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.sourceforge.net/svnroot/dist/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 Jul 11 16:58:32 CEST 2012 [metaconfig 3.5 PL0]
32 # (with additional metaconfig patches by perlbug@perl.org)
37 SCO csh still thinks true is false. Write to SCO today and tell them that next
38 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
40 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
41 we'd have to do is go in and swap the && and || tokens, wherever they are.)
43 [End of diatribe. We now return you to your regularly scheduled programming...]
47 OOPS! You naughty creature! You didn't run Configure with sh!
48 I will attempt to remedy the situation by running sh for you...
52 true || exec sh $0 $argv:q
54 (exit $?0) || cat c2$$
55 (exit $?0) || exec sh $0 $argv:q
58 if test -f /dev/cputype -a -f /dev/drivers -a -f /dev/osversion; then
61 *** I'm sorry but this system looks like Plan 9 and Plan 9 doesn't do
62 *** Configure that well. (Plan 9 is close to UNIX but not close enough.)
63 *** Please read the README.plan9 for further instructions.
64 *** Cannot continue, aborting.
70 if test ! -c /dev/null ; then
73 *** I'm sorry, but /dev/null appears to be a file rather than a device.
74 *** Please consult your operating sytem's notes for making a device
76 *** Cannot continue, aborting.
82 : compute my invocation name
86 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
91 : Proper separator for the PATH environment variable
93 : On OS/2 this directory should exist if this is not floppy only system ":-]"
94 if test -d c:/. || ( uname -a | grep -i 'os\(/\|\)2' ) 2>&1 >/dev/null ; then
95 if test -n "$OS2_SHELL"; then
97 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
98 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
100 elif test -n "$DJGPP"; then
101 case "X${MACHTYPE:-nonesuchmach}" in
108 : Proper PATH setting
109 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
110 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
111 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
112 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
113 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
114 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /opt/ansic/bin /usr/ccs/bin"
115 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
116 paths="$paths /sbin /usr/sbin /usr/libexec"
117 paths="$paths /system/gnu_library/bin"
121 case "$p_$PATH$p_" in
123 *) test -d $p && PATH=$PATH$p_$p ;;
130 : shall we be using ksh?
136 if (PATH=.; alias -x) >/dev/null 2>&1; then
139 if test -f /hp-ux -a -f /bin/ksh; then
140 needksh='to avoid sh bug in "here document" expansion'
142 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
143 if test X`/usr/bin/uname -v` = X4; then
144 avoidksh="to avoid AIX 4's /bin/sh"
148 if test -f /osf_boot -a -f /usr/sbin/setld; then
149 if test X`/usr/bin/uname -s` = XOSF1; then
150 avoidksh="to avoid Digital UNIX' ksh"
155 case "$inksh/$needksh" in
162 case "$inksh/$avoidksh" in
168 case "$inksh/$needksh-$avoidksh-" in
171 (I see you are using the Korn shell. Some ksh's blow up on $me,
172 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
179 echo "(Feeding myself to $newsh $reason.)"
181 Configure|*/Configure) exec $newsh $0 "$@";;
182 *) exec $newsh Configure "$@";;
186 test -x "${newsh}" || unset newsh
188 : if needed, set CDPATH to a harmless value that is not chatty
189 : avoid bash 2.02 problems with empty CDPATH.
193 *bash*) CDPATH='.' ;;
199 : Configure runs within the UU subdirectory
200 test -d UU || mkdir UU
340 initialinstalllocation=''
369 d_attribute_deprecated=''
370 d_attribute_format=''
371 d_attribute_malloc=''
372 d_attribute_nonnull=''
373 d_attribute_noreturn=''
375 d_attribute_unused=''
376 d_attribute_warn_unused_result=''
377 d_printf_format_null=''
380 d_builtin_choose_expr=''
383 d_c99_variadic_macros=''
430 endhostent_r_proto=''
436 endprotoent_r_proto=''
442 endservent_r_proto=''
495 gethostbyaddr_r_proto=''
497 gethostbyname_r_proto=''
499 gethostent_r_proto=''
512 getnetbyaddr_r_proto=''
514 getnetbyname_r_proto=''
528 d_getprotobyname_r=''
529 getprotobyname_r_proto=''
530 d_getprotobynumber_r=''
531 getprotobynumber_r_proto=''
533 getprotoent_r_proto=''
545 getservbyname_r_proto=''
547 getservbyport_r_proto=''
549 getservent_r_proto=''
576 d_libm_lib_version=''
579 d_localtime_r_needs_tzset=''
590 d_malloc_good_size=''
634 d_old_pthread_create_joinable=''
635 old_pthread_create_joinable=''
637 d_pthread_attr_setscope=''
676 sethostent_r_proto=''
693 setprotoent_r_proto=''
705 setservent_r_proto=''
744 d_sprintf_returns_strlen=''
756 perl_static_inline=''
761 d_stdio_ptr_lval_nochange_cnt=''
762 d_stdio_ptr_lval_sets_cnt=''
907 d_gdbm_ndbm_h_uses_prototypes=''
908 d_gdbmndbm_h_uses_prototypes=''
910 d_ndbm_h_uses_prototypes=''
985 d_inc_version_list=''
987 inc_version_list_init=''
1006 ignore_versioned_solibs=''
1070 d_perl_otherlibdirs=''
1078 api_versionstring=''
1084 version_patchlevel_string=''
1088 d_nv_preserves_uv=''
1089 d_nv_zero_is_allbits_zero=''
1100 nv_overflows_integers_at=''
1101 nv_preserves_uv_bits=''
1173 installsitehtml1dir=''
1176 installsitehtml3dir=''
1183 installsiteman1dir=''
1186 installsiteman3dir=''
1191 installsitescript=''
1208 d_stdio_stream_array=''
1209 stdio_stream_array=''
1226 usekernprocpathname=''
1227 ccflags_uselargefiles=''
1228 ldflags_uselargefiles=''
1229 libswanted_uselargefiles=''
1238 usensgetexecutablepath=''
1251 installvendorarch=''
1258 installvendorhtml1dir=''
1260 vendorhtml1direxp=''
1261 installvendorhtml3dir=''
1263 vendorhtml3direxp=''
1269 installvendorman1dir=''
1272 installvendorman3dir=''
1279 installvendorscript=''
1292 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1295 : We must find out about Eunice early
1297 if test -f /etc/unixtovms; then
1298 eunicefix=/etc/unixtovms
1300 if test -f /etc/unixtovms.exe; then
1301 eunicefix=/etc/unixtovms.exe
1304 : Set executable suffix now -- needed before hints available
1305 if test -f "/libs/version.library"; then
1308 elif test -f "/system/gnu_library/bin/ar.pm"; then
1311 elif test -n "$DJGPP"; then
1314 elif test -d c:/. -o -n "$is_os2" ; then
1321 : Trailing extension. Override this in a hint file, if needed.
1322 : Extra object files, if any, needed on this platform.
1325 : Possible local include directories to search.
1326 : Set locincpth to "" in a hint file to defeat local include searches.
1327 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1328 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1330 : no include file wanted by default
1333 : Enable -DEBUGGING and -DDEBUGGING from the command line
1338 : change the next line if compiling for Xenix/286 on Xenix/386
1339 xlibpth='/usr/lib/386 /lib/386'
1340 : Possible local library directories to search.
1341 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1342 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1344 : general looking path for locating libraries
1345 glibpth="/lib /usr/lib $xlibpth"
1346 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1347 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1348 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1349 test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
1351 : Private path used by Configure to find libraries. Its value
1352 : is prepended to libpth. This variable takes care of special
1353 : machines, like the mips. Usually, it should be empty.
1356 : default library list
1358 : some systems want to use only the non-versioned libso:s
1359 ignore_versioned_solibs=''
1360 : set usethreads on the Configure command line to enable threads.
1361 usereentrant='undef'
1362 : full support for void wanted by default
1368 : set useposix=false in your hint file to disable the POSIX extension.
1370 : set useopcode=false in your hint file to disable the Opcode extension.
1373 ccflags_uselargefiles=''
1374 ldflags_uselargefiles=''
1375 libswanted_uselargefiles=''
1376 : set usemultiplicity on the Configure command line to enable multiplicity.
1377 : set usesocks on the Configure command line to enable socks.
1378 : List of libraries we want.
1379 : If anyone needs extra -lxxx, put those in a hint file.
1380 libswanted="sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun"
1381 libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
1382 : We probably want to search /usr/shlib before most other libraries.
1383 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1384 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1385 glibpth="/usr/shlib $glibpth"
1386 : Do not use vfork unless overridden by a hint file.
1389 : Find the basic shell for Bourne shell scripts
1393 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1396 if test -f "$xxx"; then
1399 : Build up a list and do a single loop so we can 'break' out.
1400 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1401 for xxx in sh bash ksh pdksh ash; do
1403 try="$try ${p}/${xxx}"
1407 if test -f "$xxx"; then
1410 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1413 elif test -f "$xxx.exe"; then
1424 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1426 Usually it's in /bin/sh. How did you even get this far?
1427 Please contact me (Perl Maintainers) at perlbug@perl.org and
1428 we'll try to straighten this all out.
1434 : see if sh knows # comments
1435 if `$sh -c '#' >/dev/null 2>&1`; then
1439 test -f $xcat$_exe || xcat=/usr/bin/cat
1440 if test ! -f $xcat$_exe; then
1441 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1442 if test -f $p/cat$_exe; then
1447 if test ! -f $xcat$_exe; then
1448 echo "Can't find cat anywhere!"
1452 echo "#!$xcat" >sharp
1455 ./sharp > today 2>/dev/null
1456 if test -s today; then
1459 echo "#! $xcat" > sharp
1462 ./sharp > today 2>/dev/null
1463 if test -s today; then
1471 echo "Your $sh doesn't grok # comments--I will strip them later on."
1474 echo "exec grep -v '^[ ]*#'" >spitshell
1476 $eunicefix spitshell
1477 spitshell=`pwd`/spitshell
1479 echo "I presume that if # doesn't work, #! won't work either!"
1484 : figure out how to guarantee sh startup
1486 '') startsh=${sharpbang}${sh} ;;
1498 : echo "Yup, it does."
1500 echo "Hmm... '$startsh' does not guarantee sh startup..."
1501 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1505 : Save command line options in file UU/cmdline.opt for later use in
1506 : generating config.sh.
1507 cat > cmdline.opt <<EOSH
1508 : Configure command line arguments.
1517 cat >>cmdline.opt <<EOSH
1518 config_arg$argn='$arg'
1520 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1523 arg_exp=`cat cmdl.opt`
1524 args_exp="$args_exp$args_sep'$arg_exp'"
1525 argn=`expr $argn + 1`
1530 : produce awk script to parse command line options
1531 cat >options.awk <<'EOF'
1533 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1535 len = length(optstr);
1536 for (i = 1; i <= len; i++) {
1537 c = substr(optstr, i, 1);
1538 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1549 if (substr(str, 1, 1) != "-") {
1550 printf("'%s'\n", str);
1554 for (i = 2; i <= len; i++) {
1555 c = substr(str, i, 1);
1557 printf("-%s\n", substr(str, i));
1563 printf("'%s'\n", substr(str, i + 1));
1576 : process the command line options
1577 set X `for arg in "$@"; do echo "X$arg"; done |
1578 sed -e s/X// | awk -f options.awk`
1583 : set up default values
1593 rm -f optdef.sh posthint.sh
1594 cat >optdef.sh <<EOS
1600 while test $# -gt 0; do
1602 -d) shift; fastread=yes;;
1603 -e) shift; alldone=cont;;
1607 if test -r "$1"; then
1610 echo "$me: cannot read config file $1." >&2
1616 -h) shift; error=true;;
1617 -r) shift; reuseval=true;;
1618 -s) shift; silent=true; realsilent=true;;
1619 -E) shift; alldone=exit;;
1620 -K) shift; knowitall=true;;
1621 -O) shift; override=true;;
1622 -S) shift; silent=true; extractsh=true;;
1627 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1628 echo "$me: ignoring -D $1" >&2
1631 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1632 *) echo "$1='define'" >> optdef.sh;;
1639 *=) echo "$1" >> optdef.sh;;
1641 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1642 echo "$me: ignoring -U $1" >&2
1644 *) echo "$1='undef'" >> optdef.sh;;
1655 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1659 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1660 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1666 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1667 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1668 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1669 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1670 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1671 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1677 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1679 echo "$yyy=''" >> posthint.sh ;;
1684 echo "$yyy='$zzz'" >> posthint.sh ;;
1686 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1688 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1693 echo "$yyy=$zzz" >> posthint.sh ;;
1694 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1698 -V) echo "$me generated by metaconfig 3.5 PL0." >&2
1701 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1709 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1710 [-U symbol] [-U symbol=] [-A command:symbol...]
1711 -d : use defaults for all answers.
1712 -e : go on without questioning past the production of config.sh.
1713 -f : specify an alternate default configuration file.
1714 -h : print this help message and exit (with an error status).
1715 -r : reuse C symbols value if possible (skips costly nm extraction).
1716 -s : silent mode, only echoes questions and essential information.
1717 -D : define symbol to have some value:
1718 -D symbol symbol gets the value 'define'
1719 -D symbol=value symbol gets the value 'value'
1720 common used examples (see INSTALL for more info):
1721 -Duse64bitint use 64bit integers
1722 -Duse64bitall use 64bit integers and pointers
1723 -Dusethreads use thread support
1724 -Dinc_version_list=none do not include older perl trees in @INC
1725 -DEBUGGING=none DEBUGGING options
1726 -Dcc=gcc choose your compiler
1727 -Dprefix=/opt/perl5 choose your destination
1728 -E : stop at the end of questions, after having produced config.sh.
1729 -K : do not use unless you know what you are doing.
1730 -O : let -D and -U override definitions from loaded configuration file.
1731 -S : perform variable substitutions on all .SH files (can mix with -f)
1732 -U : undefine symbol:
1733 -U symbol symbol gets the value 'undef'
1734 -U symbol= symbol gets completely empty
1736 -A : manipulate symbol after the platform specific hints have been applied:
1737 -A append:symbol=value append value to symbol
1738 -A symbol=value like append:, but with a separating space
1739 -A define:symbol=value define symbol to have value
1740 -A clear:symbol define symbol to be ''
1741 -A define:symbol define symbol to be 'define'
1742 -A eval:symbol=value define symbol to be eval of value
1743 -A prepend:symbol=value prepend value to symbol
1744 -A undef:symbol define symbol to be 'undef'
1745 -A undef:symbol= define symbol to be ''
1746 e.g.: -A prepend:libswanted='cl pthread '
1747 -A ccflags=-DSOME_MACRO
1748 -V : print version number and exit (with a zero status).
1755 case "$fastread$alldone" in
1758 case "$extractsh" in
1761 if test ! -t 0; then
1762 echo "Say 'sh Configure', not 'sh <Configure'"
1772 true) exec 1>/dev/null;;
1775 : run the defines and the undefines, if any, but leave the file out there...
1778 : create the posthint manipulation script and leave the file out there...
1783 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1784 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1785 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1786 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1787 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1790 : Some greps do not return status, grrr.
1791 echo "grimblepritz" >grimble
1792 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1794 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1800 : the following should work in any shell
1804 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1805 cat >contains <<'EOSS'
1806 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1811 : Find the path to the source tree
1814 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1818 *) src=`cd ../$src && pwd` ;;
1831 if test -f $rsrc/Configure && \
1832 $contains "^package='$package'\$" $rsrc/Configure >/dev/null 2>&1
1834 : found it, so we are ok.
1837 for src in . .. ../.. ../../.. ../../../..; do
1838 if test -f ../$src/Configure && \
1839 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1850 Sorry, I can't seem to locate the source dir for $package. Please start
1851 Configure with an explicit path -- i.e. /some/path/Configure.
1859 echo "Sources for $package found in \"$src\"." >&4
1863 : script used to extract .SH files with variable substitutions
1864 cat >extract <<'EOS'
1866 echo "Doing variable substitutions on .SH files..."
1867 if test -f MANIFEST; then
1868 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1870 echo "(Looking for .SH files under the source directory.)"
1871 set x `(cd "$src"; find . -name "*.SH" -print)`
1875 0) set x `(cd "$src"; echo *.SH)`; shift;;
1877 if test ! -f "$src/$1"; then
1883 while test $name; do
1884 if test ! -d "$name"; then
1885 create="$name $create";
1886 name=`echo $name | sed -e "s|^[^/]*$||"`;
1887 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1892 for file in $create; do
1901 dir=`expr X$file : 'X\(.*\)/'`
1902 file=`expr X$file : 'X.*/\(.*\)'`
1903 (cd "$dir" && . ./$file)
1913 dir=`expr X$file : 'X\(.*\)/'`
1914 file=`expr X$file : 'X.*/\(.*\)'`
1915 (set x $dir; shift; eval $mkdir_p)
1916 sh <"$src/$dir/$file"
1925 if test -f "$src/config_h.SH"; then
1926 if test ! -f config.h; then
1927 : oops, they left it out of MANIFEST, probably, so do it anyway.
1928 . "$src/config_h.SH"
1933 : extract files and exit if asked to do so
1934 case "$extractsh" in
1936 case "$realsilent" in
1940 case "$config_sh" in
1941 '') config_sh='config.sh';;
1944 echo "Fetching answers from $config_sh..."
1947 test "$override" && . ./optdef.sh
1951 echo "Extraction done."
1956 : Eunice requires " " instead of "", can you believe it
1959 echo "Beginning of configuration questions for $package."
1961 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1963 : first determine how to suppress newline on echo command
1965 echo "Checking echo to see how to suppress newlines..."
1966 (echo "hi there\c" ; echo " ") >.echotmp
1967 if $contains c .echotmp >/dev/null 2>&1 ; then
1978 echo $n "The star should be here-->$c"
1982 : Now test for existence of everything in MANIFEST
1984 if test -f "$rsrc/MANIFEST"; then
1985 echo "First let's make sure your kit is complete. Checking..." >&4
1986 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | \
1987 (split -l 50 2>/dev/null || split -50)
1990 for filelist in x??; do
1991 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` \
1992 >/dev/null 2>>"$tmppwd/missing")
1994 if test -s missing; then
1998 THIS PACKAGE SEEMS TO BE INCOMPLETE.
2000 You have the option of continuing the configuration process, despite the
2001 distinct possibility that your kit is damaged, by typing 'y'es. If you
2002 do, don't blame me if something goes wrong. I advise you to type 'n'o
2003 and contact the author (perlbug@perl.org).
2006 echo $n "Continue? [n] $c" >&4
2010 echo "Continuing..." >&4
2014 echo "ABORTING..." >&4
2019 echo "Looks good..."
2022 echo "There is no MANIFEST file. I hope your kit is complete !"
2026 : Find the appropriate value for a newline for tr
2028 if test -n "$DJGPP"; then
2031 if test X"$trnl" = X; then
2032 case "`echo foo|tr '\n' x 2>/dev/null`" in
2036 if test X"$trnl" = X; then
2037 case "`echo foo|tr '\012' x 2>/dev/null`" in
2038 foox) trnl='\012' ;;
2041 if test X"$trnl" = X; then
2042 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
2043 fooxy) trnl='\n\r' ;;
2046 if test X"$trnl" = X; then
2049 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
2055 : compute the number of columns on the terminal for proper question formatting
2060 : set up the echo used in my read
2061 myecho="case \"\$xxxm\" in
2062 '') echo $n \"\$rp $c\" >&4;;
2064 '') echo $n \"[\$xxxm] $c\";;
2066 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
2068 echo $n \"[\$xxxm] $c\" >&4
2070 echo $n \"\$rp [\$xxxm] $c\" >&4
2076 : now set up to do reads with possible shell escape and default assignment
2082 case "\$fastread" in
2083 yes) case "\$dflt" in
2086 case "\$silent-\$rp" in
2091 *) case "\$silent" in
2092 true) case "\$rp" in
2097 while expr "X\$ans" : "X!" >/dev/null; do
2101 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2109 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2118 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2123 echo "(OK, I'll run with -d after this question.)" >&4
2126 echo "*** Sorry, \$1 not supported yet." >&4
2136 echo "*** Substitution done -- please confirm."
2138 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2143 echo "*** Error -- try again."
2150 case "\$ans\$xxxm\$nostick" in
2162 : create .config dir to save info across Configure sessions
2163 test -d ../.config || mkdir ../.config
2164 cat >../.config/README <<EOF
2165 This directory created by Configure to save information that should
2166 persist across sessions for $package.
2168 You may safely delete it if you wish.
2171 : See if we are using a devel version and want that
2172 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2175 usedevel="$define" ;;
2176 *) case "$xversion" in
2179 *** WHOA THERE!!! ***
2181 This is an UNSTABLE DEVELOPMENT release.
2182 The version of this $package distribution is $xversion, that is, odd,
2183 (as opposed to even) and that signifies a development release.
2184 If you want a maintenance release, you want an even-numbered version.
2186 Do ***NOT*** install this into production use.
2187 Data corruption and crashes are possible.
2189 It is most seriously suggested that you do not continue any further
2190 unless you want to help in developing and debugging Perl.
2192 If you *still* want to build perl, you can answer 'y' now,
2193 or pass -Dusedevel to Configure.
2196 rp='Do you really want to continue?'
2200 [yY]) echo >&4 "Okay, continuing."
2201 usedevel="$define" ;;
2202 *) echo >&4 "Okay, bye."
2213 case "$versiononly" in
2214 '') versiononly="$define" ;;
2216 case "$installusrbinperl" in
2217 '') installusrbinperl="$undef" ;;
2222 : general instructions
2225 user=`(logname) 2>/dev/null`
2227 '') user=`whoami 2>&1`;;
2229 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2232 rp='Would you like to see the instructions?'
2243 This installation shell script will examine your system and ask you questions
2244 to determine how the perl5 package should be installed. If you get
2245 stuck on a question, you may use a ! shell escape to start a subshell or
2246 execute a command. Many of the questions will have default answers in square
2247 brackets; typing carriage return will give you the default.
2249 On some of the questions which ask for file or directory names you are allowed
2250 to use the ~name construct to specify the login directory belonging to "name",
2251 even if you don't have a shell which knows about that. Questions where this is
2252 allowed will be marked "(~name ok)".
2256 dflt='Type carriage return to continue'
2260 The prompter used in this script allows you to use shell variables and
2261 backticks in your answers. You may use $1, $2, etc... to refer to the words
2262 in the default answer, as if the default line was a set of arguments given to a
2263 script shell. This means you may also use $* to repeat the whole default line,
2264 so you do not have to re-type everything to add something to the default.
2266 Every time there is a substitution, you will have to confirm. If there is an
2267 error (e.g. an unmatched backtick), the default answer will remain unchanged
2268 and you will be prompted again.
2270 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2271 the questions and use the computed defaults (or the previous answers if there
2272 was already a config.sh file). Type 'Configure -h' for a list of options.
2273 You may also start interactively and then answer '& -d' at any prompt to turn
2274 on the non-interactive behaviour for the remainder of the execution.
2280 Much effort has been expended to ensure that this shell script will run on any
2281 Unix system. If despite that it blows up on yours, your best bet is to edit
2282 Configure and run it again. If you can't run Configure for some reason,
2283 you'll have to generate a config.sh file by hand. Whatever problems you
2284 have, let me (perlbug@perl.org) know how I blew it.
2286 This installation script affects things in two ways:
2288 1) it may do direct variable substitutions on some of the files included
2290 2) it builds a config.h file for inclusion in C programs. You may edit
2291 any of these files as the need arises after running this script.
2293 If you make a mistake on a question, there is no easy way to back up to it
2294 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2295 files. Configure will offer to let you do this before it runs the SH files.
2298 dflt='Type carriage return to continue'
2300 case "$firsttime" in
2301 true) echo $user >>../.config/instruct;;
2305 : find out where common programs are
2307 echo "Locating common programs..." >&4
2320 if test -d \$dir/\$thing; then
2326 for thisthing in \$dir/\$thing; do
2327 : just loop through to pick last item
2329 if test -f \$thisthing; then
2332 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2335 elif test -f \$dir/\$thing.exe; then
2336 if test -n "$DJGPP"; then
2337 echo \$dir/\$thing.exe
2338 elif test "$eunicefix" != ":"; then
2339 : on Eunice apparently
2392 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2393 pth="$pth /lib /usr/lib"
2394 for file in $loclist; do
2398 if test -f "$xxx"; then
2401 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2402 xxx=`./loc $file $file $pth`
2405 '') xxx=`./loc $file $file $pth`;;
2406 *) xxx=`./loc $xxx $xxx $pth`;;
2408 eval $file=$xxx$_exe
2412 echo $file is in $xxx.
2415 echo $file is in $xxx.
2418 echo "I don't know where '$file' is, and my life depends on it." >&4
2419 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2425 echo "Don't worry if any of the following aren't found..."
2427 for file in $trylist; do
2431 if test -f "$xxx"; then
2434 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2435 xxx=`./loc $file $file $pth`
2438 '') xxx=`./loc $file $file $pth`;;
2439 *) xxx=`./loc $xxx $xxx $pth`;;
2441 eval $file=$xxx$_exe
2445 echo $file is in $xxx.
2448 echo $file is in $xxx.
2451 echo "I don't see $file out there, $say."
2458 echo "Substituting grep for egrep."
2465 *) if $less -R </dev/null >/dev/null; then
2466 echo "Substituting less -R for less."
2474 echo "Substituting cp for ln."
2483 echo "I can't find make or gmake, and my life depends on it." >&4
2484 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2492 *) # We can't have osname yet.
2493 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2494 # Assume that gmake, if found, is definitely GNU make
2495 # and prefer it over the system make.
2496 echo "Substituting gmake for make."
2504 echo "Hopefully test is built into your sh."
2507 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2508 echo "Using the test built into your sh."
2516 echo "Hopefully echo is built into your sh."
2521 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2522 $echo $n "hi there$c" >foo1
2523 echo $n "hi there$c" >foo2
2524 if cmp foo1 foo2 >/dev/null 2>&1; then
2525 echo "They are compatible. In fact, they may be identical."
2532 They are not compatible! You are probably running ksh on a non-USG system.
2533 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2534 have echo built in and we may have to run some Bourne shell scripts. That
2535 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2538 $echo $n "The star should be here-->$c"
2545 # This question was auctioned at YAPC::Europe-2007 in Vienna
2546 # I never promised you could answer it. I only auctioned the question.
2548 The following message is sponsored by
2550 Dresden.pm<--The stars should be here.
2552 Dear Perl user, system administrator or package
2553 maintainer, the Perl community sends greetings to
2554 you. Do you (emblematical) greet back [Y/n]? n
2558 : Check what type of C compiler we use
2562 cat <<'EOSC' >>trygcc
2567 int main(int argc, char *argv[]) {
2571 if $cc -o try $ccflags $ldflags try.c; then
2574 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2580 # Skip this test because it gives a false match on output like:
2581 # ./trygcc: line 23: cc: command not found
2582 # case "`$cc -v -c try.c 2>&1`" in
2583 # *gcc*) trygcc=no ;;
2585 if $test X"$trygcc" = Xyes; then
2586 if gcc -o try -c try.c; then
2588 echo "You seem to have a working gcc, though." >&4
2589 # Switching compilers may undo the work of hints files.
2590 # The most common problem is -D_REENTRANT for threads.
2591 # This heuristic catches that case, but gets false positives
2592 # if -Dusethreads was not actually specified. Better to
2593 # bail out here with a useful message than fail
2594 # mysteriously later. Should we perhaps just try to
2595 # re-invoke Configure -Dcc=gcc config_args ?
2596 if $test -f usethreads.cbu; then
2599 *** However, any setting of the C compiler flags (e.g. for thread support)
2600 *** will be lost. It may be necessary for you to restart Configure and
2601 *** add -Dcc=gcc to your Configure command line.
2604 rp="Would you like to go ahead and try gcc anyway?"
2607 rp="Would you like to use it?"
2610 if $test -f myread; then
2613 if $test -f UU/myread; then
2616 echo "Cannot find myread, sorry. Aborting." >&2
2621 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2634 cat <<'EOSC' >>checkcc
2639 int main(int argc, char *argv[]) {
2643 if $cc -o try $ccflags $ldflags try.c; then
2646 if $test X"$despair" = Xyes; then
2647 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2650 You need to find a working C compiler.
2651 Either (purchase and) install the C compiler supplied by your OS vendor,
2652 or for a free C compiler try http://gcc.gnu.org/
2653 I cannot continue any further, aborting.
2662 : determine whether symbolic links are supported
2665 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2666 echo "Symbolic links are supported." >&4
2669 echo "Symbolic links are NOT supported." >&4
2674 : determine whether symbolic links are supported
2678 echo "Checking how to test for symbolic links..." >&4
2680 if $test "X$issymlink" = X; then
2682 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2683 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2685 if test $? = 0; then
2688 echo "Your builtin 'test -h' may be broken." >&4
2691 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2694 if test -f "$p/$test"; then
2703 echo "Trying external '$test -h'." >&4
2704 issymlink="$test -h"
2705 if $test ! -h sym >/dev/null 2>&1; then
2706 echo "External '$test -h' is broken, too." >&4
2714 if $test "X$issymlink" = X; then
2715 if $test -L sym 2>/dev/null; then
2716 issymlink="$test -L"
2717 echo "The builtin '$test -L' worked." >&4
2720 if $test "X$issymlink" != X; then
2721 echo "You can test for symbolic links with '$issymlink'." >&4
2723 echo "I do not know how you can test for symbolic links." >&4
2727 *) echo "No symbolic links, so not testing for their testing..." >&4
2732 : Make symlinks util
2733 case "$mksymlinks" in
2736 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2739 *) case "$lns:$issymlink" in
2740 *"ln"*" -s:"*"test -"?)
2741 echo "Creating the symbolic links..." >&4
2742 echo "(First creating the subdirectories...)" >&4
2744 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2746 test -z "$directory" && break
2750 if test ! -d t/base; then
2751 echo "Failed to create the subdirectories. Aborting." >&4
2754 echo "(Then creating the symlinks...)" >&4
2755 awk '{print $1}' $src/MANIFEST | while true; do
2757 test -z "$filename" && break
2758 if test -f $filename; then
2759 if $issymlink $filename; then
2763 if test -f $filename; then
2764 echo "$filename already exists, not symlinking."
2766 ln -s $src/$filename $filename
2770 if test ! -f t/base/lex.t; then
2771 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2776 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2784 : Check for Cross-Compilation
2785 case "$usecrosscompile" in
2787 $echo "Cross-compiling..."
2790 *-*-gcc) # A cross-compiling gcc, probably.
2791 targetarch=`$echo $cc|$sed 's/-gcc$//'`
2793 # leave out ld, choosing it is more complex
2795 ranlib=$targetarch-ranlib
2796 $echo 'extern int foo;' > try.c
2797 set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
2799 if $test $# -gt 0; then
2801 incpth="`$echo $incpth|$sed 's/^ //'`"
2802 echo "Guessing incpth '$incpth'." >&4
2804 j="`$echo $i|$sed 's,/include$,/lib,'`"
2805 if $test -d $j; then
2809 libpth="`$echo $libpth|$sed 's/^ //'`"
2810 echo "Guessing libpth '$libpth'." >&4
2815 case "$targetarch" in
2816 '') echo "Targetarch not defined." >&4; croak=y ;;
2817 *) echo "Using targetarch $targetarch." >&4 ;;
2820 '') echo "Incpth not defined." >&4; croak=y ;;
2821 *) echo "Using incpth '$incpth'." >&4 ;;
2824 '') echo "Libpth not defined." >&4; croak=y ;;
2825 *) echo "Using libpth '$libpth'." >&4 ;;
2828 '') for i in $incpth; do
2829 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2831 echo "Guessing usrinc $usrinc." >&4
2836 '') echo "Usrinc not defined." >&4; croak=y ;;
2839 *) echo "Using usrinc $usrinc." >&4 ;;
2841 case "$targethost" in
2842 '') echo "Targethost not defined." >&4; croak=y ;;
2843 *) echo "Using targethost $targethost." >&4
2848 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2851 /*) run=$src/Cross/run
2852 targetmkdir=$src/Cross/mkdir
2854 from=$src/Cross/from
2856 *) pwd=`$test -f ../Configure & cd ..; pwd`
2858 targetmkdir=$pwd/Cross/mkdir
2860 from=$pwd/Cross/from
2863 case "$targetrun" in
2864 '') targetrun=ssh ;;
2869 case "$targetfrom" in
2870 '') targetfrom=scp ;;
2874 from=$from-$targetfrom
2875 case "$targetdir" in
2877 echo "Guessing targetdir $targetdir." >&4
2880 case "$targetuser" in
2882 echo "Guessing targetuser $targetuser." >&4
2885 case "$targetfrom" in
2889 case "$targetrun" in
2901 '') cwd=$targetdir ;;
2905 if $test ! -f \$exe.xok; then
2909 $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2912 *) echo "Unknown targetrun '$targetrun'" >&4
2916 case "$targetmkdir" in
2918 cat >$targetmkdir <<EOF
2920 $targetrun -l $targetuser $targethost "mkdir -p \$@"
2922 $chmod a+rx $targetmkdir
2924 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2936 $targetmkdir \`dirname \$f\`
2937 $targetto $q \$f $targetuser@$targethost:\$f || exit 1
2940 $targetmkdir $targetdir/\`dirname \$f\`
2941 $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2954 $mkdir -p $targetdir/\`dirname \$f\`
2955 $cp \$f $targetdir/\$f || exit 1
2958 $targetmkdir $targetdir/\`dirname \$f\`
2959 $cp \$f $targetdir/\$f || exit 1
2966 *) echo "Unknown targetto '$targetto'" >&4
2970 case "$targetfrom" in
2977 $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2982 cp) cat >$from <<EOF
2987 cp $targetdir/\$f . || exit 1
2992 *) echo "Unknown targetfrom '$targetfrom'" >&4
2996 if $test ! -f $run; then
2997 echo "Target 'run' script '$run' not found." >&4
3001 if $test ! -f $to; then
3002 echo "Target 'to' script '$to' not found." >&4
3006 if $test ! -f $from; then
3007 echo "Target 'from' script '$from' not found." >&4
3011 if $test ! -f $run -o ! -f $to -o ! -f $from; then
3015 Using '$run' for remote execution,
3016 and '$from' and '$to'
3017 for remote file transfer.
3023 usecrosscompile='undef'
3028 : see whether [:lower:] and [:upper:] are supported character classes
3030 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
3032 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
3036 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
3037 # (0xd9 and 0xe2), therefore that is a nice testing point.
3038 if test "X$up" = X -o "X$low" = X; then
3039 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
3045 if test "X$up" = X -o "X$low" = X; then
3046 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
3052 if test "X$up" = X -o "X$low" = X; then
3053 case "`echo RS | od -x 2>/dev/null`" in
3055 echo "Hey, this might be EBCDIC." >&4
3056 if test "X$up" = X -o "X$low" = X; then
3057 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
3058 rs) up='[A-IJ-RS-Z]'
3063 if test "X$up" = X -o "X$low" = X; then
3064 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
3074 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
3076 echo "Using $up and $low to convert case." >&4
3079 echo "I don't know how to translate letters from upper to lower case." >&4
3080 echo "Your tr is not acting any way I know of." >&4
3084 : set up the translation script tr, must be called with ./tr of course
3088 '[A-Z][a-z]') exec $tr '$up' '$low';;
3089 '[a-z][A-Z]') exec $tr '$low' '$up';;
3096 : Try to determine whether config.sh was made on this system
3097 case "$config_sh" in
3099 myuname=`$uname -a 2>/dev/null`
3100 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
3101 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
3102 # because the A-Z/a-z are not consecutive.
3103 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e "s,['/],,g" | \
3104 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
3105 newmyuname="$myuname"
3107 case "$knowitall" in
3109 if test -f ../config.sh; then
3110 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3111 eval "`grep myuname= ../config.sh`"
3113 if test "X$myuname" = "X$newmyuname"; then
3121 : Get old answers from old config file if Configure was run on the
3122 : same system, otherwise use the hints.
3125 if test -f config.sh; then
3127 rp="I see a config.sh file. Shall I use it to set the defaults?"
3130 n*|N*) echo "OK, I'll ignore it."
3131 mv config.sh config.sh.old
3132 myuname="$newmyuname"
3134 *) echo "Fetching default answers from your old config.sh file..." >&4
3142 : Older versions did not always set $sh. Catch re-use of such
3152 if test ! -f config.sh; then
3155 First time through, eh? I have some defaults handy for some systems
3156 that need some extra help getting the Configure answers right:
3159 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3161 : Half the following guesses are probably wrong... If you have better
3162 : tests or hints, please send them to perlbug@perl.org
3163 : The metaconfig authors would also appreciate a copy...
3164 $test -f /irix && osname=irix
3165 $test -f /xenix && osname=sco_xenix
3166 $test -f /dynix && osname=dynix
3167 $test -f /dnix && osname=dnix
3168 $test -f /lynx.os && osname=lynxos
3169 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3170 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3171 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3172 $test -f /bin/mips && /bin/mips && osname=mips
3173 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
3174 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
3175 $test -d /usr/apollo/bin && osname=apollo
3176 $test -f /etc/saf/_sactab && osname=svr4
3177 $test -d /usr/include/minix && osname=minix
3178 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3179 if $test -d /MachTen -o -d /MachTen_Folder; then
3181 if $test -x /sbin/version; then
3182 osvers=`/sbin/version | $awk '{print $2}' |
3183 $sed -e 's/[A-Za-z]$//'`
3184 elif $test -x /usr/etc/version; then
3185 osvers=`/usr/etc/version | $awk '{print $2}' |
3186 $sed -e 's/[A-Za-z]$//'`
3192 $test -f /sys/posix.dll &&
3193 $test -f /usr/bin/what &&
3194 set X `/usr/bin/what /sys/posix.dll` &&
3195 $test "$3" = UWIN &&
3199 if $test -f $uname; then
3207 umips) osname=umips ;;
3210 [23]100) osname=mips ;;
3211 next*) osname=next ;;
3213 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3214 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3217 elif $test -f /etc/kconfig; then
3219 if test "$lns" = "$ln -s"; then
3221 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3223 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3230 if test -n "$DJGPP"; then
3239 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3241 # oslevel can fail with:
3242 # oslevel: Unable to acquire lock.
3243 *not\ found) osvers="$4"."$3" ;;
3244 '<3240'|'<>3240') osvers=3.2.0 ;;
3245 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3246 '=3250'|'>3250') osvers=3.2.5 ;;
3250 bsd386) osname=bsd386
3253 cygwin*) osname=cygwin
3256 *dc.osx) osname=dcosx
3262 domainos) osname=apollo
3268 dragonfly) osname=dragonfly
3271 dynixptx*) osname=dynixptx
3272 osvers=`echo "$4"|sed 's/^v//'`
3274 freebsd) osname=freebsd
3276 genix) osname=genix ;;
3280 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3296 netbsd*) osname=netbsd
3299 news-os) osvers="$3"
3301 4*) osname=newsos4 ;;
3305 next*) osname=next ;;
3306 nonstop-ux) osname=nonstopux ;;
3307 openbsd) osname=openbsd
3313 POSIX-BC | posix-bc ) osname=posix-bc
3316 powerux | power_ux | powermax_os | powermaxos | \
3317 powerunix | power_unix) osname=powerux
3323 solaris) osname=solaris
3325 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3332 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3336 titanos) osname=titanos
3345 ultrix) osname=ultrix
3348 osf1|mls+) case "$5" in
3351 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3354 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3357 hp*) osname=hp_osf1 ;;
3358 mips) osname=mips_osf1 ;;
3361 # UnixWare 7.1.2 is known as Open UNIX 8
3362 openunix|unixware) osname=svr5
3370 $2) case "$osname" in
3374 : svr4.x or possibly later
3384 if test -f /stand/boot ; then
3385 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3386 if test -n "$INITPROG" -a -f "$INITPROG"; then
3387 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3388 if test -n "$isesix"; then
3396 *) if test -f /etc/systemid; then
3398 set `echo $3 | $sed 's/\./ /g'` $4
3399 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3401 elif $test -f $src/hints/sco_$1_$2.sh; then
3403 elif $test -f $src/hints/sco_$1.sh; then
3408 '') : Still unknown. Probably a generic Sys V.
3417 *) case "$osname" in
3418 '') : Still unknown. Probably a generic BSD.
3426 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3427 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3428 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3431 $rm -f UU/kernel.what
3432 elif test -d c:/. -o -n "$is_os2" ; then
3439 case "$targetarch" in
3442 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3447 : Now look for a hint file osname_osvers, unless one has been
3448 : specified already.
3451 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3452 : Also try without trailing minor version numbers.
3453 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3454 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3455 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3456 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3459 *) case "$osvers" in
3462 *) if $test -f $src/hints/$file.sh ; then
3464 elif $test -f $src/hints/$xfile.sh ; then
3466 elif $test -f $src/hints/$xxfile.sh ; then
3468 elif $test -f $src/hints/$xxxfile.sh ; then
3470 elif $test -f $src/hints/$xxxxfile.sh ; then
3472 elif $test -f "$src/hints/${osname}.sh" ; then
3481 if $test -f Policy.sh ; then
3484 none) dflt="Policy" ;;
3485 *) dflt="Policy $dflt" ;;
3490 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3494 if $test -f Policy.sh ; then
3497 There's also a Policy hint file available, which should make the
3498 site-specific (policy) questions easier to answer.
3505 You may give one or more space-separated answers, or "none" if appropriate.
3506 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3507 previous run of Configure, you may specify it as well as or instead of
3508 OS-specific hints. If hints are provided for your OS, you should use them:
3509 although Perl can probably be built without hints on many platforms, using
3510 hints often improve performance and may enable features that Configure can't
3511 set up on its own. If there are no hints that match your OS, specify "none";
3512 DO NOT give a wrong version or a wrong OS.
3516 rp="Which of these apply, if any?"
3519 for file in $tans; do
3520 if $test X$file = XPolicy -a -f Policy.sh; then
3522 $cat Policy.sh >> UU/config.sh
3523 elif $test -f $src/hints/$file.sh; then
3524 . $src/hints/$file.sh
3525 $cat $src/hints/$file.sh >> UU/config.sh
3526 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3529 : Give one chance to correct a possible typo.
3530 echo "$file.sh does not exist"
3532 rp="hint to use instead?"
3534 for file in $ans; do
3535 if $test -f "$src/hints/$file.sh"; then
3536 . $src/hints/$file.sh
3537 $cat $src/hints/$file.sh >> UU/config.sh
3538 elif $test X$ans = X -o X$ans = Xnone ; then
3541 echo "$file.sh does not exist -- ignored."
3548 : Remember our hint file for later.
3549 if $test -f "$src/hints/$file.sh" ; then
3559 echo "Fetching default answers from $config_sh..." >&4
3563 cp $config_sh config.sh 2>/dev/null
3573 test "$override" && . ./optdef.sh
3575 : Restore computed paths
3576 for file in $loclist $trylist; do
3577 eval $file="\$_$file"
3582 Configure uses the operating system name and version to set some defaults.
3583 The default value is probably right if the name rings a bell. Otherwise,
3584 since spelling matters for me, either accept the default or answer "none"
3591 ''|' '|none) dflt=none ;;
3592 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3595 *) dflt="$osname" ;;
3597 rp="Operating system name?"
3601 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3607 ''|' '|none) dflt=none ;;
3608 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3609 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3611 ''|' ') dflt=none ;;
3616 *) dflt="$osvers" ;;
3618 rp="Operating system version?"
3628 : who configured the system
3629 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3632 cf_by=`(logname) 2>/dev/null`
3635 cf_by=`(whoami) 2>/dev/null`
3637 "") cf_by=unknown ;;
3642 : decide how portable to be. Allow command line overrides.
3643 case "$d_portable" in
3645 *) d_portable="$define" ;;
3648 : set up shell script to do ~ expansion
3654 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3657 if $test -f /bin/csh; then
3658 /bin/csh -f -c "glob \$1"
3663 name=\`$expr x\$1 : '..\([^/]*\)'\`
3664 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3665 if $test ! -d "\$dir"; then
3667 echo "\$me: can't locate home directory for: \$name" >&2
3672 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3688 : now set up to get a file name
3692 cat <<'EOSC' >>getfile
3708 : getfile will accept an answer from the comma-separated list
3709 : enclosed in parentheses even if it does not meet other criteria.
3710 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3711 fn=`echo $fn | sed 's/(.*)//'`
3717 loc_file=`expr $fn : '.*:\(.*\)'`
3718 fn=`expr $fn : '\(.*\):.*'`
3726 */*) fullpath=true;;
3735 *e*) exp_file=true;;
3738 *p*) nopath_ok=true;;
3743 *d*) type='Directory';;
3744 *l*) type='Locate';;
3749 Locate) what='File';;
3754 case "$d_portable" in
3762 while test "$type"; do
3767 true) rp="$rp (~name ok)";;
3770 if test -f UU/getfile.ok && \
3771 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3790 value=`UU/filexp $ans`
3793 if test "$ans" != "$value"; then
3794 echo "(That expands to $value on this system.)"
3808 /*) value="$ansexp" ;;
3809 [a-zA-Z]:/*) value="$ansexp" ;;
3814 echo "I shall only accept a full path name, as in /bin/ls." >&4
3815 echo "Use a ! shell escape if you wish to check pathnames." >&4
3818 echo "Please give a full path name, starting with slash." >&4
3821 echo "Note that using ~name is ok provided it expands well." >&4
3834 for fp in $gfpth; do
3835 if test "X$fp" = X.; then
3840 if test -f "$pf"; then
3842 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3844 echo "($value is not a plain file, but that's ok.)"
3847 if test X"$type" = X; then
3854 for fp in $gfpth; do
3855 if test "X$fp" = X.; then
3860 direxp="$fp/$ansexp"
3862 if test -d "$direxp"; then
3870 if test -d "$ansexp"; then
3871 echo "(Looking for $loc_file in directory $value.)"
3872 value="$value/$loc_file"
3873 ansexp="$ansexp/$loc_file"
3875 if test -f "$ansexp"; then
3878 case "$nopath_ok" in
3879 true) case "$value" in
3881 *) echo "Assuming $value will be in people's path."
3897 if test "$fastread" = yes; then
3902 rp="$what $value doesn't exist. Use that name anyway?"
3921 test "X$gfpthkeep" != Xy && gfpth=""
3924 : determine root of directory hierarchy where package will be installed.
3927 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
3930 dflt=`echo "$prefix" | sed 's/.$//'`
3938 By default, $package will be installed in $dflt/bin, manual pages
3939 under $dflt/man, etc..., i.e. with $dflt as prefix for all
3940 installation directories. Typically this is something like /usr/local.
3941 If you wish to have binaries under /usr/bin but other parts of the
3942 installation under /usr/local, that's ok: you will be prompted
3943 separately for each of the installation directories, the prefix being
3944 only used to set the defaults.
3948 rp='Installation prefix to use?'
3956 *) oldprefix="$prefix";;
3963 : allow them to override the AFS root
3966 *) afsroot=$afsroot ;;
3972 $define|true) afs=true ;;
3973 $undef|false) afs=false ;;
3974 *) if $test -d $afsroot; then
3982 echo "AFS may be running... I'll be extra cautious then..." >&4
3984 echo "AFS does not seem to be running..." >&4
3987 : determine installation prefix for where package is to be installed.
3991 Since you are running AFS, I need to distinguish the directory in which
3992 files will reside from the directory in which they are installed (and from
3993 which they are presumably copied to the former directory by occult means).
3996 case "$installprefix" in
3997 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
3998 *) dflt="$installprefix";;
4003 In some special cases, particularly when building $package for distribution,
4004 it is convenient to distinguish the directory in which files should be
4005 installed from the directory ($prefix) in which they will
4006 eventually reside. For most users, these two directories are the same.
4009 case "$installprefix" in
4011 *) dflt=$installprefix;;
4015 rp='What installation prefix should I use for installing files?'
4017 installprefix="$ans"
4018 installprefixexp="$ansexp"
4020 : Perform the prefixexp/installprefixexp correction if necessary
4021 cat <<EOS >installprefix
4024 cat <<'EOSC' >>installprefix
4025 : Change installation prefix, if necessary.
4026 if $test X"$prefix" != X"$installprefix"; then
4027 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
4029 eval "install${prefixvar}=\"\$${prefixvar}exp\""
4032 chmod +x installprefix
4033 $eunicefix installprefix
4035 : Set variables such as privlib and privlibexp from the output of ./getfile
4036 : performing the prefixexp/installprefixexp correction if necessary.
4037 cat <<EOS >setprefixvar
4040 cat <<'EOSC' >>setprefixvar
4041 eval "${prefixvar}=\"\$ans\""
4042 eval "${prefixvar}exp=\"\$ansexp\""
4045 chmod +x setprefixvar
4046 $eunicefix setprefixvar
4048 : set up the script used to warn in case of inconsistency
4057 '') echo "The $hint value for \$$var on this machine was \"$was\"!" >&4
4059 *) echo "Hmm. Based on the hints in hints/$hintfile.sh, " >&4
4060 echo "the $hint value for \$$var on this machine was \"$was\"!" >&4
4065 echo "*** WHOA THERE!!! ***" >&4
4066 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
4069 rp=" Keep the $hint value?"
4072 y) td=$was; tu=$was;;
4076 : function used to set '$1' to '$val'
4077 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
4079 $define$undef) . ./whoa; eval "$var=\$td";;
4080 $undef$define) . ./whoa; eval "$var=\$tu";;
4081 *) eval "$var=$val";;
4084 : get the patchlevel
4086 echo "Getting the current patchlevel..." >&4
4087 if $test -r $rsrc/patchlevel.h;then
4088 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
4089 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4090 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4091 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4092 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4093 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4094 perl_patchlevel=`egrep ',"(MAINT|SMOKE)[0-9][0-9]*"' $rsrc/patchlevel.h|tail -1|sed 's/[^0-9]//g'`
4103 $echo "(You do not have patchlevel.h. Eek.)"
4105 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
4106 version_patchlevel_string="version $patchlevel subversion $subversion"
4107 case "$perl_patchlevel" in
4109 *) perl_patchlevel=`echo $perl_patchlevel | sed 's/.* //'`
4110 version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel"
4114 $echo "(You have $package $version_patchlevel_string.)"
4118 : XXX Should be a Configure test for double-dots in filenames.
4119 version=`echo $revision $patchlevel $subversion | \
4120 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4121 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4122 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4125 version=`echo $revision $patchlevel $subversion | \
4126 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4127 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4128 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4131 : Special case the 5.005_xx maintenance series, which used 5.005
4132 : without any subversion label as a subdirectory in $sitelib
4133 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4134 api_versionstring='5.005'
4137 : Do we want threads support and if so, what type
4138 case "$usethreads" in
4139 $define|true|[yY]*) dflt='y';;
4140 *) # Catch case where user specified ithreads or 5005threads but
4141 # forgot -Dusethreads (A.D. 4/2002)
4142 case "$useithreads$use5005threads" in
4143 *$define*) dflt='y';;
4150 Perl can be built to take advantage of threads on some systems.
4151 To do so, Configure can be run with -Dusethreads.
4153 Note that Perl built with threading support runs slightly slower
4154 and uses more memory than plain Perl. The current implementation
4155 is believed to be stable, but it is fairly new, and so should be
4156 treated with caution.
4158 If this doesn't make any sense to you, just accept the default '$dflt'.
4160 rp='Build a threading Perl?'
4163 y|Y) val="$define" ;;
4169 if $test $patchlevel -lt 9; then
4170 case "$usethreads" in
4174 Since release 5.6, Perl has had two different threading implementations,
4175 the newer interpreter-based version (ithreads) with one interpreter per
4176 thread, and the older 5.005 version (5005threads).
4177 The 5005threads version is effectively unmaintained and will probably be
4178 removed in Perl 5.10, so there should be no need to build a Perl using it
4179 unless needed for backwards compatibility with some existing 5.005threads
4183 : Default to ithreads unless overridden on command line or with
4186 case "$use5005threads" in
4187 $define|true|[yY]*) dflt='n';;
4189 case "$useithreads" in
4190 $undef|false|[nN]*) dflt='n';;
4192 rp='Use the newer interpreter-based ithreads?'
4195 y|Y) val="$define" ;;
4200 : Now set use5005threads to the opposite value.
4201 case "$useithreads" in
4202 $define) val="$undef" ;;
4209 useithreads="$undef"
4210 use5005threads="$undef"
4214 case "$useithreads$use5005threads" in
4218 You cannot have both the ithreads and the 5.005 threads enabled
4219 at the same time. Disabling the 5.005 threads since they are
4220 much less stable than the ithreads.
4223 use5005threads="$undef"
4228 : perl-5.9.x and later
4230 if test X"$usethreads" = "X$define"; then
4231 case "$use5005threads" in
4235 5.005 threads has been removed for 5.10. Perl will be built using ithreads.
4242 use5005threads="$undef"
4243 useithreads="$usethreads"
4246 case "$d_oldpthreads" in
4247 '') : Configure tests would be welcome here. For now, assume undef.
4249 *) val="$d_oldpthreads" ;;
4255 : Look for a hint-file generated 'call-back-unit'. If the
4256 : user has specified that a threading perl is to be built,
4257 : we may need to set or change some other defaults.
4258 if $test -f usethreads.cbu; then
4259 echo "Your platform has some specific hints regarding threaded builds, using them..."
4262 case "$usethreads" in
4263 "$define"|true|[yY]*)
4265 (Your platform does not have any specific hints for threaded builds.
4266 Assuming POSIX threads, then.)
4272 : Check if multiplicity is required
4275 Perl can be built so that multiple Perl interpreters can coexist
4276 within the same Perl executable.
4279 case "$useithreads" in
4282 This multiple interpreter support is required for interpreter-based threads.
4286 *) case "$usemultiplicity" in
4287 $define|true|[yY]*) dflt='y';;
4291 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4292 rp='Build Perl for multiplicity?'
4295 y|Y) val="$define" ;;
4303 : Check if morebits is requested
4304 case "$usemorebits" in
4305 "$define"|true|[yY]*)
4306 use64bitint="$define"
4307 uselongdouble="$define"
4308 usemorebits="$define"
4310 *) usemorebits="$undef"
4314 : Determine the C compiler to be used
4320 rp="Use which C compiler?"
4324 : See whether they have no cc but they do have gcc
4326 if $test -f cc.cbu; then
4331 : make some quick guesses about what we are up against
4333 $echo $n "Hmm... $c"
4343 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
4344 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
4346 echo "Looks kind of like an OSF/1 system, but we'll see..."
4348 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4349 xxx=`./loc addbib blurfl $pth`
4350 if $test -f $xxx; then
4351 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4355 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4356 echo "Looks kind of like an extended USG system, but we'll see..."
4358 echo "Looks kind of like a USG system, but we'll see..."
4362 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4363 echo "Looks kind of like a BSD system, but we'll see..."
4367 echo "Looks kind of like a Version 7 system, but we'll see..."
4370 case "$eunicefix" in
4373 There is, however, a strange, musty smell in the air that reminds me of
4374 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4378 : it so happens the Eunice I know will not run shell scripts in Unix format
4382 echo "Congratulations. You aren't running Eunice."
4386 : Detect OS2. The p_ variable is set above in the Head.U unit.
4387 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4388 : semicolon as a patch separator
4393 I have the feeling something is not exactly right, however...don't tell me...
4394 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4395 (Or you may be running DOS with DJGPP.)
4400 if test -f /xenix; then
4401 echo "Actually, this looks more like a XENIX system..."
4406 echo "It's not Xenix..."
4411 if test -f /venix; then
4412 echo "Actually, this looks more like a VENIX system..."
4419 echo "Nor is it Venix..."
4422 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4423 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4426 : Check if we are using GNU gcc and what its version is
4428 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4432 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4434 printf("%s\n", __VERSION__);
4436 printf("%s\n", "1");
4442 if $cc -o try $ccflags $ldflags try.c; then
4443 gccversion=`$run ./try`
4444 case "$gccversion" in
4445 '') echo "You are not using GNU cc." ;;
4446 *) echo "You are using GNU cc $gccversion."
4452 echo "*** WHOA THERE!!! ***" >&4
4453 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4454 case "$knowitall" in
4456 echo " You'd better start hunting for one and let me know about it." >&4
4462 case "$gccversion" in
4463 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4465 case "$gccversion" in
4466 '') gccosandvers='' ;;
4467 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4468 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4470 case "$gccosandvers" in
4471 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4472 $osname$osvers) ;; # looking good
4473 $osname*) cat <<EOM >&4
4475 *** WHOA THERE!!! ***
4477 Your gcc has not been compiled for the exact release of
4478 your operating system ($gccosandvers versus $osname$osvers).
4480 In general it is a good idea to keep gcc synchronized with
4481 the operating system because otherwise serious problems
4482 may ensue when trying to compile software, like Perl.
4484 I'm trying to be optimistic here, though, and will continue.
4485 If later during the configuration and build icky compilation
4486 problems appear (headerfile conflicts being the most common
4487 manifestation), I suggest reinstalling the gcc to match
4488 your operating system release.
4492 *) gccosandvers='' ;; # failed to parse, better be silent
4500 # gcc 3.* complain about adding -Idirectories that they already know about,
4501 # so we will take those off from locincpth.
4502 case "$gccversion" in
4504 echo "main(){}">try.c
4505 for incdir in $locincpth; do
4506 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4507 grep '^c[cp]p*[01]: warning: changing search order '`
4508 if test "X$warn" != X; then
4509 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4515 : What should the include directory be ?
4517 $echo $n "Hmm... $c"
4521 if $test -f /bin/mips && /bin/mips; then
4522 echo "Looks like a MIPS system..."
4523 $cat >usr.c <<'EOCP'
4524 #ifdef SYSTYPE_BSD43
4528 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4529 dflt='/bsd43/usr/include'
4533 mips_type='System V'
4535 $rm -f usr.c usr.out
4536 echo "and you're compiling with the $mips_type compiler and libraries."
4540 echo "Doesn't look like a MIPS system."
4550 case "$xxx_prompt" in
4553 rp='Where are the include files you want to use?'
4561 : see how we invoke the C preprocessor
4563 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4564 cat <<'EOT' >testcpp.c
4570 if test ! -f cppstdin; then
4571 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4572 # AIX cc -E doesn't show the absolute headerfile
4573 # locations but we'll cheat by using the -M flag.
4574 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
4576 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4579 echo "Keeping your $hint cppstdin wrapper."
4582 wrapper=`pwd`/cppstdin
4586 if $test "X$cppstdin" != "X" && \
4587 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4588 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4590 echo "You used to use $cppstdin $cppminus so we'll use that again."
4592 '') echo "But let's see if we can live without a wrapper..." ;;
4594 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4595 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4597 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4600 echo "(However, $cpprun $cpplast does not work, let's see...)"
4608 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4615 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4616 $cc -E <testcpp.c >testcpp.out 2>&1; \
4617 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4618 echo "Yup, it does."
4621 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4622 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4623 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4624 echo "Yup, it does."
4627 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4628 $cc -P <testcpp.c >testcpp.out 2>&1; \
4629 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4630 echo "Yipee, that works!"
4633 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4634 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4635 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4636 echo "At long last!"
4639 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4640 $cpp <testcpp.c >testcpp.out 2>&1; \
4641 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4645 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4646 $cpp - <testcpp.c >testcpp.out 2>&1; \
4647 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4648 echo "Hooray, it works! I was beginning to wonder."
4651 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4652 $wrapper <testcpp.c >testcpp.out 2>&1; \
4653 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4659 rp="No dice. I can't find a C preprocessor. Name one:"
4663 $x_cpp <testcpp.c >testcpp.out 2>&1
4664 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4665 echo "OK, that will do." >&4
4667 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4682 echo "Perhaps can we force $cc -E using a wrapper..."
4683 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4684 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4690 echo "Nope, we'll have to live without it..."
4704 "$wrapper"|'cppstdin') ;;
4705 *) $rm -f $wrapper;;
4707 $rm -f testcpp.c testcpp.out
4709 : Set private lib path
4712 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4717 '') dlist="$loclibpth $plibpth $glibpth";;
4718 *) dlist="$libpth";;
4721 : Now check and see which directories actually exist, avoiding duplicates
4725 if $test -d $xxx; then
4728 *) libpth="$libpth $xxx";;
4734 Some systems have incompatible or broken versions of libraries. Among
4735 the directories listed in the question below, please remove any you
4736 know not to be holding relevant libraries, and add any that are needed.
4737 Say "none" for none.
4748 rp="Directories to use for library searches?"
4755 : compute shared library extension
4758 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4768 On some systems, shared libraries may be available. Answer 'none' if
4769 you want to suppress searching of shared libraries for the remainder
4770 of this configuration.
4773 rp='What is the file extension used for shared libraries?'
4777 : Define several unixisms.
4778 : Hints files or command line option can be used to override them.
4779 : The convoluted testing is in case hints files set either the old
4782 '') case "$exe_ext" in
4784 *) _exe="$exe_ext" ;;
4789 '') case "$lib_ext" in
4796 '') case "$obj_ext" in
4803 '') case "$path_sep" in
4814 rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
4816 : Which makefile gets called first. This is used by make depend.
4817 case "$firstmakefile" in
4818 '') firstmakefile='makefile';;
4821 : Check is we will use socks
4823 $define|true|[yY]*) dflt='y';;
4828 Perl can be built to use the SOCKS proxy protocol library. To do so,
4829 Configure must be run with -Dusesocks. If you use SOCKS you also need
4830 to use the PerlIO abstraction layer, this will be implicitly selected.
4832 If this doesn't make any sense to you, just accept the default '$dflt'.
4834 rp='Build Perl for SOCKS?'
4837 y|Y) val="$define" ;;
4843 : Check for uselongdouble support
4845 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
4848 case "$uselongdouble" in
4849 $define|true|[yY]*) dflt='y';;
4854 Perl can be built to take advantage of long doubles which
4855 (if available) may give more accuracy and range for floating point numbers.
4857 If this doesn't make any sense to you, just accept the default '$dflt'.
4859 rp='Try to use long doubles if available?'
4862 y|Y) val="$define" ;;
4868 case "$uselongdouble" in
4869 true|[yY]*) uselongdouble="$define" ;;
4872 : Look for a hint-file generated 'call-back-unit'. If the
4873 : user has specified that long doubles should be used,
4874 : we may need to set or change some other defaults.
4875 if $test -f uselongdouble.cbu; then
4876 echo "Your platform has some specific hints regarding long doubles, using them..."
4877 . ./uselongdouble.cbu
4879 case "$uselongdouble" in
4882 (Your platform does not have any specific hints for long doubles.)
4888 : Looking for optional libraries
4890 echo "Checking for optional libraries..." >&4
4895 case "$libswanted" in
4896 '') libswanted='c_s';;
4899 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4905 for thisdir in $libpth $xlibpth; do
4906 test -d $thisdir && libspath="$libspath $thisdir"
4908 for thislib in $libswanted; do
4909 for thisdir in $libspath; do
4911 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4912 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
4913 $test -f "$xxx" && eval $libscheck
4914 $test -f "$xxx" && libstyle=shared
4916 if test ! -f "$xxx"; then
4917 xxx=$thisdir/lib$thislib.$so
4918 $test -f "$xxx" && eval $libscheck
4919 $test -f "$xxx" && libstyle=shared
4921 if test ! -f "$xxx"; then
4922 xxx=$thisdir/lib$thislib$_a
4923 $test -f "$xxx" && eval $libscheck
4924 $test -f "$xxx" && libstyle=static
4926 if test ! -f "$xxx"; then
4927 xxx=$thisdir/$thislib$_a
4928 $test -f "$xxx" && eval $libscheck
4929 $test -f "$xxx" && libstyle=static
4931 if test ! -f "$xxx"; then
4932 xxx=$thisdir/lib${thislib}_s$_a
4933 $test -f "$xxx" && eval $libscheck
4934 $test -f "$xxx" && libstyle=static
4935 $test -f "$xxx" && thislib=${thislib}_s
4937 if test ! -f "$xxx"; then
4938 xxx=$thisdir/Slib$thislib$_a
4939 $test -f "$xxx" && eval $libscheck
4940 $test -f "$xxx" && libstyle=static
4942 if $test -f "$xxx"; then
4944 shared) echo "Found -l$thislib (shared)." ;;
4945 static) echo "Found -l$thislib." ;;
4946 *) echo "Found -l$thislib ($libstyle)." ;;
4950 *) dflt="$dflt -l$thislib"
4951 libsfound="$libsfound $xxx"
4953 libsfiles="$libsfiles $yyy"
4954 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
4955 case " $libsdirs " in
4957 *) libsdirs="$libsdirs $yyy" ;;
4964 if $test ! -f "$xxx"; then
4965 echo "No -l$thislib."
4976 ' '|'') dflt='none';;
4981 In order to compile $package on your machine, a number of libraries
4982 are usually needed. Include any other special libraries here as well.
4983 Say "none" for none. The default list is almost always right.
4987 rp="What libraries to use?"
4994 : determine optimization, if desired, or use for debug flag also
4996 ' '|$undef) dflt='none';;
4998 *) dflt="$optimize";;
5002 By default, $package compiles with the -O flag to use the optimizer.
5003 Alternately, you might want to use the symbolic debugger, which uses
5004 the -g flag (on traditional Unix systems). Either flag can be
5005 specified here. To use neither flag, specify the word "none".
5008 rp="What optimizer/debugger flag should be used?"
5012 'none') optimize=" ";;
5015 : Check what DEBUGGING is required from the command line
5016 : -DEBUGGING or -DDEBUGGING or
5017 : -DEBUGGING=both = -g + -DDEBUGGING
5018 : -DEBUGGING=-g or -Doptimize=-g = -g
5019 : -DEBUGGING=none or -UDEBUGGING =
5020 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
5023 *) DEBUGGING=$EBUGGING ;;
5026 case "$DEBUGGING" in
5030 *) optimize="$optimize -g" ;;
5034 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
5042 case "$DEBUGGING" in
5043 both|$define) dflt='-DDEBUGGING'
5046 : argument order is deliberate, as the flag will start with - which set could
5047 : think is an option
5048 checkccflag='check=$1; flag=$2; callback=$3;
5050 echo "Checking if your compiler accepts $flag" 2>&1;
5051 echo "int main(void) { return 0; }" > gcctest.c;
5052 if $cc -O2 $flag -o gcctest gcctest.c 2>gcctest.out && ./gcctest; then
5053 echo "Yes, it does." 2>&1;
5054 if $test -s gcctest.out ; then
5055 echo "But your platform does not like it:";
5060 echo "Leaving current flags $ccflags alone." 2>&1
5062 *) dflt="$dflt $flag";
5068 echo "Nope, it does not, but that is ok." 2>&1;
5072 : We will not override a previous value, but we might want to
5073 : augment a hint file
5075 default|recommended)
5076 case "$gccversion" in
5077 1*) dflt="$dflt -fpcc-struct-return" ;;
5079 case "$optimize:$DEBUGGING" in
5080 *-g*:old) dflt="$dflt -DDEBUGGING";;
5082 case "$gccversion" in
5083 2*) if $test -d /etc/conf/kconfig.d &&
5084 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
5086 # Interactive Systems (ISC) POSIX mode.
5091 case "$gccversion" in
5094 ?*) set strict-aliasing -fno-strict-aliasing
5098 # For gcc, adding -pipe speeds up compilations for some, but apparently
5099 # some assemblers can't read from stdin. (It also slows down compilations
5100 # in other cases, but those are apparently rarer these days.) AD 5/2004.
5101 case "$gccversion" in
5107 # on x86_64 (at least) we require an extra library (libssp) in the
5108 # link command line. This library is not named, so I infer that it is
5109 # an implementation detail that may change. Hence the safest approach
5110 # is to add the flag to the flags passed to the compiler at link time,
5111 # as that way the compiler can do the right implementation dependant
5113 case "$gccversion" in
5114 ?*) set stack-protector -fstack-protector
5121 case "$mips_type" in
5122 *BSD*|'') inclwanted="$locincpth $usrinc";;
5123 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
5125 for thisincl in $inclwanted; do
5126 if $test -d $thisincl; then
5127 if $test x$thisincl != x$usrinc; then
5129 *" -I$thisincl "*);;
5130 *) dflt="$dflt -I$thisincl ";;
5136 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
5138 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5146 *) dflt="$dflt -D$2";;
5150 set signal.h LANGUAGE_C; eval $inctest
5154 ccflags="$ccflags -DSOCKS"
5159 default|recommended) dflt="$ccflags $dflt" ;;
5160 *) dflt="$ccflags";;
5169 Your C compiler may want other flags. For this question you should include
5170 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5171 but you should NOT include libraries or ld flags like -lwhatever. If you
5172 want $package to honor its debug switch, you should include -DDEBUGGING here.
5173 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5175 To use no flags, specify the word "none".
5181 rp="Any additional cc flags?"
5188 : the following weeds options from ccflags that are of no interest to cpp
5190 '') cppflags="$ccflags" ;;
5191 *) cppflags="$cppflags $ccflags" ;;
5193 case "$gccversion" in
5194 1*) cppflags="$cppflags -D__GNUC__"
5196 case "$mips_type" in
5198 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5204 echo "Let me guess what the preprocessor flags are..." >&4
5218 *) ftry="$previous $flag";;
5220 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5221 >cpp1.out 2>/dev/null && \
5222 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5223 >cpp2.out 2>/dev/null && \
5224 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5225 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5227 cppflags="$cppflags $ftry"
5237 *-*) echo "They appear to be: $cppflags";;
5239 $rm -f cpp.c cpp?.out
5243 : flags used in final linking phase
5245 '') if ./venix; then
5251 *-posix*) dflt="$dflt -posix" ;;
5254 *) dflt="$ldflags";;
5256 # See note above about -fstack-protector
5258 *-fstack-protector*)
5260 *-fstack-protector*) ;; # Don't add it again
5261 *) dflt="$dflt -fstack-protector" ;;
5266 : Try to guess additional flags to pick up local libraries.
5267 for thislibdir in $libpth; do
5268 case " $loclibpth " in
5271 *"-L$thislibdir "*) ;;
5272 *) dflt="$dflt -L$thislibdir" ;;
5284 Your C linker may need flags. For this question you should
5285 include -L/whatever and any other flags used by the C linker, but you
5286 should NOT include libraries like -lwhatever.
5288 Make sure you include the appropriate -L/path flags if your C linker
5289 does not normally search all of the directories you specified above,
5292 To use no flags, specify the word "none".
5296 rp="Any additional ld flags (NOT including libraries)?"
5302 rmlist="$rmlist pdp11"
5306 echo "Checking your choice of C compiler and flags for coherency..." >&4
5307 $cat > try.c <<'EOF'
5309 int main() { printf("Ok\n"); return(0); }
5311 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5313 $cat >try.msg <<'EOM'
5314 I've tried to compile and run the following simple program:
5317 $cat try.c >> try.msg
5319 $cat >> try.msg <<EOM
5326 and I got the following output:
5330 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5331 if $sh -c "$run ./try " >>try.msg 2>&1; then
5335 *) echo 'The program compiled OK, but produced no output.' >> try.msg
5338 cat >> try.msg <<'EOQS'
5339 If $libs contains -lsfio, and sfio is mis-configured, then it
5340 sometimes (apparently) runs and exits with a 0 status, but with no
5341 output! It may have to do with sfio's use of _exit vs. exit.
5344 rp="You have a big problem. Shall I abort Configure"
5351 echo "The program compiled OK, but exited with status $?." >>try.msg
5352 rp="You have a problem. Shall I abort Configure"
5356 echo "I can't compile the test program." >>try.msg
5357 rp="You have a BIG problem. Shall I abort Configure"
5363 case "$knowitall" in
5365 echo "(The supplied flags or libraries might be incorrect.)"
5373 *) echo "Ok. Stopping Configure." >&4
5378 n) echo "OK, that should do.";;
5380 $rm_try gcctest gcctest.out
5382 : define a shorthand compile call
5386 case "$usedevel" in $define|true|[yY]*) if $test ! -f "${mc_file}.c"; then
5387 echo "Internal Configure script bug - compiler test file ${mc_file}.c is missing. Please report this to perlbug@perl.org" >&4;
5391 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5392 : define a shorthand compile call for compilations that should be ok.
5396 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5398 : determine filename position in cpp output
5400 echo "Computing filename position in cpp output for #include directives..." >&4
5402 vos) testaccess=-e ;;
5405 echo '#include <stdio.h>' > foo.c
5408 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5409 $grep '^[ ]*#.*stdio\.h' | \
5410 while read cline; do
5413 while $test \$# -gt 0; do
5414 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5419 pos=\`expr \$pos + 1\`
5431 *) pos="${fieldn}th";;
5433 echo "Your cpp writes the filename in the $pos field of the line."
5436 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
5437 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
5440 : locate header file
5445 for usrincdir in $usrinc
5447 if test -f \$usrincdir/\$wanted; then
5448 echo "\$usrincdir/\$wanted"
5452 awkprg='{ print \$$fieldn }'
5453 echo "#include <\$wanted>" > foo\$\$.c
5454 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5455 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5456 while read cline; do
5457 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5459 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5460 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5465 # status = 0: grep returned 0 lines, case statement not executed
5466 # status = 1: headerfile found
5467 # status = 2: while loop executed, no headerfile found
5471 if test \$status -eq 1; then
5478 : define an alternate in-header-list? function
5479 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5480 cont=true; xxf="echo \"<\$1> found.\" >&4";
5481 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5482 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5484 case $# in 4) instead=instead;; *) instead="at last";; esac;
5485 while $test "$cont"; do
5487 var=$2; eval "was=\$$2";
5488 if $test "$xxx" && $test -r "$xxx";
5490 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5493 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5494 set $yyy; shift; shift; yyy=$@;
5495 case $# in 0) cont="";;
5496 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5497 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5498 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5499 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5503 do set $yyy; var=$2; eval "was=\$$2";
5504 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5505 set $yyy; shift; shift; yyy=$@;
5508 : see if stdlib is available
5509 set stdlib.h i_stdlib
5512 : check for lengths of integral types
5516 echo "Checking to see how big your integers are..." >&4
5525 printf("intsize=%d;\n", (int)sizeof(int));
5526 printf("longsize=%d;\n", (int)sizeof(long));
5527 printf("shortsize=%d;\n", (int)sizeof(short));
5532 if eval $compile_ok && $run ./try > /dev/null; then
5534 echo "Your integers are $intsize bytes long."
5535 echo "Your long integers are $longsize bytes long."
5536 echo "Your short integers are $shortsize bytes long."
5540 Help! I can't compile and run the intsize test program: please enlighten me!
5541 (This is probably a misconfiguration in your system or libraries, and
5542 you really ought to fix it. Still, I'll try anyway.)
5546 rp="What is the size of an integer (in bytes)?"
5550 rp="What is the size of a long integer (in bytes)?"
5554 rp="What is the size of a short integer (in bytes)?"
5562 : check for long long
5564 echo "Checking to see if you have long long..." >&4
5565 echo 'int main() { long long x = 7; return 0; }' > try.c
5567 if eval $compile; then
5569 echo "You have long long."
5572 echo "You do not have long long."
5578 : check for length of long long
5579 case "${d_longlong}${longlongsize}" in
5582 echo "Checking to see how big your long longs are..." >&4
5583 $cat >try.c <<'EOCP'
5587 printf("%d\n", (int)sizeof(long long));
5592 if eval $compile_ok; then
5593 longlongsize=`$run ./try`
5594 echo "Your long longs are $longlongsize bytes long."
5598 echo "(I can't seem to compile the test program. Guessing...)"
5599 rp="What is the size of a long long (in bytes)?"
5603 if $test "X$longsize" = "X$longlongsize"; then
5604 echo "(That isn't any different from an ordinary long.)"
5610 : see if inttypes.h is available
5611 : we want a real compile instead of Inhdr because some systems
5612 : have an inttypes.h which includes non-existent headers
5615 #include <inttypes.h>
5617 static int32_t foo32 = 0x12345678;
5621 if eval $compile; then
5622 echo "<inttypes.h> found." >&4
5625 echo "<inttypes.h> NOT found." >&4
5634 echo "Checking to see if you have int64_t..." >&4
5636 #include <sys/types.h>
5637 #$i_inttypes I_INTTYPES
5639 #include <inttypes.h>
5641 int main() { int64_t x = 7; }
5644 if eval $compile; then
5646 echo "You have int64_t."
5649 echo "You do not have int64_t."
5655 : Check if 64bit ints have a quad type
5657 echo "Checking which 64-bit integer type we could use..." >&4
5663 val='"unsigned int"'
5668 *) case "$longsize" in
5672 val='"unsigned long"'
5677 *) case "$d_longlong:$longlongsize" in
5682 val='"unsigned long long"'
5687 *) case "$d_int64_t" in
5706 '') echo "Alas, no 64-bit integer types in sight." >&4
5709 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5714 : Do we want 64bit support
5715 case "$uselonglong" in
5716 "$define"|true|[yY]*)
5719 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5721 use64bitint="$define"
5724 case "$use64bits" in
5725 "$define"|true|[yY]*)
5728 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5730 use64bitint="$define"
5733 case "$use64bitints" in
5734 "$define"|true|[yY]*)
5737 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5739 use64bitint="$define"
5742 case "$use64bitsint" in
5743 "$define"|true|[yY]*)
5746 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5748 use64bitint="$define"
5751 case "$uselonglongs" in
5752 "$define"|true|[yY]*)
5755 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5757 use64bitint="$define"
5760 case "$use64bitsall" in
5761 "$define"|true|[yY]*)
5764 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
5766 use64bitall="$define"
5771 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
5773 case "$use64bitall" in
5774 "$define"|true|[yY]*) use64bitint="$define" ;;
5780 You have natively 64-bit long integers.
5784 *) case "$use64bitint" in
5785 "$define"|true|[yY]*) dflt='y';;
5794 Perl can be built to take advantage of 64-bit integer types
5795 on some systems. To do so, Configure can be run with -Duse64bitint.
5796 Choosing this option will most probably introduce binary incompatibilities.
5798 If this doesn't make any sense to you, just accept the default '$dflt'.
5799 (The default has been chosen based on your configuration.)
5801 rp='Try to use 64-bit integers, if available?'
5804 [yY]*) val="$define" ;;
5812 case "$use64bitall" in
5813 "$define"|true|[yY]*) dflt='y' ;;
5814 *) case "$longsize" in
5822 You may also choose to try maximal 64-bitness. It means using as much
5823 64-bitness as possible on the platform. This in turn means even more
5824 binary incompatibilities. On the other hand, your platform may not
5825 have any more 64-bitness available than what you already have chosen.
5827 If this doesn't make any sense to you, just accept the default '$dflt'.
5828 (The default has been chosen based on your configuration.)
5830 rp='Try to use maximal 64-bit support, if available?'
5833 [yY]*) val="$define" ;;
5838 case "$use64bitall" in
5840 case "$use64bitint" in
5844 Since you have chosen a maximally 64-bit build, I'm also turning on
5845 the use of 64-bit integers.
5847 use64bitint="$define" ;;
5852 : Look for a hint-file generated 'call-back-unit'. If the
5853 : user has specified that a 64-bit perl is to be built,
5854 : we may need to set or change some other defaults.
5855 if $test -f use64bitint.cbu; then
5856 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
5859 case "$use64bitint" in
5860 "$define"|true|[yY]*)
5862 4) case "$archname64" in
5863 '') archname64=64int ;;
5870 : Look for a hint-file generated 'call-back-unit'. If the
5871 : user has specified that a maximally 64-bit perl is to be built,
5872 : we may need to set or change some other defaults.
5873 if $test -f use64bitall.cbu; then
5874 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
5877 case "$use64bitall" in
5878 "$define"|true|[yY]*)
5880 4) case "$archname64" in
5881 ''|64int) archname64=64all ;;
5888 case "$d_quad:$use64bitint" in
5892 *** You have chosen to use 64-bit integers,
5893 *** but none can be found.
5894 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
5895 *** Cannot continue, aborting.
5902 : check for length of double
5904 case "$doublesize" in
5906 echo "Checking to see how big your double precision numbers are..." >&4
5915 printf("%d\n", (int)sizeof(double));
5920 if eval $compile_ok; then
5921 doublesize=`$run ./try`
5922 echo "Your double is $doublesize bytes long."
5925 echo "(I can't seem to compile the test program. Guessing...)"
5926 rp="What is the size of a double precision number (in bytes)?"
5934 : check for long doubles
5936 echo "Checking to see if you have long double..." >&4
5937 echo 'int main() { long double x = 7.0; }' > try.c
5939 if eval $compile; then
5941 echo "You have long double."
5944 echo "You do not have long double."
5950 : check for length of long double
5951 case "${d_longdbl}${longdblsize}" in
5954 echo "Checking to see how big your long doubles are..." >&4
5955 $cat >try.c <<'EOCP'
5959 printf("%d\n", sizeof(long double));
5964 if eval $compile; then
5965 longdblsize=`$run ./try`
5966 echo "Your long doubles are $longdblsize bytes long."
5970 echo "(I can't seem to compile the test program. Guessing...)" >&4
5971 rp="What is the size of a long double (in bytes)?"
5975 if $test "X$doublesize" = "X$longdblsize"; then
5976 echo "That isn't any different from an ordinary double."
5977 echo "I'll keep your setting anyway, but you may see some"
5978 echo "harmless compilation warnings."
5984 : determine the architecture name
5986 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
5987 tarch=`arch`"-$osname"
5988 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
5989 if uname -m > tmparch 2>&1 ; then
5990 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
5991 -e 's/$/'"-$osname/" tmparch`
5999 case "$myarchname" in
6002 echo "(Your architecture name used to be $myarchname.)"
6006 case "$targetarch" in
6008 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
6013 *) dflt="$archname";;
6015 rp='What is your architecture name'
6018 case "$usethreads" in
6020 echo "Threads selected." >&4
6022 *-thread*) echo "...and architecture name already has -thread." >&4
6024 *) archname="$archname-thread"
6025 echo "...setting architecture name to $archname." >&4
6030 case "$usemultiplicity" in
6032 echo "Multiplicity selected." >&4
6034 *-multi*) echo "...and architecture name already has -multi." >&4
6036 *) archname="$archname-multi"
6037 echo "...setting architecture name to $archname." >&4
6042 case "$use64bitint$use64bitall" in
6044 case "$archname64" in
6046 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
6049 case "$use64bitint" in
6050 "$define") echo "64 bit integers selected." >&4 ;;
6052 case "$use64bitall" in
6053 "$define") echo "Maximal 64 bitness selected." >&4 ;;
6056 *-$archname64*) echo "...and architecture name already has $archname64." >&4
6058 *) archname="$archname-$archname64"
6059 echo "...setting architecture name to $archname." >&4
6065 case "$uselongdouble" in
6067 echo "Long doubles selected." >&4
6068 case "$longdblsize" in
6070 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
6074 *-ld*) echo "...and architecture name already has -ld." >&4
6076 *) archname="$archname-ld"
6077 echo "...setting architecture name to $archname." >&4
6084 if $test -f archname.cbu; then
6085 echo "Your platform has some specific hints for architecture name, using them..."
6089 : set the prefixit variable, to compute a suitable default value
6090 prefixit='case "$3" in
6092 case "$oldprefix" in
6093 "") eval "$1=\"\$$2\"";;
6100 ""|" ") eval "$1=\"\$$2\"";;
6106 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
6108 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
6109 /*-$oldprefix/*|\~*-$oldprefix/*)
6110 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
6111 *) eval "$1=\"\$$2\"";;
6115 : determine installation style
6116 : For now, try to deduce it from prefix unless it is already set.
6117 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
6118 case "$installstyle" in
6119 '') case "$prefix" in
6120 *perl*) dflt='lib';;
6121 *) dflt='lib/perl5' ;;
6124 *) dflt="$installstyle" ;;
6126 : Probably not worth prompting for this since we prompt for all
6127 : the directories individually, and the prompt would be too long and
6131 : determine where public executables go
6136 rp='Pathname where the public executables will reside?'
6138 if $test "X$ansexp" != "X$binexp"; then
6142 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6143 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
6144 : this via initialinstalllocation
6147 case "$userelocatableinc" in
6148 $define|true|[yY]*) dflt='y' ;;
6153 Would you like to build Perl so that the installation is relocatable, so that
6154 library paths in @INC are determined relative to the path of the perl binary?
6155 This is not advised for system Perl installs, or if you need to run setid
6156 scripts or scripts under taint mode.
6158 If this doesn't make any sense to you, just accept the default '$dflt'.
6160 rp='Use relocatable @INC?'
6163 y|Y) val="$define" ;;
6166 set userelocatableinc
6169 initialinstalllocation="$binexp"
6170 : Default prefix is now "up one level from where the binaries are"
6171 case "$userelocatableinc" in
6177 installprefixexp=".../.."
6181 : determine where private library files go
6182 : Usual default is /usr/local/lib/perl5/$version.
6183 : Also allow things like /opt/perl/lib/$version, since
6184 : /opt/perl/lib/perl5... would be redundant.
6185 : The default "style" setting is made in installstyle.U
6186 case "$installstyle" in
6187 *lib/perl5*) set dflt privlib lib/$package/$version ;;
6188 *) set dflt privlib lib/$version ;;
6193 There are some auxiliary files for $package that need to be put into a
6194 private library directory that is accessible by everyone.
6199 rp='Pathname where the private library files will reside?'
6204 : set the prefixup variable, to restore leading tilda escape
6205 prefixup='case "$prefixexp" in
6207 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
6210 : determine where public architecture dependent libraries go
6213 : privlib default is /usr/local/lib/$package/$version
6214 : archlib default is /usr/local/lib/$package/$version/$archname
6215 : privlib may have an optional trailing /share.
6216 tdflt=`echo $privlib | $sed 's,/share$,,'`
6217 tdflt=$tdflt/$archname
6226 $spackage contains architecture-dependent library files. If you are
6227 sharing libraries in a heterogeneous environment, you might store
6228 these files in a separate location. Otherwise, you can just include
6229 them with the rest of the public library files.
6234 rp='Where do you want to put the public architecture-dependent libraries?'
6238 if $test X"$archlib" = X"$privlib"; then
6244 : see if setuid scripts can be secure
6247 Some kernels have a bug that prevents setuid #! scripts from being
6248 secure. Some sites have disabled setuid #! scripts because of this.
6250 First let's decide if your kernel supports secure setuid #! scripts.
6251 (If setuid #! scripts would be secure but have been disabled anyway,
6252 don't say that they are secure if asked.)
6257 if $test -d /dev/fd; then
6258 echo "#!$ls" >reflect
6259 chmod +x,u+s reflect
6260 ./reflect >flect 2>&1
6261 if $contains "/dev/fd" flect >/dev/null; then
6262 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6266 If you are not sure if they are secure, I can check but I'll need a
6267 username and password different from the one you are using right now.
6268 If you don't have such a username or don't want me to test, simply
6272 rp='Other username to test security of setuid scripts with?'
6277 case "$d_suidsafe" in
6278 '') echo "I'll assume setuid scripts are *not* secure." >&4
6281 echo "Well, the $hint value is *not* secure." >&4
6283 *) echo "Well, the $hint value *is* secure." >&4
6288 $rm -f reflect flect
6289 echo "#!$ls" >reflect
6290 chmod +x,u+s reflect
6293 echo '"su" will (probably) prompt you for '"$ans's password."
6294 su $ans -c './reflect >flect'
6295 if $contains "/dev/fd" flect >/dev/null; then
6296 echo "Okay, it looks like setuid scripts are secure." >&4
6299 echo "I don't think setuid scripts are secure." >&4
6304 rp='Does your kernel have *secure* setuid scripts?'
6307 [yY]*) val="$define";;
6312 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6313 echo "(That's for file descriptors, not floppy disks.)"
6319 $rm -f reflect flect
6321 : now see if they want to do setuid emulation
6322 if $test $patchlevel -lt 11; then
6325 case "$d_suidsafe" in
6328 echo "No need to emulate SUID scripts since they are secure here." >&4
6332 Some systems have disabled setuid scripts, especially systems where
6333 setuid scripts cannot be secure. On systems where setuid scripts have
6334 been disabled, the setuid/setgid bits on scripts are currently
6335 useless. It is possible for $package to detect those bits and emulate
6336 setuid/setgid in a secure fashion. This emulation will only work if
6337 setuid scripts have been disabled in your kernel.
6341 "$define") dflt=y ;;
6344 rp="Do you want to do setuid/setgid emulation?"
6347 [yY]*) val="$define";;
6359 SUID emulation has been removed for 5.12
6360 Please re-run Configure without -Dd_dosuid
6369 : Find perl5.005 or later.
6370 echo "Looking for a previously installed perl5.005 or later... "
6372 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
6373 : Check if this perl is recent and can load a simple module
6374 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6377 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6387 '') echo "None found. That's ok.";;
6388 *) echo "Using $perl5." ;;
6391 : Set the siteprefix variables
6394 After $package is installed, you may wish to install various
6395 add-on modules and utilities. Typically, these add-ons will
6396 be installed under $prefix with the rest
6397 of this package. However, you may wish to install such add-ons
6398 elsewhere under a different prefix.
6400 If you do not wish to put everything under a single prefix, that's
6401 ok. You will be prompted for the individual locations; this siteprefix
6402 is only used to suggest the defaults.
6404 The default should be fine for most people.
6408 rp='Installation prefix to use for add-on modules and utilities?'
6409 : XXX Here might be another good place for an installstyle setting.
6410 case "$siteprefix" in
6412 *) dflt=$siteprefix ;;
6415 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6417 case "$siteprefix" in
6421 *) oldsiteprefix="$prefix";;
6426 siteprefixexp="$ansexp"
6428 : determine where site specific libraries go.
6429 : Usual default is /usr/local/lib/perl5/site_perl/$version
6430 : The default "style" setting is made in installstyle.U
6431 : XXX No longer works with Prefixit stuff.
6432 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6434 '') case "$installstyle" in
6435 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6436 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6444 The installation process will create a directory for
6445 site-specific extensions and modules. Most users find it convenient
6446 to place all site-specific files in this directory rather than in the
6447 main distribution directory.
6451 rp='Pathname for the site-specific library files?'
6455 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6457 : Determine list of previous versions to include in @INC
6458 $cat > getverlist <<EOPL
6461 \$api_versionstring = "$api_versionstring";
6462 \$version = "$version";
6463 \$stem = "$sitelib_stem";
6464 \$archname = "$archname";
6466 $cat >> getverlist <<'EOPL'
6467 # The list found is store twice for each entry: the original name, and
6468 # the binary broken down version as pack "sss", so sorting is easy and
6469 # unambiguous. This will work for all versions that have a maximum of
6470 # three digit groups, separate by '.'s or '_'s. Names are extended with
6471 # ".0.0" to ensure at least three elements for the pack.
6472 # -- H.Merijn Brand (m)'06 23-10-2006
6474 # Can't have leading @ because metaconfig interprets it as a command!
6475 ;@inc_version_list=();
6476 # XXX Redo to do opendir/readdir?
6479 ;@candidates = map {
6480 [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
6481 ;@candidates = sort { $a->[1] cmp $b->[1]} @candidates;
6487 ($pversion, $aversion, $vsn5005) = map {
6488 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
6489 foreach $d (@candidates) {
6490 if ($d->[1] lt $pversion) {
6491 if ($d->[1] ge $aversion) {
6492 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
6494 elsif ($d->[1] ge $vsn5005) {
6495 unshift(@inc_version_list, grep { -d } $d->[0]);
6499 # Skip newer version. I.e. don't look in
6500 # 5.7.0 if we're installing 5.6.1.
6504 if (@inc_version_list) {
6505 print join(' ', @inc_version_list);
6508 # Blank space to preserve value for next Configure run.
6513 case "$inc_version_list" in
6514 '') if test -x "$perl5$exe_ext"; then
6515 dflt=`$perl5 getverlist`
6520 $undef) dflt='none' ;;
6521 *) eval dflt=\"$inc_version_list\" ;;
6524 ''|' ') dflt=none ;;
6531 In order to ease the process of upgrading, this version of perl
6532 can be configured to use modules built and installed with earlier
6533 versions of perl that were installed under $prefix. Specify here
6534 the list of earlier versions that this version of perl should check.
6535 If Configure detected no earlier versions of perl installed under
6536 $prefix, then the list will be empty. Answer 'none' to tell perl
6537 to not search earlier versions.
6539 The default should almost always be sensible, so if you're not sure,
6540 just accept the default.
6543 rp='List of earlier versions to include in @INC?'
6546 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
6547 *) inc_version_list="$ans" ;;
6549 case "$inc_version_list" in
6551 inc_version_list_init='0'
6552 d_inc_version_list="$undef"
6554 *) inc_version_list_init=`echo $inc_version_list |
6555 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6556 d_inc_version_list="$define"
6561 : see if malloc/malloc.h has to be included
6562 set malloc/malloc.h i_mallocmalloc
6565 : see if this is a malloc.h system
6566 : we want a real compile instead of Inhdr because some systems have a
6567 : malloc.h that just gives a compile error saying to use stdlib.h instead
6572 #$i_mallocmalloc I_MALLOCMALLOC
6573 #ifdef I_MALLOCMALLOC
6574 # include <malloc/malloc.h>
6577 int main () { return 0; }
6580 if eval $compile; then
6581 echo "<malloc.h> found." >&4
6584 echo "<malloc.h> NOT found." >&4
6591 : check for void type
6593 echo "Checking to see how well your C compiler groks the void type..." >&4
6594 case "$voidflags" in
6606 extern void moo(); /* function returning void */
6607 void (*goo)(); /* ptr to func returning void */
6609 void *hue; /* generic ptr */
6622 int main() { sub(); }
6624 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
6625 voidflags=$defvoidused
6626 echo "Good. It appears to support void to the level $package wants.">&4
6627 if $contains warning .out >/dev/null 2>&1; then
6628 echo "However, you might get some warnings that look like this:"
6632 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
6633 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
6634 echo "It supports 1..."
6635 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
6636 echo "It also supports 2..."
6637 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
6639 echo "And it supports 4 but not 8 definitely."
6641 echo "It doesn't support 4..."
6642 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
6644 echo "But it supports 8."
6647 echo "Neither does it support 8."
6651 echo "It does not support 2..."
6652 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
6654 echo "But it supports 4 and 8."
6656 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
6658 echo "And it supports 4 but has not heard about 8."
6660 echo "However it supports 8 but not 4."
6665 echo "There is no support at all for void."
6670 case "$voidflags" in
6673 Support flag bits are:
6674 1: basic void declarations.
6675 2: arrays of pointers to functions returning void.
6676 4: operations between pointers to and addresses of void functions.
6677 8: generic void pointers.
6680 rp="Your void support flags add up to what?"
6687 : check for length of pointer
6691 echo "Checking to see how big your pointers are..." >&4
6692 if test "$voidflags" -gt 7; then
6693 echo '#define VOID_PTR char *' > try.c
6695 echo '#define VOID_PTR void *' > try.c
6705 printf("%d\n", (int)sizeof(VOID_PTR));
6710 if eval $compile_ok; then
6711 ptrsize=`$run ./try`
6712 echo "Your pointers are $ptrsize bytes long."
6715 echo "(I can't seem to compile the test program. Guessing...)" >&4
6716 rp="What is the size of a pointer (in bytes)?"
6723 case "$use64bitall" in
6724 "$define"|true|[yY]*)
6728 *** You have chosen a maximally 64-bit build,
6729 *** but your pointers are only 4 bytes wide.
6730 *** Please rerun Configure without -Duse64bitall.
6735 *** Since you have quads, you could possibly try with -Duse64bitint.
6740 *** Cannot continue, aborting.
6751 : determine whether to use malloc wrapping
6753 case "$usemallocwrap" in
6754 [yY]*|true|$define) dflt='y' ;;
6755 [nN]*|false|$undef) dflt='n' ;;
6756 *) case "$usedevel" in
6757 [yY]*|true|$define) dflt='y' ;;
6762 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
6764 usemallocwrap="$ans"
6767 usemallocwrap="$define" ;;
6769 usemallocwrap="$undef" ;;
6772 : determine which malloc to compile in
6774 case "$usemymalloc" in
6775 [yY]*|true|$define) dflt='y' ;;
6776 [nN]*|false|$undef) dflt='n' ;;
6777 *) case "$ptrsize" in
6781 if test "$useithreads" = "$define"; then dflt='n'; fi
6784 rp="Do you wish to attempt to use the malloc that comes with $package?"
6790 mallocsrc='malloc.c'
6791 mallocobj="malloc$_o"
6792 d_mymalloc="$define"
6795 : Remove malloc from list of libraries to use
6796 echo "Removing unneeded -lmalloc from library list" >&4
6797 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6800 echo "libs = $libs" >&4
6812 : compute the return types of malloc and free
6814 $cat >malloc.c <<END
6818 #include <sys/types.h>
6832 case "$malloctype" in
6834 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6841 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6845 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6852 echo "Your system uses $freetype free(), it would seem." >&4
6854 : determine where site specific architecture-dependent libraries go.
6855 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6856 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6857 : sitelib may have an optional trailing /share.
6859 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6860 dflt="$dflt/$archname"
6865 set sitearch sitearch none
6869 The installation process will also create a directory for
6870 architecture-dependent site-specific extensions and modules.
6874 rp='Pathname for the site-specific architecture-dependent library files?'
6878 if $test X"$sitearch" = X"$sitelib"; then
6881 d_sitearch="$define"
6884 : Set the vendorprefix variables
6887 The installation process will also create a directory for
6888 vendor-supplied add-ons. Vendors who supply perl with their system
6889 may find it convenient to place all vendor-supplied files in this
6890 directory rather than in the main distribution directory. This will
6891 ease upgrades between binary-compatible maintenance versions of perl.
6893 Of course you may also use these directories in whatever way you see
6894 fit. For example, you might use them to access modules shared over a
6895 company-wide network.
6897 The default answer should be fine for most people.
6898 This causes further questions about vendor add-ons to be skipped
6899 and no vendor-specific directories will be configured for perl.
6902 rp='Do you want to configure vendor-specific add-on directories?'
6903 case "$usevendorprefix" in
6904 define|true|[yY]*) dflt=y ;;
6905 *) : User may have set vendorprefix directly on Configure command line.
6906 case "$vendorprefix" in
6915 rp='Installation prefix to use for vendor-supplied add-ons?'
6916 case "$vendorprefix" in
6918 *) dflt=$vendorprefix ;;
6921 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6923 case "$vendorprefix" in
6927 *) oldvendorprefix="$prefix";;
6931 usevendorprefix="$define"
6933 vendorprefixexp="$ansexp"
6935 *) usevendorprefix="$undef"
6941 : Set the vendorlib variables
6942 case "$vendorprefix" in
6943 '') d_vendorlib="$undef"
6947 *) d_vendorlib="$define"
6948 : determine where vendor-supplied modules go.
6949 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
6950 case "$vendorlib" in
6952 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6953 case "$installstyle" in
6954 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
6955 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
6958 *) dflt="$vendorlib"
6962 rp='Pathname for the vendor-supplied library files?'
6965 vendorlibexp="$ansexp"
6968 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
6972 : Set the vendorarch variables
6973 case "$vendorprefix" in
6974 '') d_vendorarch="$undef"
6978 *) d_vendorarch="$define"
6979 : determine where vendor-supplied architecture-dependent libraries go.
6980 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
6981 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
6982 : vendorlib may have an optional trailing /share.
6983 case "$vendorarch" in
6984 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
6985 dflt="$dflt/$archname"
6987 *) dflt="$vendorarch" ;;
6990 rp='Pathname for vendor-supplied architecture-dependent files?'
6993 vendorarchexp="$ansexp"
6996 prefixvar=vendorarch
6998 if $test X"$vendorarch" = X"$vendorlib"; then
6999 d_vendorarch="$undef"
7001 d_vendorarch="$define"
7004 : Final catch-all directories to search
7007 Lastly, you can have perl look in other directories for extensions and
7008 modules in addition to those already specified.
7009 These directories will be searched after
7013 test X"$vendorlib" != "X" && echo ' ' $vendorlib
7014 test X"$vendorarch" != "X" && echo ' ' $vendorarch
7016 case "$otherlibdirs" in
7017 ''|' ') dflt='none' ;;
7018 *) dflt="$otherlibdirs" ;;
7021 Enter a colon-separated set of extra paths to include in perl's @INC
7022 search path, or enter 'none' for no extra paths.
7026 rp='Colon-separated list of additional directories for perl to search?'
7029 ' '|''|none) otherlibdirs=' ' ;;
7030 *) otherlibdirs="$ans" ;;
7032 case "$otherlibdirs" in
7036 set d_perl_otherlibdirs
7039 : Cruising for prototypes
7041 echo "Checking out function prototypes..." >&4
7042 $cat >prototype.c <<EOCP
7047 int main(int argc, char *argv[]) {
7050 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
7051 echo "Your C compiler appears to support function prototypes."
7054 echo "Your C compiler doesn't seem to understand function prototypes."
7061 : Check if ansi2knr is required
7062 case "$prototype" in
7064 *) ansi2knr='ansi2knr'
7069 This version of $package can only be compiled by a compiler that
7070 understands function prototypes. Unfortunately, your C compiler
7072 doesn't seem to understand them. Sorry about that.
7074 If GNU cc is available for your system, perhaps you could try that instead.
7076 Eventually, we hope to support building Perl with pre-ANSI compilers.
7077 If you would like to help in that effort, please contact <perlbug@perl.org>.
7079 Aborting Configure now.
7086 dflt_dtrace='/usr/sbin/dtrace'
7087 $test -x /usr/bin/dtrace && dflt_dtrace='/usr/bin/dtrace'
7091 Perl can be built to support DTrace on platforms that support it.
7092 DTrace is a diagnosis and performance analysis tool from Sun.
7094 If this doesn't make any sense to you, just accept the default '$dflt'.
7098 case "$usedtrace" in
7104 dflt_dtrace=$usedtrace
7111 rp='Support DTrace if available?'
7114 y|Y) val="$define" ;;
7120 test "X$usedtrace" != "X$define" && break
7123 rp='Where is the dtrace executable?'
7132 if $dtrace -h -s ../perldtrace.d \
7133 -o perldtrace.tmp >/dev/null 2>&1 \
7134 && rm -f perldtrace.tmp
7137 echo "Good: your $dtrace knows about the -h flag."
7141 *** $me: Fatal Error: $dtrace doesn't support -h flag
7143 *** Your installed dtrace doesn't support the -h switch to compile a D
7144 *** program into a C header. Can't continue.
7156 *** $me: Fatal Error: $dtrace not found.
7163 echo "*** $dtrace was not found."
7169 : See if we want extra modules installed
7176 Perl can be built with extra modules or bundles of modules which
7177 will be fetched from the CPAN and installed alongside Perl.
7179 Notice that you will need access to the CPAN; either via the Internet,
7180 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
7181 be asked later to configure the CPAN.pm module which will in turn do
7182 the installation of the rest of the extra modules or bundles.)
7184 Notice also that if the modules require any external software such as
7185 libraries and headers (the libz library and the zlib.h header for the
7186 Compress::Zlib module, for example) you MUST have any such software
7187 already installed, this configuration process will NOT install such
7190 If this doesn't make any sense to you, just accept the default '$dflt'.
7192 rp='Install any extra modules (y or n)?'
7198 Please list any extra modules or bundles to be installed from CPAN,
7199 with spaces between the names. The names can be in any format the
7200 'install' command of CPAN.pm will understand. (Answer 'none',
7201 without the quotes, to install no extra modules or bundles.)
7211 $rm -f ../extras.lst
7213 *) echo "(Saving the list of extras for later...)"
7214 echo "$extras" > ../extras.lst
7222 : determine where html pages for programs go
7223 set html1dir html1dir none
7227 If you wish to install html files for programs in $spackage, indicate
7228 the appropriate directory here. To skip installing html files,
7232 ''|none|$undef|' ') dflt=none ;;
7233 *) dflt=$html1dir ;;
7236 rp="Directory for the main $spackage html pages?"
7240 : Use ' ' for none so value is preserved next time through Configure
7241 $test X"$html1dir" = "X" && html1dir=' '
7243 : determine where html pages for libraries and modules go
7244 set html3dir html3dir none
7248 If you wish to install html files for modules associated with $spackage,
7249 indicate the appropriate directory here. To skip installing html files,
7252 : There is no obvious default. If they have specified html1dir, then
7253 : try to key off that, possibly changing .../html1 into .../html3.
7255 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
7256 *) dflt=$html3dir ;;
7259 rp="Directory for the $spackage module html pages?"
7263 : Use ' ' for none so value is preserved next time through Configure
7264 $test X"$html3dir" = "X" && html3dir=' '
7266 : determine whether to install perl also as /usr/bin/perl
7269 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
7271 Many scripts expect perl to be installed as /usr/bin/perl.
7273 If you want to, I can install the perl you are about to compile
7274 as /usr/bin/perl (in addition to $bin/perl).
7276 if test -f /usr/bin/perl; then
7279 However, please note that because you already have a /usr/bin/perl,
7280 overwriting that with a new Perl would very probably cause problems.
7281 Therefore I'm assuming you don't want to do that (unless you insist).
7284 case "$installusrbinperl" in
7285 "$define"|[yY]*) dflt='y';;
7291 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
7294 case "$installusrbinperl" in
7295 "$undef"|[nN]*) dflt='n';;
7299 rp="Do you want to install perl as /usr/bin/perl?"
7302 [yY]*) val="$define";;
7308 set installusrbinperl
7311 : Check if we are using the GNU C library
7313 echo "Checking for GNU C Library..." >&4
7315 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
7316 alone are insufficient to distinguish different versions, such as
7317 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
7318 libc version 2.1.0. A. Dougherty, June 3, 2002.
7324 # ifdef __GLIBC_MINOR__
7325 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
7326 # include <gnu/libc-version.h>
7327 printf("%s\n", gnu_get_libc_version());
7329 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
7332 printf("%d\n", __GLIBC__);
7341 if eval $compile_ok && $run ./try > glibc.ver; then
7343 gnulibc_version=`$cat glibc.ver`
7344 echo "You are using the GNU C Library version $gnulibc_version"
7348 echo "You are not using the GNU C Library"
7354 : see if nm is to be used to determine whether a symbol is defined or not
7358 case "$d_gnulibc" in
7361 echo "nm probably won't work on the GNU C Library." >&4
7367 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
7369 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
7370 echo "'nm' won't be sufficient on this sytem." >&4
7376 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
7377 if $test $dflt -gt 20; then
7387 true|$define) dflt=y;;
7394 I can use $nm to extract the symbols from your C libraries. This
7395 is a time consuming task which may generate huge output on the disk (up
7396 to 3 megabytes) but that should make the symbols extraction faster. The
7397 alternative is to skip the 'nm' extraction part and to compile a small
7398 test program instead to determine whether each symbol is present. If
7399 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
7400 this may be the best solution.
7402 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
7405 rp="Shall I use $nm to extract C symbols from the libraries?"
7408 [Nn]*) usenm=false;;
7417 : nm options which may be necessary
7419 '') if $test -f /mach_boot; then
7421 elif $test -d /usr/ccs/lib; then
7422 nm_opt='-p' # Solaris (and SunOS?)
7423 elif $test -f /dgux; then
7425 elif $test -f /lib64/rld; then
7426 nm_opt='-p' # 64-bit Irix
7432 : nm options which may be necessary for shared libraries but illegal
7433 : for archive libraries. Thank you, Linux.
7434 case "$nm_so_opt" in
7435 '') case "$myuname" in
7437 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
7438 nm_so_opt='--dynamic'
7445 : Figure out where the libc is located
7448 : get list of predefined functions in a handy place
7453 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
7459 *) for thislib in $libs; do
7462 : Handle C library specially below.
7465 thislib=`echo $thislib | $sed -e 's/^-l//'`
7466 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
7468 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
7470 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
7472 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
7474 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
7476 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
7478 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
7483 libnames="$libnames $try"
7485 *) libnames="$libnames $thislib" ;;
7494 for xxx in $libpth; do
7495 $test -r $1 || set $xxx/libc.$so
7496 : The messy sed command sorts on library version numbers.
7498 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
7499 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
7501 s/[0-9][0-9]*/0000&/g
7502 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
7505 $sort | $sed -e 's/^.* //'`
7508 $test -r $1 || set /usr/ccs/lib/libc.$so
7509 $test -r $1 || set /lib/libsys_s$_a
7515 if $test -r "$1"; then
7516 echo "Your (shared) C library seems to be in $1."
7518 elif $test -r /lib/libc && $test -r /lib/clib; then
7519 echo "Your C library seems to be in both /lib/clib and /lib/libc."
7521 libc='/lib/clib /lib/libc'
7522 if $test -r /lib/syslib; then
7523 echo "(Your math library is in /lib/syslib.)"
7524 libc="$libc /lib/syslib"
7526 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7527 echo "Your C library seems to be in $libc, as you said before."
7528 elif $test -r $incpath/usr/lib/libc$_a; then
7529 libc=$incpath/usr/lib/libc$_a;
7530 echo "Your C library seems to be in $libc. That's fine."
7531 elif $test -r /lib/libc$_a; then
7533 echo "Your C library seems to be in $libc. You're normal."
7535 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
7537 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
7538 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
7539 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
7541 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7543 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7546 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
7548 if $test -r "$tans"; then
7549 echo "Your C library seems to be in $tans, of all places."
7555 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7559 If the guess above is wrong (which it might be if you're using a strange
7560 compiler, or your machine supports multiple models), you can override it here.
7565 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
7567 I can't seem to find your C library. I've looked in the following places:
7570 $sed 's/^/ /' libpath
7573 None of these seems to contain your C library. I need to get its name...
7578 rp='Where is your C library?'
7583 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
7584 set X `cat libnames`
7587 case $# in 1) xxx=file; esac
7588 echo "Extracting names from the following $xxx for later perusal:" >&4
7590 $sed 's/^/ /' libnames >&4
7592 $echo $n "This may take a while...$c" >&4
7596 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
7597 *) $nm $nm_opt $file 2>/dev/null;;
7602 $grep fprintf libc.tmp > libc.ptf
7603 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
7604 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
7606 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
7608 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7610 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
7612 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7614 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
7616 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7618 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
7620 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7622 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
7624 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7626 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
7628 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7630 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
7631 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
7633 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7635 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
7637 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7639 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
7641 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7643 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
7645 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7647 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
7649 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7651 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
7653 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7655 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
7657 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7659 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
7661 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7664 $nm -p $* 2>/dev/null >libc.tmp
7665 $grep fprintf libc.tmp > libc.ptf
7666 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
7667 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
7673 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
7675 if $ar t $libc > libc.tmp && \
7676 $contains '^fprintf$' libc.tmp >/dev/null 2>&1
7678 for thisname in $libnames $libc; do
7679 $ar t $thisname >>libc.tmp
7681 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
7683 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
7684 for thisname in $libnames $libc; do
7685 $ar tv $thisname >>libc.tmp
7686 emximp -o tmp.imp $thisname \
7688 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
7689 < tmp.imp >>libc.tmp
7692 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
7695 echo "$ar didn't seem to work right." >&4
7696 echo "Maybe this is a Cray...trying bld instead..." >&4
7698 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list &&
7701 for thisname in $libnames; do
7703 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
7704 $ar t $thisname >>libc.tmp
7708 echo "That didn't work either. Giving up." >&4
7718 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
7719 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
7721 *) if $test -f /lib/syscalls.exp; then
7723 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
7724 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' \
7725 /lib/syscalls.exp >>libc.list
7731 $rm -f libnames libpath
7733 : see if dld is available
7737 : Check if we are using C++
7739 echo "Checking for C++..." >&4
7740 $cat >try.c <<'EOCP'
7752 if eval $compile_ok && $run ./try; then
7754 echo "You are using a C++ compiler."
7757 echo "You are not using a C++ compiler."
7763 : is a C symbol defined?
7766 -v) tf=libc.tmp; tdc="";;
7767 -a) tf=libc.tmp; tdc="[]";;
7768 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
7770 case "$d_cplusplus" in
7771 $define) extern_C="extern \"C\"" ;;
7772 *) extern_C="extern" ;;
7775 case "$reuseval-$4" in
7777 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
7782 if $test "$runnm" = true; then
7783 if $contains $tlook $tf >/dev/null 2>&1; then
7785 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
7786 echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7787 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
7788 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
7792 echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7793 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
7799 $define) tval=true;;
7806 : define an is-in-libc? function
7807 inlibc='echo " "; td=$define; tu=$undef;
7808 sym=$1; var=$2; eval "was=\$$2";
7810 case "$reuseval$was" in
7820 echo "$sym() found." >&4;
7821 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
7823 echo "$sym() NOT found." >&4;
7824 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
7828 $define) echo "$sym() found." >&4;;
7829 *) echo "$sym() NOT found." >&4;;
7833 : see if dlopen exists
7835 xxx_ccflags="$ccflags"
7837 : with g++ one needs -shared to get is-in-libc to work for dlopen
7838 case "$gccversion" in
7840 *) case "$d_cplusplus" in
7841 "$define") ccflags="$ccflags -shared" ;;
7848 ccflags="$xxx_ccflags"
7850 : see if this is a unistd.h system
7851 set unistd.h i_unistd
7854 : determine which dynamic loading, if any, to compile in
7856 dldir="ext/DynaLoader"
7869 $define) dflt='y' ;;
7872 $define) dflt='y' ;;
7874 : Does a dl_xxx.xs file exist for this operating system
7875 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
7878 rp="Do you wish to use dynamic loading?"
7886 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
7887 dflt="$dldir/dl_${osname}.xs"
7888 elif $test "$d_dlopen" = "$define" ; then
7889 dflt="$dldir/dl_dlopen.xs"
7890 elif $test "$i_dld" = "$define" ; then
7891 dflt="$dldir/dl_dld.xs"
7896 *) dflt="$dldir/$dlsrc"
7899 echo "The following dynamic loading files are available:"
7900 : Can not go over to $dldir because getfile has path hard-coded in.
7901 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
7902 rp="Source file to use for dynamic loading"
7908 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
7912 Some systems may require passing special flags to $cc -c to
7913 compile modules that will be used to create a shared library.
7914 To use no flags, say "none".
7917 case "$cccdlflags" in
7918 '') case "$gccversion" in
7919 '') case "$osname" in
7921 next) dflt='none' ;;
7922 irix*) dflt='-KPIC' ;;
7923 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
7924 sunos) dflt='-pic' ;;
7928 *) case "$osname" in
7929 darwin) dflt='none' ;;
7930 linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
7935 *) dflt="$cccdlflags" ;;
7937 rp="Any special flags to pass to $cc -c to compile shared library modules?"
7940 none) cccdlflags=' ' ;;
7941 *) cccdlflags="$ans" ;;
7946 Some systems use ld to create libraries that can be dynamically loaded,
7947 while other systems (such as those using ELF) use $cc.
7951 : Determine if this is ELF
7953 /* Test for whether ELF binaries are produced */
7965 int i = open("a.out",O_RDONLY);
7968 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
7969 exit(0); /* succeed (yes, it is ELF) */
7974 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
7980 '') if $test $bin_ELF = "$define"; then
7982 You appear to have ELF support. I'll use $cc to build dynamic libraries.
7986 echo "I'll use ld to build dynamic libraries."
7994 rp="What command should be used to create dynamic libraries?"
8000 Some systems may require passing special flags to $ld to create a
8001 library that can be dynamically loaded. If your ld flags include
8002 -L/other/path options to locate libraries outside your loader's normal
8003 search path, you may need to specify those -L options here as well. To
8004 use no flags, say "none".
8007 case "$lddlflags" in
8008 '') case "$osname" in
8009 beos) dflt='-nostart' ;;
8010 haiku) dflt='-shared' ;;
8012 case "$gccversion" in
8013 '') dflt="$dflt +vnocompatwarnings" ;;
8016 linux|irix*|gnu*) dflt="-shared $optimize" ;;
8017 next) dflt='none' ;;
8018 solaris) dflt='-G' ;;
8019 sunos) dflt='-assert nodefinitions' ;;
8020 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
8024 *) dflt="$lddlflags" ;;
8027 : Try to guess additional flags to pick up local libraries.
8028 : Be careful not to append to a plain 'none'
8032 for thisflag in $ldflags; do
8037 *) dflt="$dflt $thisflag" ;;
8044 ''|' ') dflt='none' ;;
8048 *-fstack-protector*)
8050 *-fstack-protector*) ;; # Don't add it again
8051 *) dflt="$dflt -fstack-protector" ;;
8057 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
8060 none) lddlflags=' ' ;;
8061 *) lddlflags="$ans" ;;
8066 Some systems may require passing special flags to $cc to indicate that
8067 the resulting executable will use dynamic linking. To use no flags,
8071 case "$ccdlflags" in
8072 '') case "$osname" in
8073 linux|hpux|gnu*) dflt='-Wl,-E' ;;
8074 next|sunos) dflt='none' ;;
8078 *) dflt="$ccdlflags" ;;
8080 rp="Any special flags to pass to $cc to use dynamic linking?"
8083 none) ccdlflags=' ' ;;
8084 *) ccdlflags="$ans" ;;
8095 ld_can_script="$undef"
8096 case "$bin_ELF$usedl" in
8098 # Abuse try.h and a.out names for neat cleanup
8110 if $cc $cccdlflags $ccdlflags $ccflags \
8111 $ldflags $lddlflags -o a.out try.c \
8112 -Wl,--version-script=try.h >/dev/null 2>&1 \
8113 && $test -s a.out ; then
8114 echo "ld supports scripting" >&4
8115 ld_can_script="$define"
8117 echo "ld does not support scripting" >&4
8123 : Do we want a shared libperl?
8127 # No dynamic loading being used, so don't bother even to prompt.
8130 *) case "$useshrplib" in
8131 '') case "$osname" in
8132 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|haiku|cygwin*)
8134 also='Building a shared libperl is required for dynamic loading to work on your system.'
8139 also='Building a shared libperl is needed for MAB support.'
8157 The perl executable is normally obtained by linking perlmain.c with
8158 libperl${_a}, any static extensions (usually just DynaLoader), and
8159 any other libraries needed on this system (such as -lm, etc.). Since
8160 your system supports dynamic loading, it is probably possible to build
8161 a shared libperl.$so. If you will have more than one executable linked
8162 to libperl.$so, this will significantly reduce the size of each
8163 executable, but it may have a noticeable effect on performance. The
8164 default is probably sensible for your system.
8168 rp="Build a shared libperl.$so (y/n)"
8172 useshrplib='true' ;;
8173 *) useshrplib='false' ;;
8178 case "$useshrplib" in
8180 case "$userelocatableinc" in
8182 echo "Cannot build with both -Duserelocatableinc and -Duseshrplib" >&4
8183 echo "See INSTALL for an explanation why that won't work." >&4
8189 # Figure out a good name for libperl.so. Since it gets stored in
8190 # a version-specific architecture-dependent library, the version
8191 # number isn't really that important, except for making cc/ld happy.
8193 # A name such as libperl.so.10.1
8194 majmin="libperl.$so.$patchlevel.$subversion"
8195 # A name such as libperl.so.100
8196 majonly=`echo $patchlevel $subversion |
8197 $awk '{printf "%d%02d", $1, $2}'`
8198 majonly=libperl.$so.$majonly
8199 # I'd prefer to keep the os-specific stuff here to a minimum, and
8200 # rely on figuring it out from the naming of libc.
8201 case "${osname}${osvers}" in
8204 # XXX How handle the --version stuff for MAB?
8206 linux*|gnu*) # ld won't link with a bare -lperl otherwise.
8209 cygwin*) # ld links now against the dll directly
8210 majmin="cygperl5_${patchlevel}_${subversion}.${so}"
8211 majonly=`echo $patchlevel $subversion |
8212 $awk '{printf "%03d%03d", $1, $2}'`
8213 majonly=cygperl5.$majonly.$so
8216 *) # Try to guess based on whether libc has major.minor.
8218 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8219 *libc.$so.[0-9]*) dflt=$majonly ;;
8220 *) dflt=libperl.$so ;;
8230 I need to select a good name for the shared libperl. If your system uses
8231 library names with major and minor numbers, then you might want something
8232 like $majmin. Alternatively, if your system uses a single version
8233 number for shared libraries, then you might want to use $majonly.
8234 Or, your system might be quite happy with a simple libperl.$so.
8236 Since the shared libperl will get installed into a version-specific
8237 architecture-dependent directory, the version number of the shared perl
8238 library probably isn't important, so the default should be o.k.
8241 rp='What name do you want to give to the shared libperl?'
8244 echo "Ok, I'll use $libperl"
8247 libperl="libperl${_a}"
8251 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8255 WARNING: Use of the shrpdir variable for the installation location of
8256 the shared $libperl is not supported. It was never documented and
8257 will not work in this version. Let me (perlbug@perl.org)
8258 know of any problems this may cause.
8264 But your current setting of $shrpdir is
8265 the default anyway, so it's harmless.
8270 Further, your current attempted setting of $shrpdir
8271 conflicts with the value of $archlibexp/CORE
8272 that installperl will use.
8279 # How will the perl executable find the installed shared $libperl?
8280 # Add $xxx to ccdlflags.
8281 # If we can't figure out a command-line option, use $shrpenv to
8282 # set env LD_RUN_PATH. The main perl makefile uses this.
8283 shrpdir=$archlibexp/CORE
8286 if "$useshrplib"; then
8289 # We'll set it in Makefile.SH...
8294 freebsd|mirbsd|netbsd|openbsd|interix|dragonfly)
8295 xxx="-Wl,-R$shrpdir"
8297 bsdos|linux|irix*|dec_osf|gnu*)
8298 xxx="-Wl,-rpath,$shrpdir"
8301 # next doesn't like the default...
8304 # beos doesn't like the default, either.
8307 # Haiku doesn't like the default, either.
8310 # hpux doesn't like the default, either.
8311 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8314 # cygwin needs only ldlibpth
8317 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8323 # Only add $xxx if it isn't already in ccdlflags.
8324 case " $ccdlflags " in
8326 *) ccdlflags="$ccdlflags $xxx"
8329 Adding $xxx to the flags
8330 passed to $ld so that the perl executable will find the
8331 installed shared $libperl.
8339 # Fix ccdlflags in AIX for building external extensions.
8340 # (For building Perl itself bare -bE:perl.exp is needed,
8341 # Makefile.SH takes care of this.)
8343 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8345 # Respect a hint or command-line value.
8347 '') shrpenv="$tmp_shrpenv" ;;
8349 case "$ldlibpthname" in
8350 '') ldlibpthname=LD_LIBRARY_PATH ;;
8351 none) ldlibpthname='' ;;
8354 : determine where manual pages are on this system
8358 syspath='/usr/share/man/man1 /usr/man/man1'
8359 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8360 syspath="$syspath /usr/man/u_man/man1"
8361 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8362 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8363 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8364 sysman=`./loc . /usr/man/man1 $syspath`
8367 if $test -d "$sysman"; then
8368 echo "System manual is in $sysman." >&4
8370 echo "Could not find manual pages in source form." >&4
8373 : determine where manual pages go
8374 set man1dir man1dir none
8378 $spackage has manual pages available in source form.
8382 echo "However, you don't have nroff, so they're probably useless to you."
8384 '') man1dir="none";;
8387 echo "If you don't want the manual sources installed, answer 'none'."
8392 lookpath="$prefixexp/share/man/man1"
8393 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8394 lookpath="$lookpath $prefixexp/man/p_man/man1"
8395 lookpath="$lookpath $prefixexp/man/u_man/man1"
8396 lookpath="$lookpath $prefixexp/man/man.1"
8398 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8399 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8409 rp="Where do the main $spackage manual pages (source) go?"
8411 if $test "X$man1direxp" != "X$ansexp"; then
8422 : What suffix to use on installed man pages
8429 rp="What suffix should be used for the main $spackage man pages?"
8431 '') case "$man1dir" in
8445 *) dflt="$man1ext";;
8452 : see if we can have long filenames
8454 first=123456789abcdef
8456 if (echo hi >$first) 2>/dev/null; then
8457 if $test -f 123456789abcde; then
8458 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8461 echo 'You can have filenames longer than 14 characters.'>&4
8466 You can't have filenames longer than 14 chars.
8467 You can't even think about them!
8473 $rm -rf 123456789abcde*
8475 : determine where library module manual pages go
8476 set man3dir man3dir none
8480 $spackage has manual pages for many of the library modules.
8486 However, you don't have nroff, so they're probably useless to you.
8489 '') man3dir="none";;
8493 case "$d_flexfnam" in
8496 However, your system can't handle the long file names like File::Basename.3.
8499 '') man3dir="none";;
8503 echo "If you don't want the manual sources installed, answer 'none'."
8504 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8506 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8507 if $test -d "$privlib/man/man3"; then
8510 WARNING: Previous versions of perl installed man3 pages into
8511 $privlib/man/man3. This version will suggest a
8512 new default of $dflt.
8516 rp='Do you wish to preserve the old behavior?(y/n)'
8519 y*) dflt="$privlib/man/man3" ;;
8524 *) dflt="$man3dir" ;;
8531 rp="Where do the $package library man pages (source) go?"
8541 : What suffix to use on installed man pages
8547 rp="What suffix should be used for the $package library man pages?"
8549 '') case "$man3dir" in
8563 *) dflt="$man3ext";;
8570 : see if we have to deal with yellow pages, now NIS.
8571 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8572 if $test -f /usr/etc/nibindd; then
8574 echo "I'm fairly confident you're on a NeXT."
8576 rp='Do you get the hosts file via NetInfo?'
8585 y*) hostcat='nidump hosts .';;
8586 *) case "$hostcat" in
8587 nidump*) hostcat='';;
8597 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8605 rp='Are you getting the hosts file via yellow pages?'
8608 y*) hostcat='ypcat hosts';;
8609 *) hostcat='cat /etc/hosts';;
8615 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8618 '') test -f /etc/group && groupcat='cat /etc/group';;
8621 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8624 : now get the host name
8626 echo "Figuring out host name..." >&4
8627 case "$myhostname" in
8629 echo 'Maybe "hostname" will work...'
8630 if tans=`sh -c hostname 2>&1` ; then
8638 if $test "$cont"; then
8640 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8641 if tans=`cat /etc/systemid 2>&1` ; then
8643 phostname='cat /etc/systemid'
8644 echo "Whadyaknow. Xenix always was a bit strange..."
8647 elif $test -r /etc/systemid; then
8648 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8651 if $test "$cont"; then
8652 echo 'No, maybe "uuname -l" will work...'
8653 if tans=`sh -c 'uuname -l' 2>&1` ; then
8655 phostname='uuname -l'
8657 echo 'Strange. Maybe "uname -n" will work...'
8658 if tans=`sh -c 'uname -n' 2>&1` ; then
8660 phostname='uname -n'
8662 echo 'Oh well, maybe I can mine it out of whoami.h...'
8663 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8664 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8665 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8667 case "$myhostname" in
8668 '') echo "Does this machine have an identity crisis or something?"
8671 echo "Well, you said $myhostname before..."
8672 phostname='echo $myhostname';;
8678 case "$myhostname" in
8679 '') myhostname=noname ;;
8681 : you do not want to know about this
8686 if $test "$myhostname" ; then
8688 rp='Your host name appears to be "'$myhostname'".'" Right?"
8696 : bad guess or no guess
8697 while $test "X$myhostname" = X ; do
8699 rp="Please type the (one word) name of your host:"
8704 : translate upper to lower if necessary
8705 case "$myhostname" in
8707 echo "(Normalizing case in your host name)"
8708 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8712 case "$myhostname" in
8714 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8715 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8716 echo "(Trimming domain name from host name--host name is now $myhostname)"
8718 *) case "$mydomain" in
8721 test "X$hostcat" = "Xypcat hosts" &&
8722 ypmatch "$myhostname" hosts 2>/dev/null |\
8723 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8726 test "X$hostcat" != "X" &&
8727 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8728 /[ ]$myhostname[ . ]/p" > hosts
8731 if $test -f hosts; then
8732 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8733 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8734 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8735 hosts | $sort | $uniq | \
8736 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8737 case `$echo X$dflt` in
8738 X*\ *) echo "(Several hosts in the database matched hostname)"
8741 X.) echo "(You do not have fully-qualified names in the hosts database)"
8745 echo "(I cannot locate a hosts database anywhere)"
8750 tans=`./loc resolv.conf X /etc /usr/etc`
8751 if $test -f "$tans"; then
8752 echo "(Attempting domain name extraction from $tans)"
8753 dflt=.`$sed -n -e 's/ / /g' \
8754 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8757 .) dflt=.`$sed -n -e 's/ / /g' \
8758 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8766 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8767 dflt=.`sh -c domainname 2>/dev/null`
8770 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8774 case "$dflt$osname" in
8775 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
8776 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
8780 .) echo "(Lost all hope -- silly guess then)"
8786 *) dflt="$mydomain";;
8790 rp="What is your domain name?"
8800 : translate upper to lower if necessary
8803 echo "(Normalizing case in your domain name)"
8804 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
8808 : a little sanity check here
8809 case "$phostname" in
8812 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
8813 $myhostname$mydomain|$myhostname) ;;
8815 case "$phostname" in
8817 echo "(That doesn't agree with your whoami.h file, by the way.)"
8820 echo "(That doesn't agree with your $phostname command, by the way.)"
8828 : determine the e-mail address of the user who is running us
8831 I need to get your e-mail address in Internet format if possible, i.e.
8832 something like user@host.domain. Please answer accurately since I have
8833 no easy means to double check it. The default value provided below
8834 is most probably close to reality but may not be valid from outside
8835 your organization...
8839 while test "$cont"; do
8841 '') dflt="$cf_by@$myhostname$mydomain";;
8842 *) dflt="$cf_email";;
8844 rp='What is your e-mail address?'
8850 rp='Address does not look like an Internet one. Use it anyway?'
8864 : Ask e-mail of administrator
8867 If you or somebody else will be maintaining perl at your site, please
8868 fill in the correct e-mail address here so that they may be contacted
8869 if necessary. Currently, the "perlbug" program included with perl
8870 will send mail to this address in addition to perlbug@perl.org. You may
8871 enter "none" for no administrator.
8874 case "$perladmin" in
8875 '') dflt="$cf_email";;
8876 *) dflt="$perladmin";;
8878 rp='Perl administrator e-mail address'
8882 : determine whether to only install version-specific parts.
8885 Do you want to install only the version-specific parts of the perl
8886 distribution? Usually you do *not* want to do this.
8888 case "$versiononly" in
8889 "$define"|[Yy]*|true) dflt='y' ;;
8892 rp="Do you want to install only the version-specific parts of perl?"
8895 [yY]*) val="$define";;
8901 case "$versiononly" in
8902 "$define") inc_version_list=''
8903 inc_version_list_init=0
8907 : figure out how to guarantee perl startup
8908 : XXX Note that this currently takes advantage of the bug that binexp ignores
8909 : the Configure -Dinstallprefix setting, which in turn means that under
8910 : relocatable @INC, initialinstalllocation is what binexp started as.
8911 case "$startperl" in
8913 case "$sharpbang" in
8917 I can use the #! construct to start perl on your system. This will
8918 make startup of perl scripts faster, but may cause problems if you
8919 want to share those scripts and perl is not in a standard place
8920 ($initialinstalllocation/perl) on all your platforms. The alternative
8921 is to force a shell by starting the script with a single ':' character.
8924 case "$versiononly" in
8925 "$define") dflt="$initialinstalllocation/perl$version";;
8926 *) dflt="$initialinstalllocation/perl";;
8928 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
8931 none) startperl=": # use perl";;
8932 *) startperl="#!$ans"
8933 if $test 30 -lt `echo "$ans" | wc -c`; then
8936 WARNING: Some systems limit the #! command to 32 characters.
8937 If you experience difficulty running Perl scripts with #!, try
8938 installing Perl in a directory with a shorter pathname.
8944 *) startperl=": # use perl"
8949 echo "I'll use $startperl to start perl scripts."
8951 : figure best path for perl in scripts
8954 case "$versiononly" in
8955 "$define") perlpath="$initialinstalllocation/perl$version";;
8956 *) perlpath="$initialinstalllocation/perl";;
8958 case "$startperl" in
8963 I will use the "eval 'exec'" idiom to start Perl on your system.
8964 I can use the full path of your Perl binary for this purpose, but
8965 doing so may cause problems if you want to share those scripts and
8966 Perl is not always in a standard place ($initialinstalllocation/perl).
8969 dflt="$initialinstalllocation/perl"
8970 rp="What path shall I use in \"eval 'exec'\"?"
8977 case "$startperl" in
8979 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
8982 : determine where public executable scripts go
8983 set scriptdir scriptdir
8985 case "$scriptdir" in
8988 : guess some guesses
8989 $test -d /usr/share/scripts && dflt=/usr/share/scripts
8990 $test -d /usr/share/bin && dflt=/usr/share/bin
8991 $test -d /usr/local/script && dflt=/usr/local/script
8992 $test -d /usr/local/scripts && dflt=/usr/local/scripts
8993 $test -d $prefixexp/script && dflt=$prefixexp/script
8997 *) dflt="$scriptdir"
9002 Some installations have a separate directory just for executable scripts so
9003 that they can mount it across multiple architectures but keep the scripts in
9004 one spot. You might, for example, have a subdirectory of /usr/share for this.
9005 Or you might just lump your scripts in with all your other executables.
9009 rp='Where do you keep publicly executable scripts?'
9011 if $test "X$ansexp" != "X$scriptdirexp"; then
9017 : A little fix up for an irregularly named variable.
9018 installscript="$installscriptdir"
9020 : determine where add-on public executables go
9022 '') dflt=$siteprefix/bin ;;
9026 rp='Pathname where the add-on public executables should be installed?'
9031 : determine where add-on html pages go
9032 : There is no standard location, so try to copy the previously-selected
9033 : directory structure for the core html pages.
9034 case "$sitehtml1dir" in
9035 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9036 *) dflt=$sitehtml1dir ;;
9039 ''|' ') dflt=none ;;
9042 rp='Pathname where the site-specific html pages should be installed?'
9044 prefixvar=sitehtml1dir
9047 : determine where add-on library html pages go
9048 : There is no standard location, so try to copy the previously-selected
9049 : directory structure for the core html pages.
9050 case "$sitehtml3dir" in
9051 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9052 *) dflt=$sitehtml3dir ;;
9055 ''|' ') dflt=none ;;
9058 rp='Pathname where the site-specific library html pages should be installed?'
9060 prefixvar=sitehtml3dir
9063 : determine where add-on manual pages go
9064 case "$siteman1dir" in
9065 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
9066 *) dflt=$siteman1dir ;;
9069 ''|' ') dflt=none ;;
9072 rp='Pathname where the site-specific manual pages should be installed?'
9074 prefixvar=siteman1dir
9077 : determine where add-on library man pages go
9078 case "$siteman3dir" in
9079 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
9080 *) dflt=$siteman3dir ;;
9083 ''|' ') dflt=none ;;
9086 rp='Pathname where the site-specific library manual pages should be installed?'
9088 prefixvar=siteman3dir
9091 : determine where add-on public executable scripts go
9092 case "$sitescript" in
9093 '') dflt=$siteprefix/script
9094 $test -d $dflt || dflt=$sitebin ;;
9095 *) dflt="$sitescript" ;;
9098 rp='Pathname where add-on public executable scripts should be installed?'
9100 prefixvar=sitescript
9103 : Check if faststdio is requested and available
9104 case "$usefaststdio" in
9105 $define|true|[yY]*|'')
9106 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
9116 Perl can be built to use 'fast stdio', which means using the stdio
9117 library but also directly manipulating the stdio buffers to enable
9118 faster I/O. Using stdio is better for backward compatibility (especially
9119 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
9120 interface has been preferred instead of stdio.
9122 If this doesn't make any sense to you, just accept the default '$dflt'.
9124 rp='Use the "fast stdio" if available?'
9127 y|Y) val="$define" ;;
9134 : define an is-a-typedef? function
9135 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9137 "") inclist="sys/types.h";;
9139 eval "varval=\$$var";
9143 for inc in $inclist; do
9144 echo "#include <$inc>" >>temp.c;
9146 echo "#ifdef $type" >> temp.c;
9147 echo "printf(\"We have $type\");" >> temp.c;
9148 echo "#endif" >> temp.c;
9149 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9150 if $contains $type temp.E >/dev/null 2>&1; then
9156 *) eval "$var=\$varval";;
9159 : define an is-a-typedef? function that prompts if the type is not available.
9160 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9162 "") inclist="sys/types.h";;
9164 eval "varval=\$$var";
9168 for inc in $inclist; do
9169 echo "#include <$inc>" >>temp.c;
9171 echo "#ifdef $type" >> temp.c;
9172 echo "printf(\"We have $type\");" >> temp.c;
9173 echo "#endif" >> temp.c;
9174 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9176 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
9177 if $contains $type temp.E >/dev/null 2>&1; then
9178 echo "$type found." >&4;
9181 echo "$type NOT found." >&4;
9187 *) eval "$var=\$varval";;
9190 : see what type lseek is declared as in the kernel
9191 rp="What is the type used for lseek's offset on this system?"
9192 set off_t lseektype long stdio.h sys/types.h
9196 echo "Checking to see how big your file offsets are..." >&4
9198 #include <sys/types.h>
9202 printf("%d\n", (int)sizeof($lseektype));
9207 if eval $compile_ok; then
9208 lseeksize=`$run ./try`
9209 echo "Your file offsets are $lseeksize bytes long."
9213 echo "(I can't seem to compile the test program. Guessing...)"
9214 rp="What is the size of your file offsets (in bytes)?"
9220 : see what type file positions are declared as in the library
9221 rp="What is the type for file position used by fsetpos()?"
9222 set fpos_t fpostype long stdio.h sys/types.h
9225 : Check size for Fpos_t
9228 *_t) zzz="$fpostype" ;;
9231 echo "Checking the size of $zzz..." >&4
9233 #include <sys/types.h>
9240 printf("%d\n", (int)sizeof($fpostype));
9245 if eval $compile_ok; then
9249 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9252 echo "Your $zzz is $fpossize bytes long."
9258 echo "(I can't compile the test program. Guessing...)" >&4
9259 rp="What is the size of your file positions (in bytes)?"
9264 : Check for large file support
9265 # Backward compatibility (uselfs is deprecated).
9267 "$define"|true|[yY]*)
9270 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9272 uselargefiles="$define"
9276 case "$lseeksize:$fpossize" in
9279 You can have files larger than 2 gigabytes.
9282 *) case "$uselargefiles" in
9283 "$undef"|false|[nN]*) dflt='n' ;;
9288 Perl can be built to understand large files (files larger than 2 gigabytes)
9289 on some systems. To do so, Configure can be run with -Duselargefiles.
9291 If this doesn't make any sense to you, just accept the default '$dflt'.
9293 rp='Try to understand large files, if available?'
9296 y|Y) val="$define" ;;
9303 : Look for a hint-file generated 'call-back-unit'. If the
9304 : user has specified that a large files perl is to be built,
9305 : we may need to set or change some other defaults.
9306 if $test -f uselargefiles.cbu; then
9307 echo "Your platform has some specific hints regarding large file builds, using them..."
9308 . ./uselargefiles.cbu
9310 case "$uselargefiles" in
9312 if $test -f uselargefiles.cbu; then
9314 echo "Rechecking to see how big your file offsets are..." >&4
9316 #include <sys/types.h>
9320 printf("%d\n", (int)sizeof($lseektype));
9325 if eval $compile_ok; then
9326 lseeksize=`$run ./try`
9327 $echo "Your file offsets are now $lseeksize bytes long."
9331 echo "(I can't seem to compile the test program. Guessing...)"
9332 rp="What is the size of your file offsets (in bytes)?"
9337 *_t) zzz="$fpostype" ;;
9340 $echo $n "Rechecking the size of $zzz...$c" >&4
9342 #include <sys/types.h>
9349 printf("%d\n", (int)sizeof($fpostype));
9354 if eval $compile_ok; then
9359 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9362 echo " $fpossize bytes." >&4
9368 echo "(I can't compile the test program. Guessing...)" >&4
9369 rp="What is the size of your file positions (in bytes)?"
9378 : Check if we want perlio
9381 : Set the vendorbin variables
9382 case "$vendorprefix" in
9383 '') d_vendorbin="$undef"
9387 *) d_vendorbin="$define"
9388 : determine where vendor-supplied executables go.
9389 case "$vendorbin" in
9390 '') dflt=$vendorprefix/bin ;;
9391 *) dflt="$vendorbin" ;;
9394 rp='Pathname for the vendor-supplied executables directory?'
9397 vendorbinexp="$ansexp"
9403 : Set the vendorhtml1dir variables
9404 case "$vendorprefix" in
9405 '') vendorhtml1dir=''
9406 vendorhtml1direxp=''
9408 *) : determine where vendor-supplied html pages go.
9409 : There is no standard location, so try to copy the previously-selected
9410 : directory structure for the core html pages.
9411 : XXX Better default suggestions would be welcome.
9412 case "$vendorhtml1dir" in
9413 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9414 *) dflt=$vendorhtml1dir ;;
9417 ''|' ') dflt=none ;;
9420 rp='Pathname for the vendor-supplied html pages?'
9422 vendorhtml1dir="$ans"
9423 vendorhtml1direxp="$ansexp"
9426 : Use ' ' for none so value is preserved next time through Configure
9427 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9428 prefixvar=vendorhtml1dir
9431 : Set the vendorhtml3dir variables
9432 case "$vendorprefix" in
9433 '') vendorhtml3dir=''
9434 vendorhtml3direxp=''
9436 *) : determine where vendor-supplied module html pages go.
9437 : There is no standard location, so try to copy the previously-selected
9438 : directory structure for the core html pages.
9439 : XXX Better default suggestions would be welcome.
9440 case "$vendorhtml3dir" in
9441 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9442 *) dflt=$vendorhtml3dir ;;
9445 ''|' ') dflt=none ;;
9448 rp='Pathname for the vendor-supplied html pages?'
9450 vendorhtml3dir="$ans"
9451 vendorhtml3direxp="$ansexp"
9454 : Use ' ' for none so value is preserved next time through Configure
9455 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9456 prefixvar=vendorhtml3dir
9459 : Set the vendorman1dir variables
9460 case "$vendorprefix" in
9461 '') vendorman1dir=''
9464 *) : determine where vendor-supplied manual pages go.
9465 case "$vendorman1dir" in
9466 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9467 *) dflt=$vendorman1dir ;;
9470 ''|' ') dflt=none ;;
9473 rp='Pathname for the vendor-supplied manual section 1 pages?'
9475 vendorman1dir="$ans"
9476 vendorman1direxp="$ansexp"
9479 : Use ' ' for none so value is preserved next time through Configure
9480 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9481 prefixvar=vendorman1dir
9484 : Set the vendorman3dir variables
9485 case "$vendorprefix" in
9486 '') vendorman3dir=''
9489 *) : determine where vendor-supplied module manual pages go.
9490 case "$vendorman3dir" in
9491 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9492 *) dflt=$vendorman3dir ;;
9495 ''|' ') dflt=none ;;
9498 rp='Pathname for the vendor-supplied manual section 3 pages?'
9500 vendorman3dir="$ans"
9501 vendorman3direxp="$ansexp"
9504 : Use ' ' for none so value is preserved next time through Configure
9505 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9506 prefixvar=vendorman3dir
9509 : Set the vendorscript variables
9510 case "$vendorprefix" in
9511 '') d_vendorscript="$undef"
9515 *) d_vendorscript="$define"
9516 : determine where vendor-supplied scripts go.
9517 case "$vendorscript" in
9518 '') dflt=$vendorprefix/script
9519 $test -d $dflt || dflt=$vendorbin ;;
9520 *) dflt="$vendorscript" ;;
9524 The installation process will create a directory for
9525 vendor-supplied scripts.
9529 rp='Pathname for the vendor-supplied scripts directory?'
9532 vendorscriptexp="$ansexp"
9535 prefixvar=vendorscript
9538 : script used to emit important warnings
9541 if test \$# -gt 0; then
9546 echo "*** WARNING:" >&4
9547 sed -e 's/^/*** /' <msg >&4
9549 cat msg >>config.msg
9550 echo " " >>config.msg
9556 : see which of string.h or strings.h is needed
9558 strings=`./findhdr string.h`
9559 if $test "$strings" && $test -r "$strings"; then
9560 echo "Using <string.h> instead of <strings.h>." >&4
9564 strings=`./findhdr strings.h`
9565 if $test "$strings" && $test -r "$strings"; then
9566 echo "Using <strings.h> instead of <string.h>." >&4
9568 ./warn "No string header found -- You'll surely have problems."
9574 "$undef") strings=`./findhdr strings.h`;;
9575 *) strings=`./findhdr string.h`;;
9578 : see if qgcvt exists
9582 : Check print/scan long double stuff
9585 if $test X"$d_longdbl" = X"$define"; then
9587 echo "Checking how to print long doubles..." >&4
9589 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
9590 $cat >try.c <<'EOCP'
9591 #include <sys/types.h>
9595 printf("%.3f\n", d);
9599 if eval $compile; then
9603 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
9604 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
9605 echo "We will use %f."
9611 if $test X"$sPRIfldbl" = X; then
9612 $cat >try.c <<'EOCP'
9613 #include <sys/types.h>
9616 long double d = 123.456;
9617 printf("%.3Lf\n", d);
9621 if eval $compile; then
9625 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
9626 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
9627 echo "We will use %Lf."
9633 if $test X"$sPRIfldbl" = X; then
9634 $cat >try.c <<'EOCP'
9635 #include <sys/types.h>
9638 long double d = 123.456;
9639 printf("%.3llf\n", d);
9643 if eval $compile; then
9647 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
9648 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
9649 echo "We will use %llf."
9655 if $test X"$sPRIfldbl" = X; then
9656 $cat >try.c <<'EOCP'
9657 #include <sys/types.h>
9660 long double d = 123.456;
9661 printf("%.3lf\n", d);
9665 if eval $compile; then
9669 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
9670 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
9671 echo "We will use %lf."
9677 if $test X"$sPRIfldbl" = X; then
9678 echo "Cannot figure out how to print long doubles." >&4
9680 sSCNfldbl=$sPRIfldbl # expect consistency
9687 case "$sPRIfldbl" in
9688 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
9689 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
9690 d_SCNfldbl="$undef";
9692 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
9693 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
9694 d_SCNfldbl="$define";
9698 : Check how to convert floats to strings.
9700 if test "X$d_Gconvert" = X; then
9703 echo "Checking for an efficient way to convert floats to strings."
9705 case "$uselongdouble" in
9706 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
9708 case "$d_longdbl" in
9709 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
9711 case "$d_PRIgldbl" in
9712 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
9716 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
9717 char *myname = "gconvert";
9720 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
9721 char *myname = "gcvt";
9724 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
9725 char *myname = "qgcvt";
9726 #define DOUBLETYPE long double
9729 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9731 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
9733 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
9736 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
9738 char *myname = "sprintf";
9742 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9743 #define DOUBLETYPE long double
9745 #define DOUBLETYPE double
9757 # include <string.h>
9759 # include <strings.h>
9762 int checkit(char *expect, char *got)
9764 if (strcmp(expect, got)) {
9765 printf("%s oddity: Expected %s, got %s\n",
9766 myname, expect, got);
9776 /* This must be 1st test on (which?) platform */
9777 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
9778 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
9779 checkit("0.1", buf);
9781 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
9782 checkit("0.01", buf);
9784 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
9785 checkit("0.001", buf);
9787 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
9788 checkit("0.0001", buf);
9790 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
9791 if (strlen(buf) > 5)
9792 checkit("9e-005", buf); /* for Microsoft ?? */
9794 checkit("9e-05", buf);
9796 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
9799 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
9800 checkit("1.1", buf);
9802 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
9803 checkit("1.01", buf);
9805 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
9806 checkit("1.001", buf);
9808 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
9809 checkit("1.0001", buf);
9811 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
9812 checkit("1.00001", buf);
9814 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
9815 checkit("1.000001", buf);
9817 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
9820 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
9823 /* Some Linux gcvt's give 1.e+5 here. */
9824 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
9825 checkit("100000", buf);
9827 /* Some Linux gcvt's give -1.e+5 here. */
9828 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
9829 checkit("-100000", buf);
9831 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
9832 checkit("123.456", buf);
9834 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
9835 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
9836 /* 34 should be enough to scare even long double
9837 * places into using the e notation. */
9838 if (strlen(buf) > 5)
9839 checkit("1e+034", buf); /* for Microsoft */
9841 checkit("1e+34", buf);
9843 /* For Perl, if you add additional tests here, also add them to
9844 * t/base/num.t for benefit of platforms not using Configure or
9845 * overriding d_Gconvert */
9850 : first add preferred functions to our list
9852 for xxx_convert in $gconvert_preference; do
9853 case $xxx_convert in
9854 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
9855 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
9858 : then add any others
9859 for xxx_convert in gconvert gcvt sprintf; do
9862 *) xxx_list="$xxx_list $xxx_convert" ;;
9866 case "$d_longdbl$uselongdouble" in
9868 : again, add preferred functions to our list first
9870 for xxx_convert in $gconvert_ld_preference; do
9871 case $xxx_convert in
9872 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9873 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
9876 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
9877 for xxx_convert in qgcvt sprintf $xxx_list; do
9878 case "$xxx_ld_list" in
9879 $xxx_convert*|*" $xxx_convert"*) ;;
9880 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9883 : if sprintf cannot do long doubles, move it to the end
9884 if test "$d_PRIgldbl" != "$define"; then
9885 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
9887 : if no qgcvt, remove it
9888 if test "$d_qgcvt" != "$define"; then
9889 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
9892 xxx_list="$xxx_ld_list"
9896 for xxx_convert in $xxx_list; do
9897 echo "Trying $xxx_convert..."
9898 $rm -f try try$_o core
9899 set try -DTRY_$xxx_convert
9900 if eval $compile; then
9901 echo "$xxx_convert() found." >&4
9903 echo "I'll use $xxx_convert to convert floats into a string." >&4
9906 echo "...But $xxx_convert didn't work as I expected."
9910 echo "$xxx_convert NOT found." >&4
9914 if test X$xxx_convert = X; then
9915 echo "*** WHOA THERE!!! ***" >&4
9916 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
9920 case "$xxx_convert" in
9921 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
9922 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
9923 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
9924 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
9925 "$define$define$define")
9926 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
9927 "$define$define$undef")
9928 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
9929 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
9937 : see if _fwalk exists
9941 : Initialize h_fcntl
9944 : Initialize h_sysfile
9947 : access call always available on UNIX
9951 : locate the flags for 'access()'
9955 $cat >access.c <<EOCP
9956 #include <sys/types.h>
9961 #include <sys/file.h>
9974 : check sys/file.h first, no particular reason here
9975 if $test `./findhdr sys/file.h` && \
9976 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
9978 echo "<sys/file.h> defines the *_OK access constants." >&4
9979 elif $test `./findhdr fcntl.h` && \
9980 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
9982 echo "<fcntl.h> defines the *_OK access constants." >&4
9983 elif $test `./findhdr unistd.h` && \
9984 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
9985 echo "<unistd.h> defines the *_OK access constants." >&4
9987 echo "I can't find the four *_OK access constants--I'll use mine." >&4
9993 : see if accessx exists
9994 set accessx d_accessx
9997 : see if aintl exists
10001 : see if alarm exists
10005 : see if 64bit time functions exists
10007 set ctime64 d_ctime64
10010 set localtime64 d_localtime64
10013 set gmtime64 d_gmtime64
10016 set mktime64 d_mktime64
10019 set difftime64 d_difftime64
10022 set asctime64 d_asctime64
10025 : see if POSIX threads are available
10026 set pthread.h i_pthread
10029 : define a function to check prototypes
10030 $cat > protochk <<EOSH
10033 optimize="$optimize"
10035 prototype="$prototype"
10038 usethreads=$usethreads
10039 i_pthread=$i_pthread
10040 pthread_h_first=$pthread_h_first
10043 $cat >> protochk <<'EOSH'
10048 while test $# -ge 2; do
10050 $define) echo "#include <$2>" >> try.c ;;
10051 literal) echo "$2" >> try.c ;;
10053 # Extra magic for the benefit of systems that need pthread.h
10054 # to be included early to correctly detect threadsafe functions.
10055 # Such functions must guarantee themselves, though, that the usethreads
10056 # and i_pthread have been defined, before calling protochk.
10057 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
10058 echo "#include <pthread.h>" >> try.c
10063 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
10064 cat >> try.c <<'EOCP'
10065 #ifdef CAN_PROTOTYPE
10066 #define _(args) args
10071 echo "$foo" >> try.c
10072 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
10073 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
10079 $eunicefix protochk
10081 : Define hasproto macro for Configure internal use
10082 hasproto='varname=$1; func=$2; shift; shift;
10083 while $test $# -ge 2; do
10085 $define) echo "#include <$2>";;
10089 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
10090 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
10091 echo "$func() prototype found.";
10094 echo "$func() prototype NOT found.";
10101 : see if sys/types.h has to be included
10102 set sys/types.h i_systypes
10105 : see if sys/select.h has to be included
10106 set sys/select.h i_sysselct
10109 : Define hasfield macro for Configure internal use
10110 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
10111 while $test $# -ge 2; do
10113 $define) echo "#include <$2>";;
10117 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
10119 if eval $compile; then
10128 : see if we should include time.h, sys/time.h, or both
10130 if test "X$timeincl" = X; then
10131 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
10132 $echo $n "I'm now running the test program...$c"
10134 #include <sys/types.h>
10139 #ifdef SYSTIMEKERNEL
10142 #include <sys/time.h>
10145 #include <sys/select.h>
10147 #$i_stdlib I_STDLIB
10149 #include <stdlib.h>
10155 struct timeval bar;
10158 struct timezone tzp;
10160 if (foo.tm_sec == foo.tm_sec)
10163 if (bar.tv_sec == bar.tv_sec)
10170 for s_timezone in '-DS_TIMEZONE' ''; do
10172 for s_timeval in '-DS_TIMEVAL' ''; do
10173 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10174 for i_time in '' '-DI_TIME'; do
10175 for i_systime in '-DI_SYSTIME' ''; do
10178 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10179 if eval $compile; then
10180 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
10184 $echo $n "Succeeded with $flags$c"
10196 *SYSTIMEKERNEL*) i_systimek="$define"
10197 timeincl=`./findhdr sys/time.h`
10198 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10199 *) i_systimek="$undef";;
10202 *I_TIME*) i_time="$define"
10203 timeincl=`./findhdr time.h`" $timeincl"
10204 echo "We'll include <time.h>." >&4;;
10205 *) i_time="$undef";;
10208 *I_SYSTIME*) i_systime="$define"
10209 timeincl=`./findhdr sys/time.h`" $timeincl"
10210 echo "We'll include <sys/time.h>." >&4;;
10211 *) i_systime="$undef";;
10215 : see if struct tm knows about tm_zone
10216 case "$i_systime$i_time" in
10219 echo "Checking to see if your struct tm has tm_zone field..." >&4
10220 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
10228 case "$d_tm_tm_zone" in
10229 "$define") echo "Yes, it does." ;;
10230 *) echo "No, it doesn't." ;;
10232 : see if struct tm knows about tm_gmtoff
10233 case "$i_systime$i_time" in
10236 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
10237 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
10245 case "$d_tm_tm_gmtoff" in
10246 "$define") echo "Yes, it does." ;;
10247 *) echo "No, it doesn't." ;;
10250 : see if asctime_r exists
10251 set asctime_r d_asctime_r
10253 case "$d_asctime_r" in
10255 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10256 case "$d_asctime_r_proto:$usethreads" in
10257 ":define") d_asctime_r_proto=define
10258 set d_asctime_r_proto asctime_r $hdrs
10262 case "$d_asctime_r_proto" in
10264 case "$asctime_r_proto" in
10265 ''|0) try='char* asctime_r(const struct tm*, char*);'
10266 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SB ;;
10268 case "$asctime_r_proto" in
10269 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
10270 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SBI ;;
10272 case "$asctime_r_proto" in
10273 ''|0) try='int asctime_r(const struct tm*, char*);'
10274 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SB ;;
10276 case "$asctime_r_proto" in
10277 ''|0) try='int asctime_r(const struct tm*, char*, int);'
10278 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SBI ;;
10280 case "$asctime_r_proto" in
10281 ''|0) d_asctime_r=undef
10283 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
10284 * ) case "$asctime_r_proto" in
10285 REENTRANT_PROTO*) ;;
10286 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
10288 echo "Prototype: $try" ;;
10291 *) case "$usethreads" in
10292 define) echo "asctime_r has no prototype, not using it." >&4 ;;
10299 *) asctime_r_proto=0
10303 : see if atolf exists
10307 : see if atoll exists
10311 : Look for GCC-style attribute format
10312 case "$d_attribute_format" in
10315 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
10316 $cat >attrib.c <<'EOCP'
10318 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
10320 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10321 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10322 echo "Your C compiler doesn't support __attribute__((format))."
10325 echo "Your C compiler supports __attribute__((format))."
10329 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10333 *) val="$d_attribute_format" ;;
10335 set d_attribute_format
10339 : Look for GCC-style attribute format with null format allowed
10340 case "$d_printf_format_null" in
10341 '') case "$d_attribute_format" in
10344 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
10345 $cat >attrib.c <<EOCP
10347 #$i_stdlib I_STDLIB
10349 #include <stdlib.h>
10351 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
10352 int null_printf (char* pat,...) { return (int)pat; }
10353 int main () { exit(null_printf(NULL)); }
10355 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
10356 : run the executable in case it produces a run-time warning
10357 if $run ./attrib >>attrib.out 2>&1; then
10358 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10359 echo "Your C compiler doesn't allow __printf__ format to be null."
10362 echo "Your C compiler allows __printf__ format to be null."
10366 echo "Your C compiler executable failed with __printf__ format null."
10370 echo "Your C compiler fails with __printf__ format null."
10377 *) val="$d_printf_format_null" ;;
10379 set d_printf_format_null
10383 : Look for GCC-style attribute malloc
10384 case "$d_attribute_malloc" in
10387 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
10388 $cat >attrib.c <<'EOCP'
10390 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
10392 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10393 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10394 echo "Your C compiler doesn't support __attribute__((malloc))."
10397 echo "Your C compiler supports __attribute__((malloc))."
10401 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10405 *) val="$d_attribute_malloc" ;;
10407 set d_attribute_malloc
10411 : Look for GCC-style attribute nonnull
10412 case "$d_attribute_nonnull" in
10415 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
10416 $cat >attrib.c <<'EOCP'
10418 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
10420 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10421 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10422 echo "Your C compiler doesn't support __attribute__((nonnull))."
10425 echo "Your C compiler supports __attribute__((nonnull))."
10429 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10433 *) val="$d_attribute_nonnull" ;;
10435 set d_attribute_nonnull
10439 : Look for GCC-style attribute noreturn
10440 case "$d_attribute_noreturn" in
10443 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
10444 $cat >attrib.c <<'EOCP'
10446 void fall_over_dead( void ) __attribute__((noreturn));
10448 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10449 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10450 echo "Your C compiler doesn't support __attribute__((noreturn))."
10453 echo "Your C compiler supports __attribute__((noreturn))."
10457 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10461 *) val="$d_attribute_noreturn" ;;
10463 set d_attribute_noreturn
10467 : Look for GCC-style attribute pure
10468 case "$d_attribute_pure" in
10471 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
10472 $cat >attrib.c <<'EOCP'
10474 int square( int n ) __attribute__((pure));
10476 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10477 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10478 echo "Your C compiler doesn't support __attribute__((pure))."
10481 echo "Your C compiler supports __attribute__((pure))."
10485 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10489 *) val="$d_attribute_pure" ;;
10491 set d_attribute_pure
10495 : Look for GCC-style attribute unused
10496 case "$d_attribute_unused" in
10499 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
10500 $cat >attrib.c <<'EOCP'
10502 int do_something( int dummy __attribute__((unused)), int n );
10504 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10505 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10506 echo "Your C compiler doesn't support __attribute__((unused))."
10509 echo "Your C compiler supports __attribute__((unused))."
10513 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10517 *) val="$d_attribute_unused" ;;
10519 set d_attribute_unused
10523 : Look for GCC-style attribute deprecated
10524 case "$d_attribute_deprecated" in
10527 echo "Checking whether your compiler can handle __attribute__((deprecated)) ..." >&4
10528 $cat >attrib.c <<'EOCP'
10530 int I_am_deprecated(void) __attribute__((deprecated));
10532 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10533 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10534 echo "Your C compiler doesn't support __attribute__((deprecated))."
10537 echo "Your C compiler supports __attribute__((deprecated))."
10541 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10545 *) val="$d_attribute_deprecated" ;;
10547 set d_attribute_deprecated
10551 : Look for GCC-style attribute warn_unused_result
10552 case "$d_attribute_warn_unused_result" in
10555 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
10556 $cat >attrib.c <<'EOCP'
10558 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
10560 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10561 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10562 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
10565 echo "Your C compiler supports __attribute__((warn_unused_result))."
10569 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10573 *) val="$d_attribute_warn_unused_result" ;;
10575 set d_attribute_warn_unused_result
10579 : see if bcmp exists
10583 : see if bcopy exists
10587 : see if getpgrp exists
10588 set getpgrp d_getpgrp
10591 case "$d_getpgrp" in
10594 echo "Checking to see which flavor of getpgrp is in use..."
10596 #$i_unistd I_UNISTD
10597 #include <sys/types.h>
10599 # include <unistd.h>
10601 #$i_stdlib I_STDLIB
10603 #include <stdlib.h>
10607 if (getuid() == 0) {
10608 printf("(I see you are running Configure as super-user...)\n");
10611 #ifdef TRY_BSD_PGRP
10612 if (getpgrp(1) == 0)
10621 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10622 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
10624 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10625 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
10628 echo "I can't seem to compile and run the test program."
10630 xxx="a USG one, i.e. you use getpgrp()."
10632 # SVR4 systems can appear rather BSD-ish.
10633 case "$i_unistd" in
10635 xxx="a BSD one, i.e. you use getpgrp(pid)."
10639 xxx="probably a USG one, i.e. you use getpgrp()."
10644 echo "Assuming your getpgrp is $xxx" >&4
10653 : see if setpgrp exists
10654 set setpgrp d_setpgrp
10657 case "$d_setpgrp" in
10660 echo "Checking to see which flavor of setpgrp is in use..."
10662 #$i_unistd I_UNISTD
10663 #include <sys/types.h>
10665 # include <unistd.h>
10667 #$i_stdlib I_STDLIB
10669 #include <stdlib.h>
10673 if (getuid() == 0) {
10674 printf("(I see you are running Configure as super-user...)\n");
10677 #ifdef TRY_BSD_PGRP
10678 if (-1 == setpgrp(1, 1))
10681 if (setpgrp() != -1)
10687 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10688 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
10690 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10691 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
10694 echo "(I can't seem to compile and run the test program.)"
10696 xxx="a USG one, i.e. you use setpgrp()."
10698 # SVR4 systems can appear rather BSD-ish.
10699 case "$i_unistd" in
10701 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
10705 xxx="probably a USG one, i.e. you use setpgrp()."
10710 echo "Assuming your setpgrp is $xxx" >&4
10719 : Look for GCC-style __builtin_choose_expr
10720 case "$d_builtin_choose_expr" in
10723 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
10724 $cat >try.c <<'EOCP'
10725 #include <assert.h>
10726 #include <stdlib.h>
10729 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
10732 assert( SYRINX(1) == 2112 );
10733 assert( SYRINX(1) != 5150 );
10734 assert( SYRINX(0) == 5150 );
10735 assert( SYRINX(0) != 2112 );
10736 puts( "All good!" );
10742 if eval $compile && $run ./try; then
10743 echo "Your C compiler supports __builtin_choose_expr."
10746 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10750 *) val="$d_builtin_choose_expr" ;;
10753 set d_builtin_choose_expr
10757 : Look for GCC-style __builtin_expect
10758 case "$d_builtin_expect" in
10761 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
10762 $cat >try.c <<'EOCP'
10765 if ( __builtin_expect(n, 0) ) n = 1;
10766 /* Remember shell exit code truth is 0, C truth is non-zero */
10771 if eval $compile && $run ./try; then
10772 echo "Your C compiler supports __builtin_expect."
10775 echo "Your C compiler doesn't seem to understand __builtin_expect."
10779 *) val="$d_builtin_expect" ;;
10782 set d_builtin_expect
10786 : see if bzero exists
10790 : see if stdarg is available
10792 if $test `./findhdr stdarg.h`; then
10793 echo "<stdarg.h> found." >&4
10796 echo "<stdarg.h> NOT found." >&4
10800 : see if varags is available
10802 if $test `./findhdr varargs.h`; then
10803 echo "<varargs.h> found." >&4
10805 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
10808 : set up the varargs testing programs
10809 $cat > varargs.c <<EOP
10811 #include <stdarg.h>
10814 #include <varargs.h>
10818 int f(char *p, ...)
10832 p = va_arg(ap, char *);
10838 $cat > varargs <<EOP
10840 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
10849 : now check which varargs header should be included
10854 if `./varargs I_STDARG`; then
10856 elif `./varargs I_VARARGS`; then
10861 if `./varargs I_VARARGS`; then
10868 echo "I could not find the definition for va_dcl... You have problems..." >&4
10869 val="$undef"; set i_stdarg; eval $setvar
10870 val="$undef"; set i_varargs; eval $setvar
10875 case "$i_varhdr" in
10877 val="$define"; set i_stdarg; eval $setvar
10878 val="$undef"; set i_varargs; eval $setvar
10881 val="$undef"; set i_stdarg; eval $setvar
10882 val="$define"; set i_varargs; eval $setvar
10885 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
10889 : see if the Compiler supports C99 variadic macros
10890 case "$i_stdarg$i_stdlib" in
10892 echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
10895 #include <stdarg.h>
10897 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
10901 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
10907 if eval $compile && $run ./try 2>&1 >/dev/null; then
10908 case "`$run ./try`" in
10910 echo "You have C99 variadic macros." >&4
10911 d_c99_variadic_macros="$define"
10914 echo "You don't have functional C99 variadic macros." >&4
10915 d_c99_variadic_macros="$undef"
10919 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
10920 d_c99_variadic_macros="$undef"
10925 echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
10926 d_c99_variadic_macros="$undef"
10930 : see if signal is declared as pointer to function returning int or void
10932 xxx=`./findhdr signal.h`
10933 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
10934 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10935 echo "You have int (*signal())() instead of void." >&4
10937 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10938 echo "You have void (*signal())()." >&4
10940 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
10941 echo "You have int (*signal())() instead of void." >&4
10943 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
10944 echo "You have void (*signal())()." >&4
10947 case "$d_voidsig" in
10949 echo "I can't determine whether signal handler returns void or int..." >&4
10951 rp="What type does your signal handler return?"
10954 v*) val="$define";;
10958 echo "As you already told me, signal handler returns void." >&4
10961 *) echo "As you already told me, signal handler returns int." >&4
10968 case "$d_voidsig" in
10969 "$define") signal_t="void";;
10970 *) signal_t="int";;
10974 : check for ability to cast large floats to 32-bit ints.
10976 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
10977 if $test "$intsize" -ge 4; then
10984 #$i_stdlib I_STDLIB
10986 #include <stdlib.h>
10988 #include <sys/types.h>
10989 #include <signal.h>
10990 $signal_t blech(int s) { exit(3); }
10997 signal(SIGFPE, blech);
10999 /* Don't let compiler optimize the test away. Store the number
11000 in a writable string for gcc to pass to sscanf under HP-UX.
11002 sprintf(str, "2147483647");
11003 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
11007 /* x86 processors will probably give 0x8000 0000, which is a
11008 sign change. We don't want that. We want to mimic SPARC
11009 behavior here, which is to preserve the sign and give
11012 if (i32 != ($xxx) f)
11018 if eval $compile_ok; then
11022 echo "(I can't seem to compile the test program--assuming it can't)"
11027 echo "Yup, it can."
11030 echo "Nope, it can't."
11037 : check for ability to cast negative floats to unsigned
11039 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
11042 #$i_stdlib I_STDLIB
11044 #include <stdlib.h>
11046 #include <sys/types.h>
11047 #include <signal.h>
11048 $signal_t blech(int s) { exit(7); }
11049 $signal_t blech_in_list(int s) { exit(4); }
11050 unsigned long dummy_long(unsigned long p) { return p; }
11051 unsigned int dummy_int(unsigned int p) { return p; }
11052 unsigned short dummy_short(unsigned short p) { return p; }
11056 unsigned long along;
11058 unsigned short ashort;
11062 /* Frustrate gcc-2.7.2's optimizer which failed this test with
11063 a direct f = -123. assignment. gcc-2.8.0 reportedly
11064 optimized the whole file away
11066 /* Store the number in a writable string for gcc to pass to
11067 sscanf under HP-UX.
11069 sprintf(str, "-123");
11070 sscanf(str, "%lf", &f); /* f = -123.; */
11072 signal(SIGFPE, blech);
11073 along = (unsigned long)f;
11074 aint = (unsigned int)f;
11075 ashort = (unsigned short)f;
11076 if (along != (unsigned long)-123)
11078 if (aint != (unsigned int)-123)
11080 if (ashort != (unsigned short)-123)
11082 sprintf(str, "1073741824.");
11083 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
11086 along = (unsigned long)f;
11087 if (along != 0x80000000)
11091 along = (unsigned long)f;
11092 if (along != 0x7fffffff)
11096 along = (unsigned long)f;
11097 if (along != 0x80000001)
11101 signal(SIGFPE, blech_in_list);
11102 sprintf(str, "123.");
11103 sscanf(str, "%lf", &f); /* f = 123.; */
11104 along = dummy_long((unsigned long)f);
11105 aint = dummy_int((unsigned int)f);
11106 ashort = dummy_short((unsigned short)f);
11107 if (along != (unsigned long)123)
11109 if (aint != (unsigned int)123)
11111 if (ashort != (unsigned short)123)
11118 if eval $compile_ok; then
11122 echo "(I can't seem to compile the test program--assuming it can't)"
11125 case "$castflags" in
11127 echo "Yup, it can."
11130 echo "Nope, it can't."
11137 : see if vprintf exists
11139 if set vprintf val -f d_vprintf; eval $csym; $val; then
11140 echo 'vprintf() found.' >&4
11143 #$i_stdarg I_STDARG /* Only one of these can be defined by i_varhrd */
11144 #$i_varargs I_VARARGS
11146 #$i_stdlib I_STDLIB
11147 #$i_unistd I_UNISTD
11150 # include <stdarg.h>
11151 #else /* I_VARARGS */
11152 # include <varargs.h>
11156 # include <unistd.h>
11160 # include <stdlib.h>
11163 #include <stdio.h> /* vsprintf prototype */
11166 void xxx(int n, ...)
11171 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11173 int main() { xxx(1, "foo"); }
11175 #else /* I_VARARGS */
11183 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11185 int main() { xxx("foo"); }
11191 if eval $compile_ok; then
11192 if $run ./try; then
11193 echo "Your vsprintf() returns (int)." >&4
11196 echo "Your vsprintf() returns (char*)." >&4
11200 echo 'I am unable to compile the vsprintf() test program.' >&4
11201 # We shouldn't get here. If we do, assume the standard signature,
11202 # not the old BSD one.
11203 echo 'Guessing that vsprintf() returns (int).' >&4
11207 echo 'vprintf() NOT found.' >&4
11218 : see if chown exists
11222 : see if chroot exists
11223 set chroot d_chroot
11226 : see if chsize exists
11227 set chsize d_chsize
11230 : see if class exists
11234 : see if clearenv exists
11235 set clearenv d_clearenv
11238 : Define hasstruct macro for Configure internal use
11239 hasstruct='varname=$1; struct=$2; shift; shift;
11240 while $test $# -ge 2; do
11242 $define) echo "#include <$2>";;
11246 echo "int main () { struct $struct foo; }" >> try.c;
11248 if eval $compile; then
11257 : see whether socket exists
11261 $echo $n "Hmm... $c" >&4
11262 if set socket val -f d_socket; eval $csym; $val; then
11263 echo "Looks like you have Berkeley networking support." >&4
11265 if set setsockopt val -f; eval $csym; $val; then
11268 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
11269 d_oldsock="$define"
11272 if $contains socklib libc.list >/dev/null 2>&1; then
11273 echo "Looks like you have Berkeley networking support." >&4
11275 : we will have to assume that it supports the 4.2 BSD interface
11278 echo "You don't have Berkeley networking in libc$_a..." >&4
11279 if test "X$d_socket" = "X$define"; then
11280 echo "...but you seem to believe that you have sockets." >&4
11282 for net in net socket
11284 if test -f /usr/lib/lib$net$_a; then
11285 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
11286 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
11287 if $contains socket libc.list >/dev/null 2>&1; then
11292 echo "...but the Wollongong group seems to have hacked it in." >&4
11293 sockethdr="-I/usr/netinclude"
11296 echo "Found Berkeley sockets interface in lib$net." >&4
11297 if $contains setsockopt libc.list >/dev/null 2>&1; then
11300 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
11301 d_oldsock="$define"
11307 if test "X$d_socket" != "X$define"; then
11308 echo "or anywhere else I see." >&4
11316 : see if socketpair exists
11317 set socketpair d_sockpair
11322 echo "Checking the availability sa_len in the sock struct ..." >&4
11324 #include <sys/types.h>
11325 #include <sys/socket.h>
11327 struct sockaddr sa;
11328 return (sa.sa_len);
11332 set try; if eval $compile; then
11335 set d_sockaddr_sa_len; eval $setvar
11339 echo "Checking the availability struct sockaddr_in6 ..." >&4
11341 #include <sys/types.h>
11342 #include <sys/socket.h>
11343 #include <netinet/in.h>
11345 struct sockaddr_in6 sin6;
11346 return (sin6.sin6_family);
11350 set try; if eval $compile; then
11353 set d_sockaddr_in6; eval $setvar
11357 echo "Checking the availability sin6_scope_id in struct sockaddr_in6 ..." >&4
11359 #include <sys/types.h>
11360 #include <sys/socket.h>
11361 #include <netinet/in.h>
11363 struct sockaddr_in6 sin6;
11364 return (sin6.sin6_scope_id);
11368 set try; if eval $compile; then
11371 set d_sin6_scope_id; eval $setvar
11375 echo "Checking the availability struct ip_mreq ..." >&4
11377 #include <sys/types.h>
11378 #include <sys/socket.h>
11379 #include <netinet/in.h>
11381 struct ip_mreq mreq;
11382 return (mreq.imr_multiaddr.s_addr);
11386 set try; if eval $compile; then
11389 set d_ip_mreq; eval $setvar
11393 echo "Checking the availability struct ipv6_mreq ..." >&4
11395 #include <sys/types.h>
11396 #include <sys/socket.h>
11397 #include <netinet/in.h>
11399 struct ipv6_mreq mreq;
11400 return (mreq.ipv6mr_interface);
11404 set try; if eval $compile; then
11407 set d_ipv6_mreq; eval $setvar
11411 echo "Checking the availability of certain socket constants..." >&4
11412 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
11413 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
11415 #include <sys/types.h>
11416 #include <sys/socket.h>
11422 set try; if eval $compile; then
11425 set d_${enum}; eval $setvar
11429 : see if this is a sys/uio.h system
11430 set sys/uio.h i_sysuio
11433 : Check for cmsghdr support
11435 echo "Checking to see if your system supports struct cmsghdr..." >&4
11436 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
11438 case "$d_cmsghdr_s" in
11439 "$define") echo "Yes, it does." ;;
11440 *) echo "No, it doesn't." ;;
11444 : check for const keyword
11446 echo 'Checking to see if your C compiler knows about "const"...' >&4
11447 $cat >const.c <<'EOCP'
11448 typedef struct spug { int drokk; } spug;
11452 const spug y = { 0 };
11455 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
11457 echo "Yup, it does."
11460 echo "Nope, it doesn't."
11465 : see if copysignl exists
11466 set copysignl d_copysignl
11469 : see if crypt exists
11474 $define) cryptlib='' ;;
11475 *) if set crypt val -f d_crypt; eval $csym; $val; then
11476 echo 'crypt() found.' >&4
11480 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
11481 if $test -z "$cryptlib"; then
11482 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
11486 if $test -z "$cryptlib"; then
11487 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
11491 if $test -z "$cryptlib"; then
11492 cryptlib=`./loc libcrypt$_a "" $libpth`
11496 if $test -z "$cryptlib"; then
11497 echo 'crypt() NOT found.' >&4
11508 : see if this is a crypt.h system
11509 set crypt.h i_crypt
11512 : see if crypt_r exists
11513 set crypt_r d_crypt_r
11515 case "$d_crypt_r" in
11517 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
11518 case "$d_crypt_r_proto:$usethreads" in
11519 ":define") d_crypt_r_proto=define
11520 set d_crypt_r_proto crypt_r $hdrs
11524 case "$d_crypt_r_proto" in
11526 case "$crypt_r_proto" in
11527 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
11528 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCS ;;
11530 case "$crypt_r_proto" in
11531 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
11532 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCD ;;
11534 case "$crypt_r_proto" in
11535 ''|0) d_crypt_r=undef
11537 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
11538 * ) case "$crypt_r_proto" in
11539 REENTRANT_PROTO*) ;;
11540 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
11542 echo "Prototype: $try" ;;
11545 *) case "$usethreads" in
11546 define) echo "crypt_r has no prototype, not using it." >&4 ;;
11557 : get csh whereabouts
11559 'csh') val="$undef" ;;
11560 *) val="$define" ;;
11564 : Respect a hint or command line value for full_csh.
11565 case "$full_csh" in
11566 '') full_csh=$csh ;;
11569 : see if ctermid exists
11570 set ctermid d_ctermid
11573 : see if ctermid_r exists
11574 set ctermid_r d_ctermid_r
11576 case "$d_ctermid_r" in
11578 hdrs="$i_systypes sys/types.h define stdio.h "
11579 case "$d_ctermid_r_proto:$usethreads" in
11580 ":define") d_ctermid_r_proto=define
11581 set d_ctermid_r_proto ctermid_r $hdrs
11585 case "$d_ctermid_r_proto" in
11587 case "$ctermid_r_proto" in
11588 ''|0) try='char* ctermid_r(char*);'
11589 ./protochk "$extern_C $try" $hdrs && ctermid_r_proto=B_B ;;
11591 case "$ctermid_r_proto" in
11592 ''|0) d_ctermid_r=undef
11594 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
11595 * ) case "$ctermid_r_proto" in
11596 REENTRANT_PROTO*) ;;
11597 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
11599 echo "Prototype: $try" ;;
11602 *) case "$usethreads" in
11603 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
11610 *) ctermid_r_proto=0
11614 : see if ctime_r exists
11615 set ctime_r d_ctime_r
11617 case "$d_ctime_r" in
11619 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
11620 case "$d_ctime_r_proto:$usethreads" in
11621 ":define") d_ctime_r_proto=define
11622 set d_ctime_r_proto ctime_r $hdrs
11626 case "$d_ctime_r_proto" in
11628 case "$ctime_r_proto" in
11629 ''|0) try='char* ctime_r(const time_t*, char*);'
11630 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SB ;;
11632 case "$ctime_r_proto" in
11633 ''|0) try='char* ctime_r(const time_t*, char*, int);'
11634 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SBI ;;
11636 case "$ctime_r_proto" in
11637 ''|0) try='int ctime_r(const time_t*, char*);'
11638 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SB ;;
11640 case "$ctime_r_proto" in
11641 ''|0) try='int ctime_r(const time_t*, char*, int);'
11642 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SBI ;;
11644 case "$ctime_r_proto" in
11645 ''|0) d_ctime_r=undef
11647 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
11648 * ) case "$ctime_r_proto" in
11649 REENTRANT_PROTO*) ;;
11650 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
11652 echo "Prototype: $try" ;;
11655 *) case "$usethreads" in
11656 define) echo "ctime_r has no prototype, not using it." >&4 ;;
11667 : see if cuserid exists
11668 set cuserid d_cuserid
11671 : see if this is a limits.h system
11672 set limits.h i_limits
11675 : see if this is a float.h system
11676 set float.h i_float
11679 : See if number of significant digits in a double precision number is known
11681 $cat >dbl_dig.c <<EOM
11682 #$i_limits I_LIMITS
11685 #include <limits.h>
11691 printf("Contains DBL_DIG");
11694 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
11695 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
11696 echo "DBL_DIG found." >&4
11699 echo "DBL_DIG NOT found." >&4
11706 : see if dbm.h is available
11707 : see if dbmclose exists
11708 set dbmclose d_dbmclose
11711 case "$d_dbmclose" in
11721 *) set rpcsvc/dbm.h i_rpcsvcdbm
11726 *) echo "We won't be including <dbm.h>"
11736 : see if prototype for dbminit is available
11738 set d_dbminitproto dbminit $i_dbm dbm.h
11741 : see if difftime exists
11742 set difftime d_difftime
11745 : see if this is a dirent system
11747 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
11749 echo "<dirent.h> found." >&4
11752 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
11753 echo "<sys/dir.h> found." >&4
11756 xinc=`./findhdr sys/ndir.h`
11758 echo "<dirent.h> NOT found." >&4
11763 : Look for type of directory structure.
11765 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11767 case "$direntrytype" in
11769 case "$i_dirent" in
11770 $define) guess1='struct dirent' ;;
11771 *) guess1='struct direct' ;;
11774 *) guess1="$direntrytype"
11779 'struct dirent') guess2='struct direct' ;;
11780 *) guess2='struct dirent' ;;
11783 if $contains "$guess1" try.c >/dev/null 2>&1; then
11784 direntrytype="$guess1"
11785 echo "Your directory entries are $direntrytype." >&4
11786 elif $contains "$guess2" try.c >/dev/null 2>&1; then
11787 direntrytype="$guess2"
11788 echo "Your directory entries seem to be $direntrytype." >&4
11790 echo "I don't recognize your system's directory entries." >&4
11791 rp="What type is used for directory entries on this system?"
11794 direntrytype="$ans"
11798 : see if the directory entry stores field length
11800 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11801 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
11802 echo "Good, your directory entry keeps length information in d_namlen." >&4
11805 echo "Your directory entry does not know about the d_namlen field." >&4
11812 : Look for DIR.dd_fd
11813 case "$i_dirent" in
11815 echo "Checking to see if DIR has a dd_fd member variable" >&4
11817 #$i_stdlib I_STDLIB
11819 #include <stdlib.h>
11821 #include <dirent.h>
11831 if eval $compile; then
11832 echo "Yes, it does."
11835 echo "No, it does not."
11840 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
11848 : see if this is an sysdir system
11849 set sys/dir.h i_sysdir
11852 : see if this is an sysndir system
11853 set sys/ndir.h i_sysndir
11858 $cat >dirfd.c <<EOM
11860 #$i_stdlib I_STDLIB
11862 #include <stdlib.h>
11864 #$i_dirent I_DIRENT /**/
11865 #$i_sysdir I_SYS_DIR /**/
11866 #$i_sysndir I_SYS_NDIR /**/
11867 #$i_systypes I_SYS_TYPES /**/
11868 #if defined(I_SYS_TYPES)
11869 #include <sys/types.h>
11871 #if defined(I_DIRENT)
11872 #include <dirent.h>
11873 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
11874 #include <sys/dir.h>
11878 #include <sys/ndir.h>
11882 #include <ndir.h> /* may be wrong in the future */
11884 #include <sys/dir.h>
11890 DIR *dirp = opendir(".");
11891 if (dirfd(dirp) >= 0)
11899 if eval $compile; then
11903 $define) echo "dirfd() found." >&4 ;;
11904 *) echo "dirfd() NOT found." >&4 ;;
11910 : see if dlerror exists
11913 set dlerror d_dlerror
11917 : see if dlfcn is available
11918 set dlfcn.h i_dlfcn
11921 : Check what extension to use for shared libs
11926 On a few systems, the dynamically loaded modules that perl generates and uses
11927 will need a different extension than shared libs. The default will probably
11933 *) dflt="$dlext" ;;
11935 rp='What is the extension of dynamically loaded modules'
11944 : Check if dlsym need a leading underscore
11950 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
11951 $cat >dyna.c <<'EOM'
11958 #$i_stdlib I_STDLIB
11960 #include <stdlib.h>
11964 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
11966 #include <sys/types.h>
11971 extern int fred() ;
11980 int mode = RTLD_LAZY ;
11982 handle = dlopen("./dyna.$dlext", mode) ;
11983 if (handle == NULL) {
11988 symbol = dlsym(handle, "fred") ;
11989 if (symbol == NULL) {
11990 /* try putting a leading underscore */
11991 symbol = dlsym(handle, "_fred") ;
11992 if (symbol == NULL) {
12005 : Call the object file tmp-dyna.o in case dlext=o.
12006 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
12007 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
12008 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
12009 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
12012 1) echo "Test program failed using dlopen." >&4
12013 echo "Perhaps you should not use dynamic loading." >&4;;
12014 2) echo "Test program failed using dlsym." >&4
12015 echo "Perhaps you should not use dynamic loading." >&4;;
12016 3) echo "dlsym needs a leading underscore" >&4
12018 4) echo "dlsym doesn't need a leading underscore." >&4;;
12021 echo "I can't compile and run the test program." >&4
12022 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
12027 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
12032 : see if drand48_r exists
12033 set drand48_r d_drand48_r
12035 case "$d_drand48_r" in
12037 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
12038 case "$d_drand48_r_proto:$usethreads" in
12039 ":define") d_drand48_r_proto=define
12040 set d_drand48_r_proto drand48_r $hdrs
12044 case "$d_drand48_r_proto" in
12046 case "$drand48_r_proto" in
12047 ''|0) try='int drand48_r(struct drand48_data*, double*);'
12048 ./protochk "$extern_C $try" $hdrs && drand48_r_proto=I_ST ;;
12050 case "$drand48_r_proto" in
12051 ''|0) d_drand48_r=undef
12053 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
12054 * ) case "$drand48_r_proto" in
12055 REENTRANT_PROTO*) ;;
12056 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
12058 echo "Prototype: $try" ;;
12061 *) case "$usethreads" in
12062 define) echo "drand48_r has no prototype, not using it." >&4 ;;
12069 *) drand48_r_proto=0
12073 : see if prototype for drand48 is available
12075 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
12078 : see if dup2 exists
12082 : see if eaccess exists
12083 set eaccess d_eaccess
12086 : see if endgrent exists
12087 set endgrent d_endgrent
12090 : see if this is an grp system
12096 xxx=`./findhdr grp.h`
12097 $cppstdin $cppflags $cppminus < $xxx >$$.h
12099 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
12111 set d_grpasswd; eval $setvar
12115 : see if endgrent_r exists
12116 set endgrent_r d_endgrent_r
12118 case "$d_endgrent_r" in
12120 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12121 case "$d_endgrent_r_proto:$usethreads" in
12122 ":define") d_endgrent_r_proto=define
12123 set d_endgrent_r_proto endgrent_r $hdrs
12127 case "$d_endgrent_r_proto" in
12129 case "$endgrent_r_proto" in
12130 ''|0) try='int endgrent_r(FILE**);'
12131 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=I_H ;;
12133 case "$endgrent_r_proto" in
12134 ''|0) try='void endgrent_r(FILE**);'
12135 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=V_H ;;
12137 case "$endgrent_r_proto" in
12138 ''|0) d_endgrent_r=undef
12140 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
12141 * ) case "$endgrent_r_proto" in
12142 REENTRANT_PROTO*) ;;
12143 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
12145 echo "Prototype: $try" ;;
12148 *) case "$usethreads" in
12149 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
12156 *) endgrent_r_proto=0
12160 : see if endhostent exists
12161 set endhostent d_endhent
12164 : see if this is a netdb.h system
12165 set netdb.h i_netdb
12168 : see if endhostent_r exists
12169 set endhostent_r d_endhostent_r
12171 case "$d_endhostent_r" in
12173 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12174 case "$d_endhostent_r_proto:$usethreads" in
12175 ":define") d_endhostent_r_proto=define
12176 set d_endhostent_r_proto endhostent_r $hdrs
12180 case "$d_endhostent_r_proto" in
12182 case "$endhostent_r_proto" in
12183 ''|0) try='int endhostent_r(struct hostent_data*);'
12184 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=I_D ;;
12186 case "$endhostent_r_proto" in
12187 ''|0) try='void endhostent_r(struct hostent_data*);'
12188 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=V_D ;;
12190 case "$endhostent_r_proto" in
12191 ''|0) d_endhostent_r=undef
12192 endhostent_r_proto=0
12193 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
12194 * ) case "$endhostent_r_proto" in
12195 REENTRANT_PROTO*) ;;
12196 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
12198 echo "Prototype: $try" ;;
12201 *) case "$usethreads" in
12202 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
12204 d_endhostent_r=undef
12205 endhostent_r_proto=0
12209 *) endhostent_r_proto=0
12213 : see if endnetent exists
12214 set endnetent d_endnent
12217 : see if endnetent_r exists
12218 set endnetent_r d_endnetent_r
12220 case "$d_endnetent_r" in
12222 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12223 case "$d_endnetent_r_proto:$usethreads" in
12224 ":define") d_endnetent_r_proto=define
12225 set d_endnetent_r_proto endnetent_r $hdrs
12229 case "$d_endnetent_r_proto" in
12231 case "$endnetent_r_proto" in
12232 ''|0) try='int endnetent_r(struct netent_data*);'
12233 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=I_D ;;
12235 case "$endnetent_r_proto" in
12236 ''|0) try='void endnetent_r(struct netent_data*);'
12237 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=V_D ;;
12239 case "$endnetent_r_proto" in
12240 ''|0) d_endnetent_r=undef
12241 endnetent_r_proto=0
12242 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
12243 * ) case "$endnetent_r_proto" in
12244 REENTRANT_PROTO*) ;;
12245 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
12247 echo "Prototype: $try" ;;
12250 *) case "$usethreads" in
12251 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
12253 d_endnetent_r=undef
12254 endnetent_r_proto=0
12258 *) endnetent_r_proto=0
12262 : see if endprotoent exists
12263 set endprotoent d_endpent
12266 : see if endprotoent_r exists
12267 set endprotoent_r d_endprotoent_r
12269 case "$d_endprotoent_r" in
12271 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12272 case "$d_endprotoent_r_proto:$usethreads" in
12273 ":define") d_endprotoent_r_proto=define
12274 set d_endprotoent_r_proto endprotoent_r $hdrs
12278 case "$d_endprotoent_r_proto" in
12280 case "$endprotoent_r_proto" in
12281 ''|0) try='int endprotoent_r(struct protoent_data*);'
12282 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=I_D ;;
12284 case "$endprotoent_r_proto" in
12285 ''|0) try='void endprotoent_r(struct protoent_data*);'
12286 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=V_D ;;
12288 case "$endprotoent_r_proto" in
12289 ''|0) d_endprotoent_r=undef
12290 endprotoent_r_proto=0
12291 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
12292 * ) case "$endprotoent_r_proto" in
12293 REENTRANT_PROTO*) ;;
12294 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
12296 echo "Prototype: $try" ;;
12299 *) case "$usethreads" in
12300 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
12302 d_endprotoent_r=undef
12303 endprotoent_r_proto=0
12307 *) endprotoent_r_proto=0
12311 : see if endpwent exists
12312 set endpwent d_endpwent
12315 : see if this is a pwd.h system
12321 xxx=`./findhdr pwd.h`
12322 $cppstdin $cppflags $cppminus < $xxx >$$.h
12324 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
12332 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
12340 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
12348 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
12356 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
12364 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
12372 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
12380 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
12392 set d_pwquota; eval $setvar
12393 set d_pwage; eval $setvar
12394 set d_pwchange; eval $setvar
12395 set d_pwclass; eval $setvar
12396 set d_pwexpire; eval $setvar
12397 set d_pwcomment; eval $setvar
12398 set d_pwgecos; eval $setvar
12399 set d_pwpasswd; eval $setvar
12403 : see if endpwent_r exists
12404 set endpwent_r d_endpwent_r
12406 case "$d_endpwent_r" in
12408 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
12409 case "$d_endpwent_r_proto:$usethreads" in
12410 ":define") d_endpwent_r_proto=define
12411 set d_endpwent_r_proto endpwent_r $hdrs
12415 case "$d_endpwent_r_proto" in
12417 case "$endpwent_r_proto" in
12418 ''|0) try='int endpwent_r(FILE**);'
12419 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=I_H ;;
12421 case "$endpwent_r_proto" in
12422 ''|0) try='void endpwent_r(FILE**);'
12423 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=V_H ;;
12425 case "$endpwent_r_proto" in
12426 ''|0) d_endpwent_r=undef
12428 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
12429 * ) case "$endpwent_r_proto" in
12430 REENTRANT_PROTO*) ;;
12431 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
12433 echo "Prototype: $try" ;;
12436 *) case "$usethreads" in
12437 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
12444 *) endpwent_r_proto=0
12448 : see if endservent exists
12449 set endservent d_endsent
12452 : see if endservent_r exists
12453 set endservent_r d_endservent_r
12455 case "$d_endservent_r" in
12457 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12458 case "$d_endservent_r_proto:$usethreads" in
12459 ":define") d_endservent_r_proto=define
12460 set d_endservent_r_proto endservent_r $hdrs
12464 case "$d_endservent_r_proto" in
12466 case "$endservent_r_proto" in
12467 ''|0) try='int endservent_r(struct servent_data*);'
12468 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=I_D ;;
12470 case "$endservent_r_proto" in
12471 ''|0) try='void endservent_r(struct servent_data*);'
12472 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=V_D ;;
12474 case "$endservent_r_proto" in
12475 ''|0) d_endservent_r=undef
12476 endservent_r_proto=0
12477 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
12478 * ) case "$endservent_r_proto" in
12479 REENTRANT_PROTO*) ;;
12480 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
12482 echo "Prototype: $try" ;;
12485 *) case "$usethreads" in
12486 define) echo "endservent_r has no prototype, not using it." >&4 ;;
12488 d_endservent_r=undef
12489 endservent_r_proto=0
12493 *) endservent_r_proto=0
12497 : Locate the flags for 'open()'
12500 #include <sys/types.h>
12505 #include <sys/file.h>
12507 #$i_stdlib I_STDLIB
12509 #include <stdlib.h>
12520 : check sys/file.h first to get FREAD on Sun
12521 if $test `./findhdr sys/file.h` && \
12522 set try -DI_SYS_FILE && eval $compile; then
12524 echo "<sys/file.h> defines the O_* constants..." >&4
12525 if $run ./try; then
12526 echo "and you have the 3 argument form of open()." >&4
12529 echo "but not the 3 argument form of open(). Oh, well." >&4
12532 elif $test `./findhdr fcntl.h` && \
12533 set try -DI_FCNTL && eval $compile; then
12535 echo "<fcntl.h> defines the O_* constants..." >&4
12536 if $run ./try; then
12537 echo "and you have the 3 argument form of open()." >&4
12540 echo "but not the 3 argument form of open(). Oh, well." >&4
12545 echo "I can't find the O_* constant definitions! You got problems." >&4
12551 : see if this is a sys/file.h system
12556 : do we need to include sys/file.h ?
12560 if $h_sysfile; then
12562 echo "We'll be including <sys/file.h>." >&4
12565 echo "We won't be including <sys/file.h>." >&4
12575 : see if fcntl.h is there
12580 : see if we can include fcntl.h
12586 echo "We'll be including <fcntl.h>." >&4
12589 if $h_sysfile; then
12590 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
12592 echo "We won't be including <fcntl.h>." >&4
12604 : see if fork exists
12608 : see if pipe exists
12612 : check for non-blocking I/O stuff
12613 case "$h_sysfile" in
12614 true) echo "#include <sys/file.h>" > head.c;;
12617 true) echo "#include <fcntl.h>" > head.c;;
12618 *) echo "#include <sys/fcntl.h>" > head.c;;
12623 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
12624 case "$o_nonblock" in
12626 $cat head.c > try.c
12627 $cat >>try.c <<EOCP
12629 #$i_stdlib I_STDLIB
12631 #include <stdlib.h>
12639 printf("O_NONBLOCK\n");
12643 printf("O_NDELAY\n");
12647 printf("FNDELAY\n");
12654 if eval $compile_ok; then
12655 o_nonblock=`$run ./try`
12656 case "$o_nonblock" in
12657 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
12658 *) echo "Seems like we can use $o_nonblock.";;
12661 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
12664 *) echo "Using $hint value $o_nonblock.";;
12669 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
12672 case "$d_fork:$d_pipe" in
12674 $cat head.c > try.c
12675 $cat >>try.c <<EOCP
12677 #include <sys/types.h>
12678 #include <signal.h>
12680 #$i_stdlib I_STDLIB
12682 #include <stdlib.h>
12688 #define MY_O_NONBLOCK $o_nonblock
12689 #ifndef errno /* XXX need better Configure test */
12692 #$i_unistd I_UNISTD
12694 #include <unistd.h>
12696 #$i_string I_STRING
12698 #include <string.h>
12700 #include <strings.h>
12702 $signal_t blech(int x) { exit(3); }
12704 $cat >> try.c <<'EOCP'
12712 pipe(pd); /* Down: child -> parent */
12713 pipe(pu); /* Up: parent -> child */
12716 close(pd[1]); /* Parent reads from pd[0] */
12717 close(pu[0]); /* Parent writes (blocking) to pu[1] */
12719 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
12724 signal(SIGALRM, blech);
12726 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
12728 sprintf(string, "%d\n", ret);
12729 write(2, string, strlen(string));
12732 if (errno == EAGAIN) {
12733 printf("EAGAIN\n");
12738 if (errno == EWOULDBLOCK)
12739 printf("EWOULDBLOCK\n");
12742 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
12743 sleep(2); /* Give it time to close our pipe */
12745 ret = read(pd[0], buf, 1); /* Should read EOF */
12747 sprintf(string, "%d\n", ret);
12748 write(4, string, strlen(string));
12752 close(pd[0]); /* We write to pd[1] */
12753 close(pu[1]); /* We read from pu[0] */
12754 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
12755 close(pd[1]); /* Pipe pd is now fully closed! */
12756 exit(0); /* Bye bye, thank you for playing! */
12760 if eval $compile_ok; then
12761 echo "$startsh" >mtry
12762 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
12764 ./mtry >/dev/null 2>&1
12766 0) eagain=`$cat try.out`;;
12767 1) echo "Could not perform non-blocking setting!";;
12768 2) echo "I did a successful read() for something that was not there!";;
12769 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
12770 4) echo "Could not find F_SETFL!";;
12771 *) echo "Something terribly wrong happened during testing.";;
12773 rd_nodata=`$cat try.ret`
12774 echo "A read() system call with no data present returns $rd_nodata."
12775 case "$rd_nodata" in
12778 echo "(That's peculiar, fixing that to be -1.)"
12784 echo "Forcing errno EAGAIN on read() with no data available."
12788 echo "Your read() sets errno to $eagain when no data is available."
12791 status=`$cat try.err`
12793 0) echo "And it correctly returns 0 to signal EOF.";;
12794 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
12795 *) echo "However, your read() returns '$status' on EOF??";;
12798 if test "$status" = "$rd_nodata"; then
12799 echo "WARNING: you can't distinguish between EOF and no data!"
12803 echo "I can't compile the test program--assuming errno EAGAIN will do."
12807 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
12816 echo "Using $hint value $eagain."
12817 echo "Your read() returns $rd_nodata when no data is present."
12818 case "$d_eofnblk" in
12819 "$define") echo "And you can see EOF because read() returns 0.";;
12820 "$undef") echo "But you can't see EOF status from read() returned value.";;
12822 echo "(Assuming you can't see EOF status from read anyway.)"
12828 $rm_try head.c mtry
12830 : see if _ptr and _cnt from stdio act std
12833 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
12834 echo "(Looks like you have stdio.h from BSD.)"
12835 case "$stdio_ptr" in
12836 '') stdio_ptr='((fp)->_p)'
12839 *) ptr_lval=$d_stdio_ptr_lval;;
12841 case "$stdio_cnt" in
12842 '') stdio_cnt='((fp)->_r)'
12845 *) cnt_lval=$d_stdio_cnt_lval;;
12847 case "$stdio_base" in
12848 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
12850 case "$stdio_bufsiz" in
12851 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
12853 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
12854 echo "(Looks like you have stdio.h from Linux.)"
12855 case "$stdio_ptr" in
12856 '') stdio_ptr='((fp)->_IO_read_ptr)'
12859 *) ptr_lval=$d_stdio_ptr_lval;;
12861 case "$stdio_cnt" in
12862 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
12865 *) cnt_lval=$d_stdio_cnt_lval;;
12867 case "$stdio_base" in
12868 '') stdio_base='((fp)->_IO_read_base)';;
12870 case "$stdio_bufsiz" in
12871 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
12874 case "$stdio_ptr" in
12875 '') stdio_ptr='((fp)->_ptr)'
12878 *) ptr_lval=$d_stdio_ptr_lval;;
12880 case "$stdio_cnt" in
12881 '') stdio_cnt='((fp)->_cnt)'
12884 *) cnt_lval=$d_stdio_cnt_lval;;
12886 case "$stdio_base" in
12887 '') stdio_base='((fp)->_base)';;
12889 case "$stdio_bufsiz" in
12890 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
12894 : test whether _ptr and _cnt really work
12895 echo "Checking how std your stdio is..." >&4
12898 #$i_stdlib I_STDLIB
12900 #include <stdlib.h>
12902 #define FILE_ptr(fp) $stdio_ptr
12903 #define FILE_cnt(fp) $stdio_cnt
12905 FILE *fp = fopen("try.c", "r");
12908 18 <= FILE_cnt(fp) &&
12909 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12917 if eval $compile && $to try.c; then
12918 if $run ./try; then
12919 echo "Your stdio acts pretty std."
12922 echo "Your stdio isn't very std."
12925 echo "Your stdio doesn't appear very std."
12929 # glibc 2.2.90 and above apparently change stdio streams so Perl's
12930 # direct buffer manipulation no longer works. The Configure tests
12931 # should be changed to correctly detect this, but until then,
12932 # the following check should at least let perl compile and run.
12933 # (This quick fix should be updated before 5.8.1.)
12934 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
12935 # A. Dougherty, June 3, 2002.
12936 case "$d_gnulibc" in
12938 case "$gnulibc_version" in
12942 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
12951 : Can _ptr be used as an lvalue?
12952 case "$d_stdstdio$ptr_lval" in
12953 $define$define) val=$define ;;
12956 set d_stdio_ptr_lval
12959 : Can _cnt be used as an lvalue?
12960 case "$d_stdstdio$cnt_lval" in
12961 $define$define) val=$define ;;
12964 set d_stdio_cnt_lval
12968 : test whether setting _ptr sets _cnt as a side effect
12969 d_stdio_ptr_lval_sets_cnt="$undef"
12970 d_stdio_ptr_lval_nochange_cnt="$undef"
12971 case "$d_stdio_ptr_lval$d_stdstdio" in
12973 echo "Checking to see what happens if we set the stdio ptr..." >&4
12976 /* Can we scream? */
12977 /* Eat dust sed :-) */
12978 /* In the buffer space, no one can hear you scream. */
12979 #$i_stdlib I_STDLIB
12981 #include <stdlib.h>
12983 #define FILE_ptr(fp) $stdio_ptr
12984 #define FILE_cnt(fp) $stdio_cnt
12985 #include <sys/types.h>
12987 FILE *fp = fopen("try.c", "r");
12992 puts("Fail even to read");
12995 c = getc(fp); /* Read away the first # */
12997 puts("Fail even to read");
13001 18 <= FILE_cnt(fp) &&
13002 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13004 puts("Fail even to read");
13007 ptr = (char*) FILE_ptr(fp);
13008 cnt = (size_t)FILE_cnt(fp);
13010 FILE_ptr(fp) += 42;
13012 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
13013 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
13016 if (FILE_cnt(fp) <= 20) {
13017 printf ("Fail (<20 chars to test)");
13020 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
13021 puts("Fail compare");
13024 if (cnt == FILE_cnt(fp)) {
13025 puts("Pass_unchanged");
13028 if (FILE_cnt(fp) == (cnt - 42)) {
13029 puts("Pass_changed");
13032 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
13038 if eval $compile && $to try.c; then
13039 case `$run ./try` in
13041 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
13042 d_stdio_ptr_lval_sets_cnt="$define" ;;
13044 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
13045 d_stdio_ptr_lval_nochange_cnt="$define" ;;
13047 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
13049 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
13052 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
13058 : see if _base is also standard
13060 case "$d_stdstdio" in
13064 #$i_stdlib I_STDLIB
13066 #include <stdlib.h>
13068 #define FILE_base(fp) $stdio_base
13069 #define FILE_bufsiz(fp) $stdio_bufsiz
13071 FILE *fp = fopen("try.c", "r");
13074 19 <= FILE_bufsiz(fp) &&
13075 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
13082 if eval $compile && $to try.c; then
13083 if $run ./try; then
13084 echo "And its _base field acts std."
13087 echo "But its _base field isn't std."
13090 echo "However, it seems to be lacking the _base field."
13098 : see if fast_stdio exists
13100 case "$d_stdstdio:$d_stdio_ptr_lval" in
13102 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
13104 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
13115 : see if fchdir exists
13116 set fchdir d_fchdir
13119 : see if fchmod exists
13120 set fchmod d_fchmod
13123 : see if fchown exists
13124 set fchown d_fchown
13127 : see if this is an fcntl system
13131 : See if fcntl-based locking works.
13134 #$i_stdlib I_STDLIB
13136 #include <stdlib.h>
13138 #include <unistd.h>
13140 #include <signal.h>
13141 $signal_t blech(int x) { exit(3); }
13143 #if defined(F_SETLK) && defined(F_SETLKW)
13144 struct flock flock;
13146 fd = open("try.c", O_RDONLY);
13147 flock.l_type = F_RDLCK;
13148 flock.l_whence = SEEK_SET;
13149 flock.l_start = flock.l_len = 0;
13150 signal(SIGALRM, blech);
13152 retval = fcntl(fd, F_SETLK, &flock);
13154 (retval < 0 ? exit(2) : exit(0));
13160 echo "Checking if fcntl-based file locking works... "
13164 if eval $compile_ok; then
13165 if $run ./try; then
13166 echo "Yes, it seems to work."
13169 echo "Nope, it didn't work."
13174 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
13175 *** This is (almost) impossible.
13176 *** If your NFS lock daemons are not feeling well, something like
13177 *** this may happen, please investigate. Cannot continue, aborting.
13185 echo "I'm unable to compile the test program, so I'll assume not."
13190 echo "Nope, since you don't even have fcntl()."
13193 set d_fcntl_can_lock
13197 : check for fd_set items
13200 Checking to see how well your C compiler handles fd_set and friends ...
13203 #$i_stdlib I_STDLIB
13205 #include <stdlib.h>
13207 #$i_systime I_SYS_TIME
13208 #$i_sysselct I_SYS_SELECT
13209 #$d_socket HAS_SOCKET
13210 #include <sys/types.h>
13212 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
13215 #include <sys/time.h>
13217 #ifdef I_SYS_SELECT
13218 #include <sys/select.h>
13227 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
13235 if eval $compile; then
13236 d_fds_bits="$define"
13238 echo "Well, your system knows about the normal fd_set typedef..." >&4
13239 if $run ./try; then
13240 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
13241 d_fd_macros="$define"
13244 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
13246 d_fd_macros="$undef"
13250 Hmm, your compiler has some difficulty with fd_set. Checking further...
13253 if eval $compile; then
13254 d_fds_bits="$undef"
13256 echo "Well, your system has some sort of fd_set available..." >&4
13257 if $run ./try; then
13258 echo "and you have the normal fd_set macros." >&4
13259 d_fd_macros="$define"
13262 but not the normal fd_set macros! Gross! More work for me...
13264 d_fd_macros="$undef"
13267 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
13269 d_fds_bits="$undef"
13270 d_fd_macros="$undef"
13275 : see if fgetpos exists
13276 set fgetpos d_fgetpos
13279 : see if finite exists
13280 set finite d_finite
13283 : see if finitel exists
13284 set finitel d_finitel
13287 : see if flock exists
13291 : see if prototype for flock is available
13293 set d_flockproto flock $i_sysfile sys/file.h
13296 : see if fp_class exists
13297 set fp_class d_fp_class
13300 : see if pathconf exists
13301 set pathconf d_pathconf
13304 : see if fpathconf exists
13305 set fpathconf d_fpathconf
13308 : see if fpclass exists
13309 set fpclass d_fpclass
13312 : see if fpclassify exists
13313 set fpclassify d_fpclassify
13316 : see if fpclassl exists
13317 set fpclassl d_fpclassl
13320 : check for fpos64_t
13322 echo "Checking to see if you have fpos64_t..." >&4
13325 int main() { fpos64_t x = 7; }
13328 if eval $compile; then
13330 echo "You have fpos64_t."
13333 echo "You do not have fpos64_t."
13334 case "$fpossize" in
13335 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
13342 : see if frexpl exists
13343 set frexpl d_frexpl
13346 : see if this is a sys/param system
13347 set sys/param.h i_sysparam
13350 : see if this is a sys/mount.h system
13351 set sys/mount.h i_sysmount
13354 : Check for fs_data_s
13356 echo "Checking to see if your system supports struct fs_data..." >&4
13357 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
13359 case "$d_fs_data_s" in
13360 "$define") echo "Yes, it does." ;;
13361 *) echo "No, it doesn't." ;;
13364 : see if fseeko exists
13365 set fseeko d_fseeko
13367 case "$longsize" in
13368 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
13371 : see if fsetpos exists
13372 set fsetpos d_fsetpos
13375 : see if fstatfs exists
13376 set fstatfs d_fstatfs
13379 : see if statvfs exists
13380 set statvfs d_statvfs
13383 : see if fstatvfs exists
13384 set fstatvfs d_fstatvfs
13388 : see if fsync exists
13392 : see if ftello exists
13393 set ftello d_ftello
13395 case "$longsize" in
13396 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
13399 : check for a working futimes
13402 echo "Checking if you have a working futimes()" >&4
13405 #include <sys/time.h>
13412 fd = open ("try.c", O_RDWR);
13413 if (-1 == fd) exit (1);
13414 rv = futimes (fd, NULL);
13415 exit (rv == -1 ? errno : 0);
13419 if eval $compile; then
13423 0) echo "Yes, you have" >&4
13424 d_futimes="$define"
13426 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
13430 echo "No, it does not (probably harmless)" >&4
13434 : see if ndbm.h is available
13437 : Compatibility location for RedHat 7.1
13438 set gdbm/ndbm.h i_gdbmndbm
13440 : Compatibility location for Debian 4.0
13441 set gdbm-ndbm.h i_gdbm_ndbm
13445 if $test "$i_ndbm" = "$define" -o "$i_gdbmndbm" = "$define" -o "$i_gdbm_ndbm" = "$define"; then
13446 : see if dbm_open exists
13447 set dbm_open d_dbm_open
13449 case "$d_dbm_open" in
13452 i_gdbmndbm="$undef"
13453 i_gdbm_ndbm="$undef"
13454 echo "We won't be including <ndbm.h>"
13464 ndbm_hdr_protochk='name=$1; hdr=$2;
13465 eval "ihdr=\$""i_$name";
13467 if $test "$ihdr" = "$define"; then
13468 $echo "Checking if your <$hdr> uses prototypes..." >&4;
13469 case "$d_cplusplus" in
13470 $define) ./protochk "$extern_C void dbm_close(DBM *);" literal "extern \"C\" {" $ihdr $hdr literal "}" && val="$define" ;;
13471 *) ./protochk "$extern_C void dbm_close(int, int);" $ihdr $hdr || val="$define" ;;
13474 $define) $echo "Your <$hdr> seems to have prototypes";;
13475 *) $echo "Your <$hdr> does not seem to have prototypes";;
13478 set "d_${name}_h_uses_prototypes";
13482 eval $ndbm_hdr_protochk
13483 set gdbmndbm gdbm/ndbm.h
13484 eval $ndbm_hdr_protochk
13485 set gdbm_ndbm gdbm-ndbm.h
13486 eval $ndbm_hdr_protochk
13488 : see if getaddrinfo exists
13489 set getaddrinfo d_getaddrinfo
13492 : see if getcwd exists
13493 set getcwd d_getcwd
13496 : see if getespwnam exists
13497 set getespwnam d_getespwnam
13500 : see if getfsstat exists
13501 set getfsstat d_getfsstat
13504 : see if getgrent exists
13505 set getgrent d_getgrent
13508 : see if getgrent_r exists
13509 set getgrent_r d_getgrent_r
13511 case "$d_getgrent_r" in
13513 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13514 case "$d_getgrent_r_proto:$usethreads" in
13515 ":define") d_getgrent_r_proto=define
13516 set d_getgrent_r_proto getgrent_r $hdrs
13520 case "$d_getgrent_r_proto" in
13522 case "$getgrent_r_proto" in
13523 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
13524 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBWR ;;
13526 case "$getgrent_r_proto" in
13527 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
13528 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIR ;;
13530 case "$getgrent_r_proto" in
13531 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
13532 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBW ;;
13534 case "$getgrent_r_proto" in
13535 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
13536 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBI ;;
13538 case "$getgrent_r_proto" in
13539 ''|0) try='int getgrent_r(struct group*, char*, int);'
13540 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBI ;;
13542 case "$getgrent_r_proto" in
13543 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
13544 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIH ;;
13546 case "$getgrent_r_proto" in
13547 ''|0) d_getgrent_r=undef
13549 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
13550 * ) case "$getgrent_r_proto" in
13551 REENTRANT_PROTO*) ;;
13552 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
13554 echo "Prototype: $try" ;;
13557 *) case "$usethreads" in
13558 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
13565 *) getgrent_r_proto=0
13569 : see if getgrgid_r exists
13570 set getgrgid_r d_getgrgid_r
13572 case "$d_getgrgid_r" in
13574 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13575 case "$d_getgrgid_r_proto:$usethreads" in
13576 ":define") d_getgrgid_r_proto=define
13577 set d_getgrgid_r_proto getgrgid_r $hdrs
13581 case "$d_getgrgid_r_proto" in
13583 case "$getgrgid_r_proto" in
13584 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
13585 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
13587 case "$getgrgid_r_proto" in
13588 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
13589 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
13591 case "$getgrgid_r_proto" in
13592 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
13593 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
13595 case "$getgrgid_r_proto" in
13596 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
13597 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
13599 case "$getgrgid_r_proto" in
13600 ''|0) d_getgrgid_r=undef
13602 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
13603 * ) case "$getgrgid_r_proto" in
13604 REENTRANT_PROTO*) ;;
13605 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
13607 echo "Prototype: $try" ;;
13610 *) case "$usethreads" in
13611 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
13618 *) getgrgid_r_proto=0
13622 : see if getgrnam_r exists
13623 set getgrnam_r d_getgrnam_r
13625 case "$d_getgrnam_r" in
13627 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13628 case "$d_getgrnam_r_proto:$usethreads" in
13629 ":define") d_getgrnam_r_proto=define
13630 set d_getgrnam_r_proto getgrnam_r $hdrs
13634 case "$d_getgrnam_r_proto" in
13636 case "$getgrnam_r_proto" in
13637 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
13638 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
13640 case "$getgrnam_r_proto" in
13641 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
13642 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
13644 case "$getgrnam_r_proto" in
13645 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
13646 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CBI ;;
13648 case "$getgrnam_r_proto" in
13649 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
13650 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
13652 case "$getgrnam_r_proto" in
13653 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
13654 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
13656 case "$getgrnam_r_proto" in
13657 ''|0) d_getgrnam_r=undef
13659 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
13660 * ) case "$getgrnam_r_proto" in
13661 REENTRANT_PROTO*) ;;
13662 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
13664 echo "Prototype: $try" ;;
13667 *) case "$usethreads" in
13668 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
13675 *) getgrnam_r_proto=0
13679 : see if gethostbyaddr exists
13680 set gethostbyaddr d_gethbyaddr
13683 : see if gethostbyname exists
13684 set gethostbyname d_gethbyname
13687 : see if gethostent exists
13688 set gethostent d_gethent
13691 : see how we will look up host name
13694 if set gethostname val -f d_gethname; eval $csym; $val; then
13695 echo 'gethostname() found.' >&4
13696 d_gethname="$define"
13699 if set uname val -f d_uname; eval $csym; $val; then
13702 uname() was found, but you're running xenix, and older versions of xenix
13703 have a broken uname(). If you don't really know whether your xenix is old
13704 enough to have a broken system call, use the default answer.
13709 "$define") dflt=n;;
13711 rp='Is your uname() broken?'
13714 n*) d_uname="$define"; call=uname;;
13717 echo 'uname() found.' >&4
13724 case "$d_gethname" in
13725 '') d_gethname="$undef";;
13728 '') d_uname="$undef";;
13730 case "$d_uname$d_gethname" in
13735 Every now and then someone has a $call() that lies about the hostname
13736 but can't be fixed for political or economic reasons. If you wish, I can
13737 pretend $call() isn't there and maybe compute hostname at run-time
13738 thanks to the '$phostname' command.
13741 rp="Shall I ignore $call() from now on?"
13744 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
13747 case "$phostname" in
13748 '') aphostname='';;
13749 *) case "$aphostname" in
13751 *) set X $phostname
13755 file=`./loc $file $file $pth`
13756 aphostname=`echo $file $*`
13761 case "$d_uname$d_gethname" in
13764 case "$phostname" in
13766 echo "There will be no way for $package to get your hostname." >&4;;
13768 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
13772 case "$d_phostname" in
13773 '') d_phostname="$undef";;
13776 : see if gethostbyaddr_r exists
13777 set gethostbyaddr_r d_gethostbyaddr_r
13779 case "$d_gethostbyaddr_r" in
13781 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13782 case "$d_gethostbyaddr_r_proto:$usethreads" in
13783 ":define") d_gethostbyaddr_r_proto=define
13784 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
13788 case "$d_gethostbyaddr_r_proto" in
13790 case "$gethostbyaddr_r_proto" in
13791 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13792 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
13794 case "$gethostbyaddr_r_proto" in
13795 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
13796 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
13798 case "$gethostbyaddr_r_proto" in
13799 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
13800 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
13802 case "$gethostbyaddr_r_proto" in
13803 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
13804 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
13806 case "$gethostbyaddr_r_proto" in
13807 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
13808 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
13810 case "$gethostbyaddr_r_proto" in
13811 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
13812 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
13814 case "$gethostbyaddr_r_proto" in
13815 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
13816 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
13818 case "$gethostbyaddr_r_proto" in
13819 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
13820 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
13822 case "$gethostbyaddr_r_proto" in
13823 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
13824 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
13826 case "$gethostbyaddr_r_proto" in
13827 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
13828 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
13830 case "$gethostbyaddr_r_proto" in
13831 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13832 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
13834 case "$gethostbyaddr_r_proto" in
13835 ''|0) d_gethostbyaddr_r=undef
13836 gethostbyaddr_r_proto=0
13837 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
13838 * ) case "$gethostbyaddr_r_proto" in
13839 REENTRANT_PROTO*) ;;
13840 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
13842 echo "Prototype: $try" ;;
13845 *) case "$usethreads" in
13846 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
13848 d_gethostbyaddr_r=undef
13849 gethostbyaddr_r_proto=0
13853 *) gethostbyaddr_r_proto=0
13857 : see if gethostbyname_r exists
13858 set gethostbyname_r d_gethostbyname_r
13860 case "$d_gethostbyname_r" in
13862 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13863 case "$d_gethostbyname_r_proto:$usethreads" in
13864 ":define") d_gethostbyname_r_proto=define
13865 set d_gethostbyname_r_proto gethostbyname_r $hdrs
13869 case "$d_gethostbyname_r_proto" in
13871 case "$gethostbyname_r_proto" in
13872 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
13873 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
13875 case "$gethostbyname_r_proto" in
13876 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
13877 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
13879 case "$gethostbyname_r_proto" in
13880 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
13881 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
13883 case "$gethostbyname_r_proto" in
13884 ''|0) d_gethostbyname_r=undef
13885 gethostbyname_r_proto=0
13886 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
13887 * ) case "$gethostbyname_r_proto" in
13888 REENTRANT_PROTO*) ;;
13889 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
13891 echo "Prototype: $try" ;;
13894 *) case "$usethreads" in
13895 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
13897 d_gethostbyname_r=undef
13898 gethostbyname_r_proto=0
13902 *) gethostbyname_r_proto=0
13906 : see if gethostent_r exists
13907 set gethostent_r d_gethostent_r
13909 case "$d_gethostent_r" in
13911 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13912 case "$d_gethostent_r_proto:$usethreads" in
13913 ":define") d_gethostent_r_proto=define
13914 set d_gethostent_r_proto gethostent_r $hdrs
13918 case "$d_gethostent_r_proto" in
13920 case "$gethostent_r_proto" in
13921 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
13922 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
13924 case "$gethostent_r_proto" in
13925 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
13926 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBIE ;;
13928 case "$gethostent_r_proto" in
13929 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
13930 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBIE ;;
13932 case "$gethostent_r_proto" in
13933 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
13934 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBI ;;
13936 case "$gethostent_r_proto" in
13937 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
13938 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBI ;;
13940 case "$gethostent_r_proto" in
13941 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
13942 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SD ;;
13944 case "$gethostent_r_proto" in
13945 ''|0) d_gethostent_r=undef
13946 gethostent_r_proto=0
13947 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
13948 * ) case "$gethostent_r_proto" in
13949 REENTRANT_PROTO*) ;;
13950 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
13952 echo "Prototype: $try" ;;
13955 *) case "$usethreads" in
13956 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
13958 d_gethostent_r=undef
13959 gethostent_r_proto=0
13963 *) gethostent_r_proto=0
13967 : see if prototypes for various gethostxxx netdb.h functions are available
13969 set d_gethostprotos gethostent $i_netdb netdb.h
13972 : see if getitimer exists
13973 set getitimer d_getitimer
13976 : see if getlogin exists
13977 set getlogin d_getlogin
13980 : see if getlogin_r exists
13981 set getlogin_r d_getlogin_r
13983 case "$d_getlogin_r" in
13985 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
13986 case "$d_getlogin_r_proto:$usethreads" in
13987 ":define") d_getlogin_r_proto=define
13988 set d_getlogin_r_proto getlogin_r $hdrs
13992 case "$d_getlogin_r_proto" in
13994 case "$getlogin_r_proto" in
13995 ''|0) try='int getlogin_r(char*, size_t);'
13996 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BW ;;
13998 case "$getlogin_r_proto" in
13999 ''|0) try='int getlogin_r(char*, int);'
14000 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BI ;;
14002 case "$getlogin_r_proto" in
14003 ''|0) try='char* getlogin_r(char*, size_t);'
14004 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BW ;;
14006 case "$getlogin_r_proto" in
14007 ''|0) try='char* getlogin_r(char*, int);'
14008 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BI ;;
14010 case "$getlogin_r_proto" in
14011 ''|0) d_getlogin_r=undef
14013 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
14014 * ) case "$getlogin_r_proto" in
14015 REENTRANT_PROTO*) ;;
14016 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
14018 echo "Prototype: $try" ;;
14021 *) case "$usethreads" in
14022 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
14029 *) getlogin_r_proto=0
14033 : see if getmnt exists
14034 set getmnt d_getmnt
14037 : see if getmntent exists
14038 set getmntent d_getmntent
14041 : see if getnameinfo exists
14042 set getnameinfo d_getnameinfo
14045 : see if getnetbyaddr exists
14046 set getnetbyaddr d_getnbyaddr
14049 : see if getnetbyname exists
14050 set getnetbyname d_getnbyname
14053 : see if getnetent exists
14054 set getnetent d_getnent
14057 : see if getnetbyaddr_r exists
14058 set getnetbyaddr_r d_getnetbyaddr_r
14060 case "$d_getnetbyaddr_r" in
14062 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14063 case "$d_getnetbyaddr_r_proto:$usethreads" in
14064 ":define") d_getnetbyaddr_r_proto=define
14065 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
14069 case "$d_getnetbyaddr_r_proto" in
14071 case "$getnetbyaddr_r_proto" in
14072 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
14073 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
14075 case "$getnetbyaddr_r_proto" in
14076 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
14077 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
14079 case "$getnetbyaddr_r_proto" in
14080 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
14081 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
14083 case "$getnetbyaddr_r_proto" in
14084 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
14085 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
14087 case "$getnetbyaddr_r_proto" in
14088 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
14089 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
14091 case "$getnetbyaddr_r_proto" in
14092 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
14093 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
14095 case "$getnetbyaddr_r_proto" in
14096 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
14097 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
14099 case "$getnetbyaddr_r_proto" in
14100 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
14101 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
14103 case "$getnetbyaddr_r_proto" in
14104 ''|0) d_getnetbyaddr_r=undef
14105 getnetbyaddr_r_proto=0
14106 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
14107 * ) case "$getnetbyaddr_r_proto" in
14108 REENTRANT_PROTO*) ;;
14109 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
14111 echo "Prototype: $try" ;;
14114 *) case "$usethreads" in
14115 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
14117 d_getnetbyaddr_r=undef
14118 getnetbyaddr_r_proto=0
14122 *) getnetbyaddr_r_proto=0
14126 : see if getnetbyname_r exists
14127 set getnetbyname_r d_getnetbyname_r
14129 case "$d_getnetbyname_r" in
14131 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14132 case "$d_getnetbyname_r_proto:$usethreads" in
14133 ":define") d_getnetbyname_r_proto=define
14134 set d_getnetbyname_r_proto getnetbyname_r $hdrs
14138 case "$d_getnetbyname_r_proto" in
14140 case "$getnetbyname_r_proto" in
14141 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
14142 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
14144 case "$getnetbyname_r_proto" in
14145 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
14146 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
14148 case "$getnetbyname_r_proto" in
14149 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
14150 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
14152 case "$getnetbyname_r_proto" in
14153 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
14154 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
14156 case "$getnetbyname_r_proto" in
14157 ''|0) d_getnetbyname_r=undef
14158 getnetbyname_r_proto=0
14159 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
14160 * ) case "$getnetbyname_r_proto" in
14161 REENTRANT_PROTO*) ;;
14162 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
14164 echo "Prototype: $try" ;;
14167 *) case "$usethreads" in
14168 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
14170 d_getnetbyname_r=undef
14171 getnetbyname_r_proto=0
14175 *) getnetbyname_r_proto=0
14179 : see if getnetent_r exists
14180 set getnetent_r d_getnetent_r
14182 case "$d_getnetent_r" in
14184 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14185 case "$d_getnetent_r_proto:$usethreads" in
14186 ":define") d_getnetent_r_proto=define
14187 set d_getnetent_r_proto getnetent_r $hdrs
14191 case "$d_getnetent_r_proto" in
14193 case "$getnetent_r_proto" in
14194 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
14195 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
14197 case "$getnetent_r_proto" in
14198 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
14199 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBIE ;;
14201 case "$getnetent_r_proto" in
14202 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
14203 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBIE ;;
14205 case "$getnetent_r_proto" in
14206 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
14207 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBI ;;
14209 case "$getnetent_r_proto" in
14210 ''|0) try='int getnetent_r(struct netent*, char*, int);'
14211 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBI ;;
14213 case "$getnetent_r_proto" in
14214 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
14215 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SD ;;
14217 case "$getnetent_r_proto" in
14218 ''|0) d_getnetent_r=undef
14219 getnetent_r_proto=0
14220 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
14221 * ) case "$getnetent_r_proto" in
14222 REENTRANT_PROTO*) ;;
14223 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
14225 echo "Prototype: $try" ;;
14228 *) case "$usethreads" in
14229 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
14231 d_getnetent_r=undef
14232 getnetent_r_proto=0
14236 *) getnetent_r_proto=0
14240 : see if prototypes for various getnetxxx netdb.h functions are available
14242 set d_getnetprotos getnetent $i_netdb netdb.h
14245 : see if getpagesize exists
14246 set getpagesize d_getpagsz
14249 : Optional checks for getprotobyname and getprotobynumber
14251 : see if getprotobyname exists
14252 set getprotobyname d_getpbyname
14255 : see if getprotobynumber exists
14256 set getprotobynumber d_getpbynumber
14259 : see if getprotoent exists
14260 set getprotoent d_getpent
14263 : see if getpgid exists
14264 set getpgid d_getpgid
14267 : see if getpgrp2 exists
14268 set getpgrp2 d_getpgrp2
14271 : see if getppid exists
14272 set getppid d_getppid
14275 : see if getpriority exists
14276 set getpriority d_getprior
14279 : see if getprotobyname_r exists
14280 set getprotobyname_r d_getprotobyname_r
14282 case "$d_getprotobyname_r" in
14284 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14285 case "$d_getprotobyname_r_proto:$usethreads" in
14286 ":define") d_getprotobyname_r_proto=define
14287 set d_getprotobyname_r_proto getprotobyname_r $hdrs
14291 case "$d_getprotobyname_r_proto" in
14293 case "$getprotobyname_r_proto" in
14294 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
14295 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
14297 case "$getprotobyname_r_proto" in
14298 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
14299 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
14301 case "$getprotobyname_r_proto" in
14302 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
14303 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
14305 case "$getprotobyname_r_proto" in
14306 ''|0) d_getprotobyname_r=undef
14307 getprotobyname_r_proto=0
14308 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
14309 * ) case "$getprotobyname_r_proto" in
14310 REENTRANT_PROTO*) ;;
14311 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
14313 echo "Prototype: $try" ;;
14316 *) case "$usethreads" in
14317 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
14319 d_getprotobyname_r=undef
14320 getprotobyname_r_proto=0
14324 *) getprotobyname_r_proto=0
14328 : see if getprotobynumber_r exists
14329 set getprotobynumber_r d_getprotobynumber_r
14331 case "$d_getprotobynumber_r" in
14333 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14334 case "$d_getprotobynumber_r_proto:$usethreads" in
14335 ":define") d_getprotobynumber_r_proto=define
14336 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
14340 case "$d_getprotobynumber_r_proto" in
14342 case "$getprotobynumber_r_proto" in
14343 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
14344 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
14346 case "$getprotobynumber_r_proto" in
14347 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
14348 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
14350 case "$getprotobynumber_r_proto" in
14351 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
14352 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
14354 case "$getprotobynumber_r_proto" in
14355 ''|0) d_getprotobynumber_r=undef
14356 getprotobynumber_r_proto=0
14357 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
14358 * ) case "$getprotobynumber_r_proto" in
14359 REENTRANT_PROTO*) ;;
14360 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
14362 echo "Prototype: $try" ;;
14365 *) case "$usethreads" in
14366 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
14368 d_getprotobynumber_r=undef
14369 getprotobynumber_r_proto=0
14373 *) getprotobynumber_r_proto=0
14377 : see if getprotoent_r exists
14378 set getprotoent_r d_getprotoent_r
14380 case "$d_getprotoent_r" in
14382 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14383 case "$d_getprotoent_r_proto:$usethreads" in
14384 ":define") d_getprotoent_r_proto=define
14385 set d_getprotoent_r_proto getprotoent_r $hdrs
14389 case "$d_getprotoent_r_proto" in
14391 case "$getprotoent_r_proto" in
14392 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
14393 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
14395 case "$getprotoent_r_proto" in
14396 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
14397 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBI ;;
14399 case "$getprotoent_r_proto" in
14400 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
14401 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=S_SBI ;;
14403 case "$getprotoent_r_proto" in
14404 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
14405 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SD ;;
14407 case "$getprotoent_r_proto" in
14408 ''|0) d_getprotoent_r=undef
14409 getprotoent_r_proto=0
14410 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
14411 * ) case "$getprotoent_r_proto" in
14412 REENTRANT_PROTO*) ;;
14413 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
14415 echo "Prototype: $try" ;;
14418 *) case "$usethreads" in
14419 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
14421 d_getprotoent_r=undef
14422 getprotoent_r_proto=0
14426 *) getprotoent_r_proto=0
14430 : see if prototypes for various getprotoxxx netdb.h functions are available
14432 set d_getprotoprotos getprotoent $i_netdb netdb.h
14435 : see if getprpwnam exists
14436 set getprpwnam d_getprpwnam
14439 : see if getpwent exists
14440 set getpwent d_getpwent
14443 : see if getpwent_r exists
14444 set getpwent_r d_getpwent_r
14446 case "$d_getpwent_r" in
14448 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14449 case "$d_getpwent_r_proto:$usethreads" in
14450 ":define") d_getpwent_r_proto=define
14451 set d_getpwent_r_proto getpwent_r $hdrs
14455 case "$d_getpwent_r_proto" in
14457 case "$getpwent_r_proto" in
14458 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
14459 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBWR ;;
14461 case "$getpwent_r_proto" in
14462 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
14463 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIR ;;
14465 case "$getpwent_r_proto" in
14466 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
14467 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBW ;;
14469 case "$getpwent_r_proto" in
14470 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
14471 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBI ;;
14473 case "$getpwent_r_proto" in
14474 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
14475 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBI ;;
14477 case "$getpwent_r_proto" in
14478 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
14479 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIH ;;
14481 case "$getpwent_r_proto" in
14482 ''|0) d_getpwent_r=undef
14484 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
14485 * ) case "$getpwent_r_proto" in
14486 REENTRANT_PROTO*) ;;
14487 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
14489 echo "Prototype: $try" ;;
14492 *) case "$usethreads" in
14493 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
14500 *) getpwent_r_proto=0
14504 : see if getpwnam_r exists
14505 set getpwnam_r d_getpwnam_r
14507 case "$d_getpwnam_r" in
14509 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14510 case "$d_getpwnam_r_proto:$usethreads" in
14511 ":define") d_getpwnam_r_proto=define
14512 set d_getpwnam_r_proto getpwnam_r $hdrs
14516 case "$d_getpwnam_r_proto" in
14518 case "$getpwnam_r_proto" in
14519 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
14520 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
14522 case "$getpwnam_r_proto" in
14523 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
14524 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
14526 case "$getpwnam_r_proto" in
14527 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
14528 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
14530 case "$getpwnam_r_proto" in
14531 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
14532 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
14534 case "$getpwnam_r_proto" in
14535 ''|0) d_getpwnam_r=undef
14537 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
14538 * ) case "$getpwnam_r_proto" in
14539 REENTRANT_PROTO*) ;;
14540 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
14542 echo "Prototype: $try" ;;
14545 *) case "$usethreads" in
14546 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
14553 *) getpwnam_r_proto=0
14557 : see if getpwuid_r exists
14558 set getpwuid_r d_getpwuid_r
14560 case "$d_getpwuid_r" in
14562 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14563 case "$d_getpwuid_r_proto:$usethreads" in
14564 ":define") d_getpwuid_r_proto=define
14565 set d_getpwuid_r_proto getpwuid_r $hdrs
14569 case "$d_getpwuid_r_proto" in
14571 case "$getpwuid_r_proto" in
14572 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
14573 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
14575 case "$getpwuid_r_proto" in
14576 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
14577 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
14579 case "$getpwuid_r_proto" in
14580 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
14581 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
14583 case "$getpwuid_r_proto" in
14584 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
14585 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
14587 case "$getpwuid_r_proto" in
14588 ''|0) d_getpwuid_r=undef
14590 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
14591 * ) case "$getpwuid_r_proto" in
14592 REENTRANT_PROTO*) ;;
14593 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
14595 echo "Prototype: $try" ;;
14598 *) case "$usethreads" in
14599 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
14606 *) getpwuid_r_proto=0
14610 : Optional checks for getsbyname and getsbyport
14612 : see if getservbyname exists
14613 set getservbyname d_getsbyname
14616 : see if getservbyport exists
14617 set getservbyport d_getsbyport
14620 : see if getservent exists
14621 set getservent d_getsent
14624 : see if getservbyname_r exists
14625 set getservbyname_r d_getservbyname_r
14627 case "$d_getservbyname_r" in
14629 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14630 case "$d_getservbyname_r_proto:$usethreads" in
14631 ":define") d_getservbyname_r_proto=define
14632 set d_getservbyname_r_proto getservbyname_r $hdrs
14636 case "$d_getservbyname_r_proto" in
14638 case "$getservbyname_r_proto" in
14639 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
14640 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
14642 case "$getservbyname_r_proto" in
14643 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
14644 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
14646 case "$getservbyname_r_proto" in
14647 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
14648 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
14650 case "$getservbyname_r_proto" in
14651 ''|0) d_getservbyname_r=undef
14652 getservbyname_r_proto=0
14653 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
14654 * ) case "$getservbyname_r_proto" in
14655 REENTRANT_PROTO*) ;;
14656 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
14658 echo "Prototype: $try" ;;
14661 *) case "$usethreads" in
14662 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
14664 d_getservbyname_r=undef
14665 getservbyname_r_proto=0
14669 *) getservbyname_r_proto=0
14673 : see if getservbyport_r exists
14674 set getservbyport_r d_getservbyport_r
14676 case "$d_getservbyport_r" in
14678 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14679 case "$d_getservbyport_r_proto:$usethreads" in
14680 ":define") d_getservbyport_r_proto=define
14681 set d_getservbyport_r_proto getservbyport_r $hdrs
14685 case "$d_getservbyport_r_proto" in
14687 case "$getservbyport_r_proto" in
14688 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
14689 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
14691 case "$getservbyport_r_proto" in
14692 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
14693 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
14695 case "$getservbyport_r_proto" in
14696 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
14697 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
14699 case "$getservbyport_r_proto" in
14700 ''|0) d_getservbyport_r=undef
14701 getservbyport_r_proto=0
14702 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
14703 * ) case "$getservbyport_r_proto" in
14704 REENTRANT_PROTO*) ;;
14705 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
14707 echo "Prototype: $try" ;;
14710 *) case "$usethreads" in
14711 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
14713 d_getservbyport_r=undef
14714 getservbyport_r_proto=0
14718 *) getservbyport_r_proto=0
14722 : see if getservent_r exists
14723 set getservent_r d_getservent_r
14725 case "$d_getservent_r" in
14727 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14728 case "$d_getservent_r_proto:$usethreads" in
14729 ":define") d_getservent_r_proto=define
14730 set d_getservent_r_proto getservent_r $hdrs
14734 case "$d_getservent_r_proto" in
14736 case "$getservent_r_proto" in
14737 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
14738 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBWR ;;
14740 case "$getservent_r_proto" in
14741 ''|0) try='int getservent_r(struct servent*, char*, int);'
14742 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBI ;;
14744 case "$getservent_r_proto" in
14745 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
14746 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=S_SBI ;;
14748 case "$getservent_r_proto" in
14749 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
14750 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SD ;;
14752 case "$getservent_r_proto" in
14753 ''|0) d_getservent_r=undef
14754 getservent_r_proto=0
14755 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
14756 * ) case "$getservent_r_proto" in
14757 REENTRANT_PROTO*) ;;
14758 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
14760 echo "Prototype: $try" ;;
14763 *) case "$usethreads" in
14764 define) echo "getservent_r has no prototype, not using it." >&4 ;;
14766 d_getservent_r=undef
14767 getservent_r_proto=0
14771 *) getservent_r_proto=0
14775 : see if prototypes for various getservxxx netdb.h functions are available
14777 set d_getservprotos getservent $i_netdb netdb.h
14780 : see if getspnam exists
14781 set getspnam d_getspnam
14784 : see if this is a shadow.h system
14785 set shadow.h i_shadow
14788 : see if getspnam_r exists
14789 set getspnam_r d_getspnam_r
14791 case "$d_getspnam_r" in
14793 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
14794 case "$d_getspnam_r_proto:$usethreads" in
14795 ":define") d_getspnam_r_proto=define
14796 set d_getspnam_r_proto getspnam_r $hdrs
14800 case "$d_getspnam_r_proto" in
14802 case "$getspnam_r_proto" in
14803 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
14804 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
14806 case "$getspnam_r_proto" in
14807 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
14808 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=S_CSBI ;;
14810 case "$getspnam_r_proto" in
14811 ''|0) d_getspnam_r=undef
14813 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
14814 * ) case "$getspnam_r_proto" in
14815 REENTRANT_PROTO*) ;;
14816 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
14818 echo "Prototype: $try" ;;
14821 *) case "$usethreads" in
14822 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
14829 *) getspnam_r_proto=0
14833 : see if gettimeofday or ftime exists
14834 set gettimeofday d_gettimeod
14836 case "$d_gettimeod" in
14842 val="$undef"; set d_ftime; eval $setvar
14845 case "$d_gettimeod$d_ftime" in
14848 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
14852 : see if gmtime_r exists
14853 set gmtime_r d_gmtime_r
14855 case "$d_gmtime_r" in
14857 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14858 case "$d_gmtime_r_proto:$usethreads" in
14859 ":define") d_gmtime_r_proto=define
14860 set d_gmtime_r_proto gmtime_r $hdrs
14864 case "$d_gmtime_r_proto" in
14866 case "$gmtime_r_proto" in
14867 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
14868 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=S_TS ;;
14870 case "$gmtime_r_proto" in
14871 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
14872 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=I_TS ;;
14874 case "$gmtime_r_proto" in
14875 ''|0) d_gmtime_r=undef
14877 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
14878 * ) case "$gmtime_r_proto" in
14879 REENTRANT_PROTO*) ;;
14880 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
14882 echo "Prototype: $try" ;;
14885 *) case "$usethreads" in
14886 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
14893 *) gmtime_r_proto=0
14897 : see if hasmntopt exists
14898 set hasmntopt d_hasmntopt
14901 : see if this is a netinet/in.h or sys/in.h system
14902 set netinet/in.h i_niin sys/in.h i_sysin
14905 : see if arpa/inet.h has to be included
14906 set arpa/inet.h i_arpainet
14909 : see if htonl --and friends-- exists
14914 : Maybe they are macros.
14917 $cat >htonl.c <<EOM
14919 #include <sys/types.h>
14920 #$i_niin I_NETINET_IN
14922 #$i_arpainet I_ARPA_INET
14923 #ifdef I_NETINET_IN
14924 #include <netinet/in.h>
14927 #include <sys/in.h>
14930 #include <arpa/inet.h>
14933 printf("Defined as a macro.");
14936 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
14937 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
14939 echo "But it seems to be defined as a macro." >&4
14947 : see if ilogbl exists
14948 set ilogbl d_ilogbl
14953 if set index val -f; eval $csym; $val; then
14954 if set strchr val -f d_strchr; eval $csym; $val; then
14955 if $contains strchr "$strings" >/dev/null 2>&1 ; then
14958 echo "strchr() found." >&4
14962 echo "index() found." >&4
14967 echo "index() found." >&4
14970 if set strchr val -f d_strchr; eval $csym; $val; then
14973 echo "strchr() found." >&4
14975 echo "No index() or strchr() found!" >&4
14980 set d_strchr; eval $setvar
14982 set d_index; eval $setvar
14984 : check whether inet_aton exists
14985 set inet_aton d_inetaton
14988 : see if inet_ntop exists
14989 set inet_ntop d_inetntop
14992 : see if inet_pton exists
14993 set inet_pton d_inetpton
14998 $cat >isascii.c <<EOCP
15001 #$i_stdlib I_STDLIB
15003 #include <stdlib.h>
15014 if eval $compile; then
15015 echo "isascii() found." >&4
15018 echo "isascii() NOT found." >&4
15027 $cat >isblank.c <<'EOCP'
15038 if $cc $ccflags $ldflags -o isblank isblank.c $libs >/dev/null 2>&1 ; then
15039 echo "isblank() found." >&4
15042 echo "isblank() NOT found." >&4
15049 : see if isfinite exists
15050 set isfinite d_isfinite
15053 : see if isinf exists
15057 : see if isnan exists
15061 : see if isnanl exists
15062 set isnanl d_isnanl
15065 : see if killpg exists
15066 set killpg d_killpg
15069 : see if lchown exists
15071 $cat > try.c <<'EOCP'
15072 /* System header to define __stub macros and hopefully few prototypes,
15073 which can conflict with char lchown(); below. */
15074 #include <assert.h>
15075 /* Override any gcc2 internal prototype to avoid an error. */
15076 /* We use char because int might match the return type of a gcc2
15077 builtin and then its argument prototype would still apply. */
15080 /* The GNU C library defines this for functions which it implements
15081 to always fail with ENOSYS. Some functions are actually named
15082 something starting with __ and the normal name is an alias. */
15083 #if defined (__stub_lchown) || defined (__stub___lchown)
15091 if eval $compile; then
15092 $echo "lchown() found." >&4
15095 $echo "lchown() NOT found." >&4
15101 : See if number of significant digits in a double precision number is known
15103 $cat >ldbl_dig.c <<EOM
15104 #$i_limits I_LIMITS
15107 #include <limits.h>
15113 printf("Contains LDBL_DIG");
15116 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
15117 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
15118 echo "LDBL_DIG found." >&4
15121 echo "LDBL_DIG NOT found." >&4
15128 : see if this is a math.h system
15132 : check to see if math.h defines _LIB_VERSION
15133 d_libm_lib_version="$undef"
15137 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
15139 #include <unistd.h>
15141 int main (int argc, char *argv[])
15143 printf ("%d\n", _LIB_VERSION);
15148 if eval $compile; then
15150 echo "Yes, it does ($foo)" >&4
15151 d_libm_lib_version="$define"
15153 echo "No, it does not (probably harmless)" >&4
15160 : see if link exists
15164 : see if localtime_r exists
15165 set localtime_r d_localtime_r
15167 case "$d_localtime_r" in
15169 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15170 case "$d_localtime_r_proto:$usethreads" in
15171 ":define") d_localtime_r_proto=define
15172 set d_localtime_r_proto localtime_r $hdrs
15176 case "$d_localtime_r_proto" in
15178 case "$localtime_r_proto" in
15179 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
15180 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=S_TS ;;
15182 case "$localtime_r_proto" in
15183 ''|0) try='int localtime_r(const time_t*, struct tm*);'
15184 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=I_TS ;;
15186 case "$localtime_r_proto" in
15187 ''|0) d_localtime_r=undef
15188 localtime_r_proto=0
15189 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
15190 * ) case "$localtime_r_proto" in
15191 REENTRANT_PROTO*) ;;
15192 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
15194 echo "Prototype: $try" ;;
15197 *) case "$usethreads" in
15198 define) echo "localtime_r has no prototype, not using it." >&4 ;;
15200 d_localtime_r=undef
15201 localtime_r_proto=0
15205 *) localtime_r_proto=0
15209 : see if localtime_r calls tzset
15210 case "$localtime_r_proto" in
15213 /* Does our libc's localtime_r call tzset ?
15214 * return 0 if so, 1 otherwise.
15216 #$i_systypes I_SYS_TYPES
15217 #$i_unistd I_UNISTD
15219 #$i_stdlib I_STDLIB
15220 #$i_string I_STRING
15221 #$i_malloc I_MALLOC
15223 # include <sys/types.h>
15226 # include <unistd.h>
15232 #include <stdlib.h>
15235 # include <string.h>
15237 # include <strings.h>
15240 # include <malloc.h>
15244 time_t t = time(0L);
15245 char w_tz[]="TZ" "=GMT+5",
15246 e_tz[]="TZ" "=GMT-5",
15247 *tz_e = (char*)malloc(16),
15248 *tz_w = (char*)malloc(16);
15249 struct tm tm_e, tm_w;
15250 memset(&tm_e,'\0',sizeof(struct tm));
15251 memset(&tm_w,'\0',sizeof(struct tm));
15256 localtime_r(&t, &tm_e);
15259 localtime_r(&t, &tm_w);
15261 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
15267 if eval $compile; then
15268 if $run ./try; then
15269 d_localtime_r_needs_tzset=undef;
15271 d_localtime_r_needs_tzset=define;
15274 d_localtime_r_needs_tzset=undef;
15278 d_localtime_r_needs_tzset=undef;
15283 : see if localeconv exists
15284 set localeconv d_locconv
15287 : see if lockf exists
15291 : see if prototype for lseek is available
15293 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
15296 : see if lstat exists
15300 : see if madvise exists
15301 set madvise d_madvise
15304 : see if malloc_size exists
15305 set malloc_size d_malloc_size
15308 : see if malloc_size_good exists
15309 set malloc_good_size d_malloc_good_size
15312 : see if mblen exists
15316 : see if mbstowcs exists
15317 set mbstowcs d_mbstowcs
15320 : see if mbtowc exists
15321 set mbtowc d_mbtowc
15324 : see if memchr exists
15325 set memchr d_memchr
15328 : see if memcmp exists
15329 set memcmp d_memcmp
15332 : see if memcpy exists
15333 set memcpy d_memcpy
15336 : see if memmove exists
15337 set memmove d_memmove
15340 : see if memset exists
15341 set memset d_memset
15344 : see if mkdir exists
15348 : see if mkdtemp exists
15349 set mkdtemp d_mkdtemp
15352 : see if mkfifo exists
15353 set mkfifo d_mkfifo
15356 : see if mkstemp exists
15357 set mkstemp d_mkstemp
15360 : see if mkstemps exists
15361 set mkstemps d_mkstemps
15364 : see if mktime exists
15365 set mktime d_mktime
15368 : see if this is a sys/mman.h system
15369 set sys/mman.h i_sysmman
15372 : see if mmap exists
15375 : see what shmat returns
15376 : default to something harmless
15378 case "$i_sysmman$d_mmap" in
15380 $cat >mmap.c <<'END'
15381 #include <sys/mman.h>
15384 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
15389 echo "and it returns ($mmaptype)." >&4
15395 : see if sqrtl exists
15399 : see if scalbnl exists
15400 set scalbnl d_scalbnl
15403 : see if modfl exists
15407 : see if prototype for modfl is available
15409 set d_modflproto modfl $i_math math.h
15412 d_modfl_pow32_bug="$undef"
15414 case "$d_longdbl$d_modfl" in
15417 Checking to see whether your modfl() is okay for large values...
15423 if $test "X$d_modflproto" != "X$define"; then
15424 $cat >>try.c <<EOCP
15425 /* Sigh. many current glibcs provide the function, but do not prototype it. */
15426 long double modfl (long double, long double *);
15429 $cat >>try.c <<EOCP
15431 long double nv = 4294967303.15;
15437 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
15441 case "$osname:$gccversion" in
15442 aix:) saveccflags="$ccflags"
15443 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
15446 if eval $compile; then
15449 *" 4294967303.150000 1.150000 4294967302.000000")
15450 echo >&4 "Your modfl() is broken for large values."
15451 d_modfl_pow32_bug="$define"
15453 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
15457 *" 4294967303.150000 0.150000 4294967303.000000")
15458 echo >&4 "Your modfl() seems okay for large values."
15460 *) echo >&4 "I don't understand your modfl() at all."
15466 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
15469 case "$osname:$gccversion" in
15470 aix:) ccflags="$saveccflags" ;; # restore
15475 if $test "$uselongdouble" = "$define"; then
15477 if $test "$d_sqrtl" != "$define"; then
15478 message="$message sqrtl"
15480 if $test "$d_modfl" != "$define"; then
15481 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
15482 echo "You have both aintl and copysignl, so I can emulate modfl."
15484 message="$message modfl"
15487 if $test "$d_frexpl" != "$define"; then
15488 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
15489 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
15491 message="$message frexpl"
15495 if $test "$message" != ""; then
15498 *** You requested the use of long doubles but you do not seem to have
15499 *** the following mathematical functions needed for long double support:
15501 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
15502 *** Cannot continue, aborting.
15510 : see if mprotect exists
15511 set mprotect d_mprotect
15514 : see if msgctl exists
15515 set msgctl d_msgctl
15518 : see if msgget exists
15519 set msgget d_msgget
15522 : see if msgsnd exists
15523 set msgsnd d_msgsnd
15526 : see if msgrcv exists
15527 set msgrcv d_msgrcv
15530 : see how much of the 'msg*(2)' library is present.
15533 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
15534 *"$undef"*) h_msg=false;;
15538 case "`ipcs 2>&1`" in
15539 "SVID messages"*"not configured"*)
15540 echo "Your $osname does not have the msg*(2) configured." >&4
15543 set msgctl d_msgctl
15545 set msgget d_msgget
15547 set msgsnd d_msgsnd
15549 set msgrcv d_msgrcv
15555 : we could also check for sys/ipc.h ...
15556 if $h_msg && $test `./findhdr sys/msg.h`; then
15557 echo "You have the full msg*(2) library." >&4
15560 echo "You don't have the full msg*(2) library." >&4
15566 : Check for msghdr_s
15568 echo "Checking to see if your system supports struct msghdr..." >&4
15569 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
15571 case "$d_msghdr_s" in
15572 "$define") echo "Yes, it does." ;;
15573 *) echo "No, it doesn't." ;;
15577 : see if msync exists
15581 : see if munmap exists
15582 set munmap d_munmap
15585 : see if nice exists
15589 : see if this is a langinfo.h system
15590 set langinfo.h i_langinfo
15593 : see if nl_langinfo exists
15594 set nl_langinfo d_nl_langinfo
15597 : check for volatile keyword
15599 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
15600 $cat >try.c <<'EOCP'
15603 typedef struct _goo_struct goo_struct;
15604 goo_struct * volatile goo = ((goo_struct *)0);
15605 struct _goo_struct {
15610 typedef unsigned short foo_t;
15611 char *volatile foo;
15613 volatile foo_t blech;
15617 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
15619 echo "Yup, it does."
15622 echo "Nope, it doesn't."
15628 : Check basic sizes
15630 $echo "Choosing the C types to be used for Perl's internal types..." >&4
15632 case "$use64bitint:$d_quad:$quadtype" in
15635 uvtype="$uquadtype"
15640 uvtype="unsigned long"
15646 case "$uselongdouble:$d_longdbl" in
15648 nvtype="long double"
15649 nvsize=$longdblsize
15656 $echo "(IV will be "$ivtype", $ivsize bytes)"
15657 $echo "(UV will be "$uvtype", $uvsize bytes)"
15658 $echo "(NV will be "$nvtype", $nvsize bytes)"
15661 #$i_inttypes I_INTTYPES
15663 #include <inttypes.h>
15668 int8_t i = INT8_MAX;
15669 uint8_t u = UINT8_MAX;
15670 printf("int8_t\n");
15673 int16_t i = INT16_MAX;
15674 uint16_t i = UINT16_MAX;
15675 printf("int16_t\n");
15678 int32_t i = INT32_MAX;
15679 uint32_t u = UINT32_MAX;
15680 printf("int32_t\n");
15685 i8type="signed char"
15686 u8type="unsigned char"
15691 '') case "$shortsize" in
15693 u16type="unsigned short"
15701 '') set try -DINT16
15702 if eval $compile; then
15703 case "`$run ./try`" in
15715 '') if $test $shortsize -ge 2; then
15717 u16type="unsigned short"
15725 '') case "$longsize" in
15727 u32type="unsigned long"
15731 *) case "$intsize" in
15733 u32type="unsigned int"
15743 '') set try -DINT32
15744 if eval $compile; then
15745 case "`$run ./try`" in
15757 '') if $test $intsize -ge 4; then
15759 u32type="unsigned int"
15767 '') case "$d_quad:$quadtype" in
15769 i64type="$quadtype"
15770 u64type="$uquadtype"
15778 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
15779 : volatile so that the compiler has to store it out to memory.
15780 if test X"$d_volatile" = X"$define"; then
15785 #$i_stdlib I_STDLIB
15787 #include <stdlib.h>
15789 #include <sys/types.h>
15790 #include <signal.h>
15792 $volatile int bletched = 0;
15793 $signal_t blech(int s) { bletched = 1; }
15798 int n = 8 * $uvsize;
15801 signal(SIGFPE, blech);
15804 for (i = 0; i < n; i++) {
15805 u = u << 1 | ($uvtype)1;
15807 if (($uvtype)d != u)
15811 d = ($nvtype)(u - 1);
15812 if (($uvtype)d != (u - 1))
15819 printf("%d\n", ((i == n) ? -n : i));
15825 d_nv_preserves_uv="$undef"
15826 if eval $compile; then
15827 nv_preserves_uv_bits="`$run ./try`"
15829 case "$nv_preserves_uv_bits" in
15831 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
15832 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
15833 d_nv_preserves_uv="$define"
15835 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
15836 d_nv_preserves_uv="$undef" ;;
15837 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
15838 nv_preserves_uv_bits="0" ;;
15842 $echo "Checking to find the largest integer value your NVs can hold..." >&4
15843 : volatile so that the compiler has to store it out to memory.
15844 if test X"$d_volatile" = X"$define"; then
15850 typedef $nvtype NV;
15857 while(count < 256) {
15858 $volatile NV up = value + 1.0;
15859 $volatile NV negated = -value;
15860 $volatile NV down = negated - 1.0;
15861 $volatile NV got_up = up - value;
15862 int up_good = got_up == 1.0;
15863 int got_down = down - negated;
15864 int down_good = got_down == -1.0;
15866 if (down_good != up_good) {
15868 "Inconsistency - up %d %f; down %d %f; for 2**%d (%.20f)\n",
15869 up_good, (double) got_up, down_good, (double) got_down,
15870 count, (double) value);
15877 fputs("256.0", stdout);
15880 fputs("2.0", stdout);
15886 fputs("*", stdout);
15892 fprintf(stderr, "Cannot overflow integer range, even at 2**%d (%.20f)\n",
15893 count, (double) value);
15899 nv_overflows_integers_at='0'
15900 if eval $compile; then
15906 The largest integer your NVs can preserve is equal to $xxx
15908 nv_overflows_integers_at="$xxx"
15911 Cannot determine the largest integer value your NVs can hold, unexpected output
15918 Cannot determine the largest integer value your NVs can hold
15925 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
15926 : volatile so that the compiler has to store it out to memory.
15927 if test X"$d_volatile" = X"$define"; then
15932 #$i_stdlib I_STDLIB
15934 #include <stdlib.h>
15936 #$i_string I_STRING
15938 # include <string.h>
15940 # include <strings.h>
15942 #include <sys/types.h>
15943 #include <signal.h>
15945 $volatile int bletched = 0;
15946 $signal_t blech(int s) { bletched = 1; }
15949 int checkit($nvtype d, char *where) {
15950 unsigned char *p = (char *)&d;
15951 unsigned char *end = p + sizeof(d);
15961 printf("No - %s: 0x", where);
15963 printf ("%02X", *p++);
15968 int main(int argc, char **argv) {
15971 fail += checkit(d, "0.0");
15973 /* The compiler shouldn't be assuming that bletched is 0 */
15976 fail += checkit(d, "bleched");
15979 signal(SIGFPE, blech);
15982 /* Paranoia - the compiler should have no way of knowing that ANSI says
15983 that argv[argc] will always be NULL. Actually, if it did assume this it
15984 would be buggy, as this is C and main() can be called from elsewhere in
15986 d = argv[argc] ? 1 : 0;
15989 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
15992 fail += checkit(d, "ternary");
15994 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
15997 printf("No - memset doesn't give 0.0\n");
15998 /* This might just blow up: */
15999 printf("(gives %g)\n", d);
16005 printf("No - something bleched\n");
16010 printf("No - %d fail(s)\n", fail);
16019 d_nv_zero_is_allbits_zero="$undef"
16020 if eval $compile; then
16026 0.0 is represented as all bits zero in memory
16028 d_nv_zero_is_allbits_zero="$define"
16031 0.0 is not represented as all bits zero in memory
16033 d_nv_zero_is_allbits_zero="$undef"
16038 0.0 is not represented as all bits zero in memory
16040 d_nv_zero_is_allbits_zero="$undef"
16046 : check for off64_t
16048 echo "Checking to see if you have off64_t..." >&4
16050 #include <sys/types.h>
16051 #include <unistd.h>
16052 int main() { off64_t x = 7; }
16055 if eval $compile; then
16057 echo "You have off64_t."
16060 echo "You do not have off64_t."
16061 case "$lseeksize" in
16062 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
16069 : how to create joinable pthreads
16070 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
16072 echo "Checking what constant to use for creating joinable pthreads..." >&4
16073 $cat >try.c <<'EOCP'
16074 #include <pthread.h>
16076 int detachstate = JOINABLE;
16079 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
16080 if eval $compile; then
16081 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
16082 val="$undef" # Yes, undef.
16083 set d_old_pthread_create_joinable
16086 set old_pthread_create_joinable
16089 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
16090 if eval $compile; then
16091 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
16093 set d_old_pthread_create_joinable
16095 val=PTHREAD_CREATE_UNDETACHED
16096 set old_pthread_create_joinable
16099 set try -DJOINABLE=__UNDETACHED
16100 if eval $compile; then
16101 echo "You seem to use __UNDETACHED." >&4
16103 set d_old_pthread_create_joinable
16106 set old_pthread_create_joinable
16109 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
16111 set d_old_pthread_create_joinable
16114 set old_pthread_create_joinable
16121 d_old_pthread_create_joinable="$undef"
16122 old_pthread_create_joinable=""
16125 : see if pause exists
16129 : see if poll exists
16133 : see if prctl exists
16137 : see if prctl supports PR_SET_NAME
16138 d_prctl_set_name=$undef
16142 #include <sys/prctl.h>
16144 int main (int argc, char *argv[])
16146 return (prctl (PR_SET_NAME, "Test"));
16150 if eval $compile_ok && $run ./try; then
16151 echo "Your prctl (PR_SET_NAME, ...) works"
16152 d_prctl_set_name=$define
16158 : see if readlink exists
16159 set readlink d_readlink
16162 : Check if exe is symlink to abs path of executing program
16166 case "$d_readlink" in
16168 : NetBSD first as /proc/self is a symlink to /proc/curproc, and it feels
16169 : more tidy to avoid an extra level of symlink
16170 set NetBSD /proc/curproc/exe Linux /proc/self/exe FreeBSD /proc/curproc/file Solaris /proc/self/path/a.out
16171 while test $# -gt 0; do
16174 if $issymlink $try; then
16175 $ls -l $try > reflect
16176 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
16177 echo "You have $type-like $try."
16178 procselfexe='"'$try'"'
16180 : This will break out of the loop
16191 : backward compatibility for d_hvfork
16192 if test X$d_hvfork != X; then
16193 d_vfork="$d_hvfork"
16196 : see if there is a vfork
16201 d_pseudofork=$undef
16203 : Ok, but do we want to use it. vfork is reportedly unreliable in
16204 : perl on Solaris 2.x, and probably elsewhere.
16208 case "$usevfork" in
16214 Perl can only use a vfork() that doesn't suffer from strict
16215 restrictions on calling functions or modifying global data in
16216 the child. For example, glibc-2.1 contains such a vfork()
16217 that is unsuitable. If your system provides a proper fork()
16218 call, chances are that you do NOT want perl to use vfork().
16221 rp="Do you still want to use vfork()?"
16226 echo "Ok, we won't use vfork()."
16235 $define) usevfork='true';;
16236 *) usevfork='false';;
16239 : see whether the pthread_atfork exists
16241 #include <pthread.h>
16244 #ifdef PTHREAD_ATFORK
16245 pthread_atfork(NULL,NULL,NULL);
16250 : see if pthread_atfork exists
16251 set try -DPTHREAD_ATFORK
16252 if eval $compile; then
16257 case "$usethreads" in
16260 $define) echo 'pthread_atfork found.' >&4 ;;
16261 *) echo 'pthread_atfork NOT found.' >&4 ;;
16264 set d_pthread_atfork
16267 : see if pthread_attr_setscope exists
16268 set pthread_attr_setscope d_pthread_attr_setscope
16271 : see whether the various POSIXish _yields exist
16273 #include <pthread.h>
16279 #ifdef PTHREAD_YIELD
16282 #ifdef PTHREAD_YIELD_NULL
16283 pthread_yield(NULL);
16289 : see if sched_yield exists
16290 set try -DSCHED_YIELD
16291 if eval $compile; then
16293 sched_yield='sched_yield()'
16297 case "$usethreads" in
16300 $define) echo 'sched_yield() found.' >&4 ;;
16301 *) echo 'sched_yield() NOT found.' >&4 ;;
16307 : see if pthread_yield exists
16308 set try -DPTHREAD_YIELD
16309 if eval $compile; then
16311 case "$sched_yield" in
16312 '') sched_yield='pthread_yield()' ;;
16315 set try -DPTHREAD_YIELD_NULL
16316 if eval $compile; then
16318 case "$sched_yield" in
16319 '') sched_yield='pthread_yield(NULL)' ;;
16325 case "$usethreads" in
16328 $define) echo 'pthread_yield() found.' >&4 ;;
16329 *) echo 'pthread_yield() NOT found.' >&4 ;;
16333 set d_pthread_yield
16335 case "$sched_yield" in
16336 '') sched_yield=undef ;;
16340 : see if random_r exists
16341 set random_r d_random_r
16343 case "$d_random_r" in
16345 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16346 case "$d_random_r_proto:$usethreads" in
16347 ":define") d_random_r_proto=define
16348 set d_random_r_proto random_r $hdrs
16352 case "$d_random_r_proto" in
16354 case "$random_r_proto" in
16355 ''|0) try='int random_r(int*, struct random_data*);'
16356 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_iS ;;
16358 case "$random_r_proto" in
16359 ''|0) try='int random_r(long*, struct random_data*);'
16360 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_lS ;;
16362 case "$random_r_proto" in
16363 ''|0) try='int random_r(struct random_data*, int32_t*);'
16364 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_St ;;
16366 case "$random_r_proto" in
16367 ''|0) d_random_r=undef
16369 echo "Disabling random_r, cannot determine prototype." >&4 ;;
16370 * ) case "$random_r_proto" in
16371 REENTRANT_PROTO*) ;;
16372 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
16374 echo "Prototype: $try" ;;
16377 *) case "$usethreads" in
16378 define) echo "random_r has no prototype, not using it." >&4 ;;
16385 *) random_r_proto=0
16389 : see if readdir and friends exist
16390 set readdir d_readdir
16392 set seekdir d_seekdir
16394 set telldir d_telldir
16396 set rewinddir d_rewinddir
16399 : see if readdir64_r exists
16400 set readdir64_r d_readdir64_r
16402 case "$d_readdir64_r" in
16404 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16405 case "$d_readdir64_r_proto:$usethreads" in
16406 ":define") d_readdir64_r_proto=define
16407 set d_readdir64_r_proto readdir64_r $hdrs
16411 case "$d_readdir64_r_proto" in
16413 case "$readdir64_r_proto" in
16414 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
16415 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TSR ;;
16417 case "$readdir64_r_proto" in
16418 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
16419 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TS ;;
16421 case "$readdir64_r_proto" in
16422 ''|0) d_readdir64_r=undef
16423 readdir64_r_proto=0
16424 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
16425 * ) case "$readdir64_r_proto" in
16426 REENTRANT_PROTO*) ;;
16427 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
16429 echo "Prototype: $try" ;;
16432 *) case "$usethreads" in
16433 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
16435 d_readdir64_r=undef
16436 readdir64_r_proto=0
16440 *) readdir64_r_proto=0
16444 : see if readdir_r exists
16445 set readdir_r d_readdir_r
16447 case "$d_readdir_r" in
16449 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16450 case "$d_readdir_r_proto:$usethreads" in
16451 ":define") d_readdir_r_proto=define
16452 set d_readdir_r_proto readdir_r $hdrs
16456 case "$d_readdir_r_proto" in
16458 case "$readdir_r_proto" in
16459 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
16460 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TSR ;;
16462 case "$readdir_r_proto" in
16463 ''|0) try='int readdir_r(DIR*, struct dirent*);'
16464 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TS ;;
16466 case "$readdir_r_proto" in
16467 ''|0) d_readdir_r=undef
16469 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
16470 * ) case "$readdir_r_proto" in
16471 REENTRANT_PROTO*) ;;
16472 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
16474 echo "Prototype: $try" ;;
16477 *) case "$usethreads" in
16478 define) echo "readdir_r has no prototype, not using it." >&4 ;;
16485 *) readdir_r_proto=0
16489 : see if readv exists
16493 : see if recvmsg exists
16494 set recvmsg d_recvmsg
16497 : see if rename exists
16498 set rename d_rename
16501 : see if rmdir exists
16505 : see if memory.h is available.
16510 : See if it conflicts with string.h
16516 $cppstdin $cppflags $cppminus < $strings > mem.h
16517 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
16519 echo "We won't be including <memory.h>."
16529 : can bcopy handle overlapping blocks?
16532 case "$d_memmove" in
16533 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
16534 *) case "$d_bcopy" in
16536 echo "Checking to see if bcopy() can do overlapping copies..." >&4
16538 #$i_memory I_MEMORY
16539 #$i_stdlib I_STDLIB
16540 #$i_string I_STRING
16541 #$i_unistd I_UNISTD
16543 $cat >>try.c <<'EOCP'
16546 # include <memory.h>
16549 # include <stdlib.h>
16552 # include <string.h>
16554 # include <strings.h>
16557 # include <unistd.h> /* Needed for NetBSD */
16561 char buf[128], abc[128];
16567 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16568 try to store the string in read-only memory. */
16569 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
16571 for (align = 7; align >= 0; align--) {
16572 for (len = 36; len; len--) {
16574 bcopy(abc, b, len);
16575 for (off = 1; off <= len; off++) {
16576 bcopy(b, b+off, len);
16577 bcopy(b+off, b, len);
16578 if (bcmp(b, abc, len))
16587 if eval $compile_ok; then
16588 if $run ./try 2>/dev/null; then
16589 echo "Yes, it can."
16592 echo "It can't, sorry."
16595 echo "(I can't compile the test program, so we'll assume not...)"
16605 : can memcpy handle overlapping blocks?
16608 case "$d_memmove" in
16609 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
16610 *) case "$d_memcpy" in
16612 echo "Checking to see if memcpy() can do overlapping copies..." >&4
16614 #$i_memory I_MEMORY
16615 #$i_stdlib I_STDLIB
16616 #$i_string I_STRING
16617 #$i_unistd I_UNISTD
16619 $cat >>try.c <<'EOCP'
16622 # include <memory.h>
16625 # include <stdlib.h>
16628 # include <string.h>
16630 # include <strings.h>
16633 # include <unistd.h> /* Needed for NetBSD */
16637 char buf[128], abc[128];
16643 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16644 try to store the string in read-only memory. */
16645 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
16647 for (align = 7; align >= 0; align--) {
16648 for (len = 36; len; len--) {
16650 memcpy(b, abc, len);
16651 for (off = 1; off <= len; off++) {
16652 memcpy(b+off, b, len);
16653 memcpy(b, b+off, len);
16654 if (memcmp(b, abc, len))
16663 if eval $compile_ok; then
16664 if $run ./try 2>/dev/null; then
16665 echo "Yes, it can."
16668 echo "It can't, sorry."
16671 echo "(I can't compile the test program, so we'll assume not...)"
16681 : can memcmp be trusted to compare relative magnitude?
16683 case "$d_memcmp" in
16686 echo "Checking if your memcmp() can compare relative magnitude..." >&4
16688 #$i_memory I_MEMORY
16689 #$i_stdlib I_STDLIB
16690 #$i_string I_STRING
16691 #$i_unistd I_UNISTD
16693 $cat >>try.c <<'EOCP'
16696 # include <memory.h>
16699 # include <stdlib.h>
16702 # include <string.h>
16704 # include <strings.h>
16707 # include <unistd.h> /* Needed for NetBSD */
16713 if ((a < b) && memcmp(&a, &b, 1) < 0)
16719 if eval $compile_ok; then
16720 if $run ./try 2>/dev/null; then
16721 echo "Yes, it can."
16724 echo "No, it can't (it uses signed chars)."
16727 echo "(I can't compile the test program, so we'll assume not...)"
16735 : see if prototype for sbrk is available
16737 set d_sbrkproto sbrk $i_unistd unistd.h
16740 : see if select exists
16741 set select d_select
16744 : see if semctl exists
16745 set semctl d_semctl
16748 : see if semget exists
16749 set semget d_semget
16752 : see if semop exists
16756 : see how much of the 'sem*(2)' library is present.
16759 case "$d_semctl$d_semget$d_semop" in
16760 *"$undef"*) h_sem=false;;
16764 case "`ipcs 2>&1`" in
16765 "SVID messages"*"not configured"*)
16766 echo "Your $osname does not have the sem*(2) configured." >&4
16769 set semctl d_semctl
16771 set semget d_semget
16779 : we could also check for sys/ipc.h ...
16780 if $h_sem && $test `./findhdr sys/sem.h`; then
16781 echo "You have the full sem*(2) library." >&4
16784 echo "You don't have the full sem*(2) library." >&4
16790 : see whether sys/sem.h defines union semun
16792 $cat > try.c <<'END'
16793 #include <sys/types.h>
16794 #include <sys/ipc.h>
16795 #include <sys/sem.h>
16796 int main () { union semun semun; semun.buf = 0; }
16799 if eval $compile; then
16800 echo "You have union semun in <sys/sem.h>." >&4
16803 echo "You do not have union semun in <sys/sem.h>." >&4
16810 : see how to do semctl IPC_STAT
16814 $cat > tryh.h <<END
16817 # define S_IRUSR S_IREAD
16818 # define S_IWUSR S_IWRITE
16819 # define S_IXUSR S_IEXEC
16821 # define S_IRUSR 0400
16822 # define S_IWUSR 0200
16823 # define S_IXUSR 0100
16825 # define S_IRGRP (S_IRUSR>>3)
16826 # define S_IWGRP (S_IWUSR>>3)
16827 # define S_IXGRP (S_IXUSR>>3)
16828 # define S_IROTH (S_IRUSR>>6)
16829 # define S_IWOTH (S_IWUSR>>6)
16830 # define S_IXOTH (S_IXUSR>>6)
16833 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
16834 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
16835 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
16838 : see whether semctl IPC_STAT can use union semun
16839 case "$d_semctl_semun" in
16843 #include <sys/types.h>
16844 #include <sys/ipc.h>
16845 #include <sys/sem.h>
16846 #include <sys/stat.h>
16853 #$d_union_semun HAS_UNION_SEMUN
16856 #ifndef HAS_UNION_SEMUN
16859 struct semid_ds *buf;
16860 unsigned short *array;
16866 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16867 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16869 struct semid_ds argbuf;
16872 st = semctl(sem, 0, IPC_STAT, arg);
16876 # endif /* IPC_STAT */
16877 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16879 if (semctl(sem, 0, IPC_RMID, arg) != 0)
16880 # endif /* IPC_RMID */
16881 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16883 #endif /* IPC_PRIVATE && ... */
16884 printf("semget failed: errno = %d\n", errno);
16889 if eval $compile; then
16892 semun) val="$define" ;;
16900 case "$d_semctl_semun" in
16902 echo "You can use union semun for semctl IPC_STAT." >&4
16905 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
16910 : see whether semctl IPC_STAT can use struct semid_ds pointer
16911 case "$d_semctl_semid_ds" in
16914 $cat > try.c <<'END'
16915 #include <sys/types.h>
16916 #include <sys/ipc.h>
16917 #include <sys/sem.h>
16918 #include <sys/stat.h>
16926 struct semid_ds arg;
16929 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16930 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16933 st = semctl(sem, 0, IPC_STAT, &arg);
16935 printf("semid_ds\n");
16937 # endif /* IPC_STAT */
16938 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16940 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
16941 # endif /* IPC_RMID */
16942 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16944 #endif /* IPC_PRIVATE && ... */
16945 printf("semget failed: errno = %d\n", errno);
16951 if eval $compile; then
16954 semid_ds) val="$define" ;;
16958 set d_semctl_semid_ds
16962 case "$d_semctl_semid_ds" in
16964 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
16966 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
16972 # We do not have the full sem*(2) library, so assume we can not
16978 set d_semctl_semid_ds
16984 : see if sendmsg exists
16985 set sendmsg d_sendmsg
16988 : see if setegid exists
16989 set setegid d_setegid
16992 : see if seteuid exists
16993 set seteuid d_seteuid
16996 : see if setgrent exists
16997 set setgrent d_setgrent
17000 : see if setgrent_r exists
17001 set setgrent_r d_setgrent_r
17003 case "$d_setgrent_r" in
17005 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
17006 case "$d_setgrent_r_proto:$usethreads" in
17007 ":define") d_setgrent_r_proto=define
17008 set d_setgrent_r_proto setgrent_r $hdrs
17012 case "$d_setgrent_r_proto" in
17014 case "$setgrent_r_proto" in
17015 ''|0) try='int setgrent_r(FILE**);'
17016 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=I_H ;;
17018 case "$setgrent_r_proto" in
17019 ''|0) try='void setgrent_r(FILE**);'
17020 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=V_H ;;
17022 case "$setgrent_r_proto" in
17023 ''|0) d_setgrent_r=undef
17025 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
17026 * ) case "$setgrent_r_proto" in
17027 REENTRANT_PROTO*) ;;
17028 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
17030 echo "Prototype: $try" ;;
17033 *) case "$usethreads" in
17034 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
17041 *) setgrent_r_proto=0
17045 : see if sethostent exists
17046 set sethostent d_sethent
17049 : see if sethostent_r exists
17050 set sethostent_r d_sethostent_r
17052 case "$d_sethostent_r" in
17054 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17055 case "$d_sethostent_r_proto:$usethreads" in
17056 ":define") d_sethostent_r_proto=define
17057 set d_sethostent_r_proto sethostent_r $hdrs
17061 case "$d_sethostent_r_proto" in
17063 case "$sethostent_r_proto" in
17064 ''|0) try='int sethostent_r(int, struct hostent_data*);'
17065 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=I_ID ;;
17067 case "$sethostent_r_proto" in
17068 ''|0) try='void sethostent_r(int, struct hostent_data*);'
17069 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=V_ID ;;
17071 case "$sethostent_r_proto" in
17072 ''|0) d_sethostent_r=undef
17073 sethostent_r_proto=0
17074 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
17075 * ) case "$sethostent_r_proto" in
17076 REENTRANT_PROTO*) ;;
17077 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
17079 echo "Prototype: $try" ;;
17082 *) case "$usethreads" in
17083 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
17085 d_sethostent_r=undef
17086 sethostent_r_proto=0
17090 *) sethostent_r_proto=0
17094 : see if setitimer exists
17095 set setitimer d_setitimer
17098 : see if setlinebuf exists
17099 set setlinebuf d_setlinebuf
17102 : see if setlocale exists
17103 set setlocale d_setlocale
17106 : see if locale.h is available
17107 set locale.h i_locale
17110 : see if setlocale_r exists
17111 set setlocale_r d_setlocale_r
17113 case "$d_setlocale_r" in
17115 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
17116 case "$d_setlocale_r_proto:$usethreads" in
17117 ":define") d_setlocale_r_proto=define
17118 set d_setlocale_r_proto setlocale_r $hdrs
17122 case "$d_setlocale_r_proto" in
17124 case "$setlocale_r_proto" in
17125 ''|0) try='int setlocale_r(int, const char*, char*, int);'
17126 ./protochk "$extern_C $try" $hdrs && setlocale_r_proto=I_ICBI ;;
17128 case "$setlocale_r_proto" in
17129 ''|0) d_setlocale_r=undef
17130 setlocale_r_proto=0
17131 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
17132 * ) case "$setlocale_r_proto" in
17133 REENTRANT_PROTO*) ;;
17134 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
17136 echo "Prototype: $try" ;;
17139 *) case "$usethreads" in
17140 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
17142 d_setlocale_r=undef
17143 setlocale_r_proto=0
17147 *) setlocale_r_proto=0
17151 : see if setnetent exists
17152 set setnetent d_setnent
17155 : see if setnetent_r exists
17156 set setnetent_r d_setnetent_r
17158 case "$d_setnetent_r" in
17160 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17161 case "$d_setnetent_r_proto:$usethreads" in
17162 ":define") d_setnetent_r_proto=define
17163 set d_setnetent_r_proto setnetent_r $hdrs
17167 case "$d_setnetent_r_proto" in
17169 case "$setnetent_r_proto" in
17170 ''|0) try='int setnetent_r(int, struct netent_data*);'
17171 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=I_ID ;;
17173 case "$setnetent_r_proto" in
17174 ''|0) try='void setnetent_r(int, struct netent_data*);'
17175 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=V_ID ;;
17177 case "$setnetent_r_proto" in
17178 ''|0) d_setnetent_r=undef
17179 setnetent_r_proto=0
17180 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
17181 * ) case "$setnetent_r_proto" in
17182 REENTRANT_PROTO*) ;;
17183 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
17185 echo "Prototype: $try" ;;
17188 *) case "$usethreads" in
17189 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
17191 d_setnetent_r=undef
17192 setnetent_r_proto=0
17196 *) setnetent_r_proto=0
17200 : see if setprotoent exists
17201 set setprotoent d_setpent
17204 : see if setpgid exists
17205 set setpgid d_setpgid
17208 : see if setpgrp2 exists
17209 set setpgrp2 d_setpgrp2
17212 : see if setpriority exists
17213 set setpriority d_setprior
17216 : see if setproctitle exists
17217 set setproctitle d_setproctitle
17220 : see if setprotoent_r exists
17221 set setprotoent_r d_setprotoent_r
17223 case "$d_setprotoent_r" in
17225 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17226 case "$d_setprotoent_r_proto:$usethreads" in
17227 ":define") d_setprotoent_r_proto=define
17228 set d_setprotoent_r_proto setprotoent_r $hdrs
17232 case "$d_setprotoent_r_proto" in
17234 case "$setprotoent_r_proto" in
17235 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
17236 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=I_ID ;;
17238 case "$setprotoent_r_proto" in
17239 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
17240 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=V_ID ;;
17242 case "$setprotoent_r_proto" in
17243 ''|0) d_setprotoent_r=undef
17244 setprotoent_r_proto=0
17245 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
17246 * ) case "$setprotoent_r_proto" in
17247 REENTRANT_PROTO*) ;;
17248 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
17250 echo "Prototype: $try" ;;
17253 *) case "$usethreads" in
17254 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
17256 d_setprotoent_r=undef
17257 setprotoent_r_proto=0
17261 *) setprotoent_r_proto=0
17265 : see if setpwent exists
17266 set setpwent d_setpwent
17269 : see if setpwent_r exists
17270 set setpwent_r d_setpwent_r
17272 case "$d_setpwent_r" in
17274 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
17275 case "$d_setpwent_r_proto:$usethreads" in
17276 ":define") d_setpwent_r_proto=define
17277 set d_setpwent_r_proto setpwent_r $hdrs
17281 case "$d_setpwent_r_proto" in
17283 case "$setpwent_r_proto" in
17284 ''|0) try='int setpwent_r(FILE**);'
17285 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=I_H ;;
17287 case "$setpwent_r_proto" in
17288 ''|0) try='void setpwent_r(FILE**);'
17289 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=V_H ;;
17291 case "$setpwent_r_proto" in
17292 ''|0) d_setpwent_r=undef
17294 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
17295 * ) case "$setpwent_r_proto" in
17296 REENTRANT_PROTO*) ;;
17297 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
17299 echo "Prototype: $try" ;;
17302 *) case "$usethreads" in
17303 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
17310 *) setpwent_r_proto=0
17314 : see if setregid exists
17315 set setregid d_setregid
17317 set setresgid d_setresgid
17320 : see if setreuid exists
17321 set setreuid d_setreuid
17323 set setresuid d_setresuid
17326 : see if setrgid exists
17327 set setrgid d_setrgid
17330 : see if setruid exists
17331 set setruid d_setruid
17334 : see if setservent exists
17335 set setservent d_setsent
17338 : see if setservent_r exists
17339 set setservent_r d_setservent_r
17341 case "$d_setservent_r" in
17343 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17344 case "$d_setservent_r_proto:$usethreads" in
17345 ":define") d_setservent_r_proto=define
17346 set d_setservent_r_proto setservent_r $hdrs
17350 case "$d_setservent_r_proto" in
17352 case "$setservent_r_proto" in
17353 ''|0) try='int setservent_r(int, struct servent_data*);'
17354 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=I_ID ;;
17356 case "$setservent_r_proto" in
17357 ''|0) try='void setservent_r(int, struct servent_data*);'
17358 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=V_ID ;;
17360 case "$setservent_r_proto" in
17361 ''|0) d_setservent_r=undef
17362 setservent_r_proto=0
17363 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
17364 * ) case "$setservent_r_proto" in
17365 REENTRANT_PROTO*) ;;
17366 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
17368 echo "Prototype: $try" ;;
17371 *) case "$usethreads" in
17372 define) echo "setservent_r has no prototype, not using it." >&4 ;;
17374 d_setservent_r=undef
17375 setservent_r_proto=0
17379 *) setservent_r_proto=0
17383 : see if setsid exists
17384 set setsid d_setsid
17387 : see if setvbuf exists
17388 set setvbuf d_setvbuf
17391 : see if sfio.h is available
17395 : see if sfio library is available
17406 : Ok, but do we want to use it.
17410 true|$define|[yY]*) dflt='y';;
17413 echo "$package can use the sfio library, but it is experimental."
17414 rp="You seem to have sfio available, do you want to try using it?"
17417 y|Y) echo "Ok, turning on sfio then."
17420 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
17425 *) case "$usesfio" in
17426 true|$define|[yY]*)
17427 echo "Sorry, cannot find sfio on this machine." >&4
17428 echo "Ignoring your setting of usesfio=$usesfio." >&4
17437 $define) usesfio='true';;
17438 *) usesfio='false';;
17442 *) : Remove sfio from list of libraries to use
17445 echo "Removing unneeded -lsfio from library list" >&4
17446 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
17449 echo "libs = $libs" >&4
17456 : see if shmctl exists
17457 set shmctl d_shmctl
17460 : see if shmget exists
17461 set shmget d_shmget
17464 : see if shmat exists
17467 : see what shmat returns
17470 $cat >shmat.c <<'END'
17471 #include <sys/shm.h>
17474 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
17479 echo "and it returns ($shmattype)." >&4
17480 : see if a prototype for shmat is available
17481 xxx=`./findhdr sys/shm.h`
17482 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
17483 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
17494 set d_shmatprototype
17497 : see if shmdt exists
17501 : see how much of the 'shm*(2)' library is present.
17504 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
17505 *"$undef"*) h_shm=false;;
17509 case "`ipcs 2>&1`" in
17510 "SVID shared memory"*"not configured"*)
17511 echo "Your $osname does not have the shm*(2) configured." >&4
17514 set shmctl d_shmctl
17516 set shmget d_shmget
17526 : we could also check for sys/ipc.h ...
17527 if $h_shm && $test `./findhdr sys/shm.h`; then
17528 echo "You have the full shm*(2) library." >&4
17531 echo "You don't have the full shm*(2) library." >&4
17537 : see if we have sigaction
17539 if set sigaction val -f d_sigaction; eval $csym; $val; then
17540 echo 'sigaction() found.' >&4
17543 #include <sys/types.h>
17544 #include <signal.h>
17545 #$i_stdlib I_STDLIB
17547 #include <stdlib.h>
17551 struct sigaction act, oact;
17553 oact.sa_handler = 0;
17554 /* so that act and oact are used */
17555 exit(act.sa_flags == 0 && oact.sa_handler == 0);
17559 if eval $compile_ok; then
17562 echo "But you don't seem to have a useable struct sigaction." >&4
17566 echo 'sigaction NOT found.' >&4
17569 set d_sigaction; eval $setvar
17572 : see if this is a sunmath.h system
17573 set sunmath.h i_sunmath
17576 : see if signbit exists
17577 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
17580 #$i_sunmath I_SUNMATH
17584 #ifdef I_SUNMATH /* Solaris special math library */
17585 # include <sunmath.h>
17588 int main(int argc, char **argv)
17592 if ((signbit(x) == 0) && (signbit(y) != 0))
17600 if eval $compile; then
17601 if $run ./try; then
17605 $echo "Signbit seems to be available, but doesn't work as I expected."
17606 $echo "I won't use it." >&4
17617 : see if sigprocmask exists
17618 set sigprocmask d_sigprocmask
17621 : see if sigsetjmp exists
17623 case "$d_sigsetjmp" in
17626 #include <setjmp.h>
17627 #$i_stdlib I_STDLIB
17629 #include <stdlib.h>
17635 if (sigsetjmp(env,1))
17638 siglongjmp(env, 1);
17643 if eval $compile; then
17644 if $run ./try >/dev/null 2>&1; then
17645 echo "POSIX sigsetjmp found." >&4
17649 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
17655 echo "sigsetjmp not found." >&4
17659 *) val="$d_sigsetjmp"
17660 case "$d_sigsetjmp" in
17661 $define) echo "POSIX sigsetjmp found." >&4;;
17662 $undef) echo "sigsetjmp not found." >&4;;
17670 : see if snprintf exists
17671 set snprintf d_snprintf
17674 : see if vsnprintf exists
17675 set vsnprintf d_vsnprintf
17678 case "$d_snprintf-$d_vsnprintf" in
17681 Checking whether your snprintf() and vsnprintf() work okay...
17683 $cat >try.c <<'EOCP'
17684 /* v?snprintf testing logic courtesy of Russ Allbery.
17685 * According to C99:
17686 * - if the buffer is too short it still must be \0-terminated
17687 * - if the buffer is too short the potentially required length
17688 * must be returned and not -1
17689 * - if the buffer is NULL the potentially required length
17690 * must be returned and not -1 or core dump
17693 #include <stdarg.h>
17697 int test (char *format, ...)
17702 va_start (args, format);
17703 count = vsnprintf (buf, sizeof buf, format, args);
17710 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
17711 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
17715 if eval $compile; then
17718 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
17720 Your snprintf() and snprintf() don't seem to be working okay.
17722 d_snprintf="$undef"
17723 d_vsnprintf="$undef"
17727 echo "(I can't seem to compile the test program--assuming they don't)"
17728 d_snprintf="$undef"
17729 d_vsnprintf="$undef"
17735 : see if sockatmark exists
17736 set sockatmark d_sockatmark
17739 : see if prototype for sockatmark is available
17741 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
17744 : see if socks5_init exists
17745 set socks5_init d_socks5_init
17748 : see if sprintf returns the length of the string in the buffer as per ANSI
17749 $echo "Checking whether sprintf returns the length of the string..." >&4
17752 #$i_stdlib I_STDLIB
17754 #include <stdlib.h>
17756 #$i_string I_STRING
17758 # include <string.h>
17760 # include <strings.h>
17769 int check (size_t expect, int test) {
17770 size_t got = strlen(buffer);
17774 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
17779 int main(int argc, char **argv) {
17782 check(sprintf(buffer, ""), ++test);
17783 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
17784 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
17791 if eval $compile; then
17795 sprintf returns the length of the string (as ANSI says it should)
17797 d_sprintf_returns_strlen="$define"
17800 sprintf does not return the length of the string (how old is this system?)
17802 d_sprintf_returns_strlen="$undef"
17806 echo "(I can't seem to compile the test program--assuming it doesn't)" >&4
17807 d_sprintf_returns_strlen="$undef"
17811 : see if srand48_r exists
17812 set srand48_r d_srand48_r
17814 case "$d_srand48_r" in
17816 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17817 case "$d_srand48_r_proto:$usethreads" in
17818 ":define") d_srand48_r_proto=define
17819 set d_srand48_r_proto srand48_r $hdrs
17823 case "$d_srand48_r_proto" in
17825 case "$srand48_r_proto" in
17826 ''|0) try='int srand48_r(long, struct drand48_data*);'
17827 ./protochk "$extern_C $try" $hdrs && srand48_r_proto=I_LS ;;
17829 case "$srand48_r_proto" in
17830 ''|0) d_srand48_r=undef
17832 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
17833 * ) case "$srand48_r_proto" in
17834 REENTRANT_PROTO*) ;;
17835 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
17837 echo "Prototype: $try" ;;
17840 *) case "$usethreads" in
17841 define) echo "srand48_r has no prototype, not using it." >&4 ;;
17848 *) srand48_r_proto=0
17852 : see if srandom_r exists
17853 set srandom_r d_srandom_r
17855 case "$d_srandom_r" in
17857 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17858 case "$d_srandom_r_proto:$usethreads" in
17859 ":define") d_srandom_r_proto=define
17860 set d_srandom_r_proto srandom_r $hdrs
17864 case "$d_srandom_r_proto" in
17866 case "$srandom_r_proto" in
17867 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
17868 ./protochk "$extern_C $try" $hdrs && srandom_r_proto=I_TS ;;
17870 case "$srandom_r_proto" in
17871 ''|0) d_srandom_r=undef
17873 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
17874 * ) case "$srandom_r_proto" in
17875 REENTRANT_PROTO*) ;;
17876 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
17878 echo "Prototype: $try" ;;
17881 *) case "$usethreads" in
17882 define) echo "srandom_r has no prototype, not using it." >&4 ;;
17889 *) srandom_r_proto=0
17893 : see if prototype for setresgid is available
17895 set d_sresgproto setresgid $i_unistd unistd.h
17898 : see if prototype for setresuid is available
17900 set d_sresuproto setresuid $i_unistd unistd.h
17903 : see if sys/stat.h is available
17904 set sys/stat.h i_sysstat
17907 : see if stat knows about block sizes
17909 echo "Checking to see if your struct stat has st_blocks field..." >&4
17910 set d_statblks stat st_blocks $i_sysstat sys/stat.h
17913 : see if this is a sys/vfs.h system
17914 set sys/vfs.h i_sysvfs
17917 : see if this is a sys/statfs.h system
17918 set sys/statfs.h i_sysstatfs
17921 : Check for statfs_s
17923 echo "Checking to see if your system supports struct statfs..." >&4
17924 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
17926 case "$d_statfs_s" in
17927 "$define") echo "Yes, it does." ;;
17928 *) echo "No, it doesn't." ;;
17932 : see if struct statfs knows about f_flags
17933 case "$d_statfs_s" in
17936 echo "Checking to see if your struct statfs has f_flags field..." >&4
17937 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
17941 set d_statfs_f_flags
17945 case "$d_statfs_f_flags" in
17946 "$define") echo "Yes, it does." ;;
17947 *) echo "No, it doesn't." ;;
17950 : see what flavor, if any, of static inline is supported
17952 echo "Checking to see if your system supports static inline..."
17953 $cat > try.c <<'EOCP'
17954 #include <stdlib.h>
17955 extern int f_via_a(int x);
17956 extern int f_via_b(int x);
17957 int main(int argc, char **argv)
17966 return EXIT_SUCCESS;
17969 return EXIT_FAILURE;
17973 $cat > a.c <<'EOCP'
17974 static INLINE int f(int x) {
17985 $cat > b.c <<'EOCP'
17986 extern int f(int x);
17994 # Respect a hint (or previous) value for perl_static_inline, if there is one.
17995 case "$perl_static_inline" in
17996 '') # Check the various possibilities, and break out on success.
17997 # For gcc, prefer __inline__, which will still permit
17998 # cflags.SH to add in -ansi.
17999 case "$gccversion" in
18000 '') xxx="inline __inline__ __inline _inline";;
18001 *) xxx="__inline__ inline __inline _inline";;
18003 for inline in $xxx; do
18004 set try -DINLINE=$inline a.c
18005 if eval $compile && $run ./try; then
18006 # Now make sure there is no external linkage of static
18008 set try -DINLINE=$inline -DUSE_B a.c b.c
18009 if eval $compile && $run ./try; then
18010 $echo "Your compiler supports static $inline, " >&4
18011 $echo "but it also creates an external definition," >&4
18012 $echo "so I won't use it." >&4
18015 $echo "Your compiler supports static $inline." >&4
18017 perl_static_inline="static $inline";
18021 $echo "Your compiler does NOT support static $inline." >&4
18026 *inline*) # Some variant of inline exists.
18027 echo "Keeping your $hint value of $perl_static_inline."
18030 static) # No inline capabilities
18031 echo "Keeping your $hint value of $perl_static_inline."
18034 *) # Unrecognized previous value -- blindly trust the supplied
18035 # value and hope it makes sense. Use old value for
18036 # d_static_inline, if there is one.
18037 echo "Keeping your $hint value of $perl_static_inline."
18038 case "$d_static_inline" in
18040 *) val=$d_static_inline ;;
18044 # Fallback to plain 'static' if nothing worked.
18045 case "$perl_static_inline" in
18047 perl_static_inline="static"
18051 set d_static_inline
18053 $rm -f a.[co] b.[co]
18056 : Check stream access
18058 Checking how to access stdio streams by file descriptor number...
18060 case "$stdio_stream_array" in
18061 '') $cat >try.c <<EOCP
18064 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
18068 for s in _iob __iob __sF
18070 set try -DSTDIO_STREAM_ARRAY=$s
18071 if eval $compile; then
18072 case "`$run ./try`" in
18073 yes) stdio_stream_array=$s; break ;;
18079 case "$stdio_stream_array" in
18081 I can't figure out how to access stdio streams by file descriptor number.
18083 d_stdio_stream_array="$undef"
18086 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
18088 d_stdio_stream_array="$define"
18092 : see if strcoll exists
18093 set strcoll d_strcoll
18096 : check for structure copying
18098 echo "Checking to see if your C compiler can copy structs..." >&4
18099 $cat >try.c <<'EOCP'
18109 if $cc -c try.c >/dev/null 2>&1 ; then
18111 echo "Yup, it can."
18114 echo "Nope, it can't."
18120 : see if strerror and/or sys_errlist[] exist
18122 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
18123 if set strerror val -f d_strerror; eval $csym; $val; then
18124 echo 'strerror() found.' >&4
18125 d_strerror="$define"
18126 d_strerrm='strerror(e)'
18127 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18128 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
18129 d_syserrlst="$define"
18131 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
18132 d_syserrlst="$undef"
18134 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
18135 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
18136 echo 'strerror() found in string header.' >&4
18137 d_strerror="$define"
18138 d_strerrm='strerror(e)'
18139 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18140 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
18141 d_syserrlst="$define"
18143 echo "(You don't appear to have any sys_errlist[], how can this be?)"
18144 d_syserrlst="$undef"
18146 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18147 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
18148 d_strerror="$undef"
18149 d_syserrlst="$define"
18150 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
18152 echo 'strerror() and sys_errlist[] NOT found.' >&4
18153 d_strerror="$undef"
18154 d_syserrlst="$undef"
18155 d_strerrm='"unknown"'
18159 : see if strerror_r exists
18160 set strerror_r d_strerror_r
18162 case "$d_strerror_r" in
18164 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
18165 case "$d_strerror_r_proto:$usethreads" in
18166 ":define") d_strerror_r_proto=define
18167 set d_strerror_r_proto strerror_r $hdrs
18171 case "$d_strerror_r_proto" in
18173 case "$strerror_r_proto" in
18174 ''|0) try='int strerror_r(int, char*, size_t);'
18175 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBW ;;
18177 case "$strerror_r_proto" in
18178 ''|0) try='int strerror_r(int, char*, int);'
18179 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBI ;;
18181 case "$strerror_r_proto" in
18182 ''|0) try='char* strerror_r(int, char*, size_t);'
18183 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=B_IBW ;;
18185 case "$strerror_r_proto" in
18186 ''|0) d_strerror_r=undef
18188 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
18189 * ) case "$strerror_r_proto" in
18190 REENTRANT_PROTO*) ;;
18191 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
18193 echo "Prototype: $try" ;;
18196 *) case "$usethreads" in
18197 define) echo "strerror_r has no prototype, not using it." >&4 ;;
18204 *) strerror_r_proto=0
18208 : see if strftime exists
18209 set strftime d_strftime
18212 : see if strlcat exists
18213 set strlcat d_strlcat
18216 : see if strlcpy exists
18217 set strlcpy d_strlcpy
18220 : see if strtod exists
18221 set strtod d_strtod
18224 : see if strtol exists
18225 set strtol d_strtol
18228 : see if strtold exists
18229 set strtold d_strtold
18232 : see if strtoll exists
18233 set strtoll d_strtoll
18236 case "$d_longlong-$d_strtoll" in
18239 Checking whether your strtoll() works okay...
18241 $cat >try.c <<'EOCP'
18244 #define strtoll __strtoll
18247 #define strtoll _strtoll
18250 extern long long int strtoll(char *s, char **, int);
18251 static int bad = 0;
18252 int check(char *s, long long ell, int een) {
18255 gll = strtoll(s, 0, 10);
18256 if (!((gll == ell) && (errno == een)))
18260 check(" 1", 1LL, 0);
18261 check(" 0", 0LL, 0);
18262 check("-1", -1LL, 0);
18263 check("-9223372036854775808", -9223372036854775808LL, 0);
18264 check("-9223372036854775808", -9223372036854775808LL, 0);
18265 check(" 9223372036854775807", 9223372036854775807LL, 0);
18266 check("-9223372036854775808", -9223372036854775808LL, 0);
18267 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
18268 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
18274 if eval $compile; then
18277 ok) echo "Your strtoll() seems to be working okay." ;;
18279 Your strtoll() doesn't seem to be working okay.
18285 echo "(I can't seem to compile the test program--assuming it doesn't)"
18291 : see if strtoq exists
18292 set strtoq d_strtoq
18295 : see if strtoul exists
18296 set strtoul d_strtoul
18299 case "$d_strtoul" in
18302 Checking whether your strtoul() works okay...
18304 $cat >try.c <<'EOCP'
18307 extern unsigned long int strtoul(char *s, char **, int);
18308 static int bad = 0;
18309 void check(char *s, unsigned long eul, int een) {
18312 gul = strtoul(s, 0, 10);
18313 if (!((gul == eul) && (errno == een)))
18317 check(" 1", 1L, 0);
18318 check(" 0", 0L, 0);
18320 case "$longsize" in
18322 $cat >>try.c <<'EOCP'
18323 check("18446744073709551615", 18446744073709551615UL, 0);
18324 check("18446744073709551616", 18446744073709551615UL, ERANGE);
18325 #if 0 /* strtoul() for /^-/ strings is undefined. */
18326 check("-1", 18446744073709551615UL, 0);
18327 check("-18446744073709551614", 2, 0);
18328 check("-18446744073709551615", 1, 0);
18329 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
18330 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
18335 $cat >>try.c <<'EOCP'
18336 check("4294967295", 4294967295UL, 0);
18337 check("4294967296", 4294967295UL, ERANGE);
18338 #if 0 /* strtoul() for /^-/ strings is undefined. */
18339 check("-1", 4294967295UL, 0);
18340 check("-4294967294", 2, 0);
18341 check("-4294967295", 1, 0);
18342 check("-4294967296", 4294967295UL, ERANGE);
18343 check("-4294967297", 4294967295UL, ERANGE);
18348 : Should we write these tests to be more portable by sprintf-ing
18349 : ~0 and then manipulating that char string as input for strtol?
18352 $cat >>try.c <<'EOCP'
18359 if eval $compile; then
18360 case "`$run ./try`" in
18361 ok) echo "Your strtoul() seems to be working okay." ;;
18363 Your strtoul() doesn't seem to be working okay.
18369 echo "(I can't seem to compile the test program--assuming it doesn't)"
18375 : see if strtoull exists
18376 set strtoull d_strtoull
18379 case "$d_longlong-$d_strtoull" in
18382 Checking whether your strtoull() works okay...
18384 $cat >try.c <<'EOCP'
18387 #define strtoull __strtoull
18390 extern unsigned long long int strtoull(char *s, char **, int);
18391 static int bad = 0;
18392 int check(char *s, long long eull, int een) {
18395 gull = strtoull(s, 0, 10);
18396 if (!((gull == eull) && (errno == een)))
18400 check(" 1", 1LL, 0);
18401 check(" 0", 0LL, 0);
18402 check("18446744073709551615", 18446744073709551615ULL, 0);
18403 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18404 #if 0 /* strtoull() for /^-/ strings is undefined. */
18405 check("-1", 18446744073709551615ULL, 0);
18406 check("-18446744073709551614", 2LL, 0);
18407 check("-18446744073709551615", 1LL, 0);
18408 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18409 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18416 if eval $compile; then
18417 case "`$run ./try`" in
18418 ok) echo "Your strtoull() seems to be working okay." ;;
18420 Your strtoull() doesn't seem to be working okay.
18422 d_strtoull="$undef"
18426 echo "(I can't seem to compile the test program--assuming it doesn't)"
18427 d_strtoull="$undef"
18432 : see if strtouq exists
18433 set strtouq d_strtouq
18436 case "$d_strtouq" in
18439 Checking whether your strtouq() works okay...
18441 $cat >try.c <<'EOCP'
18444 extern unsigned long long int strtouq(char *s, char **, int);
18445 static int bad = 0;
18446 void check(char *s, unsigned long long eull, int een) {
18447 unsigned long long gull;
18449 gull = strtouq(s, 0, 10);
18450 if (!((gull == eull) && (errno == een)))
18454 check(" 1", 1LL, 0);
18455 check(" 0", 0LL, 0);
18456 check("18446744073709551615", 18446744073709551615ULL, 0);
18457 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18458 #if 0 /* strtouq() for /^-/ strings is undefined. */
18459 check("-1", 18446744073709551615ULL, 0);
18460 check("-18446744073709551614", 2LL, 0);
18461 check("-18446744073709551615", 1LL, 0);
18462 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18463 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18471 if eval $compile; then
18472 case "`$run ./try`" in
18473 ok) echo "Your strtouq() seems to be working okay." ;;
18475 Your strtouq() doesn't seem to be working okay.
18481 echo "(I can't seem to compile the test program--assuming it doesn't)"
18487 : see if strxfrm exists
18488 set strxfrm d_strxfrm
18491 : see if symlink exists
18492 set symlink d_symlink
18495 : see if syscall exists
18496 set syscall d_syscall
18499 : see if prototype for syscall is available
18501 set d_syscallproto syscall $i_unistd unistd.h
18504 : see if sysconf exists
18505 set sysconf d_sysconf
18508 : see if system exists
18509 set system d_system
18512 : see if tcgetpgrp exists
18513 set tcgetpgrp d_tcgetpgrp
18516 : see if tcsetpgrp exists
18517 set tcsetpgrp d_tcsetpgrp
18520 : see if prototype for telldir is available
18522 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
18525 : see if time exists
18527 if test "X$d_time" = X -o X"$timetype" = X; then
18528 if set time val -f d_time; eval $csym; $val; then
18529 echo 'time() found.' >&4
18531 rp="What is the type returned by time() on this system?"
18532 set time_t timetype long stdio.h sys/types.h
18535 echo 'time() not found, hope that will do.' >&4
18543 : see if timegm exists
18544 set timegm d_timegm
18547 : see if this is a sys/times.h system
18548 set sys/times.h i_systimes
18551 : see if times exists
18553 if set times val -f d_times; eval $csym; $val; then
18554 echo 'times() found.' >&4
18557 case "$i_systimes" in
18558 "$define") inc='sys/times.h';;
18560 rp="What is the type returned by times() on this system?"
18561 set clock_t clocktype long stdio.h sys/types.h $inc
18564 echo 'times() NOT found, hope that will do.' >&4
18569 : see if tmpnam_r exists
18570 set tmpnam_r d_tmpnam_r
18572 case "$d_tmpnam_r" in
18574 hdrs="$i_systypes sys/types.h define stdio.h "
18575 case "$d_tmpnam_r_proto:$usethreads" in
18576 ":define") d_tmpnam_r_proto=define
18577 set d_tmpnam_r_proto tmpnam_r $hdrs
18581 case "$d_tmpnam_r_proto" in
18583 case "$tmpnam_r_proto" in
18584 ''|0) try='char* tmpnam_r(char*);'
18585 ./protochk "$extern_C $try" $hdrs && tmpnam_r_proto=B_B ;;
18587 case "$tmpnam_r_proto" in
18588 ''|0) d_tmpnam_r=undef
18590 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
18591 * ) case "$tmpnam_r_proto" in
18592 REENTRANT_PROTO*) ;;
18593 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
18595 echo "Prototype: $try" ;;
18598 *) case "$usethreads" in
18599 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
18606 *) tmpnam_r_proto=0
18610 : see if truncate exists
18611 set truncate d_truncate
18614 : see if ttyname_r exists
18615 set ttyname_r d_ttyname_r
18617 case "$d_ttyname_r" in
18619 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
18620 case "$d_ttyname_r_proto:$usethreads" in
18621 ":define") d_ttyname_r_proto=define
18622 set d_ttyname_r_proto ttyname_r $hdrs
18626 case "$d_ttyname_r_proto" in
18628 case "$ttyname_r_proto" in
18629 ''|0) try='int ttyname_r(int, char*, size_t);'
18630 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBW ;;
18632 case "$ttyname_r_proto" in
18633 ''|0) try='int ttyname_r(int, char*, int);'
18634 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBI ;;
18636 case "$ttyname_r_proto" in
18637 ''|0) try='char* ttyname_r(int, char*, int);'
18638 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=B_IBI ;;
18640 case "$ttyname_r_proto" in
18641 ''|0) d_ttyname_r=undef
18643 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
18644 * ) case "$ttyname_r_proto" in
18645 REENTRANT_PROTO*) ;;
18646 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
18648 echo "Prototype: $try" ;;
18651 *) case "$usethreads" in
18652 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
18659 *) ttyname_r_proto=0
18663 : see if tzname[] exists
18665 if set tzname val -a d_tzname; eval $csym; $val; then
18667 echo 'tzname[] found.' >&4
18670 echo 'tzname[] NOT found.' >&4
18675 : Check if is a multiplatform env
18677 next|rhapsody|darwin) multiarch="$define" ;;
18679 case "$multiarch" in
18680 ''|[nN]*) multiarch="$undef" ;;
18683 : check for ordering of bytes in a UV
18685 case "$usecrosscompile$multiarch" in
18688 You seem to be either cross-compiling or doing a multiarchitecture build,
18689 skipping the byteorder check.
18695 case "$byteorder" in
18698 In the following, larger digits indicate more significance. A big-endian
18699 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
18700 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
18701 machines may have weird orders like 3412. A Cray will report 87654321,
18702 an Alpha will report 12345678. If the test program works the default is
18704 I'm now running the test program...
18708 #$i_stdlib I_STDLIB
18710 #include <stdlib.h>
18712 #include <sys/types.h>
18713 typedef $uvtype UV;
18723 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
18725 u.l = (UV)0x04030201;
18726 for (i = 0; i < $uvsize; i++)
18727 printf("%c", u.c[i]+'0');
18734 if eval $compile && $run ./try > /dev/null; then
18737 [1-4][1-4][1-4][1-4]|12345678|87654321)
18738 echo "(The test program ran ok.)"
18739 echo "byteorder=$dflt"
18742 ????|????????) echo "(The test program ran ok.)" ;;
18743 *) echo "(The test program didn't run right for some reason.)" ;;
18748 (I can't seem to compile the test program. Guessing big-endian...)
18751 case "$xxx_prompt" in
18753 rp="What is the order of bytes in $uvtype?"
18766 : Checking 32bit alignedness
18769 Checking to see whether you can access character data unalignedly...
18771 case "$d_u32align" in
18772 '') $cat >try.c <<EOCP
18774 #$i_stdlib I_STDLIB
18776 #include <stdlib.h>
18778 #define U32 $u32type
18779 #define BYTEORDER 0x$byteorder
18781 #include <signal.h>
18783 $signal_t bletch(int s) { exit(4); }
18786 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
18787 volatile U8 buf[8];
18791 if (sizeof(U32) != 4) {
18792 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
18799 signal(SIGBUS, bletch);
18811 for (i = 0; i < 4; i++) {
18812 up = (U32*)(buf + i);
18813 if (! ((*up == 1 << (8*i)) || /* big-endian */
18814 (*up == 1 << (8*(3-i))) /* little-endian */
18818 printf("read failed (%x)\n", *up);
18824 for (i = 0; i < 4; i++) {
18825 up = (U32*)(buf + i);
18827 if (*up != 0xBeef) {
18828 printf("write failed (%x)\n", *up);
18842 if eval $compile_ok; then
18843 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
18844 $run ./try 2>&1 >/dev/null
18847 You can access character data pretty unalignedly.
18849 d_u32align="$undef"
18852 It seems that you must access character data in an aligned manner.
18854 d_u32align="$define"
18858 rp='Can you access character data at unaligned addresses?'
18862 [yY]*) d_u32align="$undef" ;;
18863 *) d_u32align="$define" ;;
18870 : see if ualarm exists
18871 set ualarm d_ualarm
18874 : see if umask exists
18878 : see if unordered exists
18879 set unordered d_unordered
18882 : see if unsetenv exists
18883 set unsetenv d_unsetenv
18886 : see if usleep exists
18887 set usleep d_usleep
18890 : see if prototype for usleep is available
18892 set d_usleepproto usleep $i_unistd unistd.h
18895 : see if ustat exists
18899 : see if closedir exists
18900 set closedir d_closedir
18903 case "$d_closedir" in
18906 echo "Checking whether closedir() returns a status..." >&4
18908 #$i_dirent I_DIRENT /**/
18909 #$i_sysdir I_SYS_DIR /**/
18910 #$i_sysndir I_SYS_NDIR /**/
18911 #$i_systypes I_SYS_TYPES /**/
18913 #if defined(I_SYS_TYPES)
18914 #include <sys/types.h>
18916 #if defined(I_DIRENT)
18917 #include <dirent.h>
18918 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
18919 #include <sys/dir.h>
18923 #include <sys/ndir.h>
18927 #include <ndir.h> /* may be wrong in the future */
18929 #include <sys/dir.h>
18934 int main() { return closedir(opendir(".")); }
18937 if eval $compile_ok; then
18938 if $run ./try > /dev/null 2>&1 ; then
18939 echo "Yes, it does."
18942 echo "No, it doesn't."
18946 echo "(I can't seem to compile the test program--assuming it doesn't)"
18954 set d_void_closedir
18958 : see if there is a wait4
18962 : see if waitpid exists
18963 set waitpid d_waitpid
18966 : see if wcstombs exists
18967 set wcstombs d_wcstombs
18970 : see if wctomb exists
18971 set wctomb d_wctomb
18974 : see if writev exists
18975 set writev d_writev
18978 : preserve RCS keywords in files with variable substitution, grrr
18983 Revision='$Revision'
18985 : check for alignment requirements
18987 case "$usecrosscompile$multiarch" in
18990 You seem to be either cross-compiling or doing a multiarchitecture build,
18991 skipping the memory alignment check.
18994 case "$alignbytes" in
18995 '') alignbytes=8 ;;
18999 case "$alignbytes" in
19000 '') echo "Checking alignment constraints..." >&4
19001 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
19002 $cat >try.c <<'EOCP'
19003 typedef long double NV;
19006 $cat >try.c <<'EOCP'
19010 $cat >>try.c <<'EOCP'
19018 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
19023 if eval $compile_ok; then
19027 echo "(I can't seem to compile the test program...)"
19030 *) dflt="$alignbytes"
19033 rp="Doubles must be aligned on a how-many-byte boundary?"
19041 : set the base revision
19044 : length of character in bytes. Is always 1, otherwise it isnt C
19045 : This used to be a test using sizeof
19048 : Check for the number of bits in a character
19049 case "$charbits" in
19050 '') echo "Checking how long a character is (in bits)..." >&4
19057 for (c = 1, n = 0; c; c <<= 1, n++) ;
19058 printf ("%d\n", n);
19063 if eval $compile_ok; then
19067 echo "(I can't seem to compile the test program. Guessing...)"
19074 rp="What is the length of a character (in bits)?"
19078 case "$charbits" in
19081 Your system has an unsigned character size of $charbits bits, which
19082 is rather unusual (normally it is 8 bits). Perl likely will not work
19083 correctly on your system, with subtle bugs in various places.
19085 rp='Do you really want to continue?'
19089 [yY]) echo >&4 "Okay, continuing." ;;
19094 : how do we concatenate cpp tokens here?
19096 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
19097 $cat >cpp_stuff.c <<'EOCP'
19098 #define RCAT(a,b)a/**/b
19099 #define ACAT(a,b)a ## b
19103 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
19104 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
19105 echo "Oh! Smells like ANSI's been here." >&4
19106 echo "We can catify or stringify, separately or together!"
19108 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
19109 echo "Ah, yes! The good old days!" >&4
19110 echo "However, in the good old days we don't know how to stringify and"
19111 echo "catify at the same time."
19115 Hmm, I don't seem to be able to concatenate tokens with your cpp.
19116 You're going to have to edit the values of CAT[2-5] in config.h...
19118 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
19122 : see if this is a db.h system
19128 : Check db version.
19130 echo "Checking Berkeley DB version ..." >&4
19136 #include <sys/types.h>
19138 #$i_stdlib I_STDLIB
19140 #include <stdlib.h>
19143 int main(int argc, char *argv[])
19145 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
19146 int Major, Minor, Patch ;
19147 unsigned long Version ;
19148 (void)db_version(&Major, &Minor, &Patch) ;
19150 printf("%d %d %d %d %d %d\n",
19151 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
19152 Major, Minor, Patch);
19155 printf("You have Berkeley DB Version 2 or greater.\n");
19157 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
19158 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
19159 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
19160 Major, Minor, Patch) ;
19162 /* check that db.h & libdb are compatible */
19163 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
19164 printf("db.h and libdb are incompatible.\n") ;
19168 printf("db.h and libdb are compatible.\n") ;
19170 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
19171 + DB_VERSION_PATCH ;
19173 /* needs to be >= 2.3.4 */
19174 if (Version < 2003004) {
19175 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
19176 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
19182 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
19187 printf("You have Berkeley DB Version 1.\n");
19188 exit(0); /* DB version < 2: the coast is clear. */
19190 exit(1); /* <db.h> not Berkeley DB? */
19196 if eval $compile_ok && $run ./try; then
19197 echo 'Looks OK.' >&4
19199 db_version_major=$1
19200 db_version_minor=$2
19201 db_version_patch=$3
19203 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
19207 : Remove db from list of libraries to use
19208 echo "Removing unusable -ldb from library list" >&4
19209 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
19212 echo "libs = $libs" >&4
19222 : Check the return type needed for hash
19224 echo "Checking return type needed for hash for Berkeley DB ..." >&4
19230 #include <sys/types.h>
19233 #ifndef DB_VERSION_MAJOR
19234 u_int32_t hash_cb (ptr, size)
19242 info.hash = hash_cb;
19246 if $cc $ccflags -c try.c >try.out 2>&1 ; then
19247 if $contains warning try.out >>/dev/null 2>&1 ; then
19250 db_hashtype='u_int32_t'
19253 : XXX Maybe we should just give up here.
19254 db_hashtype=u_int32_t
19256 echo "Help: I can't seem to compile the db test program." >&4
19257 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
19260 echo "Your version of Berkeley DB uses $db_hashtype for hash."
19262 *) db_hashtype=u_int32_t
19267 : Check the return type needed for prefix
19269 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
19275 #include <sys/types.h>
19278 #ifndef DB_VERSION_MAJOR
19279 size_t prefix_cb (key1, key2)
19287 info.prefix = prefix_cb;
19291 if $cc $ccflags -c try.c >try.out 2>&1 ; then
19292 if $contains warning try.out >>/dev/null 2>&1 ; then
19293 db_prefixtype='int'
19295 db_prefixtype='size_t'
19298 db_prefixtype='size_t'
19299 : XXX Maybe we should just give up here.
19301 echo "Help: I can't seem to compile the db test program." >&4
19302 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
19305 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
19307 *) db_prefixtype='size_t'
19311 : How can we generate normalized random numbers ?
19313 echo "Looking for a random number function..." >&4
19314 case "$randfunc" in
19316 if set drand48 val -f; eval $csym; $val; then
19318 echo "Good, found drand48()." >&4
19319 elif set random val -f; eval $csym; $val; then
19321 echo "OK, found random()." >&4
19324 echo "Yick, looks like I have to use rand()." >&4
19335 *-Dmy_rand=*|*-Dmy_srand=*)
19336 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
19337 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
19338 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
19339 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
19343 while $test "$cont"; do
19344 rp="Use which function to generate random numbers?"
19346 if $test "$ans" = "$dflt"; then
19352 if set $ans val -f; eval $csym; $val; then
19356 rp="I cannot find function $ans. Use that name anyway?"
19365 case "$randfunc" in
19367 drand01="drand48()"
19373 case "$randbits" in
19375 echo "Checking to see how many bits your $randfunc() function produces..." >&4
19377 #$i_unistd I_UNISTD
19378 #$i_stdlib I_STDLIB
19381 # include <unistd.h>
19384 # include <stdlib.h>
19389 register unsigned long tmp;
19390 register unsigned long max = 0L;
19392 for (i = 1000; i; i--) {
19393 tmp = (unsigned long) $randfunc();
19394 if (tmp > max) max = tmp;
19396 for (i = 0; max; i++)
19402 if eval $compile_ok; then
19406 echo "(I can't seem to compile the test program...)"
19413 rp="How many bits does your $randfunc() function produce?"
19417 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
19418 seedfunc="s$randfunc"
19419 randseedtype=unsigned
19423 rp="How many bits does your $randfunc() function produce?"
19426 seedfunc="s$randfunc"
19427 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
19428 if set $seedfunc val -f; eval $csym; $val; then
19429 echo "(Using $seedfunc() to seed random generator)"
19431 echo "(Warning: no $seedfunc() to seed random generator)"
19434 randseedtype=unsigned
19441 : Determine if this is an EBCDIC system
19443 echo "Determining whether or not we are on an EBCDIC system..." >&4
19444 $cat >try.c <<'EOM'
19447 if ('M'==0xd4) return 0;
19454 if eval $compile_ok; then
19455 if $run ./try; then
19456 echo "You seem to speak EBCDIC." >&4
19459 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
19462 echo "I'm unable to compile the test program." >&4
19463 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
19469 : Check how to flush
19472 Checking how to flush all pending stdio output...
19474 # I only know how to find the first 32 possibly open files on SunOS.
19475 # See also hints/sunos_4_1.sh and util.c --AD
19477 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
19479 $cat >>try.c <<EOCP
19481 #$i_stdlib I_STDLIB
19483 #include <stdlib.h>
19485 #$i_unistd I_UNISTD
19487 # include <unistd.h>
19489 #$d_sysconf HAS_SYSCONF
19490 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
19491 #ifdef HAS_STDIO_STREAM_ARRAY
19492 # define STDIO_STREAM_ARRAY $stdio_stream_array
19497 p = fopen("try.out", "w");
19501 # ifdef TRY_FPRINTF
19505 #ifdef TRY_FFLUSH_NULL
19508 #ifdef TRY_FFLUSH_ALL
19510 long open_max = -1;
19511 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
19512 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
19514 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
19515 open_max = sysconf(_SC_OPEN_MAX);
19518 open_max = FOPEN_MAX;
19521 open_max = OPEN_MAX;
19530 # ifdef HAS_STDIO_STREAM_ARRAY
19531 if (open_max > 0) {
19533 for (i = 0; i < open_max; i++)
19534 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
19535 STDIO_STREAM_ARRAY[i]._file < open_max &&
19536 STDIO_STREAM_ARRAY[i]._flag)
19537 fflush(&STDIO_STREAM_ARRAY[i]);
19545 : first we have to find out how _not_ to flush
19547 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
19549 set try -DTRY_FPUTC
19550 if eval $compile; then
19551 $run ./try 2>/dev/null
19554 if $test ! -s try.out -a "X$code" = X42; then
19560 set try -DTRY_FPRINTF
19561 if eval $compile; then
19562 $run ./try 2>/dev/null
19565 if $test ! -s try.out -a "X$code" = X42; then
19566 output=-DTRY_FPRINTF
19572 : check for fflush NULL behaviour
19573 case "$fflushNULL" in
19574 '') set try -DTRY_FFLUSH_NULL $output
19575 if eval $compile; then
19576 $run ./try 2>/dev/null
19579 if $test -s try.out -a "X$code" = X42; then
19580 fflushNULL="`$cat try.out`"
19582 if $test "X$code" != X42; then
19584 (If this test failed, don't worry, we'll try another method shortly.)
19589 $rm -f core try.core core.try.*
19590 case "$fflushNULL" in
19592 Your fflush(NULL) works okay for output streams.
19593 Let's see if it clobbers input pipes...
19595 # As of mid-March 2000 all versions of Solaris appear to have a stdio
19596 # bug that improperly flushes the input end of pipes. So we avoid the
19597 # autoflush on fork/system/exec support for now. :-(
19598 $cat >tryp.c <<EOCP
19601 main(int argc, char **argv)
19607 while ((i = getc(stdin)) != -1
19608 && (*bp++ = i) != '\n'
19609 && bp < &buf[1024])
19612 fprintf(stdout, "%s", buf);
19620 fflushNULL="$define"
19622 if eval $compile; then
19624 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19625 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19627 fflush(NULL) seems to behave okay with input streams.
19629 fflushNULL="$define"
19632 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
19634 fflushNULL="$undef"
19637 $rm -f core tryp.c tryp.core core.tryp.*
19640 Your fflush(NULL) isn't working (contrary to ANSI C).
19642 fflushNULL="$undef"
19645 Cannot figure out whether your fflush(NULL) works or not.
19646 I'm assuming it doesn't (contrary to ANSI C).
19648 fflushNULL="$undef"
19652 $define|true|[yY]*)
19653 fflushNULL="$define"
19656 fflushNULL="$undef"
19659 : check explicit looping only if NULL did not work, and if the pipe
19660 : bug does not show up on an explicit flush too
19661 case "$fflushNULL" in
19663 $cat >tryp.c <<EOCP
19666 main(int argc, char **argv)
19672 while ((i = getc(stdin)) != -1
19673 && (*bp++ = i) != '\n'
19674 && bp < &buf[1024])
19677 fprintf(stdout, "%s", buf);
19686 if eval $compile; then
19688 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19689 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19691 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
19693 : now check for fflushall behaviour
19694 case "$fflushall" in
19695 '') set try -DTRY_FFLUSH_ALL $output
19696 if eval $compile; then
19698 (Now testing the other method--but note that this also may fail.)
19700 $run ./try 2>/dev/null
19703 if $test -s try.out -a "X$code" = X42; then
19704 fflushall="`$cat try.out`"
19708 case "$fflushall" in
19710 Whew. Flushing explicitly all the stdio streams works.
19712 fflushall="$define"
19715 Sigh. Flushing explicitly all the stdio streams doesn't work.
19720 Cannot figure out whether flushing stdio streams explicitly works or not.
19721 I'm assuming it doesn't.
19727 "$define"|true|[yY]*)
19728 fflushall="$define"
19736 All is futile. Even fflush(stdin) clobbers input pipes!
19743 $rm -f core tryp.c tryp.core core.tryp.*
19745 *) fflushall="$undef"
19749 case "$fflushNULL$fflushall" in
19752 OK, I give up. I cannot figure out how to flush pending stdio output.
19753 We won't be flushing handles at all before fork/exec/popen.
19759 : Store the full pathname to the ar program for use in the C program
19760 : Respect a hint or command line value for full_ar.
19765 : Store the full pathname to the sed program for use in the C program
19768 : see what type gids are declared as in the kernel
19770 echo "Looking for the type for group ids returned by getgid()."
19771 set gid_t gidtype xxx stdio.h sys/types.h
19775 xxx=`./findhdr sys/user.h`
19776 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
19778 unsigned) dflt="$1 $2" ;;
19782 *) dflt="$gidtype";;
19785 gid_t) echo "gid_t found." ;;
19786 *) rp="What is the type for group ids returned by getgid()?"
19792 : Check the size of GID
19795 *_t) zzz="$gidtype" ;;
19798 echo "Checking the size of $zzz..." >&4
19800 #include <sys/types.h>
19802 #$i_stdlib I_STDLIB
19804 #include <stdlib.h>
19807 printf("%d\n", (int)sizeof($gidtype));
19812 if eval $compile_ok; then
19816 echo "(I can't execute the test program--guessing $gidsize.)" >&4
19819 echo "Your $zzz is $gidsize bytes long."
19824 echo "(I can't compile the test program--guessing $gidsize.)" >&4
19828 : Check if GID is signed
19831 *_t) zzz="$gidtype" ;;
19834 echo "Checking the sign of $zzz..." >&4
19836 #include <sys/types.h>
19847 if eval $compile; then
19851 echo "(I can't execute the test program--guessing unsigned.)" >&4
19855 1) echo "Your $zzz is unsigned." ;;
19856 -1) echo "Your $zzz is signed." ;;
19862 echo "(I can't compile the test program--guessing unsigned.)" >&4
19866 : Check 64bit sizes
19869 if $test X"$quadtype" != X; then
19871 echo "Checking how to print 64-bit integers..." >&4
19873 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
19874 $cat >try.c <<'EOCP'
19875 #include <sys/types.h>
19878 int q = 12345678901;
19879 printf("%ld\n", q);
19883 if eval $compile; then
19887 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
19888 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
19889 echo "We will use %d."
19895 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
19896 $cat >try.c <<'EOCP'
19897 #include <sys/types.h>
19900 long q = 12345678901;
19901 printf("%ld\n", q);
19905 if eval $compile; then
19909 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
19910 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
19911 echo "We will use %ld."
19917 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
19918 $cat >try.c <<'EOCP'
19919 #include <sys/types.h>
19920 #include <inttypes.h>
19923 int64_t q = 12345678901;
19924 printf("%" PRId64 "\n", q);
19928 if eval $compile; then
19932 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
19933 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
19934 echo "We will use the C9X style."
19940 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19942 #include <sys/types.h>
19945 $quadtype q = 12345678901;
19946 printf("%Ld\n", q);
19950 if eval $compile; then
19954 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
19955 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
19956 echo "We will use %Ld."
19962 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
19963 $cat >try.c <<'EOCP'
19964 #include <sys/types.h>
19967 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
19968 printf("%lld\n", q);
19972 if eval $compile; then
19976 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
19977 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
19978 echo "We will use the %lld style."
19984 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19986 #include <sys/types.h>
19989 $quadtype q = 12345678901;
19990 printf("%qd\n", q);
19994 if eval $compile; then
19998 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
19999 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
20000 echo "We will use %qd."
20006 if $test X"$sPRId64" = X; then
20007 echo "Cannot figure out how to print 64-bit integers." >&4
20014 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
20015 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
20017 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
20018 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
20022 : Check format strings for internal types
20024 $echo "Checking the format strings to be used for Perl's internal types..." >&4
20026 if $test X"$ivsize" = X8; then
20027 ivdformat="$sPRId64"
20028 uvuformat="$sPRIu64"
20029 uvoformat="$sPRIo64"
20030 uvxformat="$sPRIx64"
20031 uvXUformat="$sPRIXU64"
20033 if $test X"$ivsize" = X"$longsize"; then
20040 if $test X"$ivsize" = X"$intsize"; then
20048 if $test X"$ivsize" = X"$shortsize"; then
20059 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
20060 nveformat="$sPRIeldbl"
20061 nvfformat="$sPRIfldbl"
20062 nvgformat="$sPRIgldbl"
20063 nvEUformat="$sPRIEUldbl"
20064 nvFUformat="$sPRIFUldbl"
20065 nvGUformat="$sPRIGUldbl"
20075 case "$ivdformat" in
20076 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
20081 : Check format string for GID
20084 $echo "Checking the format string to be used for gids..." >&4
20087 -1) if $test X"$gidsize" = X"$ivsize"; then
20088 gidformat="$ivdformat"
20090 if $test X"$gidsize" = X"$longsize"; then
20093 if $test X"$gidsize" = X"$intsize"; then
20096 if $test X"$gidsize" = X"$shortsize"; then
20103 *) if $test X"$gidsize" = X"$uvsize"; then
20104 gidformat="$uvuformat"
20106 if $test X"$gidsize" = X"$longsize"; then
20109 if $test X"$gidsize" = X"$intsize"; then
20112 if $test X"$gidsize" = X"$shortsize"; then
20121 : see if getgroups exists
20122 set getgroups d_getgrps
20125 : see if setgroups exists
20126 set setgroups d_setgrps
20129 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
20131 case "$d_getgrps$d_setgrps" in
20133 case "$groupstype" in
20134 '') dflt="$gidtype" ;;
20135 *) dflt="$groupstype" ;;
20138 What type of pointer is the second argument to getgroups() and setgroups()?
20139 Usually this is the same as group ids, $gidtype, but not always.
20142 rp='What type pointer is the second argument to getgroups() and setgroups()?'
20146 *) groupstype="$gidtype";;
20149 : MAD = Misc Attribute Definition
20151 if $test $patchlevel -lt 9; then
20152 : MAD is not available in 5.8.x or earlier.
20156 $define|true|[yY]*) dflt='y' ;;
20161 Would you like to build with Misc Attribute Decoration? This is development
20162 work leading to a Perl 5 to Perl 6 convertor, which imposes a space and speed
20163 overhead on the interpreter.
20165 If this doesn't make any sense to you, just accept the default '$dflt'.
20167 rp='Build Perl with MAD?'
20172 madlyh='madly.h madly.act madly.tab'
20174 madlyobj="madly$_o" ;;
20183 : check whether make sets MAKE
20185 echo "Checking if your $make program sets \$(MAKE)..." >&4
20186 case "$make_set_make" in
20188 $sed 's/^X //' > testmake.mak << 'EOF'
20190 X @echo 'maketemp="$(MAKE)"'
20192 case "`$make -f testmake.mak 2>/dev/null`" in
20193 *maketemp=*) make_set_make='#' ;;
20194 *) make_set_make="MAKE=$make" ;;
20196 $rm -f testmake.mak
20199 case "$make_set_make" in
20200 '#') echo "Yup, it does.";;
20201 *) echo "Nope, it doesn't.";;
20204 : see what type is used for mode_t
20205 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
20206 set mode_t modetype int stdio.h sys/types.h
20209 : see if we need va_copy
20211 case "$i_stdarg" in
20214 #include <stdarg.h>
20216 #$i_stdlib I_STDLIB
20218 #include <stdlib.h>
20220 #include <signal.h>
20223 ivfprintf(FILE *f, const char *fmt, va_list *valp)
20225 return vfprintf(f, fmt, *valp);
20229 myvfprintf(FILE *f, const char *fmt, va_list val)
20231 return ivfprintf(f, fmt, &val);
20235 myprintf(char *fmt, ...)
20238 va_start(val, fmt);
20239 return myvfprintf(stdout, fmt, val);
20243 main(int ac, char **av)
20245 signal(SIGSEGV, exit);
20247 myprintf("%s%cs all right, then\n", "that", '\'');
20252 if eval $compile && $run ./try 2>&1 >/dev/null; then
20253 case "`$run ./try`" in
20254 "that's all right, then")
20260 yes) echo "It seems that you don't need va_copy()." >&4
20261 need_va_copy="$undef"
20263 *) echo "It seems that va_copy() or similar will be needed." >&4
20264 need_va_copy="$define"
20269 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
20273 : see what type is used for size_t
20274 rp="What is the type used for the length parameter for string functions?"
20275 set size_t sizetype 'unsigned int' stdio.h sys/types.h
20278 : check for type of arguments to gethostbyaddr.
20279 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
20280 case "$d_gethbyaddr" in
20284 Checking to see what type of arguments are accepted by gethostbyaddr().
20286 hdrs="$define sys/types.h
20287 $d_socket sys/socket.h
20288 $i_niin netinet/in.h
20290 $i_unistd unistd.h"
20291 : The first arg can 'char *' or 'void *'
20292 : The second arg is some of integral type
20293 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
20294 for yyy in size_t long int; do
20295 case "$netdb_host_type" in
20296 '') try="$extern_C struct hostent *gethostbyaddr($xxx, $yyy, int);"
20297 if ./protochk "$try" $hdrs; then
20298 echo "Your system accepts $xxx for the first arg."
20299 echo "...and $yyy for the second arg."
20300 netdb_host_type="$xxx"
20301 netdb_hlen_type="$yyy"
20307 : In case none of those worked, prompt the user.
20308 case "$netdb_host_type" in
20309 '') rp='What is the type for the 1st argument to gethostbyaddr?'
20312 netdb_host_type=$ans
20313 rp='What is the type for the 2nd argument to gethostbyaddr?'
20316 netdb_hlen_type=$ans
20320 *) : no gethostbyaddr, so pick harmless defaults
20321 netdb_host_type='char *'
20322 netdb_hlen_type="$sizetype"
20325 # Remove the "const" if needed. -- but then we'll have a
20327 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
20330 : check for type of argument to gethostbyname.
20331 if test "X$netdb_name_type" = X ; then
20332 case "$d_gethbyname" in
20336 Checking to see what type of argument is accepted by gethostbyname().
20338 hdrs="$define sys/types.h
20339 $d_socket sys/socket.h
20340 $i_niin netinet/in.h
20342 $i_unistd unistd.h"
20343 for xxx in "const char *" "char *"; do
20344 case "$netdb_name_type" in
20345 '') try="$extern_C struct hostent *gethostbyname($xxx);"
20346 if ./protochk "$try" $hdrs; then
20347 echo "Your system accepts $xxx."
20348 netdb_name_type="$xxx"
20353 : In case none of those worked, prompt the user.
20354 case "$netdb_name_type" in
20355 '') rp='What is the type for the 1st argument to gethostbyname?'
20358 netdb_name_type=$ans
20362 *) : no gethostbyname, so pick harmless default
20363 netdb_name_type='char *'
20368 : check for type of 1st argument to getnetbyaddr.
20369 if test "X$netdb_net_type" = X ; then
20370 case "$d_getnbyaddr" in
20374 Checking to see what type of 1st argument is accepted by getnetbyaddr().
20376 hdrs="$define sys/types.h
20377 $d_socket sys/socket.h
20378 $i_niin netinet/in.h
20380 $i_unistd unistd.h"
20381 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
20382 case "$netdb_net_type" in
20383 '') try="$extern_C struct netent *getnetbyaddr($xxx, int);"
20384 if ./protochk "$try" $hdrs; then
20385 echo "Your system accepts $xxx."
20386 netdb_net_type="$xxx"
20391 : In case none of those worked, prompt the user.
20392 case "$netdb_net_type" in
20393 '') rp='What is the type for the 1st argument to getnetbyaddr?'
20396 netdb_net_type=$ans
20400 *) : no getnetbyaddr, so pick harmless default
20401 netdb_net_type='long'
20405 : locate the preferred pager for this system
20412 [a-zA-Z]:/*) dflt=$pg;;
20416 [a-zA-Z]:/*) dflt=$more;;
20420 [a-zA-Z]:/*) dflt=$less;;
20423 '') dflt=/usr/ucb/more;;
20431 rp='What pager is used on your system?'
20435 : see what type pids are declared as in the kernel
20436 rp="What is the type of process ids on this system?"
20437 set pid_t pidtype int stdio.h sys/types.h
20440 : see if ar generates random libraries by itself
20442 echo "Checking how to generate random libraries on your machine..." >&4
20443 echo 'int bar1() { return bar2(); }' > bar1.c
20444 echo 'int bar2() { return 2; }' > bar2.c
20446 #$i_stdlib I_STDLIB
20448 #include <stdlib.h>
20450 int main() { printf("%d\n", bar1()); exit(0); }
20452 $cc $ccflags -c bar1.c >/dev/null 2>&1
20453 $cc $ccflags -c bar2.c >/dev/null 2>&1
20454 $cc $ccflags -c foo.c >/dev/null 2>&1
20455 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
20456 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20457 $run ./foobar >/dev/null 2>&1; then
20458 echo "$ar appears to generate random libraries itself."
20460 if [ "X$ranlib" = "X" ]; then
20463 elif $ar s bar$_a >/dev/null 2>&1 &&
20464 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20465 $run ./foobar >/dev/null 2>&1; then
20466 echo "a table of contents needs to be added with '$ar s'."
20469 elif $ar ts bar$_a >/dev/null 2>&1 &&
20470 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20471 $run ./foobar >/dev/null 2>&1; then
20472 echo "a table of contents needs to be added with '$ar ts'."
20479 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
20480 $test -f $ranlib || ranlib=''
20483 if $test -n "$ranlib"; then
20484 echo "your system has '$ranlib'; we'll use that."
20487 echo "your system doesn't seem to support random libraries"
20488 echo "so we'll use lorder and tsort to order the libraries."
20495 : see if this is a values.h system
20496 set values.h i_values
20499 : Check the max offset that gmtime and localtime accept
20500 echo "Checking max offsets that gmtime () accepts"
20503 define) yyy="#include <values.h>" ;;
20507 case "$sGMTIME_min/$sGMTIME_max" in
20510 #include <sys/types.h>
20519 void gm_check (time_t t, int min_year, int max_year)
20522 if ( tmp == NULL ||
20523 /* Check tm_year overflow */
20524 tmp->tm_year < min_year || tmp->tm_year > max_year)
20535 gm_check (MAXLONG, 69, 0x7fffffff);
20537 if (tmp == NULL || tmp->tm_year < 0) {
20538 for (i = 63; i >= 0; i--) {
20539 time_t x = pt | ((time_t)1 << i);
20540 if (x < 0 || x < pt) continue;
20541 gm_check (x, 69, 0x7fffffff);
20544 printf ("sGMTIME_max=%ld\n", pt);
20553 gm_check (MINLONG, -1900, 70);
20556 for (i = 36; i >= 0; i--) {
20557 time_t x = pt - ((time_t)1 << i);
20558 if (x > 0) continue;
20559 gm_check (x, -1900, 70);
20562 printf ("sGMTIME_min=%ld\n", pt);
20566 int main (int argc, char *argv[])
20568 fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t));
20575 if eval $compile; then
20578 echo "Cannot determine sGMTIME_max and sGMTIME_min." >&4
20584 echo "Checking max offsets that localtime () accepts"
20586 case "$sLOCALTIME_min/$sLOCALTIME_max" in
20589 #include <sys/types.h>
20598 void local_check (time_t t, int min_year, int max_year)
20600 if (sizeof (time_t) > 4 && t > 0x7ffffffffffff000LL)
20603 tmp = localtime (&t);
20604 if ( tmp == NULL ||
20605 /* Check tm_year overflow */
20606 tmp->tm_year < min_year || tmp->tm_year > max_year)
20610 } /* local_check */
20617 local_check (MAXLONG, 69, 0x7fffffff);
20619 if (tmp == NULL || tmp->tm_year < 0) {
20620 for (i = 63; i >= 0; i--) {
20621 time_t x = pt | ((time_t)1 << i);
20622 if (x < 0 || x < pt) continue;
20623 local_check (x, 69, 0x7fffffff);
20626 printf ("sLOCALTIME_max=%ld\n", pt);
20635 local_check (MINLONG, -1900, 70);
20638 for (i = 36; i >= 0; i--) {
20639 time_t x = pt - ((time_t)1 << i);
20640 if (x > 0) continue;
20641 local_check (x, -1900, 70);
20644 printf ("sLOCALTIME_min=%ld\n", pt);
20648 int main (int argc, char *argv[])
20656 if eval $compile; then
20659 echo "Cannot determine sLOCALTIME_max and sLOCALTIME_min." >&4
20665 : check for type of arguments to select.
20666 case "$selecttype" in
20667 '') case "$d_select" in
20671 Checking to see what type of arguments are accepted by select().
20673 hdrs="$define sys/types.h
20674 $i_systime sys/time.h
20675 $i_sysselct sys/select.h
20676 $d_socket sys/socket.h"
20677 : The first arg can be int, unsigned, or size_t
20678 : The last arg may or may not be 'const'
20680 : void pointer has been seen but using that
20681 : breaks the selectminbits test
20682 for xxx in 'fd_set *' 'int *'; do
20683 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
20684 for tmo in 'struct timeval *' 'const struct timeval *'; do
20686 '') try="$extern_C select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
20687 if ./protochk "$try" $hdrs; then
20688 echo "Your system accepts $xxx."
20697 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
20698 case "$d_fd_set" in
20699 $define) dflt="fd_set *" ;;
20708 *) : no select, so pick a harmless default
20715 : check for the select 'width'
20716 case "$selectminbits" in
20717 '') safebits=`expr $ptrsize \* 8`
20718 case "$d_select" in
20722 Checking to see on how many bits at a time your select() operates...
20725 #include <sys/types.h>
20727 #$i_systime I_SYS_TIME
20728 #$i_systimek I_SYS_TIME_KERNEL
20733 # ifdef I_SYS_TIME_KERNEL
20736 # include <sys/time.h>
20737 # ifdef I_SYS_TIME_KERNEL
20741 #$i_sysselct I_SYS_SELECT
20742 #ifdef I_SYS_SELECT
20743 #include <sys/select.h>
20745 #$d_socket HAS_SOCKET
20747 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
20750 #$i_stdlib I_STDLIB
20752 #include <stdlib.h>
20755 #define S sizeof(*(b))
20757 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
20758 #define NBITS (NBYTES * 8)
20760 char *s = (char *)malloc(NBYTES);
20769 fp = fopen("try.c", "r");
20775 b = ($selecttype)s;
20776 for (i = 0; i < NBITS; i++)
20780 select(fd + 1, b, 0, 0, &t);
20781 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
20783 printf("%d\n", i + 1);
20788 if eval $compile_ok; then
20789 selectminbits=`$run ./try`
20790 case "$selectminbits" in
20792 Cannot figure out on how many bits at a time your select() operates.
20793 I'll play safe and guess it is $safebits bits.
20795 selectminbits=$safebits
20796 bits="$safebits bits"
20799 *) bits="$selectminbits bits" ;;
20801 echo "Your select() operates on $bits at a time." >&4
20803 rp='What is the minimum number of bits your select() operates on?'
20804 case "$byteorder" in
20805 12345678) dflt=64 ;;
20811 selectminbits="$val"
20815 *) : no select, so pick a harmless default
20816 selectminbits=$safebits
20822 : Trace out the files included by signal.h, then look for SIGxxx names.
20823 if [ "X$fieldn" = X ]; then
20824 : Just make some guesses. We check them later.
20825 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
20827 xxx=`echo '#include <signal.h>' |
20828 $cppstdin $cppminus $cppflags 2>/dev/null |
20829 $grep '^[ ]*#.*include' |
20830 $awk "{print \\$$fieldn}" | $sed 's!"!!g' |\
20831 $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
20834 for xx in $xxx /dev/null ; do
20835 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
20837 case "$xxxfiles" in
20838 '') xxxfiles=`./findhdr signal.h` ;;
20841 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
20842 print substr($2, 4, 20)
20844 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
20845 print substr($3, 4, 20)
20847 : Append some common names just in case the awk scan failed.
20848 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
20849 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
20850 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
20851 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
20852 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
20854 : generate a few handy files for later
20855 $cat > signal.c <<EOCP
20856 #include <sys/types.h>
20857 #include <signal.h>
20858 #$i_stdlib I_STDLIB
20860 #include <stdlib.h>
20865 /* Strange style to avoid deeply-nested #if/#else/#endif */
20868 # define NSIG (_NSIG)
20874 # define NSIG (SIGMAX+1)
20880 # define NSIG (SIG_MAX+1)
20886 # define NSIG (_SIG_MAX+1)
20892 # define NSIG (MAXSIG+1)
20898 # define NSIG (MAX_SIG+1)
20903 # ifdef SIGARRAYSIZE
20904 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
20910 # define NSIG (_sys_nsig) /* Solaris 2.5 */
20914 /* Default to some arbitrary number that's big enough to get most
20915 of the common signals.
20921 printf("NSIG %d\n", NSIG);
20927 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
20929 printf "#ifdef SIG"; printf $1; printf "\n"
20930 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
20931 printf $1; printf ");\n"
20935 printf "#endif /* JUST_NSIG */\n";
20936 printf "exit(0);\n}\n";
20939 $cat >signal.awk <<'EOP'
20940 BEGIN { ndups = 0 }
20941 $1 ~ /^NSIG$/ { nsig = $2 }
20942 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
20943 if ($2 > maxsig) { maxsig = $2 }
20944 if (sig_name[$2]) {
20945 dup_name[ndups] = $1
20946 dup_num[ndups] = $2
20958 printf("NSIG %d\n", nsig);
20959 for (n = 1; n < nsig; n++) {
20961 printf("%s %d\n", sig_name[n], sig_num[n])
20964 printf("NUM%d %d\n", n, n)
20967 for (n = 0; n < ndups; n++) {
20968 printf("%s %d\n", dup_name[n], dup_num[n])
20972 $cat >signal_cmd <<EOS
20974 if $test -s signal.lst; then
20975 echo "Using your existing signal.lst file"
20980 $cat >>signal_cmd <<'EOS'
20983 if eval $compile_ok; then
20984 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) |\
20985 $uniq | $awk -f signal.awk >signal.lst
20987 echo "(I can't seem be able to compile the whole test program)" >&4
20988 echo "(I'll try it in little pieces.)" >&4
20989 set signal -DJUST_NSIG
20990 if eval $compile_ok; then
20991 $run ./signal$_exe > signal.nsg
20994 echo "I can't seem to figure out how many signals you have." >&4
20995 echo "Guessing 50." >&4
20996 echo 'NSIG 50' > signal.nsg
20998 : Now look at all the signal names, one at a time.
20999 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
21000 $cat > signal.c <<EOCP
21001 #include <sys/types.h>
21002 #include <signal.h>
21005 printf("$xx %d\n", SIG${xx});
21010 if eval $compile; then
21011 echo "SIG${xx} found."
21012 $run ./signal$_exe >> signal.ls1
21014 echo "SIG${xx} NOT found."
21017 if $test -s signal.ls1; then
21018 $cat signal.nsg signal.ls1 |
21019 $sort -n | $uniq | $awk -f signal.awk >signal.lst
21023 if $test -s signal.lst; then
21026 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
21027 echo 'kill -l' >signal
21028 set X `csh -f <signal`
21032 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
21034 echo $@ | $tr ' ' $trnl | \
21035 $awk '{ printf "%s %d\n", $1, ++s; }
21036 END { printf "NSIG %d\n", ++s }' >signal.lst
21038 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
21040 chmod a+x signal_cmd
21041 $eunicefix signal_cmd
21043 : generate list of signal names
21045 case "$sig_name_init" in
21047 *) case "$sig_num_init" in
21048 ''|*,*) doinit=yes ;;
21053 echo "Generating a list of signal names and numbers..." >&4
21055 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
21056 sig_name=`$awk 'BEGIN { printf "ZERO " }
21057 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
21058 sig_num=`$awk 'BEGIN { printf "0 " }
21059 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
21060 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
21061 !/^NSIG/ { printf "\"%s\", ", $1 }
21062 END { printf "0\n" }' signal.lst`
21063 sig_num_init=`$awk 'BEGIN { printf "0, " }
21064 !/^NSIG/ { printf "%d, ", $2}
21065 END { printf "0\n"}' signal.lst`
21068 echo "The following $sig_count signals are available:"
21070 echo $sig_name | $awk \
21071 'BEGIN { linelen = 0 }
21073 for (i = 1; i <= NF; i++) {
21074 name = "SIG" $i " "
21075 linelen = linelen + length(name)
21076 if (linelen > 70) {
21078 linelen = length(name)
21084 sig_size=`echo $sig_name | awk '{print NF}'`
21085 $rm -f signal signal.c signal.awk signal.lst signal_cmd
21087 : Check size of size
21089 case "$sizetype" in
21090 *_t) zzz="$sizetype" ;;
21091 *) zzz="filesize" ;;
21093 echo "Checking the size of $zzz..." >&4
21095 #include <sys/types.h>
21097 #$i_stdlib I_STDLIB
21099 #include <stdlib.h>
21102 printf("%d\n", (int)sizeof($sizetype));
21107 if eval $compile_ok; then
21111 echo "(I can't execute the test program--guessing $sizesize.)" >&4
21114 echo "Your $zzz size is $sizesize bytes."
21119 echo "(I can't compile the test program--guessing $sizesize.)" >&4
21123 : check for socklen_t
21125 echo "Checking to see if you have socklen_t..." >&4
21127 #include <sys/types.h>
21128 #$d_socket HAS_SOCKET
21130 #include <sys/socket.h>
21132 int main() { socklen_t x = 16; }
21135 if eval $compile; then
21137 echo "You have socklen_t."
21140 echo "You do not have socklen_t."
21141 case "$sizetype" in
21142 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
21149 : see if this is a socks.h system
21150 set socks.h i_socks
21153 : check for type of the size argument to socket calls
21154 case "$d_socket" in
21158 Checking to see what type is the last argument of accept().
21161 case "$d_socklen_t" in
21162 "$define") yyy="$yyy socklen_t"
21164 yyy="$yyy $sizetype int long unsigned"
21165 for xxx in $yyy; do
21166 case "$socksizetype" in
21167 '') try="$extern_C int accept(int, struct sockaddr *, $xxx *);"
21168 case "$usesocks" in
21170 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
21171 echo "Your system accepts '$xxx *' for the last argument of accept()."
21172 socksizetype="$xxx"
21175 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
21176 echo "Your system accepts '$xxx *' for the last argument of accept()."
21177 socksizetype="$xxx"
21184 : In case none of those worked, prompt the user.
21185 case "$socksizetype" in
21186 '') rp='What is the type for socket address structure sizes?'
21193 *) : no sockets, so pick relatively harmless default
21198 : see what type is used for signed size_t
21199 set ssize_t ssizetype int stdio.h sys/types.h
21204 #$i_stdlib I_STDLIB
21206 #include <stdlib.h>
21208 #include <sys/types.h>
21209 #define Size_t $sizetype
21210 #define SSize_t $dflt
21213 if (sizeof(Size_t) == sizeof(SSize_t))
21215 else if (sizeof(Size_t) == sizeof(int))
21224 if eval $compile_ok && $run ./try > /dev/null; then
21225 ssizetype=`$run ./try`
21226 echo "I'll be using $ssizetype for functions returning a byte count." >&4
21229 Help! I can't compile and run the ssize_t test program: please enlighten me!
21230 (This is probably a misconfiguration in your system or libraries, and
21231 you really ought to fix it. Still, I'll try anyway.)
21233 I need a type that is the same size as $sizetype, but is guaranteed to
21234 be signed. Common values are ssize_t, int and long.
21237 rp="What signed type is the same size as $sizetype?"
21243 : Check the size of st_ino
21245 $echo "Checking the size of st_ino..." >&4
21246 $cat > try.c <<EOCP
21247 #include <sys/stat.h>
21249 #$i_stdlib I_STDLIB
21251 #include <stdlib.h>
21255 printf("%d\n", (int)sizeof(st.st_ino));
21260 if eval $compile_ok; then
21264 $echo "(I can't execute the test program--guessing $st_ino_size.)" >&4
21266 *) st_ino_size=$val
21267 $echo "Your st_ino is $st_ino_size bytes long."
21272 $echo "(I can't compile the test program--guessing $st_ino_size.)" >&4
21276 : Check if st_ino is signed
21278 $echo "Checking the sign of st_ino..." >&4
21279 $cat > try.c <<EOCP
21280 #include <sys/stat.h>
21285 if (foo.st_ino < 0)
21292 if eval $compile; then
21296 $echo "(I can't execute the test program--guessing unsigned.)" >&4
21298 *) st_ino_sign=$val
21299 case "$st_ino_sign" in
21300 1) $echo "Your st_ino is unsigned." ;;
21301 -1) $echo "Your st_ino is signed." ;;
21307 $echo "(I can't compile the test program--guessing unsigned.)" >&4
21311 : see what type of char stdio uses.
21313 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
21314 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
21315 echo "Your stdio uses unsigned chars." >&4
21316 stdchar="unsigned char"
21318 echo "Your stdio uses signed chars." >&4
21323 : see what type uids are declared as in the kernel
21325 echo "Looking for the type for user ids returned by getuid()."
21326 set uid_t uidtype xxx stdio.h sys/types.h
21330 xxx=`./findhdr sys/user.h`
21331 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
21333 unsigned) dflt="$1 $2" ;;
21337 *) dflt="$uidtype";;
21340 uid_t) echo "uid_t found." ;;
21341 *) rp="What is the type for user ids returned by getuid()?"
21347 : Check size of UID
21350 *_t) zzz="$uidtype" ;;
21353 echo "Checking the size of $zzz..." >&4
21355 #include <sys/types.h>
21357 #$i_stdlib I_STDLIB
21359 #include <stdlib.h>
21362 printf("%d\n", (int)sizeof($uidtype));
21367 if eval $compile_ok; then
21371 echo "(I can't execute the test program--guessing $uidsize.)" >&4
21374 echo "Your $zzz is $uidsize bytes long."
21379 echo "(I can't compile the test program--guessing $uidsize.)" >&4
21382 : Check if UID is signed
21385 *_t) zzz="$uidtype" ;;
21388 echo "Checking the sign of $zzz..." >&4
21390 #include <sys/types.h>
21401 if eval $compile; then
21405 echo "(I can't execute the test program--guessing unsigned.)" >&4
21409 1) echo "Your $zzz is unsigned." ;;
21410 -1) echo "Your $zzz is signed." ;;
21416 echo "(I can't compile the test program--guessing unsigned.)" >&4
21420 : Check format string for UID
21422 $echo "Checking the format string to be used for uids..." >&4
21425 -1) if $test X"$uidsize" = X"$ivsize"; then
21426 uidformat="$ivdformat"
21428 if $test X"$uidsize" = X"$longsize"; then
21431 if $test X"$uidsize" = X"$intsize"; then
21434 if $test X"$uidsize" = X"$shortsize"; then
21441 *) if $test X"$uidsize" = X"$uvsize"; then
21442 uidformat="$uvuformat"
21444 if $test X"$uidsize" = X"$longsize"; then
21447 if $test X"$uidsize" = X"$intsize"; then
21450 if $test X"$uidsize" = X"$shortsize"; then
21459 : Determine if we can use sysctl with KERN_PROC_PATHNAME to find executing program
21461 echo "Determining whether we can use sysctl with KERN_PROC_PATHNAME to find executing program..." >&4
21462 $cat >try.c <<'EOM'
21463 /* Intentionally a long probe as I'd like to sanity check that the exact
21464 approach is going to work, as thinking it will work, but only having it
21465 part working at runtime is worse than not having it. */
21467 #include <sys/types.h>
21468 #include <sys/sysctl.h>
21469 #include <sys/param.h>
21471 #include <string.h>
21472 #include <stdlib.h>
21473 #include <unistd.h>
21476 main(int argc, char **argv) {
21478 char *argv_leaf = strrchr(argv[0], '/');
21484 mib[1] = KERN_PROC;
21485 mib[2] = KERN_PROC_PATHNAME;
21489 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
21493 if (sysctl(mib, 4, NULL, &size, NULL, 0)) {
21498 if (size < strlen(argv_leaf) + 1) {
21499 fprintf(stderr, "size %lu is too short for a path\n",
21500 (unsigned long) size);
21504 if (size > MAXPATHLEN * MAXPATHLEN) {
21505 fprintf(stderr, "size %lu is too long for a path\n",
21506 (unsigned long) size);
21510 buffer = malloc(size);
21516 if (sysctl(mib, 4, buffer, &size, NULL, 0)) {
21521 if (strlen(buffer) + 1 != size) {
21522 fprintf(stderr, "size != strlen(buffer) + 1 (%lu != %lu)\n",
21523 (unsigned long)size, (unsigned long)strlen(buffer) + 1);
21528 if (*buffer != '/') {
21529 fprintf(stderr, "Not an absolute path: '%s'\n", buffer);
21533 if (strstr(buffer, "/./")) {
21534 fprintf(stderr, "Contains /./: '%s'\n", buffer);
21538 if (strstr(buffer, "/../")) {
21539 fprintf(stderr, "Contains /../: '%s'\n", buffer);
21543 buffer_leaf = strrchr(buffer, '/');
21544 if (strcmp(buffer_leaf, argv_leaf) != 0) {
21545 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], buffer);
21557 if eval $compile; then
21558 if $run ./try; then
21559 echo "You can use sysctl with KERN_PROC_PATHNAME to find the executing program." >&4
21562 echo "Nope, sysctl with KERN_PROC_PATHNAME doesn't work here." >&4
21566 echo "I'm unable to compile the test program." >&4
21567 echo "I'll assume no sysctl with KERN_PROC_PATHNAME here." >&4
21571 set usekernprocpathname
21574 : Determine if we can use _NSGetExecutablePath to find executing program
21576 echo "Determining whether we can use _NSGetExecutablePath to find executing program..." >&4
21577 $cat >try.c <<'EOM'
21578 /* Intentionally a long probe as I'd like to sanity check that the exact
21579 approach is going to work, as thinking it will work, but only having it
21580 part working at runtime is worse than not having it. */
21581 #include <mach-o/dyld.h>
21583 #include <stdlib.h>
21584 #include <sys/param.h>
21585 #include <string.h>
21588 main(int argc, char **argv) {
21590 uint32_t size = sizeof(buf);
21594 char *argv_leaf = strrchr(argv[0], '/');
21598 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
21602 _NSGetExecutablePath(buf, &size);
21603 if (size > MAXPATHLEN * MAXPATHLEN) {
21604 fprintf(stderr, "_NSGetExecutablePath size %u is too long for a path\n",
21605 (unsigned int) size);
21609 buffer = malloc(size);
21615 result = _NSGetExecutablePath(buffer, &size);
21617 fprintf(stderr, "_NSGetExecutablePath returned %i for a size of %u\n",
21618 result, (unsigned int) size);
21622 tidied = realpath(buffer, NULL);
21624 perror("realpath");
21630 if (*tidied != '/') {
21631 fprintf(stderr, "Not an absolute path: '%s'\n", tidied);
21635 if (strstr(tidied, "/./")) {
21636 fprintf(stderr, "Contains /./: '%s'\n", tidied);
21640 if (strstr(tidied, "/../")) {
21641 fprintf(stderr, "Contains /../: '%s'\n", tidied);
21645 tidied_leaf = strrchr(tidied, '/');
21646 if (strcmp(tidied_leaf, argv_leaf) != 0) {
21647 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], tidied);
21659 if eval $compile; then
21660 if $run ./try; then
21661 echo "You can use _NSGetExecutablePath to find the executing program." >&4
21664 echo "Nope, _NSGetExecutablePath doesn't work here." >&4
21667 echo "I'm unable to compile the test program." >&4
21668 echo "I'll assume no _NSGetExecutablePath here." >&4
21671 set usensgetexecutablepath
21674 : Check if site customization support was requested
21675 case "$usesitecustomize" in
21676 $define|true|[Yy]*)
21677 usesitecustomize="$define"
21680 usesitecustomize="$undef"
21684 : see if prototypes support variable argument declarations
21686 case "$prototype$i_stdarg" in
21688 echo "It appears we'll be able to prototype varargs functions." >&4
21692 echo "Too bad... We won't be using prototyped varargs functions..." >&4
21699 : determine compiler compiler
21708 if $test -f "$byacc$_exe"; then
21710 comp="byacc or $comp"
21712 if $test -f "$bison$_exe"; then
21713 comp="$comp or bison -y"
21715 rp="Which compiler compiler ($comp) shall I use?"
21724 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
21730 : see if this is a assert.h system
21731 set assert.h i_assert
21734 : see if this is a fp.h system
21738 : see if this is a fp_class.h system
21739 set fp_class.h i_fp_class
21742 : see if gdbm.h is available
21747 : see if gdbm_open exists
21748 set gdbm_open d_gdbm_open
21750 case "$d_gdbm_open" in
21753 echo "We won't be including <gdbm.h>"
21762 : see if this is a ieeefp.h system
21763 case "$i_ieeefp" in
21764 '' ) set ieeefp.h i_ieeefp
21769 : see if this is a libutil.h system
21770 set libutil.h i_libutil
21773 : see if mach cthreads are available
21774 if test "X$usethreads" = "X$define"; then
21775 set mach/cthreads.h i_machcthr
21778 i_machcthr="$undef"
21781 : see if this is a mntent.h system
21782 set mntent.h i_mntent
21785 : see if net/errno.h is available
21787 set net/errno.h val
21790 : Unfortunately, it causes problems on some systems. Arrgh.
21793 cat > try.c <<'EOM'
21796 #include <net/errno.h>
21802 if $cc $ccflags -c try.c >/dev/null 2>&1; then
21803 echo "We'll be including <net/errno.h>." >&4
21805 echo "We won't be including <net/errno.h>." >&4
21814 : see if netinet/tcp.h is available
21815 set netinet/tcp.h i_netinettcp
21818 : see if this is a poll.h system
21822 : see if this is a prot.h system
21826 : Preprocessor symbols
21828 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
21829 $cat <<'EOSH' > Cppsym.know
21830 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
21831 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
21832 alliant alpha am29000 AM29000 AMD64 amd64 amiga AMIGAOS AMIX
21833 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
21834 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
21835 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
21836 bull c cadmus clipper CMU COFF COMPILER_VERSION
21837 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
21838 CYGWIN DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
21839 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
21840 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
21842 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
21843 H3050R H3050RX hbullx20 hcx host_mips
21844 hp200 hp300 hp700 HP700 hp800 hp9000
21845 hp9000s200 hp9000s300 hp9000s400 hp9000s500
21846 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
21847 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
21848 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
21849 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
21850 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
21851 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
21852 LIBCATAMOUNT Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
21853 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
21854 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
21855 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
21856 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
21857 MATH_HAS_NO_SIDE_EFFECTS
21858 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
21859 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
21860 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
21861 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
21862 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
21863 NetBSD news1500 news1700 news1800 news1900 news3700
21864 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
21865 ns32016 ns32332 ns32k nsc32000
21866 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
21867 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
21868 pc532 pdp11 PGC PIC plexus PORTAR posix
21869 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
21870 POSIX_C_SOURCE POSIX_SOURCE POWER
21871 PROTOTYPES PWB pyr QNX QK_USER R3000 REENTRANT RES Rhapsody RISC6000
21872 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
21873 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
21874 sony sony_news sonyrisc sparc sparclite spectrum
21875 stardent stdc STDC_EXT stratos sun sun3 sun386
21876 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
21877 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
21878 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
21879 sysV68 sysV88 Tek4132 Tek4300 titan
21880 TM3200 TM5400 TM5600
21881 tower tower32 tower32_200 tower32_600 tower32_700
21882 tower32_800 tower32_850 tss
21883 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
21884 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
21885 unix UNIX95 UNIX99 unixpc unos
21886 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
21887 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
21888 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
21890 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms x86_64 xenix Xenix286
21891 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
21892 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
21895 # Maybe put other stuff here too.
21896 cat <<EOSH >>Cppsym.know
21899 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
21900 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
21901 $cat Cppsym.know > Cppsym.c
21902 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
21903 $rm -f Cppsym.a Cppsym.b Cppsym.c
21904 cat <<EOSH > Cppsym
21906 if $test \$# -gt 0; then
21907 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
21908 if $test -s Cppsym.got; then
21915 $tr " " "$trnl" | ./Cppsym.try
21921 cat <<EOSH > Cppsym.try
21923 cat <<'EOCP' > try.c
21926 #define STRINGIFY(a) "a"
21928 #if cpp_stuff == 42
21929 #define StGiFy(a) #a
21930 #define STRINGIFY(a) StGiFy(a)
21932 #if $cpp_stuff != 1 && $cpp_stuff != 42
21933 # include "Bletch: How does this C preprocessor stringify macros?"
21939 cat <<'EOSH' >> Cppsym.try
21941 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
21942 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
21943 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
21944 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
21946 echo 'return 0;}' >> try.c
21948 cat <<EOSH >> Cppsym.try
21950 case "$osname-$gccversion" in
21951 irix-) ccflags="\$ccflags -woff 1178" ;;
21952 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
21954 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
21956 chmod +x Cppsym.try
21957 $eunicefix Cppsym.try
21958 ./Cppsym < Cppsym.know | $sort | $uniq > Cppsym.true
21959 : Add in any linux cpp "predefined macros":
21960 case "$osname::$gccversion" in
21961 *linux*::*.*|*gnukfreebsd*::*.*|gnu::*.*)
21963 rm -f $tHdrH'.h' $tHdrH
21965 # Filter out macro arguments, such as Linux's __INT8_C(c)
21966 if $cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
21967 sed -e 's/#define[\ \ ]*//;s/[\ \ ].*$//' -e 's/(.*//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
21968 if [ -s $tHdrH'_cppsym.real' ]; then
21969 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
21972 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
21975 : now check the C compiler for additional symbols
21976 postprocess_cc_v=''
21978 aix) postprocess_cc_v="|$tr , ' '" ;;
21985 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
21988 -D*) echo "\$i" | $sed 's/^-D//';;
21989 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
21994 postprocess_cc_v=''
21997 ./ccsym > ccsym1.raw
21998 if $test -s ccsym1.raw; then
21999 $sort ccsym1.raw | $uniq >ccsym.raw
22001 mv ccsym1.raw ccsym.raw
22004 $awk '/\=/ { print $0; next }
22005 { print $0"=1" }' ccsym.raw >ccsym.list
22006 $comm -13 Cppsym.true ccsym.list >ccsym.own
22007 $comm -12 Cppsym.true ccsym.list >ccsym.com
22008 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
22010 if $test -z ccsym.raw; then
22011 echo "Your C compiler doesn't seem to define any symbols!" >&4
22013 echo "However, your C preprocessor defines the following symbols:"
22016 cppsymbols=`$cat Cppsym.true`
22017 cppsymbols=`echo $cppsymbols`
22018 cppccsymbols="$cppsymbols"
22020 if $test -s ccsym.com; then
22021 echo "Your C compiler and pre-processor define these symbols:"
22022 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
22025 cppccsymbols=`$cat ccsym.com`
22026 cppccsymbols=`echo $cppccsymbols`
22027 $test "$silent" || sleep 1
22029 if $test -s ccsym.cpp; then
22030 $test "$also" && echo " "
22031 echo "Your C pre-processor ${also}defines the following symbols:"
22032 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
22034 cppsymbols=`$cat ccsym.cpp`
22035 cppsymbols=`echo $cppsymbols`
22036 $test "$silent" || sleep 1
22038 if $test -s ccsym.own; then
22039 $test "$also" && echo " "
22040 echo "Your C compiler ${also}defines the following cpp symbols:"
22041 $sed -e 's/\(..*\)=1/\1/' ccsym.own
22042 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
22043 ccsymbols=`$cat ccsym.own`
22044 ccsymbols=`echo $ccsymbols`
22045 $test "$silent" || sleep 1
22049 : see if this is a termio system
22053 if $test `./findhdr termios.h`; then
22054 set tcsetattr i_termios
22060 "$define") echo "You have POSIX termios.h... good!" >&4;;
22061 *) if ./Cppsym pyr; then
22062 case "`/bin/universe`" in
22063 ucb) if $test `./findhdr sgtty.h`; then
22065 echo "<sgtty.h> found." >&4
22067 echo "System is pyramid with BSD universe."
22068 ./warn "<sgtty.h> not found--you could have problems."
22070 *) if $test `./findhdr termio.h`; then
22072 echo "<termio.h> found." >&4
22074 echo "System is pyramid with USG universe."
22075 ./warn "<termio.h> not found--you could have problems."
22079 if $test `./findhdr termio.h`; then
22080 echo "<termio.h> found." >&4
22082 elif $test `./findhdr sgtty.h`; then
22083 echo "<sgtty.h> found." >&4
22086 ./warn "Neither <termio.h> nor <sgtty.h> found--cross fingers!"
22089 if $test `./findhdr sgtty.h`; then
22090 echo "<sgtty.h> found." >&4
22092 elif $test `./findhdr termio.h`; then
22093 echo "<termio.h> found." >&4
22096 ./warn "Neither <sgtty.h> nor <termio.h> found--cross fingers!"
22100 set i_termio; eval $setvar
22101 val=$val2; set i_sgtty; eval $setvar
22102 val=$val3; set i_termios; eval $setvar
22104 : see if stdbool is available
22105 : we want a real compile instead of Inhdr because some Solaris systems
22106 : have stdbool.h, but it can only be used if the compiler indicates it
22107 : is sufficiently c99-compliant.
22111 #include <stdbool.h>
22116 int main(int argc, char **argv)
22122 if eval $compile; then
22123 echo "<stdbool.h> found." >&4
22126 echo "<stdbool.h> NOT found." >&4
22133 : see if stddef is available
22134 set stddef.h i_stddef
22137 : see if sys/access.h is available
22138 set sys/access.h i_sysaccess
22141 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
22142 set sys/filio.h i_sysfilio
22145 if $test `./findhdr sys/ioctl.h`; then
22147 echo '<sys/ioctl.h> found.' >&4
22150 if $test $i_sysfilio = "$define"; then
22151 echo '<sys/ioctl.h> NOT found.' >&4
22153 $test $i_sgtty = "$define" && xxx="sgtty.h"
22154 $test $i_termio = "$define" && xxx="termio.h"
22155 $test $i_termios = "$define" && xxx="termios.h"
22156 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
22162 : see if socket ioctl defs are in sys/sockio.h
22164 xxx=`./findhdr sys/sockio.h`
22165 if $test "$xxx"; then
22166 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
22168 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
22171 echo "No socket ioctls found in <sys/sockio.h>." >&4
22176 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
22182 : see if this is a syslog.h system
22183 set syslog.h i_syslog
22186 : see if this is a sys/mode.h system
22187 set sys/mode.h i_sysmode
22190 : see if there is a sys/poll.h file
22191 set sys/poll.h i_syspoll
22194 : see if sys/resource.h has to be included
22195 set sys/resource.h i_sysresrc
22198 : see if sys/security.h is available
22199 set sys/security.h i_syssecrt
22202 : see if this is a sys/statvfs.h system
22203 set sys/statvfs.h i_sysstatvfs
22206 : see if this is a sys/un.h system
22207 set sys/un.h i_sysun
22210 : see if this is a sys/utsname.h system
22211 set sys/utsname.h i_sysutsname
22214 : see if this is a syswait system
22215 set sys/wait.h i_syswait
22218 : see if this is a ustat.h system
22219 set ustat.h i_ustat
22222 : see if this is an utime system
22223 set utime.h i_utime
22226 : see if this is a vfork system
22229 set vfork.h i_vfork
22239 echo "Looking for extensions..." >&4
22240 : If we are using the old config.sh, known_extensions may contain
22241 : old or inaccurate or duplicate values.
22242 known_extensions=''
22243 nonxs_extensions=''
22244 : We do not use find because it might not be available.
22245 : We do not just use MANIFEST because the user may have dropped
22246 : some additional extensions into the source tree and expect them
22249 : Function to recursively find available extensions, ignoring DynaLoader
22250 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
22251 : In 5.10.1 and later, extensions are stored in directories
22252 : like File-Glob instead of the older File/Glob/.
22256 DynaLoader|dynaload) ;;
22258 this_ext=`echo $xxx | $sed -e s/-/\\\//g`;
22259 leaf=`echo $xxx | $sed -e s/.*-//`;
22260 if $test -d File; then
22261 if $test -f $xxx/$leaf.xs -o -f $xxx/$leaf.c; then
22262 known_extensions="$known_extensions $1$this_ext";
22263 elif $test -f $xxx/Makefile.PL; then
22264 nonxs_extensions="$nonxs_extensions $1$this_ext";
22266 if $test -d $xxx -a $# -lt 10; then
22269 eval $find_extensions;
22275 echo " $known_extensions $nonxs_extensions" > $$.tmp;
22276 if $contains " $this_ext " $$.tmp; then
22278 echo "Duplicate directories detected for extension $xxx" >&4;
22279 echo "Configure cannot correctly recover from this - shall I abort?" >&4;
22280 case "$knowitall" in
22288 echo "Ok. Stopping Configure." >&4;
22289 echo "Please remove the duplicate directory (eg using git clean) and then re-run Configure" >&4;
22292 echo "Ok. You will need to correct config.sh before running make." >&4;
22294 $ls -1 $xxx > $$.tmp;
22295 if $contains "\.xs$" $$.tmp > /dev/null 2>&1; then
22296 known_extensions="$known_extensions $this_ext";
22297 elif $contains "\.c$" $$.tmp > /dev/null 2>&1; then
22298 known_extensions="$known_extensions $this_ext";
22299 elif $test -d $xxx; then
22300 nonxs_extensions="$nonxs_extensions $this_ext";
22311 eval $find_extensions
22315 eval $find_extensions
22319 eval $find_extensions
22320 if $test -d File-Glob; then
22321 : All ext/ flattened
22323 # Special case: Add in modules that nest beyond the first level.
22324 # Currently threads/shared and Hash/Util/FieldHash, since they are
22325 # not picked up by the recursive find above (and adding in general
22326 # recursive finding breaks SDBM_File/sdbm).
22327 # A.D. 20011025 (SDBM), ajgough 20071008 (FieldHash)
22328 known_extensions="$known_extensions threads/shared Hash/Util/FieldHash"
22330 set X $known_extensions
22332 known_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
22333 set X $nonxs_extensions
22335 nonxs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
22338 : Now see which are supported on this system.
22340 for xxx in $known_extensions ; do
22344 $define) avail_ext="$avail_ext $xxx" ;;
22347 GDBM_File|gdbm_fil)
22349 $define) avail_ext="$avail_ext $xxx" ;;
22352 I18N/Langinfo|i18n_lan)
22353 case "$i_langinfo$d_nl_langinfo" in
22354 $define$define) avail_ext="$avail_ext $xxx" ;;
22358 : XXX Do we need a useipcsysv variable here
22359 case "${d_msg}${d_sem}${d_shm}" in
22360 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
22363 NDBM_File|ndbm_fil)
22366 case "$osname-$use64bitint" in
22369 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
22372 *) avail_ext="$avail_ext $xxx" ;;
22377 ODBM_File|odbm_fil)
22378 case "${i_dbm}${i_rpcsvcdbm}" in
22380 case "$d_cplusplus" in
22381 define) ;; # delete as a function name will not work
22382 *) case "$osname-$use64bitint" in
22385 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
22388 *) avail_ext="$avail_ext $xxx" ;;
22396 case "$useopcode" in
22397 true|define|y) avail_ext="$avail_ext $xxx" ;;
22401 case "$useposix" in
22402 true|define|y) avail_ext="$avail_ext $xxx" ;;
22406 case "$d_socket" in
22409 beos) ;; # not unless BONE
22410 *) avail_ext="$avail_ext $xxx" ;;
22415 Sys/Syslog|sys/syslog)
22416 : XXX syslog requires socket
22417 case "$d_socket" in
22418 true|$define|y) avail_ext="$avail_ext $xxx" ;;
22422 case "$usethreads" in
22424 case "$use5005threads" in
22425 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
22429 threads|threads/shared)
22430 # threads and threads::shared are special cases.
22431 # To stop people from asking "Perl 5.8.0 was supposed
22432 # to have this new fancy threads implementation but my
22433 # perl doesn't have it" and from people trying to
22434 # (re)install the threads module using CPAN.pm and
22435 # CPAN.pm then offering to reinstall Perl 5.8.0,
22436 # the threads.pm and threads/shared.pm will always be
22437 # there, croaking informatively ("you need to rebuild
22438 # all of Perl with threads, sorry") when threads haven't
22439 # been compiled in.
22441 avail_ext="$avail_ext $xxx"
22447 cygwin) avail_ext="$avail_ext $xxx" ;;
22450 XS/APItest|xs/apitest)
22451 # This is just for testing. Skip it unless we have dynamic loading.
22454 $define) avail_ext="$avail_ext $xxx" ;;
22457 XS/Typemap|xs/typemap)
22458 # This is just for testing. Skip it unless we have dynamic loading.
22460 $define) avail_ext="$avail_ext $xxx" ;;
22463 *) avail_ext="$avail_ext $xxx"
22472 case "$onlyextensions" in
22474 *) keepextensions=''
22475 echo "You have requested that only certain extensions be included..." >&4
22476 for i in $onlyextensions; do
22477 case " $avail_ext " in
22479 echo "Keeping extension $i."
22480 keepextensions="$keepextensions $i"
22482 *) echo "Ignoring extension $i." ;;
22485 avail_ext="$keepextensions"
22489 case "$noextensions" in
22491 *) keepextensions=''
22492 echo "You have requested that certain extensions be ignored..." >&4
22493 for i in $avail_ext; do
22494 case " $noextensions " in
22495 *" $i "*) echo "Ignoring extension $i." ;;
22496 *) echo "Keeping extension $i.";
22497 keepextensions="$keepextensions $i"
22501 avail_ext="$keepextensions"
22505 : Now see which nonxs extensions are supported on this system.
22506 : For now assume all are.
22508 for xxx in $nonxs_extensions ; do
22510 *) nonxs_ext="$nonxs_ext $xxx"
22522 A number of extensions are supplied with $package. You may choose to
22523 compile these extensions for dynamic loading (the default), compile
22524 them into the $package executable (static loading), or not include
22525 them at all. Answer "none" to include no extensions.
22526 Note that DynaLoader is always built and need not be mentioned here.
22529 case "$dynamic_ext" in
22531 : Exclude those listed in static_ext
22533 for xxx in $avail_ext; do
22534 case " $static_ext " in
22536 *) dflt="$dflt $xxx" ;;
22543 *) dflt="$dynamic_ext"
22544 # Perhaps we are reusing an old out-of-date config.sh.
22547 if test X"$dynamic_ext" != X"$avail_ext"; then
22549 NOTICE: Your previous config.sh list may be incorrect.
22550 The extensions now available to you are
22552 but the default list from your previous config.sh is
22564 rp="What extensions do you wish to load dynamically?"
22567 none) dynamic_ext=' ' ;;
22568 *) dynamic_ext="$ans" ;;
22571 case "$static_ext" in
22573 : Exclude those already listed in dynamic linking
22575 for xxx in $avail_ext; do
22576 case " $dynamic_ext " in
22578 *) dflt="$dflt $xxx" ;;
22585 *) dflt="$static_ext"
22592 rp="What extensions do you wish to load statically?"
22595 none) static_ext=' ' ;;
22596 *) static_ext="$ans" ;;
22601 A number of extensions are supplied with $package. Answer "none"
22602 to include no extensions.
22603 Note that DynaLoader is always built and need not be mentioned here.
22606 case "$static_ext" in
22607 '') dflt="$avail_ext" ;;
22608 *) dflt="$static_ext"
22609 # Perhaps we are reusing an old out-of-date config.sh.
22612 if test X"$static_ext" != X"$avail_ext"; then
22614 NOTICE: Your previous config.sh list may be incorrect.
22615 The extensions now available to you are
22617 but the default list from your previous config.sh is
22626 : Exclude those that are not xs extensions
22630 rp="What extensions do you wish to include?"
22633 none) static_ext=' ' ;;
22634 *) static_ext="$ans" ;;
22639 # Encode is a special case. If we are building Encode as a static
22640 # extension, we need to explicitly list its subextensions as well.
22641 # For other nested extensions, this is handled automatically by
22642 # the appropriate Makefile.PL.
22643 case " $static_ext " in
22644 *" Encode "*) # Add the subextensions of Encode
22646 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
22647 static_ext="$static_ext Encode/$xxx"
22653 set X $dynamic_ext $static_ext $nonxs_ext
22657 # Sanity check: We require an extension suitable for use with
22658 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
22659 # should show up as failures in the test suite, but it's helpful to
22660 # catch them now.) The 'extensions' list is normally sorted
22661 # alphabetically, so we need to accept either
22662 # DB_File ... Fcntl ... IO ....
22663 # or something like
22664 # Fcntl ... NDBM_File ... IO ....
22665 case " $extensions" in
22666 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
22667 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
22668 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
22669 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
22670 echo "WARNING: The Perl you are building will be quite crippled." >& 4
22674 : Remove libraries needed only for extensions
22675 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
22676 : The exception is SunOS 4.x, which needs them.
22677 case "${osname}X${osvers}" in
22681 *) case "$usedl" in
22682 $define|true|[yY]*)
22683 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
22687 *) perllibs="$libs"
22693 : Remove build directory name from cppstdin so it can be used from
22694 : either the present location or the final installed location.
22696 : Get out of the UU directory to get correct path name.
22698 case "$cppstdin" in
22700 echo "Stripping down cppstdin path name"
22706 : end of configuration questions
22708 echo "End of configuration questions."
22711 : back to where it started
22712 if test -d ../UU; then
22716 : configuration may be unconditionally patched via a 'config.arch' file
22717 if $test -f config.arch; then
22718 echo "I see a config.arch file, loading it." >&4
22722 : configuration may be patched via a 'config.over' file
22723 if $test -f config.over; then
22726 rp='I see a config.over file. Do you wish to load it?'
22729 n*) echo "OK, I'll ignore it.";;
22731 echo "Configuration override changes have been loaded."
22736 : in case they want portability, strip down executable paths
22737 case "$d_portable" in
22740 echo "Stripping down executable paths..." >&4
22741 for file in $loclist $trylist; do
22743 eval $file=`basename $temp`
22748 : create config.sh file
22750 echo "Creating config.sh..." >&4
22751 $spitshell <<EOT >config.sh
22754 # This file was produced by running the Configure script. It holds all the
22755 # definitions figured out by Configure. Should you modify one of these values,
22756 # do not forget to propagate your changes by running "Configure -der". You may
22757 # instead choose to run each of the .SH files by yourself, or "Configure -S".
22760 # Package name : $package
22761 # Source directory : $src
22762 # Configuration time: $cf_time
22763 # Configured by : $cf_by
22764 # Target system : $myuname
22767 : Add in command line options if available
22768 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
22770 $spitshell <<EOT >>config.sh
22779 Revision='$Revision'
22787 alignbytes='$alignbytes'
22788 ansi2knr='$ansi2knr'
22789 aphostname='$aphostname'
22790 api_revision='$api_revision'
22791 api_subversion='$api_subversion'
22792 api_version='$api_version'
22793 api_versionstring='$api_versionstring'
22796 archlibexp='$archlibexp'
22797 archname64='$archname64'
22798 archname='$archname'
22799 archobjs='$archobjs'
22800 asctime_r_proto='$asctime_r_proto'
22809 byteorder='$byteorder'
22811 castflags='$castflags'
22814 cccdlflags='$cccdlflags'
22815 ccdlflags='$ccdlflags'
22817 ccflags_uselargefiles='$ccflags_uselargefiles'
22819 ccsymbols='$ccsymbols'
22820 ccversion='$ccversion'
22822 cf_email='$cf_email'
22824 charbits='$charbits'
22825 charsize='$charsize'
22829 clocktype='$clocktype'
22831 compress='$compress'
22832 contains='$contains'
22836 cpp_stuff='$cpp_stuff'
22837 cppccsymbols='$cppccsymbols'
22838 cppflags='$cppflags'
22840 cppminus='$cppminus'
22842 cppstdin='$cppstdin'
22843 cppsymbols='$cppsymbols'
22844 crypt_r_proto='$crypt_r_proto'
22845 cryptlib='$cryptlib'
22847 ctermid_r_proto='$ctermid_r_proto'
22848 ctime_r_proto='$ctime_r_proto'
22849 d_Gconvert='$d_Gconvert'
22850 d_PRIEUldbl='$d_PRIEUldbl'
22851 d_PRIFUldbl='$d_PRIFUldbl'
22852 d_PRIGUldbl='$d_PRIGUldbl'
22853 d_PRIXU64='$d_PRIXU64'
22854 d_PRId64='$d_PRId64'
22855 d_PRIeldbl='$d_PRIeldbl'
22856 d_PRIfldbl='$d_PRIfldbl'
22857 d_PRIgldbl='$d_PRIgldbl'
22858 d_PRIi64='$d_PRIi64'
22859 d_PRIo64='$d_PRIo64'
22860 d_PRIu64='$d_PRIu64'
22861 d_PRIx64='$d_PRIx64'
22862 d_SCNfldbl='$d_SCNfldbl'
22863 d__fwalk='$d__fwalk'
22864 d_access='$d_access'
22865 d_accessx='$d_accessx'
22868 d_archlib='$d_archlib'
22869 d_asctime64='$d_asctime64'
22870 d_asctime_r='$d_asctime_r'
22873 d_attribute_deprecated='$d_attribute_deprecated'
22874 d_attribute_format='$d_attribute_format'
22875 d_attribute_malloc='$d_attribute_malloc'
22876 d_attribute_nonnull='$d_attribute_nonnull'
22877 d_attribute_noreturn='$d_attribute_noreturn'
22878 d_attribute_pure='$d_attribute_pure'
22879 d_attribute_unused='$d_attribute_unused'
22880 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
22884 d_bsdgetpgrp='$d_bsdgetpgrp'
22885 d_bsdsetpgrp='$d_bsdsetpgrp'
22886 d_builtin_choose_expr='$d_builtin_choose_expr'
22887 d_builtin_expect='$d_builtin_expect'
22889 d_c99_variadic_macros='$d_c99_variadic_macros'
22890 d_casti32='$d_casti32'
22891 d_castneg='$d_castneg'
22892 d_charvspr='$d_charvspr'
22894 d_chroot='$d_chroot'
22895 d_chsize='$d_chsize'
22897 d_clearenv='$d_clearenv'
22898 d_closedir='$d_closedir'
22899 d_cmsghdr_s='$d_cmsghdr_s'
22901 d_copysignl='$d_copysignl'
22902 d_cplusplus='$d_cplusplus'
22904 d_crypt_r='$d_crypt_r'
22906 d_ctermid='$d_ctermid'
22907 d_ctermid_r='$d_ctermid_r'
22908 d_ctime64='$d_ctime64'
22909 d_ctime_r='$d_ctime_r'
22910 d_cuserid='$d_cuserid'
22911 d_dbl_dig='$d_dbl_dig'
22912 d_dbminitproto='$d_dbminitproto'
22913 d_difftime64='$d_difftime64'
22914 d_difftime='$d_difftime'
22915 d_dir_dd_fd='$d_dir_dd_fd'
22917 d_dirnamlen='$d_dirnamlen'
22918 d_dlerror='$d_dlerror'
22919 d_dlopen='$d_dlopen'
22920 d_dlsymun='$d_dlsymun'
22921 d_dosuid='$d_dosuid'
22922 d_drand48_r='$d_drand48_r'
22923 d_drand48proto='$d_drand48proto'
22925 d_eaccess='$d_eaccess'
22926 d_endgrent='$d_endgrent'
22927 d_endgrent_r='$d_endgrent_r'
22928 d_endhent='$d_endhent'
22929 d_endhostent_r='$d_endhostent_r'
22930 d_endnent='$d_endnent'
22931 d_endnetent_r='$d_endnetent_r'
22932 d_endpent='$d_endpent'
22933 d_endprotoent_r='$d_endprotoent_r'
22934 d_endpwent='$d_endpwent'
22935 d_endpwent_r='$d_endpwent_r'
22936 d_endsent='$d_endsent'
22937 d_endservent_r='$d_endservent_r'
22938 d_eofnblk='$d_eofnblk'
22939 d_eunice='$d_eunice'
22940 d_faststdio='$d_faststdio'
22941 d_fchdir='$d_fchdir'
22942 d_fchmod='$d_fchmod'
22943 d_fchown='$d_fchown'
22945 d_fcntl_can_lock='$d_fcntl_can_lock'
22946 d_fd_macros='$d_fd_macros'
22947 d_fd_set='$d_fd_set'
22948 d_fds_bits='$d_fds_bits'
22949 d_fgetpos='$d_fgetpos'
22950 d_finite='$d_finite'
22951 d_finitel='$d_finitel'
22952 d_flexfnam='$d_flexfnam'
22954 d_flockproto='$d_flockproto'
22956 d_fp_class='$d_fp_class'
22957 d_fpathconf='$d_fpathconf'
22958 d_fpclass='$d_fpclass'
22959 d_fpclassify='$d_fpclassify'
22960 d_fpclassl='$d_fpclassl'
22961 d_fpos64_t='$d_fpos64_t'
22962 d_frexpl='$d_frexpl'
22963 d_fs_data_s='$d_fs_data_s'
22964 d_fseeko='$d_fseeko'
22965 d_fsetpos='$d_fsetpos'
22966 d_fstatfs='$d_fstatfs'
22967 d_fstatvfs='$d_fstatvfs'
22969 d_ftello='$d_ftello'
22971 d_futimes='$d_futimes'
22972 d_gdbm_ndbm_h_uses_prototypes='$d_gdbm_ndbm_h_uses_prototypes'
22973 d_gdbmndbm_h_uses_prototypes='$d_gdbmndbm_h_uses_prototypes'
22974 d_getaddrinfo='$d_getaddrinfo'
22975 d_getcwd='$d_getcwd'
22976 d_getespwnam='$d_getespwnam'
22977 d_getfsstat='$d_getfsstat'
22978 d_getgrent='$d_getgrent'
22979 d_getgrent_r='$d_getgrent_r'
22980 d_getgrgid_r='$d_getgrgid_r'
22981 d_getgrnam_r='$d_getgrnam_r'
22982 d_getgrps='$d_getgrps'
22983 d_gethbyaddr='$d_gethbyaddr'
22984 d_gethbyname='$d_gethbyname'
22985 d_gethent='$d_gethent'
22986 d_gethname='$d_gethname'
22987 d_gethostbyaddr_r='$d_gethostbyaddr_r'
22988 d_gethostbyname_r='$d_gethostbyname_r'
22989 d_gethostent_r='$d_gethostent_r'
22990 d_gethostprotos='$d_gethostprotos'
22991 d_getitimer='$d_getitimer'
22992 d_getlogin='$d_getlogin'
22993 d_getlogin_r='$d_getlogin_r'
22994 d_getmnt='$d_getmnt'
22995 d_getmntent='$d_getmntent'
22996 d_getnameinfo='$d_getnameinfo'
22997 d_getnbyaddr='$d_getnbyaddr'
22998 d_getnbyname='$d_getnbyname'
22999 d_getnent='$d_getnent'
23000 d_getnetbyaddr_r='$d_getnetbyaddr_r'
23001 d_getnetbyname_r='$d_getnetbyname_r'
23002 d_getnetent_r='$d_getnetent_r'
23003 d_getnetprotos='$d_getnetprotos'
23004 d_getpagsz='$d_getpagsz'
23005 d_getpbyname='$d_getpbyname'
23006 d_getpbynumber='$d_getpbynumber'
23007 d_getpent='$d_getpent'
23008 d_getpgid='$d_getpgid'
23009 d_getpgrp2='$d_getpgrp2'
23010 d_getpgrp='$d_getpgrp'
23011 d_getppid='$d_getppid'
23012 d_getprior='$d_getprior'
23013 d_getprotobyname_r='$d_getprotobyname_r'
23014 d_getprotobynumber_r='$d_getprotobynumber_r'
23015 d_getprotoent_r='$d_getprotoent_r'
23016 d_getprotoprotos='$d_getprotoprotos'
23017 d_getprpwnam='$d_getprpwnam'
23018 d_getpwent='$d_getpwent'
23019 d_getpwent_r='$d_getpwent_r'
23020 d_getpwnam_r='$d_getpwnam_r'
23021 d_getpwuid_r='$d_getpwuid_r'
23022 d_getsbyname='$d_getsbyname'
23023 d_getsbyport='$d_getsbyport'
23024 d_getsent='$d_getsent'
23025 d_getservbyname_r='$d_getservbyname_r'
23026 d_getservbyport_r='$d_getservbyport_r'
23027 d_getservent_r='$d_getservent_r'
23028 d_getservprotos='$d_getservprotos'
23029 d_getspnam='$d_getspnam'
23030 d_getspnam_r='$d_getspnam_r'
23031 d_gettimeod='$d_gettimeod'
23032 d_gmtime64='$d_gmtime64'
23033 d_gmtime_r='$d_gmtime_r'
23034 d_gnulibc='$d_gnulibc'
23035 d_grpasswd='$d_grpasswd'
23036 d_hasmntopt='$d_hasmntopt'
23038 d_ilogbl='$d_ilogbl'
23039 d_inc_version_list='$d_inc_version_list'
23041 d_inetaton='$d_inetaton'
23042 d_inetntop='$d_inetntop'
23043 d_inetpton='$d_inetpton'
23044 d_int64_t='$d_int64_t'
23045 d_ip_mreq='$d_ip_mreq'
23046 d_ipv6_mreq='$d_ipv6_mreq'
23047 d_isascii='$d_isascii'
23048 d_isblank='$d_isblank'
23049 d_isfinite='$d_isfinite'
23052 d_isnanl='$d_isnanl'
23053 d_killpg='$d_killpg'
23054 d_lchown='$d_lchown'
23055 d_ldbl_dig='$d_ldbl_dig'
23056 d_libm_lib_version='$d_libm_lib_version'
23058 d_localtime64='$d_localtime64'
23059 d_localtime_r='$d_localtime_r'
23060 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
23061 d_locconv='$d_locconv'
23063 d_longdbl='$d_longdbl'
23064 d_longlong='$d_longlong'
23065 d_lseekproto='$d_lseekproto'
23067 d_madvise='$d_madvise'
23068 d_malloc_good_size='$d_malloc_good_size'
23069 d_malloc_size='$d_malloc_size'
23071 d_mbstowcs='$d_mbstowcs'
23072 d_mbtowc='$d_mbtowc'
23073 d_memchr='$d_memchr'
23074 d_memcmp='$d_memcmp'
23075 d_memcpy='$d_memcpy'
23076 d_memmove='$d_memmove'
23077 d_memset='$d_memset'
23079 d_mkdtemp='$d_mkdtemp'
23080 d_mkfifo='$d_mkfifo'
23081 d_mkstemp='$d_mkstemp'
23082 d_mkstemps='$d_mkstemps'
23083 d_mktime64='$d_mktime64'
23084 d_mktime='$d_mktime'
23087 d_modfl_pow32_bug='$d_modfl_pow32_bug'
23088 d_modflproto='$d_modflproto'
23089 d_mprotect='$d_mprotect'
23091 d_msg_ctrunc='$d_msg_ctrunc'
23092 d_msg_dontroute='$d_msg_dontroute'
23093 d_msg_oob='$d_msg_oob'
23094 d_msg_peek='$d_msg_peek'
23095 d_msg_proxy='$d_msg_proxy'
23096 d_msgctl='$d_msgctl'
23097 d_msgget='$d_msgget'
23098 d_msghdr_s='$d_msghdr_s'
23099 d_msgrcv='$d_msgrcv'
23100 d_msgsnd='$d_msgsnd'
23102 d_munmap='$d_munmap'
23103 d_mymalloc='$d_mymalloc'
23105 d_ndbm_h_uses_prototypes='$d_ndbm_h_uses_prototypes'
23107 d_nl_langinfo='$d_nl_langinfo'
23108 d_nv_preserves_uv='$d_nv_preserves_uv'
23109 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
23110 d_off64_t='$d_off64_t'
23111 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
23112 d_oldpthreads='$d_oldpthreads'
23113 d_oldsock='$d_oldsock'
23115 d_pathconf='$d_pathconf'
23117 d_perl_otherlibdirs='$d_perl_otherlibdirs'
23118 d_phostname='$d_phostname'
23121 d_portable='$d_portable'
23123 d_prctl_set_name='$d_prctl_set_name'
23124 d_printf_format_null='$d_printf_format_null'
23125 d_procselfexe='$d_procselfexe'
23126 d_pseudofork='$d_pseudofork'
23127 d_pthread_atfork='$d_pthread_atfork'
23128 d_pthread_attr_setscope='$d_pthread_attr_setscope'
23129 d_pthread_yield='$d_pthread_yield'
23131 d_pwchange='$d_pwchange'
23132 d_pwclass='$d_pwclass'
23133 d_pwcomment='$d_pwcomment'
23134 d_pwexpire='$d_pwexpire'
23135 d_pwgecos='$d_pwgecos'
23136 d_pwpasswd='$d_pwpasswd'
23137 d_pwquota='$d_pwquota'
23140 d_random_r='$d_random_r'
23141 d_readdir64_r='$d_readdir64_r'
23142 d_readdir='$d_readdir'
23143 d_readdir_r='$d_readdir_r'
23144 d_readlink='$d_readlink'
23146 d_recvmsg='$d_recvmsg'
23147 d_rename='$d_rename'
23148 d_rewinddir='$d_rewinddir'
23150 d_safebcpy='$d_safebcpy'
23151 d_safemcpy='$d_safemcpy'
23152 d_sanemcmp='$d_sanemcmp'
23153 d_sbrkproto='$d_sbrkproto'
23154 d_scalbnl='$d_scalbnl'
23155 d_sched_yield='$d_sched_yield'
23156 d_scm_rights='$d_scm_rights'
23157 d_seekdir='$d_seekdir'
23158 d_select='$d_select'
23160 d_semctl='$d_semctl'
23161 d_semctl_semid_ds='$d_semctl_semid_ds'
23162 d_semctl_semun='$d_semctl_semun'
23163 d_semget='$d_semget'
23165 d_sendmsg='$d_sendmsg'
23166 d_setegid='$d_setegid'
23167 d_seteuid='$d_seteuid'
23168 d_setgrent='$d_setgrent'
23169 d_setgrent_r='$d_setgrent_r'
23170 d_setgrps='$d_setgrps'
23171 d_sethent='$d_sethent'
23172 d_sethostent_r='$d_sethostent_r'
23173 d_setitimer='$d_setitimer'
23174 d_setlinebuf='$d_setlinebuf'
23175 d_setlocale='$d_setlocale'
23176 d_setlocale_r='$d_setlocale_r'
23177 d_setnent='$d_setnent'
23178 d_setnetent_r='$d_setnetent_r'
23179 d_setpent='$d_setpent'
23180 d_setpgid='$d_setpgid'
23181 d_setpgrp2='$d_setpgrp2'
23182 d_setpgrp='$d_setpgrp'
23183 d_setprior='$d_setprior'
23184 d_setproctitle='$d_setproctitle'
23185 d_setprotoent_r='$d_setprotoent_r'
23186 d_setpwent='$d_setpwent'
23187 d_setpwent_r='$d_setpwent_r'
23188 d_setregid='$d_setregid'
23189 d_setresgid='$d_setresgid'
23190 d_setresuid='$d_setresuid'
23191 d_setreuid='$d_setreuid'
23192 d_setrgid='$d_setrgid'
23193 d_setruid='$d_setruid'
23194 d_setsent='$d_setsent'
23195 d_setservent_r='$d_setservent_r'
23196 d_setsid='$d_setsid'
23197 d_setvbuf='$d_setvbuf'
23201 d_shmatprototype='$d_shmatprototype'
23202 d_shmctl='$d_shmctl'
23204 d_shmget='$d_shmget'
23205 d_sigaction='$d_sigaction'
23206 d_signbit='$d_signbit'
23207 d_sigprocmask='$d_sigprocmask'
23208 d_sigsetjmp='$d_sigsetjmp'
23209 d_sin6_scope_id='$d_sin6_scope_id'
23210 d_sitearch='$d_sitearch'
23211 d_snprintf='$d_snprintf'
23212 d_sockaddr_in6='$d_sockaddr_in6'
23213 d_sockaddr_sa_len='$d_sockaddr_sa_len'
23214 d_sockatmark='$d_sockatmark'
23215 d_sockatmarkproto='$d_sockatmarkproto'
23216 d_socket='$d_socket'
23217 d_socklen_t='$d_socklen_t'
23218 d_sockpair='$d_sockpair'
23219 d_socks5_init='$d_socks5_init'
23220 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
23222 d_srand48_r='$d_srand48_r'
23223 d_srandom_r='$d_srandom_r'
23224 d_sresgproto='$d_sresgproto'
23225 d_sresuproto='$d_sresuproto'
23226 d_statblks='$d_statblks'
23227 d_statfs_f_flags='$d_statfs_f_flags'
23228 d_statfs_s='$d_statfs_s'
23229 d_static_inline='$d_static_inline'
23230 d_statvfs='$d_statvfs'
23231 d_stdio_cnt_lval='$d_stdio_cnt_lval'
23232 d_stdio_ptr_lval='$d_stdio_ptr_lval'
23233 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
23234 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
23235 d_stdio_stream_array='$d_stdio_stream_array'
23236 d_stdiobase='$d_stdiobase'
23237 d_stdstdio='$d_stdstdio'
23238 d_strchr='$d_strchr'
23239 d_strcoll='$d_strcoll'
23240 d_strctcpy='$d_strctcpy'
23241 d_strerrm='$d_strerrm'
23242 d_strerror='$d_strerror'
23243 d_strerror_r='$d_strerror_r'
23244 d_strftime='$d_strftime'
23245 d_strlcat='$d_strlcat'
23246 d_strlcpy='$d_strlcpy'
23247 d_strtod='$d_strtod'
23248 d_strtol='$d_strtol'
23249 d_strtold='$d_strtold'
23250 d_strtoll='$d_strtoll'
23251 d_strtoq='$d_strtoq'
23252 d_strtoul='$d_strtoul'
23253 d_strtoull='$d_strtoull'
23254 d_strtouq='$d_strtouq'
23255 d_strxfrm='$d_strxfrm'
23256 d_suidsafe='$d_suidsafe'
23257 d_symlink='$d_symlink'
23258 d_syscall='$d_syscall'
23259 d_syscallproto='$d_syscallproto'
23260 d_sysconf='$d_sysconf'
23261 d_sysernlst='$d_sysernlst'
23262 d_syserrlst='$d_syserrlst'
23263 d_system='$d_system'
23264 d_tcgetpgrp='$d_tcgetpgrp'
23265 d_tcsetpgrp='$d_tcsetpgrp'
23266 d_telldir='$d_telldir'
23267 d_telldirproto='$d_telldirproto'
23269 d_timegm='$d_timegm'
23271 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
23272 d_tm_tm_zone='$d_tm_tm_zone'
23273 d_tmpnam_r='$d_tmpnam_r'
23274 d_truncate='$d_truncate'
23275 d_ttyname_r='$d_ttyname_r'
23276 d_tzname='$d_tzname'
23277 d_u32align='$d_u32align'
23278 d_ualarm='$d_ualarm'
23281 d_union_semun='$d_union_semun'
23282 d_unordered='$d_unordered'
23283 d_unsetenv='$d_unsetenv'
23284 d_usleep='$d_usleep'
23285 d_usleepproto='$d_usleepproto'
23287 d_vendorarch='$d_vendorarch'
23288 d_vendorbin='$d_vendorbin'
23289 d_vendorlib='$d_vendorlib'
23290 d_vendorscript='$d_vendorscript'
23292 d_void_closedir='$d_void_closedir'
23293 d_voidsig='$d_voidsig'
23294 d_voidtty='$d_voidtty'
23295 d_volatile='$d_volatile'
23296 d_vprintf='$d_vprintf'
23297 d_vsnprintf='$d_vsnprintf'
23299 d_waitpid='$d_waitpid'
23300 d_wcstombs='$d_wcstombs'
23301 d_wctomb='$d_wctomb'
23302 d_writev='$d_writev'
23305 db_hashtype='$db_hashtype'
23306 db_prefixtype='$db_prefixtype'
23307 db_version_major='$db_version_major'
23308 db_version_minor='$db_version_minor'
23309 db_version_patch='$db_version_patch'
23310 defvoidused='$defvoidused'
23311 direntrytype='$direntrytype'
23314 doublesize='$doublesize'
23316 drand48_r_proto='$drand48_r_proto'
23318 dynamic_ext='$dynamic_ext'
23324 endgrent_r_proto='$endgrent_r_proto'
23325 endhostent_r_proto='$endhostent_r_proto'
23326 endnetent_r_proto='$endnetent_r_proto'
23327 endprotoent_r_proto='$endprotoent_r_proto'
23328 endpwent_r_proto='$endpwent_r_proto'
23329 endservent_r_proto='$endservent_r_proto'
23330 eunicefix='$eunicefix'
23333 extensions='$extensions'
23334 extern_C='$extern_C'
23336 fflushNULL='$fflushNULL'
23337 fflushall='$fflushall'
23339 firstmakefile='$firstmakefile'
23341 fpossize='$fpossize'
23342 fpostype='$fpostype'
23343 freetype='$freetype'
23346 full_csh='$full_csh'
23347 full_sed='$full_sed'
23348 gccansipedantic='$gccansipedantic'
23349 gccosandvers='$gccosandvers'
23350 gccversion='$gccversion'
23351 getgrent_r_proto='$getgrent_r_proto'
23352 getgrgid_r_proto='$getgrgid_r_proto'
23353 getgrnam_r_proto='$getgrnam_r_proto'
23354 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
23355 gethostbyname_r_proto='$gethostbyname_r_proto'
23356 gethostent_r_proto='$gethostent_r_proto'
23357 getlogin_r_proto='$getlogin_r_proto'
23358 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
23359 getnetbyname_r_proto='$getnetbyname_r_proto'
23360 getnetent_r_proto='$getnetent_r_proto'
23361 getprotobyname_r_proto='$getprotobyname_r_proto'
23362 getprotobynumber_r_proto='$getprotobynumber_r_proto'
23363 getprotoent_r_proto='$getprotoent_r_proto'
23364 getpwent_r_proto='$getpwent_r_proto'
23365 getpwnam_r_proto='$getpwnam_r_proto'
23366 getpwuid_r_proto='$getpwuid_r_proto'
23367 getservbyname_r_proto='$getservbyname_r_proto'
23368 getservbyport_r_proto='$getservbyport_r_proto'
23369 getservent_r_proto='$getservent_r_proto'
23370 getspnam_r_proto='$getspnam_r_proto'
23371 gidformat='$gidformat'
23377 gmtime_r_proto='$gmtime_r_proto'
23378 gnulibc_version='$gnulibc_version'
23380 groupcat='$groupcat'
23381 groupstype='$groupstype'
23384 h_sysfile='$h_sysfile'
23387 html1dir='$html1dir'
23388 html1direxp='$html1direxp'
23389 html3dir='$html3dir'
23390 html3direxp='$html3direxp'
23399 i_arpainet='$i_arpainet'
23400 i_assert='$i_assert'
23401 i_bsdioctl='$i_bsdioctl'
23405 i_dirent='$i_dirent'
23411 i_fp_class='$i_fp_class'
23413 i_gdbm_ndbm='$i_gdbm_ndbm'
23414 i_gdbmndbm='$i_gdbmndbm'
23416 i_ieeefp='$i_ieeefp'
23417 i_inttypes='$i_inttypes'
23418 i_langinfo='$i_langinfo'
23419 i_libutil='$i_libutil'
23420 i_limits='$i_limits'
23421 i_locale='$i_locale'
23422 i_machcthr='$i_machcthr'
23423 i_malloc='$i_malloc'
23424 i_mallocmalloc='$i_mallocmalloc'
23426 i_memory='$i_memory'
23427 i_mntent='$i_mntent'
23430 i_neterrno='$i_neterrno'
23431 i_netinettcp='$i_netinettcp'
23435 i_pthread='$i_pthread'
23437 i_rpcsvcdbm='$i_rpcsvcdbm'
23440 i_shadow='$i_shadow'
23442 i_stdarg='$i_stdarg'
23443 i_stdbool='$i_stdbool'
23444 i_stddef='$i_stddef'
23445 i_stdlib='$i_stdlib'
23446 i_string='$i_string'
23447 i_sunmath='$i_sunmath'
23448 i_sysaccess='$i_sysaccess'
23449 i_sysdir='$i_sysdir'
23450 i_sysfile='$i_sysfile'
23451 i_sysfilio='$i_sysfilio'
23453 i_sysioctl='$i_sysioctl'
23454 i_syslog='$i_syslog'
23455 i_sysmman='$i_sysmman'
23456 i_sysmode='$i_sysmode'
23457 i_sysmount='$i_sysmount'
23458 i_sysndir='$i_sysndir'
23459 i_sysparam='$i_sysparam'
23460 i_syspoll='$i_syspoll'
23461 i_sysresrc='$i_sysresrc'
23462 i_syssecrt='$i_syssecrt'
23463 i_sysselct='$i_sysselct'
23464 i_syssockio='$i_syssockio'
23465 i_sysstat='$i_sysstat'
23466 i_sysstatfs='$i_sysstatfs'
23467 i_sysstatvfs='$i_sysstatvfs'
23468 i_systime='$i_systime'
23469 i_systimek='$i_systimek'
23470 i_systimes='$i_systimes'
23471 i_systypes='$i_systypes'
23472 i_sysuio='$i_sysuio'
23474 i_sysutsname='$i_sysutsname'
23475 i_sysvfs='$i_sysvfs'
23476 i_syswait='$i_syswait'
23477 i_termio='$i_termio'
23478 i_termios='$i_termios'
23480 i_unistd='$i_unistd'
23483 i_values='$i_values'
23484 i_varargs='$i_varargs'
23485 i_varhdr='$i_varhdr'
23487 ignore_versioned_solibs='$ignore_versioned_solibs'
23488 inc_version_list='$inc_version_list'
23489 inc_version_list_init='$inc_version_list_init'
23492 initialinstalllocation='$initialinstalllocation'
23493 installarchlib='$installarchlib'
23494 installbin='$installbin'
23495 installhtml1dir='$installhtml1dir'
23496 installhtml3dir='$installhtml3dir'
23497 installman1dir='$installman1dir'
23498 installman3dir='$installman3dir'
23499 installprefix='$installprefix'
23500 installprefixexp='$installprefixexp'
23501 installprivlib='$installprivlib'
23502 installscript='$installscript'
23503 installsitearch='$installsitearch'
23504 installsitebin='$installsitebin'
23505 installsitehtml1dir='$installsitehtml1dir'
23506 installsitehtml3dir='$installsitehtml3dir'
23507 installsitelib='$installsitelib'
23508 installsiteman1dir='$installsiteman1dir'
23509 installsiteman3dir='$installsiteman3dir'
23510 installsitescript='$installsitescript'
23511 installstyle='$installstyle'
23512 installusrbinperl='$installusrbinperl'
23513 installvendorarch='$installvendorarch'
23514 installvendorbin='$installvendorbin'
23515 installvendorhtml1dir='$installvendorhtml1dir'
23516 installvendorhtml3dir='$installvendorhtml3dir'
23517 installvendorlib='$installvendorlib'
23518 installvendorman1dir='$installvendorman1dir'
23519 installvendorman3dir='$installvendorman3dir'
23520 installvendorscript='$installvendorscript'
23522 issymlink='$issymlink'
23523 ivdformat='$ivdformat'
23526 known_extensions='$known_extensions'
23529 ld_can_script='$ld_can_script'
23530 lddlflags='$lddlflags'
23532 ldflags_uselargefiles='$ldflags_uselargefiles'
23533 ldlibpthname='$ldlibpthname'
23540 libsdirs='$libsdirs'
23541 libsfiles='$libsfiles'
23542 libsfound='$libsfound'
23543 libspath='$libspath'
23544 libswanted='$libswanted'
23545 libswanted_uselargefiles='$libswanted_uselargefiles'
23551 localtime_r_proto='$localtime_r_proto'
23552 locincpth='$locincpth'
23553 loclibpth='$loclibpth'
23554 longdblsize='$longdblsize'
23555 longlongsize='$longlongsize'
23556 longsize='$longsize'
23560 lseeksize='$lseeksize'
23561 lseektype='$lseektype'
23564 madlyobj='$madlyobj'
23565 madlysrc='$madlysrc'
23569 make_set_make='$make_set_make'
23570 mallocobj='$mallocobj'
23571 mallocsrc='$mallocsrc'
23572 malloctype='$malloctype'
23574 man1direxp='$man1direxp'
23577 man3direxp='$man3direxp'
23579 mips_type='$mips_type'
23580 mistrustnm='$mistrustnm'
23582 mmaptype='$mmaptype'
23583 modetype='$modetype'
23585 multiarch='$multiarch'
23587 myarchname='$myarchname'
23588 mydomain='$mydomain'
23589 myhostname='$myhostname'
23592 need_va_copy='$need_va_copy'
23593 netdb_hlen_type='$netdb_hlen_type'
23594 netdb_host_type='$netdb_host_type'
23595 netdb_name_type='$netdb_name_type'
23596 netdb_net_type='$netdb_net_type'
23599 nm_so_opt='$nm_so_opt'
23600 nonxs_ext='$nonxs_ext'
23602 nvEUformat='$nvEUformat'
23603 nvFUformat='$nvFUformat'
23604 nvGUformat='$nvGUformat'
23605 nv_overflows_integers_at='$nv_overflows_integers_at'
23606 nv_preserves_uv_bits='$nv_preserves_uv_bits'
23607 nveformat='$nveformat'
23608 nvfformat='$nvfformat'
23609 nvgformat='$nvgformat'
23612 o_nonblock='$o_nonblock'
23614 old_pthread_create_joinable='$old_pthread_create_joinable'
23615 optimize='$optimize'
23616 orderlib='$orderlib'
23619 otherlibdirs='$otherlibdirs'
23623 patchlevel='$patchlevel'
23624 path_sep='$path_sep'
23627 perl_patchlevel='$perl_patchlevel'
23628 perl_static_inline='$perl_static_inline'
23629 perladmin='$perladmin'
23630 perllibs='$perllibs'
23631 perlpath='$perlpath'
23633 phostname='$phostname'
23639 prefixexp='$prefixexp'
23641 privlibexp='$privlibexp'
23642 procselfexe='$procselfexe'
23643 prototype='$prototype'
23645 quadkind='$quadkind'
23646 quadtype='$quadtype'
23647 randbits='$randbits'
23648 randfunc='$randfunc'
23649 random_r_proto='$random_r_proto'
23650 randseedtype='$randseedtype'
23652 rd_nodata='$rd_nodata'
23653 readdir64_r_proto='$readdir64_r_proto'
23654 readdir_r_proto='$readdir_r_proto'
23655 revision='$revision'
23661 sGMTIME_max='$sGMTIME_max'
23662 sGMTIME_min='$sGMTIME_min'
23663 sLOCALTIME_max='$sLOCALTIME_max'
23664 sLOCALTIME_min='$sLOCALTIME_min'
23665 sPRIEUldbl='$sPRIEUldbl'
23666 sPRIFUldbl='$sPRIFUldbl'
23667 sPRIGUldbl='$sPRIGUldbl'
23668 sPRIXU64='$sPRIXU64'
23670 sPRIeldbl='$sPRIeldbl'
23671 sPRIfldbl='$sPRIfldbl'
23672 sPRIgldbl='$sPRIgldbl'
23677 sSCNfldbl='$sSCNfldbl'
23678 sched_yield='$sched_yield'
23679 scriptdir='$scriptdir'
23680 scriptdirexp='$scriptdirexp'
23682 seedfunc='$seedfunc'
23683 selectminbits='$selectminbits'
23684 selecttype='$selecttype'
23685 sendmail='$sendmail'
23686 setgrent_r_proto='$setgrent_r_proto'
23687 sethostent_r_proto='$sethostent_r_proto'
23688 setlocale_r_proto='$setlocale_r_proto'
23689 setnetent_r_proto='$setnetent_r_proto'
23690 setprotoent_r_proto='$setprotoent_r_proto'
23691 setpwent_r_proto='$setpwent_r_proto'
23692 setservent_r_proto='$setservent_r_proto'
23695 sharpbang='$sharpbang'
23696 shmattype='$shmattype'
23697 shortsize='$shortsize'
23700 sig_count='$sig_count'
23701 sig_name='$sig_name'
23702 sig_name_init='$sig_name_init'
23704 sig_num_init='$sig_num_init'
23705 sig_size='$sig_size'
23706 signal_t='$signal_t'
23707 sitearch='$sitearch'
23708 sitearchexp='$sitearchexp'
23710 sitebinexp='$sitebinexp'
23711 sitehtml1dir='$sitehtml1dir'
23712 sitehtml1direxp='$sitehtml1direxp'
23713 sitehtml3dir='$sitehtml3dir'
23714 sitehtml3direxp='$sitehtml3direxp'
23716 sitelib_stem='$sitelib_stem'
23717 sitelibexp='$sitelibexp'
23718 siteman1dir='$siteman1dir'
23719 siteman1direxp='$siteman1direxp'
23720 siteman3dir='$siteman3dir'
23721 siteman3direxp='$siteman3direxp'
23722 siteprefix='$siteprefix'
23723 siteprefixexp='$siteprefixexp'
23724 sitescript='$sitescript'
23725 sitescriptexp='$sitescriptexp'
23726 sizesize='$sizesize'
23727 sizetype='$sizetype'
23731 sockethdr='$sockethdr'
23732 socketlib='$socketlib'
23733 socksizetype='$socksizetype'
23735 spackage='$spackage'
23736 spitshell='$spitshell'
23737 srand48_r_proto='$srand48_r_proto'
23738 srandom_r_proto='$srandom_r_proto'
23740 ssizetype='$ssizetype'
23741 st_ino_sign='$st_ino_sign'
23742 st_ino_size='$st_ino_size'
23743 startperl='$startperl'
23745 static_ext='$static_ext'
23747 stdio_base='$stdio_base'
23748 stdio_bufsiz='$stdio_bufsiz'
23749 stdio_cnt='$stdio_cnt'
23750 stdio_filbuf='$stdio_filbuf'
23751 stdio_ptr='$stdio_ptr'
23752 stdio_stream_array='$stdio_stream_array'
23753 strerror_r_proto='$strerror_r_proto'
23756 subversion='$subversion'
23760 targetarch='$targetarch'
23764 timeincl='$timeincl'
23765 timetype='$timetype'
23766 tmpnam_r_proto='$tmpnam_r_proto'
23772 ttyname_r_proto='$ttyname_r_proto'
23781 uidformat='$uidformat'
23787 uquadtype='$uquadtype'
23788 use5005threads='$use5005threads'
23789 use64bitall='$use64bitall'
23790 use64bitint='$use64bitint'
23791 usecrosscompile='$usecrosscompile'
23792 usedevel='$usedevel'
23794 usedtrace='$usedtrace'
23795 usefaststdio='$usefaststdio'
23796 useithreads='$useithreads'
23797 usekernprocpathname='$usekernprocpathname'
23798 uselargefiles='$uselargefiles'
23799 uselongdouble='$uselongdouble'
23800 usemallocwrap='$usemallocwrap'
23801 usemorebits='$usemorebits'
23802 usemultiplicity='$usemultiplicity'
23803 usemymalloc='$usemymalloc'
23805 usensgetexecutablepath='$usensgetexecutablepath'
23806 useopcode='$useopcode'
23807 useperlio='$useperlio'
23808 useposix='$useposix'
23809 usereentrant='$usereentrant'
23810 userelocatableinc='$userelocatableinc'
23812 useshrplib='$useshrplib'
23813 usesitecustomize='$usesitecustomize'
23814 usesocks='$usesocks'
23815 usethreads='$usethreads'
23816 usevendorprefix='$usevendorprefix'
23817 usevfork='$usevfork'
23820 uvXUformat='$uvXUformat'
23821 uvoformat='$uvoformat'
23824 uvuformat='$uvuformat'
23825 uvxformat='$uvxformat'
23827 vendorarch='$vendorarch'
23828 vendorarchexp='$vendorarchexp'
23829 vendorbin='$vendorbin'
23830 vendorbinexp='$vendorbinexp'
23831 vendorhtml1dir='$vendorhtml1dir'
23832 vendorhtml1direxp='$vendorhtml1direxp'
23833 vendorhtml3dir='$vendorhtml3dir'
23834 vendorhtml3direxp='$vendorhtml3direxp'
23835 vendorlib='$vendorlib'
23836 vendorlib_stem='$vendorlib_stem'
23837 vendorlibexp='$vendorlibexp'
23838 vendorman1dir='$vendorman1dir'
23839 vendorman1direxp='$vendorman1direxp'
23840 vendorman3dir='$vendorman3dir'
23841 vendorman3direxp='$vendorman3direxp'
23842 vendorprefix='$vendorprefix'
23843 vendorprefixexp='$vendorprefixexp'
23844 vendorscript='$vendorscript'
23845 vendorscriptexp='$vendorscriptexp'
23847 version_patchlevel_string='$version_patchlevel_string'
23848 versiononly='$versiononly'
23850 voidflags='$voidflags'
23853 yaccflags='$yaccflags'
23858 : add special variables
23859 $test -f $src/patchlevel.h && \
23860 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
23861 echo "PERL_PATCHLEVEL='$perl_patchlevel'" >>config.sh
23862 echo "PERL_CONFIG_SH=true" >>config.sh
23864 : propagate old symbols
23865 if $test -f UU/config.sh; then
23866 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
23867 $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \
23868 config.sh config.sh UU/oldconfig.sh |\
23869 $sort | $uniq -u >UU/oldsyms
23870 set X `$cat UU/oldsyms`
23876 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
23878 echo ": Variables propagated from previous config.sh file." >>config.sh
23879 for sym in `$cat UU/oldsyms`; do
23880 echo " Propagating $hint variable "'$'"$sym..."
23881 eval 'tmp="$'"${sym}"'"'
23883 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
23889 : Finish up by extracting the .SH files
23893 echo "Extraction done."
23903 If you'd like to make any changes to the config.sh file before I begin
23904 to configure things, do it as a shell escape now (e.g. !vi config.sh).
23907 rp="Press return or use a shell escape to edit config.sh:"
23912 *) : in case they cannot read
23913 sh 1>&4 -c "$ans";;
23918 : if this fails, just run all the .SH files by hand
23927 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
23934 Now you need to generate make dependencies by running "$make depend".
23935 You might prefer to run it in background: "$make depend > makedepend.out &"
23936 It can take a while, so you might not want to run it right now.
23941 rp="Run $make depend now?"
23945 $make depend && echo "Now you must run '$make'."
23948 echo "You must run '$make depend' then '$make'."
23951 elif test -f [Mm]akefile; then
23953 echo "Now you must run a $make."
23955 echo "Configure done."
23958 if $test -f Policy.sh; then
23961 If you compile $package on a different machine or from a different object
23962 directory, copy the Policy.sh file from this object directory to the
23963 new one before you run Configure -- this will help you with most of
23964 the policy defaults.
23968 if $test -f config.msg; then
23969 echo "Hmm. I also noted the following information while running:"
23971 $cat config.msg >&4
23974 $rm -f kit*isdone ark*isdone