3 # If these # comments don't work, trim them. Don't worry about any other
4 # shell scripts, Configure will trim # comments from them for you.
6 # (If you are trying to port this package to a machine without sh,
7 # I would suggest you have a look at the prototypical config_h.SH file
8 # and edit it to reflect your system. Some packages may include samples
9 # of config.h for certain machines, so you might look for one of those.)
11 # Yes, you may rip this off to use in other distribution packages. This
12 # script belongs to the public domain and cannot be copyrighted.
14 # Note: this Configure script was generated automatically. Rather than
15 # working with this copy of Configure, you may wish to get metaconfig.
16 # The dist package (which contains metaconfig) is available via SVN:
17 # svn co https://svn.sourceforge.net/svnroot/dist/trunk/dist
19 # Though this script was generated by metaconfig from metaunits, it is
20 # OK to send patches against Configure itself. It's up to the Configure
21 # pumpkin to backport the patch to the metaunits if it is accepted.
22 # For more information on patching Configure, see pod/perlhack.pod
24 # The metaunits are also available from the public git repository:
25 # http://perl5.git.perl.org/metaconfig.git/ or
26 # $ git clone git://perl5.git.perl.org/metaconfig.git metaconfig
28 # See Porting/pumpkin.pod for more information on metaconfig.
31 # Generated on Sun Jul 31 12:11:29 CEST 2011 [metaconfig 3.5 PL0]
32 # (with additional metaconfig patches by perlbug@perl.org)
37 SCO csh still thinks true is false. Write to SCO today and tell them that next
38 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
40 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
41 we'd have to do is go in and swap the && and || tokens, wherever they are.)
43 [End of diatribe. We now return you to your regularly scheduled programming...]
47 OOPS! You naughty creature! You didn't run Configure with sh!
48 I will attempt to remedy the situation by running sh for you...
52 true || exec sh $0 $argv:q
54 (exit $?0) || cat c2$$
55 (exit $?0) || exec sh $0 $argv:q
58 if test -f /dev/cputype -a -f /dev/drivers -a -f /dev/osversion; then
61 *** I'm sorry but this system looks like Plan 9 and Plan 9 doesn't do
62 *** Configure that well. (Plan 9 is close to UNIX but not close enough.)
63 *** Please read the README.plan9 for further instructions.
64 *** Cannot continue, aborting.
70 if test ! -c /dev/null ; then
73 *** I'm sorry, but /dev/null appears to be a file rather than a device.
74 *** Please consult your operating sytem's notes for making a device
76 *** Cannot continue, aborting.
82 : compute my invocation name
86 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
91 : Proper separator for the PATH environment variable
93 : On OS/2 this directory should exist if this is not floppy only system ":-]"
94 if test -d c:/. || ( uname -a | grep -i 'os\(/\|\)2' ) 2>&1 >/dev/null ; then
95 if test -n "$OS2_SHELL"; then
97 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
98 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
100 elif test -n "$DJGPP"; then
101 case "X${MACHTYPE:-nonesuchmach}" in
108 : Proper PATH setting
109 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
110 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
111 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
112 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
113 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
114 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /opt/ansic/bin /usr/ccs/bin"
115 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
116 paths="$paths /sbin /usr/sbin /usr/libexec"
117 paths="$paths /system/gnu_library/bin"
121 case "$p_$PATH$p_" in
123 *) test -d $p && PATH=$PATH$p_$p ;;
130 : shall we be using ksh?
136 if (PATH=.; alias -x) >/dev/null 2>&1; then
139 if test -f /hp-ux -a -f /bin/ksh; then
140 needksh='to avoid sh bug in "here document" expansion'
142 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
143 if test X`/usr/bin/uname -v` = X4; then
144 avoidksh="to avoid AIX 4's /bin/sh"
148 if test -f /osf_boot -a -f /usr/sbin/setld; then
149 if test X`/usr/bin/uname -s` = XOSF1; then
150 avoidksh="to avoid Digital UNIX' ksh"
155 case "$inksh/$needksh" in
162 case "$inksh/$avoidksh" in
168 case "$inksh/$needksh-$avoidksh-" in
171 (I see you are using the Korn shell. Some ksh's blow up on $me,
172 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
179 echo "(Feeding myself to $newsh $reason.)"
181 Configure|*/Configure) exec $newsh $0 "$@";;
182 *) exec $newsh Configure "$@";;
186 test -x "${newsh}" || unset newsh
188 : if needed, set CDPATH to a harmless value that is not chatty
189 : avoid bash 2.02 problems with empty CDPATH.
193 *bash*) CDPATH='.' ;;
199 : Configure runs within the UU subdirectory
200 test -d UU || mkdir UU
340 initialinstalllocation=''
369 d_attribute_deprecated=''
370 d_attribute_format=''
371 d_attribute_malloc=''
372 d_attribute_nonnull=''
373 d_attribute_noreturn=''
375 d_attribute_unused=''
376 d_attribute_warn_unused_result=''
377 d_printf_format_null=''
380 d_builtin_choose_expr=''
383 d_c99_variadic_macros=''
430 endhostent_r_proto=''
436 endprotoent_r_proto=''
442 endservent_r_proto=''
495 gethostbyaddr_r_proto=''
497 gethostbyname_r_proto=''
499 gethostent_r_proto=''
512 getnetbyaddr_r_proto=''
514 getnetbyname_r_proto=''
528 d_getprotobyname_r=''
529 getprotobyname_r_proto=''
530 d_getprotobynumber_r=''
531 getprotobynumber_r_proto=''
533 getprotoent_r_proto=''
545 getservbyname_r_proto=''
547 getservbyport_r_proto=''
549 getservent_r_proto=''
575 d_libm_lib_version=''
578 d_localtime_r_needs_tzset=''
589 d_malloc_good_size=''
633 d_old_pthread_create_joinable=''
634 old_pthread_create_joinable=''
636 d_pthread_attr_setscope=''
675 sethostent_r_proto=''
692 setprotoent_r_proto=''
704 setservent_r_proto=''
740 d_sprintf_returns_strlen=''
752 perl_static_inline=''
757 d_stdio_ptr_lval_nochange_cnt=''
758 d_stdio_ptr_lval_sets_cnt=''
902 d_gdbm_ndbm_h_uses_prototypes=''
903 d_gdbmndbm_h_uses_prototypes=''
905 d_ndbm_h_uses_prototypes=''
979 d_inc_version_list=''
981 inc_version_list_init=''
1000 ignore_versioned_solibs=''
1064 d_perl_otherlibdirs=''
1072 api_versionstring=''
1078 version_patchlevel_string=''
1082 d_nv_preserves_uv=''
1083 d_nv_zero_is_allbits_zero=''
1094 nv_overflows_integers_at=''
1095 nv_preserves_uv_bits=''
1167 installsitehtml1dir=''
1170 installsitehtml3dir=''
1177 installsiteman1dir=''
1180 installsiteman3dir=''
1185 installsitescript=''
1202 d_stdio_stream_array=''
1203 stdio_stream_array=''
1220 ccflags_uselargefiles=''
1221 ldflags_uselargefiles=''
1222 libswanted_uselargefiles=''
1243 installvendorarch=''
1250 installvendorhtml1dir=''
1252 vendorhtml1direxp=''
1253 installvendorhtml3dir=''
1255 vendorhtml3direxp=''
1261 installvendorman1dir=''
1264 installvendorman3dir=''
1271 installvendorscript=''
1284 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1287 : We must find out about Eunice early
1289 if test -f /etc/unixtovms; then
1290 eunicefix=/etc/unixtovms
1292 if test -f /etc/unixtovms.exe; then
1293 eunicefix=/etc/unixtovms.exe
1296 : Set executable suffix now -- needed before hints available
1297 if test -f "/libs/version.library"; then
1300 elif test -f "/system/gnu_library/bin/ar.pm"; then
1303 elif test -n "$DJGPP"; then
1306 elif test -d c:/. -o -n "$is_os2" ; then
1314 : Possible local include directories to search.
1315 : Set locincpth to "" in a hint file to defeat local include searches.
1316 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1317 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1319 : no include file wanted by default
1322 : Enable -DEBUGGING and -DDEBUGGING from the command line
1326 : set usethreads on the Configure command line to enable threads.
1327 usereentrant='undef'
1328 : Trailing extension. Override this in a hint file, if needed.
1329 : Extra object files, if any, needed on this platform.
1332 : change the next line if compiling for Xenix/286 on Xenix/386
1333 xlibpth='/usr/lib/386 /lib/386'
1334 : Possible local library directories to search.
1335 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1336 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1338 : general looking path for locating libraries
1339 glibpth="/lib /usr/lib $xlibpth"
1340 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1341 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1342 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1343 test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
1345 : Private path used by Configure to find libraries. Its value
1346 : is prepended to libpth. This variable takes care of special
1347 : machines, like the mips. Usually, it should be empty.
1350 : default library list
1352 : some systems want to use only the non-versioned libso:s
1353 ignore_versioned_solibs=''
1354 : full support for void wanted by default
1360 : set useposix=false in your hint file to disable the POSIX extension.
1362 : set useopcode=false in your hint file to disable the Opcode extension.
1365 ccflags_uselargefiles=''
1366 ldflags_uselargefiles=''
1367 libswanted_uselargefiles=''
1368 : set usemultiplicity on the Configure command line to enable multiplicity.
1369 : set usesocks on the Configure command line to enable socks.
1370 : List of libraries we want.
1371 : If anyone needs extra -lxxx, put those in a hint file.
1372 libswanted="sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun"
1373 libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
1374 : We probably want to search /usr/shlib before most other libraries.
1375 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1376 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1377 glibpth="/usr/shlib $glibpth"
1378 : Do not use vfork unless overridden by a hint file.
1381 : Find the basic shell for Bourne shell scripts
1385 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1388 if test -f "$xxx"; then
1391 : Build up a list and do a single loop so we can 'break' out.
1392 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1393 for xxx in sh bash ksh pdksh ash; do
1395 try="$try ${p}/${xxx}"
1399 if test -f "$xxx"; then
1402 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1405 elif test -f "$xxx.exe"; then
1416 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1418 Usually it's in /bin/sh. How did you even get this far?
1419 Please contact me (Perl Maintainers) at perlbug@perl.org and
1420 we'll try to straighten this all out.
1426 : see if sh knows # comments
1427 if `$sh -c '#' >/dev/null 2>&1`; then
1431 test -f $xcat$_exe || xcat=/usr/bin/cat
1432 if test ! -f $xcat$_exe; then
1433 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1434 if test -f $p/cat$_exe; then
1439 if test ! -f $xcat$_exe; then
1440 echo "Can't find cat anywhere!"
1444 echo "#!$xcat" >sharp
1447 ./sharp > today 2>/dev/null
1448 if test -s today; then
1451 echo "#! $xcat" > sharp
1454 ./sharp > today 2>/dev/null
1455 if test -s today; then
1463 echo "Your $sh doesn't grok # comments--I will strip them later on."
1466 echo "exec grep -v '^[ ]*#'" >spitshell
1468 $eunicefix spitshell
1469 spitshell=`pwd`/spitshell
1471 echo "I presume that if # doesn't work, #! won't work either!"
1476 : figure out how to guarantee sh startup
1478 '') startsh=${sharpbang}${sh} ;;
1490 : echo "Yup, it does."
1492 echo "Hmm... '$startsh' does not guarantee sh startup..."
1493 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1497 : Save command line options in file UU/cmdline.opt for later use in
1498 : generating config.sh.
1499 cat > cmdline.opt <<EOSH
1500 : Configure command line arguments.
1509 cat >>cmdline.opt <<EOSH
1510 config_arg$argn='$arg'
1512 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1515 arg_exp=`cat cmdl.opt`
1516 args_exp="$args_exp$args_sep'$arg_exp'"
1517 argn=`expr $argn + 1`
1522 : produce awk script to parse command line options
1523 cat >options.awk <<'EOF'
1525 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1527 len = length(optstr);
1528 for (i = 1; i <= len; i++) {
1529 c = substr(optstr, i, 1);
1530 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1541 if (substr(str, 1, 1) != "-") {
1542 printf("'%s'\n", str);
1546 for (i = 2; i <= len; i++) {
1547 c = substr(str, i, 1);
1549 printf("-%s\n", substr(str, i));
1555 printf("'%s'\n", substr(str, i + 1));
1568 : process the command line options
1569 set X `for arg in "$@"; do echo "X$arg"; done |
1570 sed -e s/X// | awk -f options.awk`
1575 : set up default values
1585 rm -f optdef.sh posthint.sh
1586 cat >optdef.sh <<EOS
1592 while test $# -gt 0; do
1594 -d) shift; fastread=yes;;
1595 -e) shift; alldone=cont;;
1599 if test -r "$1"; then
1602 echo "$me: cannot read config file $1." >&2
1608 -h) shift; error=true;;
1609 -r) shift; reuseval=true;;
1610 -s) shift; silent=true; realsilent=true;;
1611 -E) shift; alldone=exit;;
1612 -K) shift; knowitall=true;;
1613 -O) shift; override=true;;
1614 -S) shift; silent=true; extractsh=true;;
1619 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1620 echo "$me: ignoring -D $1" >&2
1623 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1624 *) echo "$1='define'" >> optdef.sh;;
1631 *=) echo "$1" >> optdef.sh;;
1633 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1634 echo "$me: ignoring -U $1" >&2
1636 *) echo "$1='undef'" >> optdef.sh;;
1647 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1651 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1652 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1658 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1659 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1660 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1661 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1662 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1663 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1669 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1671 echo "$yyy=''" >> posthint.sh ;;
1676 echo "$yyy='$zzz'" >> posthint.sh ;;
1678 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1680 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1685 echo "$yyy=$zzz" >> posthint.sh ;;
1686 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1690 -V) echo "$me generated by metaconfig 3.5 PL0." >&2
1693 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1701 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1702 [-U symbol] [-U symbol=] [-A command:symbol...]
1703 -d : use defaults for all answers.
1704 -e : go on without questioning past the production of config.sh.
1705 -f : specify an alternate default configuration file.
1706 -h : print this help message and exit (with an error status).
1707 -r : reuse C symbols value if possible (skips costly nm extraction).
1708 -s : silent mode, only echoes questions and essential information.
1709 -D : define symbol to have some value:
1710 -D symbol symbol gets the value 'define'
1711 -D symbol=value symbol gets the value 'value'
1712 common used examples (see INSTALL for more info):
1713 -Duse64bitint use 64bit integers
1714 -Duse64bitall use 64bit integers and pointers
1715 -Dusethreads use thread support
1716 -Dinc_version_list=none do not include older perl trees in @INC
1717 -DEBUGGING=none DEBUGGING options
1718 -Dcc=gcc choose your compiler
1719 -Dprefix=/opt/perl5 choose your destination
1720 -E : stop at the end of questions, after having produced config.sh.
1721 -K : do not use unless you know what you are doing.
1722 -O : let -D and -U override definitions from loaded configuration file.
1723 -S : perform variable substitutions on all .SH files (can mix with -f)
1724 -U : undefine symbol:
1725 -U symbol symbol gets the value 'undef'
1726 -U symbol= symbol gets completely empty
1728 -A : manipulate symbol after the platform specific hints have been applied:
1729 -A append:symbol=value append value to symbol
1730 -A symbol=value like append:, but with a separating space
1731 -A define:symbol=value define symbol to have value
1732 -A clear:symbol define symbol to be ''
1733 -A define:symbol define symbol to be 'define'
1734 -A eval:symbol=value define symbol to be eval of value
1735 -A prepend:symbol=value prepend value to symbol
1736 -A undef:symbol define symbol to be 'undef'
1737 -A undef:symbol= define symbol to be ''
1738 e.g.: -A prepend:libswanted='cl pthread '
1739 -A ccflags=-DSOME_MACRO
1740 -V : print version number and exit (with a zero status).
1747 case "$fastread$alldone" in
1750 case "$extractsh" in
1753 if test ! -t 0; then
1754 echo "Say 'sh Configure', not 'sh <Configure'"
1764 true) exec 1>/dev/null;;
1767 : run the defines and the undefines, if any, but leave the file out there...
1770 : create the posthint manipulation script and leave the file out there...
1775 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1776 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1777 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1778 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1779 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1782 : Some greps do not return status, grrr.
1783 echo "grimblepritz" >grimble
1784 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1786 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1792 : the following should work in any shell
1796 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1797 cat >contains <<'EOSS'
1798 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1803 : Find the path to the source tree
1806 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1810 *) src=`cd ../$src && pwd` ;;
1823 if test -f $rsrc/Configure && \
1824 $contains "^package='$package'\$" $rsrc/Configure >/dev/null 2>&1
1826 : found it, so we are ok.
1829 for src in . .. ../.. ../../.. ../../../..; do
1830 if test -f ../$src/Configure && \
1831 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1842 Sorry, I can't seem to locate the source dir for $package. Please start
1843 Configure with an explicit path -- i.e. /some/path/Configure.
1851 echo "Sources for $package found in \"$src\"." >&4
1855 : script used to extract .SH files with variable substitutions
1856 cat >extract <<'EOS'
1858 echo "Doing variable substitutions on .SH files..."
1859 if test -f MANIFEST; then
1860 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1862 echo "(Looking for .SH files under the source directory.)"
1863 set x `(cd "$src"; find . -name "*.SH" -print)`
1867 0) set x `(cd "$src"; echo *.SH)`; shift;;
1869 if test ! -f "$src/$1"; then
1875 while test $name; do
1876 if test ! -d "$name"; then
1877 create="$name $create";
1878 name=`echo $name | sed -e "s|^[^/]*$||"`;
1879 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1884 for file in $create; do
1893 dir=`expr X$file : 'X\(.*\)/'`
1894 file=`expr X$file : 'X.*/\(.*\)'`
1895 (cd "$dir" && . ./$file)
1905 dir=`expr X$file : 'X\(.*\)/'`
1906 file=`expr X$file : 'X.*/\(.*\)'`
1907 (set x $dir; shift; eval $mkdir_p)
1908 sh <"$src/$dir/$file"
1917 if test -f "$src/config_h.SH"; then
1918 if test ! -f config.h; then
1919 : oops, they left it out of MANIFEST, probably, so do it anyway.
1920 . "$src/config_h.SH"
1925 : extract files and exit if asked to do so
1926 case "$extractsh" in
1928 case "$realsilent" in
1932 case "$config_sh" in
1933 '') config_sh='config.sh';;
1936 echo "Fetching answers from $config_sh..."
1939 test "$override" && . ./optdef.sh
1943 echo "Extraction done."
1948 : Eunice requires " " instead of "", can you believe it
1951 echo "Beginning of configuration questions for $package."
1953 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1955 : first determine how to suppress newline on echo command
1957 echo "Checking echo to see how to suppress newlines..."
1958 (echo "hi there\c" ; echo " ") >.echotmp
1959 if $contains c .echotmp >/dev/null 2>&1 ; then
1970 echo $n "The star should be here-->$c"
1974 : Now test for existence of everything in MANIFEST
1976 if test -f "$rsrc/MANIFEST"; then
1977 echo "First let's make sure your kit is complete. Checking..." >&4
1978 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | \
1979 (split -l 50 2>/dev/null || split -50)
1982 for filelist in x??; do
1983 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` \
1984 >/dev/null 2>>"$tmppwd/missing")
1986 if test -s missing; then
1990 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1992 You have the option of continuing the configuration process, despite the
1993 distinct possibility that your kit is damaged, by typing 'y'es. If you
1994 do, don't blame me if something goes wrong. I advise you to type 'n'o
1995 and contact the author (perlbug@perl.org).
1998 echo $n "Continue? [n] $c" >&4
2002 echo "Continuing..." >&4
2006 echo "ABORTING..." >&4
2011 echo "Looks good..."
2014 echo "There is no MANIFEST file. I hope your kit is complete !"
2018 : Find the appropriate value for a newline for tr
2020 if test -n "$DJGPP"; then
2023 if test X"$trnl" = X; then
2024 case "`echo foo|tr '\n' x 2>/dev/null`" in
2028 if test X"$trnl" = X; then
2029 case "`echo foo|tr '\012' x 2>/dev/null`" in
2030 foox) trnl='\012' ;;
2033 if test X"$trnl" = X; then
2034 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
2035 fooxy) trnl='\n\r' ;;
2038 if test X"$trnl" = X; then
2041 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
2047 : compute the number of columns on the terminal for proper question formatting
2052 : set up the echo used in my read
2053 myecho="case \"\$xxxm\" in
2054 '') echo $n \"\$rp $c\" >&4;;
2056 '') echo $n \"[\$xxxm] $c\";;
2058 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
2060 echo $n \"[\$xxxm] $c\" >&4
2062 echo $n \"\$rp [\$xxxm] $c\" >&4
2068 : now set up to do reads with possible shell escape and default assignment
2074 case "\$fastread" in
2075 yes) case "\$dflt" in
2078 case "\$silent-\$rp" in
2083 *) case "\$silent" in
2084 true) case "\$rp" in
2089 while expr "X\$ans" : "X!" >/dev/null; do
2093 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2101 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2110 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2115 echo "(OK, I'll run with -d after this question.)" >&4
2118 echo "*** Sorry, \$1 not supported yet." >&4
2128 echo "*** Substitution done -- please confirm."
2130 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2135 echo "*** Error -- try again."
2142 case "\$ans\$xxxm\$nostick" in
2154 : create .config dir to save info across Configure sessions
2155 test -d ../.config || mkdir ../.config
2156 cat >../.config/README <<EOF
2157 This directory created by Configure to save information that should
2158 persist across sessions for $package.
2160 You may safely delete it if you wish.
2163 : See if we are using a devel version and want that
2164 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2167 usedevel="$define" ;;
2168 *) case "$xversion" in
2171 *** WHOA THERE!!! ***
2173 This is an UNSTABLE DEVELOPMENT release.
2174 The version of this $package distribution is $xversion, that is, odd,
2175 (as opposed to even) and that signifies a development release.
2176 If you want a maintenance release, you want an even-numbered version.
2178 Do ***NOT*** install this into production use.
2179 Data corruption and crashes are possible.
2181 It is most seriously suggested that you do not continue any further
2182 unless you want to help in developing and debugging Perl.
2184 If you *still* want to build perl, you can answer 'y' now,
2185 or pass -Dusedevel to Configure.
2188 rp='Do you really want to continue?'
2192 [yY]) echo >&4 "Okay, continuing."
2193 usedevel="$define" ;;
2194 *) echo >&4 "Okay, bye."
2205 case "$versiononly" in
2206 '') versiononly="$define" ;;
2208 case "$installusrbinperl" in
2209 '') installusrbinperl="$undef" ;;
2214 : general instructions
2217 user=`(logname) 2>/dev/null`
2219 '') user=`whoami 2>&1`;;
2221 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2224 rp='Would you like to see the instructions?'
2235 This installation shell script will examine your system and ask you questions
2236 to determine how the perl5 package should be installed. If you get
2237 stuck on a question, you may use a ! shell escape to start a subshell or
2238 execute a command. Many of the questions will have default answers in square
2239 brackets; typing carriage return will give you the default.
2241 On some of the questions which ask for file or directory names you are allowed
2242 to use the ~name construct to specify the login directory belonging to "name",
2243 even if you don't have a shell which knows about that. Questions where this is
2244 allowed will be marked "(~name ok)".
2248 dflt='Type carriage return to continue'
2252 The prompter used in this script allows you to use shell variables and
2253 backticks in your answers. You may use $1, $2, etc... to refer to the words
2254 in the default answer, as if the default line was a set of arguments given to a
2255 script shell. This means you may also use $* to repeat the whole default line,
2256 so you do not have to re-type everything to add something to the default.
2258 Every time there is a substitution, you will have to confirm. If there is an
2259 error (e.g. an unmatched backtick), the default answer will remain unchanged
2260 and you will be prompted again.
2262 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2263 the questions and use the computed defaults (or the previous answers if there
2264 was already a config.sh file). Type 'Configure -h' for a list of options.
2265 You may also start interactively and then answer '& -d' at any prompt to turn
2266 on the non-interactive behaviour for the remainder of the execution.
2272 Much effort has been expended to ensure that this shell script will run on any
2273 Unix system. If despite that it blows up on yours, your best bet is to edit
2274 Configure and run it again. If you can't run Configure for some reason,
2275 you'll have to generate a config.sh file by hand. Whatever problems you
2276 have, let me (perlbug@perl.org) know how I blew it.
2278 This installation script affects things in two ways:
2280 1) it may do direct variable substitutions on some of the files included
2282 2) it builds a config.h file for inclusion in C programs. You may edit
2283 any of these files as the need arises after running this script.
2285 If you make a mistake on a question, there is no easy way to back up to it
2286 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2287 files. Configure will offer to let you do this before it runs the SH files.
2290 dflt='Type carriage return to continue'
2292 case "$firsttime" in
2293 true) echo $user >>../.config/instruct;;
2297 : find out where common programs are
2299 echo "Locating common programs..." >&4
2312 if test -d \$dir/\$thing; then
2318 for thisthing in \$dir/\$thing; do
2319 : just loop through to pick last item
2321 if test -f \$thisthing; then
2324 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2327 elif test -f \$dir/\$thing.exe; then
2328 if test -n "$DJGPP"; then
2329 echo \$dir/\$thing.exe
2330 elif test "$eunicefix" != ":"; then
2331 : on Eunice apparently
2384 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2385 pth="$pth /lib /usr/lib"
2386 for file in $loclist; do
2390 if test -f "$xxx"; then
2393 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2394 xxx=`./loc $file $file $pth`
2397 '') xxx=`./loc $file $file $pth`;;
2398 *) xxx=`./loc $xxx $xxx $pth`;;
2400 eval $file=$xxx$_exe
2404 echo $file is in $xxx.
2407 echo $file is in $xxx.
2410 echo "I don't know where '$file' is, and my life depends on it." >&4
2411 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2417 echo "Don't worry if any of the following aren't found..."
2419 for file in $trylist; do
2423 if test -f "$xxx"; then
2426 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2427 xxx=`./loc $file $file $pth`
2430 '') xxx=`./loc $file $file $pth`;;
2431 *) xxx=`./loc $xxx $xxx $pth`;;
2433 eval $file=$xxx$_exe
2437 echo $file is in $xxx.
2440 echo $file is in $xxx.
2443 echo "I don't see $file out there, $say."
2450 echo "Substituting grep for egrep."
2457 *) if $less -R </dev/null >/dev/null; then
2458 echo "Substituting less -R for less."
2466 echo "Substituting cp for ln."
2475 echo "I can't find make or gmake, and my life depends on it." >&4
2476 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2484 *) # We can't have osname yet.
2485 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2486 # Assume that gmake, if found, is definitely GNU make
2487 # and prefer it over the system make.
2488 echo "Substituting gmake for make."
2496 echo "Hopefully test is built into your sh."
2499 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2500 echo "Using the test built into your sh."
2508 echo "Hopefully echo is built into your sh."
2513 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2514 $echo $n "hi there$c" >foo1
2515 echo $n "hi there$c" >foo2
2516 if cmp foo1 foo2 >/dev/null 2>&1; then
2517 echo "They are compatible. In fact, they may be identical."
2524 They are not compatible! You are probably running ksh on a non-USG system.
2525 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2526 have echo built in and we may have to run some Bourne shell scripts. That
2527 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2530 $echo $n "The star should be here-->$c"
2537 # This question was auctioned at YAPC::Europe-2007 in Vienna
2538 # I never promised you could answer it. I only auctioned the question.
2540 The following message is sponsored by
2542 Dresden.pm<--The stars should be here.
2544 Dear Perl user, system administrator or package
2545 maintainer, the Perl community sends greetings to
2546 you. Do you (emblematical) greet back [Y/n]? n
2550 : Check what type of C compiler we use
2554 cat <<'EOSC' >>trygcc
2559 int main(int argc, char *argv[]) {
2563 if $cc -o try $ccflags $ldflags try.c; then
2566 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2572 # Skip this test because it gives a false match on output like:
2573 # ./trygcc: line 23: cc: command not found
2574 # case "`$cc -v -c try.c 2>&1`" in
2575 # *gcc*) trygcc=no ;;
2577 if $test X"$trygcc" = Xyes; then
2578 if gcc -o try -c try.c; then
2580 echo "You seem to have a working gcc, though." >&4
2581 # Switching compilers may undo the work of hints files.
2582 # The most common problem is -D_REENTRANT for threads.
2583 # This heuristic catches that case, but gets false positives
2584 # if -Dusethreads was not actually specified. Better to
2585 # bail out here with a useful message than fail
2586 # mysteriously later. Should we perhaps just try to
2587 # re-invoke Configure -Dcc=gcc config_args ?
2588 if $test -f usethreads.cbu; then
2591 *** However, any setting of the C compiler flags (e.g. for thread support)
2592 *** will be lost. It may be necessary for you to restart Configure and
2593 *** add -Dcc=gcc to your Configure command line.
2596 rp="Would you like to go ahead and try gcc anyway?"
2599 rp="Would you like to use it?"
2602 if $test -f myread; then
2605 if $test -f UU/myread; then
2608 echo "Cannot find myread, sorry. Aborting." >&2
2613 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2626 cat <<'EOSC' >>checkcc
2631 int main(int argc, char *argv[]) {
2635 if $cc -o try $ccflags $ldflags try.c; then
2638 if $test X"$despair" = Xyes; then
2639 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2642 You need to find a working C compiler.
2643 Either (purchase and) install the C compiler supplied by your OS vendor,
2644 or for a free C compiler try http://gcc.gnu.org/
2645 I cannot continue any further, aborting.
2654 : determine whether symbolic links are supported
2657 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2658 echo "Symbolic links are supported." >&4
2661 echo "Symbolic links are NOT supported." >&4
2666 : determine whether symbolic links are supported
2670 echo "Checking how to test for symbolic links..." >&4
2672 if $test "X$issymlink" = X; then
2674 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2675 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2677 if test $? = 0; then
2680 echo "Your builtin 'test -h' may be broken." >&4
2683 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2686 if test -f "$p/$test"; then
2695 echo "Trying external '$test -h'." >&4
2696 issymlink="$test -h"
2697 if $test ! -h sym >/dev/null 2>&1; then
2698 echo "External '$test -h' is broken, too." >&4
2706 if $test "X$issymlink" = X; then
2707 if $test -L sym 2>/dev/null; then
2708 issymlink="$test -L"
2709 echo "The builtin '$test -L' worked." >&4
2712 if $test "X$issymlink" != X; then
2713 echo "You can test for symbolic links with '$issymlink'." >&4
2715 echo "I do not know how you can test for symbolic links." >&4
2719 *) echo "No symbolic links, so not testing for their testing..." >&4
2724 : Make symlinks util
2725 case "$mksymlinks" in
2728 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2731 *) case "$lns:$issymlink" in
2732 *"ln"*" -s:"*"test -"?)
2733 echo "Creating the symbolic links..." >&4
2734 echo "(First creating the subdirectories...)" >&4
2736 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2738 test -z "$directory" && break
2742 if test ! -d t/base; then
2743 echo "Failed to create the subdirectories. Aborting." >&4
2746 echo "(Then creating the symlinks...)" >&4
2747 awk '{print $1}' $src/MANIFEST | while true; do
2749 test -z "$filename" && break
2750 if test -f $filename; then
2751 if $issymlink $filename; then
2755 if test -f $filename; then
2756 echo "$filename already exists, not symlinking."
2758 ln -s $src/$filename $filename
2762 if test ! -f t/base/lex.t; then
2763 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2768 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2776 : Check for Cross-Compilation
2777 case "$usecrosscompile" in
2779 $echo "Cross-compiling..."
2782 *-*-gcc) # A cross-compiling gcc, probably.
2783 targetarch=`$echo $cc|$sed 's/-gcc$//'`
2785 # leave out ld, choosing it is more complex
2787 ranlib=$targetarch-ranlib
2788 $echo 'extern int foo;' > try.c
2789 set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
2791 if $test $# -gt 0; then
2793 incpth="`$echo $incpth|$sed 's/^ //'`"
2794 echo "Guessing incpth '$incpth'." >&4
2796 j="`$echo $i|$sed 's,/include$,/lib,'`"
2797 if $test -d $j; then
2801 libpth="`$echo $libpth|$sed 's/^ //'`"
2802 echo "Guessing libpth '$libpth'." >&4
2807 case "$targetarch" in
2808 '') echo "Targetarch not defined." >&4; croak=y ;;
2809 *) echo "Using targetarch $targetarch." >&4 ;;
2812 '') echo "Incpth not defined." >&4; croak=y ;;
2813 *) echo "Using incpth '$incpth'." >&4 ;;
2816 '') echo "Libpth not defined." >&4; croak=y ;;
2817 *) echo "Using libpth '$libpth'." >&4 ;;
2820 '') for i in $incpth; do
2821 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2823 echo "Guessing usrinc $usrinc." >&4
2828 '') echo "Usrinc not defined." >&4; croak=y ;;
2831 *) echo "Using usrinc $usrinc." >&4 ;;
2833 case "$targethost" in
2834 '') echo "Targethost not defined." >&4; croak=y ;;
2835 *) echo "Using targethost $targethost." >&4
2840 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2843 /*) run=$src/Cross/run
2844 targetmkdir=$src/Cross/mkdir
2846 from=$src/Cross/from
2848 *) pwd=`$test -f ../Configure & cd ..; pwd`
2850 targetmkdir=$pwd/Cross/mkdir
2852 from=$pwd/Cross/from
2855 case "$targetrun" in
2856 '') targetrun=ssh ;;
2861 case "$targetfrom" in
2862 '') targetfrom=scp ;;
2866 from=$from-$targetfrom
2867 case "$targetdir" in
2869 echo "Guessing targetdir $targetdir." >&4
2872 case "$targetuser" in
2874 echo "Guessing targetuser $targetuser." >&4
2877 case "$targetfrom" in
2881 case "$targetrun" in
2893 '') cwd=$targetdir ;;
2897 if $test ! -f \$exe.xok; then
2901 $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2904 *) echo "Unknown targetrun '$targetrun'" >&4
2908 case "$targetmkdir" in
2910 cat >$targetmkdir <<EOF
2912 $targetrun -l $targetuser $targethost "mkdir -p \$@"
2914 $chmod a+rx $targetmkdir
2916 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2928 $targetmkdir \`dirname \$f\`
2929 $targetto $q \$f $targetuser@$targethost:\$f || exit 1
2932 $targetmkdir $targetdir/\`dirname \$f\`
2933 $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2946 $mkdir -p $targetdir/\`dirname \$f\`
2947 $cp \$f $targetdir/\$f || exit 1
2950 $targetmkdir $targetdir/\`dirname \$f\`
2951 $cp \$f $targetdir/\$f || exit 1
2958 *) echo "Unknown targetto '$targetto'" >&4
2962 case "$targetfrom" in
2969 $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2974 cp) cat >$from <<EOF
2979 cp $targetdir/\$f . || exit 1
2984 *) echo "Unknown targetfrom '$targetfrom'" >&4
2988 if $test ! -f $run; then
2989 echo "Target 'run' script '$run' not found." >&4
2993 if $test ! -f $to; then
2994 echo "Target 'to' script '$to' not found." >&4
2998 if $test ! -f $from; then
2999 echo "Target 'from' script '$from' not found." >&4
3003 if $test ! -f $run -o ! -f $to -o ! -f $from; then
3007 Using '$run' for remote execution,
3008 and '$from' and '$to'
3009 for remote file transfer.
3015 usecrosscompile='undef'
3020 : see whether [:lower:] and [:upper:] are supported character classes
3022 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
3024 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
3028 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
3029 # (0xd9 and 0xe2), therefore that is a nice testing point.
3030 if test "X$up" = X -o "X$low" = X; then
3031 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
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 | od -x 2>/dev/null`" in
3047 echo "Hey, this might be EBCDIC." >&4
3048 if test "X$up" = X -o "X$low" = X; then
3049 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
3050 rs) up='[A-IJ-RS-Z]'
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
3066 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
3068 echo "Using $up and $low to convert case." >&4
3071 echo "I don't know how to translate letters from upper to lower case." >&4
3072 echo "Your tr is not acting any way I know of." >&4
3076 : set up the translation script tr, must be called with ./tr of course
3080 '[A-Z][a-z]') exec $tr '$up' '$low';;
3081 '[a-z][A-Z]') exec $tr '$low' '$up';;
3088 : Try to determine whether config.sh was made on this system
3089 case "$config_sh" in
3091 myuname=`$uname -a 2>/dev/null`
3092 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
3093 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
3094 # because the A-Z/a-z are not consecutive.
3095 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e "s,['/],,g" | \
3096 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
3097 newmyuname="$myuname"
3099 case "$knowitall" in
3101 if test -f ../config.sh; then
3102 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3103 eval "`grep myuname= ../config.sh`"
3105 if test "X$myuname" = "X$newmyuname"; then
3113 : Get old answers from old config file if Configure was run on the
3114 : same system, otherwise use the hints.
3117 if test -f config.sh; then
3119 rp="I see a config.sh file. Shall I use it to set the defaults?"
3122 n*|N*) echo "OK, I'll ignore it."
3123 mv config.sh config.sh.old
3124 myuname="$newmyuname"
3126 *) echo "Fetching default answers from your old config.sh file..." >&4
3134 : Older versions did not always set $sh. Catch re-use of such
3144 if test ! -f config.sh; then
3147 First time through, eh? I have some defaults handy for some systems
3148 that need some extra help getting the Configure answers right:
3151 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3153 : Half the following guesses are probably wrong... If you have better
3154 : tests or hints, please send them to perlbug@perl.org
3155 : The metaconfig authors would also appreciate a copy...
3156 $test -f /irix && osname=irix
3157 $test -f /xenix && osname=sco_xenix
3158 $test -f /dynix && osname=dynix
3159 $test -f /dnix && osname=dnix
3160 $test -f /lynx.os && osname=lynxos
3161 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3162 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3163 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3164 $test -f /bin/mips && /bin/mips && osname=mips
3165 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
3166 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
3167 $test -d /usr/apollo/bin && osname=apollo
3168 $test -f /etc/saf/_sactab && osname=svr4
3169 $test -d /usr/include/minix && osname=minix
3170 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3171 if $test -d /MachTen -o -d /MachTen_Folder; then
3173 if $test -x /sbin/version; then
3174 osvers=`/sbin/version | $awk '{print $2}' |
3175 $sed -e 's/[A-Za-z]$//'`
3176 elif $test -x /usr/etc/version; then
3177 osvers=`/usr/etc/version | $awk '{print $2}' |
3178 $sed -e 's/[A-Za-z]$//'`
3184 $test -f /sys/posix.dll &&
3185 $test -f /usr/bin/what &&
3186 set X `/usr/bin/what /sys/posix.dll` &&
3187 $test "$3" = UWIN &&
3191 if $test -f $uname; then
3199 umips) osname=umips ;;
3202 [23]100) osname=mips ;;
3203 next*) osname=next ;;
3205 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3206 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3209 elif $test -f /etc/kconfig; then
3211 if test "$lns" = "$ln -s"; then
3213 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3215 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3222 if test -n "$DJGPP"; then
3231 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3233 # oslevel can fail with:
3234 # oslevel: Unable to acquire lock.
3235 *not\ found) osvers="$4"."$3" ;;
3236 '<3240'|'<>3240') osvers=3.2.0 ;;
3237 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3238 '=3250'|'>3250') osvers=3.2.5 ;;
3242 bsd386) osname=bsd386
3245 cygwin*) osname=cygwin
3248 *dc.osx) osname=dcosx
3254 domainos) osname=apollo
3260 dragonfly) osname=dragonfly
3263 dynixptx*) osname=dynixptx
3264 osvers=`echo "$4"|sed 's/^v//'`
3266 freebsd) osname=freebsd
3268 genix) osname=genix ;;
3272 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3288 netbsd*) osname=netbsd
3291 news-os) osvers="$3"
3293 4*) osname=newsos4 ;;
3297 next*) osname=next ;;
3298 nonstop-ux) osname=nonstopux ;;
3299 openbsd) osname=openbsd
3305 POSIX-BC | posix-bc ) osname=posix-bc
3308 powerux | power_ux | powermax_os | powermaxos | \
3309 powerunix | power_unix) osname=powerux
3315 solaris) osname=solaris
3317 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3324 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3328 titanos) osname=titanos
3337 ultrix) osname=ultrix
3340 osf1|mls+) case "$5" in
3343 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3346 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3349 hp*) osname=hp_osf1 ;;
3350 mips) osname=mips_osf1 ;;
3353 # UnixWare 7.1.2 is known as Open UNIX 8
3354 openunix|unixware) osname=svr5
3362 $2) case "$osname" in
3366 : svr4.x or possibly later
3376 if test -f /stand/boot ; then
3377 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3378 if test -n "$INITPROG" -a -f "$INITPROG"; then
3379 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3380 if test -n "$isesix"; then
3388 *) if test -f /etc/systemid; then
3390 set `echo $3 | $sed 's/\./ /g'` $4
3391 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3393 elif $test -f $src/hints/sco_$1_$2.sh; then
3395 elif $test -f $src/hints/sco_$1.sh; then
3400 '') : Still unknown. Probably a generic Sys V.
3409 *) case "$osname" in
3410 '') : Still unknown. Probably a generic BSD.
3418 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3419 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3420 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3423 $rm -f UU/kernel.what
3424 elif test -d c:/. -o -n "$is_os2" ; then
3431 case "$targetarch" in
3434 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3439 : Now look for a hint file osname_osvers, unless one has been
3440 : specified already.
3443 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3444 : Also try without trailing minor version numbers.
3445 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3446 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3447 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3448 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3451 *) case "$osvers" in
3454 *) if $test -f $src/hints/$file.sh ; then
3456 elif $test -f $src/hints/$xfile.sh ; then
3458 elif $test -f $src/hints/$xxfile.sh ; then
3460 elif $test -f $src/hints/$xxxfile.sh ; then
3462 elif $test -f $src/hints/$xxxxfile.sh ; then
3464 elif $test -f "$src/hints/${osname}.sh" ; then
3473 if $test -f Policy.sh ; then
3476 none) dflt="Policy" ;;
3477 *) dflt="Policy $dflt" ;;
3482 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3486 if $test -f Policy.sh ; then
3489 There's also a Policy hint file available, which should make the
3490 site-specific (policy) questions easier to answer.
3497 You may give one or more space-separated answers, or "none" if appropriate.
3498 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3499 previous run of Configure, you may specify it as well as or instead of
3500 OS-specific hints. If hints are provided for your OS, you should use them:
3501 although Perl can probably be built without hints on many platforms, using
3502 hints often improve performance and may enable features that Configure can't
3503 set up on its own. If there are no hints that match your OS, specify "none";
3504 DO NOT give a wrong version or a wrong OS.
3508 rp="Which of these apply, if any?"
3511 for file in $tans; do
3512 if $test X$file = XPolicy -a -f Policy.sh; then
3514 $cat Policy.sh >> UU/config.sh
3515 elif $test -f $src/hints/$file.sh; then
3516 . $src/hints/$file.sh
3517 $cat $src/hints/$file.sh >> UU/config.sh
3518 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3521 : Give one chance to correct a possible typo.
3522 echo "$file.sh does not exist"
3524 rp="hint to use instead?"
3526 for file in $ans; do
3527 if $test -f "$src/hints/$file.sh"; then
3528 . $src/hints/$file.sh
3529 $cat $src/hints/$file.sh >> UU/config.sh
3530 elif $test X$ans = X -o X$ans = Xnone ; then
3533 echo "$file.sh does not exist -- ignored."
3540 : Remember our hint file for later.
3541 if $test -f "$src/hints/$file.sh" ; then
3551 echo "Fetching default answers from $config_sh..." >&4
3555 cp $config_sh config.sh 2>/dev/null
3565 test "$override" && . ./optdef.sh
3567 : Restore computed paths
3568 for file in $loclist $trylist; do
3569 eval $file="\$_$file"
3574 Configure uses the operating system name and version to set some defaults.
3575 The default value is probably right if the name rings a bell. Otherwise,
3576 since spelling matters for me, either accept the default or answer "none"
3583 ''|' '|none) dflt=none ;;
3584 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3587 *) dflt="$osname" ;;
3589 rp="Operating system name?"
3593 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3599 ''|' '|none) dflt=none ;;
3600 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3601 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3603 ''|' ') dflt=none ;;
3608 *) dflt="$osvers" ;;
3610 rp="Operating system version?"
3620 : who configured the system
3621 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3624 cf_by=`(logname) 2>/dev/null`
3627 cf_by=`(whoami) 2>/dev/null`
3629 "") cf_by=unknown ;;
3634 : decide how portable to be. Allow command line overrides.
3635 case "$d_portable" in
3637 *) d_portable="$define" ;;
3640 : set up shell script to do ~ expansion
3646 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3649 if $test -f /bin/csh; then
3650 /bin/csh -f -c "glob \$1"
3655 name=\`$expr x\$1 : '..\([^/]*\)'\`
3656 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3657 if $test ! -d "\$dir"; then
3659 echo "\$me: can't locate home directory for: \$name" >&2
3664 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3680 : now set up to get a file name
3684 cat <<'EOSC' >>getfile
3700 : getfile will accept an answer from the comma-separated list
3701 : enclosed in parentheses even if it does not meet other criteria.
3702 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3703 fn=`echo $fn | sed 's/(.*)//'`
3709 loc_file=`expr $fn : '.*:\(.*\)'`
3710 fn=`expr $fn : '\(.*\):.*'`
3718 */*) fullpath=true;;
3727 *e*) exp_file=true;;
3730 *p*) nopath_ok=true;;
3735 *d*) type='Directory';;
3736 *l*) type='Locate';;
3741 Locate) what='File';;
3746 case "$d_portable" in
3754 while test "$type"; do
3759 true) rp="$rp (~name ok)";;
3762 if test -f UU/getfile.ok && \
3763 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3782 value=`UU/filexp $ans`
3785 if test "$ans" != "$value"; then
3786 echo "(That expands to $value on this system.)"
3800 /*) value="$ansexp" ;;
3801 [a-zA-Z]:/*) value="$ansexp" ;;
3806 echo "I shall only accept a full path name, as in /bin/ls." >&4
3807 echo "Use a ! shell escape if you wish to check pathnames." >&4
3810 echo "Please give a full path name, starting with slash." >&4
3813 echo "Note that using ~name is ok provided it expands well." >&4
3826 for fp in $gfpth; do
3827 if test "X$fp" = X.; then
3832 if test -f "$pf"; then
3834 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3836 echo "($value is not a plain file, but that's ok.)"
3839 if test X"$type" = X; then
3846 for fp in $gfpth; do
3847 if test "X$fp" = X.; then
3852 direxp="$fp/$ansexp"
3854 if test -d "$direxp"; then
3862 if test -d "$ansexp"; then
3863 echo "(Looking for $loc_file in directory $value.)"
3864 value="$value/$loc_file"
3865 ansexp="$ansexp/$loc_file"
3867 if test -f "$ansexp"; then
3870 case "$nopath_ok" in
3871 true) case "$value" in
3873 *) echo "Assuming $value will be in people's path."
3889 if test "$fastread" = yes; then
3894 rp="$what $value doesn't exist. Use that name anyway?"
3913 test "X$gfpthkeep" != Xy && gfpth=""
3916 : determine root of directory hierarchy where package will be installed.
3919 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
3922 dflt=`echo "$prefix" | sed 's/.$//'`
3930 By default, $package will be installed in $dflt/bin, manual pages
3931 under $dflt/man, etc..., i.e. with $dflt as prefix for all
3932 installation directories. Typically this is something like /usr/local.
3933 If you wish to have binaries under /usr/bin but other parts of the
3934 installation under /usr/local, that's ok: you will be prompted
3935 separately for each of the installation directories, the prefix being
3936 only used to set the defaults.
3940 rp='Installation prefix to use?'
3948 *) oldprefix="$prefix";;
3955 : allow them to override the AFS root
3958 *) afsroot=$afsroot ;;
3964 $define|true) afs=true ;;
3965 $undef|false) afs=false ;;
3966 *) if $test -d $afsroot; then
3974 echo "AFS may be running... I'll be extra cautious then..." >&4
3976 echo "AFS does not seem to be running..." >&4
3979 : determine installation prefix for where package is to be installed.
3983 Since you are running AFS, I need to distinguish the directory in which
3984 files will reside from the directory in which they are installed (and from
3985 which they are presumably copied to the former directory by occult means).
3988 case "$installprefix" in
3989 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
3990 *) dflt="$installprefix";;
3995 In some special cases, particularly when building $package for distribution,
3996 it is convenient to distinguish the directory in which files should be
3997 installed from the directory ($prefix) in which they will
3998 eventually reside. For most users, these two directories are the same.
4001 case "$installprefix" in
4003 *) dflt=$installprefix;;
4007 rp='What installation prefix should I use for installing files?'
4009 installprefix="$ans"
4010 installprefixexp="$ansexp"
4012 : Perform the prefixexp/installprefixexp correction if necessary
4013 cat <<EOS >installprefix
4016 cat <<'EOSC' >>installprefix
4017 : Change installation prefix, if necessary.
4018 if $test X"$prefix" != X"$installprefix"; then
4019 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
4021 eval "install${prefixvar}=\"\$${prefixvar}exp\""
4024 chmod +x installprefix
4025 $eunicefix installprefix
4027 : Set variables such as privlib and privlibexp from the output of ./getfile
4028 : performing the prefixexp/installprefixexp correction if necessary.
4029 cat <<EOS >setprefixvar
4032 cat <<'EOSC' >>setprefixvar
4033 eval "${prefixvar}=\"\$ans\""
4034 eval "${prefixvar}exp=\"\$ansexp\""
4037 chmod +x setprefixvar
4038 $eunicefix setprefixvar
4040 : set up the script used to warn in case of inconsistency
4049 '') echo "The $hint value for \$$var on this machine was \"$was\"!" >&4
4051 *) echo "Hmm. Based on the hints in hints/$hintfile.sh, " >&4
4052 echo "the $hint value for \$$var on this machine was \"$was\"!" >&4
4057 echo "*** WHOA THERE!!! ***" >&4
4058 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
4061 rp=" Keep the $hint value?"
4064 y) td=$was; tu=$was;;
4068 : function used to set '$1' to '$val'
4069 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
4071 $define$undef) . ./whoa; eval "$var=\$td";;
4072 $undef$define) . ./whoa; eval "$var=\$tu";;
4073 *) eval "$var=$val";;
4076 : get the patchlevel
4078 echo "Getting the current patchlevel..." >&4
4079 if $test -r $rsrc/patchlevel.h;then
4080 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
4081 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4082 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4083 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4084 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4085 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4086 perl_patchlevel=`egrep ',"(MAINT|SMOKE)[0-9][0-9]*"' $rsrc/patchlevel.h|tail -1|sed 's/[^0-9]//g'`
4095 $echo "(You do not have patchlevel.h. Eek.)"
4097 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
4098 version_patchlevel_string="version $patchlevel subversion $subversion"
4099 case "$perl_patchlevel" in
4101 *) perl_patchlevel=`echo $perl_patchlevel | sed 's/.* //'`
4102 version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel"
4106 $echo "(You have $package $version_patchlevel_string.)"
4110 : XXX Should be a Configure test for double-dots in filenames.
4111 version=`echo $revision $patchlevel $subversion | \
4112 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4113 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4114 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4117 version=`echo $revision $patchlevel $subversion | \
4118 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4119 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4120 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4123 : Special case the 5.005_xx maintenance series, which used 5.005
4124 : without any subversion label as a subdirectory in $sitelib
4125 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4126 api_versionstring='5.005'
4129 : Do we want threads support and if so, what type
4130 case "$usethreads" in
4131 $define|true|[yY]*) dflt='y';;
4132 *) # Catch case where user specified ithreads or 5005threads but
4133 # forgot -Dusethreads (A.D. 4/2002)
4134 case "$useithreads$use5005threads" in
4135 *$define*) dflt='y';;
4142 Perl can be built to take advantage of threads on some systems.
4143 To do so, Configure can be run with -Dusethreads.
4145 Note that Perl built with threading support runs slightly slower
4146 and uses more memory than plain Perl. The current implementation
4147 is believed to be stable, but it is fairly new, and so should be
4148 treated with caution.
4150 If this doesn't make any sense to you, just accept the default '$dflt'.
4152 rp='Build a threading Perl?'
4155 y|Y) val="$define" ;;
4161 if $test $patchlevel -lt 9; then
4162 case "$usethreads" in
4166 Since release 5.6, Perl has had two different threading implementations,
4167 the newer interpreter-based version (ithreads) with one interpreter per
4168 thread, and the older 5.005 version (5005threads).
4169 The 5005threads version is effectively unmaintained and will probably be
4170 removed in Perl 5.10, so there should be no need to build a Perl using it
4171 unless needed for backwards compatibility with some existing 5.005threads
4175 : Default to ithreads unless overridden on command line or with
4178 case "$use5005threads" in
4179 $define|true|[yY]*) dflt='n';;
4181 case "$useithreads" in
4182 $undef|false|[nN]*) dflt='n';;
4184 rp='Use the newer interpreter-based ithreads?'
4187 y|Y) val="$define" ;;
4192 : Now set use5005threads to the opposite value.
4193 case "$useithreads" in
4194 $define) val="$undef" ;;
4201 useithreads="$undef"
4202 use5005threads="$undef"
4206 case "$useithreads$use5005threads" in
4210 You cannot have both the ithreads and the 5.005 threads enabled
4211 at the same time. Disabling the 5.005 threads since they are
4212 much less stable than the ithreads.
4215 use5005threads="$undef"
4220 : perl-5.9.x and later
4222 if test X"$usethreads" = "X$define"; then
4223 case "$use5005threads" in
4227 5.005 threads has been removed for 5.10. Perl will be built using ithreads.
4234 use5005threads="$undef"
4235 useithreads="$usethreads"
4238 case "$d_oldpthreads" in
4239 '') : Configure tests would be welcome here. For now, assume undef.
4241 *) val="$d_oldpthreads" ;;
4247 : Look for a hint-file generated 'call-back-unit'. If the
4248 : user has specified that a threading perl is to be built,
4249 : we may need to set or change some other defaults.
4250 if $test -f usethreads.cbu; then
4251 echo "Your platform has some specific hints regarding threaded builds, using them..."
4254 case "$usethreads" in
4255 "$define"|true|[yY]*)
4257 (Your platform does not have any specific hints for threaded builds.
4258 Assuming POSIX threads, then.)
4264 : Check if multiplicity is required
4267 Perl can be built so that multiple Perl interpreters can coexist
4268 within the same Perl executable.
4271 case "$useithreads" in
4274 This multiple interpreter support is required for interpreter-based threads.
4278 *) case "$usemultiplicity" in
4279 $define|true|[yY]*) dflt='y';;
4283 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4284 rp='Build Perl for multiplicity?'
4287 y|Y) val="$define" ;;
4295 : Check if morebits is requested
4296 case "$usemorebits" in
4297 "$define"|true|[yY]*)
4298 use64bitint="$define"
4299 uselongdouble="$define"
4300 usemorebits="$define"
4302 *) usemorebits="$undef"
4306 : Determine the C compiler to be used
4312 rp="Use which C compiler?"
4316 : See whether they have no cc but they do have gcc
4318 if $test -f cc.cbu; then
4323 : make some quick guesses about what we are up against
4325 $echo $n "Hmm... $c"
4335 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
4336 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
4338 echo "Looks kind of like an OSF/1 system, but we'll see..."
4340 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4341 xxx=`./loc addbib blurfl $pth`
4342 if $test -f $xxx; then
4343 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4347 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4348 echo "Looks kind of like an extended USG system, but we'll see..."
4350 echo "Looks kind of like a USG system, but we'll see..."
4354 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4355 echo "Looks kind of like a BSD system, but we'll see..."
4359 echo "Looks kind of like a Version 7 system, but we'll see..."
4362 case "$eunicefix" in
4365 There is, however, a strange, musty smell in the air that reminds me of
4366 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4370 : it so happens the Eunice I know will not run shell scripts in Unix format
4374 echo "Congratulations. You aren't running Eunice."
4378 : Detect OS2. The p_ variable is set above in the Head.U unit.
4379 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4380 : semicolon as a patch separator
4385 I have the feeling something is not exactly right, however...don't tell me...
4386 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4387 (Or you may be running DOS with DJGPP.)
4392 if test -f /xenix; then
4393 echo "Actually, this looks more like a XENIX system..."
4398 echo "It's not Xenix..."
4403 if test -f /venix; then
4404 echo "Actually, this looks more like a VENIX system..."
4411 echo "Nor is it Venix..."
4414 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4415 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4418 : Check if we are using GNU gcc and what its version is
4420 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4424 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4426 printf("%s\n", __VERSION__);
4428 printf("%s\n", "1");
4434 if $cc -o try $ccflags $ldflags try.c; then
4435 gccversion=`$run ./try`
4436 case "$gccversion" in
4437 '') echo "You are not using GNU cc." ;;
4438 *) echo "You are using GNU cc $gccversion."
4444 echo "*** WHOA THERE!!! ***" >&4
4445 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4446 case "$knowitall" in
4448 echo " You'd better start hunting for one and let me know about it." >&4
4454 case "$gccversion" in
4455 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4457 case "$gccversion" in
4458 '') gccosandvers='' ;;
4459 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4460 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4462 case "$gccosandvers" in
4463 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4464 $osname$osvers) ;; # looking good
4465 $osname*) cat <<EOM >&4
4467 *** WHOA THERE!!! ***
4469 Your gcc has not been compiled for the exact release of
4470 your operating system ($gccosandvers versus $osname$osvers).
4472 In general it is a good idea to keep gcc synchronized with
4473 the operating system because otherwise serious problems
4474 may ensue when trying to compile software, like Perl.
4476 I'm trying to be optimistic here, though, and will continue.
4477 If later during the configuration and build icky compilation
4478 problems appear (headerfile conflicts being the most common
4479 manifestation), I suggest reinstalling the gcc to match
4480 your operating system release.
4484 *) gccosandvers='' ;; # failed to parse, better be silent
4492 # gcc 3.* complain about adding -Idirectories that they already know about,
4493 # so we will take those off from locincpth.
4494 case "$gccversion" in
4496 echo "main(){}">try.c
4497 for incdir in $locincpth; do
4498 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4499 grep '^c[cp]p*[01]: warning: changing search order '`
4500 if test "X$warn" != X; then
4501 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4507 : What should the include directory be ?
4509 $echo $n "Hmm... $c"
4513 if $test -f /bin/mips && /bin/mips; then
4514 echo "Looks like a MIPS system..."
4515 $cat >usr.c <<'EOCP'
4516 #ifdef SYSTYPE_BSD43
4520 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4521 dflt='/bsd43/usr/include'
4525 mips_type='System V'
4527 $rm -f usr.c usr.out
4528 echo "and you're compiling with the $mips_type compiler and libraries."
4532 echo "Doesn't look like a MIPS system."
4542 case "$xxx_prompt" in
4545 rp='Where are the include files you want to use?'
4553 : see how we invoke the C preprocessor
4555 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4556 cat <<'EOT' >testcpp.c
4562 if test ! -f cppstdin; then
4563 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4564 # AIX cc -E doesn't show the absolute headerfile
4565 # locations but we'll cheat by using the -M flag.
4566 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
4568 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4571 echo "Keeping your $hint cppstdin wrapper."
4574 wrapper=`pwd`/cppstdin
4578 if $test "X$cppstdin" != "X" && \
4579 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4580 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4582 echo "You used to use $cppstdin $cppminus so we'll use that again."
4584 '') echo "But let's see if we can live without a wrapper..." ;;
4586 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4587 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4589 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4592 echo "(However, $cpprun $cpplast does not work, let's see...)"
4600 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4607 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4608 $cc -E <testcpp.c >testcpp.out 2>&1; \
4609 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4610 echo "Yup, it does."
4613 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4614 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4615 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4616 echo "Yup, it does."
4619 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4620 $cc -P <testcpp.c >testcpp.out 2>&1; \
4621 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4622 echo "Yipee, that works!"
4625 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4626 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4627 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4628 echo "At long last!"
4631 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4632 $cpp <testcpp.c >testcpp.out 2>&1; \
4633 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4637 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4638 $cpp - <testcpp.c >testcpp.out 2>&1; \
4639 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4640 echo "Hooray, it works! I was beginning to wonder."
4643 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4644 $wrapper <testcpp.c >testcpp.out 2>&1; \
4645 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4651 rp="No dice. I can't find a C preprocessor. Name one:"
4655 $x_cpp <testcpp.c >testcpp.out 2>&1
4656 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4657 echo "OK, that will do." >&4
4659 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4674 echo "Perhaps can we force $cc -E using a wrapper..."
4675 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4676 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4682 echo "Nope, we'll have to live without it..."
4696 "$wrapper"|'cppstdin') ;;
4697 *) $rm -f $wrapper;;
4699 $rm -f testcpp.c testcpp.out
4701 : Set private lib path
4704 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4709 '') dlist="$loclibpth $plibpth $glibpth";;
4710 *) dlist="$libpth";;
4713 : Now check and see which directories actually exist, avoiding duplicates
4717 if $test -d $xxx; then
4720 *) libpth="$libpth $xxx";;
4726 Some systems have incompatible or broken versions of libraries. Among
4727 the directories listed in the question below, please remove any you
4728 know not to be holding relevant libraries, and add any that are needed.
4729 Say "none" for none.
4740 rp="Directories to use for library searches?"
4747 : compute shared library extension
4750 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4760 On some systems, shared libraries may be available. Answer 'none' if
4761 you want to suppress searching of shared libraries for the remainder
4762 of this configuration.
4765 rp='What is the file extension used for shared libraries?'
4769 : Define several unixisms.
4770 : Hints files or command line option can be used to override them.
4771 : The convoluted testing is in case hints files set either the old
4774 '') case "$exe_ext" in
4776 *) _exe="$exe_ext" ;;
4781 '') case "$lib_ext" in
4788 '') case "$obj_ext" in
4795 '') case "$path_sep" in
4806 rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
4808 : Which makefile gets called first. This is used by make depend.
4809 case "$firstmakefile" in
4810 '') firstmakefile='makefile';;
4813 : Check is we will use socks
4815 $define|true|[yY]*) dflt='y';;
4820 Perl can be built to use the SOCKS proxy protocol library. To do so,
4821 Configure must be run with -Dusesocks. If you use SOCKS you also need
4822 to use the PerlIO abstraction layer, this will be implicitly selected.
4824 If this doesn't make any sense to you, just accept the default '$dflt'.
4826 rp='Build Perl for SOCKS?'
4829 y|Y) val="$define" ;;
4835 : Check for uselongdouble support
4837 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
4840 case "$uselongdouble" in
4841 $define|true|[yY]*) dflt='y';;
4846 Perl can be built to take advantage of long doubles which
4847 (if available) may give more accuracy and range for floating point numbers.
4849 If this doesn't make any sense to you, just accept the default '$dflt'.
4851 rp='Try to use long doubles if available?'
4854 y|Y) val="$define" ;;
4860 case "$uselongdouble" in
4861 true|[yY]*) uselongdouble="$define" ;;
4864 : Look for a hint-file generated 'call-back-unit'. If the
4865 : user has specified that long doubles should be used,
4866 : we may need to set or change some other defaults.
4867 if $test -f uselongdouble.cbu; then
4868 echo "Your platform has some specific hints regarding long doubles, using them..."
4869 . ./uselongdouble.cbu
4871 case "$uselongdouble" in
4874 (Your platform does not have any specific hints for long doubles.)
4880 : Looking for optional libraries
4882 echo "Checking for optional libraries..." >&4
4887 case "$libswanted" in
4888 '') libswanted='c_s';;
4891 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4897 for thisdir in $libpth $xlibpth; do
4898 test -d $thisdir && libspath="$libspath $thisdir"
4900 for thislib in $libswanted; do
4901 for thisdir in $libspath; do
4903 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4904 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
4905 $test -f "$xxx" && eval $libscheck
4906 $test -f "$xxx" && libstyle=shared
4908 if test ! -f "$xxx"; then
4909 xxx=$thisdir/lib$thislib.$so
4910 $test -f "$xxx" && eval $libscheck
4911 $test -f "$xxx" && libstyle=shared
4913 if test ! -f "$xxx"; then
4914 xxx=$thisdir/lib$thislib$_a
4915 $test -f "$xxx" && eval $libscheck
4916 $test -f "$xxx" && libstyle=static
4918 if test ! -f "$xxx"; then
4919 xxx=$thisdir/$thislib$_a
4920 $test -f "$xxx" && eval $libscheck
4921 $test -f "$xxx" && libstyle=static
4923 if test ! -f "$xxx"; then
4924 xxx=$thisdir/lib${thislib}_s$_a
4925 $test -f "$xxx" && eval $libscheck
4926 $test -f "$xxx" && libstyle=static
4927 $test -f "$xxx" && thislib=${thislib}_s
4929 if test ! -f "$xxx"; then
4930 xxx=$thisdir/Slib$thislib$_a
4931 $test -f "$xxx" && eval $libscheck
4932 $test -f "$xxx" && libstyle=static
4934 if $test -f "$xxx"; then
4936 shared) echo "Found -l$thislib (shared)." ;;
4937 static) echo "Found -l$thislib." ;;
4938 *) echo "Found -l$thislib ($libstyle)." ;;
4942 *) dflt="$dflt -l$thislib"
4943 libsfound="$libsfound $xxx"
4945 libsfiles="$libsfiles $yyy"
4946 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
4947 case " $libsdirs " in
4949 *) libsdirs="$libsdirs $yyy" ;;
4956 if $test ! -f "$xxx"; then
4957 echo "No -l$thislib."
4968 ' '|'') dflt='none';;
4973 In order to compile $package on your machine, a number of libraries
4974 are usually needed. Include any other special libraries here as well.
4975 Say "none" for none. The default list is almost always right.
4979 rp="What libraries to use?"
4986 : determine optimization, if desired, or use for debug flag also
4988 ' '|$undef) dflt='none';;
4990 *) dflt="$optimize";;
4994 By default, $package compiles with the -O flag to use the optimizer.
4995 Alternately, you might want to use the symbolic debugger, which uses
4996 the -g flag (on traditional Unix systems). Either flag can be
4997 specified here. To use neither flag, specify the word "none".
5000 rp="What optimizer/debugger flag should be used?"
5004 'none') optimize=" ";;
5007 : Check what DEBUGGING is required from the command line
5008 : -DEBUGGING or -DDEBUGGING or
5009 : -DEBUGGING=both = -g + -DDEBUGGING
5010 : -DEBUGGING=-g or -Doptimize=-g = -g
5011 : -DEBUGGING=none or -UDEBUGGING =
5012 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
5015 *) DEBUGGING=$EBUGGING ;;
5018 case "$DEBUGGING" in
5022 *) optimize="$optimize -g" ;;
5026 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
5034 case "$DEBUGGING" in
5035 both|$define) dflt='-DDEBUGGING'
5038 : argument order is deliberate, as the flag will start with - which set could
5039 : think is an option
5040 checkccflag='check=$1; flag=$2; callback=$3;
5042 echo "Checking if your compiler accepts $flag" 2>&1;
5043 echo "int main(void) { return 0; }" > gcctest.c;
5044 if $cc -O2 $flag -o gcctest gcctest.c 2>gcctest.out && ./gcctest; then
5045 echo "Yes, it does." 2>&1;
5046 if $test -s gcctest.out ; then
5047 echo "But your platform does not like it:";
5052 echo "Leaving current flags $ccflags alone." 2>&1
5054 *) dflt="$dflt $flag";
5060 echo "Nope, it does not, but that is ok." 2>&1;
5064 : We will not override a previous value, but we might want to
5065 : augment a hint file
5067 default|recommended)
5068 case "$gccversion" in
5069 1*) dflt="$dflt -fpcc-struct-return" ;;
5071 case "$optimize:$DEBUGGING" in
5072 *-g*:old) dflt="$dflt -DDEBUGGING";;
5074 case "$gccversion" in
5075 2*) if $test -d /etc/conf/kconfig.d &&
5076 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
5078 # Interactive Systems (ISC) POSIX mode.
5083 case "$gccversion" in
5086 ?*) set strict-aliasing -fno-strict-aliasing
5090 # For gcc, adding -pipe speeds up compilations for some, but apparently
5091 # some assemblers can't read from stdin. (It also slows down compilations
5092 # in other cases, but those are apparently rarer these days.) AD 5/2004.
5093 case "$gccversion" in
5099 # on x86_64 (at least) we require an extra library (libssp) in the
5100 # link command line. This library is not named, so I infer that it is
5101 # an implementation detail that may change. Hence the safest approach
5102 # is to add the flag to the flags passed to the compiler at link time,
5103 # as that way the compiler can do the right implementation dependant
5105 case "$gccversion" in
5106 ?*) set stack-protector -fstack-protector
5113 case "$mips_type" in
5114 *BSD*|'') inclwanted="$locincpth $usrinc";;
5115 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
5117 for thisincl in $inclwanted; do
5118 if $test -d $thisincl; then
5119 if $test x$thisincl != x$usrinc; then
5121 *" -I$thisincl "*);;
5122 *) dflt="$dflt -I$thisincl ";;
5128 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
5130 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5138 *) dflt="$dflt -D$2";;
5142 set signal.h LANGUAGE_C; eval $inctest
5146 ccflags="$ccflags -DSOCKS"
5151 default|recommended) dflt="$ccflags $dflt" ;;
5152 *) dflt="$ccflags";;
5161 Your C compiler may want other flags. For this question you should include
5162 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5163 but you should NOT include libraries or ld flags like -lwhatever. If you
5164 want $package to honor its debug switch, you should include -DDEBUGGING here.
5165 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5167 To use no flags, specify the word "none".
5173 rp="Any additional cc flags?"
5180 : the following weeds options from ccflags that are of no interest to cpp
5182 '') cppflags="$ccflags" ;;
5183 *) cppflags="$cppflags $ccflags" ;;
5185 case "$gccversion" in
5186 1*) cppflags="$cppflags -D__GNUC__"
5188 case "$mips_type" in
5190 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5196 echo "Let me guess what the preprocessor flags are..." >&4
5210 *) ftry="$previous $flag";;
5212 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5213 >cpp1.out 2>/dev/null && \
5214 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5215 >cpp2.out 2>/dev/null && \
5216 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5217 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5219 cppflags="$cppflags $ftry"
5229 *-*) echo "They appear to be: $cppflags";;
5231 $rm -f cpp.c cpp?.out
5235 : flags used in final linking phase
5237 '') if ./venix; then
5243 *-posix*) dflt="$dflt -posix" ;;
5246 *) dflt="$ldflags";;
5248 # See note above about -fstack-protector
5250 *-fstack-protector*)
5252 *-fstack-protector*) ;; # Don't add it again
5253 *) dflt="$dflt -fstack-protector" ;;
5258 : Try to guess additional flags to pick up local libraries.
5259 for thislibdir in $libpth; do
5260 case " $loclibpth " in
5263 *"-L$thislibdir "*) ;;
5264 *) dflt="$dflt -L$thislibdir" ;;
5276 Your C linker may need flags. For this question you should
5277 include -L/whatever and any other flags used by the C linker, but you
5278 should NOT include libraries like -lwhatever.
5280 Make sure you include the appropriate -L/path flags if your C linker
5281 does not normally search all of the directories you specified above,
5284 To use no flags, specify the word "none".
5288 rp="Any additional ld flags (NOT including libraries)?"
5294 rmlist="$rmlist pdp11"
5298 echo "Checking your choice of C compiler and flags for coherency..." >&4
5299 $cat > try.c <<'EOF'
5301 int main() { printf("Ok\n"); return(0); }
5303 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5305 $cat >try.msg <<'EOM'
5306 I've tried to compile and run the following simple program:
5309 $cat try.c >> try.msg
5311 $cat >> try.msg <<EOM
5318 and I got the following output:
5322 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5323 if $sh -c "$run ./try " >>try.msg 2>&1; then
5327 *) echo 'The program compiled OK, but produced no output.' >> try.msg
5330 cat >> try.msg <<'EOQS'
5331 If $libs contains -lsfio, and sfio is mis-configured, then it
5332 sometimes (apparently) runs and exits with a 0 status, but with no
5333 output! It may have to do with sfio's use of _exit vs. exit.
5336 rp="You have a big problem. Shall I abort Configure"
5343 echo "The program compiled OK, but exited with status $?." >>try.msg
5344 rp="You have a problem. Shall I abort Configure"
5348 echo "I can't compile the test program." >>try.msg
5349 rp="You have a BIG problem. Shall I abort Configure"
5355 case "$knowitall" in
5357 echo "(The supplied flags or libraries might be incorrect.)"
5365 *) echo "Ok. Stopping Configure." >&4
5370 n) echo "OK, that should do.";;
5372 $rm_try gcctest gcctest.out
5374 : define a shorthand compile call
5378 case "$usedevel" in $define|true|[yY]*) if $test ! -f "${mc_file}.c"; then
5379 echo "Internal Configure script bug - compiler test file ${mc_file}.c is missing. Please report this to perlbug@perl.org" >&4;
5383 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5384 : define a shorthand compile call for compilations that should be ok.
5388 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5390 : determine filename position in cpp output
5392 echo "Computing filename position in cpp output for #include directives..." >&4
5394 vos) testaccess=-e ;;
5397 echo '#include <stdio.h>' > foo.c
5400 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5401 $grep '^[ ]*#.*stdio\.h' | \
5402 while read cline; do
5405 while $test \$# -gt 0; do
5406 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5411 pos=\`expr \$pos + 1\`
5423 *) pos="${fieldn}th";;
5425 echo "Your cpp writes the filename in the $pos field of the line."
5428 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
5429 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
5432 : locate header file
5437 for usrincdir in $usrinc
5439 if test -f \$usrincdir/\$wanted; then
5440 echo "\$usrincdir/\$wanted"
5444 awkprg='{ print \$$fieldn }'
5445 echo "#include <\$wanted>" > foo\$\$.c
5446 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5447 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5448 while read cline; do
5449 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5451 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5452 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5457 # status = 0: grep returned 0 lines, case statement not executed
5458 # status = 1: headerfile found
5459 # status = 2: while loop executed, no headerfile found
5463 if test \$status -eq 1; then
5470 : define an alternate in-header-list? function
5471 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5472 cont=true; xxf="echo \"<\$1> found.\" >&4";
5473 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5474 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5476 case $# in 4) instead=instead;; *) instead="at last";; esac;
5477 while $test "$cont"; do
5479 var=$2; eval "was=\$$2";
5480 if $test "$xxx" && $test -r "$xxx";
5482 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5485 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5486 set $yyy; shift; shift; yyy=$@;
5487 case $# in 0) cont="";;
5488 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5489 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5490 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5491 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5495 do set $yyy; var=$2; eval "was=\$$2";
5496 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5497 set $yyy; shift; shift; yyy=$@;
5500 : see if stdlib is available
5501 set stdlib.h i_stdlib
5504 : check for lengths of integral types
5508 echo "Checking to see how big your integers are..." >&4
5517 printf("intsize=%d;\n", (int)sizeof(int));
5518 printf("longsize=%d;\n", (int)sizeof(long));
5519 printf("shortsize=%d;\n", (int)sizeof(short));
5524 if eval $compile_ok && $run ./try > /dev/null; then
5526 echo "Your integers are $intsize bytes long."
5527 echo "Your long integers are $longsize bytes long."
5528 echo "Your short integers are $shortsize bytes long."
5532 Help! I can't compile and run the intsize test program: please enlighten me!
5533 (This is probably a misconfiguration in your system or libraries, and
5534 you really ought to fix it. Still, I'll try anyway.)
5538 rp="What is the size of an integer (in bytes)?"
5542 rp="What is the size of a long integer (in bytes)?"
5546 rp="What is the size of a short integer (in bytes)?"
5554 : check for long long
5556 echo "Checking to see if you have long long..." >&4
5557 echo 'int main() { long long x = 7; return 0; }' > try.c
5559 if eval $compile; then
5561 echo "You have long long."
5564 echo "You do not have long long."
5570 : check for length of long long
5571 case "${d_longlong}${longlongsize}" in
5574 echo "Checking to see how big your long longs are..." >&4
5575 $cat >try.c <<'EOCP'
5579 printf("%d\n", (int)sizeof(long long));
5584 if eval $compile_ok; then
5585 longlongsize=`$run ./try`
5586 echo "Your long longs are $longlongsize bytes long."
5590 echo "(I can't seem to compile the test program. Guessing...)"
5591 rp="What is the size of a long long (in bytes)?"
5595 if $test "X$longsize" = "X$longlongsize"; then
5596 echo "(That isn't any different from an ordinary long.)"
5602 : see if inttypes.h is available
5603 : we want a real compile instead of Inhdr because some systems
5604 : have an inttypes.h which includes non-existent headers
5607 #include <inttypes.h>
5609 static int32_t foo32 = 0x12345678;
5613 if eval $compile; then
5614 echo "<inttypes.h> found." >&4
5617 echo "<inttypes.h> NOT found." >&4
5626 echo "Checking to see if you have int64_t..." >&4
5628 #include <sys/types.h>
5629 #$i_inttypes I_INTTYPES
5631 #include <inttypes.h>
5633 int main() { int64_t x = 7; }
5636 if eval $compile; then
5638 echo "You have int64_t."
5641 echo "You do not have int64_t."
5647 : Check if 64bit ints have a quad type
5649 echo "Checking which 64-bit integer type we could use..." >&4
5655 val='"unsigned int"'
5660 *) case "$longsize" in
5664 val='"unsigned long"'
5669 *) case "$d_longlong:$longlongsize" in
5674 val='"unsigned long long"'
5679 *) case "$d_int64_t" in
5698 '') echo "Alas, no 64-bit integer types in sight." >&4
5701 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5706 : Do we want 64bit support
5707 case "$uselonglong" in
5708 "$define"|true|[yY]*)
5711 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5713 use64bitint="$define"
5716 case "$use64bits" in
5717 "$define"|true|[yY]*)
5720 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5722 use64bitint="$define"
5725 case "$use64bitints" in
5726 "$define"|true|[yY]*)
5729 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5731 use64bitint="$define"
5734 case "$use64bitsint" in
5735 "$define"|true|[yY]*)
5738 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5740 use64bitint="$define"
5743 case "$uselonglongs" in
5744 "$define"|true|[yY]*)
5747 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5749 use64bitint="$define"
5752 case "$use64bitsall" in
5753 "$define"|true|[yY]*)
5756 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
5758 use64bitall="$define"
5763 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
5765 case "$use64bitall" in
5766 "$define"|true|[yY]*) use64bitint="$define" ;;
5772 You have natively 64-bit long integers.
5776 *) case "$use64bitint" in
5777 "$define"|true|[yY]*) dflt='y';;
5786 Perl can be built to take advantage of 64-bit integer types
5787 on some systems. To do so, Configure can be run with -Duse64bitint.
5788 Choosing this option will most probably introduce binary incompatibilities.
5790 If this doesn't make any sense to you, just accept the default '$dflt'.
5791 (The default has been chosen based on your configuration.)
5793 rp='Try to use 64-bit integers, if available?'
5796 [yY]*) val="$define" ;;
5804 case "$use64bitall" in
5805 "$define"|true|[yY]*) dflt='y' ;;
5806 *) case "$longsize" in
5814 You may also choose to try maximal 64-bitness. It means using as much
5815 64-bitness as possible on the platform. This in turn means even more
5816 binary incompatibilities. On the other hand, your platform may not
5817 have any more 64-bitness available than what you already have chosen.
5819 If this doesn't make any sense to you, just accept the default '$dflt'.
5820 (The default has been chosen based on your configuration.)
5822 rp='Try to use maximal 64-bit support, if available?'
5825 [yY]*) val="$define" ;;
5830 case "$use64bitall" in
5832 case "$use64bitint" in
5836 Since you have chosen a maximally 64-bit build, I'm also turning on
5837 the use of 64-bit integers.
5839 use64bitint="$define" ;;
5844 : Look for a hint-file generated 'call-back-unit'. If the
5845 : user has specified that a 64-bit perl is to be built,
5846 : we may need to set or change some other defaults.
5847 if $test -f use64bitint.cbu; then
5848 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
5851 case "$use64bitint" in
5852 "$define"|true|[yY]*)
5854 4) case "$archname64" in
5855 '') archname64=64int ;;
5862 : Look for a hint-file generated 'call-back-unit'. If the
5863 : user has specified that a maximally 64-bit perl is to be built,
5864 : we may need to set or change some other defaults.
5865 if $test -f use64bitall.cbu; then
5866 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
5869 case "$use64bitall" in
5870 "$define"|true|[yY]*)
5872 4) case "$archname64" in
5873 ''|64int) archname64=64all ;;
5880 case "$d_quad:$use64bitint" in
5884 *** You have chosen to use 64-bit integers,
5885 *** but none can be found.
5886 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
5887 *** Cannot continue, aborting.
5894 : check for length of double
5896 case "$doublesize" in
5898 echo "Checking to see how big your double precision numbers are..." >&4
5907 printf("%d\n", (int)sizeof(double));
5912 if eval $compile_ok; then
5913 doublesize=`$run ./try`
5914 echo "Your double is $doublesize bytes long."
5917 echo "(I can't seem to compile the test program. Guessing...)"
5918 rp="What is the size of a double precision number (in bytes)?"
5926 : check for long doubles
5928 echo "Checking to see if you have long double..." >&4
5929 echo 'int main() { long double x = 7.0; }' > try.c
5931 if eval $compile; then
5933 echo "You have long double."
5936 echo "You do not have long double."
5942 : check for length of long double
5943 case "${d_longdbl}${longdblsize}" in
5946 echo "Checking to see how big your long doubles are..." >&4
5947 $cat >try.c <<'EOCP'
5951 printf("%d\n", sizeof(long double));
5956 if eval $compile; then
5957 longdblsize=`$run ./try`
5958 echo "Your long doubles are $longdblsize bytes long."
5962 echo "(I can't seem to compile the test program. Guessing...)" >&4
5963 rp="What is the size of a long double (in bytes)?"
5967 if $test "X$doublesize" = "X$longdblsize"; then
5968 echo "That isn't any different from an ordinary double."
5969 echo "I'll keep your setting anyway, but you may see some"
5970 echo "harmless compilation warnings."
5976 : determine the architecture name
5978 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
5979 tarch=`arch`"-$osname"
5980 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
5981 if uname -m > tmparch 2>&1 ; then
5982 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
5983 -e 's/$/'"-$osname/" tmparch`
5991 case "$myarchname" in
5994 echo "(Your architecture name used to be $myarchname.)"
5998 case "$targetarch" in
6000 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
6005 *) dflt="$archname";;
6007 rp='What is your architecture name'
6010 case "$usethreads" in
6012 echo "Threads selected." >&4
6014 *-thread*) echo "...and architecture name already has -thread." >&4
6016 *) archname="$archname-thread"
6017 echo "...setting architecture name to $archname." >&4
6022 case "$usemultiplicity" in
6024 echo "Multiplicity selected." >&4
6026 *-multi*) echo "...and architecture name already has -multi." >&4
6028 *) archname="$archname-multi"
6029 echo "...setting architecture name to $archname." >&4
6034 case "$use64bitint$use64bitall" in
6036 case "$archname64" in
6038 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
6041 case "$use64bitint" in
6042 "$define") echo "64 bit integers selected." >&4 ;;
6044 case "$use64bitall" in
6045 "$define") echo "Maximal 64 bitness selected." >&4 ;;
6048 *-$archname64*) echo "...and architecture name already has $archname64." >&4
6050 *) archname="$archname-$archname64"
6051 echo "...setting architecture name to $archname." >&4
6057 case "$uselongdouble" in
6059 echo "Long doubles selected." >&4
6060 case "$longdblsize" in
6062 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
6066 *-ld*) echo "...and architecture name already has -ld." >&4
6068 *) archname="$archname-ld"
6069 echo "...setting architecture name to $archname." >&4
6076 if $test -f archname.cbu; then
6077 echo "Your platform has some specific hints for architecture name, using them..."
6081 : set the prefixit variable, to compute a suitable default value
6082 prefixit='case "$3" in
6084 case "$oldprefix" in
6085 "") eval "$1=\"\$$2\"";;
6092 ""|" ") eval "$1=\"\$$2\"";;
6098 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
6100 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
6101 /*-$oldprefix/*|\~*-$oldprefix/*)
6102 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
6103 *) eval "$1=\"\$$2\"";;
6107 : determine installation style
6108 : For now, try to deduce it from prefix unless it is already set.
6109 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
6110 case "$installstyle" in
6111 '') case "$prefix" in
6112 *perl*) dflt='lib';;
6113 *) dflt='lib/perl5' ;;
6116 *) dflt="$installstyle" ;;
6118 : Probably not worth prompting for this since we prompt for all
6119 : the directories individually, and the prompt would be too long and
6123 : determine where public executables go
6128 rp='Pathname where the public executables will reside?'
6130 if $test "X$ansexp" != "X$binexp"; then
6134 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6135 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
6136 : this via initialinstalllocation
6139 case "$userelocatableinc" in
6140 $define|true|[yY]*) dflt='y' ;;
6145 Would you like to build Perl so that the installation is relocatable, so that
6146 library paths in @INC are determined relative to the path of the perl binary?
6147 This is not advised for system Perl installs, or if you need to run setid
6148 scripts or scripts under taint mode.
6150 If this doesn't make any sense to you, just accept the default '$dflt'.
6152 rp='Use relocatable @INC?'
6155 y|Y) val="$define" ;;
6158 set userelocatableinc
6161 initialinstalllocation="$binexp"
6162 : Default prefix is now "up one level from where the binaries are"
6163 case "$userelocatableinc" in
6169 installprefixexp=".../.."
6173 : determine where private library files go
6174 : Usual default is /usr/local/lib/perl5/$version.
6175 : Also allow things like /opt/perl/lib/$version, since
6176 : /opt/perl/lib/perl5... would be redundant.
6177 : The default "style" setting is made in installstyle.U
6178 case "$installstyle" in
6179 *lib/perl5*) set dflt privlib lib/$package/$version ;;
6180 *) set dflt privlib lib/$version ;;
6185 There are some auxiliary files for $package that need to be put into a
6186 private library directory that is accessible by everyone.
6191 rp='Pathname where the private library files will reside?'
6196 : set the prefixup variable, to restore leading tilda escape
6197 prefixup='case "$prefixexp" in
6199 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
6202 : determine where public architecture dependent libraries go
6205 : privlib default is /usr/local/lib/$package/$version
6206 : archlib default is /usr/local/lib/$package/$version/$archname
6207 : privlib may have an optional trailing /share.
6208 tdflt=`echo $privlib | $sed 's,/share$,,'`
6209 tdflt=$tdflt/$archname
6218 $spackage contains architecture-dependent library files. If you are
6219 sharing libraries in a heterogeneous environment, you might store
6220 these files in a separate location. Otherwise, you can just include
6221 them with the rest of the public library files.
6226 rp='Where do you want to put the public architecture-dependent libraries?'
6230 if $test X"$archlib" = X"$privlib"; then
6236 : see if setuid scripts can be secure
6239 Some kernels have a bug that prevents setuid #! scripts from being
6240 secure. Some sites have disabled setuid #! scripts because of this.
6242 First let's decide if your kernel supports secure setuid #! scripts.
6243 (If setuid #! scripts would be secure but have been disabled anyway,
6244 don't say that they are secure if asked.)
6249 if $test -d /dev/fd; then
6250 echo "#!$ls" >reflect
6251 chmod +x,u+s reflect
6252 ./reflect >flect 2>&1
6253 if $contains "/dev/fd" flect >/dev/null; then
6254 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6258 If you are not sure if they are secure, I can check but I'll need a
6259 username and password different from the one you are using right now.
6260 If you don't have such a username or don't want me to test, simply
6264 rp='Other username to test security of setuid scripts with?'
6269 case "$d_suidsafe" in
6270 '') echo "I'll assume setuid scripts are *not* secure." >&4
6273 echo "Well, the $hint value is *not* secure." >&4
6275 *) echo "Well, the $hint value *is* secure." >&4
6280 $rm -f reflect flect
6281 echo "#!$ls" >reflect
6282 chmod +x,u+s reflect
6285 echo '"su" will (probably) prompt you for '"$ans's password."
6286 su $ans -c './reflect >flect'
6287 if $contains "/dev/fd" flect >/dev/null; then
6288 echo "Okay, it looks like setuid scripts are secure." >&4
6291 echo "I don't think setuid scripts are secure." >&4
6296 rp='Does your kernel have *secure* setuid scripts?'
6299 [yY]*) val="$define";;
6304 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6305 echo "(That's for file descriptors, not floppy disks.)"
6311 $rm -f reflect flect
6313 : now see if they want to do setuid emulation
6314 if $test $patchlevel -lt 11; then
6317 case "$d_suidsafe" in
6320 echo "No need to emulate SUID scripts since they are secure here." >&4
6324 Some systems have disabled setuid scripts, especially systems where
6325 setuid scripts cannot be secure. On systems where setuid scripts have
6326 been disabled, the setuid/setgid bits on scripts are currently
6327 useless. It is possible for $package to detect those bits and emulate
6328 setuid/setgid in a secure fashion. This emulation will only work if
6329 setuid scripts have been disabled in your kernel.
6333 "$define") dflt=y ;;
6336 rp="Do you want to do setuid/setgid emulation?"
6339 [yY]*) val="$define";;
6351 SUID emulation has been removed for 5.12
6352 Please re-run Configure without -Dd_dosuid
6361 : Find perl5.005 or later.
6362 echo "Looking for a previously installed perl5.005 or later... "
6364 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
6365 : Check if this perl is recent and can load a simple module
6366 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6369 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6379 '') echo "None found. That's ok.";;
6380 *) echo "Using $perl5." ;;
6383 : Set the siteprefix variables
6386 After $package is installed, you may wish to install various
6387 add-on modules and utilities. Typically, these add-ons will
6388 be installed under $prefix with the rest
6389 of this package. However, you may wish to install such add-ons
6390 elsewhere under a different prefix.
6392 If you do not wish to put everything under a single prefix, that's
6393 ok. You will be prompted for the individual locations; this siteprefix
6394 is only used to suggest the defaults.
6396 The default should be fine for most people.
6400 rp='Installation prefix to use for add-on modules and utilities?'
6401 : XXX Here might be another good place for an installstyle setting.
6402 case "$siteprefix" in
6404 *) dflt=$siteprefix ;;
6407 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6409 case "$siteprefix" in
6413 *) oldsiteprefix="$prefix";;
6418 siteprefixexp="$ansexp"
6420 : determine where site specific libraries go.
6421 : Usual default is /usr/local/lib/perl5/site_perl/$version
6422 : The default "style" setting is made in installstyle.U
6423 : XXX No longer works with Prefixit stuff.
6424 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6426 '') case "$installstyle" in
6427 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6428 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6436 The installation process will create a directory for
6437 site-specific extensions and modules. Most users find it convenient
6438 to place all site-specific files in this directory rather than in the
6439 main distribution directory.
6443 rp='Pathname for the site-specific library files?'
6447 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6449 : Determine list of previous versions to include in @INC
6450 $cat > getverlist <<EOPL
6453 \$api_versionstring = "$api_versionstring";
6454 \$version = "$version";
6455 \$stem = "$sitelib_stem";
6456 \$archname = "$archname";
6458 $cat >> getverlist <<'EOPL'
6459 # The list found is store twice for each entry: the original name, and
6460 # the binary broken down version as pack "sss", so sorting is easy and
6461 # unambiguous. This will work for all versions that have a maximum of
6462 # three digit groups, separate by '.'s or '_'s. Names are extended with
6463 # ".0.0" to ensure at least three elements for the pack.
6464 # -- H.Merijn Brand (m)'06 23-10-2006
6466 # Can't have leading @ because metaconfig interprets it as a command!
6467 ;@inc_version_list=();
6468 # XXX Redo to do opendir/readdir?
6471 ;@candidates = map {
6472 [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
6473 ;@candidates = sort { $a->[1] cmp $b->[1]} @candidates;
6479 ($pversion, $aversion, $vsn5005) = map {
6480 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
6481 foreach $d (@candidates) {
6482 if ($d->[1] lt $pversion) {
6483 if ($d->[1] ge $aversion) {
6484 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
6486 elsif ($d->[1] ge $vsn5005) {
6487 unshift(@inc_version_list, grep { -d } $d->[0]);
6491 # Skip newer version. I.e. don't look in
6492 # 5.7.0 if we're installing 5.6.1.
6496 if (@inc_version_list) {
6497 print join(' ', @inc_version_list);
6500 # Blank space to preserve value for next Configure run.
6505 case "$inc_version_list" in
6506 '') if test -x "$perl5$exe_ext"; then
6507 dflt=`$perl5 getverlist`
6512 $undef) dflt='none' ;;
6513 *) eval dflt=\"$inc_version_list\" ;;
6516 ''|' ') dflt=none ;;
6523 In order to ease the process of upgrading, this version of perl
6524 can be configured to use modules built and installed with earlier
6525 versions of perl that were installed under $prefix. Specify here
6526 the list of earlier versions that this version of perl should check.
6527 If Configure detected no earlier versions of perl installed under
6528 $prefix, then the list will be empty. Answer 'none' to tell perl
6529 to not search earlier versions.
6531 The default should almost always be sensible, so if you're not sure,
6532 just accept the default.
6535 rp='List of earlier versions to include in @INC?'
6538 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
6539 *) inc_version_list="$ans" ;;
6541 case "$inc_version_list" in
6543 inc_version_list_init='0'
6544 d_inc_version_list="$undef"
6546 *) inc_version_list_init=`echo $inc_version_list |
6547 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6548 d_inc_version_list="$define"
6553 : see if malloc/malloc.h has to be included
6554 set malloc/malloc.h i_mallocmalloc
6557 : see if this is a malloc.h system
6558 : we want a real compile instead of Inhdr because some systems have a
6559 : malloc.h that just gives a compile error saying to use stdlib.h instead
6564 #$i_mallocmalloc I_MALLOCMALLOC
6565 #ifdef I_MALLOCMALLOC
6566 # include <malloc/malloc.h>
6569 int main () { return 0; }
6572 if eval $compile; then
6573 echo "<malloc.h> found." >&4
6576 echo "<malloc.h> NOT found." >&4
6583 : check for void type
6585 echo "Checking to see how well your C compiler groks the void type..." >&4
6586 case "$voidflags" in
6598 extern void moo(); /* function returning void */
6599 void (*goo)(); /* ptr to func returning void */
6601 void *hue; /* generic ptr */
6614 int main() { sub(); }
6616 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
6617 voidflags=$defvoidused
6618 echo "Good. It appears to support void to the level $package wants.">&4
6619 if $contains warning .out >/dev/null 2>&1; then
6620 echo "However, you might get some warnings that look like this:"
6624 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
6625 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
6626 echo "It supports 1..."
6627 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
6628 echo "It also supports 2..."
6629 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
6631 echo "And it supports 4 but not 8 definitely."
6633 echo "It doesn't support 4..."
6634 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
6636 echo "But it supports 8."
6639 echo "Neither does it support 8."
6643 echo "It does not support 2..."
6644 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
6646 echo "But it supports 4 and 8."
6648 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
6650 echo "And it supports 4 but has not heard about 8."
6652 echo "However it supports 8 but not 4."
6657 echo "There is no support at all for void."
6662 case "$voidflags" in
6665 Support flag bits are:
6666 1: basic void declarations.
6667 2: arrays of pointers to functions returning void.
6668 4: operations between pointers to and addresses of void functions.
6669 8: generic void pointers.
6672 rp="Your void support flags add up to what?"
6679 : check for length of pointer
6683 echo "Checking to see how big your pointers are..." >&4
6684 if test "$voidflags" -gt 7; then
6685 echo '#define VOID_PTR char *' > try.c
6687 echo '#define VOID_PTR void *' > try.c
6697 printf("%d\n", (int)sizeof(VOID_PTR));
6702 if eval $compile_ok; then
6703 ptrsize=`$run ./try`
6704 echo "Your pointers are $ptrsize bytes long."
6707 echo "(I can't seem to compile the test program. Guessing...)" >&4
6708 rp="What is the size of a pointer (in bytes)?"
6715 case "$use64bitall" in
6716 "$define"|true|[yY]*)
6720 *** You have chosen a maximally 64-bit build,
6721 *** but your pointers are only 4 bytes wide.
6722 *** Please rerun Configure without -Duse64bitall.
6727 *** Since you have quads, you could possibly try with -Duse64bitint.
6732 *** Cannot continue, aborting.
6743 : determine whether to use malloc wrapping
6745 case "$usemallocwrap" in
6746 [yY]*|true|$define) dflt='y' ;;
6747 [nN]*|false|$undef) dflt='n' ;;
6748 *) case "$usedevel" in
6749 [yY]*|true|$define) dflt='y' ;;
6754 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
6756 usemallocwrap="$ans"
6759 usemallocwrap="$define" ;;
6761 usemallocwrap="$undef" ;;
6764 : determine which malloc to compile in
6766 case "$usemymalloc" in
6767 [yY]*|true|$define) dflt='y' ;;
6768 [nN]*|false|$undef) dflt='n' ;;
6769 *) case "$ptrsize" in
6775 rp="Do you wish to attempt to use the malloc that comes with $package?"
6781 mallocsrc='malloc.c'
6782 mallocobj="malloc$_o"
6783 d_mymalloc="$define"
6786 : Remove malloc from list of libraries to use
6787 echo "Removing unneeded -lmalloc from library list" >&4
6788 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6791 echo "libs = $libs" >&4
6803 : compute the return types of malloc and free
6805 $cat >malloc.c <<END
6809 #include <sys/types.h>
6823 case "$malloctype" in
6825 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6832 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6836 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6843 echo "Your system uses $freetype free(), it would seem." >&4
6845 : determine where site specific architecture-dependent libraries go.
6846 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6847 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6848 : sitelib may have an optional trailing /share.
6850 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6851 dflt="$dflt/$archname"
6856 set sitearch sitearch none
6860 The installation process will also create a directory for
6861 architecture-dependent site-specific extensions and modules.
6865 rp='Pathname for the site-specific architecture-dependent library files?'
6869 if $test X"$sitearch" = X"$sitelib"; then
6872 d_sitearch="$define"
6875 : Set the vendorprefix variables
6878 The installation process will also create a directory for
6879 vendor-supplied add-ons. Vendors who supply perl with their system
6880 may find it convenient to place all vendor-supplied files in this
6881 directory rather than in the main distribution directory. This will
6882 ease upgrades between binary-compatible maintenance versions of perl.
6884 Of course you may also use these directories in whatever way you see
6885 fit. For example, you might use them to access modules shared over a
6886 company-wide network.
6888 The default answer should be fine for most people.
6889 This causes further questions about vendor add-ons to be skipped
6890 and no vendor-specific directories will be configured for perl.
6893 rp='Do you want to configure vendor-specific add-on directories?'
6894 case "$usevendorprefix" in
6895 define|true|[yY]*) dflt=y ;;
6896 *) : User may have set vendorprefix directly on Configure command line.
6897 case "$vendorprefix" in
6906 rp='Installation prefix to use for vendor-supplied add-ons?'
6907 case "$vendorprefix" in
6909 *) dflt=$vendorprefix ;;
6912 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6914 case "$vendorprefix" in
6918 *) oldvendorprefix="$prefix";;
6922 usevendorprefix="$define"
6924 vendorprefixexp="$ansexp"
6926 *) usevendorprefix="$undef"
6932 : Set the vendorlib variables
6933 case "$vendorprefix" in
6934 '') d_vendorlib="$undef"
6938 *) d_vendorlib="$define"
6939 : determine where vendor-supplied modules go.
6940 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
6941 case "$vendorlib" in
6943 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6944 case "$installstyle" in
6945 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
6946 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
6949 *) dflt="$vendorlib"
6953 rp='Pathname for the vendor-supplied library files?'
6956 vendorlibexp="$ansexp"
6959 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
6963 : Set the vendorarch variables
6964 case "$vendorprefix" in
6965 '') d_vendorarch="$undef"
6969 *) d_vendorarch="$define"
6970 : determine where vendor-supplied architecture-dependent libraries go.
6971 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
6972 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
6973 : vendorlib may have an optional trailing /share.
6974 case "$vendorarch" in
6975 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
6976 dflt="$dflt/$archname"
6978 *) dflt="$vendorarch" ;;
6981 rp='Pathname for vendor-supplied architecture-dependent files?'
6984 vendorarchexp="$ansexp"
6987 prefixvar=vendorarch
6989 if $test X"$vendorarch" = X"$vendorlib"; then
6990 d_vendorarch="$undef"
6992 d_vendorarch="$define"
6995 : Final catch-all directories to search
6998 Lastly, you can have perl look in other directories for extensions and
6999 modules in addition to those already specified.
7000 These directories will be searched after
7004 test X"$vendorlib" != "X" && echo ' ' $vendorlib
7005 test X"$vendorarch" != "X" && echo ' ' $vendorarch
7007 case "$otherlibdirs" in
7008 ''|' ') dflt='none' ;;
7009 *) dflt="$otherlibdirs" ;;
7012 Enter a colon-separated set of extra paths to include in perl's @INC
7013 search path, or enter 'none' for no extra paths.
7017 rp='Colon-separated list of additional directories for perl to search?'
7020 ' '|''|none) otherlibdirs=' ' ;;
7021 *) otherlibdirs="$ans" ;;
7023 case "$otherlibdirs" in
7027 set d_perl_otherlibdirs
7030 : Cruising for prototypes
7032 echo "Checking out function prototypes..." >&4
7033 $cat >prototype.c <<EOCP
7038 int main(int argc, char *argv[]) {
7041 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
7042 echo "Your C compiler appears to support function prototypes."
7045 echo "Your C compiler doesn't seem to understand function prototypes."
7052 : Check if ansi2knr is required
7053 case "$prototype" in
7055 *) ansi2knr='ansi2knr'
7060 This version of $package can only be compiled by a compiler that
7061 understands function prototypes. Unfortunately, your C compiler
7063 doesn't seem to understand them. Sorry about that.
7065 If GNU cc is available for your system, perhaps you could try that instead.
7067 Eventually, we hope to support building Perl with pre-ANSI compilers.
7068 If you would like to help in that effort, please contact <perlbug@perl.org>.
7070 Aborting Configure now.
7077 dflt_dtrace='/usr/sbin/dtrace'
7078 $test -x /usr/bin/dtrace && dflt_dtrace='/usr/bin/dtrace'
7082 Perl can be built to support DTrace on platforms that support it.
7083 DTrace is a diagnosis and performance analysis tool from Sun.
7085 If this doesn't make any sense to you, just accept the default '$dflt'.
7089 case "$usedtrace" in
7095 dflt_dtrace=$usedtrace
7102 rp='Support DTrace if available?'
7105 y|Y) val="$define" ;;
7111 test "X$usedtrace" != "X$define" && break
7114 rp='Where is the dtrace executable?'
7123 if $dtrace -h -s ../perldtrace.d \
7124 -o perldtrace.tmp >/dev/null 2>&1 \
7125 && rm -f perldtrace.tmp
7128 echo "Good: your $dtrace knows about the -h flag."
7132 *** $me: Fatal Error: $dtrace doesn't support -h flag
7134 *** Your installed dtrace doesn't support the -h switch to compile a D
7135 *** program into a C header. Can't continue.
7147 *** $me: Fatal Error: $dtrace not found.
7154 echo "*** $dtrace was not found."
7160 : See if we want extra modules installed
7167 Perl can be built with extra modules or bundles of modules which
7168 will be fetched from the CPAN and installed alongside Perl.
7170 Notice that you will need access to the CPAN; either via the Internet,
7171 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
7172 be asked later to configure the CPAN.pm module which will in turn do
7173 the installation of the rest of the extra modules or bundles.)
7175 Notice also that if the modules require any external software such as
7176 libraries and headers (the libz library and the zlib.h header for the
7177 Compress::Zlib module, for example) you MUST have any such software
7178 already installed, this configuration process will NOT install such
7181 If this doesn't make any sense to you, just accept the default '$dflt'.
7183 rp='Install any extra modules (y or n)?'
7189 Please list any extra modules or bundles to be installed from CPAN,
7190 with spaces between the names. The names can be in any format the
7191 'install' command of CPAN.pm will understand. (Answer 'none',
7192 without the quotes, to install no extra modules or bundles.)
7202 $rm -f ../extras.lst
7204 *) echo "(Saving the list of extras for later...)"
7205 echo "$extras" > ../extras.lst
7213 : determine where html pages for programs go
7214 set html1dir html1dir none
7218 If you wish to install html files for programs in $spackage, indicate
7219 the appropriate directory here. To skip installing html files,
7223 ''|none|$undef|' ') dflt=none ;;
7224 *) dflt=$html1dir ;;
7227 rp="Directory for the main $spackage html pages?"
7231 : Use ' ' for none so value is preserved next time through Configure
7232 $test X"$html1dir" = "X" && html1dir=' '
7234 : determine where html pages for libraries and modules go
7235 set html3dir html3dir none
7239 If you wish to install html files for modules associated with $spackage,
7240 indicate the appropriate directory here. To skip installing html files,
7243 : There is no obvious default. If they have specified html1dir, then
7244 : try to key off that, possibly changing .../html1 into .../html3.
7246 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
7247 *) dflt=$html3dir ;;
7250 rp="Directory for the $spackage module html pages?"
7254 : Use ' ' for none so value is preserved next time through Configure
7255 $test X"$html3dir" = "X" && html3dir=' '
7257 : determine whether to install perl also as /usr/bin/perl
7260 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
7262 Many scripts expect perl to be installed as /usr/bin/perl.
7264 If you want to, I can install the perl you are about to compile
7265 as /usr/bin/perl (in addition to $bin/perl).
7267 if test -f /usr/bin/perl; then
7270 However, please note that because you already have a /usr/bin/perl,
7271 overwriting that with a new Perl would very probably cause problems.
7272 Therefore I'm assuming you don't want to do that (unless you insist).
7275 case "$installusrbinperl" in
7276 "$define"|[yY]*) dflt='y';;
7282 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
7285 case "$installusrbinperl" in
7286 "$undef"|[nN]*) dflt='n';;
7290 rp="Do you want to install perl as /usr/bin/perl?"
7293 [yY]*) val="$define";;
7299 set installusrbinperl
7302 : Check if we are using the GNU C library
7304 echo "Checking for GNU C Library..." >&4
7306 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
7307 alone are insufficient to distinguish different versions, such as
7308 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
7309 libc version 2.1.0. A. Dougherty, June 3, 2002.
7315 # ifdef __GLIBC_MINOR__
7316 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
7317 # include <gnu/libc-version.h>
7318 printf("%s\n", gnu_get_libc_version());
7320 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
7323 printf("%d\n", __GLIBC__);
7332 if eval $compile_ok && $run ./try > glibc.ver; then
7334 gnulibc_version=`$cat glibc.ver`
7335 echo "You are using the GNU C Library version $gnulibc_version"
7339 echo "You are not using the GNU C Library"
7345 : see if nm is to be used to determine whether a symbol is defined or not
7349 case "$d_gnulibc" in
7352 echo "nm probably won't work on the GNU C Library." >&4
7358 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
7360 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
7361 echo "'nm' won't be sufficient on this sytem." >&4
7367 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
7368 if $test $dflt -gt 20; then
7378 true|$define) dflt=y;;
7385 I can use $nm to extract the symbols from your C libraries. This
7386 is a time consuming task which may generate huge output on the disk (up
7387 to 3 megabytes) but that should make the symbols extraction faster. The
7388 alternative is to skip the 'nm' extraction part and to compile a small
7389 test program instead to determine whether each symbol is present. If
7390 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
7391 this may be the best solution.
7393 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
7396 rp="Shall I use $nm to extract C symbols from the libraries?"
7399 [Nn]*) usenm=false;;
7408 : nm options which may be necessary
7410 '') if $test -f /mach_boot; then
7412 elif $test -d /usr/ccs/lib; then
7413 nm_opt='-p' # Solaris (and SunOS?)
7414 elif $test -f /dgux; then
7416 elif $test -f /lib64/rld; then
7417 nm_opt='-p' # 64-bit Irix
7423 : nm options which may be necessary for shared libraries but illegal
7424 : for archive libraries. Thank you, Linux.
7425 case "$nm_so_opt" in
7426 '') case "$myuname" in
7428 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
7429 nm_so_opt='--dynamic'
7436 : Figure out where the libc is located
7439 : get list of predefined functions in a handy place
7444 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
7450 *) for thislib in $libs; do
7453 : Handle C library specially below.
7456 thislib=`echo $thislib | $sed -e 's/^-l//'`
7457 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
7459 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
7461 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
7463 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
7465 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
7467 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
7469 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
7474 libnames="$libnames $try"
7476 *) libnames="$libnames $thislib" ;;
7485 for xxx in $libpth; do
7486 $test -r $1 || set $xxx/libc.$so
7487 : The messy sed command sorts on library version numbers.
7489 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
7490 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
7492 s/[0-9][0-9]*/0000&/g
7493 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
7496 $sort | $sed -e 's/^.* //'`
7499 $test -r $1 || set /usr/ccs/lib/libc.$so
7500 $test -r $1 || set /lib/libsys_s$_a
7506 if $test -r "$1"; then
7507 echo "Your (shared) C library seems to be in $1."
7509 elif $test -r /lib/libc && $test -r /lib/clib; then
7510 echo "Your C library seems to be in both /lib/clib and /lib/libc."
7512 libc='/lib/clib /lib/libc'
7513 if $test -r /lib/syslib; then
7514 echo "(Your math library is in /lib/syslib.)"
7515 libc="$libc /lib/syslib"
7517 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7518 echo "Your C library seems to be in $libc, as you said before."
7519 elif $test -r $incpath/usr/lib/libc$_a; then
7520 libc=$incpath/usr/lib/libc$_a;
7521 echo "Your C library seems to be in $libc. That's fine."
7522 elif $test -r /lib/libc$_a; then
7524 echo "Your C library seems to be in $libc. You're normal."
7526 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
7528 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
7529 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
7530 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
7532 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7534 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7537 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
7539 if $test -r "$tans"; then
7540 echo "Your C library seems to be in $tans, of all places."
7546 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7550 If the guess above is wrong (which it might be if you're using a strange
7551 compiler, or your machine supports multiple models), you can override it here.
7556 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
7558 I can't seem to find your C library. I've looked in the following places:
7561 $sed 's/^/ /' libpath
7564 None of these seems to contain your C library. I need to get its name...
7569 rp='Where is your C library?'
7574 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
7575 set X `cat libnames`
7578 case $# in 1) xxx=file; esac
7579 echo "Extracting names from the following $xxx for later perusal:" >&4
7581 $sed 's/^/ /' libnames >&4
7583 $echo $n "This may take a while...$c" >&4
7587 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
7588 *) $nm $nm_opt $file 2>/dev/null;;
7593 $grep fprintf libc.tmp > libc.ptf
7594 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
7595 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
7597 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
7599 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7601 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
7603 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7605 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
7607 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7609 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
7611 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7613 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
7615 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7617 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
7619 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7621 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
7622 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
7624 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7626 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
7628 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7630 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
7632 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7634 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
7636 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7638 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
7640 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7642 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
7644 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7646 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
7648 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7650 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
7652 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7655 $nm -p $* 2>/dev/null >libc.tmp
7656 $grep fprintf libc.tmp > libc.ptf
7657 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
7658 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
7664 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
7666 if $ar t $libc > libc.tmp && \
7667 $contains '^fprintf$' libc.tmp >/dev/null 2>&1
7669 for thisname in $libnames $libc; do
7670 $ar t $thisname >>libc.tmp
7672 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
7674 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
7675 for thisname in $libnames $libc; do
7676 $ar tv $thisname >>libc.tmp
7677 emximp -o tmp.imp $thisname \
7679 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
7680 < tmp.imp >>libc.tmp
7683 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
7686 echo "$ar didn't seem to work right." >&4
7687 echo "Maybe this is a Cray...trying bld instead..." >&4
7689 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list &&
7692 for thisname in $libnames; do
7694 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
7695 $ar t $thisname >>libc.tmp
7699 echo "That didn't work either. Giving up." >&4
7709 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
7710 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
7712 *) if $test -f /lib/syscalls.exp; then
7714 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
7715 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' \
7716 /lib/syscalls.exp >>libc.list
7722 $rm -f libnames libpath
7724 : see if dld is available
7728 : Check if we are using C++
7730 echo "Checking for C++..." >&4
7731 $cat >try.c <<'EOCP'
7743 if eval $compile_ok && $run ./try; then
7745 echo "You are using a C++ compiler."
7748 echo "You are not using a C++ compiler."
7754 : is a C symbol defined?
7757 -v) tf=libc.tmp; tdc="";;
7758 -a) tf=libc.tmp; tdc="[]";;
7759 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
7761 case "$d_cplusplus" in
7762 $define) extern_C="extern \"C\"" ;;
7763 *) extern_C="extern" ;;
7766 case "$reuseval-$4" in
7768 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
7773 if $test "$runnm" = true; then
7774 if $contains $tlook $tf >/dev/null 2>&1; then
7776 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
7777 echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7778 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
7779 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
7783 echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7784 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
7790 $define) tval=true;;
7797 : define an is-in-libc? function
7798 inlibc='echo " "; td=$define; tu=$undef;
7799 sym=$1; var=$2; eval "was=\$$2";
7801 case "$reuseval$was" in
7811 echo "$sym() found." >&4;
7812 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
7814 echo "$sym() NOT found." >&4;
7815 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
7819 $define) echo "$sym() found." >&4;;
7820 *) echo "$sym() NOT found." >&4;;
7824 : see if dlopen exists
7826 xxx_ccflags="$ccflags"
7828 : with g++ one needs -shared to get is-in-libc to work for dlopen
7829 case "$gccversion" in
7831 *) case "$d_cplusplus" in
7832 "$define") ccflags="$ccflags -shared" ;;
7839 ccflags="$xxx_ccflags"
7841 : see if this is a unistd.h system
7842 set unistd.h i_unistd
7845 : determine which dynamic loading, if any, to compile in
7847 dldir="ext/DynaLoader"
7860 $define) dflt='y' ;;
7863 $define) dflt='y' ;;
7865 : Does a dl_xxx.xs file exist for this operating system
7866 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
7869 rp="Do you wish to use dynamic loading?"
7877 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
7878 dflt="$dldir/dl_${osname}.xs"
7879 elif $test "$d_dlopen" = "$define" ; then
7880 dflt="$dldir/dl_dlopen.xs"
7881 elif $test "$i_dld" = "$define" ; then
7882 dflt="$dldir/dl_dld.xs"
7887 *) dflt="$dldir/$dlsrc"
7890 echo "The following dynamic loading files are available:"
7891 : Can not go over to $dldir because getfile has path hard-coded in.
7892 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
7893 rp="Source file to use for dynamic loading"
7899 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
7903 Some systems may require passing special flags to $cc -c to
7904 compile modules that will be used to create a shared library.
7905 To use no flags, say "none".
7908 case "$cccdlflags" in
7909 '') case "$gccversion" in
7910 '') case "$osname" in
7912 next) dflt='none' ;;
7913 irix*) dflt='-KPIC' ;;
7914 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
7915 sunos) dflt='-pic' ;;
7919 *) case "$osname" in
7920 darwin) dflt='none' ;;
7921 linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
7926 *) dflt="$cccdlflags" ;;
7928 rp="Any special flags to pass to $cc -c to compile shared library modules?"
7931 none) cccdlflags=' ' ;;
7932 *) cccdlflags="$ans" ;;
7937 Some systems use ld to create libraries that can be dynamically loaded,
7938 while other systems (such as those using ELF) use $cc.
7942 '') $cat >try.c <<EOM
7943 /* Test for whether ELF binaries are produced */
7955 int i = open("a.out",O_RDONLY);
7958 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
7959 exit(0); /* succeed (yes, it's ELF) */
7964 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
7966 You appear to have ELF support. I'll use $cc to build dynamic libraries.
7971 echo "I'll use ld to build dynamic libraries."
7980 rp="What command should be used to create dynamic libraries?"
7986 Some systems may require passing special flags to $ld to create a
7987 library that can be dynamically loaded. If your ld flags include
7988 -L/other/path options to locate libraries outside your loader's normal
7989 search path, you may need to specify those -L options here as well. To
7990 use no flags, say "none".
7993 case "$lddlflags" in
7994 '') case "$osname" in
7995 beos) dflt='-nostart' ;;
7996 haiku) dflt='-shared' ;;
7998 case "$gccversion" in
7999 '') dflt="$dflt +vnocompatwarnings" ;;
8002 linux|irix*|gnu*) dflt="-shared $optimize" ;;
8003 next) dflt='none' ;;
8004 solaris) dflt='-G' ;;
8005 sunos) dflt='-assert nodefinitions' ;;
8006 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
8010 *) dflt="$lddlflags" ;;
8013 : Try to guess additional flags to pick up local libraries.
8014 : Be careful not to append to a plain 'none'
8018 for thisflag in $ldflags; do
8023 *) dflt="$dflt $thisflag" ;;
8030 ''|' ') dflt='none' ;;
8034 *-fstack-protector*)
8036 *-fstack-protector*) ;; # Don't add it again
8037 *) dflt="$dflt -fstack-protector" ;;
8043 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
8046 none) lddlflags=' ' ;;
8047 *) lddlflags="$ans" ;;
8052 Some systems may require passing special flags to $cc to indicate that
8053 the resulting executable will use dynamic linking. To use no flags,
8057 case "$ccdlflags" in
8058 '') case "$osname" in
8059 linux|hpux|gnu*) dflt='-Wl,-E' ;;
8060 next|sunos) dflt='none' ;;
8064 *) dflt="$ccdlflags" ;;
8066 rp="Any special flags to pass to $cc to use dynamic linking?"
8069 none) ccdlflags=' ' ;;
8070 *) ccdlflags="$ans" ;;
8081 : Do we want a shared libperl?
8085 # No dynamic loading being used, so don't bother even to prompt.
8088 *) case "$useshrplib" in
8089 '') case "$osname" in
8090 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|haiku|cygwin*)
8092 also='Building a shared libperl is required for dynamic loading to work on your system.'
8097 also='Building a shared libperl is needed for MAB support.'
8115 The perl executable is normally obtained by linking perlmain.c with
8116 libperl${_a}, any static extensions (usually just DynaLoader), and
8117 any other libraries needed on this system (such as -lm, etc.). Since
8118 your system supports dynamic loading, it is probably possible to build
8119 a shared libperl.$so. If you will have more than one executable linked
8120 to libperl.$so, this will significantly reduce the size of each
8121 executable, but it may have a noticeable effect on performance. The
8122 default is probably sensible for your system.
8126 rp="Build a shared libperl.$so (y/n)"
8130 useshrplib='true' ;;
8131 *) useshrplib='false' ;;
8136 case "$useshrplib" in
8138 case "$userelocatableinc" in
8140 echo "Cannot build with both -Duserelocatableinc and -Duseshrplib" >&4
8141 echo "See INSTALL for an explanation why that won't work." >&4
8147 # Figure out a good name for libperl.so. Since it gets stored in
8148 # a version-specific architecture-dependent library, the version
8149 # number isn't really that important, except for making cc/ld happy.
8151 # A name such as libperl.so.10.1
8152 majmin="libperl.$so.$patchlevel.$subversion"
8153 # A name such as libperl.so.100
8154 majonly=`echo $patchlevel $subversion |
8155 $awk '{printf "%d%02d", $1, $2}'`
8156 majonly=libperl.$so.$majonly
8157 # I'd prefer to keep the os-specific stuff here to a minimum, and
8158 # rely on figuring it out from the naming of libc.
8159 case "${osname}${osvers}" in
8162 # XXX How handle the --version stuff for MAB?
8164 linux*|gnu*) # ld won't link with a bare -lperl otherwise.
8167 cygwin*) # ld links now against the dll directly
8168 majmin="cygperl5_${patchlevel}_${subversion}.${so}"
8169 majonly=`echo $patchlevel $subversion |
8170 $awk '{printf "%03d%03d", $1, $2}'`
8171 majonly=cygperl5.$majonly.$so
8174 *) # Try to guess based on whether libc has major.minor.
8176 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8177 *libc.$so.[0-9]*) dflt=$majonly ;;
8178 *) dflt=libperl.$so ;;
8188 I need to select a good name for the shared libperl. If your system uses
8189 library names with major and minor numbers, then you might want something
8190 like $majmin. Alternatively, if your system uses a single version
8191 number for shared libraries, then you might want to use $majonly.
8192 Or, your system might be quite happy with a simple libperl.$so.
8194 Since the shared libperl will get installed into a version-specific
8195 architecture-dependent directory, the version number of the shared perl
8196 library probably isn't important, so the default should be o.k.
8199 rp='What name do you want to give to the shared libperl?'
8202 echo "Ok, I'll use $libperl"
8205 libperl="libperl${_a}"
8209 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8213 WARNING: Use of the shrpdir variable for the installation location of
8214 the shared $libperl is not supported. It was never documented and
8215 will not work in this version. Let me (perlbug@perl.org)
8216 know of any problems this may cause.
8222 But your current setting of $shrpdir is
8223 the default anyway, so it's harmless.
8228 Further, your current attempted setting of $shrpdir
8229 conflicts with the value of $archlibexp/CORE
8230 that installperl will use.
8237 # How will the perl executable find the installed shared $libperl?
8238 # Add $xxx to ccdlflags.
8239 # If we can't figure out a command-line option, use $shrpenv to
8240 # set env LD_RUN_PATH. The main perl makefile uses this.
8241 shrpdir=$archlibexp/CORE
8244 if "$useshrplib"; then
8247 # We'll set it in Makefile.SH...
8252 freebsd|mirbsd|netbsd|openbsd|interix|dragonfly)
8253 xxx="-Wl,-R$shrpdir"
8255 bsdos|linux|irix*|dec_osf|gnu*)
8256 xxx="-Wl,-rpath,$shrpdir"
8259 # next doesn't like the default...
8262 # beos doesn't like the default, either.
8265 # Haiku doesn't like the default, either.
8268 # hpux doesn't like the default, either.
8269 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8272 # cygwin needs only ldlibpth
8275 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8281 # Only add $xxx if it isn't already in ccdlflags.
8282 case " $ccdlflags " in
8284 *) ccdlflags="$ccdlflags $xxx"
8287 Adding $xxx to the flags
8288 passed to $ld so that the perl executable will find the
8289 installed shared $libperl.
8297 # Fix ccdlflags in AIX for building external extensions.
8298 # (For building Perl itself bare -bE:perl.exp is needed,
8299 # Makefile.SH takes care of this.)
8301 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8303 # Respect a hint or command-line value.
8305 '') shrpenv="$tmp_shrpenv" ;;
8307 case "$ldlibpthname" in
8308 '') ldlibpthname=LD_LIBRARY_PATH ;;
8309 none) ldlibpthname='' ;;
8312 : determine where manual pages are on this system
8316 syspath='/usr/share/man/man1 /usr/man/man1'
8317 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8318 syspath="$syspath /usr/man/u_man/man1"
8319 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8320 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8321 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8322 sysman=`./loc . /usr/man/man1 $syspath`
8325 if $test -d "$sysman"; then
8326 echo "System manual is in $sysman." >&4
8328 echo "Could not find manual pages in source form." >&4
8331 : determine where manual pages go
8332 set man1dir man1dir none
8336 $spackage has manual pages available in source form.
8340 echo "However, you don't have nroff, so they're probably useless to you."
8342 '') man1dir="none";;
8345 echo "If you don't want the manual sources installed, answer 'none'."
8350 lookpath="$prefixexp/share/man/man1"
8351 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8352 lookpath="$lookpath $prefixexp/man/p_man/man1"
8353 lookpath="$lookpath $prefixexp/man/u_man/man1"
8354 lookpath="$lookpath $prefixexp/man/man.1"
8356 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8357 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8367 rp="Where do the main $spackage manual pages (source) go?"
8369 if $test "X$man1direxp" != "X$ansexp"; then
8380 : What suffix to use on installed man pages
8387 rp="What suffix should be used for the main $spackage man pages?"
8389 '') case "$man1dir" in
8403 *) dflt="$man1ext";;
8410 : see if we can have long filenames
8412 first=123456789abcdef
8414 if (echo hi >$first) 2>/dev/null; then
8415 if $test -f 123456789abcde; then
8416 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8419 echo 'You can have filenames longer than 14 characters.'>&4
8424 You can't have filenames longer than 14 chars.
8425 You can't even think about them!
8431 $rm -rf 123456789abcde*
8433 : determine where library module manual pages go
8434 set man3dir man3dir none
8438 $spackage has manual pages for many of the library modules.
8444 However, you don't have nroff, so they're probably useless to you.
8447 '') man3dir="none";;
8451 case "$d_flexfnam" in
8454 However, your system can't handle the long file names like File::Basename.3.
8457 '') man3dir="none";;
8461 echo "If you don't want the manual sources installed, answer 'none'."
8462 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8464 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8465 if $test -d "$privlib/man/man3"; then
8468 WARNING: Previous versions of perl installed man3 pages into
8469 $privlib/man/man3. This version will suggest a
8470 new default of $dflt.
8474 rp='Do you wish to preserve the old behavior?(y/n)'
8477 y*) dflt="$privlib/man/man3" ;;
8482 *) dflt="$man3dir" ;;
8489 rp="Where do the $package library man pages (source) go?"
8499 : What suffix to use on installed man pages
8505 rp="What suffix should be used for the $package library man pages?"
8507 '') case "$man3dir" in
8521 *) dflt="$man3ext";;
8528 : see if we have to deal with yellow pages, now NIS.
8529 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8530 if $test -f /usr/etc/nibindd; then
8532 echo "I'm fairly confident you're on a NeXT."
8534 rp='Do you get the hosts file via NetInfo?'
8543 y*) hostcat='nidump hosts .';;
8544 *) case "$hostcat" in
8545 nidump*) hostcat='';;
8555 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8563 rp='Are you getting the hosts file via yellow pages?'
8566 y*) hostcat='ypcat hosts';;
8567 *) hostcat='cat /etc/hosts';;
8573 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8576 '') test -f /etc/group && groupcat='cat /etc/group';;
8579 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8582 : now get the host name
8584 echo "Figuring out host name..." >&4
8585 case "$myhostname" in
8587 echo 'Maybe "hostname" will work...'
8588 if tans=`sh -c hostname 2>&1` ; then
8596 if $test "$cont"; then
8598 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8599 if tans=`cat /etc/systemid 2>&1` ; then
8601 phostname='cat /etc/systemid'
8602 echo "Whadyaknow. Xenix always was a bit strange..."
8605 elif $test -r /etc/systemid; then
8606 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8609 if $test "$cont"; then
8610 echo 'No, maybe "uuname -l" will work...'
8611 if tans=`sh -c 'uuname -l' 2>&1` ; then
8613 phostname='uuname -l'
8615 echo 'Strange. Maybe "uname -n" will work...'
8616 if tans=`sh -c 'uname -n' 2>&1` ; then
8618 phostname='uname -n'
8620 echo 'Oh well, maybe I can mine it out of whoami.h...'
8621 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8622 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8623 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8625 case "$myhostname" in
8626 '') echo "Does this machine have an identity crisis or something?"
8629 echo "Well, you said $myhostname before..."
8630 phostname='echo $myhostname';;
8636 case "$myhostname" in
8637 '') myhostname=noname ;;
8639 : you do not want to know about this
8644 if $test "$myhostname" ; then
8646 rp='Your host name appears to be "'$myhostname'".'" Right?"
8654 : bad guess or no guess
8655 while $test "X$myhostname" = X ; do
8657 rp="Please type the (one word) name of your host:"
8662 : translate upper to lower if necessary
8663 case "$myhostname" in
8665 echo "(Normalizing case in your host name)"
8666 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8670 case "$myhostname" in
8672 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8673 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8674 echo "(Trimming domain name from host name--host name is now $myhostname)"
8676 *) case "$mydomain" in
8679 test "X$hostcat" = "Xypcat hosts" &&
8680 ypmatch "$myhostname" hosts 2>/dev/null |\
8681 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8684 test "X$hostcat" != "X" &&
8685 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8686 /[ ]$myhostname[ . ]/p" > hosts
8689 if $test -f hosts; then
8690 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8691 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8692 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8693 hosts | $sort | $uniq | \
8694 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8695 case `$echo X$dflt` in
8696 X*\ *) echo "(Several hosts in the database matched hostname)"
8699 X.) echo "(You do not have fully-qualified names in the hosts database)"
8703 echo "(I cannot locate a hosts database anywhere)"
8708 tans=`./loc resolv.conf X /etc /usr/etc`
8709 if $test -f "$tans"; then
8710 echo "(Attempting domain name extraction from $tans)"
8711 dflt=.`$sed -n -e 's/ / /g' \
8712 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8715 .) dflt=.`$sed -n -e 's/ / /g' \
8716 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8724 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8725 dflt=.`sh -c domainname 2>/dev/null`
8728 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8732 case "$dflt$osname" in
8733 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
8734 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
8738 .) echo "(Lost all hope -- silly guess then)"
8744 *) dflt="$mydomain";;
8748 rp="What is your domain name?"
8758 : translate upper to lower if necessary
8761 echo "(Normalizing case in your domain name)"
8762 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
8766 : a little sanity check here
8767 case "$phostname" in
8770 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
8771 $myhostname$mydomain|$myhostname) ;;
8773 case "$phostname" in
8775 echo "(That doesn't agree with your whoami.h file, by the way.)"
8778 echo "(That doesn't agree with your $phostname command, by the way.)"
8786 : determine the e-mail address of the user who is running us
8789 I need to get your e-mail address in Internet format if possible, i.e.
8790 something like user@host.domain. Please answer accurately since I have
8791 no easy means to double check it. The default value provided below
8792 is most probably close to reality but may not be valid from outside
8793 your organization...
8797 while test "$cont"; do
8799 '') dflt="$cf_by@$myhostname$mydomain";;
8800 *) dflt="$cf_email";;
8802 rp='What is your e-mail address?'
8808 rp='Address does not look like an Internet one. Use it anyway?'
8822 : Ask e-mail of administrator
8825 If you or somebody else will be maintaining perl at your site, please
8826 fill in the correct e-mail address here so that they may be contacted
8827 if necessary. Currently, the "perlbug" program included with perl
8828 will send mail to this address in addition to perlbug@perl.org. You may
8829 enter "none" for no administrator.
8832 case "$perladmin" in
8833 '') dflt="$cf_email";;
8834 *) dflt="$perladmin";;
8836 rp='Perl administrator e-mail address'
8840 : determine whether to only install version-specific parts.
8843 Do you want to install only the version-specific parts of the perl
8844 distribution? Usually you do *not* want to do this.
8846 case "$versiononly" in
8847 "$define"|[Yy]*|true) dflt='y' ;;
8850 rp="Do you want to install only the version-specific parts of perl?"
8853 [yY]*) val="$define";;
8859 case "$versiononly" in
8860 "$define") inc_version_list=''
8861 inc_version_list_init=0
8865 : figure out how to guarantee perl startup
8866 : XXX Note that this currently takes advantage of the bug that binexp ignores
8867 : the Configure -Dinstallprefix setting, which in turn means that under
8868 : relocatable @INC, initialinstalllocation is what binexp started as.
8869 case "$startperl" in
8871 case "$sharpbang" in
8875 I can use the #! construct to start perl on your system. This will
8876 make startup of perl scripts faster, but may cause problems if you
8877 want to share those scripts and perl is not in a standard place
8878 ($initialinstalllocation/perl) on all your platforms. The alternative
8879 is to force a shell by starting the script with a single ':' character.
8882 case "$versiononly" in
8883 "$define") dflt="$initialinstalllocation/perl$version";;
8884 *) dflt="$initialinstalllocation/perl";;
8886 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
8889 none) startperl=": # use perl";;
8890 *) startperl="#!$ans"
8891 if $test 30 -lt `echo "$ans" | wc -c`; then
8894 WARNING: Some systems limit the #! command to 32 characters.
8895 If you experience difficulty running Perl scripts with #!, try
8896 installing Perl in a directory with a shorter pathname.
8902 *) startperl=": # use perl"
8907 echo "I'll use $startperl to start perl scripts."
8909 : figure best path for perl in scripts
8912 case "$versiononly" in
8913 "$define") perlpath="$initialinstalllocation/perl$version";;
8914 *) perlpath="$initialinstalllocation/perl";;
8916 case "$startperl" in
8921 I will use the "eval 'exec'" idiom to start Perl on your system.
8922 I can use the full path of your Perl binary for this purpose, but
8923 doing so may cause problems if you want to share those scripts and
8924 Perl is not always in a standard place ($initialinstalllocation/perl).
8927 dflt="$initialinstalllocation/perl"
8928 rp="What path shall I use in \"eval 'exec'\"?"
8935 case "$startperl" in
8937 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
8940 : determine where public executable scripts go
8941 set scriptdir scriptdir
8943 case "$scriptdir" in
8946 : guess some guesses
8947 $test -d /usr/share/scripts && dflt=/usr/share/scripts
8948 $test -d /usr/share/bin && dflt=/usr/share/bin
8949 $test -d /usr/local/script && dflt=/usr/local/script
8950 $test -d /usr/local/scripts && dflt=/usr/local/scripts
8951 $test -d $prefixexp/script && dflt=$prefixexp/script
8955 *) dflt="$scriptdir"
8960 Some installations have a separate directory just for executable scripts so
8961 that they can mount it across multiple architectures but keep the scripts in
8962 one spot. You might, for example, have a subdirectory of /usr/share for this.
8963 Or you might just lump your scripts in with all your other executables.
8967 rp='Where do you keep publicly executable scripts?'
8969 if $test "X$ansexp" != "X$scriptdirexp"; then
8975 : A little fix up for an irregularly named variable.
8976 installscript="$installscriptdir"
8978 : determine where add-on public executables go
8980 '') dflt=$siteprefix/bin ;;
8984 rp='Pathname where the add-on public executables should be installed?'
8989 : determine where add-on html pages go
8990 : There is no standard location, so try to copy the previously-selected
8991 : directory structure for the core html pages.
8992 case "$sitehtml1dir" in
8993 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8994 *) dflt=$sitehtml1dir ;;
8997 ''|' ') dflt=none ;;
9000 rp='Pathname where the site-specific html pages should be installed?'
9002 prefixvar=sitehtml1dir
9005 : determine where add-on library html pages go
9006 : There is no standard location, so try to copy the previously-selected
9007 : directory structure for the core html pages.
9008 case "$sitehtml3dir" in
9009 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9010 *) dflt=$sitehtml3dir ;;
9013 ''|' ') dflt=none ;;
9016 rp='Pathname where the site-specific library html pages should be installed?'
9018 prefixvar=sitehtml3dir
9021 : determine where add-on manual pages go
9022 case "$siteman1dir" in
9023 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
9024 *) dflt=$siteman1dir ;;
9027 ''|' ') dflt=none ;;
9030 rp='Pathname where the site-specific manual pages should be installed?'
9032 prefixvar=siteman1dir
9035 : determine where add-on library man pages go
9036 case "$siteman3dir" in
9037 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
9038 *) dflt=$siteman3dir ;;
9041 ''|' ') dflt=none ;;
9044 rp='Pathname where the site-specific library manual pages should be installed?'
9046 prefixvar=siteman3dir
9049 : determine where add-on public executable scripts go
9050 case "$sitescript" in
9051 '') dflt=$siteprefix/script
9052 $test -d $dflt || dflt=$sitebin ;;
9053 *) dflt="$sitescript" ;;
9056 rp='Pathname where add-on public executable scripts should be installed?'
9058 prefixvar=sitescript
9061 : Check if faststdio is requested and available
9062 case "$usefaststdio" in
9063 $define|true|[yY]*|'')
9064 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
9074 Perl can be built to use 'fast stdio', which means using the stdio
9075 library but also directly manipulating the stdio buffers to enable
9076 faster I/O. Using stdio is better for backward compatibility (especially
9077 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
9078 interface has been preferred instead of stdio.
9080 If this doesn't make any sense to you, just accept the default '$dflt'.
9082 rp='Use the "fast stdio" if available?'
9085 y|Y) val="$define" ;;
9092 : define an is-a-typedef? function
9093 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9095 "") inclist="sys/types.h";;
9097 eval "varval=\$$var";
9101 for inc in $inclist; do
9102 echo "#include <$inc>" >>temp.c;
9104 echo "#ifdef $type" >> temp.c;
9105 echo "printf(\"We have $type\");" >> temp.c;
9106 echo "#endif" >> temp.c;
9107 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9108 if $contains $type temp.E >/dev/null 2>&1; then
9114 *) eval "$var=\$varval";;
9117 : define an is-a-typedef? function that prompts if the type is not available.
9118 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9120 "") inclist="sys/types.h";;
9122 eval "varval=\$$var";
9126 for inc in $inclist; do
9127 echo "#include <$inc>" >>temp.c;
9129 echo "#ifdef $type" >> temp.c;
9130 echo "printf(\"We have $type\");" >> temp.c;
9131 echo "#endif" >> temp.c;
9132 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9134 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
9135 if $contains $type temp.E >/dev/null 2>&1; then
9136 echo "$type found." >&4;
9139 echo "$type NOT found." >&4;
9145 *) eval "$var=\$varval";;
9148 : see what type lseek is declared as in the kernel
9149 rp="What is the type used for lseek's offset on this system?"
9150 set off_t lseektype long stdio.h sys/types.h
9154 echo "Checking to see how big your file offsets are..." >&4
9156 #include <sys/types.h>
9160 printf("%d\n", (int)sizeof($lseektype));
9165 if eval $compile_ok; then
9166 lseeksize=`$run ./try`
9167 echo "Your file offsets are $lseeksize bytes long."
9171 echo "(I can't seem to compile the test program. Guessing...)"
9172 rp="What is the size of your file offsets (in bytes)?"
9178 : see what type file positions are declared as in the library
9179 rp="What is the type for file position used by fsetpos()?"
9180 set fpos_t fpostype long stdio.h sys/types.h
9183 : Check size for Fpos_t
9186 *_t) zzz="$fpostype" ;;
9189 echo "Checking the size of $zzz..." >&4
9191 #include <sys/types.h>
9198 printf("%d\n", (int)sizeof($fpostype));
9203 if eval $compile_ok; then
9207 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9210 echo "Your $zzz is $fpossize bytes long."
9216 echo "(I can't compile the test program. Guessing...)" >&4
9217 rp="What is the size of your file positions (in bytes)?"
9222 : Check for large file support
9223 # Backward compatibility (uselfs is deprecated).
9225 "$define"|true|[yY]*)
9228 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9230 uselargefiles="$define"
9234 case "$lseeksize:$fpossize" in
9237 You can have files larger than 2 gigabytes.
9240 *) case "$uselargefiles" in
9241 "$undef"|false|[nN]*) dflt='n' ;;
9246 Perl can be built to understand large files (files larger than 2 gigabytes)
9247 on some systems. To do so, Configure can be run with -Duselargefiles.
9249 If this doesn't make any sense to you, just accept the default '$dflt'.
9251 rp='Try to understand large files, if available?'
9254 y|Y) val="$define" ;;
9261 : Look for a hint-file generated 'call-back-unit'. If the
9262 : user has specified that a large files perl is to be built,
9263 : we may need to set or change some other defaults.
9264 if $test -f uselargefiles.cbu; then
9265 echo "Your platform has some specific hints regarding large file builds, using them..."
9266 . ./uselargefiles.cbu
9268 case "$uselargefiles" in
9270 if $test -f uselargefiles.cbu; then
9272 echo "Rechecking to see how big your file offsets are..." >&4
9274 #include <sys/types.h>
9278 printf("%d\n", (int)sizeof($lseektype));
9283 if eval $compile_ok; then
9284 lseeksize=`$run ./try`
9285 $echo "Your file offsets are now $lseeksize bytes long."
9289 echo "(I can't seem to compile the test program. Guessing...)"
9290 rp="What is the size of your file offsets (in bytes)?"
9295 *_t) zzz="$fpostype" ;;
9298 $echo $n "Rechecking the size of $zzz...$c" >&4
9300 #include <sys/types.h>
9307 printf("%d\n", (int)sizeof($fpostype));
9312 if eval $compile_ok; then
9317 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9320 echo " $fpossize bytes." >&4
9326 echo "(I can't compile the test program. Guessing...)" >&4
9327 rp="What is the size of your file positions (in bytes)?"
9336 : Check if we want perlio
9339 : Set the vendorbin variables
9340 case "$vendorprefix" in
9341 '') d_vendorbin="$undef"
9345 *) d_vendorbin="$define"
9346 : determine where vendor-supplied executables go.
9347 case "$vendorbin" in
9348 '') dflt=$vendorprefix/bin ;;
9349 *) dflt="$vendorbin" ;;
9352 rp='Pathname for the vendor-supplied executables directory?'
9355 vendorbinexp="$ansexp"
9361 : Set the vendorhtml1dir variables
9362 case "$vendorprefix" in
9363 '') vendorhtml1dir=''
9364 vendorhtml1direxp=''
9366 *) : determine where vendor-supplied html pages go.
9367 : There is no standard location, so try to copy the previously-selected
9368 : directory structure for the core html pages.
9369 : XXX Better default suggestions would be welcome.
9370 case "$vendorhtml1dir" in
9371 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9372 *) dflt=$vendorhtml1dir ;;
9375 ''|' ') dflt=none ;;
9378 rp='Pathname for the vendor-supplied html pages?'
9380 vendorhtml1dir="$ans"
9381 vendorhtml1direxp="$ansexp"
9384 : Use ' ' for none so value is preserved next time through Configure
9385 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9386 prefixvar=vendorhtml1dir
9389 : Set the vendorhtml3dir variables
9390 case "$vendorprefix" in
9391 '') vendorhtml3dir=''
9392 vendorhtml3direxp=''
9394 *) : determine where vendor-supplied module html pages go.
9395 : There is no standard location, so try to copy the previously-selected
9396 : directory structure for the core html pages.
9397 : XXX Better default suggestions would be welcome.
9398 case "$vendorhtml3dir" in
9399 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9400 *) dflt=$vendorhtml3dir ;;
9403 ''|' ') dflt=none ;;
9406 rp='Pathname for the vendor-supplied html pages?'
9408 vendorhtml3dir="$ans"
9409 vendorhtml3direxp="$ansexp"
9412 : Use ' ' for none so value is preserved next time through Configure
9413 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9414 prefixvar=vendorhtml3dir
9417 : Set the vendorman1dir variables
9418 case "$vendorprefix" in
9419 '') vendorman1dir=''
9422 *) : determine where vendor-supplied manual pages go.
9423 case "$vendorman1dir" in
9424 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9425 *) dflt=$vendorman1dir ;;
9428 ''|' ') dflt=none ;;
9431 rp='Pathname for the vendor-supplied manual section 1 pages?'
9433 vendorman1dir="$ans"
9434 vendorman1direxp="$ansexp"
9437 : Use ' ' for none so value is preserved next time through Configure
9438 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9439 prefixvar=vendorman1dir
9442 : Set the vendorman3dir variables
9443 case "$vendorprefix" in
9444 '') vendorman3dir=''
9447 *) : determine where vendor-supplied module manual pages go.
9448 case "$vendorman3dir" in
9449 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9450 *) dflt=$vendorman3dir ;;
9453 ''|' ') dflt=none ;;
9456 rp='Pathname for the vendor-supplied manual section 3 pages?'
9458 vendorman3dir="$ans"
9459 vendorman3direxp="$ansexp"
9462 : Use ' ' for none so value is preserved next time through Configure
9463 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9464 prefixvar=vendorman3dir
9467 : Set the vendorscript variables
9468 case "$vendorprefix" in
9469 '') d_vendorscript="$undef"
9473 *) d_vendorscript="$define"
9474 : determine where vendor-supplied scripts go.
9475 case "$vendorscript" in
9476 '') dflt=$vendorprefix/script
9477 $test -d $dflt || dflt=$vendorbin ;;
9478 *) dflt="$vendorscript" ;;
9482 The installation process will create a directory for
9483 vendor-supplied scripts.
9487 rp='Pathname for the vendor-supplied scripts directory?'
9490 vendorscriptexp="$ansexp"
9493 prefixvar=vendorscript
9496 : script used to emit important warnings
9499 if test \$# -gt 0; then
9504 echo "*** WARNING:" >&4
9505 sed -e 's/^/*** /' <msg >&4
9507 cat msg >>config.msg
9508 echo " " >>config.msg
9514 : see which of string.h or strings.h is needed
9516 strings=`./findhdr string.h`
9517 if $test "$strings" && $test -r "$strings"; then
9518 echo "Using <string.h> instead of <strings.h>." >&4
9522 strings=`./findhdr strings.h`
9523 if $test "$strings" && $test -r "$strings"; then
9524 echo "Using <strings.h> instead of <string.h>." >&4
9526 ./warn "No string header found -- You'll surely have problems."
9532 "$undef") strings=`./findhdr strings.h`;;
9533 *) strings=`./findhdr string.h`;;
9536 : see if qgcvt exists
9540 : Check print/scan long double stuff
9543 if $test X"$d_longdbl" = X"$define"; then
9545 echo "Checking how to print long doubles..." >&4
9547 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
9548 $cat >try.c <<'EOCP'
9549 #include <sys/types.h>
9553 printf("%.3f\n", d);
9557 if eval $compile; then
9561 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
9562 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
9563 echo "We will use %f."
9569 if $test X"$sPRIfldbl" = X; then
9570 $cat >try.c <<'EOCP'
9571 #include <sys/types.h>
9574 long double d = 123.456;
9575 printf("%.3Lf\n", d);
9579 if eval $compile; then
9583 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
9584 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
9585 echo "We will use %Lf."
9591 if $test X"$sPRIfldbl" = X; then
9592 $cat >try.c <<'EOCP'
9593 #include <sys/types.h>
9596 long double d = 123.456;
9597 printf("%.3llf\n", d);
9601 if eval $compile; then
9605 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
9606 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
9607 echo "We will use %llf."
9613 if $test X"$sPRIfldbl" = X; then
9614 $cat >try.c <<'EOCP'
9615 #include <sys/types.h>
9618 long double d = 123.456;
9619 printf("%.3lf\n", d);
9623 if eval $compile; then
9627 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
9628 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
9629 echo "We will use %lf."
9635 if $test X"$sPRIfldbl" = X; then
9636 echo "Cannot figure out how to print long doubles." >&4
9638 sSCNfldbl=$sPRIfldbl # expect consistency
9645 case "$sPRIfldbl" in
9646 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
9647 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
9648 d_SCNfldbl="$undef";
9650 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
9651 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
9652 d_SCNfldbl="$define";
9656 : Check how to convert floats to strings.
9658 if test "X$d_Gconvert" = X; then
9661 echo "Checking for an efficient way to convert floats to strings."
9663 case "$uselongdouble" in
9664 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
9666 case "$d_longdbl" in
9667 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
9669 case "$d_PRIgldbl" in
9670 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
9674 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
9675 char *myname = "gconvert";
9678 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
9679 char *myname = "gcvt";
9682 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
9683 char *myname = "qgcvt";
9684 #define DOUBLETYPE long double
9687 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9689 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
9691 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
9694 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
9696 char *myname = "sprintf";
9700 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9701 #define DOUBLETYPE long double
9703 #define DOUBLETYPE double
9715 # include <string.h>
9717 # include <strings.h>
9720 int checkit(char *expect, char *got)
9722 if (strcmp(expect, got)) {
9723 printf("%s oddity: Expected %s, got %s\n",
9724 myname, expect, got);
9734 /* This must be 1st test on (which?) platform */
9735 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
9736 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
9737 checkit("0.1", buf);
9739 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
9740 checkit("0.01", buf);
9742 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
9743 checkit("0.001", buf);
9745 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
9746 checkit("0.0001", buf);
9748 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
9749 if (strlen(buf) > 5)
9750 checkit("9e-005", buf); /* for Microsoft ?? */
9752 checkit("9e-05", buf);
9754 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
9757 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
9758 checkit("1.1", buf);
9760 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
9761 checkit("1.01", buf);
9763 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
9764 checkit("1.001", buf);
9766 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
9767 checkit("1.0001", buf);
9769 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
9770 checkit("1.00001", buf);
9772 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
9773 checkit("1.000001", buf);
9775 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
9778 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
9781 /* Some Linux gcvt's give 1.e+5 here. */
9782 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
9783 checkit("100000", buf);
9785 /* Some Linux gcvt's give -1.e+5 here. */
9786 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
9787 checkit("-100000", buf);
9789 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
9790 checkit("123.456", buf);
9792 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
9793 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
9794 /* 34 should be enough to scare even long double
9795 * places into using the e notation. */
9796 if (strlen(buf) > 5)
9797 checkit("1e+034", buf); /* for Microsoft */
9799 checkit("1e+34", buf);
9801 /* For Perl, if you add additional tests here, also add them to
9802 * t/base/num.t for benefit of platforms not using Configure or
9803 * overriding d_Gconvert */
9808 : first add preferred functions to our list
9810 for xxx_convert in $gconvert_preference; do
9811 case $xxx_convert in
9812 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
9813 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
9816 : then add any others
9817 for xxx_convert in gconvert gcvt sprintf; do
9820 *) xxx_list="$xxx_list $xxx_convert" ;;
9824 case "$d_longdbl$uselongdouble" in
9826 : again, add preferred functions to our list first
9828 for xxx_convert in $gconvert_ld_preference; do
9829 case $xxx_convert in
9830 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9831 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
9834 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
9835 for xxx_convert in qgcvt sprintf $xxx_list; do
9836 case "$xxx_ld_list" in
9837 $xxx_convert*|*" $xxx_convert"*) ;;
9838 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9841 : if sprintf cannot do long doubles, move it to the end
9842 if test "$d_PRIgldbl" != "$define"; then
9843 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
9845 : if no qgcvt, remove it
9846 if test "$d_qgcvt" != "$define"; then
9847 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
9850 xxx_list="$xxx_ld_list"
9854 for xxx_convert in $xxx_list; do
9855 echo "Trying $xxx_convert..."
9856 $rm -f try try$_o core
9857 set try -DTRY_$xxx_convert
9858 if eval $compile; then
9859 echo "$xxx_convert() found." >&4
9861 echo "I'll use $xxx_convert to convert floats into a string." >&4
9864 echo "...But $xxx_convert didn't work as I expected."
9868 echo "$xxx_convert NOT found." >&4
9872 if test X$xxx_convert = X; then
9873 echo "*** WHOA THERE!!! ***" >&4
9874 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
9878 case "$xxx_convert" in
9879 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
9880 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
9881 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
9882 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
9883 "$define$define$define")
9884 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
9885 "$define$define$undef")
9886 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
9887 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
9895 : see if _fwalk exists
9899 : Initialize h_fcntl
9902 : Initialize h_sysfile
9905 : access call always available on UNIX
9909 : locate the flags for 'access()'
9913 $cat >access.c <<EOCP
9914 #include <sys/types.h>
9919 #include <sys/file.h>
9932 : check sys/file.h first, no particular reason here
9933 if $test `./findhdr sys/file.h` && \
9934 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
9936 echo "<sys/file.h> defines the *_OK access constants." >&4
9937 elif $test `./findhdr fcntl.h` && \
9938 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
9940 echo "<fcntl.h> defines the *_OK access constants." >&4
9941 elif $test `./findhdr unistd.h` && \
9942 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
9943 echo "<unistd.h> defines the *_OK access constants." >&4
9945 echo "I can't find the four *_OK access constants--I'll use mine." >&4
9951 : see if accessx exists
9952 set accessx d_accessx
9955 : see if aintl exists
9959 : see if alarm exists
9963 : see if 64bit time functions exists
9965 set ctime64 d_ctime64
9968 set localtime64 d_localtime64
9971 set gmtime64 d_gmtime64
9974 set mktime64 d_mktime64
9977 set difftime64 d_difftime64
9980 set asctime64 d_asctime64
9983 : see if POSIX threads are available
9984 set pthread.h i_pthread
9987 : define a function to check prototypes
9988 $cat > protochk <<EOSH
9991 optimize="$optimize"
9993 prototype="$prototype"
9996 usethreads=$usethreads
9997 i_pthread=$i_pthread
9998 pthread_h_first=$pthread_h_first
10001 $cat >> protochk <<'EOSH'
10006 while test $# -ge 2; do
10008 $define) echo "#include <$2>" >> try.c ;;
10009 literal) echo "$2" >> try.c ;;
10011 # Extra magic for the benefit of systems that need pthread.h
10012 # to be included early to correctly detect threadsafe functions.
10013 # Such functions must guarantee themselves, though, that the usethreads
10014 # and i_pthread have been defined, before calling protochk.
10015 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
10016 echo "#include <pthread.h>" >> try.c
10021 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
10022 cat >> try.c <<'EOCP'
10023 #ifdef CAN_PROTOTYPE
10024 #define _(args) args
10029 echo "$foo" >> try.c
10030 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
10031 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
10037 $eunicefix protochk
10039 : Define hasproto macro for Configure internal use
10040 hasproto='varname=$1; func=$2; shift; shift;
10041 while $test $# -ge 2; do
10043 $define) echo "#include <$2>";;
10047 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
10048 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
10049 echo "$func() prototype found.";
10052 echo "$func() prototype NOT found.";
10059 : see if sys/types.h has to be included
10060 set sys/types.h i_systypes
10063 : see if sys/select.h has to be included
10064 set sys/select.h i_sysselct
10067 : Define hasfield macro for Configure internal use
10068 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
10069 while $test $# -ge 2; do
10071 $define) echo "#include <$2>";;
10075 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
10077 if eval $compile; then
10086 : see if we should include time.h, sys/time.h, or both
10088 if test "X$timeincl" = X; then
10089 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
10090 $echo $n "I'm now running the test program...$c"
10092 #include <sys/types.h>
10097 #ifdef SYSTIMEKERNEL
10100 #include <sys/time.h>
10103 #include <sys/select.h>
10105 #$i_stdlib I_STDLIB
10107 #include <stdlib.h>
10113 struct timeval bar;
10116 struct timezone tzp;
10118 if (foo.tm_sec == foo.tm_sec)
10121 if (bar.tv_sec == bar.tv_sec)
10128 for s_timezone in '-DS_TIMEZONE' ''; do
10130 for s_timeval in '-DS_TIMEVAL' ''; do
10131 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10132 for i_time in '' '-DI_TIME'; do
10133 for i_systime in '-DI_SYSTIME' ''; do
10136 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10137 if eval $compile; then
10138 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
10142 $echo $n "Succeeded with $flags$c"
10154 *SYSTIMEKERNEL*) i_systimek="$define"
10155 timeincl=`./findhdr sys/time.h`
10156 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10157 *) i_systimek="$undef";;
10160 *I_TIME*) i_time="$define"
10161 timeincl=`./findhdr time.h`" $timeincl"
10162 echo "We'll include <time.h>." >&4;;
10163 *) i_time="$undef";;
10166 *I_SYSTIME*) i_systime="$define"
10167 timeincl=`./findhdr sys/time.h`" $timeincl"
10168 echo "We'll include <sys/time.h>." >&4;;
10169 *) i_systime="$undef";;
10173 : see if struct tm knows about tm_zone
10174 case "$i_systime$i_time" in
10177 echo "Checking to see if your struct tm has tm_zone field..." >&4
10178 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
10186 case "$d_tm_tm_zone" in
10187 "$define") echo "Yes, it does." ;;
10188 *) echo "No, it doesn't." ;;
10190 : see if struct tm knows about tm_gmtoff
10191 case "$i_systime$i_time" in
10194 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
10195 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
10203 case "$d_tm_tm_gmtoff" in
10204 "$define") echo "Yes, it does." ;;
10205 *) echo "No, it doesn't." ;;
10208 : see if asctime_r exists
10209 set asctime_r d_asctime_r
10211 case "$d_asctime_r" in
10213 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10214 case "$d_asctime_r_proto:$usethreads" in
10215 ":define") d_asctime_r_proto=define
10216 set d_asctime_r_proto asctime_r $hdrs
10220 case "$d_asctime_r_proto" in
10222 case "$asctime_r_proto" in
10223 ''|0) try='char* asctime_r(const struct tm*, char*);'
10224 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SB ;;
10226 case "$asctime_r_proto" in
10227 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
10228 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SBI ;;
10230 case "$asctime_r_proto" in
10231 ''|0) try='int asctime_r(const struct tm*, char*);'
10232 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SB ;;
10234 case "$asctime_r_proto" in
10235 ''|0) try='int asctime_r(const struct tm*, char*, int);'
10236 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SBI ;;
10238 case "$asctime_r_proto" in
10239 ''|0) d_asctime_r=undef
10241 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
10242 * ) case "$asctime_r_proto" in
10243 REENTRANT_PROTO*) ;;
10244 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
10246 echo "Prototype: $try" ;;
10249 *) case "$usethreads" in
10250 define) echo "asctime_r has no prototype, not using it." >&4 ;;
10257 *) asctime_r_proto=0
10261 : see if atolf exists
10265 : see if atoll exists
10269 : Look for GCC-style attribute format
10270 case "$d_attribute_format" in
10273 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
10274 $cat >attrib.c <<'EOCP'
10276 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
10278 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10279 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10280 echo "Your C compiler doesn't support __attribute__((format))."
10283 echo "Your C compiler supports __attribute__((format))."
10287 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10291 *) val="$d_attribute_format" ;;
10293 set d_attribute_format
10297 : Look for GCC-style attribute format with null format allowed
10298 case "$d_printf_format_null" in
10299 '') case "$d_attribute_format" in
10302 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
10303 $cat >attrib.c <<EOCP
10305 #$i_stdlib I_STDLIB
10307 #include <stdlib.h>
10309 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
10310 int null_printf (char* pat,...) { return (int)pat; }
10311 int main () { exit(null_printf(NULL)); }
10313 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
10314 : run the executable in case it produces a run-time warning
10315 if $run ./attrib >>attrib.out 2>&1; then
10316 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10317 echo "Your C compiler doesn't allow __printf__ format to be null."
10320 echo "Your C compiler allows __printf__ format to be null."
10324 echo "Your C compiler executable failed with __printf__ format null."
10328 echo "Your C compiler fails with __printf__ format null."
10335 *) val="$d_printf_format_null" ;;
10337 set d_printf_format_null
10341 : Look for GCC-style attribute malloc
10342 case "$d_attribute_malloc" in
10345 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
10346 $cat >attrib.c <<'EOCP'
10348 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
10350 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10351 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10352 echo "Your C compiler doesn't support __attribute__((malloc))."
10355 echo "Your C compiler supports __attribute__((malloc))."
10359 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10363 *) val="$d_attribute_malloc" ;;
10365 set d_attribute_malloc
10369 : Look for GCC-style attribute nonnull
10370 case "$d_attribute_nonnull" in
10373 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
10374 $cat >attrib.c <<'EOCP'
10376 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
10378 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10379 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10380 echo "Your C compiler doesn't support __attribute__((nonnull))."
10383 echo "Your C compiler supports __attribute__((nonnull))."
10387 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10391 *) val="$d_attribute_nonnull" ;;
10393 set d_attribute_nonnull
10397 : Look for GCC-style attribute noreturn
10398 case "$d_attribute_noreturn" in
10401 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
10402 $cat >attrib.c <<'EOCP'
10404 void fall_over_dead( void ) __attribute__((noreturn));
10406 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10407 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10408 echo "Your C compiler doesn't support __attribute__((noreturn))."
10411 echo "Your C compiler supports __attribute__((noreturn))."
10415 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10419 *) val="$d_attribute_noreturn" ;;
10421 set d_attribute_noreturn
10425 : Look for GCC-style attribute pure
10426 case "$d_attribute_pure" in
10429 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
10430 $cat >attrib.c <<'EOCP'
10432 int square( int n ) __attribute__((pure));
10434 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10435 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10436 echo "Your C compiler doesn't support __attribute__((pure))."
10439 echo "Your C compiler supports __attribute__((pure))."
10443 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10447 *) val="$d_attribute_pure" ;;
10449 set d_attribute_pure
10453 : Look for GCC-style attribute unused
10454 case "$d_attribute_unused" in
10457 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
10458 $cat >attrib.c <<'EOCP'
10460 int do_something( int dummy __attribute__((unused)), int n );
10462 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10463 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10464 echo "Your C compiler doesn't support __attribute__((unused))."
10467 echo "Your C compiler supports __attribute__((unused))."
10471 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10475 *) val="$d_attribute_unused" ;;
10477 set d_attribute_unused
10481 : Look for GCC-style attribute deprecated
10482 case "$d_attribute_deprecated" in
10485 echo "Checking whether your compiler can handle __attribute__((deprecated)) ..." >&4
10486 $cat >attrib.c <<'EOCP'
10488 int I_am_deprecated(void) __attribute__((deprecated));
10490 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10491 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10492 echo "Your C compiler doesn't support __attribute__((deprecated))."
10495 echo "Your C compiler supports __attribute__((deprecated))."
10499 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10503 *) val="$d_attribute_deprecated" ;;
10505 set d_attribute_deprecated
10509 : Look for GCC-style attribute warn_unused_result
10510 case "$d_attribute_warn_unused_result" in
10513 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
10514 $cat >attrib.c <<'EOCP'
10516 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
10518 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10519 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10520 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
10523 echo "Your C compiler supports __attribute__((warn_unused_result))."
10527 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10531 *) val="$d_attribute_warn_unused_result" ;;
10533 set d_attribute_warn_unused_result
10537 : see if bcmp exists
10541 : see if bcopy exists
10545 : see if getpgrp exists
10546 set getpgrp d_getpgrp
10549 case "$d_getpgrp" in
10552 echo "Checking to see which flavor of getpgrp is in use..."
10554 #$i_unistd I_UNISTD
10555 #include <sys/types.h>
10557 # include <unistd.h>
10559 #$i_stdlib I_STDLIB
10561 #include <stdlib.h>
10565 if (getuid() == 0) {
10566 printf("(I see you are running Configure as super-user...)\n");
10569 #ifdef TRY_BSD_PGRP
10570 if (getpgrp(1) == 0)
10579 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10580 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
10582 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10583 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
10586 echo "I can't seem to compile and run the test program."
10588 xxx="a USG one, i.e. you use getpgrp()."
10590 # SVR4 systems can appear rather BSD-ish.
10591 case "$i_unistd" in
10593 xxx="a BSD one, i.e. you use getpgrp(pid)."
10597 xxx="probably a USG one, i.e. you use getpgrp()."
10602 echo "Assuming your getpgrp is $xxx" >&4
10611 : see if setpgrp exists
10612 set setpgrp d_setpgrp
10615 case "$d_setpgrp" in
10618 echo "Checking to see which flavor of setpgrp is in use..."
10620 #$i_unistd I_UNISTD
10621 #include <sys/types.h>
10623 # include <unistd.h>
10625 #$i_stdlib I_STDLIB
10627 #include <stdlib.h>
10631 if (getuid() == 0) {
10632 printf("(I see you are running Configure as super-user...)\n");
10635 #ifdef TRY_BSD_PGRP
10636 if (-1 == setpgrp(1, 1))
10639 if (setpgrp() != -1)
10645 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10646 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
10648 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10649 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
10652 echo "(I can't seem to compile and run the test program.)"
10654 xxx="a USG one, i.e. you use setpgrp()."
10656 # SVR4 systems can appear rather BSD-ish.
10657 case "$i_unistd" in
10659 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
10663 xxx="probably a USG one, i.e. you use setpgrp()."
10668 echo "Assuming your setpgrp is $xxx" >&4
10677 : Look for GCC-style __builtin_choose_expr
10678 case "$d_builtin_choose_expr" in
10681 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
10682 $cat >try.c <<'EOCP'
10683 #include <assert.h>
10684 #include <stdlib.h>
10687 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
10690 assert( SYRINX(1) == 2112 );
10691 assert( SYRINX(1) != 5150 );
10692 assert( SYRINX(0) == 5150 );
10693 assert( SYRINX(0) != 2112 );
10694 puts( "All good!" );
10700 if eval $compile && $run ./try; then
10701 echo "Your C compiler supports __builtin_choose_expr."
10704 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10708 *) val="$d_builtin_choose_expr" ;;
10711 set d_builtin_choose_expr
10715 : Look for GCC-style __builtin_expect
10716 case "$d_builtin_expect" in
10719 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
10720 $cat >try.c <<'EOCP'
10723 if ( __builtin_expect(n, 0) ) n = 1;
10724 /* Remember shell exit code truth is 0, C truth is non-zero */
10729 if eval $compile && $run ./try; then
10730 echo "Your C compiler supports __builtin_expect."
10733 echo "Your C compiler doesn't seem to understand __builtin_expect."
10737 *) val="$d_builtin_expect" ;;
10740 set d_builtin_expect
10744 : see if bzero exists
10748 : see if stdarg is available
10750 if $test `./findhdr stdarg.h`; then
10751 echo "<stdarg.h> found." >&4
10754 echo "<stdarg.h> NOT found." >&4
10758 : see if varags is available
10760 if $test `./findhdr varargs.h`; then
10761 echo "<varargs.h> found." >&4
10763 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
10766 : set up the varargs testing programs
10767 $cat > varargs.c <<EOP
10769 #include <stdarg.h>
10772 #include <varargs.h>
10776 int f(char *p, ...)
10790 p = va_arg(ap, char *);
10796 $cat > varargs <<EOP
10798 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
10807 : now check which varargs header should be included
10812 if `./varargs I_STDARG`; then
10814 elif `./varargs I_VARARGS`; then
10819 if `./varargs I_VARARGS`; then
10826 echo "I could not find the definition for va_dcl... You have problems..." >&4
10827 val="$undef"; set i_stdarg; eval $setvar
10828 val="$undef"; set i_varargs; eval $setvar
10833 case "$i_varhdr" in
10835 val="$define"; set i_stdarg; eval $setvar
10836 val="$undef"; set i_varargs; eval $setvar
10839 val="$undef"; set i_stdarg; eval $setvar
10840 val="$define"; set i_varargs; eval $setvar
10843 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
10847 : see if the Compiler supports C99 variadic macros
10848 case "$i_stdarg$i_stdlib" in
10850 echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
10853 #include <stdarg.h>
10855 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
10859 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
10865 if eval $compile && $run ./try 2>&1 >/dev/null; then
10866 case "`$run ./try`" in
10868 echo "You have C99 variadic macros." >&4
10869 d_c99_variadic_macros="$define"
10872 echo "You don't have functional C99 variadic macros." >&4
10873 d_c99_variadic_macros="$undef"
10877 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
10878 d_c99_variadic_macros="$undef"
10883 echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
10884 d_c99_variadic_macros="$undef"
10888 : see if signal is declared as pointer to function returning int or void
10890 xxx=`./findhdr signal.h`
10891 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
10892 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10893 echo "You have int (*signal())() instead of void." >&4
10895 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10896 echo "You have void (*signal())()." >&4
10898 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
10899 echo "You have int (*signal())() instead of void." >&4
10901 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
10902 echo "You have void (*signal())()." >&4
10905 case "$d_voidsig" in
10907 echo "I can't determine whether signal handler returns void or int..." >&4
10909 rp="What type does your signal handler return?"
10912 v*) val="$define";;
10916 echo "As you already told me, signal handler returns void." >&4
10919 *) echo "As you already told me, signal handler returns int." >&4
10926 case "$d_voidsig" in
10927 "$define") signal_t="void";;
10928 *) signal_t="int";;
10932 : check for ability to cast large floats to 32-bit ints.
10934 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
10935 if $test "$intsize" -ge 4; then
10942 #$i_stdlib I_STDLIB
10944 #include <stdlib.h>
10946 #include <sys/types.h>
10947 #include <signal.h>
10948 $signal_t blech(int s) { exit(3); }
10955 signal(SIGFPE, blech);
10957 /* Don't let compiler optimize the test away. Store the number
10958 in a writable string for gcc to pass to sscanf under HP-UX.
10960 sprintf(str, "2147483647");
10961 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
10965 /* x86 processors will probably give 0x8000 0000, which is a
10966 sign change. We don't want that. We want to mimic SPARC
10967 behavior here, which is to preserve the sign and give
10970 if (i32 != ($xxx) f)
10976 if eval $compile_ok; then
10980 echo "(I can't seem to compile the test program--assuming it can't)"
10985 echo "Yup, it can."
10988 echo "Nope, it can't."
10995 : check for ability to cast negative floats to unsigned
10997 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
11000 #$i_stdlib I_STDLIB
11002 #include <stdlib.h>
11004 #include <sys/types.h>
11005 #include <signal.h>
11006 $signal_t blech(int s) { exit(7); }
11007 $signal_t blech_in_list(int s) { exit(4); }
11008 unsigned long dummy_long(unsigned long p) { return p; }
11009 unsigned int dummy_int(unsigned int p) { return p; }
11010 unsigned short dummy_short(unsigned short p) { return p; }
11014 unsigned long along;
11016 unsigned short ashort;
11020 /* Frustrate gcc-2.7.2's optimizer which failed this test with
11021 a direct f = -123. assignment. gcc-2.8.0 reportedly
11022 optimized the whole file away
11024 /* Store the number in a writable string for gcc to pass to
11025 sscanf under HP-UX.
11027 sprintf(str, "-123");
11028 sscanf(str, "%lf", &f); /* f = -123.; */
11030 signal(SIGFPE, blech);
11031 along = (unsigned long)f;
11032 aint = (unsigned int)f;
11033 ashort = (unsigned short)f;
11034 if (along != (unsigned long)-123)
11036 if (aint != (unsigned int)-123)
11038 if (ashort != (unsigned short)-123)
11040 sprintf(str, "1073741824.");
11041 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
11044 along = (unsigned long)f;
11045 if (along != 0x80000000)
11049 along = (unsigned long)f;
11050 if (along != 0x7fffffff)
11054 along = (unsigned long)f;
11055 if (along != 0x80000001)
11059 signal(SIGFPE, blech_in_list);
11060 sprintf(str, "123.");
11061 sscanf(str, "%lf", &f); /* f = 123.; */
11062 along = dummy_long((unsigned long)f);
11063 aint = dummy_int((unsigned int)f);
11064 ashort = dummy_short((unsigned short)f);
11065 if (along != (unsigned long)123)
11067 if (aint != (unsigned int)123)
11069 if (ashort != (unsigned short)123)
11076 if eval $compile_ok; then
11080 echo "(I can't seem to compile the test program--assuming it can't)"
11083 case "$castflags" in
11085 echo "Yup, it can."
11088 echo "Nope, it can't."
11095 : see if vprintf exists
11097 if set vprintf val -f d_vprintf; eval $csym; $val; then
11098 echo 'vprintf() found.' >&4
11101 #$i_stdarg I_STDARG /* Only one of these can be defined by i_varhrd */
11102 #$i_varargs I_VARARGS
11104 #$i_stdlib I_STDLIB
11105 #$i_unistd I_UNISTD
11108 # include <stdarg.h>
11109 #else /* I_VARARGS */
11110 # include <varargs.h>
11114 # include <unistd.h>
11118 # include <stdlib.h>
11121 #include <stdio.h> /* vsprintf prototype */
11124 void xxx(int n, ...)
11129 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11131 int main() { xxx(1, "foo"); }
11133 #else /* I_VARARGS */
11141 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11143 int main() { xxx("foo"); }
11149 if eval $compile_ok; then
11150 if $run ./try; then
11151 echo "Your vsprintf() returns (int)." >&4
11154 echo "Your vsprintf() returns (char*)." >&4
11158 echo 'I am unable to compile the vsprintf() test program.' >&4
11159 # We shouldn't get here. If we do, assume the standard signature,
11160 # not the old BSD one.
11161 echo 'Guessing that vsprintf() returns (int).' >&4
11165 echo 'vprintf() NOT found.' >&4
11176 : see if chown exists
11180 : see if chroot exists
11181 set chroot d_chroot
11184 : see if chsize exists
11185 set chsize d_chsize
11188 : see if class exists
11192 : see if clearenv exists
11193 set clearenv d_clearenv
11196 : Define hasstruct macro for Configure internal use
11197 hasstruct='varname=$1; struct=$2; shift; shift;
11198 while $test $# -ge 2; do
11200 $define) echo "#include <$2>";;
11204 echo "int main () { struct $struct foo; }" >> try.c;
11206 if eval $compile; then
11215 : see whether socket exists
11219 $echo $n "Hmm... $c" >&4
11220 if set socket val -f d_socket; eval $csym; $val; then
11221 echo "Looks like you have Berkeley networking support." >&4
11223 if set setsockopt val -f; eval $csym; $val; then
11226 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
11227 d_oldsock="$define"
11230 if $contains socklib libc.list >/dev/null 2>&1; then
11231 echo "Looks like you have Berkeley networking support." >&4
11233 : we will have to assume that it supports the 4.2 BSD interface
11236 echo "You don't have Berkeley networking in libc$_a..." >&4
11237 if test "X$d_socket" = "X$define"; then
11238 echo "...but you seem to believe that you have sockets." >&4
11240 for net in net socket
11242 if test -f /usr/lib/lib$net$_a; then
11243 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
11244 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
11245 if $contains socket libc.list >/dev/null 2>&1; then
11250 echo "...but the Wollongong group seems to have hacked it in." >&4
11251 sockethdr="-I/usr/netinclude"
11254 echo "Found Berkeley sockets interface in lib$net." >&4
11255 if $contains setsockopt libc.list >/dev/null 2>&1; then
11258 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
11259 d_oldsock="$define"
11265 if test "X$d_socket" != "X$define"; then
11266 echo "or anywhere else I see." >&4
11274 : see if socketpair exists
11275 set socketpair d_sockpair
11280 echo "Checking the availability sa_len in the sock struct ..." >&4
11282 #include <sys/types.h>
11283 #include <sys/socket.h>
11285 struct sockaddr sa;
11286 return (sa.sa_len);
11290 set try; if eval $compile; then
11293 set d_sockaddr_sa_len; eval $setvar
11297 echo "Checking the availability sin6_scope_id in struct sockaddr_in6 ..." >&4
11299 #include <sys/types.h>
11300 #include <sys/socket.h>
11301 #include <netinet/in.h>
11303 struct sockaddr_in6 sin6;
11304 return (sin6.sin6_scope_id);
11308 set try; if eval $compile; then
11311 set d_sin6_scope_id; eval $setvar
11315 echo "Checking the availability of certain socket constants..." >&4
11316 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
11317 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
11319 #include <sys/types.h>
11320 #include <sys/socket.h>
11326 set try; if eval $compile; then
11329 set d_${enum}; eval $setvar
11333 : see if this is a sys/uio.h system
11334 set sys/uio.h i_sysuio
11337 : Check for cmsghdr support
11339 echo "Checking to see if your system supports struct cmsghdr..." >&4
11340 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
11342 case "$d_cmsghdr_s" in
11343 "$define") echo "Yes, it does." ;;
11344 *) echo "No, it doesn't." ;;
11348 : check for const keyword
11350 echo 'Checking to see if your C compiler knows about "const"...' >&4
11351 $cat >const.c <<'EOCP'
11352 typedef struct spug { int drokk; } spug;
11356 const spug y = { 0 };
11359 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
11361 echo "Yup, it does."
11364 echo "Nope, it doesn't."
11369 : see if copysignl exists
11370 set copysignl d_copysignl
11373 : see if crypt exists
11378 $define) cryptlib='' ;;
11379 *) if set crypt val -f d_crypt; eval $csym; $val; then
11380 echo 'crypt() found.' >&4
11384 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
11385 if $test -z "$cryptlib"; then
11386 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
11390 if $test -z "$cryptlib"; then
11391 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
11395 if $test -z "$cryptlib"; then
11396 cryptlib=`./loc libcrypt$_a "" $libpth`
11400 if $test -z "$cryptlib"; then
11401 echo 'crypt() NOT found.' >&4
11412 : see if this is a crypt.h system
11413 set crypt.h i_crypt
11416 : see if crypt_r exists
11417 set crypt_r d_crypt_r
11419 case "$d_crypt_r" in
11421 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
11422 case "$d_crypt_r_proto:$usethreads" in
11423 ":define") d_crypt_r_proto=define
11424 set d_crypt_r_proto crypt_r $hdrs
11428 case "$d_crypt_r_proto" in
11430 case "$crypt_r_proto" in
11431 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
11432 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCS ;;
11434 case "$crypt_r_proto" in
11435 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
11436 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCD ;;
11438 case "$crypt_r_proto" in
11439 ''|0) d_crypt_r=undef
11441 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
11442 * ) case "$crypt_r_proto" in
11443 REENTRANT_PROTO*) ;;
11444 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
11446 echo "Prototype: $try" ;;
11449 *) case "$usethreads" in
11450 define) echo "crypt_r has no prototype, not using it." >&4 ;;
11461 : get csh whereabouts
11463 'csh') val="$undef" ;;
11464 *) val="$define" ;;
11468 : Respect a hint or command line value for full_csh.
11469 case "$full_csh" in
11470 '') full_csh=$csh ;;
11473 : see if ctermid exists
11474 set ctermid d_ctermid
11477 : see if ctermid_r exists
11478 set ctermid_r d_ctermid_r
11480 case "$d_ctermid_r" in
11482 hdrs="$i_systypes sys/types.h define stdio.h "
11483 case "$d_ctermid_r_proto:$usethreads" in
11484 ":define") d_ctermid_r_proto=define
11485 set d_ctermid_r_proto ctermid_r $hdrs
11489 case "$d_ctermid_r_proto" in
11491 case "$ctermid_r_proto" in
11492 ''|0) try='char* ctermid_r(char*);'
11493 ./protochk "$extern_C $try" $hdrs && ctermid_r_proto=B_B ;;
11495 case "$ctermid_r_proto" in
11496 ''|0) d_ctermid_r=undef
11498 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
11499 * ) case "$ctermid_r_proto" in
11500 REENTRANT_PROTO*) ;;
11501 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
11503 echo "Prototype: $try" ;;
11506 *) case "$usethreads" in
11507 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
11514 *) ctermid_r_proto=0
11518 : see if ctime_r exists
11519 set ctime_r d_ctime_r
11521 case "$d_ctime_r" in
11523 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
11524 case "$d_ctime_r_proto:$usethreads" in
11525 ":define") d_ctime_r_proto=define
11526 set d_ctime_r_proto ctime_r $hdrs
11530 case "$d_ctime_r_proto" in
11532 case "$ctime_r_proto" in
11533 ''|0) try='char* ctime_r(const time_t*, char*);'
11534 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SB ;;
11536 case "$ctime_r_proto" in
11537 ''|0) try='char* ctime_r(const time_t*, char*, int);'
11538 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SBI ;;
11540 case "$ctime_r_proto" in
11541 ''|0) try='int ctime_r(const time_t*, char*);'
11542 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SB ;;
11544 case "$ctime_r_proto" in
11545 ''|0) try='int ctime_r(const time_t*, char*, int);'
11546 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SBI ;;
11548 case "$ctime_r_proto" in
11549 ''|0) d_ctime_r=undef
11551 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
11552 * ) case "$ctime_r_proto" in
11553 REENTRANT_PROTO*) ;;
11554 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
11556 echo "Prototype: $try" ;;
11559 *) case "$usethreads" in
11560 define) echo "ctime_r has no prototype, not using it." >&4 ;;
11571 : see if cuserid exists
11572 set cuserid d_cuserid
11575 : see if this is a limits.h system
11576 set limits.h i_limits
11579 : see if this is a float.h system
11580 set float.h i_float
11583 : See if number of significant digits in a double precision number is known
11585 $cat >dbl_dig.c <<EOM
11586 #$i_limits I_LIMITS
11589 #include <limits.h>
11595 printf("Contains DBL_DIG");
11598 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
11599 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
11600 echo "DBL_DIG found." >&4
11603 echo "DBL_DIG NOT found." >&4
11610 : see if dbm.h is available
11611 : see if dbmclose exists
11612 set dbmclose d_dbmclose
11615 case "$d_dbmclose" in
11625 *) set rpcsvc/dbm.h i_rpcsvcdbm
11630 *) echo "We won't be including <dbm.h>"
11640 : see if prototype for dbminit is available
11642 set d_dbminitproto dbminit $i_dbm dbm.h
11645 : see if difftime exists
11646 set difftime d_difftime
11649 : see if this is a dirent system
11651 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
11653 echo "<dirent.h> found." >&4
11656 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
11657 echo "<sys/dir.h> found." >&4
11660 xinc=`./findhdr sys/ndir.h`
11662 echo "<dirent.h> NOT found." >&4
11667 : Look for type of directory structure.
11669 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11671 case "$direntrytype" in
11673 case "$i_dirent" in
11674 $define) guess1='struct dirent' ;;
11675 *) guess1='struct direct' ;;
11678 *) guess1="$direntrytype"
11683 'struct dirent') guess2='struct direct' ;;
11684 *) guess2='struct dirent' ;;
11687 if $contains "$guess1" try.c >/dev/null 2>&1; then
11688 direntrytype="$guess1"
11689 echo "Your directory entries are $direntrytype." >&4
11690 elif $contains "$guess2" try.c >/dev/null 2>&1; then
11691 direntrytype="$guess2"
11692 echo "Your directory entries seem to be $direntrytype." >&4
11694 echo "I don't recognize your system's directory entries." >&4
11695 rp="What type is used for directory entries on this system?"
11698 direntrytype="$ans"
11702 : see if the directory entry stores field length
11704 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11705 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
11706 echo "Good, your directory entry keeps length information in d_namlen." >&4
11709 echo "Your directory entry does not know about the d_namlen field." >&4
11716 : Look for DIR.dd_fd
11717 case "$i_dirent" in
11719 echo "Checking to see if DIR has a dd_fd member variable" >&4
11721 #$i_stdlib I_STDLIB
11723 #include <stdlib.h>
11725 #include <dirent.h>
11735 if eval $compile; then
11736 echo "Yes, it does."
11739 echo "No, it does not."
11744 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
11752 : see if this is an sysdir system
11753 set sys/dir.h i_sysdir
11756 : see if this is an sysndir system
11757 set sys/ndir.h i_sysndir
11762 $cat >dirfd.c <<EOM
11764 #$i_stdlib I_STDLIB
11766 #include <stdlib.h>
11768 #$i_dirent I_DIRENT /**/
11769 #$i_sysdir I_SYS_DIR /**/
11770 #$i_sysndir I_SYS_NDIR /**/
11771 #$i_systypes I_SYS_TYPES /**/
11772 #if defined(I_SYS_TYPES)
11773 #include <sys/types.h>
11775 #if defined(I_DIRENT)
11776 #include <dirent.h>
11777 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
11778 #include <sys/dir.h>
11782 #include <sys/ndir.h>
11786 #include <ndir.h> /* may be wrong in the future */
11788 #include <sys/dir.h>
11794 DIR *dirp = opendir(".");
11795 if (dirfd(dirp) >= 0)
11803 if eval $compile; then
11807 $define) echo "dirfd() found." >&4 ;;
11808 *) echo "dirfd() NOT found." >&4 ;;
11814 : see if dlerror exists
11817 set dlerror d_dlerror
11821 : see if dlfcn is available
11822 set dlfcn.h i_dlfcn
11825 : Check what extension to use for shared libs
11830 On a few systems, the dynamically loaded modules that perl generates and uses
11831 will need a different extension than shared libs. The default will probably
11837 *) dflt="$dlext" ;;
11839 rp='What is the extension of dynamically loaded modules'
11848 : Check if dlsym need a leading underscore
11854 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
11855 $cat >dyna.c <<'EOM'
11862 #$i_stdlib I_STDLIB
11864 #include <stdlib.h>
11868 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
11870 #include <sys/types.h>
11875 extern int fred() ;
11884 int mode = RTLD_LAZY ;
11886 handle = dlopen("./dyna.$dlext", mode) ;
11887 if (handle == NULL) {
11892 symbol = dlsym(handle, "fred") ;
11893 if (symbol == NULL) {
11894 /* try putting a leading underscore */
11895 symbol = dlsym(handle, "_fred") ;
11896 if (symbol == NULL) {
11909 : Call the object file tmp-dyna.o in case dlext=o.
11910 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
11911 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
11912 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
11913 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
11916 1) echo "Test program failed using dlopen." >&4
11917 echo "Perhaps you should not use dynamic loading." >&4;;
11918 2) echo "Test program failed using dlsym." >&4
11919 echo "Perhaps you should not use dynamic loading." >&4;;
11920 3) echo "dlsym needs a leading underscore" >&4
11922 4) echo "dlsym doesn't need a leading underscore." >&4;;
11925 echo "I can't compile and run the test program." >&4
11926 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
11931 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
11936 : see if drand48_r exists
11937 set drand48_r d_drand48_r
11939 case "$d_drand48_r" in
11941 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
11942 case "$d_drand48_r_proto:$usethreads" in
11943 ":define") d_drand48_r_proto=define
11944 set d_drand48_r_proto drand48_r $hdrs
11948 case "$d_drand48_r_proto" in
11950 case "$drand48_r_proto" in
11951 ''|0) try='int drand48_r(struct drand48_data*, double*);'
11952 ./protochk "$extern_C $try" $hdrs && drand48_r_proto=I_ST ;;
11954 case "$drand48_r_proto" in
11955 ''|0) d_drand48_r=undef
11957 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
11958 * ) case "$drand48_r_proto" in
11959 REENTRANT_PROTO*) ;;
11960 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
11962 echo "Prototype: $try" ;;
11965 *) case "$usethreads" in
11966 define) echo "drand48_r has no prototype, not using it." >&4 ;;
11973 *) drand48_r_proto=0
11977 : see if prototype for drand48 is available
11979 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
11982 : see if dup2 exists
11986 : see if eaccess exists
11987 set eaccess d_eaccess
11990 : see if endgrent exists
11991 set endgrent d_endgrent
11994 : see if this is an grp system
12000 xxx=`./findhdr grp.h`
12001 $cppstdin $cppflags $cppminus < $xxx >$$.h
12003 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
12015 set d_grpasswd; eval $setvar
12019 : see if endgrent_r exists
12020 set endgrent_r d_endgrent_r
12022 case "$d_endgrent_r" in
12024 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12025 case "$d_endgrent_r_proto:$usethreads" in
12026 ":define") d_endgrent_r_proto=define
12027 set d_endgrent_r_proto endgrent_r $hdrs
12031 case "$d_endgrent_r_proto" in
12033 case "$endgrent_r_proto" in
12034 ''|0) try='int endgrent_r(FILE**);'
12035 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=I_H ;;
12037 case "$endgrent_r_proto" in
12038 ''|0) try='void endgrent_r(FILE**);'
12039 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=V_H ;;
12041 case "$endgrent_r_proto" in
12042 ''|0) d_endgrent_r=undef
12044 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
12045 * ) case "$endgrent_r_proto" in
12046 REENTRANT_PROTO*) ;;
12047 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
12049 echo "Prototype: $try" ;;
12052 *) case "$usethreads" in
12053 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
12060 *) endgrent_r_proto=0
12064 : see if endhostent exists
12065 set endhostent d_endhent
12068 : see if this is a netdb.h system
12069 set netdb.h i_netdb
12072 : see if endhostent_r exists
12073 set endhostent_r d_endhostent_r
12075 case "$d_endhostent_r" in
12077 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12078 case "$d_endhostent_r_proto:$usethreads" in
12079 ":define") d_endhostent_r_proto=define
12080 set d_endhostent_r_proto endhostent_r $hdrs
12084 case "$d_endhostent_r_proto" in
12086 case "$endhostent_r_proto" in
12087 ''|0) try='int endhostent_r(struct hostent_data*);'
12088 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=I_D ;;
12090 case "$endhostent_r_proto" in
12091 ''|0) try='void endhostent_r(struct hostent_data*);'
12092 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=V_D ;;
12094 case "$endhostent_r_proto" in
12095 ''|0) d_endhostent_r=undef
12096 endhostent_r_proto=0
12097 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
12098 * ) case "$endhostent_r_proto" in
12099 REENTRANT_PROTO*) ;;
12100 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
12102 echo "Prototype: $try" ;;
12105 *) case "$usethreads" in
12106 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
12108 d_endhostent_r=undef
12109 endhostent_r_proto=0
12113 *) endhostent_r_proto=0
12117 : see if endnetent exists
12118 set endnetent d_endnent
12121 : see if endnetent_r exists
12122 set endnetent_r d_endnetent_r
12124 case "$d_endnetent_r" in
12126 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12127 case "$d_endnetent_r_proto:$usethreads" in
12128 ":define") d_endnetent_r_proto=define
12129 set d_endnetent_r_proto endnetent_r $hdrs
12133 case "$d_endnetent_r_proto" in
12135 case "$endnetent_r_proto" in
12136 ''|0) try='int endnetent_r(struct netent_data*);'
12137 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=I_D ;;
12139 case "$endnetent_r_proto" in
12140 ''|0) try='void endnetent_r(struct netent_data*);'
12141 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=V_D ;;
12143 case "$endnetent_r_proto" in
12144 ''|0) d_endnetent_r=undef
12145 endnetent_r_proto=0
12146 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
12147 * ) case "$endnetent_r_proto" in
12148 REENTRANT_PROTO*) ;;
12149 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
12151 echo "Prototype: $try" ;;
12154 *) case "$usethreads" in
12155 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
12157 d_endnetent_r=undef
12158 endnetent_r_proto=0
12162 *) endnetent_r_proto=0
12166 : see if endprotoent exists
12167 set endprotoent d_endpent
12170 : see if endprotoent_r exists
12171 set endprotoent_r d_endprotoent_r
12173 case "$d_endprotoent_r" in
12175 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12176 case "$d_endprotoent_r_proto:$usethreads" in
12177 ":define") d_endprotoent_r_proto=define
12178 set d_endprotoent_r_proto endprotoent_r $hdrs
12182 case "$d_endprotoent_r_proto" in
12184 case "$endprotoent_r_proto" in
12185 ''|0) try='int endprotoent_r(struct protoent_data*);'
12186 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=I_D ;;
12188 case "$endprotoent_r_proto" in
12189 ''|0) try='void endprotoent_r(struct protoent_data*);'
12190 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=V_D ;;
12192 case "$endprotoent_r_proto" in
12193 ''|0) d_endprotoent_r=undef
12194 endprotoent_r_proto=0
12195 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
12196 * ) case "$endprotoent_r_proto" in
12197 REENTRANT_PROTO*) ;;
12198 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
12200 echo "Prototype: $try" ;;
12203 *) case "$usethreads" in
12204 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
12206 d_endprotoent_r=undef
12207 endprotoent_r_proto=0
12211 *) endprotoent_r_proto=0
12215 : see if endpwent exists
12216 set endpwent d_endpwent
12219 : see if this is a pwd.h system
12225 xxx=`./findhdr pwd.h`
12226 $cppstdin $cppflags $cppminus < $xxx >$$.h
12228 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
12236 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
12244 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
12252 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
12260 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
12268 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
12276 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
12284 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
12296 set d_pwquota; eval $setvar
12297 set d_pwage; eval $setvar
12298 set d_pwchange; eval $setvar
12299 set d_pwclass; eval $setvar
12300 set d_pwexpire; eval $setvar
12301 set d_pwcomment; eval $setvar
12302 set d_pwgecos; eval $setvar
12303 set d_pwpasswd; eval $setvar
12307 : see if endpwent_r exists
12308 set endpwent_r d_endpwent_r
12310 case "$d_endpwent_r" in
12312 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
12313 case "$d_endpwent_r_proto:$usethreads" in
12314 ":define") d_endpwent_r_proto=define
12315 set d_endpwent_r_proto endpwent_r $hdrs
12319 case "$d_endpwent_r_proto" in
12321 case "$endpwent_r_proto" in
12322 ''|0) try='int endpwent_r(FILE**);'
12323 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=I_H ;;
12325 case "$endpwent_r_proto" in
12326 ''|0) try='void endpwent_r(FILE**);'
12327 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=V_H ;;
12329 case "$endpwent_r_proto" in
12330 ''|0) d_endpwent_r=undef
12332 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
12333 * ) case "$endpwent_r_proto" in
12334 REENTRANT_PROTO*) ;;
12335 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
12337 echo "Prototype: $try" ;;
12340 *) case "$usethreads" in
12341 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
12348 *) endpwent_r_proto=0
12352 : see if endservent exists
12353 set endservent d_endsent
12356 : see if endservent_r exists
12357 set endservent_r d_endservent_r
12359 case "$d_endservent_r" in
12361 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12362 case "$d_endservent_r_proto:$usethreads" in
12363 ":define") d_endservent_r_proto=define
12364 set d_endservent_r_proto endservent_r $hdrs
12368 case "$d_endservent_r_proto" in
12370 case "$endservent_r_proto" in
12371 ''|0) try='int endservent_r(struct servent_data*);'
12372 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=I_D ;;
12374 case "$endservent_r_proto" in
12375 ''|0) try='void endservent_r(struct servent_data*);'
12376 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=V_D ;;
12378 case "$endservent_r_proto" in
12379 ''|0) d_endservent_r=undef
12380 endservent_r_proto=0
12381 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
12382 * ) case "$endservent_r_proto" in
12383 REENTRANT_PROTO*) ;;
12384 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
12386 echo "Prototype: $try" ;;
12389 *) case "$usethreads" in
12390 define) echo "endservent_r has no prototype, not using it." >&4 ;;
12392 d_endservent_r=undef
12393 endservent_r_proto=0
12397 *) endservent_r_proto=0
12401 : Locate the flags for 'open()'
12404 #include <sys/types.h>
12409 #include <sys/file.h>
12411 #$i_stdlib I_STDLIB
12413 #include <stdlib.h>
12424 : check sys/file.h first to get FREAD on Sun
12425 if $test `./findhdr sys/file.h` && \
12426 set try -DI_SYS_FILE && eval $compile; then
12428 echo "<sys/file.h> defines the O_* constants..." >&4
12429 if $run ./try; then
12430 echo "and you have the 3 argument form of open()." >&4
12433 echo "but not the 3 argument form of open(). Oh, well." >&4
12436 elif $test `./findhdr fcntl.h` && \
12437 set try -DI_FCNTL && eval $compile; then
12439 echo "<fcntl.h> defines the O_* constants..." >&4
12440 if $run ./try; then
12441 echo "and you have the 3 argument form of open()." >&4
12444 echo "but not the 3 argument form of open(). Oh, well." >&4
12449 echo "I can't find the O_* constant definitions! You got problems." >&4
12455 : see if this is a sys/file.h system
12460 : do we need to include sys/file.h ?
12464 if $h_sysfile; then
12466 echo "We'll be including <sys/file.h>." >&4
12469 echo "We won't be including <sys/file.h>." >&4
12479 : see if fcntl.h is there
12484 : see if we can include fcntl.h
12490 echo "We'll be including <fcntl.h>." >&4
12493 if $h_sysfile; then
12494 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
12496 echo "We won't be including <fcntl.h>." >&4
12508 : see if fork exists
12512 : see if pipe exists
12516 : check for non-blocking I/O stuff
12517 case "$h_sysfile" in
12518 true) echo "#include <sys/file.h>" > head.c;;
12521 true) echo "#include <fcntl.h>" > head.c;;
12522 *) echo "#include <sys/fcntl.h>" > head.c;;
12527 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
12528 case "$o_nonblock" in
12530 $cat head.c > try.c
12531 $cat >>try.c <<EOCP
12533 #$i_stdlib I_STDLIB
12535 #include <stdlib.h>
12543 printf("O_NONBLOCK\n");
12547 printf("O_NDELAY\n");
12551 printf("FNDELAY\n");
12558 if eval $compile_ok; then
12559 o_nonblock=`$run ./try`
12560 case "$o_nonblock" in
12561 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
12562 *) echo "Seems like we can use $o_nonblock.";;
12565 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
12568 *) echo "Using $hint value $o_nonblock.";;
12573 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
12576 case "$d_fork:$d_pipe" in
12578 $cat head.c > try.c
12579 $cat >>try.c <<EOCP
12581 #include <sys/types.h>
12582 #include <signal.h>
12584 #$i_stdlib I_STDLIB
12586 #include <stdlib.h>
12592 #define MY_O_NONBLOCK $o_nonblock
12593 #ifndef errno /* XXX need better Configure test */
12596 #$i_unistd I_UNISTD
12598 #include <unistd.h>
12600 #$i_string I_STRING
12602 #include <string.h>
12604 #include <strings.h>
12606 $signal_t blech(int x) { exit(3); }
12608 $cat >> try.c <<'EOCP'
12616 pipe(pd); /* Down: child -> parent */
12617 pipe(pu); /* Up: parent -> child */
12620 close(pd[1]); /* Parent reads from pd[0] */
12621 close(pu[0]); /* Parent writes (blocking) to pu[1] */
12623 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
12628 signal(SIGALRM, blech);
12630 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
12632 sprintf(string, "%d\n", ret);
12633 write(2, string, strlen(string));
12636 if (errno == EAGAIN) {
12637 printf("EAGAIN\n");
12642 if (errno == EWOULDBLOCK)
12643 printf("EWOULDBLOCK\n");
12646 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
12647 sleep(2); /* Give it time to close our pipe */
12649 ret = read(pd[0], buf, 1); /* Should read EOF */
12651 sprintf(string, "%d\n", ret);
12652 write(4, string, strlen(string));
12656 close(pd[0]); /* We write to pd[1] */
12657 close(pu[1]); /* We read from pu[0] */
12658 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
12659 close(pd[1]); /* Pipe pd is now fully closed! */
12660 exit(0); /* Bye bye, thank you for playing! */
12664 if eval $compile_ok; then
12665 echo "$startsh" >mtry
12666 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
12668 ./mtry >/dev/null 2>&1
12670 0) eagain=`$cat try.out`;;
12671 1) echo "Could not perform non-blocking setting!";;
12672 2) echo "I did a successful read() for something that was not there!";;
12673 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
12674 4) echo "Could not find F_SETFL!";;
12675 *) echo "Something terribly wrong happened during testing.";;
12677 rd_nodata=`$cat try.ret`
12678 echo "A read() system call with no data present returns $rd_nodata."
12679 case "$rd_nodata" in
12682 echo "(That's peculiar, fixing that to be -1.)"
12688 echo "Forcing errno EAGAIN on read() with no data available."
12692 echo "Your read() sets errno to $eagain when no data is available."
12695 status=`$cat try.err`
12697 0) echo "And it correctly returns 0 to signal EOF.";;
12698 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
12699 *) echo "However, your read() returns '$status' on EOF??";;
12702 if test "$status" = "$rd_nodata"; then
12703 echo "WARNING: you can't distinguish between EOF and no data!"
12707 echo "I can't compile the test program--assuming errno EAGAIN will do."
12711 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
12720 echo "Using $hint value $eagain."
12721 echo "Your read() returns $rd_nodata when no data is present."
12722 case "$d_eofnblk" in
12723 "$define") echo "And you can see EOF because read() returns 0.";;
12724 "$undef") echo "But you can't see EOF status from read() returned value.";;
12726 echo "(Assuming you can't see EOF status from read anyway.)"
12732 $rm_try head.c mtry
12734 : see if _ptr and _cnt from stdio act std
12737 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
12738 echo "(Looks like you have stdio.h from BSD.)"
12739 case "$stdio_ptr" in
12740 '') stdio_ptr='((fp)->_p)'
12743 *) ptr_lval=$d_stdio_ptr_lval;;
12745 case "$stdio_cnt" in
12746 '') stdio_cnt='((fp)->_r)'
12749 *) cnt_lval=$d_stdio_cnt_lval;;
12751 case "$stdio_base" in
12752 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
12754 case "$stdio_bufsiz" in
12755 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
12757 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
12758 echo "(Looks like you have stdio.h from Linux.)"
12759 case "$stdio_ptr" in
12760 '') stdio_ptr='((fp)->_IO_read_ptr)'
12763 *) ptr_lval=$d_stdio_ptr_lval;;
12765 case "$stdio_cnt" in
12766 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
12769 *) cnt_lval=$d_stdio_cnt_lval;;
12771 case "$stdio_base" in
12772 '') stdio_base='((fp)->_IO_read_base)';;
12774 case "$stdio_bufsiz" in
12775 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
12778 case "$stdio_ptr" in
12779 '') stdio_ptr='((fp)->_ptr)'
12782 *) ptr_lval=$d_stdio_ptr_lval;;
12784 case "$stdio_cnt" in
12785 '') stdio_cnt='((fp)->_cnt)'
12788 *) cnt_lval=$d_stdio_cnt_lval;;
12790 case "$stdio_base" in
12791 '') stdio_base='((fp)->_base)';;
12793 case "$stdio_bufsiz" in
12794 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
12798 : test whether _ptr and _cnt really work
12799 echo "Checking how std your stdio is..." >&4
12802 #$i_stdlib I_STDLIB
12804 #include <stdlib.h>
12806 #define FILE_ptr(fp) $stdio_ptr
12807 #define FILE_cnt(fp) $stdio_cnt
12809 FILE *fp = fopen("try.c", "r");
12812 18 <= FILE_cnt(fp) &&
12813 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12821 if eval $compile && $to try.c; then
12822 if $run ./try; then
12823 echo "Your stdio acts pretty std."
12826 echo "Your stdio isn't very std."
12829 echo "Your stdio doesn't appear very std."
12833 # glibc 2.2.90 and above apparently change stdio streams so Perl's
12834 # direct buffer manipulation no longer works. The Configure tests
12835 # should be changed to correctly detect this, but until then,
12836 # the following check should at least let perl compile and run.
12837 # (This quick fix should be updated before 5.8.1.)
12838 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
12839 # A. Dougherty, June 3, 2002.
12840 case "$d_gnulibc" in
12842 case "$gnulibc_version" in
12846 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
12855 : Can _ptr be used as an lvalue?
12856 case "$d_stdstdio$ptr_lval" in
12857 $define$define) val=$define ;;
12860 set d_stdio_ptr_lval
12863 : Can _cnt be used as an lvalue?
12864 case "$d_stdstdio$cnt_lval" in
12865 $define$define) val=$define ;;
12868 set d_stdio_cnt_lval
12872 : test whether setting _ptr sets _cnt as a side effect
12873 d_stdio_ptr_lval_sets_cnt="$undef"
12874 d_stdio_ptr_lval_nochange_cnt="$undef"
12875 case "$d_stdio_ptr_lval$d_stdstdio" in
12877 echo "Checking to see what happens if we set the stdio ptr..." >&4
12880 /* Can we scream? */
12881 /* Eat dust sed :-) */
12882 /* In the buffer space, no one can hear you scream. */
12883 #$i_stdlib I_STDLIB
12885 #include <stdlib.h>
12887 #define FILE_ptr(fp) $stdio_ptr
12888 #define FILE_cnt(fp) $stdio_cnt
12889 #include <sys/types.h>
12891 FILE *fp = fopen("try.c", "r");
12896 puts("Fail even to read");
12899 c = getc(fp); /* Read away the first # */
12901 puts("Fail even to read");
12905 18 <= FILE_cnt(fp) &&
12906 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12908 puts("Fail even to read");
12911 ptr = (char*) FILE_ptr(fp);
12912 cnt = (size_t)FILE_cnt(fp);
12914 FILE_ptr(fp) += 42;
12916 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
12917 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
12920 if (FILE_cnt(fp) <= 20) {
12921 printf ("Fail (<20 chars to test)");
12924 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
12925 puts("Fail compare");
12928 if (cnt == FILE_cnt(fp)) {
12929 puts("Pass_unchanged");
12932 if (FILE_cnt(fp) == (cnt - 42)) {
12933 puts("Pass_changed");
12936 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
12942 if eval $compile && $to try.c; then
12943 case `$run ./try` in
12945 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
12946 d_stdio_ptr_lval_sets_cnt="$define" ;;
12948 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
12949 d_stdio_ptr_lval_nochange_cnt="$define" ;;
12951 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
12953 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
12956 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
12962 : see if _base is also standard
12964 case "$d_stdstdio" in
12968 #$i_stdlib I_STDLIB
12970 #include <stdlib.h>
12972 #define FILE_base(fp) $stdio_base
12973 #define FILE_bufsiz(fp) $stdio_bufsiz
12975 FILE *fp = fopen("try.c", "r");
12978 19 <= FILE_bufsiz(fp) &&
12979 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
12986 if eval $compile && $to try.c; then
12987 if $run ./try; then
12988 echo "And its _base field acts std."
12991 echo "But its _base field isn't std."
12994 echo "However, it seems to be lacking the _base field."
13002 : see if fast_stdio exists
13004 case "$d_stdstdio:$d_stdio_ptr_lval" in
13006 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
13008 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
13019 : see if fchdir exists
13020 set fchdir d_fchdir
13023 : see if fchmod exists
13024 set fchmod d_fchmod
13027 : see if fchown exists
13028 set fchown d_fchown
13031 : see if this is an fcntl system
13035 : See if fcntl-based locking works.
13038 #$i_stdlib I_STDLIB
13040 #include <stdlib.h>
13042 #include <unistd.h>
13044 #include <signal.h>
13045 $signal_t blech(int x) { exit(3); }
13047 #if defined(F_SETLK) && defined(F_SETLKW)
13048 struct flock flock;
13050 fd = open("try.c", O_RDONLY);
13051 flock.l_type = F_RDLCK;
13052 flock.l_whence = SEEK_SET;
13053 flock.l_start = flock.l_len = 0;
13054 signal(SIGALRM, blech);
13056 retval = fcntl(fd, F_SETLK, &flock);
13058 (retval < 0 ? exit(2) : exit(0));
13064 echo "Checking if fcntl-based file locking works... "
13068 if eval $compile_ok; then
13069 if $run ./try; then
13070 echo "Yes, it seems to work."
13073 echo "Nope, it didn't work."
13078 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
13079 *** This is (almost) impossible.
13080 *** If your NFS lock daemons are not feeling well, something like
13081 *** this may happen, please investigate. Cannot continue, aborting.
13089 echo "I'm unable to compile the test program, so I'll assume not."
13094 echo "Nope, since you don't even have fcntl()."
13097 set d_fcntl_can_lock
13101 : check for fd_set items
13104 Checking to see how well your C compiler handles fd_set and friends ...
13107 #$i_stdlib I_STDLIB
13109 #include <stdlib.h>
13111 #$i_systime I_SYS_TIME
13112 #$i_sysselct I_SYS_SELECT
13113 #$d_socket HAS_SOCKET
13114 #include <sys/types.h>
13116 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
13119 #include <sys/time.h>
13121 #ifdef I_SYS_SELECT
13122 #include <sys/select.h>
13131 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
13139 if eval $compile; then
13140 d_fds_bits="$define"
13142 echo "Well, your system knows about the normal fd_set typedef..." >&4
13143 if $run ./try; then
13144 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
13145 d_fd_macros="$define"
13148 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
13150 d_fd_macros="$undef"
13154 Hmm, your compiler has some difficulty with fd_set. Checking further...
13157 if eval $compile; then
13158 d_fds_bits="$undef"
13160 echo "Well, your system has some sort of fd_set available..." >&4
13161 if $run ./try; then
13162 echo "and you have the normal fd_set macros." >&4
13163 d_fd_macros="$define"
13166 but not the normal fd_set macros! Gross! More work for me...
13168 d_fd_macros="$undef"
13171 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
13173 d_fds_bits="$undef"
13174 d_fd_macros="$undef"
13179 : see if fgetpos exists
13180 set fgetpos d_fgetpos
13183 : see if finite exists
13184 set finite d_finite
13187 : see if finitel exists
13188 set finitel d_finitel
13191 : see if flock exists
13195 : see if prototype for flock is available
13197 set d_flockproto flock $i_sysfile sys/file.h
13200 : see if fp_class exists
13201 set fp_class d_fp_class
13204 : see if pathconf exists
13205 set pathconf d_pathconf
13208 : see if fpathconf exists
13209 set fpathconf d_fpathconf
13212 : see if fpclass exists
13213 set fpclass d_fpclass
13216 : see if fpclassify exists
13217 set fpclassify d_fpclassify
13220 : see if fpclassl exists
13221 set fpclassl d_fpclassl
13224 : check for fpos64_t
13226 echo "Checking to see if you have fpos64_t..." >&4
13229 int main() { fpos64_t x = 7; }
13232 if eval $compile; then
13234 echo "You have fpos64_t."
13237 echo "You do not have fpos64_t."
13238 case "$fpossize" in
13239 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
13246 : see if frexpl exists
13247 set frexpl d_frexpl
13250 : see if this is a sys/param system
13251 set sys/param.h i_sysparam
13254 : see if this is a sys/mount.h system
13255 set sys/mount.h i_sysmount
13258 : Check for fs_data_s
13260 echo "Checking to see if your system supports struct fs_data..." >&4
13261 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
13263 case "$d_fs_data_s" in
13264 "$define") echo "Yes, it does." ;;
13265 *) echo "No, it doesn't." ;;
13268 : see if fseeko exists
13269 set fseeko d_fseeko
13271 case "$longsize" in
13272 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
13275 : see if fsetpos exists
13276 set fsetpos d_fsetpos
13279 : see if fstatfs exists
13280 set fstatfs d_fstatfs
13283 : see if statvfs exists
13284 set statvfs d_statvfs
13287 : see if fstatvfs exists
13288 set fstatvfs d_fstatvfs
13292 : see if fsync exists
13296 : see if ftello exists
13297 set ftello d_ftello
13299 case "$longsize" in
13300 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
13303 : check for a working futimes
13306 echo "Checking if you have a working futimes()" >&4
13309 #include <sys/time.h>
13316 fd = open ("try.c", O_RDWR);
13317 if (-1 == fd) exit (1);
13318 rv = futimes (fd, NULL);
13319 exit (rv == -1 ? errno : 0);
13323 if eval $compile; then
13327 0) echo "Yes, you have" >&4
13328 d_futimes="$define"
13330 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
13334 echo "No, it does not (probably harmless)" >&4
13338 : see if ndbm.h is available
13341 : Compatibility location for RedHat 7.1
13342 set gdbm/ndbm.h i_gdbmndbm
13344 : Compatibility location for Debian 4.0
13345 set gdbm-ndbm.h i_gdbm_ndbm
13349 if $test "$i_ndbm" = "$define" -o "$i_gdbmndbm" = "$define" -o "$i_gdbm_ndbm" = "$define"; then
13350 : see if dbm_open exists
13351 set dbm_open d_dbm_open
13353 case "$d_dbm_open" in
13356 i_gdbmndbm="$undef"
13357 i_gdbm_ndbm="$undef"
13358 echo "We won't be including <ndbm.h>"
13368 ndbm_hdr_protochk='name=$1; hdr=$2;
13369 eval "ihdr=\$""i_$name";
13371 if $test "$ihdr" = "$define"; then
13372 $echo "Checking if your <$hdr> uses prototypes..." >&4;
13373 case "$d_cplusplus" in
13374 $define) ./protochk "$extern_C void dbm_close(DBM *);" literal "extern \"C\" {" $ihdr $hdr literal "}" && val="$define" ;;
13375 *) ./protochk "$extern_C void dbm_close(int, int);" $ihdr $hdr || val="$define" ;;
13378 $define) $echo "Your <$hdr> seems to have prototypes";;
13379 *) $echo "Your <$hdr> does not seem to have prototypes";;
13382 set "d_${name}_h_uses_prototypes";
13386 eval $ndbm_hdr_protochk
13387 set gdbmndbm gdbm/ndbm.h
13388 eval $ndbm_hdr_protochk
13389 set gdbm_ndbm gdbm-ndbm.h
13390 eval $ndbm_hdr_protochk
13392 : see if getaddrinfo exists
13393 set getaddrinfo d_getaddrinfo
13396 : see if getcwd exists
13397 set getcwd d_getcwd
13400 : see if getespwnam exists
13401 set getespwnam d_getespwnam
13404 : see if getfsstat exists
13405 set getfsstat d_getfsstat
13408 : see if getgrent exists
13409 set getgrent d_getgrent
13412 : see if getgrent_r exists
13413 set getgrent_r d_getgrent_r
13415 case "$d_getgrent_r" in
13417 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13418 case "$d_getgrent_r_proto:$usethreads" in
13419 ":define") d_getgrent_r_proto=define
13420 set d_getgrent_r_proto getgrent_r $hdrs
13424 case "$d_getgrent_r_proto" in
13426 case "$getgrent_r_proto" in
13427 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
13428 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBWR ;;
13430 case "$getgrent_r_proto" in
13431 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
13432 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIR ;;
13434 case "$getgrent_r_proto" in
13435 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
13436 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBW ;;
13438 case "$getgrent_r_proto" in
13439 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
13440 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBI ;;
13442 case "$getgrent_r_proto" in
13443 ''|0) try='int getgrent_r(struct group*, char*, int);'
13444 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBI ;;
13446 case "$getgrent_r_proto" in
13447 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
13448 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIH ;;
13450 case "$getgrent_r_proto" in
13451 ''|0) d_getgrent_r=undef
13453 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
13454 * ) case "$getgrent_r_proto" in
13455 REENTRANT_PROTO*) ;;
13456 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
13458 echo "Prototype: $try" ;;
13461 *) case "$usethreads" in
13462 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
13469 *) getgrent_r_proto=0
13473 : see if getgrgid_r exists
13474 set getgrgid_r d_getgrgid_r
13476 case "$d_getgrgid_r" in
13478 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13479 case "$d_getgrgid_r_proto:$usethreads" in
13480 ":define") d_getgrgid_r_proto=define
13481 set d_getgrgid_r_proto getgrgid_r $hdrs
13485 case "$d_getgrgid_r_proto" in
13487 case "$getgrgid_r_proto" in
13488 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
13489 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
13491 case "$getgrgid_r_proto" in
13492 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
13493 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
13495 case "$getgrgid_r_proto" in
13496 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
13497 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
13499 case "$getgrgid_r_proto" in
13500 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
13501 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
13503 case "$getgrgid_r_proto" in
13504 ''|0) d_getgrgid_r=undef
13506 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
13507 * ) case "$getgrgid_r_proto" in
13508 REENTRANT_PROTO*) ;;
13509 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
13511 echo "Prototype: $try" ;;
13514 *) case "$usethreads" in
13515 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
13522 *) getgrgid_r_proto=0
13526 : see if getgrnam_r exists
13527 set getgrnam_r d_getgrnam_r
13529 case "$d_getgrnam_r" in
13531 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13532 case "$d_getgrnam_r_proto:$usethreads" in
13533 ":define") d_getgrnam_r_proto=define
13534 set d_getgrnam_r_proto getgrnam_r $hdrs
13538 case "$d_getgrnam_r_proto" in
13540 case "$getgrnam_r_proto" in
13541 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
13542 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
13544 case "$getgrnam_r_proto" in
13545 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
13546 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
13548 case "$getgrnam_r_proto" in
13549 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
13550 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CBI ;;
13552 case "$getgrnam_r_proto" in
13553 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
13554 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
13556 case "$getgrnam_r_proto" in
13557 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
13558 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
13560 case "$getgrnam_r_proto" in
13561 ''|0) d_getgrnam_r=undef
13563 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
13564 * ) case "$getgrnam_r_proto" in
13565 REENTRANT_PROTO*) ;;
13566 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
13568 echo "Prototype: $try" ;;
13571 *) case "$usethreads" in
13572 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
13579 *) getgrnam_r_proto=0
13583 : see if gethostbyaddr exists
13584 set gethostbyaddr d_gethbyaddr
13587 : see if gethostbyname exists
13588 set gethostbyname d_gethbyname
13591 : see if gethostent exists
13592 set gethostent d_gethent
13595 : see how we will look up host name
13598 if set gethostname val -f d_gethname; eval $csym; $val; then
13599 echo 'gethostname() found.' >&4
13600 d_gethname="$define"
13603 if set uname val -f d_uname; eval $csym; $val; then
13606 uname() was found, but you're running xenix, and older versions of xenix
13607 have a broken uname(). If you don't really know whether your xenix is old
13608 enough to have a broken system call, use the default answer.
13613 "$define") dflt=n;;
13615 rp='Is your uname() broken?'
13618 n*) d_uname="$define"; call=uname;;
13621 echo 'uname() found.' >&4
13628 case "$d_gethname" in
13629 '') d_gethname="$undef";;
13632 '') d_uname="$undef";;
13634 case "$d_uname$d_gethname" in
13639 Every now and then someone has a $call() that lies about the hostname
13640 but can't be fixed for political or economic reasons. If you wish, I can
13641 pretend $call() isn't there and maybe compute hostname at run-time
13642 thanks to the '$phostname' command.
13645 rp="Shall I ignore $call() from now on?"
13648 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
13651 case "$phostname" in
13652 '') aphostname='';;
13653 *) case "$aphostname" in
13655 *) set X $phostname
13659 file=`./loc $file $file $pth`
13660 aphostname=`echo $file $*`
13665 case "$d_uname$d_gethname" in
13668 case "$phostname" in
13670 echo "There will be no way for $package to get your hostname." >&4;;
13672 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
13676 case "$d_phostname" in
13677 '') d_phostname="$undef";;
13680 : see if gethostbyaddr_r exists
13681 set gethostbyaddr_r d_gethostbyaddr_r
13683 case "$d_gethostbyaddr_r" in
13685 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13686 case "$d_gethostbyaddr_r_proto:$usethreads" in
13687 ":define") d_gethostbyaddr_r_proto=define
13688 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
13692 case "$d_gethostbyaddr_r_proto" in
13694 case "$gethostbyaddr_r_proto" in
13695 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13696 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
13698 case "$gethostbyaddr_r_proto" in
13699 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
13700 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
13702 case "$gethostbyaddr_r_proto" in
13703 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
13704 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
13706 case "$gethostbyaddr_r_proto" in
13707 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
13708 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
13710 case "$gethostbyaddr_r_proto" in
13711 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
13712 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
13714 case "$gethostbyaddr_r_proto" in
13715 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
13716 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
13718 case "$gethostbyaddr_r_proto" in
13719 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
13720 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
13722 case "$gethostbyaddr_r_proto" in
13723 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
13724 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
13726 case "$gethostbyaddr_r_proto" in
13727 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
13728 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
13730 case "$gethostbyaddr_r_proto" in
13731 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
13732 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
13734 case "$gethostbyaddr_r_proto" in
13735 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13736 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
13738 case "$gethostbyaddr_r_proto" in
13739 ''|0) d_gethostbyaddr_r=undef
13740 gethostbyaddr_r_proto=0
13741 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
13742 * ) case "$gethostbyaddr_r_proto" in
13743 REENTRANT_PROTO*) ;;
13744 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
13746 echo "Prototype: $try" ;;
13749 *) case "$usethreads" in
13750 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
13752 d_gethostbyaddr_r=undef
13753 gethostbyaddr_r_proto=0
13757 *) gethostbyaddr_r_proto=0
13761 : see if gethostbyname_r exists
13762 set gethostbyname_r d_gethostbyname_r
13764 case "$d_gethostbyname_r" in
13766 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13767 case "$d_gethostbyname_r_proto:$usethreads" in
13768 ":define") d_gethostbyname_r_proto=define
13769 set d_gethostbyname_r_proto gethostbyname_r $hdrs
13773 case "$d_gethostbyname_r_proto" in
13775 case "$gethostbyname_r_proto" in
13776 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
13777 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
13779 case "$gethostbyname_r_proto" in
13780 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
13781 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
13783 case "$gethostbyname_r_proto" in
13784 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
13785 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
13787 case "$gethostbyname_r_proto" in
13788 ''|0) d_gethostbyname_r=undef
13789 gethostbyname_r_proto=0
13790 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
13791 * ) case "$gethostbyname_r_proto" in
13792 REENTRANT_PROTO*) ;;
13793 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
13795 echo "Prototype: $try" ;;
13798 *) case "$usethreads" in
13799 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
13801 d_gethostbyname_r=undef
13802 gethostbyname_r_proto=0
13806 *) gethostbyname_r_proto=0
13810 : see if gethostent_r exists
13811 set gethostent_r d_gethostent_r
13813 case "$d_gethostent_r" in
13815 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13816 case "$d_gethostent_r_proto:$usethreads" in
13817 ":define") d_gethostent_r_proto=define
13818 set d_gethostent_r_proto gethostent_r $hdrs
13822 case "$d_gethostent_r_proto" in
13824 case "$gethostent_r_proto" in
13825 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
13826 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
13828 case "$gethostent_r_proto" in
13829 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
13830 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBIE ;;
13832 case "$gethostent_r_proto" in
13833 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
13834 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBIE ;;
13836 case "$gethostent_r_proto" in
13837 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
13838 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBI ;;
13840 case "$gethostent_r_proto" in
13841 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
13842 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBI ;;
13844 case "$gethostent_r_proto" in
13845 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
13846 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SD ;;
13848 case "$gethostent_r_proto" in
13849 ''|0) d_gethostent_r=undef
13850 gethostent_r_proto=0
13851 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
13852 * ) case "$gethostent_r_proto" in
13853 REENTRANT_PROTO*) ;;
13854 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
13856 echo "Prototype: $try" ;;
13859 *) case "$usethreads" in
13860 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
13862 d_gethostent_r=undef
13863 gethostent_r_proto=0
13867 *) gethostent_r_proto=0
13871 : see if prototypes for various gethostxxx netdb.h functions are available
13873 set d_gethostprotos gethostent $i_netdb netdb.h
13876 : see if getitimer exists
13877 set getitimer d_getitimer
13880 : see if getlogin exists
13881 set getlogin d_getlogin
13884 : see if getlogin_r exists
13885 set getlogin_r d_getlogin_r
13887 case "$d_getlogin_r" in
13889 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
13890 case "$d_getlogin_r_proto:$usethreads" in
13891 ":define") d_getlogin_r_proto=define
13892 set d_getlogin_r_proto getlogin_r $hdrs
13896 case "$d_getlogin_r_proto" in
13898 case "$getlogin_r_proto" in
13899 ''|0) try='int getlogin_r(char*, size_t);'
13900 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BW ;;
13902 case "$getlogin_r_proto" in
13903 ''|0) try='int getlogin_r(char*, int);'
13904 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BI ;;
13906 case "$getlogin_r_proto" in
13907 ''|0) try='char* getlogin_r(char*, size_t);'
13908 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BW ;;
13910 case "$getlogin_r_proto" in
13911 ''|0) try='char* getlogin_r(char*, int);'
13912 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BI ;;
13914 case "$getlogin_r_proto" in
13915 ''|0) d_getlogin_r=undef
13917 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
13918 * ) case "$getlogin_r_proto" in
13919 REENTRANT_PROTO*) ;;
13920 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
13922 echo "Prototype: $try" ;;
13925 *) case "$usethreads" in
13926 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
13933 *) getlogin_r_proto=0
13937 : see if getmnt exists
13938 set getmnt d_getmnt
13941 : see if getmntent exists
13942 set getmntent d_getmntent
13945 : see if getnameinfo exists
13946 set getnameinfo d_getnameinfo
13949 : see if getnetbyaddr exists
13950 set getnetbyaddr d_getnbyaddr
13953 : see if getnetbyname exists
13954 set getnetbyname d_getnbyname
13957 : see if getnetent exists
13958 set getnetent d_getnent
13961 : see if getnetbyaddr_r exists
13962 set getnetbyaddr_r d_getnetbyaddr_r
13964 case "$d_getnetbyaddr_r" in
13966 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13967 case "$d_getnetbyaddr_r_proto:$usethreads" in
13968 ":define") d_getnetbyaddr_r_proto=define
13969 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
13973 case "$d_getnetbyaddr_r_proto" in
13975 case "$getnetbyaddr_r_proto" in
13976 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
13977 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
13979 case "$getnetbyaddr_r_proto" in
13980 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
13981 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
13983 case "$getnetbyaddr_r_proto" in
13984 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
13985 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
13987 case "$getnetbyaddr_r_proto" in
13988 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
13989 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
13991 case "$getnetbyaddr_r_proto" in
13992 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
13993 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
13995 case "$getnetbyaddr_r_proto" in
13996 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
13997 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
13999 case "$getnetbyaddr_r_proto" in
14000 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
14001 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
14003 case "$getnetbyaddr_r_proto" in
14004 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
14005 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
14007 case "$getnetbyaddr_r_proto" in
14008 ''|0) d_getnetbyaddr_r=undef
14009 getnetbyaddr_r_proto=0
14010 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
14011 * ) case "$getnetbyaddr_r_proto" in
14012 REENTRANT_PROTO*) ;;
14013 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
14015 echo "Prototype: $try" ;;
14018 *) case "$usethreads" in
14019 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
14021 d_getnetbyaddr_r=undef
14022 getnetbyaddr_r_proto=0
14026 *) getnetbyaddr_r_proto=0
14030 : see if getnetbyname_r exists
14031 set getnetbyname_r d_getnetbyname_r
14033 case "$d_getnetbyname_r" in
14035 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14036 case "$d_getnetbyname_r_proto:$usethreads" in
14037 ":define") d_getnetbyname_r_proto=define
14038 set d_getnetbyname_r_proto getnetbyname_r $hdrs
14042 case "$d_getnetbyname_r_proto" in
14044 case "$getnetbyname_r_proto" in
14045 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
14046 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
14048 case "$getnetbyname_r_proto" in
14049 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
14050 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
14052 case "$getnetbyname_r_proto" in
14053 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
14054 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
14056 case "$getnetbyname_r_proto" in
14057 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
14058 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
14060 case "$getnetbyname_r_proto" in
14061 ''|0) d_getnetbyname_r=undef
14062 getnetbyname_r_proto=0
14063 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
14064 * ) case "$getnetbyname_r_proto" in
14065 REENTRANT_PROTO*) ;;
14066 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
14068 echo "Prototype: $try" ;;
14071 *) case "$usethreads" in
14072 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
14074 d_getnetbyname_r=undef
14075 getnetbyname_r_proto=0
14079 *) getnetbyname_r_proto=0
14083 : see if getnetent_r exists
14084 set getnetent_r d_getnetent_r
14086 case "$d_getnetent_r" in
14088 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14089 case "$d_getnetent_r_proto:$usethreads" in
14090 ":define") d_getnetent_r_proto=define
14091 set d_getnetent_r_proto getnetent_r $hdrs
14095 case "$d_getnetent_r_proto" in
14097 case "$getnetent_r_proto" in
14098 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
14099 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
14101 case "$getnetent_r_proto" in
14102 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
14103 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBIE ;;
14105 case "$getnetent_r_proto" in
14106 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
14107 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBIE ;;
14109 case "$getnetent_r_proto" in
14110 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
14111 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBI ;;
14113 case "$getnetent_r_proto" in
14114 ''|0) try='int getnetent_r(struct netent*, char*, int);'
14115 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBI ;;
14117 case "$getnetent_r_proto" in
14118 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
14119 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SD ;;
14121 case "$getnetent_r_proto" in
14122 ''|0) d_getnetent_r=undef
14123 getnetent_r_proto=0
14124 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
14125 * ) case "$getnetent_r_proto" in
14126 REENTRANT_PROTO*) ;;
14127 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
14129 echo "Prototype: $try" ;;
14132 *) case "$usethreads" in
14133 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
14135 d_getnetent_r=undef
14136 getnetent_r_proto=0
14140 *) getnetent_r_proto=0
14144 : see if prototypes for various getnetxxx netdb.h functions are available
14146 set d_getnetprotos getnetent $i_netdb netdb.h
14149 : see if getpagesize exists
14150 set getpagesize d_getpagsz
14153 : Optional checks for getprotobyname and getprotobynumber
14155 : see if getprotobyname exists
14156 set getprotobyname d_getpbyname
14159 : see if getprotobynumber exists
14160 set getprotobynumber d_getpbynumber
14163 : see if getprotoent exists
14164 set getprotoent d_getpent
14167 : see if getpgid exists
14168 set getpgid d_getpgid
14171 : see if getpgrp2 exists
14172 set getpgrp2 d_getpgrp2
14175 : see if getppid exists
14176 set getppid d_getppid
14179 : see if getpriority exists
14180 set getpriority d_getprior
14183 : see if getprotobyname_r exists
14184 set getprotobyname_r d_getprotobyname_r
14186 case "$d_getprotobyname_r" in
14188 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14189 case "$d_getprotobyname_r_proto:$usethreads" in
14190 ":define") d_getprotobyname_r_proto=define
14191 set d_getprotobyname_r_proto getprotobyname_r $hdrs
14195 case "$d_getprotobyname_r_proto" in
14197 case "$getprotobyname_r_proto" in
14198 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
14199 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
14201 case "$getprotobyname_r_proto" in
14202 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
14203 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
14205 case "$getprotobyname_r_proto" in
14206 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
14207 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
14209 case "$getprotobyname_r_proto" in
14210 ''|0) d_getprotobyname_r=undef
14211 getprotobyname_r_proto=0
14212 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
14213 * ) case "$getprotobyname_r_proto" in
14214 REENTRANT_PROTO*) ;;
14215 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
14217 echo "Prototype: $try" ;;
14220 *) case "$usethreads" in
14221 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
14223 d_getprotobyname_r=undef
14224 getprotobyname_r_proto=0
14228 *) getprotobyname_r_proto=0
14232 : see if getprotobynumber_r exists
14233 set getprotobynumber_r d_getprotobynumber_r
14235 case "$d_getprotobynumber_r" in
14237 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14238 case "$d_getprotobynumber_r_proto:$usethreads" in
14239 ":define") d_getprotobynumber_r_proto=define
14240 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
14244 case "$d_getprotobynumber_r_proto" in
14246 case "$getprotobynumber_r_proto" in
14247 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
14248 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
14250 case "$getprotobynumber_r_proto" in
14251 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
14252 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
14254 case "$getprotobynumber_r_proto" in
14255 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
14256 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
14258 case "$getprotobynumber_r_proto" in
14259 ''|0) d_getprotobynumber_r=undef
14260 getprotobynumber_r_proto=0
14261 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
14262 * ) case "$getprotobynumber_r_proto" in
14263 REENTRANT_PROTO*) ;;
14264 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
14266 echo "Prototype: $try" ;;
14269 *) case "$usethreads" in
14270 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
14272 d_getprotobynumber_r=undef
14273 getprotobynumber_r_proto=0
14277 *) getprotobynumber_r_proto=0
14281 : see if getprotoent_r exists
14282 set getprotoent_r d_getprotoent_r
14284 case "$d_getprotoent_r" in
14286 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14287 case "$d_getprotoent_r_proto:$usethreads" in
14288 ":define") d_getprotoent_r_proto=define
14289 set d_getprotoent_r_proto getprotoent_r $hdrs
14293 case "$d_getprotoent_r_proto" in
14295 case "$getprotoent_r_proto" in
14296 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
14297 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
14299 case "$getprotoent_r_proto" in
14300 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
14301 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBI ;;
14303 case "$getprotoent_r_proto" in
14304 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
14305 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=S_SBI ;;
14307 case "$getprotoent_r_proto" in
14308 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
14309 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SD ;;
14311 case "$getprotoent_r_proto" in
14312 ''|0) d_getprotoent_r=undef
14313 getprotoent_r_proto=0
14314 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
14315 * ) case "$getprotoent_r_proto" in
14316 REENTRANT_PROTO*) ;;
14317 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
14319 echo "Prototype: $try" ;;
14322 *) case "$usethreads" in
14323 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
14325 d_getprotoent_r=undef
14326 getprotoent_r_proto=0
14330 *) getprotoent_r_proto=0
14334 : see if prototypes for various getprotoxxx netdb.h functions are available
14336 set d_getprotoprotos getprotoent $i_netdb netdb.h
14339 : see if getprpwnam exists
14340 set getprpwnam d_getprpwnam
14343 : see if getpwent exists
14344 set getpwent d_getpwent
14347 : see if getpwent_r exists
14348 set getpwent_r d_getpwent_r
14350 case "$d_getpwent_r" in
14352 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14353 case "$d_getpwent_r_proto:$usethreads" in
14354 ":define") d_getpwent_r_proto=define
14355 set d_getpwent_r_proto getpwent_r $hdrs
14359 case "$d_getpwent_r_proto" in
14361 case "$getpwent_r_proto" in
14362 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
14363 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBWR ;;
14365 case "$getpwent_r_proto" in
14366 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
14367 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIR ;;
14369 case "$getpwent_r_proto" in
14370 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
14371 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBW ;;
14373 case "$getpwent_r_proto" in
14374 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
14375 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBI ;;
14377 case "$getpwent_r_proto" in
14378 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
14379 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBI ;;
14381 case "$getpwent_r_proto" in
14382 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
14383 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIH ;;
14385 case "$getpwent_r_proto" in
14386 ''|0) d_getpwent_r=undef
14388 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
14389 * ) case "$getpwent_r_proto" in
14390 REENTRANT_PROTO*) ;;
14391 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
14393 echo "Prototype: $try" ;;
14396 *) case "$usethreads" in
14397 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
14404 *) getpwent_r_proto=0
14408 : see if getpwnam_r exists
14409 set getpwnam_r d_getpwnam_r
14411 case "$d_getpwnam_r" in
14413 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14414 case "$d_getpwnam_r_proto:$usethreads" in
14415 ":define") d_getpwnam_r_proto=define
14416 set d_getpwnam_r_proto getpwnam_r $hdrs
14420 case "$d_getpwnam_r_proto" in
14422 case "$getpwnam_r_proto" in
14423 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
14424 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
14426 case "$getpwnam_r_proto" in
14427 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
14428 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
14430 case "$getpwnam_r_proto" in
14431 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
14432 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
14434 case "$getpwnam_r_proto" in
14435 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
14436 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
14438 case "$getpwnam_r_proto" in
14439 ''|0) d_getpwnam_r=undef
14441 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
14442 * ) case "$getpwnam_r_proto" in
14443 REENTRANT_PROTO*) ;;
14444 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
14446 echo "Prototype: $try" ;;
14449 *) case "$usethreads" in
14450 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
14457 *) getpwnam_r_proto=0
14461 : see if getpwuid_r exists
14462 set getpwuid_r d_getpwuid_r
14464 case "$d_getpwuid_r" in
14466 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14467 case "$d_getpwuid_r_proto:$usethreads" in
14468 ":define") d_getpwuid_r_proto=define
14469 set d_getpwuid_r_proto getpwuid_r $hdrs
14473 case "$d_getpwuid_r_proto" in
14475 case "$getpwuid_r_proto" in
14476 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
14477 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
14479 case "$getpwuid_r_proto" in
14480 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
14481 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
14483 case "$getpwuid_r_proto" in
14484 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
14485 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
14487 case "$getpwuid_r_proto" in
14488 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
14489 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
14491 case "$getpwuid_r_proto" in
14492 ''|0) d_getpwuid_r=undef
14494 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
14495 * ) case "$getpwuid_r_proto" in
14496 REENTRANT_PROTO*) ;;
14497 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
14499 echo "Prototype: $try" ;;
14502 *) case "$usethreads" in
14503 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
14510 *) getpwuid_r_proto=0
14514 : Optional checks for getsbyname and getsbyport
14516 : see if getservbyname exists
14517 set getservbyname d_getsbyname
14520 : see if getservbyport exists
14521 set getservbyport d_getsbyport
14524 : see if getservent exists
14525 set getservent d_getsent
14528 : see if getservbyname_r exists
14529 set getservbyname_r d_getservbyname_r
14531 case "$d_getservbyname_r" in
14533 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14534 case "$d_getservbyname_r_proto:$usethreads" in
14535 ":define") d_getservbyname_r_proto=define
14536 set d_getservbyname_r_proto getservbyname_r $hdrs
14540 case "$d_getservbyname_r_proto" in
14542 case "$getservbyname_r_proto" in
14543 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
14544 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
14546 case "$getservbyname_r_proto" in
14547 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
14548 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
14550 case "$getservbyname_r_proto" in
14551 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
14552 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
14554 case "$getservbyname_r_proto" in
14555 ''|0) d_getservbyname_r=undef
14556 getservbyname_r_proto=0
14557 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
14558 * ) case "$getservbyname_r_proto" in
14559 REENTRANT_PROTO*) ;;
14560 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
14562 echo "Prototype: $try" ;;
14565 *) case "$usethreads" in
14566 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
14568 d_getservbyname_r=undef
14569 getservbyname_r_proto=0
14573 *) getservbyname_r_proto=0
14577 : see if getservbyport_r exists
14578 set getservbyport_r d_getservbyport_r
14580 case "$d_getservbyport_r" in
14582 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14583 case "$d_getservbyport_r_proto:$usethreads" in
14584 ":define") d_getservbyport_r_proto=define
14585 set d_getservbyport_r_proto getservbyport_r $hdrs
14589 case "$d_getservbyport_r_proto" in
14591 case "$getservbyport_r_proto" in
14592 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
14593 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
14595 case "$getservbyport_r_proto" in
14596 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
14597 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
14599 case "$getservbyport_r_proto" in
14600 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
14601 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
14603 case "$getservbyport_r_proto" in
14604 ''|0) d_getservbyport_r=undef
14605 getservbyport_r_proto=0
14606 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
14607 * ) case "$getservbyport_r_proto" in
14608 REENTRANT_PROTO*) ;;
14609 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
14611 echo "Prototype: $try" ;;
14614 *) case "$usethreads" in
14615 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
14617 d_getservbyport_r=undef
14618 getservbyport_r_proto=0
14622 *) getservbyport_r_proto=0
14626 : see if getservent_r exists
14627 set getservent_r d_getservent_r
14629 case "$d_getservent_r" in
14631 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14632 case "$d_getservent_r_proto:$usethreads" in
14633 ":define") d_getservent_r_proto=define
14634 set d_getservent_r_proto getservent_r $hdrs
14638 case "$d_getservent_r_proto" in
14640 case "$getservent_r_proto" in
14641 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
14642 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBWR ;;
14644 case "$getservent_r_proto" in
14645 ''|0) try='int getservent_r(struct servent*, char*, int);'
14646 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBI ;;
14648 case "$getservent_r_proto" in
14649 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
14650 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=S_SBI ;;
14652 case "$getservent_r_proto" in
14653 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
14654 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SD ;;
14656 case "$getservent_r_proto" in
14657 ''|0) d_getservent_r=undef
14658 getservent_r_proto=0
14659 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
14660 * ) case "$getservent_r_proto" in
14661 REENTRANT_PROTO*) ;;
14662 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
14664 echo "Prototype: $try" ;;
14667 *) case "$usethreads" in
14668 define) echo "getservent_r has no prototype, not using it." >&4 ;;
14670 d_getservent_r=undef
14671 getservent_r_proto=0
14675 *) getservent_r_proto=0
14679 : see if prototypes for various getservxxx netdb.h functions are available
14681 set d_getservprotos getservent $i_netdb netdb.h
14684 : see if getspnam exists
14685 set getspnam d_getspnam
14688 : see if this is a shadow.h system
14689 set shadow.h i_shadow
14692 : see if getspnam_r exists
14693 set getspnam_r d_getspnam_r
14695 case "$d_getspnam_r" in
14697 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
14698 case "$d_getspnam_r_proto:$usethreads" in
14699 ":define") d_getspnam_r_proto=define
14700 set d_getspnam_r_proto getspnam_r $hdrs
14704 case "$d_getspnam_r_proto" in
14706 case "$getspnam_r_proto" in
14707 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
14708 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
14710 case "$getspnam_r_proto" in
14711 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
14712 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=S_CSBI ;;
14714 case "$getspnam_r_proto" in
14715 ''|0) d_getspnam_r=undef
14717 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
14718 * ) case "$getspnam_r_proto" in
14719 REENTRANT_PROTO*) ;;
14720 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
14722 echo "Prototype: $try" ;;
14725 *) case "$usethreads" in
14726 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
14733 *) getspnam_r_proto=0
14737 : see if gettimeofday or ftime exists
14738 set gettimeofday d_gettimeod
14740 case "$d_gettimeod" in
14746 val="$undef"; set d_ftime; eval $setvar
14749 case "$d_gettimeod$d_ftime" in
14752 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
14756 : see if gmtime_r exists
14757 set gmtime_r d_gmtime_r
14759 case "$d_gmtime_r" in
14761 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14762 case "$d_gmtime_r_proto:$usethreads" in
14763 ":define") d_gmtime_r_proto=define
14764 set d_gmtime_r_proto gmtime_r $hdrs
14768 case "$d_gmtime_r_proto" in
14770 case "$gmtime_r_proto" in
14771 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
14772 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=S_TS ;;
14774 case "$gmtime_r_proto" in
14775 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
14776 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=I_TS ;;
14778 case "$gmtime_r_proto" in
14779 ''|0) d_gmtime_r=undef
14781 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
14782 * ) case "$gmtime_r_proto" in
14783 REENTRANT_PROTO*) ;;
14784 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
14786 echo "Prototype: $try" ;;
14789 *) case "$usethreads" in
14790 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
14797 *) gmtime_r_proto=0
14801 : see if hasmntopt exists
14802 set hasmntopt d_hasmntopt
14805 : see if this is a netinet/in.h or sys/in.h system
14806 set netinet/in.h i_niin sys/in.h i_sysin
14809 : see if arpa/inet.h has to be included
14810 set arpa/inet.h i_arpainet
14813 : see if htonl --and friends-- exists
14818 : Maybe they are macros.
14821 $cat >htonl.c <<EOM
14823 #include <sys/types.h>
14824 #$i_niin I_NETINET_IN
14826 #$i_arpainet I_ARPA_INET
14827 #ifdef I_NETINET_IN
14828 #include <netinet/in.h>
14831 #include <sys/in.h>
14834 #include <arpa/inet.h>
14837 printf("Defined as a macro.");
14840 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
14841 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
14843 echo "But it seems to be defined as a macro." >&4
14851 : see if ilogbl exists
14852 set ilogbl d_ilogbl
14857 if set index val -f; eval $csym; $val; then
14858 if set strchr val -f d_strchr; eval $csym; $val; then
14859 if $contains strchr "$strings" >/dev/null 2>&1 ; then
14862 echo "strchr() found." >&4
14866 echo "index() found." >&4
14871 echo "index() found." >&4
14874 if set strchr val -f d_strchr; eval $csym; $val; then
14877 echo "strchr() found." >&4
14879 echo "No index() or strchr() found!" >&4
14884 set d_strchr; eval $setvar
14886 set d_index; eval $setvar
14888 : check whether inet_aton exists
14889 set inet_aton d_inetaton
14892 : see if inet_ntop exists
14893 set inet_ntop d_inetntop
14896 : see if inet_pton exists
14897 set inet_pton d_inetpton
14902 $cat >isascii.c <<EOCP
14905 #$i_stdlib I_STDLIB
14907 #include <stdlib.h>
14918 if eval $compile; then
14919 echo "isascii() found." >&4
14922 echo "isascii() NOT found." >&4
14929 : see if isfinite exists
14930 set isfinite d_isfinite
14933 : see if isinf exists
14937 : see if isnan exists
14941 : see if isnanl exists
14942 set isnanl d_isnanl
14945 : see if killpg exists
14946 set killpg d_killpg
14949 : see if lchown exists
14951 $cat > try.c <<'EOCP'
14952 /* System header to define __stub macros and hopefully few prototypes,
14953 which can conflict with char lchown(); below. */
14954 #include <assert.h>
14955 /* Override any gcc2 internal prototype to avoid an error. */
14956 /* We use char because int might match the return type of a gcc2
14957 builtin and then its argument prototype would still apply. */
14960 /* The GNU C library defines this for functions which it implements
14961 to always fail with ENOSYS. Some functions are actually named
14962 something starting with __ and the normal name is an alias. */
14963 #if defined (__stub_lchown) || defined (__stub___lchown)
14971 if eval $compile; then
14972 $echo "lchown() found." >&4
14975 $echo "lchown() NOT found." >&4
14981 : See if number of significant digits in a double precision number is known
14983 $cat >ldbl_dig.c <<EOM
14984 #$i_limits I_LIMITS
14987 #include <limits.h>
14993 printf("Contains LDBL_DIG");
14996 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
14997 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
14998 echo "LDBL_DIG found." >&4
15001 echo "LDBL_DIG NOT found." >&4
15008 : see if this is a math.h system
15012 : check to see if math.h defines _LIB_VERSION
15013 d_libm_lib_version="$undef"
15017 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
15019 #include <unistd.h>
15021 int main (int argc, char *argv[])
15023 printf ("%d\n", _LIB_VERSION);
15028 if eval $compile; then
15030 echo "Yes, it does ($foo)" >&4
15031 d_libm_lib_version="$define"
15033 echo "No, it does not (probably harmless)" >&4
15040 : see if link exists
15044 : see if localtime_r exists
15045 set localtime_r d_localtime_r
15047 case "$d_localtime_r" in
15049 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15050 case "$d_localtime_r_proto:$usethreads" in
15051 ":define") d_localtime_r_proto=define
15052 set d_localtime_r_proto localtime_r $hdrs
15056 case "$d_localtime_r_proto" in
15058 case "$localtime_r_proto" in
15059 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
15060 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=S_TS ;;
15062 case "$localtime_r_proto" in
15063 ''|0) try='int localtime_r(const time_t*, struct tm*);'
15064 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=I_TS ;;
15066 case "$localtime_r_proto" in
15067 ''|0) d_localtime_r=undef
15068 localtime_r_proto=0
15069 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
15070 * ) case "$localtime_r_proto" in
15071 REENTRANT_PROTO*) ;;
15072 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
15074 echo "Prototype: $try" ;;
15077 *) case "$usethreads" in
15078 define) echo "localtime_r has no prototype, not using it." >&4 ;;
15080 d_localtime_r=undef
15081 localtime_r_proto=0
15085 *) localtime_r_proto=0
15089 : see if localtime_r calls tzset
15090 case "$localtime_r_proto" in
15093 /* Does our libc's localtime_r call tzset ?
15094 * return 0 if so, 1 otherwise.
15096 #$i_systypes I_SYS_TYPES
15097 #$i_unistd I_UNISTD
15099 #$i_stdlib I_STDLIB
15100 #$i_string I_STRING
15101 #$i_malloc I_MALLOC
15103 # include <sys/types.h>
15106 # include <unistd.h>
15112 #include <stdlib.h>
15115 # include <string.h>
15117 # include <strings.h>
15120 # include <malloc.h>
15124 time_t t = time(0L);
15125 char w_tz[]="TZ" "=GMT+5",
15126 e_tz[]="TZ" "=GMT-5",
15127 *tz_e = (char*)malloc(16),
15128 *tz_w = (char*)malloc(16);
15129 struct tm tm_e, tm_w;
15130 memset(&tm_e,'\0',sizeof(struct tm));
15131 memset(&tm_w,'\0',sizeof(struct tm));
15136 localtime_r(&t, &tm_e);
15139 localtime_r(&t, &tm_w);
15141 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
15147 if eval $compile; then
15148 if $run ./try; then
15149 d_localtime_r_needs_tzset=undef;
15151 d_localtime_r_needs_tzset=define;
15154 d_localtime_r_needs_tzset=undef;
15158 d_localtime_r_needs_tzset=undef;
15163 : see if localeconv exists
15164 set localeconv d_locconv
15167 : see if lockf exists
15171 : see if prototype for lseek is available
15173 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
15176 : see if lstat exists
15180 : see if madvise exists
15181 set madvise d_madvise
15184 : see if malloc_size exists
15185 set malloc_size d_malloc_size
15188 : see if malloc_size_good exists
15189 set malloc_good_size d_malloc_good_size
15192 : see if mblen exists
15196 : see if mbstowcs exists
15197 set mbstowcs d_mbstowcs
15200 : see if mbtowc exists
15201 set mbtowc d_mbtowc
15204 : see if memchr exists
15205 set memchr d_memchr
15208 : see if memcmp exists
15209 set memcmp d_memcmp
15212 : see if memcpy exists
15213 set memcpy d_memcpy
15216 : see if memmove exists
15217 set memmove d_memmove
15220 : see if memset exists
15221 set memset d_memset
15224 : see if mkdir exists
15228 : see if mkdtemp exists
15229 set mkdtemp d_mkdtemp
15232 : see if mkfifo exists
15233 set mkfifo d_mkfifo
15236 : see if mkstemp exists
15237 set mkstemp d_mkstemp
15240 : see if mkstemps exists
15241 set mkstemps d_mkstemps
15244 : see if mktime exists
15245 set mktime d_mktime
15248 : see if this is a sys/mman.h system
15249 set sys/mman.h i_sysmman
15252 : see if mmap exists
15255 : see what shmat returns
15256 : default to something harmless
15258 case "$i_sysmman$d_mmap" in
15260 $cat >mmap.c <<'END'
15261 #include <sys/mman.h>
15264 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
15269 echo "and it returns ($mmaptype)." >&4
15275 : see if sqrtl exists
15279 : see if scalbnl exists
15280 set scalbnl d_scalbnl
15283 : see if modfl exists
15287 : see if prototype for modfl is available
15289 set d_modflproto modfl $i_math math.h
15292 d_modfl_pow32_bug="$undef"
15294 case "$d_longdbl$d_modfl" in
15297 Checking to see whether your modfl() is okay for large values...
15303 if $test "X$d_modflproto" != "X$define"; then
15304 $cat >>try.c <<EOCP
15305 /* Sigh. many current glibcs provide the function, but do not prototype it. */
15306 long double modfl (long double, long double *);
15309 $cat >>try.c <<EOCP
15311 long double nv = 4294967303.15;
15317 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
15321 case "$osname:$gccversion" in
15322 aix:) saveccflags="$ccflags"
15323 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
15326 if eval $compile; then
15329 *" 4294967303.150000 1.150000 4294967302.000000")
15330 echo >&4 "Your modfl() is broken for large values."
15331 d_modfl_pow32_bug="$define"
15333 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
15337 *" 4294967303.150000 0.150000 4294967303.000000")
15338 echo >&4 "Your modfl() seems okay for large values."
15340 *) echo >&4 "I don't understand your modfl() at all."
15346 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
15349 case "$osname:$gccversion" in
15350 aix:) ccflags="$saveccflags" ;; # restore
15355 if $test "$uselongdouble" = "$define"; then
15357 if $test "$d_sqrtl" != "$define"; then
15358 message="$message sqrtl"
15360 if $test "$d_modfl" != "$define"; then
15361 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
15362 echo "You have both aintl and copysignl, so I can emulate modfl."
15364 message="$message modfl"
15367 if $test "$d_frexpl" != "$define"; then
15368 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
15369 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
15371 message="$message frexpl"
15375 if $test "$message" != ""; then
15378 *** You requested the use of long doubles but you do not seem to have
15379 *** the following mathematical functions needed for long double support:
15381 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
15382 *** Cannot continue, aborting.
15390 : see if mprotect exists
15391 set mprotect d_mprotect
15394 : see if msgctl exists
15395 set msgctl d_msgctl
15398 : see if msgget exists
15399 set msgget d_msgget
15402 : see if msgsnd exists
15403 set msgsnd d_msgsnd
15406 : see if msgrcv exists
15407 set msgrcv d_msgrcv
15410 : see how much of the 'msg*(2)' library is present.
15413 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
15414 *"$undef"*) h_msg=false;;
15418 case "`ipcs 2>&1`" in
15419 "SVID messages"*"not configured"*)
15420 echo "Your $osname does not have the msg*(2) configured." >&4
15423 set msgctl d_msgctl
15425 set msgget d_msgget
15427 set msgsnd d_msgsnd
15429 set msgrcv d_msgrcv
15435 : we could also check for sys/ipc.h ...
15436 if $h_msg && $test `./findhdr sys/msg.h`; then
15437 echo "You have the full msg*(2) library." >&4
15440 echo "You don't have the full msg*(2) library." >&4
15446 : Check for msghdr_s
15448 echo "Checking to see if your system supports struct msghdr..." >&4
15449 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
15451 case "$d_msghdr_s" in
15452 "$define") echo "Yes, it does." ;;
15453 *) echo "No, it doesn't." ;;
15457 : see if msync exists
15461 : see if munmap exists
15462 set munmap d_munmap
15465 : see if nice exists
15469 : see if this is a langinfo.h system
15470 set langinfo.h i_langinfo
15473 : see if nl_langinfo exists
15474 set nl_langinfo d_nl_langinfo
15477 : check for volatile keyword
15479 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
15480 $cat >try.c <<'EOCP'
15483 typedef struct _goo_struct goo_struct;
15484 goo_struct * volatile goo = ((goo_struct *)0);
15485 struct _goo_struct {
15490 typedef unsigned short foo_t;
15491 char *volatile foo;
15493 volatile foo_t blech;
15497 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
15499 echo "Yup, it does."
15502 echo "Nope, it doesn't."
15508 : Check basic sizes
15510 $echo "Choosing the C types to be used for Perl's internal types..." >&4
15512 case "$use64bitint:$d_quad:$quadtype" in
15515 uvtype="$uquadtype"
15520 uvtype="unsigned long"
15526 case "$uselongdouble:$d_longdbl" in
15528 nvtype="long double"
15529 nvsize=$longdblsize
15536 $echo "(IV will be "$ivtype", $ivsize bytes)"
15537 $echo "(UV will be "$uvtype", $uvsize bytes)"
15538 $echo "(NV will be "$nvtype", $nvsize bytes)"
15541 #$i_inttypes I_INTTYPES
15543 #include <inttypes.h>
15548 int8_t i = INT8_MAX;
15549 uint8_t u = UINT8_MAX;
15550 printf("int8_t\n");
15553 int16_t i = INT16_MAX;
15554 uint16_t i = UINT16_MAX;
15555 printf("int16_t\n");
15558 int32_t i = INT32_MAX;
15559 uint32_t u = UINT32_MAX;
15560 printf("int32_t\n");
15565 i8type="signed char"
15566 u8type="unsigned char"
15571 '') case "$shortsize" in
15573 u16type="unsigned short"
15581 '') set try -DINT16
15582 if eval $compile; then
15583 case "`$run ./try`" in
15595 '') if $test $shortsize -ge 2; then
15597 u16type="unsigned short"
15605 '') case "$longsize" in
15607 u32type="unsigned long"
15611 *) case "$intsize" in
15613 u32type="unsigned int"
15623 '') set try -DINT32
15624 if eval $compile; then
15625 case "`$run ./try`" in
15637 '') if $test $intsize -ge 4; then
15639 u32type="unsigned int"
15647 '') case "$d_quad:$quadtype" in
15649 i64type="$quadtype"
15650 u64type="$uquadtype"
15658 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
15659 : volatile so that the compiler has to store it out to memory.
15660 if test X"$d_volatile" = X"$define"; then
15665 #$i_stdlib I_STDLIB
15667 #include <stdlib.h>
15669 #include <sys/types.h>
15670 #include <signal.h>
15672 $volatile int bletched = 0;
15673 $signal_t blech(int s) { bletched = 1; }
15678 int n = 8 * $uvsize;
15681 signal(SIGFPE, blech);
15684 for (i = 0; i < n; i++) {
15685 u = u << 1 | ($uvtype)1;
15687 if (($uvtype)d != u)
15691 d = ($nvtype)(u - 1);
15692 if (($uvtype)d != (u - 1))
15699 printf("%d\n", ((i == n) ? -n : i));
15705 d_nv_preserves_uv="$undef"
15706 if eval $compile; then
15707 nv_preserves_uv_bits="`$run ./try`"
15709 case "$nv_preserves_uv_bits" in
15711 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
15712 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
15713 d_nv_preserves_uv="$define"
15715 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
15716 d_nv_preserves_uv="$undef" ;;
15717 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
15718 nv_preserves_uv_bits="0" ;;
15722 $echo "Checking to find the largest integer value your NVs can hold..." >&4
15723 : volatile so that the compiler has to store it out to memory.
15724 if test X"$d_volatile" = X"$define"; then
15730 typedef $nvtype NV;
15737 while(count < 256) {
15738 $volatile NV up = value + 1.0;
15739 $volatile NV negated = -value;
15740 $volatile NV down = negated - 1.0;
15741 $volatile NV got_up = up - value;
15742 int up_good = got_up == 1.0;
15743 int got_down = down - negated;
15744 int down_good = got_down == -1.0;
15746 if (down_good != up_good) {
15748 "Inconsistency - up %d %f; down %d %f; for 2**%d (%.20f)\n",
15749 up_good, (double) got_up, down_good, (double) got_down,
15750 count, (double) value);
15757 fputs("256.0", stdout);
15760 fputs("2.0", stdout);
15766 fputs("*", stdout);
15772 fprintf(stderr, "Cannot overflow integer range, even at 2**%d (%.20f)\n",
15773 count, (double) value);
15779 nv_overflows_integers_at='0'
15780 if eval $compile; then
15786 The largest integer your NVs can preserve is equal to $xxx
15788 nv_overflows_integers_at="$xxx"
15791 Cannot determine the largest integer value your NVs can hold, unexpected output
15798 Cannot determine the largest integer value your NVs can hold
15805 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
15806 : volatile so that the compiler has to store it out to memory.
15807 if test X"$d_volatile" = X"$define"; then
15812 #$i_stdlib I_STDLIB
15814 #include <stdlib.h>
15816 #$i_string I_STRING
15818 # include <string.h>
15820 # include <strings.h>
15822 #include <sys/types.h>
15823 #include <signal.h>
15825 $volatile int bletched = 0;
15826 $signal_t blech(int s) { bletched = 1; }
15829 int checkit($nvtype d, char *where) {
15830 unsigned char *p = (char *)&d;
15831 unsigned char *end = p + sizeof(d);
15841 printf("No - %s: 0x", where);
15843 printf ("%02X", *p++);
15848 int main(int argc, char **argv) {
15851 fail += checkit(d, "0.0");
15853 /* The compiler shouldn't be assuming that bletched is 0 */
15856 fail += checkit(d, "bleched");
15859 signal(SIGFPE, blech);
15862 /* Paranoia - the compiler should have no way of knowing that ANSI says
15863 that argv[argc] will always be NULL. Actually, if it did assume this it
15864 would be buggy, as this is C and main() can be called from elsewhere in
15866 d = argv[argc] ? 1 : 0;
15869 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
15872 fail += checkit(d, "ternary");
15874 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
15877 printf("No - memset doesn't give 0.0\n");
15878 /* This might just blow up: */
15879 printf("(gives %g)\n", d);
15885 printf("No - something bleched\n");
15890 printf("No - %d fail(s)\n", fail);
15899 d_nv_zero_is_allbits_zero="$undef"
15900 if eval $compile; then
15906 0.0 is represented as all bits zero in memory
15908 d_nv_zero_is_allbits_zero="$define"
15911 0.0 is not represented as all bits zero in memory
15913 d_nv_zero_is_allbits_zero="$undef"
15918 0.0 is not represented as all bits zero in memory
15920 d_nv_zero_is_allbits_zero="$undef"
15926 : check for off64_t
15928 echo "Checking to see if you have off64_t..." >&4
15930 #include <sys/types.h>
15931 #include <unistd.h>
15932 int main() { off64_t x = 7; }
15935 if eval $compile; then
15937 echo "You have off64_t."
15940 echo "You do not have off64_t."
15941 case "$lseeksize" in
15942 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
15949 : how to create joinable pthreads
15950 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
15952 echo "Checking what constant to use for creating joinable pthreads..." >&4
15953 $cat >try.c <<'EOCP'
15954 #include <pthread.h>
15956 int detachstate = JOINABLE;
15959 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
15960 if eval $compile; then
15961 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
15962 val="$undef" # Yes, undef.
15963 set d_old_pthread_create_joinable
15966 set old_pthread_create_joinable
15969 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
15970 if eval $compile; then
15971 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
15973 set d_old_pthread_create_joinable
15975 val=PTHREAD_CREATE_UNDETACHED
15976 set old_pthread_create_joinable
15979 set try -DJOINABLE=__UNDETACHED
15980 if eval $compile; then
15981 echo "You seem to use __UNDETACHED." >&4
15983 set d_old_pthread_create_joinable
15986 set old_pthread_create_joinable
15989 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
15991 set d_old_pthread_create_joinable
15994 set old_pthread_create_joinable
16001 d_old_pthread_create_joinable="$undef"
16002 old_pthread_create_joinable=""
16005 : see if pause exists
16009 : see if poll exists
16013 : see if prctl exists
16017 : see if prctl supports PR_SET_NAME
16018 d_prctl_set_name=$undef
16022 #include <sys/prctl.h>
16024 int main (int argc, char *argv[])
16026 return (prctl (PR_SET_NAME, "Test"));
16030 if eval $compile_ok && $run ./try; then
16031 echo "Your prctl (PR_SET_NAME, ...) works"
16032 d_prctl_set_name=$define
16038 : see if readlink exists
16039 set readlink d_readlink
16042 : Check if exe is symlink to abs path of executing program
16046 case "$d_readlink" in
16048 if $issymlink /proc/self/exe ; then
16049 $ls -l /proc/self/exe > reflect
16050 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
16051 echo "You have Linux-like /proc/self/exe."
16052 procselfexe='"/proc/self/exe"'
16056 if $issymlink /proc/curproc/file ; then
16057 $ls -l /proc/curproc/file > reflect
16058 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
16059 echo "You have BSD-like /proc/curproc/file."
16060 procselfexe='"/proc/curproc/file"'
16070 : backward compatibility for d_hvfork
16071 if test X$d_hvfork != X; then
16072 d_vfork="$d_hvfork"
16075 : see if there is a vfork
16080 d_pseudofork=$undef
16082 : Ok, but do we want to use it. vfork is reportedly unreliable in
16083 : perl on Solaris 2.x, and probably elsewhere.
16087 case "$usevfork" in
16093 Perl can only use a vfork() that doesn't suffer from strict
16094 restrictions on calling functions or modifying global data in
16095 the child. For example, glibc-2.1 contains such a vfork()
16096 that is unsuitable. If your system provides a proper fork()
16097 call, chances are that you do NOT want perl to use vfork().
16100 rp="Do you still want to use vfork()?"
16105 echo "Ok, we won't use vfork()."
16114 $define) usevfork='true';;
16115 *) usevfork='false';;
16118 : see whether the pthread_atfork exists
16120 #include <pthread.h>
16123 #ifdef PTHREAD_ATFORK
16124 pthread_atfork(NULL,NULL,NULL);
16129 : see if pthread_atfork exists
16130 set try -DPTHREAD_ATFORK
16131 if eval $compile; then
16136 case "$usethreads" in
16139 $define) echo 'pthread_atfork found.' >&4 ;;
16140 *) echo 'pthread_atfork NOT found.' >&4 ;;
16143 set d_pthread_atfork
16146 : see if pthread_attr_setscope exists
16147 set pthread_attr_setscope d_pthread_attr_setscope
16150 : see whether the various POSIXish _yields exist
16152 #include <pthread.h>
16158 #ifdef PTHREAD_YIELD
16161 #ifdef PTHREAD_YIELD_NULL
16162 pthread_yield(NULL);
16168 : see if sched_yield exists
16169 set try -DSCHED_YIELD
16170 if eval $compile; then
16172 sched_yield='sched_yield()'
16176 case "$usethreads" in
16179 $define) echo 'sched_yield() found.' >&4 ;;
16180 *) echo 'sched_yield() NOT found.' >&4 ;;
16186 : see if pthread_yield exists
16187 set try -DPTHREAD_YIELD
16188 if eval $compile; then
16190 case "$sched_yield" in
16191 '') sched_yield='pthread_yield()' ;;
16194 set try -DPTHREAD_YIELD_NULL
16195 if eval $compile; then
16197 case "$sched_yield" in
16198 '') sched_yield='pthread_yield(NULL)' ;;
16204 case "$usethreads" in
16207 $define) echo 'pthread_yield() found.' >&4 ;;
16208 *) echo 'pthread_yield() NOT found.' >&4 ;;
16212 set d_pthread_yield
16214 case "$sched_yield" in
16215 '') sched_yield=undef ;;
16219 : see if random_r exists
16220 set random_r d_random_r
16222 case "$d_random_r" in
16224 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16225 case "$d_random_r_proto:$usethreads" in
16226 ":define") d_random_r_proto=define
16227 set d_random_r_proto random_r $hdrs
16231 case "$d_random_r_proto" in
16233 case "$random_r_proto" in
16234 ''|0) try='int random_r(int*, struct random_data*);'
16235 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_iS ;;
16237 case "$random_r_proto" in
16238 ''|0) try='int random_r(long*, struct random_data*);'
16239 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_lS ;;
16241 case "$random_r_proto" in
16242 ''|0) try='int random_r(struct random_data*, int32_t*);'
16243 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_St ;;
16245 case "$random_r_proto" in
16246 ''|0) d_random_r=undef
16248 echo "Disabling random_r, cannot determine prototype." >&4 ;;
16249 * ) case "$random_r_proto" in
16250 REENTRANT_PROTO*) ;;
16251 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
16253 echo "Prototype: $try" ;;
16256 *) case "$usethreads" in
16257 define) echo "random_r has no prototype, not using it." >&4 ;;
16264 *) random_r_proto=0
16268 : see if readdir and friends exist
16269 set readdir d_readdir
16271 set seekdir d_seekdir
16273 set telldir d_telldir
16275 set rewinddir d_rewinddir
16278 : see if readdir64_r exists
16279 set readdir64_r d_readdir64_r
16281 case "$d_readdir64_r" in
16283 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16284 case "$d_readdir64_r_proto:$usethreads" in
16285 ":define") d_readdir64_r_proto=define
16286 set d_readdir64_r_proto readdir64_r $hdrs
16290 case "$d_readdir64_r_proto" in
16292 case "$readdir64_r_proto" in
16293 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
16294 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TSR ;;
16296 case "$readdir64_r_proto" in
16297 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
16298 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TS ;;
16300 case "$readdir64_r_proto" in
16301 ''|0) d_readdir64_r=undef
16302 readdir64_r_proto=0
16303 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
16304 * ) case "$readdir64_r_proto" in
16305 REENTRANT_PROTO*) ;;
16306 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
16308 echo "Prototype: $try" ;;
16311 *) case "$usethreads" in
16312 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
16314 d_readdir64_r=undef
16315 readdir64_r_proto=0
16319 *) readdir64_r_proto=0
16323 : see if readdir_r exists
16324 set readdir_r d_readdir_r
16326 case "$d_readdir_r" in
16328 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16329 case "$d_readdir_r_proto:$usethreads" in
16330 ":define") d_readdir_r_proto=define
16331 set d_readdir_r_proto readdir_r $hdrs
16335 case "$d_readdir_r_proto" in
16337 case "$readdir_r_proto" in
16338 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
16339 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TSR ;;
16341 case "$readdir_r_proto" in
16342 ''|0) try='int readdir_r(DIR*, struct dirent*);'
16343 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TS ;;
16345 case "$readdir_r_proto" in
16346 ''|0) d_readdir_r=undef
16348 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
16349 * ) case "$readdir_r_proto" in
16350 REENTRANT_PROTO*) ;;
16351 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
16353 echo "Prototype: $try" ;;
16356 *) case "$usethreads" in
16357 define) echo "readdir_r has no prototype, not using it." >&4 ;;
16364 *) readdir_r_proto=0
16368 : see if readv exists
16372 : see if recvmsg exists
16373 set recvmsg d_recvmsg
16376 : see if rename exists
16377 set rename d_rename
16380 : see if rmdir exists
16384 : see if memory.h is available.
16389 : See if it conflicts with string.h
16395 $cppstdin $cppflags $cppminus < $strings > mem.h
16396 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
16398 echo "We won't be including <memory.h>."
16408 : can bcopy handle overlapping blocks?
16411 case "$d_memmove" in
16412 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
16413 *) case "$d_bcopy" in
16415 echo "Checking to see if bcopy() can do overlapping copies..." >&4
16417 #$i_memory I_MEMORY
16418 #$i_stdlib I_STDLIB
16419 #$i_string I_STRING
16420 #$i_unistd I_UNISTD
16422 $cat >>try.c <<'EOCP'
16425 # include <memory.h>
16428 # include <stdlib.h>
16431 # include <string.h>
16433 # include <strings.h>
16436 # include <unistd.h> /* Needed for NetBSD */
16440 char buf[128], abc[128];
16446 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16447 try to store the string in read-only memory. */
16448 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
16450 for (align = 7; align >= 0; align--) {
16451 for (len = 36; len; len--) {
16453 bcopy(abc, b, len);
16454 for (off = 1; off <= len; off++) {
16455 bcopy(b, b+off, len);
16456 bcopy(b+off, b, len);
16457 if (bcmp(b, abc, len))
16466 if eval $compile_ok; then
16467 if $run ./try 2>/dev/null; then
16468 echo "Yes, it can."
16471 echo "It can't, sorry."
16474 echo "(I can't compile the test program, so we'll assume not...)"
16484 : can memcpy handle overlapping blocks?
16487 case "$d_memmove" in
16488 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
16489 *) case "$d_memcpy" in
16491 echo "Checking to see if memcpy() can do overlapping copies..." >&4
16493 #$i_memory I_MEMORY
16494 #$i_stdlib I_STDLIB
16495 #$i_string I_STRING
16496 #$i_unistd I_UNISTD
16498 $cat >>try.c <<'EOCP'
16501 # include <memory.h>
16504 # include <stdlib.h>
16507 # include <string.h>
16509 # include <strings.h>
16512 # include <unistd.h> /* Needed for NetBSD */
16516 char buf[128], abc[128];
16522 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16523 try to store the string in read-only memory. */
16524 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
16526 for (align = 7; align >= 0; align--) {
16527 for (len = 36; len; len--) {
16529 memcpy(b, abc, len);
16530 for (off = 1; off <= len; off++) {
16531 memcpy(b+off, b, len);
16532 memcpy(b, b+off, len);
16533 if (memcmp(b, abc, len))
16542 if eval $compile_ok; then
16543 if $run ./try 2>/dev/null; then
16544 echo "Yes, it can."
16547 echo "It can't, sorry."
16550 echo "(I can't compile the test program, so we'll assume not...)"
16560 : can memcmp be trusted to compare relative magnitude?
16562 case "$d_memcmp" in
16565 echo "Checking if your memcmp() can compare relative magnitude..." >&4
16567 #$i_memory I_MEMORY
16568 #$i_stdlib I_STDLIB
16569 #$i_string I_STRING
16570 #$i_unistd I_UNISTD
16572 $cat >>try.c <<'EOCP'
16575 # include <memory.h>
16578 # include <stdlib.h>
16581 # include <string.h>
16583 # include <strings.h>
16586 # include <unistd.h> /* Needed for NetBSD */
16592 if ((a < b) && memcmp(&a, &b, 1) < 0)
16598 if eval $compile_ok; then
16599 if $run ./try 2>/dev/null; then
16600 echo "Yes, it can."
16603 echo "No, it can't (it uses signed chars)."
16606 echo "(I can't compile the test program, so we'll assume not...)"
16614 : see if prototype for sbrk is available
16616 set d_sbrkproto sbrk $i_unistd unistd.h
16619 : see if select exists
16620 set select d_select
16623 : see if semctl exists
16624 set semctl d_semctl
16627 : see if semget exists
16628 set semget d_semget
16631 : see if semop exists
16635 : see how much of the 'sem*(2)' library is present.
16638 case "$d_semctl$d_semget$d_semop" in
16639 *"$undef"*) h_sem=false;;
16643 case "`ipcs 2>&1`" in
16644 "SVID messages"*"not configured"*)
16645 echo "Your $osname does not have the sem*(2) configured." >&4
16648 set semctl d_semctl
16650 set semget d_semget
16658 : we could also check for sys/ipc.h ...
16659 if $h_sem && $test `./findhdr sys/sem.h`; then
16660 echo "You have the full sem*(2) library." >&4
16663 echo "You don't have the full sem*(2) library." >&4
16669 : see whether sys/sem.h defines union semun
16671 $cat > try.c <<'END'
16672 #include <sys/types.h>
16673 #include <sys/ipc.h>
16674 #include <sys/sem.h>
16675 int main () { union semun semun; semun.buf = 0; }
16678 if eval $compile; then
16679 echo "You have union semun in <sys/sem.h>." >&4
16682 echo "You do not have union semun in <sys/sem.h>." >&4
16689 : see how to do semctl IPC_STAT
16693 $cat > tryh.h <<END
16696 # define S_IRUSR S_IREAD
16697 # define S_IWUSR S_IWRITE
16698 # define S_IXUSR S_IEXEC
16700 # define S_IRUSR 0400
16701 # define S_IWUSR 0200
16702 # define S_IXUSR 0100
16704 # define S_IRGRP (S_IRUSR>>3)
16705 # define S_IWGRP (S_IWUSR>>3)
16706 # define S_IXGRP (S_IXUSR>>3)
16707 # define S_IROTH (S_IRUSR>>6)
16708 # define S_IWOTH (S_IWUSR>>6)
16709 # define S_IXOTH (S_IXUSR>>6)
16712 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
16713 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
16714 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
16717 : see whether semctl IPC_STAT can use union semun
16718 case "$d_semctl_semun" in
16722 #include <sys/types.h>
16723 #include <sys/ipc.h>
16724 #include <sys/sem.h>
16725 #include <sys/stat.h>
16732 #$d_union_semun HAS_UNION_SEMUN
16735 #ifndef HAS_UNION_SEMUN
16738 struct semid_ds *buf;
16739 unsigned short *array;
16745 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16746 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16748 struct semid_ds argbuf;
16751 st = semctl(sem, 0, IPC_STAT, arg);
16755 # endif /* IPC_STAT */
16756 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16758 if (semctl(sem, 0, IPC_RMID, arg) != 0)
16759 # endif /* IPC_RMID */
16760 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16762 #endif /* IPC_PRIVATE && ... */
16763 printf("semget failed: errno = %d\n", errno);
16768 if eval $compile; then
16771 semun) val="$define" ;;
16779 case "$d_semctl_semun" in
16781 echo "You can use union semun for semctl IPC_STAT." >&4
16784 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
16789 : see whether semctl IPC_STAT can use struct semid_ds pointer
16790 case "$d_semctl_semid_ds" in
16793 $cat > try.c <<'END'
16794 #include <sys/types.h>
16795 #include <sys/ipc.h>
16796 #include <sys/sem.h>
16797 #include <sys/stat.h>
16805 struct semid_ds arg;
16808 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16809 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16812 st = semctl(sem, 0, IPC_STAT, &arg);
16814 printf("semid_ds\n");
16816 # endif /* IPC_STAT */
16817 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16819 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
16820 # endif /* IPC_RMID */
16821 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16823 #endif /* IPC_PRIVATE && ... */
16824 printf("semget failed: errno = %d\n", errno);
16830 if eval $compile; then
16833 semid_ds) val="$define" ;;
16837 set d_semctl_semid_ds
16841 case "$d_semctl_semid_ds" in
16843 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
16845 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
16851 # We do not have the full sem*(2) library, so assume we can not
16857 set d_semctl_semid_ds
16863 : see if sendmsg exists
16864 set sendmsg d_sendmsg
16867 : see if setegid exists
16868 set setegid d_setegid
16871 : see if seteuid exists
16872 set seteuid d_seteuid
16875 : see if setgrent exists
16876 set setgrent d_setgrent
16879 : see if setgrent_r exists
16880 set setgrent_r d_setgrent_r
16882 case "$d_setgrent_r" in
16884 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
16885 case "$d_setgrent_r_proto:$usethreads" in
16886 ":define") d_setgrent_r_proto=define
16887 set d_setgrent_r_proto setgrent_r $hdrs
16891 case "$d_setgrent_r_proto" in
16893 case "$setgrent_r_proto" in
16894 ''|0) try='int setgrent_r(FILE**);'
16895 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=I_H ;;
16897 case "$setgrent_r_proto" in
16898 ''|0) try='void setgrent_r(FILE**);'
16899 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=V_H ;;
16901 case "$setgrent_r_proto" in
16902 ''|0) d_setgrent_r=undef
16904 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
16905 * ) case "$setgrent_r_proto" in
16906 REENTRANT_PROTO*) ;;
16907 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
16909 echo "Prototype: $try" ;;
16912 *) case "$usethreads" in
16913 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
16920 *) setgrent_r_proto=0
16924 : see if sethostent exists
16925 set sethostent d_sethent
16928 : see if sethostent_r exists
16929 set sethostent_r d_sethostent_r
16931 case "$d_sethostent_r" in
16933 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16934 case "$d_sethostent_r_proto:$usethreads" in
16935 ":define") d_sethostent_r_proto=define
16936 set d_sethostent_r_proto sethostent_r $hdrs
16940 case "$d_sethostent_r_proto" in
16942 case "$sethostent_r_proto" in
16943 ''|0) try='int sethostent_r(int, struct hostent_data*);'
16944 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=I_ID ;;
16946 case "$sethostent_r_proto" in
16947 ''|0) try='void sethostent_r(int, struct hostent_data*);'
16948 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=V_ID ;;
16950 case "$sethostent_r_proto" in
16951 ''|0) d_sethostent_r=undef
16952 sethostent_r_proto=0
16953 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
16954 * ) case "$sethostent_r_proto" in
16955 REENTRANT_PROTO*) ;;
16956 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
16958 echo "Prototype: $try" ;;
16961 *) case "$usethreads" in
16962 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
16964 d_sethostent_r=undef
16965 sethostent_r_proto=0
16969 *) sethostent_r_proto=0
16973 : see if setitimer exists
16974 set setitimer d_setitimer
16977 : see if setlinebuf exists
16978 set setlinebuf d_setlinebuf
16981 : see if setlocale exists
16982 set setlocale d_setlocale
16985 : see if locale.h is available
16986 set locale.h i_locale
16989 : see if setlocale_r exists
16990 set setlocale_r d_setlocale_r
16992 case "$d_setlocale_r" in
16994 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
16995 case "$d_setlocale_r_proto:$usethreads" in
16996 ":define") d_setlocale_r_proto=define
16997 set d_setlocale_r_proto setlocale_r $hdrs
17001 case "$d_setlocale_r_proto" in
17003 case "$setlocale_r_proto" in
17004 ''|0) try='int setlocale_r(int, const char*, char*, int);'
17005 ./protochk "$extern_C $try" $hdrs && setlocale_r_proto=I_ICBI ;;
17007 case "$setlocale_r_proto" in
17008 ''|0) d_setlocale_r=undef
17009 setlocale_r_proto=0
17010 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
17011 * ) case "$setlocale_r_proto" in
17012 REENTRANT_PROTO*) ;;
17013 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
17015 echo "Prototype: $try" ;;
17018 *) case "$usethreads" in
17019 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
17021 d_setlocale_r=undef
17022 setlocale_r_proto=0
17026 *) setlocale_r_proto=0
17030 : see if setnetent exists
17031 set setnetent d_setnent
17034 : see if setnetent_r exists
17035 set setnetent_r d_setnetent_r
17037 case "$d_setnetent_r" in
17039 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17040 case "$d_setnetent_r_proto:$usethreads" in
17041 ":define") d_setnetent_r_proto=define
17042 set d_setnetent_r_proto setnetent_r $hdrs
17046 case "$d_setnetent_r_proto" in
17048 case "$setnetent_r_proto" in
17049 ''|0) try='int setnetent_r(int, struct netent_data*);'
17050 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=I_ID ;;
17052 case "$setnetent_r_proto" in
17053 ''|0) try='void setnetent_r(int, struct netent_data*);'
17054 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=V_ID ;;
17056 case "$setnetent_r_proto" in
17057 ''|0) d_setnetent_r=undef
17058 setnetent_r_proto=0
17059 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
17060 * ) case "$setnetent_r_proto" in
17061 REENTRANT_PROTO*) ;;
17062 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
17064 echo "Prototype: $try" ;;
17067 *) case "$usethreads" in
17068 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
17070 d_setnetent_r=undef
17071 setnetent_r_proto=0
17075 *) setnetent_r_proto=0
17079 : see if setprotoent exists
17080 set setprotoent d_setpent
17083 : see if setpgid exists
17084 set setpgid d_setpgid
17087 : see if setpgrp2 exists
17088 set setpgrp2 d_setpgrp2
17091 : see if setpriority exists
17092 set setpriority d_setprior
17095 : see if setproctitle exists
17096 set setproctitle d_setproctitle
17099 : see if setprotoent_r exists
17100 set setprotoent_r d_setprotoent_r
17102 case "$d_setprotoent_r" in
17104 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17105 case "$d_setprotoent_r_proto:$usethreads" in
17106 ":define") d_setprotoent_r_proto=define
17107 set d_setprotoent_r_proto setprotoent_r $hdrs
17111 case "$d_setprotoent_r_proto" in
17113 case "$setprotoent_r_proto" in
17114 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
17115 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=I_ID ;;
17117 case "$setprotoent_r_proto" in
17118 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
17119 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=V_ID ;;
17121 case "$setprotoent_r_proto" in
17122 ''|0) d_setprotoent_r=undef
17123 setprotoent_r_proto=0
17124 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
17125 * ) case "$setprotoent_r_proto" in
17126 REENTRANT_PROTO*) ;;
17127 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
17129 echo "Prototype: $try" ;;
17132 *) case "$usethreads" in
17133 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
17135 d_setprotoent_r=undef
17136 setprotoent_r_proto=0
17140 *) setprotoent_r_proto=0
17144 : see if setpwent exists
17145 set setpwent d_setpwent
17148 : see if setpwent_r exists
17149 set setpwent_r d_setpwent_r
17151 case "$d_setpwent_r" in
17153 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
17154 case "$d_setpwent_r_proto:$usethreads" in
17155 ":define") d_setpwent_r_proto=define
17156 set d_setpwent_r_proto setpwent_r $hdrs
17160 case "$d_setpwent_r_proto" in
17162 case "$setpwent_r_proto" in
17163 ''|0) try='int setpwent_r(FILE**);'
17164 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=I_H ;;
17166 case "$setpwent_r_proto" in
17167 ''|0) try='void setpwent_r(FILE**);'
17168 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=V_H ;;
17170 case "$setpwent_r_proto" in
17171 ''|0) d_setpwent_r=undef
17173 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
17174 * ) case "$setpwent_r_proto" in
17175 REENTRANT_PROTO*) ;;
17176 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
17178 echo "Prototype: $try" ;;
17181 *) case "$usethreads" in
17182 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
17189 *) setpwent_r_proto=0
17193 : see if setregid exists
17194 set setregid d_setregid
17196 set setresgid d_setresgid
17199 : see if setreuid exists
17200 set setreuid d_setreuid
17202 set setresuid d_setresuid
17205 : see if setrgid exists
17206 set setrgid d_setrgid
17209 : see if setruid exists
17210 set setruid d_setruid
17213 : see if setservent exists
17214 set setservent d_setsent
17217 : see if setservent_r exists
17218 set setservent_r d_setservent_r
17220 case "$d_setservent_r" in
17222 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17223 case "$d_setservent_r_proto:$usethreads" in
17224 ":define") d_setservent_r_proto=define
17225 set d_setservent_r_proto setservent_r $hdrs
17229 case "$d_setservent_r_proto" in
17231 case "$setservent_r_proto" in
17232 ''|0) try='int setservent_r(int, struct servent_data*);'
17233 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=I_ID ;;
17235 case "$setservent_r_proto" in
17236 ''|0) try='void setservent_r(int, struct servent_data*);'
17237 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=V_ID ;;
17239 case "$setservent_r_proto" in
17240 ''|0) d_setservent_r=undef
17241 setservent_r_proto=0
17242 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
17243 * ) case "$setservent_r_proto" in
17244 REENTRANT_PROTO*) ;;
17245 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
17247 echo "Prototype: $try" ;;
17250 *) case "$usethreads" in
17251 define) echo "setservent_r has no prototype, not using it." >&4 ;;
17253 d_setservent_r=undef
17254 setservent_r_proto=0
17258 *) setservent_r_proto=0
17262 : see if setsid exists
17263 set setsid d_setsid
17266 : see if setvbuf exists
17267 set setvbuf d_setvbuf
17270 : see if sfio.h is available
17274 : see if sfio library is available
17285 : Ok, but do we want to use it.
17289 true|$define|[yY]*) dflt='y';;
17292 echo "$package can use the sfio library, but it is experimental."
17293 rp="You seem to have sfio available, do you want to try using it?"
17296 y|Y) echo "Ok, turning on sfio then."
17299 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
17304 *) case "$usesfio" in
17305 true|$define|[yY]*)
17306 echo "Sorry, cannot find sfio on this machine." >&4
17307 echo "Ignoring your setting of usesfio=$usesfio." >&4
17316 $define) usesfio='true';;
17317 *) usesfio='false';;
17321 *) : Remove sfio from list of libraries to use
17324 echo "Removing unneeded -lsfio from library list" >&4
17325 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
17328 echo "libs = $libs" >&4
17335 : see if shmctl exists
17336 set shmctl d_shmctl
17339 : see if shmget exists
17340 set shmget d_shmget
17343 : see if shmat exists
17346 : see what shmat returns
17349 $cat >shmat.c <<'END'
17350 #include <sys/shm.h>
17353 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
17358 echo "and it returns ($shmattype)." >&4
17359 : see if a prototype for shmat is available
17360 xxx=`./findhdr sys/shm.h`
17361 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
17362 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
17373 set d_shmatprototype
17376 : see if shmdt exists
17380 : see how much of the 'shm*(2)' library is present.
17383 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
17384 *"$undef"*) h_shm=false;;
17388 case "`ipcs 2>&1`" in
17389 "SVID shared memory"*"not configured"*)
17390 echo "Your $osname does not have the shm*(2) configured." >&4
17393 set shmctl d_shmctl
17395 set shmget d_shmget
17405 : we could also check for sys/ipc.h ...
17406 if $h_shm && $test `./findhdr sys/shm.h`; then
17407 echo "You have the full shm*(2) library." >&4
17410 echo "You don't have the full shm*(2) library." >&4
17416 : see if we have sigaction
17418 if set sigaction val -f d_sigaction; eval $csym; $val; then
17419 echo 'sigaction() found.' >&4
17422 #include <sys/types.h>
17423 #include <signal.h>
17424 #$i_stdlib I_STDLIB
17426 #include <stdlib.h>
17430 struct sigaction act, oact;
17432 oact.sa_handler = 0;
17433 /* so that act and oact are used */
17434 exit(act.sa_flags == 0 && oact.sa_handler == 0);
17438 if eval $compile_ok; then
17441 echo "But you don't seem to have a useable struct sigaction." >&4
17445 echo 'sigaction NOT found.' >&4
17448 set d_sigaction; eval $setvar
17451 : see if this is a sunmath.h system
17452 set sunmath.h i_sunmath
17455 : see if signbit exists
17456 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
17459 #$i_sunmath I_SUNMATH
17463 #ifdef I_SUNMATH /* Solaris special math library */
17464 # include <sunmath.h>
17467 int main(int argc, char **argv)
17471 if ((signbit(x) == 0) && (signbit(y) != 0))
17479 if eval $compile; then
17480 if $run ./try; then
17484 $echo "Signbit seems to be available, but doesn't work as I expected."
17485 $echo "I won't use it." >&4
17496 : see if sigprocmask exists
17497 set sigprocmask d_sigprocmask
17500 : see if sigsetjmp exists
17502 case "$d_sigsetjmp" in
17505 #include <setjmp.h>
17506 #$i_stdlib I_STDLIB
17508 #include <stdlib.h>
17514 if (sigsetjmp(env,1))
17517 siglongjmp(env, 1);
17522 if eval $compile; then
17523 if $run ./try >/dev/null 2>&1; then
17524 echo "POSIX sigsetjmp found." >&4
17528 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
17534 echo "sigsetjmp not found." >&4
17538 *) val="$d_sigsetjmp"
17539 case "$d_sigsetjmp" in
17540 $define) echo "POSIX sigsetjmp found." >&4;;
17541 $undef) echo "sigsetjmp not found." >&4;;
17549 : see if snprintf exists
17550 set snprintf d_snprintf
17553 : see if vsnprintf exists
17554 set vsnprintf d_vsnprintf
17557 case "$d_snprintf-$d_vsnprintf" in
17560 Checking whether your snprintf() and vsnprintf() work okay...
17562 $cat >try.c <<'EOCP'
17563 /* v?snprintf testing logic courtesy of Russ Allbery.
17564 * According to C99:
17565 * - if the buffer is too short it still must be \0-terminated
17566 * - if the buffer is too short the potentially required length
17567 * must be returned and not -1
17568 * - if the buffer is NULL the potentially required length
17569 * must be returned and not -1 or core dump
17572 #include <stdarg.h>
17576 int test (char *format, ...)
17581 va_start (args, format);
17582 count = vsnprintf (buf, sizeof buf, format, args);
17589 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
17590 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
17594 if eval $compile; then
17597 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
17599 Your snprintf() and snprintf() don't seem to be working okay.
17601 d_snprintf="$undef"
17602 d_vsnprintf="$undef"
17606 echo "(I can't seem to compile the test program--assuming they don't)"
17607 d_snprintf="$undef"
17608 d_vsnprintf="$undef"
17614 : see if sockatmark exists
17615 set sockatmark d_sockatmark
17618 : see if prototype for sockatmark is available
17620 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
17623 : see if socks5_init exists
17624 set socks5_init d_socks5_init
17627 : see if sprintf returns the length of the string in the buffer as per ANSI
17628 $echo "Checking whether sprintf returns the length of the string..." >&4
17631 #$i_stdlib I_STDLIB
17633 #include <stdlib.h>
17635 #$i_string I_STRING
17637 # include <string.h>
17639 # include <strings.h>
17648 int check (size_t expect, int test) {
17649 size_t got = strlen(buffer);
17653 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
17658 int main(int argc, char **argv) {
17661 check(sprintf(buffer, ""), ++test);
17662 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
17663 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
17670 if eval $compile; then
17674 sprintf returns the length of the string (as ANSI says it should)
17676 d_sprintf_returns_strlen="$define"
17679 sprintf does not return the length of the string (how old is this system?)
17681 d_sprintf_returns_strlen="$undef"
17685 echo "(I can't seem to compile the test program--assuming it doesn't)" >&4
17686 d_sprintf_returns_strlen="$undef"
17690 : see if srand48_r exists
17691 set srand48_r d_srand48_r
17693 case "$d_srand48_r" in
17695 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17696 case "$d_srand48_r_proto:$usethreads" in
17697 ":define") d_srand48_r_proto=define
17698 set d_srand48_r_proto srand48_r $hdrs
17702 case "$d_srand48_r_proto" in
17704 case "$srand48_r_proto" in
17705 ''|0) try='int srand48_r(long, struct drand48_data*);'
17706 ./protochk "$extern_C $try" $hdrs && srand48_r_proto=I_LS ;;
17708 case "$srand48_r_proto" in
17709 ''|0) d_srand48_r=undef
17711 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
17712 * ) case "$srand48_r_proto" in
17713 REENTRANT_PROTO*) ;;
17714 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
17716 echo "Prototype: $try" ;;
17719 *) case "$usethreads" in
17720 define) echo "srand48_r has no prototype, not using it." >&4 ;;
17727 *) srand48_r_proto=0
17731 : see if srandom_r exists
17732 set srandom_r d_srandom_r
17734 case "$d_srandom_r" in
17736 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17737 case "$d_srandom_r_proto:$usethreads" in
17738 ":define") d_srandom_r_proto=define
17739 set d_srandom_r_proto srandom_r $hdrs
17743 case "$d_srandom_r_proto" in
17745 case "$srandom_r_proto" in
17746 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
17747 ./protochk "$extern_C $try" $hdrs && srandom_r_proto=I_TS ;;
17749 case "$srandom_r_proto" in
17750 ''|0) d_srandom_r=undef
17752 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
17753 * ) case "$srandom_r_proto" in
17754 REENTRANT_PROTO*) ;;
17755 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
17757 echo "Prototype: $try" ;;
17760 *) case "$usethreads" in
17761 define) echo "srandom_r has no prototype, not using it." >&4 ;;
17768 *) srandom_r_proto=0
17772 : see if prototype for setresgid is available
17774 set d_sresgproto setresgid $i_unistd unistd.h
17777 : see if prototype for setresuid is available
17779 set d_sresuproto setresuid $i_unistd unistd.h
17782 : see if sys/stat.h is available
17783 set sys/stat.h i_sysstat
17786 : see if stat knows about block sizes
17788 echo "Checking to see if your struct stat has st_blocks field..." >&4
17789 set d_statblks stat st_blocks $i_sysstat sys/stat.h
17792 : see if this is a sys/vfs.h system
17793 set sys/vfs.h i_sysvfs
17796 : see if this is a sys/statfs.h system
17797 set sys/statfs.h i_sysstatfs
17800 : Check for statfs_s
17802 echo "Checking to see if your system supports struct statfs..." >&4
17803 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
17805 case "$d_statfs_s" in
17806 "$define") echo "Yes, it does." ;;
17807 *) echo "No, it doesn't." ;;
17811 : see if struct statfs knows about f_flags
17812 case "$d_statfs_s" in
17815 echo "Checking to see if your struct statfs has f_flags field..." >&4
17816 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
17820 set d_statfs_f_flags
17824 case "$d_statfs_f_flags" in
17825 "$define") echo "Yes, it does." ;;
17826 *) echo "No, it doesn't." ;;
17829 : see what flavor, if any, of static inline is supported
17831 echo "Checking to see if your system supports static inline..."
17832 $cat > try.c <<'EOCP'
17833 #include <stdlib.h>
17834 extern int f_via_a(int x);
17835 extern int f_via_b(int x);
17836 int main(int argc, char **argv)
17845 return EXIT_SUCCESS;
17848 return EXIT_FAILURE;
17852 $cat > a.c <<'EOCP'
17853 static INLINE int f(int x) {
17864 $cat > b.c <<'EOCP'
17865 extern int f(int x);
17873 # Respect a hint (or previous) value for perl_static_inline, if there is one.
17874 case "$perl_static_inline" in
17875 '') # Check the various possibilities, and break out on success.
17876 # For gcc, prefer __inline__, which will still permit
17877 # cflags.SH to add in -ansi.
17878 case "$gccversion" in
17879 '') xxx="inline __inline__ __inline _inline";;
17880 *) xxx="__inline__ inline __inline _inline";;
17882 for inline in $xxx; do
17883 set try -DINLINE=$inline a.c
17884 if eval $compile && $run ./try; then
17885 # Now make sure there is no external linkage of static
17887 set try -DINLINE=$inline -DUSE_B a.c b.c
17888 if eval $compile && $run ./try; then
17889 $echo "Your compiler supports static $inline, " >&4
17890 $echo "but it also creates an external definition," >&4
17891 $echo "so I won't use it." >&4
17894 $echo "Your compiler supports static $inline." >&4
17896 perl_static_inline="static $inline";
17900 $echo "Your compiler does NOT support static $inline." >&4
17905 *inline*) # Some variant of inline exists.
17906 echo "Keeping your $hint value of $perl_static_inline."
17909 static) # No inline capabilities
17910 echo "Keeping your $hint value of $perl_static_inline."
17913 *) # Unrecognized previous value -- blindly trust the supplied
17914 # value and hope it makes sense. Use old value for
17915 # d_static_inline, if there is one.
17916 echo "Keeping your $hint value of $perl_static_inline."
17917 case "$d_static_inline" in
17919 *) val=$d_static_inline ;;
17923 # Fallback to plain 'static' if nothing worked.
17924 case "$perl_static_inline" in
17926 perl_static_inline="static"
17930 set d_static_inline
17932 $rm -f a.[co] b.[co]
17935 : Check stream access
17937 Checking how to access stdio streams by file descriptor number...
17939 case "$stdio_stream_array" in
17940 '') $cat >try.c <<EOCP
17943 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
17947 for s in _iob __iob __sF
17949 set try -DSTDIO_STREAM_ARRAY=$s
17950 if eval $compile; then
17951 case "`$run ./try`" in
17952 yes) stdio_stream_array=$s; break ;;
17958 case "$stdio_stream_array" in
17960 I can't figure out how to access stdio streams by file descriptor number.
17962 d_stdio_stream_array="$undef"
17965 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
17967 d_stdio_stream_array="$define"
17971 : see if strcoll exists
17972 set strcoll d_strcoll
17975 : check for structure copying
17977 echo "Checking to see if your C compiler can copy structs..." >&4
17978 $cat >try.c <<'EOCP'
17988 if $cc -c try.c >/dev/null 2>&1 ; then
17990 echo "Yup, it can."
17993 echo "Nope, it can't."
17999 : see if strerror and/or sys_errlist[] exist
18001 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
18002 if set strerror val -f d_strerror; eval $csym; $val; then
18003 echo 'strerror() found.' >&4
18004 d_strerror="$define"
18005 d_strerrm='strerror(e)'
18006 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18007 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
18008 d_syserrlst="$define"
18010 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
18011 d_syserrlst="$undef"
18013 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
18014 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
18015 echo 'strerror() found in string header.' >&4
18016 d_strerror="$define"
18017 d_strerrm='strerror(e)'
18018 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18019 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
18020 d_syserrlst="$define"
18022 echo "(You don't appear to have any sys_errlist[], how can this be?)"
18023 d_syserrlst="$undef"
18025 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18026 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
18027 d_strerror="$undef"
18028 d_syserrlst="$define"
18029 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
18031 echo 'strerror() and sys_errlist[] NOT found.' >&4
18032 d_strerror="$undef"
18033 d_syserrlst="$undef"
18034 d_strerrm='"unknown"'
18038 : see if strerror_r exists
18039 set strerror_r d_strerror_r
18041 case "$d_strerror_r" in
18043 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
18044 case "$d_strerror_r_proto:$usethreads" in
18045 ":define") d_strerror_r_proto=define
18046 set d_strerror_r_proto strerror_r $hdrs
18050 case "$d_strerror_r_proto" in
18052 case "$strerror_r_proto" in
18053 ''|0) try='int strerror_r(int, char*, size_t);'
18054 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBW ;;
18056 case "$strerror_r_proto" in
18057 ''|0) try='int strerror_r(int, char*, int);'
18058 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBI ;;
18060 case "$strerror_r_proto" in
18061 ''|0) try='char* strerror_r(int, char*, size_t);'
18062 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=B_IBW ;;
18064 case "$strerror_r_proto" in
18065 ''|0) d_strerror_r=undef
18067 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
18068 * ) case "$strerror_r_proto" in
18069 REENTRANT_PROTO*) ;;
18070 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
18072 echo "Prototype: $try" ;;
18075 *) case "$usethreads" in
18076 define) echo "strerror_r has no prototype, not using it." >&4 ;;
18083 *) strerror_r_proto=0
18087 : see if strftime exists
18088 set strftime d_strftime
18091 : see if strlcat exists
18092 set strlcat d_strlcat
18095 : see if strlcpy exists
18096 set strlcpy d_strlcpy
18099 : see if strtod exists
18100 set strtod d_strtod
18103 : see if strtol exists
18104 set strtol d_strtol
18107 : see if strtold exists
18108 set strtold d_strtold
18111 : see if strtoll exists
18112 set strtoll d_strtoll
18115 case "$d_longlong-$d_strtoll" in
18118 Checking whether your strtoll() works okay...
18120 $cat >try.c <<'EOCP'
18123 #define strtoll __strtoll
18126 #define strtoll _strtoll
18129 extern long long int strtoll(char *s, char **, int);
18130 static int bad = 0;
18131 int check(char *s, long long ell, int een) {
18134 gll = strtoll(s, 0, 10);
18135 if (!((gll == ell) && (errno == een)))
18139 check(" 1", 1LL, 0);
18140 check(" 0", 0LL, 0);
18141 check("-1", -1LL, 0);
18142 check("-9223372036854775808", -9223372036854775808LL, 0);
18143 check("-9223372036854775808", -9223372036854775808LL, 0);
18144 check(" 9223372036854775807", 9223372036854775807LL, 0);
18145 check("-9223372036854775808", -9223372036854775808LL, 0);
18146 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
18147 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
18153 if eval $compile; then
18156 ok) echo "Your strtoll() seems to be working okay." ;;
18158 Your strtoll() doesn't seem to be working okay.
18164 echo "(I can't seem to compile the test program--assuming it doesn't)"
18170 : see if strtoq exists
18171 set strtoq d_strtoq
18174 : see if strtoul exists
18175 set strtoul d_strtoul
18178 case "$d_strtoul" in
18181 Checking whether your strtoul() works okay...
18183 $cat >try.c <<'EOCP'
18186 extern unsigned long int strtoul(char *s, char **, int);
18187 static int bad = 0;
18188 void check(char *s, unsigned long eul, int een) {
18191 gul = strtoul(s, 0, 10);
18192 if (!((gul == eul) && (errno == een)))
18196 check(" 1", 1L, 0);
18197 check(" 0", 0L, 0);
18199 case "$longsize" in
18201 $cat >>try.c <<'EOCP'
18202 check("18446744073709551615", 18446744073709551615UL, 0);
18203 check("18446744073709551616", 18446744073709551615UL, ERANGE);
18204 #if 0 /* strtoul() for /^-/ strings is undefined. */
18205 check("-1", 18446744073709551615UL, 0);
18206 check("-18446744073709551614", 2, 0);
18207 check("-18446744073709551615", 1, 0);
18208 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
18209 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
18214 $cat >>try.c <<'EOCP'
18215 check("4294967295", 4294967295UL, 0);
18216 check("4294967296", 4294967295UL, ERANGE);
18217 #if 0 /* strtoul() for /^-/ strings is undefined. */
18218 check("-1", 4294967295UL, 0);
18219 check("-4294967294", 2, 0);
18220 check("-4294967295", 1, 0);
18221 check("-4294967296", 4294967295UL, ERANGE);
18222 check("-4294967297", 4294967295UL, ERANGE);
18227 : Should we write these tests to be more portable by sprintf-ing
18228 : ~0 and then manipulating that char string as input for strtol?
18231 $cat >>try.c <<'EOCP'
18238 if eval $compile; then
18239 case "`$run ./try`" in
18240 ok) echo "Your strtoul() seems to be working okay." ;;
18242 Your strtoul() doesn't seem to be working okay.
18248 echo "(I can't seem to compile the test program--assuming it doesn't)"
18254 : see if strtoull exists
18255 set strtoull d_strtoull
18258 case "$d_longlong-$d_strtoull" in
18261 Checking whether your strtoull() works okay...
18263 $cat >try.c <<'EOCP'
18266 #define strtoull __strtoull
18269 extern unsigned long long int strtoull(char *s, char **, int);
18270 static int bad = 0;
18271 int check(char *s, long long eull, int een) {
18274 gull = strtoull(s, 0, 10);
18275 if (!((gull == eull) && (errno == een)))
18279 check(" 1", 1LL, 0);
18280 check(" 0", 0LL, 0);
18281 check("18446744073709551615", 18446744073709551615ULL, 0);
18282 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18283 #if 0 /* strtoull() for /^-/ strings is undefined. */
18284 check("-1", 18446744073709551615ULL, 0);
18285 check("-18446744073709551614", 2LL, 0);
18286 check("-18446744073709551615", 1LL, 0);
18287 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18288 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18295 if eval $compile; then
18296 case "`$run ./try`" in
18297 ok) echo "Your strtoull() seems to be working okay." ;;
18299 Your strtoull() doesn't seem to be working okay.
18301 d_strtoull="$undef"
18305 echo "(I can't seem to compile the test program--assuming it doesn't)"
18306 d_strtoull="$undef"
18311 : see if strtouq exists
18312 set strtouq d_strtouq
18315 case "$d_strtouq" in
18318 Checking whether your strtouq() works okay...
18320 $cat >try.c <<'EOCP'
18323 extern unsigned long long int strtouq(char *s, char **, int);
18324 static int bad = 0;
18325 void check(char *s, unsigned long long eull, int een) {
18326 unsigned long long gull;
18328 gull = strtouq(s, 0, 10);
18329 if (!((gull == eull) && (errno == een)))
18333 check(" 1", 1LL, 0);
18334 check(" 0", 0LL, 0);
18335 check("18446744073709551615", 18446744073709551615ULL, 0);
18336 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18337 #if 0 /* strtouq() for /^-/ strings is undefined. */
18338 check("-1", 18446744073709551615ULL, 0);
18339 check("-18446744073709551614", 2LL, 0);
18340 check("-18446744073709551615", 1LL, 0);
18341 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18342 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18350 if eval $compile; then
18351 case "`$run ./try`" in
18352 ok) echo "Your strtouq() seems to be working okay." ;;
18354 Your strtouq() doesn't seem to be working okay.
18360 echo "(I can't seem to compile the test program--assuming it doesn't)"
18366 : see if strxfrm exists
18367 set strxfrm d_strxfrm
18370 : see if symlink exists
18371 set symlink d_symlink
18374 : see if syscall exists
18375 set syscall d_syscall
18378 : see if prototype for syscall is available
18380 set d_syscallproto syscall $i_unistd unistd.h
18383 : see if sysconf exists
18384 set sysconf d_sysconf
18387 : see if system exists
18388 set system d_system
18391 : see if tcgetpgrp exists
18392 set tcgetpgrp d_tcgetpgrp
18395 : see if tcsetpgrp exists
18396 set tcsetpgrp d_tcsetpgrp
18399 : see if prototype for telldir is available
18401 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
18404 : see if time exists
18406 if test "X$d_time" = X -o X"$timetype" = X; then
18407 if set time val -f d_time; eval $csym; $val; then
18408 echo 'time() found.' >&4
18410 rp="What is the type returned by time() on this system?"
18411 set time_t timetype long stdio.h sys/types.h
18414 echo 'time() not found, hope that will do.' >&4
18422 : see if timegm exists
18423 set timegm d_timegm
18426 : see if this is a sys/times.h system
18427 set sys/times.h i_systimes
18430 : see if times exists
18432 if set times val -f d_times; eval $csym; $val; then
18433 echo 'times() found.' >&4
18436 case "$i_systimes" in
18437 "$define") inc='sys/times.h';;
18439 rp="What is the type returned by times() on this system?"
18440 set clock_t clocktype long stdio.h sys/types.h $inc
18443 echo 'times() NOT found, hope that will do.' >&4
18448 : see if tmpnam_r exists
18449 set tmpnam_r d_tmpnam_r
18451 case "$d_tmpnam_r" in
18453 hdrs="$i_systypes sys/types.h define stdio.h "
18454 case "$d_tmpnam_r_proto:$usethreads" in
18455 ":define") d_tmpnam_r_proto=define
18456 set d_tmpnam_r_proto tmpnam_r $hdrs
18460 case "$d_tmpnam_r_proto" in
18462 case "$tmpnam_r_proto" in
18463 ''|0) try='char* tmpnam_r(char*);'
18464 ./protochk "$extern_C $try" $hdrs && tmpnam_r_proto=B_B ;;
18466 case "$tmpnam_r_proto" in
18467 ''|0) d_tmpnam_r=undef
18469 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
18470 * ) case "$tmpnam_r_proto" in
18471 REENTRANT_PROTO*) ;;
18472 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
18474 echo "Prototype: $try" ;;
18477 *) case "$usethreads" in
18478 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
18485 *) tmpnam_r_proto=0
18489 : see if truncate exists
18490 set truncate d_truncate
18493 : see if ttyname_r exists
18494 set ttyname_r d_ttyname_r
18496 case "$d_ttyname_r" in
18498 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
18499 case "$d_ttyname_r_proto:$usethreads" in
18500 ":define") d_ttyname_r_proto=define
18501 set d_ttyname_r_proto ttyname_r $hdrs
18505 case "$d_ttyname_r_proto" in
18507 case "$ttyname_r_proto" in
18508 ''|0) try='int ttyname_r(int, char*, size_t);'
18509 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBW ;;
18511 case "$ttyname_r_proto" in
18512 ''|0) try='int ttyname_r(int, char*, int);'
18513 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBI ;;
18515 case "$ttyname_r_proto" in
18516 ''|0) try='char* ttyname_r(int, char*, int);'
18517 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=B_IBI ;;
18519 case "$ttyname_r_proto" in
18520 ''|0) d_ttyname_r=undef
18522 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
18523 * ) case "$ttyname_r_proto" in
18524 REENTRANT_PROTO*) ;;
18525 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
18527 echo "Prototype: $try" ;;
18530 *) case "$usethreads" in
18531 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
18538 *) ttyname_r_proto=0
18542 : see if tzname[] exists
18544 if set tzname val -a d_tzname; eval $csym; $val; then
18546 echo 'tzname[] found.' >&4
18549 echo 'tzname[] NOT found.' >&4
18554 : Check if is a multiplatform env
18556 next|rhapsody|darwin) multiarch="$define" ;;
18558 case "$multiarch" in
18559 ''|[nN]*) multiarch="$undef" ;;
18562 : check for ordering of bytes in a UV
18564 case "$usecrosscompile$multiarch" in
18567 You seem to be either cross-compiling or doing a multiarchitecture build,
18568 skipping the byteorder check.
18574 case "$byteorder" in
18577 In the following, larger digits indicate more significance. A big-endian
18578 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
18579 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
18580 machines may have weird orders like 3412. A Cray will report 87654321,
18581 an Alpha will report 12345678. If the test program works the default is
18583 I'm now running the test program...
18587 #$i_stdlib I_STDLIB
18589 #include <stdlib.h>
18591 #include <sys/types.h>
18592 typedef $uvtype UV;
18602 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
18604 u.l = (UV)0x04030201;
18605 for (i = 0; i < $uvsize; i++)
18606 printf("%c", u.c[i]+'0');
18613 if eval $compile && $run ./try > /dev/null; then
18616 [1-4][1-4][1-4][1-4]|12345678|87654321)
18617 echo "(The test program ran ok.)"
18618 echo "byteorder=$dflt"
18621 ????|????????) echo "(The test program ran ok.)" ;;
18622 *) echo "(The test program didn't run right for some reason.)" ;;
18627 (I can't seem to compile the test program. Guessing big-endian...)
18630 case "$xxx_prompt" in
18632 rp="What is the order of bytes in $uvtype?"
18645 : Checking 32bit alignedness
18648 Checking to see whether you can access character data unalignedly...
18650 case "$d_u32align" in
18651 '') $cat >try.c <<EOCP
18653 #$i_stdlib I_STDLIB
18655 #include <stdlib.h>
18657 #define U32 $u32type
18658 #define BYTEORDER 0x$byteorder
18660 #include <signal.h>
18662 $signal_t bletch(int s) { exit(4); }
18665 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
18666 volatile U8 buf[8];
18670 if (sizeof(U32) != 4) {
18671 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
18678 signal(SIGBUS, bletch);
18690 for (i = 0; i < 4; i++) {
18691 up = (U32*)(buf + i);
18692 if (! ((*up == 1 << (8*i)) || /* big-endian */
18693 (*up == 1 << (8*(3-i))) /* little-endian */
18697 printf("read failed (%x)\n", *up);
18703 for (i = 0; i < 4; i++) {
18704 up = (U32*)(buf + i);
18706 if (*up != 0xBeef) {
18707 printf("write failed (%x)\n", *up);
18721 if eval $compile_ok; then
18722 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
18723 $run ./try 2>&1 >/dev/null
18726 You can access character data pretty unalignedly.
18728 d_u32align="$undef"
18731 It seems that you must access character data in an aligned manner.
18733 d_u32align="$define"
18737 rp='Can you access character data at unaligned addresses?'
18741 [yY]*) d_u32align="$undef" ;;
18742 *) d_u32align="$define" ;;
18749 : see if ualarm exists
18750 set ualarm d_ualarm
18753 : see if umask exists
18757 : see if unordered exists
18758 set unordered d_unordered
18761 : see if unsetenv exists
18762 set unsetenv d_unsetenv
18765 : see if usleep exists
18766 set usleep d_usleep
18769 : see if prototype for usleep is available
18771 set d_usleepproto usleep $i_unistd unistd.h
18774 : see if ustat exists
18778 : see if closedir exists
18779 set closedir d_closedir
18782 case "$d_closedir" in
18785 echo "Checking whether closedir() returns a status..." >&4
18787 #$i_dirent I_DIRENT /**/
18788 #$i_sysdir I_SYS_DIR /**/
18789 #$i_sysndir I_SYS_NDIR /**/
18790 #$i_systypes I_SYS_TYPES /**/
18792 #if defined(I_SYS_TYPES)
18793 #include <sys/types.h>
18795 #if defined(I_DIRENT)
18796 #include <dirent.h>
18797 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
18798 #include <sys/dir.h>
18802 #include <sys/ndir.h>
18806 #include <ndir.h> /* may be wrong in the future */
18808 #include <sys/dir.h>
18813 int main() { return closedir(opendir(".")); }
18816 if eval $compile_ok; then
18817 if $run ./try > /dev/null 2>&1 ; then
18818 echo "Yes, it does."
18821 echo "No, it doesn't."
18825 echo "(I can't seem to compile the test program--assuming it doesn't)"
18833 set d_void_closedir
18837 : see if there is a wait4
18841 : see if waitpid exists
18842 set waitpid d_waitpid
18845 : see if wcstombs exists
18846 set wcstombs d_wcstombs
18849 : see if wctomb exists
18850 set wctomb d_wctomb
18853 : see if writev exists
18854 set writev d_writev
18857 : preserve RCS keywords in files with variable substitution, grrr
18862 Revision='$Revision'
18864 : check for alignment requirements
18866 case "$usecrosscompile$multiarch" in
18869 You seem to be either cross-compiling or doing a multiarchitecture build,
18870 skipping the memory alignment check.
18873 case "$alignbytes" in
18874 '') alignbytes=8 ;;
18878 case "$alignbytes" in
18879 '') echo "Checking alignment constraints..." >&4
18880 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
18881 $cat >try.c <<'EOCP'
18882 typedef long double NV;
18885 $cat >try.c <<'EOCP'
18889 $cat >>try.c <<'EOCP'
18897 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
18902 if eval $compile_ok; then
18906 echo "(I can't seem to compile the test program...)"
18909 *) dflt="$alignbytes"
18912 rp="Doubles must be aligned on a how-many-byte boundary?"
18920 : set the base revision
18923 : length of character in bytes. Is always 1, otherwise it isnt C
18924 : This used to be a test using sizeof
18927 : Check for the number of bits in a character
18928 case "$charbits" in
18929 '') echo "Checking how long a character is (in bits)..." >&4
18936 for (c = 1, n = 0; c; c <<= 1, n++) ;
18937 printf ("%d\n", n);
18942 if eval $compile_ok; then
18946 echo "(I can't seem to compile the test program. Guessing...)"
18953 rp="What is the length of a character (in bits)?"
18957 case "$charbits" in
18960 Your system has an unsigned character size of $charbits bits, which
18961 is rather unusual (normally it is 8 bits). Perl likely will not work
18962 correctly on your system, with subtle bugs in various places.
18964 rp='Do you really want to continue?'
18968 [yY]) echo >&4 "Okay, continuing." ;;
18973 : how do we concatenate cpp tokens here?
18975 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
18976 $cat >cpp_stuff.c <<'EOCP'
18977 #define RCAT(a,b)a/**/b
18978 #define ACAT(a,b)a ## b
18982 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
18983 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
18984 echo "Oh! Smells like ANSI's been here." >&4
18985 echo "We can catify or stringify, separately or together!"
18987 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
18988 echo "Ah, yes! The good old days!" >&4
18989 echo "However, in the good old days we don't know how to stringify and"
18990 echo "catify at the same time."
18994 Hmm, I don't seem to be able to concatenate tokens with your cpp.
18995 You're going to have to edit the values of CAT[2-5] in config.h...
18997 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
19001 : see if this is a db.h system
19007 : Check db version.
19009 echo "Checking Berkeley DB version ..." >&4
19015 #include <sys/types.h>
19017 #$i_stdlib I_STDLIB
19019 #include <stdlib.h>
19022 int main(int argc, char *argv[])
19024 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
19025 int Major, Minor, Patch ;
19026 unsigned long Version ;
19027 (void)db_version(&Major, &Minor, &Patch) ;
19029 printf("%d %d %d %d %d %d\n",
19030 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
19031 Major, Minor, Patch);
19034 printf("You have Berkeley DB Version 2 or greater.\n");
19036 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
19037 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
19038 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
19039 Major, Minor, Patch) ;
19041 /* check that db.h & libdb are compatible */
19042 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
19043 printf("db.h and libdb are incompatible.\n") ;
19047 printf("db.h and libdb are compatible.\n") ;
19049 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
19050 + DB_VERSION_PATCH ;
19052 /* needs to be >= 2.3.4 */
19053 if (Version < 2003004) {
19054 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
19055 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
19061 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
19066 printf("You have Berkeley DB Version 1.\n");
19067 exit(0); /* DB version < 2: the coast is clear. */
19069 exit(1); /* <db.h> not Berkeley DB? */
19075 if eval $compile_ok && $run ./try; then
19076 echo 'Looks OK.' >&4
19078 db_version_major=$1
19079 db_version_minor=$2
19080 db_version_patch=$3
19082 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
19086 : Remove db from list of libraries to use
19087 echo "Removing unusable -ldb from library list" >&4
19088 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
19091 echo "libs = $libs" >&4
19101 : Check the return type needed for hash
19103 echo "Checking return type needed for hash for Berkeley DB ..." >&4
19109 #include <sys/types.h>
19112 #ifndef DB_VERSION_MAJOR
19113 u_int32_t hash_cb (ptr, size)
19121 info.hash = hash_cb;
19125 if $cc $ccflags -c try.c >try.out 2>&1 ; then
19126 if $contains warning try.out >>/dev/null 2>&1 ; then
19129 db_hashtype='u_int32_t'
19132 : XXX Maybe we should just give up here.
19133 db_hashtype=u_int32_t
19135 echo "Help: I can't seem to compile the db test program." >&4
19136 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
19139 echo "Your version of Berkeley DB uses $db_hashtype for hash."
19141 *) db_hashtype=u_int32_t
19146 : Check the return type needed for prefix
19148 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
19154 #include <sys/types.h>
19157 #ifndef DB_VERSION_MAJOR
19158 size_t prefix_cb (key1, key2)
19166 info.prefix = prefix_cb;
19170 if $cc $ccflags -c try.c >try.out 2>&1 ; then
19171 if $contains warning try.out >>/dev/null 2>&1 ; then
19172 db_prefixtype='int'
19174 db_prefixtype='size_t'
19177 db_prefixtype='size_t'
19178 : XXX Maybe we should just give up here.
19180 echo "Help: I can't seem to compile the db test program." >&4
19181 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
19184 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
19186 *) db_prefixtype='size_t'
19190 : How can we generate normalized random numbers ?
19192 echo "Looking for a random number function..." >&4
19193 case "$randfunc" in
19195 if set drand48 val -f; eval $csym; $val; then
19197 echo "Good, found drand48()." >&4
19198 elif set random val -f; eval $csym; $val; then
19200 echo "OK, found random()." >&4
19203 echo "Yick, looks like I have to use rand()." >&4
19214 *-Dmy_rand=*|*-Dmy_srand=*)
19215 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
19216 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
19217 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
19218 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
19222 while $test "$cont"; do
19223 rp="Use which function to generate random numbers?"
19225 if $test "$ans" = "$dflt"; then
19231 if set $ans val -f; eval $csym; $val; then
19235 rp="I cannot find function $ans. Use that name anyway?"
19244 case "$randfunc" in
19246 drand01="drand48()"
19252 case "$randbits" in
19254 echo "Checking to see how many bits your $randfunc() function produces..." >&4
19256 #$i_unistd I_UNISTD
19257 #$i_stdlib I_STDLIB
19260 # include <unistd.h>
19263 # include <stdlib.h>
19268 register unsigned long tmp;
19269 register unsigned long max = 0L;
19271 for (i = 1000; i; i--) {
19272 tmp = (unsigned long) $randfunc();
19273 if (tmp > max) max = tmp;
19275 for (i = 0; max; i++)
19281 if eval $compile_ok; then
19285 echo "(I can't seem to compile the test program...)"
19292 rp="How many bits does your $randfunc() function produce?"
19296 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
19297 seedfunc="s$randfunc"
19298 randseedtype=unsigned
19302 rp="How many bits does your $randfunc() function produce?"
19305 seedfunc="s$randfunc"
19306 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
19307 if set $seedfunc val -f; eval $csym; $val; then
19308 echo "(Using $seedfunc() to seed random generator)"
19310 echo "(Warning: no $seedfunc() to seed random generator)"
19313 randseedtype=unsigned
19320 : Determine if this is an EBCDIC system
19322 echo "Determining whether or not we are on an EBCDIC system..." >&4
19323 $cat >try.c <<'EOM'
19326 if ('M'==0xd4) return 0;
19333 if eval $compile_ok; then
19334 if $run ./try; then
19335 echo "You seem to speak EBCDIC." >&4
19338 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
19341 echo "I'm unable to compile the test program." >&4
19342 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
19348 : Check how to flush
19351 Checking how to flush all pending stdio output...
19353 # I only know how to find the first 32 possibly open files on SunOS.
19354 # See also hints/sunos_4_1.sh and util.c --AD
19356 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
19358 $cat >>try.c <<EOCP
19360 #$i_stdlib I_STDLIB
19362 #include <stdlib.h>
19364 #$i_unistd I_UNISTD
19366 # include <unistd.h>
19368 #$d_sysconf HAS_SYSCONF
19369 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
19370 #ifdef HAS_STDIO_STREAM_ARRAY
19371 # define STDIO_STREAM_ARRAY $stdio_stream_array
19376 p = fopen("try.out", "w");
19380 # ifdef TRY_FPRINTF
19384 #ifdef TRY_FFLUSH_NULL
19387 #ifdef TRY_FFLUSH_ALL
19389 long open_max = -1;
19390 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
19391 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
19393 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
19394 open_max = sysconf(_SC_OPEN_MAX);
19397 open_max = FOPEN_MAX;
19400 open_max = OPEN_MAX;
19409 # ifdef HAS_STDIO_STREAM_ARRAY
19410 if (open_max > 0) {
19412 for (i = 0; i < open_max; i++)
19413 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
19414 STDIO_STREAM_ARRAY[i]._file < open_max &&
19415 STDIO_STREAM_ARRAY[i]._flag)
19416 fflush(&STDIO_STREAM_ARRAY[i]);
19424 : first we have to find out how _not_ to flush
19426 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
19428 set try -DTRY_FPUTC
19429 if eval $compile; then
19430 $run ./try 2>/dev/null
19433 if $test ! -s try.out -a "X$code" = X42; then
19439 set try -DTRY_FPRINTF
19440 if eval $compile; then
19441 $run ./try 2>/dev/null
19444 if $test ! -s try.out -a "X$code" = X42; then
19445 output=-DTRY_FPRINTF
19451 : check for fflush NULL behaviour
19452 case "$fflushNULL" in
19453 '') set try -DTRY_FFLUSH_NULL $output
19454 if eval $compile; then
19455 $run ./try 2>/dev/null
19458 if $test -s try.out -a "X$code" = X42; then
19459 fflushNULL="`$cat try.out`"
19461 if $test "X$code" != X42; then
19463 (If this test failed, don't worry, we'll try another method shortly.)
19468 $rm -f core try.core core.try.*
19469 case "$fflushNULL" in
19471 Your fflush(NULL) works okay for output streams.
19472 Let's see if it clobbers input pipes...
19474 # As of mid-March 2000 all versions of Solaris appear to have a stdio
19475 # bug that improperly flushes the input end of pipes. So we avoid the
19476 # autoflush on fork/system/exec support for now. :-(
19477 $cat >tryp.c <<EOCP
19480 main(int argc, char **argv)
19486 while ((i = getc(stdin)) != -1
19487 && (*bp++ = i) != '\n'
19488 && bp < &buf[1024])
19491 fprintf(stdout, "%s", buf);
19499 fflushNULL="$define"
19501 if eval $compile; then
19503 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19504 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19506 fflush(NULL) seems to behave okay with input streams.
19508 fflushNULL="$define"
19511 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
19513 fflushNULL="$undef"
19516 $rm -f core tryp.c tryp.core core.tryp.*
19519 Your fflush(NULL) isn't working (contrary to ANSI C).
19521 fflushNULL="$undef"
19524 Cannot figure out whether your fflush(NULL) works or not.
19525 I'm assuming it doesn't (contrary to ANSI C).
19527 fflushNULL="$undef"
19531 $define|true|[yY]*)
19532 fflushNULL="$define"
19535 fflushNULL="$undef"
19538 : check explicit looping only if NULL did not work, and if the pipe
19539 : bug does not show up on an explicit flush too
19540 case "$fflushNULL" in
19542 $cat >tryp.c <<EOCP
19545 main(int argc, char **argv)
19551 while ((i = getc(stdin)) != -1
19552 && (*bp++ = i) != '\n'
19553 && bp < &buf[1024])
19556 fprintf(stdout, "%s", buf);
19565 if eval $compile; then
19567 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19568 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19570 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
19572 : now check for fflushall behaviour
19573 case "$fflushall" in
19574 '') set try -DTRY_FFLUSH_ALL $output
19575 if eval $compile; then
19577 (Now testing the other method--but note that this also may fail.)
19579 $run ./try 2>/dev/null
19582 if $test -s try.out -a "X$code" = X42; then
19583 fflushall="`$cat try.out`"
19587 case "$fflushall" in
19589 Whew. Flushing explicitly all the stdio streams works.
19591 fflushall="$define"
19594 Sigh. Flushing explicitly all the stdio streams doesn't work.
19599 Cannot figure out whether flushing stdio streams explicitly works or not.
19600 I'm assuming it doesn't.
19606 "$define"|true|[yY]*)
19607 fflushall="$define"
19615 All is futile. Even fflush(stdin) clobbers input pipes!
19622 $rm -f core tryp.c tryp.core core.tryp.*
19624 *) fflushall="$undef"
19628 case "$fflushNULL$fflushall" in
19631 OK, I give up. I cannot figure out how to flush pending stdio output.
19632 We won't be flushing handles at all before fork/exec/popen.
19638 : Store the full pathname to the ar program for use in the C program
19639 : Respect a hint or command line value for full_ar.
19644 : Store the full pathname to the sed program for use in the C program
19647 : see what type gids are declared as in the kernel
19649 echo "Looking for the type for group ids returned by getgid()."
19650 set gid_t gidtype xxx stdio.h sys/types.h
19654 xxx=`./findhdr sys/user.h`
19655 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
19657 unsigned) dflt="$1 $2" ;;
19661 *) dflt="$gidtype";;
19664 gid_t) echo "gid_t found." ;;
19665 *) rp="What is the type for group ids returned by getgid()?"
19671 : Check the size of GID
19674 *_t) zzz="$gidtype" ;;
19677 echo "Checking the size of $zzz..." >&4
19679 #include <sys/types.h>
19681 #$i_stdlib I_STDLIB
19683 #include <stdlib.h>
19686 printf("%d\n", (int)sizeof($gidtype));
19691 if eval $compile_ok; then
19695 echo "(I can't execute the test program--guessing $gidsize.)" >&4
19698 echo "Your $zzz is $gidsize bytes long."
19703 echo "(I can't compile the test program--guessing $gidsize.)" >&4
19707 : Check if GID is signed
19710 *_t) zzz="$gidtype" ;;
19713 echo "Checking the sign of $zzz..." >&4
19715 #include <sys/types.h>
19726 if eval $compile; then
19730 echo "(I can't execute the test program--guessing unsigned.)" >&4
19734 1) echo "Your $zzz is unsigned." ;;
19735 -1) echo "Your $zzz is signed." ;;
19741 echo "(I can't compile the test program--guessing unsigned.)" >&4
19745 : Check 64bit sizes
19748 if $test X"$quadtype" != X; then
19750 echo "Checking how to print 64-bit integers..." >&4
19752 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
19753 $cat >try.c <<'EOCP'
19754 #include <sys/types.h>
19757 int q = 12345678901;
19758 printf("%ld\n", q);
19762 if eval $compile; then
19766 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
19767 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
19768 echo "We will use %d."
19774 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
19775 $cat >try.c <<'EOCP'
19776 #include <sys/types.h>
19779 long q = 12345678901;
19780 printf("%ld\n", q);
19784 if eval $compile; then
19788 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
19789 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
19790 echo "We will use %ld."
19796 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
19797 $cat >try.c <<'EOCP'
19798 #include <sys/types.h>
19799 #include <inttypes.h>
19802 int64_t q = 12345678901;
19803 printf("%" PRId64 "\n", q);
19807 if eval $compile; then
19811 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
19812 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
19813 echo "We will use the C9X style."
19819 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19821 #include <sys/types.h>
19824 $quadtype q = 12345678901;
19825 printf("%Ld\n", q);
19829 if eval $compile; then
19833 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
19834 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
19835 echo "We will use %Ld."
19841 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
19842 $cat >try.c <<'EOCP'
19843 #include <sys/types.h>
19846 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
19847 printf("%lld\n", q);
19851 if eval $compile; then
19855 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
19856 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
19857 echo "We will use the %lld style."
19863 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19865 #include <sys/types.h>
19868 $quadtype q = 12345678901;
19869 printf("%qd\n", q);
19873 if eval $compile; then
19877 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
19878 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
19879 echo "We will use %qd."
19885 if $test X"$sPRId64" = X; then
19886 echo "Cannot figure out how to print 64-bit integers." >&4
19893 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
19894 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
19896 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
19897 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
19901 : Check format strings for internal types
19903 $echo "Checking the format strings to be used for Perl's internal types..." >&4
19905 if $test X"$ivsize" = X8; then
19906 ivdformat="$sPRId64"
19907 uvuformat="$sPRIu64"
19908 uvoformat="$sPRIo64"
19909 uvxformat="$sPRIx64"
19910 uvXUformat="$sPRIXU64"
19912 if $test X"$ivsize" = X"$longsize"; then
19919 if $test X"$ivsize" = X"$intsize"; then
19927 if $test X"$ivsize" = X"$shortsize"; then
19938 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
19939 nveformat="$sPRIeldbl"
19940 nvfformat="$sPRIfldbl"
19941 nvgformat="$sPRIgldbl"
19942 nvEUformat="$sPRIEUldbl"
19943 nvFUformat="$sPRIFUldbl"
19944 nvGUformat="$sPRIGUldbl"
19954 case "$ivdformat" in
19955 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
19960 : Check format string for GID
19963 $echo "Checking the format string to be used for gids..." >&4
19966 -1) if $test X"$gidsize" = X"$ivsize"; then
19967 gidformat="$ivdformat"
19969 if $test X"$gidsize" = X"$longsize"; then
19972 if $test X"$gidsize" = X"$intsize"; then
19975 if $test X"$gidsize" = X"$shortsize"; then
19982 *) if $test X"$gidsize" = X"$uvsize"; then
19983 gidformat="$uvuformat"
19985 if $test X"$gidsize" = X"$longsize"; then
19988 if $test X"$gidsize" = X"$intsize"; then
19991 if $test X"$gidsize" = X"$shortsize"; then
20000 : see if getgroups exists
20001 set getgroups d_getgrps
20004 : see if setgroups exists
20005 set setgroups d_setgrps
20008 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
20010 case "$d_getgrps$d_setgrps" in
20012 case "$groupstype" in
20013 '') dflt="$gidtype" ;;
20014 *) dflt="$groupstype" ;;
20017 What type of pointer is the second argument to getgroups() and setgroups()?
20018 Usually this is the same as group ids, $gidtype, but not always.
20021 rp='What type pointer is the second argument to getgroups() and setgroups()?'
20025 *) groupstype="$gidtype";;
20028 : MAD = Misc Attribute Definition
20030 if $test $patchlevel -lt 9; then
20031 : MAD is not available in 5.8.x or earlier.
20035 $define|true|[yY]*) dflt='y' ;;
20040 Would you like to build with Misc Attribute Decoration? This is development
20041 work leading to a Perl 5 to Perl 6 convertor, which imposes a space and speed
20042 overhead on the interpreter.
20044 If this doesn't make any sense to you, just accept the default '$dflt'.
20046 rp='Build Perl with MAD?'
20051 madlyh='madly.h madly.act madly.tab'
20053 madlyobj="madly$_o" ;;
20062 : check whether make sets MAKE
20064 echo "Checking if your $make program sets \$(MAKE)..." >&4
20065 case "$make_set_make" in
20067 $sed 's/^X //' > testmake.mak << 'EOF'
20069 X @echo 'maketemp="$(MAKE)"'
20071 case "`$make -f testmake.mak 2>/dev/null`" in
20072 *maketemp=*) make_set_make='#' ;;
20073 *) make_set_make="MAKE=$make" ;;
20075 $rm -f testmake.mak
20078 case "$make_set_make" in
20079 '#') echo "Yup, it does.";;
20080 *) echo "Nope, it doesn't.";;
20083 : see what type is used for mode_t
20084 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
20085 set mode_t modetype int stdio.h sys/types.h
20088 : see if we need va_copy
20090 case "$i_stdarg" in
20093 #include <stdarg.h>
20095 #$i_stdlib I_STDLIB
20097 #include <stdlib.h>
20099 #include <signal.h>
20102 ivfprintf(FILE *f, const char *fmt, va_list *valp)
20104 return vfprintf(f, fmt, *valp);
20108 myvfprintf(FILE *f, const char *fmt, va_list val)
20110 return ivfprintf(f, fmt, &val);
20114 myprintf(char *fmt, ...)
20117 va_start(val, fmt);
20118 return myvfprintf(stdout, fmt, val);
20122 main(int ac, char **av)
20124 signal(SIGSEGV, exit);
20126 myprintf("%s%cs all right, then\n", "that", '\'');
20131 if eval $compile && $run ./try 2>&1 >/dev/null; then
20132 case "`$run ./try`" in
20133 "that's all right, then")
20139 yes) echo "It seems that you don't need va_copy()." >&4
20140 need_va_copy="$undef"
20142 *) echo "It seems that va_copy() or similar will be needed." >&4
20143 need_va_copy="$define"
20148 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
20152 : see what type is used for size_t
20153 rp="What is the type used for the length parameter for string functions?"
20154 set size_t sizetype 'unsigned int' stdio.h sys/types.h
20157 : check for type of arguments to gethostbyaddr.
20158 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
20159 case "$d_gethbyaddr" in
20163 Checking to see what type of arguments are accepted by gethostbyaddr().
20165 hdrs="$define sys/types.h
20166 $d_socket sys/socket.h
20167 $i_niin netinet/in.h
20169 $i_unistd unistd.h"
20170 : The first arg can 'char *' or 'void *'
20171 : The second arg is some of integral type
20172 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
20173 for yyy in size_t long int; do
20174 case "$netdb_host_type" in
20175 '') try="$extern_C struct hostent *gethostbyaddr($xxx, $yyy, int);"
20176 if ./protochk "$try" $hdrs; then
20177 echo "Your system accepts $xxx for the first arg."
20178 echo "...and $yyy for the second arg."
20179 netdb_host_type="$xxx"
20180 netdb_hlen_type="$yyy"
20186 : In case none of those worked, prompt the user.
20187 case "$netdb_host_type" in
20188 '') rp='What is the type for the 1st argument to gethostbyaddr?'
20191 netdb_host_type=$ans
20192 rp='What is the type for the 2nd argument to gethostbyaddr?'
20195 netdb_hlen_type=$ans
20199 *) : no gethostbyaddr, so pick harmless defaults
20200 netdb_host_type='char *'
20201 netdb_hlen_type="$sizetype"
20204 # Remove the "const" if needed. -- but then we'll have a
20206 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
20209 : check for type of argument to gethostbyname.
20210 if test "X$netdb_name_type" = X ; then
20211 case "$d_gethbyname" in
20215 Checking to see what type of argument is accepted by gethostbyname().
20217 hdrs="$define sys/types.h
20218 $d_socket sys/socket.h
20219 $i_niin netinet/in.h
20221 $i_unistd unistd.h"
20222 for xxx in "const char *" "char *"; do
20223 case "$netdb_name_type" in
20224 '') try="$extern_C struct hostent *gethostbyname($xxx);"
20225 if ./protochk "$try" $hdrs; then
20226 echo "Your system accepts $xxx."
20227 netdb_name_type="$xxx"
20232 : In case none of those worked, prompt the user.
20233 case "$netdb_name_type" in
20234 '') rp='What is the type for the 1st argument to gethostbyname?'
20237 netdb_name_type=$ans
20241 *) : no gethostbyname, so pick harmless default
20242 netdb_name_type='char *'
20247 : check for type of 1st argument to getnetbyaddr.
20248 if test "X$netdb_net_type" = X ; then
20249 case "$d_getnbyaddr" in
20253 Checking to see what type of 1st argument is accepted by getnetbyaddr().
20255 hdrs="$define sys/types.h
20256 $d_socket sys/socket.h
20257 $i_niin netinet/in.h
20259 $i_unistd unistd.h"
20260 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
20261 case "$netdb_net_type" in
20262 '') try="$extern_C struct netent *getnetbyaddr($xxx, int);"
20263 if ./protochk "$try" $hdrs; then
20264 echo "Your system accepts $xxx."
20265 netdb_net_type="$xxx"
20270 : In case none of those worked, prompt the user.
20271 case "$netdb_net_type" in
20272 '') rp='What is the type for the 1st argument to getnetbyaddr?'
20275 netdb_net_type=$ans
20279 *) : no getnetbyaddr, so pick harmless default
20280 netdb_net_type='long'
20284 : locate the preferred pager for this system
20291 [a-zA-Z]:/*) dflt=$pg;;
20295 [a-zA-Z]:/*) dflt=$more;;
20299 [a-zA-Z]:/*) dflt=$less;;
20302 '') dflt=/usr/ucb/more;;
20310 rp='What pager is used on your system?'
20314 : see what type pids are declared as in the kernel
20315 rp="What is the type of process ids on this system?"
20316 set pid_t pidtype int stdio.h sys/types.h
20319 : see if ar generates random libraries by itself
20321 echo "Checking how to generate random libraries on your machine..." >&4
20322 echo 'int bar1() { return bar2(); }' > bar1.c
20323 echo 'int bar2() { return 2; }' > bar2.c
20325 #$i_stdlib I_STDLIB
20327 #include <stdlib.h>
20329 int main() { printf("%d\n", bar1()); exit(0); }
20331 $cc $ccflags -c bar1.c >/dev/null 2>&1
20332 $cc $ccflags -c bar2.c >/dev/null 2>&1
20333 $cc $ccflags -c foo.c >/dev/null 2>&1
20334 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
20335 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20336 $run ./foobar >/dev/null 2>&1; then
20337 echo "$ar appears to generate random libraries itself."
20339 if [ "X$ranlib" = "X" ]; then
20342 elif $ar s bar$_a >/dev/null 2>&1 &&
20343 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20344 $run ./foobar >/dev/null 2>&1; then
20345 echo "a table of contents needs to be added with '$ar s'."
20348 elif $ar ts bar$_a >/dev/null 2>&1 &&
20349 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20350 $run ./foobar >/dev/null 2>&1; then
20351 echo "a table of contents needs to be added with '$ar ts'."
20358 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
20359 $test -f $ranlib || ranlib=''
20362 if $test -n "$ranlib"; then
20363 echo "your system has '$ranlib'; we'll use that."
20366 echo "your system doesn't seem to support random libraries"
20367 echo "so we'll use lorder and tsort to order the libraries."
20374 : see if this is a values.h system
20375 set values.h i_values
20378 : Check the max offset that gmtime and localtime accept
20379 echo "Checking max offsets that gmtime () accepts"
20382 define) yyy="#include <values.h>" ;;
20386 case "$sGMTIME_min/$sGMTIME_max" in
20389 #include <sys/types.h>
20398 void gm_check (time_t t, int min_year, int max_year)
20401 if ( tmp == NULL ||
20402 /* Check tm_year overflow */
20403 tmp->tm_year < min_year || tmp->tm_year > max_year)
20414 gm_check (MAXLONG, 69, 0x7fffffff);
20416 if (tmp == NULL || tmp->tm_year < 0) {
20417 for (i = 63; i >= 0; i--) {
20418 time_t x = pt | ((time_t)1 << i);
20419 if (x < 0 || x < pt) continue;
20420 gm_check (x, 69, 0x7fffffff);
20423 printf ("sGMTIME_max=%ld\n", pt);
20432 gm_check (MINLONG, -1900, 70);
20435 for (i = 36; i >= 0; i--) {
20436 time_t x = pt - ((time_t)1 << i);
20437 if (x > 0) continue;
20438 gm_check (x, -1900, 70);
20441 printf ("sGMTIME_min=%ld\n", pt);
20445 int main (int argc, char *argv[])
20447 fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t));
20454 if eval $compile; then
20457 echo "Cannot determine sGMTIME_max and sGMTIME_min." >&4
20463 echo "Checking max offsets that localtime () accepts"
20465 case "$sLOCALTIME_min/$sLOCALTIME_max" in
20468 #include <sys/types.h>
20477 void local_check (time_t t, int min_year, int max_year)
20479 if (sizeof (time_t) > 4 && t > 0x7ffffffffffff000LL)
20482 tmp = localtime (&t);
20483 if ( tmp == NULL ||
20484 /* Check tm_year overflow */
20485 tmp->tm_year < min_year || tmp->tm_year > max_year)
20489 } /* local_check */
20496 local_check (MAXLONG, 69, 0x7fffffff);
20498 if (tmp == NULL || tmp->tm_year < 0) {
20499 for (i = 63; i >= 0; i--) {
20500 time_t x = pt | ((time_t)1 << i);
20501 if (x < 0 || x < pt) continue;
20502 local_check (x, 69, 0x7fffffff);
20505 printf ("sLOCALTIME_max=%ld\n", pt);
20514 local_check (MINLONG, -1900, 70);
20517 for (i = 36; i >= 0; i--) {
20518 time_t x = pt - ((time_t)1 << i);
20519 if (x > 0) continue;
20520 local_check (x, -1900, 70);
20523 printf ("sLOCALTIME_min=%ld\n", pt);
20527 int main (int argc, char *argv[])
20535 if eval $compile; then
20538 echo "Cannot determine sLOCALTIME_max and sLOCALTIME_min." >&4
20544 : check for type of arguments to select.
20545 case "$selecttype" in
20546 '') case "$d_select" in
20550 Checking to see what type of arguments are accepted by select().
20552 hdrs="$define sys/types.h
20553 $i_systime sys/time.h
20554 $i_sysselct sys/select.h
20555 $d_socket sys/socket.h"
20556 : The first arg can be int, unsigned, or size_t
20557 : The last arg may or may not be 'const'
20559 : void pointer has been seen but using that
20560 : breaks the selectminbits test
20561 for xxx in 'fd_set *' 'int *'; do
20562 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
20563 for tmo in 'struct timeval *' 'const struct timeval *'; do
20565 '') try="$extern_C select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
20566 if ./protochk "$try" $hdrs; then
20567 echo "Your system accepts $xxx."
20576 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
20577 case "$d_fd_set" in
20578 $define) dflt="fd_set *" ;;
20587 *) : no select, so pick a harmless default
20594 : check for the select 'width'
20595 case "$selectminbits" in
20596 '') safebits=`expr $ptrsize \* 8`
20597 case "$d_select" in
20601 Checking to see on how many bits at a time your select() operates...
20604 #include <sys/types.h>
20606 #$i_systime I_SYS_TIME
20607 #$i_systimek I_SYS_TIME_KERNEL
20612 # ifdef I_SYS_TIME_KERNEL
20615 # include <sys/time.h>
20616 # ifdef I_SYS_TIME_KERNEL
20620 #$i_sysselct I_SYS_SELECT
20621 #ifdef I_SYS_SELECT
20622 #include <sys/select.h>
20624 #$d_socket HAS_SOCKET
20626 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
20629 #$i_stdlib I_STDLIB
20631 #include <stdlib.h>
20634 #define S sizeof(*(b))
20636 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
20637 #define NBITS (NBYTES * 8)
20639 char *s = (char *)malloc(NBYTES);
20648 fp = fopen("try.c", "r");
20654 b = ($selecttype)s;
20655 for (i = 0; i < NBITS; i++)
20659 select(fd + 1, b, 0, 0, &t);
20660 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
20662 printf("%d\n", i + 1);
20667 if eval $compile_ok; then
20668 selectminbits=`$run ./try`
20669 case "$selectminbits" in
20671 Cannot figure out on how many bits at a time your select() operates.
20672 I'll play safe and guess it is $safebits bits.
20674 selectminbits=$safebits
20675 bits="$safebits bits"
20678 *) bits="$selectminbits bits" ;;
20680 echo "Your select() operates on $bits at a time." >&4
20682 rp='What is the minimum number of bits your select() operates on?'
20683 case "$byteorder" in
20684 12345678) dflt=64 ;;
20690 selectminbits="$val"
20694 *) : no select, so pick a harmless default
20695 selectminbits=$safebits
20701 : Trace out the files included by signal.h, then look for SIGxxx names.
20702 if [ "X$fieldn" = X ]; then
20703 : Just make some guesses. We check them later.
20704 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
20706 xxx=`echo '#include <signal.h>' |
20707 $cppstdin $cppminus $cppflags 2>/dev/null |
20708 $grep '^[ ]*#.*include' |
20709 $awk "{print \\$$fieldn}" | $sed 's!"!!g' |\
20710 $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
20713 for xx in $xxx /dev/null ; do
20714 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
20716 case "$xxxfiles" in
20717 '') xxxfiles=`./findhdr signal.h` ;;
20720 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
20721 print substr($2, 4, 20)
20723 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
20724 print substr($3, 4, 20)
20726 : Append some common names just in case the awk scan failed.
20727 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
20728 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
20729 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
20730 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
20731 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
20733 : generate a few handy files for later
20734 $cat > signal.c <<EOCP
20735 #include <sys/types.h>
20736 #include <signal.h>
20737 #$i_stdlib I_STDLIB
20739 #include <stdlib.h>
20744 /* Strange style to avoid deeply-nested #if/#else/#endif */
20747 # define NSIG (_NSIG)
20753 # define NSIG (SIGMAX+1)
20759 # define NSIG (SIG_MAX+1)
20765 # define NSIG (_SIG_MAX+1)
20771 # define NSIG (MAXSIG+1)
20777 # define NSIG (MAX_SIG+1)
20782 # ifdef SIGARRAYSIZE
20783 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
20789 # define NSIG (_sys_nsig) /* Solaris 2.5 */
20793 /* Default to some arbitrary number that's big enough to get most
20794 of the common signals.
20800 printf("NSIG %d\n", NSIG);
20806 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
20808 printf "#ifdef SIG"; printf $1; printf "\n"
20809 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
20810 printf $1; printf ");\n"
20814 printf "#endif /* JUST_NSIG */\n";
20815 printf "exit(0);\n}\n";
20818 $cat >signal.awk <<'EOP'
20819 BEGIN { ndups = 0 }
20820 $1 ~ /^NSIG$/ { nsig = $2 }
20821 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
20822 if ($2 > maxsig) { maxsig = $2 }
20823 if (sig_name[$2]) {
20824 dup_name[ndups] = $1
20825 dup_num[ndups] = $2
20837 printf("NSIG %d\n", nsig);
20838 for (n = 1; n < nsig; n++) {
20840 printf("%s %d\n", sig_name[n], sig_num[n])
20843 printf("NUM%d %d\n", n, n)
20846 for (n = 0; n < ndups; n++) {
20847 printf("%s %d\n", dup_name[n], dup_num[n])
20851 $cat >signal_cmd <<EOS
20853 if $test -s signal.lst; then
20854 echo "Using your existing signal.lst file"
20859 $cat >>signal_cmd <<'EOS'
20862 if eval $compile_ok; then
20863 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) |\
20864 $uniq | $awk -f signal.awk >signal.lst
20866 echo "(I can't seem be able to compile the whole test program)" >&4
20867 echo "(I'll try it in little pieces.)" >&4
20868 set signal -DJUST_NSIG
20869 if eval $compile_ok; then
20870 $run ./signal$_exe > signal.nsg
20873 echo "I can't seem to figure out how many signals you have." >&4
20874 echo "Guessing 50." >&4
20875 echo 'NSIG 50' > signal.nsg
20877 : Now look at all the signal names, one at a time.
20878 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
20879 $cat > signal.c <<EOCP
20880 #include <sys/types.h>
20881 #include <signal.h>
20884 printf("$xx %d\n", SIG${xx});
20889 if eval $compile; then
20890 echo "SIG${xx} found."
20891 $run ./signal$_exe >> signal.ls1
20893 echo "SIG${xx} NOT found."
20896 if $test -s signal.ls1; then
20897 $cat signal.nsg signal.ls1 |
20898 $sort -n | $uniq | $awk -f signal.awk >signal.lst
20902 if $test -s signal.lst; then
20905 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
20906 echo 'kill -l' >signal
20907 set X `csh -f <signal`
20911 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
20913 echo $@ | $tr ' ' $trnl | \
20914 $awk '{ printf "%s %d\n", $1, ++s; }
20915 END { printf "NSIG %d\n", ++s }' >signal.lst
20917 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
20919 chmod a+x signal_cmd
20920 $eunicefix signal_cmd
20922 : generate list of signal names
20924 case "$sig_name_init" in
20926 *) case "$sig_num_init" in
20927 ''|*,*) doinit=yes ;;
20932 echo "Generating a list of signal names and numbers..." >&4
20934 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
20935 sig_name=`$awk 'BEGIN { printf "ZERO " }
20936 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
20937 sig_num=`$awk 'BEGIN { printf "0 " }
20938 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
20939 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
20940 !/^NSIG/ { printf "\"%s\", ", $1 }
20941 END { printf "0\n" }' signal.lst`
20942 sig_num_init=`$awk 'BEGIN { printf "0, " }
20943 !/^NSIG/ { printf "%d, ", $2}
20944 END { printf "0\n"}' signal.lst`
20947 echo "The following $sig_count signals are available:"
20949 echo $sig_name | $awk \
20950 'BEGIN { linelen = 0 }
20952 for (i = 1; i <= NF; i++) {
20953 name = "SIG" $i " "
20954 linelen = linelen + length(name)
20955 if (linelen > 70) {
20957 linelen = length(name)
20963 sig_size=`echo $sig_name | awk '{print NF}'`
20964 $rm -f signal signal.c signal.awk signal.lst signal_cmd
20966 : Check size of size
20968 case "$sizetype" in
20969 *_t) zzz="$sizetype" ;;
20970 *) zzz="filesize" ;;
20972 echo "Checking the size of $zzz..." >&4
20974 #include <sys/types.h>
20976 #$i_stdlib I_STDLIB
20978 #include <stdlib.h>
20981 printf("%d\n", (int)sizeof($sizetype));
20986 if eval $compile_ok; then
20990 echo "(I can't execute the test program--guessing $sizesize.)" >&4
20993 echo "Your $zzz size is $sizesize bytes."
20998 echo "(I can't compile the test program--guessing $sizesize.)" >&4
21002 : check for socklen_t
21004 echo "Checking to see if you have socklen_t..." >&4
21006 #include <sys/types.h>
21007 #$d_socket HAS_SOCKET
21009 #include <sys/socket.h>
21011 int main() { socklen_t x = 16; }
21014 if eval $compile; then
21016 echo "You have socklen_t."
21019 echo "You do not have socklen_t."
21020 case "$sizetype" in
21021 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
21028 : see if this is a socks.h system
21029 set socks.h i_socks
21032 : check for type of the size argument to socket calls
21033 case "$d_socket" in
21037 Checking to see what type is the last argument of accept().
21040 case "$d_socklen_t" in
21041 "$define") yyy="$yyy socklen_t"
21043 yyy="$yyy $sizetype int long unsigned"
21044 for xxx in $yyy; do
21045 case "$socksizetype" in
21046 '') try="$extern_C int accept(int, struct sockaddr *, $xxx *);"
21047 case "$usesocks" in
21049 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
21050 echo "Your system accepts '$xxx *' for the last argument of accept()."
21051 socksizetype="$xxx"
21054 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
21055 echo "Your system accepts '$xxx *' for the last argument of accept()."
21056 socksizetype="$xxx"
21063 : In case none of those worked, prompt the user.
21064 case "$socksizetype" in
21065 '') rp='What is the type for socket address structure sizes?'
21072 *) : no sockets, so pick relatively harmless default
21077 : see what type is used for signed size_t
21078 set ssize_t ssizetype int stdio.h sys/types.h
21083 #$i_stdlib I_STDLIB
21085 #include <stdlib.h>
21087 #include <sys/types.h>
21088 #define Size_t $sizetype
21089 #define SSize_t $dflt
21092 if (sizeof(Size_t) == sizeof(SSize_t))
21094 else if (sizeof(Size_t) == sizeof(int))
21103 if eval $compile_ok && $run ./try > /dev/null; then
21104 ssizetype=`$run ./try`
21105 echo "I'll be using $ssizetype for functions returning a byte count." >&4
21108 Help! I can't compile and run the ssize_t test program: please enlighten me!
21109 (This is probably a misconfiguration in your system or libraries, and
21110 you really ought to fix it. Still, I'll try anyway.)
21112 I need a type that is the same size as $sizetype, but is guaranteed to
21113 be signed. Common values are ssize_t, int and long.
21116 rp="What signed type is the same size as $sizetype?"
21122 : Check the size of st_ino
21124 $echo "Checking the size of st_ino..." >&4
21125 $cat > try.c <<EOCP
21126 #include <sys/stat.h>
21128 #$i_stdlib I_STDLIB
21130 #include <stdlib.h>
21134 printf("%d\n", (int)sizeof(st.st_ino));
21139 if eval $compile_ok; then
21143 $echo "(I can't execute the test program--guessing $st_ino_size.)" >&4
21145 *) st_ino_size=$val
21146 $echo "Your st_ino is $st_ino_size bytes long."
21151 $echo "(I can't compile the test program--guessing $st_ino_size.)" >&4
21155 : Check if st_ino is signed
21157 $echo "Checking the sign of st_ino..." >&4
21158 $cat > try.c <<EOCP
21159 #include <sys/stat.h>
21164 if (foo.st_ino < 0)
21171 if eval $compile; then
21175 $echo "(I can't execute the test program--guessing unsigned.)" >&4
21177 *) st_ino_sign=$val
21178 case "$st_ino_sign" in
21179 1) $echo "Your st_ino is unsigned." ;;
21180 -1) $echo "Your st_ino is signed." ;;
21186 $echo "(I can't compile the test program--guessing unsigned.)" >&4
21190 : see what type of char stdio uses.
21192 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
21193 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
21194 echo "Your stdio uses unsigned chars." >&4
21195 stdchar="unsigned char"
21197 echo "Your stdio uses signed chars." >&4
21202 : see what type uids are declared as in the kernel
21204 echo "Looking for the type for user ids returned by getuid()."
21205 set uid_t uidtype xxx stdio.h sys/types.h
21209 xxx=`./findhdr sys/user.h`
21210 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
21212 unsigned) dflt="$1 $2" ;;
21216 *) dflt="$uidtype";;
21219 uid_t) echo "uid_t found." ;;
21220 *) rp="What is the type for user ids returned by getuid()?"
21226 : Check size of UID
21229 *_t) zzz="$uidtype" ;;
21232 echo "Checking the size of $zzz..." >&4
21234 #include <sys/types.h>
21236 #$i_stdlib I_STDLIB
21238 #include <stdlib.h>
21241 printf("%d\n", (int)sizeof($uidtype));
21246 if eval $compile_ok; then
21250 echo "(I can't execute the test program--guessing $uidsize.)" >&4
21253 echo "Your $zzz is $uidsize bytes long."
21258 echo "(I can't compile the test program--guessing $uidsize.)" >&4
21261 : Check if UID is signed
21264 *_t) zzz="$uidtype" ;;
21267 echo "Checking the sign of $zzz..." >&4
21269 #include <sys/types.h>
21280 if eval $compile; then
21284 echo "(I can't execute the test program--guessing unsigned.)" >&4
21288 1) echo "Your $zzz is unsigned." ;;
21289 -1) echo "Your $zzz is signed." ;;
21295 echo "(I can't compile the test program--guessing unsigned.)" >&4
21299 : Check format string for UID
21301 $echo "Checking the format string to be used for uids..." >&4
21304 -1) if $test X"$uidsize" = X"$ivsize"; then
21305 uidformat="$ivdformat"
21307 if $test X"$uidsize" = X"$longsize"; then
21310 if $test X"$uidsize" = X"$intsize"; then
21313 if $test X"$uidsize" = X"$shortsize"; then
21320 *) if $test X"$uidsize" = X"$uvsize"; then
21321 uidformat="$uvuformat"
21323 if $test X"$uidsize" = X"$longsize"; then
21326 if $test X"$uidsize" = X"$intsize"; then
21329 if $test X"$uidsize" = X"$shortsize"; then
21338 : Check if site customization support was requested
21339 case "$usesitecustomize" in
21340 $define|true|[Yy]*)
21341 usesitecustomize="$define"
21344 usesitecustomize="$undef"
21348 : see if prototypes support variable argument declarations
21350 case "$prototype$i_stdarg" in
21352 echo "It appears we'll be able to prototype varargs functions." >&4
21356 echo "Too bad... We won't be using prototyped varargs functions..." >&4
21363 : determine compiler compiler
21372 if $test -f "$byacc$_exe"; then
21374 comp="byacc or $comp"
21376 if $test -f "$bison$_exe"; then
21377 comp="$comp or bison -y"
21379 rp="Which compiler compiler ($comp) shall I use?"
21388 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
21394 : see if this is a assert.h system
21395 set assert.h i_assert
21398 : see if this is a fp.h system
21402 : see if this is a fp_class.h system
21403 set fp_class.h i_fp_class
21406 : see if gdbm.h is available
21411 : see if gdbm_open exists
21412 set gdbm_open d_gdbm_open
21414 case "$d_gdbm_open" in
21417 echo "We won't be including <gdbm.h>"
21426 : see if this is a ieeefp.h system
21427 case "$i_ieeefp" in
21428 '' ) set ieeefp.h i_ieeefp
21433 : see if this is a libutil.h system
21434 set libutil.h i_libutil
21437 : see if mach cthreads are available
21438 if test "X$usethreads" = "X$define"; then
21439 set mach/cthreads.h i_machcthr
21442 i_machcthr="$undef"
21445 : see if this is a mntent.h system
21446 set mntent.h i_mntent
21449 : see if net/errno.h is available
21451 set net/errno.h val
21454 : Unfortunately, it causes problems on some systems. Arrgh.
21457 cat > try.c <<'EOM'
21460 #include <net/errno.h>
21466 if $cc $ccflags -c try.c >/dev/null 2>&1; then
21467 echo "We'll be including <net/errno.h>." >&4
21469 echo "We won't be including <net/errno.h>." >&4
21478 : see if netinet/tcp.h is available
21479 set netinet/tcp.h i_netinettcp
21482 : see if this is a poll.h system
21486 : see if this is a prot.h system
21490 : Preprocessor symbols
21492 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
21493 $cat <<'EOSH' > Cppsym.know
21494 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
21495 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
21496 alliant alpha am29000 AM29000 AMD64 amd64 amiga AMIGAOS AMIX
21497 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
21498 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
21499 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
21500 bull c cadmus clipper CMU COFF COMPILER_VERSION
21501 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
21502 CYGWIN DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
21503 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
21504 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
21506 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
21507 H3050R H3050RX hbullx20 hcx host_mips
21508 hp200 hp300 hp700 HP700 hp800 hp9000
21509 hp9000s200 hp9000s300 hp9000s400 hp9000s500
21510 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
21511 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
21512 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
21513 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
21514 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
21515 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
21516 LIBCATAMOUNT Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
21517 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
21518 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
21519 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
21520 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
21521 MATH_HAS_NO_SIDE_EFFECTS
21522 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
21523 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
21524 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
21525 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
21526 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
21527 NetBSD news1500 news1700 news1800 news1900 news3700
21528 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
21529 ns32016 ns32332 ns32k nsc32000
21530 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
21531 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
21532 pc532 pdp11 PGC PIC plexus PORTAR posix
21533 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
21534 POSIX_C_SOURCE POSIX_SOURCE POWER
21535 PROTOTYPES PWB pyr QNX QK_USER R3000 REENTRANT RES Rhapsody RISC6000
21536 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
21537 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
21538 sony sony_news sonyrisc sparc sparclite spectrum
21539 stardent stdc STDC_EXT stratos sun sun3 sun386
21540 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
21541 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
21542 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
21543 sysV68 sysV88 Tek4132 Tek4300 titan
21544 TM3200 TM5400 TM5600
21545 tower tower32 tower32_200 tower32_600 tower32_700
21546 tower32_800 tower32_850 tss
21547 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
21548 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
21549 unix UNIX95 UNIX99 unixpc unos
21550 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
21551 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
21552 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
21554 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms x86_64 xenix Xenix286
21555 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
21556 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
21559 # Maybe put other stuff here too.
21560 cat <<EOSH >>Cppsym.know
21563 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
21564 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
21565 $cat Cppsym.know > Cppsym.c
21566 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
21567 $rm -f Cppsym.a Cppsym.b Cppsym.c
21568 cat <<EOSH > Cppsym
21570 if $test \$# -gt 0; then
21571 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
21572 if $test -s Cppsym.got; then
21579 $tr " " "$trnl" | ./Cppsym.try
21585 cat <<EOSH > Cppsym.try
21587 cat <<'EOCP' > try.c
21590 #define STRINGIFY(a) "a"
21592 #if cpp_stuff == 42
21593 #define StGiFy(a) #a
21594 #define STRINGIFY(a) StGiFy(a)
21596 #if $cpp_stuff != 1 && $cpp_stuff != 42
21597 # include "Bletch: How does this C preprocessor stringify macros?"
21603 cat <<'EOSH' >> Cppsym.try
21605 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
21606 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
21607 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
21608 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
21610 echo 'return 0;}' >> try.c
21612 cat <<EOSH >> Cppsym.try
21614 case "$osname-$gccversion" in
21615 irix-) ccflags="\$ccflags -woff 1178" ;;
21616 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
21618 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
21620 chmod +x Cppsym.try
21621 $eunicefix Cppsym.try
21622 ./Cppsym < Cppsym.know > Cppsym.true
21623 : Add in any linux cpp "predefined macros":
21624 case "$osname::$gccversion" in
21625 *linux*::*.*|*gnukfreebsd*::*.*|gnu::*.*)
21627 rm -f $tHdrH'.h' $tHdrH
21629 if $cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
21630 sed 's/#define[\ \ ]*//;s/[\ \ ].*$//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
21631 if [ -s $tHdrH'_cppsym.real' ]; then
21632 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
21635 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
21638 : now check the C compiler for additional symbols
21639 postprocess_cc_v=''
21641 aix) postprocess_cc_v="|$tr , ' '" ;;
21648 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
21651 -D*) echo "\$i" | $sed 's/^-D//';;
21652 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
21657 postprocess_cc_v=''
21660 ./ccsym > ccsym1.raw
21661 if $test -s ccsym1.raw; then
21662 $sort ccsym1.raw | $uniq >ccsym.raw
21664 mv ccsym1.raw ccsym.raw
21667 $awk '/\=/ { print $0; next }
21668 { print $0"=1" }' ccsym.raw >ccsym.list
21669 $comm -13 Cppsym.true ccsym.list >ccsym.own
21670 $comm -12 Cppsym.true ccsym.list >ccsym.com
21671 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
21673 if $test -z ccsym.raw; then
21674 echo "Your C compiler doesn't seem to define any symbols!" >&4
21676 echo "However, your C preprocessor defines the following symbols:"
21679 cppsymbols=`$cat Cppsym.true`
21680 cppsymbols=`echo $cppsymbols`
21681 cppccsymbols="$cppsymbols"
21683 if $test -s ccsym.com; then
21684 echo "Your C compiler and pre-processor define these symbols:"
21685 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
21688 cppccsymbols=`$cat ccsym.com`
21689 cppccsymbols=`echo $cppccsymbols`
21690 $test "$silent" || sleep 1
21692 if $test -s ccsym.cpp; then
21693 $test "$also" && echo " "
21694 echo "Your C pre-processor ${also}defines the following symbols:"
21695 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
21697 cppsymbols=`$cat ccsym.cpp`
21698 cppsymbols=`echo $cppsymbols`
21699 $test "$silent" || sleep 1
21701 if $test -s ccsym.own; then
21702 $test "$also" && echo " "
21703 echo "Your C compiler ${also}defines the following cpp symbols:"
21704 $sed -e 's/\(..*\)=1/\1/' ccsym.own
21705 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
21706 ccsymbols=`$cat ccsym.own`
21707 ccsymbols=`echo $ccsymbols`
21708 $test "$silent" || sleep 1
21712 : see if this is a termio system
21716 if $test `./findhdr termios.h`; then
21717 set tcsetattr i_termios
21723 "$define") echo "You have POSIX termios.h... good!" >&4;;
21724 *) if ./Cppsym pyr; then
21725 case "`/bin/universe`" in
21726 ucb) if $test `./findhdr sgtty.h`; then
21728 echo "<sgtty.h> found." >&4
21730 echo "System is pyramid with BSD universe."
21731 ./warn "<sgtty.h> not found--you could have problems."
21733 *) if $test `./findhdr termio.h`; then
21735 echo "<termio.h> found." >&4
21737 echo "System is pyramid with USG universe."
21738 ./warn "<termio.h> not found--you could have problems."
21742 if $test `./findhdr termio.h`; then
21743 echo "<termio.h> found." >&4
21745 elif $test `./findhdr sgtty.h`; then
21746 echo "<sgtty.h> found." >&4
21749 ./warn "Neither <termio.h> nor <sgtty.h> found--cross fingers!"
21752 if $test `./findhdr sgtty.h`; then
21753 echo "<sgtty.h> found." >&4
21755 elif $test `./findhdr termio.h`; then
21756 echo "<termio.h> found." >&4
21759 ./warn "Neither <sgtty.h> nor <termio.h> found--cross fingers!"
21763 set i_termio; eval $setvar
21764 val=$val2; set i_sgtty; eval $setvar
21765 val=$val3; set i_termios; eval $setvar
21767 : see if stddef is available
21768 set stddef.h i_stddef
21771 : see if sys/access.h is available
21772 set sys/access.h i_sysaccess
21775 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
21776 set sys/filio.h i_sysfilio
21779 if $test `./findhdr sys/ioctl.h`; then
21781 echo '<sys/ioctl.h> found.' >&4
21784 if $test $i_sysfilio = "$define"; then
21785 echo '<sys/ioctl.h> NOT found.' >&4
21787 $test $i_sgtty = "$define" && xxx="sgtty.h"
21788 $test $i_termio = "$define" && xxx="termio.h"
21789 $test $i_termios = "$define" && xxx="termios.h"
21790 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
21796 : see if socket ioctl defs are in sys/sockio.h
21798 xxx=`./findhdr sys/sockio.h`
21799 if $test "$xxx"; then
21800 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
21802 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
21805 echo "No socket ioctls found in <sys/sockio.h>." >&4
21810 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
21816 : see if this is a syslog.h system
21817 set syslog.h i_syslog
21820 : see if this is a sys/mode.h system
21821 set sys/mode.h i_sysmode
21824 : see if there is a sys/poll.h file
21825 set sys/poll.h i_syspoll
21828 : see if sys/resource.h has to be included
21829 set sys/resource.h i_sysresrc
21832 : see if sys/security.h is available
21833 set sys/security.h i_syssecrt
21836 : see if this is a sys/statvfs.h system
21837 set sys/statvfs.h i_sysstatvfs
21840 : see if this is a sys/un.h system
21841 set sys/un.h i_sysun
21844 : see if this is a sys/utsname.h system
21845 set sys/utsname.h i_sysutsname
21848 : see if this is a syswait system
21849 set sys/wait.h i_syswait
21852 : see if this is a ustat.h system
21853 set ustat.h i_ustat
21856 : see if this is an utime system
21857 set utime.h i_utime
21860 : see if this is a vfork system
21863 set vfork.h i_vfork
21873 echo "Looking for extensions..." >&4
21874 : If we are using the old config.sh, known_extensions may contain
21875 : old or inaccurate or duplicate values.
21876 known_extensions=''
21877 nonxs_extensions=''
21878 : We do not use find because it might not be available.
21879 : We do not just use MANIFEST because the user may have dropped
21880 : some additional extensions into the source tree and expect them
21883 : Function to recursively find available extensions, ignoring DynaLoader
21884 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
21885 : In 5.10.1 and later, extensions are stored in directories
21886 : like File-Glob instead of the older File/Glob/.
21890 DynaLoader|dynaload) ;;
21892 this_ext=`echo $xxx | $sed -e s/-/\\\//g`;
21893 leaf=`echo $xxx | $sed -e s/.*-//`;
21894 if $test -d File; then
21895 if $test -f $xxx/$leaf.xs -o -f $xxx/$leaf.c; then
21896 known_extensions="$known_extensions $1$this_ext";
21897 elif $test -f $xxx/Makefile.PL; then
21898 nonxs_extensions="$nonxs_extensions $1$this_ext";
21900 if $test -d $xxx -a $# -lt 10; then
21903 eval $find_extensions;
21909 $ls -1 $xxx > $$.tmp;
21910 if $contains "\.xs$" $$.tmp > /dev/null 2>&1; then
21911 known_extensions="$known_extensions $this_ext";
21912 elif $contains "\.c$" $$.tmp > /dev/null 2>&1; then
21913 known_extensions="$known_extensions $this_ext";
21914 elif $test -d $xxx; then
21915 nonxs_extensions="$nonxs_extensions $this_ext";
21926 eval $find_extensions
21930 eval $find_extensions
21934 eval $find_extensions
21935 if $test -d File-Glob; then
21936 : All ext/ flattened
21938 # Special case: Add in modules that nest beyond the first level.
21939 # Currently threads/shared and Hash/Util/FieldHash, since they are
21940 # not picked up by the recursive find above (and adding in general
21941 # recursive finding breaks SDBM_File/sdbm).
21942 # A.D. 20011025 (SDBM), ajgough 20071008 (FieldHash)
21943 known_extensions="$known_extensions threads/shared Hash/Util/FieldHash"
21945 set X $known_extensions
21947 known_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
21948 set X $nonxs_extensions
21950 nonxs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
21953 : Now see which are supported on this system.
21955 for xxx in $known_extensions ; do
21959 $define) avail_ext="$avail_ext $xxx" ;;
21962 GDBM_File|gdbm_fil)
21964 $define) avail_ext="$avail_ext $xxx" ;;
21967 I18N/Langinfo|i18n_lan)
21968 case "$i_langinfo$d_nl_langinfo" in
21969 $define$define) avail_ext="$avail_ext $xxx" ;;
21973 : XXX Do we need a useipcsysv variable here
21974 case "${d_msg}${d_sem}${d_shm}" in
21975 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
21978 NDBM_File|ndbm_fil)
21981 case "$osname-$use64bitint" in
21984 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
21987 *) avail_ext="$avail_ext $xxx" ;;
21992 ODBM_File|odbm_fil)
21993 case "${i_dbm}${i_rpcsvcdbm}" in
21995 case "$d_cplusplus" in
21996 define) ;; # delete as a function name will not work
21997 *) case "$osname-$use64bitint" in
22000 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
22003 *) avail_ext="$avail_ext $xxx" ;;
22011 case "$useopcode" in
22012 true|define|y) avail_ext="$avail_ext $xxx" ;;
22016 case "$useposix" in
22017 true|define|y) avail_ext="$avail_ext $xxx" ;;
22021 case "$d_socket" in
22024 beos) ;; # not unless BONE
22025 *) avail_ext="$avail_ext $xxx" ;;
22030 Sys/Syslog|sys/syslog)
22031 : XXX syslog requires socket
22032 case "$d_socket" in
22033 true|$define|y) avail_ext="$avail_ext $xxx" ;;
22037 case "$usethreads" in
22039 case "$use5005threads" in
22040 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
22044 threads|threads/shared)
22045 # threads and threads::shared are special cases.
22046 # To stop people from asking "Perl 5.8.0 was supposed
22047 # to have this new fancy threads implementation but my
22048 # perl doesn't have it" and from people trying to
22049 # (re)install the threads module using CPAN.pm and
22050 # CPAN.pm then offering to reinstall Perl 5.8.0,
22051 # the threads.pm and threads/shared.pm will always be
22052 # there, croaking informatively ("you need to rebuild
22053 # all of Perl with threads, sorry") when threads haven't
22054 # been compiled in.
22056 avail_ext="$avail_ext $xxx"
22062 cygwin) avail_ext="$avail_ext $xxx" ;;
22065 XS/APItest|xs/apitest)
22066 # This is just for testing. Skip it unless we have dynamic loading.
22069 $define) avail_ext="$avail_ext $xxx" ;;
22072 XS/Typemap|xs/typemap)
22073 # This is just for testing. Skip it unless we have dynamic loading.
22075 $define) avail_ext="$avail_ext $xxx" ;;
22078 *) avail_ext="$avail_ext $xxx"
22087 case "$onlyextensions" in
22089 *) keepextensions=''
22090 echo "You have requested that only certain extensions be included..." >&4
22091 for i in $onlyextensions; do
22092 case " $avail_ext " in
22094 echo "Keeping extension $i."
22095 keepextensions="$keepextensions $i"
22097 *) echo "Ignoring extension $i." ;;
22100 avail_ext="$keepextensions"
22104 case "$noextensions" in
22106 *) keepextensions=''
22107 echo "You have requested that certain extensions be ignored..." >&4
22108 for i in $avail_ext; do
22109 case " $noextensions " in
22110 *" $i "*) echo "Ignoring extension $i." ;;
22111 *) echo "Keeping extension $i.";
22112 keepextensions="$keepextensions $i"
22116 avail_ext="$keepextensions"
22120 : Now see which nonxs extensions are supported on this system.
22121 : For now assume all are.
22123 for xxx in $nonxs_extensions ; do
22125 *) nonxs_ext="$nonxs_ext $xxx"
22137 A number of extensions are supplied with $package. You may choose to
22138 compile these extensions for dynamic loading (the default), compile
22139 them into the $package executable (static loading), or not include
22140 them at all. Answer "none" to include no extensions.
22141 Note that DynaLoader is always built and need not be mentioned here.
22144 case "$dynamic_ext" in
22146 : Exclude those listed in static_ext
22148 for xxx in $avail_ext; do
22149 case " $static_ext " in
22151 *) dflt="$dflt $xxx" ;;
22158 *) dflt="$dynamic_ext"
22159 # Perhaps we are reusing an old out-of-date config.sh.
22162 if test X"$dynamic_ext" != X"$avail_ext"; then
22164 NOTICE: Your previous config.sh list may be incorrect.
22165 The extensions now available to you are
22167 but the default list from your previous config.sh is
22179 rp="What extensions do you wish to load dynamically?"
22182 none) dynamic_ext=' ' ;;
22183 *) dynamic_ext="$ans" ;;
22186 case "$static_ext" in
22188 : Exclude those already listed in dynamic linking
22190 for xxx in $avail_ext; do
22191 case " $dynamic_ext " in
22193 *) dflt="$dflt $xxx" ;;
22200 *) dflt="$static_ext"
22207 rp="What extensions do you wish to load statically?"
22210 none) static_ext=' ' ;;
22211 *) static_ext="$ans" ;;
22216 A number of extensions are supplied with $package. Answer "none"
22217 to include no extensions.
22218 Note that DynaLoader is always built and need not be mentioned here.
22221 case "$static_ext" in
22222 '') dflt="$avail_ext" ;;
22223 *) dflt="$static_ext"
22224 # Perhaps we are reusing an old out-of-date config.sh.
22227 if test X"$static_ext" != X"$avail_ext"; then
22229 NOTICE: Your previous config.sh list may be incorrect.
22230 The extensions now available to you are
22232 but the default list from your previous config.sh is
22241 : Exclude those that are not xs extensions
22245 rp="What extensions do you wish to include?"
22248 none) static_ext=' ' ;;
22249 *) static_ext="$ans" ;;
22254 # Encode is a special case. If we are building Encode as a static
22255 # extension, we need to explicitly list its subextensions as well.
22256 # For other nested extensions, this is handled automatically by
22257 # the appropriate Makefile.PL.
22258 case " $static_ext " in
22259 *" Encode "*) # Add the subextensions of Encode
22261 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
22262 static_ext="$static_ext Encode/$xxx"
22268 set X $dynamic_ext $static_ext $nonxs_ext
22272 # Sanity check: We require an extension suitable for use with
22273 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
22274 # should show up as failures in the test suite, but it's helpful to
22275 # catch them now.) The 'extensions' list is normally sorted
22276 # alphabetically, so we need to accept either
22277 # DB_File ... Fcntl ... IO ....
22278 # or something like
22279 # Fcntl ... NDBM_File ... IO ....
22280 case " $extensions" in
22281 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
22282 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
22283 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
22284 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
22285 echo "WARNING: The Perl you are building will be quite crippled." >& 4
22289 : Remove libraries needed only for extensions
22290 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
22291 : The exception is SunOS 4.x, which needs them.
22292 case "${osname}X${osvers}" in
22296 *) case "$usedl" in
22297 $define|true|[yY]*)
22298 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
22302 *) perllibs="$libs"
22308 : Remove build directory name from cppstdin so it can be used from
22309 : either the present location or the final installed location.
22311 : Get out of the UU directory to get correct path name.
22313 case "$cppstdin" in
22315 echo "Stripping down cppstdin path name"
22321 : end of configuration questions
22323 echo "End of configuration questions."
22326 : back to where it started
22327 if test -d ../UU; then
22331 : configuration may be unconditionally patched via a 'config.arch' file
22332 if $test -f config.arch; then
22333 echo "I see a config.arch file, loading it." >&4
22337 : configuration may be patched via a 'config.over' file
22338 if $test -f config.over; then
22341 rp='I see a config.over file. Do you wish to load it?'
22344 n*) echo "OK, I'll ignore it.";;
22346 echo "Configuration override changes have been loaded."
22351 : in case they want portability, strip down executable paths
22352 case "$d_portable" in
22355 echo "Stripping down executable paths..." >&4
22356 for file in $loclist $trylist; do
22358 eval $file=`basename $temp`
22363 : create config.sh file
22365 echo "Creating config.sh..." >&4
22366 $spitshell <<EOT >config.sh
22369 # This file was produced by running the Configure script. It holds all the
22370 # definitions figured out by Configure. Should you modify one of these values,
22371 # do not forget to propagate your changes by running "Configure -der". You may
22372 # instead choose to run each of the .SH files by yourself, or "Configure -S".
22375 # Package name : $package
22376 # Source directory : $src
22377 # Configuration time: $cf_time
22378 # Configured by : $cf_by
22379 # Target system : $myuname
22382 : Add in command line options if available
22383 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
22385 $spitshell <<EOT >>config.sh
22394 Revision='$Revision'
22402 alignbytes='$alignbytes'
22403 ansi2knr='$ansi2knr'
22404 aphostname='$aphostname'
22405 api_revision='$api_revision'
22406 api_subversion='$api_subversion'
22407 api_version='$api_version'
22408 api_versionstring='$api_versionstring'
22411 archlibexp='$archlibexp'
22412 archname64='$archname64'
22413 archname='$archname'
22414 archobjs='$archobjs'
22415 asctime_r_proto='$asctime_r_proto'
22424 byteorder='$byteorder'
22426 castflags='$castflags'
22429 cccdlflags='$cccdlflags'
22430 ccdlflags='$ccdlflags'
22432 ccflags_uselargefiles='$ccflags_uselargefiles'
22434 ccsymbols='$ccsymbols'
22435 ccversion='$ccversion'
22437 cf_email='$cf_email'
22439 charbits='$charbits'
22440 charsize='$charsize'
22444 clocktype='$clocktype'
22446 compress='$compress'
22447 contains='$contains'
22451 cpp_stuff='$cpp_stuff'
22452 cppccsymbols='$cppccsymbols'
22453 cppflags='$cppflags'
22455 cppminus='$cppminus'
22457 cppstdin='$cppstdin'
22458 cppsymbols='$cppsymbols'
22459 crypt_r_proto='$crypt_r_proto'
22460 cryptlib='$cryptlib'
22462 ctermid_r_proto='$ctermid_r_proto'
22463 ctime_r_proto='$ctime_r_proto'
22464 d_Gconvert='$d_Gconvert'
22465 d_PRIEUldbl='$d_PRIEUldbl'
22466 d_PRIFUldbl='$d_PRIFUldbl'
22467 d_PRIGUldbl='$d_PRIGUldbl'
22468 d_PRIXU64='$d_PRIXU64'
22469 d_PRId64='$d_PRId64'
22470 d_PRIeldbl='$d_PRIeldbl'
22471 d_PRIfldbl='$d_PRIfldbl'
22472 d_PRIgldbl='$d_PRIgldbl'
22473 d_PRIi64='$d_PRIi64'
22474 d_PRIo64='$d_PRIo64'
22475 d_PRIu64='$d_PRIu64'
22476 d_PRIx64='$d_PRIx64'
22477 d_SCNfldbl='$d_SCNfldbl'
22478 d__fwalk='$d__fwalk'
22479 d_access='$d_access'
22480 d_accessx='$d_accessx'
22483 d_archlib='$d_archlib'
22484 d_asctime64='$d_asctime64'
22485 d_asctime_r='$d_asctime_r'
22488 d_attribute_deprecated='$d_attribute_deprecated'
22489 d_attribute_format='$d_attribute_format'
22490 d_attribute_malloc='$d_attribute_malloc'
22491 d_attribute_nonnull='$d_attribute_nonnull'
22492 d_attribute_noreturn='$d_attribute_noreturn'
22493 d_attribute_pure='$d_attribute_pure'
22494 d_attribute_unused='$d_attribute_unused'
22495 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
22499 d_bsdgetpgrp='$d_bsdgetpgrp'
22500 d_bsdsetpgrp='$d_bsdsetpgrp'
22501 d_builtin_choose_expr='$d_builtin_choose_expr'
22502 d_builtin_expect='$d_builtin_expect'
22504 d_c99_variadic_macros='$d_c99_variadic_macros'
22505 d_casti32='$d_casti32'
22506 d_castneg='$d_castneg'
22507 d_charvspr='$d_charvspr'
22509 d_chroot='$d_chroot'
22510 d_chsize='$d_chsize'
22512 d_clearenv='$d_clearenv'
22513 d_closedir='$d_closedir'
22514 d_cmsghdr_s='$d_cmsghdr_s'
22516 d_copysignl='$d_copysignl'
22517 d_cplusplus='$d_cplusplus'
22519 d_crypt_r='$d_crypt_r'
22521 d_ctermid='$d_ctermid'
22522 d_ctermid_r='$d_ctermid_r'
22523 d_ctime64='$d_ctime64'
22524 d_ctime_r='$d_ctime_r'
22525 d_cuserid='$d_cuserid'
22526 d_dbl_dig='$d_dbl_dig'
22527 d_dbminitproto='$d_dbminitproto'
22528 d_difftime64='$d_difftime64'
22529 d_difftime='$d_difftime'
22530 d_dir_dd_fd='$d_dir_dd_fd'
22532 d_dirnamlen='$d_dirnamlen'
22533 d_dlerror='$d_dlerror'
22534 d_dlopen='$d_dlopen'
22535 d_dlsymun='$d_dlsymun'
22536 d_dosuid='$d_dosuid'
22537 d_drand48_r='$d_drand48_r'
22538 d_drand48proto='$d_drand48proto'
22540 d_eaccess='$d_eaccess'
22541 d_endgrent='$d_endgrent'
22542 d_endgrent_r='$d_endgrent_r'
22543 d_endhent='$d_endhent'
22544 d_endhostent_r='$d_endhostent_r'
22545 d_endnent='$d_endnent'
22546 d_endnetent_r='$d_endnetent_r'
22547 d_endpent='$d_endpent'
22548 d_endprotoent_r='$d_endprotoent_r'
22549 d_endpwent='$d_endpwent'
22550 d_endpwent_r='$d_endpwent_r'
22551 d_endsent='$d_endsent'
22552 d_endservent_r='$d_endservent_r'
22553 d_eofnblk='$d_eofnblk'
22554 d_eunice='$d_eunice'
22555 d_faststdio='$d_faststdio'
22556 d_fchdir='$d_fchdir'
22557 d_fchmod='$d_fchmod'
22558 d_fchown='$d_fchown'
22560 d_fcntl_can_lock='$d_fcntl_can_lock'
22561 d_fd_macros='$d_fd_macros'
22562 d_fd_set='$d_fd_set'
22563 d_fds_bits='$d_fds_bits'
22564 d_fgetpos='$d_fgetpos'
22565 d_finite='$d_finite'
22566 d_finitel='$d_finitel'
22567 d_flexfnam='$d_flexfnam'
22569 d_flockproto='$d_flockproto'
22571 d_fp_class='$d_fp_class'
22572 d_fpathconf='$d_fpathconf'
22573 d_fpclass='$d_fpclass'
22574 d_fpclassify='$d_fpclassify'
22575 d_fpclassl='$d_fpclassl'
22576 d_fpos64_t='$d_fpos64_t'
22577 d_frexpl='$d_frexpl'
22578 d_fs_data_s='$d_fs_data_s'
22579 d_fseeko='$d_fseeko'
22580 d_fsetpos='$d_fsetpos'
22581 d_fstatfs='$d_fstatfs'
22582 d_fstatvfs='$d_fstatvfs'
22584 d_ftello='$d_ftello'
22586 d_futimes='$d_futimes'
22587 d_gdbm_ndbm_h_uses_prototypes='$d_gdbm_ndbm_h_uses_prototypes'
22588 d_gdbmndbm_h_uses_prototypes='$d_gdbmndbm_h_uses_prototypes'
22589 d_getaddrinfo='$d_getaddrinfo'
22590 d_getcwd='$d_getcwd'
22591 d_getespwnam='$d_getespwnam'
22592 d_getfsstat='$d_getfsstat'
22593 d_getgrent='$d_getgrent'
22594 d_getgrent_r='$d_getgrent_r'
22595 d_getgrgid_r='$d_getgrgid_r'
22596 d_getgrnam_r='$d_getgrnam_r'
22597 d_getgrps='$d_getgrps'
22598 d_gethbyaddr='$d_gethbyaddr'
22599 d_gethbyname='$d_gethbyname'
22600 d_gethent='$d_gethent'
22601 d_gethname='$d_gethname'
22602 d_gethostbyaddr_r='$d_gethostbyaddr_r'
22603 d_gethostbyname_r='$d_gethostbyname_r'
22604 d_gethostent_r='$d_gethostent_r'
22605 d_gethostprotos='$d_gethostprotos'
22606 d_getitimer='$d_getitimer'
22607 d_getlogin='$d_getlogin'
22608 d_getlogin_r='$d_getlogin_r'
22609 d_getmnt='$d_getmnt'
22610 d_getmntent='$d_getmntent'
22611 d_getnameinfo='$d_getnameinfo'
22612 d_getnbyaddr='$d_getnbyaddr'
22613 d_getnbyname='$d_getnbyname'
22614 d_getnent='$d_getnent'
22615 d_getnetbyaddr_r='$d_getnetbyaddr_r'
22616 d_getnetbyname_r='$d_getnetbyname_r'
22617 d_getnetent_r='$d_getnetent_r'
22618 d_getnetprotos='$d_getnetprotos'
22619 d_getpagsz='$d_getpagsz'
22620 d_getpbyname='$d_getpbyname'
22621 d_getpbynumber='$d_getpbynumber'
22622 d_getpent='$d_getpent'
22623 d_getpgid='$d_getpgid'
22624 d_getpgrp2='$d_getpgrp2'
22625 d_getpgrp='$d_getpgrp'
22626 d_getppid='$d_getppid'
22627 d_getprior='$d_getprior'
22628 d_getprotobyname_r='$d_getprotobyname_r'
22629 d_getprotobynumber_r='$d_getprotobynumber_r'
22630 d_getprotoent_r='$d_getprotoent_r'
22631 d_getprotoprotos='$d_getprotoprotos'
22632 d_getprpwnam='$d_getprpwnam'
22633 d_getpwent='$d_getpwent'
22634 d_getpwent_r='$d_getpwent_r'
22635 d_getpwnam_r='$d_getpwnam_r'
22636 d_getpwuid_r='$d_getpwuid_r'
22637 d_getsbyname='$d_getsbyname'
22638 d_getsbyport='$d_getsbyport'
22639 d_getsent='$d_getsent'
22640 d_getservbyname_r='$d_getservbyname_r'
22641 d_getservbyport_r='$d_getservbyport_r'
22642 d_getservent_r='$d_getservent_r'
22643 d_getservprotos='$d_getservprotos'
22644 d_getspnam='$d_getspnam'
22645 d_getspnam_r='$d_getspnam_r'
22646 d_gettimeod='$d_gettimeod'
22647 d_gmtime64='$d_gmtime64'
22648 d_gmtime_r='$d_gmtime_r'
22649 d_gnulibc='$d_gnulibc'
22650 d_grpasswd='$d_grpasswd'
22651 d_hasmntopt='$d_hasmntopt'
22653 d_ilogbl='$d_ilogbl'
22654 d_inc_version_list='$d_inc_version_list'
22656 d_inetaton='$d_inetaton'
22657 d_inetntop='$d_inetntop'
22658 d_inetpton='$d_inetpton'
22659 d_int64_t='$d_int64_t'
22660 d_isascii='$d_isascii'
22661 d_isfinite='$d_isfinite'
22664 d_isnanl='$d_isnanl'
22665 d_killpg='$d_killpg'
22666 d_lchown='$d_lchown'
22667 d_ldbl_dig='$d_ldbl_dig'
22668 d_libm_lib_version='$d_libm_lib_version'
22670 d_localtime64='$d_localtime64'
22671 d_localtime_r='$d_localtime_r'
22672 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
22673 d_locconv='$d_locconv'
22675 d_longdbl='$d_longdbl'
22676 d_longlong='$d_longlong'
22677 d_lseekproto='$d_lseekproto'
22679 d_madvise='$d_madvise'
22680 d_malloc_good_size='$d_malloc_good_size'
22681 d_malloc_size='$d_malloc_size'
22683 d_mbstowcs='$d_mbstowcs'
22684 d_mbtowc='$d_mbtowc'
22685 d_memchr='$d_memchr'
22686 d_memcmp='$d_memcmp'
22687 d_memcpy='$d_memcpy'
22688 d_memmove='$d_memmove'
22689 d_memset='$d_memset'
22691 d_mkdtemp='$d_mkdtemp'
22692 d_mkfifo='$d_mkfifo'
22693 d_mkstemp='$d_mkstemp'
22694 d_mkstemps='$d_mkstemps'
22695 d_mktime64='$d_mktime64'
22696 d_mktime='$d_mktime'
22699 d_modfl_pow32_bug='$d_modfl_pow32_bug'
22700 d_modflproto='$d_modflproto'
22701 d_mprotect='$d_mprotect'
22703 d_msg_ctrunc='$d_msg_ctrunc'
22704 d_msg_dontroute='$d_msg_dontroute'
22705 d_msg_oob='$d_msg_oob'
22706 d_msg_peek='$d_msg_peek'
22707 d_msg_proxy='$d_msg_proxy'
22708 d_msgctl='$d_msgctl'
22709 d_msgget='$d_msgget'
22710 d_msghdr_s='$d_msghdr_s'
22711 d_msgrcv='$d_msgrcv'
22712 d_msgsnd='$d_msgsnd'
22714 d_munmap='$d_munmap'
22715 d_mymalloc='$d_mymalloc'
22717 d_ndbm_h_uses_prototypes='$d_ndbm_h_uses_prototypes'
22719 d_nl_langinfo='$d_nl_langinfo'
22720 d_nv_preserves_uv='$d_nv_preserves_uv'
22721 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
22722 d_off64_t='$d_off64_t'
22723 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
22724 d_oldpthreads='$d_oldpthreads'
22725 d_oldsock='$d_oldsock'
22727 d_pathconf='$d_pathconf'
22729 d_perl_otherlibdirs='$d_perl_otherlibdirs'
22730 d_phostname='$d_phostname'
22733 d_portable='$d_portable'
22735 d_prctl_set_name='$d_prctl_set_name'
22736 d_printf_format_null='$d_printf_format_null'
22737 d_procselfexe='$d_procselfexe'
22738 d_pseudofork='$d_pseudofork'
22739 d_pthread_atfork='$d_pthread_atfork'
22740 d_pthread_attr_setscope='$d_pthread_attr_setscope'
22741 d_pthread_yield='$d_pthread_yield'
22743 d_pwchange='$d_pwchange'
22744 d_pwclass='$d_pwclass'
22745 d_pwcomment='$d_pwcomment'
22746 d_pwexpire='$d_pwexpire'
22747 d_pwgecos='$d_pwgecos'
22748 d_pwpasswd='$d_pwpasswd'
22749 d_pwquota='$d_pwquota'
22752 d_random_r='$d_random_r'
22753 d_readdir64_r='$d_readdir64_r'
22754 d_readdir='$d_readdir'
22755 d_readdir_r='$d_readdir_r'
22756 d_readlink='$d_readlink'
22758 d_recvmsg='$d_recvmsg'
22759 d_rename='$d_rename'
22760 d_rewinddir='$d_rewinddir'
22762 d_safebcpy='$d_safebcpy'
22763 d_safemcpy='$d_safemcpy'
22764 d_sanemcmp='$d_sanemcmp'
22765 d_sbrkproto='$d_sbrkproto'
22766 d_scalbnl='$d_scalbnl'
22767 d_sched_yield='$d_sched_yield'
22768 d_scm_rights='$d_scm_rights'
22769 d_seekdir='$d_seekdir'
22770 d_select='$d_select'
22772 d_semctl='$d_semctl'
22773 d_semctl_semid_ds='$d_semctl_semid_ds'
22774 d_semctl_semun='$d_semctl_semun'
22775 d_semget='$d_semget'
22777 d_sendmsg='$d_sendmsg'
22778 d_setegid='$d_setegid'
22779 d_seteuid='$d_seteuid'
22780 d_setgrent='$d_setgrent'
22781 d_setgrent_r='$d_setgrent_r'
22782 d_setgrps='$d_setgrps'
22783 d_sethent='$d_sethent'
22784 d_sethostent_r='$d_sethostent_r'
22785 d_setitimer='$d_setitimer'
22786 d_setlinebuf='$d_setlinebuf'
22787 d_setlocale='$d_setlocale'
22788 d_setlocale_r='$d_setlocale_r'
22789 d_setnent='$d_setnent'
22790 d_setnetent_r='$d_setnetent_r'
22791 d_setpent='$d_setpent'
22792 d_setpgid='$d_setpgid'
22793 d_setpgrp2='$d_setpgrp2'
22794 d_setpgrp='$d_setpgrp'
22795 d_setprior='$d_setprior'
22796 d_setproctitle='$d_setproctitle'
22797 d_setprotoent_r='$d_setprotoent_r'
22798 d_setpwent='$d_setpwent'
22799 d_setpwent_r='$d_setpwent_r'
22800 d_setregid='$d_setregid'
22801 d_setresgid='$d_setresgid'
22802 d_setresuid='$d_setresuid'
22803 d_setreuid='$d_setreuid'
22804 d_setrgid='$d_setrgid'
22805 d_setruid='$d_setruid'
22806 d_setsent='$d_setsent'
22807 d_setservent_r='$d_setservent_r'
22808 d_setsid='$d_setsid'
22809 d_setvbuf='$d_setvbuf'
22813 d_shmatprototype='$d_shmatprototype'
22814 d_shmctl='$d_shmctl'
22816 d_shmget='$d_shmget'
22817 d_sigaction='$d_sigaction'
22818 d_signbit='$d_signbit'
22819 d_sigprocmask='$d_sigprocmask'
22820 d_sigsetjmp='$d_sigsetjmp'
22821 d_sin6_scope_id='$d_sin6_scope_id'
22822 d_sitearch='$d_sitearch'
22823 d_snprintf='$d_snprintf'
22824 d_sockaddr_sa_len='$d_sockaddr_sa_len'
22825 d_sockatmark='$d_sockatmark'
22826 d_sockatmarkproto='$d_sockatmarkproto'
22827 d_socket='$d_socket'
22828 d_socklen_t='$d_socklen_t'
22829 d_sockpair='$d_sockpair'
22830 d_socks5_init='$d_socks5_init'
22831 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
22833 d_srand48_r='$d_srand48_r'
22834 d_srandom_r='$d_srandom_r'
22835 d_sresgproto='$d_sresgproto'
22836 d_sresuproto='$d_sresuproto'
22837 d_statblks='$d_statblks'
22838 d_statfs_f_flags='$d_statfs_f_flags'
22839 d_statfs_s='$d_statfs_s'
22840 d_static_inline='$d_static_inline'
22841 d_statvfs='$d_statvfs'
22842 d_stdio_cnt_lval='$d_stdio_cnt_lval'
22843 d_stdio_ptr_lval='$d_stdio_ptr_lval'
22844 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
22845 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
22846 d_stdio_stream_array='$d_stdio_stream_array'
22847 d_stdiobase='$d_stdiobase'
22848 d_stdstdio='$d_stdstdio'
22849 d_strchr='$d_strchr'
22850 d_strcoll='$d_strcoll'
22851 d_strctcpy='$d_strctcpy'
22852 d_strerrm='$d_strerrm'
22853 d_strerror='$d_strerror'
22854 d_strerror_r='$d_strerror_r'
22855 d_strftime='$d_strftime'
22856 d_strlcat='$d_strlcat'
22857 d_strlcpy='$d_strlcpy'
22858 d_strtod='$d_strtod'
22859 d_strtol='$d_strtol'
22860 d_strtold='$d_strtold'
22861 d_strtoll='$d_strtoll'
22862 d_strtoq='$d_strtoq'
22863 d_strtoul='$d_strtoul'
22864 d_strtoull='$d_strtoull'
22865 d_strtouq='$d_strtouq'
22866 d_strxfrm='$d_strxfrm'
22867 d_suidsafe='$d_suidsafe'
22868 d_symlink='$d_symlink'
22869 d_syscall='$d_syscall'
22870 d_syscallproto='$d_syscallproto'
22871 d_sysconf='$d_sysconf'
22872 d_sysernlst='$d_sysernlst'
22873 d_syserrlst='$d_syserrlst'
22874 d_system='$d_system'
22875 d_tcgetpgrp='$d_tcgetpgrp'
22876 d_tcsetpgrp='$d_tcsetpgrp'
22877 d_telldir='$d_telldir'
22878 d_telldirproto='$d_telldirproto'
22880 d_timegm='$d_timegm'
22882 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
22883 d_tm_tm_zone='$d_tm_tm_zone'
22884 d_tmpnam_r='$d_tmpnam_r'
22885 d_truncate='$d_truncate'
22886 d_ttyname_r='$d_ttyname_r'
22887 d_tzname='$d_tzname'
22888 d_u32align='$d_u32align'
22889 d_ualarm='$d_ualarm'
22892 d_union_semun='$d_union_semun'
22893 d_unordered='$d_unordered'
22894 d_unsetenv='$d_unsetenv'
22895 d_usleep='$d_usleep'
22896 d_usleepproto='$d_usleepproto'
22898 d_vendorarch='$d_vendorarch'
22899 d_vendorbin='$d_vendorbin'
22900 d_vendorlib='$d_vendorlib'
22901 d_vendorscript='$d_vendorscript'
22903 d_void_closedir='$d_void_closedir'
22904 d_voidsig='$d_voidsig'
22905 d_voidtty='$d_voidtty'
22906 d_volatile='$d_volatile'
22907 d_vprintf='$d_vprintf'
22908 d_vsnprintf='$d_vsnprintf'
22910 d_waitpid='$d_waitpid'
22911 d_wcstombs='$d_wcstombs'
22912 d_wctomb='$d_wctomb'
22913 d_writev='$d_writev'
22916 db_hashtype='$db_hashtype'
22917 db_prefixtype='$db_prefixtype'
22918 db_version_major='$db_version_major'
22919 db_version_minor='$db_version_minor'
22920 db_version_patch='$db_version_patch'
22921 defvoidused='$defvoidused'
22922 direntrytype='$direntrytype'
22925 doublesize='$doublesize'
22927 drand48_r_proto='$drand48_r_proto'
22929 dynamic_ext='$dynamic_ext'
22935 endgrent_r_proto='$endgrent_r_proto'
22936 endhostent_r_proto='$endhostent_r_proto'
22937 endnetent_r_proto='$endnetent_r_proto'
22938 endprotoent_r_proto='$endprotoent_r_proto'
22939 endpwent_r_proto='$endpwent_r_proto'
22940 endservent_r_proto='$endservent_r_proto'
22941 eunicefix='$eunicefix'
22944 extensions='$extensions'
22945 extern_C='$extern_C'
22947 fflushNULL='$fflushNULL'
22948 fflushall='$fflushall'
22950 firstmakefile='$firstmakefile'
22952 fpossize='$fpossize'
22953 fpostype='$fpostype'
22954 freetype='$freetype'
22957 full_csh='$full_csh'
22958 full_sed='$full_sed'
22959 gccansipedantic='$gccansipedantic'
22960 gccosandvers='$gccosandvers'
22961 gccversion='$gccversion'
22962 getgrent_r_proto='$getgrent_r_proto'
22963 getgrgid_r_proto='$getgrgid_r_proto'
22964 getgrnam_r_proto='$getgrnam_r_proto'
22965 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
22966 gethostbyname_r_proto='$gethostbyname_r_proto'
22967 gethostent_r_proto='$gethostent_r_proto'
22968 getlogin_r_proto='$getlogin_r_proto'
22969 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
22970 getnetbyname_r_proto='$getnetbyname_r_proto'
22971 getnetent_r_proto='$getnetent_r_proto'
22972 getprotobyname_r_proto='$getprotobyname_r_proto'
22973 getprotobynumber_r_proto='$getprotobynumber_r_proto'
22974 getprotoent_r_proto='$getprotoent_r_proto'
22975 getpwent_r_proto='$getpwent_r_proto'
22976 getpwnam_r_proto='$getpwnam_r_proto'
22977 getpwuid_r_proto='$getpwuid_r_proto'
22978 getservbyname_r_proto='$getservbyname_r_proto'
22979 getservbyport_r_proto='$getservbyport_r_proto'
22980 getservent_r_proto='$getservent_r_proto'
22981 getspnam_r_proto='$getspnam_r_proto'
22982 gidformat='$gidformat'
22988 gmtime_r_proto='$gmtime_r_proto'
22989 gnulibc_version='$gnulibc_version'
22991 groupcat='$groupcat'
22992 groupstype='$groupstype'
22995 h_sysfile='$h_sysfile'
22998 html1dir='$html1dir'
22999 html1direxp='$html1direxp'
23000 html3dir='$html3dir'
23001 html3direxp='$html3direxp'
23010 i_arpainet='$i_arpainet'
23011 i_assert='$i_assert'
23012 i_bsdioctl='$i_bsdioctl'
23016 i_dirent='$i_dirent'
23022 i_fp_class='$i_fp_class'
23024 i_gdbm_ndbm='$i_gdbm_ndbm'
23025 i_gdbmndbm='$i_gdbmndbm'
23027 i_ieeefp='$i_ieeefp'
23028 i_inttypes='$i_inttypes'
23029 i_langinfo='$i_langinfo'
23030 i_libutil='$i_libutil'
23031 i_limits='$i_limits'
23032 i_locale='$i_locale'
23033 i_machcthr='$i_machcthr'
23034 i_malloc='$i_malloc'
23035 i_mallocmalloc='$i_mallocmalloc'
23037 i_memory='$i_memory'
23038 i_mntent='$i_mntent'
23041 i_neterrno='$i_neterrno'
23042 i_netinettcp='$i_netinettcp'
23046 i_pthread='$i_pthread'
23048 i_rpcsvcdbm='$i_rpcsvcdbm'
23051 i_shadow='$i_shadow'
23053 i_stdarg='$i_stdarg'
23054 i_stddef='$i_stddef'
23055 i_stdlib='$i_stdlib'
23056 i_string='$i_string'
23057 i_sunmath='$i_sunmath'
23058 i_sysaccess='$i_sysaccess'
23059 i_sysdir='$i_sysdir'
23060 i_sysfile='$i_sysfile'
23061 i_sysfilio='$i_sysfilio'
23063 i_sysioctl='$i_sysioctl'
23064 i_syslog='$i_syslog'
23065 i_sysmman='$i_sysmman'
23066 i_sysmode='$i_sysmode'
23067 i_sysmount='$i_sysmount'
23068 i_sysndir='$i_sysndir'
23069 i_sysparam='$i_sysparam'
23070 i_syspoll='$i_syspoll'
23071 i_sysresrc='$i_sysresrc'
23072 i_syssecrt='$i_syssecrt'
23073 i_sysselct='$i_sysselct'
23074 i_syssockio='$i_syssockio'
23075 i_sysstat='$i_sysstat'
23076 i_sysstatfs='$i_sysstatfs'
23077 i_sysstatvfs='$i_sysstatvfs'
23078 i_systime='$i_systime'
23079 i_systimek='$i_systimek'
23080 i_systimes='$i_systimes'
23081 i_systypes='$i_systypes'
23082 i_sysuio='$i_sysuio'
23084 i_sysutsname='$i_sysutsname'
23085 i_sysvfs='$i_sysvfs'
23086 i_syswait='$i_syswait'
23087 i_termio='$i_termio'
23088 i_termios='$i_termios'
23090 i_unistd='$i_unistd'
23093 i_values='$i_values'
23094 i_varargs='$i_varargs'
23095 i_varhdr='$i_varhdr'
23097 ignore_versioned_solibs='$ignore_versioned_solibs'
23098 inc_version_list='$inc_version_list'
23099 inc_version_list_init='$inc_version_list_init'
23102 initialinstalllocation='$initialinstalllocation'
23103 installarchlib='$installarchlib'
23104 installbin='$installbin'
23105 installhtml1dir='$installhtml1dir'
23106 installhtml3dir='$installhtml3dir'
23107 installman1dir='$installman1dir'
23108 installman3dir='$installman3dir'
23109 installprefix='$installprefix'
23110 installprefixexp='$installprefixexp'
23111 installprivlib='$installprivlib'
23112 installscript='$installscript'
23113 installsitearch='$installsitearch'
23114 installsitebin='$installsitebin'
23115 installsitehtml1dir='$installsitehtml1dir'
23116 installsitehtml3dir='$installsitehtml3dir'
23117 installsitelib='$installsitelib'
23118 installsiteman1dir='$installsiteman1dir'
23119 installsiteman3dir='$installsiteman3dir'
23120 installsitescript='$installsitescript'
23121 installstyle='$installstyle'
23122 installusrbinperl='$installusrbinperl'
23123 installvendorarch='$installvendorarch'
23124 installvendorbin='$installvendorbin'
23125 installvendorhtml1dir='$installvendorhtml1dir'
23126 installvendorhtml3dir='$installvendorhtml3dir'
23127 installvendorlib='$installvendorlib'
23128 installvendorman1dir='$installvendorman1dir'
23129 installvendorman3dir='$installvendorman3dir'
23130 installvendorscript='$installvendorscript'
23132 issymlink='$issymlink'
23133 ivdformat='$ivdformat'
23136 known_extensions='$known_extensions'
23139 lddlflags='$lddlflags'
23141 ldflags_uselargefiles='$ldflags_uselargefiles'
23142 ldlibpthname='$ldlibpthname'
23149 libsdirs='$libsdirs'
23150 libsfiles='$libsfiles'
23151 libsfound='$libsfound'
23152 libspath='$libspath'
23153 libswanted='$libswanted'
23154 libswanted_uselargefiles='$libswanted_uselargefiles'
23160 localtime_r_proto='$localtime_r_proto'
23161 locincpth='$locincpth'
23162 loclibpth='$loclibpth'
23163 longdblsize='$longdblsize'
23164 longlongsize='$longlongsize'
23165 longsize='$longsize'
23169 lseeksize='$lseeksize'
23170 lseektype='$lseektype'
23173 madlyobj='$madlyobj'
23174 madlysrc='$madlysrc'
23178 make_set_make='$make_set_make'
23179 mallocobj='$mallocobj'
23180 mallocsrc='$mallocsrc'
23181 malloctype='$malloctype'
23183 man1direxp='$man1direxp'
23186 man3direxp='$man3direxp'
23188 mips_type='$mips_type'
23189 mistrustnm='$mistrustnm'
23191 mmaptype='$mmaptype'
23192 modetype='$modetype'
23194 multiarch='$multiarch'
23196 myarchname='$myarchname'
23197 mydomain='$mydomain'
23198 myhostname='$myhostname'
23201 need_va_copy='$need_va_copy'
23202 netdb_hlen_type='$netdb_hlen_type'
23203 netdb_host_type='$netdb_host_type'
23204 netdb_name_type='$netdb_name_type'
23205 netdb_net_type='$netdb_net_type'
23208 nm_so_opt='$nm_so_opt'
23209 nonxs_ext='$nonxs_ext'
23211 nvEUformat='$nvEUformat'
23212 nvFUformat='$nvFUformat'
23213 nvGUformat='$nvGUformat'
23214 nv_overflows_integers_at='$nv_overflows_integers_at'
23215 nv_preserves_uv_bits='$nv_preserves_uv_bits'
23216 nveformat='$nveformat'
23217 nvfformat='$nvfformat'
23218 nvgformat='$nvgformat'
23221 o_nonblock='$o_nonblock'
23223 old_pthread_create_joinable='$old_pthread_create_joinable'
23224 optimize='$optimize'
23225 orderlib='$orderlib'
23228 otherlibdirs='$otherlibdirs'
23232 patchlevel='$patchlevel'
23233 path_sep='$path_sep'
23236 perl_patchlevel='$perl_patchlevel'
23237 perl_static_inline='$perl_static_inline'
23238 perladmin='$perladmin'
23239 perllibs='$perllibs'
23240 perlpath='$perlpath'
23242 phostname='$phostname'
23248 prefixexp='$prefixexp'
23250 privlibexp='$privlibexp'
23251 procselfexe='$procselfexe'
23252 prototype='$prototype'
23254 quadkind='$quadkind'
23255 quadtype='$quadtype'
23256 randbits='$randbits'
23257 randfunc='$randfunc'
23258 random_r_proto='$random_r_proto'
23259 randseedtype='$randseedtype'
23261 rd_nodata='$rd_nodata'
23262 readdir64_r_proto='$readdir64_r_proto'
23263 readdir_r_proto='$readdir_r_proto'
23264 revision='$revision'
23270 sGMTIME_max='$sGMTIME_max'
23271 sGMTIME_min='$sGMTIME_min'
23272 sLOCALTIME_max='$sLOCALTIME_max'
23273 sLOCALTIME_min='$sLOCALTIME_min'
23274 sPRIEUldbl='$sPRIEUldbl'
23275 sPRIFUldbl='$sPRIFUldbl'
23276 sPRIGUldbl='$sPRIGUldbl'
23277 sPRIXU64='$sPRIXU64'
23279 sPRIeldbl='$sPRIeldbl'
23280 sPRIfldbl='$sPRIfldbl'
23281 sPRIgldbl='$sPRIgldbl'
23286 sSCNfldbl='$sSCNfldbl'
23287 sched_yield='$sched_yield'
23288 scriptdir='$scriptdir'
23289 scriptdirexp='$scriptdirexp'
23291 seedfunc='$seedfunc'
23292 selectminbits='$selectminbits'
23293 selecttype='$selecttype'
23294 sendmail='$sendmail'
23295 setgrent_r_proto='$setgrent_r_proto'
23296 sethostent_r_proto='$sethostent_r_proto'
23297 setlocale_r_proto='$setlocale_r_proto'
23298 setnetent_r_proto='$setnetent_r_proto'
23299 setprotoent_r_proto='$setprotoent_r_proto'
23300 setpwent_r_proto='$setpwent_r_proto'
23301 setservent_r_proto='$setservent_r_proto'
23304 sharpbang='$sharpbang'
23305 shmattype='$shmattype'
23306 shortsize='$shortsize'
23309 sig_count='$sig_count'
23310 sig_name='$sig_name'
23311 sig_name_init='$sig_name_init'
23313 sig_num_init='$sig_num_init'
23314 sig_size='$sig_size'
23315 signal_t='$signal_t'
23316 sitearch='$sitearch'
23317 sitearchexp='$sitearchexp'
23319 sitebinexp='$sitebinexp'
23320 sitehtml1dir='$sitehtml1dir'
23321 sitehtml1direxp='$sitehtml1direxp'
23322 sitehtml3dir='$sitehtml3dir'
23323 sitehtml3direxp='$sitehtml3direxp'
23325 sitelib_stem='$sitelib_stem'
23326 sitelibexp='$sitelibexp'
23327 siteman1dir='$siteman1dir'
23328 siteman1direxp='$siteman1direxp'
23329 siteman3dir='$siteman3dir'
23330 siteman3direxp='$siteman3direxp'
23331 siteprefix='$siteprefix'
23332 siteprefixexp='$siteprefixexp'
23333 sitescript='$sitescript'
23334 sitescriptexp='$sitescriptexp'
23335 sizesize='$sizesize'
23336 sizetype='$sizetype'
23340 sockethdr='$sockethdr'
23341 socketlib='$socketlib'
23342 socksizetype='$socksizetype'
23344 spackage='$spackage'
23345 spitshell='$spitshell'
23346 srand48_r_proto='$srand48_r_proto'
23347 srandom_r_proto='$srandom_r_proto'
23349 ssizetype='$ssizetype'
23350 st_ino_sign='$st_ino_sign'
23351 st_ino_size='$st_ino_size'
23352 startperl='$startperl'
23354 static_ext='$static_ext'
23356 stdio_base='$stdio_base'
23357 stdio_bufsiz='$stdio_bufsiz'
23358 stdio_cnt='$stdio_cnt'
23359 stdio_filbuf='$stdio_filbuf'
23360 stdio_ptr='$stdio_ptr'
23361 stdio_stream_array='$stdio_stream_array'
23362 strerror_r_proto='$strerror_r_proto'
23365 subversion='$subversion'
23369 targetarch='$targetarch'
23373 timeincl='$timeincl'
23374 timetype='$timetype'
23375 tmpnam_r_proto='$tmpnam_r_proto'
23381 ttyname_r_proto='$ttyname_r_proto'
23390 uidformat='$uidformat'
23396 uquadtype='$uquadtype'
23397 use5005threads='$use5005threads'
23398 use64bitall='$use64bitall'
23399 use64bitint='$use64bitint'
23400 usecrosscompile='$usecrosscompile'
23401 usedevel='$usedevel'
23403 usedtrace='$usedtrace'
23404 usefaststdio='$usefaststdio'
23405 useithreads='$useithreads'
23406 uselargefiles='$uselargefiles'
23407 uselongdouble='$uselongdouble'
23408 usemallocwrap='$usemallocwrap'
23409 usemorebits='$usemorebits'
23410 usemultiplicity='$usemultiplicity'
23411 usemymalloc='$usemymalloc'
23413 useopcode='$useopcode'
23414 useperlio='$useperlio'
23415 useposix='$useposix'
23416 usereentrant='$usereentrant'
23417 userelocatableinc='$userelocatableinc'
23419 useshrplib='$useshrplib'
23420 usesitecustomize='$usesitecustomize'
23421 usesocks='$usesocks'
23422 usethreads='$usethreads'
23423 usevendorprefix='$usevendorprefix'
23424 usevfork='$usevfork'
23427 uvXUformat='$uvXUformat'
23428 uvoformat='$uvoformat'
23431 uvuformat='$uvuformat'
23432 uvxformat='$uvxformat'
23434 vendorarch='$vendorarch'
23435 vendorarchexp='$vendorarchexp'
23436 vendorbin='$vendorbin'
23437 vendorbinexp='$vendorbinexp'
23438 vendorhtml1dir='$vendorhtml1dir'
23439 vendorhtml1direxp='$vendorhtml1direxp'
23440 vendorhtml3dir='$vendorhtml3dir'
23441 vendorhtml3direxp='$vendorhtml3direxp'
23442 vendorlib='$vendorlib'
23443 vendorlib_stem='$vendorlib_stem'
23444 vendorlibexp='$vendorlibexp'
23445 vendorman1dir='$vendorman1dir'
23446 vendorman1direxp='$vendorman1direxp'
23447 vendorman3dir='$vendorman3dir'
23448 vendorman3direxp='$vendorman3direxp'
23449 vendorprefix='$vendorprefix'
23450 vendorprefixexp='$vendorprefixexp'
23451 vendorscript='$vendorscript'
23452 vendorscriptexp='$vendorscriptexp'
23454 version_patchlevel_string='$version_patchlevel_string'
23455 versiononly='$versiononly'
23457 voidflags='$voidflags'
23460 yaccflags='$yaccflags'
23465 : add special variables
23466 $test -f $src/patchlevel.h && \
23467 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
23468 echo "PERL_PATCHLEVEL='$perl_patchlevel'" >>config.sh
23469 echo "PERL_CONFIG_SH=true" >>config.sh
23471 : propagate old symbols
23472 if $test -f UU/config.sh; then
23473 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
23474 $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \
23475 config.sh config.sh UU/oldconfig.sh |\
23476 $sort | $uniq -u >UU/oldsyms
23477 set X `$cat UU/oldsyms`
23483 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
23485 echo ": Variables propagated from previous config.sh file." >>config.sh
23486 for sym in `$cat UU/oldsyms`; do
23487 echo " Propagating $hint variable "'$'"$sym..."
23488 eval 'tmp="$'"${sym}"'"'
23490 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
23496 : Finish up by extracting the .SH files
23500 echo "Extraction done."
23510 If you'd like to make any changes to the config.sh file before I begin
23511 to configure things, do it as a shell escape now (e.g. !vi config.sh).
23514 rp="Press return or use a shell escape to edit config.sh:"
23519 *) : in case they cannot read
23520 sh 1>&4 -c "$ans";;
23525 : if this fails, just run all the .SH files by hand
23534 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
23541 Now you need to generate make dependencies by running "$make depend".
23542 You might prefer to run it in background: "$make depend > makedepend.out &"
23543 It can take a while, so you might not want to run it right now.
23548 rp="Run $make depend now?"
23552 $make depend && echo "Now you must run '$make'."
23555 echo "You must run '$make depend' then '$make'."
23558 elif test -f [Mm]akefile; then
23560 echo "Now you must run a $make."
23562 echo "Configure done."
23565 if $test -f Policy.sh; then
23568 If you compile $package on a different machine or from a different object
23569 directory, copy the Policy.sh file from this object directory to the
23570 new one before you run Configure -- this will help you with most of
23571 the policy defaults.
23575 if $test -f config.msg; then
23576 echo "Hmm. I also noted the following information while running:"
23578 $cat config.msg >&4
23581 $rm -f kit*isdone ark*isdone