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 beos) dflt='-nostart' ;;
8012 haiku) dflt='-shared' ;;
8014 case "$gccversion" in
8015 '') dflt="$dflt +vnocompatwarnings" ;;
8018 linux|irix*|gnu*) dflt="-shared $optimize" ;;
8019 next) dflt='none' ;;
8020 solaris) dflt='-G' ;;
8021 sunos) dflt='-assert nodefinitions' ;;
8022 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
8026 *) dflt="$lddlflags" ;;
8029 : Try to guess additional flags to pick up local libraries.
8030 : Be careful not to append to a plain 'none'
8034 for thisflag in $ldflags; do
8039 *) dflt="$dflt $thisflag" ;;
8046 ''|' ') dflt='none' ;;
8050 *-fstack-protector*)
8052 *-fstack-protector*) ;; # Don't add it again
8053 *) dflt="$dflt -fstack-protector" ;;
8059 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
8062 none) lddlflags=' ' ;;
8063 *) lddlflags="$ans" ;;
8068 Some systems may require passing special flags to $cc to indicate that
8069 the resulting executable will use dynamic linking. To use no flags,
8073 case "$ccdlflags" in
8074 '') case "$osname" in
8075 linux|hpux|gnu*) dflt='-Wl,-E' ;;
8076 next|sunos) dflt='none' ;;
8080 *) dflt="$ccdlflags" ;;
8082 rp="Any special flags to pass to $cc to use dynamic linking?"
8085 none) ccdlflags=' ' ;;
8086 *) ccdlflags="$ans" ;;
8097 ld_can_script="$undef"
8098 case "$bin_ELF$usedl" in
8100 # Abuse try.h and a.out names for neat cleanup
8112 if $cc $cccdlflags $ccdlflags $ccflags \
8113 $ldflags $lddlflags -o a.out try.c \
8114 -Wl,--version-script=try.h >/dev/null 2>&1 \
8115 && $test -s a.out ; then
8116 echo "ld supports scripting" >&4
8117 ld_can_script="$define"
8119 echo "ld does not support scripting" >&4
8125 : Do we want a shared libperl?
8129 # No dynamic loading being used, so don't bother even to prompt.
8132 *) case "$useshrplib" in
8133 '') case "$osname" in
8134 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|haiku|cygwin*)
8136 also='Building a shared libperl is required for dynamic loading to work on your system.'
8141 also='Building a shared libperl is needed for MAB support.'
8159 The perl executable is normally obtained by linking perlmain.c with
8160 libperl${_a}, any static extensions (usually just DynaLoader), and
8161 any other libraries needed on this system (such as -lm, etc.). Since
8162 your system supports dynamic loading, it is probably possible to build
8163 a shared libperl.$so. If you will have more than one executable linked
8164 to libperl.$so, this will significantly reduce the size of each
8165 executable, but it may have a noticeable effect on performance. The
8166 default is probably sensible for your system.
8170 rp="Build a shared libperl.$so (y/n)"
8174 useshrplib='true' ;;
8175 *) useshrplib='false' ;;
8180 case "$useshrplib" in
8182 case "$userelocatableinc" in
8184 echo "Cannot build with both -Duserelocatableinc and -Duseshrplib" >&4
8185 echo "See INSTALL for an explanation why that won't work." >&4
8191 # Figure out a good name for libperl.so. Since it gets stored in
8192 # a version-specific architecture-dependent library, the version
8193 # number isn't really that important, except for making cc/ld happy.
8195 # A name such as libperl.so.10.1
8196 majmin="libperl.$so.$patchlevel.$subversion"
8197 # A name such as libperl.so.100
8198 majonly=`echo $patchlevel $subversion |
8199 $awk '{printf "%d%02d", $1, $2}'`
8200 majonly=libperl.$so.$majonly
8201 # I'd prefer to keep the os-specific stuff here to a minimum, and
8202 # rely on figuring it out from the naming of libc.
8203 case "${osname}${osvers}" in
8206 # XXX How handle the --version stuff for MAB?
8208 linux*|gnu*) # ld won't link with a bare -lperl otherwise.
8211 cygwin*) # ld links now against the dll directly
8212 majmin="cygperl5_${patchlevel}_${subversion}.${so}"
8213 majonly=`echo $patchlevel $subversion |
8214 $awk '{printf "%03d%03d", $1, $2}'`
8215 majonly=cygperl5.$majonly.$so
8218 *) # Try to guess based on whether libc has major.minor.
8220 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8221 *libc.$so.[0-9]*) dflt=$majonly ;;
8222 *) dflt=libperl.$so ;;
8232 I need to select a good name for the shared libperl. If your system uses
8233 library names with major and minor numbers, then you might want something
8234 like $majmin. Alternatively, if your system uses a single version
8235 number for shared libraries, then you might want to use $majonly.
8236 Or, your system might be quite happy with a simple libperl.$so.
8238 Since the shared libperl will get installed into a version-specific
8239 architecture-dependent directory, the version number of the shared perl
8240 library probably isn't important, so the default should be o.k.
8243 rp='What name do you want to give to the shared libperl?'
8246 echo "Ok, I'll use $libperl"
8249 libperl="libperl${_a}"
8253 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8257 WARNING: Use of the shrpdir variable for the installation location of
8258 the shared $libperl is not supported. It was never documented and
8259 will not work in this version. Let me (perlbug@perl.org)
8260 know of any problems this may cause.
8266 But your current setting of $shrpdir is
8267 the default anyway, so it's harmless.
8272 Further, your current attempted setting of $shrpdir
8273 conflicts with the value of $archlibexp/CORE
8274 that installperl will use.
8281 # How will the perl executable find the installed shared $libperl?
8282 # Add $xxx to ccdlflags.
8283 # If we can't figure out a command-line option, use $shrpenv to
8284 # set env LD_RUN_PATH. The main perl makefile uses this.
8285 shrpdir=$archlibexp/CORE
8288 if "$useshrplib"; then
8291 # We'll set it in Makefile.SH...
8296 freebsd|mirbsd|netbsd|openbsd|interix|dragonfly)
8297 xxx="-Wl,-R$shrpdir"
8299 bsdos|linux|irix*|dec_osf|gnu*)
8300 xxx="-Wl,-rpath,$shrpdir"
8303 # next doesn't like the default...
8306 # beos doesn't like the default, either.
8309 # Haiku doesn't like the default, either.
8312 # hpux doesn't like the default, either.
8313 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8316 # cygwin needs only ldlibpth
8319 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8325 # Only add $xxx if it isn't already in ccdlflags.
8326 case " $ccdlflags " in
8328 *) ccdlflags="$ccdlflags $xxx"
8331 Adding $xxx to the flags
8332 passed to $ld so that the perl executable will find the
8333 installed shared $libperl.
8341 # Fix ccdlflags in AIX for building external extensions.
8342 # (For building Perl itself bare -bE:perl.exp is needed,
8343 # Makefile.SH takes care of this.)
8345 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8347 # Respect a hint or command-line value.
8349 '') shrpenv="$tmp_shrpenv" ;;
8351 case "$ldlibpthname" in
8352 '') ldlibpthname=LD_LIBRARY_PATH ;;
8353 none) ldlibpthname='' ;;
8356 : determine where manual pages are on this system
8360 syspath='/usr/share/man/man1 /usr/man/man1'
8361 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8362 syspath="$syspath /usr/man/u_man/man1"
8363 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8364 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8365 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8366 sysman=`./loc . /usr/man/man1 $syspath`
8369 if $test -d "$sysman"; then
8370 echo "System manual is in $sysman." >&4
8372 echo "Could not find manual pages in source form." >&4
8375 : determine where manual pages go
8376 set man1dir man1dir none
8380 $spackage has manual pages available in source form.
8384 echo "However, you don't have nroff, so they're probably useless to you."
8386 '') man1dir="none";;
8389 echo "If you don't want the manual sources installed, answer 'none'."
8394 lookpath="$prefixexp/share/man/man1"
8395 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8396 lookpath="$lookpath $prefixexp/man/p_man/man1"
8397 lookpath="$lookpath $prefixexp/man/u_man/man1"
8398 lookpath="$lookpath $prefixexp/man/man.1"
8400 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8401 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8411 rp="Where do the main $spackage manual pages (source) go?"
8413 if $test "X$man1direxp" != "X$ansexp"; then
8424 : What suffix to use on installed man pages
8431 rp="What suffix should be used for the main $spackage man pages?"
8433 '') case "$man1dir" in
8447 *) dflt="$man1ext";;
8454 : see if we can have long filenames
8456 first=123456789abcdef
8458 if (echo hi >$first) 2>/dev/null; then
8459 if $test -f 123456789abcde; then
8460 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8463 echo 'You can have filenames longer than 14 characters.'>&4
8468 You can't have filenames longer than 14 chars.
8469 You can't even think about them!
8475 $rm -rf 123456789abcde*
8477 : determine where library module manual pages go
8478 set man3dir man3dir none
8482 $spackage has manual pages for many of the library modules.
8488 However, you don't have nroff, so they're probably useless to you.
8491 '') man3dir="none";;
8495 case "$d_flexfnam" in
8498 However, your system can't handle the long file names like File::Basename.3.
8501 '') man3dir="none";;
8505 echo "If you don't want the manual sources installed, answer 'none'."
8506 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8508 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8509 if $test -d "$privlib/man/man3"; then
8512 WARNING: Previous versions of perl installed man3 pages into
8513 $privlib/man/man3. This version will suggest a
8514 new default of $dflt.
8518 rp='Do you wish to preserve the old behavior?(y/n)'
8521 y*) dflt="$privlib/man/man3" ;;
8526 *) dflt="$man3dir" ;;
8533 rp="Where do the $package library man pages (source) go?"
8543 : What suffix to use on installed man pages
8549 rp="What suffix should be used for the $package library man pages?"
8551 '') case "$man3dir" in
8565 *) dflt="$man3ext";;
8572 : see if we have to deal with yellow pages, now NIS.
8573 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8574 if $test -f /usr/etc/nibindd; then
8576 echo "I'm fairly confident you're on a NeXT."
8578 rp='Do you get the hosts file via NetInfo?'
8587 y*) hostcat='nidump hosts .';;
8588 *) case "$hostcat" in
8589 nidump*) hostcat='';;
8599 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8607 rp='Are you getting the hosts file via yellow pages?'
8610 y*) hostcat='ypcat hosts';;
8611 *) hostcat='cat /etc/hosts';;
8617 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8620 '') test -f /etc/group && groupcat='cat /etc/group';;
8623 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8626 : now get the host name
8628 echo "Figuring out host name..." >&4
8629 case "$myhostname" in
8631 echo 'Maybe "hostname" will work...'
8632 if tans=`sh -c hostname 2>&1` ; then
8640 if $test "$cont"; then
8642 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8643 if tans=`cat /etc/systemid 2>&1` ; then
8645 phostname='cat /etc/systemid'
8646 echo "Whadyaknow. Xenix always was a bit strange..."
8649 elif $test -r /etc/systemid; then
8650 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8653 if $test "$cont"; then
8654 echo 'No, maybe "uuname -l" will work...'
8655 if tans=`sh -c 'uuname -l' 2>&1` ; then
8657 phostname='uuname -l'
8659 echo 'Strange. Maybe "uname -n" will work...'
8660 if tans=`sh -c 'uname -n' 2>&1` ; then
8662 phostname='uname -n'
8664 echo 'Oh well, maybe I can mine it out of whoami.h...'
8665 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8666 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8667 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8669 case "$myhostname" in
8670 '') echo "Does this machine have an identity crisis or something?"
8673 echo "Well, you said $myhostname before..."
8674 phostname='echo $myhostname';;
8680 case "$myhostname" in
8681 '') myhostname=noname ;;
8683 : you do not want to know about this
8688 if $test "$myhostname" ; then
8690 rp='Your host name appears to be "'$myhostname'".'" Right?"
8698 : bad guess or no guess
8699 while $test "X$myhostname" = X ; do
8701 rp="Please type the (one word) name of your host:"
8706 : translate upper to lower if necessary
8707 case "$myhostname" in
8709 echo "(Normalizing case in your host name)"
8710 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8714 case "$myhostname" in
8716 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8717 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8718 echo "(Trimming domain name from host name--host name is now $myhostname)"
8720 *) case "$mydomain" in
8723 test "X$hostcat" = "Xypcat hosts" &&
8724 ypmatch "$myhostname" hosts 2>/dev/null |\
8725 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8728 test "X$hostcat" != "X" &&
8729 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8730 /[ ]$myhostname[ . ]/p" > hosts
8733 if $test -f hosts; then
8734 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8735 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8736 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8737 hosts | $sort | $uniq | \
8738 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8739 case `$echo X$dflt` in
8740 X*\ *) echo "(Several hosts in the database matched hostname)"
8743 X.) echo "(You do not have fully-qualified names in the hosts database)"
8747 echo "(I cannot locate a hosts database anywhere)"
8752 tans=`./loc resolv.conf X /etc /usr/etc`
8753 if $test -f "$tans"; then
8754 echo "(Attempting domain name extraction from $tans)"
8755 dflt=.`$sed -n -e 's/ / /g' \
8756 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8759 .) dflt=.`$sed -n -e 's/ / /g' \
8760 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8768 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8769 dflt=.`sh -c domainname 2>/dev/null`
8772 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8776 case "$dflt$osname" in
8777 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
8778 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
8782 .) echo "(Lost all hope -- silly guess then)"
8788 *) dflt="$mydomain";;
8792 rp="What is your domain name?"
8802 : translate upper to lower if necessary
8805 echo "(Normalizing case in your domain name)"
8806 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
8810 : a little sanity check here
8811 case "$phostname" in
8814 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
8815 $myhostname$mydomain|$myhostname) ;;
8817 case "$phostname" in
8819 echo "(That doesn't agree with your whoami.h file, by the way.)"
8822 echo "(That doesn't agree with your $phostname command, by the way.)"
8830 : determine the e-mail address of the user who is running us
8833 I need to get your e-mail address in Internet format if possible, i.e.
8834 something like user@host.domain. Please answer accurately since I have
8835 no easy means to double check it. The default value provided below
8836 is most probably close to reality but may not be valid from outside
8837 your organization...
8841 while test "$cont"; do
8843 '') dflt="$cf_by@$myhostname$mydomain";;
8844 *) dflt="$cf_email";;
8846 rp='What is your e-mail address?'
8852 rp='Address does not look like an Internet one. Use it anyway?'
8866 : Ask e-mail of administrator
8869 If you or somebody else will be maintaining perl at your site, please
8870 fill in the correct e-mail address here so that they may be contacted
8871 if necessary. Currently, the "perlbug" program included with perl
8872 will send mail to this address in addition to perlbug@perl.org. You may
8873 enter "none" for no administrator.
8876 case "$perladmin" in
8877 '') dflt="$cf_email";;
8878 *) dflt="$perladmin";;
8880 rp='Perl administrator e-mail address'
8884 : determine whether to only install version-specific parts.
8887 Do you want to install only the version-specific parts of the perl
8888 distribution? Usually you do *not* want to do this.
8890 case "$versiononly" in
8891 "$define"|[Yy]*|true) dflt='y' ;;
8894 rp="Do you want to install only the version-specific parts of perl?"
8897 [yY]*) val="$define";;
8903 case "$versiononly" in
8904 "$define") inc_version_list=''
8905 inc_version_list_init=0
8909 : figure out how to guarantee perl startup
8910 : XXX Note that this currently takes advantage of the bug that binexp ignores
8911 : the Configure -Dinstallprefix setting, which in turn means that under
8912 : relocatable @INC, initialinstalllocation is what binexp started as.
8913 case "$startperl" in
8915 case "$sharpbang" in
8919 I can use the #! construct to start perl on your system. This will
8920 make startup of perl scripts faster, but may cause problems if you
8921 want to share those scripts and perl is not in a standard place
8922 ($initialinstalllocation/perl) on all your platforms. The alternative
8923 is to force a shell by starting the script with a single ':' character.
8926 case "$versiononly" in
8927 "$define") dflt="$initialinstalllocation/perl$version";;
8928 *) dflt="$initialinstalllocation/perl";;
8930 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
8933 none) startperl=": # use perl";;
8934 *) startperl="#!$ans"
8935 if $test 30 -lt `echo "$ans" | wc -c`; then
8938 WARNING: Some systems limit the #! command to 32 characters.
8939 If you experience difficulty running Perl scripts with #!, try
8940 installing Perl in a directory with a shorter pathname.
8946 *) startperl=": # use perl"
8951 echo "I'll use $startperl to start perl scripts."
8953 : figure best path for perl in scripts
8956 case "$versiononly" in
8957 "$define") perlpath="$initialinstalllocation/perl$version";;
8958 *) perlpath="$initialinstalllocation/perl";;
8960 case "$startperl" in
8965 I will use the "eval 'exec'" idiom to start Perl on your system.
8966 I can use the full path of your Perl binary for this purpose, but
8967 doing so may cause problems if you want to share those scripts and
8968 Perl is not always in a standard place ($initialinstalllocation/perl).
8971 dflt="$initialinstalllocation/perl"
8972 rp="What path shall I use in \"eval 'exec'\"?"
8979 case "$startperl" in
8981 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
8984 : determine where public executable scripts go
8985 set scriptdir scriptdir
8987 case "$scriptdir" in
8990 : guess some guesses
8991 $test -d /usr/share/scripts && dflt=/usr/share/scripts
8992 $test -d /usr/share/bin && dflt=/usr/share/bin
8993 $test -d /usr/local/script && dflt=/usr/local/script
8994 $test -d /usr/local/scripts && dflt=/usr/local/scripts
8995 $test -d $prefixexp/script && dflt=$prefixexp/script
8999 *) dflt="$scriptdir"
9004 Some installations have a separate directory just for executable scripts so
9005 that they can mount it across multiple architectures but keep the scripts in
9006 one spot. You might, for example, have a subdirectory of /usr/share for this.
9007 Or you might just lump your scripts in with all your other executables.
9011 rp='Where do you keep publicly executable scripts?'
9013 if $test "X$ansexp" != "X$scriptdirexp"; then
9019 : A little fix up for an irregularly named variable.
9020 installscript="$installscriptdir"
9022 : determine where add-on public executables go
9024 '') dflt=$siteprefix/bin ;;
9028 rp='Pathname where the add-on public executables should be installed?'
9033 : determine where add-on html pages go
9034 : There is no standard location, so try to copy the previously-selected
9035 : directory structure for the core html pages.
9036 case "$sitehtml1dir" in
9037 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9038 *) dflt=$sitehtml1dir ;;
9041 ''|' ') dflt=none ;;
9044 rp='Pathname where the site-specific html pages should be installed?'
9046 prefixvar=sitehtml1dir
9049 : determine where add-on library html pages go
9050 : There is no standard location, so try to copy the previously-selected
9051 : directory structure for the core html pages.
9052 case "$sitehtml3dir" in
9053 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9054 *) dflt=$sitehtml3dir ;;
9057 ''|' ') dflt=none ;;
9060 rp='Pathname where the site-specific library html pages should be installed?'
9062 prefixvar=sitehtml3dir
9065 : determine where add-on manual pages go
9066 case "$siteman1dir" in
9067 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
9068 *) dflt=$siteman1dir ;;
9071 ''|' ') dflt=none ;;
9074 rp='Pathname where the site-specific manual pages should be installed?'
9076 prefixvar=siteman1dir
9079 : determine where add-on library man pages go
9080 case "$siteman3dir" in
9081 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
9082 *) dflt=$siteman3dir ;;
9085 ''|' ') dflt=none ;;
9088 rp='Pathname where the site-specific library manual pages should be installed?'
9090 prefixvar=siteman3dir
9093 : determine where add-on public executable scripts go
9094 case "$sitescript" in
9095 '') dflt=$siteprefix/script
9096 $test -d $dflt || dflt=$sitebin ;;
9097 *) dflt="$sitescript" ;;
9100 rp='Pathname where add-on public executable scripts should be installed?'
9102 prefixvar=sitescript
9105 : Check if faststdio is requested and available
9106 case "$usefaststdio" in
9107 $define|true|[yY]*|'')
9108 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
9118 Perl can be built to use 'fast stdio', which means using the stdio
9119 library but also directly manipulating the stdio buffers to enable
9120 faster I/O. Using stdio is better for backward compatibility (especially
9121 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
9122 interface has been preferred instead of stdio.
9124 If this doesn't make any sense to you, just accept the default '$dflt'.
9126 rp='Use the "fast stdio" if available?'
9129 y|Y) val="$define" ;;
9136 : define an is-a-typedef? function
9137 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9139 "") inclist="sys/types.h";;
9141 eval "varval=\$$var";
9145 for inc in $inclist; do
9146 echo "#include <$inc>" >>temp.c;
9148 echo "#ifdef $type" >> temp.c;
9149 echo "printf(\"We have $type\");" >> temp.c;
9150 echo "#endif" >> temp.c;
9151 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9152 if $contains $type temp.E >/dev/null 2>&1; then
9158 *) eval "$var=\$varval";;
9161 : define an is-a-typedef? function that prompts if the type is not available.
9162 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9164 "") inclist="sys/types.h";;
9166 eval "varval=\$$var";
9170 for inc in $inclist; do
9171 echo "#include <$inc>" >>temp.c;
9173 echo "#ifdef $type" >> temp.c;
9174 echo "printf(\"We have $type\");" >> temp.c;
9175 echo "#endif" >> temp.c;
9176 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9178 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
9179 if $contains $type temp.E >/dev/null 2>&1; then
9180 echo "$type found." >&4;
9183 echo "$type NOT found." >&4;
9189 *) eval "$var=\$varval";;
9192 : see what type lseek is declared as in the kernel
9193 rp="What is the type used for lseek's offset on this system?"
9194 set off_t lseektype long stdio.h sys/types.h
9198 echo "Checking to see how big your file offsets are..." >&4
9200 #include <sys/types.h>
9204 printf("%d\n", (int)sizeof($lseektype));
9209 if eval $compile_ok; then
9210 lseeksize=`$run ./try`
9211 echo "Your file offsets are $lseeksize bytes long."
9215 echo "(I can't seem to compile the test program. Guessing...)"
9216 rp="What is the size of your file offsets (in bytes)?"
9222 : see what type file positions are declared as in the library
9223 rp="What is the type for file position used by fsetpos()?"
9224 set fpos_t fpostype long stdio.h sys/types.h
9227 : Check size for Fpos_t
9230 *_t) zzz="$fpostype" ;;
9233 echo "Checking the size of $zzz..." >&4
9235 #include <sys/types.h>
9242 printf("%d\n", (int)sizeof($fpostype));
9247 if eval $compile_ok; then
9251 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9254 echo "Your $zzz is $fpossize bytes long."
9260 echo "(I can't compile the test program. Guessing...)" >&4
9261 rp="What is the size of your file positions (in bytes)?"
9266 : Check for large file support
9267 # Backward compatibility (uselfs is deprecated).
9269 "$define"|true|[yY]*)
9272 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9274 uselargefiles="$define"
9278 case "$lseeksize:$fpossize" in
9281 You can have files larger than 2 gigabytes.
9284 *) case "$uselargefiles" in
9285 "$undef"|false|[nN]*) dflt='n' ;;
9290 Perl can be built to understand large files (files larger than 2 gigabytes)
9291 on some systems. To do so, Configure can be run with -Duselargefiles.
9293 If this doesn't make any sense to you, just accept the default '$dflt'.
9295 rp='Try to understand large files, if available?'
9298 y|Y) val="$define" ;;
9305 : Look for a hint-file generated 'call-back-unit'. If the
9306 : user has specified that a large files perl is to be built,
9307 : we may need to set or change some other defaults.
9308 if $test -f uselargefiles.cbu; then
9309 echo "Your platform has some specific hints regarding large file builds, using them..."
9310 . ./uselargefiles.cbu
9312 case "$uselargefiles" in
9314 if $test -f uselargefiles.cbu; then
9316 echo "Rechecking to see how big your file offsets are..." >&4
9318 #include <sys/types.h>
9322 printf("%d\n", (int)sizeof($lseektype));
9327 if eval $compile_ok; then
9328 lseeksize=`$run ./try`
9329 $echo "Your file offsets are now $lseeksize bytes long."
9333 echo "(I can't seem to compile the test program. Guessing...)"
9334 rp="What is the size of your file offsets (in bytes)?"
9339 *_t) zzz="$fpostype" ;;
9342 $echo $n "Rechecking the size of $zzz...$c" >&4
9344 #include <sys/types.h>
9351 printf("%d\n", (int)sizeof($fpostype));
9356 if eval $compile_ok; then
9361 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9364 echo " $fpossize bytes." >&4
9370 echo "(I can't compile the test program. Guessing...)" >&4
9371 rp="What is the size of your file positions (in bytes)?"
9380 : Check if we want perlio
9383 : Set the vendorbin variables
9384 case "$vendorprefix" in
9385 '') d_vendorbin="$undef"
9389 *) d_vendorbin="$define"
9390 : determine where vendor-supplied executables go.
9391 case "$vendorbin" in
9392 '') dflt=$vendorprefix/bin ;;
9393 *) dflt="$vendorbin" ;;
9396 rp='Pathname for the vendor-supplied executables directory?'
9399 vendorbinexp="$ansexp"
9405 : Set the vendorhtml1dir variables
9406 case "$vendorprefix" in
9407 '') vendorhtml1dir=''
9408 vendorhtml1direxp=''
9410 *) : determine where vendor-supplied html pages go.
9411 : There is no standard location, so try to copy the previously-selected
9412 : directory structure for the core html pages.
9413 : XXX Better default suggestions would be welcome.
9414 case "$vendorhtml1dir" in
9415 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9416 *) dflt=$vendorhtml1dir ;;
9419 ''|' ') dflt=none ;;
9422 rp='Pathname for the vendor-supplied html pages?'
9424 vendorhtml1dir="$ans"
9425 vendorhtml1direxp="$ansexp"
9428 : Use ' ' for none so value is preserved next time through Configure
9429 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9430 prefixvar=vendorhtml1dir
9433 : Set the vendorhtml3dir variables
9434 case "$vendorprefix" in
9435 '') vendorhtml3dir=''
9436 vendorhtml3direxp=''
9438 *) : determine where vendor-supplied module html pages go.
9439 : There is no standard location, so try to copy the previously-selected
9440 : directory structure for the core html pages.
9441 : XXX Better default suggestions would be welcome.
9442 case "$vendorhtml3dir" in
9443 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9444 *) dflt=$vendorhtml3dir ;;
9447 ''|' ') dflt=none ;;
9450 rp='Pathname for the vendor-supplied html pages?'
9452 vendorhtml3dir="$ans"
9453 vendorhtml3direxp="$ansexp"
9456 : Use ' ' for none so value is preserved next time through Configure
9457 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9458 prefixvar=vendorhtml3dir
9461 : Set the vendorman1dir variables
9462 case "$vendorprefix" in
9463 '') vendorman1dir=''
9466 *) : determine where vendor-supplied manual pages go.
9467 case "$vendorman1dir" in
9468 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9469 *) dflt=$vendorman1dir ;;
9472 ''|' ') dflt=none ;;
9475 rp='Pathname for the vendor-supplied manual section 1 pages?'
9477 vendorman1dir="$ans"
9478 vendorman1direxp="$ansexp"
9481 : Use ' ' for none so value is preserved next time through Configure
9482 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9483 prefixvar=vendorman1dir
9486 : Set the vendorman3dir variables
9487 case "$vendorprefix" in
9488 '') vendorman3dir=''
9491 *) : determine where vendor-supplied module manual pages go.
9492 case "$vendorman3dir" in
9493 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9494 *) dflt=$vendorman3dir ;;
9497 ''|' ') dflt=none ;;
9500 rp='Pathname for the vendor-supplied manual section 3 pages?'
9502 vendorman3dir="$ans"
9503 vendorman3direxp="$ansexp"
9506 : Use ' ' for none so value is preserved next time through Configure
9507 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9508 prefixvar=vendorman3dir
9511 : Set the vendorscript variables
9512 case "$vendorprefix" in
9513 '') d_vendorscript="$undef"
9517 *) d_vendorscript="$define"
9518 : determine where vendor-supplied scripts go.
9519 case "$vendorscript" in
9520 '') dflt=$vendorprefix/script
9521 $test -d $dflt || dflt=$vendorbin ;;
9522 *) dflt="$vendorscript" ;;
9526 The installation process will create a directory for
9527 vendor-supplied scripts.
9531 rp='Pathname for the vendor-supplied scripts directory?'
9534 vendorscriptexp="$ansexp"
9537 prefixvar=vendorscript
9540 : script used to emit important warnings
9543 if test \$# -gt 0; then
9548 echo "*** WARNING:" >&4
9549 sed -e 's/^/*** /' <msg >&4
9551 cat msg >>config.msg
9552 echo " " >>config.msg
9558 : see which of string.h or strings.h is needed
9560 strings=`./findhdr string.h`
9561 if $test "$strings" && $test -r "$strings"; then
9562 echo "Using <string.h> instead of <strings.h>." >&4
9566 strings=`./findhdr strings.h`
9567 if $test "$strings" && $test -r "$strings"; then
9568 echo "Using <strings.h> instead of <string.h>." >&4
9570 ./warn "No string header found -- You'll surely have problems."
9576 "$undef") strings=`./findhdr strings.h`;;
9577 *) strings=`./findhdr string.h`;;
9580 : see if qgcvt exists
9584 : Check print/scan long double stuff
9587 if $test X"$d_longdbl" = X"$define"; then
9589 echo "Checking how to print long doubles..." >&4
9591 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
9592 $cat >try.c <<'EOCP'
9593 #include <sys/types.h>
9597 printf("%.3f\n", d);
9601 if eval $compile; then
9605 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
9606 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
9607 echo "We will use %f."
9613 if $test X"$sPRIfldbl" = X; then
9614 $cat >try.c <<'EOCP'
9615 #include <sys/types.h>
9618 long double d = 123.456;
9619 printf("%.3Lf\n", d);
9623 if eval $compile; then
9627 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
9628 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
9629 echo "We will use %Lf."
9635 if $test X"$sPRIfldbl" = X; then
9636 $cat >try.c <<'EOCP'
9637 #include <sys/types.h>
9640 long double d = 123.456;
9641 printf("%.3llf\n", d);
9645 if eval $compile; then
9649 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
9650 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
9651 echo "We will use %llf."
9657 if $test X"$sPRIfldbl" = X; then
9658 $cat >try.c <<'EOCP'
9659 #include <sys/types.h>
9662 long double d = 123.456;
9663 printf("%.3lf\n", d);
9667 if eval $compile; then
9671 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
9672 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
9673 echo "We will use %lf."
9679 if $test X"$sPRIfldbl" = X; then
9680 echo "Cannot figure out how to print long doubles." >&4
9682 sSCNfldbl=$sPRIfldbl # expect consistency
9689 case "$sPRIfldbl" in
9690 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
9691 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
9692 d_SCNfldbl="$undef";
9694 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
9695 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
9696 d_SCNfldbl="$define";
9700 : Check how to convert floats to strings.
9702 if test "X$d_Gconvert" = X; then
9705 echo "Checking for an efficient way to convert floats to strings."
9707 case "$uselongdouble" in
9708 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
9710 case "$d_longdbl" in
9711 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
9713 case "$d_PRIgldbl" in
9714 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
9718 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
9719 char *myname = "gconvert";
9722 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
9723 char *myname = "gcvt";
9726 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
9727 char *myname = "qgcvt";
9728 #define DOUBLETYPE long double
9731 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9733 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
9735 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
9738 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
9740 char *myname = "sprintf";
9744 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9745 #define DOUBLETYPE long double
9747 #define DOUBLETYPE double
9759 # include <string.h>
9761 # include <strings.h>
9764 int checkit(char *expect, char *got)
9766 if (strcmp(expect, got)) {
9767 printf("%s oddity: Expected %s, got %s\n",
9768 myname, expect, got);
9778 /* This must be 1st test on (which?) platform */
9779 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
9780 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
9781 checkit("0.1", buf);
9783 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
9784 checkit("0.01", buf);
9786 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
9787 checkit("0.001", buf);
9789 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
9790 checkit("0.0001", buf);
9792 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
9793 if (strlen(buf) > 5)
9794 checkit("9e-005", buf); /* for Microsoft ?? */
9796 checkit("9e-05", buf);
9798 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
9801 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
9802 checkit("1.1", buf);
9804 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
9805 checkit("1.01", buf);
9807 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
9808 checkit("1.001", buf);
9810 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
9811 checkit("1.0001", buf);
9813 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
9814 checkit("1.00001", buf);
9816 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
9817 checkit("1.000001", buf);
9819 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
9822 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
9825 /* Some Linux gcvt's give 1.e+5 here. */
9826 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
9827 checkit("100000", buf);
9829 /* Some Linux gcvt's give -1.e+5 here. */
9830 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
9831 checkit("-100000", buf);
9833 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
9834 checkit("123.456", buf);
9836 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
9837 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
9838 /* 34 should be enough to scare even long double
9839 * places into using the e notation. */
9840 if (strlen(buf) > 5)
9841 checkit("1e+034", buf); /* for Microsoft */
9843 checkit("1e+34", buf);
9845 /* For Perl, if you add additional tests here, also add them to
9846 * t/base/num.t for benefit of platforms not using Configure or
9847 * overriding d_Gconvert */
9852 : first add preferred functions to our list
9854 for xxx_convert in $gconvert_preference; do
9855 case $xxx_convert in
9856 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
9857 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
9860 : then add any others
9861 for xxx_convert in gconvert gcvt sprintf; do
9864 *) xxx_list="$xxx_list $xxx_convert" ;;
9868 case "$d_longdbl$uselongdouble" in
9870 : again, add preferred functions to our list first
9872 for xxx_convert in $gconvert_ld_preference; do
9873 case $xxx_convert in
9874 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9875 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
9878 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
9879 for xxx_convert in qgcvt sprintf $xxx_list; do
9880 case "$xxx_ld_list" in
9881 $xxx_convert*|*" $xxx_convert"*) ;;
9882 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9885 : if sprintf cannot do long doubles, move it to the end
9886 if test "$d_PRIgldbl" != "$define"; then
9887 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
9889 : if no qgcvt, remove it
9890 if test "$d_qgcvt" != "$define"; then
9891 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
9894 xxx_list="$xxx_ld_list"
9898 for xxx_convert in $xxx_list; do
9899 echo "Trying $xxx_convert..."
9900 $rm -f try try$_o core
9901 set try -DTRY_$xxx_convert
9902 if eval $compile; then
9903 echo "$xxx_convert() found." >&4
9905 echo "I'll use $xxx_convert to convert floats into a string." >&4
9908 echo "...But $xxx_convert didn't work as I expected."
9912 echo "$xxx_convert NOT found." >&4
9916 if test X$xxx_convert = X; then
9917 echo "*** WHOA THERE!!! ***" >&4
9918 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
9922 case "$xxx_convert" in
9923 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
9924 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
9925 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
9926 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
9927 "$define$define$define")
9928 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
9929 "$define$define$undef")
9930 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
9931 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
9939 : see if _fwalk exists
9943 : Initialize h_fcntl
9946 : Initialize h_sysfile
9949 : access call always available on UNIX
9953 : locate the flags for 'access()'
9957 $cat >access.c <<EOCP
9958 #include <sys/types.h>
9963 #include <sys/file.h>
9976 : check sys/file.h first, no particular reason here
9977 if $test `./findhdr sys/file.h` && \
9978 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
9980 echo "<sys/file.h> defines the *_OK access constants." >&4
9981 elif $test `./findhdr fcntl.h` && \
9982 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
9984 echo "<fcntl.h> defines the *_OK access constants." >&4
9985 elif $test `./findhdr unistd.h` && \
9986 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
9987 echo "<unistd.h> defines the *_OK access constants." >&4
9989 echo "I can't find the four *_OK access constants--I'll use mine." >&4
9995 : see if accessx exists
9996 set accessx d_accessx
9999 : see if aintl exists
10003 : see if alarm exists
10007 : see if 64bit time functions exists
10009 set ctime64 d_ctime64
10012 set localtime64 d_localtime64
10015 set gmtime64 d_gmtime64
10018 set mktime64 d_mktime64
10021 set difftime64 d_difftime64
10024 set asctime64 d_asctime64
10027 : see if POSIX threads are available
10028 set pthread.h i_pthread
10031 : define a function to check prototypes
10032 $cat > protochk <<EOSH
10035 optimize="$optimize"
10037 prototype="$prototype"
10040 usethreads=$usethreads
10041 i_pthread=$i_pthread
10042 pthread_h_first=$pthread_h_first
10045 $cat >> protochk <<'EOSH'
10050 while test $# -ge 2; do
10052 $define) echo "#include <$2>" >> try.c ;;
10053 literal) echo "$2" >> try.c ;;
10055 # Extra magic for the benefit of systems that need pthread.h
10056 # to be included early to correctly detect threadsafe functions.
10057 # Such functions must guarantee themselves, though, that the usethreads
10058 # and i_pthread have been defined, before calling protochk.
10059 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
10060 echo "#include <pthread.h>" >> try.c
10065 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
10066 cat >> try.c <<'EOCP'
10067 #ifdef CAN_PROTOTYPE
10068 #define _(args) args
10073 echo "$foo" >> try.c
10074 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
10075 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
10081 $eunicefix protochk
10083 : Define hasproto macro for Configure internal use
10084 hasproto='varname=$1; func=$2; shift; shift;
10085 while $test $# -ge 2; do
10087 $define) echo "#include <$2>";;
10091 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
10092 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
10093 echo "$func() prototype found.";
10096 echo "$func() prototype NOT found.";
10103 : see if sys/types.h has to be included
10104 set sys/types.h i_systypes
10107 : see if sys/select.h has to be included
10108 set sys/select.h i_sysselct
10111 : Define hasfield macro for Configure internal use
10112 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
10113 while $test $# -ge 2; do
10115 $define) echo "#include <$2>";;
10119 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
10121 if eval $compile; then
10130 : see if we should include time.h, sys/time.h, or both
10132 if test "X$timeincl" = X; then
10133 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
10134 $echo $n "I'm now running the test program...$c"
10136 #include <sys/types.h>
10141 #ifdef SYSTIMEKERNEL
10144 #include <sys/time.h>
10147 #include <sys/select.h>
10149 #$i_stdlib I_STDLIB
10151 #include <stdlib.h>
10157 struct timeval bar;
10160 struct timezone tzp;
10162 if (foo.tm_sec == foo.tm_sec)
10165 if (bar.tv_sec == bar.tv_sec)
10172 for s_timezone in '-DS_TIMEZONE' ''; do
10174 for s_timeval in '-DS_TIMEVAL' ''; do
10175 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10176 for i_time in '' '-DI_TIME'; do
10177 for i_systime in '-DI_SYSTIME' ''; do
10180 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10181 if eval $compile; then
10182 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
10186 $echo $n "Succeeded with $flags$c"
10198 *SYSTIMEKERNEL*) i_systimek="$define"
10199 timeincl=`./findhdr sys/time.h`
10200 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10201 *) i_systimek="$undef";;
10204 *I_TIME*) i_time="$define"
10205 timeincl=`./findhdr time.h`" $timeincl"
10206 echo "We'll include <time.h>." >&4;;
10207 *) i_time="$undef";;
10210 *I_SYSTIME*) i_systime="$define"
10211 timeincl=`./findhdr sys/time.h`" $timeincl"
10212 echo "We'll include <sys/time.h>." >&4;;
10213 *) i_systime="$undef";;
10217 : see if struct tm knows about tm_zone
10218 case "$i_systime$i_time" in
10221 echo "Checking to see if your struct tm has tm_zone field..." >&4
10222 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
10230 case "$d_tm_tm_zone" in
10231 "$define") echo "Yes, it does." ;;
10232 *) echo "No, it doesn't." ;;
10234 : see if struct tm knows about tm_gmtoff
10235 case "$i_systime$i_time" in
10238 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
10239 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
10247 case "$d_tm_tm_gmtoff" in
10248 "$define") echo "Yes, it does." ;;
10249 *) echo "No, it doesn't." ;;
10252 : see if asctime_r exists
10253 set asctime_r d_asctime_r
10255 case "$d_asctime_r" in
10257 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10258 case "$d_asctime_r_proto:$usethreads" in
10259 ":define") d_asctime_r_proto=define
10260 set d_asctime_r_proto asctime_r $hdrs
10264 case "$d_asctime_r_proto" in
10266 case "$asctime_r_proto" in
10267 ''|0) try='char* asctime_r(const struct tm*, char*);'
10268 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SB ;;
10270 case "$asctime_r_proto" in
10271 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
10272 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SBI ;;
10274 case "$asctime_r_proto" in
10275 ''|0) try='int asctime_r(const struct tm*, char*);'
10276 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SB ;;
10278 case "$asctime_r_proto" in
10279 ''|0) try='int asctime_r(const struct tm*, char*, int);'
10280 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SBI ;;
10282 case "$asctime_r_proto" in
10283 ''|0) d_asctime_r=undef
10285 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
10286 * ) case "$asctime_r_proto" in
10287 REENTRANT_PROTO*) ;;
10288 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
10290 echo "Prototype: $try" ;;
10293 *) case "$usethreads" in
10294 define) echo "asctime_r has no prototype, not using it." >&4 ;;
10301 *) asctime_r_proto=0
10305 : see if atolf exists
10309 : see if atoll exists
10313 : Look for GCC-style attribute format
10314 case "$d_attribute_format" in
10317 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
10318 $cat >attrib.c <<'EOCP'
10320 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
10322 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10323 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10324 echo "Your C compiler doesn't support __attribute__((format))."
10327 echo "Your C compiler supports __attribute__((format))."
10331 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10335 *) val="$d_attribute_format" ;;
10337 set d_attribute_format
10341 : Look for GCC-style attribute format with null format allowed
10342 case "$d_printf_format_null" in
10343 '') case "$d_attribute_format" in
10346 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
10347 $cat >attrib.c <<EOCP
10349 #$i_stdlib I_STDLIB
10351 #include <stdlib.h>
10353 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
10354 int null_printf (char* pat,...) { return (int)pat; }
10355 int main () { exit(null_printf(NULL)); }
10357 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
10358 : run the executable in case it produces a run-time warning
10359 if $run ./attrib >>attrib.out 2>&1; then
10360 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10361 echo "Your C compiler doesn't allow __printf__ format to be null."
10364 echo "Your C compiler allows __printf__ format to be null."
10368 echo "Your C compiler executable failed with __printf__ format null."
10372 echo "Your C compiler fails with __printf__ format null."
10379 *) val="$d_printf_format_null" ;;
10381 set d_printf_format_null
10385 : Look for GCC-style attribute malloc
10386 case "$d_attribute_malloc" in
10389 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
10390 $cat >attrib.c <<'EOCP'
10392 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
10394 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10395 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10396 echo "Your C compiler doesn't support __attribute__((malloc))."
10399 echo "Your C compiler supports __attribute__((malloc))."
10403 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10407 *) val="$d_attribute_malloc" ;;
10409 set d_attribute_malloc
10413 : Look for GCC-style attribute nonnull
10414 case "$d_attribute_nonnull" in
10417 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
10418 $cat >attrib.c <<'EOCP'
10420 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
10422 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10423 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10424 echo "Your C compiler doesn't support __attribute__((nonnull))."
10427 echo "Your C compiler supports __attribute__((nonnull))."
10431 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10435 *) val="$d_attribute_nonnull" ;;
10437 set d_attribute_nonnull
10441 : Look for GCC-style attribute noreturn
10442 case "$d_attribute_noreturn" in
10445 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
10446 $cat >attrib.c <<'EOCP'
10448 void fall_over_dead( void ) __attribute__((noreturn));
10450 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10451 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10452 echo "Your C compiler doesn't support __attribute__((noreturn))."
10455 echo "Your C compiler supports __attribute__((noreturn))."
10459 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10463 *) val="$d_attribute_noreturn" ;;
10465 set d_attribute_noreturn
10469 : Look for GCC-style attribute pure
10470 case "$d_attribute_pure" in
10473 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
10474 $cat >attrib.c <<'EOCP'
10476 int square( int n ) __attribute__((pure));
10478 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10479 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10480 echo "Your C compiler doesn't support __attribute__((pure))."
10483 echo "Your C compiler supports __attribute__((pure))."
10487 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10491 *) val="$d_attribute_pure" ;;
10493 set d_attribute_pure
10497 : Look for GCC-style attribute unused
10498 case "$d_attribute_unused" in
10501 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
10502 $cat >attrib.c <<'EOCP'
10504 int do_something( int dummy __attribute__((unused)), int n );
10506 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10507 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10508 echo "Your C compiler doesn't support __attribute__((unused))."
10511 echo "Your C compiler supports __attribute__((unused))."
10515 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10519 *) val="$d_attribute_unused" ;;
10521 set d_attribute_unused
10525 : Look for GCC-style attribute deprecated
10526 case "$d_attribute_deprecated" in
10529 echo "Checking whether your compiler can handle __attribute__((deprecated)) ..." >&4
10530 $cat >attrib.c <<'EOCP'
10532 int I_am_deprecated(void) __attribute__((deprecated));
10534 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10535 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10536 echo "Your C compiler doesn't support __attribute__((deprecated))."
10539 echo "Your C compiler supports __attribute__((deprecated))."
10543 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10547 *) val="$d_attribute_deprecated" ;;
10549 set d_attribute_deprecated
10553 : Look for GCC-style attribute warn_unused_result
10554 case "$d_attribute_warn_unused_result" in
10557 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
10558 $cat >attrib.c <<'EOCP'
10560 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
10562 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10563 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10564 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
10567 echo "Your C compiler supports __attribute__((warn_unused_result))."
10571 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10575 *) val="$d_attribute_warn_unused_result" ;;
10577 set d_attribute_warn_unused_result
10581 : see if bcmp exists
10585 : see if bcopy exists
10589 : see if getpgrp exists
10590 set getpgrp d_getpgrp
10593 case "$d_getpgrp" in
10596 echo "Checking to see which flavor of getpgrp is in use..."
10598 #$i_unistd I_UNISTD
10599 #include <sys/types.h>
10601 # include <unistd.h>
10603 #$i_stdlib I_STDLIB
10605 #include <stdlib.h>
10609 if (getuid() == 0) {
10610 printf("(I see you are running Configure as super-user...)\n");
10613 #ifdef TRY_BSD_PGRP
10614 if (getpgrp(1) == 0)
10623 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10624 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
10626 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10627 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
10630 echo "I can't seem to compile and run the test program."
10632 xxx="a USG one, i.e. you use getpgrp()."
10634 # SVR4 systems can appear rather BSD-ish.
10635 case "$i_unistd" in
10637 xxx="a BSD one, i.e. you use getpgrp(pid)."
10641 xxx="probably a USG one, i.e. you use getpgrp()."
10646 echo "Assuming your getpgrp is $xxx" >&4
10655 : see if setpgrp exists
10656 set setpgrp d_setpgrp
10659 case "$d_setpgrp" in
10662 echo "Checking to see which flavor of setpgrp is in use..."
10664 #$i_unistd I_UNISTD
10665 #include <sys/types.h>
10667 # include <unistd.h>
10669 #$i_stdlib I_STDLIB
10671 #include <stdlib.h>
10675 if (getuid() == 0) {
10676 printf("(I see you are running Configure as super-user...)\n");
10679 #ifdef TRY_BSD_PGRP
10680 if (-1 == setpgrp(1, 1))
10683 if (setpgrp() != -1)
10689 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10690 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
10692 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10693 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
10696 echo "(I can't seem to compile and run the test program.)"
10698 xxx="a USG one, i.e. you use setpgrp()."
10700 # SVR4 systems can appear rather BSD-ish.
10701 case "$i_unistd" in
10703 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
10707 xxx="probably a USG one, i.e. you use setpgrp()."
10712 echo "Assuming your setpgrp is $xxx" >&4
10721 : Look for GCC-style __builtin_choose_expr
10722 case "$d_builtin_choose_expr" in
10725 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
10726 $cat >try.c <<'EOCP'
10727 #include <assert.h>
10728 #include <stdlib.h>
10731 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
10734 assert( SYRINX(1) == 2112 );
10735 assert( SYRINX(1) != 5150 );
10736 assert( SYRINX(0) == 5150 );
10737 assert( SYRINX(0) != 2112 );
10738 puts( "All good!" );
10744 if eval $compile && $run ./try; then
10745 echo "Your C compiler supports __builtin_choose_expr."
10748 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10752 *) val="$d_builtin_choose_expr" ;;
10755 set d_builtin_choose_expr
10759 : Look for GCC-style __builtin_expect
10760 case "$d_builtin_expect" in
10763 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
10764 $cat >try.c <<'EOCP'
10767 if ( __builtin_expect(n, 0) ) n = 1;
10768 /* Remember shell exit code truth is 0, C truth is non-zero */
10773 if eval $compile && $run ./try; then
10774 echo "Your C compiler supports __builtin_expect."
10777 echo "Your C compiler doesn't seem to understand __builtin_expect."
10781 *) val="$d_builtin_expect" ;;
10784 set d_builtin_expect
10788 : see if bzero exists
10792 : see if stdarg is available
10794 if $test `./findhdr stdarg.h`; then
10795 echo "<stdarg.h> found." >&4
10798 echo "<stdarg.h> NOT found." >&4
10802 : see if varags is available
10804 if $test `./findhdr varargs.h`; then
10805 echo "<varargs.h> found." >&4
10807 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
10810 : set up the varargs testing programs
10811 $cat > varargs.c <<EOP
10813 #include <stdarg.h>
10816 #include <varargs.h>
10820 int f(char *p, ...)
10834 p = va_arg(ap, char *);
10840 $cat > varargs <<EOP
10842 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
10851 : now check which varargs header should be included
10856 if `./varargs I_STDARG`; then
10858 elif `./varargs I_VARARGS`; then
10863 if `./varargs I_VARARGS`; then
10870 echo "I could not find the definition for va_dcl... You have problems..." >&4
10871 val="$undef"; set i_stdarg; eval $setvar
10872 val="$undef"; set i_varargs; eval $setvar
10877 case "$i_varhdr" in
10879 val="$define"; set i_stdarg; eval $setvar
10880 val="$undef"; set i_varargs; eval $setvar
10883 val="$undef"; set i_stdarg; eval $setvar
10884 val="$define"; set i_varargs; eval $setvar
10887 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
10891 : see if the Compiler supports C99 variadic macros
10892 case "$i_stdarg$i_stdlib" in
10894 echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
10897 #include <stdarg.h>
10899 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
10903 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
10909 if eval $compile && $run ./try 2>&1 >/dev/null; then
10910 case "`$run ./try`" in
10912 echo "You have C99 variadic macros." >&4
10913 d_c99_variadic_macros="$define"
10916 echo "You don't have functional C99 variadic macros." >&4
10917 d_c99_variadic_macros="$undef"
10921 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
10922 d_c99_variadic_macros="$undef"
10927 echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
10928 d_c99_variadic_macros="$undef"
10932 : see if signal is declared as pointer to function returning int or void
10934 xxx=`./findhdr signal.h`
10935 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
10936 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10937 echo "You have int (*signal())() instead of void." >&4
10939 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10940 echo "You have void (*signal())()." >&4
10942 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
10943 echo "You have int (*signal())() instead of void." >&4
10945 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
10946 echo "You have void (*signal())()." >&4
10949 case "$d_voidsig" in
10951 echo "I can't determine whether signal handler returns void or int..." >&4
10953 rp="What type does your signal handler return?"
10956 v*) val="$define";;
10960 echo "As you already told me, signal handler returns void." >&4
10963 *) echo "As you already told me, signal handler returns int." >&4
10970 case "$d_voidsig" in
10971 "$define") signal_t="void";;
10972 *) signal_t="int";;
10976 : check for ability to cast large floats to 32-bit ints.
10978 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
10979 if $test "$intsize" -ge 4; then
10986 #$i_stdlib I_STDLIB
10988 #include <stdlib.h>
10990 #include <sys/types.h>
10991 #include <signal.h>
10992 $signal_t blech(int s) { exit(3); }
10999 signal(SIGFPE, blech);
11001 /* Don't let compiler optimize the test away. Store the number
11002 in a writable string for gcc to pass to sscanf under HP-UX.
11004 sprintf(str, "2147483647");
11005 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
11009 /* x86 processors will probably give 0x8000 0000, which is a
11010 sign change. We don't want that. We want to mimic SPARC
11011 behavior here, which is to preserve the sign and give
11014 if (i32 != ($xxx) f)
11020 if eval $compile_ok; then
11024 echo "(I can't seem to compile the test program--assuming it can't)"
11029 echo "Yup, it can."
11032 echo "Nope, it can't."
11039 : check for ability to cast negative floats to unsigned
11041 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
11044 #$i_stdlib I_STDLIB
11046 #include <stdlib.h>
11048 #include <sys/types.h>
11049 #include <signal.h>
11050 $signal_t blech(int s) { exit(7); }
11051 $signal_t blech_in_list(int s) { exit(4); }
11052 unsigned long dummy_long(unsigned long p) { return p; }
11053 unsigned int dummy_int(unsigned int p) { return p; }
11054 unsigned short dummy_short(unsigned short p) { return p; }
11058 unsigned long along;
11060 unsigned short ashort;
11064 /* Frustrate gcc-2.7.2's optimizer which failed this test with
11065 a direct f = -123. assignment. gcc-2.8.0 reportedly
11066 optimized the whole file away
11068 /* Store the number in a writable string for gcc to pass to
11069 sscanf under HP-UX.
11071 sprintf(str, "-123");
11072 sscanf(str, "%lf", &f); /* f = -123.; */
11074 signal(SIGFPE, blech);
11075 along = (unsigned long)f;
11076 aint = (unsigned int)f;
11077 ashort = (unsigned short)f;
11078 if (along != (unsigned long)-123)
11080 if (aint != (unsigned int)-123)
11082 if (ashort != (unsigned short)-123)
11084 sprintf(str, "1073741824.");
11085 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
11088 along = (unsigned long)f;
11089 if (along != 0x80000000)
11093 along = (unsigned long)f;
11094 if (along != 0x7fffffff)
11098 along = (unsigned long)f;
11099 if (along != 0x80000001)
11103 signal(SIGFPE, blech_in_list);
11104 sprintf(str, "123.");
11105 sscanf(str, "%lf", &f); /* f = 123.; */
11106 along = dummy_long((unsigned long)f);
11107 aint = dummy_int((unsigned int)f);
11108 ashort = dummy_short((unsigned short)f);
11109 if (along != (unsigned long)123)
11111 if (aint != (unsigned int)123)
11113 if (ashort != (unsigned short)123)
11120 if eval $compile_ok; then
11124 echo "(I can't seem to compile the test program--assuming it can't)"
11127 case "$castflags" in
11129 echo "Yup, it can."
11132 echo "Nope, it can't."
11139 : see if vprintf exists
11141 if set vprintf val -f d_vprintf; eval $csym; $val; then
11142 echo 'vprintf() found.' >&4
11145 #$i_stdarg I_STDARG /* Only one of these can be defined by i_varhrd */
11146 #$i_varargs I_VARARGS
11148 #$i_stdlib I_STDLIB
11149 #$i_unistd I_UNISTD
11152 # include <stdarg.h>
11153 #else /* I_VARARGS */
11154 # include <varargs.h>
11158 # include <unistd.h>
11162 # include <stdlib.h>
11165 #include <stdio.h> /* vsprintf prototype */
11168 void xxx(int n, ...)
11173 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11175 int main() { xxx(1, "foo"); }
11177 #else /* I_VARARGS */
11185 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11187 int main() { xxx("foo"); }
11193 if eval $compile_ok; then
11194 if $run ./try; then
11195 echo "Your vsprintf() returns (int)." >&4
11198 echo "Your vsprintf() returns (char*)." >&4
11202 echo 'I am unable to compile the vsprintf() test program.' >&4
11203 # We shouldn't get here. If we do, assume the standard signature,
11204 # not the old BSD one.
11205 echo 'Guessing that vsprintf() returns (int).' >&4
11209 echo 'vprintf() NOT found.' >&4
11220 : see if chown exists
11224 : see if chroot exists
11225 set chroot d_chroot
11228 : see if chsize exists
11229 set chsize d_chsize
11232 : see if class exists
11236 : see if clearenv exists
11237 set clearenv d_clearenv
11240 : Define hasstruct macro for Configure internal use
11241 hasstruct='varname=$1; struct=$2; shift; shift;
11242 while $test $# -ge 2; do
11244 $define) echo "#include <$2>";;
11248 echo "int main () { struct $struct foo; }" >> try.c;
11250 if eval $compile; then
11259 : see whether socket exists
11263 $echo $n "Hmm... $c" >&4
11264 if set socket val -f d_socket; eval $csym; $val; then
11265 echo "Looks like you have Berkeley networking support." >&4
11267 if set setsockopt val -f; eval $csym; $val; then
11270 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
11271 d_oldsock="$define"
11274 if $contains socklib libc.list >/dev/null 2>&1; then
11275 echo "Looks like you have Berkeley networking support." >&4
11277 : we will have to assume that it supports the 4.2 BSD interface
11280 echo "You don't have Berkeley networking in libc$_a..." >&4
11281 if test "X$d_socket" = "X$define"; then
11282 echo "...but you seem to believe that you have sockets." >&4
11284 for net in net socket
11286 if test -f /usr/lib/lib$net$_a; then
11287 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
11288 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
11289 if $contains socket libc.list >/dev/null 2>&1; then
11294 echo "...but the Wollongong group seems to have hacked it in." >&4
11295 sockethdr="-I/usr/netinclude"
11298 echo "Found Berkeley sockets interface in lib$net." >&4
11299 if $contains setsockopt libc.list >/dev/null 2>&1; then
11302 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
11303 d_oldsock="$define"
11309 if test "X$d_socket" != "X$define"; then
11310 echo "or anywhere else I see." >&4
11318 : see if socketpair exists
11319 set socketpair d_sockpair
11324 echo "Checking the availability sa_len in the sock struct ..." >&4
11326 #include <sys/types.h>
11327 #include <sys/socket.h>
11329 struct sockaddr sa;
11330 return (sa.sa_len);
11334 set try; if eval $compile; then
11337 set d_sockaddr_sa_len; eval $setvar
11341 echo "Checking the availability struct sockaddr_in6 ..." >&4
11343 #include <sys/types.h>
11344 #include <sys/socket.h>
11345 #include <netinet/in.h>
11347 struct sockaddr_in6 sin6;
11348 return (sin6.sin6_family);
11352 set try; if eval $compile; then
11355 set d_sockaddr_in6; eval $setvar
11359 echo "Checking the availability sin6_scope_id in struct sockaddr_in6 ..." >&4
11361 #include <sys/types.h>
11362 #include <sys/socket.h>
11363 #include <netinet/in.h>
11365 struct sockaddr_in6 sin6;
11366 return (sin6.sin6_scope_id);
11370 set try; if eval $compile; then
11373 set d_sin6_scope_id; eval $setvar
11377 echo "Checking the availability struct ip_mreq ..." >&4
11379 #include <sys/types.h>
11380 #include <sys/socket.h>
11381 #include <netinet/in.h>
11383 struct ip_mreq mreq;
11384 return (mreq.imr_multiaddr.s_addr);
11388 set try; if eval $compile; then
11391 set d_ip_mreq; eval $setvar
11395 echo "Checking the availability struct ip_mreq_source ..." >&4
11397 #include <sys/types.h>
11398 #include <sys/socket.h>
11399 #include <netinet/in.h>
11401 struct ip_mreq_source mreq;
11402 return (mreq.imr_multiaddr.s_addr);
11406 set try; if eval $compile; then
11409 set d_ip_mreq_source; eval $setvar
11413 echo "Checking the availability struct ipv6_mreq ..." >&4
11415 #include <sys/types.h>
11416 #include <sys/socket.h>
11417 #include <netinet/in.h>
11419 struct ipv6_mreq mreq;
11420 return (mreq.ipv6mr_interface);
11424 set try; if eval $compile; then
11427 set d_ipv6_mreq; eval $setvar
11431 echo "Checking the availability struct ipv6_mreq_source ..." >&4
11433 #include <sys/types.h>
11434 #include <sys/socket.h>
11435 #include <netinet/in.h>
11437 struct ipv6_mreq_source mreq;
11438 return (mreq.imr_multiaddr.s_addr);
11442 set try; if eval $compile; then
11445 set d_ipv6_mreq_source; eval $setvar
11449 echo "Checking the availability of certain socket constants..." >&4
11450 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
11451 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
11453 #include <sys/types.h>
11454 #include <sys/socket.h>
11460 set try; if eval $compile; then
11463 set d_${enum}; eval $setvar
11467 : see if this is a sys/uio.h system
11468 set sys/uio.h i_sysuio
11471 : Check for cmsghdr support
11473 echo "Checking to see if your system supports struct cmsghdr..." >&4
11474 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
11476 case "$d_cmsghdr_s" in
11477 "$define") echo "Yes, it does." ;;
11478 *) echo "No, it doesn't." ;;
11482 : check for const keyword
11484 echo 'Checking to see if your C compiler knows about "const"...' >&4
11485 $cat >const.c <<'EOCP'
11486 typedef struct spug { int drokk; } spug;
11490 const spug y = { 0 };
11493 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
11495 echo "Yup, it does."
11498 echo "Nope, it doesn't."
11503 : see if copysignl exists
11504 set copysignl d_copysignl
11507 : see if crypt exists
11512 $define) cryptlib='' ;;
11513 *) if set crypt val -f d_crypt; eval $csym; $val; then
11514 echo 'crypt() found.' >&4
11518 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
11519 if $test -z "$cryptlib"; then
11520 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
11524 if $test -z "$cryptlib"; then
11525 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
11529 if $test -z "$cryptlib"; then
11530 cryptlib=`./loc libcrypt$_a "" $libpth`
11534 if $test -z "$cryptlib"; then
11535 echo 'crypt() NOT found.' >&4
11546 : see if this is a crypt.h system
11547 set crypt.h i_crypt
11550 : see if crypt_r exists
11551 set crypt_r d_crypt_r
11553 case "$d_crypt_r" in
11555 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
11556 case "$d_crypt_r_proto:$usethreads" in
11557 ":define") d_crypt_r_proto=define
11558 set d_crypt_r_proto crypt_r $hdrs
11562 case "$d_crypt_r_proto" in
11564 case "$crypt_r_proto" in
11565 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
11566 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCS ;;
11568 case "$crypt_r_proto" in
11569 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
11570 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCD ;;
11572 case "$crypt_r_proto" in
11573 ''|0) d_crypt_r=undef
11575 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
11576 * ) case "$crypt_r_proto" in
11577 REENTRANT_PROTO*) ;;
11578 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
11580 echo "Prototype: $try" ;;
11583 *) case "$usethreads" in
11584 define) echo "crypt_r has no prototype, not using it." >&4 ;;
11595 : get csh whereabouts
11597 'csh') val="$undef" ;;
11598 *) val="$define" ;;
11602 : Respect a hint or command line value for full_csh.
11603 case "$full_csh" in
11604 '') full_csh=$csh ;;
11607 : see if ctermid exists
11608 set ctermid d_ctermid
11611 : see if ctermid_r exists
11612 set ctermid_r d_ctermid_r
11614 case "$d_ctermid_r" in
11616 hdrs="$i_systypes sys/types.h define stdio.h "
11617 case "$d_ctermid_r_proto:$usethreads" in
11618 ":define") d_ctermid_r_proto=define
11619 set d_ctermid_r_proto ctermid_r $hdrs
11623 case "$d_ctermid_r_proto" in
11625 case "$ctermid_r_proto" in
11626 ''|0) try='char* ctermid_r(char*);'
11627 ./protochk "$extern_C $try" $hdrs && ctermid_r_proto=B_B ;;
11629 case "$ctermid_r_proto" in
11630 ''|0) d_ctermid_r=undef
11632 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
11633 * ) case "$ctermid_r_proto" in
11634 REENTRANT_PROTO*) ;;
11635 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
11637 echo "Prototype: $try" ;;
11640 *) case "$usethreads" in
11641 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
11648 *) ctermid_r_proto=0
11652 : see if ctime_r exists
11653 set ctime_r d_ctime_r
11655 case "$d_ctime_r" in
11657 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
11658 case "$d_ctime_r_proto:$usethreads" in
11659 ":define") d_ctime_r_proto=define
11660 set d_ctime_r_proto ctime_r $hdrs
11664 case "$d_ctime_r_proto" in
11666 case "$ctime_r_proto" in
11667 ''|0) try='char* ctime_r(const time_t*, char*);'
11668 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SB ;;
11670 case "$ctime_r_proto" in
11671 ''|0) try='char* ctime_r(const time_t*, char*, int);'
11672 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SBI ;;
11674 case "$ctime_r_proto" in
11675 ''|0) try='int ctime_r(const time_t*, char*);'
11676 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SB ;;
11678 case "$ctime_r_proto" in
11679 ''|0) try='int ctime_r(const time_t*, char*, int);'
11680 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SBI ;;
11682 case "$ctime_r_proto" in
11683 ''|0) d_ctime_r=undef
11685 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
11686 * ) case "$ctime_r_proto" in
11687 REENTRANT_PROTO*) ;;
11688 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
11690 echo "Prototype: $try" ;;
11693 *) case "$usethreads" in
11694 define) echo "ctime_r has no prototype, not using it." >&4 ;;
11705 : see if cuserid exists
11706 set cuserid d_cuserid
11709 : see if this is a limits.h system
11710 set limits.h i_limits
11713 : see if this is a float.h system
11714 set float.h i_float
11717 : See if number of significant digits in a double precision number is known
11719 $cat >dbl_dig.c <<EOM
11720 #$i_limits I_LIMITS
11723 #include <limits.h>
11729 printf("Contains DBL_DIG");
11732 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
11733 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
11734 echo "DBL_DIG found." >&4
11737 echo "DBL_DIG NOT found." >&4
11744 : see if dbm.h is available
11745 : see if dbmclose exists
11746 set dbmclose d_dbmclose
11749 case "$d_dbmclose" in
11759 *) set rpcsvc/dbm.h i_rpcsvcdbm
11764 *) echo "We won't be including <dbm.h>"
11774 : see if prototype for dbminit is available
11776 set d_dbminitproto dbminit $i_dbm dbm.h
11779 : see if difftime exists
11780 set difftime d_difftime
11783 : see if this is a dirent system
11785 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
11787 echo "<dirent.h> found." >&4
11790 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
11791 echo "<sys/dir.h> found." >&4
11794 xinc=`./findhdr sys/ndir.h`
11796 echo "<dirent.h> NOT found." >&4
11801 : Look for type of directory structure.
11803 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11805 case "$direntrytype" in
11807 case "$i_dirent" in
11808 $define) guess1='struct dirent' ;;
11809 *) guess1='struct direct' ;;
11812 *) guess1="$direntrytype"
11817 'struct dirent') guess2='struct direct' ;;
11818 *) guess2='struct dirent' ;;
11821 if $contains "$guess1" try.c >/dev/null 2>&1; then
11822 direntrytype="$guess1"
11823 echo "Your directory entries are $direntrytype." >&4
11824 elif $contains "$guess2" try.c >/dev/null 2>&1; then
11825 direntrytype="$guess2"
11826 echo "Your directory entries seem to be $direntrytype." >&4
11828 echo "I don't recognize your system's directory entries." >&4
11829 rp="What type is used for directory entries on this system?"
11832 direntrytype="$ans"
11836 : see if the directory entry stores field length
11838 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11839 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
11840 echo "Good, your directory entry keeps length information in d_namlen." >&4
11843 echo "Your directory entry does not know about the d_namlen field." >&4
11850 : Look for DIR.dd_fd
11851 case "$i_dirent" in
11853 echo "Checking to see if DIR has a dd_fd member variable" >&4
11855 #$i_stdlib I_STDLIB
11857 #include <stdlib.h>
11859 #include <dirent.h>
11869 if eval $compile; then
11870 echo "Yes, it does."
11873 echo "No, it does not."
11878 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
11886 : see if this is an sysdir system
11887 set sys/dir.h i_sysdir
11890 : see if this is an sysndir system
11891 set sys/ndir.h i_sysndir
11896 $cat >dirfd.c <<EOM
11898 #$i_stdlib I_STDLIB
11900 #include <stdlib.h>
11902 #$i_dirent I_DIRENT /**/
11903 #$i_sysdir I_SYS_DIR /**/
11904 #$i_sysndir I_SYS_NDIR /**/
11905 #$i_systypes I_SYS_TYPES /**/
11906 #if defined(I_SYS_TYPES)
11907 #include <sys/types.h>
11909 #if defined(I_DIRENT)
11910 #include <dirent.h>
11911 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
11912 #include <sys/dir.h>
11916 #include <sys/ndir.h>
11920 #include <ndir.h> /* may be wrong in the future */
11922 #include <sys/dir.h>
11928 DIR *dirp = opendir(".");
11929 if (dirfd(dirp) >= 0)
11937 if eval $compile; then
11941 $define) echo "dirfd() found." >&4 ;;
11942 *) echo "dirfd() NOT found." >&4 ;;
11948 : see if dlerror exists
11951 set dlerror d_dlerror
11955 : see if dlfcn is available
11956 set dlfcn.h i_dlfcn
11959 : Check what extension to use for shared libs
11964 On a few systems, the dynamically loaded modules that perl generates and uses
11965 will need a different extension than shared libs. The default will probably
11971 *) dflt="$dlext" ;;
11973 rp='What is the extension of dynamically loaded modules'
11982 : Check if dlsym need a leading underscore
11988 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
11989 $cat >dyna.c <<'EOM'
11996 #$i_stdlib I_STDLIB
11998 #include <stdlib.h>
12002 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
12004 #include <sys/types.h>
12009 extern int fred() ;
12018 int mode = RTLD_LAZY ;
12020 handle = dlopen("./dyna.$dlext", mode) ;
12021 if (handle == NULL) {
12026 symbol = dlsym(handle, "fred") ;
12027 if (symbol == NULL) {
12028 /* try putting a leading underscore */
12029 symbol = dlsym(handle, "_fred") ;
12030 if (symbol == NULL) {
12043 : Call the object file tmp-dyna.o in case dlext=o.
12044 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
12045 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
12046 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
12047 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
12050 1) echo "Test program failed using dlopen." >&4
12051 echo "Perhaps you should not use dynamic loading." >&4;;
12052 2) echo "Test program failed using dlsym." >&4
12053 echo "Perhaps you should not use dynamic loading." >&4;;
12054 3) echo "dlsym needs a leading underscore" >&4
12056 4) echo "dlsym doesn't need a leading underscore." >&4;;
12059 echo "I can't compile and run the test program." >&4
12060 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
12065 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
12070 : see if drand48_r exists
12071 set drand48_r d_drand48_r
12073 case "$d_drand48_r" in
12075 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
12076 case "$d_drand48_r_proto:$usethreads" in
12077 ":define") d_drand48_r_proto=define
12078 set d_drand48_r_proto drand48_r $hdrs
12082 case "$d_drand48_r_proto" in
12084 case "$drand48_r_proto" in
12085 ''|0) try='int drand48_r(struct drand48_data*, double*);'
12086 ./protochk "$extern_C $try" $hdrs && drand48_r_proto=I_ST ;;
12088 case "$drand48_r_proto" in
12089 ''|0) d_drand48_r=undef
12091 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
12092 * ) case "$drand48_r_proto" in
12093 REENTRANT_PROTO*) ;;
12094 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
12096 echo "Prototype: $try" ;;
12099 *) case "$usethreads" in
12100 define) echo "drand48_r has no prototype, not using it." >&4 ;;
12107 *) drand48_r_proto=0
12111 : see if prototype for drand48 is available
12113 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
12116 : see if dup2 exists
12120 : see if eaccess exists
12121 set eaccess d_eaccess
12124 : see if endgrent exists
12125 set endgrent d_endgrent
12128 : see if this is an grp system
12134 xxx=`./findhdr grp.h`
12135 $cppstdin $cppflags $cppminus < $xxx >$$.h
12137 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
12149 set d_grpasswd; eval $setvar
12153 : see if endgrent_r exists
12154 set endgrent_r d_endgrent_r
12156 case "$d_endgrent_r" in
12158 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12159 case "$d_endgrent_r_proto:$usethreads" in
12160 ":define") d_endgrent_r_proto=define
12161 set d_endgrent_r_proto endgrent_r $hdrs
12165 case "$d_endgrent_r_proto" in
12167 case "$endgrent_r_proto" in
12168 ''|0) try='int endgrent_r(FILE**);'
12169 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=I_H ;;
12171 case "$endgrent_r_proto" in
12172 ''|0) try='void endgrent_r(FILE**);'
12173 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=V_H ;;
12175 case "$endgrent_r_proto" in
12176 ''|0) d_endgrent_r=undef
12178 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
12179 * ) case "$endgrent_r_proto" in
12180 REENTRANT_PROTO*) ;;
12181 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
12183 echo "Prototype: $try" ;;
12186 *) case "$usethreads" in
12187 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
12194 *) endgrent_r_proto=0
12198 : see if endhostent exists
12199 set endhostent d_endhent
12202 : see if this is a netdb.h system
12203 set netdb.h i_netdb
12206 : see if endhostent_r exists
12207 set endhostent_r d_endhostent_r
12209 case "$d_endhostent_r" in
12211 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12212 case "$d_endhostent_r_proto:$usethreads" in
12213 ":define") d_endhostent_r_proto=define
12214 set d_endhostent_r_proto endhostent_r $hdrs
12218 case "$d_endhostent_r_proto" in
12220 case "$endhostent_r_proto" in
12221 ''|0) try='int endhostent_r(struct hostent_data*);'
12222 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=I_D ;;
12224 case "$endhostent_r_proto" in
12225 ''|0) try='void endhostent_r(struct hostent_data*);'
12226 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=V_D ;;
12228 case "$endhostent_r_proto" in
12229 ''|0) d_endhostent_r=undef
12230 endhostent_r_proto=0
12231 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
12232 * ) case "$endhostent_r_proto" in
12233 REENTRANT_PROTO*) ;;
12234 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
12236 echo "Prototype: $try" ;;
12239 *) case "$usethreads" in
12240 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
12242 d_endhostent_r=undef
12243 endhostent_r_proto=0
12247 *) endhostent_r_proto=0
12251 : see if endnetent exists
12252 set endnetent d_endnent
12255 : see if endnetent_r exists
12256 set endnetent_r d_endnetent_r
12258 case "$d_endnetent_r" in
12260 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12261 case "$d_endnetent_r_proto:$usethreads" in
12262 ":define") d_endnetent_r_proto=define
12263 set d_endnetent_r_proto endnetent_r $hdrs
12267 case "$d_endnetent_r_proto" in
12269 case "$endnetent_r_proto" in
12270 ''|0) try='int endnetent_r(struct netent_data*);'
12271 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=I_D ;;
12273 case "$endnetent_r_proto" in
12274 ''|0) try='void endnetent_r(struct netent_data*);'
12275 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=V_D ;;
12277 case "$endnetent_r_proto" in
12278 ''|0) d_endnetent_r=undef
12279 endnetent_r_proto=0
12280 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
12281 * ) case "$endnetent_r_proto" in
12282 REENTRANT_PROTO*) ;;
12283 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
12285 echo "Prototype: $try" ;;
12288 *) case "$usethreads" in
12289 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
12291 d_endnetent_r=undef
12292 endnetent_r_proto=0
12296 *) endnetent_r_proto=0
12300 : see if endprotoent exists
12301 set endprotoent d_endpent
12304 : see if endprotoent_r exists
12305 set endprotoent_r d_endprotoent_r
12307 case "$d_endprotoent_r" in
12309 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12310 case "$d_endprotoent_r_proto:$usethreads" in
12311 ":define") d_endprotoent_r_proto=define
12312 set d_endprotoent_r_proto endprotoent_r $hdrs
12316 case "$d_endprotoent_r_proto" in
12318 case "$endprotoent_r_proto" in
12319 ''|0) try='int endprotoent_r(struct protoent_data*);'
12320 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=I_D ;;
12322 case "$endprotoent_r_proto" in
12323 ''|0) try='void endprotoent_r(struct protoent_data*);'
12324 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=V_D ;;
12326 case "$endprotoent_r_proto" in
12327 ''|0) d_endprotoent_r=undef
12328 endprotoent_r_proto=0
12329 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
12330 * ) case "$endprotoent_r_proto" in
12331 REENTRANT_PROTO*) ;;
12332 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
12334 echo "Prototype: $try" ;;
12337 *) case "$usethreads" in
12338 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
12340 d_endprotoent_r=undef
12341 endprotoent_r_proto=0
12345 *) endprotoent_r_proto=0
12349 : see if endpwent exists
12350 set endpwent d_endpwent
12353 : see if this is a pwd.h system
12359 xxx=`./findhdr pwd.h`
12360 $cppstdin $cppflags $cppminus < $xxx >$$.h
12362 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
12370 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
12378 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
12386 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
12394 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
12402 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
12410 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
12418 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
12430 set d_pwquota; eval $setvar
12431 set d_pwage; eval $setvar
12432 set d_pwchange; eval $setvar
12433 set d_pwclass; eval $setvar
12434 set d_pwexpire; eval $setvar
12435 set d_pwcomment; eval $setvar
12436 set d_pwgecos; eval $setvar
12437 set d_pwpasswd; eval $setvar
12441 : see if endpwent_r exists
12442 set endpwent_r d_endpwent_r
12444 case "$d_endpwent_r" in
12446 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
12447 case "$d_endpwent_r_proto:$usethreads" in
12448 ":define") d_endpwent_r_proto=define
12449 set d_endpwent_r_proto endpwent_r $hdrs
12453 case "$d_endpwent_r_proto" in
12455 case "$endpwent_r_proto" in
12456 ''|0) try='int endpwent_r(FILE**);'
12457 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=I_H ;;
12459 case "$endpwent_r_proto" in
12460 ''|0) try='void endpwent_r(FILE**);'
12461 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=V_H ;;
12463 case "$endpwent_r_proto" in
12464 ''|0) d_endpwent_r=undef
12466 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
12467 * ) case "$endpwent_r_proto" in
12468 REENTRANT_PROTO*) ;;
12469 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
12471 echo "Prototype: $try" ;;
12474 *) case "$usethreads" in
12475 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
12482 *) endpwent_r_proto=0
12486 : see if endservent exists
12487 set endservent d_endsent
12490 : see if endservent_r exists
12491 set endservent_r d_endservent_r
12493 case "$d_endservent_r" in
12495 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12496 case "$d_endservent_r_proto:$usethreads" in
12497 ":define") d_endservent_r_proto=define
12498 set d_endservent_r_proto endservent_r $hdrs
12502 case "$d_endservent_r_proto" in
12504 case "$endservent_r_proto" in
12505 ''|0) try='int endservent_r(struct servent_data*);'
12506 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=I_D ;;
12508 case "$endservent_r_proto" in
12509 ''|0) try='void endservent_r(struct servent_data*);'
12510 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=V_D ;;
12512 case "$endservent_r_proto" in
12513 ''|0) d_endservent_r=undef
12514 endservent_r_proto=0
12515 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
12516 * ) case "$endservent_r_proto" in
12517 REENTRANT_PROTO*) ;;
12518 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
12520 echo "Prototype: $try" ;;
12523 *) case "$usethreads" in
12524 define) echo "endservent_r has no prototype, not using it." >&4 ;;
12526 d_endservent_r=undef
12527 endservent_r_proto=0
12531 *) endservent_r_proto=0
12535 : Locate the flags for 'open()'
12538 #include <sys/types.h>
12543 #include <sys/file.h>
12545 #$i_stdlib I_STDLIB
12547 #include <stdlib.h>
12558 : check sys/file.h first to get FREAD on Sun
12559 if $test `./findhdr sys/file.h` && \
12560 set try -DI_SYS_FILE && eval $compile; then
12562 echo "<sys/file.h> defines the O_* constants..." >&4
12563 if $run ./try; then
12564 echo "and you have the 3 argument form of open()." >&4
12567 echo "but not the 3 argument form of open(). Oh, well." >&4
12570 elif $test `./findhdr fcntl.h` && \
12571 set try -DI_FCNTL && eval $compile; then
12573 echo "<fcntl.h> defines the O_* constants..." >&4
12574 if $run ./try; then
12575 echo "and you have the 3 argument form of open()." >&4
12578 echo "but not the 3 argument form of open(). Oh, well." >&4
12583 echo "I can't find the O_* constant definitions! You got problems." >&4
12589 : see if this is a sys/file.h system
12594 : do we need to include sys/file.h ?
12598 if $h_sysfile; then
12600 echo "We'll be including <sys/file.h>." >&4
12603 echo "We won't be including <sys/file.h>." >&4
12613 : see if fcntl.h is there
12618 : see if we can include fcntl.h
12624 echo "We'll be including <fcntl.h>." >&4
12627 if $h_sysfile; then
12628 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
12630 echo "We won't be including <fcntl.h>." >&4
12642 : see if fork exists
12646 : see if pipe exists
12650 : check for non-blocking I/O stuff
12651 case "$h_sysfile" in
12652 true) echo "#include <sys/file.h>" > head.c;;
12655 true) echo "#include <fcntl.h>" > head.c;;
12656 *) echo "#include <sys/fcntl.h>" > head.c;;
12661 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
12662 case "$o_nonblock" in
12664 $cat head.c > try.c
12665 $cat >>try.c <<EOCP
12667 #$i_stdlib I_STDLIB
12669 #include <stdlib.h>
12677 printf("O_NONBLOCK\n");
12681 printf("O_NDELAY\n");
12685 printf("FNDELAY\n");
12692 if eval $compile_ok; then
12693 o_nonblock=`$run ./try`
12694 case "$o_nonblock" in
12695 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
12696 *) echo "Seems like we can use $o_nonblock.";;
12699 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
12702 *) echo "Using $hint value $o_nonblock.";;
12707 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
12710 case "$d_fork:$d_pipe" in
12712 $cat head.c > try.c
12713 $cat >>try.c <<EOCP
12715 #include <sys/types.h>
12716 #include <signal.h>
12718 #$i_stdlib I_STDLIB
12720 #include <stdlib.h>
12726 #define MY_O_NONBLOCK $o_nonblock
12727 #ifndef errno /* XXX need better Configure test */
12730 #$i_unistd I_UNISTD
12732 #include <unistd.h>
12734 #$i_string I_STRING
12736 #include <string.h>
12738 #include <strings.h>
12740 $signal_t blech(int x) { exit(3); }
12742 $cat >> try.c <<'EOCP'
12750 pipe(pd); /* Down: child -> parent */
12751 pipe(pu); /* Up: parent -> child */
12754 close(pd[1]); /* Parent reads from pd[0] */
12755 close(pu[0]); /* Parent writes (blocking) to pu[1] */
12757 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
12762 signal(SIGALRM, blech);
12764 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
12766 sprintf(string, "%d\n", ret);
12767 write(2, string, strlen(string));
12770 if (errno == EAGAIN) {
12771 printf("EAGAIN\n");
12776 if (errno == EWOULDBLOCK)
12777 printf("EWOULDBLOCK\n");
12780 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
12781 sleep(2); /* Give it time to close our pipe */
12783 ret = read(pd[0], buf, 1); /* Should read EOF */
12785 sprintf(string, "%d\n", ret);
12786 write(4, string, strlen(string));
12790 close(pd[0]); /* We write to pd[1] */
12791 close(pu[1]); /* We read from pu[0] */
12792 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
12793 close(pd[1]); /* Pipe pd is now fully closed! */
12794 exit(0); /* Bye bye, thank you for playing! */
12798 if eval $compile_ok; then
12799 echo "$startsh" >mtry
12800 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
12802 ./mtry >/dev/null 2>&1
12804 0) eagain=`$cat try.out`;;
12805 1) echo "Could not perform non-blocking setting!";;
12806 2) echo "I did a successful read() for something that was not there!";;
12807 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
12808 4) echo "Could not find F_SETFL!";;
12809 *) echo "Something terribly wrong happened during testing.";;
12811 rd_nodata=`$cat try.ret`
12812 echo "A read() system call with no data present returns $rd_nodata."
12813 case "$rd_nodata" in
12816 echo "(That's peculiar, fixing that to be -1.)"
12822 echo "Forcing errno EAGAIN on read() with no data available."
12826 echo "Your read() sets errno to $eagain when no data is available."
12829 status=`$cat try.err`
12831 0) echo "And it correctly returns 0 to signal EOF.";;
12832 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
12833 *) echo "However, your read() returns '$status' on EOF??";;
12836 if test "$status" = "$rd_nodata"; then
12837 echo "WARNING: you can't distinguish between EOF and no data!"
12841 echo "I can't compile the test program--assuming errno EAGAIN will do."
12845 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
12854 echo "Using $hint value $eagain."
12855 echo "Your read() returns $rd_nodata when no data is present."
12856 case "$d_eofnblk" in
12857 "$define") echo "And you can see EOF because read() returns 0.";;
12858 "$undef") echo "But you can't see EOF status from read() returned value.";;
12860 echo "(Assuming you can't see EOF status from read anyway.)"
12866 $rm_try head.c mtry
12868 : see if _ptr and _cnt from stdio act std
12871 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
12872 echo "(Looks like you have stdio.h from BSD.)"
12873 case "$stdio_ptr" in
12874 '') stdio_ptr='((fp)->_p)'
12877 *) ptr_lval=$d_stdio_ptr_lval;;
12879 case "$stdio_cnt" in
12880 '') stdio_cnt='((fp)->_r)'
12883 *) cnt_lval=$d_stdio_cnt_lval;;
12885 case "$stdio_base" in
12886 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
12888 case "$stdio_bufsiz" in
12889 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
12891 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
12892 echo "(Looks like you have stdio.h from Linux.)"
12893 case "$stdio_ptr" in
12894 '') stdio_ptr='((fp)->_IO_read_ptr)'
12897 *) ptr_lval=$d_stdio_ptr_lval;;
12899 case "$stdio_cnt" in
12900 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
12903 *) cnt_lval=$d_stdio_cnt_lval;;
12905 case "$stdio_base" in
12906 '') stdio_base='((fp)->_IO_read_base)';;
12908 case "$stdio_bufsiz" in
12909 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
12912 case "$stdio_ptr" in
12913 '') stdio_ptr='((fp)->_ptr)'
12916 *) ptr_lval=$d_stdio_ptr_lval;;
12918 case "$stdio_cnt" in
12919 '') stdio_cnt='((fp)->_cnt)'
12922 *) cnt_lval=$d_stdio_cnt_lval;;
12924 case "$stdio_base" in
12925 '') stdio_base='((fp)->_base)';;
12927 case "$stdio_bufsiz" in
12928 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
12932 : test whether _ptr and _cnt really work
12933 echo "Checking how std your stdio is..." >&4
12936 #$i_stdlib I_STDLIB
12938 #include <stdlib.h>
12940 #define FILE_ptr(fp) $stdio_ptr
12941 #define FILE_cnt(fp) $stdio_cnt
12943 FILE *fp = fopen("try.c", "r");
12946 18 <= FILE_cnt(fp) &&
12947 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12955 if eval $compile && $to try.c; then
12956 if $run ./try; then
12957 echo "Your stdio acts pretty std."
12960 echo "Your stdio isn't very std."
12963 echo "Your stdio doesn't appear very std."
12967 # glibc 2.2.90 and above apparently change stdio streams so Perl's
12968 # direct buffer manipulation no longer works. The Configure tests
12969 # should be changed to correctly detect this, but until then,
12970 # the following check should at least let perl compile and run.
12971 # (This quick fix should be updated before 5.8.1.)
12972 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
12973 # A. Dougherty, June 3, 2002.
12974 case "$d_gnulibc" in
12976 case "$gnulibc_version" in
12980 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
12989 : Can _ptr be used as an lvalue?
12990 case "$d_stdstdio$ptr_lval" in
12991 $define$define) val=$define ;;
12994 set d_stdio_ptr_lval
12997 : Can _cnt be used as an lvalue?
12998 case "$d_stdstdio$cnt_lval" in
12999 $define$define) val=$define ;;
13002 set d_stdio_cnt_lval
13006 : test whether setting _ptr sets _cnt as a side effect
13007 d_stdio_ptr_lval_sets_cnt="$undef"
13008 d_stdio_ptr_lval_nochange_cnt="$undef"
13009 case "$d_stdio_ptr_lval$d_stdstdio" in
13011 echo "Checking to see what happens if we set the stdio ptr..." >&4
13014 /* Can we scream? */
13015 /* Eat dust sed :-) */
13016 /* In the buffer space, no one can hear you scream. */
13017 #$i_stdlib I_STDLIB
13019 #include <stdlib.h>
13021 #define FILE_ptr(fp) $stdio_ptr
13022 #define FILE_cnt(fp) $stdio_cnt
13023 #include <sys/types.h>
13025 FILE *fp = fopen("try.c", "r");
13030 puts("Fail even to read");
13033 c = getc(fp); /* Read away the first # */
13035 puts("Fail even to read");
13039 18 <= FILE_cnt(fp) &&
13040 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13042 puts("Fail even to read");
13045 ptr = (char*) FILE_ptr(fp);
13046 cnt = (size_t)FILE_cnt(fp);
13048 FILE_ptr(fp) += 42;
13050 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
13051 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
13054 if (FILE_cnt(fp) <= 20) {
13055 printf ("Fail (<20 chars to test)");
13058 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
13059 puts("Fail compare");
13062 if (cnt == FILE_cnt(fp)) {
13063 puts("Pass_unchanged");
13066 if (FILE_cnt(fp) == (cnt - 42)) {
13067 puts("Pass_changed");
13070 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
13076 if eval $compile && $to try.c; then
13077 case `$run ./try` in
13079 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
13080 d_stdio_ptr_lval_sets_cnt="$define" ;;
13082 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
13083 d_stdio_ptr_lval_nochange_cnt="$define" ;;
13085 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
13087 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
13090 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
13096 : see if _base is also standard
13098 case "$d_stdstdio" in
13102 #$i_stdlib I_STDLIB
13104 #include <stdlib.h>
13106 #define FILE_base(fp) $stdio_base
13107 #define FILE_bufsiz(fp) $stdio_bufsiz
13109 FILE *fp = fopen("try.c", "r");
13112 19 <= FILE_bufsiz(fp) &&
13113 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
13120 if eval $compile && $to try.c; then
13121 if $run ./try; then
13122 echo "And its _base field acts std."
13125 echo "But its _base field isn't std."
13128 echo "However, it seems to be lacking the _base field."
13136 : see if fast_stdio exists
13138 case "$d_stdstdio:$d_stdio_ptr_lval" in
13140 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
13142 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
13153 : see if fchdir exists
13154 set fchdir d_fchdir
13157 : see if fchmod exists
13158 set fchmod d_fchmod
13161 : see if fchown exists
13162 set fchown d_fchown
13165 : see if this is an fcntl system
13169 : See if fcntl-based locking works.
13172 #$i_stdlib I_STDLIB
13174 #include <stdlib.h>
13176 #include <unistd.h>
13178 #include <signal.h>
13179 $signal_t blech(int x) { exit(3); }
13181 #if defined(F_SETLK) && defined(F_SETLKW)
13182 struct flock flock;
13184 fd = open("try.c", O_RDONLY);
13185 flock.l_type = F_RDLCK;
13186 flock.l_whence = SEEK_SET;
13187 flock.l_start = flock.l_len = 0;
13188 signal(SIGALRM, blech);
13190 retval = fcntl(fd, F_SETLK, &flock);
13192 (retval < 0 ? exit(2) : exit(0));
13198 echo "Checking if fcntl-based file locking works... "
13202 if eval $compile_ok; then
13203 if $run ./try; then
13204 echo "Yes, it seems to work."
13207 echo "Nope, it didn't work."
13212 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
13213 *** This is (almost) impossible.
13214 *** If your NFS lock daemons are not feeling well, something like
13215 *** this may happen, please investigate. Cannot continue, aborting.
13223 echo "I'm unable to compile the test program, so I'll assume not."
13228 echo "Nope, since you don't even have fcntl()."
13231 set d_fcntl_can_lock
13235 : check for fd_set items
13238 Checking to see how well your C compiler handles fd_set and friends ...
13241 #$i_stdlib I_STDLIB
13243 #include <stdlib.h>
13245 #$i_systime I_SYS_TIME
13246 #$i_sysselct I_SYS_SELECT
13247 #$d_socket HAS_SOCKET
13248 #include <sys/types.h>
13250 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
13253 #include <sys/time.h>
13255 #ifdef I_SYS_SELECT
13256 #include <sys/select.h>
13265 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
13273 if eval $compile; then
13274 d_fds_bits="$define"
13276 echo "Well, your system knows about the normal fd_set typedef..." >&4
13277 if $run ./try; then
13278 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
13279 d_fd_macros="$define"
13282 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
13284 d_fd_macros="$undef"
13288 Hmm, your compiler has some difficulty with fd_set. Checking further...
13291 if eval $compile; then
13292 d_fds_bits="$undef"
13294 echo "Well, your system has some sort of fd_set available..." >&4
13295 if $run ./try; then
13296 echo "and you have the normal fd_set macros." >&4
13297 d_fd_macros="$define"
13300 but not the normal fd_set macros! Gross! More work for me...
13302 d_fd_macros="$undef"
13305 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
13307 d_fds_bits="$undef"
13308 d_fd_macros="$undef"
13313 : see if fgetpos exists
13314 set fgetpos d_fgetpos
13317 : see if finite exists
13318 set finite d_finite
13321 : see if finitel exists
13322 set finitel d_finitel
13325 : see if flock exists
13329 : see if prototype for flock is available
13331 set d_flockproto flock $i_sysfile sys/file.h
13334 : see if fp_class exists
13335 set fp_class d_fp_class
13338 : see if pathconf exists
13339 set pathconf d_pathconf
13342 : see if fpathconf exists
13343 set fpathconf d_fpathconf
13346 : see if fpclass exists
13347 set fpclass d_fpclass
13350 : see if fpclassify exists
13351 set fpclassify d_fpclassify
13354 : see if fpclassl exists
13355 set fpclassl d_fpclassl
13358 : check for fpos64_t
13360 echo "Checking to see if you have fpos64_t..." >&4
13363 int main() { fpos64_t x = 7; }
13366 if eval $compile; then
13368 echo "You have fpos64_t."
13371 echo "You do not have fpos64_t."
13372 case "$fpossize" in
13373 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
13380 : see if frexpl exists
13381 set frexpl d_frexpl
13384 : see if this is a sys/param system
13385 set sys/param.h i_sysparam
13388 : see if this is a sys/mount.h system
13389 set sys/mount.h i_sysmount
13392 : Check for fs_data_s
13394 echo "Checking to see if your system supports struct fs_data..." >&4
13395 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
13397 case "$d_fs_data_s" in
13398 "$define") echo "Yes, it does." ;;
13399 *) echo "No, it doesn't." ;;
13402 : see if fseeko exists
13403 set fseeko d_fseeko
13405 case "$longsize" in
13406 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
13409 : see if fsetpos exists
13410 set fsetpos d_fsetpos
13413 : see if fstatfs exists
13414 set fstatfs d_fstatfs
13417 : see if statvfs exists
13418 set statvfs d_statvfs
13421 : see if fstatvfs exists
13422 set fstatvfs d_fstatvfs
13426 : see if fsync exists
13430 : see if ftello exists
13431 set ftello d_ftello
13433 case "$longsize" in
13434 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
13437 : check for a working futimes
13440 echo "Checking if you have a working futimes()" >&4
13443 #include <sys/time.h>
13450 fd = open ("try.c", O_RDWR);
13451 if (-1 == fd) exit (1);
13452 rv = futimes (fd, NULL);
13453 exit (rv == -1 ? errno : 0);
13457 if eval $compile; then
13461 0) echo "Yes, you have" >&4
13462 d_futimes="$define"
13464 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
13468 echo "No, it does not (probably harmless)" >&4
13472 : see if ndbm.h is available
13475 : Compatibility location for RedHat 7.1
13476 set gdbm/ndbm.h i_gdbmndbm
13478 : Compatibility location for Debian 4.0
13479 set gdbm-ndbm.h i_gdbm_ndbm
13483 if $test "$i_ndbm" = "$define" -o "$i_gdbmndbm" = "$define" -o "$i_gdbm_ndbm" = "$define"; then
13484 : see if dbm_open exists
13485 set dbm_open d_dbm_open
13487 case "$d_dbm_open" in
13490 i_gdbmndbm="$undef"
13491 i_gdbm_ndbm="$undef"
13492 echo "We won't be including <ndbm.h>"
13502 ndbm_hdr_protochk='name=$1; hdr=$2;
13503 eval "ihdr=\$""i_$name";
13505 if $test "$ihdr" = "$define"; then
13506 $echo "Checking if your <$hdr> uses prototypes..." >&4;
13507 case "$d_cplusplus" in
13508 $define) ./protochk "$extern_C void dbm_close(DBM *);" literal "extern \"C\" {" $ihdr $hdr literal "}" && val="$define" ;;
13509 *) ./protochk "$extern_C void dbm_close(int, int);" $ihdr $hdr || val="$define" ;;
13512 $define) $echo "Your <$hdr> seems to have prototypes";;
13513 *) $echo "Your <$hdr> does not seem to have prototypes";;
13516 set "d_${name}_h_uses_prototypes";
13520 eval $ndbm_hdr_protochk
13521 set gdbmndbm gdbm/ndbm.h
13522 eval $ndbm_hdr_protochk
13523 set gdbm_ndbm gdbm-ndbm.h
13524 eval $ndbm_hdr_protochk
13526 : see if getaddrinfo exists
13527 set getaddrinfo d_getaddrinfo
13530 : see if getcwd exists
13531 set getcwd d_getcwd
13534 : see if getespwnam exists
13535 set getespwnam d_getespwnam
13538 : see if getfsstat exists
13539 set getfsstat d_getfsstat
13542 : see if getgrent exists
13543 set getgrent d_getgrent
13546 : see if getgrent_r exists
13547 set getgrent_r d_getgrent_r
13549 case "$d_getgrent_r" in
13551 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13552 case "$d_getgrent_r_proto:$usethreads" in
13553 ":define") d_getgrent_r_proto=define
13554 set d_getgrent_r_proto getgrent_r $hdrs
13558 case "$d_getgrent_r_proto" in
13560 case "$getgrent_r_proto" in
13561 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
13562 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBWR ;;
13564 case "$getgrent_r_proto" in
13565 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
13566 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIR ;;
13568 case "$getgrent_r_proto" in
13569 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
13570 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBW ;;
13572 case "$getgrent_r_proto" in
13573 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
13574 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBI ;;
13576 case "$getgrent_r_proto" in
13577 ''|0) try='int getgrent_r(struct group*, char*, int);'
13578 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBI ;;
13580 case "$getgrent_r_proto" in
13581 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
13582 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIH ;;
13584 case "$getgrent_r_proto" in
13585 ''|0) d_getgrent_r=undef
13587 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
13588 * ) case "$getgrent_r_proto" in
13589 REENTRANT_PROTO*) ;;
13590 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
13592 echo "Prototype: $try" ;;
13595 *) case "$usethreads" in
13596 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
13603 *) getgrent_r_proto=0
13607 : see if getgrgid_r exists
13608 set getgrgid_r d_getgrgid_r
13610 case "$d_getgrgid_r" in
13612 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13613 case "$d_getgrgid_r_proto:$usethreads" in
13614 ":define") d_getgrgid_r_proto=define
13615 set d_getgrgid_r_proto getgrgid_r $hdrs
13619 case "$d_getgrgid_r_proto" in
13621 case "$getgrgid_r_proto" in
13622 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
13623 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
13625 case "$getgrgid_r_proto" in
13626 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
13627 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
13629 case "$getgrgid_r_proto" in
13630 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
13631 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
13633 case "$getgrgid_r_proto" in
13634 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
13635 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
13637 case "$getgrgid_r_proto" in
13638 ''|0) d_getgrgid_r=undef
13640 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
13641 * ) case "$getgrgid_r_proto" in
13642 REENTRANT_PROTO*) ;;
13643 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
13645 echo "Prototype: $try" ;;
13648 *) case "$usethreads" in
13649 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
13656 *) getgrgid_r_proto=0
13660 : see if getgrnam_r exists
13661 set getgrnam_r d_getgrnam_r
13663 case "$d_getgrnam_r" in
13665 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13666 case "$d_getgrnam_r_proto:$usethreads" in
13667 ":define") d_getgrnam_r_proto=define
13668 set d_getgrnam_r_proto getgrnam_r $hdrs
13672 case "$d_getgrnam_r_proto" in
13674 case "$getgrnam_r_proto" in
13675 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
13676 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
13678 case "$getgrnam_r_proto" in
13679 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
13680 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
13682 case "$getgrnam_r_proto" in
13683 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
13684 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CBI ;;
13686 case "$getgrnam_r_proto" in
13687 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
13688 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
13690 case "$getgrnam_r_proto" in
13691 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
13692 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
13694 case "$getgrnam_r_proto" in
13695 ''|0) d_getgrnam_r=undef
13697 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
13698 * ) case "$getgrnam_r_proto" in
13699 REENTRANT_PROTO*) ;;
13700 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
13702 echo "Prototype: $try" ;;
13705 *) case "$usethreads" in
13706 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
13713 *) getgrnam_r_proto=0
13717 : see if gethostbyaddr exists
13718 set gethostbyaddr d_gethbyaddr
13721 : see if gethostbyname exists
13722 set gethostbyname d_gethbyname
13725 : see if gethostent exists
13726 set gethostent d_gethent
13729 : see how we will look up host name
13732 if set gethostname val -f d_gethname; eval $csym; $val; then
13733 echo 'gethostname() found.' >&4
13734 d_gethname="$define"
13737 if set uname val -f d_uname; eval $csym; $val; then
13740 uname() was found, but you're running xenix, and older versions of xenix
13741 have a broken uname(). If you don't really know whether your xenix is old
13742 enough to have a broken system call, use the default answer.
13747 "$define") dflt=n;;
13749 rp='Is your uname() broken?'
13752 n*) d_uname="$define"; call=uname;;
13755 echo 'uname() found.' >&4
13762 case "$d_gethname" in
13763 '') d_gethname="$undef";;
13766 '') d_uname="$undef";;
13768 case "$d_uname$d_gethname" in
13773 Every now and then someone has a $call() that lies about the hostname
13774 but can't be fixed for political or economic reasons. If you wish, I can
13775 pretend $call() isn't there and maybe compute hostname at run-time
13776 thanks to the '$phostname' command.
13779 rp="Shall I ignore $call() from now on?"
13782 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
13785 case "$phostname" in
13786 '') aphostname='';;
13787 *) case "$aphostname" in
13789 *) set X $phostname
13793 file=`./loc $file $file $pth`
13794 aphostname=`echo $file $*`
13799 case "$d_uname$d_gethname" in
13802 case "$phostname" in
13804 echo "There will be no way for $package to get your hostname." >&4;;
13806 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
13810 case "$d_phostname" in
13811 '') d_phostname="$undef";;
13814 : see if gethostbyaddr_r exists
13815 set gethostbyaddr_r d_gethostbyaddr_r
13817 case "$d_gethostbyaddr_r" in
13819 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13820 case "$d_gethostbyaddr_r_proto:$usethreads" in
13821 ":define") d_gethostbyaddr_r_proto=define
13822 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
13826 case "$d_gethostbyaddr_r_proto" in
13828 case "$gethostbyaddr_r_proto" in
13829 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13830 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
13832 case "$gethostbyaddr_r_proto" in
13833 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
13834 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
13836 case "$gethostbyaddr_r_proto" in
13837 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
13838 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
13840 case "$gethostbyaddr_r_proto" in
13841 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
13842 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
13844 case "$gethostbyaddr_r_proto" in
13845 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
13846 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
13848 case "$gethostbyaddr_r_proto" in
13849 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
13850 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
13852 case "$gethostbyaddr_r_proto" in
13853 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
13854 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
13856 case "$gethostbyaddr_r_proto" in
13857 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
13858 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
13860 case "$gethostbyaddr_r_proto" in
13861 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
13862 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
13864 case "$gethostbyaddr_r_proto" in
13865 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
13866 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
13868 case "$gethostbyaddr_r_proto" in
13869 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13870 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
13872 case "$gethostbyaddr_r_proto" in
13873 ''|0) d_gethostbyaddr_r=undef
13874 gethostbyaddr_r_proto=0
13875 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
13876 * ) case "$gethostbyaddr_r_proto" in
13877 REENTRANT_PROTO*) ;;
13878 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
13880 echo "Prototype: $try" ;;
13883 *) case "$usethreads" in
13884 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
13886 d_gethostbyaddr_r=undef
13887 gethostbyaddr_r_proto=0
13891 *) gethostbyaddr_r_proto=0
13895 : see if gethostbyname_r exists
13896 set gethostbyname_r d_gethostbyname_r
13898 case "$d_gethostbyname_r" in
13900 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13901 case "$d_gethostbyname_r_proto:$usethreads" in
13902 ":define") d_gethostbyname_r_proto=define
13903 set d_gethostbyname_r_proto gethostbyname_r $hdrs
13907 case "$d_gethostbyname_r_proto" in
13909 case "$gethostbyname_r_proto" in
13910 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
13911 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
13913 case "$gethostbyname_r_proto" in
13914 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
13915 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
13917 case "$gethostbyname_r_proto" in
13918 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
13919 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
13921 case "$gethostbyname_r_proto" in
13922 ''|0) d_gethostbyname_r=undef
13923 gethostbyname_r_proto=0
13924 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
13925 * ) case "$gethostbyname_r_proto" in
13926 REENTRANT_PROTO*) ;;
13927 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
13929 echo "Prototype: $try" ;;
13932 *) case "$usethreads" in
13933 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
13935 d_gethostbyname_r=undef
13936 gethostbyname_r_proto=0
13940 *) gethostbyname_r_proto=0
13944 : see if gethostent_r exists
13945 set gethostent_r d_gethostent_r
13947 case "$d_gethostent_r" in
13949 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13950 case "$d_gethostent_r_proto:$usethreads" in
13951 ":define") d_gethostent_r_proto=define
13952 set d_gethostent_r_proto gethostent_r $hdrs
13956 case "$d_gethostent_r_proto" in
13958 case "$gethostent_r_proto" in
13959 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
13960 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
13962 case "$gethostent_r_proto" in
13963 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
13964 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBIE ;;
13966 case "$gethostent_r_proto" in
13967 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
13968 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBIE ;;
13970 case "$gethostent_r_proto" in
13971 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
13972 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBI ;;
13974 case "$gethostent_r_proto" in
13975 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
13976 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBI ;;
13978 case "$gethostent_r_proto" in
13979 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
13980 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SD ;;
13982 case "$gethostent_r_proto" in
13983 ''|0) d_gethostent_r=undef
13984 gethostent_r_proto=0
13985 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
13986 * ) case "$gethostent_r_proto" in
13987 REENTRANT_PROTO*) ;;
13988 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
13990 echo "Prototype: $try" ;;
13993 *) case "$usethreads" in
13994 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
13996 d_gethostent_r=undef
13997 gethostent_r_proto=0
14001 *) gethostent_r_proto=0
14005 : see if prototypes for various gethostxxx netdb.h functions are available
14007 set d_gethostprotos gethostent $i_netdb netdb.h
14010 : see if getitimer exists
14011 set getitimer d_getitimer
14014 : see if getlogin exists
14015 set getlogin d_getlogin
14018 : see if getlogin_r exists
14019 set getlogin_r d_getlogin_r
14021 case "$d_getlogin_r" in
14023 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
14024 case "$d_getlogin_r_proto:$usethreads" in
14025 ":define") d_getlogin_r_proto=define
14026 set d_getlogin_r_proto getlogin_r $hdrs
14030 case "$d_getlogin_r_proto" in
14032 case "$getlogin_r_proto" in
14033 ''|0) try='int getlogin_r(char*, size_t);'
14034 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BW ;;
14036 case "$getlogin_r_proto" in
14037 ''|0) try='int getlogin_r(char*, int);'
14038 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BI ;;
14040 case "$getlogin_r_proto" in
14041 ''|0) try='char* getlogin_r(char*, size_t);'
14042 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BW ;;
14044 case "$getlogin_r_proto" in
14045 ''|0) try='char* getlogin_r(char*, int);'
14046 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BI ;;
14048 case "$getlogin_r_proto" in
14049 ''|0) d_getlogin_r=undef
14051 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
14052 * ) case "$getlogin_r_proto" in
14053 REENTRANT_PROTO*) ;;
14054 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
14056 echo "Prototype: $try" ;;
14059 *) case "$usethreads" in
14060 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
14067 *) getlogin_r_proto=0
14071 : see if getmnt exists
14072 set getmnt d_getmnt
14075 : see if getmntent exists
14076 set getmntent d_getmntent
14079 : see if getnameinfo exists
14080 set getnameinfo d_getnameinfo
14083 : see if getnetbyaddr exists
14084 set getnetbyaddr d_getnbyaddr
14087 : see if getnetbyname exists
14088 set getnetbyname d_getnbyname
14091 : see if getnetent exists
14092 set getnetent d_getnent
14095 : see if getnetbyaddr_r exists
14096 set getnetbyaddr_r d_getnetbyaddr_r
14098 case "$d_getnetbyaddr_r" in
14100 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14101 case "$d_getnetbyaddr_r_proto:$usethreads" in
14102 ":define") d_getnetbyaddr_r_proto=define
14103 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
14107 case "$d_getnetbyaddr_r_proto" in
14109 case "$getnetbyaddr_r_proto" in
14110 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
14111 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
14113 case "$getnetbyaddr_r_proto" in
14114 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
14115 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
14117 case "$getnetbyaddr_r_proto" in
14118 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
14119 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
14121 case "$getnetbyaddr_r_proto" in
14122 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
14123 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
14125 case "$getnetbyaddr_r_proto" in
14126 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
14127 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
14129 case "$getnetbyaddr_r_proto" in
14130 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
14131 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
14133 case "$getnetbyaddr_r_proto" in
14134 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
14135 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
14137 case "$getnetbyaddr_r_proto" in
14138 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
14139 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
14141 case "$getnetbyaddr_r_proto" in
14142 ''|0) d_getnetbyaddr_r=undef
14143 getnetbyaddr_r_proto=0
14144 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
14145 * ) case "$getnetbyaddr_r_proto" in
14146 REENTRANT_PROTO*) ;;
14147 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
14149 echo "Prototype: $try" ;;
14152 *) case "$usethreads" in
14153 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
14155 d_getnetbyaddr_r=undef
14156 getnetbyaddr_r_proto=0
14160 *) getnetbyaddr_r_proto=0
14164 : see if getnetbyname_r exists
14165 set getnetbyname_r d_getnetbyname_r
14167 case "$d_getnetbyname_r" in
14169 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14170 case "$d_getnetbyname_r_proto:$usethreads" in
14171 ":define") d_getnetbyname_r_proto=define
14172 set d_getnetbyname_r_proto getnetbyname_r $hdrs
14176 case "$d_getnetbyname_r_proto" in
14178 case "$getnetbyname_r_proto" in
14179 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
14180 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
14182 case "$getnetbyname_r_proto" in
14183 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
14184 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
14186 case "$getnetbyname_r_proto" in
14187 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
14188 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
14190 case "$getnetbyname_r_proto" in
14191 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
14192 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
14194 case "$getnetbyname_r_proto" in
14195 ''|0) d_getnetbyname_r=undef
14196 getnetbyname_r_proto=0
14197 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
14198 * ) case "$getnetbyname_r_proto" in
14199 REENTRANT_PROTO*) ;;
14200 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
14202 echo "Prototype: $try" ;;
14205 *) case "$usethreads" in
14206 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
14208 d_getnetbyname_r=undef
14209 getnetbyname_r_proto=0
14213 *) getnetbyname_r_proto=0
14217 : see if getnetent_r exists
14218 set getnetent_r d_getnetent_r
14220 case "$d_getnetent_r" in
14222 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14223 case "$d_getnetent_r_proto:$usethreads" in
14224 ":define") d_getnetent_r_proto=define
14225 set d_getnetent_r_proto getnetent_r $hdrs
14229 case "$d_getnetent_r_proto" in
14231 case "$getnetent_r_proto" in
14232 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
14233 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
14235 case "$getnetent_r_proto" in
14236 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
14237 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBIE ;;
14239 case "$getnetent_r_proto" in
14240 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
14241 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBIE ;;
14243 case "$getnetent_r_proto" in
14244 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
14245 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBI ;;
14247 case "$getnetent_r_proto" in
14248 ''|0) try='int getnetent_r(struct netent*, char*, int);'
14249 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBI ;;
14251 case "$getnetent_r_proto" in
14252 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
14253 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SD ;;
14255 case "$getnetent_r_proto" in
14256 ''|0) d_getnetent_r=undef
14257 getnetent_r_proto=0
14258 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
14259 * ) case "$getnetent_r_proto" in
14260 REENTRANT_PROTO*) ;;
14261 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
14263 echo "Prototype: $try" ;;
14266 *) case "$usethreads" in
14267 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
14269 d_getnetent_r=undef
14270 getnetent_r_proto=0
14274 *) getnetent_r_proto=0
14278 : see if prototypes for various getnetxxx netdb.h functions are available
14280 set d_getnetprotos getnetent $i_netdb netdb.h
14283 : see if getpagesize exists
14284 set getpagesize d_getpagsz
14287 : Optional checks for getprotobyname and getprotobynumber
14289 : see if getprotobyname exists
14290 set getprotobyname d_getpbyname
14293 : see if getprotobynumber exists
14294 set getprotobynumber d_getpbynumber
14297 : see if getprotoent exists
14298 set getprotoent d_getpent
14301 : see if getpgid exists
14302 set getpgid d_getpgid
14305 : see if getpgrp2 exists
14306 set getpgrp2 d_getpgrp2
14309 : see if getppid exists
14310 set getppid d_getppid
14313 : see if getpriority exists
14314 set getpriority d_getprior
14317 : see if getprotobyname_r exists
14318 set getprotobyname_r d_getprotobyname_r
14320 case "$d_getprotobyname_r" in
14322 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14323 case "$d_getprotobyname_r_proto:$usethreads" in
14324 ":define") d_getprotobyname_r_proto=define
14325 set d_getprotobyname_r_proto getprotobyname_r $hdrs
14329 case "$d_getprotobyname_r_proto" in
14331 case "$getprotobyname_r_proto" in
14332 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
14333 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
14335 case "$getprotobyname_r_proto" in
14336 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
14337 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
14339 case "$getprotobyname_r_proto" in
14340 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
14341 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
14343 case "$getprotobyname_r_proto" in
14344 ''|0) d_getprotobyname_r=undef
14345 getprotobyname_r_proto=0
14346 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
14347 * ) case "$getprotobyname_r_proto" in
14348 REENTRANT_PROTO*) ;;
14349 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
14351 echo "Prototype: $try" ;;
14354 *) case "$usethreads" in
14355 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
14357 d_getprotobyname_r=undef
14358 getprotobyname_r_proto=0
14362 *) getprotobyname_r_proto=0
14366 : see if getprotobynumber_r exists
14367 set getprotobynumber_r d_getprotobynumber_r
14369 case "$d_getprotobynumber_r" in
14371 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14372 case "$d_getprotobynumber_r_proto:$usethreads" in
14373 ":define") d_getprotobynumber_r_proto=define
14374 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
14378 case "$d_getprotobynumber_r_proto" in
14380 case "$getprotobynumber_r_proto" in
14381 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
14382 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
14384 case "$getprotobynumber_r_proto" in
14385 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
14386 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
14388 case "$getprotobynumber_r_proto" in
14389 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
14390 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
14392 case "$getprotobynumber_r_proto" in
14393 ''|0) d_getprotobynumber_r=undef
14394 getprotobynumber_r_proto=0
14395 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
14396 * ) case "$getprotobynumber_r_proto" in
14397 REENTRANT_PROTO*) ;;
14398 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
14400 echo "Prototype: $try" ;;
14403 *) case "$usethreads" in
14404 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
14406 d_getprotobynumber_r=undef
14407 getprotobynumber_r_proto=0
14411 *) getprotobynumber_r_proto=0
14415 : see if getprotoent_r exists
14416 set getprotoent_r d_getprotoent_r
14418 case "$d_getprotoent_r" in
14420 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14421 case "$d_getprotoent_r_proto:$usethreads" in
14422 ":define") d_getprotoent_r_proto=define
14423 set d_getprotoent_r_proto getprotoent_r $hdrs
14427 case "$d_getprotoent_r_proto" in
14429 case "$getprotoent_r_proto" in
14430 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
14431 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
14433 case "$getprotoent_r_proto" in
14434 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
14435 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBI ;;
14437 case "$getprotoent_r_proto" in
14438 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
14439 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=S_SBI ;;
14441 case "$getprotoent_r_proto" in
14442 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
14443 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SD ;;
14445 case "$getprotoent_r_proto" in
14446 ''|0) d_getprotoent_r=undef
14447 getprotoent_r_proto=0
14448 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
14449 * ) case "$getprotoent_r_proto" in
14450 REENTRANT_PROTO*) ;;
14451 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
14453 echo "Prototype: $try" ;;
14456 *) case "$usethreads" in
14457 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
14459 d_getprotoent_r=undef
14460 getprotoent_r_proto=0
14464 *) getprotoent_r_proto=0
14468 : see if prototypes for various getprotoxxx netdb.h functions are available
14470 set d_getprotoprotos getprotoent $i_netdb netdb.h
14473 : see if getprpwnam exists
14474 set getprpwnam d_getprpwnam
14477 : see if getpwent exists
14478 set getpwent d_getpwent
14481 : see if getpwent_r exists
14482 set getpwent_r d_getpwent_r
14484 case "$d_getpwent_r" in
14486 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14487 case "$d_getpwent_r_proto:$usethreads" in
14488 ":define") d_getpwent_r_proto=define
14489 set d_getpwent_r_proto getpwent_r $hdrs
14493 case "$d_getpwent_r_proto" in
14495 case "$getpwent_r_proto" in
14496 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
14497 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBWR ;;
14499 case "$getpwent_r_proto" in
14500 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
14501 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIR ;;
14503 case "$getpwent_r_proto" in
14504 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
14505 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBW ;;
14507 case "$getpwent_r_proto" in
14508 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
14509 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBI ;;
14511 case "$getpwent_r_proto" in
14512 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
14513 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBI ;;
14515 case "$getpwent_r_proto" in
14516 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
14517 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIH ;;
14519 case "$getpwent_r_proto" in
14520 ''|0) d_getpwent_r=undef
14522 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
14523 * ) case "$getpwent_r_proto" in
14524 REENTRANT_PROTO*) ;;
14525 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
14527 echo "Prototype: $try" ;;
14530 *) case "$usethreads" in
14531 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
14538 *) getpwent_r_proto=0
14542 : see if getpwnam_r exists
14543 set getpwnam_r d_getpwnam_r
14545 case "$d_getpwnam_r" in
14547 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14548 case "$d_getpwnam_r_proto:$usethreads" in
14549 ":define") d_getpwnam_r_proto=define
14550 set d_getpwnam_r_proto getpwnam_r $hdrs
14554 case "$d_getpwnam_r_proto" in
14556 case "$getpwnam_r_proto" in
14557 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
14558 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
14560 case "$getpwnam_r_proto" in
14561 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
14562 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
14564 case "$getpwnam_r_proto" in
14565 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
14566 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
14568 case "$getpwnam_r_proto" in
14569 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
14570 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
14572 case "$getpwnam_r_proto" in
14573 ''|0) d_getpwnam_r=undef
14575 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
14576 * ) case "$getpwnam_r_proto" in
14577 REENTRANT_PROTO*) ;;
14578 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
14580 echo "Prototype: $try" ;;
14583 *) case "$usethreads" in
14584 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
14591 *) getpwnam_r_proto=0
14595 : see if getpwuid_r exists
14596 set getpwuid_r d_getpwuid_r
14598 case "$d_getpwuid_r" in
14600 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14601 case "$d_getpwuid_r_proto:$usethreads" in
14602 ":define") d_getpwuid_r_proto=define
14603 set d_getpwuid_r_proto getpwuid_r $hdrs
14607 case "$d_getpwuid_r_proto" in
14609 case "$getpwuid_r_proto" in
14610 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
14611 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
14613 case "$getpwuid_r_proto" in
14614 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
14615 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
14617 case "$getpwuid_r_proto" in
14618 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
14619 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
14621 case "$getpwuid_r_proto" in
14622 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
14623 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
14625 case "$getpwuid_r_proto" in
14626 ''|0) d_getpwuid_r=undef
14628 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
14629 * ) case "$getpwuid_r_proto" in
14630 REENTRANT_PROTO*) ;;
14631 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
14633 echo "Prototype: $try" ;;
14636 *) case "$usethreads" in
14637 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
14644 *) getpwuid_r_proto=0
14648 : Optional checks for getsbyname and getsbyport
14650 : see if getservbyname exists
14651 set getservbyname d_getsbyname
14654 : see if getservbyport exists
14655 set getservbyport d_getsbyport
14658 : see if getservent exists
14659 set getservent d_getsent
14662 : see if getservbyname_r exists
14663 set getservbyname_r d_getservbyname_r
14665 case "$d_getservbyname_r" in
14667 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14668 case "$d_getservbyname_r_proto:$usethreads" in
14669 ":define") d_getservbyname_r_proto=define
14670 set d_getservbyname_r_proto getservbyname_r $hdrs
14674 case "$d_getservbyname_r_proto" in
14676 case "$getservbyname_r_proto" in
14677 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
14678 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
14680 case "$getservbyname_r_proto" in
14681 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
14682 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
14684 case "$getservbyname_r_proto" in
14685 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
14686 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
14688 case "$getservbyname_r_proto" in
14689 ''|0) d_getservbyname_r=undef
14690 getservbyname_r_proto=0
14691 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
14692 * ) case "$getservbyname_r_proto" in
14693 REENTRANT_PROTO*) ;;
14694 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
14696 echo "Prototype: $try" ;;
14699 *) case "$usethreads" in
14700 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
14702 d_getservbyname_r=undef
14703 getservbyname_r_proto=0
14707 *) getservbyname_r_proto=0
14711 : see if getservbyport_r exists
14712 set getservbyport_r d_getservbyport_r
14714 case "$d_getservbyport_r" in
14716 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14717 case "$d_getservbyport_r_proto:$usethreads" in
14718 ":define") d_getservbyport_r_proto=define
14719 set d_getservbyport_r_proto getservbyport_r $hdrs
14723 case "$d_getservbyport_r_proto" in
14725 case "$getservbyport_r_proto" in
14726 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
14727 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
14729 case "$getservbyport_r_proto" in
14730 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
14731 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
14733 case "$getservbyport_r_proto" in
14734 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
14735 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
14737 case "$getservbyport_r_proto" in
14738 ''|0) d_getservbyport_r=undef
14739 getservbyport_r_proto=0
14740 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
14741 * ) case "$getservbyport_r_proto" in
14742 REENTRANT_PROTO*) ;;
14743 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
14745 echo "Prototype: $try" ;;
14748 *) case "$usethreads" in
14749 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
14751 d_getservbyport_r=undef
14752 getservbyport_r_proto=0
14756 *) getservbyport_r_proto=0
14760 : see if getservent_r exists
14761 set getservent_r d_getservent_r
14763 case "$d_getservent_r" in
14765 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14766 case "$d_getservent_r_proto:$usethreads" in
14767 ":define") d_getservent_r_proto=define
14768 set d_getservent_r_proto getservent_r $hdrs
14772 case "$d_getservent_r_proto" in
14774 case "$getservent_r_proto" in
14775 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
14776 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBWR ;;
14778 case "$getservent_r_proto" in
14779 ''|0) try='int getservent_r(struct servent*, char*, int);'
14780 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBI ;;
14782 case "$getservent_r_proto" in
14783 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
14784 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=S_SBI ;;
14786 case "$getservent_r_proto" in
14787 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
14788 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SD ;;
14790 case "$getservent_r_proto" in
14791 ''|0) d_getservent_r=undef
14792 getservent_r_proto=0
14793 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
14794 * ) case "$getservent_r_proto" in
14795 REENTRANT_PROTO*) ;;
14796 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
14798 echo "Prototype: $try" ;;
14801 *) case "$usethreads" in
14802 define) echo "getservent_r has no prototype, not using it." >&4 ;;
14804 d_getservent_r=undef
14805 getservent_r_proto=0
14809 *) getservent_r_proto=0
14813 : see if prototypes for various getservxxx netdb.h functions are available
14815 set d_getservprotos getservent $i_netdb netdb.h
14818 : see if getspnam exists
14819 set getspnam d_getspnam
14822 : see if this is a shadow.h system
14823 set shadow.h i_shadow
14826 : see if getspnam_r exists
14827 set getspnam_r d_getspnam_r
14829 case "$d_getspnam_r" in
14831 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
14832 case "$d_getspnam_r_proto:$usethreads" in
14833 ":define") d_getspnam_r_proto=define
14834 set d_getspnam_r_proto getspnam_r $hdrs
14838 case "$d_getspnam_r_proto" in
14840 case "$getspnam_r_proto" in
14841 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
14842 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
14844 case "$getspnam_r_proto" in
14845 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
14846 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=S_CSBI ;;
14848 case "$getspnam_r_proto" in
14849 ''|0) d_getspnam_r=undef
14851 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
14852 * ) case "$getspnam_r_proto" in
14853 REENTRANT_PROTO*) ;;
14854 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
14856 echo "Prototype: $try" ;;
14859 *) case "$usethreads" in
14860 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
14867 *) getspnam_r_proto=0
14871 : see if gettimeofday or ftime exists
14872 set gettimeofday d_gettimeod
14874 case "$d_gettimeod" in
14880 val="$undef"; set d_ftime; eval $setvar
14883 case "$d_gettimeod$d_ftime" in
14886 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
14890 : see if gmtime_r exists
14891 set gmtime_r d_gmtime_r
14893 case "$d_gmtime_r" in
14895 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14896 case "$d_gmtime_r_proto:$usethreads" in
14897 ":define") d_gmtime_r_proto=define
14898 set d_gmtime_r_proto gmtime_r $hdrs
14902 case "$d_gmtime_r_proto" in
14904 case "$gmtime_r_proto" in
14905 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
14906 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=S_TS ;;
14908 case "$gmtime_r_proto" in
14909 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
14910 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=I_TS ;;
14912 case "$gmtime_r_proto" in
14913 ''|0) d_gmtime_r=undef
14915 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
14916 * ) case "$gmtime_r_proto" in
14917 REENTRANT_PROTO*) ;;
14918 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
14920 echo "Prototype: $try" ;;
14923 *) case "$usethreads" in
14924 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
14931 *) gmtime_r_proto=0
14935 : see if hasmntopt exists
14936 set hasmntopt d_hasmntopt
14939 : see if this is a netinet/in.h or sys/in.h system
14940 set netinet/in.h i_niin sys/in.h i_sysin
14943 : see if arpa/inet.h has to be included
14944 set arpa/inet.h i_arpainet
14947 : see if htonl --and friends-- exists
14952 : Maybe they are macros.
14955 $cat >htonl.c <<EOM
14957 #include <sys/types.h>
14958 #$i_niin I_NETINET_IN
14960 #$i_arpainet I_ARPA_INET
14961 #ifdef I_NETINET_IN
14962 #include <netinet/in.h>
14965 #include <sys/in.h>
14968 #include <arpa/inet.h>
14971 printf("Defined as a macro.");
14974 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
14975 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
14977 echo "But it seems to be defined as a macro." >&4
14985 : see if ilogbl exists
14986 set ilogbl d_ilogbl
14991 if set index val -f; eval $csym; $val; then
14992 if set strchr val -f d_strchr; eval $csym; $val; then
14993 if $contains strchr "$strings" >/dev/null 2>&1 ; then
14996 echo "strchr() found." >&4
15000 echo "index() found." >&4
15005 echo "index() found." >&4
15008 if set strchr val -f d_strchr; eval $csym; $val; then
15011 echo "strchr() found." >&4
15013 echo "No index() or strchr() found!" >&4
15018 set d_strchr; eval $setvar
15020 set d_index; eval $setvar
15022 : check whether inet_aton exists
15023 set inet_aton d_inetaton
15026 : see if inet_ntop exists
15027 set inet_ntop d_inetntop
15030 : see if inet_pton exists
15031 set inet_pton d_inetpton
15036 $cat >isascii.c <<EOCP
15039 #$i_stdlib I_STDLIB
15041 #include <stdlib.h>
15052 if eval $compile; then
15053 echo "isascii() found." >&4
15056 echo "isascii() NOT found." >&4
15065 $cat >isblank.c <<'EOCP'
15076 if $cc $ccflags $ldflags -o isblank isblank.c $libs >/dev/null 2>&1 ; then
15077 echo "isblank() found." >&4
15080 echo "isblank() NOT found." >&4
15087 : see if isfinite exists
15088 set isfinite d_isfinite
15091 : see if isinf exists
15095 : see if isnan exists
15099 : see if isnanl exists
15100 set isnanl d_isnanl
15103 : see if killpg exists
15104 set killpg d_killpg
15107 : see if lchown exists
15109 $cat > try.c <<'EOCP'
15110 /* System header to define __stub macros and hopefully few prototypes,
15111 which can conflict with char lchown(); below. */
15112 #include <assert.h>
15113 /* Override any gcc2 internal prototype to avoid an error. */
15114 /* We use char because int might match the return type of a gcc2
15115 builtin and then its argument prototype would still apply. */
15118 /* The GNU C library defines this for functions which it implements
15119 to always fail with ENOSYS. Some functions are actually named
15120 something starting with __ and the normal name is an alias. */
15121 #if defined (__stub_lchown) || defined (__stub___lchown)
15129 if eval $compile; then
15130 $echo "lchown() found." >&4
15133 $echo "lchown() NOT found." >&4
15139 : See if number of significant digits in a double precision number is known
15141 $cat >ldbl_dig.c <<EOM
15142 #$i_limits I_LIMITS
15145 #include <limits.h>
15151 printf("Contains LDBL_DIG");
15154 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
15155 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
15156 echo "LDBL_DIG found." >&4
15159 echo "LDBL_DIG NOT found." >&4
15166 : see if this is a math.h system
15170 : check to see if math.h defines _LIB_VERSION
15171 d_libm_lib_version="$undef"
15175 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
15177 #include <unistd.h>
15179 int main (int argc, char *argv[])
15181 printf ("%d\n", _LIB_VERSION);
15186 if eval $compile; then
15188 echo "Yes, it does ($foo)" >&4
15189 d_libm_lib_version="$define"
15191 echo "No, it does not (probably harmless)" >&4
15198 : see if link exists
15202 : see if localtime_r exists
15203 set localtime_r d_localtime_r
15205 case "$d_localtime_r" in
15207 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15208 case "$d_localtime_r_proto:$usethreads" in
15209 ":define") d_localtime_r_proto=define
15210 set d_localtime_r_proto localtime_r $hdrs
15214 case "$d_localtime_r_proto" in
15216 case "$localtime_r_proto" in
15217 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
15218 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=S_TS ;;
15220 case "$localtime_r_proto" in
15221 ''|0) try='int localtime_r(const time_t*, struct tm*);'
15222 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=I_TS ;;
15224 case "$localtime_r_proto" in
15225 ''|0) d_localtime_r=undef
15226 localtime_r_proto=0
15227 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
15228 * ) case "$localtime_r_proto" in
15229 REENTRANT_PROTO*) ;;
15230 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
15232 echo "Prototype: $try" ;;
15235 *) case "$usethreads" in
15236 define) echo "localtime_r has no prototype, not using it." >&4 ;;
15238 d_localtime_r=undef
15239 localtime_r_proto=0
15243 *) localtime_r_proto=0
15247 : see if localtime_r calls tzset
15248 case "$localtime_r_proto" in
15251 /* Does our libc's localtime_r call tzset ?
15252 * return 0 if so, 1 otherwise.
15254 #$i_systypes I_SYS_TYPES
15255 #$i_unistd I_UNISTD
15257 #$i_stdlib I_STDLIB
15258 #$i_string I_STRING
15259 #$i_malloc I_MALLOC
15261 # include <sys/types.h>
15264 # include <unistd.h>
15270 #include <stdlib.h>
15273 # include <string.h>
15275 # include <strings.h>
15278 # include <malloc.h>
15282 time_t t = time(0L);
15283 char w_tz[]="TZ" "=GMT+5",
15284 e_tz[]="TZ" "=GMT-5",
15285 *tz_e = (char*)malloc(16),
15286 *tz_w = (char*)malloc(16);
15287 struct tm tm_e, tm_w;
15288 memset(&tm_e,'\0',sizeof(struct tm));
15289 memset(&tm_w,'\0',sizeof(struct tm));
15294 localtime_r(&t, &tm_e);
15297 localtime_r(&t, &tm_w);
15299 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
15305 if eval $compile; then
15306 if $run ./try; then
15307 d_localtime_r_needs_tzset=undef;
15309 d_localtime_r_needs_tzset=define;
15312 d_localtime_r_needs_tzset=undef;
15316 d_localtime_r_needs_tzset=undef;
15321 : see if localeconv exists
15322 set localeconv d_locconv
15325 : see if lockf exists
15329 : see if prototype for lseek is available
15331 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
15334 : see if lstat exists
15338 : see if madvise exists
15339 set madvise d_madvise
15342 : see if malloc_size exists
15343 set malloc_size d_malloc_size
15346 : see if malloc_size_good exists
15347 set malloc_good_size d_malloc_good_size
15350 : see if mblen exists
15354 : see if mbstowcs exists
15355 set mbstowcs d_mbstowcs
15358 : see if mbtowc exists
15359 set mbtowc d_mbtowc
15362 : see if memchr exists
15363 set memchr d_memchr
15366 : see if memcmp exists
15367 set memcmp d_memcmp
15370 : see if memcpy exists
15371 set memcpy d_memcpy
15374 : see if memmove exists
15375 set memmove d_memmove
15378 : see if memset exists
15379 set memset d_memset
15382 : see if mkdir exists
15386 : see if mkdtemp exists
15387 set mkdtemp d_mkdtemp
15390 : see if mkfifo exists
15391 set mkfifo d_mkfifo
15394 : see if mkstemp exists
15395 set mkstemp d_mkstemp
15398 : see if mkstemps exists
15399 set mkstemps d_mkstemps
15402 : see if mktime exists
15403 set mktime d_mktime
15406 : see if this is a sys/mman.h system
15407 set sys/mman.h i_sysmman
15410 : see if mmap exists
15413 : see what shmat returns
15414 : default to something harmless
15416 case "$i_sysmman$d_mmap" in
15418 $cat >mmap.c <<'END'
15419 #include <sys/mman.h>
15422 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
15427 echo "and it returns ($mmaptype)." >&4
15433 : see if sqrtl exists
15437 : see if scalbnl exists
15438 set scalbnl d_scalbnl
15441 : see if modfl exists
15445 : see if prototype for modfl is available
15447 set d_modflproto modfl $i_math math.h
15450 d_modfl_pow32_bug="$undef"
15452 case "$d_longdbl$d_modfl" in
15455 Checking to see whether your modfl() is okay for large values...
15461 if $test "X$d_modflproto" != "X$define"; then
15462 $cat >>try.c <<EOCP
15463 /* Sigh. many current glibcs provide the function, but do not prototype it. */
15464 long double modfl (long double, long double *);
15467 $cat >>try.c <<EOCP
15469 long double nv = 4294967303.15;
15475 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
15479 case "$osname:$gccversion" in
15480 aix:) saveccflags="$ccflags"
15481 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
15484 if eval $compile; then
15487 *" 4294967303.150000 1.150000 4294967302.000000")
15488 echo >&4 "Your modfl() is broken for large values."
15489 d_modfl_pow32_bug="$define"
15491 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
15495 *" 4294967303.150000 0.150000 4294967303.000000")
15496 echo >&4 "Your modfl() seems okay for large values."
15498 *) echo >&4 "I don't understand your modfl() at all."
15504 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
15507 case "$osname:$gccversion" in
15508 aix:) ccflags="$saveccflags" ;; # restore
15513 if $test "$uselongdouble" = "$define"; then
15515 if $test "$d_sqrtl" != "$define"; then
15516 message="$message sqrtl"
15518 if $test "$d_modfl" != "$define"; then
15519 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
15520 echo "You have both aintl and copysignl, so I can emulate modfl."
15522 message="$message modfl"
15525 if $test "$d_frexpl" != "$define"; then
15526 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
15527 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
15529 message="$message frexpl"
15533 if $test "$message" != ""; then
15536 *** You requested the use of long doubles but you do not seem to have
15537 *** the following mathematical functions needed for long double support:
15539 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
15540 *** Cannot continue, aborting.
15548 : see if mprotect exists
15549 set mprotect d_mprotect
15552 : see if msgctl exists
15553 set msgctl d_msgctl
15556 : see if msgget exists
15557 set msgget d_msgget
15560 : see if msgsnd exists
15561 set msgsnd d_msgsnd
15564 : see if msgrcv exists
15565 set msgrcv d_msgrcv
15568 : see how much of the 'msg*(2)' library is present.
15571 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
15572 *"$undef"*) h_msg=false;;
15576 case "`ipcs 2>&1`" in
15577 "SVID messages"*"not configured"*)
15578 echo "Your $osname does not have the msg*(2) configured." >&4
15581 set msgctl d_msgctl
15583 set msgget d_msgget
15585 set msgsnd d_msgsnd
15587 set msgrcv d_msgrcv
15593 : we could also check for sys/ipc.h ...
15594 if $h_msg && $test `./findhdr sys/msg.h`; then
15595 echo "You have the full msg*(2) library." >&4
15598 echo "You don't have the full msg*(2) library." >&4
15604 : Check for msghdr_s
15606 echo "Checking to see if your system supports struct msghdr..." >&4
15607 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
15609 case "$d_msghdr_s" in
15610 "$define") echo "Yes, it does." ;;
15611 *) echo "No, it doesn't." ;;
15615 : see if msync exists
15619 : see if munmap exists
15620 set munmap d_munmap
15623 : see if nice exists
15627 : see if this is a langinfo.h system
15628 set langinfo.h i_langinfo
15631 : see if nl_langinfo exists
15632 set nl_langinfo d_nl_langinfo
15635 : check for volatile keyword
15637 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
15638 $cat >try.c <<'EOCP'
15641 typedef struct _goo_struct goo_struct;
15642 goo_struct * volatile goo = ((goo_struct *)0);
15643 struct _goo_struct {
15648 typedef unsigned short foo_t;
15649 char *volatile foo;
15651 volatile foo_t blech;
15655 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
15657 echo "Yup, it does."
15660 echo "Nope, it doesn't."
15666 : Check basic sizes
15668 $echo "Choosing the C types to be used for Perl's internal types..." >&4
15670 case "$use64bitint:$d_quad:$quadtype" in
15673 uvtype="$uquadtype"
15678 uvtype="unsigned long"
15684 case "$uselongdouble:$d_longdbl" in
15686 nvtype="long double"
15687 nvsize=$longdblsize
15694 $echo "(IV will be "$ivtype", $ivsize bytes)"
15695 $echo "(UV will be "$uvtype", $uvsize bytes)"
15696 $echo "(NV will be "$nvtype", $nvsize bytes)"
15699 #$i_inttypes I_INTTYPES
15701 #include <inttypes.h>
15706 int8_t i = INT8_MAX;
15707 uint8_t u = UINT8_MAX;
15708 printf("int8_t\n");
15711 int16_t i = INT16_MAX;
15712 uint16_t i = UINT16_MAX;
15713 printf("int16_t\n");
15716 int32_t i = INT32_MAX;
15717 uint32_t u = UINT32_MAX;
15718 printf("int32_t\n");
15723 i8type="signed char"
15724 u8type="unsigned char"
15729 '') case "$shortsize" in
15731 u16type="unsigned short"
15739 '') set try -DINT16
15740 if eval $compile; then
15741 case "`$run ./try`" in
15753 '') if $test $shortsize -ge 2; then
15755 u16type="unsigned short"
15763 '') case "$longsize" in
15765 u32type="unsigned long"
15769 *) case "$intsize" in
15771 u32type="unsigned int"
15781 '') set try -DINT32
15782 if eval $compile; then
15783 case "`$run ./try`" in
15795 '') if $test $intsize -ge 4; then
15797 u32type="unsigned int"
15805 '') case "$d_quad:$quadtype" in
15807 i64type="$quadtype"
15808 u64type="$uquadtype"
15816 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
15817 : volatile so that the compiler has to store it out to memory.
15818 if test X"$d_volatile" = X"$define"; then
15823 #$i_stdlib I_STDLIB
15825 #include <stdlib.h>
15827 #include <sys/types.h>
15828 #include <signal.h>
15830 $volatile int bletched = 0;
15831 $signal_t blech(int s) { bletched = 1; }
15836 int n = 8 * $uvsize;
15839 signal(SIGFPE, blech);
15842 for (i = 0; i < n; i++) {
15843 u = u << 1 | ($uvtype)1;
15845 if (($uvtype)d != u)
15849 d = ($nvtype)(u - 1);
15850 if (($uvtype)d != (u - 1))
15857 printf("%d\n", ((i == n) ? -n : i));
15863 d_nv_preserves_uv="$undef"
15864 if eval $compile; then
15865 nv_preserves_uv_bits="`$run ./try`"
15867 case "$nv_preserves_uv_bits" in
15869 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
15870 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
15871 d_nv_preserves_uv="$define"
15873 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
15874 d_nv_preserves_uv="$undef" ;;
15875 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
15876 nv_preserves_uv_bits="0" ;;
15880 $echo "Checking to find the largest integer value your NVs can hold..." >&4
15881 : volatile so that the compiler has to store it out to memory.
15882 if test X"$d_volatile" = X"$define"; then
15888 typedef $nvtype NV;
15895 while(count < 256) {
15896 $volatile NV up = value + 1.0;
15897 $volatile NV negated = -value;
15898 $volatile NV down = negated - 1.0;
15899 $volatile NV got_up = up - value;
15900 int up_good = got_up == 1.0;
15901 int got_down = down - negated;
15902 int down_good = got_down == -1.0;
15904 if (down_good != up_good) {
15906 "Inconsistency - up %d %f; down %d %f; for 2**%d (%.20f)\n",
15907 up_good, (double) got_up, down_good, (double) got_down,
15908 count, (double) value);
15915 fputs("256.0", stdout);
15918 fputs("2.0", stdout);
15924 fputs("*", stdout);
15930 fprintf(stderr, "Cannot overflow integer range, even at 2**%d (%.20f)\n",
15931 count, (double) value);
15937 nv_overflows_integers_at='0'
15938 if eval $compile; then
15944 The largest integer your NVs can preserve is equal to $xxx
15946 nv_overflows_integers_at="$xxx"
15949 Cannot determine the largest integer value your NVs can hold, unexpected output
15956 Cannot determine the largest integer value your NVs can hold
15963 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
15964 : volatile so that the compiler has to store it out to memory.
15965 if test X"$d_volatile" = X"$define"; then
15970 #$i_stdlib I_STDLIB
15972 #include <stdlib.h>
15974 #$i_string I_STRING
15976 # include <string.h>
15978 # include <strings.h>
15980 #include <sys/types.h>
15981 #include <signal.h>
15983 $volatile int bletched = 0;
15984 $signal_t blech(int s) { bletched = 1; }
15987 int checkit($nvtype d, char *where) {
15988 unsigned char *p = (char *)&d;
15989 unsigned char *end = p + sizeof(d);
15999 printf("No - %s: 0x", where);
16001 printf ("%02X", *p++);
16006 int main(int argc, char **argv) {
16009 fail += checkit(d, "0.0");
16011 /* The compiler shouldn't be assuming that bletched is 0 */
16014 fail += checkit(d, "bleched");
16017 signal(SIGFPE, blech);
16020 /* Paranoia - the compiler should have no way of knowing that ANSI says
16021 that argv[argc] will always be NULL. Actually, if it did assume this it
16022 would be buggy, as this is C and main() can be called from elsewhere in
16024 d = argv[argc] ? 1 : 0;
16027 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
16030 fail += checkit(d, "ternary");
16032 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
16035 printf("No - memset doesn't give 0.0\n");
16036 /* This might just blow up: */
16037 printf("(gives %g)\n", d);
16043 printf("No - something bleched\n");
16048 printf("No - %d fail(s)\n", fail);
16057 d_nv_zero_is_allbits_zero="$undef"
16058 if eval $compile; then
16064 0.0 is represented as all bits zero in memory
16066 d_nv_zero_is_allbits_zero="$define"
16069 0.0 is not represented as all bits zero in memory
16071 d_nv_zero_is_allbits_zero="$undef"
16076 0.0 is not represented as all bits zero in memory
16078 d_nv_zero_is_allbits_zero="$undef"
16084 : check for off64_t
16086 echo "Checking to see if you have off64_t..." >&4
16088 #include <sys/types.h>
16089 #include <unistd.h>
16090 int main() { off64_t x = 7; }
16093 if eval $compile; then
16095 echo "You have off64_t."
16098 echo "You do not have off64_t."
16099 case "$lseeksize" in
16100 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
16107 : how to create joinable pthreads
16108 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
16110 echo "Checking what constant to use for creating joinable pthreads..." >&4
16111 $cat >try.c <<'EOCP'
16112 #include <pthread.h>
16114 int detachstate = JOINABLE;
16117 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
16118 if eval $compile; then
16119 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
16120 val="$undef" # Yes, undef.
16121 set d_old_pthread_create_joinable
16124 set old_pthread_create_joinable
16127 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
16128 if eval $compile; then
16129 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
16131 set d_old_pthread_create_joinable
16133 val=PTHREAD_CREATE_UNDETACHED
16134 set old_pthread_create_joinable
16137 set try -DJOINABLE=__UNDETACHED
16138 if eval $compile; then
16139 echo "You seem to use __UNDETACHED." >&4
16141 set d_old_pthread_create_joinable
16144 set old_pthread_create_joinable
16147 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
16149 set d_old_pthread_create_joinable
16152 set old_pthread_create_joinable
16159 d_old_pthread_create_joinable="$undef"
16160 old_pthread_create_joinable=""
16163 : see if pause exists
16167 : see if poll exists
16171 : see if prctl exists
16175 : see if prctl supports PR_SET_NAME
16176 d_prctl_set_name=$undef
16180 #include <sys/prctl.h>
16182 int main (int argc, char *argv[])
16184 return (prctl (PR_SET_NAME, "Test"));
16188 if eval $compile_ok && $run ./try; then
16189 echo "Your prctl (PR_SET_NAME, ...) works"
16190 d_prctl_set_name=$define
16196 : see if readlink exists
16197 set readlink d_readlink
16200 : Check if exe is symlink to abs path of executing program
16204 case "$d_readlink" in
16206 : NetBSD first as /proc/self is a symlink to /proc/curproc, and it feels
16207 : more tidy to avoid an extra level of symlink
16208 set NetBSD /proc/curproc/exe Linux /proc/self/exe FreeBSD /proc/curproc/file Solaris /proc/self/path/a.out
16209 while test $# -gt 0; do
16212 if $issymlink $try; then
16213 $ls -l $try > reflect
16214 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
16215 echo "You have $type-like $try."
16216 procselfexe='"'$try'"'
16218 : This will break out of the loop
16229 : backward compatibility for d_hvfork
16230 if test X$d_hvfork != X; then
16231 d_vfork="$d_hvfork"
16234 : see if there is a vfork
16239 d_pseudofork=$undef
16241 : Ok, but do we want to use it. vfork is reportedly unreliable in
16242 : perl on Solaris 2.x, and probably elsewhere.
16246 case "$usevfork" in
16252 Perl can only use a vfork() that doesn't suffer from strict
16253 restrictions on calling functions or modifying global data in
16254 the child. For example, glibc-2.1 contains such a vfork()
16255 that is unsuitable. If your system provides a proper fork()
16256 call, chances are that you do NOT want perl to use vfork().
16259 rp="Do you still want to use vfork()?"
16264 echo "Ok, we won't use vfork()."
16273 $define) usevfork='true';;
16274 *) usevfork='false';;
16277 : see whether the pthread_atfork exists
16279 #include <pthread.h>
16282 #ifdef PTHREAD_ATFORK
16283 pthread_atfork(NULL,NULL,NULL);
16288 : see if pthread_atfork exists
16289 set try -DPTHREAD_ATFORK
16290 if eval $compile; then
16295 case "$usethreads" in
16298 $define) echo 'pthread_atfork found.' >&4 ;;
16299 *) echo 'pthread_atfork NOT found.' >&4 ;;
16302 set d_pthread_atfork
16305 : see if pthread_attr_setscope exists
16306 set pthread_attr_setscope d_pthread_attr_setscope
16309 : see whether the various POSIXish _yields exist
16311 #include <pthread.h>
16317 #ifdef PTHREAD_YIELD
16320 #ifdef PTHREAD_YIELD_NULL
16321 pthread_yield(NULL);
16327 : see if sched_yield exists
16328 set try -DSCHED_YIELD
16329 if eval $compile; then
16331 sched_yield='sched_yield()'
16335 case "$usethreads" in
16338 $define) echo 'sched_yield() found.' >&4 ;;
16339 *) echo 'sched_yield() NOT found.' >&4 ;;
16345 : see if pthread_yield exists
16346 set try -DPTHREAD_YIELD
16347 if eval $compile; then
16349 case "$sched_yield" in
16350 '') sched_yield='pthread_yield()' ;;
16353 set try -DPTHREAD_YIELD_NULL
16354 if eval $compile; then
16356 case "$sched_yield" in
16357 '') sched_yield='pthread_yield(NULL)' ;;
16363 case "$usethreads" in
16366 $define) echo 'pthread_yield() found.' >&4 ;;
16367 *) echo 'pthread_yield() NOT found.' >&4 ;;
16371 set d_pthread_yield
16373 case "$sched_yield" in
16374 '') sched_yield=undef ;;
16378 : see if random_r exists
16379 set random_r d_random_r
16381 case "$d_random_r" in
16383 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16384 case "$d_random_r_proto:$usethreads" in
16385 ":define") d_random_r_proto=define
16386 set d_random_r_proto random_r $hdrs
16390 case "$d_random_r_proto" in
16392 case "$random_r_proto" in
16393 ''|0) try='int random_r(int*, struct random_data*);'
16394 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_iS ;;
16396 case "$random_r_proto" in
16397 ''|0) try='int random_r(long*, struct random_data*);'
16398 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_lS ;;
16400 case "$random_r_proto" in
16401 ''|0) try='int random_r(struct random_data*, int32_t*);'
16402 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_St ;;
16404 case "$random_r_proto" in
16405 ''|0) d_random_r=undef
16407 echo "Disabling random_r, cannot determine prototype." >&4 ;;
16408 * ) case "$random_r_proto" in
16409 REENTRANT_PROTO*) ;;
16410 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
16412 echo "Prototype: $try" ;;
16415 *) case "$usethreads" in
16416 define) echo "random_r has no prototype, not using it." >&4 ;;
16423 *) random_r_proto=0
16427 : see if readdir and friends exist
16428 set readdir d_readdir
16430 set seekdir d_seekdir
16432 set telldir d_telldir
16434 set rewinddir d_rewinddir
16437 : see if readdir64_r exists
16438 set readdir64_r d_readdir64_r
16440 case "$d_readdir64_r" in
16442 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16443 case "$d_readdir64_r_proto:$usethreads" in
16444 ":define") d_readdir64_r_proto=define
16445 set d_readdir64_r_proto readdir64_r $hdrs
16449 case "$d_readdir64_r_proto" in
16451 case "$readdir64_r_proto" in
16452 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
16453 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TSR ;;
16455 case "$readdir64_r_proto" in
16456 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
16457 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TS ;;
16459 case "$readdir64_r_proto" in
16460 ''|0) d_readdir64_r=undef
16461 readdir64_r_proto=0
16462 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
16463 * ) case "$readdir64_r_proto" in
16464 REENTRANT_PROTO*) ;;
16465 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
16467 echo "Prototype: $try" ;;
16470 *) case "$usethreads" in
16471 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
16473 d_readdir64_r=undef
16474 readdir64_r_proto=0
16478 *) readdir64_r_proto=0
16482 : see if readdir_r exists
16483 set readdir_r d_readdir_r
16485 case "$d_readdir_r" in
16487 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16488 case "$d_readdir_r_proto:$usethreads" in
16489 ":define") d_readdir_r_proto=define
16490 set d_readdir_r_proto readdir_r $hdrs
16494 case "$d_readdir_r_proto" in
16496 case "$readdir_r_proto" in
16497 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
16498 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TSR ;;
16500 case "$readdir_r_proto" in
16501 ''|0) try='int readdir_r(DIR*, struct dirent*);'
16502 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TS ;;
16504 case "$readdir_r_proto" in
16505 ''|0) d_readdir_r=undef
16507 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
16508 * ) case "$readdir_r_proto" in
16509 REENTRANT_PROTO*) ;;
16510 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
16512 echo "Prototype: $try" ;;
16515 *) case "$usethreads" in
16516 define) echo "readdir_r has no prototype, not using it." >&4 ;;
16523 *) readdir_r_proto=0
16527 : see if readv exists
16531 : see if recvmsg exists
16532 set recvmsg d_recvmsg
16535 : see if rename exists
16536 set rename d_rename
16539 : see if rmdir exists
16543 : see if memory.h is available.
16548 : See if it conflicts with string.h
16554 $cppstdin $cppflags $cppminus < $strings > mem.h
16555 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
16557 echo "We won't be including <memory.h>."
16567 : can bcopy handle overlapping blocks?
16570 case "$d_memmove" in
16571 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
16572 *) case "$d_bcopy" in
16574 echo "Checking to see if bcopy() can do overlapping copies..." >&4
16576 #$i_memory I_MEMORY
16577 #$i_stdlib I_STDLIB
16578 #$i_string I_STRING
16579 #$i_unistd I_UNISTD
16581 $cat >>try.c <<'EOCP'
16584 # include <memory.h>
16587 # include <stdlib.h>
16590 # include <string.h>
16592 # include <strings.h>
16595 # include <unistd.h> /* Needed for NetBSD */
16599 char buf[128], abc[128];
16605 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16606 try to store the string in read-only memory. */
16607 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
16609 for (align = 7; align >= 0; align--) {
16610 for (len = 36; len; len--) {
16612 bcopy(abc, b, len);
16613 for (off = 1; off <= len; off++) {
16614 bcopy(b, b+off, len);
16615 bcopy(b+off, b, len);
16616 if (bcmp(b, abc, len))
16625 if eval $compile_ok; then
16626 if $run ./try 2>/dev/null; then
16627 echo "Yes, it can."
16630 echo "It can't, sorry."
16633 echo "(I can't compile the test program, so we'll assume not...)"
16643 : can memcpy handle overlapping blocks?
16646 case "$d_memmove" in
16647 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
16648 *) case "$d_memcpy" in
16650 echo "Checking to see if memcpy() can do overlapping copies..." >&4
16652 #$i_memory I_MEMORY
16653 #$i_stdlib I_STDLIB
16654 #$i_string I_STRING
16655 #$i_unistd I_UNISTD
16657 $cat >>try.c <<'EOCP'
16660 # include <memory.h>
16663 # include <stdlib.h>
16666 # include <string.h>
16668 # include <strings.h>
16671 # include <unistd.h> /* Needed for NetBSD */
16675 char buf[128], abc[128];
16681 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16682 try to store the string in read-only memory. */
16683 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
16685 for (align = 7; align >= 0; align--) {
16686 for (len = 36; len; len--) {
16688 memcpy(b, abc, len);
16689 for (off = 1; off <= len; off++) {
16690 memcpy(b+off, b, len);
16691 memcpy(b, b+off, len);
16692 if (memcmp(b, abc, len))
16701 if eval $compile_ok; then
16702 if $run ./try 2>/dev/null; then
16703 echo "Yes, it can."
16706 echo "It can't, sorry."
16709 echo "(I can't compile the test program, so we'll assume not...)"
16719 : can memcmp be trusted to compare relative magnitude?
16721 case "$d_memcmp" in
16724 echo "Checking if your memcmp() can compare relative magnitude..." >&4
16726 #$i_memory I_MEMORY
16727 #$i_stdlib I_STDLIB
16728 #$i_string I_STRING
16729 #$i_unistd I_UNISTD
16731 $cat >>try.c <<'EOCP'
16734 # include <memory.h>
16737 # include <stdlib.h>
16740 # include <string.h>
16742 # include <strings.h>
16745 # include <unistd.h> /* Needed for NetBSD */
16751 if ((a < b) && memcmp(&a, &b, 1) < 0)
16757 if eval $compile_ok; then
16758 if $run ./try 2>/dev/null; then
16759 echo "Yes, it can."
16762 echo "No, it can't (it uses signed chars)."
16765 echo "(I can't compile the test program, so we'll assume not...)"
16773 : see if prototype for sbrk is available
16775 set d_sbrkproto sbrk $i_unistd unistd.h
16778 : see if select exists
16779 set select d_select
16782 : see if semctl exists
16783 set semctl d_semctl
16786 : see if semget exists
16787 set semget d_semget
16790 : see if semop exists
16794 : see how much of the 'sem*(2)' library is present.
16797 case "$d_semctl$d_semget$d_semop" in
16798 *"$undef"*) h_sem=false;;
16802 case "`ipcs 2>&1`" in
16803 "SVID messages"*"not configured"*)
16804 echo "Your $osname does not have the sem*(2) configured." >&4
16807 set semctl d_semctl
16809 set semget d_semget
16817 : we could also check for sys/ipc.h ...
16818 if $h_sem && $test `./findhdr sys/sem.h`; then
16819 echo "You have the full sem*(2) library." >&4
16822 echo "You don't have the full sem*(2) library." >&4
16828 : see whether sys/sem.h defines union semun
16830 $cat > try.c <<'END'
16831 #include <sys/types.h>
16832 #include <sys/ipc.h>
16833 #include <sys/sem.h>
16834 int main () { union semun semun; semun.buf = 0; }
16837 if eval $compile; then
16838 echo "You have union semun in <sys/sem.h>." >&4
16841 echo "You do not have union semun in <sys/sem.h>." >&4
16848 : see how to do semctl IPC_STAT
16852 $cat > tryh.h <<END
16855 # define S_IRUSR S_IREAD
16856 # define S_IWUSR S_IWRITE
16857 # define S_IXUSR S_IEXEC
16859 # define S_IRUSR 0400
16860 # define S_IWUSR 0200
16861 # define S_IXUSR 0100
16863 # define S_IRGRP (S_IRUSR>>3)
16864 # define S_IWGRP (S_IWUSR>>3)
16865 # define S_IXGRP (S_IXUSR>>3)
16866 # define S_IROTH (S_IRUSR>>6)
16867 # define S_IWOTH (S_IWUSR>>6)
16868 # define S_IXOTH (S_IXUSR>>6)
16871 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
16872 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
16873 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
16876 : see whether semctl IPC_STAT can use union semun
16877 case "$d_semctl_semun" in
16881 #include <sys/types.h>
16882 #include <sys/ipc.h>
16883 #include <sys/sem.h>
16884 #include <sys/stat.h>
16891 #$d_union_semun HAS_UNION_SEMUN
16894 #ifndef HAS_UNION_SEMUN
16897 struct semid_ds *buf;
16898 unsigned short *array;
16904 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16905 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16907 struct semid_ds argbuf;
16910 st = semctl(sem, 0, IPC_STAT, arg);
16914 # endif /* IPC_STAT */
16915 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16917 if (semctl(sem, 0, IPC_RMID, arg) != 0)
16918 # endif /* IPC_RMID */
16919 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16921 #endif /* IPC_PRIVATE && ... */
16922 printf("semget failed: errno = %d\n", errno);
16927 if eval $compile; then
16930 semun) val="$define" ;;
16938 case "$d_semctl_semun" in
16940 echo "You can use union semun for semctl IPC_STAT." >&4
16943 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
16948 : see whether semctl IPC_STAT can use struct semid_ds pointer
16949 case "$d_semctl_semid_ds" in
16952 $cat > try.c <<'END'
16953 #include <sys/types.h>
16954 #include <sys/ipc.h>
16955 #include <sys/sem.h>
16956 #include <sys/stat.h>
16964 struct semid_ds arg;
16967 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16968 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16971 st = semctl(sem, 0, IPC_STAT, &arg);
16973 printf("semid_ds\n");
16975 # endif /* IPC_STAT */
16976 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16978 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
16979 # endif /* IPC_RMID */
16980 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16982 #endif /* IPC_PRIVATE && ... */
16983 printf("semget failed: errno = %d\n", errno);
16989 if eval $compile; then
16992 semid_ds) val="$define" ;;
16996 set d_semctl_semid_ds
17000 case "$d_semctl_semid_ds" in
17002 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
17004 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
17010 # We do not have the full sem*(2) library, so assume we can not
17016 set d_semctl_semid_ds
17022 : see if sendmsg exists
17023 set sendmsg d_sendmsg
17026 : see if setegid exists
17027 set setegid d_setegid
17030 : see if seteuid exists
17031 set seteuid d_seteuid
17034 : see if setgrent exists
17035 set setgrent d_setgrent
17038 : see if setgrent_r exists
17039 set setgrent_r d_setgrent_r
17041 case "$d_setgrent_r" in
17043 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
17044 case "$d_setgrent_r_proto:$usethreads" in
17045 ":define") d_setgrent_r_proto=define
17046 set d_setgrent_r_proto setgrent_r $hdrs
17050 case "$d_setgrent_r_proto" in
17052 case "$setgrent_r_proto" in
17053 ''|0) try='int setgrent_r(FILE**);'
17054 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=I_H ;;
17056 case "$setgrent_r_proto" in
17057 ''|0) try='void setgrent_r(FILE**);'
17058 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=V_H ;;
17060 case "$setgrent_r_proto" in
17061 ''|0) d_setgrent_r=undef
17063 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
17064 * ) case "$setgrent_r_proto" in
17065 REENTRANT_PROTO*) ;;
17066 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
17068 echo "Prototype: $try" ;;
17071 *) case "$usethreads" in
17072 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
17079 *) setgrent_r_proto=0
17083 : see if sethostent exists
17084 set sethostent d_sethent
17087 : see if sethostent_r exists
17088 set sethostent_r d_sethostent_r
17090 case "$d_sethostent_r" in
17092 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17093 case "$d_sethostent_r_proto:$usethreads" in
17094 ":define") d_sethostent_r_proto=define
17095 set d_sethostent_r_proto sethostent_r $hdrs
17099 case "$d_sethostent_r_proto" in
17101 case "$sethostent_r_proto" in
17102 ''|0) try='int sethostent_r(int, struct hostent_data*);'
17103 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=I_ID ;;
17105 case "$sethostent_r_proto" in
17106 ''|0) try='void sethostent_r(int, struct hostent_data*);'
17107 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=V_ID ;;
17109 case "$sethostent_r_proto" in
17110 ''|0) d_sethostent_r=undef
17111 sethostent_r_proto=0
17112 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
17113 * ) case "$sethostent_r_proto" in
17114 REENTRANT_PROTO*) ;;
17115 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
17117 echo "Prototype: $try" ;;
17120 *) case "$usethreads" in
17121 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
17123 d_sethostent_r=undef
17124 sethostent_r_proto=0
17128 *) sethostent_r_proto=0
17132 : see if setitimer exists
17133 set setitimer d_setitimer
17136 : see if setlinebuf exists
17137 set setlinebuf d_setlinebuf
17140 : see if setlocale exists
17141 set setlocale d_setlocale
17144 : see if locale.h is available
17145 set locale.h i_locale
17148 : see if setlocale_r exists
17149 set setlocale_r d_setlocale_r
17151 case "$d_setlocale_r" in
17153 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
17154 case "$d_setlocale_r_proto:$usethreads" in
17155 ":define") d_setlocale_r_proto=define
17156 set d_setlocale_r_proto setlocale_r $hdrs
17160 case "$d_setlocale_r_proto" in
17162 case "$setlocale_r_proto" in
17163 ''|0) try='int setlocale_r(int, const char*, char*, int);'
17164 ./protochk "$extern_C $try" $hdrs && setlocale_r_proto=I_ICBI ;;
17166 case "$setlocale_r_proto" in
17167 ''|0) d_setlocale_r=undef
17168 setlocale_r_proto=0
17169 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
17170 * ) case "$setlocale_r_proto" in
17171 REENTRANT_PROTO*) ;;
17172 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
17174 echo "Prototype: $try" ;;
17177 *) case "$usethreads" in
17178 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
17180 d_setlocale_r=undef
17181 setlocale_r_proto=0
17185 *) setlocale_r_proto=0
17189 : see if setnetent exists
17190 set setnetent d_setnent
17193 : see if setnetent_r exists
17194 set setnetent_r d_setnetent_r
17196 case "$d_setnetent_r" in
17198 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17199 case "$d_setnetent_r_proto:$usethreads" in
17200 ":define") d_setnetent_r_proto=define
17201 set d_setnetent_r_proto setnetent_r $hdrs
17205 case "$d_setnetent_r_proto" in
17207 case "$setnetent_r_proto" in
17208 ''|0) try='int setnetent_r(int, struct netent_data*);'
17209 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=I_ID ;;
17211 case "$setnetent_r_proto" in
17212 ''|0) try='void setnetent_r(int, struct netent_data*);'
17213 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=V_ID ;;
17215 case "$setnetent_r_proto" in
17216 ''|0) d_setnetent_r=undef
17217 setnetent_r_proto=0
17218 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
17219 * ) case "$setnetent_r_proto" in
17220 REENTRANT_PROTO*) ;;
17221 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
17223 echo "Prototype: $try" ;;
17226 *) case "$usethreads" in
17227 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
17229 d_setnetent_r=undef
17230 setnetent_r_proto=0
17234 *) setnetent_r_proto=0
17238 : see if setprotoent exists
17239 set setprotoent d_setpent
17242 : see if setpgid exists
17243 set setpgid d_setpgid
17246 : see if setpgrp2 exists
17247 set setpgrp2 d_setpgrp2
17250 : see if setpriority exists
17251 set setpriority d_setprior
17254 : see if setproctitle exists
17255 set setproctitle d_setproctitle
17258 : see if setprotoent_r exists
17259 set setprotoent_r d_setprotoent_r
17261 case "$d_setprotoent_r" in
17263 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17264 case "$d_setprotoent_r_proto:$usethreads" in
17265 ":define") d_setprotoent_r_proto=define
17266 set d_setprotoent_r_proto setprotoent_r $hdrs
17270 case "$d_setprotoent_r_proto" in
17272 case "$setprotoent_r_proto" in
17273 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
17274 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=I_ID ;;
17276 case "$setprotoent_r_proto" in
17277 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
17278 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=V_ID ;;
17280 case "$setprotoent_r_proto" in
17281 ''|0) d_setprotoent_r=undef
17282 setprotoent_r_proto=0
17283 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
17284 * ) case "$setprotoent_r_proto" in
17285 REENTRANT_PROTO*) ;;
17286 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
17288 echo "Prototype: $try" ;;
17291 *) case "$usethreads" in
17292 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
17294 d_setprotoent_r=undef
17295 setprotoent_r_proto=0
17299 *) setprotoent_r_proto=0
17303 : see if setpwent exists
17304 set setpwent d_setpwent
17307 : see if setpwent_r exists
17308 set setpwent_r d_setpwent_r
17310 case "$d_setpwent_r" in
17312 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
17313 case "$d_setpwent_r_proto:$usethreads" in
17314 ":define") d_setpwent_r_proto=define
17315 set d_setpwent_r_proto setpwent_r $hdrs
17319 case "$d_setpwent_r_proto" in
17321 case "$setpwent_r_proto" in
17322 ''|0) try='int setpwent_r(FILE**);'
17323 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=I_H ;;
17325 case "$setpwent_r_proto" in
17326 ''|0) try='void setpwent_r(FILE**);'
17327 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=V_H ;;
17329 case "$setpwent_r_proto" in
17330 ''|0) d_setpwent_r=undef
17332 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
17333 * ) case "$setpwent_r_proto" in
17334 REENTRANT_PROTO*) ;;
17335 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
17337 echo "Prototype: $try" ;;
17340 *) case "$usethreads" in
17341 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
17348 *) setpwent_r_proto=0
17352 : see if setregid exists
17353 set setregid d_setregid
17355 set setresgid d_setresgid
17358 : see if setreuid exists
17359 set setreuid d_setreuid
17361 set setresuid d_setresuid
17364 : see if setrgid exists
17365 set setrgid d_setrgid
17368 : see if setruid exists
17369 set setruid d_setruid
17372 : see if setservent exists
17373 set setservent d_setsent
17376 : see if setservent_r exists
17377 set setservent_r d_setservent_r
17379 case "$d_setservent_r" in
17381 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17382 case "$d_setservent_r_proto:$usethreads" in
17383 ":define") d_setservent_r_proto=define
17384 set d_setservent_r_proto setservent_r $hdrs
17388 case "$d_setservent_r_proto" in
17390 case "$setservent_r_proto" in
17391 ''|0) try='int setservent_r(int, struct servent_data*);'
17392 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=I_ID ;;
17394 case "$setservent_r_proto" in
17395 ''|0) try='void setservent_r(int, struct servent_data*);'
17396 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=V_ID ;;
17398 case "$setservent_r_proto" in
17399 ''|0) d_setservent_r=undef
17400 setservent_r_proto=0
17401 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
17402 * ) case "$setservent_r_proto" in
17403 REENTRANT_PROTO*) ;;
17404 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
17406 echo "Prototype: $try" ;;
17409 *) case "$usethreads" in
17410 define) echo "setservent_r has no prototype, not using it." >&4 ;;
17412 d_setservent_r=undef
17413 setservent_r_proto=0
17417 *) setservent_r_proto=0
17421 : see if setsid exists
17422 set setsid d_setsid
17425 : see if setvbuf exists
17426 set setvbuf d_setvbuf
17429 : see if sfio.h is available
17433 : see if sfio library is available
17444 : Ok, but do we want to use it.
17448 true|$define|[yY]*) dflt='y';;
17451 echo "$package can use the sfio library, but it is experimental."
17452 rp="You seem to have sfio available, do you want to try using it?"
17455 y|Y) echo "Ok, turning on sfio then."
17458 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
17463 *) case "$usesfio" in
17464 true|$define|[yY]*)
17465 echo "Sorry, cannot find sfio on this machine." >&4
17466 echo "Ignoring your setting of usesfio=$usesfio." >&4
17475 $define) usesfio='true';;
17476 *) usesfio='false';;
17480 *) : Remove sfio from list of libraries to use
17483 echo "Removing unneeded -lsfio from library list" >&4
17484 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
17487 echo "libs = $libs" >&4
17494 : see if shmctl exists
17495 set shmctl d_shmctl
17498 : see if shmget exists
17499 set shmget d_shmget
17502 : see if shmat exists
17505 : see what shmat returns
17508 $cat >shmat.c <<'END'
17509 #include <sys/shm.h>
17512 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
17517 echo "and it returns ($shmattype)." >&4
17518 : see if a prototype for shmat is available
17519 xxx=`./findhdr sys/shm.h`
17520 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
17521 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
17532 set d_shmatprototype
17535 : see if shmdt exists
17539 : see how much of the 'shm*(2)' library is present.
17542 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
17543 *"$undef"*) h_shm=false;;
17547 case "`ipcs 2>&1`" in
17548 "SVID shared memory"*"not configured"*)
17549 echo "Your $osname does not have the shm*(2) configured." >&4
17552 set shmctl d_shmctl
17554 set shmget d_shmget
17564 : we could also check for sys/ipc.h ...
17565 if $h_shm && $test `./findhdr sys/shm.h`; then
17566 echo "You have the full shm*(2) library." >&4
17569 echo "You don't have the full shm*(2) library." >&4
17575 : see if we have sigaction
17577 if set sigaction val -f d_sigaction; eval $csym; $val; then
17578 echo 'sigaction() found.' >&4
17581 #include <sys/types.h>
17582 #include <signal.h>
17583 #$i_stdlib I_STDLIB
17585 #include <stdlib.h>
17589 struct sigaction act, oact;
17591 oact.sa_handler = 0;
17592 /* so that act and oact are used */
17593 exit(act.sa_flags == 0 && oact.sa_handler == 0);
17597 if eval $compile_ok; then
17600 echo "But you don't seem to have a useable struct sigaction." >&4
17604 echo 'sigaction NOT found.' >&4
17607 set d_sigaction; eval $setvar
17610 : see if this is a sunmath.h system
17611 set sunmath.h i_sunmath
17614 : see if signbit exists
17615 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
17618 #$i_sunmath I_SUNMATH
17622 #ifdef I_SUNMATH /* Solaris special math library */
17623 # include <sunmath.h>
17626 int main(int argc, char **argv)
17630 if ((signbit(x) == 0) && (signbit(y) != 0))
17638 if eval $compile; then
17639 if $run ./try; then
17643 $echo "Signbit seems to be available, but doesn't work as I expected."
17644 $echo "I won't use it." >&4
17655 : see if sigprocmask exists
17656 set sigprocmask d_sigprocmask
17659 : see if sigsetjmp exists
17661 case "$d_sigsetjmp" in
17664 #include <setjmp.h>
17665 #$i_stdlib I_STDLIB
17667 #include <stdlib.h>
17673 if (sigsetjmp(env,1))
17676 siglongjmp(env, 1);
17681 if eval $compile; then
17682 if $run ./try >/dev/null 2>&1; then
17683 echo "POSIX sigsetjmp found." >&4
17687 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
17693 echo "sigsetjmp not found." >&4
17697 *) val="$d_sigsetjmp"
17698 case "$d_sigsetjmp" in
17699 $define) echo "POSIX sigsetjmp found." >&4;;
17700 $undef) echo "sigsetjmp not found." >&4;;
17708 : see if snprintf exists
17709 set snprintf d_snprintf
17712 : see if vsnprintf exists
17713 set vsnprintf d_vsnprintf
17716 case "$d_snprintf-$d_vsnprintf" in
17719 Checking whether your snprintf() and vsnprintf() work okay...
17721 $cat >try.c <<'EOCP'
17722 /* v?snprintf testing logic courtesy of Russ Allbery.
17723 * According to C99:
17724 * - if the buffer is too short it still must be \0-terminated
17725 * - if the buffer is too short the potentially required length
17726 * must be returned and not -1
17727 * - if the buffer is NULL the potentially required length
17728 * must be returned and not -1 or core dump
17731 #include <stdarg.h>
17735 int test (char *format, ...)
17740 va_start (args, format);
17741 count = vsnprintf (buf, sizeof buf, format, args);
17748 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
17749 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
17753 if eval $compile; then
17756 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
17758 Your snprintf() and snprintf() don't seem to be working okay.
17760 d_snprintf="$undef"
17761 d_vsnprintf="$undef"
17765 echo "(I can't seem to compile the test program--assuming they don't)"
17766 d_snprintf="$undef"
17767 d_vsnprintf="$undef"
17773 : see if sockatmark exists
17774 set sockatmark d_sockatmark
17777 : see if prototype for sockatmark is available
17779 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
17782 : see if socks5_init exists
17783 set socks5_init d_socks5_init
17786 : see if sprintf returns the length of the string in the buffer as per ANSI
17787 $echo "Checking whether sprintf returns the length of the string..." >&4
17790 #$i_stdlib I_STDLIB
17792 #include <stdlib.h>
17794 #$i_string I_STRING
17796 # include <string.h>
17798 # include <strings.h>
17807 int check (size_t expect, int test) {
17808 size_t got = strlen(buffer);
17812 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
17817 int main(int argc, char **argv) {
17820 check(sprintf(buffer, ""), ++test);
17821 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
17822 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
17829 if eval $compile; then
17833 sprintf returns the length of the string (as ANSI says it should)
17835 d_sprintf_returns_strlen="$define"
17838 sprintf does not return the length of the string (how old is this system?)
17840 d_sprintf_returns_strlen="$undef"
17844 echo "(I can't seem to compile the test program--assuming it doesn't)" >&4
17845 d_sprintf_returns_strlen="$undef"
17849 : see if srand48_r exists
17850 set srand48_r d_srand48_r
17852 case "$d_srand48_r" in
17854 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17855 case "$d_srand48_r_proto:$usethreads" in
17856 ":define") d_srand48_r_proto=define
17857 set d_srand48_r_proto srand48_r $hdrs
17861 case "$d_srand48_r_proto" in
17863 case "$srand48_r_proto" in
17864 ''|0) try='int srand48_r(long, struct drand48_data*);'
17865 ./protochk "$extern_C $try" $hdrs && srand48_r_proto=I_LS ;;
17867 case "$srand48_r_proto" in
17868 ''|0) d_srand48_r=undef
17870 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
17871 * ) case "$srand48_r_proto" in
17872 REENTRANT_PROTO*) ;;
17873 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
17875 echo "Prototype: $try" ;;
17878 *) case "$usethreads" in
17879 define) echo "srand48_r has no prototype, not using it." >&4 ;;
17886 *) srand48_r_proto=0
17890 : see if srandom_r exists
17891 set srandom_r d_srandom_r
17893 case "$d_srandom_r" in
17895 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17896 case "$d_srandom_r_proto:$usethreads" in
17897 ":define") d_srandom_r_proto=define
17898 set d_srandom_r_proto srandom_r $hdrs
17902 case "$d_srandom_r_proto" in
17904 case "$srandom_r_proto" in
17905 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
17906 ./protochk "$extern_C $try" $hdrs && srandom_r_proto=I_TS ;;
17908 case "$srandom_r_proto" in
17909 ''|0) d_srandom_r=undef
17911 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
17912 * ) case "$srandom_r_proto" in
17913 REENTRANT_PROTO*) ;;
17914 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
17916 echo "Prototype: $try" ;;
17919 *) case "$usethreads" in
17920 define) echo "srandom_r has no prototype, not using it." >&4 ;;
17927 *) srandom_r_proto=0
17931 : see if prototype for setresgid is available
17933 set d_sresgproto setresgid $i_unistd unistd.h
17936 : see if prototype for setresuid is available
17938 set d_sresuproto setresuid $i_unistd unistd.h
17941 : see if sys/stat.h is available
17942 set sys/stat.h i_sysstat
17945 : see if stat knows about block sizes
17947 echo "Checking to see if your struct stat has st_blocks field..." >&4
17948 set d_statblks stat st_blocks $i_sysstat sys/stat.h
17951 : see if this is a sys/vfs.h system
17952 set sys/vfs.h i_sysvfs
17955 : see if this is a sys/statfs.h system
17956 set sys/statfs.h i_sysstatfs
17959 : Check for statfs_s
17961 echo "Checking to see if your system supports struct statfs..." >&4
17962 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
17964 case "$d_statfs_s" in
17965 "$define") echo "Yes, it does." ;;
17966 *) echo "No, it doesn't." ;;
17970 : see if struct statfs knows about f_flags
17971 case "$d_statfs_s" in
17974 echo "Checking to see if your struct statfs has f_flags field..." >&4
17975 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
17979 set d_statfs_f_flags
17983 case "$d_statfs_f_flags" in
17984 "$define") echo "Yes, it does." ;;
17985 *) echo "No, it doesn't." ;;
17988 : see what flavor, if any, of static inline is supported
17990 echo "Checking to see if your system supports static inline..."
17991 $cat > try.c <<'EOCP'
17992 #include <stdlib.h>
17993 extern int f_via_a(int x);
17994 extern int f_via_b(int x);
17995 int main(int argc, char **argv)
18004 return EXIT_SUCCESS;
18007 return EXIT_FAILURE;
18011 $cat > a.c <<'EOCP'
18012 static INLINE int f(int x) {
18023 $cat > b.c <<'EOCP'
18024 extern int f(int x);
18032 # Respect a hint (or previous) value for perl_static_inline, if there is one.
18033 case "$perl_static_inline" in
18034 '') # Check the various possibilities, and break out on success.
18035 # For gcc, prefer __inline__, which will still permit
18036 # cflags.SH to add in -ansi.
18037 case "$gccversion" in
18038 '') xxx="inline __inline__ __inline _inline";;
18039 *) xxx="__inline__ inline __inline _inline";;
18041 for inline in $xxx; do
18042 set try -DINLINE=$inline a.c
18043 if eval $compile && $run ./try; then
18044 # Now make sure there is no external linkage of static
18046 set try -DINLINE=$inline -DUSE_B a.c b.c
18047 if eval $compile && $run ./try; then
18048 $echo "Your compiler supports static $inline, " >&4
18049 $echo "but it also creates an external definition," >&4
18050 $echo "so I won't use it." >&4
18053 $echo "Your compiler supports static $inline." >&4
18055 perl_static_inline="static $inline";
18059 $echo "Your compiler does NOT support static $inline." >&4
18064 *inline*) # Some variant of inline exists.
18065 echo "Keeping your $hint value of $perl_static_inline."
18068 static) # No inline capabilities
18069 echo "Keeping your $hint value of $perl_static_inline."
18072 *) # Unrecognized previous value -- blindly trust the supplied
18073 # value and hope it makes sense. Use old value for
18074 # d_static_inline, if there is one.
18075 echo "Keeping your $hint value of $perl_static_inline."
18076 case "$d_static_inline" in
18078 *) val=$d_static_inline ;;
18082 # Fallback to plain 'static' if nothing worked.
18083 case "$perl_static_inline" in
18085 perl_static_inline="static"
18089 set d_static_inline
18091 $rm -f a.[co] b.[co]
18094 : Check stream access
18096 Checking how to access stdio streams by file descriptor number...
18098 case "$stdio_stream_array" in
18099 '') $cat >try.c <<EOCP
18102 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
18106 for s in _iob __iob __sF
18108 set try -DSTDIO_STREAM_ARRAY=$s
18109 if eval $compile; then
18110 case "`$run ./try`" in
18111 yes) stdio_stream_array=$s; break ;;
18117 case "$stdio_stream_array" in
18119 I can't figure out how to access stdio streams by file descriptor number.
18121 d_stdio_stream_array="$undef"
18124 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
18126 d_stdio_stream_array="$define"
18130 : see if strcoll exists
18131 set strcoll d_strcoll
18134 : check for structure copying
18136 echo "Checking to see if your C compiler can copy structs..." >&4
18137 $cat >try.c <<'EOCP'
18147 if $cc -c try.c >/dev/null 2>&1 ; then
18149 echo "Yup, it can."
18152 echo "Nope, it can't."
18158 : see if strerror and/or sys_errlist[] exist
18160 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
18161 if set strerror val -f d_strerror; eval $csym; $val; then
18162 echo 'strerror() found.' >&4
18163 d_strerror="$define"
18164 d_strerrm='strerror(e)'
18165 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18166 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
18167 d_syserrlst="$define"
18169 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
18170 d_syserrlst="$undef"
18172 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
18173 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
18174 echo 'strerror() found in string header.' >&4
18175 d_strerror="$define"
18176 d_strerrm='strerror(e)'
18177 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18178 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
18179 d_syserrlst="$define"
18181 echo "(You don't appear to have any sys_errlist[], how can this be?)"
18182 d_syserrlst="$undef"
18184 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18185 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
18186 d_strerror="$undef"
18187 d_syserrlst="$define"
18188 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
18190 echo 'strerror() and sys_errlist[] NOT found.' >&4
18191 d_strerror="$undef"
18192 d_syserrlst="$undef"
18193 d_strerrm='"unknown"'
18197 : see if strerror_r exists
18198 set strerror_r d_strerror_r
18200 case "$d_strerror_r" in
18202 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
18203 case "$d_strerror_r_proto:$usethreads" in
18204 ":define") d_strerror_r_proto=define
18205 set d_strerror_r_proto strerror_r $hdrs
18209 case "$d_strerror_r_proto" in
18211 case "$strerror_r_proto" in
18212 ''|0) try='int strerror_r(int, char*, size_t);'
18213 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBW ;;
18215 case "$strerror_r_proto" in
18216 ''|0) try='int strerror_r(int, char*, int);'
18217 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBI ;;
18219 case "$strerror_r_proto" in
18220 ''|0) try='char* strerror_r(int, char*, size_t);'
18221 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=B_IBW ;;
18223 case "$strerror_r_proto" in
18224 ''|0) d_strerror_r=undef
18226 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
18227 * ) case "$strerror_r_proto" in
18228 REENTRANT_PROTO*) ;;
18229 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
18231 echo "Prototype: $try" ;;
18234 *) case "$usethreads" in
18235 define) echo "strerror_r has no prototype, not using it." >&4 ;;
18242 *) strerror_r_proto=0
18246 : see if strftime exists
18247 set strftime d_strftime
18250 : see if strlcat exists
18251 set strlcat d_strlcat
18254 : see if strlcpy exists
18255 set strlcpy d_strlcpy
18258 : see if strtod exists
18259 set strtod d_strtod
18262 : see if strtol exists
18263 set strtol d_strtol
18266 : see if strtold exists
18267 set strtold d_strtold
18270 : see if strtoll exists
18271 set strtoll d_strtoll
18274 case "$d_longlong-$d_strtoll" in
18277 Checking whether your strtoll() works okay...
18279 $cat >try.c <<'EOCP'
18282 #define strtoll __strtoll
18285 #define strtoll _strtoll
18288 extern long long int strtoll(char *s, char **, int);
18289 static int bad = 0;
18290 int check(char *s, long long ell, int een) {
18293 gll = strtoll(s, 0, 10);
18294 if (!((gll == ell) && (errno == een)))
18298 check(" 1", 1LL, 0);
18299 check(" 0", 0LL, 0);
18300 check("-1", -1LL, 0);
18301 check("-9223372036854775808", -9223372036854775808LL, 0);
18302 check("-9223372036854775808", -9223372036854775808LL, 0);
18303 check(" 9223372036854775807", 9223372036854775807LL, 0);
18304 check("-9223372036854775808", -9223372036854775808LL, 0);
18305 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
18306 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
18312 if eval $compile; then
18315 ok) echo "Your strtoll() seems to be working okay." ;;
18317 Your strtoll() doesn't seem to be working okay.
18323 echo "(I can't seem to compile the test program--assuming it doesn't)"
18329 : see if strtoq exists
18330 set strtoq d_strtoq
18333 : see if strtoul exists
18334 set strtoul d_strtoul
18337 case "$d_strtoul" in
18340 Checking whether your strtoul() works okay...
18342 $cat >try.c <<'EOCP'
18345 extern unsigned long int strtoul(char *s, char **, int);
18346 static int bad = 0;
18347 void check(char *s, unsigned long eul, int een) {
18350 gul = strtoul(s, 0, 10);
18351 if (!((gul == eul) && (errno == een)))
18355 check(" 1", 1L, 0);
18356 check(" 0", 0L, 0);
18358 case "$longsize" in
18360 $cat >>try.c <<'EOCP'
18361 check("18446744073709551615", 18446744073709551615UL, 0);
18362 check("18446744073709551616", 18446744073709551615UL, ERANGE);
18363 #if 0 /* strtoul() for /^-/ strings is undefined. */
18364 check("-1", 18446744073709551615UL, 0);
18365 check("-18446744073709551614", 2, 0);
18366 check("-18446744073709551615", 1, 0);
18367 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
18368 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
18373 $cat >>try.c <<'EOCP'
18374 check("4294967295", 4294967295UL, 0);
18375 check("4294967296", 4294967295UL, ERANGE);
18376 #if 0 /* strtoul() for /^-/ strings is undefined. */
18377 check("-1", 4294967295UL, 0);
18378 check("-4294967294", 2, 0);
18379 check("-4294967295", 1, 0);
18380 check("-4294967296", 4294967295UL, ERANGE);
18381 check("-4294967297", 4294967295UL, ERANGE);
18386 : Should we write these tests to be more portable by sprintf-ing
18387 : ~0 and then manipulating that char string as input for strtol?
18390 $cat >>try.c <<'EOCP'
18397 if eval $compile; then
18398 case "`$run ./try`" in
18399 ok) echo "Your strtoul() seems to be working okay." ;;
18401 Your strtoul() doesn't seem to be working okay.
18407 echo "(I can't seem to compile the test program--assuming it doesn't)"
18413 : see if strtoull exists
18414 set strtoull d_strtoull
18417 case "$d_longlong-$d_strtoull" in
18420 Checking whether your strtoull() works okay...
18422 $cat >try.c <<'EOCP'
18425 #define strtoull __strtoull
18428 extern unsigned long long int strtoull(char *s, char **, int);
18429 static int bad = 0;
18430 int check(char *s, long long eull, int een) {
18433 gull = strtoull(s, 0, 10);
18434 if (!((gull == eull) && (errno == een)))
18438 check(" 1", 1LL, 0);
18439 check(" 0", 0LL, 0);
18440 check("18446744073709551615", 18446744073709551615ULL, 0);
18441 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18442 #if 0 /* strtoull() for /^-/ strings is undefined. */
18443 check("-1", 18446744073709551615ULL, 0);
18444 check("-18446744073709551614", 2LL, 0);
18445 check("-18446744073709551615", 1LL, 0);
18446 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18447 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18454 if eval $compile; then
18455 case "`$run ./try`" in
18456 ok) echo "Your strtoull() seems to be working okay." ;;
18458 Your strtoull() doesn't seem to be working okay.
18460 d_strtoull="$undef"
18464 echo "(I can't seem to compile the test program--assuming it doesn't)"
18465 d_strtoull="$undef"
18470 : see if strtouq exists
18471 set strtouq d_strtouq
18474 case "$d_strtouq" in
18477 Checking whether your strtouq() works okay...
18479 $cat >try.c <<'EOCP'
18482 extern unsigned long long int strtouq(char *s, char **, int);
18483 static int bad = 0;
18484 void check(char *s, unsigned long long eull, int een) {
18485 unsigned long long gull;
18487 gull = strtouq(s, 0, 10);
18488 if (!((gull == eull) && (errno == een)))
18492 check(" 1", 1LL, 0);
18493 check(" 0", 0LL, 0);
18494 check("18446744073709551615", 18446744073709551615ULL, 0);
18495 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18496 #if 0 /* strtouq() for /^-/ strings is undefined. */
18497 check("-1", 18446744073709551615ULL, 0);
18498 check("-18446744073709551614", 2LL, 0);
18499 check("-18446744073709551615", 1LL, 0);
18500 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18501 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18509 if eval $compile; then
18510 case "`$run ./try`" in
18511 ok) echo "Your strtouq() seems to be working okay." ;;
18513 Your strtouq() doesn't seem to be working okay.
18519 echo "(I can't seem to compile the test program--assuming it doesn't)"
18525 : see if strxfrm exists
18526 set strxfrm d_strxfrm
18529 : see if symlink exists
18530 set symlink d_symlink
18533 : see if syscall exists
18534 set syscall d_syscall
18537 : see if prototype for syscall is available
18539 set d_syscallproto syscall $i_unistd unistd.h
18542 : see if sysconf exists
18543 set sysconf d_sysconf
18546 : see if system exists
18547 set system d_system
18550 : see if tcgetpgrp exists
18551 set tcgetpgrp d_tcgetpgrp
18554 : see if tcsetpgrp exists
18555 set tcsetpgrp d_tcsetpgrp
18558 : see if prototype for telldir is available
18560 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
18563 : see if time exists
18565 if test "X$d_time" = X -o X"$timetype" = X; then
18566 if set time val -f d_time; eval $csym; $val; then
18567 echo 'time() found.' >&4
18569 rp="What is the type returned by time() on this system?"
18570 set time_t timetype long stdio.h sys/types.h
18573 echo 'time() not found, hope that will do.' >&4
18581 : see if timegm exists
18582 set timegm d_timegm
18585 : see if this is a sys/times.h system
18586 set sys/times.h i_systimes
18589 : see if times exists
18591 if set times val -f d_times; eval $csym; $val; then
18592 echo 'times() found.' >&4
18595 case "$i_systimes" in
18596 "$define") inc='sys/times.h';;
18598 rp="What is the type returned by times() on this system?"
18599 set clock_t clocktype long stdio.h sys/types.h $inc
18602 echo 'times() NOT found, hope that will do.' >&4
18607 : see if tmpnam_r exists
18608 set tmpnam_r d_tmpnam_r
18610 case "$d_tmpnam_r" in
18612 hdrs="$i_systypes sys/types.h define stdio.h "
18613 case "$d_tmpnam_r_proto:$usethreads" in
18614 ":define") d_tmpnam_r_proto=define
18615 set d_tmpnam_r_proto tmpnam_r $hdrs
18619 case "$d_tmpnam_r_proto" in
18621 case "$tmpnam_r_proto" in
18622 ''|0) try='char* tmpnam_r(char*);'
18623 ./protochk "$extern_C $try" $hdrs && tmpnam_r_proto=B_B ;;
18625 case "$tmpnam_r_proto" in
18626 ''|0) d_tmpnam_r=undef
18628 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
18629 * ) case "$tmpnam_r_proto" in
18630 REENTRANT_PROTO*) ;;
18631 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
18633 echo "Prototype: $try" ;;
18636 *) case "$usethreads" in
18637 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
18644 *) tmpnam_r_proto=0
18648 : see if truncate exists
18649 set truncate d_truncate
18652 : see if ttyname_r exists
18653 set ttyname_r d_ttyname_r
18655 case "$d_ttyname_r" in
18657 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
18658 case "$d_ttyname_r_proto:$usethreads" in
18659 ":define") d_ttyname_r_proto=define
18660 set d_ttyname_r_proto ttyname_r $hdrs
18664 case "$d_ttyname_r_proto" in
18666 case "$ttyname_r_proto" in
18667 ''|0) try='int ttyname_r(int, char*, size_t);'
18668 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBW ;;
18670 case "$ttyname_r_proto" in
18671 ''|0) try='int ttyname_r(int, char*, int);'
18672 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBI ;;
18674 case "$ttyname_r_proto" in
18675 ''|0) try='char* ttyname_r(int, char*, int);'
18676 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=B_IBI ;;
18678 case "$ttyname_r_proto" in
18679 ''|0) d_ttyname_r=undef
18681 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
18682 * ) case "$ttyname_r_proto" in
18683 REENTRANT_PROTO*) ;;
18684 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
18686 echo "Prototype: $try" ;;
18689 *) case "$usethreads" in
18690 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
18697 *) ttyname_r_proto=0
18701 : see if tzname[] exists
18703 if set tzname val -a d_tzname; eval $csym; $val; then
18705 echo 'tzname[] found.' >&4
18708 echo 'tzname[] NOT found.' >&4
18713 : Check if is a multiplatform env
18715 next|rhapsody|darwin) multiarch="$define" ;;
18717 case "$multiarch" in
18718 ''|[nN]*) multiarch="$undef" ;;
18721 : check for ordering of bytes in a UV
18723 case "$usecrosscompile$multiarch" in
18726 You seem to be either cross-compiling or doing a multiarchitecture build,
18727 skipping the byteorder check.
18733 case "$byteorder" in
18736 In the following, larger digits indicate more significance. A big-endian
18737 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
18738 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
18739 machines may have weird orders like 3412. A Cray will report 87654321,
18740 an Alpha will report 12345678. If the test program works the default is
18742 I'm now running the test program...
18746 #$i_stdlib I_STDLIB
18748 #include <stdlib.h>
18750 #include <sys/types.h>
18751 typedef $uvtype UV;
18761 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
18763 u.l = (UV)0x04030201;
18764 for (i = 0; i < $uvsize; i++)
18765 printf("%c", u.c[i]+'0');
18772 if eval $compile && $run ./try > /dev/null; then
18775 [1-4][1-4][1-4][1-4]|12345678|87654321)
18776 echo "(The test program ran ok.)"
18777 echo "byteorder=$dflt"
18780 ????|????????) echo "(The test program ran ok.)" ;;
18781 *) echo "(The test program didn't run right for some reason.)" ;;
18786 (I can't seem to compile the test program. Guessing big-endian...)
18789 case "$xxx_prompt" in
18791 rp="What is the order of bytes in $uvtype?"
18804 : Checking 32bit alignedness
18807 Checking to see whether you can access character data unalignedly...
18809 case "$d_u32align" in
18810 '') $cat >try.c <<EOCP
18812 #$i_stdlib I_STDLIB
18814 #include <stdlib.h>
18816 #define U32 $u32type
18817 #define BYTEORDER 0x$byteorder
18819 #include <signal.h>
18821 $signal_t bletch(int s) { exit(4); }
18824 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
18825 volatile U8 buf[8];
18829 if (sizeof(U32) != 4) {
18830 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
18837 signal(SIGBUS, bletch);
18849 for (i = 0; i < 4; i++) {
18850 up = (U32*)(buf + i);
18851 if (! ((*up == 1 << (8*i)) || /* big-endian */
18852 (*up == 1 << (8*(3-i))) /* little-endian */
18856 printf("read failed (%x)\n", *up);
18862 for (i = 0; i < 4; i++) {
18863 up = (U32*)(buf + i);
18865 if (*up != 0xBeef) {
18866 printf("write failed (%x)\n", *up);
18880 if eval $compile_ok; then
18881 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
18882 $run ./try 2>&1 >/dev/null
18885 You can access character data pretty unalignedly.
18887 d_u32align="$undef"
18890 It seems that you must access character data in an aligned manner.
18892 d_u32align="$define"
18896 rp='Can you access character data at unaligned addresses?'
18900 [yY]*) d_u32align="$undef" ;;
18901 *) d_u32align="$define" ;;
18908 : see if ualarm exists
18909 set ualarm d_ualarm
18912 : see if umask exists
18916 : see if unordered exists
18917 set unordered d_unordered
18920 : see if unsetenv exists
18921 set unsetenv d_unsetenv
18924 : see if usleep exists
18925 set usleep d_usleep
18928 : see if prototype for usleep is available
18930 set d_usleepproto usleep $i_unistd unistd.h
18933 : see if ustat exists
18937 : see if closedir exists
18938 set closedir d_closedir
18941 case "$d_closedir" in
18944 echo "Checking whether closedir() returns a status..." >&4
18946 #$i_dirent I_DIRENT /**/
18947 #$i_sysdir I_SYS_DIR /**/
18948 #$i_sysndir I_SYS_NDIR /**/
18949 #$i_systypes I_SYS_TYPES /**/
18951 #if defined(I_SYS_TYPES)
18952 #include <sys/types.h>
18954 #if defined(I_DIRENT)
18955 #include <dirent.h>
18956 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
18957 #include <sys/dir.h>
18961 #include <sys/ndir.h>
18965 #include <ndir.h> /* may be wrong in the future */
18967 #include <sys/dir.h>
18972 int main() { return closedir(opendir(".")); }
18975 if eval $compile_ok; then
18976 if $run ./try > /dev/null 2>&1 ; then
18977 echo "Yes, it does."
18980 echo "No, it doesn't."
18984 echo "(I can't seem to compile the test program--assuming it doesn't)"
18992 set d_void_closedir
18996 : see if there is a wait4
19000 : see if waitpid exists
19001 set waitpid d_waitpid
19004 : see if wcstombs exists
19005 set wcstombs d_wcstombs
19008 : see if wctomb exists
19009 set wctomb d_wctomb
19012 : see if writev exists
19013 set writev d_writev
19016 : preserve RCS keywords in files with variable substitution, grrr
19021 Revision='$Revision'
19023 : check for alignment requirements
19025 case "$usecrosscompile$multiarch" in
19028 You seem to be either cross-compiling or doing a multiarchitecture build,
19029 skipping the memory alignment check.
19032 case "$alignbytes" in
19033 '') alignbytes=8 ;;
19037 case "$alignbytes" in
19038 '') echo "Checking alignment constraints..." >&4
19039 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
19040 $cat >try.c <<'EOCP'
19041 typedef long double NV;
19044 $cat >try.c <<'EOCP'
19048 $cat >>try.c <<'EOCP'
19056 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
19061 if eval $compile_ok; then
19065 echo "(I can't seem to compile the test program...)"
19068 *) dflt="$alignbytes"
19071 rp="Doubles must be aligned on a how-many-byte boundary?"
19079 : set the base revision
19082 : length of character in bytes. Is always 1, otherwise it isnt C
19083 : This used to be a test using sizeof
19086 : Check for the number of bits in a character
19087 case "$charbits" in
19088 '') echo "Checking how long a character is (in bits)..." >&4
19095 for (c = 1, n = 0; c; c <<= 1, n++) ;
19096 printf ("%d\n", n);
19101 if eval $compile_ok; then
19105 echo "(I can't seem to compile the test program. Guessing...)"
19112 rp="What is the length of a character (in bits)?"
19116 case "$charbits" in
19119 Your system has an unsigned character size of $charbits bits, which
19120 is rather unusual (normally it is 8 bits). Perl likely will not work
19121 correctly on your system, with subtle bugs in various places.
19123 rp='Do you really want to continue?'
19127 [yY]) echo >&4 "Okay, continuing." ;;
19132 : how do we concatenate cpp tokens here?
19134 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
19135 $cat >cpp_stuff.c <<'EOCP'
19136 #define RCAT(a,b)a/**/b
19137 #define ACAT(a,b)a ## b
19141 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
19142 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
19143 echo "Oh! Smells like ANSI's been here." >&4
19144 echo "We can catify or stringify, separately or together!"
19146 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
19147 echo "Ah, yes! The good old days!" >&4
19148 echo "However, in the good old days we don't know how to stringify and"
19149 echo "catify at the same time."
19153 Hmm, I don't seem to be able to concatenate tokens with your cpp.
19154 You're going to have to edit the values of CAT[2-5] in config.h...
19156 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
19160 : see if this is a db.h system
19166 : Check db version.
19168 echo "Checking Berkeley DB version ..." >&4
19174 #include <sys/types.h>
19176 #$i_stdlib I_STDLIB
19178 #include <stdlib.h>
19181 int main(int argc, char *argv[])
19183 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
19184 int Major, Minor, Patch ;
19185 unsigned long Version ;
19186 (void)db_version(&Major, &Minor, &Patch) ;
19188 printf("%d %d %d %d %d %d\n",
19189 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
19190 Major, Minor, Patch);
19193 printf("You have Berkeley DB Version 2 or greater.\n");
19195 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
19196 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
19197 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
19198 Major, Minor, Patch) ;
19200 /* check that db.h & libdb are compatible */
19201 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
19202 printf("db.h and libdb are incompatible.\n") ;
19206 printf("db.h and libdb are compatible.\n") ;
19208 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
19209 + DB_VERSION_PATCH ;
19211 /* needs to be >= 2.3.4 */
19212 if (Version < 2003004) {
19213 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
19214 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
19220 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
19225 printf("You have Berkeley DB Version 1.\n");
19226 exit(0); /* DB version < 2: the coast is clear. */
19228 exit(1); /* <db.h> not Berkeley DB? */
19234 if eval $compile_ok && $run ./try; then
19235 echo 'Looks OK.' >&4
19237 db_version_major=$1
19238 db_version_minor=$2
19239 db_version_patch=$3
19241 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
19245 : Remove db from list of libraries to use
19246 echo "Removing unusable -ldb from library list" >&4
19247 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
19250 echo "libs = $libs" >&4
19260 : Check the return type needed for hash
19262 echo "Checking return type needed for hash for Berkeley DB ..." >&4
19268 #include <sys/types.h>
19271 #ifndef DB_VERSION_MAJOR
19272 u_int32_t hash_cb (ptr, size)
19280 info.hash = hash_cb;
19284 if $cc $ccflags -c try.c >try.out 2>&1 ; then
19285 if $contains warning try.out >>/dev/null 2>&1 ; then
19288 db_hashtype='u_int32_t'
19291 : XXX Maybe we should just give up here.
19292 db_hashtype=u_int32_t
19294 echo "Help: I can't seem to compile the db test program." >&4
19295 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
19298 echo "Your version of Berkeley DB uses $db_hashtype for hash."
19300 *) db_hashtype=u_int32_t
19305 : Check the return type needed for prefix
19307 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
19313 #include <sys/types.h>
19316 #ifndef DB_VERSION_MAJOR
19317 size_t prefix_cb (key1, key2)
19325 info.prefix = prefix_cb;
19329 if $cc $ccflags -c try.c >try.out 2>&1 ; then
19330 if $contains warning try.out >>/dev/null 2>&1 ; then
19331 db_prefixtype='int'
19333 db_prefixtype='size_t'
19336 db_prefixtype='size_t'
19337 : XXX Maybe we should just give up here.
19339 echo "Help: I can't seem to compile the db test program." >&4
19340 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
19343 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
19345 *) db_prefixtype='size_t'
19349 : How can we generate normalized random numbers ?
19351 echo "Looking for a random number function..." >&4
19352 case "$randfunc" in
19354 if set drand48 val -f; eval $csym; $val; then
19356 echo "Good, found drand48()." >&4
19357 elif set random val -f; eval $csym; $val; then
19359 echo "OK, found random()." >&4
19362 echo "Yick, looks like I have to use rand()." >&4
19373 *-Dmy_rand=*|*-Dmy_srand=*)
19374 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
19375 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
19376 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
19377 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
19381 while $test "$cont"; do
19382 rp="Use which function to generate random numbers?"
19384 if $test "$ans" = "$dflt"; then
19390 if set $ans val -f; eval $csym; $val; then
19394 rp="I cannot find function $ans. Use that name anyway?"
19403 case "$randfunc" in
19405 drand01="drand48()"
19411 case "$randbits" in
19413 echo "Checking to see how many bits your $randfunc() function produces..." >&4
19415 #$i_unistd I_UNISTD
19416 #$i_stdlib I_STDLIB
19419 # include <unistd.h>
19422 # include <stdlib.h>
19427 register unsigned long tmp;
19428 register unsigned long max = 0L;
19430 for (i = 1000; i; i--) {
19431 tmp = (unsigned long) $randfunc();
19432 if (tmp > max) max = tmp;
19434 for (i = 0; max; i++)
19440 if eval $compile_ok; then
19444 echo "(I can't seem to compile the test program...)"
19451 rp="How many bits does your $randfunc() function produce?"
19455 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
19456 seedfunc="s$randfunc"
19457 randseedtype=unsigned
19461 rp="How many bits does your $randfunc() function produce?"
19464 seedfunc="s$randfunc"
19465 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
19466 if set $seedfunc val -f; eval $csym; $val; then
19467 echo "(Using $seedfunc() to seed random generator)"
19469 echo "(Warning: no $seedfunc() to seed random generator)"
19472 randseedtype=unsigned
19479 : Determine if this is an EBCDIC system
19481 echo "Determining whether or not we are on an EBCDIC system..." >&4
19482 $cat >try.c <<'EOM'
19485 if ('M'==0xd4) return 0;
19492 if eval $compile_ok; then
19493 if $run ./try; then
19494 echo "You seem to speak EBCDIC." >&4
19497 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
19500 echo "I'm unable to compile the test program." >&4
19501 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
19507 : Check how to flush
19510 Checking how to flush all pending stdio output...
19512 # I only know how to find the first 32 possibly open files on SunOS.
19513 # See also hints/sunos_4_1.sh and util.c --AD
19515 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
19517 $cat >>try.c <<EOCP
19519 #$i_stdlib I_STDLIB
19521 #include <stdlib.h>
19523 #$i_unistd I_UNISTD
19525 # include <unistd.h>
19527 #$d_sysconf HAS_SYSCONF
19528 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
19529 #ifdef HAS_STDIO_STREAM_ARRAY
19530 # define STDIO_STREAM_ARRAY $stdio_stream_array
19535 p = fopen("try.out", "w");
19539 # ifdef TRY_FPRINTF
19543 #ifdef TRY_FFLUSH_NULL
19546 #ifdef TRY_FFLUSH_ALL
19548 long open_max = -1;
19549 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
19550 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
19552 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
19553 open_max = sysconf(_SC_OPEN_MAX);
19556 open_max = FOPEN_MAX;
19559 open_max = OPEN_MAX;
19568 # ifdef HAS_STDIO_STREAM_ARRAY
19569 if (open_max > 0) {
19571 for (i = 0; i < open_max; i++)
19572 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
19573 STDIO_STREAM_ARRAY[i]._file < open_max &&
19574 STDIO_STREAM_ARRAY[i]._flag)
19575 fflush(&STDIO_STREAM_ARRAY[i]);
19583 : first we have to find out how _not_ to flush
19585 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
19587 set try -DTRY_FPUTC
19588 if eval $compile; then
19589 $run ./try 2>/dev/null
19592 if $test ! -s try.out -a "X$code" = X42; then
19598 set try -DTRY_FPRINTF
19599 if eval $compile; then
19600 $run ./try 2>/dev/null
19603 if $test ! -s try.out -a "X$code" = X42; then
19604 output=-DTRY_FPRINTF
19610 : check for fflush NULL behaviour
19611 case "$fflushNULL" in
19612 '') set try -DTRY_FFLUSH_NULL $output
19613 if eval $compile; then
19614 $run ./try 2>/dev/null
19617 if $test -s try.out -a "X$code" = X42; then
19618 fflushNULL="`$cat try.out`"
19620 if $test "X$code" != X42; then
19622 (If this test failed, don't worry, we'll try another method shortly.)
19627 $rm -f core try.core core.try.*
19628 case "$fflushNULL" in
19630 Your fflush(NULL) works okay for output streams.
19631 Let's see if it clobbers input pipes...
19633 # As of mid-March 2000 all versions of Solaris appear to have a stdio
19634 # bug that improperly flushes the input end of pipes. So we avoid the
19635 # autoflush on fork/system/exec support for now. :-(
19636 $cat >tryp.c <<EOCP
19639 main(int argc, char **argv)
19645 while ((i = getc(stdin)) != -1
19646 && (*bp++ = i) != '\n'
19647 && bp < &buf[1024])
19650 fprintf(stdout, "%s", buf);
19658 fflushNULL="$define"
19660 if eval $compile; then
19662 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19663 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19665 fflush(NULL) seems to behave okay with input streams.
19667 fflushNULL="$define"
19670 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
19672 fflushNULL="$undef"
19675 $rm -f core tryp.c tryp.core core.tryp.*
19678 Your fflush(NULL) isn't working (contrary to ANSI C).
19680 fflushNULL="$undef"
19683 Cannot figure out whether your fflush(NULL) works or not.
19684 I'm assuming it doesn't (contrary to ANSI C).
19686 fflushNULL="$undef"
19690 $define|true|[yY]*)
19691 fflushNULL="$define"
19694 fflushNULL="$undef"
19697 : check explicit looping only if NULL did not work, and if the pipe
19698 : bug does not show up on an explicit flush too
19699 case "$fflushNULL" in
19701 $cat >tryp.c <<EOCP
19704 main(int argc, char **argv)
19710 while ((i = getc(stdin)) != -1
19711 && (*bp++ = i) != '\n'
19712 && bp < &buf[1024])
19715 fprintf(stdout, "%s", buf);
19724 if eval $compile; then
19726 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19727 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19729 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
19731 : now check for fflushall behaviour
19732 case "$fflushall" in
19733 '') set try -DTRY_FFLUSH_ALL $output
19734 if eval $compile; then
19736 (Now testing the other method--but note that this also may fail.)
19738 $run ./try 2>/dev/null
19741 if $test -s try.out -a "X$code" = X42; then
19742 fflushall="`$cat try.out`"
19746 case "$fflushall" in
19748 Whew. Flushing explicitly all the stdio streams works.
19750 fflushall="$define"
19753 Sigh. Flushing explicitly all the stdio streams doesn't work.
19758 Cannot figure out whether flushing stdio streams explicitly works or not.
19759 I'm assuming it doesn't.
19765 "$define"|true|[yY]*)
19766 fflushall="$define"
19774 All is futile. Even fflush(stdin) clobbers input pipes!
19781 $rm -f core tryp.c tryp.core core.tryp.*
19783 *) fflushall="$undef"
19787 case "$fflushNULL$fflushall" in
19790 OK, I give up. I cannot figure out how to flush pending stdio output.
19791 We won't be flushing handles at all before fork/exec/popen.
19797 : Store the full pathname to the ar program for use in the C program
19798 : Respect a hint or command line value for full_ar.
19803 : Store the full pathname to the sed program for use in the C program
19806 : see what type gids are declared as in the kernel
19808 echo "Looking for the type for group ids returned by getgid()."
19809 set gid_t gidtype xxx stdio.h sys/types.h
19813 xxx=`./findhdr sys/user.h`
19814 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
19816 unsigned) dflt="$1 $2" ;;
19820 *) dflt="$gidtype";;
19823 gid_t) echo "gid_t found." ;;
19824 *) rp="What is the type for group ids returned by getgid()?"
19830 : Check the size of GID
19833 *_t) zzz="$gidtype" ;;
19836 echo "Checking the size of $zzz..." >&4
19838 #include <sys/types.h>
19840 #$i_stdlib I_STDLIB
19842 #include <stdlib.h>
19845 printf("%d\n", (int)sizeof($gidtype));
19850 if eval $compile_ok; then
19854 echo "(I can't execute the test program--guessing $gidsize.)" >&4
19857 echo "Your $zzz is $gidsize bytes long."
19862 echo "(I can't compile the test program--guessing $gidsize.)" >&4
19866 : Check if GID is signed
19869 *_t) zzz="$gidtype" ;;
19872 echo "Checking the sign of $zzz..." >&4
19874 #include <sys/types.h>
19885 if eval $compile; then
19889 echo "(I can't execute the test program--guessing unsigned.)" >&4
19893 1) echo "Your $zzz is unsigned." ;;
19894 -1) echo "Your $zzz is signed." ;;
19900 echo "(I can't compile the test program--guessing unsigned.)" >&4
19904 : Check 64bit sizes
19907 if $test X"$quadtype" != X; then
19909 echo "Checking how to print 64-bit integers..." >&4
19911 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
19912 $cat >try.c <<'EOCP'
19913 #include <sys/types.h>
19916 int q = 12345678901;
19917 printf("%ld\n", q);
19921 if eval $compile; then
19925 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
19926 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
19927 echo "We will use %d."
19933 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
19934 $cat >try.c <<'EOCP'
19935 #include <sys/types.h>
19938 long q = 12345678901;
19939 printf("%ld\n", q);
19943 if eval $compile; then
19947 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
19948 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
19949 echo "We will use %ld."
19955 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
19956 $cat >try.c <<'EOCP'
19957 #include <sys/types.h>
19958 #include <inttypes.h>
19961 int64_t q = 12345678901;
19962 printf("%" PRId64 "\n", q);
19966 if eval $compile; then
19970 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
19971 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
19972 echo "We will use the C9X style."
19978 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19980 #include <sys/types.h>
19983 $quadtype q = 12345678901;
19984 printf("%Ld\n", q);
19988 if eval $compile; then
19992 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
19993 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
19994 echo "We will use %Ld."
20000 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
20001 $cat >try.c <<'EOCP'
20002 #include <sys/types.h>
20005 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
20006 printf("%lld\n", q);
20010 if eval $compile; then
20014 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
20015 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
20016 echo "We will use the %lld style."
20022 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
20024 #include <sys/types.h>
20027 $quadtype q = 12345678901;
20028 printf("%qd\n", q);
20032 if eval $compile; then
20036 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
20037 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
20038 echo "We will use %qd."
20044 if $test X"$sPRId64" = X; then
20045 echo "Cannot figure out how to print 64-bit integers." >&4
20052 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
20053 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
20055 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
20056 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
20060 : Check format strings for internal types
20062 $echo "Checking the format strings to be used for Perl's internal types..." >&4
20064 if $test X"$ivsize" = X8; then
20065 ivdformat="$sPRId64"
20066 uvuformat="$sPRIu64"
20067 uvoformat="$sPRIo64"
20068 uvxformat="$sPRIx64"
20069 uvXUformat="$sPRIXU64"
20071 if $test X"$ivsize" = X"$longsize"; then
20078 if $test X"$ivsize" = X"$intsize"; then
20086 if $test X"$ivsize" = X"$shortsize"; then
20097 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
20098 nveformat="$sPRIeldbl"
20099 nvfformat="$sPRIfldbl"
20100 nvgformat="$sPRIgldbl"
20101 nvEUformat="$sPRIEUldbl"
20102 nvFUformat="$sPRIFUldbl"
20103 nvGUformat="$sPRIGUldbl"
20113 case "$ivdformat" in
20114 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
20119 : Check format string for GID
20122 $echo "Checking the format string to be used for gids..." >&4
20125 -1) if $test X"$gidsize" = X"$ivsize"; then
20126 gidformat="$ivdformat"
20128 if $test X"$gidsize" = X"$longsize"; then
20131 if $test X"$gidsize" = X"$intsize"; then
20134 if $test X"$gidsize" = X"$shortsize"; then
20141 *) if $test X"$gidsize" = X"$uvsize"; then
20142 gidformat="$uvuformat"
20144 if $test X"$gidsize" = X"$longsize"; then
20147 if $test X"$gidsize" = X"$intsize"; then
20150 if $test X"$gidsize" = X"$shortsize"; then
20159 : see if getgroups exists
20160 set getgroups d_getgrps
20163 : see if setgroups exists
20164 set setgroups d_setgrps
20167 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
20169 case "$d_getgrps$d_setgrps" in
20171 case "$groupstype" in
20172 '') dflt="$gidtype" ;;
20173 *) dflt="$groupstype" ;;
20176 What type of pointer is the second argument to getgroups() and setgroups()?
20177 Usually this is the same as group ids, $gidtype, but not always.
20180 rp='What type pointer is the second argument to getgroups() and setgroups()?'
20184 *) groupstype="$gidtype";;
20187 : MAD = Misc Attribute Definition
20189 if $test $patchlevel -lt 9; then
20190 : MAD is not available in 5.8.x or earlier.
20194 $define|true|[yY]*) dflt='y' ;;
20199 Would you like to build with Misc Attribute Decoration? This is development
20200 work leading to a Perl 5 to Perl 6 convertor, which imposes a space and speed
20201 overhead on the interpreter.
20203 If this doesn't make any sense to you, just accept the default '$dflt'.
20205 rp='Build Perl with MAD?'
20210 madlyh='madly.h madly.act madly.tab'
20212 madlyobj="madly$_o" ;;
20221 : check whether make sets MAKE
20223 echo "Checking if your $make program sets \$(MAKE)..." >&4
20224 case "$make_set_make" in
20226 $sed 's/^X //' > testmake.mak << 'EOF'
20228 X @echo 'maketemp="$(MAKE)"'
20230 case "`$make -f testmake.mak 2>/dev/null`" in
20231 *maketemp=*) make_set_make='#' ;;
20232 *) make_set_make="MAKE=$make" ;;
20234 $rm -f testmake.mak
20237 case "$make_set_make" in
20238 '#') echo "Yup, it does.";;
20239 *) echo "Nope, it doesn't.";;
20242 : see what type is used for mode_t
20243 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
20244 set mode_t modetype int stdio.h sys/types.h
20247 : see if we need va_copy
20249 case "$i_stdarg" in
20252 #include <stdarg.h>
20254 #$i_stdlib I_STDLIB
20256 #include <stdlib.h>
20258 #include <signal.h>
20261 ivfprintf(FILE *f, const char *fmt, va_list *valp)
20263 return vfprintf(f, fmt, *valp);
20267 myvfprintf(FILE *f, const char *fmt, va_list val)
20269 return ivfprintf(f, fmt, &val);
20273 myprintf(char *fmt, ...)
20276 va_start(val, fmt);
20277 return myvfprintf(stdout, fmt, val);
20281 main(int ac, char **av)
20283 signal(SIGSEGV, exit);
20285 myprintf("%s%cs all right, then\n", "that", '\'');
20290 if eval $compile && $run ./try 2>&1 >/dev/null; then
20291 case "`$run ./try`" in
20292 "that's all right, then")
20298 yes) echo "It seems that you don't need va_copy()." >&4
20299 need_va_copy="$undef"
20301 *) echo "It seems that va_copy() or similar will be needed." >&4
20302 need_va_copy="$define"
20307 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
20311 : see what type is used for size_t
20312 rp="What is the type used for the length parameter for string functions?"
20313 set size_t sizetype 'unsigned int' stdio.h sys/types.h
20316 : check for type of arguments to gethostbyaddr.
20317 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
20318 case "$d_gethbyaddr" in
20322 Checking to see what type of arguments are accepted by gethostbyaddr().
20324 hdrs="$define sys/types.h
20325 $d_socket sys/socket.h
20326 $i_niin netinet/in.h
20328 $i_unistd unistd.h"
20329 : The first arg can 'char *' or 'void *'
20330 : The second arg is some of integral type
20331 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
20332 for yyy in size_t long int; do
20333 case "$netdb_host_type" in
20334 '') try="$extern_C struct hostent *gethostbyaddr($xxx, $yyy, int);"
20335 if ./protochk "$try" $hdrs; then
20336 echo "Your system accepts $xxx for the first arg."
20337 echo "...and $yyy for the second arg."
20338 netdb_host_type="$xxx"
20339 netdb_hlen_type="$yyy"
20345 : In case none of those worked, prompt the user.
20346 case "$netdb_host_type" in
20347 '') rp='What is the type for the 1st argument to gethostbyaddr?'
20350 netdb_host_type=$ans
20351 rp='What is the type for the 2nd argument to gethostbyaddr?'
20354 netdb_hlen_type=$ans
20358 *) : no gethostbyaddr, so pick harmless defaults
20359 netdb_host_type='char *'
20360 netdb_hlen_type="$sizetype"
20363 # Remove the "const" if needed. -- but then we'll have a
20365 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
20368 : check for type of argument to gethostbyname.
20369 if test "X$netdb_name_type" = X ; then
20370 case "$d_gethbyname" in
20374 Checking to see what type of argument is accepted by gethostbyname().
20376 hdrs="$define sys/types.h
20377 $d_socket sys/socket.h
20378 $i_niin netinet/in.h
20380 $i_unistd unistd.h"
20381 for xxx in "const char *" "char *"; do
20382 case "$netdb_name_type" in
20383 '') try="$extern_C struct hostent *gethostbyname($xxx);"
20384 if ./protochk "$try" $hdrs; then
20385 echo "Your system accepts $xxx."
20386 netdb_name_type="$xxx"
20391 : In case none of those worked, prompt the user.
20392 case "$netdb_name_type" in
20393 '') rp='What is the type for the 1st argument to gethostbyname?'
20396 netdb_name_type=$ans
20400 *) : no gethostbyname, so pick harmless default
20401 netdb_name_type='char *'
20406 : check for type of 1st argument to getnetbyaddr.
20407 if test "X$netdb_net_type" = X ; then
20408 case "$d_getnbyaddr" in
20412 Checking to see what type of 1st argument is accepted by getnetbyaddr().
20414 hdrs="$define sys/types.h
20415 $d_socket sys/socket.h
20416 $i_niin netinet/in.h
20418 $i_unistd unistd.h"
20419 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
20420 case "$netdb_net_type" in
20421 '') try="$extern_C struct netent *getnetbyaddr($xxx, int);"
20422 if ./protochk "$try" $hdrs; then
20423 echo "Your system accepts $xxx."
20424 netdb_net_type="$xxx"
20429 : In case none of those worked, prompt the user.
20430 case "$netdb_net_type" in
20431 '') rp='What is the type for the 1st argument to getnetbyaddr?'
20434 netdb_net_type=$ans
20438 *) : no getnetbyaddr, so pick harmless default
20439 netdb_net_type='long'
20443 : locate the preferred pager for this system
20450 [a-zA-Z]:/*) dflt=$pg;;
20454 [a-zA-Z]:/*) dflt=$more;;
20458 [a-zA-Z]:/*) dflt=$less;;
20461 '') dflt=/usr/ucb/more;;
20469 rp='What pager is used on your system?'
20473 : see what type pids are declared as in the kernel
20474 rp="What is the type of process ids on this system?"
20475 set pid_t pidtype int stdio.h sys/types.h
20478 : see if ar generates random libraries by itself
20480 echo "Checking how to generate random libraries on your machine..." >&4
20481 echo 'int bar1() { return bar2(); }' > bar1.c
20482 echo 'int bar2() { return 2; }' > bar2.c
20484 #$i_stdlib I_STDLIB
20486 #include <stdlib.h>
20488 int main() { printf("%d\n", bar1()); exit(0); }
20490 $cc $ccflags -c bar1.c >/dev/null 2>&1
20491 $cc $ccflags -c bar2.c >/dev/null 2>&1
20492 $cc $ccflags -c foo.c >/dev/null 2>&1
20493 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
20494 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20495 $run ./foobar >/dev/null 2>&1; then
20496 echo "$ar appears to generate random libraries itself."
20498 if [ "X$ranlib" = "X" ]; then
20501 elif $ar s bar$_a >/dev/null 2>&1 &&
20502 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20503 $run ./foobar >/dev/null 2>&1; then
20504 echo "a table of contents needs to be added with '$ar s'."
20507 elif $ar ts 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 ts'."
20517 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
20518 $test -f $ranlib || ranlib=''
20521 if $test -n "$ranlib"; then
20522 echo "your system has '$ranlib'; we'll use that."
20525 echo "your system doesn't seem to support random libraries"
20526 echo "so we'll use lorder and tsort to order the libraries."
20533 : see if this is a values.h system
20534 set values.h i_values
20537 : Check the max offset that gmtime and localtime accept
20538 echo "Checking max offsets that gmtime () accepts"
20541 define) yyy="#include <values.h>" ;;
20545 case "$sGMTIME_min/$sGMTIME_max" in
20548 #include <sys/types.h>
20557 void gm_check (time_t t, int min_year, int max_year)
20560 if ( tmp == NULL ||
20561 /* Check tm_year overflow */
20562 tmp->tm_year < min_year || tmp->tm_year > max_year)
20573 gm_check (MAXLONG, 69, 0x7fffffff);
20575 if (tmp == NULL || tmp->tm_year < 0) {
20576 for (i = 63; i >= 0; i--) {
20577 time_t x = pt | ((time_t)1 << i);
20578 if (x < 0 || x < pt) continue;
20579 gm_check (x, 69, 0x7fffffff);
20582 printf ("sGMTIME_max=%ld\n", pt);
20591 gm_check (MINLONG, -1900, 70);
20594 for (i = 36; i >= 0; i--) {
20595 time_t x = pt - ((time_t)1 << i);
20596 if (x > 0) continue;
20597 gm_check (x, -1900, 70);
20600 printf ("sGMTIME_min=%ld\n", pt);
20604 int main (int argc, char *argv[])
20606 fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t));
20613 if eval $compile; then
20616 echo "Cannot determine sGMTIME_max and sGMTIME_min." >&4
20622 echo "Checking max offsets that localtime () accepts"
20624 case "$sLOCALTIME_min/$sLOCALTIME_max" in
20627 #include <sys/types.h>
20636 void local_check (time_t t, int min_year, int max_year)
20638 if (sizeof (time_t) > 4 && t > 0x7ffffffffffff000LL)
20641 tmp = localtime (&t);
20642 if ( tmp == NULL ||
20643 /* Check tm_year overflow */
20644 tmp->tm_year < min_year || tmp->tm_year > max_year)
20648 } /* local_check */
20655 local_check (MAXLONG, 69, 0x7fffffff);
20657 if (tmp == NULL || tmp->tm_year < 0) {
20658 for (i = 63; i >= 0; i--) {
20659 time_t x = pt | ((time_t)1 << i);
20660 if (x < 0 || x < pt) continue;
20661 local_check (x, 69, 0x7fffffff);
20664 printf ("sLOCALTIME_max=%ld\n", pt);
20673 local_check (MINLONG, -1900, 70);
20676 for (i = 36; i >= 0; i--) {
20677 time_t x = pt - ((time_t)1 << i);
20678 if (x > 0) continue;
20679 local_check (x, -1900, 70);
20682 printf ("sLOCALTIME_min=%ld\n", pt);
20686 int main (int argc, char *argv[])
20694 if eval $compile; then
20697 echo "Cannot determine sLOCALTIME_max and sLOCALTIME_min." >&4
20703 : check for type of arguments to select.
20704 case "$selecttype" in
20705 '') case "$d_select" in
20709 Checking to see what type of arguments are accepted by select().
20711 hdrs="$define sys/types.h
20712 $i_systime sys/time.h
20713 $i_sysselct sys/select.h
20714 $d_socket sys/socket.h"
20715 : The first arg can be int, unsigned, or size_t
20716 : The last arg may or may not be 'const'
20718 : void pointer has been seen but using that
20719 : breaks the selectminbits test
20720 for xxx in 'fd_set *' 'int *'; do
20721 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
20722 for tmo in 'struct timeval *' 'const struct timeval *'; do
20724 '') try="$extern_C select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
20725 if ./protochk "$try" $hdrs; then
20726 echo "Your system accepts $xxx."
20735 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
20736 case "$d_fd_set" in
20737 $define) dflt="fd_set *" ;;
20746 *) : no select, so pick a harmless default
20753 : check for the select 'width'
20754 case "$selectminbits" in
20755 '') safebits=`expr $ptrsize \* 8`
20756 case "$d_select" in
20760 Checking to see on how many bits at a time your select() operates...
20763 #include <sys/types.h>
20765 #$i_systime I_SYS_TIME
20766 #$i_systimek I_SYS_TIME_KERNEL
20771 # ifdef I_SYS_TIME_KERNEL
20774 # include <sys/time.h>
20775 # ifdef I_SYS_TIME_KERNEL
20779 #$i_sysselct I_SYS_SELECT
20780 #ifdef I_SYS_SELECT
20781 #include <sys/select.h>
20783 #$d_socket HAS_SOCKET
20785 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
20788 #$i_stdlib I_STDLIB
20790 #include <stdlib.h>
20793 #define S sizeof(*(b))
20795 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
20796 #define NBITS (NBYTES * 8)
20798 char *s = (char *)malloc(NBYTES);
20807 fp = fopen("try.c", "r");
20813 b = ($selecttype)s;
20814 for (i = 0; i < NBITS; i++)
20818 select(fd + 1, b, 0, 0, &t);
20819 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
20821 printf("%d\n", i + 1);
20826 if eval $compile_ok; then
20827 selectminbits=`$run ./try`
20828 case "$selectminbits" in
20830 Cannot figure out on how many bits at a time your select() operates.
20831 I'll play safe and guess it is $safebits bits.
20833 selectminbits=$safebits
20834 bits="$safebits bits"
20837 *) bits="$selectminbits bits" ;;
20839 echo "Your select() operates on $bits at a time." >&4
20841 rp='What is the minimum number of bits your select() operates on?'
20842 case "$byteorder" in
20843 12345678) dflt=64 ;;
20849 selectminbits="$val"
20853 *) : no select, so pick a harmless default
20854 selectminbits=$safebits
20860 : Trace out the files included by signal.h, then look for SIGxxx names.
20861 if [ "X$fieldn" = X ]; then
20862 : Just make some guesses. We check them later.
20863 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
20865 xxx=`echo '#include <signal.h>' |
20866 $cppstdin $cppminus $cppflags 2>/dev/null |
20867 $grep '^[ ]*#.*include' |
20868 $awk "{print \\$$fieldn}" | $sed 's!"!!g' |\
20869 $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
20872 for xx in $xxx /dev/null ; do
20873 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
20875 case "$xxxfiles" in
20876 '') xxxfiles=`./findhdr signal.h` ;;
20879 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
20880 print substr($2, 4, 20)
20882 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
20883 print substr($3, 4, 20)
20885 : Append some common names just in case the awk scan failed.
20886 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
20887 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
20888 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
20889 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
20890 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
20892 : generate a few handy files for later
20893 $cat > signal.c <<EOCP
20894 #include <sys/types.h>
20895 #include <signal.h>
20896 #$i_stdlib I_STDLIB
20898 #include <stdlib.h>
20903 /* Strange style to avoid deeply-nested #if/#else/#endif */
20906 # define NSIG (_NSIG)
20912 # define NSIG (SIGMAX+1)
20918 # define NSIG (SIG_MAX+1)
20924 # define NSIG (_SIG_MAX+1)
20930 # define NSIG (MAXSIG+1)
20936 # define NSIG (MAX_SIG+1)
20941 # ifdef SIGARRAYSIZE
20942 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
20948 # define NSIG (_sys_nsig) /* Solaris 2.5 */
20952 /* Default to some arbitrary number that's big enough to get most
20953 of the common signals.
20959 printf("NSIG %d\n", NSIG);
20965 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
20967 printf "#ifdef SIG"; printf $1; printf "\n"
20968 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
20969 printf $1; printf ");\n"
20973 printf "#endif /* JUST_NSIG */\n";
20974 printf "exit(0);\n}\n";
20977 $cat >signal.awk <<'EOP'
20978 BEGIN { ndups = 0 }
20979 $1 ~ /^NSIG$/ { nsig = $2 }
20980 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
20981 if ($2 > maxsig) { maxsig = $2 }
20982 if (sig_name[$2]) {
20983 dup_name[ndups] = $1
20984 dup_num[ndups] = $2
20996 printf("NSIG %d\n", nsig);
20997 for (n = 1; n < nsig; n++) {
20999 printf("%s %d\n", sig_name[n], sig_num[n])
21002 printf("NUM%d %d\n", n, n)
21005 for (n = 0; n < ndups; n++) {
21006 printf("%s %d\n", dup_name[n], dup_num[n])
21010 $cat >signal_cmd <<EOS
21012 if $test -s signal.lst; then
21013 echo "Using your existing signal.lst file"
21018 $cat >>signal_cmd <<'EOS'
21021 if eval $compile_ok; then
21022 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) |\
21023 $uniq | $awk -f signal.awk >signal.lst
21025 echo "(I can't seem be able to compile the whole test program)" >&4
21026 echo "(I'll try it in little pieces.)" >&4
21027 set signal -DJUST_NSIG
21028 if eval $compile_ok; then
21029 $run ./signal$_exe > signal.nsg
21032 echo "I can't seem to figure out how many signals you have." >&4
21033 echo "Guessing 50." >&4
21034 echo 'NSIG 50' > signal.nsg
21036 : Now look at all the signal names, one at a time.
21037 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
21038 $cat > signal.c <<EOCP
21039 #include <sys/types.h>
21040 #include <signal.h>
21043 printf("$xx %d\n", SIG${xx});
21048 if eval $compile; then
21049 echo "SIG${xx} found."
21050 $run ./signal$_exe >> signal.ls1
21052 echo "SIG${xx} NOT found."
21055 if $test -s signal.ls1; then
21056 $cat signal.nsg signal.ls1 |
21057 $sort -n | $uniq | $awk -f signal.awk >signal.lst
21061 if $test -s signal.lst; then
21064 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
21065 echo 'kill -l' >signal
21066 set X `csh -f <signal`
21070 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
21072 echo $@ | $tr ' ' $trnl | \
21073 $awk '{ printf "%s %d\n", $1, ++s; }
21074 END { printf "NSIG %d\n", ++s }' >signal.lst
21076 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
21078 chmod a+x signal_cmd
21079 $eunicefix signal_cmd
21081 : generate list of signal names
21083 case "$sig_name_init" in
21085 *) case "$sig_num_init" in
21086 ''|*,*) doinit=yes ;;
21091 echo "Generating a list of signal names and numbers..." >&4
21093 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
21094 sig_name=`$awk 'BEGIN { printf "ZERO " }
21095 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
21096 sig_num=`$awk 'BEGIN { printf "0 " }
21097 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
21098 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
21099 !/^NSIG/ { printf "\"%s\", ", $1 }
21100 END { printf "0\n" }' signal.lst`
21101 sig_num_init=`$awk 'BEGIN { printf "0, " }
21102 !/^NSIG/ { printf "%d, ", $2}
21103 END { printf "0\n"}' signal.lst`
21106 echo "The following $sig_count signals are available:"
21108 echo $sig_name | $awk \
21109 'BEGIN { linelen = 0 }
21111 for (i = 1; i <= NF; i++) {
21112 name = "SIG" $i " "
21113 linelen = linelen + length(name)
21114 if (linelen > 70) {
21116 linelen = length(name)
21122 sig_size=`echo $sig_name | awk '{print NF}'`
21123 $rm -f signal signal.c signal.awk signal.lst signal_cmd
21125 : Check size of size
21127 case "$sizetype" in
21128 *_t) zzz="$sizetype" ;;
21129 *) zzz="filesize" ;;
21131 echo "Checking the size of $zzz..." >&4
21133 #include <sys/types.h>
21135 #$i_stdlib I_STDLIB
21137 #include <stdlib.h>
21140 printf("%d\n", (int)sizeof($sizetype));
21145 if eval $compile_ok; then
21149 echo "(I can't execute the test program--guessing $sizesize.)" >&4
21152 echo "Your $zzz size is $sizesize bytes."
21157 echo "(I can't compile the test program--guessing $sizesize.)" >&4
21161 : check for socklen_t
21163 echo "Checking to see if you have socklen_t..." >&4
21165 #include <sys/types.h>
21166 #$d_socket HAS_SOCKET
21168 #include <sys/socket.h>
21170 int main() { socklen_t x = 16; }
21173 if eval $compile; then
21175 echo "You have socklen_t."
21178 echo "You do not have socklen_t."
21179 case "$sizetype" in
21180 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
21187 : see if this is a socks.h system
21188 set socks.h i_socks
21191 : check for type of the size argument to socket calls
21192 case "$d_socket" in
21196 Checking to see what type is the last argument of accept().
21199 case "$d_socklen_t" in
21200 "$define") yyy="$yyy socklen_t"
21202 yyy="$yyy $sizetype int long unsigned"
21203 for xxx in $yyy; do
21204 case "$socksizetype" in
21205 '') try="$extern_C int accept(int, struct sockaddr *, $xxx *);"
21206 case "$usesocks" in
21208 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
21209 echo "Your system accepts '$xxx *' for the last argument of accept()."
21210 socksizetype="$xxx"
21213 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
21214 echo "Your system accepts '$xxx *' for the last argument of accept()."
21215 socksizetype="$xxx"
21222 : In case none of those worked, prompt the user.
21223 case "$socksizetype" in
21224 '') rp='What is the type for socket address structure sizes?'
21231 *) : no sockets, so pick relatively harmless default
21236 : see what type is used for signed size_t
21237 set ssize_t ssizetype int stdio.h sys/types.h
21242 #$i_stdlib I_STDLIB
21244 #include <stdlib.h>
21246 #include <sys/types.h>
21247 #define Size_t $sizetype
21248 #define SSize_t $dflt
21251 if (sizeof(Size_t) == sizeof(SSize_t))
21253 else if (sizeof(Size_t) == sizeof(int))
21262 if eval $compile_ok && $run ./try > /dev/null; then
21263 ssizetype=`$run ./try`
21264 echo "I'll be using $ssizetype for functions returning a byte count." >&4
21267 Help! I can't compile and run the ssize_t test program: please enlighten me!
21268 (This is probably a misconfiguration in your system or libraries, and
21269 you really ought to fix it. Still, I'll try anyway.)
21271 I need a type that is the same size as $sizetype, but is guaranteed to
21272 be signed. Common values are ssize_t, int and long.
21275 rp="What signed type is the same size as $sizetype?"
21281 : Check the size of st_ino
21283 $echo "Checking the size of st_ino..." >&4
21284 $cat > try.c <<EOCP
21285 #include <sys/stat.h>
21287 #$i_stdlib I_STDLIB
21289 #include <stdlib.h>
21293 printf("%d\n", (int)sizeof(st.st_ino));
21298 if eval $compile_ok; then
21302 $echo "(I can't execute the test program--guessing $st_ino_size.)" >&4
21304 *) st_ino_size=$val
21305 $echo "Your st_ino is $st_ino_size bytes long."
21310 $echo "(I can't compile the test program--guessing $st_ino_size.)" >&4
21314 : Check if st_ino is signed
21316 $echo "Checking the sign of st_ino..." >&4
21317 $cat > try.c <<EOCP
21318 #include <sys/stat.h>
21323 if (foo.st_ino < 0)
21330 if eval $compile; then
21334 $echo "(I can't execute the test program--guessing unsigned.)" >&4
21336 *) st_ino_sign=$val
21337 case "$st_ino_sign" in
21338 1) $echo "Your st_ino is unsigned." ;;
21339 -1) $echo "Your st_ino is signed." ;;
21345 $echo "(I can't compile the test program--guessing unsigned.)" >&4
21349 : see what type of char stdio uses.
21351 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
21352 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
21353 echo "Your stdio uses unsigned chars." >&4
21354 stdchar="unsigned char"
21356 echo "Your stdio uses signed chars." >&4
21361 : see what type uids are declared as in the kernel
21363 echo "Looking for the type for user ids returned by getuid()."
21364 set uid_t uidtype xxx stdio.h sys/types.h
21368 xxx=`./findhdr sys/user.h`
21369 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
21371 unsigned) dflt="$1 $2" ;;
21375 *) dflt="$uidtype";;
21378 uid_t) echo "uid_t found." ;;
21379 *) rp="What is the type for user ids returned by getuid()?"
21385 : Check size of UID
21388 *_t) zzz="$uidtype" ;;
21391 echo "Checking the size of $zzz..." >&4
21393 #include <sys/types.h>
21395 #$i_stdlib I_STDLIB
21397 #include <stdlib.h>
21400 printf("%d\n", (int)sizeof($uidtype));
21405 if eval $compile_ok; then
21409 echo "(I can't execute the test program--guessing $uidsize.)" >&4
21412 echo "Your $zzz is $uidsize bytes long."
21417 echo "(I can't compile the test program--guessing $uidsize.)" >&4
21420 : Check if UID is signed
21423 *_t) zzz="$uidtype" ;;
21426 echo "Checking the sign of $zzz..." >&4
21428 #include <sys/types.h>
21439 if eval $compile; then
21443 echo "(I can't execute the test program--guessing unsigned.)" >&4
21447 1) echo "Your $zzz is unsigned." ;;
21448 -1) echo "Your $zzz is signed." ;;
21454 echo "(I can't compile the test program--guessing unsigned.)" >&4
21458 : Check format string for UID
21460 $echo "Checking the format string to be used for uids..." >&4
21463 -1) if $test X"$uidsize" = X"$ivsize"; then
21464 uidformat="$ivdformat"
21466 if $test X"$uidsize" = X"$longsize"; then
21469 if $test X"$uidsize" = X"$intsize"; then
21472 if $test X"$uidsize" = X"$shortsize"; then
21479 *) if $test X"$uidsize" = X"$uvsize"; then
21480 uidformat="$uvuformat"
21482 if $test X"$uidsize" = X"$longsize"; then
21485 if $test X"$uidsize" = X"$intsize"; then
21488 if $test X"$uidsize" = X"$shortsize"; then
21497 : Determine if we can use sysctl with KERN_PROC_PATHNAME to find executing program
21499 echo "Determining whether we can use sysctl with KERN_PROC_PATHNAME to find executing program..." >&4
21500 $cat >try.c <<'EOM'
21501 /* Intentionally a long probe as I'd like to sanity check that the exact
21502 approach is going to work, as thinking it will work, but only having it
21503 part working at runtime is worse than not having it. */
21505 #include <sys/types.h>
21506 #include <sys/sysctl.h>
21507 #include <sys/param.h>
21509 #include <string.h>
21510 #include <stdlib.h>
21511 #include <unistd.h>
21514 main(int argc, char **argv) {
21516 char *argv_leaf = strrchr(argv[0], '/');
21522 mib[1] = KERN_PROC;
21523 mib[2] = KERN_PROC_PATHNAME;
21527 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
21531 if (sysctl(mib, 4, NULL, &size, NULL, 0)) {
21536 if (size < strlen(argv_leaf) + 1) {
21537 fprintf(stderr, "size %lu is too short for a path\n",
21538 (unsigned long) size);
21542 if (size > MAXPATHLEN * MAXPATHLEN) {
21543 fprintf(stderr, "size %lu is too long for a path\n",
21544 (unsigned long) size);
21548 buffer = malloc(size);
21554 if (sysctl(mib, 4, buffer, &size, NULL, 0)) {
21559 if (strlen(buffer) + 1 != size) {
21560 fprintf(stderr, "size != strlen(buffer) + 1 (%lu != %lu)\n",
21561 (unsigned long)size, (unsigned long)strlen(buffer) + 1);
21566 if (*buffer != '/') {
21567 fprintf(stderr, "Not an absolute path: '%s'\n", buffer);
21571 if (strstr(buffer, "/./")) {
21572 fprintf(stderr, "Contains /./: '%s'\n", buffer);
21576 if (strstr(buffer, "/../")) {
21577 fprintf(stderr, "Contains /../: '%s'\n", buffer);
21581 buffer_leaf = strrchr(buffer, '/');
21582 if (strcmp(buffer_leaf, argv_leaf) != 0) {
21583 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], buffer);
21595 if eval $compile; then
21596 if $run ./try; then
21597 echo "You can use sysctl with KERN_PROC_PATHNAME to find the executing program." >&4
21600 echo "Nope, sysctl with KERN_PROC_PATHNAME doesn't work here." >&4
21604 echo "I'm unable to compile the test program." >&4
21605 echo "I'll assume no sysctl with KERN_PROC_PATHNAME here." >&4
21609 set usekernprocpathname
21612 : Determine if we can use _NSGetExecutablePath to find executing program
21614 echo "Determining whether we can use _NSGetExecutablePath to find executing program..." >&4
21615 $cat >try.c <<'EOM'
21616 /* Intentionally a long probe as I'd like to sanity check that the exact
21617 approach is going to work, as thinking it will work, but only having it
21618 part working at runtime is worse than not having it. */
21619 #include <mach-o/dyld.h>
21621 #include <stdlib.h>
21622 #include <sys/param.h>
21623 #include <string.h>
21626 main(int argc, char **argv) {
21628 uint32_t size = sizeof(buf);
21632 char *argv_leaf = strrchr(argv[0], '/');
21636 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
21640 _NSGetExecutablePath(buf, &size);
21641 if (size > MAXPATHLEN * MAXPATHLEN) {
21642 fprintf(stderr, "_NSGetExecutablePath size %u is too long for a path\n",
21643 (unsigned int) size);
21647 buffer = malloc(size);
21653 result = _NSGetExecutablePath(buffer, &size);
21655 fprintf(stderr, "_NSGetExecutablePath returned %i for a size of %u\n",
21656 result, (unsigned int) size);
21660 tidied = realpath(buffer, NULL);
21662 perror("realpath");
21668 if (*tidied != '/') {
21669 fprintf(stderr, "Not an absolute path: '%s'\n", tidied);
21673 if (strstr(tidied, "/./")) {
21674 fprintf(stderr, "Contains /./: '%s'\n", tidied);
21678 if (strstr(tidied, "/../")) {
21679 fprintf(stderr, "Contains /../: '%s'\n", tidied);
21683 tidied_leaf = strrchr(tidied, '/');
21684 if (strcmp(tidied_leaf, argv_leaf) != 0) {
21685 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], tidied);
21697 if eval $compile; then
21698 if $run ./try; then
21699 echo "You can use _NSGetExecutablePath to find the executing program." >&4
21702 echo "Nope, _NSGetExecutablePath doesn't work here." >&4
21705 echo "I'm unable to compile the test program." >&4
21706 echo "I'll assume no _NSGetExecutablePath here." >&4
21709 set usensgetexecutablepath
21712 : Check if site customization support was requested
21713 case "$usesitecustomize" in
21714 $define|true|[Yy]*)
21715 usesitecustomize="$define"
21718 usesitecustomize="$undef"
21722 : see if prototypes support variable argument declarations
21724 case "$prototype$i_stdarg" in
21726 echo "It appears we'll be able to prototype varargs functions." >&4
21730 echo "Too bad... We won't be using prototyped varargs functions..." >&4
21737 : determine compiler compiler
21746 if $test -f "$byacc$_exe"; then
21748 comp="byacc or $comp"
21750 if $test -f "$bison$_exe"; then
21751 comp="$comp or bison -y"
21753 rp="Which compiler compiler ($comp) shall I use?"
21762 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
21768 : see if this is a assert.h system
21769 set assert.h i_assert
21772 : see if this is a fp.h system
21776 : see if this is a fp_class.h system
21777 set fp_class.h i_fp_class
21780 : see if gdbm.h is available
21785 : see if gdbm_open exists
21786 set gdbm_open d_gdbm_open
21788 case "$d_gdbm_open" in
21791 echo "We won't be including <gdbm.h>"
21800 : see if this is a ieeefp.h system
21801 case "$i_ieeefp" in
21802 '' ) set ieeefp.h i_ieeefp
21807 : see if this is a libutil.h system
21808 set libutil.h i_libutil
21811 : see if mach cthreads are available
21812 if test "X$usethreads" = "X$define"; then
21813 set mach/cthreads.h i_machcthr
21816 i_machcthr="$undef"
21819 : see if this is a mntent.h system
21820 set mntent.h i_mntent
21823 : see if net/errno.h is available
21825 set net/errno.h val
21828 : Unfortunately, it causes problems on some systems. Arrgh.
21831 cat > try.c <<'EOM'
21834 #include <net/errno.h>
21840 if $cc $ccflags -c try.c >/dev/null 2>&1; then
21841 echo "We'll be including <net/errno.h>." >&4
21843 echo "We won't be including <net/errno.h>." >&4
21852 : see if netinet/tcp.h is available
21853 set netinet/tcp.h i_netinettcp
21856 : see if this is a poll.h system
21860 : see if this is a prot.h system
21864 : Preprocessor symbols
21866 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
21867 $cat <<'EOSH' > Cppsym.know
21868 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
21869 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
21870 alliant alpha am29000 AM29000 AMD64 amd64 amiga AMIGAOS AMIX
21871 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
21872 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
21873 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
21874 bull c cadmus clipper CMU COFF COMPILER_VERSION
21875 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
21876 CYGWIN DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
21877 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
21878 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
21880 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
21881 H3050R H3050RX hbullx20 hcx host_mips
21882 hp200 hp300 hp700 HP700 hp800 hp9000
21883 hp9000s200 hp9000s300 hp9000s400 hp9000s500
21884 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
21885 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
21886 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
21887 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
21888 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
21889 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
21890 LIBCATAMOUNT Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
21891 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
21892 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
21893 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
21894 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
21895 MATH_HAS_NO_SIDE_EFFECTS
21896 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
21897 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
21898 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
21899 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
21900 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
21901 NetBSD news1500 news1700 news1800 news1900 news3700
21902 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
21903 ns32016 ns32332 ns32k nsc32000
21904 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
21905 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
21906 pc532 pdp11 PGC PIC plexus PORTAR posix
21907 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
21908 POSIX_C_SOURCE POSIX_SOURCE POWER
21909 PROTOTYPES PWB pyr QNX QK_USER R3000 REENTRANT RES Rhapsody RISC6000
21910 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
21911 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
21912 sony sony_news sonyrisc sparc sparclite spectrum
21913 stardent stdc STDC_EXT stratos sun sun3 sun386
21914 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
21915 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
21916 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
21917 sysV68 sysV88 Tek4132 Tek4300 titan
21918 TM3200 TM5400 TM5600
21919 tower tower32 tower32_200 tower32_600 tower32_700
21920 tower32_800 tower32_850 tss
21921 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
21922 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
21923 unix UNIX95 UNIX99 unixpc unos
21924 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
21925 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
21926 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
21928 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms x86_64 xenix Xenix286
21929 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
21930 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
21933 # Maybe put other stuff here too.
21934 cat <<EOSH >>Cppsym.know
21937 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
21938 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
21939 $cat Cppsym.know > Cppsym.c
21940 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
21941 $rm -f Cppsym.a Cppsym.b Cppsym.c
21942 cat <<EOSH > Cppsym
21944 if $test \$# -gt 0; then
21945 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
21946 if $test -s Cppsym.got; then
21953 $tr " " "$trnl" | ./Cppsym.try
21959 cat <<EOSH > Cppsym.try
21961 cat <<'EOCP' > try.c
21964 #define STRINGIFY(a) "a"
21966 #if cpp_stuff == 42
21967 #define StGiFy(a) #a
21968 #define STRINGIFY(a) StGiFy(a)
21970 #if $cpp_stuff != 1 && $cpp_stuff != 42
21971 # include "Bletch: How does this C preprocessor stringify macros?"
21977 cat <<'EOSH' >> Cppsym.try
21979 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
21980 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
21981 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
21982 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
21984 echo 'return 0;}' >> try.c
21986 cat <<EOSH >> Cppsym.try
21988 case "$osname-$gccversion" in
21989 irix-) ccflags="\$ccflags -woff 1178" ;;
21990 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
21992 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
21994 chmod +x Cppsym.try
21995 $eunicefix Cppsym.try
21996 ./Cppsym < Cppsym.know | $sort | $uniq > Cppsym.true
21997 : Add in any linux cpp "predefined macros":
21998 case "$osname::$gccversion" in
21999 *linux*::*.*|*gnukfreebsd*::*.*|gnu::*.*)
22001 rm -f $tHdrH'.h' $tHdrH
22003 # Filter out macro arguments, such as Linux's __INT8_C(c)
22004 if $cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
22005 sed -e 's/#define[\ \ ]*//;s/[\ \ ].*$//' -e 's/(.*//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
22006 if [ -s $tHdrH'_cppsym.real' ]; then
22007 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
22010 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
22013 : now check the C compiler for additional symbols
22014 postprocess_cc_v=''
22016 aix) postprocess_cc_v="|$tr , ' '" ;;
22023 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
22026 -D*) echo "\$i" | $sed 's/^-D//';;
22027 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
22032 postprocess_cc_v=''
22035 ./ccsym > ccsym1.raw
22036 if $test -s ccsym1.raw; then
22037 $sort ccsym1.raw | $uniq >ccsym.raw
22039 mv ccsym1.raw ccsym.raw
22042 $awk '/\=/ { print $0; next }
22043 { print $0"=1" }' ccsym.raw >ccsym.list
22044 $comm -13 Cppsym.true ccsym.list >ccsym.own
22045 $comm -12 Cppsym.true ccsym.list >ccsym.com
22046 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
22048 if $test -z ccsym.raw; then
22049 echo "Your C compiler doesn't seem to define any symbols!" >&4
22051 echo "However, your C preprocessor defines the following symbols:"
22054 cppsymbols=`$cat Cppsym.true`
22055 cppsymbols=`echo $cppsymbols`
22056 cppccsymbols="$cppsymbols"
22058 if $test -s ccsym.com; then
22059 echo "Your C compiler and pre-processor define these symbols:"
22060 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
22063 cppccsymbols=`$cat ccsym.com`
22064 cppccsymbols=`echo $cppccsymbols`
22065 $test "$silent" || sleep 1
22067 if $test -s ccsym.cpp; then
22068 $test "$also" && echo " "
22069 echo "Your C pre-processor ${also}defines the following symbols:"
22070 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
22072 cppsymbols=`$cat ccsym.cpp`
22073 cppsymbols=`echo $cppsymbols`
22074 $test "$silent" || sleep 1
22076 if $test -s ccsym.own; then
22077 $test "$also" && echo " "
22078 echo "Your C compiler ${also}defines the following cpp symbols:"
22079 $sed -e 's/\(..*\)=1/\1/' ccsym.own
22080 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
22081 ccsymbols=`$cat ccsym.own`
22082 ccsymbols=`echo $ccsymbols`
22083 $test "$silent" || sleep 1
22087 : see if this is a termio system
22091 if $test `./findhdr termios.h`; then
22092 set tcsetattr i_termios
22098 "$define") echo "You have POSIX termios.h... good!" >&4;;
22099 *) if ./Cppsym pyr; then
22100 case "`/bin/universe`" in
22101 ucb) if $test `./findhdr sgtty.h`; then
22103 echo "<sgtty.h> found." >&4
22105 echo "System is pyramid with BSD universe."
22106 ./warn "<sgtty.h> not found--you could have problems."
22108 *) if $test `./findhdr termio.h`; then
22110 echo "<termio.h> found." >&4
22112 echo "System is pyramid with USG universe."
22113 ./warn "<termio.h> not found--you could have problems."
22117 if $test `./findhdr termio.h`; then
22118 echo "<termio.h> found." >&4
22120 elif $test `./findhdr sgtty.h`; then
22121 echo "<sgtty.h> found." >&4
22124 ./warn "Neither <termio.h> nor <sgtty.h> found--cross fingers!"
22127 if $test `./findhdr sgtty.h`; then
22128 echo "<sgtty.h> found." >&4
22130 elif $test `./findhdr termio.h`; then
22131 echo "<termio.h> found." >&4
22134 ./warn "Neither <sgtty.h> nor <termio.h> found--cross fingers!"
22138 set i_termio; eval $setvar
22139 val=$val2; set i_sgtty; eval $setvar
22140 val=$val3; set i_termios; eval $setvar
22142 : see if stdbool is available
22143 : we want a real compile instead of Inhdr because some Solaris systems
22144 : have stdbool.h, but it can only be used if the compiler indicates it
22145 : is sufficiently c99-compliant.
22149 #include <stdbool.h>
22154 int main(int argc, char **argv)
22160 if eval $compile; then
22161 echo "<stdbool.h> found." >&4
22164 echo "<stdbool.h> NOT found." >&4
22171 : see if stddef is available
22172 set stddef.h i_stddef
22175 : see if sys/access.h is available
22176 set sys/access.h i_sysaccess
22179 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
22180 set sys/filio.h i_sysfilio
22183 if $test `./findhdr sys/ioctl.h`; then
22185 echo '<sys/ioctl.h> found.' >&4
22188 if $test $i_sysfilio = "$define"; then
22189 echo '<sys/ioctl.h> NOT found.' >&4
22191 $test $i_sgtty = "$define" && xxx="sgtty.h"
22192 $test $i_termio = "$define" && xxx="termio.h"
22193 $test $i_termios = "$define" && xxx="termios.h"
22194 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
22200 : see if socket ioctl defs are in sys/sockio.h
22202 xxx=`./findhdr sys/sockio.h`
22203 if $test "$xxx"; then
22204 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
22206 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
22209 echo "No socket ioctls found in <sys/sockio.h>." >&4
22214 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
22220 : see if this is a syslog.h system
22221 set syslog.h i_syslog
22224 : see if this is a sys/mode.h system
22225 set sys/mode.h i_sysmode
22228 : see if there is a sys/poll.h file
22229 set sys/poll.h i_syspoll
22232 : see if sys/resource.h has to be included
22233 set sys/resource.h i_sysresrc
22236 : see if sys/security.h is available
22237 set sys/security.h i_syssecrt
22240 : see if this is a sys/statvfs.h system
22241 set sys/statvfs.h i_sysstatvfs
22244 : see if this is a sys/un.h system
22245 set sys/un.h i_sysun
22248 : see if this is a sys/utsname.h system
22249 set sys/utsname.h i_sysutsname
22252 : see if this is a syswait system
22253 set sys/wait.h i_syswait
22256 : see if this is a ustat.h system
22257 set ustat.h i_ustat
22260 : see if this is an utime system
22261 set utime.h i_utime
22264 : see if this is a vfork system
22267 set vfork.h i_vfork
22277 echo "Looking for extensions..." >&4
22278 : If we are using the old config.sh, known_extensions may contain
22279 : old or inaccurate or duplicate values.
22280 known_extensions=''
22281 nonxs_extensions=''
22282 : We do not use find because it might not be available.
22283 : We do not just use MANIFEST because the user may have dropped
22284 : some additional extensions into the source tree and expect them
22287 : Function to recursively find available extensions, ignoring DynaLoader
22288 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
22289 : In 5.10.1 and later, extensions are stored in directories
22290 : like File-Glob instead of the older File/Glob/.
22294 DynaLoader|dynaload) ;;
22296 this_ext=`echo $xxx | $sed -e s/-/\\\//g`;
22297 leaf=`echo $xxx | $sed -e s/.*-//`;
22298 if $test -d File; then
22299 if $test -f $xxx/$leaf.xs -o -f $xxx/$leaf.c; then
22300 known_extensions="$known_extensions $1$this_ext";
22301 elif $test -f $xxx/Makefile.PL; then
22302 nonxs_extensions="$nonxs_extensions $1$this_ext";
22304 if $test -d $xxx -a $# -lt 10; then
22307 eval $find_extensions;
22313 echo " $known_extensions $nonxs_extensions" > $$.tmp;
22314 if $contains " $this_ext " $$.tmp; then
22316 echo "Duplicate directories detected for extension $xxx" >&4;
22317 echo "Configure cannot correctly recover from this - shall I abort?" >&4;
22318 case "$knowitall" in
22326 echo "Ok. Stopping Configure." >&4;
22327 echo "Please remove the duplicate directory (eg using git clean) and then re-run Configure" >&4;
22330 echo "Ok. You will need to correct config.sh before running make." >&4;
22332 $ls -1 $xxx > $$.tmp;
22333 if $contains "\.xs$" $$.tmp > /dev/null 2>&1; then
22334 known_extensions="$known_extensions $this_ext";
22335 elif $contains "\.c$" $$.tmp > /dev/null 2>&1; then
22336 known_extensions="$known_extensions $this_ext";
22337 elif $test -d $xxx; then
22338 nonxs_extensions="$nonxs_extensions $this_ext";
22349 eval $find_extensions
22353 eval $find_extensions
22357 eval $find_extensions
22358 if $test -d File-Glob; then
22359 : All ext/ flattened
22361 # Special case: Add in modules that nest beyond the first level.
22362 # Currently threads/shared and Hash/Util/FieldHash, since they are
22363 # not picked up by the recursive find above (and adding in general
22364 # recursive finding breaks SDBM_File/sdbm).
22365 # A.D. 20011025 (SDBM), ajgough 20071008 (FieldHash)
22366 known_extensions="$known_extensions threads/shared Hash/Util/FieldHash"
22368 set X $known_extensions
22370 known_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
22371 set X $nonxs_extensions
22373 nonxs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
22376 : Now see which are supported on this system.
22378 for xxx in $known_extensions ; do
22382 $define) avail_ext="$avail_ext $xxx" ;;
22385 GDBM_File|gdbm_fil)
22387 $define) avail_ext="$avail_ext $xxx" ;;
22390 I18N/Langinfo|i18n_lan)
22391 case "$i_langinfo$d_nl_langinfo" in
22392 $define$define) avail_ext="$avail_ext $xxx" ;;
22396 : XXX Do we need a useipcsysv variable here
22397 case "${d_msg}${d_sem}${d_shm}" in
22398 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
22401 NDBM_File|ndbm_fil)
22404 case "$osname-$use64bitint" in
22407 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
22410 *) avail_ext="$avail_ext $xxx" ;;
22415 ODBM_File|odbm_fil)
22416 case "${i_dbm}${i_rpcsvcdbm}" in
22418 case "$d_cplusplus" in
22419 define) ;; # delete as a function name will not work
22420 *) case "$osname-$use64bitint" in
22423 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
22426 *) avail_ext="$avail_ext $xxx" ;;
22434 case "$useopcode" in
22435 true|define|y) avail_ext="$avail_ext $xxx" ;;
22439 case "$useposix" in
22440 true|define|y) avail_ext="$avail_ext $xxx" ;;
22444 case "$d_socket" in
22447 beos) ;; # not unless BONE
22448 *) avail_ext="$avail_ext $xxx" ;;
22453 Sys/Syslog|sys/syslog)
22454 : XXX syslog requires socket
22455 case "$d_socket" in
22456 true|$define|y) avail_ext="$avail_ext $xxx" ;;
22460 case "$usethreads" in
22462 case "$use5005threads" in
22463 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
22467 threads|threads/shared)
22468 # threads and threads::shared are special cases.
22469 # To stop people from asking "Perl 5.8.0 was supposed
22470 # to have this new fancy threads implementation but my
22471 # perl doesn't have it" and from people trying to
22472 # (re)install the threads module using CPAN.pm and
22473 # CPAN.pm then offering to reinstall Perl 5.8.0,
22474 # the threads.pm and threads/shared.pm will always be
22475 # there, croaking informatively ("you need to rebuild
22476 # all of Perl with threads, sorry") when threads haven't
22477 # been compiled in.
22479 avail_ext="$avail_ext $xxx"
22485 cygwin) avail_ext="$avail_ext $xxx" ;;
22488 XS/APItest|xs/apitest)
22489 # This is just for testing. Skip it unless we have dynamic loading.
22492 $define) avail_ext="$avail_ext $xxx" ;;
22495 XS/Typemap|xs/typemap)
22496 # This is just for testing. Skip it unless we have dynamic loading.
22498 $define) avail_ext="$avail_ext $xxx" ;;
22501 *) avail_ext="$avail_ext $xxx"
22510 case "$onlyextensions" in
22512 *) keepextensions=''
22513 echo "You have requested that only certain extensions be included..." >&4
22514 for i in $onlyextensions; do
22515 case " $avail_ext " in
22517 echo "Keeping extension $i."
22518 keepextensions="$keepextensions $i"
22520 *) echo "Ignoring extension $i." ;;
22523 avail_ext="$keepextensions"
22527 case "$noextensions" in
22529 *) keepextensions=''
22530 echo "You have requested that certain extensions be ignored..." >&4
22531 for i in $avail_ext; do
22532 case " $noextensions " in
22533 *" $i "*) echo "Ignoring extension $i." ;;
22534 *) echo "Keeping extension $i.";
22535 keepextensions="$keepextensions $i"
22539 avail_ext="$keepextensions"
22543 : Now see which nonxs extensions are supported on this system.
22544 : For now assume all are.
22546 for xxx in $nonxs_extensions ; do
22548 *) nonxs_ext="$nonxs_ext $xxx"
22560 A number of extensions are supplied with $package. You may choose to
22561 compile these extensions for dynamic loading (the default), compile
22562 them into the $package executable (static loading), or not include
22563 them at all. Answer "none" to include no extensions.
22564 Note that DynaLoader is always built and need not be mentioned here.
22567 case "$dynamic_ext" in
22569 : Exclude those listed in static_ext
22571 for xxx in $avail_ext; do
22572 case " $static_ext " in
22574 *) dflt="$dflt $xxx" ;;
22581 *) dflt="$dynamic_ext"
22582 # Perhaps we are reusing an old out-of-date config.sh.
22585 if test X"$dynamic_ext" != X"$avail_ext"; then
22587 NOTICE: Your previous config.sh list may be incorrect.
22588 The extensions now available to you are
22590 but the default list from your previous config.sh is
22602 rp="What extensions do you wish to load dynamically?"
22605 none) dynamic_ext=' ' ;;
22606 *) dynamic_ext="$ans" ;;
22609 case "$static_ext" in
22611 : Exclude those already listed in dynamic linking
22613 for xxx in $avail_ext; do
22614 case " $dynamic_ext " in
22616 *) dflt="$dflt $xxx" ;;
22623 *) dflt="$static_ext"
22630 rp="What extensions do you wish to load statically?"
22633 none) static_ext=' ' ;;
22634 *) static_ext="$ans" ;;
22639 A number of extensions are supplied with $package. Answer "none"
22640 to include no extensions.
22641 Note that DynaLoader is always built and need not be mentioned here.
22644 case "$static_ext" in
22645 '') dflt="$avail_ext" ;;
22646 *) dflt="$static_ext"
22647 # Perhaps we are reusing an old out-of-date config.sh.
22650 if test X"$static_ext" != X"$avail_ext"; then
22652 NOTICE: Your previous config.sh list may be incorrect.
22653 The extensions now available to you are
22655 but the default list from your previous config.sh is
22664 : Exclude those that are not xs extensions
22668 rp="What extensions do you wish to include?"
22671 none) static_ext=' ' ;;
22672 *) static_ext="$ans" ;;
22677 # Encode is a special case. If we are building Encode as a static
22678 # extension, we need to explicitly list its subextensions as well.
22679 # For other nested extensions, this is handled automatically by
22680 # the appropriate Makefile.PL.
22681 case " $static_ext " in
22682 *" Encode "*) # Add the subextensions of Encode
22684 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
22685 static_ext="$static_ext Encode/$xxx"
22691 set X $dynamic_ext $static_ext $nonxs_ext
22695 # Sanity check: We require an extension suitable for use with
22696 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
22697 # should show up as failures in the test suite, but it's helpful to
22698 # catch them now.) The 'extensions' list is normally sorted
22699 # alphabetically, so we need to accept either
22700 # DB_File ... Fcntl ... IO ....
22701 # or something like
22702 # Fcntl ... NDBM_File ... IO ....
22703 case " $extensions" in
22704 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
22705 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
22706 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
22707 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
22708 echo "WARNING: The Perl you are building will be quite crippled." >& 4
22712 : Remove libraries needed only for extensions
22713 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
22714 : The exception is SunOS 4.x, which needs them.
22715 case "${osname}X${osvers}" in
22719 *) case "$usedl" in
22720 $define|true|[yY]*)
22721 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
22725 *) perllibs="$libs"
22731 : Remove build directory name from cppstdin so it can be used from
22732 : either the present location or the final installed location.
22734 : Get out of the UU directory to get correct path name.
22736 case "$cppstdin" in
22738 echo "Stripping down cppstdin path name"
22744 : end of configuration questions
22746 echo "End of configuration questions."
22749 : back to where it started
22750 if test -d ../UU; then
22754 : configuration may be unconditionally patched via a 'config.arch' file
22755 if $test -f config.arch; then
22756 echo "I see a config.arch file, loading it." >&4
22760 : configuration may be patched via a 'config.over' file
22761 if $test -f config.over; then
22764 rp='I see a config.over file. Do you wish to load it?'
22767 n*) echo "OK, I'll ignore it.";;
22769 echo "Configuration override changes have been loaded."
22774 : in case they want portability, strip down executable paths
22775 case "$d_portable" in
22778 echo "Stripping down executable paths..." >&4
22779 for file in $loclist $trylist; do
22781 eval $file=`basename $temp`
22786 : create config.sh file
22788 echo "Creating config.sh..." >&4
22789 $spitshell <<EOT >config.sh
22792 # This file was produced by running the Configure script. It holds all the
22793 # definitions figured out by Configure. Should you modify one of these values,
22794 # do not forget to propagate your changes by running "Configure -der". You may
22795 # instead choose to run each of the .SH files by yourself, or "Configure -S".
22798 # Package name : $package
22799 # Source directory : $src
22800 # Configuration time: $cf_time
22801 # Configured by : $cf_by
22802 # Target system : $myuname
22805 : Add in command line options if available
22806 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
22808 $spitshell <<EOT >>config.sh
22817 Revision='$Revision'
22825 alignbytes='$alignbytes'
22826 ansi2knr='$ansi2knr'
22827 aphostname='$aphostname'
22828 api_revision='$api_revision'
22829 api_subversion='$api_subversion'
22830 api_version='$api_version'
22831 api_versionstring='$api_versionstring'
22834 archlibexp='$archlibexp'
22835 archname64='$archname64'
22836 archname='$archname'
22837 archobjs='$archobjs'
22838 asctime_r_proto='$asctime_r_proto'
22847 byteorder='$byteorder'
22849 castflags='$castflags'
22852 cccdlflags='$cccdlflags'
22853 ccdlflags='$ccdlflags'
22855 ccflags_uselargefiles='$ccflags_uselargefiles'
22857 ccsymbols='$ccsymbols'
22858 ccversion='$ccversion'
22860 cf_email='$cf_email'
22862 charbits='$charbits'
22863 charsize='$charsize'
22867 clocktype='$clocktype'
22869 compress='$compress'
22870 contains='$contains'
22874 cpp_stuff='$cpp_stuff'
22875 cppccsymbols='$cppccsymbols'
22876 cppflags='$cppflags'
22878 cppminus='$cppminus'
22880 cppstdin='$cppstdin'
22881 cppsymbols='$cppsymbols'
22882 crypt_r_proto='$crypt_r_proto'
22883 cryptlib='$cryptlib'
22885 ctermid_r_proto='$ctermid_r_proto'
22886 ctime_r_proto='$ctime_r_proto'
22887 d_Gconvert='$d_Gconvert'
22888 d_PRIEUldbl='$d_PRIEUldbl'
22889 d_PRIFUldbl='$d_PRIFUldbl'
22890 d_PRIGUldbl='$d_PRIGUldbl'
22891 d_PRIXU64='$d_PRIXU64'
22892 d_PRId64='$d_PRId64'
22893 d_PRIeldbl='$d_PRIeldbl'
22894 d_PRIfldbl='$d_PRIfldbl'
22895 d_PRIgldbl='$d_PRIgldbl'
22896 d_PRIi64='$d_PRIi64'
22897 d_PRIo64='$d_PRIo64'
22898 d_PRIu64='$d_PRIu64'
22899 d_PRIx64='$d_PRIx64'
22900 d_SCNfldbl='$d_SCNfldbl'
22901 d__fwalk='$d__fwalk'
22902 d_access='$d_access'
22903 d_accessx='$d_accessx'
22906 d_archlib='$d_archlib'
22907 d_asctime64='$d_asctime64'
22908 d_asctime_r='$d_asctime_r'
22911 d_attribute_deprecated='$d_attribute_deprecated'
22912 d_attribute_format='$d_attribute_format'
22913 d_attribute_malloc='$d_attribute_malloc'
22914 d_attribute_nonnull='$d_attribute_nonnull'
22915 d_attribute_noreturn='$d_attribute_noreturn'
22916 d_attribute_pure='$d_attribute_pure'
22917 d_attribute_unused='$d_attribute_unused'
22918 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
22922 d_bsdgetpgrp='$d_bsdgetpgrp'
22923 d_bsdsetpgrp='$d_bsdsetpgrp'
22924 d_builtin_choose_expr='$d_builtin_choose_expr'
22925 d_builtin_expect='$d_builtin_expect'
22927 d_c99_variadic_macros='$d_c99_variadic_macros'
22928 d_casti32='$d_casti32'
22929 d_castneg='$d_castneg'
22930 d_charvspr='$d_charvspr'
22932 d_chroot='$d_chroot'
22933 d_chsize='$d_chsize'
22935 d_clearenv='$d_clearenv'
22936 d_closedir='$d_closedir'
22937 d_cmsghdr_s='$d_cmsghdr_s'
22939 d_copysignl='$d_copysignl'
22940 d_cplusplus='$d_cplusplus'
22942 d_crypt_r='$d_crypt_r'
22944 d_ctermid='$d_ctermid'
22945 d_ctermid_r='$d_ctermid_r'
22946 d_ctime64='$d_ctime64'
22947 d_ctime_r='$d_ctime_r'
22948 d_cuserid='$d_cuserid'
22949 d_dbl_dig='$d_dbl_dig'
22950 d_dbminitproto='$d_dbminitproto'
22951 d_difftime64='$d_difftime64'
22952 d_difftime='$d_difftime'
22953 d_dir_dd_fd='$d_dir_dd_fd'
22955 d_dirnamlen='$d_dirnamlen'
22956 d_dlerror='$d_dlerror'
22957 d_dlopen='$d_dlopen'
22958 d_dlsymun='$d_dlsymun'
22959 d_dosuid='$d_dosuid'
22960 d_drand48_r='$d_drand48_r'
22961 d_drand48proto='$d_drand48proto'
22963 d_eaccess='$d_eaccess'
22964 d_endgrent='$d_endgrent'
22965 d_endgrent_r='$d_endgrent_r'
22966 d_endhent='$d_endhent'
22967 d_endhostent_r='$d_endhostent_r'
22968 d_endnent='$d_endnent'
22969 d_endnetent_r='$d_endnetent_r'
22970 d_endpent='$d_endpent'
22971 d_endprotoent_r='$d_endprotoent_r'
22972 d_endpwent='$d_endpwent'
22973 d_endpwent_r='$d_endpwent_r'
22974 d_endsent='$d_endsent'
22975 d_endservent_r='$d_endservent_r'
22976 d_eofnblk='$d_eofnblk'
22977 d_eunice='$d_eunice'
22978 d_faststdio='$d_faststdio'
22979 d_fchdir='$d_fchdir'
22980 d_fchmod='$d_fchmod'
22981 d_fchown='$d_fchown'
22983 d_fcntl_can_lock='$d_fcntl_can_lock'
22984 d_fd_macros='$d_fd_macros'
22985 d_fd_set='$d_fd_set'
22986 d_fds_bits='$d_fds_bits'
22987 d_fgetpos='$d_fgetpos'
22988 d_finite='$d_finite'
22989 d_finitel='$d_finitel'
22990 d_flexfnam='$d_flexfnam'
22992 d_flockproto='$d_flockproto'
22994 d_fp_class='$d_fp_class'
22995 d_fpathconf='$d_fpathconf'
22996 d_fpclass='$d_fpclass'
22997 d_fpclassify='$d_fpclassify'
22998 d_fpclassl='$d_fpclassl'
22999 d_fpos64_t='$d_fpos64_t'
23000 d_frexpl='$d_frexpl'
23001 d_fs_data_s='$d_fs_data_s'
23002 d_fseeko='$d_fseeko'
23003 d_fsetpos='$d_fsetpos'
23004 d_fstatfs='$d_fstatfs'
23005 d_fstatvfs='$d_fstatvfs'
23007 d_ftello='$d_ftello'
23009 d_futimes='$d_futimes'
23010 d_gdbm_ndbm_h_uses_prototypes='$d_gdbm_ndbm_h_uses_prototypes'
23011 d_gdbmndbm_h_uses_prototypes='$d_gdbmndbm_h_uses_prototypes'
23012 d_getaddrinfo='$d_getaddrinfo'
23013 d_getcwd='$d_getcwd'
23014 d_getespwnam='$d_getespwnam'
23015 d_getfsstat='$d_getfsstat'
23016 d_getgrent='$d_getgrent'
23017 d_getgrent_r='$d_getgrent_r'
23018 d_getgrgid_r='$d_getgrgid_r'
23019 d_getgrnam_r='$d_getgrnam_r'
23020 d_getgrps='$d_getgrps'
23021 d_gethbyaddr='$d_gethbyaddr'
23022 d_gethbyname='$d_gethbyname'
23023 d_gethent='$d_gethent'
23024 d_gethname='$d_gethname'
23025 d_gethostbyaddr_r='$d_gethostbyaddr_r'
23026 d_gethostbyname_r='$d_gethostbyname_r'
23027 d_gethostent_r='$d_gethostent_r'
23028 d_gethostprotos='$d_gethostprotos'
23029 d_getitimer='$d_getitimer'
23030 d_getlogin='$d_getlogin'
23031 d_getlogin_r='$d_getlogin_r'
23032 d_getmnt='$d_getmnt'
23033 d_getmntent='$d_getmntent'
23034 d_getnameinfo='$d_getnameinfo'
23035 d_getnbyaddr='$d_getnbyaddr'
23036 d_getnbyname='$d_getnbyname'
23037 d_getnent='$d_getnent'
23038 d_getnetbyaddr_r='$d_getnetbyaddr_r'
23039 d_getnetbyname_r='$d_getnetbyname_r'
23040 d_getnetent_r='$d_getnetent_r'
23041 d_getnetprotos='$d_getnetprotos'
23042 d_getpagsz='$d_getpagsz'
23043 d_getpbyname='$d_getpbyname'
23044 d_getpbynumber='$d_getpbynumber'
23045 d_getpent='$d_getpent'
23046 d_getpgid='$d_getpgid'
23047 d_getpgrp2='$d_getpgrp2'
23048 d_getpgrp='$d_getpgrp'
23049 d_getppid='$d_getppid'
23050 d_getprior='$d_getprior'
23051 d_getprotobyname_r='$d_getprotobyname_r'
23052 d_getprotobynumber_r='$d_getprotobynumber_r'
23053 d_getprotoent_r='$d_getprotoent_r'
23054 d_getprotoprotos='$d_getprotoprotos'
23055 d_getprpwnam='$d_getprpwnam'
23056 d_getpwent='$d_getpwent'
23057 d_getpwent_r='$d_getpwent_r'
23058 d_getpwnam_r='$d_getpwnam_r'
23059 d_getpwuid_r='$d_getpwuid_r'
23060 d_getsbyname='$d_getsbyname'
23061 d_getsbyport='$d_getsbyport'
23062 d_getsent='$d_getsent'
23063 d_getservbyname_r='$d_getservbyname_r'
23064 d_getservbyport_r='$d_getservbyport_r'
23065 d_getservent_r='$d_getservent_r'
23066 d_getservprotos='$d_getservprotos'
23067 d_getspnam='$d_getspnam'
23068 d_getspnam_r='$d_getspnam_r'
23069 d_gettimeod='$d_gettimeod'
23070 d_gmtime64='$d_gmtime64'
23071 d_gmtime_r='$d_gmtime_r'
23072 d_gnulibc='$d_gnulibc'
23073 d_grpasswd='$d_grpasswd'
23074 d_hasmntopt='$d_hasmntopt'
23076 d_ilogbl='$d_ilogbl'
23077 d_inc_version_list='$d_inc_version_list'
23079 d_inetaton='$d_inetaton'
23080 d_inetntop='$d_inetntop'
23081 d_inetpton='$d_inetpton'
23082 d_int64_t='$d_int64_t'
23083 d_ip_mreq='$d_ip_mreq'
23084 d_ip_mreq_source='$d_ip_mreq_source'
23085 d_ipv6_mreq='$d_ipv6_mreq'
23086 d_ipv6_mreq_source='$d_ipv6_mreq_source'
23087 d_isascii='$d_isascii'
23088 d_isblank='$d_isblank'
23089 d_isfinite='$d_isfinite'
23092 d_isnanl='$d_isnanl'
23093 d_killpg='$d_killpg'
23094 d_lchown='$d_lchown'
23095 d_ldbl_dig='$d_ldbl_dig'
23096 d_libm_lib_version='$d_libm_lib_version'
23098 d_localtime64='$d_localtime64'
23099 d_localtime_r='$d_localtime_r'
23100 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
23101 d_locconv='$d_locconv'
23103 d_longdbl='$d_longdbl'
23104 d_longlong='$d_longlong'
23105 d_lseekproto='$d_lseekproto'
23107 d_madvise='$d_madvise'
23108 d_malloc_good_size='$d_malloc_good_size'
23109 d_malloc_size='$d_malloc_size'
23111 d_mbstowcs='$d_mbstowcs'
23112 d_mbtowc='$d_mbtowc'
23113 d_memchr='$d_memchr'
23114 d_memcmp='$d_memcmp'
23115 d_memcpy='$d_memcpy'
23116 d_memmove='$d_memmove'
23117 d_memset='$d_memset'
23119 d_mkdtemp='$d_mkdtemp'
23120 d_mkfifo='$d_mkfifo'
23121 d_mkstemp='$d_mkstemp'
23122 d_mkstemps='$d_mkstemps'
23123 d_mktime64='$d_mktime64'
23124 d_mktime='$d_mktime'
23127 d_modfl_pow32_bug='$d_modfl_pow32_bug'
23128 d_modflproto='$d_modflproto'
23129 d_mprotect='$d_mprotect'
23131 d_msg_ctrunc='$d_msg_ctrunc'
23132 d_msg_dontroute='$d_msg_dontroute'
23133 d_msg_oob='$d_msg_oob'
23134 d_msg_peek='$d_msg_peek'
23135 d_msg_proxy='$d_msg_proxy'
23136 d_msgctl='$d_msgctl'
23137 d_msgget='$d_msgget'
23138 d_msghdr_s='$d_msghdr_s'
23139 d_msgrcv='$d_msgrcv'
23140 d_msgsnd='$d_msgsnd'
23142 d_munmap='$d_munmap'
23143 d_mymalloc='$d_mymalloc'
23145 d_ndbm_h_uses_prototypes='$d_ndbm_h_uses_prototypes'
23147 d_nl_langinfo='$d_nl_langinfo'
23148 d_nv_preserves_uv='$d_nv_preserves_uv'
23149 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
23150 d_off64_t='$d_off64_t'
23151 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
23152 d_oldpthreads='$d_oldpthreads'
23153 d_oldsock='$d_oldsock'
23155 d_pathconf='$d_pathconf'
23157 d_perl_otherlibdirs='$d_perl_otherlibdirs'
23158 d_phostname='$d_phostname'
23161 d_portable='$d_portable'
23163 d_prctl_set_name='$d_prctl_set_name'
23164 d_printf_format_null='$d_printf_format_null'
23165 d_procselfexe='$d_procselfexe'
23166 d_pseudofork='$d_pseudofork'
23167 d_pthread_atfork='$d_pthread_atfork'
23168 d_pthread_attr_setscope='$d_pthread_attr_setscope'
23169 d_pthread_yield='$d_pthread_yield'
23171 d_pwchange='$d_pwchange'
23172 d_pwclass='$d_pwclass'
23173 d_pwcomment='$d_pwcomment'
23174 d_pwexpire='$d_pwexpire'
23175 d_pwgecos='$d_pwgecos'
23176 d_pwpasswd='$d_pwpasswd'
23177 d_pwquota='$d_pwquota'
23180 d_random_r='$d_random_r'
23181 d_readdir64_r='$d_readdir64_r'
23182 d_readdir='$d_readdir'
23183 d_readdir_r='$d_readdir_r'
23184 d_readlink='$d_readlink'
23186 d_recvmsg='$d_recvmsg'
23187 d_rename='$d_rename'
23188 d_rewinddir='$d_rewinddir'
23190 d_safebcpy='$d_safebcpy'
23191 d_safemcpy='$d_safemcpy'
23192 d_sanemcmp='$d_sanemcmp'
23193 d_sbrkproto='$d_sbrkproto'
23194 d_scalbnl='$d_scalbnl'
23195 d_sched_yield='$d_sched_yield'
23196 d_scm_rights='$d_scm_rights'
23197 d_seekdir='$d_seekdir'
23198 d_select='$d_select'
23200 d_semctl='$d_semctl'
23201 d_semctl_semid_ds='$d_semctl_semid_ds'
23202 d_semctl_semun='$d_semctl_semun'
23203 d_semget='$d_semget'
23205 d_sendmsg='$d_sendmsg'
23206 d_setegid='$d_setegid'
23207 d_seteuid='$d_seteuid'
23208 d_setgrent='$d_setgrent'
23209 d_setgrent_r='$d_setgrent_r'
23210 d_setgrps='$d_setgrps'
23211 d_sethent='$d_sethent'
23212 d_sethostent_r='$d_sethostent_r'
23213 d_setitimer='$d_setitimer'
23214 d_setlinebuf='$d_setlinebuf'
23215 d_setlocale='$d_setlocale'
23216 d_setlocale_r='$d_setlocale_r'
23217 d_setnent='$d_setnent'
23218 d_setnetent_r='$d_setnetent_r'
23219 d_setpent='$d_setpent'
23220 d_setpgid='$d_setpgid'
23221 d_setpgrp2='$d_setpgrp2'
23222 d_setpgrp='$d_setpgrp'
23223 d_setprior='$d_setprior'
23224 d_setproctitle='$d_setproctitle'
23225 d_setprotoent_r='$d_setprotoent_r'
23226 d_setpwent='$d_setpwent'
23227 d_setpwent_r='$d_setpwent_r'
23228 d_setregid='$d_setregid'
23229 d_setresgid='$d_setresgid'
23230 d_setresuid='$d_setresuid'
23231 d_setreuid='$d_setreuid'
23232 d_setrgid='$d_setrgid'
23233 d_setruid='$d_setruid'
23234 d_setsent='$d_setsent'
23235 d_setservent_r='$d_setservent_r'
23236 d_setsid='$d_setsid'
23237 d_setvbuf='$d_setvbuf'
23241 d_shmatprototype='$d_shmatprototype'
23242 d_shmctl='$d_shmctl'
23244 d_shmget='$d_shmget'
23245 d_sigaction='$d_sigaction'
23246 d_signbit='$d_signbit'
23247 d_sigprocmask='$d_sigprocmask'
23248 d_sigsetjmp='$d_sigsetjmp'
23249 d_sin6_scope_id='$d_sin6_scope_id'
23250 d_sitearch='$d_sitearch'
23251 d_snprintf='$d_snprintf'
23252 d_sockaddr_in6='$d_sockaddr_in6'
23253 d_sockaddr_sa_len='$d_sockaddr_sa_len'
23254 d_sockatmark='$d_sockatmark'
23255 d_sockatmarkproto='$d_sockatmarkproto'
23256 d_socket='$d_socket'
23257 d_socklen_t='$d_socklen_t'
23258 d_sockpair='$d_sockpair'
23259 d_socks5_init='$d_socks5_init'
23260 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
23262 d_srand48_r='$d_srand48_r'
23263 d_srandom_r='$d_srandom_r'
23264 d_sresgproto='$d_sresgproto'
23265 d_sresuproto='$d_sresuproto'
23266 d_statblks='$d_statblks'
23267 d_statfs_f_flags='$d_statfs_f_flags'
23268 d_statfs_s='$d_statfs_s'
23269 d_static_inline='$d_static_inline'
23270 d_statvfs='$d_statvfs'
23271 d_stdio_cnt_lval='$d_stdio_cnt_lval'
23272 d_stdio_ptr_lval='$d_stdio_ptr_lval'
23273 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
23274 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
23275 d_stdio_stream_array='$d_stdio_stream_array'
23276 d_stdiobase='$d_stdiobase'
23277 d_stdstdio='$d_stdstdio'
23278 d_strchr='$d_strchr'
23279 d_strcoll='$d_strcoll'
23280 d_strctcpy='$d_strctcpy'
23281 d_strerrm='$d_strerrm'
23282 d_strerror='$d_strerror'
23283 d_strerror_r='$d_strerror_r'
23284 d_strftime='$d_strftime'
23285 d_strlcat='$d_strlcat'
23286 d_strlcpy='$d_strlcpy'
23287 d_strtod='$d_strtod'
23288 d_strtol='$d_strtol'
23289 d_strtold='$d_strtold'
23290 d_strtoll='$d_strtoll'
23291 d_strtoq='$d_strtoq'
23292 d_strtoul='$d_strtoul'
23293 d_strtoull='$d_strtoull'
23294 d_strtouq='$d_strtouq'
23295 d_strxfrm='$d_strxfrm'
23296 d_suidsafe='$d_suidsafe'
23297 d_symlink='$d_symlink'
23298 d_syscall='$d_syscall'
23299 d_syscallproto='$d_syscallproto'
23300 d_sysconf='$d_sysconf'
23301 d_sysernlst='$d_sysernlst'
23302 d_syserrlst='$d_syserrlst'
23303 d_system='$d_system'
23304 d_tcgetpgrp='$d_tcgetpgrp'
23305 d_tcsetpgrp='$d_tcsetpgrp'
23306 d_telldir='$d_telldir'
23307 d_telldirproto='$d_telldirproto'
23309 d_timegm='$d_timegm'
23311 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
23312 d_tm_tm_zone='$d_tm_tm_zone'
23313 d_tmpnam_r='$d_tmpnam_r'
23314 d_truncate='$d_truncate'
23315 d_ttyname_r='$d_ttyname_r'
23316 d_tzname='$d_tzname'
23317 d_u32align='$d_u32align'
23318 d_ualarm='$d_ualarm'
23321 d_union_semun='$d_union_semun'
23322 d_unordered='$d_unordered'
23323 d_unsetenv='$d_unsetenv'
23324 d_usleep='$d_usleep'
23325 d_usleepproto='$d_usleepproto'
23327 d_vendorarch='$d_vendorarch'
23328 d_vendorbin='$d_vendorbin'
23329 d_vendorlib='$d_vendorlib'
23330 d_vendorscript='$d_vendorscript'
23332 d_void_closedir='$d_void_closedir'
23333 d_voidsig='$d_voidsig'
23334 d_voidtty='$d_voidtty'
23335 d_volatile='$d_volatile'
23336 d_vprintf='$d_vprintf'
23337 d_vsnprintf='$d_vsnprintf'
23339 d_waitpid='$d_waitpid'
23340 d_wcstombs='$d_wcstombs'
23341 d_wctomb='$d_wctomb'
23342 d_writev='$d_writev'
23345 db_hashtype='$db_hashtype'
23346 db_prefixtype='$db_prefixtype'
23347 db_version_major='$db_version_major'
23348 db_version_minor='$db_version_minor'
23349 db_version_patch='$db_version_patch'
23350 defvoidused='$defvoidused'
23351 direntrytype='$direntrytype'
23354 doublesize='$doublesize'
23356 drand48_r_proto='$drand48_r_proto'
23358 dynamic_ext='$dynamic_ext'
23364 endgrent_r_proto='$endgrent_r_proto'
23365 endhostent_r_proto='$endhostent_r_proto'
23366 endnetent_r_proto='$endnetent_r_proto'
23367 endprotoent_r_proto='$endprotoent_r_proto'
23368 endpwent_r_proto='$endpwent_r_proto'
23369 endservent_r_proto='$endservent_r_proto'
23370 eunicefix='$eunicefix'
23373 extensions='$extensions'
23374 extern_C='$extern_C'
23376 fflushNULL='$fflushNULL'
23377 fflushall='$fflushall'
23379 firstmakefile='$firstmakefile'
23381 fpossize='$fpossize'
23382 fpostype='$fpostype'
23383 freetype='$freetype'
23386 full_csh='$full_csh'
23387 full_sed='$full_sed'
23388 gccansipedantic='$gccansipedantic'
23389 gccosandvers='$gccosandvers'
23390 gccversion='$gccversion'
23391 getgrent_r_proto='$getgrent_r_proto'
23392 getgrgid_r_proto='$getgrgid_r_proto'
23393 getgrnam_r_proto='$getgrnam_r_proto'
23394 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
23395 gethostbyname_r_proto='$gethostbyname_r_proto'
23396 gethostent_r_proto='$gethostent_r_proto'
23397 getlogin_r_proto='$getlogin_r_proto'
23398 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
23399 getnetbyname_r_proto='$getnetbyname_r_proto'
23400 getnetent_r_proto='$getnetent_r_proto'
23401 getprotobyname_r_proto='$getprotobyname_r_proto'
23402 getprotobynumber_r_proto='$getprotobynumber_r_proto'
23403 getprotoent_r_proto='$getprotoent_r_proto'
23404 getpwent_r_proto='$getpwent_r_proto'
23405 getpwnam_r_proto='$getpwnam_r_proto'
23406 getpwuid_r_proto='$getpwuid_r_proto'
23407 getservbyname_r_proto='$getservbyname_r_proto'
23408 getservbyport_r_proto='$getservbyport_r_proto'
23409 getservent_r_proto='$getservent_r_proto'
23410 getspnam_r_proto='$getspnam_r_proto'
23411 gidformat='$gidformat'
23417 gmtime_r_proto='$gmtime_r_proto'
23418 gnulibc_version='$gnulibc_version'
23420 groupcat='$groupcat'
23421 groupstype='$groupstype'
23424 h_sysfile='$h_sysfile'
23427 html1dir='$html1dir'
23428 html1direxp='$html1direxp'
23429 html3dir='$html3dir'
23430 html3direxp='$html3direxp'
23439 i_arpainet='$i_arpainet'
23440 i_assert='$i_assert'
23441 i_bsdioctl='$i_bsdioctl'
23445 i_dirent='$i_dirent'
23451 i_fp_class='$i_fp_class'
23453 i_gdbm_ndbm='$i_gdbm_ndbm'
23454 i_gdbmndbm='$i_gdbmndbm'
23456 i_ieeefp='$i_ieeefp'
23457 i_inttypes='$i_inttypes'
23458 i_langinfo='$i_langinfo'
23459 i_libutil='$i_libutil'
23460 i_limits='$i_limits'
23461 i_locale='$i_locale'
23462 i_machcthr='$i_machcthr'
23463 i_malloc='$i_malloc'
23464 i_mallocmalloc='$i_mallocmalloc'
23466 i_memory='$i_memory'
23467 i_mntent='$i_mntent'
23470 i_neterrno='$i_neterrno'
23471 i_netinettcp='$i_netinettcp'
23475 i_pthread='$i_pthread'
23477 i_rpcsvcdbm='$i_rpcsvcdbm'
23480 i_shadow='$i_shadow'
23482 i_stdarg='$i_stdarg'
23483 i_stdbool='$i_stdbool'
23484 i_stddef='$i_stddef'
23485 i_stdlib='$i_stdlib'
23486 i_string='$i_string'
23487 i_sunmath='$i_sunmath'
23488 i_sysaccess='$i_sysaccess'
23489 i_sysdir='$i_sysdir'
23490 i_sysfile='$i_sysfile'
23491 i_sysfilio='$i_sysfilio'
23493 i_sysioctl='$i_sysioctl'
23494 i_syslog='$i_syslog'
23495 i_sysmman='$i_sysmman'
23496 i_sysmode='$i_sysmode'
23497 i_sysmount='$i_sysmount'
23498 i_sysndir='$i_sysndir'
23499 i_sysparam='$i_sysparam'
23500 i_syspoll='$i_syspoll'
23501 i_sysresrc='$i_sysresrc'
23502 i_syssecrt='$i_syssecrt'
23503 i_sysselct='$i_sysselct'
23504 i_syssockio='$i_syssockio'
23505 i_sysstat='$i_sysstat'
23506 i_sysstatfs='$i_sysstatfs'
23507 i_sysstatvfs='$i_sysstatvfs'
23508 i_systime='$i_systime'
23509 i_systimek='$i_systimek'
23510 i_systimes='$i_systimes'
23511 i_systypes='$i_systypes'
23512 i_sysuio='$i_sysuio'
23514 i_sysutsname='$i_sysutsname'
23515 i_sysvfs='$i_sysvfs'
23516 i_syswait='$i_syswait'
23517 i_termio='$i_termio'
23518 i_termios='$i_termios'
23520 i_unistd='$i_unistd'
23523 i_values='$i_values'
23524 i_varargs='$i_varargs'
23525 i_varhdr='$i_varhdr'
23527 ignore_versioned_solibs='$ignore_versioned_solibs'
23528 inc_version_list='$inc_version_list'
23529 inc_version_list_init='$inc_version_list_init'
23532 initialinstalllocation='$initialinstalllocation'
23533 installarchlib='$installarchlib'
23534 installbin='$installbin'
23535 installhtml1dir='$installhtml1dir'
23536 installhtml3dir='$installhtml3dir'
23537 installman1dir='$installman1dir'
23538 installman3dir='$installman3dir'
23539 installprefix='$installprefix'
23540 installprefixexp='$installprefixexp'
23541 installprivlib='$installprivlib'
23542 installscript='$installscript'
23543 installsitearch='$installsitearch'
23544 installsitebin='$installsitebin'
23545 installsitehtml1dir='$installsitehtml1dir'
23546 installsitehtml3dir='$installsitehtml3dir'
23547 installsitelib='$installsitelib'
23548 installsiteman1dir='$installsiteman1dir'
23549 installsiteman3dir='$installsiteman3dir'
23550 installsitescript='$installsitescript'
23551 installstyle='$installstyle'
23552 installusrbinperl='$installusrbinperl'
23553 installvendorarch='$installvendorarch'
23554 installvendorbin='$installvendorbin'
23555 installvendorhtml1dir='$installvendorhtml1dir'
23556 installvendorhtml3dir='$installvendorhtml3dir'
23557 installvendorlib='$installvendorlib'
23558 installvendorman1dir='$installvendorman1dir'
23559 installvendorman3dir='$installvendorman3dir'
23560 installvendorscript='$installvendorscript'
23562 issymlink='$issymlink'
23563 ivdformat='$ivdformat'
23566 known_extensions='$known_extensions'
23569 ld_can_script='$ld_can_script'
23570 lddlflags='$lddlflags'
23572 ldflags_uselargefiles='$ldflags_uselargefiles'
23573 ldlibpthname='$ldlibpthname'
23580 libsdirs='$libsdirs'
23581 libsfiles='$libsfiles'
23582 libsfound='$libsfound'
23583 libspath='$libspath'
23584 libswanted='$libswanted'
23585 libswanted_uselargefiles='$libswanted_uselargefiles'
23591 localtime_r_proto='$localtime_r_proto'
23592 locincpth='$locincpth'
23593 loclibpth='$loclibpth'
23594 longdblsize='$longdblsize'
23595 longlongsize='$longlongsize'
23596 longsize='$longsize'
23600 lseeksize='$lseeksize'
23601 lseektype='$lseektype'
23604 madlyobj='$madlyobj'
23605 madlysrc='$madlysrc'
23609 make_set_make='$make_set_make'
23610 mallocobj='$mallocobj'
23611 mallocsrc='$mallocsrc'
23612 malloctype='$malloctype'
23614 man1direxp='$man1direxp'
23617 man3direxp='$man3direxp'
23619 mips_type='$mips_type'
23620 mistrustnm='$mistrustnm'
23622 mmaptype='$mmaptype'
23623 modetype='$modetype'
23625 multiarch='$multiarch'
23627 myarchname='$myarchname'
23628 mydomain='$mydomain'
23629 myhostname='$myhostname'
23632 need_va_copy='$need_va_copy'
23633 netdb_hlen_type='$netdb_hlen_type'
23634 netdb_host_type='$netdb_host_type'
23635 netdb_name_type='$netdb_name_type'
23636 netdb_net_type='$netdb_net_type'
23639 nm_so_opt='$nm_so_opt'
23640 nonxs_ext='$nonxs_ext'
23642 nvEUformat='$nvEUformat'
23643 nvFUformat='$nvFUformat'
23644 nvGUformat='$nvGUformat'
23645 nv_overflows_integers_at='$nv_overflows_integers_at'
23646 nv_preserves_uv_bits='$nv_preserves_uv_bits'
23647 nveformat='$nveformat'
23648 nvfformat='$nvfformat'
23649 nvgformat='$nvgformat'
23652 o_nonblock='$o_nonblock'
23654 old_pthread_create_joinable='$old_pthread_create_joinable'
23655 optimize='$optimize'
23656 orderlib='$orderlib'
23659 otherlibdirs='$otherlibdirs'
23663 patchlevel='$patchlevel'
23664 path_sep='$path_sep'
23667 perl_patchlevel='$perl_patchlevel'
23668 perl_static_inline='$perl_static_inline'
23669 perladmin='$perladmin'
23670 perllibs='$perllibs'
23671 perlpath='$perlpath'
23673 phostname='$phostname'
23679 prefixexp='$prefixexp'
23681 privlibexp='$privlibexp'
23682 procselfexe='$procselfexe'
23683 prototype='$prototype'
23685 quadkind='$quadkind'
23686 quadtype='$quadtype'
23687 randbits='$randbits'
23688 randfunc='$randfunc'
23689 random_r_proto='$random_r_proto'
23690 randseedtype='$randseedtype'
23692 rd_nodata='$rd_nodata'
23693 readdir64_r_proto='$readdir64_r_proto'
23694 readdir_r_proto='$readdir_r_proto'
23695 revision='$revision'
23701 sGMTIME_max='$sGMTIME_max'
23702 sGMTIME_min='$sGMTIME_min'
23703 sLOCALTIME_max='$sLOCALTIME_max'
23704 sLOCALTIME_min='$sLOCALTIME_min'
23705 sPRIEUldbl='$sPRIEUldbl'
23706 sPRIFUldbl='$sPRIFUldbl'
23707 sPRIGUldbl='$sPRIGUldbl'
23708 sPRIXU64='$sPRIXU64'
23710 sPRIeldbl='$sPRIeldbl'
23711 sPRIfldbl='$sPRIfldbl'
23712 sPRIgldbl='$sPRIgldbl'
23717 sSCNfldbl='$sSCNfldbl'
23718 sched_yield='$sched_yield'
23719 scriptdir='$scriptdir'
23720 scriptdirexp='$scriptdirexp'
23722 seedfunc='$seedfunc'
23723 selectminbits='$selectminbits'
23724 selecttype='$selecttype'
23725 sendmail='$sendmail'
23726 setgrent_r_proto='$setgrent_r_proto'
23727 sethostent_r_proto='$sethostent_r_proto'
23728 setlocale_r_proto='$setlocale_r_proto'
23729 setnetent_r_proto='$setnetent_r_proto'
23730 setprotoent_r_proto='$setprotoent_r_proto'
23731 setpwent_r_proto='$setpwent_r_proto'
23732 setservent_r_proto='$setservent_r_proto'
23735 sharpbang='$sharpbang'
23736 shmattype='$shmattype'
23737 shortsize='$shortsize'
23740 sig_count='$sig_count'
23741 sig_name='$sig_name'
23742 sig_name_init='$sig_name_init'
23744 sig_num_init='$sig_num_init'
23745 sig_size='$sig_size'
23746 signal_t='$signal_t'
23747 sitearch='$sitearch'
23748 sitearchexp='$sitearchexp'
23750 sitebinexp='$sitebinexp'
23751 sitehtml1dir='$sitehtml1dir'
23752 sitehtml1direxp='$sitehtml1direxp'
23753 sitehtml3dir='$sitehtml3dir'
23754 sitehtml3direxp='$sitehtml3direxp'
23756 sitelib_stem='$sitelib_stem'
23757 sitelibexp='$sitelibexp'
23758 siteman1dir='$siteman1dir'
23759 siteman1direxp='$siteman1direxp'
23760 siteman3dir='$siteman3dir'
23761 siteman3direxp='$siteman3direxp'
23762 siteprefix='$siteprefix'
23763 siteprefixexp='$siteprefixexp'
23764 sitescript='$sitescript'
23765 sitescriptexp='$sitescriptexp'
23766 sizesize='$sizesize'
23767 sizetype='$sizetype'
23771 sockethdr='$sockethdr'
23772 socketlib='$socketlib'
23773 socksizetype='$socksizetype'
23775 spackage='$spackage'
23776 spitshell='$spitshell'
23777 srand48_r_proto='$srand48_r_proto'
23778 srandom_r_proto='$srandom_r_proto'
23780 ssizetype='$ssizetype'
23781 st_ino_sign='$st_ino_sign'
23782 st_ino_size='$st_ino_size'
23783 startperl='$startperl'
23785 static_ext='$static_ext'
23787 stdio_base='$stdio_base'
23788 stdio_bufsiz='$stdio_bufsiz'
23789 stdio_cnt='$stdio_cnt'
23790 stdio_filbuf='$stdio_filbuf'
23791 stdio_ptr='$stdio_ptr'
23792 stdio_stream_array='$stdio_stream_array'
23793 strerror_r_proto='$strerror_r_proto'
23796 subversion='$subversion'
23800 targetarch='$targetarch'
23804 timeincl='$timeincl'
23805 timetype='$timetype'
23806 tmpnam_r_proto='$tmpnam_r_proto'
23812 ttyname_r_proto='$ttyname_r_proto'
23821 uidformat='$uidformat'
23827 uquadtype='$uquadtype'
23828 use5005threads='$use5005threads'
23829 use64bitall='$use64bitall'
23830 use64bitint='$use64bitint'
23831 usecrosscompile='$usecrosscompile'
23832 usedevel='$usedevel'
23834 usedtrace='$usedtrace'
23835 usefaststdio='$usefaststdio'
23836 useithreads='$useithreads'
23837 usekernprocpathname='$usekernprocpathname'
23838 uselargefiles='$uselargefiles'
23839 uselongdouble='$uselongdouble'
23840 usemallocwrap='$usemallocwrap'
23841 usemorebits='$usemorebits'
23842 usemultiplicity='$usemultiplicity'
23843 usemymalloc='$usemymalloc'
23845 usensgetexecutablepath='$usensgetexecutablepath'
23846 useopcode='$useopcode'
23847 useperlio='$useperlio'
23848 useposix='$useposix'
23849 usereentrant='$usereentrant'
23850 userelocatableinc='$userelocatableinc'
23852 useshrplib='$useshrplib'
23853 usesitecustomize='$usesitecustomize'
23854 usesocks='$usesocks'
23855 usethreads='$usethreads'
23856 usevendorprefix='$usevendorprefix'
23857 usevfork='$usevfork'
23860 uvXUformat='$uvXUformat'
23861 uvoformat='$uvoformat'
23864 uvuformat='$uvuformat'
23865 uvxformat='$uvxformat'
23867 vendorarch='$vendorarch'
23868 vendorarchexp='$vendorarchexp'
23869 vendorbin='$vendorbin'
23870 vendorbinexp='$vendorbinexp'
23871 vendorhtml1dir='$vendorhtml1dir'
23872 vendorhtml1direxp='$vendorhtml1direxp'
23873 vendorhtml3dir='$vendorhtml3dir'
23874 vendorhtml3direxp='$vendorhtml3direxp'
23875 vendorlib='$vendorlib'
23876 vendorlib_stem='$vendorlib_stem'
23877 vendorlibexp='$vendorlibexp'
23878 vendorman1dir='$vendorman1dir'
23879 vendorman1direxp='$vendorman1direxp'
23880 vendorman3dir='$vendorman3dir'
23881 vendorman3direxp='$vendorman3direxp'
23882 vendorprefix='$vendorprefix'
23883 vendorprefixexp='$vendorprefixexp'
23884 vendorscript='$vendorscript'
23885 vendorscriptexp='$vendorscriptexp'
23887 version_patchlevel_string='$version_patchlevel_string'
23888 versiononly='$versiononly'
23890 voidflags='$voidflags'
23893 yaccflags='$yaccflags'
23898 : add special variables
23899 $test -f $src/patchlevel.h && \
23900 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
23901 echo "PERL_PATCHLEVEL='$perl_patchlevel'" >>config.sh
23902 echo "PERL_CONFIG_SH=true" >>config.sh
23904 : propagate old symbols
23905 if $test -f UU/config.sh; then
23906 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
23907 $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \
23908 config.sh config.sh UU/oldconfig.sh |\
23909 $sort | $uniq -u >UU/oldsyms
23910 set X `$cat UU/oldsyms`
23916 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
23918 echo ": Variables propagated from previous config.sh file." >>config.sh
23919 for sym in `$cat UU/oldsyms`; do
23920 echo " Propagating $hint variable "'$'"$sym..."
23921 eval 'tmp="$'"${sym}"'"'
23923 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
23929 : Finish up by extracting the .SH files
23933 echo "Extraction done."
23943 If you'd like to make any changes to the config.sh file before I begin
23944 to configure things, do it as a shell escape now (e.g. !vi config.sh).
23947 rp="Press return or use a shell escape to edit config.sh:"
23952 *) : in case they cannot read
23953 sh 1>&4 -c "$ans";;
23958 : if this fails, just run all the .SH files by hand
23967 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
23974 Now you need to generate make dependencies by running "$make depend".
23975 You might prefer to run it in background: "$make depend > makedepend.out &"
23976 It can take a while, so you might not want to run it right now.
23981 rp="Run $make depend now?"
23985 $make depend && echo "Now you must run '$make'."
23988 echo "You must run '$make depend' then '$make'."
23991 elif test -f [Mm]akefile; then
23993 echo "Now you must run a $make."
23995 echo "Configure done."
23998 if $test -f Policy.sh; then
24001 If you compile $package on a different machine or from a different object
24002 directory, copy the Policy.sh file from this object directory to the
24003 new one before you run Configure -- this will help you with most of
24004 the policy defaults.
24008 if $test -f config.msg; then
24009 echo "Hmm. I also noted the following information while running:"
24011 $cat config.msg >&4
24014 $rm -f kit*isdone ark*isdone