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 Fri Jan 7 14:18:56 CET 2011 [metaconfig 3.5 PL0]
32 # (with additional metaconfig patches by perlbug@perl.org)
37 SCO csh still thinks true is false. Write to SCO today and tell them that next
38 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
40 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
41 we'd have to do is go in and swap the && and || tokens, wherever they are.)
43 [End of diatribe. We now return you to your regularly scheduled programming...]
47 OOPS! You naughty creature! You didn't run Configure with sh!
48 I will attempt to remedy the situation by running sh for you...
52 true || exec sh $0 $argv:q
54 (exit $?0) || cat c2$$
55 (exit $?0) || exec sh $0 $argv:q
58 if test -f /dev/cputype -a -f /dev/drivers -a -f /dev/osversion; then
61 *** I'm sorry but this system looks like Plan 9 and Plan 9 doesn't do
62 *** Configure that well. (Plan 9 is close to UNIX but not close enough.)
63 *** Please read the README.plan9 for further instructions.
64 *** Cannot continue, aborting.
70 if test ! -c /dev/null ; then
73 *** I'm sorry, but /dev/null appears to be a file rather than a device.
74 *** Please consult your operating sytem's notes for making a device
76 *** Cannot continue, aborting.
82 : compute my invocation name
86 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
91 : Proper separator for the PATH environment variable
93 : On OS/2 this directory should exist if this is not floppy only system ":-]"
94 if test -d c:/. || ( uname -a | grep -i 'os\(/\|\)2' ) 2>&1 >/dev/null ; then
95 if test -n "$OS2_SHELL"; then
97 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
98 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
100 elif test -n "$DJGPP"; then
101 case "X${MACHTYPE:-nonesuchmach}" in
108 : Proper PATH setting
109 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
110 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
111 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
112 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
113 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
114 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /opt/ansic/bin /usr/ccs/bin"
115 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
116 paths="$paths /sbin /usr/sbin /usr/libexec"
117 paths="$paths /system/gnu_library/bin"
121 case "$p_$PATH$p_" in
123 *) test -d $p && PATH=$PATH$p_$p ;;
130 : shall we be using ksh?
136 if (PATH=.; alias -x) >/dev/null 2>&1; then
139 if test -f /hp-ux -a -f /bin/ksh; then
140 needksh='to avoid sh bug in "here document" expansion'
142 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
143 if test X`/usr/bin/uname -v` = X4; then
144 avoidksh="to avoid AIX 4's /bin/sh"
148 if test -f /osf_boot -a -f /usr/sbin/setld; then
149 if test X`/usr/bin/uname -s` = XOSF1; then
150 avoidksh="to avoid Digital UNIX' ksh"
155 case "$inksh/$needksh" in
162 case "$inksh/$avoidksh" in
168 case "$inksh/$needksh-$avoidksh-" in
171 (I see you are using the Korn shell. Some ksh's blow up on $me,
172 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
179 echo "(Feeding myself to $newsh $reason.)"
181 Configure|*/Configure) exec $newsh $0 "$@";;
182 *) exec $newsh Configure "$@";;
186 test -x "${newsh}" || unset newsh
188 : if needed, set CDPATH to a harmless value that is not chatty
189 : avoid bash 2.02 problems with empty CDPATH.
193 *bash*) CDPATH='.' ;;
199 : Configure runs within the UU subdirectory
200 test -d UU || mkdir UU
340 initialinstalllocation=''
369 d_attribute_deprecated=''
370 d_attribute_format=''
371 d_attribute_malloc=''
372 d_attribute_nonnull=''
373 d_attribute_noreturn=''
375 d_attribute_unused=''
376 d_attribute_warn_unused_result=''
377 d_printf_format_null=''
380 d_builtin_choose_expr=''
383 d_c99_variadic_macros=''
430 endhostent_r_proto=''
436 endprotoent_r_proto=''
442 endservent_r_proto=''
495 gethostbyaddr_r_proto=''
497 gethostbyname_r_proto=''
499 gethostent_r_proto=''
512 getnetbyaddr_r_proto=''
514 getnetbyname_r_proto=''
528 d_getprotobyname_r=''
529 getprotobyname_r_proto=''
530 d_getprotobynumber_r=''
531 getprotobynumber_r_proto=''
533 getprotoent_r_proto=''
545 getservbyname_r_proto=''
547 getservbyport_r_proto=''
549 getservent_r_proto=''
575 d_libm_lib_version=''
578 d_localtime_r_needs_tzset=''
589 d_malloc_good_size=''
633 d_old_pthread_create_joinable=''
634 old_pthread_create_joinable=''
636 d_pthread_attr_setscope=''
675 sethostent_r_proto=''
692 setprotoent_r_proto=''
704 setservent_r_proto=''
740 d_sprintf_returns_strlen=''
752 perl_static_inline=''
757 d_stdio_ptr_lval_nochange_cnt=''
758 d_stdio_ptr_lval_sets_cnt=''
902 d_gdbm_ndbm_h_uses_prototypes=''
903 d_gdbmndbm_h_uses_prototypes=''
905 d_ndbm_h_uses_prototypes=''
979 d_inc_version_list=''
981 inc_version_list_init=''
1000 ignore_versioned_solibs=''
1064 d_perl_otherlibdirs=''
1072 api_versionstring=''
1078 version_patchlevel_string=''
1082 d_nv_preserves_uv=''
1083 d_nv_zero_is_allbits_zero=''
1094 nv_overflows_integers_at=''
1095 nv_preserves_uv_bits=''
1167 installsitehtml1dir=''
1170 installsitehtml3dir=''
1177 installsiteman1dir=''
1180 installsiteman3dir=''
1185 installsitescript=''
1200 d_stdio_stream_array=''
1201 stdio_stream_array=''
1218 ccflags_uselargefiles=''
1219 ldflags_uselargefiles=''
1220 libswanted_uselargefiles=''
1241 installvendorarch=''
1248 installvendorhtml1dir=''
1250 vendorhtml1direxp=''
1251 installvendorhtml3dir=''
1253 vendorhtml3direxp=''
1259 installvendorman1dir=''
1262 installvendorman3dir=''
1269 installvendorscript=''
1282 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1285 : We must find out about Eunice early
1287 if test -f /etc/unixtovms; then
1288 eunicefix=/etc/unixtovms
1290 if test -f /etc/unixtovms.exe; then
1291 eunicefix=/etc/unixtovms.exe
1294 : Set executable suffix now -- needed before hints available
1295 if test -f "/libs/version.library"; then
1298 elif test -f "/system/gnu_library/bin/ar.pm"; then
1301 elif test -n "$DJGPP"; then
1304 elif test -d c:/. -o -n "$is_os2" ; then
1312 : Possible local include directories to search.
1313 : Set locincpth to "" in a hint file to defeat local include searches.
1314 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1315 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1317 : no include file wanted by default
1320 : Enable -DEBUGGING and -DDEBUGGING from the command line
1324 : set usethreads on the Configure command line to enable threads.
1325 usereentrant='undef'
1326 : Trailing extension. Override this in a hint file, if needed.
1327 : Extra object files, if any, needed on this platform.
1330 : change the next line if compiling for Xenix/286 on Xenix/386
1331 xlibpth='/usr/lib/386 /lib/386'
1332 : Possible local library directories to search.
1333 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1334 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1336 : general looking path for locating libraries
1337 glibpth="/lib /usr/lib $xlibpth"
1338 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1339 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1340 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1341 test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
1343 : Private path used by Configure to find libraries. Its value
1344 : is prepended to libpth. This variable takes care of special
1345 : machines, like the mips. Usually, it should be empty.
1348 : default library list
1350 : some systems want to use only the non-versioned libso:s
1351 ignore_versioned_solibs=''
1352 : full support for void wanted by default
1358 : set useposix=false in your hint file to disable the POSIX extension.
1360 : set useopcode=false in your hint file to disable the Opcode extension.
1363 ccflags_uselargefiles=''
1364 ldflags_uselargefiles=''
1365 libswanted_uselargefiles=''
1366 : set usemultiplicity on the Configure command line to enable multiplicity.
1367 : set usesocks on the Configure command line to enable socks.
1368 : List of libraries we want.
1369 : If anyone needs extra -lxxx, put those in a hint file.
1370 libswanted="sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun"
1371 libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
1372 : We probably want to search /usr/shlib before most other libraries.
1373 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1374 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1375 glibpth="/usr/shlib $glibpth"
1376 : Do not use vfork unless overridden by a hint file.
1379 : Find the basic shell for Bourne shell scripts
1383 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1386 if test -f "$xxx"; then
1389 : Build up a list and do a single loop so we can 'break' out.
1390 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1391 for xxx in sh bash ksh pdksh ash; do
1393 try="$try ${p}/${xxx}"
1397 if test -f "$xxx"; then
1400 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1403 elif test -f "$xxx.exe"; then
1414 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1416 Usually it's in /bin/sh. How did you even get this far?
1417 Please contact me (Perl Maintainers) at perlbug@perl.org and
1418 we'll try to straighten this all out.
1424 : see if sh knows # comments
1425 if `$sh -c '#' >/dev/null 2>&1`; then
1429 test -f $xcat$_exe || xcat=/usr/bin/cat
1430 if test ! -f $xcat$_exe; then
1431 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1432 if test -f $p/cat$_exe; then
1437 if test ! -f $xcat$_exe; then
1438 echo "Can't find cat anywhere!"
1442 echo "#!$xcat" >sharp
1445 ./sharp > today 2>/dev/null
1446 if test -s today; then
1449 echo "#! $xcat" > sharp
1452 ./sharp > today 2>/dev/null
1453 if test -s today; then
1461 echo "Your $sh doesn't grok # comments--I will strip them later on."
1464 echo "exec grep -v '^[ ]*#'" >spitshell
1466 $eunicefix spitshell
1467 spitshell=`pwd`/spitshell
1469 echo "I presume that if # doesn't work, #! won't work either!"
1474 : figure out how to guarantee sh startup
1476 '') startsh=${sharpbang}${sh} ;;
1488 : echo "Yup, it does."
1490 echo "Hmm... '$startsh' does not guarantee sh startup..."
1491 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1495 : Save command line options in file UU/cmdline.opt for later use in
1496 : generating config.sh.
1497 cat > cmdline.opt <<EOSH
1498 : Configure command line arguments.
1507 cat >>cmdline.opt <<EOSH
1508 config_arg$argn='$arg'
1510 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1513 arg_exp=`cat cmdl.opt`
1514 args_exp="$args_exp$args_sep'$arg_exp'"
1515 argn=`expr $argn + 1`
1520 : produce awk script to parse command line options
1521 cat >options.awk <<'EOF'
1523 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1525 len = length(optstr);
1526 for (i = 1; i <= len; i++) {
1527 c = substr(optstr, i, 1);
1528 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1539 if (substr(str, 1, 1) != "-") {
1540 printf("'%s'\n", str);
1544 for (i = 2; i <= len; i++) {
1545 c = substr(str, i, 1);
1547 printf("-%s\n", substr(str, i));
1553 printf("'%s'\n", substr(str, i + 1));
1566 : process the command line options
1567 set X `for arg in "$@"; do echo "X$arg"; done |
1568 sed -e s/X// | awk -f options.awk`
1573 : set up default values
1583 rm -f optdef.sh posthint.sh
1584 cat >optdef.sh <<EOS
1590 while test $# -gt 0; do
1592 -d) shift; fastread=yes;;
1593 -e) shift; alldone=cont;;
1597 if test -r "$1"; then
1600 echo "$me: cannot read config file $1." >&2
1606 -h) shift; error=true;;
1607 -r) shift; reuseval=true;;
1608 -s) shift; silent=true; realsilent=true;;
1609 -E) shift; alldone=exit;;
1610 -K) shift; knowitall=true;;
1611 -O) shift; override=true;;
1612 -S) shift; silent=true; extractsh=true;;
1617 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1618 echo "$me: ignoring -D $1" >&2
1621 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1622 *) echo "$1='define'" >> optdef.sh;;
1629 *=) echo "$1" >> optdef.sh;;
1631 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1632 echo "$me: ignoring -U $1" >&2
1634 *) echo "$1='undef'" >> optdef.sh;;
1645 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1649 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1650 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1656 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1657 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1658 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1659 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1660 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1661 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1667 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1669 echo "$yyy=''" >> posthint.sh ;;
1674 echo "$yyy='$zzz'" >> posthint.sh ;;
1676 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1678 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1683 echo "$yyy=$zzz" >> posthint.sh ;;
1684 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1688 -V) echo "$me generated by metaconfig 3.5 PL0." >&2
1691 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1699 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1700 [-U symbol] [-U symbol=] [-A command:symbol...]
1701 -d : use defaults for all answers.
1702 -e : go on without questioning past the production of config.sh.
1703 -f : specify an alternate default configuration file.
1704 -h : print this help message and exit (with an error status).
1705 -r : reuse C symbols value if possible (skips costly nm extraction).
1706 -s : silent mode, only echoes questions and essential information.
1707 -D : define symbol to have some value:
1708 -D symbol symbol gets the value 'define'
1709 -D symbol=value symbol gets the value 'value'
1710 common used examples (see INSTALL for more info):
1711 -Duse64bitint use 64bit integers
1712 -Duse64bitall use 64bit integers and pointers
1713 -Dusethreads use thread support
1714 -Dinc_version_list=none do not include older perl trees in @INC
1715 -DEBUGGING=none DEBUGGING options
1716 -Dcc=gcc choose your compiler
1717 -Dprefix=/opt/perl5 choose your destination
1718 -E : stop at the end of questions, after having produced config.sh.
1719 -K : do not use unless you know what you are doing.
1720 -O : let -D and -U override definitions from loaded configuration file.
1721 -S : perform variable substitutions on all .SH files (can mix with -f)
1722 -U : undefine symbol:
1723 -U symbol symbol gets the value 'undef'
1724 -U symbol= symbol gets completely empty
1726 -A : manipulate symbol after the platform specific hints have been applied:
1727 -A append:symbol=value append value to symbol
1728 -A symbol=value like append:, but with a separating space
1729 -A define:symbol=value define symbol to have value
1730 -A clear:symbol define symbol to be ''
1731 -A define:symbol define symbol to be 'define'
1732 -A eval:symbol=value define symbol to be eval of value
1733 -A prepend:symbol=value prepend value to symbol
1734 -A undef:symbol define symbol to be 'undef'
1735 -A undef:symbol= define symbol to be ''
1736 e.g.: -A prepend:libswanted='cl pthread '
1737 -A ccflags=-DSOME_MACRO
1738 -V : print version number and exit (with a zero status).
1745 case "$fastread$alldone" in
1748 case "$extractsh" in
1751 if test ! -t 0; then
1752 echo "Say 'sh Configure', not 'sh <Configure'"
1762 true) exec 1>/dev/null;;
1765 : run the defines and the undefines, if any, but leave the file out there...
1768 : create the posthint manipulation script and leave the file out there...
1773 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1774 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1775 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1776 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1777 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1780 : Some greps do not return status, grrr.
1781 echo "grimblepritz" >grimble
1782 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1784 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1790 : the following should work in any shell
1794 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1795 cat >contains <<'EOSS'
1796 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1801 : Find the path to the source tree
1804 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1808 *) src=`cd ../$src && pwd` ;;
1821 if test -f $rsrc/Configure && \
1822 $contains "^package='$package'\$" $rsrc/Configure >/dev/null 2>&1
1824 : found it, so we are ok.
1827 for src in . .. ../.. ../../.. ../../../..; do
1828 if test -f ../$src/Configure && \
1829 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1840 Sorry, I can't seem to locate the source dir for $package. Please start
1841 Configure with an explicit path -- i.e. /some/path/Configure.
1849 echo "Sources for $package found in \"$src\"." >&4
1853 : script used to extract .SH files with variable substitutions
1854 cat >extract <<'EOS'
1856 echo "Doing variable substitutions on .SH files..."
1857 if test -f MANIFEST; then
1858 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1860 echo "(Looking for .SH files under the source directory.)"
1861 set x `(cd "$src"; find . -name "*.SH" -print)`
1865 0) set x `(cd "$src"; echo *.SH)`; shift;;
1867 if test ! -f "$src/$1"; then
1873 while test $name; do
1874 if test ! -d "$name"; then
1875 create="$name $create";
1876 name=`echo $name | sed -e "s|^[^/]*$||"`;
1877 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1882 for file in $create; do
1891 dir=`expr X$file : 'X\(.*\)/'`
1892 file=`expr X$file : 'X.*/\(.*\)'`
1893 (cd "$dir" && . ./$file)
1903 dir=`expr X$file : 'X\(.*\)/'`
1904 file=`expr X$file : 'X.*/\(.*\)'`
1905 (set x $dir; shift; eval $mkdir_p)
1906 sh <"$src/$dir/$file"
1915 if test -f "$src/config_h.SH"; then
1916 if test ! -f config.h; then
1917 : oops, they left it out of MANIFEST, probably, so do it anyway.
1918 . "$src/config_h.SH"
1923 : extract files and exit if asked to do so
1924 case "$extractsh" in
1926 case "$realsilent" in
1930 case "$config_sh" in
1931 '') config_sh='config.sh';;
1934 echo "Fetching answers from $config_sh..."
1937 test "$override" && . ./optdef.sh
1941 echo "Extraction done."
1946 : Eunice requires " " instead of "", can you believe it
1949 echo "Beginning of configuration questions for $package."
1951 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1953 : first determine how to suppress newline on echo command
1955 echo "Checking echo to see how to suppress newlines..."
1956 (echo "hi there\c" ; echo " ") >.echotmp
1957 if $contains c .echotmp >/dev/null 2>&1 ; then
1968 echo $n "The star should be here-->$c"
1972 : Now test for existence of everything in MANIFEST
1974 if test -f "$rsrc/MANIFEST"; then
1975 echo "First let's make sure your kit is complete. Checking..." >&4
1976 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | \
1977 (split -l 50 2>/dev/null || split -50)
1980 for filelist in x??; do
1981 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` \
1982 >/dev/null 2>>"$tmppwd/missing")
1984 if test -s missing; then
1988 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1990 You have the option of continuing the configuration process, despite the
1991 distinct possibility that your kit is damaged, by typing 'y'es. If you
1992 do, don't blame me if something goes wrong. I advise you to type 'n'o
1993 and contact the author (perlbug@perl.org).
1996 echo $n "Continue? [n] $c" >&4
2000 echo "Continuing..." >&4
2004 echo "ABORTING..." >&4
2009 echo "Looks good..."
2012 echo "There is no MANIFEST file. I hope your kit is complete !"
2016 : Find the appropriate value for a newline for tr
2018 if test -n "$DJGPP"; then
2021 if test X"$trnl" = X; then
2022 case "`echo foo|tr '\n' x 2>/dev/null`" in
2026 if test X"$trnl" = X; then
2027 case "`echo foo|tr '\012' x 2>/dev/null`" in
2028 foox) trnl='\012' ;;
2031 if test X"$trnl" = X; then
2032 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
2033 fooxy) trnl='\n\r' ;;
2036 if test X"$trnl" = X; then
2039 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
2045 : compute the number of columns on the terminal for proper question formatting
2050 : set up the echo used in my read
2051 myecho="case \"\$xxxm\" in
2052 '') echo $n \"\$rp $c\" >&4;;
2054 '') echo $n \"[\$xxxm] $c\";;
2056 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
2058 echo $n \"[\$xxxm] $c\" >&4
2060 echo $n \"\$rp [\$xxxm] $c\" >&4
2066 : now set up to do reads with possible shell escape and default assignment
2072 case "\$fastread" in
2073 yes) case "\$dflt" in
2076 case "\$silent-\$rp" in
2081 *) case "\$silent" in
2082 true) case "\$rp" in
2087 while expr "X\$ans" : "X!" >/dev/null; do
2091 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2099 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2108 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2113 echo "(OK, I'll run with -d after this question.)" >&4
2116 echo "*** Sorry, \$1 not supported yet." >&4
2126 echo "*** Substitution done -- please confirm."
2128 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2133 echo "*** Error -- try again."
2140 case "\$ans\$xxxm\$nostick" in
2152 : create .config dir to save info across Configure sessions
2153 test -d ../.config || mkdir ../.config
2154 cat >../.config/README <<EOF
2155 This directory created by Configure to save information that should
2156 persist across sessions for $package.
2158 You may safely delete it if you wish.
2161 : See if we are using a devel version and want that
2162 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2165 usedevel="$define" ;;
2166 *) case "$xversion" in
2169 *** WHOA THERE!!! ***
2171 This is an UNSTABLE DEVELOPMENT release.
2172 The version of this $package distribution is $xversion, that is, odd,
2173 (as opposed to even) and that signifies a development release.
2174 If you want a maintenance release, you want an even-numbered version.
2176 Do ***NOT*** install this into production use.
2177 Data corruption and crashes are possible.
2179 It is most seriously suggested that you do not continue any further
2180 unless you want to help in developing and debugging Perl.
2182 If you *still* want to build perl, you can answer 'y' now,
2183 or pass -Dusedevel to Configure.
2186 rp='Do you really want to continue?'
2190 [yY]) echo >&4 "Okay, continuing."
2191 usedevel="$define" ;;
2192 *) echo >&4 "Okay, bye."
2203 case "$versiononly" in
2204 '') versiononly="$define" ;;
2206 case "$installusrbinperl" in
2207 '') installusrbinperl="$undef" ;;
2212 : general instructions
2215 user=`(logname) 2>/dev/null`
2217 '') user=`whoami 2>&1`;;
2219 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2222 rp='Would you like to see the instructions?'
2233 This installation shell script will examine your system and ask you questions
2234 to determine how the perl5 package should be installed. If you get
2235 stuck on a question, you may use a ! shell escape to start a subshell or
2236 execute a command. Many of the questions will have default answers in square
2237 brackets; typing carriage return will give you the default.
2239 On some of the questions which ask for file or directory names you are allowed
2240 to use the ~name construct to specify the login directory belonging to "name",
2241 even if you don't have a shell which knows about that. Questions where this is
2242 allowed will be marked "(~name ok)".
2246 dflt='Type carriage return to continue'
2250 The prompter used in this script allows you to use shell variables and
2251 backticks in your answers. You may use $1, $2, etc... to refer to the words
2252 in the default answer, as if the default line was a set of arguments given to a
2253 script shell. This means you may also use $* to repeat the whole default line,
2254 so you do not have to re-type everything to add something to the default.
2256 Every time there is a substitution, you will have to confirm. If there is an
2257 error (e.g. an unmatched backtick), the default answer will remain unchanged
2258 and you will be prompted again.
2260 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2261 the questions and use the computed defaults (or the previous answers if there
2262 was already a config.sh file). Type 'Configure -h' for a list of options.
2263 You may also start interactively and then answer '& -d' at any prompt to turn
2264 on the non-interactive behaviour for the remainder of the execution.
2270 Much effort has been expended to ensure that this shell script will run on any
2271 Unix system. If despite that it blows up on yours, your best bet is to edit
2272 Configure and run it again. If you can't run Configure for some reason,
2273 you'll have to generate a config.sh file by hand. Whatever problems you
2274 have, let me (perlbug@perl.org) know how I blew it.
2276 This installation script affects things in two ways:
2278 1) it may do direct variable substitutions on some of the files included
2280 2) it builds a config.h file for inclusion in C programs. You may edit
2281 any of these files as the need arises after running this script.
2283 If you make a mistake on a question, there is no easy way to back up to it
2284 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2285 files. Configure will offer to let you do this before it runs the SH files.
2288 dflt='Type carriage return to continue'
2290 case "$firsttime" in
2291 true) echo $user >>../.config/instruct;;
2295 : find out where common programs are
2297 echo "Locating common programs..." >&4
2310 if test -d \$dir/\$thing; then
2316 for thisthing in \$dir/\$thing; do
2317 : just loop through to pick last item
2319 if test -f \$thisthing; then
2322 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2325 elif test -f \$dir/\$thing.exe; then
2326 if test -n "$DJGPP"; then
2327 echo \$dir/\$thing.exe
2328 elif test "$eunicefix" != ":"; then
2329 : on Eunice apparently
2382 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2383 pth="$pth /lib /usr/lib"
2384 for file in $loclist; do
2388 if test -f "$xxx"; then
2391 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2392 xxx=`./loc $file $file $pth`
2395 '') xxx=`./loc $file $file $pth`;;
2396 *) xxx=`./loc $xxx $xxx $pth`;;
2398 eval $file=$xxx$_exe
2402 echo $file is in $xxx.
2405 echo $file is in $xxx.
2408 echo "I don't know where '$file' is, and my life depends on it." >&4
2409 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2415 echo "Don't worry if any of the following aren't found..."
2417 for file in $trylist; do
2421 if test -f "$xxx"; then
2424 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2425 xxx=`./loc $file $file $pth`
2428 '') xxx=`./loc $file $file $pth`;;
2429 *) xxx=`./loc $xxx $xxx $pth`;;
2431 eval $file=$xxx$_exe
2435 echo $file is in $xxx.
2438 echo $file is in $xxx.
2441 echo "I don't see $file out there, $say."
2448 echo "Substituting grep for egrep."
2455 *) if $less -R </dev/null >/dev/null; then
2456 echo "Substituting less -R for less."
2464 echo "Substituting cp for ln."
2473 echo "I can't find make or gmake, and my life depends on it." >&4
2474 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2482 *) # We can't have osname yet.
2483 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2484 # Assume that gmake, if found, is definitely GNU make
2485 # and prefer it over the system make.
2486 echo "Substituting gmake for make."
2494 echo "Hopefully test is built into your sh."
2497 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2498 echo "Using the test built into your sh."
2506 echo "Hopefully echo is built into your sh."
2511 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2512 $echo $n "hi there$c" >foo1
2513 echo $n "hi there$c" >foo2
2514 if cmp foo1 foo2 >/dev/null 2>&1; then
2515 echo "They are compatible. In fact, they may be identical."
2522 They are not compatible! You are probably running ksh on a non-USG system.
2523 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2524 have echo built in and we may have to run some Bourne shell scripts. That
2525 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2528 $echo $n "The star should be here-->$c"
2535 # This question was auctioned at YAPC::Europe-2007 in Vienna
2536 # I never promised you could answer it. I only auctioned the question.
2538 The following message is sponsored by
2540 Dresden.pm<--The stars should be here.
2542 Dear Perl user, system administrator or package
2543 maintainer, the Perl community sends greetings to
2544 you. Do you (emblematical) greet back [Y/n]? n
2548 : Check what type of C compiler we use
2552 cat <<'EOSC' >>trygcc
2557 int main(int argc, char *argv[]) {
2561 if $cc -o try $ccflags $ldflags try.c; then
2564 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2570 # Skip this test because it gives a false match on output like:
2571 # ./trygcc: line 23: cc: command not found
2572 # case "`$cc -v -c try.c 2>&1`" in
2573 # *gcc*) trygcc=no ;;
2575 if $test X"$trygcc" = Xyes; then
2576 if gcc -o try -c try.c; then
2578 echo "You seem to have a working gcc, though." >&4
2579 # Switching compilers may undo the work of hints files.
2580 # The most common problem is -D_REENTRANT for threads.
2581 # This heuristic catches that case, but gets false positives
2582 # if -Dusethreads was not actually specified. Better to
2583 # bail out here with a useful message than fail
2584 # mysteriously later. Should we perhaps just try to
2585 # re-invoke Configure -Dcc=gcc config_args ?
2586 if $test -f usethreads.cbu; then
2589 *** However, any setting of the C compiler flags (e.g. for thread support)
2590 *** will be lost. It may be necessary for you to restart Configure and
2591 *** add -Dcc=gcc to your Configure command line.
2594 rp="Would you like to go ahead and try gcc anyway?"
2597 rp="Would you like to use it?"
2600 if $test -f myread; then
2603 if $test -f UU/myread; then
2606 echo "Cannot find myread, sorry. Aborting." >&2
2611 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2624 cat <<'EOSC' >>checkcc
2629 int main(int argc, char *argv[]) {
2633 if $cc -o try $ccflags $ldflags try.c; then
2636 if $test X"$despair" = Xyes; then
2637 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2640 You need to find a working C compiler.
2641 Either (purchase and) install the C compiler supplied by your OS vendor,
2642 or for a free C compiler try http://gcc.gnu.org/
2643 I cannot continue any further, aborting.
2652 : determine whether symbolic links are supported
2655 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2656 echo "Symbolic links are supported." >&4
2659 echo "Symbolic links are NOT supported." >&4
2664 : determine whether symbolic links are supported
2668 echo "Checking how to test for symbolic links..." >&4
2670 if $test "X$issymlink" = X; then
2672 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2673 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2675 if test $? = 0; then
2678 echo "Your builtin 'test -h' may be broken." >&4
2681 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2684 if test -f "$p/$test"; then
2693 echo "Trying external '$test -h'." >&4
2694 issymlink="$test -h"
2695 if $test ! -h sym >/dev/null 2>&1; then
2696 echo "External '$test -h' is broken, too." >&4
2704 if $test "X$issymlink" = X; then
2705 if $test -L sym 2>/dev/null; then
2706 issymlink="$test -L"
2707 echo "The builtin '$test -L' worked." >&4
2710 if $test "X$issymlink" != X; then
2711 echo "You can test for symbolic links with '$issymlink'." >&4
2713 echo "I do not know how you can test for symbolic links." >&4
2717 *) echo "No symbolic links, so not testing for their testing..." >&4
2722 : Make symlinks util
2723 case "$mksymlinks" in
2726 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2729 *) case "$lns:$issymlink" in
2730 *"ln"*" -s:"*"test -"?)
2731 echo "Creating the symbolic links..." >&4
2732 echo "(First creating the subdirectories...)" >&4
2734 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2736 test -z "$directory" && break
2740 if test ! -d t/base; then
2741 echo "Failed to create the subdirectories. Aborting." >&4
2744 echo "(Then creating the symlinks...)" >&4
2745 awk '{print $1}' $src/MANIFEST | while true; do
2747 test -z "$filename" && break
2748 if test -f $filename; then
2749 if $issymlink $filename; then
2753 if test -f $filename; then
2754 echo "$filename already exists, not symlinking."
2756 ln -s $src/$filename $filename
2760 if test ! -f t/base/lex.t; then
2761 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2766 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2774 : Check for Cross-Compilation
2775 case "$usecrosscompile" in
2777 $echo "Cross-compiling..."
2780 *-*-gcc) # A cross-compiling gcc, probably.
2781 targetarch=`$echo $cc|$sed 's/-gcc$//'`
2783 # leave out ld, choosing it is more complex
2785 ranlib=$targetarch-ranlib
2786 $echo 'extern int foo;' > try.c
2787 set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
2789 if $test $# -gt 0; then
2791 incpth="`$echo $incpth|$sed 's/^ //'`"
2792 echo "Guessing incpth '$incpth'." >&4
2794 j="`$echo $i|$sed 's,/include$,/lib,'`"
2795 if $test -d $j; then
2799 libpth="`$echo $libpth|$sed 's/^ //'`"
2800 echo "Guessing libpth '$libpth'." >&4
2805 case "$targetarch" in
2806 '') echo "Targetarch not defined." >&4; croak=y ;;
2807 *) echo "Using targetarch $targetarch." >&4 ;;
2810 '') echo "Incpth not defined." >&4; croak=y ;;
2811 *) echo "Using incpth '$incpth'." >&4 ;;
2814 '') echo "Libpth not defined." >&4; croak=y ;;
2815 *) echo "Using libpth '$libpth'." >&4 ;;
2818 '') for i in $incpth; do
2819 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2821 echo "Guessing usrinc $usrinc." >&4
2826 '') echo "Usrinc not defined." >&4; croak=y ;;
2829 *) echo "Using usrinc $usrinc." >&4 ;;
2831 case "$targethost" in
2832 '') echo "Targethost not defined." >&4; croak=y ;;
2833 *) echo "Using targethost $targethost." >&4
2838 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2841 /*) run=$src/Cross/run
2842 targetmkdir=$src/Cross/mkdir
2844 from=$src/Cross/from
2846 *) pwd=`$test -f ../Configure & cd ..; pwd`
2848 targetmkdir=$pwd/Cross/mkdir
2850 from=$pwd/Cross/from
2853 case "$targetrun" in
2854 '') targetrun=ssh ;;
2859 case "$targetfrom" in
2860 '') targetfrom=scp ;;
2864 from=$from-$targetfrom
2865 case "$targetdir" in
2867 echo "Guessing targetdir $targetdir." >&4
2870 case "$targetuser" in
2872 echo "Guessing targetuser $targetuser." >&4
2875 case "$targetfrom" in
2879 case "$targetrun" in
2891 '') cwd=$targetdir ;;
2895 if $test ! -f \$exe.xok; then
2899 $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2902 *) echo "Unknown targetrun '$targetrun'" >&4
2906 case "$targetmkdir" in
2908 cat >$targetmkdir <<EOF
2910 $targetrun -l $targetuser $targethost "mkdir -p \$@"
2912 $chmod a+rx $targetmkdir
2914 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2926 $targetmkdir \`dirname \$f\`
2927 $targetto $q \$f $targetuser@$targethost:\$f || exit 1
2930 $targetmkdir $targetdir/\`dirname \$f\`
2931 $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2944 $mkdir -p $targetdir/\`dirname \$f\`
2945 $cp \$f $targetdir/\$f || exit 1
2948 $targetmkdir $targetdir/\`dirname \$f\`
2949 $cp \$f $targetdir/\$f || exit 1
2956 *) echo "Unknown targetto '$targetto'" >&4
2960 case "$targetfrom" in
2967 $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2972 cp) cat >$from <<EOF
2977 cp $targetdir/\$f . || exit 1
2982 *) echo "Unknown targetfrom '$targetfrom'" >&4
2986 if $test ! -f $run; then
2987 echo "Target 'run' script '$run' not found." >&4
2991 if $test ! -f $to; then
2992 echo "Target 'to' script '$to' not found." >&4
2996 if $test ! -f $from; then
2997 echo "Target 'from' script '$from' not found." >&4
3001 if $test ! -f $run -o ! -f $to -o ! -f $from; then
3005 Using '$run' for remote execution,
3006 and '$from' and '$to'
3007 for remote file transfer.
3013 usecrosscompile='undef'
3018 : see whether [:lower:] and [:upper:] are supported character classes
3020 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
3022 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
3026 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
3027 # (0xd9 and 0xe2), therefore that is a nice testing point.
3028 if test "X$up" = X -o "X$low" = X; then
3029 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
3035 if test "X$up" = X -o "X$low" = X; then
3036 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
3042 if test "X$up" = X -o "X$low" = X; then
3043 case "`echo RS | od -x 2>/dev/null`" in
3045 echo "Hey, this might be EBCDIC." >&4
3046 if test "X$up" = X -o "X$low" = X; then
3047 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
3048 rs) up='[A-IJ-RS-Z]'
3053 if test "X$up" = X -o "X$low" = X; then
3054 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
3064 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
3066 echo "Using $up and $low to convert case." >&4
3069 echo "I don't know how to translate letters from upper to lower case." >&4
3070 echo "Your tr is not acting any way I know of." >&4
3074 : set up the translation script tr, must be called with ./tr of course
3078 '[A-Z][a-z]') exec $tr '$up' '$low';;
3079 '[a-z][A-Z]') exec $tr '$low' '$up';;
3086 : Try to determine whether config.sh was made on this system
3087 case "$config_sh" in
3089 myuname=`$uname -a 2>/dev/null`
3090 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
3091 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
3092 # because the A-Z/a-z are not consecutive.
3093 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e "s,['/],,g" | \
3094 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
3095 newmyuname="$myuname"
3097 case "$knowitall" in
3099 if test -f ../config.sh; then
3100 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3101 eval "`grep myuname= ../config.sh`"
3103 if test "X$myuname" = "X$newmyuname"; then
3111 : Get old answers from old config file if Configure was run on the
3112 : same system, otherwise use the hints.
3115 if test -f config.sh; then
3117 rp="I see a config.sh file. Shall I use it to set the defaults?"
3120 n*|N*) echo "OK, I'll ignore it."
3121 mv config.sh config.sh.old
3122 myuname="$newmyuname"
3124 *) echo "Fetching default answers from your old config.sh file..." >&4
3132 : Older versions did not always set $sh. Catch re-use of such
3142 if test ! -f config.sh; then
3145 First time through, eh? I have some defaults handy for some systems
3146 that need some extra help getting the Configure answers right:
3149 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3151 : Half the following guesses are probably wrong... If you have better
3152 : tests or hints, please send them to perlbug@perl.org
3153 : The metaconfig authors would also appreciate a copy...
3154 $test -f /irix && osname=irix
3155 $test -f /xenix && osname=sco_xenix
3156 $test -f /dynix && osname=dynix
3157 $test -f /dnix && osname=dnix
3158 $test -f /lynx.os && osname=lynxos
3159 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3160 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3161 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3162 $test -f /bin/mips && /bin/mips && osname=mips
3163 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
3164 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
3165 $test -d /usr/apollo/bin && osname=apollo
3166 $test -f /etc/saf/_sactab && osname=svr4
3167 $test -d /usr/include/minix && osname=minix
3168 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3169 if $test -d /MachTen -o -d /MachTen_Folder; then
3171 if $test -x /sbin/version; then
3172 osvers=`/sbin/version | $awk '{print $2}' |
3173 $sed -e 's/[A-Za-z]$//'`
3174 elif $test -x /usr/etc/version; then
3175 osvers=`/usr/etc/version | $awk '{print $2}' |
3176 $sed -e 's/[A-Za-z]$//'`
3182 $test -f /sys/posix.dll &&
3183 $test -f /usr/bin/what &&
3184 set X `/usr/bin/what /sys/posix.dll` &&
3185 $test "$3" = UWIN &&
3189 if $test -f $uname; then
3197 umips) osname=umips ;;
3200 [23]100) osname=mips ;;
3201 next*) osname=next ;;
3203 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3204 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3207 elif $test -f /etc/kconfig; then
3209 if test "$lns" = "$ln -s"; then
3211 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3213 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3220 if test -n "$DJGPP"; then
3229 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3231 # oslevel can fail with:
3232 # oslevel: Unable to acquire lock.
3233 *not\ found) osvers="$4"."$3" ;;
3234 '<3240'|'<>3240') osvers=3.2.0 ;;
3235 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3236 '=3250'|'>3250') osvers=3.2.5 ;;
3240 bsd386) osname=bsd386
3243 cygwin*) osname=cygwin
3246 *dc.osx) osname=dcosx
3252 domainos) osname=apollo
3258 dragonfly) osname=dragonfly
3261 dynixptx*) osname=dynixptx
3262 osvers=`echo "$4"|sed 's/^v//'`
3264 freebsd) osname=freebsd
3266 genix) osname=genix ;;
3270 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3286 netbsd*) osname=netbsd
3289 news-os) osvers="$3"
3291 4*) osname=newsos4 ;;
3295 next*) osname=next ;;
3296 nonstop-ux) osname=nonstopux ;;
3297 openbsd) osname=openbsd
3303 POSIX-BC | posix-bc ) osname=posix-bc
3306 powerux | power_ux | powermax_os | powermaxos | \
3307 powerunix | power_unix) osname=powerux
3313 solaris) osname=solaris
3315 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3322 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3326 titanos) osname=titanos
3335 ultrix) osname=ultrix
3338 osf1|mls+) case "$5" in
3341 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3344 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3347 hp*) osname=hp_osf1 ;;
3348 mips) osname=mips_osf1 ;;
3351 # UnixWare 7.1.2 is known as Open UNIX 8
3352 openunix|unixware) osname=svr5
3360 $2) case "$osname" in
3364 : svr4.x or possibly later
3374 if test -f /stand/boot ; then
3375 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3376 if test -n "$INITPROG" -a -f "$INITPROG"; then
3377 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3378 if test -n "$isesix"; then
3386 *) if test -f /etc/systemid; then
3388 set `echo $3 | $sed 's/\./ /g'` $4
3389 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3391 elif $test -f $src/hints/sco_$1_$2.sh; then
3393 elif $test -f $src/hints/sco_$1.sh; then
3398 '') : Still unknown. Probably a generic Sys V.
3407 *) case "$osname" in
3408 '') : Still unknown. Probably a generic BSD.
3416 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3417 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3418 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3421 $rm -f UU/kernel.what
3422 elif test -d c:/. -o -n "$is_os2" ; then
3429 case "$targetarch" in
3432 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3437 : Now look for a hint file osname_osvers, unless one has been
3438 : specified already.
3441 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3442 : Also try without trailing minor version numbers.
3443 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3444 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3445 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3446 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3449 *) case "$osvers" in
3452 *) if $test -f $src/hints/$file.sh ; then
3454 elif $test -f $src/hints/$xfile.sh ; then
3456 elif $test -f $src/hints/$xxfile.sh ; then
3458 elif $test -f $src/hints/$xxxfile.sh ; then
3460 elif $test -f $src/hints/$xxxxfile.sh ; then
3462 elif $test -f "$src/hints/${osname}.sh" ; then
3471 if $test -f Policy.sh ; then
3474 none) dflt="Policy" ;;
3475 *) dflt="Policy $dflt" ;;
3480 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3484 if $test -f Policy.sh ; then
3487 There's also a Policy hint file available, which should make the
3488 site-specific (policy) questions easier to answer.
3495 You may give one or more space-separated answers, or "none" if appropriate.
3496 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3497 previous run of Configure, you may specify it as well as or instead of
3498 OS-specific hints. If hints are provided for your OS, you should use them:
3499 although Perl can probably be built without hints on many platforms, using
3500 hints often improve performance and may enable features that Configure can't
3501 set up on its own. If there are no hints that match your OS, specify "none";
3502 DO NOT give a wrong version or a wrong OS.
3506 rp="Which of these apply, if any?"
3509 for file in $tans; do
3510 if $test X$file = XPolicy -a -f Policy.sh; then
3512 $cat Policy.sh >> UU/config.sh
3513 elif $test -f $src/hints/$file.sh; then
3514 . $src/hints/$file.sh
3515 $cat $src/hints/$file.sh >> UU/config.sh
3516 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3519 : Give one chance to correct a possible typo.
3520 echo "$file.sh does not exist"
3522 rp="hint to use instead?"
3524 for file in $ans; do
3525 if $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$ans = X -o X$ans = Xnone ; then
3531 echo "$file.sh does not exist -- ignored."
3538 : Remember our hint file for later.
3539 if $test -f "$src/hints/$file.sh" ; then
3549 echo "Fetching default answers from $config_sh..." >&4
3553 cp $config_sh config.sh 2>/dev/null
3563 test "$override" && . ./optdef.sh
3565 : Restore computed paths
3566 for file in $loclist $trylist; do
3567 eval $file="\$_$file"
3572 Configure uses the operating system name and version to set some defaults.
3573 The default value is probably right if the name rings a bell. Otherwise,
3574 since spelling matters for me, either accept the default or answer "none"
3581 ''|' '|none) dflt=none ;;
3582 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3585 *) dflt="$osname" ;;
3587 rp="Operating system name?"
3591 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3597 ''|' '|none) dflt=none ;;
3598 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3599 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3601 ''|' ') dflt=none ;;
3606 *) dflt="$osvers" ;;
3608 rp="Operating system version?"
3618 : who configured the system
3619 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3622 cf_by=`(logname) 2>/dev/null`
3625 cf_by=`(whoami) 2>/dev/null`
3627 "") cf_by=unknown ;;
3632 : decide how portable to be. Allow command line overrides.
3633 case "$d_portable" in
3635 *) d_portable="$define" ;;
3638 : set up shell script to do ~ expansion
3644 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3647 if $test -f /bin/csh; then
3648 /bin/csh -f -c "glob \$1"
3653 name=\`$expr x\$1 : '..\([^/]*\)'\`
3654 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3655 if $test ! -d "\$dir"; then
3657 echo "\$me: can't locate home directory for: \$name" >&2
3662 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3678 : now set up to get a file name
3682 cat <<'EOSC' >>getfile
3698 : getfile will accept an answer from the comma-separated list
3699 : enclosed in parentheses even if it does not meet other criteria.
3700 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3701 fn=`echo $fn | sed 's/(.*)//'`
3707 loc_file=`expr $fn : '.*:\(.*\)'`
3708 fn=`expr $fn : '\(.*\):.*'`
3716 */*) fullpath=true;;
3725 *e*) exp_file=true;;
3728 *p*) nopath_ok=true;;
3733 *d*) type='Directory';;
3734 *l*) type='Locate';;
3739 Locate) what='File';;
3744 case "$d_portable" in
3752 while test "$type"; do
3757 true) rp="$rp (~name ok)";;
3760 if test -f UU/getfile.ok && \
3761 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3780 value=`UU/filexp $ans`
3783 if test "$ans" != "$value"; then
3784 echo "(That expands to $value on this system.)"
3798 /*) value="$ansexp" ;;
3799 [a-zA-Z]:/*) value="$ansexp" ;;
3804 echo "I shall only accept a full path name, as in /bin/ls." >&4
3805 echo "Use a ! shell escape if you wish to check pathnames." >&4
3808 echo "Please give a full path name, starting with slash." >&4
3811 echo "Note that using ~name is ok provided it expands well." >&4
3824 for fp in $gfpth; do
3825 if test "X$fp" = X.; then
3830 if test -f "$pf"; then
3832 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3834 echo "($value is not a plain file, but that's ok.)"
3837 if test X"$type" = X; then
3844 for fp in $gfpth; do
3845 if test "X$fp" = X.; then
3850 direxp="$fp/$ansexp"
3852 if test -d "$direxp"; then
3860 if test -d "$ansexp"; then
3861 echo "(Looking for $loc_file in directory $value.)"
3862 value="$value/$loc_file"
3863 ansexp="$ansexp/$loc_file"
3865 if test -f "$ansexp"; then
3868 case "$nopath_ok" in
3869 true) case "$value" in
3871 *) echo "Assuming $value will be in people's path."
3887 if test "$fastread" = yes; then
3892 rp="$what $value doesn't exist. Use that name anyway?"
3911 test "X$gfpthkeep" != Xy && gfpth=""
3914 : determine root of directory hierarchy where package will be installed.
3917 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
3920 dflt=`echo "$prefix" | sed 's/.$//'`
3928 By default, $package will be installed in $dflt/bin, manual pages
3929 under $dflt/man, etc..., i.e. with $dflt as prefix for all
3930 installation directories. Typically this is something like /usr/local.
3931 If you wish to have binaries under /usr/bin but other parts of the
3932 installation under /usr/local, that's ok: you will be prompted
3933 separately for each of the installation directories, the prefix being
3934 only used to set the defaults.
3938 rp='Installation prefix to use?'
3946 *) oldprefix="$prefix";;
3953 : allow them to override the AFS root
3956 *) afsroot=$afsroot ;;
3962 $define|true) afs=true ;;
3963 $undef|false) afs=false ;;
3964 *) if $test -d $afsroot; then
3972 echo "AFS may be running... I'll be extra cautious then..." >&4
3974 echo "AFS does not seem to be running..." >&4
3977 : determine installation prefix for where package is to be installed.
3981 Since you are running AFS, I need to distinguish the directory in which
3982 files will reside from the directory in which they are installed (and from
3983 which they are presumably copied to the former directory by occult means).
3986 case "$installprefix" in
3987 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
3988 *) dflt="$installprefix";;
3993 In some special cases, particularly when building $package for distribution,
3994 it is convenient to distinguish the directory in which files should be
3995 installed from the directory ($prefix) in which they will
3996 eventually reside. For most users, these two directories are the same.
3999 case "$installprefix" in
4001 *) dflt=$installprefix;;
4005 rp='What installation prefix should I use for installing files?'
4007 installprefix="$ans"
4008 installprefixexp="$ansexp"
4010 : Perform the prefixexp/installprefixexp correction if necessary
4011 cat <<EOS >installprefix
4014 cat <<'EOSC' >>installprefix
4015 : Change installation prefix, if necessary.
4016 if $test X"$prefix" != X"$installprefix"; then
4017 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
4019 eval "install${prefixvar}=\"\$${prefixvar}exp\""
4022 chmod +x installprefix
4023 $eunicefix installprefix
4025 : Set variables such as privlib and privlibexp from the output of ./getfile
4026 : performing the prefixexp/installprefixexp correction if necessary.
4027 cat <<EOS >setprefixvar
4030 cat <<'EOSC' >>setprefixvar
4031 eval "${prefixvar}=\"\$ans\""
4032 eval "${prefixvar}exp=\"\$ansexp\""
4035 chmod +x setprefixvar
4036 $eunicefix setprefixvar
4038 : set up the script used to warn in case of inconsistency
4047 '') echo "The $hint value for \$$var on this machine was \"$was\"!" >&4
4049 *) echo "Hmm. Based on the hints in hints/$hintfile.sh, " >&4
4050 echo "the $hint value for \$$var on this machine was \"$was\"!" >&4
4055 echo "*** WHOA THERE!!! ***" >&4
4056 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
4059 rp=" Keep the $hint value?"
4062 y) td=$was; tu=$was;;
4066 : function used to set '$1' to '$val'
4067 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
4069 $define$undef) . ./whoa; eval "$var=\$td";;
4070 $undef$define) . ./whoa; eval "$var=\$tu";;
4071 *) eval "$var=$val";;
4074 : Check is we will use socks
4076 $define|true|[yY]*) dflt='y';;
4081 Perl can be built to use the SOCKS proxy protocol library. To do so,
4082 Configure must be run with -Dusesocks. If you use SOCKS you also need
4083 to use the PerlIO abstraction layer, this will be implicitly selected.
4085 If this doesn't make any sense to you, just accept the default '$dflt'.
4087 rp='Build Perl for SOCKS?'
4090 y|Y) val="$define" ;;
4097 $define|true|[yY]*) useperlio="$define";;
4100 : Check if we want perlio
4101 case "$useperlio" in
4102 $define|true|[yY]*|'') dflt='y';;
4107 Previous version of $package used the standard IO mechanisms as
4108 defined in <stdio.h>. Versions 5.003_02 and later of $package allow
4109 alternate IO mechanisms via the PerlIO abstraction layer, but the
4110 stdio mechanism is still available if needed. The abstraction layer
4111 can use AT&T's sfio (if you already have sfio installed) or regular stdio.
4112 Using PerlIO with sfio may cause problems with some extension modules.
4114 If this doesn't make any sense to you, just accept the default '$dflt'.
4116 rp='Use the PerlIO abstraction layer?'
4123 echo "Ok, doing things the stdio way."
4132 case "$useperlio" in
4133 $define|true|[yY]*) ;;
4136 You are using the SOCKS proxy protocol library which means that you
4137 should also use the PerlIO layer. You may be headed for trouble.
4145 : get the patchlevel
4147 echo "Getting the current patchlevel..." >&4
4148 if $test -r $rsrc/patchlevel.h;then
4149 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
4150 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4151 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4152 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4153 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4154 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4155 perl_patchlevel=`egrep ',"(MAINT|SMOKE)[0-9][0-9]*"' $rsrc/patchlevel.h|tail -1|sed 's/[^0-9]//g'`
4164 $echo "(You do not have patchlevel.h. Eek.)"
4166 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
4167 version_patchlevel_string="version $patchlevel subversion $subversion"
4168 case "$perl_patchlevel" in
4170 *) perl_patchlevel=`echo $perl_patchlevel | sed 's/.* //'`
4171 version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel"
4175 $echo "(You have $package $version_patchlevel_string.)"
4179 : XXX Should be a Configure test for double-dots in filenames.
4180 version=`echo $revision $patchlevel $subversion | \
4181 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4182 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4183 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4186 version=`echo $revision $patchlevel $subversion | \
4187 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4188 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4189 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4192 : Special case the 5.005_xx maintenance series, which used 5.005
4193 : without any subversion label as a subdirectory in $sitelib
4194 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4195 api_versionstring='5.005'
4198 : Do we want threads support and if so, what type
4199 case "$usethreads" in
4200 $define|true|[yY]*) dflt='y';;
4201 *) # Catch case where user specified ithreads or 5005threads but
4202 # forgot -Dusethreads (A.D. 4/2002)
4203 case "$useithreads$use5005threads" in
4205 case "$useperlio" in
4206 "$define") dflt='y' ;;
4216 Perl can be built to take advantage of threads on some systems.
4217 To do so, Configure can be run with -Dusethreads.
4219 Note that Perl built with threading support runs slightly slower
4220 and uses more memory than plain Perl. The current implementation
4221 is believed to be stable, but it is fairly new, and so should be
4222 treated with caution.
4224 If this doesn't make any sense to you, just accept the default '$dflt'.
4226 rp='Build a threading Perl?'
4229 y|Y) val="$define" ;;
4235 if $test $patchlevel -lt 9; then
4236 case "$usethreads" in
4240 Since release 5.6, Perl has had two different threading implementations,
4241 the newer interpreter-based version (ithreads) with one interpreter per
4242 thread, and the older 5.005 version (5005threads).
4243 The 5005threads version is effectively unmaintained and will probably be
4244 removed in Perl 5.10, so there should be no need to build a Perl using it
4245 unless needed for backwards compatibility with some existing 5.005threads
4249 : Default to ithreads unless overridden on command line or with
4252 case "$use5005threads" in
4253 $define|true|[yY]*) dflt='n';;
4255 case "$useithreads" in
4256 $undef|false|[nN]*) dflt='n';;
4258 rp='Use the newer interpreter-based ithreads?'
4261 y|Y) val="$define" ;;
4266 : Now set use5005threads to the opposite value.
4267 case "$useithreads" in
4268 $define) val="$undef" ;;
4275 useithreads="$undef"
4276 use5005threads="$undef"
4280 case "$useithreads$use5005threads" in
4284 You cannot have both the ithreads and the 5.005 threads enabled
4285 at the same time. Disabling the 5.005 threads since they are
4286 much less stable than the ithreads.
4289 use5005threads="$undef"
4294 : perl-5.9.x and later
4296 if test X"$usethreads" = "X$define"; then
4297 case "$use5005threads" in
4301 5.005 threads has been removed for 5.10. Perl will be built using ithreads.
4308 use5005threads="$undef"
4309 useithreads="$usethreads"
4312 if test X"$usethreads" = "X$define" -a "X$useperlio" = "Xundef"; then
4315 *** To build with ithreads you must also use the PerlIO layer.
4316 *** Cannot continue, aborting.
4322 case "$d_oldpthreads" in
4323 '') : Configure tests would be welcome here. For now, assume undef.
4325 *) val="$d_oldpthreads" ;;
4331 : Look for a hint-file generated 'call-back-unit'. If the
4332 : user has specified that a threading perl is to be built,
4333 : we may need to set or change some other defaults.
4334 if $test -f usethreads.cbu; then
4335 echo "Your platform has some specific hints regarding threaded builds, using them..."
4338 case "$usethreads" in
4339 "$define"|true|[yY]*)
4341 (Your platform does not have any specific hints for threaded builds.
4342 Assuming POSIX threads, then.)
4348 : Check if multiplicity is required
4351 Perl can be built so that multiple Perl interpreters can coexist
4352 within the same Perl executable.
4355 case "$useithreads" in
4358 This multiple interpreter support is required for interpreter-based threads.
4362 *) case "$usemultiplicity" in
4363 $define|true|[yY]*) dflt='y';;
4367 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4368 rp='Build Perl for multiplicity?'
4371 y|Y) val="$define" ;;
4379 : Check if morebits is requested
4380 case "$usemorebits" in
4381 "$define"|true|[yY]*)
4382 use64bitint="$define"
4383 uselongdouble="$define"
4384 usemorebits="$define"
4386 *) usemorebits="$undef"
4390 : Determine the C compiler to be used
4396 rp="Use which C compiler?"
4400 : See whether they have no cc but they do have gcc
4402 if $test -f cc.cbu; then
4407 : make some quick guesses about what we are up against
4409 $echo $n "Hmm... $c"
4419 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
4420 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
4422 echo "Looks kind of like an OSF/1 system, but we'll see..."
4424 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4425 xxx=`./loc addbib blurfl $pth`
4426 if $test -f $xxx; then
4427 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4431 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4432 echo "Looks kind of like an extended USG system, but we'll see..."
4434 echo "Looks kind of like a USG system, but we'll see..."
4438 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4439 echo "Looks kind of like a BSD system, but we'll see..."
4443 echo "Looks kind of like a Version 7 system, but we'll see..."
4446 case "$eunicefix" in
4449 There is, however, a strange, musty smell in the air that reminds me of
4450 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4454 : it so happens the Eunice I know will not run shell scripts in Unix format
4458 echo "Congratulations. You aren't running Eunice."
4462 : Detect OS2. The p_ variable is set above in the Head.U unit.
4463 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4464 : semicolon as a patch separator
4469 I have the feeling something is not exactly right, however...don't tell me...
4470 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4471 (Or you may be running DOS with DJGPP.)
4476 if test -f /xenix; then
4477 echo "Actually, this looks more like a XENIX system..."
4482 echo "It's not Xenix..."
4487 if test -f /venix; then
4488 echo "Actually, this looks more like a VENIX system..."
4495 echo "Nor is it Venix..."
4498 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4499 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4502 : Check if we are using GNU gcc and what its version is
4504 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4508 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4510 printf("%s\n", __VERSION__);
4512 printf("%s\n", "1");
4518 if $cc -o try $ccflags $ldflags try.c; then
4519 gccversion=`$run ./try`
4520 case "$gccversion" in
4521 '') echo "You are not using GNU cc." ;;
4522 *) echo "You are using GNU cc $gccversion."
4528 echo "*** WHOA THERE!!! ***" >&4
4529 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4530 case "$knowitall" in
4532 echo " You'd better start hunting for one and let me know about it." >&4
4538 case "$gccversion" in
4539 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4541 case "$gccversion" in
4542 '') gccosandvers='' ;;
4543 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4544 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4546 case "$gccosandvers" in
4547 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4548 $osname$osvers) ;; # looking good
4549 $osname*) cat <<EOM >&4
4551 *** WHOA THERE!!! ***
4553 Your gcc has not been compiled for the exact release of
4554 your operating system ($gccosandvers versus $osname$osvers).
4556 In general it is a good idea to keep gcc synchronized with
4557 the operating system because otherwise serious problems
4558 may ensue when trying to compile software, like Perl.
4560 I'm trying to be optimistic here, though, and will continue.
4561 If later during the configuration and build icky compilation
4562 problems appear (headerfile conflicts being the most common
4563 manifestation), I suggest reinstalling the gcc to match
4564 your operating system release.
4568 *) gccosandvers='' ;; # failed to parse, better be silent
4576 # gcc 3.* complain about adding -Idirectories that they already know about,
4577 # so we will take those off from locincpth.
4578 case "$gccversion" in
4580 echo "main(){}">try.c
4581 for incdir in $locincpth; do
4582 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4583 grep '^c[cp]p*[01]: warning: changing search order '`
4584 if test "X$warn" != X; then
4585 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4591 : What should the include directory be ?
4593 $echo $n "Hmm... $c"
4597 if $test -f /bin/mips && /bin/mips; then
4598 echo "Looks like a MIPS system..."
4599 $cat >usr.c <<'EOCP'
4600 #ifdef SYSTYPE_BSD43
4604 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4605 dflt='/bsd43/usr/include'
4609 mips_type='System V'
4611 $rm -f usr.c usr.out
4612 echo "and you're compiling with the $mips_type compiler and libraries."
4616 echo "Doesn't look like a MIPS system."
4626 case "$xxx_prompt" in
4629 rp='Where are the include files you want to use?'
4637 : see how we invoke the C preprocessor
4639 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4640 cat <<'EOT' >testcpp.c
4646 if test ! -f cppstdin; then
4647 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4648 # AIX cc -E doesn't show the absolute headerfile
4649 # locations but we'll cheat by using the -M flag.
4650 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
4652 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4655 echo "Keeping your $hint cppstdin wrapper."
4658 wrapper=`pwd`/cppstdin
4662 if $test "X$cppstdin" != "X" && \
4663 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4664 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4666 echo "You used to use $cppstdin $cppminus so we'll use that again."
4668 '') echo "But let's see if we can live without a wrapper..." ;;
4670 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4671 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4673 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4676 echo "(However, $cpprun $cpplast does not work, let's see...)"
4684 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4691 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4692 $cc -E <testcpp.c >testcpp.out 2>&1; \
4693 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4694 echo "Yup, it does."
4697 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4698 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4699 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4700 echo "Yup, it does."
4703 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4704 $cc -P <testcpp.c >testcpp.out 2>&1; \
4705 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4706 echo "Yipee, that works!"
4709 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4710 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4711 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4712 echo "At long last!"
4715 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4716 $cpp <testcpp.c >testcpp.out 2>&1; \
4717 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4721 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4722 $cpp - <testcpp.c >testcpp.out 2>&1; \
4723 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4724 echo "Hooray, it works! I was beginning to wonder."
4727 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4728 $wrapper <testcpp.c >testcpp.out 2>&1; \
4729 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4735 rp="No dice. I can't find a C preprocessor. Name one:"
4739 $x_cpp <testcpp.c >testcpp.out 2>&1
4740 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4741 echo "OK, that will do." >&4
4743 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4758 echo "Perhaps can we force $cc -E using a wrapper..."
4759 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4760 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4766 echo "Nope, we'll have to live without it..."
4780 "$wrapper"|'cppstdin') ;;
4781 *) $rm -f $wrapper;;
4783 $rm -f testcpp.c testcpp.out
4785 : Set private lib path
4788 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4793 '') dlist="$loclibpth $plibpth $glibpth";;
4794 *) dlist="$libpth";;
4797 : Now check and see which directories actually exist, avoiding duplicates
4801 if $test -d $xxx; then
4804 *) libpth="$libpth $xxx";;
4810 Some systems have incompatible or broken versions of libraries. Among
4811 the directories listed in the question below, please remove any you
4812 know not to be holding relevant libraries, and add any that are needed.
4813 Say "none" for none.
4824 rp="Directories to use for library searches?"
4831 : compute shared library extension
4834 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4844 On some systems, shared libraries may be available. Answer 'none' if
4845 you want to suppress searching of shared libraries for the remainder
4846 of this configuration.
4849 rp='What is the file extension used for shared libraries?'
4853 : Define several unixisms.
4854 : Hints files or command line option can be used to override them.
4855 : The convoluted testing is in case hints files set either the old
4858 '') case "$exe_ext" in
4860 *) _exe="$exe_ext" ;;
4865 '') case "$lib_ext" in
4872 '') case "$obj_ext" in
4879 '') case "$path_sep" in
4890 rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
4892 : Which makefile gets called first. This is used by make depend.
4893 case "$firstmakefile" in
4894 '') firstmakefile='makefile';;
4897 : Check for uselongdouble support
4899 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
4902 case "$uselongdouble" in
4903 $define|true|[yY]*) dflt='y';;
4908 Perl can be built to take advantage of long doubles which
4909 (if available) may give more accuracy and range for floating point numbers.
4911 If this doesn't make any sense to you, just accept the default '$dflt'.
4913 rp='Try to use long doubles if available?'
4916 y|Y) val="$define" ;;
4922 case "$uselongdouble" in
4923 true|[yY]*) uselongdouble="$define" ;;
4926 : Look for a hint-file generated 'call-back-unit'. If the
4927 : user has specified that long doubles should be used,
4928 : we may need to set or change some other defaults.
4929 if $test -f uselongdouble.cbu; then
4930 echo "Your platform has some specific hints regarding long doubles, using them..."
4931 . ./uselongdouble.cbu
4933 case "$uselongdouble" in
4936 (Your platform does not have any specific hints for long doubles.)
4942 : Looking for optional libraries
4944 echo "Checking for optional libraries..." >&4
4949 case "$libswanted" in
4950 '') libswanted='c_s';;
4953 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4959 for thisdir in $libpth $xlibpth; do
4960 test -d $thisdir && libspath="$libspath $thisdir"
4962 for thislib in $libswanted; do
4963 for thisdir in $libspath; do
4965 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4966 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
4967 $test -f "$xxx" && eval $libscheck
4968 $test -f "$xxx" && libstyle=shared
4970 if test ! -f "$xxx"; then
4971 xxx=$thisdir/lib$thislib.$so
4972 $test -f "$xxx" && eval $libscheck
4973 $test -f "$xxx" && libstyle=shared
4975 if test ! -f "$xxx"; then
4976 xxx=$thisdir/lib$thislib$_a
4977 $test -f "$xxx" && eval $libscheck
4978 $test -f "$xxx" && libstyle=static
4980 if test ! -f "$xxx"; then
4981 xxx=$thisdir/$thislib$_a
4982 $test -f "$xxx" && eval $libscheck
4983 $test -f "$xxx" && libstyle=static
4985 if test ! -f "$xxx"; then
4986 xxx=$thisdir/lib${thislib}_s$_a
4987 $test -f "$xxx" && eval $libscheck
4988 $test -f "$xxx" && libstyle=static
4989 $test -f "$xxx" && thislib=${thislib}_s
4991 if test ! -f "$xxx"; then
4992 xxx=$thisdir/Slib$thislib$_a
4993 $test -f "$xxx" && eval $libscheck
4994 $test -f "$xxx" && libstyle=static
4996 if $test -f "$xxx"; then
4998 shared) echo "Found -l$thislib (shared)." ;;
4999 static) echo "Found -l$thislib." ;;
5000 *) echo "Found -l$thislib ($libstyle)." ;;
5004 *) dflt="$dflt -l$thislib"
5005 libsfound="$libsfound $xxx"
5007 libsfiles="$libsfiles $yyy"
5008 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
5009 case " $libsdirs " in
5011 *) libsdirs="$libsdirs $yyy" ;;
5018 if $test ! -f "$xxx"; then
5019 echo "No -l$thislib."
5030 ' '|'') dflt='none';;
5035 In order to compile $package on your machine, a number of libraries
5036 are usually needed. Include any other special libraries here as well.
5037 Say "none" for none. The default list is almost always right.
5041 rp="What libraries to use?"
5048 : determine optimization, if desired, or use for debug flag also
5050 ' '|$undef) dflt='none';;
5052 *) dflt="$optimize";;
5056 By default, $package compiles with the -O flag to use the optimizer.
5057 Alternately, you might want to use the symbolic debugger, which uses
5058 the -g flag (on traditional Unix systems). Either flag can be
5059 specified here. To use neither flag, specify the word "none".
5062 rp="What optimizer/debugger flag should be used?"
5066 'none') optimize=" ";;
5069 : Check what DEBUGGING is required from the command line
5070 : -DEBUGGING or -DDEBUGGING or
5071 : -DEBUGGING=both = -g + -DDEBUGGING
5072 : -DEBUGGING=-g or -Doptimize=-g = -g
5073 : -DEBUGGING=none or -UDEBUGGING =
5074 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
5077 *) DEBUGGING=$EBUGGING ;;
5080 case "$DEBUGGING" in
5084 *) optimize="$optimize -g" ;;
5088 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
5096 case "$DEBUGGING" in
5097 both|$define) dflt='-DDEBUGGING'
5100 : argument order is deliberate, as the flag will start with - which set could
5101 : think is an option
5102 checkccflag='check=$1; flag=$2; callback=$3;
5104 echo "Checking if your compiler accepts $flag" 2>&1;
5105 echo "int main(void) { return 0; }" > gcctest.c;
5106 if $cc -O2 $flag -o gcctest gcctest.c 2>gcctest.out && ./gcctest; then
5107 echo "Yes, it does." 2>&1;
5108 if $test -s gcctest.out ; then
5109 echo "But your platform does not like it:";
5114 echo "Leaving current flags $ccflags alone." 2>&1
5116 *) dflt="$dflt $flag";
5122 echo "Nope, it does not, but that is ok." 2>&1;
5126 : We will not override a previous value, but we might want to
5127 : augment a hint file
5129 default|recommended)
5130 case "$gccversion" in
5131 1*) dflt="$dflt -fpcc-struct-return" ;;
5133 case "$optimize:$DEBUGGING" in
5134 *-g*:old) dflt="$dflt -DDEBUGGING";;
5136 case "$gccversion" in
5137 2*) if $test -d /etc/conf/kconfig.d &&
5138 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
5140 # Interactive Systems (ISC) POSIX mode.
5145 case "$gccversion" in
5148 ?*) set strict-aliasing -fno-strict-aliasing
5152 # For gcc, adding -pipe speeds up compilations for some, but apparently
5153 # some assemblers can't read from stdin. (It also slows down compilations
5154 # in other cases, but those are apparently rarer these days.) AD 5/2004.
5155 case "$gccversion" in
5161 # on x86_64 (at least) we require an extra library (libssp) in the
5162 # link command line. This library is not named, so I infer that it is
5163 # an implementation detail that may change. Hence the safest approach
5164 # is to add the flag to the flags passed to the compiler at link time,
5165 # as that way the compiler can do the right implementation dependant
5167 case "$gccversion" in
5168 ?*) set stack-protector -fstack-protector
5175 case "$mips_type" in
5176 *BSD*|'') inclwanted="$locincpth $usrinc";;
5177 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
5179 for thisincl in $inclwanted; do
5180 if $test -d $thisincl; then
5181 if $test x$thisincl != x$usrinc; then
5183 *" -I$thisincl "*);;
5184 *) dflt="$dflt -I$thisincl ";;
5190 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
5192 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5200 *) dflt="$dflt -D$2";;
5204 set signal.h LANGUAGE_C; eval $inctest
5208 ccflags="$ccflags -DSOCKS"
5213 default|recommended) dflt="$ccflags $dflt" ;;
5214 *) dflt="$ccflags";;
5223 Your C compiler may want other flags. For this question you should include
5224 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5225 but you should NOT include libraries or ld flags like -lwhatever. If you
5226 want $package to honor its debug switch, you should include -DDEBUGGING here.
5227 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5229 To use no flags, specify the word "none".
5235 rp="Any additional cc flags?"
5242 : the following weeds options from ccflags that are of no interest to cpp
5244 '') cppflags="$ccflags" ;;
5245 *) cppflags="$cppflags $ccflags" ;;
5247 case "$gccversion" in
5248 1*) cppflags="$cppflags -D__GNUC__"
5250 case "$mips_type" in
5252 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5258 echo "Let me guess what the preprocessor flags are..." >&4
5272 *) ftry="$previous $flag";;
5274 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5275 >cpp1.out 2>/dev/null && \
5276 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5277 >cpp2.out 2>/dev/null && \
5278 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5279 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5281 cppflags="$cppflags $ftry"
5291 *-*) echo "They appear to be: $cppflags";;
5293 $rm -f cpp.c cpp?.out
5297 : flags used in final linking phase
5299 '') if ./venix; then
5305 *-posix*) dflt="$dflt -posix" ;;
5308 *) dflt="$ldflags";;
5310 # See note above about -fstack-protector
5312 *-fstack-protector*)
5314 *-fstack-protector*) ;; # Don't add it again
5315 *) dflt="$dflt -fstack-protector" ;;
5320 : Try to guess additional flags to pick up local libraries.
5321 for thislibdir in $libpth; do
5322 case " $loclibpth " in
5325 *"-L$thislibdir "*) ;;
5326 *) dflt="$dflt -L$thislibdir" ;;
5338 Your C linker may need flags. For this question you should
5339 include -L/whatever and any other flags used by the C linker, but you
5340 should NOT include libraries like -lwhatever.
5342 Make sure you include the appropriate -L/path flags if your C linker
5343 does not normally search all of the directories you specified above,
5346 To use no flags, specify the word "none".
5350 rp="Any additional ld flags (NOT including libraries)?"
5356 rmlist="$rmlist pdp11"
5360 echo "Checking your choice of C compiler and flags for coherency..." >&4
5361 $cat > try.c <<'EOF'
5363 int main() { printf("Ok\n"); return(0); }
5365 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5367 $cat >try.msg <<'EOM'
5368 I've tried to compile and run the following simple program:
5371 $cat try.c >> try.msg
5373 $cat >> try.msg <<EOM
5380 and I got the following output:
5384 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5385 if $sh -c "$run ./try " >>try.msg 2>&1; then
5389 *) echo 'The program compiled OK, but produced no output.' >> try.msg
5392 cat >> try.msg <<'EOQS'
5393 If $libs contains -lsfio, and sfio is mis-configured, then it
5394 sometimes (apparently) runs and exits with a 0 status, but with no
5395 output! It may have to do with sfio's use of _exit vs. exit.
5398 rp="You have a big problem. Shall I abort Configure"
5405 echo "The program compiled OK, but exited with status $?." >>try.msg
5406 rp="You have a problem. Shall I abort Configure"
5410 echo "I can't compile the test program." >>try.msg
5411 rp="You have a BIG problem. Shall I abort Configure"
5417 case "$knowitall" in
5419 echo "(The supplied flags or libraries might be incorrect.)"
5427 *) echo "Ok. Stopping Configure." >&4
5432 n) echo "OK, that should do.";;
5434 $rm_try gcctest gcctest.out
5436 : define a shorthand compile call
5440 case "$usedevel" in $define|true|[yY]*) if $test ! -f "${mc_file}.c"; then
5441 echo "Internal Configure script bug - compiler test file ${mc_file}.c is missing. Please report this to perlbug@perl.org" >&4;
5445 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5446 : define a shorthand compile call for compilations that should be ok.
5450 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5452 : determine filename position in cpp output
5454 echo "Computing filename position in cpp output for #include directives..." >&4
5456 vos) testaccess=-e ;;
5459 echo '#include <stdio.h>' > foo.c
5462 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5463 $grep '^[ ]*#.*stdio\.h' | \
5464 while read cline; do
5467 while $test \$# -gt 0; do
5468 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5473 pos=\`expr \$pos + 1\`
5485 *) pos="${fieldn}th";;
5487 echo "Your cpp writes the filename in the $pos field of the line."
5490 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
5491 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
5494 : locate header file
5499 for usrincdir in $usrinc
5501 if test -f \$usrincdir/\$wanted; then
5502 echo "\$usrincdir/\$wanted"
5506 awkprg='{ print \$$fieldn }'
5507 echo "#include <\$wanted>" > foo\$\$.c
5508 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5509 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5510 while read cline; do
5511 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5513 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5514 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5519 # status = 0: grep returned 0 lines, case statement not executed
5520 # status = 1: headerfile found
5521 # status = 2: while loop executed, no headerfile found
5525 if test \$status -eq 1; then
5532 : define an alternate in-header-list? function
5533 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5534 cont=true; xxf="echo \"<\$1> found.\" >&4";
5535 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5536 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5538 case $# in 4) instead=instead;; *) instead="at last";; esac;
5539 while $test "$cont"; do
5541 var=$2; eval "was=\$$2";
5542 if $test "$xxx" && $test -r "$xxx";
5544 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5547 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5548 set $yyy; shift; shift; yyy=$@;
5549 case $# in 0) cont="";;
5550 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5551 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5552 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5553 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5557 do set $yyy; var=$2; eval "was=\$$2";
5558 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5559 set $yyy; shift; shift; yyy=$@;
5562 : see if stdlib is available
5563 set stdlib.h i_stdlib
5566 : check for lengths of integral types
5570 echo "Checking to see how big your integers are..." >&4
5579 printf("intsize=%d;\n", (int)sizeof(int));
5580 printf("longsize=%d;\n", (int)sizeof(long));
5581 printf("shortsize=%d;\n", (int)sizeof(short));
5586 if eval $compile_ok && $run ./try > /dev/null; then
5588 echo "Your integers are $intsize bytes long."
5589 echo "Your long integers are $longsize bytes long."
5590 echo "Your short integers are $shortsize bytes long."
5594 Help! I can't compile and run the intsize test program: please enlighten me!
5595 (This is probably a misconfiguration in your system or libraries, and
5596 you really ought to fix it. Still, I'll try anyway.)
5600 rp="What is the size of an integer (in bytes)?"
5604 rp="What is the size of a long integer (in bytes)?"
5608 rp="What is the size of a short integer (in bytes)?"
5616 : check for long long
5618 echo "Checking to see if you have long long..." >&4
5619 echo 'int main() { long long x = 7; return 0; }' > try.c
5621 if eval $compile; then
5623 echo "You have long long."
5626 echo "You do not have long long."
5632 : check for length of long long
5633 case "${d_longlong}${longlongsize}" in
5636 echo "Checking to see how big your long longs are..." >&4
5637 $cat >try.c <<'EOCP'
5641 printf("%d\n", (int)sizeof(long long));
5646 if eval $compile_ok; then
5647 longlongsize=`$run ./try`
5648 echo "Your long longs are $longlongsize bytes long."
5652 echo "(I can't seem to compile the test program. Guessing...)"
5653 rp="What is the size of a long long (in bytes)?"
5657 if $test "X$longsize" = "X$longlongsize"; then
5658 echo "(That isn't any different from an ordinary long.)"
5664 : see if inttypes.h is available
5665 : we want a real compile instead of Inhdr because some systems
5666 : have an inttypes.h which includes non-existent headers
5669 #include <inttypes.h>
5671 static int32_t foo32 = 0x12345678;
5675 if eval $compile; then
5676 echo "<inttypes.h> found." >&4
5679 echo "<inttypes.h> NOT found." >&4
5688 echo "Checking to see if you have int64_t..." >&4
5690 #include <sys/types.h>
5691 #$i_inttypes I_INTTYPES
5693 #include <inttypes.h>
5695 int main() { int64_t x = 7; }
5698 if eval $compile; then
5700 echo "You have int64_t."
5703 echo "You do not have int64_t."
5709 : Check if 64bit ints have a quad type
5711 echo "Checking which 64-bit integer type we could use..." >&4
5717 val='"unsigned int"'
5722 *) case "$longsize" in
5726 val='"unsigned long"'
5731 *) case "$d_longlong:$longlongsize" in
5736 val='"unsigned long long"'
5741 *) case "$d_int64_t" in
5760 '') echo "Alas, no 64-bit integer types in sight." >&4
5763 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5768 : Do we want 64bit support
5769 case "$uselonglong" in
5770 "$define"|true|[yY]*)
5773 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5775 use64bitint="$define"
5778 case "$use64bits" in
5779 "$define"|true|[yY]*)
5782 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5784 use64bitint="$define"
5787 case "$use64bitints" in
5788 "$define"|true|[yY]*)
5791 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5793 use64bitint="$define"
5796 case "$use64bitsint" in
5797 "$define"|true|[yY]*)
5800 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5802 use64bitint="$define"
5805 case "$uselonglongs" in
5806 "$define"|true|[yY]*)
5809 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5811 use64bitint="$define"
5814 case "$use64bitsall" in
5815 "$define"|true|[yY]*)
5818 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
5820 use64bitall="$define"
5825 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
5827 case "$use64bitall" in
5828 "$define"|true|[yY]*) use64bitint="$define" ;;
5834 You have natively 64-bit long integers.
5838 *) case "$use64bitint" in
5839 "$define"|true|[yY]*) dflt='y';;
5848 Perl can be built to take advantage of 64-bit integer types
5849 on some systems. To do so, Configure can be run with -Duse64bitint.
5850 Choosing this option will most probably introduce binary incompatibilities.
5852 If this doesn't make any sense to you, just accept the default '$dflt'.
5853 (The default has been chosen based on your configuration.)
5855 rp='Try to use 64-bit integers, if available?'
5858 [yY]*) val="$define" ;;
5866 case "$use64bitall" in
5867 "$define"|true|[yY]*) dflt='y' ;;
5868 *) case "$longsize" in
5876 You may also choose to try maximal 64-bitness. It means using as much
5877 64-bitness as possible on the platform. This in turn means even more
5878 binary incompatibilities. On the other hand, your platform may not
5879 have any more 64-bitness available than what you already have chosen.
5881 If this doesn't make any sense to you, just accept the default '$dflt'.
5882 (The default has been chosen based on your configuration.)
5884 rp='Try to use maximal 64-bit support, if available?'
5887 [yY]*) val="$define" ;;
5892 case "$use64bitall" in
5894 case "$use64bitint" in
5898 Since you have chosen a maximally 64-bit build, I'm also turning on
5899 the use of 64-bit integers.
5901 use64bitint="$define" ;;
5906 : Look for a hint-file generated 'call-back-unit'. If the
5907 : user has specified that a 64-bit perl is to be built,
5908 : we may need to set or change some other defaults.
5909 if $test -f use64bitint.cbu; then
5910 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
5913 case "$use64bitint" in
5914 "$define"|true|[yY]*)
5916 4) case "$archname64" in
5917 '') archname64=64int ;;
5924 : Look for a hint-file generated 'call-back-unit'. If the
5925 : user has specified that a maximally 64-bit perl is to be built,
5926 : we may need to set or change some other defaults.
5927 if $test -f use64bitall.cbu; then
5928 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
5931 case "$use64bitall" in
5932 "$define"|true|[yY]*)
5934 4) case "$archname64" in
5935 ''|64int) archname64=64all ;;
5942 case "$d_quad:$use64bitint" in
5946 *** You have chosen to use 64-bit integers,
5947 *** but none can be found.
5948 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
5949 *** Cannot continue, aborting.
5956 : check for length of double
5958 case "$doublesize" in
5960 echo "Checking to see how big your double precision numbers are..." >&4
5969 printf("%d\n", (int)sizeof(double));
5974 if eval $compile_ok; then
5975 doublesize=`$run ./try`
5976 echo "Your double is $doublesize bytes long."
5979 echo "(I can't seem to compile the test program. Guessing...)"
5980 rp="What is the size of a double precision number (in bytes)?"
5988 : check for long doubles
5990 echo "Checking to see if you have long double..." >&4
5991 echo 'int main() { long double x = 7.0; }' > try.c
5993 if eval $compile; then
5995 echo "You have long double."
5998 echo "You do not have long double."
6004 : check for length of long double
6005 case "${d_longdbl}${longdblsize}" in
6008 echo "Checking to see how big your long doubles are..." >&4
6009 $cat >try.c <<'EOCP'
6013 printf("%d\n", sizeof(long double));
6018 if eval $compile; then
6019 longdblsize=`$run ./try`
6020 echo "Your long doubles are $longdblsize bytes long."
6024 echo "(I can't seem to compile the test program. Guessing...)" >&4
6025 rp="What is the size of a long double (in bytes)?"
6029 if $test "X$doublesize" = "X$longdblsize"; then
6030 echo "That isn't any different from an ordinary double."
6031 echo "I'll keep your setting anyway, but you may see some"
6032 echo "harmless compilation warnings."
6038 : determine the architecture name
6040 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
6041 tarch=`arch`"-$osname"
6042 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
6043 if uname -m > tmparch 2>&1 ; then
6044 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
6045 -e 's/$/'"-$osname/" tmparch`
6053 case "$myarchname" in
6056 echo "(Your architecture name used to be $myarchname.)"
6060 case "$targetarch" in
6062 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
6067 *) dflt="$archname";;
6069 rp='What is your architecture name'
6072 case "$usethreads" in
6074 echo "Threads selected." >&4
6076 *-thread*) echo "...and architecture name already has -thread." >&4
6078 *) archname="$archname-thread"
6079 echo "...setting architecture name to $archname." >&4
6084 case "$usemultiplicity" in
6086 echo "Multiplicity selected." >&4
6088 *-multi*) echo "...and architecture name already has -multi." >&4
6090 *) archname="$archname-multi"
6091 echo "...setting architecture name to $archname." >&4
6096 case "$use64bitint$use64bitall" in
6098 case "$archname64" in
6100 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
6103 case "$use64bitint" in
6104 "$define") echo "64 bit integers selected." >&4 ;;
6106 case "$use64bitall" in
6107 "$define") echo "Maximal 64 bitness selected." >&4 ;;
6110 *-$archname64*) echo "...and architecture name already has $archname64." >&4
6112 *) archname="$archname-$archname64"
6113 echo "...setting architecture name to $archname." >&4
6119 case "$uselongdouble" in
6121 echo "Long doubles selected." >&4
6122 case "$longdblsize" in
6124 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
6128 *-ld*) echo "...and architecture name already has -ld." >&4
6130 *) archname="$archname-ld"
6131 echo "...setting architecture name to $archname." >&4
6138 case "$useperlio" in
6140 echo "Perlio selected." >&4
6143 echo "Perlio not selected, using stdio." >&4
6145 *-stdio*) echo "...and architecture name already has -stdio." >&4
6147 *) archname="$archname-stdio"
6148 echo "...setting architecture name to $archname." >&4
6153 if $test -f archname.cbu; then
6154 echo "Your platform has some specific hints for architecture name, using them..."
6158 : set the prefixit variable, to compute a suitable default value
6159 prefixit='case "$3" in
6161 case "$oldprefix" in
6162 "") eval "$1=\"\$$2\"";;
6169 ""|" ") eval "$1=\"\$$2\"";;
6175 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
6177 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
6178 /*-$oldprefix/*|\~*-$oldprefix/*)
6179 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
6180 *) eval "$1=\"\$$2\"";;
6184 : determine installation style
6185 : For now, try to deduce it from prefix unless it is already set.
6186 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
6187 case "$installstyle" in
6188 '') case "$prefix" in
6189 *perl*) dflt='lib';;
6190 *) dflt='lib/perl5' ;;
6193 *) dflt="$installstyle" ;;
6195 : Probably not worth prompting for this since we prompt for all
6196 : the directories individually, and the prompt would be too long and
6200 : determine where public executables go
6205 rp='Pathname where the public executables will reside?'
6207 if $test "X$ansexp" != "X$binexp"; then
6211 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6212 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
6213 : this via initialinstalllocation
6216 case "$userelocatableinc" in
6217 $define|true|[yY]*) dflt='y' ;;
6222 Would you like to build Perl so that the installation is relocatable, so that
6223 library paths in @INC are determined relative to the path of the perl binary?
6224 This is not advised for system Perl installs, or if you need to run setid
6225 scripts or scripts under taint mode.
6227 If this doesn't make any sense to you, just accept the default '$dflt'.
6229 rp='Use relocatable @INC?'
6232 y|Y) val="$define" ;;
6235 set userelocatableinc
6238 initialinstalllocation="$binexp"
6239 : Default prefix is now "up one level from where the binaries are"
6240 case "$userelocatableinc" in
6246 installprefixexp=".../.."
6250 : determine where private library files go
6251 : Usual default is /usr/local/lib/perl5/$version.
6252 : Also allow things like /opt/perl/lib/$version, since
6253 : /opt/perl/lib/perl5... would be redundant.
6254 : The default "style" setting is made in installstyle.U
6255 case "$installstyle" in
6256 *lib/perl5*) set dflt privlib lib/$package/$version ;;
6257 *) set dflt privlib lib/$version ;;
6262 There are some auxiliary files for $package that need to be put into a
6263 private library directory that is accessible by everyone.
6268 rp='Pathname where the private library files will reside?'
6273 : set the prefixup variable, to restore leading tilda escape
6274 prefixup='case "$prefixexp" in
6276 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
6279 : determine where public architecture dependent libraries go
6282 : privlib default is /usr/local/lib/$package/$version
6283 : archlib default is /usr/local/lib/$package/$version/$archname
6284 : privlib may have an optional trailing /share.
6285 tdflt=`echo $privlib | $sed 's,/share$,,'`
6286 tdflt=$tdflt/$archname
6295 $spackage contains architecture-dependent library files. If you are
6296 sharing libraries in a heterogeneous environment, you might store
6297 these files in a separate location. Otherwise, you can just include
6298 them with the rest of the public library files.
6303 rp='Where do you want to put the public architecture-dependent libraries?'
6307 if $test X"$archlib" = X"$privlib"; then
6313 : see if setuid scripts can be secure
6316 Some kernels have a bug that prevents setuid #! scripts from being
6317 secure. Some sites have disabled setuid #! scripts because of this.
6319 First let's decide if your kernel supports secure setuid #! scripts.
6320 (If setuid #! scripts would be secure but have been disabled anyway,
6321 don't say that they are secure if asked.)
6326 if $test -d /dev/fd; then
6327 echo "#!$ls" >reflect
6328 chmod +x,u+s reflect
6329 ./reflect >flect 2>&1
6330 if $contains "/dev/fd" flect >/dev/null; then
6331 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6335 If you are not sure if they are secure, I can check but I'll need a
6336 username and password different from the one you are using right now.
6337 If you don't have such a username or don't want me to test, simply
6341 rp='Other username to test security of setuid scripts with?'
6346 case "$d_suidsafe" in
6347 '') echo "I'll assume setuid scripts are *not* secure." >&4
6350 echo "Well, the $hint value is *not* secure." >&4
6352 *) echo "Well, the $hint value *is* secure." >&4
6357 $rm -f reflect flect
6358 echo "#!$ls" >reflect
6359 chmod +x,u+s reflect
6362 echo '"su" will (probably) prompt you for '"$ans's password."
6363 su $ans -c './reflect >flect'
6364 if $contains "/dev/fd" flect >/dev/null; then
6365 echo "Okay, it looks like setuid scripts are secure." >&4
6368 echo "I don't think setuid scripts are secure." >&4
6373 rp='Does your kernel have *secure* setuid scripts?'
6376 [yY]*) val="$define";;
6381 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6382 echo "(That's for file descriptors, not floppy disks.)"
6388 $rm -f reflect flect
6390 : now see if they want to do setuid emulation
6391 if $test $patchlevel -lt 11; then
6394 case "$d_suidsafe" in
6397 echo "No need to emulate SUID scripts since they are secure here." >&4
6401 Some systems have disabled setuid scripts, especially systems where
6402 setuid scripts cannot be secure. On systems where setuid scripts have
6403 been disabled, the setuid/setgid bits on scripts are currently
6404 useless. It is possible for $package to detect those bits and emulate
6405 setuid/setgid in a secure fashion. This emulation will only work if
6406 setuid scripts have been disabled in your kernel.
6410 "$define") dflt=y ;;
6413 rp="Do you want to do setuid/setgid emulation?"
6416 [yY]*) val="$define";;
6428 SUID emulation has been removed for 5.12
6429 Please re-run Configure without -Dd_dosuid
6438 : Find perl5.005 or later.
6439 echo "Looking for a previously installed perl5.005 or later... "
6441 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
6442 : Check if this perl is recent and can load a simple module
6443 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6446 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6456 '') echo "None found. That's ok.";;
6457 *) echo "Using $perl5." ;;
6460 : Set the siteprefix variables
6463 After $package is installed, you may wish to install various
6464 add-on modules and utilities. Typically, these add-ons will
6465 be installed under $prefix with the rest
6466 of this package. However, you may wish to install such add-ons
6467 elsewhere under a different prefix.
6469 If you do not wish to put everything under a single prefix, that's
6470 ok. You will be prompted for the individual locations; this siteprefix
6471 is only used to suggest the defaults.
6473 The default should be fine for most people.
6477 rp='Installation prefix to use for add-on modules and utilities?'
6478 : XXX Here might be another good place for an installstyle setting.
6479 case "$siteprefix" in
6481 *) dflt=$siteprefix ;;
6484 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6486 case "$siteprefix" in
6490 *) oldsiteprefix="$prefix";;
6495 siteprefixexp="$ansexp"
6497 : determine where site specific libraries go.
6498 : Usual default is /usr/local/lib/perl5/site_perl/$version
6499 : The default "style" setting is made in installstyle.U
6500 : XXX No longer works with Prefixit stuff.
6501 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6503 '') case "$installstyle" in
6504 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6505 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6513 The installation process will create a directory for
6514 site-specific extensions and modules. Most users find it convenient
6515 to place all site-specific files in this directory rather than in the
6516 main distribution directory.
6520 rp='Pathname for the site-specific library files?'
6524 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6526 : Determine list of previous versions to include in @INC
6527 $cat > getverlist <<EOPL
6530 \$api_versionstring = "$api_versionstring";
6531 \$version = "$version";
6532 \$stem = "$sitelib_stem";
6533 \$archname = "$archname";
6535 $cat >> getverlist <<'EOPL'
6536 # The list found is store twice for each entry: the original name, and
6537 # the binary broken down version as pack "sss", so sorting is easy and
6538 # unambiguous. This will work for all versions that have a maximum of
6539 # three digit groups, separate by '.'s or '_'s. Names are extended with
6540 # ".0.0" to ensure at least three elements for the pack.
6541 # -- H.Merijn Brand (m)'06 23-10-2006
6543 # Can't have leading @ because metaconfig interprets it as a command!
6544 ;@inc_version_list=();
6545 # XXX Redo to do opendir/readdir?
6548 ;@candidates = map {
6549 [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
6550 ;@candidates = sort { $a->[1] cmp $b->[1]} @candidates;
6556 ($pversion, $aversion, $vsn5005) = map {
6557 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
6558 foreach $d (@candidates) {
6559 if ($d->[1] lt $pversion) {
6560 if ($d->[1] ge $aversion) {
6561 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
6563 elsif ($d->[1] ge $vsn5005) {
6564 unshift(@inc_version_list, grep { -d } $d->[0]);
6568 # Skip newer version. I.e. don't look in
6569 # 5.7.0 if we're installing 5.6.1.
6573 if (@inc_version_list) {
6574 print join(' ', @inc_version_list);
6577 # Blank space to preserve value for next Configure run.
6582 case "$inc_version_list" in
6583 '') if test -x "$perl5$exe_ext"; then
6584 dflt=`$perl5 getverlist`
6589 $undef) dflt='none' ;;
6590 *) eval dflt=\"$inc_version_list\" ;;
6593 ''|' ') dflt=none ;;
6600 In order to ease the process of upgrading, this version of perl
6601 can be configured to use modules built and installed with earlier
6602 versions of perl that were installed under $prefix. Specify here
6603 the list of earlier versions that this version of perl should check.
6604 If Configure detected no earlier versions of perl installed under
6605 $prefix, then the list will be empty. Answer 'none' to tell perl
6606 to not search earlier versions.
6608 The default should almost always be sensible, so if you're not sure,
6609 just accept the default.
6612 rp='List of earlier versions to include in @INC?'
6615 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
6616 *) inc_version_list="$ans" ;;
6618 case "$inc_version_list" in
6620 inc_version_list_init='0'
6621 d_inc_version_list="$undef"
6623 *) inc_version_list_init=`echo $inc_version_list |
6624 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6625 d_inc_version_list="$define"
6630 : see if malloc/malloc.h has to be included
6631 set malloc/malloc.h i_mallocmalloc
6634 : see if this is a malloc.h system
6635 : we want a real compile instead of Inhdr because some systems have a
6636 : malloc.h that just gives a compile error saying to use stdlib.h instead
6641 #$i_mallocmalloc I_MALLOCMALLOC
6642 #ifdef I_MALLOCMALLOC
6643 # include <malloc/malloc.h>
6646 int main () { return 0; }
6649 if eval $compile; then
6650 echo "<malloc.h> found." >&4
6653 echo "<malloc.h> NOT found." >&4
6660 : check for void type
6662 echo "Checking to see how well your C compiler groks the void type..." >&4
6663 case "$voidflags" in
6675 extern void moo(); /* function returning void */
6676 void (*goo)(); /* ptr to func returning void */
6678 void *hue; /* generic ptr */
6691 int main() { sub(); }
6693 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
6694 voidflags=$defvoidused
6695 echo "Good. It appears to support void to the level $package wants.">&4
6696 if $contains warning .out >/dev/null 2>&1; then
6697 echo "However, you might get some warnings that look like this:"
6701 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
6702 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
6703 echo "It supports 1..."
6704 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
6705 echo "It also supports 2..."
6706 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
6708 echo "And it supports 4 but not 8 definitely."
6710 echo "It doesn't support 4..."
6711 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
6713 echo "But it supports 8."
6716 echo "Neither does it support 8."
6720 echo "It does not support 2..."
6721 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
6723 echo "But it supports 4 and 8."
6725 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
6727 echo "And it supports 4 but has not heard about 8."
6729 echo "However it supports 8 but not 4."
6734 echo "There is no support at all for void."
6739 case "$voidflags" in
6742 Support flag bits are:
6743 1: basic void declarations.
6744 2: arrays of pointers to functions returning void.
6745 4: operations between pointers to and addresses of void functions.
6746 8: generic void pointers.
6749 rp="Your void support flags add up to what?"
6756 : check for length of pointer
6760 echo "Checking to see how big your pointers are..." >&4
6761 if test "$voidflags" -gt 7; then
6762 echo '#define VOID_PTR char *' > try.c
6764 echo '#define VOID_PTR void *' > try.c
6774 printf("%d\n", (int)sizeof(VOID_PTR));
6779 if eval $compile_ok; then
6780 ptrsize=`$run ./try`
6781 echo "Your pointers are $ptrsize bytes long."
6784 echo "(I can't seem to compile the test program. Guessing...)" >&4
6785 rp="What is the size of a pointer (in bytes)?"
6792 case "$use64bitall" in
6793 "$define"|true|[yY]*)
6797 *** You have chosen a maximally 64-bit build,
6798 *** but your pointers are only 4 bytes wide.
6799 *** Please rerun Configure without -Duse64bitall.
6804 *** Since you have quads, you could possibly try with -Duse64bitint.
6809 *** Cannot continue, aborting.
6820 : determine whether to use malloc wrapping
6822 case "$usemallocwrap" in
6823 [yY]*|true|$define) dflt='y' ;;
6824 [nN]*|false|$undef) dflt='n' ;;
6825 *) case "$usedevel" in
6826 [yY]*|true|$define) dflt='y' ;;
6831 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
6833 usemallocwrap="$ans"
6836 usemallocwrap="$define" ;;
6838 usemallocwrap="$undef" ;;
6841 : determine which malloc to compile in
6843 case "$usemymalloc" in
6844 [yY]*|true|$define) dflt='y' ;;
6845 [nN]*|false|$undef) dflt='n' ;;
6846 *) case "$ptrsize" in
6852 rp="Do you wish to attempt to use the malloc that comes with $package?"
6858 mallocsrc='malloc.c'
6859 mallocobj="malloc$_o"
6860 d_mymalloc="$define"
6863 : Remove malloc from list of libraries to use
6864 echo "Removing unneeded -lmalloc from library list" >&4
6865 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6868 echo "libs = $libs" >&4
6880 : compute the return types of malloc and free
6882 $cat >malloc.c <<END
6886 #include <sys/types.h>
6900 case "$malloctype" in
6902 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6909 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6913 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6920 echo "Your system uses $freetype free(), it would seem." >&4
6922 : determine where site specific architecture-dependent libraries go.
6923 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6924 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6925 : sitelib may have an optional trailing /share.
6927 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6928 dflt="$dflt/$archname"
6933 set sitearch sitearch none
6937 The installation process will also create a directory for
6938 architecture-dependent site-specific extensions and modules.
6942 rp='Pathname for the site-specific architecture-dependent library files?'
6946 if $test X"$sitearch" = X"$sitelib"; then
6949 d_sitearch="$define"
6952 : Set the vendorprefix variables
6955 The installation process will also create a directory for
6956 vendor-supplied add-ons. Vendors who supply perl with their system
6957 may find it convenient to place all vendor-supplied files in this
6958 directory rather than in the main distribution directory. This will
6959 ease upgrades between binary-compatible maintenance versions of perl.
6961 Of course you may also use these directories in whatever way you see
6962 fit. For example, you might use them to access modules shared over a
6963 company-wide network.
6965 The default answer should be fine for most people.
6966 This causes further questions about vendor add-ons to be skipped
6967 and no vendor-specific directories will be configured for perl.
6970 rp='Do you want to configure vendor-specific add-on directories?'
6971 case "$usevendorprefix" in
6972 define|true|[yY]*) dflt=y ;;
6973 *) : User may have set vendorprefix directly on Configure command line.
6974 case "$vendorprefix" in
6983 rp='Installation prefix to use for vendor-supplied add-ons?'
6984 case "$vendorprefix" in
6986 *) dflt=$vendorprefix ;;
6989 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6991 case "$vendorprefix" in
6995 *) oldvendorprefix="$prefix";;
6999 usevendorprefix="$define"
7001 vendorprefixexp="$ansexp"
7003 *) usevendorprefix="$undef"
7009 : Set the vendorlib variables
7010 case "$vendorprefix" in
7011 '') d_vendorlib="$undef"
7015 *) d_vendorlib="$define"
7016 : determine where vendor-supplied modules go.
7017 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
7018 case "$vendorlib" in
7020 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7021 case "$installstyle" in
7022 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
7023 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
7026 *) dflt="$vendorlib"
7030 rp='Pathname for the vendor-supplied library files?'
7033 vendorlibexp="$ansexp"
7036 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
7040 : Set the vendorarch variables
7041 case "$vendorprefix" in
7042 '') d_vendorarch="$undef"
7046 *) d_vendorarch="$define"
7047 : determine where vendor-supplied architecture-dependent libraries go.
7048 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
7049 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
7050 : vendorlib may have an optional trailing /share.
7051 case "$vendorarch" in
7052 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
7053 dflt="$dflt/$archname"
7055 *) dflt="$vendorarch" ;;
7058 rp='Pathname for vendor-supplied architecture-dependent files?'
7061 vendorarchexp="$ansexp"
7064 prefixvar=vendorarch
7066 if $test X"$vendorarch" = X"$vendorlib"; then
7067 d_vendorarch="$undef"
7069 d_vendorarch="$define"
7072 : Final catch-all directories to search
7075 Lastly, you can have perl look in other directories for extensions and
7076 modules in addition to those already specified.
7077 These directories will be searched after
7081 test X"$vendorlib" != "X" && echo ' ' $vendorlib
7082 test X"$vendorarch" != "X" && echo ' ' $vendorarch
7084 case "$otherlibdirs" in
7085 ''|' ') dflt='none' ;;
7086 *) dflt="$otherlibdirs" ;;
7089 Enter a colon-separated set of extra paths to include in perl's @INC
7090 search path, or enter 'none' for no extra paths.
7094 rp='Colon-separated list of additional directories for perl to search?'
7097 ' '|''|none) otherlibdirs=' ' ;;
7098 *) otherlibdirs="$ans" ;;
7100 case "$otherlibdirs" in
7104 set d_perl_otherlibdirs
7107 : Cruising for prototypes
7109 echo "Checking out function prototypes..." >&4
7110 $cat >prototype.c <<EOCP
7115 int main(int argc, char *argv[]) {
7118 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
7119 echo "Your C compiler appears to support function prototypes."
7122 echo "Your C compiler doesn't seem to understand function prototypes."
7129 : Check if ansi2knr is required
7130 case "$prototype" in
7132 *) ansi2knr='ansi2knr'
7137 This version of $package can only be compiled by a compiler that
7138 understands function prototypes. Unfortunately, your C compiler
7140 doesn't seem to understand them. Sorry about that.
7142 If GNU cc is available for your system, perhaps you could try that instead.
7144 Eventually, we hope to support building Perl with pre-ANSI compilers.
7145 If you would like to help in that effort, please contact <perlbug@perl.org>.
7147 Aborting Configure now.
7154 dflt_dtrace='/usr/sbin/dtrace'
7155 $test -x /usr/bin/dtrace && dflt_dtrace='/usr/bin/dtrace'
7159 Perl can be built to support DTrace on platforms that support it.
7160 DTrace is a diagnosis and performance analysis tool from Sun.
7162 If this doesn't make any sense to you, just accept the default '$dflt'.
7166 case "$usedtrace" in
7172 dflt_dtrace=$usedtrace
7179 rp='Support DTrace if available?'
7182 y|Y) val="$define" ;;
7188 test "X$usedtrace" != "X$define" && break
7191 rp='Where is the dtrace executable?'
7200 if $dtrace -h -s ../perldtrace.d \
7201 -o perldtrace.tmp >/dev/null 2>&1 \
7202 && rm -f perldtrace.tmp
7205 echo "Good: your $dtrace knows about the -h flag."
7209 *** $me: Fatal Error: $dtrace doesn't support -h flag
7211 *** Your installed dtrace doesn't support the -h switch to compile a D
7212 *** program into a C header. Can't continue.
7224 *** $me: Fatal Error: $dtrace not found.
7231 echo "*** $dtrace was not found."
7237 : See if we want extra modules installed
7244 Perl can be built with extra modules or bundles of modules which
7245 will be fetched from the CPAN and installed alongside Perl.
7247 Notice that you will need access to the CPAN; either via the Internet,
7248 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
7249 be asked later to configure the CPAN.pm module which will in turn do
7250 the installation of the rest of the extra modules or bundles.)
7252 Notice also that if the modules require any external software such as
7253 libraries and headers (the libz library and the zlib.h header for the
7254 Compress::Zlib module, for example) you MUST have any such software
7255 already installed, this configuration process will NOT install such
7258 If this doesn't make any sense to you, just accept the default '$dflt'.
7260 rp='Install any extra modules (y or n)?'
7266 Please list any extra modules or bundles to be installed from CPAN,
7267 with spaces between the names. The names can be in any format the
7268 'install' command of CPAN.pm will understand. (Answer 'none',
7269 without the quotes, to install no extra modules or bundles.)
7279 $rm -f ../extras.lst
7281 *) echo "(Saving the list of extras for later...)"
7282 echo "$extras" > ../extras.lst
7290 : determine where html pages for programs go
7291 set html1dir html1dir none
7295 If you wish to install html files for programs in $spackage, indicate
7296 the appropriate directory here. To skip installing html files,
7300 ''|none|$undef|' ') dflt=none ;;
7301 *) dflt=$html1dir ;;
7304 rp="Directory for the main $spackage html pages?"
7308 : Use ' ' for none so value is preserved next time through Configure
7309 $test X"$html1dir" = "X" && html1dir=' '
7311 : determine where html pages for libraries and modules go
7312 set html3dir html3dir none
7316 If you wish to install html files for modules associated with $spackage,
7317 indicate the appropriate directory here. To skip installing html files,
7320 : There is no obvious default. If they have specified html1dir, then
7321 : try to key off that, possibly changing .../html1 into .../html3.
7323 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
7324 *) dflt=$html3dir ;;
7327 rp="Directory for the $spackage module html pages?"
7331 : Use ' ' for none so value is preserved next time through Configure
7332 $test X"$html3dir" = "X" && html3dir=' '
7334 : determine whether to install perl also as /usr/bin/perl
7337 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
7339 Many scripts expect perl to be installed as /usr/bin/perl.
7341 If you want to, I can install the perl you are about to compile
7342 as /usr/bin/perl (in addition to $bin/perl).
7344 if test -f /usr/bin/perl; then
7347 However, please note that because you already have a /usr/bin/perl,
7348 overwriting that with a new Perl would very probably cause problems.
7349 Therefore I'm assuming you don't want to do that (unless you insist).
7352 case "$installusrbinperl" in
7353 "$define"|[yY]*) dflt='y';;
7359 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
7362 case "$installusrbinperl" in
7363 "$undef"|[nN]*) dflt='n';;
7367 rp="Do you want to install perl as /usr/bin/perl?"
7370 [yY]*) val="$define";;
7376 set installusrbinperl
7379 : Check if we are using the GNU C library
7381 echo "Checking for GNU C Library..." >&4
7383 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
7384 alone are insufficient to distinguish different versions, such as
7385 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
7386 libc version 2.1.0. A. Dougherty, June 3, 2002.
7392 # ifdef __GLIBC_MINOR__
7393 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
7394 # include <gnu/libc-version.h>
7395 printf("%s\n", gnu_get_libc_version());
7397 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
7400 printf("%d\n", __GLIBC__);
7409 if eval $compile_ok && $run ./try > glibc.ver; then
7411 gnulibc_version=`$cat glibc.ver`
7412 echo "You are using the GNU C Library version $gnulibc_version"
7416 echo "You are not using the GNU C Library"
7422 : see if nm is to be used to determine whether a symbol is defined or not
7426 case "$d_gnulibc" in
7429 echo "nm probably won't work on the GNU C Library." >&4
7435 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
7437 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
7438 echo "'nm' won't be sufficient on this sytem." >&4
7444 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
7445 if $test $dflt -gt 20; then
7455 true|$define) dflt=y;;
7462 I can use $nm to extract the symbols from your C libraries. This
7463 is a time consuming task which may generate huge output on the disk (up
7464 to 3 megabytes) but that should make the symbols extraction faster. The
7465 alternative is to skip the 'nm' extraction part and to compile a small
7466 test program instead to determine whether each symbol is present. If
7467 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
7468 this may be the best solution.
7470 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
7473 rp="Shall I use $nm to extract C symbols from the libraries?"
7476 [Nn]*) usenm=false;;
7485 : nm options which may be necessary
7487 '') if $test -f /mach_boot; then
7489 elif $test -d /usr/ccs/lib; then
7490 nm_opt='-p' # Solaris (and SunOS?)
7491 elif $test -f /dgux; then
7493 elif $test -f /lib64/rld; then
7494 nm_opt='-p' # 64-bit Irix
7500 : nm options which may be necessary for shared libraries but illegal
7501 : for archive libraries. Thank you, Linux.
7502 case "$nm_so_opt" in
7503 '') case "$myuname" in
7505 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
7506 nm_so_opt='--dynamic'
7513 : Figure out where the libc is located
7516 : get list of predefined functions in a handy place
7521 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
7527 *) for thislib in $libs; do
7530 : Handle C library specially below.
7533 thislib=`echo $thislib | $sed -e 's/^-l//'`
7534 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
7536 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
7538 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
7540 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
7542 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
7544 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
7546 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
7551 libnames="$libnames $try"
7553 *) libnames="$libnames $thislib" ;;
7562 for xxx in $libpth; do
7563 $test -r $1 || set $xxx/libc.$so
7564 : The messy sed command sorts on library version numbers.
7566 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
7567 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
7569 s/[0-9][0-9]*/0000&/g
7570 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
7573 $sort | $sed -e 's/^.* //'`
7576 $test -r $1 || set /usr/ccs/lib/libc.$so
7577 $test -r $1 || set /lib/libsys_s$_a
7583 if $test -r "$1"; then
7584 echo "Your (shared) C library seems to be in $1."
7586 elif $test -r /lib/libc && $test -r /lib/clib; then
7587 echo "Your C library seems to be in both /lib/clib and /lib/libc."
7589 libc='/lib/clib /lib/libc'
7590 if $test -r /lib/syslib; then
7591 echo "(Your math library is in /lib/syslib.)"
7592 libc="$libc /lib/syslib"
7594 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7595 echo "Your C library seems to be in $libc, as you said before."
7596 elif $test -r $incpath/usr/lib/libc$_a; then
7597 libc=$incpath/usr/lib/libc$_a;
7598 echo "Your C library seems to be in $libc. That's fine."
7599 elif $test -r /lib/libc$_a; then
7601 echo "Your C library seems to be in $libc. You're normal."
7603 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
7605 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
7606 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
7607 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
7609 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7611 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7614 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
7616 if $test -r "$tans"; then
7617 echo "Your C library seems to be in $tans, of all places."
7623 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7627 If the guess above is wrong (which it might be if you're using a strange
7628 compiler, or your machine supports multiple models), you can override it here.
7633 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
7635 I can't seem to find your C library. I've looked in the following places:
7638 $sed 's/^/ /' libpath
7641 None of these seems to contain your C library. I need to get its name...
7646 rp='Where is your C library?'
7651 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
7652 set X `cat libnames`
7655 case $# in 1) xxx=file; esac
7656 echo "Extracting names from the following $xxx for later perusal:" >&4
7658 $sed 's/^/ /' libnames >&4
7660 $echo $n "This may take a while...$c" >&4
7664 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
7665 *) $nm $nm_opt $file 2>/dev/null;;
7670 $grep fprintf libc.tmp > libc.ptf
7671 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
7672 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
7674 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
7676 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7678 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
7680 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7682 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
7684 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7686 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
7688 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7690 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
7692 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7694 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
7696 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7698 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
7699 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
7701 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7703 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
7705 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7707 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
7709 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7711 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
7713 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7715 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
7717 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7719 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
7721 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7723 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
7725 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7727 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
7729 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7732 $nm -p $* 2>/dev/null >libc.tmp
7733 $grep fprintf libc.tmp > libc.ptf
7734 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
7735 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
7741 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
7743 if $ar t $libc > libc.tmp && \
7744 $contains '^fprintf$' libc.tmp >/dev/null 2>&1
7746 for thisname in $libnames $libc; do
7747 $ar t $thisname >>libc.tmp
7749 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
7751 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
7752 for thisname in $libnames $libc; do
7753 $ar tv $thisname >>libc.tmp
7754 emximp -o tmp.imp $thisname \
7756 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
7757 < tmp.imp >>libc.tmp
7760 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
7763 echo "$ar didn't seem to work right." >&4
7764 echo "Maybe this is a Cray...trying bld instead..." >&4
7766 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list &&
7769 for thisname in $libnames; do
7771 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
7772 $ar t $thisname >>libc.tmp
7776 echo "That didn't work either. Giving up." >&4
7786 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
7787 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
7789 *) if $test -f /lib/syscalls.exp; then
7791 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
7792 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' \
7793 /lib/syscalls.exp >>libc.list
7799 $rm -f libnames libpath
7801 : see if dld is available
7805 : Check if we are using C++
7807 echo "Checking for C++..." >&4
7808 $cat >try.c <<'EOCP'
7820 if eval $compile_ok && $run ./try; then
7822 echo "You are using a C++ compiler."
7825 echo "You are not using a C++ compiler."
7831 : is a C symbol defined?
7834 -v) tf=libc.tmp; tdc="";;
7835 -a) tf=libc.tmp; tdc="[]";;
7836 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
7838 case "$d_cplusplus" in
7839 $define) extern_C="extern \"C\"" ;;
7840 *) extern_C="extern" ;;
7843 case "$reuseval-$4" in
7845 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
7850 if $test "$runnm" = true; then
7851 if $contains $tlook $tf >/dev/null 2>&1; then
7853 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
7854 echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7855 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
7856 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
7860 echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7861 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
7867 $define) tval=true;;
7874 : define an is-in-libc? function
7875 inlibc='echo " "; td=$define; tu=$undef;
7876 sym=$1; var=$2; eval "was=\$$2";
7878 case "$reuseval$was" in
7888 echo "$sym() found." >&4;
7889 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
7891 echo "$sym() NOT found." >&4;
7892 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
7896 $define) echo "$sym() found." >&4;;
7897 *) echo "$sym() NOT found." >&4;;
7901 : see if dlopen exists
7903 xxx_ccflags="$ccflags"
7905 : with g++ one needs -shared to get is-in-libc to work for dlopen
7906 case "$gccversion" in
7908 *) case "$d_cplusplus" in
7909 "$define") ccflags="$ccflags -shared" ;;
7916 ccflags="$xxx_ccflags"
7918 : see if this is a unistd.h system
7919 set unistd.h i_unistd
7922 : determine which dynamic loading, if any, to compile in
7924 dldir="ext/DynaLoader"
7937 $define) dflt='y' ;;
7940 $define) dflt='y' ;;
7942 : Does a dl_xxx.xs file exist for this operating system
7943 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
7946 rp="Do you wish to use dynamic loading?"
7954 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
7955 dflt="$dldir/dl_${osname}.xs"
7956 elif $test "$d_dlopen" = "$define" ; then
7957 dflt="$dldir/dl_dlopen.xs"
7958 elif $test "$i_dld" = "$define" ; then
7959 dflt="$dldir/dl_dld.xs"
7964 *) dflt="$dldir/$dlsrc"
7967 echo "The following dynamic loading files are available:"
7968 : Can not go over to $dldir because getfile has path hard-coded in.
7969 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
7970 rp="Source file to use for dynamic loading"
7976 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
7980 Some systems may require passing special flags to $cc -c to
7981 compile modules that will be used to create a shared library.
7982 To use no flags, say "none".
7985 case "$cccdlflags" in
7986 '') case "$gccversion" in
7987 '') case "$osname" in
7989 next) dflt='none' ;;
7990 irix*) dflt='-KPIC' ;;
7991 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
7992 sunos) dflt='-pic' ;;
7996 *) case "$osname" in
7997 darwin) dflt='none' ;;
7998 linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
8003 *) dflt="$cccdlflags" ;;
8005 rp="Any special flags to pass to $cc -c to compile shared library modules?"
8008 none) cccdlflags=' ' ;;
8009 *) cccdlflags="$ans" ;;
8014 Some systems use ld to create libraries that can be dynamically loaded,
8015 while other systems (such as those using ELF) use $cc.
8019 '') $cat >try.c <<EOM
8020 /* Test for whether ELF binaries are produced */
8032 int i = open("a.out",O_RDONLY);
8035 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
8036 exit(0); /* succeed (yes, it's ELF) */
8041 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
8043 You appear to have ELF support. I'll use $cc to build dynamic libraries.
8048 echo "I'll use ld to build dynamic libraries."
8057 rp="What command should be used to create dynamic libraries?"
8063 Some systems may require passing special flags to $ld to create a
8064 library that can be dynamically loaded. If your ld flags include
8065 -L/other/path options to locate libraries outside your loader's normal
8066 search path, you may need to specify those -L options here as well. To
8067 use no flags, say "none".
8070 case "$lddlflags" in
8071 '') case "$osname" in
8072 beos) dflt='-nostart' ;;
8073 haiku) dflt='-shared' ;;
8075 case "$gccversion" in
8076 '') dflt="$dflt +vnocompatwarnings" ;;
8079 linux|irix*|gnu*) dflt="-shared $optimize" ;;
8080 next) dflt='none' ;;
8081 solaris) dflt='-G' ;;
8082 sunos) dflt='-assert nodefinitions' ;;
8083 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
8087 *) dflt="$lddlflags" ;;
8090 : Try to guess additional flags to pick up local libraries.
8091 : Be careful not to append to a plain 'none'
8095 for thisflag in $ldflags; do
8100 *) dflt="$dflt $thisflag" ;;
8107 ''|' ') dflt='none' ;;
8111 *-fstack-protector*)
8113 *-fstack-protector*) ;; # Don't add it again
8114 *) dflt="$dflt -fstack-protector" ;;
8120 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
8123 none) lddlflags=' ' ;;
8124 *) lddlflags="$ans" ;;
8129 Some systems may require passing special flags to $cc to indicate that
8130 the resulting executable will use dynamic linking. To use no flags,
8134 case "$ccdlflags" in
8135 '') case "$osname" in
8136 linux|hpux|gnu*) dflt='-Wl,-E' ;;
8137 next|sunos) dflt='none' ;;
8141 *) dflt="$ccdlflags" ;;
8143 rp="Any special flags to pass to $cc to use dynamic linking?"
8146 none) ccdlflags=' ' ;;
8147 *) ccdlflags="$ans" ;;
8158 : Do we want a shared libperl?
8162 # No dynamic loading being used, so don't bother even to prompt.
8165 *) case "$useshrplib" in
8166 '') case "$osname" in
8167 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|haiku|cygwin*)
8169 also='Building a shared libperl is required for dynamic loading to work on your system.'
8174 also='Building a shared libperl is needed for MAB support.'
8192 The perl executable is normally obtained by linking perlmain.c with
8193 libperl${_a}, any static extensions (usually just DynaLoader), and
8194 any other libraries needed on this system (such as -lm, etc.). Since
8195 your system supports dynamic loading, it is probably possible to build
8196 a shared libperl.$so. If you will have more than one executable linked
8197 to libperl.$so, this will significantly reduce the size of each
8198 executable, but it may have a noticeable effect on performance. The
8199 default is probably sensible for your system.
8203 rp="Build a shared libperl.$so (y/n)"
8207 useshrplib='true' ;;
8208 *) useshrplib='false' ;;
8213 case "$useshrplib" in
8215 case "$userelocatableinc" in
8217 echo "Cannot build with both -Duserelocatableinc and -Duseshrplib" >&4
8218 echo "See INSTALL for an explanation why that won't work." >&4
8224 # Figure out a good name for libperl.so. Since it gets stored in
8225 # a version-specific architecture-dependent library, the version
8226 # number isn't really that important, except for making cc/ld happy.
8228 # A name such as libperl.so.10.1
8229 majmin="libperl.$so.$patchlevel.$subversion"
8230 # A name such as libperl.so.100
8231 majonly=`echo $patchlevel $subversion |
8232 $awk '{printf "%d%02d", $1, $2}'`
8233 majonly=libperl.$so.$majonly
8234 # I'd prefer to keep the os-specific stuff here to a minimum, and
8235 # rely on figuring it out from the naming of libc.
8236 case "${osname}${osvers}" in
8239 # XXX How handle the --version stuff for MAB?
8241 linux*|gnu*) # ld won't link with a bare -lperl otherwise.
8244 cygwin*) # ld links now against the dll directly
8245 majmin="cygperl5_${patchlevel}_${subversion}.${so}"
8246 majonly=`echo $patchlevel $subversion |
8247 $awk '{printf "%03d%03d", $1, $2}'`
8248 majonly=cygperl5.$majonly.$so
8251 *) # Try to guess based on whether libc has major.minor.
8253 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8254 *libc.$so.[0-9]*) dflt=$majonly ;;
8255 *) dflt=libperl.$so ;;
8265 I need to select a good name for the shared libperl. If your system uses
8266 library names with major and minor numbers, then you might want something
8267 like $majmin. Alternatively, if your system uses a single version
8268 number for shared libraries, then you might want to use $majonly.
8269 Or, your system might be quite happy with a simple libperl.$so.
8271 Since the shared libperl will get installed into a version-specific
8272 architecture-dependent directory, the version number of the shared perl
8273 library probably isn't important, so the default should be o.k.
8276 rp='What name do you want to give to the shared libperl?'
8279 echo "Ok, I'll use $libperl"
8282 libperl="libperl${_a}"
8286 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8290 WARNING: Use of the shrpdir variable for the installation location of
8291 the shared $libperl is not supported. It was never documented and
8292 will not work in this version. Let me (perlbug@perl.org)
8293 know of any problems this may cause.
8299 But your current setting of $shrpdir is
8300 the default anyway, so it's harmless.
8305 Further, your current attempted setting of $shrpdir
8306 conflicts with the value of $archlibexp/CORE
8307 that installperl will use.
8314 # How will the perl executable find the installed shared $libperl?
8315 # Add $xxx to ccdlflags.
8316 # If we can't figure out a command-line option, use $shrpenv to
8317 # set env LD_RUN_PATH. The main perl makefile uses this.
8318 shrpdir=$archlibexp/CORE
8321 if "$useshrplib"; then
8324 # We'll set it in Makefile.SH...
8329 freebsd|netbsd|openbsd|interix|dragonfly)
8330 xxx="-Wl,-R$shrpdir"
8332 bsdos|linux|irix*|dec_osf|gnu*)
8333 xxx="-Wl,-rpath,$shrpdir"
8336 # next doesn't like the default...
8339 # beos doesn't like the default, either.
8342 # Haiku doesn't like the default, either.
8345 # hpux doesn't like the default, either.
8346 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8349 # cygwin needs only ldlibpth
8352 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8358 # Only add $xxx if it isn't already in ccdlflags.
8359 case " $ccdlflags " in
8361 *) ccdlflags="$ccdlflags $xxx"
8364 Adding $xxx to the flags
8365 passed to $ld so that the perl executable will find the
8366 installed shared $libperl.
8374 # Fix ccdlflags in AIX for building external extensions.
8375 # (For building Perl itself bare -bE:perl.exp is needed,
8376 # Makefile.SH takes care of this.)
8378 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8380 # Respect a hint or command-line value.
8382 '') shrpenv="$tmp_shrpenv" ;;
8384 case "$ldlibpthname" in
8385 '') ldlibpthname=LD_LIBRARY_PATH ;;
8386 none) ldlibpthname='' ;;
8389 : determine where manual pages are on this system
8393 syspath='/usr/share/man/man1 /usr/man/man1'
8394 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8395 syspath="$syspath /usr/man/u_man/man1"
8396 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8397 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8398 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8399 sysman=`./loc . /usr/man/man1 $syspath`
8402 if $test -d "$sysman"; then
8403 echo "System manual is in $sysman." >&4
8405 echo "Could not find manual pages in source form." >&4
8408 : determine where manual pages go
8409 set man1dir man1dir none
8413 $spackage has manual pages available in source form.
8417 echo "However, you don't have nroff, so they're probably useless to you."
8419 '') man1dir="none";;
8422 echo "If you don't want the manual sources installed, answer 'none'."
8427 lookpath="$prefixexp/share/man/man1"
8428 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8429 lookpath="$lookpath $prefixexp/man/p_man/man1"
8430 lookpath="$lookpath $prefixexp/man/u_man/man1"
8431 lookpath="$lookpath $prefixexp/man/man.1"
8433 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8434 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8444 rp="Where do the main $spackage manual pages (source) go?"
8446 if $test "X$man1direxp" != "X$ansexp"; then
8457 : What suffix to use on installed man pages
8464 rp="What suffix should be used for the main $spackage man pages?"
8466 '') case "$man1dir" in
8480 *) dflt="$man1ext";;
8487 : see if we can have long filenames
8489 first=123456789abcdef
8491 if (echo hi >$first) 2>/dev/null; then
8492 if $test -f 123456789abcde; then
8493 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8496 echo 'You can have filenames longer than 14 characters.'>&4
8501 You can't have filenames longer than 14 chars.
8502 You can't even think about them!
8508 $rm -rf 123456789abcde*
8510 : determine where library module manual pages go
8511 set man3dir man3dir none
8515 $spackage has manual pages for many of the library modules.
8521 However, you don't have nroff, so they're probably useless to you.
8524 '') man3dir="none";;
8528 case "$d_flexfnam" in
8531 However, your system can't handle the long file names like File::Basename.3.
8534 '') man3dir="none";;
8538 echo "If you don't want the manual sources installed, answer 'none'."
8539 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8541 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8542 if $test -d "$privlib/man/man3"; then
8545 WARNING: Previous versions of perl installed man3 pages into
8546 $privlib/man/man3. This version will suggest a
8547 new default of $dflt.
8551 rp='Do you wish to preserve the old behavior?(y/n)'
8554 y*) dflt="$privlib/man/man3" ;;
8559 *) dflt="$man3dir" ;;
8566 rp="Where do the $package library man pages (source) go?"
8576 : What suffix to use on installed man pages
8582 rp="What suffix should be used for the $package library man pages?"
8584 '') case "$man3dir" in
8598 *) dflt="$man3ext";;
8605 : see if we have to deal with yellow pages, now NIS.
8606 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8607 if $test -f /usr/etc/nibindd; then
8609 echo "I'm fairly confident you're on a NeXT."
8611 rp='Do you get the hosts file via NetInfo?'
8620 y*) hostcat='nidump hosts .';;
8621 *) case "$hostcat" in
8622 nidump*) hostcat='';;
8632 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8640 rp='Are you getting the hosts file via yellow pages?'
8643 y*) hostcat='ypcat hosts';;
8644 *) hostcat='cat /etc/hosts';;
8650 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8653 '') test -f /etc/group && groupcat='cat /etc/group';;
8656 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8659 : now get the host name
8661 echo "Figuring out host name..." >&4
8662 case "$myhostname" in
8664 echo 'Maybe "hostname" will work...'
8665 if tans=`sh -c hostname 2>&1` ; then
8673 if $test "$cont"; then
8675 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8676 if tans=`cat /etc/systemid 2>&1` ; then
8678 phostname='cat /etc/systemid'
8679 echo "Whadyaknow. Xenix always was a bit strange..."
8682 elif $test -r /etc/systemid; then
8683 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8686 if $test "$cont"; then
8687 echo 'No, maybe "uuname -l" will work...'
8688 if tans=`sh -c 'uuname -l' 2>&1` ; then
8690 phostname='uuname -l'
8692 echo 'Strange. Maybe "uname -n" will work...'
8693 if tans=`sh -c 'uname -n' 2>&1` ; then
8695 phostname='uname -n'
8697 echo 'Oh well, maybe I can mine it out of whoami.h...'
8698 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8699 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8700 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8702 case "$myhostname" in
8703 '') echo "Does this machine have an identity crisis or something?"
8706 echo "Well, you said $myhostname before..."
8707 phostname='echo $myhostname';;
8713 case "$myhostname" in
8714 '') myhostname=noname ;;
8716 : you do not want to know about this
8721 if $test "$myhostname" ; then
8723 rp='Your host name appears to be "'$myhostname'".'" Right?"
8731 : bad guess or no guess
8732 while $test "X$myhostname" = X ; do
8734 rp="Please type the (one word) name of your host:"
8739 : translate upper to lower if necessary
8740 case "$myhostname" in
8742 echo "(Normalizing case in your host name)"
8743 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8747 case "$myhostname" in
8749 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8750 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8751 echo "(Trimming domain name from host name--host name is now $myhostname)"
8753 *) case "$mydomain" in
8756 test "X$hostcat" = "Xypcat hosts" &&
8757 ypmatch "$myhostname" hosts 2>/dev/null |\
8758 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8761 test "X$hostcat" != "X" &&
8762 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8763 /[ ]$myhostname[ . ]/p" > hosts
8766 if $test -f hosts; then
8767 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8768 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8769 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8770 hosts | $sort | $uniq | \
8771 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8772 case `$echo X$dflt` in
8773 X*\ *) echo "(Several hosts in the database matched hostname)"
8776 X.) echo "(You do not have fully-qualified names in the hosts database)"
8780 echo "(I cannot locate a hosts database anywhere)"
8785 tans=`./loc resolv.conf X /etc /usr/etc`
8786 if $test -f "$tans"; then
8787 echo "(Attempting domain name extraction from $tans)"
8788 dflt=.`$sed -n -e 's/ / /g' \
8789 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8792 .) dflt=.`$sed -n -e 's/ / /g' \
8793 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8801 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8802 dflt=.`sh -c domainname 2>/dev/null`
8805 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8809 case "$dflt$osname" in
8810 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
8811 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
8815 .) echo "(Lost all hope -- silly guess then)"
8821 *) dflt="$mydomain";;
8825 rp="What is your domain name?"
8835 : translate upper to lower if necessary
8838 echo "(Normalizing case in your domain name)"
8839 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
8843 : a little sanity check here
8844 case "$phostname" in
8847 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
8848 $myhostname$mydomain|$myhostname) ;;
8850 case "$phostname" in
8852 echo "(That doesn't agree with your whoami.h file, by the way.)"
8855 echo "(That doesn't agree with your $phostname command, by the way.)"
8863 : determine the e-mail address of the user who is running us
8866 I need to get your e-mail address in Internet format if possible, i.e.
8867 something like user@host.domain. Please answer accurately since I have
8868 no easy means to double check it. The default value provided below
8869 is most probably close to reality but may not be valid from outside
8870 your organization...
8874 while test "$cont"; do
8876 '') dflt="$cf_by@$myhostname$mydomain";;
8877 *) dflt="$cf_email";;
8879 rp='What is your e-mail address?'
8885 rp='Address does not look like an Internet one. Use it anyway?'
8899 : Ask e-mail of administrator
8902 If you or somebody else will be maintaining perl at your site, please
8903 fill in the correct e-mail address here so that they may be contacted
8904 if necessary. Currently, the "perlbug" program included with perl
8905 will send mail to this address in addition to perlbug@perl.org. You may
8906 enter "none" for no administrator.
8909 case "$perladmin" in
8910 '') dflt="$cf_email";;
8911 *) dflt="$perladmin";;
8913 rp='Perl administrator e-mail address'
8917 : determine whether to only install version-specific parts.
8920 Do you want to install only the version-specific parts of the perl
8921 distribution? Usually you do *not* want to do this.
8923 case "$versiononly" in
8924 "$define"|[Yy]*|true) dflt='y' ;;
8927 rp="Do you want to install only the version-specific parts of perl?"
8930 [yY]*) val="$define";;
8936 case "$versiononly" in
8937 "$define") inc_version_list=''
8938 inc_version_list_init=0
8942 : figure out how to guarantee perl startup
8943 : XXX Note that this currently takes advantage of the bug that binexp ignores
8944 : the Configure -Dinstallprefix setting, which in turn means that under
8945 : relocatable @INC, initialinstalllocation is what binexp started as.
8946 case "$startperl" in
8948 case "$sharpbang" in
8952 I can use the #! construct to start perl on your system. This will
8953 make startup of perl scripts faster, but may cause problems if you
8954 want to share those scripts and perl is not in a standard place
8955 ($initialinstalllocation/perl) on all your platforms. The alternative
8956 is to force a shell by starting the script with a single ':' character.
8959 case "$versiononly" in
8960 "$define") dflt="$initialinstalllocation/perl$version";;
8961 *) dflt="$initialinstalllocation/perl";;
8963 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
8966 none) startperl=": # use perl";;
8967 *) startperl="#!$ans"
8968 if $test 30 -lt `echo "$ans" | wc -c`; then
8971 WARNING: Some systems limit the #! command to 32 characters.
8972 If you experience difficulty running Perl scripts with #!, try
8973 installing Perl in a directory with a shorter pathname.
8979 *) startperl=": # use perl"
8984 echo "I'll use $startperl to start perl scripts."
8986 : figure best path for perl in scripts
8989 case "$versiononly" in
8990 "$define") perlpath="$initialinstalllocation/perl$version";;
8991 *) perlpath="$initialinstalllocation/perl";;
8993 case "$startperl" in
8998 I will use the "eval 'exec'" idiom to start Perl on your system.
8999 I can use the full path of your Perl binary for this purpose, but
9000 doing so may cause problems if you want to share those scripts and
9001 Perl is not always in a standard place ($initialinstalllocation/perl).
9004 dflt="$initialinstalllocation/perl"
9005 rp="What path shall I use in \"eval 'exec'\"?"
9012 case "$startperl" in
9014 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
9017 : determine where public executable scripts go
9018 set scriptdir scriptdir
9020 case "$scriptdir" in
9023 : guess some guesses
9024 $test -d /usr/share/scripts && dflt=/usr/share/scripts
9025 $test -d /usr/share/bin && dflt=/usr/share/bin
9026 $test -d /usr/local/script && dflt=/usr/local/script
9027 $test -d /usr/local/scripts && dflt=/usr/local/scripts
9028 $test -d $prefixexp/script && dflt=$prefixexp/script
9032 *) dflt="$scriptdir"
9037 Some installations have a separate directory just for executable scripts so
9038 that they can mount it across multiple architectures but keep the scripts in
9039 one spot. You might, for example, have a subdirectory of /usr/share for this.
9040 Or you might just lump your scripts in with all your other executables.
9044 rp='Where do you keep publicly executable scripts?'
9046 if $test "X$ansexp" != "X$scriptdirexp"; then
9052 : A little fix up for an irregularly named variable.
9053 installscript="$installscriptdir"
9055 : determine where add-on public executables go
9057 '') dflt=$siteprefix/bin ;;
9061 rp='Pathname where the add-on public executables should be installed?'
9066 : determine where add-on html pages go
9067 : There is no standard location, so try to copy the previously-selected
9068 : directory structure for the core html pages.
9069 case "$sitehtml1dir" in
9070 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9071 *) dflt=$sitehtml1dir ;;
9074 ''|' ') dflt=none ;;
9077 rp='Pathname where the site-specific html pages should be installed?'
9079 prefixvar=sitehtml1dir
9082 : determine where add-on library html pages go
9083 : There is no standard location, so try to copy the previously-selected
9084 : directory structure for the core html pages.
9085 case "$sitehtml3dir" in
9086 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9087 *) dflt=$sitehtml3dir ;;
9090 ''|' ') dflt=none ;;
9093 rp='Pathname where the site-specific library html pages should be installed?'
9095 prefixvar=sitehtml3dir
9098 : determine where add-on manual pages go
9099 case "$siteman1dir" in
9100 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
9101 *) dflt=$siteman1dir ;;
9104 ''|' ') dflt=none ;;
9107 rp='Pathname where the site-specific manual pages should be installed?'
9109 prefixvar=siteman1dir
9112 : determine where add-on library man pages go
9113 case "$siteman3dir" in
9114 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
9115 *) dflt=$siteman3dir ;;
9118 ''|' ') dflt=none ;;
9121 rp='Pathname where the site-specific library manual pages should be installed?'
9123 prefixvar=siteman3dir
9126 : determine where add-on public executable scripts go
9127 case "$sitescript" in
9128 '') dflt=$siteprefix/script
9129 $test -d $dflt || dflt=$sitebin ;;
9130 *) dflt="$sitescript" ;;
9133 rp='Pathname where add-on public executable scripts should be installed?'
9135 prefixvar=sitescript
9138 : Check if faststdio is requested and available
9139 case "$usefaststdio" in
9140 $define|true|[yY]*|'')
9141 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
9151 Perl can be built to use 'fast stdio', which means using the stdio
9152 library but also directly manipulating the stdio buffers to enable
9153 faster I/O. Using stdio is better for backward compatibility (especially
9154 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
9155 interface has been preferred instead of stdio.
9157 If this doesn't make any sense to you, just accept the default '$dflt'.
9159 rp='Use the "fast stdio" if available?'
9162 y|Y) val="$define" ;;
9169 : define an is-a-typedef? function
9170 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9172 "") inclist="sys/types.h";;
9174 eval "varval=\$$var";
9178 for inc in $inclist; do
9179 echo "#include <$inc>" >>temp.c;
9181 echo "#ifdef $type" >> temp.c;
9182 echo "printf(\"We have $type\");" >> temp.c;
9183 echo "#endif" >> temp.c;
9184 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9185 if $contains $type temp.E >/dev/null 2>&1; then
9191 *) eval "$var=\$varval";;
9194 : define an is-a-typedef? function that prompts if the type is not available.
9195 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9197 "") inclist="sys/types.h";;
9199 eval "varval=\$$var";
9203 for inc in $inclist; do
9204 echo "#include <$inc>" >>temp.c;
9206 echo "#ifdef $type" >> temp.c;
9207 echo "printf(\"We have $type\");" >> temp.c;
9208 echo "#endif" >> temp.c;
9209 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9211 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
9212 if $contains $type temp.E >/dev/null 2>&1; then
9213 echo "$type found." >&4;
9216 echo "$type NOT found." >&4;
9222 *) eval "$var=\$varval";;
9225 : see what type lseek is declared as in the kernel
9226 rp="What is the type used for lseek's offset on this system?"
9227 set off_t lseektype long stdio.h sys/types.h
9231 echo "Checking to see how big your file offsets are..." >&4
9233 #include <sys/types.h>
9237 printf("%d\n", (int)sizeof($lseektype));
9242 if eval $compile_ok; then
9243 lseeksize=`$run ./try`
9244 echo "Your file offsets are $lseeksize bytes long."
9248 echo "(I can't seem to compile the test program. Guessing...)"
9249 rp="What is the size of your file offsets (in bytes)?"
9255 : see what type file positions are declared as in the library
9256 rp="What is the type for file position used by fsetpos()?"
9257 set fpos_t fpostype long stdio.h sys/types.h
9260 : Check size for Fpos_t
9263 *_t) zzz="$fpostype" ;;
9266 echo "Checking the size of $zzz..." >&4
9268 #include <sys/types.h>
9275 printf("%d\n", (int)sizeof($fpostype));
9280 if eval $compile_ok; then
9284 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9287 echo "Your $zzz is $fpossize bytes long."
9293 echo "(I can't compile the test program. Guessing...)" >&4
9294 rp="What is the size of your file positions (in bytes)?"
9299 : Check for large file support
9300 # Backward compatibility (uselfs is deprecated).
9302 "$define"|true|[yY]*)
9305 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9307 uselargefiles="$define"
9311 case "$lseeksize:$fpossize" in
9314 You can have files larger than 2 gigabytes.
9317 *) case "$uselargefiles" in
9318 "$undef"|false|[nN]*) dflt='n' ;;
9323 Perl can be built to understand large files (files larger than 2 gigabytes)
9324 on some systems. To do so, Configure can be run with -Duselargefiles.
9326 If this doesn't make any sense to you, just accept the default '$dflt'.
9328 rp='Try to understand large files, if available?'
9331 y|Y) val="$define" ;;
9338 : Look for a hint-file generated 'call-back-unit'. If the
9339 : user has specified that a large files perl is to be built,
9340 : we may need to set or change some other defaults.
9341 if $test -f uselargefiles.cbu; then
9342 echo "Your platform has some specific hints regarding large file builds, using them..."
9343 . ./uselargefiles.cbu
9345 case "$uselargefiles" in
9347 if $test -f uselargefiles.cbu; then
9349 echo "Rechecking to see how big your file offsets are..." >&4
9351 #include <sys/types.h>
9355 printf("%d\n", (int)sizeof($lseektype));
9360 if eval $compile_ok; then
9361 lseeksize=`$run ./try`
9362 $echo "Your file offsets are now $lseeksize bytes long."
9366 echo "(I can't seem to compile the test program. Guessing...)"
9367 rp="What is the size of your file offsets (in bytes)?"
9372 *_t) zzz="$fpostype" ;;
9375 $echo $n "Rechecking the size of $zzz...$c" >&4
9377 #include <sys/types.h>
9384 printf("%d\n", (int)sizeof($fpostype));
9389 if eval $compile_ok; then
9394 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9397 echo " $fpossize bytes." >&4
9403 echo "(I can't compile the test program. Guessing...)" >&4
9404 rp="What is the size of your file positions (in bytes)?"
9413 : Set the vendorbin variables
9414 case "$vendorprefix" in
9415 '') d_vendorbin="$undef"
9419 *) d_vendorbin="$define"
9420 : determine where vendor-supplied executables go.
9421 case "$vendorbin" in
9422 '') dflt=$vendorprefix/bin ;;
9423 *) dflt="$vendorbin" ;;
9426 rp='Pathname for the vendor-supplied executables directory?'
9429 vendorbinexp="$ansexp"
9435 : Set the vendorhtml1dir variables
9436 case "$vendorprefix" in
9437 '') vendorhtml1dir=''
9438 vendorhtml1direxp=''
9440 *) : determine where vendor-supplied html pages go.
9441 : There is no standard location, so try to copy the previously-selected
9442 : directory structure for the core html pages.
9443 : XXX Better default suggestions would be welcome.
9444 case "$vendorhtml1dir" in
9445 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9446 *) dflt=$vendorhtml1dir ;;
9449 ''|' ') dflt=none ;;
9452 rp='Pathname for the vendor-supplied html pages?'
9454 vendorhtml1dir="$ans"
9455 vendorhtml1direxp="$ansexp"
9458 : Use ' ' for none so value is preserved next time through Configure
9459 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9460 prefixvar=vendorhtml1dir
9463 : Set the vendorhtml3dir variables
9464 case "$vendorprefix" in
9465 '') vendorhtml3dir=''
9466 vendorhtml3direxp=''
9468 *) : determine where vendor-supplied module html pages go.
9469 : There is no standard location, so try to copy the previously-selected
9470 : directory structure for the core html pages.
9471 : XXX Better default suggestions would be welcome.
9472 case "$vendorhtml3dir" in
9473 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9474 *) dflt=$vendorhtml3dir ;;
9477 ''|' ') dflt=none ;;
9480 rp='Pathname for the vendor-supplied html pages?'
9482 vendorhtml3dir="$ans"
9483 vendorhtml3direxp="$ansexp"
9486 : Use ' ' for none so value is preserved next time through Configure
9487 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9488 prefixvar=vendorhtml3dir
9491 : Set the vendorman1dir variables
9492 case "$vendorprefix" in
9493 '') vendorman1dir=''
9496 *) : determine where vendor-supplied manual pages go.
9497 case "$vendorman1dir" in
9498 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9499 *) dflt=$vendorman1dir ;;
9502 ''|' ') dflt=none ;;
9505 rp='Pathname for the vendor-supplied manual section 1 pages?'
9507 vendorman1dir="$ans"
9508 vendorman1direxp="$ansexp"
9511 : Use ' ' for none so value is preserved next time through Configure
9512 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9513 prefixvar=vendorman1dir
9516 : Set the vendorman3dir variables
9517 case "$vendorprefix" in
9518 '') vendorman3dir=''
9521 *) : determine where vendor-supplied module manual pages go.
9522 case "$vendorman3dir" in
9523 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9524 *) dflt=$vendorman3dir ;;
9527 ''|' ') dflt=none ;;
9530 rp='Pathname for the vendor-supplied manual section 3 pages?'
9532 vendorman3dir="$ans"
9533 vendorman3direxp="$ansexp"
9536 : Use ' ' for none so value is preserved next time through Configure
9537 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9538 prefixvar=vendorman3dir
9541 : Set the vendorscript variables
9542 case "$vendorprefix" in
9543 '') d_vendorscript="$undef"
9547 *) d_vendorscript="$define"
9548 : determine where vendor-supplied scripts go.
9549 case "$vendorscript" in
9550 '') dflt=$vendorprefix/script
9551 $test -d $dflt || dflt=$vendorbin ;;
9552 *) dflt="$vendorscript" ;;
9556 The installation process will create a directory for
9557 vendor-supplied scripts.
9561 rp='Pathname for the vendor-supplied scripts directory?'
9564 vendorscriptexp="$ansexp"
9567 prefixvar=vendorscript
9570 : script used to emit important warnings
9573 if test \$# -gt 0; then
9578 echo "*** WARNING:" >&4
9579 sed -e 's/^/*** /' <msg >&4
9581 cat msg >>config.msg
9582 echo " " >>config.msg
9588 : see which of string.h or strings.h is needed
9590 strings=`./findhdr string.h`
9591 if $test "$strings" && $test -r "$strings"; then
9592 echo "Using <string.h> instead of <strings.h>." >&4
9596 strings=`./findhdr strings.h`
9597 if $test "$strings" && $test -r "$strings"; then
9598 echo "Using <strings.h> instead of <string.h>." >&4
9600 ./warn "No string header found -- You'll surely have problems."
9606 "$undef") strings=`./findhdr strings.h`;;
9607 *) strings=`./findhdr string.h`;;
9610 : see if qgcvt exists
9614 : Check print/scan long double stuff
9617 if $test X"$d_longdbl" = X"$define"; then
9619 echo "Checking how to print long doubles..." >&4
9621 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
9622 $cat >try.c <<'EOCP'
9623 #include <sys/types.h>
9627 printf("%.3f\n", d);
9631 if eval $compile; then
9635 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
9636 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
9637 echo "We will use %f."
9643 if $test X"$sPRIfldbl" = X; then
9644 $cat >try.c <<'EOCP'
9645 #include <sys/types.h>
9648 long double d = 123.456;
9649 printf("%.3Lf\n", d);
9653 if eval $compile; then
9657 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
9658 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
9659 echo "We will use %Lf."
9665 if $test X"$sPRIfldbl" = X; then
9666 $cat >try.c <<'EOCP'
9667 #include <sys/types.h>
9670 long double d = 123.456;
9671 printf("%.3llf\n", d);
9675 if eval $compile; then
9679 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
9680 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
9681 echo "We will use %llf."
9687 if $test X"$sPRIfldbl" = X; then
9688 $cat >try.c <<'EOCP'
9689 #include <sys/types.h>
9692 long double d = 123.456;
9693 printf("%.3lf\n", d);
9697 if eval $compile; then
9701 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
9702 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
9703 echo "We will use %lf."
9709 if $test X"$sPRIfldbl" = X; then
9710 echo "Cannot figure out how to print long doubles." >&4
9712 sSCNfldbl=$sPRIfldbl # expect consistency
9719 case "$sPRIfldbl" in
9720 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
9721 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
9722 d_SCNfldbl="$undef";
9724 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
9725 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
9726 d_SCNfldbl="$define";
9730 : Check how to convert floats to strings.
9732 if test "X$d_Gconvert" = X; then
9735 echo "Checking for an efficient way to convert floats to strings."
9737 case "$uselongdouble" in
9738 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
9740 case "$d_longdbl" in
9741 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
9743 case "$d_PRIgldbl" in
9744 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
9748 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
9749 char *myname = "gconvert";
9752 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
9753 char *myname = "gcvt";
9756 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
9757 char *myname = "qgcvt";
9758 #define DOUBLETYPE long double
9761 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9763 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
9765 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
9768 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
9770 char *myname = "sprintf";
9774 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9775 #define DOUBLETYPE long double
9777 #define DOUBLETYPE double
9789 # include <string.h>
9791 # include <strings.h>
9794 int checkit(char *expect, char *got)
9796 if (strcmp(expect, got)) {
9797 printf("%s oddity: Expected %s, got %s\n",
9798 myname, expect, got);
9808 /* This must be 1st test on (which?) platform */
9809 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
9810 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
9811 checkit("0.1", buf);
9813 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
9814 checkit("0.01", buf);
9816 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
9817 checkit("0.001", buf);
9819 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
9820 checkit("0.0001", buf);
9822 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
9823 if (strlen(buf) > 5)
9824 checkit("9e-005", buf); /* for Microsoft ?? */
9826 checkit("9e-05", buf);
9828 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
9831 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
9832 checkit("1.1", buf);
9834 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
9835 checkit("1.01", buf);
9837 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
9838 checkit("1.001", buf);
9840 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
9841 checkit("1.0001", buf);
9843 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
9844 checkit("1.00001", buf);
9846 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
9847 checkit("1.000001", buf);
9849 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
9852 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
9855 /* Some Linux gcvt's give 1.e+5 here. */
9856 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
9857 checkit("100000", buf);
9859 /* Some Linux gcvt's give -1.e+5 here. */
9860 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
9861 checkit("-100000", buf);
9863 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
9864 checkit("123.456", buf);
9866 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
9867 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
9868 /* 34 should be enough to scare even long double
9869 * places into using the e notation. */
9870 if (strlen(buf) > 5)
9871 checkit("1e+034", buf); /* for Microsoft */
9873 checkit("1e+34", buf);
9875 /* For Perl, if you add additional tests here, also add them to
9876 * t/base/num.t for benefit of platforms not using Configure or
9877 * overriding d_Gconvert */
9882 : first add preferred functions to our list
9884 for xxx_convert in $gconvert_preference; do
9885 case $xxx_convert in
9886 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
9887 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
9890 : then add any others
9891 for xxx_convert in gconvert gcvt sprintf; do
9894 *) xxx_list="$xxx_list $xxx_convert" ;;
9898 case "$d_longdbl$uselongdouble" in
9900 : again, add preferred functions to our list first
9902 for xxx_convert in $gconvert_ld_preference; do
9903 case $xxx_convert in
9904 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9905 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
9908 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
9909 for xxx_convert in qgcvt sprintf $xxx_list; do
9910 case "$xxx_ld_list" in
9911 $xxx_convert*|*" $xxx_convert"*) ;;
9912 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9915 : if sprintf cannot do long doubles, move it to the end
9916 if test "$d_PRIgldbl" != "$define"; then
9917 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
9919 : if no qgcvt, remove it
9920 if test "$d_qgcvt" != "$define"; then
9921 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
9924 xxx_list="$xxx_ld_list"
9928 for xxx_convert in $xxx_list; do
9929 echo "Trying $xxx_convert..."
9930 $rm -f try try$_o core
9931 set try -DTRY_$xxx_convert
9932 if eval $compile; then
9933 echo "$xxx_convert() found." >&4
9935 echo "I'll use $xxx_convert to convert floats into a string." >&4
9938 echo "...But $xxx_convert didn't work as I expected."
9942 echo "$xxx_convert NOT found." >&4
9946 if test X$xxx_convert = X; then
9947 echo "*** WHOA THERE!!! ***" >&4
9948 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
9952 case "$xxx_convert" in
9953 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
9954 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
9955 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
9956 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
9957 "$define$define$define")
9958 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
9959 "$define$define$undef")
9960 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
9961 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
9969 : see if _fwalk exists
9973 : Initialize h_fcntl
9976 : Initialize h_sysfile
9979 : access call always available on UNIX
9983 : locate the flags for 'access()'
9987 $cat >access.c <<EOCP
9988 #include <sys/types.h>
9993 #include <sys/file.h>
10000 #include <stdlib.h>
10006 : check sys/file.h first, no particular reason here
10007 if $test `./findhdr sys/file.h` && \
10008 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
10010 echo "<sys/file.h> defines the *_OK access constants." >&4
10011 elif $test `./findhdr fcntl.h` && \
10012 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
10014 echo "<fcntl.h> defines the *_OK access constants." >&4
10015 elif $test `./findhdr unistd.h` && \
10016 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
10017 echo "<unistd.h> defines the *_OK access constants." >&4
10019 echo "I can't find the four *_OK access constants--I'll use mine." >&4
10025 : see if accessx exists
10026 set accessx d_accessx
10029 : see if aintl exists
10033 : see if alarm exists
10037 : see if 64bit time functions exists
10039 set ctime64 d_ctime64
10042 set localtime64 d_localtime64
10045 set gmtime64 d_gmtime64
10048 set mktime64 d_mktime64
10051 set difftime64 d_difftime64
10054 set asctime64 d_asctime64
10057 : see if POSIX threads are available
10058 set pthread.h i_pthread
10061 : define a function to check prototypes
10062 $cat > protochk <<EOSH
10065 optimize="$optimize"
10067 prototype="$prototype"
10070 usethreads=$usethreads
10071 i_pthread=$i_pthread
10072 pthread_h_first=$pthread_h_first
10075 $cat >> protochk <<'EOSH'
10080 while test $# -ge 2; do
10082 $define) echo "#include <$2>" >> try.c ;;
10083 literal) echo "$2" >> try.c ;;
10085 # Extra magic for the benefit of systems that need pthread.h
10086 # to be included early to correctly detect threadsafe functions.
10087 # Such functions must guarantee themselves, though, that the usethreads
10088 # and i_pthread have been defined, before calling protochk.
10089 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
10090 echo "#include <pthread.h>" >> try.c
10095 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
10096 cat >> try.c <<'EOCP'
10097 #ifdef CAN_PROTOTYPE
10098 #define _(args) args
10103 echo "$foo" >> try.c
10104 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
10105 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
10111 $eunicefix protochk
10113 : Define hasproto macro for Configure internal use
10114 hasproto='varname=$1; func=$2; shift; shift;
10115 while $test $# -ge 2; do
10117 $define) echo "#include <$2>";;
10121 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
10122 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
10123 echo "$func() prototype found.";
10126 echo "$func() prototype NOT found.";
10133 : see if sys/types.h has to be included
10134 set sys/types.h i_systypes
10137 : see if sys/select.h has to be included
10138 set sys/select.h i_sysselct
10141 : Define hasfield macro for Configure internal use
10142 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
10143 while $test $# -ge 2; do
10145 $define) echo "#include <$2>";;
10149 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
10151 if eval $compile; then
10160 : see if we should include time.h, sys/time.h, or both
10162 if test "X$timeincl" = X; then
10163 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
10164 $echo $n "I'm now running the test program...$c"
10166 #include <sys/types.h>
10171 #ifdef SYSTIMEKERNEL
10174 #include <sys/time.h>
10177 #include <sys/select.h>
10179 #$i_stdlib I_STDLIB
10181 #include <stdlib.h>
10187 struct timeval bar;
10190 struct timezone tzp;
10192 if (foo.tm_sec == foo.tm_sec)
10195 if (bar.tv_sec == bar.tv_sec)
10202 for s_timezone in '-DS_TIMEZONE' ''; do
10204 for s_timeval in '-DS_TIMEVAL' ''; do
10205 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10206 for i_time in '' '-DI_TIME'; do
10207 for i_systime in '-DI_SYSTIME' ''; do
10210 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10211 if eval $compile; then
10212 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
10216 $echo $n "Succeeded with $flags$c"
10228 *SYSTIMEKERNEL*) i_systimek="$define"
10229 timeincl=`./findhdr sys/time.h`
10230 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10231 *) i_systimek="$undef";;
10234 *I_TIME*) i_time="$define"
10235 timeincl=`./findhdr time.h`" $timeincl"
10236 echo "We'll include <time.h>." >&4;;
10237 *) i_time="$undef";;
10240 *I_SYSTIME*) i_systime="$define"
10241 timeincl=`./findhdr sys/time.h`" $timeincl"
10242 echo "We'll include <sys/time.h>." >&4;;
10243 *) i_systime="$undef";;
10247 : see if struct tm knows about tm_zone
10248 case "$i_systime$i_time" in
10251 echo "Checking to see if your struct tm has tm_zone field..." >&4
10252 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
10260 case "$d_tm_tm_zone" in
10261 "$define") echo "Yes, it does." ;;
10262 *) echo "No, it doesn't." ;;
10264 : see if struct tm knows about tm_gmtoff
10265 case "$i_systime$i_time" in
10268 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
10269 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
10277 case "$d_tm_tm_gmtoff" in
10278 "$define") echo "Yes, it does." ;;
10279 *) echo "No, it doesn't." ;;
10282 : see if asctime_r exists
10283 set asctime_r d_asctime_r
10285 case "$d_asctime_r" in
10287 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10288 case "$d_asctime_r_proto:$usethreads" in
10289 ":define") d_asctime_r_proto=define
10290 set d_asctime_r_proto asctime_r $hdrs
10294 case "$d_asctime_r_proto" in
10296 case "$asctime_r_proto" in
10297 ''|0) try='char* asctime_r(const struct tm*, char*);'
10298 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SB ;;
10300 case "$asctime_r_proto" in
10301 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
10302 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SBI ;;
10304 case "$asctime_r_proto" in
10305 ''|0) try='int asctime_r(const struct tm*, char*);'
10306 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SB ;;
10308 case "$asctime_r_proto" in
10309 ''|0) try='int asctime_r(const struct tm*, char*, int);'
10310 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SBI ;;
10312 case "$asctime_r_proto" in
10313 ''|0) d_asctime_r=undef
10315 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
10316 * ) case "$asctime_r_proto" in
10317 REENTRANT_PROTO*) ;;
10318 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
10320 echo "Prototype: $try" ;;
10323 *) case "$usethreads" in
10324 define) echo "asctime_r has no prototype, not using it." >&4 ;;
10331 *) asctime_r_proto=0
10335 : see if atolf exists
10339 : see if atoll exists
10343 : Look for GCC-style attribute format
10344 case "$d_attribute_format" in
10347 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
10348 $cat >attrib.c <<'EOCP'
10350 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
10352 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10353 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10354 echo "Your C compiler doesn't support __attribute__((format))."
10357 echo "Your C compiler supports __attribute__((format))."
10361 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10365 *) val="$d_attribute_format" ;;
10367 set d_attribute_format
10371 : Look for GCC-style attribute format with null format allowed
10372 case "$d_printf_format_null" in
10373 '') case "$d_attribute_format" in
10376 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
10377 $cat >attrib.c <<EOCP
10379 #$i_stdlib I_STDLIB
10381 #include <stdlib.h>
10383 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
10384 int null_printf (char* pat,...) { return (int)pat; }
10385 int main () { exit(null_printf(NULL)); }
10387 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
10388 : run the executable in case it produces a run-time warning
10389 if $run ./attrib >>attrib.out 2>&1; then
10390 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10391 echo "Your C compiler doesn't allow __printf__ format to be null."
10394 echo "Your C compiler allows __printf__ format to be null."
10398 echo "Your C compiler executable failed with __printf__ format null."
10402 echo "Your C compiler fails with __printf__ format null."
10409 *) val="$d_printf_format_null" ;;
10411 set d_printf_format_null
10415 : Look for GCC-style attribute malloc
10416 case "$d_attribute_malloc" in
10419 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
10420 $cat >attrib.c <<'EOCP'
10422 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
10424 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10425 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10426 echo "Your C compiler doesn't support __attribute__((malloc))."
10429 echo "Your C compiler supports __attribute__((malloc))."
10433 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10437 *) val="$d_attribute_malloc" ;;
10439 set d_attribute_malloc
10443 : Look for GCC-style attribute nonnull
10444 case "$d_attribute_nonnull" in
10447 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
10448 $cat >attrib.c <<'EOCP'
10450 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
10452 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10453 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10454 echo "Your C compiler doesn't support __attribute__((nonnull))."
10457 echo "Your C compiler supports __attribute__((nonnull))."
10461 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10465 *) val="$d_attribute_nonnull" ;;
10467 set d_attribute_nonnull
10471 : Look for GCC-style attribute noreturn
10472 case "$d_attribute_noreturn" in
10475 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
10476 $cat >attrib.c <<'EOCP'
10478 void fall_over_dead( void ) __attribute__((noreturn));
10480 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10481 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10482 echo "Your C compiler doesn't support __attribute__((noreturn))."
10485 echo "Your C compiler supports __attribute__((noreturn))."
10489 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10493 *) val="$d_attribute_noreturn" ;;
10495 set d_attribute_noreturn
10499 : Look for GCC-style attribute pure
10500 case "$d_attribute_pure" in
10503 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
10504 $cat >attrib.c <<'EOCP'
10506 int square( int n ) __attribute__((pure));
10508 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10509 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10510 echo "Your C compiler doesn't support __attribute__((pure))."
10513 echo "Your C compiler supports __attribute__((pure))."
10517 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10521 *) val="$d_attribute_pure" ;;
10523 set d_attribute_pure
10527 : Look for GCC-style attribute unused
10528 case "$d_attribute_unused" in
10531 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
10532 $cat >attrib.c <<'EOCP'
10534 int do_something( int dummy __attribute__((unused)), int n );
10536 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10537 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10538 echo "Your C compiler doesn't support __attribute__((unused))."
10541 echo "Your C compiler supports __attribute__((unused))."
10545 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10549 *) val="$d_attribute_unused" ;;
10551 set d_attribute_unused
10555 : Look for GCC-style attribute deprecated
10556 case "$d_attribute_deprecated" in
10559 echo "Checking whether your compiler can handle __attribute__((deprecated)) ..." >&4
10560 $cat >attrib.c <<'EOCP'
10562 int I_am_deprecated(void) __attribute__((deprecated));
10564 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10565 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10566 echo "Your C compiler doesn't support __attribute__((deprecated))."
10569 echo "Your C compiler supports __attribute__((deprecated))."
10573 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10577 *) val="$d_attribute_deprecated" ;;
10579 set d_attribute_deprecated
10583 : Look for GCC-style attribute warn_unused_result
10584 case "$d_attribute_warn_unused_result" in
10587 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
10588 $cat >attrib.c <<'EOCP'
10590 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
10592 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10593 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10594 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
10597 echo "Your C compiler supports __attribute__((warn_unused_result))."
10601 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10605 *) val="$d_attribute_warn_unused_result" ;;
10607 set d_attribute_warn_unused_result
10611 : see if bcmp exists
10615 : see if bcopy exists
10619 : see if getpgrp exists
10620 set getpgrp d_getpgrp
10623 case "$d_getpgrp" in
10626 echo "Checking to see which flavor of getpgrp is in use..."
10628 #$i_unistd I_UNISTD
10629 #include <sys/types.h>
10631 # include <unistd.h>
10633 #$i_stdlib I_STDLIB
10635 #include <stdlib.h>
10639 if (getuid() == 0) {
10640 printf("(I see you are running Configure as super-user...)\n");
10643 #ifdef TRY_BSD_PGRP
10644 if (getpgrp(1) == 0)
10653 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10654 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
10656 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10657 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
10660 echo "I can't seem to compile and run the test program."
10662 xxx="a USG one, i.e. you use getpgrp()."
10664 # SVR4 systems can appear rather BSD-ish.
10665 case "$i_unistd" in
10667 xxx="a BSD one, i.e. you use getpgrp(pid)."
10671 xxx="probably a USG one, i.e. you use getpgrp()."
10676 echo "Assuming your getpgrp is $xxx" >&4
10685 : see if setpgrp exists
10686 set setpgrp d_setpgrp
10689 case "$d_setpgrp" in
10692 echo "Checking to see which flavor of setpgrp is in use..."
10694 #$i_unistd I_UNISTD
10695 #include <sys/types.h>
10697 # include <unistd.h>
10699 #$i_stdlib I_STDLIB
10701 #include <stdlib.h>
10705 if (getuid() == 0) {
10706 printf("(I see you are running Configure as super-user...)\n");
10709 #ifdef TRY_BSD_PGRP
10710 if (-1 == setpgrp(1, 1))
10713 if (setpgrp() != -1)
10719 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10720 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
10722 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10723 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
10726 echo "(I can't seem to compile and run the test program.)"
10728 xxx="a USG one, i.e. you use setpgrp()."
10730 # SVR4 systems can appear rather BSD-ish.
10731 case "$i_unistd" in
10733 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
10737 xxx="probably a USG one, i.e. you use setpgrp()."
10742 echo "Assuming your setpgrp is $xxx" >&4
10751 : Look for GCC-style __builtin_choose_expr
10752 case "$d_builtin_choose_expr" in
10755 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
10756 $cat >try.c <<'EOCP'
10757 #include <assert.h>
10758 #include <stdlib.h>
10761 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
10764 assert( SYRINX(1) == 2112 );
10765 assert( SYRINX(1) != 5150 );
10766 assert( SYRINX(0) == 5150 );
10767 assert( SYRINX(0) != 2112 );
10768 puts( "All good!" );
10774 if eval $compile && $run ./try; then
10775 echo "Your C compiler supports __builtin_choose_expr."
10778 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10782 *) val="$d_builtin_choose_expr" ;;
10785 set d_builtin_choose_expr
10789 : Look for GCC-style __builtin_expect
10790 case "$d_builtin_expect" in
10793 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
10794 $cat >try.c <<'EOCP'
10797 if ( __builtin_expect(n, 0) ) n = 1;
10798 /* Remember shell exit code truth is 0, C truth is non-zero */
10803 if eval $compile && $run ./try; then
10804 echo "Your C compiler supports __builtin_expect."
10807 echo "Your C compiler doesn't seem to understand __builtin_expect."
10811 *) val="$d_builtin_expect" ;;
10814 set d_builtin_expect
10818 : see if bzero exists
10822 : see if stdarg is available
10824 if $test `./findhdr stdarg.h`; then
10825 echo "<stdarg.h> found." >&4
10828 echo "<stdarg.h> NOT found." >&4
10832 : see if varags is available
10834 if $test `./findhdr varargs.h`; then
10835 echo "<varargs.h> found." >&4
10837 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
10840 : set up the varargs testing programs
10841 $cat > varargs.c <<EOP
10843 #include <stdarg.h>
10846 #include <varargs.h>
10850 int f(char *p, ...)
10864 p = va_arg(ap, char *);
10870 $cat > varargs <<EOP
10872 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
10881 : now check which varargs header should be included
10886 if `./varargs I_STDARG`; then
10888 elif `./varargs I_VARARGS`; then
10893 if `./varargs I_VARARGS`; then
10900 echo "I could not find the definition for va_dcl... You have problems..." >&4
10901 val="$undef"; set i_stdarg; eval $setvar
10902 val="$undef"; set i_varargs; eval $setvar
10907 case "$i_varhdr" in
10909 val="$define"; set i_stdarg; eval $setvar
10910 val="$undef"; set i_varargs; eval $setvar
10913 val="$undef"; set i_stdarg; eval $setvar
10914 val="$define"; set i_varargs; eval $setvar
10917 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
10921 : see if the Compiler supports C99 variadic macros
10922 case "$i_stdarg$i_stdlib" in
10924 echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
10927 #include <stdarg.h>
10929 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
10933 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
10939 if eval $compile && $run ./try 2>&1 >/dev/null; then
10940 case "`$run ./try`" in
10942 echo "You have C99 variadic macros." >&4
10943 d_c99_variadic_macros="$define"
10946 echo "You don't have functional C99 variadic macros." >&4
10947 d_c99_variadic_macros="$undef"
10951 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
10952 d_c99_variadic_macros="$undef"
10957 echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
10958 d_c99_variadic_macros="$undef"
10962 : see if signal is declared as pointer to function returning int or void
10964 xxx=`./findhdr signal.h`
10965 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
10966 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10967 echo "You have int (*signal())() instead of void." >&4
10969 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10970 echo "You have void (*signal())()." >&4
10972 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
10973 echo "You have int (*signal())() instead of void." >&4
10975 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
10976 echo "You have void (*signal())()." >&4
10979 case "$d_voidsig" in
10981 echo "I can't determine whether signal handler returns void or int..." >&4
10983 rp="What type does your signal handler return?"
10986 v*) val="$define";;
10990 echo "As you already told me, signal handler returns void." >&4
10993 *) echo "As you already told me, signal handler returns int." >&4
11000 case "$d_voidsig" in
11001 "$define") signal_t="void";;
11002 *) signal_t="int";;
11006 : check for ability to cast large floats to 32-bit ints.
11008 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
11009 if $test "$intsize" -ge 4; then
11016 #$i_stdlib I_STDLIB
11018 #include <stdlib.h>
11020 #include <sys/types.h>
11021 #include <signal.h>
11022 $signal_t blech(int s) { exit(3); }
11029 signal(SIGFPE, blech);
11031 /* Don't let compiler optimize the test away. Store the number
11032 in a writable string for gcc to pass to sscanf under HP-UX.
11034 sprintf(str, "2147483647");
11035 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
11039 /* x86 processors will probably give 0x8000 0000, which is a
11040 sign change. We don't want that. We want to mimic SPARC
11041 behavior here, which is to preserve the sign and give
11044 if (i32 != ($xxx) f)
11050 if eval $compile_ok; then
11054 echo "(I can't seem to compile the test program--assuming it can't)"
11059 echo "Yup, it can."
11062 echo "Nope, it can't."
11069 : check for ability to cast negative floats to unsigned
11071 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
11074 #$i_stdlib I_STDLIB
11076 #include <stdlib.h>
11078 #include <sys/types.h>
11079 #include <signal.h>
11080 $signal_t blech(int s) { exit(7); }
11081 $signal_t blech_in_list(int s) { exit(4); }
11082 unsigned long dummy_long(unsigned long p) { return p; }
11083 unsigned int dummy_int(unsigned int p) { return p; }
11084 unsigned short dummy_short(unsigned short p) { return p; }
11088 unsigned long along;
11090 unsigned short ashort;
11094 /* Frustrate gcc-2.7.2's optimizer which failed this test with
11095 a direct f = -123. assignment. gcc-2.8.0 reportedly
11096 optimized the whole file away
11098 /* Store the number in a writable string for gcc to pass to
11099 sscanf under HP-UX.
11101 sprintf(str, "-123");
11102 sscanf(str, "%lf", &f); /* f = -123.; */
11104 signal(SIGFPE, blech);
11105 along = (unsigned long)f;
11106 aint = (unsigned int)f;
11107 ashort = (unsigned short)f;
11108 if (along != (unsigned long)-123)
11110 if (aint != (unsigned int)-123)
11112 if (ashort != (unsigned short)-123)
11114 sprintf(str, "1073741824.");
11115 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
11118 along = (unsigned long)f;
11119 if (along != 0x80000000)
11123 along = (unsigned long)f;
11124 if (along != 0x7fffffff)
11128 along = (unsigned long)f;
11129 if (along != 0x80000001)
11133 signal(SIGFPE, blech_in_list);
11134 sprintf(str, "123.");
11135 sscanf(str, "%lf", &f); /* f = 123.; */
11136 along = dummy_long((unsigned long)f);
11137 aint = dummy_int((unsigned int)f);
11138 ashort = dummy_short((unsigned short)f);
11139 if (along != (unsigned long)123)
11141 if (aint != (unsigned int)123)
11143 if (ashort != (unsigned short)123)
11150 if eval $compile_ok; then
11154 echo "(I can't seem to compile the test program--assuming it can't)"
11157 case "$castflags" in
11159 echo "Yup, it can."
11162 echo "Nope, it can't."
11169 : see if vprintf exists
11171 if set vprintf val -f d_vprintf; eval $csym; $val; then
11172 echo 'vprintf() found.' >&4
11175 #$i_stdarg I_STDARG /* Only one of these can be defined by i_varhrd */
11176 #$i_varargs I_VARARGS
11178 #$i_stdlib I_STDLIB
11179 #$i_unistd I_UNISTD
11182 # include <stdarg.h>
11183 #else /* I_VARARGS */
11184 # include <varargs.h>
11188 # include <unistd.h>
11192 # include <stdlib.h>
11195 #include <stdio.h> /* vsprintf prototype */
11198 void xxx(int n, ...)
11203 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11205 int main() { xxx(1, "foo"); }
11207 #else /* I_VARARGS */
11215 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11217 int main() { xxx("foo"); }
11223 if eval $compile_ok; then
11224 if $run ./try; then
11225 echo "Your vsprintf() returns (int)." >&4
11228 echo "Your vsprintf() returns (char*)." >&4
11232 echo 'I am unable to compile the vsprintf() test program.' >&4
11233 # We shouldn't get here. If we do, assume the standard signature,
11234 # not the old BSD one.
11235 echo 'Guessing that vsprintf() returns (int).' >&4
11239 echo 'vprintf() NOT found.' >&4
11250 : see if chown exists
11254 : see if chroot exists
11255 set chroot d_chroot
11258 : see if chsize exists
11259 set chsize d_chsize
11262 : see if class exists
11266 : see if clearenv exists
11267 set clearenv d_clearenv
11270 : Define hasstruct macro for Configure internal use
11271 hasstruct='varname=$1; struct=$2; shift; shift;
11272 while $test $# -ge 2; do
11274 $define) echo "#include <$2>";;
11278 echo "int main () { struct $struct foo; }" >> try.c;
11280 if eval $compile; then
11289 : see whether socket exists
11293 $echo $n "Hmm... $c" >&4
11294 if set socket val -f d_socket; eval $csym; $val; then
11295 echo "Looks like you have Berkeley networking support." >&4
11297 if set setsockopt val -f; eval $csym; $val; then
11300 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
11301 d_oldsock="$define"
11304 if $contains socklib libc.list >/dev/null 2>&1; then
11305 echo "Looks like you have Berkeley networking support." >&4
11307 : we will have to assume that it supports the 4.2 BSD interface
11310 echo "You don't have Berkeley networking in libc$_a..." >&4
11311 if test "X$d_socket" = "X$define"; then
11312 echo "...but you seem to believe that you have sockets." >&4
11314 for net in net socket
11316 if test -f /usr/lib/lib$net$_a; then
11317 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
11318 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
11319 if $contains socket libc.list >/dev/null 2>&1; then
11324 echo "...but the Wollongong group seems to have hacked it in." >&4
11325 sockethdr="-I/usr/netinclude"
11328 echo "Found Berkeley sockets interface in lib$net." >&4
11329 if $contains setsockopt libc.list >/dev/null 2>&1; then
11332 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
11333 d_oldsock="$define"
11339 if test "X$d_socket" != "X$define"; then
11340 echo "or anywhere else I see." >&4
11348 : see if socketpair exists
11349 set socketpair d_sockpair
11354 echo "Checking the availability sa_len in the sock struct ..." >&4
11356 #include <sys/types.h>
11357 #include <sys/socket.h>
11359 struct sockaddr sa;
11360 return (sa.sa_len);
11364 set try; if eval $compile; then
11367 set d_sockaddr_sa_len; eval $setvar
11371 echo "Checking the availability sin6_scope_id in struct sockaddr_in6 ..." >&4
11373 #include <sys/types.h>
11374 #include <sys/socket.h>
11375 #include <netinet/in.h>
11377 struct sockaddr_in6 sin6;
11378 return (sin6.sin6_scope_id);
11382 set try; if eval $compile; then
11385 set d_sin6_scope_id; eval $setvar
11389 echo "Checking the availability of certain socket constants..." >&4
11390 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
11391 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
11393 #include <sys/types.h>
11394 #include <sys/socket.h>
11400 set try; if eval $compile; then
11403 set d_${enum}; eval $setvar
11407 : see if this is a sys/uio.h system
11408 set sys/uio.h i_sysuio
11411 : Check for cmsghdr support
11413 echo "Checking to see if your system supports struct cmsghdr..." >&4
11414 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
11416 case "$d_cmsghdr_s" in
11417 "$define") echo "Yes, it does." ;;
11418 *) echo "No, it doesn't." ;;
11422 : check for const keyword
11424 echo 'Checking to see if your C compiler knows about "const"...' >&4
11425 $cat >const.c <<'EOCP'
11426 typedef struct spug { int drokk; } spug;
11430 const spug y = { 0 };
11433 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
11435 echo "Yup, it does."
11438 echo "Nope, it doesn't."
11443 : see if copysignl exists
11444 set copysignl d_copysignl
11447 : see if crypt exists
11452 $define) cryptlib='' ;;
11453 *) if set crypt val -f d_crypt; eval $csym; $val; then
11454 echo 'crypt() found.' >&4
11458 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
11459 if $test -z "$cryptlib"; then
11460 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
11464 if $test -z "$cryptlib"; then
11465 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
11469 if $test -z "$cryptlib"; then
11470 cryptlib=`./loc libcrypt$_a "" $libpth`
11474 if $test -z "$cryptlib"; then
11475 echo 'crypt() NOT found.' >&4
11486 : see if this is a crypt.h system
11487 set crypt.h i_crypt
11490 : see if crypt_r exists
11491 set crypt_r d_crypt_r
11493 case "$d_crypt_r" in
11495 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
11496 case "$d_crypt_r_proto:$usethreads" in
11497 ":define") d_crypt_r_proto=define
11498 set d_crypt_r_proto crypt_r $hdrs
11502 case "$d_crypt_r_proto" in
11504 case "$crypt_r_proto" in
11505 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
11506 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCS ;;
11508 case "$crypt_r_proto" in
11509 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
11510 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCD ;;
11512 case "$crypt_r_proto" in
11513 ''|0) d_crypt_r=undef
11515 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
11516 * ) case "$crypt_r_proto" in
11517 REENTRANT_PROTO*) ;;
11518 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
11520 echo "Prototype: $try" ;;
11523 *) case "$usethreads" in
11524 define) echo "crypt_r has no prototype, not using it." >&4 ;;
11535 : get csh whereabouts
11537 'csh') val="$undef" ;;
11538 *) val="$define" ;;
11542 : Respect a hint or command line value for full_csh.
11543 case "$full_csh" in
11544 '') full_csh=$csh ;;
11547 : see if ctermid exists
11548 set ctermid d_ctermid
11551 : see if ctermid_r exists
11552 set ctermid_r d_ctermid_r
11554 case "$d_ctermid_r" in
11556 hdrs="$i_systypes sys/types.h define stdio.h "
11557 case "$d_ctermid_r_proto:$usethreads" in
11558 ":define") d_ctermid_r_proto=define
11559 set d_ctermid_r_proto ctermid_r $hdrs
11563 case "$d_ctermid_r_proto" in
11565 case "$ctermid_r_proto" in
11566 ''|0) try='char* ctermid_r(char*);'
11567 ./protochk "$extern_C $try" $hdrs && ctermid_r_proto=B_B ;;
11569 case "$ctermid_r_proto" in
11570 ''|0) d_ctermid_r=undef
11572 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
11573 * ) case "$ctermid_r_proto" in
11574 REENTRANT_PROTO*) ;;
11575 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
11577 echo "Prototype: $try" ;;
11580 *) case "$usethreads" in
11581 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
11588 *) ctermid_r_proto=0
11592 : see if ctime_r exists
11593 set ctime_r d_ctime_r
11595 case "$d_ctime_r" in
11597 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
11598 case "$d_ctime_r_proto:$usethreads" in
11599 ":define") d_ctime_r_proto=define
11600 set d_ctime_r_proto ctime_r $hdrs
11604 case "$d_ctime_r_proto" in
11606 case "$ctime_r_proto" in
11607 ''|0) try='char* ctime_r(const time_t*, char*);'
11608 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SB ;;
11610 case "$ctime_r_proto" in
11611 ''|0) try='char* ctime_r(const time_t*, char*, int);'
11612 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SBI ;;
11614 case "$ctime_r_proto" in
11615 ''|0) try='int ctime_r(const time_t*, char*);'
11616 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SB ;;
11618 case "$ctime_r_proto" in
11619 ''|0) try='int ctime_r(const time_t*, char*, int);'
11620 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SBI ;;
11622 case "$ctime_r_proto" in
11623 ''|0) d_ctime_r=undef
11625 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
11626 * ) case "$ctime_r_proto" in
11627 REENTRANT_PROTO*) ;;
11628 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
11630 echo "Prototype: $try" ;;
11633 *) case "$usethreads" in
11634 define) echo "ctime_r has no prototype, not using it." >&4 ;;
11645 : see if cuserid exists
11646 set cuserid d_cuserid
11649 : see if this is a limits.h system
11650 set limits.h i_limits
11653 : see if this is a float.h system
11654 set float.h i_float
11657 : See if number of significant digits in a double precision number is known
11659 $cat >dbl_dig.c <<EOM
11660 #$i_limits I_LIMITS
11663 #include <limits.h>
11669 printf("Contains DBL_DIG");
11672 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
11673 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
11674 echo "DBL_DIG found." >&4
11677 echo "DBL_DIG NOT found." >&4
11684 : see if dbm.h is available
11685 : see if dbmclose exists
11686 set dbmclose d_dbmclose
11689 case "$d_dbmclose" in
11699 *) set rpcsvc/dbm.h i_rpcsvcdbm
11704 *) echo "We won't be including <dbm.h>"
11714 : see if prototype for dbminit is available
11716 set d_dbminitproto dbminit $i_dbm dbm.h
11719 : see if difftime exists
11720 set difftime d_difftime
11723 : see if this is a dirent system
11725 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
11727 echo "<dirent.h> found." >&4
11730 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
11731 echo "<sys/dir.h> found." >&4
11734 xinc=`./findhdr sys/ndir.h`
11736 echo "<dirent.h> NOT found." >&4
11741 : Look for type of directory structure.
11743 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11745 case "$direntrytype" in
11747 case "$i_dirent" in
11748 $define) guess1='struct dirent' ;;
11749 *) guess1='struct direct' ;;
11752 *) guess1="$direntrytype"
11757 'struct dirent') guess2='struct direct' ;;
11758 *) guess2='struct dirent' ;;
11761 if $contains "$guess1" try.c >/dev/null 2>&1; then
11762 direntrytype="$guess1"
11763 echo "Your directory entries are $direntrytype." >&4
11764 elif $contains "$guess2" try.c >/dev/null 2>&1; then
11765 direntrytype="$guess2"
11766 echo "Your directory entries seem to be $direntrytype." >&4
11768 echo "I don't recognize your system's directory entries." >&4
11769 rp="What type is used for directory entries on this system?"
11772 direntrytype="$ans"
11776 : see if the directory entry stores field length
11778 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11779 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
11780 echo "Good, your directory entry keeps length information in d_namlen." >&4
11783 echo "Your directory entry does not know about the d_namlen field." >&4
11790 : Look for DIR.dd_fd
11791 case "$i_dirent" in
11793 echo "Checking to see if DIR has a dd_fd member variable" >&4
11795 #$i_stdlib I_STDLIB
11797 #include <stdlib.h>
11799 #include <dirent.h>
11809 if eval $compile; then
11810 echo "Yes, it does."
11813 echo "No, it does not."
11818 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
11826 : see if this is an sysdir system
11827 set sys/dir.h i_sysdir
11830 : see if this is an sysndir system
11831 set sys/ndir.h i_sysndir
11836 $cat >dirfd.c <<EOM
11838 #$i_stdlib I_STDLIB
11840 #include <stdlib.h>
11842 #$i_dirent I_DIRENT /**/
11843 #$i_sysdir I_SYS_DIR /**/
11844 #$i_sysndir I_SYS_NDIR /**/
11845 #$i_systypes I_SYS_TYPES /**/
11846 #if defined(I_SYS_TYPES)
11847 #include <sys/types.h>
11849 #if defined(I_DIRENT)
11850 #include <dirent.h>
11851 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
11852 #include <sys/dir.h>
11856 #include <sys/ndir.h>
11860 #include <ndir.h> /* may be wrong in the future */
11862 #include <sys/dir.h>
11868 DIR *dirp = opendir(".");
11869 if (dirfd(dirp) >= 0)
11877 if eval $compile; then
11881 $define) echo "dirfd() found." >&4 ;;
11882 *) echo "dirfd() NOT found." >&4 ;;
11888 : see if dlerror exists
11891 set dlerror d_dlerror
11895 : see if dlfcn is available
11896 set dlfcn.h i_dlfcn
11899 : Check what extension to use for shared libs
11904 On a few systems, the dynamically loaded modules that perl generates and uses
11905 will need a different extension than shared libs. The default will probably
11911 *) dflt="$dlext" ;;
11913 rp='What is the extension of dynamically loaded modules'
11922 : Check if dlsym need a leading underscore
11928 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
11929 $cat >dyna.c <<'EOM'
11936 #$i_stdlib I_STDLIB
11938 #include <stdlib.h>
11942 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
11944 #include <sys/types.h>
11949 extern int fred() ;
11958 int mode = RTLD_LAZY ;
11960 handle = dlopen("./dyna.$dlext", mode) ;
11961 if (handle == NULL) {
11966 symbol = dlsym(handle, "fred") ;
11967 if (symbol == NULL) {
11968 /* try putting a leading underscore */
11969 symbol = dlsym(handle, "_fred") ;
11970 if (symbol == NULL) {
11983 : Call the object file tmp-dyna.o in case dlext=o.
11984 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
11985 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
11986 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
11987 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
11990 1) echo "Test program failed using dlopen." >&4
11991 echo "Perhaps you should not use dynamic loading." >&4;;
11992 2) echo "Test program failed using dlsym." >&4
11993 echo "Perhaps you should not use dynamic loading." >&4;;
11994 3) echo "dlsym needs a leading underscore" >&4
11996 4) echo "dlsym doesn't need a leading underscore." >&4;;
11999 echo "I can't compile and run the test program." >&4
12000 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
12005 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
12010 : see if drand48_r exists
12011 set drand48_r d_drand48_r
12013 case "$d_drand48_r" in
12015 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
12016 case "$d_drand48_r_proto:$usethreads" in
12017 ":define") d_drand48_r_proto=define
12018 set d_drand48_r_proto drand48_r $hdrs
12022 case "$d_drand48_r_proto" in
12024 case "$drand48_r_proto" in
12025 ''|0) try='int drand48_r(struct drand48_data*, double*);'
12026 ./protochk "$extern_C $try" $hdrs && drand48_r_proto=I_ST ;;
12028 case "$drand48_r_proto" in
12029 ''|0) d_drand48_r=undef
12031 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
12032 * ) case "$drand48_r_proto" in
12033 REENTRANT_PROTO*) ;;
12034 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
12036 echo "Prototype: $try" ;;
12039 *) case "$usethreads" in
12040 define) echo "drand48_r has no prototype, not using it." >&4 ;;
12047 *) drand48_r_proto=0
12051 : see if prototype for drand48 is available
12053 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
12056 : see if dup2 exists
12060 : see if eaccess exists
12061 set eaccess d_eaccess
12064 : see if endgrent exists
12065 set endgrent d_endgrent
12068 : see if this is an grp system
12074 xxx=`./findhdr grp.h`
12075 $cppstdin $cppflags $cppminus < $xxx >$$.h
12077 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
12089 set d_grpasswd; eval $setvar
12093 : see if endgrent_r exists
12094 set endgrent_r d_endgrent_r
12096 case "$d_endgrent_r" in
12098 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12099 case "$d_endgrent_r_proto:$usethreads" in
12100 ":define") d_endgrent_r_proto=define
12101 set d_endgrent_r_proto endgrent_r $hdrs
12105 case "$d_endgrent_r_proto" in
12107 case "$endgrent_r_proto" in
12108 ''|0) try='int endgrent_r(FILE**);'
12109 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=I_H ;;
12111 case "$endgrent_r_proto" in
12112 ''|0) try='void endgrent_r(FILE**);'
12113 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=V_H ;;
12115 case "$endgrent_r_proto" in
12116 ''|0) d_endgrent_r=undef
12118 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
12119 * ) case "$endgrent_r_proto" in
12120 REENTRANT_PROTO*) ;;
12121 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
12123 echo "Prototype: $try" ;;
12126 *) case "$usethreads" in
12127 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
12134 *) endgrent_r_proto=0
12138 : see if endhostent exists
12139 set endhostent d_endhent
12142 : see if this is a netdb.h system
12143 set netdb.h i_netdb
12146 : see if endhostent_r exists
12147 set endhostent_r d_endhostent_r
12149 case "$d_endhostent_r" in
12151 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12152 case "$d_endhostent_r_proto:$usethreads" in
12153 ":define") d_endhostent_r_proto=define
12154 set d_endhostent_r_proto endhostent_r $hdrs
12158 case "$d_endhostent_r_proto" in
12160 case "$endhostent_r_proto" in
12161 ''|0) try='int endhostent_r(struct hostent_data*);'
12162 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=I_D ;;
12164 case "$endhostent_r_proto" in
12165 ''|0) try='void endhostent_r(struct hostent_data*);'
12166 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=V_D ;;
12168 case "$endhostent_r_proto" in
12169 ''|0) d_endhostent_r=undef
12170 endhostent_r_proto=0
12171 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
12172 * ) case "$endhostent_r_proto" in
12173 REENTRANT_PROTO*) ;;
12174 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
12176 echo "Prototype: $try" ;;
12179 *) case "$usethreads" in
12180 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
12182 d_endhostent_r=undef
12183 endhostent_r_proto=0
12187 *) endhostent_r_proto=0
12191 : see if endnetent exists
12192 set endnetent d_endnent
12195 : see if endnetent_r exists
12196 set endnetent_r d_endnetent_r
12198 case "$d_endnetent_r" in
12200 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12201 case "$d_endnetent_r_proto:$usethreads" in
12202 ":define") d_endnetent_r_proto=define
12203 set d_endnetent_r_proto endnetent_r $hdrs
12207 case "$d_endnetent_r_proto" in
12209 case "$endnetent_r_proto" in
12210 ''|0) try='int endnetent_r(struct netent_data*);'
12211 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=I_D ;;
12213 case "$endnetent_r_proto" in
12214 ''|0) try='void endnetent_r(struct netent_data*);'
12215 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=V_D ;;
12217 case "$endnetent_r_proto" in
12218 ''|0) d_endnetent_r=undef
12219 endnetent_r_proto=0
12220 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
12221 * ) case "$endnetent_r_proto" in
12222 REENTRANT_PROTO*) ;;
12223 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
12225 echo "Prototype: $try" ;;
12228 *) case "$usethreads" in
12229 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
12231 d_endnetent_r=undef
12232 endnetent_r_proto=0
12236 *) endnetent_r_proto=0
12240 : see if endprotoent exists
12241 set endprotoent d_endpent
12244 : see if endprotoent_r exists
12245 set endprotoent_r d_endprotoent_r
12247 case "$d_endprotoent_r" in
12249 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12250 case "$d_endprotoent_r_proto:$usethreads" in
12251 ":define") d_endprotoent_r_proto=define
12252 set d_endprotoent_r_proto endprotoent_r $hdrs
12256 case "$d_endprotoent_r_proto" in
12258 case "$endprotoent_r_proto" in
12259 ''|0) try='int endprotoent_r(struct protoent_data*);'
12260 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=I_D ;;
12262 case "$endprotoent_r_proto" in
12263 ''|0) try='void endprotoent_r(struct protoent_data*);'
12264 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=V_D ;;
12266 case "$endprotoent_r_proto" in
12267 ''|0) d_endprotoent_r=undef
12268 endprotoent_r_proto=0
12269 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
12270 * ) case "$endprotoent_r_proto" in
12271 REENTRANT_PROTO*) ;;
12272 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
12274 echo "Prototype: $try" ;;
12277 *) case "$usethreads" in
12278 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
12280 d_endprotoent_r=undef
12281 endprotoent_r_proto=0
12285 *) endprotoent_r_proto=0
12289 : see if endpwent exists
12290 set endpwent d_endpwent
12293 : see if this is a pwd.h system
12299 xxx=`./findhdr pwd.h`
12300 $cppstdin $cppflags $cppminus < $xxx >$$.h
12302 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
12310 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
12318 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
12326 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
12334 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
12342 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
12350 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
12358 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
12370 set d_pwquota; eval $setvar
12371 set d_pwage; eval $setvar
12372 set d_pwchange; eval $setvar
12373 set d_pwclass; eval $setvar
12374 set d_pwexpire; eval $setvar
12375 set d_pwcomment; eval $setvar
12376 set d_pwgecos; eval $setvar
12377 set d_pwpasswd; eval $setvar
12381 : see if endpwent_r exists
12382 set endpwent_r d_endpwent_r
12384 case "$d_endpwent_r" in
12386 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
12387 case "$d_endpwent_r_proto:$usethreads" in
12388 ":define") d_endpwent_r_proto=define
12389 set d_endpwent_r_proto endpwent_r $hdrs
12393 case "$d_endpwent_r_proto" in
12395 case "$endpwent_r_proto" in
12396 ''|0) try='int endpwent_r(FILE**);'
12397 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=I_H ;;
12399 case "$endpwent_r_proto" in
12400 ''|0) try='void endpwent_r(FILE**);'
12401 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=V_H ;;
12403 case "$endpwent_r_proto" in
12404 ''|0) d_endpwent_r=undef
12406 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
12407 * ) case "$endpwent_r_proto" in
12408 REENTRANT_PROTO*) ;;
12409 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
12411 echo "Prototype: $try" ;;
12414 *) case "$usethreads" in
12415 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
12422 *) endpwent_r_proto=0
12426 : see if endservent exists
12427 set endservent d_endsent
12430 : see if endservent_r exists
12431 set endservent_r d_endservent_r
12433 case "$d_endservent_r" in
12435 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12436 case "$d_endservent_r_proto:$usethreads" in
12437 ":define") d_endservent_r_proto=define
12438 set d_endservent_r_proto endservent_r $hdrs
12442 case "$d_endservent_r_proto" in
12444 case "$endservent_r_proto" in
12445 ''|0) try='int endservent_r(struct servent_data*);'
12446 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=I_D ;;
12448 case "$endservent_r_proto" in
12449 ''|0) try='void endservent_r(struct servent_data*);'
12450 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=V_D ;;
12452 case "$endservent_r_proto" in
12453 ''|0) d_endservent_r=undef
12454 endservent_r_proto=0
12455 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
12456 * ) case "$endservent_r_proto" in
12457 REENTRANT_PROTO*) ;;
12458 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
12460 echo "Prototype: $try" ;;
12463 *) case "$usethreads" in
12464 define) echo "endservent_r has no prototype, not using it." >&4 ;;
12466 d_endservent_r=undef
12467 endservent_r_proto=0
12471 *) endservent_r_proto=0
12475 : Locate the flags for 'open()'
12478 #include <sys/types.h>
12483 #include <sys/file.h>
12485 #$i_stdlib I_STDLIB
12487 #include <stdlib.h>
12498 : check sys/file.h first to get FREAD on Sun
12499 if $test `./findhdr sys/file.h` && \
12500 set try -DI_SYS_FILE && eval $compile; then
12502 echo "<sys/file.h> defines the O_* constants..." >&4
12503 if $run ./try; then
12504 echo "and you have the 3 argument form of open()." >&4
12507 echo "but not the 3 argument form of open(). Oh, well." >&4
12510 elif $test `./findhdr fcntl.h` && \
12511 set try -DI_FCNTL && eval $compile; then
12513 echo "<fcntl.h> defines the O_* constants..." >&4
12514 if $run ./try; then
12515 echo "and you have the 3 argument form of open()." >&4
12518 echo "but not the 3 argument form of open(). Oh, well." >&4
12523 echo "I can't find the O_* constant definitions! You got problems." >&4
12529 : see if this is a sys/file.h system
12534 : do we need to include sys/file.h ?
12538 if $h_sysfile; then
12540 echo "We'll be including <sys/file.h>." >&4
12543 echo "We won't be including <sys/file.h>." >&4
12553 : see if fcntl.h is there
12558 : see if we can include fcntl.h
12564 echo "We'll be including <fcntl.h>." >&4
12567 if $h_sysfile; then
12568 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
12570 echo "We won't be including <fcntl.h>." >&4
12582 : see if fork exists
12586 : see if pipe exists
12590 : check for non-blocking I/O stuff
12591 case "$h_sysfile" in
12592 true) echo "#include <sys/file.h>" > head.c;;
12595 true) echo "#include <fcntl.h>" > head.c;;
12596 *) echo "#include <sys/fcntl.h>" > head.c;;
12601 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
12602 case "$o_nonblock" in
12604 $cat head.c > try.c
12605 $cat >>try.c <<EOCP
12607 #$i_stdlib I_STDLIB
12609 #include <stdlib.h>
12617 printf("O_NONBLOCK\n");
12621 printf("O_NDELAY\n");
12625 printf("FNDELAY\n");
12632 if eval $compile_ok; then
12633 o_nonblock=`$run ./try`
12634 case "$o_nonblock" in
12635 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
12636 *) echo "Seems like we can use $o_nonblock.";;
12639 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
12642 *) echo "Using $hint value $o_nonblock.";;
12647 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
12650 case "$d_fork:$d_pipe" in
12652 $cat head.c > try.c
12653 $cat >>try.c <<EOCP
12655 #include <sys/types.h>
12656 #include <signal.h>
12658 #$i_stdlib I_STDLIB
12660 #include <stdlib.h>
12666 #define MY_O_NONBLOCK $o_nonblock
12667 #ifndef errno /* XXX need better Configure test */
12670 #$i_unistd I_UNISTD
12672 #include <unistd.h>
12674 #$i_string I_STRING
12676 #include <string.h>
12678 #include <strings.h>
12680 $signal_t blech(int x) { exit(3); }
12682 $cat >> try.c <<'EOCP'
12690 pipe(pd); /* Down: child -> parent */
12691 pipe(pu); /* Up: parent -> child */
12694 close(pd[1]); /* Parent reads from pd[0] */
12695 close(pu[0]); /* Parent writes (blocking) to pu[1] */
12697 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
12702 signal(SIGALRM, blech);
12704 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
12706 sprintf(string, "%d\n", ret);
12707 write(2, string, strlen(string));
12710 if (errno == EAGAIN) {
12711 printf("EAGAIN\n");
12716 if (errno == EWOULDBLOCK)
12717 printf("EWOULDBLOCK\n");
12720 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
12721 sleep(2); /* Give it time to close our pipe */
12723 ret = read(pd[0], buf, 1); /* Should read EOF */
12725 sprintf(string, "%d\n", ret);
12726 write(4, string, strlen(string));
12730 close(pd[0]); /* We write to pd[1] */
12731 close(pu[1]); /* We read from pu[0] */
12732 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
12733 close(pd[1]); /* Pipe pd is now fully closed! */
12734 exit(0); /* Bye bye, thank you for playing! */
12738 if eval $compile_ok; then
12739 echo "$startsh" >mtry
12740 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
12742 ./mtry >/dev/null 2>&1
12744 0) eagain=`$cat try.out`;;
12745 1) echo "Could not perform non-blocking setting!";;
12746 2) echo "I did a successful read() for something that was not there!";;
12747 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
12748 4) echo "Could not find F_SETFL!";;
12749 *) echo "Something terribly wrong happened during testing.";;
12751 rd_nodata=`$cat try.ret`
12752 echo "A read() system call with no data present returns $rd_nodata."
12753 case "$rd_nodata" in
12756 echo "(That's peculiar, fixing that to be -1.)"
12762 echo "Forcing errno EAGAIN on read() with no data available."
12766 echo "Your read() sets errno to $eagain when no data is available."
12769 status=`$cat try.err`
12771 0) echo "And it correctly returns 0 to signal EOF.";;
12772 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
12773 *) echo "However, your read() returns '$status' on EOF??";;
12776 if test "$status" = "$rd_nodata"; then
12777 echo "WARNING: you can't distinguish between EOF and no data!"
12781 echo "I can't compile the test program--assuming errno EAGAIN will do."
12785 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
12794 echo "Using $hint value $eagain."
12795 echo "Your read() returns $rd_nodata when no data is present."
12796 case "$d_eofnblk" in
12797 "$define") echo "And you can see EOF because read() returns 0.";;
12798 "$undef") echo "But you can't see EOF status from read() returned value.";;
12800 echo "(Assuming you can't see EOF status from read anyway.)"
12806 $rm_try head.c mtry
12808 : see if _ptr and _cnt from stdio act std
12811 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
12812 echo "(Looks like you have stdio.h from BSD.)"
12813 case "$stdio_ptr" in
12814 '') stdio_ptr='((fp)->_p)'
12817 *) ptr_lval=$d_stdio_ptr_lval;;
12819 case "$stdio_cnt" in
12820 '') stdio_cnt='((fp)->_r)'
12823 *) cnt_lval=$d_stdio_cnt_lval;;
12825 case "$stdio_base" in
12826 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
12828 case "$stdio_bufsiz" in
12829 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
12831 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
12832 echo "(Looks like you have stdio.h from Linux.)"
12833 case "$stdio_ptr" in
12834 '') stdio_ptr='((fp)->_IO_read_ptr)'
12837 *) ptr_lval=$d_stdio_ptr_lval;;
12839 case "$stdio_cnt" in
12840 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
12843 *) cnt_lval=$d_stdio_cnt_lval;;
12845 case "$stdio_base" in
12846 '') stdio_base='((fp)->_IO_read_base)';;
12848 case "$stdio_bufsiz" in
12849 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
12852 case "$stdio_ptr" in
12853 '') stdio_ptr='((fp)->_ptr)'
12856 *) ptr_lval=$d_stdio_ptr_lval;;
12858 case "$stdio_cnt" in
12859 '') stdio_cnt='((fp)->_cnt)'
12862 *) cnt_lval=$d_stdio_cnt_lval;;
12864 case "$stdio_base" in
12865 '') stdio_base='((fp)->_base)';;
12867 case "$stdio_bufsiz" in
12868 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
12872 : test whether _ptr and _cnt really work
12873 echo "Checking how std your stdio is..." >&4
12876 #$i_stdlib I_STDLIB
12878 #include <stdlib.h>
12880 #define FILE_ptr(fp) $stdio_ptr
12881 #define FILE_cnt(fp) $stdio_cnt
12883 FILE *fp = fopen("try.c", "r");
12886 18 <= FILE_cnt(fp) &&
12887 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12895 if eval $compile && $to try.c; then
12896 if $run ./try; then
12897 echo "Your stdio acts pretty std."
12900 echo "Your stdio isn't very std."
12903 echo "Your stdio doesn't appear very std."
12907 # glibc 2.2.90 and above apparently change stdio streams so Perl's
12908 # direct buffer manipulation no longer works. The Configure tests
12909 # should be changed to correctly detect this, but until then,
12910 # the following check should at least let perl compile and run.
12911 # (This quick fix should be updated before 5.8.1.)
12912 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
12913 # A. Dougherty, June 3, 2002.
12914 case "$d_gnulibc" in
12916 case "$gnulibc_version" in
12920 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
12929 : Can _ptr be used as an lvalue?
12930 case "$d_stdstdio$ptr_lval" in
12931 $define$define) val=$define ;;
12934 set d_stdio_ptr_lval
12937 : Can _cnt be used as an lvalue?
12938 case "$d_stdstdio$cnt_lval" in
12939 $define$define) val=$define ;;
12942 set d_stdio_cnt_lval
12946 : test whether setting _ptr sets _cnt as a side effect
12947 d_stdio_ptr_lval_sets_cnt="$undef"
12948 d_stdio_ptr_lval_nochange_cnt="$undef"
12949 case "$d_stdio_ptr_lval$d_stdstdio" in
12951 echo "Checking to see what happens if we set the stdio ptr..." >&4
12954 /* Can we scream? */
12955 /* Eat dust sed :-) */
12956 /* In the buffer space, no one can hear you scream. */
12957 #$i_stdlib I_STDLIB
12959 #include <stdlib.h>
12961 #define FILE_ptr(fp) $stdio_ptr
12962 #define FILE_cnt(fp) $stdio_cnt
12963 #include <sys/types.h>
12965 FILE *fp = fopen("try.c", "r");
12970 puts("Fail even to read");
12973 c = getc(fp); /* Read away the first # */
12975 puts("Fail even to read");
12979 18 <= FILE_cnt(fp) &&
12980 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12982 puts("Fail even to read");
12985 ptr = (char*) FILE_ptr(fp);
12986 cnt = (size_t)FILE_cnt(fp);
12988 FILE_ptr(fp) += 42;
12990 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
12991 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
12994 if (FILE_cnt(fp) <= 20) {
12995 printf ("Fail (<20 chars to test)");
12998 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
12999 puts("Fail compare");
13002 if (cnt == FILE_cnt(fp)) {
13003 puts("Pass_unchanged");
13006 if (FILE_cnt(fp) == (cnt - 42)) {
13007 puts("Pass_changed");
13010 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
13016 if eval $compile && $to try.c; then
13017 case `$run ./try` in
13019 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
13020 d_stdio_ptr_lval_sets_cnt="$define" ;;
13022 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
13023 d_stdio_ptr_lval_nochange_cnt="$define" ;;
13025 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
13027 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
13030 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
13036 : see if _base is also standard
13038 case "$d_stdstdio" in
13042 #$i_stdlib I_STDLIB
13044 #include <stdlib.h>
13046 #define FILE_base(fp) $stdio_base
13047 #define FILE_bufsiz(fp) $stdio_bufsiz
13049 FILE *fp = fopen("try.c", "r");
13052 19 <= FILE_bufsiz(fp) &&
13053 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
13060 if eval $compile && $to try.c; then
13061 if $run ./try; then
13062 echo "And its _base field acts std."
13065 echo "But its _base field isn't std."
13068 echo "However, it seems to be lacking the _base field."
13076 : see if fast_stdio exists
13078 case "$d_stdstdio:$d_stdio_ptr_lval" in
13080 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
13082 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
13093 : see if fchdir exists
13094 set fchdir d_fchdir
13097 : see if fchmod exists
13098 set fchmod d_fchmod
13101 : see if fchown exists
13102 set fchown d_fchown
13105 : see if this is an fcntl system
13109 : See if fcntl-based locking works.
13112 #$i_stdlib I_STDLIB
13114 #include <stdlib.h>
13116 #include <unistd.h>
13118 #include <signal.h>
13119 $signal_t blech(int x) { exit(3); }
13121 #if defined(F_SETLK) && defined(F_SETLKW)
13122 struct flock flock;
13124 fd = open("try.c", O_RDONLY);
13125 flock.l_type = F_RDLCK;
13126 flock.l_whence = SEEK_SET;
13127 flock.l_start = flock.l_len = 0;
13128 signal(SIGALRM, blech);
13130 retval = fcntl(fd, F_SETLK, &flock);
13132 (retval < 0 ? exit(2) : exit(0));
13138 echo "Checking if fcntl-based file locking works... "
13142 if eval $compile_ok; then
13143 if $run ./try; then
13144 echo "Yes, it seems to work."
13147 echo "Nope, it didn't work."
13152 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
13153 *** This is (almost) impossible.
13154 *** If your NFS lock daemons are not feeling well, something like
13155 *** this may happen, please investigate. Cannot continue, aborting.
13163 echo "I'm unable to compile the test program, so I'll assume not."
13168 echo "Nope, since you don't even have fcntl()."
13171 set d_fcntl_can_lock
13175 : check for fd_set items
13178 Checking to see how well your C compiler handles fd_set and friends ...
13181 #$i_stdlib I_STDLIB
13183 #include <stdlib.h>
13185 #$i_systime I_SYS_TIME
13186 #$i_sysselct I_SYS_SELECT
13187 #$d_socket HAS_SOCKET
13188 #include <sys/types.h>
13190 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
13193 #include <sys/time.h>
13195 #ifdef I_SYS_SELECT
13196 #include <sys/select.h>
13205 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
13213 if eval $compile; then
13214 d_fds_bits="$define"
13216 echo "Well, your system knows about the normal fd_set typedef..." >&4
13217 if $run ./try; then
13218 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
13219 d_fd_macros="$define"
13222 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
13224 d_fd_macros="$undef"
13228 Hmm, your compiler has some difficulty with fd_set. Checking further...
13231 if eval $compile; then
13232 d_fds_bits="$undef"
13234 echo "Well, your system has some sort of fd_set available..." >&4
13235 if $run ./try; then
13236 echo "and you have the normal fd_set macros." >&4
13237 d_fd_macros="$define"
13240 but not the normal fd_set macros! Gross! More work for me...
13242 d_fd_macros="$undef"
13245 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
13247 d_fds_bits="$undef"
13248 d_fd_macros="$undef"
13253 : see if fgetpos exists
13254 set fgetpos d_fgetpos
13257 : see if finite exists
13258 set finite d_finite
13261 : see if finitel exists
13262 set finitel d_finitel
13265 : see if flock exists
13269 : see if prototype for flock is available
13271 set d_flockproto flock $i_sysfile sys/file.h
13274 : see if fp_class exists
13275 set fp_class d_fp_class
13278 : see if pathconf exists
13279 set pathconf d_pathconf
13282 : see if fpathconf exists
13283 set fpathconf d_fpathconf
13286 : see if fpclass exists
13287 set fpclass d_fpclass
13290 : see if fpclassify exists
13291 set fpclassify d_fpclassify
13294 : see if fpclassl exists
13295 set fpclassl d_fpclassl
13298 : check for fpos64_t
13300 echo "Checking to see if you have fpos64_t..." >&4
13303 int main() { fpos64_t x = 7; }
13306 if eval $compile; then
13308 echo "You have fpos64_t."
13311 echo "You do not have fpos64_t."
13312 case "$fpossize" in
13313 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
13320 : see if frexpl exists
13321 set frexpl d_frexpl
13324 : see if this is a sys/param system
13325 set sys/param.h i_sysparam
13328 : see if this is a sys/mount.h system
13329 set sys/mount.h i_sysmount
13332 : Check for fs_data_s
13334 echo "Checking to see if your system supports struct fs_data..." >&4
13335 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
13337 case "$d_fs_data_s" in
13338 "$define") echo "Yes, it does." ;;
13339 *) echo "No, it doesn't." ;;
13342 : see if fseeko exists
13343 set fseeko d_fseeko
13345 case "$longsize" in
13346 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
13349 : see if fsetpos exists
13350 set fsetpos d_fsetpos
13353 : see if fstatfs exists
13354 set fstatfs d_fstatfs
13357 : see if statvfs exists
13358 set statvfs d_statvfs
13361 : see if fstatvfs exists
13362 set fstatvfs d_fstatvfs
13366 : see if fsync exists
13370 : see if ftello exists
13371 set ftello d_ftello
13373 case "$longsize" in
13374 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
13377 : check for a working futimes
13380 echo "Checking if you have a working futimes()" >&4
13383 #include <sys/time.h>
13390 fd = open ("try.c", O_RDWR);
13391 if (-1 == fd) exit (1);
13392 rv = futimes (fd, NULL);
13393 exit (rv == -1 ? errno : 0);
13397 if eval $compile; then
13401 0) echo "Yes, you have" >&4
13402 d_futimes="$define"
13404 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
13408 echo "No, it does not (probably harmless)" >&4
13412 : see if ndbm.h is available
13415 : Compatibility location for RedHat 7.1
13416 set gdbm/ndbm.h i_gdbmndbm
13418 : Compatibility location for Debian 4.0
13419 set gdbm-ndbm.h i_gdbm_ndbm
13423 if $test "$i_ndbm" = "$define" -o "$i_gdbmndbm" = "$define" -o "$i_gdbm_ndbm" = "$define"; then
13424 : see if dbm_open exists
13425 set dbm_open d_dbm_open
13427 case "$d_dbm_open" in
13430 i_gdbmndbm="$undef"
13431 i_gdbm_ndbm="$undef"
13432 echo "We won't be including <ndbm.h>"
13442 ndbm_hdr_protochk='name=$1; hdr=$2;
13443 eval "ihdr=\$""i_$name";
13445 if $test "$ihdr" = "$define"; then
13446 $echo "Checking if your <$hdr> uses prototypes..." >&4;
13447 case "$d_cplusplus" in
13448 $define) ./protochk "$extern_C void dbm_close(DBM *);" literal "extern \"C\" {" $ihdr $hdr literal "}" && val="$define" ;;
13449 *) ./protochk "$extern_C void dbm_close(int, int);" $ihdr $hdr || val="$define" ;;
13452 $define) $echo "Your <$hdr> seems to have prototypes";;
13453 *) $echo "Your <$hdr> does not seem to have prototypes";;
13456 set "d_${name}_h_uses_prototypes";
13460 eval $ndbm_hdr_protochk
13461 set gdbmndbm gdbm/ndbm.h
13462 eval $ndbm_hdr_protochk
13463 set gdbm_ndbm gdbm-ndbm.h
13464 eval $ndbm_hdr_protochk
13466 : see if getaddrinfo exists
13467 set getaddrinfo d_getaddrinfo
13470 : see if getcwd exists
13471 set getcwd d_getcwd
13474 : see if getespwnam exists
13475 set getespwnam d_getespwnam
13478 : see if getfsstat exists
13479 set getfsstat d_getfsstat
13482 : see if getgrent exists
13483 set getgrent d_getgrent
13486 : see if getgrent_r exists
13487 set getgrent_r d_getgrent_r
13489 case "$d_getgrent_r" in
13491 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13492 case "$d_getgrent_r_proto:$usethreads" in
13493 ":define") d_getgrent_r_proto=define
13494 set d_getgrent_r_proto getgrent_r $hdrs
13498 case "$d_getgrent_r_proto" in
13500 case "$getgrent_r_proto" in
13501 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
13502 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBWR ;;
13504 case "$getgrent_r_proto" in
13505 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
13506 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIR ;;
13508 case "$getgrent_r_proto" in
13509 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
13510 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBW ;;
13512 case "$getgrent_r_proto" in
13513 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
13514 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBI ;;
13516 case "$getgrent_r_proto" in
13517 ''|0) try='int getgrent_r(struct group*, char*, int);'
13518 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBI ;;
13520 case "$getgrent_r_proto" in
13521 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
13522 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIH ;;
13524 case "$getgrent_r_proto" in
13525 ''|0) d_getgrent_r=undef
13527 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
13528 * ) case "$getgrent_r_proto" in
13529 REENTRANT_PROTO*) ;;
13530 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
13532 echo "Prototype: $try" ;;
13535 *) case "$usethreads" in
13536 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
13543 *) getgrent_r_proto=0
13547 : see if getgrgid_r exists
13548 set getgrgid_r d_getgrgid_r
13550 case "$d_getgrgid_r" in
13552 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13553 case "$d_getgrgid_r_proto:$usethreads" in
13554 ":define") d_getgrgid_r_proto=define
13555 set d_getgrgid_r_proto getgrgid_r $hdrs
13559 case "$d_getgrgid_r_proto" in
13561 case "$getgrgid_r_proto" in
13562 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
13563 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
13565 case "$getgrgid_r_proto" in
13566 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
13567 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
13569 case "$getgrgid_r_proto" in
13570 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
13571 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
13573 case "$getgrgid_r_proto" in
13574 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
13575 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
13577 case "$getgrgid_r_proto" in
13578 ''|0) d_getgrgid_r=undef
13580 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
13581 * ) case "$getgrgid_r_proto" in
13582 REENTRANT_PROTO*) ;;
13583 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
13585 echo "Prototype: $try" ;;
13588 *) case "$usethreads" in
13589 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
13596 *) getgrgid_r_proto=0
13600 : see if getgrnam_r exists
13601 set getgrnam_r d_getgrnam_r
13603 case "$d_getgrnam_r" in
13605 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13606 case "$d_getgrnam_r_proto:$usethreads" in
13607 ":define") d_getgrnam_r_proto=define
13608 set d_getgrnam_r_proto getgrnam_r $hdrs
13612 case "$d_getgrnam_r_proto" in
13614 case "$getgrnam_r_proto" in
13615 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
13616 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
13618 case "$getgrnam_r_proto" in
13619 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
13620 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
13622 case "$getgrnam_r_proto" in
13623 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
13624 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CBI ;;
13626 case "$getgrnam_r_proto" in
13627 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
13628 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
13630 case "$getgrnam_r_proto" in
13631 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
13632 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
13634 case "$getgrnam_r_proto" in
13635 ''|0) d_getgrnam_r=undef
13637 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
13638 * ) case "$getgrnam_r_proto" in
13639 REENTRANT_PROTO*) ;;
13640 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
13642 echo "Prototype: $try" ;;
13645 *) case "$usethreads" in
13646 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
13653 *) getgrnam_r_proto=0
13657 : see if gethostbyaddr exists
13658 set gethostbyaddr d_gethbyaddr
13661 : see if gethostbyname exists
13662 set gethostbyname d_gethbyname
13665 : see if gethostent exists
13666 set gethostent d_gethent
13669 : see how we will look up host name
13672 if set gethostname val -f d_gethname; eval $csym; $val; then
13673 echo 'gethostname() found.' >&4
13674 d_gethname="$define"
13677 if set uname val -f d_uname; eval $csym; $val; then
13680 uname() was found, but you're running xenix, and older versions of xenix
13681 have a broken uname(). If you don't really know whether your xenix is old
13682 enough to have a broken system call, use the default answer.
13687 "$define") dflt=n;;
13689 rp='Is your uname() broken?'
13692 n*) d_uname="$define"; call=uname;;
13695 echo 'uname() found.' >&4
13702 case "$d_gethname" in
13703 '') d_gethname="$undef";;
13706 '') d_uname="$undef";;
13708 case "$d_uname$d_gethname" in
13713 Every now and then someone has a $call() that lies about the hostname
13714 but can't be fixed for political or economic reasons. If you wish, I can
13715 pretend $call() isn't there and maybe compute hostname at run-time
13716 thanks to the '$phostname' command.
13719 rp="Shall I ignore $call() from now on?"
13722 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
13725 case "$phostname" in
13726 '') aphostname='';;
13727 *) case "$aphostname" in
13729 *) set X $phostname
13733 file=`./loc $file $file $pth`
13734 aphostname=`echo $file $*`
13739 case "$d_uname$d_gethname" in
13742 case "$phostname" in
13744 echo "There will be no way for $package to get your hostname." >&4;;
13746 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
13750 case "$d_phostname" in
13751 '') d_phostname="$undef";;
13754 : see if gethostbyaddr_r exists
13755 set gethostbyaddr_r d_gethostbyaddr_r
13757 case "$d_gethostbyaddr_r" in
13759 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13760 case "$d_gethostbyaddr_r_proto:$usethreads" in
13761 ":define") d_gethostbyaddr_r_proto=define
13762 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
13766 case "$d_gethostbyaddr_r_proto" in
13768 case "$gethostbyaddr_r_proto" in
13769 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13770 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
13772 case "$gethostbyaddr_r_proto" in
13773 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
13774 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
13776 case "$gethostbyaddr_r_proto" in
13777 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
13778 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
13780 case "$gethostbyaddr_r_proto" in
13781 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
13782 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
13784 case "$gethostbyaddr_r_proto" in
13785 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
13786 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
13788 case "$gethostbyaddr_r_proto" in
13789 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
13790 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
13792 case "$gethostbyaddr_r_proto" in
13793 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
13794 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
13796 case "$gethostbyaddr_r_proto" in
13797 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
13798 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
13800 case "$gethostbyaddr_r_proto" in
13801 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
13802 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
13804 case "$gethostbyaddr_r_proto" in
13805 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
13806 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
13808 case "$gethostbyaddr_r_proto" in
13809 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13810 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
13812 case "$gethostbyaddr_r_proto" in
13813 ''|0) d_gethostbyaddr_r=undef
13814 gethostbyaddr_r_proto=0
13815 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
13816 * ) case "$gethostbyaddr_r_proto" in
13817 REENTRANT_PROTO*) ;;
13818 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
13820 echo "Prototype: $try" ;;
13823 *) case "$usethreads" in
13824 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
13826 d_gethostbyaddr_r=undef
13827 gethostbyaddr_r_proto=0
13831 *) gethostbyaddr_r_proto=0
13835 : see if gethostbyname_r exists
13836 set gethostbyname_r d_gethostbyname_r
13838 case "$d_gethostbyname_r" in
13840 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13841 case "$d_gethostbyname_r_proto:$usethreads" in
13842 ":define") d_gethostbyname_r_proto=define
13843 set d_gethostbyname_r_proto gethostbyname_r $hdrs
13847 case "$d_gethostbyname_r_proto" in
13849 case "$gethostbyname_r_proto" in
13850 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
13851 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
13853 case "$gethostbyname_r_proto" in
13854 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
13855 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
13857 case "$gethostbyname_r_proto" in
13858 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
13859 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
13861 case "$gethostbyname_r_proto" in
13862 ''|0) d_gethostbyname_r=undef
13863 gethostbyname_r_proto=0
13864 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
13865 * ) case "$gethostbyname_r_proto" in
13866 REENTRANT_PROTO*) ;;
13867 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
13869 echo "Prototype: $try" ;;
13872 *) case "$usethreads" in
13873 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
13875 d_gethostbyname_r=undef
13876 gethostbyname_r_proto=0
13880 *) gethostbyname_r_proto=0
13884 : see if gethostent_r exists
13885 set gethostent_r d_gethostent_r
13887 case "$d_gethostent_r" in
13889 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13890 case "$d_gethostent_r_proto:$usethreads" in
13891 ":define") d_gethostent_r_proto=define
13892 set d_gethostent_r_proto gethostent_r $hdrs
13896 case "$d_gethostent_r_proto" in
13898 case "$gethostent_r_proto" in
13899 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
13900 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
13902 case "$gethostent_r_proto" in
13903 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
13904 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBIE ;;
13906 case "$gethostent_r_proto" in
13907 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
13908 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBIE ;;
13910 case "$gethostent_r_proto" in
13911 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
13912 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBI ;;
13914 case "$gethostent_r_proto" in
13915 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
13916 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBI ;;
13918 case "$gethostent_r_proto" in
13919 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
13920 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SD ;;
13922 case "$gethostent_r_proto" in
13923 ''|0) d_gethostent_r=undef
13924 gethostent_r_proto=0
13925 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
13926 * ) case "$gethostent_r_proto" in
13927 REENTRANT_PROTO*) ;;
13928 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
13930 echo "Prototype: $try" ;;
13933 *) case "$usethreads" in
13934 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
13936 d_gethostent_r=undef
13937 gethostent_r_proto=0
13941 *) gethostent_r_proto=0
13945 : see if prototypes for various gethostxxx netdb.h functions are available
13947 set d_gethostprotos gethostent $i_netdb netdb.h
13950 : see if getitimer exists
13951 set getitimer d_getitimer
13954 : see if getlogin exists
13955 set getlogin d_getlogin
13958 : see if getlogin_r exists
13959 set getlogin_r d_getlogin_r
13961 case "$d_getlogin_r" in
13963 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
13964 case "$d_getlogin_r_proto:$usethreads" in
13965 ":define") d_getlogin_r_proto=define
13966 set d_getlogin_r_proto getlogin_r $hdrs
13970 case "$d_getlogin_r_proto" in
13972 case "$getlogin_r_proto" in
13973 ''|0) try='int getlogin_r(char*, size_t);'
13974 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BW ;;
13976 case "$getlogin_r_proto" in
13977 ''|0) try='int getlogin_r(char*, int);'
13978 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BI ;;
13980 case "$getlogin_r_proto" in
13981 ''|0) try='char* getlogin_r(char*, size_t);'
13982 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BW ;;
13984 case "$getlogin_r_proto" in
13985 ''|0) try='char* getlogin_r(char*, int);'
13986 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BI ;;
13988 case "$getlogin_r_proto" in
13989 ''|0) d_getlogin_r=undef
13991 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
13992 * ) case "$getlogin_r_proto" in
13993 REENTRANT_PROTO*) ;;
13994 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
13996 echo "Prototype: $try" ;;
13999 *) case "$usethreads" in
14000 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
14007 *) getlogin_r_proto=0
14011 : see if getmnt exists
14012 set getmnt d_getmnt
14015 : see if getmntent exists
14016 set getmntent d_getmntent
14019 : see if getnameinfo exists
14020 set getnameinfo d_getnameinfo
14023 : see if getnetbyaddr exists
14024 set getnetbyaddr d_getnbyaddr
14027 : see if getnetbyname exists
14028 set getnetbyname d_getnbyname
14031 : see if getnetent exists
14032 set getnetent d_getnent
14035 : see if getnetbyaddr_r exists
14036 set getnetbyaddr_r d_getnetbyaddr_r
14038 case "$d_getnetbyaddr_r" in
14040 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14041 case "$d_getnetbyaddr_r_proto:$usethreads" in
14042 ":define") d_getnetbyaddr_r_proto=define
14043 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
14047 case "$d_getnetbyaddr_r_proto" in
14049 case "$getnetbyaddr_r_proto" in
14050 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
14051 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
14053 case "$getnetbyaddr_r_proto" in
14054 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
14055 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
14057 case "$getnetbyaddr_r_proto" in
14058 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
14059 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
14061 case "$getnetbyaddr_r_proto" in
14062 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
14063 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
14065 case "$getnetbyaddr_r_proto" in
14066 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
14067 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
14069 case "$getnetbyaddr_r_proto" in
14070 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
14071 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
14073 case "$getnetbyaddr_r_proto" in
14074 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
14075 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
14077 case "$getnetbyaddr_r_proto" in
14078 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
14079 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
14081 case "$getnetbyaddr_r_proto" in
14082 ''|0) d_getnetbyaddr_r=undef
14083 getnetbyaddr_r_proto=0
14084 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
14085 * ) case "$getnetbyaddr_r_proto" in
14086 REENTRANT_PROTO*) ;;
14087 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
14089 echo "Prototype: $try" ;;
14092 *) case "$usethreads" in
14093 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
14095 d_getnetbyaddr_r=undef
14096 getnetbyaddr_r_proto=0
14100 *) getnetbyaddr_r_proto=0
14104 : see if getnetbyname_r exists
14105 set getnetbyname_r d_getnetbyname_r
14107 case "$d_getnetbyname_r" in
14109 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14110 case "$d_getnetbyname_r_proto:$usethreads" in
14111 ":define") d_getnetbyname_r_proto=define
14112 set d_getnetbyname_r_proto getnetbyname_r $hdrs
14116 case "$d_getnetbyname_r_proto" in
14118 case "$getnetbyname_r_proto" in
14119 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
14120 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
14122 case "$getnetbyname_r_proto" in
14123 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
14124 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
14126 case "$getnetbyname_r_proto" in
14127 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
14128 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
14130 case "$getnetbyname_r_proto" in
14131 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
14132 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
14134 case "$getnetbyname_r_proto" in
14135 ''|0) d_getnetbyname_r=undef
14136 getnetbyname_r_proto=0
14137 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
14138 * ) case "$getnetbyname_r_proto" in
14139 REENTRANT_PROTO*) ;;
14140 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
14142 echo "Prototype: $try" ;;
14145 *) case "$usethreads" in
14146 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
14148 d_getnetbyname_r=undef
14149 getnetbyname_r_proto=0
14153 *) getnetbyname_r_proto=0
14157 : see if getnetent_r exists
14158 set getnetent_r d_getnetent_r
14160 case "$d_getnetent_r" in
14162 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14163 case "$d_getnetent_r_proto:$usethreads" in
14164 ":define") d_getnetent_r_proto=define
14165 set d_getnetent_r_proto getnetent_r $hdrs
14169 case "$d_getnetent_r_proto" in
14171 case "$getnetent_r_proto" in
14172 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
14173 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
14175 case "$getnetent_r_proto" in
14176 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
14177 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBIE ;;
14179 case "$getnetent_r_proto" in
14180 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
14181 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBIE ;;
14183 case "$getnetent_r_proto" in
14184 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
14185 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBI ;;
14187 case "$getnetent_r_proto" in
14188 ''|0) try='int getnetent_r(struct netent*, char*, int);'
14189 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBI ;;
14191 case "$getnetent_r_proto" in
14192 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
14193 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SD ;;
14195 case "$getnetent_r_proto" in
14196 ''|0) d_getnetent_r=undef
14197 getnetent_r_proto=0
14198 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
14199 * ) case "$getnetent_r_proto" in
14200 REENTRANT_PROTO*) ;;
14201 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
14203 echo "Prototype: $try" ;;
14206 *) case "$usethreads" in
14207 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
14209 d_getnetent_r=undef
14210 getnetent_r_proto=0
14214 *) getnetent_r_proto=0
14218 : see if prototypes for various getnetxxx netdb.h functions are available
14220 set d_getnetprotos getnetent $i_netdb netdb.h
14223 : see if getpagesize exists
14224 set getpagesize d_getpagsz
14227 : Optional checks for getprotobyname and getprotobynumber
14229 : see if getprotobyname exists
14230 set getprotobyname d_getpbyname
14233 : see if getprotobynumber exists
14234 set getprotobynumber d_getpbynumber
14237 : see if getprotoent exists
14238 set getprotoent d_getpent
14241 : see if getpgid exists
14242 set getpgid d_getpgid
14245 : see if getpgrp2 exists
14246 set getpgrp2 d_getpgrp2
14249 : see if getppid exists
14250 set getppid d_getppid
14253 : see if getpriority exists
14254 set getpriority d_getprior
14257 : see if getprotobyname_r exists
14258 set getprotobyname_r d_getprotobyname_r
14260 case "$d_getprotobyname_r" in
14262 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14263 case "$d_getprotobyname_r_proto:$usethreads" in
14264 ":define") d_getprotobyname_r_proto=define
14265 set d_getprotobyname_r_proto getprotobyname_r $hdrs
14269 case "$d_getprotobyname_r_proto" in
14271 case "$getprotobyname_r_proto" in
14272 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
14273 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
14275 case "$getprotobyname_r_proto" in
14276 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
14277 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
14279 case "$getprotobyname_r_proto" in
14280 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
14281 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
14283 case "$getprotobyname_r_proto" in
14284 ''|0) d_getprotobyname_r=undef
14285 getprotobyname_r_proto=0
14286 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
14287 * ) case "$getprotobyname_r_proto" in
14288 REENTRANT_PROTO*) ;;
14289 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
14291 echo "Prototype: $try" ;;
14294 *) case "$usethreads" in
14295 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
14297 d_getprotobyname_r=undef
14298 getprotobyname_r_proto=0
14302 *) getprotobyname_r_proto=0
14306 : see if getprotobynumber_r exists
14307 set getprotobynumber_r d_getprotobynumber_r
14309 case "$d_getprotobynumber_r" in
14311 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14312 case "$d_getprotobynumber_r_proto:$usethreads" in
14313 ":define") d_getprotobynumber_r_proto=define
14314 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
14318 case "$d_getprotobynumber_r_proto" in
14320 case "$getprotobynumber_r_proto" in
14321 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
14322 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
14324 case "$getprotobynumber_r_proto" in
14325 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
14326 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
14328 case "$getprotobynumber_r_proto" in
14329 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
14330 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
14332 case "$getprotobynumber_r_proto" in
14333 ''|0) d_getprotobynumber_r=undef
14334 getprotobynumber_r_proto=0
14335 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
14336 * ) case "$getprotobynumber_r_proto" in
14337 REENTRANT_PROTO*) ;;
14338 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
14340 echo "Prototype: $try" ;;
14343 *) case "$usethreads" in
14344 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
14346 d_getprotobynumber_r=undef
14347 getprotobynumber_r_proto=0
14351 *) getprotobynumber_r_proto=0
14355 : see if getprotoent_r exists
14356 set getprotoent_r d_getprotoent_r
14358 case "$d_getprotoent_r" in
14360 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14361 case "$d_getprotoent_r_proto:$usethreads" in
14362 ":define") d_getprotoent_r_proto=define
14363 set d_getprotoent_r_proto getprotoent_r $hdrs
14367 case "$d_getprotoent_r_proto" in
14369 case "$getprotoent_r_proto" in
14370 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
14371 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
14373 case "$getprotoent_r_proto" in
14374 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
14375 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBI ;;
14377 case "$getprotoent_r_proto" in
14378 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
14379 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=S_SBI ;;
14381 case "$getprotoent_r_proto" in
14382 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
14383 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SD ;;
14385 case "$getprotoent_r_proto" in
14386 ''|0) d_getprotoent_r=undef
14387 getprotoent_r_proto=0
14388 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
14389 * ) case "$getprotoent_r_proto" in
14390 REENTRANT_PROTO*) ;;
14391 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
14393 echo "Prototype: $try" ;;
14396 *) case "$usethreads" in
14397 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
14399 d_getprotoent_r=undef
14400 getprotoent_r_proto=0
14404 *) getprotoent_r_proto=0
14408 : see if prototypes for various getprotoxxx netdb.h functions are available
14410 set d_getprotoprotos getprotoent $i_netdb netdb.h
14413 : see if getprpwnam exists
14414 set getprpwnam d_getprpwnam
14417 : see if getpwent exists
14418 set getpwent d_getpwent
14421 : see if getpwent_r exists
14422 set getpwent_r d_getpwent_r
14424 case "$d_getpwent_r" in
14426 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14427 case "$d_getpwent_r_proto:$usethreads" in
14428 ":define") d_getpwent_r_proto=define
14429 set d_getpwent_r_proto getpwent_r $hdrs
14433 case "$d_getpwent_r_proto" in
14435 case "$getpwent_r_proto" in
14436 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
14437 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBWR ;;
14439 case "$getpwent_r_proto" in
14440 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
14441 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIR ;;
14443 case "$getpwent_r_proto" in
14444 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
14445 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBW ;;
14447 case "$getpwent_r_proto" in
14448 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
14449 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBI ;;
14451 case "$getpwent_r_proto" in
14452 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
14453 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBI ;;
14455 case "$getpwent_r_proto" in
14456 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
14457 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIH ;;
14459 case "$getpwent_r_proto" in
14460 ''|0) d_getpwent_r=undef
14462 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
14463 * ) case "$getpwent_r_proto" in
14464 REENTRANT_PROTO*) ;;
14465 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
14467 echo "Prototype: $try" ;;
14470 *) case "$usethreads" in
14471 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
14478 *) getpwent_r_proto=0
14482 : see if getpwnam_r exists
14483 set getpwnam_r d_getpwnam_r
14485 case "$d_getpwnam_r" in
14487 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14488 case "$d_getpwnam_r_proto:$usethreads" in
14489 ":define") d_getpwnam_r_proto=define
14490 set d_getpwnam_r_proto getpwnam_r $hdrs
14494 case "$d_getpwnam_r_proto" in
14496 case "$getpwnam_r_proto" in
14497 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
14498 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
14500 case "$getpwnam_r_proto" in
14501 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
14502 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
14504 case "$getpwnam_r_proto" in
14505 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
14506 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
14508 case "$getpwnam_r_proto" in
14509 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
14510 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
14512 case "$getpwnam_r_proto" in
14513 ''|0) d_getpwnam_r=undef
14515 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
14516 * ) case "$getpwnam_r_proto" in
14517 REENTRANT_PROTO*) ;;
14518 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
14520 echo "Prototype: $try" ;;
14523 *) case "$usethreads" in
14524 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
14531 *) getpwnam_r_proto=0
14535 : see if getpwuid_r exists
14536 set getpwuid_r d_getpwuid_r
14538 case "$d_getpwuid_r" in
14540 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14541 case "$d_getpwuid_r_proto:$usethreads" in
14542 ":define") d_getpwuid_r_proto=define
14543 set d_getpwuid_r_proto getpwuid_r $hdrs
14547 case "$d_getpwuid_r_proto" in
14549 case "$getpwuid_r_proto" in
14550 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
14551 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
14553 case "$getpwuid_r_proto" in
14554 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
14555 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
14557 case "$getpwuid_r_proto" in
14558 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
14559 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
14561 case "$getpwuid_r_proto" in
14562 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
14563 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
14565 case "$getpwuid_r_proto" in
14566 ''|0) d_getpwuid_r=undef
14568 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
14569 * ) case "$getpwuid_r_proto" in
14570 REENTRANT_PROTO*) ;;
14571 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
14573 echo "Prototype: $try" ;;
14576 *) case "$usethreads" in
14577 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
14584 *) getpwuid_r_proto=0
14588 : Optional checks for getsbyname and getsbyport
14590 : see if getservbyname exists
14591 set getservbyname d_getsbyname
14594 : see if getservbyport exists
14595 set getservbyport d_getsbyport
14598 : see if getservent exists
14599 set getservent d_getsent
14602 : see if getservbyname_r exists
14603 set getservbyname_r d_getservbyname_r
14605 case "$d_getservbyname_r" in
14607 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14608 case "$d_getservbyname_r_proto:$usethreads" in
14609 ":define") d_getservbyname_r_proto=define
14610 set d_getservbyname_r_proto getservbyname_r $hdrs
14614 case "$d_getservbyname_r_proto" in
14616 case "$getservbyname_r_proto" in
14617 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
14618 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
14620 case "$getservbyname_r_proto" in
14621 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
14622 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
14624 case "$getservbyname_r_proto" in
14625 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
14626 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
14628 case "$getservbyname_r_proto" in
14629 ''|0) d_getservbyname_r=undef
14630 getservbyname_r_proto=0
14631 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
14632 * ) case "$getservbyname_r_proto" in
14633 REENTRANT_PROTO*) ;;
14634 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
14636 echo "Prototype: $try" ;;
14639 *) case "$usethreads" in
14640 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
14642 d_getservbyname_r=undef
14643 getservbyname_r_proto=0
14647 *) getservbyname_r_proto=0
14651 : see if getservbyport_r exists
14652 set getservbyport_r d_getservbyport_r
14654 case "$d_getservbyport_r" in
14656 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14657 case "$d_getservbyport_r_proto:$usethreads" in
14658 ":define") d_getservbyport_r_proto=define
14659 set d_getservbyport_r_proto getservbyport_r $hdrs
14663 case "$d_getservbyport_r_proto" in
14665 case "$getservbyport_r_proto" in
14666 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
14667 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
14669 case "$getservbyport_r_proto" in
14670 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
14671 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
14673 case "$getservbyport_r_proto" in
14674 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
14675 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
14677 case "$getservbyport_r_proto" in
14678 ''|0) d_getservbyport_r=undef
14679 getservbyport_r_proto=0
14680 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
14681 * ) case "$getservbyport_r_proto" in
14682 REENTRANT_PROTO*) ;;
14683 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
14685 echo "Prototype: $try" ;;
14688 *) case "$usethreads" in
14689 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
14691 d_getservbyport_r=undef
14692 getservbyport_r_proto=0
14696 *) getservbyport_r_proto=0
14700 : see if getservent_r exists
14701 set getservent_r d_getservent_r
14703 case "$d_getservent_r" in
14705 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14706 case "$d_getservent_r_proto:$usethreads" in
14707 ":define") d_getservent_r_proto=define
14708 set d_getservent_r_proto getservent_r $hdrs
14712 case "$d_getservent_r_proto" in
14714 case "$getservent_r_proto" in
14715 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
14716 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBWR ;;
14718 case "$getservent_r_proto" in
14719 ''|0) try='int getservent_r(struct servent*, char*, int);'
14720 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBI ;;
14722 case "$getservent_r_proto" in
14723 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
14724 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=S_SBI ;;
14726 case "$getservent_r_proto" in
14727 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
14728 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SD ;;
14730 case "$getservent_r_proto" in
14731 ''|0) d_getservent_r=undef
14732 getservent_r_proto=0
14733 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
14734 * ) case "$getservent_r_proto" in
14735 REENTRANT_PROTO*) ;;
14736 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
14738 echo "Prototype: $try" ;;
14741 *) case "$usethreads" in
14742 define) echo "getservent_r has no prototype, not using it." >&4 ;;
14744 d_getservent_r=undef
14745 getservent_r_proto=0
14749 *) getservent_r_proto=0
14753 : see if prototypes for various getservxxx netdb.h functions are available
14755 set d_getservprotos getservent $i_netdb netdb.h
14758 : see if getspnam exists
14759 set getspnam d_getspnam
14762 : see if this is a shadow.h system
14763 set shadow.h i_shadow
14766 : see if getspnam_r exists
14767 set getspnam_r d_getspnam_r
14769 case "$d_getspnam_r" in
14771 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
14772 case "$d_getspnam_r_proto:$usethreads" in
14773 ":define") d_getspnam_r_proto=define
14774 set d_getspnam_r_proto getspnam_r $hdrs
14778 case "$d_getspnam_r_proto" in
14780 case "$getspnam_r_proto" in
14781 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
14782 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
14784 case "$getspnam_r_proto" in
14785 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
14786 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=S_CSBI ;;
14788 case "$getspnam_r_proto" in
14789 ''|0) d_getspnam_r=undef
14791 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
14792 * ) case "$getspnam_r_proto" in
14793 REENTRANT_PROTO*) ;;
14794 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
14796 echo "Prototype: $try" ;;
14799 *) case "$usethreads" in
14800 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
14807 *) getspnam_r_proto=0
14811 : see if gettimeofday or ftime exists
14812 set gettimeofday d_gettimeod
14814 case "$d_gettimeod" in
14820 val="$undef"; set d_ftime; eval $setvar
14823 case "$d_gettimeod$d_ftime" in
14826 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
14830 : see if gmtime_r exists
14831 set gmtime_r d_gmtime_r
14833 case "$d_gmtime_r" in
14835 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14836 case "$d_gmtime_r_proto:$usethreads" in
14837 ":define") d_gmtime_r_proto=define
14838 set d_gmtime_r_proto gmtime_r $hdrs
14842 case "$d_gmtime_r_proto" in
14844 case "$gmtime_r_proto" in
14845 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
14846 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=S_TS ;;
14848 case "$gmtime_r_proto" in
14849 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
14850 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=I_TS ;;
14852 case "$gmtime_r_proto" in
14853 ''|0) d_gmtime_r=undef
14855 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
14856 * ) case "$gmtime_r_proto" in
14857 REENTRANT_PROTO*) ;;
14858 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
14860 echo "Prototype: $try" ;;
14863 *) case "$usethreads" in
14864 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
14871 *) gmtime_r_proto=0
14875 : see if hasmntopt exists
14876 set hasmntopt d_hasmntopt
14879 : see if this is a netinet/in.h or sys/in.h system
14880 set netinet/in.h i_niin sys/in.h i_sysin
14883 : see if arpa/inet.h has to be included
14884 set arpa/inet.h i_arpainet
14887 : see if htonl --and friends-- exists
14892 : Maybe they are macros.
14895 $cat >htonl.c <<EOM
14897 #include <sys/types.h>
14898 #$i_niin I_NETINET_IN
14900 #$i_arpainet I_ARPA_INET
14901 #ifdef I_NETINET_IN
14902 #include <netinet/in.h>
14905 #include <sys/in.h>
14908 #include <arpa/inet.h>
14911 printf("Defined as a macro.");
14914 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
14915 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
14917 echo "But it seems to be defined as a macro." >&4
14925 : see if ilogbl exists
14926 set ilogbl d_ilogbl
14931 if set index val -f; eval $csym; $val; then
14932 if set strchr val -f d_strchr; eval $csym; $val; then
14933 if $contains strchr "$strings" >/dev/null 2>&1 ; then
14936 echo "strchr() found." >&4
14940 echo "index() found." >&4
14945 echo "index() found." >&4
14948 if set strchr val -f d_strchr; eval $csym; $val; then
14951 echo "strchr() found." >&4
14953 echo "No index() or strchr() found!" >&4
14958 set d_strchr; eval $setvar
14960 set d_index; eval $setvar
14962 : check whether inet_aton exists
14963 set inet_aton d_inetaton
14966 : see if inet_ntop exists
14967 set inet_ntop d_inetntop
14970 : see if inet_pton exists
14971 set inet_pton d_inetpton
14976 $cat >isascii.c <<EOCP
14979 #$i_stdlib I_STDLIB
14981 #include <stdlib.h>
14992 if eval $compile; then
14993 echo "isascii() found." >&4
14996 echo "isascii() NOT found." >&4
15003 : see if isfinite exists
15004 set isfinite d_isfinite
15007 : see if isinf exists
15011 : see if isnan exists
15015 : see if isnanl exists
15016 set isnanl d_isnanl
15019 : see if killpg exists
15020 set killpg d_killpg
15023 : see if lchown exists
15025 $cat > try.c <<'EOCP'
15026 /* System header to define __stub macros and hopefully few prototypes,
15027 which can conflict with char lchown(); below. */
15028 #include <assert.h>
15029 /* Override any gcc2 internal prototype to avoid an error. */
15030 /* We use char because int might match the return type of a gcc2
15031 builtin and then its argument prototype would still apply. */
15034 /* The GNU C library defines this for functions which it implements
15035 to always fail with ENOSYS. Some functions are actually named
15036 something starting with __ and the normal name is an alias. */
15037 #if defined (__stub_lchown) || defined (__stub___lchown)
15045 if eval $compile; then
15046 $echo "lchown() found." >&4
15049 $echo "lchown() NOT found." >&4
15055 : See if number of significant digits in a double precision number is known
15057 $cat >ldbl_dig.c <<EOM
15058 #$i_limits I_LIMITS
15061 #include <limits.h>
15067 printf("Contains LDBL_DIG");
15070 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
15071 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
15072 echo "LDBL_DIG found." >&4
15075 echo "LDBL_DIG NOT found." >&4
15082 : see if this is a math.h system
15086 : check to see if math.h defines _LIB_VERSION
15087 d_libm_lib_version="$undef"
15091 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
15093 #include <unistd.h>
15095 int main (int argc, char *argv[])
15097 printf ("%d\n", _LIB_VERSION);
15102 if eval $compile; then
15104 echo "Yes, it does ($foo)" >&4
15105 d_libm_lib_version="$define"
15107 echo "No, it does not (probably harmless)" >&4
15114 : see if link exists
15118 : see if localtime_r exists
15119 set localtime_r d_localtime_r
15121 case "$d_localtime_r" in
15123 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15124 case "$d_localtime_r_proto:$usethreads" in
15125 ":define") d_localtime_r_proto=define
15126 set d_localtime_r_proto localtime_r $hdrs
15130 case "$d_localtime_r_proto" in
15132 case "$localtime_r_proto" in
15133 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
15134 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=S_TS ;;
15136 case "$localtime_r_proto" in
15137 ''|0) try='int localtime_r(const time_t*, struct tm*);'
15138 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=I_TS ;;
15140 case "$localtime_r_proto" in
15141 ''|0) d_localtime_r=undef
15142 localtime_r_proto=0
15143 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
15144 * ) case "$localtime_r_proto" in
15145 REENTRANT_PROTO*) ;;
15146 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
15148 echo "Prototype: $try" ;;
15151 *) case "$usethreads" in
15152 define) echo "localtime_r has no prototype, not using it." >&4 ;;
15154 d_localtime_r=undef
15155 localtime_r_proto=0
15159 *) localtime_r_proto=0
15163 : see if localtime_r calls tzset
15164 case "$localtime_r_proto" in
15167 /* Does our libc's localtime_r call tzset ?
15168 * return 0 if so, 1 otherwise.
15170 #$i_systypes I_SYS_TYPES
15171 #$i_unistd I_UNISTD
15173 #$i_stdlib I_STDLIB
15174 #$i_string I_STRING
15175 #$i_malloc I_MALLOC
15177 # include <sys/types.h>
15180 # include <unistd.h>
15186 #include <stdlib.h>
15189 # include <string.h>
15191 # include <strings.h>
15194 # include <malloc.h>
15198 time_t t = time(0L);
15199 char w_tz[]="TZ" "=GMT+5",
15200 e_tz[]="TZ" "=GMT-5",
15201 *tz_e = (char*)malloc(16),
15202 *tz_w = (char*)malloc(16);
15203 struct tm tm_e, tm_w;
15204 memset(&tm_e,'\0',sizeof(struct tm));
15205 memset(&tm_w,'\0',sizeof(struct tm));
15210 localtime_r(&t, &tm_e);
15213 localtime_r(&t, &tm_w);
15215 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
15221 if eval $compile; then
15222 if $run ./try; then
15223 d_localtime_r_needs_tzset=undef;
15225 d_localtime_r_needs_tzset=define;
15228 d_localtime_r_needs_tzset=undef;
15232 d_localtime_r_needs_tzset=undef;
15237 : see if localeconv exists
15238 set localeconv d_locconv
15241 : see if lockf exists
15245 : see if prototype for lseek is available
15247 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
15250 : see if lstat exists
15254 : see if madvise exists
15255 set madvise d_madvise
15258 : see if malloc_size exists
15259 set malloc_size d_malloc_size
15262 : see if malloc_size_good exists
15263 set malloc_good_size d_malloc_good_size
15266 : see if mblen exists
15270 : see if mbstowcs exists
15271 set mbstowcs d_mbstowcs
15274 : see if mbtowc exists
15275 set mbtowc d_mbtowc
15278 : see if memchr exists
15279 set memchr d_memchr
15282 : see if memcmp exists
15283 set memcmp d_memcmp
15286 : see if memcpy exists
15287 set memcpy d_memcpy
15290 : see if memmove exists
15291 set memmove d_memmove
15294 : see if memset exists
15295 set memset d_memset
15298 : see if mkdir exists
15302 : see if mkdtemp exists
15303 set mkdtemp d_mkdtemp
15306 : see if mkfifo exists
15307 set mkfifo d_mkfifo
15310 : see if mkstemp exists
15311 set mkstemp d_mkstemp
15314 : see if mkstemps exists
15315 set mkstemps d_mkstemps
15318 : see if mktime exists
15319 set mktime d_mktime
15322 : see if this is a sys/mman.h system
15323 set sys/mman.h i_sysmman
15326 : see if mmap exists
15329 : see what shmat returns
15330 : default to something harmless
15332 case "$i_sysmman$d_mmap" in
15334 $cat >mmap.c <<'END'
15335 #include <sys/mman.h>
15338 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
15343 echo "and it returns ($mmaptype)." >&4
15349 : see if sqrtl exists
15353 : see if scalbnl exists
15354 set scalbnl d_scalbnl
15357 : see if modfl exists
15361 : see if prototype for modfl is available
15363 set d_modflproto modfl $i_math math.h
15366 d_modfl_pow32_bug="$undef"
15368 case "$d_longdbl$d_modfl" in
15371 Checking to see whether your modfl() is okay for large values...
15377 if $test "X$d_modflproto" != "X$define"; then
15378 $cat >>try.c <<EOCP
15379 /* Sigh. many current glibcs provide the function, but do not prototype it. */
15380 long double modfl (long double, long double *);
15383 $cat >>try.c <<EOCP
15385 long double nv = 4294967303.15;
15391 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
15395 case "$osname:$gccversion" in
15396 aix:) saveccflags="$ccflags"
15397 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
15400 if eval $compile; then
15403 *" 4294967303.150000 1.150000 4294967302.000000")
15404 echo >&4 "Your modfl() is broken for large values."
15405 d_modfl_pow32_bug="$define"
15407 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
15411 *" 4294967303.150000 0.150000 4294967303.000000")
15412 echo >&4 "Your modfl() seems okay for large values."
15414 *) echo >&4 "I don't understand your modfl() at all."
15420 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
15423 case "$osname:$gccversion" in
15424 aix:) ccflags="$saveccflags" ;; # restore
15429 if $test "$uselongdouble" = "$define"; then
15431 if $test "$d_sqrtl" != "$define"; then
15432 message="$message sqrtl"
15434 if $test "$d_modfl" != "$define"; then
15435 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
15436 echo "You have both aintl and copysignl, so I can emulate modfl."
15438 message="$message modfl"
15441 if $test "$d_frexpl" != "$define"; then
15442 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
15443 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
15445 message="$message frexpl"
15449 if $test "$message" != ""; then
15452 *** You requested the use of long doubles but you do not seem to have
15453 *** the following mathematical functions needed for long double support:
15455 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
15456 *** Cannot continue, aborting.
15464 : see if mprotect exists
15465 set mprotect d_mprotect
15468 : see if msgctl exists
15469 set msgctl d_msgctl
15472 : see if msgget exists
15473 set msgget d_msgget
15476 : see if msgsnd exists
15477 set msgsnd d_msgsnd
15480 : see if msgrcv exists
15481 set msgrcv d_msgrcv
15484 : see how much of the 'msg*(2)' library is present.
15487 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
15488 *"$undef"*) h_msg=false;;
15492 case "`ipcs 2>&1`" in
15493 "SVID messages"*"not configured"*)
15494 echo "Your $osname does not have the msg*(2) configured." >&4
15497 set msgctl d_msgctl
15499 set msgget d_msgget
15501 set msgsnd d_msgsnd
15503 set msgrcv d_msgrcv
15509 : we could also check for sys/ipc.h ...
15510 if $h_msg && $test `./findhdr sys/msg.h`; then
15511 echo "You have the full msg*(2) library." >&4
15514 echo "You don't have the full msg*(2) library." >&4
15520 : Check for msghdr_s
15522 echo "Checking to see if your system supports struct msghdr..." >&4
15523 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
15525 case "$d_msghdr_s" in
15526 "$define") echo "Yes, it does." ;;
15527 *) echo "No, it doesn't." ;;
15531 : see if msync exists
15535 : see if munmap exists
15536 set munmap d_munmap
15539 : see if nice exists
15543 : see if this is a langinfo.h system
15544 set langinfo.h i_langinfo
15547 : see if nl_langinfo exists
15548 set nl_langinfo d_nl_langinfo
15551 : check for volatile keyword
15553 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
15554 $cat >try.c <<'EOCP'
15557 typedef struct _goo_struct goo_struct;
15558 goo_struct * volatile goo = ((goo_struct *)0);
15559 struct _goo_struct {
15564 typedef unsigned short foo_t;
15565 char *volatile foo;
15567 volatile foo_t blech;
15571 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
15573 echo "Yup, it does."
15576 echo "Nope, it doesn't."
15582 : Check basic sizes
15584 $echo "Choosing the C types to be used for Perl's internal types..." >&4
15586 case "$use64bitint:$d_quad:$quadtype" in
15589 uvtype="$uquadtype"
15594 uvtype="unsigned long"
15600 case "$uselongdouble:$d_longdbl" in
15602 nvtype="long double"
15603 nvsize=$longdblsize
15610 $echo "(IV will be "$ivtype", $ivsize bytes)"
15611 $echo "(UV will be "$uvtype", $uvsize bytes)"
15612 $echo "(NV will be "$nvtype", $nvsize bytes)"
15615 #$i_inttypes I_INTTYPES
15617 #include <inttypes.h>
15622 int8_t i = INT8_MAX;
15623 uint8_t u = UINT8_MAX;
15624 printf("int8_t\n");
15627 int16_t i = INT16_MAX;
15628 uint16_t i = UINT16_MAX;
15629 printf("int16_t\n");
15632 int32_t i = INT32_MAX;
15633 uint32_t u = UINT32_MAX;
15634 printf("int32_t\n");
15639 i8type="signed char"
15640 u8type="unsigned char"
15645 '') case "$shortsize" in
15647 u16type="unsigned short"
15655 '') set try -DINT16
15656 if eval $compile; then
15657 case "`$run ./try`" in
15669 '') if $test $shortsize -ge 2; then
15671 u16type="unsigned short"
15679 '') case "$longsize" in
15681 u32type="unsigned long"
15685 *) case "$intsize" in
15687 u32type="unsigned int"
15697 '') set try -DINT32
15698 if eval $compile; then
15699 case "`$run ./try`" in
15711 '') if $test $intsize -ge 4; then
15713 u32type="unsigned int"
15721 '') case "$d_quad:$quadtype" in
15723 i64type="$quadtype"
15724 u64type="$uquadtype"
15732 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
15733 : volatile so that the compiler has to store it out to memory.
15734 if test X"$d_volatile" = X"$define"; then
15739 #$i_stdlib I_STDLIB
15741 #include <stdlib.h>
15743 #include <sys/types.h>
15744 #include <signal.h>
15746 $volatile int bletched = 0;
15747 $signal_t blech(int s) { bletched = 1; }
15752 int n = 8 * $uvsize;
15755 signal(SIGFPE, blech);
15758 for (i = 0; i < n; i++) {
15759 u = u << 1 | ($uvtype)1;
15761 if (($uvtype)d != u)
15765 d = ($nvtype)(u - 1);
15766 if (($uvtype)d != (u - 1))
15773 printf("%d\n", ((i == n) ? -n : i));
15779 d_nv_preserves_uv="$undef"
15780 if eval $compile; then
15781 nv_preserves_uv_bits="`$run ./try`"
15783 case "$nv_preserves_uv_bits" in
15785 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
15786 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
15787 d_nv_preserves_uv="$define"
15789 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
15790 d_nv_preserves_uv="$undef" ;;
15791 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
15792 nv_preserves_uv_bits="0" ;;
15796 $echo "Checking to find the largest integer value your NVs can hold..." >&4
15797 : volatile so that the compiler has to store it out to memory.
15798 if test X"$d_volatile" = X"$define"; then
15804 typedef $nvtype NV;
15811 while(count < 256) {
15812 $volatile NV up = value + 1.0;
15813 $volatile NV negated = -value;
15814 $volatile NV down = negated - 1.0;
15815 $volatile NV got_up = up - value;
15816 int up_good = got_up == 1.0;
15817 int got_down = down - negated;
15818 int down_good = got_down == -1.0;
15820 if (down_good != up_good) {
15822 "Inconsistency - up %d %f; down %d %f; for 2**%d (%.20f)\n",
15823 up_good, (double) got_up, down_good, (double) got_down,
15824 count, (double) value);
15831 fputs("256.0", stdout);
15834 fputs("2.0", stdout);
15840 fputs("*", stdout);
15846 fprintf(stderr, "Cannot overflow integer range, even at 2**%d (%.20f)\n",
15847 count, (double) value);
15853 nv_overflows_integers_at='0'
15854 if eval $compile; then
15860 The largest integer your NVs can preserve is equal to $xxx
15862 nv_overflows_integers_at="$xxx"
15865 Cannot determine the largest integer value your NVs can hold, unexpected output
15872 Cannot determine the largest integer value your NVs can hold
15879 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
15880 : volatile so that the compiler has to store it out to memory.
15881 if test X"$d_volatile" = X"$define"; then
15886 #$i_stdlib I_STDLIB
15888 #include <stdlib.h>
15890 #$i_string I_STRING
15892 # include <string.h>
15894 # include <strings.h>
15896 #include <sys/types.h>
15897 #include <signal.h>
15899 $volatile int bletched = 0;
15900 $signal_t blech(int s) { bletched = 1; }
15903 int checkit($nvtype d, char *where) {
15904 unsigned char *p = (char *)&d;
15905 unsigned char *end = p + sizeof(d);
15915 printf("No - %s: 0x", where);
15917 printf ("%02X", *p++);
15922 int main(int argc, char **argv) {
15925 fail += checkit(d, "0.0");
15927 /* The compiler shouldn't be assuming that bletched is 0 */
15930 fail += checkit(d, "bleched");
15933 signal(SIGFPE, blech);
15936 /* Paranoia - the compiler should have no way of knowing that ANSI says
15937 that argv[argc] will always be NULL. Actually, if it did assume this it
15938 would be buggy, as this is C and main() can be called from elsewhere in
15940 d = argv[argc] ? 1 : 0;
15943 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
15946 fail += checkit(d, "ternary");
15948 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
15951 printf("No - memset doesn't give 0.0\n");
15952 /* This might just blow up: */
15953 printf("(gives %g)\n", d);
15959 printf("No - something bleched\n");
15964 printf("No - %d fail(s)\n", fail);
15973 d_nv_zero_is_allbits_zero="$undef"
15974 if eval $compile; then
15980 0.0 is represented as all bits zero in memory
15982 d_nv_zero_is_allbits_zero="$define"
15985 0.0 is not represented as all bits zero in memory
15987 d_nv_zero_is_allbits_zero="$undef"
15992 0.0 is not represented as all bits zero in memory
15994 d_nv_zero_is_allbits_zero="$undef"
16000 : check for off64_t
16002 echo "Checking to see if you have off64_t..." >&4
16004 #include <sys/types.h>
16005 #include <unistd.h>
16006 int main() { off64_t x = 7; }
16009 if eval $compile; then
16011 echo "You have off64_t."
16014 echo "You do not have off64_t."
16015 case "$lseeksize" in
16016 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
16023 : how to create joinable pthreads
16024 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
16026 echo "Checking what constant to use for creating joinable pthreads..." >&4
16027 $cat >try.c <<'EOCP'
16028 #include <pthread.h>
16030 int detachstate = JOINABLE;
16033 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
16034 if eval $compile; then
16035 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
16036 val="$undef" # Yes, undef.
16037 set d_old_pthread_create_joinable
16040 set old_pthread_create_joinable
16043 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
16044 if eval $compile; then
16045 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
16047 set d_old_pthread_create_joinable
16049 val=PTHREAD_CREATE_UNDETACHED
16050 set old_pthread_create_joinable
16053 set try -DJOINABLE=__UNDETACHED
16054 if eval $compile; then
16055 echo "You seem to use __UNDETACHED." >&4
16057 set d_old_pthread_create_joinable
16060 set old_pthread_create_joinable
16063 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
16065 set d_old_pthread_create_joinable
16068 set old_pthread_create_joinable
16075 d_old_pthread_create_joinable="$undef"
16076 old_pthread_create_joinable=""
16079 : see if pause exists
16083 : see if poll exists
16087 : see if prctl exists
16091 : see if prctl supports PR_SET_NAME
16092 d_prctl_set_name=$undef
16096 #include <sys/prctl.h>
16098 int main (int argc, char *argv[])
16100 return (prctl (PR_SET_NAME, "Test"));
16104 if eval $compile_ok && $run ./try; then
16105 echo "Your prctl (PR_SET_NAME, ...) works"
16106 d_prctl_set_name=$define
16112 : see if readlink exists
16113 set readlink d_readlink
16116 : Check if exe is symlink to abs path of executing program
16120 case "$d_readlink" in
16122 if $issymlink /proc/self/exe ; then
16123 $ls -l /proc/self/exe > reflect
16124 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
16125 echo "You have Linux-like /proc/self/exe."
16126 procselfexe='"/proc/self/exe"'
16130 if $issymlink /proc/curproc/file ; then
16131 $ls -l /proc/curproc/file > reflect
16132 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
16133 echo "You have BSD-like /proc/curproc/file."
16134 procselfexe='"/proc/curproc/file"'
16144 : backward compatibility for d_hvfork
16145 if test X$d_hvfork != X; then
16146 d_vfork="$d_hvfork"
16149 : see if there is a vfork
16154 d_pseudofork=$undef
16156 : Ok, but do we want to use it. vfork is reportedly unreliable in
16157 : perl on Solaris 2.x, and probably elsewhere.
16161 case "$usevfork" in
16167 Perl can only use a vfork() that doesn't suffer from strict
16168 restrictions on calling functions or modifying global data in
16169 the child. For example, glibc-2.1 contains such a vfork()
16170 that is unsuitable. If your system provides a proper fork()
16171 call, chances are that you do NOT want perl to use vfork().
16174 rp="Do you still want to use vfork()?"
16179 echo "Ok, we won't use vfork()."
16188 $define) usevfork='true';;
16189 *) usevfork='false';;
16192 : see whether the pthread_atfork exists
16194 #include <pthread.h>
16197 #ifdef PTHREAD_ATFORK
16198 pthread_atfork(NULL,NULL,NULL);
16203 : see if pthread_atfork exists
16204 set try -DPTHREAD_ATFORK
16205 if eval $compile; then
16210 case "$usethreads" in
16213 $define) echo 'pthread_atfork found.' >&4 ;;
16214 *) echo 'pthread_atfork NOT found.' >&4 ;;
16217 set d_pthread_atfork
16220 : see if pthread_attr_setscope exists
16221 set pthread_attr_setscope d_pthread_attr_setscope
16224 : see whether the various POSIXish _yields exist
16226 #include <pthread.h>
16232 #ifdef PTHREAD_YIELD
16235 #ifdef PTHREAD_YIELD_NULL
16236 pthread_yield(NULL);
16242 : see if sched_yield exists
16243 set try -DSCHED_YIELD
16244 if eval $compile; then
16246 sched_yield='sched_yield()'
16250 case "$usethreads" in
16253 $define) echo 'sched_yield() found.' >&4 ;;
16254 *) echo 'sched_yield() NOT found.' >&4 ;;
16260 : see if pthread_yield exists
16261 set try -DPTHREAD_YIELD
16262 if eval $compile; then
16264 case "$sched_yield" in
16265 '') sched_yield='pthread_yield()' ;;
16268 set try -DPTHREAD_YIELD_NULL
16269 if eval $compile; then
16271 case "$sched_yield" in
16272 '') sched_yield='pthread_yield(NULL)' ;;
16278 case "$usethreads" in
16281 $define) echo 'pthread_yield() found.' >&4 ;;
16282 *) echo 'pthread_yield() NOT found.' >&4 ;;
16286 set d_pthread_yield
16288 case "$sched_yield" in
16289 '') sched_yield=undef ;;
16293 : see if random_r exists
16294 set random_r d_random_r
16296 case "$d_random_r" in
16298 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16299 case "$d_random_r_proto:$usethreads" in
16300 ":define") d_random_r_proto=define
16301 set d_random_r_proto random_r $hdrs
16305 case "$d_random_r_proto" in
16307 case "$random_r_proto" in
16308 ''|0) try='int random_r(int*, struct random_data*);'
16309 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_iS ;;
16311 case "$random_r_proto" in
16312 ''|0) try='int random_r(long*, struct random_data*);'
16313 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_lS ;;
16315 case "$random_r_proto" in
16316 ''|0) try='int random_r(struct random_data*, int32_t*);'
16317 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_St ;;
16319 case "$random_r_proto" in
16320 ''|0) d_random_r=undef
16322 echo "Disabling random_r, cannot determine prototype." >&4 ;;
16323 * ) case "$random_r_proto" in
16324 REENTRANT_PROTO*) ;;
16325 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
16327 echo "Prototype: $try" ;;
16330 *) case "$usethreads" in
16331 define) echo "random_r has no prototype, not using it." >&4 ;;
16338 *) random_r_proto=0
16342 : see if readdir and friends exist
16343 set readdir d_readdir
16345 set seekdir d_seekdir
16347 set telldir d_telldir
16349 set rewinddir d_rewinddir
16352 : see if readdir64_r exists
16353 set readdir64_r d_readdir64_r
16355 case "$d_readdir64_r" in
16357 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16358 case "$d_readdir64_r_proto:$usethreads" in
16359 ":define") d_readdir64_r_proto=define
16360 set d_readdir64_r_proto readdir64_r $hdrs
16364 case "$d_readdir64_r_proto" in
16366 case "$readdir64_r_proto" in
16367 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
16368 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TSR ;;
16370 case "$readdir64_r_proto" in
16371 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
16372 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TS ;;
16374 case "$readdir64_r_proto" in
16375 ''|0) d_readdir64_r=undef
16376 readdir64_r_proto=0
16377 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
16378 * ) case "$readdir64_r_proto" in
16379 REENTRANT_PROTO*) ;;
16380 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
16382 echo "Prototype: $try" ;;
16385 *) case "$usethreads" in
16386 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
16388 d_readdir64_r=undef
16389 readdir64_r_proto=0
16393 *) readdir64_r_proto=0
16397 : see if readdir_r exists
16398 set readdir_r d_readdir_r
16400 case "$d_readdir_r" in
16402 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16403 case "$d_readdir_r_proto:$usethreads" in
16404 ":define") d_readdir_r_proto=define
16405 set d_readdir_r_proto readdir_r $hdrs
16409 case "$d_readdir_r_proto" in
16411 case "$readdir_r_proto" in
16412 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
16413 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TSR ;;
16415 case "$readdir_r_proto" in
16416 ''|0) try='int readdir_r(DIR*, struct dirent*);'
16417 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TS ;;
16419 case "$readdir_r_proto" in
16420 ''|0) d_readdir_r=undef
16422 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
16423 * ) case "$readdir_r_proto" in
16424 REENTRANT_PROTO*) ;;
16425 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
16427 echo "Prototype: $try" ;;
16430 *) case "$usethreads" in
16431 define) echo "readdir_r has no prototype, not using it." >&4 ;;
16438 *) readdir_r_proto=0
16442 : see if readv exists
16446 : see if recvmsg exists
16447 set recvmsg d_recvmsg
16450 : see if rename exists
16451 set rename d_rename
16454 : see if rmdir exists
16458 : see if memory.h is available.
16463 : See if it conflicts with string.h
16469 $cppstdin $cppflags $cppminus < $strings > mem.h
16470 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
16472 echo "We won't be including <memory.h>."
16482 : can bcopy handle overlapping blocks?
16485 case "$d_memmove" in
16486 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
16487 *) case "$d_bcopy" in
16489 echo "Checking to see if bcopy() can do overlapping copies..." >&4
16491 #$i_memory I_MEMORY
16492 #$i_stdlib I_STDLIB
16493 #$i_string I_STRING
16494 #$i_unistd I_UNISTD
16496 $cat >>try.c <<'EOCP'
16499 # include <memory.h>
16502 # include <stdlib.h>
16505 # include <string.h>
16507 # include <strings.h>
16510 # include <unistd.h> /* Needed for NetBSD */
16514 char buf[128], abc[128];
16520 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16521 try to store the string in read-only memory. */
16522 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
16524 for (align = 7; align >= 0; align--) {
16525 for (len = 36; len; len--) {
16527 bcopy(abc, b, len);
16528 for (off = 1; off <= len; off++) {
16529 bcopy(b, b+off, len);
16530 bcopy(b+off, b, len);
16531 if (bcmp(b, abc, len))
16540 if eval $compile_ok; then
16541 if $run ./try 2>/dev/null; then
16542 echo "Yes, it can."
16545 echo "It can't, sorry."
16548 echo "(I can't compile the test program, so we'll assume not...)"
16558 : can memcpy handle overlapping blocks?
16561 case "$d_memmove" in
16562 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
16563 *) case "$d_memcpy" in
16565 echo "Checking to see if memcpy() can do overlapping copies..." >&4
16567 #$i_memory I_MEMORY
16568 #$i_stdlib I_STDLIB
16569 #$i_string I_STRING
16570 #$i_unistd I_UNISTD
16572 $cat >>try.c <<'EOCP'
16575 # include <memory.h>
16578 # include <stdlib.h>
16581 # include <string.h>
16583 # include <strings.h>
16586 # include <unistd.h> /* Needed for NetBSD */
16590 char buf[128], abc[128];
16596 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16597 try to store the string in read-only memory. */
16598 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
16600 for (align = 7; align >= 0; align--) {
16601 for (len = 36; len; len--) {
16603 memcpy(b, abc, len);
16604 for (off = 1; off <= len; off++) {
16605 memcpy(b+off, b, len);
16606 memcpy(b, b+off, len);
16607 if (memcmp(b, abc, len))
16616 if eval $compile_ok; then
16617 if $run ./try 2>/dev/null; then
16618 echo "Yes, it can."
16621 echo "It can't, sorry."
16624 echo "(I can't compile the test program, so we'll assume not...)"
16634 : can memcmp be trusted to compare relative magnitude?
16636 case "$d_memcmp" in
16639 echo "Checking if your memcmp() can compare relative magnitude..." >&4
16641 #$i_memory I_MEMORY
16642 #$i_stdlib I_STDLIB
16643 #$i_string I_STRING
16644 #$i_unistd I_UNISTD
16646 $cat >>try.c <<'EOCP'
16649 # include <memory.h>
16652 # include <stdlib.h>
16655 # include <string.h>
16657 # include <strings.h>
16660 # include <unistd.h> /* Needed for NetBSD */
16666 if ((a < b) && memcmp(&a, &b, 1) < 0)
16672 if eval $compile_ok; then
16673 if $run ./try 2>/dev/null; then
16674 echo "Yes, it can."
16677 echo "No, it can't (it uses signed chars)."
16680 echo "(I can't compile the test program, so we'll assume not...)"
16688 : see if prototype for sbrk is available
16690 set d_sbrkproto sbrk $i_unistd unistd.h
16693 : see if select exists
16694 set select d_select
16697 : see if semctl exists
16698 set semctl d_semctl
16701 : see if semget exists
16702 set semget d_semget
16705 : see if semop exists
16709 : see how much of the 'sem*(2)' library is present.
16712 case "$d_semctl$d_semget$d_semop" in
16713 *"$undef"*) h_sem=false;;
16717 case "`ipcs 2>&1`" in
16718 "SVID messages"*"not configured"*)
16719 echo "Your $osname does not have the sem*(2) configured." >&4
16722 set semctl d_semctl
16724 set semget d_semget
16732 : we could also check for sys/ipc.h ...
16733 if $h_sem && $test `./findhdr sys/sem.h`; then
16734 echo "You have the full sem*(2) library." >&4
16737 echo "You don't have the full sem*(2) library." >&4
16743 : see whether sys/sem.h defines union semun
16745 $cat > try.c <<'END'
16746 #include <sys/types.h>
16747 #include <sys/ipc.h>
16748 #include <sys/sem.h>
16749 int main () { union semun semun; semun.buf = 0; }
16752 if eval $compile; then
16753 echo "You have union semun in <sys/sem.h>." >&4
16756 echo "You do not have union semun in <sys/sem.h>." >&4
16763 : see how to do semctl IPC_STAT
16767 $cat > tryh.h <<END
16770 # define S_IRUSR S_IREAD
16771 # define S_IWUSR S_IWRITE
16772 # define S_IXUSR S_IEXEC
16774 # define S_IRUSR 0400
16775 # define S_IWUSR 0200
16776 # define S_IXUSR 0100
16778 # define S_IRGRP (S_IRUSR>>3)
16779 # define S_IWGRP (S_IWUSR>>3)
16780 # define S_IXGRP (S_IXUSR>>3)
16781 # define S_IROTH (S_IRUSR>>6)
16782 # define S_IWOTH (S_IWUSR>>6)
16783 # define S_IXOTH (S_IXUSR>>6)
16786 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
16787 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
16788 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
16791 : see whether semctl IPC_STAT can use union semun
16792 case "$d_semctl_semun" in
16796 #include <sys/types.h>
16797 #include <sys/ipc.h>
16798 #include <sys/sem.h>
16799 #include <sys/stat.h>
16806 #$d_union_semun HAS_UNION_SEMUN
16809 #ifndef HAS_UNION_SEMUN
16812 struct semid_ds *buf;
16813 unsigned short *array;
16819 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16820 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16822 struct semid_ds argbuf;
16825 st = semctl(sem, 0, IPC_STAT, arg);
16829 # endif /* IPC_STAT */
16830 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16832 if (semctl(sem, 0, IPC_RMID, arg) != 0)
16833 # endif /* IPC_RMID */
16834 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16836 #endif /* IPC_PRIVATE && ... */
16837 printf("semget failed: errno = %d\n", errno);
16842 if eval $compile; then
16845 semun) val="$define" ;;
16853 case "$d_semctl_semun" in
16855 echo "You can use union semun for semctl IPC_STAT." >&4
16858 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
16863 : see whether semctl IPC_STAT can use struct semid_ds pointer
16864 case "$d_semctl_semid_ds" in
16867 $cat > try.c <<'END'
16868 #include <sys/types.h>
16869 #include <sys/ipc.h>
16870 #include <sys/sem.h>
16871 #include <sys/stat.h>
16879 struct semid_ds arg;
16882 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16883 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16886 st = semctl(sem, 0, IPC_STAT, &arg);
16888 printf("semid_ds\n");
16890 # endif /* IPC_STAT */
16891 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16893 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
16894 # endif /* IPC_RMID */
16895 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16897 #endif /* IPC_PRIVATE && ... */
16898 printf("semget failed: errno = %d\n", errno);
16904 if eval $compile; then
16907 semid_ds) val="$define" ;;
16911 set d_semctl_semid_ds
16915 case "$d_semctl_semid_ds" in
16917 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
16919 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
16925 # We do not have the full sem*(2) library, so assume we can not
16931 set d_semctl_semid_ds
16937 : see if sendmsg exists
16938 set sendmsg d_sendmsg
16941 : see if setegid exists
16942 set setegid d_setegid
16945 : see if seteuid exists
16946 set seteuid d_seteuid
16949 : see if setgrent exists
16950 set setgrent d_setgrent
16953 : see if setgrent_r exists
16954 set setgrent_r d_setgrent_r
16956 case "$d_setgrent_r" in
16958 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
16959 case "$d_setgrent_r_proto:$usethreads" in
16960 ":define") d_setgrent_r_proto=define
16961 set d_setgrent_r_proto setgrent_r $hdrs
16965 case "$d_setgrent_r_proto" in
16967 case "$setgrent_r_proto" in
16968 ''|0) try='int setgrent_r(FILE**);'
16969 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=I_H ;;
16971 case "$setgrent_r_proto" in
16972 ''|0) try='void setgrent_r(FILE**);'
16973 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=V_H ;;
16975 case "$setgrent_r_proto" in
16976 ''|0) d_setgrent_r=undef
16978 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
16979 * ) case "$setgrent_r_proto" in
16980 REENTRANT_PROTO*) ;;
16981 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
16983 echo "Prototype: $try" ;;
16986 *) case "$usethreads" in
16987 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
16994 *) setgrent_r_proto=0
16998 : see if sethostent exists
16999 set sethostent d_sethent
17002 : see if sethostent_r exists
17003 set sethostent_r d_sethostent_r
17005 case "$d_sethostent_r" in
17007 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17008 case "$d_sethostent_r_proto:$usethreads" in
17009 ":define") d_sethostent_r_proto=define
17010 set d_sethostent_r_proto sethostent_r $hdrs
17014 case "$d_sethostent_r_proto" in
17016 case "$sethostent_r_proto" in
17017 ''|0) try='int sethostent_r(int, struct hostent_data*);'
17018 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=I_ID ;;
17020 case "$sethostent_r_proto" in
17021 ''|0) try='void sethostent_r(int, struct hostent_data*);'
17022 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=V_ID ;;
17024 case "$sethostent_r_proto" in
17025 ''|0) d_sethostent_r=undef
17026 sethostent_r_proto=0
17027 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
17028 * ) case "$sethostent_r_proto" in
17029 REENTRANT_PROTO*) ;;
17030 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
17032 echo "Prototype: $try" ;;
17035 *) case "$usethreads" in
17036 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
17038 d_sethostent_r=undef
17039 sethostent_r_proto=0
17043 *) sethostent_r_proto=0
17047 : see if setitimer exists
17048 set setitimer d_setitimer
17051 : see if setlinebuf exists
17052 set setlinebuf d_setlinebuf
17055 : see if setlocale exists
17056 set setlocale d_setlocale
17059 : see if locale.h is available
17060 set locale.h i_locale
17063 : see if setlocale_r exists
17064 set setlocale_r d_setlocale_r
17066 case "$d_setlocale_r" in
17068 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
17069 case "$d_setlocale_r_proto:$usethreads" in
17070 ":define") d_setlocale_r_proto=define
17071 set d_setlocale_r_proto setlocale_r $hdrs
17075 case "$d_setlocale_r_proto" in
17077 case "$setlocale_r_proto" in
17078 ''|0) try='int setlocale_r(int, const char*, char*, int);'
17079 ./protochk "$extern_C $try" $hdrs && setlocale_r_proto=I_ICBI ;;
17081 case "$setlocale_r_proto" in
17082 ''|0) d_setlocale_r=undef
17083 setlocale_r_proto=0
17084 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
17085 * ) case "$setlocale_r_proto" in
17086 REENTRANT_PROTO*) ;;
17087 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
17089 echo "Prototype: $try" ;;
17092 *) case "$usethreads" in
17093 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
17095 d_setlocale_r=undef
17096 setlocale_r_proto=0
17100 *) setlocale_r_proto=0
17104 : see if setnetent exists
17105 set setnetent d_setnent
17108 : see if setnetent_r exists
17109 set setnetent_r d_setnetent_r
17111 case "$d_setnetent_r" in
17113 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17114 case "$d_setnetent_r_proto:$usethreads" in
17115 ":define") d_setnetent_r_proto=define
17116 set d_setnetent_r_proto setnetent_r $hdrs
17120 case "$d_setnetent_r_proto" in
17122 case "$setnetent_r_proto" in
17123 ''|0) try='int setnetent_r(int, struct netent_data*);'
17124 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=I_ID ;;
17126 case "$setnetent_r_proto" in
17127 ''|0) try='void setnetent_r(int, struct netent_data*);'
17128 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=V_ID ;;
17130 case "$setnetent_r_proto" in
17131 ''|0) d_setnetent_r=undef
17132 setnetent_r_proto=0
17133 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
17134 * ) case "$setnetent_r_proto" in
17135 REENTRANT_PROTO*) ;;
17136 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
17138 echo "Prototype: $try" ;;
17141 *) case "$usethreads" in
17142 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
17144 d_setnetent_r=undef
17145 setnetent_r_proto=0
17149 *) setnetent_r_proto=0
17153 : see if setprotoent exists
17154 set setprotoent d_setpent
17157 : see if setpgid exists
17158 set setpgid d_setpgid
17161 : see if setpgrp2 exists
17162 set setpgrp2 d_setpgrp2
17165 : see if setpriority exists
17166 set setpriority d_setprior
17169 : see if setproctitle exists
17170 set setproctitle d_setproctitle
17173 : see if setprotoent_r exists
17174 set setprotoent_r d_setprotoent_r
17176 case "$d_setprotoent_r" in
17178 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17179 case "$d_setprotoent_r_proto:$usethreads" in
17180 ":define") d_setprotoent_r_proto=define
17181 set d_setprotoent_r_proto setprotoent_r $hdrs
17185 case "$d_setprotoent_r_proto" in
17187 case "$setprotoent_r_proto" in
17188 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
17189 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=I_ID ;;
17191 case "$setprotoent_r_proto" in
17192 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
17193 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=V_ID ;;
17195 case "$setprotoent_r_proto" in
17196 ''|0) d_setprotoent_r=undef
17197 setprotoent_r_proto=0
17198 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
17199 * ) case "$setprotoent_r_proto" in
17200 REENTRANT_PROTO*) ;;
17201 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
17203 echo "Prototype: $try" ;;
17206 *) case "$usethreads" in
17207 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
17209 d_setprotoent_r=undef
17210 setprotoent_r_proto=0
17214 *) setprotoent_r_proto=0
17218 : see if setpwent exists
17219 set setpwent d_setpwent
17222 : see if setpwent_r exists
17223 set setpwent_r d_setpwent_r
17225 case "$d_setpwent_r" in
17227 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
17228 case "$d_setpwent_r_proto:$usethreads" in
17229 ":define") d_setpwent_r_proto=define
17230 set d_setpwent_r_proto setpwent_r $hdrs
17234 case "$d_setpwent_r_proto" in
17236 case "$setpwent_r_proto" in
17237 ''|0) try='int setpwent_r(FILE**);'
17238 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=I_H ;;
17240 case "$setpwent_r_proto" in
17241 ''|0) try='void setpwent_r(FILE**);'
17242 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=V_H ;;
17244 case "$setpwent_r_proto" in
17245 ''|0) d_setpwent_r=undef
17247 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
17248 * ) case "$setpwent_r_proto" in
17249 REENTRANT_PROTO*) ;;
17250 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
17252 echo "Prototype: $try" ;;
17255 *) case "$usethreads" in
17256 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
17263 *) setpwent_r_proto=0
17267 : see if setregid exists
17268 set setregid d_setregid
17270 set setresgid d_setresgid
17273 : see if setreuid exists
17274 set setreuid d_setreuid
17276 set setresuid d_setresuid
17279 : see if setrgid exists
17280 set setrgid d_setrgid
17283 : see if setruid exists
17284 set setruid d_setruid
17287 : see if setservent exists
17288 set setservent d_setsent
17291 : see if setservent_r exists
17292 set setservent_r d_setservent_r
17294 case "$d_setservent_r" in
17296 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17297 case "$d_setservent_r_proto:$usethreads" in
17298 ":define") d_setservent_r_proto=define
17299 set d_setservent_r_proto setservent_r $hdrs
17303 case "$d_setservent_r_proto" in
17305 case "$setservent_r_proto" in
17306 ''|0) try='int setservent_r(int, struct servent_data*);'
17307 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=I_ID ;;
17309 case "$setservent_r_proto" in
17310 ''|0) try='void setservent_r(int, struct servent_data*);'
17311 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=V_ID ;;
17313 case "$setservent_r_proto" in
17314 ''|0) d_setservent_r=undef
17315 setservent_r_proto=0
17316 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
17317 * ) case "$setservent_r_proto" in
17318 REENTRANT_PROTO*) ;;
17319 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
17321 echo "Prototype: $try" ;;
17324 *) case "$usethreads" in
17325 define) echo "setservent_r has no prototype, not using it." >&4 ;;
17327 d_setservent_r=undef
17328 setservent_r_proto=0
17332 *) setservent_r_proto=0
17336 : see if setsid exists
17337 set setsid d_setsid
17340 : see if setvbuf exists
17341 set setvbuf d_setvbuf
17344 : see if sfio.h is available
17348 : see if sfio library is available
17359 : Ok, but do we want to use it.
17363 true|$define|[yY]*) dflt='y';;
17366 echo "$package can use the sfio library, but it is experimental."
17367 case "$useperlio" in
17369 echo "For sfio also the PerlIO abstraction layer is needed."
17370 echo "Earlier you said you wouldn't want that."
17373 rp="You seem to have sfio available, do you want to try using it?"
17376 y|Y) echo "Ok, turning on both sfio and PerlIO, then."
17377 useperlio="$define"
17380 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
17385 *) case "$usesfio" in
17386 true|$define|[yY]*)
17387 echo "Sorry, cannot find sfio on this machine." >&4
17388 echo "Ignoring your setting of usesfio=$usesfio." >&4
17397 $define) usesfio='true';;
17398 *) usesfio='false';;
17402 *) : Remove sfio from list of libraries to use
17405 echo "Removing unneeded -lsfio from library list" >&4
17406 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
17409 echo "libs = $libs" >&4
17416 : see if shmctl exists
17417 set shmctl d_shmctl
17420 : see if shmget exists
17421 set shmget d_shmget
17424 : see if shmat exists
17427 : see what shmat returns
17430 $cat >shmat.c <<'END'
17431 #include <sys/shm.h>
17434 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
17439 echo "and it returns ($shmattype)." >&4
17440 : see if a prototype for shmat is available
17441 xxx=`./findhdr sys/shm.h`
17442 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
17443 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
17454 set d_shmatprototype
17457 : see if shmdt exists
17461 : see how much of the 'shm*(2)' library is present.
17464 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
17465 *"$undef"*) h_shm=false;;
17469 case "`ipcs 2>&1`" in
17470 "SVID shared memory"*"not configured"*)
17471 echo "Your $osname does not have the shm*(2) configured." >&4
17474 set shmctl d_shmctl
17476 set shmget d_shmget
17486 : we could also check for sys/ipc.h ...
17487 if $h_shm && $test `./findhdr sys/shm.h`; then
17488 echo "You have the full shm*(2) library." >&4
17491 echo "You don't have the full shm*(2) library." >&4
17497 : see if we have sigaction
17499 if set sigaction val -f d_sigaction; eval $csym; $val; then
17500 echo 'sigaction() found.' >&4
17503 #include <sys/types.h>
17504 #include <signal.h>
17505 #$i_stdlib I_STDLIB
17507 #include <stdlib.h>
17511 struct sigaction act, oact;
17513 oact.sa_handler = 0;
17514 /* so that act and oact are used */
17515 exit(act.sa_flags == 0 && oact.sa_handler == 0);
17519 if eval $compile_ok; then
17522 echo "But you don't seem to have a useable struct sigaction." >&4
17526 echo 'sigaction NOT found.' >&4
17529 set d_sigaction; eval $setvar
17532 : see if this is a sunmath.h system
17533 set sunmath.h i_sunmath
17536 : see if signbit exists
17537 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
17540 #$i_sunmath I_SUNMATH
17544 #ifdef I_SUNMATH /* Solaris special math library */
17545 # include <sunmath.h>
17548 int main(int argc, char **argv)
17552 if ((signbit(x) == 0) && (signbit(y) != 0))
17560 if eval $compile; then
17561 if $run ./try; then
17565 $echo "Signbit seems to be available, but doesn't work as I expected."
17566 $echo "I won't use it." >&4
17577 : see if sigprocmask exists
17578 set sigprocmask d_sigprocmask
17581 : see if sigsetjmp exists
17583 case "$d_sigsetjmp" in
17586 #include <setjmp.h>
17587 #$i_stdlib I_STDLIB
17589 #include <stdlib.h>
17595 if (sigsetjmp(env,1))
17598 siglongjmp(env, 1);
17603 if eval $compile; then
17604 if $run ./try >/dev/null 2>&1; then
17605 echo "POSIX sigsetjmp found." >&4
17609 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
17615 echo "sigsetjmp not found." >&4
17619 *) val="$d_sigsetjmp"
17620 case "$d_sigsetjmp" in
17621 $define) echo "POSIX sigsetjmp found." >&4;;
17622 $undef) echo "sigsetjmp not found." >&4;;
17630 : see if snprintf exists
17631 set snprintf d_snprintf
17634 : see if vsnprintf exists
17635 set vsnprintf d_vsnprintf
17638 case "$d_snprintf-$d_vsnprintf" in
17641 Checking whether your snprintf() and vsnprintf() work okay...
17643 $cat >try.c <<'EOCP'
17644 /* v?snprintf testing logic courtesy of Russ Allbery.
17645 * According to C99:
17646 * - if the buffer is too short it still must be \0-terminated
17647 * - if the buffer is too short the potentially required length
17648 * must be returned and not -1
17649 * - if the buffer is NULL the potentially required length
17650 * must be returned and not -1 or core dump
17653 #include <stdarg.h>
17657 int test (char *format, ...)
17662 va_start (args, format);
17663 count = vsnprintf (buf, sizeof buf, format, args);
17670 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
17671 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
17675 if eval $compile; then
17678 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
17680 Your snprintf() and snprintf() don't seem to be working okay.
17682 d_snprintf="$undef"
17683 d_vsnprintf="$undef"
17687 echo "(I can't seem to compile the test program--assuming they don't)"
17688 d_snprintf="$undef"
17689 d_vsnprintf="$undef"
17695 : see if sockatmark exists
17696 set sockatmark d_sockatmark
17699 : see if prototype for sockatmark is available
17701 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
17704 : see if socks5_init exists
17705 set socks5_init d_socks5_init
17708 : see if sprintf returns the length of the string in the buffer as per ANSI
17709 $echo "Checking whether sprintf returns the length of the string..." >&4
17712 #$i_stdlib I_STDLIB
17714 #include <stdlib.h>
17716 #$i_string I_STRING
17718 # include <string.h>
17720 # include <strings.h>
17729 int check (size_t expect, int test) {
17730 size_t got = strlen(buffer);
17734 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
17739 int main(int argc, char **argv) {
17742 check(sprintf(buffer, ""), ++test);
17743 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
17744 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
17751 if eval $compile; then
17755 sprintf returns the length of the string (as ANSI says it should)
17757 d_sprintf_returns_strlen="$define"
17760 sprintf does not return the length of the string (how old is this system?)
17762 d_sprintf_returns_strlen="$undef"
17766 echo "(I can't seem to compile the test program--assuming it doesn't)" >&4
17767 d_sprintf_returns_strlen="$undef"
17771 : see if srand48_r exists
17772 set srand48_r d_srand48_r
17774 case "$d_srand48_r" in
17776 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17777 case "$d_srand48_r_proto:$usethreads" in
17778 ":define") d_srand48_r_proto=define
17779 set d_srand48_r_proto srand48_r $hdrs
17783 case "$d_srand48_r_proto" in
17785 case "$srand48_r_proto" in
17786 ''|0) try='int srand48_r(long, struct drand48_data*);'
17787 ./protochk "$extern_C $try" $hdrs && srand48_r_proto=I_LS ;;
17789 case "$srand48_r_proto" in
17790 ''|0) d_srand48_r=undef
17792 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
17793 * ) case "$srand48_r_proto" in
17794 REENTRANT_PROTO*) ;;
17795 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
17797 echo "Prototype: $try" ;;
17800 *) case "$usethreads" in
17801 define) echo "srand48_r has no prototype, not using it." >&4 ;;
17808 *) srand48_r_proto=0
17812 : see if srandom_r exists
17813 set srandom_r d_srandom_r
17815 case "$d_srandom_r" in
17817 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17818 case "$d_srandom_r_proto:$usethreads" in
17819 ":define") d_srandom_r_proto=define
17820 set d_srandom_r_proto srandom_r $hdrs
17824 case "$d_srandom_r_proto" in
17826 case "$srandom_r_proto" in
17827 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
17828 ./protochk "$extern_C $try" $hdrs && srandom_r_proto=I_TS ;;
17830 case "$srandom_r_proto" in
17831 ''|0) d_srandom_r=undef
17833 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
17834 * ) case "$srandom_r_proto" in
17835 REENTRANT_PROTO*) ;;
17836 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
17838 echo "Prototype: $try" ;;
17841 *) case "$usethreads" in
17842 define) echo "srandom_r has no prototype, not using it." >&4 ;;
17849 *) srandom_r_proto=0
17853 : see if prototype for setresgid is available
17855 set d_sresgproto setresgid $i_unistd unistd.h
17858 : see if prototype for setresuid is available
17860 set d_sresuproto setresuid $i_unistd unistd.h
17863 : see if sys/stat.h is available
17864 set sys/stat.h i_sysstat
17867 : see if stat knows about block sizes
17869 echo "Checking to see if your struct stat has st_blocks field..." >&4
17870 set d_statblks stat st_blocks $i_sysstat sys/stat.h
17873 : see if this is a sys/vfs.h system
17874 set sys/vfs.h i_sysvfs
17877 : see if this is a sys/statfs.h system
17878 set sys/statfs.h i_sysstatfs
17881 : Check for statfs_s
17883 echo "Checking to see if your system supports struct statfs..." >&4
17884 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
17886 case "$d_statfs_s" in
17887 "$define") echo "Yes, it does." ;;
17888 *) echo "No, it doesn't." ;;
17892 : see if struct statfs knows about f_flags
17893 case "$d_statfs_s" in
17896 echo "Checking to see if your struct statfs has f_flags field..." >&4
17897 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
17901 set d_statfs_f_flags
17905 case "$d_statfs_f_flags" in
17906 "$define") echo "Yes, it does." ;;
17907 *) echo "No, it doesn't." ;;
17910 : see what flavor, if any, of static inline is supported
17912 echo "Checking to see if your system supports static inline..."
17913 $cat > try.c <<'EOCP'
17914 #include <stdlib.h>
17915 extern int f_via_a(int x);
17916 extern int f_via_b(int x);
17917 int main(int argc, char **argv)
17926 return EXIT_SUCCESS;
17929 return EXIT_FAILURE;
17933 $cat > a.c <<'EOCP'
17934 static INLINE int f(int x) {
17945 $cat > b.c <<'EOCP'
17946 extern int f(int x);
17954 # Respect a hint (or previous) value for perl_static_inline, if there is one.
17955 case "$perl_static_inline" in
17956 '') # Check the various possibilities, and break out on success.
17957 # For gcc, prefer __inline__, which will still permit
17958 # cflags.SH to add in -ansi.
17959 case "$gccversion" in
17960 '') xxx="inline __inline__ __inline _inline";;
17961 *) xxx="__inline__ inline __inline _inline";;
17963 for inline in $xxx; do
17964 set try -DINLINE=$inline a.c
17965 if eval $compile && $run ./try; then
17966 # Now make sure there is no external linkage of static
17968 set try -DINLINE=$inline -DUSE_B a.c b.c
17969 if eval $compile && $run ./try; then
17970 $echo "Your compiler supports static $inline, " >&4
17971 $echo "but it also creates an external definition," >&4
17972 $echo "so I won't use it." >&4
17975 $echo "Your compiler supports static $inline." >&4
17977 perl_static_inline="static $inline";
17981 $echo "Your compiler does NOT support static $inline." >&4
17986 *inline*) # Some variant of inline exists.
17987 echo "Keeping your $hint value of $perl_static_inline."
17990 static) # No inline capabilities
17991 echo "Keeping your $hint value of $perl_static_inline."
17994 *) # Unrecognized previous value -- blindly trust the supplied
17995 # value and hope it makes sense. Use old value for
17996 # d_static_inline, if there is one.
17997 echo "Keeping your $hint value of $perl_static_inline."
17998 case "$d_static_inline" in
18000 *) val=$d_static_inline ;;
18004 # Fallback to plain 'static' if nothing worked.
18005 case "$perl_static_inline" in
18007 perl_static_inline="static"
18011 set d_static_inline
18013 $rm -f a.[co] b.[co]
18016 : Check stream access
18018 Checking how to access stdio streams by file descriptor number...
18020 case "$stdio_stream_array" in
18021 '') $cat >try.c <<EOCP
18024 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
18028 for s in _iob __iob __sF
18030 set try -DSTDIO_STREAM_ARRAY=$s
18031 if eval $compile; then
18032 case "`$run ./try`" in
18033 yes) stdio_stream_array=$s; break ;;
18039 case "$stdio_stream_array" in
18041 I can't figure out how to access stdio streams by file descriptor number.
18043 d_stdio_stream_array="$undef"
18046 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
18048 d_stdio_stream_array="$define"
18052 : see if strcoll exists
18053 set strcoll d_strcoll
18056 : check for structure copying
18058 echo "Checking to see if your C compiler can copy structs..." >&4
18059 $cat >try.c <<'EOCP'
18069 if $cc -c try.c >/dev/null 2>&1 ; then
18071 echo "Yup, it can."
18074 echo "Nope, it can't."
18080 : see if strerror and/or sys_errlist[] exist
18082 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
18083 if set strerror val -f d_strerror; eval $csym; $val; then
18084 echo 'strerror() found.' >&4
18085 d_strerror="$define"
18086 d_strerrm='strerror(e)'
18087 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18088 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
18089 d_syserrlst="$define"
18091 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
18092 d_syserrlst="$undef"
18094 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
18095 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
18096 echo 'strerror() found in string header.' >&4
18097 d_strerror="$define"
18098 d_strerrm='strerror(e)'
18099 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18100 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
18101 d_syserrlst="$define"
18103 echo "(You don't appear to have any sys_errlist[], how can this be?)"
18104 d_syserrlst="$undef"
18106 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18107 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
18108 d_strerror="$undef"
18109 d_syserrlst="$define"
18110 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
18112 echo 'strerror() and sys_errlist[] NOT found.' >&4
18113 d_strerror="$undef"
18114 d_syserrlst="$undef"
18115 d_strerrm='"unknown"'
18119 : see if strerror_r exists
18120 set strerror_r d_strerror_r
18122 case "$d_strerror_r" in
18124 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
18125 case "$d_strerror_r_proto:$usethreads" in
18126 ":define") d_strerror_r_proto=define
18127 set d_strerror_r_proto strerror_r $hdrs
18131 case "$d_strerror_r_proto" in
18133 case "$strerror_r_proto" in
18134 ''|0) try='int strerror_r(int, char*, size_t);'
18135 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBW ;;
18137 case "$strerror_r_proto" in
18138 ''|0) try='int strerror_r(int, char*, int);'
18139 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBI ;;
18141 case "$strerror_r_proto" in
18142 ''|0) try='char* strerror_r(int, char*, size_t);'
18143 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=B_IBW ;;
18145 case "$strerror_r_proto" in
18146 ''|0) d_strerror_r=undef
18148 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
18149 * ) case "$strerror_r_proto" in
18150 REENTRANT_PROTO*) ;;
18151 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
18153 echo "Prototype: $try" ;;
18156 *) case "$usethreads" in
18157 define) echo "strerror_r has no prototype, not using it." >&4 ;;
18164 *) strerror_r_proto=0
18168 : see if strftime exists
18169 set strftime d_strftime
18172 : see if strlcat exists
18173 set strlcat d_strlcat
18176 : see if strlcpy exists
18177 set strlcpy d_strlcpy
18180 : see if strtod exists
18181 set strtod d_strtod
18184 : see if strtol exists
18185 set strtol d_strtol
18188 : see if strtold exists
18189 set strtold d_strtold
18192 : see if strtoll exists
18193 set strtoll d_strtoll
18196 case "$d_longlong-$d_strtoll" in
18199 Checking whether your strtoll() works okay...
18201 $cat >try.c <<'EOCP'
18204 #define strtoll __strtoll
18207 #define strtoll _strtoll
18210 extern long long int strtoll(char *s, char **, int);
18211 static int bad = 0;
18212 int check(char *s, long long ell, int een) {
18215 gll = strtoll(s, 0, 10);
18216 if (!((gll == ell) && (errno == een)))
18220 check(" 1", 1LL, 0);
18221 check(" 0", 0LL, 0);
18222 check("-1", -1LL, 0);
18223 check("-9223372036854775808", -9223372036854775808LL, 0);
18224 check("-9223372036854775808", -9223372036854775808LL, 0);
18225 check(" 9223372036854775807", 9223372036854775807LL, 0);
18226 check("-9223372036854775808", -9223372036854775808LL, 0);
18227 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
18228 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
18234 if eval $compile; then
18237 ok) echo "Your strtoll() seems to be working okay." ;;
18239 Your strtoll() doesn't seem to be working okay.
18245 echo "(I can't seem to compile the test program--assuming it doesn't)"
18251 : see if strtoq exists
18252 set strtoq d_strtoq
18255 : see if strtoul exists
18256 set strtoul d_strtoul
18259 case "$d_strtoul" in
18262 Checking whether your strtoul() works okay...
18264 $cat >try.c <<'EOCP'
18267 extern unsigned long int strtoul(char *s, char **, int);
18268 static int bad = 0;
18269 void check(char *s, unsigned long eul, int een) {
18272 gul = strtoul(s, 0, 10);
18273 if (!((gul == eul) && (errno == een)))
18277 check(" 1", 1L, 0);
18278 check(" 0", 0L, 0);
18280 case "$longsize" in
18282 $cat >>try.c <<'EOCP'
18283 check("18446744073709551615", 18446744073709551615UL, 0);
18284 check("18446744073709551616", 18446744073709551615UL, ERANGE);
18285 #if 0 /* strtoul() for /^-/ strings is undefined. */
18286 check("-1", 18446744073709551615UL, 0);
18287 check("-18446744073709551614", 2, 0);
18288 check("-18446744073709551615", 1, 0);
18289 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
18290 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
18295 $cat >>try.c <<'EOCP'
18296 check("4294967295", 4294967295UL, 0);
18297 check("4294967296", 4294967295UL, ERANGE);
18298 #if 0 /* strtoul() for /^-/ strings is undefined. */
18299 check("-1", 4294967295UL, 0);
18300 check("-4294967294", 2, 0);
18301 check("-4294967295", 1, 0);
18302 check("-4294967296", 4294967295UL, ERANGE);
18303 check("-4294967297", 4294967295UL, ERANGE);
18308 : Should we write these tests to be more portable by sprintf-ing
18309 : ~0 and then manipulating that char string as input for strtol?
18312 $cat >>try.c <<'EOCP'
18319 if eval $compile; then
18320 case "`$run ./try`" in
18321 ok) echo "Your strtoul() seems to be working okay." ;;
18323 Your strtoul() doesn't seem to be working okay.
18329 echo "(I can't seem to compile the test program--assuming it doesn't)"
18335 : see if strtoull exists
18336 set strtoull d_strtoull
18339 case "$d_longlong-$d_strtoull" in
18342 Checking whether your strtoull() works okay...
18344 $cat >try.c <<'EOCP'
18347 #define strtoull __strtoull
18350 extern unsigned long long int strtoull(char *s, char **, int);
18351 static int bad = 0;
18352 int check(char *s, long long eull, int een) {
18355 gull = strtoull(s, 0, 10);
18356 if (!((gull == eull) && (errno == een)))
18360 check(" 1", 1LL, 0);
18361 check(" 0", 0LL, 0);
18362 check("18446744073709551615", 18446744073709551615ULL, 0);
18363 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18364 #if 0 /* strtoull() for /^-/ strings is undefined. */
18365 check("-1", 18446744073709551615ULL, 0);
18366 check("-18446744073709551614", 2LL, 0);
18367 check("-18446744073709551615", 1LL, 0);
18368 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18369 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18376 if eval $compile; then
18377 case "`$run ./try`" in
18378 ok) echo "Your strtoull() seems to be working okay." ;;
18380 Your strtoull() doesn't seem to be working okay.
18382 d_strtoull="$undef"
18386 echo "(I can't seem to compile the test program--assuming it doesn't)"
18387 d_strtoull="$undef"
18392 : see if strtouq exists
18393 set strtouq d_strtouq
18396 case "$d_strtouq" in
18399 Checking whether your strtouq() works okay...
18401 $cat >try.c <<'EOCP'
18404 extern unsigned long long int strtouq(char *s, char **, int);
18405 static int bad = 0;
18406 void check(char *s, unsigned long long eull, int een) {
18407 unsigned long long gull;
18409 gull = strtouq(s, 0, 10);
18410 if (!((gull == eull) && (errno == een)))
18414 check(" 1", 1LL, 0);
18415 check(" 0", 0LL, 0);
18416 check("18446744073709551615", 18446744073709551615ULL, 0);
18417 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18418 #if 0 /* strtouq() for /^-/ strings is undefined. */
18419 check("-1", 18446744073709551615ULL, 0);
18420 check("-18446744073709551614", 2LL, 0);
18421 check("-18446744073709551615", 1LL, 0);
18422 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18423 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18431 if eval $compile; then
18432 case "`$run ./try`" in
18433 ok) echo "Your strtouq() seems to be working okay." ;;
18435 Your strtouq() doesn't seem to be working okay.
18441 echo "(I can't seem to compile the test program--assuming it doesn't)"
18447 : see if strxfrm exists
18448 set strxfrm d_strxfrm
18451 : see if symlink exists
18452 set symlink d_symlink
18455 : see if syscall exists
18456 set syscall d_syscall
18459 : see if prototype for syscall is available
18461 set d_syscallproto syscall $i_unistd unistd.h
18464 : see if sysconf exists
18465 set sysconf d_sysconf
18468 : see if system exists
18469 set system d_system
18472 : see if tcgetpgrp exists
18473 set tcgetpgrp d_tcgetpgrp
18476 : see if tcsetpgrp exists
18477 set tcsetpgrp d_tcsetpgrp
18480 : see if prototype for telldir is available
18482 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
18485 : see if time exists
18487 if test "X$d_time" = X -o X"$timetype" = X; then
18488 if set time val -f d_time; eval $csym; $val; then
18489 echo 'time() found.' >&4
18491 rp="What is the type returned by time() on this system?"
18492 set time_t timetype long stdio.h sys/types.h
18495 echo 'time() not found, hope that will do.' >&4
18503 : see if timegm exists
18504 set timegm d_timegm
18507 : see if this is a sys/times.h system
18508 set sys/times.h i_systimes
18511 : see if times exists
18513 if set times val -f d_times; eval $csym; $val; then
18514 echo 'times() found.' >&4
18517 case "$i_systimes" in
18518 "$define") inc='sys/times.h';;
18520 rp="What is the type returned by times() on this system?"
18521 set clock_t clocktype long stdio.h sys/types.h $inc
18524 echo 'times() NOT found, hope that will do.' >&4
18529 : see if tmpnam_r exists
18530 set tmpnam_r d_tmpnam_r
18532 case "$d_tmpnam_r" in
18534 hdrs="$i_systypes sys/types.h define stdio.h "
18535 case "$d_tmpnam_r_proto:$usethreads" in
18536 ":define") d_tmpnam_r_proto=define
18537 set d_tmpnam_r_proto tmpnam_r $hdrs
18541 case "$d_tmpnam_r_proto" in
18543 case "$tmpnam_r_proto" in
18544 ''|0) try='char* tmpnam_r(char*);'
18545 ./protochk "$extern_C $try" $hdrs && tmpnam_r_proto=B_B ;;
18547 case "$tmpnam_r_proto" in
18548 ''|0) d_tmpnam_r=undef
18550 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
18551 * ) case "$tmpnam_r_proto" in
18552 REENTRANT_PROTO*) ;;
18553 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
18555 echo "Prototype: $try" ;;
18558 *) case "$usethreads" in
18559 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
18566 *) tmpnam_r_proto=0
18570 : see if truncate exists
18571 set truncate d_truncate
18574 : see if ttyname_r exists
18575 set ttyname_r d_ttyname_r
18577 case "$d_ttyname_r" in
18579 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
18580 case "$d_ttyname_r_proto:$usethreads" in
18581 ":define") d_ttyname_r_proto=define
18582 set d_ttyname_r_proto ttyname_r $hdrs
18586 case "$d_ttyname_r_proto" in
18588 case "$ttyname_r_proto" in
18589 ''|0) try='int ttyname_r(int, char*, size_t);'
18590 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBW ;;
18592 case "$ttyname_r_proto" in
18593 ''|0) try='int ttyname_r(int, char*, int);'
18594 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBI ;;
18596 case "$ttyname_r_proto" in
18597 ''|0) try='char* ttyname_r(int, char*, int);'
18598 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=B_IBI ;;
18600 case "$ttyname_r_proto" in
18601 ''|0) d_ttyname_r=undef
18603 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
18604 * ) case "$ttyname_r_proto" in
18605 REENTRANT_PROTO*) ;;
18606 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
18608 echo "Prototype: $try" ;;
18611 *) case "$usethreads" in
18612 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
18619 *) ttyname_r_proto=0
18623 : see if tzname[] exists
18625 if set tzname val -a d_tzname; eval $csym; $val; then
18627 echo 'tzname[] found.' >&4
18630 echo 'tzname[] NOT found.' >&4
18635 : Check if is a multiplatform env
18637 next|rhapsody|darwin) multiarch="$define" ;;
18639 case "$multiarch" in
18640 ''|[nN]*) multiarch="$undef" ;;
18643 : check for ordering of bytes in a UV
18645 case "$usecrosscompile$multiarch" in
18648 You seem to be either cross-compiling or doing a multiarchitecture build,
18649 skipping the byteorder check.
18655 case "$byteorder" in
18658 In the following, larger digits indicate more significance. A big-endian
18659 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
18660 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
18661 machines may have weird orders like 3412. A Cray will report 87654321,
18662 an Alpha will report 12345678. If the test program works the default is
18664 I'm now running the test program...
18668 #$i_stdlib I_STDLIB
18670 #include <stdlib.h>
18672 #include <sys/types.h>
18673 typedef $uvtype UV;
18683 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
18685 u.l = (UV)0x04030201;
18686 for (i = 0; i < $uvsize; i++)
18687 printf("%c", u.c[i]+'0');
18694 if eval $compile && $run ./try > /dev/null; then
18697 [1-4][1-4][1-4][1-4]|12345678|87654321)
18698 echo "(The test program ran ok.)"
18699 echo "byteorder=$dflt"
18702 ????|????????) echo "(The test program ran ok.)" ;;
18703 *) echo "(The test program didn't run right for some reason.)" ;;
18708 (I can't seem to compile the test program. Guessing big-endian...)
18711 case "$xxx_prompt" in
18713 rp="What is the order of bytes in $uvtype?"
18726 : Checking 32bit alignedness
18729 Checking to see whether you can access character data unalignedly...
18731 case "$d_u32align" in
18732 '') $cat >try.c <<EOCP
18734 #$i_stdlib I_STDLIB
18736 #include <stdlib.h>
18738 #define U32 $u32type
18739 #define BYTEORDER 0x$byteorder
18741 #include <signal.h>
18743 $signal_t bletch(int s) { exit(4); }
18746 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
18747 volatile U8 buf[8];
18751 if (sizeof(U32) != 4) {
18752 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
18759 signal(SIGBUS, bletch);
18771 for (i = 0; i < 4; i++) {
18772 up = (U32*)(buf + i);
18773 if (! ((*up == 1 << (8*i)) || /* big-endian */
18774 (*up == 1 << (8*(3-i))) /* little-endian */
18778 printf("read failed (%x)\n", *up);
18784 for (i = 0; i < 4; i++) {
18785 up = (U32*)(buf + i);
18787 if (*up != 0xBeef) {
18788 printf("write failed (%x)\n", *up);
18802 if eval $compile_ok; then
18803 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
18804 $run ./try 2>&1 >/dev/null
18807 You can access character data pretty unalignedly.
18809 d_u32align="$undef"
18812 It seems that you must access character data in an aligned manner.
18814 d_u32align="$define"
18818 rp='Can you access character data at unaligned addresses?'
18822 [yY]*) d_u32align="$undef" ;;
18823 *) d_u32align="$define" ;;
18830 : see if ualarm exists
18831 set ualarm d_ualarm
18834 : see if umask exists
18838 : see if unordered exists
18839 set unordered d_unordered
18842 : see if unsetenv exists
18843 set unsetenv d_unsetenv
18846 : see if usleep exists
18847 set usleep d_usleep
18850 : see if prototype for usleep is available
18852 set d_usleepproto usleep $i_unistd unistd.h
18855 : see if ustat exists
18859 : see if closedir exists
18860 set closedir d_closedir
18863 case "$d_closedir" in
18866 echo "Checking whether closedir() returns a status..." >&4
18868 #$i_dirent I_DIRENT /**/
18869 #$i_sysdir I_SYS_DIR /**/
18870 #$i_sysndir I_SYS_NDIR /**/
18871 #$i_systypes I_SYS_TYPES /**/
18873 #if defined(I_SYS_TYPES)
18874 #include <sys/types.h>
18876 #if defined(I_DIRENT)
18877 #include <dirent.h>
18878 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
18879 #include <sys/dir.h>
18883 #include <sys/ndir.h>
18887 #include <ndir.h> /* may be wrong in the future */
18889 #include <sys/dir.h>
18894 int main() { return closedir(opendir(".")); }
18897 if eval $compile_ok; then
18898 if $run ./try > /dev/null 2>&1 ; then
18899 echo "Yes, it does."
18902 echo "No, it doesn't."
18906 echo "(I can't seem to compile the test program--assuming it doesn't)"
18914 set d_void_closedir
18918 : see if there is a wait4
18922 : see if waitpid exists
18923 set waitpid d_waitpid
18926 : see if wcstombs exists
18927 set wcstombs d_wcstombs
18930 : see if wctomb exists
18931 set wctomb d_wctomb
18934 : see if writev exists
18935 set writev d_writev
18938 : preserve RCS keywords in files with variable substitution, grrr
18943 Revision='$Revision'
18945 : check for alignment requirements
18947 case "$usecrosscompile$multiarch" in
18950 You seem to be either cross-compiling or doing a multiarchitecture build,
18951 skipping the memory alignment check.
18954 case "$alignbytes" in
18955 '') alignbytes=8 ;;
18959 case "$alignbytes" in
18960 '') echo "Checking alignment constraints..." >&4
18961 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
18962 $cat >try.c <<'EOCP'
18963 typedef long double NV;
18966 $cat >try.c <<'EOCP'
18970 $cat >>try.c <<'EOCP'
18978 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
18983 if eval $compile_ok; then
18987 echo "(I can't seem to compile the test program...)"
18990 *) dflt="$alignbytes"
18993 rp="Doubles must be aligned on a how-many-byte boundary?"
19001 : set the base revision
19004 : length of character in bytes. Is always 1, otherwise it isnt C
19005 : This used to be a test using sizeof
19008 : Check for the number of bits in a character
19009 case "$charbits" in
19010 '') echo "Checking how long a character is (in bits)..." >&4
19017 for (c = 1, n = 0; c; c <<= 1, n++) ;
19018 printf ("%d\n", n);
19023 if eval $compile_ok; then
19027 echo "(I can't seem to compile the test program. Guessing...)"
19034 rp="What is the length of a character (in bits)?"
19038 case "$charbits" in
19041 Your system has an unsigned character size of $charbits bits, which
19042 is rather unusual (normally it is 8 bits). Perl likely will not work
19043 correctly on your system, with subtle bugs in various places.
19045 rp='Do you really want to continue?'
19049 [yY]) echo >&4 "Okay, continuing." ;;
19054 : how do we concatenate cpp tokens here?
19056 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
19057 $cat >cpp_stuff.c <<'EOCP'
19058 #define RCAT(a,b)a/**/b
19059 #define ACAT(a,b)a ## b
19063 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
19064 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
19065 echo "Oh! Smells like ANSI's been here." >&4
19066 echo "We can catify or stringify, separately or together!"
19068 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
19069 echo "Ah, yes! The good old days!" >&4
19070 echo "However, in the good old days we don't know how to stringify and"
19071 echo "catify at the same time."
19075 Hmm, I don't seem to be able to concatenate tokens with your cpp.
19076 You're going to have to edit the values of CAT[2-5] in config.h...
19078 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
19082 : see if this is a db.h system
19088 : Check db version.
19090 echo "Checking Berkeley DB version ..." >&4
19096 #include <sys/types.h>
19098 #$i_stdlib I_STDLIB
19100 #include <stdlib.h>
19103 int main(int argc, char *argv[])
19105 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
19106 int Major, Minor, Patch ;
19107 unsigned long Version ;
19108 (void)db_version(&Major, &Minor, &Patch) ;
19110 printf("%d %d %d %d %d %d\n",
19111 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
19112 Major, Minor, Patch);
19115 printf("You have Berkeley DB Version 2 or greater.\n");
19117 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
19118 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
19119 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
19120 Major, Minor, Patch) ;
19122 /* check that db.h & libdb are compatible */
19123 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
19124 printf("db.h and libdb are incompatible.\n") ;
19128 printf("db.h and libdb are compatible.\n") ;
19130 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
19131 + DB_VERSION_PATCH ;
19133 /* needs to be >= 2.3.4 */
19134 if (Version < 2003004) {
19135 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
19136 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
19142 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
19147 printf("You have Berkeley DB Version 1.\n");
19148 exit(0); /* DB version < 2: the coast is clear. */
19150 exit(1); /* <db.h> not Berkeley DB? */
19156 if eval $compile_ok && $run ./try; then
19157 echo 'Looks OK.' >&4
19159 db_version_major=$1
19160 db_version_minor=$2
19161 db_version_patch=$3
19163 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
19167 : Remove db from list of libraries to use
19168 echo "Removing unusable -ldb from library list" >&4
19169 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
19172 echo "libs = $libs" >&4
19182 : Check the return type needed for hash
19184 echo "Checking return type needed for hash for Berkeley DB ..." >&4
19190 #include <sys/types.h>
19193 #ifndef DB_VERSION_MAJOR
19194 u_int32_t hash_cb (ptr, size)
19202 info.hash = hash_cb;
19206 if $cc $ccflags -c try.c >try.out 2>&1 ; then
19207 if $contains warning try.out >>/dev/null 2>&1 ; then
19210 db_hashtype='u_int32_t'
19213 : XXX Maybe we should just give up here.
19214 db_hashtype=u_int32_t
19216 echo "Help: I can't seem to compile the db test program." >&4
19217 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
19220 echo "Your version of Berkeley DB uses $db_hashtype for hash."
19222 *) db_hashtype=u_int32_t
19227 : Check the return type needed for prefix
19229 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
19235 #include <sys/types.h>
19238 #ifndef DB_VERSION_MAJOR
19239 size_t prefix_cb (key1, key2)
19247 info.prefix = prefix_cb;
19251 if $cc $ccflags -c try.c >try.out 2>&1 ; then
19252 if $contains warning try.out >>/dev/null 2>&1 ; then
19253 db_prefixtype='int'
19255 db_prefixtype='size_t'
19258 db_prefixtype='size_t'
19259 : XXX Maybe we should just give up here.
19261 echo "Help: I can't seem to compile the db test program." >&4
19262 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
19265 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
19267 *) db_prefixtype='size_t'
19271 : How can we generate normalized random numbers ?
19273 echo "Looking for a random number function..." >&4
19274 case "$randfunc" in
19276 if set drand48 val -f; eval $csym; $val; then
19278 echo "Good, found drand48()." >&4
19279 elif set random val -f; eval $csym; $val; then
19281 echo "OK, found random()." >&4
19284 echo "Yick, looks like I have to use rand()." >&4
19295 *-Dmy_rand=*|*-Dmy_srand=*)
19296 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
19297 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
19298 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
19299 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
19303 while $test "$cont"; do
19304 rp="Use which function to generate random numbers?"
19306 if $test "$ans" = "$dflt"; then
19312 if set $ans val -f; eval $csym; $val; then
19316 rp="I cannot find function $ans. Use that name anyway?"
19325 case "$randfunc" in
19327 drand01="drand48()"
19333 case "$randbits" in
19335 echo "Checking to see how many bits your $randfunc() function produces..." >&4
19337 #$i_unistd I_UNISTD
19338 #$i_stdlib I_STDLIB
19341 # include <unistd.h>
19344 # include <stdlib.h>
19349 register unsigned long tmp;
19350 register unsigned long max = 0L;
19352 for (i = 1000; i; i--) {
19353 tmp = (unsigned long) $randfunc();
19354 if (tmp > max) max = tmp;
19356 for (i = 0; max; i++)
19362 if eval $compile_ok; then
19366 echo "(I can't seem to compile the test program...)"
19373 rp="How many bits does your $randfunc() function produce?"
19377 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
19378 seedfunc="s$randfunc"
19379 randseedtype=unsigned
19383 rp="How many bits does your $randfunc() function produce?"
19386 seedfunc="s$randfunc"
19387 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
19388 if set $seedfunc val -f; eval $csym; $val; then
19389 echo "(Using $seedfunc() to seed random generator)"
19391 echo "(Warning: no $seedfunc() to seed random generator)"
19394 randseedtype=unsigned
19401 : Determine if this is an EBCDIC system
19403 echo "Determining whether or not we are on an EBCDIC system..." >&4
19404 $cat >try.c <<'EOM'
19407 if ('M'==0xd4) return 0;
19414 if eval $compile_ok; then
19415 if $run ./try; then
19416 echo "You seem to speak EBCDIC." >&4
19419 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
19422 echo "I'm unable to compile the test program." >&4
19423 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
19429 : Check how to flush
19432 Checking how to flush all pending stdio output...
19434 # I only know how to find the first 32 possibly open files on SunOS.
19435 # See also hints/sunos_4_1.sh and util.c --AD
19437 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
19439 $cat >>try.c <<EOCP
19441 #$i_stdlib I_STDLIB
19443 #include <stdlib.h>
19445 #$i_unistd I_UNISTD
19447 # include <unistd.h>
19449 #$d_sysconf HAS_SYSCONF
19450 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
19451 #ifdef HAS_STDIO_STREAM_ARRAY
19452 # define STDIO_STREAM_ARRAY $stdio_stream_array
19457 p = fopen("try.out", "w");
19461 # ifdef TRY_FPRINTF
19465 #ifdef TRY_FFLUSH_NULL
19468 #ifdef TRY_FFLUSH_ALL
19470 long open_max = -1;
19471 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
19472 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
19474 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
19475 open_max = sysconf(_SC_OPEN_MAX);
19478 open_max = FOPEN_MAX;
19481 open_max = OPEN_MAX;
19490 # ifdef HAS_STDIO_STREAM_ARRAY
19491 if (open_max > 0) {
19493 for (i = 0; i < open_max; i++)
19494 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
19495 STDIO_STREAM_ARRAY[i]._file < open_max &&
19496 STDIO_STREAM_ARRAY[i]._flag)
19497 fflush(&STDIO_STREAM_ARRAY[i]);
19505 : first we have to find out how _not_ to flush
19507 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
19509 set try -DTRY_FPUTC
19510 if eval $compile; then
19511 $run ./try 2>/dev/null
19514 if $test ! -s try.out -a "X$code" = X42; then
19520 set try -DTRY_FPRINTF
19521 if eval $compile; then
19522 $run ./try 2>/dev/null
19525 if $test ! -s try.out -a "X$code" = X42; then
19526 output=-DTRY_FPRINTF
19532 : check for fflush NULL behaviour
19533 case "$fflushNULL" in
19534 '') set try -DTRY_FFLUSH_NULL $output
19535 if eval $compile; then
19536 $run ./try 2>/dev/null
19539 if $test -s try.out -a "X$code" = X42; then
19540 fflushNULL="`$cat try.out`"
19542 if $test "X$code" != X42; then
19544 (If this test failed, don't worry, we'll try another method shortly.)
19549 $rm -f core try.core core.try.*
19550 case "$fflushNULL" in
19552 Your fflush(NULL) works okay for output streams.
19553 Let's see if it clobbers input pipes...
19555 # As of mid-March 2000 all versions of Solaris appear to have a stdio
19556 # bug that improperly flushes the input end of pipes. So we avoid the
19557 # autoflush on fork/system/exec support for now. :-(
19558 $cat >tryp.c <<EOCP
19561 main(int argc, char **argv)
19567 while ((i = getc(stdin)) != -1
19568 && (*bp++ = i) != '\n'
19569 && bp < &buf[1024])
19572 fprintf(stdout, "%s", buf);
19580 fflushNULL="$define"
19582 if eval $compile; then
19584 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19585 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19587 fflush(NULL) seems to behave okay with input streams.
19589 fflushNULL="$define"
19592 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
19594 fflushNULL="$undef"
19597 $rm -f core tryp.c tryp.core core.tryp.*
19600 Your fflush(NULL) isn't working (contrary to ANSI C).
19602 fflushNULL="$undef"
19605 Cannot figure out whether your fflush(NULL) works or not.
19606 I'm assuming it doesn't (contrary to ANSI C).
19608 fflushNULL="$undef"
19612 $define|true|[yY]*)
19613 fflushNULL="$define"
19616 fflushNULL="$undef"
19619 : check explicit looping only if NULL did not work, and if the pipe
19620 : bug does not show up on an explicit flush too
19621 case "$fflushNULL" in
19623 $cat >tryp.c <<EOCP
19626 main(int argc, char **argv)
19632 while ((i = getc(stdin)) != -1
19633 && (*bp++ = i) != '\n'
19634 && bp < &buf[1024])
19637 fprintf(stdout, "%s", buf);
19646 if eval $compile; then
19648 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19649 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19651 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
19653 : now check for fflushall behaviour
19654 case "$fflushall" in
19655 '') set try -DTRY_FFLUSH_ALL $output
19656 if eval $compile; then
19658 (Now testing the other method--but note that this also may fail.)
19660 $run ./try 2>/dev/null
19663 if $test -s try.out -a "X$code" = X42; then
19664 fflushall="`$cat try.out`"
19668 case "$fflushall" in
19670 Whew. Flushing explicitly all the stdio streams works.
19672 fflushall="$define"
19675 Sigh. Flushing explicitly all the stdio streams doesn't work.
19680 Cannot figure out whether flushing stdio streams explicitly works or not.
19681 I'm assuming it doesn't.
19687 "$define"|true|[yY]*)
19688 fflushall="$define"
19696 All is futile. Even fflush(stdin) clobbers input pipes!
19703 $rm -f core tryp.c tryp.core core.tryp.*
19705 *) fflushall="$undef"
19709 case "$fflushNULL$fflushall" in
19712 OK, I give up. I cannot figure out how to flush pending stdio output.
19713 We won't be flushing handles at all before fork/exec/popen.
19719 : Store the full pathname to the ar program for use in the C program
19720 : Respect a hint or command line value for full_ar.
19725 : Store the full pathname to the sed program for use in the C program
19728 : see what type gids are declared as in the kernel
19730 echo "Looking for the type for group ids returned by getgid()."
19731 set gid_t gidtype xxx stdio.h sys/types.h
19735 xxx=`./findhdr sys/user.h`
19736 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
19738 unsigned) dflt="$1 $2" ;;
19742 *) dflt="$gidtype";;
19745 gid_t) echo "gid_t found." ;;
19746 *) rp="What is the type for group ids returned by getgid()?"
19752 : Check the size of GID
19755 *_t) zzz="$gidtype" ;;
19758 echo "Checking the size of $zzz..." >&4
19760 #include <sys/types.h>
19762 #$i_stdlib I_STDLIB
19764 #include <stdlib.h>
19767 printf("%d\n", (int)sizeof($gidtype));
19772 if eval $compile_ok; then
19776 echo "(I can't execute the test program--guessing $gidsize.)" >&4
19779 echo "Your $zzz is $gidsize bytes long."
19784 echo "(I can't compile the test program--guessing $gidsize.)" >&4
19788 : Check if GID is signed
19791 *_t) zzz="$gidtype" ;;
19794 echo "Checking the sign of $zzz..." >&4
19796 #include <sys/types.h>
19807 if eval $compile; then
19811 echo "(I can't execute the test program--guessing unsigned.)" >&4
19815 1) echo "Your $zzz is unsigned." ;;
19816 -1) echo "Your $zzz is signed." ;;
19822 echo "(I can't compile the test program--guessing unsigned.)" >&4
19826 : Check 64bit sizes
19829 if $test X"$quadtype" != X; then
19831 echo "Checking how to print 64-bit integers..." >&4
19833 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
19834 $cat >try.c <<'EOCP'
19835 #include <sys/types.h>
19838 int q = 12345678901;
19839 printf("%ld\n", q);
19843 if eval $compile; then
19847 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
19848 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
19849 echo "We will use %d."
19855 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
19856 $cat >try.c <<'EOCP'
19857 #include <sys/types.h>
19860 long q = 12345678901;
19861 printf("%ld\n", q);
19865 if eval $compile; then
19869 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
19870 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
19871 echo "We will use %ld."
19877 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
19878 $cat >try.c <<'EOCP'
19879 #include <sys/types.h>
19880 #include <inttypes.h>
19883 int64_t q = 12345678901;
19884 printf("%" PRId64 "\n", q);
19888 if eval $compile; then
19892 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
19893 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
19894 echo "We will use the C9X style."
19900 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19902 #include <sys/types.h>
19905 $quadtype q = 12345678901;
19906 printf("%Ld\n", q);
19910 if eval $compile; then
19914 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
19915 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
19916 echo "We will use %Ld."
19922 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
19923 $cat >try.c <<'EOCP'
19924 #include <sys/types.h>
19927 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
19928 printf("%lld\n", q);
19932 if eval $compile; then
19936 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
19937 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
19938 echo "We will use the %lld style."
19944 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19946 #include <sys/types.h>
19949 $quadtype q = 12345678901;
19950 printf("%qd\n", q);
19954 if eval $compile; then
19958 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
19959 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
19960 echo "We will use %qd."
19966 if $test X"$sPRId64" = X; then
19967 echo "Cannot figure out how to print 64-bit integers." >&4
19974 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
19975 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
19977 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
19978 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
19982 : Check format strings for internal types
19984 $echo "Checking the format strings to be used for Perl's internal types..." >&4
19986 if $test X"$ivsize" = X8; then
19987 ivdformat="$sPRId64"
19988 uvuformat="$sPRIu64"
19989 uvoformat="$sPRIo64"
19990 uvxformat="$sPRIx64"
19991 uvXUformat="$sPRIXU64"
19993 if $test X"$ivsize" = X"$longsize"; then
20000 if $test X"$ivsize" = X"$intsize"; then
20008 if $test X"$ivsize" = X"$shortsize"; then
20019 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
20020 nveformat="$sPRIeldbl"
20021 nvfformat="$sPRIfldbl"
20022 nvgformat="$sPRIgldbl"
20023 nvEUformat="$sPRIEUldbl"
20024 nvFUformat="$sPRIFUldbl"
20025 nvGUformat="$sPRIGUldbl"
20035 case "$ivdformat" in
20036 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
20041 : Check format string for GID
20044 $echo "Checking the format string to be used for gids..." >&4
20047 -1) if $test X"$gidsize" = X"$ivsize"; then
20048 gidformat="$ivdformat"
20050 if $test X"$gidsize" = X"$longsize"; then
20053 if $test X"$gidsize" = X"$intsize"; then
20056 if $test X"$gidsize" = X"$shortsize"; then
20063 *) if $test X"$gidsize" = X"$uvsize"; then
20064 gidformat="$uvuformat"
20066 if $test X"$gidsize" = X"$longsize"; then
20069 if $test X"$gidsize" = X"$intsize"; then
20072 if $test X"$gidsize" = X"$shortsize"; then
20081 : see if getgroups exists
20082 set getgroups d_getgrps
20085 : see if setgroups exists
20086 set setgroups d_setgrps
20089 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
20091 case "$d_getgrps$d_setgrps" in
20093 case "$groupstype" in
20094 '') dflt="$gidtype" ;;
20095 *) dflt="$groupstype" ;;
20098 What type of pointer is the second argument to getgroups() and setgroups()?
20099 Usually this is the same as group ids, $gidtype, but not always.
20102 rp='What type pointer is the second argument to getgroups() and setgroups()?'
20106 *) groupstype="$gidtype";;
20109 : MAD = Misc Attribute Definition
20111 if $test $patchlevel -lt 9; then
20112 : MAD is not available in 5.8.x or earlier.
20116 $define|true|[yY]*) dflt='y' ;;
20121 Would you like to build with Misc Attribute Decoration? This is development
20122 work leading to a Perl 5 to Perl 6 convertor, which imposes a space and speed
20123 overhead on the interpreter.
20125 If this doesn't make any sense to you, just accept the default '$dflt'.
20127 rp='Build Perl with MAD?'
20132 madlyh='madly.h madly.act madly.tab'
20134 madlyobj="madly$_o" ;;
20143 : check whether make sets MAKE
20145 echo "Checking if your $make program sets \$(MAKE)..." >&4
20146 case "$make_set_make" in
20148 $sed 's/^X //' > testmake.mak << 'EOF'
20150 X @echo 'maketemp="$(MAKE)"'
20152 case "`$make -f testmake.mak 2>/dev/null`" in
20153 *maketemp=*) make_set_make='#' ;;
20154 *) make_set_make="MAKE=$make" ;;
20156 $rm -f testmake.mak
20159 case "$make_set_make" in
20160 '#') echo "Yup, it does.";;
20161 *) echo "Nope, it doesn't.";;
20164 : see what type is used for mode_t
20165 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
20166 set mode_t modetype int stdio.h sys/types.h
20169 : see if we need va_copy
20171 case "$i_stdarg" in
20174 #include <stdarg.h>
20176 #$i_stdlib I_STDLIB
20178 #include <stdlib.h>
20180 #include <signal.h>
20183 ivfprintf(FILE *f, const char *fmt, va_list *valp)
20185 return vfprintf(f, fmt, *valp);
20189 myvfprintf(FILE *f, const char *fmt, va_list val)
20191 return ivfprintf(f, fmt, &val);
20195 myprintf(char *fmt, ...)
20198 va_start(val, fmt);
20199 return myvfprintf(stdout, fmt, val);
20203 main(int ac, char **av)
20205 signal(SIGSEGV, exit);
20207 myprintf("%s%cs all right, then\n", "that", '\'');
20212 if eval $compile && $run ./try 2>&1 >/dev/null; then
20213 case "`$run ./try`" in
20214 "that's all right, then")
20220 yes) echo "It seems that you don't need va_copy()." >&4
20221 need_va_copy="$undef"
20223 *) echo "It seems that va_copy() or similar will be needed." >&4
20224 need_va_copy="$define"
20229 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
20233 : see what type is used for size_t
20234 rp="What is the type used for the length parameter for string functions?"
20235 set size_t sizetype 'unsigned int' stdio.h sys/types.h
20238 : check for type of arguments to gethostbyaddr.
20239 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
20240 case "$d_gethbyaddr" in
20244 Checking to see what type of arguments are accepted by gethostbyaddr().
20246 hdrs="$define sys/types.h
20247 $d_socket sys/socket.h
20248 $i_niin netinet/in.h
20250 $i_unistd unistd.h"
20251 : The first arg can 'char *' or 'void *'
20252 : The second arg is some of integral type
20253 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
20254 for yyy in size_t long int; do
20255 case "$netdb_host_type" in
20256 '') try="$extern_C struct hostent *gethostbyaddr($xxx, $yyy, int);"
20257 if ./protochk "$try" $hdrs; then
20258 echo "Your system accepts $xxx for the first arg."
20259 echo "...and $yyy for the second arg."
20260 netdb_host_type="$xxx"
20261 netdb_hlen_type="$yyy"
20267 : In case none of those worked, prompt the user.
20268 case "$netdb_host_type" in
20269 '') rp='What is the type for the 1st argument to gethostbyaddr?'
20272 netdb_host_type=$ans
20273 rp='What is the type for the 2nd argument to gethostbyaddr?'
20276 netdb_hlen_type=$ans
20280 *) : no gethostbyaddr, so pick harmless defaults
20281 netdb_host_type='char *'
20282 netdb_hlen_type="$sizetype"
20285 # Remove the "const" if needed. -- but then we'll have a
20287 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
20290 : check for type of argument to gethostbyname.
20291 if test "X$netdb_name_type" = X ; then
20292 case "$d_gethbyname" in
20296 Checking to see what type of argument is accepted by gethostbyname().
20298 hdrs="$define sys/types.h
20299 $d_socket sys/socket.h
20300 $i_niin netinet/in.h
20302 $i_unistd unistd.h"
20303 for xxx in "const char *" "char *"; do
20304 case "$netdb_name_type" in
20305 '') try="$extern_C struct hostent *gethostbyname($xxx);"
20306 if ./protochk "$try" $hdrs; then
20307 echo "Your system accepts $xxx."
20308 netdb_name_type="$xxx"
20313 : In case none of those worked, prompt the user.
20314 case "$netdb_name_type" in
20315 '') rp='What is the type for the 1st argument to gethostbyname?'
20318 netdb_name_type=$ans
20322 *) : no gethostbyname, so pick harmless default
20323 netdb_name_type='char *'
20328 : check for type of 1st argument to getnetbyaddr.
20329 if test "X$netdb_net_type" = X ; then
20330 case "$d_getnbyaddr" in
20334 Checking to see what type of 1st argument is accepted by getnetbyaddr().
20336 hdrs="$define sys/types.h
20337 $d_socket sys/socket.h
20338 $i_niin netinet/in.h
20340 $i_unistd unistd.h"
20341 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
20342 case "$netdb_net_type" in
20343 '') try="$extern_C struct netent *getnetbyaddr($xxx, int);"
20344 if ./protochk "$try" $hdrs; then
20345 echo "Your system accepts $xxx."
20346 netdb_net_type="$xxx"
20351 : In case none of those worked, prompt the user.
20352 case "$netdb_net_type" in
20353 '') rp='What is the type for the 1st argument to getnetbyaddr?'
20356 netdb_net_type=$ans
20360 *) : no getnetbyaddr, so pick harmless default
20361 netdb_net_type='long'
20365 : locate the preferred pager for this system
20372 [a-zA-Z]:/*) dflt=$pg;;
20376 [a-zA-Z]:/*) dflt=$more;;
20380 [a-zA-Z]:/*) dflt=$less;;
20383 '') dflt=/usr/ucb/more;;
20391 rp='What pager is used on your system?'
20395 : see what type pids are declared as in the kernel
20396 rp="What is the type of process ids on this system?"
20397 set pid_t pidtype int stdio.h sys/types.h
20400 : see if ar generates random libraries by itself
20402 echo "Checking how to generate random libraries on your machine..." >&4
20403 echo 'int bar1() { return bar2(); }' > bar1.c
20404 echo 'int bar2() { return 2; }' > bar2.c
20406 #$i_stdlib I_STDLIB
20408 #include <stdlib.h>
20410 int main() { printf("%d\n", bar1()); exit(0); }
20412 $cc $ccflags -c bar1.c >/dev/null 2>&1
20413 $cc $ccflags -c bar2.c >/dev/null 2>&1
20414 $cc $ccflags -c foo.c >/dev/null 2>&1
20415 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
20416 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20417 $run ./foobar >/dev/null 2>&1; then
20418 echo "$ar appears to generate random libraries itself."
20420 if [ "X$ranlib" = "X" ]; then
20423 elif $ar s bar$_a >/dev/null 2>&1 &&
20424 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20425 $run ./foobar >/dev/null 2>&1; then
20426 echo "a table of contents needs to be added with '$ar s'."
20429 elif $ar ts bar$_a >/dev/null 2>&1 &&
20430 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20431 $run ./foobar >/dev/null 2>&1; then
20432 echo "a table of contents needs to be added with '$ar ts'."
20439 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
20440 $test -f $ranlib || ranlib=''
20443 if $test -n "$ranlib"; then
20444 echo "your system has '$ranlib'; we'll use that."
20447 echo "your system doesn't seem to support random libraries"
20448 echo "so we'll use lorder and tsort to order the libraries."
20455 : see if this is a values.h system
20456 set values.h i_values
20459 : Check the max offset that gmtime and localtime accept
20460 echo "Checking max offsets that gmtime () accepts"
20463 define) yyy="#include <values.h>" ;;
20467 case "$sGMTIME_min/$sGMTIME_max" in
20470 #include <sys/types.h>
20479 void gm_check (time_t t, int min_year, int max_year)
20482 if ( tmp == NULL ||
20483 /* Check tm_year overflow */
20484 tmp->tm_year < min_year || tmp->tm_year > max_year)
20495 gm_check (MAXLONG, 69, 0x7fffffff);
20497 if (tmp == NULL || tmp->tm_year < 0) {
20498 for (i = 63; i >= 0; i--) {
20499 time_t x = pt | ((time_t)1 << i);
20500 if (x < 0 || x < pt) continue;
20501 gm_check (x, 69, 0x7fffffff);
20504 printf ("sGMTIME_max=%ld\n", pt);
20513 gm_check (MINLONG, -1900, 70);
20516 for (i = 36; i >= 0; i--) {
20517 time_t x = pt - ((time_t)1 << i);
20518 if (x > 0) continue;
20519 gm_check (x, -1900, 70);
20522 printf ("sGMTIME_min=%ld\n", pt);
20526 int main (int argc, char *argv[])
20528 fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t));
20535 if eval $compile; then
20538 echo "Cannot determine sGMTIME_max and sGMTIME_min." >&4
20544 echo "Checking max offsets that localtime () accepts"
20546 case "$sLOCALTIME_min/$sLOCALTIME_max" in
20549 #include <sys/types.h>
20558 void local_check (time_t t, int min_year, int max_year)
20560 if (sizeof (time_t) > 4 && t > 0x7ffffffffffff000LL)
20563 tmp = localtime (&t);
20564 if ( tmp == NULL ||
20565 /* Check tm_year overflow */
20566 tmp->tm_year < min_year || tmp->tm_year > max_year)
20570 } /* local_check */
20577 local_check (MAXLONG, 69, 0x7fffffff);
20579 if (tmp == NULL || tmp->tm_year < 0) {
20580 for (i = 63; i >= 0; i--) {
20581 time_t x = pt | ((time_t)1 << i);
20582 if (x < 0 || x < pt) continue;
20583 local_check (x, 69, 0x7fffffff);
20586 printf ("sLOCALTIME_max=%ld\n", pt);
20595 local_check (MINLONG, -1900, 70);
20598 for (i = 36; i >= 0; i--) {
20599 time_t x = pt - ((time_t)1 << i);
20600 if (x > 0) continue;
20601 local_check (x, -1900, 70);
20604 printf ("sLOCALTIME_min=%ld\n", pt);
20608 int main (int argc, char *argv[])
20616 if eval $compile; then
20619 echo "Cannot determine sLOCALTIME_max and sLOCALTIME_min." >&4
20625 : check for type of arguments to select.
20626 case "$selecttype" in
20627 '') case "$d_select" in
20631 Checking to see what type of arguments are accepted by select().
20633 hdrs="$define sys/types.h
20634 $i_systime sys/time.h
20635 $i_sysselct sys/select.h
20636 $d_socket sys/socket.h"
20637 : The first arg can be int, unsigned, or size_t
20638 : The last arg may or may not be 'const'
20640 : void pointer has been seen but using that
20641 : breaks the selectminbits test
20642 for xxx in 'fd_set *' 'int *'; do
20643 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
20644 for tmo in 'struct timeval *' 'const struct timeval *'; do
20646 '') try="$extern_C select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
20647 if ./protochk "$try" $hdrs; then
20648 echo "Your system accepts $xxx."
20657 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
20658 case "$d_fd_set" in
20659 $define) dflt="fd_set *" ;;
20668 *) : no select, so pick a harmless default
20675 : check for the select 'width'
20676 case "$selectminbits" in
20677 '') safebits=`expr $ptrsize \* 8`
20678 case "$d_select" in
20682 Checking to see on how many bits at a time your select() operates...
20685 #include <sys/types.h>
20687 #$i_systime I_SYS_TIME
20688 #$i_systimek I_SYS_TIME_KERNEL
20693 # ifdef I_SYS_TIME_KERNEL
20696 # include <sys/time.h>
20697 # ifdef I_SYS_TIME_KERNEL
20701 #$i_sysselct I_SYS_SELECT
20702 #ifdef I_SYS_SELECT
20703 #include <sys/select.h>
20705 #$d_socket HAS_SOCKET
20707 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
20710 #$i_stdlib I_STDLIB
20712 #include <stdlib.h>
20715 #define S sizeof(*(b))
20717 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
20718 #define NBITS (NBYTES * 8)
20720 char *s = (char *)malloc(NBYTES);
20729 fp = fopen("try.c", "r");
20735 b = ($selecttype)s;
20736 for (i = 0; i < NBITS; i++)
20740 select(fd + 1, b, 0, 0, &t);
20741 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
20743 printf("%d\n", i + 1);
20748 if eval $compile_ok; then
20749 selectminbits=`$run ./try`
20750 case "$selectminbits" in
20752 Cannot figure out on how many bits at a time your select() operates.
20753 I'll play safe and guess it is $safebits bits.
20755 selectminbits=$safebits
20756 bits="$safebits bits"
20759 *) bits="$selectminbits bits" ;;
20761 echo "Your select() operates on $bits at a time." >&4
20763 rp='What is the minimum number of bits your select() operates on?'
20764 case "$byteorder" in
20765 12345678) dflt=64 ;;
20771 selectminbits="$val"
20775 *) : no select, so pick a harmless default
20776 selectminbits=$safebits
20782 : Trace out the files included by signal.h, then look for SIGxxx names.
20783 if [ "X$fieldn" = X ]; then
20784 : Just make some guesses. We check them later.
20785 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
20787 xxx=`echo '#include <signal.h>' |
20788 $cppstdin $cppminus $cppflags 2>/dev/null |
20789 $grep '^[ ]*#.*include' |
20790 $awk "{print \\$$fieldn}" | $sed 's!"!!g' |\
20791 $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
20794 for xx in $xxx /dev/null ; do
20795 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
20797 case "$xxxfiles" in
20798 '') xxxfiles=`./findhdr signal.h` ;;
20801 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
20802 print substr($2, 4, 20)
20804 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
20805 print substr($3, 4, 20)
20807 : Append some common names just in case the awk scan failed.
20808 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
20809 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
20810 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
20811 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
20812 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
20814 : generate a few handy files for later
20815 $cat > signal.c <<EOCP
20816 #include <sys/types.h>
20817 #include <signal.h>
20818 #$i_stdlib I_STDLIB
20820 #include <stdlib.h>
20825 /* Strange style to avoid deeply-nested #if/#else/#endif */
20828 # define NSIG (_NSIG)
20834 # define NSIG (SIGMAX+1)
20840 # define NSIG (SIG_MAX+1)
20846 # define NSIG (_SIG_MAX+1)
20852 # define NSIG (MAXSIG+1)
20858 # define NSIG (MAX_SIG+1)
20863 # ifdef SIGARRAYSIZE
20864 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
20870 # define NSIG (_sys_nsig) /* Solaris 2.5 */
20874 /* Default to some arbitrary number that's big enough to get most
20875 of the common signals.
20881 printf("NSIG %d\n", NSIG);
20887 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
20889 printf "#ifdef SIG"; printf $1; printf "\n"
20890 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
20891 printf $1; printf ");\n"
20895 printf "#endif /* JUST_NSIG */\n";
20896 printf "exit(0);\n}\n";
20899 $cat >signal.awk <<'EOP'
20900 BEGIN { ndups = 0 }
20901 $1 ~ /^NSIG$/ { nsig = $2 }
20902 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
20903 if ($2 > maxsig) { maxsig = $2 }
20904 if (sig_name[$2]) {
20905 dup_name[ndups] = $1
20906 dup_num[ndups] = $2
20918 printf("NSIG %d\n", nsig);
20919 for (n = 1; n < nsig; n++) {
20921 printf("%s %d\n", sig_name[n], sig_num[n])
20924 printf("NUM%d %d\n", n, n)
20927 for (n = 0; n < ndups; n++) {
20928 printf("%s %d\n", dup_name[n], dup_num[n])
20932 $cat >signal_cmd <<EOS
20934 if $test -s signal.lst; then
20935 echo "Using your existing signal.lst file"
20940 $cat >>signal_cmd <<'EOS'
20943 if eval $compile_ok; then
20944 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) |\
20945 $uniq | $awk -f signal.awk >signal.lst
20947 echo "(I can't seem be able to compile the whole test program)" >&4
20948 echo "(I'll try it in little pieces.)" >&4
20949 set signal -DJUST_NSIG
20950 if eval $compile_ok; then
20951 $run ./signal$_exe > signal.nsg
20954 echo "I can't seem to figure out how many signals you have." >&4
20955 echo "Guessing 50." >&4
20956 echo 'NSIG 50' > signal.nsg
20958 : Now look at all the signal names, one at a time.
20959 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
20960 $cat > signal.c <<EOCP
20961 #include <sys/types.h>
20962 #include <signal.h>
20965 printf("$xx %d\n", SIG${xx});
20970 if eval $compile; then
20971 echo "SIG${xx} found."
20972 $run ./signal$_exe >> signal.ls1
20974 echo "SIG${xx} NOT found."
20977 if $test -s signal.ls1; then
20978 $cat signal.nsg signal.ls1 |
20979 $sort -n | $uniq | $awk -f signal.awk >signal.lst
20983 if $test -s signal.lst; then
20986 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
20987 echo 'kill -l' >signal
20988 set X `csh -f <signal`
20992 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
20994 echo $@ | $tr ' ' $trnl | \
20995 $awk '{ printf "%s %d\n", $1, ++s; }
20996 END { printf "NSIG %d\n", ++s }' >signal.lst
20998 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
21000 chmod a+x signal_cmd
21001 $eunicefix signal_cmd
21003 : generate list of signal names
21005 case "$sig_name_init" in
21007 *) case "$sig_num_init" in
21008 ''|*,*) doinit=yes ;;
21013 echo "Generating a list of signal names and numbers..." >&4
21015 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
21016 sig_name=`$awk 'BEGIN { printf "ZERO " }
21017 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
21018 sig_num=`$awk 'BEGIN { printf "0 " }
21019 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
21020 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
21021 !/^NSIG/ { printf "\"%s\", ", $1 }
21022 END { printf "0\n" }' signal.lst`
21023 sig_num_init=`$awk 'BEGIN { printf "0, " }
21024 !/^NSIG/ { printf "%d, ", $2}
21025 END { printf "0\n"}' signal.lst`
21028 echo "The following $sig_count signals are available:"
21030 echo $sig_name | $awk \
21031 'BEGIN { linelen = 0 }
21033 for (i = 1; i <= NF; i++) {
21034 name = "SIG" $i " "
21035 linelen = linelen + length(name)
21036 if (linelen > 70) {
21038 linelen = length(name)
21044 sig_size=`echo $sig_name | awk '{print NF}'`
21045 $rm -f signal signal.c signal.awk signal.lst signal_cmd
21047 : Check size of size
21049 case "$sizetype" in
21050 *_t) zzz="$sizetype" ;;
21051 *) zzz="filesize" ;;
21053 echo "Checking the size of $zzz..." >&4
21055 #include <sys/types.h>
21057 #$i_stdlib I_STDLIB
21059 #include <stdlib.h>
21062 printf("%d\n", (int)sizeof($sizetype));
21067 if eval $compile_ok; then
21071 echo "(I can't execute the test program--guessing $sizesize.)" >&4
21074 echo "Your $zzz size is $sizesize bytes."
21079 echo "(I can't compile the test program--guessing $sizesize.)" >&4
21083 : check for socklen_t
21085 echo "Checking to see if you have socklen_t..." >&4
21087 #include <sys/types.h>
21088 #$d_socket HAS_SOCKET
21090 #include <sys/socket.h>
21092 int main() { socklen_t x = 16; }
21095 if eval $compile; then
21097 echo "You have socklen_t."
21100 echo "You do not have socklen_t."
21101 case "$sizetype" in
21102 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
21109 : see if this is a socks.h system
21110 set socks.h i_socks
21113 : check for type of the size argument to socket calls
21114 case "$d_socket" in
21118 Checking to see what type is the last argument of accept().
21121 case "$d_socklen_t" in
21122 "$define") yyy="$yyy socklen_t"
21124 yyy="$yyy $sizetype int long unsigned"
21125 for xxx in $yyy; do
21126 case "$socksizetype" in
21127 '') try="$extern_C int accept(int, struct sockaddr *, $xxx *);"
21128 case "$usesocks" in
21130 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
21131 echo "Your system accepts '$xxx *' for the last argument of accept()."
21132 socksizetype="$xxx"
21135 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
21136 echo "Your system accepts '$xxx *' for the last argument of accept()."
21137 socksizetype="$xxx"
21144 : In case none of those worked, prompt the user.
21145 case "$socksizetype" in
21146 '') rp='What is the type for socket address structure sizes?'
21153 *) : no sockets, so pick relatively harmless default
21158 : see what type is used for signed size_t
21159 set ssize_t ssizetype int stdio.h sys/types.h
21164 #$i_stdlib I_STDLIB
21166 #include <stdlib.h>
21168 #include <sys/types.h>
21169 #define Size_t $sizetype
21170 #define SSize_t $dflt
21173 if (sizeof(Size_t) == sizeof(SSize_t))
21175 else if (sizeof(Size_t) == sizeof(int))
21184 if eval $compile_ok && $run ./try > /dev/null; then
21185 ssizetype=`$run ./try`
21186 echo "I'll be using $ssizetype for functions returning a byte count." >&4
21189 Help! I can't compile and run the ssize_t test program: please enlighten me!
21190 (This is probably a misconfiguration in your system or libraries, and
21191 you really ought to fix it. Still, I'll try anyway.)
21193 I need a type that is the same size as $sizetype, but is guaranteed to
21194 be signed. Common values are ssize_t, int and long.
21197 rp="What signed type is the same size as $sizetype?"
21203 : see what type of char stdio uses.
21205 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
21206 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
21207 echo "Your stdio uses unsigned chars." >&4
21208 stdchar="unsigned char"
21210 echo "Your stdio uses signed chars." >&4
21215 : see what type uids are declared as in the kernel
21217 echo "Looking for the type for user ids returned by getuid()."
21218 set uid_t uidtype xxx stdio.h sys/types.h
21222 xxx=`./findhdr sys/user.h`
21223 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
21225 unsigned) dflt="$1 $2" ;;
21229 *) dflt="$uidtype";;
21232 uid_t) echo "uid_t found." ;;
21233 *) rp="What is the type for user ids returned by getuid()?"
21239 : Check size of UID
21242 *_t) zzz="$uidtype" ;;
21245 echo "Checking the size of $zzz..." >&4
21247 #include <sys/types.h>
21249 #$i_stdlib I_STDLIB
21251 #include <stdlib.h>
21254 printf("%d\n", (int)sizeof($uidtype));
21259 if eval $compile_ok; then
21263 echo "(I can't execute the test program--guessing $uidsize.)" >&4
21266 echo "Your $zzz is $uidsize bytes long."
21271 echo "(I can't compile the test program--guessing $uidsize.)" >&4
21274 : Check if UID is signed
21277 *_t) zzz="$uidtype" ;;
21280 echo "Checking the sign of $zzz..." >&4
21282 #include <sys/types.h>
21293 if eval $compile; then
21297 echo "(I can't execute the test program--guessing unsigned.)" >&4
21301 1) echo "Your $zzz is unsigned." ;;
21302 -1) echo "Your $zzz is signed." ;;
21308 echo "(I can't compile the test program--guessing unsigned.)" >&4
21312 : Check format string for UID
21314 $echo "Checking the format string to be used for uids..." >&4
21317 -1) if $test X"$uidsize" = X"$ivsize"; then
21318 uidformat="$ivdformat"
21320 if $test X"$uidsize" = X"$longsize"; then
21323 if $test X"$uidsize" = X"$intsize"; then
21326 if $test X"$uidsize" = X"$shortsize"; then
21333 *) if $test X"$uidsize" = X"$uvsize"; then
21334 uidformat="$uvuformat"
21336 if $test X"$uidsize" = X"$longsize"; then
21339 if $test X"$uidsize" = X"$intsize"; then
21342 if $test X"$uidsize" = X"$shortsize"; then
21351 : Check if site customization support was requested
21352 case "$usesitecustomize" in
21353 $define|true|[Yy]*)
21354 usesitecustomize="$define"
21357 usesitecustomize="$undef"
21361 : see if prototypes support variable argument declarations
21363 case "$prototype$i_stdarg" in
21365 echo "It appears we'll be able to prototype varargs functions." >&4
21369 echo "Too bad... We won't be using prototyped varargs functions..." >&4
21376 : determine compiler compiler
21385 if $test -f "$byacc$_exe"; then
21387 comp="byacc or $comp"
21389 if $test -f "$bison$_exe"; then
21390 comp="$comp or bison -y"
21392 rp="Which compiler compiler ($comp) shall I use?"
21401 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
21407 : see if this is a assert.h system
21408 set assert.h i_assert
21411 : see if this is a fp.h system
21415 : see if this is a fp_class.h system
21416 set fp_class.h i_fp_class
21419 : see if gdbm.h is available
21424 : see if gdbm_open exists
21425 set gdbm_open d_gdbm_open
21427 case "$d_gdbm_open" in
21430 echo "We won't be including <gdbm.h>"
21439 : see if this is a ieeefp.h system
21440 case "$i_ieeefp" in
21441 '' ) set ieeefp.h i_ieeefp
21446 : see if this is a libutil.h system
21447 set libutil.h i_libutil
21450 : see if mach cthreads are available
21451 if test "X$usethreads" = "X$define"; then
21452 set mach/cthreads.h i_machcthr
21455 i_machcthr="$undef"
21458 : see if this is a mntent.h system
21459 set mntent.h i_mntent
21462 : see if net/errno.h is available
21464 set net/errno.h val
21467 : Unfortunately, it causes problems on some systems. Arrgh.
21470 cat > try.c <<'EOM'
21473 #include <net/errno.h>
21479 if $cc $ccflags -c try.c >/dev/null 2>&1; then
21480 echo "We'll be including <net/errno.h>." >&4
21482 echo "We won't be including <net/errno.h>." >&4
21491 : see if netinet/tcp.h is available
21492 set netinet/tcp.h i_netinettcp
21495 : see if this is a poll.h system
21499 : see if this is a prot.h system
21503 : Preprocessor symbols
21505 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
21506 $cat <<'EOSH' > Cppsym.know
21507 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
21508 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
21509 alliant alpha am29000 AM29000 AMD64 amd64 amiga AMIGAOS AMIX
21510 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
21511 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
21512 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
21513 bull c cadmus clipper CMU COFF COMPILER_VERSION
21514 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
21515 CYGWIN DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
21516 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
21517 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
21519 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
21520 H3050R H3050RX hbullx20 hcx host_mips
21521 hp200 hp300 hp700 HP700 hp800 hp9000
21522 hp9000s200 hp9000s300 hp9000s400 hp9000s500
21523 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
21524 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
21525 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
21526 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
21527 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
21528 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
21529 LIBCATAMOUNT Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
21530 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
21531 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
21532 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
21533 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
21534 MATH_HAS_NO_SIDE_EFFECTS
21535 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
21536 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
21537 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
21538 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
21539 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
21540 NetBSD news1500 news1700 news1800 news1900 news3700
21541 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
21542 ns32016 ns32332 ns32k nsc32000
21543 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
21544 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
21545 pc532 pdp11 PGC PIC plexus PORTAR posix
21546 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
21547 POSIX_C_SOURCE POSIX_SOURCE POWER
21548 PROTOTYPES PWB pyr QNX QK_USER R3000 REENTRANT RES Rhapsody RISC6000
21549 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
21550 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
21551 sony sony_news sonyrisc sparc sparclite spectrum
21552 stardent stdc STDC_EXT stratos sun sun3 sun386
21553 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
21554 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
21555 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
21556 sysV68 sysV88 Tek4132 Tek4300 titan
21557 TM3200 TM5400 TM5600
21558 tower tower32 tower32_200 tower32_600 tower32_700
21559 tower32_800 tower32_850 tss
21560 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
21561 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
21562 unix UNIX95 UNIX99 unixpc unos
21563 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
21564 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
21565 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
21567 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms x86_64 xenix Xenix286
21568 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
21569 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
21572 # Maybe put other stuff here too.
21573 cat <<EOSH >>Cppsym.know
21576 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
21577 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
21578 $cat Cppsym.know > Cppsym.c
21579 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
21580 $rm -f Cppsym.a Cppsym.b Cppsym.c
21581 cat <<EOSH > Cppsym
21583 if $test \$# -gt 0; then
21584 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
21585 if $test -s Cppsym.got; then
21592 $tr " " "$trnl" | ./Cppsym.try
21598 cat <<EOSH > Cppsym.try
21600 cat <<'EOCP' > try.c
21603 #define STRINGIFY(a) "a"
21605 #if cpp_stuff == 42
21606 #define StGiFy(a) #a
21607 #define STRINGIFY(a) StGiFy(a)
21609 #if $cpp_stuff != 1 && $cpp_stuff != 42
21610 # include "Bletch: How does this C preprocessor stringify macros?"
21616 cat <<'EOSH' >> Cppsym.try
21618 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
21619 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
21620 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
21621 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
21623 echo 'return 0;}' >> try.c
21625 cat <<EOSH >> Cppsym.try
21627 case "$osname-$gccversion" in
21628 irix-) ccflags="\$ccflags -woff 1178" ;;
21629 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
21631 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
21633 chmod +x Cppsym.try
21634 $eunicefix Cppsym.try
21635 ./Cppsym < Cppsym.know > Cppsym.true
21636 : Add in any linux cpp "predefined macros":
21637 case "$osname::$gccversion" in
21638 *linux*::*.*|*gnukfreebsd*::*.*|gnu::*.*)
21640 rm -f $tHdrH'.h' $tHdrH
21642 if $cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
21643 sed 's/#define[\ \ ]*//;s/[\ \ ].*$//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
21644 if [ -s $tHdrH'_cppsym.real' ]; then
21645 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
21648 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
21651 : now check the C compiler for additional symbols
21652 postprocess_cc_v=''
21654 aix) postprocess_cc_v="|$tr , ' '" ;;
21661 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
21664 -D*) echo "\$i" | $sed 's/^-D//';;
21665 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
21670 postprocess_cc_v=''
21673 ./ccsym > ccsym1.raw
21674 if $test -s ccsym1.raw; then
21675 $sort ccsym1.raw | $uniq >ccsym.raw
21677 mv ccsym1.raw ccsym.raw
21680 $awk '/\=/ { print $0; next }
21681 { print $0"=1" }' ccsym.raw >ccsym.list
21682 $comm -13 Cppsym.true ccsym.list >ccsym.own
21683 $comm -12 Cppsym.true ccsym.list >ccsym.com
21684 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
21686 if $test -z ccsym.raw; then
21687 echo "Your C compiler doesn't seem to define any symbols!" >&4
21689 echo "However, your C preprocessor defines the following symbols:"
21692 cppsymbols=`$cat Cppsym.true`
21693 cppsymbols=`echo $cppsymbols`
21694 cppccsymbols="$cppsymbols"
21696 if $test -s ccsym.com; then
21697 echo "Your C compiler and pre-processor define these symbols:"
21698 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
21701 cppccsymbols=`$cat ccsym.com`
21702 cppccsymbols=`echo $cppccsymbols`
21703 $test "$silent" || sleep 1
21705 if $test -s ccsym.cpp; then
21706 $test "$also" && echo " "
21707 echo "Your C pre-processor ${also}defines the following symbols:"
21708 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
21710 cppsymbols=`$cat ccsym.cpp`
21711 cppsymbols=`echo $cppsymbols`
21712 $test "$silent" || sleep 1
21714 if $test -s ccsym.own; then
21715 $test "$also" && echo " "
21716 echo "Your C compiler ${also}defines the following cpp symbols:"
21717 $sed -e 's/\(..*\)=1/\1/' ccsym.own
21718 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
21719 ccsymbols=`$cat ccsym.own`
21720 ccsymbols=`echo $ccsymbols`
21721 $test "$silent" || sleep 1
21725 : see if this is a termio system
21729 if $test `./findhdr termios.h`; then
21730 set tcsetattr i_termios
21736 "$define") echo "You have POSIX termios.h... good!" >&4;;
21737 *) if ./Cppsym pyr; then
21738 case "`/bin/universe`" in
21739 ucb) if $test `./findhdr sgtty.h`; then
21741 echo "<sgtty.h> found." >&4
21743 echo "System is pyramid with BSD universe."
21744 ./warn "<sgtty.h> not found--you could have problems."
21746 *) if $test `./findhdr termio.h`; then
21748 echo "<termio.h> found." >&4
21750 echo "System is pyramid with USG universe."
21751 ./warn "<termio.h> not found--you could have problems."
21755 if $test `./findhdr termio.h`; then
21756 echo "<termio.h> found." >&4
21758 elif $test `./findhdr sgtty.h`; then
21759 echo "<sgtty.h> found." >&4
21762 ./warn "Neither <termio.h> nor <sgtty.h> found--cross fingers!"
21765 if $test `./findhdr sgtty.h`; then
21766 echo "<sgtty.h> found." >&4
21768 elif $test `./findhdr termio.h`; then
21769 echo "<termio.h> found." >&4
21772 ./warn "Neither <sgtty.h> nor <termio.h> found--cross fingers!"
21776 set i_termio; eval $setvar
21777 val=$val2; set i_sgtty; eval $setvar
21778 val=$val3; set i_termios; eval $setvar
21780 : see if stddef is available
21781 set stddef.h i_stddef
21784 : see if sys/access.h is available
21785 set sys/access.h i_sysaccess
21788 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
21789 set sys/filio.h i_sysfilio
21792 if $test `./findhdr sys/ioctl.h`; then
21794 echo '<sys/ioctl.h> found.' >&4
21797 if $test $i_sysfilio = "$define"; then
21798 echo '<sys/ioctl.h> NOT found.' >&4
21800 $test $i_sgtty = "$define" && xxx="sgtty.h"
21801 $test $i_termio = "$define" && xxx="termio.h"
21802 $test $i_termios = "$define" && xxx="termios.h"
21803 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
21809 : see if socket ioctl defs are in sys/sockio.h
21811 xxx=`./findhdr sys/sockio.h`
21812 if $test "$xxx"; then
21813 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
21815 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
21818 echo "No socket ioctls found in <sys/sockio.h>." >&4
21823 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
21829 : see if this is a syslog.h system
21830 set syslog.h i_syslog
21833 : see if this is a sys/mode.h system
21834 set sys/mode.h i_sysmode
21837 : see if there is a sys/poll.h file
21838 set sys/poll.h i_syspoll
21841 : see if sys/resource.h has to be included
21842 set sys/resource.h i_sysresrc
21845 : see if sys/security.h is available
21846 set sys/security.h i_syssecrt
21849 : see if this is a sys/statvfs.h system
21850 set sys/statvfs.h i_sysstatvfs
21853 : see if this is a sys/un.h system
21854 set sys/un.h i_sysun
21857 : see if this is a sys/utsname.h system
21858 set sys/utsname.h i_sysutsname
21861 : see if this is a syswait system
21862 set sys/wait.h i_syswait
21865 : see if this is a ustat.h system
21866 set ustat.h i_ustat
21869 : see if this is an utime system
21870 set utime.h i_utime
21873 : see if this is a vfork system
21876 set vfork.h i_vfork
21886 echo "Looking for extensions..." >&4
21887 : If we are using the old config.sh, known_extensions may contain
21888 : old or inaccurate or duplicate values.
21889 known_extensions=''
21890 nonxs_extensions=''
21891 : We do not use find because it might not be available.
21892 : We do not just use MANIFEST because the user may have dropped
21893 : some additional extensions into the source tree and expect them
21896 : Function to recursively find available extensions, ignoring DynaLoader
21897 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
21898 : In 5.10.1 and later, extensions are stored in directories
21899 : like File-Glob instead of the older File/Glob/.
21903 DynaLoader|dynaload) ;;
21905 this_ext=`echo $xxx | $sed -e s/-/\\\//g`;
21906 leaf=`echo $xxx | $sed -e s/.*-//`;
21907 if $test -d File; then
21908 if $test -f $xxx/$leaf.xs -o -f $xxx/$leaf.c; then
21909 known_extensions="$known_extensions $1$this_ext";
21910 elif $test -f $xxx/Makefile.PL; then
21911 nonxs_extensions="$nonxs_extensions $1$this_ext";
21913 if $test -d $xxx -a $# -lt 10; then
21916 eval $find_extensions;
21922 $ls -1 $xxx > $$.tmp;
21923 if $contains "\.xs$" $$.tmp > /dev/null 2>&1; then
21924 known_extensions="$known_extensions $this_ext";
21925 elif $contains "\.c$" $$.tmp > /dev/null 2>&1; then
21926 known_extensions="$known_extensions $this_ext";
21927 elif $test -d $xxx; then
21928 nonxs_extensions="$nonxs_extensions $this_ext";
21939 eval $find_extensions
21943 eval $find_extensions
21947 eval $find_extensions
21948 if $test -d File-Glob; then
21949 : All ext/ flattened
21951 # Special case: Add in modules that nest beyond the first level.
21952 # Currently threads/shared and Hash/Util/FieldHash, since they are
21953 # not picked up by the recursive find above (and adding in general
21954 # recursive finding breaks SDBM_File/sdbm).
21955 # A.D. 20011025 (SDBM), ajgough 20071008 (FieldHash)
21956 known_extensions="$known_extensions threads/shared Hash/Util/FieldHash"
21958 set X $known_extensions
21960 known_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
21961 set X $nonxs_extensions
21963 nonxs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
21966 : Now see which are supported on this system.
21968 for xxx in $known_extensions ; do
21972 $define) avail_ext="$avail_ext $xxx" ;;
21975 GDBM_File|gdbm_fil)
21977 $define) avail_ext="$avail_ext $xxx" ;;
21980 I18N/Langinfo|i18n_lan)
21981 case "$i_langinfo$d_nl_langinfo" in
21982 $define$define) avail_ext="$avail_ext $xxx" ;;
21986 : XXX Do we need a useipcsysv variable here
21987 case "${d_msg}${d_sem}${d_shm}" in
21988 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
21991 NDBM_File|ndbm_fil)
21994 case "$osname-$use64bitint" in
21997 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
22000 *) avail_ext="$avail_ext $xxx" ;;
22005 ODBM_File|odbm_fil)
22006 case "${i_dbm}${i_rpcsvcdbm}" in
22008 case "$d_cplusplus" in
22009 define) ;; # delete as a function name will not work
22010 *) case "$osname-$use64bitint" in
22013 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
22016 *) avail_ext="$avail_ext $xxx" ;;
22024 case "$useopcode" in
22025 true|define|y) avail_ext="$avail_ext $xxx" ;;
22029 case "$useposix" in
22030 true|define|y) avail_ext="$avail_ext $xxx" ;;
22034 case "$d_socket" in
22037 beos) ;; # not unless BONE
22038 *) avail_ext="$avail_ext $xxx" ;;
22043 Sys/Syslog|sys/syslog)
22044 : XXX syslog requires socket
22045 case "$d_socket" in
22046 true|$define|y) avail_ext="$avail_ext $xxx" ;;
22050 case "$usethreads" in
22052 case "$use5005threads" in
22053 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
22057 threads|threads/shared)
22058 # threads and threads::shared are special cases.
22059 # To stop people from asking "Perl 5.8.0 was supposed
22060 # to have this new fancy threads implementation but my
22061 # perl doesn't have it" and from people trying to
22062 # (re)install the threads module using CPAN.pm and
22063 # CPAN.pm then offering to reinstall Perl 5.8.0,
22064 # the threads.pm and threads/shared.pm will always be
22065 # there, croaking informatively ("you need to rebuild
22066 # all of Perl with threads, sorry") when threads haven't
22067 # been compiled in.
22069 avail_ext="$avail_ext $xxx"
22075 cygwin) avail_ext="$avail_ext $xxx" ;;
22078 XS/APItest|xs/apitest)
22079 # This is just for testing. Skip it unless we have dynamic loading.
22082 $define) avail_ext="$avail_ext $xxx" ;;
22085 XS/Typemap|xs/typemap)
22086 # This is just for testing. Skip it unless we have dynamic loading.
22088 $define) avail_ext="$avail_ext $xxx" ;;
22091 *) avail_ext="$avail_ext $xxx"
22100 case "$onlyextensions" in
22102 *) keepextensions=''
22103 echo "You have requested that only certain extensions be included..." >&4
22104 for i in $onlyextensions; do
22105 case " $avail_ext " in
22107 echo "Keeping extension $i."
22108 keepextensions="$keepextensions $i"
22110 *) echo "Ignoring extension $i." ;;
22113 avail_ext="$keepextensions"
22117 case "$noextensions" in
22119 *) keepextensions=''
22120 echo "You have requested that certain extensions be ignored..." >&4
22121 for i in $avail_ext; do
22122 case " $noextensions " in
22123 *" $i "*) echo "Ignoring extension $i." ;;
22124 *) echo "Keeping extension $i.";
22125 keepextensions="$keepextensions $i"
22129 avail_ext="$keepextensions"
22133 : Now see which nonxs extensions are supported on this system.
22134 : For now assume all are.
22136 for xxx in $nonxs_extensions ; do
22138 *) nonxs_ext="$nonxs_ext $xxx"
22150 A number of extensions are supplied with $package. You may choose to
22151 compile these extensions for dynamic loading (the default), compile
22152 them into the $package executable (static loading), or not include
22153 them at all. Answer "none" to include no extensions.
22154 Note that DynaLoader is always built and need not be mentioned here.
22157 case "$dynamic_ext" in
22159 : Exclude those listed in static_ext
22161 for xxx in $avail_ext; do
22162 case " $static_ext " in
22164 *) dflt="$dflt $xxx" ;;
22171 *) dflt="$dynamic_ext"
22172 # Perhaps we are reusing an old out-of-date config.sh.
22175 if test X"$dynamic_ext" != X"$avail_ext"; then
22177 NOTICE: Your previous config.sh list may be incorrect.
22178 The extensions now available to you are
22180 but the default list from your previous config.sh is
22192 rp="What extensions do you wish to load dynamically?"
22195 none) dynamic_ext=' ' ;;
22196 *) dynamic_ext="$ans" ;;
22199 case "$static_ext" in
22201 : Exclude those already listed in dynamic linking
22203 for xxx in $avail_ext; do
22204 case " $dynamic_ext " in
22206 *) dflt="$dflt $xxx" ;;
22213 *) dflt="$static_ext"
22220 rp="What extensions do you wish to load statically?"
22223 none) static_ext=' ' ;;
22224 *) static_ext="$ans" ;;
22229 A number of extensions are supplied with $package. Answer "none"
22230 to include no extensions.
22231 Note that DynaLoader is always built and need not be mentioned here.
22234 case "$static_ext" in
22235 '') dflt="$avail_ext" ;;
22236 *) dflt="$static_ext"
22237 # Perhaps we are reusing an old out-of-date config.sh.
22240 if test X"$static_ext" != X"$avail_ext"; then
22242 NOTICE: Your previous config.sh list may be incorrect.
22243 The extensions now available to you are
22245 but the default list from your previous config.sh is
22254 : Exclude those that are not xs extensions
22258 rp="What extensions do you wish to include?"
22261 none) static_ext=' ' ;;
22262 *) static_ext="$ans" ;;
22267 # Encode is a special case. If we are building Encode as a static
22268 # extension, we need to explicitly list its subextensions as well.
22269 # For other nested extensions, this is handled automatically by
22270 # the appropriate Makefile.PL.
22271 case " $static_ext " in
22272 *" Encode "*) # Add the subextensions of Encode
22274 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
22275 static_ext="$static_ext Encode/$xxx"
22281 set X $dynamic_ext $static_ext $nonxs_ext
22285 # Sanity check: We require an extension suitable for use with
22286 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
22287 # should show up as failures in the test suite, but it's helpful to
22288 # catch them now.) The 'extensions' list is normally sorted
22289 # alphabetically, so we need to accept either
22290 # DB_File ... Fcntl ... IO ....
22291 # or something like
22292 # Fcntl ... NDBM_File ... IO ....
22293 case " $extensions" in
22294 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
22295 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
22296 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
22297 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
22298 echo "WARNING: The Perl you are building will be quite crippled." >& 4
22302 : Remove libraries needed only for extensions
22303 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
22304 : The exception is SunOS 4.x, which needs them.
22305 case "${osname}X${osvers}" in
22309 *) case "$usedl" in
22310 $define|true|[yY]*)
22311 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
22315 *) perllibs="$libs"
22321 : Remove build directory name from cppstdin so it can be used from
22322 : either the present location or the final installed location.
22324 : Get out of the UU directory to get correct path name.
22326 case "$cppstdin" in
22328 echo "Stripping down cppstdin path name"
22334 : end of configuration questions
22336 echo "End of configuration questions."
22339 : back to where it started
22340 if test -d ../UU; then
22344 : configuration may be unconditionally patched via a 'config.arch' file
22345 if $test -f config.arch; then
22346 echo "I see a config.arch file, loading it." >&4
22350 : configuration may be patched via a 'config.over' file
22351 if $test -f config.over; then
22354 rp='I see a config.over file. Do you wish to load it?'
22357 n*) echo "OK, I'll ignore it.";;
22359 echo "Configuration override changes have been loaded."
22364 : in case they want portability, strip down executable paths
22365 case "$d_portable" in
22368 echo "Stripping down executable paths..." >&4
22369 for file in $loclist $trylist; do
22371 eval $file=`basename $temp`
22376 : create config.sh file
22378 echo "Creating config.sh..." >&4
22379 $spitshell <<EOT >config.sh
22382 # This file was produced by running the Configure script. It holds all the
22383 # definitions figured out by Configure. Should you modify one of these values,
22384 # do not forget to propagate your changes by running "Configure -der". You may
22385 # instead choose to run each of the .SH files by yourself, or "Configure -S".
22388 # Package name : $package
22389 # Source directory : $src
22390 # Configuration time: $cf_time
22391 # Configured by : $cf_by
22392 # Target system : $myuname
22395 : Add in command line options if available
22396 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
22398 $spitshell <<EOT >>config.sh
22407 Revision='$Revision'
22415 alignbytes='$alignbytes'
22416 ansi2knr='$ansi2knr'
22417 aphostname='$aphostname'
22418 api_revision='$api_revision'
22419 api_subversion='$api_subversion'
22420 api_version='$api_version'
22421 api_versionstring='$api_versionstring'
22424 archlibexp='$archlibexp'
22425 archname64='$archname64'
22426 archname='$archname'
22427 archobjs='$archobjs'
22428 asctime_r_proto='$asctime_r_proto'
22437 byteorder='$byteorder'
22439 castflags='$castflags'
22442 cccdlflags='$cccdlflags'
22443 ccdlflags='$ccdlflags'
22445 ccflags_uselargefiles='$ccflags_uselargefiles'
22447 ccsymbols='$ccsymbols'
22448 ccversion='$ccversion'
22450 cf_email='$cf_email'
22452 charbits='$charbits'
22453 charsize='$charsize'
22457 clocktype='$clocktype'
22459 compress='$compress'
22460 contains='$contains'
22464 cpp_stuff='$cpp_stuff'
22465 cppccsymbols='$cppccsymbols'
22466 cppflags='$cppflags'
22468 cppminus='$cppminus'
22470 cppstdin='$cppstdin'
22471 cppsymbols='$cppsymbols'
22472 crypt_r_proto='$crypt_r_proto'
22473 cryptlib='$cryptlib'
22475 ctermid_r_proto='$ctermid_r_proto'
22476 ctime_r_proto='$ctime_r_proto'
22477 d_Gconvert='$d_Gconvert'
22478 d_PRIEUldbl='$d_PRIEUldbl'
22479 d_PRIFUldbl='$d_PRIFUldbl'
22480 d_PRIGUldbl='$d_PRIGUldbl'
22481 d_PRIXU64='$d_PRIXU64'
22482 d_PRId64='$d_PRId64'
22483 d_PRIeldbl='$d_PRIeldbl'
22484 d_PRIfldbl='$d_PRIfldbl'
22485 d_PRIgldbl='$d_PRIgldbl'
22486 d_PRIi64='$d_PRIi64'
22487 d_PRIo64='$d_PRIo64'
22488 d_PRIu64='$d_PRIu64'
22489 d_PRIx64='$d_PRIx64'
22490 d_SCNfldbl='$d_SCNfldbl'
22491 d__fwalk='$d__fwalk'
22492 d_access='$d_access'
22493 d_accessx='$d_accessx'
22496 d_archlib='$d_archlib'
22497 d_asctime64='$d_asctime64'
22498 d_asctime_r='$d_asctime_r'
22501 d_attribute_deprecated='$d_attribute_deprecated'
22502 d_attribute_format='$d_attribute_format'
22503 d_attribute_malloc='$d_attribute_malloc'
22504 d_attribute_nonnull='$d_attribute_nonnull'
22505 d_attribute_noreturn='$d_attribute_noreturn'
22506 d_attribute_pure='$d_attribute_pure'
22507 d_attribute_unused='$d_attribute_unused'
22508 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
22512 d_bsdgetpgrp='$d_bsdgetpgrp'
22513 d_bsdsetpgrp='$d_bsdsetpgrp'
22514 d_builtin_choose_expr='$d_builtin_choose_expr'
22515 d_builtin_expect='$d_builtin_expect'
22517 d_c99_variadic_macros='$d_c99_variadic_macros'
22518 d_casti32='$d_casti32'
22519 d_castneg='$d_castneg'
22520 d_charvspr='$d_charvspr'
22522 d_chroot='$d_chroot'
22523 d_chsize='$d_chsize'
22525 d_clearenv='$d_clearenv'
22526 d_closedir='$d_closedir'
22527 d_cmsghdr_s='$d_cmsghdr_s'
22529 d_copysignl='$d_copysignl'
22530 d_cplusplus='$d_cplusplus'
22532 d_crypt_r='$d_crypt_r'
22534 d_ctermid='$d_ctermid'
22535 d_ctermid_r='$d_ctermid_r'
22536 d_ctime64='$d_ctime64'
22537 d_ctime_r='$d_ctime_r'
22538 d_cuserid='$d_cuserid'
22539 d_dbl_dig='$d_dbl_dig'
22540 d_dbminitproto='$d_dbminitproto'
22541 d_difftime64='$d_difftime64'
22542 d_difftime='$d_difftime'
22543 d_dir_dd_fd='$d_dir_dd_fd'
22545 d_dirnamlen='$d_dirnamlen'
22546 d_dlerror='$d_dlerror'
22547 d_dlopen='$d_dlopen'
22548 d_dlsymun='$d_dlsymun'
22549 d_dosuid='$d_dosuid'
22550 d_drand48_r='$d_drand48_r'
22551 d_drand48proto='$d_drand48proto'
22553 d_eaccess='$d_eaccess'
22554 d_endgrent='$d_endgrent'
22555 d_endgrent_r='$d_endgrent_r'
22556 d_endhent='$d_endhent'
22557 d_endhostent_r='$d_endhostent_r'
22558 d_endnent='$d_endnent'
22559 d_endnetent_r='$d_endnetent_r'
22560 d_endpent='$d_endpent'
22561 d_endprotoent_r='$d_endprotoent_r'
22562 d_endpwent='$d_endpwent'
22563 d_endpwent_r='$d_endpwent_r'
22564 d_endsent='$d_endsent'
22565 d_endservent_r='$d_endservent_r'
22566 d_eofnblk='$d_eofnblk'
22567 d_eunice='$d_eunice'
22568 d_faststdio='$d_faststdio'
22569 d_fchdir='$d_fchdir'
22570 d_fchmod='$d_fchmod'
22571 d_fchown='$d_fchown'
22573 d_fcntl_can_lock='$d_fcntl_can_lock'
22574 d_fd_macros='$d_fd_macros'
22575 d_fd_set='$d_fd_set'
22576 d_fds_bits='$d_fds_bits'
22577 d_fgetpos='$d_fgetpos'
22578 d_finite='$d_finite'
22579 d_finitel='$d_finitel'
22580 d_flexfnam='$d_flexfnam'
22582 d_flockproto='$d_flockproto'
22584 d_fp_class='$d_fp_class'
22585 d_fpathconf='$d_fpathconf'
22586 d_fpclass='$d_fpclass'
22587 d_fpclassify='$d_fpclassify'
22588 d_fpclassl='$d_fpclassl'
22589 d_fpos64_t='$d_fpos64_t'
22590 d_frexpl='$d_frexpl'
22591 d_fs_data_s='$d_fs_data_s'
22592 d_fseeko='$d_fseeko'
22593 d_fsetpos='$d_fsetpos'
22594 d_fstatfs='$d_fstatfs'
22595 d_fstatvfs='$d_fstatvfs'
22597 d_ftello='$d_ftello'
22599 d_futimes='$d_futimes'
22600 d_gdbm_ndbm_h_uses_prototypes='$d_gdbm_ndbm_h_uses_prototypes'
22601 d_gdbmndbm_h_uses_prototypes='$d_gdbmndbm_h_uses_prototypes'
22602 d_getaddrinfo='$d_getaddrinfo'
22603 d_getcwd='$d_getcwd'
22604 d_getespwnam='$d_getespwnam'
22605 d_getfsstat='$d_getfsstat'
22606 d_getgrent='$d_getgrent'
22607 d_getgrent_r='$d_getgrent_r'
22608 d_getgrgid_r='$d_getgrgid_r'
22609 d_getgrnam_r='$d_getgrnam_r'
22610 d_getgrps='$d_getgrps'
22611 d_gethbyaddr='$d_gethbyaddr'
22612 d_gethbyname='$d_gethbyname'
22613 d_gethent='$d_gethent'
22614 d_gethname='$d_gethname'
22615 d_gethostbyaddr_r='$d_gethostbyaddr_r'
22616 d_gethostbyname_r='$d_gethostbyname_r'
22617 d_gethostent_r='$d_gethostent_r'
22618 d_gethostprotos='$d_gethostprotos'
22619 d_getitimer='$d_getitimer'
22620 d_getlogin='$d_getlogin'
22621 d_getlogin_r='$d_getlogin_r'
22622 d_getmnt='$d_getmnt'
22623 d_getmntent='$d_getmntent'
22624 d_getnameinfo='$d_getnameinfo'
22625 d_getnbyaddr='$d_getnbyaddr'
22626 d_getnbyname='$d_getnbyname'
22627 d_getnent='$d_getnent'
22628 d_getnetbyaddr_r='$d_getnetbyaddr_r'
22629 d_getnetbyname_r='$d_getnetbyname_r'
22630 d_getnetent_r='$d_getnetent_r'
22631 d_getnetprotos='$d_getnetprotos'
22632 d_getpagsz='$d_getpagsz'
22633 d_getpbyname='$d_getpbyname'
22634 d_getpbynumber='$d_getpbynumber'
22635 d_getpent='$d_getpent'
22636 d_getpgid='$d_getpgid'
22637 d_getpgrp2='$d_getpgrp2'
22638 d_getpgrp='$d_getpgrp'
22639 d_getppid='$d_getppid'
22640 d_getprior='$d_getprior'
22641 d_getprotobyname_r='$d_getprotobyname_r'
22642 d_getprotobynumber_r='$d_getprotobynumber_r'
22643 d_getprotoent_r='$d_getprotoent_r'
22644 d_getprotoprotos='$d_getprotoprotos'
22645 d_getprpwnam='$d_getprpwnam'
22646 d_getpwent='$d_getpwent'
22647 d_getpwent_r='$d_getpwent_r'
22648 d_getpwnam_r='$d_getpwnam_r'
22649 d_getpwuid_r='$d_getpwuid_r'
22650 d_getsbyname='$d_getsbyname'
22651 d_getsbyport='$d_getsbyport'
22652 d_getsent='$d_getsent'
22653 d_getservbyname_r='$d_getservbyname_r'
22654 d_getservbyport_r='$d_getservbyport_r'
22655 d_getservent_r='$d_getservent_r'
22656 d_getservprotos='$d_getservprotos'
22657 d_getspnam='$d_getspnam'
22658 d_getspnam_r='$d_getspnam_r'
22659 d_gettimeod='$d_gettimeod'
22660 d_gmtime64='$d_gmtime64'
22661 d_gmtime_r='$d_gmtime_r'
22662 d_gnulibc='$d_gnulibc'
22663 d_grpasswd='$d_grpasswd'
22664 d_hasmntopt='$d_hasmntopt'
22666 d_ilogbl='$d_ilogbl'
22667 d_inc_version_list='$d_inc_version_list'
22669 d_inetaton='$d_inetaton'
22670 d_inetntop='$d_inetntop'
22671 d_inetpton='$d_inetpton'
22672 d_int64_t='$d_int64_t'
22673 d_isascii='$d_isascii'
22674 d_isfinite='$d_isfinite'
22677 d_isnanl='$d_isnanl'
22678 d_killpg='$d_killpg'
22679 d_lchown='$d_lchown'
22680 d_ldbl_dig='$d_ldbl_dig'
22681 d_libm_lib_version='$d_libm_lib_version'
22683 d_localtime64='$d_localtime64'
22684 d_localtime_r='$d_localtime_r'
22685 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
22686 d_locconv='$d_locconv'
22688 d_longdbl='$d_longdbl'
22689 d_longlong='$d_longlong'
22690 d_lseekproto='$d_lseekproto'
22692 d_madvise='$d_madvise'
22693 d_malloc_good_size='$d_malloc_good_size'
22694 d_malloc_size='$d_malloc_size'
22696 d_mbstowcs='$d_mbstowcs'
22697 d_mbtowc='$d_mbtowc'
22698 d_memchr='$d_memchr'
22699 d_memcmp='$d_memcmp'
22700 d_memcpy='$d_memcpy'
22701 d_memmove='$d_memmove'
22702 d_memset='$d_memset'
22704 d_mkdtemp='$d_mkdtemp'
22705 d_mkfifo='$d_mkfifo'
22706 d_mkstemp='$d_mkstemp'
22707 d_mkstemps='$d_mkstemps'
22708 d_mktime64='$d_mktime64'
22709 d_mktime='$d_mktime'
22712 d_modfl_pow32_bug='$d_modfl_pow32_bug'
22713 d_modflproto='$d_modflproto'
22714 d_mprotect='$d_mprotect'
22716 d_msg_ctrunc='$d_msg_ctrunc'
22717 d_msg_dontroute='$d_msg_dontroute'
22718 d_msg_oob='$d_msg_oob'
22719 d_msg_peek='$d_msg_peek'
22720 d_msg_proxy='$d_msg_proxy'
22721 d_msgctl='$d_msgctl'
22722 d_msgget='$d_msgget'
22723 d_msghdr_s='$d_msghdr_s'
22724 d_msgrcv='$d_msgrcv'
22725 d_msgsnd='$d_msgsnd'
22727 d_munmap='$d_munmap'
22728 d_mymalloc='$d_mymalloc'
22730 d_ndbm_h_uses_prototypes='$d_ndbm_h_uses_prototypes'
22732 d_nl_langinfo='$d_nl_langinfo'
22733 d_nv_preserves_uv='$d_nv_preserves_uv'
22734 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
22735 d_off64_t='$d_off64_t'
22736 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
22737 d_oldpthreads='$d_oldpthreads'
22738 d_oldsock='$d_oldsock'
22740 d_pathconf='$d_pathconf'
22742 d_perl_otherlibdirs='$d_perl_otherlibdirs'
22743 d_phostname='$d_phostname'
22746 d_portable='$d_portable'
22748 d_prctl_set_name='$d_prctl_set_name'
22749 d_printf_format_null='$d_printf_format_null'
22750 d_procselfexe='$d_procselfexe'
22751 d_pseudofork='$d_pseudofork'
22752 d_pthread_atfork='$d_pthread_atfork'
22753 d_pthread_attr_setscope='$d_pthread_attr_setscope'
22754 d_pthread_yield='$d_pthread_yield'
22756 d_pwchange='$d_pwchange'
22757 d_pwclass='$d_pwclass'
22758 d_pwcomment='$d_pwcomment'
22759 d_pwexpire='$d_pwexpire'
22760 d_pwgecos='$d_pwgecos'
22761 d_pwpasswd='$d_pwpasswd'
22762 d_pwquota='$d_pwquota'
22765 d_random_r='$d_random_r'
22766 d_readdir64_r='$d_readdir64_r'
22767 d_readdir='$d_readdir'
22768 d_readdir_r='$d_readdir_r'
22769 d_readlink='$d_readlink'
22771 d_recvmsg='$d_recvmsg'
22772 d_rename='$d_rename'
22773 d_rewinddir='$d_rewinddir'
22775 d_safebcpy='$d_safebcpy'
22776 d_safemcpy='$d_safemcpy'
22777 d_sanemcmp='$d_sanemcmp'
22778 d_sbrkproto='$d_sbrkproto'
22779 d_scalbnl='$d_scalbnl'
22780 d_sched_yield='$d_sched_yield'
22781 d_scm_rights='$d_scm_rights'
22782 d_seekdir='$d_seekdir'
22783 d_select='$d_select'
22785 d_semctl='$d_semctl'
22786 d_semctl_semid_ds='$d_semctl_semid_ds'
22787 d_semctl_semun='$d_semctl_semun'
22788 d_semget='$d_semget'
22790 d_sendmsg='$d_sendmsg'
22791 d_setegid='$d_setegid'
22792 d_seteuid='$d_seteuid'
22793 d_setgrent='$d_setgrent'
22794 d_setgrent_r='$d_setgrent_r'
22795 d_setgrps='$d_setgrps'
22796 d_sethent='$d_sethent'
22797 d_sethostent_r='$d_sethostent_r'
22798 d_setitimer='$d_setitimer'
22799 d_setlinebuf='$d_setlinebuf'
22800 d_setlocale='$d_setlocale'
22801 d_setlocale_r='$d_setlocale_r'
22802 d_setnent='$d_setnent'
22803 d_setnetent_r='$d_setnetent_r'
22804 d_setpent='$d_setpent'
22805 d_setpgid='$d_setpgid'
22806 d_setpgrp2='$d_setpgrp2'
22807 d_setpgrp='$d_setpgrp'
22808 d_setprior='$d_setprior'
22809 d_setproctitle='$d_setproctitle'
22810 d_setprotoent_r='$d_setprotoent_r'
22811 d_setpwent='$d_setpwent'
22812 d_setpwent_r='$d_setpwent_r'
22813 d_setregid='$d_setregid'
22814 d_setresgid='$d_setresgid'
22815 d_setresuid='$d_setresuid'
22816 d_setreuid='$d_setreuid'
22817 d_setrgid='$d_setrgid'
22818 d_setruid='$d_setruid'
22819 d_setsent='$d_setsent'
22820 d_setservent_r='$d_setservent_r'
22821 d_setsid='$d_setsid'
22822 d_setvbuf='$d_setvbuf'
22826 d_shmatprototype='$d_shmatprototype'
22827 d_shmctl='$d_shmctl'
22829 d_shmget='$d_shmget'
22830 d_sigaction='$d_sigaction'
22831 d_signbit='$d_signbit'
22832 d_sigprocmask='$d_sigprocmask'
22833 d_sigsetjmp='$d_sigsetjmp'
22834 d_sin6_scope_id='$d_sin6_scope_id'
22835 d_sitearch='$d_sitearch'
22836 d_snprintf='$d_snprintf'
22837 d_sockaddr_sa_len='$d_sockaddr_sa_len'
22838 d_sockatmark='$d_sockatmark'
22839 d_sockatmarkproto='$d_sockatmarkproto'
22840 d_socket='$d_socket'
22841 d_socklen_t='$d_socklen_t'
22842 d_sockpair='$d_sockpair'
22843 d_socks5_init='$d_socks5_init'
22844 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
22846 d_srand48_r='$d_srand48_r'
22847 d_srandom_r='$d_srandom_r'
22848 d_sresgproto='$d_sresgproto'
22849 d_sresuproto='$d_sresuproto'
22850 d_statblks='$d_statblks'
22851 d_statfs_f_flags='$d_statfs_f_flags'
22852 d_statfs_s='$d_statfs_s'
22853 d_static_inline='$d_static_inline'
22854 d_statvfs='$d_statvfs'
22855 d_stdio_cnt_lval='$d_stdio_cnt_lval'
22856 d_stdio_ptr_lval='$d_stdio_ptr_lval'
22857 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
22858 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
22859 d_stdio_stream_array='$d_stdio_stream_array'
22860 d_stdiobase='$d_stdiobase'
22861 d_stdstdio='$d_stdstdio'
22862 d_strchr='$d_strchr'
22863 d_strcoll='$d_strcoll'
22864 d_strctcpy='$d_strctcpy'
22865 d_strerrm='$d_strerrm'
22866 d_strerror='$d_strerror'
22867 d_strerror_r='$d_strerror_r'
22868 d_strftime='$d_strftime'
22869 d_strlcat='$d_strlcat'
22870 d_strlcpy='$d_strlcpy'
22871 d_strtod='$d_strtod'
22872 d_strtol='$d_strtol'
22873 d_strtold='$d_strtold'
22874 d_strtoll='$d_strtoll'
22875 d_strtoq='$d_strtoq'
22876 d_strtoul='$d_strtoul'
22877 d_strtoull='$d_strtoull'
22878 d_strtouq='$d_strtouq'
22879 d_strxfrm='$d_strxfrm'
22880 d_suidsafe='$d_suidsafe'
22881 d_symlink='$d_symlink'
22882 d_syscall='$d_syscall'
22883 d_syscallproto='$d_syscallproto'
22884 d_sysconf='$d_sysconf'
22885 d_sysernlst='$d_sysernlst'
22886 d_syserrlst='$d_syserrlst'
22887 d_system='$d_system'
22888 d_tcgetpgrp='$d_tcgetpgrp'
22889 d_tcsetpgrp='$d_tcsetpgrp'
22890 d_telldir='$d_telldir'
22891 d_telldirproto='$d_telldirproto'
22893 d_timegm='$d_timegm'
22895 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
22896 d_tm_tm_zone='$d_tm_tm_zone'
22897 d_tmpnam_r='$d_tmpnam_r'
22898 d_truncate='$d_truncate'
22899 d_ttyname_r='$d_ttyname_r'
22900 d_tzname='$d_tzname'
22901 d_u32align='$d_u32align'
22902 d_ualarm='$d_ualarm'
22905 d_union_semun='$d_union_semun'
22906 d_unordered='$d_unordered'
22907 d_unsetenv='$d_unsetenv'
22908 d_usleep='$d_usleep'
22909 d_usleepproto='$d_usleepproto'
22911 d_vendorarch='$d_vendorarch'
22912 d_vendorbin='$d_vendorbin'
22913 d_vendorlib='$d_vendorlib'
22914 d_vendorscript='$d_vendorscript'
22916 d_void_closedir='$d_void_closedir'
22917 d_voidsig='$d_voidsig'
22918 d_voidtty='$d_voidtty'
22919 d_volatile='$d_volatile'
22920 d_vprintf='$d_vprintf'
22921 d_vsnprintf='$d_vsnprintf'
22923 d_waitpid='$d_waitpid'
22924 d_wcstombs='$d_wcstombs'
22925 d_wctomb='$d_wctomb'
22926 d_writev='$d_writev'
22929 db_hashtype='$db_hashtype'
22930 db_prefixtype='$db_prefixtype'
22931 db_version_major='$db_version_major'
22932 db_version_minor='$db_version_minor'
22933 db_version_patch='$db_version_patch'
22934 defvoidused='$defvoidused'
22935 direntrytype='$direntrytype'
22938 doublesize='$doublesize'
22940 drand48_r_proto='$drand48_r_proto'
22942 dynamic_ext='$dynamic_ext'
22948 endgrent_r_proto='$endgrent_r_proto'
22949 endhostent_r_proto='$endhostent_r_proto'
22950 endnetent_r_proto='$endnetent_r_proto'
22951 endprotoent_r_proto='$endprotoent_r_proto'
22952 endpwent_r_proto='$endpwent_r_proto'
22953 endservent_r_proto='$endservent_r_proto'
22954 eunicefix='$eunicefix'
22957 extensions='$extensions'
22958 extern_C='$extern_C'
22960 fflushNULL='$fflushNULL'
22961 fflushall='$fflushall'
22963 firstmakefile='$firstmakefile'
22965 fpossize='$fpossize'
22966 fpostype='$fpostype'
22967 freetype='$freetype'
22970 full_csh='$full_csh'
22971 full_sed='$full_sed'
22972 gccansipedantic='$gccansipedantic'
22973 gccosandvers='$gccosandvers'
22974 gccversion='$gccversion'
22975 getgrent_r_proto='$getgrent_r_proto'
22976 getgrgid_r_proto='$getgrgid_r_proto'
22977 getgrnam_r_proto='$getgrnam_r_proto'
22978 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
22979 gethostbyname_r_proto='$gethostbyname_r_proto'
22980 gethostent_r_proto='$gethostent_r_proto'
22981 getlogin_r_proto='$getlogin_r_proto'
22982 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
22983 getnetbyname_r_proto='$getnetbyname_r_proto'
22984 getnetent_r_proto='$getnetent_r_proto'
22985 getprotobyname_r_proto='$getprotobyname_r_proto'
22986 getprotobynumber_r_proto='$getprotobynumber_r_proto'
22987 getprotoent_r_proto='$getprotoent_r_proto'
22988 getpwent_r_proto='$getpwent_r_proto'
22989 getpwnam_r_proto='$getpwnam_r_proto'
22990 getpwuid_r_proto='$getpwuid_r_proto'
22991 getservbyname_r_proto='$getservbyname_r_proto'
22992 getservbyport_r_proto='$getservbyport_r_proto'
22993 getservent_r_proto='$getservent_r_proto'
22994 getspnam_r_proto='$getspnam_r_proto'
22995 gidformat='$gidformat'
23001 gmtime_r_proto='$gmtime_r_proto'
23002 gnulibc_version='$gnulibc_version'
23004 groupcat='$groupcat'
23005 groupstype='$groupstype'
23008 h_sysfile='$h_sysfile'
23011 html1dir='$html1dir'
23012 html1direxp='$html1direxp'
23013 html3dir='$html3dir'
23014 html3direxp='$html3direxp'
23023 i_arpainet='$i_arpainet'
23024 i_assert='$i_assert'
23025 i_bsdioctl='$i_bsdioctl'
23029 i_dirent='$i_dirent'
23035 i_fp_class='$i_fp_class'
23037 i_gdbm_ndbm='$i_gdbm_ndbm'
23038 i_gdbmndbm='$i_gdbmndbm'
23040 i_ieeefp='$i_ieeefp'
23041 i_inttypes='$i_inttypes'
23042 i_langinfo='$i_langinfo'
23043 i_libutil='$i_libutil'
23044 i_limits='$i_limits'
23045 i_locale='$i_locale'
23046 i_machcthr='$i_machcthr'
23047 i_malloc='$i_malloc'
23048 i_mallocmalloc='$i_mallocmalloc'
23050 i_memory='$i_memory'
23051 i_mntent='$i_mntent'
23054 i_neterrno='$i_neterrno'
23055 i_netinettcp='$i_netinettcp'
23059 i_pthread='$i_pthread'
23061 i_rpcsvcdbm='$i_rpcsvcdbm'
23064 i_shadow='$i_shadow'
23066 i_stdarg='$i_stdarg'
23067 i_stddef='$i_stddef'
23068 i_stdlib='$i_stdlib'
23069 i_string='$i_string'
23070 i_sunmath='$i_sunmath'
23071 i_sysaccess='$i_sysaccess'
23072 i_sysdir='$i_sysdir'
23073 i_sysfile='$i_sysfile'
23074 i_sysfilio='$i_sysfilio'
23076 i_sysioctl='$i_sysioctl'
23077 i_syslog='$i_syslog'
23078 i_sysmman='$i_sysmman'
23079 i_sysmode='$i_sysmode'
23080 i_sysmount='$i_sysmount'
23081 i_sysndir='$i_sysndir'
23082 i_sysparam='$i_sysparam'
23083 i_syspoll='$i_syspoll'
23084 i_sysresrc='$i_sysresrc'
23085 i_syssecrt='$i_syssecrt'
23086 i_sysselct='$i_sysselct'
23087 i_syssockio='$i_syssockio'
23088 i_sysstat='$i_sysstat'
23089 i_sysstatfs='$i_sysstatfs'
23090 i_sysstatvfs='$i_sysstatvfs'
23091 i_systime='$i_systime'
23092 i_systimek='$i_systimek'
23093 i_systimes='$i_systimes'
23094 i_systypes='$i_systypes'
23095 i_sysuio='$i_sysuio'
23097 i_sysutsname='$i_sysutsname'
23098 i_sysvfs='$i_sysvfs'
23099 i_syswait='$i_syswait'
23100 i_termio='$i_termio'
23101 i_termios='$i_termios'
23103 i_unistd='$i_unistd'
23106 i_values='$i_values'
23107 i_varargs='$i_varargs'
23108 i_varhdr='$i_varhdr'
23110 ignore_versioned_solibs='$ignore_versioned_solibs'
23111 inc_version_list='$inc_version_list'
23112 inc_version_list_init='$inc_version_list_init'
23115 initialinstalllocation='$initialinstalllocation'
23116 installarchlib='$installarchlib'
23117 installbin='$installbin'
23118 installhtml1dir='$installhtml1dir'
23119 installhtml3dir='$installhtml3dir'
23120 installman1dir='$installman1dir'
23121 installman3dir='$installman3dir'
23122 installprefix='$installprefix'
23123 installprefixexp='$installprefixexp'
23124 installprivlib='$installprivlib'
23125 installscript='$installscript'
23126 installsitearch='$installsitearch'
23127 installsitebin='$installsitebin'
23128 installsitehtml1dir='$installsitehtml1dir'
23129 installsitehtml3dir='$installsitehtml3dir'
23130 installsitelib='$installsitelib'
23131 installsiteman1dir='$installsiteman1dir'
23132 installsiteman3dir='$installsiteman3dir'
23133 installsitescript='$installsitescript'
23134 installstyle='$installstyle'
23135 installusrbinperl='$installusrbinperl'
23136 installvendorarch='$installvendorarch'
23137 installvendorbin='$installvendorbin'
23138 installvendorhtml1dir='$installvendorhtml1dir'
23139 installvendorhtml3dir='$installvendorhtml3dir'
23140 installvendorlib='$installvendorlib'
23141 installvendorman1dir='$installvendorman1dir'
23142 installvendorman3dir='$installvendorman3dir'
23143 installvendorscript='$installvendorscript'
23145 issymlink='$issymlink'
23146 ivdformat='$ivdformat'
23149 known_extensions='$known_extensions'
23152 lddlflags='$lddlflags'
23154 ldflags_uselargefiles='$ldflags_uselargefiles'
23155 ldlibpthname='$ldlibpthname'
23162 libsdirs='$libsdirs'
23163 libsfiles='$libsfiles'
23164 libsfound='$libsfound'
23165 libspath='$libspath'
23166 libswanted='$libswanted'
23167 libswanted_uselargefiles='$libswanted_uselargefiles'
23173 localtime_r_proto='$localtime_r_proto'
23174 locincpth='$locincpth'
23175 loclibpth='$loclibpth'
23176 longdblsize='$longdblsize'
23177 longlongsize='$longlongsize'
23178 longsize='$longsize'
23182 lseeksize='$lseeksize'
23183 lseektype='$lseektype'
23186 madlyobj='$madlyobj'
23187 madlysrc='$madlysrc'
23191 make_set_make='$make_set_make'
23192 mallocobj='$mallocobj'
23193 mallocsrc='$mallocsrc'
23194 malloctype='$malloctype'
23196 man1direxp='$man1direxp'
23199 man3direxp='$man3direxp'
23201 mips_type='$mips_type'
23202 mistrustnm='$mistrustnm'
23204 mmaptype='$mmaptype'
23205 modetype='$modetype'
23207 multiarch='$multiarch'
23209 myarchname='$myarchname'
23210 mydomain='$mydomain'
23211 myhostname='$myhostname'
23214 need_va_copy='$need_va_copy'
23215 netdb_hlen_type='$netdb_hlen_type'
23216 netdb_host_type='$netdb_host_type'
23217 netdb_name_type='$netdb_name_type'
23218 netdb_net_type='$netdb_net_type'
23221 nm_so_opt='$nm_so_opt'
23222 nonxs_ext='$nonxs_ext'
23224 nvEUformat='$nvEUformat'
23225 nvFUformat='$nvFUformat'
23226 nvGUformat='$nvGUformat'
23227 nv_overflows_integers_at='$nv_overflows_integers_at'
23228 nv_preserves_uv_bits='$nv_preserves_uv_bits'
23229 nveformat='$nveformat'
23230 nvfformat='$nvfformat'
23231 nvgformat='$nvgformat'
23234 o_nonblock='$o_nonblock'
23236 old_pthread_create_joinable='$old_pthread_create_joinable'
23237 optimize='$optimize'
23238 orderlib='$orderlib'
23241 otherlibdirs='$otherlibdirs'
23245 patchlevel='$patchlevel'
23246 path_sep='$path_sep'
23249 perl_patchlevel='$perl_patchlevel'
23250 perl_static_inline='$perl_static_inline'
23251 perladmin='$perladmin'
23252 perllibs='$perllibs'
23253 perlpath='$perlpath'
23255 phostname='$phostname'
23261 prefixexp='$prefixexp'
23263 privlibexp='$privlibexp'
23264 procselfexe='$procselfexe'
23265 prototype='$prototype'
23267 quadkind='$quadkind'
23268 quadtype='$quadtype'
23269 randbits='$randbits'
23270 randfunc='$randfunc'
23271 random_r_proto='$random_r_proto'
23272 randseedtype='$randseedtype'
23274 rd_nodata='$rd_nodata'
23275 readdir64_r_proto='$readdir64_r_proto'
23276 readdir_r_proto='$readdir_r_proto'
23277 revision='$revision'
23283 sGMTIME_max='$sGMTIME_max'
23284 sGMTIME_min='$sGMTIME_min'
23285 sLOCALTIME_max='$sLOCALTIME_max'
23286 sLOCALTIME_min='$sLOCALTIME_min'
23287 sPRIEUldbl='$sPRIEUldbl'
23288 sPRIFUldbl='$sPRIFUldbl'
23289 sPRIGUldbl='$sPRIGUldbl'
23290 sPRIXU64='$sPRIXU64'
23292 sPRIeldbl='$sPRIeldbl'
23293 sPRIfldbl='$sPRIfldbl'
23294 sPRIgldbl='$sPRIgldbl'
23299 sSCNfldbl='$sSCNfldbl'
23300 sched_yield='$sched_yield'
23301 scriptdir='$scriptdir'
23302 scriptdirexp='$scriptdirexp'
23304 seedfunc='$seedfunc'
23305 selectminbits='$selectminbits'
23306 selecttype='$selecttype'
23307 sendmail='$sendmail'
23308 setgrent_r_proto='$setgrent_r_proto'
23309 sethostent_r_proto='$sethostent_r_proto'
23310 setlocale_r_proto='$setlocale_r_proto'
23311 setnetent_r_proto='$setnetent_r_proto'
23312 setprotoent_r_proto='$setprotoent_r_proto'
23313 setpwent_r_proto='$setpwent_r_proto'
23314 setservent_r_proto='$setservent_r_proto'
23317 sharpbang='$sharpbang'
23318 shmattype='$shmattype'
23319 shortsize='$shortsize'
23322 sig_count='$sig_count'
23323 sig_name='$sig_name'
23324 sig_name_init='$sig_name_init'
23326 sig_num_init='$sig_num_init'
23327 sig_size='$sig_size'
23328 signal_t='$signal_t'
23329 sitearch='$sitearch'
23330 sitearchexp='$sitearchexp'
23332 sitebinexp='$sitebinexp'
23333 sitehtml1dir='$sitehtml1dir'
23334 sitehtml1direxp='$sitehtml1direxp'
23335 sitehtml3dir='$sitehtml3dir'
23336 sitehtml3direxp='$sitehtml3direxp'
23338 sitelib_stem='$sitelib_stem'
23339 sitelibexp='$sitelibexp'
23340 siteman1dir='$siteman1dir'
23341 siteman1direxp='$siteman1direxp'
23342 siteman3dir='$siteman3dir'
23343 siteman3direxp='$siteman3direxp'
23344 siteprefix='$siteprefix'
23345 siteprefixexp='$siteprefixexp'
23346 sitescript='$sitescript'
23347 sitescriptexp='$sitescriptexp'
23348 sizesize='$sizesize'
23349 sizetype='$sizetype'
23353 sockethdr='$sockethdr'
23354 socketlib='$socketlib'
23355 socksizetype='$socksizetype'
23357 spackage='$spackage'
23358 spitshell='$spitshell'
23359 srand48_r_proto='$srand48_r_proto'
23360 srandom_r_proto='$srandom_r_proto'
23362 ssizetype='$ssizetype'
23363 startperl='$startperl'
23365 static_ext='$static_ext'
23367 stdio_base='$stdio_base'
23368 stdio_bufsiz='$stdio_bufsiz'
23369 stdio_cnt='$stdio_cnt'
23370 stdio_filbuf='$stdio_filbuf'
23371 stdio_ptr='$stdio_ptr'
23372 stdio_stream_array='$stdio_stream_array'
23373 strerror_r_proto='$strerror_r_proto'
23376 subversion='$subversion'
23380 targetarch='$targetarch'
23384 timeincl='$timeincl'
23385 timetype='$timetype'
23386 tmpnam_r_proto='$tmpnam_r_proto'
23392 ttyname_r_proto='$ttyname_r_proto'
23401 uidformat='$uidformat'
23407 uquadtype='$uquadtype'
23408 use5005threads='$use5005threads'
23409 use64bitall='$use64bitall'
23410 use64bitint='$use64bitint'
23411 usecrosscompile='$usecrosscompile'
23412 usedevel='$usedevel'
23414 usedtrace='$usedtrace'
23415 usefaststdio='$usefaststdio'
23416 useithreads='$useithreads'
23417 uselargefiles='$uselargefiles'
23418 uselongdouble='$uselongdouble'
23419 usemallocwrap='$usemallocwrap'
23420 usemorebits='$usemorebits'
23421 usemultiplicity='$usemultiplicity'
23422 usemymalloc='$usemymalloc'
23424 useopcode='$useopcode'
23425 useperlio='$useperlio'
23426 useposix='$useposix'
23427 usereentrant='$usereentrant'
23428 userelocatableinc='$userelocatableinc'
23430 useshrplib='$useshrplib'
23431 usesitecustomize='$usesitecustomize'
23432 usesocks='$usesocks'
23433 usethreads='$usethreads'
23434 usevendorprefix='$usevendorprefix'
23435 usevfork='$usevfork'
23438 uvXUformat='$uvXUformat'
23439 uvoformat='$uvoformat'
23442 uvuformat='$uvuformat'
23443 uvxformat='$uvxformat'
23445 vendorarch='$vendorarch'
23446 vendorarchexp='$vendorarchexp'
23447 vendorbin='$vendorbin'
23448 vendorbinexp='$vendorbinexp'
23449 vendorhtml1dir='$vendorhtml1dir'
23450 vendorhtml1direxp='$vendorhtml1direxp'
23451 vendorhtml3dir='$vendorhtml3dir'
23452 vendorhtml3direxp='$vendorhtml3direxp'
23453 vendorlib='$vendorlib'
23454 vendorlib_stem='$vendorlib_stem'
23455 vendorlibexp='$vendorlibexp'
23456 vendorman1dir='$vendorman1dir'
23457 vendorman1direxp='$vendorman1direxp'
23458 vendorman3dir='$vendorman3dir'
23459 vendorman3direxp='$vendorman3direxp'
23460 vendorprefix='$vendorprefix'
23461 vendorprefixexp='$vendorprefixexp'
23462 vendorscript='$vendorscript'
23463 vendorscriptexp='$vendorscriptexp'
23465 version_patchlevel_string='$version_patchlevel_string'
23466 versiononly='$versiononly'
23468 voidflags='$voidflags'
23471 yaccflags='$yaccflags'
23476 : add special variables
23477 $test -f $src/patchlevel.h && \
23478 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
23479 echo "PERL_PATCHLEVEL='$perl_patchlevel'" >>config.sh
23480 echo "PERL_CONFIG_SH=true" >>config.sh
23482 : propagate old symbols
23483 if $test -f UU/config.sh; then
23484 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
23485 $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \
23486 config.sh config.sh UU/oldconfig.sh |\
23487 $sort | $uniq -u >UU/oldsyms
23488 set X `cat UU/oldsyms`
23494 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
23496 echo ": Variables propagated from previous config.sh file." >>config.sh
23497 for sym in `cat UU/oldsyms`; do
23498 echo " Propagating $hint variable "'$'"$sym..."
23499 eval 'tmp="$'"${sym}"'"'
23501 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
23507 : Finish up by extracting the .SH files
23511 echo "Extraction done."
23521 If you'd like to make any changes to the config.sh file before I begin
23522 to configure things, do it as a shell escape now (e.g. !vi config.sh).
23525 rp="Press return or use a shell escape to edit config.sh:"
23530 *) : in case they cannot read
23531 sh 1>&4 -c "$ans";;
23536 : if this fails, just run all the .SH files by hand
23545 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
23552 Now you need to generate make dependencies by running "$make depend".
23553 You might prefer to run it in background: "$make depend > makedepend.out &"
23554 It can take a while, so you might not want to run it right now.
23559 rp="Run $make depend now?"
23563 $make depend && echo "Now you must run '$make'."
23566 echo "You must run '$make depend' then '$make'."
23569 elif test -f [Mm]akefile; then
23571 echo "Now you must run a $make."
23573 echo "Configure done."
23576 if $test -f Policy.sh; then
23579 If you compile $package on a different machine or from a different object
23580 directory, copy the Policy.sh file from this object directory to the
23581 new one before you run Configure -- this will help you with most of
23582 the policy defaults.
23586 if $test -f config.msg; then
23587 echo "Hmm. I also noted the following information while running:"
23589 $cat config.msg >&4
23592 $rm -f kit*isdone ark*isdone