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 Sat Oct 1 12:33:17 CEST 2011 [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=''
575 d_libm_lib_version=''
578 d_localtime_r_needs_tzset=''
589 d_malloc_good_size=''
633 d_old_pthread_create_joinable=''
634 old_pthread_create_joinable=''
636 d_pthread_attr_setscope=''
675 sethostent_r_proto=''
692 setprotoent_r_proto=''
704 setservent_r_proto=''
740 d_sprintf_returns_strlen=''
752 perl_static_inline=''
757 d_stdio_ptr_lval_nochange_cnt=''
758 d_stdio_ptr_lval_sets_cnt=''
902 d_gdbm_ndbm_h_uses_prototypes=''
903 d_gdbmndbm_h_uses_prototypes=''
905 d_ndbm_h_uses_prototypes=''
980 d_inc_version_list=''
982 inc_version_list_init=''
1001 ignore_versioned_solibs=''
1065 d_perl_otherlibdirs=''
1073 api_versionstring=''
1079 version_patchlevel_string=''
1083 d_nv_preserves_uv=''
1084 d_nv_zero_is_allbits_zero=''
1095 nv_overflows_integers_at=''
1096 nv_preserves_uv_bits=''
1168 installsitehtml1dir=''
1171 installsitehtml3dir=''
1178 installsiteman1dir=''
1181 installsiteman3dir=''
1186 installsitescript=''
1203 d_stdio_stream_array=''
1204 stdio_stream_array=''
1221 usekernprocpathname=''
1222 ccflags_uselargefiles=''
1223 ldflags_uselargefiles=''
1224 libswanted_uselargefiles=''
1233 usensgetexecutablepath=''
1246 installvendorarch=''
1253 installvendorhtml1dir=''
1255 vendorhtml1direxp=''
1256 installvendorhtml3dir=''
1258 vendorhtml3direxp=''
1264 installvendorman1dir=''
1267 installvendorman3dir=''
1274 installvendorscript=''
1287 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1290 : We must find out about Eunice early
1292 if test -f /etc/unixtovms; then
1293 eunicefix=/etc/unixtovms
1295 if test -f /etc/unixtovms.exe; then
1296 eunicefix=/etc/unixtovms.exe
1299 : Set executable suffix now -- needed before hints available
1300 if test -f "/libs/version.library"; then
1303 elif test -f "/system/gnu_library/bin/ar.pm"; then
1306 elif test -n "$DJGPP"; then
1309 elif test -d c:/. -o -n "$is_os2" ; then
1316 : Trailing extension. Override this in a hint file, if needed.
1317 : Extra object files, if any, needed on this platform.
1320 : Possible local include directories to search.
1321 : Set locincpth to "" in a hint file to defeat local include searches.
1322 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1323 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1325 : no include file wanted by default
1328 : Enable -DEBUGGING and -DDEBUGGING from the command line
1333 : change the next line if compiling for Xenix/286 on Xenix/386
1334 xlibpth='/usr/lib/386 /lib/386'
1335 : Possible local library directories to search.
1336 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1337 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1339 : general looking path for locating libraries
1340 glibpth="/lib /usr/lib $xlibpth"
1341 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1342 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1343 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1344 test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
1346 : Private path used by Configure to find libraries. Its value
1347 : is prepended to libpth. This variable takes care of special
1348 : machines, like the mips. Usually, it should be empty.
1351 : default library list
1353 : some systems want to use only the non-versioned libso:s
1354 ignore_versioned_solibs=''
1355 : set usethreads on the Configure command line to enable threads.
1356 usereentrant='undef'
1357 : full support for void wanted by default
1363 : set useposix=false in your hint file to disable the POSIX extension.
1365 : set useopcode=false in your hint file to disable the Opcode extension.
1368 ccflags_uselargefiles=''
1369 ldflags_uselargefiles=''
1370 libswanted_uselargefiles=''
1371 : set usemultiplicity on the Configure command line to enable multiplicity.
1372 : set usesocks on the Configure command line to enable socks.
1373 : List of libraries we want.
1374 : If anyone needs extra -lxxx, put those in a hint file.
1375 libswanted="sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun"
1376 libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
1377 : We probably want to search /usr/shlib before most other libraries.
1378 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1379 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1380 glibpth="/usr/shlib $glibpth"
1381 : Do not use vfork unless overridden by a hint file.
1384 : Find the basic shell for Bourne shell scripts
1388 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1391 if test -f "$xxx"; then
1394 : Build up a list and do a single loop so we can 'break' out.
1395 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1396 for xxx in sh bash ksh pdksh ash; do
1398 try="$try ${p}/${xxx}"
1402 if test -f "$xxx"; then
1405 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1408 elif test -f "$xxx.exe"; then
1419 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1421 Usually it's in /bin/sh. How did you even get this far?
1422 Please contact me (Perl Maintainers) at perlbug@perl.org and
1423 we'll try to straighten this all out.
1429 : see if sh knows # comments
1430 if `$sh -c '#' >/dev/null 2>&1`; then
1434 test -f $xcat$_exe || xcat=/usr/bin/cat
1435 if test ! -f $xcat$_exe; then
1436 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1437 if test -f $p/cat$_exe; then
1442 if test ! -f $xcat$_exe; then
1443 echo "Can't find cat anywhere!"
1447 echo "#!$xcat" >sharp
1450 ./sharp > today 2>/dev/null
1451 if test -s today; then
1454 echo "#! $xcat" > sharp
1457 ./sharp > today 2>/dev/null
1458 if test -s today; then
1466 echo "Your $sh doesn't grok # comments--I will strip them later on."
1469 echo "exec grep -v '^[ ]*#'" >spitshell
1471 $eunicefix spitshell
1472 spitshell=`pwd`/spitshell
1474 echo "I presume that if # doesn't work, #! won't work either!"
1479 : figure out how to guarantee sh startup
1481 '') startsh=${sharpbang}${sh} ;;
1493 : echo "Yup, it does."
1495 echo "Hmm... '$startsh' does not guarantee sh startup..."
1496 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1500 : Save command line options in file UU/cmdline.opt for later use in
1501 : generating config.sh.
1502 cat > cmdline.opt <<EOSH
1503 : Configure command line arguments.
1512 cat >>cmdline.opt <<EOSH
1513 config_arg$argn='$arg'
1515 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1518 arg_exp=`cat cmdl.opt`
1519 args_exp="$args_exp$args_sep'$arg_exp'"
1520 argn=`expr $argn + 1`
1525 : produce awk script to parse command line options
1526 cat >options.awk <<'EOF'
1528 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1530 len = length(optstr);
1531 for (i = 1; i <= len; i++) {
1532 c = substr(optstr, i, 1);
1533 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1544 if (substr(str, 1, 1) != "-") {
1545 printf("'%s'\n", str);
1549 for (i = 2; i <= len; i++) {
1550 c = substr(str, i, 1);
1552 printf("-%s\n", substr(str, i));
1558 printf("'%s'\n", substr(str, i + 1));
1571 : process the command line options
1572 set X `for arg in "$@"; do echo "X$arg"; done |
1573 sed -e s/X// | awk -f options.awk`
1578 : set up default values
1588 rm -f optdef.sh posthint.sh
1589 cat >optdef.sh <<EOS
1595 while test $# -gt 0; do
1597 -d) shift; fastread=yes;;
1598 -e) shift; alldone=cont;;
1602 if test -r "$1"; then
1605 echo "$me: cannot read config file $1." >&2
1611 -h) shift; error=true;;
1612 -r) shift; reuseval=true;;
1613 -s) shift; silent=true; realsilent=true;;
1614 -E) shift; alldone=exit;;
1615 -K) shift; knowitall=true;;
1616 -O) shift; override=true;;
1617 -S) shift; silent=true; extractsh=true;;
1622 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1623 echo "$me: ignoring -D $1" >&2
1626 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1627 *) echo "$1='define'" >> optdef.sh;;
1634 *=) echo "$1" >> optdef.sh;;
1636 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1637 echo "$me: ignoring -U $1" >&2
1639 *) echo "$1='undef'" >> optdef.sh;;
1650 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1654 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1655 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1661 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1662 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1663 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1664 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1665 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1666 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1672 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1674 echo "$yyy=''" >> posthint.sh ;;
1679 echo "$yyy='$zzz'" >> posthint.sh ;;
1681 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1683 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1688 echo "$yyy=$zzz" >> posthint.sh ;;
1689 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1693 -V) echo "$me generated by metaconfig 3.5 PL0." >&2
1696 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1704 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1705 [-U symbol] [-U symbol=] [-A command:symbol...]
1706 -d : use defaults for all answers.
1707 -e : go on without questioning past the production of config.sh.
1708 -f : specify an alternate default configuration file.
1709 -h : print this help message and exit (with an error status).
1710 -r : reuse C symbols value if possible (skips costly nm extraction).
1711 -s : silent mode, only echoes questions and essential information.
1712 -D : define symbol to have some value:
1713 -D symbol symbol gets the value 'define'
1714 -D symbol=value symbol gets the value 'value'
1715 common used examples (see INSTALL for more info):
1716 -Duse64bitint use 64bit integers
1717 -Duse64bitall use 64bit integers and pointers
1718 -Dusethreads use thread support
1719 -Dinc_version_list=none do not include older perl trees in @INC
1720 -DEBUGGING=none DEBUGGING options
1721 -Dcc=gcc choose your compiler
1722 -Dprefix=/opt/perl5 choose your destination
1723 -E : stop at the end of questions, after having produced config.sh.
1724 -K : do not use unless you know what you are doing.
1725 -O : let -D and -U override definitions from loaded configuration file.
1726 -S : perform variable substitutions on all .SH files (can mix with -f)
1727 -U : undefine symbol:
1728 -U symbol symbol gets the value 'undef'
1729 -U symbol= symbol gets completely empty
1731 -A : manipulate symbol after the platform specific hints have been applied:
1732 -A append:symbol=value append value to symbol
1733 -A symbol=value like append:, but with a separating space
1734 -A define:symbol=value define symbol to have value
1735 -A clear:symbol define symbol to be ''
1736 -A define:symbol define symbol to be 'define'
1737 -A eval:symbol=value define symbol to be eval of value
1738 -A prepend:symbol=value prepend value to symbol
1739 -A undef:symbol define symbol to be 'undef'
1740 -A undef:symbol= define symbol to be ''
1741 e.g.: -A prepend:libswanted='cl pthread '
1742 -A ccflags=-DSOME_MACRO
1743 -V : print version number and exit (with a zero status).
1750 case "$fastread$alldone" in
1753 case "$extractsh" in
1756 if test ! -t 0; then
1757 echo "Say 'sh Configure', not 'sh <Configure'"
1767 true) exec 1>/dev/null;;
1770 : run the defines and the undefines, if any, but leave the file out there...
1773 : create the posthint manipulation script and leave the file out there...
1778 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1779 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1780 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1781 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1782 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1785 : Some greps do not return status, grrr.
1786 echo "grimblepritz" >grimble
1787 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1789 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1795 : the following should work in any shell
1799 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1800 cat >contains <<'EOSS'
1801 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1806 : Find the path to the source tree
1809 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1813 *) src=`cd ../$src && pwd` ;;
1826 if test -f $rsrc/Configure && \
1827 $contains "^package='$package'\$" $rsrc/Configure >/dev/null 2>&1
1829 : found it, so we are ok.
1832 for src in . .. ../.. ../../.. ../../../..; do
1833 if test -f ../$src/Configure && \
1834 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1845 Sorry, I can't seem to locate the source dir for $package. Please start
1846 Configure with an explicit path -- i.e. /some/path/Configure.
1854 echo "Sources for $package found in \"$src\"." >&4
1858 : script used to extract .SH files with variable substitutions
1859 cat >extract <<'EOS'
1861 echo "Doing variable substitutions on .SH files..."
1862 if test -f MANIFEST; then
1863 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1865 echo "(Looking for .SH files under the source directory.)"
1866 set x `(cd "$src"; find . -name "*.SH" -print)`
1870 0) set x `(cd "$src"; echo *.SH)`; shift;;
1872 if test ! -f "$src/$1"; then
1878 while test $name; do
1879 if test ! -d "$name"; then
1880 create="$name $create";
1881 name=`echo $name | sed -e "s|^[^/]*$||"`;
1882 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1887 for file in $create; do
1896 dir=`expr X$file : 'X\(.*\)/'`
1897 file=`expr X$file : 'X.*/\(.*\)'`
1898 (cd "$dir" && . ./$file)
1908 dir=`expr X$file : 'X\(.*\)/'`
1909 file=`expr X$file : 'X.*/\(.*\)'`
1910 (set x $dir; shift; eval $mkdir_p)
1911 sh <"$src/$dir/$file"
1920 if test -f "$src/config_h.SH"; then
1921 if test ! -f config.h; then
1922 : oops, they left it out of MANIFEST, probably, so do it anyway.
1923 . "$src/config_h.SH"
1928 : extract files and exit if asked to do so
1929 case "$extractsh" in
1931 case "$realsilent" in
1935 case "$config_sh" in
1936 '') config_sh='config.sh';;
1939 echo "Fetching answers from $config_sh..."
1942 test "$override" && . ./optdef.sh
1946 echo "Extraction done."
1951 : Eunice requires " " instead of "", can you believe it
1954 echo "Beginning of configuration questions for $package."
1956 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1958 : first determine how to suppress newline on echo command
1960 echo "Checking echo to see how to suppress newlines..."
1961 (echo "hi there\c" ; echo " ") >.echotmp
1962 if $contains c .echotmp >/dev/null 2>&1 ; then
1973 echo $n "The star should be here-->$c"
1977 : Now test for existence of everything in MANIFEST
1979 if test -f "$rsrc/MANIFEST"; then
1980 echo "First let's make sure your kit is complete. Checking..." >&4
1981 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | \
1982 (split -l 50 2>/dev/null || split -50)
1985 for filelist in x??; do
1986 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` \
1987 >/dev/null 2>>"$tmppwd/missing")
1989 if test -s missing; then
1993 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1995 You have the option of continuing the configuration process, despite the
1996 distinct possibility that your kit is damaged, by typing 'y'es. If you
1997 do, don't blame me if something goes wrong. I advise you to type 'n'o
1998 and contact the author (perlbug@perl.org).
2001 echo $n "Continue? [n] $c" >&4
2005 echo "Continuing..." >&4
2009 echo "ABORTING..." >&4
2014 echo "Looks good..."
2017 echo "There is no MANIFEST file. I hope your kit is complete !"
2021 : Find the appropriate value for a newline for tr
2023 if test -n "$DJGPP"; then
2026 if test X"$trnl" = X; then
2027 case "`echo foo|tr '\n' x 2>/dev/null`" in
2031 if test X"$trnl" = X; then
2032 case "`echo foo|tr '\012' x 2>/dev/null`" in
2033 foox) trnl='\012' ;;
2036 if test X"$trnl" = X; then
2037 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
2038 fooxy) trnl='\n\r' ;;
2041 if test X"$trnl" = X; then
2044 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
2050 : compute the number of columns on the terminal for proper question formatting
2055 : set up the echo used in my read
2056 myecho="case \"\$xxxm\" in
2057 '') echo $n \"\$rp $c\" >&4;;
2059 '') echo $n \"[\$xxxm] $c\";;
2061 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
2063 echo $n \"[\$xxxm] $c\" >&4
2065 echo $n \"\$rp [\$xxxm] $c\" >&4
2071 : now set up to do reads with possible shell escape and default assignment
2077 case "\$fastread" in
2078 yes) case "\$dflt" in
2081 case "\$silent-\$rp" in
2086 *) case "\$silent" in
2087 true) case "\$rp" in
2092 while expr "X\$ans" : "X!" >/dev/null; do
2096 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2104 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2113 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2118 echo "(OK, I'll run with -d after this question.)" >&4
2121 echo "*** Sorry, \$1 not supported yet." >&4
2131 echo "*** Substitution done -- please confirm."
2133 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2138 echo "*** Error -- try again."
2145 case "\$ans\$xxxm\$nostick" in
2157 : create .config dir to save info across Configure sessions
2158 test -d ../.config || mkdir ../.config
2159 cat >../.config/README <<EOF
2160 This directory created by Configure to save information that should
2161 persist across sessions for $package.
2163 You may safely delete it if you wish.
2166 : See if we are using a devel version and want that
2167 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2170 usedevel="$define" ;;
2171 *) case "$xversion" in
2174 *** WHOA THERE!!! ***
2176 This is an UNSTABLE DEVELOPMENT release.
2177 The version of this $package distribution is $xversion, that is, odd,
2178 (as opposed to even) and that signifies a development release.
2179 If you want a maintenance release, you want an even-numbered version.
2181 Do ***NOT*** install this into production use.
2182 Data corruption and crashes are possible.
2184 It is most seriously suggested that you do not continue any further
2185 unless you want to help in developing and debugging Perl.
2187 If you *still* want to build perl, you can answer 'y' now,
2188 or pass -Dusedevel to Configure.
2191 rp='Do you really want to continue?'
2195 [yY]) echo >&4 "Okay, continuing."
2196 usedevel="$define" ;;
2197 *) echo >&4 "Okay, bye."
2208 case "$versiononly" in
2209 '') versiononly="$define" ;;
2211 case "$installusrbinperl" in
2212 '') installusrbinperl="$undef" ;;
2217 : general instructions
2220 user=`(logname) 2>/dev/null`
2222 '') user=`whoami 2>&1`;;
2224 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2227 rp='Would you like to see the instructions?'
2238 This installation shell script will examine your system and ask you questions
2239 to determine how the perl5 package should be installed. If you get
2240 stuck on a question, you may use a ! shell escape to start a subshell or
2241 execute a command. Many of the questions will have default answers in square
2242 brackets; typing carriage return will give you the default.
2244 On some of the questions which ask for file or directory names you are allowed
2245 to use the ~name construct to specify the login directory belonging to "name",
2246 even if you don't have a shell which knows about that. Questions where this is
2247 allowed will be marked "(~name ok)".
2251 dflt='Type carriage return to continue'
2255 The prompter used in this script allows you to use shell variables and
2256 backticks in your answers. You may use $1, $2, etc... to refer to the words
2257 in the default answer, as if the default line was a set of arguments given to a
2258 script shell. This means you may also use $* to repeat the whole default line,
2259 so you do not have to re-type everything to add something to the default.
2261 Every time there is a substitution, you will have to confirm. If there is an
2262 error (e.g. an unmatched backtick), the default answer will remain unchanged
2263 and you will be prompted again.
2265 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2266 the questions and use the computed defaults (or the previous answers if there
2267 was already a config.sh file). Type 'Configure -h' for a list of options.
2268 You may also start interactively and then answer '& -d' at any prompt to turn
2269 on the non-interactive behaviour for the remainder of the execution.
2275 Much effort has been expended to ensure that this shell script will run on any
2276 Unix system. If despite that it blows up on yours, your best bet is to edit
2277 Configure and run it again. If you can't run Configure for some reason,
2278 you'll have to generate a config.sh file by hand. Whatever problems you
2279 have, let me (perlbug@perl.org) know how I blew it.
2281 This installation script affects things in two ways:
2283 1) it may do direct variable substitutions on some of the files included
2285 2) it builds a config.h file for inclusion in C programs. You may edit
2286 any of these files as the need arises after running this script.
2288 If you make a mistake on a question, there is no easy way to back up to it
2289 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2290 files. Configure will offer to let you do this before it runs the SH files.
2293 dflt='Type carriage return to continue'
2295 case "$firsttime" in
2296 true) echo $user >>../.config/instruct;;
2300 : find out where common programs are
2302 echo "Locating common programs..." >&4
2315 if test -d \$dir/\$thing; then
2321 for thisthing in \$dir/\$thing; do
2322 : just loop through to pick last item
2324 if test -f \$thisthing; then
2327 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2330 elif test -f \$dir/\$thing.exe; then
2331 if test -n "$DJGPP"; then
2332 echo \$dir/\$thing.exe
2333 elif test "$eunicefix" != ":"; then
2334 : on Eunice apparently
2387 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2388 pth="$pth /lib /usr/lib"
2389 for file in $loclist; do
2393 if test -f "$xxx"; then
2396 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2397 xxx=`./loc $file $file $pth`
2400 '') xxx=`./loc $file $file $pth`;;
2401 *) xxx=`./loc $xxx $xxx $pth`;;
2403 eval $file=$xxx$_exe
2407 echo $file is in $xxx.
2410 echo $file is in $xxx.
2413 echo "I don't know where '$file' is, and my life depends on it." >&4
2414 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2420 echo "Don't worry if any of the following aren't found..."
2422 for file in $trylist; do
2426 if test -f "$xxx"; then
2429 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2430 xxx=`./loc $file $file $pth`
2433 '') xxx=`./loc $file $file $pth`;;
2434 *) xxx=`./loc $xxx $xxx $pth`;;
2436 eval $file=$xxx$_exe
2440 echo $file is in $xxx.
2443 echo $file is in $xxx.
2446 echo "I don't see $file out there, $say."
2453 echo "Substituting grep for egrep."
2460 *) if $less -R </dev/null >/dev/null; then
2461 echo "Substituting less -R for less."
2469 echo "Substituting cp for ln."
2478 echo "I can't find make or gmake, and my life depends on it." >&4
2479 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2487 *) # We can't have osname yet.
2488 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2489 # Assume that gmake, if found, is definitely GNU make
2490 # and prefer it over the system make.
2491 echo "Substituting gmake for make."
2499 echo "Hopefully test is built into your sh."
2502 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2503 echo "Using the test built into your sh."
2511 echo "Hopefully echo is built into your sh."
2516 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2517 $echo $n "hi there$c" >foo1
2518 echo $n "hi there$c" >foo2
2519 if cmp foo1 foo2 >/dev/null 2>&1; then
2520 echo "They are compatible. In fact, they may be identical."
2527 They are not compatible! You are probably running ksh on a non-USG system.
2528 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2529 have echo built in and we may have to run some Bourne shell scripts. That
2530 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2533 $echo $n "The star should be here-->$c"
2540 # This question was auctioned at YAPC::Europe-2007 in Vienna
2541 # I never promised you could answer it. I only auctioned the question.
2543 The following message is sponsored by
2545 Dresden.pm<--The stars should be here.
2547 Dear Perl user, system administrator or package
2548 maintainer, the Perl community sends greetings to
2549 you. Do you (emblematical) greet back [Y/n]? n
2553 : Check what type of C compiler we use
2557 cat <<'EOSC' >>trygcc
2562 int main(int argc, char *argv[]) {
2566 if $cc -o try $ccflags $ldflags try.c; then
2569 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2575 # Skip this test because it gives a false match on output like:
2576 # ./trygcc: line 23: cc: command not found
2577 # case "`$cc -v -c try.c 2>&1`" in
2578 # *gcc*) trygcc=no ;;
2580 if $test X"$trygcc" = Xyes; then
2581 if gcc -o try -c try.c; then
2583 echo "You seem to have a working gcc, though." >&4
2584 # Switching compilers may undo the work of hints files.
2585 # The most common problem is -D_REENTRANT for threads.
2586 # This heuristic catches that case, but gets false positives
2587 # if -Dusethreads was not actually specified. Better to
2588 # bail out here with a useful message than fail
2589 # mysteriously later. Should we perhaps just try to
2590 # re-invoke Configure -Dcc=gcc config_args ?
2591 if $test -f usethreads.cbu; then
2594 *** However, any setting of the C compiler flags (e.g. for thread support)
2595 *** will be lost. It may be necessary for you to restart Configure and
2596 *** add -Dcc=gcc to your Configure command line.
2599 rp="Would you like to go ahead and try gcc anyway?"
2602 rp="Would you like to use it?"
2605 if $test -f myread; then
2608 if $test -f UU/myread; then
2611 echo "Cannot find myread, sorry. Aborting." >&2
2616 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2629 cat <<'EOSC' >>checkcc
2634 int main(int argc, char *argv[]) {
2638 if $cc -o try $ccflags $ldflags try.c; then
2641 if $test X"$despair" = Xyes; then
2642 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2645 You need to find a working C compiler.
2646 Either (purchase and) install the C compiler supplied by your OS vendor,
2647 or for a free C compiler try http://gcc.gnu.org/
2648 I cannot continue any further, aborting.
2657 : determine whether symbolic links are supported
2660 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2661 echo "Symbolic links are supported." >&4
2664 echo "Symbolic links are NOT supported." >&4
2669 : determine whether symbolic links are supported
2673 echo "Checking how to test for symbolic links..." >&4
2675 if $test "X$issymlink" = X; then
2677 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2678 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2680 if test $? = 0; then
2683 echo "Your builtin 'test -h' may be broken." >&4
2686 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2689 if test -f "$p/$test"; then
2698 echo "Trying external '$test -h'." >&4
2699 issymlink="$test -h"
2700 if $test ! -h sym >/dev/null 2>&1; then
2701 echo "External '$test -h' is broken, too." >&4
2709 if $test "X$issymlink" = X; then
2710 if $test -L sym 2>/dev/null; then
2711 issymlink="$test -L"
2712 echo "The builtin '$test -L' worked." >&4
2715 if $test "X$issymlink" != X; then
2716 echo "You can test for symbolic links with '$issymlink'." >&4
2718 echo "I do not know how you can test for symbolic links." >&4
2722 *) echo "No symbolic links, so not testing for their testing..." >&4
2727 : Make symlinks util
2728 case "$mksymlinks" in
2731 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2734 *) case "$lns:$issymlink" in
2735 *"ln"*" -s:"*"test -"?)
2736 echo "Creating the symbolic links..." >&4
2737 echo "(First creating the subdirectories...)" >&4
2739 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2741 test -z "$directory" && break
2745 if test ! -d t/base; then
2746 echo "Failed to create the subdirectories. Aborting." >&4
2749 echo "(Then creating the symlinks...)" >&4
2750 awk '{print $1}' $src/MANIFEST | while true; do
2752 test -z "$filename" && break
2753 if test -f $filename; then
2754 if $issymlink $filename; then
2758 if test -f $filename; then
2759 echo "$filename already exists, not symlinking."
2761 ln -s $src/$filename $filename
2765 if test ! -f t/base/lex.t; then
2766 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2771 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2779 : Check for Cross-Compilation
2780 case "$usecrosscompile" in
2782 $echo "Cross-compiling..."
2785 *-*-gcc) # A cross-compiling gcc, probably.
2786 targetarch=`$echo $cc|$sed 's/-gcc$//'`
2788 # leave out ld, choosing it is more complex
2790 ranlib=$targetarch-ranlib
2791 $echo 'extern int foo;' > try.c
2792 set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
2794 if $test $# -gt 0; then
2796 incpth="`$echo $incpth|$sed 's/^ //'`"
2797 echo "Guessing incpth '$incpth'." >&4
2799 j="`$echo $i|$sed 's,/include$,/lib,'`"
2800 if $test -d $j; then
2804 libpth="`$echo $libpth|$sed 's/^ //'`"
2805 echo "Guessing libpth '$libpth'." >&4
2810 case "$targetarch" in
2811 '') echo "Targetarch not defined." >&4; croak=y ;;
2812 *) echo "Using targetarch $targetarch." >&4 ;;
2815 '') echo "Incpth not defined." >&4; croak=y ;;
2816 *) echo "Using incpth '$incpth'." >&4 ;;
2819 '') echo "Libpth not defined." >&4; croak=y ;;
2820 *) echo "Using libpth '$libpth'." >&4 ;;
2823 '') for i in $incpth; do
2824 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2826 echo "Guessing usrinc $usrinc." >&4
2831 '') echo "Usrinc not defined." >&4; croak=y ;;
2834 *) echo "Using usrinc $usrinc." >&4 ;;
2836 case "$targethost" in
2837 '') echo "Targethost not defined." >&4; croak=y ;;
2838 *) echo "Using targethost $targethost." >&4
2843 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2846 /*) run=$src/Cross/run
2847 targetmkdir=$src/Cross/mkdir
2849 from=$src/Cross/from
2851 *) pwd=`$test -f ../Configure & cd ..; pwd`
2853 targetmkdir=$pwd/Cross/mkdir
2855 from=$pwd/Cross/from
2858 case "$targetrun" in
2859 '') targetrun=ssh ;;
2864 case "$targetfrom" in
2865 '') targetfrom=scp ;;
2869 from=$from-$targetfrom
2870 case "$targetdir" in
2872 echo "Guessing targetdir $targetdir." >&4
2875 case "$targetuser" in
2877 echo "Guessing targetuser $targetuser." >&4
2880 case "$targetfrom" in
2884 case "$targetrun" in
2896 '') cwd=$targetdir ;;
2900 if $test ! -f \$exe.xok; then
2904 $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2907 *) echo "Unknown targetrun '$targetrun'" >&4
2911 case "$targetmkdir" in
2913 cat >$targetmkdir <<EOF
2915 $targetrun -l $targetuser $targethost "mkdir -p \$@"
2917 $chmod a+rx $targetmkdir
2919 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2931 $targetmkdir \`dirname \$f\`
2932 $targetto $q \$f $targetuser@$targethost:\$f || exit 1
2935 $targetmkdir $targetdir/\`dirname \$f\`
2936 $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2949 $mkdir -p $targetdir/\`dirname \$f\`
2950 $cp \$f $targetdir/\$f || exit 1
2953 $targetmkdir $targetdir/\`dirname \$f\`
2954 $cp \$f $targetdir/\$f || exit 1
2961 *) echo "Unknown targetto '$targetto'" >&4
2965 case "$targetfrom" in
2972 $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2977 cp) cat >$from <<EOF
2982 cp $targetdir/\$f . || exit 1
2987 *) echo "Unknown targetfrom '$targetfrom'" >&4
2991 if $test ! -f $run; then
2992 echo "Target 'run' script '$run' not found." >&4
2996 if $test ! -f $to; then
2997 echo "Target 'to' script '$to' not found." >&4
3001 if $test ! -f $from; then
3002 echo "Target 'from' script '$from' not found." >&4
3006 if $test ! -f $run -o ! -f $to -o ! -f $from; then
3010 Using '$run' for remote execution,
3011 and '$from' and '$to'
3012 for remote file transfer.
3018 usecrosscompile='undef'
3023 : see whether [:lower:] and [:upper:] are supported character classes
3025 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
3027 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
3031 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
3032 # (0xd9 and 0xe2), therefore that is a nice testing point.
3033 if test "X$up" = X -o "X$low" = X; then
3034 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
3040 if test "X$up" = X -o "X$low" = X; then
3041 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
3047 if test "X$up" = X -o "X$low" = X; then
3048 case "`echo RS | od -x 2>/dev/null`" in
3050 echo "Hey, this might be EBCDIC." >&4
3051 if test "X$up" = X -o "X$low" = X; then
3052 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
3053 rs) up='[A-IJ-RS-Z]'
3058 if test "X$up" = X -o "X$low" = X; then
3059 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
3069 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
3071 echo "Using $up and $low to convert case." >&4
3074 echo "I don't know how to translate letters from upper to lower case." >&4
3075 echo "Your tr is not acting any way I know of." >&4
3079 : set up the translation script tr, must be called with ./tr of course
3083 '[A-Z][a-z]') exec $tr '$up' '$low';;
3084 '[a-z][A-Z]') exec $tr '$low' '$up';;
3091 : Try to determine whether config.sh was made on this system
3092 case "$config_sh" in
3094 myuname=`$uname -a 2>/dev/null`
3095 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
3096 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
3097 # because the A-Z/a-z are not consecutive.
3098 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e "s,['/],,g" | \
3099 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
3100 newmyuname="$myuname"
3102 case "$knowitall" in
3104 if test -f ../config.sh; then
3105 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3106 eval "`grep myuname= ../config.sh`"
3108 if test "X$myuname" = "X$newmyuname"; then
3116 : Get old answers from old config file if Configure was run on the
3117 : same system, otherwise use the hints.
3120 if test -f config.sh; then
3122 rp="I see a config.sh file. Shall I use it to set the defaults?"
3125 n*|N*) echo "OK, I'll ignore it."
3126 mv config.sh config.sh.old
3127 myuname="$newmyuname"
3129 *) echo "Fetching default answers from your old config.sh file..." >&4
3137 : Older versions did not always set $sh. Catch re-use of such
3147 if test ! -f config.sh; then
3150 First time through, eh? I have some defaults handy for some systems
3151 that need some extra help getting the Configure answers right:
3154 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3156 : Half the following guesses are probably wrong... If you have better
3157 : tests or hints, please send them to perlbug@perl.org
3158 : The metaconfig authors would also appreciate a copy...
3159 $test -f /irix && osname=irix
3160 $test -f /xenix && osname=sco_xenix
3161 $test -f /dynix && osname=dynix
3162 $test -f /dnix && osname=dnix
3163 $test -f /lynx.os && osname=lynxos
3164 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3165 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3166 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3167 $test -f /bin/mips && /bin/mips && osname=mips
3168 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
3169 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
3170 $test -d /usr/apollo/bin && osname=apollo
3171 $test -f /etc/saf/_sactab && osname=svr4
3172 $test -d /usr/include/minix && osname=minix
3173 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3174 if $test -d /MachTen -o -d /MachTen_Folder; then
3176 if $test -x /sbin/version; then
3177 osvers=`/sbin/version | $awk '{print $2}' |
3178 $sed -e 's/[A-Za-z]$//'`
3179 elif $test -x /usr/etc/version; then
3180 osvers=`/usr/etc/version | $awk '{print $2}' |
3181 $sed -e 's/[A-Za-z]$//'`
3187 $test -f /sys/posix.dll &&
3188 $test -f /usr/bin/what &&
3189 set X `/usr/bin/what /sys/posix.dll` &&
3190 $test "$3" = UWIN &&
3194 if $test -f $uname; then
3202 umips) osname=umips ;;
3205 [23]100) osname=mips ;;
3206 next*) osname=next ;;
3208 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3209 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3212 elif $test -f /etc/kconfig; then
3214 if test "$lns" = "$ln -s"; then
3216 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3218 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3225 if test -n "$DJGPP"; then
3234 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3236 # oslevel can fail with:
3237 # oslevel: Unable to acquire lock.
3238 *not\ found) osvers="$4"."$3" ;;
3239 '<3240'|'<>3240') osvers=3.2.0 ;;
3240 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3241 '=3250'|'>3250') osvers=3.2.5 ;;
3245 bsd386) osname=bsd386
3248 cygwin*) osname=cygwin
3251 *dc.osx) osname=dcosx
3257 domainos) osname=apollo
3263 dragonfly) osname=dragonfly
3266 dynixptx*) osname=dynixptx
3267 osvers=`echo "$4"|sed 's/^v//'`
3269 freebsd) osname=freebsd
3271 genix) osname=genix ;;
3275 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3291 netbsd*) osname=netbsd
3294 news-os) osvers="$3"
3296 4*) osname=newsos4 ;;
3300 next*) osname=next ;;
3301 nonstop-ux) osname=nonstopux ;;
3302 openbsd) osname=openbsd
3308 POSIX-BC | posix-bc ) osname=posix-bc
3311 powerux | power_ux | powermax_os | powermaxos | \
3312 powerunix | power_unix) osname=powerux
3318 solaris) osname=solaris
3320 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3327 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3331 titanos) osname=titanos
3340 ultrix) osname=ultrix
3343 osf1|mls+) case "$5" in
3346 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3349 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3352 hp*) osname=hp_osf1 ;;
3353 mips) osname=mips_osf1 ;;
3356 # UnixWare 7.1.2 is known as Open UNIX 8
3357 openunix|unixware) osname=svr5
3365 $2) case "$osname" in
3369 : svr4.x or possibly later
3379 if test -f /stand/boot ; then
3380 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3381 if test -n "$INITPROG" -a -f "$INITPROG"; then
3382 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3383 if test -n "$isesix"; then
3391 *) if test -f /etc/systemid; then
3393 set `echo $3 | $sed 's/\./ /g'` $4
3394 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3396 elif $test -f $src/hints/sco_$1_$2.sh; then
3398 elif $test -f $src/hints/sco_$1.sh; then
3403 '') : Still unknown. Probably a generic Sys V.
3412 *) case "$osname" in
3413 '') : Still unknown. Probably a generic BSD.
3421 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3422 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3423 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3426 $rm -f UU/kernel.what
3427 elif test -d c:/. -o -n "$is_os2" ; then
3434 case "$targetarch" in
3437 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3442 : Now look for a hint file osname_osvers, unless one has been
3443 : specified already.
3446 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3447 : Also try without trailing minor version numbers.
3448 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3449 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3450 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3451 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3454 *) case "$osvers" in
3457 *) if $test -f $src/hints/$file.sh ; then
3459 elif $test -f $src/hints/$xfile.sh ; then
3461 elif $test -f $src/hints/$xxfile.sh ; then
3463 elif $test -f $src/hints/$xxxfile.sh ; then
3465 elif $test -f $src/hints/$xxxxfile.sh ; then
3467 elif $test -f "$src/hints/${osname}.sh" ; then
3476 if $test -f Policy.sh ; then
3479 none) dflt="Policy" ;;
3480 *) dflt="Policy $dflt" ;;
3485 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3489 if $test -f Policy.sh ; then
3492 There's also a Policy hint file available, which should make the
3493 site-specific (policy) questions easier to answer.
3500 You may give one or more space-separated answers, or "none" if appropriate.
3501 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3502 previous run of Configure, you may specify it as well as or instead of
3503 OS-specific hints. If hints are provided for your OS, you should use them:
3504 although Perl can probably be built without hints on many platforms, using
3505 hints often improve performance and may enable features that Configure can't
3506 set up on its own. If there are no hints that match your OS, specify "none";
3507 DO NOT give a wrong version or a wrong OS.
3511 rp="Which of these apply, if any?"
3514 for file in $tans; do
3515 if $test X$file = XPolicy -a -f Policy.sh; then
3517 $cat Policy.sh >> UU/config.sh
3518 elif $test -f $src/hints/$file.sh; then
3519 . $src/hints/$file.sh
3520 $cat $src/hints/$file.sh >> UU/config.sh
3521 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3524 : Give one chance to correct a possible typo.
3525 echo "$file.sh does not exist"
3527 rp="hint to use instead?"
3529 for file in $ans; do
3530 if $test -f "$src/hints/$file.sh"; then
3531 . $src/hints/$file.sh
3532 $cat $src/hints/$file.sh >> UU/config.sh
3533 elif $test X$ans = X -o X$ans = Xnone ; then
3536 echo "$file.sh does not exist -- ignored."
3543 : Remember our hint file for later.
3544 if $test -f "$src/hints/$file.sh" ; then
3554 echo "Fetching default answers from $config_sh..." >&4
3558 cp $config_sh config.sh 2>/dev/null
3568 test "$override" && . ./optdef.sh
3570 : Restore computed paths
3571 for file in $loclist $trylist; do
3572 eval $file="\$_$file"
3577 Configure uses the operating system name and version to set some defaults.
3578 The default value is probably right if the name rings a bell. Otherwise,
3579 since spelling matters for me, either accept the default or answer "none"
3586 ''|' '|none) dflt=none ;;
3587 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3590 *) dflt="$osname" ;;
3592 rp="Operating system name?"
3596 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3602 ''|' '|none) dflt=none ;;
3603 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3604 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3606 ''|' ') dflt=none ;;
3611 *) dflt="$osvers" ;;
3613 rp="Operating system version?"
3623 : who configured the system
3624 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3627 cf_by=`(logname) 2>/dev/null`
3630 cf_by=`(whoami) 2>/dev/null`
3632 "") cf_by=unknown ;;
3637 : decide how portable to be. Allow command line overrides.
3638 case "$d_portable" in
3640 *) d_portable="$define" ;;
3643 : set up shell script to do ~ expansion
3649 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3652 if $test -f /bin/csh; then
3653 /bin/csh -f -c "glob \$1"
3658 name=\`$expr x\$1 : '..\([^/]*\)'\`
3659 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3660 if $test ! -d "\$dir"; then
3662 echo "\$me: can't locate home directory for: \$name" >&2
3667 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3683 : now set up to get a file name
3687 cat <<'EOSC' >>getfile
3703 : getfile will accept an answer from the comma-separated list
3704 : enclosed in parentheses even if it does not meet other criteria.
3705 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3706 fn=`echo $fn | sed 's/(.*)//'`
3712 loc_file=`expr $fn : '.*:\(.*\)'`
3713 fn=`expr $fn : '\(.*\):.*'`
3721 */*) fullpath=true;;
3730 *e*) exp_file=true;;
3733 *p*) nopath_ok=true;;
3738 *d*) type='Directory';;
3739 *l*) type='Locate';;
3744 Locate) what='File';;
3749 case "$d_portable" in
3757 while test "$type"; do
3762 true) rp="$rp (~name ok)";;
3765 if test -f UU/getfile.ok && \
3766 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3785 value=`UU/filexp $ans`
3788 if test "$ans" != "$value"; then
3789 echo "(That expands to $value on this system.)"
3803 /*) value="$ansexp" ;;
3804 [a-zA-Z]:/*) value="$ansexp" ;;
3809 echo "I shall only accept a full path name, as in /bin/ls." >&4
3810 echo "Use a ! shell escape if you wish to check pathnames." >&4
3813 echo "Please give a full path name, starting with slash." >&4
3816 echo "Note that using ~name is ok provided it expands well." >&4
3829 for fp in $gfpth; do
3830 if test "X$fp" = X.; then
3835 if test -f "$pf"; then
3837 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3839 echo "($value is not a plain file, but that's ok.)"
3842 if test X"$type" = X; then
3849 for fp in $gfpth; do
3850 if test "X$fp" = X.; then
3855 direxp="$fp/$ansexp"
3857 if test -d "$direxp"; then
3865 if test -d "$ansexp"; then
3866 echo "(Looking for $loc_file in directory $value.)"
3867 value="$value/$loc_file"
3868 ansexp="$ansexp/$loc_file"
3870 if test -f "$ansexp"; then
3873 case "$nopath_ok" in
3874 true) case "$value" in
3876 *) echo "Assuming $value will be in people's path."
3892 if test "$fastread" = yes; then
3897 rp="$what $value doesn't exist. Use that name anyway?"
3916 test "X$gfpthkeep" != Xy && gfpth=""
3919 : determine root of directory hierarchy where package will be installed.
3922 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
3925 dflt=`echo "$prefix" | sed 's/.$//'`
3933 By default, $package will be installed in $dflt/bin, manual pages
3934 under $dflt/man, etc..., i.e. with $dflt as prefix for all
3935 installation directories. Typically this is something like /usr/local.
3936 If you wish to have binaries under /usr/bin but other parts of the
3937 installation under /usr/local, that's ok: you will be prompted
3938 separately for each of the installation directories, the prefix being
3939 only used to set the defaults.
3943 rp='Installation prefix to use?'
3951 *) oldprefix="$prefix";;
3958 : allow them to override the AFS root
3961 *) afsroot=$afsroot ;;
3967 $define|true) afs=true ;;
3968 $undef|false) afs=false ;;
3969 *) if $test -d $afsroot; then
3977 echo "AFS may be running... I'll be extra cautious then..." >&4
3979 echo "AFS does not seem to be running..." >&4
3982 : determine installation prefix for where package is to be installed.
3986 Since you are running AFS, I need to distinguish the directory in which
3987 files will reside from the directory in which they are installed (and from
3988 which they are presumably copied to the former directory by occult means).
3991 case "$installprefix" in
3992 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
3993 *) dflt="$installprefix";;
3998 In some special cases, particularly when building $package for distribution,
3999 it is convenient to distinguish the directory in which files should be
4000 installed from the directory ($prefix) in which they will
4001 eventually reside. For most users, these two directories are the same.
4004 case "$installprefix" in
4006 *) dflt=$installprefix;;
4010 rp='What installation prefix should I use for installing files?'
4012 installprefix="$ans"
4013 installprefixexp="$ansexp"
4015 : Perform the prefixexp/installprefixexp correction if necessary
4016 cat <<EOS >installprefix
4019 cat <<'EOSC' >>installprefix
4020 : Change installation prefix, if necessary.
4021 if $test X"$prefix" != X"$installprefix"; then
4022 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
4024 eval "install${prefixvar}=\"\$${prefixvar}exp\""
4027 chmod +x installprefix
4028 $eunicefix installprefix
4030 : Set variables such as privlib and privlibexp from the output of ./getfile
4031 : performing the prefixexp/installprefixexp correction if necessary.
4032 cat <<EOS >setprefixvar
4035 cat <<'EOSC' >>setprefixvar
4036 eval "${prefixvar}=\"\$ans\""
4037 eval "${prefixvar}exp=\"\$ansexp\""
4040 chmod +x setprefixvar
4041 $eunicefix setprefixvar
4043 : set up the script used to warn in case of inconsistency
4052 '') echo "The $hint value for \$$var on this machine was \"$was\"!" >&4
4054 *) echo "Hmm. Based on the hints in hints/$hintfile.sh, " >&4
4055 echo "the $hint value for \$$var on this machine was \"$was\"!" >&4
4060 echo "*** WHOA THERE!!! ***" >&4
4061 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
4064 rp=" Keep the $hint value?"
4067 y) td=$was; tu=$was;;
4071 : function used to set '$1' to '$val'
4072 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
4074 $define$undef) . ./whoa; eval "$var=\$td";;
4075 $undef$define) . ./whoa; eval "$var=\$tu";;
4076 *) eval "$var=$val";;
4079 : get the patchlevel
4081 echo "Getting the current patchlevel..." >&4
4082 if $test -r $rsrc/patchlevel.h;then
4083 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
4084 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4085 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4086 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4087 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4088 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4089 perl_patchlevel=`egrep ',"(MAINT|SMOKE)[0-9][0-9]*"' $rsrc/patchlevel.h|tail -1|sed 's/[^0-9]//g'`
4098 $echo "(You do not have patchlevel.h. Eek.)"
4100 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
4101 version_patchlevel_string="version $patchlevel subversion $subversion"
4102 case "$perl_patchlevel" in
4104 *) perl_patchlevel=`echo $perl_patchlevel | sed 's/.* //'`
4105 version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel"
4109 $echo "(You have $package $version_patchlevel_string.)"
4113 : XXX Should be a Configure test for double-dots in filenames.
4114 version=`echo $revision $patchlevel $subversion | \
4115 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4116 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4117 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4120 version=`echo $revision $patchlevel $subversion | \
4121 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4122 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4123 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4126 : Special case the 5.005_xx maintenance series, which used 5.005
4127 : without any subversion label as a subdirectory in $sitelib
4128 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4129 api_versionstring='5.005'
4132 : Do we want threads support and if so, what type
4133 case "$usethreads" in
4134 $define|true|[yY]*) dflt='y';;
4135 *) # Catch case where user specified ithreads or 5005threads but
4136 # forgot -Dusethreads (A.D. 4/2002)
4137 case "$useithreads$use5005threads" in
4138 *$define*) dflt='y';;
4145 Perl can be built to take advantage of threads on some systems.
4146 To do so, Configure can be run with -Dusethreads.
4148 Note that Perl built with threading support runs slightly slower
4149 and uses more memory than plain Perl. The current implementation
4150 is believed to be stable, but it is fairly new, and so should be
4151 treated with caution.
4153 If this doesn't make any sense to you, just accept the default '$dflt'.
4155 rp='Build a threading Perl?'
4158 y|Y) val="$define" ;;
4164 if $test $patchlevel -lt 9; then
4165 case "$usethreads" in
4169 Since release 5.6, Perl has had two different threading implementations,
4170 the newer interpreter-based version (ithreads) with one interpreter per
4171 thread, and the older 5.005 version (5005threads).
4172 The 5005threads version is effectively unmaintained and will probably be
4173 removed in Perl 5.10, so there should be no need to build a Perl using it
4174 unless needed for backwards compatibility with some existing 5.005threads
4178 : Default to ithreads unless overridden on command line or with
4181 case "$use5005threads" in
4182 $define|true|[yY]*) dflt='n';;
4184 case "$useithreads" in
4185 $undef|false|[nN]*) dflt='n';;
4187 rp='Use the newer interpreter-based ithreads?'
4190 y|Y) val="$define" ;;
4195 : Now set use5005threads to the opposite value.
4196 case "$useithreads" in
4197 $define) val="$undef" ;;
4204 useithreads="$undef"
4205 use5005threads="$undef"
4209 case "$useithreads$use5005threads" in
4213 You cannot have both the ithreads and the 5.005 threads enabled
4214 at the same time. Disabling the 5.005 threads since they are
4215 much less stable than the ithreads.
4218 use5005threads="$undef"
4223 : perl-5.9.x and later
4225 if test X"$usethreads" = "X$define"; then
4226 case "$use5005threads" in
4230 5.005 threads has been removed for 5.10. Perl will be built using ithreads.
4237 use5005threads="$undef"
4238 useithreads="$usethreads"
4241 case "$d_oldpthreads" in
4242 '') : Configure tests would be welcome here. For now, assume undef.
4244 *) val="$d_oldpthreads" ;;
4250 : Look for a hint-file generated 'call-back-unit'. If the
4251 : user has specified that a threading perl is to be built,
4252 : we may need to set or change some other defaults.
4253 if $test -f usethreads.cbu; then
4254 echo "Your platform has some specific hints regarding threaded builds, using them..."
4257 case "$usethreads" in
4258 "$define"|true|[yY]*)
4260 (Your platform does not have any specific hints for threaded builds.
4261 Assuming POSIX threads, then.)
4267 : Check if multiplicity is required
4270 Perl can be built so that multiple Perl interpreters can coexist
4271 within the same Perl executable.
4274 case "$useithreads" in
4277 This multiple interpreter support is required for interpreter-based threads.
4281 *) case "$usemultiplicity" in
4282 $define|true|[yY]*) dflt='y';;
4286 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4287 rp='Build Perl for multiplicity?'
4290 y|Y) val="$define" ;;
4298 : Check if morebits is requested
4299 case "$usemorebits" in
4300 "$define"|true|[yY]*)
4301 use64bitint="$define"
4302 uselongdouble="$define"
4303 usemorebits="$define"
4305 *) usemorebits="$undef"
4309 : Determine the C compiler to be used
4315 rp="Use which C compiler?"
4319 : See whether they have no cc but they do have gcc
4321 if $test -f cc.cbu; then
4326 : make some quick guesses about what we are up against
4328 $echo $n "Hmm... $c"
4338 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
4339 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
4341 echo "Looks kind of like an OSF/1 system, but we'll see..."
4343 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4344 xxx=`./loc addbib blurfl $pth`
4345 if $test -f $xxx; then
4346 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4350 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4351 echo "Looks kind of like an extended USG system, but we'll see..."
4353 echo "Looks kind of like a USG system, but we'll see..."
4357 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4358 echo "Looks kind of like a BSD system, but we'll see..."
4362 echo "Looks kind of like a Version 7 system, but we'll see..."
4365 case "$eunicefix" in
4368 There is, however, a strange, musty smell in the air that reminds me of
4369 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4373 : it so happens the Eunice I know will not run shell scripts in Unix format
4377 echo "Congratulations. You aren't running Eunice."
4381 : Detect OS2. The p_ variable is set above in the Head.U unit.
4382 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4383 : semicolon as a patch separator
4388 I have the feeling something is not exactly right, however...don't tell me...
4389 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4390 (Or you may be running DOS with DJGPP.)
4395 if test -f /xenix; then
4396 echo "Actually, this looks more like a XENIX system..."
4401 echo "It's not Xenix..."
4406 if test -f /venix; then
4407 echo "Actually, this looks more like a VENIX system..."
4414 echo "Nor is it Venix..."
4417 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4418 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4421 : Check if we are using GNU gcc and what its version is
4423 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4427 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4429 printf("%s\n", __VERSION__);
4431 printf("%s\n", "1");
4437 if $cc -o try $ccflags $ldflags try.c; then
4438 gccversion=`$run ./try`
4439 case "$gccversion" in
4440 '') echo "You are not using GNU cc." ;;
4441 *) echo "You are using GNU cc $gccversion."
4447 echo "*** WHOA THERE!!! ***" >&4
4448 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4449 case "$knowitall" in
4451 echo " You'd better start hunting for one and let me know about it." >&4
4457 case "$gccversion" in
4458 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4460 case "$gccversion" in
4461 '') gccosandvers='' ;;
4462 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4463 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4465 case "$gccosandvers" in
4466 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4467 $osname$osvers) ;; # looking good
4468 $osname*) cat <<EOM >&4
4470 *** WHOA THERE!!! ***
4472 Your gcc has not been compiled for the exact release of
4473 your operating system ($gccosandvers versus $osname$osvers).
4475 In general it is a good idea to keep gcc synchronized with
4476 the operating system because otherwise serious problems
4477 may ensue when trying to compile software, like Perl.
4479 I'm trying to be optimistic here, though, and will continue.
4480 If later during the configuration and build icky compilation
4481 problems appear (headerfile conflicts being the most common
4482 manifestation), I suggest reinstalling the gcc to match
4483 your operating system release.
4487 *) gccosandvers='' ;; # failed to parse, better be silent
4495 # gcc 3.* complain about adding -Idirectories that they already know about,
4496 # so we will take those off from locincpth.
4497 case "$gccversion" in
4499 echo "main(){}">try.c
4500 for incdir in $locincpth; do
4501 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4502 grep '^c[cp]p*[01]: warning: changing search order '`
4503 if test "X$warn" != X; then
4504 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4510 : What should the include directory be ?
4512 $echo $n "Hmm... $c"
4516 if $test -f /bin/mips && /bin/mips; then
4517 echo "Looks like a MIPS system..."
4518 $cat >usr.c <<'EOCP'
4519 #ifdef SYSTYPE_BSD43
4523 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4524 dflt='/bsd43/usr/include'
4528 mips_type='System V'
4530 $rm -f usr.c usr.out
4531 echo "and you're compiling with the $mips_type compiler and libraries."
4535 echo "Doesn't look like a MIPS system."
4545 case "$xxx_prompt" in
4548 rp='Where are the include files you want to use?'
4556 : see how we invoke the C preprocessor
4558 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4559 cat <<'EOT' >testcpp.c
4565 if test ! -f cppstdin; then
4566 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4567 # AIX cc -E doesn't show the absolute headerfile
4568 # locations but we'll cheat by using the -M flag.
4569 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
4571 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4574 echo "Keeping your $hint cppstdin wrapper."
4577 wrapper=`pwd`/cppstdin
4581 if $test "X$cppstdin" != "X" && \
4582 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4583 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4585 echo "You used to use $cppstdin $cppminus so we'll use that again."
4587 '') echo "But let's see if we can live without a wrapper..." ;;
4589 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4590 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4592 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4595 echo "(However, $cpprun $cpplast does not work, let's see...)"
4603 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4610 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4611 $cc -E <testcpp.c >testcpp.out 2>&1; \
4612 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4613 echo "Yup, it does."
4616 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4617 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4618 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4619 echo "Yup, it does."
4622 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4623 $cc -P <testcpp.c >testcpp.out 2>&1; \
4624 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4625 echo "Yipee, that works!"
4628 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4629 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4630 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4631 echo "At long last!"
4634 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4635 $cpp <testcpp.c >testcpp.out 2>&1; \
4636 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4640 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4641 $cpp - <testcpp.c >testcpp.out 2>&1; \
4642 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4643 echo "Hooray, it works! I was beginning to wonder."
4646 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4647 $wrapper <testcpp.c >testcpp.out 2>&1; \
4648 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4654 rp="No dice. I can't find a C preprocessor. Name one:"
4658 $x_cpp <testcpp.c >testcpp.out 2>&1
4659 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4660 echo "OK, that will do." >&4
4662 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4677 echo "Perhaps can we force $cc -E using a wrapper..."
4678 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4679 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4685 echo "Nope, we'll have to live without it..."
4699 "$wrapper"|'cppstdin') ;;
4700 *) $rm -f $wrapper;;
4702 $rm -f testcpp.c testcpp.out
4704 : Set private lib path
4707 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4712 '') dlist="$loclibpth $plibpth $glibpth";;
4713 *) dlist="$libpth";;
4716 : Now check and see which directories actually exist, avoiding duplicates
4720 if $test -d $xxx; then
4723 *) libpth="$libpth $xxx";;
4729 Some systems have incompatible or broken versions of libraries. Among
4730 the directories listed in the question below, please remove any you
4731 know not to be holding relevant libraries, and add any that are needed.
4732 Say "none" for none.
4743 rp="Directories to use for library searches?"
4750 : compute shared library extension
4753 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4763 On some systems, shared libraries may be available. Answer 'none' if
4764 you want to suppress searching of shared libraries for the remainder
4765 of this configuration.
4768 rp='What is the file extension used for shared libraries?'
4772 : Define several unixisms.
4773 : Hints files or command line option can be used to override them.
4774 : The convoluted testing is in case hints files set either the old
4777 '') case "$exe_ext" in
4779 *) _exe="$exe_ext" ;;
4784 '') case "$lib_ext" in
4791 '') case "$obj_ext" in
4798 '') case "$path_sep" in
4809 rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
4811 : Which makefile gets called first. This is used by make depend.
4812 case "$firstmakefile" in
4813 '') firstmakefile='makefile';;
4816 : Check is we will use socks
4818 $define|true|[yY]*) dflt='y';;
4823 Perl can be built to use the SOCKS proxy protocol library. To do so,
4824 Configure must be run with -Dusesocks. If you use SOCKS you also need
4825 to use the PerlIO abstraction layer, this will be implicitly selected.
4827 If this doesn't make any sense to you, just accept the default '$dflt'.
4829 rp='Build Perl for SOCKS?'
4832 y|Y) val="$define" ;;
4838 : Check for uselongdouble support
4840 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
4843 case "$uselongdouble" in
4844 $define|true|[yY]*) dflt='y';;
4849 Perl can be built to take advantage of long doubles which
4850 (if available) may give more accuracy and range for floating point numbers.
4852 If this doesn't make any sense to you, just accept the default '$dflt'.
4854 rp='Try to use long doubles if available?'
4857 y|Y) val="$define" ;;
4863 case "$uselongdouble" in
4864 true|[yY]*) uselongdouble="$define" ;;
4867 : Look for a hint-file generated 'call-back-unit'. If the
4868 : user has specified that long doubles should be used,
4869 : we may need to set or change some other defaults.
4870 if $test -f uselongdouble.cbu; then
4871 echo "Your platform has some specific hints regarding long doubles, using them..."
4872 . ./uselongdouble.cbu
4874 case "$uselongdouble" in
4877 (Your platform does not have any specific hints for long doubles.)
4883 : Looking for optional libraries
4885 echo "Checking for optional libraries..." >&4
4890 case "$libswanted" in
4891 '') libswanted='c_s';;
4894 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4900 for thisdir in $libpth $xlibpth; do
4901 test -d $thisdir && libspath="$libspath $thisdir"
4903 for thislib in $libswanted; do
4904 for thisdir in $libspath; do
4906 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4907 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
4908 $test -f "$xxx" && eval $libscheck
4909 $test -f "$xxx" && libstyle=shared
4911 if test ! -f "$xxx"; then
4912 xxx=$thisdir/lib$thislib.$so
4913 $test -f "$xxx" && eval $libscheck
4914 $test -f "$xxx" && libstyle=shared
4916 if test ! -f "$xxx"; then
4917 xxx=$thisdir/lib$thislib$_a
4918 $test -f "$xxx" && eval $libscheck
4919 $test -f "$xxx" && libstyle=static
4921 if test ! -f "$xxx"; then
4922 xxx=$thisdir/$thislib$_a
4923 $test -f "$xxx" && eval $libscheck
4924 $test -f "$xxx" && libstyle=static
4926 if test ! -f "$xxx"; then
4927 xxx=$thisdir/lib${thislib}_s$_a
4928 $test -f "$xxx" && eval $libscheck
4929 $test -f "$xxx" && libstyle=static
4930 $test -f "$xxx" && thislib=${thislib}_s
4932 if test ! -f "$xxx"; then
4933 xxx=$thisdir/Slib$thislib$_a
4934 $test -f "$xxx" && eval $libscheck
4935 $test -f "$xxx" && libstyle=static
4937 if $test -f "$xxx"; then
4939 shared) echo "Found -l$thislib (shared)." ;;
4940 static) echo "Found -l$thislib." ;;
4941 *) echo "Found -l$thislib ($libstyle)." ;;
4945 *) dflt="$dflt -l$thislib"
4946 libsfound="$libsfound $xxx"
4948 libsfiles="$libsfiles $yyy"
4949 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
4950 case " $libsdirs " in
4952 *) libsdirs="$libsdirs $yyy" ;;
4959 if $test ! -f "$xxx"; then
4960 echo "No -l$thislib."
4971 ' '|'') dflt='none';;
4976 In order to compile $package on your machine, a number of libraries
4977 are usually needed. Include any other special libraries here as well.
4978 Say "none" for none. The default list is almost always right.
4982 rp="What libraries to use?"
4989 : determine optimization, if desired, or use for debug flag also
4991 ' '|$undef) dflt='none';;
4993 *) dflt="$optimize";;
4997 By default, $package compiles with the -O flag to use the optimizer.
4998 Alternately, you might want to use the symbolic debugger, which uses
4999 the -g flag (on traditional Unix systems). Either flag can be
5000 specified here. To use neither flag, specify the word "none".
5003 rp="What optimizer/debugger flag should be used?"
5007 'none') optimize=" ";;
5010 : Check what DEBUGGING is required from the command line
5011 : -DEBUGGING or -DDEBUGGING or
5012 : -DEBUGGING=both = -g + -DDEBUGGING
5013 : -DEBUGGING=-g or -Doptimize=-g = -g
5014 : -DEBUGGING=none or -UDEBUGGING =
5015 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
5018 *) DEBUGGING=$EBUGGING ;;
5021 case "$DEBUGGING" in
5025 *) optimize="$optimize -g" ;;
5029 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
5037 case "$DEBUGGING" in
5038 both|$define) dflt='-DDEBUGGING'
5041 : argument order is deliberate, as the flag will start with - which set could
5042 : think is an option
5043 checkccflag='check=$1; flag=$2; callback=$3;
5045 echo "Checking if your compiler accepts $flag" 2>&1;
5046 echo "int main(void) { return 0; }" > gcctest.c;
5047 if $cc -O2 $flag -o gcctest gcctest.c 2>gcctest.out && ./gcctest; then
5048 echo "Yes, it does." 2>&1;
5049 if $test -s gcctest.out ; then
5050 echo "But your platform does not like it:";
5055 echo "Leaving current flags $ccflags alone." 2>&1
5057 *) dflt="$dflt $flag";
5063 echo "Nope, it does not, but that is ok." 2>&1;
5067 : We will not override a previous value, but we might want to
5068 : augment a hint file
5070 default|recommended)
5071 case "$gccversion" in
5072 1*) dflt="$dflt -fpcc-struct-return" ;;
5074 case "$optimize:$DEBUGGING" in
5075 *-g*:old) dflt="$dflt -DDEBUGGING";;
5077 case "$gccversion" in
5078 2*) if $test -d /etc/conf/kconfig.d &&
5079 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
5081 # Interactive Systems (ISC) POSIX mode.
5086 case "$gccversion" in
5089 ?*) set strict-aliasing -fno-strict-aliasing
5093 # For gcc, adding -pipe speeds up compilations for some, but apparently
5094 # some assemblers can't read from stdin. (It also slows down compilations
5095 # in other cases, but those are apparently rarer these days.) AD 5/2004.
5096 case "$gccversion" in
5102 # on x86_64 (at least) we require an extra library (libssp) in the
5103 # link command line. This library is not named, so I infer that it is
5104 # an implementation detail that may change. Hence the safest approach
5105 # is to add the flag to the flags passed to the compiler at link time,
5106 # as that way the compiler can do the right implementation dependant
5108 case "$gccversion" in
5109 ?*) set stack-protector -fstack-protector
5116 case "$mips_type" in
5117 *BSD*|'') inclwanted="$locincpth $usrinc";;
5118 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
5120 for thisincl in $inclwanted; do
5121 if $test -d $thisincl; then
5122 if $test x$thisincl != x$usrinc; then
5124 *" -I$thisincl "*);;
5125 *) dflt="$dflt -I$thisincl ";;
5131 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
5133 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5141 *) dflt="$dflt -D$2";;
5145 set signal.h LANGUAGE_C; eval $inctest
5149 ccflags="$ccflags -DSOCKS"
5154 default|recommended) dflt="$ccflags $dflt" ;;
5155 *) dflt="$ccflags";;
5164 Your C compiler may want other flags. For this question you should include
5165 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5166 but you should NOT include libraries or ld flags like -lwhatever. If you
5167 want $package to honor its debug switch, you should include -DDEBUGGING here.
5168 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5170 To use no flags, specify the word "none".
5176 rp="Any additional cc flags?"
5183 : the following weeds options from ccflags that are of no interest to cpp
5185 '') cppflags="$ccflags" ;;
5186 *) cppflags="$cppflags $ccflags" ;;
5188 case "$gccversion" in
5189 1*) cppflags="$cppflags -D__GNUC__"
5191 case "$mips_type" in
5193 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5199 echo "Let me guess what the preprocessor flags are..." >&4
5213 *) ftry="$previous $flag";;
5215 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5216 >cpp1.out 2>/dev/null && \
5217 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5218 >cpp2.out 2>/dev/null && \
5219 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5220 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5222 cppflags="$cppflags $ftry"
5232 *-*) echo "They appear to be: $cppflags";;
5234 $rm -f cpp.c cpp?.out
5238 : flags used in final linking phase
5240 '') if ./venix; then
5246 *-posix*) dflt="$dflt -posix" ;;
5249 *) dflt="$ldflags";;
5251 # See note above about -fstack-protector
5253 *-fstack-protector*)
5255 *-fstack-protector*) ;; # Don't add it again
5256 *) dflt="$dflt -fstack-protector" ;;
5261 : Try to guess additional flags to pick up local libraries.
5262 for thislibdir in $libpth; do
5263 case " $loclibpth " in
5266 *"-L$thislibdir "*) ;;
5267 *) dflt="$dflt -L$thislibdir" ;;
5279 Your C linker may need flags. For this question you should
5280 include -L/whatever and any other flags used by the C linker, but you
5281 should NOT include libraries like -lwhatever.
5283 Make sure you include the appropriate -L/path flags if your C linker
5284 does not normally search all of the directories you specified above,
5287 To use no flags, specify the word "none".
5291 rp="Any additional ld flags (NOT including libraries)?"
5297 rmlist="$rmlist pdp11"
5301 echo "Checking your choice of C compiler and flags for coherency..." >&4
5302 $cat > try.c <<'EOF'
5304 int main() { printf("Ok\n"); return(0); }
5306 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5308 $cat >try.msg <<'EOM'
5309 I've tried to compile and run the following simple program:
5312 $cat try.c >> try.msg
5314 $cat >> try.msg <<EOM
5321 and I got the following output:
5325 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5326 if $sh -c "$run ./try " >>try.msg 2>&1; then
5330 *) echo 'The program compiled OK, but produced no output.' >> try.msg
5333 cat >> try.msg <<'EOQS'
5334 If $libs contains -lsfio, and sfio is mis-configured, then it
5335 sometimes (apparently) runs and exits with a 0 status, but with no
5336 output! It may have to do with sfio's use of _exit vs. exit.
5339 rp="You have a big problem. Shall I abort Configure"
5346 echo "The program compiled OK, but exited with status $?." >>try.msg
5347 rp="You have a problem. Shall I abort Configure"
5351 echo "I can't compile the test program." >>try.msg
5352 rp="You have a BIG problem. Shall I abort Configure"
5358 case "$knowitall" in
5360 echo "(The supplied flags or libraries might be incorrect.)"
5368 *) echo "Ok. Stopping Configure." >&4
5373 n) echo "OK, that should do.";;
5375 $rm_try gcctest gcctest.out
5377 : define a shorthand compile call
5381 case "$usedevel" in $define|true|[yY]*) if $test ! -f "${mc_file}.c"; then
5382 echo "Internal Configure script bug - compiler test file ${mc_file}.c is missing. Please report this to perlbug@perl.org" >&4;
5386 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5387 : define a shorthand compile call for compilations that should be ok.
5391 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5393 : determine filename position in cpp output
5395 echo "Computing filename position in cpp output for #include directives..." >&4
5397 vos) testaccess=-e ;;
5400 echo '#include <stdio.h>' > foo.c
5403 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5404 $grep '^[ ]*#.*stdio\.h' | \
5405 while read cline; do
5408 while $test \$# -gt 0; do
5409 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5414 pos=\`expr \$pos + 1\`
5426 *) pos="${fieldn}th";;
5428 echo "Your cpp writes the filename in the $pos field of the line."
5431 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
5432 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
5435 : locate header file
5440 for usrincdir in $usrinc
5442 if test -f \$usrincdir/\$wanted; then
5443 echo "\$usrincdir/\$wanted"
5447 awkprg='{ print \$$fieldn }'
5448 echo "#include <\$wanted>" > foo\$\$.c
5449 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5450 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5451 while read cline; do
5452 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5454 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5455 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5460 # status = 0: grep returned 0 lines, case statement not executed
5461 # status = 1: headerfile found
5462 # status = 2: while loop executed, no headerfile found
5466 if test \$status -eq 1; then
5473 : define an alternate in-header-list? function
5474 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5475 cont=true; xxf="echo \"<\$1> found.\" >&4";
5476 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5477 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5479 case $# in 4) instead=instead;; *) instead="at last";; esac;
5480 while $test "$cont"; do
5482 var=$2; eval "was=\$$2";
5483 if $test "$xxx" && $test -r "$xxx";
5485 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5488 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5489 set $yyy; shift; shift; yyy=$@;
5490 case $# in 0) cont="";;
5491 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5492 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5493 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5494 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5498 do set $yyy; var=$2; eval "was=\$$2";
5499 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5500 set $yyy; shift; shift; yyy=$@;
5503 : see if stdlib is available
5504 set stdlib.h i_stdlib
5507 : check for lengths of integral types
5511 echo "Checking to see how big your integers are..." >&4
5520 printf("intsize=%d;\n", (int)sizeof(int));
5521 printf("longsize=%d;\n", (int)sizeof(long));
5522 printf("shortsize=%d;\n", (int)sizeof(short));
5527 if eval $compile_ok && $run ./try > /dev/null; then
5529 echo "Your integers are $intsize bytes long."
5530 echo "Your long integers are $longsize bytes long."
5531 echo "Your short integers are $shortsize bytes long."
5535 Help! I can't compile and run the intsize test program: please enlighten me!
5536 (This is probably a misconfiguration in your system or libraries, and
5537 you really ought to fix it. Still, I'll try anyway.)
5541 rp="What is the size of an integer (in bytes)?"
5545 rp="What is the size of a long integer (in bytes)?"
5549 rp="What is the size of a short integer (in bytes)?"
5557 : check for long long
5559 echo "Checking to see if you have long long..." >&4
5560 echo 'int main() { long long x = 7; return 0; }' > try.c
5562 if eval $compile; then
5564 echo "You have long long."
5567 echo "You do not have long long."
5573 : check for length of long long
5574 case "${d_longlong}${longlongsize}" in
5577 echo "Checking to see how big your long longs are..." >&4
5578 $cat >try.c <<'EOCP'
5582 printf("%d\n", (int)sizeof(long long));
5587 if eval $compile_ok; then
5588 longlongsize=`$run ./try`
5589 echo "Your long longs are $longlongsize bytes long."
5593 echo "(I can't seem to compile the test program. Guessing...)"
5594 rp="What is the size of a long long (in bytes)?"
5598 if $test "X$longsize" = "X$longlongsize"; then
5599 echo "(That isn't any different from an ordinary long.)"
5605 : see if inttypes.h is available
5606 : we want a real compile instead of Inhdr because some systems
5607 : have an inttypes.h which includes non-existent headers
5610 #include <inttypes.h>
5612 static int32_t foo32 = 0x12345678;
5616 if eval $compile; then
5617 echo "<inttypes.h> found." >&4
5620 echo "<inttypes.h> NOT found." >&4
5629 echo "Checking to see if you have int64_t..." >&4
5631 #include <sys/types.h>
5632 #$i_inttypes I_INTTYPES
5634 #include <inttypes.h>
5636 int main() { int64_t x = 7; }
5639 if eval $compile; then
5641 echo "You have int64_t."
5644 echo "You do not have int64_t."
5650 : Check if 64bit ints have a quad type
5652 echo "Checking which 64-bit integer type we could use..." >&4
5658 val='"unsigned int"'
5663 *) case "$longsize" in
5667 val='"unsigned long"'
5672 *) case "$d_longlong:$longlongsize" in
5677 val='"unsigned long long"'
5682 *) case "$d_int64_t" in
5701 '') echo "Alas, no 64-bit integer types in sight." >&4
5704 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5709 : Do we want 64bit support
5710 case "$uselonglong" in
5711 "$define"|true|[yY]*)
5714 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5716 use64bitint="$define"
5719 case "$use64bits" in
5720 "$define"|true|[yY]*)
5723 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5725 use64bitint="$define"
5728 case "$use64bitints" in
5729 "$define"|true|[yY]*)
5732 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5734 use64bitint="$define"
5737 case "$use64bitsint" in
5738 "$define"|true|[yY]*)
5741 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5743 use64bitint="$define"
5746 case "$uselonglongs" in
5747 "$define"|true|[yY]*)
5750 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5752 use64bitint="$define"
5755 case "$use64bitsall" in
5756 "$define"|true|[yY]*)
5759 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
5761 use64bitall="$define"
5766 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
5768 case "$use64bitall" in
5769 "$define"|true|[yY]*) use64bitint="$define" ;;
5775 You have natively 64-bit long integers.
5779 *) case "$use64bitint" in
5780 "$define"|true|[yY]*) dflt='y';;
5789 Perl can be built to take advantage of 64-bit integer types
5790 on some systems. To do so, Configure can be run with -Duse64bitint.
5791 Choosing this option will most probably introduce binary incompatibilities.
5793 If this doesn't make any sense to you, just accept the default '$dflt'.
5794 (The default has been chosen based on your configuration.)
5796 rp='Try to use 64-bit integers, if available?'
5799 [yY]*) val="$define" ;;
5807 case "$use64bitall" in
5808 "$define"|true|[yY]*) dflt='y' ;;
5809 *) case "$longsize" in
5817 You may also choose to try maximal 64-bitness. It means using as much
5818 64-bitness as possible on the platform. This in turn means even more
5819 binary incompatibilities. On the other hand, your platform may not
5820 have any more 64-bitness available than what you already have chosen.
5822 If this doesn't make any sense to you, just accept the default '$dflt'.
5823 (The default has been chosen based on your configuration.)
5825 rp='Try to use maximal 64-bit support, if available?'
5828 [yY]*) val="$define" ;;
5833 case "$use64bitall" in
5835 case "$use64bitint" in
5839 Since you have chosen a maximally 64-bit build, I'm also turning on
5840 the use of 64-bit integers.
5842 use64bitint="$define" ;;
5847 : Look for a hint-file generated 'call-back-unit'. If the
5848 : user has specified that a 64-bit perl is to be built,
5849 : we may need to set or change some other defaults.
5850 if $test -f use64bitint.cbu; then
5851 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
5854 case "$use64bitint" in
5855 "$define"|true|[yY]*)
5857 4) case "$archname64" in
5858 '') archname64=64int ;;
5865 : Look for a hint-file generated 'call-back-unit'. If the
5866 : user has specified that a maximally 64-bit perl is to be built,
5867 : we may need to set or change some other defaults.
5868 if $test -f use64bitall.cbu; then
5869 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
5872 case "$use64bitall" in
5873 "$define"|true|[yY]*)
5875 4) case "$archname64" in
5876 ''|64int) archname64=64all ;;
5883 case "$d_quad:$use64bitint" in
5887 *** You have chosen to use 64-bit integers,
5888 *** but none can be found.
5889 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
5890 *** Cannot continue, aborting.
5897 : check for length of double
5899 case "$doublesize" in
5901 echo "Checking to see how big your double precision numbers are..." >&4
5910 printf("%d\n", (int)sizeof(double));
5915 if eval $compile_ok; then
5916 doublesize=`$run ./try`
5917 echo "Your double is $doublesize bytes long."
5920 echo "(I can't seem to compile the test program. Guessing...)"
5921 rp="What is the size of a double precision number (in bytes)?"
5929 : check for long doubles
5931 echo "Checking to see if you have long double..." >&4
5932 echo 'int main() { long double x = 7.0; }' > try.c
5934 if eval $compile; then
5936 echo "You have long double."
5939 echo "You do not have long double."
5945 : check for length of long double
5946 case "${d_longdbl}${longdblsize}" in
5949 echo "Checking to see how big your long doubles are..." >&4
5950 $cat >try.c <<'EOCP'
5954 printf("%d\n", sizeof(long double));
5959 if eval $compile; then
5960 longdblsize=`$run ./try`
5961 echo "Your long doubles are $longdblsize bytes long."
5965 echo "(I can't seem to compile the test program. Guessing...)" >&4
5966 rp="What is the size of a long double (in bytes)?"
5970 if $test "X$doublesize" = "X$longdblsize"; then
5971 echo "That isn't any different from an ordinary double."
5972 echo "I'll keep your setting anyway, but you may see some"
5973 echo "harmless compilation warnings."
5979 : determine the architecture name
5981 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
5982 tarch=`arch`"-$osname"
5983 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
5984 if uname -m > tmparch 2>&1 ; then
5985 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
5986 -e 's/$/'"-$osname/" tmparch`
5994 case "$myarchname" in
5997 echo "(Your architecture name used to be $myarchname.)"
6001 case "$targetarch" in
6003 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
6008 *) dflt="$archname";;
6010 rp='What is your architecture name'
6013 case "$usethreads" in
6015 echo "Threads selected." >&4
6017 *-thread*) echo "...and architecture name already has -thread." >&4
6019 *) archname="$archname-thread"
6020 echo "...setting architecture name to $archname." >&4
6025 case "$usemultiplicity" in
6027 echo "Multiplicity selected." >&4
6029 *-multi*) echo "...and architecture name already has -multi." >&4
6031 *) archname="$archname-multi"
6032 echo "...setting architecture name to $archname." >&4
6037 case "$use64bitint$use64bitall" in
6039 case "$archname64" in
6041 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
6044 case "$use64bitint" in
6045 "$define") echo "64 bit integers selected." >&4 ;;
6047 case "$use64bitall" in
6048 "$define") echo "Maximal 64 bitness selected." >&4 ;;
6051 *-$archname64*) echo "...and architecture name already has $archname64." >&4
6053 *) archname="$archname-$archname64"
6054 echo "...setting architecture name to $archname." >&4
6060 case "$uselongdouble" in
6062 echo "Long doubles selected." >&4
6063 case "$longdblsize" in
6065 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
6069 *-ld*) echo "...and architecture name already has -ld." >&4
6071 *) archname="$archname-ld"
6072 echo "...setting architecture name to $archname." >&4
6079 if $test -f archname.cbu; then
6080 echo "Your platform has some specific hints for architecture name, using them..."
6084 : set the prefixit variable, to compute a suitable default value
6085 prefixit='case "$3" in
6087 case "$oldprefix" in
6088 "") eval "$1=\"\$$2\"";;
6095 ""|" ") eval "$1=\"\$$2\"";;
6101 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
6103 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
6104 /*-$oldprefix/*|\~*-$oldprefix/*)
6105 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
6106 *) eval "$1=\"\$$2\"";;
6110 : determine installation style
6111 : For now, try to deduce it from prefix unless it is already set.
6112 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
6113 case "$installstyle" in
6114 '') case "$prefix" in
6115 *perl*) dflt='lib';;
6116 *) dflt='lib/perl5' ;;
6119 *) dflt="$installstyle" ;;
6121 : Probably not worth prompting for this since we prompt for all
6122 : the directories individually, and the prompt would be too long and
6126 : determine where public executables go
6131 rp='Pathname where the public executables will reside?'
6133 if $test "X$ansexp" != "X$binexp"; then
6137 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6138 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
6139 : this via initialinstalllocation
6142 case "$userelocatableinc" in
6143 $define|true|[yY]*) dflt='y' ;;
6148 Would you like to build Perl so that the installation is relocatable, so that
6149 library paths in @INC are determined relative to the path of the perl binary?
6150 This is not advised for system Perl installs, or if you need to run setid
6151 scripts or scripts under taint mode.
6153 If this doesn't make any sense to you, just accept the default '$dflt'.
6155 rp='Use relocatable @INC?'
6158 y|Y) val="$define" ;;
6161 set userelocatableinc
6164 initialinstalllocation="$binexp"
6165 : Default prefix is now "up one level from where the binaries are"
6166 case "$userelocatableinc" in
6172 installprefixexp=".../.."
6176 : determine where private library files go
6177 : Usual default is /usr/local/lib/perl5/$version.
6178 : Also allow things like /opt/perl/lib/$version, since
6179 : /opt/perl/lib/perl5... would be redundant.
6180 : The default "style" setting is made in installstyle.U
6181 case "$installstyle" in
6182 *lib/perl5*) set dflt privlib lib/$package/$version ;;
6183 *) set dflt privlib lib/$version ;;
6188 There are some auxiliary files for $package that need to be put into a
6189 private library directory that is accessible by everyone.
6194 rp='Pathname where the private library files will reside?'
6199 : set the prefixup variable, to restore leading tilda escape
6200 prefixup='case "$prefixexp" in
6202 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
6205 : determine where public architecture dependent libraries go
6208 : privlib default is /usr/local/lib/$package/$version
6209 : archlib default is /usr/local/lib/$package/$version/$archname
6210 : privlib may have an optional trailing /share.
6211 tdflt=`echo $privlib | $sed 's,/share$,,'`
6212 tdflt=$tdflt/$archname
6221 $spackage contains architecture-dependent library files. If you are
6222 sharing libraries in a heterogeneous environment, you might store
6223 these files in a separate location. Otherwise, you can just include
6224 them with the rest of the public library files.
6229 rp='Where do you want to put the public architecture-dependent libraries?'
6233 if $test X"$archlib" = X"$privlib"; then
6239 : see if setuid scripts can be secure
6242 Some kernels have a bug that prevents setuid #! scripts from being
6243 secure. Some sites have disabled setuid #! scripts because of this.
6245 First let's decide if your kernel supports secure setuid #! scripts.
6246 (If setuid #! scripts would be secure but have been disabled anyway,
6247 don't say that they are secure if asked.)
6252 if $test -d /dev/fd; then
6253 echo "#!$ls" >reflect
6254 chmod +x,u+s reflect
6255 ./reflect >flect 2>&1
6256 if $contains "/dev/fd" flect >/dev/null; then
6257 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6261 If you are not sure if they are secure, I can check but I'll need a
6262 username and password different from the one you are using right now.
6263 If you don't have such a username or don't want me to test, simply
6267 rp='Other username to test security of setuid scripts with?'
6272 case "$d_suidsafe" in
6273 '') echo "I'll assume setuid scripts are *not* secure." >&4
6276 echo "Well, the $hint value is *not* secure." >&4
6278 *) echo "Well, the $hint value *is* secure." >&4
6283 $rm -f reflect flect
6284 echo "#!$ls" >reflect
6285 chmod +x,u+s reflect
6288 echo '"su" will (probably) prompt you for '"$ans's password."
6289 su $ans -c './reflect >flect'
6290 if $contains "/dev/fd" flect >/dev/null; then
6291 echo "Okay, it looks like setuid scripts are secure." >&4
6294 echo "I don't think setuid scripts are secure." >&4
6299 rp='Does your kernel have *secure* setuid scripts?'
6302 [yY]*) val="$define";;
6307 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6308 echo "(That's for file descriptors, not floppy disks.)"
6314 $rm -f reflect flect
6316 : now see if they want to do setuid emulation
6317 if $test $patchlevel -lt 11; then
6320 case "$d_suidsafe" in
6323 echo "No need to emulate SUID scripts since they are secure here." >&4
6327 Some systems have disabled setuid scripts, especially systems where
6328 setuid scripts cannot be secure. On systems where setuid scripts have
6329 been disabled, the setuid/setgid bits on scripts are currently
6330 useless. It is possible for $package to detect those bits and emulate
6331 setuid/setgid in a secure fashion. This emulation will only work if
6332 setuid scripts have been disabled in your kernel.
6336 "$define") dflt=y ;;
6339 rp="Do you want to do setuid/setgid emulation?"
6342 [yY]*) val="$define";;
6354 SUID emulation has been removed for 5.12
6355 Please re-run Configure without -Dd_dosuid
6364 : Find perl5.005 or later.
6365 echo "Looking for a previously installed perl5.005 or later... "
6367 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
6368 : Check if this perl is recent and can load a simple module
6369 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6372 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6382 '') echo "None found. That's ok.";;
6383 *) echo "Using $perl5." ;;
6386 : Set the siteprefix variables
6389 After $package is installed, you may wish to install various
6390 add-on modules and utilities. Typically, these add-ons will
6391 be installed under $prefix with the rest
6392 of this package. However, you may wish to install such add-ons
6393 elsewhere under a different prefix.
6395 If you do not wish to put everything under a single prefix, that's
6396 ok. You will be prompted for the individual locations; this siteprefix
6397 is only used to suggest the defaults.
6399 The default should be fine for most people.
6403 rp='Installation prefix to use for add-on modules and utilities?'
6404 : XXX Here might be another good place for an installstyle setting.
6405 case "$siteprefix" in
6407 *) dflt=$siteprefix ;;
6410 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6412 case "$siteprefix" in
6416 *) oldsiteprefix="$prefix";;
6421 siteprefixexp="$ansexp"
6423 : determine where site specific libraries go.
6424 : Usual default is /usr/local/lib/perl5/site_perl/$version
6425 : The default "style" setting is made in installstyle.U
6426 : XXX No longer works with Prefixit stuff.
6427 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6429 '') case "$installstyle" in
6430 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6431 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6439 The installation process will create a directory for
6440 site-specific extensions and modules. Most users find it convenient
6441 to place all site-specific files in this directory rather than in the
6442 main distribution directory.
6446 rp='Pathname for the site-specific library files?'
6450 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6452 : Determine list of previous versions to include in @INC
6453 $cat > getverlist <<EOPL
6456 \$api_versionstring = "$api_versionstring";
6457 \$version = "$version";
6458 \$stem = "$sitelib_stem";
6459 \$archname = "$archname";
6461 $cat >> getverlist <<'EOPL'
6462 # The list found is store twice for each entry: the original name, and
6463 # the binary broken down version as pack "sss", so sorting is easy and
6464 # unambiguous. This will work for all versions that have a maximum of
6465 # three digit groups, separate by '.'s or '_'s. Names are extended with
6466 # ".0.0" to ensure at least three elements for the pack.
6467 # -- H.Merijn Brand (m)'06 23-10-2006
6469 # Can't have leading @ because metaconfig interprets it as a command!
6470 ;@inc_version_list=();
6471 # XXX Redo to do opendir/readdir?
6474 ;@candidates = map {
6475 [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
6476 ;@candidates = sort { $a->[1] cmp $b->[1]} @candidates;
6482 ($pversion, $aversion, $vsn5005) = map {
6483 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
6484 foreach $d (@candidates) {
6485 if ($d->[1] lt $pversion) {
6486 if ($d->[1] ge $aversion) {
6487 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
6489 elsif ($d->[1] ge $vsn5005) {
6490 unshift(@inc_version_list, grep { -d } $d->[0]);
6494 # Skip newer version. I.e. don't look in
6495 # 5.7.0 if we're installing 5.6.1.
6499 if (@inc_version_list) {
6500 print join(' ', @inc_version_list);
6503 # Blank space to preserve value for next Configure run.
6508 case "$inc_version_list" in
6509 '') if test -x "$perl5$exe_ext"; then
6510 dflt=`$perl5 getverlist`
6515 $undef) dflt='none' ;;
6516 *) eval dflt=\"$inc_version_list\" ;;
6519 ''|' ') dflt=none ;;
6526 In order to ease the process of upgrading, this version of perl
6527 can be configured to use modules built and installed with earlier
6528 versions of perl that were installed under $prefix. Specify here
6529 the list of earlier versions that this version of perl should check.
6530 If Configure detected no earlier versions of perl installed under
6531 $prefix, then the list will be empty. Answer 'none' to tell perl
6532 to not search earlier versions.
6534 The default should almost always be sensible, so if you're not sure,
6535 just accept the default.
6538 rp='List of earlier versions to include in @INC?'
6541 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
6542 *) inc_version_list="$ans" ;;
6544 case "$inc_version_list" in
6546 inc_version_list_init='0'
6547 d_inc_version_list="$undef"
6549 *) inc_version_list_init=`echo $inc_version_list |
6550 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6551 d_inc_version_list="$define"
6556 : see if malloc/malloc.h has to be included
6557 set malloc/malloc.h i_mallocmalloc
6560 : see if this is a malloc.h system
6561 : we want a real compile instead of Inhdr because some systems have a
6562 : malloc.h that just gives a compile error saying to use stdlib.h instead
6567 #$i_mallocmalloc I_MALLOCMALLOC
6568 #ifdef I_MALLOCMALLOC
6569 # include <malloc/malloc.h>
6572 int main () { return 0; }
6575 if eval $compile; then
6576 echo "<malloc.h> found." >&4
6579 echo "<malloc.h> NOT found." >&4
6586 : check for void type
6588 echo "Checking to see how well your C compiler groks the void type..." >&4
6589 case "$voidflags" in
6601 extern void moo(); /* function returning void */
6602 void (*goo)(); /* ptr to func returning void */
6604 void *hue; /* generic ptr */
6617 int main() { sub(); }
6619 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
6620 voidflags=$defvoidused
6621 echo "Good. It appears to support void to the level $package wants.">&4
6622 if $contains warning .out >/dev/null 2>&1; then
6623 echo "However, you might get some warnings that look like this:"
6627 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
6628 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
6629 echo "It supports 1..."
6630 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
6631 echo "It also supports 2..."
6632 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
6634 echo "And it supports 4 but not 8 definitely."
6636 echo "It doesn't support 4..."
6637 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
6639 echo "But it supports 8."
6642 echo "Neither does it support 8."
6646 echo "It does not support 2..."
6647 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
6649 echo "But it supports 4 and 8."
6651 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
6653 echo "And it supports 4 but has not heard about 8."
6655 echo "However it supports 8 but not 4."
6660 echo "There is no support at all for void."
6665 case "$voidflags" in
6668 Support flag bits are:
6669 1: basic void declarations.
6670 2: arrays of pointers to functions returning void.
6671 4: operations between pointers to and addresses of void functions.
6672 8: generic void pointers.
6675 rp="Your void support flags add up to what?"
6682 : check for length of pointer
6686 echo "Checking to see how big your pointers are..." >&4
6687 if test "$voidflags" -gt 7; then
6688 echo '#define VOID_PTR char *' > try.c
6690 echo '#define VOID_PTR void *' > try.c
6700 printf("%d\n", (int)sizeof(VOID_PTR));
6705 if eval $compile_ok; then
6706 ptrsize=`$run ./try`
6707 echo "Your pointers are $ptrsize bytes long."
6710 echo "(I can't seem to compile the test program. Guessing...)" >&4
6711 rp="What is the size of a pointer (in bytes)?"
6718 case "$use64bitall" in
6719 "$define"|true|[yY]*)
6723 *** You have chosen a maximally 64-bit build,
6724 *** but your pointers are only 4 bytes wide.
6725 *** Please rerun Configure without -Duse64bitall.
6730 *** Since you have quads, you could possibly try with -Duse64bitint.
6735 *** Cannot continue, aborting.
6746 : determine whether to use malloc wrapping
6748 case "$usemallocwrap" in
6749 [yY]*|true|$define) dflt='y' ;;
6750 [nN]*|false|$undef) dflt='n' ;;
6751 *) case "$usedevel" in
6752 [yY]*|true|$define) dflt='y' ;;
6757 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
6759 usemallocwrap="$ans"
6762 usemallocwrap="$define" ;;
6764 usemallocwrap="$undef" ;;
6767 : determine which malloc to compile in
6769 case "$usemymalloc" in
6770 [yY]*|true|$define) dflt='y' ;;
6771 [nN]*|false|$undef) dflt='n' ;;
6772 *) case "$ptrsize" in
6778 rp="Do you wish to attempt to use the malloc that comes with $package?"
6784 mallocsrc='malloc.c'
6785 mallocobj="malloc$_o"
6786 d_mymalloc="$define"
6789 : Remove malloc from list of libraries to use
6790 echo "Removing unneeded -lmalloc from library list" >&4
6791 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6794 echo "libs = $libs" >&4
6806 : compute the return types of malloc and free
6808 $cat >malloc.c <<END
6812 #include <sys/types.h>
6826 case "$malloctype" in
6828 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6835 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6839 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6846 echo "Your system uses $freetype free(), it would seem." >&4
6848 : determine where site specific architecture-dependent libraries go.
6849 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6850 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6851 : sitelib may have an optional trailing /share.
6853 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6854 dflt="$dflt/$archname"
6859 set sitearch sitearch none
6863 The installation process will also create a directory for
6864 architecture-dependent site-specific extensions and modules.
6868 rp='Pathname for the site-specific architecture-dependent library files?'
6872 if $test X"$sitearch" = X"$sitelib"; then
6875 d_sitearch="$define"
6878 : Set the vendorprefix variables
6881 The installation process will also create a directory for
6882 vendor-supplied add-ons. Vendors who supply perl with their system
6883 may find it convenient to place all vendor-supplied files in this
6884 directory rather than in the main distribution directory. This will
6885 ease upgrades between binary-compatible maintenance versions of perl.
6887 Of course you may also use these directories in whatever way you see
6888 fit. For example, you might use them to access modules shared over a
6889 company-wide network.
6891 The default answer should be fine for most people.
6892 This causes further questions about vendor add-ons to be skipped
6893 and no vendor-specific directories will be configured for perl.
6896 rp='Do you want to configure vendor-specific add-on directories?'
6897 case "$usevendorprefix" in
6898 define|true|[yY]*) dflt=y ;;
6899 *) : User may have set vendorprefix directly on Configure command line.
6900 case "$vendorprefix" in
6909 rp='Installation prefix to use for vendor-supplied add-ons?'
6910 case "$vendorprefix" in
6912 *) dflt=$vendorprefix ;;
6915 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6917 case "$vendorprefix" in
6921 *) oldvendorprefix="$prefix";;
6925 usevendorprefix="$define"
6927 vendorprefixexp="$ansexp"
6929 *) usevendorprefix="$undef"
6935 : Set the vendorlib variables
6936 case "$vendorprefix" in
6937 '') d_vendorlib="$undef"
6941 *) d_vendorlib="$define"
6942 : determine where vendor-supplied modules go.
6943 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
6944 case "$vendorlib" in
6946 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6947 case "$installstyle" in
6948 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
6949 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
6952 *) dflt="$vendorlib"
6956 rp='Pathname for the vendor-supplied library files?'
6959 vendorlibexp="$ansexp"
6962 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
6966 : Set the vendorarch variables
6967 case "$vendorprefix" in
6968 '') d_vendorarch="$undef"
6972 *) d_vendorarch="$define"
6973 : determine where vendor-supplied architecture-dependent libraries go.
6974 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
6975 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
6976 : vendorlib may have an optional trailing /share.
6977 case "$vendorarch" in
6978 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
6979 dflt="$dflt/$archname"
6981 *) dflt="$vendorarch" ;;
6984 rp='Pathname for vendor-supplied architecture-dependent files?'
6987 vendorarchexp="$ansexp"
6990 prefixvar=vendorarch
6992 if $test X"$vendorarch" = X"$vendorlib"; then
6993 d_vendorarch="$undef"
6995 d_vendorarch="$define"
6998 : Final catch-all directories to search
7001 Lastly, you can have perl look in other directories for extensions and
7002 modules in addition to those already specified.
7003 These directories will be searched after
7007 test X"$vendorlib" != "X" && echo ' ' $vendorlib
7008 test X"$vendorarch" != "X" && echo ' ' $vendorarch
7010 case "$otherlibdirs" in
7011 ''|' ') dflt='none' ;;
7012 *) dflt="$otherlibdirs" ;;
7015 Enter a colon-separated set of extra paths to include in perl's @INC
7016 search path, or enter 'none' for no extra paths.
7020 rp='Colon-separated list of additional directories for perl to search?'
7023 ' '|''|none) otherlibdirs=' ' ;;
7024 *) otherlibdirs="$ans" ;;
7026 case "$otherlibdirs" in
7030 set d_perl_otherlibdirs
7033 : Cruising for prototypes
7035 echo "Checking out function prototypes..." >&4
7036 $cat >prototype.c <<EOCP
7041 int main(int argc, char *argv[]) {
7044 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
7045 echo "Your C compiler appears to support function prototypes."
7048 echo "Your C compiler doesn't seem to understand function prototypes."
7055 : Check if ansi2knr is required
7056 case "$prototype" in
7058 *) ansi2knr='ansi2knr'
7063 This version of $package can only be compiled by a compiler that
7064 understands function prototypes. Unfortunately, your C compiler
7066 doesn't seem to understand them. Sorry about that.
7068 If GNU cc is available for your system, perhaps you could try that instead.
7070 Eventually, we hope to support building Perl with pre-ANSI compilers.
7071 If you would like to help in that effort, please contact <perlbug@perl.org>.
7073 Aborting Configure now.
7080 dflt_dtrace='/usr/sbin/dtrace'
7081 $test -x /usr/bin/dtrace && dflt_dtrace='/usr/bin/dtrace'
7085 Perl can be built to support DTrace on platforms that support it.
7086 DTrace is a diagnosis and performance analysis tool from Sun.
7088 If this doesn't make any sense to you, just accept the default '$dflt'.
7092 case "$usedtrace" in
7098 dflt_dtrace=$usedtrace
7105 rp='Support DTrace if available?'
7108 y|Y) val="$define" ;;
7114 test "X$usedtrace" != "X$define" && break
7117 rp='Where is the dtrace executable?'
7126 if $dtrace -h -s ../perldtrace.d \
7127 -o perldtrace.tmp >/dev/null 2>&1 \
7128 && rm -f perldtrace.tmp
7131 echo "Good: your $dtrace knows about the -h flag."
7135 *** $me: Fatal Error: $dtrace doesn't support -h flag
7137 *** Your installed dtrace doesn't support the -h switch to compile a D
7138 *** program into a C header. Can't continue.
7150 *** $me: Fatal Error: $dtrace not found.
7157 echo "*** $dtrace was not found."
7163 : See if we want extra modules installed
7170 Perl can be built with extra modules or bundles of modules which
7171 will be fetched from the CPAN and installed alongside Perl.
7173 Notice that you will need access to the CPAN; either via the Internet,
7174 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
7175 be asked later to configure the CPAN.pm module which will in turn do
7176 the installation of the rest of the extra modules or bundles.)
7178 Notice also that if the modules require any external software such as
7179 libraries and headers (the libz library and the zlib.h header for the
7180 Compress::Zlib module, for example) you MUST have any such software
7181 already installed, this configuration process will NOT install such
7184 If this doesn't make any sense to you, just accept the default '$dflt'.
7186 rp='Install any extra modules (y or n)?'
7192 Please list any extra modules or bundles to be installed from CPAN,
7193 with spaces between the names. The names can be in any format the
7194 'install' command of CPAN.pm will understand. (Answer 'none',
7195 without the quotes, to install no extra modules or bundles.)
7205 $rm -f ../extras.lst
7207 *) echo "(Saving the list of extras for later...)"
7208 echo "$extras" > ../extras.lst
7216 : determine where html pages for programs go
7217 set html1dir html1dir none
7221 If you wish to install html files for programs in $spackage, indicate
7222 the appropriate directory here. To skip installing html files,
7226 ''|none|$undef|' ') dflt=none ;;
7227 *) dflt=$html1dir ;;
7230 rp="Directory for the main $spackage html pages?"
7234 : Use ' ' for none so value is preserved next time through Configure
7235 $test X"$html1dir" = "X" && html1dir=' '
7237 : determine where html pages for libraries and modules go
7238 set html3dir html3dir none
7242 If you wish to install html files for modules associated with $spackage,
7243 indicate the appropriate directory here. To skip installing html files,
7246 : There is no obvious default. If they have specified html1dir, then
7247 : try to key off that, possibly changing .../html1 into .../html3.
7249 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
7250 *) dflt=$html3dir ;;
7253 rp="Directory for the $spackage module html pages?"
7257 : Use ' ' for none so value is preserved next time through Configure
7258 $test X"$html3dir" = "X" && html3dir=' '
7260 : determine whether to install perl also as /usr/bin/perl
7263 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
7265 Many scripts expect perl to be installed as /usr/bin/perl.
7267 If you want to, I can install the perl you are about to compile
7268 as /usr/bin/perl (in addition to $bin/perl).
7270 if test -f /usr/bin/perl; then
7273 However, please note that because you already have a /usr/bin/perl,
7274 overwriting that with a new Perl would very probably cause problems.
7275 Therefore I'm assuming you don't want to do that (unless you insist).
7278 case "$installusrbinperl" in
7279 "$define"|[yY]*) dflt='y';;
7285 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
7288 case "$installusrbinperl" in
7289 "$undef"|[nN]*) dflt='n';;
7293 rp="Do you want to install perl as /usr/bin/perl?"
7296 [yY]*) val="$define";;
7302 set installusrbinperl
7305 : Check if we are using the GNU C library
7307 echo "Checking for GNU C Library..." >&4
7309 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
7310 alone are insufficient to distinguish different versions, such as
7311 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
7312 libc version 2.1.0. A. Dougherty, June 3, 2002.
7318 # ifdef __GLIBC_MINOR__
7319 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
7320 # include <gnu/libc-version.h>
7321 printf("%s\n", gnu_get_libc_version());
7323 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
7326 printf("%d\n", __GLIBC__);
7335 if eval $compile_ok && $run ./try > glibc.ver; then
7337 gnulibc_version=`$cat glibc.ver`
7338 echo "You are using the GNU C Library version $gnulibc_version"
7342 echo "You are not using the GNU C Library"
7348 : see if nm is to be used to determine whether a symbol is defined or not
7352 case "$d_gnulibc" in
7355 echo "nm probably won't work on the GNU C Library." >&4
7361 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
7363 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
7364 echo "'nm' won't be sufficient on this sytem." >&4
7370 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
7371 if $test $dflt -gt 20; then
7381 true|$define) dflt=y;;
7388 I can use $nm to extract the symbols from your C libraries. This
7389 is a time consuming task which may generate huge output on the disk (up
7390 to 3 megabytes) but that should make the symbols extraction faster. The
7391 alternative is to skip the 'nm' extraction part and to compile a small
7392 test program instead to determine whether each symbol is present. If
7393 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
7394 this may be the best solution.
7396 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
7399 rp="Shall I use $nm to extract C symbols from the libraries?"
7402 [Nn]*) usenm=false;;
7411 : nm options which may be necessary
7413 '') if $test -f /mach_boot; then
7415 elif $test -d /usr/ccs/lib; then
7416 nm_opt='-p' # Solaris (and SunOS?)
7417 elif $test -f /dgux; then
7419 elif $test -f /lib64/rld; then
7420 nm_opt='-p' # 64-bit Irix
7426 : nm options which may be necessary for shared libraries but illegal
7427 : for archive libraries. Thank you, Linux.
7428 case "$nm_so_opt" in
7429 '') case "$myuname" in
7431 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
7432 nm_so_opt='--dynamic'
7439 : Figure out where the libc is located
7442 : get list of predefined functions in a handy place
7447 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
7453 *) for thislib in $libs; do
7456 : Handle C library specially below.
7459 thislib=`echo $thislib | $sed -e 's/^-l//'`
7460 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
7462 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
7464 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
7466 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
7468 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
7470 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
7472 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
7477 libnames="$libnames $try"
7479 *) libnames="$libnames $thislib" ;;
7488 for xxx in $libpth; do
7489 $test -r $1 || set $xxx/libc.$so
7490 : The messy sed command sorts on library version numbers.
7492 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
7493 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
7495 s/[0-9][0-9]*/0000&/g
7496 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
7499 $sort | $sed -e 's/^.* //'`
7502 $test -r $1 || set /usr/ccs/lib/libc.$so
7503 $test -r $1 || set /lib/libsys_s$_a
7509 if $test -r "$1"; then
7510 echo "Your (shared) C library seems to be in $1."
7512 elif $test -r /lib/libc && $test -r /lib/clib; then
7513 echo "Your C library seems to be in both /lib/clib and /lib/libc."
7515 libc='/lib/clib /lib/libc'
7516 if $test -r /lib/syslib; then
7517 echo "(Your math library is in /lib/syslib.)"
7518 libc="$libc /lib/syslib"
7520 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7521 echo "Your C library seems to be in $libc, as you said before."
7522 elif $test -r $incpath/usr/lib/libc$_a; then
7523 libc=$incpath/usr/lib/libc$_a;
7524 echo "Your C library seems to be in $libc. That's fine."
7525 elif $test -r /lib/libc$_a; then
7527 echo "Your C library seems to be in $libc. You're normal."
7529 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
7531 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
7532 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
7533 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
7535 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7537 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7540 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
7542 if $test -r "$tans"; then
7543 echo "Your C library seems to be in $tans, of all places."
7549 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7553 If the guess above is wrong (which it might be if you're using a strange
7554 compiler, or your machine supports multiple models), you can override it here.
7559 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
7561 I can't seem to find your C library. I've looked in the following places:
7564 $sed 's/^/ /' libpath
7567 None of these seems to contain your C library. I need to get its name...
7572 rp='Where is your C library?'
7577 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
7578 set X `cat libnames`
7581 case $# in 1) xxx=file; esac
7582 echo "Extracting names from the following $xxx for later perusal:" >&4
7584 $sed 's/^/ /' libnames >&4
7586 $echo $n "This may take a while...$c" >&4
7590 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
7591 *) $nm $nm_opt $file 2>/dev/null;;
7596 $grep fprintf libc.tmp > libc.ptf
7597 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
7598 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
7600 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
7602 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7604 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
7606 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7608 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
7610 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7612 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
7614 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7616 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
7618 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7620 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
7622 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7624 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
7625 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
7627 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7629 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
7631 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7633 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
7635 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7637 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
7639 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7641 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
7643 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7645 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
7647 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7649 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
7651 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7653 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
7655 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7658 $nm -p $* 2>/dev/null >libc.tmp
7659 $grep fprintf libc.tmp > libc.ptf
7660 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
7661 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
7667 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
7669 if $ar t $libc > libc.tmp && \
7670 $contains '^fprintf$' libc.tmp >/dev/null 2>&1
7672 for thisname in $libnames $libc; do
7673 $ar t $thisname >>libc.tmp
7675 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
7677 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
7678 for thisname in $libnames $libc; do
7679 $ar tv $thisname >>libc.tmp
7680 emximp -o tmp.imp $thisname \
7682 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
7683 < tmp.imp >>libc.tmp
7686 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
7689 echo "$ar didn't seem to work right." >&4
7690 echo "Maybe this is a Cray...trying bld instead..." >&4
7692 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list &&
7695 for thisname in $libnames; do
7697 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
7698 $ar t $thisname >>libc.tmp
7702 echo "That didn't work either. Giving up." >&4
7712 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
7713 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
7715 *) if $test -f /lib/syscalls.exp; then
7717 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
7718 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' \
7719 /lib/syscalls.exp >>libc.list
7725 $rm -f libnames libpath
7727 : see if dld is available
7731 : Check if we are using C++
7733 echo "Checking for C++..." >&4
7734 $cat >try.c <<'EOCP'
7746 if eval $compile_ok && $run ./try; then
7748 echo "You are using a C++ compiler."
7751 echo "You are not using a C++ compiler."
7757 : is a C symbol defined?
7760 -v) tf=libc.tmp; tdc="";;
7761 -a) tf=libc.tmp; tdc="[]";;
7762 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
7764 case "$d_cplusplus" in
7765 $define) extern_C="extern \"C\"" ;;
7766 *) extern_C="extern" ;;
7769 case "$reuseval-$4" in
7771 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
7776 if $test "$runnm" = true; then
7777 if $contains $tlook $tf >/dev/null 2>&1; then
7779 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
7780 echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7781 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
7782 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
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 $libs >/dev/null 2>&1 && tval=true;
7793 $define) tval=true;;
7800 : define an is-in-libc? function
7801 inlibc='echo " "; td=$define; tu=$undef;
7802 sym=$1; var=$2; eval "was=\$$2";
7804 case "$reuseval$was" in
7814 echo "$sym() found." >&4;
7815 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
7817 echo "$sym() NOT found." >&4;
7818 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
7822 $define) echo "$sym() found." >&4;;
7823 *) echo "$sym() NOT found." >&4;;
7827 : see if dlopen exists
7829 xxx_ccflags="$ccflags"
7831 : with g++ one needs -shared to get is-in-libc to work for dlopen
7832 case "$gccversion" in
7834 *) case "$d_cplusplus" in
7835 "$define") ccflags="$ccflags -shared" ;;
7842 ccflags="$xxx_ccflags"
7844 : see if this is a unistd.h system
7845 set unistd.h i_unistd
7848 : determine which dynamic loading, if any, to compile in
7850 dldir="ext/DynaLoader"
7863 $define) dflt='y' ;;
7866 $define) dflt='y' ;;
7868 : Does a dl_xxx.xs file exist for this operating system
7869 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
7872 rp="Do you wish to use dynamic loading?"
7880 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
7881 dflt="$dldir/dl_${osname}.xs"
7882 elif $test "$d_dlopen" = "$define" ; then
7883 dflt="$dldir/dl_dlopen.xs"
7884 elif $test "$i_dld" = "$define" ; then
7885 dflt="$dldir/dl_dld.xs"
7890 *) dflt="$dldir/$dlsrc"
7893 echo "The following dynamic loading files are available:"
7894 : Can not go over to $dldir because getfile has path hard-coded in.
7895 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
7896 rp="Source file to use for dynamic loading"
7902 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
7906 Some systems may require passing special flags to $cc -c to
7907 compile modules that will be used to create a shared library.
7908 To use no flags, say "none".
7911 case "$cccdlflags" in
7912 '') case "$gccversion" in
7913 '') case "$osname" in
7915 next) dflt='none' ;;
7916 irix*) dflt='-KPIC' ;;
7917 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
7918 sunos) dflt='-pic' ;;
7922 *) case "$osname" in
7923 darwin) dflt='none' ;;
7924 linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
7929 *) dflt="$cccdlflags" ;;
7931 rp="Any special flags to pass to $cc -c to compile shared library modules?"
7934 none) cccdlflags=' ' ;;
7935 *) cccdlflags="$ans" ;;
7940 Some systems use ld to create libraries that can be dynamically loaded,
7941 while other systems (such as those using ELF) use $cc.
7945 '') $cat >try.c <<EOM
7946 /* Test for whether ELF binaries are produced */
7958 int i = open("a.out",O_RDONLY);
7961 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
7962 exit(0); /* succeed (yes, it's ELF) */
7967 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
7969 You appear to have ELF support. I'll use $cc to build dynamic libraries.
7974 echo "I'll use ld to build dynamic libraries."
7983 rp="What command should be used to create dynamic libraries?"
7989 Some systems may require passing special flags to $ld to create a
7990 library that can be dynamically loaded. If your ld flags include
7991 -L/other/path options to locate libraries outside your loader's normal
7992 search path, you may need to specify those -L options here as well. To
7993 use no flags, say "none".
7996 case "$lddlflags" in
7997 '') case "$osname" in
7998 beos) dflt='-nostart' ;;
7999 haiku) dflt='-shared' ;;
8001 case "$gccversion" in
8002 '') dflt="$dflt +vnocompatwarnings" ;;
8005 linux|irix*|gnu*) dflt="-shared $optimize" ;;
8006 next) dflt='none' ;;
8007 solaris) dflt='-G' ;;
8008 sunos) dflt='-assert nodefinitions' ;;
8009 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
8013 *) dflt="$lddlflags" ;;
8016 : Try to guess additional flags to pick up local libraries.
8017 : Be careful not to append to a plain 'none'
8021 for thisflag in $ldflags; do
8026 *) dflt="$dflt $thisflag" ;;
8033 ''|' ') dflt='none' ;;
8037 *-fstack-protector*)
8039 *-fstack-protector*) ;; # Don't add it again
8040 *) dflt="$dflt -fstack-protector" ;;
8046 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
8049 none) lddlflags=' ' ;;
8050 *) lddlflags="$ans" ;;
8055 Some systems may require passing special flags to $cc to indicate that
8056 the resulting executable will use dynamic linking. To use no flags,
8060 case "$ccdlflags" in
8061 '') case "$osname" in
8062 linux|hpux|gnu*) dflt='-Wl,-E' ;;
8063 next|sunos) dflt='none' ;;
8067 *) dflt="$ccdlflags" ;;
8069 rp="Any special flags to pass to $cc to use dynamic linking?"
8072 none) ccdlflags=' ' ;;
8073 *) ccdlflags="$ans" ;;
8084 : Do we want a shared libperl?
8088 # No dynamic loading being used, so don't bother even to prompt.
8091 *) case "$useshrplib" in
8092 '') case "$osname" in
8093 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|haiku|cygwin*)
8095 also='Building a shared libperl is required for dynamic loading to work on your system.'
8100 also='Building a shared libperl is needed for MAB support.'
8118 The perl executable is normally obtained by linking perlmain.c with
8119 libperl${_a}, any static extensions (usually just DynaLoader), and
8120 any other libraries needed on this system (such as -lm, etc.). Since
8121 your system supports dynamic loading, it is probably possible to build
8122 a shared libperl.$so. If you will have more than one executable linked
8123 to libperl.$so, this will significantly reduce the size of each
8124 executable, but it may have a noticeable effect on performance. The
8125 default is probably sensible for your system.
8129 rp="Build a shared libperl.$so (y/n)"
8133 useshrplib='true' ;;
8134 *) useshrplib='false' ;;
8139 case "$useshrplib" in
8141 case "$userelocatableinc" in
8143 echo "Cannot build with both -Duserelocatableinc and -Duseshrplib" >&4
8144 echo "See INSTALL for an explanation why that won't work." >&4
8150 # Figure out a good name for libperl.so. Since it gets stored in
8151 # a version-specific architecture-dependent library, the version
8152 # number isn't really that important, except for making cc/ld happy.
8154 # A name such as libperl.so.10.1
8155 majmin="libperl.$so.$patchlevel.$subversion"
8156 # A name such as libperl.so.100
8157 majonly=`echo $patchlevel $subversion |
8158 $awk '{printf "%d%02d", $1, $2}'`
8159 majonly=libperl.$so.$majonly
8160 # I'd prefer to keep the os-specific stuff here to a minimum, and
8161 # rely on figuring it out from the naming of libc.
8162 case "${osname}${osvers}" in
8165 # XXX How handle the --version stuff for MAB?
8167 linux*|gnu*) # ld won't link with a bare -lperl otherwise.
8170 cygwin*) # ld links now against the dll directly
8171 majmin="cygperl5_${patchlevel}_${subversion}.${so}"
8172 majonly=`echo $patchlevel $subversion |
8173 $awk '{printf "%03d%03d", $1, $2}'`
8174 majonly=cygperl5.$majonly.$so
8177 *) # Try to guess based on whether libc has major.minor.
8179 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8180 *libc.$so.[0-9]*) dflt=$majonly ;;
8181 *) dflt=libperl.$so ;;
8191 I need to select a good name for the shared libperl. If your system uses
8192 library names with major and minor numbers, then you might want something
8193 like $majmin. Alternatively, if your system uses a single version
8194 number for shared libraries, then you might want to use $majonly.
8195 Or, your system might be quite happy with a simple libperl.$so.
8197 Since the shared libperl will get installed into a version-specific
8198 architecture-dependent directory, the version number of the shared perl
8199 library probably isn't important, so the default should be o.k.
8202 rp='What name do you want to give to the shared libperl?'
8205 echo "Ok, I'll use $libperl"
8208 libperl="libperl${_a}"
8212 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8216 WARNING: Use of the shrpdir variable for the installation location of
8217 the shared $libperl is not supported. It was never documented and
8218 will not work in this version. Let me (perlbug@perl.org)
8219 know of any problems this may cause.
8225 But your current setting of $shrpdir is
8226 the default anyway, so it's harmless.
8231 Further, your current attempted setting of $shrpdir
8232 conflicts with the value of $archlibexp/CORE
8233 that installperl will use.
8240 # How will the perl executable find the installed shared $libperl?
8241 # Add $xxx to ccdlflags.
8242 # If we can't figure out a command-line option, use $shrpenv to
8243 # set env LD_RUN_PATH. The main perl makefile uses this.
8244 shrpdir=$archlibexp/CORE
8247 if "$useshrplib"; then
8250 # We'll set it in Makefile.SH...
8255 freebsd|mirbsd|netbsd|openbsd|interix|dragonfly)
8256 xxx="-Wl,-R$shrpdir"
8258 bsdos|linux|irix*|dec_osf|gnu*)
8259 xxx="-Wl,-rpath,$shrpdir"
8262 # next doesn't like the default...
8265 # beos doesn't like the default, either.
8268 # Haiku doesn't like the default, either.
8271 # hpux doesn't like the default, either.
8272 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8275 # cygwin needs only ldlibpth
8278 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8284 # Only add $xxx if it isn't already in ccdlflags.
8285 case " $ccdlflags " in
8287 *) ccdlflags="$ccdlflags $xxx"
8290 Adding $xxx to the flags
8291 passed to $ld so that the perl executable will find the
8292 installed shared $libperl.
8300 # Fix ccdlflags in AIX for building external extensions.
8301 # (For building Perl itself bare -bE:perl.exp is needed,
8302 # Makefile.SH takes care of this.)
8304 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8306 # Respect a hint or command-line value.
8308 '') shrpenv="$tmp_shrpenv" ;;
8310 case "$ldlibpthname" in
8311 '') ldlibpthname=LD_LIBRARY_PATH ;;
8312 none) ldlibpthname='' ;;
8315 : determine where manual pages are on this system
8319 syspath='/usr/share/man/man1 /usr/man/man1'
8320 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8321 syspath="$syspath /usr/man/u_man/man1"
8322 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8323 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8324 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8325 sysman=`./loc . /usr/man/man1 $syspath`
8328 if $test -d "$sysman"; then
8329 echo "System manual is in $sysman." >&4
8331 echo "Could not find manual pages in source form." >&4
8334 : determine where manual pages go
8335 set man1dir man1dir none
8339 $spackage has manual pages available in source form.
8343 echo "However, you don't have nroff, so they're probably useless to you."
8345 '') man1dir="none";;
8348 echo "If you don't want the manual sources installed, answer 'none'."
8353 lookpath="$prefixexp/share/man/man1"
8354 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8355 lookpath="$lookpath $prefixexp/man/p_man/man1"
8356 lookpath="$lookpath $prefixexp/man/u_man/man1"
8357 lookpath="$lookpath $prefixexp/man/man.1"
8359 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8360 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8370 rp="Where do the main $spackage manual pages (source) go?"
8372 if $test "X$man1direxp" != "X$ansexp"; then
8383 : What suffix to use on installed man pages
8390 rp="What suffix should be used for the main $spackage man pages?"
8392 '') case "$man1dir" in
8406 *) dflt="$man1ext";;
8413 : see if we can have long filenames
8415 first=123456789abcdef
8417 if (echo hi >$first) 2>/dev/null; then
8418 if $test -f 123456789abcde; then
8419 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8422 echo 'You can have filenames longer than 14 characters.'>&4
8427 You can't have filenames longer than 14 chars.
8428 You can't even think about them!
8434 $rm -rf 123456789abcde*
8436 : determine where library module manual pages go
8437 set man3dir man3dir none
8441 $spackage has manual pages for many of the library modules.
8447 However, you don't have nroff, so they're probably useless to you.
8450 '') man3dir="none";;
8454 case "$d_flexfnam" in
8457 However, your system can't handle the long file names like File::Basename.3.
8460 '') man3dir="none";;
8464 echo "If you don't want the manual sources installed, answer 'none'."
8465 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8467 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8468 if $test -d "$privlib/man/man3"; then
8471 WARNING: Previous versions of perl installed man3 pages into
8472 $privlib/man/man3. This version will suggest a
8473 new default of $dflt.
8477 rp='Do you wish to preserve the old behavior?(y/n)'
8480 y*) dflt="$privlib/man/man3" ;;
8485 *) dflt="$man3dir" ;;
8492 rp="Where do the $package library man pages (source) go?"
8502 : What suffix to use on installed man pages
8508 rp="What suffix should be used for the $package library man pages?"
8510 '') case "$man3dir" in
8524 *) dflt="$man3ext";;
8531 : see if we have to deal with yellow pages, now NIS.
8532 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8533 if $test -f /usr/etc/nibindd; then
8535 echo "I'm fairly confident you're on a NeXT."
8537 rp='Do you get the hosts file via NetInfo?'
8546 y*) hostcat='nidump hosts .';;
8547 *) case "$hostcat" in
8548 nidump*) hostcat='';;
8558 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8566 rp='Are you getting the hosts file via yellow pages?'
8569 y*) hostcat='ypcat hosts';;
8570 *) hostcat='cat /etc/hosts';;
8576 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8579 '') test -f /etc/group && groupcat='cat /etc/group';;
8582 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8585 : now get the host name
8587 echo "Figuring out host name..." >&4
8588 case "$myhostname" in
8590 echo 'Maybe "hostname" will work...'
8591 if tans=`sh -c hostname 2>&1` ; then
8599 if $test "$cont"; then
8601 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8602 if tans=`cat /etc/systemid 2>&1` ; then
8604 phostname='cat /etc/systemid'
8605 echo "Whadyaknow. Xenix always was a bit strange..."
8608 elif $test -r /etc/systemid; then
8609 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8612 if $test "$cont"; then
8613 echo 'No, maybe "uuname -l" will work...'
8614 if tans=`sh -c 'uuname -l' 2>&1` ; then
8616 phostname='uuname -l'
8618 echo 'Strange. Maybe "uname -n" will work...'
8619 if tans=`sh -c 'uname -n' 2>&1` ; then
8621 phostname='uname -n'
8623 echo 'Oh well, maybe I can mine it out of whoami.h...'
8624 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8625 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8626 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8628 case "$myhostname" in
8629 '') echo "Does this machine have an identity crisis or something?"
8632 echo "Well, you said $myhostname before..."
8633 phostname='echo $myhostname';;
8639 case "$myhostname" in
8640 '') myhostname=noname ;;
8642 : you do not want to know about this
8647 if $test "$myhostname" ; then
8649 rp='Your host name appears to be "'$myhostname'".'" Right?"
8657 : bad guess or no guess
8658 while $test "X$myhostname" = X ; do
8660 rp="Please type the (one word) name of your host:"
8665 : translate upper to lower if necessary
8666 case "$myhostname" in
8668 echo "(Normalizing case in your host name)"
8669 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8673 case "$myhostname" in
8675 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8676 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8677 echo "(Trimming domain name from host name--host name is now $myhostname)"
8679 *) case "$mydomain" in
8682 test "X$hostcat" = "Xypcat hosts" &&
8683 ypmatch "$myhostname" hosts 2>/dev/null |\
8684 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8687 test "X$hostcat" != "X" &&
8688 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8689 /[ ]$myhostname[ . ]/p" > hosts
8692 if $test -f hosts; then
8693 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8694 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8695 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8696 hosts | $sort | $uniq | \
8697 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8698 case `$echo X$dflt` in
8699 X*\ *) echo "(Several hosts in the database matched hostname)"
8702 X.) echo "(You do not have fully-qualified names in the hosts database)"
8706 echo "(I cannot locate a hosts database anywhere)"
8711 tans=`./loc resolv.conf X /etc /usr/etc`
8712 if $test -f "$tans"; then
8713 echo "(Attempting domain name extraction from $tans)"
8714 dflt=.`$sed -n -e 's/ / /g' \
8715 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8718 .) dflt=.`$sed -n -e 's/ / /g' \
8719 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8727 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8728 dflt=.`sh -c domainname 2>/dev/null`
8731 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8735 case "$dflt$osname" in
8736 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
8737 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
8741 .) echo "(Lost all hope -- silly guess then)"
8747 *) dflt="$mydomain";;
8751 rp="What is your domain name?"
8761 : translate upper to lower if necessary
8764 echo "(Normalizing case in your domain name)"
8765 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
8769 : a little sanity check here
8770 case "$phostname" in
8773 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
8774 $myhostname$mydomain|$myhostname) ;;
8776 case "$phostname" in
8778 echo "(That doesn't agree with your whoami.h file, by the way.)"
8781 echo "(That doesn't agree with your $phostname command, by the way.)"
8789 : determine the e-mail address of the user who is running us
8792 I need to get your e-mail address in Internet format if possible, i.e.
8793 something like user@host.domain. Please answer accurately since I have
8794 no easy means to double check it. The default value provided below
8795 is most probably close to reality but may not be valid from outside
8796 your organization...
8800 while test "$cont"; do
8802 '') dflt="$cf_by@$myhostname$mydomain";;
8803 *) dflt="$cf_email";;
8805 rp='What is your e-mail address?'
8811 rp='Address does not look like an Internet one. Use it anyway?'
8825 : Ask e-mail of administrator
8828 If you or somebody else will be maintaining perl at your site, please
8829 fill in the correct e-mail address here so that they may be contacted
8830 if necessary. Currently, the "perlbug" program included with perl
8831 will send mail to this address in addition to perlbug@perl.org. You may
8832 enter "none" for no administrator.
8835 case "$perladmin" in
8836 '') dflt="$cf_email";;
8837 *) dflt="$perladmin";;
8839 rp='Perl administrator e-mail address'
8843 : determine whether to only install version-specific parts.
8846 Do you want to install only the version-specific parts of the perl
8847 distribution? Usually you do *not* want to do this.
8849 case "$versiononly" in
8850 "$define"|[Yy]*|true) dflt='y' ;;
8853 rp="Do you want to install only the version-specific parts of perl?"
8856 [yY]*) val="$define";;
8862 case "$versiononly" in
8863 "$define") inc_version_list=''
8864 inc_version_list_init=0
8868 : figure out how to guarantee perl startup
8869 : XXX Note that this currently takes advantage of the bug that binexp ignores
8870 : the Configure -Dinstallprefix setting, which in turn means that under
8871 : relocatable @INC, initialinstalllocation is what binexp started as.
8872 case "$startperl" in
8874 case "$sharpbang" in
8878 I can use the #! construct to start perl on your system. This will
8879 make startup of perl scripts faster, but may cause problems if you
8880 want to share those scripts and perl is not in a standard place
8881 ($initialinstalllocation/perl) on all your platforms. The alternative
8882 is to force a shell by starting the script with a single ':' character.
8885 case "$versiononly" in
8886 "$define") dflt="$initialinstalllocation/perl$version";;
8887 *) dflt="$initialinstalllocation/perl";;
8889 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
8892 none) startperl=": # use perl";;
8893 *) startperl="#!$ans"
8894 if $test 30 -lt `echo "$ans" | wc -c`; then
8897 WARNING: Some systems limit the #! command to 32 characters.
8898 If you experience difficulty running Perl scripts with #!, try
8899 installing Perl in a directory with a shorter pathname.
8905 *) startperl=": # use perl"
8910 echo "I'll use $startperl to start perl scripts."
8912 : figure best path for perl in scripts
8915 case "$versiononly" in
8916 "$define") perlpath="$initialinstalllocation/perl$version";;
8917 *) perlpath="$initialinstalllocation/perl";;
8919 case "$startperl" in
8924 I will use the "eval 'exec'" idiom to start Perl on your system.
8925 I can use the full path of your Perl binary for this purpose, but
8926 doing so may cause problems if you want to share those scripts and
8927 Perl is not always in a standard place ($initialinstalllocation/perl).
8930 dflt="$initialinstalllocation/perl"
8931 rp="What path shall I use in \"eval 'exec'\"?"
8938 case "$startperl" in
8940 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
8943 : determine where public executable scripts go
8944 set scriptdir scriptdir
8946 case "$scriptdir" in
8949 : guess some guesses
8950 $test -d /usr/share/scripts && dflt=/usr/share/scripts
8951 $test -d /usr/share/bin && dflt=/usr/share/bin
8952 $test -d /usr/local/script && dflt=/usr/local/script
8953 $test -d /usr/local/scripts && dflt=/usr/local/scripts
8954 $test -d $prefixexp/script && dflt=$prefixexp/script
8958 *) dflt="$scriptdir"
8963 Some installations have a separate directory just for executable scripts so
8964 that they can mount it across multiple architectures but keep the scripts in
8965 one spot. You might, for example, have a subdirectory of /usr/share for this.
8966 Or you might just lump your scripts in with all your other executables.
8970 rp='Where do you keep publicly executable scripts?'
8972 if $test "X$ansexp" != "X$scriptdirexp"; then
8978 : A little fix up for an irregularly named variable.
8979 installscript="$installscriptdir"
8981 : determine where add-on public executables go
8983 '') dflt=$siteprefix/bin ;;
8987 rp='Pathname where the add-on public executables should be installed?'
8992 : determine where add-on html pages go
8993 : There is no standard location, so try to copy the previously-selected
8994 : directory structure for the core html pages.
8995 case "$sitehtml1dir" in
8996 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8997 *) dflt=$sitehtml1dir ;;
9000 ''|' ') dflt=none ;;
9003 rp='Pathname where the site-specific html pages should be installed?'
9005 prefixvar=sitehtml1dir
9008 : determine where add-on library html pages go
9009 : There is no standard location, so try to copy the previously-selected
9010 : directory structure for the core html pages.
9011 case "$sitehtml3dir" in
9012 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9013 *) dflt=$sitehtml3dir ;;
9016 ''|' ') dflt=none ;;
9019 rp='Pathname where the site-specific library html pages should be installed?'
9021 prefixvar=sitehtml3dir
9024 : determine where add-on manual pages go
9025 case "$siteman1dir" in
9026 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
9027 *) dflt=$siteman1dir ;;
9030 ''|' ') dflt=none ;;
9033 rp='Pathname where the site-specific manual pages should be installed?'
9035 prefixvar=siteman1dir
9038 : determine where add-on library man pages go
9039 case "$siteman3dir" in
9040 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
9041 *) dflt=$siteman3dir ;;
9044 ''|' ') dflt=none ;;
9047 rp='Pathname where the site-specific library manual pages should be installed?'
9049 prefixvar=siteman3dir
9052 : determine where add-on public executable scripts go
9053 case "$sitescript" in
9054 '') dflt=$siteprefix/script
9055 $test -d $dflt || dflt=$sitebin ;;
9056 *) dflt="$sitescript" ;;
9059 rp='Pathname where add-on public executable scripts should be installed?'
9061 prefixvar=sitescript
9064 : Check if faststdio is requested and available
9065 case "$usefaststdio" in
9066 $define|true|[yY]*|'')
9067 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
9077 Perl can be built to use 'fast stdio', which means using the stdio
9078 library but also directly manipulating the stdio buffers to enable
9079 faster I/O. Using stdio is better for backward compatibility (especially
9080 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
9081 interface has been preferred instead of stdio.
9083 If this doesn't make any sense to you, just accept the default '$dflt'.
9085 rp='Use the "fast stdio" if available?'
9088 y|Y) val="$define" ;;
9095 : define an is-a-typedef? function
9096 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9098 "") inclist="sys/types.h";;
9100 eval "varval=\$$var";
9104 for inc in $inclist; do
9105 echo "#include <$inc>" >>temp.c;
9107 echo "#ifdef $type" >> temp.c;
9108 echo "printf(\"We have $type\");" >> temp.c;
9109 echo "#endif" >> temp.c;
9110 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9111 if $contains $type temp.E >/dev/null 2>&1; then
9117 *) eval "$var=\$varval";;
9120 : define an is-a-typedef? function that prompts if the type is not available.
9121 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9123 "") inclist="sys/types.h";;
9125 eval "varval=\$$var";
9129 for inc in $inclist; do
9130 echo "#include <$inc>" >>temp.c;
9132 echo "#ifdef $type" >> temp.c;
9133 echo "printf(\"We have $type\");" >> temp.c;
9134 echo "#endif" >> temp.c;
9135 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9137 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
9138 if $contains $type temp.E >/dev/null 2>&1; then
9139 echo "$type found." >&4;
9142 echo "$type NOT found." >&4;
9148 *) eval "$var=\$varval";;
9151 : see what type lseek is declared as in the kernel
9152 rp="What is the type used for lseek's offset on this system?"
9153 set off_t lseektype long stdio.h sys/types.h
9157 echo "Checking to see how big your file offsets are..." >&4
9159 #include <sys/types.h>
9163 printf("%d\n", (int)sizeof($lseektype));
9168 if eval $compile_ok; then
9169 lseeksize=`$run ./try`
9170 echo "Your file offsets are $lseeksize bytes long."
9174 echo "(I can't seem to compile the test program. Guessing...)"
9175 rp="What is the size of your file offsets (in bytes)?"
9181 : see what type file positions are declared as in the library
9182 rp="What is the type for file position used by fsetpos()?"
9183 set fpos_t fpostype long stdio.h sys/types.h
9186 : Check size for Fpos_t
9189 *_t) zzz="$fpostype" ;;
9192 echo "Checking the size of $zzz..." >&4
9194 #include <sys/types.h>
9201 printf("%d\n", (int)sizeof($fpostype));
9206 if eval $compile_ok; then
9210 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9213 echo "Your $zzz is $fpossize bytes long."
9219 echo "(I can't compile the test program. Guessing...)" >&4
9220 rp="What is the size of your file positions (in bytes)?"
9225 : Check for large file support
9226 # Backward compatibility (uselfs is deprecated).
9228 "$define"|true|[yY]*)
9231 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9233 uselargefiles="$define"
9237 case "$lseeksize:$fpossize" in
9240 You can have files larger than 2 gigabytes.
9243 *) case "$uselargefiles" in
9244 "$undef"|false|[nN]*) dflt='n' ;;
9249 Perl can be built to understand large files (files larger than 2 gigabytes)
9250 on some systems. To do so, Configure can be run with -Duselargefiles.
9252 If this doesn't make any sense to you, just accept the default '$dflt'.
9254 rp='Try to understand large files, if available?'
9257 y|Y) val="$define" ;;
9264 : Look for a hint-file generated 'call-back-unit'. If the
9265 : user has specified that a large files perl is to be built,
9266 : we may need to set or change some other defaults.
9267 if $test -f uselargefiles.cbu; then
9268 echo "Your platform has some specific hints regarding large file builds, using them..."
9269 . ./uselargefiles.cbu
9271 case "$uselargefiles" in
9273 if $test -f uselargefiles.cbu; then
9275 echo "Rechecking to see how big your file offsets are..." >&4
9277 #include <sys/types.h>
9281 printf("%d\n", (int)sizeof($lseektype));
9286 if eval $compile_ok; then
9287 lseeksize=`$run ./try`
9288 $echo "Your file offsets are now $lseeksize bytes long."
9292 echo "(I can't seem to compile the test program. Guessing...)"
9293 rp="What is the size of your file offsets (in bytes)?"
9298 *_t) zzz="$fpostype" ;;
9301 $echo $n "Rechecking the size of $zzz...$c" >&4
9303 #include <sys/types.h>
9310 printf("%d\n", (int)sizeof($fpostype));
9315 if eval $compile_ok; then
9320 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9323 echo " $fpossize bytes." >&4
9329 echo "(I can't compile the test program. Guessing...)" >&4
9330 rp="What is the size of your file positions (in bytes)?"
9339 : Check if we want perlio
9342 : Set the vendorbin variables
9343 case "$vendorprefix" in
9344 '') d_vendorbin="$undef"
9348 *) d_vendorbin="$define"
9349 : determine where vendor-supplied executables go.
9350 case "$vendorbin" in
9351 '') dflt=$vendorprefix/bin ;;
9352 *) dflt="$vendorbin" ;;
9355 rp='Pathname for the vendor-supplied executables directory?'
9358 vendorbinexp="$ansexp"
9364 : Set the vendorhtml1dir variables
9365 case "$vendorprefix" in
9366 '') vendorhtml1dir=''
9367 vendorhtml1direxp=''
9369 *) : determine where vendor-supplied html pages go.
9370 : There is no standard location, so try to copy the previously-selected
9371 : directory structure for the core html pages.
9372 : XXX Better default suggestions would be welcome.
9373 case "$vendorhtml1dir" in
9374 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9375 *) dflt=$vendorhtml1dir ;;
9378 ''|' ') dflt=none ;;
9381 rp='Pathname for the vendor-supplied html pages?'
9383 vendorhtml1dir="$ans"
9384 vendorhtml1direxp="$ansexp"
9387 : Use ' ' for none so value is preserved next time through Configure
9388 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9389 prefixvar=vendorhtml1dir
9392 : Set the vendorhtml3dir variables
9393 case "$vendorprefix" in
9394 '') vendorhtml3dir=''
9395 vendorhtml3direxp=''
9397 *) : determine where vendor-supplied module html pages go.
9398 : There is no standard location, so try to copy the previously-selected
9399 : directory structure for the core html pages.
9400 : XXX Better default suggestions would be welcome.
9401 case "$vendorhtml3dir" in
9402 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9403 *) dflt=$vendorhtml3dir ;;
9406 ''|' ') dflt=none ;;
9409 rp='Pathname for the vendor-supplied html pages?'
9411 vendorhtml3dir="$ans"
9412 vendorhtml3direxp="$ansexp"
9415 : Use ' ' for none so value is preserved next time through Configure
9416 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9417 prefixvar=vendorhtml3dir
9420 : Set the vendorman1dir variables
9421 case "$vendorprefix" in
9422 '') vendorman1dir=''
9425 *) : determine where vendor-supplied manual pages go.
9426 case "$vendorman1dir" in
9427 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9428 *) dflt=$vendorman1dir ;;
9431 ''|' ') dflt=none ;;
9434 rp='Pathname for the vendor-supplied manual section 1 pages?'
9436 vendorman1dir="$ans"
9437 vendorman1direxp="$ansexp"
9440 : Use ' ' for none so value is preserved next time through Configure
9441 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9442 prefixvar=vendorman1dir
9445 : Set the vendorman3dir variables
9446 case "$vendorprefix" in
9447 '') vendorman3dir=''
9450 *) : determine where vendor-supplied module manual pages go.
9451 case "$vendorman3dir" in
9452 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9453 *) dflt=$vendorman3dir ;;
9456 ''|' ') dflt=none ;;
9459 rp='Pathname for the vendor-supplied manual section 3 pages?'
9461 vendorman3dir="$ans"
9462 vendorman3direxp="$ansexp"
9465 : Use ' ' for none so value is preserved next time through Configure
9466 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9467 prefixvar=vendorman3dir
9470 : Set the vendorscript variables
9471 case "$vendorprefix" in
9472 '') d_vendorscript="$undef"
9476 *) d_vendorscript="$define"
9477 : determine where vendor-supplied scripts go.
9478 case "$vendorscript" in
9479 '') dflt=$vendorprefix/script
9480 $test -d $dflt || dflt=$vendorbin ;;
9481 *) dflt="$vendorscript" ;;
9485 The installation process will create a directory for
9486 vendor-supplied scripts.
9490 rp='Pathname for the vendor-supplied scripts directory?'
9493 vendorscriptexp="$ansexp"
9496 prefixvar=vendorscript
9499 : script used to emit important warnings
9502 if test \$# -gt 0; then
9507 echo "*** WARNING:" >&4
9508 sed -e 's/^/*** /' <msg >&4
9510 cat msg >>config.msg
9511 echo " " >>config.msg
9517 : see which of string.h or strings.h is needed
9519 strings=`./findhdr string.h`
9520 if $test "$strings" && $test -r "$strings"; then
9521 echo "Using <string.h> instead of <strings.h>." >&4
9525 strings=`./findhdr strings.h`
9526 if $test "$strings" && $test -r "$strings"; then
9527 echo "Using <strings.h> instead of <string.h>." >&4
9529 ./warn "No string header found -- You'll surely have problems."
9535 "$undef") strings=`./findhdr strings.h`;;
9536 *) strings=`./findhdr string.h`;;
9539 : see if qgcvt exists
9543 : Check print/scan long double stuff
9546 if $test X"$d_longdbl" = X"$define"; then
9548 echo "Checking how to print long doubles..." >&4
9550 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
9551 $cat >try.c <<'EOCP'
9552 #include <sys/types.h>
9556 printf("%.3f\n", d);
9560 if eval $compile; then
9564 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
9565 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
9566 echo "We will use %f."
9572 if $test X"$sPRIfldbl" = X; then
9573 $cat >try.c <<'EOCP'
9574 #include <sys/types.h>
9577 long double d = 123.456;
9578 printf("%.3Lf\n", d);
9582 if eval $compile; then
9586 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
9587 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
9588 echo "We will use %Lf."
9594 if $test X"$sPRIfldbl" = X; then
9595 $cat >try.c <<'EOCP'
9596 #include <sys/types.h>
9599 long double d = 123.456;
9600 printf("%.3llf\n", d);
9604 if eval $compile; then
9608 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
9609 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
9610 echo "We will use %llf."
9616 if $test X"$sPRIfldbl" = X; then
9617 $cat >try.c <<'EOCP'
9618 #include <sys/types.h>
9621 long double d = 123.456;
9622 printf("%.3lf\n", d);
9626 if eval $compile; then
9630 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
9631 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
9632 echo "We will use %lf."
9638 if $test X"$sPRIfldbl" = X; then
9639 echo "Cannot figure out how to print long doubles." >&4
9641 sSCNfldbl=$sPRIfldbl # expect consistency
9648 case "$sPRIfldbl" in
9649 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
9650 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
9651 d_SCNfldbl="$undef";
9653 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
9654 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
9655 d_SCNfldbl="$define";
9659 : Check how to convert floats to strings.
9661 if test "X$d_Gconvert" = X; then
9664 echo "Checking for an efficient way to convert floats to strings."
9666 case "$uselongdouble" in
9667 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
9669 case "$d_longdbl" in
9670 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
9672 case "$d_PRIgldbl" in
9673 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
9677 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
9678 char *myname = "gconvert";
9681 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
9682 char *myname = "gcvt";
9685 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
9686 char *myname = "qgcvt";
9687 #define DOUBLETYPE long double
9690 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9692 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
9694 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
9697 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
9699 char *myname = "sprintf";
9703 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9704 #define DOUBLETYPE long double
9706 #define DOUBLETYPE double
9718 # include <string.h>
9720 # include <strings.h>
9723 int checkit(char *expect, char *got)
9725 if (strcmp(expect, got)) {
9726 printf("%s oddity: Expected %s, got %s\n",
9727 myname, expect, got);
9737 /* This must be 1st test on (which?) platform */
9738 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
9739 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
9740 checkit("0.1", buf);
9742 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
9743 checkit("0.01", buf);
9745 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
9746 checkit("0.001", buf);
9748 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
9749 checkit("0.0001", buf);
9751 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
9752 if (strlen(buf) > 5)
9753 checkit("9e-005", buf); /* for Microsoft ?? */
9755 checkit("9e-05", buf);
9757 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
9760 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
9761 checkit("1.1", buf);
9763 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
9764 checkit("1.01", buf);
9766 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
9767 checkit("1.001", buf);
9769 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
9770 checkit("1.0001", buf);
9772 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
9773 checkit("1.00001", buf);
9775 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
9776 checkit("1.000001", buf);
9778 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
9781 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
9784 /* Some Linux gcvt's give 1.e+5 here. */
9785 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
9786 checkit("100000", buf);
9788 /* Some Linux gcvt's give -1.e+5 here. */
9789 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
9790 checkit("-100000", buf);
9792 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
9793 checkit("123.456", buf);
9795 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
9796 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
9797 /* 34 should be enough to scare even long double
9798 * places into using the e notation. */
9799 if (strlen(buf) > 5)
9800 checkit("1e+034", buf); /* for Microsoft */
9802 checkit("1e+34", buf);
9804 /* For Perl, if you add additional tests here, also add them to
9805 * t/base/num.t for benefit of platforms not using Configure or
9806 * overriding d_Gconvert */
9811 : first add preferred functions to our list
9813 for xxx_convert in $gconvert_preference; do
9814 case $xxx_convert in
9815 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
9816 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
9819 : then add any others
9820 for xxx_convert in gconvert gcvt sprintf; do
9823 *) xxx_list="$xxx_list $xxx_convert" ;;
9827 case "$d_longdbl$uselongdouble" in
9829 : again, add preferred functions to our list first
9831 for xxx_convert in $gconvert_ld_preference; do
9832 case $xxx_convert in
9833 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9834 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
9837 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
9838 for xxx_convert in qgcvt sprintf $xxx_list; do
9839 case "$xxx_ld_list" in
9840 $xxx_convert*|*" $xxx_convert"*) ;;
9841 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9844 : if sprintf cannot do long doubles, move it to the end
9845 if test "$d_PRIgldbl" != "$define"; then
9846 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
9848 : if no qgcvt, remove it
9849 if test "$d_qgcvt" != "$define"; then
9850 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
9853 xxx_list="$xxx_ld_list"
9857 for xxx_convert in $xxx_list; do
9858 echo "Trying $xxx_convert..."
9859 $rm -f try try$_o core
9860 set try -DTRY_$xxx_convert
9861 if eval $compile; then
9862 echo "$xxx_convert() found." >&4
9864 echo "I'll use $xxx_convert to convert floats into a string." >&4
9867 echo "...But $xxx_convert didn't work as I expected."
9871 echo "$xxx_convert NOT found." >&4
9875 if test X$xxx_convert = X; then
9876 echo "*** WHOA THERE!!! ***" >&4
9877 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
9881 case "$xxx_convert" in
9882 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
9883 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
9884 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
9885 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
9886 "$define$define$define")
9887 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
9888 "$define$define$undef")
9889 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
9890 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
9898 : see if _fwalk exists
9902 : Initialize h_fcntl
9905 : Initialize h_sysfile
9908 : access call always available on UNIX
9912 : locate the flags for 'access()'
9916 $cat >access.c <<EOCP
9917 #include <sys/types.h>
9922 #include <sys/file.h>
9935 : check sys/file.h first, no particular reason here
9936 if $test `./findhdr sys/file.h` && \
9937 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
9939 echo "<sys/file.h> defines the *_OK access constants." >&4
9940 elif $test `./findhdr fcntl.h` && \
9941 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
9943 echo "<fcntl.h> defines the *_OK access constants." >&4
9944 elif $test `./findhdr unistd.h` && \
9945 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
9946 echo "<unistd.h> defines the *_OK access constants." >&4
9948 echo "I can't find the four *_OK access constants--I'll use mine." >&4
9954 : see if accessx exists
9955 set accessx d_accessx
9958 : see if aintl exists
9962 : see if alarm exists
9966 : see if 64bit time functions exists
9968 set ctime64 d_ctime64
9971 set localtime64 d_localtime64
9974 set gmtime64 d_gmtime64
9977 set mktime64 d_mktime64
9980 set difftime64 d_difftime64
9983 set asctime64 d_asctime64
9986 : see if POSIX threads are available
9987 set pthread.h i_pthread
9990 : define a function to check prototypes
9991 $cat > protochk <<EOSH
9994 optimize="$optimize"
9996 prototype="$prototype"
9999 usethreads=$usethreads
10000 i_pthread=$i_pthread
10001 pthread_h_first=$pthread_h_first
10004 $cat >> protochk <<'EOSH'
10009 while test $# -ge 2; do
10011 $define) echo "#include <$2>" >> try.c ;;
10012 literal) echo "$2" >> try.c ;;
10014 # Extra magic for the benefit of systems that need pthread.h
10015 # to be included early to correctly detect threadsafe functions.
10016 # Such functions must guarantee themselves, though, that the usethreads
10017 # and i_pthread have been defined, before calling protochk.
10018 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
10019 echo "#include <pthread.h>" >> try.c
10024 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
10025 cat >> try.c <<'EOCP'
10026 #ifdef CAN_PROTOTYPE
10027 #define _(args) args
10032 echo "$foo" >> try.c
10033 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
10034 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
10040 $eunicefix protochk
10042 : Define hasproto macro for Configure internal use
10043 hasproto='varname=$1; func=$2; shift; shift;
10044 while $test $# -ge 2; do
10046 $define) echo "#include <$2>";;
10050 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
10051 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
10052 echo "$func() prototype found.";
10055 echo "$func() prototype NOT found.";
10062 : see if sys/types.h has to be included
10063 set sys/types.h i_systypes
10066 : see if sys/select.h has to be included
10067 set sys/select.h i_sysselct
10070 : Define hasfield macro for Configure internal use
10071 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
10072 while $test $# -ge 2; do
10074 $define) echo "#include <$2>";;
10078 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
10080 if eval $compile; then
10089 : see if we should include time.h, sys/time.h, or both
10091 if test "X$timeincl" = X; then
10092 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
10093 $echo $n "I'm now running the test program...$c"
10095 #include <sys/types.h>
10100 #ifdef SYSTIMEKERNEL
10103 #include <sys/time.h>
10106 #include <sys/select.h>
10108 #$i_stdlib I_STDLIB
10110 #include <stdlib.h>
10116 struct timeval bar;
10119 struct timezone tzp;
10121 if (foo.tm_sec == foo.tm_sec)
10124 if (bar.tv_sec == bar.tv_sec)
10131 for s_timezone in '-DS_TIMEZONE' ''; do
10133 for s_timeval in '-DS_TIMEVAL' ''; do
10134 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10135 for i_time in '' '-DI_TIME'; do
10136 for i_systime in '-DI_SYSTIME' ''; do
10139 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10140 if eval $compile; then
10141 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
10145 $echo $n "Succeeded with $flags$c"
10157 *SYSTIMEKERNEL*) i_systimek="$define"
10158 timeincl=`./findhdr sys/time.h`
10159 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10160 *) i_systimek="$undef";;
10163 *I_TIME*) i_time="$define"
10164 timeincl=`./findhdr time.h`" $timeincl"
10165 echo "We'll include <time.h>." >&4;;
10166 *) i_time="$undef";;
10169 *I_SYSTIME*) i_systime="$define"
10170 timeincl=`./findhdr sys/time.h`" $timeincl"
10171 echo "We'll include <sys/time.h>." >&4;;
10172 *) i_systime="$undef";;
10176 : see if struct tm knows about tm_zone
10177 case "$i_systime$i_time" in
10180 echo "Checking to see if your struct tm has tm_zone field..." >&4
10181 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
10189 case "$d_tm_tm_zone" in
10190 "$define") echo "Yes, it does." ;;
10191 *) echo "No, it doesn't." ;;
10193 : see if struct tm knows about tm_gmtoff
10194 case "$i_systime$i_time" in
10197 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
10198 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
10206 case "$d_tm_tm_gmtoff" in
10207 "$define") echo "Yes, it does." ;;
10208 *) echo "No, it doesn't." ;;
10211 : see if asctime_r exists
10212 set asctime_r d_asctime_r
10214 case "$d_asctime_r" in
10216 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10217 case "$d_asctime_r_proto:$usethreads" in
10218 ":define") d_asctime_r_proto=define
10219 set d_asctime_r_proto asctime_r $hdrs
10223 case "$d_asctime_r_proto" in
10225 case "$asctime_r_proto" in
10226 ''|0) try='char* asctime_r(const struct tm*, char*);'
10227 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SB ;;
10229 case "$asctime_r_proto" in
10230 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
10231 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SBI ;;
10233 case "$asctime_r_proto" in
10234 ''|0) try='int asctime_r(const struct tm*, char*);'
10235 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SB ;;
10237 case "$asctime_r_proto" in
10238 ''|0) try='int asctime_r(const struct tm*, char*, int);'
10239 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SBI ;;
10241 case "$asctime_r_proto" in
10242 ''|0) d_asctime_r=undef
10244 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
10245 * ) case "$asctime_r_proto" in
10246 REENTRANT_PROTO*) ;;
10247 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
10249 echo "Prototype: $try" ;;
10252 *) case "$usethreads" in
10253 define) echo "asctime_r has no prototype, not using it." >&4 ;;
10260 *) asctime_r_proto=0
10264 : see if atolf exists
10268 : see if atoll exists
10272 : Look for GCC-style attribute format
10273 case "$d_attribute_format" in
10276 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
10277 $cat >attrib.c <<'EOCP'
10279 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
10281 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10282 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10283 echo "Your C compiler doesn't support __attribute__((format))."
10286 echo "Your C compiler supports __attribute__((format))."
10290 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10294 *) val="$d_attribute_format" ;;
10296 set d_attribute_format
10300 : Look for GCC-style attribute format with null format allowed
10301 case "$d_printf_format_null" in
10302 '') case "$d_attribute_format" in
10305 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
10306 $cat >attrib.c <<EOCP
10308 #$i_stdlib I_STDLIB
10310 #include <stdlib.h>
10312 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
10313 int null_printf (char* pat,...) { return (int)pat; }
10314 int main () { exit(null_printf(NULL)); }
10316 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
10317 : run the executable in case it produces a run-time warning
10318 if $run ./attrib >>attrib.out 2>&1; then
10319 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10320 echo "Your C compiler doesn't allow __printf__ format to be null."
10323 echo "Your C compiler allows __printf__ format to be null."
10327 echo "Your C compiler executable failed with __printf__ format null."
10331 echo "Your C compiler fails with __printf__ format null."
10338 *) val="$d_printf_format_null" ;;
10340 set d_printf_format_null
10344 : Look for GCC-style attribute malloc
10345 case "$d_attribute_malloc" in
10348 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
10349 $cat >attrib.c <<'EOCP'
10351 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
10353 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10354 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10355 echo "Your C compiler doesn't support __attribute__((malloc))."
10358 echo "Your C compiler supports __attribute__((malloc))."
10362 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10366 *) val="$d_attribute_malloc" ;;
10368 set d_attribute_malloc
10372 : Look for GCC-style attribute nonnull
10373 case "$d_attribute_nonnull" in
10376 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
10377 $cat >attrib.c <<'EOCP'
10379 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
10381 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10382 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10383 echo "Your C compiler doesn't support __attribute__((nonnull))."
10386 echo "Your C compiler supports __attribute__((nonnull))."
10390 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10394 *) val="$d_attribute_nonnull" ;;
10396 set d_attribute_nonnull
10400 : Look for GCC-style attribute noreturn
10401 case "$d_attribute_noreturn" in
10404 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
10405 $cat >attrib.c <<'EOCP'
10407 void fall_over_dead( void ) __attribute__((noreturn));
10409 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10410 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10411 echo "Your C compiler doesn't support __attribute__((noreturn))."
10414 echo "Your C compiler supports __attribute__((noreturn))."
10418 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10422 *) val="$d_attribute_noreturn" ;;
10424 set d_attribute_noreturn
10428 : Look for GCC-style attribute pure
10429 case "$d_attribute_pure" in
10432 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
10433 $cat >attrib.c <<'EOCP'
10435 int square( int n ) __attribute__((pure));
10437 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10438 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10439 echo "Your C compiler doesn't support __attribute__((pure))."
10442 echo "Your C compiler supports __attribute__((pure))."
10446 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10450 *) val="$d_attribute_pure" ;;
10452 set d_attribute_pure
10456 : Look for GCC-style attribute unused
10457 case "$d_attribute_unused" in
10460 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
10461 $cat >attrib.c <<'EOCP'
10463 int do_something( int dummy __attribute__((unused)), int n );
10465 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10466 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10467 echo "Your C compiler doesn't support __attribute__((unused))."
10470 echo "Your C compiler supports __attribute__((unused))."
10474 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10478 *) val="$d_attribute_unused" ;;
10480 set d_attribute_unused
10484 : Look for GCC-style attribute deprecated
10485 case "$d_attribute_deprecated" in
10488 echo "Checking whether your compiler can handle __attribute__((deprecated)) ..." >&4
10489 $cat >attrib.c <<'EOCP'
10491 int I_am_deprecated(void) __attribute__((deprecated));
10493 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10494 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10495 echo "Your C compiler doesn't support __attribute__((deprecated))."
10498 echo "Your C compiler supports __attribute__((deprecated))."
10502 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10506 *) val="$d_attribute_deprecated" ;;
10508 set d_attribute_deprecated
10512 : Look for GCC-style attribute warn_unused_result
10513 case "$d_attribute_warn_unused_result" in
10516 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
10517 $cat >attrib.c <<'EOCP'
10519 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
10521 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10522 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10523 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
10526 echo "Your C compiler supports __attribute__((warn_unused_result))."
10530 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10534 *) val="$d_attribute_warn_unused_result" ;;
10536 set d_attribute_warn_unused_result
10540 : see if bcmp exists
10544 : see if bcopy exists
10548 : see if getpgrp exists
10549 set getpgrp d_getpgrp
10552 case "$d_getpgrp" in
10555 echo "Checking to see which flavor of getpgrp is in use..."
10557 #$i_unistd I_UNISTD
10558 #include <sys/types.h>
10560 # include <unistd.h>
10562 #$i_stdlib I_STDLIB
10564 #include <stdlib.h>
10568 if (getuid() == 0) {
10569 printf("(I see you are running Configure as super-user...)\n");
10572 #ifdef TRY_BSD_PGRP
10573 if (getpgrp(1) == 0)
10582 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10583 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
10585 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10586 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
10589 echo "I can't seem to compile and run the test program."
10591 xxx="a USG one, i.e. you use getpgrp()."
10593 # SVR4 systems can appear rather BSD-ish.
10594 case "$i_unistd" in
10596 xxx="a BSD one, i.e. you use getpgrp(pid)."
10600 xxx="probably a USG one, i.e. you use getpgrp()."
10605 echo "Assuming your getpgrp is $xxx" >&4
10614 : see if setpgrp exists
10615 set setpgrp d_setpgrp
10618 case "$d_setpgrp" in
10621 echo "Checking to see which flavor of setpgrp is in use..."
10623 #$i_unistd I_UNISTD
10624 #include <sys/types.h>
10626 # include <unistd.h>
10628 #$i_stdlib I_STDLIB
10630 #include <stdlib.h>
10634 if (getuid() == 0) {
10635 printf("(I see you are running Configure as super-user...)\n");
10638 #ifdef TRY_BSD_PGRP
10639 if (-1 == setpgrp(1, 1))
10642 if (setpgrp() != -1)
10648 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10649 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
10651 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10652 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
10655 echo "(I can't seem to compile and run the test program.)"
10657 xxx="a USG one, i.e. you use setpgrp()."
10659 # SVR4 systems can appear rather BSD-ish.
10660 case "$i_unistd" in
10662 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
10666 xxx="probably a USG one, i.e. you use setpgrp()."
10671 echo "Assuming your setpgrp is $xxx" >&4
10680 : Look for GCC-style __builtin_choose_expr
10681 case "$d_builtin_choose_expr" in
10684 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
10685 $cat >try.c <<'EOCP'
10686 #include <assert.h>
10687 #include <stdlib.h>
10690 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
10693 assert( SYRINX(1) == 2112 );
10694 assert( SYRINX(1) != 5150 );
10695 assert( SYRINX(0) == 5150 );
10696 assert( SYRINX(0) != 2112 );
10697 puts( "All good!" );
10703 if eval $compile && $run ./try; then
10704 echo "Your C compiler supports __builtin_choose_expr."
10707 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10711 *) val="$d_builtin_choose_expr" ;;
10714 set d_builtin_choose_expr
10718 : Look for GCC-style __builtin_expect
10719 case "$d_builtin_expect" in
10722 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
10723 $cat >try.c <<'EOCP'
10726 if ( __builtin_expect(n, 0) ) n = 1;
10727 /* Remember shell exit code truth is 0, C truth is non-zero */
10732 if eval $compile && $run ./try; then
10733 echo "Your C compiler supports __builtin_expect."
10736 echo "Your C compiler doesn't seem to understand __builtin_expect."
10740 *) val="$d_builtin_expect" ;;
10743 set d_builtin_expect
10747 : see if bzero exists
10751 : see if stdarg is available
10753 if $test `./findhdr stdarg.h`; then
10754 echo "<stdarg.h> found." >&4
10757 echo "<stdarg.h> NOT found." >&4
10761 : see if varags is available
10763 if $test `./findhdr varargs.h`; then
10764 echo "<varargs.h> found." >&4
10766 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
10769 : set up the varargs testing programs
10770 $cat > varargs.c <<EOP
10772 #include <stdarg.h>
10775 #include <varargs.h>
10779 int f(char *p, ...)
10793 p = va_arg(ap, char *);
10799 $cat > varargs <<EOP
10801 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
10810 : now check which varargs header should be included
10815 if `./varargs I_STDARG`; then
10817 elif `./varargs I_VARARGS`; then
10822 if `./varargs I_VARARGS`; then
10829 echo "I could not find the definition for va_dcl... You have problems..." >&4
10830 val="$undef"; set i_stdarg; eval $setvar
10831 val="$undef"; set i_varargs; eval $setvar
10836 case "$i_varhdr" in
10838 val="$define"; set i_stdarg; eval $setvar
10839 val="$undef"; set i_varargs; eval $setvar
10842 val="$undef"; set i_stdarg; eval $setvar
10843 val="$define"; set i_varargs; eval $setvar
10846 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
10850 : see if the Compiler supports C99 variadic macros
10851 case "$i_stdarg$i_stdlib" in
10853 echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
10856 #include <stdarg.h>
10858 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
10862 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
10868 if eval $compile && $run ./try 2>&1 >/dev/null; then
10869 case "`$run ./try`" in
10871 echo "You have C99 variadic macros." >&4
10872 d_c99_variadic_macros="$define"
10875 echo "You don't have functional C99 variadic macros." >&4
10876 d_c99_variadic_macros="$undef"
10880 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
10881 d_c99_variadic_macros="$undef"
10886 echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
10887 d_c99_variadic_macros="$undef"
10891 : see if signal is declared as pointer to function returning int or void
10893 xxx=`./findhdr signal.h`
10894 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
10895 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10896 echo "You have int (*signal())() instead of void." >&4
10898 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10899 echo "You have void (*signal())()." >&4
10901 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
10902 echo "You have int (*signal())() instead of void." >&4
10904 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
10905 echo "You have void (*signal())()." >&4
10908 case "$d_voidsig" in
10910 echo "I can't determine whether signal handler returns void or int..." >&4
10912 rp="What type does your signal handler return?"
10915 v*) val="$define";;
10919 echo "As you already told me, signal handler returns void." >&4
10922 *) echo "As you already told me, signal handler returns int." >&4
10929 case "$d_voidsig" in
10930 "$define") signal_t="void";;
10931 *) signal_t="int";;
10935 : check for ability to cast large floats to 32-bit ints.
10937 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
10938 if $test "$intsize" -ge 4; then
10945 #$i_stdlib I_STDLIB
10947 #include <stdlib.h>
10949 #include <sys/types.h>
10950 #include <signal.h>
10951 $signal_t blech(int s) { exit(3); }
10958 signal(SIGFPE, blech);
10960 /* Don't let compiler optimize the test away. Store the number
10961 in a writable string for gcc to pass to sscanf under HP-UX.
10963 sprintf(str, "2147483647");
10964 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
10968 /* x86 processors will probably give 0x8000 0000, which is a
10969 sign change. We don't want that. We want to mimic SPARC
10970 behavior here, which is to preserve the sign and give
10973 if (i32 != ($xxx) f)
10979 if eval $compile_ok; then
10983 echo "(I can't seem to compile the test program--assuming it can't)"
10988 echo "Yup, it can."
10991 echo "Nope, it can't."
10998 : check for ability to cast negative floats to unsigned
11000 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
11003 #$i_stdlib I_STDLIB
11005 #include <stdlib.h>
11007 #include <sys/types.h>
11008 #include <signal.h>
11009 $signal_t blech(int s) { exit(7); }
11010 $signal_t blech_in_list(int s) { exit(4); }
11011 unsigned long dummy_long(unsigned long p) { return p; }
11012 unsigned int dummy_int(unsigned int p) { return p; }
11013 unsigned short dummy_short(unsigned short p) { return p; }
11017 unsigned long along;
11019 unsigned short ashort;
11023 /* Frustrate gcc-2.7.2's optimizer which failed this test with
11024 a direct f = -123. assignment. gcc-2.8.0 reportedly
11025 optimized the whole file away
11027 /* Store the number in a writable string for gcc to pass to
11028 sscanf under HP-UX.
11030 sprintf(str, "-123");
11031 sscanf(str, "%lf", &f); /* f = -123.; */
11033 signal(SIGFPE, blech);
11034 along = (unsigned long)f;
11035 aint = (unsigned int)f;
11036 ashort = (unsigned short)f;
11037 if (along != (unsigned long)-123)
11039 if (aint != (unsigned int)-123)
11041 if (ashort != (unsigned short)-123)
11043 sprintf(str, "1073741824.");
11044 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
11047 along = (unsigned long)f;
11048 if (along != 0x80000000)
11052 along = (unsigned long)f;
11053 if (along != 0x7fffffff)
11057 along = (unsigned long)f;
11058 if (along != 0x80000001)
11062 signal(SIGFPE, blech_in_list);
11063 sprintf(str, "123.");
11064 sscanf(str, "%lf", &f); /* f = 123.; */
11065 along = dummy_long((unsigned long)f);
11066 aint = dummy_int((unsigned int)f);
11067 ashort = dummy_short((unsigned short)f);
11068 if (along != (unsigned long)123)
11070 if (aint != (unsigned int)123)
11072 if (ashort != (unsigned short)123)
11079 if eval $compile_ok; then
11083 echo "(I can't seem to compile the test program--assuming it can't)"
11086 case "$castflags" in
11088 echo "Yup, it can."
11091 echo "Nope, it can't."
11098 : see if vprintf exists
11100 if set vprintf val -f d_vprintf; eval $csym; $val; then
11101 echo 'vprintf() found.' >&4
11104 #$i_stdarg I_STDARG /* Only one of these can be defined by i_varhrd */
11105 #$i_varargs I_VARARGS
11107 #$i_stdlib I_STDLIB
11108 #$i_unistd I_UNISTD
11111 # include <stdarg.h>
11112 #else /* I_VARARGS */
11113 # include <varargs.h>
11117 # include <unistd.h>
11121 # include <stdlib.h>
11124 #include <stdio.h> /* vsprintf prototype */
11127 void xxx(int n, ...)
11132 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11134 int main() { xxx(1, "foo"); }
11136 #else /* I_VARARGS */
11144 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11146 int main() { xxx("foo"); }
11152 if eval $compile_ok; then
11153 if $run ./try; then
11154 echo "Your vsprintf() returns (int)." >&4
11157 echo "Your vsprintf() returns (char*)." >&4
11161 echo 'I am unable to compile the vsprintf() test program.' >&4
11162 # We shouldn't get here. If we do, assume the standard signature,
11163 # not the old BSD one.
11164 echo 'Guessing that vsprintf() returns (int).' >&4
11168 echo 'vprintf() NOT found.' >&4
11179 : see if chown exists
11183 : see if chroot exists
11184 set chroot d_chroot
11187 : see if chsize exists
11188 set chsize d_chsize
11191 : see if class exists
11195 : see if clearenv exists
11196 set clearenv d_clearenv
11199 : Define hasstruct macro for Configure internal use
11200 hasstruct='varname=$1; struct=$2; shift; shift;
11201 while $test $# -ge 2; do
11203 $define) echo "#include <$2>";;
11207 echo "int main () { struct $struct foo; }" >> try.c;
11209 if eval $compile; then
11218 : see whether socket exists
11222 $echo $n "Hmm... $c" >&4
11223 if set socket val -f d_socket; eval $csym; $val; then
11224 echo "Looks like you have Berkeley networking support." >&4
11226 if set setsockopt val -f; eval $csym; $val; then
11229 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
11230 d_oldsock="$define"
11233 if $contains socklib libc.list >/dev/null 2>&1; then
11234 echo "Looks like you have Berkeley networking support." >&4
11236 : we will have to assume that it supports the 4.2 BSD interface
11239 echo "You don't have Berkeley networking in libc$_a..." >&4
11240 if test "X$d_socket" = "X$define"; then
11241 echo "...but you seem to believe that you have sockets." >&4
11243 for net in net socket
11245 if test -f /usr/lib/lib$net$_a; then
11246 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
11247 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
11248 if $contains socket libc.list >/dev/null 2>&1; then
11253 echo "...but the Wollongong group seems to have hacked it in." >&4
11254 sockethdr="-I/usr/netinclude"
11257 echo "Found Berkeley sockets interface in lib$net." >&4
11258 if $contains setsockopt libc.list >/dev/null 2>&1; then
11261 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
11262 d_oldsock="$define"
11268 if test "X$d_socket" != "X$define"; then
11269 echo "or anywhere else I see." >&4
11277 : see if socketpair exists
11278 set socketpair d_sockpair
11283 echo "Checking the availability sa_len in the sock struct ..." >&4
11285 #include <sys/types.h>
11286 #include <sys/socket.h>
11288 struct sockaddr sa;
11289 return (sa.sa_len);
11293 set try; if eval $compile; then
11296 set d_sockaddr_sa_len; eval $setvar
11300 echo "Checking the availability sin6_scope_id in struct sockaddr_in6 ..." >&4
11302 #include <sys/types.h>
11303 #include <sys/socket.h>
11304 #include <netinet/in.h>
11306 struct sockaddr_in6 sin6;
11307 return (sin6.sin6_scope_id);
11311 set try; if eval $compile; then
11314 set d_sin6_scope_id; eval $setvar
11318 echo "Checking the availability of certain socket constants..." >&4
11319 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
11320 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
11322 #include <sys/types.h>
11323 #include <sys/socket.h>
11329 set try; if eval $compile; then
11332 set d_${enum}; eval $setvar
11336 : see if this is a sys/uio.h system
11337 set sys/uio.h i_sysuio
11340 : Check for cmsghdr support
11342 echo "Checking to see if your system supports struct cmsghdr..." >&4
11343 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
11345 case "$d_cmsghdr_s" in
11346 "$define") echo "Yes, it does." ;;
11347 *) echo "No, it doesn't." ;;
11351 : check for const keyword
11353 echo 'Checking to see if your C compiler knows about "const"...' >&4
11354 $cat >const.c <<'EOCP'
11355 typedef struct spug { int drokk; } spug;
11359 const spug y = { 0 };
11362 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
11364 echo "Yup, it does."
11367 echo "Nope, it doesn't."
11372 : see if copysignl exists
11373 set copysignl d_copysignl
11376 : see if crypt exists
11381 $define) cryptlib='' ;;
11382 *) if set crypt val -f d_crypt; eval $csym; $val; then
11383 echo 'crypt() found.' >&4
11387 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
11388 if $test -z "$cryptlib"; then
11389 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
11393 if $test -z "$cryptlib"; then
11394 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
11398 if $test -z "$cryptlib"; then
11399 cryptlib=`./loc libcrypt$_a "" $libpth`
11403 if $test -z "$cryptlib"; then
11404 echo 'crypt() NOT found.' >&4
11415 : see if this is a crypt.h system
11416 set crypt.h i_crypt
11419 : see if crypt_r exists
11420 set crypt_r d_crypt_r
11422 case "$d_crypt_r" in
11424 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
11425 case "$d_crypt_r_proto:$usethreads" in
11426 ":define") d_crypt_r_proto=define
11427 set d_crypt_r_proto crypt_r $hdrs
11431 case "$d_crypt_r_proto" in
11433 case "$crypt_r_proto" in
11434 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
11435 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCS ;;
11437 case "$crypt_r_proto" in
11438 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
11439 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCD ;;
11441 case "$crypt_r_proto" in
11442 ''|0) d_crypt_r=undef
11444 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
11445 * ) case "$crypt_r_proto" in
11446 REENTRANT_PROTO*) ;;
11447 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
11449 echo "Prototype: $try" ;;
11452 *) case "$usethreads" in
11453 define) echo "crypt_r has no prototype, not using it." >&4 ;;
11464 : get csh whereabouts
11466 'csh') val="$undef" ;;
11467 *) val="$define" ;;
11471 : Respect a hint or command line value for full_csh.
11472 case "$full_csh" in
11473 '') full_csh=$csh ;;
11476 : see if ctermid exists
11477 set ctermid d_ctermid
11480 : see if ctermid_r exists
11481 set ctermid_r d_ctermid_r
11483 case "$d_ctermid_r" in
11485 hdrs="$i_systypes sys/types.h define stdio.h "
11486 case "$d_ctermid_r_proto:$usethreads" in
11487 ":define") d_ctermid_r_proto=define
11488 set d_ctermid_r_proto ctermid_r $hdrs
11492 case "$d_ctermid_r_proto" in
11494 case "$ctermid_r_proto" in
11495 ''|0) try='char* ctermid_r(char*);'
11496 ./protochk "$extern_C $try" $hdrs && ctermid_r_proto=B_B ;;
11498 case "$ctermid_r_proto" in
11499 ''|0) d_ctermid_r=undef
11501 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
11502 * ) case "$ctermid_r_proto" in
11503 REENTRANT_PROTO*) ;;
11504 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
11506 echo "Prototype: $try" ;;
11509 *) case "$usethreads" in
11510 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
11517 *) ctermid_r_proto=0
11521 : see if ctime_r exists
11522 set ctime_r d_ctime_r
11524 case "$d_ctime_r" in
11526 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
11527 case "$d_ctime_r_proto:$usethreads" in
11528 ":define") d_ctime_r_proto=define
11529 set d_ctime_r_proto ctime_r $hdrs
11533 case "$d_ctime_r_proto" in
11535 case "$ctime_r_proto" in
11536 ''|0) try='char* ctime_r(const time_t*, char*);'
11537 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SB ;;
11539 case "$ctime_r_proto" in
11540 ''|0) try='char* ctime_r(const time_t*, char*, int);'
11541 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SBI ;;
11543 case "$ctime_r_proto" in
11544 ''|0) try='int ctime_r(const time_t*, char*);'
11545 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SB ;;
11547 case "$ctime_r_proto" in
11548 ''|0) try='int ctime_r(const time_t*, char*, int);'
11549 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SBI ;;
11551 case "$ctime_r_proto" in
11552 ''|0) d_ctime_r=undef
11554 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
11555 * ) case "$ctime_r_proto" in
11556 REENTRANT_PROTO*) ;;
11557 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
11559 echo "Prototype: $try" ;;
11562 *) case "$usethreads" in
11563 define) echo "ctime_r has no prototype, not using it." >&4 ;;
11574 : see if cuserid exists
11575 set cuserid d_cuserid
11578 : see if this is a limits.h system
11579 set limits.h i_limits
11582 : see if this is a float.h system
11583 set float.h i_float
11586 : See if number of significant digits in a double precision number is known
11588 $cat >dbl_dig.c <<EOM
11589 #$i_limits I_LIMITS
11592 #include <limits.h>
11598 printf("Contains DBL_DIG");
11601 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
11602 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
11603 echo "DBL_DIG found." >&4
11606 echo "DBL_DIG NOT found." >&4
11613 : see if dbm.h is available
11614 : see if dbmclose exists
11615 set dbmclose d_dbmclose
11618 case "$d_dbmclose" in
11628 *) set rpcsvc/dbm.h i_rpcsvcdbm
11633 *) echo "We won't be including <dbm.h>"
11643 : see if prototype for dbminit is available
11645 set d_dbminitproto dbminit $i_dbm dbm.h
11648 : see if difftime exists
11649 set difftime d_difftime
11652 : see if this is a dirent system
11654 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
11656 echo "<dirent.h> found." >&4
11659 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
11660 echo "<sys/dir.h> found." >&4
11663 xinc=`./findhdr sys/ndir.h`
11665 echo "<dirent.h> NOT found." >&4
11670 : Look for type of directory structure.
11672 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11674 case "$direntrytype" in
11676 case "$i_dirent" in
11677 $define) guess1='struct dirent' ;;
11678 *) guess1='struct direct' ;;
11681 *) guess1="$direntrytype"
11686 'struct dirent') guess2='struct direct' ;;
11687 *) guess2='struct dirent' ;;
11690 if $contains "$guess1" try.c >/dev/null 2>&1; then
11691 direntrytype="$guess1"
11692 echo "Your directory entries are $direntrytype." >&4
11693 elif $contains "$guess2" try.c >/dev/null 2>&1; then
11694 direntrytype="$guess2"
11695 echo "Your directory entries seem to be $direntrytype." >&4
11697 echo "I don't recognize your system's directory entries." >&4
11698 rp="What type is used for directory entries on this system?"
11701 direntrytype="$ans"
11705 : see if the directory entry stores field length
11707 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11708 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
11709 echo "Good, your directory entry keeps length information in d_namlen." >&4
11712 echo "Your directory entry does not know about the d_namlen field." >&4
11719 : Look for DIR.dd_fd
11720 case "$i_dirent" in
11722 echo "Checking to see if DIR has a dd_fd member variable" >&4
11724 #$i_stdlib I_STDLIB
11726 #include <stdlib.h>
11728 #include <dirent.h>
11738 if eval $compile; then
11739 echo "Yes, it does."
11742 echo "No, it does not."
11747 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
11755 : see if this is an sysdir system
11756 set sys/dir.h i_sysdir
11759 : see if this is an sysndir system
11760 set sys/ndir.h i_sysndir
11765 $cat >dirfd.c <<EOM
11767 #$i_stdlib I_STDLIB
11769 #include <stdlib.h>
11771 #$i_dirent I_DIRENT /**/
11772 #$i_sysdir I_SYS_DIR /**/
11773 #$i_sysndir I_SYS_NDIR /**/
11774 #$i_systypes I_SYS_TYPES /**/
11775 #if defined(I_SYS_TYPES)
11776 #include <sys/types.h>
11778 #if defined(I_DIRENT)
11779 #include <dirent.h>
11780 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
11781 #include <sys/dir.h>
11785 #include <sys/ndir.h>
11789 #include <ndir.h> /* may be wrong in the future */
11791 #include <sys/dir.h>
11797 DIR *dirp = opendir(".");
11798 if (dirfd(dirp) >= 0)
11806 if eval $compile; then
11810 $define) echo "dirfd() found." >&4 ;;
11811 *) echo "dirfd() NOT found." >&4 ;;
11817 : see if dlerror exists
11820 set dlerror d_dlerror
11824 : see if dlfcn is available
11825 set dlfcn.h i_dlfcn
11828 : Check what extension to use for shared libs
11833 On a few systems, the dynamically loaded modules that perl generates and uses
11834 will need a different extension than shared libs. The default will probably
11840 *) dflt="$dlext" ;;
11842 rp='What is the extension of dynamically loaded modules'
11851 : Check if dlsym need a leading underscore
11857 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
11858 $cat >dyna.c <<'EOM'
11865 #$i_stdlib I_STDLIB
11867 #include <stdlib.h>
11871 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
11873 #include <sys/types.h>
11878 extern int fred() ;
11887 int mode = RTLD_LAZY ;
11889 handle = dlopen("./dyna.$dlext", mode) ;
11890 if (handle == NULL) {
11895 symbol = dlsym(handle, "fred") ;
11896 if (symbol == NULL) {
11897 /* try putting a leading underscore */
11898 symbol = dlsym(handle, "_fred") ;
11899 if (symbol == NULL) {
11912 : Call the object file tmp-dyna.o in case dlext=o.
11913 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
11914 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
11915 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
11916 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
11919 1) echo "Test program failed using dlopen." >&4
11920 echo "Perhaps you should not use dynamic loading." >&4;;
11921 2) echo "Test program failed using dlsym." >&4
11922 echo "Perhaps you should not use dynamic loading." >&4;;
11923 3) echo "dlsym needs a leading underscore" >&4
11925 4) echo "dlsym doesn't need a leading underscore." >&4;;
11928 echo "I can't compile and run the test program." >&4
11929 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
11934 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
11939 : see if drand48_r exists
11940 set drand48_r d_drand48_r
11942 case "$d_drand48_r" in
11944 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
11945 case "$d_drand48_r_proto:$usethreads" in
11946 ":define") d_drand48_r_proto=define
11947 set d_drand48_r_proto drand48_r $hdrs
11951 case "$d_drand48_r_proto" in
11953 case "$drand48_r_proto" in
11954 ''|0) try='int drand48_r(struct drand48_data*, double*);'
11955 ./protochk "$extern_C $try" $hdrs && drand48_r_proto=I_ST ;;
11957 case "$drand48_r_proto" in
11958 ''|0) d_drand48_r=undef
11960 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
11961 * ) case "$drand48_r_proto" in
11962 REENTRANT_PROTO*) ;;
11963 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
11965 echo "Prototype: $try" ;;
11968 *) case "$usethreads" in
11969 define) echo "drand48_r has no prototype, not using it." >&4 ;;
11976 *) drand48_r_proto=0
11980 : see if prototype for drand48 is available
11982 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
11985 : see if dup2 exists
11989 : see if eaccess exists
11990 set eaccess d_eaccess
11993 : see if endgrent exists
11994 set endgrent d_endgrent
11997 : see if this is an grp system
12003 xxx=`./findhdr grp.h`
12004 $cppstdin $cppflags $cppminus < $xxx >$$.h
12006 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
12018 set d_grpasswd; eval $setvar
12022 : see if endgrent_r exists
12023 set endgrent_r d_endgrent_r
12025 case "$d_endgrent_r" in
12027 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12028 case "$d_endgrent_r_proto:$usethreads" in
12029 ":define") d_endgrent_r_proto=define
12030 set d_endgrent_r_proto endgrent_r $hdrs
12034 case "$d_endgrent_r_proto" in
12036 case "$endgrent_r_proto" in
12037 ''|0) try='int endgrent_r(FILE**);'
12038 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=I_H ;;
12040 case "$endgrent_r_proto" in
12041 ''|0) try='void endgrent_r(FILE**);'
12042 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=V_H ;;
12044 case "$endgrent_r_proto" in
12045 ''|0) d_endgrent_r=undef
12047 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
12048 * ) case "$endgrent_r_proto" in
12049 REENTRANT_PROTO*) ;;
12050 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
12052 echo "Prototype: $try" ;;
12055 *) case "$usethreads" in
12056 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
12063 *) endgrent_r_proto=0
12067 : see if endhostent exists
12068 set endhostent d_endhent
12071 : see if this is a netdb.h system
12072 set netdb.h i_netdb
12075 : see if endhostent_r exists
12076 set endhostent_r d_endhostent_r
12078 case "$d_endhostent_r" in
12080 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12081 case "$d_endhostent_r_proto:$usethreads" in
12082 ":define") d_endhostent_r_proto=define
12083 set d_endhostent_r_proto endhostent_r $hdrs
12087 case "$d_endhostent_r_proto" in
12089 case "$endhostent_r_proto" in
12090 ''|0) try='int endhostent_r(struct hostent_data*);'
12091 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=I_D ;;
12093 case "$endhostent_r_proto" in
12094 ''|0) try='void endhostent_r(struct hostent_data*);'
12095 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=V_D ;;
12097 case "$endhostent_r_proto" in
12098 ''|0) d_endhostent_r=undef
12099 endhostent_r_proto=0
12100 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
12101 * ) case "$endhostent_r_proto" in
12102 REENTRANT_PROTO*) ;;
12103 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
12105 echo "Prototype: $try" ;;
12108 *) case "$usethreads" in
12109 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
12111 d_endhostent_r=undef
12112 endhostent_r_proto=0
12116 *) endhostent_r_proto=0
12120 : see if endnetent exists
12121 set endnetent d_endnent
12124 : see if endnetent_r exists
12125 set endnetent_r d_endnetent_r
12127 case "$d_endnetent_r" in
12129 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12130 case "$d_endnetent_r_proto:$usethreads" in
12131 ":define") d_endnetent_r_proto=define
12132 set d_endnetent_r_proto endnetent_r $hdrs
12136 case "$d_endnetent_r_proto" in
12138 case "$endnetent_r_proto" in
12139 ''|0) try='int endnetent_r(struct netent_data*);'
12140 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=I_D ;;
12142 case "$endnetent_r_proto" in
12143 ''|0) try='void endnetent_r(struct netent_data*);'
12144 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=V_D ;;
12146 case "$endnetent_r_proto" in
12147 ''|0) d_endnetent_r=undef
12148 endnetent_r_proto=0
12149 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
12150 * ) case "$endnetent_r_proto" in
12151 REENTRANT_PROTO*) ;;
12152 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
12154 echo "Prototype: $try" ;;
12157 *) case "$usethreads" in
12158 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
12160 d_endnetent_r=undef
12161 endnetent_r_proto=0
12165 *) endnetent_r_proto=0
12169 : see if endprotoent exists
12170 set endprotoent d_endpent
12173 : see if endprotoent_r exists
12174 set endprotoent_r d_endprotoent_r
12176 case "$d_endprotoent_r" in
12178 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12179 case "$d_endprotoent_r_proto:$usethreads" in
12180 ":define") d_endprotoent_r_proto=define
12181 set d_endprotoent_r_proto endprotoent_r $hdrs
12185 case "$d_endprotoent_r_proto" in
12187 case "$endprotoent_r_proto" in
12188 ''|0) try='int endprotoent_r(struct protoent_data*);'
12189 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=I_D ;;
12191 case "$endprotoent_r_proto" in
12192 ''|0) try='void endprotoent_r(struct protoent_data*);'
12193 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=V_D ;;
12195 case "$endprotoent_r_proto" in
12196 ''|0) d_endprotoent_r=undef
12197 endprotoent_r_proto=0
12198 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
12199 * ) case "$endprotoent_r_proto" in
12200 REENTRANT_PROTO*) ;;
12201 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
12203 echo "Prototype: $try" ;;
12206 *) case "$usethreads" in
12207 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
12209 d_endprotoent_r=undef
12210 endprotoent_r_proto=0
12214 *) endprotoent_r_proto=0
12218 : see if endpwent exists
12219 set endpwent d_endpwent
12222 : see if this is a pwd.h system
12228 xxx=`./findhdr pwd.h`
12229 $cppstdin $cppflags $cppminus < $xxx >$$.h
12231 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
12239 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
12247 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
12255 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
12263 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
12271 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
12279 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
12287 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
12299 set d_pwquota; eval $setvar
12300 set d_pwage; eval $setvar
12301 set d_pwchange; eval $setvar
12302 set d_pwclass; eval $setvar
12303 set d_pwexpire; eval $setvar
12304 set d_pwcomment; eval $setvar
12305 set d_pwgecos; eval $setvar
12306 set d_pwpasswd; eval $setvar
12310 : see if endpwent_r exists
12311 set endpwent_r d_endpwent_r
12313 case "$d_endpwent_r" in
12315 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
12316 case "$d_endpwent_r_proto:$usethreads" in
12317 ":define") d_endpwent_r_proto=define
12318 set d_endpwent_r_proto endpwent_r $hdrs
12322 case "$d_endpwent_r_proto" in
12324 case "$endpwent_r_proto" in
12325 ''|0) try='int endpwent_r(FILE**);'
12326 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=I_H ;;
12328 case "$endpwent_r_proto" in
12329 ''|0) try='void endpwent_r(FILE**);'
12330 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=V_H ;;
12332 case "$endpwent_r_proto" in
12333 ''|0) d_endpwent_r=undef
12335 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
12336 * ) case "$endpwent_r_proto" in
12337 REENTRANT_PROTO*) ;;
12338 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
12340 echo "Prototype: $try" ;;
12343 *) case "$usethreads" in
12344 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
12351 *) endpwent_r_proto=0
12355 : see if endservent exists
12356 set endservent d_endsent
12359 : see if endservent_r exists
12360 set endservent_r d_endservent_r
12362 case "$d_endservent_r" in
12364 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12365 case "$d_endservent_r_proto:$usethreads" in
12366 ":define") d_endservent_r_proto=define
12367 set d_endservent_r_proto endservent_r $hdrs
12371 case "$d_endservent_r_proto" in
12373 case "$endservent_r_proto" in
12374 ''|0) try='int endservent_r(struct servent_data*);'
12375 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=I_D ;;
12377 case "$endservent_r_proto" in
12378 ''|0) try='void endservent_r(struct servent_data*);'
12379 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=V_D ;;
12381 case "$endservent_r_proto" in
12382 ''|0) d_endservent_r=undef
12383 endservent_r_proto=0
12384 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
12385 * ) case "$endservent_r_proto" in
12386 REENTRANT_PROTO*) ;;
12387 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
12389 echo "Prototype: $try" ;;
12392 *) case "$usethreads" in
12393 define) echo "endservent_r has no prototype, not using it." >&4 ;;
12395 d_endservent_r=undef
12396 endservent_r_proto=0
12400 *) endservent_r_proto=0
12404 : Locate the flags for 'open()'
12407 #include <sys/types.h>
12412 #include <sys/file.h>
12414 #$i_stdlib I_STDLIB
12416 #include <stdlib.h>
12427 : check sys/file.h first to get FREAD on Sun
12428 if $test `./findhdr sys/file.h` && \
12429 set try -DI_SYS_FILE && eval $compile; then
12431 echo "<sys/file.h> defines the O_* constants..." >&4
12432 if $run ./try; then
12433 echo "and you have the 3 argument form of open()." >&4
12436 echo "but not the 3 argument form of open(). Oh, well." >&4
12439 elif $test `./findhdr fcntl.h` && \
12440 set try -DI_FCNTL && eval $compile; then
12442 echo "<fcntl.h> defines the O_* constants..." >&4
12443 if $run ./try; then
12444 echo "and you have the 3 argument form of open()." >&4
12447 echo "but not the 3 argument form of open(). Oh, well." >&4
12452 echo "I can't find the O_* constant definitions! You got problems." >&4
12458 : see if this is a sys/file.h system
12463 : do we need to include sys/file.h ?
12467 if $h_sysfile; then
12469 echo "We'll be including <sys/file.h>." >&4
12472 echo "We won't be including <sys/file.h>." >&4
12482 : see if fcntl.h is there
12487 : see if we can include fcntl.h
12493 echo "We'll be including <fcntl.h>." >&4
12496 if $h_sysfile; then
12497 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
12499 echo "We won't be including <fcntl.h>." >&4
12511 : see if fork exists
12515 : see if pipe exists
12519 : check for non-blocking I/O stuff
12520 case "$h_sysfile" in
12521 true) echo "#include <sys/file.h>" > head.c;;
12524 true) echo "#include <fcntl.h>" > head.c;;
12525 *) echo "#include <sys/fcntl.h>" > head.c;;
12530 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
12531 case "$o_nonblock" in
12533 $cat head.c > try.c
12534 $cat >>try.c <<EOCP
12536 #$i_stdlib I_STDLIB
12538 #include <stdlib.h>
12546 printf("O_NONBLOCK\n");
12550 printf("O_NDELAY\n");
12554 printf("FNDELAY\n");
12561 if eval $compile_ok; then
12562 o_nonblock=`$run ./try`
12563 case "$o_nonblock" in
12564 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
12565 *) echo "Seems like we can use $o_nonblock.";;
12568 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
12571 *) echo "Using $hint value $o_nonblock.";;
12576 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
12579 case "$d_fork:$d_pipe" in
12581 $cat head.c > try.c
12582 $cat >>try.c <<EOCP
12584 #include <sys/types.h>
12585 #include <signal.h>
12587 #$i_stdlib I_STDLIB
12589 #include <stdlib.h>
12595 #define MY_O_NONBLOCK $o_nonblock
12596 #ifndef errno /* XXX need better Configure test */
12599 #$i_unistd I_UNISTD
12601 #include <unistd.h>
12603 #$i_string I_STRING
12605 #include <string.h>
12607 #include <strings.h>
12609 $signal_t blech(int x) { exit(3); }
12611 $cat >> try.c <<'EOCP'
12619 pipe(pd); /* Down: child -> parent */
12620 pipe(pu); /* Up: parent -> child */
12623 close(pd[1]); /* Parent reads from pd[0] */
12624 close(pu[0]); /* Parent writes (blocking) to pu[1] */
12626 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
12631 signal(SIGALRM, blech);
12633 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
12635 sprintf(string, "%d\n", ret);
12636 write(2, string, strlen(string));
12639 if (errno == EAGAIN) {
12640 printf("EAGAIN\n");
12645 if (errno == EWOULDBLOCK)
12646 printf("EWOULDBLOCK\n");
12649 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
12650 sleep(2); /* Give it time to close our pipe */
12652 ret = read(pd[0], buf, 1); /* Should read EOF */
12654 sprintf(string, "%d\n", ret);
12655 write(4, string, strlen(string));
12659 close(pd[0]); /* We write to pd[1] */
12660 close(pu[1]); /* We read from pu[0] */
12661 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
12662 close(pd[1]); /* Pipe pd is now fully closed! */
12663 exit(0); /* Bye bye, thank you for playing! */
12667 if eval $compile_ok; then
12668 echo "$startsh" >mtry
12669 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
12671 ./mtry >/dev/null 2>&1
12673 0) eagain=`$cat try.out`;;
12674 1) echo "Could not perform non-blocking setting!";;
12675 2) echo "I did a successful read() for something that was not there!";;
12676 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
12677 4) echo "Could not find F_SETFL!";;
12678 *) echo "Something terribly wrong happened during testing.";;
12680 rd_nodata=`$cat try.ret`
12681 echo "A read() system call with no data present returns $rd_nodata."
12682 case "$rd_nodata" in
12685 echo "(That's peculiar, fixing that to be -1.)"
12691 echo "Forcing errno EAGAIN on read() with no data available."
12695 echo "Your read() sets errno to $eagain when no data is available."
12698 status=`$cat try.err`
12700 0) echo "And it correctly returns 0 to signal EOF.";;
12701 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
12702 *) echo "However, your read() returns '$status' on EOF??";;
12705 if test "$status" = "$rd_nodata"; then
12706 echo "WARNING: you can't distinguish between EOF and no data!"
12710 echo "I can't compile the test program--assuming errno EAGAIN will do."
12714 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
12723 echo "Using $hint value $eagain."
12724 echo "Your read() returns $rd_nodata when no data is present."
12725 case "$d_eofnblk" in
12726 "$define") echo "And you can see EOF because read() returns 0.";;
12727 "$undef") echo "But you can't see EOF status from read() returned value.";;
12729 echo "(Assuming you can't see EOF status from read anyway.)"
12735 $rm_try head.c mtry
12737 : see if _ptr and _cnt from stdio act std
12740 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
12741 echo "(Looks like you have stdio.h from BSD.)"
12742 case "$stdio_ptr" in
12743 '') stdio_ptr='((fp)->_p)'
12746 *) ptr_lval=$d_stdio_ptr_lval;;
12748 case "$stdio_cnt" in
12749 '') stdio_cnt='((fp)->_r)'
12752 *) cnt_lval=$d_stdio_cnt_lval;;
12754 case "$stdio_base" in
12755 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
12757 case "$stdio_bufsiz" in
12758 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
12760 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
12761 echo "(Looks like you have stdio.h from Linux.)"
12762 case "$stdio_ptr" in
12763 '') stdio_ptr='((fp)->_IO_read_ptr)'
12766 *) ptr_lval=$d_stdio_ptr_lval;;
12768 case "$stdio_cnt" in
12769 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
12772 *) cnt_lval=$d_stdio_cnt_lval;;
12774 case "$stdio_base" in
12775 '') stdio_base='((fp)->_IO_read_base)';;
12777 case "$stdio_bufsiz" in
12778 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
12781 case "$stdio_ptr" in
12782 '') stdio_ptr='((fp)->_ptr)'
12785 *) ptr_lval=$d_stdio_ptr_lval;;
12787 case "$stdio_cnt" in
12788 '') stdio_cnt='((fp)->_cnt)'
12791 *) cnt_lval=$d_stdio_cnt_lval;;
12793 case "$stdio_base" in
12794 '') stdio_base='((fp)->_base)';;
12796 case "$stdio_bufsiz" in
12797 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
12801 : test whether _ptr and _cnt really work
12802 echo "Checking how std your stdio is..." >&4
12805 #$i_stdlib I_STDLIB
12807 #include <stdlib.h>
12809 #define FILE_ptr(fp) $stdio_ptr
12810 #define FILE_cnt(fp) $stdio_cnt
12812 FILE *fp = fopen("try.c", "r");
12815 18 <= FILE_cnt(fp) &&
12816 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12824 if eval $compile && $to try.c; then
12825 if $run ./try; then
12826 echo "Your stdio acts pretty std."
12829 echo "Your stdio isn't very std."
12832 echo "Your stdio doesn't appear very std."
12836 # glibc 2.2.90 and above apparently change stdio streams so Perl's
12837 # direct buffer manipulation no longer works. The Configure tests
12838 # should be changed to correctly detect this, but until then,
12839 # the following check should at least let perl compile and run.
12840 # (This quick fix should be updated before 5.8.1.)
12841 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
12842 # A. Dougherty, June 3, 2002.
12843 case "$d_gnulibc" in
12845 case "$gnulibc_version" in
12849 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
12858 : Can _ptr be used as an lvalue?
12859 case "$d_stdstdio$ptr_lval" in
12860 $define$define) val=$define ;;
12863 set d_stdio_ptr_lval
12866 : Can _cnt be used as an lvalue?
12867 case "$d_stdstdio$cnt_lval" in
12868 $define$define) val=$define ;;
12871 set d_stdio_cnt_lval
12875 : test whether setting _ptr sets _cnt as a side effect
12876 d_stdio_ptr_lval_sets_cnt="$undef"
12877 d_stdio_ptr_lval_nochange_cnt="$undef"
12878 case "$d_stdio_ptr_lval$d_stdstdio" in
12880 echo "Checking to see what happens if we set the stdio ptr..." >&4
12883 /* Can we scream? */
12884 /* Eat dust sed :-) */
12885 /* In the buffer space, no one can hear you scream. */
12886 #$i_stdlib I_STDLIB
12888 #include <stdlib.h>
12890 #define FILE_ptr(fp) $stdio_ptr
12891 #define FILE_cnt(fp) $stdio_cnt
12892 #include <sys/types.h>
12894 FILE *fp = fopen("try.c", "r");
12899 puts("Fail even to read");
12902 c = getc(fp); /* Read away the first # */
12904 puts("Fail even to read");
12908 18 <= FILE_cnt(fp) &&
12909 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12911 puts("Fail even to read");
12914 ptr = (char*) FILE_ptr(fp);
12915 cnt = (size_t)FILE_cnt(fp);
12917 FILE_ptr(fp) += 42;
12919 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
12920 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
12923 if (FILE_cnt(fp) <= 20) {
12924 printf ("Fail (<20 chars to test)");
12927 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
12928 puts("Fail compare");
12931 if (cnt == FILE_cnt(fp)) {
12932 puts("Pass_unchanged");
12935 if (FILE_cnt(fp) == (cnt - 42)) {
12936 puts("Pass_changed");
12939 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
12945 if eval $compile && $to try.c; then
12946 case `$run ./try` in
12948 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
12949 d_stdio_ptr_lval_sets_cnt="$define" ;;
12951 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
12952 d_stdio_ptr_lval_nochange_cnt="$define" ;;
12954 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
12956 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
12959 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
12965 : see if _base is also standard
12967 case "$d_stdstdio" in
12971 #$i_stdlib I_STDLIB
12973 #include <stdlib.h>
12975 #define FILE_base(fp) $stdio_base
12976 #define FILE_bufsiz(fp) $stdio_bufsiz
12978 FILE *fp = fopen("try.c", "r");
12981 19 <= FILE_bufsiz(fp) &&
12982 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
12989 if eval $compile && $to try.c; then
12990 if $run ./try; then
12991 echo "And its _base field acts std."
12994 echo "But its _base field isn't std."
12997 echo "However, it seems to be lacking the _base field."
13005 : see if fast_stdio exists
13007 case "$d_stdstdio:$d_stdio_ptr_lval" in
13009 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
13011 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
13022 : see if fchdir exists
13023 set fchdir d_fchdir
13026 : see if fchmod exists
13027 set fchmod d_fchmod
13030 : see if fchown exists
13031 set fchown d_fchown
13034 : see if this is an fcntl system
13038 : See if fcntl-based locking works.
13041 #$i_stdlib I_STDLIB
13043 #include <stdlib.h>
13045 #include <unistd.h>
13047 #include <signal.h>
13048 $signal_t blech(int x) { exit(3); }
13050 #if defined(F_SETLK) && defined(F_SETLKW)
13051 struct flock flock;
13053 fd = open("try.c", O_RDONLY);
13054 flock.l_type = F_RDLCK;
13055 flock.l_whence = SEEK_SET;
13056 flock.l_start = flock.l_len = 0;
13057 signal(SIGALRM, blech);
13059 retval = fcntl(fd, F_SETLK, &flock);
13061 (retval < 0 ? exit(2) : exit(0));
13067 echo "Checking if fcntl-based file locking works... "
13071 if eval $compile_ok; then
13072 if $run ./try; then
13073 echo "Yes, it seems to work."
13076 echo "Nope, it didn't work."
13081 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
13082 *** This is (almost) impossible.
13083 *** If your NFS lock daemons are not feeling well, something like
13084 *** this may happen, please investigate. Cannot continue, aborting.
13092 echo "I'm unable to compile the test program, so I'll assume not."
13097 echo "Nope, since you don't even have fcntl()."
13100 set d_fcntl_can_lock
13104 : check for fd_set items
13107 Checking to see how well your C compiler handles fd_set and friends ...
13110 #$i_stdlib I_STDLIB
13112 #include <stdlib.h>
13114 #$i_systime I_SYS_TIME
13115 #$i_sysselct I_SYS_SELECT
13116 #$d_socket HAS_SOCKET
13117 #include <sys/types.h>
13119 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
13122 #include <sys/time.h>
13124 #ifdef I_SYS_SELECT
13125 #include <sys/select.h>
13134 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
13142 if eval $compile; then
13143 d_fds_bits="$define"
13145 echo "Well, your system knows about the normal fd_set typedef..." >&4
13146 if $run ./try; then
13147 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
13148 d_fd_macros="$define"
13151 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
13153 d_fd_macros="$undef"
13157 Hmm, your compiler has some difficulty with fd_set. Checking further...
13160 if eval $compile; then
13161 d_fds_bits="$undef"
13163 echo "Well, your system has some sort of fd_set available..." >&4
13164 if $run ./try; then
13165 echo "and you have the normal fd_set macros." >&4
13166 d_fd_macros="$define"
13169 but not the normal fd_set macros! Gross! More work for me...
13171 d_fd_macros="$undef"
13174 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
13176 d_fds_bits="$undef"
13177 d_fd_macros="$undef"
13182 : see if fgetpos exists
13183 set fgetpos d_fgetpos
13186 : see if finite exists
13187 set finite d_finite
13190 : see if finitel exists
13191 set finitel d_finitel
13194 : see if flock exists
13198 : see if prototype for flock is available
13200 set d_flockproto flock $i_sysfile sys/file.h
13203 : see if fp_class exists
13204 set fp_class d_fp_class
13207 : see if pathconf exists
13208 set pathconf d_pathconf
13211 : see if fpathconf exists
13212 set fpathconf d_fpathconf
13215 : see if fpclass exists
13216 set fpclass d_fpclass
13219 : see if fpclassify exists
13220 set fpclassify d_fpclassify
13223 : see if fpclassl exists
13224 set fpclassl d_fpclassl
13227 : check for fpos64_t
13229 echo "Checking to see if you have fpos64_t..." >&4
13232 int main() { fpos64_t x = 7; }
13235 if eval $compile; then
13237 echo "You have fpos64_t."
13240 echo "You do not have fpos64_t."
13241 case "$fpossize" in
13242 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
13249 : see if frexpl exists
13250 set frexpl d_frexpl
13253 : see if this is a sys/param system
13254 set sys/param.h i_sysparam
13257 : see if this is a sys/mount.h system
13258 set sys/mount.h i_sysmount
13261 : Check for fs_data_s
13263 echo "Checking to see if your system supports struct fs_data..." >&4
13264 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
13266 case "$d_fs_data_s" in
13267 "$define") echo "Yes, it does." ;;
13268 *) echo "No, it doesn't." ;;
13271 : see if fseeko exists
13272 set fseeko d_fseeko
13274 case "$longsize" in
13275 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
13278 : see if fsetpos exists
13279 set fsetpos d_fsetpos
13282 : see if fstatfs exists
13283 set fstatfs d_fstatfs
13286 : see if statvfs exists
13287 set statvfs d_statvfs
13290 : see if fstatvfs exists
13291 set fstatvfs d_fstatvfs
13295 : see if fsync exists
13299 : see if ftello exists
13300 set ftello d_ftello
13302 case "$longsize" in
13303 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
13306 : check for a working futimes
13309 echo "Checking if you have a working futimes()" >&4
13312 #include <sys/time.h>
13319 fd = open ("try.c", O_RDWR);
13320 if (-1 == fd) exit (1);
13321 rv = futimes (fd, NULL);
13322 exit (rv == -1 ? errno : 0);
13326 if eval $compile; then
13330 0) echo "Yes, you have" >&4
13331 d_futimes="$define"
13333 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
13337 echo "No, it does not (probably harmless)" >&4
13341 : see if ndbm.h is available
13344 : Compatibility location for RedHat 7.1
13345 set gdbm/ndbm.h i_gdbmndbm
13347 : Compatibility location for Debian 4.0
13348 set gdbm-ndbm.h i_gdbm_ndbm
13352 if $test "$i_ndbm" = "$define" -o "$i_gdbmndbm" = "$define" -o "$i_gdbm_ndbm" = "$define"; then
13353 : see if dbm_open exists
13354 set dbm_open d_dbm_open
13356 case "$d_dbm_open" in
13359 i_gdbmndbm="$undef"
13360 i_gdbm_ndbm="$undef"
13361 echo "We won't be including <ndbm.h>"
13371 ndbm_hdr_protochk='name=$1; hdr=$2;
13372 eval "ihdr=\$""i_$name";
13374 if $test "$ihdr" = "$define"; then
13375 $echo "Checking if your <$hdr> uses prototypes..." >&4;
13376 case "$d_cplusplus" in
13377 $define) ./protochk "$extern_C void dbm_close(DBM *);" literal "extern \"C\" {" $ihdr $hdr literal "}" && val="$define" ;;
13378 *) ./protochk "$extern_C void dbm_close(int, int);" $ihdr $hdr || val="$define" ;;
13381 $define) $echo "Your <$hdr> seems to have prototypes";;
13382 *) $echo "Your <$hdr> does not seem to have prototypes";;
13385 set "d_${name}_h_uses_prototypes";
13389 eval $ndbm_hdr_protochk
13390 set gdbmndbm gdbm/ndbm.h
13391 eval $ndbm_hdr_protochk
13392 set gdbm_ndbm gdbm-ndbm.h
13393 eval $ndbm_hdr_protochk
13395 : see if getaddrinfo exists
13396 set getaddrinfo d_getaddrinfo
13399 : see if getcwd exists
13400 set getcwd d_getcwd
13403 : see if getespwnam exists
13404 set getespwnam d_getespwnam
13407 : see if getfsstat exists
13408 set getfsstat d_getfsstat
13411 : see if getgrent exists
13412 set getgrent d_getgrent
13415 : see if getgrent_r exists
13416 set getgrent_r d_getgrent_r
13418 case "$d_getgrent_r" in
13420 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13421 case "$d_getgrent_r_proto:$usethreads" in
13422 ":define") d_getgrent_r_proto=define
13423 set d_getgrent_r_proto getgrent_r $hdrs
13427 case "$d_getgrent_r_proto" in
13429 case "$getgrent_r_proto" in
13430 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
13431 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBWR ;;
13433 case "$getgrent_r_proto" in
13434 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
13435 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIR ;;
13437 case "$getgrent_r_proto" in
13438 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
13439 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBW ;;
13441 case "$getgrent_r_proto" in
13442 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
13443 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBI ;;
13445 case "$getgrent_r_proto" in
13446 ''|0) try='int getgrent_r(struct group*, char*, int);'
13447 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBI ;;
13449 case "$getgrent_r_proto" in
13450 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
13451 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIH ;;
13453 case "$getgrent_r_proto" in
13454 ''|0) d_getgrent_r=undef
13456 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
13457 * ) case "$getgrent_r_proto" in
13458 REENTRANT_PROTO*) ;;
13459 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
13461 echo "Prototype: $try" ;;
13464 *) case "$usethreads" in
13465 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
13472 *) getgrent_r_proto=0
13476 : see if getgrgid_r exists
13477 set getgrgid_r d_getgrgid_r
13479 case "$d_getgrgid_r" in
13481 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13482 case "$d_getgrgid_r_proto:$usethreads" in
13483 ":define") d_getgrgid_r_proto=define
13484 set d_getgrgid_r_proto getgrgid_r $hdrs
13488 case "$d_getgrgid_r_proto" in
13490 case "$getgrgid_r_proto" in
13491 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
13492 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
13494 case "$getgrgid_r_proto" in
13495 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
13496 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
13498 case "$getgrgid_r_proto" in
13499 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
13500 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
13502 case "$getgrgid_r_proto" in
13503 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
13504 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
13506 case "$getgrgid_r_proto" in
13507 ''|0) d_getgrgid_r=undef
13509 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
13510 * ) case "$getgrgid_r_proto" in
13511 REENTRANT_PROTO*) ;;
13512 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
13514 echo "Prototype: $try" ;;
13517 *) case "$usethreads" in
13518 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
13525 *) getgrgid_r_proto=0
13529 : see if getgrnam_r exists
13530 set getgrnam_r d_getgrnam_r
13532 case "$d_getgrnam_r" in
13534 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13535 case "$d_getgrnam_r_proto:$usethreads" in
13536 ":define") d_getgrnam_r_proto=define
13537 set d_getgrnam_r_proto getgrnam_r $hdrs
13541 case "$d_getgrnam_r_proto" in
13543 case "$getgrnam_r_proto" in
13544 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
13545 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
13547 case "$getgrnam_r_proto" in
13548 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
13549 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
13551 case "$getgrnam_r_proto" in
13552 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
13553 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CBI ;;
13555 case "$getgrnam_r_proto" in
13556 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
13557 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
13559 case "$getgrnam_r_proto" in
13560 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
13561 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
13563 case "$getgrnam_r_proto" in
13564 ''|0) d_getgrnam_r=undef
13566 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
13567 * ) case "$getgrnam_r_proto" in
13568 REENTRANT_PROTO*) ;;
13569 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
13571 echo "Prototype: $try" ;;
13574 *) case "$usethreads" in
13575 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
13582 *) getgrnam_r_proto=0
13586 : see if gethostbyaddr exists
13587 set gethostbyaddr d_gethbyaddr
13590 : see if gethostbyname exists
13591 set gethostbyname d_gethbyname
13594 : see if gethostent exists
13595 set gethostent d_gethent
13598 : see how we will look up host name
13601 if set gethostname val -f d_gethname; eval $csym; $val; then
13602 echo 'gethostname() found.' >&4
13603 d_gethname="$define"
13606 if set uname val -f d_uname; eval $csym; $val; then
13609 uname() was found, but you're running xenix, and older versions of xenix
13610 have a broken uname(). If you don't really know whether your xenix is old
13611 enough to have a broken system call, use the default answer.
13616 "$define") dflt=n;;
13618 rp='Is your uname() broken?'
13621 n*) d_uname="$define"; call=uname;;
13624 echo 'uname() found.' >&4
13631 case "$d_gethname" in
13632 '') d_gethname="$undef";;
13635 '') d_uname="$undef";;
13637 case "$d_uname$d_gethname" in
13642 Every now and then someone has a $call() that lies about the hostname
13643 but can't be fixed for political or economic reasons. If you wish, I can
13644 pretend $call() isn't there and maybe compute hostname at run-time
13645 thanks to the '$phostname' command.
13648 rp="Shall I ignore $call() from now on?"
13651 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
13654 case "$phostname" in
13655 '') aphostname='';;
13656 *) case "$aphostname" in
13658 *) set X $phostname
13662 file=`./loc $file $file $pth`
13663 aphostname=`echo $file $*`
13668 case "$d_uname$d_gethname" in
13671 case "$phostname" in
13673 echo "There will be no way for $package to get your hostname." >&4;;
13675 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
13679 case "$d_phostname" in
13680 '') d_phostname="$undef";;
13683 : see if gethostbyaddr_r exists
13684 set gethostbyaddr_r d_gethostbyaddr_r
13686 case "$d_gethostbyaddr_r" in
13688 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13689 case "$d_gethostbyaddr_r_proto:$usethreads" in
13690 ":define") d_gethostbyaddr_r_proto=define
13691 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
13695 case "$d_gethostbyaddr_r_proto" in
13697 case "$gethostbyaddr_r_proto" in
13698 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13699 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
13701 case "$gethostbyaddr_r_proto" in
13702 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
13703 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
13705 case "$gethostbyaddr_r_proto" in
13706 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
13707 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
13709 case "$gethostbyaddr_r_proto" in
13710 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
13711 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
13713 case "$gethostbyaddr_r_proto" in
13714 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
13715 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
13717 case "$gethostbyaddr_r_proto" in
13718 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
13719 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
13721 case "$gethostbyaddr_r_proto" in
13722 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
13723 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
13725 case "$gethostbyaddr_r_proto" in
13726 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
13727 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
13729 case "$gethostbyaddr_r_proto" in
13730 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
13731 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
13733 case "$gethostbyaddr_r_proto" in
13734 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
13735 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
13737 case "$gethostbyaddr_r_proto" in
13738 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13739 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
13741 case "$gethostbyaddr_r_proto" in
13742 ''|0) d_gethostbyaddr_r=undef
13743 gethostbyaddr_r_proto=0
13744 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
13745 * ) case "$gethostbyaddr_r_proto" in
13746 REENTRANT_PROTO*) ;;
13747 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
13749 echo "Prototype: $try" ;;
13752 *) case "$usethreads" in
13753 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
13755 d_gethostbyaddr_r=undef
13756 gethostbyaddr_r_proto=0
13760 *) gethostbyaddr_r_proto=0
13764 : see if gethostbyname_r exists
13765 set gethostbyname_r d_gethostbyname_r
13767 case "$d_gethostbyname_r" in
13769 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13770 case "$d_gethostbyname_r_proto:$usethreads" in
13771 ":define") d_gethostbyname_r_proto=define
13772 set d_gethostbyname_r_proto gethostbyname_r $hdrs
13776 case "$d_gethostbyname_r_proto" in
13778 case "$gethostbyname_r_proto" in
13779 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
13780 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
13782 case "$gethostbyname_r_proto" in
13783 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
13784 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
13786 case "$gethostbyname_r_proto" in
13787 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
13788 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
13790 case "$gethostbyname_r_proto" in
13791 ''|0) d_gethostbyname_r=undef
13792 gethostbyname_r_proto=0
13793 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
13794 * ) case "$gethostbyname_r_proto" in
13795 REENTRANT_PROTO*) ;;
13796 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
13798 echo "Prototype: $try" ;;
13801 *) case "$usethreads" in
13802 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
13804 d_gethostbyname_r=undef
13805 gethostbyname_r_proto=0
13809 *) gethostbyname_r_proto=0
13813 : see if gethostent_r exists
13814 set gethostent_r d_gethostent_r
13816 case "$d_gethostent_r" in
13818 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13819 case "$d_gethostent_r_proto:$usethreads" in
13820 ":define") d_gethostent_r_proto=define
13821 set d_gethostent_r_proto gethostent_r $hdrs
13825 case "$d_gethostent_r_proto" in
13827 case "$gethostent_r_proto" in
13828 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
13829 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
13831 case "$gethostent_r_proto" in
13832 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
13833 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBIE ;;
13835 case "$gethostent_r_proto" in
13836 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
13837 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBIE ;;
13839 case "$gethostent_r_proto" in
13840 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
13841 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBI ;;
13843 case "$gethostent_r_proto" in
13844 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
13845 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBI ;;
13847 case "$gethostent_r_proto" in
13848 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
13849 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SD ;;
13851 case "$gethostent_r_proto" in
13852 ''|0) d_gethostent_r=undef
13853 gethostent_r_proto=0
13854 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
13855 * ) case "$gethostent_r_proto" in
13856 REENTRANT_PROTO*) ;;
13857 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
13859 echo "Prototype: $try" ;;
13862 *) case "$usethreads" in
13863 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
13865 d_gethostent_r=undef
13866 gethostent_r_proto=0
13870 *) gethostent_r_proto=0
13874 : see if prototypes for various gethostxxx netdb.h functions are available
13876 set d_gethostprotos gethostent $i_netdb netdb.h
13879 : see if getitimer exists
13880 set getitimer d_getitimer
13883 : see if getlogin exists
13884 set getlogin d_getlogin
13887 : see if getlogin_r exists
13888 set getlogin_r d_getlogin_r
13890 case "$d_getlogin_r" in
13892 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
13893 case "$d_getlogin_r_proto:$usethreads" in
13894 ":define") d_getlogin_r_proto=define
13895 set d_getlogin_r_proto getlogin_r $hdrs
13899 case "$d_getlogin_r_proto" in
13901 case "$getlogin_r_proto" in
13902 ''|0) try='int getlogin_r(char*, size_t);'
13903 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BW ;;
13905 case "$getlogin_r_proto" in
13906 ''|0) try='int getlogin_r(char*, int);'
13907 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BI ;;
13909 case "$getlogin_r_proto" in
13910 ''|0) try='char* getlogin_r(char*, size_t);'
13911 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BW ;;
13913 case "$getlogin_r_proto" in
13914 ''|0) try='char* getlogin_r(char*, int);'
13915 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BI ;;
13917 case "$getlogin_r_proto" in
13918 ''|0) d_getlogin_r=undef
13920 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
13921 * ) case "$getlogin_r_proto" in
13922 REENTRANT_PROTO*) ;;
13923 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
13925 echo "Prototype: $try" ;;
13928 *) case "$usethreads" in
13929 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
13936 *) getlogin_r_proto=0
13940 : see if getmnt exists
13941 set getmnt d_getmnt
13944 : see if getmntent exists
13945 set getmntent d_getmntent
13948 : see if getnameinfo exists
13949 set getnameinfo d_getnameinfo
13952 : see if getnetbyaddr exists
13953 set getnetbyaddr d_getnbyaddr
13956 : see if getnetbyname exists
13957 set getnetbyname d_getnbyname
13960 : see if getnetent exists
13961 set getnetent d_getnent
13964 : see if getnetbyaddr_r exists
13965 set getnetbyaddr_r d_getnetbyaddr_r
13967 case "$d_getnetbyaddr_r" in
13969 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13970 case "$d_getnetbyaddr_r_proto:$usethreads" in
13971 ":define") d_getnetbyaddr_r_proto=define
13972 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
13976 case "$d_getnetbyaddr_r_proto" in
13978 case "$getnetbyaddr_r_proto" in
13979 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
13980 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
13982 case "$getnetbyaddr_r_proto" in
13983 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
13984 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
13986 case "$getnetbyaddr_r_proto" in
13987 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
13988 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
13990 case "$getnetbyaddr_r_proto" in
13991 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
13992 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
13994 case "$getnetbyaddr_r_proto" in
13995 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
13996 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
13998 case "$getnetbyaddr_r_proto" in
13999 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
14000 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
14002 case "$getnetbyaddr_r_proto" in
14003 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
14004 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
14006 case "$getnetbyaddr_r_proto" in
14007 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
14008 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
14010 case "$getnetbyaddr_r_proto" in
14011 ''|0) d_getnetbyaddr_r=undef
14012 getnetbyaddr_r_proto=0
14013 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
14014 * ) case "$getnetbyaddr_r_proto" in
14015 REENTRANT_PROTO*) ;;
14016 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
14018 echo "Prototype: $try" ;;
14021 *) case "$usethreads" in
14022 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
14024 d_getnetbyaddr_r=undef
14025 getnetbyaddr_r_proto=0
14029 *) getnetbyaddr_r_proto=0
14033 : see if getnetbyname_r exists
14034 set getnetbyname_r d_getnetbyname_r
14036 case "$d_getnetbyname_r" in
14038 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14039 case "$d_getnetbyname_r_proto:$usethreads" in
14040 ":define") d_getnetbyname_r_proto=define
14041 set d_getnetbyname_r_proto getnetbyname_r $hdrs
14045 case "$d_getnetbyname_r_proto" in
14047 case "$getnetbyname_r_proto" in
14048 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
14049 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
14051 case "$getnetbyname_r_proto" in
14052 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
14053 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
14055 case "$getnetbyname_r_proto" in
14056 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
14057 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
14059 case "$getnetbyname_r_proto" in
14060 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
14061 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
14063 case "$getnetbyname_r_proto" in
14064 ''|0) d_getnetbyname_r=undef
14065 getnetbyname_r_proto=0
14066 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
14067 * ) case "$getnetbyname_r_proto" in
14068 REENTRANT_PROTO*) ;;
14069 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
14071 echo "Prototype: $try" ;;
14074 *) case "$usethreads" in
14075 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
14077 d_getnetbyname_r=undef
14078 getnetbyname_r_proto=0
14082 *) getnetbyname_r_proto=0
14086 : see if getnetent_r exists
14087 set getnetent_r d_getnetent_r
14089 case "$d_getnetent_r" in
14091 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14092 case "$d_getnetent_r_proto:$usethreads" in
14093 ":define") d_getnetent_r_proto=define
14094 set d_getnetent_r_proto getnetent_r $hdrs
14098 case "$d_getnetent_r_proto" in
14100 case "$getnetent_r_proto" in
14101 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
14102 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
14104 case "$getnetent_r_proto" in
14105 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
14106 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBIE ;;
14108 case "$getnetent_r_proto" in
14109 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
14110 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBIE ;;
14112 case "$getnetent_r_proto" in
14113 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
14114 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBI ;;
14116 case "$getnetent_r_proto" in
14117 ''|0) try='int getnetent_r(struct netent*, char*, int);'
14118 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBI ;;
14120 case "$getnetent_r_proto" in
14121 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
14122 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SD ;;
14124 case "$getnetent_r_proto" in
14125 ''|0) d_getnetent_r=undef
14126 getnetent_r_proto=0
14127 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
14128 * ) case "$getnetent_r_proto" in
14129 REENTRANT_PROTO*) ;;
14130 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
14132 echo "Prototype: $try" ;;
14135 *) case "$usethreads" in
14136 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
14138 d_getnetent_r=undef
14139 getnetent_r_proto=0
14143 *) getnetent_r_proto=0
14147 : see if prototypes for various getnetxxx netdb.h functions are available
14149 set d_getnetprotos getnetent $i_netdb netdb.h
14152 : see if getpagesize exists
14153 set getpagesize d_getpagsz
14156 : Optional checks for getprotobyname and getprotobynumber
14158 : see if getprotobyname exists
14159 set getprotobyname d_getpbyname
14162 : see if getprotobynumber exists
14163 set getprotobynumber d_getpbynumber
14166 : see if getprotoent exists
14167 set getprotoent d_getpent
14170 : see if getpgid exists
14171 set getpgid d_getpgid
14174 : see if getpgrp2 exists
14175 set getpgrp2 d_getpgrp2
14178 : see if getppid exists
14179 set getppid d_getppid
14182 : see if getpriority exists
14183 set getpriority d_getprior
14186 : see if getprotobyname_r exists
14187 set getprotobyname_r d_getprotobyname_r
14189 case "$d_getprotobyname_r" in
14191 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14192 case "$d_getprotobyname_r_proto:$usethreads" in
14193 ":define") d_getprotobyname_r_proto=define
14194 set d_getprotobyname_r_proto getprotobyname_r $hdrs
14198 case "$d_getprotobyname_r_proto" in
14200 case "$getprotobyname_r_proto" in
14201 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
14202 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
14204 case "$getprotobyname_r_proto" in
14205 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
14206 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
14208 case "$getprotobyname_r_proto" in
14209 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
14210 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
14212 case "$getprotobyname_r_proto" in
14213 ''|0) d_getprotobyname_r=undef
14214 getprotobyname_r_proto=0
14215 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
14216 * ) case "$getprotobyname_r_proto" in
14217 REENTRANT_PROTO*) ;;
14218 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
14220 echo "Prototype: $try" ;;
14223 *) case "$usethreads" in
14224 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
14226 d_getprotobyname_r=undef
14227 getprotobyname_r_proto=0
14231 *) getprotobyname_r_proto=0
14235 : see if getprotobynumber_r exists
14236 set getprotobynumber_r d_getprotobynumber_r
14238 case "$d_getprotobynumber_r" in
14240 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14241 case "$d_getprotobynumber_r_proto:$usethreads" in
14242 ":define") d_getprotobynumber_r_proto=define
14243 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
14247 case "$d_getprotobynumber_r_proto" in
14249 case "$getprotobynumber_r_proto" in
14250 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
14251 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
14253 case "$getprotobynumber_r_proto" in
14254 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
14255 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
14257 case "$getprotobynumber_r_proto" in
14258 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
14259 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
14261 case "$getprotobynumber_r_proto" in
14262 ''|0) d_getprotobynumber_r=undef
14263 getprotobynumber_r_proto=0
14264 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
14265 * ) case "$getprotobynumber_r_proto" in
14266 REENTRANT_PROTO*) ;;
14267 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
14269 echo "Prototype: $try" ;;
14272 *) case "$usethreads" in
14273 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
14275 d_getprotobynumber_r=undef
14276 getprotobynumber_r_proto=0
14280 *) getprotobynumber_r_proto=0
14284 : see if getprotoent_r exists
14285 set getprotoent_r d_getprotoent_r
14287 case "$d_getprotoent_r" in
14289 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14290 case "$d_getprotoent_r_proto:$usethreads" in
14291 ":define") d_getprotoent_r_proto=define
14292 set d_getprotoent_r_proto getprotoent_r $hdrs
14296 case "$d_getprotoent_r_proto" in
14298 case "$getprotoent_r_proto" in
14299 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
14300 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
14302 case "$getprotoent_r_proto" in
14303 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
14304 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBI ;;
14306 case "$getprotoent_r_proto" in
14307 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
14308 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=S_SBI ;;
14310 case "$getprotoent_r_proto" in
14311 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
14312 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SD ;;
14314 case "$getprotoent_r_proto" in
14315 ''|0) d_getprotoent_r=undef
14316 getprotoent_r_proto=0
14317 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
14318 * ) case "$getprotoent_r_proto" in
14319 REENTRANT_PROTO*) ;;
14320 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
14322 echo "Prototype: $try" ;;
14325 *) case "$usethreads" in
14326 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
14328 d_getprotoent_r=undef
14329 getprotoent_r_proto=0
14333 *) getprotoent_r_proto=0
14337 : see if prototypes for various getprotoxxx netdb.h functions are available
14339 set d_getprotoprotos getprotoent $i_netdb netdb.h
14342 : see if getprpwnam exists
14343 set getprpwnam d_getprpwnam
14346 : see if getpwent exists
14347 set getpwent d_getpwent
14350 : see if getpwent_r exists
14351 set getpwent_r d_getpwent_r
14353 case "$d_getpwent_r" in
14355 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14356 case "$d_getpwent_r_proto:$usethreads" in
14357 ":define") d_getpwent_r_proto=define
14358 set d_getpwent_r_proto getpwent_r $hdrs
14362 case "$d_getpwent_r_proto" in
14364 case "$getpwent_r_proto" in
14365 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
14366 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBWR ;;
14368 case "$getpwent_r_proto" in
14369 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
14370 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIR ;;
14372 case "$getpwent_r_proto" in
14373 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
14374 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBW ;;
14376 case "$getpwent_r_proto" in
14377 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
14378 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBI ;;
14380 case "$getpwent_r_proto" in
14381 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
14382 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBI ;;
14384 case "$getpwent_r_proto" in
14385 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
14386 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIH ;;
14388 case "$getpwent_r_proto" in
14389 ''|0) d_getpwent_r=undef
14391 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
14392 * ) case "$getpwent_r_proto" in
14393 REENTRANT_PROTO*) ;;
14394 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
14396 echo "Prototype: $try" ;;
14399 *) case "$usethreads" in
14400 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
14407 *) getpwent_r_proto=0
14411 : see if getpwnam_r exists
14412 set getpwnam_r d_getpwnam_r
14414 case "$d_getpwnam_r" in
14416 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14417 case "$d_getpwnam_r_proto:$usethreads" in
14418 ":define") d_getpwnam_r_proto=define
14419 set d_getpwnam_r_proto getpwnam_r $hdrs
14423 case "$d_getpwnam_r_proto" in
14425 case "$getpwnam_r_proto" in
14426 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
14427 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
14429 case "$getpwnam_r_proto" in
14430 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
14431 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
14433 case "$getpwnam_r_proto" in
14434 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
14435 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
14437 case "$getpwnam_r_proto" in
14438 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
14439 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
14441 case "$getpwnam_r_proto" in
14442 ''|0) d_getpwnam_r=undef
14444 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
14445 * ) case "$getpwnam_r_proto" in
14446 REENTRANT_PROTO*) ;;
14447 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
14449 echo "Prototype: $try" ;;
14452 *) case "$usethreads" in
14453 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
14460 *) getpwnam_r_proto=0
14464 : see if getpwuid_r exists
14465 set getpwuid_r d_getpwuid_r
14467 case "$d_getpwuid_r" in
14469 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14470 case "$d_getpwuid_r_proto:$usethreads" in
14471 ":define") d_getpwuid_r_proto=define
14472 set d_getpwuid_r_proto getpwuid_r $hdrs
14476 case "$d_getpwuid_r_proto" in
14478 case "$getpwuid_r_proto" in
14479 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
14480 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
14482 case "$getpwuid_r_proto" in
14483 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
14484 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
14486 case "$getpwuid_r_proto" in
14487 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
14488 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
14490 case "$getpwuid_r_proto" in
14491 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
14492 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
14494 case "$getpwuid_r_proto" in
14495 ''|0) d_getpwuid_r=undef
14497 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
14498 * ) case "$getpwuid_r_proto" in
14499 REENTRANT_PROTO*) ;;
14500 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
14502 echo "Prototype: $try" ;;
14505 *) case "$usethreads" in
14506 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
14513 *) getpwuid_r_proto=0
14517 : Optional checks for getsbyname and getsbyport
14519 : see if getservbyname exists
14520 set getservbyname d_getsbyname
14523 : see if getservbyport exists
14524 set getservbyport d_getsbyport
14527 : see if getservent exists
14528 set getservent d_getsent
14531 : see if getservbyname_r exists
14532 set getservbyname_r d_getservbyname_r
14534 case "$d_getservbyname_r" in
14536 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14537 case "$d_getservbyname_r_proto:$usethreads" in
14538 ":define") d_getservbyname_r_proto=define
14539 set d_getservbyname_r_proto getservbyname_r $hdrs
14543 case "$d_getservbyname_r_proto" in
14545 case "$getservbyname_r_proto" in
14546 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
14547 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
14549 case "$getservbyname_r_proto" in
14550 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
14551 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
14553 case "$getservbyname_r_proto" in
14554 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
14555 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
14557 case "$getservbyname_r_proto" in
14558 ''|0) d_getservbyname_r=undef
14559 getservbyname_r_proto=0
14560 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
14561 * ) case "$getservbyname_r_proto" in
14562 REENTRANT_PROTO*) ;;
14563 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
14565 echo "Prototype: $try" ;;
14568 *) case "$usethreads" in
14569 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
14571 d_getservbyname_r=undef
14572 getservbyname_r_proto=0
14576 *) getservbyname_r_proto=0
14580 : see if getservbyport_r exists
14581 set getservbyport_r d_getservbyport_r
14583 case "$d_getservbyport_r" in
14585 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14586 case "$d_getservbyport_r_proto:$usethreads" in
14587 ":define") d_getservbyport_r_proto=define
14588 set d_getservbyport_r_proto getservbyport_r $hdrs
14592 case "$d_getservbyport_r_proto" in
14594 case "$getservbyport_r_proto" in
14595 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
14596 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
14598 case "$getservbyport_r_proto" in
14599 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
14600 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
14602 case "$getservbyport_r_proto" in
14603 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
14604 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
14606 case "$getservbyport_r_proto" in
14607 ''|0) d_getservbyport_r=undef
14608 getservbyport_r_proto=0
14609 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
14610 * ) case "$getservbyport_r_proto" in
14611 REENTRANT_PROTO*) ;;
14612 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
14614 echo "Prototype: $try" ;;
14617 *) case "$usethreads" in
14618 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
14620 d_getservbyport_r=undef
14621 getservbyport_r_proto=0
14625 *) getservbyport_r_proto=0
14629 : see if getservent_r exists
14630 set getservent_r d_getservent_r
14632 case "$d_getservent_r" in
14634 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14635 case "$d_getservent_r_proto:$usethreads" in
14636 ":define") d_getservent_r_proto=define
14637 set d_getservent_r_proto getservent_r $hdrs
14641 case "$d_getservent_r_proto" in
14643 case "$getservent_r_proto" in
14644 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
14645 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBWR ;;
14647 case "$getservent_r_proto" in
14648 ''|0) try='int getservent_r(struct servent*, char*, int);'
14649 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBI ;;
14651 case "$getservent_r_proto" in
14652 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
14653 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=S_SBI ;;
14655 case "$getservent_r_proto" in
14656 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
14657 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SD ;;
14659 case "$getservent_r_proto" in
14660 ''|0) d_getservent_r=undef
14661 getservent_r_proto=0
14662 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
14663 * ) case "$getservent_r_proto" in
14664 REENTRANT_PROTO*) ;;
14665 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
14667 echo "Prototype: $try" ;;
14670 *) case "$usethreads" in
14671 define) echo "getservent_r has no prototype, not using it." >&4 ;;
14673 d_getservent_r=undef
14674 getservent_r_proto=0
14678 *) getservent_r_proto=0
14682 : see if prototypes for various getservxxx netdb.h functions are available
14684 set d_getservprotos getservent $i_netdb netdb.h
14687 : see if getspnam exists
14688 set getspnam d_getspnam
14691 : see if this is a shadow.h system
14692 set shadow.h i_shadow
14695 : see if getspnam_r exists
14696 set getspnam_r d_getspnam_r
14698 case "$d_getspnam_r" in
14700 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
14701 case "$d_getspnam_r_proto:$usethreads" in
14702 ":define") d_getspnam_r_proto=define
14703 set d_getspnam_r_proto getspnam_r $hdrs
14707 case "$d_getspnam_r_proto" in
14709 case "$getspnam_r_proto" in
14710 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
14711 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
14713 case "$getspnam_r_proto" in
14714 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
14715 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=S_CSBI ;;
14717 case "$getspnam_r_proto" in
14718 ''|0) d_getspnam_r=undef
14720 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
14721 * ) case "$getspnam_r_proto" in
14722 REENTRANT_PROTO*) ;;
14723 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
14725 echo "Prototype: $try" ;;
14728 *) case "$usethreads" in
14729 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
14736 *) getspnam_r_proto=0
14740 : see if gettimeofday or ftime exists
14741 set gettimeofday d_gettimeod
14743 case "$d_gettimeod" in
14749 val="$undef"; set d_ftime; eval $setvar
14752 case "$d_gettimeod$d_ftime" in
14755 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
14759 : see if gmtime_r exists
14760 set gmtime_r d_gmtime_r
14762 case "$d_gmtime_r" in
14764 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14765 case "$d_gmtime_r_proto:$usethreads" in
14766 ":define") d_gmtime_r_proto=define
14767 set d_gmtime_r_proto gmtime_r $hdrs
14771 case "$d_gmtime_r_proto" in
14773 case "$gmtime_r_proto" in
14774 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
14775 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=S_TS ;;
14777 case "$gmtime_r_proto" in
14778 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
14779 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=I_TS ;;
14781 case "$gmtime_r_proto" in
14782 ''|0) d_gmtime_r=undef
14784 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
14785 * ) case "$gmtime_r_proto" in
14786 REENTRANT_PROTO*) ;;
14787 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
14789 echo "Prototype: $try" ;;
14792 *) case "$usethreads" in
14793 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
14800 *) gmtime_r_proto=0
14804 : see if hasmntopt exists
14805 set hasmntopt d_hasmntopt
14808 : see if this is a netinet/in.h or sys/in.h system
14809 set netinet/in.h i_niin sys/in.h i_sysin
14812 : see if arpa/inet.h has to be included
14813 set arpa/inet.h i_arpainet
14816 : see if htonl --and friends-- exists
14821 : Maybe they are macros.
14824 $cat >htonl.c <<EOM
14826 #include <sys/types.h>
14827 #$i_niin I_NETINET_IN
14829 #$i_arpainet I_ARPA_INET
14830 #ifdef I_NETINET_IN
14831 #include <netinet/in.h>
14834 #include <sys/in.h>
14837 #include <arpa/inet.h>
14840 printf("Defined as a macro.");
14843 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
14844 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
14846 echo "But it seems to be defined as a macro." >&4
14854 : see if ilogbl exists
14855 set ilogbl d_ilogbl
14860 if set index val -f; eval $csym; $val; then
14861 if set strchr val -f d_strchr; eval $csym; $val; then
14862 if $contains strchr "$strings" >/dev/null 2>&1 ; then
14865 echo "strchr() found." >&4
14869 echo "index() found." >&4
14874 echo "index() found." >&4
14877 if set strchr val -f d_strchr; eval $csym; $val; then
14880 echo "strchr() found." >&4
14882 echo "No index() or strchr() found!" >&4
14887 set d_strchr; eval $setvar
14889 set d_index; eval $setvar
14891 : check whether inet_aton exists
14892 set inet_aton d_inetaton
14895 : see if inet_ntop exists
14896 set inet_ntop d_inetntop
14899 : see if inet_pton exists
14900 set inet_pton d_inetpton
14905 $cat >isascii.c <<EOCP
14908 #$i_stdlib I_STDLIB
14910 #include <stdlib.h>
14921 if eval $compile; then
14922 echo "isascii() found." >&4
14925 echo "isascii() NOT found." >&4
14932 : see if isfinite exists
14933 set isfinite d_isfinite
14936 : see if isinf exists
14940 : see if isnan exists
14944 : see if isnanl exists
14945 set isnanl d_isnanl
14948 : see if killpg exists
14949 set killpg d_killpg
14952 : see if lchown exists
14954 $cat > try.c <<'EOCP'
14955 /* System header to define __stub macros and hopefully few prototypes,
14956 which can conflict with char lchown(); below. */
14957 #include <assert.h>
14958 /* Override any gcc2 internal prototype to avoid an error. */
14959 /* We use char because int might match the return type of a gcc2
14960 builtin and then its argument prototype would still apply. */
14963 /* The GNU C library defines this for functions which it implements
14964 to always fail with ENOSYS. Some functions are actually named
14965 something starting with __ and the normal name is an alias. */
14966 #if defined (__stub_lchown) || defined (__stub___lchown)
14974 if eval $compile; then
14975 $echo "lchown() found." >&4
14978 $echo "lchown() NOT found." >&4
14984 : See if number of significant digits in a double precision number is known
14986 $cat >ldbl_dig.c <<EOM
14987 #$i_limits I_LIMITS
14990 #include <limits.h>
14996 printf("Contains LDBL_DIG");
14999 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
15000 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
15001 echo "LDBL_DIG found." >&4
15004 echo "LDBL_DIG NOT found." >&4
15011 : see if this is a math.h system
15015 : check to see if math.h defines _LIB_VERSION
15016 d_libm_lib_version="$undef"
15020 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
15022 #include <unistd.h>
15024 int main (int argc, char *argv[])
15026 printf ("%d\n", _LIB_VERSION);
15031 if eval $compile; then
15033 echo "Yes, it does ($foo)" >&4
15034 d_libm_lib_version="$define"
15036 echo "No, it does not (probably harmless)" >&4
15043 : see if link exists
15047 : see if localtime_r exists
15048 set localtime_r d_localtime_r
15050 case "$d_localtime_r" in
15052 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15053 case "$d_localtime_r_proto:$usethreads" in
15054 ":define") d_localtime_r_proto=define
15055 set d_localtime_r_proto localtime_r $hdrs
15059 case "$d_localtime_r_proto" in
15061 case "$localtime_r_proto" in
15062 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
15063 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=S_TS ;;
15065 case "$localtime_r_proto" in
15066 ''|0) try='int localtime_r(const time_t*, struct tm*);'
15067 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=I_TS ;;
15069 case "$localtime_r_proto" in
15070 ''|0) d_localtime_r=undef
15071 localtime_r_proto=0
15072 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
15073 * ) case "$localtime_r_proto" in
15074 REENTRANT_PROTO*) ;;
15075 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
15077 echo "Prototype: $try" ;;
15080 *) case "$usethreads" in
15081 define) echo "localtime_r has no prototype, not using it." >&4 ;;
15083 d_localtime_r=undef
15084 localtime_r_proto=0
15088 *) localtime_r_proto=0
15092 : see if localtime_r calls tzset
15093 case "$localtime_r_proto" in
15096 /* Does our libc's localtime_r call tzset ?
15097 * return 0 if so, 1 otherwise.
15099 #$i_systypes I_SYS_TYPES
15100 #$i_unistd I_UNISTD
15102 #$i_stdlib I_STDLIB
15103 #$i_string I_STRING
15104 #$i_malloc I_MALLOC
15106 # include <sys/types.h>
15109 # include <unistd.h>
15115 #include <stdlib.h>
15118 # include <string.h>
15120 # include <strings.h>
15123 # include <malloc.h>
15127 time_t t = time(0L);
15128 char w_tz[]="TZ" "=GMT+5",
15129 e_tz[]="TZ" "=GMT-5",
15130 *tz_e = (char*)malloc(16),
15131 *tz_w = (char*)malloc(16);
15132 struct tm tm_e, tm_w;
15133 memset(&tm_e,'\0',sizeof(struct tm));
15134 memset(&tm_w,'\0',sizeof(struct tm));
15139 localtime_r(&t, &tm_e);
15142 localtime_r(&t, &tm_w);
15144 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
15150 if eval $compile; then
15151 if $run ./try; then
15152 d_localtime_r_needs_tzset=undef;
15154 d_localtime_r_needs_tzset=define;
15157 d_localtime_r_needs_tzset=undef;
15161 d_localtime_r_needs_tzset=undef;
15166 : see if localeconv exists
15167 set localeconv d_locconv
15170 : see if lockf exists
15174 : see if prototype for lseek is available
15176 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
15179 : see if lstat exists
15183 : see if madvise exists
15184 set madvise d_madvise
15187 : see if malloc_size exists
15188 set malloc_size d_malloc_size
15191 : see if malloc_size_good exists
15192 set malloc_good_size d_malloc_good_size
15195 : see if mblen exists
15199 : see if mbstowcs exists
15200 set mbstowcs d_mbstowcs
15203 : see if mbtowc exists
15204 set mbtowc d_mbtowc
15207 : see if memchr exists
15208 set memchr d_memchr
15211 : see if memcmp exists
15212 set memcmp d_memcmp
15215 : see if memcpy exists
15216 set memcpy d_memcpy
15219 : see if memmove exists
15220 set memmove d_memmove
15223 : see if memset exists
15224 set memset d_memset
15227 : see if mkdir exists
15231 : see if mkdtemp exists
15232 set mkdtemp d_mkdtemp
15235 : see if mkfifo exists
15236 set mkfifo d_mkfifo
15239 : see if mkstemp exists
15240 set mkstemp d_mkstemp
15243 : see if mkstemps exists
15244 set mkstemps d_mkstemps
15247 : see if mktime exists
15248 set mktime d_mktime
15251 : see if this is a sys/mman.h system
15252 set sys/mman.h i_sysmman
15255 : see if mmap exists
15258 : see what shmat returns
15259 : default to something harmless
15261 case "$i_sysmman$d_mmap" in
15263 $cat >mmap.c <<'END'
15264 #include <sys/mman.h>
15267 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
15272 echo "and it returns ($mmaptype)." >&4
15278 : see if sqrtl exists
15282 : see if scalbnl exists
15283 set scalbnl d_scalbnl
15286 : see if modfl exists
15290 : see if prototype for modfl is available
15292 set d_modflproto modfl $i_math math.h
15295 d_modfl_pow32_bug="$undef"
15297 case "$d_longdbl$d_modfl" in
15300 Checking to see whether your modfl() is okay for large values...
15306 if $test "X$d_modflproto" != "X$define"; then
15307 $cat >>try.c <<EOCP
15308 /* Sigh. many current glibcs provide the function, but do not prototype it. */
15309 long double modfl (long double, long double *);
15312 $cat >>try.c <<EOCP
15314 long double nv = 4294967303.15;
15320 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
15324 case "$osname:$gccversion" in
15325 aix:) saveccflags="$ccflags"
15326 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
15329 if eval $compile; then
15332 *" 4294967303.150000 1.150000 4294967302.000000")
15333 echo >&4 "Your modfl() is broken for large values."
15334 d_modfl_pow32_bug="$define"
15336 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
15340 *" 4294967303.150000 0.150000 4294967303.000000")
15341 echo >&4 "Your modfl() seems okay for large values."
15343 *) echo >&4 "I don't understand your modfl() at all."
15349 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
15352 case "$osname:$gccversion" in
15353 aix:) ccflags="$saveccflags" ;; # restore
15358 if $test "$uselongdouble" = "$define"; then
15360 if $test "$d_sqrtl" != "$define"; then
15361 message="$message sqrtl"
15363 if $test "$d_modfl" != "$define"; then
15364 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
15365 echo "You have both aintl and copysignl, so I can emulate modfl."
15367 message="$message modfl"
15370 if $test "$d_frexpl" != "$define"; then
15371 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
15372 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
15374 message="$message frexpl"
15378 if $test "$message" != ""; then
15381 *** You requested the use of long doubles but you do not seem to have
15382 *** the following mathematical functions needed for long double support:
15384 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
15385 *** Cannot continue, aborting.
15393 : see if mprotect exists
15394 set mprotect d_mprotect
15397 : see if msgctl exists
15398 set msgctl d_msgctl
15401 : see if msgget exists
15402 set msgget d_msgget
15405 : see if msgsnd exists
15406 set msgsnd d_msgsnd
15409 : see if msgrcv exists
15410 set msgrcv d_msgrcv
15413 : see how much of the 'msg*(2)' library is present.
15416 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
15417 *"$undef"*) h_msg=false;;
15421 case "`ipcs 2>&1`" in
15422 "SVID messages"*"not configured"*)
15423 echo "Your $osname does not have the msg*(2) configured." >&4
15426 set msgctl d_msgctl
15428 set msgget d_msgget
15430 set msgsnd d_msgsnd
15432 set msgrcv d_msgrcv
15438 : we could also check for sys/ipc.h ...
15439 if $h_msg && $test `./findhdr sys/msg.h`; then
15440 echo "You have the full msg*(2) library." >&4
15443 echo "You don't have the full msg*(2) library." >&4
15449 : Check for msghdr_s
15451 echo "Checking to see if your system supports struct msghdr..." >&4
15452 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
15454 case "$d_msghdr_s" in
15455 "$define") echo "Yes, it does." ;;
15456 *) echo "No, it doesn't." ;;
15460 : see if msync exists
15464 : see if munmap exists
15465 set munmap d_munmap
15468 : see if nice exists
15472 : see if this is a langinfo.h system
15473 set langinfo.h i_langinfo
15476 : see if nl_langinfo exists
15477 set nl_langinfo d_nl_langinfo
15480 : check for volatile keyword
15482 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
15483 $cat >try.c <<'EOCP'
15486 typedef struct _goo_struct goo_struct;
15487 goo_struct * volatile goo = ((goo_struct *)0);
15488 struct _goo_struct {
15493 typedef unsigned short foo_t;
15494 char *volatile foo;
15496 volatile foo_t blech;
15500 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
15502 echo "Yup, it does."
15505 echo "Nope, it doesn't."
15511 : Check basic sizes
15513 $echo "Choosing the C types to be used for Perl's internal types..." >&4
15515 case "$use64bitint:$d_quad:$quadtype" in
15518 uvtype="$uquadtype"
15523 uvtype="unsigned long"
15529 case "$uselongdouble:$d_longdbl" in
15531 nvtype="long double"
15532 nvsize=$longdblsize
15539 $echo "(IV will be "$ivtype", $ivsize bytes)"
15540 $echo "(UV will be "$uvtype", $uvsize bytes)"
15541 $echo "(NV will be "$nvtype", $nvsize bytes)"
15544 #$i_inttypes I_INTTYPES
15546 #include <inttypes.h>
15551 int8_t i = INT8_MAX;
15552 uint8_t u = UINT8_MAX;
15553 printf("int8_t\n");
15556 int16_t i = INT16_MAX;
15557 uint16_t i = UINT16_MAX;
15558 printf("int16_t\n");
15561 int32_t i = INT32_MAX;
15562 uint32_t u = UINT32_MAX;
15563 printf("int32_t\n");
15568 i8type="signed char"
15569 u8type="unsigned char"
15574 '') case "$shortsize" in
15576 u16type="unsigned short"
15584 '') set try -DINT16
15585 if eval $compile; then
15586 case "`$run ./try`" in
15598 '') if $test $shortsize -ge 2; then
15600 u16type="unsigned short"
15608 '') case "$longsize" in
15610 u32type="unsigned long"
15614 *) case "$intsize" in
15616 u32type="unsigned int"
15626 '') set try -DINT32
15627 if eval $compile; then
15628 case "`$run ./try`" in
15640 '') if $test $intsize -ge 4; then
15642 u32type="unsigned int"
15650 '') case "$d_quad:$quadtype" in
15652 i64type="$quadtype"
15653 u64type="$uquadtype"
15661 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
15662 : volatile so that the compiler has to store it out to memory.
15663 if test X"$d_volatile" = X"$define"; then
15668 #$i_stdlib I_STDLIB
15670 #include <stdlib.h>
15672 #include <sys/types.h>
15673 #include <signal.h>
15675 $volatile int bletched = 0;
15676 $signal_t blech(int s) { bletched = 1; }
15681 int n = 8 * $uvsize;
15684 signal(SIGFPE, blech);
15687 for (i = 0; i < n; i++) {
15688 u = u << 1 | ($uvtype)1;
15690 if (($uvtype)d != u)
15694 d = ($nvtype)(u - 1);
15695 if (($uvtype)d != (u - 1))
15702 printf("%d\n", ((i == n) ? -n : i));
15708 d_nv_preserves_uv="$undef"
15709 if eval $compile; then
15710 nv_preserves_uv_bits="`$run ./try`"
15712 case "$nv_preserves_uv_bits" in
15714 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
15715 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
15716 d_nv_preserves_uv="$define"
15718 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
15719 d_nv_preserves_uv="$undef" ;;
15720 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
15721 nv_preserves_uv_bits="0" ;;
15725 $echo "Checking to find the largest integer value your NVs can hold..." >&4
15726 : volatile so that the compiler has to store it out to memory.
15727 if test X"$d_volatile" = X"$define"; then
15733 typedef $nvtype NV;
15740 while(count < 256) {
15741 $volatile NV up = value + 1.0;
15742 $volatile NV negated = -value;
15743 $volatile NV down = negated - 1.0;
15744 $volatile NV got_up = up - value;
15745 int up_good = got_up == 1.0;
15746 int got_down = down - negated;
15747 int down_good = got_down == -1.0;
15749 if (down_good != up_good) {
15751 "Inconsistency - up %d %f; down %d %f; for 2**%d (%.20f)\n",
15752 up_good, (double) got_up, down_good, (double) got_down,
15753 count, (double) value);
15760 fputs("256.0", stdout);
15763 fputs("2.0", stdout);
15769 fputs("*", stdout);
15775 fprintf(stderr, "Cannot overflow integer range, even at 2**%d (%.20f)\n",
15776 count, (double) value);
15782 nv_overflows_integers_at='0'
15783 if eval $compile; then
15789 The largest integer your NVs can preserve is equal to $xxx
15791 nv_overflows_integers_at="$xxx"
15794 Cannot determine the largest integer value your NVs can hold, unexpected output
15801 Cannot determine the largest integer value your NVs can hold
15808 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
15809 : volatile so that the compiler has to store it out to memory.
15810 if test X"$d_volatile" = X"$define"; then
15815 #$i_stdlib I_STDLIB
15817 #include <stdlib.h>
15819 #$i_string I_STRING
15821 # include <string.h>
15823 # include <strings.h>
15825 #include <sys/types.h>
15826 #include <signal.h>
15828 $volatile int bletched = 0;
15829 $signal_t blech(int s) { bletched = 1; }
15832 int checkit($nvtype d, char *where) {
15833 unsigned char *p = (char *)&d;
15834 unsigned char *end = p + sizeof(d);
15844 printf("No - %s: 0x", where);
15846 printf ("%02X", *p++);
15851 int main(int argc, char **argv) {
15854 fail += checkit(d, "0.0");
15856 /* The compiler shouldn't be assuming that bletched is 0 */
15859 fail += checkit(d, "bleched");
15862 signal(SIGFPE, blech);
15865 /* Paranoia - the compiler should have no way of knowing that ANSI says
15866 that argv[argc] will always be NULL. Actually, if it did assume this it
15867 would be buggy, as this is C and main() can be called from elsewhere in
15869 d = argv[argc] ? 1 : 0;
15872 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
15875 fail += checkit(d, "ternary");
15877 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
15880 printf("No - memset doesn't give 0.0\n");
15881 /* This might just blow up: */
15882 printf("(gives %g)\n", d);
15888 printf("No - something bleched\n");
15893 printf("No - %d fail(s)\n", fail);
15902 d_nv_zero_is_allbits_zero="$undef"
15903 if eval $compile; then
15909 0.0 is represented as all bits zero in memory
15911 d_nv_zero_is_allbits_zero="$define"
15914 0.0 is not represented as all bits zero in memory
15916 d_nv_zero_is_allbits_zero="$undef"
15921 0.0 is not represented as all bits zero in memory
15923 d_nv_zero_is_allbits_zero="$undef"
15929 : check for off64_t
15931 echo "Checking to see if you have off64_t..." >&4
15933 #include <sys/types.h>
15934 #include <unistd.h>
15935 int main() { off64_t x = 7; }
15938 if eval $compile; then
15940 echo "You have off64_t."
15943 echo "You do not have off64_t."
15944 case "$lseeksize" in
15945 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
15952 : how to create joinable pthreads
15953 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
15955 echo "Checking what constant to use for creating joinable pthreads..." >&4
15956 $cat >try.c <<'EOCP'
15957 #include <pthread.h>
15959 int detachstate = JOINABLE;
15962 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
15963 if eval $compile; then
15964 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
15965 val="$undef" # Yes, undef.
15966 set d_old_pthread_create_joinable
15969 set old_pthread_create_joinable
15972 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
15973 if eval $compile; then
15974 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
15976 set d_old_pthread_create_joinable
15978 val=PTHREAD_CREATE_UNDETACHED
15979 set old_pthread_create_joinable
15982 set try -DJOINABLE=__UNDETACHED
15983 if eval $compile; then
15984 echo "You seem to use __UNDETACHED." >&4
15986 set d_old_pthread_create_joinable
15989 set old_pthread_create_joinable
15992 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
15994 set d_old_pthread_create_joinable
15997 set old_pthread_create_joinable
16004 d_old_pthread_create_joinable="$undef"
16005 old_pthread_create_joinable=""
16008 : see if pause exists
16012 : see if poll exists
16016 : see if prctl exists
16020 : see if prctl supports PR_SET_NAME
16021 d_prctl_set_name=$undef
16025 #include <sys/prctl.h>
16027 int main (int argc, char *argv[])
16029 return (prctl (PR_SET_NAME, "Test"));
16033 if eval $compile_ok && $run ./try; then
16034 echo "Your prctl (PR_SET_NAME, ...) works"
16035 d_prctl_set_name=$define
16041 : see if readlink exists
16042 set readlink d_readlink
16045 : Check if exe is symlink to abs path of executing program
16049 case "$d_readlink" in
16051 : NetBSD first as /proc/self is a symlink to /proc/curproc, and it feels
16052 : more tidy to avoid an extra level of symlink
16053 set NetBSD /proc/curproc/exe Linux /proc/self/exe FreeBSD /proc/curproc/file Solaris /proc/self/path/a.out
16054 while test $# -gt 0; do
16057 if $issymlink $try; then
16058 $ls -l $try > reflect
16059 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
16060 echo "You have $type-like $try."
16061 procselfexe='"'$try'"'
16063 : This will break out of the loop
16074 : backward compatibility for d_hvfork
16075 if test X$d_hvfork != X; then
16076 d_vfork="$d_hvfork"
16079 : see if there is a vfork
16084 d_pseudofork=$undef
16086 : Ok, but do we want to use it. vfork is reportedly unreliable in
16087 : perl on Solaris 2.x, and probably elsewhere.
16091 case "$usevfork" in
16097 Perl can only use a vfork() that doesn't suffer from strict
16098 restrictions on calling functions or modifying global data in
16099 the child. For example, glibc-2.1 contains such a vfork()
16100 that is unsuitable. If your system provides a proper fork()
16101 call, chances are that you do NOT want perl to use vfork().
16104 rp="Do you still want to use vfork()?"
16109 echo "Ok, we won't use vfork()."
16118 $define) usevfork='true';;
16119 *) usevfork='false';;
16122 : see whether the pthread_atfork exists
16124 #include <pthread.h>
16127 #ifdef PTHREAD_ATFORK
16128 pthread_atfork(NULL,NULL,NULL);
16133 : see if pthread_atfork exists
16134 set try -DPTHREAD_ATFORK
16135 if eval $compile; then
16140 case "$usethreads" in
16143 $define) echo 'pthread_atfork found.' >&4 ;;
16144 *) echo 'pthread_atfork NOT found.' >&4 ;;
16147 set d_pthread_atfork
16150 : see if pthread_attr_setscope exists
16151 set pthread_attr_setscope d_pthread_attr_setscope
16154 : see whether the various POSIXish _yields exist
16156 #include <pthread.h>
16162 #ifdef PTHREAD_YIELD
16165 #ifdef PTHREAD_YIELD_NULL
16166 pthread_yield(NULL);
16172 : see if sched_yield exists
16173 set try -DSCHED_YIELD
16174 if eval $compile; then
16176 sched_yield='sched_yield()'
16180 case "$usethreads" in
16183 $define) echo 'sched_yield() found.' >&4 ;;
16184 *) echo 'sched_yield() NOT found.' >&4 ;;
16190 : see if pthread_yield exists
16191 set try -DPTHREAD_YIELD
16192 if eval $compile; then
16194 case "$sched_yield" in
16195 '') sched_yield='pthread_yield()' ;;
16198 set try -DPTHREAD_YIELD_NULL
16199 if eval $compile; then
16201 case "$sched_yield" in
16202 '') sched_yield='pthread_yield(NULL)' ;;
16208 case "$usethreads" in
16211 $define) echo 'pthread_yield() found.' >&4 ;;
16212 *) echo 'pthread_yield() NOT found.' >&4 ;;
16216 set d_pthread_yield
16218 case "$sched_yield" in
16219 '') sched_yield=undef ;;
16223 : see if random_r exists
16224 set random_r d_random_r
16226 case "$d_random_r" in
16228 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16229 case "$d_random_r_proto:$usethreads" in
16230 ":define") d_random_r_proto=define
16231 set d_random_r_proto random_r $hdrs
16235 case "$d_random_r_proto" in
16237 case "$random_r_proto" in
16238 ''|0) try='int random_r(int*, struct random_data*);'
16239 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_iS ;;
16241 case "$random_r_proto" in
16242 ''|0) try='int random_r(long*, struct random_data*);'
16243 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_lS ;;
16245 case "$random_r_proto" in
16246 ''|0) try='int random_r(struct random_data*, int32_t*);'
16247 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_St ;;
16249 case "$random_r_proto" in
16250 ''|0) d_random_r=undef
16252 echo "Disabling random_r, cannot determine prototype." >&4 ;;
16253 * ) case "$random_r_proto" in
16254 REENTRANT_PROTO*) ;;
16255 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
16257 echo "Prototype: $try" ;;
16260 *) case "$usethreads" in
16261 define) echo "random_r has no prototype, not using it." >&4 ;;
16268 *) random_r_proto=0
16272 : see if readdir and friends exist
16273 set readdir d_readdir
16275 set seekdir d_seekdir
16277 set telldir d_telldir
16279 set rewinddir d_rewinddir
16282 : see if readdir64_r exists
16283 set readdir64_r d_readdir64_r
16285 case "$d_readdir64_r" in
16287 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16288 case "$d_readdir64_r_proto:$usethreads" in
16289 ":define") d_readdir64_r_proto=define
16290 set d_readdir64_r_proto readdir64_r $hdrs
16294 case "$d_readdir64_r_proto" in
16296 case "$readdir64_r_proto" in
16297 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
16298 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TSR ;;
16300 case "$readdir64_r_proto" in
16301 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
16302 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TS ;;
16304 case "$readdir64_r_proto" in
16305 ''|0) d_readdir64_r=undef
16306 readdir64_r_proto=0
16307 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
16308 * ) case "$readdir64_r_proto" in
16309 REENTRANT_PROTO*) ;;
16310 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
16312 echo "Prototype: $try" ;;
16315 *) case "$usethreads" in
16316 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
16318 d_readdir64_r=undef
16319 readdir64_r_proto=0
16323 *) readdir64_r_proto=0
16327 : see if readdir_r exists
16328 set readdir_r d_readdir_r
16330 case "$d_readdir_r" in
16332 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16333 case "$d_readdir_r_proto:$usethreads" in
16334 ":define") d_readdir_r_proto=define
16335 set d_readdir_r_proto readdir_r $hdrs
16339 case "$d_readdir_r_proto" in
16341 case "$readdir_r_proto" in
16342 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
16343 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TSR ;;
16345 case "$readdir_r_proto" in
16346 ''|0) try='int readdir_r(DIR*, struct dirent*);'
16347 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TS ;;
16349 case "$readdir_r_proto" in
16350 ''|0) d_readdir_r=undef
16352 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
16353 * ) case "$readdir_r_proto" in
16354 REENTRANT_PROTO*) ;;
16355 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
16357 echo "Prototype: $try" ;;
16360 *) case "$usethreads" in
16361 define) echo "readdir_r has no prototype, not using it." >&4 ;;
16368 *) readdir_r_proto=0
16372 : see if readv exists
16376 : see if recvmsg exists
16377 set recvmsg d_recvmsg
16380 : see if rename exists
16381 set rename d_rename
16384 : see if rmdir exists
16388 : see if memory.h is available.
16393 : See if it conflicts with string.h
16399 $cppstdin $cppflags $cppminus < $strings > mem.h
16400 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
16402 echo "We won't be including <memory.h>."
16412 : can bcopy handle overlapping blocks?
16415 case "$d_memmove" in
16416 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
16417 *) case "$d_bcopy" in
16419 echo "Checking to see if bcopy() can do overlapping copies..." >&4
16421 #$i_memory I_MEMORY
16422 #$i_stdlib I_STDLIB
16423 #$i_string I_STRING
16424 #$i_unistd I_UNISTD
16426 $cat >>try.c <<'EOCP'
16429 # include <memory.h>
16432 # include <stdlib.h>
16435 # include <string.h>
16437 # include <strings.h>
16440 # include <unistd.h> /* Needed for NetBSD */
16444 char buf[128], abc[128];
16450 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16451 try to store the string in read-only memory. */
16452 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
16454 for (align = 7; align >= 0; align--) {
16455 for (len = 36; len; len--) {
16457 bcopy(abc, b, len);
16458 for (off = 1; off <= len; off++) {
16459 bcopy(b, b+off, len);
16460 bcopy(b+off, b, len);
16461 if (bcmp(b, abc, len))
16470 if eval $compile_ok; then
16471 if $run ./try 2>/dev/null; then
16472 echo "Yes, it can."
16475 echo "It can't, sorry."
16478 echo "(I can't compile the test program, so we'll assume not...)"
16488 : can memcpy handle overlapping blocks?
16491 case "$d_memmove" in
16492 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
16493 *) case "$d_memcpy" in
16495 echo "Checking to see if memcpy() can do overlapping copies..." >&4
16497 #$i_memory I_MEMORY
16498 #$i_stdlib I_STDLIB
16499 #$i_string I_STRING
16500 #$i_unistd I_UNISTD
16502 $cat >>try.c <<'EOCP'
16505 # include <memory.h>
16508 # include <stdlib.h>
16511 # include <string.h>
16513 # include <strings.h>
16516 # include <unistd.h> /* Needed for NetBSD */
16520 char buf[128], abc[128];
16526 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16527 try to store the string in read-only memory. */
16528 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
16530 for (align = 7; align >= 0; align--) {
16531 for (len = 36; len; len--) {
16533 memcpy(b, abc, len);
16534 for (off = 1; off <= len; off++) {
16535 memcpy(b+off, b, len);
16536 memcpy(b, b+off, len);
16537 if (memcmp(b, abc, len))
16546 if eval $compile_ok; then
16547 if $run ./try 2>/dev/null; then
16548 echo "Yes, it can."
16551 echo "It can't, sorry."
16554 echo "(I can't compile the test program, so we'll assume not...)"
16564 : can memcmp be trusted to compare relative magnitude?
16566 case "$d_memcmp" in
16569 echo "Checking if your memcmp() can compare relative magnitude..." >&4
16571 #$i_memory I_MEMORY
16572 #$i_stdlib I_STDLIB
16573 #$i_string I_STRING
16574 #$i_unistd I_UNISTD
16576 $cat >>try.c <<'EOCP'
16579 # include <memory.h>
16582 # include <stdlib.h>
16585 # include <string.h>
16587 # include <strings.h>
16590 # include <unistd.h> /* Needed for NetBSD */
16596 if ((a < b) && memcmp(&a, &b, 1) < 0)
16602 if eval $compile_ok; then
16603 if $run ./try 2>/dev/null; then
16604 echo "Yes, it can."
16607 echo "No, it can't (it uses signed chars)."
16610 echo "(I can't compile the test program, so we'll assume not...)"
16618 : see if prototype for sbrk is available
16620 set d_sbrkproto sbrk $i_unistd unistd.h
16623 : see if select exists
16624 set select d_select
16627 : see if semctl exists
16628 set semctl d_semctl
16631 : see if semget exists
16632 set semget d_semget
16635 : see if semop exists
16639 : see how much of the 'sem*(2)' library is present.
16642 case "$d_semctl$d_semget$d_semop" in
16643 *"$undef"*) h_sem=false;;
16647 case "`ipcs 2>&1`" in
16648 "SVID messages"*"not configured"*)
16649 echo "Your $osname does not have the sem*(2) configured." >&4
16652 set semctl d_semctl
16654 set semget d_semget
16662 : we could also check for sys/ipc.h ...
16663 if $h_sem && $test `./findhdr sys/sem.h`; then
16664 echo "You have the full sem*(2) library." >&4
16667 echo "You don't have the full sem*(2) library." >&4
16673 : see whether sys/sem.h defines union semun
16675 $cat > try.c <<'END'
16676 #include <sys/types.h>
16677 #include <sys/ipc.h>
16678 #include <sys/sem.h>
16679 int main () { union semun semun; semun.buf = 0; }
16682 if eval $compile; then
16683 echo "You have union semun in <sys/sem.h>." >&4
16686 echo "You do not have union semun in <sys/sem.h>." >&4
16693 : see how to do semctl IPC_STAT
16697 $cat > tryh.h <<END
16700 # define S_IRUSR S_IREAD
16701 # define S_IWUSR S_IWRITE
16702 # define S_IXUSR S_IEXEC
16704 # define S_IRUSR 0400
16705 # define S_IWUSR 0200
16706 # define S_IXUSR 0100
16708 # define S_IRGRP (S_IRUSR>>3)
16709 # define S_IWGRP (S_IWUSR>>3)
16710 # define S_IXGRP (S_IXUSR>>3)
16711 # define S_IROTH (S_IRUSR>>6)
16712 # define S_IWOTH (S_IWUSR>>6)
16713 # define S_IXOTH (S_IXUSR>>6)
16716 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
16717 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
16718 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
16721 : see whether semctl IPC_STAT can use union semun
16722 case "$d_semctl_semun" in
16726 #include <sys/types.h>
16727 #include <sys/ipc.h>
16728 #include <sys/sem.h>
16729 #include <sys/stat.h>
16736 #$d_union_semun HAS_UNION_SEMUN
16739 #ifndef HAS_UNION_SEMUN
16742 struct semid_ds *buf;
16743 unsigned short *array;
16749 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16750 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16752 struct semid_ds argbuf;
16755 st = semctl(sem, 0, IPC_STAT, arg);
16759 # endif /* IPC_STAT */
16760 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16762 if (semctl(sem, 0, IPC_RMID, arg) != 0)
16763 # endif /* IPC_RMID */
16764 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16766 #endif /* IPC_PRIVATE && ... */
16767 printf("semget failed: errno = %d\n", errno);
16772 if eval $compile; then
16775 semun) val="$define" ;;
16783 case "$d_semctl_semun" in
16785 echo "You can use union semun for semctl IPC_STAT." >&4
16788 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
16793 : see whether semctl IPC_STAT can use struct semid_ds pointer
16794 case "$d_semctl_semid_ds" in
16797 $cat > try.c <<'END'
16798 #include <sys/types.h>
16799 #include <sys/ipc.h>
16800 #include <sys/sem.h>
16801 #include <sys/stat.h>
16809 struct semid_ds arg;
16812 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16813 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16816 st = semctl(sem, 0, IPC_STAT, &arg);
16818 printf("semid_ds\n");
16820 # endif /* IPC_STAT */
16821 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16823 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
16824 # endif /* IPC_RMID */
16825 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16827 #endif /* IPC_PRIVATE && ... */
16828 printf("semget failed: errno = %d\n", errno);
16834 if eval $compile; then
16837 semid_ds) val="$define" ;;
16841 set d_semctl_semid_ds
16845 case "$d_semctl_semid_ds" in
16847 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
16849 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
16855 # We do not have the full sem*(2) library, so assume we can not
16861 set d_semctl_semid_ds
16867 : see if sendmsg exists
16868 set sendmsg d_sendmsg
16871 : see if setegid exists
16872 set setegid d_setegid
16875 : see if seteuid exists
16876 set seteuid d_seteuid
16879 : see if setgrent exists
16880 set setgrent d_setgrent
16883 : see if setgrent_r exists
16884 set setgrent_r d_setgrent_r
16886 case "$d_setgrent_r" in
16888 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
16889 case "$d_setgrent_r_proto:$usethreads" in
16890 ":define") d_setgrent_r_proto=define
16891 set d_setgrent_r_proto setgrent_r $hdrs
16895 case "$d_setgrent_r_proto" in
16897 case "$setgrent_r_proto" in
16898 ''|0) try='int setgrent_r(FILE**);'
16899 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=I_H ;;
16901 case "$setgrent_r_proto" in
16902 ''|0) try='void setgrent_r(FILE**);'
16903 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=V_H ;;
16905 case "$setgrent_r_proto" in
16906 ''|0) d_setgrent_r=undef
16908 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
16909 * ) case "$setgrent_r_proto" in
16910 REENTRANT_PROTO*) ;;
16911 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
16913 echo "Prototype: $try" ;;
16916 *) case "$usethreads" in
16917 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
16924 *) setgrent_r_proto=0
16928 : see if sethostent exists
16929 set sethostent d_sethent
16932 : see if sethostent_r exists
16933 set sethostent_r d_sethostent_r
16935 case "$d_sethostent_r" in
16937 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16938 case "$d_sethostent_r_proto:$usethreads" in
16939 ":define") d_sethostent_r_proto=define
16940 set d_sethostent_r_proto sethostent_r $hdrs
16944 case "$d_sethostent_r_proto" in
16946 case "$sethostent_r_proto" in
16947 ''|0) try='int sethostent_r(int, struct hostent_data*);'
16948 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=I_ID ;;
16950 case "$sethostent_r_proto" in
16951 ''|0) try='void sethostent_r(int, struct hostent_data*);'
16952 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=V_ID ;;
16954 case "$sethostent_r_proto" in
16955 ''|0) d_sethostent_r=undef
16956 sethostent_r_proto=0
16957 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
16958 * ) case "$sethostent_r_proto" in
16959 REENTRANT_PROTO*) ;;
16960 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
16962 echo "Prototype: $try" ;;
16965 *) case "$usethreads" in
16966 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
16968 d_sethostent_r=undef
16969 sethostent_r_proto=0
16973 *) sethostent_r_proto=0
16977 : see if setitimer exists
16978 set setitimer d_setitimer
16981 : see if setlinebuf exists
16982 set setlinebuf d_setlinebuf
16985 : see if setlocale exists
16986 set setlocale d_setlocale
16989 : see if locale.h is available
16990 set locale.h i_locale
16993 : see if setlocale_r exists
16994 set setlocale_r d_setlocale_r
16996 case "$d_setlocale_r" in
16998 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
16999 case "$d_setlocale_r_proto:$usethreads" in
17000 ":define") d_setlocale_r_proto=define
17001 set d_setlocale_r_proto setlocale_r $hdrs
17005 case "$d_setlocale_r_proto" in
17007 case "$setlocale_r_proto" in
17008 ''|0) try='int setlocale_r(int, const char*, char*, int);'
17009 ./protochk "$extern_C $try" $hdrs && setlocale_r_proto=I_ICBI ;;
17011 case "$setlocale_r_proto" in
17012 ''|0) d_setlocale_r=undef
17013 setlocale_r_proto=0
17014 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
17015 * ) case "$setlocale_r_proto" in
17016 REENTRANT_PROTO*) ;;
17017 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
17019 echo "Prototype: $try" ;;
17022 *) case "$usethreads" in
17023 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
17025 d_setlocale_r=undef
17026 setlocale_r_proto=0
17030 *) setlocale_r_proto=0
17034 : see if setnetent exists
17035 set setnetent d_setnent
17038 : see if setnetent_r exists
17039 set setnetent_r d_setnetent_r
17041 case "$d_setnetent_r" in
17043 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17044 case "$d_setnetent_r_proto:$usethreads" in
17045 ":define") d_setnetent_r_proto=define
17046 set d_setnetent_r_proto setnetent_r $hdrs
17050 case "$d_setnetent_r_proto" in
17052 case "$setnetent_r_proto" in
17053 ''|0) try='int setnetent_r(int, struct netent_data*);'
17054 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=I_ID ;;
17056 case "$setnetent_r_proto" in
17057 ''|0) try='void setnetent_r(int, struct netent_data*);'
17058 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=V_ID ;;
17060 case "$setnetent_r_proto" in
17061 ''|0) d_setnetent_r=undef
17062 setnetent_r_proto=0
17063 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
17064 * ) case "$setnetent_r_proto" in
17065 REENTRANT_PROTO*) ;;
17066 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
17068 echo "Prototype: $try" ;;
17071 *) case "$usethreads" in
17072 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
17074 d_setnetent_r=undef
17075 setnetent_r_proto=0
17079 *) setnetent_r_proto=0
17083 : see if setprotoent exists
17084 set setprotoent d_setpent
17087 : see if setpgid exists
17088 set setpgid d_setpgid
17091 : see if setpgrp2 exists
17092 set setpgrp2 d_setpgrp2
17095 : see if setpriority exists
17096 set setpriority d_setprior
17099 : see if setproctitle exists
17100 set setproctitle d_setproctitle
17103 : see if setprotoent_r exists
17104 set setprotoent_r d_setprotoent_r
17106 case "$d_setprotoent_r" in
17108 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17109 case "$d_setprotoent_r_proto:$usethreads" in
17110 ":define") d_setprotoent_r_proto=define
17111 set d_setprotoent_r_proto setprotoent_r $hdrs
17115 case "$d_setprotoent_r_proto" in
17117 case "$setprotoent_r_proto" in
17118 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
17119 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=I_ID ;;
17121 case "$setprotoent_r_proto" in
17122 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
17123 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=V_ID ;;
17125 case "$setprotoent_r_proto" in
17126 ''|0) d_setprotoent_r=undef
17127 setprotoent_r_proto=0
17128 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
17129 * ) case "$setprotoent_r_proto" in
17130 REENTRANT_PROTO*) ;;
17131 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
17133 echo "Prototype: $try" ;;
17136 *) case "$usethreads" in
17137 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
17139 d_setprotoent_r=undef
17140 setprotoent_r_proto=0
17144 *) setprotoent_r_proto=0
17148 : see if setpwent exists
17149 set setpwent d_setpwent
17152 : see if setpwent_r exists
17153 set setpwent_r d_setpwent_r
17155 case "$d_setpwent_r" in
17157 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
17158 case "$d_setpwent_r_proto:$usethreads" in
17159 ":define") d_setpwent_r_proto=define
17160 set d_setpwent_r_proto setpwent_r $hdrs
17164 case "$d_setpwent_r_proto" in
17166 case "$setpwent_r_proto" in
17167 ''|0) try='int setpwent_r(FILE**);'
17168 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=I_H ;;
17170 case "$setpwent_r_proto" in
17171 ''|0) try='void setpwent_r(FILE**);'
17172 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=V_H ;;
17174 case "$setpwent_r_proto" in
17175 ''|0) d_setpwent_r=undef
17177 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
17178 * ) case "$setpwent_r_proto" in
17179 REENTRANT_PROTO*) ;;
17180 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
17182 echo "Prototype: $try" ;;
17185 *) case "$usethreads" in
17186 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
17193 *) setpwent_r_proto=0
17197 : see if setregid exists
17198 set setregid d_setregid
17200 set setresgid d_setresgid
17203 : see if setreuid exists
17204 set setreuid d_setreuid
17206 set setresuid d_setresuid
17209 : see if setrgid exists
17210 set setrgid d_setrgid
17213 : see if setruid exists
17214 set setruid d_setruid
17217 : see if setservent exists
17218 set setservent d_setsent
17221 : see if setservent_r exists
17222 set setservent_r d_setservent_r
17224 case "$d_setservent_r" in
17226 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17227 case "$d_setservent_r_proto:$usethreads" in
17228 ":define") d_setservent_r_proto=define
17229 set d_setservent_r_proto setservent_r $hdrs
17233 case "$d_setservent_r_proto" in
17235 case "$setservent_r_proto" in
17236 ''|0) try='int setservent_r(int, struct servent_data*);'
17237 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=I_ID ;;
17239 case "$setservent_r_proto" in
17240 ''|0) try='void setservent_r(int, struct servent_data*);'
17241 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=V_ID ;;
17243 case "$setservent_r_proto" in
17244 ''|0) d_setservent_r=undef
17245 setservent_r_proto=0
17246 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
17247 * ) case "$setservent_r_proto" in
17248 REENTRANT_PROTO*) ;;
17249 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
17251 echo "Prototype: $try" ;;
17254 *) case "$usethreads" in
17255 define) echo "setservent_r has no prototype, not using it." >&4 ;;
17257 d_setservent_r=undef
17258 setservent_r_proto=0
17262 *) setservent_r_proto=0
17266 : see if setsid exists
17267 set setsid d_setsid
17270 : see if setvbuf exists
17271 set setvbuf d_setvbuf
17274 : see if sfio.h is available
17278 : see if sfio library is available
17289 : Ok, but do we want to use it.
17293 true|$define|[yY]*) dflt='y';;
17296 echo "$package can use the sfio library, but it is experimental."
17297 rp="You seem to have sfio available, do you want to try using it?"
17300 y|Y) echo "Ok, turning on sfio then."
17303 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
17308 *) case "$usesfio" in
17309 true|$define|[yY]*)
17310 echo "Sorry, cannot find sfio on this machine." >&4
17311 echo "Ignoring your setting of usesfio=$usesfio." >&4
17320 $define) usesfio='true';;
17321 *) usesfio='false';;
17325 *) : Remove sfio from list of libraries to use
17328 echo "Removing unneeded -lsfio from library list" >&4
17329 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
17332 echo "libs = $libs" >&4
17339 : see if shmctl exists
17340 set shmctl d_shmctl
17343 : see if shmget exists
17344 set shmget d_shmget
17347 : see if shmat exists
17350 : see what shmat returns
17353 $cat >shmat.c <<'END'
17354 #include <sys/shm.h>
17357 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
17362 echo "and it returns ($shmattype)." >&4
17363 : see if a prototype for shmat is available
17364 xxx=`./findhdr sys/shm.h`
17365 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
17366 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
17377 set d_shmatprototype
17380 : see if shmdt exists
17384 : see how much of the 'shm*(2)' library is present.
17387 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
17388 *"$undef"*) h_shm=false;;
17392 case "`ipcs 2>&1`" in
17393 "SVID shared memory"*"not configured"*)
17394 echo "Your $osname does not have the shm*(2) configured." >&4
17397 set shmctl d_shmctl
17399 set shmget d_shmget
17409 : we could also check for sys/ipc.h ...
17410 if $h_shm && $test `./findhdr sys/shm.h`; then
17411 echo "You have the full shm*(2) library." >&4
17414 echo "You don't have the full shm*(2) library." >&4
17420 : see if we have sigaction
17422 if set sigaction val -f d_sigaction; eval $csym; $val; then
17423 echo 'sigaction() found.' >&4
17426 #include <sys/types.h>
17427 #include <signal.h>
17428 #$i_stdlib I_STDLIB
17430 #include <stdlib.h>
17434 struct sigaction act, oact;
17436 oact.sa_handler = 0;
17437 /* so that act and oact are used */
17438 exit(act.sa_flags == 0 && oact.sa_handler == 0);
17442 if eval $compile_ok; then
17445 echo "But you don't seem to have a useable struct sigaction." >&4
17449 echo 'sigaction NOT found.' >&4
17452 set d_sigaction; eval $setvar
17455 : see if this is a sunmath.h system
17456 set sunmath.h i_sunmath
17459 : see if signbit exists
17460 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
17463 #$i_sunmath I_SUNMATH
17467 #ifdef I_SUNMATH /* Solaris special math library */
17468 # include <sunmath.h>
17471 int main(int argc, char **argv)
17475 if ((signbit(x) == 0) && (signbit(y) != 0))
17483 if eval $compile; then
17484 if $run ./try; then
17488 $echo "Signbit seems to be available, but doesn't work as I expected."
17489 $echo "I won't use it." >&4
17500 : see if sigprocmask exists
17501 set sigprocmask d_sigprocmask
17504 : see if sigsetjmp exists
17506 case "$d_sigsetjmp" in
17509 #include <setjmp.h>
17510 #$i_stdlib I_STDLIB
17512 #include <stdlib.h>
17518 if (sigsetjmp(env,1))
17521 siglongjmp(env, 1);
17526 if eval $compile; then
17527 if $run ./try >/dev/null 2>&1; then
17528 echo "POSIX sigsetjmp found." >&4
17532 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
17538 echo "sigsetjmp not found." >&4
17542 *) val="$d_sigsetjmp"
17543 case "$d_sigsetjmp" in
17544 $define) echo "POSIX sigsetjmp found." >&4;;
17545 $undef) echo "sigsetjmp not found." >&4;;
17553 : see if snprintf exists
17554 set snprintf d_snprintf
17557 : see if vsnprintf exists
17558 set vsnprintf d_vsnprintf
17561 case "$d_snprintf-$d_vsnprintf" in
17564 Checking whether your snprintf() and vsnprintf() work okay...
17566 $cat >try.c <<'EOCP'
17567 /* v?snprintf testing logic courtesy of Russ Allbery.
17568 * According to C99:
17569 * - if the buffer is too short it still must be \0-terminated
17570 * - if the buffer is too short the potentially required length
17571 * must be returned and not -1
17572 * - if the buffer is NULL the potentially required length
17573 * must be returned and not -1 or core dump
17576 #include <stdarg.h>
17580 int test (char *format, ...)
17585 va_start (args, format);
17586 count = vsnprintf (buf, sizeof buf, format, args);
17593 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
17594 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
17598 if eval $compile; then
17601 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
17603 Your snprintf() and snprintf() don't seem to be working okay.
17605 d_snprintf="$undef"
17606 d_vsnprintf="$undef"
17610 echo "(I can't seem to compile the test program--assuming they don't)"
17611 d_snprintf="$undef"
17612 d_vsnprintf="$undef"
17618 : see if sockatmark exists
17619 set sockatmark d_sockatmark
17622 : see if prototype for sockatmark is available
17624 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
17627 : see if socks5_init exists
17628 set socks5_init d_socks5_init
17631 : see if sprintf returns the length of the string in the buffer as per ANSI
17632 $echo "Checking whether sprintf returns the length of the string..." >&4
17635 #$i_stdlib I_STDLIB
17637 #include <stdlib.h>
17639 #$i_string I_STRING
17641 # include <string.h>
17643 # include <strings.h>
17652 int check (size_t expect, int test) {
17653 size_t got = strlen(buffer);
17657 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
17662 int main(int argc, char **argv) {
17665 check(sprintf(buffer, ""), ++test);
17666 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
17667 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
17674 if eval $compile; then
17678 sprintf returns the length of the string (as ANSI says it should)
17680 d_sprintf_returns_strlen="$define"
17683 sprintf does not return the length of the string (how old is this system?)
17685 d_sprintf_returns_strlen="$undef"
17689 echo "(I can't seem to compile the test program--assuming it doesn't)" >&4
17690 d_sprintf_returns_strlen="$undef"
17694 : see if srand48_r exists
17695 set srand48_r d_srand48_r
17697 case "$d_srand48_r" in
17699 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17700 case "$d_srand48_r_proto:$usethreads" in
17701 ":define") d_srand48_r_proto=define
17702 set d_srand48_r_proto srand48_r $hdrs
17706 case "$d_srand48_r_proto" in
17708 case "$srand48_r_proto" in
17709 ''|0) try='int srand48_r(long, struct drand48_data*);'
17710 ./protochk "$extern_C $try" $hdrs && srand48_r_proto=I_LS ;;
17712 case "$srand48_r_proto" in
17713 ''|0) d_srand48_r=undef
17715 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
17716 * ) case "$srand48_r_proto" in
17717 REENTRANT_PROTO*) ;;
17718 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
17720 echo "Prototype: $try" ;;
17723 *) case "$usethreads" in
17724 define) echo "srand48_r has no prototype, not using it." >&4 ;;
17731 *) srand48_r_proto=0
17735 : see if srandom_r exists
17736 set srandom_r d_srandom_r
17738 case "$d_srandom_r" in
17740 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17741 case "$d_srandom_r_proto:$usethreads" in
17742 ":define") d_srandom_r_proto=define
17743 set d_srandom_r_proto srandom_r $hdrs
17747 case "$d_srandom_r_proto" in
17749 case "$srandom_r_proto" in
17750 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
17751 ./protochk "$extern_C $try" $hdrs && srandom_r_proto=I_TS ;;
17753 case "$srandom_r_proto" in
17754 ''|0) d_srandom_r=undef
17756 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
17757 * ) case "$srandom_r_proto" in
17758 REENTRANT_PROTO*) ;;
17759 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
17761 echo "Prototype: $try" ;;
17764 *) case "$usethreads" in
17765 define) echo "srandom_r has no prototype, not using it." >&4 ;;
17772 *) srandom_r_proto=0
17776 : see if prototype for setresgid is available
17778 set d_sresgproto setresgid $i_unistd unistd.h
17781 : see if prototype for setresuid is available
17783 set d_sresuproto setresuid $i_unistd unistd.h
17786 : see if sys/stat.h is available
17787 set sys/stat.h i_sysstat
17790 : see if stat knows about block sizes
17792 echo "Checking to see if your struct stat has st_blocks field..." >&4
17793 set d_statblks stat st_blocks $i_sysstat sys/stat.h
17796 : see if this is a sys/vfs.h system
17797 set sys/vfs.h i_sysvfs
17800 : see if this is a sys/statfs.h system
17801 set sys/statfs.h i_sysstatfs
17804 : Check for statfs_s
17806 echo "Checking to see if your system supports struct statfs..." >&4
17807 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
17809 case "$d_statfs_s" in
17810 "$define") echo "Yes, it does." ;;
17811 *) echo "No, it doesn't." ;;
17815 : see if struct statfs knows about f_flags
17816 case "$d_statfs_s" in
17819 echo "Checking to see if your struct statfs has f_flags field..." >&4
17820 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
17824 set d_statfs_f_flags
17828 case "$d_statfs_f_flags" in
17829 "$define") echo "Yes, it does." ;;
17830 *) echo "No, it doesn't." ;;
17833 : see what flavor, if any, of static inline is supported
17835 echo "Checking to see if your system supports static inline..."
17836 $cat > try.c <<'EOCP'
17837 #include <stdlib.h>
17838 extern int f_via_a(int x);
17839 extern int f_via_b(int x);
17840 int main(int argc, char **argv)
17849 return EXIT_SUCCESS;
17852 return EXIT_FAILURE;
17856 $cat > a.c <<'EOCP'
17857 static INLINE int f(int x) {
17868 $cat > b.c <<'EOCP'
17869 extern int f(int x);
17877 # Respect a hint (or previous) value for perl_static_inline, if there is one.
17878 case "$perl_static_inline" in
17879 '') # Check the various possibilities, and break out on success.
17880 # For gcc, prefer __inline__, which will still permit
17881 # cflags.SH to add in -ansi.
17882 case "$gccversion" in
17883 '') xxx="inline __inline__ __inline _inline";;
17884 *) xxx="__inline__ inline __inline _inline";;
17886 for inline in $xxx; do
17887 set try -DINLINE=$inline a.c
17888 if eval $compile && $run ./try; then
17889 # Now make sure there is no external linkage of static
17891 set try -DINLINE=$inline -DUSE_B a.c b.c
17892 if eval $compile && $run ./try; then
17893 $echo "Your compiler supports static $inline, " >&4
17894 $echo "but it also creates an external definition," >&4
17895 $echo "so I won't use it." >&4
17898 $echo "Your compiler supports static $inline." >&4
17900 perl_static_inline="static $inline";
17904 $echo "Your compiler does NOT support static $inline." >&4
17909 *inline*) # Some variant of inline exists.
17910 echo "Keeping your $hint value of $perl_static_inline."
17913 static) # No inline capabilities
17914 echo "Keeping your $hint value of $perl_static_inline."
17917 *) # Unrecognized previous value -- blindly trust the supplied
17918 # value and hope it makes sense. Use old value for
17919 # d_static_inline, if there is one.
17920 echo "Keeping your $hint value of $perl_static_inline."
17921 case "$d_static_inline" in
17923 *) val=$d_static_inline ;;
17927 # Fallback to plain 'static' if nothing worked.
17928 case "$perl_static_inline" in
17930 perl_static_inline="static"
17934 set d_static_inline
17936 $rm -f a.[co] b.[co]
17939 : Check stream access
17941 Checking how to access stdio streams by file descriptor number...
17943 case "$stdio_stream_array" in
17944 '') $cat >try.c <<EOCP
17947 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
17951 for s in _iob __iob __sF
17953 set try -DSTDIO_STREAM_ARRAY=$s
17954 if eval $compile; then
17955 case "`$run ./try`" in
17956 yes) stdio_stream_array=$s; break ;;
17962 case "$stdio_stream_array" in
17964 I can't figure out how to access stdio streams by file descriptor number.
17966 d_stdio_stream_array="$undef"
17969 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
17971 d_stdio_stream_array="$define"
17975 : see if strcoll exists
17976 set strcoll d_strcoll
17979 : check for structure copying
17981 echo "Checking to see if your C compiler can copy structs..." >&4
17982 $cat >try.c <<'EOCP'
17992 if $cc -c try.c >/dev/null 2>&1 ; then
17994 echo "Yup, it can."
17997 echo "Nope, it can't."
18003 : see if strerror and/or sys_errlist[] exist
18005 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
18006 if set strerror val -f d_strerror; eval $csym; $val; then
18007 echo 'strerror() found.' >&4
18008 d_strerror="$define"
18009 d_strerrm='strerror(e)'
18010 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18011 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
18012 d_syserrlst="$define"
18014 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
18015 d_syserrlst="$undef"
18017 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
18018 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
18019 echo 'strerror() found in string header.' >&4
18020 d_strerror="$define"
18021 d_strerrm='strerror(e)'
18022 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18023 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
18024 d_syserrlst="$define"
18026 echo "(You don't appear to have any sys_errlist[], how can this be?)"
18027 d_syserrlst="$undef"
18029 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18030 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
18031 d_strerror="$undef"
18032 d_syserrlst="$define"
18033 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
18035 echo 'strerror() and sys_errlist[] NOT found.' >&4
18036 d_strerror="$undef"
18037 d_syserrlst="$undef"
18038 d_strerrm='"unknown"'
18042 : see if strerror_r exists
18043 set strerror_r d_strerror_r
18045 case "$d_strerror_r" in
18047 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
18048 case "$d_strerror_r_proto:$usethreads" in
18049 ":define") d_strerror_r_proto=define
18050 set d_strerror_r_proto strerror_r $hdrs
18054 case "$d_strerror_r_proto" in
18056 case "$strerror_r_proto" in
18057 ''|0) try='int strerror_r(int, char*, size_t);'
18058 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBW ;;
18060 case "$strerror_r_proto" in
18061 ''|0) try='int strerror_r(int, char*, int);'
18062 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBI ;;
18064 case "$strerror_r_proto" in
18065 ''|0) try='char* strerror_r(int, char*, size_t);'
18066 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=B_IBW ;;
18068 case "$strerror_r_proto" in
18069 ''|0) d_strerror_r=undef
18071 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
18072 * ) case "$strerror_r_proto" in
18073 REENTRANT_PROTO*) ;;
18074 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
18076 echo "Prototype: $try" ;;
18079 *) case "$usethreads" in
18080 define) echo "strerror_r has no prototype, not using it." >&4 ;;
18087 *) strerror_r_proto=0
18091 : see if strftime exists
18092 set strftime d_strftime
18095 : see if strlcat exists
18096 set strlcat d_strlcat
18099 : see if strlcpy exists
18100 set strlcpy d_strlcpy
18103 : see if strtod exists
18104 set strtod d_strtod
18107 : see if strtol exists
18108 set strtol d_strtol
18111 : see if strtold exists
18112 set strtold d_strtold
18115 : see if strtoll exists
18116 set strtoll d_strtoll
18119 case "$d_longlong-$d_strtoll" in
18122 Checking whether your strtoll() works okay...
18124 $cat >try.c <<'EOCP'
18127 #define strtoll __strtoll
18130 #define strtoll _strtoll
18133 extern long long int strtoll(char *s, char **, int);
18134 static int bad = 0;
18135 int check(char *s, long long ell, int een) {
18138 gll = strtoll(s, 0, 10);
18139 if (!((gll == ell) && (errno == een)))
18143 check(" 1", 1LL, 0);
18144 check(" 0", 0LL, 0);
18145 check("-1", -1LL, 0);
18146 check("-9223372036854775808", -9223372036854775808LL, 0);
18147 check("-9223372036854775808", -9223372036854775808LL, 0);
18148 check(" 9223372036854775807", 9223372036854775807LL, 0);
18149 check("-9223372036854775808", -9223372036854775808LL, 0);
18150 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
18151 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
18157 if eval $compile; then
18160 ok) echo "Your strtoll() seems to be working okay." ;;
18162 Your strtoll() doesn't seem to be working okay.
18168 echo "(I can't seem to compile the test program--assuming it doesn't)"
18174 : see if strtoq exists
18175 set strtoq d_strtoq
18178 : see if strtoul exists
18179 set strtoul d_strtoul
18182 case "$d_strtoul" in
18185 Checking whether your strtoul() works okay...
18187 $cat >try.c <<'EOCP'
18190 extern unsigned long int strtoul(char *s, char **, int);
18191 static int bad = 0;
18192 void check(char *s, unsigned long eul, int een) {
18195 gul = strtoul(s, 0, 10);
18196 if (!((gul == eul) && (errno == een)))
18200 check(" 1", 1L, 0);
18201 check(" 0", 0L, 0);
18203 case "$longsize" in
18205 $cat >>try.c <<'EOCP'
18206 check("18446744073709551615", 18446744073709551615UL, 0);
18207 check("18446744073709551616", 18446744073709551615UL, ERANGE);
18208 #if 0 /* strtoul() for /^-/ strings is undefined. */
18209 check("-1", 18446744073709551615UL, 0);
18210 check("-18446744073709551614", 2, 0);
18211 check("-18446744073709551615", 1, 0);
18212 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
18213 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
18218 $cat >>try.c <<'EOCP'
18219 check("4294967295", 4294967295UL, 0);
18220 check("4294967296", 4294967295UL, ERANGE);
18221 #if 0 /* strtoul() for /^-/ strings is undefined. */
18222 check("-1", 4294967295UL, 0);
18223 check("-4294967294", 2, 0);
18224 check("-4294967295", 1, 0);
18225 check("-4294967296", 4294967295UL, ERANGE);
18226 check("-4294967297", 4294967295UL, ERANGE);
18231 : Should we write these tests to be more portable by sprintf-ing
18232 : ~0 and then manipulating that char string as input for strtol?
18235 $cat >>try.c <<'EOCP'
18242 if eval $compile; then
18243 case "`$run ./try`" in
18244 ok) echo "Your strtoul() seems to be working okay." ;;
18246 Your strtoul() doesn't seem to be working okay.
18252 echo "(I can't seem to compile the test program--assuming it doesn't)"
18258 : see if strtoull exists
18259 set strtoull d_strtoull
18262 case "$d_longlong-$d_strtoull" in
18265 Checking whether your strtoull() works okay...
18267 $cat >try.c <<'EOCP'
18270 #define strtoull __strtoull
18273 extern unsigned long long int strtoull(char *s, char **, int);
18274 static int bad = 0;
18275 int check(char *s, long long eull, int een) {
18278 gull = strtoull(s, 0, 10);
18279 if (!((gull == eull) && (errno == een)))
18283 check(" 1", 1LL, 0);
18284 check(" 0", 0LL, 0);
18285 check("18446744073709551615", 18446744073709551615ULL, 0);
18286 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18287 #if 0 /* strtoull() for /^-/ strings is undefined. */
18288 check("-1", 18446744073709551615ULL, 0);
18289 check("-18446744073709551614", 2LL, 0);
18290 check("-18446744073709551615", 1LL, 0);
18291 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18292 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18299 if eval $compile; then
18300 case "`$run ./try`" in
18301 ok) echo "Your strtoull() seems to be working okay." ;;
18303 Your strtoull() doesn't seem to be working okay.
18305 d_strtoull="$undef"
18309 echo "(I can't seem to compile the test program--assuming it doesn't)"
18310 d_strtoull="$undef"
18315 : see if strtouq exists
18316 set strtouq d_strtouq
18319 case "$d_strtouq" in
18322 Checking whether your strtouq() works okay...
18324 $cat >try.c <<'EOCP'
18327 extern unsigned long long int strtouq(char *s, char **, int);
18328 static int bad = 0;
18329 void check(char *s, unsigned long long eull, int een) {
18330 unsigned long long gull;
18332 gull = strtouq(s, 0, 10);
18333 if (!((gull == eull) && (errno == een)))
18337 check(" 1", 1LL, 0);
18338 check(" 0", 0LL, 0);
18339 check("18446744073709551615", 18446744073709551615ULL, 0);
18340 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18341 #if 0 /* strtouq() for /^-/ strings is undefined. */
18342 check("-1", 18446744073709551615ULL, 0);
18343 check("-18446744073709551614", 2LL, 0);
18344 check("-18446744073709551615", 1LL, 0);
18345 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18346 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18354 if eval $compile; then
18355 case "`$run ./try`" in
18356 ok) echo "Your strtouq() seems to be working okay." ;;
18358 Your strtouq() doesn't seem to be working okay.
18364 echo "(I can't seem to compile the test program--assuming it doesn't)"
18370 : see if strxfrm exists
18371 set strxfrm d_strxfrm
18374 : see if symlink exists
18375 set symlink d_symlink
18378 : see if syscall exists
18379 set syscall d_syscall
18382 : see if prototype for syscall is available
18384 set d_syscallproto syscall $i_unistd unistd.h
18387 : see if sysconf exists
18388 set sysconf d_sysconf
18391 : see if system exists
18392 set system d_system
18395 : see if tcgetpgrp exists
18396 set tcgetpgrp d_tcgetpgrp
18399 : see if tcsetpgrp exists
18400 set tcsetpgrp d_tcsetpgrp
18403 : see if prototype for telldir is available
18405 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
18408 : see if time exists
18410 if test "X$d_time" = X -o X"$timetype" = X; then
18411 if set time val -f d_time; eval $csym; $val; then
18412 echo 'time() found.' >&4
18414 rp="What is the type returned by time() on this system?"
18415 set time_t timetype long stdio.h sys/types.h
18418 echo 'time() not found, hope that will do.' >&4
18426 : see if timegm exists
18427 set timegm d_timegm
18430 : see if this is a sys/times.h system
18431 set sys/times.h i_systimes
18434 : see if times exists
18436 if set times val -f d_times; eval $csym; $val; then
18437 echo 'times() found.' >&4
18440 case "$i_systimes" in
18441 "$define") inc='sys/times.h';;
18443 rp="What is the type returned by times() on this system?"
18444 set clock_t clocktype long stdio.h sys/types.h $inc
18447 echo 'times() NOT found, hope that will do.' >&4
18452 : see if tmpnam_r exists
18453 set tmpnam_r d_tmpnam_r
18455 case "$d_tmpnam_r" in
18457 hdrs="$i_systypes sys/types.h define stdio.h "
18458 case "$d_tmpnam_r_proto:$usethreads" in
18459 ":define") d_tmpnam_r_proto=define
18460 set d_tmpnam_r_proto tmpnam_r $hdrs
18464 case "$d_tmpnam_r_proto" in
18466 case "$tmpnam_r_proto" in
18467 ''|0) try='char* tmpnam_r(char*);'
18468 ./protochk "$extern_C $try" $hdrs && tmpnam_r_proto=B_B ;;
18470 case "$tmpnam_r_proto" in
18471 ''|0) d_tmpnam_r=undef
18473 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
18474 * ) case "$tmpnam_r_proto" in
18475 REENTRANT_PROTO*) ;;
18476 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
18478 echo "Prototype: $try" ;;
18481 *) case "$usethreads" in
18482 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
18489 *) tmpnam_r_proto=0
18493 : see if truncate exists
18494 set truncate d_truncate
18497 : see if ttyname_r exists
18498 set ttyname_r d_ttyname_r
18500 case "$d_ttyname_r" in
18502 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
18503 case "$d_ttyname_r_proto:$usethreads" in
18504 ":define") d_ttyname_r_proto=define
18505 set d_ttyname_r_proto ttyname_r $hdrs
18509 case "$d_ttyname_r_proto" in
18511 case "$ttyname_r_proto" in
18512 ''|0) try='int ttyname_r(int, char*, size_t);'
18513 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBW ;;
18515 case "$ttyname_r_proto" in
18516 ''|0) try='int ttyname_r(int, char*, int);'
18517 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBI ;;
18519 case "$ttyname_r_proto" in
18520 ''|0) try='char* ttyname_r(int, char*, int);'
18521 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=B_IBI ;;
18523 case "$ttyname_r_proto" in
18524 ''|0) d_ttyname_r=undef
18526 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
18527 * ) case "$ttyname_r_proto" in
18528 REENTRANT_PROTO*) ;;
18529 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
18531 echo "Prototype: $try" ;;
18534 *) case "$usethreads" in
18535 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
18542 *) ttyname_r_proto=0
18546 : see if tzname[] exists
18548 if set tzname val -a d_tzname; eval $csym; $val; then
18550 echo 'tzname[] found.' >&4
18553 echo 'tzname[] NOT found.' >&4
18558 : Check if is a multiplatform env
18560 next|rhapsody|darwin) multiarch="$define" ;;
18562 case "$multiarch" in
18563 ''|[nN]*) multiarch="$undef" ;;
18566 : check for ordering of bytes in a UV
18568 case "$usecrosscompile$multiarch" in
18571 You seem to be either cross-compiling or doing a multiarchitecture build,
18572 skipping the byteorder check.
18578 case "$byteorder" in
18581 In the following, larger digits indicate more significance. A big-endian
18582 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
18583 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
18584 machines may have weird orders like 3412. A Cray will report 87654321,
18585 an Alpha will report 12345678. If the test program works the default is
18587 I'm now running the test program...
18591 #$i_stdlib I_STDLIB
18593 #include <stdlib.h>
18595 #include <sys/types.h>
18596 typedef $uvtype UV;
18606 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
18608 u.l = (UV)0x04030201;
18609 for (i = 0; i < $uvsize; i++)
18610 printf("%c", u.c[i]+'0');
18617 if eval $compile && $run ./try > /dev/null; then
18620 [1-4][1-4][1-4][1-4]|12345678|87654321)
18621 echo "(The test program ran ok.)"
18622 echo "byteorder=$dflt"
18625 ????|????????) echo "(The test program ran ok.)" ;;
18626 *) echo "(The test program didn't run right for some reason.)" ;;
18631 (I can't seem to compile the test program. Guessing big-endian...)
18634 case "$xxx_prompt" in
18636 rp="What is the order of bytes in $uvtype?"
18649 : Checking 32bit alignedness
18652 Checking to see whether you can access character data unalignedly...
18654 case "$d_u32align" in
18655 '') $cat >try.c <<EOCP
18657 #$i_stdlib I_STDLIB
18659 #include <stdlib.h>
18661 #define U32 $u32type
18662 #define BYTEORDER 0x$byteorder
18664 #include <signal.h>
18666 $signal_t bletch(int s) { exit(4); }
18669 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
18670 volatile U8 buf[8];
18674 if (sizeof(U32) != 4) {
18675 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
18682 signal(SIGBUS, bletch);
18694 for (i = 0; i < 4; i++) {
18695 up = (U32*)(buf + i);
18696 if (! ((*up == 1 << (8*i)) || /* big-endian */
18697 (*up == 1 << (8*(3-i))) /* little-endian */
18701 printf("read failed (%x)\n", *up);
18707 for (i = 0; i < 4; i++) {
18708 up = (U32*)(buf + i);
18710 if (*up != 0xBeef) {
18711 printf("write failed (%x)\n", *up);
18725 if eval $compile_ok; then
18726 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
18727 $run ./try 2>&1 >/dev/null
18730 You can access character data pretty unalignedly.
18732 d_u32align="$undef"
18735 It seems that you must access character data in an aligned manner.
18737 d_u32align="$define"
18741 rp='Can you access character data at unaligned addresses?'
18745 [yY]*) d_u32align="$undef" ;;
18746 *) d_u32align="$define" ;;
18753 : see if ualarm exists
18754 set ualarm d_ualarm
18757 : see if umask exists
18761 : see if unordered exists
18762 set unordered d_unordered
18765 : see if unsetenv exists
18766 set unsetenv d_unsetenv
18769 : see if usleep exists
18770 set usleep d_usleep
18773 : see if prototype for usleep is available
18775 set d_usleepproto usleep $i_unistd unistd.h
18778 : see if ustat exists
18782 : see if closedir exists
18783 set closedir d_closedir
18786 case "$d_closedir" in
18789 echo "Checking whether closedir() returns a status..." >&4
18791 #$i_dirent I_DIRENT /**/
18792 #$i_sysdir I_SYS_DIR /**/
18793 #$i_sysndir I_SYS_NDIR /**/
18794 #$i_systypes I_SYS_TYPES /**/
18796 #if defined(I_SYS_TYPES)
18797 #include <sys/types.h>
18799 #if defined(I_DIRENT)
18800 #include <dirent.h>
18801 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
18802 #include <sys/dir.h>
18806 #include <sys/ndir.h>
18810 #include <ndir.h> /* may be wrong in the future */
18812 #include <sys/dir.h>
18817 int main() { return closedir(opendir(".")); }
18820 if eval $compile_ok; then
18821 if $run ./try > /dev/null 2>&1 ; then
18822 echo "Yes, it does."
18825 echo "No, it doesn't."
18829 echo "(I can't seem to compile the test program--assuming it doesn't)"
18837 set d_void_closedir
18841 : see if there is a wait4
18845 : see if waitpid exists
18846 set waitpid d_waitpid
18849 : see if wcstombs exists
18850 set wcstombs d_wcstombs
18853 : see if wctomb exists
18854 set wctomb d_wctomb
18857 : see if writev exists
18858 set writev d_writev
18861 : preserve RCS keywords in files with variable substitution, grrr
18866 Revision='$Revision'
18868 : check for alignment requirements
18870 case "$usecrosscompile$multiarch" in
18873 You seem to be either cross-compiling or doing a multiarchitecture build,
18874 skipping the memory alignment check.
18877 case "$alignbytes" in
18878 '') alignbytes=8 ;;
18882 case "$alignbytes" in
18883 '') echo "Checking alignment constraints..." >&4
18884 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
18885 $cat >try.c <<'EOCP'
18886 typedef long double NV;
18889 $cat >try.c <<'EOCP'
18893 $cat >>try.c <<'EOCP'
18901 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
18906 if eval $compile_ok; then
18910 echo "(I can't seem to compile the test program...)"
18913 *) dflt="$alignbytes"
18916 rp="Doubles must be aligned on a how-many-byte boundary?"
18924 : set the base revision
18927 : length of character in bytes. Is always 1, otherwise it isnt C
18928 : This used to be a test using sizeof
18931 : Check for the number of bits in a character
18932 case "$charbits" in
18933 '') echo "Checking how long a character is (in bits)..." >&4
18940 for (c = 1, n = 0; c; c <<= 1, n++) ;
18941 printf ("%d\n", n);
18946 if eval $compile_ok; then
18950 echo "(I can't seem to compile the test program. Guessing...)"
18957 rp="What is the length of a character (in bits)?"
18961 case "$charbits" in
18964 Your system has an unsigned character size of $charbits bits, which
18965 is rather unusual (normally it is 8 bits). Perl likely will not work
18966 correctly on your system, with subtle bugs in various places.
18968 rp='Do you really want to continue?'
18972 [yY]) echo >&4 "Okay, continuing." ;;
18977 : how do we concatenate cpp tokens here?
18979 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
18980 $cat >cpp_stuff.c <<'EOCP'
18981 #define RCAT(a,b)a/**/b
18982 #define ACAT(a,b)a ## b
18986 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
18987 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
18988 echo "Oh! Smells like ANSI's been here." >&4
18989 echo "We can catify or stringify, separately or together!"
18991 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
18992 echo "Ah, yes! The good old days!" >&4
18993 echo "However, in the good old days we don't know how to stringify and"
18994 echo "catify at the same time."
18998 Hmm, I don't seem to be able to concatenate tokens with your cpp.
18999 You're going to have to edit the values of CAT[2-5] in config.h...
19001 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
19005 : see if this is a db.h system
19011 : Check db version.
19013 echo "Checking Berkeley DB version ..." >&4
19019 #include <sys/types.h>
19021 #$i_stdlib I_STDLIB
19023 #include <stdlib.h>
19026 int main(int argc, char *argv[])
19028 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
19029 int Major, Minor, Patch ;
19030 unsigned long Version ;
19031 (void)db_version(&Major, &Minor, &Patch) ;
19033 printf("%d %d %d %d %d %d\n",
19034 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
19035 Major, Minor, Patch);
19038 printf("You have Berkeley DB Version 2 or greater.\n");
19040 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
19041 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
19042 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
19043 Major, Minor, Patch) ;
19045 /* check that db.h & libdb are compatible */
19046 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
19047 printf("db.h and libdb are incompatible.\n") ;
19051 printf("db.h and libdb are compatible.\n") ;
19053 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
19054 + DB_VERSION_PATCH ;
19056 /* needs to be >= 2.3.4 */
19057 if (Version < 2003004) {
19058 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
19059 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
19065 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
19070 printf("You have Berkeley DB Version 1.\n");
19071 exit(0); /* DB version < 2: the coast is clear. */
19073 exit(1); /* <db.h> not Berkeley DB? */
19079 if eval $compile_ok && $run ./try; then
19080 echo 'Looks OK.' >&4
19082 db_version_major=$1
19083 db_version_minor=$2
19084 db_version_patch=$3
19086 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
19090 : Remove db from list of libraries to use
19091 echo "Removing unusable -ldb from library list" >&4
19092 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
19095 echo "libs = $libs" >&4
19105 : Check the return type needed for hash
19107 echo "Checking return type needed for hash for Berkeley DB ..." >&4
19113 #include <sys/types.h>
19116 #ifndef DB_VERSION_MAJOR
19117 u_int32_t hash_cb (ptr, size)
19125 info.hash = hash_cb;
19129 if $cc $ccflags -c try.c >try.out 2>&1 ; then
19130 if $contains warning try.out >>/dev/null 2>&1 ; then
19133 db_hashtype='u_int32_t'
19136 : XXX Maybe we should just give up here.
19137 db_hashtype=u_int32_t
19139 echo "Help: I can't seem to compile the db test program." >&4
19140 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
19143 echo "Your version of Berkeley DB uses $db_hashtype for hash."
19145 *) db_hashtype=u_int32_t
19150 : Check the return type needed for prefix
19152 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
19158 #include <sys/types.h>
19161 #ifndef DB_VERSION_MAJOR
19162 size_t prefix_cb (key1, key2)
19170 info.prefix = prefix_cb;
19174 if $cc $ccflags -c try.c >try.out 2>&1 ; then
19175 if $contains warning try.out >>/dev/null 2>&1 ; then
19176 db_prefixtype='int'
19178 db_prefixtype='size_t'
19181 db_prefixtype='size_t'
19182 : XXX Maybe we should just give up here.
19184 echo "Help: I can't seem to compile the db test program." >&4
19185 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
19188 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
19190 *) db_prefixtype='size_t'
19194 : How can we generate normalized random numbers ?
19196 echo "Looking for a random number function..." >&4
19197 case "$randfunc" in
19199 if set drand48 val -f; eval $csym; $val; then
19201 echo "Good, found drand48()." >&4
19202 elif set random val -f; eval $csym; $val; then
19204 echo "OK, found random()." >&4
19207 echo "Yick, looks like I have to use rand()." >&4
19218 *-Dmy_rand=*|*-Dmy_srand=*)
19219 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
19220 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
19221 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
19222 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
19226 while $test "$cont"; do
19227 rp="Use which function to generate random numbers?"
19229 if $test "$ans" = "$dflt"; then
19235 if set $ans val -f; eval $csym; $val; then
19239 rp="I cannot find function $ans. Use that name anyway?"
19248 case "$randfunc" in
19250 drand01="drand48()"
19256 case "$randbits" in
19258 echo "Checking to see how many bits your $randfunc() function produces..." >&4
19260 #$i_unistd I_UNISTD
19261 #$i_stdlib I_STDLIB
19264 # include <unistd.h>
19267 # include <stdlib.h>
19272 register unsigned long tmp;
19273 register unsigned long max = 0L;
19275 for (i = 1000; i; i--) {
19276 tmp = (unsigned long) $randfunc();
19277 if (tmp > max) max = tmp;
19279 for (i = 0; max; i++)
19285 if eval $compile_ok; then
19289 echo "(I can't seem to compile the test program...)"
19296 rp="How many bits does your $randfunc() function produce?"
19300 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
19301 seedfunc="s$randfunc"
19302 randseedtype=unsigned
19306 rp="How many bits does your $randfunc() function produce?"
19309 seedfunc="s$randfunc"
19310 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
19311 if set $seedfunc val -f; eval $csym; $val; then
19312 echo "(Using $seedfunc() to seed random generator)"
19314 echo "(Warning: no $seedfunc() to seed random generator)"
19317 randseedtype=unsigned
19324 : Determine if this is an EBCDIC system
19326 echo "Determining whether or not we are on an EBCDIC system..." >&4
19327 $cat >try.c <<'EOM'
19330 if ('M'==0xd4) return 0;
19337 if eval $compile_ok; then
19338 if $run ./try; then
19339 echo "You seem to speak EBCDIC." >&4
19342 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
19345 echo "I'm unable to compile the test program." >&4
19346 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
19352 : Check how to flush
19355 Checking how to flush all pending stdio output...
19357 # I only know how to find the first 32 possibly open files on SunOS.
19358 # See also hints/sunos_4_1.sh and util.c --AD
19360 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
19362 $cat >>try.c <<EOCP
19364 #$i_stdlib I_STDLIB
19366 #include <stdlib.h>
19368 #$i_unistd I_UNISTD
19370 # include <unistd.h>
19372 #$d_sysconf HAS_SYSCONF
19373 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
19374 #ifdef HAS_STDIO_STREAM_ARRAY
19375 # define STDIO_STREAM_ARRAY $stdio_stream_array
19380 p = fopen("try.out", "w");
19384 # ifdef TRY_FPRINTF
19388 #ifdef TRY_FFLUSH_NULL
19391 #ifdef TRY_FFLUSH_ALL
19393 long open_max = -1;
19394 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
19395 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
19397 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
19398 open_max = sysconf(_SC_OPEN_MAX);
19401 open_max = FOPEN_MAX;
19404 open_max = OPEN_MAX;
19413 # ifdef HAS_STDIO_STREAM_ARRAY
19414 if (open_max > 0) {
19416 for (i = 0; i < open_max; i++)
19417 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
19418 STDIO_STREAM_ARRAY[i]._file < open_max &&
19419 STDIO_STREAM_ARRAY[i]._flag)
19420 fflush(&STDIO_STREAM_ARRAY[i]);
19428 : first we have to find out how _not_ to flush
19430 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
19432 set try -DTRY_FPUTC
19433 if eval $compile; then
19434 $run ./try 2>/dev/null
19437 if $test ! -s try.out -a "X$code" = X42; then
19443 set try -DTRY_FPRINTF
19444 if eval $compile; then
19445 $run ./try 2>/dev/null
19448 if $test ! -s try.out -a "X$code" = X42; then
19449 output=-DTRY_FPRINTF
19455 : check for fflush NULL behaviour
19456 case "$fflushNULL" in
19457 '') set try -DTRY_FFLUSH_NULL $output
19458 if eval $compile; then
19459 $run ./try 2>/dev/null
19462 if $test -s try.out -a "X$code" = X42; then
19463 fflushNULL="`$cat try.out`"
19465 if $test "X$code" != X42; then
19467 (If this test failed, don't worry, we'll try another method shortly.)
19472 $rm -f core try.core core.try.*
19473 case "$fflushNULL" in
19475 Your fflush(NULL) works okay for output streams.
19476 Let's see if it clobbers input pipes...
19478 # As of mid-March 2000 all versions of Solaris appear to have a stdio
19479 # bug that improperly flushes the input end of pipes. So we avoid the
19480 # autoflush on fork/system/exec support for now. :-(
19481 $cat >tryp.c <<EOCP
19484 main(int argc, char **argv)
19490 while ((i = getc(stdin)) != -1
19491 && (*bp++ = i) != '\n'
19492 && bp < &buf[1024])
19495 fprintf(stdout, "%s", buf);
19503 fflushNULL="$define"
19505 if eval $compile; then
19507 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19508 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19510 fflush(NULL) seems to behave okay with input streams.
19512 fflushNULL="$define"
19515 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
19517 fflushNULL="$undef"
19520 $rm -f core tryp.c tryp.core core.tryp.*
19523 Your fflush(NULL) isn't working (contrary to ANSI C).
19525 fflushNULL="$undef"
19528 Cannot figure out whether your fflush(NULL) works or not.
19529 I'm assuming it doesn't (contrary to ANSI C).
19531 fflushNULL="$undef"
19535 $define|true|[yY]*)
19536 fflushNULL="$define"
19539 fflushNULL="$undef"
19542 : check explicit looping only if NULL did not work, and if the pipe
19543 : bug does not show up on an explicit flush too
19544 case "$fflushNULL" in
19546 $cat >tryp.c <<EOCP
19549 main(int argc, char **argv)
19555 while ((i = getc(stdin)) != -1
19556 && (*bp++ = i) != '\n'
19557 && bp < &buf[1024])
19560 fprintf(stdout, "%s", buf);
19569 if eval $compile; then
19571 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19572 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19574 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
19576 : now check for fflushall behaviour
19577 case "$fflushall" in
19578 '') set try -DTRY_FFLUSH_ALL $output
19579 if eval $compile; then
19581 (Now testing the other method--but note that this also may fail.)
19583 $run ./try 2>/dev/null
19586 if $test -s try.out -a "X$code" = X42; then
19587 fflushall="`$cat try.out`"
19591 case "$fflushall" in
19593 Whew. Flushing explicitly all the stdio streams works.
19595 fflushall="$define"
19598 Sigh. Flushing explicitly all the stdio streams doesn't work.
19603 Cannot figure out whether flushing stdio streams explicitly works or not.
19604 I'm assuming it doesn't.
19610 "$define"|true|[yY]*)
19611 fflushall="$define"
19619 All is futile. Even fflush(stdin) clobbers input pipes!
19626 $rm -f core tryp.c tryp.core core.tryp.*
19628 *) fflushall="$undef"
19632 case "$fflushNULL$fflushall" in
19635 OK, I give up. I cannot figure out how to flush pending stdio output.
19636 We won't be flushing handles at all before fork/exec/popen.
19642 : Store the full pathname to the ar program for use in the C program
19643 : Respect a hint or command line value for full_ar.
19648 : Store the full pathname to the sed program for use in the C program
19651 : see what type gids are declared as in the kernel
19653 echo "Looking for the type for group ids returned by getgid()."
19654 set gid_t gidtype xxx stdio.h sys/types.h
19658 xxx=`./findhdr sys/user.h`
19659 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
19661 unsigned) dflt="$1 $2" ;;
19665 *) dflt="$gidtype";;
19668 gid_t) echo "gid_t found." ;;
19669 *) rp="What is the type for group ids returned by getgid()?"
19675 : Check the size of GID
19678 *_t) zzz="$gidtype" ;;
19681 echo "Checking the size of $zzz..." >&4
19683 #include <sys/types.h>
19685 #$i_stdlib I_STDLIB
19687 #include <stdlib.h>
19690 printf("%d\n", (int)sizeof($gidtype));
19695 if eval $compile_ok; then
19699 echo "(I can't execute the test program--guessing $gidsize.)" >&4
19702 echo "Your $zzz is $gidsize bytes long."
19707 echo "(I can't compile the test program--guessing $gidsize.)" >&4
19711 : Check if GID is signed
19714 *_t) zzz="$gidtype" ;;
19717 echo "Checking the sign of $zzz..." >&4
19719 #include <sys/types.h>
19730 if eval $compile; then
19734 echo "(I can't execute the test program--guessing unsigned.)" >&4
19738 1) echo "Your $zzz is unsigned." ;;
19739 -1) echo "Your $zzz is signed." ;;
19745 echo "(I can't compile the test program--guessing unsigned.)" >&4
19749 : Check 64bit sizes
19752 if $test X"$quadtype" != X; then
19754 echo "Checking how to print 64-bit integers..." >&4
19756 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
19757 $cat >try.c <<'EOCP'
19758 #include <sys/types.h>
19761 int q = 12345678901;
19762 printf("%ld\n", q);
19766 if eval $compile; then
19770 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
19771 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
19772 echo "We will use %d."
19778 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
19779 $cat >try.c <<'EOCP'
19780 #include <sys/types.h>
19783 long q = 12345678901;
19784 printf("%ld\n", q);
19788 if eval $compile; then
19792 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
19793 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
19794 echo "We will use %ld."
19800 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
19801 $cat >try.c <<'EOCP'
19802 #include <sys/types.h>
19803 #include <inttypes.h>
19806 int64_t q = 12345678901;
19807 printf("%" PRId64 "\n", q);
19811 if eval $compile; then
19815 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
19816 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
19817 echo "We will use the C9X style."
19823 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19825 #include <sys/types.h>
19828 $quadtype q = 12345678901;
19829 printf("%Ld\n", q);
19833 if eval $compile; then
19837 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
19838 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
19839 echo "We will use %Ld."
19845 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
19846 $cat >try.c <<'EOCP'
19847 #include <sys/types.h>
19850 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
19851 printf("%lld\n", q);
19855 if eval $compile; then
19859 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
19860 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
19861 echo "We will use the %lld style."
19867 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19869 #include <sys/types.h>
19872 $quadtype q = 12345678901;
19873 printf("%qd\n", q);
19877 if eval $compile; then
19881 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
19882 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
19883 echo "We will use %qd."
19889 if $test X"$sPRId64" = X; then
19890 echo "Cannot figure out how to print 64-bit integers." >&4
19897 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
19898 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
19900 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
19901 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
19905 : Check format strings for internal types
19907 $echo "Checking the format strings to be used for Perl's internal types..." >&4
19909 if $test X"$ivsize" = X8; then
19910 ivdformat="$sPRId64"
19911 uvuformat="$sPRIu64"
19912 uvoformat="$sPRIo64"
19913 uvxformat="$sPRIx64"
19914 uvXUformat="$sPRIXU64"
19916 if $test X"$ivsize" = X"$longsize"; then
19923 if $test X"$ivsize" = X"$intsize"; then
19931 if $test X"$ivsize" = X"$shortsize"; then
19942 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
19943 nveformat="$sPRIeldbl"
19944 nvfformat="$sPRIfldbl"
19945 nvgformat="$sPRIgldbl"
19946 nvEUformat="$sPRIEUldbl"
19947 nvFUformat="$sPRIFUldbl"
19948 nvGUformat="$sPRIGUldbl"
19958 case "$ivdformat" in
19959 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
19964 : Check format string for GID
19967 $echo "Checking the format string to be used for gids..." >&4
19970 -1) if $test X"$gidsize" = X"$ivsize"; then
19971 gidformat="$ivdformat"
19973 if $test X"$gidsize" = X"$longsize"; then
19976 if $test X"$gidsize" = X"$intsize"; then
19979 if $test X"$gidsize" = X"$shortsize"; then
19986 *) if $test X"$gidsize" = X"$uvsize"; then
19987 gidformat="$uvuformat"
19989 if $test X"$gidsize" = X"$longsize"; then
19992 if $test X"$gidsize" = X"$intsize"; then
19995 if $test X"$gidsize" = X"$shortsize"; then
20004 : see if getgroups exists
20005 set getgroups d_getgrps
20008 : see if setgroups exists
20009 set setgroups d_setgrps
20012 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
20014 case "$d_getgrps$d_setgrps" in
20016 case "$groupstype" in
20017 '') dflt="$gidtype" ;;
20018 *) dflt="$groupstype" ;;
20021 What type of pointer is the second argument to getgroups() and setgroups()?
20022 Usually this is the same as group ids, $gidtype, but not always.
20025 rp='What type pointer is the second argument to getgroups() and setgroups()?'
20029 *) groupstype="$gidtype";;
20032 : MAD = Misc Attribute Definition
20034 if $test $patchlevel -lt 9; then
20035 : MAD is not available in 5.8.x or earlier.
20039 $define|true|[yY]*) dflt='y' ;;
20044 Would you like to build with Misc Attribute Decoration? This is development
20045 work leading to a Perl 5 to Perl 6 convertor, which imposes a space and speed
20046 overhead on the interpreter.
20048 If this doesn't make any sense to you, just accept the default '$dflt'.
20050 rp='Build Perl with MAD?'
20055 madlyh='madly.h madly.act madly.tab'
20057 madlyobj="madly$_o" ;;
20066 : check whether make sets MAKE
20068 echo "Checking if your $make program sets \$(MAKE)..." >&4
20069 case "$make_set_make" in
20071 $sed 's/^X //' > testmake.mak << 'EOF'
20073 X @echo 'maketemp="$(MAKE)"'
20075 case "`$make -f testmake.mak 2>/dev/null`" in
20076 *maketemp=*) make_set_make='#' ;;
20077 *) make_set_make="MAKE=$make" ;;
20079 $rm -f testmake.mak
20082 case "$make_set_make" in
20083 '#') echo "Yup, it does.";;
20084 *) echo "Nope, it doesn't.";;
20087 : see what type is used for mode_t
20088 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
20089 set mode_t modetype int stdio.h sys/types.h
20092 : see if we need va_copy
20094 case "$i_stdarg" in
20097 #include <stdarg.h>
20099 #$i_stdlib I_STDLIB
20101 #include <stdlib.h>
20103 #include <signal.h>
20106 ivfprintf(FILE *f, const char *fmt, va_list *valp)
20108 return vfprintf(f, fmt, *valp);
20112 myvfprintf(FILE *f, const char *fmt, va_list val)
20114 return ivfprintf(f, fmt, &val);
20118 myprintf(char *fmt, ...)
20121 va_start(val, fmt);
20122 return myvfprintf(stdout, fmt, val);
20126 main(int ac, char **av)
20128 signal(SIGSEGV, exit);
20130 myprintf("%s%cs all right, then\n", "that", '\'');
20135 if eval $compile && $run ./try 2>&1 >/dev/null; then
20136 case "`$run ./try`" in
20137 "that's all right, then")
20143 yes) echo "It seems that you don't need va_copy()." >&4
20144 need_va_copy="$undef"
20146 *) echo "It seems that va_copy() or similar will be needed." >&4
20147 need_va_copy="$define"
20152 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
20156 : see what type is used for size_t
20157 rp="What is the type used for the length parameter for string functions?"
20158 set size_t sizetype 'unsigned int' stdio.h sys/types.h
20161 : check for type of arguments to gethostbyaddr.
20162 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
20163 case "$d_gethbyaddr" in
20167 Checking to see what type of arguments are accepted by gethostbyaddr().
20169 hdrs="$define sys/types.h
20170 $d_socket sys/socket.h
20171 $i_niin netinet/in.h
20173 $i_unistd unistd.h"
20174 : The first arg can 'char *' or 'void *'
20175 : The second arg is some of integral type
20176 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
20177 for yyy in size_t long int; do
20178 case "$netdb_host_type" in
20179 '') try="$extern_C struct hostent *gethostbyaddr($xxx, $yyy, int);"
20180 if ./protochk "$try" $hdrs; then
20181 echo "Your system accepts $xxx for the first arg."
20182 echo "...and $yyy for the second arg."
20183 netdb_host_type="$xxx"
20184 netdb_hlen_type="$yyy"
20190 : In case none of those worked, prompt the user.
20191 case "$netdb_host_type" in
20192 '') rp='What is the type for the 1st argument to gethostbyaddr?'
20195 netdb_host_type=$ans
20196 rp='What is the type for the 2nd argument to gethostbyaddr?'
20199 netdb_hlen_type=$ans
20203 *) : no gethostbyaddr, so pick harmless defaults
20204 netdb_host_type='char *'
20205 netdb_hlen_type="$sizetype"
20208 # Remove the "const" if needed. -- but then we'll have a
20210 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
20213 : check for type of argument to gethostbyname.
20214 if test "X$netdb_name_type" = X ; then
20215 case "$d_gethbyname" in
20219 Checking to see what type of argument is accepted by gethostbyname().
20221 hdrs="$define sys/types.h
20222 $d_socket sys/socket.h
20223 $i_niin netinet/in.h
20225 $i_unistd unistd.h"
20226 for xxx in "const char *" "char *"; do
20227 case "$netdb_name_type" in
20228 '') try="$extern_C struct hostent *gethostbyname($xxx);"
20229 if ./protochk "$try" $hdrs; then
20230 echo "Your system accepts $xxx."
20231 netdb_name_type="$xxx"
20236 : In case none of those worked, prompt the user.
20237 case "$netdb_name_type" in
20238 '') rp='What is the type for the 1st argument to gethostbyname?'
20241 netdb_name_type=$ans
20245 *) : no gethostbyname, so pick harmless default
20246 netdb_name_type='char *'
20251 : check for type of 1st argument to getnetbyaddr.
20252 if test "X$netdb_net_type" = X ; then
20253 case "$d_getnbyaddr" in
20257 Checking to see what type of 1st argument is accepted by getnetbyaddr().
20259 hdrs="$define sys/types.h
20260 $d_socket sys/socket.h
20261 $i_niin netinet/in.h
20263 $i_unistd unistd.h"
20264 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
20265 case "$netdb_net_type" in
20266 '') try="$extern_C struct netent *getnetbyaddr($xxx, int);"
20267 if ./protochk "$try" $hdrs; then
20268 echo "Your system accepts $xxx."
20269 netdb_net_type="$xxx"
20274 : In case none of those worked, prompt the user.
20275 case "$netdb_net_type" in
20276 '') rp='What is the type for the 1st argument to getnetbyaddr?'
20279 netdb_net_type=$ans
20283 *) : no getnetbyaddr, so pick harmless default
20284 netdb_net_type='long'
20288 : locate the preferred pager for this system
20295 [a-zA-Z]:/*) dflt=$pg;;
20299 [a-zA-Z]:/*) dflt=$more;;
20303 [a-zA-Z]:/*) dflt=$less;;
20306 '') dflt=/usr/ucb/more;;
20314 rp='What pager is used on your system?'
20318 : see what type pids are declared as in the kernel
20319 rp="What is the type of process ids on this system?"
20320 set pid_t pidtype int stdio.h sys/types.h
20323 : see if ar generates random libraries by itself
20325 echo "Checking how to generate random libraries on your machine..." >&4
20326 echo 'int bar1() { return bar2(); }' > bar1.c
20327 echo 'int bar2() { return 2; }' > bar2.c
20329 #$i_stdlib I_STDLIB
20331 #include <stdlib.h>
20333 int main() { printf("%d\n", bar1()); exit(0); }
20335 $cc $ccflags -c bar1.c >/dev/null 2>&1
20336 $cc $ccflags -c bar2.c >/dev/null 2>&1
20337 $cc $ccflags -c foo.c >/dev/null 2>&1
20338 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
20339 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20340 $run ./foobar >/dev/null 2>&1; then
20341 echo "$ar appears to generate random libraries itself."
20343 if [ "X$ranlib" = "X" ]; then
20346 elif $ar s bar$_a >/dev/null 2>&1 &&
20347 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20348 $run ./foobar >/dev/null 2>&1; then
20349 echo "a table of contents needs to be added with '$ar s'."
20352 elif $ar ts bar$_a >/dev/null 2>&1 &&
20353 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20354 $run ./foobar >/dev/null 2>&1; then
20355 echo "a table of contents needs to be added with '$ar ts'."
20362 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
20363 $test -f $ranlib || ranlib=''
20366 if $test -n "$ranlib"; then
20367 echo "your system has '$ranlib'; we'll use that."
20370 echo "your system doesn't seem to support random libraries"
20371 echo "so we'll use lorder and tsort to order the libraries."
20378 : see if this is a values.h system
20379 set values.h i_values
20382 : Check the max offset that gmtime and localtime accept
20383 echo "Checking max offsets that gmtime () accepts"
20386 define) yyy="#include <values.h>" ;;
20390 case "$sGMTIME_min/$sGMTIME_max" in
20393 #include <sys/types.h>
20402 void gm_check (time_t t, int min_year, int max_year)
20405 if ( tmp == NULL ||
20406 /* Check tm_year overflow */
20407 tmp->tm_year < min_year || tmp->tm_year > max_year)
20418 gm_check (MAXLONG, 69, 0x7fffffff);
20420 if (tmp == NULL || tmp->tm_year < 0) {
20421 for (i = 63; i >= 0; i--) {
20422 time_t x = pt | ((time_t)1 << i);
20423 if (x < 0 || x < pt) continue;
20424 gm_check (x, 69, 0x7fffffff);
20427 printf ("sGMTIME_max=%ld\n", pt);
20436 gm_check (MINLONG, -1900, 70);
20439 for (i = 36; i >= 0; i--) {
20440 time_t x = pt - ((time_t)1 << i);
20441 if (x > 0) continue;
20442 gm_check (x, -1900, 70);
20445 printf ("sGMTIME_min=%ld\n", pt);
20449 int main (int argc, char *argv[])
20451 fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t));
20458 if eval $compile; then
20461 echo "Cannot determine sGMTIME_max and sGMTIME_min." >&4
20467 echo "Checking max offsets that localtime () accepts"
20469 case "$sLOCALTIME_min/$sLOCALTIME_max" in
20472 #include <sys/types.h>
20481 void local_check (time_t t, int min_year, int max_year)
20483 if (sizeof (time_t) > 4 && t > 0x7ffffffffffff000LL)
20486 tmp = localtime (&t);
20487 if ( tmp == NULL ||
20488 /* Check tm_year overflow */
20489 tmp->tm_year < min_year || tmp->tm_year > max_year)
20493 } /* local_check */
20500 local_check (MAXLONG, 69, 0x7fffffff);
20502 if (tmp == NULL || tmp->tm_year < 0) {
20503 for (i = 63; i >= 0; i--) {
20504 time_t x = pt | ((time_t)1 << i);
20505 if (x < 0 || x < pt) continue;
20506 local_check (x, 69, 0x7fffffff);
20509 printf ("sLOCALTIME_max=%ld\n", pt);
20518 local_check (MINLONG, -1900, 70);
20521 for (i = 36; i >= 0; i--) {
20522 time_t x = pt - ((time_t)1 << i);
20523 if (x > 0) continue;
20524 local_check (x, -1900, 70);
20527 printf ("sLOCALTIME_min=%ld\n", pt);
20531 int main (int argc, char *argv[])
20539 if eval $compile; then
20542 echo "Cannot determine sLOCALTIME_max and sLOCALTIME_min." >&4
20548 : check for type of arguments to select.
20549 case "$selecttype" in
20550 '') case "$d_select" in
20554 Checking to see what type of arguments are accepted by select().
20556 hdrs="$define sys/types.h
20557 $i_systime sys/time.h
20558 $i_sysselct sys/select.h
20559 $d_socket sys/socket.h"
20560 : The first arg can be int, unsigned, or size_t
20561 : The last arg may or may not be 'const'
20563 : void pointer has been seen but using that
20564 : breaks the selectminbits test
20565 for xxx in 'fd_set *' 'int *'; do
20566 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
20567 for tmo in 'struct timeval *' 'const struct timeval *'; do
20569 '') try="$extern_C select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
20570 if ./protochk "$try" $hdrs; then
20571 echo "Your system accepts $xxx."
20580 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
20581 case "$d_fd_set" in
20582 $define) dflt="fd_set *" ;;
20591 *) : no select, so pick a harmless default
20598 : check for the select 'width'
20599 case "$selectminbits" in
20600 '') safebits=`expr $ptrsize \* 8`
20601 case "$d_select" in
20605 Checking to see on how many bits at a time your select() operates...
20608 #include <sys/types.h>
20610 #$i_systime I_SYS_TIME
20611 #$i_systimek I_SYS_TIME_KERNEL
20616 # ifdef I_SYS_TIME_KERNEL
20619 # include <sys/time.h>
20620 # ifdef I_SYS_TIME_KERNEL
20624 #$i_sysselct I_SYS_SELECT
20625 #ifdef I_SYS_SELECT
20626 #include <sys/select.h>
20628 #$d_socket HAS_SOCKET
20630 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
20633 #$i_stdlib I_STDLIB
20635 #include <stdlib.h>
20638 #define S sizeof(*(b))
20640 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
20641 #define NBITS (NBYTES * 8)
20643 char *s = (char *)malloc(NBYTES);
20652 fp = fopen("try.c", "r");
20658 b = ($selecttype)s;
20659 for (i = 0; i < NBITS; i++)
20663 select(fd + 1, b, 0, 0, &t);
20664 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
20666 printf("%d\n", i + 1);
20671 if eval $compile_ok; then
20672 selectminbits=`$run ./try`
20673 case "$selectminbits" in
20675 Cannot figure out on how many bits at a time your select() operates.
20676 I'll play safe and guess it is $safebits bits.
20678 selectminbits=$safebits
20679 bits="$safebits bits"
20682 *) bits="$selectminbits bits" ;;
20684 echo "Your select() operates on $bits at a time." >&4
20686 rp='What is the minimum number of bits your select() operates on?'
20687 case "$byteorder" in
20688 12345678) dflt=64 ;;
20694 selectminbits="$val"
20698 *) : no select, so pick a harmless default
20699 selectminbits=$safebits
20705 : Trace out the files included by signal.h, then look for SIGxxx names.
20706 if [ "X$fieldn" = X ]; then
20707 : Just make some guesses. We check them later.
20708 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
20710 xxx=`echo '#include <signal.h>' |
20711 $cppstdin $cppminus $cppflags 2>/dev/null |
20712 $grep '^[ ]*#.*include' |
20713 $awk "{print \\$$fieldn}" | $sed 's!"!!g' |\
20714 $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
20717 for xx in $xxx /dev/null ; do
20718 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
20720 case "$xxxfiles" in
20721 '') xxxfiles=`./findhdr signal.h` ;;
20724 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
20725 print substr($2, 4, 20)
20727 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
20728 print substr($3, 4, 20)
20730 : Append some common names just in case the awk scan failed.
20731 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
20732 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
20733 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
20734 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
20735 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
20737 : generate a few handy files for later
20738 $cat > signal.c <<EOCP
20739 #include <sys/types.h>
20740 #include <signal.h>
20741 #$i_stdlib I_STDLIB
20743 #include <stdlib.h>
20748 /* Strange style to avoid deeply-nested #if/#else/#endif */
20751 # define NSIG (_NSIG)
20757 # define NSIG (SIGMAX+1)
20763 # define NSIG (SIG_MAX+1)
20769 # define NSIG (_SIG_MAX+1)
20775 # define NSIG (MAXSIG+1)
20781 # define NSIG (MAX_SIG+1)
20786 # ifdef SIGARRAYSIZE
20787 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
20793 # define NSIG (_sys_nsig) /* Solaris 2.5 */
20797 /* Default to some arbitrary number that's big enough to get most
20798 of the common signals.
20804 printf("NSIG %d\n", NSIG);
20810 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
20812 printf "#ifdef SIG"; printf $1; printf "\n"
20813 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
20814 printf $1; printf ");\n"
20818 printf "#endif /* JUST_NSIG */\n";
20819 printf "exit(0);\n}\n";
20822 $cat >signal.awk <<'EOP'
20823 BEGIN { ndups = 0 }
20824 $1 ~ /^NSIG$/ { nsig = $2 }
20825 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
20826 if ($2 > maxsig) { maxsig = $2 }
20827 if (sig_name[$2]) {
20828 dup_name[ndups] = $1
20829 dup_num[ndups] = $2
20841 printf("NSIG %d\n", nsig);
20842 for (n = 1; n < nsig; n++) {
20844 printf("%s %d\n", sig_name[n], sig_num[n])
20847 printf("NUM%d %d\n", n, n)
20850 for (n = 0; n < ndups; n++) {
20851 printf("%s %d\n", dup_name[n], dup_num[n])
20855 $cat >signal_cmd <<EOS
20857 if $test -s signal.lst; then
20858 echo "Using your existing signal.lst file"
20863 $cat >>signal_cmd <<'EOS'
20866 if eval $compile_ok; then
20867 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) |\
20868 $uniq | $awk -f signal.awk >signal.lst
20870 echo "(I can't seem be able to compile the whole test program)" >&4
20871 echo "(I'll try it in little pieces.)" >&4
20872 set signal -DJUST_NSIG
20873 if eval $compile_ok; then
20874 $run ./signal$_exe > signal.nsg
20877 echo "I can't seem to figure out how many signals you have." >&4
20878 echo "Guessing 50." >&4
20879 echo 'NSIG 50' > signal.nsg
20881 : Now look at all the signal names, one at a time.
20882 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
20883 $cat > signal.c <<EOCP
20884 #include <sys/types.h>
20885 #include <signal.h>
20888 printf("$xx %d\n", SIG${xx});
20893 if eval $compile; then
20894 echo "SIG${xx} found."
20895 $run ./signal$_exe >> signal.ls1
20897 echo "SIG${xx} NOT found."
20900 if $test -s signal.ls1; then
20901 $cat signal.nsg signal.ls1 |
20902 $sort -n | $uniq | $awk -f signal.awk >signal.lst
20906 if $test -s signal.lst; then
20909 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
20910 echo 'kill -l' >signal
20911 set X `csh -f <signal`
20915 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
20917 echo $@ | $tr ' ' $trnl | \
20918 $awk '{ printf "%s %d\n", $1, ++s; }
20919 END { printf "NSIG %d\n", ++s }' >signal.lst
20921 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
20923 chmod a+x signal_cmd
20924 $eunicefix signal_cmd
20926 : generate list of signal names
20928 case "$sig_name_init" in
20930 *) case "$sig_num_init" in
20931 ''|*,*) doinit=yes ;;
20936 echo "Generating a list of signal names and numbers..." >&4
20938 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
20939 sig_name=`$awk 'BEGIN { printf "ZERO " }
20940 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
20941 sig_num=`$awk 'BEGIN { printf "0 " }
20942 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
20943 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
20944 !/^NSIG/ { printf "\"%s\", ", $1 }
20945 END { printf "0\n" }' signal.lst`
20946 sig_num_init=`$awk 'BEGIN { printf "0, " }
20947 !/^NSIG/ { printf "%d, ", $2}
20948 END { printf "0\n"}' signal.lst`
20951 echo "The following $sig_count signals are available:"
20953 echo $sig_name | $awk \
20954 'BEGIN { linelen = 0 }
20956 for (i = 1; i <= NF; i++) {
20957 name = "SIG" $i " "
20958 linelen = linelen + length(name)
20959 if (linelen > 70) {
20961 linelen = length(name)
20967 sig_size=`echo $sig_name | awk '{print NF}'`
20968 $rm -f signal signal.c signal.awk signal.lst signal_cmd
20970 : Check size of size
20972 case "$sizetype" in
20973 *_t) zzz="$sizetype" ;;
20974 *) zzz="filesize" ;;
20976 echo "Checking the size of $zzz..." >&4
20978 #include <sys/types.h>
20980 #$i_stdlib I_STDLIB
20982 #include <stdlib.h>
20985 printf("%d\n", (int)sizeof($sizetype));
20990 if eval $compile_ok; then
20994 echo "(I can't execute the test program--guessing $sizesize.)" >&4
20997 echo "Your $zzz size is $sizesize bytes."
21002 echo "(I can't compile the test program--guessing $sizesize.)" >&4
21006 : check for socklen_t
21008 echo "Checking to see if you have socklen_t..." >&4
21010 #include <sys/types.h>
21011 #$d_socket HAS_SOCKET
21013 #include <sys/socket.h>
21015 int main() { socklen_t x = 16; }
21018 if eval $compile; then
21020 echo "You have socklen_t."
21023 echo "You do not have socklen_t."
21024 case "$sizetype" in
21025 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
21032 : see if this is a socks.h system
21033 set socks.h i_socks
21036 : check for type of the size argument to socket calls
21037 case "$d_socket" in
21041 Checking to see what type is the last argument of accept().
21044 case "$d_socklen_t" in
21045 "$define") yyy="$yyy socklen_t"
21047 yyy="$yyy $sizetype int long unsigned"
21048 for xxx in $yyy; do
21049 case "$socksizetype" in
21050 '') try="$extern_C int accept(int, struct sockaddr *, $xxx *);"
21051 case "$usesocks" in
21053 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
21054 echo "Your system accepts '$xxx *' for the last argument of accept()."
21055 socksizetype="$xxx"
21058 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
21059 echo "Your system accepts '$xxx *' for the last argument of accept()."
21060 socksizetype="$xxx"
21067 : In case none of those worked, prompt the user.
21068 case "$socksizetype" in
21069 '') rp='What is the type for socket address structure sizes?'
21076 *) : no sockets, so pick relatively harmless default
21081 : see what type is used for signed size_t
21082 set ssize_t ssizetype int stdio.h sys/types.h
21087 #$i_stdlib I_STDLIB
21089 #include <stdlib.h>
21091 #include <sys/types.h>
21092 #define Size_t $sizetype
21093 #define SSize_t $dflt
21096 if (sizeof(Size_t) == sizeof(SSize_t))
21098 else if (sizeof(Size_t) == sizeof(int))
21107 if eval $compile_ok && $run ./try > /dev/null; then
21108 ssizetype=`$run ./try`
21109 echo "I'll be using $ssizetype for functions returning a byte count." >&4
21112 Help! I can't compile and run the ssize_t test program: please enlighten me!
21113 (This is probably a misconfiguration in your system or libraries, and
21114 you really ought to fix it. Still, I'll try anyway.)
21116 I need a type that is the same size as $sizetype, but is guaranteed to
21117 be signed. Common values are ssize_t, int and long.
21120 rp="What signed type is the same size as $sizetype?"
21126 : Check the size of st_ino
21128 $echo "Checking the size of st_ino..." >&4
21129 $cat > try.c <<EOCP
21130 #include <sys/stat.h>
21132 #$i_stdlib I_STDLIB
21134 #include <stdlib.h>
21138 printf("%d\n", (int)sizeof(st.st_ino));
21143 if eval $compile_ok; then
21147 $echo "(I can't execute the test program--guessing $st_ino_size.)" >&4
21149 *) st_ino_size=$val
21150 $echo "Your st_ino is $st_ino_size bytes long."
21155 $echo "(I can't compile the test program--guessing $st_ino_size.)" >&4
21159 : Check if st_ino is signed
21161 $echo "Checking the sign of st_ino..." >&4
21162 $cat > try.c <<EOCP
21163 #include <sys/stat.h>
21168 if (foo.st_ino < 0)
21175 if eval $compile; then
21179 $echo "(I can't execute the test program--guessing unsigned.)" >&4
21181 *) st_ino_sign=$val
21182 case "$st_ino_sign" in
21183 1) $echo "Your st_ino is unsigned." ;;
21184 -1) $echo "Your st_ino is signed." ;;
21190 $echo "(I can't compile the test program--guessing unsigned.)" >&4
21194 : see what type of char stdio uses.
21196 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
21197 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
21198 echo "Your stdio uses unsigned chars." >&4
21199 stdchar="unsigned char"
21201 echo "Your stdio uses signed chars." >&4
21206 : see what type uids are declared as in the kernel
21208 echo "Looking for the type for user ids returned by getuid()."
21209 set uid_t uidtype xxx stdio.h sys/types.h
21213 xxx=`./findhdr sys/user.h`
21214 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
21216 unsigned) dflt="$1 $2" ;;
21220 *) dflt="$uidtype";;
21223 uid_t) echo "uid_t found." ;;
21224 *) rp="What is the type for user ids returned by getuid()?"
21230 : Check size of UID
21233 *_t) zzz="$uidtype" ;;
21236 echo "Checking the size of $zzz..." >&4
21238 #include <sys/types.h>
21240 #$i_stdlib I_STDLIB
21242 #include <stdlib.h>
21245 printf("%d\n", (int)sizeof($uidtype));
21250 if eval $compile_ok; then
21254 echo "(I can't execute the test program--guessing $uidsize.)" >&4
21257 echo "Your $zzz is $uidsize bytes long."
21262 echo "(I can't compile the test program--guessing $uidsize.)" >&4
21265 : Check if UID is signed
21268 *_t) zzz="$uidtype" ;;
21271 echo "Checking the sign of $zzz..." >&4
21273 #include <sys/types.h>
21284 if eval $compile; then
21288 echo "(I can't execute the test program--guessing unsigned.)" >&4
21292 1) echo "Your $zzz is unsigned." ;;
21293 -1) echo "Your $zzz is signed." ;;
21299 echo "(I can't compile the test program--guessing unsigned.)" >&4
21303 : Check format string for UID
21305 $echo "Checking the format string to be used for uids..." >&4
21308 -1) if $test X"$uidsize" = X"$ivsize"; then
21309 uidformat="$ivdformat"
21311 if $test X"$uidsize" = X"$longsize"; then
21314 if $test X"$uidsize" = X"$intsize"; then
21317 if $test X"$uidsize" = X"$shortsize"; then
21324 *) if $test X"$uidsize" = X"$uvsize"; then
21325 uidformat="$uvuformat"
21327 if $test X"$uidsize" = X"$longsize"; then
21330 if $test X"$uidsize" = X"$intsize"; then
21333 if $test X"$uidsize" = X"$shortsize"; then
21342 : Determine if we can use sysctl with KERN_PROC_PATHNAME to find executing program
21344 echo "Determining whether we can use sysctl with KERN_PROC_PATHNAME to find executing program..." >&4
21345 $cat >try.c <<'EOM'
21346 /* Intentionally a long probe as I'd like to sanity check that the exact
21347 approach is going to work, as thinking it will work, but only having it
21348 part working at runtime is worse than not having it. */
21350 #include <sys/types.h>
21351 #include <sys/sysctl.h>
21352 #include <sys/param.h>
21354 #include <string.h>
21355 #include <stdlib.h>
21356 #include <unistd.h>
21359 main(int argc, char **argv) {
21361 char *argv_leaf = strrchr(argv[0], '/');
21367 mib[1] = KERN_PROC;
21368 mib[2] = KERN_PROC_PATHNAME;
21372 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
21376 if (sysctl(mib, 4, NULL, &size, NULL, 0)) {
21381 if (size < strlen(argv_leaf) + 1) {
21382 fprintf(stderr, "size %lu is too short for a path\n",
21383 (unsigned long) size);
21387 if (size > MAXPATHLEN * MAXPATHLEN) {
21388 fprintf(stderr, "size %lu is too long for a path\n",
21389 (unsigned long) size);
21393 buffer = malloc(size);
21399 if (sysctl(mib, 4, buffer, &size, NULL, 0)) {
21404 if (strlen(buffer) + 1 != size) {
21405 fprintf(stderr, "size != strlen(buffer) + 1 (%lu != %lu)\n",
21406 (unsigned long)size, (unsigned long)strlen(buffer) + 1);
21411 if (*buffer != '/') {
21412 fprintf(stderr, "Not an absolute path: '%s'\n", buffer);
21416 if (strstr(buffer, "/./")) {
21417 fprintf(stderr, "Contains /./: '%s'\n", buffer);
21421 if (strstr(buffer, "/../")) {
21422 fprintf(stderr, "Contains /../: '%s'\n", buffer);
21426 buffer_leaf = strrchr(buffer, '/');
21427 if (strcmp(buffer_leaf, argv_leaf) != 0) {
21428 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], buffer);
21440 if eval $compile_ok; then
21441 if $run ./try; then
21442 echo "You can use sysctl with KERN_PROC_PATHNAME to find the executing program." >&4
21445 echo "Nope, sysctl with KERN_PROC_PATHNAME doesn't work here." >&4
21449 echo "I'm unable to compile the test program." >&4
21450 echo "I'll assume no sysctl with KERN_PROC_PATHNAME here." >&4
21454 set usekernprocpathname
21457 : Determine if we can use _NSGetExecutablePath to find executing program
21459 echo "Determining whether we can use _NSGetExecutablePath to find executing program..." >&4
21460 $cat >try.c <<'EOM'
21461 /* Intentionally a long probe as I'd like to sanity check that the exact
21462 approach is going to work, as thinking it will work, but only having it
21463 part working at runtime is worse than not having it. */
21464 #include <mach-o/dyld.h>
21466 #include <stdlib.h>
21467 #include <sys/param.h>
21468 #include <string.h>
21471 main(int argc, char **argv) {
21473 uint32_t size = sizeof(buf);
21477 char *argv_leaf = strrchr(argv[0], '/');
21481 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
21485 _NSGetExecutablePath(buf, &size);
21486 if (size > MAXPATHLEN * MAXPATHLEN) {
21487 fprintf(stderr, "_NSGetExecutablePath size %u is too long for a path\n",
21488 (unsigned int) size);
21492 buffer = malloc(size);
21498 result = _NSGetExecutablePath(buffer, &size);
21500 fprintf(stderr, "_NSGetExecutablePath returned %i for a size of %u\n",
21501 result, (unsigned int) size);
21505 tidied = realpath(buffer, NULL);
21507 perror("realpath");
21513 if (*tidied != '/') {
21514 fprintf(stderr, "Not an absolute path: '%s'\n", tidied);
21518 if (strstr(tidied, "/./")) {
21519 fprintf(stderr, "Contains /./: '%s'\n", tidied);
21523 if (strstr(tidied, "/../")) {
21524 fprintf(stderr, "Contains /../: '%s'\n", tidied);
21528 tidied_leaf = strrchr(tidied, '/');
21529 if (strcmp(tidied_leaf, argv_leaf) != 0) {
21530 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], tidied);
21542 if eval $compile_ok; then
21543 if $run ./try; then
21544 echo "You can use _NSGetExecutablePath to find the executing program." >&4
21547 echo "Nope, _NSGetExecutablePath doesn't work here." >&4
21550 echo "I'm unable to compile the test program." >&4
21551 echo "I'll assume no _NSGetExecutablePath here." >&4
21554 set usensgetexecutablepath
21557 : Check if site customization support was requested
21558 case "$usesitecustomize" in
21559 $define|true|[Yy]*)
21560 usesitecustomize="$define"
21563 usesitecustomize="$undef"
21567 : see if prototypes support variable argument declarations
21569 case "$prototype$i_stdarg" in
21571 echo "It appears we'll be able to prototype varargs functions." >&4
21575 echo "Too bad... We won't be using prototyped varargs functions..." >&4
21582 : determine compiler compiler
21591 if $test -f "$byacc$_exe"; then
21593 comp="byacc or $comp"
21595 if $test -f "$bison$_exe"; then
21596 comp="$comp or bison -y"
21598 rp="Which compiler compiler ($comp) shall I use?"
21607 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
21613 : see if this is a assert.h system
21614 set assert.h i_assert
21617 : see if this is a fp.h system
21621 : see if this is a fp_class.h system
21622 set fp_class.h i_fp_class
21625 : see if gdbm.h is available
21630 : see if gdbm_open exists
21631 set gdbm_open d_gdbm_open
21633 case "$d_gdbm_open" in
21636 echo "We won't be including <gdbm.h>"
21645 : see if this is a ieeefp.h system
21646 case "$i_ieeefp" in
21647 '' ) set ieeefp.h i_ieeefp
21652 : see if this is a libutil.h system
21653 set libutil.h i_libutil
21656 : see if mach cthreads are available
21657 if test "X$usethreads" = "X$define"; then
21658 set mach/cthreads.h i_machcthr
21661 i_machcthr="$undef"
21664 : see if this is a mntent.h system
21665 set mntent.h i_mntent
21668 : see if net/errno.h is available
21670 set net/errno.h val
21673 : Unfortunately, it causes problems on some systems. Arrgh.
21676 cat > try.c <<'EOM'
21679 #include <net/errno.h>
21685 if $cc $ccflags -c try.c >/dev/null 2>&1; then
21686 echo "We'll be including <net/errno.h>." >&4
21688 echo "We won't be including <net/errno.h>." >&4
21697 : see if netinet/tcp.h is available
21698 set netinet/tcp.h i_netinettcp
21701 : see if this is a poll.h system
21705 : see if this is a prot.h system
21709 : Preprocessor symbols
21711 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
21712 $cat <<'EOSH' > Cppsym.know
21713 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
21714 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
21715 alliant alpha am29000 AM29000 AMD64 amd64 amiga AMIGAOS AMIX
21716 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
21717 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
21718 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
21719 bull c cadmus clipper CMU COFF COMPILER_VERSION
21720 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
21721 CYGWIN DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
21722 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
21723 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
21725 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
21726 H3050R H3050RX hbullx20 hcx host_mips
21727 hp200 hp300 hp700 HP700 hp800 hp9000
21728 hp9000s200 hp9000s300 hp9000s400 hp9000s500
21729 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
21730 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
21731 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
21732 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
21733 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
21734 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
21735 LIBCATAMOUNT Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
21736 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
21737 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
21738 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
21739 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
21740 MATH_HAS_NO_SIDE_EFFECTS
21741 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
21742 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
21743 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
21744 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
21745 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
21746 NetBSD news1500 news1700 news1800 news1900 news3700
21747 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
21748 ns32016 ns32332 ns32k nsc32000
21749 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
21750 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
21751 pc532 pdp11 PGC PIC plexus PORTAR posix
21752 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
21753 POSIX_C_SOURCE POSIX_SOURCE POWER
21754 PROTOTYPES PWB pyr QNX QK_USER R3000 REENTRANT RES Rhapsody RISC6000
21755 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
21756 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
21757 sony sony_news sonyrisc sparc sparclite spectrum
21758 stardent stdc STDC_EXT stratos sun sun3 sun386
21759 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
21760 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
21761 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
21762 sysV68 sysV88 Tek4132 Tek4300 titan
21763 TM3200 TM5400 TM5600
21764 tower tower32 tower32_200 tower32_600 tower32_700
21765 tower32_800 tower32_850 tss
21766 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
21767 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
21768 unix UNIX95 UNIX99 unixpc unos
21769 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
21770 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
21771 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
21773 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms x86_64 xenix Xenix286
21774 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
21775 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
21778 # Maybe put other stuff here too.
21779 cat <<EOSH >>Cppsym.know
21782 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
21783 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
21784 $cat Cppsym.know > Cppsym.c
21785 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
21786 $rm -f Cppsym.a Cppsym.b Cppsym.c
21787 cat <<EOSH > Cppsym
21789 if $test \$# -gt 0; then
21790 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
21791 if $test -s Cppsym.got; then
21798 $tr " " "$trnl" | ./Cppsym.try
21804 cat <<EOSH > Cppsym.try
21806 cat <<'EOCP' > try.c
21809 #define STRINGIFY(a) "a"
21811 #if cpp_stuff == 42
21812 #define StGiFy(a) #a
21813 #define STRINGIFY(a) StGiFy(a)
21815 #if $cpp_stuff != 1 && $cpp_stuff != 42
21816 # include "Bletch: How does this C preprocessor stringify macros?"
21822 cat <<'EOSH' >> Cppsym.try
21824 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
21825 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
21826 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
21827 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
21829 echo 'return 0;}' >> try.c
21831 cat <<EOSH >> Cppsym.try
21833 case "$osname-$gccversion" in
21834 irix-) ccflags="\$ccflags -woff 1178" ;;
21835 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
21837 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
21839 chmod +x Cppsym.try
21840 $eunicefix Cppsym.try
21841 ./Cppsym < Cppsym.know > Cppsym.true
21842 : Add in any linux cpp "predefined macros":
21843 case "$osname::$gccversion" in
21844 *linux*::*.*|*gnukfreebsd*::*.*|gnu::*.*)
21846 rm -f $tHdrH'.h' $tHdrH
21848 if $cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
21849 sed 's/#define[\ \ ]*//;s/[\ \ ].*$//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
21850 if [ -s $tHdrH'_cppsym.real' ]; then
21851 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
21854 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
21857 : now check the C compiler for additional symbols
21858 postprocess_cc_v=''
21860 aix) postprocess_cc_v="|$tr , ' '" ;;
21867 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
21870 -D*) echo "\$i" | $sed 's/^-D//';;
21871 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
21876 postprocess_cc_v=''
21879 ./ccsym > ccsym1.raw
21880 if $test -s ccsym1.raw; then
21881 $sort ccsym1.raw | $uniq >ccsym.raw
21883 mv ccsym1.raw ccsym.raw
21886 $awk '/\=/ { print $0; next }
21887 { print $0"=1" }' ccsym.raw >ccsym.list
21888 $comm -13 Cppsym.true ccsym.list >ccsym.own
21889 $comm -12 Cppsym.true ccsym.list >ccsym.com
21890 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
21892 if $test -z ccsym.raw; then
21893 echo "Your C compiler doesn't seem to define any symbols!" >&4
21895 echo "However, your C preprocessor defines the following symbols:"
21898 cppsymbols=`$cat Cppsym.true`
21899 cppsymbols=`echo $cppsymbols`
21900 cppccsymbols="$cppsymbols"
21902 if $test -s ccsym.com; then
21903 echo "Your C compiler and pre-processor define these symbols:"
21904 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
21907 cppccsymbols=`$cat ccsym.com`
21908 cppccsymbols=`echo $cppccsymbols`
21909 $test "$silent" || sleep 1
21911 if $test -s ccsym.cpp; then
21912 $test "$also" && echo " "
21913 echo "Your C pre-processor ${also}defines the following symbols:"
21914 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
21916 cppsymbols=`$cat ccsym.cpp`
21917 cppsymbols=`echo $cppsymbols`
21918 $test "$silent" || sleep 1
21920 if $test -s ccsym.own; then
21921 $test "$also" && echo " "
21922 echo "Your C compiler ${also}defines the following cpp symbols:"
21923 $sed -e 's/\(..*\)=1/\1/' ccsym.own
21924 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
21925 ccsymbols=`$cat ccsym.own`
21926 ccsymbols=`echo $ccsymbols`
21927 $test "$silent" || sleep 1
21931 : see if this is a termio system
21935 if $test `./findhdr termios.h`; then
21936 set tcsetattr i_termios
21942 "$define") echo "You have POSIX termios.h... good!" >&4;;
21943 *) if ./Cppsym pyr; then
21944 case "`/bin/universe`" in
21945 ucb) if $test `./findhdr sgtty.h`; then
21947 echo "<sgtty.h> found." >&4
21949 echo "System is pyramid with BSD universe."
21950 ./warn "<sgtty.h> not found--you could have problems."
21952 *) if $test `./findhdr termio.h`; then
21954 echo "<termio.h> found." >&4
21956 echo "System is pyramid with USG universe."
21957 ./warn "<termio.h> not found--you could have problems."
21961 if $test `./findhdr termio.h`; then
21962 echo "<termio.h> found." >&4
21964 elif $test `./findhdr sgtty.h`; then
21965 echo "<sgtty.h> found." >&4
21968 ./warn "Neither <termio.h> nor <sgtty.h> found--cross fingers!"
21971 if $test `./findhdr sgtty.h`; then
21972 echo "<sgtty.h> found." >&4
21974 elif $test `./findhdr termio.h`; then
21975 echo "<termio.h> found." >&4
21978 ./warn "Neither <sgtty.h> nor <termio.h> found--cross fingers!"
21982 set i_termio; eval $setvar
21983 val=$val2; set i_sgtty; eval $setvar
21984 val=$val3; set i_termios; eval $setvar
21986 : see if stdbool is available
21987 : we want a real compile instead of Inhdr because some Solaris systems
21988 : have stdbool.h, but it can only be used if the compiler indicates it
21989 : is sufficiently c99-compliant.
21993 #include <stdbool.h>
21998 int main(int argc, char **argv)
22004 if eval $compile; then
22005 echo "<stdbool.h> found." >&4
22008 echo "<stdbool.h> NOT found." >&4
22015 : see if stddef is available
22016 set stddef.h i_stddef
22019 : see if sys/access.h is available
22020 set sys/access.h i_sysaccess
22023 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
22024 set sys/filio.h i_sysfilio
22027 if $test `./findhdr sys/ioctl.h`; then
22029 echo '<sys/ioctl.h> found.' >&4
22032 if $test $i_sysfilio = "$define"; then
22033 echo '<sys/ioctl.h> NOT found.' >&4
22035 $test $i_sgtty = "$define" && xxx="sgtty.h"
22036 $test $i_termio = "$define" && xxx="termio.h"
22037 $test $i_termios = "$define" && xxx="termios.h"
22038 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
22044 : see if socket ioctl defs are in sys/sockio.h
22046 xxx=`./findhdr sys/sockio.h`
22047 if $test "$xxx"; then
22048 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
22050 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
22053 echo "No socket ioctls found in <sys/sockio.h>." >&4
22058 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
22064 : see if this is a syslog.h system
22065 set syslog.h i_syslog
22068 : see if this is a sys/mode.h system
22069 set sys/mode.h i_sysmode
22072 : see if there is a sys/poll.h file
22073 set sys/poll.h i_syspoll
22076 : see if sys/resource.h has to be included
22077 set sys/resource.h i_sysresrc
22080 : see if sys/security.h is available
22081 set sys/security.h i_syssecrt
22084 : see if this is a sys/statvfs.h system
22085 set sys/statvfs.h i_sysstatvfs
22088 : see if this is a sys/un.h system
22089 set sys/un.h i_sysun
22092 : see if this is a sys/utsname.h system
22093 set sys/utsname.h i_sysutsname
22096 : see if this is a syswait system
22097 set sys/wait.h i_syswait
22100 : see if this is a ustat.h system
22101 set ustat.h i_ustat
22104 : see if this is an utime system
22105 set utime.h i_utime
22108 : see if this is a vfork system
22111 set vfork.h i_vfork
22121 echo "Looking for extensions..." >&4
22122 : If we are using the old config.sh, known_extensions may contain
22123 : old or inaccurate or duplicate values.
22124 known_extensions=''
22125 nonxs_extensions=''
22126 : We do not use find because it might not be available.
22127 : We do not just use MANIFEST because the user may have dropped
22128 : some additional extensions into the source tree and expect them
22131 : Function to recursively find available extensions, ignoring DynaLoader
22132 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
22133 : In 5.10.1 and later, extensions are stored in directories
22134 : like File-Glob instead of the older File/Glob/.
22138 DynaLoader|dynaload) ;;
22140 this_ext=`echo $xxx | $sed -e s/-/\\\//g`;
22141 leaf=`echo $xxx | $sed -e s/.*-//`;
22142 if $test -d File; then
22143 if $test -f $xxx/$leaf.xs -o -f $xxx/$leaf.c; then
22144 known_extensions="$known_extensions $1$this_ext";
22145 elif $test -f $xxx/Makefile.PL; then
22146 nonxs_extensions="$nonxs_extensions $1$this_ext";
22148 if $test -d $xxx -a $# -lt 10; then
22151 eval $find_extensions;
22157 $ls -1 $xxx > $$.tmp;
22158 if $contains "\.xs$" $$.tmp > /dev/null 2>&1; then
22159 known_extensions="$known_extensions $this_ext";
22160 elif $contains "\.c$" $$.tmp > /dev/null 2>&1; then
22161 known_extensions="$known_extensions $this_ext";
22162 elif $test -d $xxx; then
22163 nonxs_extensions="$nonxs_extensions $this_ext";
22174 eval $find_extensions
22178 eval $find_extensions
22182 eval $find_extensions
22183 if $test -d File-Glob; then
22184 : All ext/ flattened
22186 # Special case: Add in modules that nest beyond the first level.
22187 # Currently threads/shared and Hash/Util/FieldHash, since they are
22188 # not picked up by the recursive find above (and adding in general
22189 # recursive finding breaks SDBM_File/sdbm).
22190 # A.D. 20011025 (SDBM), ajgough 20071008 (FieldHash)
22191 known_extensions="$known_extensions threads/shared Hash/Util/FieldHash"
22193 set X $known_extensions
22195 known_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
22196 set X $nonxs_extensions
22198 nonxs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
22201 : Now see which are supported on this system.
22203 for xxx in $known_extensions ; do
22207 $define) avail_ext="$avail_ext $xxx" ;;
22210 GDBM_File|gdbm_fil)
22212 $define) avail_ext="$avail_ext $xxx" ;;
22215 I18N/Langinfo|i18n_lan)
22216 case "$i_langinfo$d_nl_langinfo" in
22217 $define$define) avail_ext="$avail_ext $xxx" ;;
22221 : XXX Do we need a useipcsysv variable here
22222 case "${d_msg}${d_sem}${d_shm}" in
22223 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
22226 NDBM_File|ndbm_fil)
22229 case "$osname-$use64bitint" in
22232 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
22235 *) avail_ext="$avail_ext $xxx" ;;
22240 ODBM_File|odbm_fil)
22241 case "${i_dbm}${i_rpcsvcdbm}" in
22243 case "$d_cplusplus" in
22244 define) ;; # delete as a function name will not work
22245 *) case "$osname-$use64bitint" in
22248 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
22251 *) avail_ext="$avail_ext $xxx" ;;
22259 case "$useopcode" in
22260 true|define|y) avail_ext="$avail_ext $xxx" ;;
22264 case "$useposix" in
22265 true|define|y) avail_ext="$avail_ext $xxx" ;;
22269 case "$d_socket" in
22272 beos) ;; # not unless BONE
22273 *) avail_ext="$avail_ext $xxx" ;;
22278 Sys/Syslog|sys/syslog)
22279 : XXX syslog requires socket
22280 case "$d_socket" in
22281 true|$define|y) avail_ext="$avail_ext $xxx" ;;
22285 case "$usethreads" in
22287 case "$use5005threads" in
22288 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
22292 threads|threads/shared)
22293 # threads and threads::shared are special cases.
22294 # To stop people from asking "Perl 5.8.0 was supposed
22295 # to have this new fancy threads implementation but my
22296 # perl doesn't have it" and from people trying to
22297 # (re)install the threads module using CPAN.pm and
22298 # CPAN.pm then offering to reinstall Perl 5.8.0,
22299 # the threads.pm and threads/shared.pm will always be
22300 # there, croaking informatively ("you need to rebuild
22301 # all of Perl with threads, sorry") when threads haven't
22302 # been compiled in.
22304 avail_ext="$avail_ext $xxx"
22310 cygwin) avail_ext="$avail_ext $xxx" ;;
22313 XS/APItest|xs/apitest)
22314 # This is just for testing. Skip it unless we have dynamic loading.
22317 $define) avail_ext="$avail_ext $xxx" ;;
22320 XS/Typemap|xs/typemap)
22321 # This is just for testing. Skip it unless we have dynamic loading.
22323 $define) avail_ext="$avail_ext $xxx" ;;
22326 *) avail_ext="$avail_ext $xxx"
22335 case "$onlyextensions" in
22337 *) keepextensions=''
22338 echo "You have requested that only certain extensions be included..." >&4
22339 for i in $onlyextensions; do
22340 case " $avail_ext " in
22342 echo "Keeping extension $i."
22343 keepextensions="$keepextensions $i"
22345 *) echo "Ignoring extension $i." ;;
22348 avail_ext="$keepextensions"
22352 case "$noextensions" in
22354 *) keepextensions=''
22355 echo "You have requested that certain extensions be ignored..." >&4
22356 for i in $avail_ext; do
22357 case " $noextensions " in
22358 *" $i "*) echo "Ignoring extension $i." ;;
22359 *) echo "Keeping extension $i.";
22360 keepextensions="$keepextensions $i"
22364 avail_ext="$keepextensions"
22368 : Now see which nonxs extensions are supported on this system.
22369 : For now assume all are.
22371 for xxx in $nonxs_extensions ; do
22373 *) nonxs_ext="$nonxs_ext $xxx"
22385 A number of extensions are supplied with $package. You may choose to
22386 compile these extensions for dynamic loading (the default), compile
22387 them into the $package executable (static loading), or not include
22388 them at all. Answer "none" to include no extensions.
22389 Note that DynaLoader is always built and need not be mentioned here.
22392 case "$dynamic_ext" in
22394 : Exclude those listed in static_ext
22396 for xxx in $avail_ext; do
22397 case " $static_ext " in
22399 *) dflt="$dflt $xxx" ;;
22406 *) dflt="$dynamic_ext"
22407 # Perhaps we are reusing an old out-of-date config.sh.
22410 if test X"$dynamic_ext" != X"$avail_ext"; then
22412 NOTICE: Your previous config.sh list may be incorrect.
22413 The extensions now available to you are
22415 but the default list from your previous config.sh is
22427 rp="What extensions do you wish to load dynamically?"
22430 none) dynamic_ext=' ' ;;
22431 *) dynamic_ext="$ans" ;;
22434 case "$static_ext" in
22436 : Exclude those already listed in dynamic linking
22438 for xxx in $avail_ext; do
22439 case " $dynamic_ext " in
22441 *) dflt="$dflt $xxx" ;;
22448 *) dflt="$static_ext"
22455 rp="What extensions do you wish to load statically?"
22458 none) static_ext=' ' ;;
22459 *) static_ext="$ans" ;;
22464 A number of extensions are supplied with $package. Answer "none"
22465 to include no extensions.
22466 Note that DynaLoader is always built and need not be mentioned here.
22469 case "$static_ext" in
22470 '') dflt="$avail_ext" ;;
22471 *) dflt="$static_ext"
22472 # Perhaps we are reusing an old out-of-date config.sh.
22475 if test X"$static_ext" != X"$avail_ext"; then
22477 NOTICE: Your previous config.sh list may be incorrect.
22478 The extensions now available to you are
22480 but the default list from your previous config.sh is
22489 : Exclude those that are not xs extensions
22493 rp="What extensions do you wish to include?"
22496 none) static_ext=' ' ;;
22497 *) static_ext="$ans" ;;
22502 # Encode is a special case. If we are building Encode as a static
22503 # extension, we need to explicitly list its subextensions as well.
22504 # For other nested extensions, this is handled automatically by
22505 # the appropriate Makefile.PL.
22506 case " $static_ext " in
22507 *" Encode "*) # Add the subextensions of Encode
22509 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
22510 static_ext="$static_ext Encode/$xxx"
22516 set X $dynamic_ext $static_ext $nonxs_ext
22520 # Sanity check: We require an extension suitable for use with
22521 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
22522 # should show up as failures in the test suite, but it's helpful to
22523 # catch them now.) The 'extensions' list is normally sorted
22524 # alphabetically, so we need to accept either
22525 # DB_File ... Fcntl ... IO ....
22526 # or something like
22527 # Fcntl ... NDBM_File ... IO ....
22528 case " $extensions" in
22529 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
22530 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
22531 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
22532 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
22533 echo "WARNING: The Perl you are building will be quite crippled." >& 4
22537 : Remove libraries needed only for extensions
22538 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
22539 : The exception is SunOS 4.x, which needs them.
22540 case "${osname}X${osvers}" in
22544 *) case "$usedl" in
22545 $define|true|[yY]*)
22546 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
22550 *) perllibs="$libs"
22556 : Remove build directory name from cppstdin so it can be used from
22557 : either the present location or the final installed location.
22559 : Get out of the UU directory to get correct path name.
22561 case "$cppstdin" in
22563 echo "Stripping down cppstdin path name"
22569 : end of configuration questions
22571 echo "End of configuration questions."
22574 : back to where it started
22575 if test -d ../UU; then
22579 : configuration may be unconditionally patched via a 'config.arch' file
22580 if $test -f config.arch; then
22581 echo "I see a config.arch file, loading it." >&4
22585 : configuration may be patched via a 'config.over' file
22586 if $test -f config.over; then
22589 rp='I see a config.over file. Do you wish to load it?'
22592 n*) echo "OK, I'll ignore it.";;
22594 echo "Configuration override changes have been loaded."
22599 : in case they want portability, strip down executable paths
22600 case "$d_portable" in
22603 echo "Stripping down executable paths..." >&4
22604 for file in $loclist $trylist; do
22606 eval $file=`basename $temp`
22611 : create config.sh file
22613 echo "Creating config.sh..." >&4
22614 $spitshell <<EOT >config.sh
22617 # This file was produced by running the Configure script. It holds all the
22618 # definitions figured out by Configure. Should you modify one of these values,
22619 # do not forget to propagate your changes by running "Configure -der". You may
22620 # instead choose to run each of the .SH files by yourself, or "Configure -S".
22623 # Package name : $package
22624 # Source directory : $src
22625 # Configuration time: $cf_time
22626 # Configured by : $cf_by
22627 # Target system : $myuname
22630 : Add in command line options if available
22631 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
22633 $spitshell <<EOT >>config.sh
22642 Revision='$Revision'
22650 alignbytes='$alignbytes'
22651 ansi2knr='$ansi2knr'
22652 aphostname='$aphostname'
22653 api_revision='$api_revision'
22654 api_subversion='$api_subversion'
22655 api_version='$api_version'
22656 api_versionstring='$api_versionstring'
22659 archlibexp='$archlibexp'
22660 archname64='$archname64'
22661 archname='$archname'
22662 archobjs='$archobjs'
22663 asctime_r_proto='$asctime_r_proto'
22672 byteorder='$byteorder'
22674 castflags='$castflags'
22677 cccdlflags='$cccdlflags'
22678 ccdlflags='$ccdlflags'
22680 ccflags_uselargefiles='$ccflags_uselargefiles'
22682 ccsymbols='$ccsymbols'
22683 ccversion='$ccversion'
22685 cf_email='$cf_email'
22687 charbits='$charbits'
22688 charsize='$charsize'
22692 clocktype='$clocktype'
22694 compress='$compress'
22695 contains='$contains'
22699 cpp_stuff='$cpp_stuff'
22700 cppccsymbols='$cppccsymbols'
22701 cppflags='$cppflags'
22703 cppminus='$cppminus'
22705 cppstdin='$cppstdin'
22706 cppsymbols='$cppsymbols'
22707 crypt_r_proto='$crypt_r_proto'
22708 cryptlib='$cryptlib'
22710 ctermid_r_proto='$ctermid_r_proto'
22711 ctime_r_proto='$ctime_r_proto'
22712 d_Gconvert='$d_Gconvert'
22713 d_PRIEUldbl='$d_PRIEUldbl'
22714 d_PRIFUldbl='$d_PRIFUldbl'
22715 d_PRIGUldbl='$d_PRIGUldbl'
22716 d_PRIXU64='$d_PRIXU64'
22717 d_PRId64='$d_PRId64'
22718 d_PRIeldbl='$d_PRIeldbl'
22719 d_PRIfldbl='$d_PRIfldbl'
22720 d_PRIgldbl='$d_PRIgldbl'
22721 d_PRIi64='$d_PRIi64'
22722 d_PRIo64='$d_PRIo64'
22723 d_PRIu64='$d_PRIu64'
22724 d_PRIx64='$d_PRIx64'
22725 d_SCNfldbl='$d_SCNfldbl'
22726 d__fwalk='$d__fwalk'
22727 d_access='$d_access'
22728 d_accessx='$d_accessx'
22731 d_archlib='$d_archlib'
22732 d_asctime64='$d_asctime64'
22733 d_asctime_r='$d_asctime_r'
22736 d_attribute_deprecated='$d_attribute_deprecated'
22737 d_attribute_format='$d_attribute_format'
22738 d_attribute_malloc='$d_attribute_malloc'
22739 d_attribute_nonnull='$d_attribute_nonnull'
22740 d_attribute_noreturn='$d_attribute_noreturn'
22741 d_attribute_pure='$d_attribute_pure'
22742 d_attribute_unused='$d_attribute_unused'
22743 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
22747 d_bsdgetpgrp='$d_bsdgetpgrp'
22748 d_bsdsetpgrp='$d_bsdsetpgrp'
22749 d_builtin_choose_expr='$d_builtin_choose_expr'
22750 d_builtin_expect='$d_builtin_expect'
22752 d_c99_variadic_macros='$d_c99_variadic_macros'
22753 d_casti32='$d_casti32'
22754 d_castneg='$d_castneg'
22755 d_charvspr='$d_charvspr'
22757 d_chroot='$d_chroot'
22758 d_chsize='$d_chsize'
22760 d_clearenv='$d_clearenv'
22761 d_closedir='$d_closedir'
22762 d_cmsghdr_s='$d_cmsghdr_s'
22764 d_copysignl='$d_copysignl'
22765 d_cplusplus='$d_cplusplus'
22767 d_crypt_r='$d_crypt_r'
22769 d_ctermid='$d_ctermid'
22770 d_ctermid_r='$d_ctermid_r'
22771 d_ctime64='$d_ctime64'
22772 d_ctime_r='$d_ctime_r'
22773 d_cuserid='$d_cuserid'
22774 d_dbl_dig='$d_dbl_dig'
22775 d_dbminitproto='$d_dbminitproto'
22776 d_difftime64='$d_difftime64'
22777 d_difftime='$d_difftime'
22778 d_dir_dd_fd='$d_dir_dd_fd'
22780 d_dirnamlen='$d_dirnamlen'
22781 d_dlerror='$d_dlerror'
22782 d_dlopen='$d_dlopen'
22783 d_dlsymun='$d_dlsymun'
22784 d_dosuid='$d_dosuid'
22785 d_drand48_r='$d_drand48_r'
22786 d_drand48proto='$d_drand48proto'
22788 d_eaccess='$d_eaccess'
22789 d_endgrent='$d_endgrent'
22790 d_endgrent_r='$d_endgrent_r'
22791 d_endhent='$d_endhent'
22792 d_endhostent_r='$d_endhostent_r'
22793 d_endnent='$d_endnent'
22794 d_endnetent_r='$d_endnetent_r'
22795 d_endpent='$d_endpent'
22796 d_endprotoent_r='$d_endprotoent_r'
22797 d_endpwent='$d_endpwent'
22798 d_endpwent_r='$d_endpwent_r'
22799 d_endsent='$d_endsent'
22800 d_endservent_r='$d_endservent_r'
22801 d_eofnblk='$d_eofnblk'
22802 d_eunice='$d_eunice'
22803 d_faststdio='$d_faststdio'
22804 d_fchdir='$d_fchdir'
22805 d_fchmod='$d_fchmod'
22806 d_fchown='$d_fchown'
22808 d_fcntl_can_lock='$d_fcntl_can_lock'
22809 d_fd_macros='$d_fd_macros'
22810 d_fd_set='$d_fd_set'
22811 d_fds_bits='$d_fds_bits'
22812 d_fgetpos='$d_fgetpos'
22813 d_finite='$d_finite'
22814 d_finitel='$d_finitel'
22815 d_flexfnam='$d_flexfnam'
22817 d_flockproto='$d_flockproto'
22819 d_fp_class='$d_fp_class'
22820 d_fpathconf='$d_fpathconf'
22821 d_fpclass='$d_fpclass'
22822 d_fpclassify='$d_fpclassify'
22823 d_fpclassl='$d_fpclassl'
22824 d_fpos64_t='$d_fpos64_t'
22825 d_frexpl='$d_frexpl'
22826 d_fs_data_s='$d_fs_data_s'
22827 d_fseeko='$d_fseeko'
22828 d_fsetpos='$d_fsetpos'
22829 d_fstatfs='$d_fstatfs'
22830 d_fstatvfs='$d_fstatvfs'
22832 d_ftello='$d_ftello'
22834 d_futimes='$d_futimes'
22835 d_gdbm_ndbm_h_uses_prototypes='$d_gdbm_ndbm_h_uses_prototypes'
22836 d_gdbmndbm_h_uses_prototypes='$d_gdbmndbm_h_uses_prototypes'
22837 d_getaddrinfo='$d_getaddrinfo'
22838 d_getcwd='$d_getcwd'
22839 d_getespwnam='$d_getespwnam'
22840 d_getfsstat='$d_getfsstat'
22841 d_getgrent='$d_getgrent'
22842 d_getgrent_r='$d_getgrent_r'
22843 d_getgrgid_r='$d_getgrgid_r'
22844 d_getgrnam_r='$d_getgrnam_r'
22845 d_getgrps='$d_getgrps'
22846 d_gethbyaddr='$d_gethbyaddr'
22847 d_gethbyname='$d_gethbyname'
22848 d_gethent='$d_gethent'
22849 d_gethname='$d_gethname'
22850 d_gethostbyaddr_r='$d_gethostbyaddr_r'
22851 d_gethostbyname_r='$d_gethostbyname_r'
22852 d_gethostent_r='$d_gethostent_r'
22853 d_gethostprotos='$d_gethostprotos'
22854 d_getitimer='$d_getitimer'
22855 d_getlogin='$d_getlogin'
22856 d_getlogin_r='$d_getlogin_r'
22857 d_getmnt='$d_getmnt'
22858 d_getmntent='$d_getmntent'
22859 d_getnameinfo='$d_getnameinfo'
22860 d_getnbyaddr='$d_getnbyaddr'
22861 d_getnbyname='$d_getnbyname'
22862 d_getnent='$d_getnent'
22863 d_getnetbyaddr_r='$d_getnetbyaddr_r'
22864 d_getnetbyname_r='$d_getnetbyname_r'
22865 d_getnetent_r='$d_getnetent_r'
22866 d_getnetprotos='$d_getnetprotos'
22867 d_getpagsz='$d_getpagsz'
22868 d_getpbyname='$d_getpbyname'
22869 d_getpbynumber='$d_getpbynumber'
22870 d_getpent='$d_getpent'
22871 d_getpgid='$d_getpgid'
22872 d_getpgrp2='$d_getpgrp2'
22873 d_getpgrp='$d_getpgrp'
22874 d_getppid='$d_getppid'
22875 d_getprior='$d_getprior'
22876 d_getprotobyname_r='$d_getprotobyname_r'
22877 d_getprotobynumber_r='$d_getprotobynumber_r'
22878 d_getprotoent_r='$d_getprotoent_r'
22879 d_getprotoprotos='$d_getprotoprotos'
22880 d_getprpwnam='$d_getprpwnam'
22881 d_getpwent='$d_getpwent'
22882 d_getpwent_r='$d_getpwent_r'
22883 d_getpwnam_r='$d_getpwnam_r'
22884 d_getpwuid_r='$d_getpwuid_r'
22885 d_getsbyname='$d_getsbyname'
22886 d_getsbyport='$d_getsbyport'
22887 d_getsent='$d_getsent'
22888 d_getservbyname_r='$d_getservbyname_r'
22889 d_getservbyport_r='$d_getservbyport_r'
22890 d_getservent_r='$d_getservent_r'
22891 d_getservprotos='$d_getservprotos'
22892 d_getspnam='$d_getspnam'
22893 d_getspnam_r='$d_getspnam_r'
22894 d_gettimeod='$d_gettimeod'
22895 d_gmtime64='$d_gmtime64'
22896 d_gmtime_r='$d_gmtime_r'
22897 d_gnulibc='$d_gnulibc'
22898 d_grpasswd='$d_grpasswd'
22899 d_hasmntopt='$d_hasmntopt'
22901 d_ilogbl='$d_ilogbl'
22902 d_inc_version_list='$d_inc_version_list'
22904 d_inetaton='$d_inetaton'
22905 d_inetntop='$d_inetntop'
22906 d_inetpton='$d_inetpton'
22907 d_int64_t='$d_int64_t'
22908 d_isascii='$d_isascii'
22909 d_isfinite='$d_isfinite'
22912 d_isnanl='$d_isnanl'
22913 d_killpg='$d_killpg'
22914 d_lchown='$d_lchown'
22915 d_ldbl_dig='$d_ldbl_dig'
22916 d_libm_lib_version='$d_libm_lib_version'
22918 d_localtime64='$d_localtime64'
22919 d_localtime_r='$d_localtime_r'
22920 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
22921 d_locconv='$d_locconv'
22923 d_longdbl='$d_longdbl'
22924 d_longlong='$d_longlong'
22925 d_lseekproto='$d_lseekproto'
22927 d_madvise='$d_madvise'
22928 d_malloc_good_size='$d_malloc_good_size'
22929 d_malloc_size='$d_malloc_size'
22931 d_mbstowcs='$d_mbstowcs'
22932 d_mbtowc='$d_mbtowc'
22933 d_memchr='$d_memchr'
22934 d_memcmp='$d_memcmp'
22935 d_memcpy='$d_memcpy'
22936 d_memmove='$d_memmove'
22937 d_memset='$d_memset'
22939 d_mkdtemp='$d_mkdtemp'
22940 d_mkfifo='$d_mkfifo'
22941 d_mkstemp='$d_mkstemp'
22942 d_mkstemps='$d_mkstemps'
22943 d_mktime64='$d_mktime64'
22944 d_mktime='$d_mktime'
22947 d_modfl_pow32_bug='$d_modfl_pow32_bug'
22948 d_modflproto='$d_modflproto'
22949 d_mprotect='$d_mprotect'
22951 d_msg_ctrunc='$d_msg_ctrunc'
22952 d_msg_dontroute='$d_msg_dontroute'
22953 d_msg_oob='$d_msg_oob'
22954 d_msg_peek='$d_msg_peek'
22955 d_msg_proxy='$d_msg_proxy'
22956 d_msgctl='$d_msgctl'
22957 d_msgget='$d_msgget'
22958 d_msghdr_s='$d_msghdr_s'
22959 d_msgrcv='$d_msgrcv'
22960 d_msgsnd='$d_msgsnd'
22962 d_munmap='$d_munmap'
22963 d_mymalloc='$d_mymalloc'
22965 d_ndbm_h_uses_prototypes='$d_ndbm_h_uses_prototypes'
22967 d_nl_langinfo='$d_nl_langinfo'
22968 d_nv_preserves_uv='$d_nv_preserves_uv'
22969 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
22970 d_off64_t='$d_off64_t'
22971 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
22972 d_oldpthreads='$d_oldpthreads'
22973 d_oldsock='$d_oldsock'
22975 d_pathconf='$d_pathconf'
22977 d_perl_otherlibdirs='$d_perl_otherlibdirs'
22978 d_phostname='$d_phostname'
22981 d_portable='$d_portable'
22983 d_prctl_set_name='$d_prctl_set_name'
22984 d_printf_format_null='$d_printf_format_null'
22985 d_procselfexe='$d_procselfexe'
22986 d_pseudofork='$d_pseudofork'
22987 d_pthread_atfork='$d_pthread_atfork'
22988 d_pthread_attr_setscope='$d_pthread_attr_setscope'
22989 d_pthread_yield='$d_pthread_yield'
22991 d_pwchange='$d_pwchange'
22992 d_pwclass='$d_pwclass'
22993 d_pwcomment='$d_pwcomment'
22994 d_pwexpire='$d_pwexpire'
22995 d_pwgecos='$d_pwgecos'
22996 d_pwpasswd='$d_pwpasswd'
22997 d_pwquota='$d_pwquota'
23000 d_random_r='$d_random_r'
23001 d_readdir64_r='$d_readdir64_r'
23002 d_readdir='$d_readdir'
23003 d_readdir_r='$d_readdir_r'
23004 d_readlink='$d_readlink'
23006 d_recvmsg='$d_recvmsg'
23007 d_rename='$d_rename'
23008 d_rewinddir='$d_rewinddir'
23010 d_safebcpy='$d_safebcpy'
23011 d_safemcpy='$d_safemcpy'
23012 d_sanemcmp='$d_sanemcmp'
23013 d_sbrkproto='$d_sbrkproto'
23014 d_scalbnl='$d_scalbnl'
23015 d_sched_yield='$d_sched_yield'
23016 d_scm_rights='$d_scm_rights'
23017 d_seekdir='$d_seekdir'
23018 d_select='$d_select'
23020 d_semctl='$d_semctl'
23021 d_semctl_semid_ds='$d_semctl_semid_ds'
23022 d_semctl_semun='$d_semctl_semun'
23023 d_semget='$d_semget'
23025 d_sendmsg='$d_sendmsg'
23026 d_setegid='$d_setegid'
23027 d_seteuid='$d_seteuid'
23028 d_setgrent='$d_setgrent'
23029 d_setgrent_r='$d_setgrent_r'
23030 d_setgrps='$d_setgrps'
23031 d_sethent='$d_sethent'
23032 d_sethostent_r='$d_sethostent_r'
23033 d_setitimer='$d_setitimer'
23034 d_setlinebuf='$d_setlinebuf'
23035 d_setlocale='$d_setlocale'
23036 d_setlocale_r='$d_setlocale_r'
23037 d_setnent='$d_setnent'
23038 d_setnetent_r='$d_setnetent_r'
23039 d_setpent='$d_setpent'
23040 d_setpgid='$d_setpgid'
23041 d_setpgrp2='$d_setpgrp2'
23042 d_setpgrp='$d_setpgrp'
23043 d_setprior='$d_setprior'
23044 d_setproctitle='$d_setproctitle'
23045 d_setprotoent_r='$d_setprotoent_r'
23046 d_setpwent='$d_setpwent'
23047 d_setpwent_r='$d_setpwent_r'
23048 d_setregid='$d_setregid'
23049 d_setresgid='$d_setresgid'
23050 d_setresuid='$d_setresuid'
23051 d_setreuid='$d_setreuid'
23052 d_setrgid='$d_setrgid'
23053 d_setruid='$d_setruid'
23054 d_setsent='$d_setsent'
23055 d_setservent_r='$d_setservent_r'
23056 d_setsid='$d_setsid'
23057 d_setvbuf='$d_setvbuf'
23061 d_shmatprototype='$d_shmatprototype'
23062 d_shmctl='$d_shmctl'
23064 d_shmget='$d_shmget'
23065 d_sigaction='$d_sigaction'
23066 d_signbit='$d_signbit'
23067 d_sigprocmask='$d_sigprocmask'
23068 d_sigsetjmp='$d_sigsetjmp'
23069 d_sin6_scope_id='$d_sin6_scope_id'
23070 d_sitearch='$d_sitearch'
23071 d_snprintf='$d_snprintf'
23072 d_sockaddr_sa_len='$d_sockaddr_sa_len'
23073 d_sockatmark='$d_sockatmark'
23074 d_sockatmarkproto='$d_sockatmarkproto'
23075 d_socket='$d_socket'
23076 d_socklen_t='$d_socklen_t'
23077 d_sockpair='$d_sockpair'
23078 d_socks5_init='$d_socks5_init'
23079 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
23081 d_srand48_r='$d_srand48_r'
23082 d_srandom_r='$d_srandom_r'
23083 d_sresgproto='$d_sresgproto'
23084 d_sresuproto='$d_sresuproto'
23085 d_statblks='$d_statblks'
23086 d_statfs_f_flags='$d_statfs_f_flags'
23087 d_statfs_s='$d_statfs_s'
23088 d_static_inline='$d_static_inline'
23089 d_statvfs='$d_statvfs'
23090 d_stdio_cnt_lval='$d_stdio_cnt_lval'
23091 d_stdio_ptr_lval='$d_stdio_ptr_lval'
23092 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
23093 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
23094 d_stdio_stream_array='$d_stdio_stream_array'
23095 d_stdiobase='$d_stdiobase'
23096 d_stdstdio='$d_stdstdio'
23097 d_strchr='$d_strchr'
23098 d_strcoll='$d_strcoll'
23099 d_strctcpy='$d_strctcpy'
23100 d_strerrm='$d_strerrm'
23101 d_strerror='$d_strerror'
23102 d_strerror_r='$d_strerror_r'
23103 d_strftime='$d_strftime'
23104 d_strlcat='$d_strlcat'
23105 d_strlcpy='$d_strlcpy'
23106 d_strtod='$d_strtod'
23107 d_strtol='$d_strtol'
23108 d_strtold='$d_strtold'
23109 d_strtoll='$d_strtoll'
23110 d_strtoq='$d_strtoq'
23111 d_strtoul='$d_strtoul'
23112 d_strtoull='$d_strtoull'
23113 d_strtouq='$d_strtouq'
23114 d_strxfrm='$d_strxfrm'
23115 d_suidsafe='$d_suidsafe'
23116 d_symlink='$d_symlink'
23117 d_syscall='$d_syscall'
23118 d_syscallproto='$d_syscallproto'
23119 d_sysconf='$d_sysconf'
23120 d_sysernlst='$d_sysernlst'
23121 d_syserrlst='$d_syserrlst'
23122 d_system='$d_system'
23123 d_tcgetpgrp='$d_tcgetpgrp'
23124 d_tcsetpgrp='$d_tcsetpgrp'
23125 d_telldir='$d_telldir'
23126 d_telldirproto='$d_telldirproto'
23128 d_timegm='$d_timegm'
23130 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
23131 d_tm_tm_zone='$d_tm_tm_zone'
23132 d_tmpnam_r='$d_tmpnam_r'
23133 d_truncate='$d_truncate'
23134 d_ttyname_r='$d_ttyname_r'
23135 d_tzname='$d_tzname'
23136 d_u32align='$d_u32align'
23137 d_ualarm='$d_ualarm'
23140 d_union_semun='$d_union_semun'
23141 d_unordered='$d_unordered'
23142 d_unsetenv='$d_unsetenv'
23143 d_usleep='$d_usleep'
23144 d_usleepproto='$d_usleepproto'
23146 d_vendorarch='$d_vendorarch'
23147 d_vendorbin='$d_vendorbin'
23148 d_vendorlib='$d_vendorlib'
23149 d_vendorscript='$d_vendorscript'
23151 d_void_closedir='$d_void_closedir'
23152 d_voidsig='$d_voidsig'
23153 d_voidtty='$d_voidtty'
23154 d_volatile='$d_volatile'
23155 d_vprintf='$d_vprintf'
23156 d_vsnprintf='$d_vsnprintf'
23158 d_waitpid='$d_waitpid'
23159 d_wcstombs='$d_wcstombs'
23160 d_wctomb='$d_wctomb'
23161 d_writev='$d_writev'
23164 db_hashtype='$db_hashtype'
23165 db_prefixtype='$db_prefixtype'
23166 db_version_major='$db_version_major'
23167 db_version_minor='$db_version_minor'
23168 db_version_patch='$db_version_patch'
23169 defvoidused='$defvoidused'
23170 direntrytype='$direntrytype'
23173 doublesize='$doublesize'
23175 drand48_r_proto='$drand48_r_proto'
23177 dynamic_ext='$dynamic_ext'
23183 endgrent_r_proto='$endgrent_r_proto'
23184 endhostent_r_proto='$endhostent_r_proto'
23185 endnetent_r_proto='$endnetent_r_proto'
23186 endprotoent_r_proto='$endprotoent_r_proto'
23187 endpwent_r_proto='$endpwent_r_proto'
23188 endservent_r_proto='$endservent_r_proto'
23189 eunicefix='$eunicefix'
23192 extensions='$extensions'
23193 extern_C='$extern_C'
23195 fflushNULL='$fflushNULL'
23196 fflushall='$fflushall'
23198 firstmakefile='$firstmakefile'
23200 fpossize='$fpossize'
23201 fpostype='$fpostype'
23202 freetype='$freetype'
23205 full_csh='$full_csh'
23206 full_sed='$full_sed'
23207 gccansipedantic='$gccansipedantic'
23208 gccosandvers='$gccosandvers'
23209 gccversion='$gccversion'
23210 getgrent_r_proto='$getgrent_r_proto'
23211 getgrgid_r_proto='$getgrgid_r_proto'
23212 getgrnam_r_proto='$getgrnam_r_proto'
23213 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
23214 gethostbyname_r_proto='$gethostbyname_r_proto'
23215 gethostent_r_proto='$gethostent_r_proto'
23216 getlogin_r_proto='$getlogin_r_proto'
23217 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
23218 getnetbyname_r_proto='$getnetbyname_r_proto'
23219 getnetent_r_proto='$getnetent_r_proto'
23220 getprotobyname_r_proto='$getprotobyname_r_proto'
23221 getprotobynumber_r_proto='$getprotobynumber_r_proto'
23222 getprotoent_r_proto='$getprotoent_r_proto'
23223 getpwent_r_proto='$getpwent_r_proto'
23224 getpwnam_r_proto='$getpwnam_r_proto'
23225 getpwuid_r_proto='$getpwuid_r_proto'
23226 getservbyname_r_proto='$getservbyname_r_proto'
23227 getservbyport_r_proto='$getservbyport_r_proto'
23228 getservent_r_proto='$getservent_r_proto'
23229 getspnam_r_proto='$getspnam_r_proto'
23230 gidformat='$gidformat'
23236 gmtime_r_proto='$gmtime_r_proto'
23237 gnulibc_version='$gnulibc_version'
23239 groupcat='$groupcat'
23240 groupstype='$groupstype'
23243 h_sysfile='$h_sysfile'
23246 html1dir='$html1dir'
23247 html1direxp='$html1direxp'
23248 html3dir='$html3dir'
23249 html3direxp='$html3direxp'
23258 i_arpainet='$i_arpainet'
23259 i_assert='$i_assert'
23260 i_bsdioctl='$i_bsdioctl'
23264 i_dirent='$i_dirent'
23270 i_fp_class='$i_fp_class'
23272 i_gdbm_ndbm='$i_gdbm_ndbm'
23273 i_gdbmndbm='$i_gdbmndbm'
23275 i_ieeefp='$i_ieeefp'
23276 i_inttypes='$i_inttypes'
23277 i_langinfo='$i_langinfo'
23278 i_libutil='$i_libutil'
23279 i_limits='$i_limits'
23280 i_locale='$i_locale'
23281 i_machcthr='$i_machcthr'
23282 i_malloc='$i_malloc'
23283 i_mallocmalloc='$i_mallocmalloc'
23285 i_memory='$i_memory'
23286 i_mntent='$i_mntent'
23289 i_neterrno='$i_neterrno'
23290 i_netinettcp='$i_netinettcp'
23294 i_pthread='$i_pthread'
23296 i_rpcsvcdbm='$i_rpcsvcdbm'
23299 i_shadow='$i_shadow'
23301 i_stdarg='$i_stdarg'
23302 i_stdbool='$i_stdbool'
23303 i_stddef='$i_stddef'
23304 i_stdlib='$i_stdlib'
23305 i_string='$i_string'
23306 i_sunmath='$i_sunmath'
23307 i_sysaccess='$i_sysaccess'
23308 i_sysdir='$i_sysdir'
23309 i_sysfile='$i_sysfile'
23310 i_sysfilio='$i_sysfilio'
23312 i_sysioctl='$i_sysioctl'
23313 i_syslog='$i_syslog'
23314 i_sysmman='$i_sysmman'
23315 i_sysmode='$i_sysmode'
23316 i_sysmount='$i_sysmount'
23317 i_sysndir='$i_sysndir'
23318 i_sysparam='$i_sysparam'
23319 i_syspoll='$i_syspoll'
23320 i_sysresrc='$i_sysresrc'
23321 i_syssecrt='$i_syssecrt'
23322 i_sysselct='$i_sysselct'
23323 i_syssockio='$i_syssockio'
23324 i_sysstat='$i_sysstat'
23325 i_sysstatfs='$i_sysstatfs'
23326 i_sysstatvfs='$i_sysstatvfs'
23327 i_systime='$i_systime'
23328 i_systimek='$i_systimek'
23329 i_systimes='$i_systimes'
23330 i_systypes='$i_systypes'
23331 i_sysuio='$i_sysuio'
23333 i_sysutsname='$i_sysutsname'
23334 i_sysvfs='$i_sysvfs'
23335 i_syswait='$i_syswait'
23336 i_termio='$i_termio'
23337 i_termios='$i_termios'
23339 i_unistd='$i_unistd'
23342 i_values='$i_values'
23343 i_varargs='$i_varargs'
23344 i_varhdr='$i_varhdr'
23346 ignore_versioned_solibs='$ignore_versioned_solibs'
23347 inc_version_list='$inc_version_list'
23348 inc_version_list_init='$inc_version_list_init'
23351 initialinstalllocation='$initialinstalllocation'
23352 installarchlib='$installarchlib'
23353 installbin='$installbin'
23354 installhtml1dir='$installhtml1dir'
23355 installhtml3dir='$installhtml3dir'
23356 installman1dir='$installman1dir'
23357 installman3dir='$installman3dir'
23358 installprefix='$installprefix'
23359 installprefixexp='$installprefixexp'
23360 installprivlib='$installprivlib'
23361 installscript='$installscript'
23362 installsitearch='$installsitearch'
23363 installsitebin='$installsitebin'
23364 installsitehtml1dir='$installsitehtml1dir'
23365 installsitehtml3dir='$installsitehtml3dir'
23366 installsitelib='$installsitelib'
23367 installsiteman1dir='$installsiteman1dir'
23368 installsiteman3dir='$installsiteman3dir'
23369 installsitescript='$installsitescript'
23370 installstyle='$installstyle'
23371 installusrbinperl='$installusrbinperl'
23372 installvendorarch='$installvendorarch'
23373 installvendorbin='$installvendorbin'
23374 installvendorhtml1dir='$installvendorhtml1dir'
23375 installvendorhtml3dir='$installvendorhtml3dir'
23376 installvendorlib='$installvendorlib'
23377 installvendorman1dir='$installvendorman1dir'
23378 installvendorman3dir='$installvendorman3dir'
23379 installvendorscript='$installvendorscript'
23381 issymlink='$issymlink'
23382 ivdformat='$ivdformat'
23385 known_extensions='$known_extensions'
23388 lddlflags='$lddlflags'
23390 ldflags_uselargefiles='$ldflags_uselargefiles'
23391 ldlibpthname='$ldlibpthname'
23398 libsdirs='$libsdirs'
23399 libsfiles='$libsfiles'
23400 libsfound='$libsfound'
23401 libspath='$libspath'
23402 libswanted='$libswanted'
23403 libswanted_uselargefiles='$libswanted_uselargefiles'
23409 localtime_r_proto='$localtime_r_proto'
23410 locincpth='$locincpth'
23411 loclibpth='$loclibpth'
23412 longdblsize='$longdblsize'
23413 longlongsize='$longlongsize'
23414 longsize='$longsize'
23418 lseeksize='$lseeksize'
23419 lseektype='$lseektype'
23422 madlyobj='$madlyobj'
23423 madlysrc='$madlysrc'
23427 make_set_make='$make_set_make'
23428 mallocobj='$mallocobj'
23429 mallocsrc='$mallocsrc'
23430 malloctype='$malloctype'
23432 man1direxp='$man1direxp'
23435 man3direxp='$man3direxp'
23437 mips_type='$mips_type'
23438 mistrustnm='$mistrustnm'
23440 mmaptype='$mmaptype'
23441 modetype='$modetype'
23443 multiarch='$multiarch'
23445 myarchname='$myarchname'
23446 mydomain='$mydomain'
23447 myhostname='$myhostname'
23450 need_va_copy='$need_va_copy'
23451 netdb_hlen_type='$netdb_hlen_type'
23452 netdb_host_type='$netdb_host_type'
23453 netdb_name_type='$netdb_name_type'
23454 netdb_net_type='$netdb_net_type'
23457 nm_so_opt='$nm_so_opt'
23458 nonxs_ext='$nonxs_ext'
23460 nvEUformat='$nvEUformat'
23461 nvFUformat='$nvFUformat'
23462 nvGUformat='$nvGUformat'
23463 nv_overflows_integers_at='$nv_overflows_integers_at'
23464 nv_preserves_uv_bits='$nv_preserves_uv_bits'
23465 nveformat='$nveformat'
23466 nvfformat='$nvfformat'
23467 nvgformat='$nvgformat'
23470 o_nonblock='$o_nonblock'
23472 old_pthread_create_joinable='$old_pthread_create_joinable'
23473 optimize='$optimize'
23474 orderlib='$orderlib'
23477 otherlibdirs='$otherlibdirs'
23481 patchlevel='$patchlevel'
23482 path_sep='$path_sep'
23485 perl_patchlevel='$perl_patchlevel'
23486 perl_static_inline='$perl_static_inline'
23487 perladmin='$perladmin'
23488 perllibs='$perllibs'
23489 perlpath='$perlpath'
23491 phostname='$phostname'
23497 prefixexp='$prefixexp'
23499 privlibexp='$privlibexp'
23500 procselfexe='$procselfexe'
23501 prototype='$prototype'
23503 quadkind='$quadkind'
23504 quadtype='$quadtype'
23505 randbits='$randbits'
23506 randfunc='$randfunc'
23507 random_r_proto='$random_r_proto'
23508 randseedtype='$randseedtype'
23510 rd_nodata='$rd_nodata'
23511 readdir64_r_proto='$readdir64_r_proto'
23512 readdir_r_proto='$readdir_r_proto'
23513 revision='$revision'
23519 sGMTIME_max='$sGMTIME_max'
23520 sGMTIME_min='$sGMTIME_min'
23521 sLOCALTIME_max='$sLOCALTIME_max'
23522 sLOCALTIME_min='$sLOCALTIME_min'
23523 sPRIEUldbl='$sPRIEUldbl'
23524 sPRIFUldbl='$sPRIFUldbl'
23525 sPRIGUldbl='$sPRIGUldbl'
23526 sPRIXU64='$sPRIXU64'
23528 sPRIeldbl='$sPRIeldbl'
23529 sPRIfldbl='$sPRIfldbl'
23530 sPRIgldbl='$sPRIgldbl'
23535 sSCNfldbl='$sSCNfldbl'
23536 sched_yield='$sched_yield'
23537 scriptdir='$scriptdir'
23538 scriptdirexp='$scriptdirexp'
23540 seedfunc='$seedfunc'
23541 selectminbits='$selectminbits'
23542 selecttype='$selecttype'
23543 sendmail='$sendmail'
23544 setgrent_r_proto='$setgrent_r_proto'
23545 sethostent_r_proto='$sethostent_r_proto'
23546 setlocale_r_proto='$setlocale_r_proto'
23547 setnetent_r_proto='$setnetent_r_proto'
23548 setprotoent_r_proto='$setprotoent_r_proto'
23549 setpwent_r_proto='$setpwent_r_proto'
23550 setservent_r_proto='$setservent_r_proto'
23553 sharpbang='$sharpbang'
23554 shmattype='$shmattype'
23555 shortsize='$shortsize'
23558 sig_count='$sig_count'
23559 sig_name='$sig_name'
23560 sig_name_init='$sig_name_init'
23562 sig_num_init='$sig_num_init'
23563 sig_size='$sig_size'
23564 signal_t='$signal_t'
23565 sitearch='$sitearch'
23566 sitearchexp='$sitearchexp'
23568 sitebinexp='$sitebinexp'
23569 sitehtml1dir='$sitehtml1dir'
23570 sitehtml1direxp='$sitehtml1direxp'
23571 sitehtml3dir='$sitehtml3dir'
23572 sitehtml3direxp='$sitehtml3direxp'
23574 sitelib_stem='$sitelib_stem'
23575 sitelibexp='$sitelibexp'
23576 siteman1dir='$siteman1dir'
23577 siteman1direxp='$siteman1direxp'
23578 siteman3dir='$siteman3dir'
23579 siteman3direxp='$siteman3direxp'
23580 siteprefix='$siteprefix'
23581 siteprefixexp='$siteprefixexp'
23582 sitescript='$sitescript'
23583 sitescriptexp='$sitescriptexp'
23584 sizesize='$sizesize'
23585 sizetype='$sizetype'
23589 sockethdr='$sockethdr'
23590 socketlib='$socketlib'
23591 socksizetype='$socksizetype'
23593 spackage='$spackage'
23594 spitshell='$spitshell'
23595 srand48_r_proto='$srand48_r_proto'
23596 srandom_r_proto='$srandom_r_proto'
23598 ssizetype='$ssizetype'
23599 st_ino_sign='$st_ino_sign'
23600 st_ino_size='$st_ino_size'
23601 startperl='$startperl'
23603 static_ext='$static_ext'
23605 stdio_base='$stdio_base'
23606 stdio_bufsiz='$stdio_bufsiz'
23607 stdio_cnt='$stdio_cnt'
23608 stdio_filbuf='$stdio_filbuf'
23609 stdio_ptr='$stdio_ptr'
23610 stdio_stream_array='$stdio_stream_array'
23611 strerror_r_proto='$strerror_r_proto'
23614 subversion='$subversion'
23618 targetarch='$targetarch'
23622 timeincl='$timeincl'
23623 timetype='$timetype'
23624 tmpnam_r_proto='$tmpnam_r_proto'
23630 ttyname_r_proto='$ttyname_r_proto'
23639 uidformat='$uidformat'
23645 uquadtype='$uquadtype'
23646 use5005threads='$use5005threads'
23647 use64bitall='$use64bitall'
23648 use64bitint='$use64bitint'
23649 usecrosscompile='$usecrosscompile'
23650 usedevel='$usedevel'
23652 usedtrace='$usedtrace'
23653 usefaststdio='$usefaststdio'
23654 useithreads='$useithreads'
23655 usekernprocpathname='$usekernprocpathname'
23656 uselargefiles='$uselargefiles'
23657 uselongdouble='$uselongdouble'
23658 usemallocwrap='$usemallocwrap'
23659 usemorebits='$usemorebits'
23660 usemultiplicity='$usemultiplicity'
23661 usemymalloc='$usemymalloc'
23663 usensgetexecutablepath='$usensgetexecutablepath'
23664 useopcode='$useopcode'
23665 useperlio='$useperlio'
23666 useposix='$useposix'
23667 usereentrant='$usereentrant'
23668 userelocatableinc='$userelocatableinc'
23670 useshrplib='$useshrplib'
23671 usesitecustomize='$usesitecustomize'
23672 usesocks='$usesocks'
23673 usethreads='$usethreads'
23674 usevendorprefix='$usevendorprefix'
23675 usevfork='$usevfork'
23678 uvXUformat='$uvXUformat'
23679 uvoformat='$uvoformat'
23682 uvuformat='$uvuformat'
23683 uvxformat='$uvxformat'
23685 vendorarch='$vendorarch'
23686 vendorarchexp='$vendorarchexp'
23687 vendorbin='$vendorbin'
23688 vendorbinexp='$vendorbinexp'
23689 vendorhtml1dir='$vendorhtml1dir'
23690 vendorhtml1direxp='$vendorhtml1direxp'
23691 vendorhtml3dir='$vendorhtml3dir'
23692 vendorhtml3direxp='$vendorhtml3direxp'
23693 vendorlib='$vendorlib'
23694 vendorlib_stem='$vendorlib_stem'
23695 vendorlibexp='$vendorlibexp'
23696 vendorman1dir='$vendorman1dir'
23697 vendorman1direxp='$vendorman1direxp'
23698 vendorman3dir='$vendorman3dir'
23699 vendorman3direxp='$vendorman3direxp'
23700 vendorprefix='$vendorprefix'
23701 vendorprefixexp='$vendorprefixexp'
23702 vendorscript='$vendorscript'
23703 vendorscriptexp='$vendorscriptexp'
23705 version_patchlevel_string='$version_patchlevel_string'
23706 versiononly='$versiononly'
23708 voidflags='$voidflags'
23711 yaccflags='$yaccflags'
23716 : add special variables
23717 $test -f $src/patchlevel.h && \
23718 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
23719 echo "PERL_PATCHLEVEL='$perl_patchlevel'" >>config.sh
23720 echo "PERL_CONFIG_SH=true" >>config.sh
23722 : propagate old symbols
23723 if $test -f UU/config.sh; then
23724 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
23725 $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \
23726 config.sh config.sh UU/oldconfig.sh |\
23727 $sort | $uniq -u >UU/oldsyms
23728 set X `$cat UU/oldsyms`
23734 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
23736 echo ": Variables propagated from previous config.sh file." >>config.sh
23737 for sym in `$cat UU/oldsyms`; do
23738 echo " Propagating $hint variable "'$'"$sym..."
23739 eval 'tmp="$'"${sym}"'"'
23741 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
23747 : Finish up by extracting the .SH files
23751 echo "Extraction done."
23761 If you'd like to make any changes to the config.sh file before I begin
23762 to configure things, do it as a shell escape now (e.g. !vi config.sh).
23765 rp="Press return or use a shell escape to edit config.sh:"
23770 *) : in case they cannot read
23771 sh 1>&4 -c "$ans";;
23776 : if this fails, just run all the .SH files by hand
23785 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
23792 Now you need to generate make dependencies by running "$make depend".
23793 You might prefer to run it in background: "$make depend > makedepend.out &"
23794 It can take a while, so you might not want to run it right now.
23799 rp="Run $make depend now?"
23803 $make depend && echo "Now you must run '$make'."
23806 echo "You must run '$make depend' then '$make'."
23809 elif test -f [Mm]akefile; then
23811 echo "Now you must run a $make."
23813 echo "Configure done."
23816 if $test -f Policy.sh; then
23819 If you compile $package on a different machine or from a different object
23820 directory, copy the Policy.sh file from this object directory to the
23821 new one before you run Configure -- this will help you with most of
23822 the policy defaults.
23826 if $test -f config.msg; then
23827 echo "Hmm. I also noted the following information while running:"
23829 $cat config.msg >&4
23832 $rm -f kit*isdone ark*isdone