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 Mon Jan 9 18:25:32 CET 2012 [metaconfig 3.5 PL0]
32 # (with additional metaconfig patches by perlbug@perl.org)
37 SCO csh still thinks true is false. Write to SCO today and tell them that next
38 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
40 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
41 we'd have to do is go in and swap the && and || tokens, wherever they are.)
43 [End of diatribe. We now return you to your regularly scheduled programming...]
47 OOPS! You naughty creature! You didn't run Configure with sh!
48 I will attempt to remedy the situation by running sh for you...
52 true || exec sh $0 $argv:q
54 (exit $?0) || cat c2$$
55 (exit $?0) || exec sh $0 $argv:q
58 if test -f /dev/cputype -a -f /dev/drivers -a -f /dev/osversion; then
61 *** I'm sorry but this system looks like Plan 9 and Plan 9 doesn't do
62 *** Configure that well. (Plan 9 is close to UNIX but not close enough.)
63 *** Please read the README.plan9 for further instructions.
64 *** Cannot continue, aborting.
70 if test ! -c /dev/null ; then
73 *** I'm sorry, but /dev/null appears to be a file rather than a device.
74 *** Please consult your operating sytem's notes for making a device
76 *** Cannot continue, aborting.
82 : compute my invocation name
86 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
91 : Proper separator for the PATH environment variable
93 : On OS/2 this directory should exist if this is not floppy only system ":-]"
94 if test -d c:/. || ( uname -a | grep -i 'os\(/\|\)2' ) 2>&1 >/dev/null ; then
95 if test -n "$OS2_SHELL"; then
97 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
98 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
100 elif test -n "$DJGPP"; then
101 case "X${MACHTYPE:-nonesuchmach}" in
108 : Proper PATH setting
109 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
110 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
111 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
112 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
113 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
114 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /opt/ansic/bin /usr/ccs/bin"
115 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
116 paths="$paths /sbin /usr/sbin /usr/libexec"
117 paths="$paths /system/gnu_library/bin"
121 case "$p_$PATH$p_" in
123 *) test -d $p && PATH=$PATH$p_$p ;;
130 : shall we be using ksh?
136 if (PATH=.; alias -x) >/dev/null 2>&1; then
139 if test -f /hp-ux -a -f /bin/ksh; then
140 needksh='to avoid sh bug in "here document" expansion'
142 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
143 if test X`/usr/bin/uname -v` = X4; then
144 avoidksh="to avoid AIX 4's /bin/sh"
148 if test -f /osf_boot -a -f /usr/sbin/setld; then
149 if test X`/usr/bin/uname -s` = XOSF1; then
150 avoidksh="to avoid Digital UNIX' ksh"
155 case "$inksh/$needksh" in
162 case "$inksh/$avoidksh" in
168 case "$inksh/$needksh-$avoidksh-" in
171 (I see you are using the Korn shell. Some ksh's blow up on $me,
172 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
179 echo "(Feeding myself to $newsh $reason.)"
181 Configure|*/Configure) exec $newsh $0 "$@";;
182 *) exec $newsh Configure "$@";;
186 test -x "${newsh}" || unset newsh
188 : if needed, set CDPATH to a harmless value that is not chatty
189 : avoid bash 2.02 problems with empty CDPATH.
193 *bash*) CDPATH='.' ;;
199 : Configure runs within the UU subdirectory
200 test -d UU || mkdir UU
340 initialinstalllocation=''
369 d_attribute_deprecated=''
370 d_attribute_format=''
371 d_attribute_malloc=''
372 d_attribute_nonnull=''
373 d_attribute_noreturn=''
375 d_attribute_unused=''
376 d_attribute_warn_unused_result=''
377 d_printf_format_null=''
380 d_builtin_choose_expr=''
383 d_c99_variadic_macros=''
430 endhostent_r_proto=''
436 endprotoent_r_proto=''
442 endservent_r_proto=''
495 gethostbyaddr_r_proto=''
497 gethostbyname_r_proto=''
499 gethostent_r_proto=''
512 getnetbyaddr_r_proto=''
514 getnetbyname_r_proto=''
528 d_getprotobyname_r=''
529 getprotobyname_r_proto=''
530 d_getprotobynumber_r=''
531 getprotobynumber_r_proto=''
533 getprotoent_r_proto=''
545 getservbyname_r_proto=''
547 getservbyport_r_proto=''
549 getservent_r_proto=''
576 d_libm_lib_version=''
579 d_localtime_r_needs_tzset=''
590 d_malloc_good_size=''
634 d_old_pthread_create_joinable=''
635 old_pthread_create_joinable=''
637 d_pthread_attr_setscope=''
676 sethostent_r_proto=''
693 setprotoent_r_proto=''
705 setservent_r_proto=''
741 d_sprintf_returns_strlen=''
753 perl_static_inline=''
758 d_stdio_ptr_lval_nochange_cnt=''
759 d_stdio_ptr_lval_sets_cnt=''
903 d_gdbm_ndbm_h_uses_prototypes=''
904 d_gdbmndbm_h_uses_prototypes=''
906 d_ndbm_h_uses_prototypes=''
981 d_inc_version_list=''
983 inc_version_list_init=''
1002 ignore_versioned_solibs=''
1066 d_perl_otherlibdirs=''
1074 api_versionstring=''
1080 version_patchlevel_string=''
1084 d_nv_preserves_uv=''
1085 d_nv_zero_is_allbits_zero=''
1096 nv_overflows_integers_at=''
1097 nv_preserves_uv_bits=''
1169 installsitehtml1dir=''
1172 installsitehtml3dir=''
1179 installsiteman1dir=''
1182 installsiteman3dir=''
1187 installsitescript=''
1204 d_stdio_stream_array=''
1205 stdio_stream_array=''
1222 usekernprocpathname=''
1223 ccflags_uselargefiles=''
1224 ldflags_uselargefiles=''
1225 libswanted_uselargefiles=''
1234 usensgetexecutablepath=''
1247 installvendorarch=''
1254 installvendorhtml1dir=''
1256 vendorhtml1direxp=''
1257 installvendorhtml3dir=''
1259 vendorhtml3direxp=''
1265 installvendorman1dir=''
1268 installvendorman3dir=''
1275 installvendorscript=''
1288 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1291 : We must find out about Eunice early
1293 if test -f /etc/unixtovms; then
1294 eunicefix=/etc/unixtovms
1296 if test -f /etc/unixtovms.exe; then
1297 eunicefix=/etc/unixtovms.exe
1300 : Set executable suffix now -- needed before hints available
1301 if test -f "/libs/version.library"; then
1304 elif test -f "/system/gnu_library/bin/ar.pm"; then
1307 elif test -n "$DJGPP"; then
1310 elif test -d c:/. -o -n "$is_os2" ; then
1317 : Trailing extension. Override this in a hint file, if needed.
1318 : Extra object files, if any, needed on this platform.
1321 : Possible local include directories to search.
1322 : Set locincpth to "" in a hint file to defeat local include searches.
1323 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1324 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1326 : no include file wanted by default
1329 : Enable -DEBUGGING and -DDEBUGGING from the command line
1334 : change the next line if compiling for Xenix/286 on Xenix/386
1335 xlibpth='/usr/lib/386 /lib/386'
1336 : Possible local library directories to search.
1337 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1338 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1340 : general looking path for locating libraries
1341 glibpth="/lib /usr/lib $xlibpth"
1342 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1343 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1344 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1345 test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
1347 : Private path used by Configure to find libraries. Its value
1348 : is prepended to libpth. This variable takes care of special
1349 : machines, like the mips. Usually, it should be empty.
1352 : default library list
1354 : some systems want to use only the non-versioned libso:s
1355 ignore_versioned_solibs=''
1356 : set usethreads on the Configure command line to enable threads.
1357 usereentrant='undef'
1358 : full support for void wanted by default
1364 : set useposix=false in your hint file to disable the POSIX extension.
1366 : set useopcode=false in your hint file to disable the Opcode extension.
1369 ccflags_uselargefiles=''
1370 ldflags_uselargefiles=''
1371 libswanted_uselargefiles=''
1372 : set usemultiplicity on the Configure command line to enable multiplicity.
1373 : set usesocks on the Configure command line to enable socks.
1374 : List of libraries we want.
1375 : If anyone needs extra -lxxx, put those in a hint file.
1376 libswanted="sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun"
1377 libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
1378 : We probably want to search /usr/shlib before most other libraries.
1379 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1380 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1381 glibpth="/usr/shlib $glibpth"
1382 : Do not use vfork unless overridden by a hint file.
1385 : Find the basic shell for Bourne shell scripts
1389 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1392 if test -f "$xxx"; then
1395 : Build up a list and do a single loop so we can 'break' out.
1396 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1397 for xxx in sh bash ksh pdksh ash; do
1399 try="$try ${p}/${xxx}"
1403 if test -f "$xxx"; then
1406 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1409 elif test -f "$xxx.exe"; then
1420 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1422 Usually it's in /bin/sh. How did you even get this far?
1423 Please contact me (Perl Maintainers) at perlbug@perl.org and
1424 we'll try to straighten this all out.
1430 : see if sh knows # comments
1431 if `$sh -c '#' >/dev/null 2>&1`; then
1435 test -f $xcat$_exe || xcat=/usr/bin/cat
1436 if test ! -f $xcat$_exe; then
1437 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1438 if test -f $p/cat$_exe; then
1443 if test ! -f $xcat$_exe; then
1444 echo "Can't find cat anywhere!"
1448 echo "#!$xcat" >sharp
1451 ./sharp > today 2>/dev/null
1452 if test -s today; then
1455 echo "#! $xcat" > sharp
1458 ./sharp > today 2>/dev/null
1459 if test -s today; then
1467 echo "Your $sh doesn't grok # comments--I will strip them later on."
1470 echo "exec grep -v '^[ ]*#'" >spitshell
1472 $eunicefix spitshell
1473 spitshell=`pwd`/spitshell
1475 echo "I presume that if # doesn't work, #! won't work either!"
1480 : figure out how to guarantee sh startup
1482 '') startsh=${sharpbang}${sh} ;;
1494 : echo "Yup, it does."
1496 echo "Hmm... '$startsh' does not guarantee sh startup..."
1497 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1501 : Save command line options in file UU/cmdline.opt for later use in
1502 : generating config.sh.
1503 cat > cmdline.opt <<EOSH
1504 : Configure command line arguments.
1513 cat >>cmdline.opt <<EOSH
1514 config_arg$argn='$arg'
1516 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1519 arg_exp=`cat cmdl.opt`
1520 args_exp="$args_exp$args_sep'$arg_exp'"
1521 argn=`expr $argn + 1`
1526 : produce awk script to parse command line options
1527 cat >options.awk <<'EOF'
1529 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1531 len = length(optstr);
1532 for (i = 1; i <= len; i++) {
1533 c = substr(optstr, i, 1);
1534 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1545 if (substr(str, 1, 1) != "-") {
1546 printf("'%s'\n", str);
1550 for (i = 2; i <= len; i++) {
1551 c = substr(str, i, 1);
1553 printf("-%s\n", substr(str, i));
1559 printf("'%s'\n", substr(str, i + 1));
1572 : process the command line options
1573 set X `for arg in "$@"; do echo "X$arg"; done |
1574 sed -e s/X// | awk -f options.awk`
1579 : set up default values
1589 rm -f optdef.sh posthint.sh
1590 cat >optdef.sh <<EOS
1596 while test $# -gt 0; do
1598 -d) shift; fastread=yes;;
1599 -e) shift; alldone=cont;;
1603 if test -r "$1"; then
1606 echo "$me: cannot read config file $1." >&2
1612 -h) shift; error=true;;
1613 -r) shift; reuseval=true;;
1614 -s) shift; silent=true; realsilent=true;;
1615 -E) shift; alldone=exit;;
1616 -K) shift; knowitall=true;;
1617 -O) shift; override=true;;
1618 -S) shift; silent=true; extractsh=true;;
1623 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1624 echo "$me: ignoring -D $1" >&2
1627 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1628 *) echo "$1='define'" >> optdef.sh;;
1635 *=) echo "$1" >> optdef.sh;;
1637 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1638 echo "$me: ignoring -U $1" >&2
1640 *) echo "$1='undef'" >> optdef.sh;;
1651 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1655 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1656 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1662 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1663 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1664 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1665 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1666 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1667 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1673 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1675 echo "$yyy=''" >> posthint.sh ;;
1680 echo "$yyy='$zzz'" >> posthint.sh ;;
1682 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1684 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1689 echo "$yyy=$zzz" >> posthint.sh ;;
1690 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1694 -V) echo "$me generated by metaconfig 3.5 PL0." >&2
1697 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1705 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1706 [-U symbol] [-U symbol=] [-A command:symbol...]
1707 -d : use defaults for all answers.
1708 -e : go on without questioning past the production of config.sh.
1709 -f : specify an alternate default configuration file.
1710 -h : print this help message and exit (with an error status).
1711 -r : reuse C symbols value if possible (skips costly nm extraction).
1712 -s : silent mode, only echoes questions and essential information.
1713 -D : define symbol to have some value:
1714 -D symbol symbol gets the value 'define'
1715 -D symbol=value symbol gets the value 'value'
1716 common used examples (see INSTALL for more info):
1717 -Duse64bitint use 64bit integers
1718 -Duse64bitall use 64bit integers and pointers
1719 -Dusethreads use thread support
1720 -Dinc_version_list=none do not include older perl trees in @INC
1721 -DEBUGGING=none DEBUGGING options
1722 -Dcc=gcc choose your compiler
1723 -Dprefix=/opt/perl5 choose your destination
1724 -E : stop at the end of questions, after having produced config.sh.
1725 -K : do not use unless you know what you are doing.
1726 -O : let -D and -U override definitions from loaded configuration file.
1727 -S : perform variable substitutions on all .SH files (can mix with -f)
1728 -U : undefine symbol:
1729 -U symbol symbol gets the value 'undef'
1730 -U symbol= symbol gets completely empty
1732 -A : manipulate symbol after the platform specific hints have been applied:
1733 -A append:symbol=value append value to symbol
1734 -A symbol=value like append:, but with a separating space
1735 -A define:symbol=value define symbol to have value
1736 -A clear:symbol define symbol to be ''
1737 -A define:symbol define symbol to be 'define'
1738 -A eval:symbol=value define symbol to be eval of value
1739 -A prepend:symbol=value prepend value to symbol
1740 -A undef:symbol define symbol to be 'undef'
1741 -A undef:symbol= define symbol to be ''
1742 e.g.: -A prepend:libswanted='cl pthread '
1743 -A ccflags=-DSOME_MACRO
1744 -V : print version number and exit (with a zero status).
1751 case "$fastread$alldone" in
1754 case "$extractsh" in
1757 if test ! -t 0; then
1758 echo "Say 'sh Configure', not 'sh <Configure'"
1768 true) exec 1>/dev/null;;
1771 : run the defines and the undefines, if any, but leave the file out there...
1774 : create the posthint manipulation script and leave the file out there...
1779 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1780 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1781 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1782 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1783 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1786 : Some greps do not return status, grrr.
1787 echo "grimblepritz" >grimble
1788 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1790 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1796 : the following should work in any shell
1800 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1801 cat >contains <<'EOSS'
1802 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1807 : Find the path to the source tree
1810 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1814 *) src=`cd ../$src && pwd` ;;
1827 if test -f $rsrc/Configure && \
1828 $contains "^package='$package'\$" $rsrc/Configure >/dev/null 2>&1
1830 : found it, so we are ok.
1833 for src in . .. ../.. ../../.. ../../../..; do
1834 if test -f ../$src/Configure && \
1835 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1846 Sorry, I can't seem to locate the source dir for $package. Please start
1847 Configure with an explicit path -- i.e. /some/path/Configure.
1855 echo "Sources for $package found in \"$src\"." >&4
1859 : script used to extract .SH files with variable substitutions
1860 cat >extract <<'EOS'
1862 echo "Doing variable substitutions on .SH files..."
1863 if test -f MANIFEST; then
1864 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1866 echo "(Looking for .SH files under the source directory.)"
1867 set x `(cd "$src"; find . -name "*.SH" -print)`
1871 0) set x `(cd "$src"; echo *.SH)`; shift;;
1873 if test ! -f "$src/$1"; then
1879 while test $name; do
1880 if test ! -d "$name"; then
1881 create="$name $create";
1882 name=`echo $name | sed -e "s|^[^/]*$||"`;
1883 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1888 for file in $create; do
1897 dir=`expr X$file : 'X\(.*\)/'`
1898 file=`expr X$file : 'X.*/\(.*\)'`
1899 (cd "$dir" && . ./$file)
1909 dir=`expr X$file : 'X\(.*\)/'`
1910 file=`expr X$file : 'X.*/\(.*\)'`
1911 (set x $dir; shift; eval $mkdir_p)
1912 sh <"$src/$dir/$file"
1921 if test -f "$src/config_h.SH"; then
1922 if test ! -f config.h; then
1923 : oops, they left it out of MANIFEST, probably, so do it anyway.
1924 . "$src/config_h.SH"
1929 : extract files and exit if asked to do so
1930 case "$extractsh" in
1932 case "$realsilent" in
1936 case "$config_sh" in
1937 '') config_sh='config.sh';;
1940 echo "Fetching answers from $config_sh..."
1943 test "$override" && . ./optdef.sh
1947 echo "Extraction done."
1952 : Eunice requires " " instead of "", can you believe it
1955 echo "Beginning of configuration questions for $package."
1957 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1959 : first determine how to suppress newline on echo command
1961 echo "Checking echo to see how to suppress newlines..."
1962 (echo "hi there\c" ; echo " ") >.echotmp
1963 if $contains c .echotmp >/dev/null 2>&1 ; then
1974 echo $n "The star should be here-->$c"
1978 : Now test for existence of everything in MANIFEST
1980 if test -f "$rsrc/MANIFEST"; then
1981 echo "First let's make sure your kit is complete. Checking..." >&4
1982 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | \
1983 (split -l 50 2>/dev/null || split -50)
1986 for filelist in x??; do
1987 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` \
1988 >/dev/null 2>>"$tmppwd/missing")
1990 if test -s missing; then
1994 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1996 You have the option of continuing the configuration process, despite the
1997 distinct possibility that your kit is damaged, by typing 'y'es. If you
1998 do, don't blame me if something goes wrong. I advise you to type 'n'o
1999 and contact the author (perlbug@perl.org).
2002 echo $n "Continue? [n] $c" >&4
2006 echo "Continuing..." >&4
2010 echo "ABORTING..." >&4
2015 echo "Looks good..."
2018 echo "There is no MANIFEST file. I hope your kit is complete !"
2022 : Find the appropriate value for a newline for tr
2024 if test -n "$DJGPP"; then
2027 if test X"$trnl" = X; then
2028 case "`echo foo|tr '\n' x 2>/dev/null`" in
2032 if test X"$trnl" = X; then
2033 case "`echo foo|tr '\012' x 2>/dev/null`" in
2034 foox) trnl='\012' ;;
2037 if test X"$trnl" = X; then
2038 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
2039 fooxy) trnl='\n\r' ;;
2042 if test X"$trnl" = X; then
2045 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
2051 : compute the number of columns on the terminal for proper question formatting
2056 : set up the echo used in my read
2057 myecho="case \"\$xxxm\" in
2058 '') echo $n \"\$rp $c\" >&4;;
2060 '') echo $n \"[\$xxxm] $c\";;
2062 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
2064 echo $n \"[\$xxxm] $c\" >&4
2066 echo $n \"\$rp [\$xxxm] $c\" >&4
2072 : now set up to do reads with possible shell escape and default assignment
2078 case "\$fastread" in
2079 yes) case "\$dflt" in
2082 case "\$silent-\$rp" in
2087 *) case "\$silent" in
2088 true) case "\$rp" in
2093 while expr "X\$ans" : "X!" >/dev/null; do
2097 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2105 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2114 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2119 echo "(OK, I'll run with -d after this question.)" >&4
2122 echo "*** Sorry, \$1 not supported yet." >&4
2132 echo "*** Substitution done -- please confirm."
2134 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2139 echo "*** Error -- try again."
2146 case "\$ans\$xxxm\$nostick" in
2158 : create .config dir to save info across Configure sessions
2159 test -d ../.config || mkdir ../.config
2160 cat >../.config/README <<EOF
2161 This directory created by Configure to save information that should
2162 persist across sessions for $package.
2164 You may safely delete it if you wish.
2167 : See if we are using a devel version and want that
2168 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2171 usedevel="$define" ;;
2172 *) case "$xversion" in
2175 *** WHOA THERE!!! ***
2177 This is an UNSTABLE DEVELOPMENT release.
2178 The version of this $package distribution is $xversion, that is, odd,
2179 (as opposed to even) and that signifies a development release.
2180 If you want a maintenance release, you want an even-numbered version.
2182 Do ***NOT*** install this into production use.
2183 Data corruption and crashes are possible.
2185 It is most seriously suggested that you do not continue any further
2186 unless you want to help in developing and debugging Perl.
2188 If you *still* want to build perl, you can answer 'y' now,
2189 or pass -Dusedevel to Configure.
2192 rp='Do you really want to continue?'
2196 [yY]) echo >&4 "Okay, continuing."
2197 usedevel="$define" ;;
2198 *) echo >&4 "Okay, bye."
2209 case "$versiononly" in
2210 '') versiononly="$define" ;;
2212 case "$installusrbinperl" in
2213 '') installusrbinperl="$undef" ;;
2218 : general instructions
2221 user=`(logname) 2>/dev/null`
2223 '') user=`whoami 2>&1`;;
2225 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2228 rp='Would you like to see the instructions?'
2239 This installation shell script will examine your system and ask you questions
2240 to determine how the perl5 package should be installed. If you get
2241 stuck on a question, you may use a ! shell escape to start a subshell or
2242 execute a command. Many of the questions will have default answers in square
2243 brackets; typing carriage return will give you the default.
2245 On some of the questions which ask for file or directory names you are allowed
2246 to use the ~name construct to specify the login directory belonging to "name",
2247 even if you don't have a shell which knows about that. Questions where this is
2248 allowed will be marked "(~name ok)".
2252 dflt='Type carriage return to continue'
2256 The prompter used in this script allows you to use shell variables and
2257 backticks in your answers. You may use $1, $2, etc... to refer to the words
2258 in the default answer, as if the default line was a set of arguments given to a
2259 script shell. This means you may also use $* to repeat the whole default line,
2260 so you do not have to re-type everything to add something to the default.
2262 Every time there is a substitution, you will have to confirm. If there is an
2263 error (e.g. an unmatched backtick), the default answer will remain unchanged
2264 and you will be prompted again.
2266 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2267 the questions and use the computed defaults (or the previous answers if there
2268 was already a config.sh file). Type 'Configure -h' for a list of options.
2269 You may also start interactively and then answer '& -d' at any prompt to turn
2270 on the non-interactive behaviour for the remainder of the execution.
2276 Much effort has been expended to ensure that this shell script will run on any
2277 Unix system. If despite that it blows up on yours, your best bet is to edit
2278 Configure and run it again. If you can't run Configure for some reason,
2279 you'll have to generate a config.sh file by hand. Whatever problems you
2280 have, let me (perlbug@perl.org) know how I blew it.
2282 This installation script affects things in two ways:
2284 1) it may do direct variable substitutions on some of the files included
2286 2) it builds a config.h file for inclusion in C programs. You may edit
2287 any of these files as the need arises after running this script.
2289 If you make a mistake on a question, there is no easy way to back up to it
2290 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2291 files. Configure will offer to let you do this before it runs the SH files.
2294 dflt='Type carriage return to continue'
2296 case "$firsttime" in
2297 true) echo $user >>../.config/instruct;;
2301 : find out where common programs are
2303 echo "Locating common programs..." >&4
2316 if test -d \$dir/\$thing; then
2322 for thisthing in \$dir/\$thing; do
2323 : just loop through to pick last item
2325 if test -f \$thisthing; then
2328 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2331 elif test -f \$dir/\$thing.exe; then
2332 if test -n "$DJGPP"; then
2333 echo \$dir/\$thing.exe
2334 elif test "$eunicefix" != ":"; then
2335 : on Eunice apparently
2388 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2389 pth="$pth /lib /usr/lib"
2390 for file in $loclist; do
2394 if test -f "$xxx"; then
2397 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2398 xxx=`./loc $file $file $pth`
2401 '') xxx=`./loc $file $file $pth`;;
2402 *) xxx=`./loc $xxx $xxx $pth`;;
2404 eval $file=$xxx$_exe
2408 echo $file is in $xxx.
2411 echo $file is in $xxx.
2414 echo "I don't know where '$file' is, and my life depends on it." >&4
2415 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2421 echo "Don't worry if any of the following aren't found..."
2423 for file in $trylist; do
2427 if test -f "$xxx"; then
2430 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2431 xxx=`./loc $file $file $pth`
2434 '') xxx=`./loc $file $file $pth`;;
2435 *) xxx=`./loc $xxx $xxx $pth`;;
2437 eval $file=$xxx$_exe
2441 echo $file is in $xxx.
2444 echo $file is in $xxx.
2447 echo "I don't see $file out there, $say."
2454 echo "Substituting grep for egrep."
2461 *) if $less -R </dev/null >/dev/null; then
2462 echo "Substituting less -R for less."
2470 echo "Substituting cp for ln."
2479 echo "I can't find make or gmake, and my life depends on it." >&4
2480 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2488 *) # We can't have osname yet.
2489 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2490 # Assume that gmake, if found, is definitely GNU make
2491 # and prefer it over the system make.
2492 echo "Substituting gmake for make."
2500 echo "Hopefully test is built into your sh."
2503 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2504 echo "Using the test built into your sh."
2512 echo "Hopefully echo is built into your sh."
2517 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2518 $echo $n "hi there$c" >foo1
2519 echo $n "hi there$c" >foo2
2520 if cmp foo1 foo2 >/dev/null 2>&1; then
2521 echo "They are compatible. In fact, they may be identical."
2528 They are not compatible! You are probably running ksh on a non-USG system.
2529 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2530 have echo built in and we may have to run some Bourne shell scripts. That
2531 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2534 $echo $n "The star should be here-->$c"
2541 # This question was auctioned at YAPC::Europe-2007 in Vienna
2542 # I never promised you could answer it. I only auctioned the question.
2544 The following message is sponsored by
2546 Dresden.pm<--The stars should be here.
2548 Dear Perl user, system administrator or package
2549 maintainer, the Perl community sends greetings to
2550 you. Do you (emblematical) greet back [Y/n]? n
2554 : Check what type of C compiler we use
2558 cat <<'EOSC' >>trygcc
2563 int main(int argc, char *argv[]) {
2567 if $cc -o try $ccflags $ldflags try.c; then
2570 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2576 # Skip this test because it gives a false match on output like:
2577 # ./trygcc: line 23: cc: command not found
2578 # case "`$cc -v -c try.c 2>&1`" in
2579 # *gcc*) trygcc=no ;;
2581 if $test X"$trygcc" = Xyes; then
2582 if gcc -o try -c try.c; then
2584 echo "You seem to have a working gcc, though." >&4
2585 # Switching compilers may undo the work of hints files.
2586 # The most common problem is -D_REENTRANT for threads.
2587 # This heuristic catches that case, but gets false positives
2588 # if -Dusethreads was not actually specified. Better to
2589 # bail out here with a useful message than fail
2590 # mysteriously later. Should we perhaps just try to
2591 # re-invoke Configure -Dcc=gcc config_args ?
2592 if $test -f usethreads.cbu; then
2595 *** However, any setting of the C compiler flags (e.g. for thread support)
2596 *** will be lost. It may be necessary for you to restart Configure and
2597 *** add -Dcc=gcc to your Configure command line.
2600 rp="Would you like to go ahead and try gcc anyway?"
2603 rp="Would you like to use it?"
2606 if $test -f myread; then
2609 if $test -f UU/myread; then
2612 echo "Cannot find myread, sorry. Aborting." >&2
2617 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2630 cat <<'EOSC' >>checkcc
2635 int main(int argc, char *argv[]) {
2639 if $cc -o try $ccflags $ldflags try.c; then
2642 if $test X"$despair" = Xyes; then
2643 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2646 You need to find a working C compiler.
2647 Either (purchase and) install the C compiler supplied by your OS vendor,
2648 or for a free C compiler try http://gcc.gnu.org/
2649 I cannot continue any further, aborting.
2658 : determine whether symbolic links are supported
2661 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2662 echo "Symbolic links are supported." >&4
2665 echo "Symbolic links are NOT supported." >&4
2670 : determine whether symbolic links are supported
2674 echo "Checking how to test for symbolic links..." >&4
2676 if $test "X$issymlink" = X; then
2678 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2679 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2681 if test $? = 0; then
2684 echo "Your builtin 'test -h' may be broken." >&4
2687 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2690 if test -f "$p/$test"; then
2699 echo "Trying external '$test -h'." >&4
2700 issymlink="$test -h"
2701 if $test ! -h sym >/dev/null 2>&1; then
2702 echo "External '$test -h' is broken, too." >&4
2710 if $test "X$issymlink" = X; then
2711 if $test -L sym 2>/dev/null; then
2712 issymlink="$test -L"
2713 echo "The builtin '$test -L' worked." >&4
2716 if $test "X$issymlink" != X; then
2717 echo "You can test for symbolic links with '$issymlink'." >&4
2719 echo "I do not know how you can test for symbolic links." >&4
2723 *) echo "No symbolic links, so not testing for their testing..." >&4
2728 : Make symlinks util
2729 case "$mksymlinks" in
2732 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2735 *) case "$lns:$issymlink" in
2736 *"ln"*" -s:"*"test -"?)
2737 echo "Creating the symbolic links..." >&4
2738 echo "(First creating the subdirectories...)" >&4
2740 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2742 test -z "$directory" && break
2746 if test ! -d t/base; then
2747 echo "Failed to create the subdirectories. Aborting." >&4
2750 echo "(Then creating the symlinks...)" >&4
2751 awk '{print $1}' $src/MANIFEST | while true; do
2753 test -z "$filename" && break
2754 if test -f $filename; then
2755 if $issymlink $filename; then
2759 if test -f $filename; then
2760 echo "$filename already exists, not symlinking."
2762 ln -s $src/$filename $filename
2766 if test ! -f t/base/lex.t; then
2767 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2772 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2780 : Check for Cross-Compilation
2781 case "$usecrosscompile" in
2783 $echo "Cross-compiling..."
2786 *-*-gcc) # A cross-compiling gcc, probably.
2787 targetarch=`$echo $cc|$sed 's/-gcc$//'`
2789 # leave out ld, choosing it is more complex
2791 ranlib=$targetarch-ranlib
2792 $echo 'extern int foo;' > try.c
2793 set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
2795 if $test $# -gt 0; then
2797 incpth="`$echo $incpth|$sed 's/^ //'`"
2798 echo "Guessing incpth '$incpth'." >&4
2800 j="`$echo $i|$sed 's,/include$,/lib,'`"
2801 if $test -d $j; then
2805 libpth="`$echo $libpth|$sed 's/^ //'`"
2806 echo "Guessing libpth '$libpth'." >&4
2811 case "$targetarch" in
2812 '') echo "Targetarch not defined." >&4; croak=y ;;
2813 *) echo "Using targetarch $targetarch." >&4 ;;
2816 '') echo "Incpth not defined." >&4; croak=y ;;
2817 *) echo "Using incpth '$incpth'." >&4 ;;
2820 '') echo "Libpth not defined." >&4; croak=y ;;
2821 *) echo "Using libpth '$libpth'." >&4 ;;
2824 '') for i in $incpth; do
2825 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2827 echo "Guessing usrinc $usrinc." >&4
2832 '') echo "Usrinc not defined." >&4; croak=y ;;
2835 *) echo "Using usrinc $usrinc." >&4 ;;
2837 case "$targethost" in
2838 '') echo "Targethost not defined." >&4; croak=y ;;
2839 *) echo "Using targethost $targethost." >&4
2844 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2847 /*) run=$src/Cross/run
2848 targetmkdir=$src/Cross/mkdir
2850 from=$src/Cross/from
2852 *) pwd=`$test -f ../Configure & cd ..; pwd`
2854 targetmkdir=$pwd/Cross/mkdir
2856 from=$pwd/Cross/from
2859 case "$targetrun" in
2860 '') targetrun=ssh ;;
2865 case "$targetfrom" in
2866 '') targetfrom=scp ;;
2870 from=$from-$targetfrom
2871 case "$targetdir" in
2873 echo "Guessing targetdir $targetdir." >&4
2876 case "$targetuser" in
2878 echo "Guessing targetuser $targetuser." >&4
2881 case "$targetfrom" in
2885 case "$targetrun" in
2897 '') cwd=$targetdir ;;
2901 if $test ! -f \$exe.xok; then
2905 $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2908 *) echo "Unknown targetrun '$targetrun'" >&4
2912 case "$targetmkdir" in
2914 cat >$targetmkdir <<EOF
2916 $targetrun -l $targetuser $targethost "mkdir -p \$@"
2918 $chmod a+rx $targetmkdir
2920 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2932 $targetmkdir \`dirname \$f\`
2933 $targetto $q \$f $targetuser@$targethost:\$f || exit 1
2936 $targetmkdir $targetdir/\`dirname \$f\`
2937 $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2950 $mkdir -p $targetdir/\`dirname \$f\`
2951 $cp \$f $targetdir/\$f || exit 1
2954 $targetmkdir $targetdir/\`dirname \$f\`
2955 $cp \$f $targetdir/\$f || exit 1
2962 *) echo "Unknown targetto '$targetto'" >&4
2966 case "$targetfrom" in
2973 $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2978 cp) cat >$from <<EOF
2983 cp $targetdir/\$f . || exit 1
2988 *) echo "Unknown targetfrom '$targetfrom'" >&4
2992 if $test ! -f $run; then
2993 echo "Target 'run' script '$run' not found." >&4
2997 if $test ! -f $to; then
2998 echo "Target 'to' script '$to' not found." >&4
3002 if $test ! -f $from; then
3003 echo "Target 'from' script '$from' not found." >&4
3007 if $test ! -f $run -o ! -f $to -o ! -f $from; then
3011 Using '$run' for remote execution,
3012 and '$from' and '$to'
3013 for remote file transfer.
3019 usecrosscompile='undef'
3024 : see whether [:lower:] and [:upper:] are supported character classes
3026 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
3028 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
3032 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
3033 # (0xd9 and 0xe2), therefore that is a nice testing point.
3034 if test "X$up" = X -o "X$low" = X; then
3035 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
3041 if test "X$up" = X -o "X$low" = X; then
3042 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
3048 if test "X$up" = X -o "X$low" = X; then
3049 case "`echo RS | od -x 2>/dev/null`" in
3051 echo "Hey, this might be EBCDIC." >&4
3052 if test "X$up" = X -o "X$low" = X; then
3053 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
3054 rs) up='[A-IJ-RS-Z]'
3059 if test "X$up" = X -o "X$low" = X; then
3060 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
3070 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
3072 echo "Using $up and $low to convert case." >&4
3075 echo "I don't know how to translate letters from upper to lower case." >&4
3076 echo "Your tr is not acting any way I know of." >&4
3080 : set up the translation script tr, must be called with ./tr of course
3084 '[A-Z][a-z]') exec $tr '$up' '$low';;
3085 '[a-z][A-Z]') exec $tr '$low' '$up';;
3092 : Try to determine whether config.sh was made on this system
3093 case "$config_sh" in
3095 myuname=`$uname -a 2>/dev/null`
3096 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
3097 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
3098 # because the A-Z/a-z are not consecutive.
3099 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e "s,['/],,g" | \
3100 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
3101 newmyuname="$myuname"
3103 case "$knowitall" in
3105 if test -f ../config.sh; then
3106 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3107 eval "`grep myuname= ../config.sh`"
3109 if test "X$myuname" = "X$newmyuname"; then
3117 : Get old answers from old config file if Configure was run on the
3118 : same system, otherwise use the hints.
3121 if test -f config.sh; then
3123 rp="I see a config.sh file. Shall I use it to set the defaults?"
3126 n*|N*) echo "OK, I'll ignore it."
3127 mv config.sh config.sh.old
3128 myuname="$newmyuname"
3130 *) echo "Fetching default answers from your old config.sh file..." >&4
3138 : Older versions did not always set $sh. Catch re-use of such
3148 if test ! -f config.sh; then
3151 First time through, eh? I have some defaults handy for some systems
3152 that need some extra help getting the Configure answers right:
3155 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3157 : Half the following guesses are probably wrong... If you have better
3158 : tests or hints, please send them to perlbug@perl.org
3159 : The metaconfig authors would also appreciate a copy...
3160 $test -f /irix && osname=irix
3161 $test -f /xenix && osname=sco_xenix
3162 $test -f /dynix && osname=dynix
3163 $test -f /dnix && osname=dnix
3164 $test -f /lynx.os && osname=lynxos
3165 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3166 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3167 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3168 $test -f /bin/mips && /bin/mips && osname=mips
3169 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
3170 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
3171 $test -d /usr/apollo/bin && osname=apollo
3172 $test -f /etc/saf/_sactab && osname=svr4
3173 $test -d /usr/include/minix && osname=minix
3174 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3175 if $test -d /MachTen -o -d /MachTen_Folder; then
3177 if $test -x /sbin/version; then
3178 osvers=`/sbin/version | $awk '{print $2}' |
3179 $sed -e 's/[A-Za-z]$//'`
3180 elif $test -x /usr/etc/version; then
3181 osvers=`/usr/etc/version | $awk '{print $2}' |
3182 $sed -e 's/[A-Za-z]$//'`
3188 $test -f /sys/posix.dll &&
3189 $test -f /usr/bin/what &&
3190 set X `/usr/bin/what /sys/posix.dll` &&
3191 $test "$3" = UWIN &&
3195 if $test -f $uname; then
3203 umips) osname=umips ;;
3206 [23]100) osname=mips ;;
3207 next*) osname=next ;;
3209 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3210 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3213 elif $test -f /etc/kconfig; then
3215 if test "$lns" = "$ln -s"; then
3217 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3219 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3226 if test -n "$DJGPP"; then
3235 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3237 # oslevel can fail with:
3238 # oslevel: Unable to acquire lock.
3239 *not\ found) osvers="$4"."$3" ;;
3240 '<3240'|'<>3240') osvers=3.2.0 ;;
3241 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3242 '=3250'|'>3250') osvers=3.2.5 ;;
3246 bsd386) osname=bsd386
3249 cygwin*) osname=cygwin
3252 *dc.osx) osname=dcosx
3258 domainos) osname=apollo
3264 dragonfly) osname=dragonfly
3267 dynixptx*) osname=dynixptx
3268 osvers=`echo "$4"|sed 's/^v//'`
3270 freebsd) osname=freebsd
3272 genix) osname=genix ;;
3276 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3292 netbsd*) osname=netbsd
3295 news-os) osvers="$3"
3297 4*) osname=newsos4 ;;
3301 next*) osname=next ;;
3302 nonstop-ux) osname=nonstopux ;;
3303 openbsd) osname=openbsd
3309 POSIX-BC | posix-bc ) osname=posix-bc
3312 powerux | power_ux | powermax_os | powermaxos | \
3313 powerunix | power_unix) osname=powerux
3319 solaris) osname=solaris
3321 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3328 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3332 titanos) osname=titanos
3341 ultrix) osname=ultrix
3344 osf1|mls+) case "$5" in
3347 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3350 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3353 hp*) osname=hp_osf1 ;;
3354 mips) osname=mips_osf1 ;;
3357 # UnixWare 7.1.2 is known as Open UNIX 8
3358 openunix|unixware) osname=svr5
3366 $2) case "$osname" in
3370 : svr4.x or possibly later
3380 if test -f /stand/boot ; then
3381 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3382 if test -n "$INITPROG" -a -f "$INITPROG"; then
3383 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3384 if test -n "$isesix"; then
3392 *) if test -f /etc/systemid; then
3394 set `echo $3 | $sed 's/\./ /g'` $4
3395 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3397 elif $test -f $src/hints/sco_$1_$2.sh; then
3399 elif $test -f $src/hints/sco_$1.sh; then
3404 '') : Still unknown. Probably a generic Sys V.
3413 *) case "$osname" in
3414 '') : Still unknown. Probably a generic BSD.
3422 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3423 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3424 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3427 $rm -f UU/kernel.what
3428 elif test -d c:/. -o -n "$is_os2" ; then
3435 case "$targetarch" in
3438 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3443 : Now look for a hint file osname_osvers, unless one has been
3444 : specified already.
3447 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3448 : Also try without trailing minor version numbers.
3449 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3450 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3451 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3452 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3455 *) case "$osvers" in
3458 *) if $test -f $src/hints/$file.sh ; then
3460 elif $test -f $src/hints/$xfile.sh ; then
3462 elif $test -f $src/hints/$xxfile.sh ; then
3464 elif $test -f $src/hints/$xxxfile.sh ; then
3466 elif $test -f $src/hints/$xxxxfile.sh ; then
3468 elif $test -f "$src/hints/${osname}.sh" ; then
3477 if $test -f Policy.sh ; then
3480 none) dflt="Policy" ;;
3481 *) dflt="Policy $dflt" ;;
3486 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3490 if $test -f Policy.sh ; then
3493 There's also a Policy hint file available, which should make the
3494 site-specific (policy) questions easier to answer.
3501 You may give one or more space-separated answers, or "none" if appropriate.
3502 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3503 previous run of Configure, you may specify it as well as or instead of
3504 OS-specific hints. If hints are provided for your OS, you should use them:
3505 although Perl can probably be built without hints on many platforms, using
3506 hints often improve performance and may enable features that Configure can't
3507 set up on its own. If there are no hints that match your OS, specify "none";
3508 DO NOT give a wrong version or a wrong OS.
3512 rp="Which of these apply, if any?"
3515 for file in $tans; do
3516 if $test X$file = XPolicy -a -f Policy.sh; then
3518 $cat Policy.sh >> UU/config.sh
3519 elif $test -f $src/hints/$file.sh; then
3520 . $src/hints/$file.sh
3521 $cat $src/hints/$file.sh >> UU/config.sh
3522 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3525 : Give one chance to correct a possible typo.
3526 echo "$file.sh does not exist"
3528 rp="hint to use instead?"
3530 for file in $ans; do
3531 if $test -f "$src/hints/$file.sh"; then
3532 . $src/hints/$file.sh
3533 $cat $src/hints/$file.sh >> UU/config.sh
3534 elif $test X$ans = X -o X$ans = Xnone ; then
3537 echo "$file.sh does not exist -- ignored."
3544 : Remember our hint file for later.
3545 if $test -f "$src/hints/$file.sh" ; then
3555 echo "Fetching default answers from $config_sh..." >&4
3559 cp $config_sh config.sh 2>/dev/null
3569 test "$override" && . ./optdef.sh
3571 : Restore computed paths
3572 for file in $loclist $trylist; do
3573 eval $file="\$_$file"
3578 Configure uses the operating system name and version to set some defaults.
3579 The default value is probably right if the name rings a bell. Otherwise,
3580 since spelling matters for me, either accept the default or answer "none"
3587 ''|' '|none) dflt=none ;;
3588 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3591 *) dflt="$osname" ;;
3593 rp="Operating system name?"
3597 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3603 ''|' '|none) dflt=none ;;
3604 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3605 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3607 ''|' ') dflt=none ;;
3612 *) dflt="$osvers" ;;
3614 rp="Operating system version?"
3624 : who configured the system
3625 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3628 cf_by=`(logname) 2>/dev/null`
3631 cf_by=`(whoami) 2>/dev/null`
3633 "") cf_by=unknown ;;
3638 : decide how portable to be. Allow command line overrides.
3639 case "$d_portable" in
3641 *) d_portable="$define" ;;
3644 : set up shell script to do ~ expansion
3650 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3653 if $test -f /bin/csh; then
3654 /bin/csh -f -c "glob \$1"
3659 name=\`$expr x\$1 : '..\([^/]*\)'\`
3660 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3661 if $test ! -d "\$dir"; then
3663 echo "\$me: can't locate home directory for: \$name" >&2
3668 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3684 : now set up to get a file name
3688 cat <<'EOSC' >>getfile
3704 : getfile will accept an answer from the comma-separated list
3705 : enclosed in parentheses even if it does not meet other criteria.
3706 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3707 fn=`echo $fn | sed 's/(.*)//'`
3713 loc_file=`expr $fn : '.*:\(.*\)'`
3714 fn=`expr $fn : '\(.*\):.*'`
3722 */*) fullpath=true;;
3731 *e*) exp_file=true;;
3734 *p*) nopath_ok=true;;
3739 *d*) type='Directory';;
3740 *l*) type='Locate';;
3745 Locate) what='File';;
3750 case "$d_portable" in
3758 while test "$type"; do
3763 true) rp="$rp (~name ok)";;
3766 if test -f UU/getfile.ok && \
3767 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3786 value=`UU/filexp $ans`
3789 if test "$ans" != "$value"; then
3790 echo "(That expands to $value on this system.)"
3804 /*) value="$ansexp" ;;
3805 [a-zA-Z]:/*) value="$ansexp" ;;
3810 echo "I shall only accept a full path name, as in /bin/ls." >&4
3811 echo "Use a ! shell escape if you wish to check pathnames." >&4
3814 echo "Please give a full path name, starting with slash." >&4
3817 echo "Note that using ~name is ok provided it expands well." >&4
3830 for fp in $gfpth; do
3831 if test "X$fp" = X.; then
3836 if test -f "$pf"; then
3838 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3840 echo "($value is not a plain file, but that's ok.)"
3843 if test X"$type" = X; then
3850 for fp in $gfpth; do
3851 if test "X$fp" = X.; then
3856 direxp="$fp/$ansexp"
3858 if test -d "$direxp"; then
3866 if test -d "$ansexp"; then
3867 echo "(Looking for $loc_file in directory $value.)"
3868 value="$value/$loc_file"
3869 ansexp="$ansexp/$loc_file"
3871 if test -f "$ansexp"; then
3874 case "$nopath_ok" in
3875 true) case "$value" in
3877 *) echo "Assuming $value will be in people's path."
3893 if test "$fastread" = yes; then
3898 rp="$what $value doesn't exist. Use that name anyway?"
3917 test "X$gfpthkeep" != Xy && gfpth=""
3920 : determine root of directory hierarchy where package will be installed.
3923 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
3926 dflt=`echo "$prefix" | sed 's/.$//'`
3934 By default, $package will be installed in $dflt/bin, manual pages
3935 under $dflt/man, etc..., i.e. with $dflt as prefix for all
3936 installation directories. Typically this is something like /usr/local.
3937 If you wish to have binaries under /usr/bin but other parts of the
3938 installation under /usr/local, that's ok: you will be prompted
3939 separately for each of the installation directories, the prefix being
3940 only used to set the defaults.
3944 rp='Installation prefix to use?'
3952 *) oldprefix="$prefix";;
3959 : allow them to override the AFS root
3962 *) afsroot=$afsroot ;;
3968 $define|true) afs=true ;;
3969 $undef|false) afs=false ;;
3970 *) if $test -d $afsroot; then
3978 echo "AFS may be running... I'll be extra cautious then..." >&4
3980 echo "AFS does not seem to be running..." >&4
3983 : determine installation prefix for where package is to be installed.
3987 Since you are running AFS, I need to distinguish the directory in which
3988 files will reside from the directory in which they are installed (and from
3989 which they are presumably copied to the former directory by occult means).
3992 case "$installprefix" in
3993 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
3994 *) dflt="$installprefix";;
3999 In some special cases, particularly when building $package for distribution,
4000 it is convenient to distinguish the directory in which files should be
4001 installed from the directory ($prefix) in which they will
4002 eventually reside. For most users, these two directories are the same.
4005 case "$installprefix" in
4007 *) dflt=$installprefix;;
4011 rp='What installation prefix should I use for installing files?'
4013 installprefix="$ans"
4014 installprefixexp="$ansexp"
4016 : Perform the prefixexp/installprefixexp correction if necessary
4017 cat <<EOS >installprefix
4020 cat <<'EOSC' >>installprefix
4021 : Change installation prefix, if necessary.
4022 if $test X"$prefix" != X"$installprefix"; then
4023 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
4025 eval "install${prefixvar}=\"\$${prefixvar}exp\""
4028 chmod +x installprefix
4029 $eunicefix installprefix
4031 : Set variables such as privlib and privlibexp from the output of ./getfile
4032 : performing the prefixexp/installprefixexp correction if necessary.
4033 cat <<EOS >setprefixvar
4036 cat <<'EOSC' >>setprefixvar
4037 eval "${prefixvar}=\"\$ans\""
4038 eval "${prefixvar}exp=\"\$ansexp\""
4041 chmod +x setprefixvar
4042 $eunicefix setprefixvar
4044 : set up the script used to warn in case of inconsistency
4053 '') echo "The $hint value for \$$var on this machine was \"$was\"!" >&4
4055 *) echo "Hmm. Based on the hints in hints/$hintfile.sh, " >&4
4056 echo "the $hint value for \$$var on this machine was \"$was\"!" >&4
4061 echo "*** WHOA THERE!!! ***" >&4
4062 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
4065 rp=" Keep the $hint value?"
4068 y) td=$was; tu=$was;;
4072 : function used to set '$1' to '$val'
4073 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
4075 $define$undef) . ./whoa; eval "$var=\$td";;
4076 $undef$define) . ./whoa; eval "$var=\$tu";;
4077 *) eval "$var=$val";;
4080 : get the patchlevel
4082 echo "Getting the current patchlevel..." >&4
4083 if $test -r $rsrc/patchlevel.h;then
4084 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
4085 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4086 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4087 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4088 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4089 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4090 perl_patchlevel=`egrep ',"(MAINT|SMOKE)[0-9][0-9]*"' $rsrc/patchlevel.h|tail -1|sed 's/[^0-9]//g'`
4099 $echo "(You do not have patchlevel.h. Eek.)"
4101 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
4102 version_patchlevel_string="version $patchlevel subversion $subversion"
4103 case "$perl_patchlevel" in
4105 *) perl_patchlevel=`echo $perl_patchlevel | sed 's/.* //'`
4106 version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel"
4110 $echo "(You have $package $version_patchlevel_string.)"
4114 : XXX Should be a Configure test for double-dots in filenames.
4115 version=`echo $revision $patchlevel $subversion | \
4116 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4117 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4118 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4121 version=`echo $revision $patchlevel $subversion | \
4122 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4123 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4124 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4127 : Special case the 5.005_xx maintenance series, which used 5.005
4128 : without any subversion label as a subdirectory in $sitelib
4129 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4130 api_versionstring='5.005'
4133 : Do we want threads support and if so, what type
4134 case "$usethreads" in
4135 $define|true|[yY]*) dflt='y';;
4136 *) # Catch case where user specified ithreads or 5005threads but
4137 # forgot -Dusethreads (A.D. 4/2002)
4138 case "$useithreads$use5005threads" in
4139 *$define*) dflt='y';;
4146 Perl can be built to take advantage of threads on some systems.
4147 To do so, Configure can be run with -Dusethreads.
4149 Note that Perl built with threading support runs slightly slower
4150 and uses more memory than plain Perl. The current implementation
4151 is believed to be stable, but it is fairly new, and so should be
4152 treated with caution.
4154 If this doesn't make any sense to you, just accept the default '$dflt'.
4156 rp='Build a threading Perl?'
4159 y|Y) val="$define" ;;
4165 if $test $patchlevel -lt 9; then
4166 case "$usethreads" in
4170 Since release 5.6, Perl has had two different threading implementations,
4171 the newer interpreter-based version (ithreads) with one interpreter per
4172 thread, and the older 5.005 version (5005threads).
4173 The 5005threads version is effectively unmaintained and will probably be
4174 removed in Perl 5.10, so there should be no need to build a Perl using it
4175 unless needed for backwards compatibility with some existing 5.005threads
4179 : Default to ithreads unless overridden on command line or with
4182 case "$use5005threads" in
4183 $define|true|[yY]*) dflt='n';;
4185 case "$useithreads" in
4186 $undef|false|[nN]*) dflt='n';;
4188 rp='Use the newer interpreter-based ithreads?'
4191 y|Y) val="$define" ;;
4196 : Now set use5005threads to the opposite value.
4197 case "$useithreads" in
4198 $define) val="$undef" ;;
4205 useithreads="$undef"
4206 use5005threads="$undef"
4210 case "$useithreads$use5005threads" in
4214 You cannot have both the ithreads and the 5.005 threads enabled
4215 at the same time. Disabling the 5.005 threads since they are
4216 much less stable than the ithreads.
4219 use5005threads="$undef"
4224 : perl-5.9.x and later
4226 if test X"$usethreads" = "X$define"; then
4227 case "$use5005threads" in
4231 5.005 threads has been removed for 5.10. Perl will be built using ithreads.
4238 use5005threads="$undef"
4239 useithreads="$usethreads"
4242 case "$d_oldpthreads" in
4243 '') : Configure tests would be welcome here. For now, assume undef.
4245 *) val="$d_oldpthreads" ;;
4251 : Look for a hint-file generated 'call-back-unit'. If the
4252 : user has specified that a threading perl is to be built,
4253 : we may need to set or change some other defaults.
4254 if $test -f usethreads.cbu; then
4255 echo "Your platform has some specific hints regarding threaded builds, using them..."
4258 case "$usethreads" in
4259 "$define"|true|[yY]*)
4261 (Your platform does not have any specific hints for threaded builds.
4262 Assuming POSIX threads, then.)
4268 : Check if multiplicity is required
4271 Perl can be built so that multiple Perl interpreters can coexist
4272 within the same Perl executable.
4275 case "$useithreads" in
4278 This multiple interpreter support is required for interpreter-based threads.
4282 *) case "$usemultiplicity" in
4283 $define|true|[yY]*) dflt='y';;
4287 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4288 rp='Build Perl for multiplicity?'
4291 y|Y) val="$define" ;;
4299 : Check if morebits is requested
4300 case "$usemorebits" in
4301 "$define"|true|[yY]*)
4302 use64bitint="$define"
4303 uselongdouble="$define"
4304 usemorebits="$define"
4306 *) usemorebits="$undef"
4310 : Determine the C compiler to be used
4316 rp="Use which C compiler?"
4320 : See whether they have no cc but they do have gcc
4322 if $test -f cc.cbu; then
4327 : make some quick guesses about what we are up against
4329 $echo $n "Hmm... $c"
4339 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
4340 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
4342 echo "Looks kind of like an OSF/1 system, but we'll see..."
4344 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4345 xxx=`./loc addbib blurfl $pth`
4346 if $test -f $xxx; then
4347 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4351 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4352 echo "Looks kind of like an extended USG system, but we'll see..."
4354 echo "Looks kind of like a USG system, but we'll see..."
4358 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4359 echo "Looks kind of like a BSD system, but we'll see..."
4363 echo "Looks kind of like a Version 7 system, but we'll see..."
4366 case "$eunicefix" in
4369 There is, however, a strange, musty smell in the air that reminds me of
4370 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4374 : it so happens the Eunice I know will not run shell scripts in Unix format
4378 echo "Congratulations. You aren't running Eunice."
4382 : Detect OS2. The p_ variable is set above in the Head.U unit.
4383 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4384 : semicolon as a patch separator
4389 I have the feeling something is not exactly right, however...don't tell me...
4390 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4391 (Or you may be running DOS with DJGPP.)
4396 if test -f /xenix; then
4397 echo "Actually, this looks more like a XENIX system..."
4402 echo "It's not Xenix..."
4407 if test -f /venix; then
4408 echo "Actually, this looks more like a VENIX system..."
4415 echo "Nor is it Venix..."
4418 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4419 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4422 : Check if we are using GNU gcc and what its version is
4424 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4428 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4430 printf("%s\n", __VERSION__);
4432 printf("%s\n", "1");
4438 if $cc -o try $ccflags $ldflags try.c; then
4439 gccversion=`$run ./try`
4440 case "$gccversion" in
4441 '') echo "You are not using GNU cc." ;;
4442 *) echo "You are using GNU cc $gccversion."
4448 echo "*** WHOA THERE!!! ***" >&4
4449 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4450 case "$knowitall" in
4452 echo " You'd better start hunting for one and let me know about it." >&4
4458 case "$gccversion" in
4459 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4461 case "$gccversion" in
4462 '') gccosandvers='' ;;
4463 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4464 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4466 case "$gccosandvers" in
4467 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4468 $osname$osvers) ;; # looking good
4469 $osname*) cat <<EOM >&4
4471 *** WHOA THERE!!! ***
4473 Your gcc has not been compiled for the exact release of
4474 your operating system ($gccosandvers versus $osname$osvers).
4476 In general it is a good idea to keep gcc synchronized with
4477 the operating system because otherwise serious problems
4478 may ensue when trying to compile software, like Perl.
4480 I'm trying to be optimistic here, though, and will continue.
4481 If later during the configuration and build icky compilation
4482 problems appear (headerfile conflicts being the most common
4483 manifestation), I suggest reinstalling the gcc to match
4484 your operating system release.
4488 *) gccosandvers='' ;; # failed to parse, better be silent
4496 # gcc 3.* complain about adding -Idirectories that they already know about,
4497 # so we will take those off from locincpth.
4498 case "$gccversion" in
4500 echo "main(){}">try.c
4501 for incdir in $locincpth; do
4502 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4503 grep '^c[cp]p*[01]: warning: changing search order '`
4504 if test "X$warn" != X; then
4505 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4511 : What should the include directory be ?
4513 $echo $n "Hmm... $c"
4517 if $test -f /bin/mips && /bin/mips; then
4518 echo "Looks like a MIPS system..."
4519 $cat >usr.c <<'EOCP'
4520 #ifdef SYSTYPE_BSD43
4524 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4525 dflt='/bsd43/usr/include'
4529 mips_type='System V'
4531 $rm -f usr.c usr.out
4532 echo "and you're compiling with the $mips_type compiler and libraries."
4536 echo "Doesn't look like a MIPS system."
4546 case "$xxx_prompt" in
4549 rp='Where are the include files you want to use?'
4557 : see how we invoke the C preprocessor
4559 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4560 cat <<'EOT' >testcpp.c
4566 if test ! -f cppstdin; then
4567 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4568 # AIX cc -E doesn't show the absolute headerfile
4569 # locations but we'll cheat by using the -M flag.
4570 echo 'cat >.$$.c; rm -f .$$.u; '"$cc"' ${1+"$@"} -M -c .$$.c 2>/dev/null; test -s .$$.u && awk '"'"'$2 ~ /\.h$/ { print "# 0 \""$2"\"" }'"'"' .$$.u; rm -f .$$.o .$$.u; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' > cppstdin
4572 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4575 echo "Keeping your $hint cppstdin wrapper."
4578 wrapper=`pwd`/cppstdin
4582 if $test "X$cppstdin" != "X" && \
4583 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4584 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4586 echo "You used to use $cppstdin $cppminus so we'll use that again."
4588 '') echo "But let's see if we can live without a wrapper..." ;;
4590 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4591 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4593 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4596 echo "(However, $cpprun $cpplast does not work, let's see...)"
4604 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4611 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4612 $cc -E <testcpp.c >testcpp.out 2>&1; \
4613 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4614 echo "Yup, it does."
4617 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4618 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4619 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4620 echo "Yup, it does."
4623 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4624 $cc -P <testcpp.c >testcpp.out 2>&1; \
4625 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4626 echo "Yipee, that works!"
4629 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4630 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4631 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4632 echo "At long last!"
4635 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4636 $cpp <testcpp.c >testcpp.out 2>&1; \
4637 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4641 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4642 $cpp - <testcpp.c >testcpp.out 2>&1; \
4643 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4644 echo "Hooray, it works! I was beginning to wonder."
4647 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4648 $wrapper <testcpp.c >testcpp.out 2>&1; \
4649 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4655 rp="No dice. I can't find a C preprocessor. Name one:"
4659 $x_cpp <testcpp.c >testcpp.out 2>&1
4660 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4661 echo "OK, that will do." >&4
4663 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4678 echo "Perhaps can we force $cc -E using a wrapper..."
4679 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4680 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4686 echo "Nope, we'll have to live without it..."
4700 "$wrapper"|'cppstdin') ;;
4701 *) $rm -f $wrapper;;
4703 $rm -f testcpp.c testcpp.out
4705 : Set private lib path
4708 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4713 '') dlist="$loclibpth $plibpth $glibpth";;
4714 *) dlist="$libpth";;
4717 : Now check and see which directories actually exist, avoiding duplicates
4721 if $test -d $xxx; then
4724 *) libpth="$libpth $xxx";;
4730 Some systems have incompatible or broken versions of libraries. Among
4731 the directories listed in the question below, please remove any you
4732 know not to be holding relevant libraries, and add any that are needed.
4733 Say "none" for none.
4744 rp="Directories to use for library searches?"
4751 : compute shared library extension
4754 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4764 On some systems, shared libraries may be available. Answer 'none' if
4765 you want to suppress searching of shared libraries for the remainder
4766 of this configuration.
4769 rp='What is the file extension used for shared libraries?'
4773 : Define several unixisms.
4774 : Hints files or command line option can be used to override them.
4775 : The convoluted testing is in case hints files set either the old
4778 '') case "$exe_ext" in
4780 *) _exe="$exe_ext" ;;
4785 '') case "$lib_ext" in
4792 '') case "$obj_ext" in
4799 '') case "$path_sep" in
4810 rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
4812 : Which makefile gets called first. This is used by make depend.
4813 case "$firstmakefile" in
4814 '') firstmakefile='makefile';;
4817 : Check is we will use socks
4819 $define|true|[yY]*) dflt='y';;
4824 Perl can be built to use the SOCKS proxy protocol library. To do so,
4825 Configure must be run with -Dusesocks. If you use SOCKS you also need
4826 to use the PerlIO abstraction layer, this will be implicitly selected.
4828 If this doesn't make any sense to you, just accept the default '$dflt'.
4830 rp='Build Perl for SOCKS?'
4833 y|Y) val="$define" ;;
4839 : Check for uselongdouble support
4841 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
4844 case "$uselongdouble" in
4845 $define|true|[yY]*) dflt='y';;
4850 Perl can be built to take advantage of long doubles which
4851 (if available) may give more accuracy and range for floating point numbers.
4853 If this doesn't make any sense to you, just accept the default '$dflt'.
4855 rp='Try to use long doubles if available?'
4858 y|Y) val="$define" ;;
4864 case "$uselongdouble" in
4865 true|[yY]*) uselongdouble="$define" ;;
4868 : Look for a hint-file generated 'call-back-unit'. If the
4869 : user has specified that long doubles should be used,
4870 : we may need to set or change some other defaults.
4871 if $test -f uselongdouble.cbu; then
4872 echo "Your platform has some specific hints regarding long doubles, using them..."
4873 . ./uselongdouble.cbu
4875 case "$uselongdouble" in
4878 (Your platform does not have any specific hints for long doubles.)
4884 : Looking for optional libraries
4886 echo "Checking for optional libraries..." >&4
4891 case "$libswanted" in
4892 '') libswanted='c_s';;
4895 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4901 for thisdir in $libpth $xlibpth; do
4902 test -d $thisdir && libspath="$libspath $thisdir"
4904 for thislib in $libswanted; do
4905 for thisdir in $libspath; do
4907 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4908 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
4909 $test -f "$xxx" && eval $libscheck
4910 $test -f "$xxx" && libstyle=shared
4912 if test ! -f "$xxx"; then
4913 xxx=$thisdir/lib$thislib.$so
4914 $test -f "$xxx" && eval $libscheck
4915 $test -f "$xxx" && libstyle=shared
4917 if test ! -f "$xxx"; then
4918 xxx=$thisdir/lib$thislib$_a
4919 $test -f "$xxx" && eval $libscheck
4920 $test -f "$xxx" && libstyle=static
4922 if test ! -f "$xxx"; then
4923 xxx=$thisdir/$thislib$_a
4924 $test -f "$xxx" && eval $libscheck
4925 $test -f "$xxx" && libstyle=static
4927 if test ! -f "$xxx"; then
4928 xxx=$thisdir/lib${thislib}_s$_a
4929 $test -f "$xxx" && eval $libscheck
4930 $test -f "$xxx" && libstyle=static
4931 $test -f "$xxx" && thislib=${thislib}_s
4933 if test ! -f "$xxx"; then
4934 xxx=$thisdir/Slib$thislib$_a
4935 $test -f "$xxx" && eval $libscheck
4936 $test -f "$xxx" && libstyle=static
4938 if $test -f "$xxx"; then
4940 shared) echo "Found -l$thislib (shared)." ;;
4941 static) echo "Found -l$thislib." ;;
4942 *) echo "Found -l$thislib ($libstyle)." ;;
4946 *) dflt="$dflt -l$thislib"
4947 libsfound="$libsfound $xxx"
4949 libsfiles="$libsfiles $yyy"
4950 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
4951 case " $libsdirs " in
4953 *) libsdirs="$libsdirs $yyy" ;;
4960 if $test ! -f "$xxx"; then
4961 echo "No -l$thislib."
4972 ' '|'') dflt='none';;
4977 In order to compile $package on your machine, a number of libraries
4978 are usually needed. Include any other special libraries here as well.
4979 Say "none" for none. The default list is almost always right.
4983 rp="What libraries to use?"
4990 : determine optimization, if desired, or use for debug flag also
4992 ' '|$undef) dflt='none';;
4994 *) dflt="$optimize";;
4998 By default, $package compiles with the -O flag to use the optimizer.
4999 Alternately, you might want to use the symbolic debugger, which uses
5000 the -g flag (on traditional Unix systems). Either flag can be
5001 specified here. To use neither flag, specify the word "none".
5004 rp="What optimizer/debugger flag should be used?"
5008 'none') optimize=" ";;
5011 : Check what DEBUGGING is required from the command line
5012 : -DEBUGGING or -DDEBUGGING or
5013 : -DEBUGGING=both = -g + -DDEBUGGING
5014 : -DEBUGGING=-g or -Doptimize=-g = -g
5015 : -DEBUGGING=none or -UDEBUGGING =
5016 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
5019 *) DEBUGGING=$EBUGGING ;;
5022 case "$DEBUGGING" in
5026 *) optimize="$optimize -g" ;;
5030 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
5038 case "$DEBUGGING" in
5039 both|$define) dflt='-DDEBUGGING'
5042 : argument order is deliberate, as the flag will start with - which set could
5043 : think is an option
5044 checkccflag='check=$1; flag=$2; callback=$3;
5046 echo "Checking if your compiler accepts $flag" 2>&1;
5047 echo "int main(void) { return 0; }" > gcctest.c;
5048 if $cc -O2 $flag -o gcctest gcctest.c 2>gcctest.out && ./gcctest; then
5049 echo "Yes, it does." 2>&1;
5050 if $test -s gcctest.out ; then
5051 echo "But your platform does not like it:";
5056 echo "Leaving current flags $ccflags alone." 2>&1
5058 *) dflt="$dflt $flag";
5064 echo "Nope, it does not, but that is ok." 2>&1;
5068 : We will not override a previous value, but we might want to
5069 : augment a hint file
5071 default|recommended)
5072 case "$gccversion" in
5073 1*) dflt="$dflt -fpcc-struct-return" ;;
5075 case "$optimize:$DEBUGGING" in
5076 *-g*:old) dflt="$dflt -DDEBUGGING";;
5078 case "$gccversion" in
5079 2*) if $test -d /etc/conf/kconfig.d &&
5080 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
5082 # Interactive Systems (ISC) POSIX mode.
5087 case "$gccversion" in
5090 ?*) set strict-aliasing -fno-strict-aliasing
5094 # For gcc, adding -pipe speeds up compilations for some, but apparently
5095 # some assemblers can't read from stdin. (It also slows down compilations
5096 # in other cases, but those are apparently rarer these days.) AD 5/2004.
5097 case "$gccversion" in
5103 # on x86_64 (at least) we require an extra library (libssp) in the
5104 # link command line. This library is not named, so I infer that it is
5105 # an implementation detail that may change. Hence the safest approach
5106 # is to add the flag to the flags passed to the compiler at link time,
5107 # as that way the compiler can do the right implementation dependant
5109 case "$gccversion" in
5110 ?*) set stack-protector -fstack-protector
5117 case "$mips_type" in
5118 *BSD*|'') inclwanted="$locincpth $usrinc";;
5119 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
5121 for thisincl in $inclwanted; do
5122 if $test -d $thisincl; then
5123 if $test x$thisincl != x$usrinc; then
5125 *" -I$thisincl "*);;
5126 *) dflt="$dflt -I$thisincl ";;
5132 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
5134 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5142 *) dflt="$dflt -D$2";;
5146 set signal.h LANGUAGE_C; eval $inctest
5150 ccflags="$ccflags -DSOCKS"
5155 default|recommended) dflt="$ccflags $dflt" ;;
5156 *) dflt="$ccflags";;
5165 Your C compiler may want other flags. For this question you should include
5166 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5167 but you should NOT include libraries or ld flags like -lwhatever. If you
5168 want $package to honor its debug switch, you should include -DDEBUGGING here.
5169 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5171 To use no flags, specify the word "none".
5177 rp="Any additional cc flags?"
5184 : the following weeds options from ccflags that are of no interest to cpp
5186 '') cppflags="$ccflags" ;;
5187 *) cppflags="$cppflags $ccflags" ;;
5189 case "$gccversion" in
5190 1*) cppflags="$cppflags -D__GNUC__"
5192 case "$mips_type" in
5194 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5200 echo "Let me guess what the preprocessor flags are..." >&4
5214 *) ftry="$previous $flag";;
5216 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5217 >cpp1.out 2>/dev/null && \
5218 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5219 >cpp2.out 2>/dev/null && \
5220 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5221 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5223 cppflags="$cppflags $ftry"
5233 *-*) echo "They appear to be: $cppflags";;
5235 $rm -f cpp.c cpp?.out
5239 : flags used in final linking phase
5241 '') if ./venix; then
5247 *-posix*) dflt="$dflt -posix" ;;
5250 *) dflt="$ldflags";;
5252 # See note above about -fstack-protector
5254 *-fstack-protector*)
5256 *-fstack-protector*) ;; # Don't add it again
5257 *) dflt="$dflt -fstack-protector" ;;
5262 : Try to guess additional flags to pick up local libraries.
5263 for thislibdir in $libpth; do
5264 case " $loclibpth " in
5267 *"-L$thislibdir "*) ;;
5268 *) dflt="$dflt -L$thislibdir" ;;
5280 Your C linker may need flags. For this question you should
5281 include -L/whatever and any other flags used by the C linker, but you
5282 should NOT include libraries like -lwhatever.
5284 Make sure you include the appropriate -L/path flags if your C linker
5285 does not normally search all of the directories you specified above,
5288 To use no flags, specify the word "none".
5292 rp="Any additional ld flags (NOT including libraries)?"
5298 rmlist="$rmlist pdp11"
5302 echo "Checking your choice of C compiler and flags for coherency..." >&4
5303 $cat > try.c <<'EOF'
5305 int main() { printf("Ok\n"); return(0); }
5307 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5309 $cat >try.msg <<'EOM'
5310 I've tried to compile and run the following simple program:
5313 $cat try.c >> try.msg
5315 $cat >> try.msg <<EOM
5322 and I got the following output:
5326 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5327 if $sh -c "$run ./try " >>try.msg 2>&1; then
5331 *) echo 'The program compiled OK, but produced no output.' >> try.msg
5334 cat >> try.msg <<'EOQS'
5335 If $libs contains -lsfio, and sfio is mis-configured, then it
5336 sometimes (apparently) runs and exits with a 0 status, but with no
5337 output! It may have to do with sfio's use of _exit vs. exit.
5340 rp="You have a big problem. Shall I abort Configure"
5347 echo "The program compiled OK, but exited with status $?." >>try.msg
5348 rp="You have a problem. Shall I abort Configure"
5352 echo "I can't compile the test program." >>try.msg
5353 rp="You have a BIG problem. Shall I abort Configure"
5359 case "$knowitall" in
5361 echo "(The supplied flags or libraries might be incorrect.)"
5369 *) echo "Ok. Stopping Configure." >&4
5374 n) echo "OK, that should do.";;
5376 $rm_try gcctest gcctest.out
5378 : define a shorthand compile call
5382 case "$usedevel" in $define|true|[yY]*) if $test ! -f "${mc_file}.c"; then
5383 echo "Internal Configure script bug - compiler test file ${mc_file}.c is missing. Please report this to perlbug@perl.org" >&4;
5387 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5388 : define a shorthand compile call for compilations that should be ok.
5392 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5394 : determine filename position in cpp output
5396 echo "Computing filename position in cpp output for #include directives..." >&4
5398 vos) testaccess=-e ;;
5401 echo '#include <stdio.h>' > foo.c
5404 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5405 $grep '^[ ]*#.*stdio\.h' | \
5406 while read cline; do
5409 while $test \$# -gt 0; do
5410 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5415 pos=\`expr \$pos + 1\`
5427 *) pos="${fieldn}th";;
5429 echo "Your cpp writes the filename in the $pos field of the line."
5432 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
5433 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
5436 : locate header file
5441 for usrincdir in $usrinc
5443 if test -f \$usrincdir/\$wanted; then
5444 echo "\$usrincdir/\$wanted"
5448 awkprg='{ print \$$fieldn }'
5449 echo "#include <\$wanted>" > foo\$\$.c
5450 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5451 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5452 while read cline; do
5453 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5455 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5456 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5461 # status = 0: grep returned 0 lines, case statement not executed
5462 # status = 1: headerfile found
5463 # status = 2: while loop executed, no headerfile found
5467 if test \$status -eq 1; then
5474 : define an alternate in-header-list? function
5475 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5476 cont=true; xxf="echo \"<\$1> found.\" >&4";
5477 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5478 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5480 case $# in 4) instead=instead;; *) instead="at last";; esac;
5481 while $test "$cont"; do
5483 var=$2; eval "was=\$$2";
5484 if $test "$xxx" && $test -r "$xxx";
5486 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5489 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5490 set $yyy; shift; shift; yyy=$@;
5491 case $# in 0) cont="";;
5492 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5493 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5494 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5495 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5499 do set $yyy; var=$2; eval "was=\$$2";
5500 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5501 set $yyy; shift; shift; yyy=$@;
5504 : see if stdlib is available
5505 set stdlib.h i_stdlib
5508 : check for lengths of integral types
5512 echo "Checking to see how big your integers are..." >&4
5521 printf("intsize=%d;\n", (int)sizeof(int));
5522 printf("longsize=%d;\n", (int)sizeof(long));
5523 printf("shortsize=%d;\n", (int)sizeof(short));
5528 if eval $compile_ok && $run ./try > /dev/null; then
5530 echo "Your integers are $intsize bytes long."
5531 echo "Your long integers are $longsize bytes long."
5532 echo "Your short integers are $shortsize bytes long."
5536 Help! I can't compile and run the intsize test program: please enlighten me!
5537 (This is probably a misconfiguration in your system or libraries, and
5538 you really ought to fix it. Still, I'll try anyway.)
5542 rp="What is the size of an integer (in bytes)?"
5546 rp="What is the size of a long integer (in bytes)?"
5550 rp="What is the size of a short integer (in bytes)?"
5558 : check for long long
5560 echo "Checking to see if you have long long..." >&4
5561 echo 'int main() { long long x = 7; return 0; }' > try.c
5563 if eval $compile; then
5565 echo "You have long long."
5568 echo "You do not have long long."
5574 : check for length of long long
5575 case "${d_longlong}${longlongsize}" in
5578 echo "Checking to see how big your long longs are..." >&4
5579 $cat >try.c <<'EOCP'
5583 printf("%d\n", (int)sizeof(long long));
5588 if eval $compile_ok; then
5589 longlongsize=`$run ./try`
5590 echo "Your long longs are $longlongsize bytes long."
5594 echo "(I can't seem to compile the test program. Guessing...)"
5595 rp="What is the size of a long long (in bytes)?"
5599 if $test "X$longsize" = "X$longlongsize"; then
5600 echo "(That isn't any different from an ordinary long.)"
5606 : see if inttypes.h is available
5607 : we want a real compile instead of Inhdr because some systems
5608 : have an inttypes.h which includes non-existent headers
5611 #include <inttypes.h>
5613 static int32_t foo32 = 0x12345678;
5617 if eval $compile; then
5618 echo "<inttypes.h> found." >&4
5621 echo "<inttypes.h> NOT found." >&4
5630 echo "Checking to see if you have int64_t..." >&4
5632 #include <sys/types.h>
5633 #$i_inttypes I_INTTYPES
5635 #include <inttypes.h>
5637 int main() { int64_t x = 7; }
5640 if eval $compile; then
5642 echo "You have int64_t."
5645 echo "You do not have int64_t."
5651 : Check if 64bit ints have a quad type
5653 echo "Checking which 64-bit integer type we could use..." >&4
5659 val='"unsigned int"'
5664 *) case "$longsize" in
5668 val='"unsigned long"'
5673 *) case "$d_longlong:$longlongsize" in
5678 val='"unsigned long long"'
5683 *) case "$d_int64_t" in
5702 '') echo "Alas, no 64-bit integer types in sight." >&4
5705 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5710 : Do we want 64bit support
5711 case "$uselonglong" in
5712 "$define"|true|[yY]*)
5715 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5717 use64bitint="$define"
5720 case "$use64bits" in
5721 "$define"|true|[yY]*)
5724 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5726 use64bitint="$define"
5729 case "$use64bitints" in
5730 "$define"|true|[yY]*)
5733 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5735 use64bitint="$define"
5738 case "$use64bitsint" in
5739 "$define"|true|[yY]*)
5742 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5744 use64bitint="$define"
5747 case "$uselonglongs" in
5748 "$define"|true|[yY]*)
5751 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5753 use64bitint="$define"
5756 case "$use64bitsall" in
5757 "$define"|true|[yY]*)
5760 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
5762 use64bitall="$define"
5767 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
5769 case "$use64bitall" in
5770 "$define"|true|[yY]*) use64bitint="$define" ;;
5776 You have natively 64-bit long integers.
5780 *) case "$use64bitint" in
5781 "$define"|true|[yY]*) dflt='y';;
5790 Perl can be built to take advantage of 64-bit integer types
5791 on some systems. To do so, Configure can be run with -Duse64bitint.
5792 Choosing this option will most probably introduce binary incompatibilities.
5794 If this doesn't make any sense to you, just accept the default '$dflt'.
5795 (The default has been chosen based on your configuration.)
5797 rp='Try to use 64-bit integers, if available?'
5800 [yY]*) val="$define" ;;
5808 case "$use64bitall" in
5809 "$define"|true|[yY]*) dflt='y' ;;
5810 *) case "$longsize" in
5818 You may also choose to try maximal 64-bitness. It means using as much
5819 64-bitness as possible on the platform. This in turn means even more
5820 binary incompatibilities. On the other hand, your platform may not
5821 have any more 64-bitness available than what you already have chosen.
5823 If this doesn't make any sense to you, just accept the default '$dflt'.
5824 (The default has been chosen based on your configuration.)
5826 rp='Try to use maximal 64-bit support, if available?'
5829 [yY]*) val="$define" ;;
5834 case "$use64bitall" in
5836 case "$use64bitint" in
5840 Since you have chosen a maximally 64-bit build, I'm also turning on
5841 the use of 64-bit integers.
5843 use64bitint="$define" ;;
5848 : Look for a hint-file generated 'call-back-unit'. If the
5849 : user has specified that a 64-bit perl is to be built,
5850 : we may need to set or change some other defaults.
5851 if $test -f use64bitint.cbu; then
5852 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
5855 case "$use64bitint" in
5856 "$define"|true|[yY]*)
5858 4) case "$archname64" in
5859 '') archname64=64int ;;
5866 : Look for a hint-file generated 'call-back-unit'. If the
5867 : user has specified that a maximally 64-bit perl is to be built,
5868 : we may need to set or change some other defaults.
5869 if $test -f use64bitall.cbu; then
5870 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
5873 case "$use64bitall" in
5874 "$define"|true|[yY]*)
5876 4) case "$archname64" in
5877 ''|64int) archname64=64all ;;
5884 case "$d_quad:$use64bitint" in
5888 *** You have chosen to use 64-bit integers,
5889 *** but none can be found.
5890 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
5891 *** Cannot continue, aborting.
5898 : check for length of double
5900 case "$doublesize" in
5902 echo "Checking to see how big your double precision numbers are..." >&4
5911 printf("%d\n", (int)sizeof(double));
5916 if eval $compile_ok; then
5917 doublesize=`$run ./try`
5918 echo "Your double is $doublesize bytes long."
5921 echo "(I can't seem to compile the test program. Guessing...)"
5922 rp="What is the size of a double precision number (in bytes)?"
5930 : check for long doubles
5932 echo "Checking to see if you have long double..." >&4
5933 echo 'int main() { long double x = 7.0; }' > try.c
5935 if eval $compile; then
5937 echo "You have long double."
5940 echo "You do not have long double."
5946 : check for length of long double
5947 case "${d_longdbl}${longdblsize}" in
5950 echo "Checking to see how big your long doubles are..." >&4
5951 $cat >try.c <<'EOCP'
5955 printf("%d\n", sizeof(long double));
5960 if eval $compile; then
5961 longdblsize=`$run ./try`
5962 echo "Your long doubles are $longdblsize bytes long."
5966 echo "(I can't seem to compile the test program. Guessing...)" >&4
5967 rp="What is the size of a long double (in bytes)?"
5971 if $test "X$doublesize" = "X$longdblsize"; then
5972 echo "That isn't any different from an ordinary double."
5973 echo "I'll keep your setting anyway, but you may see some"
5974 echo "harmless compilation warnings."
5980 : determine the architecture name
5982 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
5983 tarch=`arch`"-$osname"
5984 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
5985 if uname -m > tmparch 2>&1 ; then
5986 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
5987 -e 's/$/'"-$osname/" tmparch`
5995 case "$myarchname" in
5998 echo "(Your architecture name used to be $myarchname.)"
6002 case "$targetarch" in
6004 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
6009 *) dflt="$archname";;
6011 rp='What is your architecture name'
6014 case "$usethreads" in
6016 echo "Threads selected." >&4
6018 *-thread*) echo "...and architecture name already has -thread." >&4
6020 *) archname="$archname-thread"
6021 echo "...setting architecture name to $archname." >&4
6026 case "$usemultiplicity" in
6028 echo "Multiplicity selected." >&4
6030 *-multi*) echo "...and architecture name already has -multi." >&4
6032 *) archname="$archname-multi"
6033 echo "...setting architecture name to $archname." >&4
6038 case "$use64bitint$use64bitall" in
6040 case "$archname64" in
6042 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
6045 case "$use64bitint" in
6046 "$define") echo "64 bit integers selected." >&4 ;;
6048 case "$use64bitall" in
6049 "$define") echo "Maximal 64 bitness selected." >&4 ;;
6052 *-$archname64*) echo "...and architecture name already has $archname64." >&4
6054 *) archname="$archname-$archname64"
6055 echo "...setting architecture name to $archname." >&4
6061 case "$uselongdouble" in
6063 echo "Long doubles selected." >&4
6064 case "$longdblsize" in
6066 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
6070 *-ld*) echo "...and architecture name already has -ld." >&4
6072 *) archname="$archname-ld"
6073 echo "...setting architecture name to $archname." >&4
6080 if $test -f archname.cbu; then
6081 echo "Your platform has some specific hints for architecture name, using them..."
6085 : set the prefixit variable, to compute a suitable default value
6086 prefixit='case "$3" in
6088 case "$oldprefix" in
6089 "") eval "$1=\"\$$2\"";;
6096 ""|" ") eval "$1=\"\$$2\"";;
6102 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
6104 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
6105 /*-$oldprefix/*|\~*-$oldprefix/*)
6106 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
6107 *) eval "$1=\"\$$2\"";;
6111 : determine installation style
6112 : For now, try to deduce it from prefix unless it is already set.
6113 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
6114 case "$installstyle" in
6115 '') case "$prefix" in
6116 *perl*) dflt='lib';;
6117 *) dflt='lib/perl5' ;;
6120 *) dflt="$installstyle" ;;
6122 : Probably not worth prompting for this since we prompt for all
6123 : the directories individually, and the prompt would be too long and
6127 : determine where public executables go
6132 rp='Pathname where the public executables will reside?'
6134 if $test "X$ansexp" != "X$binexp"; then
6138 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6139 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
6140 : this via initialinstalllocation
6143 case "$userelocatableinc" in
6144 $define|true|[yY]*) dflt='y' ;;
6149 Would you like to build Perl so that the installation is relocatable, so that
6150 library paths in @INC are determined relative to the path of the perl binary?
6151 This is not advised for system Perl installs, or if you need to run setid
6152 scripts or scripts under taint mode.
6154 If this doesn't make any sense to you, just accept the default '$dflt'.
6156 rp='Use relocatable @INC?'
6159 y|Y) val="$define" ;;
6162 set userelocatableinc
6165 initialinstalllocation="$binexp"
6166 : Default prefix is now "up one level from where the binaries are"
6167 case "$userelocatableinc" in
6173 installprefixexp=".../.."
6177 : determine where private library files go
6178 : Usual default is /usr/local/lib/perl5/$version.
6179 : Also allow things like /opt/perl/lib/$version, since
6180 : /opt/perl/lib/perl5... would be redundant.
6181 : The default "style" setting is made in installstyle.U
6182 case "$installstyle" in
6183 *lib/perl5*) set dflt privlib lib/$package/$version ;;
6184 *) set dflt privlib lib/$version ;;
6189 There are some auxiliary files for $package that need to be put into a
6190 private library directory that is accessible by everyone.
6195 rp='Pathname where the private library files will reside?'
6200 : set the prefixup variable, to restore leading tilda escape
6201 prefixup='case "$prefixexp" in
6203 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
6206 : determine where public architecture dependent libraries go
6209 : privlib default is /usr/local/lib/$package/$version
6210 : archlib default is /usr/local/lib/$package/$version/$archname
6211 : privlib may have an optional trailing /share.
6212 tdflt=`echo $privlib | $sed 's,/share$,,'`
6213 tdflt=$tdflt/$archname
6222 $spackage contains architecture-dependent library files. If you are
6223 sharing libraries in a heterogeneous environment, you might store
6224 these files in a separate location. Otherwise, you can just include
6225 them with the rest of the public library files.
6230 rp='Where do you want to put the public architecture-dependent libraries?'
6234 if $test X"$archlib" = X"$privlib"; then
6240 : see if setuid scripts can be secure
6243 Some kernels have a bug that prevents setuid #! scripts from being
6244 secure. Some sites have disabled setuid #! scripts because of this.
6246 First let's decide if your kernel supports secure setuid #! scripts.
6247 (If setuid #! scripts would be secure but have been disabled anyway,
6248 don't say that they are secure if asked.)
6253 if $test -d /dev/fd; then
6254 echo "#!$ls" >reflect
6255 chmod +x,u+s reflect
6256 ./reflect >flect 2>&1
6257 if $contains "/dev/fd" flect >/dev/null; then
6258 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6262 If you are not sure if they are secure, I can check but I'll need a
6263 username and password different from the one you are using right now.
6264 If you don't have such a username or don't want me to test, simply
6268 rp='Other username to test security of setuid scripts with?'
6273 case "$d_suidsafe" in
6274 '') echo "I'll assume setuid scripts are *not* secure." >&4
6277 echo "Well, the $hint value is *not* secure." >&4
6279 *) echo "Well, the $hint value *is* secure." >&4
6284 $rm -f reflect flect
6285 echo "#!$ls" >reflect
6286 chmod +x,u+s reflect
6289 echo '"su" will (probably) prompt you for '"$ans's password."
6290 su $ans -c './reflect >flect'
6291 if $contains "/dev/fd" flect >/dev/null; then
6292 echo "Okay, it looks like setuid scripts are secure." >&4
6295 echo "I don't think setuid scripts are secure." >&4
6300 rp='Does your kernel have *secure* setuid scripts?'
6303 [yY]*) val="$define";;
6308 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6309 echo "(That's for file descriptors, not floppy disks.)"
6315 $rm -f reflect flect
6317 : now see if they want to do setuid emulation
6318 if $test $patchlevel -lt 11; then
6321 case "$d_suidsafe" in
6324 echo "No need to emulate SUID scripts since they are secure here." >&4
6328 Some systems have disabled setuid scripts, especially systems where
6329 setuid scripts cannot be secure. On systems where setuid scripts have
6330 been disabled, the setuid/setgid bits on scripts are currently
6331 useless. It is possible for $package to detect those bits and emulate
6332 setuid/setgid in a secure fashion. This emulation will only work if
6333 setuid scripts have been disabled in your kernel.
6337 "$define") dflt=y ;;
6340 rp="Do you want to do setuid/setgid emulation?"
6343 [yY]*) val="$define";;
6355 SUID emulation has been removed for 5.12
6356 Please re-run Configure without -Dd_dosuid
6365 : Find perl5.005 or later.
6366 echo "Looking for a previously installed perl5.005 or later... "
6368 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
6369 : Check if this perl is recent and can load a simple module
6370 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6373 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6383 '') echo "None found. That's ok.";;
6384 *) echo "Using $perl5." ;;
6387 : Set the siteprefix variables
6390 After $package is installed, you may wish to install various
6391 add-on modules and utilities. Typically, these add-ons will
6392 be installed under $prefix with the rest
6393 of this package. However, you may wish to install such add-ons
6394 elsewhere under a different prefix.
6396 If you do not wish to put everything under a single prefix, that's
6397 ok. You will be prompted for the individual locations; this siteprefix
6398 is only used to suggest the defaults.
6400 The default should be fine for most people.
6404 rp='Installation prefix to use for add-on modules and utilities?'
6405 : XXX Here might be another good place for an installstyle setting.
6406 case "$siteprefix" in
6408 *) dflt=$siteprefix ;;
6411 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6413 case "$siteprefix" in
6417 *) oldsiteprefix="$prefix";;
6422 siteprefixexp="$ansexp"
6424 : determine where site specific libraries go.
6425 : Usual default is /usr/local/lib/perl5/site_perl/$version
6426 : The default "style" setting is made in installstyle.U
6427 : XXX No longer works with Prefixit stuff.
6428 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6430 '') case "$installstyle" in
6431 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6432 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6440 The installation process will create a directory for
6441 site-specific extensions and modules. Most users find it convenient
6442 to place all site-specific files in this directory rather than in the
6443 main distribution directory.
6447 rp='Pathname for the site-specific library files?'
6451 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6453 : Determine list of previous versions to include in @INC
6454 $cat > getverlist <<EOPL
6457 \$api_versionstring = "$api_versionstring";
6458 \$version = "$version";
6459 \$stem = "$sitelib_stem";
6460 \$archname = "$archname";
6462 $cat >> getverlist <<'EOPL'
6463 # The list found is store twice for each entry: the original name, and
6464 # the binary broken down version as pack "sss", so sorting is easy and
6465 # unambiguous. This will work for all versions that have a maximum of
6466 # three digit groups, separate by '.'s or '_'s. Names are extended with
6467 # ".0.0" to ensure at least three elements for the pack.
6468 # -- H.Merijn Brand (m)'06 23-10-2006
6470 # Can't have leading @ because metaconfig interprets it as a command!
6471 ;@inc_version_list=();
6472 # XXX Redo to do opendir/readdir?
6475 ;@candidates = map {
6476 [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
6477 ;@candidates = sort { $a->[1] cmp $b->[1]} @candidates;
6483 ($pversion, $aversion, $vsn5005) = map {
6484 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
6485 foreach $d (@candidates) {
6486 if ($d->[1] lt $pversion) {
6487 if ($d->[1] ge $aversion) {
6488 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
6490 elsif ($d->[1] ge $vsn5005) {
6491 unshift(@inc_version_list, grep { -d } $d->[0]);
6495 # Skip newer version. I.e. don't look in
6496 # 5.7.0 if we're installing 5.6.1.
6500 if (@inc_version_list) {
6501 print join(' ', @inc_version_list);
6504 # Blank space to preserve value for next Configure run.
6509 case "$inc_version_list" in
6510 '') if test -x "$perl5$exe_ext"; then
6511 dflt=`$perl5 getverlist`
6516 $undef) dflt='none' ;;
6517 *) eval dflt=\"$inc_version_list\" ;;
6520 ''|' ') dflt=none ;;
6527 In order to ease the process of upgrading, this version of perl
6528 can be configured to use modules built and installed with earlier
6529 versions of perl that were installed under $prefix. Specify here
6530 the list of earlier versions that this version of perl should check.
6531 If Configure detected no earlier versions of perl installed under
6532 $prefix, then the list will be empty. Answer 'none' to tell perl
6533 to not search earlier versions.
6535 The default should almost always be sensible, so if you're not sure,
6536 just accept the default.
6539 rp='List of earlier versions to include in @INC?'
6542 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
6543 *) inc_version_list="$ans" ;;
6545 case "$inc_version_list" in
6547 inc_version_list_init='0'
6548 d_inc_version_list="$undef"
6550 *) inc_version_list_init=`echo $inc_version_list |
6551 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6552 d_inc_version_list="$define"
6557 : see if malloc/malloc.h has to be included
6558 set malloc/malloc.h i_mallocmalloc
6561 : see if this is a malloc.h system
6562 : we want a real compile instead of Inhdr because some systems have a
6563 : malloc.h that just gives a compile error saying to use stdlib.h instead
6568 #$i_mallocmalloc I_MALLOCMALLOC
6569 #ifdef I_MALLOCMALLOC
6570 # include <malloc/malloc.h>
6573 int main () { return 0; }
6576 if eval $compile; then
6577 echo "<malloc.h> found." >&4
6580 echo "<malloc.h> NOT found." >&4
6587 : check for void type
6589 echo "Checking to see how well your C compiler groks the void type..." >&4
6590 case "$voidflags" in
6602 extern void moo(); /* function returning void */
6603 void (*goo)(); /* ptr to func returning void */
6605 void *hue; /* generic ptr */
6618 int main() { sub(); }
6620 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
6621 voidflags=$defvoidused
6622 echo "Good. It appears to support void to the level $package wants.">&4
6623 if $contains warning .out >/dev/null 2>&1; then
6624 echo "However, you might get some warnings that look like this:"
6628 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
6629 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
6630 echo "It supports 1..."
6631 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
6632 echo "It also supports 2..."
6633 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
6635 echo "And it supports 4 but not 8 definitely."
6637 echo "It doesn't support 4..."
6638 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
6640 echo "But it supports 8."
6643 echo "Neither does it support 8."
6647 echo "It does not support 2..."
6648 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
6650 echo "But it supports 4 and 8."
6652 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
6654 echo "And it supports 4 but has not heard about 8."
6656 echo "However it supports 8 but not 4."
6661 echo "There is no support at all for void."
6666 case "$voidflags" in
6669 Support flag bits are:
6670 1: basic void declarations.
6671 2: arrays of pointers to functions returning void.
6672 4: operations between pointers to and addresses of void functions.
6673 8: generic void pointers.
6676 rp="Your void support flags add up to what?"
6683 : check for length of pointer
6687 echo "Checking to see how big your pointers are..." >&4
6688 if test "$voidflags" -gt 7; then
6689 echo '#define VOID_PTR char *' > try.c
6691 echo '#define VOID_PTR void *' > try.c
6701 printf("%d\n", (int)sizeof(VOID_PTR));
6706 if eval $compile_ok; then
6707 ptrsize=`$run ./try`
6708 echo "Your pointers are $ptrsize bytes long."
6711 echo "(I can't seem to compile the test program. Guessing...)" >&4
6712 rp="What is the size of a pointer (in bytes)?"
6719 case "$use64bitall" in
6720 "$define"|true|[yY]*)
6724 *** You have chosen a maximally 64-bit build,
6725 *** but your pointers are only 4 bytes wide.
6726 *** Please rerun Configure without -Duse64bitall.
6731 *** Since you have quads, you could possibly try with -Duse64bitint.
6736 *** Cannot continue, aborting.
6747 : determine whether to use malloc wrapping
6749 case "$usemallocwrap" in
6750 [yY]*|true|$define) dflt='y' ;;
6751 [nN]*|false|$undef) dflt='n' ;;
6752 *) case "$usedevel" in
6753 [yY]*|true|$define) dflt='y' ;;
6758 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
6760 usemallocwrap="$ans"
6763 usemallocwrap="$define" ;;
6765 usemallocwrap="$undef" ;;
6768 : determine which malloc to compile in
6770 case "$usemymalloc" in
6771 [yY]*|true|$define) dflt='y' ;;
6772 [nN]*|false|$undef) dflt='n' ;;
6773 *) case "$ptrsize" in
6779 rp="Do you wish to attempt to use the malloc that comes with $package?"
6785 mallocsrc='malloc.c'
6786 mallocobj="malloc$_o"
6787 d_mymalloc="$define"
6790 : Remove malloc from list of libraries to use
6791 echo "Removing unneeded -lmalloc from library list" >&4
6792 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6795 echo "libs = $libs" >&4
6807 : compute the return types of malloc and free
6809 $cat >malloc.c <<END
6813 #include <sys/types.h>
6827 case "$malloctype" in
6829 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6836 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6840 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6847 echo "Your system uses $freetype free(), it would seem." >&4
6849 : determine where site specific architecture-dependent libraries go.
6850 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6851 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6852 : sitelib may have an optional trailing /share.
6854 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6855 dflt="$dflt/$archname"
6860 set sitearch sitearch none
6864 The installation process will also create a directory for
6865 architecture-dependent site-specific extensions and modules.
6869 rp='Pathname for the site-specific architecture-dependent library files?'
6873 if $test X"$sitearch" = X"$sitelib"; then
6876 d_sitearch="$define"
6879 : Set the vendorprefix variables
6882 The installation process will also create a directory for
6883 vendor-supplied add-ons. Vendors who supply perl with their system
6884 may find it convenient to place all vendor-supplied files in this
6885 directory rather than in the main distribution directory. This will
6886 ease upgrades between binary-compatible maintenance versions of perl.
6888 Of course you may also use these directories in whatever way you see
6889 fit. For example, you might use them to access modules shared over a
6890 company-wide network.
6892 The default answer should be fine for most people.
6893 This causes further questions about vendor add-ons to be skipped
6894 and no vendor-specific directories will be configured for perl.
6897 rp='Do you want to configure vendor-specific add-on directories?'
6898 case "$usevendorprefix" in
6899 define|true|[yY]*) dflt=y ;;
6900 *) : User may have set vendorprefix directly on Configure command line.
6901 case "$vendorprefix" in
6910 rp='Installation prefix to use for vendor-supplied add-ons?'
6911 case "$vendorprefix" in
6913 *) dflt=$vendorprefix ;;
6916 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6918 case "$vendorprefix" in
6922 *) oldvendorprefix="$prefix";;
6926 usevendorprefix="$define"
6928 vendorprefixexp="$ansexp"
6930 *) usevendorprefix="$undef"
6936 : Set the vendorlib variables
6937 case "$vendorprefix" in
6938 '') d_vendorlib="$undef"
6942 *) d_vendorlib="$define"
6943 : determine where vendor-supplied modules go.
6944 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
6945 case "$vendorlib" in
6947 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6948 case "$installstyle" in
6949 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
6950 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
6953 *) dflt="$vendorlib"
6957 rp='Pathname for the vendor-supplied library files?'
6960 vendorlibexp="$ansexp"
6963 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
6967 : Set the vendorarch variables
6968 case "$vendorprefix" in
6969 '') d_vendorarch="$undef"
6973 *) d_vendorarch="$define"
6974 : determine where vendor-supplied architecture-dependent libraries go.
6975 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
6976 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
6977 : vendorlib may have an optional trailing /share.
6978 case "$vendorarch" in
6979 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
6980 dflt="$dflt/$archname"
6982 *) dflt="$vendorarch" ;;
6985 rp='Pathname for vendor-supplied architecture-dependent files?'
6988 vendorarchexp="$ansexp"
6991 prefixvar=vendorarch
6993 if $test X"$vendorarch" = X"$vendorlib"; then
6994 d_vendorarch="$undef"
6996 d_vendorarch="$define"
6999 : Final catch-all directories to search
7002 Lastly, you can have perl look in other directories for extensions and
7003 modules in addition to those already specified.
7004 These directories will be searched after
7008 test X"$vendorlib" != "X" && echo ' ' $vendorlib
7009 test X"$vendorarch" != "X" && echo ' ' $vendorarch
7011 case "$otherlibdirs" in
7012 ''|' ') dflt='none' ;;
7013 *) dflt="$otherlibdirs" ;;
7016 Enter a colon-separated set of extra paths to include in perl's @INC
7017 search path, or enter 'none' for no extra paths.
7021 rp='Colon-separated list of additional directories for perl to search?'
7024 ' '|''|none) otherlibdirs=' ' ;;
7025 *) otherlibdirs="$ans" ;;
7027 case "$otherlibdirs" in
7031 set d_perl_otherlibdirs
7034 : Cruising for prototypes
7036 echo "Checking out function prototypes..." >&4
7037 $cat >prototype.c <<EOCP
7042 int main(int argc, char *argv[]) {
7045 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
7046 echo "Your C compiler appears to support function prototypes."
7049 echo "Your C compiler doesn't seem to understand function prototypes."
7056 : Check if ansi2knr is required
7057 case "$prototype" in
7059 *) ansi2knr='ansi2knr'
7064 This version of $package can only be compiled by a compiler that
7065 understands function prototypes. Unfortunately, your C compiler
7067 doesn't seem to understand them. Sorry about that.
7069 If GNU cc is available for your system, perhaps you could try that instead.
7071 Eventually, we hope to support building Perl with pre-ANSI compilers.
7072 If you would like to help in that effort, please contact <perlbug@perl.org>.
7074 Aborting Configure now.
7081 dflt_dtrace='/usr/sbin/dtrace'
7082 $test -x /usr/bin/dtrace && dflt_dtrace='/usr/bin/dtrace'
7086 Perl can be built to support DTrace on platforms that support it.
7087 DTrace is a diagnosis and performance analysis tool from Sun.
7089 If this doesn't make any sense to you, just accept the default '$dflt'.
7093 case "$usedtrace" in
7099 dflt_dtrace=$usedtrace
7106 rp='Support DTrace if available?'
7109 y|Y) val="$define" ;;
7115 test "X$usedtrace" != "X$define" && break
7118 rp='Where is the dtrace executable?'
7127 if $dtrace -h -s ../perldtrace.d \
7128 -o perldtrace.tmp >/dev/null 2>&1 \
7129 && rm -f perldtrace.tmp
7132 echo "Good: your $dtrace knows about the -h flag."
7136 *** $me: Fatal Error: $dtrace doesn't support -h flag
7138 *** Your installed dtrace doesn't support the -h switch to compile a D
7139 *** program into a C header. Can't continue.
7151 *** $me: Fatal Error: $dtrace not found.
7158 echo "*** $dtrace was not found."
7164 : See if we want extra modules installed
7171 Perl can be built with extra modules or bundles of modules which
7172 will be fetched from the CPAN and installed alongside Perl.
7174 Notice that you will need access to the CPAN; either via the Internet,
7175 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
7176 be asked later to configure the CPAN.pm module which will in turn do
7177 the installation of the rest of the extra modules or bundles.)
7179 Notice also that if the modules require any external software such as
7180 libraries and headers (the libz library and the zlib.h header for the
7181 Compress::Zlib module, for example) you MUST have any such software
7182 already installed, this configuration process will NOT install such
7185 If this doesn't make any sense to you, just accept the default '$dflt'.
7187 rp='Install any extra modules (y or n)?'
7193 Please list any extra modules or bundles to be installed from CPAN,
7194 with spaces between the names. The names can be in any format the
7195 'install' command of CPAN.pm will understand. (Answer 'none',
7196 without the quotes, to install no extra modules or bundles.)
7206 $rm -f ../extras.lst
7208 *) echo "(Saving the list of extras for later...)"
7209 echo "$extras" > ../extras.lst
7217 : determine where html pages for programs go
7218 set html1dir html1dir none
7222 If you wish to install html files for programs in $spackage, indicate
7223 the appropriate directory here. To skip installing html files,
7227 ''|none|$undef|' ') dflt=none ;;
7228 *) dflt=$html1dir ;;
7231 rp="Directory for the main $spackage html pages?"
7235 : Use ' ' for none so value is preserved next time through Configure
7236 $test X"$html1dir" = "X" && html1dir=' '
7238 : determine where html pages for libraries and modules go
7239 set html3dir html3dir none
7243 If you wish to install html files for modules associated with $spackage,
7244 indicate the appropriate directory here. To skip installing html files,
7247 : There is no obvious default. If they have specified html1dir, then
7248 : try to key off that, possibly changing .../html1 into .../html3.
7250 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
7251 *) dflt=$html3dir ;;
7254 rp="Directory for the $spackage module html pages?"
7258 : Use ' ' for none so value is preserved next time through Configure
7259 $test X"$html3dir" = "X" && html3dir=' '
7261 : determine whether to install perl also as /usr/bin/perl
7264 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
7266 Many scripts expect perl to be installed as /usr/bin/perl.
7268 If you want to, I can install the perl you are about to compile
7269 as /usr/bin/perl (in addition to $bin/perl).
7271 if test -f /usr/bin/perl; then
7274 However, please note that because you already have a /usr/bin/perl,
7275 overwriting that with a new Perl would very probably cause problems.
7276 Therefore I'm assuming you don't want to do that (unless you insist).
7279 case "$installusrbinperl" in
7280 "$define"|[yY]*) dflt='y';;
7286 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
7289 case "$installusrbinperl" in
7290 "$undef"|[nN]*) dflt='n';;
7294 rp="Do you want to install perl as /usr/bin/perl?"
7297 [yY]*) val="$define";;
7303 set installusrbinperl
7306 : Check if we are using the GNU C library
7308 echo "Checking for GNU C Library..." >&4
7310 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
7311 alone are insufficient to distinguish different versions, such as
7312 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
7313 libc version 2.1.0. A. Dougherty, June 3, 2002.
7319 # ifdef __GLIBC_MINOR__
7320 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
7321 # include <gnu/libc-version.h>
7322 printf("%s\n", gnu_get_libc_version());
7324 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
7327 printf("%d\n", __GLIBC__);
7336 if eval $compile_ok && $run ./try > glibc.ver; then
7338 gnulibc_version=`$cat glibc.ver`
7339 echo "You are using the GNU C Library version $gnulibc_version"
7343 echo "You are not using the GNU C Library"
7349 : see if nm is to be used to determine whether a symbol is defined or not
7353 case "$d_gnulibc" in
7356 echo "nm probably won't work on the GNU C Library." >&4
7362 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
7364 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
7365 echo "'nm' won't be sufficient on this sytem." >&4
7371 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
7372 if $test $dflt -gt 20; then
7382 true|$define) dflt=y;;
7389 I can use $nm to extract the symbols from your C libraries. This
7390 is a time consuming task which may generate huge output on the disk (up
7391 to 3 megabytes) but that should make the symbols extraction faster. The
7392 alternative is to skip the 'nm' extraction part and to compile a small
7393 test program instead to determine whether each symbol is present. If
7394 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
7395 this may be the best solution.
7397 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
7400 rp="Shall I use $nm to extract C symbols from the libraries?"
7403 [Nn]*) usenm=false;;
7412 : nm options which may be necessary
7414 '') if $test -f /mach_boot; then
7416 elif $test -d /usr/ccs/lib; then
7417 nm_opt='-p' # Solaris (and SunOS?)
7418 elif $test -f /dgux; then
7420 elif $test -f /lib64/rld; then
7421 nm_opt='-p' # 64-bit Irix
7427 : nm options which may be necessary for shared libraries but illegal
7428 : for archive libraries. Thank you, Linux.
7429 case "$nm_so_opt" in
7430 '') case "$myuname" in
7432 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
7433 nm_so_opt='--dynamic'
7440 : Figure out where the libc is located
7443 : get list of predefined functions in a handy place
7448 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
7454 *) for thislib in $libs; do
7457 : Handle C library specially below.
7460 thislib=`echo $thislib | $sed -e 's/^-l//'`
7461 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
7463 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
7465 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
7467 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
7469 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
7471 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
7473 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
7478 libnames="$libnames $try"
7480 *) libnames="$libnames $thislib" ;;
7489 for xxx in $libpth; do
7490 $test -r $1 || set $xxx/libc.$so
7491 : The messy sed command sorts on library version numbers.
7493 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
7494 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
7496 s/[0-9][0-9]*/0000&/g
7497 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
7500 $sort | $sed -e 's/^.* //'`
7503 $test -r $1 || set /usr/ccs/lib/libc.$so
7504 $test -r $1 || set /lib/libsys_s$_a
7510 if $test -r "$1"; then
7511 echo "Your (shared) C library seems to be in $1."
7513 elif $test -r /lib/libc && $test -r /lib/clib; then
7514 echo "Your C library seems to be in both /lib/clib and /lib/libc."
7516 libc='/lib/clib /lib/libc'
7517 if $test -r /lib/syslib; then
7518 echo "(Your math library is in /lib/syslib.)"
7519 libc="$libc /lib/syslib"
7521 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7522 echo "Your C library seems to be in $libc, as you said before."
7523 elif $test -r $incpath/usr/lib/libc$_a; then
7524 libc=$incpath/usr/lib/libc$_a;
7525 echo "Your C library seems to be in $libc. That's fine."
7526 elif $test -r /lib/libc$_a; then
7528 echo "Your C library seems to be in $libc. You're normal."
7530 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
7532 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
7533 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
7534 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
7536 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7538 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7541 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
7543 if $test -r "$tans"; then
7544 echo "Your C library seems to be in $tans, of all places."
7550 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7554 If the guess above is wrong (which it might be if you're using a strange
7555 compiler, or your machine supports multiple models), you can override it here.
7560 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
7562 I can't seem to find your C library. I've looked in the following places:
7565 $sed 's/^/ /' libpath
7568 None of these seems to contain your C library. I need to get its name...
7573 rp='Where is your C library?'
7578 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
7579 set X `cat libnames`
7582 case $# in 1) xxx=file; esac
7583 echo "Extracting names from the following $xxx for later perusal:" >&4
7585 $sed 's/^/ /' libnames >&4
7587 $echo $n "This may take a while...$c" >&4
7591 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
7592 *) $nm $nm_opt $file 2>/dev/null;;
7597 $grep fprintf libc.tmp > libc.ptf
7598 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
7599 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
7601 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
7603 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7605 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
7607 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7609 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
7611 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7613 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
7615 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7617 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
7619 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7621 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
7623 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7625 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
7626 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
7628 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7630 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
7632 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7634 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
7636 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7638 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
7640 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7642 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
7644 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7646 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
7648 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7650 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
7652 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7654 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
7656 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7659 $nm -p $* 2>/dev/null >libc.tmp
7660 $grep fprintf libc.tmp > libc.ptf
7661 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
7662 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
7668 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
7670 if $ar t $libc > libc.tmp && \
7671 $contains '^fprintf$' libc.tmp >/dev/null 2>&1
7673 for thisname in $libnames $libc; do
7674 $ar t $thisname >>libc.tmp
7676 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
7678 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
7679 for thisname in $libnames $libc; do
7680 $ar tv $thisname >>libc.tmp
7681 emximp -o tmp.imp $thisname \
7683 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
7684 < tmp.imp >>libc.tmp
7687 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
7690 echo "$ar didn't seem to work right." >&4
7691 echo "Maybe this is a Cray...trying bld instead..." >&4
7693 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list &&
7696 for thisname in $libnames; do
7698 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
7699 $ar t $thisname >>libc.tmp
7703 echo "That didn't work either. Giving up." >&4
7713 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
7714 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
7716 *) if $test -f /lib/syscalls.exp; then
7718 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
7719 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' \
7720 /lib/syscalls.exp >>libc.list
7726 $rm -f libnames libpath
7728 : see if dld is available
7732 : Check if we are using C++
7734 echo "Checking for C++..." >&4
7735 $cat >try.c <<'EOCP'
7747 if eval $compile_ok && $run ./try; then
7749 echo "You are using a C++ compiler."
7752 echo "You are not using a C++ compiler."
7758 : is a C symbol defined?
7761 -v) tf=libc.tmp; tdc="";;
7762 -a) tf=libc.tmp; tdc="[]";;
7763 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
7765 case "$d_cplusplus" in
7766 $define) extern_C="extern \"C\"" ;;
7767 *) extern_C="extern" ;;
7770 case "$reuseval-$4" in
7772 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
7777 if $test "$runnm" = true; then
7778 if $contains $tlook $tf >/dev/null 2>&1; then
7780 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
7781 echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7782 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
7783 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
7787 echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7788 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
7794 $define) tval=true;;
7801 : define an is-in-libc? function
7802 inlibc='echo " "; td=$define; tu=$undef;
7803 sym=$1; var=$2; eval "was=\$$2";
7805 case "$reuseval$was" in
7815 echo "$sym() found." >&4;
7816 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
7818 echo "$sym() NOT found." >&4;
7819 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
7823 $define) echo "$sym() found." >&4;;
7824 *) echo "$sym() NOT found." >&4;;
7828 : see if dlopen exists
7830 xxx_ccflags="$ccflags"
7832 : with g++ one needs -shared to get is-in-libc to work for dlopen
7833 case "$gccversion" in
7835 *) case "$d_cplusplus" in
7836 "$define") ccflags="$ccflags -shared" ;;
7843 ccflags="$xxx_ccflags"
7845 : see if this is a unistd.h system
7846 set unistd.h i_unistd
7849 : determine which dynamic loading, if any, to compile in
7851 dldir="ext/DynaLoader"
7864 $define) dflt='y' ;;
7867 $define) dflt='y' ;;
7869 : Does a dl_xxx.xs file exist for this operating system
7870 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
7873 rp="Do you wish to use dynamic loading?"
7881 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
7882 dflt="$dldir/dl_${osname}.xs"
7883 elif $test "$d_dlopen" = "$define" ; then
7884 dflt="$dldir/dl_dlopen.xs"
7885 elif $test "$i_dld" = "$define" ; then
7886 dflt="$dldir/dl_dld.xs"
7891 *) dflt="$dldir/$dlsrc"
7894 echo "The following dynamic loading files are available:"
7895 : Can not go over to $dldir because getfile has path hard-coded in.
7896 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
7897 rp="Source file to use for dynamic loading"
7903 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
7907 Some systems may require passing special flags to $cc -c to
7908 compile modules that will be used to create a shared library.
7909 To use no flags, say "none".
7912 case "$cccdlflags" in
7913 '') case "$gccversion" in
7914 '') case "$osname" in
7916 next) dflt='none' ;;
7917 irix*) dflt='-KPIC' ;;
7918 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
7919 sunos) dflt='-pic' ;;
7923 *) case "$osname" in
7924 darwin) dflt='none' ;;
7925 linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
7930 *) dflt="$cccdlflags" ;;
7932 rp="Any special flags to pass to $cc -c to compile shared library modules?"
7935 none) cccdlflags=' ' ;;
7936 *) cccdlflags="$ans" ;;
7941 Some systems use ld to create libraries that can be dynamically loaded,
7942 while other systems (such as those using ELF) use $cc.
7946 '') $cat >try.c <<EOM
7947 /* Test for whether ELF binaries are produced */
7959 int i = open("a.out",O_RDONLY);
7962 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
7963 exit(0); /* succeed (yes, it's ELF) */
7968 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
7970 You appear to have ELF support. I'll use $cc to build dynamic libraries.
7975 echo "I'll use ld to build dynamic libraries."
7984 rp="What command should be used to create dynamic libraries?"
7990 Some systems may require passing special flags to $ld to create a
7991 library that can be dynamically loaded. If your ld flags include
7992 -L/other/path options to locate libraries outside your loader's normal
7993 search path, you may need to specify those -L options here as well. To
7994 use no flags, say "none".
7997 case "$lddlflags" in
7998 '') case "$osname" in
7999 beos) dflt='-nostart' ;;
8000 haiku) dflt='-shared' ;;
8002 case "$gccversion" in
8003 '') dflt="$dflt +vnocompatwarnings" ;;
8006 linux|irix*|gnu*) dflt="-shared $optimize" ;;
8007 next) dflt='none' ;;
8008 solaris) dflt='-G' ;;
8009 sunos) dflt='-assert nodefinitions' ;;
8010 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
8014 *) dflt="$lddlflags" ;;
8017 : Try to guess additional flags to pick up local libraries.
8018 : Be careful not to append to a plain 'none'
8022 for thisflag in $ldflags; do
8027 *) dflt="$dflt $thisflag" ;;
8034 ''|' ') dflt='none' ;;
8038 *-fstack-protector*)
8040 *-fstack-protector*) ;; # Don't add it again
8041 *) dflt="$dflt -fstack-protector" ;;
8047 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
8050 none) lddlflags=' ' ;;
8051 *) lddlflags="$ans" ;;
8056 Some systems may require passing special flags to $cc to indicate that
8057 the resulting executable will use dynamic linking. To use no flags,
8061 case "$ccdlflags" in
8062 '') case "$osname" in
8063 linux|hpux|gnu*) dflt='-Wl,-E' ;;
8064 next|sunos) dflt='none' ;;
8068 *) dflt="$ccdlflags" ;;
8070 rp="Any special flags to pass to $cc to use dynamic linking?"
8073 none) ccdlflags=' ' ;;
8074 *) ccdlflags="$ans" ;;
8085 : Do we want a shared libperl?
8089 # No dynamic loading being used, so don't bother even to prompt.
8092 *) case "$useshrplib" in
8093 '') case "$osname" in
8094 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|haiku|cygwin*)
8096 also='Building a shared libperl is required for dynamic loading to work on your system.'
8101 also='Building a shared libperl is needed for MAB support.'
8119 The perl executable is normally obtained by linking perlmain.c with
8120 libperl${_a}, any static extensions (usually just DynaLoader), and
8121 any other libraries needed on this system (such as -lm, etc.). Since
8122 your system supports dynamic loading, it is probably possible to build
8123 a shared libperl.$so. If you will have more than one executable linked
8124 to libperl.$so, this will significantly reduce the size of each
8125 executable, but it may have a noticeable effect on performance. The
8126 default is probably sensible for your system.
8130 rp="Build a shared libperl.$so (y/n)"
8134 useshrplib='true' ;;
8135 *) useshrplib='false' ;;
8140 case "$useshrplib" in
8142 case "$userelocatableinc" in
8144 echo "Cannot build with both -Duserelocatableinc and -Duseshrplib" >&4
8145 echo "See INSTALL for an explanation why that won't work." >&4
8151 # Figure out a good name for libperl.so. Since it gets stored in
8152 # a version-specific architecture-dependent library, the version
8153 # number isn't really that important, except for making cc/ld happy.
8155 # A name such as libperl.so.10.1
8156 majmin="libperl.$so.$patchlevel.$subversion"
8157 # A name such as libperl.so.100
8158 majonly=`echo $patchlevel $subversion |
8159 $awk '{printf "%d%02d", $1, $2}'`
8160 majonly=libperl.$so.$majonly
8161 # I'd prefer to keep the os-specific stuff here to a minimum, and
8162 # rely on figuring it out from the naming of libc.
8163 case "${osname}${osvers}" in
8166 # XXX How handle the --version stuff for MAB?
8168 linux*|gnu*) # ld won't link with a bare -lperl otherwise.
8171 cygwin*) # ld links now against the dll directly
8172 majmin="cygperl5_${patchlevel}_${subversion}.${so}"
8173 majonly=`echo $patchlevel $subversion |
8174 $awk '{printf "%03d%03d", $1, $2}'`
8175 majonly=cygperl5.$majonly.$so
8178 *) # Try to guess based on whether libc has major.minor.
8180 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8181 *libc.$so.[0-9]*) dflt=$majonly ;;
8182 *) dflt=libperl.$so ;;
8192 I need to select a good name for the shared libperl. If your system uses
8193 library names with major and minor numbers, then you might want something
8194 like $majmin. Alternatively, if your system uses a single version
8195 number for shared libraries, then you might want to use $majonly.
8196 Or, your system might be quite happy with a simple libperl.$so.
8198 Since the shared libperl will get installed into a version-specific
8199 architecture-dependent directory, the version number of the shared perl
8200 library probably isn't important, so the default should be o.k.
8203 rp='What name do you want to give to the shared libperl?'
8206 echo "Ok, I'll use $libperl"
8209 libperl="libperl${_a}"
8213 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8217 WARNING: Use of the shrpdir variable for the installation location of
8218 the shared $libperl is not supported. It was never documented and
8219 will not work in this version. Let me (perlbug@perl.org)
8220 know of any problems this may cause.
8226 But your current setting of $shrpdir is
8227 the default anyway, so it's harmless.
8232 Further, your current attempted setting of $shrpdir
8233 conflicts with the value of $archlibexp/CORE
8234 that installperl will use.
8241 # How will the perl executable find the installed shared $libperl?
8242 # Add $xxx to ccdlflags.
8243 # If we can't figure out a command-line option, use $shrpenv to
8244 # set env LD_RUN_PATH. The main perl makefile uses this.
8245 shrpdir=$archlibexp/CORE
8248 if "$useshrplib"; then
8251 # We'll set it in Makefile.SH...
8256 freebsd|mirbsd|netbsd|openbsd|interix|dragonfly)
8257 xxx="-Wl,-R$shrpdir"
8259 bsdos|linux|irix*|dec_osf|gnu*)
8260 xxx="-Wl,-rpath,$shrpdir"
8263 # next doesn't like the default...
8266 # beos doesn't like the default, either.
8269 # Haiku doesn't like the default, either.
8272 # hpux doesn't like the default, either.
8273 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8276 # cygwin needs only ldlibpth
8279 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8285 # Only add $xxx if it isn't already in ccdlflags.
8286 case " $ccdlflags " in
8288 *) ccdlflags="$ccdlflags $xxx"
8291 Adding $xxx to the flags
8292 passed to $ld so that the perl executable will find the
8293 installed shared $libperl.
8301 # Fix ccdlflags in AIX for building external extensions.
8302 # (For building Perl itself bare -bE:perl.exp is needed,
8303 # Makefile.SH takes care of this.)
8305 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8307 # Respect a hint or command-line value.
8309 '') shrpenv="$tmp_shrpenv" ;;
8311 case "$ldlibpthname" in
8312 '') ldlibpthname=LD_LIBRARY_PATH ;;
8313 none) ldlibpthname='' ;;
8316 : determine where manual pages are on this system
8320 syspath='/usr/share/man/man1 /usr/man/man1'
8321 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8322 syspath="$syspath /usr/man/u_man/man1"
8323 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8324 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8325 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8326 sysman=`./loc . /usr/man/man1 $syspath`
8329 if $test -d "$sysman"; then
8330 echo "System manual is in $sysman." >&4
8332 echo "Could not find manual pages in source form." >&4
8335 : determine where manual pages go
8336 set man1dir man1dir none
8340 $spackage has manual pages available in source form.
8344 echo "However, you don't have nroff, so they're probably useless to you."
8346 '') man1dir="none";;
8349 echo "If you don't want the manual sources installed, answer 'none'."
8354 lookpath="$prefixexp/share/man/man1"
8355 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8356 lookpath="$lookpath $prefixexp/man/p_man/man1"
8357 lookpath="$lookpath $prefixexp/man/u_man/man1"
8358 lookpath="$lookpath $prefixexp/man/man.1"
8360 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8361 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8371 rp="Where do the main $spackage manual pages (source) go?"
8373 if $test "X$man1direxp" != "X$ansexp"; then
8384 : What suffix to use on installed man pages
8391 rp="What suffix should be used for the main $spackage man pages?"
8393 '') case "$man1dir" in
8407 *) dflt="$man1ext";;
8414 : see if we can have long filenames
8416 first=123456789abcdef
8418 if (echo hi >$first) 2>/dev/null; then
8419 if $test -f 123456789abcde; then
8420 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8423 echo 'You can have filenames longer than 14 characters.'>&4
8428 You can't have filenames longer than 14 chars.
8429 You can't even think about them!
8435 $rm -rf 123456789abcde*
8437 : determine where library module manual pages go
8438 set man3dir man3dir none
8442 $spackage has manual pages for many of the library modules.
8448 However, you don't have nroff, so they're probably useless to you.
8451 '') man3dir="none";;
8455 case "$d_flexfnam" in
8458 However, your system can't handle the long file names like File::Basename.3.
8461 '') man3dir="none";;
8465 echo "If you don't want the manual sources installed, answer 'none'."
8466 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8468 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8469 if $test -d "$privlib/man/man3"; then
8472 WARNING: Previous versions of perl installed man3 pages into
8473 $privlib/man/man3. This version will suggest a
8474 new default of $dflt.
8478 rp='Do you wish to preserve the old behavior?(y/n)'
8481 y*) dflt="$privlib/man/man3" ;;
8486 *) dflt="$man3dir" ;;
8493 rp="Where do the $package library man pages (source) go?"
8503 : What suffix to use on installed man pages
8509 rp="What suffix should be used for the $package library man pages?"
8511 '') case "$man3dir" in
8525 *) dflt="$man3ext";;
8532 : see if we have to deal with yellow pages, now NIS.
8533 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8534 if $test -f /usr/etc/nibindd; then
8536 echo "I'm fairly confident you're on a NeXT."
8538 rp='Do you get the hosts file via NetInfo?'
8547 y*) hostcat='nidump hosts .';;
8548 *) case "$hostcat" in
8549 nidump*) hostcat='';;
8559 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8567 rp='Are you getting the hosts file via yellow pages?'
8570 y*) hostcat='ypcat hosts';;
8571 *) hostcat='cat /etc/hosts';;
8577 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8580 '') test -f /etc/group && groupcat='cat /etc/group';;
8583 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8586 : now get the host name
8588 echo "Figuring out host name..." >&4
8589 case "$myhostname" in
8591 echo 'Maybe "hostname" will work...'
8592 if tans=`sh -c hostname 2>&1` ; then
8600 if $test "$cont"; then
8602 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8603 if tans=`cat /etc/systemid 2>&1` ; then
8605 phostname='cat /etc/systemid'
8606 echo "Whadyaknow. Xenix always was a bit strange..."
8609 elif $test -r /etc/systemid; then
8610 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8613 if $test "$cont"; then
8614 echo 'No, maybe "uuname -l" will work...'
8615 if tans=`sh -c 'uuname -l' 2>&1` ; then
8617 phostname='uuname -l'
8619 echo 'Strange. Maybe "uname -n" will work...'
8620 if tans=`sh -c 'uname -n' 2>&1` ; then
8622 phostname='uname -n'
8624 echo 'Oh well, maybe I can mine it out of whoami.h...'
8625 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8626 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8627 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8629 case "$myhostname" in
8630 '') echo "Does this machine have an identity crisis or something?"
8633 echo "Well, you said $myhostname before..."
8634 phostname='echo $myhostname';;
8640 case "$myhostname" in
8641 '') myhostname=noname ;;
8643 : you do not want to know about this
8648 if $test "$myhostname" ; then
8650 rp='Your host name appears to be "'$myhostname'".'" Right?"
8658 : bad guess or no guess
8659 while $test "X$myhostname" = X ; do
8661 rp="Please type the (one word) name of your host:"
8666 : translate upper to lower if necessary
8667 case "$myhostname" in
8669 echo "(Normalizing case in your host name)"
8670 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8674 case "$myhostname" in
8676 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8677 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8678 echo "(Trimming domain name from host name--host name is now $myhostname)"
8680 *) case "$mydomain" in
8683 test "X$hostcat" = "Xypcat hosts" &&
8684 ypmatch "$myhostname" hosts 2>/dev/null |\
8685 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8688 test "X$hostcat" != "X" &&
8689 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8690 /[ ]$myhostname[ . ]/p" > hosts
8693 if $test -f hosts; then
8694 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8695 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8696 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8697 hosts | $sort | $uniq | \
8698 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8699 case `$echo X$dflt` in
8700 X*\ *) echo "(Several hosts in the database matched hostname)"
8703 X.) echo "(You do not have fully-qualified names in the hosts database)"
8707 echo "(I cannot locate a hosts database anywhere)"
8712 tans=`./loc resolv.conf X /etc /usr/etc`
8713 if $test -f "$tans"; then
8714 echo "(Attempting domain name extraction from $tans)"
8715 dflt=.`$sed -n -e 's/ / /g' \
8716 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8719 .) dflt=.`$sed -n -e 's/ / /g' \
8720 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8728 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8729 dflt=.`sh -c domainname 2>/dev/null`
8732 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8736 case "$dflt$osname" in
8737 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
8738 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
8742 .) echo "(Lost all hope -- silly guess then)"
8748 *) dflt="$mydomain";;
8752 rp="What is your domain name?"
8762 : translate upper to lower if necessary
8765 echo "(Normalizing case in your domain name)"
8766 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
8770 : a little sanity check here
8771 case "$phostname" in
8774 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
8775 $myhostname$mydomain|$myhostname) ;;
8777 case "$phostname" in
8779 echo "(That doesn't agree with your whoami.h file, by the way.)"
8782 echo "(That doesn't agree with your $phostname command, by the way.)"
8790 : determine the e-mail address of the user who is running us
8793 I need to get your e-mail address in Internet format if possible, i.e.
8794 something like user@host.domain. Please answer accurately since I have
8795 no easy means to double check it. The default value provided below
8796 is most probably close to reality but may not be valid from outside
8797 your organization...
8801 while test "$cont"; do
8803 '') dflt="$cf_by@$myhostname$mydomain";;
8804 *) dflt="$cf_email";;
8806 rp='What is your e-mail address?'
8812 rp='Address does not look like an Internet one. Use it anyway?'
8826 : Ask e-mail of administrator
8829 If you or somebody else will be maintaining perl at your site, please
8830 fill in the correct e-mail address here so that they may be contacted
8831 if necessary. Currently, the "perlbug" program included with perl
8832 will send mail to this address in addition to perlbug@perl.org. You may
8833 enter "none" for no administrator.
8836 case "$perladmin" in
8837 '') dflt="$cf_email";;
8838 *) dflt="$perladmin";;
8840 rp='Perl administrator e-mail address'
8844 : determine whether to only install version-specific parts.
8847 Do you want to install only the version-specific parts of the perl
8848 distribution? Usually you do *not* want to do this.
8850 case "$versiononly" in
8851 "$define"|[Yy]*|true) dflt='y' ;;
8854 rp="Do you want to install only the version-specific parts of perl?"
8857 [yY]*) val="$define";;
8863 case "$versiononly" in
8864 "$define") inc_version_list=''
8865 inc_version_list_init=0
8869 : figure out how to guarantee perl startup
8870 : XXX Note that this currently takes advantage of the bug that binexp ignores
8871 : the Configure -Dinstallprefix setting, which in turn means that under
8872 : relocatable @INC, initialinstalllocation is what binexp started as.
8873 case "$startperl" in
8875 case "$sharpbang" in
8879 I can use the #! construct to start perl on your system. This will
8880 make startup of perl scripts faster, but may cause problems if you
8881 want to share those scripts and perl is not in a standard place
8882 ($initialinstalllocation/perl) on all your platforms. The alternative
8883 is to force a shell by starting the script with a single ':' character.
8886 case "$versiononly" in
8887 "$define") dflt="$initialinstalllocation/perl$version";;
8888 *) dflt="$initialinstalllocation/perl";;
8890 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
8893 none) startperl=": # use perl";;
8894 *) startperl="#!$ans"
8895 if $test 30 -lt `echo "$ans" | wc -c`; then
8898 WARNING: Some systems limit the #! command to 32 characters.
8899 If you experience difficulty running Perl scripts with #!, try
8900 installing Perl in a directory with a shorter pathname.
8906 *) startperl=": # use perl"
8911 echo "I'll use $startperl to start perl scripts."
8913 : figure best path for perl in scripts
8916 case "$versiononly" in
8917 "$define") perlpath="$initialinstalllocation/perl$version";;
8918 *) perlpath="$initialinstalllocation/perl";;
8920 case "$startperl" in
8925 I will use the "eval 'exec'" idiom to start Perl on your system.
8926 I can use the full path of your Perl binary for this purpose, but
8927 doing so may cause problems if you want to share those scripts and
8928 Perl is not always in a standard place ($initialinstalllocation/perl).
8931 dflt="$initialinstalllocation/perl"
8932 rp="What path shall I use in \"eval 'exec'\"?"
8939 case "$startperl" in
8941 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
8944 : determine where public executable scripts go
8945 set scriptdir scriptdir
8947 case "$scriptdir" in
8950 : guess some guesses
8951 $test -d /usr/share/scripts && dflt=/usr/share/scripts
8952 $test -d /usr/share/bin && dflt=/usr/share/bin
8953 $test -d /usr/local/script && dflt=/usr/local/script
8954 $test -d /usr/local/scripts && dflt=/usr/local/scripts
8955 $test -d $prefixexp/script && dflt=$prefixexp/script
8959 *) dflt="$scriptdir"
8964 Some installations have a separate directory just for executable scripts so
8965 that they can mount it across multiple architectures but keep the scripts in
8966 one spot. You might, for example, have a subdirectory of /usr/share for this.
8967 Or you might just lump your scripts in with all your other executables.
8971 rp='Where do you keep publicly executable scripts?'
8973 if $test "X$ansexp" != "X$scriptdirexp"; then
8979 : A little fix up for an irregularly named variable.
8980 installscript="$installscriptdir"
8982 : determine where add-on public executables go
8984 '') dflt=$siteprefix/bin ;;
8988 rp='Pathname where the add-on public executables should be installed?'
8993 : determine where add-on html pages go
8994 : There is no standard location, so try to copy the previously-selected
8995 : directory structure for the core html pages.
8996 case "$sitehtml1dir" in
8997 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8998 *) dflt=$sitehtml1dir ;;
9001 ''|' ') dflt=none ;;
9004 rp='Pathname where the site-specific html pages should be installed?'
9006 prefixvar=sitehtml1dir
9009 : determine where add-on library html pages go
9010 : There is no standard location, so try to copy the previously-selected
9011 : directory structure for the core html pages.
9012 case "$sitehtml3dir" in
9013 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9014 *) dflt=$sitehtml3dir ;;
9017 ''|' ') dflt=none ;;
9020 rp='Pathname where the site-specific library html pages should be installed?'
9022 prefixvar=sitehtml3dir
9025 : determine where add-on manual pages go
9026 case "$siteman1dir" in
9027 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
9028 *) dflt=$siteman1dir ;;
9031 ''|' ') dflt=none ;;
9034 rp='Pathname where the site-specific manual pages should be installed?'
9036 prefixvar=siteman1dir
9039 : determine where add-on library man pages go
9040 case "$siteman3dir" in
9041 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
9042 *) dflt=$siteman3dir ;;
9045 ''|' ') dflt=none ;;
9048 rp='Pathname where the site-specific library manual pages should be installed?'
9050 prefixvar=siteman3dir
9053 : determine where add-on public executable scripts go
9054 case "$sitescript" in
9055 '') dflt=$siteprefix/script
9056 $test -d $dflt || dflt=$sitebin ;;
9057 *) dflt="$sitescript" ;;
9060 rp='Pathname where add-on public executable scripts should be installed?'
9062 prefixvar=sitescript
9065 : Check if faststdio is requested and available
9066 case "$usefaststdio" in
9067 $define|true|[yY]*|'')
9068 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
9078 Perl can be built to use 'fast stdio', which means using the stdio
9079 library but also directly manipulating the stdio buffers to enable
9080 faster I/O. Using stdio is better for backward compatibility (especially
9081 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
9082 interface has been preferred instead of stdio.
9084 If this doesn't make any sense to you, just accept the default '$dflt'.
9086 rp='Use the "fast stdio" if available?'
9089 y|Y) val="$define" ;;
9096 : define an is-a-typedef? function
9097 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9099 "") inclist="sys/types.h";;
9101 eval "varval=\$$var";
9105 for inc in $inclist; do
9106 echo "#include <$inc>" >>temp.c;
9108 echo "#ifdef $type" >> temp.c;
9109 echo "printf(\"We have $type\");" >> temp.c;
9110 echo "#endif" >> temp.c;
9111 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9112 if $contains $type temp.E >/dev/null 2>&1; then
9118 *) eval "$var=\$varval";;
9121 : define an is-a-typedef? function that prompts if the type is not available.
9122 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9124 "") inclist="sys/types.h";;
9126 eval "varval=\$$var";
9130 for inc in $inclist; do
9131 echo "#include <$inc>" >>temp.c;
9133 echo "#ifdef $type" >> temp.c;
9134 echo "printf(\"We have $type\");" >> temp.c;
9135 echo "#endif" >> temp.c;
9136 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9138 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
9139 if $contains $type temp.E >/dev/null 2>&1; then
9140 echo "$type found." >&4;
9143 echo "$type NOT found." >&4;
9149 *) eval "$var=\$varval";;
9152 : see what type lseek is declared as in the kernel
9153 rp="What is the type used for lseek's offset on this system?"
9154 set off_t lseektype long stdio.h sys/types.h
9158 echo "Checking to see how big your file offsets are..." >&4
9160 #include <sys/types.h>
9164 printf("%d\n", (int)sizeof($lseektype));
9169 if eval $compile_ok; then
9170 lseeksize=`$run ./try`
9171 echo "Your file offsets are $lseeksize bytes long."
9175 echo "(I can't seem to compile the test program. Guessing...)"
9176 rp="What is the size of your file offsets (in bytes)?"
9182 : see what type file positions are declared as in the library
9183 rp="What is the type for file position used by fsetpos()?"
9184 set fpos_t fpostype long stdio.h sys/types.h
9187 : Check size for Fpos_t
9190 *_t) zzz="$fpostype" ;;
9193 echo "Checking the size of $zzz..." >&4
9195 #include <sys/types.h>
9202 printf("%d\n", (int)sizeof($fpostype));
9207 if eval $compile_ok; then
9211 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9214 echo "Your $zzz is $fpossize bytes long."
9220 echo "(I can't compile the test program. Guessing...)" >&4
9221 rp="What is the size of your file positions (in bytes)?"
9226 : Check for large file support
9227 # Backward compatibility (uselfs is deprecated).
9229 "$define"|true|[yY]*)
9232 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9234 uselargefiles="$define"
9238 case "$lseeksize:$fpossize" in
9241 You can have files larger than 2 gigabytes.
9244 *) case "$uselargefiles" in
9245 "$undef"|false|[nN]*) dflt='n' ;;
9250 Perl can be built to understand large files (files larger than 2 gigabytes)
9251 on some systems. To do so, Configure can be run with -Duselargefiles.
9253 If this doesn't make any sense to you, just accept the default '$dflt'.
9255 rp='Try to understand large files, if available?'
9258 y|Y) val="$define" ;;
9265 : Look for a hint-file generated 'call-back-unit'. If the
9266 : user has specified that a large files perl is to be built,
9267 : we may need to set or change some other defaults.
9268 if $test -f uselargefiles.cbu; then
9269 echo "Your platform has some specific hints regarding large file builds, using them..."
9270 . ./uselargefiles.cbu
9272 case "$uselargefiles" in
9274 if $test -f uselargefiles.cbu; then
9276 echo "Rechecking to see how big your file offsets are..." >&4
9278 #include <sys/types.h>
9282 printf("%d\n", (int)sizeof($lseektype));
9287 if eval $compile_ok; then
9288 lseeksize=`$run ./try`
9289 $echo "Your file offsets are now $lseeksize bytes long."
9293 echo "(I can't seem to compile the test program. Guessing...)"
9294 rp="What is the size of your file offsets (in bytes)?"
9299 *_t) zzz="$fpostype" ;;
9302 $echo $n "Rechecking the size of $zzz...$c" >&4
9304 #include <sys/types.h>
9311 printf("%d\n", (int)sizeof($fpostype));
9316 if eval $compile_ok; then
9321 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9324 echo " $fpossize bytes." >&4
9330 echo "(I can't compile the test program. Guessing...)" >&4
9331 rp="What is the size of your file positions (in bytes)?"
9340 : Check if we want perlio
9343 : Set the vendorbin variables
9344 case "$vendorprefix" in
9345 '') d_vendorbin="$undef"
9349 *) d_vendorbin="$define"
9350 : determine where vendor-supplied executables go.
9351 case "$vendorbin" in
9352 '') dflt=$vendorprefix/bin ;;
9353 *) dflt="$vendorbin" ;;
9356 rp='Pathname for the vendor-supplied executables directory?'
9359 vendorbinexp="$ansexp"
9365 : Set the vendorhtml1dir variables
9366 case "$vendorprefix" in
9367 '') vendorhtml1dir=''
9368 vendorhtml1direxp=''
9370 *) : determine where vendor-supplied html pages go.
9371 : There is no standard location, so try to copy the previously-selected
9372 : directory structure for the core html pages.
9373 : XXX Better default suggestions would be welcome.
9374 case "$vendorhtml1dir" in
9375 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9376 *) dflt=$vendorhtml1dir ;;
9379 ''|' ') dflt=none ;;
9382 rp='Pathname for the vendor-supplied html pages?'
9384 vendorhtml1dir="$ans"
9385 vendorhtml1direxp="$ansexp"
9388 : Use ' ' for none so value is preserved next time through Configure
9389 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9390 prefixvar=vendorhtml1dir
9393 : Set the vendorhtml3dir variables
9394 case "$vendorprefix" in
9395 '') vendorhtml3dir=''
9396 vendorhtml3direxp=''
9398 *) : determine where vendor-supplied module html pages go.
9399 : There is no standard location, so try to copy the previously-selected
9400 : directory structure for the core html pages.
9401 : XXX Better default suggestions would be welcome.
9402 case "$vendorhtml3dir" in
9403 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9404 *) dflt=$vendorhtml3dir ;;
9407 ''|' ') dflt=none ;;
9410 rp='Pathname for the vendor-supplied html pages?'
9412 vendorhtml3dir="$ans"
9413 vendorhtml3direxp="$ansexp"
9416 : Use ' ' for none so value is preserved next time through Configure
9417 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9418 prefixvar=vendorhtml3dir
9421 : Set the vendorman1dir variables
9422 case "$vendorprefix" in
9423 '') vendorman1dir=''
9426 *) : determine where vendor-supplied manual pages go.
9427 case "$vendorman1dir" in
9428 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9429 *) dflt=$vendorman1dir ;;
9432 ''|' ') dflt=none ;;
9435 rp='Pathname for the vendor-supplied manual section 1 pages?'
9437 vendorman1dir="$ans"
9438 vendorman1direxp="$ansexp"
9441 : Use ' ' for none so value is preserved next time through Configure
9442 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9443 prefixvar=vendorman1dir
9446 : Set the vendorman3dir variables
9447 case "$vendorprefix" in
9448 '') vendorman3dir=''
9451 *) : determine where vendor-supplied module manual pages go.
9452 case "$vendorman3dir" in
9453 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9454 *) dflt=$vendorman3dir ;;
9457 ''|' ') dflt=none ;;
9460 rp='Pathname for the vendor-supplied manual section 3 pages?'
9462 vendorman3dir="$ans"
9463 vendorman3direxp="$ansexp"
9466 : Use ' ' for none so value is preserved next time through Configure
9467 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9468 prefixvar=vendorman3dir
9471 : Set the vendorscript variables
9472 case "$vendorprefix" in
9473 '') d_vendorscript="$undef"
9477 *) d_vendorscript="$define"
9478 : determine where vendor-supplied scripts go.
9479 case "$vendorscript" in
9480 '') dflt=$vendorprefix/script
9481 $test -d $dflt || dflt=$vendorbin ;;
9482 *) dflt="$vendorscript" ;;
9486 The installation process will create a directory for
9487 vendor-supplied scripts.
9491 rp='Pathname for the vendor-supplied scripts directory?'
9494 vendorscriptexp="$ansexp"
9497 prefixvar=vendorscript
9500 : script used to emit important warnings
9503 if test \$# -gt 0; then
9508 echo "*** WARNING:" >&4
9509 sed -e 's/^/*** /' <msg >&4
9511 cat msg >>config.msg
9512 echo " " >>config.msg
9518 : see which of string.h or strings.h is needed
9520 strings=`./findhdr string.h`
9521 if $test "$strings" && $test -r "$strings"; then
9522 echo "Using <string.h> instead of <strings.h>." >&4
9526 strings=`./findhdr strings.h`
9527 if $test "$strings" && $test -r "$strings"; then
9528 echo "Using <strings.h> instead of <string.h>." >&4
9530 ./warn "No string header found -- You'll surely have problems."
9536 "$undef") strings=`./findhdr strings.h`;;
9537 *) strings=`./findhdr string.h`;;
9540 : see if qgcvt exists
9544 : Check print/scan long double stuff
9547 if $test X"$d_longdbl" = X"$define"; then
9549 echo "Checking how to print long doubles..." >&4
9551 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
9552 $cat >try.c <<'EOCP'
9553 #include <sys/types.h>
9557 printf("%.3f\n", d);
9561 if eval $compile; then
9565 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
9566 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
9567 echo "We will use %f."
9573 if $test X"$sPRIfldbl" = X; then
9574 $cat >try.c <<'EOCP'
9575 #include <sys/types.h>
9578 long double d = 123.456;
9579 printf("%.3Lf\n", d);
9583 if eval $compile; then
9587 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
9588 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
9589 echo "We will use %Lf."
9595 if $test X"$sPRIfldbl" = X; then
9596 $cat >try.c <<'EOCP'
9597 #include <sys/types.h>
9600 long double d = 123.456;
9601 printf("%.3llf\n", d);
9605 if eval $compile; then
9609 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
9610 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
9611 echo "We will use %llf."
9617 if $test X"$sPRIfldbl" = X; then
9618 $cat >try.c <<'EOCP'
9619 #include <sys/types.h>
9622 long double d = 123.456;
9623 printf("%.3lf\n", d);
9627 if eval $compile; then
9631 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
9632 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
9633 echo "We will use %lf."
9639 if $test X"$sPRIfldbl" = X; then
9640 echo "Cannot figure out how to print long doubles." >&4
9642 sSCNfldbl=$sPRIfldbl # expect consistency
9649 case "$sPRIfldbl" in
9650 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
9651 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
9652 d_SCNfldbl="$undef";
9654 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
9655 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
9656 d_SCNfldbl="$define";
9660 : Check how to convert floats to strings.
9662 if test "X$d_Gconvert" = X; then
9665 echo "Checking for an efficient way to convert floats to strings."
9667 case "$uselongdouble" in
9668 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
9670 case "$d_longdbl" in
9671 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
9673 case "$d_PRIgldbl" in
9674 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
9678 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
9679 char *myname = "gconvert";
9682 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
9683 char *myname = "gcvt";
9686 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
9687 char *myname = "qgcvt";
9688 #define DOUBLETYPE long double
9691 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9693 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
9695 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
9698 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
9700 char *myname = "sprintf";
9704 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9705 #define DOUBLETYPE long double
9707 #define DOUBLETYPE double
9719 # include <string.h>
9721 # include <strings.h>
9724 int checkit(char *expect, char *got)
9726 if (strcmp(expect, got)) {
9727 printf("%s oddity: Expected %s, got %s\n",
9728 myname, expect, got);
9738 /* This must be 1st test on (which?) platform */
9739 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
9740 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
9741 checkit("0.1", buf);
9743 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
9744 checkit("0.01", buf);
9746 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
9747 checkit("0.001", buf);
9749 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
9750 checkit("0.0001", buf);
9752 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
9753 if (strlen(buf) > 5)
9754 checkit("9e-005", buf); /* for Microsoft ?? */
9756 checkit("9e-05", buf);
9758 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
9761 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
9762 checkit("1.1", buf);
9764 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
9765 checkit("1.01", buf);
9767 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
9768 checkit("1.001", buf);
9770 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
9771 checkit("1.0001", buf);
9773 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
9774 checkit("1.00001", buf);
9776 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
9777 checkit("1.000001", buf);
9779 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
9782 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
9785 /* Some Linux gcvt's give 1.e+5 here. */
9786 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
9787 checkit("100000", buf);
9789 /* Some Linux gcvt's give -1.e+5 here. */
9790 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
9791 checkit("-100000", buf);
9793 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
9794 checkit("123.456", buf);
9796 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
9797 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
9798 /* 34 should be enough to scare even long double
9799 * places into using the e notation. */
9800 if (strlen(buf) > 5)
9801 checkit("1e+034", buf); /* for Microsoft */
9803 checkit("1e+34", buf);
9805 /* For Perl, if you add additional tests here, also add them to
9806 * t/base/num.t for benefit of platforms not using Configure or
9807 * overriding d_Gconvert */
9812 : first add preferred functions to our list
9814 for xxx_convert in $gconvert_preference; do
9815 case $xxx_convert in
9816 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
9817 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
9820 : then add any others
9821 for xxx_convert in gconvert gcvt sprintf; do
9824 *) xxx_list="$xxx_list $xxx_convert" ;;
9828 case "$d_longdbl$uselongdouble" in
9830 : again, add preferred functions to our list first
9832 for xxx_convert in $gconvert_ld_preference; do
9833 case $xxx_convert in
9834 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9835 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
9838 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
9839 for xxx_convert in qgcvt sprintf $xxx_list; do
9840 case "$xxx_ld_list" in
9841 $xxx_convert*|*" $xxx_convert"*) ;;
9842 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9845 : if sprintf cannot do long doubles, move it to the end
9846 if test "$d_PRIgldbl" != "$define"; then
9847 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
9849 : if no qgcvt, remove it
9850 if test "$d_qgcvt" != "$define"; then
9851 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
9854 xxx_list="$xxx_ld_list"
9858 for xxx_convert in $xxx_list; do
9859 echo "Trying $xxx_convert..."
9860 $rm -f try try$_o core
9861 set try -DTRY_$xxx_convert
9862 if eval $compile; then
9863 echo "$xxx_convert() found." >&4
9865 echo "I'll use $xxx_convert to convert floats into a string." >&4
9868 echo "...But $xxx_convert didn't work as I expected."
9872 echo "$xxx_convert NOT found." >&4
9876 if test X$xxx_convert = X; then
9877 echo "*** WHOA THERE!!! ***" >&4
9878 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
9882 case "$xxx_convert" in
9883 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
9884 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
9885 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
9886 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
9887 "$define$define$define")
9888 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
9889 "$define$define$undef")
9890 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
9891 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
9899 : see if _fwalk exists
9903 : Initialize h_fcntl
9906 : Initialize h_sysfile
9909 : access call always available on UNIX
9913 : locate the flags for 'access()'
9917 $cat >access.c <<EOCP
9918 #include <sys/types.h>
9923 #include <sys/file.h>
9936 : check sys/file.h first, no particular reason here
9937 if $test `./findhdr sys/file.h` && \
9938 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
9940 echo "<sys/file.h> defines the *_OK access constants." >&4
9941 elif $test `./findhdr fcntl.h` && \
9942 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
9944 echo "<fcntl.h> defines the *_OK access constants." >&4
9945 elif $test `./findhdr unistd.h` && \
9946 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
9947 echo "<unistd.h> defines the *_OK access constants." >&4
9949 echo "I can't find the four *_OK access constants--I'll use mine." >&4
9955 : see if accessx exists
9956 set accessx d_accessx
9959 : see if aintl exists
9963 : see if alarm exists
9967 : see if 64bit time functions exists
9969 set ctime64 d_ctime64
9972 set localtime64 d_localtime64
9975 set gmtime64 d_gmtime64
9978 set mktime64 d_mktime64
9981 set difftime64 d_difftime64
9984 set asctime64 d_asctime64
9987 : see if POSIX threads are available
9988 set pthread.h i_pthread
9991 : define a function to check prototypes
9992 $cat > protochk <<EOSH
9995 optimize="$optimize"
9997 prototype="$prototype"
10000 usethreads=$usethreads
10001 i_pthread=$i_pthread
10002 pthread_h_first=$pthread_h_first
10005 $cat >> protochk <<'EOSH'
10010 while test $# -ge 2; do
10012 $define) echo "#include <$2>" >> try.c ;;
10013 literal) echo "$2" >> try.c ;;
10015 # Extra magic for the benefit of systems that need pthread.h
10016 # to be included early to correctly detect threadsafe functions.
10017 # Such functions must guarantee themselves, though, that the usethreads
10018 # and i_pthread have been defined, before calling protochk.
10019 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
10020 echo "#include <pthread.h>" >> try.c
10025 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
10026 cat >> try.c <<'EOCP'
10027 #ifdef CAN_PROTOTYPE
10028 #define _(args) args
10033 echo "$foo" >> try.c
10034 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
10035 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
10041 $eunicefix protochk
10043 : Define hasproto macro for Configure internal use
10044 hasproto='varname=$1; func=$2; shift; shift;
10045 while $test $# -ge 2; do
10047 $define) echo "#include <$2>";;
10051 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
10052 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
10053 echo "$func() prototype found.";
10056 echo "$func() prototype NOT found.";
10063 : see if sys/types.h has to be included
10064 set sys/types.h i_systypes
10067 : see if sys/select.h has to be included
10068 set sys/select.h i_sysselct
10071 : Define hasfield macro for Configure internal use
10072 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
10073 while $test $# -ge 2; do
10075 $define) echo "#include <$2>";;
10079 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
10081 if eval $compile; then
10090 : see if we should include time.h, sys/time.h, or both
10092 if test "X$timeincl" = X; then
10093 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
10094 $echo $n "I'm now running the test program...$c"
10096 #include <sys/types.h>
10101 #ifdef SYSTIMEKERNEL
10104 #include <sys/time.h>
10107 #include <sys/select.h>
10109 #$i_stdlib I_STDLIB
10111 #include <stdlib.h>
10117 struct timeval bar;
10120 struct timezone tzp;
10122 if (foo.tm_sec == foo.tm_sec)
10125 if (bar.tv_sec == bar.tv_sec)
10132 for s_timezone in '-DS_TIMEZONE' ''; do
10134 for s_timeval in '-DS_TIMEVAL' ''; do
10135 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10136 for i_time in '' '-DI_TIME'; do
10137 for i_systime in '-DI_SYSTIME' ''; do
10140 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10141 if eval $compile; then
10142 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
10146 $echo $n "Succeeded with $flags$c"
10158 *SYSTIMEKERNEL*) i_systimek="$define"
10159 timeincl=`./findhdr sys/time.h`
10160 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10161 *) i_systimek="$undef";;
10164 *I_TIME*) i_time="$define"
10165 timeincl=`./findhdr time.h`" $timeincl"
10166 echo "We'll include <time.h>." >&4;;
10167 *) i_time="$undef";;
10170 *I_SYSTIME*) i_systime="$define"
10171 timeincl=`./findhdr sys/time.h`" $timeincl"
10172 echo "We'll include <sys/time.h>." >&4;;
10173 *) i_systime="$undef";;
10177 : see if struct tm knows about tm_zone
10178 case "$i_systime$i_time" in
10181 echo "Checking to see if your struct tm has tm_zone field..." >&4
10182 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
10190 case "$d_tm_tm_zone" in
10191 "$define") echo "Yes, it does." ;;
10192 *) echo "No, it doesn't." ;;
10194 : see if struct tm knows about tm_gmtoff
10195 case "$i_systime$i_time" in
10198 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
10199 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
10207 case "$d_tm_tm_gmtoff" in
10208 "$define") echo "Yes, it does." ;;
10209 *) echo "No, it doesn't." ;;
10212 : see if asctime_r exists
10213 set asctime_r d_asctime_r
10215 case "$d_asctime_r" in
10217 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10218 case "$d_asctime_r_proto:$usethreads" in
10219 ":define") d_asctime_r_proto=define
10220 set d_asctime_r_proto asctime_r $hdrs
10224 case "$d_asctime_r_proto" in
10226 case "$asctime_r_proto" in
10227 ''|0) try='char* asctime_r(const struct tm*, char*);'
10228 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SB ;;
10230 case "$asctime_r_proto" in
10231 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
10232 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SBI ;;
10234 case "$asctime_r_proto" in
10235 ''|0) try='int asctime_r(const struct tm*, char*);'
10236 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SB ;;
10238 case "$asctime_r_proto" in
10239 ''|0) try='int asctime_r(const struct tm*, char*, int);'
10240 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SBI ;;
10242 case "$asctime_r_proto" in
10243 ''|0) d_asctime_r=undef
10245 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
10246 * ) case "$asctime_r_proto" in
10247 REENTRANT_PROTO*) ;;
10248 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
10250 echo "Prototype: $try" ;;
10253 *) case "$usethreads" in
10254 define) echo "asctime_r has no prototype, not using it." >&4 ;;
10261 *) asctime_r_proto=0
10265 : see if atolf exists
10269 : see if atoll exists
10273 : Look for GCC-style attribute format
10274 case "$d_attribute_format" in
10277 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
10278 $cat >attrib.c <<'EOCP'
10280 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
10282 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10283 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10284 echo "Your C compiler doesn't support __attribute__((format))."
10287 echo "Your C compiler supports __attribute__((format))."
10291 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10295 *) val="$d_attribute_format" ;;
10297 set d_attribute_format
10301 : Look for GCC-style attribute format with null format allowed
10302 case "$d_printf_format_null" in
10303 '') case "$d_attribute_format" in
10306 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
10307 $cat >attrib.c <<EOCP
10309 #$i_stdlib I_STDLIB
10311 #include <stdlib.h>
10313 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
10314 int null_printf (char* pat,...) { return (int)pat; }
10315 int main () { exit(null_printf(NULL)); }
10317 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
10318 : run the executable in case it produces a run-time warning
10319 if $run ./attrib >>attrib.out 2>&1; then
10320 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10321 echo "Your C compiler doesn't allow __printf__ format to be null."
10324 echo "Your C compiler allows __printf__ format to be null."
10328 echo "Your C compiler executable failed with __printf__ format null."
10332 echo "Your C compiler fails with __printf__ format null."
10339 *) val="$d_printf_format_null" ;;
10341 set d_printf_format_null
10345 : Look for GCC-style attribute malloc
10346 case "$d_attribute_malloc" in
10349 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
10350 $cat >attrib.c <<'EOCP'
10352 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
10354 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10355 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10356 echo "Your C compiler doesn't support __attribute__((malloc))."
10359 echo "Your C compiler supports __attribute__((malloc))."
10363 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10367 *) val="$d_attribute_malloc" ;;
10369 set d_attribute_malloc
10373 : Look for GCC-style attribute nonnull
10374 case "$d_attribute_nonnull" in
10377 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
10378 $cat >attrib.c <<'EOCP'
10380 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
10382 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10383 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10384 echo "Your C compiler doesn't support __attribute__((nonnull))."
10387 echo "Your C compiler supports __attribute__((nonnull))."
10391 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10395 *) val="$d_attribute_nonnull" ;;
10397 set d_attribute_nonnull
10401 : Look for GCC-style attribute noreturn
10402 case "$d_attribute_noreturn" in
10405 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
10406 $cat >attrib.c <<'EOCP'
10408 void fall_over_dead( void ) __attribute__((noreturn));
10410 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10411 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10412 echo "Your C compiler doesn't support __attribute__((noreturn))."
10415 echo "Your C compiler supports __attribute__((noreturn))."
10419 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10423 *) val="$d_attribute_noreturn" ;;
10425 set d_attribute_noreturn
10429 : Look for GCC-style attribute pure
10430 case "$d_attribute_pure" in
10433 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
10434 $cat >attrib.c <<'EOCP'
10436 int square( int n ) __attribute__((pure));
10438 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10439 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10440 echo "Your C compiler doesn't support __attribute__((pure))."
10443 echo "Your C compiler supports __attribute__((pure))."
10447 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10451 *) val="$d_attribute_pure" ;;
10453 set d_attribute_pure
10457 : Look for GCC-style attribute unused
10458 case "$d_attribute_unused" in
10461 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
10462 $cat >attrib.c <<'EOCP'
10464 int do_something( int dummy __attribute__((unused)), int n );
10466 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10467 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10468 echo "Your C compiler doesn't support __attribute__((unused))."
10471 echo "Your C compiler supports __attribute__((unused))."
10475 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10479 *) val="$d_attribute_unused" ;;
10481 set d_attribute_unused
10485 : Look for GCC-style attribute deprecated
10486 case "$d_attribute_deprecated" in
10489 echo "Checking whether your compiler can handle __attribute__((deprecated)) ..." >&4
10490 $cat >attrib.c <<'EOCP'
10492 int I_am_deprecated(void) __attribute__((deprecated));
10494 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10495 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10496 echo "Your C compiler doesn't support __attribute__((deprecated))."
10499 echo "Your C compiler supports __attribute__((deprecated))."
10503 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10507 *) val="$d_attribute_deprecated" ;;
10509 set d_attribute_deprecated
10513 : Look for GCC-style attribute warn_unused_result
10514 case "$d_attribute_warn_unused_result" in
10517 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
10518 $cat >attrib.c <<'EOCP'
10520 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
10522 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10523 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10524 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
10527 echo "Your C compiler supports __attribute__((warn_unused_result))."
10531 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10535 *) val="$d_attribute_warn_unused_result" ;;
10537 set d_attribute_warn_unused_result
10541 : see if bcmp exists
10545 : see if bcopy exists
10549 : see if getpgrp exists
10550 set getpgrp d_getpgrp
10553 case "$d_getpgrp" in
10556 echo "Checking to see which flavor of getpgrp is in use..."
10558 #$i_unistd I_UNISTD
10559 #include <sys/types.h>
10561 # include <unistd.h>
10563 #$i_stdlib I_STDLIB
10565 #include <stdlib.h>
10569 if (getuid() == 0) {
10570 printf("(I see you are running Configure as super-user...)\n");
10573 #ifdef TRY_BSD_PGRP
10574 if (getpgrp(1) == 0)
10583 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10584 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
10586 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10587 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
10590 echo "I can't seem to compile and run the test program."
10592 xxx="a USG one, i.e. you use getpgrp()."
10594 # SVR4 systems can appear rather BSD-ish.
10595 case "$i_unistd" in
10597 xxx="a BSD one, i.e. you use getpgrp(pid)."
10601 xxx="probably a USG one, i.e. you use getpgrp()."
10606 echo "Assuming your getpgrp is $xxx" >&4
10615 : see if setpgrp exists
10616 set setpgrp d_setpgrp
10619 case "$d_setpgrp" in
10622 echo "Checking to see which flavor of setpgrp is in use..."
10624 #$i_unistd I_UNISTD
10625 #include <sys/types.h>
10627 # include <unistd.h>
10629 #$i_stdlib I_STDLIB
10631 #include <stdlib.h>
10635 if (getuid() == 0) {
10636 printf("(I see you are running Configure as super-user...)\n");
10639 #ifdef TRY_BSD_PGRP
10640 if (-1 == setpgrp(1, 1))
10643 if (setpgrp() != -1)
10649 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10650 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
10652 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10653 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
10656 echo "(I can't seem to compile and run the test program.)"
10658 xxx="a USG one, i.e. you use setpgrp()."
10660 # SVR4 systems can appear rather BSD-ish.
10661 case "$i_unistd" in
10663 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
10667 xxx="probably a USG one, i.e. you use setpgrp()."
10672 echo "Assuming your setpgrp is $xxx" >&4
10681 : Look for GCC-style __builtin_choose_expr
10682 case "$d_builtin_choose_expr" in
10685 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
10686 $cat >try.c <<'EOCP'
10687 #include <assert.h>
10688 #include <stdlib.h>
10691 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
10694 assert( SYRINX(1) == 2112 );
10695 assert( SYRINX(1) != 5150 );
10696 assert( SYRINX(0) == 5150 );
10697 assert( SYRINX(0) != 2112 );
10698 puts( "All good!" );
10704 if eval $compile && $run ./try; then
10705 echo "Your C compiler supports __builtin_choose_expr."
10708 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10712 *) val="$d_builtin_choose_expr" ;;
10715 set d_builtin_choose_expr
10719 : Look for GCC-style __builtin_expect
10720 case "$d_builtin_expect" in
10723 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
10724 $cat >try.c <<'EOCP'
10727 if ( __builtin_expect(n, 0) ) n = 1;
10728 /* Remember shell exit code truth is 0, C truth is non-zero */
10733 if eval $compile && $run ./try; then
10734 echo "Your C compiler supports __builtin_expect."
10737 echo "Your C compiler doesn't seem to understand __builtin_expect."
10741 *) val="$d_builtin_expect" ;;
10744 set d_builtin_expect
10748 : see if bzero exists
10752 : see if stdarg is available
10754 if $test `./findhdr stdarg.h`; then
10755 echo "<stdarg.h> found." >&4
10758 echo "<stdarg.h> NOT found." >&4
10762 : see if varags is available
10764 if $test `./findhdr varargs.h`; then
10765 echo "<varargs.h> found." >&4
10767 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
10770 : set up the varargs testing programs
10771 $cat > varargs.c <<EOP
10773 #include <stdarg.h>
10776 #include <varargs.h>
10780 int f(char *p, ...)
10794 p = va_arg(ap, char *);
10800 $cat > varargs <<EOP
10802 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
10811 : now check which varargs header should be included
10816 if `./varargs I_STDARG`; then
10818 elif `./varargs I_VARARGS`; then
10823 if `./varargs I_VARARGS`; then
10830 echo "I could not find the definition for va_dcl... You have problems..." >&4
10831 val="$undef"; set i_stdarg; eval $setvar
10832 val="$undef"; set i_varargs; eval $setvar
10837 case "$i_varhdr" in
10839 val="$define"; set i_stdarg; eval $setvar
10840 val="$undef"; set i_varargs; eval $setvar
10843 val="$undef"; set i_stdarg; eval $setvar
10844 val="$define"; set i_varargs; eval $setvar
10847 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
10851 : see if the Compiler supports C99 variadic macros
10852 case "$i_stdarg$i_stdlib" in
10854 echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
10857 #include <stdarg.h>
10859 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
10863 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
10869 if eval $compile && $run ./try 2>&1 >/dev/null; then
10870 case "`$run ./try`" in
10872 echo "You have C99 variadic macros." >&4
10873 d_c99_variadic_macros="$define"
10876 echo "You don't have functional C99 variadic macros." >&4
10877 d_c99_variadic_macros="$undef"
10881 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
10882 d_c99_variadic_macros="$undef"
10887 echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
10888 d_c99_variadic_macros="$undef"
10892 : see if signal is declared as pointer to function returning int or void
10894 xxx=`./findhdr signal.h`
10895 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
10896 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10897 echo "You have int (*signal())() instead of void." >&4
10899 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10900 echo "You have void (*signal())()." >&4
10902 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
10903 echo "You have int (*signal())() instead of void." >&4
10905 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
10906 echo "You have void (*signal())()." >&4
10909 case "$d_voidsig" in
10911 echo "I can't determine whether signal handler returns void or int..." >&4
10913 rp="What type does your signal handler return?"
10916 v*) val="$define";;
10920 echo "As you already told me, signal handler returns void." >&4
10923 *) echo "As you already told me, signal handler returns int." >&4
10930 case "$d_voidsig" in
10931 "$define") signal_t="void";;
10932 *) signal_t="int";;
10936 : check for ability to cast large floats to 32-bit ints.
10938 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
10939 if $test "$intsize" -ge 4; then
10946 #$i_stdlib I_STDLIB
10948 #include <stdlib.h>
10950 #include <sys/types.h>
10951 #include <signal.h>
10952 $signal_t blech(int s) { exit(3); }
10959 signal(SIGFPE, blech);
10961 /* Don't let compiler optimize the test away. Store the number
10962 in a writable string for gcc to pass to sscanf under HP-UX.
10964 sprintf(str, "2147483647");
10965 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
10969 /* x86 processors will probably give 0x8000 0000, which is a
10970 sign change. We don't want that. We want to mimic SPARC
10971 behavior here, which is to preserve the sign and give
10974 if (i32 != ($xxx) f)
10980 if eval $compile_ok; then
10984 echo "(I can't seem to compile the test program--assuming it can't)"
10989 echo "Yup, it can."
10992 echo "Nope, it can't."
10999 : check for ability to cast negative floats to unsigned
11001 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
11004 #$i_stdlib I_STDLIB
11006 #include <stdlib.h>
11008 #include <sys/types.h>
11009 #include <signal.h>
11010 $signal_t blech(int s) { exit(7); }
11011 $signal_t blech_in_list(int s) { exit(4); }
11012 unsigned long dummy_long(unsigned long p) { return p; }
11013 unsigned int dummy_int(unsigned int p) { return p; }
11014 unsigned short dummy_short(unsigned short p) { return p; }
11018 unsigned long along;
11020 unsigned short ashort;
11024 /* Frustrate gcc-2.7.2's optimizer which failed this test with
11025 a direct f = -123. assignment. gcc-2.8.0 reportedly
11026 optimized the whole file away
11028 /* Store the number in a writable string for gcc to pass to
11029 sscanf under HP-UX.
11031 sprintf(str, "-123");
11032 sscanf(str, "%lf", &f); /* f = -123.; */
11034 signal(SIGFPE, blech);
11035 along = (unsigned long)f;
11036 aint = (unsigned int)f;
11037 ashort = (unsigned short)f;
11038 if (along != (unsigned long)-123)
11040 if (aint != (unsigned int)-123)
11042 if (ashort != (unsigned short)-123)
11044 sprintf(str, "1073741824.");
11045 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
11048 along = (unsigned long)f;
11049 if (along != 0x80000000)
11053 along = (unsigned long)f;
11054 if (along != 0x7fffffff)
11058 along = (unsigned long)f;
11059 if (along != 0x80000001)
11063 signal(SIGFPE, blech_in_list);
11064 sprintf(str, "123.");
11065 sscanf(str, "%lf", &f); /* f = 123.; */
11066 along = dummy_long((unsigned long)f);
11067 aint = dummy_int((unsigned int)f);
11068 ashort = dummy_short((unsigned short)f);
11069 if (along != (unsigned long)123)
11071 if (aint != (unsigned int)123)
11073 if (ashort != (unsigned short)123)
11080 if eval $compile_ok; then
11084 echo "(I can't seem to compile the test program--assuming it can't)"
11087 case "$castflags" in
11089 echo "Yup, it can."
11092 echo "Nope, it can't."
11099 : see if vprintf exists
11101 if set vprintf val -f d_vprintf; eval $csym; $val; then
11102 echo 'vprintf() found.' >&4
11105 #$i_stdarg I_STDARG /* Only one of these can be defined by i_varhrd */
11106 #$i_varargs I_VARARGS
11108 #$i_stdlib I_STDLIB
11109 #$i_unistd I_UNISTD
11112 # include <stdarg.h>
11113 #else /* I_VARARGS */
11114 # include <varargs.h>
11118 # include <unistd.h>
11122 # include <stdlib.h>
11125 #include <stdio.h> /* vsprintf prototype */
11128 void xxx(int n, ...)
11133 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11135 int main() { xxx(1, "foo"); }
11137 #else /* I_VARARGS */
11145 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11147 int main() { xxx("foo"); }
11153 if eval $compile_ok; then
11154 if $run ./try; then
11155 echo "Your vsprintf() returns (int)." >&4
11158 echo "Your vsprintf() returns (char*)." >&4
11162 echo 'I am unable to compile the vsprintf() test program.' >&4
11163 # We shouldn't get here. If we do, assume the standard signature,
11164 # not the old BSD one.
11165 echo 'Guessing that vsprintf() returns (int).' >&4
11169 echo 'vprintf() NOT found.' >&4
11180 : see if chown exists
11184 : see if chroot exists
11185 set chroot d_chroot
11188 : see if chsize exists
11189 set chsize d_chsize
11192 : see if class exists
11196 : see if clearenv exists
11197 set clearenv d_clearenv
11200 : Define hasstruct macro for Configure internal use
11201 hasstruct='varname=$1; struct=$2; shift; shift;
11202 while $test $# -ge 2; do
11204 $define) echo "#include <$2>";;
11208 echo "int main () { struct $struct foo; }" >> try.c;
11210 if eval $compile; then
11219 : see whether socket exists
11223 $echo $n "Hmm... $c" >&4
11224 if set socket val -f d_socket; eval $csym; $val; then
11225 echo "Looks like you have Berkeley networking support." >&4
11227 if set setsockopt val -f; eval $csym; $val; then
11230 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
11231 d_oldsock="$define"
11234 if $contains socklib libc.list >/dev/null 2>&1; then
11235 echo "Looks like you have Berkeley networking support." >&4
11237 : we will have to assume that it supports the 4.2 BSD interface
11240 echo "You don't have Berkeley networking in libc$_a..." >&4
11241 if test "X$d_socket" = "X$define"; then
11242 echo "...but you seem to believe that you have sockets." >&4
11244 for net in net socket
11246 if test -f /usr/lib/lib$net$_a; then
11247 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
11248 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
11249 if $contains socket libc.list >/dev/null 2>&1; then
11254 echo "...but the Wollongong group seems to have hacked it in." >&4
11255 sockethdr="-I/usr/netinclude"
11258 echo "Found Berkeley sockets interface in lib$net." >&4
11259 if $contains setsockopt libc.list >/dev/null 2>&1; then
11262 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
11263 d_oldsock="$define"
11269 if test "X$d_socket" != "X$define"; then
11270 echo "or anywhere else I see." >&4
11278 : see if socketpair exists
11279 set socketpair d_sockpair
11284 echo "Checking the availability sa_len in the sock struct ..." >&4
11286 #include <sys/types.h>
11287 #include <sys/socket.h>
11289 struct sockaddr sa;
11290 return (sa.sa_len);
11294 set try; if eval $compile; then
11297 set d_sockaddr_sa_len; eval $setvar
11301 echo "Checking the availability sin6_scope_id in struct sockaddr_in6 ..." >&4
11303 #include <sys/types.h>
11304 #include <sys/socket.h>
11305 #include <netinet/in.h>
11307 struct sockaddr_in6 sin6;
11308 return (sin6.sin6_scope_id);
11312 set try; if eval $compile; then
11315 set d_sin6_scope_id; eval $setvar
11319 echo "Checking the availability of certain socket constants..." >&4
11320 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
11321 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
11323 #include <sys/types.h>
11324 #include <sys/socket.h>
11330 set try; if eval $compile; then
11333 set d_${enum}; eval $setvar
11337 : see if this is a sys/uio.h system
11338 set sys/uio.h i_sysuio
11341 : Check for cmsghdr support
11343 echo "Checking to see if your system supports struct cmsghdr..." >&4
11344 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
11346 case "$d_cmsghdr_s" in
11347 "$define") echo "Yes, it does." ;;
11348 *) echo "No, it doesn't." ;;
11352 : check for const keyword
11354 echo 'Checking to see if your C compiler knows about "const"...' >&4
11355 $cat >const.c <<'EOCP'
11356 typedef struct spug { int drokk; } spug;
11360 const spug y = { 0 };
11363 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
11365 echo "Yup, it does."
11368 echo "Nope, it doesn't."
11373 : see if copysignl exists
11374 set copysignl d_copysignl
11377 : see if crypt exists
11382 $define) cryptlib='' ;;
11383 *) if set crypt val -f d_crypt; eval $csym; $val; then
11384 echo 'crypt() found.' >&4
11388 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
11389 if $test -z "$cryptlib"; then
11390 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
11394 if $test -z "$cryptlib"; then
11395 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
11399 if $test -z "$cryptlib"; then
11400 cryptlib=`./loc libcrypt$_a "" $libpth`
11404 if $test -z "$cryptlib"; then
11405 echo 'crypt() NOT found.' >&4
11416 : see if this is a crypt.h system
11417 set crypt.h i_crypt
11420 : see if crypt_r exists
11421 set crypt_r d_crypt_r
11423 case "$d_crypt_r" in
11425 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
11426 case "$d_crypt_r_proto:$usethreads" in
11427 ":define") d_crypt_r_proto=define
11428 set d_crypt_r_proto crypt_r $hdrs
11432 case "$d_crypt_r_proto" in
11434 case "$crypt_r_proto" in
11435 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
11436 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCS ;;
11438 case "$crypt_r_proto" in
11439 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
11440 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCD ;;
11442 case "$crypt_r_proto" in
11443 ''|0) d_crypt_r=undef
11445 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
11446 * ) case "$crypt_r_proto" in
11447 REENTRANT_PROTO*) ;;
11448 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
11450 echo "Prototype: $try" ;;
11453 *) case "$usethreads" in
11454 define) echo "crypt_r has no prototype, not using it." >&4 ;;
11465 : get csh whereabouts
11467 'csh') val="$undef" ;;
11468 *) val="$define" ;;
11472 : Respect a hint or command line value for full_csh.
11473 case "$full_csh" in
11474 '') full_csh=$csh ;;
11477 : see if ctermid exists
11478 set ctermid d_ctermid
11481 : see if ctermid_r exists
11482 set ctermid_r d_ctermid_r
11484 case "$d_ctermid_r" in
11486 hdrs="$i_systypes sys/types.h define stdio.h "
11487 case "$d_ctermid_r_proto:$usethreads" in
11488 ":define") d_ctermid_r_proto=define
11489 set d_ctermid_r_proto ctermid_r $hdrs
11493 case "$d_ctermid_r_proto" in
11495 case "$ctermid_r_proto" in
11496 ''|0) try='char* ctermid_r(char*);'
11497 ./protochk "$extern_C $try" $hdrs && ctermid_r_proto=B_B ;;
11499 case "$ctermid_r_proto" in
11500 ''|0) d_ctermid_r=undef
11502 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
11503 * ) case "$ctermid_r_proto" in
11504 REENTRANT_PROTO*) ;;
11505 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
11507 echo "Prototype: $try" ;;
11510 *) case "$usethreads" in
11511 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
11518 *) ctermid_r_proto=0
11522 : see if ctime_r exists
11523 set ctime_r d_ctime_r
11525 case "$d_ctime_r" in
11527 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
11528 case "$d_ctime_r_proto:$usethreads" in
11529 ":define") d_ctime_r_proto=define
11530 set d_ctime_r_proto ctime_r $hdrs
11534 case "$d_ctime_r_proto" in
11536 case "$ctime_r_proto" in
11537 ''|0) try='char* ctime_r(const time_t*, char*);'
11538 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SB ;;
11540 case "$ctime_r_proto" in
11541 ''|0) try='char* ctime_r(const time_t*, char*, int);'
11542 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SBI ;;
11544 case "$ctime_r_proto" in
11545 ''|0) try='int ctime_r(const time_t*, char*);'
11546 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SB ;;
11548 case "$ctime_r_proto" in
11549 ''|0) try='int ctime_r(const time_t*, char*, int);'
11550 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SBI ;;
11552 case "$ctime_r_proto" in
11553 ''|0) d_ctime_r=undef
11555 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
11556 * ) case "$ctime_r_proto" in
11557 REENTRANT_PROTO*) ;;
11558 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
11560 echo "Prototype: $try" ;;
11563 *) case "$usethreads" in
11564 define) echo "ctime_r has no prototype, not using it." >&4 ;;
11575 : see if cuserid exists
11576 set cuserid d_cuserid
11579 : see if this is a limits.h system
11580 set limits.h i_limits
11583 : see if this is a float.h system
11584 set float.h i_float
11587 : See if number of significant digits in a double precision number is known
11589 $cat >dbl_dig.c <<EOM
11590 #$i_limits I_LIMITS
11593 #include <limits.h>
11599 printf("Contains DBL_DIG");
11602 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
11603 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
11604 echo "DBL_DIG found." >&4
11607 echo "DBL_DIG NOT found." >&4
11614 : see if dbm.h is available
11615 : see if dbmclose exists
11616 set dbmclose d_dbmclose
11619 case "$d_dbmclose" in
11629 *) set rpcsvc/dbm.h i_rpcsvcdbm
11634 *) echo "We won't be including <dbm.h>"
11644 : see if prototype for dbminit is available
11646 set d_dbminitproto dbminit $i_dbm dbm.h
11649 : see if difftime exists
11650 set difftime d_difftime
11653 : see if this is a dirent system
11655 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
11657 echo "<dirent.h> found." >&4
11660 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
11661 echo "<sys/dir.h> found." >&4
11664 xinc=`./findhdr sys/ndir.h`
11666 echo "<dirent.h> NOT found." >&4
11671 : Look for type of directory structure.
11673 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11675 case "$direntrytype" in
11677 case "$i_dirent" in
11678 $define) guess1='struct dirent' ;;
11679 *) guess1='struct direct' ;;
11682 *) guess1="$direntrytype"
11687 'struct dirent') guess2='struct direct' ;;
11688 *) guess2='struct dirent' ;;
11691 if $contains "$guess1" try.c >/dev/null 2>&1; then
11692 direntrytype="$guess1"
11693 echo "Your directory entries are $direntrytype." >&4
11694 elif $contains "$guess2" try.c >/dev/null 2>&1; then
11695 direntrytype="$guess2"
11696 echo "Your directory entries seem to be $direntrytype." >&4
11698 echo "I don't recognize your system's directory entries." >&4
11699 rp="What type is used for directory entries on this system?"
11702 direntrytype="$ans"
11706 : see if the directory entry stores field length
11708 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11709 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
11710 echo "Good, your directory entry keeps length information in d_namlen." >&4
11713 echo "Your directory entry does not know about the d_namlen field." >&4
11720 : Look for DIR.dd_fd
11721 case "$i_dirent" in
11723 echo "Checking to see if DIR has a dd_fd member variable" >&4
11725 #$i_stdlib I_STDLIB
11727 #include <stdlib.h>
11729 #include <dirent.h>
11739 if eval $compile; then
11740 echo "Yes, it does."
11743 echo "No, it does not."
11748 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
11756 : see if this is an sysdir system
11757 set sys/dir.h i_sysdir
11760 : see if this is an sysndir system
11761 set sys/ndir.h i_sysndir
11766 $cat >dirfd.c <<EOM
11768 #$i_stdlib I_STDLIB
11770 #include <stdlib.h>
11772 #$i_dirent I_DIRENT /**/
11773 #$i_sysdir I_SYS_DIR /**/
11774 #$i_sysndir I_SYS_NDIR /**/
11775 #$i_systypes I_SYS_TYPES /**/
11776 #if defined(I_SYS_TYPES)
11777 #include <sys/types.h>
11779 #if defined(I_DIRENT)
11780 #include <dirent.h>
11781 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
11782 #include <sys/dir.h>
11786 #include <sys/ndir.h>
11790 #include <ndir.h> /* may be wrong in the future */
11792 #include <sys/dir.h>
11798 DIR *dirp = opendir(".");
11799 if (dirfd(dirp) >= 0)
11807 if eval $compile; then
11811 $define) echo "dirfd() found." >&4 ;;
11812 *) echo "dirfd() NOT found." >&4 ;;
11818 : see if dlerror exists
11821 set dlerror d_dlerror
11825 : see if dlfcn is available
11826 set dlfcn.h i_dlfcn
11829 : Check what extension to use for shared libs
11834 On a few systems, the dynamically loaded modules that perl generates and uses
11835 will need a different extension than shared libs. The default will probably
11841 *) dflt="$dlext" ;;
11843 rp='What is the extension of dynamically loaded modules'
11852 : Check if dlsym need a leading underscore
11858 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
11859 $cat >dyna.c <<'EOM'
11866 #$i_stdlib I_STDLIB
11868 #include <stdlib.h>
11872 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
11874 #include <sys/types.h>
11879 extern int fred() ;
11888 int mode = RTLD_LAZY ;
11890 handle = dlopen("./dyna.$dlext", mode) ;
11891 if (handle == NULL) {
11896 symbol = dlsym(handle, "fred") ;
11897 if (symbol == NULL) {
11898 /* try putting a leading underscore */
11899 symbol = dlsym(handle, "_fred") ;
11900 if (symbol == NULL) {
11913 : Call the object file tmp-dyna.o in case dlext=o.
11914 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
11915 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
11916 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
11917 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
11920 1) echo "Test program failed using dlopen." >&4
11921 echo "Perhaps you should not use dynamic loading." >&4;;
11922 2) echo "Test program failed using dlsym." >&4
11923 echo "Perhaps you should not use dynamic loading." >&4;;
11924 3) echo "dlsym needs a leading underscore" >&4
11926 4) echo "dlsym doesn't need a leading underscore." >&4;;
11929 echo "I can't compile and run the test program." >&4
11930 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
11935 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
11940 : see if drand48_r exists
11941 set drand48_r d_drand48_r
11943 case "$d_drand48_r" in
11945 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
11946 case "$d_drand48_r_proto:$usethreads" in
11947 ":define") d_drand48_r_proto=define
11948 set d_drand48_r_proto drand48_r $hdrs
11952 case "$d_drand48_r_proto" in
11954 case "$drand48_r_proto" in
11955 ''|0) try='int drand48_r(struct drand48_data*, double*);'
11956 ./protochk "$extern_C $try" $hdrs && drand48_r_proto=I_ST ;;
11958 case "$drand48_r_proto" in
11959 ''|0) d_drand48_r=undef
11961 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
11962 * ) case "$drand48_r_proto" in
11963 REENTRANT_PROTO*) ;;
11964 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
11966 echo "Prototype: $try" ;;
11969 *) case "$usethreads" in
11970 define) echo "drand48_r has no prototype, not using it." >&4 ;;
11977 *) drand48_r_proto=0
11981 : see if prototype for drand48 is available
11983 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
11986 : see if dup2 exists
11990 : see if eaccess exists
11991 set eaccess d_eaccess
11994 : see if endgrent exists
11995 set endgrent d_endgrent
11998 : see if this is an grp system
12004 xxx=`./findhdr grp.h`
12005 $cppstdin $cppflags $cppminus < $xxx >$$.h
12007 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
12019 set d_grpasswd; eval $setvar
12023 : see if endgrent_r exists
12024 set endgrent_r d_endgrent_r
12026 case "$d_endgrent_r" in
12028 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12029 case "$d_endgrent_r_proto:$usethreads" in
12030 ":define") d_endgrent_r_proto=define
12031 set d_endgrent_r_proto endgrent_r $hdrs
12035 case "$d_endgrent_r_proto" in
12037 case "$endgrent_r_proto" in
12038 ''|0) try='int endgrent_r(FILE**);'
12039 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=I_H ;;
12041 case "$endgrent_r_proto" in
12042 ''|0) try='void endgrent_r(FILE**);'
12043 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=V_H ;;
12045 case "$endgrent_r_proto" in
12046 ''|0) d_endgrent_r=undef
12048 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
12049 * ) case "$endgrent_r_proto" in
12050 REENTRANT_PROTO*) ;;
12051 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
12053 echo "Prototype: $try" ;;
12056 *) case "$usethreads" in
12057 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
12064 *) endgrent_r_proto=0
12068 : see if endhostent exists
12069 set endhostent d_endhent
12072 : see if this is a netdb.h system
12073 set netdb.h i_netdb
12076 : see if endhostent_r exists
12077 set endhostent_r d_endhostent_r
12079 case "$d_endhostent_r" in
12081 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12082 case "$d_endhostent_r_proto:$usethreads" in
12083 ":define") d_endhostent_r_proto=define
12084 set d_endhostent_r_proto endhostent_r $hdrs
12088 case "$d_endhostent_r_proto" in
12090 case "$endhostent_r_proto" in
12091 ''|0) try='int endhostent_r(struct hostent_data*);'
12092 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=I_D ;;
12094 case "$endhostent_r_proto" in
12095 ''|0) try='void endhostent_r(struct hostent_data*);'
12096 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=V_D ;;
12098 case "$endhostent_r_proto" in
12099 ''|0) d_endhostent_r=undef
12100 endhostent_r_proto=0
12101 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
12102 * ) case "$endhostent_r_proto" in
12103 REENTRANT_PROTO*) ;;
12104 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
12106 echo "Prototype: $try" ;;
12109 *) case "$usethreads" in
12110 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
12112 d_endhostent_r=undef
12113 endhostent_r_proto=0
12117 *) endhostent_r_proto=0
12121 : see if endnetent exists
12122 set endnetent d_endnent
12125 : see if endnetent_r exists
12126 set endnetent_r d_endnetent_r
12128 case "$d_endnetent_r" in
12130 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12131 case "$d_endnetent_r_proto:$usethreads" in
12132 ":define") d_endnetent_r_proto=define
12133 set d_endnetent_r_proto endnetent_r $hdrs
12137 case "$d_endnetent_r_proto" in
12139 case "$endnetent_r_proto" in
12140 ''|0) try='int endnetent_r(struct netent_data*);'
12141 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=I_D ;;
12143 case "$endnetent_r_proto" in
12144 ''|0) try='void endnetent_r(struct netent_data*);'
12145 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=V_D ;;
12147 case "$endnetent_r_proto" in
12148 ''|0) d_endnetent_r=undef
12149 endnetent_r_proto=0
12150 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
12151 * ) case "$endnetent_r_proto" in
12152 REENTRANT_PROTO*) ;;
12153 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
12155 echo "Prototype: $try" ;;
12158 *) case "$usethreads" in
12159 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
12161 d_endnetent_r=undef
12162 endnetent_r_proto=0
12166 *) endnetent_r_proto=0
12170 : see if endprotoent exists
12171 set endprotoent d_endpent
12174 : see if endprotoent_r exists
12175 set endprotoent_r d_endprotoent_r
12177 case "$d_endprotoent_r" in
12179 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12180 case "$d_endprotoent_r_proto:$usethreads" in
12181 ":define") d_endprotoent_r_proto=define
12182 set d_endprotoent_r_proto endprotoent_r $hdrs
12186 case "$d_endprotoent_r_proto" in
12188 case "$endprotoent_r_proto" in
12189 ''|0) try='int endprotoent_r(struct protoent_data*);'
12190 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=I_D ;;
12192 case "$endprotoent_r_proto" in
12193 ''|0) try='void endprotoent_r(struct protoent_data*);'
12194 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=V_D ;;
12196 case "$endprotoent_r_proto" in
12197 ''|0) d_endprotoent_r=undef
12198 endprotoent_r_proto=0
12199 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
12200 * ) case "$endprotoent_r_proto" in
12201 REENTRANT_PROTO*) ;;
12202 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
12204 echo "Prototype: $try" ;;
12207 *) case "$usethreads" in
12208 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
12210 d_endprotoent_r=undef
12211 endprotoent_r_proto=0
12215 *) endprotoent_r_proto=0
12219 : see if endpwent exists
12220 set endpwent d_endpwent
12223 : see if this is a pwd.h system
12229 xxx=`./findhdr pwd.h`
12230 $cppstdin $cppflags $cppminus < $xxx >$$.h
12232 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
12240 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
12248 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
12256 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
12264 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
12272 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
12280 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
12288 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
12300 set d_pwquota; eval $setvar
12301 set d_pwage; eval $setvar
12302 set d_pwchange; eval $setvar
12303 set d_pwclass; eval $setvar
12304 set d_pwexpire; eval $setvar
12305 set d_pwcomment; eval $setvar
12306 set d_pwgecos; eval $setvar
12307 set d_pwpasswd; eval $setvar
12311 : see if endpwent_r exists
12312 set endpwent_r d_endpwent_r
12314 case "$d_endpwent_r" in
12316 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
12317 case "$d_endpwent_r_proto:$usethreads" in
12318 ":define") d_endpwent_r_proto=define
12319 set d_endpwent_r_proto endpwent_r $hdrs
12323 case "$d_endpwent_r_proto" in
12325 case "$endpwent_r_proto" in
12326 ''|0) try='int endpwent_r(FILE**);'
12327 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=I_H ;;
12329 case "$endpwent_r_proto" in
12330 ''|0) try='void endpwent_r(FILE**);'
12331 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=V_H ;;
12333 case "$endpwent_r_proto" in
12334 ''|0) d_endpwent_r=undef
12336 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
12337 * ) case "$endpwent_r_proto" in
12338 REENTRANT_PROTO*) ;;
12339 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
12341 echo "Prototype: $try" ;;
12344 *) case "$usethreads" in
12345 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
12352 *) endpwent_r_proto=0
12356 : see if endservent exists
12357 set endservent d_endsent
12360 : see if endservent_r exists
12361 set endservent_r d_endservent_r
12363 case "$d_endservent_r" in
12365 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12366 case "$d_endservent_r_proto:$usethreads" in
12367 ":define") d_endservent_r_proto=define
12368 set d_endservent_r_proto endservent_r $hdrs
12372 case "$d_endservent_r_proto" in
12374 case "$endservent_r_proto" in
12375 ''|0) try='int endservent_r(struct servent_data*);'
12376 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=I_D ;;
12378 case "$endservent_r_proto" in
12379 ''|0) try='void endservent_r(struct servent_data*);'
12380 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=V_D ;;
12382 case "$endservent_r_proto" in
12383 ''|0) d_endservent_r=undef
12384 endservent_r_proto=0
12385 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
12386 * ) case "$endservent_r_proto" in
12387 REENTRANT_PROTO*) ;;
12388 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
12390 echo "Prototype: $try" ;;
12393 *) case "$usethreads" in
12394 define) echo "endservent_r has no prototype, not using it." >&4 ;;
12396 d_endservent_r=undef
12397 endservent_r_proto=0
12401 *) endservent_r_proto=0
12405 : Locate the flags for 'open()'
12408 #include <sys/types.h>
12413 #include <sys/file.h>
12415 #$i_stdlib I_STDLIB
12417 #include <stdlib.h>
12428 : check sys/file.h first to get FREAD on Sun
12429 if $test `./findhdr sys/file.h` && \
12430 set try -DI_SYS_FILE && eval $compile; then
12432 echo "<sys/file.h> defines the O_* constants..." >&4
12433 if $run ./try; then
12434 echo "and you have the 3 argument form of open()." >&4
12437 echo "but not the 3 argument form of open(). Oh, well." >&4
12440 elif $test `./findhdr fcntl.h` && \
12441 set try -DI_FCNTL && eval $compile; then
12443 echo "<fcntl.h> defines the O_* constants..." >&4
12444 if $run ./try; then
12445 echo "and you have the 3 argument form of open()." >&4
12448 echo "but not the 3 argument form of open(). Oh, well." >&4
12453 echo "I can't find the O_* constant definitions! You got problems." >&4
12459 : see if this is a sys/file.h system
12464 : do we need to include sys/file.h ?
12468 if $h_sysfile; then
12470 echo "We'll be including <sys/file.h>." >&4
12473 echo "We won't be including <sys/file.h>." >&4
12483 : see if fcntl.h is there
12488 : see if we can include fcntl.h
12494 echo "We'll be including <fcntl.h>." >&4
12497 if $h_sysfile; then
12498 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
12500 echo "We won't be including <fcntl.h>." >&4
12512 : see if fork exists
12516 : see if pipe exists
12520 : check for non-blocking I/O stuff
12521 case "$h_sysfile" in
12522 true) echo "#include <sys/file.h>" > head.c;;
12525 true) echo "#include <fcntl.h>" > head.c;;
12526 *) echo "#include <sys/fcntl.h>" > head.c;;
12531 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
12532 case "$o_nonblock" in
12534 $cat head.c > try.c
12535 $cat >>try.c <<EOCP
12537 #$i_stdlib I_STDLIB
12539 #include <stdlib.h>
12547 printf("O_NONBLOCK\n");
12551 printf("O_NDELAY\n");
12555 printf("FNDELAY\n");
12562 if eval $compile_ok; then
12563 o_nonblock=`$run ./try`
12564 case "$o_nonblock" in
12565 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
12566 *) echo "Seems like we can use $o_nonblock.";;
12569 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
12572 *) echo "Using $hint value $o_nonblock.";;
12577 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
12580 case "$d_fork:$d_pipe" in
12582 $cat head.c > try.c
12583 $cat >>try.c <<EOCP
12585 #include <sys/types.h>
12586 #include <signal.h>
12588 #$i_stdlib I_STDLIB
12590 #include <stdlib.h>
12596 #define MY_O_NONBLOCK $o_nonblock
12597 #ifndef errno /* XXX need better Configure test */
12600 #$i_unistd I_UNISTD
12602 #include <unistd.h>
12604 #$i_string I_STRING
12606 #include <string.h>
12608 #include <strings.h>
12610 $signal_t blech(int x) { exit(3); }
12612 $cat >> try.c <<'EOCP'
12620 pipe(pd); /* Down: child -> parent */
12621 pipe(pu); /* Up: parent -> child */
12624 close(pd[1]); /* Parent reads from pd[0] */
12625 close(pu[0]); /* Parent writes (blocking) to pu[1] */
12627 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
12632 signal(SIGALRM, blech);
12634 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
12636 sprintf(string, "%d\n", ret);
12637 write(2, string, strlen(string));
12640 if (errno == EAGAIN) {
12641 printf("EAGAIN\n");
12646 if (errno == EWOULDBLOCK)
12647 printf("EWOULDBLOCK\n");
12650 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
12651 sleep(2); /* Give it time to close our pipe */
12653 ret = read(pd[0], buf, 1); /* Should read EOF */
12655 sprintf(string, "%d\n", ret);
12656 write(4, string, strlen(string));
12660 close(pd[0]); /* We write to pd[1] */
12661 close(pu[1]); /* We read from pu[0] */
12662 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
12663 close(pd[1]); /* Pipe pd is now fully closed! */
12664 exit(0); /* Bye bye, thank you for playing! */
12668 if eval $compile_ok; then
12669 echo "$startsh" >mtry
12670 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
12672 ./mtry >/dev/null 2>&1
12674 0) eagain=`$cat try.out`;;
12675 1) echo "Could not perform non-blocking setting!";;
12676 2) echo "I did a successful read() for something that was not there!";;
12677 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
12678 4) echo "Could not find F_SETFL!";;
12679 *) echo "Something terribly wrong happened during testing.";;
12681 rd_nodata=`$cat try.ret`
12682 echo "A read() system call with no data present returns $rd_nodata."
12683 case "$rd_nodata" in
12686 echo "(That's peculiar, fixing that to be -1.)"
12692 echo "Forcing errno EAGAIN on read() with no data available."
12696 echo "Your read() sets errno to $eagain when no data is available."
12699 status=`$cat try.err`
12701 0) echo "And it correctly returns 0 to signal EOF.";;
12702 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
12703 *) echo "However, your read() returns '$status' on EOF??";;
12706 if test "$status" = "$rd_nodata"; then
12707 echo "WARNING: you can't distinguish between EOF and no data!"
12711 echo "I can't compile the test program--assuming errno EAGAIN will do."
12715 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
12724 echo "Using $hint value $eagain."
12725 echo "Your read() returns $rd_nodata when no data is present."
12726 case "$d_eofnblk" in
12727 "$define") echo "And you can see EOF because read() returns 0.";;
12728 "$undef") echo "But you can't see EOF status from read() returned value.";;
12730 echo "(Assuming you can't see EOF status from read anyway.)"
12736 $rm_try head.c mtry
12738 : see if _ptr and _cnt from stdio act std
12741 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
12742 echo "(Looks like you have stdio.h from BSD.)"
12743 case "$stdio_ptr" in
12744 '') stdio_ptr='((fp)->_p)'
12747 *) ptr_lval=$d_stdio_ptr_lval;;
12749 case "$stdio_cnt" in
12750 '') stdio_cnt='((fp)->_r)'
12753 *) cnt_lval=$d_stdio_cnt_lval;;
12755 case "$stdio_base" in
12756 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
12758 case "$stdio_bufsiz" in
12759 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
12761 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
12762 echo "(Looks like you have stdio.h from Linux.)"
12763 case "$stdio_ptr" in
12764 '') stdio_ptr='((fp)->_IO_read_ptr)'
12767 *) ptr_lval=$d_stdio_ptr_lval;;
12769 case "$stdio_cnt" in
12770 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
12773 *) cnt_lval=$d_stdio_cnt_lval;;
12775 case "$stdio_base" in
12776 '') stdio_base='((fp)->_IO_read_base)';;
12778 case "$stdio_bufsiz" in
12779 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
12782 case "$stdio_ptr" in
12783 '') stdio_ptr='((fp)->_ptr)'
12786 *) ptr_lval=$d_stdio_ptr_lval;;
12788 case "$stdio_cnt" in
12789 '') stdio_cnt='((fp)->_cnt)'
12792 *) cnt_lval=$d_stdio_cnt_lval;;
12794 case "$stdio_base" in
12795 '') stdio_base='((fp)->_base)';;
12797 case "$stdio_bufsiz" in
12798 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
12802 : test whether _ptr and _cnt really work
12803 echo "Checking how std your stdio is..." >&4
12806 #$i_stdlib I_STDLIB
12808 #include <stdlib.h>
12810 #define FILE_ptr(fp) $stdio_ptr
12811 #define FILE_cnt(fp) $stdio_cnt
12813 FILE *fp = fopen("try.c", "r");
12816 18 <= FILE_cnt(fp) &&
12817 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12825 if eval $compile && $to try.c; then
12826 if $run ./try; then
12827 echo "Your stdio acts pretty std."
12830 echo "Your stdio isn't very std."
12833 echo "Your stdio doesn't appear very std."
12837 # glibc 2.2.90 and above apparently change stdio streams so Perl's
12838 # direct buffer manipulation no longer works. The Configure tests
12839 # should be changed to correctly detect this, but until then,
12840 # the following check should at least let perl compile and run.
12841 # (This quick fix should be updated before 5.8.1.)
12842 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
12843 # A. Dougherty, June 3, 2002.
12844 case "$d_gnulibc" in
12846 case "$gnulibc_version" in
12850 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
12859 : Can _ptr be used as an lvalue?
12860 case "$d_stdstdio$ptr_lval" in
12861 $define$define) val=$define ;;
12864 set d_stdio_ptr_lval
12867 : Can _cnt be used as an lvalue?
12868 case "$d_stdstdio$cnt_lval" in
12869 $define$define) val=$define ;;
12872 set d_stdio_cnt_lval
12876 : test whether setting _ptr sets _cnt as a side effect
12877 d_stdio_ptr_lval_sets_cnt="$undef"
12878 d_stdio_ptr_lval_nochange_cnt="$undef"
12879 case "$d_stdio_ptr_lval$d_stdstdio" in
12881 echo "Checking to see what happens if we set the stdio ptr..." >&4
12884 /* Can we scream? */
12885 /* Eat dust sed :-) */
12886 /* In the buffer space, no one can hear you scream. */
12887 #$i_stdlib I_STDLIB
12889 #include <stdlib.h>
12891 #define FILE_ptr(fp) $stdio_ptr
12892 #define FILE_cnt(fp) $stdio_cnt
12893 #include <sys/types.h>
12895 FILE *fp = fopen("try.c", "r");
12900 puts("Fail even to read");
12903 c = getc(fp); /* Read away the first # */
12905 puts("Fail even to read");
12909 18 <= FILE_cnt(fp) &&
12910 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12912 puts("Fail even to read");
12915 ptr = (char*) FILE_ptr(fp);
12916 cnt = (size_t)FILE_cnt(fp);
12918 FILE_ptr(fp) += 42;
12920 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
12921 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
12924 if (FILE_cnt(fp) <= 20) {
12925 printf ("Fail (<20 chars to test)");
12928 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
12929 puts("Fail compare");
12932 if (cnt == FILE_cnt(fp)) {
12933 puts("Pass_unchanged");
12936 if (FILE_cnt(fp) == (cnt - 42)) {
12937 puts("Pass_changed");
12940 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
12946 if eval $compile && $to try.c; then
12947 case `$run ./try` in
12949 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
12950 d_stdio_ptr_lval_sets_cnt="$define" ;;
12952 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
12953 d_stdio_ptr_lval_nochange_cnt="$define" ;;
12955 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
12957 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
12960 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
12966 : see if _base is also standard
12968 case "$d_stdstdio" in
12972 #$i_stdlib I_STDLIB
12974 #include <stdlib.h>
12976 #define FILE_base(fp) $stdio_base
12977 #define FILE_bufsiz(fp) $stdio_bufsiz
12979 FILE *fp = fopen("try.c", "r");
12982 19 <= FILE_bufsiz(fp) &&
12983 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
12990 if eval $compile && $to try.c; then
12991 if $run ./try; then
12992 echo "And its _base field acts std."
12995 echo "But its _base field isn't std."
12998 echo "However, it seems to be lacking the _base field."
13006 : see if fast_stdio exists
13008 case "$d_stdstdio:$d_stdio_ptr_lval" in
13010 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
13012 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
13023 : see if fchdir exists
13024 set fchdir d_fchdir
13027 : see if fchmod exists
13028 set fchmod d_fchmod
13031 : see if fchown exists
13032 set fchown d_fchown
13035 : see if this is an fcntl system
13039 : See if fcntl-based locking works.
13042 #$i_stdlib I_STDLIB
13044 #include <stdlib.h>
13046 #include <unistd.h>
13048 #include <signal.h>
13049 $signal_t blech(int x) { exit(3); }
13051 #if defined(F_SETLK) && defined(F_SETLKW)
13052 struct flock flock;
13054 fd = open("try.c", O_RDONLY);
13055 flock.l_type = F_RDLCK;
13056 flock.l_whence = SEEK_SET;
13057 flock.l_start = flock.l_len = 0;
13058 signal(SIGALRM, blech);
13060 retval = fcntl(fd, F_SETLK, &flock);
13062 (retval < 0 ? exit(2) : exit(0));
13068 echo "Checking if fcntl-based file locking works... "
13072 if eval $compile_ok; then
13073 if $run ./try; then
13074 echo "Yes, it seems to work."
13077 echo "Nope, it didn't work."
13082 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
13083 *** This is (almost) impossible.
13084 *** If your NFS lock daemons are not feeling well, something like
13085 *** this may happen, please investigate. Cannot continue, aborting.
13093 echo "I'm unable to compile the test program, so I'll assume not."
13098 echo "Nope, since you don't even have fcntl()."
13101 set d_fcntl_can_lock
13105 : check for fd_set items
13108 Checking to see how well your C compiler handles fd_set and friends ...
13111 #$i_stdlib I_STDLIB
13113 #include <stdlib.h>
13115 #$i_systime I_SYS_TIME
13116 #$i_sysselct I_SYS_SELECT
13117 #$d_socket HAS_SOCKET
13118 #include <sys/types.h>
13120 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
13123 #include <sys/time.h>
13125 #ifdef I_SYS_SELECT
13126 #include <sys/select.h>
13135 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
13143 if eval $compile; then
13144 d_fds_bits="$define"
13146 echo "Well, your system knows about the normal fd_set typedef..." >&4
13147 if $run ./try; then
13148 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
13149 d_fd_macros="$define"
13152 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
13154 d_fd_macros="$undef"
13158 Hmm, your compiler has some difficulty with fd_set. Checking further...
13161 if eval $compile; then
13162 d_fds_bits="$undef"
13164 echo "Well, your system has some sort of fd_set available..." >&4
13165 if $run ./try; then
13166 echo "and you have the normal fd_set macros." >&4
13167 d_fd_macros="$define"
13170 but not the normal fd_set macros! Gross! More work for me...
13172 d_fd_macros="$undef"
13175 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
13177 d_fds_bits="$undef"
13178 d_fd_macros="$undef"
13183 : see if fgetpos exists
13184 set fgetpos d_fgetpos
13187 : see if finite exists
13188 set finite d_finite
13191 : see if finitel exists
13192 set finitel d_finitel
13195 : see if flock exists
13199 : see if prototype for flock is available
13201 set d_flockproto flock $i_sysfile sys/file.h
13204 : see if fp_class exists
13205 set fp_class d_fp_class
13208 : see if pathconf exists
13209 set pathconf d_pathconf
13212 : see if fpathconf exists
13213 set fpathconf d_fpathconf
13216 : see if fpclass exists
13217 set fpclass d_fpclass
13220 : see if fpclassify exists
13221 set fpclassify d_fpclassify
13224 : see if fpclassl exists
13225 set fpclassl d_fpclassl
13228 : check for fpos64_t
13230 echo "Checking to see if you have fpos64_t..." >&4
13233 int main() { fpos64_t x = 7; }
13236 if eval $compile; then
13238 echo "You have fpos64_t."
13241 echo "You do not have fpos64_t."
13242 case "$fpossize" in
13243 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
13250 : see if frexpl exists
13251 set frexpl d_frexpl
13254 : see if this is a sys/param system
13255 set sys/param.h i_sysparam
13258 : see if this is a sys/mount.h system
13259 set sys/mount.h i_sysmount
13262 : Check for fs_data_s
13264 echo "Checking to see if your system supports struct fs_data..." >&4
13265 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
13267 case "$d_fs_data_s" in
13268 "$define") echo "Yes, it does." ;;
13269 *) echo "No, it doesn't." ;;
13272 : see if fseeko exists
13273 set fseeko d_fseeko
13275 case "$longsize" in
13276 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
13279 : see if fsetpos exists
13280 set fsetpos d_fsetpos
13283 : see if fstatfs exists
13284 set fstatfs d_fstatfs
13287 : see if statvfs exists
13288 set statvfs d_statvfs
13291 : see if fstatvfs exists
13292 set fstatvfs d_fstatvfs
13296 : see if fsync exists
13300 : see if ftello exists
13301 set ftello d_ftello
13303 case "$longsize" in
13304 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
13307 : check for a working futimes
13310 echo "Checking if you have a working futimes()" >&4
13313 #include <sys/time.h>
13320 fd = open ("try.c", O_RDWR);
13321 if (-1 == fd) exit (1);
13322 rv = futimes (fd, NULL);
13323 exit (rv == -1 ? errno : 0);
13327 if eval $compile; then
13331 0) echo "Yes, you have" >&4
13332 d_futimes="$define"
13334 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
13338 echo "No, it does not (probably harmless)" >&4
13342 : see if ndbm.h is available
13345 : Compatibility location for RedHat 7.1
13346 set gdbm/ndbm.h i_gdbmndbm
13348 : Compatibility location for Debian 4.0
13349 set gdbm-ndbm.h i_gdbm_ndbm
13353 if $test "$i_ndbm" = "$define" -o "$i_gdbmndbm" = "$define" -o "$i_gdbm_ndbm" = "$define"; then
13354 : see if dbm_open exists
13355 set dbm_open d_dbm_open
13357 case "$d_dbm_open" in
13360 i_gdbmndbm="$undef"
13361 i_gdbm_ndbm="$undef"
13362 echo "We won't be including <ndbm.h>"
13372 ndbm_hdr_protochk='name=$1; hdr=$2;
13373 eval "ihdr=\$""i_$name";
13375 if $test "$ihdr" = "$define"; then
13376 $echo "Checking if your <$hdr> uses prototypes..." >&4;
13377 case "$d_cplusplus" in
13378 $define) ./protochk "$extern_C void dbm_close(DBM *);" literal "extern \"C\" {" $ihdr $hdr literal "}" && val="$define" ;;
13379 *) ./protochk "$extern_C void dbm_close(int, int);" $ihdr $hdr || val="$define" ;;
13382 $define) $echo "Your <$hdr> seems to have prototypes";;
13383 *) $echo "Your <$hdr> does not seem to have prototypes";;
13386 set "d_${name}_h_uses_prototypes";
13390 eval $ndbm_hdr_protochk
13391 set gdbmndbm gdbm/ndbm.h
13392 eval $ndbm_hdr_protochk
13393 set gdbm_ndbm gdbm-ndbm.h
13394 eval $ndbm_hdr_protochk
13396 : see if getaddrinfo exists
13397 set getaddrinfo d_getaddrinfo
13400 : see if getcwd exists
13401 set getcwd d_getcwd
13404 : see if getespwnam exists
13405 set getespwnam d_getespwnam
13408 : see if getfsstat exists
13409 set getfsstat d_getfsstat
13412 : see if getgrent exists
13413 set getgrent d_getgrent
13416 : see if getgrent_r exists
13417 set getgrent_r d_getgrent_r
13419 case "$d_getgrent_r" in
13421 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13422 case "$d_getgrent_r_proto:$usethreads" in
13423 ":define") d_getgrent_r_proto=define
13424 set d_getgrent_r_proto getgrent_r $hdrs
13428 case "$d_getgrent_r_proto" in
13430 case "$getgrent_r_proto" in
13431 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
13432 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBWR ;;
13434 case "$getgrent_r_proto" in
13435 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
13436 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIR ;;
13438 case "$getgrent_r_proto" in
13439 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
13440 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBW ;;
13442 case "$getgrent_r_proto" in
13443 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
13444 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBI ;;
13446 case "$getgrent_r_proto" in
13447 ''|0) try='int getgrent_r(struct group*, char*, int);'
13448 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBI ;;
13450 case "$getgrent_r_proto" in
13451 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
13452 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIH ;;
13454 case "$getgrent_r_proto" in
13455 ''|0) d_getgrent_r=undef
13457 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
13458 * ) case "$getgrent_r_proto" in
13459 REENTRANT_PROTO*) ;;
13460 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
13462 echo "Prototype: $try" ;;
13465 *) case "$usethreads" in
13466 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
13473 *) getgrent_r_proto=0
13477 : see if getgrgid_r exists
13478 set getgrgid_r d_getgrgid_r
13480 case "$d_getgrgid_r" in
13482 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13483 case "$d_getgrgid_r_proto:$usethreads" in
13484 ":define") d_getgrgid_r_proto=define
13485 set d_getgrgid_r_proto getgrgid_r $hdrs
13489 case "$d_getgrgid_r_proto" in
13491 case "$getgrgid_r_proto" in
13492 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
13493 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
13495 case "$getgrgid_r_proto" in
13496 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
13497 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
13499 case "$getgrgid_r_proto" in
13500 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
13501 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
13503 case "$getgrgid_r_proto" in
13504 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
13505 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
13507 case "$getgrgid_r_proto" in
13508 ''|0) d_getgrgid_r=undef
13510 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
13511 * ) case "$getgrgid_r_proto" in
13512 REENTRANT_PROTO*) ;;
13513 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
13515 echo "Prototype: $try" ;;
13518 *) case "$usethreads" in
13519 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
13526 *) getgrgid_r_proto=0
13530 : see if getgrnam_r exists
13531 set getgrnam_r d_getgrnam_r
13533 case "$d_getgrnam_r" in
13535 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13536 case "$d_getgrnam_r_proto:$usethreads" in
13537 ":define") d_getgrnam_r_proto=define
13538 set d_getgrnam_r_proto getgrnam_r $hdrs
13542 case "$d_getgrnam_r_proto" in
13544 case "$getgrnam_r_proto" in
13545 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
13546 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
13548 case "$getgrnam_r_proto" in
13549 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
13550 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
13552 case "$getgrnam_r_proto" in
13553 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
13554 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CBI ;;
13556 case "$getgrnam_r_proto" in
13557 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
13558 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
13560 case "$getgrnam_r_proto" in
13561 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
13562 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
13564 case "$getgrnam_r_proto" in
13565 ''|0) d_getgrnam_r=undef
13567 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
13568 * ) case "$getgrnam_r_proto" in
13569 REENTRANT_PROTO*) ;;
13570 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
13572 echo "Prototype: $try" ;;
13575 *) case "$usethreads" in
13576 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
13583 *) getgrnam_r_proto=0
13587 : see if gethostbyaddr exists
13588 set gethostbyaddr d_gethbyaddr
13591 : see if gethostbyname exists
13592 set gethostbyname d_gethbyname
13595 : see if gethostent exists
13596 set gethostent d_gethent
13599 : see how we will look up host name
13602 if set gethostname val -f d_gethname; eval $csym; $val; then
13603 echo 'gethostname() found.' >&4
13604 d_gethname="$define"
13607 if set uname val -f d_uname; eval $csym; $val; then
13610 uname() was found, but you're running xenix, and older versions of xenix
13611 have a broken uname(). If you don't really know whether your xenix is old
13612 enough to have a broken system call, use the default answer.
13617 "$define") dflt=n;;
13619 rp='Is your uname() broken?'
13622 n*) d_uname="$define"; call=uname;;
13625 echo 'uname() found.' >&4
13632 case "$d_gethname" in
13633 '') d_gethname="$undef";;
13636 '') d_uname="$undef";;
13638 case "$d_uname$d_gethname" in
13643 Every now and then someone has a $call() that lies about the hostname
13644 but can't be fixed for political or economic reasons. If you wish, I can
13645 pretend $call() isn't there and maybe compute hostname at run-time
13646 thanks to the '$phostname' command.
13649 rp="Shall I ignore $call() from now on?"
13652 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
13655 case "$phostname" in
13656 '') aphostname='';;
13657 *) case "$aphostname" in
13659 *) set X $phostname
13663 file=`./loc $file $file $pth`
13664 aphostname=`echo $file $*`
13669 case "$d_uname$d_gethname" in
13672 case "$phostname" in
13674 echo "There will be no way for $package to get your hostname." >&4;;
13676 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
13680 case "$d_phostname" in
13681 '') d_phostname="$undef";;
13684 : see if gethostbyaddr_r exists
13685 set gethostbyaddr_r d_gethostbyaddr_r
13687 case "$d_gethostbyaddr_r" in
13689 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13690 case "$d_gethostbyaddr_r_proto:$usethreads" in
13691 ":define") d_gethostbyaddr_r_proto=define
13692 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
13696 case "$d_gethostbyaddr_r_proto" in
13698 case "$gethostbyaddr_r_proto" in
13699 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13700 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
13702 case "$gethostbyaddr_r_proto" in
13703 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
13704 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
13706 case "$gethostbyaddr_r_proto" in
13707 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
13708 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
13710 case "$gethostbyaddr_r_proto" in
13711 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
13712 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
13714 case "$gethostbyaddr_r_proto" in
13715 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
13716 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
13718 case "$gethostbyaddr_r_proto" in
13719 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
13720 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
13722 case "$gethostbyaddr_r_proto" in
13723 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
13724 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
13726 case "$gethostbyaddr_r_proto" in
13727 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
13728 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
13730 case "$gethostbyaddr_r_proto" in
13731 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
13732 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
13734 case "$gethostbyaddr_r_proto" in
13735 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
13736 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
13738 case "$gethostbyaddr_r_proto" in
13739 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13740 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
13742 case "$gethostbyaddr_r_proto" in
13743 ''|0) d_gethostbyaddr_r=undef
13744 gethostbyaddr_r_proto=0
13745 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
13746 * ) case "$gethostbyaddr_r_proto" in
13747 REENTRANT_PROTO*) ;;
13748 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
13750 echo "Prototype: $try" ;;
13753 *) case "$usethreads" in
13754 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
13756 d_gethostbyaddr_r=undef
13757 gethostbyaddr_r_proto=0
13761 *) gethostbyaddr_r_proto=0
13765 : see if gethostbyname_r exists
13766 set gethostbyname_r d_gethostbyname_r
13768 case "$d_gethostbyname_r" in
13770 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13771 case "$d_gethostbyname_r_proto:$usethreads" in
13772 ":define") d_gethostbyname_r_proto=define
13773 set d_gethostbyname_r_proto gethostbyname_r $hdrs
13777 case "$d_gethostbyname_r_proto" in
13779 case "$gethostbyname_r_proto" in
13780 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
13781 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
13783 case "$gethostbyname_r_proto" in
13784 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
13785 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
13787 case "$gethostbyname_r_proto" in
13788 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
13789 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
13791 case "$gethostbyname_r_proto" in
13792 ''|0) d_gethostbyname_r=undef
13793 gethostbyname_r_proto=0
13794 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
13795 * ) case "$gethostbyname_r_proto" in
13796 REENTRANT_PROTO*) ;;
13797 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
13799 echo "Prototype: $try" ;;
13802 *) case "$usethreads" in
13803 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
13805 d_gethostbyname_r=undef
13806 gethostbyname_r_proto=0
13810 *) gethostbyname_r_proto=0
13814 : see if gethostent_r exists
13815 set gethostent_r d_gethostent_r
13817 case "$d_gethostent_r" in
13819 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13820 case "$d_gethostent_r_proto:$usethreads" in
13821 ":define") d_gethostent_r_proto=define
13822 set d_gethostent_r_proto gethostent_r $hdrs
13826 case "$d_gethostent_r_proto" in
13828 case "$gethostent_r_proto" in
13829 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
13830 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
13832 case "$gethostent_r_proto" in
13833 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
13834 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBIE ;;
13836 case "$gethostent_r_proto" in
13837 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
13838 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBIE ;;
13840 case "$gethostent_r_proto" in
13841 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
13842 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBI ;;
13844 case "$gethostent_r_proto" in
13845 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
13846 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBI ;;
13848 case "$gethostent_r_proto" in
13849 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
13850 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SD ;;
13852 case "$gethostent_r_proto" in
13853 ''|0) d_gethostent_r=undef
13854 gethostent_r_proto=0
13855 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
13856 * ) case "$gethostent_r_proto" in
13857 REENTRANT_PROTO*) ;;
13858 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
13860 echo "Prototype: $try" ;;
13863 *) case "$usethreads" in
13864 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
13866 d_gethostent_r=undef
13867 gethostent_r_proto=0
13871 *) gethostent_r_proto=0
13875 : see if prototypes for various gethostxxx netdb.h functions are available
13877 set d_gethostprotos gethostent $i_netdb netdb.h
13880 : see if getitimer exists
13881 set getitimer d_getitimer
13884 : see if getlogin exists
13885 set getlogin d_getlogin
13888 : see if getlogin_r exists
13889 set getlogin_r d_getlogin_r
13891 case "$d_getlogin_r" in
13893 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
13894 case "$d_getlogin_r_proto:$usethreads" in
13895 ":define") d_getlogin_r_proto=define
13896 set d_getlogin_r_proto getlogin_r $hdrs
13900 case "$d_getlogin_r_proto" in
13902 case "$getlogin_r_proto" in
13903 ''|0) try='int getlogin_r(char*, size_t);'
13904 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BW ;;
13906 case "$getlogin_r_proto" in
13907 ''|0) try='int getlogin_r(char*, int);'
13908 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BI ;;
13910 case "$getlogin_r_proto" in
13911 ''|0) try='char* getlogin_r(char*, size_t);'
13912 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BW ;;
13914 case "$getlogin_r_proto" in
13915 ''|0) try='char* getlogin_r(char*, int);'
13916 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BI ;;
13918 case "$getlogin_r_proto" in
13919 ''|0) d_getlogin_r=undef
13921 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
13922 * ) case "$getlogin_r_proto" in
13923 REENTRANT_PROTO*) ;;
13924 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
13926 echo "Prototype: $try" ;;
13929 *) case "$usethreads" in
13930 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
13937 *) getlogin_r_proto=0
13941 : see if getmnt exists
13942 set getmnt d_getmnt
13945 : see if getmntent exists
13946 set getmntent d_getmntent
13949 : see if getnameinfo exists
13950 set getnameinfo d_getnameinfo
13953 : see if getnetbyaddr exists
13954 set getnetbyaddr d_getnbyaddr
13957 : see if getnetbyname exists
13958 set getnetbyname d_getnbyname
13961 : see if getnetent exists
13962 set getnetent d_getnent
13965 : see if getnetbyaddr_r exists
13966 set getnetbyaddr_r d_getnetbyaddr_r
13968 case "$d_getnetbyaddr_r" in
13970 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13971 case "$d_getnetbyaddr_r_proto:$usethreads" in
13972 ":define") d_getnetbyaddr_r_proto=define
13973 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
13977 case "$d_getnetbyaddr_r_proto" in
13979 case "$getnetbyaddr_r_proto" in
13980 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
13981 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
13983 case "$getnetbyaddr_r_proto" in
13984 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
13985 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
13987 case "$getnetbyaddr_r_proto" in
13988 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
13989 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
13991 case "$getnetbyaddr_r_proto" in
13992 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
13993 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
13995 case "$getnetbyaddr_r_proto" in
13996 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
13997 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
13999 case "$getnetbyaddr_r_proto" in
14000 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
14001 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
14003 case "$getnetbyaddr_r_proto" in
14004 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
14005 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
14007 case "$getnetbyaddr_r_proto" in
14008 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
14009 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
14011 case "$getnetbyaddr_r_proto" in
14012 ''|0) d_getnetbyaddr_r=undef
14013 getnetbyaddr_r_proto=0
14014 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
14015 * ) case "$getnetbyaddr_r_proto" in
14016 REENTRANT_PROTO*) ;;
14017 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
14019 echo "Prototype: $try" ;;
14022 *) case "$usethreads" in
14023 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
14025 d_getnetbyaddr_r=undef
14026 getnetbyaddr_r_proto=0
14030 *) getnetbyaddr_r_proto=0
14034 : see if getnetbyname_r exists
14035 set getnetbyname_r d_getnetbyname_r
14037 case "$d_getnetbyname_r" in
14039 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14040 case "$d_getnetbyname_r_proto:$usethreads" in
14041 ":define") d_getnetbyname_r_proto=define
14042 set d_getnetbyname_r_proto getnetbyname_r $hdrs
14046 case "$d_getnetbyname_r_proto" in
14048 case "$getnetbyname_r_proto" in
14049 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
14050 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
14052 case "$getnetbyname_r_proto" in
14053 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
14054 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
14056 case "$getnetbyname_r_proto" in
14057 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
14058 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
14060 case "$getnetbyname_r_proto" in
14061 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
14062 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
14064 case "$getnetbyname_r_proto" in
14065 ''|0) d_getnetbyname_r=undef
14066 getnetbyname_r_proto=0
14067 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
14068 * ) case "$getnetbyname_r_proto" in
14069 REENTRANT_PROTO*) ;;
14070 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
14072 echo "Prototype: $try" ;;
14075 *) case "$usethreads" in
14076 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
14078 d_getnetbyname_r=undef
14079 getnetbyname_r_proto=0
14083 *) getnetbyname_r_proto=0
14087 : see if getnetent_r exists
14088 set getnetent_r d_getnetent_r
14090 case "$d_getnetent_r" in
14092 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14093 case "$d_getnetent_r_proto:$usethreads" in
14094 ":define") d_getnetent_r_proto=define
14095 set d_getnetent_r_proto getnetent_r $hdrs
14099 case "$d_getnetent_r_proto" in
14101 case "$getnetent_r_proto" in
14102 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
14103 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
14105 case "$getnetent_r_proto" in
14106 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
14107 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBIE ;;
14109 case "$getnetent_r_proto" in
14110 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
14111 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBIE ;;
14113 case "$getnetent_r_proto" in
14114 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
14115 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBI ;;
14117 case "$getnetent_r_proto" in
14118 ''|0) try='int getnetent_r(struct netent*, char*, int);'
14119 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBI ;;
14121 case "$getnetent_r_proto" in
14122 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
14123 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SD ;;
14125 case "$getnetent_r_proto" in
14126 ''|0) d_getnetent_r=undef
14127 getnetent_r_proto=0
14128 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
14129 * ) case "$getnetent_r_proto" in
14130 REENTRANT_PROTO*) ;;
14131 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
14133 echo "Prototype: $try" ;;
14136 *) case "$usethreads" in
14137 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
14139 d_getnetent_r=undef
14140 getnetent_r_proto=0
14144 *) getnetent_r_proto=0
14148 : see if prototypes for various getnetxxx netdb.h functions are available
14150 set d_getnetprotos getnetent $i_netdb netdb.h
14153 : see if getpagesize exists
14154 set getpagesize d_getpagsz
14157 : Optional checks for getprotobyname and getprotobynumber
14159 : see if getprotobyname exists
14160 set getprotobyname d_getpbyname
14163 : see if getprotobynumber exists
14164 set getprotobynumber d_getpbynumber
14167 : see if getprotoent exists
14168 set getprotoent d_getpent
14171 : see if getpgid exists
14172 set getpgid d_getpgid
14175 : see if getpgrp2 exists
14176 set getpgrp2 d_getpgrp2
14179 : see if getppid exists
14180 set getppid d_getppid
14183 : see if getpriority exists
14184 set getpriority d_getprior
14187 : see if getprotobyname_r exists
14188 set getprotobyname_r d_getprotobyname_r
14190 case "$d_getprotobyname_r" in
14192 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14193 case "$d_getprotobyname_r_proto:$usethreads" in
14194 ":define") d_getprotobyname_r_proto=define
14195 set d_getprotobyname_r_proto getprotobyname_r $hdrs
14199 case "$d_getprotobyname_r_proto" in
14201 case "$getprotobyname_r_proto" in
14202 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
14203 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
14205 case "$getprotobyname_r_proto" in
14206 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
14207 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
14209 case "$getprotobyname_r_proto" in
14210 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
14211 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
14213 case "$getprotobyname_r_proto" in
14214 ''|0) d_getprotobyname_r=undef
14215 getprotobyname_r_proto=0
14216 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
14217 * ) case "$getprotobyname_r_proto" in
14218 REENTRANT_PROTO*) ;;
14219 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
14221 echo "Prototype: $try" ;;
14224 *) case "$usethreads" in
14225 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
14227 d_getprotobyname_r=undef
14228 getprotobyname_r_proto=0
14232 *) getprotobyname_r_proto=0
14236 : see if getprotobynumber_r exists
14237 set getprotobynumber_r d_getprotobynumber_r
14239 case "$d_getprotobynumber_r" in
14241 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14242 case "$d_getprotobynumber_r_proto:$usethreads" in
14243 ":define") d_getprotobynumber_r_proto=define
14244 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
14248 case "$d_getprotobynumber_r_proto" in
14250 case "$getprotobynumber_r_proto" in
14251 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
14252 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
14254 case "$getprotobynumber_r_proto" in
14255 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
14256 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
14258 case "$getprotobynumber_r_proto" in
14259 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
14260 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
14262 case "$getprotobynumber_r_proto" in
14263 ''|0) d_getprotobynumber_r=undef
14264 getprotobynumber_r_proto=0
14265 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
14266 * ) case "$getprotobynumber_r_proto" in
14267 REENTRANT_PROTO*) ;;
14268 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
14270 echo "Prototype: $try" ;;
14273 *) case "$usethreads" in
14274 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
14276 d_getprotobynumber_r=undef
14277 getprotobynumber_r_proto=0
14281 *) getprotobynumber_r_proto=0
14285 : see if getprotoent_r exists
14286 set getprotoent_r d_getprotoent_r
14288 case "$d_getprotoent_r" in
14290 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14291 case "$d_getprotoent_r_proto:$usethreads" in
14292 ":define") d_getprotoent_r_proto=define
14293 set d_getprotoent_r_proto getprotoent_r $hdrs
14297 case "$d_getprotoent_r_proto" in
14299 case "$getprotoent_r_proto" in
14300 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
14301 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
14303 case "$getprotoent_r_proto" in
14304 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
14305 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBI ;;
14307 case "$getprotoent_r_proto" in
14308 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
14309 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=S_SBI ;;
14311 case "$getprotoent_r_proto" in
14312 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
14313 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SD ;;
14315 case "$getprotoent_r_proto" in
14316 ''|0) d_getprotoent_r=undef
14317 getprotoent_r_proto=0
14318 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
14319 * ) case "$getprotoent_r_proto" in
14320 REENTRANT_PROTO*) ;;
14321 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
14323 echo "Prototype: $try" ;;
14326 *) case "$usethreads" in
14327 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
14329 d_getprotoent_r=undef
14330 getprotoent_r_proto=0
14334 *) getprotoent_r_proto=0
14338 : see if prototypes for various getprotoxxx netdb.h functions are available
14340 set d_getprotoprotos getprotoent $i_netdb netdb.h
14343 : see if getprpwnam exists
14344 set getprpwnam d_getprpwnam
14347 : see if getpwent exists
14348 set getpwent d_getpwent
14351 : see if getpwent_r exists
14352 set getpwent_r d_getpwent_r
14354 case "$d_getpwent_r" in
14356 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14357 case "$d_getpwent_r_proto:$usethreads" in
14358 ":define") d_getpwent_r_proto=define
14359 set d_getpwent_r_proto getpwent_r $hdrs
14363 case "$d_getpwent_r_proto" in
14365 case "$getpwent_r_proto" in
14366 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
14367 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBWR ;;
14369 case "$getpwent_r_proto" in
14370 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
14371 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIR ;;
14373 case "$getpwent_r_proto" in
14374 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
14375 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBW ;;
14377 case "$getpwent_r_proto" in
14378 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
14379 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBI ;;
14381 case "$getpwent_r_proto" in
14382 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
14383 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBI ;;
14385 case "$getpwent_r_proto" in
14386 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
14387 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIH ;;
14389 case "$getpwent_r_proto" in
14390 ''|0) d_getpwent_r=undef
14392 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
14393 * ) case "$getpwent_r_proto" in
14394 REENTRANT_PROTO*) ;;
14395 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
14397 echo "Prototype: $try" ;;
14400 *) case "$usethreads" in
14401 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
14408 *) getpwent_r_proto=0
14412 : see if getpwnam_r exists
14413 set getpwnam_r d_getpwnam_r
14415 case "$d_getpwnam_r" in
14417 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14418 case "$d_getpwnam_r_proto:$usethreads" in
14419 ":define") d_getpwnam_r_proto=define
14420 set d_getpwnam_r_proto getpwnam_r $hdrs
14424 case "$d_getpwnam_r_proto" in
14426 case "$getpwnam_r_proto" in
14427 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
14428 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
14430 case "$getpwnam_r_proto" in
14431 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
14432 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
14434 case "$getpwnam_r_proto" in
14435 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
14436 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
14438 case "$getpwnam_r_proto" in
14439 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
14440 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
14442 case "$getpwnam_r_proto" in
14443 ''|0) d_getpwnam_r=undef
14445 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
14446 * ) case "$getpwnam_r_proto" in
14447 REENTRANT_PROTO*) ;;
14448 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
14450 echo "Prototype: $try" ;;
14453 *) case "$usethreads" in
14454 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
14461 *) getpwnam_r_proto=0
14465 : see if getpwuid_r exists
14466 set getpwuid_r d_getpwuid_r
14468 case "$d_getpwuid_r" in
14470 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14471 case "$d_getpwuid_r_proto:$usethreads" in
14472 ":define") d_getpwuid_r_proto=define
14473 set d_getpwuid_r_proto getpwuid_r $hdrs
14477 case "$d_getpwuid_r_proto" in
14479 case "$getpwuid_r_proto" in
14480 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
14481 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
14483 case "$getpwuid_r_proto" in
14484 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
14485 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
14487 case "$getpwuid_r_proto" in
14488 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
14489 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
14491 case "$getpwuid_r_proto" in
14492 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
14493 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
14495 case "$getpwuid_r_proto" in
14496 ''|0) d_getpwuid_r=undef
14498 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
14499 * ) case "$getpwuid_r_proto" in
14500 REENTRANT_PROTO*) ;;
14501 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
14503 echo "Prototype: $try" ;;
14506 *) case "$usethreads" in
14507 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
14514 *) getpwuid_r_proto=0
14518 : Optional checks for getsbyname and getsbyport
14520 : see if getservbyname exists
14521 set getservbyname d_getsbyname
14524 : see if getservbyport exists
14525 set getservbyport d_getsbyport
14528 : see if getservent exists
14529 set getservent d_getsent
14532 : see if getservbyname_r exists
14533 set getservbyname_r d_getservbyname_r
14535 case "$d_getservbyname_r" in
14537 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14538 case "$d_getservbyname_r_proto:$usethreads" in
14539 ":define") d_getservbyname_r_proto=define
14540 set d_getservbyname_r_proto getservbyname_r $hdrs
14544 case "$d_getservbyname_r_proto" in
14546 case "$getservbyname_r_proto" in
14547 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
14548 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
14550 case "$getservbyname_r_proto" in
14551 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
14552 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
14554 case "$getservbyname_r_proto" in
14555 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
14556 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
14558 case "$getservbyname_r_proto" in
14559 ''|0) d_getservbyname_r=undef
14560 getservbyname_r_proto=0
14561 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
14562 * ) case "$getservbyname_r_proto" in
14563 REENTRANT_PROTO*) ;;
14564 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
14566 echo "Prototype: $try" ;;
14569 *) case "$usethreads" in
14570 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
14572 d_getservbyname_r=undef
14573 getservbyname_r_proto=0
14577 *) getservbyname_r_proto=0
14581 : see if getservbyport_r exists
14582 set getservbyport_r d_getservbyport_r
14584 case "$d_getservbyport_r" in
14586 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14587 case "$d_getservbyport_r_proto:$usethreads" in
14588 ":define") d_getservbyport_r_proto=define
14589 set d_getservbyport_r_proto getservbyport_r $hdrs
14593 case "$d_getservbyport_r_proto" in
14595 case "$getservbyport_r_proto" in
14596 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
14597 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
14599 case "$getservbyport_r_proto" in
14600 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
14601 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
14603 case "$getservbyport_r_proto" in
14604 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
14605 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
14607 case "$getservbyport_r_proto" in
14608 ''|0) d_getservbyport_r=undef
14609 getservbyport_r_proto=0
14610 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
14611 * ) case "$getservbyport_r_proto" in
14612 REENTRANT_PROTO*) ;;
14613 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
14615 echo "Prototype: $try" ;;
14618 *) case "$usethreads" in
14619 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
14621 d_getservbyport_r=undef
14622 getservbyport_r_proto=0
14626 *) getservbyport_r_proto=0
14630 : see if getservent_r exists
14631 set getservent_r d_getservent_r
14633 case "$d_getservent_r" in
14635 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14636 case "$d_getservent_r_proto:$usethreads" in
14637 ":define") d_getservent_r_proto=define
14638 set d_getservent_r_proto getservent_r $hdrs
14642 case "$d_getservent_r_proto" in
14644 case "$getservent_r_proto" in
14645 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
14646 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBWR ;;
14648 case "$getservent_r_proto" in
14649 ''|0) try='int getservent_r(struct servent*, char*, int);'
14650 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBI ;;
14652 case "$getservent_r_proto" in
14653 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
14654 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=S_SBI ;;
14656 case "$getservent_r_proto" in
14657 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
14658 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SD ;;
14660 case "$getservent_r_proto" in
14661 ''|0) d_getservent_r=undef
14662 getservent_r_proto=0
14663 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
14664 * ) case "$getservent_r_proto" in
14665 REENTRANT_PROTO*) ;;
14666 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
14668 echo "Prototype: $try" ;;
14671 *) case "$usethreads" in
14672 define) echo "getservent_r has no prototype, not using it." >&4 ;;
14674 d_getservent_r=undef
14675 getservent_r_proto=0
14679 *) getservent_r_proto=0
14683 : see if prototypes for various getservxxx netdb.h functions are available
14685 set d_getservprotos getservent $i_netdb netdb.h
14688 : see if getspnam exists
14689 set getspnam d_getspnam
14692 : see if this is a shadow.h system
14693 set shadow.h i_shadow
14696 : see if getspnam_r exists
14697 set getspnam_r d_getspnam_r
14699 case "$d_getspnam_r" in
14701 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
14702 case "$d_getspnam_r_proto:$usethreads" in
14703 ":define") d_getspnam_r_proto=define
14704 set d_getspnam_r_proto getspnam_r $hdrs
14708 case "$d_getspnam_r_proto" in
14710 case "$getspnam_r_proto" in
14711 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
14712 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
14714 case "$getspnam_r_proto" in
14715 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
14716 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=S_CSBI ;;
14718 case "$getspnam_r_proto" in
14719 ''|0) d_getspnam_r=undef
14721 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
14722 * ) case "$getspnam_r_proto" in
14723 REENTRANT_PROTO*) ;;
14724 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
14726 echo "Prototype: $try" ;;
14729 *) case "$usethreads" in
14730 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
14737 *) getspnam_r_proto=0
14741 : see if gettimeofday or ftime exists
14742 set gettimeofday d_gettimeod
14744 case "$d_gettimeod" in
14750 val="$undef"; set d_ftime; eval $setvar
14753 case "$d_gettimeod$d_ftime" in
14756 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
14760 : see if gmtime_r exists
14761 set gmtime_r d_gmtime_r
14763 case "$d_gmtime_r" in
14765 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14766 case "$d_gmtime_r_proto:$usethreads" in
14767 ":define") d_gmtime_r_proto=define
14768 set d_gmtime_r_proto gmtime_r $hdrs
14772 case "$d_gmtime_r_proto" in
14774 case "$gmtime_r_proto" in
14775 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
14776 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=S_TS ;;
14778 case "$gmtime_r_proto" in
14779 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
14780 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=I_TS ;;
14782 case "$gmtime_r_proto" in
14783 ''|0) d_gmtime_r=undef
14785 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
14786 * ) case "$gmtime_r_proto" in
14787 REENTRANT_PROTO*) ;;
14788 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
14790 echo "Prototype: $try" ;;
14793 *) case "$usethreads" in
14794 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
14801 *) gmtime_r_proto=0
14805 : see if hasmntopt exists
14806 set hasmntopt d_hasmntopt
14809 : see if this is a netinet/in.h or sys/in.h system
14810 set netinet/in.h i_niin sys/in.h i_sysin
14813 : see if arpa/inet.h has to be included
14814 set arpa/inet.h i_arpainet
14817 : see if htonl --and friends-- exists
14822 : Maybe they are macros.
14825 $cat >htonl.c <<EOM
14827 #include <sys/types.h>
14828 #$i_niin I_NETINET_IN
14830 #$i_arpainet I_ARPA_INET
14831 #ifdef I_NETINET_IN
14832 #include <netinet/in.h>
14835 #include <sys/in.h>
14838 #include <arpa/inet.h>
14841 printf("Defined as a macro.");
14844 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
14845 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
14847 echo "But it seems to be defined as a macro." >&4
14855 : see if ilogbl exists
14856 set ilogbl d_ilogbl
14861 if set index val -f; eval $csym; $val; then
14862 if set strchr val -f d_strchr; eval $csym; $val; then
14863 if $contains strchr "$strings" >/dev/null 2>&1 ; then
14866 echo "strchr() found." >&4
14870 echo "index() found." >&4
14875 echo "index() found." >&4
14878 if set strchr val -f d_strchr; eval $csym; $val; then
14881 echo "strchr() found." >&4
14883 echo "No index() or strchr() found!" >&4
14888 set d_strchr; eval $setvar
14890 set d_index; eval $setvar
14892 : check whether inet_aton exists
14893 set inet_aton d_inetaton
14896 : see if inet_ntop exists
14897 set inet_ntop d_inetntop
14900 : see if inet_pton exists
14901 set inet_pton d_inetpton
14906 $cat >isascii.c <<EOCP
14909 #$i_stdlib I_STDLIB
14911 #include <stdlib.h>
14922 if eval $compile; then
14923 echo "isascii() found." >&4
14926 echo "isascii() NOT found." >&4
14935 $cat >isblank.c <<'EOCP'
14946 if $cc $ccflags $ldflags -o isblank isblank.c $libs >/dev/null 2>&1 ; then
14947 echo "isblank() found." >&4
14950 echo "isblank() NOT found." >&4
14957 : see if isfinite exists
14958 set isfinite d_isfinite
14961 : see if isinf exists
14965 : see if isnan exists
14969 : see if isnanl exists
14970 set isnanl d_isnanl
14973 : see if killpg exists
14974 set killpg d_killpg
14977 : see if lchown exists
14979 $cat > try.c <<'EOCP'
14980 /* System header to define __stub macros and hopefully few prototypes,
14981 which can conflict with char lchown(); below. */
14982 #include <assert.h>
14983 /* Override any gcc2 internal prototype to avoid an error. */
14984 /* We use char because int might match the return type of a gcc2
14985 builtin and then its argument prototype would still apply. */
14988 /* The GNU C library defines this for functions which it implements
14989 to always fail with ENOSYS. Some functions are actually named
14990 something starting with __ and the normal name is an alias. */
14991 #if defined (__stub_lchown) || defined (__stub___lchown)
14999 if eval $compile; then
15000 $echo "lchown() found." >&4
15003 $echo "lchown() NOT found." >&4
15009 : See if number of significant digits in a double precision number is known
15011 $cat >ldbl_dig.c <<EOM
15012 #$i_limits I_LIMITS
15015 #include <limits.h>
15021 printf("Contains LDBL_DIG");
15024 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
15025 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
15026 echo "LDBL_DIG found." >&4
15029 echo "LDBL_DIG NOT found." >&4
15036 : see if this is a math.h system
15040 : check to see if math.h defines _LIB_VERSION
15041 d_libm_lib_version="$undef"
15045 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
15047 #include <unistd.h>
15049 int main (int argc, char *argv[])
15051 printf ("%d\n", _LIB_VERSION);
15056 if eval $compile; then
15058 echo "Yes, it does ($foo)" >&4
15059 d_libm_lib_version="$define"
15061 echo "No, it does not (probably harmless)" >&4
15068 : see if link exists
15072 : see if localtime_r exists
15073 set localtime_r d_localtime_r
15075 case "$d_localtime_r" in
15077 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15078 case "$d_localtime_r_proto:$usethreads" in
15079 ":define") d_localtime_r_proto=define
15080 set d_localtime_r_proto localtime_r $hdrs
15084 case "$d_localtime_r_proto" in
15086 case "$localtime_r_proto" in
15087 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
15088 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=S_TS ;;
15090 case "$localtime_r_proto" in
15091 ''|0) try='int localtime_r(const time_t*, struct tm*);'
15092 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=I_TS ;;
15094 case "$localtime_r_proto" in
15095 ''|0) d_localtime_r=undef
15096 localtime_r_proto=0
15097 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
15098 * ) case "$localtime_r_proto" in
15099 REENTRANT_PROTO*) ;;
15100 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
15102 echo "Prototype: $try" ;;
15105 *) case "$usethreads" in
15106 define) echo "localtime_r has no prototype, not using it." >&4 ;;
15108 d_localtime_r=undef
15109 localtime_r_proto=0
15113 *) localtime_r_proto=0
15117 : see if localtime_r calls tzset
15118 case "$localtime_r_proto" in
15121 /* Does our libc's localtime_r call tzset ?
15122 * return 0 if so, 1 otherwise.
15124 #$i_systypes I_SYS_TYPES
15125 #$i_unistd I_UNISTD
15127 #$i_stdlib I_STDLIB
15128 #$i_string I_STRING
15129 #$i_malloc I_MALLOC
15131 # include <sys/types.h>
15134 # include <unistd.h>
15140 #include <stdlib.h>
15143 # include <string.h>
15145 # include <strings.h>
15148 # include <malloc.h>
15152 time_t t = time(0L);
15153 char w_tz[]="TZ" "=GMT+5",
15154 e_tz[]="TZ" "=GMT-5",
15155 *tz_e = (char*)malloc(16),
15156 *tz_w = (char*)malloc(16);
15157 struct tm tm_e, tm_w;
15158 memset(&tm_e,'\0',sizeof(struct tm));
15159 memset(&tm_w,'\0',sizeof(struct tm));
15164 localtime_r(&t, &tm_e);
15167 localtime_r(&t, &tm_w);
15169 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
15175 if eval $compile; then
15176 if $run ./try; then
15177 d_localtime_r_needs_tzset=undef;
15179 d_localtime_r_needs_tzset=define;
15182 d_localtime_r_needs_tzset=undef;
15186 d_localtime_r_needs_tzset=undef;
15191 : see if localeconv exists
15192 set localeconv d_locconv
15195 : see if lockf exists
15199 : see if prototype for lseek is available
15201 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
15204 : see if lstat exists
15208 : see if madvise exists
15209 set madvise d_madvise
15212 : see if malloc_size exists
15213 set malloc_size d_malloc_size
15216 : see if malloc_size_good exists
15217 set malloc_good_size d_malloc_good_size
15220 : see if mblen exists
15224 : see if mbstowcs exists
15225 set mbstowcs d_mbstowcs
15228 : see if mbtowc exists
15229 set mbtowc d_mbtowc
15232 : see if memchr exists
15233 set memchr d_memchr
15236 : see if memcmp exists
15237 set memcmp d_memcmp
15240 : see if memcpy exists
15241 set memcpy d_memcpy
15244 : see if memmove exists
15245 set memmove d_memmove
15248 : see if memset exists
15249 set memset d_memset
15252 : see if mkdir exists
15256 : see if mkdtemp exists
15257 set mkdtemp d_mkdtemp
15260 : see if mkfifo exists
15261 set mkfifo d_mkfifo
15264 : see if mkstemp exists
15265 set mkstemp d_mkstemp
15268 : see if mkstemps exists
15269 set mkstemps d_mkstemps
15272 : see if mktime exists
15273 set mktime d_mktime
15276 : see if this is a sys/mman.h system
15277 set sys/mman.h i_sysmman
15280 : see if mmap exists
15283 : see what shmat returns
15284 : default to something harmless
15286 case "$i_sysmman$d_mmap" in
15288 $cat >mmap.c <<'END'
15289 #include <sys/mman.h>
15292 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
15297 echo "and it returns ($mmaptype)." >&4
15303 : see if sqrtl exists
15307 : see if scalbnl exists
15308 set scalbnl d_scalbnl
15311 : see if modfl exists
15315 : see if prototype for modfl is available
15317 set d_modflproto modfl $i_math math.h
15320 d_modfl_pow32_bug="$undef"
15322 case "$d_longdbl$d_modfl" in
15325 Checking to see whether your modfl() is okay for large values...
15331 if $test "X$d_modflproto" != "X$define"; then
15332 $cat >>try.c <<EOCP
15333 /* Sigh. many current glibcs provide the function, but do not prototype it. */
15334 long double modfl (long double, long double *);
15337 $cat >>try.c <<EOCP
15339 long double nv = 4294967303.15;
15345 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
15349 case "$osname:$gccversion" in
15350 aix:) saveccflags="$ccflags"
15351 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
15354 if eval $compile; then
15357 *" 4294967303.150000 1.150000 4294967302.000000")
15358 echo >&4 "Your modfl() is broken for large values."
15359 d_modfl_pow32_bug="$define"
15361 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
15365 *" 4294967303.150000 0.150000 4294967303.000000")
15366 echo >&4 "Your modfl() seems okay for large values."
15368 *) echo >&4 "I don't understand your modfl() at all."
15374 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
15377 case "$osname:$gccversion" in
15378 aix:) ccflags="$saveccflags" ;; # restore
15383 if $test "$uselongdouble" = "$define"; then
15385 if $test "$d_sqrtl" != "$define"; then
15386 message="$message sqrtl"
15388 if $test "$d_modfl" != "$define"; then
15389 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
15390 echo "You have both aintl and copysignl, so I can emulate modfl."
15392 message="$message modfl"
15395 if $test "$d_frexpl" != "$define"; then
15396 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
15397 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
15399 message="$message frexpl"
15403 if $test "$message" != ""; then
15406 *** You requested the use of long doubles but you do not seem to have
15407 *** the following mathematical functions needed for long double support:
15409 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
15410 *** Cannot continue, aborting.
15418 : see if mprotect exists
15419 set mprotect d_mprotect
15422 : see if msgctl exists
15423 set msgctl d_msgctl
15426 : see if msgget exists
15427 set msgget d_msgget
15430 : see if msgsnd exists
15431 set msgsnd d_msgsnd
15434 : see if msgrcv exists
15435 set msgrcv d_msgrcv
15438 : see how much of the 'msg*(2)' library is present.
15441 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
15442 *"$undef"*) h_msg=false;;
15446 case "`ipcs 2>&1`" in
15447 "SVID messages"*"not configured"*)
15448 echo "Your $osname does not have the msg*(2) configured." >&4
15451 set msgctl d_msgctl
15453 set msgget d_msgget
15455 set msgsnd d_msgsnd
15457 set msgrcv d_msgrcv
15463 : we could also check for sys/ipc.h ...
15464 if $h_msg && $test `./findhdr sys/msg.h`; then
15465 echo "You have the full msg*(2) library." >&4
15468 echo "You don't have the full msg*(2) library." >&4
15474 : Check for msghdr_s
15476 echo "Checking to see if your system supports struct msghdr..." >&4
15477 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
15479 case "$d_msghdr_s" in
15480 "$define") echo "Yes, it does." ;;
15481 *) echo "No, it doesn't." ;;
15485 : see if msync exists
15489 : see if munmap exists
15490 set munmap d_munmap
15493 : see if nice exists
15497 : see if this is a langinfo.h system
15498 set langinfo.h i_langinfo
15501 : see if nl_langinfo exists
15502 set nl_langinfo d_nl_langinfo
15505 : check for volatile keyword
15507 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
15508 $cat >try.c <<'EOCP'
15511 typedef struct _goo_struct goo_struct;
15512 goo_struct * volatile goo = ((goo_struct *)0);
15513 struct _goo_struct {
15518 typedef unsigned short foo_t;
15519 char *volatile foo;
15521 volatile foo_t blech;
15525 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
15527 echo "Yup, it does."
15530 echo "Nope, it doesn't."
15536 : Check basic sizes
15538 $echo "Choosing the C types to be used for Perl's internal types..." >&4
15540 case "$use64bitint:$d_quad:$quadtype" in
15543 uvtype="$uquadtype"
15548 uvtype="unsigned long"
15554 case "$uselongdouble:$d_longdbl" in
15556 nvtype="long double"
15557 nvsize=$longdblsize
15564 $echo "(IV will be "$ivtype", $ivsize bytes)"
15565 $echo "(UV will be "$uvtype", $uvsize bytes)"
15566 $echo "(NV will be "$nvtype", $nvsize bytes)"
15569 #$i_inttypes I_INTTYPES
15571 #include <inttypes.h>
15576 int8_t i = INT8_MAX;
15577 uint8_t u = UINT8_MAX;
15578 printf("int8_t\n");
15581 int16_t i = INT16_MAX;
15582 uint16_t i = UINT16_MAX;
15583 printf("int16_t\n");
15586 int32_t i = INT32_MAX;
15587 uint32_t u = UINT32_MAX;
15588 printf("int32_t\n");
15593 i8type="signed char"
15594 u8type="unsigned char"
15599 '') case "$shortsize" in
15601 u16type="unsigned short"
15609 '') set try -DINT16
15610 if eval $compile; then
15611 case "`$run ./try`" in
15623 '') if $test $shortsize -ge 2; then
15625 u16type="unsigned short"
15633 '') case "$longsize" in
15635 u32type="unsigned long"
15639 *) case "$intsize" in
15641 u32type="unsigned int"
15651 '') set try -DINT32
15652 if eval $compile; then
15653 case "`$run ./try`" in
15665 '') if $test $intsize -ge 4; then
15667 u32type="unsigned int"
15675 '') case "$d_quad:$quadtype" in
15677 i64type="$quadtype"
15678 u64type="$uquadtype"
15686 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
15687 : volatile so that the compiler has to store it out to memory.
15688 if test X"$d_volatile" = X"$define"; then
15693 #$i_stdlib I_STDLIB
15695 #include <stdlib.h>
15697 #include <sys/types.h>
15698 #include <signal.h>
15700 $volatile int bletched = 0;
15701 $signal_t blech(int s) { bletched = 1; }
15706 int n = 8 * $uvsize;
15709 signal(SIGFPE, blech);
15712 for (i = 0; i < n; i++) {
15713 u = u << 1 | ($uvtype)1;
15715 if (($uvtype)d != u)
15719 d = ($nvtype)(u - 1);
15720 if (($uvtype)d != (u - 1))
15727 printf("%d\n", ((i == n) ? -n : i));
15733 d_nv_preserves_uv="$undef"
15734 if eval $compile; then
15735 nv_preserves_uv_bits="`$run ./try`"
15737 case "$nv_preserves_uv_bits" in
15739 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
15740 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
15741 d_nv_preserves_uv="$define"
15743 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
15744 d_nv_preserves_uv="$undef" ;;
15745 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
15746 nv_preserves_uv_bits="0" ;;
15750 $echo "Checking to find the largest integer value your NVs can hold..." >&4
15751 : volatile so that the compiler has to store it out to memory.
15752 if test X"$d_volatile" = X"$define"; then
15758 typedef $nvtype NV;
15765 while(count < 256) {
15766 $volatile NV up = value + 1.0;
15767 $volatile NV negated = -value;
15768 $volatile NV down = negated - 1.0;
15769 $volatile NV got_up = up - value;
15770 int up_good = got_up == 1.0;
15771 int got_down = down - negated;
15772 int down_good = got_down == -1.0;
15774 if (down_good != up_good) {
15776 "Inconsistency - up %d %f; down %d %f; for 2**%d (%.20f)\n",
15777 up_good, (double) got_up, down_good, (double) got_down,
15778 count, (double) value);
15785 fputs("256.0", stdout);
15788 fputs("2.0", stdout);
15794 fputs("*", stdout);
15800 fprintf(stderr, "Cannot overflow integer range, even at 2**%d (%.20f)\n",
15801 count, (double) value);
15807 nv_overflows_integers_at='0'
15808 if eval $compile; then
15814 The largest integer your NVs can preserve is equal to $xxx
15816 nv_overflows_integers_at="$xxx"
15819 Cannot determine the largest integer value your NVs can hold, unexpected output
15826 Cannot determine the largest integer value your NVs can hold
15833 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
15834 : volatile so that the compiler has to store it out to memory.
15835 if test X"$d_volatile" = X"$define"; then
15840 #$i_stdlib I_STDLIB
15842 #include <stdlib.h>
15844 #$i_string I_STRING
15846 # include <string.h>
15848 # include <strings.h>
15850 #include <sys/types.h>
15851 #include <signal.h>
15853 $volatile int bletched = 0;
15854 $signal_t blech(int s) { bletched = 1; }
15857 int checkit($nvtype d, char *where) {
15858 unsigned char *p = (char *)&d;
15859 unsigned char *end = p + sizeof(d);
15869 printf("No - %s: 0x", where);
15871 printf ("%02X", *p++);
15876 int main(int argc, char **argv) {
15879 fail += checkit(d, "0.0");
15881 /* The compiler shouldn't be assuming that bletched is 0 */
15884 fail += checkit(d, "bleched");
15887 signal(SIGFPE, blech);
15890 /* Paranoia - the compiler should have no way of knowing that ANSI says
15891 that argv[argc] will always be NULL. Actually, if it did assume this it
15892 would be buggy, as this is C and main() can be called from elsewhere in
15894 d = argv[argc] ? 1 : 0;
15897 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
15900 fail += checkit(d, "ternary");
15902 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
15905 printf("No - memset doesn't give 0.0\n");
15906 /* This might just blow up: */
15907 printf("(gives %g)\n", d);
15913 printf("No - something bleched\n");
15918 printf("No - %d fail(s)\n", fail);
15927 d_nv_zero_is_allbits_zero="$undef"
15928 if eval $compile; then
15934 0.0 is represented as all bits zero in memory
15936 d_nv_zero_is_allbits_zero="$define"
15939 0.0 is not represented as all bits zero in memory
15941 d_nv_zero_is_allbits_zero="$undef"
15946 0.0 is not represented as all bits zero in memory
15948 d_nv_zero_is_allbits_zero="$undef"
15954 : check for off64_t
15956 echo "Checking to see if you have off64_t..." >&4
15958 #include <sys/types.h>
15959 #include <unistd.h>
15960 int main() { off64_t x = 7; }
15963 if eval $compile; then
15965 echo "You have off64_t."
15968 echo "You do not have off64_t."
15969 case "$lseeksize" in
15970 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
15977 : how to create joinable pthreads
15978 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
15980 echo "Checking what constant to use for creating joinable pthreads..." >&4
15981 $cat >try.c <<'EOCP'
15982 #include <pthread.h>
15984 int detachstate = JOINABLE;
15987 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
15988 if eval $compile; then
15989 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
15990 val="$undef" # Yes, undef.
15991 set d_old_pthread_create_joinable
15994 set old_pthread_create_joinable
15997 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
15998 if eval $compile; then
15999 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
16001 set d_old_pthread_create_joinable
16003 val=PTHREAD_CREATE_UNDETACHED
16004 set old_pthread_create_joinable
16007 set try -DJOINABLE=__UNDETACHED
16008 if eval $compile; then
16009 echo "You seem to use __UNDETACHED." >&4
16011 set d_old_pthread_create_joinable
16014 set old_pthread_create_joinable
16017 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
16019 set d_old_pthread_create_joinable
16022 set old_pthread_create_joinable
16029 d_old_pthread_create_joinable="$undef"
16030 old_pthread_create_joinable=""
16033 : see if pause exists
16037 : see if poll exists
16041 : see if prctl exists
16045 : see if prctl supports PR_SET_NAME
16046 d_prctl_set_name=$undef
16050 #include <sys/prctl.h>
16052 int main (int argc, char *argv[])
16054 return (prctl (PR_SET_NAME, "Test"));
16058 if eval $compile_ok && $run ./try; then
16059 echo "Your prctl (PR_SET_NAME, ...) works"
16060 d_prctl_set_name=$define
16066 : see if readlink exists
16067 set readlink d_readlink
16070 : Check if exe is symlink to abs path of executing program
16074 case "$d_readlink" in
16076 : NetBSD first as /proc/self is a symlink to /proc/curproc, and it feels
16077 : more tidy to avoid an extra level of symlink
16078 set NetBSD /proc/curproc/exe Linux /proc/self/exe FreeBSD /proc/curproc/file Solaris /proc/self/path/a.out
16079 while test $# -gt 0; do
16082 if $issymlink $try; then
16083 $ls -l $try > reflect
16084 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
16085 echo "You have $type-like $try."
16086 procselfexe='"'$try'"'
16088 : This will break out of the loop
16099 : backward compatibility for d_hvfork
16100 if test X$d_hvfork != X; then
16101 d_vfork="$d_hvfork"
16104 : see if there is a vfork
16109 d_pseudofork=$undef
16111 : Ok, but do we want to use it. vfork is reportedly unreliable in
16112 : perl on Solaris 2.x, and probably elsewhere.
16116 case "$usevfork" in
16122 Perl can only use a vfork() that doesn't suffer from strict
16123 restrictions on calling functions or modifying global data in
16124 the child. For example, glibc-2.1 contains such a vfork()
16125 that is unsuitable. If your system provides a proper fork()
16126 call, chances are that you do NOT want perl to use vfork().
16129 rp="Do you still want to use vfork()?"
16134 echo "Ok, we won't use vfork()."
16143 $define) usevfork='true';;
16144 *) usevfork='false';;
16147 : see whether the pthread_atfork exists
16149 #include <pthread.h>
16152 #ifdef PTHREAD_ATFORK
16153 pthread_atfork(NULL,NULL,NULL);
16158 : see if pthread_atfork exists
16159 set try -DPTHREAD_ATFORK
16160 if eval $compile; then
16165 case "$usethreads" in
16168 $define) echo 'pthread_atfork found.' >&4 ;;
16169 *) echo 'pthread_atfork NOT found.' >&4 ;;
16172 set d_pthread_atfork
16175 : see if pthread_attr_setscope exists
16176 set pthread_attr_setscope d_pthread_attr_setscope
16179 : see whether the various POSIXish _yields exist
16181 #include <pthread.h>
16187 #ifdef PTHREAD_YIELD
16190 #ifdef PTHREAD_YIELD_NULL
16191 pthread_yield(NULL);
16197 : see if sched_yield exists
16198 set try -DSCHED_YIELD
16199 if eval $compile; then
16201 sched_yield='sched_yield()'
16205 case "$usethreads" in
16208 $define) echo 'sched_yield() found.' >&4 ;;
16209 *) echo 'sched_yield() NOT found.' >&4 ;;
16215 : see if pthread_yield exists
16216 set try -DPTHREAD_YIELD
16217 if eval $compile; then
16219 case "$sched_yield" in
16220 '') sched_yield='pthread_yield()' ;;
16223 set try -DPTHREAD_YIELD_NULL
16224 if eval $compile; then
16226 case "$sched_yield" in
16227 '') sched_yield='pthread_yield(NULL)' ;;
16233 case "$usethreads" in
16236 $define) echo 'pthread_yield() found.' >&4 ;;
16237 *) echo 'pthread_yield() NOT found.' >&4 ;;
16241 set d_pthread_yield
16243 case "$sched_yield" in
16244 '') sched_yield=undef ;;
16248 : see if random_r exists
16249 set random_r d_random_r
16251 case "$d_random_r" in
16253 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16254 case "$d_random_r_proto:$usethreads" in
16255 ":define") d_random_r_proto=define
16256 set d_random_r_proto random_r $hdrs
16260 case "$d_random_r_proto" in
16262 case "$random_r_proto" in
16263 ''|0) try='int random_r(int*, struct random_data*);'
16264 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_iS ;;
16266 case "$random_r_proto" in
16267 ''|0) try='int random_r(long*, struct random_data*);'
16268 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_lS ;;
16270 case "$random_r_proto" in
16271 ''|0) try='int random_r(struct random_data*, int32_t*);'
16272 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_St ;;
16274 case "$random_r_proto" in
16275 ''|0) d_random_r=undef
16277 echo "Disabling random_r, cannot determine prototype." >&4 ;;
16278 * ) case "$random_r_proto" in
16279 REENTRANT_PROTO*) ;;
16280 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
16282 echo "Prototype: $try" ;;
16285 *) case "$usethreads" in
16286 define) echo "random_r has no prototype, not using it." >&4 ;;
16293 *) random_r_proto=0
16297 : see if readdir and friends exist
16298 set readdir d_readdir
16300 set seekdir d_seekdir
16302 set telldir d_telldir
16304 set rewinddir d_rewinddir
16307 : see if readdir64_r exists
16308 set readdir64_r d_readdir64_r
16310 case "$d_readdir64_r" in
16312 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16313 case "$d_readdir64_r_proto:$usethreads" in
16314 ":define") d_readdir64_r_proto=define
16315 set d_readdir64_r_proto readdir64_r $hdrs
16319 case "$d_readdir64_r_proto" in
16321 case "$readdir64_r_proto" in
16322 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
16323 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TSR ;;
16325 case "$readdir64_r_proto" in
16326 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
16327 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TS ;;
16329 case "$readdir64_r_proto" in
16330 ''|0) d_readdir64_r=undef
16331 readdir64_r_proto=0
16332 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
16333 * ) case "$readdir64_r_proto" in
16334 REENTRANT_PROTO*) ;;
16335 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
16337 echo "Prototype: $try" ;;
16340 *) case "$usethreads" in
16341 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
16343 d_readdir64_r=undef
16344 readdir64_r_proto=0
16348 *) readdir64_r_proto=0
16352 : see if readdir_r exists
16353 set readdir_r d_readdir_r
16355 case "$d_readdir_r" in
16357 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16358 case "$d_readdir_r_proto:$usethreads" in
16359 ":define") d_readdir_r_proto=define
16360 set d_readdir_r_proto readdir_r $hdrs
16364 case "$d_readdir_r_proto" in
16366 case "$readdir_r_proto" in
16367 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
16368 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TSR ;;
16370 case "$readdir_r_proto" in
16371 ''|0) try='int readdir_r(DIR*, struct dirent*);'
16372 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TS ;;
16374 case "$readdir_r_proto" in
16375 ''|0) d_readdir_r=undef
16377 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
16378 * ) case "$readdir_r_proto" in
16379 REENTRANT_PROTO*) ;;
16380 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
16382 echo "Prototype: $try" ;;
16385 *) case "$usethreads" in
16386 define) echo "readdir_r has no prototype, not using it." >&4 ;;
16393 *) readdir_r_proto=0
16397 : see if readv exists
16401 : see if recvmsg exists
16402 set recvmsg d_recvmsg
16405 : see if rename exists
16406 set rename d_rename
16409 : see if rmdir exists
16413 : see if memory.h is available.
16418 : See if it conflicts with string.h
16424 $cppstdin $cppflags $cppminus < $strings > mem.h
16425 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
16427 echo "We won't be including <memory.h>."
16437 : can bcopy handle overlapping blocks?
16440 case "$d_memmove" in
16441 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
16442 *) case "$d_bcopy" in
16444 echo "Checking to see if bcopy() can do overlapping copies..." >&4
16446 #$i_memory I_MEMORY
16447 #$i_stdlib I_STDLIB
16448 #$i_string I_STRING
16449 #$i_unistd I_UNISTD
16451 $cat >>try.c <<'EOCP'
16454 # include <memory.h>
16457 # include <stdlib.h>
16460 # include <string.h>
16462 # include <strings.h>
16465 # include <unistd.h> /* Needed for NetBSD */
16469 char buf[128], abc[128];
16475 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16476 try to store the string in read-only memory. */
16477 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
16479 for (align = 7; align >= 0; align--) {
16480 for (len = 36; len; len--) {
16482 bcopy(abc, b, len);
16483 for (off = 1; off <= len; off++) {
16484 bcopy(b, b+off, len);
16485 bcopy(b+off, b, len);
16486 if (bcmp(b, abc, len))
16495 if eval $compile_ok; then
16496 if $run ./try 2>/dev/null; then
16497 echo "Yes, it can."
16500 echo "It can't, sorry."
16503 echo "(I can't compile the test program, so we'll assume not...)"
16513 : can memcpy handle overlapping blocks?
16516 case "$d_memmove" in
16517 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
16518 *) case "$d_memcpy" in
16520 echo "Checking to see if memcpy() can do overlapping copies..." >&4
16522 #$i_memory I_MEMORY
16523 #$i_stdlib I_STDLIB
16524 #$i_string I_STRING
16525 #$i_unistd I_UNISTD
16527 $cat >>try.c <<'EOCP'
16530 # include <memory.h>
16533 # include <stdlib.h>
16536 # include <string.h>
16538 # include <strings.h>
16541 # include <unistd.h> /* Needed for NetBSD */
16545 char buf[128], abc[128];
16551 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16552 try to store the string in read-only memory. */
16553 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
16555 for (align = 7; align >= 0; align--) {
16556 for (len = 36; len; len--) {
16558 memcpy(b, abc, len);
16559 for (off = 1; off <= len; off++) {
16560 memcpy(b+off, b, len);
16561 memcpy(b, b+off, len);
16562 if (memcmp(b, abc, len))
16571 if eval $compile_ok; then
16572 if $run ./try 2>/dev/null; then
16573 echo "Yes, it can."
16576 echo "It can't, sorry."
16579 echo "(I can't compile the test program, so we'll assume not...)"
16589 : can memcmp be trusted to compare relative magnitude?
16591 case "$d_memcmp" in
16594 echo "Checking if your memcmp() can compare relative magnitude..." >&4
16596 #$i_memory I_MEMORY
16597 #$i_stdlib I_STDLIB
16598 #$i_string I_STRING
16599 #$i_unistd I_UNISTD
16601 $cat >>try.c <<'EOCP'
16604 # include <memory.h>
16607 # include <stdlib.h>
16610 # include <string.h>
16612 # include <strings.h>
16615 # include <unistd.h> /* Needed for NetBSD */
16621 if ((a < b) && memcmp(&a, &b, 1) < 0)
16627 if eval $compile_ok; then
16628 if $run ./try 2>/dev/null; then
16629 echo "Yes, it can."
16632 echo "No, it can't (it uses signed chars)."
16635 echo "(I can't compile the test program, so we'll assume not...)"
16643 : see if prototype for sbrk is available
16645 set d_sbrkproto sbrk $i_unistd unistd.h
16648 : see if select exists
16649 set select d_select
16652 : see if semctl exists
16653 set semctl d_semctl
16656 : see if semget exists
16657 set semget d_semget
16660 : see if semop exists
16664 : see how much of the 'sem*(2)' library is present.
16667 case "$d_semctl$d_semget$d_semop" in
16668 *"$undef"*) h_sem=false;;
16672 case "`ipcs 2>&1`" in
16673 "SVID messages"*"not configured"*)
16674 echo "Your $osname does not have the sem*(2) configured." >&4
16677 set semctl d_semctl
16679 set semget d_semget
16687 : we could also check for sys/ipc.h ...
16688 if $h_sem && $test `./findhdr sys/sem.h`; then
16689 echo "You have the full sem*(2) library." >&4
16692 echo "You don't have the full sem*(2) library." >&4
16698 : see whether sys/sem.h defines union semun
16700 $cat > try.c <<'END'
16701 #include <sys/types.h>
16702 #include <sys/ipc.h>
16703 #include <sys/sem.h>
16704 int main () { union semun semun; semun.buf = 0; }
16707 if eval $compile; then
16708 echo "You have union semun in <sys/sem.h>." >&4
16711 echo "You do not have union semun in <sys/sem.h>." >&4
16718 : see how to do semctl IPC_STAT
16722 $cat > tryh.h <<END
16725 # define S_IRUSR S_IREAD
16726 # define S_IWUSR S_IWRITE
16727 # define S_IXUSR S_IEXEC
16729 # define S_IRUSR 0400
16730 # define S_IWUSR 0200
16731 # define S_IXUSR 0100
16733 # define S_IRGRP (S_IRUSR>>3)
16734 # define S_IWGRP (S_IWUSR>>3)
16735 # define S_IXGRP (S_IXUSR>>3)
16736 # define S_IROTH (S_IRUSR>>6)
16737 # define S_IWOTH (S_IWUSR>>6)
16738 # define S_IXOTH (S_IXUSR>>6)
16741 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
16742 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
16743 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
16746 : see whether semctl IPC_STAT can use union semun
16747 case "$d_semctl_semun" in
16751 #include <sys/types.h>
16752 #include <sys/ipc.h>
16753 #include <sys/sem.h>
16754 #include <sys/stat.h>
16761 #$d_union_semun HAS_UNION_SEMUN
16764 #ifndef HAS_UNION_SEMUN
16767 struct semid_ds *buf;
16768 unsigned short *array;
16774 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16775 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16777 struct semid_ds argbuf;
16780 st = semctl(sem, 0, IPC_STAT, arg);
16784 # endif /* IPC_STAT */
16785 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16787 if (semctl(sem, 0, IPC_RMID, arg) != 0)
16788 # endif /* IPC_RMID */
16789 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16791 #endif /* IPC_PRIVATE && ... */
16792 printf("semget failed: errno = %d\n", errno);
16797 if eval $compile; then
16800 semun) val="$define" ;;
16808 case "$d_semctl_semun" in
16810 echo "You can use union semun for semctl IPC_STAT." >&4
16813 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
16818 : see whether semctl IPC_STAT can use struct semid_ds pointer
16819 case "$d_semctl_semid_ds" in
16822 $cat > try.c <<'END'
16823 #include <sys/types.h>
16824 #include <sys/ipc.h>
16825 #include <sys/sem.h>
16826 #include <sys/stat.h>
16834 struct semid_ds arg;
16837 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16838 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16841 st = semctl(sem, 0, IPC_STAT, &arg);
16843 printf("semid_ds\n");
16845 # endif /* IPC_STAT */
16846 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16848 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
16849 # endif /* IPC_RMID */
16850 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16852 #endif /* IPC_PRIVATE && ... */
16853 printf("semget failed: errno = %d\n", errno);
16859 if eval $compile; then
16862 semid_ds) val="$define" ;;
16866 set d_semctl_semid_ds
16870 case "$d_semctl_semid_ds" in
16872 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
16874 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
16880 # We do not have the full sem*(2) library, so assume we can not
16886 set d_semctl_semid_ds
16892 : see if sendmsg exists
16893 set sendmsg d_sendmsg
16896 : see if setegid exists
16897 set setegid d_setegid
16900 : see if seteuid exists
16901 set seteuid d_seteuid
16904 : see if setgrent exists
16905 set setgrent d_setgrent
16908 : see if setgrent_r exists
16909 set setgrent_r d_setgrent_r
16911 case "$d_setgrent_r" in
16913 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
16914 case "$d_setgrent_r_proto:$usethreads" in
16915 ":define") d_setgrent_r_proto=define
16916 set d_setgrent_r_proto setgrent_r $hdrs
16920 case "$d_setgrent_r_proto" in
16922 case "$setgrent_r_proto" in
16923 ''|0) try='int setgrent_r(FILE**);'
16924 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=I_H ;;
16926 case "$setgrent_r_proto" in
16927 ''|0) try='void setgrent_r(FILE**);'
16928 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=V_H ;;
16930 case "$setgrent_r_proto" in
16931 ''|0) d_setgrent_r=undef
16933 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
16934 * ) case "$setgrent_r_proto" in
16935 REENTRANT_PROTO*) ;;
16936 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
16938 echo "Prototype: $try" ;;
16941 *) case "$usethreads" in
16942 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
16949 *) setgrent_r_proto=0
16953 : see if sethostent exists
16954 set sethostent d_sethent
16957 : see if sethostent_r exists
16958 set sethostent_r d_sethostent_r
16960 case "$d_sethostent_r" in
16962 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16963 case "$d_sethostent_r_proto:$usethreads" in
16964 ":define") d_sethostent_r_proto=define
16965 set d_sethostent_r_proto sethostent_r $hdrs
16969 case "$d_sethostent_r_proto" in
16971 case "$sethostent_r_proto" in
16972 ''|0) try='int sethostent_r(int, struct hostent_data*);'
16973 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=I_ID ;;
16975 case "$sethostent_r_proto" in
16976 ''|0) try='void sethostent_r(int, struct hostent_data*);'
16977 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=V_ID ;;
16979 case "$sethostent_r_proto" in
16980 ''|0) d_sethostent_r=undef
16981 sethostent_r_proto=0
16982 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
16983 * ) case "$sethostent_r_proto" in
16984 REENTRANT_PROTO*) ;;
16985 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
16987 echo "Prototype: $try" ;;
16990 *) case "$usethreads" in
16991 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
16993 d_sethostent_r=undef
16994 sethostent_r_proto=0
16998 *) sethostent_r_proto=0
17002 : see if setitimer exists
17003 set setitimer d_setitimer
17006 : see if setlinebuf exists
17007 set setlinebuf d_setlinebuf
17010 : see if setlocale exists
17011 set setlocale d_setlocale
17014 : see if locale.h is available
17015 set locale.h i_locale
17018 : see if setlocale_r exists
17019 set setlocale_r d_setlocale_r
17021 case "$d_setlocale_r" in
17023 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
17024 case "$d_setlocale_r_proto:$usethreads" in
17025 ":define") d_setlocale_r_proto=define
17026 set d_setlocale_r_proto setlocale_r $hdrs
17030 case "$d_setlocale_r_proto" in
17032 case "$setlocale_r_proto" in
17033 ''|0) try='int setlocale_r(int, const char*, char*, int);'
17034 ./protochk "$extern_C $try" $hdrs && setlocale_r_proto=I_ICBI ;;
17036 case "$setlocale_r_proto" in
17037 ''|0) d_setlocale_r=undef
17038 setlocale_r_proto=0
17039 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
17040 * ) case "$setlocale_r_proto" in
17041 REENTRANT_PROTO*) ;;
17042 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
17044 echo "Prototype: $try" ;;
17047 *) case "$usethreads" in
17048 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
17050 d_setlocale_r=undef
17051 setlocale_r_proto=0
17055 *) setlocale_r_proto=0
17059 : see if setnetent exists
17060 set setnetent d_setnent
17063 : see if setnetent_r exists
17064 set setnetent_r d_setnetent_r
17066 case "$d_setnetent_r" in
17068 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17069 case "$d_setnetent_r_proto:$usethreads" in
17070 ":define") d_setnetent_r_proto=define
17071 set d_setnetent_r_proto setnetent_r $hdrs
17075 case "$d_setnetent_r_proto" in
17077 case "$setnetent_r_proto" in
17078 ''|0) try='int setnetent_r(int, struct netent_data*);'
17079 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=I_ID ;;
17081 case "$setnetent_r_proto" in
17082 ''|0) try='void setnetent_r(int, struct netent_data*);'
17083 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=V_ID ;;
17085 case "$setnetent_r_proto" in
17086 ''|0) d_setnetent_r=undef
17087 setnetent_r_proto=0
17088 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
17089 * ) case "$setnetent_r_proto" in
17090 REENTRANT_PROTO*) ;;
17091 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
17093 echo "Prototype: $try" ;;
17096 *) case "$usethreads" in
17097 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
17099 d_setnetent_r=undef
17100 setnetent_r_proto=0
17104 *) setnetent_r_proto=0
17108 : see if setprotoent exists
17109 set setprotoent d_setpent
17112 : see if setpgid exists
17113 set setpgid d_setpgid
17116 : see if setpgrp2 exists
17117 set setpgrp2 d_setpgrp2
17120 : see if setpriority exists
17121 set setpriority d_setprior
17124 : see if setproctitle exists
17125 set setproctitle d_setproctitle
17128 : see if setprotoent_r exists
17129 set setprotoent_r d_setprotoent_r
17131 case "$d_setprotoent_r" in
17133 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17134 case "$d_setprotoent_r_proto:$usethreads" in
17135 ":define") d_setprotoent_r_proto=define
17136 set d_setprotoent_r_proto setprotoent_r $hdrs
17140 case "$d_setprotoent_r_proto" in
17142 case "$setprotoent_r_proto" in
17143 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
17144 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=I_ID ;;
17146 case "$setprotoent_r_proto" in
17147 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
17148 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=V_ID ;;
17150 case "$setprotoent_r_proto" in
17151 ''|0) d_setprotoent_r=undef
17152 setprotoent_r_proto=0
17153 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
17154 * ) case "$setprotoent_r_proto" in
17155 REENTRANT_PROTO*) ;;
17156 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
17158 echo "Prototype: $try" ;;
17161 *) case "$usethreads" in
17162 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
17164 d_setprotoent_r=undef
17165 setprotoent_r_proto=0
17169 *) setprotoent_r_proto=0
17173 : see if setpwent exists
17174 set setpwent d_setpwent
17177 : see if setpwent_r exists
17178 set setpwent_r d_setpwent_r
17180 case "$d_setpwent_r" in
17182 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
17183 case "$d_setpwent_r_proto:$usethreads" in
17184 ":define") d_setpwent_r_proto=define
17185 set d_setpwent_r_proto setpwent_r $hdrs
17189 case "$d_setpwent_r_proto" in
17191 case "$setpwent_r_proto" in
17192 ''|0) try='int setpwent_r(FILE**);'
17193 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=I_H ;;
17195 case "$setpwent_r_proto" in
17196 ''|0) try='void setpwent_r(FILE**);'
17197 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=V_H ;;
17199 case "$setpwent_r_proto" in
17200 ''|0) d_setpwent_r=undef
17202 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
17203 * ) case "$setpwent_r_proto" in
17204 REENTRANT_PROTO*) ;;
17205 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
17207 echo "Prototype: $try" ;;
17210 *) case "$usethreads" in
17211 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
17218 *) setpwent_r_proto=0
17222 : see if setregid exists
17223 set setregid d_setregid
17225 set setresgid d_setresgid
17228 : see if setreuid exists
17229 set setreuid d_setreuid
17231 set setresuid d_setresuid
17234 : see if setrgid exists
17235 set setrgid d_setrgid
17238 : see if setruid exists
17239 set setruid d_setruid
17242 : see if setservent exists
17243 set setservent d_setsent
17246 : see if setservent_r exists
17247 set setservent_r d_setservent_r
17249 case "$d_setservent_r" in
17251 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17252 case "$d_setservent_r_proto:$usethreads" in
17253 ":define") d_setservent_r_proto=define
17254 set d_setservent_r_proto setservent_r $hdrs
17258 case "$d_setservent_r_proto" in
17260 case "$setservent_r_proto" in
17261 ''|0) try='int setservent_r(int, struct servent_data*);'
17262 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=I_ID ;;
17264 case "$setservent_r_proto" in
17265 ''|0) try='void setservent_r(int, struct servent_data*);'
17266 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=V_ID ;;
17268 case "$setservent_r_proto" in
17269 ''|0) d_setservent_r=undef
17270 setservent_r_proto=0
17271 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
17272 * ) case "$setservent_r_proto" in
17273 REENTRANT_PROTO*) ;;
17274 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
17276 echo "Prototype: $try" ;;
17279 *) case "$usethreads" in
17280 define) echo "setservent_r has no prototype, not using it." >&4 ;;
17282 d_setservent_r=undef
17283 setservent_r_proto=0
17287 *) setservent_r_proto=0
17291 : see if setsid exists
17292 set setsid d_setsid
17295 : see if setvbuf exists
17296 set setvbuf d_setvbuf
17299 : see if sfio.h is available
17303 : see if sfio library is available
17314 : Ok, but do we want to use it.
17318 true|$define|[yY]*) dflt='y';;
17321 echo "$package can use the sfio library, but it is experimental."
17322 rp="You seem to have sfio available, do you want to try using it?"
17325 y|Y) echo "Ok, turning on sfio then."
17328 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
17333 *) case "$usesfio" in
17334 true|$define|[yY]*)
17335 echo "Sorry, cannot find sfio on this machine." >&4
17336 echo "Ignoring your setting of usesfio=$usesfio." >&4
17345 $define) usesfio='true';;
17346 *) usesfio='false';;
17350 *) : Remove sfio from list of libraries to use
17353 echo "Removing unneeded -lsfio from library list" >&4
17354 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
17357 echo "libs = $libs" >&4
17364 : see if shmctl exists
17365 set shmctl d_shmctl
17368 : see if shmget exists
17369 set shmget d_shmget
17372 : see if shmat exists
17375 : see what shmat returns
17378 $cat >shmat.c <<'END'
17379 #include <sys/shm.h>
17382 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
17387 echo "and it returns ($shmattype)." >&4
17388 : see if a prototype for shmat is available
17389 xxx=`./findhdr sys/shm.h`
17390 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
17391 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
17402 set d_shmatprototype
17405 : see if shmdt exists
17409 : see how much of the 'shm*(2)' library is present.
17412 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
17413 *"$undef"*) h_shm=false;;
17417 case "`ipcs 2>&1`" in
17418 "SVID shared memory"*"not configured"*)
17419 echo "Your $osname does not have the shm*(2) configured." >&4
17422 set shmctl d_shmctl
17424 set shmget d_shmget
17434 : we could also check for sys/ipc.h ...
17435 if $h_shm && $test `./findhdr sys/shm.h`; then
17436 echo "You have the full shm*(2) library." >&4
17439 echo "You don't have the full shm*(2) library." >&4
17445 : see if we have sigaction
17447 if set sigaction val -f d_sigaction; eval $csym; $val; then
17448 echo 'sigaction() found.' >&4
17451 #include <sys/types.h>
17452 #include <signal.h>
17453 #$i_stdlib I_STDLIB
17455 #include <stdlib.h>
17459 struct sigaction act, oact;
17461 oact.sa_handler = 0;
17462 /* so that act and oact are used */
17463 exit(act.sa_flags == 0 && oact.sa_handler == 0);
17467 if eval $compile_ok; then
17470 echo "But you don't seem to have a useable struct sigaction." >&4
17474 echo 'sigaction NOT found.' >&4
17477 set d_sigaction; eval $setvar
17480 : see if this is a sunmath.h system
17481 set sunmath.h i_sunmath
17484 : see if signbit exists
17485 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
17488 #$i_sunmath I_SUNMATH
17492 #ifdef I_SUNMATH /* Solaris special math library */
17493 # include <sunmath.h>
17496 int main(int argc, char **argv)
17500 if ((signbit(x) == 0) && (signbit(y) != 0))
17508 if eval $compile; then
17509 if $run ./try; then
17513 $echo "Signbit seems to be available, but doesn't work as I expected."
17514 $echo "I won't use it." >&4
17525 : see if sigprocmask exists
17526 set sigprocmask d_sigprocmask
17529 : see if sigsetjmp exists
17531 case "$d_sigsetjmp" in
17534 #include <setjmp.h>
17535 #$i_stdlib I_STDLIB
17537 #include <stdlib.h>
17543 if (sigsetjmp(env,1))
17546 siglongjmp(env, 1);
17551 if eval $compile; then
17552 if $run ./try >/dev/null 2>&1; then
17553 echo "POSIX sigsetjmp found." >&4
17557 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
17563 echo "sigsetjmp not found." >&4
17567 *) val="$d_sigsetjmp"
17568 case "$d_sigsetjmp" in
17569 $define) echo "POSIX sigsetjmp found." >&4;;
17570 $undef) echo "sigsetjmp not found." >&4;;
17578 : see if snprintf exists
17579 set snprintf d_snprintf
17582 : see if vsnprintf exists
17583 set vsnprintf d_vsnprintf
17586 case "$d_snprintf-$d_vsnprintf" in
17589 Checking whether your snprintf() and vsnprintf() work okay...
17591 $cat >try.c <<'EOCP'
17592 /* v?snprintf testing logic courtesy of Russ Allbery.
17593 * According to C99:
17594 * - if the buffer is too short it still must be \0-terminated
17595 * - if the buffer is too short the potentially required length
17596 * must be returned and not -1
17597 * - if the buffer is NULL the potentially required length
17598 * must be returned and not -1 or core dump
17601 #include <stdarg.h>
17605 int test (char *format, ...)
17610 va_start (args, format);
17611 count = vsnprintf (buf, sizeof buf, format, args);
17618 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
17619 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
17623 if eval $compile; then
17626 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
17628 Your snprintf() and snprintf() don't seem to be working okay.
17630 d_snprintf="$undef"
17631 d_vsnprintf="$undef"
17635 echo "(I can't seem to compile the test program--assuming they don't)"
17636 d_snprintf="$undef"
17637 d_vsnprintf="$undef"
17643 : see if sockatmark exists
17644 set sockatmark d_sockatmark
17647 : see if prototype for sockatmark is available
17649 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
17652 : see if socks5_init exists
17653 set socks5_init d_socks5_init
17656 : see if sprintf returns the length of the string in the buffer as per ANSI
17657 $echo "Checking whether sprintf returns the length of the string..." >&4
17660 #$i_stdlib I_STDLIB
17662 #include <stdlib.h>
17664 #$i_string I_STRING
17666 # include <string.h>
17668 # include <strings.h>
17677 int check (size_t expect, int test) {
17678 size_t got = strlen(buffer);
17682 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
17687 int main(int argc, char **argv) {
17690 check(sprintf(buffer, ""), ++test);
17691 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
17692 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
17699 if eval $compile; then
17703 sprintf returns the length of the string (as ANSI says it should)
17705 d_sprintf_returns_strlen="$define"
17708 sprintf does not return the length of the string (how old is this system?)
17710 d_sprintf_returns_strlen="$undef"
17714 echo "(I can't seem to compile the test program--assuming it doesn't)" >&4
17715 d_sprintf_returns_strlen="$undef"
17719 : see if srand48_r exists
17720 set srand48_r d_srand48_r
17722 case "$d_srand48_r" in
17724 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17725 case "$d_srand48_r_proto:$usethreads" in
17726 ":define") d_srand48_r_proto=define
17727 set d_srand48_r_proto srand48_r $hdrs
17731 case "$d_srand48_r_proto" in
17733 case "$srand48_r_proto" in
17734 ''|0) try='int srand48_r(long, struct drand48_data*);'
17735 ./protochk "$extern_C $try" $hdrs && srand48_r_proto=I_LS ;;
17737 case "$srand48_r_proto" in
17738 ''|0) d_srand48_r=undef
17740 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
17741 * ) case "$srand48_r_proto" in
17742 REENTRANT_PROTO*) ;;
17743 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
17745 echo "Prototype: $try" ;;
17748 *) case "$usethreads" in
17749 define) echo "srand48_r has no prototype, not using it." >&4 ;;
17756 *) srand48_r_proto=0
17760 : see if srandom_r exists
17761 set srandom_r d_srandom_r
17763 case "$d_srandom_r" in
17765 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17766 case "$d_srandom_r_proto:$usethreads" in
17767 ":define") d_srandom_r_proto=define
17768 set d_srandom_r_proto srandom_r $hdrs
17772 case "$d_srandom_r_proto" in
17774 case "$srandom_r_proto" in
17775 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
17776 ./protochk "$extern_C $try" $hdrs && srandom_r_proto=I_TS ;;
17778 case "$srandom_r_proto" in
17779 ''|0) d_srandom_r=undef
17781 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
17782 * ) case "$srandom_r_proto" in
17783 REENTRANT_PROTO*) ;;
17784 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
17786 echo "Prototype: $try" ;;
17789 *) case "$usethreads" in
17790 define) echo "srandom_r has no prototype, not using it." >&4 ;;
17797 *) srandom_r_proto=0
17801 : see if prototype for setresgid is available
17803 set d_sresgproto setresgid $i_unistd unistd.h
17806 : see if prototype for setresuid is available
17808 set d_sresuproto setresuid $i_unistd unistd.h
17811 : see if sys/stat.h is available
17812 set sys/stat.h i_sysstat
17815 : see if stat knows about block sizes
17817 echo "Checking to see if your struct stat has st_blocks field..." >&4
17818 set d_statblks stat st_blocks $i_sysstat sys/stat.h
17821 : see if this is a sys/vfs.h system
17822 set sys/vfs.h i_sysvfs
17825 : see if this is a sys/statfs.h system
17826 set sys/statfs.h i_sysstatfs
17829 : Check for statfs_s
17831 echo "Checking to see if your system supports struct statfs..." >&4
17832 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
17834 case "$d_statfs_s" in
17835 "$define") echo "Yes, it does." ;;
17836 *) echo "No, it doesn't." ;;
17840 : see if struct statfs knows about f_flags
17841 case "$d_statfs_s" in
17844 echo "Checking to see if your struct statfs has f_flags field..." >&4
17845 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
17849 set d_statfs_f_flags
17853 case "$d_statfs_f_flags" in
17854 "$define") echo "Yes, it does." ;;
17855 *) echo "No, it doesn't." ;;
17858 : see what flavor, if any, of static inline is supported
17860 echo "Checking to see if your system supports static inline..."
17861 $cat > try.c <<'EOCP'
17862 #include <stdlib.h>
17863 extern int f_via_a(int x);
17864 extern int f_via_b(int x);
17865 int main(int argc, char **argv)
17874 return EXIT_SUCCESS;
17877 return EXIT_FAILURE;
17881 $cat > a.c <<'EOCP'
17882 static INLINE int f(int x) {
17893 $cat > b.c <<'EOCP'
17894 extern int f(int x);
17902 # Respect a hint (or previous) value for perl_static_inline, if there is one.
17903 case "$perl_static_inline" in
17904 '') # Check the various possibilities, and break out on success.
17905 # For gcc, prefer __inline__, which will still permit
17906 # cflags.SH to add in -ansi.
17907 case "$gccversion" in
17908 '') xxx="inline __inline__ __inline _inline";;
17909 *) xxx="__inline__ inline __inline _inline";;
17911 for inline in $xxx; do
17912 set try -DINLINE=$inline a.c
17913 if eval $compile && $run ./try; then
17914 # Now make sure there is no external linkage of static
17916 set try -DINLINE=$inline -DUSE_B a.c b.c
17917 if eval $compile && $run ./try; then
17918 $echo "Your compiler supports static $inline, " >&4
17919 $echo "but it also creates an external definition," >&4
17920 $echo "so I won't use it." >&4
17923 $echo "Your compiler supports static $inline." >&4
17925 perl_static_inline="static $inline";
17929 $echo "Your compiler does NOT support static $inline." >&4
17934 *inline*) # Some variant of inline exists.
17935 echo "Keeping your $hint value of $perl_static_inline."
17938 static) # No inline capabilities
17939 echo "Keeping your $hint value of $perl_static_inline."
17942 *) # Unrecognized previous value -- blindly trust the supplied
17943 # value and hope it makes sense. Use old value for
17944 # d_static_inline, if there is one.
17945 echo "Keeping your $hint value of $perl_static_inline."
17946 case "$d_static_inline" in
17948 *) val=$d_static_inline ;;
17952 # Fallback to plain 'static' if nothing worked.
17953 case "$perl_static_inline" in
17955 perl_static_inline="static"
17959 set d_static_inline
17961 $rm -f a.[co] b.[co]
17964 : Check stream access
17966 Checking how to access stdio streams by file descriptor number...
17968 case "$stdio_stream_array" in
17969 '') $cat >try.c <<EOCP
17972 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
17976 for s in _iob __iob __sF
17978 set try -DSTDIO_STREAM_ARRAY=$s
17979 if eval $compile; then
17980 case "`$run ./try`" in
17981 yes) stdio_stream_array=$s; break ;;
17987 case "$stdio_stream_array" in
17989 I can't figure out how to access stdio streams by file descriptor number.
17991 d_stdio_stream_array="$undef"
17994 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
17996 d_stdio_stream_array="$define"
18000 : see if strcoll exists
18001 set strcoll d_strcoll
18004 : check for structure copying
18006 echo "Checking to see if your C compiler can copy structs..." >&4
18007 $cat >try.c <<'EOCP'
18017 if $cc -c try.c >/dev/null 2>&1 ; then
18019 echo "Yup, it can."
18022 echo "Nope, it can't."
18028 : see if strerror and/or sys_errlist[] exist
18030 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
18031 if set strerror val -f d_strerror; eval $csym; $val; then
18032 echo 'strerror() found.' >&4
18033 d_strerror="$define"
18034 d_strerrm='strerror(e)'
18035 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18036 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
18037 d_syserrlst="$define"
18039 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
18040 d_syserrlst="$undef"
18042 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
18043 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
18044 echo 'strerror() found in string header.' >&4
18045 d_strerror="$define"
18046 d_strerrm='strerror(e)'
18047 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18048 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
18049 d_syserrlst="$define"
18051 echo "(You don't appear to have any sys_errlist[], how can this be?)"
18052 d_syserrlst="$undef"
18054 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18055 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
18056 d_strerror="$undef"
18057 d_syserrlst="$define"
18058 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
18060 echo 'strerror() and sys_errlist[] NOT found.' >&4
18061 d_strerror="$undef"
18062 d_syserrlst="$undef"
18063 d_strerrm='"unknown"'
18067 : see if strerror_r exists
18068 set strerror_r d_strerror_r
18070 case "$d_strerror_r" in
18072 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
18073 case "$d_strerror_r_proto:$usethreads" in
18074 ":define") d_strerror_r_proto=define
18075 set d_strerror_r_proto strerror_r $hdrs
18079 case "$d_strerror_r_proto" in
18081 case "$strerror_r_proto" in
18082 ''|0) try='int strerror_r(int, char*, size_t);'
18083 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBW ;;
18085 case "$strerror_r_proto" in
18086 ''|0) try='int strerror_r(int, char*, int);'
18087 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBI ;;
18089 case "$strerror_r_proto" in
18090 ''|0) try='char* strerror_r(int, char*, size_t);'
18091 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=B_IBW ;;
18093 case "$strerror_r_proto" in
18094 ''|0) d_strerror_r=undef
18096 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
18097 * ) case "$strerror_r_proto" in
18098 REENTRANT_PROTO*) ;;
18099 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
18101 echo "Prototype: $try" ;;
18104 *) case "$usethreads" in
18105 define) echo "strerror_r has no prototype, not using it." >&4 ;;
18112 *) strerror_r_proto=0
18116 : see if strftime exists
18117 set strftime d_strftime
18120 : see if strlcat exists
18121 set strlcat d_strlcat
18124 : see if strlcpy exists
18125 set strlcpy d_strlcpy
18128 : see if strtod exists
18129 set strtod d_strtod
18132 : see if strtol exists
18133 set strtol d_strtol
18136 : see if strtold exists
18137 set strtold d_strtold
18140 : see if strtoll exists
18141 set strtoll d_strtoll
18144 case "$d_longlong-$d_strtoll" in
18147 Checking whether your strtoll() works okay...
18149 $cat >try.c <<'EOCP'
18152 #define strtoll __strtoll
18155 #define strtoll _strtoll
18158 extern long long int strtoll(char *s, char **, int);
18159 static int bad = 0;
18160 int check(char *s, long long ell, int een) {
18163 gll = strtoll(s, 0, 10);
18164 if (!((gll == ell) && (errno == een)))
18168 check(" 1", 1LL, 0);
18169 check(" 0", 0LL, 0);
18170 check("-1", -1LL, 0);
18171 check("-9223372036854775808", -9223372036854775808LL, 0);
18172 check("-9223372036854775808", -9223372036854775808LL, 0);
18173 check(" 9223372036854775807", 9223372036854775807LL, 0);
18174 check("-9223372036854775808", -9223372036854775808LL, 0);
18175 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
18176 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
18182 if eval $compile; then
18185 ok) echo "Your strtoll() seems to be working okay." ;;
18187 Your strtoll() doesn't seem to be working okay.
18193 echo "(I can't seem to compile the test program--assuming it doesn't)"
18199 : see if strtoq exists
18200 set strtoq d_strtoq
18203 : see if strtoul exists
18204 set strtoul d_strtoul
18207 case "$d_strtoul" in
18210 Checking whether your strtoul() works okay...
18212 $cat >try.c <<'EOCP'
18215 extern unsigned long int strtoul(char *s, char **, int);
18216 static int bad = 0;
18217 void check(char *s, unsigned long eul, int een) {
18220 gul = strtoul(s, 0, 10);
18221 if (!((gul == eul) && (errno == een)))
18225 check(" 1", 1L, 0);
18226 check(" 0", 0L, 0);
18228 case "$longsize" in
18230 $cat >>try.c <<'EOCP'
18231 check("18446744073709551615", 18446744073709551615UL, 0);
18232 check("18446744073709551616", 18446744073709551615UL, ERANGE);
18233 #if 0 /* strtoul() for /^-/ strings is undefined. */
18234 check("-1", 18446744073709551615UL, 0);
18235 check("-18446744073709551614", 2, 0);
18236 check("-18446744073709551615", 1, 0);
18237 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
18238 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
18243 $cat >>try.c <<'EOCP'
18244 check("4294967295", 4294967295UL, 0);
18245 check("4294967296", 4294967295UL, ERANGE);
18246 #if 0 /* strtoul() for /^-/ strings is undefined. */
18247 check("-1", 4294967295UL, 0);
18248 check("-4294967294", 2, 0);
18249 check("-4294967295", 1, 0);
18250 check("-4294967296", 4294967295UL, ERANGE);
18251 check("-4294967297", 4294967295UL, ERANGE);
18256 : Should we write these tests to be more portable by sprintf-ing
18257 : ~0 and then manipulating that char string as input for strtol?
18260 $cat >>try.c <<'EOCP'
18267 if eval $compile; then
18268 case "`$run ./try`" in
18269 ok) echo "Your strtoul() seems to be working okay." ;;
18271 Your strtoul() doesn't seem to be working okay.
18277 echo "(I can't seem to compile the test program--assuming it doesn't)"
18283 : see if strtoull exists
18284 set strtoull d_strtoull
18287 case "$d_longlong-$d_strtoull" in
18290 Checking whether your strtoull() works okay...
18292 $cat >try.c <<'EOCP'
18295 #define strtoull __strtoull
18298 extern unsigned long long int strtoull(char *s, char **, int);
18299 static int bad = 0;
18300 int check(char *s, long long eull, int een) {
18303 gull = strtoull(s, 0, 10);
18304 if (!((gull == eull) && (errno == een)))
18308 check(" 1", 1LL, 0);
18309 check(" 0", 0LL, 0);
18310 check("18446744073709551615", 18446744073709551615ULL, 0);
18311 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18312 #if 0 /* strtoull() for /^-/ strings is undefined. */
18313 check("-1", 18446744073709551615ULL, 0);
18314 check("-18446744073709551614", 2LL, 0);
18315 check("-18446744073709551615", 1LL, 0);
18316 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18317 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18324 if eval $compile; then
18325 case "`$run ./try`" in
18326 ok) echo "Your strtoull() seems to be working okay." ;;
18328 Your strtoull() doesn't seem to be working okay.
18330 d_strtoull="$undef"
18334 echo "(I can't seem to compile the test program--assuming it doesn't)"
18335 d_strtoull="$undef"
18340 : see if strtouq exists
18341 set strtouq d_strtouq
18344 case "$d_strtouq" in
18347 Checking whether your strtouq() works okay...
18349 $cat >try.c <<'EOCP'
18352 extern unsigned long long int strtouq(char *s, char **, int);
18353 static int bad = 0;
18354 void check(char *s, unsigned long long eull, int een) {
18355 unsigned long long gull;
18357 gull = strtouq(s, 0, 10);
18358 if (!((gull == eull) && (errno == een)))
18362 check(" 1", 1LL, 0);
18363 check(" 0", 0LL, 0);
18364 check("18446744073709551615", 18446744073709551615ULL, 0);
18365 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18366 #if 0 /* strtouq() for /^-/ strings is undefined. */
18367 check("-1", 18446744073709551615ULL, 0);
18368 check("-18446744073709551614", 2LL, 0);
18369 check("-18446744073709551615", 1LL, 0);
18370 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18371 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18379 if eval $compile; then
18380 case "`$run ./try`" in
18381 ok) echo "Your strtouq() seems to be working okay." ;;
18383 Your strtouq() doesn't seem to be working okay.
18389 echo "(I can't seem to compile the test program--assuming it doesn't)"
18395 : see if strxfrm exists
18396 set strxfrm d_strxfrm
18399 : see if symlink exists
18400 set symlink d_symlink
18403 : see if syscall exists
18404 set syscall d_syscall
18407 : see if prototype for syscall is available
18409 set d_syscallproto syscall $i_unistd unistd.h
18412 : see if sysconf exists
18413 set sysconf d_sysconf
18416 : see if system exists
18417 set system d_system
18420 : see if tcgetpgrp exists
18421 set tcgetpgrp d_tcgetpgrp
18424 : see if tcsetpgrp exists
18425 set tcsetpgrp d_tcsetpgrp
18428 : see if prototype for telldir is available
18430 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
18433 : see if time exists
18435 if test "X$d_time" = X -o X"$timetype" = X; then
18436 if set time val -f d_time; eval $csym; $val; then
18437 echo 'time() found.' >&4
18439 rp="What is the type returned by time() on this system?"
18440 set time_t timetype long stdio.h sys/types.h
18443 echo 'time() not found, hope that will do.' >&4
18451 : see if timegm exists
18452 set timegm d_timegm
18455 : see if this is a sys/times.h system
18456 set sys/times.h i_systimes
18459 : see if times exists
18461 if set times val -f d_times; eval $csym; $val; then
18462 echo 'times() found.' >&4
18465 case "$i_systimes" in
18466 "$define") inc='sys/times.h';;
18468 rp="What is the type returned by times() on this system?"
18469 set clock_t clocktype long stdio.h sys/types.h $inc
18472 echo 'times() NOT found, hope that will do.' >&4
18477 : see if tmpnam_r exists
18478 set tmpnam_r d_tmpnam_r
18480 case "$d_tmpnam_r" in
18482 hdrs="$i_systypes sys/types.h define stdio.h "
18483 case "$d_tmpnam_r_proto:$usethreads" in
18484 ":define") d_tmpnam_r_proto=define
18485 set d_tmpnam_r_proto tmpnam_r $hdrs
18489 case "$d_tmpnam_r_proto" in
18491 case "$tmpnam_r_proto" in
18492 ''|0) try='char* tmpnam_r(char*);'
18493 ./protochk "$extern_C $try" $hdrs && tmpnam_r_proto=B_B ;;
18495 case "$tmpnam_r_proto" in
18496 ''|0) d_tmpnam_r=undef
18498 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
18499 * ) case "$tmpnam_r_proto" in
18500 REENTRANT_PROTO*) ;;
18501 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
18503 echo "Prototype: $try" ;;
18506 *) case "$usethreads" in
18507 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
18514 *) tmpnam_r_proto=0
18518 : see if truncate exists
18519 set truncate d_truncate
18522 : see if ttyname_r exists
18523 set ttyname_r d_ttyname_r
18525 case "$d_ttyname_r" in
18527 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
18528 case "$d_ttyname_r_proto:$usethreads" in
18529 ":define") d_ttyname_r_proto=define
18530 set d_ttyname_r_proto ttyname_r $hdrs
18534 case "$d_ttyname_r_proto" in
18536 case "$ttyname_r_proto" in
18537 ''|0) try='int ttyname_r(int, char*, size_t);'
18538 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBW ;;
18540 case "$ttyname_r_proto" in
18541 ''|0) try='int ttyname_r(int, char*, int);'
18542 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBI ;;
18544 case "$ttyname_r_proto" in
18545 ''|0) try='char* ttyname_r(int, char*, int);'
18546 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=B_IBI ;;
18548 case "$ttyname_r_proto" in
18549 ''|0) d_ttyname_r=undef
18551 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
18552 * ) case "$ttyname_r_proto" in
18553 REENTRANT_PROTO*) ;;
18554 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
18556 echo "Prototype: $try" ;;
18559 *) case "$usethreads" in
18560 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
18567 *) ttyname_r_proto=0
18571 : see if tzname[] exists
18573 if set tzname val -a d_tzname; eval $csym; $val; then
18575 echo 'tzname[] found.' >&4
18578 echo 'tzname[] NOT found.' >&4
18583 : Check if is a multiplatform env
18585 next|rhapsody|darwin) multiarch="$define" ;;
18587 case "$multiarch" in
18588 ''|[nN]*) multiarch="$undef" ;;
18591 : check for ordering of bytes in a UV
18593 case "$usecrosscompile$multiarch" in
18596 You seem to be either cross-compiling or doing a multiarchitecture build,
18597 skipping the byteorder check.
18603 case "$byteorder" in
18606 In the following, larger digits indicate more significance. A big-endian
18607 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
18608 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
18609 machines may have weird orders like 3412. A Cray will report 87654321,
18610 an Alpha will report 12345678. If the test program works the default is
18612 I'm now running the test program...
18616 #$i_stdlib I_STDLIB
18618 #include <stdlib.h>
18620 #include <sys/types.h>
18621 typedef $uvtype UV;
18631 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
18633 u.l = (UV)0x04030201;
18634 for (i = 0; i < $uvsize; i++)
18635 printf("%c", u.c[i]+'0');
18642 if eval $compile && $run ./try > /dev/null; then
18645 [1-4][1-4][1-4][1-4]|12345678|87654321)
18646 echo "(The test program ran ok.)"
18647 echo "byteorder=$dflt"
18650 ????|????????) echo "(The test program ran ok.)" ;;
18651 *) echo "(The test program didn't run right for some reason.)" ;;
18656 (I can't seem to compile the test program. Guessing big-endian...)
18659 case "$xxx_prompt" in
18661 rp="What is the order of bytes in $uvtype?"
18674 : Checking 32bit alignedness
18677 Checking to see whether you can access character data unalignedly...
18679 case "$d_u32align" in
18680 '') $cat >try.c <<EOCP
18682 #$i_stdlib I_STDLIB
18684 #include <stdlib.h>
18686 #define U32 $u32type
18687 #define BYTEORDER 0x$byteorder
18689 #include <signal.h>
18691 $signal_t bletch(int s) { exit(4); }
18694 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
18695 volatile U8 buf[8];
18699 if (sizeof(U32) != 4) {
18700 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
18707 signal(SIGBUS, bletch);
18719 for (i = 0; i < 4; i++) {
18720 up = (U32*)(buf + i);
18721 if (! ((*up == 1 << (8*i)) || /* big-endian */
18722 (*up == 1 << (8*(3-i))) /* little-endian */
18726 printf("read failed (%x)\n", *up);
18732 for (i = 0; i < 4; i++) {
18733 up = (U32*)(buf + i);
18735 if (*up != 0xBeef) {
18736 printf("write failed (%x)\n", *up);
18750 if eval $compile_ok; then
18751 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
18752 $run ./try 2>&1 >/dev/null
18755 You can access character data pretty unalignedly.
18757 d_u32align="$undef"
18760 It seems that you must access character data in an aligned manner.
18762 d_u32align="$define"
18766 rp='Can you access character data at unaligned addresses?'
18770 [yY]*) d_u32align="$undef" ;;
18771 *) d_u32align="$define" ;;
18778 : see if ualarm exists
18779 set ualarm d_ualarm
18782 : see if umask exists
18786 : see if unordered exists
18787 set unordered d_unordered
18790 : see if unsetenv exists
18791 set unsetenv d_unsetenv
18794 : see if usleep exists
18795 set usleep d_usleep
18798 : see if prototype for usleep is available
18800 set d_usleepproto usleep $i_unistd unistd.h
18803 : see if ustat exists
18807 : see if closedir exists
18808 set closedir d_closedir
18811 case "$d_closedir" in
18814 echo "Checking whether closedir() returns a status..." >&4
18816 #$i_dirent I_DIRENT /**/
18817 #$i_sysdir I_SYS_DIR /**/
18818 #$i_sysndir I_SYS_NDIR /**/
18819 #$i_systypes I_SYS_TYPES /**/
18821 #if defined(I_SYS_TYPES)
18822 #include <sys/types.h>
18824 #if defined(I_DIRENT)
18825 #include <dirent.h>
18826 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
18827 #include <sys/dir.h>
18831 #include <sys/ndir.h>
18835 #include <ndir.h> /* may be wrong in the future */
18837 #include <sys/dir.h>
18842 int main() { return closedir(opendir(".")); }
18845 if eval $compile_ok; then
18846 if $run ./try > /dev/null 2>&1 ; then
18847 echo "Yes, it does."
18850 echo "No, it doesn't."
18854 echo "(I can't seem to compile the test program--assuming it doesn't)"
18862 set d_void_closedir
18866 : see if there is a wait4
18870 : see if waitpid exists
18871 set waitpid d_waitpid
18874 : see if wcstombs exists
18875 set wcstombs d_wcstombs
18878 : see if wctomb exists
18879 set wctomb d_wctomb
18882 : see if writev exists
18883 set writev d_writev
18886 : preserve RCS keywords in files with variable substitution, grrr
18891 Revision='$Revision'
18893 : check for alignment requirements
18895 case "$usecrosscompile$multiarch" in
18898 You seem to be either cross-compiling or doing a multiarchitecture build,
18899 skipping the memory alignment check.
18902 case "$alignbytes" in
18903 '') alignbytes=8 ;;
18907 case "$alignbytes" in
18908 '') echo "Checking alignment constraints..." >&4
18909 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
18910 $cat >try.c <<'EOCP'
18911 typedef long double NV;
18914 $cat >try.c <<'EOCP'
18918 $cat >>try.c <<'EOCP'
18926 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
18931 if eval $compile_ok; then
18935 echo "(I can't seem to compile the test program...)"
18938 *) dflt="$alignbytes"
18941 rp="Doubles must be aligned on a how-many-byte boundary?"
18949 : set the base revision
18952 : length of character in bytes. Is always 1, otherwise it isnt C
18953 : This used to be a test using sizeof
18956 : Check for the number of bits in a character
18957 case "$charbits" in
18958 '') echo "Checking how long a character is (in bits)..." >&4
18965 for (c = 1, n = 0; c; c <<= 1, n++) ;
18966 printf ("%d\n", n);
18971 if eval $compile_ok; then
18975 echo "(I can't seem to compile the test program. Guessing...)"
18982 rp="What is the length of a character (in bits)?"
18986 case "$charbits" in
18989 Your system has an unsigned character size of $charbits bits, which
18990 is rather unusual (normally it is 8 bits). Perl likely will not work
18991 correctly on your system, with subtle bugs in various places.
18993 rp='Do you really want to continue?'
18997 [yY]) echo >&4 "Okay, continuing." ;;
19002 : how do we concatenate cpp tokens here?
19004 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
19005 $cat >cpp_stuff.c <<'EOCP'
19006 #define RCAT(a,b)a/**/b
19007 #define ACAT(a,b)a ## b
19011 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
19012 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
19013 echo "Oh! Smells like ANSI's been here." >&4
19014 echo "We can catify or stringify, separately or together!"
19016 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
19017 echo "Ah, yes! The good old days!" >&4
19018 echo "However, in the good old days we don't know how to stringify and"
19019 echo "catify at the same time."
19023 Hmm, I don't seem to be able to concatenate tokens with your cpp.
19024 You're going to have to edit the values of CAT[2-5] in config.h...
19026 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
19030 : see if this is a db.h system
19036 : Check db version.
19038 echo "Checking Berkeley DB version ..." >&4
19044 #include <sys/types.h>
19046 #$i_stdlib I_STDLIB
19048 #include <stdlib.h>
19051 int main(int argc, char *argv[])
19053 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
19054 int Major, Minor, Patch ;
19055 unsigned long Version ;
19056 (void)db_version(&Major, &Minor, &Patch) ;
19058 printf("%d %d %d %d %d %d\n",
19059 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
19060 Major, Minor, Patch);
19063 printf("You have Berkeley DB Version 2 or greater.\n");
19065 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
19066 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
19067 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
19068 Major, Minor, Patch) ;
19070 /* check that db.h & libdb are compatible */
19071 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
19072 printf("db.h and libdb are incompatible.\n") ;
19076 printf("db.h and libdb are compatible.\n") ;
19078 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
19079 + DB_VERSION_PATCH ;
19081 /* needs to be >= 2.3.4 */
19082 if (Version < 2003004) {
19083 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
19084 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
19090 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
19095 printf("You have Berkeley DB Version 1.\n");
19096 exit(0); /* DB version < 2: the coast is clear. */
19098 exit(1); /* <db.h> not Berkeley DB? */
19104 if eval $compile_ok && $run ./try; then
19105 echo 'Looks OK.' >&4
19107 db_version_major=$1
19108 db_version_minor=$2
19109 db_version_patch=$3
19111 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
19115 : Remove db from list of libraries to use
19116 echo "Removing unusable -ldb from library list" >&4
19117 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
19120 echo "libs = $libs" >&4
19130 : Check the return type needed for hash
19132 echo "Checking return type needed for hash for Berkeley DB ..." >&4
19138 #include <sys/types.h>
19141 #ifndef DB_VERSION_MAJOR
19142 u_int32_t hash_cb (ptr, size)
19150 info.hash = hash_cb;
19154 if $cc $ccflags -c try.c >try.out 2>&1 ; then
19155 if $contains warning try.out >>/dev/null 2>&1 ; then
19158 db_hashtype='u_int32_t'
19161 : XXX Maybe we should just give up here.
19162 db_hashtype=u_int32_t
19164 echo "Help: I can't seem to compile the db test program." >&4
19165 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
19168 echo "Your version of Berkeley DB uses $db_hashtype for hash."
19170 *) db_hashtype=u_int32_t
19175 : Check the return type needed for prefix
19177 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
19183 #include <sys/types.h>
19186 #ifndef DB_VERSION_MAJOR
19187 size_t prefix_cb (key1, key2)
19195 info.prefix = prefix_cb;
19199 if $cc $ccflags -c try.c >try.out 2>&1 ; then
19200 if $contains warning try.out >>/dev/null 2>&1 ; then
19201 db_prefixtype='int'
19203 db_prefixtype='size_t'
19206 db_prefixtype='size_t'
19207 : XXX Maybe we should just give up here.
19209 echo "Help: I can't seem to compile the db test program." >&4
19210 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
19213 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
19215 *) db_prefixtype='size_t'
19219 : How can we generate normalized random numbers ?
19221 echo "Looking for a random number function..." >&4
19222 case "$randfunc" in
19224 if set drand48 val -f; eval $csym; $val; then
19226 echo "Good, found drand48()." >&4
19227 elif set random val -f; eval $csym; $val; then
19229 echo "OK, found random()." >&4
19232 echo "Yick, looks like I have to use rand()." >&4
19243 *-Dmy_rand=*|*-Dmy_srand=*)
19244 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
19245 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
19246 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
19247 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
19251 while $test "$cont"; do
19252 rp="Use which function to generate random numbers?"
19254 if $test "$ans" = "$dflt"; then
19260 if set $ans val -f; eval $csym; $val; then
19264 rp="I cannot find function $ans. Use that name anyway?"
19273 case "$randfunc" in
19275 drand01="drand48()"
19281 case "$randbits" in
19283 echo "Checking to see how many bits your $randfunc() function produces..." >&4
19285 #$i_unistd I_UNISTD
19286 #$i_stdlib I_STDLIB
19289 # include <unistd.h>
19292 # include <stdlib.h>
19297 register unsigned long tmp;
19298 register unsigned long max = 0L;
19300 for (i = 1000; i; i--) {
19301 tmp = (unsigned long) $randfunc();
19302 if (tmp > max) max = tmp;
19304 for (i = 0; max; i++)
19310 if eval $compile_ok; then
19314 echo "(I can't seem to compile the test program...)"
19321 rp="How many bits does your $randfunc() function produce?"
19325 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
19326 seedfunc="s$randfunc"
19327 randseedtype=unsigned
19331 rp="How many bits does your $randfunc() function produce?"
19334 seedfunc="s$randfunc"
19335 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
19336 if set $seedfunc val -f; eval $csym; $val; then
19337 echo "(Using $seedfunc() to seed random generator)"
19339 echo "(Warning: no $seedfunc() to seed random generator)"
19342 randseedtype=unsigned
19349 : Determine if this is an EBCDIC system
19351 echo "Determining whether or not we are on an EBCDIC system..." >&4
19352 $cat >try.c <<'EOM'
19355 if ('M'==0xd4) return 0;
19362 if eval $compile_ok; then
19363 if $run ./try; then
19364 echo "You seem to speak EBCDIC." >&4
19367 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
19370 echo "I'm unable to compile the test program." >&4
19371 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
19377 : Check how to flush
19380 Checking how to flush all pending stdio output...
19382 # I only know how to find the first 32 possibly open files on SunOS.
19383 # See also hints/sunos_4_1.sh and util.c --AD
19385 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
19387 $cat >>try.c <<EOCP
19389 #$i_stdlib I_STDLIB
19391 #include <stdlib.h>
19393 #$i_unistd I_UNISTD
19395 # include <unistd.h>
19397 #$d_sysconf HAS_SYSCONF
19398 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
19399 #ifdef HAS_STDIO_STREAM_ARRAY
19400 # define STDIO_STREAM_ARRAY $stdio_stream_array
19405 p = fopen("try.out", "w");
19409 # ifdef TRY_FPRINTF
19413 #ifdef TRY_FFLUSH_NULL
19416 #ifdef TRY_FFLUSH_ALL
19418 long open_max = -1;
19419 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
19420 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
19422 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
19423 open_max = sysconf(_SC_OPEN_MAX);
19426 open_max = FOPEN_MAX;
19429 open_max = OPEN_MAX;
19438 # ifdef HAS_STDIO_STREAM_ARRAY
19439 if (open_max > 0) {
19441 for (i = 0; i < open_max; i++)
19442 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
19443 STDIO_STREAM_ARRAY[i]._file < open_max &&
19444 STDIO_STREAM_ARRAY[i]._flag)
19445 fflush(&STDIO_STREAM_ARRAY[i]);
19453 : first we have to find out how _not_ to flush
19455 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
19457 set try -DTRY_FPUTC
19458 if eval $compile; then
19459 $run ./try 2>/dev/null
19462 if $test ! -s try.out -a "X$code" = X42; then
19468 set try -DTRY_FPRINTF
19469 if eval $compile; then
19470 $run ./try 2>/dev/null
19473 if $test ! -s try.out -a "X$code" = X42; then
19474 output=-DTRY_FPRINTF
19480 : check for fflush NULL behaviour
19481 case "$fflushNULL" in
19482 '') set try -DTRY_FFLUSH_NULL $output
19483 if eval $compile; then
19484 $run ./try 2>/dev/null
19487 if $test -s try.out -a "X$code" = X42; then
19488 fflushNULL="`$cat try.out`"
19490 if $test "X$code" != X42; then
19492 (If this test failed, don't worry, we'll try another method shortly.)
19497 $rm -f core try.core core.try.*
19498 case "$fflushNULL" in
19500 Your fflush(NULL) works okay for output streams.
19501 Let's see if it clobbers input pipes...
19503 # As of mid-March 2000 all versions of Solaris appear to have a stdio
19504 # bug that improperly flushes the input end of pipes. So we avoid the
19505 # autoflush on fork/system/exec support for now. :-(
19506 $cat >tryp.c <<EOCP
19509 main(int argc, char **argv)
19515 while ((i = getc(stdin)) != -1
19516 && (*bp++ = i) != '\n'
19517 && bp < &buf[1024])
19520 fprintf(stdout, "%s", buf);
19528 fflushNULL="$define"
19530 if eval $compile; then
19532 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19533 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19535 fflush(NULL) seems to behave okay with input streams.
19537 fflushNULL="$define"
19540 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
19542 fflushNULL="$undef"
19545 $rm -f core tryp.c tryp.core core.tryp.*
19548 Your fflush(NULL) isn't working (contrary to ANSI C).
19550 fflushNULL="$undef"
19553 Cannot figure out whether your fflush(NULL) works or not.
19554 I'm assuming it doesn't (contrary to ANSI C).
19556 fflushNULL="$undef"
19560 $define|true|[yY]*)
19561 fflushNULL="$define"
19564 fflushNULL="$undef"
19567 : check explicit looping only if NULL did not work, and if the pipe
19568 : bug does not show up on an explicit flush too
19569 case "$fflushNULL" in
19571 $cat >tryp.c <<EOCP
19574 main(int argc, char **argv)
19580 while ((i = getc(stdin)) != -1
19581 && (*bp++ = i) != '\n'
19582 && bp < &buf[1024])
19585 fprintf(stdout, "%s", buf);
19594 if eval $compile; then
19596 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19597 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19599 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
19601 : now check for fflushall behaviour
19602 case "$fflushall" in
19603 '') set try -DTRY_FFLUSH_ALL $output
19604 if eval $compile; then
19606 (Now testing the other method--but note that this also may fail.)
19608 $run ./try 2>/dev/null
19611 if $test -s try.out -a "X$code" = X42; then
19612 fflushall="`$cat try.out`"
19616 case "$fflushall" in
19618 Whew. Flushing explicitly all the stdio streams works.
19620 fflushall="$define"
19623 Sigh. Flushing explicitly all the stdio streams doesn't work.
19628 Cannot figure out whether flushing stdio streams explicitly works or not.
19629 I'm assuming it doesn't.
19635 "$define"|true|[yY]*)
19636 fflushall="$define"
19644 All is futile. Even fflush(stdin) clobbers input pipes!
19651 $rm -f core tryp.c tryp.core core.tryp.*
19653 *) fflushall="$undef"
19657 case "$fflushNULL$fflushall" in
19660 OK, I give up. I cannot figure out how to flush pending stdio output.
19661 We won't be flushing handles at all before fork/exec/popen.
19667 : Store the full pathname to the ar program for use in the C program
19668 : Respect a hint or command line value for full_ar.
19673 : Store the full pathname to the sed program for use in the C program
19676 : see what type gids are declared as in the kernel
19678 echo "Looking for the type for group ids returned by getgid()."
19679 set gid_t gidtype xxx stdio.h sys/types.h
19683 xxx=`./findhdr sys/user.h`
19684 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
19686 unsigned) dflt="$1 $2" ;;
19690 *) dflt="$gidtype";;
19693 gid_t) echo "gid_t found." ;;
19694 *) rp="What is the type for group ids returned by getgid()?"
19700 : Check the size of GID
19703 *_t) zzz="$gidtype" ;;
19706 echo "Checking the size of $zzz..." >&4
19708 #include <sys/types.h>
19710 #$i_stdlib I_STDLIB
19712 #include <stdlib.h>
19715 printf("%d\n", (int)sizeof($gidtype));
19720 if eval $compile_ok; then
19724 echo "(I can't execute the test program--guessing $gidsize.)" >&4
19727 echo "Your $zzz is $gidsize bytes long."
19732 echo "(I can't compile the test program--guessing $gidsize.)" >&4
19736 : Check if GID is signed
19739 *_t) zzz="$gidtype" ;;
19742 echo "Checking the sign of $zzz..." >&4
19744 #include <sys/types.h>
19755 if eval $compile; then
19759 echo "(I can't execute the test program--guessing unsigned.)" >&4
19763 1) echo "Your $zzz is unsigned." ;;
19764 -1) echo "Your $zzz is signed." ;;
19770 echo "(I can't compile the test program--guessing unsigned.)" >&4
19774 : Check 64bit sizes
19777 if $test X"$quadtype" != X; then
19779 echo "Checking how to print 64-bit integers..." >&4
19781 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
19782 $cat >try.c <<'EOCP'
19783 #include <sys/types.h>
19786 int q = 12345678901;
19787 printf("%ld\n", q);
19791 if eval $compile; then
19795 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
19796 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
19797 echo "We will use %d."
19803 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
19804 $cat >try.c <<'EOCP'
19805 #include <sys/types.h>
19808 long q = 12345678901;
19809 printf("%ld\n", q);
19813 if eval $compile; then
19817 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
19818 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
19819 echo "We will use %ld."
19825 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
19826 $cat >try.c <<'EOCP'
19827 #include <sys/types.h>
19828 #include <inttypes.h>
19831 int64_t q = 12345678901;
19832 printf("%" PRId64 "\n", q);
19836 if eval $compile; then
19840 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
19841 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
19842 echo "We will use the C9X style."
19848 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19850 #include <sys/types.h>
19853 $quadtype q = 12345678901;
19854 printf("%Ld\n", q);
19858 if eval $compile; then
19862 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
19863 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
19864 echo "We will use %Ld."
19870 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
19871 $cat >try.c <<'EOCP'
19872 #include <sys/types.h>
19875 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
19876 printf("%lld\n", q);
19880 if eval $compile; then
19884 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
19885 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
19886 echo "We will use the %lld style."
19892 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19894 #include <sys/types.h>
19897 $quadtype q = 12345678901;
19898 printf("%qd\n", q);
19902 if eval $compile; then
19906 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
19907 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
19908 echo "We will use %qd."
19914 if $test X"$sPRId64" = X; then
19915 echo "Cannot figure out how to print 64-bit integers." >&4
19922 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
19923 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
19925 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
19926 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
19930 : Check format strings for internal types
19932 $echo "Checking the format strings to be used for Perl's internal types..." >&4
19934 if $test X"$ivsize" = X8; then
19935 ivdformat="$sPRId64"
19936 uvuformat="$sPRIu64"
19937 uvoformat="$sPRIo64"
19938 uvxformat="$sPRIx64"
19939 uvXUformat="$sPRIXU64"
19941 if $test X"$ivsize" = X"$longsize"; then
19948 if $test X"$ivsize" = X"$intsize"; then
19956 if $test X"$ivsize" = X"$shortsize"; then
19967 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
19968 nveformat="$sPRIeldbl"
19969 nvfformat="$sPRIfldbl"
19970 nvgformat="$sPRIgldbl"
19971 nvEUformat="$sPRIEUldbl"
19972 nvFUformat="$sPRIFUldbl"
19973 nvGUformat="$sPRIGUldbl"
19983 case "$ivdformat" in
19984 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
19989 : Check format string for GID
19992 $echo "Checking the format string to be used for gids..." >&4
19995 -1) if $test X"$gidsize" = X"$ivsize"; then
19996 gidformat="$ivdformat"
19998 if $test X"$gidsize" = X"$longsize"; then
20001 if $test X"$gidsize" = X"$intsize"; then
20004 if $test X"$gidsize" = X"$shortsize"; then
20011 *) if $test X"$gidsize" = X"$uvsize"; then
20012 gidformat="$uvuformat"
20014 if $test X"$gidsize" = X"$longsize"; then
20017 if $test X"$gidsize" = X"$intsize"; then
20020 if $test X"$gidsize" = X"$shortsize"; then
20029 : see if getgroups exists
20030 set getgroups d_getgrps
20033 : see if setgroups exists
20034 set setgroups d_setgrps
20037 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
20039 case "$d_getgrps$d_setgrps" in
20041 case "$groupstype" in
20042 '') dflt="$gidtype" ;;
20043 *) dflt="$groupstype" ;;
20046 What type of pointer is the second argument to getgroups() and setgroups()?
20047 Usually this is the same as group ids, $gidtype, but not always.
20050 rp='What type pointer is the second argument to getgroups() and setgroups()?'
20054 *) groupstype="$gidtype";;
20057 : MAD = Misc Attribute Definition
20059 if $test $patchlevel -lt 9; then
20060 : MAD is not available in 5.8.x or earlier.
20064 $define|true|[yY]*) dflt='y' ;;
20069 Would you like to build with Misc Attribute Decoration? This is development
20070 work leading to a Perl 5 to Perl 6 convertor, which imposes a space and speed
20071 overhead on the interpreter.
20073 If this doesn't make any sense to you, just accept the default '$dflt'.
20075 rp='Build Perl with MAD?'
20080 madlyh='madly.h madly.act madly.tab'
20082 madlyobj="madly$_o" ;;
20091 : check whether make sets MAKE
20093 echo "Checking if your $make program sets \$(MAKE)..." >&4
20094 case "$make_set_make" in
20096 $sed 's/^X //' > testmake.mak << 'EOF'
20098 X @echo 'maketemp="$(MAKE)"'
20100 case "`$make -f testmake.mak 2>/dev/null`" in
20101 *maketemp=*) make_set_make='#' ;;
20102 *) make_set_make="MAKE=$make" ;;
20104 $rm -f testmake.mak
20107 case "$make_set_make" in
20108 '#') echo "Yup, it does.";;
20109 *) echo "Nope, it doesn't.";;
20112 : see what type is used for mode_t
20113 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
20114 set mode_t modetype int stdio.h sys/types.h
20117 : see if we need va_copy
20119 case "$i_stdarg" in
20122 #include <stdarg.h>
20124 #$i_stdlib I_STDLIB
20126 #include <stdlib.h>
20128 #include <signal.h>
20131 ivfprintf(FILE *f, const char *fmt, va_list *valp)
20133 return vfprintf(f, fmt, *valp);
20137 myvfprintf(FILE *f, const char *fmt, va_list val)
20139 return ivfprintf(f, fmt, &val);
20143 myprintf(char *fmt, ...)
20146 va_start(val, fmt);
20147 return myvfprintf(stdout, fmt, val);
20151 main(int ac, char **av)
20153 signal(SIGSEGV, exit);
20155 myprintf("%s%cs all right, then\n", "that", '\'');
20160 if eval $compile && $run ./try 2>&1 >/dev/null; then
20161 case "`$run ./try`" in
20162 "that's all right, then")
20168 yes) echo "It seems that you don't need va_copy()." >&4
20169 need_va_copy="$undef"
20171 *) echo "It seems that va_copy() or similar will be needed." >&4
20172 need_va_copy="$define"
20177 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
20181 : see what type is used for size_t
20182 rp="What is the type used for the length parameter for string functions?"
20183 set size_t sizetype 'unsigned int' stdio.h sys/types.h
20186 : check for type of arguments to gethostbyaddr.
20187 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
20188 case "$d_gethbyaddr" in
20192 Checking to see what type of arguments are accepted by gethostbyaddr().
20194 hdrs="$define sys/types.h
20195 $d_socket sys/socket.h
20196 $i_niin netinet/in.h
20198 $i_unistd unistd.h"
20199 : The first arg can 'char *' or 'void *'
20200 : The second arg is some of integral type
20201 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
20202 for yyy in size_t long int; do
20203 case "$netdb_host_type" in
20204 '') try="$extern_C struct hostent *gethostbyaddr($xxx, $yyy, int);"
20205 if ./protochk "$try" $hdrs; then
20206 echo "Your system accepts $xxx for the first arg."
20207 echo "...and $yyy for the second arg."
20208 netdb_host_type="$xxx"
20209 netdb_hlen_type="$yyy"
20215 : In case none of those worked, prompt the user.
20216 case "$netdb_host_type" in
20217 '') rp='What is the type for the 1st argument to gethostbyaddr?'
20220 netdb_host_type=$ans
20221 rp='What is the type for the 2nd argument to gethostbyaddr?'
20224 netdb_hlen_type=$ans
20228 *) : no gethostbyaddr, so pick harmless defaults
20229 netdb_host_type='char *'
20230 netdb_hlen_type="$sizetype"
20233 # Remove the "const" if needed. -- but then we'll have a
20235 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
20238 : check for type of argument to gethostbyname.
20239 if test "X$netdb_name_type" = X ; then
20240 case "$d_gethbyname" in
20244 Checking to see what type of argument is accepted by gethostbyname().
20246 hdrs="$define sys/types.h
20247 $d_socket sys/socket.h
20248 $i_niin netinet/in.h
20250 $i_unistd unistd.h"
20251 for xxx in "const char *" "char *"; do
20252 case "$netdb_name_type" in
20253 '') try="$extern_C struct hostent *gethostbyname($xxx);"
20254 if ./protochk "$try" $hdrs; then
20255 echo "Your system accepts $xxx."
20256 netdb_name_type="$xxx"
20261 : In case none of those worked, prompt the user.
20262 case "$netdb_name_type" in
20263 '') rp='What is the type for the 1st argument to gethostbyname?'
20266 netdb_name_type=$ans
20270 *) : no gethostbyname, so pick harmless default
20271 netdb_name_type='char *'
20276 : check for type of 1st argument to getnetbyaddr.
20277 if test "X$netdb_net_type" = X ; then
20278 case "$d_getnbyaddr" in
20282 Checking to see what type of 1st argument is accepted by getnetbyaddr().
20284 hdrs="$define sys/types.h
20285 $d_socket sys/socket.h
20286 $i_niin netinet/in.h
20288 $i_unistd unistd.h"
20289 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
20290 case "$netdb_net_type" in
20291 '') try="$extern_C struct netent *getnetbyaddr($xxx, int);"
20292 if ./protochk "$try" $hdrs; then
20293 echo "Your system accepts $xxx."
20294 netdb_net_type="$xxx"
20299 : In case none of those worked, prompt the user.
20300 case "$netdb_net_type" in
20301 '') rp='What is the type for the 1st argument to getnetbyaddr?'
20304 netdb_net_type=$ans
20308 *) : no getnetbyaddr, so pick harmless default
20309 netdb_net_type='long'
20313 : locate the preferred pager for this system
20320 [a-zA-Z]:/*) dflt=$pg;;
20324 [a-zA-Z]:/*) dflt=$more;;
20328 [a-zA-Z]:/*) dflt=$less;;
20331 '') dflt=/usr/ucb/more;;
20339 rp='What pager is used on your system?'
20343 : see what type pids are declared as in the kernel
20344 rp="What is the type of process ids on this system?"
20345 set pid_t pidtype int stdio.h sys/types.h
20348 : see if ar generates random libraries by itself
20350 echo "Checking how to generate random libraries on your machine..." >&4
20351 echo 'int bar1() { return bar2(); }' > bar1.c
20352 echo 'int bar2() { return 2; }' > bar2.c
20354 #$i_stdlib I_STDLIB
20356 #include <stdlib.h>
20358 int main() { printf("%d\n", bar1()); exit(0); }
20360 $cc $ccflags -c bar1.c >/dev/null 2>&1
20361 $cc $ccflags -c bar2.c >/dev/null 2>&1
20362 $cc $ccflags -c foo.c >/dev/null 2>&1
20363 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
20364 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20365 $run ./foobar >/dev/null 2>&1; then
20366 echo "$ar appears to generate random libraries itself."
20368 if [ "X$ranlib" = "X" ]; then
20371 elif $ar s bar$_a >/dev/null 2>&1 &&
20372 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20373 $run ./foobar >/dev/null 2>&1; then
20374 echo "a table of contents needs to be added with '$ar s'."
20377 elif $ar ts bar$_a >/dev/null 2>&1 &&
20378 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20379 $run ./foobar >/dev/null 2>&1; then
20380 echo "a table of contents needs to be added with '$ar ts'."
20387 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
20388 $test -f $ranlib || ranlib=''
20391 if $test -n "$ranlib"; then
20392 echo "your system has '$ranlib'; we'll use that."
20395 echo "your system doesn't seem to support random libraries"
20396 echo "so we'll use lorder and tsort to order the libraries."
20403 : see if this is a values.h system
20404 set values.h i_values
20407 : Check the max offset that gmtime and localtime accept
20408 echo "Checking max offsets that gmtime () accepts"
20411 define) yyy="#include <values.h>" ;;
20415 case "$sGMTIME_min/$sGMTIME_max" in
20418 #include <sys/types.h>
20427 void gm_check (time_t t, int min_year, int max_year)
20430 if ( tmp == NULL ||
20431 /* Check tm_year overflow */
20432 tmp->tm_year < min_year || tmp->tm_year > max_year)
20443 gm_check (MAXLONG, 69, 0x7fffffff);
20445 if (tmp == NULL || tmp->tm_year < 0) {
20446 for (i = 63; i >= 0; i--) {
20447 time_t x = pt | ((time_t)1 << i);
20448 if (x < 0 || x < pt) continue;
20449 gm_check (x, 69, 0x7fffffff);
20452 printf ("sGMTIME_max=%ld\n", pt);
20461 gm_check (MINLONG, -1900, 70);
20464 for (i = 36; i >= 0; i--) {
20465 time_t x = pt - ((time_t)1 << i);
20466 if (x > 0) continue;
20467 gm_check (x, -1900, 70);
20470 printf ("sGMTIME_min=%ld\n", pt);
20474 int main (int argc, char *argv[])
20476 fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t));
20483 if eval $compile; then
20486 echo "Cannot determine sGMTIME_max and sGMTIME_min." >&4
20492 echo "Checking max offsets that localtime () accepts"
20494 case "$sLOCALTIME_min/$sLOCALTIME_max" in
20497 #include <sys/types.h>
20506 void local_check (time_t t, int min_year, int max_year)
20508 if (sizeof (time_t) > 4 && t > 0x7ffffffffffff000LL)
20511 tmp = localtime (&t);
20512 if ( tmp == NULL ||
20513 /* Check tm_year overflow */
20514 tmp->tm_year < min_year || tmp->tm_year > max_year)
20518 } /* local_check */
20525 local_check (MAXLONG, 69, 0x7fffffff);
20527 if (tmp == NULL || tmp->tm_year < 0) {
20528 for (i = 63; i >= 0; i--) {
20529 time_t x = pt | ((time_t)1 << i);
20530 if (x < 0 || x < pt) continue;
20531 local_check (x, 69, 0x7fffffff);
20534 printf ("sLOCALTIME_max=%ld\n", pt);
20543 local_check (MINLONG, -1900, 70);
20546 for (i = 36; i >= 0; i--) {
20547 time_t x = pt - ((time_t)1 << i);
20548 if (x > 0) continue;
20549 local_check (x, -1900, 70);
20552 printf ("sLOCALTIME_min=%ld\n", pt);
20556 int main (int argc, char *argv[])
20564 if eval $compile; then
20567 echo "Cannot determine sLOCALTIME_max and sLOCALTIME_min." >&4
20573 : check for type of arguments to select.
20574 case "$selecttype" in
20575 '') case "$d_select" in
20579 Checking to see what type of arguments are accepted by select().
20581 hdrs="$define sys/types.h
20582 $i_systime sys/time.h
20583 $i_sysselct sys/select.h
20584 $d_socket sys/socket.h"
20585 : The first arg can be int, unsigned, or size_t
20586 : The last arg may or may not be 'const'
20588 : void pointer has been seen but using that
20589 : breaks the selectminbits test
20590 for xxx in 'fd_set *' 'int *'; do
20591 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
20592 for tmo in 'struct timeval *' 'const struct timeval *'; do
20594 '') try="$extern_C select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
20595 if ./protochk "$try" $hdrs; then
20596 echo "Your system accepts $xxx."
20605 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
20606 case "$d_fd_set" in
20607 $define) dflt="fd_set *" ;;
20616 *) : no select, so pick a harmless default
20623 : check for the select 'width'
20624 case "$selectminbits" in
20625 '') safebits=`expr $ptrsize \* 8`
20626 case "$d_select" in
20630 Checking to see on how many bits at a time your select() operates...
20633 #include <sys/types.h>
20635 #$i_systime I_SYS_TIME
20636 #$i_systimek I_SYS_TIME_KERNEL
20641 # ifdef I_SYS_TIME_KERNEL
20644 # include <sys/time.h>
20645 # ifdef I_SYS_TIME_KERNEL
20649 #$i_sysselct I_SYS_SELECT
20650 #ifdef I_SYS_SELECT
20651 #include <sys/select.h>
20653 #$d_socket HAS_SOCKET
20655 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
20658 #$i_stdlib I_STDLIB
20660 #include <stdlib.h>
20663 #define S sizeof(*(b))
20665 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
20666 #define NBITS (NBYTES * 8)
20668 char *s = (char *)malloc(NBYTES);
20677 fp = fopen("try.c", "r");
20683 b = ($selecttype)s;
20684 for (i = 0; i < NBITS; i++)
20688 select(fd + 1, b, 0, 0, &t);
20689 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
20691 printf("%d\n", i + 1);
20696 if eval $compile_ok; then
20697 selectminbits=`$run ./try`
20698 case "$selectminbits" in
20700 Cannot figure out on how many bits at a time your select() operates.
20701 I'll play safe and guess it is $safebits bits.
20703 selectminbits=$safebits
20704 bits="$safebits bits"
20707 *) bits="$selectminbits bits" ;;
20709 echo "Your select() operates on $bits at a time." >&4
20711 rp='What is the minimum number of bits your select() operates on?'
20712 case "$byteorder" in
20713 12345678) dflt=64 ;;
20719 selectminbits="$val"
20723 *) : no select, so pick a harmless default
20724 selectminbits=$safebits
20730 : Trace out the files included by signal.h, then look for SIGxxx names.
20731 if [ "X$fieldn" = X ]; then
20732 : Just make some guesses. We check them later.
20733 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
20735 xxx=`echo '#include <signal.h>' |
20736 $cppstdin $cppminus $cppflags 2>/dev/null |
20737 $grep '^[ ]*#.*include' |
20738 $awk "{print \\$$fieldn}" | $sed 's!"!!g' |\
20739 $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
20742 for xx in $xxx /dev/null ; do
20743 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
20745 case "$xxxfiles" in
20746 '') xxxfiles=`./findhdr signal.h` ;;
20749 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
20750 print substr($2, 4, 20)
20752 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
20753 print substr($3, 4, 20)
20755 : Append some common names just in case the awk scan failed.
20756 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
20757 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
20758 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
20759 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
20760 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
20762 : generate a few handy files for later
20763 $cat > signal.c <<EOCP
20764 #include <sys/types.h>
20765 #include <signal.h>
20766 #$i_stdlib I_STDLIB
20768 #include <stdlib.h>
20773 /* Strange style to avoid deeply-nested #if/#else/#endif */
20776 # define NSIG (_NSIG)
20782 # define NSIG (SIGMAX+1)
20788 # define NSIG (SIG_MAX+1)
20794 # define NSIG (_SIG_MAX+1)
20800 # define NSIG (MAXSIG+1)
20806 # define NSIG (MAX_SIG+1)
20811 # ifdef SIGARRAYSIZE
20812 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
20818 # define NSIG (_sys_nsig) /* Solaris 2.5 */
20822 /* Default to some arbitrary number that's big enough to get most
20823 of the common signals.
20829 printf("NSIG %d\n", NSIG);
20835 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
20837 printf "#ifdef SIG"; printf $1; printf "\n"
20838 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
20839 printf $1; printf ");\n"
20843 printf "#endif /* JUST_NSIG */\n";
20844 printf "exit(0);\n}\n";
20847 $cat >signal.awk <<'EOP'
20848 BEGIN { ndups = 0 }
20849 $1 ~ /^NSIG$/ { nsig = $2 }
20850 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
20851 if ($2 > maxsig) { maxsig = $2 }
20852 if (sig_name[$2]) {
20853 dup_name[ndups] = $1
20854 dup_num[ndups] = $2
20866 printf("NSIG %d\n", nsig);
20867 for (n = 1; n < nsig; n++) {
20869 printf("%s %d\n", sig_name[n], sig_num[n])
20872 printf("NUM%d %d\n", n, n)
20875 for (n = 0; n < ndups; n++) {
20876 printf("%s %d\n", dup_name[n], dup_num[n])
20880 $cat >signal_cmd <<EOS
20882 if $test -s signal.lst; then
20883 echo "Using your existing signal.lst file"
20888 $cat >>signal_cmd <<'EOS'
20891 if eval $compile_ok; then
20892 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) |\
20893 $uniq | $awk -f signal.awk >signal.lst
20895 echo "(I can't seem be able to compile the whole test program)" >&4
20896 echo "(I'll try it in little pieces.)" >&4
20897 set signal -DJUST_NSIG
20898 if eval $compile_ok; then
20899 $run ./signal$_exe > signal.nsg
20902 echo "I can't seem to figure out how many signals you have." >&4
20903 echo "Guessing 50." >&4
20904 echo 'NSIG 50' > signal.nsg
20906 : Now look at all the signal names, one at a time.
20907 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
20908 $cat > signal.c <<EOCP
20909 #include <sys/types.h>
20910 #include <signal.h>
20913 printf("$xx %d\n", SIG${xx});
20918 if eval $compile; then
20919 echo "SIG${xx} found."
20920 $run ./signal$_exe >> signal.ls1
20922 echo "SIG${xx} NOT found."
20925 if $test -s signal.ls1; then
20926 $cat signal.nsg signal.ls1 |
20927 $sort -n | $uniq | $awk -f signal.awk >signal.lst
20931 if $test -s signal.lst; then
20934 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
20935 echo 'kill -l' >signal
20936 set X `csh -f <signal`
20940 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
20942 echo $@ | $tr ' ' $trnl | \
20943 $awk '{ printf "%s %d\n", $1, ++s; }
20944 END { printf "NSIG %d\n", ++s }' >signal.lst
20946 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
20948 chmod a+x signal_cmd
20949 $eunicefix signal_cmd
20951 : generate list of signal names
20953 case "$sig_name_init" in
20955 *) case "$sig_num_init" in
20956 ''|*,*) doinit=yes ;;
20961 echo "Generating a list of signal names and numbers..." >&4
20963 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
20964 sig_name=`$awk 'BEGIN { printf "ZERO " }
20965 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
20966 sig_num=`$awk 'BEGIN { printf "0 " }
20967 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
20968 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
20969 !/^NSIG/ { printf "\"%s\", ", $1 }
20970 END { printf "0\n" }' signal.lst`
20971 sig_num_init=`$awk 'BEGIN { printf "0, " }
20972 !/^NSIG/ { printf "%d, ", $2}
20973 END { printf "0\n"}' signal.lst`
20976 echo "The following $sig_count signals are available:"
20978 echo $sig_name | $awk \
20979 'BEGIN { linelen = 0 }
20981 for (i = 1; i <= NF; i++) {
20982 name = "SIG" $i " "
20983 linelen = linelen + length(name)
20984 if (linelen > 70) {
20986 linelen = length(name)
20992 sig_size=`echo $sig_name | awk '{print NF}'`
20993 $rm -f signal signal.c signal.awk signal.lst signal_cmd
20995 : Check size of size
20997 case "$sizetype" in
20998 *_t) zzz="$sizetype" ;;
20999 *) zzz="filesize" ;;
21001 echo "Checking the size of $zzz..." >&4
21003 #include <sys/types.h>
21005 #$i_stdlib I_STDLIB
21007 #include <stdlib.h>
21010 printf("%d\n", (int)sizeof($sizetype));
21015 if eval $compile_ok; then
21019 echo "(I can't execute the test program--guessing $sizesize.)" >&4
21022 echo "Your $zzz size is $sizesize bytes."
21027 echo "(I can't compile the test program--guessing $sizesize.)" >&4
21031 : check for socklen_t
21033 echo "Checking to see if you have socklen_t..." >&4
21035 #include <sys/types.h>
21036 #$d_socket HAS_SOCKET
21038 #include <sys/socket.h>
21040 int main() { socklen_t x = 16; }
21043 if eval $compile; then
21045 echo "You have socklen_t."
21048 echo "You do not have socklen_t."
21049 case "$sizetype" in
21050 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
21057 : see if this is a socks.h system
21058 set socks.h i_socks
21061 : check for type of the size argument to socket calls
21062 case "$d_socket" in
21066 Checking to see what type is the last argument of accept().
21069 case "$d_socklen_t" in
21070 "$define") yyy="$yyy socklen_t"
21072 yyy="$yyy $sizetype int long unsigned"
21073 for xxx in $yyy; do
21074 case "$socksizetype" in
21075 '') try="$extern_C int accept(int, struct sockaddr *, $xxx *);"
21076 case "$usesocks" in
21078 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
21079 echo "Your system accepts '$xxx *' for the last argument of accept()."
21080 socksizetype="$xxx"
21083 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
21084 echo "Your system accepts '$xxx *' for the last argument of accept()."
21085 socksizetype="$xxx"
21092 : In case none of those worked, prompt the user.
21093 case "$socksizetype" in
21094 '') rp='What is the type for socket address structure sizes?'
21101 *) : no sockets, so pick relatively harmless default
21106 : see what type is used for signed size_t
21107 set ssize_t ssizetype int stdio.h sys/types.h
21112 #$i_stdlib I_STDLIB
21114 #include <stdlib.h>
21116 #include <sys/types.h>
21117 #define Size_t $sizetype
21118 #define SSize_t $dflt
21121 if (sizeof(Size_t) == sizeof(SSize_t))
21123 else if (sizeof(Size_t) == sizeof(int))
21132 if eval $compile_ok && $run ./try > /dev/null; then
21133 ssizetype=`$run ./try`
21134 echo "I'll be using $ssizetype for functions returning a byte count." >&4
21137 Help! I can't compile and run the ssize_t test program: please enlighten me!
21138 (This is probably a misconfiguration in your system or libraries, and
21139 you really ought to fix it. Still, I'll try anyway.)
21141 I need a type that is the same size as $sizetype, but is guaranteed to
21142 be signed. Common values are ssize_t, int and long.
21145 rp="What signed type is the same size as $sizetype?"
21151 : Check the size of st_ino
21153 $echo "Checking the size of st_ino..." >&4
21154 $cat > try.c <<EOCP
21155 #include <sys/stat.h>
21157 #$i_stdlib I_STDLIB
21159 #include <stdlib.h>
21163 printf("%d\n", (int)sizeof(st.st_ino));
21168 if eval $compile_ok; then
21172 $echo "(I can't execute the test program--guessing $st_ino_size.)" >&4
21174 *) st_ino_size=$val
21175 $echo "Your st_ino is $st_ino_size bytes long."
21180 $echo "(I can't compile the test program--guessing $st_ino_size.)" >&4
21184 : Check if st_ino is signed
21186 $echo "Checking the sign of st_ino..." >&4
21187 $cat > try.c <<EOCP
21188 #include <sys/stat.h>
21193 if (foo.st_ino < 0)
21200 if eval $compile; then
21204 $echo "(I can't execute the test program--guessing unsigned.)" >&4
21206 *) st_ino_sign=$val
21207 case "$st_ino_sign" in
21208 1) $echo "Your st_ino is unsigned." ;;
21209 -1) $echo "Your st_ino is signed." ;;
21215 $echo "(I can't compile the test program--guessing unsigned.)" >&4
21219 : see what type of char stdio uses.
21221 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
21222 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
21223 echo "Your stdio uses unsigned chars." >&4
21224 stdchar="unsigned char"
21226 echo "Your stdio uses signed chars." >&4
21231 : see what type uids are declared as in the kernel
21233 echo "Looking for the type for user ids returned by getuid()."
21234 set uid_t uidtype xxx stdio.h sys/types.h
21238 xxx=`./findhdr sys/user.h`
21239 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
21241 unsigned) dflt="$1 $2" ;;
21245 *) dflt="$uidtype";;
21248 uid_t) echo "uid_t found." ;;
21249 *) rp="What is the type for user ids returned by getuid()?"
21255 : Check size of UID
21258 *_t) zzz="$uidtype" ;;
21261 echo "Checking the size of $zzz..." >&4
21263 #include <sys/types.h>
21265 #$i_stdlib I_STDLIB
21267 #include <stdlib.h>
21270 printf("%d\n", (int)sizeof($uidtype));
21275 if eval $compile_ok; then
21279 echo "(I can't execute the test program--guessing $uidsize.)" >&4
21282 echo "Your $zzz is $uidsize bytes long."
21287 echo "(I can't compile the test program--guessing $uidsize.)" >&4
21290 : Check if UID is signed
21293 *_t) zzz="$uidtype" ;;
21296 echo "Checking the sign of $zzz..." >&4
21298 #include <sys/types.h>
21309 if eval $compile; then
21313 echo "(I can't execute the test program--guessing unsigned.)" >&4
21317 1) echo "Your $zzz is unsigned." ;;
21318 -1) echo "Your $zzz is signed." ;;
21324 echo "(I can't compile the test program--guessing unsigned.)" >&4
21328 : Check format string for UID
21330 $echo "Checking the format string to be used for uids..." >&4
21333 -1) if $test X"$uidsize" = X"$ivsize"; then
21334 uidformat="$ivdformat"
21336 if $test X"$uidsize" = X"$longsize"; then
21339 if $test X"$uidsize" = X"$intsize"; then
21342 if $test X"$uidsize" = X"$shortsize"; then
21349 *) if $test X"$uidsize" = X"$uvsize"; then
21350 uidformat="$uvuformat"
21352 if $test X"$uidsize" = X"$longsize"; then
21355 if $test X"$uidsize" = X"$intsize"; then
21358 if $test X"$uidsize" = X"$shortsize"; then
21367 : Determine if we can use sysctl with KERN_PROC_PATHNAME to find executing program
21369 echo "Determining whether we can use sysctl with KERN_PROC_PATHNAME to find executing program..." >&4
21370 $cat >try.c <<'EOM'
21371 /* Intentionally a long probe as I'd like to sanity check that the exact
21372 approach is going to work, as thinking it will work, but only having it
21373 part working at runtime is worse than not having it. */
21375 #include <sys/types.h>
21376 #include <sys/sysctl.h>
21377 #include <sys/param.h>
21379 #include <string.h>
21380 #include <stdlib.h>
21381 #include <unistd.h>
21384 main(int argc, char **argv) {
21386 char *argv_leaf = strrchr(argv[0], '/');
21392 mib[1] = KERN_PROC;
21393 mib[2] = KERN_PROC_PATHNAME;
21397 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
21401 if (sysctl(mib, 4, NULL, &size, NULL, 0)) {
21406 if (size < strlen(argv_leaf) + 1) {
21407 fprintf(stderr, "size %lu is too short for a path\n",
21408 (unsigned long) size);
21412 if (size > MAXPATHLEN * MAXPATHLEN) {
21413 fprintf(stderr, "size %lu is too long for a path\n",
21414 (unsigned long) size);
21418 buffer = malloc(size);
21424 if (sysctl(mib, 4, buffer, &size, NULL, 0)) {
21429 if (strlen(buffer) + 1 != size) {
21430 fprintf(stderr, "size != strlen(buffer) + 1 (%lu != %lu)\n",
21431 (unsigned long)size, (unsigned long)strlen(buffer) + 1);
21436 if (*buffer != '/') {
21437 fprintf(stderr, "Not an absolute path: '%s'\n", buffer);
21441 if (strstr(buffer, "/./")) {
21442 fprintf(stderr, "Contains /./: '%s'\n", buffer);
21446 if (strstr(buffer, "/../")) {
21447 fprintf(stderr, "Contains /../: '%s'\n", buffer);
21451 buffer_leaf = strrchr(buffer, '/');
21452 if (strcmp(buffer_leaf, argv_leaf) != 0) {
21453 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], buffer);
21465 if eval $compile_ok; then
21466 if $run ./try; then
21467 echo "You can use sysctl with KERN_PROC_PATHNAME to find the executing program." >&4
21470 echo "Nope, sysctl with KERN_PROC_PATHNAME doesn't work here." >&4
21474 echo "I'm unable to compile the test program." >&4
21475 echo "I'll assume no sysctl with KERN_PROC_PATHNAME here." >&4
21479 set usekernprocpathname
21482 : Determine if we can use _NSGetExecutablePath to find executing program
21484 echo "Determining whether we can use _NSGetExecutablePath to find executing program..." >&4
21485 $cat >try.c <<'EOM'
21486 /* Intentionally a long probe as I'd like to sanity check that the exact
21487 approach is going to work, as thinking it will work, but only having it
21488 part working at runtime is worse than not having it. */
21489 #include <mach-o/dyld.h>
21491 #include <stdlib.h>
21492 #include <sys/param.h>
21493 #include <string.h>
21496 main(int argc, char **argv) {
21498 uint32_t size = sizeof(buf);
21502 char *argv_leaf = strrchr(argv[0], '/');
21506 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
21510 _NSGetExecutablePath(buf, &size);
21511 if (size > MAXPATHLEN * MAXPATHLEN) {
21512 fprintf(stderr, "_NSGetExecutablePath size %u is too long for a path\n",
21513 (unsigned int) size);
21517 buffer = malloc(size);
21523 result = _NSGetExecutablePath(buffer, &size);
21525 fprintf(stderr, "_NSGetExecutablePath returned %i for a size of %u\n",
21526 result, (unsigned int) size);
21530 tidied = realpath(buffer, NULL);
21532 perror("realpath");
21538 if (*tidied != '/') {
21539 fprintf(stderr, "Not an absolute path: '%s'\n", tidied);
21543 if (strstr(tidied, "/./")) {
21544 fprintf(stderr, "Contains /./: '%s'\n", tidied);
21548 if (strstr(tidied, "/../")) {
21549 fprintf(stderr, "Contains /../: '%s'\n", tidied);
21553 tidied_leaf = strrchr(tidied, '/');
21554 if (strcmp(tidied_leaf, argv_leaf) != 0) {
21555 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], tidied);
21567 if eval $compile_ok; then
21568 if $run ./try; then
21569 echo "You can use _NSGetExecutablePath to find the executing program." >&4
21572 echo "Nope, _NSGetExecutablePath doesn't work here." >&4
21575 echo "I'm unable to compile the test program." >&4
21576 echo "I'll assume no _NSGetExecutablePath here." >&4
21579 set usensgetexecutablepath
21582 : Check if site customization support was requested
21583 case "$usesitecustomize" in
21584 $define|true|[Yy]*)
21585 usesitecustomize="$define"
21588 usesitecustomize="$undef"
21592 : see if prototypes support variable argument declarations
21594 case "$prototype$i_stdarg" in
21596 echo "It appears we'll be able to prototype varargs functions." >&4
21600 echo "Too bad... We won't be using prototyped varargs functions..." >&4
21607 : determine compiler compiler
21616 if $test -f "$byacc$_exe"; then
21618 comp="byacc or $comp"
21620 if $test -f "$bison$_exe"; then
21621 comp="$comp or bison -y"
21623 rp="Which compiler compiler ($comp) shall I use?"
21632 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
21638 : see if this is a assert.h system
21639 set assert.h i_assert
21642 : see if this is a fp.h system
21646 : see if this is a fp_class.h system
21647 set fp_class.h i_fp_class
21650 : see if gdbm.h is available
21655 : see if gdbm_open exists
21656 set gdbm_open d_gdbm_open
21658 case "$d_gdbm_open" in
21661 echo "We won't be including <gdbm.h>"
21670 : see if this is a ieeefp.h system
21671 case "$i_ieeefp" in
21672 '' ) set ieeefp.h i_ieeefp
21677 : see if this is a libutil.h system
21678 set libutil.h i_libutil
21681 : see if mach cthreads are available
21682 if test "X$usethreads" = "X$define"; then
21683 set mach/cthreads.h i_machcthr
21686 i_machcthr="$undef"
21689 : see if this is a mntent.h system
21690 set mntent.h i_mntent
21693 : see if net/errno.h is available
21695 set net/errno.h val
21698 : Unfortunately, it causes problems on some systems. Arrgh.
21701 cat > try.c <<'EOM'
21704 #include <net/errno.h>
21710 if $cc $ccflags -c try.c >/dev/null 2>&1; then
21711 echo "We'll be including <net/errno.h>." >&4
21713 echo "We won't be including <net/errno.h>." >&4
21722 : see if netinet/tcp.h is available
21723 set netinet/tcp.h i_netinettcp
21726 : see if this is a poll.h system
21730 : see if this is a prot.h system
21734 : Preprocessor symbols
21736 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
21737 $cat <<'EOSH' > Cppsym.know
21738 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
21739 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
21740 alliant alpha am29000 AM29000 AMD64 amd64 amiga AMIGAOS AMIX
21741 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
21742 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
21743 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
21744 bull c cadmus clipper CMU COFF COMPILER_VERSION
21745 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
21746 CYGWIN DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
21747 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
21748 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
21750 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
21751 H3050R H3050RX hbullx20 hcx host_mips
21752 hp200 hp300 hp700 HP700 hp800 hp9000
21753 hp9000s200 hp9000s300 hp9000s400 hp9000s500
21754 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
21755 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
21756 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
21757 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
21758 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
21759 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
21760 LIBCATAMOUNT Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
21761 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
21762 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
21763 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
21764 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
21765 MATH_HAS_NO_SIDE_EFFECTS
21766 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
21767 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
21768 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
21769 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
21770 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
21771 NetBSD news1500 news1700 news1800 news1900 news3700
21772 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
21773 ns32016 ns32332 ns32k nsc32000
21774 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
21775 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
21776 pc532 pdp11 PGC PIC plexus PORTAR posix
21777 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
21778 POSIX_C_SOURCE POSIX_SOURCE POWER
21779 PROTOTYPES PWB pyr QNX QK_USER R3000 REENTRANT RES Rhapsody RISC6000
21780 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
21781 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
21782 sony sony_news sonyrisc sparc sparclite spectrum
21783 stardent stdc STDC_EXT stratos sun sun3 sun386
21784 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
21785 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
21786 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
21787 sysV68 sysV88 Tek4132 Tek4300 titan
21788 TM3200 TM5400 TM5600
21789 tower tower32 tower32_200 tower32_600 tower32_700
21790 tower32_800 tower32_850 tss
21791 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
21792 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
21793 unix UNIX95 UNIX99 unixpc unos
21794 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
21795 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
21796 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
21798 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms x86_64 xenix Xenix286
21799 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
21800 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
21803 # Maybe put other stuff here too.
21804 cat <<EOSH >>Cppsym.know
21807 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
21808 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
21809 $cat Cppsym.know > Cppsym.c
21810 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
21811 $rm -f Cppsym.a Cppsym.b Cppsym.c
21812 cat <<EOSH > Cppsym
21814 if $test \$# -gt 0; then
21815 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
21816 if $test -s Cppsym.got; then
21823 $tr " " "$trnl" | ./Cppsym.try
21829 cat <<EOSH > Cppsym.try
21831 cat <<'EOCP' > try.c
21834 #define STRINGIFY(a) "a"
21836 #if cpp_stuff == 42
21837 #define StGiFy(a) #a
21838 #define STRINGIFY(a) StGiFy(a)
21840 #if $cpp_stuff != 1 && $cpp_stuff != 42
21841 # include "Bletch: How does this C preprocessor stringify macros?"
21847 cat <<'EOSH' >> Cppsym.try
21849 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
21850 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
21851 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
21852 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
21854 echo 'return 0;}' >> try.c
21856 cat <<EOSH >> Cppsym.try
21858 case "$osname-$gccversion" in
21859 irix-) ccflags="\$ccflags -woff 1178" ;;
21860 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
21862 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
21864 chmod +x Cppsym.try
21865 $eunicefix Cppsym.try
21866 ./Cppsym < Cppsym.know > Cppsym.true
21867 : Add in any linux cpp "predefined macros":
21868 case "$osname::$gccversion" in
21869 *linux*::*.*|*gnukfreebsd*::*.*|gnu::*.*)
21871 rm -f $tHdrH'.h' $tHdrH
21873 if $cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
21874 sed 's/#define[\ \ ]*//;s/[\ \ ].*$//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
21875 if [ -s $tHdrH'_cppsym.real' ]; then
21876 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
21879 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
21882 : now check the C compiler for additional symbols
21883 postprocess_cc_v=''
21885 aix) postprocess_cc_v="|$tr , ' '" ;;
21892 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
21895 -D*) echo "\$i" | $sed 's/^-D//';;
21896 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
21901 postprocess_cc_v=''
21904 ./ccsym > ccsym1.raw
21905 if $test -s ccsym1.raw; then
21906 $sort ccsym1.raw | $uniq >ccsym.raw
21908 mv ccsym1.raw ccsym.raw
21911 $awk '/\=/ { print $0; next }
21912 { print $0"=1" }' ccsym.raw >ccsym.list
21913 $comm -13 Cppsym.true ccsym.list >ccsym.own
21914 $comm -12 Cppsym.true ccsym.list >ccsym.com
21915 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
21917 if $test -z ccsym.raw; then
21918 echo "Your C compiler doesn't seem to define any symbols!" >&4
21920 echo "However, your C preprocessor defines the following symbols:"
21923 cppsymbols=`$cat Cppsym.true`
21924 cppsymbols=`echo $cppsymbols`
21925 cppccsymbols="$cppsymbols"
21927 if $test -s ccsym.com; then
21928 echo "Your C compiler and pre-processor define these symbols:"
21929 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
21932 cppccsymbols=`$cat ccsym.com`
21933 cppccsymbols=`echo $cppccsymbols`
21934 $test "$silent" || sleep 1
21936 if $test -s ccsym.cpp; then
21937 $test "$also" && echo " "
21938 echo "Your C pre-processor ${also}defines the following symbols:"
21939 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
21941 cppsymbols=`$cat ccsym.cpp`
21942 cppsymbols=`echo $cppsymbols`
21943 $test "$silent" || sleep 1
21945 if $test -s ccsym.own; then
21946 $test "$also" && echo " "
21947 echo "Your C compiler ${also}defines the following cpp symbols:"
21948 $sed -e 's/\(..*\)=1/\1/' ccsym.own
21949 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
21950 ccsymbols=`$cat ccsym.own`
21951 ccsymbols=`echo $ccsymbols`
21952 $test "$silent" || sleep 1
21956 : see if this is a termio system
21960 if $test `./findhdr termios.h`; then
21961 set tcsetattr i_termios
21967 "$define") echo "You have POSIX termios.h... good!" >&4;;
21968 *) if ./Cppsym pyr; then
21969 case "`/bin/universe`" in
21970 ucb) if $test `./findhdr sgtty.h`; then
21972 echo "<sgtty.h> found." >&4
21974 echo "System is pyramid with BSD universe."
21975 ./warn "<sgtty.h> not found--you could have problems."
21977 *) if $test `./findhdr termio.h`; then
21979 echo "<termio.h> found." >&4
21981 echo "System is pyramid with USG universe."
21982 ./warn "<termio.h> not found--you could have problems."
21986 if $test `./findhdr termio.h`; then
21987 echo "<termio.h> found." >&4
21989 elif $test `./findhdr sgtty.h`; then
21990 echo "<sgtty.h> found." >&4
21993 ./warn "Neither <termio.h> nor <sgtty.h> found--cross fingers!"
21996 if $test `./findhdr sgtty.h`; then
21997 echo "<sgtty.h> found." >&4
21999 elif $test `./findhdr termio.h`; then
22000 echo "<termio.h> found." >&4
22003 ./warn "Neither <sgtty.h> nor <termio.h> found--cross fingers!"
22007 set i_termio; eval $setvar
22008 val=$val2; set i_sgtty; eval $setvar
22009 val=$val3; set i_termios; eval $setvar
22011 : see if stdbool is available
22012 : we want a real compile instead of Inhdr because some Solaris systems
22013 : have stdbool.h, but it can only be used if the compiler indicates it
22014 : is sufficiently c99-compliant.
22018 #include <stdbool.h>
22023 int main(int argc, char **argv)
22029 if eval $compile; then
22030 echo "<stdbool.h> found." >&4
22033 echo "<stdbool.h> NOT found." >&4
22040 : see if stddef is available
22041 set stddef.h i_stddef
22044 : see if sys/access.h is available
22045 set sys/access.h i_sysaccess
22048 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
22049 set sys/filio.h i_sysfilio
22052 if $test `./findhdr sys/ioctl.h`; then
22054 echo '<sys/ioctl.h> found.' >&4
22057 if $test $i_sysfilio = "$define"; then
22058 echo '<sys/ioctl.h> NOT found.' >&4
22060 $test $i_sgtty = "$define" && xxx="sgtty.h"
22061 $test $i_termio = "$define" && xxx="termio.h"
22062 $test $i_termios = "$define" && xxx="termios.h"
22063 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
22069 : see if socket ioctl defs are in sys/sockio.h
22071 xxx=`./findhdr sys/sockio.h`
22072 if $test "$xxx"; then
22073 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
22075 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
22078 echo "No socket ioctls found in <sys/sockio.h>." >&4
22083 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
22089 : see if this is a syslog.h system
22090 set syslog.h i_syslog
22093 : see if this is a sys/mode.h system
22094 set sys/mode.h i_sysmode
22097 : see if there is a sys/poll.h file
22098 set sys/poll.h i_syspoll
22101 : see if sys/resource.h has to be included
22102 set sys/resource.h i_sysresrc
22105 : see if sys/security.h is available
22106 set sys/security.h i_syssecrt
22109 : see if this is a sys/statvfs.h system
22110 set sys/statvfs.h i_sysstatvfs
22113 : see if this is a sys/un.h system
22114 set sys/un.h i_sysun
22117 : see if this is a sys/utsname.h system
22118 set sys/utsname.h i_sysutsname
22121 : see if this is a syswait system
22122 set sys/wait.h i_syswait
22125 : see if this is a ustat.h system
22126 set ustat.h i_ustat
22129 : see if this is an utime system
22130 set utime.h i_utime
22133 : see if this is a vfork system
22136 set vfork.h i_vfork
22146 echo "Looking for extensions..." >&4
22147 : If we are using the old config.sh, known_extensions may contain
22148 : old or inaccurate or duplicate values.
22149 known_extensions=''
22150 nonxs_extensions=''
22151 : We do not use find because it might not be available.
22152 : We do not just use MANIFEST because the user may have dropped
22153 : some additional extensions into the source tree and expect them
22156 : Function to recursively find available extensions, ignoring DynaLoader
22157 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
22158 : In 5.10.1 and later, extensions are stored in directories
22159 : like File-Glob instead of the older File/Glob/.
22163 DynaLoader|dynaload) ;;
22165 this_ext=`echo $xxx | $sed -e s/-/\\\//g`;
22166 leaf=`echo $xxx | $sed -e s/.*-//`;
22167 if $test -d File; then
22168 if $test -f $xxx/$leaf.xs -o -f $xxx/$leaf.c; then
22169 known_extensions="$known_extensions $1$this_ext";
22170 elif $test -f $xxx/Makefile.PL; then
22171 nonxs_extensions="$nonxs_extensions $1$this_ext";
22173 if $test -d $xxx -a $# -lt 10; then
22176 eval $find_extensions;
22182 $ls -1 $xxx > $$.tmp;
22183 if $contains "\.xs$" $$.tmp > /dev/null 2>&1; then
22184 known_extensions="$known_extensions $this_ext";
22185 elif $contains "\.c$" $$.tmp > /dev/null 2>&1; then
22186 known_extensions="$known_extensions $this_ext";
22187 elif $test -d $xxx; then
22188 nonxs_extensions="$nonxs_extensions $this_ext";
22199 eval $find_extensions
22203 eval $find_extensions
22207 eval $find_extensions
22208 if $test -d File-Glob; then
22209 : All ext/ flattened
22211 # Special case: Add in modules that nest beyond the first level.
22212 # Currently threads/shared and Hash/Util/FieldHash, since they are
22213 # not picked up by the recursive find above (and adding in general
22214 # recursive finding breaks SDBM_File/sdbm).
22215 # A.D. 20011025 (SDBM), ajgough 20071008 (FieldHash)
22216 known_extensions="$known_extensions threads/shared Hash/Util/FieldHash"
22218 set X $known_extensions
22220 known_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
22221 set X $nonxs_extensions
22223 nonxs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
22226 : Now see which are supported on this system.
22228 for xxx in $known_extensions ; do
22232 $define) avail_ext="$avail_ext $xxx" ;;
22235 GDBM_File|gdbm_fil)
22237 $define) avail_ext="$avail_ext $xxx" ;;
22240 I18N/Langinfo|i18n_lan)
22241 case "$i_langinfo$d_nl_langinfo" in
22242 $define$define) avail_ext="$avail_ext $xxx" ;;
22246 : XXX Do we need a useipcsysv variable here
22247 case "${d_msg}${d_sem}${d_shm}" in
22248 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
22251 NDBM_File|ndbm_fil)
22254 case "$osname-$use64bitint" in
22257 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
22260 *) avail_ext="$avail_ext $xxx" ;;
22265 ODBM_File|odbm_fil)
22266 case "${i_dbm}${i_rpcsvcdbm}" in
22268 case "$d_cplusplus" in
22269 define) ;; # delete as a function name will not work
22270 *) case "$osname-$use64bitint" in
22273 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
22276 *) avail_ext="$avail_ext $xxx" ;;
22284 case "$useopcode" in
22285 true|define|y) avail_ext="$avail_ext $xxx" ;;
22289 case "$useposix" in
22290 true|define|y) avail_ext="$avail_ext $xxx" ;;
22294 case "$d_socket" in
22297 beos) ;; # not unless BONE
22298 *) avail_ext="$avail_ext $xxx" ;;
22303 Sys/Syslog|sys/syslog)
22304 : XXX syslog requires socket
22305 case "$d_socket" in
22306 true|$define|y) avail_ext="$avail_ext $xxx" ;;
22310 case "$usethreads" in
22312 case "$use5005threads" in
22313 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
22317 threads|threads/shared)
22318 # threads and threads::shared are special cases.
22319 # To stop people from asking "Perl 5.8.0 was supposed
22320 # to have this new fancy threads implementation but my
22321 # perl doesn't have it" and from people trying to
22322 # (re)install the threads module using CPAN.pm and
22323 # CPAN.pm then offering to reinstall Perl 5.8.0,
22324 # the threads.pm and threads/shared.pm will always be
22325 # there, croaking informatively ("you need to rebuild
22326 # all of Perl with threads, sorry") when threads haven't
22327 # been compiled in.
22329 avail_ext="$avail_ext $xxx"
22335 cygwin) avail_ext="$avail_ext $xxx" ;;
22338 XS/APItest|xs/apitest)
22339 # This is just for testing. Skip it unless we have dynamic loading.
22342 $define) avail_ext="$avail_ext $xxx" ;;
22345 XS/Typemap|xs/typemap)
22346 # This is just for testing. Skip it unless we have dynamic loading.
22348 $define) avail_ext="$avail_ext $xxx" ;;
22351 *) avail_ext="$avail_ext $xxx"
22360 case "$onlyextensions" in
22362 *) keepextensions=''
22363 echo "You have requested that only certain extensions be included..." >&4
22364 for i in $onlyextensions; do
22365 case " $avail_ext " in
22367 echo "Keeping extension $i."
22368 keepextensions="$keepextensions $i"
22370 *) echo "Ignoring extension $i." ;;
22373 avail_ext="$keepextensions"
22377 case "$noextensions" in
22379 *) keepextensions=''
22380 echo "You have requested that certain extensions be ignored..." >&4
22381 for i in $avail_ext; do
22382 case " $noextensions " in
22383 *" $i "*) echo "Ignoring extension $i." ;;
22384 *) echo "Keeping extension $i.";
22385 keepextensions="$keepextensions $i"
22389 avail_ext="$keepextensions"
22393 : Now see which nonxs extensions are supported on this system.
22394 : For now assume all are.
22396 for xxx in $nonxs_extensions ; do
22398 *) nonxs_ext="$nonxs_ext $xxx"
22410 A number of extensions are supplied with $package. You may choose to
22411 compile these extensions for dynamic loading (the default), compile
22412 them into the $package executable (static loading), or not include
22413 them at all. Answer "none" to include no extensions.
22414 Note that DynaLoader is always built and need not be mentioned here.
22417 case "$dynamic_ext" in
22419 : Exclude those listed in static_ext
22421 for xxx in $avail_ext; do
22422 case " $static_ext " in
22424 *) dflt="$dflt $xxx" ;;
22431 *) dflt="$dynamic_ext"
22432 # Perhaps we are reusing an old out-of-date config.sh.
22435 if test X"$dynamic_ext" != X"$avail_ext"; then
22437 NOTICE: Your previous config.sh list may be incorrect.
22438 The extensions now available to you are
22440 but the default list from your previous config.sh is
22452 rp="What extensions do you wish to load dynamically?"
22455 none) dynamic_ext=' ' ;;
22456 *) dynamic_ext="$ans" ;;
22459 case "$static_ext" in
22461 : Exclude those already listed in dynamic linking
22463 for xxx in $avail_ext; do
22464 case " $dynamic_ext " in
22466 *) dflt="$dflt $xxx" ;;
22473 *) dflt="$static_ext"
22480 rp="What extensions do you wish to load statically?"
22483 none) static_ext=' ' ;;
22484 *) static_ext="$ans" ;;
22489 A number of extensions are supplied with $package. Answer "none"
22490 to include no extensions.
22491 Note that DynaLoader is always built and need not be mentioned here.
22494 case "$static_ext" in
22495 '') dflt="$avail_ext" ;;
22496 *) dflt="$static_ext"
22497 # Perhaps we are reusing an old out-of-date config.sh.
22500 if test X"$static_ext" != X"$avail_ext"; then
22502 NOTICE: Your previous config.sh list may be incorrect.
22503 The extensions now available to you are
22505 but the default list from your previous config.sh is
22514 : Exclude those that are not xs extensions
22518 rp="What extensions do you wish to include?"
22521 none) static_ext=' ' ;;
22522 *) static_ext="$ans" ;;
22527 # Encode is a special case. If we are building Encode as a static
22528 # extension, we need to explicitly list its subextensions as well.
22529 # For other nested extensions, this is handled automatically by
22530 # the appropriate Makefile.PL.
22531 case " $static_ext " in
22532 *" Encode "*) # Add the subextensions of Encode
22534 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
22535 static_ext="$static_ext Encode/$xxx"
22541 set X $dynamic_ext $static_ext $nonxs_ext
22545 # Sanity check: We require an extension suitable for use with
22546 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
22547 # should show up as failures in the test suite, but it's helpful to
22548 # catch them now.) The 'extensions' list is normally sorted
22549 # alphabetically, so we need to accept either
22550 # DB_File ... Fcntl ... IO ....
22551 # or something like
22552 # Fcntl ... NDBM_File ... IO ....
22553 case " $extensions" in
22554 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
22555 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
22556 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
22557 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
22558 echo "WARNING: The Perl you are building will be quite crippled." >& 4
22562 : Remove libraries needed only for extensions
22563 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
22564 : The exception is SunOS 4.x, which needs them.
22565 case "${osname}X${osvers}" in
22569 *) case "$usedl" in
22570 $define|true|[yY]*)
22571 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
22575 *) perllibs="$libs"
22581 : Remove build directory name from cppstdin so it can be used from
22582 : either the present location or the final installed location.
22584 : Get out of the UU directory to get correct path name.
22586 case "$cppstdin" in
22588 echo "Stripping down cppstdin path name"
22594 : end of configuration questions
22596 echo "End of configuration questions."
22599 : back to where it started
22600 if test -d ../UU; then
22604 : configuration may be unconditionally patched via a 'config.arch' file
22605 if $test -f config.arch; then
22606 echo "I see a config.arch file, loading it." >&4
22610 : configuration may be patched via a 'config.over' file
22611 if $test -f config.over; then
22614 rp='I see a config.over file. Do you wish to load it?'
22617 n*) echo "OK, I'll ignore it.";;
22619 echo "Configuration override changes have been loaded."
22624 : in case they want portability, strip down executable paths
22625 case "$d_portable" in
22628 echo "Stripping down executable paths..." >&4
22629 for file in $loclist $trylist; do
22631 eval $file=`basename $temp`
22636 : create config.sh file
22638 echo "Creating config.sh..." >&4
22639 $spitshell <<EOT >config.sh
22642 # This file was produced by running the Configure script. It holds all the
22643 # definitions figured out by Configure. Should you modify one of these values,
22644 # do not forget to propagate your changes by running "Configure -der". You may
22645 # instead choose to run each of the .SH files by yourself, or "Configure -S".
22648 # Package name : $package
22649 # Source directory : $src
22650 # Configuration time: $cf_time
22651 # Configured by : $cf_by
22652 # Target system : $myuname
22655 : Add in command line options if available
22656 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
22658 $spitshell <<EOT >>config.sh
22667 Revision='$Revision'
22675 alignbytes='$alignbytes'
22676 ansi2knr='$ansi2knr'
22677 aphostname='$aphostname'
22678 api_revision='$api_revision'
22679 api_subversion='$api_subversion'
22680 api_version='$api_version'
22681 api_versionstring='$api_versionstring'
22684 archlibexp='$archlibexp'
22685 archname64='$archname64'
22686 archname='$archname'
22687 archobjs='$archobjs'
22688 asctime_r_proto='$asctime_r_proto'
22697 byteorder='$byteorder'
22699 castflags='$castflags'
22702 cccdlflags='$cccdlflags'
22703 ccdlflags='$ccdlflags'
22705 ccflags_uselargefiles='$ccflags_uselargefiles'
22707 ccsymbols='$ccsymbols'
22708 ccversion='$ccversion'
22710 cf_email='$cf_email'
22712 charbits='$charbits'
22713 charsize='$charsize'
22717 clocktype='$clocktype'
22719 compress='$compress'
22720 contains='$contains'
22724 cpp_stuff='$cpp_stuff'
22725 cppccsymbols='$cppccsymbols'
22726 cppflags='$cppflags'
22728 cppminus='$cppminus'
22730 cppstdin='$cppstdin'
22731 cppsymbols='$cppsymbols'
22732 crypt_r_proto='$crypt_r_proto'
22733 cryptlib='$cryptlib'
22735 ctermid_r_proto='$ctermid_r_proto'
22736 ctime_r_proto='$ctime_r_proto'
22737 d_Gconvert='$d_Gconvert'
22738 d_PRIEUldbl='$d_PRIEUldbl'
22739 d_PRIFUldbl='$d_PRIFUldbl'
22740 d_PRIGUldbl='$d_PRIGUldbl'
22741 d_PRIXU64='$d_PRIXU64'
22742 d_PRId64='$d_PRId64'
22743 d_PRIeldbl='$d_PRIeldbl'
22744 d_PRIfldbl='$d_PRIfldbl'
22745 d_PRIgldbl='$d_PRIgldbl'
22746 d_PRIi64='$d_PRIi64'
22747 d_PRIo64='$d_PRIo64'
22748 d_PRIu64='$d_PRIu64'
22749 d_PRIx64='$d_PRIx64'
22750 d_SCNfldbl='$d_SCNfldbl'
22751 d__fwalk='$d__fwalk'
22752 d_access='$d_access'
22753 d_accessx='$d_accessx'
22756 d_archlib='$d_archlib'
22757 d_asctime64='$d_asctime64'
22758 d_asctime_r='$d_asctime_r'
22761 d_attribute_deprecated='$d_attribute_deprecated'
22762 d_attribute_format='$d_attribute_format'
22763 d_attribute_malloc='$d_attribute_malloc'
22764 d_attribute_nonnull='$d_attribute_nonnull'
22765 d_attribute_noreturn='$d_attribute_noreturn'
22766 d_attribute_pure='$d_attribute_pure'
22767 d_attribute_unused='$d_attribute_unused'
22768 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
22772 d_bsdgetpgrp='$d_bsdgetpgrp'
22773 d_bsdsetpgrp='$d_bsdsetpgrp'
22774 d_builtin_choose_expr='$d_builtin_choose_expr'
22775 d_builtin_expect='$d_builtin_expect'
22777 d_c99_variadic_macros='$d_c99_variadic_macros'
22778 d_casti32='$d_casti32'
22779 d_castneg='$d_castneg'
22780 d_charvspr='$d_charvspr'
22782 d_chroot='$d_chroot'
22783 d_chsize='$d_chsize'
22785 d_clearenv='$d_clearenv'
22786 d_closedir='$d_closedir'
22787 d_cmsghdr_s='$d_cmsghdr_s'
22789 d_copysignl='$d_copysignl'
22790 d_cplusplus='$d_cplusplus'
22792 d_crypt_r='$d_crypt_r'
22794 d_ctermid='$d_ctermid'
22795 d_ctermid_r='$d_ctermid_r'
22796 d_ctime64='$d_ctime64'
22797 d_ctime_r='$d_ctime_r'
22798 d_cuserid='$d_cuserid'
22799 d_dbl_dig='$d_dbl_dig'
22800 d_dbminitproto='$d_dbminitproto'
22801 d_difftime64='$d_difftime64'
22802 d_difftime='$d_difftime'
22803 d_dir_dd_fd='$d_dir_dd_fd'
22805 d_dirnamlen='$d_dirnamlen'
22806 d_dlerror='$d_dlerror'
22807 d_dlopen='$d_dlopen'
22808 d_dlsymun='$d_dlsymun'
22809 d_dosuid='$d_dosuid'
22810 d_drand48_r='$d_drand48_r'
22811 d_drand48proto='$d_drand48proto'
22813 d_eaccess='$d_eaccess'
22814 d_endgrent='$d_endgrent'
22815 d_endgrent_r='$d_endgrent_r'
22816 d_endhent='$d_endhent'
22817 d_endhostent_r='$d_endhostent_r'
22818 d_endnent='$d_endnent'
22819 d_endnetent_r='$d_endnetent_r'
22820 d_endpent='$d_endpent'
22821 d_endprotoent_r='$d_endprotoent_r'
22822 d_endpwent='$d_endpwent'
22823 d_endpwent_r='$d_endpwent_r'
22824 d_endsent='$d_endsent'
22825 d_endservent_r='$d_endservent_r'
22826 d_eofnblk='$d_eofnblk'
22827 d_eunice='$d_eunice'
22828 d_faststdio='$d_faststdio'
22829 d_fchdir='$d_fchdir'
22830 d_fchmod='$d_fchmod'
22831 d_fchown='$d_fchown'
22833 d_fcntl_can_lock='$d_fcntl_can_lock'
22834 d_fd_macros='$d_fd_macros'
22835 d_fd_set='$d_fd_set'
22836 d_fds_bits='$d_fds_bits'
22837 d_fgetpos='$d_fgetpos'
22838 d_finite='$d_finite'
22839 d_finitel='$d_finitel'
22840 d_flexfnam='$d_flexfnam'
22842 d_flockproto='$d_flockproto'
22844 d_fp_class='$d_fp_class'
22845 d_fpathconf='$d_fpathconf'
22846 d_fpclass='$d_fpclass'
22847 d_fpclassify='$d_fpclassify'
22848 d_fpclassl='$d_fpclassl'
22849 d_fpos64_t='$d_fpos64_t'
22850 d_frexpl='$d_frexpl'
22851 d_fs_data_s='$d_fs_data_s'
22852 d_fseeko='$d_fseeko'
22853 d_fsetpos='$d_fsetpos'
22854 d_fstatfs='$d_fstatfs'
22855 d_fstatvfs='$d_fstatvfs'
22857 d_ftello='$d_ftello'
22859 d_futimes='$d_futimes'
22860 d_gdbm_ndbm_h_uses_prototypes='$d_gdbm_ndbm_h_uses_prototypes'
22861 d_gdbmndbm_h_uses_prototypes='$d_gdbmndbm_h_uses_prototypes'
22862 d_getaddrinfo='$d_getaddrinfo'
22863 d_getcwd='$d_getcwd'
22864 d_getespwnam='$d_getespwnam'
22865 d_getfsstat='$d_getfsstat'
22866 d_getgrent='$d_getgrent'
22867 d_getgrent_r='$d_getgrent_r'
22868 d_getgrgid_r='$d_getgrgid_r'
22869 d_getgrnam_r='$d_getgrnam_r'
22870 d_getgrps='$d_getgrps'
22871 d_gethbyaddr='$d_gethbyaddr'
22872 d_gethbyname='$d_gethbyname'
22873 d_gethent='$d_gethent'
22874 d_gethname='$d_gethname'
22875 d_gethostbyaddr_r='$d_gethostbyaddr_r'
22876 d_gethostbyname_r='$d_gethostbyname_r'
22877 d_gethostent_r='$d_gethostent_r'
22878 d_gethostprotos='$d_gethostprotos'
22879 d_getitimer='$d_getitimer'
22880 d_getlogin='$d_getlogin'
22881 d_getlogin_r='$d_getlogin_r'
22882 d_getmnt='$d_getmnt'
22883 d_getmntent='$d_getmntent'
22884 d_getnameinfo='$d_getnameinfo'
22885 d_getnbyaddr='$d_getnbyaddr'
22886 d_getnbyname='$d_getnbyname'
22887 d_getnent='$d_getnent'
22888 d_getnetbyaddr_r='$d_getnetbyaddr_r'
22889 d_getnetbyname_r='$d_getnetbyname_r'
22890 d_getnetent_r='$d_getnetent_r'
22891 d_getnetprotos='$d_getnetprotos'
22892 d_getpagsz='$d_getpagsz'
22893 d_getpbyname='$d_getpbyname'
22894 d_getpbynumber='$d_getpbynumber'
22895 d_getpent='$d_getpent'
22896 d_getpgid='$d_getpgid'
22897 d_getpgrp2='$d_getpgrp2'
22898 d_getpgrp='$d_getpgrp'
22899 d_getppid='$d_getppid'
22900 d_getprior='$d_getprior'
22901 d_getprotobyname_r='$d_getprotobyname_r'
22902 d_getprotobynumber_r='$d_getprotobynumber_r'
22903 d_getprotoent_r='$d_getprotoent_r'
22904 d_getprotoprotos='$d_getprotoprotos'
22905 d_getprpwnam='$d_getprpwnam'
22906 d_getpwent='$d_getpwent'
22907 d_getpwent_r='$d_getpwent_r'
22908 d_getpwnam_r='$d_getpwnam_r'
22909 d_getpwuid_r='$d_getpwuid_r'
22910 d_getsbyname='$d_getsbyname'
22911 d_getsbyport='$d_getsbyport'
22912 d_getsent='$d_getsent'
22913 d_getservbyname_r='$d_getservbyname_r'
22914 d_getservbyport_r='$d_getservbyport_r'
22915 d_getservent_r='$d_getservent_r'
22916 d_getservprotos='$d_getservprotos'
22917 d_getspnam='$d_getspnam'
22918 d_getspnam_r='$d_getspnam_r'
22919 d_gettimeod='$d_gettimeod'
22920 d_gmtime64='$d_gmtime64'
22921 d_gmtime_r='$d_gmtime_r'
22922 d_gnulibc='$d_gnulibc'
22923 d_grpasswd='$d_grpasswd'
22924 d_hasmntopt='$d_hasmntopt'
22926 d_ilogbl='$d_ilogbl'
22927 d_inc_version_list='$d_inc_version_list'
22929 d_inetaton='$d_inetaton'
22930 d_inetntop='$d_inetntop'
22931 d_inetpton='$d_inetpton'
22932 d_int64_t='$d_int64_t'
22933 d_isascii='$d_isascii'
22934 d_isblank='$d_isblank'
22935 d_isfinite='$d_isfinite'
22938 d_isnanl='$d_isnanl'
22939 d_killpg='$d_killpg'
22940 d_lchown='$d_lchown'
22941 d_ldbl_dig='$d_ldbl_dig'
22942 d_libm_lib_version='$d_libm_lib_version'
22944 d_localtime64='$d_localtime64'
22945 d_localtime_r='$d_localtime_r'
22946 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
22947 d_locconv='$d_locconv'
22949 d_longdbl='$d_longdbl'
22950 d_longlong='$d_longlong'
22951 d_lseekproto='$d_lseekproto'
22953 d_madvise='$d_madvise'
22954 d_malloc_good_size='$d_malloc_good_size'
22955 d_malloc_size='$d_malloc_size'
22957 d_mbstowcs='$d_mbstowcs'
22958 d_mbtowc='$d_mbtowc'
22959 d_memchr='$d_memchr'
22960 d_memcmp='$d_memcmp'
22961 d_memcpy='$d_memcpy'
22962 d_memmove='$d_memmove'
22963 d_memset='$d_memset'
22965 d_mkdtemp='$d_mkdtemp'
22966 d_mkfifo='$d_mkfifo'
22967 d_mkstemp='$d_mkstemp'
22968 d_mkstemps='$d_mkstemps'
22969 d_mktime64='$d_mktime64'
22970 d_mktime='$d_mktime'
22973 d_modfl_pow32_bug='$d_modfl_pow32_bug'
22974 d_modflproto='$d_modflproto'
22975 d_mprotect='$d_mprotect'
22977 d_msg_ctrunc='$d_msg_ctrunc'
22978 d_msg_dontroute='$d_msg_dontroute'
22979 d_msg_oob='$d_msg_oob'
22980 d_msg_peek='$d_msg_peek'
22981 d_msg_proxy='$d_msg_proxy'
22982 d_msgctl='$d_msgctl'
22983 d_msgget='$d_msgget'
22984 d_msghdr_s='$d_msghdr_s'
22985 d_msgrcv='$d_msgrcv'
22986 d_msgsnd='$d_msgsnd'
22988 d_munmap='$d_munmap'
22989 d_mymalloc='$d_mymalloc'
22991 d_ndbm_h_uses_prototypes='$d_ndbm_h_uses_prototypes'
22993 d_nl_langinfo='$d_nl_langinfo'
22994 d_nv_preserves_uv='$d_nv_preserves_uv'
22995 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
22996 d_off64_t='$d_off64_t'
22997 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
22998 d_oldpthreads='$d_oldpthreads'
22999 d_oldsock='$d_oldsock'
23001 d_pathconf='$d_pathconf'
23003 d_perl_otherlibdirs='$d_perl_otherlibdirs'
23004 d_phostname='$d_phostname'
23007 d_portable='$d_portable'
23009 d_prctl_set_name='$d_prctl_set_name'
23010 d_printf_format_null='$d_printf_format_null'
23011 d_procselfexe='$d_procselfexe'
23012 d_pseudofork='$d_pseudofork'
23013 d_pthread_atfork='$d_pthread_atfork'
23014 d_pthread_attr_setscope='$d_pthread_attr_setscope'
23015 d_pthread_yield='$d_pthread_yield'
23017 d_pwchange='$d_pwchange'
23018 d_pwclass='$d_pwclass'
23019 d_pwcomment='$d_pwcomment'
23020 d_pwexpire='$d_pwexpire'
23021 d_pwgecos='$d_pwgecos'
23022 d_pwpasswd='$d_pwpasswd'
23023 d_pwquota='$d_pwquota'
23026 d_random_r='$d_random_r'
23027 d_readdir64_r='$d_readdir64_r'
23028 d_readdir='$d_readdir'
23029 d_readdir_r='$d_readdir_r'
23030 d_readlink='$d_readlink'
23032 d_recvmsg='$d_recvmsg'
23033 d_rename='$d_rename'
23034 d_rewinddir='$d_rewinddir'
23036 d_safebcpy='$d_safebcpy'
23037 d_safemcpy='$d_safemcpy'
23038 d_sanemcmp='$d_sanemcmp'
23039 d_sbrkproto='$d_sbrkproto'
23040 d_scalbnl='$d_scalbnl'
23041 d_sched_yield='$d_sched_yield'
23042 d_scm_rights='$d_scm_rights'
23043 d_seekdir='$d_seekdir'
23044 d_select='$d_select'
23046 d_semctl='$d_semctl'
23047 d_semctl_semid_ds='$d_semctl_semid_ds'
23048 d_semctl_semun='$d_semctl_semun'
23049 d_semget='$d_semget'
23051 d_sendmsg='$d_sendmsg'
23052 d_setegid='$d_setegid'
23053 d_seteuid='$d_seteuid'
23054 d_setgrent='$d_setgrent'
23055 d_setgrent_r='$d_setgrent_r'
23056 d_setgrps='$d_setgrps'
23057 d_sethent='$d_sethent'
23058 d_sethostent_r='$d_sethostent_r'
23059 d_setitimer='$d_setitimer'
23060 d_setlinebuf='$d_setlinebuf'
23061 d_setlocale='$d_setlocale'
23062 d_setlocale_r='$d_setlocale_r'
23063 d_setnent='$d_setnent'
23064 d_setnetent_r='$d_setnetent_r'
23065 d_setpent='$d_setpent'
23066 d_setpgid='$d_setpgid'
23067 d_setpgrp2='$d_setpgrp2'
23068 d_setpgrp='$d_setpgrp'
23069 d_setprior='$d_setprior'
23070 d_setproctitle='$d_setproctitle'
23071 d_setprotoent_r='$d_setprotoent_r'
23072 d_setpwent='$d_setpwent'
23073 d_setpwent_r='$d_setpwent_r'
23074 d_setregid='$d_setregid'
23075 d_setresgid='$d_setresgid'
23076 d_setresuid='$d_setresuid'
23077 d_setreuid='$d_setreuid'
23078 d_setrgid='$d_setrgid'
23079 d_setruid='$d_setruid'
23080 d_setsent='$d_setsent'
23081 d_setservent_r='$d_setservent_r'
23082 d_setsid='$d_setsid'
23083 d_setvbuf='$d_setvbuf'
23087 d_shmatprototype='$d_shmatprototype'
23088 d_shmctl='$d_shmctl'
23090 d_shmget='$d_shmget'
23091 d_sigaction='$d_sigaction'
23092 d_signbit='$d_signbit'
23093 d_sigprocmask='$d_sigprocmask'
23094 d_sigsetjmp='$d_sigsetjmp'
23095 d_sin6_scope_id='$d_sin6_scope_id'
23096 d_sitearch='$d_sitearch'
23097 d_snprintf='$d_snprintf'
23098 d_sockaddr_sa_len='$d_sockaddr_sa_len'
23099 d_sockatmark='$d_sockatmark'
23100 d_sockatmarkproto='$d_sockatmarkproto'
23101 d_socket='$d_socket'
23102 d_socklen_t='$d_socklen_t'
23103 d_sockpair='$d_sockpair'
23104 d_socks5_init='$d_socks5_init'
23105 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
23107 d_srand48_r='$d_srand48_r'
23108 d_srandom_r='$d_srandom_r'
23109 d_sresgproto='$d_sresgproto'
23110 d_sresuproto='$d_sresuproto'
23111 d_statblks='$d_statblks'
23112 d_statfs_f_flags='$d_statfs_f_flags'
23113 d_statfs_s='$d_statfs_s'
23114 d_static_inline='$d_static_inline'
23115 d_statvfs='$d_statvfs'
23116 d_stdio_cnt_lval='$d_stdio_cnt_lval'
23117 d_stdio_ptr_lval='$d_stdio_ptr_lval'
23118 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
23119 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
23120 d_stdio_stream_array='$d_stdio_stream_array'
23121 d_stdiobase='$d_stdiobase'
23122 d_stdstdio='$d_stdstdio'
23123 d_strchr='$d_strchr'
23124 d_strcoll='$d_strcoll'
23125 d_strctcpy='$d_strctcpy'
23126 d_strerrm='$d_strerrm'
23127 d_strerror='$d_strerror'
23128 d_strerror_r='$d_strerror_r'
23129 d_strftime='$d_strftime'
23130 d_strlcat='$d_strlcat'
23131 d_strlcpy='$d_strlcpy'
23132 d_strtod='$d_strtod'
23133 d_strtol='$d_strtol'
23134 d_strtold='$d_strtold'
23135 d_strtoll='$d_strtoll'
23136 d_strtoq='$d_strtoq'
23137 d_strtoul='$d_strtoul'
23138 d_strtoull='$d_strtoull'
23139 d_strtouq='$d_strtouq'
23140 d_strxfrm='$d_strxfrm'
23141 d_suidsafe='$d_suidsafe'
23142 d_symlink='$d_symlink'
23143 d_syscall='$d_syscall'
23144 d_syscallproto='$d_syscallproto'
23145 d_sysconf='$d_sysconf'
23146 d_sysernlst='$d_sysernlst'
23147 d_syserrlst='$d_syserrlst'
23148 d_system='$d_system'
23149 d_tcgetpgrp='$d_tcgetpgrp'
23150 d_tcsetpgrp='$d_tcsetpgrp'
23151 d_telldir='$d_telldir'
23152 d_telldirproto='$d_telldirproto'
23154 d_timegm='$d_timegm'
23156 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
23157 d_tm_tm_zone='$d_tm_tm_zone'
23158 d_tmpnam_r='$d_tmpnam_r'
23159 d_truncate='$d_truncate'
23160 d_ttyname_r='$d_ttyname_r'
23161 d_tzname='$d_tzname'
23162 d_u32align='$d_u32align'
23163 d_ualarm='$d_ualarm'
23166 d_union_semun='$d_union_semun'
23167 d_unordered='$d_unordered'
23168 d_unsetenv='$d_unsetenv'
23169 d_usleep='$d_usleep'
23170 d_usleepproto='$d_usleepproto'
23172 d_vendorarch='$d_vendorarch'
23173 d_vendorbin='$d_vendorbin'
23174 d_vendorlib='$d_vendorlib'
23175 d_vendorscript='$d_vendorscript'
23177 d_void_closedir='$d_void_closedir'
23178 d_voidsig='$d_voidsig'
23179 d_voidtty='$d_voidtty'
23180 d_volatile='$d_volatile'
23181 d_vprintf='$d_vprintf'
23182 d_vsnprintf='$d_vsnprintf'
23184 d_waitpid='$d_waitpid'
23185 d_wcstombs='$d_wcstombs'
23186 d_wctomb='$d_wctomb'
23187 d_writev='$d_writev'
23190 db_hashtype='$db_hashtype'
23191 db_prefixtype='$db_prefixtype'
23192 db_version_major='$db_version_major'
23193 db_version_minor='$db_version_minor'
23194 db_version_patch='$db_version_patch'
23195 defvoidused='$defvoidused'
23196 direntrytype='$direntrytype'
23199 doublesize='$doublesize'
23201 drand48_r_proto='$drand48_r_proto'
23203 dynamic_ext='$dynamic_ext'
23209 endgrent_r_proto='$endgrent_r_proto'
23210 endhostent_r_proto='$endhostent_r_proto'
23211 endnetent_r_proto='$endnetent_r_proto'
23212 endprotoent_r_proto='$endprotoent_r_proto'
23213 endpwent_r_proto='$endpwent_r_proto'
23214 endservent_r_proto='$endservent_r_proto'
23215 eunicefix='$eunicefix'
23218 extensions='$extensions'
23219 extern_C='$extern_C'
23221 fflushNULL='$fflushNULL'
23222 fflushall='$fflushall'
23224 firstmakefile='$firstmakefile'
23226 fpossize='$fpossize'
23227 fpostype='$fpostype'
23228 freetype='$freetype'
23231 full_csh='$full_csh'
23232 full_sed='$full_sed'
23233 gccansipedantic='$gccansipedantic'
23234 gccosandvers='$gccosandvers'
23235 gccversion='$gccversion'
23236 getgrent_r_proto='$getgrent_r_proto'
23237 getgrgid_r_proto='$getgrgid_r_proto'
23238 getgrnam_r_proto='$getgrnam_r_proto'
23239 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
23240 gethostbyname_r_proto='$gethostbyname_r_proto'
23241 gethostent_r_proto='$gethostent_r_proto'
23242 getlogin_r_proto='$getlogin_r_proto'
23243 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
23244 getnetbyname_r_proto='$getnetbyname_r_proto'
23245 getnetent_r_proto='$getnetent_r_proto'
23246 getprotobyname_r_proto='$getprotobyname_r_proto'
23247 getprotobynumber_r_proto='$getprotobynumber_r_proto'
23248 getprotoent_r_proto='$getprotoent_r_proto'
23249 getpwent_r_proto='$getpwent_r_proto'
23250 getpwnam_r_proto='$getpwnam_r_proto'
23251 getpwuid_r_proto='$getpwuid_r_proto'
23252 getservbyname_r_proto='$getservbyname_r_proto'
23253 getservbyport_r_proto='$getservbyport_r_proto'
23254 getservent_r_proto='$getservent_r_proto'
23255 getspnam_r_proto='$getspnam_r_proto'
23256 gidformat='$gidformat'
23262 gmtime_r_proto='$gmtime_r_proto'
23263 gnulibc_version='$gnulibc_version'
23265 groupcat='$groupcat'
23266 groupstype='$groupstype'
23269 h_sysfile='$h_sysfile'
23272 html1dir='$html1dir'
23273 html1direxp='$html1direxp'
23274 html3dir='$html3dir'
23275 html3direxp='$html3direxp'
23284 i_arpainet='$i_arpainet'
23285 i_assert='$i_assert'
23286 i_bsdioctl='$i_bsdioctl'
23290 i_dirent='$i_dirent'
23296 i_fp_class='$i_fp_class'
23298 i_gdbm_ndbm='$i_gdbm_ndbm'
23299 i_gdbmndbm='$i_gdbmndbm'
23301 i_ieeefp='$i_ieeefp'
23302 i_inttypes='$i_inttypes'
23303 i_langinfo='$i_langinfo'
23304 i_libutil='$i_libutil'
23305 i_limits='$i_limits'
23306 i_locale='$i_locale'
23307 i_machcthr='$i_machcthr'
23308 i_malloc='$i_malloc'
23309 i_mallocmalloc='$i_mallocmalloc'
23311 i_memory='$i_memory'
23312 i_mntent='$i_mntent'
23315 i_neterrno='$i_neterrno'
23316 i_netinettcp='$i_netinettcp'
23320 i_pthread='$i_pthread'
23322 i_rpcsvcdbm='$i_rpcsvcdbm'
23325 i_shadow='$i_shadow'
23327 i_stdarg='$i_stdarg'
23328 i_stdbool='$i_stdbool'
23329 i_stddef='$i_stddef'
23330 i_stdlib='$i_stdlib'
23331 i_string='$i_string'
23332 i_sunmath='$i_sunmath'
23333 i_sysaccess='$i_sysaccess'
23334 i_sysdir='$i_sysdir'
23335 i_sysfile='$i_sysfile'
23336 i_sysfilio='$i_sysfilio'
23338 i_sysioctl='$i_sysioctl'
23339 i_syslog='$i_syslog'
23340 i_sysmman='$i_sysmman'
23341 i_sysmode='$i_sysmode'
23342 i_sysmount='$i_sysmount'
23343 i_sysndir='$i_sysndir'
23344 i_sysparam='$i_sysparam'
23345 i_syspoll='$i_syspoll'
23346 i_sysresrc='$i_sysresrc'
23347 i_syssecrt='$i_syssecrt'
23348 i_sysselct='$i_sysselct'
23349 i_syssockio='$i_syssockio'
23350 i_sysstat='$i_sysstat'
23351 i_sysstatfs='$i_sysstatfs'
23352 i_sysstatvfs='$i_sysstatvfs'
23353 i_systime='$i_systime'
23354 i_systimek='$i_systimek'
23355 i_systimes='$i_systimes'
23356 i_systypes='$i_systypes'
23357 i_sysuio='$i_sysuio'
23359 i_sysutsname='$i_sysutsname'
23360 i_sysvfs='$i_sysvfs'
23361 i_syswait='$i_syswait'
23362 i_termio='$i_termio'
23363 i_termios='$i_termios'
23365 i_unistd='$i_unistd'
23368 i_values='$i_values'
23369 i_varargs='$i_varargs'
23370 i_varhdr='$i_varhdr'
23372 ignore_versioned_solibs='$ignore_versioned_solibs'
23373 inc_version_list='$inc_version_list'
23374 inc_version_list_init='$inc_version_list_init'
23377 initialinstalllocation='$initialinstalllocation'
23378 installarchlib='$installarchlib'
23379 installbin='$installbin'
23380 installhtml1dir='$installhtml1dir'
23381 installhtml3dir='$installhtml3dir'
23382 installman1dir='$installman1dir'
23383 installman3dir='$installman3dir'
23384 installprefix='$installprefix'
23385 installprefixexp='$installprefixexp'
23386 installprivlib='$installprivlib'
23387 installscript='$installscript'
23388 installsitearch='$installsitearch'
23389 installsitebin='$installsitebin'
23390 installsitehtml1dir='$installsitehtml1dir'
23391 installsitehtml3dir='$installsitehtml3dir'
23392 installsitelib='$installsitelib'
23393 installsiteman1dir='$installsiteman1dir'
23394 installsiteman3dir='$installsiteman3dir'
23395 installsitescript='$installsitescript'
23396 installstyle='$installstyle'
23397 installusrbinperl='$installusrbinperl'
23398 installvendorarch='$installvendorarch'
23399 installvendorbin='$installvendorbin'
23400 installvendorhtml1dir='$installvendorhtml1dir'
23401 installvendorhtml3dir='$installvendorhtml3dir'
23402 installvendorlib='$installvendorlib'
23403 installvendorman1dir='$installvendorman1dir'
23404 installvendorman3dir='$installvendorman3dir'
23405 installvendorscript='$installvendorscript'
23407 issymlink='$issymlink'
23408 ivdformat='$ivdformat'
23411 known_extensions='$known_extensions'
23414 lddlflags='$lddlflags'
23416 ldflags_uselargefiles='$ldflags_uselargefiles'
23417 ldlibpthname='$ldlibpthname'
23424 libsdirs='$libsdirs'
23425 libsfiles='$libsfiles'
23426 libsfound='$libsfound'
23427 libspath='$libspath'
23428 libswanted='$libswanted'
23429 libswanted_uselargefiles='$libswanted_uselargefiles'
23435 localtime_r_proto='$localtime_r_proto'
23436 locincpth='$locincpth'
23437 loclibpth='$loclibpth'
23438 longdblsize='$longdblsize'
23439 longlongsize='$longlongsize'
23440 longsize='$longsize'
23444 lseeksize='$lseeksize'
23445 lseektype='$lseektype'
23448 madlyobj='$madlyobj'
23449 madlysrc='$madlysrc'
23453 make_set_make='$make_set_make'
23454 mallocobj='$mallocobj'
23455 mallocsrc='$mallocsrc'
23456 malloctype='$malloctype'
23458 man1direxp='$man1direxp'
23461 man3direxp='$man3direxp'
23463 mips_type='$mips_type'
23464 mistrustnm='$mistrustnm'
23466 mmaptype='$mmaptype'
23467 modetype='$modetype'
23469 multiarch='$multiarch'
23471 myarchname='$myarchname'
23472 mydomain='$mydomain'
23473 myhostname='$myhostname'
23476 need_va_copy='$need_va_copy'
23477 netdb_hlen_type='$netdb_hlen_type'
23478 netdb_host_type='$netdb_host_type'
23479 netdb_name_type='$netdb_name_type'
23480 netdb_net_type='$netdb_net_type'
23483 nm_so_opt='$nm_so_opt'
23484 nonxs_ext='$nonxs_ext'
23486 nvEUformat='$nvEUformat'
23487 nvFUformat='$nvFUformat'
23488 nvGUformat='$nvGUformat'
23489 nv_overflows_integers_at='$nv_overflows_integers_at'
23490 nv_preserves_uv_bits='$nv_preserves_uv_bits'
23491 nveformat='$nveformat'
23492 nvfformat='$nvfformat'
23493 nvgformat='$nvgformat'
23496 o_nonblock='$o_nonblock'
23498 old_pthread_create_joinable='$old_pthread_create_joinable'
23499 optimize='$optimize'
23500 orderlib='$orderlib'
23503 otherlibdirs='$otherlibdirs'
23507 patchlevel='$patchlevel'
23508 path_sep='$path_sep'
23511 perl_patchlevel='$perl_patchlevel'
23512 perl_static_inline='$perl_static_inline'
23513 perladmin='$perladmin'
23514 perllibs='$perllibs'
23515 perlpath='$perlpath'
23517 phostname='$phostname'
23523 prefixexp='$prefixexp'
23525 privlibexp='$privlibexp'
23526 procselfexe='$procselfexe'
23527 prototype='$prototype'
23529 quadkind='$quadkind'
23530 quadtype='$quadtype'
23531 randbits='$randbits'
23532 randfunc='$randfunc'
23533 random_r_proto='$random_r_proto'
23534 randseedtype='$randseedtype'
23536 rd_nodata='$rd_nodata'
23537 readdir64_r_proto='$readdir64_r_proto'
23538 readdir_r_proto='$readdir_r_proto'
23539 revision='$revision'
23545 sGMTIME_max='$sGMTIME_max'
23546 sGMTIME_min='$sGMTIME_min'
23547 sLOCALTIME_max='$sLOCALTIME_max'
23548 sLOCALTIME_min='$sLOCALTIME_min'
23549 sPRIEUldbl='$sPRIEUldbl'
23550 sPRIFUldbl='$sPRIFUldbl'
23551 sPRIGUldbl='$sPRIGUldbl'
23552 sPRIXU64='$sPRIXU64'
23554 sPRIeldbl='$sPRIeldbl'
23555 sPRIfldbl='$sPRIfldbl'
23556 sPRIgldbl='$sPRIgldbl'
23561 sSCNfldbl='$sSCNfldbl'
23562 sched_yield='$sched_yield'
23563 scriptdir='$scriptdir'
23564 scriptdirexp='$scriptdirexp'
23566 seedfunc='$seedfunc'
23567 selectminbits='$selectminbits'
23568 selecttype='$selecttype'
23569 sendmail='$sendmail'
23570 setgrent_r_proto='$setgrent_r_proto'
23571 sethostent_r_proto='$sethostent_r_proto'
23572 setlocale_r_proto='$setlocale_r_proto'
23573 setnetent_r_proto='$setnetent_r_proto'
23574 setprotoent_r_proto='$setprotoent_r_proto'
23575 setpwent_r_proto='$setpwent_r_proto'
23576 setservent_r_proto='$setservent_r_proto'
23579 sharpbang='$sharpbang'
23580 shmattype='$shmattype'
23581 shortsize='$shortsize'
23584 sig_count='$sig_count'
23585 sig_name='$sig_name'
23586 sig_name_init='$sig_name_init'
23588 sig_num_init='$sig_num_init'
23589 sig_size='$sig_size'
23590 signal_t='$signal_t'
23591 sitearch='$sitearch'
23592 sitearchexp='$sitearchexp'
23594 sitebinexp='$sitebinexp'
23595 sitehtml1dir='$sitehtml1dir'
23596 sitehtml1direxp='$sitehtml1direxp'
23597 sitehtml3dir='$sitehtml3dir'
23598 sitehtml3direxp='$sitehtml3direxp'
23600 sitelib_stem='$sitelib_stem'
23601 sitelibexp='$sitelibexp'
23602 siteman1dir='$siteman1dir'
23603 siteman1direxp='$siteman1direxp'
23604 siteman3dir='$siteman3dir'
23605 siteman3direxp='$siteman3direxp'
23606 siteprefix='$siteprefix'
23607 siteprefixexp='$siteprefixexp'
23608 sitescript='$sitescript'
23609 sitescriptexp='$sitescriptexp'
23610 sizesize='$sizesize'
23611 sizetype='$sizetype'
23615 sockethdr='$sockethdr'
23616 socketlib='$socketlib'
23617 socksizetype='$socksizetype'
23619 spackage='$spackage'
23620 spitshell='$spitshell'
23621 srand48_r_proto='$srand48_r_proto'
23622 srandom_r_proto='$srandom_r_proto'
23624 ssizetype='$ssizetype'
23625 st_ino_sign='$st_ino_sign'
23626 st_ino_size='$st_ino_size'
23627 startperl='$startperl'
23629 static_ext='$static_ext'
23631 stdio_base='$stdio_base'
23632 stdio_bufsiz='$stdio_bufsiz'
23633 stdio_cnt='$stdio_cnt'
23634 stdio_filbuf='$stdio_filbuf'
23635 stdio_ptr='$stdio_ptr'
23636 stdio_stream_array='$stdio_stream_array'
23637 strerror_r_proto='$strerror_r_proto'
23640 subversion='$subversion'
23644 targetarch='$targetarch'
23648 timeincl='$timeincl'
23649 timetype='$timetype'
23650 tmpnam_r_proto='$tmpnam_r_proto'
23656 ttyname_r_proto='$ttyname_r_proto'
23665 uidformat='$uidformat'
23671 uquadtype='$uquadtype'
23672 use5005threads='$use5005threads'
23673 use64bitall='$use64bitall'
23674 use64bitint='$use64bitint'
23675 usecrosscompile='$usecrosscompile'
23676 usedevel='$usedevel'
23678 usedtrace='$usedtrace'
23679 usefaststdio='$usefaststdio'
23680 useithreads='$useithreads'
23681 usekernprocpathname='$usekernprocpathname'
23682 uselargefiles='$uselargefiles'
23683 uselongdouble='$uselongdouble'
23684 usemallocwrap='$usemallocwrap'
23685 usemorebits='$usemorebits'
23686 usemultiplicity='$usemultiplicity'
23687 usemymalloc='$usemymalloc'
23689 usensgetexecutablepath='$usensgetexecutablepath'
23690 useopcode='$useopcode'
23691 useperlio='$useperlio'
23692 useposix='$useposix'
23693 usereentrant='$usereentrant'
23694 userelocatableinc='$userelocatableinc'
23696 useshrplib='$useshrplib'
23697 usesitecustomize='$usesitecustomize'
23698 usesocks='$usesocks'
23699 usethreads='$usethreads'
23700 usevendorprefix='$usevendorprefix'
23701 usevfork='$usevfork'
23704 uvXUformat='$uvXUformat'
23705 uvoformat='$uvoformat'
23708 uvuformat='$uvuformat'
23709 uvxformat='$uvxformat'
23711 vendorarch='$vendorarch'
23712 vendorarchexp='$vendorarchexp'
23713 vendorbin='$vendorbin'
23714 vendorbinexp='$vendorbinexp'
23715 vendorhtml1dir='$vendorhtml1dir'
23716 vendorhtml1direxp='$vendorhtml1direxp'
23717 vendorhtml3dir='$vendorhtml3dir'
23718 vendorhtml3direxp='$vendorhtml3direxp'
23719 vendorlib='$vendorlib'
23720 vendorlib_stem='$vendorlib_stem'
23721 vendorlibexp='$vendorlibexp'
23722 vendorman1dir='$vendorman1dir'
23723 vendorman1direxp='$vendorman1direxp'
23724 vendorman3dir='$vendorman3dir'
23725 vendorman3direxp='$vendorman3direxp'
23726 vendorprefix='$vendorprefix'
23727 vendorprefixexp='$vendorprefixexp'
23728 vendorscript='$vendorscript'
23729 vendorscriptexp='$vendorscriptexp'
23731 version_patchlevel_string='$version_patchlevel_string'
23732 versiononly='$versiononly'
23734 voidflags='$voidflags'
23737 yaccflags='$yaccflags'
23742 : add special variables
23743 $test -f $src/patchlevel.h && \
23744 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
23745 echo "PERL_PATCHLEVEL='$perl_patchlevel'" >>config.sh
23746 echo "PERL_CONFIG_SH=true" >>config.sh
23748 : propagate old symbols
23749 if $test -f UU/config.sh; then
23750 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
23751 $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \
23752 config.sh config.sh UU/oldconfig.sh |\
23753 $sort | $uniq -u >UU/oldsyms
23754 set X `$cat UU/oldsyms`
23760 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
23762 echo ": Variables propagated from previous config.sh file." >>config.sh
23763 for sym in `$cat UU/oldsyms`; do
23764 echo " Propagating $hint variable "'$'"$sym..."
23765 eval 'tmp="$'"${sym}"'"'
23767 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
23773 : Finish up by extracting the .SH files
23777 echo "Extraction done."
23787 If you'd like to make any changes to the config.sh file before I begin
23788 to configure things, do it as a shell escape now (e.g. !vi config.sh).
23791 rp="Press return or use a shell escape to edit config.sh:"
23796 *) : in case they cannot read
23797 sh 1>&4 -c "$ans";;
23802 : if this fails, just run all the .SH files by hand
23811 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
23818 Now you need to generate make dependencies by running "$make depend".
23819 You might prefer to run it in background: "$make depend > makedepend.out &"
23820 It can take a while, so you might not want to run it right now.
23825 rp="Run $make depend now?"
23829 $make depend && echo "Now you must run '$make'."
23832 echo "You must run '$make depend' then '$make'."
23835 elif test -f [Mm]akefile; then
23837 echo "Now you must run a $make."
23839 echo "Configure done."
23842 if $test -f Policy.sh; then
23845 If you compile $package on a different machine or from a different object
23846 directory, copy the Policy.sh file from this object directory to the
23847 new one before you run Configure -- this will help you with most of
23848 the policy defaults.
23852 if $test -f config.msg; then
23853 echo "Hmm. I also noted the following information while running:"
23855 $cat config.msg >&4
23858 $rm -f kit*isdone ark*isdone