3 # If these # comments don't work, trim them. Don't worry about any other
4 # shell scripts, Configure will trim # comments from them for you.
6 # (If you are trying to port this package to a machine without sh,
7 # I would suggest you have a look at the prototypical config_h.SH file
8 # and edit it to reflect your system. Some packages may include samples
9 # of config.h for certain machines, so you might look for one of those.)
11 # Yes, you may rip this off to use in other distribution packages. This
12 # script belongs to the public domain and cannot be copyrighted.
14 # Note: this Configure script was generated automatically. Rather than
15 # working with this copy of Configure, you may wish to get metaconfig.
16 # The dist package (which contains metaconfig) is available via SVN:
17 # svn co https://svn.code.sf.net/p/dist/code/trunk/dist
19 # Though this script was generated by metaconfig from metaunits, it is
20 # OK to send patches against Configure itself. It's up to the Configure
21 # pumpkin to backport the patch to the metaunits if it is accepted.
22 # For more information on patching Configure, see pod/perlhack.pod
24 # The metaunits are also available from the public git repository:
25 # http://perl5.git.perl.org/metaconfig.git/ or
26 # $ git clone git://perl5.git.perl.org/metaconfig.git metaconfig
28 # See Porting/pumpkin.pod for more information on metaconfig.
31 # Generated on Wed Jan 1 18:06:40 CET 2014 [metaconfig 3.5 PL0]
32 # (with additional metaconfig patches by perlbug@perl.org)
37 SCO csh still thinks true is false. Write to SCO today and tell them that next
38 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
40 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
41 we'd have to do is go in and swap the && and || tokens, wherever they are.)
43 [End of diatribe. We now return you to your regularly scheduled programming...]
47 OOPS! You naughty creature! You didn't run Configure with sh!
48 I will attempt to remedy the situation by running sh for you...
52 true || exec sh $0 $argv:q
54 (exit $?0) || cat c2$$
55 (exit $?0) || exec sh $0 $argv:q
58 if test -f /dev/cputype -a -f /dev/drivers -a -f /dev/osversion; then
61 *** I'm sorry but this system looks like Plan 9 and Plan 9 doesn't do
62 *** Configure that well. (Plan 9 is close to UNIX but not close enough.)
63 *** Please read the README.plan9 for further instructions.
64 *** Cannot continue, aborting.
70 if test ! -c /dev/null ; then
73 *** I'm sorry, but /dev/null appears to be a file rather than a device.
74 *** Please consult your operating sytem's notes for making a device
76 *** Cannot continue, aborting.
82 : compute my invocation name
86 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
91 : Proper separator for the PATH environment variable
93 : On OS/2 this directory should exist if this is not floppy only system ":-]"
94 if test -d c:/. || ( uname -a | grep -i 'os\(/\|\)2' ) 2>&1 >/dev/null ; then
95 if test -n "$OS2_SHELL"; then
97 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
98 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
100 elif test -n "$DJGPP"; then
101 case "X${MACHTYPE:-nonesuchmach}" in
108 : Proper PATH setting
109 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
110 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
111 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
112 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
113 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
114 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /opt/ansic/bin /usr/ccs/bin"
115 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
116 paths="$paths /sbin /usr/sbin /usr/libexec"
117 paths="$paths /system/gnu_library/bin"
121 case "$p_$PATH$p_" in
123 *) test -d $p && PATH=$PATH$p_$p ;;
130 : shall we be using ksh?
136 if (PATH=.; alias -x) >/dev/null 2>&1; then
139 if test -f /hp-ux -a -f /bin/ksh; then
140 needksh='to avoid sh bug in "here document" expansion'
142 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
143 if test X`/usr/bin/uname -v` = X4; then
144 avoidksh="to avoid AIX 4's /bin/sh"
148 if test -f /osf_boot -a -f /usr/sbin/setld; then
149 if test X`/usr/bin/uname -s` = XOSF1; then
150 avoidksh="to avoid Digital UNIX' ksh"
155 case "$inksh/$needksh" in
162 case "$inksh/$avoidksh" in
168 case "$inksh/$needksh-$avoidksh-" in
171 (I see you are using the Korn shell. Some ksh's blow up on $me,
172 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
179 echo "(Feeding myself to $newsh $reason.)"
181 Configure|*/Configure) exec $newsh $0 "$@";;
182 *) exec $newsh Configure "$@";;
186 test -x "${newsh}" || unset newsh
188 : if needed, set CDPATH to a harmless value that is not chatty
189 : avoid bash 2.02 problems with empty CDPATH.
193 *bash*) CDPATH='.' ;;
199 : Configure runs within the UU subdirectory
200 test -d UU || mkdir UU
335 useversionedarchname=''
341 initialinstalllocation=''
370 d_attribute_deprecated=''
371 d_attribute_format=''
372 d_attribute_malloc=''
373 d_attribute_nonnull=''
374 d_attribute_noreturn=''
376 d_attribute_unused=''
377 d_attribute_warn_unused_result=''
378 d_printf_format_null=''
381 d_builtin_choose_expr=''
384 d_c99_variadic_macros=''
431 endhostent_r_proto=''
437 endprotoent_r_proto=''
443 endservent_r_proto=''
496 gethostbyaddr_r_proto=''
498 gethostbyname_r_proto=''
500 gethostent_r_proto=''
513 getnetbyaddr_r_proto=''
515 getnetbyname_r_proto=''
529 d_getprotobyname_r=''
530 getprotobyname_r_proto=''
531 d_getprotobynumber_r=''
532 getprotobynumber_r_proto=''
534 getprotoent_r_proto=''
546 getservbyname_r_proto=''
548 getservbyport_r_proto=''
550 getservent_r_proto=''
577 d_libm_lib_version=''
581 d_localtime_r_needs_tzset=''
592 d_malloc_good_size=''
636 d_old_pthread_create_joinable=''
637 old_pthread_create_joinable=''
639 d_pthread_attr_setscope=''
678 sethostent_r_proto=''
695 setprotoent_r_proto=''
707 setservent_r_proto=''
729 d_ipv6_mreq_source=''
746 d_sprintf_returns_strlen=''
758 perl_static_inline=''
763 d_stdio_ptr_lval_nochange_cnt=''
764 d_stdio_ptr_lval_sets_cnt=''
909 d_gdbm_ndbm_h_uses_prototypes=''
910 d_gdbmndbm_h_uses_prototypes=''
912 d_ndbm_h_uses_prototypes=''
986 d_inc_version_list=''
988 inc_version_list_init=''
1007 ignore_versioned_solibs=''
1071 d_perl_otherlibdirs=''
1079 api_versionstring=''
1085 version_patchlevel_string=''
1089 d_nv_preserves_uv=''
1090 d_nv_zero_is_allbits_zero=''
1101 nv_overflows_integers_at=''
1102 nv_preserves_uv_bits=''
1174 installsitehtml1dir=''
1177 installsitehtml3dir=''
1184 installsiteman1dir=''
1187 installsiteman3dir=''
1192 installsitescript=''
1209 d_stdio_stream_array=''
1210 stdio_stream_array=''
1227 usekernprocpathname=''
1228 ccflags_uselargefiles=''
1229 ldflags_uselargefiles=''
1230 libswanted_uselargefiles=''
1239 usensgetexecutablepath=''
1252 installvendorarch=''
1259 installvendorhtml1dir=''
1261 vendorhtml1direxp=''
1262 installvendorhtml3dir=''
1264 vendorhtml3direxp=''
1270 installvendorman1dir=''
1273 installvendorman3dir=''
1280 installvendorscript=''
1291 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1294 : We must find out about Eunice early
1296 if test -f /etc/unixtovms; then
1297 eunicefix=/etc/unixtovms
1299 if test -f /etc/unixtovms.exe; then
1300 eunicefix=/etc/unixtovms.exe
1303 : Set executable suffix now -- needed before hints available
1304 if test -f "/libs/version.library"; then
1307 elif test -f "/system/gnu_library/bin/ar.pm"; then
1310 elif test -n "$DJGPP"; then
1313 elif test -f /kern/cookiejar; then
1316 elif test -d c:/. -o -n "$is_os2" ; then
1323 : Trailing extension. Override this in a hint file, if needed.
1324 : Extra object files, if any, needed on this platform.
1327 : Possible local include directories to search.
1328 : Set locincpth to "" in a hint file to defeat local include searches.
1329 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1330 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1332 : no include file wanted by default
1335 : Enable -DEBUGGING and -DDEBUGGING from the command line
1340 : change the next line if compiling for Xenix/286 on Xenix/386
1341 xlibpth='/usr/lib/386 /lib/386'
1342 : Possible local library directories to search.
1343 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1344 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1346 : general looking path for locating libraries
1347 glibpth="/lib /usr/lib $xlibpth"
1348 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1349 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1350 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1351 test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
1353 : Private path used by Configure to find libraries. Its value
1354 : is prepended to libpth. This variable takes care of special
1355 : machines, like the mips. Usually, it should be empty.
1358 : default library list
1360 : some systems want to use only the non-versioned libso:s
1361 ignore_versioned_solibs=''
1362 : set usethreads on the Configure command line to enable threads.
1363 usereentrant='undef'
1367 : set useposix=false in your hint file to disable the POSIX extension.
1369 : set useopcode=false in your hint file to disable the Opcode extension.
1372 ccflags_uselargefiles=''
1373 ldflags_uselargefiles=''
1374 libswanted_uselargefiles=''
1375 : set usemultiplicity on the Configure command line to enable multiplicity.
1376 : set usesocks on the Configure command line to enable socks.
1377 : List of libraries we want.
1378 : If anyone needs extra -lxxx, put those in a hint file.
1379 libswanted="socket bind inet nsl nm ndbm gdbm dbm db malloc dl ld sun"
1380 libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
1381 : We probably want to search /usr/shlib before most other libraries.
1382 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1383 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1384 glibpth="/usr/shlib $glibpth"
1385 : Do not use vfork unless overridden by a hint file.
1388 : Find the basic shell for Bourne shell scripts
1392 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1395 if test -f "$xxx"; then
1398 : Build up a list and do a single loop so we can 'break' out.
1399 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1400 for xxx in sh bash ksh pdksh ash; do
1402 try="$try ${p}/${xxx}"
1406 if test -f "$xxx"; then
1409 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1412 elif test -f "$xxx.exe"; then
1423 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1425 Usually it's in /bin/sh. How did you even get this far?
1426 Please contact me (Perl Maintainers) at perlbug@perl.org and
1427 we'll try to straighten this all out.
1433 : see if sh knows # comments
1434 if `$sh -c '#' >/dev/null 2>&1`; then
1438 test -f $xcat$_exe || xcat=/usr/bin/cat
1439 if test ! -f $xcat$_exe; then
1440 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1441 if test -f $p/cat$_exe; then
1446 if test ! -f $xcat$_exe; then
1447 echo "Can't find cat anywhere!"
1451 echo "#!$xcat" >sharp
1454 ./sharp > today 2>/dev/null
1455 if test -s today; then
1458 echo "#! $xcat" > sharp
1461 ./sharp > today 2>/dev/null
1462 if test -s today; then
1470 echo "Your $sh doesn't grok # comments--I will strip them later on."
1473 echo "exec grep -v '^[ ]*#'" >spitshell
1475 $eunicefix spitshell
1476 spitshell=`pwd`/spitshell
1478 echo "I presume that if # doesn't work, #! won't work either!"
1483 : figure out how to guarantee sh startup
1485 '') startsh=${sharpbang}${sh} ;;
1497 : echo "Yup, it does."
1499 echo "Hmm... '$startsh' does not guarantee sh startup..."
1500 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1504 : Save command line options in file UU/cmdline.opt for later use in
1505 : generating config.sh.
1506 cat > cmdline.opt <<EOSH
1507 : Configure command line arguments.
1516 cat >>cmdline.opt <<EOSH
1517 config_arg$argn='$arg'
1519 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1522 arg_exp=`cat cmdl.opt`
1523 args_exp="$args_exp$args_sep'$arg_exp'"
1524 argn=`expr $argn + 1`
1529 : produce awk script to parse command line options
1530 cat >options.awk <<'EOF'
1532 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1534 len = length(optstr);
1535 for (i = 1; i <= len; i++) {
1536 c = substr(optstr, i, 1);
1537 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1548 if (substr(str, 1, 1) != "-") {
1549 printf("'%s'\n", str);
1553 for (i = 2; i <= len; i++) {
1554 c = substr(str, i, 1);
1556 printf("-%s\n", substr(str, i));
1562 printf("'%s'\n", substr(str, i + 1));
1575 : process the command line options
1576 set X `for arg in "$@"; do echo "X$arg"; done |
1577 sed -e s/X// | awk -f options.awk`
1582 : set up default values
1592 rm -f optdef.sh posthint.sh
1593 cat >optdef.sh <<EOS
1599 while test $# -gt 0; do
1601 -d) shift; fastread=yes;;
1602 -e) shift; alldone=cont;;
1606 if test -r "$1"; then
1609 echo "$me: cannot read config file $1." >&2
1615 -h) shift; error=true;;
1616 -r) shift; reuseval=true;;
1617 -s) shift; silent=true; realsilent=true;;
1618 -E) shift; alldone=exit;;
1619 -K) shift; knowitall=true;;
1620 -O) shift; override=true;;
1621 -S) shift; silent=true; extractsh=true;;
1626 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1627 echo "$me: ignoring -D $1" >&2
1630 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1631 *) echo "$1='define'" >> optdef.sh;;
1638 *=) echo "$1" >> optdef.sh;;
1640 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1641 echo "$me: ignoring -U $1" >&2
1643 *) echo "$1='undef'" >> optdef.sh;;
1654 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1658 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1659 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1665 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1666 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1667 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1668 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1669 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1670 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1676 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1678 echo "$yyy=''" >> posthint.sh ;;
1683 echo "$yyy='$zzz'" >> posthint.sh ;;
1685 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1687 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1692 echo "$yyy=$zzz" >> posthint.sh ;;
1693 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1697 -V) echo "$me generated by metaconfig 3.5 PL0." >&2
1700 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1708 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1709 [-U symbol] [-U symbol=] [-A command:symbol...]
1710 -d : use defaults for all answers.
1711 -e : go on without questioning past the production of config.sh.
1712 -f : specify an alternate default configuration file.
1713 -h : print this help message and exit (with an error status).
1714 -r : reuse C symbols value if possible (skips costly nm extraction).
1715 -s : silent mode, only echoes questions and essential information.
1716 -D : define symbol to have some value:
1717 -D symbol symbol gets the value 'define'
1718 -D symbol=value symbol gets the value 'value'
1719 common used examples (see INSTALL for more info):
1720 -Duse64bitint use 64bit integers
1721 -Duse64bitall use 64bit integers and pointers
1722 -Dusethreads use thread support
1723 -Dinc_version_list=none do not include older perl trees in @INC
1724 -DEBUGGING=none DEBUGGING options
1725 -Dcc=gcc choose your compiler
1726 -Dprefix=/opt/perl5 choose your destination
1727 -E : stop at the end of questions, after having produced config.sh.
1728 -K : do not use unless you know what you are doing.
1729 -O : let -D and -U override definitions from loaded configuration file.
1730 -S : perform variable substitutions on all .SH files (can mix with -f)
1731 -U : undefine symbol:
1732 -U symbol symbol gets the value 'undef'
1733 -U symbol= symbol gets completely empty
1735 -A : manipulate symbol after the platform specific hints have been applied:
1736 -A append:symbol=value append value to symbol
1737 -A symbol=value like append:, but with a separating space
1738 -A define:symbol=value define symbol to have value
1739 -A clear:symbol define symbol to be ''
1740 -A define:symbol define symbol to be 'define'
1741 -A eval:symbol=value define symbol to be eval of value
1742 -A prepend:symbol=value prepend value to symbol
1743 -A undef:symbol define symbol to be 'undef'
1744 -A undef:symbol= define symbol to be ''
1745 e.g.: -A prepend:libswanted='cl pthread '
1746 -A ccflags=-DSOME_MACRO
1747 -V : print version number and exit (with a zero status).
1754 case "$fastread$alldone" in
1757 case "$extractsh" in
1760 if test ! -t 0; then
1761 echo "Say 'sh Configure', not 'sh <Configure'"
1771 true) exec 1>/dev/null;;
1774 : run the defines and the undefines, if any, but leave the file out there...
1777 : create the posthint manipulation script and leave the file out there...
1782 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1783 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1784 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1785 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1786 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1789 : Some greps do not return status, grrr.
1790 echo "grimblepritz" >grimble
1791 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1793 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1799 : the following should work in any shell
1803 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1804 cat >contains <<'EOSS'
1805 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1810 : Find the path to the source tree
1813 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1817 *) src=`cd ../$src && pwd` ;;
1830 if test -f $rsrc/Configure && \
1831 $contains "^package='$package'\$" $rsrc/Configure >/dev/null 2>&1
1833 : found it, so we are ok.
1836 for src in . .. ../.. ../../.. ../../../..; do
1837 if test -f ../$src/Configure && \
1838 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1849 Sorry, I can't seem to locate the source dir for $package. Please start
1850 Configure with an explicit path -- i.e. /some/path/Configure.
1858 echo "Sources for $package found in \"$src\"." >&4
1862 : script used to extract .SH files with variable substitutions
1863 cat >extract <<'EOS'
1865 echo "Doing variable substitutions on .SH files..."
1866 if test -f MANIFEST; then
1867 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1869 echo "(Looking for .SH files under the source directory.)"
1870 set x `(cd "$src"; find . -name "*.SH" -print)`
1874 0) set x `(cd "$src"; echo *.SH)`; shift;;
1876 if test ! -f "$src/$1"; then
1882 while test $name; do
1883 if test ! -d "$name"; then
1884 create="$name $create";
1885 name=`echo $name | sed -e "s|^[^/]*$||"`;
1886 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1891 for file in $create; do
1900 dir=`expr X$file : 'X\(.*\)/'`
1901 file=`expr X$file : 'X.*/\(.*\)'`
1902 (cd "$dir" && . ./$file)
1912 dir=`expr X$file : 'X\(.*\)/'`
1913 file=`expr X$file : 'X.*/\(.*\)'`
1914 (set x $dir; shift; eval $mkdir_p)
1915 sh <"$src/$dir/$file"
1924 if test -f "$src/config_h.SH"; then
1925 if test ! -f config.h; then
1926 : oops, they left it out of MANIFEST, probably, so do it anyway.
1927 . "$src/config_h.SH"
1932 : extract files and exit if asked to do so
1933 case "$extractsh" in
1935 case "$realsilent" in
1939 case "$config_sh" in
1940 '') config_sh='config.sh';;
1943 echo "Fetching answers from $config_sh..."
1946 test "$override" && . ./optdef.sh
1950 echo "Extraction done."
1955 : Eunice requires " " instead of "", can you believe it
1958 echo "Beginning of configuration questions for $package."
1960 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1962 : first determine how to suppress newline on echo command
1964 echo "Checking echo to see how to suppress newlines..."
1965 (echo "hi there\c" ; echo " ") >.echotmp
1966 if $contains c .echotmp >/dev/null 2>&1 ; then
1977 echo $n "The star should be here-->$c"
1981 : Now test for existence of everything in MANIFEST
1983 if test -f "$rsrc/MANIFEST"; then
1984 echo "First let's make sure your kit is complete. Checking..." >&4
1985 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | \
1986 (split -l 50 2>/dev/null || split -50)
1989 for filelist in x??; do
1990 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` \
1991 >/dev/null 2>>"$tmppwd/missing")
1993 if test -s missing; then
1997 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1999 You have the option of continuing the configuration process, despite the
2000 distinct possibility that your kit is damaged, by typing 'y'es. If you
2001 do, don't blame me if something goes wrong. I advise you to type 'n'o
2002 and contact the author (perlbug@perl.org).
2005 echo $n "Continue? [n] $c" >&4
2009 echo "Continuing..." >&4
2013 echo "ABORTING..." >&4
2018 echo "Looks good..."
2021 echo "There is no MANIFEST file. I hope your kit is complete !"
2025 : Find the appropriate value for a newline for tr
2027 if test -n "$DJGPP"; then
2030 if test X"$trnl" = X; then
2031 case "`echo foo|tr '\n' x 2>/dev/null`" in
2035 if test X"$trnl" = X; then
2036 case "`echo foo|tr '\012' x 2>/dev/null`" in
2037 foox) trnl='\012' ;;
2040 if test X"$trnl" = X; then
2041 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
2042 fooxy) trnl='\n\r' ;;
2045 if test X"$trnl" = X; then
2048 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
2054 : compute the number of columns on the terminal for proper question formatting
2059 : set up the echo used in my read
2060 myecho="case \"\$xxxm\" in
2061 '') echo $n \"\$rp $c\" >&4;;
2063 '') echo $n \"[\$xxxm] $c\";;
2065 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
2067 echo $n \"[\$xxxm] $c\" >&4
2069 echo $n \"\$rp [\$xxxm] $c\" >&4
2075 : now set up to do reads with possible shell escape and default assignment
2081 case "\$fastread" in
2082 yes) case "\$dflt" in
2085 case "\$silent-\$rp" in
2090 *) case "\$silent" in
2091 true) case "\$rp" in
2096 while expr "X\$ans" : "X!" >/dev/null; do
2100 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2108 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2117 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2122 echo "(OK, I'll run with -d after this question.)" >&4
2125 echo "*** Sorry, \$1 not supported yet." >&4
2135 echo "*** Substitution done -- please confirm."
2137 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2142 echo "*** Error -- try again."
2149 case "\$ans\$xxxm\$nostick" in
2161 : create .config dir to save info across Configure sessions
2162 test -d ../.config || mkdir ../.config
2163 cat >../.config/README <<EOF
2164 This directory created by Configure to save information that should
2165 persist across sessions for $package.
2167 You may safely delete it if you wish.
2170 : See if we are using a devel version and want that
2171 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2174 usedevel="$define" ;;
2175 *) case "$xversion" in
2178 *** WHOA THERE!!! ***
2180 This is an UNSTABLE DEVELOPMENT release.
2181 The version of this $package distribution is $xversion, that is, odd,
2182 (as opposed to even) and that signifies a development release.
2183 If you want a maintenance release, you want an even-numbered version.
2185 Do ***NOT*** install this into production use.
2186 Data corruption and crashes are possible.
2188 It is most seriously suggested that you do not continue any further
2189 unless you want to help in developing and debugging Perl.
2191 If you *still* want to build perl, you can answer 'y' now,
2192 or pass -Dusedevel to Configure.
2195 rp='Do you really want to continue?'
2199 [yY]) echo >&4 "Okay, continuing."
2200 usedevel="$define" ;;
2201 *) echo >&4 "Okay, bye."
2212 case "$versiononly" in
2213 '') versiononly="$define" ;;
2215 case "$installusrbinperl" in
2216 '') installusrbinperl="$undef" ;;
2221 : general instructions
2224 user=`(logname) 2>/dev/null`
2226 '') user=`whoami 2>&1`;;
2228 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2231 rp='Would you like to see the instructions?'
2242 This installation shell script will examine your system and ask you questions
2243 to determine how the perl5 package should be installed. If you get
2244 stuck on a question, you may use a ! shell escape to start a subshell or
2245 execute a command. Many of the questions will have default answers in square
2246 brackets; typing carriage return will give you the default.
2248 On some of the questions which ask for file or directory names you are allowed
2249 to use the ~name construct to specify the login directory belonging to "name",
2250 even if you don't have a shell which knows about that. Questions where this is
2251 allowed will be marked "(~name ok)".
2255 dflt='Type carriage return to continue'
2259 The prompter used in this script allows you to use shell variables and
2260 backticks in your answers. You may use $1, $2, etc... to refer to the words
2261 in the default answer, as if the default line was a set of arguments given to a
2262 script shell. This means you may also use $* to repeat the whole default line,
2263 so you do not have to re-type everything to add something to the default.
2265 Every time there is a substitution, you will have to confirm. If there is an
2266 error (e.g. an unmatched backtick), the default answer will remain unchanged
2267 and you will be prompted again.
2269 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2270 the questions and use the computed defaults (or the previous answers if there
2271 was already a config.sh file). Type 'Configure -h' for a list of options.
2272 You may also start interactively and then answer '& -d' at any prompt to turn
2273 on the non-interactive behaviour for the remainder of the execution.
2279 Much effort has been expended to ensure that this shell script will run on any
2280 Unix system. If despite that it blows up on yours, your best bet is to edit
2281 Configure and run it again. If you can't run Configure for some reason,
2282 you'll have to generate a config.sh file by hand. Whatever problems you
2283 have, let me (perlbug@perl.org) know how I blew it.
2285 This installation script affects things in two ways:
2287 1) it may do direct variable substitutions on some of the files included
2289 2) it builds a config.h file for inclusion in C programs. You may edit
2290 any of these files as the need arises after running this script.
2292 If you make a mistake on a question, there is no easy way to back up to it
2293 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2294 files. Configure will offer to let you do this before it runs the SH files.
2297 dflt='Type carriage return to continue'
2299 case "$firsttime" in
2300 true) echo $user >>../.config/instruct;;
2304 : find out where common programs are
2306 echo "Locating common programs..." >&4
2319 if test -d \$dir/\$thing; then
2325 for thisthing in \$dir/\$thing; do
2326 : just loop through to pick last item
2328 if test -f \$thisthing; then
2331 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2334 elif test -f \$dir/\$thing.exe; then
2335 if test -n "$DJGPP"; then
2336 echo \$dir/\$thing.exe
2337 elif test "$eunicefix" != ":"; then
2338 : on Eunice apparently
2391 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2392 pth="$pth /lib /usr/lib"
2393 for file in $loclist; do
2397 if test -f "$xxx"; then
2400 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2401 xxx=`./loc $file $file $pth`
2404 '') xxx=`./loc $file $file $pth`;;
2405 *) xxx=`./loc $xxx $xxx $pth`;;
2407 eval $file=$xxx$_exe
2411 echo $file is in $xxx.
2414 echo $file is in $xxx.
2417 echo "I don't know where '$file' is, and my life depends on it." >&4
2418 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2424 echo "Don't worry if any of the following aren't found..."
2426 for file in $trylist; do
2430 if test -f "$xxx"; then
2433 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2434 xxx=`./loc $file $file $pth`
2437 '') xxx=`./loc $file $file $pth`;;
2438 *) xxx=`./loc $xxx $xxx $pth`;;
2440 eval $file=$xxx$_exe
2444 echo $file is in $xxx.
2447 echo $file is in $xxx.
2450 echo "I don't see $file out there, $say."
2457 echo "Substituting grep for egrep."
2464 *) if $less -R </dev/null >/dev/null; then
2465 echo "Substituting less -R for less."
2473 echo "Substituting cp for ln."
2482 echo "I can't find make or gmake, and my life depends on it." >&4
2483 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2491 *) # We can't have osname yet.
2492 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2493 # Assume that gmake, if found, is definitely GNU make
2494 # and prefer it over the system make.
2495 echo "Substituting gmake for make."
2503 echo "Hopefully test is built into your sh."
2506 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2507 echo "Using the test built into your sh."
2515 echo "Hopefully echo is built into your sh."
2520 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2521 $echo $n "hi there$c" >foo1
2522 echo $n "hi there$c" >foo2
2523 if cmp foo1 foo2 >/dev/null 2>&1; then
2524 echo "They are compatible. In fact, they may be identical."
2531 They are not compatible! You are probably running ksh on a non-USG system.
2532 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2533 have echo built in and we may have to run some Bourne shell scripts. That
2534 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2537 $echo $n "The star should be here-->$c"
2544 # This question was auctioned at YAPC::Europe-2007 in Vienna
2545 # I never promised you could answer it. I only auctioned the question.
2547 The following message is sponsored by
2549 Dresden.pm<--The stars should be here.
2551 Dear Perl user, system administrator or package
2552 maintainer, the Perl community sends greetings to
2553 you. Do you (emblematical) greet back [Y/n]? n
2557 : Check what type of C compiler we use
2561 cat <<'EOSC' >>trygcc
2566 int main(int argc, char *argv[]) {
2570 if $cc -o try $ccflags $ldflags try.c; then
2573 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2579 # Skip this test because it gives a false match on output like:
2580 # ./trygcc: line 23: cc: command not found
2581 # case "`$cc -v -c try.c 2>&1`" in
2582 # *gcc*) trygcc=no ;;
2584 if $test X"$trygcc" = Xyes; then
2585 if gcc -o try -c try.c; then
2587 echo "You seem to have a working gcc, though." >&4
2588 # Switching compilers may undo the work of hints files.
2589 # The most common problem is -D_REENTRANT for threads.
2590 # This heuristic catches that case, but gets false positives
2591 # if -Dusethreads was not actually specified. Better to
2592 # bail out here with a useful message than fail
2593 # mysteriously later. Should we perhaps just try to
2594 # re-invoke Configure -Dcc=gcc config_args ?
2595 if $test -f usethreads.cbu; then
2598 *** However, any setting of the C compiler flags (e.g. for thread support)
2599 *** will be lost. It may be necessary for you to restart Configure and
2600 *** add -Dcc=gcc to your Configure command line.
2603 rp="Would you like to go ahead and try gcc anyway?"
2606 rp="Would you like to use it?"
2609 if $test -f myread; then
2612 if $test -f UU/myread; then
2615 echo "Cannot find myread, sorry. Aborting." >&2
2620 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2633 cat <<'EOSC' >>checkcc
2638 int main(int argc, char *argv[]) {
2642 if $cc -o try $ccflags $ldflags try.c; then
2645 if $test X"$despair" = Xyes; then
2646 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2649 You need to find a working C compiler.
2650 Either (purchase and) install the C compiler supplied by your OS vendor,
2651 or for a free C compiler try http://gcc.gnu.org/
2652 I cannot continue any further, aborting.
2661 : determine whether symbolic links are supported
2664 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2665 echo "Symbolic links are supported." >&4
2668 echo "Symbolic links are NOT supported." >&4
2673 : determine whether symbolic links are supported
2677 echo "Checking how to test for symbolic links..." >&4
2679 if $test "X$issymlink" = X; then
2681 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2682 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2684 if test $? = 0; then
2687 echo "Your builtin 'test -h' may be broken." >&4
2690 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2693 if test -f "$p/$test"; then
2702 echo "Trying external '$test -h'." >&4
2703 issymlink="$test -h"
2704 if $test ! -h sym >/dev/null 2>&1; then
2705 echo "External '$test -h' is broken, too." >&4
2713 if $test "X$issymlink" = X; then
2714 if $test -L sym 2>/dev/null; then
2715 issymlink="$test -L"
2716 echo "The builtin '$test -L' worked." >&4
2719 if $test "X$issymlink" != X; then
2720 echo "You can test for symbolic links with '$issymlink'." >&4
2722 echo "I do not know how you can test for symbolic links." >&4
2726 *) echo "No symbolic links, so not testing for their testing..." >&4
2731 : Make symlinks util
2732 case "$mksymlinks" in
2735 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2738 *) case "$lns:$issymlink" in
2739 *"ln"*" -s:"*"test -"?)
2740 echo "Creating the symbolic links..." >&4
2741 echo "(First creating the subdirectories...)" >&4
2743 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2745 test -z "$directory" && break
2749 if test ! -d t/base; then
2750 echo "Failed to create the subdirectories. Aborting." >&4
2753 echo "(Then creating the symlinks...)" >&4
2754 awk '{print $1}' $src/MANIFEST | while true; do
2756 test -z "$filename" && break
2757 if test -f $filename; then
2758 if $issymlink $filename; then
2762 if test -f $filename; then
2763 echo "$filename already exists, not symlinking."
2765 ln -s $src/$filename $filename
2769 if test ! -f t/base/lex.t; then
2770 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2775 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2783 : Check for Cross-Compilation
2784 case "$usecrosscompile" in
2786 $echo "Cross-compiling..."
2789 *-*-gcc) # A cross-compiling gcc, probably.
2790 targetarch=`$echo $cc|$sed 's/-gcc$//'`
2792 # leave out ld, choosing it is more complex
2794 ranlib=$targetarch-ranlib
2795 $echo 'extern int foo;' > try.c
2796 set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
2798 if $test $# -gt 0; then
2800 incpth="`$echo $incpth|$sed 's/^ //'`"
2801 echo "Guessing incpth '$incpth'." >&4
2803 j="`$echo $i|$sed 's,/include$,/lib,'`"
2804 if $test -d $j; then
2808 libpth="`$echo $libpth|$sed 's/^ //'`"
2809 echo "Guessing libpth '$libpth'." >&4
2814 case "$targetarch" in
2815 '') echo "Targetarch not defined." >&4; croak=y ;;
2816 *) echo "Using targetarch $targetarch." >&4 ;;
2819 '') echo "Incpth not defined." >&4; croak=y ;;
2820 *) echo "Using incpth '$incpth'." >&4 ;;
2823 '') echo "Libpth not defined." >&4; croak=y ;;
2824 *) echo "Using libpth '$libpth'." >&4 ;;
2827 '') for i in $incpth; do
2828 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2830 echo "Guessing usrinc $usrinc." >&4
2835 '') echo "Usrinc not defined." >&4; croak=y ;;
2838 *) echo "Using usrinc $usrinc." >&4 ;;
2840 case "$targethost" in
2841 '') echo "Targethost not defined." >&4; croak=y ;;
2842 *) echo "Using targethost $targethost." >&4
2847 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2850 /*) run=$src/Cross/run
2851 targetmkdir=$src/Cross/mkdir
2853 from=$src/Cross/from
2855 *) pwd=`$test -f ../Configure & cd ..; pwd`
2857 targetmkdir=$pwd/Cross/mkdir
2859 from=$pwd/Cross/from
2862 case "$targetrun" in
2863 '') targetrun=ssh ;;
2868 case "$targetfrom" in
2869 '') targetfrom=scp ;;
2873 from=$from-$targetfrom
2874 case "$targetdir" in
2876 echo "Guessing targetdir $targetdir." >&4
2879 case "$targetuser" in
2881 echo "Guessing targetuser $targetuser." >&4
2884 case "$targetfrom" in
2888 case "$targetrun" in
2900 '') cwd=$targetdir ;;
2904 if $test ! -f \$exe.xok; then
2908 $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2911 *) echo "Unknown targetrun '$targetrun'" >&4
2915 case "$targetmkdir" in
2917 cat >$targetmkdir <<EOF
2919 $targetrun -l $targetuser $targethost "mkdir -p \$@"
2921 $chmod a+rx $targetmkdir
2923 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2935 $targetmkdir \`dirname \$f\`
2936 $targetto $q \$f $targetuser@$targethost:\$f || exit 1
2939 $targetmkdir $targetdir/\`dirname \$f\`
2940 $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2953 $mkdir -p $targetdir/\`dirname \$f\`
2954 $cp \$f $targetdir/\$f || exit 1
2957 $targetmkdir $targetdir/\`dirname \$f\`
2958 $cp \$f $targetdir/\$f || exit 1
2965 *) echo "Unknown targetto '$targetto'" >&4
2969 case "$targetfrom" in
2976 $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2981 cp) cat >$from <<EOF
2986 cp $targetdir/\$f . || exit 1
2991 *) echo "Unknown targetfrom '$targetfrom'" >&4
2995 if $test ! -f $run; then
2996 echo "Target 'run' script '$run' not found." >&4
3000 if $test ! -f $to; then
3001 echo "Target 'to' script '$to' not found." >&4
3005 if $test ! -f $from; then
3006 echo "Target 'from' script '$from' not found." >&4
3010 if $test ! -f $run -o ! -f $to -o ! -f $from; then
3014 Using '$run' for remote execution,
3015 and '$from' and '$to'
3016 for remote file transfer.
3022 usecrosscompile='undef'
3027 : see whether [:lower:] and [:upper:] are supported character classes
3029 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
3031 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
3035 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
3036 # (0xd9 and 0xe2), therefore that is a nice testing point.
3037 if test "X$up" = X -o "X$low" = X; then
3038 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
3044 if test "X$up" = X -o "X$low" = X; then
3045 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
3051 if test "X$up" = X -o "X$low" = X; then
3052 case "`echo RS | od -x 2>/dev/null`" in
3054 echo "Hey, this might be EBCDIC." >&4
3055 if test "X$up" = X -o "X$low" = X; then
3056 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
3057 rs) up='[A-IJ-RS-Z]'
3062 if test "X$up" = X -o "X$low" = X; then
3063 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
3073 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
3075 echo "Using $up and $low to convert case." >&4
3078 echo "I don't know how to translate letters from upper to lower case." >&4
3079 echo "Your tr is not acting any way I know of." >&4
3083 : set up the translation script tr, must be called with ./tr of course
3087 '[A-Z][a-z]') exec $tr '$up' '$low';;
3088 '[a-z][A-Z]') exec $tr '$low' '$up';;
3095 : Try to determine whether config.sh was made on this system
3096 case "$config_sh" in
3098 myuname=`$uname -a 2>/dev/null`
3099 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
3100 # Downcase everything to avoid ambiguity.
3101 # Remove slashes and single quotes so we can use parts of this in
3102 # directory and file names.
3103 # Remove newlines so myuname is sane to use elsewhere.
3104 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
3105 # because the A-Z/a-z are not consecutive.
3106 myuname=`echo $myuname | $sed -e "s,['/],,g" | \
3107 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
3108 newmyuname="$myuname"
3110 case "$knowitall" in
3112 if test -f ../config.sh; then
3113 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3114 eval "`grep myuname= ../config.sh`"
3116 if test "X$myuname" = "X$newmyuname"; then
3124 : Get old answers from old config file if Configure was run on the
3125 : same system, otherwise use the hints.
3128 if test -f config.sh; then
3130 rp="I see a config.sh file. Shall I use it to set the defaults?"
3133 n*|N*) echo "OK, I'll ignore it."
3134 mv config.sh config.sh.old
3135 myuname="$newmyuname"
3137 *) echo "Fetching default answers from your old config.sh file..." >&4
3145 : Older versions did not always set $sh. Catch re-use of such
3155 if test ! -f config.sh; then
3158 First time through, eh? I have some defaults handy for some systems
3159 that need some extra help getting the Configure answers right:
3162 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3164 : Half the following guesses are probably wrong... If you have better
3165 : tests or hints, please send them to perlbug@perl.org
3166 : The metaconfig authors would also appreciate a copy...
3167 $test -f /irix && osname=irix
3168 $test -f /xenix && osname=sco_xenix
3169 $test -f /dynix && osname=dynix
3170 $test -f /dnix && osname=dnix
3171 $test -f /lynx.os && osname=lynxos
3172 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3173 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3174 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3175 $test -f /bin/mips && /bin/mips && osname=mips
3176 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
3177 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
3178 $test -d /usr/apollo/bin && osname=apollo
3179 $test -f /etc/saf/_sactab && osname=svr4
3180 $test -d /usr/include/minix && osname=minix
3181 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3182 if $test -d /MachTen -o -d /MachTen_Folder; then
3184 if $test -x /sbin/version; then
3185 osvers=`/sbin/version | $awk '{print $2}' |
3186 $sed -e 's/[A-Za-z]$//'`
3187 elif $test -x /usr/etc/version; then
3188 osvers=`/usr/etc/version | $awk '{print $2}' |
3189 $sed -e 's/[A-Za-z]$//'`
3195 $test -f /sys/posix.dll &&
3196 $test -f /usr/bin/what &&
3197 set X `/usr/bin/what /sys/posix.dll` &&
3198 $test "$3" = UWIN &&
3202 if $test -f $uname; then
3210 umips) osname=umips ;;
3213 [23]100) osname=mips ;;
3214 next*) osname=next ;;
3216 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3217 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3220 elif $test -f /etc/kconfig; then
3222 if test "$lns" = "$ln -s"; then
3224 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3226 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3233 if test -n "$DJGPP"; then
3242 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3244 # oslevel can fail with:
3245 # oslevel: Unable to acquire lock.
3246 *not\ found) osvers="$4"."$3" ;;
3247 '<3240'|'<>3240') osvers=3.2.0 ;;
3248 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3249 '=3250'|'>3250') osvers=3.2.5 ;;
3253 bitrig) osname=bitrig
3256 bsd386) osname=bsd386
3259 cygwin*) osname=cygwin
3262 *dc.osx) osname=dcosx
3268 domainos) osname=apollo
3274 dragonfly) osname=dragonfly
3277 dynixptx*) osname=dynixptx
3278 osvers=`echo "$4"|sed 's/^v//'`
3280 freebsd) osname=freebsd
3282 genix) osname=genix ;;
3286 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3302 netbsd*) osname=netbsd
3305 news-os) osvers="$3"
3307 4*) osname=newsos4 ;;
3311 next*) osname=next ;;
3312 nonstop-ux) osname=nonstopux ;;
3313 openbsd) osname=openbsd
3319 POSIX-BC | posix-bc ) osname=posix-bc
3322 powerux | power_ux | powermax_os | powermaxos | \
3323 powerunix | power_unix) osname=powerux
3329 solaris) osname=solaris
3331 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3338 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3342 titanos) osname=titanos
3351 ultrix) osname=ultrix
3354 osf1|mls+) case "$5" in
3357 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3360 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3363 hp*) osname=hp_osf1 ;;
3364 mips) osname=mips_osf1 ;;
3367 # UnixWare 7.1.2 is known as Open UNIX 8
3368 openunix|unixware) osname=svr5
3376 $2) case "$osname" in
3380 : svr4.x or possibly later
3390 if test -f /stand/boot ; then
3391 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3392 if test -n "$INITPROG" -a -f "$INITPROG"; then
3393 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3394 if test -n "$isesix"; then
3402 *) if test -f /etc/systemid; then
3404 set `echo $3 | $sed 's/\./ /g'` $4
3405 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3407 elif $test -f $src/hints/sco_$1_$2.sh; then
3409 elif $test -f $src/hints/sco_$1.sh; then
3414 '') : Still unknown. Probably a generic Sys V.
3423 *) case "$osname" in
3424 '') : Still unknown. Probably a generic BSD.
3432 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3433 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3434 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3437 $rm -f UU/kernel.what
3438 elif test -d c:/. -o -n "$is_os2" ; then
3445 case "$targetarch" in
3448 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3453 : Now look for a hint file osname_osvers, unless one has been
3454 : specified already.
3457 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3458 : Also try without trailing minor version numbers.
3459 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3460 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3461 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3462 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3465 *) case "$osvers" in
3468 *) if $test -f $src/hints/$file.sh ; then
3470 elif $test -f $src/hints/$xfile.sh ; then
3472 elif $test -f $src/hints/$xxfile.sh ; then
3474 elif $test -f $src/hints/$xxxfile.sh ; then
3476 elif $test -f $src/hints/$xxxxfile.sh ; then
3478 elif $test -f "$src/hints/${osname}.sh" ; then
3487 if $test -f Policy.sh ; then
3490 none) dflt="Policy" ;;
3491 *) dflt="Policy $dflt" ;;
3496 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3500 if $test -f Policy.sh ; then
3503 There's also a Policy hint file available, which should make the
3504 site-specific (policy) questions easier to answer.
3511 You may give one or more space-separated answers, or "none" if appropriate.
3512 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3513 previous run of Configure, you may specify it as well as or instead of
3514 OS-specific hints. If hints are provided for your OS, you should use them:
3515 although Perl can probably be built without hints on many platforms, using
3516 hints often improve performance and may enable features that Configure can't
3517 set up on its own. If there are no hints that match your OS, specify "none";
3518 DO NOT give a wrong version or a wrong OS.
3522 rp="Which of these apply, if any?"
3525 for file in $tans; do
3526 if $test X$file = XPolicy -a -f Policy.sh; then
3528 $cat Policy.sh >> UU/config.sh
3529 elif $test -f $src/hints/$file.sh; then
3530 . $src/hints/$file.sh
3531 $cat $src/hints/$file.sh >> UU/config.sh
3532 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3535 : Give one chance to correct a possible typo.
3536 echo "$file.sh does not exist"
3538 rp="hint to use instead?"
3540 for file in $ans; do
3541 if $test -f "$src/hints/$file.sh"; then
3542 . $src/hints/$file.sh
3543 $cat $src/hints/$file.sh >> UU/config.sh
3544 elif $test X$ans = X -o X$ans = Xnone ; then
3547 echo "$file.sh does not exist -- ignored."
3554 : Remember our hint file for later.
3555 if $test -f "$src/hints/$file.sh" ; then
3565 echo "Fetching default answers from $config_sh..." >&4
3569 cp $config_sh config.sh 2>/dev/null
3579 test "$override" && . ./optdef.sh
3581 : Restore computed paths
3582 for file in $loclist $trylist; do
3583 eval $file="\$_$file"
3588 Configure uses the operating system name and version to set some defaults.
3589 The default value is probably right if the name rings a bell. Otherwise,
3590 since spelling matters for me, either accept the default or answer "none"
3597 ''|' '|none) dflt=none ;;
3598 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3601 *) dflt="$osname" ;;
3603 rp="Operating system name?"
3607 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3613 ''|' '|none) dflt=none ;;
3614 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3615 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3617 ''|' ') dflt=none ;;
3622 *) dflt="$osvers" ;;
3624 rp="Operating system version?"
3634 : who configured the system
3635 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3638 cf_by=`(logname) 2>/dev/null`
3641 cf_by=`(whoami) 2>/dev/null`
3643 "") cf_by=unknown ;;
3648 : decide how portable to be. Allow command line overrides.
3649 case "$d_portable" in
3651 *) d_portable="$define" ;;
3654 : set up shell script to do ~ expansion
3660 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3663 if $test -f /bin/csh; then
3664 /bin/csh -f -c "glob \$1"
3669 name=\`$expr x\$1 : '..\([^/]*\)'\`
3670 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3671 if $test ! -d "\$dir"; then
3673 echo "\$me: can't locate home directory for: \$name" >&2
3678 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3694 : now set up to get a file name
3698 cat <<'EOSC' >>getfile
3714 : getfile will accept an answer from the comma-separated list
3715 : enclosed in parentheses even if it does not meet other criteria.
3716 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3717 fn=`echo $fn | sed 's/(.*)//'`
3723 loc_file=`expr $fn : '.*:\(.*\)'`
3724 fn=`expr $fn : '\(.*\):.*'`
3732 */*) fullpath=true;;
3741 *e*) exp_file=true;;
3744 *p*) nopath_ok=true;;
3749 *d*) type='Directory';;
3750 *l*) type='Locate';;
3755 Locate) what='File';;
3760 case "$d_portable" in
3768 while test "$type"; do
3773 true) rp="$rp (~name ok)";;
3776 if test -f UU/getfile.ok && \
3777 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3796 value=`UU/filexp $ans`
3799 if test "$ans" != "$value"; then
3800 echo "(That expands to $value on this system.)"
3814 /*) value="$ansexp" ;;
3815 [a-zA-Z]:/*) value="$ansexp" ;;
3820 echo "I shall only accept a full path name, as in /bin/ls." >&4
3821 echo "Use a ! shell escape if you wish to check pathnames." >&4
3824 echo "Please give a full path name, starting with slash." >&4
3827 echo "Note that using ~name is ok provided it expands well." >&4
3840 for fp in $gfpth; do
3841 if test "X$fp" = X.; then
3846 if test -f "$pf"; then
3848 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3850 echo "($value is not a plain file, but that's ok.)"
3853 if test X"$type" = X; then
3860 for fp in $gfpth; do
3861 if test "X$fp" = X.; then
3866 direxp="$fp/$ansexp"
3868 if test -d "$direxp"; then
3876 if test -d "$ansexp"; then
3877 echo "(Looking for $loc_file in directory $value.)"
3878 value="$value/$loc_file"
3879 ansexp="$ansexp/$loc_file"
3881 if test -f "$ansexp"; then
3884 case "$nopath_ok" in
3885 true) case "$value" in
3887 *) echo "Assuming $value will be in people's path."
3903 if test "$fastread" = yes; then
3908 rp="$what $value doesn't exist. Use that name anyway?"
3927 test "X$gfpthkeep" != Xy && gfpth=""
3930 : determine root of directory hierarchy where package will be installed.
3933 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
3936 dflt=`echo "$prefix" | sed 's/.$//'`
3944 By default, $package will be installed in $dflt/bin, manual pages
3945 under $dflt/man, etc..., i.e. with $dflt as prefix for all
3946 installation directories. Typically this is something like /usr/local.
3947 If you wish to have binaries under /usr/bin but other parts of the
3948 installation under /usr/local, that's ok: you will be prompted
3949 separately for each of the installation directories, the prefix being
3950 only used to set the defaults.
3954 rp='Installation prefix to use?'
3962 *) oldprefix="$prefix";;
3969 : allow them to override the AFS root
3972 *) afsroot=$afsroot ;;
3978 $define|true) afs=true ;;
3979 $undef|false) afs=false ;;
3980 *) if $test -d $afsroot; then
3988 echo "AFS may be running... I'll be extra cautious then..." >&4
3990 echo "AFS does not seem to be running..." >&4
3993 : determine installation prefix for where package is to be installed.
3997 Since you are running AFS, I need to distinguish the directory in which
3998 files will reside from the directory in which they are installed (and from
3999 which they are presumably copied to the former directory by occult means).
4002 case "$installprefix" in
4003 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
4004 *) dflt="$installprefix";;
4009 In some special cases, particularly when building $package for distribution,
4010 it is convenient to distinguish the directory in which files should be
4011 installed from the directory ($prefix) in which they will
4012 eventually reside. For most users, these two directories are the same.
4015 case "$installprefix" in
4017 *) dflt=$installprefix;;
4021 rp='What installation prefix should I use for installing files?'
4023 installprefix="$ans"
4024 installprefixexp="$ansexp"
4026 : Perform the prefixexp/installprefixexp correction if necessary
4027 cat <<EOS >installprefix
4030 cat <<'EOSC' >>installprefix
4031 : Change installation prefix, if necessary.
4032 if $test X"$prefix" != X"$installprefix"; then
4033 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
4035 eval "install${prefixvar}=\"\$${prefixvar}exp\""
4038 chmod +x installprefix
4039 $eunicefix installprefix
4041 : Set variables such as privlib and privlibexp from the output of ./getfile
4042 : performing the prefixexp/installprefixexp correction if necessary.
4043 cat <<EOS >setprefixvar
4046 cat <<'EOSC' >>setprefixvar
4047 eval "${prefixvar}=\"\$ans\""
4048 eval "${prefixvar}exp=\"\$ansexp\""
4051 chmod +x setprefixvar
4052 $eunicefix setprefixvar
4054 : set up the script used to warn in case of inconsistency
4063 '') echo "The $hint value for \$$var on this machine was \"$was\"!" >&4
4065 *) echo "Hmm. Based on the hints in hints/$hintfile.sh, " >&4
4066 echo "the $hint value for \$$var on this machine was \"$was\"!" >&4
4071 echo "*** WHOA THERE!!! ***" >&4
4072 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
4075 rp=" Keep the $hint value?"
4078 y) td=$was; tu=$was;;
4082 : function used to set '$1' to '$val'
4083 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
4085 $define$undef) . ./whoa; eval "$var=\$td";;
4086 $undef$define) . ./whoa; eval "$var=\$tu";;
4087 *) eval "$var=$val";;
4090 : get the patchlevel
4092 echo "Getting the current patchlevel..." >&4
4093 if $test -r $rsrc/patchlevel.h;then
4094 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
4095 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4096 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4097 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4098 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4099 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4100 perl_patchlevel=`egrep ',"(MAINT|SMOKE)[0-9][0-9]*"' $rsrc/patchlevel.h|tail -1|sed 's/[^0-9]//g'`
4109 $echo "(You do not have patchlevel.h. Eek.)"
4111 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
4112 version_patchlevel_string="version $patchlevel subversion $subversion"
4113 case "$perl_patchlevel" in
4115 *) perl_patchlevel=`echo $perl_patchlevel | sed 's/.* //'`
4116 version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel"
4120 $echo "(You have $package $version_patchlevel_string.)"
4124 : XXX Should be a Configure test for double-dots in filenames.
4125 version=`echo $revision $patchlevel $subversion | \
4126 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4127 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4128 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4131 version=`echo $revision $patchlevel $subversion | \
4132 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4133 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4134 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4137 : Special case the 5.005_xx maintenance series, which used 5.005
4138 : without any subversion label as a subdirectory in $sitelib
4139 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4140 api_versionstring='5.005'
4143 : Do we want threads support and if so, what type
4144 case "$usethreads" in
4145 $define|true|[yY]*) dflt='y';;
4146 *) # Catch case where user specified ithreads or 5005threads but
4147 # forgot -Dusethreads (A.D. 4/2002)
4148 case "$useithreads$use5005threads" in
4149 *$define*) dflt='y';;
4156 Perl can be built to offer a form of threading support on some systems
4157 To do so, Configure can be run with -Dusethreads.
4159 Note that Perl built with threading support runs slightly slower
4160 and uses slightly more memory than plain Perl.
4162 If this doesn't make any sense to you, just accept the default '$dflt'.
4164 rp='Build a threading Perl?'
4167 y|Y) val="$define" ;;
4173 if $test $patchlevel -lt 9; then
4174 case "$usethreads" in
4176 : Default to ithreads unless overridden on command line or with
4179 case "$use5005threads" in
4181 echo "5.005 threads are no longer supported"
4185 case "$useithreads" in
4186 $undef|false|[nN]*) dflt='n';;
4188 rp='Use the newer interpreter-based ithreads?'
4191 y|Y) val="$define" ;;
4196 : Now set use5005threads to the opposite value.
4197 case "$useithreads" in
4198 $define) val="$undef" ;;
4205 useithreads="$undef"
4206 use5005threads="$undef"
4210 case "$useithreads$use5005threads" in
4214 You cannot have both the ithreads and the 5.005 threads enabled
4215 at the same time. Disabling the 5.005 threads since they are
4216 much less stable than the ithreads.
4219 use5005threads="$undef"
4224 : perl-5.9.x and later
4226 if test X"$usethreads" = "X$define"; then
4227 case "$use5005threads" in
4231 5.005 threads has been removed for 5.10. Perl will be built using ithreads.
4238 use5005threads="$undef"
4239 useithreads="$usethreads"
4242 case "$d_oldpthreads" in
4243 '') : Configure tests would be welcome here. For now, assume undef.
4245 *) val="$d_oldpthreads" ;;
4251 : Look for a hint-file generated 'call-back-unit'. If the
4252 : user has specified that a threading perl is to be built,
4253 : we may need to set or change some other defaults.
4254 if $test -f usethreads.cbu; then
4255 echo "Your platform has some specific hints regarding threaded builds, using them..."
4258 case "$usethreads" in
4259 "$define"|true|[yY]*)
4261 (Your platform does not have any specific hints for threaded builds.
4262 Assuming POSIX threads, then.)
4268 : Check if multiplicity is required
4271 Perl can be built so that multiple Perl interpreters can coexist
4272 within the same Perl executable.
4275 case "$useithreads" in
4278 This multiple interpreter support is required for interpreter-based threads.
4282 *) case "$usemultiplicity" in
4283 $define|true|[yY]*) dflt='y';;
4287 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4288 rp='Build Perl for multiplicity?'
4291 y|Y) val="$define" ;;
4299 : Check if morebits is requested
4300 case "$usemorebits" in
4301 "$define"|true|[yY]*)
4302 use64bitint="$define"
4303 uselongdouble="$define"
4304 usemorebits="$define"
4306 *) usemorebits="$undef"
4310 : Determine the C compiler to be used
4316 rp="Use which C compiler?"
4320 : See whether they have no cc but they do have gcc
4322 if $test -f cc.cbu; then
4327 : make some quick guesses about what we are up against
4329 $echo $n "Hmm... $c"
4339 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
4340 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
4342 echo "Looks kind of like an OSF/1 system, but we'll see..."
4344 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4345 xxx=`./loc addbib blurfl $pth`
4346 if $test -f $xxx; then
4347 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4351 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4352 echo "Looks kind of like an extended USG system, but we'll see..."
4354 echo "Looks kind of like a USG system, but we'll see..."
4358 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4359 echo "Looks kind of like a BSD system, but we'll see..."
4363 echo "Looks kind of like a Version 7 system, but we'll see..."
4366 case "$eunicefix" in
4369 There is, however, a strange, musty smell in the air that reminds me of
4370 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4374 : it so happens the Eunice I know will not run shell scripts in Unix format
4378 echo "Congratulations. You aren't running Eunice."
4382 : Detect OS2. The p_ variable is set above in the Head.U unit.
4383 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4384 : semicolon as a patch separator
4389 I have the feeling something is not exactly right, however...don't tell me...
4390 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4391 (Or you may be running DOS with DJGPP.)
4396 if test -f /xenix; then
4397 echo "Actually, this looks more like a XENIX system..."
4402 echo "It's not Xenix..."
4407 if test -f /venix; then
4408 echo "Actually, this looks more like a VENIX system..."
4415 echo "Nor is it Venix..."
4418 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4419 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4422 : Check if we are using GNU gcc and what its version is
4424 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4428 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4430 printf("%s\n", __VERSION__);
4432 printf("%s\n", "1");
4438 if $cc -o try $ccflags $ldflags try.c; then
4439 gccversion=`$run ./try`
4440 case "$gccversion" in
4441 '') echo "You are not using GNU cc." ;;
4442 *) echo "You are using GNU cc $gccversion."
4448 echo "*** WHOA THERE!!! ***" >&4
4449 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4450 case "$knowitall" in
4452 echo " You'd better start hunting for one and let me know about it." >&4
4458 case "$gccversion" in
4459 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4461 case "$gccversion" in
4462 '') gccosandvers='' ;;
4463 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4464 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4466 case "$gccosandvers" in
4467 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4468 $osname$osvers) ;; # looking good
4469 $osname*) cat <<EOM >&4
4471 *** WHOA THERE!!! ***
4473 Your gcc has not been compiled for the exact release of
4474 your operating system ($gccosandvers versus $osname$osvers).
4476 In general it is a good idea to keep gcc synchronized with
4477 the operating system because otherwise serious problems
4478 may ensue when trying to compile software, like Perl.
4480 I'm trying to be optimistic here, though, and will continue.
4481 If later during the configuration and build icky compilation
4482 problems appear (headerfile conflicts being the most common
4483 manifestation), I suggest reinstalling the gcc to match
4484 your operating system release.
4488 *) gccosandvers='' ;; # failed to parse, better be silent
4496 # gcc 3.* complain about adding -Idirectories that they already know about,
4497 # so we will take those off from locincpth.
4498 case "$gccversion" in
4500 echo "main(){}">try.c
4501 for incdir in $locincpth; do
4502 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4503 grep '^c[cp]p*[01]: warning: changing search order '`
4504 if test "X$warn" != X; then
4505 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4511 : What should the include directory be ?
4513 $echo $n "Hmm... $c"
4517 if $test -f /bin/mips && /bin/mips; then
4518 echo "Looks like a MIPS system..."
4519 $cat >usr.c <<'EOCP'
4520 #ifdef SYSTYPE_BSD43
4524 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4525 dflt='/bsd43/usr/include'
4529 mips_type='System V'
4531 $rm -f usr.c usr.out
4532 echo "and you're compiling with the $mips_type compiler and libraries."
4536 echo "Doesn't look like a MIPS system."
4546 case "$xxx_prompt" in
4549 rp='Where are the include files you want to use?'
4557 : see how we invoke the C preprocessor
4559 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4560 cat <<'EOT' >testcpp.c
4566 if test ! -f cppstdin; then
4567 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4568 # AIX cc -E doesn't show the absolute headerfile
4569 # locations but we'll cheat by using the -M flag.
4570 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
4572 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4575 echo "Keeping your $hint cppstdin wrapper."
4578 wrapper=`pwd`/cppstdin
4582 if $test "X$cppstdin" != "X" && \
4583 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4584 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4586 echo "You used to use $cppstdin $cppminus so we'll use that again."
4588 '') echo "But let's see if we can live without a wrapper..." ;;
4590 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4591 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4593 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4596 echo "(However, $cpprun $cpplast does not work, let's see...)"
4604 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4611 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4612 $cc -E <testcpp.c >testcpp.out 2>&1; \
4613 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4614 echo "Yup, it does."
4617 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4618 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4619 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4620 echo "Yup, it does."
4623 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4624 $cc -P <testcpp.c >testcpp.out 2>&1; \
4625 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4626 echo "Yipee, that works!"
4629 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4630 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4631 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4632 echo "At long last!"
4635 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4636 $cpp <testcpp.c >testcpp.out 2>&1; \
4637 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4641 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4642 $cpp - <testcpp.c >testcpp.out 2>&1; \
4643 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4644 echo "Hooray, it works! I was beginning to wonder."
4647 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4648 $wrapper <testcpp.c >testcpp.out 2>&1; \
4649 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4655 rp="No dice. I can't find a C preprocessor. Name one:"
4659 $x_cpp <testcpp.c >testcpp.out 2>&1
4660 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4661 echo "OK, that will do." >&4
4663 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4678 echo "Perhaps can we force $cc -E using a wrapper..."
4679 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4680 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4686 echo "Nope, we'll have to live without it..."
4700 "$wrapper"|'cppstdin') ;;
4701 *) $rm -f $wrapper;;
4703 $rm -f testcpp.c testcpp.out
4705 : Set private lib path
4708 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4713 '') dlist="$loclibpth $plibpth $glibpth";;
4714 *) dlist="$libpth";;
4717 : Now check and see which directories actually exist, avoiding duplicates
4721 if $test -d $xxx; then
4724 *) libpth="$libpth $xxx";;
4730 Some systems have incompatible or broken versions of libraries. Among
4731 the directories listed in the question below, please remove any you
4732 know not to be holding relevant libraries, and add any that are needed.
4733 Say "none" for none.
4744 rp="Directories to use for library searches?"
4751 : compute shared library extension
4754 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4764 On some systems, shared libraries may be available. Answer 'none' if
4765 you want to suppress searching of shared libraries for the remainder
4766 of this configuration.
4769 rp='What is the file extension used for shared libraries?'
4773 : Does target system insist that shared library basenames are unique
4776 Some dynamic loaders assume that the *basename* of shared
4777 library filenames are globally unique.
4778 We'll default this to undef as we assume your system is not this
4779 weird. Set to defined if you're on one of them.
4784 rp='Make shared library basenames unique?'
4787 y|Y) val="$define" ;;
4790 set d_libname_unique
4793 : Define several unixisms.
4794 : Hints files or command line option can be used to override them.
4795 : The convoluted testing is in case hints files set either the old
4798 '') case "$exe_ext" in
4800 *) _exe="$exe_ext" ;;
4805 '') case "$lib_ext" in
4812 '') case "$obj_ext" in
4819 '') case "$path_sep" in
4830 rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
4832 : Which makefile gets called first. This is used by make depend.
4833 case "$firstmakefile" in
4834 '') firstmakefile='makefile';;
4837 : Check is we will use socks
4839 $define|true|[yY]*) dflt='y';;
4844 Perl can be built to use the SOCKS proxy protocol library. To do so,
4845 Configure must be run with -Dusesocks. If you use SOCKS you also need
4846 to use the PerlIO abstraction layer, this will be implicitly selected.
4848 If this doesn't make any sense to you, just accept the default '$dflt'.
4850 rp='Build Perl for SOCKS?'
4853 y|Y) val="$define" ;;
4859 : Check for uselongdouble support
4861 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
4864 case "$uselongdouble" in
4865 $define|true|[yY]*) dflt='y';;
4870 Perl can be built to take advantage of long doubles which
4871 (if available) may give more accuracy and range for floating point numbers.
4873 If this doesn't make any sense to you, just accept the default '$dflt'.
4875 rp='Try to use long doubles if available?'
4878 y|Y) val="$define" ;;
4884 case "$uselongdouble" in
4885 true|[yY]*) uselongdouble="$define" ;;
4888 : Look for a hint-file generated 'call-back-unit'. If the
4889 : user has specified that long doubles should be used,
4890 : we may need to set or change some other defaults.
4891 if $test -f uselongdouble.cbu; then
4892 echo "Your platform has some specific hints regarding long doubles, using them..."
4893 . ./uselongdouble.cbu
4895 case "$uselongdouble" in
4898 (Your platform does not have any specific hints for long doubles.)
4904 : Looking for optional libraries
4906 echo "Checking for optional libraries..." >&4
4911 case "$libswanted" in
4912 '') libswanted='c_s';;
4915 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4921 for thisdir in $libpth $xlibpth; do
4922 test -d $thisdir && libspath="$libspath $thisdir"
4924 for thislib in $libswanted; do
4925 for thisdir in $libspath; do
4927 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4928 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
4929 $test -f "$xxx" && eval $libscheck
4930 $test -f "$xxx" && libstyle=shared
4932 if test ! -f "$xxx"; then
4933 xxx=$thisdir/lib$thislib.$so
4934 $test -f "$xxx" && eval $libscheck
4935 $test -f "$xxx" && libstyle=shared
4937 if test ! -f "$xxx"; then
4938 xxx=$thisdir/lib$thislib$_a
4939 $test -f "$xxx" && eval $libscheck
4940 $test -f "$xxx" && libstyle=static
4942 if test ! -f "$xxx"; then
4943 xxx=$thisdir/$thislib$_a
4944 $test -f "$xxx" && eval $libscheck
4945 $test -f "$xxx" && libstyle=static
4947 if test ! -f "$xxx"; then
4948 xxx=$thisdir/lib${thislib}_s$_a
4949 $test -f "$xxx" && eval $libscheck
4950 $test -f "$xxx" && libstyle=static
4951 $test -f "$xxx" && thislib=${thislib}_s
4953 if test ! -f "$xxx"; then
4954 xxx=$thisdir/Slib$thislib$_a
4955 $test -f "$xxx" && eval $libscheck
4956 $test -f "$xxx" && libstyle=static
4958 if $test -f "$xxx"; then
4960 shared) echo "Found -l$thislib (shared)." ;;
4961 static) echo "Found -l$thislib." ;;
4962 *) echo "Found -l$thislib ($libstyle)." ;;
4966 *) dflt="$dflt -l$thislib"
4967 libsfound="$libsfound $xxx"
4969 libsfiles="$libsfiles $yyy"
4970 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
4971 case " $libsdirs " in
4973 *) libsdirs="$libsdirs $yyy" ;;
4980 if $test ! -f "$xxx"; then
4981 echo "No -l$thislib."
4992 ' '|'') dflt='none';;
4997 In order to compile $package on your machine, a number of libraries
4998 are usually needed. Include any other special libraries here as well.
4999 Say "none" for none. The default list is almost always right.
5003 rp="What libraries to use?"
5010 : determine optimization, if desired, or use for debug flag also
5012 ' '|$undef) dflt='none';;
5014 *) dflt="$optimize";;
5018 By default, $package compiles with the -O flag to use the optimizer.
5019 Alternately, you might want to use the symbolic debugger, which uses
5020 the -g flag (on traditional Unix systems). Either flag can be
5021 specified here. To use neither flag, specify the word "none".
5024 rp="What optimizer/debugger flag should be used?"
5028 'none') optimize=" ";;
5031 : Check what DEBUGGING is required from the command line
5032 : -DEBUGGING or -DDEBUGGING or
5033 : -DEBUGGING=both = -g + -DDEBUGGING
5034 : -DEBUGGING=-g or -Doptimize=-g = -g
5035 : -DEBUGGING=none or -UDEBUGGING =
5036 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
5039 *) DEBUGGING=$EBUGGING ;;
5042 case "$DEBUGGING" in
5046 *) optimize="$optimize -g" ;;
5050 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
5058 case "$DEBUGGING" in
5059 both|$define) dflt='-DDEBUGGING'
5062 : argument order is deliberate, as the flag will start with - which set could
5063 : think is an option
5064 checkccflag='check=$1; flag=$2; callback=$3;
5066 echo "Checking if your compiler accepts $flag" 2>&1;
5067 echo "int main(void) { return 0; }" > gcctest.c;
5068 if $cc -O2 $flag -o gcctest gcctest.c 2>gcctest.out && ./gcctest; then
5069 echo "Yes, it does." 2>&1;
5070 if $test -s gcctest.out ; then
5071 echo "But your platform does not like it:";
5076 echo "Leaving current flags $ccflags alone." 2>&1
5078 *) dflt="$dflt $flag";
5084 echo "Nope, it does not, but that is ok." 2>&1;
5088 : We will not override a previous value, but we might want to
5089 : augment a hint file
5091 default|recommended)
5092 case "$gccversion" in
5093 1*) dflt="$dflt -fpcc-struct-return" ;;
5095 case "$optimize:$DEBUGGING" in
5096 *-g*:old) dflt="$dflt -DDEBUGGING";;
5098 case "$gccversion" in
5099 2*) if $test -d /etc/conf/kconfig.d &&
5100 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
5102 # Interactive Systems (ISC) POSIX mode.
5107 case "$gccversion" in
5110 ?*) set strict-aliasing -fno-strict-aliasing
5114 # For gcc, adding -pipe speeds up compilations for some, but apparently
5115 # some assemblers can't read from stdin. (It also slows down compilations
5116 # in other cases, but those are apparently rarer these days.) AD 5/2004.
5117 case "$gccversion" in
5123 # on x86_64 (at least) we require an extra library (libssp) in the
5124 # link command line. This library is not named, so I infer that it is
5125 # an implementation detail that may change. Hence the safest approach
5126 # is to add the flag to the flags passed to the compiler at link time,
5127 # as that way the compiler can do the right implementation dependant
5129 case "$gccversion" in
5130 ?*) set stack-protector -fstack-protector
5137 case "$mips_type" in
5138 *BSD*|'') inclwanted="$locincpth $usrinc";;
5139 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
5141 for thisincl in $inclwanted; do
5142 if $test -d $thisincl; then
5143 if $test x$thisincl != x$usrinc; then
5145 *" -I$thisincl "*);;
5146 *) dflt="$dflt -I$thisincl ";;
5152 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
5154 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5162 *) dflt="$dflt -D$2";;
5166 set signal.h LANGUAGE_C; eval $inctest
5170 ccflags="$ccflags -DSOCKS"
5175 default|recommended) dflt="$ccflags $dflt" ;;
5176 *) dflt="$ccflags";;
5185 Your C compiler may want other flags. For this question you should include
5186 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5187 but you should NOT include libraries or ld flags like -lwhatever. If you
5188 want $package to honor its debug switch, you should include -DDEBUGGING here.
5189 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5191 To use no flags, specify the word "none".
5197 rp="Any additional cc flags?"
5204 : the following weeds options from ccflags that are of no interest to cpp
5206 '') cppflags="$ccflags" ;;
5207 *) cppflags="$cppflags $ccflags" ;;
5209 case "$gccversion" in
5210 1*) cppflags="$cppflags -D__GNUC__"
5212 case "$mips_type" in
5214 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5220 echo "Let me guess what the preprocessor flags are..." >&4
5234 *) ftry="$previous $flag";;
5236 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5237 >cpp1.out 2>/dev/null && \
5238 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5239 >cpp2.out 2>/dev/null && \
5240 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5241 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5243 cppflags="$cppflags $ftry"
5253 *-*) echo "They appear to be: $cppflags";;
5255 $rm -f cpp.c cpp?.out
5259 : flags used in final linking phase
5261 '') if ./venix; then
5267 *-posix*) dflt="$dflt -posix" ;;
5270 *) dflt="$ldflags";;
5272 # See note above about -fstack-protector
5274 *-fstack-protector*)
5276 *-fstack-protector*) ;; # Don't add it again
5277 *) dflt="$dflt -fstack-protector" ;;
5282 : Try to guess additional flags to pick up local libraries.
5283 for thislibdir in $libpth; do
5284 case " $loclibpth " in
5287 *"-L$thislibdir "*) ;;
5288 *) dflt="$dflt -L$thislibdir" ;;
5300 Your C linker may need flags. For this question you should
5301 include -L/whatever and any other flags used by the C linker, but you
5302 should NOT include libraries like -lwhatever.
5304 Make sure you include the appropriate -L/path flags if your C linker
5305 does not normally search all of the directories you specified above,
5308 To use no flags, specify the word "none".
5312 rp="Any additional ld flags (NOT including libraries)?"
5318 rmlist="$rmlist pdp11"
5322 echo "Checking your choice of C compiler and flags for coherency..." >&4
5323 $cat > try.c <<'EOF'
5325 int main() { printf("Ok\n"); return(0); }
5327 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5329 $cat >try.msg <<'EOM'
5330 I've tried to compile and run the following simple program:
5333 $cat try.c >> try.msg
5335 $cat >> try.msg <<EOM
5342 and I got the following output:
5346 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5347 if $sh -c "$run ./try " >>try.msg 2>&1; then
5351 *) echo 'The program compiled OK, but produced no output.' >> try.msg ;;
5354 echo "The program compiled OK, but exited with status $?." >>try.msg
5355 rp="You have a problem. Shall I abort Configure"
5359 echo "I can't compile the test program." >>try.msg
5360 rp="You have a BIG problem. Shall I abort Configure"
5366 case "$knowitall" in
5368 echo "(The supplied flags or libraries might be incorrect.)"
5376 *) echo "Ok. Stopping Configure." >&4
5381 n) echo "OK, that should do.";;
5383 $rm_try gcctest gcctest.out
5385 : define a shorthand compile call
5389 case "$usedevel" in $define|true|[yY]*) if $test ! -f "${mc_file}.c"; then
5390 echo "Internal Configure script bug - compiler test file ${mc_file}.c is missing. Please report this to perlbug@perl.org" >&4;
5394 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5395 : define a shorthand compile call for compilations that should be ok.
5399 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5401 : determine filename position in cpp output
5403 echo "Computing filename position in cpp output for #include directives..." >&4
5405 vos) testaccess=-e ;;
5408 echo '#include <stdio.h>' > foo.c
5411 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5412 $grep '^[ ]*#.*stdio\.h' | \
5413 while read cline; do
5416 while $test \$# -gt 0; do
5417 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5422 pos=\`expr \$pos + 1\`
5434 *) pos="${fieldn}th";;
5436 echo "Your cpp writes the filename in the $pos field of the line."
5439 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
5440 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
5443 : locate header file
5448 for usrincdir in $usrinc
5450 if test -f \$usrincdir/\$wanted; then
5451 echo "\$usrincdir/\$wanted"
5455 awkprg='{ print \$$fieldn }'
5456 echo "#include <\$wanted>" > foo\$\$.c
5457 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5458 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5459 while read cline; do
5460 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5462 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5463 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5468 # status = 0: grep returned 0 lines, case statement not executed
5469 # status = 1: headerfile found
5470 # status = 2: while loop executed, no headerfile found
5474 if test \$status -eq 1; then
5481 : define an alternate in-header-list? function
5482 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5483 cont=true; xxf="echo \"<\$1> found.\" >&4";
5484 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5485 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5487 case $# in 4) instead=instead;; *) instead="at last";; esac;
5488 while $test "$cont"; do
5490 var=$2; eval "was=\$$2";
5491 if $test "$xxx" && $test -r "$xxx";
5493 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5496 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5497 set $yyy; shift; shift; yyy=$@;
5498 case $# in 0) cont="";;
5499 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5500 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5501 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5502 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5506 do set $yyy; var=$2; eval "was=\$$2";
5507 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5508 set $yyy; shift; shift; yyy=$@;
5511 : see if stdlib is available
5512 set stdlib.h i_stdlib
5515 : check for lengths of integral types
5519 echo "Checking to see how big your integers are..." >&4
5528 printf("intsize=%d;\n", (int)sizeof(int));
5529 printf("longsize=%d;\n", (int)sizeof(long));
5530 printf("shortsize=%d;\n", (int)sizeof(short));
5535 if eval $compile_ok && $run ./try > /dev/null; then
5537 echo "Your integers are $intsize bytes long."
5538 echo "Your long integers are $longsize bytes long."
5539 echo "Your short integers are $shortsize bytes long."
5543 Help! I can't compile and run the intsize test program: please enlighten me!
5544 (This is probably a misconfiguration in your system or libraries, and
5545 you really ought to fix it. Still, I'll try anyway.)
5549 rp="What is the size of an integer (in bytes)?"
5553 rp="What is the size of a long integer (in bytes)?"
5557 rp="What is the size of a short integer (in bytes)?"
5565 : check for long long
5567 echo "Checking to see if you have long long..." >&4
5568 echo 'int main() { long long x = 7; return 0; }' > try.c
5570 if eval $compile; then
5572 echo "You have long long."
5575 echo "You do not have long long."
5581 : check for length of long long
5582 case "${d_longlong}${longlongsize}" in
5585 echo "Checking to see how big your long longs are..." >&4
5586 $cat >try.c <<'EOCP'
5590 printf("%d\n", (int)sizeof(long long));
5595 if eval $compile_ok; then
5596 longlongsize=`$run ./try`
5597 echo "Your long longs are $longlongsize bytes long."
5601 echo "(I can't seem to compile the test program. Guessing...)"
5602 rp="What is the size of a long long (in bytes)?"
5606 if $test "X$longsize" = "X$longlongsize"; then
5607 echo "(That isn't any different from an ordinary long.)"
5613 : see if inttypes.h is available
5614 : we want a real compile instead of Inhdr because some systems
5615 : have an inttypes.h which includes non-existent headers
5618 #include <inttypes.h>
5620 static int32_t foo32 = 0x12345678;
5624 if eval $compile; then
5625 echo "<inttypes.h> found." >&4
5628 echo "<inttypes.h> NOT found." >&4
5637 echo "Checking to see if you have int64_t..." >&4
5639 #include <sys/types.h>
5640 #$i_inttypes I_INTTYPES
5642 #include <inttypes.h>
5644 int main() { int64_t x = 7; }
5647 if eval $compile; then
5649 echo "You have int64_t."
5652 echo "You do not have int64_t."
5658 : Check if 64bit ints have a quad type
5660 echo "Checking which 64-bit integer type we could use..." >&4
5666 val='"unsigned int"'
5671 *) case "$longsize" in
5675 val='"unsigned long"'
5680 *) case "$d_longlong:$longlongsize" in
5685 val='"unsigned long long"'
5690 *) case "$d_int64_t" in
5709 '') echo "Alas, no 64-bit integer types in sight." >&4
5712 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5717 : Do we want 64bit support
5718 case "$uselonglong" in
5719 "$define"|true|[yY]*)
5722 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5724 use64bitint="$define"
5727 case "$use64bits" in
5728 "$define"|true|[yY]*)
5731 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5733 use64bitint="$define"
5736 case "$use64bitints" in
5737 "$define"|true|[yY]*)
5740 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5742 use64bitint="$define"
5745 case "$use64bitsint" in
5746 "$define"|true|[yY]*)
5749 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5751 use64bitint="$define"
5754 case "$uselonglongs" in
5755 "$define"|true|[yY]*)
5758 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5760 use64bitint="$define"
5763 case "$use64bitsall" in
5764 "$define"|true|[yY]*)
5767 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
5769 use64bitall="$define"
5774 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
5776 case "$use64bitall" in
5777 "$define"|true|[yY]*) use64bitint="$define" ;;
5783 You have natively 64-bit long integers.
5787 *) case "$use64bitint" in
5788 "$define"|true|[yY]*) dflt='y';;
5797 Perl can be built to take advantage of 64-bit integer types
5798 on some systems. To do so, Configure can be run with -Duse64bitint.
5799 Choosing this option will most probably introduce binary incompatibilities.
5801 If this doesn't make any sense to you, just accept the default '$dflt'.
5802 (The default has been chosen based on your configuration.)
5804 rp='Try to use 64-bit integers, if available?'
5807 [yY]*) val="$define" ;;
5815 case "$use64bitall" in
5816 "$define"|true|[yY]*) dflt='y' ;;
5817 *) case "$longsize" in
5825 You may also choose to try maximal 64-bitness. It means using as much
5826 64-bitness as possible on the platform. This in turn means even more
5827 binary incompatibilities. On the other hand, your platform may not
5828 have any more 64-bitness available than what you already have chosen.
5830 If this doesn't make any sense to you, just accept the default '$dflt'.
5831 (The default has been chosen based on your configuration.)
5833 rp='Try to use maximal 64-bit support, if available?'
5836 [yY]*) val="$define" ;;
5841 case "$use64bitall" in
5843 case "$use64bitint" in
5847 Since you have chosen a maximally 64-bit build, I'm also turning on
5848 the use of 64-bit integers.
5850 use64bitint="$define" ;;
5855 : Look for a hint-file generated 'call-back-unit'. If the
5856 : user has specified that a 64-bit perl is to be built,
5857 : we may need to set or change some other defaults.
5858 if $test -f use64bitint.cbu; then
5859 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
5862 case "$use64bitint" in
5863 "$define"|true|[yY]*)
5864 : This test was common to all the OpenBSD forks, and seems harmless for
5867 echo "Checking if your C library has broken 64-bit functions..." >&4
5870 typedef $uquadtype myULL;
5877 {4294967303.15, 4294967303ULL},
5878 {4294967294.2, 4294967294ULL},
5879 {4294967295.7, 4294967295ULL},
5882 for (p = test; p->u; p++) {
5883 myULL x = (myULL)p->d;
5894 if eval $compile_ok; then
5896 echo "Your C library's 64-bit functions are $libcquad."
5898 echo "(I can't seem to compile the test program.)"
5899 echo "Assuming that your C library's 64-bit functions are ok."
5908 *** You have a C library with broken 64-bit functions.
5909 *** 64-bit support does not work reliably in this configuration.
5910 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
5911 *** Cannot continue, aborting.
5918 4) case "$archname64" in
5919 '') archname64=64int ;;
5926 : Look for a hint-file generated 'call-back-unit'. If the
5927 : user has specified that a maximally 64-bit perl is to be built,
5928 : we may need to set or change some other defaults.
5929 if $test -f use64bitall.cbu; then
5930 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
5933 case "$use64bitall" in
5934 "$define"|true|[yY]*)
5936 4) case "$archname64" in
5937 ''|64int) archname64=64all ;;
5944 case "$d_quad:$use64bitint" in
5948 *** You have chosen to use 64-bit integers,
5949 *** but none can be found.
5950 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
5951 *** Cannot continue, aborting.
5958 : check for length of double
5960 case "$doublesize" in
5962 echo "Checking to see how big your double precision numbers are..." >&4
5971 printf("%d\n", (int)sizeof(double));
5976 if eval $compile_ok; then
5977 doublesize=`$run ./try`
5978 echo "Your double is $doublesize bytes long."
5981 echo "(I can't seem to compile the test program. Guessing...)"
5982 rp="What is the size of a double precision number (in bytes)?"
5990 : check for long doubles
5992 echo "Checking to see if you have long double..." >&4
5993 echo 'int main() { long double x = 7.0; }' > try.c
5995 if eval $compile; then
5997 echo "You have long double."
6000 echo "You do not have long double."
6006 : check for length of long double
6007 case "${d_longdbl}${longdblsize}" in
6010 echo "Checking to see how big your long doubles are..." >&4
6011 $cat >try.c <<'EOCP'
6015 printf("%d\n", sizeof(long double));
6020 if eval $compile; then
6021 longdblsize=`$run ./try`
6022 echo "Your long doubles are $longdblsize bytes long."
6026 echo "(I can't seem to compile the test program. Guessing...)" >&4
6027 rp="What is the size of a long double (in bytes)?"
6031 if $test "X$doublesize" = "X$longdblsize"; then
6032 echo "That isn't any different from an ordinary double."
6033 echo "I'll keep your setting anyway, but you may see some"
6034 echo "harmless compilation warnings."
6040 : determine the architecture name
6042 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
6043 tarch=`arch`"-$osname"
6044 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
6045 if uname -m > tmparch 2>&1 ; then
6046 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
6047 -e 's/$/'"-$osname/" tmparch`
6055 case "$myarchname" in
6058 echo "(Your architecture name used to be $myarchname.)"
6062 case "$targetarch" in
6064 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
6069 *) dflt="$archname";;
6071 rp='What is your architecture name'
6075 : optionally add API version to the architecture for versioned archlibs
6076 case "$useversionedarchname" in
6077 $define|true|[yY]*) dflt='y';;
6080 rp='Add the Perl API version to your archname?'
6083 y|Y) useversionedarchname="$define" ;;
6084 *) useversionedarchname="$undef" ;;
6086 case "$useversionedarchname" in
6089 *-$api_versionstring)
6090 echo "...and architecture name already has -$api_versionstring" >&4
6093 archname="$archname-$api_versionstring"
6094 echo "...setting architecture name to $archname." >&4
6100 case "$usethreads" in
6102 echo "Threads selected." >&4
6104 *-thread*) echo "...and architecture name already has -thread." >&4
6106 *) archname="$archname-thread"
6107 echo "...setting architecture name to $archname." >&4
6112 case "$usemultiplicity" in
6114 echo "Multiplicity selected." >&4
6116 *-multi*) echo "...and architecture name already has -multi." >&4
6118 *) archname="$archname-multi"
6119 echo "...setting architecture name to $archname." >&4
6124 case "$use64bitint$use64bitall" in
6126 case "$archname64" in
6128 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
6131 case "$use64bitint" in
6132 "$define") echo "64 bit integers selected." >&4 ;;
6134 case "$use64bitall" in
6135 "$define") echo "Maximal 64 bitness selected." >&4 ;;
6138 *-$archname64*) echo "...and architecture name already has $archname64." >&4
6140 *) archname="$archname-$archname64"
6141 echo "...setting architecture name to $archname." >&4
6147 case "$uselongdouble" in
6149 echo "Long doubles selected." >&4
6150 case "$longdblsize" in
6152 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
6156 *-ld*) echo "...and architecture name already has -ld." >&4
6158 *) archname="$archname-ld"
6159 echo "...setting architecture name to $archname." >&4
6166 if $test -f archname.cbu; then
6167 echo "Your platform has some specific hints for architecture name, using them..."
6171 : set the prefixit variable, to compute a suitable default value
6172 prefixit='case "$3" in
6174 case "$oldprefix" in
6175 "") eval "$1=\"\$$2\"";;
6182 ""|" ") eval "$1=\"\$$2\"";;
6188 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
6190 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
6191 /*-$oldprefix/*|\~*-$oldprefix/*)
6192 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
6193 *) eval "$1=\"\$$2\"";;
6197 : determine installation style
6198 : For now, try to deduce it from prefix unless it is already set.
6199 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
6200 case "$installstyle" in
6201 '') case "$prefix" in
6202 *perl*) dflt='lib';;
6203 *) dflt='lib/perl5' ;;
6206 *) dflt="$installstyle" ;;
6208 : Probably not worth prompting for this since we prompt for all
6209 : the directories individually, and the prompt would be too long and
6213 : determine where public executables go
6218 rp='Pathname where the public executables will reside?'
6220 if $test "X$ansexp" != "X$binexp"; then
6224 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6225 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
6226 : this via initialinstalllocation
6229 case "$userelocatableinc" in
6230 $define|true|[yY]*) dflt='y' ;;
6235 Would you like to build Perl so that the installation is relocatable, so that
6236 library paths in @INC are determined relative to the path of the perl binary?
6237 This is not advised for system Perl installs, or if you need to run setid
6238 scripts or scripts under taint mode.
6240 If this doesn't make any sense to you, just accept the default '$dflt'.
6242 rp='Use relocatable @INC?'
6245 y|Y) val="$define" ;;
6248 set userelocatableinc
6251 initialinstalllocation="$binexp"
6252 : Default prefix is now "up one level from where the binaries are"
6253 case "$userelocatableinc" in
6259 installprefixexp=".../.."
6263 : determine where private library files go
6264 : Usual default is /usr/local/lib/perl5/$version.
6265 : Also allow things like /opt/perl/lib/$version, since
6266 : /opt/perl/lib/perl5... would be redundant.
6267 : The default "style" setting is made in installstyle.U
6268 case "$installstyle" in
6269 *lib/perl5*) set dflt privlib lib/$package/$version ;;
6270 *) set dflt privlib lib/$version ;;
6275 There are some auxiliary files for $package that need to be put into a
6276 private library directory that is accessible by everyone.
6281 rp='Pathname where the private library files will reside?'
6286 : set the prefixup variable, to restore leading tilda escape
6287 prefixup='case "$prefixexp" in
6289 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
6292 : determine where public architecture dependent libraries go
6295 : privlib default is /usr/local/lib/$package/$version
6296 : archlib default is /usr/local/lib/$package/$version/$archname
6297 : privlib may have an optional trailing /share.
6298 tdflt=`echo $privlib | $sed 's,/share$,,'`
6299 tdflt=$tdflt/$archname
6308 $spackage contains architecture-dependent library files. If you are
6309 sharing libraries in a heterogeneous environment, you might store
6310 these files in a separate location. Otherwise, you can just include
6311 them with the rest of the public library files.
6316 rp='Where do you want to put the public architecture-dependent libraries?'
6320 if $test X"$archlib" = X"$privlib"; then
6326 : see if setuid scripts can be secure
6329 Some kernels have a bug that prevents setuid #! scripts from being
6330 secure. Some sites have disabled setuid #! scripts because of this.
6332 First let's decide if your kernel supports secure setuid #! scripts.
6333 (If setuid #! scripts would be secure but have been disabled anyway,
6334 don't say that they are secure if asked.)
6339 if $test -d /dev/fd; then
6340 echo "#!$ls" >reflect
6341 chmod +x,u+s reflect
6342 ./reflect >flect 2>&1
6343 if $contains "/dev/fd" flect >/dev/null; then
6344 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6348 If you are not sure if they are secure, I can check but I'll need a
6349 username and password different from the one you are using right now.
6350 If you don't have such a username or don't want me to test, simply
6354 rp='Other username to test security of setuid scripts with?'
6359 case "$d_suidsafe" in
6360 '') echo "I'll assume setuid scripts are *not* secure." >&4
6363 echo "Well, the $hint value is *not* secure." >&4
6365 *) echo "Well, the $hint value *is* secure." >&4
6370 $rm -f reflect flect
6371 echo "#!$ls" >reflect
6372 chmod +x,u+s reflect
6375 echo '"su" will (probably) prompt you for '"$ans's password."
6376 su $ans -c './reflect >flect'
6377 if $contains "/dev/fd" flect >/dev/null; then
6378 echo "Okay, it looks like setuid scripts are secure." >&4
6381 echo "I don't think setuid scripts are secure." >&4
6386 rp='Does your kernel have *secure* setuid scripts?'
6389 [yY]*) val="$define";;
6394 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6395 echo "(That's for file descriptors, not floppy disks.)"
6401 $rm -f reflect flect
6403 : now see if they want to do setuid emulation
6404 if $test $patchlevel -lt 11; then
6407 case "$d_suidsafe" in
6410 echo "No need to emulate SUID scripts since they are secure here." >&4
6414 Some systems have disabled setuid scripts, especially systems where
6415 setuid scripts cannot be secure. On systems where setuid scripts have
6416 been disabled, the setuid/setgid bits on scripts are currently
6417 useless. It is possible for $package to detect those bits and emulate
6418 setuid/setgid in a secure fashion. This emulation will only work if
6419 setuid scripts have been disabled in your kernel.
6423 "$define") dflt=y ;;
6426 rp="Do you want to do setuid/setgid emulation?"
6429 [yY]*) val="$define";;
6441 SUID emulation has been removed for 5.12
6442 Please re-run Configure without -Dd_dosuid
6451 : Find perl5.005 or later.
6452 echo "Looking for a previously installed perl5.005 or later... "
6454 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
6455 : Check if this perl is recent and can load a simple module
6456 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6459 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6469 '') echo "None found. That's ok.";;
6470 *) echo "Using $perl5." ;;
6473 : Set the siteprefix variables
6476 After $package is installed, you may wish to install various
6477 add-on modules and utilities. Typically, these add-ons will
6478 be installed under $prefix with the rest
6479 of this package. However, you may wish to install such add-ons
6480 elsewhere under a different prefix.
6482 If you do not wish to put everything under a single prefix, that's
6483 ok. You will be prompted for the individual locations; this siteprefix
6484 is only used to suggest the defaults.
6486 The default should be fine for most people.
6490 rp='Installation prefix to use for add-on modules and utilities?'
6491 : XXX Here might be another good place for an installstyle setting.
6492 case "$siteprefix" in
6494 *) dflt=$siteprefix ;;
6497 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6499 case "$siteprefix" in
6503 *) oldsiteprefix="$prefix";;
6508 siteprefixexp="$ansexp"
6510 : determine where site specific libraries go.
6511 : Usual default is /usr/local/lib/perl5/site_perl/$version
6512 : The default "style" setting is made in installstyle.U
6513 : XXX No longer works with Prefixit stuff.
6514 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6516 '') case "$installstyle" in
6517 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6518 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6526 The installation process will create a directory for
6527 site-specific extensions and modules. Most users find it convenient
6528 to place all site-specific files in this directory rather than in the
6529 main distribution directory.
6533 rp='Pathname for the site-specific library files?'
6537 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6539 : Determine list of previous versions to include in @INC
6540 $cat > getverlist <<EOPL
6543 \$api_versionstring = "$api_versionstring";
6544 \$version = "$version";
6545 \$stem = "$sitelib_stem";
6546 \$archname = "$archname";
6548 $cat >> getverlist <<'EOPL'
6549 # The list found is store twice for each entry: the original name, and
6550 # the binary broken down version as pack "sss", so sorting is easy and
6551 # unambiguous. This will work for all versions that have a maximum of
6552 # three digit groups, separate by '.'s or '_'s. Names are extended with
6553 # ".0.0" to ensure at least three elements for the pack.
6554 # -- H.Merijn Brand (m)'06 23-10-2006
6556 # Can't have leading @ because metaconfig interprets it as a command!
6557 ;@inc_version_list=();
6558 # XXX Redo to do opendir/readdir?
6561 ;@candidates = map {
6562 [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
6563 ;@candidates = sort { $a->[1] cmp $b->[1]} @candidates;
6569 ($pversion, $aversion, $vsn5005) = map {
6570 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
6571 foreach $d (@candidates) {
6572 if ($d->[1] lt $pversion) {
6573 if ($d->[1] ge $aversion) {
6574 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
6576 elsif ($d->[1] ge $vsn5005) {
6577 unshift(@inc_version_list, grep { -d } $d->[0]);
6581 # Skip newer version. I.e. don't look in
6582 # 5.7.0 if we're installing 5.6.1.
6586 if (@inc_version_list) {
6587 print join(' ', @inc_version_list);
6590 # Blank space to preserve value for next Configure run.
6595 case "$inc_version_list" in
6596 '') if test -x "$perl5$exe_ext"; then
6597 dflt=`$perl5 getverlist`
6602 $undef) dflt='none' ;;
6603 *) eval dflt=\"$inc_version_list\" ;;
6606 ''|' ') dflt=none ;;
6613 In order to ease the process of upgrading, this version of perl
6614 can be configured to use modules built and installed with earlier
6615 versions of perl that were installed under $prefix. Specify here
6616 the list of earlier versions that this version of perl should check.
6617 If Configure detected no earlier versions of perl installed under
6618 $prefix, then the list will be empty. Answer 'none' to tell perl
6619 to not search earlier versions.
6621 The default should almost always be sensible, so if you're not sure,
6622 just accept the default.
6625 rp='List of earlier versions to include in @INC?'
6628 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
6629 *) inc_version_list="$ans" ;;
6631 case "$inc_version_list" in
6633 inc_version_list_init='0'
6634 d_inc_version_list="$undef"
6636 *) inc_version_list_init=`echo $inc_version_list |
6637 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6638 d_inc_version_list="$define"
6643 : see if malloc/malloc.h has to be included
6644 set malloc/malloc.h i_mallocmalloc
6647 : see if this is a malloc.h system
6648 : we want a real compile instead of Inhdr because some systems have a
6649 : malloc.h that just gives a compile error saying to use stdlib.h instead
6654 #$i_mallocmalloc I_MALLOCMALLOC
6655 #ifdef I_MALLOCMALLOC
6656 # include <malloc/malloc.h>
6659 int main () { return 0; }
6662 if eval $compile; then
6663 echo "<malloc.h> found." >&4
6666 echo "<malloc.h> NOT found." >&4
6673 : check for length of pointer
6677 echo "Checking to see how big your pointers are..." >&4
6686 printf("%d\n", (int)sizeof(void *));
6691 if eval $compile_ok; then
6692 ptrsize=`$run ./try`
6693 echo "Your pointers are $ptrsize bytes long."
6696 echo "(I can't seem to compile the test program. Guessing...)" >&4
6697 rp="What is the size of a pointer (in bytes)?"
6704 case "$use64bitall" in
6705 "$define"|true|[yY]*)
6709 *** You have chosen a maximally 64-bit build,
6710 *** but your pointers are only 4 bytes wide.
6711 *** Please rerun Configure without -Duse64bitall.
6716 *** Since you have quads, you could possibly try with -Duse64bitint.
6721 *** Cannot continue, aborting.
6732 : determine whether to use malloc wrapping
6734 case "$usemallocwrap" in
6735 [yY]*|true|$define) dflt='y' ;;
6736 [nN]*|false|$undef) dflt='n' ;;
6737 *) case "$usedevel" in
6738 [yY]*|true|$define) dflt='y' ;;
6743 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
6745 usemallocwrap="$ans"
6748 usemallocwrap="$define" ;;
6750 usemallocwrap="$undef" ;;
6753 : determine which malloc to compile in
6755 case "$usemymalloc" in
6756 [yY]*|true|$define) dflt='y' ;;
6757 [nN]*|false|$undef) dflt='n' ;;
6758 *) case "$ptrsize" in
6762 if test "$useithreads" = "$define"; then dflt='n'; fi
6765 rp="Do you wish to attempt to use the malloc that comes with $package?"
6771 mallocsrc='malloc.c'
6772 mallocobj="malloc$_o"
6773 d_mymalloc="$define"
6776 : Remove malloc from list of libraries to use
6777 echo "Removing unneeded -lmalloc from library list" >&4
6778 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6781 echo "libs = $libs" >&4
6793 : compute the return types of malloc and free
6795 $cat >malloc.c <<END
6799 #include <sys/types.h>
6813 case "$malloctype" in
6815 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6822 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6826 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6833 echo "Your system uses $freetype free(), it would seem." >&4
6835 : determine where site specific architecture-dependent libraries go.
6836 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6837 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6838 : sitelib may have an optional trailing /share.
6840 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6841 dflt="$dflt/$archname"
6846 set sitearch sitearch none
6850 The installation process will also create a directory for
6851 architecture-dependent site-specific extensions and modules.
6855 rp='Pathname for the site-specific architecture-dependent library files?'
6859 if $test X"$sitearch" = X"$sitelib"; then
6862 d_sitearch="$define"
6865 : Set the vendorprefix variables
6868 The installation process will also create a directory for
6869 vendor-supplied add-ons. Vendors who supply perl with their system
6870 may find it convenient to place all vendor-supplied files in this
6871 directory rather than in the main distribution directory. This will
6872 ease upgrades between binary-compatible maintenance versions of perl.
6874 Of course you may also use these directories in whatever way you see
6875 fit. For example, you might use them to access modules shared over a
6876 company-wide network.
6878 The default answer should be fine for most people.
6879 This causes further questions about vendor add-ons to be skipped
6880 and no vendor-specific directories will be configured for perl.
6883 rp='Do you want to configure vendor-specific add-on directories?'
6884 case "$usevendorprefix" in
6885 define|true|[yY]*) dflt=y ;;
6886 *) : User may have set vendorprefix directly on Configure command line.
6887 case "$vendorprefix" in
6896 rp='Installation prefix to use for vendor-supplied add-ons?'
6897 case "$vendorprefix" in
6898 '') dflt="$prefix" ;;
6899 *) dflt=$vendorprefix ;;
6902 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6904 case "$vendorprefix" in
6908 *) oldvendorprefix="$prefix";;
6912 usevendorprefix="$define"
6914 vendorprefixexp="$ansexp"
6916 *) usevendorprefix="$undef"
6922 : Set the vendorlib variables
6923 case "$vendorprefix" in
6924 '') d_vendorlib="$undef"
6928 *) d_vendorlib="$define"
6929 : determine where vendor-supplied modules go.
6930 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
6931 case "$vendorlib" in
6933 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6934 case "$installstyle" in
6935 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
6936 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
6939 *) dflt="$vendorlib"
6943 rp='Pathname for the vendor-supplied library files?'
6946 vendorlibexp="$ansexp"
6949 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
6953 : Set the vendorarch variables
6954 case "$vendorprefix" in
6955 '') d_vendorarch="$undef"
6959 *) d_vendorarch="$define"
6960 : determine where vendor-supplied architecture-dependent libraries go.
6961 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
6962 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
6963 : vendorlib may have an optional trailing /share.
6964 case "$vendorarch" in
6965 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
6966 dflt="$dflt/$archname"
6968 *) dflt="$vendorarch" ;;
6971 rp='Pathname for vendor-supplied architecture-dependent files?'
6974 vendorarchexp="$ansexp"
6977 prefixvar=vendorarch
6979 if $test X"$vendorarch" = X"$vendorlib"; then
6980 d_vendorarch="$undef"
6982 d_vendorarch="$define"
6985 : Final catch-all directories to search
6988 Lastly, you can have perl look in other directories for extensions and
6989 modules in addition to those already specified.
6990 These directories will be searched after
6994 test X"$vendorlib" != "X" && echo ' ' $vendorlib
6995 test X"$vendorarch" != "X" && echo ' ' $vendorarch
6997 case "$otherlibdirs" in
6998 ''|' ') dflt='none' ;;
6999 *) dflt="$otherlibdirs" ;;
7002 Enter a colon-separated set of extra paths to include in perl's @INC
7003 search path, or enter 'none' for no extra paths.
7007 rp='Colon-separated list of additional directories for perl to search?'
7010 ' '|''|none) otherlibdirs=' ' ;;
7011 *) otherlibdirs="$ans" ;;
7013 case "$otherlibdirs" in
7017 set d_perl_otherlibdirs
7020 : Cruising for prototypes
7022 echo "Checking out function prototypes..." >&4
7023 $cat >prototype.c <<EOCP
7028 int main(int argc, char *argv[]) {
7031 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
7032 echo "Your C compiler appears to support function prototypes."
7035 echo "Your C compiler doesn't seem to understand function prototypes."
7042 : Check if ansi2knr is required
7043 case "$prototype" in
7045 *) ansi2knr='ansi2knr'
7050 This version of $package can only be compiled by a compiler that
7051 understands function prototypes. Unfortunately, your C compiler
7053 doesn't seem to understand them. Sorry about that.
7055 If GNU cc is available for your system, perhaps you could try that instead.
7057 Eventually, we hope to support building Perl with pre-ANSI compilers.
7058 If you would like to help in that effort, please contact <perlbug@perl.org>.
7060 Aborting Configure now.
7067 dflt_dtrace='/usr/sbin/dtrace'
7068 $test -x /usr/bin/dtrace && dflt_dtrace='/usr/bin/dtrace'
7072 Perl can be built to support DTrace on platforms that support it.
7073 DTrace is a diagnosis and performance analysis tool from Sun.
7075 If this doesn't make any sense to you, just accept the default '$dflt'.
7079 case "$usedtrace" in
7085 dflt_dtrace=$usedtrace
7092 rp='Support DTrace if available?'
7095 y|Y) val="$define" ;;
7101 test "X$usedtrace" != "X$define" && break
7104 rp='Where is the dtrace executable?'
7113 if $dtrace -h -s ../perldtrace.d \
7114 -o perldtrace.tmp >/dev/null 2>&1 \
7115 && rm -f perldtrace.tmp
7118 echo "Good: your $dtrace knows about the -h flag."
7122 *** $me: Fatal Error: $dtrace doesn't support -h flag
7124 *** Your installed dtrace doesn't support the -h switch to compile a D
7125 *** program into a C header. Can't continue.
7137 *** $me: Fatal Error: $dtrace not found.
7144 echo "*** $dtrace was not found."
7150 : See if we want extra modules installed
7157 Perl can be built with extra modules or bundles of modules which
7158 will be fetched from the CPAN and installed alongside Perl.
7160 Notice that you will need access to the CPAN; either via the Internet,
7161 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
7162 be asked later to configure the CPAN.pm module which will in turn do
7163 the installation of the rest of the extra modules or bundles.)
7165 Notice also that if the modules require any external software such as
7166 libraries and headers (the libz library and the zlib.h header for the
7167 Compress::Zlib module, for example) you MUST have any such software
7168 already installed, this configuration process will NOT install such
7171 If this doesn't make any sense to you, just accept the default '$dflt'.
7173 rp='Install any extra modules (y or n)?'
7179 Please list any extra modules or bundles to be installed from CPAN,
7180 with spaces between the names. The names can be in any format the
7181 'install' command of CPAN.pm will understand. (Answer 'none',
7182 without the quotes, to install no extra modules or bundles.)
7192 $rm -f ../extras.lst
7194 *) echo "(Saving the list of extras for later...)"
7195 echo "$extras" > ../extras.lst
7203 : determine where html pages for programs go
7204 set html1dir html1dir none
7208 If you wish to install html files for programs in $spackage, indicate
7209 the appropriate directory here. To skip installing html files,
7213 ''|none|$undef|' ') dflt=none ;;
7214 *) dflt=$html1dir ;;
7217 rp="Directory for the main $spackage html pages?"
7221 : Use ' ' for none so value is preserved next time through Configure
7222 $test X"$html1dir" = "X" && html1dir=' '
7224 : determine where html pages for libraries and modules go
7225 set html3dir html3dir none
7229 If you wish to install html files for modules associated with $spackage,
7230 indicate the appropriate directory here. To skip installing html files,
7233 : There is no obvious default. If they have specified html1dir, then
7234 : try to key off that, possibly changing .../html1 into .../html3.
7236 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
7237 *) dflt=$html3dir ;;
7240 rp="Directory for the $spackage module html pages?"
7244 : Use ' ' for none so value is preserved next time through Configure
7245 $test X"$html3dir" = "X" && html3dir=' '
7247 : determine whether to install perl also as /usr/bin/perl
7250 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
7252 Many scripts expect perl to be installed as /usr/bin/perl.
7254 If you want to, I can install the perl you are about to compile
7255 as /usr/bin/perl (in addition to $bin/perl).
7257 if test -f /usr/bin/perl; then
7260 However, please note that because you already have a /usr/bin/perl,
7261 overwriting that with a new Perl would very probably cause problems.
7262 Therefore I'm assuming you don't want to do that (unless you insist).
7265 case "$installusrbinperl" in
7266 "$define"|[yY]*) dflt='y';;
7272 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
7275 case "$installusrbinperl" in
7276 "$undef"|[nN]*) dflt='n';;
7280 rp="Do you want to install perl as /usr/bin/perl?"
7283 [yY]*) val="$define";;
7289 set installusrbinperl
7292 : Check if we are using the GNU C library
7294 echo "Checking for GNU C Library..." >&4
7296 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
7297 alone are insufficient to distinguish different versions, such as
7298 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
7299 libc version 2.1.0. A. Dougherty, June 3, 2002.
7305 # ifdef __GLIBC_MINOR__
7306 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
7307 # include <gnu/libc-version.h>
7308 printf("%s\n", gnu_get_libc_version());
7310 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
7313 printf("%d\n", __GLIBC__);
7322 if eval $compile_ok && $run ./try > glibc.ver; then
7324 gnulibc_version=`$cat glibc.ver`
7325 echo "You are using the GNU C Library version $gnulibc_version"
7329 echo "You are not using the GNU C Library"
7335 : see if nm is to be used to determine whether a symbol is defined or not
7339 case "$d_gnulibc" in
7342 echo "nm probably won't work on the GNU C Library." >&4
7348 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
7350 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
7351 echo "'nm' won't be sufficient on this system." >&4
7357 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
7358 if $test $dflt -gt 20; then
7368 true|$define) dflt=y;;
7375 I can use $nm to extract the symbols from your C libraries. This
7376 is a time consuming task which may generate huge output on the disk (up
7377 to 3 megabytes) but that should make the symbols extraction faster. The
7378 alternative is to skip the 'nm' extraction part and to compile a small
7379 test program instead to determine whether each symbol is present. If
7380 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
7381 this may be the best solution.
7383 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
7386 rp="Shall I use $nm to extract C symbols from the libraries?"
7389 [Nn]*) usenm=false;;
7398 : nm options which may be necessary
7400 '') if $test -f /mach_boot; then
7402 elif $test -d /usr/ccs/lib; then
7403 nm_opt='-p' # Solaris (and SunOS?)
7404 elif $test -f /dgux; then
7406 elif $test -f /lib64/rld; then
7407 nm_opt='-p' # 64-bit Irix
7413 : nm options which may be necessary for shared libraries but illegal
7414 : for archive libraries. Thank you, Linux.
7415 case "$nm_so_opt" in
7416 '') case "$myuname" in
7418 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
7419 nm_so_opt='--dynamic'
7426 : Figure out where the libc is located
7429 : get list of predefined functions in a handy place
7434 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
7440 *) for thislib in $libs; do
7443 : Handle C library specially below.
7446 thislib=`echo $thislib | $sed -e 's/^-l//'`
7447 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
7449 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
7451 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
7453 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
7455 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
7457 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
7459 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
7464 libnames="$libnames $try"
7466 *) libnames="$libnames $thislib" ;;
7475 for xxx in $libpth; do
7476 $test -r $1 || set $xxx/libc.$so
7477 : The messy sed command sorts on library version numbers.
7479 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
7480 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
7482 s/[0-9][0-9]*/0000&/g
7483 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
7486 $sort | $sed -e 's/^.* //'`
7489 $test -r $1 || set /usr/ccs/lib/libc.$so
7490 $test -r $1 || set /lib/libsys_s$_a
7496 if $test -r "$1"; then
7497 echo "Your (shared) C library seems to be in $1."
7499 elif $test -r /lib/libc && $test -r /lib/clib; then
7500 echo "Your C library seems to be in both /lib/clib and /lib/libc."
7502 libc='/lib/clib /lib/libc'
7503 if $test -r /lib/syslib; then
7504 echo "(Your math library is in /lib/syslib.)"
7505 libc="$libc /lib/syslib"
7507 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7508 echo "Your C library seems to be in $libc, as you said before."
7509 elif $test -r $incpath/usr/lib/libc$_a; then
7510 libc=$incpath/usr/lib/libc$_a;
7511 echo "Your C library seems to be in $libc. That's fine."
7512 elif $test -r /lib/libc$_a; then
7514 echo "Your C library seems to be in $libc. You're normal."
7516 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
7518 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
7519 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
7520 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
7522 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7524 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7527 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
7529 if $test -r "$tans"; then
7530 echo "Your C library seems to be in $tans, of all places."
7536 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7540 If the guess above is wrong (which it might be if you're using a strange
7541 compiler, or your machine supports multiple models), you can override it here.
7546 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
7548 I can't seem to find your C library. I've looked in the following places:
7551 $sed 's/^/ /' libpath
7554 None of these seems to contain your C library. I need to get its name...
7559 rp='Where is your C library?'
7564 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
7565 set X `cat libnames`
7568 case $# in 1) xxx=file; esac
7569 echo "Extracting names from the following $xxx for later perusal:" >&4
7571 $sed 's/^/ /' libnames >&4
7573 $echo $n "This may take a while...$c" >&4
7577 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
7578 *) $nm $nm_opt $file 2>/dev/null;;
7583 $grep fprintf libc.tmp > libc.ptf
7584 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
7585 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
7587 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
7589 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7591 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
7593 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7595 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
7597 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7599 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
7601 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7603 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
7605 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7607 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
7609 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7611 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
7612 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
7614 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7616 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
7618 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7620 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
7622 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7624 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
7626 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7628 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
7630 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7632 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
7634 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7636 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
7638 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7640 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
7642 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7645 $nm -p $* 2>/dev/null >libc.tmp
7646 $grep fprintf libc.tmp > libc.ptf
7647 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
7648 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
7654 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
7656 if $ar t $libc > libc.tmp && \
7657 $contains '^fprintf$' libc.tmp >/dev/null 2>&1
7659 for thisname in $libnames $libc; do
7660 $ar t $thisname >>libc.tmp
7662 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
7664 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
7665 for thisname in $libnames $libc; do
7666 $ar tv $thisname >>libc.tmp
7667 emximp -o tmp.imp $thisname \
7669 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
7670 < tmp.imp >>libc.tmp
7673 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
7676 echo "$ar didn't seem to work right." >&4
7677 echo "Maybe this is a Cray...trying bld instead..." >&4
7679 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list &&
7682 for thisname in $libnames; do
7684 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
7685 $ar t $thisname >>libc.tmp
7689 echo "That didn't work either. Giving up." >&4
7699 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
7700 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
7702 *) if $test -f /lib/syscalls.exp; then
7704 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
7705 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' \
7706 /lib/syscalls.exp >>libc.list
7712 $rm -f libnames libpath
7714 : Check if we are using C++
7716 echo "Checking for C++..." >&4
7717 $cat >try.c <<'EOCP'
7729 if eval $compile_ok && $run ./try; then
7731 echo "You are using a C++ compiler."
7734 echo "You are not using a C++ compiler."
7740 : is a C symbol defined?
7743 -v) tf=libc.tmp; tdc="";;
7744 -a) tf=libc.tmp; tdc="[]";;
7745 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
7747 case "$d_cplusplus" in
7748 $define) extern_C="extern \"C\"" ;;
7749 *) extern_C="extern" ;;
7752 case "$reuseval-$4" in
7754 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
7759 if $test "$runnm" = true; then
7760 if $contains $tlook $tf >/dev/null 2>&1; then
7762 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
7763 echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7764 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
7765 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
7769 echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7770 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
7776 $define) tval=true;;
7783 : define an is-in-libc? function
7784 inlibc='echo " "; td=$define; tu=$undef;
7785 sym=$1; var=$2; eval "was=\$$2";
7787 case "$reuseval$was" in
7797 echo "$sym() found." >&4;
7798 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
7800 echo "$sym() NOT found." >&4;
7801 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
7805 $define) echo "$sym() found." >&4;;
7806 *) echo "$sym() NOT found." >&4;;
7810 : see if dlopen exists
7812 xxx_ccflags="$ccflags"
7814 : with g++ one needs -shared to get is-in-libc to work for dlopen
7815 case "$gccversion" in
7817 *) case "$d_cplusplus" in
7818 "$define") ccflags="$ccflags -shared" ;;
7825 ccflags="$xxx_ccflags"
7827 : see if this is a unistd.h system
7828 set unistd.h i_unistd
7831 : determine which dynamic loading, if any, to compile in
7833 dldir="ext/DynaLoader"
7846 $define) dflt='y' ;;
7848 : Does a dl_xxx.xs file exist for this operating system
7849 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
7852 rp="Do you wish to use dynamic loading?"
7860 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
7861 dflt="$dldir/dl_${osname}.xs"
7862 elif $test "$d_dlopen" = "$define" ; then
7863 dflt="$dldir/dl_dlopen.xs"
7868 *) dflt="$dldir/$dlsrc"
7871 echo "The following dynamic loading files are available:"
7872 : Can not go over to $dldir because getfile has path hard-coded in.
7873 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
7874 rp="Source file to use for dynamic loading"
7880 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
7884 Some systems may require passing special flags to $cc -c to
7885 compile modules that will be used to create a shared library.
7886 To use no flags, say "none".
7889 case "$cccdlflags" in
7890 '') case "$gccversion" in
7891 '') case "$osname" in
7893 next) dflt='none' ;;
7894 irix*) dflt='-KPIC' ;;
7895 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
7896 sunos) dflt='-pic' ;;
7900 *) case "$osname" in
7901 darwin) dflt='none' ;;
7902 linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
7907 *) dflt="$cccdlflags" ;;
7909 rp="Any special flags to pass to $cc -c to compile shared library modules?"
7912 none) cccdlflags=' ' ;;
7913 *) cccdlflags="$ans" ;;
7918 Some systems use ld to create libraries that can be dynamically loaded,
7919 while other systems (such as those using ELF) use $cc.
7923 : Determine if this is ELF
7925 /* Test for whether ELF binaries are produced */
7937 int i = open("a.out",O_RDONLY);
7940 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
7941 exit(0); /* succeed (yes, it is ELF) */
7946 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
7952 '') if $test $bin_ELF = "$define"; then
7954 You appear to have ELF support. I'll use $cc to build dynamic libraries.
7958 echo "I'll use ld to build dynamic libraries."
7966 rp="What command should be used to create dynamic libraries?"
7972 Some systems may require passing special flags to $ld to create a
7973 library that can be dynamically loaded. If your ld flags include
7974 -L/other/path options to locate libraries outside your loader's normal
7975 search path, you may need to specify those -L options here as well. To
7976 use no flags, say "none".
7979 case "$lddlflags" in
7980 '') case "$osname" in
7981 haiku) dflt='-shared' ;;
7983 case "$gccversion" in
7984 '') dflt="$dflt +vnocompatwarnings" ;;
7987 linux|irix*|gnu*) dflt="-shared $optimize" ;;
7988 next) dflt='none' ;;
7989 solaris) # See [perl #66604].
7990 # On Solaris 11, gcc -m64 on amd64
7991 # appears not to understand -G. gcc versions at
7992 # least as old as 3.4.3 support -shared, so just
7993 # use that with Solaris 11 and later, but keep
7994 # the old behavior for older Solaris versions.
7995 case "$gccversion" in
7997 *) case "$osvers" in
7998 2.?|2.10) dflt='-G' ;;
7999 *) dflt='-shared' ;;
8004 sunos) dflt='-assert nodefinitions' ;;
8005 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
8009 *) dflt="$lddlflags" ;;
8012 : Try to guess additional flags to pick up local libraries.
8013 : Be careful not to append to a plain 'none'
8017 for thisflag in $ldflags; do
8022 *) dflt="$dflt $thisflag" ;;
8029 ''|' ') dflt='none' ;;
8033 *-fstack-protector*)
8035 *-fstack-protector*) ;; # Don't add it again
8036 *) dflt="$dflt -fstack-protector" ;;
8042 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
8045 none) lddlflags=' ' ;;
8046 *) lddlflags="$ans" ;;
8051 Some systems may require passing special flags to $cc to indicate that
8052 the resulting executable will use dynamic linking. To use no flags,
8056 case "$ccdlflags" in
8057 '') case "$osname" in
8058 linux|hpux|gnu*) dflt='-Wl,-E' ;;
8059 next|sunos) dflt='none' ;;
8063 *) dflt="$ccdlflags" ;;
8065 rp="Any special flags to pass to $cc to use dynamic linking?"
8068 none) ccdlflags=' ' ;;
8069 *) ccdlflags="$ans" ;;
8080 ld_can_script="$undef"
8081 case "$bin_ELF$usedl" in
8083 # Abuse try.h and a.out names for neat cleanup
8095 if $cc $cccdlflags $ccdlflags $ccflags \
8096 $ldflags $lddlflags -o a.out try.c \
8097 -Wl,--version-script=try.h >/dev/null 2>&1 \
8098 && $test -s a.out ; then
8099 echo "ld supports scripting" >&4
8100 ld_can_script="$define"
8102 echo "ld does not support scripting" >&4
8108 : Do we want a shared libperl?
8112 # No dynamic loading being used, so don't bother even to prompt.
8115 *) case "$useshrplib" in
8116 '') case "$osname" in
8117 svr4*|nonstopux|dgux|dynixptx|esix|powerux|haiku|cygwin*)
8119 also='Building a shared libperl is required for dynamic loading to work on your system.'
8124 also='Building a shared libperl is needed for MAB support.'
8142 The perl executable is normally obtained by linking perlmain.c with
8143 libperl${_a}, any static extensions (usually just DynaLoader), and
8144 any other libraries needed on this system (such as -lm, etc.). Since
8145 your system supports dynamic loading, it is probably possible to build
8146 a shared libperl.$so. If you will have more than one executable linked
8147 to libperl.$so, this will significantly reduce the size of each
8148 executable, but it may have a noticeable effect on performance. The
8149 default is probably sensible for your system.
8153 rp="Build a shared libperl.$so (y/n)"
8157 useshrplib='true' ;;
8158 *) useshrplib='false' ;;
8163 case "$useshrplib" in
8165 case "$userelocatableinc" in
8167 echo "Cannot build with both -Duserelocatableinc and -Duseshrplib" >&4
8168 echo "See INSTALL for an explanation why that won't work." >&4
8174 # Figure out a good name for libperl.so. Since it gets stored in
8175 # a version-specific architecture-dependent library, the version
8176 # number isn't really that important, except for making cc/ld happy.
8178 # A name such as libperl.so.10.1
8179 majmin="libperl.$so.$patchlevel.$subversion"
8180 # A name such as libperl.so.100
8181 majonly=`echo $patchlevel $subversion |
8182 $awk '{printf "%d%02d", $1, $2}'`
8183 majonly=libperl.$so.$majonly
8184 # I'd prefer to keep the os-specific stuff here to a minimum, and
8185 # rely on figuring it out from the naming of libc.
8186 case "${osname}${osvers}" in
8189 # XXX How handle the --version stuff for MAB?
8191 linux*|gnu*) # ld won't link with a bare -lperl otherwise.
8194 cygwin*) # ld links now against the dll directly
8195 majmin="cygperl5_${patchlevel}_${subversion}.${so}"
8196 majonly=`echo $patchlevel $subversion |
8197 $awk '{printf "%03d%03d", $1, $2}'`
8198 majonly=cygperl5.$majonly.$so
8201 *) # Try to guess based on whether libc has major.minor.
8203 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8204 *libc.$so.[0-9]*) dflt=$majonly ;;
8205 *) dflt=libperl.$so ;;
8215 I need to select a good name for the shared libperl. If your system uses
8216 library names with major and minor numbers, then you might want something
8217 like $majmin. Alternatively, if your system uses a single version
8218 number for shared libraries, then you might want to use $majonly.
8219 Or, your system might be quite happy with a simple libperl.$so.
8221 Since the shared libperl will get installed into a version-specific
8222 architecture-dependent directory, the version number of the shared perl
8223 library probably isn't important, so the default should be o.k.
8226 rp='What name do you want to give to the shared libperl?'
8229 echo "Ok, I'll use $libperl"
8232 libperl="libperl${_a}"
8236 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8240 WARNING: Use of the shrpdir variable for the installation location of
8241 the shared $libperl is not supported. It was never documented and
8242 will not work in this version. Let me (perlbug@perl.org)
8243 know of any problems this may cause.
8249 But your current setting of $shrpdir is
8250 the default anyway, so it's harmless.
8255 Further, your current attempted setting of $shrpdir
8256 conflicts with the value of $archlibexp/CORE
8257 that installperl will use.
8264 # How will the perl executable find the installed shared $libperl?
8265 # Add $xxx to ccdlflags.
8266 # If we can't figure out a command-line option, use $shrpenv to
8267 # set env LD_RUN_PATH. The main perl makefile uses this.
8268 shrpdir=$archlibexp/CORE
8271 if "$useshrplib"; then
8274 # We'll set it in Makefile.SH...
8279 freebsd|mirbsd|netbsd|openbsd|interix|dragonfly|bitrig)
8280 xxx="-Wl,-R$shrpdir"
8282 bsdos|linux|irix*|dec_osf|gnu*)
8283 xxx="-Wl,-rpath,$shrpdir"
8286 # next doesn't like the default...
8289 # Haiku doesn't like the default, either.
8292 # hpux doesn't like the default, either.
8293 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8296 # cygwin needs only ldlibpth
8299 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8305 # Only add $xxx if it isn't already in ccdlflags.
8306 case " $ccdlflags " in
8308 *) ccdlflags="$ccdlflags $xxx"
8311 Adding $xxx to the flags
8312 passed to $ld so that the perl executable will find the
8313 installed shared $libperl.
8321 # Fix ccdlflags in AIX for building external extensions.
8322 # (For building Perl itself bare -bE:perl.exp is needed,
8323 # Makefile.SH takes care of this.)
8325 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8327 # Respect a hint or command-line value.
8329 '') shrpenv="$tmp_shrpenv" ;;
8331 case "$ldlibpthname" in
8332 '') ldlibpthname=LD_LIBRARY_PATH ;;
8333 none) ldlibpthname='' ;;
8336 : determine where manual pages are on this system
8340 syspath='/usr/share/man/man1 /usr/man/man1'
8341 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8342 syspath="$syspath /usr/man/u_man/man1"
8343 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8344 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8345 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8346 sysman=`./loc . /usr/man/man1 $syspath`
8349 if $test -d "$sysman"; then
8350 echo "System manual is in $sysman." >&4
8352 echo "Could not find manual pages in source form." >&4
8355 : determine where manual pages go
8356 set man1dir man1dir none
8360 $spackage has manual pages available in source form.
8364 echo "However, you don't have nroff, so they're probably useless to you."
8366 '') man1dir="none";;
8369 echo "If you don't want the manual sources installed, answer 'none'."
8374 lookpath="$prefixexp/share/man/man1"
8375 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8376 lookpath="$lookpath $prefixexp/man/p_man/man1"
8377 lookpath="$lookpath $prefixexp/man/u_man/man1"
8378 lookpath="$lookpath $prefixexp/man/man.1"
8380 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8381 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8391 rp="Where do the main $spackage manual pages (source) go?"
8393 if $test "X$man1direxp" != "X$ansexp"; then
8404 : What suffix to use on installed man pages
8411 rp="What suffix should be used for the main $spackage man pages?"
8413 '') case "$man1dir" in
8427 *) dflt="$man1ext";;
8434 : see if we can have long filenames
8436 first=123456789abcdef
8438 if (echo hi >$first) 2>/dev/null; then
8439 if $test -f 123456789abcde; then
8440 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8443 echo 'You can have filenames longer than 14 characters.'>&4
8448 You can't have filenames longer than 14 chars.
8449 You can't even think about them!
8455 $rm -rf 123456789abcde*
8457 : determine where library module manual pages go
8458 set man3dir man3dir none
8462 $spackage has manual pages for many of the library modules.
8468 However, you don't have nroff, so they're probably useless to you.
8471 '') man3dir="none";;
8475 case "$d_flexfnam" in
8478 However, your system can't handle the long file names like File::Basename.3.
8481 '') man3dir="none";;
8485 echo "If you don't want the manual sources installed, answer 'none'."
8486 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8488 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8489 if $test -d "$privlib/man/man3"; then
8492 WARNING: Previous versions of perl installed man3 pages into
8493 $privlib/man/man3. This version will suggest a
8494 new default of $dflt.
8498 rp='Do you wish to preserve the old behavior?(y/n)'
8501 y*) dflt="$privlib/man/man3" ;;
8506 *) dflt="$man3dir" ;;
8513 rp="Where do the $package library man pages (source) go?"
8523 : What suffix to use on installed man pages
8529 rp="What suffix should be used for the $package library man pages?"
8531 '') case "$man3dir" in
8545 *) dflt="$man3ext";;
8552 : see if we have to deal with yellow pages, now NIS.
8553 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8554 if $test -f /usr/etc/nibindd; then
8556 echo "I'm fairly confident you're on a NeXT."
8558 rp='Do you get the hosts file via NetInfo?'
8567 y*) hostcat='nidump hosts .';;
8568 *) case "$hostcat" in
8569 nidump*) hostcat='';;
8579 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8587 rp='Are you getting the hosts file via yellow pages?'
8590 y*) hostcat='ypcat hosts';;
8591 *) hostcat='cat /etc/hosts';;
8597 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8600 '') test -f /etc/group && groupcat='cat /etc/group';;
8603 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8606 : now get the host name
8608 echo "Figuring out host name..." >&4
8609 case "$myhostname" in
8611 echo 'Maybe "hostname" will work...'
8612 if tans=`sh -c hostname 2>&1` ; then
8620 if $test "$cont"; then
8622 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8623 if tans=`cat /etc/systemid 2>&1` ; then
8625 phostname='cat /etc/systemid'
8626 echo "Whadyaknow. Xenix always was a bit strange..."
8629 elif $test -r /etc/systemid; then
8630 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8633 if $test "$cont"; then
8634 echo 'No, maybe "uuname -l" will work...'
8635 if tans=`sh -c 'uuname -l' 2>&1` ; then
8637 phostname='uuname -l'
8639 echo 'Strange. Maybe "uname -n" will work...'
8640 if tans=`sh -c 'uname -n' 2>&1` ; then
8642 phostname='uname -n'
8644 echo 'Oh well, maybe I can mine it out of whoami.h...'
8645 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8646 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8647 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8649 case "$myhostname" in
8650 '') echo "Does this machine have an identity crisis or something?"
8653 echo "Well, you said $myhostname before..."
8654 phostname='echo $myhostname';;
8660 case "$myhostname" in
8661 '') myhostname=noname ;;
8663 : you do not want to know about this
8668 if $test "$myhostname" ; then
8670 rp='Your host name appears to be "'$myhostname'".'" Right?"
8678 : bad guess or no guess
8679 while $test "X$myhostname" = X ; do
8681 rp="Please type the (one word) name of your host:"
8686 : translate upper to lower if necessary
8687 case "$myhostname" in
8689 echo "(Normalizing case in your host name)"
8690 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8694 case "$myhostname" in
8696 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8697 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8698 echo "(Trimming domain name from host name--host name is now $myhostname)"
8700 *) case "$mydomain" in
8703 test "X$hostcat" = "Xypcat hosts" &&
8704 ypmatch "$myhostname" hosts 2>/dev/null |\
8705 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8708 test "X$hostcat" != "X" &&
8709 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8710 /[ ]$myhostname[ . ]/p" > hosts
8713 if $test -f hosts; then
8714 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8715 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8716 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8717 hosts | $sort | $uniq | \
8718 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8719 case `$echo X$dflt` in
8720 X*\ *) echo "(Several hosts in the database matched hostname)"
8723 X.) echo "(You do not have fully-qualified names in the hosts database)"
8727 echo "(I cannot locate a hosts database anywhere)"
8732 tans=`./loc resolv.conf X /etc /usr/etc`
8733 if $test -f "$tans"; then
8734 echo "(Attempting domain name extraction from $tans)"
8735 dflt=.`$sed -n -e 's/ / /g' \
8736 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8739 .) dflt=.`$sed -n -e 's/ / /g' \
8740 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8748 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8749 dflt=.`sh -c domainname 2>/dev/null`
8752 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8756 case "$dflt$osname" in
8757 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
8758 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
8762 .) echo "(Lost all hope -- silly guess then)"
8768 *) dflt="$mydomain";;
8772 rp="What is your domain name?"
8782 : translate upper to lower if necessary
8785 echo "(Normalizing case in your domain name)"
8786 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
8790 : a little sanity check here
8791 case "$phostname" in
8794 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
8795 $myhostname$mydomain|$myhostname) ;;
8797 case "$phostname" in
8799 echo "(That doesn't agree with your whoami.h file, by the way.)"
8802 echo "(That doesn't agree with your $phostname command, by the way.)"
8810 : determine the e-mail address of the user who is running us
8813 I need to get your e-mail address in Internet format if possible, i.e.
8814 something like user@host.domain. Please answer accurately since I have
8815 no easy means to double check it. The default value provided below
8816 is most probably close to reality but may not be valid from outside
8817 your organization...
8821 while test "$cont"; do
8822 case "$MAILDOMAIN" in
8824 if $test -s /etc/mailname; then
8825 maildomain=`$cat /etc/mailname`
8827 maildomain="$myhostname$mydomain"
8830 *) maildomain="$MAILDOMAIN";;
8833 '') dflt="$cf_by@$maildomain";;
8834 *) dflt="$cf_email";;
8836 rp='What is your e-mail address?'
8842 rp='Address does not look like an Internet one. Use it anyway?'
8856 : Ask e-mail of administrator
8859 If you or somebody else will be maintaining perl at your site, please
8860 fill in the correct e-mail address here so that they may be contacted
8861 if necessary. Currently, the "perlbug" program included with perl
8862 will send mail to this address in addition to perlbug@perl.org. You may
8863 enter "none" for no administrator.
8866 case "$perladmin" in
8867 '') dflt="$cf_email";;
8868 *) dflt="$perladmin";;
8870 rp='Perl administrator e-mail address'
8874 : determine whether to only install version-specific parts.
8877 Do you want to install only the version-specific parts of the perl
8878 distribution? Usually you do *not* want to do this.
8880 case "$versiononly" in
8881 "$define"|[Yy]*|true) dflt='y' ;;
8884 rp="Do you want to install only the version-specific parts of perl?"
8887 [yY]*) val="$define";;
8893 case "$versiononly" in
8894 "$define") inc_version_list=''
8895 inc_version_list_init=0
8899 : figure out how to guarantee perl startup
8900 : XXX Note that this currently takes advantage of the bug that binexp ignores
8901 : the Configure -Dinstallprefix setting, which in turn means that under
8902 : relocatable @INC, initialinstalllocation is what binexp started as.
8903 case "$startperl" in
8905 case "$sharpbang" in
8909 I can use the #! construct to start perl on your system. This will
8910 make startup of perl scripts faster, but may cause problems if you
8911 want to share those scripts and perl is not in a standard place
8912 ($initialinstalllocation/perl) on all your platforms. The alternative
8913 is to force a shell by starting the script with a single ':' character.
8916 case "$versiononly" in
8917 "$define") dflt="$initialinstalllocation/perl$version";;
8918 *) dflt="$initialinstalllocation/perl";;
8920 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
8923 none) startperl=": # use perl";;
8924 *) startperl="#!$ans"
8925 if $test 30 -lt `echo "$ans" | wc -c`; then
8928 WARNING: Some systems limit the #! command to 32 characters.
8929 If you experience difficulty running Perl scripts with #!, try
8930 installing Perl in a directory with a shorter pathname.
8936 *) startperl=": # use perl"
8941 echo "I'll use $startperl to start perl scripts."
8943 : figure best path for perl in scripts
8946 case "$versiononly" in
8947 "$define") perlpath="$initialinstalllocation/perl$version";;
8948 *) perlpath="$initialinstalllocation/perl";;
8950 case "$startperl" in
8955 I will use the "eval 'exec'" idiom to start Perl on your system.
8956 I can use the full path of your Perl binary for this purpose, but
8957 doing so may cause problems if you want to share those scripts and
8958 Perl is not always in a standard place ($initialinstalllocation/perl).
8961 dflt="$initialinstalllocation/perl"
8962 rp="What path shall I use in \"eval 'exec'\"?"
8969 case "$startperl" in
8971 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
8974 : determine where public executable scripts go
8975 set scriptdir scriptdir
8977 case "$scriptdir" in
8980 : guess some guesses
8981 $test -d /usr/share/scripts && dflt=/usr/share/scripts
8982 $test -d /usr/share/bin && dflt=/usr/share/bin
8983 $test -d /usr/local/script && dflt=/usr/local/script
8984 $test -d /usr/local/scripts && dflt=/usr/local/scripts
8985 $test -d $prefixexp/script && dflt=$prefixexp/script
8989 *) dflt="$scriptdir"
8994 Some installations have a separate directory just for executable scripts so
8995 that they can mount it across multiple architectures but keep the scripts in
8996 one spot. You might, for example, have a subdirectory of /usr/share for this.
8997 Or you might just lump your scripts in with all your other executables.
9001 rp='Where do you keep publicly executable scripts?'
9003 if $test "X$ansexp" != "X$scriptdirexp"; then
9009 : A little fix up for an irregularly named variable.
9010 installscript="$installscriptdir"
9012 : determine where add-on public executables go
9014 '') dflt=$siteprefix/bin ;;
9018 rp='Pathname where the add-on public executables should be installed?'
9023 : determine where add-on html pages go
9024 : There is no standard location, so try to copy the previously-selected
9025 : directory structure for the core html pages.
9026 case "$sitehtml1dir" in
9027 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9028 *) dflt=$sitehtml1dir ;;
9031 ''|' ') dflt=none ;;
9034 rp='Pathname where the site-specific html pages should be installed?'
9036 prefixvar=sitehtml1dir
9039 : determine where add-on library html pages go
9040 : There is no standard location, so try to copy the previously-selected
9041 : directory structure for the core html pages.
9042 case "$sitehtml3dir" in
9043 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9044 *) dflt=$sitehtml3dir ;;
9047 ''|' ') dflt=none ;;
9050 rp='Pathname where the site-specific library html pages should be installed?'
9052 prefixvar=sitehtml3dir
9055 : determine where add-on manual pages go
9056 case "$siteman1dir" in
9057 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
9058 *) dflt=$siteman1dir ;;
9061 ''|' ') dflt=none ;;
9064 rp='Pathname where the site-specific manual pages should be installed?'
9066 prefixvar=siteman1dir
9069 : determine where add-on library man pages go
9070 case "$siteman3dir" in
9071 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
9072 *) dflt=$siteman3dir ;;
9075 ''|' ') dflt=none ;;
9078 rp='Pathname where the site-specific library manual pages should be installed?'
9080 prefixvar=siteman3dir
9083 : determine where add-on public executable scripts go
9084 case "$sitescript" in
9085 '') dflt=$siteprefix/script
9086 $test -d $dflt || dflt=$sitebin ;;
9087 *) dflt="$sitescript" ;;
9090 rp='Pathname where add-on public executable scripts should be installed?'
9092 prefixvar=sitescript
9095 : Check if faststdio is requested and available
9096 case "$usefaststdio" in
9097 $define|true|[yY]*|'')
9098 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
9108 Perl can be built to use 'fast stdio', which means using the stdio
9109 library but also directly manipulating the stdio buffers to enable
9110 faster I/O. Using stdio is better for backward compatibility (especially
9111 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
9112 interface has been preferred instead of stdio.
9114 If this doesn't make any sense to you, just accept the default '$dflt'.
9116 rp='Use the "fast stdio" if available?'
9119 y|Y) val="$define" ;;
9126 : define an is-a-typedef? function
9127 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9129 "") inclist="sys/types.h";;
9131 eval "varval=\$$var";
9135 for inc in $inclist; do
9136 echo "#include <$inc>" >>temp.c;
9138 echo "#ifdef $type" >> temp.c;
9139 echo "printf(\"We have $type\");" >> temp.c;
9140 echo "#endif" >> temp.c;
9141 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9142 if $contains $type temp.E >/dev/null 2>&1; then
9148 *) eval "$var=\$varval";;
9151 : define an is-a-typedef? function that prompts if the type is not available.
9152 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9154 "") inclist="sys/types.h";;
9156 eval "varval=\$$var";
9160 for inc in $inclist; do
9161 echo "#include <$inc>" >>temp.c;
9163 echo "#ifdef $type" >> temp.c;
9164 echo "printf(\"We have $type\");" >> temp.c;
9165 echo "#endif" >> temp.c;
9166 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9168 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
9169 if $contains $type temp.E >/dev/null 2>&1; then
9170 echo "$type found." >&4;
9173 echo "$type NOT found." >&4;
9179 *) eval "$var=\$varval";;
9182 : see what type lseek is declared as in the kernel
9183 rp="What is the type used for lseek's offset on this system?"
9184 set off_t lseektype long stdio.h sys/types.h
9188 echo "Checking to see how big your file offsets are..." >&4
9190 #include <sys/types.h>
9194 printf("%d\n", (int)sizeof($lseektype));
9199 if eval $compile_ok; then
9200 lseeksize=`$run ./try`
9201 echo "Your file offsets are $lseeksize bytes long."
9205 echo "(I can't seem to compile the test program. Guessing...)"
9206 rp="What is the size of your file offsets (in bytes)?"
9212 : see what type file positions are declared as in the library
9213 rp="What is the type for file position used by fsetpos()?"
9214 set fpos_t fpostype long stdio.h sys/types.h
9217 : Check size for Fpos_t
9220 *_t) zzz="$fpostype" ;;
9223 echo "Checking the size of $zzz..." >&4
9225 #include <sys/types.h>
9232 printf("%d\n", (int)sizeof($fpostype));
9237 if eval $compile_ok; then
9241 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9244 echo "Your $zzz is $fpossize bytes long."
9250 echo "(I can't compile the test program. Guessing...)" >&4
9251 rp="What is the size of your file positions (in bytes)?"
9256 : Check for large file support
9257 # Backward compatibility (uselfs is deprecated).
9259 "$define"|true|[yY]*)
9262 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9264 uselargefiles="$define"
9268 case "$lseeksize:$fpossize" in
9271 You can have files larger than 2 gigabytes.
9274 *) case "$uselargefiles" in
9275 "$undef"|false|[nN]*) dflt='n' ;;
9280 Perl can be built to understand large files (files larger than 2 gigabytes)
9281 on some systems. To do so, Configure can be run with -Duselargefiles.
9283 If this doesn't make any sense to you, just accept the default '$dflt'.
9285 rp='Try to understand large files, if available?'
9288 y|Y) val="$define" ;;
9295 : Look for a hint-file generated 'call-back-unit'. If the
9296 : user has specified that a large files perl is to be built,
9297 : we may need to set or change some other defaults.
9298 if $test -f uselargefiles.cbu; then
9299 echo "Your platform has some specific hints regarding large file builds, using them..."
9300 . ./uselargefiles.cbu
9302 case "$uselargefiles" in
9304 if $test -f uselargefiles.cbu; then
9306 echo "Rechecking to see how big your file offsets are..." >&4
9308 #include <sys/types.h>
9312 printf("%d\n", (int)sizeof($lseektype));
9317 if eval $compile_ok; then
9318 lseeksize=`$run ./try`
9319 $echo "Your file offsets are now $lseeksize bytes long."
9323 echo "(I can't seem to compile the test program. Guessing...)"
9324 rp="What is the size of your file offsets (in bytes)?"
9329 *_t) zzz="$fpostype" ;;
9332 $echo $n "Rechecking the size of $zzz...$c" >&4
9334 #include <sys/types.h>
9341 printf("%d\n", (int)sizeof($fpostype));
9346 if eval $compile_ok; then
9351 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9354 echo " $fpossize bytes." >&4
9360 echo "(I can't compile the test program. Guessing...)" >&4
9361 rp="What is the size of your file positions (in bytes)?"
9370 : Check if we want perlio
9373 : Set the vendorbin variables
9374 case "$vendorprefix" in
9375 '') d_vendorbin="$undef"
9379 *) d_vendorbin="$define"
9380 : determine where vendor-supplied executables go.
9381 case "$vendorbin" in
9382 '') dflt=$vendorprefix/bin ;;
9383 *) dflt="$vendorbin" ;;
9386 rp='Pathname for the vendor-supplied executables directory?'
9389 vendorbinexp="$ansexp"
9395 : Set the vendorhtml1dir variables
9396 case "$vendorprefix" in
9397 '') vendorhtml1dir=''
9398 vendorhtml1direxp=''
9400 *) : determine where vendor-supplied html pages go.
9401 : There is no standard location, so try to copy the previously-selected
9402 : directory structure for the core html pages.
9403 : XXX Better default suggestions would be welcome.
9404 case "$vendorhtml1dir" in
9405 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9406 *) dflt=$vendorhtml1dir ;;
9409 ''|' ') dflt=none ;;
9412 rp='Pathname for the vendor-supplied html pages?'
9414 vendorhtml1dir="$ans"
9415 vendorhtml1direxp="$ansexp"
9418 : Use ' ' for none so value is preserved next time through Configure
9419 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9420 prefixvar=vendorhtml1dir
9423 : Set the vendorhtml3dir variables
9424 case "$vendorprefix" in
9425 '') vendorhtml3dir=''
9426 vendorhtml3direxp=''
9428 *) : determine where vendor-supplied module html pages go.
9429 : There is no standard location, so try to copy the previously-selected
9430 : directory structure for the core html pages.
9431 : XXX Better default suggestions would be welcome.
9432 case "$vendorhtml3dir" in
9433 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9434 *) dflt=$vendorhtml3dir ;;
9437 ''|' ') dflt=none ;;
9440 rp='Pathname for the vendor-supplied html pages?'
9442 vendorhtml3dir="$ans"
9443 vendorhtml3direxp="$ansexp"
9446 : Use ' ' for none so value is preserved next time through Configure
9447 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9448 prefixvar=vendorhtml3dir
9451 : Set the vendorman1dir variables
9452 case "$vendorprefix" in
9453 '') vendorman1dir=''
9456 *) : determine where vendor-supplied manual pages go.
9457 case "$vendorman1dir" in
9458 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9459 *) dflt=$vendorman1dir ;;
9462 ''|' ') dflt=none ;;
9465 rp='Pathname for the vendor-supplied manual section 1 pages?'
9467 vendorman1dir="$ans"
9468 vendorman1direxp="$ansexp"
9471 : Use ' ' for none so value is preserved next time through Configure
9472 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9473 prefixvar=vendorman1dir
9476 : Set the vendorman3dir variables
9477 case "$vendorprefix" in
9478 '') vendorman3dir=''
9481 *) : determine where vendor-supplied module manual pages go.
9482 case "$vendorman3dir" in
9483 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9484 *) dflt=$vendorman3dir ;;
9487 ''|' ') dflt=none ;;
9490 rp='Pathname for the vendor-supplied manual section 3 pages?'
9492 vendorman3dir="$ans"
9493 vendorman3direxp="$ansexp"
9496 : Use ' ' for none so value is preserved next time through Configure
9497 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9498 prefixvar=vendorman3dir
9501 : Set the vendorscript variables
9502 case "$vendorprefix" in
9503 '') d_vendorscript="$undef"
9507 *) d_vendorscript="$define"
9508 : determine where vendor-supplied scripts go.
9509 case "$vendorscript" in
9510 '') dflt=$vendorprefix/script
9511 $test -d $dflt || dflt=$vendorbin ;;
9512 *) dflt="$vendorscript" ;;
9516 The installation process will create a directory for
9517 vendor-supplied scripts.
9521 rp='Pathname for the vendor-supplied scripts directory?'
9524 vendorscriptexp="$ansexp"
9527 prefixvar=vendorscript
9530 : script used to emit important warnings
9533 if test \$# -gt 0; then
9538 echo "*** WARNING:" >&4
9539 sed -e 's/^/*** /' <msg >&4
9541 cat msg >>config.msg
9542 echo " " >>config.msg
9548 : see which of string.h or strings.h is needed
9550 strings=`./findhdr string.h`
9551 if $test "$strings" && $test -r "$strings"; then
9552 echo "Using <string.h> instead of <strings.h>." >&4
9556 strings=`./findhdr strings.h`
9557 if $test "$strings" && $test -r "$strings"; then
9558 echo "Using <strings.h> instead of <string.h>." >&4
9560 ./warn "No string header found -- You'll surely have problems."
9566 "$undef") strings=`./findhdr strings.h`;;
9567 *) strings=`./findhdr string.h`;;
9570 : see if qgcvt exists
9574 : Check print/scan long double stuff
9577 if $test X"$d_longdbl" = X"$define"; then
9579 echo "Checking how to print long doubles..." >&4
9581 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
9582 $cat >try.c <<'EOCP'
9583 #include <sys/types.h>
9587 printf("%.3f\n", d);
9591 if eval $compile; then
9595 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
9596 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
9597 echo "We will use %f."
9603 if $test X"$sPRIfldbl" = X; then
9604 $cat >try.c <<'EOCP'
9605 #include <sys/types.h>
9608 long double d = 123.456;
9609 printf("%.3Lf\n", d);
9613 if eval $compile; then
9617 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
9618 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
9619 echo "We will use %Lf."
9625 if $test X"$sPRIfldbl" = X; then
9626 $cat >try.c <<'EOCP'
9627 #include <sys/types.h>
9630 long double d = 123.456;
9631 printf("%.3llf\n", d);
9635 if eval $compile; then
9639 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
9640 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
9641 echo "We will use %llf."
9647 if $test X"$sPRIfldbl" = X; then
9648 $cat >try.c <<'EOCP'
9649 #include <sys/types.h>
9652 long double d = 123.456;
9653 printf("%.3lf\n", d);
9657 if eval $compile; then
9661 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
9662 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
9663 echo "We will use %lf."
9669 if $test X"$sPRIfldbl" = X; then
9670 echo "Cannot figure out how to print long doubles." >&4
9672 sSCNfldbl=$sPRIfldbl # expect consistency
9679 case "$sPRIfldbl" in
9680 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
9681 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
9682 d_SCNfldbl="$undef";
9684 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
9685 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
9686 d_SCNfldbl="$define";
9690 : Check how to convert floats to strings.
9692 if test "X$d_Gconvert" = X; then
9695 echo "Checking for an efficient way to convert floats to strings."
9697 case "$uselongdouble" in
9698 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
9700 case "$d_longdbl" in
9701 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
9703 case "$d_PRIgldbl" in
9704 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
9708 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
9709 char *myname = "gconvert";
9712 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
9713 char *myname = "gcvt";
9716 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
9717 char *myname = "qgcvt";
9718 #define DOUBLETYPE long double
9721 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9723 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
9725 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
9728 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
9730 char *myname = "sprintf";
9734 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9735 #define DOUBLETYPE long double
9737 #define DOUBLETYPE double
9749 # include <string.h>
9751 # include <strings.h>
9754 int checkit(char *expect, char *got)
9756 if (strcmp(expect, got)) {
9757 printf("%s oddity: Expected %s, got %s\n",
9758 myname, expect, got);
9768 /* This must be 1st test on (which?) platform */
9769 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
9770 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
9771 checkit("0.1", buf);
9773 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
9774 checkit("0.01", buf);
9776 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
9777 checkit("0.001", buf);
9779 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
9780 checkit("0.0001", buf);
9782 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
9783 if (strlen(buf) > 5)
9784 checkit("9e-005", buf); /* for Microsoft ?? */
9786 checkit("9e-05", buf);
9788 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
9791 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
9792 checkit("1.1", buf);
9794 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
9795 checkit("1.01", buf);
9797 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
9798 checkit("1.001", buf);
9800 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
9801 checkit("1.0001", buf);
9803 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
9804 checkit("1.00001", buf);
9806 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
9807 checkit("1.000001", buf);
9809 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
9812 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
9815 /* Some Linux gcvt's give 1.e+5 here. */
9816 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
9817 checkit("100000", buf);
9819 /* Some Linux gcvt's give -1.e+5 here. */
9820 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
9821 checkit("-100000", buf);
9823 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
9824 checkit("123.456", buf);
9826 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
9827 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
9828 /* 34 should be enough to scare even long double
9829 * places into using the e notation. */
9830 if (strlen(buf) > 5)
9831 checkit("1e+034", buf); /* for Microsoft */
9833 checkit("1e+34", buf);
9835 /* For Perl, if you add additional tests here, also add them to
9836 * t/base/num.t for benefit of platforms not using Configure or
9837 * overriding d_Gconvert */
9842 : first add preferred functions to our list
9844 for xxx_convert in $gconvert_preference; do
9845 case $xxx_convert in
9846 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
9847 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
9850 : then add any others
9851 for xxx_convert in gconvert gcvt sprintf; do
9854 *) xxx_list="$xxx_list $xxx_convert" ;;
9858 case "$d_longdbl$uselongdouble" in
9860 : again, add preferred functions to our list first
9862 for xxx_convert in $gconvert_ld_preference; do
9863 case $xxx_convert in
9864 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9865 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
9868 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
9869 for xxx_convert in qgcvt sprintf $xxx_list; do
9870 case "$xxx_ld_list" in
9871 $xxx_convert*|*" $xxx_convert"*) ;;
9872 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9875 : if sprintf cannot do long doubles, move it to the end
9876 if test "$d_PRIgldbl" != "$define"; then
9877 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
9879 : if no qgcvt, remove it
9880 if test "$d_qgcvt" != "$define"; then
9881 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
9884 xxx_list="$xxx_ld_list"
9888 for xxx_convert in $xxx_list; do
9889 echo "Trying $xxx_convert..."
9890 $rm -f try try$_o core
9891 set try -DTRY_$xxx_convert
9892 if eval $compile; then
9893 echo "$xxx_convert() found." >&4
9895 echo "I'll use $xxx_convert to convert floats into a string." >&4
9898 echo "...But $xxx_convert didn't work as I expected."
9902 echo "$xxx_convert NOT found." >&4
9906 if test X$xxx_convert = X; then
9907 echo "*** WHOA THERE!!! ***" >&4
9908 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
9912 case "$xxx_convert" in
9913 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
9914 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
9915 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
9916 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
9917 "$define$define$define")
9918 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
9919 "$define$define$undef")
9920 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
9921 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
9929 : see if _fwalk exists
9933 : Initialize h_fcntl
9936 : Initialize h_sysfile
9939 : access call always available on UNIX
9943 : locate the flags for 'access()'
9947 $cat >access.c <<EOCP
9948 #include <sys/types.h>
9953 #include <sys/file.h>
9966 : check sys/file.h first, no particular reason here
9967 if $test `./findhdr sys/file.h` && \
9968 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
9970 echo "<sys/file.h> defines the *_OK access constants." >&4
9971 elif $test `./findhdr fcntl.h` && \
9972 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
9974 echo "<fcntl.h> defines the *_OK access constants." >&4
9975 elif $test `./findhdr unistd.h` && \
9976 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
9977 echo "<unistd.h> defines the *_OK access constants." >&4
9979 echo "I can't find the four *_OK access constants--I'll use mine." >&4
9985 : see if accessx exists
9986 set accessx d_accessx
9989 : see if aintl exists
9993 : see if alarm exists
9997 : see if 64bit time functions exists
9999 set ctime64 d_ctime64
10002 set localtime64 d_localtime64
10005 set gmtime64 d_gmtime64
10008 set mktime64 d_mktime64
10011 set difftime64 d_difftime64
10014 set asctime64 d_asctime64
10017 : see if POSIX threads are available
10018 set pthread.h i_pthread
10021 : define a function to check prototypes
10022 $cat > protochk <<EOSH
10025 optimize="$optimize"
10027 prototype="$prototype"
10030 usethreads=$usethreads
10031 i_pthread=$i_pthread
10032 pthread_h_first=$pthread_h_first
10035 $cat >> protochk <<'EOSH'
10040 while test $# -ge 2; do
10042 $define) echo "#include <$2>" >> try.c ;;
10043 literal) echo "$2" >> try.c ;;
10045 # Extra magic for the benefit of systems that need pthread.h
10046 # to be included early to correctly detect threadsafe functions.
10047 # Such functions must guarantee themselves, though, that the usethreads
10048 # and i_pthread have been defined, before calling protochk.
10049 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
10050 echo "#include <pthread.h>" >> try.c
10055 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
10056 cat >> try.c <<'EOCP'
10057 #ifdef CAN_PROTOTYPE
10058 #define _(args) args
10063 echo "$foo" >> try.c
10064 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
10065 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
10071 $eunicefix protochk
10073 : Define hasproto macro for Configure internal use
10074 hasproto='varname=$1; func=$2; shift; shift;
10075 while $test $# -ge 2; do
10077 $define) echo "#include <$2>";;
10081 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
10082 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
10083 echo "$func() prototype found.";
10086 echo "$func() prototype NOT found.";
10093 : see if sys/types.h has to be included
10094 set sys/types.h i_systypes
10097 : see if sys/select.h has to be included
10098 set sys/select.h i_sysselct
10101 : Define hasfield macro for Configure internal use
10102 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
10103 while $test $# -ge 2; do
10105 $define) echo "#include <$2>";;
10109 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
10111 if eval $compile; then
10120 : see if we should include time.h, sys/time.h, or both
10122 if test "X$timeincl" = X; then
10123 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
10124 $echo $n "I'm now running the test program...$c"
10126 #include <sys/types.h>
10131 #ifdef SYSTIMEKERNEL
10134 #include <sys/time.h>
10137 #include <sys/select.h>
10139 #$i_stdlib I_STDLIB
10141 #include <stdlib.h>
10147 struct timeval bar;
10150 struct timezone tzp;
10152 if (foo.tm_sec == foo.tm_sec)
10155 if (bar.tv_sec == bar.tv_sec)
10162 for s_timezone in '-DS_TIMEZONE' ''; do
10164 for s_timeval in '-DS_TIMEVAL' ''; do
10165 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10166 for i_time in '' '-DI_TIME'; do
10167 for i_systime in '-DI_SYSTIME' ''; do
10170 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10171 if eval $compile; then
10172 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
10176 $echo $n "Succeeded with $flags$c"
10188 *SYSTIMEKERNEL*) i_systimek="$define"
10189 timeincl=`./findhdr sys/time.h`
10190 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10191 *) i_systimek="$undef";;
10194 *I_TIME*) i_time="$define"
10195 timeincl=`./findhdr time.h`" $timeincl"
10196 echo "We'll include <time.h>." >&4;;
10197 *) i_time="$undef";;
10200 *I_SYSTIME*) i_systime="$define"
10201 timeincl=`./findhdr sys/time.h`" $timeincl"
10202 echo "We'll include <sys/time.h>." >&4;;
10203 *) i_systime="$undef";;
10207 : see if struct tm knows about tm_zone
10208 case "$i_systime$i_time" in
10211 echo "Checking to see if your struct tm has tm_zone field..." >&4
10212 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
10220 case "$d_tm_tm_zone" in
10221 "$define") echo "Yes, it does." ;;
10222 *) echo "No, it doesn't." ;;
10224 : see if struct tm knows about tm_gmtoff
10225 case "$i_systime$i_time" in
10228 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
10229 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
10237 case "$d_tm_tm_gmtoff" in
10238 "$define") echo "Yes, it does." ;;
10239 *) echo "No, it doesn't." ;;
10242 : see if asctime_r exists
10243 set asctime_r d_asctime_r
10245 case "$d_asctime_r" in
10247 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10248 case "$d_asctime_r_proto:$usethreads" in
10249 ":define") d_asctime_r_proto=define
10250 set d_asctime_r_proto asctime_r $hdrs
10254 case "$d_asctime_r_proto" in
10256 case "$asctime_r_proto" in
10257 ''|0) try='char* asctime_r(const struct tm*, char*);'
10258 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SB ;;
10260 case "$asctime_r_proto" in
10261 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
10262 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SBI ;;
10264 case "$asctime_r_proto" in
10265 ''|0) try='int asctime_r(const struct tm*, char*);'
10266 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SB ;;
10268 case "$asctime_r_proto" in
10269 ''|0) try='int asctime_r(const struct tm*, char*, int);'
10270 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SBI ;;
10272 case "$asctime_r_proto" in
10273 ''|0) d_asctime_r=undef
10275 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
10276 * ) case "$asctime_r_proto" in
10277 REENTRANT_PROTO*) ;;
10278 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
10280 echo "Prototype: $try" ;;
10283 *) case "$usethreads" in
10284 define) echo "asctime_r has no prototype, not using it." >&4 ;;
10291 *) asctime_r_proto=0
10295 : see if atolf exists
10299 : see if atoll exists
10303 : Look for GCC-style attribute format
10304 case "$d_attribute_format" in
10307 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
10308 $cat >attrib.c <<'EOCP'
10310 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
10312 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10313 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10314 echo "Your C compiler doesn't support __attribute__((format))."
10317 echo "Your C compiler supports __attribute__((format))."
10321 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10325 *) val="$d_attribute_format" ;;
10327 set d_attribute_format
10331 : Look for GCC-style attribute format with null format allowed
10332 case "$d_printf_format_null" in
10333 '') case "$d_attribute_format" in
10336 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
10337 $cat >attrib.c <<EOCP
10339 #$i_stdlib I_STDLIB
10341 #include <stdlib.h>
10343 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
10344 int null_printf (char* pat,...) { return (int)pat; }
10345 int main () { exit(null_printf(NULL)); }
10347 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
10348 : run the executable in case it produces a run-time warning
10349 if $run ./attrib >>attrib.out 2>&1; then
10350 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10351 echo "Your C compiler doesn't allow __printf__ format to be null."
10354 echo "Your C compiler allows __printf__ format to be null."
10358 echo "Your C compiler executable failed with __printf__ format null."
10362 echo "Your C compiler fails with __printf__ format null."
10369 *) val="$d_printf_format_null" ;;
10371 set d_printf_format_null
10375 : Look for GCC-style attribute malloc
10376 case "$d_attribute_malloc" in
10379 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
10380 $cat >attrib.c <<'EOCP'
10382 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
10384 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10385 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10386 echo "Your C compiler doesn't support __attribute__((malloc))."
10389 echo "Your C compiler supports __attribute__((malloc))."
10393 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10397 *) val="$d_attribute_malloc" ;;
10399 set d_attribute_malloc
10403 : Look for GCC-style attribute nonnull
10404 case "$d_attribute_nonnull" in
10407 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
10408 $cat >attrib.c <<'EOCP'
10410 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
10412 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10413 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10414 echo "Your C compiler doesn't support __attribute__((nonnull))."
10417 echo "Your C compiler supports __attribute__((nonnull))."
10421 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10425 *) val="$d_attribute_nonnull" ;;
10427 set d_attribute_nonnull
10431 : Look for GCC-style attribute noreturn
10432 case "$d_attribute_noreturn" in
10435 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
10436 $cat >attrib.c <<'EOCP'
10438 void fall_over_dead( void ) __attribute__((noreturn));
10440 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10441 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10442 echo "Your C compiler doesn't support __attribute__((noreturn))."
10445 echo "Your C compiler supports __attribute__((noreturn))."
10449 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10453 *) val="$d_attribute_noreturn" ;;
10455 set d_attribute_noreturn
10459 : Look for GCC-style attribute pure
10460 case "$d_attribute_pure" in
10463 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
10464 $cat >attrib.c <<'EOCP'
10466 int square( int n ) __attribute__((pure));
10468 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10469 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10470 echo "Your C compiler doesn't support __attribute__((pure))."
10473 echo "Your C compiler supports __attribute__((pure))."
10477 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10481 *) val="$d_attribute_pure" ;;
10483 set d_attribute_pure
10487 : Look for GCC-style attribute unused
10488 case "$d_attribute_unused" in
10491 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
10492 $cat >attrib.c <<'EOCP'
10494 int do_something( int dummy __attribute__((unused)), int n );
10496 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10497 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10498 echo "Your C compiler doesn't support __attribute__((unused))."
10501 echo "Your C compiler supports __attribute__((unused))."
10505 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10509 *) val="$d_attribute_unused" ;;
10511 set d_attribute_unused
10515 : Look for GCC-style attribute deprecated
10516 case "$d_attribute_deprecated" in
10519 echo "Checking whether your compiler can handle __attribute__((deprecated)) ..." >&4
10520 $cat >attrib.c <<'EOCP'
10522 int I_am_deprecated(void) __attribute__((deprecated));
10524 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10525 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10526 echo "Your C compiler doesn't support __attribute__((deprecated))."
10529 echo "Your C compiler supports __attribute__((deprecated))."
10533 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10537 *) val="$d_attribute_deprecated" ;;
10539 set d_attribute_deprecated
10543 : Look for GCC-style attribute warn_unused_result
10544 case "$d_attribute_warn_unused_result" in
10547 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
10548 $cat >attrib.c <<'EOCP'
10550 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
10552 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10553 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10554 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
10557 echo "Your C compiler supports __attribute__((warn_unused_result))."
10561 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10565 *) val="$d_attribute_warn_unused_result" ;;
10567 set d_attribute_warn_unused_result
10571 : see if bcmp exists
10575 : see if bcopy exists
10579 : see if getpgrp exists
10580 set getpgrp d_getpgrp
10583 case "$d_getpgrp" in
10586 echo "Checking to see which flavor of getpgrp is in use..."
10588 #$i_unistd I_UNISTD
10589 #include <sys/types.h>
10591 # include <unistd.h>
10593 #$i_stdlib I_STDLIB
10595 #include <stdlib.h>
10599 if (getuid() == 0) {
10600 printf("(I see you are running Configure as super-user...)\n");
10603 #ifdef TRY_BSD_PGRP
10604 if (getpgrp(1) == 0)
10613 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10614 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
10616 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10617 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
10620 echo "I can't seem to compile and run the test program."
10622 xxx="a USG one, i.e. you use getpgrp()."
10624 # SVR4 systems can appear rather BSD-ish.
10625 case "$i_unistd" in
10627 xxx="a BSD one, i.e. you use getpgrp(pid)."
10631 xxx="probably a USG one, i.e. you use getpgrp()."
10636 echo "Assuming your getpgrp is $xxx" >&4
10645 : see if setpgrp exists
10646 set setpgrp d_setpgrp
10649 case "$d_setpgrp" in
10652 echo "Checking to see which flavor of setpgrp is in use..."
10654 #$i_unistd I_UNISTD
10655 #include <sys/types.h>
10657 # include <unistd.h>
10659 #$i_stdlib I_STDLIB
10661 #include <stdlib.h>
10665 if (getuid() == 0) {
10666 printf("(I see you are running Configure as super-user...)\n");
10669 #ifdef TRY_BSD_PGRP
10670 if (-1 == setpgrp(1, 1))
10673 if (setpgrp() != -1)
10679 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10680 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
10682 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10683 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
10686 echo "(I can't seem to compile and run the test program.)"
10688 xxx="a USG one, i.e. you use setpgrp()."
10690 # SVR4 systems can appear rather BSD-ish.
10691 case "$i_unistd" in
10693 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
10697 xxx="probably a USG one, i.e. you use setpgrp()."
10702 echo "Assuming your setpgrp is $xxx" >&4
10711 : Look for GCC-style __builtin_choose_expr
10712 case "$d_builtin_choose_expr" in
10715 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
10716 $cat >try.c <<'EOCP'
10717 #include <assert.h>
10718 #include <stdlib.h>
10721 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
10724 assert( SYRINX(1) == 2112 );
10725 assert( SYRINX(1) != 5150 );
10726 assert( SYRINX(0) == 5150 );
10727 assert( SYRINX(0) != 2112 );
10728 puts( "All good!" );
10734 if eval $compile && $run ./try; then
10735 echo "Your C compiler supports __builtin_choose_expr."
10738 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10742 *) val="$d_builtin_choose_expr" ;;
10745 set d_builtin_choose_expr
10749 : Look for GCC-style __builtin_expect
10750 case "$d_builtin_expect" in
10753 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
10754 $cat >try.c <<'EOCP'
10757 if ( __builtin_expect(n, 0) ) n = 1;
10758 /* Remember shell exit code truth is 0, C truth is non-zero */
10763 if eval $compile && $run ./try; then
10764 echo "Your C compiler supports __builtin_expect."
10767 echo "Your C compiler doesn't seem to understand __builtin_expect."
10771 *) val="$d_builtin_expect" ;;
10774 set d_builtin_expect
10778 : see if bzero exists
10782 : see if stdarg is available
10784 if $test `./findhdr stdarg.h`; then
10785 echo "<stdarg.h> found." >&4
10788 echo "<stdarg.h> NOT found." >&4
10792 : see if varargs is available
10794 if $test `./findhdr varargs.h`; then
10795 echo "<varargs.h> found." >&4
10797 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
10800 : set up the varargs testing programs
10801 $cat > varargs.c <<EOP
10803 #include <stdarg.h>
10806 #include <varargs.h>
10810 int f(char *p, ...)
10824 p = va_arg(ap, char *);
10830 $cat > varargs <<EOP
10832 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
10841 : now check which varargs header should be included
10847 if `./varargs I_STDARG`; then
10849 elif `./varargs I_VARARGS`; then
10854 if `./varargs I_VARARGS`; then
10862 echo "*** WHOA THERE!!! ***" >&4
10863 echo " Your C compiler \"$cc\" doesn't seem to support stdarg or varargs!" >&4
10864 case "$knowitall" in
10866 echo " I'm giving up; maybe you can try again with a different compiler?" >&4
10870 echo "I could not find the definition for va_dcl... You have problems..." >&4
10871 val="$undef"; set i_stdarg; eval $setvar
10872 val="$undef"; set i_varargs; eval $setvar
10877 case "$i_varhdr" in
10879 val="$define"; set i_stdarg; eval $setvar
10880 val="$undef"; set i_varargs; eval $setvar
10883 val="$undef"; set i_stdarg; eval $setvar
10884 val="$define"; set i_varargs; eval $setvar
10887 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
10891 : see if the Compiler supports C99 variadic macros
10892 case "$i_stdarg$i_stdlib" in
10894 echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
10897 #include <stdarg.h>
10899 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
10903 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
10909 if eval $compile && $run ./try 2>&1 >/dev/null; then
10910 case "`$run ./try`" in
10912 echo "You have C99 variadic macros." >&4
10913 d_c99_variadic_macros="$define"
10916 echo "You don't have functional C99 variadic macros." >&4
10917 d_c99_variadic_macros="$undef"
10921 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
10922 d_c99_variadic_macros="$undef"
10927 echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
10928 d_c99_variadic_macros="$undef"
10932 : see if signal is declared as pointer to function returning int or void
10934 xxx=`./findhdr signal.h`
10935 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
10936 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10937 echo "You have int (*signal())() instead of void." >&4
10939 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10940 echo "You have void (*signal())()." >&4
10942 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
10943 echo "You have int (*signal())() instead of void." >&4
10945 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
10946 echo "You have void (*signal())()." >&4
10949 case "$d_voidsig" in
10951 echo "I can't determine whether signal handler returns void or int..." >&4
10953 rp="What type does your signal handler return?"
10956 v*) val="$define";;
10960 echo "As you already told me, signal handler returns void." >&4
10963 *) echo "As you already told me, signal handler returns int." >&4
10970 case "$d_voidsig" in
10971 "$define") signal_t="void";;
10972 *) signal_t="int";;
10976 : check for ability to cast large floats to 32-bit ints.
10978 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
10979 if $test "$intsize" -ge 4; then
10986 #$i_stdlib I_STDLIB
10988 #include <stdlib.h>
10990 #include <sys/types.h>
10991 #include <signal.h>
10992 $signal_t blech(int s) { exit(3); }
10999 signal(SIGFPE, blech);
11001 /* Don't let compiler optimize the test away. Store the number
11002 in a writable string for gcc to pass to sscanf under HP-UX.
11004 sprintf(str, "2147483647");
11005 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
11009 /* x86 processors will probably give 0x8000 0000, which is a
11010 sign change. We don't want that. We want to mimic SPARC
11011 behavior here, which is to preserve the sign and give
11014 if (i32 != ($xxx) f)
11020 if eval $compile_ok; then
11024 echo "(I can't seem to compile the test program--assuming it can't)"
11029 echo "Yup, it can."
11032 echo "Nope, it can't."
11039 : check for ability to cast negative floats to unsigned
11041 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
11044 #$i_stdlib I_STDLIB
11046 #include <stdlib.h>
11048 #include <sys/types.h>
11049 #include <signal.h>
11050 $signal_t blech(int s) { exit(7); }
11051 $signal_t blech_in_list(int s) { exit(4); }
11052 unsigned long dummy_long(unsigned long p) { return p; }
11053 unsigned int dummy_int(unsigned int p) { return p; }
11054 unsigned short dummy_short(unsigned short p) { return p; }
11058 unsigned long along;
11060 unsigned short ashort;
11064 /* Frustrate gcc-2.7.2's optimizer which failed this test with
11065 a direct f = -123. assignment. gcc-2.8.0 reportedly
11066 optimized the whole file away
11068 /* Store the number in a writable string for gcc to pass to
11069 sscanf under HP-UX.
11071 sprintf(str, "-123");
11072 sscanf(str, "%lf", &f); /* f = -123.; */
11074 signal(SIGFPE, blech);
11075 along = (unsigned long)f;
11076 aint = (unsigned int)f;
11077 ashort = (unsigned short)f;
11078 if (along != (unsigned long)-123)
11080 if (aint != (unsigned int)-123)
11082 if (ashort != (unsigned short)-123)
11084 sprintf(str, "1073741824.");
11085 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
11088 along = (unsigned long)f;
11089 if (along != 0x80000000)
11093 along = (unsigned long)f;
11094 if (along != 0x7fffffff)
11098 along = (unsigned long)f;
11099 if (along != 0x80000001)
11103 signal(SIGFPE, blech_in_list);
11104 sprintf(str, "123.");
11105 sscanf(str, "%lf", &f); /* f = 123.; */
11106 along = dummy_long((unsigned long)f);
11107 aint = dummy_int((unsigned int)f);
11108 ashort = dummy_short((unsigned short)f);
11109 if (along != (unsigned long)123)
11111 if (aint != (unsigned int)123)
11113 if (ashort != (unsigned short)123)
11120 if eval $compile_ok; then
11124 echo "(I can't seem to compile the test program--assuming it can't)"
11127 case "$castflags" in
11129 echo "Yup, it can."
11132 echo "Nope, it can't."
11139 : see if vprintf exists
11141 if set vprintf val -f d_vprintf; eval $csym; $val; then
11142 echo 'vprintf() found.' >&4
11145 #$i_stdarg I_STDARG /* Only one of these can be defined by i_varhrd */
11146 #$i_varargs I_VARARGS
11148 #$i_stdlib I_STDLIB
11149 #$i_unistd I_UNISTD
11152 # include <stdarg.h>
11153 #else /* I_VARARGS */
11154 # include <varargs.h>
11158 # include <unistd.h>
11162 # include <stdlib.h>
11165 #include <stdio.h> /* vsprintf prototype */
11168 void xxx(int n, ...)
11173 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11175 int main() { xxx(1, "foo"); }
11177 #else /* I_VARARGS */
11185 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11187 int main() { xxx("foo"); }
11193 if eval $compile_ok; then
11194 if $run ./try; then
11195 echo "Your vsprintf() returns (int)." >&4
11198 echo "Your vsprintf() returns (char*)." >&4
11202 echo 'I am unable to compile the vsprintf() test program.' >&4
11203 # We shouldn't get here. If we do, assume the standard signature,
11204 # not the old BSD one.
11205 echo 'Guessing that vsprintf() returns (int).' >&4
11209 echo 'vprintf() NOT found.' >&4
11220 : see if chown exists
11224 : see if chroot exists
11225 set chroot d_chroot
11228 : see if chsize exists
11229 set chsize d_chsize
11232 : see if class exists
11236 : see if clearenv exists
11237 set clearenv d_clearenv
11240 : Define hasstruct macro for Configure internal use
11241 hasstruct='varname=$1; struct=$2; shift; shift;
11242 while $test $# -ge 2; do
11244 $define) echo "#include <$2>";;
11248 echo "int main () { struct $struct foo; }" >> try.c;
11250 if eval $compile; then
11259 : see whether socket exists
11263 $echo $n "Hmm... $c" >&4
11264 if set socket val -f d_socket; eval $csym; $val; then
11265 echo "Looks like you have Berkeley networking support." >&4
11267 if set setsockopt val -f; eval $csym; $val; then
11270 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
11271 d_oldsock="$define"
11274 if $contains socklib libc.list >/dev/null 2>&1; then
11275 echo "Looks like you have Berkeley networking support." >&4
11277 : we will have to assume that it supports the 4.2 BSD interface
11280 echo "You don't have Berkeley networking in libc$_a..." >&4
11281 if test "X$d_socket" = "X$define"; then
11282 echo "...but you seem to believe that you have sockets." >&4
11284 for net in net socket
11286 if test -f /usr/lib/lib$net$_a; then
11287 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
11288 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
11289 if $contains socket libc.list >/dev/null 2>&1; then
11294 echo "...but the Wollongong group seems to have hacked it in." >&4
11295 sockethdr="-I/usr/netinclude"
11298 echo "Found Berkeley sockets interface in lib$net." >&4
11299 if $contains setsockopt libc.list >/dev/null 2>&1; then
11302 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
11303 d_oldsock="$define"
11309 if test "X$d_socket" != "X$define"; then
11310 echo "or anywhere else I see." >&4
11318 : see if socketpair exists
11319 set socketpair d_sockpair
11324 echo "Checking the availability sa_len in the sock struct ..." >&4
11326 #include <sys/types.h>
11327 #include <sys/socket.h>
11329 struct sockaddr sa;
11330 return (sa.sa_len);
11334 set try; if eval $compile; then
11337 set d_sockaddr_sa_len; eval $setvar
11341 echo "Checking the availability struct sockaddr_in6 ..." >&4
11343 #include <sys/types.h>
11344 #include <sys/socket.h>
11345 #include <netinet/in.h>
11347 struct sockaddr_in6 sin6;
11348 return (sin6.sin6_family);
11352 set try; if eval $compile; then
11355 set d_sockaddr_in6; eval $setvar
11359 echo "Checking the availability sin6_scope_id in struct sockaddr_in6 ..." >&4
11361 #include <sys/types.h>
11362 #include <sys/socket.h>
11363 #include <netinet/in.h>
11365 struct sockaddr_in6 sin6;
11366 return (sin6.sin6_scope_id);
11370 set try; if eval $compile; then
11373 set d_sin6_scope_id; eval $setvar
11377 echo "Checking the availability struct ip_mreq ..." >&4
11379 #include <sys/types.h>
11380 #include <sys/socket.h>
11381 #include <netinet/in.h>
11383 struct ip_mreq mreq;
11384 return (mreq.imr_multiaddr.s_addr);
11388 set try; if eval $compile; then
11391 set d_ip_mreq; eval $setvar
11395 echo "Checking the availability struct ip_mreq_source ..." >&4
11397 #include <sys/types.h>
11398 #include <sys/socket.h>
11399 #include <netinet/in.h>
11401 struct ip_mreq_source mreq;
11402 return (mreq.imr_multiaddr.s_addr);
11406 set try; if eval $compile; then
11409 set d_ip_mreq_source; eval $setvar
11413 echo "Checking the availability struct ipv6_mreq ..." >&4
11415 #include <sys/types.h>
11416 #include <sys/socket.h>
11417 #include <netinet/in.h>
11419 struct ipv6_mreq mreq;
11420 return (mreq.ipv6mr_interface);
11424 set try; if eval $compile; then
11427 set d_ipv6_mreq; eval $setvar
11431 echo "Checking the availability struct ipv6_mreq_source ..." >&4
11433 #include <sys/types.h>
11434 #include <sys/socket.h>
11435 #include <netinet/in.h>
11437 struct ipv6_mreq_source mreq;
11438 return (mreq.imr_multiaddr.s_addr);
11442 set try; if eval $compile; then
11445 set d_ipv6_mreq_source; eval $setvar
11449 echo "Checking the availability of certain socket constants..." >&4
11450 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
11451 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
11453 #include <sys/types.h>
11454 #include <sys/socket.h>
11460 set try; if eval $compile; then
11463 set d_${enum}; eval $setvar
11467 : see if this is a sys/uio.h system
11468 set sys/uio.h i_sysuio
11471 : Check for cmsghdr support
11473 echo "Checking to see if your system supports struct cmsghdr..." >&4
11474 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
11476 case "$d_cmsghdr_s" in
11477 "$define") echo "Yes, it does." ;;
11478 *) echo "No, it doesn't." ;;
11482 : check for const keyword
11484 echo 'Checking to see if your C compiler knows about "const"...' >&4
11485 $cat >const.c <<'EOCP'
11486 typedef struct spug { int drokk; } spug;
11490 const spug y = { 0 };
11493 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
11495 echo "Yup, it does."
11498 echo "Nope, it doesn't."
11503 : see if copysignl exists
11504 set copysignl d_copysignl
11507 : see if crypt exists
11512 $define) cryptlib='' ;;
11513 *) if set crypt val -f d_crypt; eval $csym; $val; then
11514 echo 'crypt() found.' >&4
11518 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
11519 if $test -z "$cryptlib"; then
11520 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
11524 if $test -z "$cryptlib"; then
11525 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
11529 if $test -z "$cryptlib"; then
11530 cryptlib=`./loc libcrypt$_a "" $libpth`
11534 if $test -z "$cryptlib"; then
11535 echo 'crypt() NOT found.' >&4
11546 : see if this is a crypt.h system
11547 set crypt.h i_crypt
11550 : see if crypt_r exists
11551 set crypt_r d_crypt_r
11553 case "$d_crypt_r" in
11555 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
11556 case "$d_crypt_r_proto:$usethreads" in
11557 ":define") d_crypt_r_proto=define
11558 set d_crypt_r_proto crypt_r $hdrs
11562 case "$d_crypt_r_proto" in
11564 case "$crypt_r_proto" in
11565 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
11566 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCS ;;
11568 case "$crypt_r_proto" in
11569 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
11570 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCD ;;
11572 case "$crypt_r_proto" in
11573 ''|0) d_crypt_r=undef
11575 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
11576 * ) case "$crypt_r_proto" in
11577 REENTRANT_PROTO*) ;;
11578 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
11580 echo "Prototype: $try" ;;
11583 *) case "$usethreads" in
11584 define) echo "crypt_r has no prototype, not using it." >&4 ;;
11595 : get csh whereabouts
11597 'csh') val="$undef" ;;
11598 *) val="$define" ;;
11602 : Respect a hint or command line value for full_csh.
11603 case "$full_csh" in
11604 '') full_csh=$csh ;;
11607 : see if ctermid exists
11608 set ctermid d_ctermid
11611 : see if ctermid_r exists
11612 set ctermid_r d_ctermid_r
11614 case "$d_ctermid_r" in
11616 hdrs="$i_systypes sys/types.h define stdio.h "
11617 case "$d_ctermid_r_proto:$usethreads" in
11618 ":define") d_ctermid_r_proto=define
11619 set d_ctermid_r_proto ctermid_r $hdrs
11623 case "$d_ctermid_r_proto" in
11625 case "$ctermid_r_proto" in
11626 ''|0) try='char* ctermid_r(char*);'
11627 ./protochk "$extern_C $try" $hdrs && ctermid_r_proto=B_B ;;
11629 case "$ctermid_r_proto" in
11630 ''|0) d_ctermid_r=undef
11632 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
11633 * ) case "$ctermid_r_proto" in
11634 REENTRANT_PROTO*) ;;
11635 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
11637 echo "Prototype: $try" ;;
11640 *) case "$usethreads" in
11641 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
11648 *) ctermid_r_proto=0
11652 : see if ctime_r exists
11653 set ctime_r d_ctime_r
11655 case "$d_ctime_r" in
11657 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
11658 case "$d_ctime_r_proto:$usethreads" in
11659 ":define") d_ctime_r_proto=define
11660 set d_ctime_r_proto ctime_r $hdrs
11664 case "$d_ctime_r_proto" in
11666 case "$ctime_r_proto" in
11667 ''|0) try='char* ctime_r(const time_t*, char*);'
11668 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SB ;;
11670 case "$ctime_r_proto" in
11671 ''|0) try='char* ctime_r(const time_t*, char*, int);'
11672 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SBI ;;
11674 case "$ctime_r_proto" in
11675 ''|0) try='int ctime_r(const time_t*, char*);'
11676 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SB ;;
11678 case "$ctime_r_proto" in
11679 ''|0) try='int ctime_r(const time_t*, char*, int);'
11680 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SBI ;;
11682 case "$ctime_r_proto" in
11683 ''|0) d_ctime_r=undef
11685 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
11686 * ) case "$ctime_r_proto" in
11687 REENTRANT_PROTO*) ;;
11688 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
11690 echo "Prototype: $try" ;;
11693 *) case "$usethreads" in
11694 define) echo "ctime_r has no prototype, not using it." >&4 ;;
11705 : see if cuserid exists
11706 set cuserid d_cuserid
11709 : see if this is a limits.h system
11710 set limits.h i_limits
11713 : see if this is a float.h system
11714 set float.h i_float
11717 : See if number of significant digits in a double precision number is known
11719 $cat >dbl_dig.c <<EOM
11720 #$i_limits I_LIMITS
11723 #include <limits.h>
11729 printf("Contains DBL_DIG");
11732 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
11733 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
11734 echo "DBL_DIG found." >&4
11737 echo "DBL_DIG NOT found." >&4
11744 : see if dbm.h is available
11745 : see if dbmclose exists
11746 set dbmclose d_dbmclose
11749 case "$d_dbmclose" in
11759 *) set rpcsvc/dbm.h i_rpcsvcdbm
11764 *) echo "We won't be including <dbm.h>"
11774 : see if prototype for dbminit is available
11776 set d_dbminitproto dbminit $i_dbm dbm.h
11779 : see if difftime exists
11780 set difftime d_difftime
11783 : see if this is a dirent system
11785 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
11787 echo "<dirent.h> found." >&4
11790 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
11791 echo "<sys/dir.h> found." >&4
11794 xinc=`./findhdr sys/ndir.h`
11796 echo "<dirent.h> NOT found." >&4
11801 : Look for type of directory structure.
11803 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11805 case "$direntrytype" in
11807 case "$i_dirent" in
11808 $define) guess1='struct dirent' ;;
11809 *) guess1='struct direct' ;;
11812 *) guess1="$direntrytype"
11817 'struct dirent') guess2='struct direct' ;;
11818 *) guess2='struct dirent' ;;
11821 if $contains "$guess1" try.c >/dev/null 2>&1; then
11822 direntrytype="$guess1"
11823 echo "Your directory entries are $direntrytype." >&4
11824 elif $contains "$guess2" try.c >/dev/null 2>&1; then
11825 direntrytype="$guess2"
11826 echo "Your directory entries seem to be $direntrytype." >&4
11828 echo "I don't recognize your system's directory entries." >&4
11829 rp="What type is used for directory entries on this system?"
11832 direntrytype="$ans"
11836 : see if the directory entry stores field length
11838 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11839 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
11840 echo "Good, your directory entry keeps length information in d_namlen." >&4
11843 echo "Your directory entry does not know about the d_namlen field." >&4
11850 : Look for DIR.dd_fd
11851 case "$i_dirent" in
11853 echo "Checking to see if DIR has a dd_fd member variable" >&4
11855 #$i_stdlib I_STDLIB
11857 #include <stdlib.h>
11859 #include <dirent.h>
11869 if eval $compile; then
11870 echo "Yes, it does."
11873 echo "No, it does not."
11878 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
11886 : see if this is an sysdir system
11887 set sys/dir.h i_sysdir
11890 : see if this is an sysndir system
11891 set sys/ndir.h i_sysndir
11896 $cat >dirfd.c <<EOM
11898 #$i_stdlib I_STDLIB
11900 #include <stdlib.h>
11902 #$i_dirent I_DIRENT /**/
11903 #$i_sysdir I_SYS_DIR /**/
11904 #$i_sysndir I_SYS_NDIR /**/
11905 #$i_systypes I_SYS_TYPES /**/
11906 #if defined(I_SYS_TYPES)
11907 #include <sys/types.h>
11909 #if defined(I_DIRENT)
11910 #include <dirent.h>
11911 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
11912 #include <sys/dir.h>
11916 #include <sys/ndir.h>
11920 #include <ndir.h> /* may be wrong in the future */
11922 #include <sys/dir.h>
11928 DIR *dirp = opendir(".");
11929 if (dirfd(dirp) >= 0)
11937 if eval $compile; then
11941 $define) echo "dirfd() found." >&4 ;;
11942 *) echo "dirfd() NOT found." >&4 ;;
11948 : see if dlerror exists
11951 set dlerror d_dlerror
11955 : see if dlfcn is available
11956 set dlfcn.h i_dlfcn
11959 : Check what extension to use for shared libs
11964 On a few systems, the dynamically loaded modules that perl generates and uses
11965 will need a different extension than shared libs. The default will probably
11971 *) dflt="$dlext" ;;
11973 rp='What is the extension of dynamically loaded modules'
11982 : Check if dlsym need a leading underscore
11988 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
11989 $cat >dyna.c <<'EOM'
11996 #$i_stdlib I_STDLIB
11998 #include <stdlib.h>
12002 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
12004 #include <sys/types.h>
12009 extern int fred() ;
12018 int mode = RTLD_LAZY ;
12020 handle = dlopen("./dyna.$dlext", mode) ;
12021 if (handle == NULL) {
12026 symbol = dlsym(handle, "fred") ;
12027 if (symbol == NULL) {
12028 /* try putting a leading underscore */
12029 symbol = dlsym(handle, "_fred") ;
12030 if (symbol == NULL) {
12043 : Call the object file tmp-dyna.o in case dlext=o.
12044 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
12045 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
12046 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
12047 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
12050 1) echo "Test program failed using dlopen." >&4
12051 echo "Perhaps you should not use dynamic loading." >&4;;
12052 2) echo "Test program failed using dlsym." >&4
12053 echo "Perhaps you should not use dynamic loading." >&4;;
12054 3) echo "dlsym needs a leading underscore" >&4
12056 4) echo "dlsym doesn't need a leading underscore." >&4;;
12059 echo "I can't compile and run the test program." >&4
12060 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
12065 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
12070 : see if drand48_r exists
12071 set drand48_r d_drand48_r
12073 case "$d_drand48_r" in
12075 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
12076 case "$d_drand48_r_proto:$usethreads" in
12077 ":define") d_drand48_r_proto=define
12078 set d_drand48_r_proto drand48_r $hdrs
12082 case "$d_drand48_r_proto" in
12084 case "$drand48_r_proto" in
12085 ''|0) try='int drand48_r(struct drand48_data*, double*);'
12086 ./protochk "$extern_C $try" $hdrs && drand48_r_proto=I_ST ;;
12088 case "$drand48_r_proto" in
12089 ''|0) d_drand48_r=undef
12091 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
12092 * ) case "$drand48_r_proto" in
12093 REENTRANT_PROTO*) ;;
12094 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
12096 echo "Prototype: $try" ;;
12099 *) case "$usethreads" in
12100 define) echo "drand48_r has no prototype, not using it." >&4 ;;
12107 *) drand48_r_proto=0
12111 : see if prototype for drand48 is available
12113 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
12116 : see if dup2 exists
12120 : see if eaccess exists
12121 set eaccess d_eaccess
12124 : see if endgrent exists
12125 set endgrent d_endgrent
12128 : see if this is an grp system
12134 xxx=`./findhdr grp.h`
12135 $cppstdin $cppflags $cppminus < $xxx >$$.h
12137 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
12149 set d_grpasswd; eval $setvar
12153 : see if endgrent_r exists
12154 set endgrent_r d_endgrent_r
12156 case "$d_endgrent_r" in
12158 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12159 case "$d_endgrent_r_proto:$usethreads" in
12160 ":define") d_endgrent_r_proto=define
12161 set d_endgrent_r_proto endgrent_r $hdrs
12165 case "$d_endgrent_r_proto" in
12167 case "$endgrent_r_proto" in
12168 ''|0) try='int endgrent_r(FILE**);'
12169 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=I_H ;;
12171 case "$endgrent_r_proto" in
12172 ''|0) try='void endgrent_r(FILE**);'
12173 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=V_H ;;
12175 case "$endgrent_r_proto" in
12176 ''|0) d_endgrent_r=undef
12178 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
12179 * ) case "$endgrent_r_proto" in
12180 REENTRANT_PROTO*) ;;
12181 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
12183 echo "Prototype: $try" ;;
12186 *) case "$usethreads" in
12187 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
12194 *) endgrent_r_proto=0
12198 : see if endhostent exists
12199 set endhostent d_endhent
12202 : see if this is a netdb.h system
12203 set netdb.h i_netdb
12206 : see if endhostent_r exists
12207 set endhostent_r d_endhostent_r
12209 case "$d_endhostent_r" in
12211 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12212 case "$d_endhostent_r_proto:$usethreads" in
12213 ":define") d_endhostent_r_proto=define
12214 set d_endhostent_r_proto endhostent_r $hdrs
12218 case "$d_endhostent_r_proto" in
12220 case "$endhostent_r_proto" in
12221 ''|0) try='int endhostent_r(struct hostent_data*);'
12222 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=I_D ;;
12224 case "$endhostent_r_proto" in
12225 ''|0) try='void endhostent_r(struct hostent_data*);'
12226 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=V_D ;;
12228 case "$endhostent_r_proto" in
12229 ''|0) d_endhostent_r=undef
12230 endhostent_r_proto=0
12231 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
12232 * ) case "$endhostent_r_proto" in
12233 REENTRANT_PROTO*) ;;
12234 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
12236 echo "Prototype: $try" ;;
12239 *) case "$usethreads" in
12240 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
12242 d_endhostent_r=undef
12243 endhostent_r_proto=0
12247 *) endhostent_r_proto=0
12251 : see if endnetent exists
12252 set endnetent d_endnent
12255 : see if endnetent_r exists
12256 set endnetent_r d_endnetent_r
12258 case "$d_endnetent_r" in
12260 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12261 case "$d_endnetent_r_proto:$usethreads" in
12262 ":define") d_endnetent_r_proto=define
12263 set d_endnetent_r_proto endnetent_r $hdrs
12267 case "$d_endnetent_r_proto" in
12269 case "$endnetent_r_proto" in
12270 ''|0) try='int endnetent_r(struct netent_data*);'
12271 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=I_D ;;
12273 case "$endnetent_r_proto" in
12274 ''|0) try='void endnetent_r(struct netent_data*);'
12275 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=V_D ;;
12277 case "$endnetent_r_proto" in
12278 ''|0) d_endnetent_r=undef
12279 endnetent_r_proto=0
12280 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
12281 * ) case "$endnetent_r_proto" in
12282 REENTRANT_PROTO*) ;;
12283 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
12285 echo "Prototype: $try" ;;
12288 *) case "$usethreads" in
12289 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
12291 d_endnetent_r=undef
12292 endnetent_r_proto=0
12296 *) endnetent_r_proto=0
12300 : see if endprotoent exists
12301 set endprotoent d_endpent
12304 : see if endprotoent_r exists
12305 set endprotoent_r d_endprotoent_r
12307 case "$d_endprotoent_r" in
12309 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12310 case "$d_endprotoent_r_proto:$usethreads" in
12311 ":define") d_endprotoent_r_proto=define
12312 set d_endprotoent_r_proto endprotoent_r $hdrs
12316 case "$d_endprotoent_r_proto" in
12318 case "$endprotoent_r_proto" in
12319 ''|0) try='int endprotoent_r(struct protoent_data*);'
12320 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=I_D ;;
12322 case "$endprotoent_r_proto" in
12323 ''|0) try='void endprotoent_r(struct protoent_data*);'
12324 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=V_D ;;
12326 case "$endprotoent_r_proto" in
12327 ''|0) d_endprotoent_r=undef
12328 endprotoent_r_proto=0
12329 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
12330 * ) case "$endprotoent_r_proto" in
12331 REENTRANT_PROTO*) ;;
12332 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
12334 echo "Prototype: $try" ;;
12337 *) case "$usethreads" in
12338 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
12340 d_endprotoent_r=undef
12341 endprotoent_r_proto=0
12345 *) endprotoent_r_proto=0
12349 : see if endpwent exists
12350 set endpwent d_endpwent
12353 : see if this is a pwd.h system
12359 xxx=`./findhdr pwd.h`
12360 $cppstdin $cppflags $cppminus < $xxx >$$.h
12362 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
12370 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
12378 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
12386 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
12394 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
12402 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
12410 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
12418 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
12430 set d_pwquota; eval $setvar
12431 set d_pwage; eval $setvar
12432 set d_pwchange; eval $setvar
12433 set d_pwclass; eval $setvar
12434 set d_pwexpire; eval $setvar
12435 set d_pwcomment; eval $setvar
12436 set d_pwgecos; eval $setvar
12437 set d_pwpasswd; eval $setvar
12441 : see if endpwent_r exists
12442 set endpwent_r d_endpwent_r
12444 case "$d_endpwent_r" in
12446 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
12447 case "$d_endpwent_r_proto:$usethreads" in
12448 ":define") d_endpwent_r_proto=define
12449 set d_endpwent_r_proto endpwent_r $hdrs
12453 case "$d_endpwent_r_proto" in
12455 case "$endpwent_r_proto" in
12456 ''|0) try='int endpwent_r(FILE**);'
12457 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=I_H ;;
12459 case "$endpwent_r_proto" in
12460 ''|0) try='void endpwent_r(FILE**);'
12461 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=V_H ;;
12463 case "$endpwent_r_proto" in
12464 ''|0) d_endpwent_r=undef
12466 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
12467 * ) case "$endpwent_r_proto" in
12468 REENTRANT_PROTO*) ;;
12469 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
12471 echo "Prototype: $try" ;;
12474 *) case "$usethreads" in
12475 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
12482 *) endpwent_r_proto=0
12486 : see if endservent exists
12487 set endservent d_endsent
12490 : see if endservent_r exists
12491 set endservent_r d_endservent_r
12493 case "$d_endservent_r" in
12495 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12496 case "$d_endservent_r_proto:$usethreads" in
12497 ":define") d_endservent_r_proto=define
12498 set d_endservent_r_proto endservent_r $hdrs
12502 case "$d_endservent_r_proto" in
12504 case "$endservent_r_proto" in
12505 ''|0) try='int endservent_r(struct servent_data*);'
12506 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=I_D ;;
12508 case "$endservent_r_proto" in
12509 ''|0) try='void endservent_r(struct servent_data*);'
12510 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=V_D ;;
12512 case "$endservent_r_proto" in
12513 ''|0) d_endservent_r=undef
12514 endservent_r_proto=0
12515 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
12516 * ) case "$endservent_r_proto" in
12517 REENTRANT_PROTO*) ;;
12518 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
12520 echo "Prototype: $try" ;;
12523 *) case "$usethreads" in
12524 define) echo "endservent_r has no prototype, not using it." >&4 ;;
12526 d_endservent_r=undef
12527 endservent_r_proto=0
12531 *) endservent_r_proto=0
12535 : Locate the flags for 'open()'
12538 #include <sys/types.h>
12543 #include <sys/file.h>
12545 #$i_stdlib I_STDLIB
12547 #include <stdlib.h>
12558 : check sys/file.h first to get FREAD on Sun
12559 if $test `./findhdr sys/file.h` && \
12560 set try -DI_SYS_FILE && eval $compile; then
12562 echo "<sys/file.h> defines the O_* constants..." >&4
12563 if $run ./try; then
12564 echo "and you have the 3 argument form of open()." >&4
12567 echo "but not the 3 argument form of open(). Oh, well." >&4
12570 elif $test `./findhdr fcntl.h` && \
12571 set try -DI_FCNTL && eval $compile; then
12573 echo "<fcntl.h> defines the O_* constants..." >&4
12574 if $run ./try; then
12575 echo "and you have the 3 argument form of open()." >&4
12578 echo "but not the 3 argument form of open(). Oh, well." >&4
12583 echo "I can't find the O_* constant definitions! You got problems." >&4
12589 : see if this is a sys/file.h system
12594 : do we need to include sys/file.h ?
12598 if $h_sysfile; then
12600 echo "We'll be including <sys/file.h>." >&4
12603 echo "We won't be including <sys/file.h>." >&4
12613 : see if fcntl.h is there
12618 : see if we can include fcntl.h
12624 echo "We'll be including <fcntl.h>." >&4
12627 if $h_sysfile; then
12628 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
12630 echo "We won't be including <fcntl.h>." >&4
12642 : see if fork exists
12646 : see if pipe exists
12650 : check for non-blocking I/O stuff
12651 case "$h_sysfile" in
12652 true) echo "#include <sys/file.h>" > head.c;;
12655 true) echo "#include <fcntl.h>" > head.c;;
12656 *) echo "#include <sys/fcntl.h>" > head.c;;
12661 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
12662 case "$o_nonblock" in
12664 $cat head.c > try.c
12665 $cat >>try.c <<EOCP
12667 #$i_stdlib I_STDLIB
12669 #include <stdlib.h>
12677 printf("O_NONBLOCK\n");
12681 printf("O_NDELAY\n");
12685 printf("FNDELAY\n");
12692 if eval $compile_ok; then
12693 o_nonblock=`$run ./try`
12694 case "$o_nonblock" in
12695 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
12696 *) echo "Seems like we can use $o_nonblock.";;
12699 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
12702 *) echo "Using $hint value $o_nonblock.";;
12707 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
12710 case "$d_fork:$d_pipe" in
12712 $cat head.c > try.c
12713 $cat >>try.c <<EOCP
12715 #include <sys/types.h>
12716 #include <signal.h>
12718 #$i_stdlib I_STDLIB
12720 #include <stdlib.h>
12726 #define MY_O_NONBLOCK $o_nonblock
12727 #ifndef errno /* XXX need better Configure test */
12730 #$i_unistd I_UNISTD
12732 #include <unistd.h>
12734 #$i_string I_STRING
12736 #include <string.h>
12738 #include <strings.h>
12740 $signal_t blech(int x) { exit(3); }
12742 $cat >> try.c <<'EOCP'
12750 pipe(pd); /* Down: child -> parent */
12751 pipe(pu); /* Up: parent -> child */
12754 close(pd[1]); /* Parent reads from pd[0] */
12755 close(pu[0]); /* Parent writes (blocking) to pu[1] */
12757 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
12762 signal(SIGALRM, blech);
12764 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
12766 sprintf(string, "%d\n", ret);
12767 write(2, string, strlen(string));
12770 if (errno == EAGAIN) {
12771 printf("EAGAIN\n");
12776 if (errno == EWOULDBLOCK)
12777 printf("EWOULDBLOCK\n");
12780 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
12781 sleep(2); /* Give it time to close our pipe */
12783 ret = read(pd[0], buf, 1); /* Should read EOF */
12785 sprintf(string, "%d\n", ret);
12786 write(4, string, strlen(string));
12790 close(pd[0]); /* We write to pd[1] */
12791 close(pu[1]); /* We read from pu[0] */
12792 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
12793 close(pd[1]); /* Pipe pd is now fully closed! */
12794 exit(0); /* Bye bye, thank you for playing! */
12798 if eval $compile_ok; then
12799 echo "$startsh" >mtry
12800 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
12802 ./mtry >/dev/null 2>&1
12804 0) eagain=`$cat try.out`;;
12805 1) echo "Could not perform non-blocking setting!";;
12806 2) echo "I did a successful read() for something that was not there!";;
12807 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
12808 4) echo "Could not find F_SETFL!";;
12809 *) echo "Something terribly wrong happened during testing.";;
12811 rd_nodata=`$cat try.ret`
12812 echo "A read() system call with no data present returns $rd_nodata."
12813 case "$rd_nodata" in
12816 echo "(That's peculiar, fixing that to be -1.)"
12822 echo "Forcing errno EAGAIN on read() with no data available."
12826 echo "Your read() sets errno to $eagain when no data is available."
12829 status=`$cat try.err`
12831 0) echo "And it correctly returns 0 to signal EOF.";;
12832 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
12833 *) echo "However, your read() returns '$status' on EOF??";;
12836 if test "$status" = "$rd_nodata"; then
12837 echo "WARNING: you can't distinguish between EOF and no data!"
12841 echo "I can't compile the test program--assuming errno EAGAIN will do."
12845 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
12854 echo "Using $hint value $eagain."
12855 echo "Your read() returns $rd_nodata when no data is present."
12856 case "$d_eofnblk" in
12857 "$define") echo "And you can see EOF because read() returns 0.";;
12858 "$undef") echo "But you can't see EOF status from read() returned value.";;
12860 echo "(Assuming you can't see EOF status from read anyway.)"
12866 $rm_try head.c mtry
12868 : see if _ptr and _cnt from stdio act std
12871 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
12872 echo "(Looks like you have stdio.h from BSD.)"
12873 case "$stdio_ptr" in
12874 '') stdio_ptr='((fp)->_p)'
12877 *) ptr_lval=$d_stdio_ptr_lval;;
12879 case "$stdio_cnt" in
12880 '') stdio_cnt='((fp)->_r)'
12883 *) cnt_lval=$d_stdio_cnt_lval;;
12885 case "$stdio_base" in
12886 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
12888 case "$stdio_bufsiz" in
12889 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
12891 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
12892 echo "(Looks like you have stdio.h from Linux.)"
12893 case "$stdio_ptr" in
12894 '') stdio_ptr='((fp)->_IO_read_ptr)'
12897 *) ptr_lval=$d_stdio_ptr_lval;;
12899 case "$stdio_cnt" in
12900 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
12903 *) cnt_lval=$d_stdio_cnt_lval;;
12905 case "$stdio_base" in
12906 '') stdio_base='((fp)->_IO_read_base)';;
12908 case "$stdio_bufsiz" in
12909 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
12912 case "$stdio_ptr" in
12913 '') stdio_ptr='((fp)->_ptr)'
12916 *) ptr_lval=$d_stdio_ptr_lval;;
12918 case "$stdio_cnt" in
12919 '') stdio_cnt='((fp)->_cnt)'
12922 *) cnt_lval=$d_stdio_cnt_lval;;
12924 case "$stdio_base" in
12925 '') stdio_base='((fp)->_base)';;
12927 case "$stdio_bufsiz" in
12928 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
12932 : test whether _ptr and _cnt really work
12933 echo "Checking how std your stdio is..." >&4
12936 #$i_stdlib I_STDLIB
12938 #include <stdlib.h>
12940 #define FILE_ptr(fp) $stdio_ptr
12941 #define FILE_cnt(fp) $stdio_cnt
12943 FILE *fp = fopen("try.c", "r");
12946 18 <= FILE_cnt(fp) &&
12947 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12955 if eval $compile && $to try.c; then
12956 if $run ./try; then
12957 echo "Your stdio acts pretty std."
12960 echo "Your stdio isn't very std."
12963 echo "Your stdio doesn't appear very std."
12967 # glibc 2.2.90 and above apparently change stdio streams so Perl's
12968 # direct buffer manipulation no longer works. The Configure tests
12969 # should be changed to correctly detect this, but until then,
12970 # the following check should at least let perl compile and run.
12971 # (This quick fix should be updated before 5.8.1.)
12972 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
12973 # A. Dougherty, June 3, 2002.
12974 case "$d_gnulibc" in
12976 case "$gnulibc_version" in
12980 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
12989 : Can _ptr be used as an lvalue?
12990 case "$d_stdstdio$ptr_lval" in
12991 $define$define) val=$define ;;
12994 set d_stdio_ptr_lval
12997 : Can _cnt be used as an lvalue?
12998 case "$d_stdstdio$cnt_lval" in
12999 $define$define) val=$define ;;
13002 set d_stdio_cnt_lval
13006 : test whether setting _ptr sets _cnt as a side effect
13007 d_stdio_ptr_lval_sets_cnt="$undef"
13008 d_stdio_ptr_lval_nochange_cnt="$undef"
13009 case "$d_stdio_ptr_lval$d_stdstdio" in
13011 echo "Checking to see what happens if we set the stdio ptr..." >&4
13014 /* Can we scream? */
13015 /* Eat dust sed :-) */
13016 /* In the buffer space, no one can hear you scream. */
13017 #$i_stdlib I_STDLIB
13019 #include <stdlib.h>
13021 #define FILE_ptr(fp) $stdio_ptr
13022 #define FILE_cnt(fp) $stdio_cnt
13023 #include <sys/types.h>
13025 FILE *fp = fopen("try.c", "r");
13030 puts("Fail even to read");
13033 c = getc(fp); /* Read away the first # */
13035 puts("Fail even to read");
13039 18 <= FILE_cnt(fp) &&
13040 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13042 puts("Fail even to read");
13045 ptr = (char*) FILE_ptr(fp);
13046 cnt = (size_t)FILE_cnt(fp);
13048 FILE_ptr(fp) += 42;
13050 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
13051 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
13054 if (FILE_cnt(fp) <= 20) {
13055 printf ("Fail (<20 chars to test)");
13058 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
13059 puts("Fail compare");
13062 if (cnt == FILE_cnt(fp)) {
13063 puts("Pass_unchanged");
13066 if (FILE_cnt(fp) == (cnt - 42)) {
13067 puts("Pass_changed");
13070 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
13076 if eval $compile && $to try.c; then
13077 case `$run ./try` in
13079 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
13080 d_stdio_ptr_lval_sets_cnt="$define" ;;
13082 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
13083 d_stdio_ptr_lval_nochange_cnt="$define" ;;
13085 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
13087 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
13090 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
13096 : see if _base is also standard
13098 case "$d_stdstdio" in
13102 #$i_stdlib I_STDLIB
13104 #include <stdlib.h>
13106 #define FILE_base(fp) $stdio_base
13107 #define FILE_bufsiz(fp) $stdio_bufsiz
13109 FILE *fp = fopen("try.c", "r");
13112 19 <= FILE_bufsiz(fp) &&
13113 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
13120 if eval $compile && $to try.c; then
13121 if $run ./try; then
13122 echo "And its _base field acts std."
13125 echo "But its _base field isn't std."
13128 echo "However, it seems to be lacking the _base field."
13136 : see if fast_stdio exists
13138 case "$d_stdstdio:$d_stdio_ptr_lval" in
13140 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
13142 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
13153 : see if fchdir exists
13154 set fchdir d_fchdir
13157 : see if fchmod exists
13158 set fchmod d_fchmod
13161 : see if fchown exists
13162 set fchown d_fchown
13165 : see if this is an fcntl system
13169 : See if fcntl-based locking works.
13172 #$i_stdlib I_STDLIB
13174 #include <stdlib.h>
13176 #include <unistd.h>
13178 #include <signal.h>
13179 $signal_t blech(int x) { exit(3); }
13181 #if defined(F_SETLK) && defined(F_SETLKW)
13182 struct flock flock;
13184 fd = open("try.c", O_RDONLY);
13185 flock.l_type = F_RDLCK;
13186 flock.l_whence = SEEK_SET;
13187 flock.l_start = flock.l_len = 0;
13188 signal(SIGALRM, blech);
13190 retval = fcntl(fd, F_SETLK, &flock);
13192 (retval < 0 ? exit(2) : exit(0));
13198 echo "Checking if fcntl-based file locking works... "
13202 if eval $compile_ok; then
13203 if $run ./try; then
13204 echo "Yes, it seems to work."
13207 echo "Nope, it didn't work."
13212 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
13213 *** This is (almost) impossible.
13214 *** If your NFS lock daemons are not feeling well, something like
13215 *** this may happen, please investigate. Cannot continue, aborting.
13223 echo "I'm unable to compile the test program, so I'll assume not."
13228 echo "Nope, since you don't even have fcntl()."
13231 set d_fcntl_can_lock
13235 : check for fd_set items
13238 Checking to see how well your C compiler handles fd_set and friends ...
13241 #$i_stdlib I_STDLIB
13243 #include <stdlib.h>
13245 #$i_systime I_SYS_TIME
13246 #$i_sysselct I_SYS_SELECT
13247 #$d_socket HAS_SOCKET
13248 #include <sys/types.h>
13250 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
13253 #include <sys/time.h>
13255 #ifdef I_SYS_SELECT
13256 #include <sys/select.h>
13265 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
13273 if eval $compile; then
13274 d_fds_bits="$define"
13276 echo "Well, your system knows about the normal fd_set typedef..." >&4
13277 if $run ./try; then
13278 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
13279 d_fd_macros="$define"
13282 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
13284 d_fd_macros="$undef"
13288 Hmm, your compiler has some difficulty with fd_set. Checking further...
13291 if eval $compile; then
13292 d_fds_bits="$undef"
13294 echo "Well, your system has some sort of fd_set available..." >&4
13295 if $run ./try; then
13296 echo "and you have the normal fd_set macros." >&4
13297 d_fd_macros="$define"
13300 but not the normal fd_set macros! Gross! More work for me...
13302 d_fd_macros="$undef"
13305 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
13307 d_fds_bits="$undef"
13308 d_fd_macros="$undef"
13313 : see if fgetpos exists
13314 set fgetpos d_fgetpos
13317 : see if finite exists
13318 set finite d_finite
13321 : see if finitel exists
13322 set finitel d_finitel
13325 : see if flock exists
13329 : see if prototype for flock is available
13331 set d_flockproto flock $i_sysfile sys/file.h
13334 : see if fp_class exists
13335 set fp_class d_fp_class
13338 : see if pathconf exists
13339 set pathconf d_pathconf
13342 : see if fpathconf exists
13343 set fpathconf d_fpathconf
13346 : see if fpclass exists
13347 set fpclass d_fpclass
13350 : see if fpclassify exists
13351 set fpclassify d_fpclassify
13354 : see if fpclassl exists
13355 set fpclassl d_fpclassl
13358 : check for fpos64_t
13360 echo "Checking to see if you have fpos64_t..." >&4
13363 int main() { fpos64_t x = 7; }
13366 if eval $compile; then
13368 echo "You have fpos64_t."
13371 echo "You do not have fpos64_t."
13372 case "$fpossize" in
13373 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
13380 : see if frexpl exists
13381 set frexpl d_frexpl
13384 : see if this is a sys/param system
13385 set sys/param.h i_sysparam
13388 : see if this is a sys/mount.h system
13389 set sys/mount.h i_sysmount
13392 : Check for fs_data_s
13394 echo "Checking to see if your system supports struct fs_data..." >&4
13395 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
13397 case "$d_fs_data_s" in
13398 "$define") echo "Yes, it does." ;;
13399 *) echo "No, it doesn't." ;;
13402 : see if fseeko exists
13403 set fseeko d_fseeko
13405 case "$longsize" in
13406 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
13409 : see if fsetpos exists
13410 set fsetpos d_fsetpos
13413 : see if fstatfs exists
13414 set fstatfs d_fstatfs
13417 : see if statvfs exists
13418 set statvfs d_statvfs
13421 : see if fstatvfs exists
13422 set fstatvfs d_fstatvfs
13426 : see if fsync exists
13430 : see if ftello exists
13431 set ftello d_ftello
13433 case "$longsize" in
13434 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
13437 : check for a working futimes
13440 echo "Checking if you have a working futimes()" >&4
13443 #include <sys/time.h>
13450 fd = open ("try.c", O_RDWR);
13451 if (-1 == fd) exit (1);
13452 rv = futimes (fd, NULL);
13453 exit (rv == -1 ? errno : 0);
13457 if eval $compile; then
13461 0) echo "Yes, you have" >&4
13462 d_futimes="$define"
13464 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
13468 echo "No, it does not (probably harmless)" >&4
13472 : see if ndbm.h is available
13475 : Compatibility location for RedHat 7.1
13476 set gdbm/ndbm.h i_gdbmndbm
13478 : Compatibility location for Debian 4.0
13479 set gdbm-ndbm.h i_gdbm_ndbm
13483 if $test "$i_ndbm" = "$define" -o "$i_gdbmndbm" = "$define" -o "$i_gdbm_ndbm" = "$define"; then
13484 : see if dbm_open exists
13485 set dbm_open d_dbm_open
13487 case "$d_dbm_open" in
13490 i_gdbmndbm="$undef"
13491 i_gdbm_ndbm="$undef"
13492 echo "We won't be including <ndbm.h>"
13502 ndbm_hdr_protochk='name=$1; hdr=$2;
13503 eval "ihdr=\$""i_$name";
13505 if $test "$ihdr" = "$define"; then
13506 $echo "Checking if your <$hdr> uses prototypes..." >&4;
13507 case "$d_cplusplus" in
13508 $define) ./protochk "$extern_C void dbm_close(DBM *);" literal "extern \"C\" {" $ihdr $hdr literal "}" && val="$define" ;;
13509 *) ./protochk "$extern_C void dbm_close(int, int);" $ihdr $hdr || val="$define" ;;
13512 $define) $echo "Your <$hdr> seems to have prototypes";;
13513 *) $echo "Your <$hdr> does not seem to have prototypes";;
13516 set "d_${name}_h_uses_prototypes";
13520 eval $ndbm_hdr_protochk
13521 set gdbmndbm gdbm/ndbm.h
13522 eval $ndbm_hdr_protochk
13523 set gdbm_ndbm gdbm-ndbm.h
13524 eval $ndbm_hdr_protochk
13526 : see if getaddrinfo exists
13527 set getaddrinfo d_getaddrinfo
13530 : see if getcwd exists
13531 set getcwd d_getcwd
13534 : see if getespwnam exists
13535 set getespwnam d_getespwnam
13538 : see if getfsstat exists
13539 set getfsstat d_getfsstat
13542 : see if getgrent exists
13543 set getgrent d_getgrent
13546 : see if getgrent_r exists
13547 set getgrent_r d_getgrent_r
13549 case "$d_getgrent_r" in
13551 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13552 case "$d_getgrent_r_proto:$usethreads" in
13553 ":define") d_getgrent_r_proto=define
13554 set d_getgrent_r_proto getgrent_r $hdrs
13558 case "$d_getgrent_r_proto" in
13560 case "$getgrent_r_proto" in
13561 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
13562 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBWR ;;
13564 case "$getgrent_r_proto" in
13565 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
13566 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIR ;;
13568 case "$getgrent_r_proto" in
13569 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
13570 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBW ;;
13572 case "$getgrent_r_proto" in
13573 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
13574 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBI ;;
13576 case "$getgrent_r_proto" in
13577 ''|0) try='int getgrent_r(struct group*, char*, int);'
13578 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBI ;;
13580 case "$getgrent_r_proto" in
13581 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
13582 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIH ;;
13584 case "$getgrent_r_proto" in
13585 ''|0) d_getgrent_r=undef
13587 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
13588 * ) case "$getgrent_r_proto" in
13589 REENTRANT_PROTO*) ;;
13590 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
13592 echo "Prototype: $try" ;;
13595 *) case "$usethreads" in
13596 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
13603 *) getgrent_r_proto=0
13607 : see if getgrgid_r exists
13608 set getgrgid_r d_getgrgid_r
13610 case "$d_getgrgid_r" in
13612 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13613 case "$d_getgrgid_r_proto:$usethreads" in
13614 ":define") d_getgrgid_r_proto=define
13615 set d_getgrgid_r_proto getgrgid_r $hdrs
13619 case "$d_getgrgid_r_proto" in
13621 case "$getgrgid_r_proto" in
13622 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
13623 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
13625 case "$getgrgid_r_proto" in
13626 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
13627 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
13629 case "$getgrgid_r_proto" in
13630 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
13631 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
13633 case "$getgrgid_r_proto" in
13634 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
13635 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
13637 case "$getgrgid_r_proto" in
13638 ''|0) d_getgrgid_r=undef
13640 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
13641 * ) case "$getgrgid_r_proto" in
13642 REENTRANT_PROTO*) ;;
13643 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
13645 echo "Prototype: $try" ;;
13648 *) case "$usethreads" in
13649 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
13656 *) getgrgid_r_proto=0
13660 : see if getgrnam_r exists
13661 set getgrnam_r d_getgrnam_r
13663 case "$d_getgrnam_r" in
13665 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13666 case "$d_getgrnam_r_proto:$usethreads" in
13667 ":define") d_getgrnam_r_proto=define
13668 set d_getgrnam_r_proto getgrnam_r $hdrs
13672 case "$d_getgrnam_r_proto" in
13674 case "$getgrnam_r_proto" in
13675 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
13676 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
13678 case "$getgrnam_r_proto" in
13679 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
13680 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
13682 case "$getgrnam_r_proto" in
13683 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
13684 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CBI ;;
13686 case "$getgrnam_r_proto" in
13687 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
13688 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
13690 case "$getgrnam_r_proto" in
13691 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
13692 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
13694 case "$getgrnam_r_proto" in
13695 ''|0) d_getgrnam_r=undef
13697 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
13698 * ) case "$getgrnam_r_proto" in
13699 REENTRANT_PROTO*) ;;
13700 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
13702 echo "Prototype: $try" ;;
13705 *) case "$usethreads" in
13706 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
13713 *) getgrnam_r_proto=0
13717 : see if gethostbyaddr exists
13718 set gethostbyaddr d_gethbyaddr
13721 : see if gethostbyname exists
13722 set gethostbyname d_gethbyname
13725 : see if gethostent exists
13726 set gethostent d_gethent
13729 : see how we will look up host name
13732 if set gethostname val -f d_gethname; eval $csym; $val; then
13733 echo 'gethostname() found.' >&4
13734 d_gethname="$define"
13737 if set uname val -f d_uname; eval $csym; $val; then
13740 uname() was found, but you're running xenix, and older versions of xenix
13741 have a broken uname(). If you don't really know whether your xenix is old
13742 enough to have a broken system call, use the default answer.
13747 "$define") dflt=n;;
13749 rp='Is your uname() broken?'
13752 n*) d_uname="$define"; call=uname;;
13755 echo 'uname() found.' >&4
13762 case "$d_gethname" in
13763 '') d_gethname="$undef";;
13766 '') d_uname="$undef";;
13768 case "$d_uname$d_gethname" in
13773 Every now and then someone has a $call() that lies about the hostname
13774 but can't be fixed for political or economic reasons. If you wish, I can
13775 pretend $call() isn't there and maybe compute hostname at run-time
13776 thanks to the '$phostname' command.
13779 rp="Shall I ignore $call() from now on?"
13782 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
13785 case "$phostname" in
13786 '') aphostname='';;
13787 *) case "$aphostname" in
13789 *) set X $phostname
13793 file=`./loc $file $file $pth`
13794 aphostname=`echo $file $*`
13799 case "$d_uname$d_gethname" in
13802 case "$phostname" in
13804 echo "There will be no way for $package to get your hostname." >&4;;
13806 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
13810 case "$d_phostname" in
13811 '') d_phostname="$undef";;
13814 : see if gethostbyaddr_r exists
13815 set gethostbyaddr_r d_gethostbyaddr_r
13817 case "$d_gethostbyaddr_r" in
13819 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13820 case "$d_gethostbyaddr_r_proto:$usethreads" in
13821 ":define") d_gethostbyaddr_r_proto=define
13822 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
13826 case "$d_gethostbyaddr_r_proto" in
13828 case "$gethostbyaddr_r_proto" in
13829 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13830 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
13832 case "$gethostbyaddr_r_proto" in
13833 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
13834 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
13836 case "$gethostbyaddr_r_proto" in
13837 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
13838 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
13840 case "$gethostbyaddr_r_proto" in
13841 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
13842 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
13844 case "$gethostbyaddr_r_proto" in
13845 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
13846 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
13848 case "$gethostbyaddr_r_proto" in
13849 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
13850 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
13852 case "$gethostbyaddr_r_proto" in
13853 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
13854 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
13856 case "$gethostbyaddr_r_proto" in
13857 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
13858 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
13860 case "$gethostbyaddr_r_proto" in
13861 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
13862 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
13864 case "$gethostbyaddr_r_proto" in
13865 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
13866 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
13868 case "$gethostbyaddr_r_proto" in
13869 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13870 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
13872 case "$gethostbyaddr_r_proto" in
13873 ''|0) d_gethostbyaddr_r=undef
13874 gethostbyaddr_r_proto=0
13875 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
13876 * ) case "$gethostbyaddr_r_proto" in
13877 REENTRANT_PROTO*) ;;
13878 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
13880 echo "Prototype: $try" ;;
13883 *) case "$usethreads" in
13884 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
13886 d_gethostbyaddr_r=undef
13887 gethostbyaddr_r_proto=0
13891 *) gethostbyaddr_r_proto=0
13895 : see if gethostbyname_r exists
13896 set gethostbyname_r d_gethostbyname_r
13898 case "$d_gethostbyname_r" in
13900 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13901 case "$d_gethostbyname_r_proto:$usethreads" in
13902 ":define") d_gethostbyname_r_proto=define
13903 set d_gethostbyname_r_proto gethostbyname_r $hdrs
13907 case "$d_gethostbyname_r_proto" in
13909 case "$gethostbyname_r_proto" in
13910 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
13911 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
13913 case "$gethostbyname_r_proto" in
13914 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
13915 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
13917 case "$gethostbyname_r_proto" in
13918 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
13919 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
13921 case "$gethostbyname_r_proto" in
13922 ''|0) d_gethostbyname_r=undef
13923 gethostbyname_r_proto=0
13924 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
13925 * ) case "$gethostbyname_r_proto" in
13926 REENTRANT_PROTO*) ;;
13927 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
13929 echo "Prototype: $try" ;;
13932 *) case "$usethreads" in
13933 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
13935 d_gethostbyname_r=undef
13936 gethostbyname_r_proto=0
13940 *) gethostbyname_r_proto=0
13944 : see if gethostent_r exists
13945 set gethostent_r d_gethostent_r
13947 case "$d_gethostent_r" in
13949 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13950 case "$d_gethostent_r_proto:$usethreads" in
13951 ":define") d_gethostent_r_proto=define
13952 set d_gethostent_r_proto gethostent_r $hdrs
13956 case "$d_gethostent_r_proto" in
13958 case "$gethostent_r_proto" in
13959 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
13960 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
13962 case "$gethostent_r_proto" in
13963 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
13964 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBIE ;;
13966 case "$gethostent_r_proto" in
13967 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
13968 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBIE ;;
13970 case "$gethostent_r_proto" in
13971 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
13972 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBI ;;
13974 case "$gethostent_r_proto" in
13975 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
13976 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBI ;;
13978 case "$gethostent_r_proto" in
13979 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
13980 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SD ;;
13982 case "$gethostent_r_proto" in
13983 ''|0) d_gethostent_r=undef
13984 gethostent_r_proto=0
13985 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
13986 * ) case "$gethostent_r_proto" in
13987 REENTRANT_PROTO*) ;;
13988 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
13990 echo "Prototype: $try" ;;
13993 *) case "$usethreads" in
13994 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
13996 d_gethostent_r=undef
13997 gethostent_r_proto=0
14001 *) gethostent_r_proto=0
14005 : see if prototypes for various gethostxxx netdb.h functions are available
14007 set d_gethostprotos gethostent $i_netdb netdb.h
14010 : see if getitimer exists
14011 set getitimer d_getitimer
14014 : see if getlogin exists
14015 set getlogin d_getlogin
14018 : see if getlogin_r exists
14019 set getlogin_r d_getlogin_r
14021 case "$d_getlogin_r" in
14023 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
14024 case "$d_getlogin_r_proto:$usethreads" in
14025 ":define") d_getlogin_r_proto=define
14026 set d_getlogin_r_proto getlogin_r $hdrs
14030 case "$d_getlogin_r_proto" in
14032 case "$getlogin_r_proto" in
14033 ''|0) try='int getlogin_r(char*, size_t);'
14034 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BW ;;
14036 case "$getlogin_r_proto" in
14037 ''|0) try='int getlogin_r(char*, int);'
14038 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BI ;;
14040 case "$getlogin_r_proto" in
14041 ''|0) try='char* getlogin_r(char*, size_t);'
14042 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BW ;;
14044 case "$getlogin_r_proto" in
14045 ''|0) try='char* getlogin_r(char*, int);'
14046 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BI ;;
14048 case "$getlogin_r_proto" in
14049 ''|0) d_getlogin_r=undef
14051 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
14052 * ) case "$getlogin_r_proto" in
14053 REENTRANT_PROTO*) ;;
14054 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
14056 echo "Prototype: $try" ;;
14059 *) case "$usethreads" in
14060 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
14067 *) getlogin_r_proto=0
14071 : see if getmnt exists
14072 set getmnt d_getmnt
14075 : see if getmntent exists
14076 set getmntent d_getmntent
14079 : see if getnameinfo exists
14080 set getnameinfo d_getnameinfo
14083 : see if getnetbyaddr exists
14084 set getnetbyaddr d_getnbyaddr
14087 : see if getnetbyname exists
14088 set getnetbyname d_getnbyname
14091 : see if getnetent exists
14092 set getnetent d_getnent
14095 : see if getnetbyaddr_r exists
14096 set getnetbyaddr_r d_getnetbyaddr_r
14098 case "$d_getnetbyaddr_r" in
14100 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14101 case "$d_getnetbyaddr_r_proto:$usethreads" in
14102 ":define") d_getnetbyaddr_r_proto=define
14103 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
14107 case "$d_getnetbyaddr_r_proto" in
14109 case "$getnetbyaddr_r_proto" in
14110 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
14111 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
14113 case "$getnetbyaddr_r_proto" in
14114 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
14115 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
14117 case "$getnetbyaddr_r_proto" in
14118 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
14119 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
14121 case "$getnetbyaddr_r_proto" in
14122 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
14123 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
14125 case "$getnetbyaddr_r_proto" in
14126 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
14127 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
14129 case "$getnetbyaddr_r_proto" in
14130 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
14131 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
14133 case "$getnetbyaddr_r_proto" in
14134 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
14135 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
14137 case "$getnetbyaddr_r_proto" in
14138 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
14139 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
14141 case "$getnetbyaddr_r_proto" in
14142 ''|0) d_getnetbyaddr_r=undef
14143 getnetbyaddr_r_proto=0
14144 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
14145 * ) case "$getnetbyaddr_r_proto" in
14146 REENTRANT_PROTO*) ;;
14147 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
14149 echo "Prototype: $try" ;;
14152 *) case "$usethreads" in
14153 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
14155 d_getnetbyaddr_r=undef
14156 getnetbyaddr_r_proto=0
14160 *) getnetbyaddr_r_proto=0
14164 : see if getnetbyname_r exists
14165 set getnetbyname_r d_getnetbyname_r
14167 case "$d_getnetbyname_r" in
14169 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14170 case "$d_getnetbyname_r_proto:$usethreads" in
14171 ":define") d_getnetbyname_r_proto=define
14172 set d_getnetbyname_r_proto getnetbyname_r $hdrs
14176 case "$d_getnetbyname_r_proto" in
14178 case "$getnetbyname_r_proto" in
14179 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
14180 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
14182 case "$getnetbyname_r_proto" in
14183 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
14184 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
14186 case "$getnetbyname_r_proto" in
14187 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
14188 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
14190 case "$getnetbyname_r_proto" in
14191 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
14192 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
14194 case "$getnetbyname_r_proto" in
14195 ''|0) d_getnetbyname_r=undef
14196 getnetbyname_r_proto=0
14197 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
14198 * ) case "$getnetbyname_r_proto" in
14199 REENTRANT_PROTO*) ;;
14200 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
14202 echo "Prototype: $try" ;;
14205 *) case "$usethreads" in
14206 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
14208 d_getnetbyname_r=undef
14209 getnetbyname_r_proto=0
14213 *) getnetbyname_r_proto=0
14217 : see if getnetent_r exists
14218 set getnetent_r d_getnetent_r
14220 case "$d_getnetent_r" in
14222 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14223 case "$d_getnetent_r_proto:$usethreads" in
14224 ":define") d_getnetent_r_proto=define
14225 set d_getnetent_r_proto getnetent_r $hdrs
14229 case "$d_getnetent_r_proto" in
14231 case "$getnetent_r_proto" in
14232 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
14233 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
14235 case "$getnetent_r_proto" in
14236 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
14237 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBIE ;;
14239 case "$getnetent_r_proto" in
14240 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
14241 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBIE ;;
14243 case "$getnetent_r_proto" in
14244 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
14245 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBI ;;
14247 case "$getnetent_r_proto" in
14248 ''|0) try='int getnetent_r(struct netent*, char*, int);'
14249 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBI ;;
14251 case "$getnetent_r_proto" in
14252 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
14253 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SD ;;
14255 case "$getnetent_r_proto" in
14256 ''|0) d_getnetent_r=undef
14257 getnetent_r_proto=0
14258 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
14259 * ) case "$getnetent_r_proto" in
14260 REENTRANT_PROTO*) ;;
14261 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
14263 echo "Prototype: $try" ;;
14266 *) case "$usethreads" in
14267 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
14269 d_getnetent_r=undef
14270 getnetent_r_proto=0
14274 *) getnetent_r_proto=0
14278 : see if prototypes for various getnetxxx netdb.h functions are available
14280 set d_getnetprotos getnetent $i_netdb netdb.h
14283 : see if getpagesize exists
14284 set getpagesize d_getpagsz
14287 : Optional checks for getprotobyname and getprotobynumber
14289 : see if getprotobyname exists
14290 set getprotobyname d_getpbyname
14293 : see if getprotobynumber exists
14294 set getprotobynumber d_getpbynumber
14297 : see if getprotoent exists
14298 set getprotoent d_getpent
14301 : see if getpgid exists
14302 set getpgid d_getpgid
14305 : see if getpgrp2 exists
14306 set getpgrp2 d_getpgrp2
14309 : see if getppid exists
14310 set getppid d_getppid
14313 : see if getpriority exists
14314 set getpriority d_getprior
14317 : see if getprotobyname_r exists
14318 set getprotobyname_r d_getprotobyname_r
14320 case "$d_getprotobyname_r" in
14322 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14323 case "$d_getprotobyname_r_proto:$usethreads" in
14324 ":define") d_getprotobyname_r_proto=define
14325 set d_getprotobyname_r_proto getprotobyname_r $hdrs
14329 case "$d_getprotobyname_r_proto" in
14331 case "$getprotobyname_r_proto" in
14332 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
14333 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
14335 case "$getprotobyname_r_proto" in
14336 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
14337 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
14339 case "$getprotobyname_r_proto" in
14340 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
14341 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
14343 case "$getprotobyname_r_proto" in
14344 ''|0) d_getprotobyname_r=undef
14345 getprotobyname_r_proto=0
14346 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
14347 * ) case "$getprotobyname_r_proto" in
14348 REENTRANT_PROTO*) ;;
14349 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
14351 echo "Prototype: $try" ;;
14354 *) case "$usethreads" in
14355 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
14357 d_getprotobyname_r=undef
14358 getprotobyname_r_proto=0
14362 *) getprotobyname_r_proto=0
14366 : see if getprotobynumber_r exists
14367 set getprotobynumber_r d_getprotobynumber_r
14369 case "$d_getprotobynumber_r" in
14371 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14372 case "$d_getprotobynumber_r_proto:$usethreads" in
14373 ":define") d_getprotobynumber_r_proto=define
14374 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
14378 case "$d_getprotobynumber_r_proto" in
14380 case "$getprotobynumber_r_proto" in
14381 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
14382 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
14384 case "$getprotobynumber_r_proto" in
14385 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
14386 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
14388 case "$getprotobynumber_r_proto" in
14389 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
14390 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
14392 case "$getprotobynumber_r_proto" in
14393 ''|0) d_getprotobynumber_r=undef
14394 getprotobynumber_r_proto=0
14395 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
14396 * ) case "$getprotobynumber_r_proto" in
14397 REENTRANT_PROTO*) ;;
14398 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
14400 echo "Prototype: $try" ;;
14403 *) case "$usethreads" in
14404 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
14406 d_getprotobynumber_r=undef
14407 getprotobynumber_r_proto=0
14411 *) getprotobynumber_r_proto=0
14415 : see if getprotoent_r exists
14416 set getprotoent_r d_getprotoent_r
14418 case "$d_getprotoent_r" in
14420 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14421 case "$d_getprotoent_r_proto:$usethreads" in
14422 ":define") d_getprotoent_r_proto=define
14423 set d_getprotoent_r_proto getprotoent_r $hdrs
14427 case "$d_getprotoent_r_proto" in
14429 case "$getprotoent_r_proto" in
14430 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
14431 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
14433 case "$getprotoent_r_proto" in
14434 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
14435 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBI ;;
14437 case "$getprotoent_r_proto" in
14438 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
14439 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=S_SBI ;;
14441 case "$getprotoent_r_proto" in
14442 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
14443 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SD ;;
14445 case "$getprotoent_r_proto" in
14446 ''|0) d_getprotoent_r=undef
14447 getprotoent_r_proto=0
14448 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
14449 * ) case "$getprotoent_r_proto" in
14450 REENTRANT_PROTO*) ;;
14451 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
14453 echo "Prototype: $try" ;;
14456 *) case "$usethreads" in
14457 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
14459 d_getprotoent_r=undef
14460 getprotoent_r_proto=0
14464 *) getprotoent_r_proto=0
14468 : see if prototypes for various getprotoxxx netdb.h functions are available
14470 set d_getprotoprotos getprotoent $i_netdb netdb.h
14473 : see if getprpwnam exists
14474 set getprpwnam d_getprpwnam
14477 : see if getpwent exists
14478 set getpwent d_getpwent
14481 : see if getpwent_r exists
14482 set getpwent_r d_getpwent_r
14484 case "$d_getpwent_r" in
14486 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14487 case "$d_getpwent_r_proto:$usethreads" in
14488 ":define") d_getpwent_r_proto=define
14489 set d_getpwent_r_proto getpwent_r $hdrs
14493 case "$d_getpwent_r_proto" in
14495 case "$getpwent_r_proto" in
14496 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
14497 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBWR ;;
14499 case "$getpwent_r_proto" in
14500 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
14501 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIR ;;
14503 case "$getpwent_r_proto" in
14504 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
14505 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBW ;;
14507 case "$getpwent_r_proto" in
14508 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
14509 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBI ;;
14511 case "$getpwent_r_proto" in
14512 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
14513 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBI ;;
14515 case "$getpwent_r_proto" in
14516 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
14517 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIH ;;
14519 case "$getpwent_r_proto" in
14520 ''|0) d_getpwent_r=undef
14522 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
14523 * ) case "$getpwent_r_proto" in
14524 REENTRANT_PROTO*) ;;
14525 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
14527 echo "Prototype: $try" ;;
14530 *) case "$usethreads" in
14531 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
14538 *) getpwent_r_proto=0
14542 : see if getpwnam_r exists
14543 set getpwnam_r d_getpwnam_r
14545 case "$d_getpwnam_r" in
14547 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14548 case "$d_getpwnam_r_proto:$usethreads" in
14549 ":define") d_getpwnam_r_proto=define
14550 set d_getpwnam_r_proto getpwnam_r $hdrs
14554 case "$d_getpwnam_r_proto" in
14556 case "$getpwnam_r_proto" in
14557 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
14558 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
14560 case "$getpwnam_r_proto" in
14561 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
14562 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
14564 case "$getpwnam_r_proto" in
14565 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
14566 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
14568 case "$getpwnam_r_proto" in
14569 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
14570 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
14572 case "$getpwnam_r_proto" in
14573 ''|0) d_getpwnam_r=undef
14575 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
14576 * ) case "$getpwnam_r_proto" in
14577 REENTRANT_PROTO*) ;;
14578 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
14580 echo "Prototype: $try" ;;
14583 *) case "$usethreads" in
14584 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
14591 *) getpwnam_r_proto=0
14595 : see if getpwuid_r exists
14596 set getpwuid_r d_getpwuid_r
14598 case "$d_getpwuid_r" in
14600 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14601 case "$d_getpwuid_r_proto:$usethreads" in
14602 ":define") d_getpwuid_r_proto=define
14603 set d_getpwuid_r_proto getpwuid_r $hdrs
14607 case "$d_getpwuid_r_proto" in
14609 case "$getpwuid_r_proto" in
14610 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
14611 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
14613 case "$getpwuid_r_proto" in
14614 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
14615 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
14617 case "$getpwuid_r_proto" in
14618 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
14619 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
14621 case "$getpwuid_r_proto" in
14622 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
14623 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
14625 case "$getpwuid_r_proto" in
14626 ''|0) d_getpwuid_r=undef
14628 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
14629 * ) case "$getpwuid_r_proto" in
14630 REENTRANT_PROTO*) ;;
14631 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
14633 echo "Prototype: $try" ;;
14636 *) case "$usethreads" in
14637 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
14644 *) getpwuid_r_proto=0
14648 : Optional checks for getsbyname and getsbyport
14650 : see if getservbyname exists
14651 set getservbyname d_getsbyname
14654 : see if getservbyport exists
14655 set getservbyport d_getsbyport
14658 : see if getservent exists
14659 set getservent d_getsent
14662 : see if getservbyname_r exists
14663 set getservbyname_r d_getservbyname_r
14665 case "$d_getservbyname_r" in
14667 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14668 case "$d_getservbyname_r_proto:$usethreads" in
14669 ":define") d_getservbyname_r_proto=define
14670 set d_getservbyname_r_proto getservbyname_r $hdrs
14674 case "$d_getservbyname_r_proto" in
14676 case "$getservbyname_r_proto" in
14677 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
14678 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
14680 case "$getservbyname_r_proto" in
14681 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
14682 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
14684 case "$getservbyname_r_proto" in
14685 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
14686 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
14688 case "$getservbyname_r_proto" in
14689 ''|0) d_getservbyname_r=undef
14690 getservbyname_r_proto=0
14691 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
14692 * ) case "$getservbyname_r_proto" in
14693 REENTRANT_PROTO*) ;;
14694 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
14696 echo "Prototype: $try" ;;
14699 *) case "$usethreads" in
14700 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
14702 d_getservbyname_r=undef
14703 getservbyname_r_proto=0
14707 *) getservbyname_r_proto=0
14711 : see if getservbyport_r exists
14712 set getservbyport_r d_getservbyport_r
14714 case "$d_getservbyport_r" in
14716 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14717 case "$d_getservbyport_r_proto:$usethreads" in
14718 ":define") d_getservbyport_r_proto=define
14719 set d_getservbyport_r_proto getservbyport_r $hdrs
14723 case "$d_getservbyport_r_proto" in
14725 case "$getservbyport_r_proto" in
14726 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
14727 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
14729 case "$getservbyport_r_proto" in
14730 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
14731 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
14733 case "$getservbyport_r_proto" in
14734 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
14735 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
14737 case "$getservbyport_r_proto" in
14738 ''|0) d_getservbyport_r=undef
14739 getservbyport_r_proto=0
14740 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
14741 * ) case "$getservbyport_r_proto" in
14742 REENTRANT_PROTO*) ;;
14743 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
14745 echo "Prototype: $try" ;;
14748 *) case "$usethreads" in
14749 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
14751 d_getservbyport_r=undef
14752 getservbyport_r_proto=0
14756 *) getservbyport_r_proto=0
14760 : see if getservent_r exists
14761 set getservent_r d_getservent_r
14763 case "$d_getservent_r" in
14765 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14766 case "$d_getservent_r_proto:$usethreads" in
14767 ":define") d_getservent_r_proto=define
14768 set d_getservent_r_proto getservent_r $hdrs
14772 case "$d_getservent_r_proto" in
14774 case "$getservent_r_proto" in
14775 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
14776 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBWR ;;
14778 case "$getservent_r_proto" in
14779 ''|0) try='int getservent_r(struct servent*, char*, int);'
14780 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBI ;;
14782 case "$getservent_r_proto" in
14783 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
14784 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=S_SBI ;;
14786 case "$getservent_r_proto" in
14787 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
14788 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SD ;;
14790 case "$getservent_r_proto" in
14791 ''|0) d_getservent_r=undef
14792 getservent_r_proto=0
14793 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
14794 * ) case "$getservent_r_proto" in
14795 REENTRANT_PROTO*) ;;
14796 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
14798 echo "Prototype: $try" ;;
14801 *) case "$usethreads" in
14802 define) echo "getservent_r has no prototype, not using it." >&4 ;;
14804 d_getservent_r=undef
14805 getservent_r_proto=0
14809 *) getservent_r_proto=0
14813 : see if prototypes for various getservxxx netdb.h functions are available
14815 set d_getservprotos getservent $i_netdb netdb.h
14818 : see if getspnam exists
14819 set getspnam d_getspnam
14822 : see if this is a shadow.h system
14823 set shadow.h i_shadow
14826 : see if getspnam_r exists
14827 set getspnam_r d_getspnam_r
14829 case "$d_getspnam_r" in
14831 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
14832 case "$d_getspnam_r_proto:$usethreads" in
14833 ":define") d_getspnam_r_proto=define
14834 set d_getspnam_r_proto getspnam_r $hdrs
14838 case "$d_getspnam_r_proto" in
14840 case "$getspnam_r_proto" in
14841 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
14842 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
14844 case "$getspnam_r_proto" in
14845 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
14846 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=S_CSBI ;;
14848 case "$getspnam_r_proto" in
14849 ''|0) d_getspnam_r=undef
14851 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
14852 * ) case "$getspnam_r_proto" in
14853 REENTRANT_PROTO*) ;;
14854 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
14856 echo "Prototype: $try" ;;
14859 *) case "$usethreads" in
14860 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
14867 *) getspnam_r_proto=0
14871 : see if gettimeofday or ftime exists
14872 set gettimeofday d_gettimeod
14874 case "$d_gettimeod" in
14880 val="$undef"; set d_ftime; eval $setvar
14883 case "$d_gettimeod$d_ftime" in
14886 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
14890 : see if gmtime_r exists
14891 set gmtime_r d_gmtime_r
14893 case "$d_gmtime_r" in
14895 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14896 case "$d_gmtime_r_proto:$usethreads" in
14897 ":define") d_gmtime_r_proto=define
14898 set d_gmtime_r_proto gmtime_r $hdrs
14902 case "$d_gmtime_r_proto" in
14904 case "$gmtime_r_proto" in
14905 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
14906 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=S_TS ;;
14908 case "$gmtime_r_proto" in
14909 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
14910 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=I_TS ;;
14912 case "$gmtime_r_proto" in
14913 ''|0) d_gmtime_r=undef
14915 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
14916 * ) case "$gmtime_r_proto" in
14917 REENTRANT_PROTO*) ;;
14918 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
14920 echo "Prototype: $try" ;;
14923 *) case "$usethreads" in
14924 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
14931 *) gmtime_r_proto=0
14935 : see if hasmntopt exists
14936 set hasmntopt d_hasmntopt
14939 : see if this is a netinet/in.h or sys/in.h system
14940 set netinet/in.h i_niin sys/in.h i_sysin
14943 : see if arpa/inet.h has to be included
14944 set arpa/inet.h i_arpainet
14947 : see if htonl --and friends-- exists
14952 : Maybe they are macros.
14955 $cat >htonl.c <<EOM
14957 #include <sys/types.h>
14958 #$i_niin I_NETINET_IN
14960 #$i_arpainet I_ARPA_INET
14961 #ifdef I_NETINET_IN
14962 #include <netinet/in.h>
14965 #include <sys/in.h>
14968 #include <arpa/inet.h>
14971 printf("Defined as a macro.");
14974 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
14975 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
14977 echo "But it seems to be defined as a macro." >&4
14985 : see if ilogbl exists
14986 set ilogbl d_ilogbl
14991 if set index val -f; eval $csym; $val; then
14992 if set strchr val -f d_strchr; eval $csym; $val; then
14993 if $contains strchr "$strings" >/dev/null 2>&1 ; then
14996 echo "strchr() found." >&4
15000 echo "index() found." >&4
15005 echo "index() found." >&4
15008 if set strchr val -f d_strchr; eval $csym; $val; then
15011 echo "strchr() found." >&4
15013 echo "No index() or strchr() found!" >&4
15018 set d_strchr; eval $setvar
15020 set d_index; eval $setvar
15022 : check whether inet_aton exists
15023 set inet_aton d_inetaton
15026 : see if inet_ntop exists
15027 set inet_ntop d_inetntop
15030 : see if inet_pton exists
15031 set inet_pton d_inetpton
15036 $cat >isascii.c <<EOCP
15039 #$i_stdlib I_STDLIB
15041 #include <stdlib.h>
15052 if eval $compile; then
15053 echo "isascii() found." >&4
15056 echo "isascii() NOT found." >&4
15065 $cat >isblank.c <<'EOCP'
15076 if $cc $ccflags $ldflags -o isblank isblank.c $libs >/dev/null 2>&1 ; then
15077 echo "isblank() found." >&4
15080 echo "isblank() NOT found." >&4
15087 : see if isfinite exists
15088 set isfinite d_isfinite
15091 : see if isinf exists
15095 : see if isnan exists
15099 : see if isnanl exists
15100 set isnanl d_isnanl
15103 : see if killpg exists
15104 set killpg d_killpg
15107 : see if lchown exists
15109 $cat > try.c <<'EOCP'
15110 /* System header to define __stub macros and hopefully few prototypes,
15111 which can conflict with char lchown(); below. */
15112 #include <assert.h>
15113 /* Override any gcc2 internal prototype to avoid an error. */
15114 /* We use char because int might match the return type of a gcc2
15115 builtin and then its argument prototype would still apply. */
15118 /* The GNU C library defines this for functions which it implements
15119 to always fail with ENOSYS. Some functions are actually named
15120 something starting with __ and the normal name is an alias. */
15121 #if defined (__stub_lchown) || defined (__stub___lchown)
15129 if eval $compile; then
15130 $echo "lchown() found." >&4
15133 $echo "lchown() NOT found." >&4
15139 : See if number of significant digits in a double precision number is known
15141 $cat >ldbl_dig.c <<EOM
15142 #$i_limits I_LIMITS
15145 #include <limits.h>
15151 printf("Contains LDBL_DIG");
15154 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
15155 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
15156 echo "LDBL_DIG found." >&4
15159 echo "LDBL_DIG NOT found." >&4
15166 : see if this is a math.h system
15170 : check to see if math.h defines _LIB_VERSION
15171 d_libm_lib_version="$undef"
15175 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
15177 #include <unistd.h>
15179 int main (int argc, char *argv[])
15181 printf ("%d\n", _LIB_VERSION);
15186 if eval $compile; then
15188 echo "Yes, it does ($foo)" >&4
15189 d_libm_lib_version="$define"
15191 echo "No, it does not (probably harmless)" >&4
15198 : see if link exists
15202 : see if localtime_r exists
15203 set localtime_r d_localtime_r
15205 case "$d_localtime_r" in
15207 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15208 case "$d_localtime_r_proto:$usethreads" in
15209 ":define") d_localtime_r_proto=define
15210 set d_localtime_r_proto localtime_r $hdrs
15214 case "$d_localtime_r_proto" in
15216 case "$localtime_r_proto" in
15217 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
15218 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=S_TS ;;
15220 case "$localtime_r_proto" in
15221 ''|0) try='int localtime_r(const time_t*, struct tm*);'
15222 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=I_TS ;;
15224 case "$localtime_r_proto" in
15225 ''|0) d_localtime_r=undef
15226 localtime_r_proto=0
15227 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
15228 * ) case "$localtime_r_proto" in
15229 REENTRANT_PROTO*) ;;
15230 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
15232 echo "Prototype: $try" ;;
15235 *) case "$usethreads" in
15236 define) echo "localtime_r has no prototype, not using it." >&4 ;;
15238 d_localtime_r=undef
15239 localtime_r_proto=0
15243 *) localtime_r_proto=0
15247 : see if localtime_r calls tzset
15248 case "$localtime_r_proto" in
15251 /* Does our libc's localtime_r call tzset ?
15252 * return 0 if so, 1 otherwise.
15254 #$i_systypes I_SYS_TYPES
15255 #$i_unistd I_UNISTD
15257 #$i_stdlib I_STDLIB
15258 #$i_string I_STRING
15259 #$i_malloc I_MALLOC
15261 # include <sys/types.h>
15264 # include <unistd.h>
15270 #include <stdlib.h>
15273 # include <string.h>
15275 # include <strings.h>
15278 # include <malloc.h>
15282 time_t t = time(0L);
15283 char w_tz[]="TZ" "=GMT+5",
15284 e_tz[]="TZ" "=GMT-5",
15285 *tz_e = (char*)malloc(16),
15286 *tz_w = (char*)malloc(16);
15287 struct tm tm_e, tm_w;
15288 memset(&tm_e,'\0',sizeof(struct tm));
15289 memset(&tm_w,'\0',sizeof(struct tm));
15294 localtime_r(&t, &tm_e);
15297 localtime_r(&t, &tm_w);
15299 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
15305 if eval $compile; then
15306 if $run ./try; then
15307 d_localtime_r_needs_tzset=undef;
15309 d_localtime_r_needs_tzset=define;
15312 d_localtime_r_needs_tzset=undef;
15316 d_localtime_r_needs_tzset=undef;
15321 : see if localeconv exists
15322 set localeconv d_locconv
15325 : see if lockf exists
15329 : see if prototype for lseek is available
15331 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
15334 : see if lstat exists
15338 : see if madvise exists
15339 set madvise d_madvise
15342 : see if malloc_size exists
15343 set malloc_size d_malloc_size
15346 : see if malloc_size_good exists
15347 set malloc_good_size d_malloc_good_size
15350 : see if mblen exists
15354 : see if mbstowcs exists
15355 set mbstowcs d_mbstowcs
15358 : see if mbtowc exists
15359 set mbtowc d_mbtowc
15362 : see if memchr exists
15363 set memchr d_memchr
15366 : see if memcmp exists
15367 set memcmp d_memcmp
15370 : see if memcpy exists
15371 set memcpy d_memcpy
15374 : see if memmove exists
15375 set memmove d_memmove
15378 : see if memset exists
15379 set memset d_memset
15382 : see if mkdir exists
15386 : see if mkdtemp exists
15387 set mkdtemp d_mkdtemp
15390 : see if mkfifo exists
15391 set mkfifo d_mkfifo
15394 : see if mkstemp exists
15395 set mkstemp d_mkstemp
15398 : see if mkstemps exists
15399 set mkstemps d_mkstemps
15402 : see if mktime exists
15403 set mktime d_mktime
15406 : see if this is a sys/mman.h system
15407 set sys/mman.h i_sysmman
15410 : see if mmap exists
15413 : see what shmat returns
15414 : default to something harmless
15416 case "$i_sysmman$d_mmap" in
15418 $cat >mmap.c <<'END'
15419 #include <sys/mman.h>
15422 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
15427 echo "and it returns ($mmaptype)." >&4
15433 : see if sqrtl exists
15437 : see if scalbnl exists
15438 set scalbnl d_scalbnl
15441 : see if modfl exists
15445 : see if prototype for modfl is available
15447 set d_modflproto modfl $i_math math.h
15450 d_modfl_pow32_bug="$undef"
15452 case "$d_longdbl$d_modfl" in
15455 Checking to see whether your modfl() is okay for large values...
15461 if $test "X$d_modflproto" != "X$define"; then
15462 $cat >>try.c <<EOCP
15463 /* Sigh. many current glibcs provide the function, but do not prototype it. */
15464 long double modfl (long double, long double *);
15467 $cat >>try.c <<EOCP
15469 long double nv = 4294967303.15;
15475 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
15479 case "$osname:$gccversion" in
15480 aix:) saveccflags="$ccflags"
15481 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
15484 if eval $compile; then
15487 *" 4294967303.150000 1.150000 4294967302.000000")
15488 echo >&4 "Your modfl() is broken for large values."
15489 d_modfl_pow32_bug="$define"
15491 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
15495 *" 4294967303.150000 0.150000 4294967303.000000")
15496 echo >&4 "Your modfl() seems okay for large values."
15498 *) echo >&4 "I don't understand your modfl() at all."
15504 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
15507 case "$osname:$gccversion" in
15508 aix:) ccflags="$saveccflags" ;; # restore
15513 if $test "$uselongdouble" = "$define"; then
15515 if $test "$d_sqrtl" != "$define"; then
15516 message="$message sqrtl"
15518 if $test "$d_modfl" != "$define"; then
15519 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
15520 echo "You have both aintl and copysignl, so I can emulate modfl."
15522 message="$message modfl"
15525 if $test "$d_frexpl" != "$define"; then
15526 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
15527 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
15529 message="$message frexpl"
15533 if $test "$message" != ""; then
15536 *** You requested the use of long doubles but you do not seem to have
15537 *** the following mathematical functions needed for long double support:
15539 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
15540 *** Cannot continue, aborting.
15548 : see if mprotect exists
15549 set mprotect d_mprotect
15552 : see if msgctl exists
15553 set msgctl d_msgctl
15556 : see if msgget exists
15557 set msgget d_msgget
15560 : see if msgsnd exists
15561 set msgsnd d_msgsnd
15564 : see if msgrcv exists
15565 set msgrcv d_msgrcv
15568 : see how much of the 'msg*(2)' library is present.
15571 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
15572 *"$undef"*) h_msg=false;;
15576 case "`ipcs 2>&1`" in
15577 "SVID messages"*"not configured"*)
15578 echo "Your $osname does not have the msg*(2) configured." >&4
15581 set msgctl d_msgctl
15583 set msgget d_msgget
15585 set msgsnd d_msgsnd
15587 set msgrcv d_msgrcv
15593 : we could also check for sys/ipc.h ...
15594 if $h_msg && $test `./findhdr sys/msg.h`; then
15595 echo "You have the full msg*(2) library." >&4
15598 echo "You don't have the full msg*(2) library." >&4
15604 : Check for msghdr_s
15606 echo "Checking to see if your system supports struct msghdr..." >&4
15607 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
15609 case "$d_msghdr_s" in
15610 "$define") echo "Yes, it does." ;;
15611 *) echo "No, it doesn't." ;;
15615 : see if msync exists
15619 : see if munmap exists
15620 set munmap d_munmap
15623 : see if nice exists
15627 : see if this is a langinfo.h system
15628 set langinfo.h i_langinfo
15631 : see if nl_langinfo exists
15632 set nl_langinfo d_nl_langinfo
15635 : check for volatile keyword
15637 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
15638 $cat >try.c <<'EOCP'
15641 typedef struct _goo_struct goo_struct;
15642 goo_struct * volatile goo = ((goo_struct *)0);
15643 struct _goo_struct {
15648 typedef unsigned short foo_t;
15649 char *volatile foo;
15651 volatile foo_t blech;
15655 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
15657 echo "Yup, it does."
15660 echo "Nope, it doesn't."
15666 : Check basic sizes
15668 $echo "Choosing the C types to be used for Perl's internal types..." >&4
15670 case "$use64bitint:$d_quad:$quadtype" in
15673 uvtype="$uquadtype"
15678 uvtype="unsigned long"
15684 case "$uselongdouble:$d_longdbl" in
15686 nvtype="long double"
15687 nvsize=$longdblsize
15694 $echo "(IV will be "$ivtype", $ivsize bytes)"
15695 $echo "(UV will be "$uvtype", $uvsize bytes)"
15696 $echo "(NV will be "$nvtype", $nvsize bytes)"
15699 #$i_inttypes I_INTTYPES
15701 #include <inttypes.h>
15706 int8_t i = INT8_MAX;
15707 uint8_t u = UINT8_MAX;
15708 printf("int8_t\n");
15711 int16_t i = INT16_MAX;
15712 uint16_t u = UINT16_MAX;
15713 printf("int16_t\n");
15716 int32_t i = INT32_MAX;
15717 uint32_t u = UINT32_MAX;
15718 printf("int32_t\n");
15723 i8type="signed char"
15724 u8type="unsigned char"
15729 '') case "$shortsize" in
15731 u16type="unsigned short"
15739 '') set try -DINT16
15740 if eval $compile; then
15741 case "`$run ./try`" in
15753 '') if $test $shortsize -ge 2; then
15755 u16type="unsigned short"
15763 '') case "$longsize" in
15765 u32type="unsigned long"
15769 *) case "$intsize" in
15771 u32type="unsigned int"
15781 '') set try -DINT32
15782 if eval $compile; then
15783 case "`$run ./try`" in
15795 '') if $test $intsize -ge 4; then
15797 u32type="unsigned int"
15805 '') case "$d_quad:$quadtype" in
15807 i64type="$quadtype"
15808 u64type="$uquadtype"
15816 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
15817 : volatile so that the compiler has to store it out to memory.
15818 if test X"$d_volatile" = X"$define"; then
15823 #$i_stdlib I_STDLIB
15825 #include <stdlib.h>
15827 #include <sys/types.h>
15828 #include <signal.h>
15830 $volatile int bletched = 0;
15831 $signal_t blech(int s) { bletched = 1; }
15836 int n = 8 * $uvsize;
15839 signal(SIGFPE, blech);
15842 for (i = 0; i < n; i++) {
15843 u = u << 1 | ($uvtype)1;
15845 if (($uvtype)d != u)
15849 d = ($nvtype)(u - 1);
15850 if (($uvtype)d != (u - 1))
15857 printf("%d\n", ((i == n) ? -n : i));
15863 d_nv_preserves_uv="$undef"
15864 if eval $compile; then
15865 nv_preserves_uv_bits="`$run ./try`"
15867 case "$nv_preserves_uv_bits" in
15869 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
15870 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
15871 d_nv_preserves_uv="$define"
15873 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
15874 d_nv_preserves_uv="$undef" ;;
15875 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
15876 nv_preserves_uv_bits="0" ;;
15880 $echo "Checking to find the largest integer value your NVs can hold..." >&4
15881 : volatile so that the compiler has to store it out to memory.
15882 if test X"$d_volatile" = X"$define"; then
15888 typedef $nvtype NV;
15895 while(count < 256) {
15896 $volatile NV up = value + 1.0;
15897 $volatile NV negated = -value;
15898 $volatile NV down = negated - 1.0;
15899 $volatile NV got_up = up - value;
15900 int up_good = got_up == 1.0;
15901 int got_down = down - negated;
15902 int down_good = got_down == -1.0;
15904 if (down_good != up_good) {
15906 "Inconsistency - up %d %f; down %d %f; for 2**%d (%.20f)\n",
15907 up_good, (double) got_up, down_good, (double) got_down,
15908 count, (double) value);
15915 fputs("256.0", stdout);
15918 fputs("2.0", stdout);
15924 fputs("*", stdout);
15930 fprintf(stderr, "Cannot overflow integer range, even at 2**%d (%.20f)\n",
15931 count, (double) value);
15937 nv_overflows_integers_at='0'
15938 if eval $compile; then
15944 The largest integer your NVs can preserve is equal to $xxx
15946 nv_overflows_integers_at="$xxx"
15949 Cannot determine the largest integer value your NVs can hold, unexpected output
15956 Cannot determine the largest integer value your NVs can hold
15963 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
15964 : volatile so that the compiler has to store it out to memory.
15965 if test X"$d_volatile" = X"$define"; then
15970 #$i_stdlib I_STDLIB
15972 #include <stdlib.h>
15974 #$i_string I_STRING
15976 # include <string.h>
15978 # include <strings.h>
15980 #include <sys/types.h>
15981 #include <signal.h>
15983 $volatile int bletched = 0;
15984 $signal_t blech(int s) { bletched = 1; }
15987 int checkit($nvtype d, char *where) {
15988 unsigned char *p = (char *)&d;
15989 unsigned char *end = p + sizeof(d);
15999 printf("No - %s: 0x", where);
16001 printf ("%02X", *p++);
16006 int main(int argc, char **argv) {
16009 fail += checkit(d, "0.0");
16011 /* The compiler shouldn't be assuming that bletched is 0 */
16014 fail += checkit(d, "bleched");
16017 signal(SIGFPE, blech);
16020 /* Paranoia - the compiler should have no way of knowing that ANSI says
16021 that argv[argc] will always be NULL. Actually, if it did assume this it
16022 would be buggy, as this is C and main() can be called from elsewhere in
16024 d = argv[argc] ? 1 : 0;
16027 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
16030 fail += checkit(d, "ternary");
16032 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
16035 printf("No - memset doesn't give 0.0\n");
16036 /* This might just blow up: */
16037 printf("(gives %g)\n", d);
16043 printf("No - something bleched\n");
16048 printf("No - %d fail(s)\n", fail);
16057 d_nv_zero_is_allbits_zero="$undef"
16058 if eval $compile; then
16064 0.0 is represented as all bits zero in memory
16066 d_nv_zero_is_allbits_zero="$define"
16069 0.0 is not represented as all bits zero in memory
16071 d_nv_zero_is_allbits_zero="$undef"
16076 0.0 is not represented as all bits zero in memory
16078 d_nv_zero_is_allbits_zero="$undef"
16084 : check for off64_t
16086 echo "Checking to see if you have off64_t..." >&4
16088 #include <sys/types.h>
16089 #include <unistd.h>
16090 int main() { off64_t x = 7; }
16093 if eval $compile; then
16095 echo "You have off64_t."
16098 echo "You do not have off64_t."
16099 case "$lseeksize" in
16100 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
16107 : how to create joinable pthreads
16108 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
16110 echo "Checking what constant to use for creating joinable pthreads..." >&4
16111 $cat >try.c <<'EOCP'
16112 #include <pthread.h>
16114 int detachstate = JOINABLE;
16117 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
16118 if eval $compile; then
16119 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
16120 val="$undef" # Yes, undef.
16121 set d_old_pthread_create_joinable
16124 set old_pthread_create_joinable
16127 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
16128 if eval $compile; then
16129 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
16131 set d_old_pthread_create_joinable
16133 val=PTHREAD_CREATE_UNDETACHED
16134 set old_pthread_create_joinable
16137 set try -DJOINABLE=__UNDETACHED
16138 if eval $compile; then
16139 echo "You seem to use __UNDETACHED." >&4
16141 set d_old_pthread_create_joinable
16144 set old_pthread_create_joinable
16147 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
16149 set d_old_pthread_create_joinable
16152 set old_pthread_create_joinable
16159 d_old_pthread_create_joinable="$undef"
16160 old_pthread_create_joinable=""
16163 : see if pause exists
16167 : see if poll exists
16171 : see if prctl exists
16175 : see if prctl supports PR_SET_NAME
16176 d_prctl_set_name=$undef
16180 #include <sys/prctl.h>
16182 int main (int argc, char *argv[])
16184 return (prctl (PR_SET_NAME, "Test"));
16188 if eval $compile_ok && $run ./try; then
16189 echo "Your prctl (PR_SET_NAME, ...) works"
16190 d_prctl_set_name=$define
16196 : see if readlink exists
16197 set readlink d_readlink
16200 : Check if exe is symlink to abs path of executing program
16204 case "$d_readlink" in
16206 : NetBSD first as /proc/self is a symlink to /proc/curproc, and it feels
16207 : more tidy to avoid an extra level of symlink
16208 set NetBSD /proc/curproc/exe Linux /proc/self/exe FreeBSD /proc/curproc/file Solaris /proc/self/path/a.out
16209 while test $# -gt 0; do
16212 if $issymlink $try; then
16213 $ls -l $try > reflect
16214 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
16215 echo "You have $type-like $try."
16216 procselfexe='"'$try'"'
16218 : This will break out of the loop
16229 : backward compatibility for d_hvfork
16230 if test X$d_hvfork != X; then
16231 d_vfork="$d_hvfork"
16234 : see if there is a vfork
16239 d_pseudofork=$undef
16241 : Ok, but do we want to use it. vfork is reportedly unreliable in
16242 : perl on Solaris 2.x, and probably elsewhere.
16246 case "$usevfork" in
16252 Perl can only use a vfork() that doesn't suffer from strict
16253 restrictions on calling functions or modifying global data in
16254 the child. For example, glibc-2.1 contains such a vfork()
16255 that is unsuitable. If your system provides a proper fork()
16256 call, chances are that you do NOT want perl to use vfork().
16259 rp="Do you still want to use vfork()?"
16264 echo "Ok, we won't use vfork()."
16273 $define) usevfork='true';;
16274 *) usevfork='false';;
16277 : see whether the pthread_atfork exists
16279 #include <pthread.h>
16282 #ifdef PTHREAD_ATFORK
16283 pthread_atfork(NULL,NULL,NULL);
16288 : see if pthread_atfork exists
16289 set try -DPTHREAD_ATFORK
16290 if eval $compile; then
16295 case "$usethreads" in
16298 $define) echo 'pthread_atfork found.' >&4 ;;
16299 *) echo 'pthread_atfork NOT found.' >&4 ;;
16302 set d_pthread_atfork
16305 : see if pthread_attr_setscope exists
16306 set pthread_attr_setscope d_pthread_attr_setscope
16309 : see whether the various POSIXish _yields exist
16311 #include <pthread.h>
16317 #ifdef PTHREAD_YIELD
16320 #ifdef PTHREAD_YIELD_NULL
16321 pthread_yield(NULL);
16327 : see if sched_yield exists
16328 set try -DSCHED_YIELD
16329 if eval $compile; then
16331 sched_yield='sched_yield()'
16335 case "$usethreads" in
16338 $define) echo 'sched_yield() found.' >&4 ;;
16339 *) echo 'sched_yield() NOT found.' >&4 ;;
16345 : see if pthread_yield exists
16346 set try -DPTHREAD_YIELD
16347 if eval $compile; then
16349 case "$sched_yield" in
16350 '') sched_yield='pthread_yield()' ;;
16353 set try -DPTHREAD_YIELD_NULL
16354 if eval $compile; then
16356 case "$sched_yield" in
16357 '') sched_yield='pthread_yield(NULL)' ;;
16363 case "$usethreads" in
16366 $define) echo 'pthread_yield() found.' >&4 ;;
16367 *) echo 'pthread_yield() NOT found.' >&4 ;;
16371 set d_pthread_yield
16373 case "$sched_yield" in
16374 '') sched_yield=undef ;;
16378 : see if random_r exists
16379 set random_r d_random_r
16381 case "$d_random_r" in
16383 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16384 case "$d_random_r_proto:$usethreads" in
16385 ":define") d_random_r_proto=define
16386 set d_random_r_proto random_r $hdrs
16390 case "$d_random_r_proto" in
16392 case "$random_r_proto" in
16393 ''|0) try='int random_r(int*, struct random_data*);'
16394 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_iS ;;
16396 case "$random_r_proto" in
16397 ''|0) try='int random_r(long*, struct random_data*);'
16398 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_lS ;;
16400 case "$random_r_proto" in
16401 ''|0) try='int random_r(struct random_data*, int32_t*);'
16402 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_St ;;
16404 case "$random_r_proto" in
16405 ''|0) d_random_r=undef
16407 echo "Disabling random_r, cannot determine prototype." >&4 ;;
16408 * ) case "$random_r_proto" in
16409 REENTRANT_PROTO*) ;;
16410 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
16412 echo "Prototype: $try" ;;
16415 *) case "$usethreads" in
16416 define) echo "random_r has no prototype, not using it." >&4 ;;
16423 *) random_r_proto=0
16427 : see if readdir and friends exist
16428 set readdir d_readdir
16430 set seekdir d_seekdir
16432 set telldir d_telldir
16434 set rewinddir d_rewinddir
16437 : see if readdir64_r exists
16438 set readdir64_r d_readdir64_r
16440 case "$d_readdir64_r" in
16442 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16443 case "$d_readdir64_r_proto:$usethreads" in
16444 ":define") d_readdir64_r_proto=define
16445 set d_readdir64_r_proto readdir64_r $hdrs
16449 case "$d_readdir64_r_proto" in
16451 case "$readdir64_r_proto" in
16452 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
16453 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TSR ;;
16455 case "$readdir64_r_proto" in
16456 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
16457 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TS ;;
16459 case "$readdir64_r_proto" in
16460 ''|0) d_readdir64_r=undef
16461 readdir64_r_proto=0
16462 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
16463 * ) case "$readdir64_r_proto" in
16464 REENTRANT_PROTO*) ;;
16465 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
16467 echo "Prototype: $try" ;;
16470 *) case "$usethreads" in
16471 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
16473 d_readdir64_r=undef
16474 readdir64_r_proto=0
16478 *) readdir64_r_proto=0
16482 : see if readdir_r exists
16483 set readdir_r d_readdir_r
16485 case "$d_readdir_r" in
16487 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16488 case "$d_readdir_r_proto:$usethreads" in
16489 ":define") d_readdir_r_proto=define
16490 set d_readdir_r_proto readdir_r $hdrs
16494 case "$d_readdir_r_proto" in
16496 case "$readdir_r_proto" in
16497 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
16498 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TSR ;;
16500 case "$readdir_r_proto" in
16501 ''|0) try='int readdir_r(DIR*, struct dirent*);'
16502 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TS ;;
16504 case "$readdir_r_proto" in
16505 ''|0) d_readdir_r=undef
16507 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
16508 * ) case "$readdir_r_proto" in
16509 REENTRANT_PROTO*) ;;
16510 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
16512 echo "Prototype: $try" ;;
16515 *) case "$usethreads" in
16516 define) echo "readdir_r has no prototype, not using it." >&4 ;;
16523 *) readdir_r_proto=0
16527 : see if readv exists
16531 : see if recvmsg exists
16532 set recvmsg d_recvmsg
16535 : see if rename exists
16536 set rename d_rename
16539 : see if rmdir exists
16543 : see if memory.h is available.
16548 : See if it conflicts with string.h
16554 $cppstdin $cppflags $cppminus < $strings > mem.h
16555 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
16557 echo "We won't be including <memory.h>."
16567 : can bcopy handle overlapping blocks?
16570 case "$d_memmove" in
16571 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
16572 *) case "$d_bcopy" in
16574 echo "Checking to see if bcopy() can do overlapping copies..." >&4
16576 #$i_memory I_MEMORY
16577 #$i_stdlib I_STDLIB
16578 #$i_string I_STRING
16579 #$i_unistd I_UNISTD
16581 $cat >>try.c <<'EOCP'
16584 # include <memory.h>
16587 # include <stdlib.h>
16590 # include <string.h>
16592 # include <strings.h>
16595 # include <unistd.h> /* Needed for NetBSD */
16599 char buf[128], abc[128];
16605 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16606 try to store the string in read-only memory. */
16607 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
16609 for (align = 7; align >= 0; align--) {
16610 for (len = 36; len; len--) {
16612 bcopy(abc, b, len);
16613 for (off = 1; off <= len; off++) {
16614 bcopy(b, b+off, len);
16615 bcopy(b+off, b, len);
16616 if (bcmp(b, abc, len))
16625 if eval $compile_ok; then
16626 if $run ./try 2>/dev/null; then
16627 echo "Yes, it can."
16630 echo "It can't, sorry."
16633 echo "(I can't compile the test program, so we'll assume not...)"
16643 : can memcpy handle overlapping blocks?
16646 case "$d_memmove" in
16647 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
16648 *) case "$d_memcpy" in
16650 echo "Checking to see if memcpy() can do overlapping copies..." >&4
16652 #$i_memory I_MEMORY
16653 #$i_stdlib I_STDLIB
16654 #$i_string I_STRING
16655 #$i_unistd I_UNISTD
16657 $cat >>try.c <<'EOCP'
16660 # include <memory.h>
16663 # include <stdlib.h>
16666 # include <string.h>
16668 # include <strings.h>
16671 # include <unistd.h> /* Needed for NetBSD */
16675 char buf[128], abc[128];
16681 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16682 try to store the string in read-only memory. */
16683 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
16685 for (align = 7; align >= 0; align--) {
16686 for (len = 36; len; len--) {
16688 memcpy(b, abc, len);
16689 for (off = 1; off <= len; off++) {
16690 memcpy(b+off, b, len);
16691 memcpy(b, b+off, len);
16692 if (memcmp(b, abc, len))
16701 if eval $compile_ok; then
16702 if $run ./try 2>/dev/null; then
16703 echo "Yes, it can."
16706 echo "It can't, sorry."
16709 echo "(I can't compile the test program, so we'll assume not...)"
16719 : can memcmp be trusted to compare relative magnitude?
16721 case "$d_memcmp" in
16724 echo "Checking if your memcmp() can compare relative magnitude..." >&4
16726 #$i_memory I_MEMORY
16727 #$i_stdlib I_STDLIB
16728 #$i_string I_STRING
16729 #$i_unistd I_UNISTD
16731 $cat >>try.c <<'EOCP'
16734 # include <memory.h>
16737 # include <stdlib.h>
16740 # include <string.h>
16742 # include <strings.h>
16745 # include <unistd.h> /* Needed for NetBSD */
16751 if ((a < b) && memcmp(&a, &b, 1) < 0)
16757 if eval $compile_ok; then
16758 if $run ./try 2>/dev/null; then
16759 echo "Yes, it can."
16762 echo "No, it can't (it uses signed chars)."
16765 echo "(I can't compile the test program, so we'll assume not...)"
16773 : see if prototype for sbrk is available
16775 set d_sbrkproto sbrk $i_unistd unistd.h
16778 : see if select exists
16779 set select d_select
16782 : see if semctl exists
16783 set semctl d_semctl
16786 : see if semget exists
16787 set semget d_semget
16790 : see if semop exists
16794 : see how much of the 'sem*(2)' library is present.
16797 case "$d_semctl$d_semget$d_semop" in
16798 *"$undef"*) h_sem=false;;
16802 case "`ipcs 2>&1`" in
16803 "SVID messages"*"not configured"*)
16804 echo "Your $osname does not have the sem*(2) configured." >&4
16807 set semctl d_semctl
16809 set semget d_semget
16817 : we could also check for sys/ipc.h ...
16818 if $h_sem && $test `./findhdr sys/sem.h`; then
16819 echo "You have the full sem*(2) library." >&4
16822 echo "You don't have the full sem*(2) library." >&4
16828 : see whether sys/sem.h defines union semun
16830 $cat > try.c <<'END'
16831 #include <sys/types.h>
16832 #include <sys/ipc.h>
16833 #include <sys/sem.h>
16834 int main () { union semun semun; semun.buf = 0; }
16837 if eval $compile; then
16838 echo "You have union semun in <sys/sem.h>." >&4
16841 echo "You do not have union semun in <sys/sem.h>." >&4
16848 : see how to do semctl IPC_STAT
16852 $cat > tryh.h <<END
16855 # define S_IRUSR S_IREAD
16856 # define S_IWUSR S_IWRITE
16857 # define S_IXUSR S_IEXEC
16859 # define S_IRUSR 0400
16860 # define S_IWUSR 0200
16861 # define S_IXUSR 0100
16863 # define S_IRGRP (S_IRUSR>>3)
16864 # define S_IWGRP (S_IWUSR>>3)
16865 # define S_IXGRP (S_IXUSR>>3)
16866 # define S_IROTH (S_IRUSR>>6)
16867 # define S_IWOTH (S_IWUSR>>6)
16868 # define S_IXOTH (S_IXUSR>>6)
16871 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
16872 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
16873 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
16876 : see whether semctl IPC_STAT can use union semun
16877 case "$d_semctl_semun" in
16881 #include <sys/types.h>
16882 #include <sys/ipc.h>
16883 #include <sys/sem.h>
16884 #include <sys/stat.h>
16891 #$d_union_semun HAS_UNION_SEMUN
16894 #ifndef HAS_UNION_SEMUN
16897 struct semid_ds *buf;
16898 unsigned short *array;
16904 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16905 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16907 struct semid_ds argbuf;
16910 st = semctl(sem, 0, IPC_STAT, arg);
16914 # endif /* IPC_STAT */
16915 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16917 if (semctl(sem, 0, IPC_RMID, arg) != 0)
16918 # endif /* IPC_RMID */
16919 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16921 #endif /* IPC_PRIVATE && ... */
16922 printf("semget failed: errno = %d\n", errno);
16927 if eval $compile; then
16930 semun) val="$define" ;;
16938 case "$d_semctl_semun" in
16940 echo "You can use union semun for semctl IPC_STAT." >&4
16943 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
16948 : see whether semctl IPC_STAT can use struct semid_ds pointer
16949 case "$d_semctl_semid_ds" in
16952 $cat > try.c <<'END'
16953 #include <sys/types.h>
16954 #include <sys/ipc.h>
16955 #include <sys/sem.h>
16956 #include <sys/stat.h>
16964 struct semid_ds arg;
16967 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16968 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16971 st = semctl(sem, 0, IPC_STAT, &arg);
16973 printf("semid_ds\n");
16975 # endif /* IPC_STAT */
16976 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16978 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
16979 # endif /* IPC_RMID */
16980 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16982 #endif /* IPC_PRIVATE && ... */
16983 printf("semget failed: errno = %d\n", errno);
16989 if eval $compile; then
16992 semid_ds) val="$define" ;;
16996 set d_semctl_semid_ds
17000 case "$d_semctl_semid_ds" in
17002 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
17004 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
17010 # We do not have the full sem*(2) library, so assume we can not
17016 set d_semctl_semid_ds
17022 : see if sendmsg exists
17023 set sendmsg d_sendmsg
17026 : see if setegid exists
17027 set setegid d_setegid
17030 : see if seteuid exists
17031 set seteuid d_seteuid
17034 : see if setgrent exists
17035 set setgrent d_setgrent
17038 : see if setgrent_r exists
17039 set setgrent_r d_setgrent_r
17041 case "$d_setgrent_r" in
17043 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
17044 case "$d_setgrent_r_proto:$usethreads" in
17045 ":define") d_setgrent_r_proto=define
17046 set d_setgrent_r_proto setgrent_r $hdrs
17050 case "$d_setgrent_r_proto" in
17052 case "$setgrent_r_proto" in
17053 ''|0) try='int setgrent_r(FILE**);'
17054 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=I_H ;;
17056 case "$setgrent_r_proto" in
17057 ''|0) try='void setgrent_r(FILE**);'
17058 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=V_H ;;
17060 case "$setgrent_r_proto" in
17061 ''|0) d_setgrent_r=undef
17063 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
17064 * ) case "$setgrent_r_proto" in
17065 REENTRANT_PROTO*) ;;
17066 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
17068 echo "Prototype: $try" ;;
17071 *) case "$usethreads" in
17072 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
17079 *) setgrent_r_proto=0
17083 : see if sethostent exists
17084 set sethostent d_sethent
17087 : see if sethostent_r exists
17088 set sethostent_r d_sethostent_r
17090 case "$d_sethostent_r" in
17092 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17093 case "$d_sethostent_r_proto:$usethreads" in
17094 ":define") d_sethostent_r_proto=define
17095 set d_sethostent_r_proto sethostent_r $hdrs
17099 case "$d_sethostent_r_proto" in
17101 case "$sethostent_r_proto" in
17102 ''|0) try='int sethostent_r(int, struct hostent_data*);'
17103 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=I_ID ;;
17105 case "$sethostent_r_proto" in
17106 ''|0) try='void sethostent_r(int, struct hostent_data*);'
17107 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=V_ID ;;
17109 case "$sethostent_r_proto" in
17110 ''|0) d_sethostent_r=undef
17111 sethostent_r_proto=0
17112 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
17113 * ) case "$sethostent_r_proto" in
17114 REENTRANT_PROTO*) ;;
17115 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
17117 echo "Prototype: $try" ;;
17120 *) case "$usethreads" in
17121 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
17123 d_sethostent_r=undef
17124 sethostent_r_proto=0
17128 *) sethostent_r_proto=0
17132 : see if setitimer exists
17133 set setitimer d_setitimer
17136 : see if setlinebuf exists
17137 set setlinebuf d_setlinebuf
17140 : see if setlocale exists
17141 set setlocale d_setlocale
17144 : see if locale.h is available
17145 set locale.h i_locale
17148 : see if setlocale_r exists
17149 set setlocale_r d_setlocale_r
17151 case "$d_setlocale_r" in
17153 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
17154 case "$d_setlocale_r_proto:$usethreads" in
17155 ":define") d_setlocale_r_proto=define
17156 set d_setlocale_r_proto setlocale_r $hdrs
17160 case "$d_setlocale_r_proto" in
17162 case "$setlocale_r_proto" in
17163 ''|0) try='int setlocale_r(int, const char*, char*, int);'
17164 ./protochk "$extern_C $try" $hdrs && setlocale_r_proto=I_ICBI ;;
17166 case "$setlocale_r_proto" in
17167 ''|0) d_setlocale_r=undef
17168 setlocale_r_proto=0
17169 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
17170 * ) case "$setlocale_r_proto" in
17171 REENTRANT_PROTO*) ;;
17172 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
17174 echo "Prototype: $try" ;;
17177 *) case "$usethreads" in
17178 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
17180 d_setlocale_r=undef
17181 setlocale_r_proto=0
17185 *) setlocale_r_proto=0
17189 : see if setnetent exists
17190 set setnetent d_setnent
17193 : see if setnetent_r exists
17194 set setnetent_r d_setnetent_r
17196 case "$d_setnetent_r" in
17198 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17199 case "$d_setnetent_r_proto:$usethreads" in
17200 ":define") d_setnetent_r_proto=define
17201 set d_setnetent_r_proto setnetent_r $hdrs
17205 case "$d_setnetent_r_proto" in
17207 case "$setnetent_r_proto" in
17208 ''|0) try='int setnetent_r(int, struct netent_data*);'
17209 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=I_ID ;;
17211 case "$setnetent_r_proto" in
17212 ''|0) try='void setnetent_r(int, struct netent_data*);'
17213 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=V_ID ;;
17215 case "$setnetent_r_proto" in
17216 ''|0) d_setnetent_r=undef
17217 setnetent_r_proto=0
17218 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
17219 * ) case "$setnetent_r_proto" in
17220 REENTRANT_PROTO*) ;;
17221 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
17223 echo "Prototype: $try" ;;
17226 *) case "$usethreads" in
17227 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
17229 d_setnetent_r=undef
17230 setnetent_r_proto=0
17234 *) setnetent_r_proto=0
17238 : see if setprotoent exists
17239 set setprotoent d_setpent
17242 : see if setpgid exists
17243 set setpgid d_setpgid
17246 : see if setpgrp2 exists
17247 set setpgrp2 d_setpgrp2
17250 : see if setpriority exists
17251 set setpriority d_setprior
17254 : see if setproctitle exists
17255 set setproctitle d_setproctitle
17258 : see if setprotoent_r exists
17259 set setprotoent_r d_setprotoent_r
17261 case "$d_setprotoent_r" in
17263 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17264 case "$d_setprotoent_r_proto:$usethreads" in
17265 ":define") d_setprotoent_r_proto=define
17266 set d_setprotoent_r_proto setprotoent_r $hdrs
17270 case "$d_setprotoent_r_proto" in
17272 case "$setprotoent_r_proto" in
17273 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
17274 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=I_ID ;;
17276 case "$setprotoent_r_proto" in
17277 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
17278 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=V_ID ;;
17280 case "$setprotoent_r_proto" in
17281 ''|0) d_setprotoent_r=undef
17282 setprotoent_r_proto=0
17283 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
17284 * ) case "$setprotoent_r_proto" in
17285 REENTRANT_PROTO*) ;;
17286 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
17288 echo "Prototype: $try" ;;
17291 *) case "$usethreads" in
17292 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
17294 d_setprotoent_r=undef
17295 setprotoent_r_proto=0
17299 *) setprotoent_r_proto=0
17303 : see if setpwent exists
17304 set setpwent d_setpwent
17307 : see if setpwent_r exists
17308 set setpwent_r d_setpwent_r
17310 case "$d_setpwent_r" in
17312 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
17313 case "$d_setpwent_r_proto:$usethreads" in
17314 ":define") d_setpwent_r_proto=define
17315 set d_setpwent_r_proto setpwent_r $hdrs
17319 case "$d_setpwent_r_proto" in
17321 case "$setpwent_r_proto" in
17322 ''|0) try='int setpwent_r(FILE**);'
17323 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=I_H ;;
17325 case "$setpwent_r_proto" in
17326 ''|0) try='void setpwent_r(FILE**);'
17327 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=V_H ;;
17329 case "$setpwent_r_proto" in
17330 ''|0) d_setpwent_r=undef
17332 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
17333 * ) case "$setpwent_r_proto" in
17334 REENTRANT_PROTO*) ;;
17335 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
17337 echo "Prototype: $try" ;;
17340 *) case "$usethreads" in
17341 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
17348 *) setpwent_r_proto=0
17352 : see if setregid exists
17353 set setregid d_setregid
17355 set setresgid d_setresgid
17358 : see if setreuid exists
17359 set setreuid d_setreuid
17361 set setresuid d_setresuid
17364 : see if setrgid exists
17365 set setrgid d_setrgid
17368 : see if setruid exists
17369 set setruid d_setruid
17372 : see if setservent exists
17373 set setservent d_setsent
17376 : see if setservent_r exists
17377 set setservent_r d_setservent_r
17379 case "$d_setservent_r" in
17381 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17382 case "$d_setservent_r_proto:$usethreads" in
17383 ":define") d_setservent_r_proto=define
17384 set d_setservent_r_proto setservent_r $hdrs
17388 case "$d_setservent_r_proto" in
17390 case "$setservent_r_proto" in
17391 ''|0) try='int setservent_r(int, struct servent_data*);'
17392 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=I_ID ;;
17394 case "$setservent_r_proto" in
17395 ''|0) try='void setservent_r(int, struct servent_data*);'
17396 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=V_ID ;;
17398 case "$setservent_r_proto" in
17399 ''|0) d_setservent_r=undef
17400 setservent_r_proto=0
17401 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
17402 * ) case "$setservent_r_proto" in
17403 REENTRANT_PROTO*) ;;
17404 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
17406 echo "Prototype: $try" ;;
17409 *) case "$usethreads" in
17410 define) echo "setservent_r has no prototype, not using it." >&4 ;;
17412 d_setservent_r=undef
17413 setservent_r_proto=0
17417 *) setservent_r_proto=0
17421 : see if setsid exists
17422 set setsid d_setsid
17425 : see if setvbuf exists
17426 set setvbuf d_setvbuf
17429 : see if shmctl exists
17430 set shmctl d_shmctl
17433 : see if shmget exists
17434 set shmget d_shmget
17437 : see if shmat exists
17440 : see what shmat returns
17443 $cat >shmat.c <<'END'
17444 #include <sys/shm.h>
17447 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
17452 echo "and it returns ($shmattype)." >&4
17453 : see if a prototype for shmat is available
17454 xxx=`./findhdr sys/shm.h`
17455 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
17456 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
17467 set d_shmatprototype
17470 : see if shmdt exists
17474 : see how much of the 'shm*(2)' library is present.
17477 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
17478 *"$undef"*) h_shm=false;;
17482 case "`ipcs 2>&1`" in
17483 "SVID shared memory"*"not configured"*)
17484 echo "Your $osname does not have the shm*(2) configured." >&4
17487 set shmctl d_shmctl
17489 set shmget d_shmget
17499 : we could also check for sys/ipc.h ...
17500 if $h_shm && $test `./findhdr sys/shm.h`; then
17501 echo "You have the full shm*(2) library." >&4
17504 echo "You don't have the full shm*(2) library." >&4
17510 : see if we have sigaction
17512 if set sigaction val -f d_sigaction; eval $csym; $val; then
17513 echo 'sigaction() found.' >&4
17516 #include <sys/types.h>
17517 #include <signal.h>
17518 #$i_stdlib I_STDLIB
17520 #include <stdlib.h>
17524 struct sigaction act, oact;
17526 oact.sa_handler = 0;
17527 /* so that act and oact are used */
17528 exit(act.sa_flags == 0 && oact.sa_handler == 0);
17532 if eval $compile_ok; then
17535 echo "But you don't seem to have a usable struct sigaction." >&4
17539 echo 'sigaction NOT found.' >&4
17542 set d_sigaction; eval $setvar
17545 : see if this is a sunmath.h system
17546 set sunmath.h i_sunmath
17549 : see if signbit exists
17550 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
17553 #$i_sunmath I_SUNMATH
17557 #ifdef I_SUNMATH /* Solaris special math library */
17558 # include <sunmath.h>
17561 int main(int argc, char **argv)
17565 if ((signbit(x) == 0) && (signbit(y) != 0))
17573 if eval $compile; then
17574 if $run ./try; then
17578 $echo "Signbit seems to be available, but doesn't work as I expected."
17579 $echo "I won't use it." >&4
17590 : see if sigprocmask exists
17591 set sigprocmask d_sigprocmask
17594 : see if sigsetjmp exists
17596 case "$d_sigsetjmp" in
17599 #include <setjmp.h>
17600 #$i_stdlib I_STDLIB
17602 #include <stdlib.h>
17608 if (sigsetjmp(env,1))
17611 siglongjmp(env, 1);
17616 if eval $compile; then
17617 if $run ./try >/dev/null 2>&1; then
17618 echo "POSIX sigsetjmp found." >&4
17622 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
17628 echo "sigsetjmp not found." >&4
17632 *) val="$d_sigsetjmp"
17633 case "$d_sigsetjmp" in
17634 $define) echo "POSIX sigsetjmp found." >&4;;
17635 $undef) echo "sigsetjmp not found." >&4;;
17643 : see if snprintf exists
17644 set snprintf d_snprintf
17647 : see if vsnprintf exists
17648 set vsnprintf d_vsnprintf
17651 case "$d_snprintf-$d_vsnprintf" in
17654 Checking whether your snprintf() and vsnprintf() work okay...
17656 $cat >try.c <<'EOCP'
17657 /* v?snprintf testing logic courtesy of Russ Allbery.
17658 * According to C99:
17659 * - if the buffer is too short it still must be \0-terminated
17660 * - if the buffer is too short the potentially required length
17661 * must be returned and not -1
17662 * - if the buffer is NULL the potentially required length
17663 * must be returned and not -1 or core dump
17666 #include <stdarg.h>
17670 int test (char *format, ...)
17675 va_start (args, format);
17676 count = vsnprintf (buf, sizeof buf, format, args);
17683 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
17684 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
17688 if eval $compile; then
17691 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
17693 Your snprintf() and snprintf() don't seem to be working okay.
17695 d_snprintf="$undef"
17696 d_vsnprintf="$undef"
17700 echo "(I can't seem to compile the test program--assuming they don't)"
17701 d_snprintf="$undef"
17702 d_vsnprintf="$undef"
17708 : see if sockatmark exists
17709 set sockatmark d_sockatmark
17712 : see if prototype for sockatmark is available
17714 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
17717 : see if socks5_init exists
17718 set socks5_init d_socks5_init
17721 : see if sprintf returns the length of the string in the buffer as per ANSI
17722 $echo "Checking whether sprintf returns the length of the string..." >&4
17725 #$i_stdlib I_STDLIB
17727 #include <stdlib.h>
17729 #$i_string I_STRING
17731 # include <string.h>
17733 # include <strings.h>
17742 int check (size_t expect, int test) {
17743 size_t got = strlen(buffer);
17747 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
17752 int main(int argc, char **argv) {
17755 check(sprintf(buffer, ""), ++test);
17756 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
17757 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
17764 if eval $compile; then
17768 sprintf returns the length of the string (as ANSI says it should)
17770 d_sprintf_returns_strlen="$define"
17773 sprintf does not return the length of the string (how old is this system?)
17775 d_sprintf_returns_strlen="$undef"
17779 echo "(I can't seem to compile the test program--assuming it doesn't)" >&4
17780 d_sprintf_returns_strlen="$undef"
17784 : see if srand48_r exists
17785 set srand48_r d_srand48_r
17787 case "$d_srand48_r" in
17789 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17790 case "$d_srand48_r_proto:$usethreads" in
17791 ":define") d_srand48_r_proto=define
17792 set d_srand48_r_proto srand48_r $hdrs
17796 case "$d_srand48_r_proto" in
17798 case "$srand48_r_proto" in
17799 ''|0) try='int srand48_r(long, struct drand48_data*);'
17800 ./protochk "$extern_C $try" $hdrs && srand48_r_proto=I_LS ;;
17802 case "$srand48_r_proto" in
17803 ''|0) d_srand48_r=undef
17805 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
17806 * ) case "$srand48_r_proto" in
17807 REENTRANT_PROTO*) ;;
17808 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
17810 echo "Prototype: $try" ;;
17813 *) case "$usethreads" in
17814 define) echo "srand48_r has no prototype, not using it." >&4 ;;
17821 *) srand48_r_proto=0
17825 : see if srandom_r exists
17826 set srandom_r d_srandom_r
17828 case "$d_srandom_r" in
17830 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17831 case "$d_srandom_r_proto:$usethreads" in
17832 ":define") d_srandom_r_proto=define
17833 set d_srandom_r_proto srandom_r $hdrs
17837 case "$d_srandom_r_proto" in
17839 case "$srandom_r_proto" in
17840 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
17841 ./protochk "$extern_C $try" $hdrs && srandom_r_proto=I_TS ;;
17843 case "$srandom_r_proto" in
17844 ''|0) d_srandom_r=undef
17846 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
17847 * ) case "$srandom_r_proto" in
17848 REENTRANT_PROTO*) ;;
17849 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
17851 echo "Prototype: $try" ;;
17854 *) case "$usethreads" in
17855 define) echo "srandom_r has no prototype, not using it." >&4 ;;
17862 *) srandom_r_proto=0
17866 : see if prototype for setresgid is available
17868 set d_sresgproto setresgid $i_unistd unistd.h
17871 : see if prototype for setresuid is available
17873 set d_sresuproto setresuid $i_unistd unistd.h
17876 : see if sys/stat.h is available
17877 set sys/stat.h i_sysstat
17880 : see if stat knows about block sizes
17882 echo "Checking to see if your struct stat has st_blocks field..." >&4
17883 set d_statblks stat st_blocks $i_sysstat sys/stat.h
17886 : see if this is a sys/vfs.h system
17887 set sys/vfs.h i_sysvfs
17890 : see if this is a sys/statfs.h system
17891 set sys/statfs.h i_sysstatfs
17894 : Check for statfs_s
17896 echo "Checking to see if your system supports struct statfs..." >&4
17897 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
17899 case "$d_statfs_s" in
17900 "$define") echo "Yes, it does." ;;
17901 *) echo "No, it doesn't." ;;
17905 : see if struct statfs knows about f_flags
17906 case "$d_statfs_s" in
17909 echo "Checking to see if your struct statfs has f_flags field..." >&4
17910 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
17914 set d_statfs_f_flags
17918 case "$d_statfs_f_flags" in
17919 "$define") echo "Yes, it does." ;;
17920 *) echo "No, it doesn't." ;;
17923 : see what flavor, if any, of static inline is supported
17925 echo "Checking to see if your system supports static inline..."
17926 $cat > try.c <<'EOCP'
17927 #include <stdlib.h>
17928 extern int f_via_a(int x);
17929 extern int f_via_b(int x);
17930 int main(int argc, char **argv)
17939 return EXIT_SUCCESS;
17942 return EXIT_FAILURE;
17946 $cat > a.c <<'EOCP'
17947 static INLINE int f(int x) {
17958 $cat > b.c <<'EOCP'
17959 extern int f(int x);
17967 # Respect a hint (or previous) value for perl_static_inline, if there is one.
17968 case "$perl_static_inline" in
17969 '') # Check the various possibilities, and break out on success.
17970 # For gcc, prefer __inline__, which will still permit
17971 # cflags.SH to add in -ansi.
17972 case "$gccversion" in
17973 '') xxx="inline __inline__ __inline _inline";;
17974 *) xxx="__inline__ inline __inline _inline";;
17976 for inline in $xxx; do
17977 set try -DINLINE=$inline a.c
17978 if eval $compile && $run ./try; then
17979 # Now make sure there is no external linkage of static
17981 set try -DINLINE=$inline -DUSE_B a.c b.c
17982 if eval $compile && $run ./try; then
17983 $echo "Your compiler supports static $inline, " >&4
17984 $echo "but it also creates an external definition," >&4
17985 $echo "so I won't use it." >&4
17988 $echo "Your compiler supports static $inline." >&4
17990 perl_static_inline="static $inline";
17994 $echo "Your compiler does NOT support static $inline." >&4
17999 *inline*) # Some variant of inline exists.
18000 echo "Keeping your $hint value of $perl_static_inline."
18003 static) # No inline capabilities
18004 echo "Keeping your $hint value of $perl_static_inline."
18007 *) # Unrecognized previous value -- blindly trust the supplied
18008 # value and hope it makes sense. Use old value for
18009 # d_static_inline, if there is one.
18010 echo "Keeping your $hint value of $perl_static_inline."
18011 case "$d_static_inline" in
18013 *) val=$d_static_inline ;;
18017 # Fallback to plain 'static' if nothing worked.
18018 case "$perl_static_inline" in
18020 perl_static_inline="static"
18024 set d_static_inline
18026 $rm -f a.[co] b.[co]
18029 : Check stream access
18031 Checking how to access stdio streams by file descriptor number...
18033 case "$stdio_stream_array" in
18034 '') $cat >try.c <<EOCP
18037 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
18041 for s in _iob __iob __sF
18043 set try -DSTDIO_STREAM_ARRAY=$s
18044 if eval $compile; then
18045 case "`$run ./try`" in
18046 yes) stdio_stream_array=$s; break ;;
18052 case "$stdio_stream_array" in
18054 I can't figure out how to access stdio streams by file descriptor number.
18056 d_stdio_stream_array="$undef"
18059 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
18061 d_stdio_stream_array="$define"
18065 : see if strcoll exists
18066 set strcoll d_strcoll
18069 : check for structure copying
18071 echo "Checking to see if your C compiler can copy structs..." >&4
18072 $cat >try.c <<'EOCP'
18082 if $cc -c try.c >/dev/null 2>&1 ; then
18084 echo "Yup, it can."
18087 echo "Nope, it can't."
18093 : see if strerror and/or sys_errlist[] exist
18095 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
18096 if set strerror val -f d_strerror; eval $csym; $val; then
18097 echo 'strerror() found.' >&4
18098 d_strerror="$define"
18099 d_strerrm='strerror(e)'
18100 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18101 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
18102 d_syserrlst="$define"
18104 echo "(Since you don't have sys_errlist[], strerror() is welcome.)"
18105 d_syserrlst="$undef"
18107 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
18108 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
18109 echo 'strerror() found in string header.' >&4
18110 d_strerror="$define"
18111 d_strerrm='strerror(e)'
18112 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18113 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
18114 d_syserrlst="$define"
18116 echo "(You don't appear to have any sys_errlist[], how can this be?)"
18117 d_syserrlst="$undef"
18119 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18120 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
18121 d_strerror="$undef"
18122 d_syserrlst="$define"
18123 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
18125 echo 'strerror() and sys_errlist[] NOT found.' >&4
18126 d_strerror="$undef"
18127 d_syserrlst="$undef"
18128 d_strerrm='"unknown"'
18132 : see if strerror_r exists
18133 set strerror_r d_strerror_r
18135 case "$d_strerror_r" in
18137 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
18138 case "$d_strerror_r_proto:$usethreads" in
18139 ":define") d_strerror_r_proto=define
18140 set d_strerror_r_proto strerror_r $hdrs
18144 case "$d_strerror_r_proto" in
18146 case "$strerror_r_proto" in
18147 ''|0) try='int strerror_r(int, char*, size_t);'
18148 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBW ;;
18150 case "$strerror_r_proto" in
18151 ''|0) try='int strerror_r(int, char*, int);'
18152 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBI ;;
18154 case "$strerror_r_proto" in
18155 ''|0) try='char* strerror_r(int, char*, size_t);'
18156 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=B_IBW ;;
18158 case "$strerror_r_proto" in
18159 ''|0) d_strerror_r=undef
18161 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
18162 * ) case "$strerror_r_proto" in
18163 REENTRANT_PROTO*) ;;
18164 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
18166 echo "Prototype: $try" ;;
18169 *) case "$usethreads" in
18170 define) echo "strerror_r has no prototype, not using it." >&4 ;;
18177 *) strerror_r_proto=0
18181 : see if strftime exists
18182 set strftime d_strftime
18185 : see if strlcat exists
18186 set strlcat d_strlcat
18189 : see if strlcpy exists
18190 set strlcpy d_strlcpy
18193 : see if strtod exists
18194 set strtod d_strtod
18197 : see if strtol exists
18198 set strtol d_strtol
18201 : see if strtold exists
18202 set strtold d_strtold
18205 : see if strtoll exists
18206 set strtoll d_strtoll
18209 case "$d_longlong-$d_strtoll" in
18212 Checking whether your strtoll() works okay...
18214 $cat >try.c <<'EOCP'
18217 #define strtoll __strtoll
18220 #define strtoll _strtoll
18223 extern long long int strtoll(char *s, char **, int);
18224 static int bad = 0;
18225 int check(char *s, long long ell, int een) {
18228 gll = strtoll(s, 0, 10);
18229 if (!((gll == ell) && (errno == een)))
18233 check(" 1", 1LL, 0);
18234 check(" 0", 0LL, 0);
18235 check("-1", -1LL, 0);
18236 check("-9223372036854775808", -9223372036854775808LL, 0);
18237 check("-9223372036854775808", -9223372036854775808LL, 0);
18238 check(" 9223372036854775807", 9223372036854775807LL, 0);
18239 check("-9223372036854775808", -9223372036854775808LL, 0);
18240 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
18241 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
18247 if eval $compile; then
18250 ok) echo "Your strtoll() seems to be working okay." ;;
18252 Your strtoll() doesn't seem to be working okay.
18258 echo "(I can't seem to compile the test program--assuming it doesn't)"
18264 : see if strtoq exists
18265 set strtoq d_strtoq
18268 : see if strtoul exists
18269 set strtoul d_strtoul
18272 case "$d_strtoul" in
18275 Checking whether your strtoul() works okay...
18277 $cat >try.c <<'EOCP'
18280 extern unsigned long int strtoul(char *s, char **, int);
18281 static int bad = 0;
18282 void check(char *s, unsigned long eul, int een) {
18285 gul = strtoul(s, 0, 10);
18286 if (!((gul == eul) && (errno == een)))
18290 check(" 1", 1L, 0);
18291 check(" 0", 0L, 0);
18293 case "$longsize" in
18295 $cat >>try.c <<'EOCP'
18296 check("18446744073709551615", 18446744073709551615UL, 0);
18297 check("18446744073709551616", 18446744073709551615UL, ERANGE);
18298 #if 0 /* strtoul() for /^-/ strings is undefined. */
18299 check("-1", 18446744073709551615UL, 0);
18300 check("-18446744073709551614", 2, 0);
18301 check("-18446744073709551615", 1, 0);
18302 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
18303 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
18308 $cat >>try.c <<'EOCP'
18309 check("4294967295", 4294967295UL, 0);
18310 check("4294967296", 4294967295UL, ERANGE);
18311 #if 0 /* strtoul() for /^-/ strings is undefined. */
18312 check("-1", 4294967295UL, 0);
18313 check("-4294967294", 2, 0);
18314 check("-4294967295", 1, 0);
18315 check("-4294967296", 4294967295UL, ERANGE);
18316 check("-4294967297", 4294967295UL, ERANGE);
18321 : Should we write these tests to be more portable by sprintf-ing
18322 : ~0 and then manipulating that char string as input for strtol?
18325 $cat >>try.c <<'EOCP'
18332 if eval $compile; then
18333 case "`$run ./try`" in
18334 ok) echo "Your strtoul() seems to be working okay." ;;
18336 Your strtoul() doesn't seem to be working okay.
18342 echo "(I can't seem to compile the test program--assuming it doesn't)"
18348 : see if strtoull exists
18349 set strtoull d_strtoull
18352 case "$d_longlong-$d_strtoull" in
18355 Checking whether your strtoull() works okay...
18357 $cat >try.c <<'EOCP'
18360 #define strtoull __strtoull
18363 extern unsigned long long int strtoull(char *s, char **, int);
18364 static int bad = 0;
18365 int check(char *s, long long eull, int een) {
18368 gull = strtoull(s, 0, 10);
18369 if (!((gull == eull) && (errno == een)))
18373 check(" 1", 1LL, 0);
18374 check(" 0", 0LL, 0);
18375 check("18446744073709551615", 18446744073709551615ULL, 0);
18376 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18377 #if 0 /* strtoull() for /^-/ strings is undefined. */
18378 check("-1", 18446744073709551615ULL, 0);
18379 check("-18446744073709551614", 2LL, 0);
18380 check("-18446744073709551615", 1LL, 0);
18381 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18382 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18389 if eval $compile; then
18390 case "`$run ./try`" in
18391 ok) echo "Your strtoull() seems to be working okay." ;;
18393 Your strtoull() doesn't seem to be working okay.
18395 d_strtoull="$undef"
18399 echo "(I can't seem to compile the test program--assuming it doesn't)"
18400 d_strtoull="$undef"
18405 : see if strtouq exists
18406 set strtouq d_strtouq
18409 case "$d_strtouq" in
18412 Checking whether your strtouq() works okay...
18414 $cat >try.c <<'EOCP'
18417 extern unsigned long long int strtouq(char *s, char **, int);
18418 static int bad = 0;
18419 void check(char *s, unsigned long long eull, int een) {
18420 unsigned long long gull;
18422 gull = strtouq(s, 0, 10);
18423 if (!((gull == eull) && (errno == een)))
18427 check(" 1", 1LL, 0);
18428 check(" 0", 0LL, 0);
18429 check("18446744073709551615", 18446744073709551615ULL, 0);
18430 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18431 #if 0 /* strtouq() for /^-/ strings is undefined. */
18432 check("-1", 18446744073709551615ULL, 0);
18433 check("-18446744073709551614", 2LL, 0);
18434 check("-18446744073709551615", 1LL, 0);
18435 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18436 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18444 if eval $compile; then
18445 case "`$run ./try`" in
18446 ok) echo "Your strtouq() seems to be working okay." ;;
18448 Your strtouq() doesn't seem to be working okay.
18454 echo "(I can't seem to compile the test program--assuming it doesn't)"
18460 : see if strxfrm exists
18461 set strxfrm d_strxfrm
18464 : see if symlink exists
18465 set symlink d_symlink
18468 : see if syscall exists
18469 set syscall d_syscall
18472 : see if prototype for syscall is available
18474 set d_syscallproto syscall $i_unistd unistd.h
18477 : see if sysconf exists
18478 set sysconf d_sysconf
18481 : see if system exists
18482 set system d_system
18485 : see if tcgetpgrp exists
18486 set tcgetpgrp d_tcgetpgrp
18489 : see if tcsetpgrp exists
18490 set tcsetpgrp d_tcsetpgrp
18493 : see if prototype for telldir is available
18495 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
18498 : see if time exists
18500 if test "X$d_time" = X -o X"$timetype" = X; then
18501 if set time val -f d_time; eval $csym; $val; then
18502 echo 'time() found.' >&4
18504 rp="What is the type returned by time() on this system?"
18505 set time_t timetype long stdio.h sys/types.h
18508 echo 'time() not found, hope that will do.' >&4
18516 : see if timegm exists
18517 set timegm d_timegm
18520 : see if this is a sys/times.h system
18521 set sys/times.h i_systimes
18524 : see if times exists
18526 if set times val -f d_times; eval $csym; $val; then
18527 echo 'times() found.' >&4
18530 case "$i_systimes" in
18531 "$define") inc='sys/times.h';;
18533 rp="What is the type returned by times() on this system?"
18534 set clock_t clocktype long stdio.h sys/types.h $inc
18537 echo 'times() NOT found, hope that will do.' >&4
18542 : see if tmpnam_r exists
18543 set tmpnam_r d_tmpnam_r
18545 case "$d_tmpnam_r" in
18547 hdrs="$i_systypes sys/types.h define stdio.h "
18548 case "$d_tmpnam_r_proto:$usethreads" in
18549 ":define") d_tmpnam_r_proto=define
18550 set d_tmpnam_r_proto tmpnam_r $hdrs
18554 case "$d_tmpnam_r_proto" in
18556 case "$tmpnam_r_proto" in
18557 ''|0) try='char* tmpnam_r(char*);'
18558 ./protochk "$extern_C $try" $hdrs && tmpnam_r_proto=B_B ;;
18560 case "$tmpnam_r_proto" in
18561 ''|0) d_tmpnam_r=undef
18563 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
18564 * ) case "$tmpnam_r_proto" in
18565 REENTRANT_PROTO*) ;;
18566 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
18568 echo "Prototype: $try" ;;
18571 *) case "$usethreads" in
18572 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
18579 *) tmpnam_r_proto=0
18583 : see if truncate exists
18584 set truncate d_truncate
18587 : see if ttyname_r exists
18588 set ttyname_r d_ttyname_r
18590 case "$d_ttyname_r" in
18592 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
18593 case "$d_ttyname_r_proto:$usethreads" in
18594 ":define") d_ttyname_r_proto=define
18595 set d_ttyname_r_proto ttyname_r $hdrs
18599 case "$d_ttyname_r_proto" in
18601 case "$ttyname_r_proto" in
18602 ''|0) try='int ttyname_r(int, char*, size_t);'
18603 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBW ;;
18605 case "$ttyname_r_proto" in
18606 ''|0) try='int ttyname_r(int, char*, int);'
18607 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBI ;;
18609 case "$ttyname_r_proto" in
18610 ''|0) try='char* ttyname_r(int, char*, int);'
18611 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=B_IBI ;;
18613 case "$ttyname_r_proto" in
18614 ''|0) d_ttyname_r=undef
18616 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
18617 * ) case "$ttyname_r_proto" in
18618 REENTRANT_PROTO*) ;;
18619 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
18621 echo "Prototype: $try" ;;
18624 *) case "$usethreads" in
18625 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
18632 *) ttyname_r_proto=0
18636 : see if tzname[] exists
18638 if set tzname val -a d_tzname; eval $csym; $val; then
18640 echo 'tzname[] found.' >&4
18643 echo 'tzname[] NOT found.' >&4
18648 : Check if is a multiplatform env
18650 next|darwin) multiarch="$define" ;;
18652 case "$multiarch" in
18653 ''|[nN]*) multiarch="$undef" ;;
18656 : check for ordering of bytes in a UV
18658 case "$usecrosscompile$multiarch" in
18661 You seem to be either cross-compiling or doing a multiarchitecture build,
18662 skipping the byteorder check.
18668 case "$byteorder" in
18671 In the following, larger digits indicate more significance. A big-endian
18672 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
18673 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
18674 machines may have weird orders like 3412. A Cray will report 87654321,
18675 an Alpha will report 12345678. If the test program works the default is
18677 I'm now running the test program...
18681 #$i_stdlib I_STDLIB
18683 #include <stdlib.h>
18685 #include <sys/types.h>
18686 typedef $uvtype UV;
18696 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
18698 u.l = (UV)0x04030201;
18699 for (i = 0; i < $uvsize; i++)
18700 printf("%c", u.c[i]+'0');
18707 if eval $compile && $run ./try > /dev/null; then
18710 [1-4][1-4][1-4][1-4]|12345678|87654321)
18711 echo "(The test program ran ok.)"
18712 echo "byteorder=$dflt"
18715 ????|????????) echo "(The test program ran ok.)" ;;
18716 *) echo "(The test program didn't run right for some reason.)" ;;
18721 (I can't seem to compile the test program. Guessing big-endian...)
18724 case "$xxx_prompt" in
18726 rp="What is the order of bytes in $uvtype?"
18739 : Checking 32bit alignedness
18742 Checking to see whether you can access character data unalignedly...
18744 case "$d_u32align" in
18745 '') $cat >try.c <<EOCP
18747 #$i_stdlib I_STDLIB
18749 #include <stdlib.h>
18751 #define U32 $u32type
18752 #define BYTEORDER 0x$byteorder
18754 #include <signal.h>
18756 $signal_t bletch(int s) { exit(4); }
18759 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
18760 volatile U8 buf[8];
18764 if (sizeof(U32) != 4) {
18765 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
18772 signal(SIGBUS, bletch);
18784 for (i = 0; i < 4; i++) {
18785 up = (U32*)(buf + i);
18786 if (! ((*up == 1 << (8*i)) || /* big-endian */
18787 (*up == 1 << (8*(3-i))) /* little-endian */
18791 printf("read failed (%x)\n", *up);
18797 for (i = 0; i < 4; i++) {
18798 up = (U32*)(buf + i);
18800 if (*up != 0xBeef) {
18801 printf("write failed (%x)\n", *up);
18815 if eval $compile_ok; then
18816 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
18817 $run ./try 2>&1 >/dev/null
18820 You can access character data pretty unalignedly.
18822 d_u32align="$undef"
18825 It seems that you must access character data in an aligned manner.
18827 d_u32align="$define"
18831 rp='Can you access character data at unaligned addresses?'
18835 [yY]*) d_u32align="$undef" ;;
18836 *) d_u32align="$define" ;;
18843 : see if ualarm exists
18844 set ualarm d_ualarm
18847 : see if umask exists
18851 : see if unordered exists
18852 set unordered d_unordered
18855 : see if unsetenv exists
18856 set unsetenv d_unsetenv
18859 : see if usleep exists
18860 set usleep d_usleep
18863 : see if prototype for usleep is available
18865 set d_usleepproto usleep $i_unistd unistd.h
18868 : see if ustat exists
18872 : see if closedir exists
18873 set closedir d_closedir
18876 case "$d_closedir" in
18879 echo "Checking whether closedir() returns a status..." >&4
18881 #$i_dirent I_DIRENT /**/
18882 #$i_sysdir I_SYS_DIR /**/
18883 #$i_sysndir I_SYS_NDIR /**/
18884 #$i_systypes I_SYS_TYPES /**/
18886 #if defined(I_SYS_TYPES)
18887 #include <sys/types.h>
18889 #if defined(I_DIRENT)
18890 #include <dirent.h>
18891 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
18892 #include <sys/dir.h>
18896 #include <sys/ndir.h>
18900 #include <ndir.h> /* may be wrong in the future */
18902 #include <sys/dir.h>
18907 int main() { return closedir(opendir(".")); }
18910 if eval $compile_ok; then
18911 if $run ./try > /dev/null 2>&1 ; then
18912 echo "Yes, it does."
18915 echo "No, it doesn't."
18919 echo "(I can't seem to compile the test program--assuming it doesn't)"
18927 set d_void_closedir
18931 : see if there is a wait4
18935 : see if waitpid exists
18936 set waitpid d_waitpid
18939 : see if wcstombs exists
18940 set wcstombs d_wcstombs
18943 : see if wctomb exists
18944 set wctomb d_wctomb
18947 : see if writev exists
18948 set writev d_writev
18951 : preserve RCS keywords in files with variable substitution, grrr
18956 Revision='$Revision'
18958 : check for alignment requirements
18960 case "$usecrosscompile" in
18963 You seem to be cross-compiling. Skipping the memory alignment check.
18966 case "$alignbytes" in
18967 '') alignbytes=8 ;;
18971 case "$alignbytes" in
18972 '') echo "Checking alignment constraints..." >&4
18973 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
18974 $cat >try.c <<'EOCP'
18975 typedef long double NV;
18978 $cat >try.c <<'EOCP'
18982 $cat >>try.c <<'EOCP'
18990 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
18995 if eval $compile_ok; then
18999 echo "(I can't seem to compile the test program...)"
19001 case "$multiarch" in
19003 : The usual safe value is 8, but Darwin with -Duselongdouble
19004 : needs 16. Hence, we will take 8 as a minimum, but allow
19005 : Configure to pick a larger value if needed.
19006 if $test "$dflt" -lt 8; then
19008 echo "Setting alignment to 8 for multiarch support.">&4
19013 *) dflt="$alignbytes"
19016 rp="Doubles must be aligned on a how-many-byte boundary?"
19024 : set the base revision
19027 : Determine if this is an EBCDIC system
19029 echo "Determining whether or not we are on an EBCDIC system..." >&4
19030 $cat >try.c <<'EOM'
19033 if ('M'==0xd4) return 0;
19038 case "$BOOTSTRAP_CHARSET" in
19039 Y|y|define) bootstrap_charset=$define ;;
19040 *) bootstrap_charset=$undef ;;
19045 if eval $compile_ok; then
19046 if $run ./try; then
19047 echo "You seem to speak EBCDIC." >&4
19050 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
19053 echo "I'm unable to compile the test program." >&4
19054 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
19060 : length of character in bytes. Is always 1, otherwise it is not C
19061 : This used to be a test using sizeof
19064 : Check for the number of bits in a character
19065 case "$charbits" in
19066 '') echo "Checking how long a character is (in bits)..." >&4
19073 for (c = 1, n = 0; c; c <<= 1, n++) ;
19074 printf ("%d\n", n);
19079 if eval $compile_ok; then
19083 echo "(I can't seem to compile the test program. Guessing...)"
19090 rp="What is the length of a character (in bits)?"
19094 case "$charbits" in
19097 Your system has an unsigned character size of $charbits bits, which
19098 is rather unusual (normally it is 8 bits). Perl likely will not work
19099 correctly on your system, with subtle bugs in various places.
19101 rp='Do you really want to continue?'
19105 [yY]) echo >&4 "Okay, continuing." ;;
19110 : how do we concatenate cpp tokens here?
19112 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
19113 $cat >cpp_stuff.c <<'EOCP'
19114 #define RCAT(a,b)a/**/b
19115 #define ACAT(a,b)a ## b
19119 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
19120 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
19121 echo "Oh! Smells like ANSI's been here." >&4
19122 echo "We can catify or stringify, separately or together!"
19124 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
19125 echo "Ah, yes! The good old days!" >&4
19126 echo "However, in the good old days we don't know how to stringify and"
19127 echo "catify at the same time."
19131 Hmm, I don't seem to be able to concatenate tokens with your cpp.
19132 You're going to have to edit the values of CAT[2-5] in config.h...
19134 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
19138 : see if this is a db.h system
19144 : Check db version.
19146 echo "Checking Berkeley DB version ..." >&4
19152 #include <sys/types.h>
19154 #$i_stdlib I_STDLIB
19156 #include <stdlib.h>
19159 int main(int argc, char *argv[])
19161 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
19162 int Major, Minor, Patch ;
19163 unsigned long Version ;
19164 (void)db_version(&Major, &Minor, &Patch) ;
19166 printf("%d %d %d %d %d %d\n",
19167 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
19168 Major, Minor, Patch);
19171 printf("You have Berkeley DB Version 2 or greater.\n");
19173 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
19174 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
19175 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
19176 Major, Minor, Patch) ;
19178 /* check that db.h & libdb are compatible */
19179 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
19180 printf("db.h and libdb are incompatible.\n") ;
19184 printf("db.h and libdb are compatible.\n") ;
19186 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
19187 + DB_VERSION_PATCH ;
19189 /* needs to be >= 2.3.4 */
19190 if (Version < 2003004) {
19191 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
19192 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
19198 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
19203 printf("You have Berkeley DB Version 1.\n");
19204 exit(0); /* DB version < 2: the coast is clear. */
19206 exit(1); /* <db.h> not Berkeley DB? */
19212 if eval $compile_ok && $run ./try; then
19213 echo 'Looks OK.' >&4
19215 db_version_major=$1
19216 db_version_minor=$2
19217 db_version_patch=$3
19219 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
19223 : Remove db from list of libraries to use
19224 echo "Removing unusable -ldb from library list" >&4
19225 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
19228 echo "libs = $libs" >&4
19238 : Check the return type needed for hash
19240 echo "Checking return type needed for hash for Berkeley DB ..." >&4
19246 #include <sys/types.h>
19249 #ifndef DB_VERSION_MAJOR
19250 u_int32_t hash_cb (ptr, size)
19258 info.hash = hash_cb;
19262 if $cc $ccflags -c try.c >try.out 2>&1 ; then
19263 if $contains warning try.out >>/dev/null 2>&1 ; then
19266 db_hashtype='u_int32_t'
19269 : XXX Maybe we should just give up here.
19270 db_hashtype=u_int32_t
19272 echo "Help: I can't seem to compile the db test program." >&4
19273 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
19276 echo "Your version of Berkeley DB uses $db_hashtype for hash."
19278 *) db_hashtype=u_int32_t
19283 : Check the return type needed for prefix
19285 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
19291 #include <sys/types.h>
19294 #ifndef DB_VERSION_MAJOR
19295 size_t prefix_cb (key1, key2)
19303 info.prefix = prefix_cb;
19307 if $cc $ccflags -c try.c >try.out 2>&1 ; then
19308 if $contains warning try.out >>/dev/null 2>&1 ; then
19309 db_prefixtype='int'
19311 db_prefixtype='size_t'
19314 db_prefixtype='size_t'
19315 : XXX Maybe we should just give up here.
19317 echo "Help: I can't seem to compile the db test program." >&4
19318 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
19321 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
19323 *) db_prefixtype='size_t'
19327 : How can we generate normalized random numbers ?
19329 echo "Using our internal random number implementation..." >&4
19332 *-Dmy_rand=*|*-Dmy_srand=*)
19333 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
19334 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
19335 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
19336 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
19340 randfunc=Perl_drand48
19341 drand01="Perl_drand48()"
19342 seedfunc="Perl_drand48_init"
19346 : Check how to flush
19349 Checking how to flush all pending stdio output...
19351 # I only know how to find the first 32 possibly open files on SunOS.
19352 # See also hints/sunos_4_1.sh and util.c --AD
19354 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
19356 $cat >>try.c <<EOCP
19358 #$i_stdlib I_STDLIB
19360 #include <stdlib.h>
19362 #$i_unistd I_UNISTD
19364 # include <unistd.h>
19366 #$d_sysconf HAS_SYSCONF
19367 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
19368 #ifdef HAS_STDIO_STREAM_ARRAY
19369 # define STDIO_STREAM_ARRAY $stdio_stream_array
19374 p = fopen("try.out", "w");
19378 # ifdef TRY_FPRINTF
19382 #ifdef TRY_FFLUSH_NULL
19385 #ifdef TRY_FFLUSH_ALL
19387 long open_max = -1;
19388 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
19389 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
19391 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
19392 open_max = sysconf(_SC_OPEN_MAX);
19395 open_max = FOPEN_MAX;
19398 open_max = OPEN_MAX;
19407 # ifdef HAS_STDIO_STREAM_ARRAY
19408 if (open_max > 0) {
19410 for (i = 0; i < open_max; i++)
19411 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
19412 STDIO_STREAM_ARRAY[i]._file < open_max &&
19413 STDIO_STREAM_ARRAY[i]._flag)
19414 fflush(&STDIO_STREAM_ARRAY[i]);
19422 : first we have to find out how _not_ to flush
19424 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
19426 set try -DTRY_FPUTC
19427 if eval $compile; then
19428 $run ./try 2>/dev/null
19431 if $test ! -s try.out -a "X$code" = X42; then
19437 set try -DTRY_FPRINTF
19438 if eval $compile; then
19439 $run ./try 2>/dev/null
19442 if $test ! -s try.out -a "X$code" = X42; then
19443 output=-DTRY_FPRINTF
19449 : check for fflush NULL behavior
19450 case "$fflushNULL" in
19451 '') set try -DTRY_FFLUSH_NULL $output
19452 if eval $compile; then
19453 $run ./try 2>/dev/null
19456 if $test -s try.out -a "X$code" = X42; then
19457 fflushNULL="`$cat try.out`"
19459 if $test "X$code" != X42; then
19461 (If this test failed, don't worry, we'll try another method shortly.)
19466 $rm -f core try.core core.try.*
19467 case "$fflushNULL" in
19469 Your fflush(NULL) works okay for output streams.
19470 Let's see if it clobbers input pipes...
19472 # As of mid-March 2000 all versions of Solaris appear to have a stdio
19473 # bug that improperly flushes the input end of pipes. So we avoid the
19474 # autoflush on fork/system/exec support for now. :-(
19475 $cat >tryp.c <<EOCP
19478 main(int argc, char **argv)
19484 while ((i = getc(stdin)) != -1
19485 && (*bp++ = i) != '\n'
19486 && bp < &buf[1024])
19489 fprintf(stdout, "%s", buf);
19497 fflushNULL="$define"
19499 if eval $compile; then
19501 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19502 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19504 fflush(NULL) seems to behave okay with input streams.
19506 fflushNULL="$define"
19509 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
19511 fflushNULL="$undef"
19514 $rm -f core tryp.c tryp.core core.tryp.*
19517 Your fflush(NULL) isn't working (contrary to ANSI C).
19519 fflushNULL="$undef"
19522 Cannot figure out whether your fflush(NULL) works or not.
19523 I'm assuming it doesn't (contrary to ANSI C).
19525 fflushNULL="$undef"
19529 $define|true|[yY]*)
19530 fflushNULL="$define"
19533 fflushNULL="$undef"
19536 : check explicit looping only if NULL did not work, and if the pipe
19537 : bug does not show up on an explicit flush too
19538 case "$fflushNULL" in
19540 $cat >tryp.c <<EOCP
19543 main(int argc, char **argv)
19549 while ((i = getc(stdin)) != -1
19550 && (*bp++ = i) != '\n'
19551 && bp < &buf[1024])
19554 fprintf(stdout, "%s", buf);
19563 if eval $compile; then
19565 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19566 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19568 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
19570 : now check for fflushall behaviour
19571 case "$fflushall" in
19572 '') set try -DTRY_FFLUSH_ALL $output
19573 if eval $compile; then
19575 (Now testing the other method--but note that this also may fail.)
19577 $run ./try 2>/dev/null
19580 if $test -s try.out -a "X$code" = X42; then
19581 fflushall="`$cat try.out`"
19585 case "$fflushall" in
19587 Whew. Flushing explicitly all the stdio streams works.
19589 fflushall="$define"
19592 Sigh. Flushing explicitly all the stdio streams doesn't work.
19597 Cannot figure out whether flushing stdio streams explicitly works or not.
19598 I'm assuming it doesn't.
19604 "$define"|true|[yY]*)
19605 fflushall="$define"
19613 All is futile. Even fflush(stdin) clobbers input pipes!
19620 $rm -f core tryp.c tryp.core core.tryp.*
19622 *) fflushall="$undef"
19626 case "$fflushNULL$fflushall" in
19629 OK, I give up. I cannot figure out how to flush pending stdio output.
19630 We won't be flushing handles at all before fork/exec/popen.
19636 : Store the full pathname to the ar program for use in the C program
19637 : Respect a hint or command line value for full_ar.
19642 : Store the full pathname to the sed program for use in the C program
19645 : see what type gids are declared as in the kernel
19647 echo "Looking for the type for group ids returned by getgid()."
19648 set gid_t gidtype xxx stdio.h sys/types.h
19652 xxx=`./findhdr sys/user.h`
19653 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
19655 unsigned) dflt="$1 $2" ;;
19659 *) dflt="$gidtype";;
19662 gid_t) echo "gid_t found." ;;
19663 *) rp="What is the type for group ids returned by getgid()?"
19669 : Check the size of GID
19672 *_t) zzz="$gidtype" ;;
19675 echo "Checking the size of $zzz..." >&4
19677 #include <sys/types.h>
19679 #$i_stdlib I_STDLIB
19681 #include <stdlib.h>
19684 printf("%d\n", (int)sizeof($gidtype));
19689 if eval $compile_ok; then
19693 echo "(I can't execute the test program--guessing $gidsize.)" >&4
19696 echo "Your $zzz is $gidsize bytes long."
19701 echo "(I can't compile the test program--guessing $gidsize.)" >&4
19705 : Check if GID is signed
19708 *_t) zzz="$gidtype" ;;
19711 echo "Checking the sign of $zzz..." >&4
19713 #include <sys/types.h>
19724 if eval $compile; then
19728 echo "(I can't execute the test program--guessing unsigned.)" >&4
19732 1) echo "Your $zzz is unsigned." ;;
19733 -1) echo "Your $zzz is signed." ;;
19739 echo "(I can't compile the test program--guessing unsigned.)" >&4
19743 : Check 64bit sizes
19746 if $test X"$quadtype" != X; then
19748 echo "Checking how to print 64-bit integers..." >&4
19750 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
19751 $cat >try.c <<'EOCP'
19752 #include <sys/types.h>
19755 int q = 12345678901;
19756 printf("%ld\n", q);
19760 if eval $compile; then
19764 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
19765 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
19766 echo "We will use %d."
19772 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
19773 $cat >try.c <<'EOCP'
19774 #include <sys/types.h>
19777 long q = 12345678901;
19778 printf("%ld\n", q);
19782 if eval $compile; then
19786 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
19787 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
19788 echo "We will use %ld."
19794 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
19795 $cat >try.c <<'EOCP'
19796 #include <sys/types.h>
19797 #include <inttypes.h>
19800 int64_t q = 12345678901;
19801 printf("%" PRId64 "\n", q);
19805 if eval $compile; then
19809 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
19810 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
19811 echo "We will use the C9X style."
19817 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19819 #include <sys/types.h>
19822 $quadtype q = 12345678901;
19823 printf("%Ld\n", q);
19827 if eval $compile; then
19831 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
19832 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
19833 echo "We will use %Ld."
19839 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
19840 $cat >try.c <<'EOCP'
19841 #include <sys/types.h>
19844 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
19845 printf("%lld\n", q);
19849 if eval $compile; then
19853 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
19854 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
19855 echo "We will use the %lld style."
19861 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19863 #include <sys/types.h>
19866 $quadtype q = 12345678901;
19867 printf("%qd\n", q);
19871 if eval $compile; then
19875 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
19876 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
19877 echo "We will use %qd."
19883 if $test X"$sPRId64" = X; then
19884 echo "Cannot figure out how to print 64-bit integers." >&4
19891 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
19892 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
19894 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
19895 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
19899 : Check format strings for internal types
19901 $echo "Checking the format strings to be used for Perl's internal types..." >&4
19903 if $test X"$ivsize" = X8; then
19904 ivdformat="$sPRId64"
19905 uvuformat="$sPRIu64"
19906 uvoformat="$sPRIo64"
19907 uvxformat="$sPRIx64"
19908 uvXUformat="$sPRIXU64"
19910 if $test X"$ivsize" = X"$longsize"; then
19917 if $test X"$ivsize" = X"$intsize"; then
19925 if $test X"$ivsize" = X"$shortsize"; then
19936 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
19937 nveformat="$sPRIeldbl"
19938 nvfformat="$sPRIfldbl"
19939 nvgformat="$sPRIgldbl"
19940 nvEUformat="$sPRIEUldbl"
19941 nvFUformat="$sPRIFUldbl"
19942 nvGUformat="$sPRIGUldbl"
19952 case "$ivdformat" in
19953 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
19958 : Check format string for GID
19961 $echo "Checking the format string to be used for gids..." >&4
19964 -1) if $test X"$gidsize" = X"$ivsize"; then
19965 gidformat="$ivdformat"
19967 if $test X"$gidsize" = X"$longsize"; then
19970 if $test X"$gidsize" = X"$intsize"; then
19973 if $test X"$gidsize" = X"$shortsize"; then
19980 *) if $test X"$gidsize" = X"$uvsize"; then
19981 gidformat="$uvuformat"
19983 if $test X"$gidsize" = X"$longsize"; then
19986 if $test X"$gidsize" = X"$intsize"; then
19989 if $test X"$gidsize" = X"$shortsize"; then
19998 : see if getgroups exists
19999 set getgroups d_getgrps
20002 : see if setgroups exists
20003 set setgroups d_setgrps
20006 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
20008 case "$d_getgrps$d_setgrps" in
20010 case "$groupstype" in
20011 '') dflt="$gidtype" ;;
20012 *) dflt="$groupstype" ;;
20015 What type of pointer is the second argument to getgroups() and setgroups()?
20016 Usually this is the same as group ids, $gidtype, but not always.
20019 rp='What type pointer is the second argument to getgroups() and setgroups()?'
20023 *) groupstype="$gidtype";;
20026 : MAD = Misc Attribute Definition
20028 if $test $patchlevel -lt 9; then
20029 : MAD is not available in 5.8.x or earlier.
20033 $define|true|[yY]*) dflt='y' ;;
20038 Would you like to build with Misc Attribute Decoration? This is development
20039 work leading to a Perl 5 to Perl 6 convertor, which imposes a space and speed
20040 overhead on the interpreter.
20042 If this doesn't make any sense to you, just accept the default '$dflt'.
20044 rp='Build Perl with MAD?'
20049 madlyh='madly.h madly.act madly.tab'
20051 madlyobj="madly$_o" ;;
20060 : check whether make sets MAKE
20062 echo "Checking if your $make program sets \$(MAKE)..." >&4
20063 case "$make_set_make" in
20065 $sed 's/^X //' > testmake.mak << 'EOF'
20067 X @echo 'maketemp="$(MAKE)"'
20069 case "`$make -f testmake.mak 2>/dev/null`" in
20070 *maketemp=*) make_set_make='#' ;;
20071 *) make_set_make="MAKE=$make" ;;
20073 $rm -f testmake.mak
20076 case "$make_set_make" in
20077 '#') echo "Yup, it does.";;
20078 *) echo "Nope, it doesn't.";;
20081 : see what type is used for mode_t
20082 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
20083 set mode_t modetype int stdio.h sys/types.h
20086 : see if we need va_copy
20088 case "$i_stdarg" in
20091 #include <stdarg.h>
20093 #$i_stdlib I_STDLIB
20095 #include <stdlib.h>
20097 #include <signal.h>
20100 ivfprintf(FILE *f, const char *fmt, va_list *valp)
20102 return vfprintf(f, fmt, *valp);
20106 myvfprintf(FILE *f, const char *fmt, va_list val)
20108 return ivfprintf(f, fmt, &val);
20112 myprintf(char *fmt, ...)
20115 va_start(val, fmt);
20116 return myvfprintf(stdout, fmt, val);
20120 main(int ac, char **av)
20122 signal(SIGSEGV, exit);
20124 myprintf("%s%cs all right, then\n", "that", '\'');
20129 if eval $compile && $run ./try 2>&1 >/dev/null; then
20130 case "`$run ./try`" in
20131 "that's all right, then")
20137 yes) echo "It seems that you don't need va_copy()." >&4
20138 need_va_copy="$undef"
20140 *) echo "It seems that va_copy() or similar will be needed." >&4
20141 need_va_copy="$define"
20146 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
20147 need_va_copy="$undef"
20151 : see what type is used for size_t
20152 rp="What is the type used for the length parameter for string functions?"
20153 set size_t sizetype 'unsigned int' stdio.h sys/types.h
20156 : check for type of arguments to gethostbyaddr.
20157 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
20158 case "$d_gethbyaddr" in
20162 Checking to see what type of arguments are accepted by gethostbyaddr().
20164 hdrs="$define sys/types.h
20165 $d_socket sys/socket.h
20166 $i_niin netinet/in.h
20168 $i_unistd unistd.h"
20169 : The first arg can 'char *' or 'void *'
20170 : The second arg is some of integral type
20171 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
20172 for yyy in size_t long int; do
20173 case "$netdb_host_type" in
20174 '') try="$extern_C struct hostent *gethostbyaddr($xxx, $yyy, int);"
20175 if ./protochk "$try" $hdrs; then
20176 echo "Your system accepts $xxx for the first arg."
20177 echo "...and $yyy for the second arg."
20178 netdb_host_type="$xxx"
20179 netdb_hlen_type="$yyy"
20185 : In case none of those worked, prompt the user.
20186 case "$netdb_host_type" in
20187 '') rp='What is the type for the 1st argument to gethostbyaddr?'
20190 netdb_host_type=$ans
20191 rp='What is the type for the 2nd argument to gethostbyaddr?'
20194 netdb_hlen_type=$ans
20198 *) : no gethostbyaddr, so pick harmless defaults
20199 netdb_host_type='char *'
20200 netdb_hlen_type="$sizetype"
20203 # Remove the "const" if needed. -- but then we'll have a
20205 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
20208 : check for type of argument to gethostbyname.
20209 if test "X$netdb_name_type" = X ; then
20210 case "$d_gethbyname" in
20214 Checking to see what type of argument is accepted by gethostbyname().
20216 hdrs="$define sys/types.h
20217 $d_socket sys/socket.h
20218 $i_niin netinet/in.h
20220 $i_unistd unistd.h"
20221 for xxx in "const char *" "char *"; do
20222 case "$netdb_name_type" in
20223 '') try="$extern_C struct hostent *gethostbyname($xxx);"
20224 if ./protochk "$try" $hdrs; then
20225 echo "Your system accepts $xxx."
20226 netdb_name_type="$xxx"
20231 : In case none of those worked, prompt the user.
20232 case "$netdb_name_type" in
20233 '') rp='What is the type for the 1st argument to gethostbyname?'
20236 netdb_name_type=$ans
20240 *) : no gethostbyname, so pick harmless default
20241 netdb_name_type='char *'
20246 : check for type of 1st argument to getnetbyaddr.
20247 if test "X$netdb_net_type" = X ; then
20248 case "$d_getnbyaddr" in
20252 Checking to see what type of 1st argument is accepted by getnetbyaddr().
20254 hdrs="$define sys/types.h
20255 $d_socket sys/socket.h
20256 $i_niin netinet/in.h
20258 $i_unistd unistd.h"
20259 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
20260 case "$netdb_net_type" in
20261 '') try="$extern_C struct netent *getnetbyaddr($xxx, int);"
20262 if ./protochk "$try" $hdrs; then
20263 echo "Your system accepts $xxx."
20264 netdb_net_type="$xxx"
20269 : In case none of those worked, prompt the user.
20270 case "$netdb_net_type" in
20271 '') rp='What is the type for the 1st argument to getnetbyaddr?'
20274 netdb_net_type=$ans
20278 *) : no getnetbyaddr, so pick harmless default
20279 netdb_net_type='long'
20283 : locate the preferred pager for this system
20290 [a-zA-Z]:/*) dflt=$pg;;
20294 [a-zA-Z]:/*) dflt=$more;;
20298 [a-zA-Z]:/*) dflt=$less;;
20301 '') dflt=/usr/ucb/more;;
20309 rp='What pager is used on your system?'
20313 : see what type pids are declared as in the kernel
20314 rp="What is the type of process ids on this system?"
20315 set pid_t pidtype int stdio.h sys/types.h
20318 : see if ar generates random libraries by itself
20320 echo "Checking how to generate random libraries on your machine..." >&4
20321 echo 'int bar1() { return bar2(); }' > bar1.c
20322 echo 'int bar2() { return 2; }' > bar2.c
20324 #$i_stdlib I_STDLIB
20326 #include <stdlib.h>
20328 int main() { printf("%d\n", bar1()); exit(0); }
20330 $cc $ccflags -c bar1.c >/dev/null 2>&1
20331 $cc $ccflags -c bar2.c >/dev/null 2>&1
20332 $cc $ccflags -c foo.c >/dev/null 2>&1
20333 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
20334 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20335 $run ./foobar >/dev/null 2>&1; then
20336 echo "$ar appears to generate random libraries itself."
20338 if [ "X$ranlib" = "X" ]; then
20341 elif $ar s bar$_a >/dev/null 2>&1 &&
20342 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20343 $run ./foobar >/dev/null 2>&1; then
20344 echo "a table of contents needs to be added with '$ar s'."
20347 elif $ar ts bar$_a >/dev/null 2>&1 &&
20348 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20349 $run ./foobar >/dev/null 2>&1; then
20350 echo "a table of contents needs to be added with '$ar ts'."
20357 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
20358 $test -f $ranlib || ranlib=''
20361 if $test -n "$ranlib"; then
20362 echo "your system has '$ranlib'; we'll use that."
20365 echo "your system doesn't seem to support random libraries"
20366 echo "so we'll use lorder and tsort to order the libraries."
20373 : see if this is a values.h system
20374 set values.h i_values
20377 : Check the max offset that gmtime and localtime accept
20378 echo "Checking max offsets that gmtime () accepts"
20381 define) yyy="#include <values.h>" ;;
20385 case "$sGMTIME_min/$sGMTIME_max" in
20388 #include <sys/types.h>
20397 void gm_check (time_t t, int min_year, int max_year)
20400 if ( tmp == NULL ||
20401 /* Check tm_year overflow */
20402 tmp->tm_year < min_year || tmp->tm_year > max_year)
20413 gm_check (MAXLONG, 69, 0x7fffffff);
20415 if (tmp == NULL || tmp->tm_year < 0) {
20416 for (i = 63; i >= 0; i--) {
20417 time_t x = pt | ((time_t)1 << i);
20418 if (x < 0 || x < pt) continue;
20419 gm_check (x, 69, 0x7fffffff);
20422 printf ("sGMTIME_max=%ld\n", pt);
20431 gm_check (MINLONG, -1900, 70);
20434 for (i = 36; i >= 0; i--) {
20435 time_t x = pt - ((time_t)1 << i);
20436 if (x > 0) continue;
20437 gm_check (x, -1900, 70);
20440 printf ("sGMTIME_min=%ld\n", pt);
20444 int main (int argc, char *argv[])
20446 fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t));
20453 if eval $compile; then
20456 echo "Cannot determine sGMTIME_max and sGMTIME_min." >&4
20462 echo "Checking max offsets that localtime () accepts"
20464 case "$sLOCALTIME_min/$sLOCALTIME_max" in
20467 #include <sys/types.h>
20476 void local_check (time_t t, int min_year, int max_year)
20478 if (sizeof (time_t) > 4 && t > 0x7ffffffffffff000LL)
20481 tmp = localtime (&t);
20482 if ( tmp == NULL ||
20483 /* Check tm_year overflow */
20484 tmp->tm_year < min_year || tmp->tm_year > max_year)
20488 } /* local_check */
20495 local_check (MAXLONG, 69, 0x7fffffff);
20497 if (tmp == NULL || tmp->tm_year < 0) {
20498 for (i = 63; i >= 0; i--) {
20499 time_t x = pt | ((time_t)1 << i);
20500 if (x < 0 || x < pt) continue;
20501 local_check (x, 69, 0x7fffffff);
20504 printf ("sLOCALTIME_max=%ld\n", pt);
20513 local_check (MINLONG, -1900, 70);
20516 for (i = 36; i >= 0; i--) {
20517 time_t x = pt - ((time_t)1 << i);
20518 if (x > 0) continue;
20519 local_check (x, -1900, 70);
20522 printf ("sLOCALTIME_min=%ld\n", pt);
20526 int main (int argc, char *argv[])
20534 if eval $compile; then
20537 echo "Cannot determine sLOCALTIME_max and sLOCALTIME_min." >&4
20543 : check for type of arguments to select.
20544 case "$selecttype" in
20545 '') case "$d_select" in
20549 Checking to see what type of arguments are accepted by select().
20551 hdrs="$define sys/types.h
20552 $i_systime sys/time.h
20553 $i_sysselct sys/select.h
20554 $d_socket sys/socket.h"
20555 : The first arg can be int, unsigned, or size_t
20556 : The last arg may or may not be 'const'
20558 : void pointer has been seen but using that
20559 : breaks the selectminbits test
20560 for xxx in 'fd_set *' 'int *'; do
20561 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
20562 for tmo in 'struct timeval *' 'const struct timeval *'; do
20564 '') try="$extern_C select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
20565 if ./protochk "$try" $hdrs; then
20566 echo "Your system accepts $xxx."
20575 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
20576 case "$d_fd_set" in
20577 $define) dflt="fd_set *" ;;
20586 *) : no select, so pick a harmless default
20593 : check for the select 'width'
20594 case "$selectminbits" in
20595 '') safebits=`expr $ptrsize \* 8`
20596 case "$d_select" in
20600 Checking to see on how many bits at a time your select() operates...
20603 #include <sys/types.h>
20605 #$i_systime I_SYS_TIME
20606 #$i_systimek I_SYS_TIME_KERNEL
20611 # ifdef I_SYS_TIME_KERNEL
20614 # include <sys/time.h>
20615 # ifdef I_SYS_TIME_KERNEL
20619 #$i_sysselct I_SYS_SELECT
20620 #ifdef I_SYS_SELECT
20621 #include <sys/select.h>
20623 #$d_socket HAS_SOCKET
20625 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
20628 #$i_stdlib I_STDLIB
20630 #include <stdlib.h>
20633 #define S sizeof(*(b))
20635 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
20636 #define NBITS (NBYTES * 8)
20638 char *s = (char *)malloc(NBYTES);
20647 fp = fopen("try.c", "r");
20653 b = ($selecttype)s;
20654 for (i = 0; i < NBITS; i++)
20658 select(fd + 1, b, 0, 0, &t);
20659 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
20661 printf("%d\n", i + 1);
20666 if eval $compile_ok; then
20667 selectminbits=`$run ./try`
20668 case "$selectminbits" in
20670 Cannot figure out on how many bits at a time your select() operates.
20671 I'll play safe and guess it is $safebits bits.
20673 selectminbits=$safebits
20674 bits="$safebits bits"
20677 *) bits="$selectminbits bits" ;;
20679 echo "Your select() operates on $bits at a time." >&4
20681 rp='What is the minimum number of bits your select() operates on?'
20682 case "$byteorder" in
20683 12345678) dflt=64 ;;
20689 selectminbits="$val"
20693 *) : no select, so pick a harmless default
20694 selectminbits=$safebits
20700 : Trace out the files included by signal.h, then look for SIGxxx names.
20701 if [ "X$fieldn" = X ]; then
20702 : Just make some guesses. We check them later.
20703 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
20705 xxx=`echo '#include <signal.h>' |
20706 $cppstdin $cppminus $cppflags 2>/dev/null |
20707 $grep '^[ ]*#.*include' |
20708 $awk "{print \\$$fieldn}" | $sed 's!"!!g' |\
20709 $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
20712 for xx in $xxx /dev/null ; do
20713 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
20715 case "$xxxfiles" in
20716 '') xxxfiles=`./findhdr signal.h` ;;
20719 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
20720 print substr($2, 4, 20)
20722 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
20723 print substr($3, 4, 20)
20725 : Append some common names just in case the awk scan failed.
20726 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
20727 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
20728 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
20729 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
20730 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
20732 : generate a few handy files for later
20733 $cat > signal.c <<EOCP
20734 #include <sys/types.h>
20735 #include <signal.h>
20736 #$i_stdlib I_STDLIB
20738 #include <stdlib.h>
20743 /* Strange style to avoid deeply-nested #if/#else/#endif */
20746 # define NSIG (_NSIG)
20752 # define NSIG (SIGMAX+1)
20758 # define NSIG (SIG_MAX+1)
20764 # define NSIG (_SIG_MAX+1)
20770 # define NSIG (MAXSIG+1)
20776 # define NSIG (MAX_SIG+1)
20781 # ifdef SIGARRAYSIZE
20782 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
20788 # define NSIG (_sys_nsig) /* Solaris 2.5 */
20792 /* Default to some arbitrary number that's big enough to get most
20793 of the common signals.
20799 printf("NSIG %d\n", NSIG);
20805 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
20807 printf "#ifdef SIG"; printf $1; printf "\n"
20808 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
20809 printf $1; printf ");\n"
20813 printf "#endif /* JUST_NSIG */\n";
20814 printf "exit(0);\n}\n";
20817 $cat >signal.awk <<'EOP'
20818 BEGIN { ndups = 0 }
20819 $1 ~ /^NSIG$/ { nsig = $2 }
20820 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
20821 if ($2 > maxsig) { maxsig = $2 }
20822 if (sig_name[$2]) {
20823 dup_name[ndups] = $1
20824 dup_num[ndups] = $2
20836 printf("NSIG %d\n", nsig);
20837 for (n = 1; n < nsig; n++) {
20839 printf("%s %d\n", sig_name[n], sig_num[n])
20842 printf("NUM%d %d\n", n, n)
20845 for (n = 0; n < ndups; n++) {
20846 printf("%s %d\n", dup_name[n], dup_num[n])
20850 $cat >signal_cmd <<EOS
20852 if $test -s signal.lst; then
20853 echo "Using your existing signal.lst file"
20858 $cat >>signal_cmd <<'EOS'
20861 if eval $compile_ok; then
20862 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) |\
20863 $uniq | $awk -f signal.awk >signal.lst
20865 echo "(I can't seem be able to compile the whole test program)" >&4
20866 echo "(I'll try it in little pieces.)" >&4
20867 set signal -DJUST_NSIG
20868 if eval $compile_ok; then
20869 $run ./signal$_exe > signal.nsg
20872 echo "I can't seem to figure out how many signals you have." >&4
20873 echo "Guessing 50." >&4
20874 echo 'NSIG 50' > signal.nsg
20876 : Now look at all the signal names, one at a time.
20877 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
20878 $cat > signal.c <<EOCP
20879 #include <sys/types.h>
20880 #include <signal.h>
20883 printf("$xx %d\n", SIG${xx});
20888 if eval $compile; then
20889 echo "SIG${xx} found."
20890 $run ./signal$_exe >> signal.ls1
20892 echo "SIG${xx} NOT found."
20895 if $test -s signal.ls1; then
20896 $cat signal.nsg signal.ls1 |
20897 $sort -n | $uniq | $awk -f signal.awk >signal.lst
20901 if $test -s signal.lst; then
20904 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
20905 echo 'kill -l' >signal
20906 set X `csh -f <signal`
20910 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
20912 echo $@ | $tr ' ' $trnl | \
20913 $awk '{ printf "%s %d\n", $1, ++s; }
20914 END { printf "NSIG %d\n", ++s }' >signal.lst
20916 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
20918 chmod a+x signal_cmd
20919 $eunicefix signal_cmd
20921 : generate list of signal names
20923 case "$sig_name_init" in
20925 *) case "$sig_num_init" in
20926 ''|*,*) doinit=yes ;;
20931 echo "Generating a list of signal names and numbers..." >&4
20933 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
20934 sig_name=`$awk 'BEGIN { printf "ZERO " }
20935 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
20936 sig_num=`$awk 'BEGIN { printf "0 " }
20937 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
20938 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
20939 !/^NSIG/ { printf "\"%s\", ", $1 }
20940 END { printf "0\n" }' signal.lst`
20941 sig_num_init=`$awk 'BEGIN { printf "0, " }
20942 !/^NSIG/ { printf "%d, ", $2}
20943 END { printf "0\n"}' signal.lst`
20946 echo "The following $sig_count signals are available:"
20948 echo $sig_name | $awk \
20949 'BEGIN { linelen = 0 }
20951 for (i = 1; i <= NF; i++) {
20952 name = "SIG" $i " "
20953 linelen = linelen + length(name)
20954 if (linelen > 70) {
20956 linelen = length(name)
20962 sig_size=`echo $sig_name | awk '{print NF}'`
20963 $rm -f signal signal.c signal.awk signal.lst signal_cmd
20965 : Check size of size
20967 case "$sizetype" in
20968 *_t) zzz="$sizetype" ;;
20969 *) zzz="filesize" ;;
20971 echo "Checking the size of $zzz..." >&4
20973 #include <sys/types.h>
20975 #$i_stdlib I_STDLIB
20977 #include <stdlib.h>
20980 printf("%d\n", (int)sizeof($sizetype));
20985 if eval $compile_ok; then
20989 echo "(I can't execute the test program--guessing $sizesize.)" >&4
20992 echo "Your $zzz size is $sizesize bytes."
20997 echo "(I can't compile the test program--guessing $sizesize.)" >&4
21001 : check for socklen_t
21003 echo "Checking to see if you have socklen_t..." >&4
21005 #include <sys/types.h>
21006 #$d_socket HAS_SOCKET
21008 #include <sys/socket.h>
21010 int main() { socklen_t x = 16; }
21013 if eval $compile; then
21015 echo "You have socklen_t."
21018 echo "You do not have socklen_t."
21019 case "$sizetype" in
21020 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
21027 : see if this is a socks.h system
21028 set socks.h i_socks
21031 : check for type of the size argument to socket calls
21032 case "$d_socket" in
21036 Checking to see what type is the last argument of accept().
21039 case "$d_socklen_t" in
21040 "$define") yyy="$yyy socklen_t"
21042 yyy="$yyy $sizetype int long unsigned"
21043 for xxx in $yyy; do
21044 case "$socksizetype" in
21045 '') try="$extern_C int accept(int, struct sockaddr *, $xxx *);"
21046 case "$usesocks" in
21048 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
21049 echo "Your system accepts '$xxx *' for the last argument of accept()."
21050 socksizetype="$xxx"
21053 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
21054 echo "Your system accepts '$xxx *' for the last argument of accept()."
21055 socksizetype="$xxx"
21062 : In case none of those worked, prompt the user.
21063 case "$socksizetype" in
21064 '') rp='What is the type for socket address structure sizes?'
21071 *) : no sockets, so pick relatively harmless default
21076 : see what type is used for signed size_t
21077 set ssize_t ssizetype int stdio.h sys/types.h
21082 #$i_stdlib I_STDLIB
21084 #include <stdlib.h>
21086 #include <sys/types.h>
21087 #define Size_t $sizetype
21088 #define SSize_t $dflt
21091 if (sizeof(Size_t) == sizeof(SSize_t))
21093 else if (sizeof(Size_t) == sizeof(int))
21102 if eval $compile_ok && $run ./try > /dev/null; then
21103 ssizetype=`$run ./try`
21104 echo "I'll be using $ssizetype for functions returning a byte count." >&4
21107 Help! I can't compile and run the ssize_t test program: please enlighten me!
21108 (This is probably a misconfiguration in your system or libraries, and
21109 you really ought to fix it. Still, I'll try anyway.)
21111 I need a type that is the same size as $sizetype, but is guaranteed to
21112 be signed. Common values are ssize_t, int and long.
21115 rp="What signed type is the same size as $sizetype?"
21121 : Check the size of st_ino
21123 $echo "Checking the size of st_ino..." >&4
21124 $cat > try.c <<EOCP
21125 #include <sys/stat.h>
21127 #$i_stdlib I_STDLIB
21129 #include <stdlib.h>
21133 printf("%d\n", (int)sizeof(st.st_ino));
21138 if eval $compile_ok; then
21142 $echo "(I can't execute the test program--guessing $st_ino_size.)" >&4
21144 *) st_ino_size=$val
21145 $echo "Your st_ino is $st_ino_size bytes long."
21150 $echo "(I can't compile the test program--guessing $st_ino_size.)" >&4
21154 : Check if st_ino is signed
21156 $echo "Checking the sign of st_ino..." >&4
21157 $cat > try.c <<EOCP
21158 #include <sys/stat.h>
21163 if (foo.st_ino < 0)
21170 if eval $compile; then
21174 $echo "(I can't execute the test program--guessing unsigned.)" >&4
21176 *) st_ino_sign=$val
21177 case "$st_ino_sign" in
21178 1) $echo "Your st_ino is unsigned." ;;
21179 -1) $echo "Your st_ino is signed." ;;
21185 $echo "(I can't compile the test program--guessing unsigned.)" >&4
21189 : see what type of char stdio uses.
21191 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
21192 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
21193 echo "Your stdio uses unsigned chars." >&4
21194 stdchar="unsigned char"
21196 echo "Your stdio uses signed chars." >&4
21201 : see what type uids are declared as in the kernel
21203 echo "Looking for the type for user ids returned by getuid()."
21204 set uid_t uidtype xxx stdio.h sys/types.h
21208 xxx=`./findhdr sys/user.h`
21209 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
21211 unsigned) dflt="$1 $2" ;;
21215 *) dflt="$uidtype";;
21218 uid_t) echo "uid_t found." ;;
21219 *) rp="What is the type for user ids returned by getuid()?"
21225 : Check size of UID
21228 *_t) zzz="$uidtype" ;;
21231 echo "Checking the size of $zzz..." >&4
21233 #include <sys/types.h>
21235 #$i_stdlib I_STDLIB
21237 #include <stdlib.h>
21240 printf("%d\n", (int)sizeof($uidtype));
21245 if eval $compile_ok; then
21249 echo "(I can't execute the test program--guessing $uidsize.)" >&4
21252 echo "Your $zzz is $uidsize bytes long."
21257 echo "(I can't compile the test program--guessing $uidsize.)" >&4
21260 : Check if UID is signed
21263 *_t) zzz="$uidtype" ;;
21266 echo "Checking the sign of $zzz..." >&4
21268 #include <sys/types.h>
21279 if eval $compile; then
21283 echo "(I can't execute the test program--guessing unsigned.)" >&4
21287 1) echo "Your $zzz is unsigned." ;;
21288 -1) echo "Your $zzz is signed." ;;
21294 echo "(I can't compile the test program--guessing unsigned.)" >&4
21298 : Check format string for UID
21300 $echo "Checking the format string to be used for uids..." >&4
21303 -1) if $test X"$uidsize" = X"$ivsize"; then
21304 uidformat="$ivdformat"
21306 if $test X"$uidsize" = X"$longsize"; then
21309 if $test X"$uidsize" = X"$intsize"; then
21312 if $test X"$uidsize" = X"$shortsize"; then
21319 *) if $test X"$uidsize" = X"$uvsize"; then
21320 uidformat="$uvuformat"
21322 if $test X"$uidsize" = X"$longsize"; then
21325 if $test X"$uidsize" = X"$intsize"; then
21328 if $test X"$uidsize" = X"$shortsize"; then
21337 : Determine if we can use sysctl with KERN_PROC_PATHNAME to find executing program
21339 echo "Determining whether we can use sysctl with KERN_PROC_PATHNAME to find executing program..." >&4
21340 $cat >try.c <<'EOM'
21341 /* Intentionally a long probe as I'd like to sanity check that the exact
21342 approach is going to work, as thinking it will work, but only having it
21343 part working at runtime is worse than not having it. */
21345 #include <sys/types.h>
21346 #include <sys/sysctl.h>
21347 #include <sys/param.h>
21349 #include <string.h>
21350 #include <stdlib.h>
21351 #include <unistd.h>
21354 main(int argc, char **argv) {
21356 char *argv_leaf = strrchr(argv[0], '/');
21362 mib[1] = KERN_PROC;
21363 mib[2] = KERN_PROC_PATHNAME;
21367 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
21371 if (sysctl(mib, 4, NULL, &size, NULL, 0)) {
21376 if (size < strlen(argv_leaf) + 1) {
21377 fprintf(stderr, "size %lu is too short for a path\n",
21378 (unsigned long) size);
21382 if (size > MAXPATHLEN * MAXPATHLEN) {
21383 fprintf(stderr, "size %lu is too long for a path\n",
21384 (unsigned long) size);
21388 buffer = malloc(size);
21394 if (sysctl(mib, 4, buffer, &size, NULL, 0)) {
21399 if (strlen(buffer) + 1 != size) {
21400 fprintf(stderr, "size != strlen(buffer) + 1 (%lu != %lu)\n",
21401 (unsigned long)size, (unsigned long)strlen(buffer) + 1);
21406 if (*buffer != '/') {
21407 fprintf(stderr, "Not an absolute path: '%s'\n", buffer);
21411 if (strstr(buffer, "/./")) {
21412 fprintf(stderr, "Contains /./: '%s'\n", buffer);
21416 if (strstr(buffer, "/../")) {
21417 fprintf(stderr, "Contains /../: '%s'\n", buffer);
21421 buffer_leaf = strrchr(buffer, '/');
21422 if (strcmp(buffer_leaf, argv_leaf) != 0) {
21423 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], buffer);
21435 if eval $compile; then
21436 if $run ./try; then
21437 echo "You can use sysctl with KERN_PROC_PATHNAME to find the executing program." >&4
21440 echo "Nope, sysctl with KERN_PROC_PATHNAME doesn't work here." >&4
21444 echo "I'm unable to compile the test program." >&4
21445 echo "I'll assume no sysctl with KERN_PROC_PATHNAME here." >&4
21449 set usekernprocpathname
21452 : Determine if we can use _NSGetExecutablePath to find executing program
21454 echo "Determining whether we can use _NSGetExecutablePath to find executing program..." >&4
21455 $cat >try.c <<'EOM'
21456 /* Intentionally a long probe as I'd like to sanity check that the exact
21457 approach is going to work, as thinking it will work, but only having it
21458 part working at runtime is worse than not having it. */
21459 #include <mach-o/dyld.h>
21461 #include <stdlib.h>
21462 #include <sys/param.h>
21463 #include <string.h>
21466 main(int argc, char **argv) {
21468 uint32_t size = sizeof(buf);
21472 char *argv_leaf = strrchr(argv[0], '/');
21476 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
21480 _NSGetExecutablePath(buf, &size);
21481 if (size > MAXPATHLEN * MAXPATHLEN) {
21482 fprintf(stderr, "_NSGetExecutablePath size %u is too long for a path\n",
21483 (unsigned int) size);
21487 buffer = malloc(size);
21493 result = _NSGetExecutablePath(buffer, &size);
21495 fprintf(stderr, "_NSGetExecutablePath returned %i for a size of %u\n",
21496 result, (unsigned int) size);
21500 tidied = realpath(buffer, NULL);
21502 perror("realpath");
21508 if (*tidied != '/') {
21509 fprintf(stderr, "Not an absolute path: '%s'\n", tidied);
21513 if (strstr(tidied, "/./")) {
21514 fprintf(stderr, "Contains /./: '%s'\n", tidied);
21518 if (strstr(tidied, "/../")) {
21519 fprintf(stderr, "Contains /../: '%s'\n", tidied);
21523 tidied_leaf = strrchr(tidied, '/');
21524 if (strcmp(tidied_leaf, argv_leaf) != 0) {
21525 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], tidied);
21537 if eval $compile; then
21538 if $run ./try; then
21539 echo "You can use _NSGetExecutablePath to find the executing program." >&4
21542 echo "Nope, _NSGetExecutablePath doesn't work here." >&4
21545 echo "I'm unable to compile the test program." >&4
21546 echo "I'll assume no _NSGetExecutablePath here." >&4
21549 set usensgetexecutablepath
21552 : Check if site customization support was requested
21553 case "$usesitecustomize" in
21554 $define|true|[Yy]*)
21555 usesitecustomize="$define"
21558 usesitecustomize="$undef"
21562 : see if prototypes support variable argument declarations
21564 case "$prototype$i_stdarg" in
21566 echo "It appears we'll be able to prototype varargs functions." >&4
21570 echo "Too bad... We won't be using prototyped varargs functions..." >&4
21577 : determine compiler compiler
21586 if $test -f "$byacc$_exe"; then
21588 comp="byacc or $comp"
21590 if $test -f "$bison$_exe"; then
21591 comp="$comp or bison -y"
21593 rp="Which compiler compiler ($comp) shall I use?"
21602 echo "(Adding -y option to bison to get yacc-compatible behavior.)"
21608 : see if this is a assert.h system
21609 set assert.h i_assert
21612 : see if this is a fp.h system
21616 : see if this is a fp_class.h system
21617 set fp_class.h i_fp_class
21620 : see if gdbm.h is available
21625 : see if gdbm_open exists
21626 set gdbm_open d_gdbm_open
21628 case "$d_gdbm_open" in
21631 echo "We won't be including <gdbm.h>"
21640 : see if this is a ieeefp.h system
21641 case "$i_ieeefp" in
21642 '' ) set ieeefp.h i_ieeefp
21647 : see if this is a libutil.h system
21648 set libutil.h i_libutil
21651 : see if mach cthreads are available
21652 if test "X$usethreads" = "X$define"; then
21653 set mach/cthreads.h i_machcthr
21656 i_machcthr="$undef"
21659 : see if this is a mntent.h system
21660 set mntent.h i_mntent
21663 : see if net/errno.h is available
21665 set net/errno.h val
21668 : Unfortunately, it causes problems on some systems. Arrgh.
21671 cat > try.c <<'EOM'
21674 #include <net/errno.h>
21680 if $cc $ccflags -c try.c >/dev/null 2>&1; then
21681 echo "We'll be including <net/errno.h>." >&4
21683 echo "We won't be including <net/errno.h>." >&4
21692 : see if netinet/tcp.h is available
21693 set netinet/tcp.h i_netinettcp
21696 : see if this is a poll.h system
21700 : see if this is a prot.h system
21704 : Preprocessor symbols
21706 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
21707 $cat <<'EOSH' > Cppsym.know
21708 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
21709 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
21710 alliant alpha am29000 AM29000 AMD64 amd64 amiga AMIGAOS AMIX
21711 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
21712 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
21713 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
21714 bull c cadmus clipper CMU COFF COMPILER_VERSION
21715 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
21716 CYGWIN DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
21717 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
21718 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
21720 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
21721 H3050R H3050RX hbullx20 hcx host_mips
21722 hp200 hp300 hp700 HP700 hp800 hp9000
21723 hp9000s200 hp9000s300 hp9000s400 hp9000s500
21724 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
21725 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
21726 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
21727 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
21728 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
21729 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
21730 LIBCATAMOUNT Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
21731 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
21732 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
21733 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
21734 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
21735 MATH_HAS_NO_SIDE_EFFECTS
21736 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
21737 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
21738 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
21739 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
21740 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
21741 NetBSD news1500 news1700 news1800 news1900 news3700
21742 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
21743 ns32016 ns32332 ns32k nsc32000
21744 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
21745 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
21746 pc532 pdp11 PGC PIC plexus PORTAR posix
21747 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
21748 POSIX_C_SOURCE POSIX_SOURCE POWER
21749 PROTOTYPES PWB pyr QNX QK_USER R3000 REENTRANT RES Rhapsody RISC6000
21750 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
21751 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
21752 sony sony_news sonyrisc sparc sparclite spectrum
21753 stardent stdc STDC_EXT stratos sun sun3 sun386
21754 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
21755 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
21756 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
21757 sysV68 sysV88 Tek4132 Tek4300 titan
21758 TM3200 TM5400 TM5600
21759 tower tower32 tower32_200 tower32_600 tower32_700
21760 tower32_800 tower32_850 tss
21761 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
21762 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
21763 unix UNIX95 UNIX99 unixpc unos
21764 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
21765 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
21766 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
21768 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms x86_64 xenix Xenix286
21769 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
21770 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
21773 # Maybe put other stuff here too.
21774 cat <<EOSH >>Cppsym.know
21777 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
21778 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
21779 $cat Cppsym.know > Cppsym.c
21780 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
21781 $rm -f Cppsym.a Cppsym.b Cppsym.c
21782 cat <<EOSH > Cppsym
21784 if $test \$# -gt 0; then
21785 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
21786 if $test -s Cppsym.got; then
21793 $tr " " "$trnl" | ./Cppsym.try
21799 cat <<EOSH > Cppsym.try
21801 cat <<'EOCP' > try.c
21804 #define STRINGIFY(a) "a"
21806 #if cpp_stuff == 42
21807 #define StGiFy(a) #a
21808 #define STRINGIFY(a) StGiFy(a)
21810 #if $cpp_stuff != 1 && $cpp_stuff != 42
21811 # include "Bletch: How does this C preprocessor stringify macros?"
21817 cat <<'EOSH' >> Cppsym.try
21819 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
21820 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
21821 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
21822 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
21824 echo 'return 0;}' >> try.c
21826 cat <<EOSH >> Cppsym.try
21828 case "$osname-$gccversion" in
21829 irix-) ccflags="\$ccflags -woff 1178" ;;
21830 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
21832 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
21834 chmod +x Cppsym.try
21835 $eunicefix Cppsym.try
21836 ./Cppsym < Cppsym.know | $sort | $uniq > Cppsym.true
21837 : Add in any Linux cpp "predefined macros":
21838 case "$osname::$gccversion" in
21839 *linux*::*.*|*gnukfreebsd*::*.*|gnu::*.*)
21841 rm -f $tHdrH'.h' $tHdrH
21843 # Filter out macro arguments, such as Linux's __INT8_C(c)
21844 if $cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
21845 sed -e 's/#define[\ \ ]*//;s/[\ \ ].*$//' -e 's/(.*//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
21846 if [ -s $tHdrH'_cppsym.real' ]; then
21847 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
21850 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
21853 : now check the C compiler for additional symbols
21854 postprocess_cc_v=''
21856 aix) postprocess_cc_v="|$tr , ' '" ;;
21863 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
21866 -D*) echo "\$i" | $sed 's/^-D//';;
21867 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
21872 postprocess_cc_v=''
21875 ./ccsym > ccsym1.raw
21876 if $test -s ccsym1.raw; then
21877 $sort ccsym1.raw | $uniq >ccsym.raw
21879 mv ccsym1.raw ccsym.raw
21882 $awk '/\=/ { print $0; next }
21883 { print $0"=1" }' ccsym.raw >ccsym.list
21884 $comm -13 Cppsym.true ccsym.list >ccsym.own
21885 $comm -12 Cppsym.true ccsym.list >ccsym.com
21886 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
21888 if $test -z ccsym.raw; then
21889 echo "Your C compiler doesn't seem to define any symbols!" >&4
21891 echo "However, your C preprocessor defines the following symbols:"
21894 cppsymbols=`$cat Cppsym.true`
21895 cppsymbols=`echo $cppsymbols`
21896 cppccsymbols="$cppsymbols"
21898 if $test -s ccsym.com; then
21899 echo "Your C compiler and pre-processor define these symbols:"
21900 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
21903 cppccsymbols=`$cat ccsym.com`
21904 cppccsymbols=`echo $cppccsymbols`
21905 $test "$silent" || sleep 1
21907 if $test -s ccsym.cpp; then
21908 $test "$also" && echo " "
21909 echo "Your C pre-processor ${also}defines the following symbols:"
21910 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
21912 cppsymbols=`$cat ccsym.cpp`
21913 cppsymbols=`echo $cppsymbols`
21914 $test "$silent" || sleep 1
21916 if $test -s ccsym.own; then
21917 $test "$also" && echo " "
21918 echo "Your C compiler ${also}defines the following cpp symbols:"
21919 $sed -e 's/\(..*\)=1/\1/' ccsym.own
21920 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
21921 ccsymbols=`$cat ccsym.own`
21922 ccsymbols=`echo $ccsymbols`
21923 $test "$silent" || sleep 1
21927 : see if this is a termio system
21931 if $test `./findhdr termios.h`; then
21932 set tcsetattr i_termios
21938 "$define") echo "You have POSIX termios.h... good!" >&4;;
21939 *) if ./Cppsym pyr; then
21940 case "`/bin/universe`" in
21941 ucb) if $test `./findhdr sgtty.h`; then
21943 echo "<sgtty.h> found." >&4
21945 echo "System is pyramid with BSD universe."
21946 ./warn "<sgtty.h> not found--you could have problems."
21948 *) if $test `./findhdr termio.h`; then
21950 echo "<termio.h> found." >&4
21952 echo "System is pyramid with USG universe."
21953 ./warn "<termio.h> not found--you could have problems."
21957 if $test `./findhdr termio.h`; then
21958 echo "<termio.h> found." >&4
21960 elif $test `./findhdr sgtty.h`; then
21961 echo "<sgtty.h> found." >&4
21964 ./warn "Neither <termio.h> nor <sgtty.h> found--cross fingers!"
21967 if $test `./findhdr sgtty.h`; then
21968 echo "<sgtty.h> found." >&4
21970 elif $test `./findhdr termio.h`; then
21971 echo "<termio.h> found." >&4
21974 ./warn "Neither <sgtty.h> nor <termio.h> found--cross fingers!"
21978 set i_termio; eval $setvar
21979 val=$val2; set i_sgtty; eval $setvar
21980 val=$val3; set i_termios; eval $setvar
21982 : see if stdbool is available
21983 : we want a real compile instead of Inhdr because some Solaris systems
21984 : have stdbool.h, but it can only be used if the compiler indicates it
21985 : is sufficiently c99-compliant.
21989 #include <stdbool.h>
21994 int main(int argc, char **argv)
22000 if eval $compile; then
22001 echo "<stdbool.h> found." >&4
22004 echo "<stdbool.h> NOT found." >&4
22011 : see if stddef is available
22012 set stddef.h i_stddef
22015 : see if sys/access.h is available
22016 set sys/access.h i_sysaccess
22019 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
22020 set sys/filio.h i_sysfilio
22023 if $test `./findhdr sys/ioctl.h`; then
22025 echo '<sys/ioctl.h> found.' >&4
22028 if $test $i_sysfilio = "$define"; then
22029 echo '<sys/ioctl.h> NOT found.' >&4
22031 $test $i_sgtty = "$define" && xxx="sgtty.h"
22032 $test $i_termio = "$define" && xxx="termio.h"
22033 $test $i_termios = "$define" && xxx="termios.h"
22034 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
22040 : see if socket ioctl defs are in sys/sockio.h
22042 xxx=`./findhdr sys/sockio.h`
22043 if $test "$xxx"; then
22044 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
22046 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
22049 echo "No socket ioctls found in <sys/sockio.h>." >&4
22054 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
22060 : see if this is a syslog.h system
22061 set syslog.h i_syslog
22064 : see if this is a sys/mode.h system
22065 set sys/mode.h i_sysmode
22068 : see if there is a sys/poll.h file
22069 set sys/poll.h i_syspoll
22072 : see if sys/resource.h has to be included
22073 set sys/resource.h i_sysresrc
22076 : see if sys/security.h is available
22077 set sys/security.h i_syssecrt
22080 : see if this is a sys/statvfs.h system
22081 set sys/statvfs.h i_sysstatvfs
22084 : see if this is a sys/un.h system
22085 set sys/un.h i_sysun
22088 : see if this is a sys/utsname.h system
22089 set sys/utsname.h i_sysutsname
22092 : see if this is a syswait system
22093 set sys/wait.h i_syswait
22096 : see if this is a ustat.h system
22097 set ustat.h i_ustat
22100 : see if this is an utime system
22101 set utime.h i_utime
22104 : see if this is a vfork system
22107 set vfork.h i_vfork
22117 echo "Looking for extensions..." >&4
22118 : If we are using the old config.sh, nonxs_extensions and xs_extensions may
22119 : contain old or inaccurate or duplicate values.
22120 nonxs_extensions=''
22122 : We do not use find because it might not be available.
22123 : We do not just use MANIFEST because the user may have dropped
22124 : some additional extensions into the source tree and expect them
22127 : Function to recursively find available extensions, ignoring DynaLoader
22128 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
22129 : In 5.10.1 and later, extensions are stored in directories
22130 : like File-Glob instead of the older File/Glob/.
22134 DynaLoader|dynaload) ;;
22136 this_ext=`echo $xxx | $sed -e s/-/\\\//g`;
22137 case "$this_ext" in
22138 Scalar/List/Utils) this_ext="List/Util" ;;
22139 PathTools) this_ext="Cwd" ;;
22141 echo " $xs_extensions $nonxs_extensions" > $$.tmp;
22142 if $contains " $this_ext " $$.tmp; then
22144 echo "Duplicate directories detected for extension $xxx" >&4;
22145 echo "Configure cannot correctly recover from this - shall I abort?" >&4;
22146 case "$knowitall" in
22154 echo "Ok. Stopping Configure." >&4;
22155 echo "Please remove the duplicate directory (e.g. using git clean) and then re-run Configure" >&4;
22158 echo "Ok. You will need to correct config.sh before running make." >&4;
22160 $ls -1 $xxx > $$.tmp;
22161 if $contains "\.xs$" $$.tmp > /dev/null 2>&1; then
22162 xs_extensions="$xs_extensions $this_ext";
22163 elif $contains "\.c$" $$.tmp > /dev/null 2>&1; then
22164 xs_extensions="$xs_extensions $this_ext";
22165 elif $test -d $xxx; then
22166 nonxs_extensions="$nonxs_extensions $this_ext";
22176 eval $find_extensions
22180 eval $find_extensions
22184 eval $find_extensions
22185 set X $xs_extensions
22187 xs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
22188 set X $nonxs_extensions
22190 nonxs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
22192 known_extensions=`echo $nonxs_extensions $xs_extensions | tr ' ' $trnl | $sort | tr $trnl ' '`
22194 : Now see which are supported on this system.
22196 for xxx in $xs_extensions ; do
22200 $define) avail_ext="$avail_ext $xxx" ;;
22203 GDBM_File|gdbm_fil)
22205 $define) avail_ext="$avail_ext $xxx" ;;
22208 I18N/Langinfo|i18n_lan)
22209 case "$i_langinfo$d_nl_langinfo" in
22210 $define$define) avail_ext="$avail_ext $xxx" ;;
22214 : XXX Do we need a useipcsysv variable here
22215 case "${d_msg}${d_sem}${d_shm}" in
22216 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
22219 NDBM_File|ndbm_fil)
22222 case "$osname-$use64bitint" in
22225 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
22228 *) avail_ext="$avail_ext $xxx" ;;
22233 ODBM_File|odbm_fil)
22234 case "${i_dbm}${i_rpcsvcdbm}" in
22236 case "$d_cplusplus" in
22237 define) ;; # delete as a function name will not work
22238 *) case "$osname-$use64bitint" in
22241 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
22244 *) avail_ext="$avail_ext $xxx" ;;
22252 case "$useopcode" in
22253 true|define|y) avail_ext="$avail_ext $xxx" ;;
22257 case "$useposix" in
22258 true|define|y) avail_ext="$avail_ext $xxx" ;;
22262 case "$d_socket" in
22263 true|$define|y) avail_ext="$avail_ext $xxx" ;;
22266 Sys/Syslog|sys/syslog)
22267 : XXX syslog requires socket
22268 case "$d_socket" in
22269 true|$define|y) avail_ext="$avail_ext $xxx" ;;
22273 case "$usethreads" in
22275 case "$use5005threads" in
22276 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
22280 threads|threads/shared)
22281 # threads and threads::shared are special cases.
22282 # To stop people from asking "Perl 5.8.0 was supposed
22283 # to have this new fancy threads implementation but my
22284 # perl doesn't have it" and from people trying to
22285 # (re)install the threads module using CPAN.pm and
22286 # CPAN.pm then offering to reinstall Perl 5.8.0,
22287 # the threads.pm and threads/shared.pm will always be
22288 # there, croaking informatively ("you need to rebuild
22289 # all of Perl with threads, sorry") when threads haven't
22290 # been compiled in.
22292 avail_ext="$avail_ext $xxx"
22298 cygwin) avail_ext="$avail_ext $xxx" ;;
22301 XS/APItest|xs/apitest)
22302 # This is just for testing. Skip it unless we have dynamic loading.
22305 $define) avail_ext="$avail_ext $xxx" ;;
22308 XS/Typemap|xs/typemap)
22309 # This is just for testing. Skip it unless we have dynamic loading.
22311 $define) avail_ext="$avail_ext $xxx" ;;
22314 *) avail_ext="$avail_ext $xxx"
22323 case "$onlyextensions" in
22325 *) keepextensions=''
22326 echo "You have requested that only certain extensions be included..." >&4
22327 for i in $onlyextensions; do
22328 case " $avail_ext " in
22330 echo "Keeping extension $i."
22331 keepextensions="$keepextensions $i"
22333 *) echo "Ignoring extension $i." ;;
22336 avail_ext="$keepextensions"
22340 case "$noextensions" in
22342 *) keepextensions=''
22343 echo "You have requested that certain extensions be ignored..." >&4
22344 for i in $avail_ext; do
22345 case " $noextensions " in
22346 *" $i "*) echo "Ignoring extension $i." ;;
22347 *) echo "Keeping extension $i.";
22348 keepextensions="$keepextensions $i"
22352 avail_ext="$keepextensions"
22356 : Now see which nonxs extensions are supported on this system.
22357 : For now assume all are.
22359 for xxx in $nonxs_extensions ; do
22363 *) nonxs_ext="$nonxs_ext $xxx"
22375 A number of extensions are supplied with $package. You may choose to
22376 compile these extensions for dynamic loading (the default), compile
22377 them into the $package executable (static loading), or not include
22378 them at all. Answer "none" to include no extensions.
22379 Note that DynaLoader is always built and need not be mentioned here.
22382 case "$dynamic_ext" in
22384 : Exclude those listed in static_ext
22386 for xxx in $avail_ext; do
22387 case " $static_ext " in
22389 *) dflt="$dflt $xxx" ;;
22396 *) dflt="$dynamic_ext"
22397 # Perhaps we are reusing an old out-of-date config.sh.
22400 if test X"$dynamic_ext" != X"$avail_ext"; then
22402 NOTICE: Your previous config.sh list may be incorrect.
22403 The extensions now available to you are
22405 but the default list from your previous config.sh is
22417 rp="What extensions do you wish to load dynamically?"
22420 none) dynamic_ext=' ' ;;
22421 *) dynamic_ext="$ans" ;;
22424 case "$static_ext" in
22426 : Exclude those already listed in dynamic linking
22428 for xxx in $avail_ext; do
22429 case " $dynamic_ext " in
22431 *) dflt="$dflt $xxx" ;;
22438 *) dflt="$static_ext"
22445 rp="What extensions do you wish to load statically?"
22448 none) static_ext=' ' ;;
22449 *) static_ext="$ans" ;;
22454 A number of extensions are supplied with $package. Answer "none"
22455 to include no extensions.
22456 Note that DynaLoader is always built and need not be mentioned here.
22459 case "$static_ext" in
22460 '') dflt="$avail_ext" ;;
22461 *) dflt="$static_ext"
22462 # Perhaps we are reusing an old out-of-date config.sh.
22465 if test X"$static_ext" != X"$avail_ext"; then
22467 NOTICE: Your previous config.sh list may be incorrect.
22468 The extensions now available to you are
22470 but the default list from your previous config.sh is
22479 : Exclude those that are not xs extensions
22483 rp="What extensions do you wish to include?"
22486 none) static_ext=' ' ;;
22487 *) static_ext="$ans" ;;
22492 # Encode is a special case. If we are building Encode as a static
22493 # extension, we need to explicitly list its subextensions as well.
22494 # For other nested extensions, this is handled automatically by
22495 # the appropriate Makefile.PL.
22496 case " $static_ext " in
22497 *" Encode "*) # Add the subextensions of Encode
22499 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
22500 static_ext="$static_ext Encode/$xxx"
22501 known_extensions="$known_extensions Encode/$xxx"
22507 set X $dynamic_ext $static_ext $nonxs_ext
22511 # Sanity check: We require an extension suitable for use with
22512 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
22513 # should show up as failures in the test suite, but it's helpful to
22514 # catch them now.) The 'extensions' list is normally sorted
22515 # alphabetically, so we need to accept either
22516 # DB_File ... Fcntl ... IO ....
22517 # or something like
22518 # Fcntl ... NDBM_File ... IO ....
22519 case " $extensions" in
22520 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
22521 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
22522 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
22523 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
22524 echo "WARNING: The Perl you are building will be quite crippled." >& 4
22528 : Remove libraries needed only for extensions
22529 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
22530 : The exception is SunOS 4.x, which needs them.
22531 case "${osname}X${osvers}" in
22535 *) case "$usedl" in
22536 $define|true|[yY]*)
22537 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
22541 *) perllibs="$libs"
22547 : Remove build directory name from cppstdin so it can be used from
22548 : either the present location or the final installed location.
22550 : Get out of the UU directory to get correct path name.
22552 case "$cppstdin" in
22554 echo "Stripping down cppstdin path name"
22560 : end of configuration questions
22562 echo "End of configuration questions."
22565 : back to where it started
22566 if test -d ../UU; then
22570 : configuration may be unconditionally patched via a 'config.arch' file
22571 if $test -f config.arch; then
22572 echo "I see a config.arch file, loading it." >&4
22576 : configuration may be patched via a 'config.over' file
22577 if $test -f config.over; then
22580 rp='I see a config.over file. Do you wish to load it?'
22583 n*) echo "OK, I'll ignore it.";;
22585 echo "Configuration override changes have been loaded."
22590 : in case they want portability, strip down executable paths
22591 case "$d_portable" in
22594 echo "Stripping down executable paths..." >&4
22595 for file in $loclist $trylist; do
22597 eval $file=`basename $temp`
22602 : create config.sh file
22604 echo "Creating config.sh..." >&4
22605 $spitshell <<EOT >config.sh
22608 # This file was produced by running the Configure script. It holds all the
22609 # definitions figured out by Configure. Should you modify one of these values,
22610 # do not forget to propagate your changes by running "Configure -der". You may
22611 # instead choose to run each of the .SH files by yourself, or "Configure -S".
22614 # Package name : $package
22615 # Source directory : $src
22616 # Configuration time: $cf_time
22617 # Configured by : $cf_by
22618 # Target system : $myuname
22621 : Add in command line options if available
22622 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
22624 $spitshell <<EOT >>config.sh
22633 Revision='$Revision'
22641 alignbytes='$alignbytes'
22642 ansi2knr='$ansi2knr'
22643 aphostname='$aphostname'
22644 api_revision='$api_revision'
22645 api_subversion='$api_subversion'
22646 api_version='$api_version'
22647 api_versionstring='$api_versionstring'
22650 archlibexp='$archlibexp'
22651 archname64='$archname64'
22652 archname='$archname'
22653 archobjs='$archobjs'
22654 asctime_r_proto='$asctime_r_proto'
22662 bootstrap_charset='$bootstrap_charset'
22664 byteorder='$byteorder'
22666 castflags='$castflags'
22669 cccdlflags='$cccdlflags'
22670 ccdlflags='$ccdlflags'
22672 ccflags_uselargefiles='$ccflags_uselargefiles'
22674 ccsymbols='$ccsymbols'
22675 ccversion='$ccversion'
22677 cf_email='$cf_email'
22679 charbits='$charbits'
22680 charsize='$charsize'
22684 clocktype='$clocktype'
22686 compress='$compress'
22687 contains='$contains'
22691 cpp_stuff='$cpp_stuff'
22692 cppccsymbols='$cppccsymbols'
22693 cppflags='$cppflags'
22695 cppminus='$cppminus'
22697 cppstdin='$cppstdin'
22698 cppsymbols='$cppsymbols'
22699 crypt_r_proto='$crypt_r_proto'
22700 cryptlib='$cryptlib'
22702 ctermid_r_proto='$ctermid_r_proto'
22703 ctime_r_proto='$ctime_r_proto'
22704 d_Gconvert='$d_Gconvert'
22705 d_PRIEUldbl='$d_PRIEUldbl'
22706 d_PRIFUldbl='$d_PRIFUldbl'
22707 d_PRIGUldbl='$d_PRIGUldbl'
22708 d_PRIXU64='$d_PRIXU64'
22709 d_PRId64='$d_PRId64'
22710 d_PRIeldbl='$d_PRIeldbl'
22711 d_PRIfldbl='$d_PRIfldbl'
22712 d_PRIgldbl='$d_PRIgldbl'
22713 d_PRIi64='$d_PRIi64'
22714 d_PRIo64='$d_PRIo64'
22715 d_PRIu64='$d_PRIu64'
22716 d_PRIx64='$d_PRIx64'
22717 d_SCNfldbl='$d_SCNfldbl'
22718 d__fwalk='$d__fwalk'
22719 d_access='$d_access'
22720 d_accessx='$d_accessx'
22723 d_archlib='$d_archlib'
22724 d_asctime64='$d_asctime64'
22725 d_asctime_r='$d_asctime_r'
22728 d_attribute_deprecated='$d_attribute_deprecated'
22729 d_attribute_format='$d_attribute_format'
22730 d_attribute_malloc='$d_attribute_malloc'
22731 d_attribute_nonnull='$d_attribute_nonnull'
22732 d_attribute_noreturn='$d_attribute_noreturn'
22733 d_attribute_pure='$d_attribute_pure'
22734 d_attribute_unused='$d_attribute_unused'
22735 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
22739 d_bsdgetpgrp='$d_bsdgetpgrp'
22740 d_bsdsetpgrp='$d_bsdsetpgrp'
22741 d_builtin_choose_expr='$d_builtin_choose_expr'
22742 d_builtin_expect='$d_builtin_expect'
22744 d_c99_variadic_macros='$d_c99_variadic_macros'
22745 d_casti32='$d_casti32'
22746 d_castneg='$d_castneg'
22747 d_charvspr='$d_charvspr'
22749 d_chroot='$d_chroot'
22750 d_chsize='$d_chsize'
22752 d_clearenv='$d_clearenv'
22753 d_closedir='$d_closedir'
22754 d_cmsghdr_s='$d_cmsghdr_s'
22756 d_copysignl='$d_copysignl'
22757 d_cplusplus='$d_cplusplus'
22759 d_crypt_r='$d_crypt_r'
22761 d_ctermid='$d_ctermid'
22762 d_ctermid_r='$d_ctermid_r'
22763 d_ctime64='$d_ctime64'
22764 d_ctime_r='$d_ctime_r'
22765 d_cuserid='$d_cuserid'
22766 d_dbl_dig='$d_dbl_dig'
22767 d_dbminitproto='$d_dbminitproto'
22768 d_difftime64='$d_difftime64'
22769 d_difftime='$d_difftime'
22770 d_dir_dd_fd='$d_dir_dd_fd'
22772 d_dirnamlen='$d_dirnamlen'
22773 d_dlerror='$d_dlerror'
22774 d_dlopen='$d_dlopen'
22775 d_dlsymun='$d_dlsymun'
22776 d_dosuid='$d_dosuid'
22777 d_drand48_r='$d_drand48_r'
22778 d_drand48proto='$d_drand48proto'
22780 d_eaccess='$d_eaccess'
22781 d_endgrent='$d_endgrent'
22782 d_endgrent_r='$d_endgrent_r'
22783 d_endhent='$d_endhent'
22784 d_endhostent_r='$d_endhostent_r'
22785 d_endnent='$d_endnent'
22786 d_endnetent_r='$d_endnetent_r'
22787 d_endpent='$d_endpent'
22788 d_endprotoent_r='$d_endprotoent_r'
22789 d_endpwent='$d_endpwent'
22790 d_endpwent_r='$d_endpwent_r'
22791 d_endsent='$d_endsent'
22792 d_endservent_r='$d_endservent_r'
22793 d_eofnblk='$d_eofnblk'
22794 d_eunice='$d_eunice'
22795 d_faststdio='$d_faststdio'
22796 d_fchdir='$d_fchdir'
22797 d_fchmod='$d_fchmod'
22798 d_fchown='$d_fchown'
22800 d_fcntl_can_lock='$d_fcntl_can_lock'
22801 d_fd_macros='$d_fd_macros'
22802 d_fd_set='$d_fd_set'
22803 d_fds_bits='$d_fds_bits'
22804 d_fgetpos='$d_fgetpos'
22805 d_finite='$d_finite'
22806 d_finitel='$d_finitel'
22807 d_flexfnam='$d_flexfnam'
22809 d_flockproto='$d_flockproto'
22811 d_fp_class='$d_fp_class'
22812 d_fpathconf='$d_fpathconf'
22813 d_fpclass='$d_fpclass'
22814 d_fpclassify='$d_fpclassify'
22815 d_fpclassl='$d_fpclassl'
22816 d_fpos64_t='$d_fpos64_t'
22817 d_frexpl='$d_frexpl'
22818 d_fs_data_s='$d_fs_data_s'
22819 d_fseeko='$d_fseeko'
22820 d_fsetpos='$d_fsetpos'
22821 d_fstatfs='$d_fstatfs'
22822 d_fstatvfs='$d_fstatvfs'
22824 d_ftello='$d_ftello'
22826 d_futimes='$d_futimes'
22827 d_gdbm_ndbm_h_uses_prototypes='$d_gdbm_ndbm_h_uses_prototypes'
22828 d_gdbmndbm_h_uses_prototypes='$d_gdbmndbm_h_uses_prototypes'
22829 d_getaddrinfo='$d_getaddrinfo'
22830 d_getcwd='$d_getcwd'
22831 d_getespwnam='$d_getespwnam'
22832 d_getfsstat='$d_getfsstat'
22833 d_getgrent='$d_getgrent'
22834 d_getgrent_r='$d_getgrent_r'
22835 d_getgrgid_r='$d_getgrgid_r'
22836 d_getgrnam_r='$d_getgrnam_r'
22837 d_getgrps='$d_getgrps'
22838 d_gethbyaddr='$d_gethbyaddr'
22839 d_gethbyname='$d_gethbyname'
22840 d_gethent='$d_gethent'
22841 d_gethname='$d_gethname'
22842 d_gethostbyaddr_r='$d_gethostbyaddr_r'
22843 d_gethostbyname_r='$d_gethostbyname_r'
22844 d_gethostent_r='$d_gethostent_r'
22845 d_gethostprotos='$d_gethostprotos'
22846 d_getitimer='$d_getitimer'
22847 d_getlogin='$d_getlogin'
22848 d_getlogin_r='$d_getlogin_r'
22849 d_getmnt='$d_getmnt'
22850 d_getmntent='$d_getmntent'
22851 d_getnameinfo='$d_getnameinfo'
22852 d_getnbyaddr='$d_getnbyaddr'
22853 d_getnbyname='$d_getnbyname'
22854 d_getnent='$d_getnent'
22855 d_getnetbyaddr_r='$d_getnetbyaddr_r'
22856 d_getnetbyname_r='$d_getnetbyname_r'
22857 d_getnetent_r='$d_getnetent_r'
22858 d_getnetprotos='$d_getnetprotos'
22859 d_getpagsz='$d_getpagsz'
22860 d_getpbyname='$d_getpbyname'
22861 d_getpbynumber='$d_getpbynumber'
22862 d_getpent='$d_getpent'
22863 d_getpgid='$d_getpgid'
22864 d_getpgrp2='$d_getpgrp2'
22865 d_getpgrp='$d_getpgrp'
22866 d_getppid='$d_getppid'
22867 d_getprior='$d_getprior'
22868 d_getprotobyname_r='$d_getprotobyname_r'
22869 d_getprotobynumber_r='$d_getprotobynumber_r'
22870 d_getprotoent_r='$d_getprotoent_r'
22871 d_getprotoprotos='$d_getprotoprotos'
22872 d_getprpwnam='$d_getprpwnam'
22873 d_getpwent='$d_getpwent'
22874 d_getpwent_r='$d_getpwent_r'
22875 d_getpwnam_r='$d_getpwnam_r'
22876 d_getpwuid_r='$d_getpwuid_r'
22877 d_getsbyname='$d_getsbyname'
22878 d_getsbyport='$d_getsbyport'
22879 d_getsent='$d_getsent'
22880 d_getservbyname_r='$d_getservbyname_r'
22881 d_getservbyport_r='$d_getservbyport_r'
22882 d_getservent_r='$d_getservent_r'
22883 d_getservprotos='$d_getservprotos'
22884 d_getspnam='$d_getspnam'
22885 d_getspnam_r='$d_getspnam_r'
22886 d_gettimeod='$d_gettimeod'
22887 d_gmtime64='$d_gmtime64'
22888 d_gmtime_r='$d_gmtime_r'
22889 d_gnulibc='$d_gnulibc'
22890 d_grpasswd='$d_grpasswd'
22891 d_hasmntopt='$d_hasmntopt'
22893 d_ilogbl='$d_ilogbl'
22894 d_inc_version_list='$d_inc_version_list'
22896 d_inetaton='$d_inetaton'
22897 d_inetntop='$d_inetntop'
22898 d_inetpton='$d_inetpton'
22899 d_int64_t='$d_int64_t'
22900 d_ip_mreq='$d_ip_mreq'
22901 d_ip_mreq_source='$d_ip_mreq_source'
22902 d_ipv6_mreq='$d_ipv6_mreq'
22903 d_ipv6_mreq_source='$d_ipv6_mreq_source'
22904 d_isascii='$d_isascii'
22905 d_isblank='$d_isblank'
22906 d_isfinite='$d_isfinite'
22909 d_isnanl='$d_isnanl'
22910 d_killpg='$d_killpg'
22911 d_lchown='$d_lchown'
22912 d_ldbl_dig='$d_ldbl_dig'
22913 d_libm_lib_version='$d_libm_lib_version'
22914 d_libname_unique='$d_libname_unique'
22916 d_localtime64='$d_localtime64'
22917 d_localtime_r='$d_localtime_r'
22918 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
22919 d_locconv='$d_locconv'
22921 d_longdbl='$d_longdbl'
22922 d_longlong='$d_longlong'
22923 d_lseekproto='$d_lseekproto'
22925 d_madvise='$d_madvise'
22926 d_malloc_good_size='$d_malloc_good_size'
22927 d_malloc_size='$d_malloc_size'
22929 d_mbstowcs='$d_mbstowcs'
22930 d_mbtowc='$d_mbtowc'
22931 d_memchr='$d_memchr'
22932 d_memcmp='$d_memcmp'
22933 d_memcpy='$d_memcpy'
22934 d_memmove='$d_memmove'
22935 d_memset='$d_memset'
22937 d_mkdtemp='$d_mkdtemp'
22938 d_mkfifo='$d_mkfifo'
22939 d_mkstemp='$d_mkstemp'
22940 d_mkstemps='$d_mkstemps'
22941 d_mktime64='$d_mktime64'
22942 d_mktime='$d_mktime'
22945 d_modfl_pow32_bug='$d_modfl_pow32_bug'
22946 d_modflproto='$d_modflproto'
22947 d_mprotect='$d_mprotect'
22949 d_msg_ctrunc='$d_msg_ctrunc'
22950 d_msg_dontroute='$d_msg_dontroute'
22951 d_msg_oob='$d_msg_oob'
22952 d_msg_peek='$d_msg_peek'
22953 d_msg_proxy='$d_msg_proxy'
22954 d_msgctl='$d_msgctl'
22955 d_msgget='$d_msgget'
22956 d_msghdr_s='$d_msghdr_s'
22957 d_msgrcv='$d_msgrcv'
22958 d_msgsnd='$d_msgsnd'
22960 d_munmap='$d_munmap'
22961 d_mymalloc='$d_mymalloc'
22963 d_ndbm_h_uses_prototypes='$d_ndbm_h_uses_prototypes'
22965 d_nl_langinfo='$d_nl_langinfo'
22966 d_nv_preserves_uv='$d_nv_preserves_uv'
22967 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
22968 d_off64_t='$d_off64_t'
22969 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
22970 d_oldpthreads='$d_oldpthreads'
22971 d_oldsock='$d_oldsock'
22973 d_pathconf='$d_pathconf'
22975 d_perl_otherlibdirs='$d_perl_otherlibdirs'
22976 d_phostname='$d_phostname'
22979 d_portable='$d_portable'
22981 d_prctl_set_name='$d_prctl_set_name'
22982 d_printf_format_null='$d_printf_format_null'
22983 d_procselfexe='$d_procselfexe'
22984 d_pseudofork='$d_pseudofork'
22985 d_pthread_atfork='$d_pthread_atfork'
22986 d_pthread_attr_setscope='$d_pthread_attr_setscope'
22987 d_pthread_yield='$d_pthread_yield'
22989 d_pwchange='$d_pwchange'
22990 d_pwclass='$d_pwclass'
22991 d_pwcomment='$d_pwcomment'
22992 d_pwexpire='$d_pwexpire'
22993 d_pwgecos='$d_pwgecos'
22994 d_pwpasswd='$d_pwpasswd'
22995 d_pwquota='$d_pwquota'
22998 d_random_r='$d_random_r'
22999 d_readdir64_r='$d_readdir64_r'
23000 d_readdir='$d_readdir'
23001 d_readdir_r='$d_readdir_r'
23002 d_readlink='$d_readlink'
23004 d_recvmsg='$d_recvmsg'
23005 d_rename='$d_rename'
23006 d_rewinddir='$d_rewinddir'
23008 d_safebcpy='$d_safebcpy'
23009 d_safemcpy='$d_safemcpy'
23010 d_sanemcmp='$d_sanemcmp'
23011 d_sbrkproto='$d_sbrkproto'
23012 d_scalbnl='$d_scalbnl'
23013 d_sched_yield='$d_sched_yield'
23014 d_scm_rights='$d_scm_rights'
23015 d_seekdir='$d_seekdir'
23016 d_select='$d_select'
23018 d_semctl='$d_semctl'
23019 d_semctl_semid_ds='$d_semctl_semid_ds'
23020 d_semctl_semun='$d_semctl_semun'
23021 d_semget='$d_semget'
23023 d_sendmsg='$d_sendmsg'
23024 d_setegid='$d_setegid'
23025 d_seteuid='$d_seteuid'
23026 d_setgrent='$d_setgrent'
23027 d_setgrent_r='$d_setgrent_r'
23028 d_setgrps='$d_setgrps'
23029 d_sethent='$d_sethent'
23030 d_sethostent_r='$d_sethostent_r'
23031 d_setitimer='$d_setitimer'
23032 d_setlinebuf='$d_setlinebuf'
23033 d_setlocale='$d_setlocale'
23034 d_setlocale_r='$d_setlocale_r'
23035 d_setnent='$d_setnent'
23036 d_setnetent_r='$d_setnetent_r'
23037 d_setpent='$d_setpent'
23038 d_setpgid='$d_setpgid'
23039 d_setpgrp2='$d_setpgrp2'
23040 d_setpgrp='$d_setpgrp'
23041 d_setprior='$d_setprior'
23042 d_setproctitle='$d_setproctitle'
23043 d_setprotoent_r='$d_setprotoent_r'
23044 d_setpwent='$d_setpwent'
23045 d_setpwent_r='$d_setpwent_r'
23046 d_setregid='$d_setregid'
23047 d_setresgid='$d_setresgid'
23048 d_setresuid='$d_setresuid'
23049 d_setreuid='$d_setreuid'
23050 d_setrgid='$d_setrgid'
23051 d_setruid='$d_setruid'
23052 d_setsent='$d_setsent'
23053 d_setservent_r='$d_setservent_r'
23054 d_setsid='$d_setsid'
23055 d_setvbuf='$d_setvbuf'
23058 d_shmatprototype='$d_shmatprototype'
23059 d_shmctl='$d_shmctl'
23061 d_shmget='$d_shmget'
23062 d_sigaction='$d_sigaction'
23063 d_signbit='$d_signbit'
23064 d_sigprocmask='$d_sigprocmask'
23065 d_sigsetjmp='$d_sigsetjmp'
23066 d_sin6_scope_id='$d_sin6_scope_id'
23067 d_sitearch='$d_sitearch'
23068 d_snprintf='$d_snprintf'
23069 d_sockaddr_in6='$d_sockaddr_in6'
23070 d_sockaddr_sa_len='$d_sockaddr_sa_len'
23071 d_sockatmark='$d_sockatmark'
23072 d_sockatmarkproto='$d_sockatmarkproto'
23073 d_socket='$d_socket'
23074 d_socklen_t='$d_socklen_t'
23075 d_sockpair='$d_sockpair'
23076 d_socks5_init='$d_socks5_init'
23077 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
23079 d_srand48_r='$d_srand48_r'
23080 d_srandom_r='$d_srandom_r'
23081 d_sresgproto='$d_sresgproto'
23082 d_sresuproto='$d_sresuproto'
23083 d_statblks='$d_statblks'
23084 d_statfs_f_flags='$d_statfs_f_flags'
23085 d_statfs_s='$d_statfs_s'
23086 d_static_inline='$d_static_inline'
23087 d_statvfs='$d_statvfs'
23088 d_stdio_cnt_lval='$d_stdio_cnt_lval'
23089 d_stdio_ptr_lval='$d_stdio_ptr_lval'
23090 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
23091 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
23092 d_stdio_stream_array='$d_stdio_stream_array'
23093 d_stdiobase='$d_stdiobase'
23094 d_stdstdio='$d_stdstdio'
23095 d_strchr='$d_strchr'
23096 d_strcoll='$d_strcoll'
23097 d_strctcpy='$d_strctcpy'
23098 d_strerrm='$d_strerrm'
23099 d_strerror='$d_strerror'
23100 d_strerror_r='$d_strerror_r'
23101 d_strftime='$d_strftime'
23102 d_strlcat='$d_strlcat'
23103 d_strlcpy='$d_strlcpy'
23104 d_strtod='$d_strtod'
23105 d_strtol='$d_strtol'
23106 d_strtold='$d_strtold'
23107 d_strtoll='$d_strtoll'
23108 d_strtoq='$d_strtoq'
23109 d_strtoul='$d_strtoul'
23110 d_strtoull='$d_strtoull'
23111 d_strtouq='$d_strtouq'
23112 d_strxfrm='$d_strxfrm'
23113 d_suidsafe='$d_suidsafe'
23114 d_symlink='$d_symlink'
23115 d_syscall='$d_syscall'
23116 d_syscallproto='$d_syscallproto'
23117 d_sysconf='$d_sysconf'
23118 d_sysernlst='$d_sysernlst'
23119 d_syserrlst='$d_syserrlst'
23120 d_system='$d_system'
23121 d_tcgetpgrp='$d_tcgetpgrp'
23122 d_tcsetpgrp='$d_tcsetpgrp'
23123 d_telldir='$d_telldir'
23124 d_telldirproto='$d_telldirproto'
23126 d_timegm='$d_timegm'
23128 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
23129 d_tm_tm_zone='$d_tm_tm_zone'
23130 d_tmpnam_r='$d_tmpnam_r'
23131 d_truncate='$d_truncate'
23132 d_ttyname_r='$d_ttyname_r'
23133 d_tzname='$d_tzname'
23134 d_u32align='$d_u32align'
23135 d_ualarm='$d_ualarm'
23138 d_union_semun='$d_union_semun'
23139 d_unordered='$d_unordered'
23140 d_unsetenv='$d_unsetenv'
23141 d_usleep='$d_usleep'
23142 d_usleepproto='$d_usleepproto'
23144 d_vendorarch='$d_vendorarch'
23145 d_vendorbin='$d_vendorbin'
23146 d_vendorlib='$d_vendorlib'
23147 d_vendorscript='$d_vendorscript'
23149 d_void_closedir='$d_void_closedir'
23150 d_voidsig='$d_voidsig'
23151 d_voidtty='$d_voidtty'
23152 d_volatile='$d_volatile'
23153 d_vprintf='$d_vprintf'
23154 d_vsnprintf='$d_vsnprintf'
23156 d_waitpid='$d_waitpid'
23157 d_wcstombs='$d_wcstombs'
23158 d_wctomb='$d_wctomb'
23159 d_writev='$d_writev'
23162 db_hashtype='$db_hashtype'
23163 db_prefixtype='$db_prefixtype'
23164 db_version_major='$db_version_major'
23165 db_version_minor='$db_version_minor'
23166 db_version_patch='$db_version_patch'
23167 direntrytype='$direntrytype'
23170 doublesize='$doublesize'
23172 drand48_r_proto='$drand48_r_proto'
23174 dynamic_ext='$dynamic_ext'
23180 endgrent_r_proto='$endgrent_r_proto'
23181 endhostent_r_proto='$endhostent_r_proto'
23182 endnetent_r_proto='$endnetent_r_proto'
23183 endprotoent_r_proto='$endprotoent_r_proto'
23184 endpwent_r_proto='$endpwent_r_proto'
23185 endservent_r_proto='$endservent_r_proto'
23186 eunicefix='$eunicefix'
23189 extensions='$extensions'
23190 extern_C='$extern_C'
23192 fflushNULL='$fflushNULL'
23193 fflushall='$fflushall'
23195 firstmakefile='$firstmakefile'
23197 fpossize='$fpossize'
23198 fpostype='$fpostype'
23199 freetype='$freetype'
23202 full_csh='$full_csh'
23203 full_sed='$full_sed'
23204 gccansipedantic='$gccansipedantic'
23205 gccosandvers='$gccosandvers'
23206 gccversion='$gccversion'
23207 getgrent_r_proto='$getgrent_r_proto'
23208 getgrgid_r_proto='$getgrgid_r_proto'
23209 getgrnam_r_proto='$getgrnam_r_proto'
23210 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
23211 gethostbyname_r_proto='$gethostbyname_r_proto'
23212 gethostent_r_proto='$gethostent_r_proto'
23213 getlogin_r_proto='$getlogin_r_proto'
23214 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
23215 getnetbyname_r_proto='$getnetbyname_r_proto'
23216 getnetent_r_proto='$getnetent_r_proto'
23217 getprotobyname_r_proto='$getprotobyname_r_proto'
23218 getprotobynumber_r_proto='$getprotobynumber_r_proto'
23219 getprotoent_r_proto='$getprotoent_r_proto'
23220 getpwent_r_proto='$getpwent_r_proto'
23221 getpwnam_r_proto='$getpwnam_r_proto'
23222 getpwuid_r_proto='$getpwuid_r_proto'
23223 getservbyname_r_proto='$getservbyname_r_proto'
23224 getservbyport_r_proto='$getservbyport_r_proto'
23225 getservent_r_proto='$getservent_r_proto'
23226 getspnam_r_proto='$getspnam_r_proto'
23227 gidformat='$gidformat'
23233 gmtime_r_proto='$gmtime_r_proto'
23234 gnulibc_version='$gnulibc_version'
23236 groupcat='$groupcat'
23237 groupstype='$groupstype'
23240 h_sysfile='$h_sysfile'
23243 html1dir='$html1dir'
23244 html1direxp='$html1direxp'
23245 html3dir='$html3dir'
23246 html3direxp='$html3direxp'
23255 i_arpainet='$i_arpainet'
23256 i_assert='$i_assert'
23257 i_bsdioctl='$i_bsdioctl'
23261 i_dirent='$i_dirent'
23266 i_fp_class='$i_fp_class'
23268 i_gdbm_ndbm='$i_gdbm_ndbm'
23269 i_gdbmndbm='$i_gdbmndbm'
23271 i_ieeefp='$i_ieeefp'
23272 i_inttypes='$i_inttypes'
23273 i_langinfo='$i_langinfo'
23274 i_libutil='$i_libutil'
23275 i_limits='$i_limits'
23276 i_locale='$i_locale'
23277 i_machcthr='$i_machcthr'
23278 i_malloc='$i_malloc'
23279 i_mallocmalloc='$i_mallocmalloc'
23281 i_memory='$i_memory'
23282 i_mntent='$i_mntent'
23285 i_neterrno='$i_neterrno'
23286 i_netinettcp='$i_netinettcp'
23290 i_pthread='$i_pthread'
23292 i_rpcsvcdbm='$i_rpcsvcdbm'
23294 i_shadow='$i_shadow'
23296 i_stdarg='$i_stdarg'
23297 i_stdbool='$i_stdbool'
23298 i_stddef='$i_stddef'
23299 i_stdlib='$i_stdlib'
23300 i_string='$i_string'
23301 i_sunmath='$i_sunmath'
23302 i_sysaccess='$i_sysaccess'
23303 i_sysdir='$i_sysdir'
23304 i_sysfile='$i_sysfile'
23305 i_sysfilio='$i_sysfilio'
23307 i_sysioctl='$i_sysioctl'
23308 i_syslog='$i_syslog'
23309 i_sysmman='$i_sysmman'
23310 i_sysmode='$i_sysmode'
23311 i_sysmount='$i_sysmount'
23312 i_sysndir='$i_sysndir'
23313 i_sysparam='$i_sysparam'
23314 i_syspoll='$i_syspoll'
23315 i_sysresrc='$i_sysresrc'
23316 i_syssecrt='$i_syssecrt'
23317 i_sysselct='$i_sysselct'
23318 i_syssockio='$i_syssockio'
23319 i_sysstat='$i_sysstat'
23320 i_sysstatfs='$i_sysstatfs'
23321 i_sysstatvfs='$i_sysstatvfs'
23322 i_systime='$i_systime'
23323 i_systimek='$i_systimek'
23324 i_systimes='$i_systimes'
23325 i_systypes='$i_systypes'
23326 i_sysuio='$i_sysuio'
23328 i_sysutsname='$i_sysutsname'
23329 i_sysvfs='$i_sysvfs'
23330 i_syswait='$i_syswait'
23331 i_termio='$i_termio'
23332 i_termios='$i_termios'
23334 i_unistd='$i_unistd'
23337 i_values='$i_values'
23338 i_varargs='$i_varargs'
23339 i_varhdr='$i_varhdr'
23341 ignore_versioned_solibs='$ignore_versioned_solibs'
23342 inc_version_list='$inc_version_list'
23343 inc_version_list_init='$inc_version_list_init'
23346 initialinstalllocation='$initialinstalllocation'
23347 installarchlib='$installarchlib'
23348 installbin='$installbin'
23349 installhtml1dir='$installhtml1dir'
23350 installhtml3dir='$installhtml3dir'
23351 installman1dir='$installman1dir'
23352 installman3dir='$installman3dir'
23353 installprefix='$installprefix'
23354 installprefixexp='$installprefixexp'
23355 installprivlib='$installprivlib'
23356 installscript='$installscript'
23357 installsitearch='$installsitearch'
23358 installsitebin='$installsitebin'
23359 installsitehtml1dir='$installsitehtml1dir'
23360 installsitehtml3dir='$installsitehtml3dir'
23361 installsitelib='$installsitelib'
23362 installsiteman1dir='$installsiteman1dir'
23363 installsiteman3dir='$installsiteman3dir'
23364 installsitescript='$installsitescript'
23365 installstyle='$installstyle'
23366 installusrbinperl='$installusrbinperl'
23367 installvendorarch='$installvendorarch'
23368 installvendorbin='$installvendorbin'
23369 installvendorhtml1dir='$installvendorhtml1dir'
23370 installvendorhtml3dir='$installvendorhtml3dir'
23371 installvendorlib='$installvendorlib'
23372 installvendorman1dir='$installvendorman1dir'
23373 installvendorman3dir='$installvendorman3dir'
23374 installvendorscript='$installvendorscript'
23376 issymlink='$issymlink'
23377 ivdformat='$ivdformat'
23380 known_extensions='$known_extensions'
23383 ld_can_script='$ld_can_script'
23384 lddlflags='$lddlflags'
23386 ldflags_uselargefiles='$ldflags_uselargefiles'
23387 ldlibpthname='$ldlibpthname'
23394 libsdirs='$libsdirs'
23395 libsfiles='$libsfiles'
23396 libsfound='$libsfound'
23397 libspath='$libspath'
23398 libswanted='$libswanted'
23399 libswanted_uselargefiles='$libswanted_uselargefiles'
23405 localtime_r_proto='$localtime_r_proto'
23406 locincpth='$locincpth'
23407 loclibpth='$loclibpth'
23408 longdblsize='$longdblsize'
23409 longlongsize='$longlongsize'
23410 longsize='$longsize'
23414 lseeksize='$lseeksize'
23415 lseektype='$lseektype'
23418 madlyobj='$madlyobj'
23419 madlysrc='$madlysrc'
23423 make_set_make='$make_set_make'
23424 mallocobj='$mallocobj'
23425 mallocsrc='$mallocsrc'
23426 malloctype='$malloctype'
23428 man1direxp='$man1direxp'
23431 man3direxp='$man3direxp'
23433 mips_type='$mips_type'
23434 mistrustnm='$mistrustnm'
23436 mmaptype='$mmaptype'
23437 modetype='$modetype'
23439 multiarch='$multiarch'
23441 myarchname='$myarchname'
23442 mydomain='$mydomain'
23443 myhostname='$myhostname'
23446 need_va_copy='$need_va_copy'
23447 netdb_hlen_type='$netdb_hlen_type'
23448 netdb_host_type='$netdb_host_type'
23449 netdb_name_type='$netdb_name_type'
23450 netdb_net_type='$netdb_net_type'
23453 nm_so_opt='$nm_so_opt'
23454 nonxs_ext='$nonxs_ext'
23456 nvEUformat='$nvEUformat'
23457 nvFUformat='$nvFUformat'
23458 nvGUformat='$nvGUformat'
23459 nv_overflows_integers_at='$nv_overflows_integers_at'
23460 nv_preserves_uv_bits='$nv_preserves_uv_bits'
23461 nveformat='$nveformat'
23462 nvfformat='$nvfformat'
23463 nvgformat='$nvgformat'
23466 o_nonblock='$o_nonblock'
23468 old_pthread_create_joinable='$old_pthread_create_joinable'
23469 optimize='$optimize'
23470 orderlib='$orderlib'
23473 otherlibdirs='$otherlibdirs'
23477 patchlevel='$patchlevel'
23478 path_sep='$path_sep'
23481 perl_patchlevel='$perl_patchlevel'
23482 perl_static_inline='$perl_static_inline'
23483 perladmin='$perladmin'
23484 perllibs='$perllibs'
23485 perlpath='$perlpath'
23487 phostname='$phostname'
23493 prefixexp='$prefixexp'
23495 privlibexp='$privlibexp'
23496 procselfexe='$procselfexe'
23497 prototype='$prototype'
23499 quadkind='$quadkind'
23500 quadtype='$quadtype'
23501 randbits='$randbits'
23502 randfunc='$randfunc'
23503 random_r_proto='$random_r_proto'
23504 randseedtype='$randseedtype'
23506 rd_nodata='$rd_nodata'
23507 readdir64_r_proto='$readdir64_r_proto'
23508 readdir_r_proto='$readdir_r_proto'
23509 revision='$revision'
23515 sGMTIME_max='$sGMTIME_max'
23516 sGMTIME_min='$sGMTIME_min'
23517 sLOCALTIME_max='$sLOCALTIME_max'
23518 sLOCALTIME_min='$sLOCALTIME_min'
23519 sPRIEUldbl='$sPRIEUldbl'
23520 sPRIFUldbl='$sPRIFUldbl'
23521 sPRIGUldbl='$sPRIGUldbl'
23522 sPRIXU64='$sPRIXU64'
23524 sPRIeldbl='$sPRIeldbl'
23525 sPRIfldbl='$sPRIfldbl'
23526 sPRIgldbl='$sPRIgldbl'
23531 sSCNfldbl='$sSCNfldbl'
23532 sched_yield='$sched_yield'
23533 scriptdir='$scriptdir'
23534 scriptdirexp='$scriptdirexp'
23536 seedfunc='$seedfunc'
23537 selectminbits='$selectminbits'
23538 selecttype='$selecttype'
23539 sendmail='$sendmail'
23540 setgrent_r_proto='$setgrent_r_proto'
23541 sethostent_r_proto='$sethostent_r_proto'
23542 setlocale_r_proto='$setlocale_r_proto'
23543 setnetent_r_proto='$setnetent_r_proto'
23544 setprotoent_r_proto='$setprotoent_r_proto'
23545 setpwent_r_proto='$setpwent_r_proto'
23546 setservent_r_proto='$setservent_r_proto'
23549 sharpbang='$sharpbang'
23550 shmattype='$shmattype'
23551 shortsize='$shortsize'
23554 sig_count='$sig_count'
23555 sig_name='$sig_name'
23556 sig_name_init='$sig_name_init'
23558 sig_num_init='$sig_num_init'
23559 sig_size='$sig_size'
23560 signal_t='$signal_t'
23561 sitearch='$sitearch'
23562 sitearchexp='$sitearchexp'
23564 sitebinexp='$sitebinexp'
23565 sitehtml1dir='$sitehtml1dir'
23566 sitehtml1direxp='$sitehtml1direxp'
23567 sitehtml3dir='$sitehtml3dir'
23568 sitehtml3direxp='$sitehtml3direxp'
23570 sitelib_stem='$sitelib_stem'
23571 sitelibexp='$sitelibexp'
23572 siteman1dir='$siteman1dir'
23573 siteman1direxp='$siteman1direxp'
23574 siteman3dir='$siteman3dir'
23575 siteman3direxp='$siteman3direxp'
23576 siteprefix='$siteprefix'
23577 siteprefixexp='$siteprefixexp'
23578 sitescript='$sitescript'
23579 sitescriptexp='$sitescriptexp'
23580 sizesize='$sizesize'
23581 sizetype='$sizetype'
23585 sockethdr='$sockethdr'
23586 socketlib='$socketlib'
23587 socksizetype='$socksizetype'
23589 spackage='$spackage'
23590 spitshell='$spitshell'
23591 srand48_r_proto='$srand48_r_proto'
23592 srandom_r_proto='$srandom_r_proto'
23594 ssizetype='$ssizetype'
23595 st_ino_sign='$st_ino_sign'
23596 st_ino_size='$st_ino_size'
23597 startperl='$startperl'
23599 static_ext='$static_ext'
23601 stdio_base='$stdio_base'
23602 stdio_bufsiz='$stdio_bufsiz'
23603 stdio_cnt='$stdio_cnt'
23604 stdio_filbuf='$stdio_filbuf'
23605 stdio_ptr='$stdio_ptr'
23606 stdio_stream_array='$stdio_stream_array'
23607 strerror_r_proto='$strerror_r_proto'
23610 subversion='$subversion'
23614 targetarch='$targetarch'
23618 timeincl='$timeincl'
23619 timetype='$timetype'
23620 tmpnam_r_proto='$tmpnam_r_proto'
23626 ttyname_r_proto='$ttyname_r_proto'
23635 uidformat='$uidformat'
23641 uquadtype='$uquadtype'
23642 use5005threads='$use5005threads'
23643 use64bitall='$use64bitall'
23644 use64bitint='$use64bitint'
23645 usecrosscompile='$usecrosscompile'
23646 usedevel='$usedevel'
23648 usedtrace='$usedtrace'
23649 usefaststdio='$usefaststdio'
23650 useithreads='$useithreads'
23651 usekernprocpathname='$usekernprocpathname'
23652 uselargefiles='$uselargefiles'
23653 uselongdouble='$uselongdouble'
23654 usemallocwrap='$usemallocwrap'
23655 usemorebits='$usemorebits'
23656 usemultiplicity='$usemultiplicity'
23657 usemymalloc='$usemymalloc'
23659 usensgetexecutablepath='$usensgetexecutablepath'
23660 useopcode='$useopcode'
23661 useperlio='$useperlio'
23662 useposix='$useposix'
23663 usereentrant='$usereentrant'
23664 userelocatableinc='$userelocatableinc'
23665 useshrplib='$useshrplib'
23666 usesitecustomize='$usesitecustomize'
23667 usesocks='$usesocks'
23668 usethreads='$usethreads'
23669 usevendorprefix='$usevendorprefix'
23670 useversionedarchname='$useversionedarchname'
23671 usevfork='$usevfork'
23674 uvXUformat='$uvXUformat'
23675 uvoformat='$uvoformat'
23678 uvuformat='$uvuformat'
23679 uvxformat='$uvxformat'
23681 vendorarch='$vendorarch'
23682 vendorarchexp='$vendorarchexp'
23683 vendorbin='$vendorbin'
23684 vendorbinexp='$vendorbinexp'
23685 vendorhtml1dir='$vendorhtml1dir'
23686 vendorhtml1direxp='$vendorhtml1direxp'
23687 vendorhtml3dir='$vendorhtml3dir'
23688 vendorhtml3direxp='$vendorhtml3direxp'
23689 vendorlib='$vendorlib'
23690 vendorlib_stem='$vendorlib_stem'
23691 vendorlibexp='$vendorlibexp'
23692 vendorman1dir='$vendorman1dir'
23693 vendorman1direxp='$vendorman1direxp'
23694 vendorman3dir='$vendorman3dir'
23695 vendorman3direxp='$vendorman3direxp'
23696 vendorprefix='$vendorprefix'
23697 vendorprefixexp='$vendorprefixexp'
23698 vendorscript='$vendorscript'
23699 vendorscriptexp='$vendorscriptexp'
23701 version_patchlevel_string='$version_patchlevel_string'
23702 versiononly='$versiononly'
23706 yaccflags='$yaccflags'
23711 : add special variables
23712 $test -f $src/patchlevel.h && \
23713 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
23714 echo "PERL_PATCHLEVEL='$perl_patchlevel'" >>config.sh
23715 echo "PERL_CONFIG_SH=true" >>config.sh
23717 : propagate old symbols
23718 if $test -f UU/config.sh; then
23719 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
23720 $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \
23721 config.sh config.sh UU/oldconfig.sh |\
23722 $sort | $uniq -u >UU/oldsyms
23723 set X `$cat UU/oldsyms`
23729 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
23731 echo ": Variables propagated from previous config.sh file." >>config.sh
23732 for sym in `$cat UU/oldsyms`; do
23733 echo " Propagating $hint variable "'$'"$sym..."
23734 eval 'tmp="$'"${sym}"'"'
23736 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
23742 : Finish up by extracting the .SH files
23746 echo "Extraction done."
23756 If you'd like to make any changes to the config.sh file before I begin
23757 to configure things, do it as a shell escape now (e.g. !vi config.sh).
23760 rp="Press return or use a shell escape to edit config.sh:"
23765 *) : in case they cannot read
23766 sh 1>&4 -c "$ans";;
23771 : if this fails, just run all the .SH files by hand
23780 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
23787 Now you need to generate make dependencies by running "$make depend".
23788 You might prefer to run it in background: "$make depend > makedepend.out &"
23789 It can take a while, so you might not want to run it right now.
23794 rp="Run $make depend now?"
23798 $make depend && echo "Now you must run '$make'."
23801 echo "You must run '$make depend' then '$make'."
23804 elif test -f [Mm]akefile; then
23806 echo "Now you must run a $make."
23808 echo "Configure done."
23811 if $test -f Policy.sh; then
23814 If you compile $package on a different machine or from a different object
23815 directory, copy the Policy.sh file from this object directory to the
23816 new one before you run Configure -- this will help you with most of
23817 the policy defaults.
23821 if $test -f config.msg; then
23822 echo "Hmm. I also noted the following information while running:"
23824 $cat config.msg >&4
23827 $rm -f kit*isdone ark*isdone