3 # If these # comments don't work, trim them. Don't worry about any other
4 # shell scripts, Configure will trim # comments from them for you.
6 # (If you are trying to port this package to a machine without sh,
7 # I would suggest you have a look at the prototypical config_h.SH file
8 # and edit it to reflect your system. Some packages may include samples
9 # of config.h for certain machines, so you might look for one of those.)
11 # Yes, you may rip this off to use in other distribution packages. This
12 # script belongs to the public domain and cannot be copyrighted.
14 # Note: this Configure script was generated automatically. Rather than
15 # working with this copy of Configure, you may wish to get metaconfig.
16 # The dist package (which contains metaconfig) is available via SVN:
17 # svn co https://svn.sourceforge.net/svnroot/dist/trunk/dist
19 # Though this script was generated by metaconfig from metaunits, it is
20 # OK to send patches against Configure itself. It's up to the Configure
21 # pumpkin to backport the patch to the metaunits if it is accepted.
22 # For more information on patching Configure, see pod/perlhack.pod
24 # The metaunits are also available from the public git repository:
25 # http://perl5.git.perl.org/metaconfig.git/ or
26 # $ git clone git://perl5.git.perl.org/metaconfig.git metaconfig
28 # See Porting/pumpkin.pod for more information on metaconfig.
31 # Generated on Sun Aug 26 14:33:39 CEST 2012 [metaconfig 3.5 PL0]
32 # (with additional metaconfig patches by perlbug@perl.org)
37 SCO csh still thinks true is false. Write to SCO today and tell them that next
38 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
40 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
41 we'd have to do is go in and swap the && and || tokens, wherever they are.)
43 [End of diatribe. We now return you to your regularly scheduled programming...]
47 OOPS! You naughty creature! You didn't run Configure with sh!
48 I will attempt to remedy the situation by running sh for you...
52 true || exec sh $0 $argv:q
54 (exit $?0) || cat c2$$
55 (exit $?0) || exec sh $0 $argv:q
58 if test -f /dev/cputype -a -f /dev/drivers -a -f /dev/osversion; then
61 *** I'm sorry but this system looks like Plan 9 and Plan 9 doesn't do
62 *** Configure that well. (Plan 9 is close to UNIX but not close enough.)
63 *** Please read the README.plan9 for further instructions.
64 *** Cannot continue, aborting.
70 if test ! -c /dev/null ; then
73 *** I'm sorry, but /dev/null appears to be a file rather than a device.
74 *** Please consult your operating sytem's notes for making a device
76 *** Cannot continue, aborting.
82 : compute my invocation name
86 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
91 : Proper separator for the PATH environment variable
93 : On OS/2 this directory should exist if this is not floppy only system ":-]"
94 if test -d c:/. || ( uname -a | grep -i 'os\(/\|\)2' ) 2>&1 >/dev/null ; then
95 if test -n "$OS2_SHELL"; then
97 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
98 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
100 elif test -n "$DJGPP"; then
101 case "X${MACHTYPE:-nonesuchmach}" in
108 : Proper PATH setting
109 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
110 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
111 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
112 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
113 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
114 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /opt/ansic/bin /usr/ccs/bin"
115 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
116 paths="$paths /sbin /usr/sbin /usr/libexec"
117 paths="$paths /system/gnu_library/bin"
121 case "$p_$PATH$p_" in
123 *) test -d $p && PATH=$PATH$p_$p ;;
130 : shall we be using ksh?
136 if (PATH=.; alias -x) >/dev/null 2>&1; then
139 if test -f /hp-ux -a -f /bin/ksh; then
140 needksh='to avoid sh bug in "here document" expansion'
142 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
143 if test X`/usr/bin/uname -v` = X4; then
144 avoidksh="to avoid AIX 4's /bin/sh"
148 if test -f /osf_boot -a -f /usr/sbin/setld; then
149 if test X`/usr/bin/uname -s` = XOSF1; then
150 avoidksh="to avoid Digital UNIX' ksh"
155 case "$inksh/$needksh" in
162 case "$inksh/$avoidksh" in
168 case "$inksh/$needksh-$avoidksh-" in
171 (I see you are using the Korn shell. Some ksh's blow up on $me,
172 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
179 echo "(Feeding myself to $newsh $reason.)"
181 Configure|*/Configure) exec $newsh $0 "$@";;
182 *) exec $newsh Configure "$@";;
186 test -x "${newsh}" || unset newsh
188 : if needed, set CDPATH to a harmless value that is not chatty
189 : avoid bash 2.02 problems with empty CDPATH.
193 *bash*) CDPATH='.' ;;
199 : Configure runs within the UU subdirectory
200 test -d UU || mkdir UU
340 initialinstalllocation=''
369 d_attribute_deprecated=''
370 d_attribute_format=''
371 d_attribute_malloc=''
372 d_attribute_nonnull=''
373 d_attribute_noreturn=''
375 d_attribute_unused=''
376 d_attribute_warn_unused_result=''
377 d_printf_format_null=''
380 d_builtin_choose_expr=''
383 d_c99_variadic_macros=''
430 endhostent_r_proto=''
436 endprotoent_r_proto=''
442 endservent_r_proto=''
495 gethostbyaddr_r_proto=''
497 gethostbyname_r_proto=''
499 gethostent_r_proto=''
512 getnetbyaddr_r_proto=''
514 getnetbyname_r_proto=''
528 d_getprotobyname_r=''
529 getprotobyname_r_proto=''
530 d_getprotobynumber_r=''
531 getprotobynumber_r_proto=''
533 getprotoent_r_proto=''
545 getservbyname_r_proto=''
547 getservbyport_r_proto=''
549 getservent_r_proto=''
576 d_libm_lib_version=''
579 d_localtime_r_needs_tzset=''
590 d_malloc_good_size=''
634 d_old_pthread_create_joinable=''
635 old_pthread_create_joinable=''
637 d_pthread_attr_setscope=''
676 sethostent_r_proto=''
693 setprotoent_r_proto=''
705 setservent_r_proto=''
729 d_ipv6_mreq_source=''
746 d_sprintf_returns_strlen=''
758 perl_static_inline=''
763 d_stdio_ptr_lval_nochange_cnt=''
764 d_stdio_ptr_lval_sets_cnt=''
909 d_gdbm_ndbm_h_uses_prototypes=''
910 d_gdbmndbm_h_uses_prototypes=''
912 d_ndbm_h_uses_prototypes=''
987 d_inc_version_list=''
989 inc_version_list_init=''
1008 ignore_versioned_solibs=''
1072 d_perl_otherlibdirs=''
1080 api_versionstring=''
1086 version_patchlevel_string=''
1090 d_nv_preserves_uv=''
1091 d_nv_zero_is_allbits_zero=''
1102 nv_overflows_integers_at=''
1103 nv_preserves_uv_bits=''
1175 installsitehtml1dir=''
1178 installsitehtml3dir=''
1185 installsiteman1dir=''
1188 installsiteman3dir=''
1193 installsitescript=''
1210 d_stdio_stream_array=''
1211 stdio_stream_array=''
1228 usekernprocpathname=''
1229 ccflags_uselargefiles=''
1230 ldflags_uselargefiles=''
1231 libswanted_uselargefiles=''
1240 usensgetexecutablepath=''
1253 installvendorarch=''
1260 installvendorhtml1dir=''
1262 vendorhtml1direxp=''
1263 installvendorhtml3dir=''
1265 vendorhtml3direxp=''
1271 installvendorman1dir=''
1274 installvendorman3dir=''
1281 installvendorscript=''
1294 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1297 : We must find out about Eunice early
1299 if test -f /etc/unixtovms; then
1300 eunicefix=/etc/unixtovms
1302 if test -f /etc/unixtovms.exe; then
1303 eunicefix=/etc/unixtovms.exe
1306 : Set executable suffix now -- needed before hints available
1307 if test -f "/libs/version.library"; then
1310 elif test -f "/system/gnu_library/bin/ar.pm"; then
1313 elif test -n "$DJGPP"; then
1316 elif test -d c:/. -o -n "$is_os2" ; then
1323 : Trailing extension. Override this in a hint file, if needed.
1324 : Extra object files, if any, needed on this platform.
1327 : Possible local include directories to search.
1328 : Set locincpth to "" in a hint file to defeat local include searches.
1329 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1330 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1332 : no include file wanted by default
1335 : Enable -DEBUGGING and -DDEBUGGING from the command line
1340 : change the next line if compiling for Xenix/286 on Xenix/386
1341 xlibpth='/usr/lib/386 /lib/386'
1342 : Possible local library directories to search.
1343 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1344 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1346 : general looking path for locating libraries
1347 glibpth="/lib /usr/lib $xlibpth"
1348 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1349 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1350 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1351 test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
1353 : Private path used by Configure to find libraries. Its value
1354 : is prepended to libpth. This variable takes care of special
1355 : machines, like the mips. Usually, it should be empty.
1358 : default library list
1360 : some systems want to use only the non-versioned libso:s
1361 ignore_versioned_solibs=''
1362 : set usethreads on the Configure command line to enable threads.
1363 usereentrant='undef'
1364 : full support for void wanted by default
1370 : set useposix=false in your hint file to disable the POSIX extension.
1372 : set useopcode=false in your hint file to disable the Opcode extension.
1375 ccflags_uselargefiles=''
1376 ldflags_uselargefiles=''
1377 libswanted_uselargefiles=''
1378 : set usemultiplicity on the Configure command line to enable multiplicity.
1379 : set usesocks on the Configure command line to enable socks.
1380 : List of libraries we want.
1381 : If anyone needs extra -lxxx, put those in a hint file.
1382 libswanted="sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun"
1383 libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
1384 : We probably want to search /usr/shlib before most other libraries.
1385 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1386 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1387 glibpth="/usr/shlib $glibpth"
1388 : Do not use vfork unless overridden by a hint file.
1391 : Find the basic shell for Bourne shell scripts
1395 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1398 if test -f "$xxx"; then
1401 : Build up a list and do a single loop so we can 'break' out.
1402 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1403 for xxx in sh bash ksh pdksh ash; do
1405 try="$try ${p}/${xxx}"
1409 if test -f "$xxx"; then
1412 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1415 elif test -f "$xxx.exe"; then
1426 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1428 Usually it's in /bin/sh. How did you even get this far?
1429 Please contact me (Perl Maintainers) at perlbug@perl.org and
1430 we'll try to straighten this all out.
1436 : see if sh knows # comments
1437 if `$sh -c '#' >/dev/null 2>&1`; then
1441 test -f $xcat$_exe || xcat=/usr/bin/cat
1442 if test ! -f $xcat$_exe; then
1443 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1444 if test -f $p/cat$_exe; then
1449 if test ! -f $xcat$_exe; then
1450 echo "Can't find cat anywhere!"
1454 echo "#!$xcat" >sharp
1457 ./sharp > today 2>/dev/null
1458 if test -s today; then
1461 echo "#! $xcat" > sharp
1464 ./sharp > today 2>/dev/null
1465 if test -s today; then
1473 echo "Your $sh doesn't grok # comments--I will strip them later on."
1476 echo "exec grep -v '^[ ]*#'" >spitshell
1478 $eunicefix spitshell
1479 spitshell=`pwd`/spitshell
1481 echo "I presume that if # doesn't work, #! won't work either!"
1486 : figure out how to guarantee sh startup
1488 '') startsh=${sharpbang}${sh} ;;
1500 : echo "Yup, it does."
1502 echo "Hmm... '$startsh' does not guarantee sh startup..."
1503 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1507 : Save command line options in file UU/cmdline.opt for later use in
1508 : generating config.sh.
1509 cat > cmdline.opt <<EOSH
1510 : Configure command line arguments.
1519 cat >>cmdline.opt <<EOSH
1520 config_arg$argn='$arg'
1522 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1525 arg_exp=`cat cmdl.opt`
1526 args_exp="$args_exp$args_sep'$arg_exp'"
1527 argn=`expr $argn + 1`
1532 : produce awk script to parse command line options
1533 cat >options.awk <<'EOF'
1535 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1537 len = length(optstr);
1538 for (i = 1; i <= len; i++) {
1539 c = substr(optstr, i, 1);
1540 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1551 if (substr(str, 1, 1) != "-") {
1552 printf("'%s'\n", str);
1556 for (i = 2; i <= len; i++) {
1557 c = substr(str, i, 1);
1559 printf("-%s\n", substr(str, i));
1565 printf("'%s'\n", substr(str, i + 1));
1578 : process the command line options
1579 set X `for arg in "$@"; do echo "X$arg"; done |
1580 sed -e s/X// | awk -f options.awk`
1585 : set up default values
1595 rm -f optdef.sh posthint.sh
1596 cat >optdef.sh <<EOS
1602 while test $# -gt 0; do
1604 -d) shift; fastread=yes;;
1605 -e) shift; alldone=cont;;
1609 if test -r "$1"; then
1612 echo "$me: cannot read config file $1." >&2
1618 -h) shift; error=true;;
1619 -r) shift; reuseval=true;;
1620 -s) shift; silent=true; realsilent=true;;
1621 -E) shift; alldone=exit;;
1622 -K) shift; knowitall=true;;
1623 -O) shift; override=true;;
1624 -S) shift; silent=true; extractsh=true;;
1629 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1630 echo "$me: ignoring -D $1" >&2
1633 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1634 *) echo "$1='define'" >> optdef.sh;;
1641 *=) echo "$1" >> optdef.sh;;
1643 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1644 echo "$me: ignoring -U $1" >&2
1646 *) echo "$1='undef'" >> optdef.sh;;
1657 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1661 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1662 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1668 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1669 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1670 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1671 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1672 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1673 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1679 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1681 echo "$yyy=''" >> posthint.sh ;;
1686 echo "$yyy='$zzz'" >> posthint.sh ;;
1688 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1690 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1695 echo "$yyy=$zzz" >> posthint.sh ;;
1696 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1700 -V) echo "$me generated by metaconfig 3.5 PL0." >&2
1703 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1711 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1712 [-U symbol] [-U symbol=] [-A command:symbol...]
1713 -d : use defaults for all answers.
1714 -e : go on without questioning past the production of config.sh.
1715 -f : specify an alternate default configuration file.
1716 -h : print this help message and exit (with an error status).
1717 -r : reuse C symbols value if possible (skips costly nm extraction).
1718 -s : silent mode, only echoes questions and essential information.
1719 -D : define symbol to have some value:
1720 -D symbol symbol gets the value 'define'
1721 -D symbol=value symbol gets the value 'value'
1722 common used examples (see INSTALL for more info):
1723 -Duse64bitint use 64bit integers
1724 -Duse64bitall use 64bit integers and pointers
1725 -Dusethreads use thread support
1726 -Dinc_version_list=none do not include older perl trees in @INC
1727 -DEBUGGING=none DEBUGGING options
1728 -Dcc=gcc choose your compiler
1729 -Dprefix=/opt/perl5 choose your destination
1730 -E : stop at the end of questions, after having produced config.sh.
1731 -K : do not use unless you know what you are doing.
1732 -O : let -D and -U override definitions from loaded configuration file.
1733 -S : perform variable substitutions on all .SH files (can mix with -f)
1734 -U : undefine symbol:
1735 -U symbol symbol gets the value 'undef'
1736 -U symbol= symbol gets completely empty
1738 -A : manipulate symbol after the platform specific hints have been applied:
1739 -A append:symbol=value append value to symbol
1740 -A symbol=value like append:, but with a separating space
1741 -A define:symbol=value define symbol to have value
1742 -A clear:symbol define symbol to be ''
1743 -A define:symbol define symbol to be 'define'
1744 -A eval:symbol=value define symbol to be eval of value
1745 -A prepend:symbol=value prepend value to symbol
1746 -A undef:symbol define symbol to be 'undef'
1747 -A undef:symbol= define symbol to be ''
1748 e.g.: -A prepend:libswanted='cl pthread '
1749 -A ccflags=-DSOME_MACRO
1750 -V : print version number and exit (with a zero status).
1757 case "$fastread$alldone" in
1760 case "$extractsh" in
1763 if test ! -t 0; then
1764 echo "Say 'sh Configure', not 'sh <Configure'"
1774 true) exec 1>/dev/null;;
1777 : run the defines and the undefines, if any, but leave the file out there...
1780 : create the posthint manipulation script and leave the file out there...
1785 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1786 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1787 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1788 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1789 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1792 : Some greps do not return status, grrr.
1793 echo "grimblepritz" >grimble
1794 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1796 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1802 : the following should work in any shell
1806 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1807 cat >contains <<'EOSS'
1808 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1813 : Find the path to the source tree
1816 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1820 *) src=`cd ../$src && pwd` ;;
1833 if test -f $rsrc/Configure && \
1834 $contains "^package='$package'\$" $rsrc/Configure >/dev/null 2>&1
1836 : found it, so we are ok.
1839 for src in . .. ../.. ../../.. ../../../..; do
1840 if test -f ../$src/Configure && \
1841 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1852 Sorry, I can't seem to locate the source dir for $package. Please start
1853 Configure with an explicit path -- i.e. /some/path/Configure.
1861 echo "Sources for $package found in \"$src\"." >&4
1865 : script used to extract .SH files with variable substitutions
1866 cat >extract <<'EOS'
1868 echo "Doing variable substitutions on .SH files..."
1869 if test -f MANIFEST; then
1870 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1872 echo "(Looking for .SH files under the source directory.)"
1873 set x `(cd "$src"; find . -name "*.SH" -print)`
1877 0) set x `(cd "$src"; echo *.SH)`; shift;;
1879 if test ! -f "$src/$1"; then
1885 while test $name; do
1886 if test ! -d "$name"; then
1887 create="$name $create";
1888 name=`echo $name | sed -e "s|^[^/]*$||"`;
1889 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1894 for file in $create; do
1903 dir=`expr X$file : 'X\(.*\)/'`
1904 file=`expr X$file : 'X.*/\(.*\)'`
1905 (cd "$dir" && . ./$file)
1915 dir=`expr X$file : 'X\(.*\)/'`
1916 file=`expr X$file : 'X.*/\(.*\)'`
1917 (set x $dir; shift; eval $mkdir_p)
1918 sh <"$src/$dir/$file"
1927 if test -f "$src/config_h.SH"; then
1928 if test ! -f config.h; then
1929 : oops, they left it out of MANIFEST, probably, so do it anyway.
1930 . "$src/config_h.SH"
1935 : extract files and exit if asked to do so
1936 case "$extractsh" in
1938 case "$realsilent" in
1942 case "$config_sh" in
1943 '') config_sh='config.sh';;
1946 echo "Fetching answers from $config_sh..."
1949 test "$override" && . ./optdef.sh
1953 echo "Extraction done."
1958 : Eunice requires " " instead of "", can you believe it
1961 echo "Beginning of configuration questions for $package."
1963 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1965 : first determine how to suppress newline on echo command
1967 echo "Checking echo to see how to suppress newlines..."
1968 (echo "hi there\c" ; echo " ") >.echotmp
1969 if $contains c .echotmp >/dev/null 2>&1 ; then
1980 echo $n "The star should be here-->$c"
1984 : Now test for existence of everything in MANIFEST
1986 if test -f "$rsrc/MANIFEST"; then
1987 echo "First let's make sure your kit is complete. Checking..." >&4
1988 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | \
1989 (split -l 50 2>/dev/null || split -50)
1992 for filelist in x??; do
1993 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` \
1994 >/dev/null 2>>"$tmppwd/missing")
1996 if test -s missing; then
2000 THIS PACKAGE SEEMS TO BE INCOMPLETE.
2002 You have the option of continuing the configuration process, despite the
2003 distinct possibility that your kit is damaged, by typing 'y'es. If you
2004 do, don't blame me if something goes wrong. I advise you to type 'n'o
2005 and contact the author (perlbug@perl.org).
2008 echo $n "Continue? [n] $c" >&4
2012 echo "Continuing..." >&4
2016 echo "ABORTING..." >&4
2021 echo "Looks good..."
2024 echo "There is no MANIFEST file. I hope your kit is complete !"
2028 : Find the appropriate value for a newline for tr
2030 if test -n "$DJGPP"; then
2033 if test X"$trnl" = X; then
2034 case "`echo foo|tr '\n' x 2>/dev/null`" in
2038 if test X"$trnl" = X; then
2039 case "`echo foo|tr '\012' x 2>/dev/null`" in
2040 foox) trnl='\012' ;;
2043 if test X"$trnl" = X; then
2044 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
2045 fooxy) trnl='\n\r' ;;
2048 if test X"$trnl" = X; then
2051 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
2057 : compute the number of columns on the terminal for proper question formatting
2062 : set up the echo used in my read
2063 myecho="case \"\$xxxm\" in
2064 '') echo $n \"\$rp $c\" >&4;;
2066 '') echo $n \"[\$xxxm] $c\";;
2068 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
2070 echo $n \"[\$xxxm] $c\" >&4
2072 echo $n \"\$rp [\$xxxm] $c\" >&4
2078 : now set up to do reads with possible shell escape and default assignment
2084 case "\$fastread" in
2085 yes) case "\$dflt" in
2088 case "\$silent-\$rp" in
2093 *) case "\$silent" in
2094 true) case "\$rp" in
2099 while expr "X\$ans" : "X!" >/dev/null; do
2103 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2111 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2120 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2125 echo "(OK, I'll run with -d after this question.)" >&4
2128 echo "*** Sorry, \$1 not supported yet." >&4
2138 echo "*** Substitution done -- please confirm."
2140 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2145 echo "*** Error -- try again."
2152 case "\$ans\$xxxm\$nostick" in
2164 : create .config dir to save info across Configure sessions
2165 test -d ../.config || mkdir ../.config
2166 cat >../.config/README <<EOF
2167 This directory created by Configure to save information that should
2168 persist across sessions for $package.
2170 You may safely delete it if you wish.
2173 : See if we are using a devel version and want that
2174 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2177 usedevel="$define" ;;
2178 *) case "$xversion" in
2181 *** WHOA THERE!!! ***
2183 This is an UNSTABLE DEVELOPMENT release.
2184 The version of this $package distribution is $xversion, that is, odd,
2185 (as opposed to even) and that signifies a development release.
2186 If you want a maintenance release, you want an even-numbered version.
2188 Do ***NOT*** install this into production use.
2189 Data corruption and crashes are possible.
2191 It is most seriously suggested that you do not continue any further
2192 unless you want to help in developing and debugging Perl.
2194 If you *still* want to build perl, you can answer 'y' now,
2195 or pass -Dusedevel to Configure.
2198 rp='Do you really want to continue?'
2202 [yY]) echo >&4 "Okay, continuing."
2203 usedevel="$define" ;;
2204 *) echo >&4 "Okay, bye."
2215 case "$versiononly" in
2216 '') versiononly="$define" ;;
2218 case "$installusrbinperl" in
2219 '') installusrbinperl="$undef" ;;
2224 : general instructions
2227 user=`(logname) 2>/dev/null`
2229 '') user=`whoami 2>&1`;;
2231 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2234 rp='Would you like to see the instructions?'
2245 This installation shell script will examine your system and ask you questions
2246 to determine how the perl5 package should be installed. If you get
2247 stuck on a question, you may use a ! shell escape to start a subshell or
2248 execute a command. Many of the questions will have default answers in square
2249 brackets; typing carriage return will give you the default.
2251 On some of the questions which ask for file or directory names you are allowed
2252 to use the ~name construct to specify the login directory belonging to "name",
2253 even if you don't have a shell which knows about that. Questions where this is
2254 allowed will be marked "(~name ok)".
2258 dflt='Type carriage return to continue'
2262 The prompter used in this script allows you to use shell variables and
2263 backticks in your answers. You may use $1, $2, etc... to refer to the words
2264 in the default answer, as if the default line was a set of arguments given to a
2265 script shell. This means you may also use $* to repeat the whole default line,
2266 so you do not have to re-type everything to add something to the default.
2268 Every time there is a substitution, you will have to confirm. If there is an
2269 error (e.g. an unmatched backtick), the default answer will remain unchanged
2270 and you will be prompted again.
2272 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2273 the questions and use the computed defaults (or the previous answers if there
2274 was already a config.sh file). Type 'Configure -h' for a list of options.
2275 You may also start interactively and then answer '& -d' at any prompt to turn
2276 on the non-interactive behaviour for the remainder of the execution.
2282 Much effort has been expended to ensure that this shell script will run on any
2283 Unix system. If despite that it blows up on yours, your best bet is to edit
2284 Configure and run it again. If you can't run Configure for some reason,
2285 you'll have to generate a config.sh file by hand. Whatever problems you
2286 have, let me (perlbug@perl.org) know how I blew it.
2288 This installation script affects things in two ways:
2290 1) it may do direct variable substitutions on some of the files included
2292 2) it builds a config.h file for inclusion in C programs. You may edit
2293 any of these files as the need arises after running this script.
2295 If you make a mistake on a question, there is no easy way to back up to it
2296 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2297 files. Configure will offer to let you do this before it runs the SH files.
2300 dflt='Type carriage return to continue'
2302 case "$firsttime" in
2303 true) echo $user >>../.config/instruct;;
2307 : find out where common programs are
2309 echo "Locating common programs..." >&4
2322 if test -d \$dir/\$thing; then
2328 for thisthing in \$dir/\$thing; do
2329 : just loop through to pick last item
2331 if test -f \$thisthing; then
2334 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2337 elif test -f \$dir/\$thing.exe; then
2338 if test -n "$DJGPP"; then
2339 echo \$dir/\$thing.exe
2340 elif test "$eunicefix" != ":"; then
2341 : on Eunice apparently
2394 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2395 pth="$pth /lib /usr/lib"
2396 for file in $loclist; do
2400 if test -f "$xxx"; then
2403 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2404 xxx=`./loc $file $file $pth`
2407 '') xxx=`./loc $file $file $pth`;;
2408 *) xxx=`./loc $xxx $xxx $pth`;;
2410 eval $file=$xxx$_exe
2414 echo $file is in $xxx.
2417 echo $file is in $xxx.
2420 echo "I don't know where '$file' is, and my life depends on it." >&4
2421 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2427 echo "Don't worry if any of the following aren't found..."
2429 for file in $trylist; do
2433 if test -f "$xxx"; then
2436 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2437 xxx=`./loc $file $file $pth`
2440 '') xxx=`./loc $file $file $pth`;;
2441 *) xxx=`./loc $xxx $xxx $pth`;;
2443 eval $file=$xxx$_exe
2447 echo $file is in $xxx.
2450 echo $file is in $xxx.
2453 echo "I don't see $file out there, $say."
2460 echo "Substituting grep for egrep."
2467 *) if $less -R </dev/null >/dev/null; then
2468 echo "Substituting less -R for less."
2476 echo "Substituting cp for ln."
2485 echo "I can't find make or gmake, and my life depends on it." >&4
2486 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2494 *) # We can't have osname yet.
2495 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2496 # Assume that gmake, if found, is definitely GNU make
2497 # and prefer it over the system make.
2498 echo "Substituting gmake for make."
2506 echo "Hopefully test is built into your sh."
2509 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2510 echo "Using the test built into your sh."
2518 echo "Hopefully echo is built into your sh."
2523 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2524 $echo $n "hi there$c" >foo1
2525 echo $n "hi there$c" >foo2
2526 if cmp foo1 foo2 >/dev/null 2>&1; then
2527 echo "They are compatible. In fact, they may be identical."
2534 They are not compatible! You are probably running ksh on a non-USG system.
2535 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2536 have echo built in and we may have to run some Bourne shell scripts. That
2537 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2540 $echo $n "The star should be here-->$c"
2547 # This question was auctioned at YAPC::Europe-2007 in Vienna
2548 # I never promised you could answer it. I only auctioned the question.
2550 The following message is sponsored by
2552 Dresden.pm<--The stars should be here.
2554 Dear Perl user, system administrator or package
2555 maintainer, the Perl community sends greetings to
2556 you. Do you (emblematical) greet back [Y/n]? n
2560 : Check what type of C compiler we use
2564 cat <<'EOSC' >>trygcc
2569 int main(int argc, char *argv[]) {
2573 if $cc -o try $ccflags $ldflags try.c; then
2576 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2582 # Skip this test because it gives a false match on output like:
2583 # ./trygcc: line 23: cc: command not found
2584 # case "`$cc -v -c try.c 2>&1`" in
2585 # *gcc*) trygcc=no ;;
2587 if $test X"$trygcc" = Xyes; then
2588 if gcc -o try -c try.c; then
2590 echo "You seem to have a working gcc, though." >&4
2591 # Switching compilers may undo the work of hints files.
2592 # The most common problem is -D_REENTRANT for threads.
2593 # This heuristic catches that case, but gets false positives
2594 # if -Dusethreads was not actually specified. Better to
2595 # bail out here with a useful message than fail
2596 # mysteriously later. Should we perhaps just try to
2597 # re-invoke Configure -Dcc=gcc config_args ?
2598 if $test -f usethreads.cbu; then
2601 *** However, any setting of the C compiler flags (e.g. for thread support)
2602 *** will be lost. It may be necessary for you to restart Configure and
2603 *** add -Dcc=gcc to your Configure command line.
2606 rp="Would you like to go ahead and try gcc anyway?"
2609 rp="Would you like to use it?"
2612 if $test -f myread; then
2615 if $test -f UU/myread; then
2618 echo "Cannot find myread, sorry. Aborting." >&2
2623 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2636 cat <<'EOSC' >>checkcc
2641 int main(int argc, char *argv[]) {
2645 if $cc -o try $ccflags $ldflags try.c; then
2648 if $test X"$despair" = Xyes; then
2649 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2652 You need to find a working C compiler.
2653 Either (purchase and) install the C compiler supplied by your OS vendor,
2654 or for a free C compiler try http://gcc.gnu.org/
2655 I cannot continue any further, aborting.
2664 : determine whether symbolic links are supported
2667 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2668 echo "Symbolic links are supported." >&4
2671 echo "Symbolic links are NOT supported." >&4
2676 : determine whether symbolic links are supported
2680 echo "Checking how to test for symbolic links..." >&4
2682 if $test "X$issymlink" = X; then
2684 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2685 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2687 if test $? = 0; then
2690 echo "Your builtin 'test -h' may be broken." >&4
2693 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2696 if test -f "$p/$test"; then
2705 echo "Trying external '$test -h'." >&4
2706 issymlink="$test -h"
2707 if $test ! -h sym >/dev/null 2>&1; then
2708 echo "External '$test -h' is broken, too." >&4
2716 if $test "X$issymlink" = X; then
2717 if $test -L sym 2>/dev/null; then
2718 issymlink="$test -L"
2719 echo "The builtin '$test -L' worked." >&4
2722 if $test "X$issymlink" != X; then
2723 echo "You can test for symbolic links with '$issymlink'." >&4
2725 echo "I do not know how you can test for symbolic links." >&4
2729 *) echo "No symbolic links, so not testing for their testing..." >&4
2734 : Make symlinks util
2735 case "$mksymlinks" in
2738 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2741 *) case "$lns:$issymlink" in
2742 *"ln"*" -s:"*"test -"?)
2743 echo "Creating the symbolic links..." >&4
2744 echo "(First creating the subdirectories...)" >&4
2746 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2748 test -z "$directory" && break
2752 if test ! -d t/base; then
2753 echo "Failed to create the subdirectories. Aborting." >&4
2756 echo "(Then creating the symlinks...)" >&4
2757 awk '{print $1}' $src/MANIFEST | while true; do
2759 test -z "$filename" && break
2760 if test -f $filename; then
2761 if $issymlink $filename; then
2765 if test -f $filename; then
2766 echo "$filename already exists, not symlinking."
2768 ln -s $src/$filename $filename
2772 if test ! -f t/base/lex.t; then
2773 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2778 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2786 : Check for Cross-Compilation
2787 case "$usecrosscompile" in
2789 $echo "Cross-compiling..."
2792 *-*-gcc) # A cross-compiling gcc, probably.
2793 targetarch=`$echo $cc|$sed 's/-gcc$//'`
2795 # leave out ld, choosing it is more complex
2797 ranlib=$targetarch-ranlib
2798 $echo 'extern int foo;' > try.c
2799 set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
2801 if $test $# -gt 0; then
2803 incpth="`$echo $incpth|$sed 's/^ //'`"
2804 echo "Guessing incpth '$incpth'." >&4
2806 j="`$echo $i|$sed 's,/include$,/lib,'`"
2807 if $test -d $j; then
2811 libpth="`$echo $libpth|$sed 's/^ //'`"
2812 echo "Guessing libpth '$libpth'." >&4
2817 case "$targetarch" in
2818 '') echo "Targetarch not defined." >&4; croak=y ;;
2819 *) echo "Using targetarch $targetarch." >&4 ;;
2822 '') echo "Incpth not defined." >&4; croak=y ;;
2823 *) echo "Using incpth '$incpth'." >&4 ;;
2826 '') echo "Libpth not defined." >&4; croak=y ;;
2827 *) echo "Using libpth '$libpth'." >&4 ;;
2830 '') for i in $incpth; do
2831 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2833 echo "Guessing usrinc $usrinc." >&4
2838 '') echo "Usrinc not defined." >&4; croak=y ;;
2841 *) echo "Using usrinc $usrinc." >&4 ;;
2843 case "$targethost" in
2844 '') echo "Targethost not defined." >&4; croak=y ;;
2845 *) echo "Using targethost $targethost." >&4
2850 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2853 /*) run=$src/Cross/run
2854 targetmkdir=$src/Cross/mkdir
2856 from=$src/Cross/from
2858 *) pwd=`$test -f ../Configure & cd ..; pwd`
2860 targetmkdir=$pwd/Cross/mkdir
2862 from=$pwd/Cross/from
2865 case "$targetrun" in
2866 '') targetrun=ssh ;;
2871 case "$targetfrom" in
2872 '') targetfrom=scp ;;
2876 from=$from-$targetfrom
2877 case "$targetdir" in
2879 echo "Guessing targetdir $targetdir." >&4
2882 case "$targetuser" in
2884 echo "Guessing targetuser $targetuser." >&4
2887 case "$targetfrom" in
2891 case "$targetrun" in
2903 '') cwd=$targetdir ;;
2907 if $test ! -f \$exe.xok; then
2911 $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2914 *) echo "Unknown targetrun '$targetrun'" >&4
2918 case "$targetmkdir" in
2920 cat >$targetmkdir <<EOF
2922 $targetrun -l $targetuser $targethost "mkdir -p \$@"
2924 $chmod a+rx $targetmkdir
2926 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2938 $targetmkdir \`dirname \$f\`
2939 $targetto $q \$f $targetuser@$targethost:\$f || exit 1
2942 $targetmkdir $targetdir/\`dirname \$f\`
2943 $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2956 $mkdir -p $targetdir/\`dirname \$f\`
2957 $cp \$f $targetdir/\$f || exit 1
2960 $targetmkdir $targetdir/\`dirname \$f\`
2961 $cp \$f $targetdir/\$f || exit 1
2968 *) echo "Unknown targetto '$targetto'" >&4
2972 case "$targetfrom" in
2979 $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2984 cp) cat >$from <<EOF
2989 cp $targetdir/\$f . || exit 1
2994 *) echo "Unknown targetfrom '$targetfrom'" >&4
2998 if $test ! -f $run; then
2999 echo "Target 'run' script '$run' not found." >&4
3003 if $test ! -f $to; then
3004 echo "Target 'to' script '$to' not found." >&4
3008 if $test ! -f $from; then
3009 echo "Target 'from' script '$from' not found." >&4
3013 if $test ! -f $run -o ! -f $to -o ! -f $from; then
3017 Using '$run' for remote execution,
3018 and '$from' and '$to'
3019 for remote file transfer.
3025 usecrosscompile='undef'
3030 : see whether [:lower:] and [:upper:] are supported character classes
3032 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
3034 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
3038 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
3039 # (0xd9 and 0xe2), therefore that is a nice testing point.
3040 if test "X$up" = X -o "X$low" = X; then
3041 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
3047 if test "X$up" = X -o "X$low" = X; then
3048 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
3054 if test "X$up" = X -o "X$low" = X; then
3055 case "`echo RS | od -x 2>/dev/null`" in
3057 echo "Hey, this might be EBCDIC." >&4
3058 if test "X$up" = X -o "X$low" = X; then
3059 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
3060 rs) up='[A-IJ-RS-Z]'
3065 if test "X$up" = X -o "X$low" = X; then
3066 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
3076 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
3078 echo "Using $up and $low to convert case." >&4
3081 echo "I don't know how to translate letters from upper to lower case." >&4
3082 echo "Your tr is not acting any way I know of." >&4
3086 : set up the translation script tr, must be called with ./tr of course
3090 '[A-Z][a-z]') exec $tr '$up' '$low';;
3091 '[a-z][A-Z]') exec $tr '$low' '$up';;
3098 : Try to determine whether config.sh was made on this system
3099 case "$config_sh" in
3101 myuname=`$uname -a 2>/dev/null`
3102 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
3103 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
3104 # because the A-Z/a-z are not consecutive.
3105 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e "s,['/],,g" | \
3106 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
3107 newmyuname="$myuname"
3109 case "$knowitall" in
3111 if test -f ../config.sh; then
3112 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3113 eval "`grep myuname= ../config.sh`"
3115 if test "X$myuname" = "X$newmyuname"; then
3123 : Get old answers from old config file if Configure was run on the
3124 : same system, otherwise use the hints.
3127 if test -f config.sh; then
3129 rp="I see a config.sh file. Shall I use it to set the defaults?"
3132 n*|N*) echo "OK, I'll ignore it."
3133 mv config.sh config.sh.old
3134 myuname="$newmyuname"
3136 *) echo "Fetching default answers from your old config.sh file..." >&4
3144 : Older versions did not always set $sh. Catch re-use of such
3154 if test ! -f config.sh; then
3157 First time through, eh? I have some defaults handy for some systems
3158 that need some extra help getting the Configure answers right:
3161 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3163 : Half the following guesses are probably wrong... If you have better
3164 : tests or hints, please send them to perlbug@perl.org
3165 : The metaconfig authors would also appreciate a copy...
3166 $test -f /irix && osname=irix
3167 $test -f /xenix && osname=sco_xenix
3168 $test -f /dynix && osname=dynix
3169 $test -f /dnix && osname=dnix
3170 $test -f /lynx.os && osname=lynxos
3171 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3172 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3173 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3174 $test -f /bin/mips && /bin/mips && osname=mips
3175 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
3176 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
3177 $test -d /usr/apollo/bin && osname=apollo
3178 $test -f /etc/saf/_sactab && osname=svr4
3179 $test -d /usr/include/minix && osname=minix
3180 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3181 if $test -d /MachTen -o -d /MachTen_Folder; then
3183 if $test -x /sbin/version; then
3184 osvers=`/sbin/version | $awk '{print $2}' |
3185 $sed -e 's/[A-Za-z]$//'`
3186 elif $test -x /usr/etc/version; then
3187 osvers=`/usr/etc/version | $awk '{print $2}' |
3188 $sed -e 's/[A-Za-z]$//'`
3194 $test -f /sys/posix.dll &&
3195 $test -f /usr/bin/what &&
3196 set X `/usr/bin/what /sys/posix.dll` &&
3197 $test "$3" = UWIN &&
3201 if $test -f $uname; then
3209 umips) osname=umips ;;
3212 [23]100) osname=mips ;;
3213 next*) osname=next ;;
3215 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3216 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3219 elif $test -f /etc/kconfig; then
3221 if test "$lns" = "$ln -s"; then
3223 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3225 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3232 if test -n "$DJGPP"; then
3241 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3243 # oslevel can fail with:
3244 # oslevel: Unable to acquire lock.
3245 *not\ found) osvers="$4"."$3" ;;
3246 '<3240'|'<>3240') osvers=3.2.0 ;;
3247 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3248 '=3250'|'>3250') osvers=3.2.5 ;;
3252 bsd386) osname=bsd386
3255 cygwin*) osname=cygwin
3258 *dc.osx) osname=dcosx
3264 domainos) osname=apollo
3270 dragonfly) osname=dragonfly
3273 dynixptx*) osname=dynixptx
3274 osvers=`echo "$4"|sed 's/^v//'`
3276 freebsd) osname=freebsd
3278 genix) osname=genix ;;
3282 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3298 netbsd*) osname=netbsd
3301 news-os) osvers="$3"
3303 4*) osname=newsos4 ;;
3307 next*) osname=next ;;
3308 nonstop-ux) osname=nonstopux ;;
3309 openbsd) osname=openbsd
3315 POSIX-BC | posix-bc ) osname=posix-bc
3318 powerux | power_ux | powermax_os | powermaxos | \
3319 powerunix | power_unix) osname=powerux
3325 solaris) osname=solaris
3327 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3334 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3338 titanos) osname=titanos
3347 ultrix) osname=ultrix
3350 osf1|mls+) case "$5" in
3353 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3356 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3359 hp*) osname=hp_osf1 ;;
3360 mips) osname=mips_osf1 ;;
3363 # UnixWare 7.1.2 is known as Open UNIX 8
3364 openunix|unixware) osname=svr5
3372 $2) case "$osname" in
3376 : svr4.x or possibly later
3386 if test -f /stand/boot ; then
3387 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3388 if test -n "$INITPROG" -a -f "$INITPROG"; then
3389 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3390 if test -n "$isesix"; then
3398 *) if test -f /etc/systemid; then
3400 set `echo $3 | $sed 's/\./ /g'` $4
3401 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3403 elif $test -f $src/hints/sco_$1_$2.sh; then
3405 elif $test -f $src/hints/sco_$1.sh; then
3410 '') : Still unknown. Probably a generic Sys V.
3419 *) case "$osname" in
3420 '') : Still unknown. Probably a generic BSD.
3428 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3429 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3430 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3433 $rm -f UU/kernel.what
3434 elif test -d c:/. -o -n "$is_os2" ; then
3441 case "$targetarch" in
3444 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3449 : Now look for a hint file osname_osvers, unless one has been
3450 : specified already.
3453 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3454 : Also try without trailing minor version numbers.
3455 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3456 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3457 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3458 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3461 *) case "$osvers" in
3464 *) if $test -f $src/hints/$file.sh ; then
3466 elif $test -f $src/hints/$xfile.sh ; then
3468 elif $test -f $src/hints/$xxfile.sh ; then
3470 elif $test -f $src/hints/$xxxfile.sh ; then
3472 elif $test -f $src/hints/$xxxxfile.sh ; then
3474 elif $test -f "$src/hints/${osname}.sh" ; then
3483 if $test -f Policy.sh ; then
3486 none) dflt="Policy" ;;
3487 *) dflt="Policy $dflt" ;;
3492 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3496 if $test -f Policy.sh ; then
3499 There's also a Policy hint file available, which should make the
3500 site-specific (policy) questions easier to answer.
3507 You may give one or more space-separated answers, or "none" if appropriate.
3508 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3509 previous run of Configure, you may specify it as well as or instead of
3510 OS-specific hints. If hints are provided for your OS, you should use them:
3511 although Perl can probably be built without hints on many platforms, using
3512 hints often improve performance and may enable features that Configure can't
3513 set up on its own. If there are no hints that match your OS, specify "none";
3514 DO NOT give a wrong version or a wrong OS.
3518 rp="Which of these apply, if any?"
3521 for file in $tans; do
3522 if $test X$file = XPolicy -a -f Policy.sh; then
3524 $cat Policy.sh >> UU/config.sh
3525 elif $test -f $src/hints/$file.sh; then
3526 . $src/hints/$file.sh
3527 $cat $src/hints/$file.sh >> UU/config.sh
3528 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3531 : Give one chance to correct a possible typo.
3532 echo "$file.sh does not exist"
3534 rp="hint to use instead?"
3536 for file in $ans; do
3537 if $test -f "$src/hints/$file.sh"; then
3538 . $src/hints/$file.sh
3539 $cat $src/hints/$file.sh >> UU/config.sh
3540 elif $test X$ans = X -o X$ans = Xnone ; then
3543 echo "$file.sh does not exist -- ignored."
3550 : Remember our hint file for later.
3551 if $test -f "$src/hints/$file.sh" ; then
3561 echo "Fetching default answers from $config_sh..." >&4
3565 cp $config_sh config.sh 2>/dev/null
3575 test "$override" && . ./optdef.sh
3577 : Restore computed paths
3578 for file in $loclist $trylist; do
3579 eval $file="\$_$file"
3584 Configure uses the operating system name and version to set some defaults.
3585 The default value is probably right if the name rings a bell. Otherwise,
3586 since spelling matters for me, either accept the default or answer "none"
3593 ''|' '|none) dflt=none ;;
3594 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3597 *) dflt="$osname" ;;
3599 rp="Operating system name?"
3603 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3609 ''|' '|none) dflt=none ;;
3610 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3611 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3613 ''|' ') dflt=none ;;
3618 *) dflt="$osvers" ;;
3620 rp="Operating system version?"
3630 : who configured the system
3631 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3634 cf_by=`(logname) 2>/dev/null`
3637 cf_by=`(whoami) 2>/dev/null`
3639 "") cf_by=unknown ;;
3644 : decide how portable to be. Allow command line overrides.
3645 case "$d_portable" in
3647 *) d_portable="$define" ;;
3650 : set up shell script to do ~ expansion
3656 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3659 if $test -f /bin/csh; then
3660 /bin/csh -f -c "glob \$1"
3665 name=\`$expr x\$1 : '..\([^/]*\)'\`
3666 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3667 if $test ! -d "\$dir"; then
3669 echo "\$me: can't locate home directory for: \$name" >&2
3674 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3690 : now set up to get a file name
3694 cat <<'EOSC' >>getfile
3710 : getfile will accept an answer from the comma-separated list
3711 : enclosed in parentheses even if it does not meet other criteria.
3712 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3713 fn=`echo $fn | sed 's/(.*)//'`
3719 loc_file=`expr $fn : '.*:\(.*\)'`
3720 fn=`expr $fn : '\(.*\):.*'`
3728 */*) fullpath=true;;
3737 *e*) exp_file=true;;
3740 *p*) nopath_ok=true;;
3745 *d*) type='Directory';;
3746 *l*) type='Locate';;
3751 Locate) what='File';;
3756 case "$d_portable" in
3764 while test "$type"; do
3769 true) rp="$rp (~name ok)";;
3772 if test -f UU/getfile.ok && \
3773 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3792 value=`UU/filexp $ans`
3795 if test "$ans" != "$value"; then
3796 echo "(That expands to $value on this system.)"
3810 /*) value="$ansexp" ;;
3811 [a-zA-Z]:/*) value="$ansexp" ;;
3816 echo "I shall only accept a full path name, as in /bin/ls." >&4
3817 echo "Use a ! shell escape if you wish to check pathnames." >&4
3820 echo "Please give a full path name, starting with slash." >&4
3823 echo "Note that using ~name is ok provided it expands well." >&4
3836 for fp in $gfpth; do
3837 if test "X$fp" = X.; then
3842 if test -f "$pf"; then
3844 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3846 echo "($value is not a plain file, but that's ok.)"
3849 if test X"$type" = X; then
3856 for fp in $gfpth; do
3857 if test "X$fp" = X.; then
3862 direxp="$fp/$ansexp"
3864 if test -d "$direxp"; then
3872 if test -d "$ansexp"; then
3873 echo "(Looking for $loc_file in directory $value.)"
3874 value="$value/$loc_file"
3875 ansexp="$ansexp/$loc_file"
3877 if test -f "$ansexp"; then
3880 case "$nopath_ok" in
3881 true) case "$value" in
3883 *) echo "Assuming $value will be in people's path."
3899 if test "$fastread" = yes; then
3904 rp="$what $value doesn't exist. Use that name anyway?"
3923 test "X$gfpthkeep" != Xy && gfpth=""
3926 : determine root of directory hierarchy where package will be installed.
3929 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
3932 dflt=`echo "$prefix" | sed 's/.$//'`
3940 By default, $package will be installed in $dflt/bin, manual pages
3941 under $dflt/man, etc..., i.e. with $dflt as prefix for all
3942 installation directories. Typically this is something like /usr/local.
3943 If you wish to have binaries under /usr/bin but other parts of the
3944 installation under /usr/local, that's ok: you will be prompted
3945 separately for each of the installation directories, the prefix being
3946 only used to set the defaults.
3950 rp='Installation prefix to use?'
3958 *) oldprefix="$prefix";;
3965 : allow them to override the AFS root
3968 *) afsroot=$afsroot ;;
3974 $define|true) afs=true ;;
3975 $undef|false) afs=false ;;
3976 *) if $test -d $afsroot; then
3984 echo "AFS may be running... I'll be extra cautious then..." >&4
3986 echo "AFS does not seem to be running..." >&4
3989 : determine installation prefix for where package is to be installed.
3993 Since you are running AFS, I need to distinguish the directory in which
3994 files will reside from the directory in which they are installed (and from
3995 which they are presumably copied to the former directory by occult means).
3998 case "$installprefix" in
3999 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
4000 *) dflt="$installprefix";;
4005 In some special cases, particularly when building $package for distribution,
4006 it is convenient to distinguish the directory in which files should be
4007 installed from the directory ($prefix) in which they will
4008 eventually reside. For most users, these two directories are the same.
4011 case "$installprefix" in
4013 *) dflt=$installprefix;;
4017 rp='What installation prefix should I use for installing files?'
4019 installprefix="$ans"
4020 installprefixexp="$ansexp"
4022 : Perform the prefixexp/installprefixexp correction if necessary
4023 cat <<EOS >installprefix
4026 cat <<'EOSC' >>installprefix
4027 : Change installation prefix, if necessary.
4028 if $test X"$prefix" != X"$installprefix"; then
4029 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
4031 eval "install${prefixvar}=\"\$${prefixvar}exp\""
4034 chmod +x installprefix
4035 $eunicefix installprefix
4037 : Set variables such as privlib and privlibexp from the output of ./getfile
4038 : performing the prefixexp/installprefixexp correction if necessary.
4039 cat <<EOS >setprefixvar
4042 cat <<'EOSC' >>setprefixvar
4043 eval "${prefixvar}=\"\$ans\""
4044 eval "${prefixvar}exp=\"\$ansexp\""
4047 chmod +x setprefixvar
4048 $eunicefix setprefixvar
4050 : set up the script used to warn in case of inconsistency
4059 '') echo "The $hint value for \$$var on this machine was \"$was\"!" >&4
4061 *) echo "Hmm. Based on the hints in hints/$hintfile.sh, " >&4
4062 echo "the $hint value for \$$var on this machine was \"$was\"!" >&4
4067 echo "*** WHOA THERE!!! ***" >&4
4068 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
4071 rp=" Keep the $hint value?"
4074 y) td=$was; tu=$was;;
4078 : function used to set '$1' to '$val'
4079 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
4081 $define$undef) . ./whoa; eval "$var=\$td";;
4082 $undef$define) . ./whoa; eval "$var=\$tu";;
4083 *) eval "$var=$val";;
4086 : get the patchlevel
4088 echo "Getting the current patchlevel..." >&4
4089 if $test -r $rsrc/patchlevel.h;then
4090 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
4091 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4092 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4093 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4094 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4095 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4096 perl_patchlevel=`egrep ',"(MAINT|SMOKE)[0-9][0-9]*"' $rsrc/patchlevel.h|tail -1|sed 's/[^0-9]//g'`
4105 $echo "(You do not have patchlevel.h. Eek.)"
4107 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
4108 version_patchlevel_string="version $patchlevel subversion $subversion"
4109 case "$perl_patchlevel" in
4111 *) perl_patchlevel=`echo $perl_patchlevel | sed 's/.* //'`
4112 version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel"
4116 $echo "(You have $package $version_patchlevel_string.)"
4120 : XXX Should be a Configure test for double-dots in filenames.
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 version=`echo $revision $patchlevel $subversion | \
4128 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4129 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4130 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4133 : Special case the 5.005_xx maintenance series, which used 5.005
4134 : without any subversion label as a subdirectory in $sitelib
4135 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4136 api_versionstring='5.005'
4139 : Do we want threads support and if so, what type
4140 case "$usethreads" in
4141 $define|true|[yY]*) dflt='y';;
4142 *) # Catch case where user specified ithreads or 5005threads but
4143 # forgot -Dusethreads (A.D. 4/2002)
4144 case "$useithreads$use5005threads" in
4145 *$define*) dflt='y';;
4152 Perl can be built to take advantage of threads on some systems.
4153 To do so, Configure can be run with -Dusethreads.
4155 Note that Perl built with threading support runs slightly slower
4156 and uses more memory than plain Perl. The current implementation
4157 is believed to be stable, but it is fairly new, and so should be
4158 treated with caution.
4160 If this doesn't make any sense to you, just accept the default '$dflt'.
4162 rp='Build a threading Perl?'
4165 y|Y) val="$define" ;;
4171 if $test $patchlevel -lt 9; then
4172 case "$usethreads" in
4176 Since release 5.6, Perl has had two different threading implementations,
4177 the newer interpreter-based version (ithreads) with one interpreter per
4178 thread, and the older 5.005 version (5005threads).
4179 The 5005threads version is effectively unmaintained and will probably be
4180 removed in Perl 5.10, so there should be no need to build a Perl using it
4181 unless needed for backwards compatibility with some existing 5.005threads
4185 : Default to ithreads unless overridden on command line or with
4188 case "$use5005threads" in
4189 $define|true|[yY]*) dflt='n';;
4191 case "$useithreads" in
4192 $undef|false|[nN]*) dflt='n';;
4194 rp='Use the newer interpreter-based ithreads?'
4197 y|Y) val="$define" ;;
4202 : Now set use5005threads to the opposite value.
4203 case "$useithreads" in
4204 $define) val="$undef" ;;
4211 useithreads="$undef"
4212 use5005threads="$undef"
4216 case "$useithreads$use5005threads" in
4220 You cannot have both the ithreads and the 5.005 threads enabled
4221 at the same time. Disabling the 5.005 threads since they are
4222 much less stable than the ithreads.
4225 use5005threads="$undef"
4230 : perl-5.9.x and later
4232 if test X"$usethreads" = "X$define"; then
4233 case "$use5005threads" in
4237 5.005 threads has been removed for 5.10. Perl will be built using ithreads.
4244 use5005threads="$undef"
4245 useithreads="$usethreads"
4248 case "$d_oldpthreads" in
4249 '') : Configure tests would be welcome here. For now, assume undef.
4251 *) val="$d_oldpthreads" ;;
4257 : Look for a hint-file generated 'call-back-unit'. If the
4258 : user has specified that a threading perl is to be built,
4259 : we may need to set or change some other defaults.
4260 if $test -f usethreads.cbu; then
4261 echo "Your platform has some specific hints regarding threaded builds, using them..."
4264 case "$usethreads" in
4265 "$define"|true|[yY]*)
4267 (Your platform does not have any specific hints for threaded builds.
4268 Assuming POSIX threads, then.)
4274 : Check if multiplicity is required
4277 Perl can be built so that multiple Perl interpreters can coexist
4278 within the same Perl executable.
4281 case "$useithreads" in
4284 This multiple interpreter support is required for interpreter-based threads.
4288 *) case "$usemultiplicity" in
4289 $define|true|[yY]*) dflt='y';;
4293 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4294 rp='Build Perl for multiplicity?'
4297 y|Y) val="$define" ;;
4305 : Check if morebits is requested
4306 case "$usemorebits" in
4307 "$define"|true|[yY]*)
4308 use64bitint="$define"
4309 uselongdouble="$define"
4310 usemorebits="$define"
4312 *) usemorebits="$undef"
4316 : Determine the C compiler to be used
4322 rp="Use which C compiler?"
4326 : See whether they have no cc but they do have gcc
4328 if $test -f cc.cbu; then
4333 : make some quick guesses about what we are up against
4335 $echo $n "Hmm... $c"
4345 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
4346 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
4348 echo "Looks kind of like an OSF/1 system, but we'll see..."
4350 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4351 xxx=`./loc addbib blurfl $pth`
4352 if $test -f $xxx; then
4353 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4357 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4358 echo "Looks kind of like an extended USG system, but we'll see..."
4360 echo "Looks kind of like a USG system, but we'll see..."
4364 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4365 echo "Looks kind of like a BSD system, but we'll see..."
4369 echo "Looks kind of like a Version 7 system, but we'll see..."
4372 case "$eunicefix" in
4375 There is, however, a strange, musty smell in the air that reminds me of
4376 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4380 : it so happens the Eunice I know will not run shell scripts in Unix format
4384 echo "Congratulations. You aren't running Eunice."
4388 : Detect OS2. The p_ variable is set above in the Head.U unit.
4389 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4390 : semicolon as a patch separator
4395 I have the feeling something is not exactly right, however...don't tell me...
4396 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4397 (Or you may be running DOS with DJGPP.)
4402 if test -f /xenix; then
4403 echo "Actually, this looks more like a XENIX system..."
4408 echo "It's not Xenix..."
4413 if test -f /venix; then
4414 echo "Actually, this looks more like a VENIX system..."
4421 echo "Nor is it Venix..."
4424 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4425 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4428 : Check if we are using GNU gcc and what its version is
4430 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4434 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4436 printf("%s\n", __VERSION__);
4438 printf("%s\n", "1");
4444 if $cc -o try $ccflags $ldflags try.c; then
4445 gccversion=`$run ./try`
4446 case "$gccversion" in
4447 '') echo "You are not using GNU cc." ;;
4448 *) echo "You are using GNU cc $gccversion."
4454 echo "*** WHOA THERE!!! ***" >&4
4455 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4456 case "$knowitall" in
4458 echo " You'd better start hunting for one and let me know about it." >&4
4464 case "$gccversion" in
4465 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4467 case "$gccversion" in
4468 '') gccosandvers='' ;;
4469 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4470 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4472 case "$gccosandvers" in
4473 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4474 $osname$osvers) ;; # looking good
4475 $osname*) cat <<EOM >&4
4477 *** WHOA THERE!!! ***
4479 Your gcc has not been compiled for the exact release of
4480 your operating system ($gccosandvers versus $osname$osvers).
4482 In general it is a good idea to keep gcc synchronized with
4483 the operating system because otherwise serious problems
4484 may ensue when trying to compile software, like Perl.
4486 I'm trying to be optimistic here, though, and will continue.
4487 If later during the configuration and build icky compilation
4488 problems appear (headerfile conflicts being the most common
4489 manifestation), I suggest reinstalling the gcc to match
4490 your operating system release.
4494 *) gccosandvers='' ;; # failed to parse, better be silent
4502 # gcc 3.* complain about adding -Idirectories that they already know about,
4503 # so we will take those off from locincpth.
4504 case "$gccversion" in
4506 echo "main(){}">try.c
4507 for incdir in $locincpth; do
4508 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4509 grep '^c[cp]p*[01]: warning: changing search order '`
4510 if test "X$warn" != X; then
4511 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4517 : What should the include directory be ?
4519 $echo $n "Hmm... $c"
4523 if $test -f /bin/mips && /bin/mips; then
4524 echo "Looks like a MIPS system..."
4525 $cat >usr.c <<'EOCP'
4526 #ifdef SYSTYPE_BSD43
4530 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4531 dflt='/bsd43/usr/include'
4535 mips_type='System V'
4537 $rm -f usr.c usr.out
4538 echo "and you're compiling with the $mips_type compiler and libraries."
4542 echo "Doesn't look like a MIPS system."
4552 case "$xxx_prompt" in
4555 rp='Where are the include files you want to use?'
4563 : see how we invoke the C preprocessor
4565 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4566 cat <<'EOT' >testcpp.c
4572 if test ! -f cppstdin; then
4573 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4574 # AIX cc -E doesn't show the absolute headerfile
4575 # locations but we'll cheat by using the -M flag.
4576 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
4578 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4581 echo "Keeping your $hint cppstdin wrapper."
4584 wrapper=`pwd`/cppstdin
4588 if $test "X$cppstdin" != "X" && \
4589 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4590 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4592 echo "You used to use $cppstdin $cppminus so we'll use that again."
4594 '') echo "But let's see if we can live without a wrapper..." ;;
4596 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4597 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4599 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4602 echo "(However, $cpprun $cpplast does not work, let's see...)"
4610 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4617 elif echo '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"' -E -" will work...'; \
4624 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4625 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4626 echo "Yup, it does."
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 "Yipee, that works!"
4635 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4636 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4637 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4638 echo "At long last!"
4641 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4642 $cpp <testcpp.c >testcpp.out 2>&1; \
4643 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4647 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4648 $cpp - <testcpp.c >testcpp.out 2>&1; \
4649 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4650 echo "Hooray, it works! I was beginning to wonder."
4653 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4654 $wrapper <testcpp.c >testcpp.out 2>&1; \
4655 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4661 rp="No dice. I can't find a C preprocessor. Name one:"
4665 $x_cpp <testcpp.c >testcpp.out 2>&1
4666 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4667 echo "OK, that will do." >&4
4669 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4684 echo "Perhaps can we force $cc -E using a wrapper..."
4685 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4686 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4692 echo "Nope, we'll have to live without it..."
4706 "$wrapper"|'cppstdin') ;;
4707 *) $rm -f $wrapper;;
4709 $rm -f testcpp.c testcpp.out
4711 : Set private lib path
4714 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4719 '') dlist="$loclibpth $plibpth $glibpth";;
4720 *) dlist="$libpth";;
4723 : Now check and see which directories actually exist, avoiding duplicates
4727 if $test -d $xxx; then
4730 *) libpth="$libpth $xxx";;
4736 Some systems have incompatible or broken versions of libraries. Among
4737 the directories listed in the question below, please remove any you
4738 know not to be holding relevant libraries, and add any that are needed.
4739 Say "none" for none.
4750 rp="Directories to use for library searches?"
4757 : compute shared library extension
4760 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4770 On some systems, shared libraries may be available. Answer 'none' if
4771 you want to suppress searching of shared libraries for the remainder
4772 of this configuration.
4775 rp='What is the file extension used for shared libraries?'
4779 : Define several unixisms.
4780 : Hints files or command line option can be used to override them.
4781 : The convoluted testing is in case hints files set either the old
4784 '') case "$exe_ext" in
4786 *) _exe="$exe_ext" ;;
4791 '') case "$lib_ext" in
4798 '') case "$obj_ext" in
4805 '') case "$path_sep" in
4816 rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
4818 : Which makefile gets called first. This is used by make depend.
4819 case "$firstmakefile" in
4820 '') firstmakefile='makefile';;
4823 : Check is we will use socks
4825 $define|true|[yY]*) dflt='y';;
4830 Perl can be built to use the SOCKS proxy protocol library. To do so,
4831 Configure must be run with -Dusesocks. If you use SOCKS you also need
4832 to use the PerlIO abstraction layer, this will be implicitly selected.
4834 If this doesn't make any sense to you, just accept the default '$dflt'.
4836 rp='Build Perl for SOCKS?'
4839 y|Y) val="$define" ;;
4845 : Check for uselongdouble support
4847 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
4850 case "$uselongdouble" in
4851 $define|true|[yY]*) dflt='y';;
4856 Perl can be built to take advantage of long doubles which
4857 (if available) may give more accuracy and range for floating point numbers.
4859 If this doesn't make any sense to you, just accept the default '$dflt'.
4861 rp='Try to use long doubles if available?'
4864 y|Y) val="$define" ;;
4870 case "$uselongdouble" in
4871 true|[yY]*) uselongdouble="$define" ;;
4874 : Look for a hint-file generated 'call-back-unit'. If the
4875 : user has specified that long doubles should be used,
4876 : we may need to set or change some other defaults.
4877 if $test -f uselongdouble.cbu; then
4878 echo "Your platform has some specific hints regarding long doubles, using them..."
4879 . ./uselongdouble.cbu
4881 case "$uselongdouble" in
4884 (Your platform does not have any specific hints for long doubles.)
4890 : Looking for optional libraries
4892 echo "Checking for optional libraries..." >&4
4897 case "$libswanted" in
4898 '') libswanted='c_s';;
4901 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4907 for thisdir in $libpth $xlibpth; do
4908 test -d $thisdir && libspath="$libspath $thisdir"
4910 for thislib in $libswanted; do
4911 for thisdir in $libspath; do
4913 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4914 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
4915 $test -f "$xxx" && eval $libscheck
4916 $test -f "$xxx" && libstyle=shared
4918 if test ! -f "$xxx"; then
4919 xxx=$thisdir/lib$thislib.$so
4920 $test -f "$xxx" && eval $libscheck
4921 $test -f "$xxx" && libstyle=shared
4923 if test ! -f "$xxx"; then
4924 xxx=$thisdir/lib$thislib$_a
4925 $test -f "$xxx" && eval $libscheck
4926 $test -f "$xxx" && libstyle=static
4928 if test ! -f "$xxx"; then
4929 xxx=$thisdir/$thislib$_a
4930 $test -f "$xxx" && eval $libscheck
4931 $test -f "$xxx" && libstyle=static
4933 if test ! -f "$xxx"; then
4934 xxx=$thisdir/lib${thislib}_s$_a
4935 $test -f "$xxx" && eval $libscheck
4936 $test -f "$xxx" && libstyle=static
4937 $test -f "$xxx" && thislib=${thislib}_s
4939 if test ! -f "$xxx"; then
4940 xxx=$thisdir/Slib$thislib$_a
4941 $test -f "$xxx" && eval $libscheck
4942 $test -f "$xxx" && libstyle=static
4944 if $test -f "$xxx"; then
4946 shared) echo "Found -l$thislib (shared)." ;;
4947 static) echo "Found -l$thislib." ;;
4948 *) echo "Found -l$thislib ($libstyle)." ;;
4952 *) dflt="$dflt -l$thislib"
4953 libsfound="$libsfound $xxx"
4955 libsfiles="$libsfiles $yyy"
4956 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
4957 case " $libsdirs " in
4959 *) libsdirs="$libsdirs $yyy" ;;
4966 if $test ! -f "$xxx"; then
4967 echo "No -l$thislib."
4978 ' '|'') dflt='none';;
4983 In order to compile $package on your machine, a number of libraries
4984 are usually needed. Include any other special libraries here as well.
4985 Say "none" for none. The default list is almost always right.
4989 rp="What libraries to use?"
4996 : determine optimization, if desired, or use for debug flag also
4998 ' '|$undef) dflt='none';;
5000 *) dflt="$optimize";;
5004 By default, $package compiles with the -O flag to use the optimizer.
5005 Alternately, you might want to use the symbolic debugger, which uses
5006 the -g flag (on traditional Unix systems). Either flag can be
5007 specified here. To use neither flag, specify the word "none".
5010 rp="What optimizer/debugger flag should be used?"
5014 'none') optimize=" ";;
5017 : Check what DEBUGGING is required from the command line
5018 : -DEBUGGING or -DDEBUGGING or
5019 : -DEBUGGING=both = -g + -DDEBUGGING
5020 : -DEBUGGING=-g or -Doptimize=-g = -g
5021 : -DEBUGGING=none or -UDEBUGGING =
5022 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
5025 *) DEBUGGING=$EBUGGING ;;
5028 case "$DEBUGGING" in
5032 *) optimize="$optimize -g" ;;
5036 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
5044 case "$DEBUGGING" in
5045 both|$define) dflt='-DDEBUGGING'
5048 : argument order is deliberate, as the flag will start with - which set could
5049 : think is an option
5050 checkccflag='check=$1; flag=$2; callback=$3;
5052 echo "Checking if your compiler accepts $flag" 2>&1;
5053 echo "int main(void) { return 0; }" > gcctest.c;
5054 if $cc -O2 $flag -o gcctest gcctest.c 2>gcctest.out && ./gcctest; then
5055 echo "Yes, it does." 2>&1;
5056 if $test -s gcctest.out ; then
5057 echo "But your platform does not like it:";
5062 echo "Leaving current flags $ccflags alone." 2>&1
5064 *) dflt="$dflt $flag";
5070 echo "Nope, it does not, but that is ok." 2>&1;
5074 : We will not override a previous value, but we might want to
5075 : augment a hint file
5077 default|recommended)
5078 case "$gccversion" in
5079 1*) dflt="$dflt -fpcc-struct-return" ;;
5081 case "$optimize:$DEBUGGING" in
5082 *-g*:old) dflt="$dflt -DDEBUGGING";;
5084 case "$gccversion" in
5085 2*) if $test -d /etc/conf/kconfig.d &&
5086 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
5088 # Interactive Systems (ISC) POSIX mode.
5093 case "$gccversion" in
5096 ?*) set strict-aliasing -fno-strict-aliasing
5100 # For gcc, adding -pipe speeds up compilations for some, but apparently
5101 # some assemblers can't read from stdin. (It also slows down compilations
5102 # in other cases, but those are apparently rarer these days.) AD 5/2004.
5103 case "$gccversion" in
5109 # on x86_64 (at least) we require an extra library (libssp) in the
5110 # link command line. This library is not named, so I infer that it is
5111 # an implementation detail that may change. Hence the safest approach
5112 # is to add the flag to the flags passed to the compiler at link time,
5113 # as that way the compiler can do the right implementation dependant
5115 case "$gccversion" in
5116 ?*) set stack-protector -fstack-protector
5123 case "$mips_type" in
5124 *BSD*|'') inclwanted="$locincpth $usrinc";;
5125 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
5127 for thisincl in $inclwanted; do
5128 if $test -d $thisincl; then
5129 if $test x$thisincl != x$usrinc; then
5131 *" -I$thisincl "*);;
5132 *) dflt="$dflt -I$thisincl ";;
5138 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
5140 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5148 *) dflt="$dflt -D$2";;
5152 set signal.h LANGUAGE_C; eval $inctest
5156 ccflags="$ccflags -DSOCKS"
5161 default|recommended) dflt="$ccflags $dflt" ;;
5162 *) dflt="$ccflags";;
5171 Your C compiler may want other flags. For this question you should include
5172 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5173 but you should NOT include libraries or ld flags like -lwhatever. If you
5174 want $package to honor its debug switch, you should include -DDEBUGGING here.
5175 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5177 To use no flags, specify the word "none".
5183 rp="Any additional cc flags?"
5190 : the following weeds options from ccflags that are of no interest to cpp
5192 '') cppflags="$ccflags" ;;
5193 *) cppflags="$cppflags $ccflags" ;;
5195 case "$gccversion" in
5196 1*) cppflags="$cppflags -D__GNUC__"
5198 case "$mips_type" in
5200 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5206 echo "Let me guess what the preprocessor flags are..." >&4
5220 *) ftry="$previous $flag";;
5222 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5223 >cpp1.out 2>/dev/null && \
5224 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5225 >cpp2.out 2>/dev/null && \
5226 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5227 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5229 cppflags="$cppflags $ftry"
5239 *-*) echo "They appear to be: $cppflags";;
5241 $rm -f cpp.c cpp?.out
5245 : flags used in final linking phase
5247 '') if ./venix; then
5253 *-posix*) dflt="$dflt -posix" ;;
5256 *) dflt="$ldflags";;
5258 # See note above about -fstack-protector
5260 *-fstack-protector*)
5262 *-fstack-protector*) ;; # Don't add it again
5263 *) dflt="$dflt -fstack-protector" ;;
5268 : Try to guess additional flags to pick up local libraries.
5269 for thislibdir in $libpth; do
5270 case " $loclibpth " in
5273 *"-L$thislibdir "*) ;;
5274 *) dflt="$dflt -L$thislibdir" ;;
5286 Your C linker may need flags. For this question you should
5287 include -L/whatever and any other flags used by the C linker, but you
5288 should NOT include libraries like -lwhatever.
5290 Make sure you include the appropriate -L/path flags if your C linker
5291 does not normally search all of the directories you specified above,
5294 To use no flags, specify the word "none".
5298 rp="Any additional ld flags (NOT including libraries)?"
5304 rmlist="$rmlist pdp11"
5308 echo "Checking your choice of C compiler and flags for coherency..." >&4
5309 $cat > try.c <<'EOF'
5311 int main() { printf("Ok\n"); return(0); }
5313 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5315 $cat >try.msg <<'EOM'
5316 I've tried to compile and run the following simple program:
5319 $cat try.c >> try.msg
5321 $cat >> try.msg <<EOM
5328 and I got the following output:
5332 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5333 if $sh -c "$run ./try " >>try.msg 2>&1; then
5337 *) echo 'The program compiled OK, but produced no output.' >> try.msg
5340 cat >> try.msg <<'EOQS'
5341 If $libs contains -lsfio, and sfio is mis-configured, then it
5342 sometimes (apparently) runs and exits with a 0 status, but with no
5343 output! It may have to do with sfio's use of _exit vs. exit.
5346 rp="You have a big problem. Shall I abort Configure"
5353 echo "The program compiled OK, but exited with status $?." >>try.msg
5354 rp="You have a problem. Shall I abort Configure"
5358 echo "I can't compile the test program." >>try.msg
5359 rp="You have a BIG problem. Shall I abort Configure"
5365 case "$knowitall" in
5367 echo "(The supplied flags or libraries might be incorrect.)"
5375 *) echo "Ok. Stopping Configure." >&4
5380 n) echo "OK, that should do.";;
5382 $rm_try gcctest gcctest.out
5384 : define a shorthand compile call
5388 case "$usedevel" in $define|true|[yY]*) if $test ! -f "${mc_file}.c"; then
5389 echo "Internal Configure script bug - compiler test file ${mc_file}.c is missing. Please report this to perlbug@perl.org" >&4;
5393 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5394 : define a shorthand compile call for compilations that should be ok.
5398 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5400 : determine filename position in cpp output
5402 echo "Computing filename position in cpp output for #include directives..." >&4
5404 vos) testaccess=-e ;;
5407 echo '#include <stdio.h>' > foo.c
5410 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5411 $grep '^[ ]*#.*stdio\.h' | \
5412 while read cline; do
5415 while $test \$# -gt 0; do
5416 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5421 pos=\`expr \$pos + 1\`
5433 *) pos="${fieldn}th";;
5435 echo "Your cpp writes the filename in the $pos field of the line."
5438 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
5439 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
5442 : locate header file
5447 for usrincdir in $usrinc
5449 if test -f \$usrincdir/\$wanted; then
5450 echo "\$usrincdir/\$wanted"
5454 awkprg='{ print \$$fieldn }'
5455 echo "#include <\$wanted>" > foo\$\$.c
5456 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5457 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5458 while read cline; do
5459 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5461 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5462 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5467 # status = 0: grep returned 0 lines, case statement not executed
5468 # status = 1: headerfile found
5469 # status = 2: while loop executed, no headerfile found
5473 if test \$status -eq 1; then
5480 : define an alternate in-header-list? function
5481 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5482 cont=true; xxf="echo \"<\$1> found.\" >&4";
5483 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5484 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5486 case $# in 4) instead=instead;; *) instead="at last";; esac;
5487 while $test "$cont"; do
5489 var=$2; eval "was=\$$2";
5490 if $test "$xxx" && $test -r "$xxx";
5492 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5495 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5496 set $yyy; shift; shift; yyy=$@;
5497 case $# in 0) cont="";;
5498 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5499 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5500 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5501 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5505 do set $yyy; var=$2; eval "was=\$$2";
5506 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5507 set $yyy; shift; shift; yyy=$@;
5510 : see if stdlib is available
5511 set stdlib.h i_stdlib
5514 : check for lengths of integral types
5518 echo "Checking to see how big your integers are..." >&4
5527 printf("intsize=%d;\n", (int)sizeof(int));
5528 printf("longsize=%d;\n", (int)sizeof(long));
5529 printf("shortsize=%d;\n", (int)sizeof(short));
5534 if eval $compile_ok && $run ./try > /dev/null; then
5536 echo "Your integers are $intsize bytes long."
5537 echo "Your long integers are $longsize bytes long."
5538 echo "Your short integers are $shortsize bytes long."
5542 Help! I can't compile and run the intsize test program: please enlighten me!
5543 (This is probably a misconfiguration in your system or libraries, and
5544 you really ought to fix it. Still, I'll try anyway.)
5548 rp="What is the size of an integer (in bytes)?"
5552 rp="What is the size of a long integer (in bytes)?"
5556 rp="What is the size of a short integer (in bytes)?"
5564 : check for long long
5566 echo "Checking to see if you have long long..." >&4
5567 echo 'int main() { long long x = 7; return 0; }' > try.c
5569 if eval $compile; then
5571 echo "You have long long."
5574 echo "You do not have long long."
5580 : check for length of long long
5581 case "${d_longlong}${longlongsize}" in
5584 echo "Checking to see how big your long longs are..." >&4
5585 $cat >try.c <<'EOCP'
5589 printf("%d\n", (int)sizeof(long long));
5594 if eval $compile_ok; then
5595 longlongsize=`$run ./try`
5596 echo "Your long longs are $longlongsize bytes long."
5600 echo "(I can't seem to compile the test program. Guessing...)"
5601 rp="What is the size of a long long (in bytes)?"
5605 if $test "X$longsize" = "X$longlongsize"; then
5606 echo "(That isn't any different from an ordinary long.)"
5612 : see if inttypes.h is available
5613 : we want a real compile instead of Inhdr because some systems
5614 : have an inttypes.h which includes non-existent headers
5617 #include <inttypes.h>
5619 static int32_t foo32 = 0x12345678;
5623 if eval $compile; then
5624 echo "<inttypes.h> found." >&4
5627 echo "<inttypes.h> NOT found." >&4
5636 echo "Checking to see if you have int64_t..." >&4
5638 #include <sys/types.h>
5639 #$i_inttypes I_INTTYPES
5641 #include <inttypes.h>
5643 int main() { int64_t x = 7; }
5646 if eval $compile; then
5648 echo "You have int64_t."
5651 echo "You do not have int64_t."
5657 : Check if 64bit ints have a quad type
5659 echo "Checking which 64-bit integer type we could use..." >&4
5665 val='"unsigned int"'
5670 *) case "$longsize" in
5674 val='"unsigned long"'
5679 *) case "$d_longlong:$longlongsize" in
5684 val='"unsigned long long"'
5689 *) case "$d_int64_t" in
5708 '') echo "Alas, no 64-bit integer types in sight." >&4
5711 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5716 : Do we want 64bit support
5717 case "$uselonglong" in
5718 "$define"|true|[yY]*)
5721 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5723 use64bitint="$define"
5726 case "$use64bits" in
5727 "$define"|true|[yY]*)
5730 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5732 use64bitint="$define"
5735 case "$use64bitints" in
5736 "$define"|true|[yY]*)
5739 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5741 use64bitint="$define"
5744 case "$use64bitsint" in
5745 "$define"|true|[yY]*)
5748 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5750 use64bitint="$define"
5753 case "$uselonglongs" in
5754 "$define"|true|[yY]*)
5757 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5759 use64bitint="$define"
5762 case "$use64bitsall" in
5763 "$define"|true|[yY]*)
5766 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
5768 use64bitall="$define"
5773 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
5775 case "$use64bitall" in
5776 "$define"|true|[yY]*) use64bitint="$define" ;;
5782 You have natively 64-bit long integers.
5786 *) case "$use64bitint" in
5787 "$define"|true|[yY]*) dflt='y';;
5796 Perl can be built to take advantage of 64-bit integer types
5797 on some systems. To do so, Configure can be run with -Duse64bitint.
5798 Choosing this option will most probably introduce binary incompatibilities.
5800 If this doesn't make any sense to you, just accept the default '$dflt'.
5801 (The default has been chosen based on your configuration.)
5803 rp='Try to use 64-bit integers, if available?'
5806 [yY]*) val="$define" ;;
5814 case "$use64bitall" in
5815 "$define"|true|[yY]*) dflt='y' ;;
5816 *) case "$longsize" in
5824 You may also choose to try maximal 64-bitness. It means using as much
5825 64-bitness as possible on the platform. This in turn means even more
5826 binary incompatibilities. On the other hand, your platform may not
5827 have any more 64-bitness available than what you already have chosen.
5829 If this doesn't make any sense to you, just accept the default '$dflt'.
5830 (The default has been chosen based on your configuration.)
5832 rp='Try to use maximal 64-bit support, if available?'
5835 [yY]*) val="$define" ;;
5840 case "$use64bitall" in
5842 case "$use64bitint" in
5846 Since you have chosen a maximally 64-bit build, I'm also turning on
5847 the use of 64-bit integers.
5849 use64bitint="$define" ;;
5854 : Look for a hint-file generated 'call-back-unit'. If the
5855 : user has specified that a 64-bit perl is to be built,
5856 : we may need to set or change some other defaults.
5857 if $test -f use64bitint.cbu; then
5858 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
5861 case "$use64bitint" in
5862 "$define"|true|[yY]*)
5864 4) case "$archname64" in
5865 '') archname64=64int ;;
5872 : Look for a hint-file generated 'call-back-unit'. If the
5873 : user has specified that a maximally 64-bit perl is to be built,
5874 : we may need to set or change some other defaults.
5875 if $test -f use64bitall.cbu; then
5876 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
5879 case "$use64bitall" in
5880 "$define"|true|[yY]*)
5882 4) case "$archname64" in
5883 ''|64int) archname64=64all ;;
5890 case "$d_quad:$use64bitint" in
5894 *** You have chosen to use 64-bit integers,
5895 *** but none can be found.
5896 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
5897 *** Cannot continue, aborting.
5904 : check for length of double
5906 case "$doublesize" in
5908 echo "Checking to see how big your double precision numbers are..." >&4
5917 printf("%d\n", (int)sizeof(double));
5922 if eval $compile_ok; then
5923 doublesize=`$run ./try`
5924 echo "Your double is $doublesize bytes long."
5927 echo "(I can't seem to compile the test program. Guessing...)"
5928 rp="What is the size of a double precision number (in bytes)?"
5936 : check for long doubles
5938 echo "Checking to see if you have long double..." >&4
5939 echo 'int main() { long double x = 7.0; }' > try.c
5941 if eval $compile; then
5943 echo "You have long double."
5946 echo "You do not have long double."
5952 : check for length of long double
5953 case "${d_longdbl}${longdblsize}" in
5956 echo "Checking to see how big your long doubles are..." >&4
5957 $cat >try.c <<'EOCP'
5961 printf("%d\n", sizeof(long double));
5966 if eval $compile; then
5967 longdblsize=`$run ./try`
5968 echo "Your long doubles are $longdblsize bytes long."
5972 echo "(I can't seem to compile the test program. Guessing...)" >&4
5973 rp="What is the size of a long double (in bytes)?"
5977 if $test "X$doublesize" = "X$longdblsize"; then
5978 echo "That isn't any different from an ordinary double."
5979 echo "I'll keep your setting anyway, but you may see some"
5980 echo "harmless compilation warnings."
5986 : determine the architecture name
5988 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
5989 tarch=`arch`"-$osname"
5990 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
5991 if uname -m > tmparch 2>&1 ; then
5992 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
5993 -e 's/$/'"-$osname/" tmparch`
6001 case "$myarchname" in
6004 echo "(Your architecture name used to be $myarchname.)"
6008 case "$targetarch" in
6010 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
6015 *) dflt="$archname";;
6017 rp='What is your architecture name'
6020 case "$usethreads" in
6022 echo "Threads selected." >&4
6024 *-thread*) echo "...and architecture name already has -thread." >&4
6026 *) archname="$archname-thread"
6027 echo "...setting architecture name to $archname." >&4
6032 case "$usemultiplicity" in
6034 echo "Multiplicity selected." >&4
6036 *-multi*) echo "...and architecture name already has -multi." >&4
6038 *) archname="$archname-multi"
6039 echo "...setting architecture name to $archname." >&4
6044 case "$use64bitint$use64bitall" in
6046 case "$archname64" in
6048 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
6051 case "$use64bitint" in
6052 "$define") echo "64 bit integers selected." >&4 ;;
6054 case "$use64bitall" in
6055 "$define") echo "Maximal 64 bitness selected." >&4 ;;
6058 *-$archname64*) echo "...and architecture name already has $archname64." >&4
6060 *) archname="$archname-$archname64"
6061 echo "...setting architecture name to $archname." >&4
6067 case "$uselongdouble" in
6069 echo "Long doubles selected." >&4
6070 case "$longdblsize" in
6072 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
6076 *-ld*) echo "...and architecture name already has -ld." >&4
6078 *) archname="$archname-ld"
6079 echo "...setting architecture name to $archname." >&4
6086 if $test -f archname.cbu; then
6087 echo "Your platform has some specific hints for architecture name, using them..."
6091 : set the prefixit variable, to compute a suitable default value
6092 prefixit='case "$3" in
6094 case "$oldprefix" in
6095 "") eval "$1=\"\$$2\"";;
6102 ""|" ") eval "$1=\"\$$2\"";;
6108 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
6110 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
6111 /*-$oldprefix/*|\~*-$oldprefix/*)
6112 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
6113 *) eval "$1=\"\$$2\"";;
6117 : determine installation style
6118 : For now, try to deduce it from prefix unless it is already set.
6119 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
6120 case "$installstyle" in
6121 '') case "$prefix" in
6122 *perl*) dflt='lib';;
6123 *) dflt='lib/perl5' ;;
6126 *) dflt="$installstyle" ;;
6128 : Probably not worth prompting for this since we prompt for all
6129 : the directories individually, and the prompt would be too long and
6133 : determine where public executables go
6138 rp='Pathname where the public executables will reside?'
6140 if $test "X$ansexp" != "X$binexp"; then
6144 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6145 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
6146 : this via initialinstalllocation
6149 case "$userelocatableinc" in
6150 $define|true|[yY]*) dflt='y' ;;
6155 Would you like to build Perl so that the installation is relocatable, so that
6156 library paths in @INC are determined relative to the path of the perl binary?
6157 This is not advised for system Perl installs, or if you need to run setid
6158 scripts or scripts under taint mode.
6160 If this doesn't make any sense to you, just accept the default '$dflt'.
6162 rp='Use relocatable @INC?'
6165 y|Y) val="$define" ;;
6168 set userelocatableinc
6171 initialinstalllocation="$binexp"
6172 : Default prefix is now "up one level from where the binaries are"
6173 case "$userelocatableinc" in
6179 installprefixexp=".../.."
6183 : determine where private library files go
6184 : Usual default is /usr/local/lib/perl5/$version.
6185 : Also allow things like /opt/perl/lib/$version, since
6186 : /opt/perl/lib/perl5... would be redundant.
6187 : The default "style" setting is made in installstyle.U
6188 case "$installstyle" in
6189 *lib/perl5*) set dflt privlib lib/$package/$version ;;
6190 *) set dflt privlib lib/$version ;;
6195 There are some auxiliary files for $package that need to be put into a
6196 private library directory that is accessible by everyone.
6201 rp='Pathname where the private library files will reside?'
6206 : set the prefixup variable, to restore leading tilda escape
6207 prefixup='case "$prefixexp" in
6209 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
6212 : determine where public architecture dependent libraries go
6215 : privlib default is /usr/local/lib/$package/$version
6216 : archlib default is /usr/local/lib/$package/$version/$archname
6217 : privlib may have an optional trailing /share.
6218 tdflt=`echo $privlib | $sed 's,/share$,,'`
6219 tdflt=$tdflt/$archname
6228 $spackage contains architecture-dependent library files. If you are
6229 sharing libraries in a heterogeneous environment, you might store
6230 these files in a separate location. Otherwise, you can just include
6231 them with the rest of the public library files.
6236 rp='Where do you want to put the public architecture-dependent libraries?'
6240 if $test X"$archlib" = X"$privlib"; then
6246 : see if setuid scripts can be secure
6249 Some kernels have a bug that prevents setuid #! scripts from being
6250 secure. Some sites have disabled setuid #! scripts because of this.
6252 First let's decide if your kernel supports secure setuid #! scripts.
6253 (If setuid #! scripts would be secure but have been disabled anyway,
6254 don't say that they are secure if asked.)
6259 if $test -d /dev/fd; then
6260 echo "#!$ls" >reflect
6261 chmod +x,u+s reflect
6262 ./reflect >flect 2>&1
6263 if $contains "/dev/fd" flect >/dev/null; then
6264 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6268 If you are not sure if they are secure, I can check but I'll need a
6269 username and password different from the one you are using right now.
6270 If you don't have such a username or don't want me to test, simply
6274 rp='Other username to test security of setuid scripts with?'
6279 case "$d_suidsafe" in
6280 '') echo "I'll assume setuid scripts are *not* secure." >&4
6283 echo "Well, the $hint value is *not* secure." >&4
6285 *) echo "Well, the $hint value *is* secure." >&4
6290 $rm -f reflect flect
6291 echo "#!$ls" >reflect
6292 chmod +x,u+s reflect
6295 echo '"su" will (probably) prompt you for '"$ans's password."
6296 su $ans -c './reflect >flect'
6297 if $contains "/dev/fd" flect >/dev/null; then
6298 echo "Okay, it looks like setuid scripts are secure." >&4
6301 echo "I don't think setuid scripts are secure." >&4
6306 rp='Does your kernel have *secure* setuid scripts?'
6309 [yY]*) val="$define";;
6314 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6315 echo "(That's for file descriptors, not floppy disks.)"
6321 $rm -f reflect flect
6323 : now see if they want to do setuid emulation
6324 if $test $patchlevel -lt 11; then
6327 case "$d_suidsafe" in
6330 echo "No need to emulate SUID scripts since they are secure here." >&4
6334 Some systems have disabled setuid scripts, especially systems where
6335 setuid scripts cannot be secure. On systems where setuid scripts have
6336 been disabled, the setuid/setgid bits on scripts are currently
6337 useless. It is possible for $package to detect those bits and emulate
6338 setuid/setgid in a secure fashion. This emulation will only work if
6339 setuid scripts have been disabled in your kernel.
6343 "$define") dflt=y ;;
6346 rp="Do you want to do setuid/setgid emulation?"
6349 [yY]*) val="$define";;
6361 SUID emulation has been removed for 5.12
6362 Please re-run Configure without -Dd_dosuid
6371 : Find perl5.005 or later.
6372 echo "Looking for a previously installed perl5.005 or later... "
6374 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
6375 : Check if this perl is recent and can load a simple module
6376 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6379 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6389 '') echo "None found. That's ok.";;
6390 *) echo "Using $perl5." ;;
6393 : Set the siteprefix variables
6396 After $package is installed, you may wish to install various
6397 add-on modules and utilities. Typically, these add-ons will
6398 be installed under $prefix with the rest
6399 of this package. However, you may wish to install such add-ons
6400 elsewhere under a different prefix.
6402 If you do not wish to put everything under a single prefix, that's
6403 ok. You will be prompted for the individual locations; this siteprefix
6404 is only used to suggest the defaults.
6406 The default should be fine for most people.
6410 rp='Installation prefix to use for add-on modules and utilities?'
6411 : XXX Here might be another good place for an installstyle setting.
6412 case "$siteprefix" in
6414 *) dflt=$siteprefix ;;
6417 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6419 case "$siteprefix" in
6423 *) oldsiteprefix="$prefix";;
6428 siteprefixexp="$ansexp"
6430 : determine where site specific libraries go.
6431 : Usual default is /usr/local/lib/perl5/site_perl/$version
6432 : The default "style" setting is made in installstyle.U
6433 : XXX No longer works with Prefixit stuff.
6434 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6436 '') case "$installstyle" in
6437 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6438 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6446 The installation process will create a directory for
6447 site-specific extensions and modules. Most users find it convenient
6448 to place all site-specific files in this directory rather than in the
6449 main distribution directory.
6453 rp='Pathname for the site-specific library files?'
6457 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6459 : Determine list of previous versions to include in @INC
6460 $cat > getverlist <<EOPL
6463 \$api_versionstring = "$api_versionstring";
6464 \$version = "$version";
6465 \$stem = "$sitelib_stem";
6466 \$archname = "$archname";
6468 $cat >> getverlist <<'EOPL'
6469 # The list found is store twice for each entry: the original name, and
6470 # the binary broken down version as pack "sss", so sorting is easy and
6471 # unambiguous. This will work for all versions that have a maximum of
6472 # three digit groups, separate by '.'s or '_'s. Names are extended with
6473 # ".0.0" to ensure at least three elements for the pack.
6474 # -- H.Merijn Brand (m)'06 23-10-2006
6476 # Can't have leading @ because metaconfig interprets it as a command!
6477 ;@inc_version_list=();
6478 # XXX Redo to do opendir/readdir?
6481 ;@candidates = map {
6482 [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
6483 ;@candidates = sort { $a->[1] cmp $b->[1]} @candidates;
6489 ($pversion, $aversion, $vsn5005) = map {
6490 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
6491 foreach $d (@candidates) {
6492 if ($d->[1] lt $pversion) {
6493 if ($d->[1] ge $aversion) {
6494 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
6496 elsif ($d->[1] ge $vsn5005) {
6497 unshift(@inc_version_list, grep { -d } $d->[0]);
6501 # Skip newer version. I.e. don't look in
6502 # 5.7.0 if we're installing 5.6.1.
6506 if (@inc_version_list) {
6507 print join(' ', @inc_version_list);
6510 # Blank space to preserve value for next Configure run.
6515 case "$inc_version_list" in
6516 '') if test -x "$perl5$exe_ext"; then
6517 dflt=`$perl5 getverlist`
6522 $undef) dflt='none' ;;
6523 *) eval dflt=\"$inc_version_list\" ;;
6526 ''|' ') dflt=none ;;
6533 In order to ease the process of upgrading, this version of perl
6534 can be configured to use modules built and installed with earlier
6535 versions of perl that were installed under $prefix. Specify here
6536 the list of earlier versions that this version of perl should check.
6537 If Configure detected no earlier versions of perl installed under
6538 $prefix, then the list will be empty. Answer 'none' to tell perl
6539 to not search earlier versions.
6541 The default should almost always be sensible, so if you're not sure,
6542 just accept the default.
6545 rp='List of earlier versions to include in @INC?'
6548 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
6549 *) inc_version_list="$ans" ;;
6551 case "$inc_version_list" in
6553 inc_version_list_init='0'
6554 d_inc_version_list="$undef"
6556 *) inc_version_list_init=`echo $inc_version_list |
6557 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6558 d_inc_version_list="$define"
6563 : see if malloc/malloc.h has to be included
6564 set malloc/malloc.h i_mallocmalloc
6567 : see if this is a malloc.h system
6568 : we want a real compile instead of Inhdr because some systems have a
6569 : malloc.h that just gives a compile error saying to use stdlib.h instead
6574 #$i_mallocmalloc I_MALLOCMALLOC
6575 #ifdef I_MALLOCMALLOC
6576 # include <malloc/malloc.h>
6579 int main () { return 0; }
6582 if eval $compile; then
6583 echo "<malloc.h> found." >&4
6586 echo "<malloc.h> NOT found." >&4
6593 : check for void type
6595 echo "Checking to see how well your C compiler groks the void type..." >&4
6596 case "$voidflags" in
6608 extern void moo(); /* function returning void */
6609 void (*goo)(); /* ptr to func returning void */
6611 void *hue; /* generic ptr */
6624 int main() { sub(); }
6626 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
6627 voidflags=$defvoidused
6628 echo "Good. It appears to support void to the level $package wants.">&4
6629 if $contains warning .out >/dev/null 2>&1; then
6630 echo "However, you might get some warnings that look like this:"
6634 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
6635 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
6636 echo "It supports 1..."
6637 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
6638 echo "It also supports 2..."
6639 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
6641 echo "And it supports 4 but not 8 definitely."
6643 echo "It doesn't support 4..."
6644 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
6646 echo "But it supports 8."
6649 echo "Neither does it support 8."
6653 echo "It does not support 2..."
6654 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
6656 echo "But it supports 4 and 8."
6658 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
6660 echo "And it supports 4 but has not heard about 8."
6662 echo "However it supports 8 but not 4."
6667 echo "There is no support at all for void."
6672 case "$voidflags" in
6675 Support flag bits are:
6676 1: basic void declarations.
6677 2: arrays of pointers to functions returning void.
6678 4: operations between pointers to and addresses of void functions.
6679 8: generic void pointers.
6682 rp="Your void support flags add up to what?"
6689 : check for length of pointer
6693 echo "Checking to see how big your pointers are..." >&4
6694 if test "$voidflags" -gt 7; then
6695 echo '#define VOID_PTR char *' > try.c
6697 echo '#define VOID_PTR void *' > try.c
6707 printf("%d\n", (int)sizeof(VOID_PTR));
6712 if eval $compile_ok; then
6713 ptrsize=`$run ./try`
6714 echo "Your pointers are $ptrsize bytes long."
6717 echo "(I can't seem to compile the test program. Guessing...)" >&4
6718 rp="What is the size of a pointer (in bytes)?"
6725 case "$use64bitall" in
6726 "$define"|true|[yY]*)
6730 *** You have chosen a maximally 64-bit build,
6731 *** but your pointers are only 4 bytes wide.
6732 *** Please rerun Configure without -Duse64bitall.
6737 *** Since you have quads, you could possibly try with -Duse64bitint.
6742 *** Cannot continue, aborting.
6753 : determine whether to use malloc wrapping
6755 case "$usemallocwrap" in
6756 [yY]*|true|$define) dflt='y' ;;
6757 [nN]*|false|$undef) dflt='n' ;;
6758 *) case "$usedevel" in
6759 [yY]*|true|$define) dflt='y' ;;
6764 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
6766 usemallocwrap="$ans"
6769 usemallocwrap="$define" ;;
6771 usemallocwrap="$undef" ;;
6774 : determine which malloc to compile in
6776 case "$usemymalloc" in
6777 [yY]*|true|$define) dflt='y' ;;
6778 [nN]*|false|$undef) dflt='n' ;;
6779 *) case "$ptrsize" in
6783 if test "$useithreads" = "$define"; then dflt='n'; fi
6786 rp="Do you wish to attempt to use the malloc that comes with $package?"
6792 mallocsrc='malloc.c'
6793 mallocobj="malloc$_o"
6794 d_mymalloc="$define"
6797 : Remove malloc from list of libraries to use
6798 echo "Removing unneeded -lmalloc from library list" >&4
6799 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6802 echo "libs = $libs" >&4
6814 : compute the return types of malloc and free
6816 $cat >malloc.c <<END
6820 #include <sys/types.h>
6834 case "$malloctype" in
6836 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6843 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6847 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6854 echo "Your system uses $freetype free(), it would seem." >&4
6856 : determine where site specific architecture-dependent libraries go.
6857 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6858 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6859 : sitelib may have an optional trailing /share.
6861 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6862 dflt="$dflt/$archname"
6867 set sitearch sitearch none
6871 The installation process will also create a directory for
6872 architecture-dependent site-specific extensions and modules.
6876 rp='Pathname for the site-specific architecture-dependent library files?'
6880 if $test X"$sitearch" = X"$sitelib"; then
6883 d_sitearch="$define"
6886 : Set the vendorprefix variables
6889 The installation process will also create a directory for
6890 vendor-supplied add-ons. Vendors who supply perl with their system
6891 may find it convenient to place all vendor-supplied files in this
6892 directory rather than in the main distribution directory. This will
6893 ease upgrades between binary-compatible maintenance versions of perl.
6895 Of course you may also use these directories in whatever way you see
6896 fit. For example, you might use them to access modules shared over a
6897 company-wide network.
6899 The default answer should be fine for most people.
6900 This causes further questions about vendor add-ons to be skipped
6901 and no vendor-specific directories will be configured for perl.
6904 rp='Do you want to configure vendor-specific add-on directories?'
6905 case "$usevendorprefix" in
6906 define|true|[yY]*) dflt=y ;;
6907 *) : User may have set vendorprefix directly on Configure command line.
6908 case "$vendorprefix" in
6917 rp='Installation prefix to use for vendor-supplied add-ons?'
6918 case "$vendorprefix" in
6920 *) dflt=$vendorprefix ;;
6923 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6925 case "$vendorprefix" in
6929 *) oldvendorprefix="$prefix";;
6933 usevendorprefix="$define"
6935 vendorprefixexp="$ansexp"
6937 *) usevendorprefix="$undef"
6943 : Set the vendorlib variables
6944 case "$vendorprefix" in
6945 '') d_vendorlib="$undef"
6949 *) d_vendorlib="$define"
6950 : determine where vendor-supplied modules go.
6951 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
6952 case "$vendorlib" in
6954 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6955 case "$installstyle" in
6956 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
6957 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
6960 *) dflt="$vendorlib"
6964 rp='Pathname for the vendor-supplied library files?'
6967 vendorlibexp="$ansexp"
6970 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
6974 : Set the vendorarch variables
6975 case "$vendorprefix" in
6976 '') d_vendorarch="$undef"
6980 *) d_vendorarch="$define"
6981 : determine where vendor-supplied architecture-dependent libraries go.
6982 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
6983 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
6984 : vendorlib may have an optional trailing /share.
6985 case "$vendorarch" in
6986 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
6987 dflt="$dflt/$archname"
6989 *) dflt="$vendorarch" ;;
6992 rp='Pathname for vendor-supplied architecture-dependent files?'
6995 vendorarchexp="$ansexp"
6998 prefixvar=vendorarch
7000 if $test X"$vendorarch" = X"$vendorlib"; then
7001 d_vendorarch="$undef"
7003 d_vendorarch="$define"
7006 : Final catch-all directories to search
7009 Lastly, you can have perl look in other directories for extensions and
7010 modules in addition to those already specified.
7011 These directories will be searched after
7015 test X"$vendorlib" != "X" && echo ' ' $vendorlib
7016 test X"$vendorarch" != "X" && echo ' ' $vendorarch
7018 case "$otherlibdirs" in
7019 ''|' ') dflt='none' ;;
7020 *) dflt="$otherlibdirs" ;;
7023 Enter a colon-separated set of extra paths to include in perl's @INC
7024 search path, or enter 'none' for no extra paths.
7028 rp='Colon-separated list of additional directories for perl to search?'
7031 ' '|''|none) otherlibdirs=' ' ;;
7032 *) otherlibdirs="$ans" ;;
7034 case "$otherlibdirs" in
7038 set d_perl_otherlibdirs
7041 : Cruising for prototypes
7043 echo "Checking out function prototypes..." >&4
7044 $cat >prototype.c <<EOCP
7049 int main(int argc, char *argv[]) {
7052 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
7053 echo "Your C compiler appears to support function prototypes."
7056 echo "Your C compiler doesn't seem to understand function prototypes."
7063 : Check if ansi2knr is required
7064 case "$prototype" in
7066 *) ansi2knr='ansi2knr'
7071 This version of $package can only be compiled by a compiler that
7072 understands function prototypes. Unfortunately, your C compiler
7074 doesn't seem to understand them. Sorry about that.
7076 If GNU cc is available for your system, perhaps you could try that instead.
7078 Eventually, we hope to support building Perl with pre-ANSI compilers.
7079 If you would like to help in that effort, please contact <perlbug@perl.org>.
7081 Aborting Configure now.
7088 dflt_dtrace='/usr/sbin/dtrace'
7089 $test -x /usr/bin/dtrace && dflt_dtrace='/usr/bin/dtrace'
7093 Perl can be built to support DTrace on platforms that support it.
7094 DTrace is a diagnosis and performance analysis tool from Sun.
7096 If this doesn't make any sense to you, just accept the default '$dflt'.
7100 case "$usedtrace" in
7106 dflt_dtrace=$usedtrace
7113 rp='Support DTrace if available?'
7116 y|Y) val="$define" ;;
7122 test "X$usedtrace" != "X$define" && break
7125 rp='Where is the dtrace executable?'
7134 if $dtrace -h -s ../perldtrace.d \
7135 -o perldtrace.tmp >/dev/null 2>&1 \
7136 && rm -f perldtrace.tmp
7139 echo "Good: your $dtrace knows about the -h flag."
7143 *** $me: Fatal Error: $dtrace doesn't support -h flag
7145 *** Your installed dtrace doesn't support the -h switch to compile a D
7146 *** program into a C header. Can't continue.
7158 *** $me: Fatal Error: $dtrace not found.
7165 echo "*** $dtrace was not found."
7171 : See if we want extra modules installed
7178 Perl can be built with extra modules or bundles of modules which
7179 will be fetched from the CPAN and installed alongside Perl.
7181 Notice that you will need access to the CPAN; either via the Internet,
7182 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
7183 be asked later to configure the CPAN.pm module which will in turn do
7184 the installation of the rest of the extra modules or bundles.)
7186 Notice also that if the modules require any external software such as
7187 libraries and headers (the libz library and the zlib.h header for the
7188 Compress::Zlib module, for example) you MUST have any such software
7189 already installed, this configuration process will NOT install such
7192 If this doesn't make any sense to you, just accept the default '$dflt'.
7194 rp='Install any extra modules (y or n)?'
7200 Please list any extra modules or bundles to be installed from CPAN,
7201 with spaces between the names. The names can be in any format the
7202 'install' command of CPAN.pm will understand. (Answer 'none',
7203 without the quotes, to install no extra modules or bundles.)
7213 $rm -f ../extras.lst
7215 *) echo "(Saving the list of extras for later...)"
7216 echo "$extras" > ../extras.lst
7224 : determine where html pages for programs go
7225 set html1dir html1dir none
7229 If you wish to install html files for programs in $spackage, indicate
7230 the appropriate directory here. To skip installing html files,
7234 ''|none|$undef|' ') dflt=none ;;
7235 *) dflt=$html1dir ;;
7238 rp="Directory for the main $spackage html pages?"
7242 : Use ' ' for none so value is preserved next time through Configure
7243 $test X"$html1dir" = "X" && html1dir=' '
7245 : determine where html pages for libraries and modules go
7246 set html3dir html3dir none
7250 If you wish to install html files for modules associated with $spackage,
7251 indicate the appropriate directory here. To skip installing html files,
7254 : There is no obvious default. If they have specified html1dir, then
7255 : try to key off that, possibly changing .../html1 into .../html3.
7257 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
7258 *) dflt=$html3dir ;;
7261 rp="Directory for the $spackage module html pages?"
7265 : Use ' ' for none so value is preserved next time through Configure
7266 $test X"$html3dir" = "X" && html3dir=' '
7268 : determine whether to install perl also as /usr/bin/perl
7271 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
7273 Many scripts expect perl to be installed as /usr/bin/perl.
7275 If you want to, I can install the perl you are about to compile
7276 as /usr/bin/perl (in addition to $bin/perl).
7278 if test -f /usr/bin/perl; then
7281 However, please note that because you already have a /usr/bin/perl,
7282 overwriting that with a new Perl would very probably cause problems.
7283 Therefore I'm assuming you don't want to do that (unless you insist).
7286 case "$installusrbinperl" in
7287 "$define"|[yY]*) dflt='y';;
7293 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
7296 case "$installusrbinperl" in
7297 "$undef"|[nN]*) dflt='n';;
7301 rp="Do you want to install perl as /usr/bin/perl?"
7304 [yY]*) val="$define";;
7310 set installusrbinperl
7313 : Check if we are using the GNU C library
7315 echo "Checking for GNU C Library..." >&4
7317 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
7318 alone are insufficient to distinguish different versions, such as
7319 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
7320 libc version 2.1.0. A. Dougherty, June 3, 2002.
7326 # ifdef __GLIBC_MINOR__
7327 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
7328 # include <gnu/libc-version.h>
7329 printf("%s\n", gnu_get_libc_version());
7331 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
7334 printf("%d\n", __GLIBC__);
7343 if eval $compile_ok && $run ./try > glibc.ver; then
7345 gnulibc_version=`$cat glibc.ver`
7346 echo "You are using the GNU C Library version $gnulibc_version"
7350 echo "You are not using the GNU C Library"
7356 : see if nm is to be used to determine whether a symbol is defined or not
7360 case "$d_gnulibc" in
7363 echo "nm probably won't work on the GNU C Library." >&4
7369 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
7371 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
7372 echo "'nm' won't be sufficient on this sytem." >&4
7378 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
7379 if $test $dflt -gt 20; then
7389 true|$define) dflt=y;;
7396 I can use $nm to extract the symbols from your C libraries. This
7397 is a time consuming task which may generate huge output on the disk (up
7398 to 3 megabytes) but that should make the symbols extraction faster. The
7399 alternative is to skip the 'nm' extraction part and to compile a small
7400 test program instead to determine whether each symbol is present. If
7401 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
7402 this may be the best solution.
7404 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
7407 rp="Shall I use $nm to extract C symbols from the libraries?"
7410 [Nn]*) usenm=false;;
7419 : nm options which may be necessary
7421 '') if $test -f /mach_boot; then
7423 elif $test -d /usr/ccs/lib; then
7424 nm_opt='-p' # Solaris (and SunOS?)
7425 elif $test -f /dgux; then
7427 elif $test -f /lib64/rld; then
7428 nm_opt='-p' # 64-bit Irix
7434 : nm options which may be necessary for shared libraries but illegal
7435 : for archive libraries. Thank you, Linux.
7436 case "$nm_so_opt" in
7437 '') case "$myuname" in
7439 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
7440 nm_so_opt='--dynamic'
7447 : Figure out where the libc is located
7450 : get list of predefined functions in a handy place
7455 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
7461 *) for thislib in $libs; do
7464 : Handle C library specially below.
7467 thislib=`echo $thislib | $sed -e 's/^-l//'`
7468 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
7470 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
7472 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
7474 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
7476 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
7478 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
7480 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
7485 libnames="$libnames $try"
7487 *) libnames="$libnames $thislib" ;;
7496 for xxx in $libpth; do
7497 $test -r $1 || set $xxx/libc.$so
7498 : The messy sed command sorts on library version numbers.
7500 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
7501 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
7503 s/[0-9][0-9]*/0000&/g
7504 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
7507 $sort | $sed -e 's/^.* //'`
7510 $test -r $1 || set /usr/ccs/lib/libc.$so
7511 $test -r $1 || set /lib/libsys_s$_a
7517 if $test -r "$1"; then
7518 echo "Your (shared) C library seems to be in $1."
7520 elif $test -r /lib/libc && $test -r /lib/clib; then
7521 echo "Your C library seems to be in both /lib/clib and /lib/libc."
7523 libc='/lib/clib /lib/libc'
7524 if $test -r /lib/syslib; then
7525 echo "(Your math library is in /lib/syslib.)"
7526 libc="$libc /lib/syslib"
7528 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7529 echo "Your C library seems to be in $libc, as you said before."
7530 elif $test -r $incpath/usr/lib/libc$_a; then
7531 libc=$incpath/usr/lib/libc$_a;
7532 echo "Your C library seems to be in $libc. That's fine."
7533 elif $test -r /lib/libc$_a; then
7535 echo "Your C library seems to be in $libc. You're normal."
7537 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
7539 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
7540 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
7541 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
7543 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7545 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7548 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
7550 if $test -r "$tans"; then
7551 echo "Your C library seems to be in $tans, of all places."
7557 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7561 If the guess above is wrong (which it might be if you're using a strange
7562 compiler, or your machine supports multiple models), you can override it here.
7567 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
7569 I can't seem to find your C library. I've looked in the following places:
7572 $sed 's/^/ /' libpath
7575 None of these seems to contain your C library. I need to get its name...
7580 rp='Where is your C library?'
7585 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
7586 set X `cat libnames`
7589 case $# in 1) xxx=file; esac
7590 echo "Extracting names from the following $xxx for later perusal:" >&4
7592 $sed 's/^/ /' libnames >&4
7594 $echo $n "This may take a while...$c" >&4
7598 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
7599 *) $nm $nm_opt $file 2>/dev/null;;
7604 $grep fprintf libc.tmp > libc.ptf
7605 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
7606 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
7608 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
7610 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7612 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
7614 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7616 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
7618 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7620 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
7622 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7624 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
7626 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7628 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
7630 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7632 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
7633 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
7635 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7637 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
7639 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7641 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
7643 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7645 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
7647 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7649 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
7651 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7653 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
7655 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7657 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
7659 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7661 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
7663 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7666 $nm -p $* 2>/dev/null >libc.tmp
7667 $grep fprintf libc.tmp > libc.ptf
7668 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
7669 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
7675 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
7677 if $ar t $libc > libc.tmp && \
7678 $contains '^fprintf$' libc.tmp >/dev/null 2>&1
7680 for thisname in $libnames $libc; do
7681 $ar t $thisname >>libc.tmp
7683 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
7685 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
7686 for thisname in $libnames $libc; do
7687 $ar tv $thisname >>libc.tmp
7688 emximp -o tmp.imp $thisname \
7690 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
7691 < tmp.imp >>libc.tmp
7694 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
7697 echo "$ar didn't seem to work right." >&4
7698 echo "Maybe this is a Cray...trying bld instead..." >&4
7700 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list &&
7703 for thisname in $libnames; do
7705 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
7706 $ar t $thisname >>libc.tmp
7710 echo "That didn't work either. Giving up." >&4
7720 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
7721 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
7723 *) if $test -f /lib/syscalls.exp; then
7725 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
7726 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' \
7727 /lib/syscalls.exp >>libc.list
7733 $rm -f libnames libpath
7735 : see if dld is available
7739 : Check if we are using C++
7741 echo "Checking for C++..." >&4
7742 $cat >try.c <<'EOCP'
7754 if eval $compile_ok && $run ./try; then
7756 echo "You are using a C++ compiler."
7759 echo "You are not using a C++ compiler."
7765 : is a C symbol defined?
7768 -v) tf=libc.tmp; tdc="";;
7769 -a) tf=libc.tmp; tdc="[]";;
7770 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
7772 case "$d_cplusplus" in
7773 $define) extern_C="extern \"C\"" ;;
7774 *) extern_C="extern" ;;
7777 case "$reuseval-$4" in
7779 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
7784 if $test "$runnm" = true; then
7785 if $contains $tlook $tf >/dev/null 2>&1; then
7787 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
7788 echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7789 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
7790 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
7794 echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7795 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
7801 $define) tval=true;;
7808 : define an is-in-libc? function
7809 inlibc='echo " "; td=$define; tu=$undef;
7810 sym=$1; var=$2; eval "was=\$$2";
7812 case "$reuseval$was" in
7822 echo "$sym() found." >&4;
7823 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
7825 echo "$sym() NOT found." >&4;
7826 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
7830 $define) echo "$sym() found." >&4;;
7831 *) echo "$sym() NOT found." >&4;;
7835 : see if dlopen exists
7837 xxx_ccflags="$ccflags"
7839 : with g++ one needs -shared to get is-in-libc to work for dlopen
7840 case "$gccversion" in
7842 *) case "$d_cplusplus" in
7843 "$define") ccflags="$ccflags -shared" ;;
7850 ccflags="$xxx_ccflags"
7852 : see if this is a unistd.h system
7853 set unistd.h i_unistd
7856 : determine which dynamic loading, if any, to compile in
7858 dldir="ext/DynaLoader"
7871 $define) dflt='y' ;;
7874 $define) dflt='y' ;;
7876 : Does a dl_xxx.xs file exist for this operating system
7877 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
7880 rp="Do you wish to use dynamic loading?"
7888 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
7889 dflt="$dldir/dl_${osname}.xs"
7890 elif $test "$d_dlopen" = "$define" ; then
7891 dflt="$dldir/dl_dlopen.xs"
7892 elif $test "$i_dld" = "$define" ; then
7893 dflt="$dldir/dl_dld.xs"
7898 *) dflt="$dldir/$dlsrc"
7901 echo "The following dynamic loading files are available:"
7902 : Can not go over to $dldir because getfile has path hard-coded in.
7903 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
7904 rp="Source file to use for dynamic loading"
7910 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
7914 Some systems may require passing special flags to $cc -c to
7915 compile modules that will be used to create a shared library.
7916 To use no flags, say "none".
7919 case "$cccdlflags" in
7920 '') case "$gccversion" in
7921 '') case "$osname" in
7923 next) dflt='none' ;;
7924 irix*) dflt='-KPIC' ;;
7925 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
7926 sunos) dflt='-pic' ;;
7930 *) case "$osname" in
7931 darwin) dflt='none' ;;
7932 linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
7937 *) dflt="$cccdlflags" ;;
7939 rp="Any special flags to pass to $cc -c to compile shared library modules?"
7942 none) cccdlflags=' ' ;;
7943 *) cccdlflags="$ans" ;;
7948 Some systems use ld to create libraries that can be dynamically loaded,
7949 while other systems (such as those using ELF) use $cc.
7953 : Determine if this is ELF
7955 /* Test for whether ELF binaries are produced */
7967 int i = open("a.out",O_RDONLY);
7970 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
7971 exit(0); /* succeed (yes, it is ELF) */
7976 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
7982 '') if $test $bin_ELF = "$define"; then
7984 You appear to have ELF support. I'll use $cc to build dynamic libraries.
7988 echo "I'll use ld to build dynamic libraries."
7996 rp="What command should be used to create dynamic libraries?"
8002 Some systems may require passing special flags to $ld to create a
8003 library that can be dynamically loaded. If your ld flags include
8004 -L/other/path options to locate libraries outside your loader's normal
8005 search path, you may need to specify those -L options here as well. To
8006 use no flags, say "none".
8009 case "$lddlflags" in
8010 '') case "$osname" in
8011 haiku) dflt='-shared' ;;
8013 case "$gccversion" in
8014 '') dflt="$dflt +vnocompatwarnings" ;;
8017 linux|irix*|gnu*) dflt="-shared $optimize" ;;
8018 next) dflt='none' ;;
8019 solaris) dflt='-G' ;;
8020 sunos) dflt='-assert nodefinitions' ;;
8021 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
8025 *) dflt="$lddlflags" ;;
8028 : Try to guess additional flags to pick up local libraries.
8029 : Be careful not to append to a plain 'none'
8033 for thisflag in $ldflags; do
8038 *) dflt="$dflt $thisflag" ;;
8045 ''|' ') dflt='none' ;;
8049 *-fstack-protector*)
8051 *-fstack-protector*) ;; # Don't add it again
8052 *) dflt="$dflt -fstack-protector" ;;
8058 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
8061 none) lddlflags=' ' ;;
8062 *) lddlflags="$ans" ;;
8067 Some systems may require passing special flags to $cc to indicate that
8068 the resulting executable will use dynamic linking. To use no flags,
8072 case "$ccdlflags" in
8073 '') case "$osname" in
8074 linux|hpux|gnu*) dflt='-Wl,-E' ;;
8075 next|sunos) dflt='none' ;;
8079 *) dflt="$ccdlflags" ;;
8081 rp="Any special flags to pass to $cc to use dynamic linking?"
8084 none) ccdlflags=' ' ;;
8085 *) ccdlflags="$ans" ;;
8096 ld_can_script="$undef"
8097 case "$bin_ELF$usedl" in
8099 # Abuse try.h and a.out names for neat cleanup
8111 if $cc $cccdlflags $ccdlflags $ccflags \
8112 $ldflags $lddlflags -o a.out try.c \
8113 -Wl,--version-script=try.h >/dev/null 2>&1 \
8114 && $test -s a.out ; then
8115 echo "ld supports scripting" >&4
8116 ld_can_script="$define"
8118 echo "ld does not support scripting" >&4
8124 : Do we want a shared libperl?
8128 # No dynamic loading being used, so don't bother even to prompt.
8131 *) case "$useshrplib" in
8132 '') case "$osname" in
8133 svr4*|nonstopux|dgux|dynixptx|esix|powerux|haiku|cygwin*)
8135 also='Building a shared libperl is required for dynamic loading to work on your system.'
8140 also='Building a shared libperl is needed for MAB support.'
8158 The perl executable is normally obtained by linking perlmain.c with
8159 libperl${_a}, any static extensions (usually just DynaLoader), and
8160 any other libraries needed on this system (such as -lm, etc.). Since
8161 your system supports dynamic loading, it is probably possible to build
8162 a shared libperl.$so. If you will have more than one executable linked
8163 to libperl.$so, this will significantly reduce the size of each
8164 executable, but it may have a noticeable effect on performance. The
8165 default is probably sensible for your system.
8169 rp="Build a shared libperl.$so (y/n)"
8173 useshrplib='true' ;;
8174 *) useshrplib='false' ;;
8179 case "$useshrplib" in
8181 case "$userelocatableinc" in
8183 echo "Cannot build with both -Duserelocatableinc and -Duseshrplib" >&4
8184 echo "See INSTALL for an explanation why that won't work." >&4
8190 # Figure out a good name for libperl.so. Since it gets stored in
8191 # a version-specific architecture-dependent library, the version
8192 # number isn't really that important, except for making cc/ld happy.
8194 # A name such as libperl.so.10.1
8195 majmin="libperl.$so.$patchlevel.$subversion"
8196 # A name such as libperl.so.100
8197 majonly=`echo $patchlevel $subversion |
8198 $awk '{printf "%d%02d", $1, $2}'`
8199 majonly=libperl.$so.$majonly
8200 # I'd prefer to keep the os-specific stuff here to a minimum, and
8201 # rely on figuring it out from the naming of libc.
8202 case "${osname}${osvers}" in
8205 # XXX How handle the --version stuff for MAB?
8207 linux*|gnu*) # ld won't link with a bare -lperl otherwise.
8210 cygwin*) # ld links now against the dll directly
8211 majmin="cygperl5_${patchlevel}_${subversion}.${so}"
8212 majonly=`echo $patchlevel $subversion |
8213 $awk '{printf "%03d%03d", $1, $2}'`
8214 majonly=cygperl5.$majonly.$so
8217 *) # Try to guess based on whether libc has major.minor.
8219 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8220 *libc.$so.[0-9]*) dflt=$majonly ;;
8221 *) dflt=libperl.$so ;;
8231 I need to select a good name for the shared libperl. If your system uses
8232 library names with major and minor numbers, then you might want something
8233 like $majmin. Alternatively, if your system uses a single version
8234 number for shared libraries, then you might want to use $majonly.
8235 Or, your system might be quite happy with a simple libperl.$so.
8237 Since the shared libperl will get installed into a version-specific
8238 architecture-dependent directory, the version number of the shared perl
8239 library probably isn't important, so the default should be o.k.
8242 rp='What name do you want to give to the shared libperl?'
8245 echo "Ok, I'll use $libperl"
8248 libperl="libperl${_a}"
8252 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8256 WARNING: Use of the shrpdir variable for the installation location of
8257 the shared $libperl is not supported. It was never documented and
8258 will not work in this version. Let me (perlbug@perl.org)
8259 know of any problems this may cause.
8265 But your current setting of $shrpdir is
8266 the default anyway, so it's harmless.
8271 Further, your current attempted setting of $shrpdir
8272 conflicts with the value of $archlibexp/CORE
8273 that installperl will use.
8280 # How will the perl executable find the installed shared $libperl?
8281 # Add $xxx to ccdlflags.
8282 # If we can't figure out a command-line option, use $shrpenv to
8283 # set env LD_RUN_PATH. The main perl makefile uses this.
8284 shrpdir=$archlibexp/CORE
8287 if "$useshrplib"; then
8290 # We'll set it in Makefile.SH...
8295 freebsd|mirbsd|netbsd|openbsd|interix|dragonfly)
8296 xxx="-Wl,-R$shrpdir"
8298 bsdos|linux|irix*|dec_osf|gnu*)
8299 xxx="-Wl,-rpath,$shrpdir"
8302 # next doesn't like the default...
8305 # Haiku doesn't like the default, either.
8308 # hpux doesn't like the default, either.
8309 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8312 # cygwin needs only ldlibpth
8315 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8321 # Only add $xxx if it isn't already in ccdlflags.
8322 case " $ccdlflags " in
8324 *) ccdlflags="$ccdlflags $xxx"
8327 Adding $xxx to the flags
8328 passed to $ld so that the perl executable will find the
8329 installed shared $libperl.
8337 # Fix ccdlflags in AIX for building external extensions.
8338 # (For building Perl itself bare -bE:perl.exp is needed,
8339 # Makefile.SH takes care of this.)
8341 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8343 # Respect a hint or command-line value.
8345 '') shrpenv="$tmp_shrpenv" ;;
8347 case "$ldlibpthname" in
8348 '') ldlibpthname=LD_LIBRARY_PATH ;;
8349 none) ldlibpthname='' ;;
8352 : determine where manual pages are on this system
8356 syspath='/usr/share/man/man1 /usr/man/man1'
8357 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8358 syspath="$syspath /usr/man/u_man/man1"
8359 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8360 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8361 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8362 sysman=`./loc . /usr/man/man1 $syspath`
8365 if $test -d "$sysman"; then
8366 echo "System manual is in $sysman." >&4
8368 echo "Could not find manual pages in source form." >&4
8371 : determine where manual pages go
8372 set man1dir man1dir none
8376 $spackage has manual pages available in source form.
8380 echo "However, you don't have nroff, so they're probably useless to you."
8382 '') man1dir="none";;
8385 echo "If you don't want the manual sources installed, answer 'none'."
8390 lookpath="$prefixexp/share/man/man1"
8391 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8392 lookpath="$lookpath $prefixexp/man/p_man/man1"
8393 lookpath="$lookpath $prefixexp/man/u_man/man1"
8394 lookpath="$lookpath $prefixexp/man/man.1"
8396 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8397 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8407 rp="Where do the main $spackage manual pages (source) go?"
8409 if $test "X$man1direxp" != "X$ansexp"; then
8420 : What suffix to use on installed man pages
8427 rp="What suffix should be used for the main $spackage man pages?"
8429 '') case "$man1dir" in
8443 *) dflt="$man1ext";;
8450 : see if we can have long filenames
8452 first=123456789abcdef
8454 if (echo hi >$first) 2>/dev/null; then
8455 if $test -f 123456789abcde; then
8456 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8459 echo 'You can have filenames longer than 14 characters.'>&4
8464 You can't have filenames longer than 14 chars.
8465 You can't even think about them!
8471 $rm -rf 123456789abcde*
8473 : determine where library module manual pages go
8474 set man3dir man3dir none
8478 $spackage has manual pages for many of the library modules.
8484 However, you don't have nroff, so they're probably useless to you.
8487 '') man3dir="none";;
8491 case "$d_flexfnam" in
8494 However, your system can't handle the long file names like File::Basename.3.
8497 '') man3dir="none";;
8501 echo "If you don't want the manual sources installed, answer 'none'."
8502 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8504 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8505 if $test -d "$privlib/man/man3"; then
8508 WARNING: Previous versions of perl installed man3 pages into
8509 $privlib/man/man3. This version will suggest a
8510 new default of $dflt.
8514 rp='Do you wish to preserve the old behavior?(y/n)'
8517 y*) dflt="$privlib/man/man3" ;;
8522 *) dflt="$man3dir" ;;
8529 rp="Where do the $package library man pages (source) go?"
8539 : What suffix to use on installed man pages
8545 rp="What suffix should be used for the $package library man pages?"
8547 '') case "$man3dir" in
8561 *) dflt="$man3ext";;
8568 : see if we have to deal with yellow pages, now NIS.
8569 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8570 if $test -f /usr/etc/nibindd; then
8572 echo "I'm fairly confident you're on a NeXT."
8574 rp='Do you get the hosts file via NetInfo?'
8583 y*) hostcat='nidump hosts .';;
8584 *) case "$hostcat" in
8585 nidump*) hostcat='';;
8595 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8603 rp='Are you getting the hosts file via yellow pages?'
8606 y*) hostcat='ypcat hosts';;
8607 *) hostcat='cat /etc/hosts';;
8613 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8616 '') test -f /etc/group && groupcat='cat /etc/group';;
8619 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8622 : now get the host name
8624 echo "Figuring out host name..." >&4
8625 case "$myhostname" in
8627 echo 'Maybe "hostname" will work...'
8628 if tans=`sh -c hostname 2>&1` ; then
8636 if $test "$cont"; then
8638 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8639 if tans=`cat /etc/systemid 2>&1` ; then
8641 phostname='cat /etc/systemid'
8642 echo "Whadyaknow. Xenix always was a bit strange..."
8645 elif $test -r /etc/systemid; then
8646 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8649 if $test "$cont"; then
8650 echo 'No, maybe "uuname -l" will work...'
8651 if tans=`sh -c 'uuname -l' 2>&1` ; then
8653 phostname='uuname -l'
8655 echo 'Strange. Maybe "uname -n" will work...'
8656 if tans=`sh -c 'uname -n' 2>&1` ; then
8658 phostname='uname -n'
8660 echo 'Oh well, maybe I can mine it out of whoami.h...'
8661 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8662 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8663 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8665 case "$myhostname" in
8666 '') echo "Does this machine have an identity crisis or something?"
8669 echo "Well, you said $myhostname before..."
8670 phostname='echo $myhostname';;
8676 case "$myhostname" in
8677 '') myhostname=noname ;;
8679 : you do not want to know about this
8684 if $test "$myhostname" ; then
8686 rp='Your host name appears to be "'$myhostname'".'" Right?"
8694 : bad guess or no guess
8695 while $test "X$myhostname" = X ; do
8697 rp="Please type the (one word) name of your host:"
8702 : translate upper to lower if necessary
8703 case "$myhostname" in
8705 echo "(Normalizing case in your host name)"
8706 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8710 case "$myhostname" in
8712 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8713 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8714 echo "(Trimming domain name from host name--host name is now $myhostname)"
8716 *) case "$mydomain" in
8719 test "X$hostcat" = "Xypcat hosts" &&
8720 ypmatch "$myhostname" hosts 2>/dev/null |\
8721 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8724 test "X$hostcat" != "X" &&
8725 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8726 /[ ]$myhostname[ . ]/p" > hosts
8729 if $test -f hosts; then
8730 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8731 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8732 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8733 hosts | $sort | $uniq | \
8734 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8735 case `$echo X$dflt` in
8736 X*\ *) echo "(Several hosts in the database matched hostname)"
8739 X.) echo "(You do not have fully-qualified names in the hosts database)"
8743 echo "(I cannot locate a hosts database anywhere)"
8748 tans=`./loc resolv.conf X /etc /usr/etc`
8749 if $test -f "$tans"; then
8750 echo "(Attempting domain name extraction from $tans)"
8751 dflt=.`$sed -n -e 's/ / /g' \
8752 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8755 .) dflt=.`$sed -n -e 's/ / /g' \
8756 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8764 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8765 dflt=.`sh -c domainname 2>/dev/null`
8768 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8772 case "$dflt$osname" in
8773 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
8774 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
8778 .) echo "(Lost all hope -- silly guess then)"
8784 *) dflt="$mydomain";;
8788 rp="What is your domain name?"
8798 : translate upper to lower if necessary
8801 echo "(Normalizing case in your domain name)"
8802 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
8806 : a little sanity check here
8807 case "$phostname" in
8810 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
8811 $myhostname$mydomain|$myhostname) ;;
8813 case "$phostname" in
8815 echo "(That doesn't agree with your whoami.h file, by the way.)"
8818 echo "(That doesn't agree with your $phostname command, by the way.)"
8826 : determine the e-mail address of the user who is running us
8829 I need to get your e-mail address in Internet format if possible, i.e.
8830 something like user@host.domain. Please answer accurately since I have
8831 no easy means to double check it. The default value provided below
8832 is most probably close to reality but may not be valid from outside
8833 your organization...
8837 while test "$cont"; do
8839 '') dflt="$cf_by@$myhostname$mydomain";;
8840 *) dflt="$cf_email";;
8842 rp='What is your e-mail address?'
8848 rp='Address does not look like an Internet one. Use it anyway?'
8862 : Ask e-mail of administrator
8865 If you or somebody else will be maintaining perl at your site, please
8866 fill in the correct e-mail address here so that they may be contacted
8867 if necessary. Currently, the "perlbug" program included with perl
8868 will send mail to this address in addition to perlbug@perl.org. You may
8869 enter "none" for no administrator.
8872 case "$perladmin" in
8873 '') dflt="$cf_email";;
8874 *) dflt="$perladmin";;
8876 rp='Perl administrator e-mail address'
8880 : determine whether to only install version-specific parts.
8883 Do you want to install only the version-specific parts of the perl
8884 distribution? Usually you do *not* want to do this.
8886 case "$versiononly" in
8887 "$define"|[Yy]*|true) dflt='y' ;;
8890 rp="Do you want to install only the version-specific parts of perl?"
8893 [yY]*) val="$define";;
8899 case "$versiononly" in
8900 "$define") inc_version_list=''
8901 inc_version_list_init=0
8905 : figure out how to guarantee perl startup
8906 : XXX Note that this currently takes advantage of the bug that binexp ignores
8907 : the Configure -Dinstallprefix setting, which in turn means that under
8908 : relocatable @INC, initialinstalllocation is what binexp started as.
8909 case "$startperl" in
8911 case "$sharpbang" in
8915 I can use the #! construct to start perl on your system. This will
8916 make startup of perl scripts faster, but may cause problems if you
8917 want to share those scripts and perl is not in a standard place
8918 ($initialinstalllocation/perl) on all your platforms. The alternative
8919 is to force a shell by starting the script with a single ':' character.
8922 case "$versiononly" in
8923 "$define") dflt="$initialinstalllocation/perl$version";;
8924 *) dflt="$initialinstalllocation/perl";;
8926 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
8929 none) startperl=": # use perl";;
8930 *) startperl="#!$ans"
8931 if $test 30 -lt `echo "$ans" | wc -c`; then
8934 WARNING: Some systems limit the #! command to 32 characters.
8935 If you experience difficulty running Perl scripts with #!, try
8936 installing Perl in a directory with a shorter pathname.
8942 *) startperl=": # use perl"
8947 echo "I'll use $startperl to start perl scripts."
8949 : figure best path for perl in scripts
8952 case "$versiononly" in
8953 "$define") perlpath="$initialinstalllocation/perl$version";;
8954 *) perlpath="$initialinstalllocation/perl";;
8956 case "$startperl" in
8961 I will use the "eval 'exec'" idiom to start Perl on your system.
8962 I can use the full path of your Perl binary for this purpose, but
8963 doing so may cause problems if you want to share those scripts and
8964 Perl is not always in a standard place ($initialinstalllocation/perl).
8967 dflt="$initialinstalllocation/perl"
8968 rp="What path shall I use in \"eval 'exec'\"?"
8975 case "$startperl" in
8977 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
8980 : determine where public executable scripts go
8981 set scriptdir scriptdir
8983 case "$scriptdir" in
8986 : guess some guesses
8987 $test -d /usr/share/scripts && dflt=/usr/share/scripts
8988 $test -d /usr/share/bin && dflt=/usr/share/bin
8989 $test -d /usr/local/script && dflt=/usr/local/script
8990 $test -d /usr/local/scripts && dflt=/usr/local/scripts
8991 $test -d $prefixexp/script && dflt=$prefixexp/script
8995 *) dflt="$scriptdir"
9000 Some installations have a separate directory just for executable scripts so
9001 that they can mount it across multiple architectures but keep the scripts in
9002 one spot. You might, for example, have a subdirectory of /usr/share for this.
9003 Or you might just lump your scripts in with all your other executables.
9007 rp='Where do you keep publicly executable scripts?'
9009 if $test "X$ansexp" != "X$scriptdirexp"; then
9015 : A little fix up for an irregularly named variable.
9016 installscript="$installscriptdir"
9018 : determine where add-on public executables go
9020 '') dflt=$siteprefix/bin ;;
9024 rp='Pathname where the add-on public executables should be installed?'
9029 : determine where add-on html pages go
9030 : There is no standard location, so try to copy the previously-selected
9031 : directory structure for the core html pages.
9032 case "$sitehtml1dir" in
9033 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9034 *) dflt=$sitehtml1dir ;;
9037 ''|' ') dflt=none ;;
9040 rp='Pathname where the site-specific html pages should be installed?'
9042 prefixvar=sitehtml1dir
9045 : determine where add-on library html pages go
9046 : There is no standard location, so try to copy the previously-selected
9047 : directory structure for the core html pages.
9048 case "$sitehtml3dir" in
9049 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9050 *) dflt=$sitehtml3dir ;;
9053 ''|' ') dflt=none ;;
9056 rp='Pathname where the site-specific library html pages should be installed?'
9058 prefixvar=sitehtml3dir
9061 : determine where add-on manual pages go
9062 case "$siteman1dir" in
9063 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
9064 *) dflt=$siteman1dir ;;
9067 ''|' ') dflt=none ;;
9070 rp='Pathname where the site-specific manual pages should be installed?'
9072 prefixvar=siteman1dir
9075 : determine where add-on library man pages go
9076 case "$siteman3dir" in
9077 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
9078 *) dflt=$siteman3dir ;;
9081 ''|' ') dflt=none ;;
9084 rp='Pathname where the site-specific library manual pages should be installed?'
9086 prefixvar=siteman3dir
9089 : determine where add-on public executable scripts go
9090 case "$sitescript" in
9091 '') dflt=$siteprefix/script
9092 $test -d $dflt || dflt=$sitebin ;;
9093 *) dflt="$sitescript" ;;
9096 rp='Pathname where add-on public executable scripts should be installed?'
9098 prefixvar=sitescript
9101 : Check if faststdio is requested and available
9102 case "$usefaststdio" in
9103 $define|true|[yY]*|'')
9104 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
9114 Perl can be built to use 'fast stdio', which means using the stdio
9115 library but also directly manipulating the stdio buffers to enable
9116 faster I/O. Using stdio is better for backward compatibility (especially
9117 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
9118 interface has been preferred instead of stdio.
9120 If this doesn't make any sense to you, just accept the default '$dflt'.
9122 rp='Use the "fast stdio" if available?'
9125 y|Y) val="$define" ;;
9132 : define an is-a-typedef? function
9133 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9135 "") inclist="sys/types.h";;
9137 eval "varval=\$$var";
9141 for inc in $inclist; do
9142 echo "#include <$inc>" >>temp.c;
9144 echo "#ifdef $type" >> temp.c;
9145 echo "printf(\"We have $type\");" >> temp.c;
9146 echo "#endif" >> temp.c;
9147 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9148 if $contains $type temp.E >/dev/null 2>&1; then
9154 *) eval "$var=\$varval";;
9157 : define an is-a-typedef? function that prompts if the type is not available.
9158 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9160 "") inclist="sys/types.h";;
9162 eval "varval=\$$var";
9166 for inc in $inclist; do
9167 echo "#include <$inc>" >>temp.c;
9169 echo "#ifdef $type" >> temp.c;
9170 echo "printf(\"We have $type\");" >> temp.c;
9171 echo "#endif" >> temp.c;
9172 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9174 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
9175 if $contains $type temp.E >/dev/null 2>&1; then
9176 echo "$type found." >&4;
9179 echo "$type NOT found." >&4;
9185 *) eval "$var=\$varval";;
9188 : see what type lseek is declared as in the kernel
9189 rp="What is the type used for lseek's offset on this system?"
9190 set off_t lseektype long stdio.h sys/types.h
9194 echo "Checking to see how big your file offsets are..." >&4
9196 #include <sys/types.h>
9200 printf("%d\n", (int)sizeof($lseektype));
9205 if eval $compile_ok; then
9206 lseeksize=`$run ./try`
9207 echo "Your file offsets are $lseeksize bytes long."
9211 echo "(I can't seem to compile the test program. Guessing...)"
9212 rp="What is the size of your file offsets (in bytes)?"
9218 : see what type file positions are declared as in the library
9219 rp="What is the type for file position used by fsetpos()?"
9220 set fpos_t fpostype long stdio.h sys/types.h
9223 : Check size for Fpos_t
9226 *_t) zzz="$fpostype" ;;
9229 echo "Checking the size of $zzz..." >&4
9231 #include <sys/types.h>
9238 printf("%d\n", (int)sizeof($fpostype));
9243 if eval $compile_ok; then
9247 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9250 echo "Your $zzz is $fpossize bytes long."
9256 echo "(I can't compile the test program. Guessing...)" >&4
9257 rp="What is the size of your file positions (in bytes)?"
9262 : Check for large file support
9263 # Backward compatibility (uselfs is deprecated).
9265 "$define"|true|[yY]*)
9268 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9270 uselargefiles="$define"
9274 case "$lseeksize:$fpossize" in
9277 You can have files larger than 2 gigabytes.
9280 *) case "$uselargefiles" in
9281 "$undef"|false|[nN]*) dflt='n' ;;
9286 Perl can be built to understand large files (files larger than 2 gigabytes)
9287 on some systems. To do so, Configure can be run with -Duselargefiles.
9289 If this doesn't make any sense to you, just accept the default '$dflt'.
9291 rp='Try to understand large files, if available?'
9294 y|Y) val="$define" ;;
9301 : Look for a hint-file generated 'call-back-unit'. If the
9302 : user has specified that a large files perl is to be built,
9303 : we may need to set or change some other defaults.
9304 if $test -f uselargefiles.cbu; then
9305 echo "Your platform has some specific hints regarding large file builds, using them..."
9306 . ./uselargefiles.cbu
9308 case "$uselargefiles" in
9310 if $test -f uselargefiles.cbu; then
9312 echo "Rechecking to see how big your file offsets are..." >&4
9314 #include <sys/types.h>
9318 printf("%d\n", (int)sizeof($lseektype));
9323 if eval $compile_ok; then
9324 lseeksize=`$run ./try`
9325 $echo "Your file offsets are now $lseeksize bytes long."
9329 echo "(I can't seem to compile the test program. Guessing...)"
9330 rp="What is the size of your file offsets (in bytes)?"
9335 *_t) zzz="$fpostype" ;;
9338 $echo $n "Rechecking the size of $zzz...$c" >&4
9340 #include <sys/types.h>
9347 printf("%d\n", (int)sizeof($fpostype));
9352 if eval $compile_ok; then
9357 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9360 echo " $fpossize bytes." >&4
9366 echo "(I can't compile the test program. Guessing...)" >&4
9367 rp="What is the size of your file positions (in bytes)?"
9376 : Check if we want perlio
9379 : Set the vendorbin variables
9380 case "$vendorprefix" in
9381 '') d_vendorbin="$undef"
9385 *) d_vendorbin="$define"
9386 : determine where vendor-supplied executables go.
9387 case "$vendorbin" in
9388 '') dflt=$vendorprefix/bin ;;
9389 *) dflt="$vendorbin" ;;
9392 rp='Pathname for the vendor-supplied executables directory?'
9395 vendorbinexp="$ansexp"
9401 : Set the vendorhtml1dir variables
9402 case "$vendorprefix" in
9403 '') vendorhtml1dir=''
9404 vendorhtml1direxp=''
9406 *) : determine where vendor-supplied html pages go.
9407 : There is no standard location, so try to copy the previously-selected
9408 : directory structure for the core html pages.
9409 : XXX Better default suggestions would be welcome.
9410 case "$vendorhtml1dir" in
9411 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9412 *) dflt=$vendorhtml1dir ;;
9415 ''|' ') dflt=none ;;
9418 rp='Pathname for the vendor-supplied html pages?'
9420 vendorhtml1dir="$ans"
9421 vendorhtml1direxp="$ansexp"
9424 : Use ' ' for none so value is preserved next time through Configure
9425 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9426 prefixvar=vendorhtml1dir
9429 : Set the vendorhtml3dir variables
9430 case "$vendorprefix" in
9431 '') vendorhtml3dir=''
9432 vendorhtml3direxp=''
9434 *) : determine where vendor-supplied module html pages go.
9435 : There is no standard location, so try to copy the previously-selected
9436 : directory structure for the core html pages.
9437 : XXX Better default suggestions would be welcome.
9438 case "$vendorhtml3dir" in
9439 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9440 *) dflt=$vendorhtml3dir ;;
9443 ''|' ') dflt=none ;;
9446 rp='Pathname for the vendor-supplied html pages?'
9448 vendorhtml3dir="$ans"
9449 vendorhtml3direxp="$ansexp"
9452 : Use ' ' for none so value is preserved next time through Configure
9453 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9454 prefixvar=vendorhtml3dir
9457 : Set the vendorman1dir variables
9458 case "$vendorprefix" in
9459 '') vendorman1dir=''
9462 *) : determine where vendor-supplied manual pages go.
9463 case "$vendorman1dir" in
9464 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9465 *) dflt=$vendorman1dir ;;
9468 ''|' ') dflt=none ;;
9471 rp='Pathname for the vendor-supplied manual section 1 pages?'
9473 vendorman1dir="$ans"
9474 vendorman1direxp="$ansexp"
9477 : Use ' ' for none so value is preserved next time through Configure
9478 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9479 prefixvar=vendorman1dir
9482 : Set the vendorman3dir variables
9483 case "$vendorprefix" in
9484 '') vendorman3dir=''
9487 *) : determine where vendor-supplied module manual pages go.
9488 case "$vendorman3dir" in
9489 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9490 *) dflt=$vendorman3dir ;;
9493 ''|' ') dflt=none ;;
9496 rp='Pathname for the vendor-supplied manual section 3 pages?'
9498 vendorman3dir="$ans"
9499 vendorman3direxp="$ansexp"
9502 : Use ' ' for none so value is preserved next time through Configure
9503 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9504 prefixvar=vendorman3dir
9507 : Set the vendorscript variables
9508 case "$vendorprefix" in
9509 '') d_vendorscript="$undef"
9513 *) d_vendorscript="$define"
9514 : determine where vendor-supplied scripts go.
9515 case "$vendorscript" in
9516 '') dflt=$vendorprefix/script
9517 $test -d $dflt || dflt=$vendorbin ;;
9518 *) dflt="$vendorscript" ;;
9522 The installation process will create a directory for
9523 vendor-supplied scripts.
9527 rp='Pathname for the vendor-supplied scripts directory?'
9530 vendorscriptexp="$ansexp"
9533 prefixvar=vendorscript
9536 : script used to emit important warnings
9539 if test \$# -gt 0; then
9544 echo "*** WARNING:" >&4
9545 sed -e 's/^/*** /' <msg >&4
9547 cat msg >>config.msg
9548 echo " " >>config.msg
9554 : see which of string.h or strings.h is needed
9556 strings=`./findhdr string.h`
9557 if $test "$strings" && $test -r "$strings"; then
9558 echo "Using <string.h> instead of <strings.h>." >&4
9562 strings=`./findhdr strings.h`
9563 if $test "$strings" && $test -r "$strings"; then
9564 echo "Using <strings.h> instead of <string.h>." >&4
9566 ./warn "No string header found -- You'll surely have problems."
9572 "$undef") strings=`./findhdr strings.h`;;
9573 *) strings=`./findhdr string.h`;;
9576 : see if qgcvt exists
9580 : Check print/scan long double stuff
9583 if $test X"$d_longdbl" = X"$define"; then
9585 echo "Checking how to print long doubles..." >&4
9587 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
9588 $cat >try.c <<'EOCP'
9589 #include <sys/types.h>
9593 printf("%.3f\n", d);
9597 if eval $compile; then
9601 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
9602 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
9603 echo "We will use %f."
9609 if $test X"$sPRIfldbl" = X; then
9610 $cat >try.c <<'EOCP'
9611 #include <sys/types.h>
9614 long double d = 123.456;
9615 printf("%.3Lf\n", d);
9619 if eval $compile; then
9623 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
9624 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
9625 echo "We will use %Lf."
9631 if $test X"$sPRIfldbl" = X; then
9632 $cat >try.c <<'EOCP'
9633 #include <sys/types.h>
9636 long double d = 123.456;
9637 printf("%.3llf\n", d);
9641 if eval $compile; then
9645 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
9646 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
9647 echo "We will use %llf."
9653 if $test X"$sPRIfldbl" = X; then
9654 $cat >try.c <<'EOCP'
9655 #include <sys/types.h>
9658 long double d = 123.456;
9659 printf("%.3lf\n", d);
9663 if eval $compile; then
9667 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
9668 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
9669 echo "We will use %lf."
9675 if $test X"$sPRIfldbl" = X; then
9676 echo "Cannot figure out how to print long doubles." >&4
9678 sSCNfldbl=$sPRIfldbl # expect consistency
9685 case "$sPRIfldbl" in
9686 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
9687 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
9688 d_SCNfldbl="$undef";
9690 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
9691 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
9692 d_SCNfldbl="$define";
9696 : Check how to convert floats to strings.
9698 if test "X$d_Gconvert" = X; then
9701 echo "Checking for an efficient way to convert floats to strings."
9703 case "$uselongdouble" in
9704 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
9706 case "$d_longdbl" in
9707 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
9709 case "$d_PRIgldbl" in
9710 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
9714 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
9715 char *myname = "gconvert";
9718 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
9719 char *myname = "gcvt";
9722 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
9723 char *myname = "qgcvt";
9724 #define DOUBLETYPE long double
9727 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9729 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
9731 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
9734 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
9736 char *myname = "sprintf";
9740 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9741 #define DOUBLETYPE long double
9743 #define DOUBLETYPE double
9755 # include <string.h>
9757 # include <strings.h>
9760 int checkit(char *expect, char *got)
9762 if (strcmp(expect, got)) {
9763 printf("%s oddity: Expected %s, got %s\n",
9764 myname, expect, got);
9774 /* This must be 1st test on (which?) platform */
9775 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
9776 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
9777 checkit("0.1", buf);
9779 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
9780 checkit("0.01", buf);
9782 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
9783 checkit("0.001", buf);
9785 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
9786 checkit("0.0001", buf);
9788 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
9789 if (strlen(buf) > 5)
9790 checkit("9e-005", buf); /* for Microsoft ?? */
9792 checkit("9e-05", buf);
9794 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
9797 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
9798 checkit("1.1", buf);
9800 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
9801 checkit("1.01", buf);
9803 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
9804 checkit("1.001", buf);
9806 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
9807 checkit("1.0001", buf);
9809 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
9810 checkit("1.00001", buf);
9812 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
9813 checkit("1.000001", buf);
9815 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
9818 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
9821 /* Some Linux gcvt's give 1.e+5 here. */
9822 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
9823 checkit("100000", buf);
9825 /* Some Linux gcvt's give -1.e+5 here. */
9826 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
9827 checkit("-100000", buf);
9829 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
9830 checkit("123.456", buf);
9832 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
9833 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
9834 /* 34 should be enough to scare even long double
9835 * places into using the e notation. */
9836 if (strlen(buf) > 5)
9837 checkit("1e+034", buf); /* for Microsoft */
9839 checkit("1e+34", buf);
9841 /* For Perl, if you add additional tests here, also add them to
9842 * t/base/num.t for benefit of platforms not using Configure or
9843 * overriding d_Gconvert */
9848 : first add preferred functions to our list
9850 for xxx_convert in $gconvert_preference; do
9851 case $xxx_convert in
9852 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
9853 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
9856 : then add any others
9857 for xxx_convert in gconvert gcvt sprintf; do
9860 *) xxx_list="$xxx_list $xxx_convert" ;;
9864 case "$d_longdbl$uselongdouble" in
9866 : again, add preferred functions to our list first
9868 for xxx_convert in $gconvert_ld_preference; do
9869 case $xxx_convert in
9870 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9871 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
9874 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
9875 for xxx_convert in qgcvt sprintf $xxx_list; do
9876 case "$xxx_ld_list" in
9877 $xxx_convert*|*" $xxx_convert"*) ;;
9878 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9881 : if sprintf cannot do long doubles, move it to the end
9882 if test "$d_PRIgldbl" != "$define"; then
9883 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
9885 : if no qgcvt, remove it
9886 if test "$d_qgcvt" != "$define"; then
9887 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
9890 xxx_list="$xxx_ld_list"
9894 for xxx_convert in $xxx_list; do
9895 echo "Trying $xxx_convert..."
9896 $rm -f try try$_o core
9897 set try -DTRY_$xxx_convert
9898 if eval $compile; then
9899 echo "$xxx_convert() found." >&4
9901 echo "I'll use $xxx_convert to convert floats into a string." >&4
9904 echo "...But $xxx_convert didn't work as I expected."
9908 echo "$xxx_convert NOT found." >&4
9912 if test X$xxx_convert = X; then
9913 echo "*** WHOA THERE!!! ***" >&4
9914 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
9918 case "$xxx_convert" in
9919 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
9920 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
9921 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
9922 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
9923 "$define$define$define")
9924 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
9925 "$define$define$undef")
9926 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
9927 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
9935 : see if _fwalk exists
9939 : Initialize h_fcntl
9942 : Initialize h_sysfile
9945 : access call always available on UNIX
9949 : locate the flags for 'access()'
9953 $cat >access.c <<EOCP
9954 #include <sys/types.h>
9959 #include <sys/file.h>
9972 : check sys/file.h first, no particular reason here
9973 if $test `./findhdr sys/file.h` && \
9974 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
9976 echo "<sys/file.h> defines the *_OK access constants." >&4
9977 elif $test `./findhdr fcntl.h` && \
9978 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
9980 echo "<fcntl.h> defines the *_OK access constants." >&4
9981 elif $test `./findhdr unistd.h` && \
9982 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
9983 echo "<unistd.h> defines the *_OK access constants." >&4
9985 echo "I can't find the four *_OK access constants--I'll use mine." >&4
9991 : see if accessx exists
9992 set accessx d_accessx
9995 : see if aintl exists
9999 : see if alarm exists
10003 : see if 64bit time functions exists
10005 set ctime64 d_ctime64
10008 set localtime64 d_localtime64
10011 set gmtime64 d_gmtime64
10014 set mktime64 d_mktime64
10017 set difftime64 d_difftime64
10020 set asctime64 d_asctime64
10023 : see if POSIX threads are available
10024 set pthread.h i_pthread
10027 : define a function to check prototypes
10028 $cat > protochk <<EOSH
10031 optimize="$optimize"
10033 prototype="$prototype"
10036 usethreads=$usethreads
10037 i_pthread=$i_pthread
10038 pthread_h_first=$pthread_h_first
10041 $cat >> protochk <<'EOSH'
10046 while test $# -ge 2; do
10048 $define) echo "#include <$2>" >> try.c ;;
10049 literal) echo "$2" >> try.c ;;
10051 # Extra magic for the benefit of systems that need pthread.h
10052 # to be included early to correctly detect threadsafe functions.
10053 # Such functions must guarantee themselves, though, that the usethreads
10054 # and i_pthread have been defined, before calling protochk.
10055 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
10056 echo "#include <pthread.h>" >> try.c
10061 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
10062 cat >> try.c <<'EOCP'
10063 #ifdef CAN_PROTOTYPE
10064 #define _(args) args
10069 echo "$foo" >> try.c
10070 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
10071 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
10077 $eunicefix protochk
10079 : Define hasproto macro for Configure internal use
10080 hasproto='varname=$1; func=$2; shift; shift;
10081 while $test $# -ge 2; do
10083 $define) echo "#include <$2>";;
10087 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
10088 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
10089 echo "$func() prototype found.";
10092 echo "$func() prototype NOT found.";
10099 : see if sys/types.h has to be included
10100 set sys/types.h i_systypes
10103 : see if sys/select.h has to be included
10104 set sys/select.h i_sysselct
10107 : Define hasfield macro for Configure internal use
10108 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
10109 while $test $# -ge 2; do
10111 $define) echo "#include <$2>";;
10115 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
10117 if eval $compile; then
10126 : see if we should include time.h, sys/time.h, or both
10128 if test "X$timeincl" = X; then
10129 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
10130 $echo $n "I'm now running the test program...$c"
10132 #include <sys/types.h>
10137 #ifdef SYSTIMEKERNEL
10140 #include <sys/time.h>
10143 #include <sys/select.h>
10145 #$i_stdlib I_STDLIB
10147 #include <stdlib.h>
10153 struct timeval bar;
10156 struct timezone tzp;
10158 if (foo.tm_sec == foo.tm_sec)
10161 if (bar.tv_sec == bar.tv_sec)
10168 for s_timezone in '-DS_TIMEZONE' ''; do
10170 for s_timeval in '-DS_TIMEVAL' ''; do
10171 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10172 for i_time in '' '-DI_TIME'; do
10173 for i_systime in '-DI_SYSTIME' ''; do
10176 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10177 if eval $compile; then
10178 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
10182 $echo $n "Succeeded with $flags$c"
10194 *SYSTIMEKERNEL*) i_systimek="$define"
10195 timeincl=`./findhdr sys/time.h`
10196 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10197 *) i_systimek="$undef";;
10200 *I_TIME*) i_time="$define"
10201 timeincl=`./findhdr time.h`" $timeincl"
10202 echo "We'll include <time.h>." >&4;;
10203 *) i_time="$undef";;
10206 *I_SYSTIME*) i_systime="$define"
10207 timeincl=`./findhdr sys/time.h`" $timeincl"
10208 echo "We'll include <sys/time.h>." >&4;;
10209 *) i_systime="$undef";;
10213 : see if struct tm knows about tm_zone
10214 case "$i_systime$i_time" in
10217 echo "Checking to see if your struct tm has tm_zone field..." >&4
10218 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
10226 case "$d_tm_tm_zone" in
10227 "$define") echo "Yes, it does." ;;
10228 *) echo "No, it doesn't." ;;
10230 : see if struct tm knows about tm_gmtoff
10231 case "$i_systime$i_time" in
10234 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
10235 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
10243 case "$d_tm_tm_gmtoff" in
10244 "$define") echo "Yes, it does." ;;
10245 *) echo "No, it doesn't." ;;
10248 : see if asctime_r exists
10249 set asctime_r d_asctime_r
10251 case "$d_asctime_r" in
10253 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10254 case "$d_asctime_r_proto:$usethreads" in
10255 ":define") d_asctime_r_proto=define
10256 set d_asctime_r_proto asctime_r $hdrs
10260 case "$d_asctime_r_proto" in
10262 case "$asctime_r_proto" in
10263 ''|0) try='char* asctime_r(const struct tm*, char*);'
10264 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SB ;;
10266 case "$asctime_r_proto" in
10267 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
10268 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SBI ;;
10270 case "$asctime_r_proto" in
10271 ''|0) try='int asctime_r(const struct tm*, char*);'
10272 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SB ;;
10274 case "$asctime_r_proto" in
10275 ''|0) try='int asctime_r(const struct tm*, char*, int);'
10276 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SBI ;;
10278 case "$asctime_r_proto" in
10279 ''|0) d_asctime_r=undef
10281 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
10282 * ) case "$asctime_r_proto" in
10283 REENTRANT_PROTO*) ;;
10284 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
10286 echo "Prototype: $try" ;;
10289 *) case "$usethreads" in
10290 define) echo "asctime_r has no prototype, not using it." >&4 ;;
10297 *) asctime_r_proto=0
10301 : see if atolf exists
10305 : see if atoll exists
10309 : Look for GCC-style attribute format
10310 case "$d_attribute_format" in
10313 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
10314 $cat >attrib.c <<'EOCP'
10316 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
10318 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10319 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10320 echo "Your C compiler doesn't support __attribute__((format))."
10323 echo "Your C compiler supports __attribute__((format))."
10327 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10331 *) val="$d_attribute_format" ;;
10333 set d_attribute_format
10337 : Look for GCC-style attribute format with null format allowed
10338 case "$d_printf_format_null" in
10339 '') case "$d_attribute_format" in
10342 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
10343 $cat >attrib.c <<EOCP
10345 #$i_stdlib I_STDLIB
10347 #include <stdlib.h>
10349 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
10350 int null_printf (char* pat,...) { return (int)pat; }
10351 int main () { exit(null_printf(NULL)); }
10353 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
10354 : run the executable in case it produces a run-time warning
10355 if $run ./attrib >>attrib.out 2>&1; then
10356 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10357 echo "Your C compiler doesn't allow __printf__ format to be null."
10360 echo "Your C compiler allows __printf__ format to be null."
10364 echo "Your C compiler executable failed with __printf__ format null."
10368 echo "Your C compiler fails with __printf__ format null."
10375 *) val="$d_printf_format_null" ;;
10377 set d_printf_format_null
10381 : Look for GCC-style attribute malloc
10382 case "$d_attribute_malloc" in
10385 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
10386 $cat >attrib.c <<'EOCP'
10388 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
10390 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10391 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10392 echo "Your C compiler doesn't support __attribute__((malloc))."
10395 echo "Your C compiler supports __attribute__((malloc))."
10399 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10403 *) val="$d_attribute_malloc" ;;
10405 set d_attribute_malloc
10409 : Look for GCC-style attribute nonnull
10410 case "$d_attribute_nonnull" in
10413 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
10414 $cat >attrib.c <<'EOCP'
10416 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
10418 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10419 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10420 echo "Your C compiler doesn't support __attribute__((nonnull))."
10423 echo "Your C compiler supports __attribute__((nonnull))."
10427 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10431 *) val="$d_attribute_nonnull" ;;
10433 set d_attribute_nonnull
10437 : Look for GCC-style attribute noreturn
10438 case "$d_attribute_noreturn" in
10441 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
10442 $cat >attrib.c <<'EOCP'
10444 void fall_over_dead( void ) __attribute__((noreturn));
10446 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10447 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10448 echo "Your C compiler doesn't support __attribute__((noreturn))."
10451 echo "Your C compiler supports __attribute__((noreturn))."
10455 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10459 *) val="$d_attribute_noreturn" ;;
10461 set d_attribute_noreturn
10465 : Look for GCC-style attribute pure
10466 case "$d_attribute_pure" in
10469 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
10470 $cat >attrib.c <<'EOCP'
10472 int square( int n ) __attribute__((pure));
10474 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10475 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10476 echo "Your C compiler doesn't support __attribute__((pure))."
10479 echo "Your C compiler supports __attribute__((pure))."
10483 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10487 *) val="$d_attribute_pure" ;;
10489 set d_attribute_pure
10493 : Look for GCC-style attribute unused
10494 case "$d_attribute_unused" in
10497 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
10498 $cat >attrib.c <<'EOCP'
10500 int do_something( int dummy __attribute__((unused)), int n );
10502 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10503 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10504 echo "Your C compiler doesn't support __attribute__((unused))."
10507 echo "Your C compiler supports __attribute__((unused))."
10511 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10515 *) val="$d_attribute_unused" ;;
10517 set d_attribute_unused
10521 : Look for GCC-style attribute deprecated
10522 case "$d_attribute_deprecated" in
10525 echo "Checking whether your compiler can handle __attribute__((deprecated)) ..." >&4
10526 $cat >attrib.c <<'EOCP'
10528 int I_am_deprecated(void) __attribute__((deprecated));
10530 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10531 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10532 echo "Your C compiler doesn't support __attribute__((deprecated))."
10535 echo "Your C compiler supports __attribute__((deprecated))."
10539 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10543 *) val="$d_attribute_deprecated" ;;
10545 set d_attribute_deprecated
10549 : Look for GCC-style attribute warn_unused_result
10550 case "$d_attribute_warn_unused_result" in
10553 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
10554 $cat >attrib.c <<'EOCP'
10556 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
10558 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10559 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10560 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
10563 echo "Your C compiler supports __attribute__((warn_unused_result))."
10567 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10571 *) val="$d_attribute_warn_unused_result" ;;
10573 set d_attribute_warn_unused_result
10577 : see if bcmp exists
10581 : see if bcopy exists
10585 : see if getpgrp exists
10586 set getpgrp d_getpgrp
10589 case "$d_getpgrp" in
10592 echo "Checking to see which flavor of getpgrp is in use..."
10594 #$i_unistd I_UNISTD
10595 #include <sys/types.h>
10597 # include <unistd.h>
10599 #$i_stdlib I_STDLIB
10601 #include <stdlib.h>
10605 if (getuid() == 0) {
10606 printf("(I see you are running Configure as super-user...)\n");
10609 #ifdef TRY_BSD_PGRP
10610 if (getpgrp(1) == 0)
10619 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10620 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
10622 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10623 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
10626 echo "I can't seem to compile and run the test program."
10628 xxx="a USG one, i.e. you use getpgrp()."
10630 # SVR4 systems can appear rather BSD-ish.
10631 case "$i_unistd" in
10633 xxx="a BSD one, i.e. you use getpgrp(pid)."
10637 xxx="probably a USG one, i.e. you use getpgrp()."
10642 echo "Assuming your getpgrp is $xxx" >&4
10651 : see if setpgrp exists
10652 set setpgrp d_setpgrp
10655 case "$d_setpgrp" in
10658 echo "Checking to see which flavor of setpgrp is in use..."
10660 #$i_unistd I_UNISTD
10661 #include <sys/types.h>
10663 # include <unistd.h>
10665 #$i_stdlib I_STDLIB
10667 #include <stdlib.h>
10671 if (getuid() == 0) {
10672 printf("(I see you are running Configure as super-user...)\n");
10675 #ifdef TRY_BSD_PGRP
10676 if (-1 == setpgrp(1, 1))
10679 if (setpgrp() != -1)
10685 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10686 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
10688 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10689 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
10692 echo "(I can't seem to compile and run the test program.)"
10694 xxx="a USG one, i.e. you use setpgrp()."
10696 # SVR4 systems can appear rather BSD-ish.
10697 case "$i_unistd" in
10699 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
10703 xxx="probably a USG one, i.e. you use setpgrp()."
10708 echo "Assuming your setpgrp is $xxx" >&4
10717 : Look for GCC-style __builtin_choose_expr
10718 case "$d_builtin_choose_expr" in
10721 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
10722 $cat >try.c <<'EOCP'
10723 #include <assert.h>
10724 #include <stdlib.h>
10727 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
10730 assert( SYRINX(1) == 2112 );
10731 assert( SYRINX(1) != 5150 );
10732 assert( SYRINX(0) == 5150 );
10733 assert( SYRINX(0) != 2112 );
10734 puts( "All good!" );
10740 if eval $compile && $run ./try; then
10741 echo "Your C compiler supports __builtin_choose_expr."
10744 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10748 *) val="$d_builtin_choose_expr" ;;
10751 set d_builtin_choose_expr
10755 : Look for GCC-style __builtin_expect
10756 case "$d_builtin_expect" in
10759 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
10760 $cat >try.c <<'EOCP'
10763 if ( __builtin_expect(n, 0) ) n = 1;
10764 /* Remember shell exit code truth is 0, C truth is non-zero */
10769 if eval $compile && $run ./try; then
10770 echo "Your C compiler supports __builtin_expect."
10773 echo "Your C compiler doesn't seem to understand __builtin_expect."
10777 *) val="$d_builtin_expect" ;;
10780 set d_builtin_expect
10784 : see if bzero exists
10788 : see if stdarg is available
10790 if $test `./findhdr stdarg.h`; then
10791 echo "<stdarg.h> found." >&4
10794 echo "<stdarg.h> NOT found." >&4
10798 : see if varags is available
10800 if $test `./findhdr varargs.h`; then
10801 echo "<varargs.h> found." >&4
10803 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
10806 : set up the varargs testing programs
10807 $cat > varargs.c <<EOP
10809 #include <stdarg.h>
10812 #include <varargs.h>
10816 int f(char *p, ...)
10830 p = va_arg(ap, char *);
10836 $cat > varargs <<EOP
10838 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
10847 : now check which varargs header should be included
10852 if `./varargs I_STDARG`; then
10854 elif `./varargs I_VARARGS`; then
10859 if `./varargs I_VARARGS`; then
10866 echo "I could not find the definition for va_dcl... You have problems..." >&4
10867 val="$undef"; set i_stdarg; eval $setvar
10868 val="$undef"; set i_varargs; eval $setvar
10873 case "$i_varhdr" in
10875 val="$define"; set i_stdarg; eval $setvar
10876 val="$undef"; set i_varargs; eval $setvar
10879 val="$undef"; set i_stdarg; eval $setvar
10880 val="$define"; set i_varargs; eval $setvar
10883 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
10887 : see if the Compiler supports C99 variadic macros
10888 case "$i_stdarg$i_stdlib" in
10890 echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
10893 #include <stdarg.h>
10895 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
10899 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
10905 if eval $compile && $run ./try 2>&1 >/dev/null; then
10906 case "`$run ./try`" in
10908 echo "You have C99 variadic macros." >&4
10909 d_c99_variadic_macros="$define"
10912 echo "You don't have functional C99 variadic macros." >&4
10913 d_c99_variadic_macros="$undef"
10917 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
10918 d_c99_variadic_macros="$undef"
10923 echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
10924 d_c99_variadic_macros="$undef"
10928 : see if signal is declared as pointer to function returning int or void
10930 xxx=`./findhdr signal.h`
10931 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
10932 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10933 echo "You have int (*signal())() instead of void." >&4
10935 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10936 echo "You have void (*signal())()." >&4
10938 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
10939 echo "You have int (*signal())() instead of void." >&4
10941 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
10942 echo "You have void (*signal())()." >&4
10945 case "$d_voidsig" in
10947 echo "I can't determine whether signal handler returns void or int..." >&4
10949 rp="What type does your signal handler return?"
10952 v*) val="$define";;
10956 echo "As you already told me, signal handler returns void." >&4
10959 *) echo "As you already told me, signal handler returns int." >&4
10966 case "$d_voidsig" in
10967 "$define") signal_t="void";;
10968 *) signal_t="int";;
10972 : check for ability to cast large floats to 32-bit ints.
10974 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
10975 if $test "$intsize" -ge 4; then
10982 #$i_stdlib I_STDLIB
10984 #include <stdlib.h>
10986 #include <sys/types.h>
10987 #include <signal.h>
10988 $signal_t blech(int s) { exit(3); }
10995 signal(SIGFPE, blech);
10997 /* Don't let compiler optimize the test away. Store the number
10998 in a writable string for gcc to pass to sscanf under HP-UX.
11000 sprintf(str, "2147483647");
11001 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
11005 /* x86 processors will probably give 0x8000 0000, which is a
11006 sign change. We don't want that. We want to mimic SPARC
11007 behavior here, which is to preserve the sign and give
11010 if (i32 != ($xxx) f)
11016 if eval $compile_ok; then
11020 echo "(I can't seem to compile the test program--assuming it can't)"
11025 echo "Yup, it can."
11028 echo "Nope, it can't."
11035 : check for ability to cast negative floats to unsigned
11037 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
11040 #$i_stdlib I_STDLIB
11042 #include <stdlib.h>
11044 #include <sys/types.h>
11045 #include <signal.h>
11046 $signal_t blech(int s) { exit(7); }
11047 $signal_t blech_in_list(int s) { exit(4); }
11048 unsigned long dummy_long(unsigned long p) { return p; }
11049 unsigned int dummy_int(unsigned int p) { return p; }
11050 unsigned short dummy_short(unsigned short p) { return p; }
11054 unsigned long along;
11056 unsigned short ashort;
11060 /* Frustrate gcc-2.7.2's optimizer which failed this test with
11061 a direct f = -123. assignment. gcc-2.8.0 reportedly
11062 optimized the whole file away
11064 /* Store the number in a writable string for gcc to pass to
11065 sscanf under HP-UX.
11067 sprintf(str, "-123");
11068 sscanf(str, "%lf", &f); /* f = -123.; */
11070 signal(SIGFPE, blech);
11071 along = (unsigned long)f;
11072 aint = (unsigned int)f;
11073 ashort = (unsigned short)f;
11074 if (along != (unsigned long)-123)
11076 if (aint != (unsigned int)-123)
11078 if (ashort != (unsigned short)-123)
11080 sprintf(str, "1073741824.");
11081 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
11084 along = (unsigned long)f;
11085 if (along != 0x80000000)
11089 along = (unsigned long)f;
11090 if (along != 0x7fffffff)
11094 along = (unsigned long)f;
11095 if (along != 0x80000001)
11099 signal(SIGFPE, blech_in_list);
11100 sprintf(str, "123.");
11101 sscanf(str, "%lf", &f); /* f = 123.; */
11102 along = dummy_long((unsigned long)f);
11103 aint = dummy_int((unsigned int)f);
11104 ashort = dummy_short((unsigned short)f);
11105 if (along != (unsigned long)123)
11107 if (aint != (unsigned int)123)
11109 if (ashort != (unsigned short)123)
11116 if eval $compile_ok; then
11120 echo "(I can't seem to compile the test program--assuming it can't)"
11123 case "$castflags" in
11125 echo "Yup, it can."
11128 echo "Nope, it can't."
11135 : see if vprintf exists
11137 if set vprintf val -f d_vprintf; eval $csym; $val; then
11138 echo 'vprintf() found.' >&4
11141 #$i_stdarg I_STDARG /* Only one of these can be defined by i_varhrd */
11142 #$i_varargs I_VARARGS
11144 #$i_stdlib I_STDLIB
11145 #$i_unistd I_UNISTD
11148 # include <stdarg.h>
11149 #else /* I_VARARGS */
11150 # include <varargs.h>
11154 # include <unistd.h>
11158 # include <stdlib.h>
11161 #include <stdio.h> /* vsprintf prototype */
11164 void xxx(int n, ...)
11169 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11171 int main() { xxx(1, "foo"); }
11173 #else /* I_VARARGS */
11181 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11183 int main() { xxx("foo"); }
11189 if eval $compile_ok; then
11190 if $run ./try; then
11191 echo "Your vsprintf() returns (int)." >&4
11194 echo "Your vsprintf() returns (char*)." >&4
11198 echo 'I am unable to compile the vsprintf() test program.' >&4
11199 # We shouldn't get here. If we do, assume the standard signature,
11200 # not the old BSD one.
11201 echo 'Guessing that vsprintf() returns (int).' >&4
11205 echo 'vprintf() NOT found.' >&4
11216 : see if chown exists
11220 : see if chroot exists
11221 set chroot d_chroot
11224 : see if chsize exists
11225 set chsize d_chsize
11228 : see if class exists
11232 : see if clearenv exists
11233 set clearenv d_clearenv
11236 : Define hasstruct macro for Configure internal use
11237 hasstruct='varname=$1; struct=$2; shift; shift;
11238 while $test $# -ge 2; do
11240 $define) echo "#include <$2>";;
11244 echo "int main () { struct $struct foo; }" >> try.c;
11246 if eval $compile; then
11255 : see whether socket exists
11259 $echo $n "Hmm... $c" >&4
11260 if set socket val -f d_socket; eval $csym; $val; then
11261 echo "Looks like you have Berkeley networking support." >&4
11263 if set setsockopt val -f; eval $csym; $val; then
11266 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
11267 d_oldsock="$define"
11270 if $contains socklib libc.list >/dev/null 2>&1; then
11271 echo "Looks like you have Berkeley networking support." >&4
11273 : we will have to assume that it supports the 4.2 BSD interface
11276 echo "You don't have Berkeley networking in libc$_a..." >&4
11277 if test "X$d_socket" = "X$define"; then
11278 echo "...but you seem to believe that you have sockets." >&4
11280 for net in net socket
11282 if test -f /usr/lib/lib$net$_a; then
11283 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
11284 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
11285 if $contains socket libc.list >/dev/null 2>&1; then
11290 echo "...but the Wollongong group seems to have hacked it in." >&4
11291 sockethdr="-I/usr/netinclude"
11294 echo "Found Berkeley sockets interface in lib$net." >&4
11295 if $contains setsockopt libc.list >/dev/null 2>&1; then
11298 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
11299 d_oldsock="$define"
11305 if test "X$d_socket" != "X$define"; then
11306 echo "or anywhere else I see." >&4
11314 : see if socketpair exists
11315 set socketpair d_sockpair
11320 echo "Checking the availability sa_len in the sock struct ..." >&4
11322 #include <sys/types.h>
11323 #include <sys/socket.h>
11325 struct sockaddr sa;
11326 return (sa.sa_len);
11330 set try; if eval $compile; then
11333 set d_sockaddr_sa_len; eval $setvar
11337 echo "Checking the availability struct sockaddr_in6 ..." >&4
11339 #include <sys/types.h>
11340 #include <sys/socket.h>
11341 #include <netinet/in.h>
11343 struct sockaddr_in6 sin6;
11344 return (sin6.sin6_family);
11348 set try; if eval $compile; then
11351 set d_sockaddr_in6; eval $setvar
11355 echo "Checking the availability sin6_scope_id in struct sockaddr_in6 ..." >&4
11357 #include <sys/types.h>
11358 #include <sys/socket.h>
11359 #include <netinet/in.h>
11361 struct sockaddr_in6 sin6;
11362 return (sin6.sin6_scope_id);
11366 set try; if eval $compile; then
11369 set d_sin6_scope_id; eval $setvar
11373 echo "Checking the availability struct ip_mreq ..." >&4
11375 #include <sys/types.h>
11376 #include <sys/socket.h>
11377 #include <netinet/in.h>
11379 struct ip_mreq mreq;
11380 return (mreq.imr_multiaddr.s_addr);
11384 set try; if eval $compile; then
11387 set d_ip_mreq; eval $setvar
11391 echo "Checking the availability struct ip_mreq_source ..." >&4
11393 #include <sys/types.h>
11394 #include <sys/socket.h>
11395 #include <netinet/in.h>
11397 struct ip_mreq_source mreq;
11398 return (mreq.imr_multiaddr.s_addr);
11402 set try; if eval $compile; then
11405 set d_ip_mreq_source; eval $setvar
11409 echo "Checking the availability struct ipv6_mreq ..." >&4
11411 #include <sys/types.h>
11412 #include <sys/socket.h>
11413 #include <netinet/in.h>
11415 struct ipv6_mreq mreq;
11416 return (mreq.ipv6mr_interface);
11420 set try; if eval $compile; then
11423 set d_ipv6_mreq; eval $setvar
11427 echo "Checking the availability struct ipv6_mreq_source ..." >&4
11429 #include <sys/types.h>
11430 #include <sys/socket.h>
11431 #include <netinet/in.h>
11433 struct ipv6_mreq_source mreq;
11434 return (mreq.imr_multiaddr.s_addr);
11438 set try; if eval $compile; then
11441 set d_ipv6_mreq_source; eval $setvar
11445 echo "Checking the availability of certain socket constants..." >&4
11446 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
11447 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
11449 #include <sys/types.h>
11450 #include <sys/socket.h>
11456 set try; if eval $compile; then
11459 set d_${enum}; eval $setvar
11463 : see if this is a sys/uio.h system
11464 set sys/uio.h i_sysuio
11467 : Check for cmsghdr support
11469 echo "Checking to see if your system supports struct cmsghdr..." >&4
11470 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
11472 case "$d_cmsghdr_s" in
11473 "$define") echo "Yes, it does." ;;
11474 *) echo "No, it doesn't." ;;
11478 : check for const keyword
11480 echo 'Checking to see if your C compiler knows about "const"...' >&4
11481 $cat >const.c <<'EOCP'
11482 typedef struct spug { int drokk; } spug;
11486 const spug y = { 0 };
11489 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
11491 echo "Yup, it does."
11494 echo "Nope, it doesn't."
11499 : see if copysignl exists
11500 set copysignl d_copysignl
11503 : see if crypt exists
11508 $define) cryptlib='' ;;
11509 *) if set crypt val -f d_crypt; eval $csym; $val; then
11510 echo 'crypt() found.' >&4
11514 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
11515 if $test -z "$cryptlib"; then
11516 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
11520 if $test -z "$cryptlib"; then
11521 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
11525 if $test -z "$cryptlib"; then
11526 cryptlib=`./loc libcrypt$_a "" $libpth`
11530 if $test -z "$cryptlib"; then
11531 echo 'crypt() NOT found.' >&4
11542 : see if this is a crypt.h system
11543 set crypt.h i_crypt
11546 : see if crypt_r exists
11547 set crypt_r d_crypt_r
11549 case "$d_crypt_r" in
11551 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
11552 case "$d_crypt_r_proto:$usethreads" in
11553 ":define") d_crypt_r_proto=define
11554 set d_crypt_r_proto crypt_r $hdrs
11558 case "$d_crypt_r_proto" in
11560 case "$crypt_r_proto" in
11561 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
11562 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCS ;;
11564 case "$crypt_r_proto" in
11565 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
11566 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCD ;;
11568 case "$crypt_r_proto" in
11569 ''|0) d_crypt_r=undef
11571 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
11572 * ) case "$crypt_r_proto" in
11573 REENTRANT_PROTO*) ;;
11574 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
11576 echo "Prototype: $try" ;;
11579 *) case "$usethreads" in
11580 define) echo "crypt_r has no prototype, not using it." >&4 ;;
11591 : get csh whereabouts
11593 'csh') val="$undef" ;;
11594 *) val="$define" ;;
11598 : Respect a hint or command line value for full_csh.
11599 case "$full_csh" in
11600 '') full_csh=$csh ;;
11603 : see if ctermid exists
11604 set ctermid d_ctermid
11607 : see if ctermid_r exists
11608 set ctermid_r d_ctermid_r
11610 case "$d_ctermid_r" in
11612 hdrs="$i_systypes sys/types.h define stdio.h "
11613 case "$d_ctermid_r_proto:$usethreads" in
11614 ":define") d_ctermid_r_proto=define
11615 set d_ctermid_r_proto ctermid_r $hdrs
11619 case "$d_ctermid_r_proto" in
11621 case "$ctermid_r_proto" in
11622 ''|0) try='char* ctermid_r(char*);'
11623 ./protochk "$extern_C $try" $hdrs && ctermid_r_proto=B_B ;;
11625 case "$ctermid_r_proto" in
11626 ''|0) d_ctermid_r=undef
11628 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
11629 * ) case "$ctermid_r_proto" in
11630 REENTRANT_PROTO*) ;;
11631 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
11633 echo "Prototype: $try" ;;
11636 *) case "$usethreads" in
11637 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
11644 *) ctermid_r_proto=0
11648 : see if ctime_r exists
11649 set ctime_r d_ctime_r
11651 case "$d_ctime_r" in
11653 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
11654 case "$d_ctime_r_proto:$usethreads" in
11655 ":define") d_ctime_r_proto=define
11656 set d_ctime_r_proto ctime_r $hdrs
11660 case "$d_ctime_r_proto" in
11662 case "$ctime_r_proto" in
11663 ''|0) try='char* ctime_r(const time_t*, char*);'
11664 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SB ;;
11666 case "$ctime_r_proto" in
11667 ''|0) try='char* ctime_r(const time_t*, char*, int);'
11668 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SBI ;;
11670 case "$ctime_r_proto" in
11671 ''|0) try='int ctime_r(const time_t*, char*);'
11672 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SB ;;
11674 case "$ctime_r_proto" in
11675 ''|0) try='int ctime_r(const time_t*, char*, int);'
11676 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SBI ;;
11678 case "$ctime_r_proto" in
11679 ''|0) d_ctime_r=undef
11681 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
11682 * ) case "$ctime_r_proto" in
11683 REENTRANT_PROTO*) ;;
11684 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
11686 echo "Prototype: $try" ;;
11689 *) case "$usethreads" in
11690 define) echo "ctime_r has no prototype, not using it." >&4 ;;
11701 : see if cuserid exists
11702 set cuserid d_cuserid
11705 : see if this is a limits.h system
11706 set limits.h i_limits
11709 : see if this is a float.h system
11710 set float.h i_float
11713 : See if number of significant digits in a double precision number is known
11715 $cat >dbl_dig.c <<EOM
11716 #$i_limits I_LIMITS
11719 #include <limits.h>
11725 printf("Contains DBL_DIG");
11728 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
11729 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
11730 echo "DBL_DIG found." >&4
11733 echo "DBL_DIG NOT found." >&4
11740 : see if dbm.h is available
11741 : see if dbmclose exists
11742 set dbmclose d_dbmclose
11745 case "$d_dbmclose" in
11755 *) set rpcsvc/dbm.h i_rpcsvcdbm
11760 *) echo "We won't be including <dbm.h>"
11770 : see if prototype for dbminit is available
11772 set d_dbminitproto dbminit $i_dbm dbm.h
11775 : see if difftime exists
11776 set difftime d_difftime
11779 : see if this is a dirent system
11781 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
11783 echo "<dirent.h> found." >&4
11786 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
11787 echo "<sys/dir.h> found." >&4
11790 xinc=`./findhdr sys/ndir.h`
11792 echo "<dirent.h> NOT found." >&4
11797 : Look for type of directory structure.
11799 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11801 case "$direntrytype" in
11803 case "$i_dirent" in
11804 $define) guess1='struct dirent' ;;
11805 *) guess1='struct direct' ;;
11808 *) guess1="$direntrytype"
11813 'struct dirent') guess2='struct direct' ;;
11814 *) guess2='struct dirent' ;;
11817 if $contains "$guess1" try.c >/dev/null 2>&1; then
11818 direntrytype="$guess1"
11819 echo "Your directory entries are $direntrytype." >&4
11820 elif $contains "$guess2" try.c >/dev/null 2>&1; then
11821 direntrytype="$guess2"
11822 echo "Your directory entries seem to be $direntrytype." >&4
11824 echo "I don't recognize your system's directory entries." >&4
11825 rp="What type is used for directory entries on this system?"
11828 direntrytype="$ans"
11832 : see if the directory entry stores field length
11834 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11835 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
11836 echo "Good, your directory entry keeps length information in d_namlen." >&4
11839 echo "Your directory entry does not know about the d_namlen field." >&4
11846 : Look for DIR.dd_fd
11847 case "$i_dirent" in
11849 echo "Checking to see if DIR has a dd_fd member variable" >&4
11851 #$i_stdlib I_STDLIB
11853 #include <stdlib.h>
11855 #include <dirent.h>
11865 if eval $compile; then
11866 echo "Yes, it does."
11869 echo "No, it does not."
11874 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
11882 : see if this is an sysdir system
11883 set sys/dir.h i_sysdir
11886 : see if this is an sysndir system
11887 set sys/ndir.h i_sysndir
11892 $cat >dirfd.c <<EOM
11894 #$i_stdlib I_STDLIB
11896 #include <stdlib.h>
11898 #$i_dirent I_DIRENT /**/
11899 #$i_sysdir I_SYS_DIR /**/
11900 #$i_sysndir I_SYS_NDIR /**/
11901 #$i_systypes I_SYS_TYPES /**/
11902 #if defined(I_SYS_TYPES)
11903 #include <sys/types.h>
11905 #if defined(I_DIRENT)
11906 #include <dirent.h>
11907 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
11908 #include <sys/dir.h>
11912 #include <sys/ndir.h>
11916 #include <ndir.h> /* may be wrong in the future */
11918 #include <sys/dir.h>
11924 DIR *dirp = opendir(".");
11925 if (dirfd(dirp) >= 0)
11933 if eval $compile; then
11937 $define) echo "dirfd() found." >&4 ;;
11938 *) echo "dirfd() NOT found." >&4 ;;
11944 : see if dlerror exists
11947 set dlerror d_dlerror
11951 : see if dlfcn is available
11952 set dlfcn.h i_dlfcn
11955 : Check what extension to use for shared libs
11960 On a few systems, the dynamically loaded modules that perl generates and uses
11961 will need a different extension than shared libs. The default will probably
11967 *) dflt="$dlext" ;;
11969 rp='What is the extension of dynamically loaded modules'
11978 : Check if dlsym need a leading underscore
11984 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
11985 $cat >dyna.c <<'EOM'
11992 #$i_stdlib I_STDLIB
11994 #include <stdlib.h>
11998 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
12000 #include <sys/types.h>
12005 extern int fred() ;
12014 int mode = RTLD_LAZY ;
12016 handle = dlopen("./dyna.$dlext", mode) ;
12017 if (handle == NULL) {
12022 symbol = dlsym(handle, "fred") ;
12023 if (symbol == NULL) {
12024 /* try putting a leading underscore */
12025 symbol = dlsym(handle, "_fred") ;
12026 if (symbol == NULL) {
12039 : Call the object file tmp-dyna.o in case dlext=o.
12040 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
12041 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
12042 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
12043 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
12046 1) echo "Test program failed using dlopen." >&4
12047 echo "Perhaps you should not use dynamic loading." >&4;;
12048 2) echo "Test program failed using dlsym." >&4
12049 echo "Perhaps you should not use dynamic loading." >&4;;
12050 3) echo "dlsym needs a leading underscore" >&4
12052 4) echo "dlsym doesn't need a leading underscore." >&4;;
12055 echo "I can't compile and run the test program." >&4
12056 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
12061 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
12066 : see if drand48_r exists
12067 set drand48_r d_drand48_r
12069 case "$d_drand48_r" in
12071 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
12072 case "$d_drand48_r_proto:$usethreads" in
12073 ":define") d_drand48_r_proto=define
12074 set d_drand48_r_proto drand48_r $hdrs
12078 case "$d_drand48_r_proto" in
12080 case "$drand48_r_proto" in
12081 ''|0) try='int drand48_r(struct drand48_data*, double*);'
12082 ./protochk "$extern_C $try" $hdrs && drand48_r_proto=I_ST ;;
12084 case "$drand48_r_proto" in
12085 ''|0) d_drand48_r=undef
12087 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
12088 * ) case "$drand48_r_proto" in
12089 REENTRANT_PROTO*) ;;
12090 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
12092 echo "Prototype: $try" ;;
12095 *) case "$usethreads" in
12096 define) echo "drand48_r has no prototype, not using it." >&4 ;;
12103 *) drand48_r_proto=0
12107 : see if prototype for drand48 is available
12109 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
12112 : see if dup2 exists
12116 : see if eaccess exists
12117 set eaccess d_eaccess
12120 : see if endgrent exists
12121 set endgrent d_endgrent
12124 : see if this is an grp system
12130 xxx=`./findhdr grp.h`
12131 $cppstdin $cppflags $cppminus < $xxx >$$.h
12133 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
12145 set d_grpasswd; eval $setvar
12149 : see if endgrent_r exists
12150 set endgrent_r d_endgrent_r
12152 case "$d_endgrent_r" in
12154 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12155 case "$d_endgrent_r_proto:$usethreads" in
12156 ":define") d_endgrent_r_proto=define
12157 set d_endgrent_r_proto endgrent_r $hdrs
12161 case "$d_endgrent_r_proto" in
12163 case "$endgrent_r_proto" in
12164 ''|0) try='int endgrent_r(FILE**);'
12165 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=I_H ;;
12167 case "$endgrent_r_proto" in
12168 ''|0) try='void endgrent_r(FILE**);'
12169 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=V_H ;;
12171 case "$endgrent_r_proto" in
12172 ''|0) d_endgrent_r=undef
12174 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
12175 * ) case "$endgrent_r_proto" in
12176 REENTRANT_PROTO*) ;;
12177 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
12179 echo "Prototype: $try" ;;
12182 *) case "$usethreads" in
12183 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
12190 *) endgrent_r_proto=0
12194 : see if endhostent exists
12195 set endhostent d_endhent
12198 : see if this is a netdb.h system
12199 set netdb.h i_netdb
12202 : see if endhostent_r exists
12203 set endhostent_r d_endhostent_r
12205 case "$d_endhostent_r" in
12207 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12208 case "$d_endhostent_r_proto:$usethreads" in
12209 ":define") d_endhostent_r_proto=define
12210 set d_endhostent_r_proto endhostent_r $hdrs
12214 case "$d_endhostent_r_proto" in
12216 case "$endhostent_r_proto" in
12217 ''|0) try='int endhostent_r(struct hostent_data*);'
12218 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=I_D ;;
12220 case "$endhostent_r_proto" in
12221 ''|0) try='void endhostent_r(struct hostent_data*);'
12222 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=V_D ;;
12224 case "$endhostent_r_proto" in
12225 ''|0) d_endhostent_r=undef
12226 endhostent_r_proto=0
12227 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
12228 * ) case "$endhostent_r_proto" in
12229 REENTRANT_PROTO*) ;;
12230 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
12232 echo "Prototype: $try" ;;
12235 *) case "$usethreads" in
12236 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
12238 d_endhostent_r=undef
12239 endhostent_r_proto=0
12243 *) endhostent_r_proto=0
12247 : see if endnetent exists
12248 set endnetent d_endnent
12251 : see if endnetent_r exists
12252 set endnetent_r d_endnetent_r
12254 case "$d_endnetent_r" in
12256 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12257 case "$d_endnetent_r_proto:$usethreads" in
12258 ":define") d_endnetent_r_proto=define
12259 set d_endnetent_r_proto endnetent_r $hdrs
12263 case "$d_endnetent_r_proto" in
12265 case "$endnetent_r_proto" in
12266 ''|0) try='int endnetent_r(struct netent_data*);'
12267 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=I_D ;;
12269 case "$endnetent_r_proto" in
12270 ''|0) try='void endnetent_r(struct netent_data*);'
12271 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=V_D ;;
12273 case "$endnetent_r_proto" in
12274 ''|0) d_endnetent_r=undef
12275 endnetent_r_proto=0
12276 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
12277 * ) case "$endnetent_r_proto" in
12278 REENTRANT_PROTO*) ;;
12279 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
12281 echo "Prototype: $try" ;;
12284 *) case "$usethreads" in
12285 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
12287 d_endnetent_r=undef
12288 endnetent_r_proto=0
12292 *) endnetent_r_proto=0
12296 : see if endprotoent exists
12297 set endprotoent d_endpent
12300 : see if endprotoent_r exists
12301 set endprotoent_r d_endprotoent_r
12303 case "$d_endprotoent_r" in
12305 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12306 case "$d_endprotoent_r_proto:$usethreads" in
12307 ":define") d_endprotoent_r_proto=define
12308 set d_endprotoent_r_proto endprotoent_r $hdrs
12312 case "$d_endprotoent_r_proto" in
12314 case "$endprotoent_r_proto" in
12315 ''|0) try='int endprotoent_r(struct protoent_data*);'
12316 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=I_D ;;
12318 case "$endprotoent_r_proto" in
12319 ''|0) try='void endprotoent_r(struct protoent_data*);'
12320 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=V_D ;;
12322 case "$endprotoent_r_proto" in
12323 ''|0) d_endprotoent_r=undef
12324 endprotoent_r_proto=0
12325 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
12326 * ) case "$endprotoent_r_proto" in
12327 REENTRANT_PROTO*) ;;
12328 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
12330 echo "Prototype: $try" ;;
12333 *) case "$usethreads" in
12334 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
12336 d_endprotoent_r=undef
12337 endprotoent_r_proto=0
12341 *) endprotoent_r_proto=0
12345 : see if endpwent exists
12346 set endpwent d_endpwent
12349 : see if this is a pwd.h system
12355 xxx=`./findhdr pwd.h`
12356 $cppstdin $cppflags $cppminus < $xxx >$$.h
12358 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
12366 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
12374 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
12382 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
12390 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
12398 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
12406 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
12414 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
12426 set d_pwquota; eval $setvar
12427 set d_pwage; eval $setvar
12428 set d_pwchange; eval $setvar
12429 set d_pwclass; eval $setvar
12430 set d_pwexpire; eval $setvar
12431 set d_pwcomment; eval $setvar
12432 set d_pwgecos; eval $setvar
12433 set d_pwpasswd; eval $setvar
12437 : see if endpwent_r exists
12438 set endpwent_r d_endpwent_r
12440 case "$d_endpwent_r" in
12442 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
12443 case "$d_endpwent_r_proto:$usethreads" in
12444 ":define") d_endpwent_r_proto=define
12445 set d_endpwent_r_proto endpwent_r $hdrs
12449 case "$d_endpwent_r_proto" in
12451 case "$endpwent_r_proto" in
12452 ''|0) try='int endpwent_r(FILE**);'
12453 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=I_H ;;
12455 case "$endpwent_r_proto" in
12456 ''|0) try='void endpwent_r(FILE**);'
12457 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=V_H ;;
12459 case "$endpwent_r_proto" in
12460 ''|0) d_endpwent_r=undef
12462 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
12463 * ) case "$endpwent_r_proto" in
12464 REENTRANT_PROTO*) ;;
12465 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
12467 echo "Prototype: $try" ;;
12470 *) case "$usethreads" in
12471 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
12478 *) endpwent_r_proto=0
12482 : see if endservent exists
12483 set endservent d_endsent
12486 : see if endservent_r exists
12487 set endservent_r d_endservent_r
12489 case "$d_endservent_r" in
12491 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12492 case "$d_endservent_r_proto:$usethreads" in
12493 ":define") d_endservent_r_proto=define
12494 set d_endservent_r_proto endservent_r $hdrs
12498 case "$d_endservent_r_proto" in
12500 case "$endservent_r_proto" in
12501 ''|0) try='int endservent_r(struct servent_data*);'
12502 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=I_D ;;
12504 case "$endservent_r_proto" in
12505 ''|0) try='void endservent_r(struct servent_data*);'
12506 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=V_D ;;
12508 case "$endservent_r_proto" in
12509 ''|0) d_endservent_r=undef
12510 endservent_r_proto=0
12511 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
12512 * ) case "$endservent_r_proto" in
12513 REENTRANT_PROTO*) ;;
12514 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
12516 echo "Prototype: $try" ;;
12519 *) case "$usethreads" in
12520 define) echo "endservent_r has no prototype, not using it." >&4 ;;
12522 d_endservent_r=undef
12523 endservent_r_proto=0
12527 *) endservent_r_proto=0
12531 : Locate the flags for 'open()'
12534 #include <sys/types.h>
12539 #include <sys/file.h>
12541 #$i_stdlib I_STDLIB
12543 #include <stdlib.h>
12554 : check sys/file.h first to get FREAD on Sun
12555 if $test `./findhdr sys/file.h` && \
12556 set try -DI_SYS_FILE && eval $compile; then
12558 echo "<sys/file.h> defines the O_* constants..." >&4
12559 if $run ./try; then
12560 echo "and you have the 3 argument form of open()." >&4
12563 echo "but not the 3 argument form of open(). Oh, well." >&4
12566 elif $test `./findhdr fcntl.h` && \
12567 set try -DI_FCNTL && eval $compile; then
12569 echo "<fcntl.h> defines the O_* constants..." >&4
12570 if $run ./try; then
12571 echo "and you have the 3 argument form of open()." >&4
12574 echo "but not the 3 argument form of open(). Oh, well." >&4
12579 echo "I can't find the O_* constant definitions! You got problems." >&4
12585 : see if this is a sys/file.h system
12590 : do we need to include sys/file.h ?
12594 if $h_sysfile; then
12596 echo "We'll be including <sys/file.h>." >&4
12599 echo "We won't be including <sys/file.h>." >&4
12609 : see if fcntl.h is there
12614 : see if we can include fcntl.h
12620 echo "We'll be including <fcntl.h>." >&4
12623 if $h_sysfile; then
12624 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
12626 echo "We won't be including <fcntl.h>." >&4
12638 : see if fork exists
12642 : see if pipe exists
12646 : check for non-blocking I/O stuff
12647 case "$h_sysfile" in
12648 true) echo "#include <sys/file.h>" > head.c;;
12651 true) echo "#include <fcntl.h>" > head.c;;
12652 *) echo "#include <sys/fcntl.h>" > head.c;;
12657 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
12658 case "$o_nonblock" in
12660 $cat head.c > try.c
12661 $cat >>try.c <<EOCP
12663 #$i_stdlib I_STDLIB
12665 #include <stdlib.h>
12673 printf("O_NONBLOCK\n");
12677 printf("O_NDELAY\n");
12681 printf("FNDELAY\n");
12688 if eval $compile_ok; then
12689 o_nonblock=`$run ./try`
12690 case "$o_nonblock" in
12691 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
12692 *) echo "Seems like we can use $o_nonblock.";;
12695 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
12698 *) echo "Using $hint value $o_nonblock.";;
12703 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
12706 case "$d_fork:$d_pipe" in
12708 $cat head.c > try.c
12709 $cat >>try.c <<EOCP
12711 #include <sys/types.h>
12712 #include <signal.h>
12714 #$i_stdlib I_STDLIB
12716 #include <stdlib.h>
12722 #define MY_O_NONBLOCK $o_nonblock
12723 #ifndef errno /* XXX need better Configure test */
12726 #$i_unistd I_UNISTD
12728 #include <unistd.h>
12730 #$i_string I_STRING
12732 #include <string.h>
12734 #include <strings.h>
12736 $signal_t blech(int x) { exit(3); }
12738 $cat >> try.c <<'EOCP'
12746 pipe(pd); /* Down: child -> parent */
12747 pipe(pu); /* Up: parent -> child */
12750 close(pd[1]); /* Parent reads from pd[0] */
12751 close(pu[0]); /* Parent writes (blocking) to pu[1] */
12753 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
12758 signal(SIGALRM, blech);
12760 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
12762 sprintf(string, "%d\n", ret);
12763 write(2, string, strlen(string));
12766 if (errno == EAGAIN) {
12767 printf("EAGAIN\n");
12772 if (errno == EWOULDBLOCK)
12773 printf("EWOULDBLOCK\n");
12776 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
12777 sleep(2); /* Give it time to close our pipe */
12779 ret = read(pd[0], buf, 1); /* Should read EOF */
12781 sprintf(string, "%d\n", ret);
12782 write(4, string, strlen(string));
12786 close(pd[0]); /* We write to pd[1] */
12787 close(pu[1]); /* We read from pu[0] */
12788 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
12789 close(pd[1]); /* Pipe pd is now fully closed! */
12790 exit(0); /* Bye bye, thank you for playing! */
12794 if eval $compile_ok; then
12795 echo "$startsh" >mtry
12796 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
12798 ./mtry >/dev/null 2>&1
12800 0) eagain=`$cat try.out`;;
12801 1) echo "Could not perform non-blocking setting!";;
12802 2) echo "I did a successful read() for something that was not there!";;
12803 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
12804 4) echo "Could not find F_SETFL!";;
12805 *) echo "Something terribly wrong happened during testing.";;
12807 rd_nodata=`$cat try.ret`
12808 echo "A read() system call with no data present returns $rd_nodata."
12809 case "$rd_nodata" in
12812 echo "(That's peculiar, fixing that to be -1.)"
12818 echo "Forcing errno EAGAIN on read() with no data available."
12822 echo "Your read() sets errno to $eagain when no data is available."
12825 status=`$cat try.err`
12827 0) echo "And it correctly returns 0 to signal EOF.";;
12828 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
12829 *) echo "However, your read() returns '$status' on EOF??";;
12832 if test "$status" = "$rd_nodata"; then
12833 echo "WARNING: you can't distinguish between EOF and no data!"
12837 echo "I can't compile the test program--assuming errno EAGAIN will do."
12841 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
12850 echo "Using $hint value $eagain."
12851 echo "Your read() returns $rd_nodata when no data is present."
12852 case "$d_eofnblk" in
12853 "$define") echo "And you can see EOF because read() returns 0.";;
12854 "$undef") echo "But you can't see EOF status from read() returned value.";;
12856 echo "(Assuming you can't see EOF status from read anyway.)"
12862 $rm_try head.c mtry
12864 : see if _ptr and _cnt from stdio act std
12867 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
12868 echo "(Looks like you have stdio.h from BSD.)"
12869 case "$stdio_ptr" in
12870 '') stdio_ptr='((fp)->_p)'
12873 *) ptr_lval=$d_stdio_ptr_lval;;
12875 case "$stdio_cnt" in
12876 '') stdio_cnt='((fp)->_r)'
12879 *) cnt_lval=$d_stdio_cnt_lval;;
12881 case "$stdio_base" in
12882 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
12884 case "$stdio_bufsiz" in
12885 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
12887 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
12888 echo "(Looks like you have stdio.h from Linux.)"
12889 case "$stdio_ptr" in
12890 '') stdio_ptr='((fp)->_IO_read_ptr)'
12893 *) ptr_lval=$d_stdio_ptr_lval;;
12895 case "$stdio_cnt" in
12896 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
12899 *) cnt_lval=$d_stdio_cnt_lval;;
12901 case "$stdio_base" in
12902 '') stdio_base='((fp)->_IO_read_base)';;
12904 case "$stdio_bufsiz" in
12905 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
12908 case "$stdio_ptr" in
12909 '') stdio_ptr='((fp)->_ptr)'
12912 *) ptr_lval=$d_stdio_ptr_lval;;
12914 case "$stdio_cnt" in
12915 '') stdio_cnt='((fp)->_cnt)'
12918 *) cnt_lval=$d_stdio_cnt_lval;;
12920 case "$stdio_base" in
12921 '') stdio_base='((fp)->_base)';;
12923 case "$stdio_bufsiz" in
12924 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
12928 : test whether _ptr and _cnt really work
12929 echo "Checking how std your stdio is..." >&4
12932 #$i_stdlib I_STDLIB
12934 #include <stdlib.h>
12936 #define FILE_ptr(fp) $stdio_ptr
12937 #define FILE_cnt(fp) $stdio_cnt
12939 FILE *fp = fopen("try.c", "r");
12942 18 <= FILE_cnt(fp) &&
12943 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12951 if eval $compile && $to try.c; then
12952 if $run ./try; then
12953 echo "Your stdio acts pretty std."
12956 echo "Your stdio isn't very std."
12959 echo "Your stdio doesn't appear very std."
12963 # glibc 2.2.90 and above apparently change stdio streams so Perl's
12964 # direct buffer manipulation no longer works. The Configure tests
12965 # should be changed to correctly detect this, but until then,
12966 # the following check should at least let perl compile and run.
12967 # (This quick fix should be updated before 5.8.1.)
12968 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
12969 # A. Dougherty, June 3, 2002.
12970 case "$d_gnulibc" in
12972 case "$gnulibc_version" in
12976 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
12985 : Can _ptr be used as an lvalue?
12986 case "$d_stdstdio$ptr_lval" in
12987 $define$define) val=$define ;;
12990 set d_stdio_ptr_lval
12993 : Can _cnt be used as an lvalue?
12994 case "$d_stdstdio$cnt_lval" in
12995 $define$define) val=$define ;;
12998 set d_stdio_cnt_lval
13002 : test whether setting _ptr sets _cnt as a side effect
13003 d_stdio_ptr_lval_sets_cnt="$undef"
13004 d_stdio_ptr_lval_nochange_cnt="$undef"
13005 case "$d_stdio_ptr_lval$d_stdstdio" in
13007 echo "Checking to see what happens if we set the stdio ptr..." >&4
13010 /* Can we scream? */
13011 /* Eat dust sed :-) */
13012 /* In the buffer space, no one can hear you scream. */
13013 #$i_stdlib I_STDLIB
13015 #include <stdlib.h>
13017 #define FILE_ptr(fp) $stdio_ptr
13018 #define FILE_cnt(fp) $stdio_cnt
13019 #include <sys/types.h>
13021 FILE *fp = fopen("try.c", "r");
13026 puts("Fail even to read");
13029 c = getc(fp); /* Read away the first # */
13031 puts("Fail even to read");
13035 18 <= FILE_cnt(fp) &&
13036 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13038 puts("Fail even to read");
13041 ptr = (char*) FILE_ptr(fp);
13042 cnt = (size_t)FILE_cnt(fp);
13044 FILE_ptr(fp) += 42;
13046 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
13047 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
13050 if (FILE_cnt(fp) <= 20) {
13051 printf ("Fail (<20 chars to test)");
13054 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
13055 puts("Fail compare");
13058 if (cnt == FILE_cnt(fp)) {
13059 puts("Pass_unchanged");
13062 if (FILE_cnt(fp) == (cnt - 42)) {
13063 puts("Pass_changed");
13066 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
13072 if eval $compile && $to try.c; then
13073 case `$run ./try` in
13075 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
13076 d_stdio_ptr_lval_sets_cnt="$define" ;;
13078 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
13079 d_stdio_ptr_lval_nochange_cnt="$define" ;;
13081 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
13083 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
13086 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
13092 : see if _base is also standard
13094 case "$d_stdstdio" in
13098 #$i_stdlib I_STDLIB
13100 #include <stdlib.h>
13102 #define FILE_base(fp) $stdio_base
13103 #define FILE_bufsiz(fp) $stdio_bufsiz
13105 FILE *fp = fopen("try.c", "r");
13108 19 <= FILE_bufsiz(fp) &&
13109 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
13116 if eval $compile && $to try.c; then
13117 if $run ./try; then
13118 echo "And its _base field acts std."
13121 echo "But its _base field isn't std."
13124 echo "However, it seems to be lacking the _base field."
13132 : see if fast_stdio exists
13134 case "$d_stdstdio:$d_stdio_ptr_lval" in
13136 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
13138 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
13149 : see if fchdir exists
13150 set fchdir d_fchdir
13153 : see if fchmod exists
13154 set fchmod d_fchmod
13157 : see if fchown exists
13158 set fchown d_fchown
13161 : see if this is an fcntl system
13165 : See if fcntl-based locking works.
13168 #$i_stdlib I_STDLIB
13170 #include <stdlib.h>
13172 #include <unistd.h>
13174 #include <signal.h>
13175 $signal_t blech(int x) { exit(3); }
13177 #if defined(F_SETLK) && defined(F_SETLKW)
13178 struct flock flock;
13180 fd = open("try.c", O_RDONLY);
13181 flock.l_type = F_RDLCK;
13182 flock.l_whence = SEEK_SET;
13183 flock.l_start = flock.l_len = 0;
13184 signal(SIGALRM, blech);
13186 retval = fcntl(fd, F_SETLK, &flock);
13188 (retval < 0 ? exit(2) : exit(0));
13194 echo "Checking if fcntl-based file locking works... "
13198 if eval $compile_ok; then
13199 if $run ./try; then
13200 echo "Yes, it seems to work."
13203 echo "Nope, it didn't work."
13208 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
13209 *** This is (almost) impossible.
13210 *** If your NFS lock daemons are not feeling well, something like
13211 *** this may happen, please investigate. Cannot continue, aborting.
13219 echo "I'm unable to compile the test program, so I'll assume not."
13224 echo "Nope, since you don't even have fcntl()."
13227 set d_fcntl_can_lock
13231 : check for fd_set items
13234 Checking to see how well your C compiler handles fd_set and friends ...
13237 #$i_stdlib I_STDLIB
13239 #include <stdlib.h>
13241 #$i_systime I_SYS_TIME
13242 #$i_sysselct I_SYS_SELECT
13243 #$d_socket HAS_SOCKET
13244 #include <sys/types.h>
13246 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
13249 #include <sys/time.h>
13251 #ifdef I_SYS_SELECT
13252 #include <sys/select.h>
13261 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
13269 if eval $compile; then
13270 d_fds_bits="$define"
13272 echo "Well, your system knows about the normal fd_set typedef..." >&4
13273 if $run ./try; then
13274 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
13275 d_fd_macros="$define"
13278 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
13280 d_fd_macros="$undef"
13284 Hmm, your compiler has some difficulty with fd_set. Checking further...
13287 if eval $compile; then
13288 d_fds_bits="$undef"
13290 echo "Well, your system has some sort of fd_set available..." >&4
13291 if $run ./try; then
13292 echo "and you have the normal fd_set macros." >&4
13293 d_fd_macros="$define"
13296 but not the normal fd_set macros! Gross! More work for me...
13298 d_fd_macros="$undef"
13301 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
13303 d_fds_bits="$undef"
13304 d_fd_macros="$undef"
13309 : see if fgetpos exists
13310 set fgetpos d_fgetpos
13313 : see if finite exists
13314 set finite d_finite
13317 : see if finitel exists
13318 set finitel d_finitel
13321 : see if flock exists
13325 : see if prototype for flock is available
13327 set d_flockproto flock $i_sysfile sys/file.h
13330 : see if fp_class exists
13331 set fp_class d_fp_class
13334 : see if pathconf exists
13335 set pathconf d_pathconf
13338 : see if fpathconf exists
13339 set fpathconf d_fpathconf
13342 : see if fpclass exists
13343 set fpclass d_fpclass
13346 : see if fpclassify exists
13347 set fpclassify d_fpclassify
13350 : see if fpclassl exists
13351 set fpclassl d_fpclassl
13354 : check for fpos64_t
13356 echo "Checking to see if you have fpos64_t..." >&4
13359 int main() { fpos64_t x = 7; }
13362 if eval $compile; then
13364 echo "You have fpos64_t."
13367 echo "You do not have fpos64_t."
13368 case "$fpossize" in
13369 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
13376 : see if frexpl exists
13377 set frexpl d_frexpl
13380 : see if this is a sys/param system
13381 set sys/param.h i_sysparam
13384 : see if this is a sys/mount.h system
13385 set sys/mount.h i_sysmount
13388 : Check for fs_data_s
13390 echo "Checking to see if your system supports struct fs_data..." >&4
13391 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
13393 case "$d_fs_data_s" in
13394 "$define") echo "Yes, it does." ;;
13395 *) echo "No, it doesn't." ;;
13398 : see if fseeko exists
13399 set fseeko d_fseeko
13401 case "$longsize" in
13402 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
13405 : see if fsetpos exists
13406 set fsetpos d_fsetpos
13409 : see if fstatfs exists
13410 set fstatfs d_fstatfs
13413 : see if statvfs exists
13414 set statvfs d_statvfs
13417 : see if fstatvfs exists
13418 set fstatvfs d_fstatvfs
13422 : see if fsync exists
13426 : see if ftello exists
13427 set ftello d_ftello
13429 case "$longsize" in
13430 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
13433 : check for a working futimes
13436 echo "Checking if you have a working futimes()" >&4
13439 #include <sys/time.h>
13446 fd = open ("try.c", O_RDWR);
13447 if (-1 == fd) exit (1);
13448 rv = futimes (fd, NULL);
13449 exit (rv == -1 ? errno : 0);
13453 if eval $compile; then
13457 0) echo "Yes, you have" >&4
13458 d_futimes="$define"
13460 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
13464 echo "No, it does not (probably harmless)" >&4
13468 : see if ndbm.h is available
13471 : Compatibility location for RedHat 7.1
13472 set gdbm/ndbm.h i_gdbmndbm
13474 : Compatibility location for Debian 4.0
13475 set gdbm-ndbm.h i_gdbm_ndbm
13479 if $test "$i_ndbm" = "$define" -o "$i_gdbmndbm" = "$define" -o "$i_gdbm_ndbm" = "$define"; then
13480 : see if dbm_open exists
13481 set dbm_open d_dbm_open
13483 case "$d_dbm_open" in
13486 i_gdbmndbm="$undef"
13487 i_gdbm_ndbm="$undef"
13488 echo "We won't be including <ndbm.h>"
13498 ndbm_hdr_protochk='name=$1; hdr=$2;
13499 eval "ihdr=\$""i_$name";
13501 if $test "$ihdr" = "$define"; then
13502 $echo "Checking if your <$hdr> uses prototypes..." >&4;
13503 case "$d_cplusplus" in
13504 $define) ./protochk "$extern_C void dbm_close(DBM *);" literal "extern \"C\" {" $ihdr $hdr literal "}" && val="$define" ;;
13505 *) ./protochk "$extern_C void dbm_close(int, int);" $ihdr $hdr || val="$define" ;;
13508 $define) $echo "Your <$hdr> seems to have prototypes";;
13509 *) $echo "Your <$hdr> does not seem to have prototypes";;
13512 set "d_${name}_h_uses_prototypes";
13516 eval $ndbm_hdr_protochk
13517 set gdbmndbm gdbm/ndbm.h
13518 eval $ndbm_hdr_protochk
13519 set gdbm_ndbm gdbm-ndbm.h
13520 eval $ndbm_hdr_protochk
13522 : see if getaddrinfo exists
13523 set getaddrinfo d_getaddrinfo
13526 : see if getcwd exists
13527 set getcwd d_getcwd
13530 : see if getespwnam exists
13531 set getespwnam d_getespwnam
13534 : see if getfsstat exists
13535 set getfsstat d_getfsstat
13538 : see if getgrent exists
13539 set getgrent d_getgrent
13542 : see if getgrent_r exists
13543 set getgrent_r d_getgrent_r
13545 case "$d_getgrent_r" in
13547 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13548 case "$d_getgrent_r_proto:$usethreads" in
13549 ":define") d_getgrent_r_proto=define
13550 set d_getgrent_r_proto getgrent_r $hdrs
13554 case "$d_getgrent_r_proto" in
13556 case "$getgrent_r_proto" in
13557 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
13558 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBWR ;;
13560 case "$getgrent_r_proto" in
13561 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
13562 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIR ;;
13564 case "$getgrent_r_proto" in
13565 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
13566 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBW ;;
13568 case "$getgrent_r_proto" in
13569 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
13570 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBI ;;
13572 case "$getgrent_r_proto" in
13573 ''|0) try='int getgrent_r(struct group*, char*, int);'
13574 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBI ;;
13576 case "$getgrent_r_proto" in
13577 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
13578 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIH ;;
13580 case "$getgrent_r_proto" in
13581 ''|0) d_getgrent_r=undef
13583 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
13584 * ) case "$getgrent_r_proto" in
13585 REENTRANT_PROTO*) ;;
13586 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
13588 echo "Prototype: $try" ;;
13591 *) case "$usethreads" in
13592 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
13599 *) getgrent_r_proto=0
13603 : see if getgrgid_r exists
13604 set getgrgid_r d_getgrgid_r
13606 case "$d_getgrgid_r" in
13608 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13609 case "$d_getgrgid_r_proto:$usethreads" in
13610 ":define") d_getgrgid_r_proto=define
13611 set d_getgrgid_r_proto getgrgid_r $hdrs
13615 case "$d_getgrgid_r_proto" in
13617 case "$getgrgid_r_proto" in
13618 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
13619 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
13621 case "$getgrgid_r_proto" in
13622 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
13623 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
13625 case "$getgrgid_r_proto" in
13626 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
13627 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
13629 case "$getgrgid_r_proto" in
13630 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
13631 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
13633 case "$getgrgid_r_proto" in
13634 ''|0) d_getgrgid_r=undef
13636 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
13637 * ) case "$getgrgid_r_proto" in
13638 REENTRANT_PROTO*) ;;
13639 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
13641 echo "Prototype: $try" ;;
13644 *) case "$usethreads" in
13645 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
13652 *) getgrgid_r_proto=0
13656 : see if getgrnam_r exists
13657 set getgrnam_r d_getgrnam_r
13659 case "$d_getgrnam_r" in
13661 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13662 case "$d_getgrnam_r_proto:$usethreads" in
13663 ":define") d_getgrnam_r_proto=define
13664 set d_getgrnam_r_proto getgrnam_r $hdrs
13668 case "$d_getgrnam_r_proto" in
13670 case "$getgrnam_r_proto" in
13671 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
13672 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
13674 case "$getgrnam_r_proto" in
13675 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
13676 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
13678 case "$getgrnam_r_proto" in
13679 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
13680 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CBI ;;
13682 case "$getgrnam_r_proto" in
13683 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
13684 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
13686 case "$getgrnam_r_proto" in
13687 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
13688 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
13690 case "$getgrnam_r_proto" in
13691 ''|0) d_getgrnam_r=undef
13693 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
13694 * ) case "$getgrnam_r_proto" in
13695 REENTRANT_PROTO*) ;;
13696 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
13698 echo "Prototype: $try" ;;
13701 *) case "$usethreads" in
13702 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
13709 *) getgrnam_r_proto=0
13713 : see if gethostbyaddr exists
13714 set gethostbyaddr d_gethbyaddr
13717 : see if gethostbyname exists
13718 set gethostbyname d_gethbyname
13721 : see if gethostent exists
13722 set gethostent d_gethent
13725 : see how we will look up host name
13728 if set gethostname val -f d_gethname; eval $csym; $val; then
13729 echo 'gethostname() found.' >&4
13730 d_gethname="$define"
13733 if set uname val -f d_uname; eval $csym; $val; then
13736 uname() was found, but you're running xenix, and older versions of xenix
13737 have a broken uname(). If you don't really know whether your xenix is old
13738 enough to have a broken system call, use the default answer.
13743 "$define") dflt=n;;
13745 rp='Is your uname() broken?'
13748 n*) d_uname="$define"; call=uname;;
13751 echo 'uname() found.' >&4
13758 case "$d_gethname" in
13759 '') d_gethname="$undef";;
13762 '') d_uname="$undef";;
13764 case "$d_uname$d_gethname" in
13769 Every now and then someone has a $call() that lies about the hostname
13770 but can't be fixed for political or economic reasons. If you wish, I can
13771 pretend $call() isn't there and maybe compute hostname at run-time
13772 thanks to the '$phostname' command.
13775 rp="Shall I ignore $call() from now on?"
13778 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
13781 case "$phostname" in
13782 '') aphostname='';;
13783 *) case "$aphostname" in
13785 *) set X $phostname
13789 file=`./loc $file $file $pth`
13790 aphostname=`echo $file $*`
13795 case "$d_uname$d_gethname" in
13798 case "$phostname" in
13800 echo "There will be no way for $package to get your hostname." >&4;;
13802 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
13806 case "$d_phostname" in
13807 '') d_phostname="$undef";;
13810 : see if gethostbyaddr_r exists
13811 set gethostbyaddr_r d_gethostbyaddr_r
13813 case "$d_gethostbyaddr_r" in
13815 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13816 case "$d_gethostbyaddr_r_proto:$usethreads" in
13817 ":define") d_gethostbyaddr_r_proto=define
13818 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
13822 case "$d_gethostbyaddr_r_proto" in
13824 case "$gethostbyaddr_r_proto" in
13825 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13826 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
13828 case "$gethostbyaddr_r_proto" in
13829 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
13830 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
13832 case "$gethostbyaddr_r_proto" in
13833 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
13834 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
13836 case "$gethostbyaddr_r_proto" in
13837 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
13838 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
13840 case "$gethostbyaddr_r_proto" in
13841 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
13842 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
13844 case "$gethostbyaddr_r_proto" in
13845 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
13846 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
13848 case "$gethostbyaddr_r_proto" in
13849 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
13850 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
13852 case "$gethostbyaddr_r_proto" in
13853 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
13854 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
13856 case "$gethostbyaddr_r_proto" in
13857 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
13858 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
13860 case "$gethostbyaddr_r_proto" in
13861 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
13862 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
13864 case "$gethostbyaddr_r_proto" in
13865 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13866 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
13868 case "$gethostbyaddr_r_proto" in
13869 ''|0) d_gethostbyaddr_r=undef
13870 gethostbyaddr_r_proto=0
13871 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
13872 * ) case "$gethostbyaddr_r_proto" in
13873 REENTRANT_PROTO*) ;;
13874 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
13876 echo "Prototype: $try" ;;
13879 *) case "$usethreads" in
13880 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
13882 d_gethostbyaddr_r=undef
13883 gethostbyaddr_r_proto=0
13887 *) gethostbyaddr_r_proto=0
13891 : see if gethostbyname_r exists
13892 set gethostbyname_r d_gethostbyname_r
13894 case "$d_gethostbyname_r" in
13896 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13897 case "$d_gethostbyname_r_proto:$usethreads" in
13898 ":define") d_gethostbyname_r_proto=define
13899 set d_gethostbyname_r_proto gethostbyname_r $hdrs
13903 case "$d_gethostbyname_r_proto" in
13905 case "$gethostbyname_r_proto" in
13906 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
13907 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
13909 case "$gethostbyname_r_proto" in
13910 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
13911 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
13913 case "$gethostbyname_r_proto" in
13914 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
13915 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
13917 case "$gethostbyname_r_proto" in
13918 ''|0) d_gethostbyname_r=undef
13919 gethostbyname_r_proto=0
13920 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
13921 * ) case "$gethostbyname_r_proto" in
13922 REENTRANT_PROTO*) ;;
13923 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
13925 echo "Prototype: $try" ;;
13928 *) case "$usethreads" in
13929 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
13931 d_gethostbyname_r=undef
13932 gethostbyname_r_proto=0
13936 *) gethostbyname_r_proto=0
13940 : see if gethostent_r exists
13941 set gethostent_r d_gethostent_r
13943 case "$d_gethostent_r" in
13945 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13946 case "$d_gethostent_r_proto:$usethreads" in
13947 ":define") d_gethostent_r_proto=define
13948 set d_gethostent_r_proto gethostent_r $hdrs
13952 case "$d_gethostent_r_proto" in
13954 case "$gethostent_r_proto" in
13955 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
13956 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
13958 case "$gethostent_r_proto" in
13959 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
13960 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBIE ;;
13962 case "$gethostent_r_proto" in
13963 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
13964 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBIE ;;
13966 case "$gethostent_r_proto" in
13967 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
13968 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBI ;;
13970 case "$gethostent_r_proto" in
13971 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
13972 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBI ;;
13974 case "$gethostent_r_proto" in
13975 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
13976 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SD ;;
13978 case "$gethostent_r_proto" in
13979 ''|0) d_gethostent_r=undef
13980 gethostent_r_proto=0
13981 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
13982 * ) case "$gethostent_r_proto" in
13983 REENTRANT_PROTO*) ;;
13984 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
13986 echo "Prototype: $try" ;;
13989 *) case "$usethreads" in
13990 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
13992 d_gethostent_r=undef
13993 gethostent_r_proto=0
13997 *) gethostent_r_proto=0
14001 : see if prototypes for various gethostxxx netdb.h functions are available
14003 set d_gethostprotos gethostent $i_netdb netdb.h
14006 : see if getitimer exists
14007 set getitimer d_getitimer
14010 : see if getlogin exists
14011 set getlogin d_getlogin
14014 : see if getlogin_r exists
14015 set getlogin_r d_getlogin_r
14017 case "$d_getlogin_r" in
14019 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
14020 case "$d_getlogin_r_proto:$usethreads" in
14021 ":define") d_getlogin_r_proto=define
14022 set d_getlogin_r_proto getlogin_r $hdrs
14026 case "$d_getlogin_r_proto" in
14028 case "$getlogin_r_proto" in
14029 ''|0) try='int getlogin_r(char*, size_t);'
14030 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BW ;;
14032 case "$getlogin_r_proto" in
14033 ''|0) try='int getlogin_r(char*, int);'
14034 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BI ;;
14036 case "$getlogin_r_proto" in
14037 ''|0) try='char* getlogin_r(char*, size_t);'
14038 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BW ;;
14040 case "$getlogin_r_proto" in
14041 ''|0) try='char* getlogin_r(char*, int);'
14042 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BI ;;
14044 case "$getlogin_r_proto" in
14045 ''|0) d_getlogin_r=undef
14047 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
14048 * ) case "$getlogin_r_proto" in
14049 REENTRANT_PROTO*) ;;
14050 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
14052 echo "Prototype: $try" ;;
14055 *) case "$usethreads" in
14056 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
14063 *) getlogin_r_proto=0
14067 : see if getmnt exists
14068 set getmnt d_getmnt
14071 : see if getmntent exists
14072 set getmntent d_getmntent
14075 : see if getnameinfo exists
14076 set getnameinfo d_getnameinfo
14079 : see if getnetbyaddr exists
14080 set getnetbyaddr d_getnbyaddr
14083 : see if getnetbyname exists
14084 set getnetbyname d_getnbyname
14087 : see if getnetent exists
14088 set getnetent d_getnent
14091 : see if getnetbyaddr_r exists
14092 set getnetbyaddr_r d_getnetbyaddr_r
14094 case "$d_getnetbyaddr_r" in
14096 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14097 case "$d_getnetbyaddr_r_proto:$usethreads" in
14098 ":define") d_getnetbyaddr_r_proto=define
14099 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
14103 case "$d_getnetbyaddr_r_proto" in
14105 case "$getnetbyaddr_r_proto" in
14106 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
14107 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
14109 case "$getnetbyaddr_r_proto" in
14110 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
14111 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
14113 case "$getnetbyaddr_r_proto" in
14114 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
14115 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
14117 case "$getnetbyaddr_r_proto" in
14118 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
14119 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
14121 case "$getnetbyaddr_r_proto" in
14122 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
14123 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
14125 case "$getnetbyaddr_r_proto" in
14126 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
14127 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
14129 case "$getnetbyaddr_r_proto" in
14130 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
14131 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
14133 case "$getnetbyaddr_r_proto" in
14134 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
14135 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
14137 case "$getnetbyaddr_r_proto" in
14138 ''|0) d_getnetbyaddr_r=undef
14139 getnetbyaddr_r_proto=0
14140 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
14141 * ) case "$getnetbyaddr_r_proto" in
14142 REENTRANT_PROTO*) ;;
14143 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
14145 echo "Prototype: $try" ;;
14148 *) case "$usethreads" in
14149 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
14151 d_getnetbyaddr_r=undef
14152 getnetbyaddr_r_proto=0
14156 *) getnetbyaddr_r_proto=0
14160 : see if getnetbyname_r exists
14161 set getnetbyname_r d_getnetbyname_r
14163 case "$d_getnetbyname_r" in
14165 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14166 case "$d_getnetbyname_r_proto:$usethreads" in
14167 ":define") d_getnetbyname_r_proto=define
14168 set d_getnetbyname_r_proto getnetbyname_r $hdrs
14172 case "$d_getnetbyname_r_proto" in
14174 case "$getnetbyname_r_proto" in
14175 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
14176 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
14178 case "$getnetbyname_r_proto" in
14179 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
14180 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
14182 case "$getnetbyname_r_proto" in
14183 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
14184 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
14186 case "$getnetbyname_r_proto" in
14187 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
14188 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
14190 case "$getnetbyname_r_proto" in
14191 ''|0) d_getnetbyname_r=undef
14192 getnetbyname_r_proto=0
14193 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
14194 * ) case "$getnetbyname_r_proto" in
14195 REENTRANT_PROTO*) ;;
14196 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
14198 echo "Prototype: $try" ;;
14201 *) case "$usethreads" in
14202 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
14204 d_getnetbyname_r=undef
14205 getnetbyname_r_proto=0
14209 *) getnetbyname_r_proto=0
14213 : see if getnetent_r exists
14214 set getnetent_r d_getnetent_r
14216 case "$d_getnetent_r" in
14218 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14219 case "$d_getnetent_r_proto:$usethreads" in
14220 ":define") d_getnetent_r_proto=define
14221 set d_getnetent_r_proto getnetent_r $hdrs
14225 case "$d_getnetent_r_proto" in
14227 case "$getnetent_r_proto" in
14228 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
14229 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
14231 case "$getnetent_r_proto" in
14232 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
14233 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBIE ;;
14235 case "$getnetent_r_proto" in
14236 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
14237 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBIE ;;
14239 case "$getnetent_r_proto" in
14240 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
14241 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBI ;;
14243 case "$getnetent_r_proto" in
14244 ''|0) try='int getnetent_r(struct netent*, char*, int);'
14245 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBI ;;
14247 case "$getnetent_r_proto" in
14248 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
14249 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SD ;;
14251 case "$getnetent_r_proto" in
14252 ''|0) d_getnetent_r=undef
14253 getnetent_r_proto=0
14254 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
14255 * ) case "$getnetent_r_proto" in
14256 REENTRANT_PROTO*) ;;
14257 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
14259 echo "Prototype: $try" ;;
14262 *) case "$usethreads" in
14263 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
14265 d_getnetent_r=undef
14266 getnetent_r_proto=0
14270 *) getnetent_r_proto=0
14274 : see if prototypes for various getnetxxx netdb.h functions are available
14276 set d_getnetprotos getnetent $i_netdb netdb.h
14279 : see if getpagesize exists
14280 set getpagesize d_getpagsz
14283 : Optional checks for getprotobyname and getprotobynumber
14285 : see if getprotobyname exists
14286 set getprotobyname d_getpbyname
14289 : see if getprotobynumber exists
14290 set getprotobynumber d_getpbynumber
14293 : see if getprotoent exists
14294 set getprotoent d_getpent
14297 : see if getpgid exists
14298 set getpgid d_getpgid
14301 : see if getpgrp2 exists
14302 set getpgrp2 d_getpgrp2
14305 : see if getppid exists
14306 set getppid d_getppid
14309 : see if getpriority exists
14310 set getpriority d_getprior
14313 : see if getprotobyname_r exists
14314 set getprotobyname_r d_getprotobyname_r
14316 case "$d_getprotobyname_r" in
14318 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14319 case "$d_getprotobyname_r_proto:$usethreads" in
14320 ":define") d_getprotobyname_r_proto=define
14321 set d_getprotobyname_r_proto getprotobyname_r $hdrs
14325 case "$d_getprotobyname_r_proto" in
14327 case "$getprotobyname_r_proto" in
14328 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
14329 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
14331 case "$getprotobyname_r_proto" in
14332 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
14333 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
14335 case "$getprotobyname_r_proto" in
14336 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
14337 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
14339 case "$getprotobyname_r_proto" in
14340 ''|0) d_getprotobyname_r=undef
14341 getprotobyname_r_proto=0
14342 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
14343 * ) case "$getprotobyname_r_proto" in
14344 REENTRANT_PROTO*) ;;
14345 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
14347 echo "Prototype: $try" ;;
14350 *) case "$usethreads" in
14351 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
14353 d_getprotobyname_r=undef
14354 getprotobyname_r_proto=0
14358 *) getprotobyname_r_proto=0
14362 : see if getprotobynumber_r exists
14363 set getprotobynumber_r d_getprotobynumber_r
14365 case "$d_getprotobynumber_r" in
14367 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14368 case "$d_getprotobynumber_r_proto:$usethreads" in
14369 ":define") d_getprotobynumber_r_proto=define
14370 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
14374 case "$d_getprotobynumber_r_proto" in
14376 case "$getprotobynumber_r_proto" in
14377 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
14378 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
14380 case "$getprotobynumber_r_proto" in
14381 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
14382 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
14384 case "$getprotobynumber_r_proto" in
14385 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
14386 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
14388 case "$getprotobynumber_r_proto" in
14389 ''|0) d_getprotobynumber_r=undef
14390 getprotobynumber_r_proto=0
14391 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
14392 * ) case "$getprotobynumber_r_proto" in
14393 REENTRANT_PROTO*) ;;
14394 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
14396 echo "Prototype: $try" ;;
14399 *) case "$usethreads" in
14400 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
14402 d_getprotobynumber_r=undef
14403 getprotobynumber_r_proto=0
14407 *) getprotobynumber_r_proto=0
14411 : see if getprotoent_r exists
14412 set getprotoent_r d_getprotoent_r
14414 case "$d_getprotoent_r" in
14416 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14417 case "$d_getprotoent_r_proto:$usethreads" in
14418 ":define") d_getprotoent_r_proto=define
14419 set d_getprotoent_r_proto getprotoent_r $hdrs
14423 case "$d_getprotoent_r_proto" in
14425 case "$getprotoent_r_proto" in
14426 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
14427 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
14429 case "$getprotoent_r_proto" in
14430 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
14431 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBI ;;
14433 case "$getprotoent_r_proto" in
14434 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
14435 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=S_SBI ;;
14437 case "$getprotoent_r_proto" in
14438 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
14439 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SD ;;
14441 case "$getprotoent_r_proto" in
14442 ''|0) d_getprotoent_r=undef
14443 getprotoent_r_proto=0
14444 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
14445 * ) case "$getprotoent_r_proto" in
14446 REENTRANT_PROTO*) ;;
14447 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
14449 echo "Prototype: $try" ;;
14452 *) case "$usethreads" in
14453 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
14455 d_getprotoent_r=undef
14456 getprotoent_r_proto=0
14460 *) getprotoent_r_proto=0
14464 : see if prototypes for various getprotoxxx netdb.h functions are available
14466 set d_getprotoprotos getprotoent $i_netdb netdb.h
14469 : see if getprpwnam exists
14470 set getprpwnam d_getprpwnam
14473 : see if getpwent exists
14474 set getpwent d_getpwent
14477 : see if getpwent_r exists
14478 set getpwent_r d_getpwent_r
14480 case "$d_getpwent_r" in
14482 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14483 case "$d_getpwent_r_proto:$usethreads" in
14484 ":define") d_getpwent_r_proto=define
14485 set d_getpwent_r_proto getpwent_r $hdrs
14489 case "$d_getpwent_r_proto" in
14491 case "$getpwent_r_proto" in
14492 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
14493 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBWR ;;
14495 case "$getpwent_r_proto" in
14496 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
14497 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIR ;;
14499 case "$getpwent_r_proto" in
14500 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
14501 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBW ;;
14503 case "$getpwent_r_proto" in
14504 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
14505 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBI ;;
14507 case "$getpwent_r_proto" in
14508 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
14509 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBI ;;
14511 case "$getpwent_r_proto" in
14512 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
14513 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIH ;;
14515 case "$getpwent_r_proto" in
14516 ''|0) d_getpwent_r=undef
14518 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
14519 * ) case "$getpwent_r_proto" in
14520 REENTRANT_PROTO*) ;;
14521 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
14523 echo "Prototype: $try" ;;
14526 *) case "$usethreads" in
14527 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
14534 *) getpwent_r_proto=0
14538 : see if getpwnam_r exists
14539 set getpwnam_r d_getpwnam_r
14541 case "$d_getpwnam_r" in
14543 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14544 case "$d_getpwnam_r_proto:$usethreads" in
14545 ":define") d_getpwnam_r_proto=define
14546 set d_getpwnam_r_proto getpwnam_r $hdrs
14550 case "$d_getpwnam_r_proto" in
14552 case "$getpwnam_r_proto" in
14553 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
14554 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
14556 case "$getpwnam_r_proto" in
14557 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
14558 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
14560 case "$getpwnam_r_proto" in
14561 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
14562 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
14564 case "$getpwnam_r_proto" in
14565 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
14566 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
14568 case "$getpwnam_r_proto" in
14569 ''|0) d_getpwnam_r=undef
14571 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
14572 * ) case "$getpwnam_r_proto" in
14573 REENTRANT_PROTO*) ;;
14574 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
14576 echo "Prototype: $try" ;;
14579 *) case "$usethreads" in
14580 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
14587 *) getpwnam_r_proto=0
14591 : see if getpwuid_r exists
14592 set getpwuid_r d_getpwuid_r
14594 case "$d_getpwuid_r" in
14596 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14597 case "$d_getpwuid_r_proto:$usethreads" in
14598 ":define") d_getpwuid_r_proto=define
14599 set d_getpwuid_r_proto getpwuid_r $hdrs
14603 case "$d_getpwuid_r_proto" in
14605 case "$getpwuid_r_proto" in
14606 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
14607 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
14609 case "$getpwuid_r_proto" in
14610 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
14611 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
14613 case "$getpwuid_r_proto" in
14614 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
14615 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
14617 case "$getpwuid_r_proto" in
14618 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
14619 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
14621 case "$getpwuid_r_proto" in
14622 ''|0) d_getpwuid_r=undef
14624 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
14625 * ) case "$getpwuid_r_proto" in
14626 REENTRANT_PROTO*) ;;
14627 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
14629 echo "Prototype: $try" ;;
14632 *) case "$usethreads" in
14633 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
14640 *) getpwuid_r_proto=0
14644 : Optional checks for getsbyname and getsbyport
14646 : see if getservbyname exists
14647 set getservbyname d_getsbyname
14650 : see if getservbyport exists
14651 set getservbyport d_getsbyport
14654 : see if getservent exists
14655 set getservent d_getsent
14658 : see if getservbyname_r exists
14659 set getservbyname_r d_getservbyname_r
14661 case "$d_getservbyname_r" in
14663 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14664 case "$d_getservbyname_r_proto:$usethreads" in
14665 ":define") d_getservbyname_r_proto=define
14666 set d_getservbyname_r_proto getservbyname_r $hdrs
14670 case "$d_getservbyname_r_proto" in
14672 case "$getservbyname_r_proto" in
14673 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
14674 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
14676 case "$getservbyname_r_proto" in
14677 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
14678 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
14680 case "$getservbyname_r_proto" in
14681 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
14682 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
14684 case "$getservbyname_r_proto" in
14685 ''|0) d_getservbyname_r=undef
14686 getservbyname_r_proto=0
14687 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
14688 * ) case "$getservbyname_r_proto" in
14689 REENTRANT_PROTO*) ;;
14690 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
14692 echo "Prototype: $try" ;;
14695 *) case "$usethreads" in
14696 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
14698 d_getservbyname_r=undef
14699 getservbyname_r_proto=0
14703 *) getservbyname_r_proto=0
14707 : see if getservbyport_r exists
14708 set getservbyport_r d_getservbyport_r
14710 case "$d_getservbyport_r" in
14712 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14713 case "$d_getservbyport_r_proto:$usethreads" in
14714 ":define") d_getservbyport_r_proto=define
14715 set d_getservbyport_r_proto getservbyport_r $hdrs
14719 case "$d_getservbyport_r_proto" in
14721 case "$getservbyport_r_proto" in
14722 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
14723 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
14725 case "$getservbyport_r_proto" in
14726 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
14727 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
14729 case "$getservbyport_r_proto" in
14730 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
14731 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
14733 case "$getservbyport_r_proto" in
14734 ''|0) d_getservbyport_r=undef
14735 getservbyport_r_proto=0
14736 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
14737 * ) case "$getservbyport_r_proto" in
14738 REENTRANT_PROTO*) ;;
14739 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
14741 echo "Prototype: $try" ;;
14744 *) case "$usethreads" in
14745 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
14747 d_getservbyport_r=undef
14748 getservbyport_r_proto=0
14752 *) getservbyport_r_proto=0
14756 : see if getservent_r exists
14757 set getservent_r d_getservent_r
14759 case "$d_getservent_r" in
14761 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14762 case "$d_getservent_r_proto:$usethreads" in
14763 ":define") d_getservent_r_proto=define
14764 set d_getservent_r_proto getservent_r $hdrs
14768 case "$d_getservent_r_proto" in
14770 case "$getservent_r_proto" in
14771 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
14772 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBWR ;;
14774 case "$getservent_r_proto" in
14775 ''|0) try='int getservent_r(struct servent*, char*, int);'
14776 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBI ;;
14778 case "$getservent_r_proto" in
14779 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
14780 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=S_SBI ;;
14782 case "$getservent_r_proto" in
14783 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
14784 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SD ;;
14786 case "$getservent_r_proto" in
14787 ''|0) d_getservent_r=undef
14788 getservent_r_proto=0
14789 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
14790 * ) case "$getservent_r_proto" in
14791 REENTRANT_PROTO*) ;;
14792 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
14794 echo "Prototype: $try" ;;
14797 *) case "$usethreads" in
14798 define) echo "getservent_r has no prototype, not using it." >&4 ;;
14800 d_getservent_r=undef
14801 getservent_r_proto=0
14805 *) getservent_r_proto=0
14809 : see if prototypes for various getservxxx netdb.h functions are available
14811 set d_getservprotos getservent $i_netdb netdb.h
14814 : see if getspnam exists
14815 set getspnam d_getspnam
14818 : see if this is a shadow.h system
14819 set shadow.h i_shadow
14822 : see if getspnam_r exists
14823 set getspnam_r d_getspnam_r
14825 case "$d_getspnam_r" in
14827 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
14828 case "$d_getspnam_r_proto:$usethreads" in
14829 ":define") d_getspnam_r_proto=define
14830 set d_getspnam_r_proto getspnam_r $hdrs
14834 case "$d_getspnam_r_proto" in
14836 case "$getspnam_r_proto" in
14837 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
14838 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
14840 case "$getspnam_r_proto" in
14841 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
14842 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=S_CSBI ;;
14844 case "$getspnam_r_proto" in
14845 ''|0) d_getspnam_r=undef
14847 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
14848 * ) case "$getspnam_r_proto" in
14849 REENTRANT_PROTO*) ;;
14850 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
14852 echo "Prototype: $try" ;;
14855 *) case "$usethreads" in
14856 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
14863 *) getspnam_r_proto=0
14867 : see if gettimeofday or ftime exists
14868 set gettimeofday d_gettimeod
14870 case "$d_gettimeod" in
14876 val="$undef"; set d_ftime; eval $setvar
14879 case "$d_gettimeod$d_ftime" in
14882 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
14886 : see if gmtime_r exists
14887 set gmtime_r d_gmtime_r
14889 case "$d_gmtime_r" in
14891 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14892 case "$d_gmtime_r_proto:$usethreads" in
14893 ":define") d_gmtime_r_proto=define
14894 set d_gmtime_r_proto gmtime_r $hdrs
14898 case "$d_gmtime_r_proto" in
14900 case "$gmtime_r_proto" in
14901 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
14902 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=S_TS ;;
14904 case "$gmtime_r_proto" in
14905 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
14906 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=I_TS ;;
14908 case "$gmtime_r_proto" in
14909 ''|0) d_gmtime_r=undef
14911 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
14912 * ) case "$gmtime_r_proto" in
14913 REENTRANT_PROTO*) ;;
14914 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
14916 echo "Prototype: $try" ;;
14919 *) case "$usethreads" in
14920 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
14927 *) gmtime_r_proto=0
14931 : see if hasmntopt exists
14932 set hasmntopt d_hasmntopt
14935 : see if this is a netinet/in.h or sys/in.h system
14936 set netinet/in.h i_niin sys/in.h i_sysin
14939 : see if arpa/inet.h has to be included
14940 set arpa/inet.h i_arpainet
14943 : see if htonl --and friends-- exists
14948 : Maybe they are macros.
14951 $cat >htonl.c <<EOM
14953 #include <sys/types.h>
14954 #$i_niin I_NETINET_IN
14956 #$i_arpainet I_ARPA_INET
14957 #ifdef I_NETINET_IN
14958 #include <netinet/in.h>
14961 #include <sys/in.h>
14964 #include <arpa/inet.h>
14967 printf("Defined as a macro.");
14970 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
14971 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
14973 echo "But it seems to be defined as a macro." >&4
14981 : see if ilogbl exists
14982 set ilogbl d_ilogbl
14987 if set index val -f; eval $csym; $val; then
14988 if set strchr val -f d_strchr; eval $csym; $val; then
14989 if $contains strchr "$strings" >/dev/null 2>&1 ; then
14992 echo "strchr() found." >&4
14996 echo "index() found." >&4
15001 echo "index() found." >&4
15004 if set strchr val -f d_strchr; eval $csym; $val; then
15007 echo "strchr() found." >&4
15009 echo "No index() or strchr() found!" >&4
15014 set d_strchr; eval $setvar
15016 set d_index; eval $setvar
15018 : check whether inet_aton exists
15019 set inet_aton d_inetaton
15022 : see if inet_ntop exists
15023 set inet_ntop d_inetntop
15026 : see if inet_pton exists
15027 set inet_pton d_inetpton
15032 $cat >isascii.c <<EOCP
15035 #$i_stdlib I_STDLIB
15037 #include <stdlib.h>
15048 if eval $compile; then
15049 echo "isascii() found." >&4
15052 echo "isascii() NOT found." >&4
15061 $cat >isblank.c <<'EOCP'
15072 if $cc $ccflags $ldflags -o isblank isblank.c $libs >/dev/null 2>&1 ; then
15073 echo "isblank() found." >&4
15076 echo "isblank() NOT found." >&4
15083 : see if isfinite exists
15084 set isfinite d_isfinite
15087 : see if isinf exists
15091 : see if isnan exists
15095 : see if isnanl exists
15096 set isnanl d_isnanl
15099 : see if killpg exists
15100 set killpg d_killpg
15103 : see if lchown exists
15105 $cat > try.c <<'EOCP'
15106 /* System header to define __stub macros and hopefully few prototypes,
15107 which can conflict with char lchown(); below. */
15108 #include <assert.h>
15109 /* Override any gcc2 internal prototype to avoid an error. */
15110 /* We use char because int might match the return type of a gcc2
15111 builtin and then its argument prototype would still apply. */
15114 /* The GNU C library defines this for functions which it implements
15115 to always fail with ENOSYS. Some functions are actually named
15116 something starting with __ and the normal name is an alias. */
15117 #if defined (__stub_lchown) || defined (__stub___lchown)
15125 if eval $compile; then
15126 $echo "lchown() found." >&4
15129 $echo "lchown() NOT found." >&4
15135 : See if number of significant digits in a double precision number is known
15137 $cat >ldbl_dig.c <<EOM
15138 #$i_limits I_LIMITS
15141 #include <limits.h>
15147 printf("Contains LDBL_DIG");
15150 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
15151 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
15152 echo "LDBL_DIG found." >&4
15155 echo "LDBL_DIG NOT found." >&4
15162 : see if this is a math.h system
15166 : check to see if math.h defines _LIB_VERSION
15167 d_libm_lib_version="$undef"
15171 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
15173 #include <unistd.h>
15175 int main (int argc, char *argv[])
15177 printf ("%d\n", _LIB_VERSION);
15182 if eval $compile; then
15184 echo "Yes, it does ($foo)" >&4
15185 d_libm_lib_version="$define"
15187 echo "No, it does not (probably harmless)" >&4
15194 : see if link exists
15198 : see if localtime_r exists
15199 set localtime_r d_localtime_r
15201 case "$d_localtime_r" in
15203 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15204 case "$d_localtime_r_proto:$usethreads" in
15205 ":define") d_localtime_r_proto=define
15206 set d_localtime_r_proto localtime_r $hdrs
15210 case "$d_localtime_r_proto" in
15212 case "$localtime_r_proto" in
15213 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
15214 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=S_TS ;;
15216 case "$localtime_r_proto" in
15217 ''|0) try='int localtime_r(const time_t*, struct tm*);'
15218 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=I_TS ;;
15220 case "$localtime_r_proto" in
15221 ''|0) d_localtime_r=undef
15222 localtime_r_proto=0
15223 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
15224 * ) case "$localtime_r_proto" in
15225 REENTRANT_PROTO*) ;;
15226 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
15228 echo "Prototype: $try" ;;
15231 *) case "$usethreads" in
15232 define) echo "localtime_r has no prototype, not using it." >&4 ;;
15234 d_localtime_r=undef
15235 localtime_r_proto=0
15239 *) localtime_r_proto=0
15243 : see if localtime_r calls tzset
15244 case "$localtime_r_proto" in
15247 /* Does our libc's localtime_r call tzset ?
15248 * return 0 if so, 1 otherwise.
15250 #$i_systypes I_SYS_TYPES
15251 #$i_unistd I_UNISTD
15253 #$i_stdlib I_STDLIB
15254 #$i_string I_STRING
15255 #$i_malloc I_MALLOC
15257 # include <sys/types.h>
15260 # include <unistd.h>
15266 #include <stdlib.h>
15269 # include <string.h>
15271 # include <strings.h>
15274 # include <malloc.h>
15278 time_t t = time(0L);
15279 char w_tz[]="TZ" "=GMT+5",
15280 e_tz[]="TZ" "=GMT-5",
15281 *tz_e = (char*)malloc(16),
15282 *tz_w = (char*)malloc(16);
15283 struct tm tm_e, tm_w;
15284 memset(&tm_e,'\0',sizeof(struct tm));
15285 memset(&tm_w,'\0',sizeof(struct tm));
15290 localtime_r(&t, &tm_e);
15293 localtime_r(&t, &tm_w);
15295 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
15301 if eval $compile; then
15302 if $run ./try; then
15303 d_localtime_r_needs_tzset=undef;
15305 d_localtime_r_needs_tzset=define;
15308 d_localtime_r_needs_tzset=undef;
15312 d_localtime_r_needs_tzset=undef;
15317 : see if localeconv exists
15318 set localeconv d_locconv
15321 : see if lockf exists
15325 : see if prototype for lseek is available
15327 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
15330 : see if lstat exists
15334 : see if madvise exists
15335 set madvise d_madvise
15338 : see if malloc_size exists
15339 set malloc_size d_malloc_size
15342 : see if malloc_size_good exists
15343 set malloc_good_size d_malloc_good_size
15346 : see if mblen exists
15350 : see if mbstowcs exists
15351 set mbstowcs d_mbstowcs
15354 : see if mbtowc exists
15355 set mbtowc d_mbtowc
15358 : see if memchr exists
15359 set memchr d_memchr
15362 : see if memcmp exists
15363 set memcmp d_memcmp
15366 : see if memcpy exists
15367 set memcpy d_memcpy
15370 : see if memmove exists
15371 set memmove d_memmove
15374 : see if memset exists
15375 set memset d_memset
15378 : see if mkdir exists
15382 : see if mkdtemp exists
15383 set mkdtemp d_mkdtemp
15386 : see if mkfifo exists
15387 set mkfifo d_mkfifo
15390 : see if mkstemp exists
15391 set mkstemp d_mkstemp
15394 : see if mkstemps exists
15395 set mkstemps d_mkstemps
15398 : see if mktime exists
15399 set mktime d_mktime
15402 : see if this is a sys/mman.h system
15403 set sys/mman.h i_sysmman
15406 : see if mmap exists
15409 : see what shmat returns
15410 : default to something harmless
15412 case "$i_sysmman$d_mmap" in
15414 $cat >mmap.c <<'END'
15415 #include <sys/mman.h>
15418 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
15423 echo "and it returns ($mmaptype)." >&4
15429 : see if sqrtl exists
15433 : see if scalbnl exists
15434 set scalbnl d_scalbnl
15437 : see if modfl exists
15441 : see if prototype for modfl is available
15443 set d_modflproto modfl $i_math math.h
15446 d_modfl_pow32_bug="$undef"
15448 case "$d_longdbl$d_modfl" in
15451 Checking to see whether your modfl() is okay for large values...
15457 if $test "X$d_modflproto" != "X$define"; then
15458 $cat >>try.c <<EOCP
15459 /* Sigh. many current glibcs provide the function, but do not prototype it. */
15460 long double modfl (long double, long double *);
15463 $cat >>try.c <<EOCP
15465 long double nv = 4294967303.15;
15471 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
15475 case "$osname:$gccversion" in
15476 aix:) saveccflags="$ccflags"
15477 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
15480 if eval $compile; then
15483 *" 4294967303.150000 1.150000 4294967302.000000")
15484 echo >&4 "Your modfl() is broken for large values."
15485 d_modfl_pow32_bug="$define"
15487 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
15491 *" 4294967303.150000 0.150000 4294967303.000000")
15492 echo >&4 "Your modfl() seems okay for large values."
15494 *) echo >&4 "I don't understand your modfl() at all."
15500 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
15503 case "$osname:$gccversion" in
15504 aix:) ccflags="$saveccflags" ;; # restore
15509 if $test "$uselongdouble" = "$define"; then
15511 if $test "$d_sqrtl" != "$define"; then
15512 message="$message sqrtl"
15514 if $test "$d_modfl" != "$define"; then
15515 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
15516 echo "You have both aintl and copysignl, so I can emulate modfl."
15518 message="$message modfl"
15521 if $test "$d_frexpl" != "$define"; then
15522 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
15523 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
15525 message="$message frexpl"
15529 if $test "$message" != ""; then
15532 *** You requested the use of long doubles but you do not seem to have
15533 *** the following mathematical functions needed for long double support:
15535 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
15536 *** Cannot continue, aborting.
15544 : see if mprotect exists
15545 set mprotect d_mprotect
15548 : see if msgctl exists
15549 set msgctl d_msgctl
15552 : see if msgget exists
15553 set msgget d_msgget
15556 : see if msgsnd exists
15557 set msgsnd d_msgsnd
15560 : see if msgrcv exists
15561 set msgrcv d_msgrcv
15564 : see how much of the 'msg*(2)' library is present.
15567 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
15568 *"$undef"*) h_msg=false;;
15572 case "`ipcs 2>&1`" in
15573 "SVID messages"*"not configured"*)
15574 echo "Your $osname does not have the msg*(2) configured." >&4
15577 set msgctl d_msgctl
15579 set msgget d_msgget
15581 set msgsnd d_msgsnd
15583 set msgrcv d_msgrcv
15589 : we could also check for sys/ipc.h ...
15590 if $h_msg && $test `./findhdr sys/msg.h`; then
15591 echo "You have the full msg*(2) library." >&4
15594 echo "You don't have the full msg*(2) library." >&4
15600 : Check for msghdr_s
15602 echo "Checking to see if your system supports struct msghdr..." >&4
15603 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
15605 case "$d_msghdr_s" in
15606 "$define") echo "Yes, it does." ;;
15607 *) echo "No, it doesn't." ;;
15611 : see if msync exists
15615 : see if munmap exists
15616 set munmap d_munmap
15619 : see if nice exists
15623 : see if this is a langinfo.h system
15624 set langinfo.h i_langinfo
15627 : see if nl_langinfo exists
15628 set nl_langinfo d_nl_langinfo
15631 : check for volatile keyword
15633 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
15634 $cat >try.c <<'EOCP'
15637 typedef struct _goo_struct goo_struct;
15638 goo_struct * volatile goo = ((goo_struct *)0);
15639 struct _goo_struct {
15644 typedef unsigned short foo_t;
15645 char *volatile foo;
15647 volatile foo_t blech;
15651 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
15653 echo "Yup, it does."
15656 echo "Nope, it doesn't."
15662 : Check basic sizes
15664 $echo "Choosing the C types to be used for Perl's internal types..." >&4
15666 case "$use64bitint:$d_quad:$quadtype" in
15669 uvtype="$uquadtype"
15674 uvtype="unsigned long"
15680 case "$uselongdouble:$d_longdbl" in
15682 nvtype="long double"
15683 nvsize=$longdblsize
15690 $echo "(IV will be "$ivtype", $ivsize bytes)"
15691 $echo "(UV will be "$uvtype", $uvsize bytes)"
15692 $echo "(NV will be "$nvtype", $nvsize bytes)"
15695 #$i_inttypes I_INTTYPES
15697 #include <inttypes.h>
15702 int8_t i = INT8_MAX;
15703 uint8_t u = UINT8_MAX;
15704 printf("int8_t\n");
15707 int16_t i = INT16_MAX;
15708 uint16_t i = UINT16_MAX;
15709 printf("int16_t\n");
15712 int32_t i = INT32_MAX;
15713 uint32_t u = UINT32_MAX;
15714 printf("int32_t\n");
15719 i8type="signed char"
15720 u8type="unsigned char"
15725 '') case "$shortsize" in
15727 u16type="unsigned short"
15735 '') set try -DINT16
15736 if eval $compile; then
15737 case "`$run ./try`" in
15749 '') if $test $shortsize -ge 2; then
15751 u16type="unsigned short"
15759 '') case "$longsize" in
15761 u32type="unsigned long"
15765 *) case "$intsize" in
15767 u32type="unsigned int"
15777 '') set try -DINT32
15778 if eval $compile; then
15779 case "`$run ./try`" in
15791 '') if $test $intsize -ge 4; then
15793 u32type="unsigned int"
15801 '') case "$d_quad:$quadtype" in
15803 i64type="$quadtype"
15804 u64type="$uquadtype"
15812 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
15813 : volatile so that the compiler has to store it out to memory.
15814 if test X"$d_volatile" = X"$define"; then
15819 #$i_stdlib I_STDLIB
15821 #include <stdlib.h>
15823 #include <sys/types.h>
15824 #include <signal.h>
15826 $volatile int bletched = 0;
15827 $signal_t blech(int s) { bletched = 1; }
15832 int n = 8 * $uvsize;
15835 signal(SIGFPE, blech);
15838 for (i = 0; i < n; i++) {
15839 u = u << 1 | ($uvtype)1;
15841 if (($uvtype)d != u)
15845 d = ($nvtype)(u - 1);
15846 if (($uvtype)d != (u - 1))
15853 printf("%d\n", ((i == n) ? -n : i));
15859 d_nv_preserves_uv="$undef"
15860 if eval $compile; then
15861 nv_preserves_uv_bits="`$run ./try`"
15863 case "$nv_preserves_uv_bits" in
15865 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
15866 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
15867 d_nv_preserves_uv="$define"
15869 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
15870 d_nv_preserves_uv="$undef" ;;
15871 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
15872 nv_preserves_uv_bits="0" ;;
15876 $echo "Checking to find the largest integer value your NVs can hold..." >&4
15877 : volatile so that the compiler has to store it out to memory.
15878 if test X"$d_volatile" = X"$define"; then
15884 typedef $nvtype NV;
15891 while(count < 256) {
15892 $volatile NV up = value + 1.0;
15893 $volatile NV negated = -value;
15894 $volatile NV down = negated - 1.0;
15895 $volatile NV got_up = up - value;
15896 int up_good = got_up == 1.0;
15897 int got_down = down - negated;
15898 int down_good = got_down == -1.0;
15900 if (down_good != up_good) {
15902 "Inconsistency - up %d %f; down %d %f; for 2**%d (%.20f)\n",
15903 up_good, (double) got_up, down_good, (double) got_down,
15904 count, (double) value);
15911 fputs("256.0", stdout);
15914 fputs("2.0", stdout);
15920 fputs("*", stdout);
15926 fprintf(stderr, "Cannot overflow integer range, even at 2**%d (%.20f)\n",
15927 count, (double) value);
15933 nv_overflows_integers_at='0'
15934 if eval $compile; then
15940 The largest integer your NVs can preserve is equal to $xxx
15942 nv_overflows_integers_at="$xxx"
15945 Cannot determine the largest integer value your NVs can hold, unexpected output
15952 Cannot determine the largest integer value your NVs can hold
15959 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
15960 : volatile so that the compiler has to store it out to memory.
15961 if test X"$d_volatile" = X"$define"; then
15966 #$i_stdlib I_STDLIB
15968 #include <stdlib.h>
15970 #$i_string I_STRING
15972 # include <string.h>
15974 # include <strings.h>
15976 #include <sys/types.h>
15977 #include <signal.h>
15979 $volatile int bletched = 0;
15980 $signal_t blech(int s) { bletched = 1; }
15983 int checkit($nvtype d, char *where) {
15984 unsigned char *p = (char *)&d;
15985 unsigned char *end = p + sizeof(d);
15995 printf("No - %s: 0x", where);
15997 printf ("%02X", *p++);
16002 int main(int argc, char **argv) {
16005 fail += checkit(d, "0.0");
16007 /* The compiler shouldn't be assuming that bletched is 0 */
16010 fail += checkit(d, "bleched");
16013 signal(SIGFPE, blech);
16016 /* Paranoia - the compiler should have no way of knowing that ANSI says
16017 that argv[argc] will always be NULL. Actually, if it did assume this it
16018 would be buggy, as this is C and main() can be called from elsewhere in
16020 d = argv[argc] ? 1 : 0;
16023 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
16026 fail += checkit(d, "ternary");
16028 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
16031 printf("No - memset doesn't give 0.0\n");
16032 /* This might just blow up: */
16033 printf("(gives %g)\n", d);
16039 printf("No - something bleched\n");
16044 printf("No - %d fail(s)\n", fail);
16053 d_nv_zero_is_allbits_zero="$undef"
16054 if eval $compile; then
16060 0.0 is represented as all bits zero in memory
16062 d_nv_zero_is_allbits_zero="$define"
16065 0.0 is not represented as all bits zero in memory
16067 d_nv_zero_is_allbits_zero="$undef"
16072 0.0 is not represented as all bits zero in memory
16074 d_nv_zero_is_allbits_zero="$undef"
16080 : check for off64_t
16082 echo "Checking to see if you have off64_t..." >&4
16084 #include <sys/types.h>
16085 #include <unistd.h>
16086 int main() { off64_t x = 7; }
16089 if eval $compile; then
16091 echo "You have off64_t."
16094 echo "You do not have off64_t."
16095 case "$lseeksize" in
16096 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
16103 : how to create joinable pthreads
16104 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
16106 echo "Checking what constant to use for creating joinable pthreads..." >&4
16107 $cat >try.c <<'EOCP'
16108 #include <pthread.h>
16110 int detachstate = JOINABLE;
16113 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
16114 if eval $compile; then
16115 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
16116 val="$undef" # Yes, undef.
16117 set d_old_pthread_create_joinable
16120 set old_pthread_create_joinable
16123 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
16124 if eval $compile; then
16125 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
16127 set d_old_pthread_create_joinable
16129 val=PTHREAD_CREATE_UNDETACHED
16130 set old_pthread_create_joinable
16133 set try -DJOINABLE=__UNDETACHED
16134 if eval $compile; then
16135 echo "You seem to use __UNDETACHED." >&4
16137 set d_old_pthread_create_joinable
16140 set old_pthread_create_joinable
16143 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
16145 set d_old_pthread_create_joinable
16148 set old_pthread_create_joinable
16155 d_old_pthread_create_joinable="$undef"
16156 old_pthread_create_joinable=""
16159 : see if pause exists
16163 : see if poll exists
16167 : see if prctl exists
16171 : see if prctl supports PR_SET_NAME
16172 d_prctl_set_name=$undef
16176 #include <sys/prctl.h>
16178 int main (int argc, char *argv[])
16180 return (prctl (PR_SET_NAME, "Test"));
16184 if eval $compile_ok && $run ./try; then
16185 echo "Your prctl (PR_SET_NAME, ...) works"
16186 d_prctl_set_name=$define
16192 : see if readlink exists
16193 set readlink d_readlink
16196 : Check if exe is symlink to abs path of executing program
16200 case "$d_readlink" in
16202 : NetBSD first as /proc/self is a symlink to /proc/curproc, and it feels
16203 : more tidy to avoid an extra level of symlink
16204 set NetBSD /proc/curproc/exe Linux /proc/self/exe FreeBSD /proc/curproc/file Solaris /proc/self/path/a.out
16205 while test $# -gt 0; do
16208 if $issymlink $try; then
16209 $ls -l $try > reflect
16210 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
16211 echo "You have $type-like $try."
16212 procselfexe='"'$try'"'
16214 : This will break out of the loop
16225 : backward compatibility for d_hvfork
16226 if test X$d_hvfork != X; then
16227 d_vfork="$d_hvfork"
16230 : see if there is a vfork
16235 d_pseudofork=$undef
16237 : Ok, but do we want to use it. vfork is reportedly unreliable in
16238 : perl on Solaris 2.x, and probably elsewhere.
16242 case "$usevfork" in
16248 Perl can only use a vfork() that doesn't suffer from strict
16249 restrictions on calling functions or modifying global data in
16250 the child. For example, glibc-2.1 contains such a vfork()
16251 that is unsuitable. If your system provides a proper fork()
16252 call, chances are that you do NOT want perl to use vfork().
16255 rp="Do you still want to use vfork()?"
16260 echo "Ok, we won't use vfork()."
16269 $define) usevfork='true';;
16270 *) usevfork='false';;
16273 : see whether the pthread_atfork exists
16275 #include <pthread.h>
16278 #ifdef PTHREAD_ATFORK
16279 pthread_atfork(NULL,NULL,NULL);
16284 : see if pthread_atfork exists
16285 set try -DPTHREAD_ATFORK
16286 if eval $compile; then
16291 case "$usethreads" in
16294 $define) echo 'pthread_atfork found.' >&4 ;;
16295 *) echo 'pthread_atfork NOT found.' >&4 ;;
16298 set d_pthread_atfork
16301 : see if pthread_attr_setscope exists
16302 set pthread_attr_setscope d_pthread_attr_setscope
16305 : see whether the various POSIXish _yields exist
16307 #include <pthread.h>
16313 #ifdef PTHREAD_YIELD
16316 #ifdef PTHREAD_YIELD_NULL
16317 pthread_yield(NULL);
16323 : see if sched_yield exists
16324 set try -DSCHED_YIELD
16325 if eval $compile; then
16327 sched_yield='sched_yield()'
16331 case "$usethreads" in
16334 $define) echo 'sched_yield() found.' >&4 ;;
16335 *) echo 'sched_yield() NOT found.' >&4 ;;
16341 : see if pthread_yield exists
16342 set try -DPTHREAD_YIELD
16343 if eval $compile; then
16345 case "$sched_yield" in
16346 '') sched_yield='pthread_yield()' ;;
16349 set try -DPTHREAD_YIELD_NULL
16350 if eval $compile; then
16352 case "$sched_yield" in
16353 '') sched_yield='pthread_yield(NULL)' ;;
16359 case "$usethreads" in
16362 $define) echo 'pthread_yield() found.' >&4 ;;
16363 *) echo 'pthread_yield() NOT found.' >&4 ;;
16367 set d_pthread_yield
16369 case "$sched_yield" in
16370 '') sched_yield=undef ;;
16374 : see if random_r exists
16375 set random_r d_random_r
16377 case "$d_random_r" in
16379 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16380 case "$d_random_r_proto:$usethreads" in
16381 ":define") d_random_r_proto=define
16382 set d_random_r_proto random_r $hdrs
16386 case "$d_random_r_proto" in
16388 case "$random_r_proto" in
16389 ''|0) try='int random_r(int*, struct random_data*);'
16390 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_iS ;;
16392 case "$random_r_proto" in
16393 ''|0) try='int random_r(long*, struct random_data*);'
16394 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_lS ;;
16396 case "$random_r_proto" in
16397 ''|0) try='int random_r(struct random_data*, int32_t*);'
16398 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_St ;;
16400 case "$random_r_proto" in
16401 ''|0) d_random_r=undef
16403 echo "Disabling random_r, cannot determine prototype." >&4 ;;
16404 * ) case "$random_r_proto" in
16405 REENTRANT_PROTO*) ;;
16406 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
16408 echo "Prototype: $try" ;;
16411 *) case "$usethreads" in
16412 define) echo "random_r has no prototype, not using it." >&4 ;;
16419 *) random_r_proto=0
16423 : see if readdir and friends exist
16424 set readdir d_readdir
16426 set seekdir d_seekdir
16428 set telldir d_telldir
16430 set rewinddir d_rewinddir
16433 : see if readdir64_r exists
16434 set readdir64_r d_readdir64_r
16436 case "$d_readdir64_r" in
16438 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16439 case "$d_readdir64_r_proto:$usethreads" in
16440 ":define") d_readdir64_r_proto=define
16441 set d_readdir64_r_proto readdir64_r $hdrs
16445 case "$d_readdir64_r_proto" in
16447 case "$readdir64_r_proto" in
16448 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
16449 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TSR ;;
16451 case "$readdir64_r_proto" in
16452 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
16453 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TS ;;
16455 case "$readdir64_r_proto" in
16456 ''|0) d_readdir64_r=undef
16457 readdir64_r_proto=0
16458 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
16459 * ) case "$readdir64_r_proto" in
16460 REENTRANT_PROTO*) ;;
16461 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
16463 echo "Prototype: $try" ;;
16466 *) case "$usethreads" in
16467 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
16469 d_readdir64_r=undef
16470 readdir64_r_proto=0
16474 *) readdir64_r_proto=0
16478 : see if readdir_r exists
16479 set readdir_r d_readdir_r
16481 case "$d_readdir_r" in
16483 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16484 case "$d_readdir_r_proto:$usethreads" in
16485 ":define") d_readdir_r_proto=define
16486 set d_readdir_r_proto readdir_r $hdrs
16490 case "$d_readdir_r_proto" in
16492 case "$readdir_r_proto" in
16493 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
16494 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TSR ;;
16496 case "$readdir_r_proto" in
16497 ''|0) try='int readdir_r(DIR*, struct dirent*);'
16498 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TS ;;
16500 case "$readdir_r_proto" in
16501 ''|0) d_readdir_r=undef
16503 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
16504 * ) case "$readdir_r_proto" in
16505 REENTRANT_PROTO*) ;;
16506 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
16508 echo "Prototype: $try" ;;
16511 *) case "$usethreads" in
16512 define) echo "readdir_r has no prototype, not using it." >&4 ;;
16519 *) readdir_r_proto=0
16523 : see if readv exists
16527 : see if recvmsg exists
16528 set recvmsg d_recvmsg
16531 : see if rename exists
16532 set rename d_rename
16535 : see if rmdir exists
16539 : see if memory.h is available.
16544 : See if it conflicts with string.h
16550 $cppstdin $cppflags $cppminus < $strings > mem.h
16551 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
16553 echo "We won't be including <memory.h>."
16563 : can bcopy handle overlapping blocks?
16566 case "$d_memmove" in
16567 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
16568 *) case "$d_bcopy" in
16570 echo "Checking to see if bcopy() can do overlapping copies..." >&4
16572 #$i_memory I_MEMORY
16573 #$i_stdlib I_STDLIB
16574 #$i_string I_STRING
16575 #$i_unistd I_UNISTD
16577 $cat >>try.c <<'EOCP'
16580 # include <memory.h>
16583 # include <stdlib.h>
16586 # include <string.h>
16588 # include <strings.h>
16591 # include <unistd.h> /* Needed for NetBSD */
16595 char buf[128], abc[128];
16601 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16602 try to store the string in read-only memory. */
16603 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
16605 for (align = 7; align >= 0; align--) {
16606 for (len = 36; len; len--) {
16608 bcopy(abc, b, len);
16609 for (off = 1; off <= len; off++) {
16610 bcopy(b, b+off, len);
16611 bcopy(b+off, b, len);
16612 if (bcmp(b, abc, len))
16621 if eval $compile_ok; then
16622 if $run ./try 2>/dev/null; then
16623 echo "Yes, it can."
16626 echo "It can't, sorry."
16629 echo "(I can't compile the test program, so we'll assume not...)"
16639 : can memcpy handle overlapping blocks?
16642 case "$d_memmove" in
16643 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
16644 *) case "$d_memcpy" in
16646 echo "Checking to see if memcpy() can do overlapping copies..." >&4
16648 #$i_memory I_MEMORY
16649 #$i_stdlib I_STDLIB
16650 #$i_string I_STRING
16651 #$i_unistd I_UNISTD
16653 $cat >>try.c <<'EOCP'
16656 # include <memory.h>
16659 # include <stdlib.h>
16662 # include <string.h>
16664 # include <strings.h>
16667 # include <unistd.h> /* Needed for NetBSD */
16671 char buf[128], abc[128];
16677 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16678 try to store the string in read-only memory. */
16679 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
16681 for (align = 7; align >= 0; align--) {
16682 for (len = 36; len; len--) {
16684 memcpy(b, abc, len);
16685 for (off = 1; off <= len; off++) {
16686 memcpy(b+off, b, len);
16687 memcpy(b, b+off, len);
16688 if (memcmp(b, abc, len))
16697 if eval $compile_ok; then
16698 if $run ./try 2>/dev/null; then
16699 echo "Yes, it can."
16702 echo "It can't, sorry."
16705 echo "(I can't compile the test program, so we'll assume not...)"
16715 : can memcmp be trusted to compare relative magnitude?
16717 case "$d_memcmp" in
16720 echo "Checking if your memcmp() can compare relative magnitude..." >&4
16722 #$i_memory I_MEMORY
16723 #$i_stdlib I_STDLIB
16724 #$i_string I_STRING
16725 #$i_unistd I_UNISTD
16727 $cat >>try.c <<'EOCP'
16730 # include <memory.h>
16733 # include <stdlib.h>
16736 # include <string.h>
16738 # include <strings.h>
16741 # include <unistd.h> /* Needed for NetBSD */
16747 if ((a < b) && memcmp(&a, &b, 1) < 0)
16753 if eval $compile_ok; then
16754 if $run ./try 2>/dev/null; then
16755 echo "Yes, it can."
16758 echo "No, it can't (it uses signed chars)."
16761 echo "(I can't compile the test program, so we'll assume not...)"
16769 : see if prototype for sbrk is available
16771 set d_sbrkproto sbrk $i_unistd unistd.h
16774 : see if select exists
16775 set select d_select
16778 : see if semctl exists
16779 set semctl d_semctl
16782 : see if semget exists
16783 set semget d_semget
16786 : see if semop exists
16790 : see how much of the 'sem*(2)' library is present.
16793 case "$d_semctl$d_semget$d_semop" in
16794 *"$undef"*) h_sem=false;;
16798 case "`ipcs 2>&1`" in
16799 "SVID messages"*"not configured"*)
16800 echo "Your $osname does not have the sem*(2) configured." >&4
16803 set semctl d_semctl
16805 set semget d_semget
16813 : we could also check for sys/ipc.h ...
16814 if $h_sem && $test `./findhdr sys/sem.h`; then
16815 echo "You have the full sem*(2) library." >&4
16818 echo "You don't have the full sem*(2) library." >&4
16824 : see whether sys/sem.h defines union semun
16826 $cat > try.c <<'END'
16827 #include <sys/types.h>
16828 #include <sys/ipc.h>
16829 #include <sys/sem.h>
16830 int main () { union semun semun; semun.buf = 0; }
16833 if eval $compile; then
16834 echo "You have union semun in <sys/sem.h>." >&4
16837 echo "You do not have union semun in <sys/sem.h>." >&4
16844 : see how to do semctl IPC_STAT
16848 $cat > tryh.h <<END
16851 # define S_IRUSR S_IREAD
16852 # define S_IWUSR S_IWRITE
16853 # define S_IXUSR S_IEXEC
16855 # define S_IRUSR 0400
16856 # define S_IWUSR 0200
16857 # define S_IXUSR 0100
16859 # define S_IRGRP (S_IRUSR>>3)
16860 # define S_IWGRP (S_IWUSR>>3)
16861 # define S_IXGRP (S_IXUSR>>3)
16862 # define S_IROTH (S_IRUSR>>6)
16863 # define S_IWOTH (S_IWUSR>>6)
16864 # define S_IXOTH (S_IXUSR>>6)
16867 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
16868 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
16869 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
16872 : see whether semctl IPC_STAT can use union semun
16873 case "$d_semctl_semun" in
16877 #include <sys/types.h>
16878 #include <sys/ipc.h>
16879 #include <sys/sem.h>
16880 #include <sys/stat.h>
16887 #$d_union_semun HAS_UNION_SEMUN
16890 #ifndef HAS_UNION_SEMUN
16893 struct semid_ds *buf;
16894 unsigned short *array;
16900 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16901 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16903 struct semid_ds argbuf;
16906 st = semctl(sem, 0, IPC_STAT, arg);
16910 # endif /* IPC_STAT */
16911 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16913 if (semctl(sem, 0, IPC_RMID, arg) != 0)
16914 # endif /* IPC_RMID */
16915 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16917 #endif /* IPC_PRIVATE && ... */
16918 printf("semget failed: errno = %d\n", errno);
16923 if eval $compile; then
16926 semun) val="$define" ;;
16934 case "$d_semctl_semun" in
16936 echo "You can use union semun for semctl IPC_STAT." >&4
16939 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
16944 : see whether semctl IPC_STAT can use struct semid_ds pointer
16945 case "$d_semctl_semid_ds" in
16948 $cat > try.c <<'END'
16949 #include <sys/types.h>
16950 #include <sys/ipc.h>
16951 #include <sys/sem.h>
16952 #include <sys/stat.h>
16960 struct semid_ds arg;
16963 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16964 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16967 st = semctl(sem, 0, IPC_STAT, &arg);
16969 printf("semid_ds\n");
16971 # endif /* IPC_STAT */
16972 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16974 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
16975 # endif /* IPC_RMID */
16976 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16978 #endif /* IPC_PRIVATE && ... */
16979 printf("semget failed: errno = %d\n", errno);
16985 if eval $compile; then
16988 semid_ds) val="$define" ;;
16992 set d_semctl_semid_ds
16996 case "$d_semctl_semid_ds" in
16998 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
17000 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
17006 # We do not have the full sem*(2) library, so assume we can not
17012 set d_semctl_semid_ds
17018 : see if sendmsg exists
17019 set sendmsg d_sendmsg
17022 : see if setegid exists
17023 set setegid d_setegid
17026 : see if seteuid exists
17027 set seteuid d_seteuid
17030 : see if setgrent exists
17031 set setgrent d_setgrent
17034 : see if setgrent_r exists
17035 set setgrent_r d_setgrent_r
17037 case "$d_setgrent_r" in
17039 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
17040 case "$d_setgrent_r_proto:$usethreads" in
17041 ":define") d_setgrent_r_proto=define
17042 set d_setgrent_r_proto setgrent_r $hdrs
17046 case "$d_setgrent_r_proto" in
17048 case "$setgrent_r_proto" in
17049 ''|0) try='int setgrent_r(FILE**);'
17050 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=I_H ;;
17052 case "$setgrent_r_proto" in
17053 ''|0) try='void setgrent_r(FILE**);'
17054 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=V_H ;;
17056 case "$setgrent_r_proto" in
17057 ''|0) d_setgrent_r=undef
17059 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
17060 * ) case "$setgrent_r_proto" in
17061 REENTRANT_PROTO*) ;;
17062 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
17064 echo "Prototype: $try" ;;
17067 *) case "$usethreads" in
17068 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
17075 *) setgrent_r_proto=0
17079 : see if sethostent exists
17080 set sethostent d_sethent
17083 : see if sethostent_r exists
17084 set sethostent_r d_sethostent_r
17086 case "$d_sethostent_r" in
17088 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17089 case "$d_sethostent_r_proto:$usethreads" in
17090 ":define") d_sethostent_r_proto=define
17091 set d_sethostent_r_proto sethostent_r $hdrs
17095 case "$d_sethostent_r_proto" in
17097 case "$sethostent_r_proto" in
17098 ''|0) try='int sethostent_r(int, struct hostent_data*);'
17099 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=I_ID ;;
17101 case "$sethostent_r_proto" in
17102 ''|0) try='void sethostent_r(int, struct hostent_data*);'
17103 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=V_ID ;;
17105 case "$sethostent_r_proto" in
17106 ''|0) d_sethostent_r=undef
17107 sethostent_r_proto=0
17108 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
17109 * ) case "$sethostent_r_proto" in
17110 REENTRANT_PROTO*) ;;
17111 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
17113 echo "Prototype: $try" ;;
17116 *) case "$usethreads" in
17117 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
17119 d_sethostent_r=undef
17120 sethostent_r_proto=0
17124 *) sethostent_r_proto=0
17128 : see if setitimer exists
17129 set setitimer d_setitimer
17132 : see if setlinebuf exists
17133 set setlinebuf d_setlinebuf
17136 : see if setlocale exists
17137 set setlocale d_setlocale
17140 : see if locale.h is available
17141 set locale.h i_locale
17144 : see if setlocale_r exists
17145 set setlocale_r d_setlocale_r
17147 case "$d_setlocale_r" in
17149 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
17150 case "$d_setlocale_r_proto:$usethreads" in
17151 ":define") d_setlocale_r_proto=define
17152 set d_setlocale_r_proto setlocale_r $hdrs
17156 case "$d_setlocale_r_proto" in
17158 case "$setlocale_r_proto" in
17159 ''|0) try='int setlocale_r(int, const char*, char*, int);'
17160 ./protochk "$extern_C $try" $hdrs && setlocale_r_proto=I_ICBI ;;
17162 case "$setlocale_r_proto" in
17163 ''|0) d_setlocale_r=undef
17164 setlocale_r_proto=0
17165 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
17166 * ) case "$setlocale_r_proto" in
17167 REENTRANT_PROTO*) ;;
17168 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
17170 echo "Prototype: $try" ;;
17173 *) case "$usethreads" in
17174 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
17176 d_setlocale_r=undef
17177 setlocale_r_proto=0
17181 *) setlocale_r_proto=0
17185 : see if setnetent exists
17186 set setnetent d_setnent
17189 : see if setnetent_r exists
17190 set setnetent_r d_setnetent_r
17192 case "$d_setnetent_r" in
17194 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17195 case "$d_setnetent_r_proto:$usethreads" in
17196 ":define") d_setnetent_r_proto=define
17197 set d_setnetent_r_proto setnetent_r $hdrs
17201 case "$d_setnetent_r_proto" in
17203 case "$setnetent_r_proto" in
17204 ''|0) try='int setnetent_r(int, struct netent_data*);'
17205 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=I_ID ;;
17207 case "$setnetent_r_proto" in
17208 ''|0) try='void setnetent_r(int, struct netent_data*);'
17209 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=V_ID ;;
17211 case "$setnetent_r_proto" in
17212 ''|0) d_setnetent_r=undef
17213 setnetent_r_proto=0
17214 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
17215 * ) case "$setnetent_r_proto" in
17216 REENTRANT_PROTO*) ;;
17217 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
17219 echo "Prototype: $try" ;;
17222 *) case "$usethreads" in
17223 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
17225 d_setnetent_r=undef
17226 setnetent_r_proto=0
17230 *) setnetent_r_proto=0
17234 : see if setprotoent exists
17235 set setprotoent d_setpent
17238 : see if setpgid exists
17239 set setpgid d_setpgid
17242 : see if setpgrp2 exists
17243 set setpgrp2 d_setpgrp2
17246 : see if setpriority exists
17247 set setpriority d_setprior
17250 : see if setproctitle exists
17251 set setproctitle d_setproctitle
17254 : see if setprotoent_r exists
17255 set setprotoent_r d_setprotoent_r
17257 case "$d_setprotoent_r" in
17259 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17260 case "$d_setprotoent_r_proto:$usethreads" in
17261 ":define") d_setprotoent_r_proto=define
17262 set d_setprotoent_r_proto setprotoent_r $hdrs
17266 case "$d_setprotoent_r_proto" in
17268 case "$setprotoent_r_proto" in
17269 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
17270 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=I_ID ;;
17272 case "$setprotoent_r_proto" in
17273 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
17274 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=V_ID ;;
17276 case "$setprotoent_r_proto" in
17277 ''|0) d_setprotoent_r=undef
17278 setprotoent_r_proto=0
17279 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
17280 * ) case "$setprotoent_r_proto" in
17281 REENTRANT_PROTO*) ;;
17282 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
17284 echo "Prototype: $try" ;;
17287 *) case "$usethreads" in
17288 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
17290 d_setprotoent_r=undef
17291 setprotoent_r_proto=0
17295 *) setprotoent_r_proto=0
17299 : see if setpwent exists
17300 set setpwent d_setpwent
17303 : see if setpwent_r exists
17304 set setpwent_r d_setpwent_r
17306 case "$d_setpwent_r" in
17308 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
17309 case "$d_setpwent_r_proto:$usethreads" in
17310 ":define") d_setpwent_r_proto=define
17311 set d_setpwent_r_proto setpwent_r $hdrs
17315 case "$d_setpwent_r_proto" in
17317 case "$setpwent_r_proto" in
17318 ''|0) try='int setpwent_r(FILE**);'
17319 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=I_H ;;
17321 case "$setpwent_r_proto" in
17322 ''|0) try='void setpwent_r(FILE**);'
17323 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=V_H ;;
17325 case "$setpwent_r_proto" in
17326 ''|0) d_setpwent_r=undef
17328 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
17329 * ) case "$setpwent_r_proto" in
17330 REENTRANT_PROTO*) ;;
17331 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
17333 echo "Prototype: $try" ;;
17336 *) case "$usethreads" in
17337 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
17344 *) setpwent_r_proto=0
17348 : see if setregid exists
17349 set setregid d_setregid
17351 set setresgid d_setresgid
17354 : see if setreuid exists
17355 set setreuid d_setreuid
17357 set setresuid d_setresuid
17360 : see if setrgid exists
17361 set setrgid d_setrgid
17364 : see if setruid exists
17365 set setruid d_setruid
17368 : see if setservent exists
17369 set setservent d_setsent
17372 : see if setservent_r exists
17373 set setservent_r d_setservent_r
17375 case "$d_setservent_r" in
17377 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17378 case "$d_setservent_r_proto:$usethreads" in
17379 ":define") d_setservent_r_proto=define
17380 set d_setservent_r_proto setservent_r $hdrs
17384 case "$d_setservent_r_proto" in
17386 case "$setservent_r_proto" in
17387 ''|0) try='int setservent_r(int, struct servent_data*);'
17388 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=I_ID ;;
17390 case "$setservent_r_proto" in
17391 ''|0) try='void setservent_r(int, struct servent_data*);'
17392 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=V_ID ;;
17394 case "$setservent_r_proto" in
17395 ''|0) d_setservent_r=undef
17396 setservent_r_proto=0
17397 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
17398 * ) case "$setservent_r_proto" in
17399 REENTRANT_PROTO*) ;;
17400 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
17402 echo "Prototype: $try" ;;
17405 *) case "$usethreads" in
17406 define) echo "setservent_r has no prototype, not using it." >&4 ;;
17408 d_setservent_r=undef
17409 setservent_r_proto=0
17413 *) setservent_r_proto=0
17417 : see if setsid exists
17418 set setsid d_setsid
17421 : see if setvbuf exists
17422 set setvbuf d_setvbuf
17425 : see if sfio.h is available
17429 : see if sfio library is available
17440 : Ok, but do we want to use it.
17444 true|$define|[yY]*) dflt='y';;
17447 echo "$package can use the sfio library, but it is experimental."
17448 rp="You seem to have sfio available, do you want to try using it?"
17451 y|Y) echo "Ok, turning on sfio then."
17454 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
17459 *) case "$usesfio" in
17460 true|$define|[yY]*)
17461 echo "Sorry, cannot find sfio on this machine." >&4
17462 echo "Ignoring your setting of usesfio=$usesfio." >&4
17471 $define) usesfio='true';;
17472 *) usesfio='false';;
17476 *) : Remove sfio from list of libraries to use
17479 echo "Removing unneeded -lsfio from library list" >&4
17480 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
17483 echo "libs = $libs" >&4
17490 : see if shmctl exists
17491 set shmctl d_shmctl
17494 : see if shmget exists
17495 set shmget d_shmget
17498 : see if shmat exists
17501 : see what shmat returns
17504 $cat >shmat.c <<'END'
17505 #include <sys/shm.h>
17508 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
17513 echo "and it returns ($shmattype)." >&4
17514 : see if a prototype for shmat is available
17515 xxx=`./findhdr sys/shm.h`
17516 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
17517 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
17528 set d_shmatprototype
17531 : see if shmdt exists
17535 : see how much of the 'shm*(2)' library is present.
17538 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
17539 *"$undef"*) h_shm=false;;
17543 case "`ipcs 2>&1`" in
17544 "SVID shared memory"*"not configured"*)
17545 echo "Your $osname does not have the shm*(2) configured." >&4
17548 set shmctl d_shmctl
17550 set shmget d_shmget
17560 : we could also check for sys/ipc.h ...
17561 if $h_shm && $test `./findhdr sys/shm.h`; then
17562 echo "You have the full shm*(2) library." >&4
17565 echo "You don't have the full shm*(2) library." >&4
17571 : see if we have sigaction
17573 if set sigaction val -f d_sigaction; eval $csym; $val; then
17574 echo 'sigaction() found.' >&4
17577 #include <sys/types.h>
17578 #include <signal.h>
17579 #$i_stdlib I_STDLIB
17581 #include <stdlib.h>
17585 struct sigaction act, oact;
17587 oact.sa_handler = 0;
17588 /* so that act and oact are used */
17589 exit(act.sa_flags == 0 && oact.sa_handler == 0);
17593 if eval $compile_ok; then
17596 echo "But you don't seem to have a useable struct sigaction." >&4
17600 echo 'sigaction NOT found.' >&4
17603 set d_sigaction; eval $setvar
17606 : see if this is a sunmath.h system
17607 set sunmath.h i_sunmath
17610 : see if signbit exists
17611 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
17614 #$i_sunmath I_SUNMATH
17618 #ifdef I_SUNMATH /* Solaris special math library */
17619 # include <sunmath.h>
17622 int main(int argc, char **argv)
17626 if ((signbit(x) == 0) && (signbit(y) != 0))
17634 if eval $compile; then
17635 if $run ./try; then
17639 $echo "Signbit seems to be available, but doesn't work as I expected."
17640 $echo "I won't use it." >&4
17651 : see if sigprocmask exists
17652 set sigprocmask d_sigprocmask
17655 : see if sigsetjmp exists
17657 case "$d_sigsetjmp" in
17660 #include <setjmp.h>
17661 #$i_stdlib I_STDLIB
17663 #include <stdlib.h>
17669 if (sigsetjmp(env,1))
17672 siglongjmp(env, 1);
17677 if eval $compile; then
17678 if $run ./try >/dev/null 2>&1; then
17679 echo "POSIX sigsetjmp found." >&4
17683 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
17689 echo "sigsetjmp not found." >&4
17693 *) val="$d_sigsetjmp"
17694 case "$d_sigsetjmp" in
17695 $define) echo "POSIX sigsetjmp found." >&4;;
17696 $undef) echo "sigsetjmp not found." >&4;;
17704 : see if snprintf exists
17705 set snprintf d_snprintf
17708 : see if vsnprintf exists
17709 set vsnprintf d_vsnprintf
17712 case "$d_snprintf-$d_vsnprintf" in
17715 Checking whether your snprintf() and vsnprintf() work okay...
17717 $cat >try.c <<'EOCP'
17718 /* v?snprintf testing logic courtesy of Russ Allbery.
17719 * According to C99:
17720 * - if the buffer is too short it still must be \0-terminated
17721 * - if the buffer is too short the potentially required length
17722 * must be returned and not -1
17723 * - if the buffer is NULL the potentially required length
17724 * must be returned and not -1 or core dump
17727 #include <stdarg.h>
17731 int test (char *format, ...)
17736 va_start (args, format);
17737 count = vsnprintf (buf, sizeof buf, format, args);
17744 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
17745 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
17749 if eval $compile; then
17752 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
17754 Your snprintf() and snprintf() don't seem to be working okay.
17756 d_snprintf="$undef"
17757 d_vsnprintf="$undef"
17761 echo "(I can't seem to compile the test program--assuming they don't)"
17762 d_snprintf="$undef"
17763 d_vsnprintf="$undef"
17769 : see if sockatmark exists
17770 set sockatmark d_sockatmark
17773 : see if prototype for sockatmark is available
17775 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
17778 : see if socks5_init exists
17779 set socks5_init d_socks5_init
17782 : see if sprintf returns the length of the string in the buffer as per ANSI
17783 $echo "Checking whether sprintf returns the length of the string..." >&4
17786 #$i_stdlib I_STDLIB
17788 #include <stdlib.h>
17790 #$i_string I_STRING
17792 # include <string.h>
17794 # include <strings.h>
17803 int check (size_t expect, int test) {
17804 size_t got = strlen(buffer);
17808 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
17813 int main(int argc, char **argv) {
17816 check(sprintf(buffer, ""), ++test);
17817 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
17818 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
17825 if eval $compile; then
17829 sprintf returns the length of the string (as ANSI says it should)
17831 d_sprintf_returns_strlen="$define"
17834 sprintf does not return the length of the string (how old is this system?)
17836 d_sprintf_returns_strlen="$undef"
17840 echo "(I can't seem to compile the test program--assuming it doesn't)" >&4
17841 d_sprintf_returns_strlen="$undef"
17845 : see if srand48_r exists
17846 set srand48_r d_srand48_r
17848 case "$d_srand48_r" in
17850 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17851 case "$d_srand48_r_proto:$usethreads" in
17852 ":define") d_srand48_r_proto=define
17853 set d_srand48_r_proto srand48_r $hdrs
17857 case "$d_srand48_r_proto" in
17859 case "$srand48_r_proto" in
17860 ''|0) try='int srand48_r(long, struct drand48_data*);'
17861 ./protochk "$extern_C $try" $hdrs && srand48_r_proto=I_LS ;;
17863 case "$srand48_r_proto" in
17864 ''|0) d_srand48_r=undef
17866 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
17867 * ) case "$srand48_r_proto" in
17868 REENTRANT_PROTO*) ;;
17869 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
17871 echo "Prototype: $try" ;;
17874 *) case "$usethreads" in
17875 define) echo "srand48_r has no prototype, not using it." >&4 ;;
17882 *) srand48_r_proto=0
17886 : see if srandom_r exists
17887 set srandom_r d_srandom_r
17889 case "$d_srandom_r" in
17891 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17892 case "$d_srandom_r_proto:$usethreads" in
17893 ":define") d_srandom_r_proto=define
17894 set d_srandom_r_proto srandom_r $hdrs
17898 case "$d_srandom_r_proto" in
17900 case "$srandom_r_proto" in
17901 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
17902 ./protochk "$extern_C $try" $hdrs && srandom_r_proto=I_TS ;;
17904 case "$srandom_r_proto" in
17905 ''|0) d_srandom_r=undef
17907 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
17908 * ) case "$srandom_r_proto" in
17909 REENTRANT_PROTO*) ;;
17910 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
17912 echo "Prototype: $try" ;;
17915 *) case "$usethreads" in
17916 define) echo "srandom_r has no prototype, not using it." >&4 ;;
17923 *) srandom_r_proto=0
17927 : see if prototype for setresgid is available
17929 set d_sresgproto setresgid $i_unistd unistd.h
17932 : see if prototype for setresuid is available
17934 set d_sresuproto setresuid $i_unistd unistd.h
17937 : see if sys/stat.h is available
17938 set sys/stat.h i_sysstat
17941 : see if stat knows about block sizes
17943 echo "Checking to see if your struct stat has st_blocks field..." >&4
17944 set d_statblks stat st_blocks $i_sysstat sys/stat.h
17947 : see if this is a sys/vfs.h system
17948 set sys/vfs.h i_sysvfs
17951 : see if this is a sys/statfs.h system
17952 set sys/statfs.h i_sysstatfs
17955 : Check for statfs_s
17957 echo "Checking to see if your system supports struct statfs..." >&4
17958 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
17960 case "$d_statfs_s" in
17961 "$define") echo "Yes, it does." ;;
17962 *) echo "No, it doesn't." ;;
17966 : see if struct statfs knows about f_flags
17967 case "$d_statfs_s" in
17970 echo "Checking to see if your struct statfs has f_flags field..." >&4
17971 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
17975 set d_statfs_f_flags
17979 case "$d_statfs_f_flags" in
17980 "$define") echo "Yes, it does." ;;
17981 *) echo "No, it doesn't." ;;
17984 : see what flavor, if any, of static inline is supported
17986 echo "Checking to see if your system supports static inline..."
17987 $cat > try.c <<'EOCP'
17988 #include <stdlib.h>
17989 extern int f_via_a(int x);
17990 extern int f_via_b(int x);
17991 int main(int argc, char **argv)
18000 return EXIT_SUCCESS;
18003 return EXIT_FAILURE;
18007 $cat > a.c <<'EOCP'
18008 static INLINE int f(int x) {
18019 $cat > b.c <<'EOCP'
18020 extern int f(int x);
18028 # Respect a hint (or previous) value for perl_static_inline, if there is one.
18029 case "$perl_static_inline" in
18030 '') # Check the various possibilities, and break out on success.
18031 # For gcc, prefer __inline__, which will still permit
18032 # cflags.SH to add in -ansi.
18033 case "$gccversion" in
18034 '') xxx="inline __inline__ __inline _inline";;
18035 *) xxx="__inline__ inline __inline _inline";;
18037 for inline in $xxx; do
18038 set try -DINLINE=$inline a.c
18039 if eval $compile && $run ./try; then
18040 # Now make sure there is no external linkage of static
18042 set try -DINLINE=$inline -DUSE_B a.c b.c
18043 if eval $compile && $run ./try; then
18044 $echo "Your compiler supports static $inline, " >&4
18045 $echo "but it also creates an external definition," >&4
18046 $echo "so I won't use it." >&4
18049 $echo "Your compiler supports static $inline." >&4
18051 perl_static_inline="static $inline";
18055 $echo "Your compiler does NOT support static $inline." >&4
18060 *inline*) # Some variant of inline exists.
18061 echo "Keeping your $hint value of $perl_static_inline."
18064 static) # No inline capabilities
18065 echo "Keeping your $hint value of $perl_static_inline."
18068 *) # Unrecognized previous value -- blindly trust the supplied
18069 # value and hope it makes sense. Use old value for
18070 # d_static_inline, if there is one.
18071 echo "Keeping your $hint value of $perl_static_inline."
18072 case "$d_static_inline" in
18074 *) val=$d_static_inline ;;
18078 # Fallback to plain 'static' if nothing worked.
18079 case "$perl_static_inline" in
18081 perl_static_inline="static"
18085 set d_static_inline
18087 $rm -f a.[co] b.[co]
18090 : Check stream access
18092 Checking how to access stdio streams by file descriptor number...
18094 case "$stdio_stream_array" in
18095 '') $cat >try.c <<EOCP
18098 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
18102 for s in _iob __iob __sF
18104 set try -DSTDIO_STREAM_ARRAY=$s
18105 if eval $compile; then
18106 case "`$run ./try`" in
18107 yes) stdio_stream_array=$s; break ;;
18113 case "$stdio_stream_array" in
18115 I can't figure out how to access stdio streams by file descriptor number.
18117 d_stdio_stream_array="$undef"
18120 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
18122 d_stdio_stream_array="$define"
18126 : see if strcoll exists
18127 set strcoll d_strcoll
18130 : check for structure copying
18132 echo "Checking to see if your C compiler can copy structs..." >&4
18133 $cat >try.c <<'EOCP'
18143 if $cc -c try.c >/dev/null 2>&1 ; then
18145 echo "Yup, it can."
18148 echo "Nope, it can't."
18154 : see if strerror and/or sys_errlist[] exist
18156 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
18157 if set strerror val -f d_strerror; eval $csym; $val; then
18158 echo 'strerror() found.' >&4
18159 d_strerror="$define"
18160 d_strerrm='strerror(e)'
18161 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18162 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
18163 d_syserrlst="$define"
18165 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
18166 d_syserrlst="$undef"
18168 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
18169 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
18170 echo 'strerror() found in string header.' >&4
18171 d_strerror="$define"
18172 d_strerrm='strerror(e)'
18173 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18174 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
18175 d_syserrlst="$define"
18177 echo "(You don't appear to have any sys_errlist[], how can this be?)"
18178 d_syserrlst="$undef"
18180 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18181 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
18182 d_strerror="$undef"
18183 d_syserrlst="$define"
18184 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
18186 echo 'strerror() and sys_errlist[] NOT found.' >&4
18187 d_strerror="$undef"
18188 d_syserrlst="$undef"
18189 d_strerrm='"unknown"'
18193 : see if strerror_r exists
18194 set strerror_r d_strerror_r
18196 case "$d_strerror_r" in
18198 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
18199 case "$d_strerror_r_proto:$usethreads" in
18200 ":define") d_strerror_r_proto=define
18201 set d_strerror_r_proto strerror_r $hdrs
18205 case "$d_strerror_r_proto" in
18207 case "$strerror_r_proto" in
18208 ''|0) try='int strerror_r(int, char*, size_t);'
18209 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBW ;;
18211 case "$strerror_r_proto" in
18212 ''|0) try='int strerror_r(int, char*, int);'
18213 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBI ;;
18215 case "$strerror_r_proto" in
18216 ''|0) try='char* strerror_r(int, char*, size_t);'
18217 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=B_IBW ;;
18219 case "$strerror_r_proto" in
18220 ''|0) d_strerror_r=undef
18222 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
18223 * ) case "$strerror_r_proto" in
18224 REENTRANT_PROTO*) ;;
18225 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
18227 echo "Prototype: $try" ;;
18230 *) case "$usethreads" in
18231 define) echo "strerror_r has no prototype, not using it." >&4 ;;
18238 *) strerror_r_proto=0
18242 : see if strftime exists
18243 set strftime d_strftime
18246 : see if strlcat exists
18247 set strlcat d_strlcat
18250 : see if strlcpy exists
18251 set strlcpy d_strlcpy
18254 : see if strtod exists
18255 set strtod d_strtod
18258 : see if strtol exists
18259 set strtol d_strtol
18262 : see if strtold exists
18263 set strtold d_strtold
18266 : see if strtoll exists
18267 set strtoll d_strtoll
18270 case "$d_longlong-$d_strtoll" in
18273 Checking whether your strtoll() works okay...
18275 $cat >try.c <<'EOCP'
18278 #define strtoll __strtoll
18281 #define strtoll _strtoll
18284 extern long long int strtoll(char *s, char **, int);
18285 static int bad = 0;
18286 int check(char *s, long long ell, int een) {
18289 gll = strtoll(s, 0, 10);
18290 if (!((gll == ell) && (errno == een)))
18294 check(" 1", 1LL, 0);
18295 check(" 0", 0LL, 0);
18296 check("-1", -1LL, 0);
18297 check("-9223372036854775808", -9223372036854775808LL, 0);
18298 check("-9223372036854775808", -9223372036854775808LL, 0);
18299 check(" 9223372036854775807", 9223372036854775807LL, 0);
18300 check("-9223372036854775808", -9223372036854775808LL, 0);
18301 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
18302 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
18308 if eval $compile; then
18311 ok) echo "Your strtoll() seems to be working okay." ;;
18313 Your strtoll() doesn't seem to be working okay.
18319 echo "(I can't seem to compile the test program--assuming it doesn't)"
18325 : see if strtoq exists
18326 set strtoq d_strtoq
18329 : see if strtoul exists
18330 set strtoul d_strtoul
18333 case "$d_strtoul" in
18336 Checking whether your strtoul() works okay...
18338 $cat >try.c <<'EOCP'
18341 extern unsigned long int strtoul(char *s, char **, int);
18342 static int bad = 0;
18343 void check(char *s, unsigned long eul, int een) {
18346 gul = strtoul(s, 0, 10);
18347 if (!((gul == eul) && (errno == een)))
18351 check(" 1", 1L, 0);
18352 check(" 0", 0L, 0);
18354 case "$longsize" in
18356 $cat >>try.c <<'EOCP'
18357 check("18446744073709551615", 18446744073709551615UL, 0);
18358 check("18446744073709551616", 18446744073709551615UL, ERANGE);
18359 #if 0 /* strtoul() for /^-/ strings is undefined. */
18360 check("-1", 18446744073709551615UL, 0);
18361 check("-18446744073709551614", 2, 0);
18362 check("-18446744073709551615", 1, 0);
18363 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
18364 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
18369 $cat >>try.c <<'EOCP'
18370 check("4294967295", 4294967295UL, 0);
18371 check("4294967296", 4294967295UL, ERANGE);
18372 #if 0 /* strtoul() for /^-/ strings is undefined. */
18373 check("-1", 4294967295UL, 0);
18374 check("-4294967294", 2, 0);
18375 check("-4294967295", 1, 0);
18376 check("-4294967296", 4294967295UL, ERANGE);
18377 check("-4294967297", 4294967295UL, ERANGE);
18382 : Should we write these tests to be more portable by sprintf-ing
18383 : ~0 and then manipulating that char string as input for strtol?
18386 $cat >>try.c <<'EOCP'
18393 if eval $compile; then
18394 case "`$run ./try`" in
18395 ok) echo "Your strtoul() seems to be working okay." ;;
18397 Your strtoul() doesn't seem to be working okay.
18403 echo "(I can't seem to compile the test program--assuming it doesn't)"
18409 : see if strtoull exists
18410 set strtoull d_strtoull
18413 case "$d_longlong-$d_strtoull" in
18416 Checking whether your strtoull() works okay...
18418 $cat >try.c <<'EOCP'
18421 #define strtoull __strtoull
18424 extern unsigned long long int strtoull(char *s, char **, int);
18425 static int bad = 0;
18426 int check(char *s, long long eull, int een) {
18429 gull = strtoull(s, 0, 10);
18430 if (!((gull == eull) && (errno == een)))
18434 check(" 1", 1LL, 0);
18435 check(" 0", 0LL, 0);
18436 check("18446744073709551615", 18446744073709551615ULL, 0);
18437 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18438 #if 0 /* strtoull() for /^-/ strings is undefined. */
18439 check("-1", 18446744073709551615ULL, 0);
18440 check("-18446744073709551614", 2LL, 0);
18441 check("-18446744073709551615", 1LL, 0);
18442 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18443 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18450 if eval $compile; then
18451 case "`$run ./try`" in
18452 ok) echo "Your strtoull() seems to be working okay." ;;
18454 Your strtoull() doesn't seem to be working okay.
18456 d_strtoull="$undef"
18460 echo "(I can't seem to compile the test program--assuming it doesn't)"
18461 d_strtoull="$undef"
18466 : see if strtouq exists
18467 set strtouq d_strtouq
18470 case "$d_strtouq" in
18473 Checking whether your strtouq() works okay...
18475 $cat >try.c <<'EOCP'
18478 extern unsigned long long int strtouq(char *s, char **, int);
18479 static int bad = 0;
18480 void check(char *s, unsigned long long eull, int een) {
18481 unsigned long long gull;
18483 gull = strtouq(s, 0, 10);
18484 if (!((gull == eull) && (errno == een)))
18488 check(" 1", 1LL, 0);
18489 check(" 0", 0LL, 0);
18490 check("18446744073709551615", 18446744073709551615ULL, 0);
18491 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18492 #if 0 /* strtouq() for /^-/ strings is undefined. */
18493 check("-1", 18446744073709551615ULL, 0);
18494 check("-18446744073709551614", 2LL, 0);
18495 check("-18446744073709551615", 1LL, 0);
18496 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18497 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18505 if eval $compile; then
18506 case "`$run ./try`" in
18507 ok) echo "Your strtouq() seems to be working okay." ;;
18509 Your strtouq() doesn't seem to be working okay.
18515 echo "(I can't seem to compile the test program--assuming it doesn't)"
18521 : see if strxfrm exists
18522 set strxfrm d_strxfrm
18525 : see if symlink exists
18526 set symlink d_symlink
18529 : see if syscall exists
18530 set syscall d_syscall
18533 : see if prototype for syscall is available
18535 set d_syscallproto syscall $i_unistd unistd.h
18538 : see if sysconf exists
18539 set sysconf d_sysconf
18542 : see if system exists
18543 set system d_system
18546 : see if tcgetpgrp exists
18547 set tcgetpgrp d_tcgetpgrp
18550 : see if tcsetpgrp exists
18551 set tcsetpgrp d_tcsetpgrp
18554 : see if prototype for telldir is available
18556 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
18559 : see if time exists
18561 if test "X$d_time" = X -o X"$timetype" = X; then
18562 if set time val -f d_time; eval $csym; $val; then
18563 echo 'time() found.' >&4
18565 rp="What is the type returned by time() on this system?"
18566 set time_t timetype long stdio.h sys/types.h
18569 echo 'time() not found, hope that will do.' >&4
18577 : see if timegm exists
18578 set timegm d_timegm
18581 : see if this is a sys/times.h system
18582 set sys/times.h i_systimes
18585 : see if times exists
18587 if set times val -f d_times; eval $csym; $val; then
18588 echo 'times() found.' >&4
18591 case "$i_systimes" in
18592 "$define") inc='sys/times.h';;
18594 rp="What is the type returned by times() on this system?"
18595 set clock_t clocktype long stdio.h sys/types.h $inc
18598 echo 'times() NOT found, hope that will do.' >&4
18603 : see if tmpnam_r exists
18604 set tmpnam_r d_tmpnam_r
18606 case "$d_tmpnam_r" in
18608 hdrs="$i_systypes sys/types.h define stdio.h "
18609 case "$d_tmpnam_r_proto:$usethreads" in
18610 ":define") d_tmpnam_r_proto=define
18611 set d_tmpnam_r_proto tmpnam_r $hdrs
18615 case "$d_tmpnam_r_proto" in
18617 case "$tmpnam_r_proto" in
18618 ''|0) try='char* tmpnam_r(char*);'
18619 ./protochk "$extern_C $try" $hdrs && tmpnam_r_proto=B_B ;;
18621 case "$tmpnam_r_proto" in
18622 ''|0) d_tmpnam_r=undef
18624 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
18625 * ) case "$tmpnam_r_proto" in
18626 REENTRANT_PROTO*) ;;
18627 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
18629 echo "Prototype: $try" ;;
18632 *) case "$usethreads" in
18633 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
18640 *) tmpnam_r_proto=0
18644 : see if truncate exists
18645 set truncate d_truncate
18648 : see if ttyname_r exists
18649 set ttyname_r d_ttyname_r
18651 case "$d_ttyname_r" in
18653 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
18654 case "$d_ttyname_r_proto:$usethreads" in
18655 ":define") d_ttyname_r_proto=define
18656 set d_ttyname_r_proto ttyname_r $hdrs
18660 case "$d_ttyname_r_proto" in
18662 case "$ttyname_r_proto" in
18663 ''|0) try='int ttyname_r(int, char*, size_t);'
18664 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBW ;;
18666 case "$ttyname_r_proto" in
18667 ''|0) try='int ttyname_r(int, char*, int);'
18668 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBI ;;
18670 case "$ttyname_r_proto" in
18671 ''|0) try='char* ttyname_r(int, char*, int);'
18672 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=B_IBI ;;
18674 case "$ttyname_r_proto" in
18675 ''|0) d_ttyname_r=undef
18677 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
18678 * ) case "$ttyname_r_proto" in
18679 REENTRANT_PROTO*) ;;
18680 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
18682 echo "Prototype: $try" ;;
18685 *) case "$usethreads" in
18686 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
18693 *) ttyname_r_proto=0
18697 : see if tzname[] exists
18699 if set tzname val -a d_tzname; eval $csym; $val; then
18701 echo 'tzname[] found.' >&4
18704 echo 'tzname[] NOT found.' >&4
18709 : Check if is a multiplatform env
18711 next|rhapsody|darwin) multiarch="$define" ;;
18713 case "$multiarch" in
18714 ''|[nN]*) multiarch="$undef" ;;
18717 : check for ordering of bytes in a UV
18719 case "$usecrosscompile$multiarch" in
18722 You seem to be either cross-compiling or doing a multiarchitecture build,
18723 skipping the byteorder check.
18729 case "$byteorder" in
18732 In the following, larger digits indicate more significance. A big-endian
18733 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
18734 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
18735 machines may have weird orders like 3412. A Cray will report 87654321,
18736 an Alpha will report 12345678. If the test program works the default is
18738 I'm now running the test program...
18742 #$i_stdlib I_STDLIB
18744 #include <stdlib.h>
18746 #include <sys/types.h>
18747 typedef $uvtype UV;
18757 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
18759 u.l = (UV)0x04030201;
18760 for (i = 0; i < $uvsize; i++)
18761 printf("%c", u.c[i]+'0');
18768 if eval $compile && $run ./try > /dev/null; then
18771 [1-4][1-4][1-4][1-4]|12345678|87654321)
18772 echo "(The test program ran ok.)"
18773 echo "byteorder=$dflt"
18776 ????|????????) echo "(The test program ran ok.)" ;;
18777 *) echo "(The test program didn't run right for some reason.)" ;;
18782 (I can't seem to compile the test program. Guessing big-endian...)
18785 case "$xxx_prompt" in
18787 rp="What is the order of bytes in $uvtype?"
18800 : Checking 32bit alignedness
18803 Checking to see whether you can access character data unalignedly...
18805 case "$d_u32align" in
18806 '') $cat >try.c <<EOCP
18808 #$i_stdlib I_STDLIB
18810 #include <stdlib.h>
18812 #define U32 $u32type
18813 #define BYTEORDER 0x$byteorder
18815 #include <signal.h>
18817 $signal_t bletch(int s) { exit(4); }
18820 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
18821 volatile U8 buf[8];
18825 if (sizeof(U32) != 4) {
18826 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
18833 signal(SIGBUS, bletch);
18845 for (i = 0; i < 4; i++) {
18846 up = (U32*)(buf + i);
18847 if (! ((*up == 1 << (8*i)) || /* big-endian */
18848 (*up == 1 << (8*(3-i))) /* little-endian */
18852 printf("read failed (%x)\n", *up);
18858 for (i = 0; i < 4; i++) {
18859 up = (U32*)(buf + i);
18861 if (*up != 0xBeef) {
18862 printf("write failed (%x)\n", *up);
18876 if eval $compile_ok; then
18877 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
18878 $run ./try 2>&1 >/dev/null
18881 You can access character data pretty unalignedly.
18883 d_u32align="$undef"
18886 It seems that you must access character data in an aligned manner.
18888 d_u32align="$define"
18892 rp='Can you access character data at unaligned addresses?'
18896 [yY]*) d_u32align="$undef" ;;
18897 *) d_u32align="$define" ;;
18904 : see if ualarm exists
18905 set ualarm d_ualarm
18908 : see if umask exists
18912 : see if unordered exists
18913 set unordered d_unordered
18916 : see if unsetenv exists
18917 set unsetenv d_unsetenv
18920 : see if usleep exists
18921 set usleep d_usleep
18924 : see if prototype for usleep is available
18926 set d_usleepproto usleep $i_unistd unistd.h
18929 : see if ustat exists
18933 : see if closedir exists
18934 set closedir d_closedir
18937 case "$d_closedir" in
18940 echo "Checking whether closedir() returns a status..." >&4
18942 #$i_dirent I_DIRENT /**/
18943 #$i_sysdir I_SYS_DIR /**/
18944 #$i_sysndir I_SYS_NDIR /**/
18945 #$i_systypes I_SYS_TYPES /**/
18947 #if defined(I_SYS_TYPES)
18948 #include <sys/types.h>
18950 #if defined(I_DIRENT)
18951 #include <dirent.h>
18952 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
18953 #include <sys/dir.h>
18957 #include <sys/ndir.h>
18961 #include <ndir.h> /* may be wrong in the future */
18963 #include <sys/dir.h>
18968 int main() { return closedir(opendir(".")); }
18971 if eval $compile_ok; then
18972 if $run ./try > /dev/null 2>&1 ; then
18973 echo "Yes, it does."
18976 echo "No, it doesn't."
18980 echo "(I can't seem to compile the test program--assuming it doesn't)"
18988 set d_void_closedir
18992 : see if there is a wait4
18996 : see if waitpid exists
18997 set waitpid d_waitpid
19000 : see if wcstombs exists
19001 set wcstombs d_wcstombs
19004 : see if wctomb exists
19005 set wctomb d_wctomb
19008 : see if writev exists
19009 set writev d_writev
19012 : preserve RCS keywords in files with variable substitution, grrr
19017 Revision='$Revision'
19019 : check for alignment requirements
19021 case "$usecrosscompile" in
19024 You seem to be cross-compiling. Skipping the memory alignment check.
19027 case "$alignbytes" in
19028 '') alignbytes=8 ;;
19032 case "$alignbytes" in
19033 '') echo "Checking alignment constraints..." >&4
19034 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
19035 $cat >try.c <<'EOCP'
19036 typedef long double NV;
19039 $cat >try.c <<'EOCP'
19043 $cat >>try.c <<'EOCP'
19051 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
19056 if eval $compile_ok; then
19060 echo "(I can't seem to compile the test program...)"
19062 case "$multiarch" in
19064 : The usual safe value is 8, but Darwin with -Duselongdouble
19065 : needs 16. Hence, we will take 8 as a minimum, but allow
19066 : Configure to pick a larger value if needed.
19067 if $test "$dflt" -lt 8; then
19069 echo "Setting alignment to 8 for multiarch support.">&4
19074 *) dflt="$alignbytes"
19077 rp="Doubles must be aligned on a how-many-byte boundary?"
19085 : set the base revision
19088 : length of character in bytes. Is always 1, otherwise it isnt C
19089 : This used to be a test using sizeof
19092 : Check for the number of bits in a character
19093 case "$charbits" in
19094 '') echo "Checking how long a character is (in bits)..." >&4
19101 for (c = 1, n = 0; c; c <<= 1, n++) ;
19102 printf ("%d\n", n);
19107 if eval $compile_ok; then
19111 echo "(I can't seem to compile the test program. Guessing...)"
19118 rp="What is the length of a character (in bits)?"
19122 case "$charbits" in
19125 Your system has an unsigned character size of $charbits bits, which
19126 is rather unusual (normally it is 8 bits). Perl likely will not work
19127 correctly on your system, with subtle bugs in various places.
19129 rp='Do you really want to continue?'
19133 [yY]) echo >&4 "Okay, continuing." ;;
19138 : how do we concatenate cpp tokens here?
19140 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
19141 $cat >cpp_stuff.c <<'EOCP'
19142 #define RCAT(a,b)a/**/b
19143 #define ACAT(a,b)a ## b
19147 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
19148 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
19149 echo "Oh! Smells like ANSI's been here." >&4
19150 echo "We can catify or stringify, separately or together!"
19152 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
19153 echo "Ah, yes! The good old days!" >&4
19154 echo "However, in the good old days we don't know how to stringify and"
19155 echo "catify at the same time."
19159 Hmm, I don't seem to be able to concatenate tokens with your cpp.
19160 You're going to have to edit the values of CAT[2-5] in config.h...
19162 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
19166 : see if this is a db.h system
19172 : Check db version.
19174 echo "Checking Berkeley DB version ..." >&4
19180 #include <sys/types.h>
19182 #$i_stdlib I_STDLIB
19184 #include <stdlib.h>
19187 int main(int argc, char *argv[])
19189 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
19190 int Major, Minor, Patch ;
19191 unsigned long Version ;
19192 (void)db_version(&Major, &Minor, &Patch) ;
19194 printf("%d %d %d %d %d %d\n",
19195 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
19196 Major, Minor, Patch);
19199 printf("You have Berkeley DB Version 2 or greater.\n");
19201 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
19202 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
19203 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
19204 Major, Minor, Patch) ;
19206 /* check that db.h & libdb are compatible */
19207 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
19208 printf("db.h and libdb are incompatible.\n") ;
19212 printf("db.h and libdb are compatible.\n") ;
19214 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
19215 + DB_VERSION_PATCH ;
19217 /* needs to be >= 2.3.4 */
19218 if (Version < 2003004) {
19219 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
19220 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
19226 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
19231 printf("You have Berkeley DB Version 1.\n");
19232 exit(0); /* DB version < 2: the coast is clear. */
19234 exit(1); /* <db.h> not Berkeley DB? */
19240 if eval $compile_ok && $run ./try; then
19241 echo 'Looks OK.' >&4
19243 db_version_major=$1
19244 db_version_minor=$2
19245 db_version_patch=$3
19247 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
19251 : Remove db from list of libraries to use
19252 echo "Removing unusable -ldb from library list" >&4
19253 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
19256 echo "libs = $libs" >&4
19266 : Check the return type needed for hash
19268 echo "Checking return type needed for hash for Berkeley DB ..." >&4
19274 #include <sys/types.h>
19277 #ifndef DB_VERSION_MAJOR
19278 u_int32_t hash_cb (ptr, size)
19286 info.hash = hash_cb;
19290 if $cc $ccflags -c try.c >try.out 2>&1 ; then
19291 if $contains warning try.out >>/dev/null 2>&1 ; then
19294 db_hashtype='u_int32_t'
19297 : XXX Maybe we should just give up here.
19298 db_hashtype=u_int32_t
19300 echo "Help: I can't seem to compile the db test program." >&4
19301 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
19304 echo "Your version of Berkeley DB uses $db_hashtype for hash."
19306 *) db_hashtype=u_int32_t
19311 : Check the return type needed for prefix
19313 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
19319 #include <sys/types.h>
19322 #ifndef DB_VERSION_MAJOR
19323 size_t prefix_cb (key1, key2)
19331 info.prefix = prefix_cb;
19335 if $cc $ccflags -c try.c >try.out 2>&1 ; then
19336 if $contains warning try.out >>/dev/null 2>&1 ; then
19337 db_prefixtype='int'
19339 db_prefixtype='size_t'
19342 db_prefixtype='size_t'
19343 : XXX Maybe we should just give up here.
19345 echo "Help: I can't seem to compile the db test program." >&4
19346 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
19349 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
19351 *) db_prefixtype='size_t'
19355 : How can we generate normalized random numbers ?
19357 echo "Looking for a random number function..." >&4
19358 case "$randfunc" in
19360 if set drand48 val -f; eval $csym; $val; then
19362 echo "Good, found drand48()." >&4
19363 elif set random val -f; eval $csym; $val; then
19365 echo "OK, found random()." >&4
19368 echo "Yick, looks like I have to use rand()." >&4
19379 *-Dmy_rand=*|*-Dmy_srand=*)
19380 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
19381 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
19382 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
19383 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
19387 while $test "$cont"; do
19388 rp="Use which function to generate random numbers?"
19390 if $test "$ans" = "$dflt"; then
19396 if set $ans val -f; eval $csym; $val; then
19400 rp="I cannot find function $ans. Use that name anyway?"
19409 case "$randfunc" in
19411 drand01="drand48()"
19417 case "$randbits" in
19419 echo "Checking to see how many bits your $randfunc() function produces..." >&4
19421 #$i_unistd I_UNISTD
19422 #$i_stdlib I_STDLIB
19425 # include <unistd.h>
19428 # include <stdlib.h>
19433 register unsigned long tmp;
19434 register unsigned long max = 0L;
19436 for (i = 1000; i; i--) {
19437 tmp = (unsigned long) $randfunc();
19438 if (tmp > max) max = tmp;
19440 for (i = 0; max; i++)
19446 if eval $compile_ok; then
19450 echo "(I can't seem to compile the test program...)"
19457 rp="How many bits does your $randfunc() function produce?"
19461 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
19462 seedfunc="s$randfunc"
19463 randseedtype=unsigned
19467 rp="How many bits does your $randfunc() function produce?"
19470 seedfunc="s$randfunc"
19471 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
19472 if set $seedfunc val -f; eval $csym; $val; then
19473 echo "(Using $seedfunc() to seed random generator)"
19475 echo "(Warning: no $seedfunc() to seed random generator)"
19478 randseedtype=unsigned
19485 : Determine if this is an EBCDIC system
19487 echo "Determining whether or not we are on an EBCDIC system..." >&4
19488 $cat >try.c <<'EOM'
19491 if ('M'==0xd4) return 0;
19498 if eval $compile_ok; then
19499 if $run ./try; then
19500 echo "You seem to speak EBCDIC." >&4
19503 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
19506 echo "I'm unable to compile the test program." >&4
19507 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
19513 : Check how to flush
19516 Checking how to flush all pending stdio output...
19518 # I only know how to find the first 32 possibly open files on SunOS.
19519 # See also hints/sunos_4_1.sh and util.c --AD
19521 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
19523 $cat >>try.c <<EOCP
19525 #$i_stdlib I_STDLIB
19527 #include <stdlib.h>
19529 #$i_unistd I_UNISTD
19531 # include <unistd.h>
19533 #$d_sysconf HAS_SYSCONF
19534 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
19535 #ifdef HAS_STDIO_STREAM_ARRAY
19536 # define STDIO_STREAM_ARRAY $stdio_stream_array
19541 p = fopen("try.out", "w");
19545 # ifdef TRY_FPRINTF
19549 #ifdef TRY_FFLUSH_NULL
19552 #ifdef TRY_FFLUSH_ALL
19554 long open_max = -1;
19555 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
19556 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
19558 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
19559 open_max = sysconf(_SC_OPEN_MAX);
19562 open_max = FOPEN_MAX;
19565 open_max = OPEN_MAX;
19574 # ifdef HAS_STDIO_STREAM_ARRAY
19575 if (open_max > 0) {
19577 for (i = 0; i < open_max; i++)
19578 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
19579 STDIO_STREAM_ARRAY[i]._file < open_max &&
19580 STDIO_STREAM_ARRAY[i]._flag)
19581 fflush(&STDIO_STREAM_ARRAY[i]);
19589 : first we have to find out how _not_ to flush
19591 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
19593 set try -DTRY_FPUTC
19594 if eval $compile; then
19595 $run ./try 2>/dev/null
19598 if $test ! -s try.out -a "X$code" = X42; then
19604 set try -DTRY_FPRINTF
19605 if eval $compile; then
19606 $run ./try 2>/dev/null
19609 if $test ! -s try.out -a "X$code" = X42; then
19610 output=-DTRY_FPRINTF
19616 : check for fflush NULL behaviour
19617 case "$fflushNULL" in
19618 '') set try -DTRY_FFLUSH_NULL $output
19619 if eval $compile; then
19620 $run ./try 2>/dev/null
19623 if $test -s try.out -a "X$code" = X42; then
19624 fflushNULL="`$cat try.out`"
19626 if $test "X$code" != X42; then
19628 (If this test failed, don't worry, we'll try another method shortly.)
19633 $rm -f core try.core core.try.*
19634 case "$fflushNULL" in
19636 Your fflush(NULL) works okay for output streams.
19637 Let's see if it clobbers input pipes...
19639 # As of mid-March 2000 all versions of Solaris appear to have a stdio
19640 # bug that improperly flushes the input end of pipes. So we avoid the
19641 # autoflush on fork/system/exec support for now. :-(
19642 $cat >tryp.c <<EOCP
19645 main(int argc, char **argv)
19651 while ((i = getc(stdin)) != -1
19652 && (*bp++ = i) != '\n'
19653 && bp < &buf[1024])
19656 fprintf(stdout, "%s", buf);
19664 fflushNULL="$define"
19666 if eval $compile; then
19668 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19669 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19671 fflush(NULL) seems to behave okay with input streams.
19673 fflushNULL="$define"
19676 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
19678 fflushNULL="$undef"
19681 $rm -f core tryp.c tryp.core core.tryp.*
19684 Your fflush(NULL) isn't working (contrary to ANSI C).
19686 fflushNULL="$undef"
19689 Cannot figure out whether your fflush(NULL) works or not.
19690 I'm assuming it doesn't (contrary to ANSI C).
19692 fflushNULL="$undef"
19696 $define|true|[yY]*)
19697 fflushNULL="$define"
19700 fflushNULL="$undef"
19703 : check explicit looping only if NULL did not work, and if the pipe
19704 : bug does not show up on an explicit flush too
19705 case "$fflushNULL" in
19707 $cat >tryp.c <<EOCP
19710 main(int argc, char **argv)
19716 while ((i = getc(stdin)) != -1
19717 && (*bp++ = i) != '\n'
19718 && bp < &buf[1024])
19721 fprintf(stdout, "%s", buf);
19730 if eval $compile; then
19732 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19733 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19735 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
19737 : now check for fflushall behaviour
19738 case "$fflushall" in
19739 '') set try -DTRY_FFLUSH_ALL $output
19740 if eval $compile; then
19742 (Now testing the other method--but note that this also may fail.)
19744 $run ./try 2>/dev/null
19747 if $test -s try.out -a "X$code" = X42; then
19748 fflushall="`$cat try.out`"
19752 case "$fflushall" in
19754 Whew. Flushing explicitly all the stdio streams works.
19756 fflushall="$define"
19759 Sigh. Flushing explicitly all the stdio streams doesn't work.
19764 Cannot figure out whether flushing stdio streams explicitly works or not.
19765 I'm assuming it doesn't.
19771 "$define"|true|[yY]*)
19772 fflushall="$define"
19780 All is futile. Even fflush(stdin) clobbers input pipes!
19787 $rm -f core tryp.c tryp.core core.tryp.*
19789 *) fflushall="$undef"
19793 case "$fflushNULL$fflushall" in
19796 OK, I give up. I cannot figure out how to flush pending stdio output.
19797 We won't be flushing handles at all before fork/exec/popen.
19803 : Store the full pathname to the ar program for use in the C program
19804 : Respect a hint or command line value for full_ar.
19809 : Store the full pathname to the sed program for use in the C program
19812 : see what type gids are declared as in the kernel
19814 echo "Looking for the type for group ids returned by getgid()."
19815 set gid_t gidtype xxx stdio.h sys/types.h
19819 xxx=`./findhdr sys/user.h`
19820 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
19822 unsigned) dflt="$1 $2" ;;
19826 *) dflt="$gidtype";;
19829 gid_t) echo "gid_t found." ;;
19830 *) rp="What is the type for group ids returned by getgid()?"
19836 : Check the size of GID
19839 *_t) zzz="$gidtype" ;;
19842 echo "Checking the size of $zzz..." >&4
19844 #include <sys/types.h>
19846 #$i_stdlib I_STDLIB
19848 #include <stdlib.h>
19851 printf("%d\n", (int)sizeof($gidtype));
19856 if eval $compile_ok; then
19860 echo "(I can't execute the test program--guessing $gidsize.)" >&4
19863 echo "Your $zzz is $gidsize bytes long."
19868 echo "(I can't compile the test program--guessing $gidsize.)" >&4
19872 : Check if GID is signed
19875 *_t) zzz="$gidtype" ;;
19878 echo "Checking the sign of $zzz..." >&4
19880 #include <sys/types.h>
19891 if eval $compile; then
19895 echo "(I can't execute the test program--guessing unsigned.)" >&4
19899 1) echo "Your $zzz is unsigned." ;;
19900 -1) echo "Your $zzz is signed." ;;
19906 echo "(I can't compile the test program--guessing unsigned.)" >&4
19910 : Check 64bit sizes
19913 if $test X"$quadtype" != X; then
19915 echo "Checking how to print 64-bit integers..." >&4
19917 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
19918 $cat >try.c <<'EOCP'
19919 #include <sys/types.h>
19922 int q = 12345678901;
19923 printf("%ld\n", q);
19927 if eval $compile; then
19931 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
19932 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
19933 echo "We will use %d."
19939 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
19940 $cat >try.c <<'EOCP'
19941 #include <sys/types.h>
19944 long q = 12345678901;
19945 printf("%ld\n", q);
19949 if eval $compile; then
19953 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
19954 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
19955 echo "We will use %ld."
19961 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
19962 $cat >try.c <<'EOCP'
19963 #include <sys/types.h>
19964 #include <inttypes.h>
19967 int64_t q = 12345678901;
19968 printf("%" PRId64 "\n", q);
19972 if eval $compile; then
19976 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
19977 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
19978 echo "We will use the C9X style."
19984 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19986 #include <sys/types.h>
19989 $quadtype q = 12345678901;
19990 printf("%Ld\n", q);
19994 if eval $compile; then
19998 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
19999 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
20000 echo "We will use %Ld."
20006 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
20007 $cat >try.c <<'EOCP'
20008 #include <sys/types.h>
20011 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
20012 printf("%lld\n", q);
20016 if eval $compile; then
20020 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
20021 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
20022 echo "We will use the %lld style."
20028 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
20030 #include <sys/types.h>
20033 $quadtype q = 12345678901;
20034 printf("%qd\n", q);
20038 if eval $compile; then
20042 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
20043 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
20044 echo "We will use %qd."
20050 if $test X"$sPRId64" = X; then
20051 echo "Cannot figure out how to print 64-bit integers." >&4
20058 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
20059 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
20061 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
20062 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
20066 : Check format strings for internal types
20068 $echo "Checking the format strings to be used for Perl's internal types..." >&4
20070 if $test X"$ivsize" = X8; then
20071 ivdformat="$sPRId64"
20072 uvuformat="$sPRIu64"
20073 uvoformat="$sPRIo64"
20074 uvxformat="$sPRIx64"
20075 uvXUformat="$sPRIXU64"
20077 if $test X"$ivsize" = X"$longsize"; then
20084 if $test X"$ivsize" = X"$intsize"; then
20092 if $test X"$ivsize" = X"$shortsize"; then
20103 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
20104 nveformat="$sPRIeldbl"
20105 nvfformat="$sPRIfldbl"
20106 nvgformat="$sPRIgldbl"
20107 nvEUformat="$sPRIEUldbl"
20108 nvFUformat="$sPRIFUldbl"
20109 nvGUformat="$sPRIGUldbl"
20119 case "$ivdformat" in
20120 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
20125 : Check format string for GID
20128 $echo "Checking the format string to be used for gids..." >&4
20131 -1) if $test X"$gidsize" = X"$ivsize"; then
20132 gidformat="$ivdformat"
20134 if $test X"$gidsize" = X"$longsize"; then
20137 if $test X"$gidsize" = X"$intsize"; then
20140 if $test X"$gidsize" = X"$shortsize"; then
20147 *) if $test X"$gidsize" = X"$uvsize"; then
20148 gidformat="$uvuformat"
20150 if $test X"$gidsize" = X"$longsize"; then
20153 if $test X"$gidsize" = X"$intsize"; then
20156 if $test X"$gidsize" = X"$shortsize"; then
20165 : see if getgroups exists
20166 set getgroups d_getgrps
20169 : see if setgroups exists
20170 set setgroups d_setgrps
20173 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
20175 case "$d_getgrps$d_setgrps" in
20177 case "$groupstype" in
20178 '') dflt="$gidtype" ;;
20179 *) dflt="$groupstype" ;;
20182 What type of pointer is the second argument to getgroups() and setgroups()?
20183 Usually this is the same as group ids, $gidtype, but not always.
20186 rp='What type pointer is the second argument to getgroups() and setgroups()?'
20190 *) groupstype="$gidtype";;
20193 : MAD = Misc Attribute Definition
20195 if $test $patchlevel -lt 9; then
20196 : MAD is not available in 5.8.x or earlier.
20200 $define|true|[yY]*) dflt='y' ;;
20205 Would you like to build with Misc Attribute Decoration? This is development
20206 work leading to a Perl 5 to Perl 6 convertor, which imposes a space and speed
20207 overhead on the interpreter.
20209 If this doesn't make any sense to you, just accept the default '$dflt'.
20211 rp='Build Perl with MAD?'
20216 madlyh='madly.h madly.act madly.tab'
20218 madlyobj="madly$_o" ;;
20227 : check whether make sets MAKE
20229 echo "Checking if your $make program sets \$(MAKE)..." >&4
20230 case "$make_set_make" in
20232 $sed 's/^X //' > testmake.mak << 'EOF'
20234 X @echo 'maketemp="$(MAKE)"'
20236 case "`$make -f testmake.mak 2>/dev/null`" in
20237 *maketemp=*) make_set_make='#' ;;
20238 *) make_set_make="MAKE=$make" ;;
20240 $rm -f testmake.mak
20243 case "$make_set_make" in
20244 '#') echo "Yup, it does.";;
20245 *) echo "Nope, it doesn't.";;
20248 : see what type is used for mode_t
20249 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
20250 set mode_t modetype int stdio.h sys/types.h
20253 : see if we need va_copy
20255 case "$i_stdarg" in
20258 #include <stdarg.h>
20260 #$i_stdlib I_STDLIB
20262 #include <stdlib.h>
20264 #include <signal.h>
20267 ivfprintf(FILE *f, const char *fmt, va_list *valp)
20269 return vfprintf(f, fmt, *valp);
20273 myvfprintf(FILE *f, const char *fmt, va_list val)
20275 return ivfprintf(f, fmt, &val);
20279 myprintf(char *fmt, ...)
20282 va_start(val, fmt);
20283 return myvfprintf(stdout, fmt, val);
20287 main(int ac, char **av)
20289 signal(SIGSEGV, exit);
20291 myprintf("%s%cs all right, then\n", "that", '\'');
20296 if eval $compile && $run ./try 2>&1 >/dev/null; then
20297 case "`$run ./try`" in
20298 "that's all right, then")
20304 yes) echo "It seems that you don't need va_copy()." >&4
20305 need_va_copy="$undef"
20307 *) echo "It seems that va_copy() or similar will be needed." >&4
20308 need_va_copy="$define"
20313 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
20317 : see what type is used for size_t
20318 rp="What is the type used for the length parameter for string functions?"
20319 set size_t sizetype 'unsigned int' stdio.h sys/types.h
20322 : check for type of arguments to gethostbyaddr.
20323 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
20324 case "$d_gethbyaddr" in
20328 Checking to see what type of arguments are accepted by gethostbyaddr().
20330 hdrs="$define sys/types.h
20331 $d_socket sys/socket.h
20332 $i_niin netinet/in.h
20334 $i_unistd unistd.h"
20335 : The first arg can 'char *' or 'void *'
20336 : The second arg is some of integral type
20337 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
20338 for yyy in size_t long int; do
20339 case "$netdb_host_type" in
20340 '') try="$extern_C struct hostent *gethostbyaddr($xxx, $yyy, int);"
20341 if ./protochk "$try" $hdrs; then
20342 echo "Your system accepts $xxx for the first arg."
20343 echo "...and $yyy for the second arg."
20344 netdb_host_type="$xxx"
20345 netdb_hlen_type="$yyy"
20351 : In case none of those worked, prompt the user.
20352 case "$netdb_host_type" in
20353 '') rp='What is the type for the 1st argument to gethostbyaddr?'
20356 netdb_host_type=$ans
20357 rp='What is the type for the 2nd argument to gethostbyaddr?'
20360 netdb_hlen_type=$ans
20364 *) : no gethostbyaddr, so pick harmless defaults
20365 netdb_host_type='char *'
20366 netdb_hlen_type="$sizetype"
20369 # Remove the "const" if needed. -- but then we'll have a
20371 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
20374 : check for type of argument to gethostbyname.
20375 if test "X$netdb_name_type" = X ; then
20376 case "$d_gethbyname" in
20380 Checking to see what type of argument is accepted by gethostbyname().
20382 hdrs="$define sys/types.h
20383 $d_socket sys/socket.h
20384 $i_niin netinet/in.h
20386 $i_unistd unistd.h"
20387 for xxx in "const char *" "char *"; do
20388 case "$netdb_name_type" in
20389 '') try="$extern_C struct hostent *gethostbyname($xxx);"
20390 if ./protochk "$try" $hdrs; then
20391 echo "Your system accepts $xxx."
20392 netdb_name_type="$xxx"
20397 : In case none of those worked, prompt the user.
20398 case "$netdb_name_type" in
20399 '') rp='What is the type for the 1st argument to gethostbyname?'
20402 netdb_name_type=$ans
20406 *) : no gethostbyname, so pick harmless default
20407 netdb_name_type='char *'
20412 : check for type of 1st argument to getnetbyaddr.
20413 if test "X$netdb_net_type" = X ; then
20414 case "$d_getnbyaddr" in
20418 Checking to see what type of 1st argument is accepted by getnetbyaddr().
20420 hdrs="$define sys/types.h
20421 $d_socket sys/socket.h
20422 $i_niin netinet/in.h
20424 $i_unistd unistd.h"
20425 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
20426 case "$netdb_net_type" in
20427 '') try="$extern_C struct netent *getnetbyaddr($xxx, int);"
20428 if ./protochk "$try" $hdrs; then
20429 echo "Your system accepts $xxx."
20430 netdb_net_type="$xxx"
20435 : In case none of those worked, prompt the user.
20436 case "$netdb_net_type" in
20437 '') rp='What is the type for the 1st argument to getnetbyaddr?'
20440 netdb_net_type=$ans
20444 *) : no getnetbyaddr, so pick harmless default
20445 netdb_net_type='long'
20449 : locate the preferred pager for this system
20456 [a-zA-Z]:/*) dflt=$pg;;
20460 [a-zA-Z]:/*) dflt=$more;;
20464 [a-zA-Z]:/*) dflt=$less;;
20467 '') dflt=/usr/ucb/more;;
20475 rp='What pager is used on your system?'
20479 : see what type pids are declared as in the kernel
20480 rp="What is the type of process ids on this system?"
20481 set pid_t pidtype int stdio.h sys/types.h
20484 : see if ar generates random libraries by itself
20486 echo "Checking how to generate random libraries on your machine..." >&4
20487 echo 'int bar1() { return bar2(); }' > bar1.c
20488 echo 'int bar2() { return 2; }' > bar2.c
20490 #$i_stdlib I_STDLIB
20492 #include <stdlib.h>
20494 int main() { printf("%d\n", bar1()); exit(0); }
20496 $cc $ccflags -c bar1.c >/dev/null 2>&1
20497 $cc $ccflags -c bar2.c >/dev/null 2>&1
20498 $cc $ccflags -c foo.c >/dev/null 2>&1
20499 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
20500 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20501 $run ./foobar >/dev/null 2>&1; then
20502 echo "$ar appears to generate random libraries itself."
20504 if [ "X$ranlib" = "X" ]; then
20507 elif $ar s bar$_a >/dev/null 2>&1 &&
20508 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20509 $run ./foobar >/dev/null 2>&1; then
20510 echo "a table of contents needs to be added with '$ar s'."
20513 elif $ar ts bar$_a >/dev/null 2>&1 &&
20514 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20515 $run ./foobar >/dev/null 2>&1; then
20516 echo "a table of contents needs to be added with '$ar ts'."
20523 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
20524 $test -f $ranlib || ranlib=''
20527 if $test -n "$ranlib"; then
20528 echo "your system has '$ranlib'; we'll use that."
20531 echo "your system doesn't seem to support random libraries"
20532 echo "so we'll use lorder and tsort to order the libraries."
20539 : see if this is a values.h system
20540 set values.h i_values
20543 : Check the max offset that gmtime and localtime accept
20544 echo "Checking max offsets that gmtime () accepts"
20547 define) yyy="#include <values.h>" ;;
20551 case "$sGMTIME_min/$sGMTIME_max" in
20554 #include <sys/types.h>
20563 void gm_check (time_t t, int min_year, int max_year)
20566 if ( tmp == NULL ||
20567 /* Check tm_year overflow */
20568 tmp->tm_year < min_year || tmp->tm_year > max_year)
20579 gm_check (MAXLONG, 69, 0x7fffffff);
20581 if (tmp == NULL || tmp->tm_year < 0) {
20582 for (i = 63; i >= 0; i--) {
20583 time_t x = pt | ((time_t)1 << i);
20584 if (x < 0 || x < pt) continue;
20585 gm_check (x, 69, 0x7fffffff);
20588 printf ("sGMTIME_max=%ld\n", pt);
20597 gm_check (MINLONG, -1900, 70);
20600 for (i = 36; i >= 0; i--) {
20601 time_t x = pt - ((time_t)1 << i);
20602 if (x > 0) continue;
20603 gm_check (x, -1900, 70);
20606 printf ("sGMTIME_min=%ld\n", pt);
20610 int main (int argc, char *argv[])
20612 fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t));
20619 if eval $compile; then
20622 echo "Cannot determine sGMTIME_max and sGMTIME_min." >&4
20628 echo "Checking max offsets that localtime () accepts"
20630 case "$sLOCALTIME_min/$sLOCALTIME_max" in
20633 #include <sys/types.h>
20642 void local_check (time_t t, int min_year, int max_year)
20644 if (sizeof (time_t) > 4 && t > 0x7ffffffffffff000LL)
20647 tmp = localtime (&t);
20648 if ( tmp == NULL ||
20649 /* Check tm_year overflow */
20650 tmp->tm_year < min_year || tmp->tm_year > max_year)
20654 } /* local_check */
20661 local_check (MAXLONG, 69, 0x7fffffff);
20663 if (tmp == NULL || tmp->tm_year < 0) {
20664 for (i = 63; i >= 0; i--) {
20665 time_t x = pt | ((time_t)1 << i);
20666 if (x < 0 || x < pt) continue;
20667 local_check (x, 69, 0x7fffffff);
20670 printf ("sLOCALTIME_max=%ld\n", pt);
20679 local_check (MINLONG, -1900, 70);
20682 for (i = 36; i >= 0; i--) {
20683 time_t x = pt - ((time_t)1 << i);
20684 if (x > 0) continue;
20685 local_check (x, -1900, 70);
20688 printf ("sLOCALTIME_min=%ld\n", pt);
20692 int main (int argc, char *argv[])
20700 if eval $compile; then
20703 echo "Cannot determine sLOCALTIME_max and sLOCALTIME_min." >&4
20709 : check for type of arguments to select.
20710 case "$selecttype" in
20711 '') case "$d_select" in
20715 Checking to see what type of arguments are accepted by select().
20717 hdrs="$define sys/types.h
20718 $i_systime sys/time.h
20719 $i_sysselct sys/select.h
20720 $d_socket sys/socket.h"
20721 : The first arg can be int, unsigned, or size_t
20722 : The last arg may or may not be 'const'
20724 : void pointer has been seen but using that
20725 : breaks the selectminbits test
20726 for xxx in 'fd_set *' 'int *'; do
20727 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
20728 for tmo in 'struct timeval *' 'const struct timeval *'; do
20730 '') try="$extern_C select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
20731 if ./protochk "$try" $hdrs; then
20732 echo "Your system accepts $xxx."
20741 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
20742 case "$d_fd_set" in
20743 $define) dflt="fd_set *" ;;
20752 *) : no select, so pick a harmless default
20759 : check for the select 'width'
20760 case "$selectminbits" in
20761 '') safebits=`expr $ptrsize \* 8`
20762 case "$d_select" in
20766 Checking to see on how many bits at a time your select() operates...
20769 #include <sys/types.h>
20771 #$i_systime I_SYS_TIME
20772 #$i_systimek I_SYS_TIME_KERNEL
20777 # ifdef I_SYS_TIME_KERNEL
20780 # include <sys/time.h>
20781 # ifdef I_SYS_TIME_KERNEL
20785 #$i_sysselct I_SYS_SELECT
20786 #ifdef I_SYS_SELECT
20787 #include <sys/select.h>
20789 #$d_socket HAS_SOCKET
20791 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
20794 #$i_stdlib I_STDLIB
20796 #include <stdlib.h>
20799 #define S sizeof(*(b))
20801 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
20802 #define NBITS (NBYTES * 8)
20804 char *s = (char *)malloc(NBYTES);
20813 fp = fopen("try.c", "r");
20819 b = ($selecttype)s;
20820 for (i = 0; i < NBITS; i++)
20824 select(fd + 1, b, 0, 0, &t);
20825 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
20827 printf("%d\n", i + 1);
20832 if eval $compile_ok; then
20833 selectminbits=`$run ./try`
20834 case "$selectminbits" in
20836 Cannot figure out on how many bits at a time your select() operates.
20837 I'll play safe and guess it is $safebits bits.
20839 selectminbits=$safebits
20840 bits="$safebits bits"
20843 *) bits="$selectminbits bits" ;;
20845 echo "Your select() operates on $bits at a time." >&4
20847 rp='What is the minimum number of bits your select() operates on?'
20848 case "$byteorder" in
20849 12345678) dflt=64 ;;
20855 selectminbits="$val"
20859 *) : no select, so pick a harmless default
20860 selectminbits=$safebits
20866 : Trace out the files included by signal.h, then look for SIGxxx names.
20867 if [ "X$fieldn" = X ]; then
20868 : Just make some guesses. We check them later.
20869 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
20871 xxx=`echo '#include <signal.h>' |
20872 $cppstdin $cppminus $cppflags 2>/dev/null |
20873 $grep '^[ ]*#.*include' |
20874 $awk "{print \\$$fieldn}" | $sed 's!"!!g' |\
20875 $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
20878 for xx in $xxx /dev/null ; do
20879 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
20881 case "$xxxfiles" in
20882 '') xxxfiles=`./findhdr signal.h` ;;
20885 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
20886 print substr($2, 4, 20)
20888 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
20889 print substr($3, 4, 20)
20891 : Append some common names just in case the awk scan failed.
20892 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
20893 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
20894 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
20895 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
20896 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
20898 : generate a few handy files for later
20899 $cat > signal.c <<EOCP
20900 #include <sys/types.h>
20901 #include <signal.h>
20902 #$i_stdlib I_STDLIB
20904 #include <stdlib.h>
20909 /* Strange style to avoid deeply-nested #if/#else/#endif */
20912 # define NSIG (_NSIG)
20918 # define NSIG (SIGMAX+1)
20924 # define NSIG (SIG_MAX+1)
20930 # define NSIG (_SIG_MAX+1)
20936 # define NSIG (MAXSIG+1)
20942 # define NSIG (MAX_SIG+1)
20947 # ifdef SIGARRAYSIZE
20948 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
20954 # define NSIG (_sys_nsig) /* Solaris 2.5 */
20958 /* Default to some arbitrary number that's big enough to get most
20959 of the common signals.
20965 printf("NSIG %d\n", NSIG);
20971 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
20973 printf "#ifdef SIG"; printf $1; printf "\n"
20974 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
20975 printf $1; printf ");\n"
20979 printf "#endif /* JUST_NSIG */\n";
20980 printf "exit(0);\n}\n";
20983 $cat >signal.awk <<'EOP'
20984 BEGIN { ndups = 0 }
20985 $1 ~ /^NSIG$/ { nsig = $2 }
20986 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
20987 if ($2 > maxsig) { maxsig = $2 }
20988 if (sig_name[$2]) {
20989 dup_name[ndups] = $1
20990 dup_num[ndups] = $2
21002 printf("NSIG %d\n", nsig);
21003 for (n = 1; n < nsig; n++) {
21005 printf("%s %d\n", sig_name[n], sig_num[n])
21008 printf("NUM%d %d\n", n, n)
21011 for (n = 0; n < ndups; n++) {
21012 printf("%s %d\n", dup_name[n], dup_num[n])
21016 $cat >signal_cmd <<EOS
21018 if $test -s signal.lst; then
21019 echo "Using your existing signal.lst file"
21024 $cat >>signal_cmd <<'EOS'
21027 if eval $compile_ok; then
21028 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) |\
21029 $uniq | $awk -f signal.awk >signal.lst
21031 echo "(I can't seem be able to compile the whole test program)" >&4
21032 echo "(I'll try it in little pieces.)" >&4
21033 set signal -DJUST_NSIG
21034 if eval $compile_ok; then
21035 $run ./signal$_exe > signal.nsg
21038 echo "I can't seem to figure out how many signals you have." >&4
21039 echo "Guessing 50." >&4
21040 echo 'NSIG 50' > signal.nsg
21042 : Now look at all the signal names, one at a time.
21043 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
21044 $cat > signal.c <<EOCP
21045 #include <sys/types.h>
21046 #include <signal.h>
21049 printf("$xx %d\n", SIG${xx});
21054 if eval $compile; then
21055 echo "SIG${xx} found."
21056 $run ./signal$_exe >> signal.ls1
21058 echo "SIG${xx} NOT found."
21061 if $test -s signal.ls1; then
21062 $cat signal.nsg signal.ls1 |
21063 $sort -n | $uniq | $awk -f signal.awk >signal.lst
21067 if $test -s signal.lst; then
21070 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
21071 echo 'kill -l' >signal
21072 set X `csh -f <signal`
21076 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
21078 echo $@ | $tr ' ' $trnl | \
21079 $awk '{ printf "%s %d\n", $1, ++s; }
21080 END { printf "NSIG %d\n", ++s }' >signal.lst
21082 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
21084 chmod a+x signal_cmd
21085 $eunicefix signal_cmd
21087 : generate list of signal names
21089 case "$sig_name_init" in
21091 *) case "$sig_num_init" in
21092 ''|*,*) doinit=yes ;;
21097 echo "Generating a list of signal names and numbers..." >&4
21099 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
21100 sig_name=`$awk 'BEGIN { printf "ZERO " }
21101 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
21102 sig_num=`$awk 'BEGIN { printf "0 " }
21103 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
21104 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
21105 !/^NSIG/ { printf "\"%s\", ", $1 }
21106 END { printf "0\n" }' signal.lst`
21107 sig_num_init=`$awk 'BEGIN { printf "0, " }
21108 !/^NSIG/ { printf "%d, ", $2}
21109 END { printf "0\n"}' signal.lst`
21112 echo "The following $sig_count signals are available:"
21114 echo $sig_name | $awk \
21115 'BEGIN { linelen = 0 }
21117 for (i = 1; i <= NF; i++) {
21118 name = "SIG" $i " "
21119 linelen = linelen + length(name)
21120 if (linelen > 70) {
21122 linelen = length(name)
21128 sig_size=`echo $sig_name | awk '{print NF}'`
21129 $rm -f signal signal.c signal.awk signal.lst signal_cmd
21131 : Check size of size
21133 case "$sizetype" in
21134 *_t) zzz="$sizetype" ;;
21135 *) zzz="filesize" ;;
21137 echo "Checking the size of $zzz..." >&4
21139 #include <sys/types.h>
21141 #$i_stdlib I_STDLIB
21143 #include <stdlib.h>
21146 printf("%d\n", (int)sizeof($sizetype));
21151 if eval $compile_ok; then
21155 echo "(I can't execute the test program--guessing $sizesize.)" >&4
21158 echo "Your $zzz size is $sizesize bytes."
21163 echo "(I can't compile the test program--guessing $sizesize.)" >&4
21167 : check for socklen_t
21169 echo "Checking to see if you have socklen_t..." >&4
21171 #include <sys/types.h>
21172 #$d_socket HAS_SOCKET
21174 #include <sys/socket.h>
21176 int main() { socklen_t x = 16; }
21179 if eval $compile; then
21181 echo "You have socklen_t."
21184 echo "You do not have socklen_t."
21185 case "$sizetype" in
21186 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
21193 : see if this is a socks.h system
21194 set socks.h i_socks
21197 : check for type of the size argument to socket calls
21198 case "$d_socket" in
21202 Checking to see what type is the last argument of accept().
21205 case "$d_socklen_t" in
21206 "$define") yyy="$yyy socklen_t"
21208 yyy="$yyy $sizetype int long unsigned"
21209 for xxx in $yyy; do
21210 case "$socksizetype" in
21211 '') try="$extern_C int accept(int, struct sockaddr *, $xxx *);"
21212 case "$usesocks" in
21214 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
21215 echo "Your system accepts '$xxx *' for the last argument of accept()."
21216 socksizetype="$xxx"
21219 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
21220 echo "Your system accepts '$xxx *' for the last argument of accept()."
21221 socksizetype="$xxx"
21228 : In case none of those worked, prompt the user.
21229 case "$socksizetype" in
21230 '') rp='What is the type for socket address structure sizes?'
21237 *) : no sockets, so pick relatively harmless default
21242 : see what type is used for signed size_t
21243 set ssize_t ssizetype int stdio.h sys/types.h
21248 #$i_stdlib I_STDLIB
21250 #include <stdlib.h>
21252 #include <sys/types.h>
21253 #define Size_t $sizetype
21254 #define SSize_t $dflt
21257 if (sizeof(Size_t) == sizeof(SSize_t))
21259 else if (sizeof(Size_t) == sizeof(int))
21268 if eval $compile_ok && $run ./try > /dev/null; then
21269 ssizetype=`$run ./try`
21270 echo "I'll be using $ssizetype for functions returning a byte count." >&4
21273 Help! I can't compile and run the ssize_t test program: please enlighten me!
21274 (This is probably a misconfiguration in your system or libraries, and
21275 you really ought to fix it. Still, I'll try anyway.)
21277 I need a type that is the same size as $sizetype, but is guaranteed to
21278 be signed. Common values are ssize_t, int and long.
21281 rp="What signed type is the same size as $sizetype?"
21287 : Check the size of st_ino
21289 $echo "Checking the size of st_ino..." >&4
21290 $cat > try.c <<EOCP
21291 #include <sys/stat.h>
21293 #$i_stdlib I_STDLIB
21295 #include <stdlib.h>
21299 printf("%d\n", (int)sizeof(st.st_ino));
21304 if eval $compile_ok; then
21308 $echo "(I can't execute the test program--guessing $st_ino_size.)" >&4
21310 *) st_ino_size=$val
21311 $echo "Your st_ino is $st_ino_size bytes long."
21316 $echo "(I can't compile the test program--guessing $st_ino_size.)" >&4
21320 : Check if st_ino is signed
21322 $echo "Checking the sign of st_ino..." >&4
21323 $cat > try.c <<EOCP
21324 #include <sys/stat.h>
21329 if (foo.st_ino < 0)
21336 if eval $compile; then
21340 $echo "(I can't execute the test program--guessing unsigned.)" >&4
21342 *) st_ino_sign=$val
21343 case "$st_ino_sign" in
21344 1) $echo "Your st_ino is unsigned." ;;
21345 -1) $echo "Your st_ino is signed." ;;
21351 $echo "(I can't compile the test program--guessing unsigned.)" >&4
21355 : see what type of char stdio uses.
21357 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
21358 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
21359 echo "Your stdio uses unsigned chars." >&4
21360 stdchar="unsigned char"
21362 echo "Your stdio uses signed chars." >&4
21367 : see what type uids are declared as in the kernel
21369 echo "Looking for the type for user ids returned by getuid()."
21370 set uid_t uidtype xxx stdio.h sys/types.h
21374 xxx=`./findhdr sys/user.h`
21375 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
21377 unsigned) dflt="$1 $2" ;;
21381 *) dflt="$uidtype";;
21384 uid_t) echo "uid_t found." ;;
21385 *) rp="What is the type for user ids returned by getuid()?"
21391 : Check size of UID
21394 *_t) zzz="$uidtype" ;;
21397 echo "Checking the size of $zzz..." >&4
21399 #include <sys/types.h>
21401 #$i_stdlib I_STDLIB
21403 #include <stdlib.h>
21406 printf("%d\n", (int)sizeof($uidtype));
21411 if eval $compile_ok; then
21415 echo "(I can't execute the test program--guessing $uidsize.)" >&4
21418 echo "Your $zzz is $uidsize bytes long."
21423 echo "(I can't compile the test program--guessing $uidsize.)" >&4
21426 : Check if UID is signed
21429 *_t) zzz="$uidtype" ;;
21432 echo "Checking the sign of $zzz..." >&4
21434 #include <sys/types.h>
21445 if eval $compile; then
21449 echo "(I can't execute the test program--guessing unsigned.)" >&4
21453 1) echo "Your $zzz is unsigned." ;;
21454 -1) echo "Your $zzz is signed." ;;
21460 echo "(I can't compile the test program--guessing unsigned.)" >&4
21464 : Check format string for UID
21466 $echo "Checking the format string to be used for uids..." >&4
21469 -1) if $test X"$uidsize" = X"$ivsize"; then
21470 uidformat="$ivdformat"
21472 if $test X"$uidsize" = X"$longsize"; then
21475 if $test X"$uidsize" = X"$intsize"; then
21478 if $test X"$uidsize" = X"$shortsize"; then
21485 *) if $test X"$uidsize" = X"$uvsize"; then
21486 uidformat="$uvuformat"
21488 if $test X"$uidsize" = X"$longsize"; then
21491 if $test X"$uidsize" = X"$intsize"; then
21494 if $test X"$uidsize" = X"$shortsize"; then
21503 : Determine if we can use sysctl with KERN_PROC_PATHNAME to find executing program
21505 echo "Determining whether we can use sysctl with KERN_PROC_PATHNAME to find executing program..." >&4
21506 $cat >try.c <<'EOM'
21507 /* Intentionally a long probe as I'd like to sanity check that the exact
21508 approach is going to work, as thinking it will work, but only having it
21509 part working at runtime is worse than not having it. */
21511 #include <sys/types.h>
21512 #include <sys/sysctl.h>
21513 #include <sys/param.h>
21515 #include <string.h>
21516 #include <stdlib.h>
21517 #include <unistd.h>
21520 main(int argc, char **argv) {
21522 char *argv_leaf = strrchr(argv[0], '/');
21528 mib[1] = KERN_PROC;
21529 mib[2] = KERN_PROC_PATHNAME;
21533 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
21537 if (sysctl(mib, 4, NULL, &size, NULL, 0)) {
21542 if (size < strlen(argv_leaf) + 1) {
21543 fprintf(stderr, "size %lu is too short for a path\n",
21544 (unsigned long) size);
21548 if (size > MAXPATHLEN * MAXPATHLEN) {
21549 fprintf(stderr, "size %lu is too long for a path\n",
21550 (unsigned long) size);
21554 buffer = malloc(size);
21560 if (sysctl(mib, 4, buffer, &size, NULL, 0)) {
21565 if (strlen(buffer) + 1 != size) {
21566 fprintf(stderr, "size != strlen(buffer) + 1 (%lu != %lu)\n",
21567 (unsigned long)size, (unsigned long)strlen(buffer) + 1);
21572 if (*buffer != '/') {
21573 fprintf(stderr, "Not an absolute path: '%s'\n", buffer);
21577 if (strstr(buffer, "/./")) {
21578 fprintf(stderr, "Contains /./: '%s'\n", buffer);
21582 if (strstr(buffer, "/../")) {
21583 fprintf(stderr, "Contains /../: '%s'\n", buffer);
21587 buffer_leaf = strrchr(buffer, '/');
21588 if (strcmp(buffer_leaf, argv_leaf) != 0) {
21589 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], buffer);
21601 if eval $compile; then
21602 if $run ./try; then
21603 echo "You can use sysctl with KERN_PROC_PATHNAME to find the executing program." >&4
21606 echo "Nope, sysctl with KERN_PROC_PATHNAME doesn't work here." >&4
21610 echo "I'm unable to compile the test program." >&4
21611 echo "I'll assume no sysctl with KERN_PROC_PATHNAME here." >&4
21615 set usekernprocpathname
21618 : Determine if we can use _NSGetExecutablePath to find executing program
21620 echo "Determining whether we can use _NSGetExecutablePath to find executing program..." >&4
21621 $cat >try.c <<'EOM'
21622 /* Intentionally a long probe as I'd like to sanity check that the exact
21623 approach is going to work, as thinking it will work, but only having it
21624 part working at runtime is worse than not having it. */
21625 #include <mach-o/dyld.h>
21627 #include <stdlib.h>
21628 #include <sys/param.h>
21629 #include <string.h>
21632 main(int argc, char **argv) {
21634 uint32_t size = sizeof(buf);
21638 char *argv_leaf = strrchr(argv[0], '/');
21642 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
21646 _NSGetExecutablePath(buf, &size);
21647 if (size > MAXPATHLEN * MAXPATHLEN) {
21648 fprintf(stderr, "_NSGetExecutablePath size %u is too long for a path\n",
21649 (unsigned int) size);
21653 buffer = malloc(size);
21659 result = _NSGetExecutablePath(buffer, &size);
21661 fprintf(stderr, "_NSGetExecutablePath returned %i for a size of %u\n",
21662 result, (unsigned int) size);
21666 tidied = realpath(buffer, NULL);
21668 perror("realpath");
21674 if (*tidied != '/') {
21675 fprintf(stderr, "Not an absolute path: '%s'\n", tidied);
21679 if (strstr(tidied, "/./")) {
21680 fprintf(stderr, "Contains /./: '%s'\n", tidied);
21684 if (strstr(tidied, "/../")) {
21685 fprintf(stderr, "Contains /../: '%s'\n", tidied);
21689 tidied_leaf = strrchr(tidied, '/');
21690 if (strcmp(tidied_leaf, argv_leaf) != 0) {
21691 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], tidied);
21703 if eval $compile; then
21704 if $run ./try; then
21705 echo "You can use _NSGetExecutablePath to find the executing program." >&4
21708 echo "Nope, _NSGetExecutablePath doesn't work here." >&4
21711 echo "I'm unable to compile the test program." >&4
21712 echo "I'll assume no _NSGetExecutablePath here." >&4
21715 set usensgetexecutablepath
21718 : Check if site customization support was requested
21719 case "$usesitecustomize" in
21720 $define|true|[Yy]*)
21721 usesitecustomize="$define"
21724 usesitecustomize="$undef"
21728 : see if prototypes support variable argument declarations
21730 case "$prototype$i_stdarg" in
21732 echo "It appears we'll be able to prototype varargs functions." >&4
21736 echo "Too bad... We won't be using prototyped varargs functions..." >&4
21743 : determine compiler compiler
21752 if $test -f "$byacc$_exe"; then
21754 comp="byacc or $comp"
21756 if $test -f "$bison$_exe"; then
21757 comp="$comp or bison -y"
21759 rp="Which compiler compiler ($comp) shall I use?"
21768 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
21774 : see if this is a assert.h system
21775 set assert.h i_assert
21778 : see if this is a fp.h system
21782 : see if this is a fp_class.h system
21783 set fp_class.h i_fp_class
21786 : see if gdbm.h is available
21791 : see if gdbm_open exists
21792 set gdbm_open d_gdbm_open
21794 case "$d_gdbm_open" in
21797 echo "We won't be including <gdbm.h>"
21806 : see if this is a ieeefp.h system
21807 case "$i_ieeefp" in
21808 '' ) set ieeefp.h i_ieeefp
21813 : see if this is a libutil.h system
21814 set libutil.h i_libutil
21817 : see if mach cthreads are available
21818 if test "X$usethreads" = "X$define"; then
21819 set mach/cthreads.h i_machcthr
21822 i_machcthr="$undef"
21825 : see if this is a mntent.h system
21826 set mntent.h i_mntent
21829 : see if net/errno.h is available
21831 set net/errno.h val
21834 : Unfortunately, it causes problems on some systems. Arrgh.
21837 cat > try.c <<'EOM'
21840 #include <net/errno.h>
21846 if $cc $ccflags -c try.c >/dev/null 2>&1; then
21847 echo "We'll be including <net/errno.h>." >&4
21849 echo "We won't be including <net/errno.h>." >&4
21858 : see if netinet/tcp.h is available
21859 set netinet/tcp.h i_netinettcp
21862 : see if this is a poll.h system
21866 : see if this is a prot.h system
21870 : Preprocessor symbols
21872 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
21873 $cat <<'EOSH' > Cppsym.know
21874 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
21875 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
21876 alliant alpha am29000 AM29000 AMD64 amd64 amiga AMIGAOS AMIX
21877 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
21878 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
21879 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
21880 bull c cadmus clipper CMU COFF COMPILER_VERSION
21881 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
21882 CYGWIN DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
21883 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
21884 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
21886 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
21887 H3050R H3050RX hbullx20 hcx host_mips
21888 hp200 hp300 hp700 HP700 hp800 hp9000
21889 hp9000s200 hp9000s300 hp9000s400 hp9000s500
21890 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
21891 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
21892 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
21893 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
21894 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
21895 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
21896 LIBCATAMOUNT Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
21897 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
21898 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
21899 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
21900 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
21901 MATH_HAS_NO_SIDE_EFFECTS
21902 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
21903 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
21904 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
21905 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
21906 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
21907 NetBSD news1500 news1700 news1800 news1900 news3700
21908 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
21909 ns32016 ns32332 ns32k nsc32000
21910 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
21911 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
21912 pc532 pdp11 PGC PIC plexus PORTAR posix
21913 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
21914 POSIX_C_SOURCE POSIX_SOURCE POWER
21915 PROTOTYPES PWB pyr QNX QK_USER R3000 REENTRANT RES Rhapsody RISC6000
21916 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
21917 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
21918 sony sony_news sonyrisc sparc sparclite spectrum
21919 stardent stdc STDC_EXT stratos sun sun3 sun386
21920 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
21921 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
21922 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
21923 sysV68 sysV88 Tek4132 Tek4300 titan
21924 TM3200 TM5400 TM5600
21925 tower tower32 tower32_200 tower32_600 tower32_700
21926 tower32_800 tower32_850 tss
21927 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
21928 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
21929 unix UNIX95 UNIX99 unixpc unos
21930 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
21931 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
21932 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
21934 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms x86_64 xenix Xenix286
21935 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
21936 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
21939 # Maybe put other stuff here too.
21940 cat <<EOSH >>Cppsym.know
21943 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
21944 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
21945 $cat Cppsym.know > Cppsym.c
21946 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
21947 $rm -f Cppsym.a Cppsym.b Cppsym.c
21948 cat <<EOSH > Cppsym
21950 if $test \$# -gt 0; then
21951 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
21952 if $test -s Cppsym.got; then
21959 $tr " " "$trnl" | ./Cppsym.try
21965 cat <<EOSH > Cppsym.try
21967 cat <<'EOCP' > try.c
21970 #define STRINGIFY(a) "a"
21972 #if cpp_stuff == 42
21973 #define StGiFy(a) #a
21974 #define STRINGIFY(a) StGiFy(a)
21976 #if $cpp_stuff != 1 && $cpp_stuff != 42
21977 # include "Bletch: How does this C preprocessor stringify macros?"
21983 cat <<'EOSH' >> Cppsym.try
21985 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
21986 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
21987 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
21988 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
21990 echo 'return 0;}' >> try.c
21992 cat <<EOSH >> Cppsym.try
21994 case "$osname-$gccversion" in
21995 irix-) ccflags="\$ccflags -woff 1178" ;;
21996 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
21998 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
22000 chmod +x Cppsym.try
22001 $eunicefix Cppsym.try
22002 ./Cppsym < Cppsym.know | $sort | $uniq > Cppsym.true
22003 : Add in any linux cpp "predefined macros":
22004 case "$osname::$gccversion" in
22005 *linux*::*.*|*gnukfreebsd*::*.*|gnu::*.*)
22007 rm -f $tHdrH'.h' $tHdrH
22009 # Filter out macro arguments, such as Linux's __INT8_C(c)
22010 if $cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
22011 sed -e 's/#define[\ \ ]*//;s/[\ \ ].*$//' -e 's/(.*//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
22012 if [ -s $tHdrH'_cppsym.real' ]; then
22013 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
22016 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
22019 : now check the C compiler for additional symbols
22020 postprocess_cc_v=''
22022 aix) postprocess_cc_v="|$tr , ' '" ;;
22029 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
22032 -D*) echo "\$i" | $sed 's/^-D//';;
22033 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
22038 postprocess_cc_v=''
22041 ./ccsym > ccsym1.raw
22042 if $test -s ccsym1.raw; then
22043 $sort ccsym1.raw | $uniq >ccsym.raw
22045 mv ccsym1.raw ccsym.raw
22048 $awk '/\=/ { print $0; next }
22049 { print $0"=1" }' ccsym.raw >ccsym.list
22050 $comm -13 Cppsym.true ccsym.list >ccsym.own
22051 $comm -12 Cppsym.true ccsym.list >ccsym.com
22052 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
22054 if $test -z ccsym.raw; then
22055 echo "Your C compiler doesn't seem to define any symbols!" >&4
22057 echo "However, your C preprocessor defines the following symbols:"
22060 cppsymbols=`$cat Cppsym.true`
22061 cppsymbols=`echo $cppsymbols`
22062 cppccsymbols="$cppsymbols"
22064 if $test -s ccsym.com; then
22065 echo "Your C compiler and pre-processor define these symbols:"
22066 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
22069 cppccsymbols=`$cat ccsym.com`
22070 cppccsymbols=`echo $cppccsymbols`
22071 $test "$silent" || sleep 1
22073 if $test -s ccsym.cpp; then
22074 $test "$also" && echo " "
22075 echo "Your C pre-processor ${also}defines the following symbols:"
22076 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
22078 cppsymbols=`$cat ccsym.cpp`
22079 cppsymbols=`echo $cppsymbols`
22080 $test "$silent" || sleep 1
22082 if $test -s ccsym.own; then
22083 $test "$also" && echo " "
22084 echo "Your C compiler ${also}defines the following cpp symbols:"
22085 $sed -e 's/\(..*\)=1/\1/' ccsym.own
22086 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
22087 ccsymbols=`$cat ccsym.own`
22088 ccsymbols=`echo $ccsymbols`
22089 $test "$silent" || sleep 1
22093 : see if this is a termio system
22097 if $test `./findhdr termios.h`; then
22098 set tcsetattr i_termios
22104 "$define") echo "You have POSIX termios.h... good!" >&4;;
22105 *) if ./Cppsym pyr; then
22106 case "`/bin/universe`" in
22107 ucb) if $test `./findhdr sgtty.h`; then
22109 echo "<sgtty.h> found." >&4
22111 echo "System is pyramid with BSD universe."
22112 ./warn "<sgtty.h> not found--you could have problems."
22114 *) if $test `./findhdr termio.h`; then
22116 echo "<termio.h> found." >&4
22118 echo "System is pyramid with USG universe."
22119 ./warn "<termio.h> not found--you could have problems."
22123 if $test `./findhdr termio.h`; then
22124 echo "<termio.h> found." >&4
22126 elif $test `./findhdr sgtty.h`; then
22127 echo "<sgtty.h> found." >&4
22130 ./warn "Neither <termio.h> nor <sgtty.h> found--cross fingers!"
22133 if $test `./findhdr sgtty.h`; then
22134 echo "<sgtty.h> found." >&4
22136 elif $test `./findhdr termio.h`; then
22137 echo "<termio.h> found." >&4
22140 ./warn "Neither <sgtty.h> nor <termio.h> found--cross fingers!"
22144 set i_termio; eval $setvar
22145 val=$val2; set i_sgtty; eval $setvar
22146 val=$val3; set i_termios; eval $setvar
22148 : see if stdbool is available
22149 : we want a real compile instead of Inhdr because some Solaris systems
22150 : have stdbool.h, but it can only be used if the compiler indicates it
22151 : is sufficiently c99-compliant.
22155 #include <stdbool.h>
22160 int main(int argc, char **argv)
22166 if eval $compile; then
22167 echo "<stdbool.h> found." >&4
22170 echo "<stdbool.h> NOT found." >&4
22177 : see if stddef is available
22178 set stddef.h i_stddef
22181 : see if sys/access.h is available
22182 set sys/access.h i_sysaccess
22185 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
22186 set sys/filio.h i_sysfilio
22189 if $test `./findhdr sys/ioctl.h`; then
22191 echo '<sys/ioctl.h> found.' >&4
22194 if $test $i_sysfilio = "$define"; then
22195 echo '<sys/ioctl.h> NOT found.' >&4
22197 $test $i_sgtty = "$define" && xxx="sgtty.h"
22198 $test $i_termio = "$define" && xxx="termio.h"
22199 $test $i_termios = "$define" && xxx="termios.h"
22200 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
22206 : see if socket ioctl defs are in sys/sockio.h
22208 xxx=`./findhdr sys/sockio.h`
22209 if $test "$xxx"; then
22210 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
22212 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
22215 echo "No socket ioctls found in <sys/sockio.h>." >&4
22220 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
22226 : see if this is a syslog.h system
22227 set syslog.h i_syslog
22230 : see if this is a sys/mode.h system
22231 set sys/mode.h i_sysmode
22234 : see if there is a sys/poll.h file
22235 set sys/poll.h i_syspoll
22238 : see if sys/resource.h has to be included
22239 set sys/resource.h i_sysresrc
22242 : see if sys/security.h is available
22243 set sys/security.h i_syssecrt
22246 : see if this is a sys/statvfs.h system
22247 set sys/statvfs.h i_sysstatvfs
22250 : see if this is a sys/un.h system
22251 set sys/un.h i_sysun
22254 : see if this is a sys/utsname.h system
22255 set sys/utsname.h i_sysutsname
22258 : see if this is a syswait system
22259 set sys/wait.h i_syswait
22262 : see if this is a ustat.h system
22263 set ustat.h i_ustat
22266 : see if this is an utime system
22267 set utime.h i_utime
22270 : see if this is a vfork system
22273 set vfork.h i_vfork
22283 echo "Looking for extensions..." >&4
22284 : If we are using the old config.sh, known_extensions may contain
22285 : old or inaccurate or duplicate values.
22286 known_extensions=''
22287 nonxs_extensions=''
22288 : We do not use find because it might not be available.
22289 : We do not just use MANIFEST because the user may have dropped
22290 : some additional extensions into the source tree and expect them
22293 : Function to recursively find available extensions, ignoring DynaLoader
22294 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
22295 : In 5.10.1 and later, extensions are stored in directories
22296 : like File-Glob instead of the older File/Glob/.
22300 DynaLoader|dynaload) ;;
22302 this_ext=`echo $xxx | $sed -e s/-/\\\//g`;
22303 leaf=`echo $xxx | $sed -e s/.*-//`;
22304 if $test -d File; then
22305 if $test -f $xxx/$leaf.xs -o -f $xxx/$leaf.c; then
22306 known_extensions="$known_extensions $1$this_ext";
22307 elif $test -f $xxx/Makefile.PL; then
22308 nonxs_extensions="$nonxs_extensions $1$this_ext";
22310 if $test -d $xxx -a $# -lt 10; then
22313 eval $find_extensions;
22319 echo " $known_extensions $nonxs_extensions" > $$.tmp;
22320 if $contains " $this_ext " $$.tmp; then
22322 echo "Duplicate directories detected for extension $xxx" >&4;
22323 echo "Configure cannot correctly recover from this - shall I abort?" >&4;
22324 case "$knowitall" in
22332 echo "Ok. Stopping Configure." >&4;
22333 echo "Please remove the duplicate directory (eg using git clean) and then re-run Configure" >&4;
22336 echo "Ok. You will need to correct config.sh before running make." >&4;
22338 $ls -1 $xxx > $$.tmp;
22339 if $contains "\.xs$" $$.tmp > /dev/null 2>&1; then
22340 known_extensions="$known_extensions $this_ext";
22341 elif $contains "\.c$" $$.tmp > /dev/null 2>&1; then
22342 known_extensions="$known_extensions $this_ext";
22343 elif $test -d $xxx; then
22344 nonxs_extensions="$nonxs_extensions $this_ext";
22355 eval $find_extensions
22359 eval $find_extensions
22363 eval $find_extensions
22364 if $test -d File-Glob; then
22365 : All ext/ flattened
22367 # Special case: Add in modules that nest beyond the first level.
22368 # Currently threads/shared and Hash/Util/FieldHash, since they are
22369 # not picked up by the recursive find above (and adding in general
22370 # recursive finding breaks SDBM_File/sdbm).
22371 # A.D. 20011025 (SDBM), ajgough 20071008 (FieldHash)
22372 known_extensions="$known_extensions threads/shared Hash/Util/FieldHash"
22374 set X $known_extensions
22376 known_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
22377 set X $nonxs_extensions
22379 nonxs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
22382 : Now see which are supported on this system.
22384 for xxx in $known_extensions ; do
22388 $define) avail_ext="$avail_ext $xxx" ;;
22391 GDBM_File|gdbm_fil)
22393 $define) avail_ext="$avail_ext $xxx" ;;
22396 I18N/Langinfo|i18n_lan)
22397 case "$i_langinfo$d_nl_langinfo" in
22398 $define$define) avail_ext="$avail_ext $xxx" ;;
22402 : XXX Do we need a useipcsysv variable here
22403 case "${d_msg}${d_sem}${d_shm}" in
22404 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
22407 NDBM_File|ndbm_fil)
22410 case "$osname-$use64bitint" in
22413 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
22416 *) avail_ext="$avail_ext $xxx" ;;
22421 ODBM_File|odbm_fil)
22422 case "${i_dbm}${i_rpcsvcdbm}" in
22424 case "$d_cplusplus" in
22425 define) ;; # delete as a function name will not work
22426 *) case "$osname-$use64bitint" in
22429 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
22432 *) avail_ext="$avail_ext $xxx" ;;
22440 case "$useopcode" in
22441 true|define|y) avail_ext="$avail_ext $xxx" ;;
22445 case "$useposix" in
22446 true|define|y) avail_ext="$avail_ext $xxx" ;;
22450 case "$d_socket" in
22451 true|$define|y) avail_ext="$avail_ext $xxx" ;;
22454 Sys/Syslog|sys/syslog)
22455 : XXX syslog requires socket
22456 case "$d_socket" in
22457 true|$define|y) avail_ext="$avail_ext $xxx" ;;
22461 case "$usethreads" in
22463 case "$use5005threads" in
22464 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
22468 threads|threads/shared)
22469 # threads and threads::shared are special cases.
22470 # To stop people from asking "Perl 5.8.0 was supposed
22471 # to have this new fancy threads implementation but my
22472 # perl doesn't have it" and from people trying to
22473 # (re)install the threads module using CPAN.pm and
22474 # CPAN.pm then offering to reinstall Perl 5.8.0,
22475 # the threads.pm and threads/shared.pm will always be
22476 # there, croaking informatively ("you need to rebuild
22477 # all of Perl with threads, sorry") when threads haven't
22478 # been compiled in.
22480 avail_ext="$avail_ext $xxx"
22486 cygwin) avail_ext="$avail_ext $xxx" ;;
22489 XS/APItest|xs/apitest)
22490 # This is just for testing. Skip it unless we have dynamic loading.
22493 $define) avail_ext="$avail_ext $xxx" ;;
22496 XS/Typemap|xs/typemap)
22497 # This is just for testing. Skip it unless we have dynamic loading.
22499 $define) avail_ext="$avail_ext $xxx" ;;
22502 *) avail_ext="$avail_ext $xxx"
22511 case "$onlyextensions" in
22513 *) keepextensions=''
22514 echo "You have requested that only certain extensions be included..." >&4
22515 for i in $onlyextensions; do
22516 case " $avail_ext " in
22518 echo "Keeping extension $i."
22519 keepextensions="$keepextensions $i"
22521 *) echo "Ignoring extension $i." ;;
22524 avail_ext="$keepextensions"
22528 case "$noextensions" in
22530 *) keepextensions=''
22531 echo "You have requested that certain extensions be ignored..." >&4
22532 for i in $avail_ext; do
22533 case " $noextensions " in
22534 *" $i "*) echo "Ignoring extension $i." ;;
22535 *) echo "Keeping extension $i.";
22536 keepextensions="$keepextensions $i"
22540 avail_ext="$keepextensions"
22544 : Now see which nonxs extensions are supported on this system.
22545 : For now assume all are.
22547 for xxx in $nonxs_extensions ; do
22549 *) nonxs_ext="$nonxs_ext $xxx"
22561 A number of extensions are supplied with $package. You may choose to
22562 compile these extensions for dynamic loading (the default), compile
22563 them into the $package executable (static loading), or not include
22564 them at all. Answer "none" to include no extensions.
22565 Note that DynaLoader is always built and need not be mentioned here.
22568 case "$dynamic_ext" in
22570 : Exclude those listed in static_ext
22572 for xxx in $avail_ext; do
22573 case " $static_ext " in
22575 *) dflt="$dflt $xxx" ;;
22582 *) dflt="$dynamic_ext"
22583 # Perhaps we are reusing an old out-of-date config.sh.
22586 if test X"$dynamic_ext" != X"$avail_ext"; then
22588 NOTICE: Your previous config.sh list may be incorrect.
22589 The extensions now available to you are
22591 but the default list from your previous config.sh is
22603 rp="What extensions do you wish to load dynamically?"
22606 none) dynamic_ext=' ' ;;
22607 *) dynamic_ext="$ans" ;;
22610 case "$static_ext" in
22612 : Exclude those already listed in dynamic linking
22614 for xxx in $avail_ext; do
22615 case " $dynamic_ext " in
22617 *) dflt="$dflt $xxx" ;;
22624 *) dflt="$static_ext"
22631 rp="What extensions do you wish to load statically?"
22634 none) static_ext=' ' ;;
22635 *) static_ext="$ans" ;;
22640 A number of extensions are supplied with $package. Answer "none"
22641 to include no extensions.
22642 Note that DynaLoader is always built and need not be mentioned here.
22645 case "$static_ext" in
22646 '') dflt="$avail_ext" ;;
22647 *) dflt="$static_ext"
22648 # Perhaps we are reusing an old out-of-date config.sh.
22651 if test X"$static_ext" != X"$avail_ext"; then
22653 NOTICE: Your previous config.sh list may be incorrect.
22654 The extensions now available to you are
22656 but the default list from your previous config.sh is
22665 : Exclude those that are not xs extensions
22669 rp="What extensions do you wish to include?"
22672 none) static_ext=' ' ;;
22673 *) static_ext="$ans" ;;
22678 # Encode is a special case. If we are building Encode as a static
22679 # extension, we need to explicitly list its subextensions as well.
22680 # For other nested extensions, this is handled automatically by
22681 # the appropriate Makefile.PL.
22682 case " $static_ext " in
22683 *" Encode "*) # Add the subextensions of Encode
22685 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
22686 static_ext="$static_ext Encode/$xxx"
22692 set X $dynamic_ext $static_ext $nonxs_ext
22696 # Sanity check: We require an extension suitable for use with
22697 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
22698 # should show up as failures in the test suite, but it's helpful to
22699 # catch them now.) The 'extensions' list is normally sorted
22700 # alphabetically, so we need to accept either
22701 # DB_File ... Fcntl ... IO ....
22702 # or something like
22703 # Fcntl ... NDBM_File ... IO ....
22704 case " $extensions" in
22705 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
22706 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
22707 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
22708 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
22709 echo "WARNING: The Perl you are building will be quite crippled." >& 4
22713 : Remove libraries needed only for extensions
22714 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
22715 : The exception is SunOS 4.x, which needs them.
22716 case "${osname}X${osvers}" in
22720 *) case "$usedl" in
22721 $define|true|[yY]*)
22722 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
22726 *) perllibs="$libs"
22732 : Remove build directory name from cppstdin so it can be used from
22733 : either the present location or the final installed location.
22735 : Get out of the UU directory to get correct path name.
22737 case "$cppstdin" in
22739 echo "Stripping down cppstdin path name"
22745 : end of configuration questions
22747 echo "End of configuration questions."
22750 : back to where it started
22751 if test -d ../UU; then
22755 : configuration may be unconditionally patched via a 'config.arch' file
22756 if $test -f config.arch; then
22757 echo "I see a config.arch file, loading it." >&4
22761 : configuration may be patched via a 'config.over' file
22762 if $test -f config.over; then
22765 rp='I see a config.over file. Do you wish to load it?'
22768 n*) echo "OK, I'll ignore it.";;
22770 echo "Configuration override changes have been loaded."
22775 : in case they want portability, strip down executable paths
22776 case "$d_portable" in
22779 echo "Stripping down executable paths..." >&4
22780 for file in $loclist $trylist; do
22782 eval $file=`basename $temp`
22787 : create config.sh file
22789 echo "Creating config.sh..." >&4
22790 $spitshell <<EOT >config.sh
22793 # This file was produced by running the Configure script. It holds all the
22794 # definitions figured out by Configure. Should you modify one of these values,
22795 # do not forget to propagate your changes by running "Configure -der". You may
22796 # instead choose to run each of the .SH files by yourself, or "Configure -S".
22799 # Package name : $package
22800 # Source directory : $src
22801 # Configuration time: $cf_time
22802 # Configured by : $cf_by
22803 # Target system : $myuname
22806 : Add in command line options if available
22807 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
22809 $spitshell <<EOT >>config.sh
22818 Revision='$Revision'
22826 alignbytes='$alignbytes'
22827 ansi2knr='$ansi2knr'
22828 aphostname='$aphostname'
22829 api_revision='$api_revision'
22830 api_subversion='$api_subversion'
22831 api_version='$api_version'
22832 api_versionstring='$api_versionstring'
22835 archlibexp='$archlibexp'
22836 archname64='$archname64'
22837 archname='$archname'
22838 archobjs='$archobjs'
22839 asctime_r_proto='$asctime_r_proto'
22848 byteorder='$byteorder'
22850 castflags='$castflags'
22853 cccdlflags='$cccdlflags'
22854 ccdlflags='$ccdlflags'
22856 ccflags_uselargefiles='$ccflags_uselargefiles'
22858 ccsymbols='$ccsymbols'
22859 ccversion='$ccversion'
22861 cf_email='$cf_email'
22863 charbits='$charbits'
22864 charsize='$charsize'
22868 clocktype='$clocktype'
22870 compress='$compress'
22871 contains='$contains'
22875 cpp_stuff='$cpp_stuff'
22876 cppccsymbols='$cppccsymbols'
22877 cppflags='$cppflags'
22879 cppminus='$cppminus'
22881 cppstdin='$cppstdin'
22882 cppsymbols='$cppsymbols'
22883 crypt_r_proto='$crypt_r_proto'
22884 cryptlib='$cryptlib'
22886 ctermid_r_proto='$ctermid_r_proto'
22887 ctime_r_proto='$ctime_r_proto'
22888 d_Gconvert='$d_Gconvert'
22889 d_PRIEUldbl='$d_PRIEUldbl'
22890 d_PRIFUldbl='$d_PRIFUldbl'
22891 d_PRIGUldbl='$d_PRIGUldbl'
22892 d_PRIXU64='$d_PRIXU64'
22893 d_PRId64='$d_PRId64'
22894 d_PRIeldbl='$d_PRIeldbl'
22895 d_PRIfldbl='$d_PRIfldbl'
22896 d_PRIgldbl='$d_PRIgldbl'
22897 d_PRIi64='$d_PRIi64'
22898 d_PRIo64='$d_PRIo64'
22899 d_PRIu64='$d_PRIu64'
22900 d_PRIx64='$d_PRIx64'
22901 d_SCNfldbl='$d_SCNfldbl'
22902 d__fwalk='$d__fwalk'
22903 d_access='$d_access'
22904 d_accessx='$d_accessx'
22907 d_archlib='$d_archlib'
22908 d_asctime64='$d_asctime64'
22909 d_asctime_r='$d_asctime_r'
22912 d_attribute_deprecated='$d_attribute_deprecated'
22913 d_attribute_format='$d_attribute_format'
22914 d_attribute_malloc='$d_attribute_malloc'
22915 d_attribute_nonnull='$d_attribute_nonnull'
22916 d_attribute_noreturn='$d_attribute_noreturn'
22917 d_attribute_pure='$d_attribute_pure'
22918 d_attribute_unused='$d_attribute_unused'
22919 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
22923 d_bsdgetpgrp='$d_bsdgetpgrp'
22924 d_bsdsetpgrp='$d_bsdsetpgrp'
22925 d_builtin_choose_expr='$d_builtin_choose_expr'
22926 d_builtin_expect='$d_builtin_expect'
22928 d_c99_variadic_macros='$d_c99_variadic_macros'
22929 d_casti32='$d_casti32'
22930 d_castneg='$d_castneg'
22931 d_charvspr='$d_charvspr'
22933 d_chroot='$d_chroot'
22934 d_chsize='$d_chsize'
22936 d_clearenv='$d_clearenv'
22937 d_closedir='$d_closedir'
22938 d_cmsghdr_s='$d_cmsghdr_s'
22940 d_copysignl='$d_copysignl'
22941 d_cplusplus='$d_cplusplus'
22943 d_crypt_r='$d_crypt_r'
22945 d_ctermid='$d_ctermid'
22946 d_ctermid_r='$d_ctermid_r'
22947 d_ctime64='$d_ctime64'
22948 d_ctime_r='$d_ctime_r'
22949 d_cuserid='$d_cuserid'
22950 d_dbl_dig='$d_dbl_dig'
22951 d_dbminitproto='$d_dbminitproto'
22952 d_difftime64='$d_difftime64'
22953 d_difftime='$d_difftime'
22954 d_dir_dd_fd='$d_dir_dd_fd'
22956 d_dirnamlen='$d_dirnamlen'
22957 d_dlerror='$d_dlerror'
22958 d_dlopen='$d_dlopen'
22959 d_dlsymun='$d_dlsymun'
22960 d_dosuid='$d_dosuid'
22961 d_drand48_r='$d_drand48_r'
22962 d_drand48proto='$d_drand48proto'
22964 d_eaccess='$d_eaccess'
22965 d_endgrent='$d_endgrent'
22966 d_endgrent_r='$d_endgrent_r'
22967 d_endhent='$d_endhent'
22968 d_endhostent_r='$d_endhostent_r'
22969 d_endnent='$d_endnent'
22970 d_endnetent_r='$d_endnetent_r'
22971 d_endpent='$d_endpent'
22972 d_endprotoent_r='$d_endprotoent_r'
22973 d_endpwent='$d_endpwent'
22974 d_endpwent_r='$d_endpwent_r'
22975 d_endsent='$d_endsent'
22976 d_endservent_r='$d_endservent_r'
22977 d_eofnblk='$d_eofnblk'
22978 d_eunice='$d_eunice'
22979 d_faststdio='$d_faststdio'
22980 d_fchdir='$d_fchdir'
22981 d_fchmod='$d_fchmod'
22982 d_fchown='$d_fchown'
22984 d_fcntl_can_lock='$d_fcntl_can_lock'
22985 d_fd_macros='$d_fd_macros'
22986 d_fd_set='$d_fd_set'
22987 d_fds_bits='$d_fds_bits'
22988 d_fgetpos='$d_fgetpos'
22989 d_finite='$d_finite'
22990 d_finitel='$d_finitel'
22991 d_flexfnam='$d_flexfnam'
22993 d_flockproto='$d_flockproto'
22995 d_fp_class='$d_fp_class'
22996 d_fpathconf='$d_fpathconf'
22997 d_fpclass='$d_fpclass'
22998 d_fpclassify='$d_fpclassify'
22999 d_fpclassl='$d_fpclassl'
23000 d_fpos64_t='$d_fpos64_t'
23001 d_frexpl='$d_frexpl'
23002 d_fs_data_s='$d_fs_data_s'
23003 d_fseeko='$d_fseeko'
23004 d_fsetpos='$d_fsetpos'
23005 d_fstatfs='$d_fstatfs'
23006 d_fstatvfs='$d_fstatvfs'
23008 d_ftello='$d_ftello'
23010 d_futimes='$d_futimes'
23011 d_gdbm_ndbm_h_uses_prototypes='$d_gdbm_ndbm_h_uses_prototypes'
23012 d_gdbmndbm_h_uses_prototypes='$d_gdbmndbm_h_uses_prototypes'
23013 d_getaddrinfo='$d_getaddrinfo'
23014 d_getcwd='$d_getcwd'
23015 d_getespwnam='$d_getespwnam'
23016 d_getfsstat='$d_getfsstat'
23017 d_getgrent='$d_getgrent'
23018 d_getgrent_r='$d_getgrent_r'
23019 d_getgrgid_r='$d_getgrgid_r'
23020 d_getgrnam_r='$d_getgrnam_r'
23021 d_getgrps='$d_getgrps'
23022 d_gethbyaddr='$d_gethbyaddr'
23023 d_gethbyname='$d_gethbyname'
23024 d_gethent='$d_gethent'
23025 d_gethname='$d_gethname'
23026 d_gethostbyaddr_r='$d_gethostbyaddr_r'
23027 d_gethostbyname_r='$d_gethostbyname_r'
23028 d_gethostent_r='$d_gethostent_r'
23029 d_gethostprotos='$d_gethostprotos'
23030 d_getitimer='$d_getitimer'
23031 d_getlogin='$d_getlogin'
23032 d_getlogin_r='$d_getlogin_r'
23033 d_getmnt='$d_getmnt'
23034 d_getmntent='$d_getmntent'
23035 d_getnameinfo='$d_getnameinfo'
23036 d_getnbyaddr='$d_getnbyaddr'
23037 d_getnbyname='$d_getnbyname'
23038 d_getnent='$d_getnent'
23039 d_getnetbyaddr_r='$d_getnetbyaddr_r'
23040 d_getnetbyname_r='$d_getnetbyname_r'
23041 d_getnetent_r='$d_getnetent_r'
23042 d_getnetprotos='$d_getnetprotos'
23043 d_getpagsz='$d_getpagsz'
23044 d_getpbyname='$d_getpbyname'
23045 d_getpbynumber='$d_getpbynumber'
23046 d_getpent='$d_getpent'
23047 d_getpgid='$d_getpgid'
23048 d_getpgrp2='$d_getpgrp2'
23049 d_getpgrp='$d_getpgrp'
23050 d_getppid='$d_getppid'
23051 d_getprior='$d_getprior'
23052 d_getprotobyname_r='$d_getprotobyname_r'
23053 d_getprotobynumber_r='$d_getprotobynumber_r'
23054 d_getprotoent_r='$d_getprotoent_r'
23055 d_getprotoprotos='$d_getprotoprotos'
23056 d_getprpwnam='$d_getprpwnam'
23057 d_getpwent='$d_getpwent'
23058 d_getpwent_r='$d_getpwent_r'
23059 d_getpwnam_r='$d_getpwnam_r'
23060 d_getpwuid_r='$d_getpwuid_r'
23061 d_getsbyname='$d_getsbyname'
23062 d_getsbyport='$d_getsbyport'
23063 d_getsent='$d_getsent'
23064 d_getservbyname_r='$d_getservbyname_r'
23065 d_getservbyport_r='$d_getservbyport_r'
23066 d_getservent_r='$d_getservent_r'
23067 d_getservprotos='$d_getservprotos'
23068 d_getspnam='$d_getspnam'
23069 d_getspnam_r='$d_getspnam_r'
23070 d_gettimeod='$d_gettimeod'
23071 d_gmtime64='$d_gmtime64'
23072 d_gmtime_r='$d_gmtime_r'
23073 d_gnulibc='$d_gnulibc'
23074 d_grpasswd='$d_grpasswd'
23075 d_hasmntopt='$d_hasmntopt'
23077 d_ilogbl='$d_ilogbl'
23078 d_inc_version_list='$d_inc_version_list'
23080 d_inetaton='$d_inetaton'
23081 d_inetntop='$d_inetntop'
23082 d_inetpton='$d_inetpton'
23083 d_int64_t='$d_int64_t'
23084 d_ip_mreq='$d_ip_mreq'
23085 d_ip_mreq_source='$d_ip_mreq_source'
23086 d_ipv6_mreq='$d_ipv6_mreq'
23087 d_ipv6_mreq_source='$d_ipv6_mreq_source'
23088 d_isascii='$d_isascii'
23089 d_isblank='$d_isblank'
23090 d_isfinite='$d_isfinite'
23093 d_isnanl='$d_isnanl'
23094 d_killpg='$d_killpg'
23095 d_lchown='$d_lchown'
23096 d_ldbl_dig='$d_ldbl_dig'
23097 d_libm_lib_version='$d_libm_lib_version'
23099 d_localtime64='$d_localtime64'
23100 d_localtime_r='$d_localtime_r'
23101 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
23102 d_locconv='$d_locconv'
23104 d_longdbl='$d_longdbl'
23105 d_longlong='$d_longlong'
23106 d_lseekproto='$d_lseekproto'
23108 d_madvise='$d_madvise'
23109 d_malloc_good_size='$d_malloc_good_size'
23110 d_malloc_size='$d_malloc_size'
23112 d_mbstowcs='$d_mbstowcs'
23113 d_mbtowc='$d_mbtowc'
23114 d_memchr='$d_memchr'
23115 d_memcmp='$d_memcmp'
23116 d_memcpy='$d_memcpy'
23117 d_memmove='$d_memmove'
23118 d_memset='$d_memset'
23120 d_mkdtemp='$d_mkdtemp'
23121 d_mkfifo='$d_mkfifo'
23122 d_mkstemp='$d_mkstemp'
23123 d_mkstemps='$d_mkstemps'
23124 d_mktime64='$d_mktime64'
23125 d_mktime='$d_mktime'
23128 d_modfl_pow32_bug='$d_modfl_pow32_bug'
23129 d_modflproto='$d_modflproto'
23130 d_mprotect='$d_mprotect'
23132 d_msg_ctrunc='$d_msg_ctrunc'
23133 d_msg_dontroute='$d_msg_dontroute'
23134 d_msg_oob='$d_msg_oob'
23135 d_msg_peek='$d_msg_peek'
23136 d_msg_proxy='$d_msg_proxy'
23137 d_msgctl='$d_msgctl'
23138 d_msgget='$d_msgget'
23139 d_msghdr_s='$d_msghdr_s'
23140 d_msgrcv='$d_msgrcv'
23141 d_msgsnd='$d_msgsnd'
23143 d_munmap='$d_munmap'
23144 d_mymalloc='$d_mymalloc'
23146 d_ndbm_h_uses_prototypes='$d_ndbm_h_uses_prototypes'
23148 d_nl_langinfo='$d_nl_langinfo'
23149 d_nv_preserves_uv='$d_nv_preserves_uv'
23150 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
23151 d_off64_t='$d_off64_t'
23152 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
23153 d_oldpthreads='$d_oldpthreads'
23154 d_oldsock='$d_oldsock'
23156 d_pathconf='$d_pathconf'
23158 d_perl_otherlibdirs='$d_perl_otherlibdirs'
23159 d_phostname='$d_phostname'
23162 d_portable='$d_portable'
23164 d_prctl_set_name='$d_prctl_set_name'
23165 d_printf_format_null='$d_printf_format_null'
23166 d_procselfexe='$d_procselfexe'
23167 d_pseudofork='$d_pseudofork'
23168 d_pthread_atfork='$d_pthread_atfork'
23169 d_pthread_attr_setscope='$d_pthread_attr_setscope'
23170 d_pthread_yield='$d_pthread_yield'
23172 d_pwchange='$d_pwchange'
23173 d_pwclass='$d_pwclass'
23174 d_pwcomment='$d_pwcomment'
23175 d_pwexpire='$d_pwexpire'
23176 d_pwgecos='$d_pwgecos'
23177 d_pwpasswd='$d_pwpasswd'
23178 d_pwquota='$d_pwquota'
23181 d_random_r='$d_random_r'
23182 d_readdir64_r='$d_readdir64_r'
23183 d_readdir='$d_readdir'
23184 d_readdir_r='$d_readdir_r'
23185 d_readlink='$d_readlink'
23187 d_recvmsg='$d_recvmsg'
23188 d_rename='$d_rename'
23189 d_rewinddir='$d_rewinddir'
23191 d_safebcpy='$d_safebcpy'
23192 d_safemcpy='$d_safemcpy'
23193 d_sanemcmp='$d_sanemcmp'
23194 d_sbrkproto='$d_sbrkproto'
23195 d_scalbnl='$d_scalbnl'
23196 d_sched_yield='$d_sched_yield'
23197 d_scm_rights='$d_scm_rights'
23198 d_seekdir='$d_seekdir'
23199 d_select='$d_select'
23201 d_semctl='$d_semctl'
23202 d_semctl_semid_ds='$d_semctl_semid_ds'
23203 d_semctl_semun='$d_semctl_semun'
23204 d_semget='$d_semget'
23206 d_sendmsg='$d_sendmsg'
23207 d_setegid='$d_setegid'
23208 d_seteuid='$d_seteuid'
23209 d_setgrent='$d_setgrent'
23210 d_setgrent_r='$d_setgrent_r'
23211 d_setgrps='$d_setgrps'
23212 d_sethent='$d_sethent'
23213 d_sethostent_r='$d_sethostent_r'
23214 d_setitimer='$d_setitimer'
23215 d_setlinebuf='$d_setlinebuf'
23216 d_setlocale='$d_setlocale'
23217 d_setlocale_r='$d_setlocale_r'
23218 d_setnent='$d_setnent'
23219 d_setnetent_r='$d_setnetent_r'
23220 d_setpent='$d_setpent'
23221 d_setpgid='$d_setpgid'
23222 d_setpgrp2='$d_setpgrp2'
23223 d_setpgrp='$d_setpgrp'
23224 d_setprior='$d_setprior'
23225 d_setproctitle='$d_setproctitle'
23226 d_setprotoent_r='$d_setprotoent_r'
23227 d_setpwent='$d_setpwent'
23228 d_setpwent_r='$d_setpwent_r'
23229 d_setregid='$d_setregid'
23230 d_setresgid='$d_setresgid'
23231 d_setresuid='$d_setresuid'
23232 d_setreuid='$d_setreuid'
23233 d_setrgid='$d_setrgid'
23234 d_setruid='$d_setruid'
23235 d_setsent='$d_setsent'
23236 d_setservent_r='$d_setservent_r'
23237 d_setsid='$d_setsid'
23238 d_setvbuf='$d_setvbuf'
23242 d_shmatprototype='$d_shmatprototype'
23243 d_shmctl='$d_shmctl'
23245 d_shmget='$d_shmget'
23246 d_sigaction='$d_sigaction'
23247 d_signbit='$d_signbit'
23248 d_sigprocmask='$d_sigprocmask'
23249 d_sigsetjmp='$d_sigsetjmp'
23250 d_sin6_scope_id='$d_sin6_scope_id'
23251 d_sitearch='$d_sitearch'
23252 d_snprintf='$d_snprintf'
23253 d_sockaddr_in6='$d_sockaddr_in6'
23254 d_sockaddr_sa_len='$d_sockaddr_sa_len'
23255 d_sockatmark='$d_sockatmark'
23256 d_sockatmarkproto='$d_sockatmarkproto'
23257 d_socket='$d_socket'
23258 d_socklen_t='$d_socklen_t'
23259 d_sockpair='$d_sockpair'
23260 d_socks5_init='$d_socks5_init'
23261 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
23263 d_srand48_r='$d_srand48_r'
23264 d_srandom_r='$d_srandom_r'
23265 d_sresgproto='$d_sresgproto'
23266 d_sresuproto='$d_sresuproto'
23267 d_statblks='$d_statblks'
23268 d_statfs_f_flags='$d_statfs_f_flags'
23269 d_statfs_s='$d_statfs_s'
23270 d_static_inline='$d_static_inline'
23271 d_statvfs='$d_statvfs'
23272 d_stdio_cnt_lval='$d_stdio_cnt_lval'
23273 d_stdio_ptr_lval='$d_stdio_ptr_lval'
23274 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
23275 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
23276 d_stdio_stream_array='$d_stdio_stream_array'
23277 d_stdiobase='$d_stdiobase'
23278 d_stdstdio='$d_stdstdio'
23279 d_strchr='$d_strchr'
23280 d_strcoll='$d_strcoll'
23281 d_strctcpy='$d_strctcpy'
23282 d_strerrm='$d_strerrm'
23283 d_strerror='$d_strerror'
23284 d_strerror_r='$d_strerror_r'
23285 d_strftime='$d_strftime'
23286 d_strlcat='$d_strlcat'
23287 d_strlcpy='$d_strlcpy'
23288 d_strtod='$d_strtod'
23289 d_strtol='$d_strtol'
23290 d_strtold='$d_strtold'
23291 d_strtoll='$d_strtoll'
23292 d_strtoq='$d_strtoq'
23293 d_strtoul='$d_strtoul'
23294 d_strtoull='$d_strtoull'
23295 d_strtouq='$d_strtouq'
23296 d_strxfrm='$d_strxfrm'
23297 d_suidsafe='$d_suidsafe'
23298 d_symlink='$d_symlink'
23299 d_syscall='$d_syscall'
23300 d_syscallproto='$d_syscallproto'
23301 d_sysconf='$d_sysconf'
23302 d_sysernlst='$d_sysernlst'
23303 d_syserrlst='$d_syserrlst'
23304 d_system='$d_system'
23305 d_tcgetpgrp='$d_tcgetpgrp'
23306 d_tcsetpgrp='$d_tcsetpgrp'
23307 d_telldir='$d_telldir'
23308 d_telldirproto='$d_telldirproto'
23310 d_timegm='$d_timegm'
23312 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
23313 d_tm_tm_zone='$d_tm_tm_zone'
23314 d_tmpnam_r='$d_tmpnam_r'
23315 d_truncate='$d_truncate'
23316 d_ttyname_r='$d_ttyname_r'
23317 d_tzname='$d_tzname'
23318 d_u32align='$d_u32align'
23319 d_ualarm='$d_ualarm'
23322 d_union_semun='$d_union_semun'
23323 d_unordered='$d_unordered'
23324 d_unsetenv='$d_unsetenv'
23325 d_usleep='$d_usleep'
23326 d_usleepproto='$d_usleepproto'
23328 d_vendorarch='$d_vendorarch'
23329 d_vendorbin='$d_vendorbin'
23330 d_vendorlib='$d_vendorlib'
23331 d_vendorscript='$d_vendorscript'
23333 d_void_closedir='$d_void_closedir'
23334 d_voidsig='$d_voidsig'
23335 d_voidtty='$d_voidtty'
23336 d_volatile='$d_volatile'
23337 d_vprintf='$d_vprintf'
23338 d_vsnprintf='$d_vsnprintf'
23340 d_waitpid='$d_waitpid'
23341 d_wcstombs='$d_wcstombs'
23342 d_wctomb='$d_wctomb'
23343 d_writev='$d_writev'
23346 db_hashtype='$db_hashtype'
23347 db_prefixtype='$db_prefixtype'
23348 db_version_major='$db_version_major'
23349 db_version_minor='$db_version_minor'
23350 db_version_patch='$db_version_patch'
23351 defvoidused='$defvoidused'
23352 direntrytype='$direntrytype'
23355 doublesize='$doublesize'
23357 drand48_r_proto='$drand48_r_proto'
23359 dynamic_ext='$dynamic_ext'
23365 endgrent_r_proto='$endgrent_r_proto'
23366 endhostent_r_proto='$endhostent_r_proto'
23367 endnetent_r_proto='$endnetent_r_proto'
23368 endprotoent_r_proto='$endprotoent_r_proto'
23369 endpwent_r_proto='$endpwent_r_proto'
23370 endservent_r_proto='$endservent_r_proto'
23371 eunicefix='$eunicefix'
23374 extensions='$extensions'
23375 extern_C='$extern_C'
23377 fflushNULL='$fflushNULL'
23378 fflushall='$fflushall'
23380 firstmakefile='$firstmakefile'
23382 fpossize='$fpossize'
23383 fpostype='$fpostype'
23384 freetype='$freetype'
23387 full_csh='$full_csh'
23388 full_sed='$full_sed'
23389 gccansipedantic='$gccansipedantic'
23390 gccosandvers='$gccosandvers'
23391 gccversion='$gccversion'
23392 getgrent_r_proto='$getgrent_r_proto'
23393 getgrgid_r_proto='$getgrgid_r_proto'
23394 getgrnam_r_proto='$getgrnam_r_proto'
23395 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
23396 gethostbyname_r_proto='$gethostbyname_r_proto'
23397 gethostent_r_proto='$gethostent_r_proto'
23398 getlogin_r_proto='$getlogin_r_proto'
23399 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
23400 getnetbyname_r_proto='$getnetbyname_r_proto'
23401 getnetent_r_proto='$getnetent_r_proto'
23402 getprotobyname_r_proto='$getprotobyname_r_proto'
23403 getprotobynumber_r_proto='$getprotobynumber_r_proto'
23404 getprotoent_r_proto='$getprotoent_r_proto'
23405 getpwent_r_proto='$getpwent_r_proto'
23406 getpwnam_r_proto='$getpwnam_r_proto'
23407 getpwuid_r_proto='$getpwuid_r_proto'
23408 getservbyname_r_proto='$getservbyname_r_proto'
23409 getservbyport_r_proto='$getservbyport_r_proto'
23410 getservent_r_proto='$getservent_r_proto'
23411 getspnam_r_proto='$getspnam_r_proto'
23412 gidformat='$gidformat'
23418 gmtime_r_proto='$gmtime_r_proto'
23419 gnulibc_version='$gnulibc_version'
23421 groupcat='$groupcat'
23422 groupstype='$groupstype'
23425 h_sysfile='$h_sysfile'
23428 html1dir='$html1dir'
23429 html1direxp='$html1direxp'
23430 html3dir='$html3dir'
23431 html3direxp='$html3direxp'
23440 i_arpainet='$i_arpainet'
23441 i_assert='$i_assert'
23442 i_bsdioctl='$i_bsdioctl'
23446 i_dirent='$i_dirent'
23452 i_fp_class='$i_fp_class'
23454 i_gdbm_ndbm='$i_gdbm_ndbm'
23455 i_gdbmndbm='$i_gdbmndbm'
23457 i_ieeefp='$i_ieeefp'
23458 i_inttypes='$i_inttypes'
23459 i_langinfo='$i_langinfo'
23460 i_libutil='$i_libutil'
23461 i_limits='$i_limits'
23462 i_locale='$i_locale'
23463 i_machcthr='$i_machcthr'
23464 i_malloc='$i_malloc'
23465 i_mallocmalloc='$i_mallocmalloc'
23467 i_memory='$i_memory'
23468 i_mntent='$i_mntent'
23471 i_neterrno='$i_neterrno'
23472 i_netinettcp='$i_netinettcp'
23476 i_pthread='$i_pthread'
23478 i_rpcsvcdbm='$i_rpcsvcdbm'
23481 i_shadow='$i_shadow'
23483 i_stdarg='$i_stdarg'
23484 i_stdbool='$i_stdbool'
23485 i_stddef='$i_stddef'
23486 i_stdlib='$i_stdlib'
23487 i_string='$i_string'
23488 i_sunmath='$i_sunmath'
23489 i_sysaccess='$i_sysaccess'
23490 i_sysdir='$i_sysdir'
23491 i_sysfile='$i_sysfile'
23492 i_sysfilio='$i_sysfilio'
23494 i_sysioctl='$i_sysioctl'
23495 i_syslog='$i_syslog'
23496 i_sysmman='$i_sysmman'
23497 i_sysmode='$i_sysmode'
23498 i_sysmount='$i_sysmount'
23499 i_sysndir='$i_sysndir'
23500 i_sysparam='$i_sysparam'
23501 i_syspoll='$i_syspoll'
23502 i_sysresrc='$i_sysresrc'
23503 i_syssecrt='$i_syssecrt'
23504 i_sysselct='$i_sysselct'
23505 i_syssockio='$i_syssockio'
23506 i_sysstat='$i_sysstat'
23507 i_sysstatfs='$i_sysstatfs'
23508 i_sysstatvfs='$i_sysstatvfs'
23509 i_systime='$i_systime'
23510 i_systimek='$i_systimek'
23511 i_systimes='$i_systimes'
23512 i_systypes='$i_systypes'
23513 i_sysuio='$i_sysuio'
23515 i_sysutsname='$i_sysutsname'
23516 i_sysvfs='$i_sysvfs'
23517 i_syswait='$i_syswait'
23518 i_termio='$i_termio'
23519 i_termios='$i_termios'
23521 i_unistd='$i_unistd'
23524 i_values='$i_values'
23525 i_varargs='$i_varargs'
23526 i_varhdr='$i_varhdr'
23528 ignore_versioned_solibs='$ignore_versioned_solibs'
23529 inc_version_list='$inc_version_list'
23530 inc_version_list_init='$inc_version_list_init'
23533 initialinstalllocation='$initialinstalllocation'
23534 installarchlib='$installarchlib'
23535 installbin='$installbin'
23536 installhtml1dir='$installhtml1dir'
23537 installhtml3dir='$installhtml3dir'
23538 installman1dir='$installman1dir'
23539 installman3dir='$installman3dir'
23540 installprefix='$installprefix'
23541 installprefixexp='$installprefixexp'
23542 installprivlib='$installprivlib'
23543 installscript='$installscript'
23544 installsitearch='$installsitearch'
23545 installsitebin='$installsitebin'
23546 installsitehtml1dir='$installsitehtml1dir'
23547 installsitehtml3dir='$installsitehtml3dir'
23548 installsitelib='$installsitelib'
23549 installsiteman1dir='$installsiteman1dir'
23550 installsiteman3dir='$installsiteman3dir'
23551 installsitescript='$installsitescript'
23552 installstyle='$installstyle'
23553 installusrbinperl='$installusrbinperl'
23554 installvendorarch='$installvendorarch'
23555 installvendorbin='$installvendorbin'
23556 installvendorhtml1dir='$installvendorhtml1dir'
23557 installvendorhtml3dir='$installvendorhtml3dir'
23558 installvendorlib='$installvendorlib'
23559 installvendorman1dir='$installvendorman1dir'
23560 installvendorman3dir='$installvendorman3dir'
23561 installvendorscript='$installvendorscript'
23563 issymlink='$issymlink'
23564 ivdformat='$ivdformat'
23567 known_extensions='$known_extensions'
23570 ld_can_script='$ld_can_script'
23571 lddlflags='$lddlflags'
23573 ldflags_uselargefiles='$ldflags_uselargefiles'
23574 ldlibpthname='$ldlibpthname'
23581 libsdirs='$libsdirs'
23582 libsfiles='$libsfiles'
23583 libsfound='$libsfound'
23584 libspath='$libspath'
23585 libswanted='$libswanted'
23586 libswanted_uselargefiles='$libswanted_uselargefiles'
23592 localtime_r_proto='$localtime_r_proto'
23593 locincpth='$locincpth'
23594 loclibpth='$loclibpth'
23595 longdblsize='$longdblsize'
23596 longlongsize='$longlongsize'
23597 longsize='$longsize'
23601 lseeksize='$lseeksize'
23602 lseektype='$lseektype'
23605 madlyobj='$madlyobj'
23606 madlysrc='$madlysrc'
23610 make_set_make='$make_set_make'
23611 mallocobj='$mallocobj'
23612 mallocsrc='$mallocsrc'
23613 malloctype='$malloctype'
23615 man1direxp='$man1direxp'
23618 man3direxp='$man3direxp'
23620 mips_type='$mips_type'
23621 mistrustnm='$mistrustnm'
23623 mmaptype='$mmaptype'
23624 modetype='$modetype'
23626 multiarch='$multiarch'
23628 myarchname='$myarchname'
23629 mydomain='$mydomain'
23630 myhostname='$myhostname'
23633 need_va_copy='$need_va_copy'
23634 netdb_hlen_type='$netdb_hlen_type'
23635 netdb_host_type='$netdb_host_type'
23636 netdb_name_type='$netdb_name_type'
23637 netdb_net_type='$netdb_net_type'
23640 nm_so_opt='$nm_so_opt'
23641 nonxs_ext='$nonxs_ext'
23643 nvEUformat='$nvEUformat'
23644 nvFUformat='$nvFUformat'
23645 nvGUformat='$nvGUformat'
23646 nv_overflows_integers_at='$nv_overflows_integers_at'
23647 nv_preserves_uv_bits='$nv_preserves_uv_bits'
23648 nveformat='$nveformat'
23649 nvfformat='$nvfformat'
23650 nvgformat='$nvgformat'
23653 o_nonblock='$o_nonblock'
23655 old_pthread_create_joinable='$old_pthread_create_joinable'
23656 optimize='$optimize'
23657 orderlib='$orderlib'
23660 otherlibdirs='$otherlibdirs'
23664 patchlevel='$patchlevel'
23665 path_sep='$path_sep'
23668 perl_patchlevel='$perl_patchlevel'
23669 perl_static_inline='$perl_static_inline'
23670 perladmin='$perladmin'
23671 perllibs='$perllibs'
23672 perlpath='$perlpath'
23674 phostname='$phostname'
23680 prefixexp='$prefixexp'
23682 privlibexp='$privlibexp'
23683 procselfexe='$procselfexe'
23684 prototype='$prototype'
23686 quadkind='$quadkind'
23687 quadtype='$quadtype'
23688 randbits='$randbits'
23689 randfunc='$randfunc'
23690 random_r_proto='$random_r_proto'
23691 randseedtype='$randseedtype'
23693 rd_nodata='$rd_nodata'
23694 readdir64_r_proto='$readdir64_r_proto'
23695 readdir_r_proto='$readdir_r_proto'
23696 revision='$revision'
23702 sGMTIME_max='$sGMTIME_max'
23703 sGMTIME_min='$sGMTIME_min'
23704 sLOCALTIME_max='$sLOCALTIME_max'
23705 sLOCALTIME_min='$sLOCALTIME_min'
23706 sPRIEUldbl='$sPRIEUldbl'
23707 sPRIFUldbl='$sPRIFUldbl'
23708 sPRIGUldbl='$sPRIGUldbl'
23709 sPRIXU64='$sPRIXU64'
23711 sPRIeldbl='$sPRIeldbl'
23712 sPRIfldbl='$sPRIfldbl'
23713 sPRIgldbl='$sPRIgldbl'
23718 sSCNfldbl='$sSCNfldbl'
23719 sched_yield='$sched_yield'
23720 scriptdir='$scriptdir'
23721 scriptdirexp='$scriptdirexp'
23723 seedfunc='$seedfunc'
23724 selectminbits='$selectminbits'
23725 selecttype='$selecttype'
23726 sendmail='$sendmail'
23727 setgrent_r_proto='$setgrent_r_proto'
23728 sethostent_r_proto='$sethostent_r_proto'
23729 setlocale_r_proto='$setlocale_r_proto'
23730 setnetent_r_proto='$setnetent_r_proto'
23731 setprotoent_r_proto='$setprotoent_r_proto'
23732 setpwent_r_proto='$setpwent_r_proto'
23733 setservent_r_proto='$setservent_r_proto'
23736 sharpbang='$sharpbang'
23737 shmattype='$shmattype'
23738 shortsize='$shortsize'
23741 sig_count='$sig_count'
23742 sig_name='$sig_name'
23743 sig_name_init='$sig_name_init'
23745 sig_num_init='$sig_num_init'
23746 sig_size='$sig_size'
23747 signal_t='$signal_t'
23748 sitearch='$sitearch'
23749 sitearchexp='$sitearchexp'
23751 sitebinexp='$sitebinexp'
23752 sitehtml1dir='$sitehtml1dir'
23753 sitehtml1direxp='$sitehtml1direxp'
23754 sitehtml3dir='$sitehtml3dir'
23755 sitehtml3direxp='$sitehtml3direxp'
23757 sitelib_stem='$sitelib_stem'
23758 sitelibexp='$sitelibexp'
23759 siteman1dir='$siteman1dir'
23760 siteman1direxp='$siteman1direxp'
23761 siteman3dir='$siteman3dir'
23762 siteman3direxp='$siteman3direxp'
23763 siteprefix='$siteprefix'
23764 siteprefixexp='$siteprefixexp'
23765 sitescript='$sitescript'
23766 sitescriptexp='$sitescriptexp'
23767 sizesize='$sizesize'
23768 sizetype='$sizetype'
23772 sockethdr='$sockethdr'
23773 socketlib='$socketlib'
23774 socksizetype='$socksizetype'
23776 spackage='$spackage'
23777 spitshell='$spitshell'
23778 srand48_r_proto='$srand48_r_proto'
23779 srandom_r_proto='$srandom_r_proto'
23781 ssizetype='$ssizetype'
23782 st_ino_sign='$st_ino_sign'
23783 st_ino_size='$st_ino_size'
23784 startperl='$startperl'
23786 static_ext='$static_ext'
23788 stdio_base='$stdio_base'
23789 stdio_bufsiz='$stdio_bufsiz'
23790 stdio_cnt='$stdio_cnt'
23791 stdio_filbuf='$stdio_filbuf'
23792 stdio_ptr='$stdio_ptr'
23793 stdio_stream_array='$stdio_stream_array'
23794 strerror_r_proto='$strerror_r_proto'
23797 subversion='$subversion'
23801 targetarch='$targetarch'
23805 timeincl='$timeincl'
23806 timetype='$timetype'
23807 tmpnam_r_proto='$tmpnam_r_proto'
23813 ttyname_r_proto='$ttyname_r_proto'
23822 uidformat='$uidformat'
23828 uquadtype='$uquadtype'
23829 use5005threads='$use5005threads'
23830 use64bitall='$use64bitall'
23831 use64bitint='$use64bitint'
23832 usecrosscompile='$usecrosscompile'
23833 usedevel='$usedevel'
23835 usedtrace='$usedtrace'
23836 usefaststdio='$usefaststdio'
23837 useithreads='$useithreads'
23838 usekernprocpathname='$usekernprocpathname'
23839 uselargefiles='$uselargefiles'
23840 uselongdouble='$uselongdouble'
23841 usemallocwrap='$usemallocwrap'
23842 usemorebits='$usemorebits'
23843 usemultiplicity='$usemultiplicity'
23844 usemymalloc='$usemymalloc'
23846 usensgetexecutablepath='$usensgetexecutablepath'
23847 useopcode='$useopcode'
23848 useperlio='$useperlio'
23849 useposix='$useposix'
23850 usereentrant='$usereentrant'
23851 userelocatableinc='$userelocatableinc'
23853 useshrplib='$useshrplib'
23854 usesitecustomize='$usesitecustomize'
23855 usesocks='$usesocks'
23856 usethreads='$usethreads'
23857 usevendorprefix='$usevendorprefix'
23858 usevfork='$usevfork'
23861 uvXUformat='$uvXUformat'
23862 uvoformat='$uvoformat'
23865 uvuformat='$uvuformat'
23866 uvxformat='$uvxformat'
23868 vendorarch='$vendorarch'
23869 vendorarchexp='$vendorarchexp'
23870 vendorbin='$vendorbin'
23871 vendorbinexp='$vendorbinexp'
23872 vendorhtml1dir='$vendorhtml1dir'
23873 vendorhtml1direxp='$vendorhtml1direxp'
23874 vendorhtml3dir='$vendorhtml3dir'
23875 vendorhtml3direxp='$vendorhtml3direxp'
23876 vendorlib='$vendorlib'
23877 vendorlib_stem='$vendorlib_stem'
23878 vendorlibexp='$vendorlibexp'
23879 vendorman1dir='$vendorman1dir'
23880 vendorman1direxp='$vendorman1direxp'
23881 vendorman3dir='$vendorman3dir'
23882 vendorman3direxp='$vendorman3direxp'
23883 vendorprefix='$vendorprefix'
23884 vendorprefixexp='$vendorprefixexp'
23885 vendorscript='$vendorscript'
23886 vendorscriptexp='$vendorscriptexp'
23888 version_patchlevel_string='$version_patchlevel_string'
23889 versiononly='$versiononly'
23891 voidflags='$voidflags'
23894 yaccflags='$yaccflags'
23899 : add special variables
23900 $test -f $src/patchlevel.h && \
23901 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
23902 echo "PERL_PATCHLEVEL='$perl_patchlevel'" >>config.sh
23903 echo "PERL_CONFIG_SH=true" >>config.sh
23905 : propagate old symbols
23906 if $test -f UU/config.sh; then
23907 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
23908 $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \
23909 config.sh config.sh UU/oldconfig.sh |\
23910 $sort | $uniq -u >UU/oldsyms
23911 set X `$cat UU/oldsyms`
23917 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
23919 echo ": Variables propagated from previous config.sh file." >>config.sh
23920 for sym in `$cat UU/oldsyms`; do
23921 echo " Propagating $hint variable "'$'"$sym..."
23922 eval 'tmp="$'"${sym}"'"'
23924 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
23930 : Finish up by extracting the .SH files
23934 echo "Extraction done."
23944 If you'd like to make any changes to the config.sh file before I begin
23945 to configure things, do it as a shell escape now (e.g. !vi config.sh).
23948 rp="Press return or use a shell escape to edit config.sh:"
23953 *) : in case they cannot read
23954 sh 1>&4 -c "$ans";;
23959 : if this fails, just run all the .SH files by hand
23968 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
23975 Now you need to generate make dependencies by running "$make depend".
23976 You might prefer to run it in background: "$make depend > makedepend.out &"
23977 It can take a while, so you might not want to run it right now.
23982 rp="Run $make depend now?"
23986 $make depend && echo "Now you must run '$make'."
23989 echo "You must run '$make depend' then '$make'."
23992 elif test -f [Mm]akefile; then
23994 echo "Now you must run a $make."
23996 echo "Configure done."
23999 if $test -f Policy.sh; then
24002 If you compile $package on a different machine or from a different object
24003 directory, copy the Policy.sh file from this object directory to the
24004 new one before you run Configure -- this will help you with most of
24005 the policy defaults.
24009 if $test -f config.msg; then
24010 echo "Hmm. I also noted the following information while running:"
24012 $cat config.msg >&4
24015 $rm -f kit*isdone ark*isdone