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
20 # Though this script was generated by metaconfig, it is OK to send
21 # patches against it. It's up to the Configure pumpkin to backport
22 # the patch to the metaunits if it is accepted.
23 # See Porting/pumpkin.pod for more information on metaconfig.
26 # $Id: Head.U 6 2006-08-25 22:21:46Z rmanfredi $
28 # Generated on Thu Jun 4 09:30:45 CEST 2009 [metaconfig 3.5 PL0]
29 # (with additional metaconfig patches by perlbug@perl.org)
34 SCO csh still thinks true is false. Write to SCO today and tell them that next
35 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
37 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
38 we'd have to do is go in and swap the && and || tokens, wherever they are.)
40 [End of diatribe. We now return you to your regularly scheduled programming...]
44 OOPS! You naughty creature! You didn't run Configure with sh!
45 I will attempt to remedy the situation by running sh for you...
49 true || exec sh $0 $argv:q
51 (exit $?0) || cat c2$$
52 (exit $?0) || exec sh $0 $argv:q
55 if test -f /dev/cputype -a -f /dev/drivers -a -f /dev/osversion; then
58 *** I'm sorry but this system looks like Plan 9 and Plan 9 doesn't do
59 *** Configure that well. (Plan 9 is close to UNIX but not close enough.)
60 *** Please read the README.plan9 for further instructions.
61 *** Cannot continue, aborting.
67 if test ! -c /dev/null ; then
70 *** I'm sorry, but /dev/null appears to be a file rather than a device.
71 *** Please consult your operating sytem's notes for making a device
73 *** Cannot continue, aborting.
79 : compute my invocation name
83 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
88 : Proper separator for the PATH environment variable
90 : On OS/2 this directory should exist if this is not floppy only system ":-]"
91 if test -d c:/. || ( uname -a | grep -i 'os\(/\|\)2' ) 2>&1 >/dev/null ; then
92 if test -n "$OS2_SHELL"; then
94 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
95 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
97 elif test -n "$DJGPP"; then
98 case "X${MACHTYPE:-nonesuchmach}" in
105 : Proper PATH setting
106 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
107 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
108 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
109 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
110 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
111 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /opt/ansic/bin /usr/ccs/bin"
112 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
113 paths="$paths /sbin /usr/sbin /usr/libexec"
114 paths="$paths /system/gnu_library/bin"
118 case "$p_$PATH$p_" in
120 *) test -d $p && PATH=$PATH$p_$p ;;
127 : shall we be using ksh?
133 if (PATH=.; alias -x) >/dev/null 2>&1; then
136 if test -f /hp-ux -a -f /bin/ksh; then
137 needksh='to avoid sh bug in "here document" expansion'
139 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
140 if test X`/usr/bin/uname -v` = X4; then
141 avoidksh="to avoid AIX 4's /bin/sh"
145 if test -f /osf_boot -a -f /usr/sbin/setld; then
146 if test X`/usr/bin/uname -s` = XOSF1; then
147 avoidksh="to avoid Digital UNIX' ksh"
152 case "$inksh/$needksh" in
159 case "$inksh/$avoidksh" in
165 case "$inksh/$needksh-$avoidksh-" in
168 (I see you are using the Korn shell. Some ksh's blow up on $me,
169 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
176 echo "(Feeding myself to $newsh $reason.)"
178 Configure|*/Configure) exec $newsh $0 "$@";;
179 *) exec $newsh Configure "$@";;
183 test -x "${newsh}" || unset newsh
185 : if needed, set CDPATH to a harmless value that is not chatty
186 : avoid bash 2.02 problems with empty CDPATH.
190 *bash*) CDPATH='.' ;;
196 : Configure runs within the UU subdirectory
197 test -d UU || mkdir UU
337 initialinstalllocation=''
364 d_attribute_deprecated=''
365 d_attribute_format=''
366 d_attribute_malloc=''
367 d_attribute_nonnull=''
368 d_attribute_noreturn=''
370 d_attribute_unused=''
371 d_attribute_warn_unused_result=''
372 d_printf_format_null=''
375 d_builtin_choose_expr=''
378 d_c99_variadic_macros=''
425 endhostent_r_proto=''
431 endprotoent_r_proto=''
437 endservent_r_proto=''
490 gethostbyaddr_r_proto=''
492 gethostbyname_r_proto=''
494 gethostent_r_proto=''
507 getnetbyaddr_r_proto=''
509 getnetbyname_r_proto=''
523 d_getprotobyname_r=''
524 getprotobyname_r_proto=''
525 d_getprotobynumber_r=''
526 getprotobynumber_r_proto=''
528 getprotoent_r_proto=''
540 getservbyname_r_proto=''
542 getservbyport_r_proto=''
544 getservent_r_proto=''
570 d_libm_lib_version=''
573 d_localtime_r_needs_tzset=''
584 d_malloc_good_size=''
626 d_old_pthread_create_joinable=''
627 old_pthread_create_joinable=''
629 d_pthread_attr_setscope=''
668 sethostent_r_proto=''
685 setprotoent_r_proto=''
697 setservent_r_proto=''
731 d_sprintf_returns_strlen=''
746 d_stdio_ptr_lval_nochange_cnt=''
747 d_stdio_ptr_lval_sets_cnt=''
891 d_gdbm_ndbm_h_uses_prototypes=''
892 d_gdbmndbm_h_uses_prototypes=''
894 d_ndbm_h_uses_prototypes=''
968 d_inc_version_list=''
970 inc_version_list_init=''
989 ignore_versioned_solibs=''
1053 d_perl_otherlibdirs=''
1061 api_versionstring=''
1067 version_patchlevel_string=''
1071 d_nv_preserves_uv=''
1072 d_nv_zero_is_allbits_zero=''
1083 nv_overflows_integers_at=''
1084 nv_preserves_uv_bits=''
1156 installsitehtml1dir=''
1159 installsitehtml3dir=''
1166 installsiteman1dir=''
1169 installsiteman3dir=''
1174 installsitescript=''
1189 d_stdio_stream_array=''
1190 stdio_stream_array=''
1207 ccflags_uselargefiles=''
1208 ldflags_uselargefiles=''
1209 libswanted_uselargefiles=''
1229 installvendorarch=''
1236 installvendorhtml1dir=''
1238 vendorhtml1direxp=''
1239 installvendorhtml3dir=''
1241 vendorhtml3direxp=''
1247 installvendorman1dir=''
1250 installvendorman3dir=''
1257 installvendorscript=''
1270 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1273 : We must find out about Eunice early
1275 if test -f /etc/unixtovms; then
1276 eunicefix=/etc/unixtovms
1278 if test -f /etc/unixtovms.exe; then
1279 eunicefix=/etc/unixtovms.exe
1282 : Set executable suffix now -- needed before hints available
1283 if test -f "/libs/version.library"; then
1286 elif test -f "/system/gnu_library/bin/ar.pm"; then
1289 elif test -n "$DJGPP"; then
1292 elif test -d c:/. -o -n "$is_os2" ; then
1299 : Trailing extension. Override this in a hint file, if needed.
1300 : Extra object files, if any, needed on this platform.
1304 : change the next line if compiling for Xenix/286 on Xenix/386
1305 xlibpth='/usr/lib/386 /lib/386'
1306 : Possible local library directories to search.
1307 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1308 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1310 : general looking path for locating libraries
1311 glibpth="/lib /usr/lib $xlibpth"
1312 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1313 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1314 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1315 test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
1317 : Private path used by Configure to find libraries. Its value
1318 : is prepended to libpth. This variable takes care of special
1319 : machines, like the mips. Usually, it should be empty.
1322 : default library list
1324 : some systems want to use only the non-versioned libso:s
1325 ignore_versioned_solibs=''
1326 : set usethreads on the Configure command line to enable threads.
1327 usereentrant='undef'
1328 : full support for void wanted by default
1331 : Possible local include directories to search.
1332 : Set locincpth to "" in a hint file to defeat local include searches.
1333 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1334 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1336 : no include file wanted by default
1339 : Enable -DEBUGGING and -DDEBUGGING from the command line
1346 : set useposix=false in your hint file to disable the POSIX extension.
1348 : set useopcode=false in your hint file to disable the Opcode extension.
1351 ccflags_uselargefiles=''
1352 ldflags_uselargefiles=''
1353 libswanted_uselargefiles=''
1354 : set usemultiplicity on the Configure command line to enable multiplicity.
1355 : set usesocks on the Configure command line to enable socks.
1356 : List of libraries we want.
1357 : If anyone needs extra -lxxx, put those in a hint file.
1358 libswanted="sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun"
1359 libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
1360 : We probably want to search /usr/shlib before most other libraries.
1361 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1362 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1363 glibpth="/usr/shlib $glibpth"
1364 : Do not use vfork unless overridden by a hint file.
1367 : Find the basic shell for Bourne shell scripts
1371 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1374 if test -f "$xxx"; then
1377 : Build up a list and do a single loop so we can 'break' out.
1378 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1379 for xxx in sh bash ksh pdksh ash; do
1381 try="$try ${p}/${xxx}"
1385 if test -f "$xxx"; then
1388 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1391 elif test -f "$xxx.exe"; then
1402 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1404 Usually it's in /bin/sh. How did you even get this far?
1405 Please contact me (Perl Maintainers) at perlbug@perl.org and
1406 we'll try to straighten this all out.
1412 : see if sh knows # comments
1413 if `$sh -c '#' >/dev/null 2>&1`; then
1417 test -f $xcat$_exe || xcat=/usr/bin/cat
1418 if test ! -f $xcat$_exe; then
1419 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1420 if test -f $p/cat$_exe; then
1425 if test ! -f $xcat$_exe; then
1426 echo "Can't find cat anywhere!"
1430 echo "#!$xcat" >sharp
1433 ./sharp > today 2>/dev/null
1434 if test -s today; then
1437 echo "#! $xcat" > sharp
1440 ./sharp > today 2>/dev/null
1441 if test -s today; then
1449 echo "Your $sh doesn't grok # comments--I will strip them later on."
1452 echo "exec grep -v '^[ ]*#'" >spitshell
1454 $eunicefix spitshell
1455 spitshell=`pwd`/spitshell
1457 echo "I presume that if # doesn't work, #! won't work either!"
1462 : figure out how to guarantee sh startup
1464 '') startsh=${sharpbang}${sh} ;;
1476 : echo "Yup, it does."
1478 echo "Hmm... '$startsh' does not guarantee sh startup..."
1479 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1483 : Save command line options in file UU/cmdline.opt for later use in
1484 : generating config.sh.
1485 cat > cmdline.opt <<EOSH
1486 : Configure command line arguments.
1495 cat >>cmdline.opt <<EOSH
1496 config_arg$argn='$arg'
1498 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1501 arg_exp=`cat cmdl.opt`
1502 args_exp="$args_exp$args_sep'$arg_exp'"
1503 argn=`expr $argn + 1`
1508 : produce awk script to parse command line options
1509 cat >options.awk <<'EOF'
1511 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1513 len = length(optstr);
1514 for (i = 1; i <= len; i++) {
1515 c = substr(optstr, i, 1);
1516 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1527 if (substr(str, 1, 1) != "-") {
1528 printf("'%s'\n", str);
1532 for (i = 2; i <= len; i++) {
1533 c = substr(str, i, 1);
1535 printf("-%s\n", substr(str, i));
1541 printf("'%s'\n", substr(str, i + 1));
1554 : process the command line options
1555 set X `for arg in "$@"; do echo "X$arg"; done |
1556 sed -e s/X// | awk -f options.awk`
1561 : set up default values
1571 rm -f optdef.sh posthint.sh
1572 cat >optdef.sh <<EOS
1578 while test $# -gt 0; do
1580 -d) shift; fastread=yes;;
1581 -e) shift; alldone=cont;;
1585 if test -r "$1"; then
1588 echo "$me: cannot read config file $1." >&2
1594 -h) shift; error=true;;
1595 -r) shift; reuseval=true;;
1596 -s) shift; silent=true; realsilent=true;;
1597 -E) shift; alldone=exit;;
1598 -K) shift; knowitall=true;;
1599 -O) shift; override=true;;
1600 -S) shift; silent=true; extractsh=true;;
1605 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1606 echo "$me: ignoring -D $1" >&2
1609 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1610 *) echo "$1='define'" >> optdef.sh;;
1617 *=) echo "$1" >> optdef.sh;;
1619 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1620 echo "$me: ignoring -U $1" >&2
1622 *) echo "$1='undef'" >> optdef.sh;;
1633 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1637 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1638 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1644 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1645 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1646 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1647 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1648 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1649 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1655 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1657 echo "$yyy=''" >> posthint.sh ;;
1662 echo "$yyy='$zzz'" >> posthint.sh ;;
1664 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1666 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1671 echo "$yyy=$zzz" >> posthint.sh ;;
1672 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1676 -V) echo "$me generated by metaconfig 3.5 PL0." >&2
1679 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1687 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1688 [-U symbol] [-U symbol=] [-A command:symbol...]
1689 -d : use defaults for all answers.
1690 -e : go on without questioning past the production of config.sh.
1691 -f : specify an alternate default configuration file.
1692 -h : print this help message and exit (with an error status).
1693 -r : reuse C symbols value if possible (skips costly nm extraction).
1694 -s : silent mode, only echoes questions and essential information.
1695 -D : define symbol to have some value:
1696 -D symbol symbol gets the value 'define'
1697 -D symbol=value symbol gets the value 'value'
1698 common used examples (see INSTALL for more info):
1699 -Duse64bitint use 64bit integers
1700 -Duse64bitall use 64bit integers and pointers
1701 -Dusethreads use thread support
1702 -Dinc_version_list=none do not include older perl trees in @INC
1703 -DEBUGGING=none DEBUGGING options
1704 -Dcc=gcc choose your compiler
1705 -Dprefix=/opt/perl5 choose your destination
1706 -E : stop at the end of questions, after having produced config.sh.
1707 -K : do not use unless you know what you are doing.
1708 -O : let -D and -U override definitions from loaded configuration file.
1709 -S : perform variable substitutions on all .SH files (can mix with -f)
1710 -U : undefine symbol:
1711 -U symbol symbol gets the value 'undef'
1712 -U symbol= symbol gets completely empty
1714 -A : manipulate symbol after the platform specific hints have been applied:
1715 -A append:symbol=value append value to symbol
1716 -A symbol=value like append:, but with a separating space
1717 -A define:symbol=value define symbol to have value
1718 -A clear:symbol define symbol to be ''
1719 -A define:symbol define symbol to be 'define'
1720 -A eval:symbol=value define symbol to be eval of value
1721 -A prepend:symbol=value prepend value to symbol
1722 -A undef:symbol define symbol to be 'undef'
1723 -A undef:symbol= define symbol to be ''
1724 e.g.: -A prepend:libswanted='cl pthread '
1725 -A ccflags=-DSOME_MACRO
1726 -V : print version number and exit (with a zero status).
1733 case "$fastread$alldone" in
1736 case "$extractsh" in
1739 if test ! -t 0; then
1740 echo "Say 'sh Configure', not 'sh <Configure'"
1750 true) exec 1>/dev/null;;
1753 : run the defines and the undefines, if any, but leave the file out there...
1756 : create the posthint manipulation script and leave the file out there...
1761 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1762 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1763 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1764 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1765 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1768 : Some greps do not return status, grrr.
1769 echo "grimblepritz" >grimble
1770 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1772 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1778 : the following should work in any shell
1782 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1783 cat >contains <<'EOSS'
1784 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1789 : Find the path to the source tree
1792 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1796 *) src=`cd ../$src && pwd` ;;
1809 if test -f $rsrc/Configure && \
1810 $contains "^package='$package'\$" $rsrc/Configure >/dev/null 2>&1
1812 : found it, so we are ok.
1815 for src in . .. ../.. ../../.. ../../../..; do
1816 if test -f ../$src/Configure && \
1817 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1828 Sorry, I can't seem to locate the source dir for $package. Please start
1829 Configure with an explicit path -- i.e. /some/path/Configure.
1837 echo "Sources for $package found in \"$src\"." >&4
1841 : script used to extract .SH files with variable substitutions
1842 cat >extract <<'EOS'
1844 echo "Doing variable substitutions on .SH files..."
1845 if test -f MANIFEST; then
1846 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1848 echo "(Looking for .SH files under the source directory.)"
1849 set x `(cd "$src"; find . -name "*.SH" -print)`
1853 0) set x `(cd "$src"; echo *.SH)`; shift;;
1855 if test ! -f "$src/$1"; then
1861 while test $name; do
1862 if test ! -d "$name"; then
1863 create="$name $create";
1864 name=`echo $name | sed -e "s|^[^/]*$||"`;
1865 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1870 for file in $create; do
1879 dir=`expr X$file : 'X\(.*\)/'`
1880 file=`expr X$file : 'X.*/\(.*\)'`
1881 (cd "$dir" && . ./$file)
1891 dir=`expr X$file : 'X\(.*\)/'`
1892 file=`expr X$file : 'X.*/\(.*\)'`
1893 (set x $dir; shift; eval $mkdir_p)
1894 sh <"$src/$dir/$file"
1903 if test -f "$src/config_h.SH"; then
1904 if test ! -f config.h; then
1905 : oops, they left it out of MANIFEST, probably, so do it anyway.
1906 . "$src/config_h.SH"
1911 : extract files and exit if asked to do so
1912 case "$extractsh" in
1914 case "$realsilent" in
1918 case "$config_sh" in
1919 '') config_sh='config.sh';;
1922 echo "Fetching answers from $config_sh..."
1925 test "$override" && . ./optdef.sh
1929 echo "Extraction done."
1934 : Eunice requires " " instead of "", can you believe it
1937 echo "Beginning of configuration questions for $package."
1939 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1941 : first determine how to suppress newline on echo command
1943 echo "Checking echo to see how to suppress newlines..."
1944 (echo "hi there\c" ; echo " ") >.echotmp
1945 if $contains c .echotmp >/dev/null 2>&1 ; then
1956 echo $n "The star should be here-->$c"
1960 : Now test for existence of everything in MANIFEST
1962 if test -f "$rsrc/MANIFEST"; then
1963 echo "First let's make sure your kit is complete. Checking..." >&4
1964 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | \
1965 (split -l 50 2>/dev/null || split -50)
1968 for filelist in x??; do
1969 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` \
1970 >/dev/null 2>>"$tmppwd/missing")
1972 if test -s missing; then
1976 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1978 You have the option of continuing the configuration process, despite the
1979 distinct possibility that your kit is damaged, by typing 'y'es. If you
1980 do, don't blame me if something goes wrong. I advise you to type 'n'o
1981 and contact the author (perlbug@perl.org).
1984 echo $n "Continue? [n] $c" >&4
1988 echo "Continuing..." >&4
1992 echo "ABORTING..." >&4
1997 echo "Looks good..."
2000 echo "There is no MANIFEST file. I hope your kit is complete !"
2004 : Find the appropriate value for a newline for tr
2006 if test -n "$DJGPP"; then
2009 if test X"$trnl" = X; then
2010 case "`echo foo|tr '\n' x 2>/dev/null`" in
2014 if test X"$trnl" = X; then
2015 case "`echo foo|tr '\012' x 2>/dev/null`" in
2016 foox) trnl='\012' ;;
2019 if test X"$trnl" = X; then
2020 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
2021 fooxy) trnl='\n\r' ;;
2024 if test X"$trnl" = X; then
2027 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
2033 : compute the number of columns on the terminal for proper question formatting
2038 : set up the echo used in my read
2039 myecho="case \"\$xxxm\" in
2040 '') echo $n \"\$rp $c\" >&4;;
2042 '') echo $n \"[\$xxxm] $c\";;
2044 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
2046 echo $n \"[\$xxxm] $c\" >&4
2048 echo $n \"\$rp [\$xxxm] $c\" >&4
2054 : now set up to do reads with possible shell escape and default assignment
2060 case "\$fastread" in
2061 yes) case "\$dflt" in
2064 case "\$silent-\$rp" in
2069 *) case "\$silent" in
2070 true) case "\$rp" in
2075 while expr "X\$ans" : "X!" >/dev/null; do
2079 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2087 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2096 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2101 echo "(OK, I'll run with -d after this question.)" >&4
2104 echo "*** Sorry, \$1 not supported yet." >&4
2114 echo "*** Substitution done -- please confirm."
2116 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2121 echo "*** Error -- try again."
2128 case "\$ans\$xxxm\$nostick" in
2140 : create .config dir to save info across Configure sessions
2141 test -d ../.config || mkdir ../.config
2142 cat >../.config/README <<EOF
2143 This directory created by Configure to save information that should
2144 persist across sessions for $package.
2146 You may safely delete it if you wish.
2149 : See if we are using a devel version and want that
2150 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2153 usedevel="$define" ;;
2154 *) case "$xversion" in
2157 *** WHOA THERE!!! ***
2159 This is an UNSTABLE DEVELOPMENT release.
2160 The version of this $package distribution is $xversion, that is, odd,
2161 (as opposed to even) and that signifies a development release.
2162 If you want a maintenance release, you want an even-numbered version.
2164 Do ***NOT*** install this into production use.
2165 Data corruption and crashes are possible.
2167 It is most seriously suggested that you do not continue any further
2168 unless you want to help in developing and debugging Perl.
2170 If you *still* want to build perl, you can answer 'y' now,
2171 or pass -Dusedevel to Configure.
2174 rp='Do you really want to continue?'
2178 [yY]) echo >&4 "Okay, continuing."
2179 usedevel="$define" ;;
2180 *) echo >&4 "Okay, bye."
2191 case "$versiononly" in
2192 '') versiononly="$define" ;;
2194 case "$installusrbinperl" in
2195 '') installusrbinperl="$undef" ;;
2200 : general instructions
2203 user=`(logname) 2>/dev/null`
2205 '') user=`whoami 2>&1`;;
2207 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2210 rp='Would you like to see the instructions?'
2221 This installation shell script will examine your system and ask you questions
2222 to determine how the perl5 package should be installed. If you get
2223 stuck on a question, you may use a ! shell escape to start a subshell or
2224 execute a command. Many of the questions will have default answers in square
2225 brackets; typing carriage return will give you the default.
2227 On some of the questions which ask for file or directory names you are allowed
2228 to use the ~name construct to specify the login directory belonging to "name",
2229 even if you don't have a shell which knows about that. Questions where this is
2230 allowed will be marked "(~name ok)".
2234 dflt='Type carriage return to continue'
2238 The prompter used in this script allows you to use shell variables and
2239 backticks in your answers. You may use $1, $2, etc... to refer to the words
2240 in the default answer, as if the default line was a set of arguments given to a
2241 script shell. This means you may also use $* to repeat the whole default line,
2242 so you do not have to re-type everything to add something to the default.
2244 Everytime there is a substitution, you will have to confirm. If there is an
2245 error (e.g. an unmatched backtick), the default answer will remain unchanged
2246 and you will be prompted again.
2248 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2249 the questions and use the computed defaults (or the previous answers if there
2250 was already a config.sh file). Type 'Configure -h' for a list of options.
2251 You may also start interactively and then answer '& -d' at any prompt to turn
2252 on the non-interactive behaviour for the remainder of the execution.
2258 Much effort has been expended to ensure that this shell script will run on any
2259 Unix system. If despite that it blows up on yours, your best bet is to edit
2260 Configure and run it again. If you can't run Configure for some reason,
2261 you'll have to generate a config.sh file by hand. Whatever problems you
2262 have, let me (perlbug@perl.org) know how I blew it.
2264 This installation script affects things in two ways:
2266 1) it may do direct variable substitutions on some of the files included
2268 2) it builds a config.h file for inclusion in C programs. You may edit
2269 any of these files as the need arises after running this script.
2271 If you make a mistake on a question, there is no easy way to back up to it
2272 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2273 files. Configure will offer to let you do this before it runs the SH files.
2276 dflt='Type carriage return to continue'
2278 case "$firsttime" in
2279 true) echo $user >>../.config/instruct;;
2283 : find out where common programs are
2285 echo "Locating common programs..." >&4
2298 if test -d \$dir/\$thing; then
2304 for thisthing in \$dir/\$thing; do
2305 : just loop through to pick last item
2307 if test -f \$thisthing; then
2310 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2313 elif test -f \$dir/\$thing.exe; then
2314 if test -n "$DJGPP"; then
2315 echo \$dir/\$thing.exe
2316 elif test "$eunicefix" != ":"; then
2317 : on Eunice apparently
2369 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2370 pth="$pth /lib /usr/lib"
2371 for file in $loclist; do
2375 if test -f "$xxx"; then
2378 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2379 xxx=`./loc $file $file $pth`
2382 '') xxx=`./loc $file $file $pth`;;
2383 *) xxx=`./loc $xxx $xxx $pth`;;
2385 eval $file=$xxx$_exe
2389 echo $file is in $xxx.
2392 echo $file is in $xxx.
2395 echo "I don't know where '$file' is, and my life depends on it." >&4
2396 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2402 echo "Don't worry if any of the following aren't found..."
2404 for file in $trylist; do
2408 if test -f "$xxx"; then
2411 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2412 xxx=`./loc $file $file $pth`
2415 '') xxx=`./loc $file $file $pth`;;
2416 *) xxx=`./loc $xxx $xxx $pth`;;
2418 eval $file=$xxx$_exe
2422 echo $file is in $xxx.
2425 echo $file is in $xxx.
2428 echo "I don't see $file out there, $say."
2435 echo "Substituting grep for egrep."
2442 echo "Substituting cp for ln."
2451 echo "I can't find make or gmake, and my life depends on it." >&4
2452 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2460 *) # We can't have osname yet.
2461 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2462 # Assume that gmake, if found, is definitely GNU make
2463 # and prefer it over the system make.
2464 echo "Substituting gmake for make."
2472 echo "Hopefully test is built into your sh."
2475 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2476 echo "Using the test built into your sh."
2484 echo "Hopefully echo is built into your sh."
2489 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2490 $echo $n "hi there$c" >foo1
2491 echo $n "hi there$c" >foo2
2492 if cmp foo1 foo2 >/dev/null 2>&1; then
2493 echo "They are compatible. In fact, they may be identical."
2500 They are not compatible! You are probably running ksh on a non-USG system.
2501 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2502 have echo built in and we may have to run some Bourne shell scripts. That
2503 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2506 $echo $n "The star should be here-->$c"
2513 # This question was auctioned at YAPC::Europe-2007 in Vienna
2514 # I never promised you could answer it. I only auctioned the question.
2516 The following message is sponsored by
2518 Dresden.pm<--The stars should be here.
2520 Dear Perl user, system administrator or package
2521 maintainer, the Perl community sends greetings to
2522 you. Do you (emblematical) greet back [Y/n]? n
2526 : Check what type of C compiler we use
2530 cat <<'EOSC' >>trygcc
2535 int main(int argc, char *argv[]) {
2539 if $cc -o try $ccflags $ldflags try.c; then
2542 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2548 # Skip this test because it gives a false match on output like:
2549 # ./trygcc: line 23: cc: command not found
2550 # case "`$cc -v -c try.c 2>&1`" in
2551 # *gcc*) trygcc=no ;;
2553 if $test X"$trygcc" = Xyes; then
2554 if gcc -o try -c try.c; then
2556 echo "You seem to have a working gcc, though." >&4
2557 # Switching compilers may undo the work of hints files.
2558 # The most common problem is -D_REENTRANT for threads.
2559 # This heuristic catches that case, but gets false positives
2560 # if -Dusethreads was not actually specified. Better to
2561 # bail out here with a useful message than fail
2562 # mysteriously later. Should we perhaps just try to
2563 # re-invoke Configure -Dcc=gcc config_args ?
2564 if $test -f usethreads.cbu; then
2567 *** However, any setting of the C compiler flags (e.g. for thread support)
2568 *** will be lost. It may be necessary for you to restart Configure and
2569 *** add -Dcc=gcc to your Configure command line.
2572 rp="Would you like to go ahead and try gcc anyway?"
2575 rp="Would you like to use it?"
2578 if $test -f myread; then
2581 if $test -f UU/myread; then
2584 echo "Cannot find myread, sorry. Aborting." >&2
2589 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2602 cat <<'EOSC' >>checkcc
2607 int main(int argc, char *argv[]) {
2611 if $cc -o try $ccflags $ldflags try.c; then
2614 if $test X"$despair" = Xyes; then
2615 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2618 You need to find a working C compiler.
2619 Either (purchase and) install the C compiler supplied by your OS vendor,
2620 or for a free C compiler try http://gcc.gnu.org/
2621 I cannot continue any further, aborting.
2630 : determine whether symbolic links are supported
2633 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2634 echo "Symbolic links are supported." >&4
2637 echo "Symbolic links are NOT supported." >&4
2642 : determine whether symbolic links are supported
2646 echo "Checking how to test for symbolic links..." >&4
2648 if $test "X$issymlink" = X; then
2650 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2651 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2653 if test $? = 0; then
2656 echo "Your builtin 'test -h' may be broken." >&4
2659 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2662 if test -f "$p/$test"; then
2671 echo "Trying external '$test -h'." >&4
2672 issymlink="$test -h"
2673 if $test ! -h sym >/dev/null 2>&1; then
2674 echo "External '$test -h' is broken, too." >&4
2682 if $test "X$issymlink" = X; then
2683 if $test -L sym 2>/dev/null; then
2684 issymlink="$test -L"
2685 echo "The builtin '$test -L' worked." >&4
2688 if $test "X$issymlink" != X; then
2689 echo "You can test for symbolic links with '$issymlink'." >&4
2691 echo "I do not know how you can test for symbolic links." >&4
2695 *) echo "No symbolic links, so not testing for their testing..." >&4
2700 : Make symlinks util
2701 case "$mksymlinks" in
2704 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2707 *) case "$lns:$issymlink" in
2708 *"ln"*" -s:"*"test -"?)
2709 echo "Creating the symbolic links..." >&4
2710 echo "(First creating the subdirectories...)" >&4
2712 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2714 test -z "$directory" && break
2718 if test ! -d t/base; then
2719 echo "Failed to create the subdirectories. Aborting." >&4
2722 echo "(Then creating the symlinks...)" >&4
2723 awk '{print $1}' $src/MANIFEST | while true; do
2725 test -z "$filename" && break
2726 if test -f $filename; then
2727 if $issymlink $filename; then
2731 if test -f $filename; then
2732 echo "$filename already exists, not symlinking."
2734 ln -s $src/$filename $filename
2738 if test ! -f t/base/lex.t; then
2739 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2744 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2752 : Check for Cross-Compilation
2753 case "$usecrosscompile" in
2755 $echo "Cross-compiling..."
2758 *-*-gcc) # A cross-compiling gcc, probably.
2759 targetarch=`$echo $cc|$sed 's/-gcc$//'`
2761 # leave out ld, choosing it is more complex
2763 ranlib=$targetarch-ranlib
2764 $echo 'extern int foo;' > try.c
2765 set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
2767 if $test $# -gt 0; then
2769 incpth="`$echo $incpth|$sed 's/^ //'`"
2770 echo "Guessing incpth '$incpth'." >&4
2772 j="`$echo $i|$sed 's,/include$,/lib,'`"
2773 if $test -d $j; then
2777 libpth="`$echo $libpth|$sed 's/^ //'`"
2778 echo "Guessing libpth '$libpth'." >&4
2783 case "$targetarch" in
2784 '') echo "Targetarch not defined." >&4; croak=y ;;
2785 *) echo "Using targetarch $targetarch." >&4 ;;
2788 '') echo "Incpth not defined." >&4; croak=y ;;
2789 *) echo "Using incpth '$incpth'." >&4 ;;
2792 '') echo "Libpth not defined." >&4; croak=y ;;
2793 *) echo "Using libpth '$libpth'." >&4 ;;
2796 '') for i in $incpth; do
2797 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2799 echo "Guessing usrinc $usrinc." >&4
2804 '') echo "Usrinc not defined." >&4; croak=y ;;
2807 *) echo "Using usrinc $usrinc." >&4 ;;
2809 case "$targethost" in
2810 '') echo "Targethost not defined." >&4; croak=y ;;
2811 *) echo "Using targethost $targethost." >&4
2816 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2819 /*) run=$src/Cross/run
2820 targetmkdir=$src/Cross/mkdir
2822 from=$src/Cross/from
2824 *) pwd=`$test -f ../Configure & cd ..; pwd`
2826 targetmkdir=$pwd/Cross/mkdir
2828 from=$pwd/Cross/from
2831 case "$targetrun" in
2832 '') targetrun=ssh ;;
2837 case "$targetfrom" in
2838 '') targetfrom=scp ;;
2842 from=$from-$targetfrom
2843 case "$targetdir" in
2845 echo "Guessing targetdir $targetdir." >&4
2848 case "$targetuser" in
2850 echo "Guessing targetuser $targetuser." >&4
2853 case "$targetfrom" in
2857 case "$targetrun" in
2869 '') cwd=$targetdir ;;
2873 if $test ! -f \$exe.xok; then
2877 $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2880 *) echo "Unknown targetrun '$targetrun'" >&4
2884 case "$targetmkdir" in
2886 cat >$targetmkdir <<EOF
2888 $targetrun -l $targetuser $targethost "mkdir -p \$@"
2890 $chmod a+rx $targetmkdir
2892 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2904 $targetmkdir \`dirname \$f\`
2905 $targetto $q \$f $targetuser@$targethost:\$f || exit 1
2908 $targetmkdir $targetdir/\`dirname \$f\`
2909 $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2922 $mkdir -p $targetdir/\`dirname \$f\`
2923 $cp \$f $targetdir/\$f || exit 1
2926 $targetmkdir $targetdir/\`dirname \$f\`
2927 $cp \$f $targetdir/\$f || exit 1
2934 *) echo "Unknown targetto '$targetto'" >&4
2938 case "$targetfrom" in
2945 $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2950 cp) cat >$from <<EOF
2955 cp $targetdir/\$f . || exit 1
2960 *) echo "Unknown targetfrom '$targetfrom'" >&4
2964 if $test ! -f $run; then
2965 echo "Target 'run' script '$run' not found." >&4
2969 if $test ! -f $to; then
2970 echo "Target 'to' script '$to' not found." >&4
2974 if $test ! -f $from; then
2975 echo "Target 'from' script '$from' not found." >&4
2979 if $test ! -f $run -o ! -f $to -o ! -f $from; then
2983 Using '$run' for remote execution,
2984 and '$from' and '$to'
2985 for remote file transfer.
2991 usecrosscompile='undef'
2996 : see whether [:lower:] and [:upper:] are supported character classes
2998 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
3000 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
3004 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
3005 # (0xd9 and 0xe2), therefore that is a nice testing point.
3006 if test "X$up" = X -o "X$low" = X; then
3007 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
3013 if test "X$up" = X -o "X$low" = X; then
3014 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
3020 if test "X$up" = X -o "X$low" = X; then
3021 case "`echo RS | od -x 2>/dev/null`" in
3023 echo "Hey, this might be EBCDIC." >&4
3024 if test "X$up" = X -o "X$low" = X; then
3025 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
3026 rs) up='[A-IJ-RS-Z]'
3031 if test "X$up" = X -o "X$low" = X; then
3032 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
3042 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
3044 echo "Using $up and $low to convert case." >&4
3047 echo "I don't know how to translate letters from upper to lower case." >&4
3048 echo "Your tr is not acting any way I know of." >&4
3052 : set up the translation script tr, must be called with ./tr of course
3056 '[A-Z][a-z]') exec $tr '$up' '$low';;
3057 '[a-z][A-Z]') exec $tr '$low' '$up';;
3064 : Try to determine whether config.sh was made on this system
3065 case "$config_sh" in
3067 myuname=`$uname -a 2>/dev/null`
3068 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
3069 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
3070 # because the A-Z/a-z are not consecutive.
3071 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e "s,['/],,g" | \
3072 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
3073 newmyuname="$myuname"
3075 case "$knowitall" in
3077 if test -f ../config.sh; then
3078 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3079 eval "`grep myuname= ../config.sh`"
3081 if test "X$myuname" = "X$newmyuname"; then
3089 : Get old answers from old config file if Configure was run on the
3090 : same system, otherwise use the hints.
3093 if test -f config.sh; then
3095 rp="I see a config.sh file. Shall I use it to set the defaults?"
3098 n*|N*) echo "OK, I'll ignore it."
3099 mv config.sh config.sh.old
3100 myuname="$newmyuname"
3102 *) echo "Fetching default answers from your old config.sh file..." >&4
3110 : Older versions did not always set $sh. Catch re-use of such
3120 if test ! -f config.sh; then
3123 First time through, eh? I have some defaults handy for some systems
3124 that need some extra help getting the Configure answers right:
3127 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3129 : Half the following guesses are probably wrong... If you have better
3130 : tests or hints, please send them to perlbug@perl.org
3131 : The metaconfig authors would also appreciate a copy...
3132 $test -f /irix && osname=irix
3133 $test -f /xenix && osname=sco_xenix
3134 $test -f /dynix && osname=dynix
3135 $test -f /dnix && osname=dnix
3136 $test -f /lynx.os && osname=lynxos
3137 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3138 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3139 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3140 $test -f /bin/mips && /bin/mips && osname=mips
3141 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
3142 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
3143 $test -d /usr/apollo/bin && osname=apollo
3144 $test -f /etc/saf/_sactab && osname=svr4
3145 $test -d /usr/include/minix && osname=minix
3146 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3147 if $test -d /MachTen -o -d /MachTen_Folder; then
3149 if $test -x /sbin/version; then
3150 osvers=`/sbin/version | $awk '{print $2}' |
3151 $sed -e 's/[A-Za-z]$//'`
3152 elif $test -x /usr/etc/version; then
3153 osvers=`/usr/etc/version | $awk '{print $2}' |
3154 $sed -e 's/[A-Za-z]$//'`
3160 $test -f /sys/posix.dll &&
3161 $test -f /usr/bin/what &&
3162 set X `/usr/bin/what /sys/posix.dll` &&
3163 $test "$3" = UWIN &&
3167 if $test -f $uname; then
3175 umips) osname=umips ;;
3178 [23]100) osname=mips ;;
3179 next*) osname=next ;;
3181 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3182 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3185 elif $test -f /etc/kconfig; then
3187 if test "$lns" = "$ln -s"; then
3189 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3191 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3198 if test -n "$DJGPP"; then
3207 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3209 # oslevel can fail with:
3210 # oslevel: Unable to acquire lock.
3211 *not\ found) osvers="$4"."$3" ;;
3212 '<3240'|'<>3240') osvers=3.2.0 ;;
3213 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3214 '=3250'|'>3250') osvers=3.2.5 ;;
3218 bsd386) osname=bsd386
3221 cygwin*) osname=cygwin
3224 *dc.osx) osname=dcosx
3230 domainos) osname=apollo
3236 dragonfly) osname=dragonfly
3239 dynixptx*) osname=dynixptx
3240 osvers=`echo "$4"|sed 's/^v//'`
3242 freebsd) osname=freebsd
3244 genix) osname=genix ;;
3248 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3264 netbsd*) osname=netbsd
3267 news-os) osvers="$3"
3269 4*) osname=newsos4 ;;
3273 next*) osname=next ;;
3274 nonstop-ux) osname=nonstopux ;;
3275 openbsd) osname=openbsd
3281 POSIX-BC | posix-bc ) osname=posix-bc
3284 powerux | power_ux | powermax_os | powermaxos | \
3285 powerunix | power_unix) osname=powerux
3291 solaris) osname=solaris
3293 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3300 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3304 titanos) osname=titanos
3313 ultrix) osname=ultrix
3316 osf1|mls+) case "$5" in
3319 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3322 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3325 hp*) osname=hp_osf1 ;;
3326 mips) osname=mips_osf1 ;;
3329 # UnixWare 7.1.2 is known as Open UNIX 8
3330 openunix|unixware) osname=svr5
3338 $2) case "$osname" in
3342 : svr4.x or possibly later
3352 if test -f /stand/boot ; then
3353 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3354 if test -n "$INITPROG" -a -f "$INITPROG"; then
3355 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3356 if test -n "$isesix"; then
3364 *) if test -f /etc/systemid; then
3366 set `echo $3 | $sed 's/\./ /g'` $4
3367 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3369 elif $test -f $src/hints/sco_$1_$2.sh; then
3371 elif $test -f $src/hints/sco_$1.sh; then
3376 '') : Still unknown. Probably a generic Sys V.
3385 *) case "$osname" in
3386 '') : Still unknown. Probably a generic BSD.
3394 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3395 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3396 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3399 $rm -f UU/kernel.what
3400 elif test -d c:/. -o -n "$is_os2" ; then
3407 case "$targetarch" in
3410 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3415 : Now look for a hint file osname_osvers, unless one has been
3416 : specified already.
3419 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3420 : Also try without trailing minor version numbers.
3421 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3422 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3423 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3424 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3427 *) case "$osvers" in
3430 *) if $test -f $src/hints/$file.sh ; then
3432 elif $test -f $src/hints/$xfile.sh ; then
3434 elif $test -f $src/hints/$xxfile.sh ; then
3436 elif $test -f $src/hints/$xxxfile.sh ; then
3438 elif $test -f $src/hints/$xxxxfile.sh ; then
3440 elif $test -f "$src/hints/${osname}.sh" ; then
3449 if $test -f Policy.sh ; then
3452 none) dflt="Policy" ;;
3453 *) dflt="Policy $dflt" ;;
3458 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3462 if $test -f Policy.sh ; then
3465 There's also a Policy hint file available, which should make the
3466 site-specific (policy) questions easier to answer.
3473 You may give one or more space-separated answers, or "none" if appropriate.
3474 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3475 previous run of Configure, you may specify it as well as or instead of
3476 OS-specific hints. If hints are provided for your OS, you should use them:
3477 although Perl can probably be built without hints on many platforms, using
3478 hints often improve performance and may enable features that Configure can't
3479 set up on its own. If there are no hints that match your OS, specify "none";
3480 DO NOT give a wrong version or a wrong OS.
3484 rp="Which of these apply, if any?"
3487 for file in $tans; do
3488 if $test X$file = XPolicy -a -f Policy.sh; then
3490 $cat Policy.sh >> UU/config.sh
3491 elif $test -f $src/hints/$file.sh; then
3492 . $src/hints/$file.sh
3493 $cat $src/hints/$file.sh >> UU/config.sh
3494 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3497 : Give one chance to correct a possible typo.
3498 echo "$file.sh does not exist"
3500 rp="hint to use instead?"
3502 for file in $ans; do
3503 if $test -f "$src/hints/$file.sh"; then
3504 . $src/hints/$file.sh
3505 $cat $src/hints/$file.sh >> UU/config.sh
3506 elif $test X$ans = X -o X$ans = Xnone ; then
3509 echo "$file.sh does not exist -- ignored."
3516 : Remember our hint file for later.
3517 if $test -f "$src/hints/$file.sh" ; then
3527 echo "Fetching default answers from $config_sh..." >&4
3531 cp $config_sh config.sh 2>/dev/null
3541 test "$override" && . ./optdef.sh
3543 : Restore computed paths
3544 for file in $loclist $trylist; do
3545 eval $file="\$_$file"
3550 Configure uses the operating system name and version to set some defaults.
3551 The default value is probably right if the name rings a bell. Otherwise,
3552 since spelling matters for me, either accept the default or answer "none"
3559 ''|' '|none) dflt=none ;;
3560 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3563 *) dflt="$osname" ;;
3565 rp="Operating system name?"
3569 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3575 ''|' '|none) dflt=none ;;
3576 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3577 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3579 ''|' ') dflt=none ;;
3584 *) dflt="$osvers" ;;
3586 rp="Operating system version?"
3596 : who configured the system
3597 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3600 cf_by=`(logname) 2>/dev/null`
3603 cf_by=`(whoami) 2>/dev/null`
3605 "") cf_by=unknown ;;
3610 : decide how portable to be. Allow command line overrides.
3611 case "$d_portable" in
3613 *) d_portable="$define" ;;
3616 : set up shell script to do ~ expansion
3622 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3625 if $test -f /bin/csh; then
3626 /bin/csh -f -c "glob \$1"
3631 name=\`$expr x\$1 : '..\([^/]*\)'\`
3632 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3633 if $test ! -d "\$dir"; then
3635 echo "\$me: can't locate home directory for: \$name" >&2
3640 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3656 : now set up to get a file name
3660 cat <<'EOSC' >>getfile
3676 : getfile will accept an answer from the comma-separated list
3677 : enclosed in parentheses even if it does not meet other criteria.
3678 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3679 fn=`echo $fn | sed 's/(.*)//'`
3685 loc_file=`expr $fn : '.*:\(.*\)'`
3686 fn=`expr $fn : '\(.*\):.*'`
3694 */*) fullpath=true;;
3703 *e*) exp_file=true;;
3706 *p*) nopath_ok=true;;
3711 *d*) type='Directory';;
3712 *l*) type='Locate';;
3717 Locate) what='File';;
3722 case "$d_portable" in
3730 while test "$type"; do
3735 true) rp="$rp (~name ok)";;
3738 if test -f UU/getfile.ok && \
3739 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3758 value=`UU/filexp $ans`
3761 if test "$ans" != "$value"; then
3762 echo "(That expands to $value on this system.)"
3776 /*) value="$ansexp" ;;
3777 [a-zA-Z]:/*) value="$ansexp" ;;
3782 echo "I shall only accept a full path name, as in /bin/ls." >&4
3783 echo "Use a ! shell escape if you wish to check pathnames." >&4
3786 echo "Please give a full path name, starting with slash." >&4
3789 echo "Note that using ~name is ok provided it expands well." >&4
3802 for fp in $gfpth; do
3803 if test "X$fp" = X.; then
3808 if test -f "$pf"; then
3810 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3812 echo "($value is not a plain file, but that's ok.)"
3815 if test X"$type" = X; then
3822 for fp in $gfpth; do
3823 if test "X$fp" = X.; then
3828 direxp="$fp/$ansexp"
3830 if test -d "$direxp"; then
3838 if test -d "$ansexp"; then
3839 echo "(Looking for $loc_file in directory $value.)"
3840 value="$value/$loc_file"
3841 ansexp="$ansexp/$loc_file"
3843 if test -f "$ansexp"; then
3846 case "$nopath_ok" in
3847 true) case "$value" in
3849 *) echo "Assuming $value will be in people's path."
3865 if test "$fastread" = yes; then
3870 rp="$what $value doesn't exist. Use that name anyway?"
3889 test "X$gfpthkeep" != Xy && gfpth=""
3892 : determine root of directory hierarchy where package will be installed.
3895 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
3898 dflt=`echo "$prefix" | sed 's/.$//'`
3906 By default, $package will be installed in $dflt/bin, manual pages
3907 under $dflt/man, etc..., i.e. with $dflt as prefix for all
3908 installation directories. Typically this is something like /usr/local.
3909 If you wish to have binaries under /usr/bin but other parts of the
3910 installation under /usr/local, that's ok: you will be prompted
3911 separately for each of the installation directories, the prefix being
3912 only used to set the defaults.
3916 rp='Installation prefix to use?'
3924 *) oldprefix="$prefix";;
3931 : allow them to override the AFS root
3934 *) afsroot=$afsroot ;;
3940 $define|true) afs=true ;;
3941 $undef|false) afs=false ;;
3942 *) if $test -d $afsroot; then
3950 echo "AFS may be running... I'll be extra cautious then..." >&4
3952 echo "AFS does not seem to be running..." >&4
3955 : determine installation prefix for where package is to be installed.
3959 Since you are running AFS, I need to distinguish the directory in which
3960 files will reside from the directory in which they are installed (and from
3961 which they are presumably copied to the former directory by occult means).
3964 case "$installprefix" in
3965 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
3966 *) dflt="$installprefix";;
3971 In some special cases, particularly when building $package for distribution,
3972 it is convenient to distinguish the directory in which files should be
3973 installed from the directory ($prefix) in which they will
3974 eventually reside. For most users, these two directories are the same.
3977 case "$installprefix" in
3979 *) dflt=$installprefix;;
3983 rp='What installation prefix should I use for installing files?'
3985 installprefix="$ans"
3986 installprefixexp="$ansexp"
3988 : Perform the prefixexp/installprefixexp correction if necessary
3989 cat <<EOS >installprefix
3992 cat <<'EOSC' >>installprefix
3993 : Change installation prefix, if necessary.
3994 if $test X"$prefix" != X"$installprefix"; then
3995 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
3997 eval "install${prefixvar}=\"\$${prefixvar}exp\""
4000 chmod +x installprefix
4001 $eunicefix installprefix
4003 : Set variables such as privlib and privlibexp from the output of ./getfile
4004 : performing the prefixexp/installprefixexp correction if necessary.
4005 cat <<EOS >setprefixvar
4008 cat <<'EOSC' >>setprefixvar
4009 eval "${prefixvar}=\"\$ans\""
4010 eval "${prefixvar}exp=\"\$ansexp\""
4013 chmod +x setprefixvar
4014 $eunicefix setprefixvar
4016 : set up the script used to warn in case of inconsistency
4025 '') echo "The $hint value for \$$var on this machine was \"$was\"!" >&4
4027 *) echo "Hmm. Based on the hints in hints/$hintfile.sh, " >&4
4028 echo "the $hint value for \$$var on this machine was \"$was\"!" >&4
4033 echo "*** WHOA THERE!!! ***" >&4
4034 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
4037 rp=" Keep the $hint value?"
4040 y) td=$was; tu=$was;;
4044 : function used to set '$1' to '$val'
4045 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
4047 $define$undef) . ./whoa; eval "$var=\$td";;
4048 $undef$define) . ./whoa; eval "$var=\$tu";;
4049 *) eval "$var=$val";;
4052 : Check is we will use socks
4054 $define|true|[yY]*) dflt='y';;
4059 Perl can be built to use the SOCKS proxy protocol library. To do so,
4060 Configure must be run with -Dusesocks. If you use SOCKS you also need
4061 to use the PerlIO abstraction layer, this will be implicitly selected.
4063 If this doesn't make any sense to you, just accept the default '$dflt'.
4065 rp='Build Perl for SOCKS?'
4068 y|Y) val="$define" ;;
4075 $define|true|[yY]*) useperlio="$define";;
4078 : Check if we want perlio
4079 case "$useperlio" in
4080 $define|true|[yY]*|'') dflt='y';;
4085 Previous version of $package used the standard IO mechanisms as
4086 defined in <stdio.h>. Versions 5.003_02 and later of $package allow
4087 alternate IO mechanisms via the PerlIO abstraction layer, but the
4088 stdio mechanism is still available if needed. The abstraction layer
4089 can use AT&T's sfio (if you already have sfio installed) or regular stdio.
4090 Using PerlIO with sfio may cause problems with some extension modules.
4092 If this doesn't make any sense to you, just accept the default '$dflt'.
4094 rp='Use the PerlIO abstraction layer?'
4101 echo "Ok, doing things the stdio way."
4110 case "$useperlio" in
4111 $define|true|[yY]*) ;;
4114 You are using the SOCKS proxy protocol library which means that you
4115 should also use the PerlIO layer. You may be headed for trouble.
4123 : get the patchlevel
4125 echo "Getting the current patchlevel..." >&4
4126 if $test -r $rsrc/patchlevel.h;then
4127 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
4128 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4129 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4130 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4131 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4132 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4133 perl_patchlevel=`egrep ',"(MAINT|SMOKE)[0-9][0-9]*"' $rsrc/patchlevel.h|tail -1|sed 's/[^0-9]//g'`
4142 $echo "(You do not have patchlevel.h. Eek.)"
4144 if $test -r $rsrc/.patch ; then
4145 if $test "X$perl_patchlevel" = "X" || $test "`cat $rsrc/.patch`" -gt "$perl_patchlevel" ; then
4146 perl_patchlevel=`cat $rsrc/.patch`
4149 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
4150 version_patchlevel_string="version $patchlevel subversion $subversion"
4151 case "$perl_patchlevel" in
4153 *) perl_patchlevel=`echo $perl_patchlevel | sed 's/.* //'`
4154 version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel"
4158 $echo "(You have $package $version_patchlevel_string.)"
4162 : XXX Should be a Configure test for double-dots in filenames.
4163 version=`echo $revision $patchlevel $subversion | \
4164 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4165 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4166 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4169 version=`echo $revision $patchlevel $subversion | \
4170 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4171 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4172 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4175 : Special case the 5.005_xx maintenance series, which used 5.005
4176 : without any subversion label as a subdirectory in $sitelib
4177 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4178 api_versionstring='5.005'
4181 : Do we want threads support and if so, what type
4182 case "$usethreads" in
4183 $define|true|[yY]*) dflt='y';;
4184 *) # Catch case where user specified ithreads or 5005threads but
4185 # forgot -Dusethreads (A.D. 4/2002)
4186 case "$useithreads$use5005threads" in
4188 case "$useperlio" in
4189 "$define") dflt='y' ;;
4199 Perl can be built to take advantage of threads on some systems.
4200 To do so, Configure can be run with -Dusethreads.
4202 Note that Perl built with threading support runs slightly slower
4203 and uses more memory than plain Perl. The current implementation
4204 is believed to be stable, but it is fairly new, and so should be
4205 treated with caution.
4207 If this doesn't make any sense to you, just accept the default '$dflt'.
4209 rp='Build a threading Perl?'
4212 y|Y) val="$define" ;;
4218 if $test $patchlevel -lt 9; then
4219 case "$usethreads" in
4223 Since release 5.6, Perl has had two different threading implementations,
4224 the newer interpreter-based version (ithreads) with one interpreter per
4225 thread, and the older 5.005 version (5005threads).
4226 The 5005threads version is effectively unmaintained and will probably be
4227 removed in Perl 5.10, so there should be no need to build a Perl using it
4228 unless needed for backwards compatibility with some existing 5.005threads
4232 : Default to ithreads unless overridden on command line or with
4235 case "$use5005threads" in
4236 $define|true|[yY]*) dflt='n';;
4238 case "$useithreads" in
4239 $undef|false|[nN]*) dflt='n';;
4241 rp='Use the newer interpreter-based ithreads?'
4244 y|Y) val="$define" ;;
4249 : Now set use5005threads to the opposite value.
4250 case "$useithreads" in
4251 $define) val="$undef" ;;
4258 useithreads="$undef"
4259 use5005threads="$undef"
4263 case "$useithreads$use5005threads" in
4267 You cannot have both the ithreads and the 5.005 threads enabled
4268 at the same time. Disabling the 5.005 threads since they are
4269 much less stable than the ithreads.
4272 use5005threads="$undef"
4277 : perl-5.9.x and later
4279 if test X"$usethreads" = "X$define"; then
4280 case "$use5005threads" in
4284 5.005 threads has been removed for 5.10. Perl will be built using ithreads.
4291 use5005threads="$undef"
4292 useithreads="$usethreads"
4295 if test X"$usethreads" = "X$define" -a "X$useperlio" = "Xundef"; then
4298 *** To build with ithreads you must also use the PerlIO layer.
4299 *** Cannot continue, aborting.
4305 case "$d_oldpthreads" in
4306 '') : Configure tests would be welcome here. For now, assume undef.
4308 *) val="$d_oldpthreads" ;;
4314 : Look for a hint-file generated 'call-back-unit'. If the
4315 : user has specified that a threading perl is to be built,
4316 : we may need to set or change some other defaults.
4317 if $test -f usethreads.cbu; then
4318 echo "Your platform has some specific hints regarding threaded builds, using them..."
4321 case "$usethreads" in
4322 "$define"|true|[yY]*)
4324 (Your platform does not have any specific hints for threaded builds.
4325 Assuming POSIX threads, then.)
4331 : Check if multiplicity is required
4334 Perl can be built so that multiple Perl interpreters can coexist
4335 within the same Perl executable.
4338 case "$useithreads" in
4341 This multiple interpreter support is required for interpreter-based threads.
4345 *) case "$usemultiplicity" in
4346 $define|true|[yY]*) dflt='y';;
4350 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4351 rp='Build Perl for multiplicity?'
4354 y|Y) val="$define" ;;
4362 : Check if morebits is requested
4363 case "$usemorebits" in
4364 "$define"|true|[yY]*)
4365 use64bitint="$define"
4366 uselongdouble="$define"
4367 usemorebits="$define"
4369 *) usemorebits="$undef"
4373 : Determine the C compiler to be used
4379 rp="Use which C compiler?"
4383 : See whether they have no cc but they do have gcc
4385 if $test -f cc.cbu; then
4390 : make some quick guesses about what we are up against
4392 $echo $n "Hmm... $c"
4402 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
4403 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
4405 echo "Looks kind of like an OSF/1 system, but we'll see..."
4407 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4408 xxx=`./loc addbib blurfl $pth`
4409 if $test -f $xxx; then
4410 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4414 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4415 echo "Looks kind of like an extended USG system, but we'll see..."
4417 echo "Looks kind of like a USG system, but we'll see..."
4421 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4422 echo "Looks kind of like a BSD system, but we'll see..."
4426 echo "Looks kind of like a Version 7 system, but we'll see..."
4429 case "$eunicefix" in
4432 There is, however, a strange, musty smell in the air that reminds me of
4433 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4437 : it so happens the Eunice I know will not run shell scripts in Unix format
4441 echo "Congratulations. You aren't running Eunice."
4445 : Detect OS2. The p_ variable is set above in the Head.U unit.
4446 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4447 : semicolon as a patch separator
4452 I have the feeling something is not exactly right, however...don't tell me...
4453 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4454 (Or you may be running DOS with DJGPP.)
4459 if test -f /xenix; then
4460 echo "Actually, this looks more like a XENIX system..."
4465 echo "It's not Xenix..."
4470 if test -f /venix; then
4471 echo "Actually, this looks more like a VENIX system..."
4478 echo "Nor is it Venix..."
4481 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4482 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4485 : Check if we are using GNU gcc and what its version is
4487 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4491 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4493 printf("%s\n", __VERSION__);
4495 printf("%s\n", "1");
4501 if $cc -o try $ccflags $ldflags try.c; then
4502 gccversion=`$run ./try`
4503 case "$gccversion" in
4504 '') echo "You are not using GNU cc." ;;
4505 *) echo "You are using GNU cc $gccversion."
4511 echo "*** WHOA THERE!!! ***" >&4
4512 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4513 case "$knowitall" in
4515 echo " You'd better start hunting for one and let me know about it." >&4
4521 case "$gccversion" in
4522 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4524 case "$gccversion" in
4525 '') gccosandvers='' ;;
4526 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4527 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4529 case "$gccosandvers" in
4530 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4531 $osname$osvers) ;; # looking good
4532 $osname*) cat <<EOM >&4
4534 *** WHOA THERE!!! ***
4536 Your gcc has not been compiled for the exact release of
4537 your operating system ($gccosandvers versus $osname$osvers).
4539 In general it is a good idea to keep gcc synchronized with
4540 the operating system because otherwise serious problems
4541 may ensue when trying to compile software, like Perl.
4543 I'm trying to be optimistic here, though, and will continue.
4544 If later during the configuration and build icky compilation
4545 problems appear (headerfile conflicts being the most common
4546 manifestation), I suggest reinstalling the gcc to match
4547 your operating system release.
4551 *) gccosandvers='' ;; # failed to parse, better be silent
4559 # gcc 3.* complain about adding -Idirectories that they already know about,
4560 # so we will take those off from locincpth.
4561 case "$gccversion" in
4563 echo "main(){}">try.c
4564 for incdir in $locincpth; do
4565 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4566 grep '^c[cp]p*[01]: warning: changing search order '`
4567 if test "X$warn" != X; then
4568 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4574 : What should the include directory be ?
4576 $echo $n "Hmm... $c"
4580 if $test -f /bin/mips && /bin/mips; then
4581 echo "Looks like a MIPS system..."
4582 $cat >usr.c <<'EOCP'
4583 #ifdef SYSTYPE_BSD43
4587 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4588 dflt='/bsd43/usr/include'
4592 mips_type='System V'
4594 $rm -f usr.c usr.out
4595 echo "and you're compiling with the $mips_type compiler and libraries."
4599 echo "Doesn't look like a MIPS system."
4609 case "$xxx_prompt" in
4612 rp='Where are the include files you want to use?'
4620 : see how we invoke the C preprocessor
4622 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4623 cat <<'EOT' >testcpp.c
4629 if test ! -f cppstdin; then
4630 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4631 # AIX cc -E doesn't show the absolute headerfile
4632 # locations but we'll cheat by using the -M flag.
4633 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
4635 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4638 echo "Keeping your $hint cppstdin wrapper."
4641 wrapper=`pwd`/cppstdin
4645 if $test "X$cppstdin" != "X" && \
4646 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4647 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4649 echo "You used to use $cppstdin $cppminus so we'll use that again."
4651 '') echo "But let's see if we can live without a wrapper..." ;;
4653 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4654 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4656 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4659 echo "(However, $cpprun $cpplast does not work, let's see...)"
4667 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4674 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4675 $cc -E <testcpp.c >testcpp.out 2>&1; \
4676 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4677 echo "Yup, it does."
4680 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4681 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4682 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4683 echo "Yup, it does."
4686 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4687 $cc -P <testcpp.c >testcpp.out 2>&1; \
4688 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4689 echo "Yipee, that works!"
4692 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4693 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4694 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4695 echo "At long last!"
4698 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4699 $cpp <testcpp.c >testcpp.out 2>&1; \
4700 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4704 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4705 $cpp - <testcpp.c >testcpp.out 2>&1; \
4706 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4707 echo "Hooray, it works! I was beginning to wonder."
4710 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4711 $wrapper <testcpp.c >testcpp.out 2>&1; \
4712 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4718 rp="No dice. I can't find a C preprocessor. Name one:"
4722 $x_cpp <testcpp.c >testcpp.out 2>&1
4723 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4724 echo "OK, that will do." >&4
4726 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4741 echo "Perhaps can we force $cc -E using a wrapper..."
4742 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4743 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4749 echo "Nope, we'll have to live without it..."
4763 "$wrapper"|'cppstdin') ;;
4764 *) $rm -f $wrapper;;
4766 $rm -f testcpp.c testcpp.out
4768 : Set private lib path
4771 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4776 '') dlist="$loclibpth $plibpth $glibpth";;
4777 *) dlist="$libpth";;
4780 : Now check and see which directories actually exist, avoiding duplicates
4784 if $test -d $xxx; then
4787 *) libpth="$libpth $xxx";;
4793 Some systems have incompatible or broken versions of libraries. Among
4794 the directories listed in the question below, please remove any you
4795 know not to be holding relevant libraries, and add any that are needed.
4796 Say "none" for none.
4807 rp="Directories to use for library searches?"
4814 : compute shared library extension
4817 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4827 On some systems, shared libraries may be available. Answer 'none' if
4828 you want to suppress searching of shared libraries for the remainder
4829 of this configuration.
4832 rp='What is the file extension used for shared libraries?'
4836 : Define several unixisms.
4837 : Hints files or command line option can be used to override them.
4838 : The convoluted testing is in case hints files set either the old
4841 '') case "$exe_ext" in
4843 *) _exe="$exe_ext" ;;
4848 '') case "$lib_ext" in
4855 '') case "$obj_ext" in
4862 '') case "$path_sep" in
4873 rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
4875 : Which makefile gets called first. This is used by make depend.
4876 case "$firstmakefile" in
4877 '') firstmakefile='makefile';;
4880 : Check for uselongdouble support
4882 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
4885 case "$uselongdouble" in
4886 $define|true|[yY]*) dflt='y';;
4891 Perl can be built to take advantage of long doubles which
4892 (if available) may give more accuracy and range for floating point numbers.
4894 If this doesn't make any sense to you, just accept the default '$dflt'.
4896 rp='Try to use long doubles if available?'
4899 y|Y) val="$define" ;;
4905 case "$uselongdouble" in
4906 true|[yY]*) uselongdouble="$define" ;;
4909 : Look for a hint-file generated 'call-back-unit'. If the
4910 : user has specified that long doubles should be used,
4911 : we may need to set or change some other defaults.
4912 if $test -f uselongdouble.cbu; then
4913 echo "Your platform has some specific hints regarding long doubles, using them..."
4914 . ./uselongdouble.cbu
4916 case "$uselongdouble" in
4919 (Your platform does not have any specific hints for long doubles.)
4925 : Looking for optional libraries
4927 echo "Checking for optional libraries..." >&4
4932 case "$libswanted" in
4933 '') libswanted='c_s';;
4936 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4942 for thisdir in $libpth $xlibpth; do
4943 test -d $thisdir && libspath="$libspath $thisdir"
4945 for thislib in $libswanted; do
4946 for thisdir in $libspath; do
4948 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4949 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
4950 $test -f "$xxx" && eval $libscheck
4951 $test -f "$xxx" && libstyle=shared
4953 if test ! -f "$xxx"; then
4954 xxx=$thisdir/lib$thislib.$so
4955 $test -f "$xxx" && eval $libscheck
4956 $test -f "$xxx" && libstyle=shared
4958 if test ! -f "$xxx"; then
4959 xxx=$thisdir/lib$thislib$_a
4960 $test -f "$xxx" && eval $libscheck
4961 $test -f "$xxx" && libstyle=static
4963 if test ! -f "$xxx"; then
4964 xxx=$thisdir/$thislib$_a
4965 $test -f "$xxx" && eval $libscheck
4966 $test -f "$xxx" && libstyle=static
4968 if test ! -f "$xxx"; then
4969 xxx=$thisdir/lib${thislib}_s$_a
4970 $test -f "$xxx" && eval $libscheck
4971 $test -f "$xxx" && libstyle=static
4972 $test -f "$xxx" && thislib=${thislib}_s
4974 if test ! -f "$xxx"; then
4975 xxx=$thisdir/Slib$thislib$_a
4976 $test -f "$xxx" && eval $libscheck
4977 $test -f "$xxx" && libstyle=static
4979 if $test -f "$xxx"; then
4981 shared) echo "Found -l$thislib (shared)." ;;
4982 static) echo "Found -l$thislib." ;;
4983 *) echo "Found -l$thislib ($libstyle)." ;;
4987 *) dflt="$dflt -l$thislib"
4988 libsfound="$libsfound $xxx"
4990 libsfiles="$libsfiles $yyy"
4991 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
4992 case " $libsdirs " in
4994 *) libsdirs="$libsdirs $yyy" ;;
5001 if $test ! -f "$xxx"; then
5002 echo "No -l$thislib."
5013 ' '|'') dflt='none';;
5018 In order to compile $package on your machine, a number of libraries
5019 are usually needed. Include any other special libraries here as well.
5020 Say "none" for none. The default list is almost always right.
5024 rp="What libraries to use?"
5031 : determine optimization, if desired, or use for debug flag also
5033 ' '|$undef) dflt='none';;
5035 *) dflt="$optimize";;
5039 By default, $package compiles with the -O flag to use the optimizer.
5040 Alternately, you might want to use the symbolic debugger, which uses
5041 the -g flag (on traditional Unix systems). Either flag can be
5042 specified here. To use neither flag, specify the word "none".
5045 rp="What optimizer/debugger flag should be used?"
5049 'none') optimize=" ";;
5052 : Check what DEBUGGING is required from the command line
5053 : -DEBUGGING or -DDEBUGGING or
5054 : -DEBUGGING=both = -g + -DDEBUGGING
5055 : -DEBUGGING=-g or -Doptimize=-g = -g
5056 : -DEBUGGING=none or -UDEBUGGING =
5057 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
5060 *) DEBUGGING=$EBUGGING ;;
5063 case "$DEBUGGING" in
5067 *) optimize="$optimize -g" ;;
5071 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
5079 case "$DEBUGGING" in
5080 both|$define) dflt='-DDEBUGGING'
5083 : argument order is deliberate, as the flag will start with - which set could
5084 : think is an option
5085 checkccflag='check=$1; flag=$2; callback=$3;
5087 echo "Checking if your compiler accepts $flag" 2>&1;
5088 echo "int main(void) { return 0; }" > gcctest.c;
5089 if $cc -O2 $flag -o gcctest gcctest.c 2>gcctest.out && ./gcctest; then
5090 echo "Yes, it does." 2>&1;
5091 if $test -s gcctest.out ; then
5092 echo "But your platform does not like it:";
5097 echo "Leaving current flags $ccflags alone." 2>&1
5099 *) dflt="$dflt $flag";
5105 echo "Nope, it does not, but that is ok." 2>&1;
5109 : We will not override a previous value, but we might want to
5110 : augment a hint file
5112 default|recommended)
5113 case "$gccversion" in
5114 1*) dflt="$dflt -fpcc-struct-return" ;;
5116 case "$optimize:$DEBUGGING" in
5117 *-g*:old) dflt="$dflt -DDEBUGGING";;
5119 case "$gccversion" in
5120 2*) if $test -d /etc/conf/kconfig.d &&
5121 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
5123 # Interactive Systems (ISC) POSIX mode.
5128 case "$gccversion" in
5131 ?*) set strict-aliasing -fno-strict-aliasing
5135 # For gcc, adding -pipe speeds up compilations for some, but apparently
5136 # some assemblers can't read from stdin. (It also slows down compilations
5137 # in other cases, but those are apparently rarer these days.) AD 5/2004.
5138 case "$gccversion" in
5144 # on x86_64 (at least) we require an extra library (libssp) in the
5145 # link command line. This library is not named, so I infer that it is
5146 # an implementation detail that may change. Hence the safest approach
5147 # is to add the flag to the flags passed to the compiler at link time,
5148 # as that way the compiler can do the right implementation dependant
5150 case "$gccversion" in
5151 ?*) set stack-protector -fstack-protector
5158 case "$mips_type" in
5159 *BSD*|'') inclwanted="$locincpth $usrinc";;
5160 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
5162 for thisincl in $inclwanted; do
5163 if $test -d $thisincl; then
5164 if $test x$thisincl != x$usrinc; then
5166 *" -I$thisincl "*);;
5167 *) dflt="$dflt -I$thisincl ";;
5173 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
5175 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5183 *) dflt="$dflt -D$2";;
5187 set signal.h LANGUAGE_C; eval $inctest
5191 ccflags="$ccflags -DSOCKS"
5196 default|recommended) dflt="$ccflags $dflt" ;;
5197 *) dflt="$ccflags";;
5206 Your C compiler may want other flags. For this question you should include
5207 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5208 but you should NOT include libraries or ld flags like -lwhatever. If you
5209 want $package to honor its debug switch, you should include -DDEBUGGING here.
5210 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5212 To use no flags, specify the word "none".
5218 rp="Any additional cc flags?"
5225 : the following weeds options from ccflags that are of no interest to cpp
5227 '') cppflags="$ccflags" ;;
5228 *) cppflags="$cppflags $ccflags" ;;
5230 case "$gccversion" in
5231 1*) cppflags="$cppflags -D__GNUC__"
5233 case "$mips_type" in
5235 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5241 echo "Let me guess what the preprocessor flags are..." >&4
5255 *) ftry="$previous $flag";;
5257 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5258 >cpp1.out 2>/dev/null && \
5259 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5260 >cpp2.out 2>/dev/null && \
5261 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5262 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5264 cppflags="$cppflags $ftry"
5274 *-*) echo "They appear to be: $cppflags";;
5276 $rm -f cpp.c cpp?.out
5280 : flags used in final linking phase
5282 '') if ./venix; then
5288 *-posix*) dflt="$dflt -posix" ;;
5291 *) dflt="$ldflags";;
5293 # See note above about -fstack-protector
5295 *-fstack-protector*)
5297 *-fstack-protector*) ;; # Don't add it again
5298 *) dflt="$dflt -fstack-protector" ;;
5303 : Try to guess additional flags to pick up local libraries.
5304 for thislibdir in $libpth; do
5305 case " $loclibpth " in
5308 *"-L$thislibdir "*) ;;
5309 *) dflt="$dflt -L$thislibdir" ;;
5321 Your C linker may need flags. For this question you should
5322 include -L/whatever and any other flags used by the C linker, but you
5323 should NOT include libraries like -lwhatever.
5325 Make sure you include the appropriate -L/path flags if your C linker
5326 does not normally search all of the directories you specified above,
5329 To use no flags, specify the word "none".
5333 rp="Any additional ld flags (NOT including libraries)?"
5339 rmlist="$rmlist pdp11"
5343 echo "Checking your choice of C compiler and flags for coherency..." >&4
5344 $cat > try.c <<'EOF'
5346 int main() { printf("Ok\n"); return(0); }
5348 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5350 $cat >try.msg <<'EOM'
5351 I've tried to compile and run the following simple program:
5354 $cat try.c >> try.msg
5356 $cat >> try.msg <<EOM
5363 and I got the following output:
5367 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5368 if $sh -c "$run ./try " >>try.msg 2>&1; then
5372 *) echo 'The program compiled OK, but produced no output.' >> try.msg
5375 cat >> try.msg <<'EOQS'
5376 If $libs contains -lsfio, and sfio is mis-configured, then it
5377 sometimes (apparently) runs and exits with a 0 status, but with no
5378 output! It may have to do with sfio's use of _exit vs. exit.
5381 rp="You have a big problem. Shall I abort Configure"
5388 echo "The program compiled OK, but exited with status $?." >>try.msg
5389 rp="You have a problem. Shall I abort Configure"
5393 echo "I can't compile the test program." >>try.msg
5394 rp="You have a BIG problem. Shall I abort Configure"
5400 case "$knowitall" in
5402 echo "(The supplied flags or libraries might be incorrect.)"
5410 *) echo "Ok. Stopping Configure." >&4
5415 n) echo "OK, that should do.";;
5417 $rm_try gcctest gcctest.out
5419 : define a shorthand compile call
5423 case "$usedevel" in $define|true|[yY]*) if $test ! -f "${mc_file}.c"; then
5424 echo "Internal Configure script bug - compiler test file ${mc_file}.c is missing. Please report this to perlbug@perl.org" >&4;
5428 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5429 : define a shorthand compile call for compilations that should be ok.
5433 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5435 : determine filename position in cpp output
5437 echo "Computing filename position in cpp output for #include directives..." >&4
5439 vos) testaccess=-e ;;
5442 echo '#include <stdio.h>' > foo.c
5445 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5446 $grep '^[ ]*#.*stdio\.h' | \
5447 while read cline; do
5450 while $test \$# -gt 0; do
5451 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5456 pos=\`expr \$pos + 1\`
5468 *) pos="${fieldn}th";;
5470 echo "Your cpp writes the filename in the $pos field of the line."
5473 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
5474 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
5477 : locate header file
5482 for usrincdir in $usrinc
5484 if test -f \$usrincdir/\$wanted; then
5485 echo "\$usrincdir/\$wanted"
5489 awkprg='{ print \$$fieldn }'
5490 echo "#include <\$wanted>" > foo\$\$.c
5491 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5492 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5493 while read cline; do
5494 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5496 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5497 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5502 # status = 0: grep returned 0 lines, case statement not executed
5503 # status = 1: headerfile found
5504 # status = 2: while loop executed, no headerfile found
5508 if test \$status -eq 1; then
5515 : define an alternate in-header-list? function
5516 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5517 cont=true; xxf="echo \"<\$1> found.\" >&4";
5518 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5519 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5521 case $# in 4) instead=instead;; *) instead="at last";; esac;
5522 while $test "$cont"; do
5524 var=$2; eval "was=\$$2";
5525 if $test "$xxx" && $test -r "$xxx";
5527 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5530 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5531 set $yyy; shift; shift; yyy=$@;
5532 case $# in 0) cont="";;
5533 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5534 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5535 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5536 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5540 do set $yyy; var=$2; eval "was=\$$2";
5541 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5542 set $yyy; shift; shift; yyy=$@;
5545 : see if stdlib is available
5546 set stdlib.h i_stdlib
5549 : check for lengths of integral types
5553 echo "Checking to see how big your integers are..." >&4
5562 printf("intsize=%d;\n", (int)sizeof(int));
5563 printf("longsize=%d;\n", (int)sizeof(long));
5564 printf("shortsize=%d;\n", (int)sizeof(short));
5569 if eval $compile_ok && $run ./try > /dev/null; then
5571 echo "Your integers are $intsize bytes long."
5572 echo "Your long integers are $longsize bytes long."
5573 echo "Your short integers are $shortsize bytes long."
5577 Help! I can't compile and run the intsize test program: please enlighten me!
5578 (This is probably a misconfiguration in your system or libraries, and
5579 you really ought to fix it. Still, I'll try anyway.)
5583 rp="What is the size of an integer (in bytes)?"
5587 rp="What is the size of a long integer (in bytes)?"
5591 rp="What is the size of a short integer (in bytes)?"
5599 : check for long long
5601 echo "Checking to see if you have long long..." >&4
5602 echo 'int main() { long long x = 7; return 0; }' > try.c
5604 if eval $compile; then
5606 echo "You have long long."
5609 echo "You do not have long long."
5615 : check for length of long long
5616 case "${d_longlong}${longlongsize}" in
5619 echo "Checking to see how big your long longs are..." >&4
5620 $cat >try.c <<'EOCP'
5624 printf("%d\n", (int)sizeof(long long));
5629 if eval $compile_ok; then
5630 longlongsize=`$run ./try`
5631 echo "Your long longs are $longlongsize bytes long."
5635 echo "(I can't seem to compile the test program. Guessing...)"
5636 rp="What is the size of a long long (in bytes)?"
5640 if $test "X$longsize" = "X$longlongsize"; then
5641 echo "(That isn't any different from an ordinary long.)"
5647 : see if inttypes.h is available
5648 : we want a real compile instead of Inhdr because some systems
5649 : have an inttypes.h which includes non-existent headers
5652 #include <inttypes.h>
5654 static int32_t foo32 = 0x12345678;
5658 if eval $compile; then
5659 echo "<inttypes.h> found." >&4
5662 echo "<inttypes.h> NOT found." >&4
5671 echo "Checking to see if you have int64_t..." >&4
5673 #include <sys/types.h>
5674 #$i_inttypes I_INTTYPES
5676 #include <inttypes.h>
5678 int main() { int64_t x = 7; }
5681 if eval $compile; then
5683 echo "You have int64_t."
5686 echo "You do not have int64_t."
5692 : Check if 64bit ints have a quad type
5694 echo "Checking which 64-bit integer type we could use..." >&4
5700 val='"unsigned int"'
5705 *) case "$longsize" in
5709 val='"unsigned long"'
5714 *) case "$d_longlong:$longlongsize" in
5719 val='"unsigned long long"'
5724 *) case "$d_int64_t" in
5743 '') echo "Alas, no 64-bit integer types in sight." >&4
5746 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5751 : Do we want 64bit support
5752 case "$uselonglong" in
5753 "$define"|true|[yY]*)
5756 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5758 use64bitint="$define"
5761 case "$use64bits" in
5762 "$define"|true|[yY]*)
5765 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5767 use64bitint="$define"
5770 case "$use64bitints" in
5771 "$define"|true|[yY]*)
5774 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5776 use64bitint="$define"
5779 case "$use64bitsint" in
5780 "$define"|true|[yY]*)
5783 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5785 use64bitint="$define"
5788 case "$uselonglongs" in
5789 "$define"|true|[yY]*)
5792 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5794 use64bitint="$define"
5797 case "$use64bitsall" in
5798 "$define"|true|[yY]*)
5801 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
5803 use64bitall="$define"
5808 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
5810 case "$use64bitall" in
5811 "$define"|true|[yY]*) use64bitint="$define" ;;
5817 You have natively 64-bit long integers.
5821 *) case "$use64bitint" in
5822 "$define"|true|[yY]*) dflt='y';;
5831 Perl can be built to take advantage of 64-bit integer types
5832 on some systems. To do so, Configure can be run with -Duse64bitint.
5833 Choosing this option will most probably introduce binary incompatibilities.
5835 If this doesn't make any sense to you, just accept the default '$dflt'.
5836 (The default has been chosen based on your configuration.)
5838 rp='Try to use 64-bit integers, if available?'
5841 [yY]*) val="$define" ;;
5849 case "$use64bitall" in
5850 "$define"|true|[yY]*) dflt='y' ;;
5851 *) case "$longsize" in
5859 You may also choose to try maximal 64-bitness. It means using as much
5860 64-bitness as possible on the platform. This in turn means even more
5861 binary incompatibilities. On the other hand, your platform may not
5862 have any more 64-bitness available than what you already have chosen.
5864 If this doesn't make any sense to you, just accept the default '$dflt'.
5865 (The default has been chosen based on your configuration.)
5867 rp='Try to use maximal 64-bit support, if available?'
5870 [yY]*) val="$define" ;;
5875 case "$use64bitall" in
5877 case "$use64bitint" in
5881 Since you have chosen a maximally 64-bit build, I'm also turning on
5882 the use of 64-bit integers.
5884 use64bitint="$define" ;;
5889 : Look for a hint-file generated 'call-back-unit'. If the
5890 : user has specified that a 64-bit perl is to be built,
5891 : we may need to set or change some other defaults.
5892 if $test -f use64bitint.cbu; then
5893 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
5896 case "$use64bitint" in
5897 "$define"|true|[yY]*)
5899 4) case "$archname64" in
5900 '') archname64=64int ;;
5907 : Look for a hint-file generated 'call-back-unit'. If the
5908 : user has specified that a maximally 64-bit perl is to be built,
5909 : we may need to set or change some other defaults.
5910 if $test -f use64bitall.cbu; then
5911 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
5914 case "$use64bitall" in
5915 "$define"|true|[yY]*)
5917 4) case "$archname64" in
5918 ''|64int) archname64=64all ;;
5925 case "$d_quad:$use64bitint" in
5929 *** You have chosen to use 64-bit integers,
5930 *** but none can be found.
5931 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
5932 *** Cannot continue, aborting.
5939 : check for length of double
5941 case "$doublesize" in
5943 echo "Checking to see how big your double precision numbers are..." >&4
5952 printf("%d\n", (int)sizeof(double));
5957 if eval $compile_ok; then
5958 doublesize=`$run ./try`
5959 echo "Your double is $doublesize bytes long."
5962 echo "(I can't seem to compile the test program. Guessing...)"
5963 rp="What is the size of a double precision number (in bytes)?"
5971 : check for long doubles
5973 echo "Checking to see if you have long double..." >&4
5974 echo 'int main() { long double x = 7.0; }' > try.c
5976 if eval $compile; then
5978 echo "You have long double."
5981 echo "You do not have long double."
5987 : check for length of long double
5988 case "${d_longdbl}${longdblsize}" in
5991 echo "Checking to see how big your long doubles are..." >&4
5992 $cat >try.c <<'EOCP'
5996 printf("%d\n", sizeof(long double));
6001 if eval $compile; then
6002 longdblsize=`$run ./try`
6003 echo "Your long doubles are $longdblsize bytes long."
6007 echo "(I can't seem to compile the test program. Guessing...)" >&4
6008 rp="What is the size of a long double (in bytes)?"
6012 if $test "X$doublesize" = "X$longdblsize"; then
6013 echo "That isn't any different from an ordinary double."
6014 echo "I'll keep your setting anyway, but you may see some"
6015 echo "harmless compilation warnings."
6021 : determine the architecture name
6023 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
6024 tarch=`arch`"-$osname"
6025 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
6026 if uname -m > tmparch 2>&1 ; then
6027 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
6028 -e 's/$/'"-$osname/" tmparch`
6036 case "$myarchname" in
6039 echo "(Your architecture name used to be $myarchname.)"
6043 case "$targetarch" in
6045 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
6050 *) dflt="$archname";;
6052 rp='What is your architecture name'
6055 case "$usethreads" in
6057 echo "Threads selected." >&4
6059 *-thread*) echo "...and architecture name already has -thread." >&4
6061 *) archname="$archname-thread"
6062 echo "...setting architecture name to $archname." >&4
6067 case "$usemultiplicity" in
6069 echo "Multiplicity selected." >&4
6071 *-multi*) echo "...and architecture name already has -multi." >&4
6073 *) archname="$archname-multi"
6074 echo "...setting architecture name to $archname." >&4
6079 case "$use64bitint$use64bitall" in
6081 case "$archname64" in
6083 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
6086 case "$use64bitint" in
6087 "$define") echo "64 bit integers selected." >&4 ;;
6089 case "$use64bitall" in
6090 "$define") echo "Maximal 64 bitness selected." >&4 ;;
6093 *-$archname64*) echo "...and architecture name already has $archname64." >&4
6095 *) archname="$archname-$archname64"
6096 echo "...setting architecture name to $archname." >&4
6102 case "$uselongdouble" in
6104 echo "Long doubles selected." >&4
6105 case "$longdblsize" in
6107 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
6111 *-ld*) echo "...and architecture name already has -ld." >&4
6113 *) archname="$archname-ld"
6114 echo "...setting architecture name to $archname." >&4
6121 case "$useperlio" in
6123 echo "Perlio selected." >&4
6126 echo "Perlio not selected, using stdio." >&4
6128 *-stdio*) echo "...and architecture name already has -stdio." >&4
6130 *) archname="$archname-stdio"
6131 echo "...setting architecture name to $archname." >&4
6136 if $test -f archname.cbu; then
6137 echo "Your platform has some specific hints for architecture name, using them..."
6141 : set the prefixit variable, to compute a suitable default value
6142 prefixit='case "$3" in
6144 case "$oldprefix" in
6145 "") eval "$1=\"\$$2\"";;
6152 ""|" ") eval "$1=\"\$$2\"";;
6158 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
6160 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
6161 /*-$oldprefix/*|\~*-$oldprefix/*)
6162 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
6163 *) eval "$1=\"\$$2\"";;
6167 : determine installation style
6168 : For now, try to deduce it from prefix unless it is already set.
6169 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
6170 case "$installstyle" in
6171 '') case "$prefix" in
6172 *perl*) dflt='lib';;
6173 *) dflt='lib/perl5' ;;
6176 *) dflt="$installstyle" ;;
6178 : Probably not worth prompting for this since we prompt for all
6179 : the directories individually, and the prompt would be too long and
6183 : determine where public executables go
6188 rp='Pathname where the public executables will reside?'
6190 if $test "X$ansexp" != "X$binexp"; then
6194 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6195 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
6196 : this via initialinstalllocation
6199 case "$userelocatableinc" in
6200 $define|true|[yY]*) dflt='y' ;;
6205 Would you like to build Perl so that the installation is relocatable, so that
6206 library paths in @INC are determined relative to the path of the perl binary?
6207 This is not advised for system Perl installs, or if you need to run setid
6208 scripts or scripts under taint mode.
6210 If this doesn't make any sense to you, just accept the default '$dflt'.
6212 rp='Use relocatable @INC?'
6215 y|Y) val="$define" ;;
6218 set userelocatableinc
6221 initialinstalllocation="$binexp"
6222 : Default prefix is now "up one level from where the binaries are"
6223 case "$userelocatableinc" in
6229 installprefixexp=".../.."
6233 : determine where private library files go
6234 : Usual default is /usr/local/lib/perl5/$version.
6235 : Also allow things like /opt/perl/lib/$version, since
6236 : /opt/perl/lib/perl5... would be redundant.
6237 : The default "style" setting is made in installstyle.U
6238 case "$installstyle" in
6239 *lib/perl5*) set dflt privlib lib/$package/$version ;;
6240 *) set dflt privlib lib/$version ;;
6245 There are some auxiliary files for $package that need to be put into a
6246 private library directory that is accessible by everyone.
6251 rp='Pathname where the private library files will reside?'
6256 : set the prefixup variable, to restore leading tilda escape
6257 prefixup='case "$prefixexp" in
6259 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
6262 : determine where public architecture dependent libraries go
6265 : privlib default is /usr/local/lib/$package/$version
6266 : archlib default is /usr/local/lib/$package/$version/$archname
6267 : privlib may have an optional trailing /share.
6268 tdflt=`echo $privlib | $sed 's,/share$,,'`
6269 tdflt=$tdflt/$archname
6278 $spackage contains architecture-dependent library files. If you are
6279 sharing libraries in a heterogeneous environment, you might store
6280 these files in a separate location. Otherwise, you can just include
6281 them with the rest of the public library files.
6286 rp='Where do you want to put the public architecture-dependent libraries?'
6290 if $test X"$archlib" = X"$privlib"; then
6296 : see if setuid scripts can be secure
6299 Some kernels have a bug that prevents setuid #! scripts from being
6300 secure. Some sites have disabled setuid #! scripts because of this.
6302 First let's decide if your kernel supports secure setuid #! scripts.
6303 (If setuid #! scripts would be secure but have been disabled anyway,
6304 don't say that they are secure if asked.)
6309 if $test -d /dev/fd; then
6310 echo "#!$ls" >reflect
6311 chmod +x,u+s reflect
6312 ./reflect >flect 2>&1
6313 if $contains "/dev/fd" flect >/dev/null; then
6314 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6318 If you are not sure if they are secure, I can check but I'll need a
6319 username and password different from the one you are using right now.
6320 If you don't have such a username or don't want me to test, simply
6324 rp='Other username to test security of setuid scripts with?'
6329 case "$d_suidsafe" in
6330 '') echo "I'll assume setuid scripts are *not* secure." >&4
6333 echo "Well, the $hint value is *not* secure." >&4
6335 *) echo "Well, the $hint value *is* secure." >&4
6340 $rm -f reflect flect
6341 echo "#!$ls" >reflect
6342 chmod +x,u+s reflect
6345 echo '"su" will (probably) prompt you for '"$ans's password."
6346 su $ans -c './reflect >flect'
6347 if $contains "/dev/fd" flect >/dev/null; then
6348 echo "Okay, it looks like setuid scripts are secure." >&4
6351 echo "I don't think setuid scripts are secure." >&4
6356 rp='Does your kernel have *secure* setuid scripts?'
6359 [yY]*) val="$define";;
6364 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6365 echo "(That's for file descriptors, not floppy disks.)"
6371 $rm -f reflect flect
6373 : now see if they want to do setuid emulation
6374 if $test $patchlevel -lt 11; then
6377 case "$d_suidsafe" in
6380 echo "No need to emulate SUID scripts since they are secure here." >&4
6384 Some systems have disabled setuid scripts, especially systems where
6385 setuid scripts cannot be secure. On systems where setuid scripts have
6386 been disabled, the setuid/setgid bits on scripts are currently
6387 useless. It is possible for $package to detect those bits and emulate
6388 setuid/setgid in a secure fashion. This emulation will only work if
6389 setuid scripts have been disabled in your kernel.
6393 "$define") dflt=y ;;
6396 rp="Do you want to do setuid/setgid emulation?"
6399 [yY]*) val="$define";;
6411 SUID emulation has been removed for 5.12
6412 Please re-run Configure without -Dd_dosuid
6421 : Find perl5.005 or later.
6422 echo "Looking for a previously installed perl5.005 or later... "
6424 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
6425 : Check if this perl is recent and can load a simple module
6426 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6429 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6439 '') echo "None found. That's ok.";;
6440 *) echo "Using $perl5." ;;
6443 : Set the siteprefix variables
6446 After $package is installed, you may wish to install various
6447 add-on modules and utilities. Typically, these add-ons will
6448 be installed under $prefix with the rest
6449 of this package. However, you may wish to install such add-ons
6450 elsewhere under a different prefix.
6452 If you do not wish to put everything under a single prefix, that's
6453 ok. You will be prompted for the individual locations; this siteprefix
6454 is only used to suggest the defaults.
6456 The default should be fine for most people.
6460 rp='Installation prefix to use for add-on modules and utilities?'
6461 : XXX Here might be another good place for an installstyle setting.
6462 case "$siteprefix" in
6464 *) dflt=$siteprefix ;;
6467 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6469 case "$siteprefix" in
6473 *) oldsiteprefix="$prefix";;
6478 siteprefixexp="$ansexp"
6480 : determine where site specific libraries go.
6481 : Usual default is /usr/local/lib/perl5/site_perl/$version
6482 : The default "style" setting is made in installstyle.U
6483 : XXX No longer works with Prefixit stuff.
6484 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6486 '') case "$installstyle" in
6487 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6488 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6496 The installation process will create a directory for
6497 site-specific extensions and modules. Most users find it convenient
6498 to place all site-specific files in this directory rather than in the
6499 main distribution directory.
6503 rp='Pathname for the site-specific library files?'
6507 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6509 : Determine list of previous versions to include in @INC
6510 $cat > getverlist <<EOPL
6513 \$api_versionstring = "$api_versionstring";
6514 \$version = "$version";
6515 \$stem = "$sitelib_stem";
6516 \$archname = "$archname";
6518 $cat >> getverlist <<'EOPL'
6519 # The list found is store twice for each entry: the original name, and
6520 # the binary broken down version as pack "sss", so sorting is easy and
6521 # unambiguous. This will work for all versions that have a maximum of
6522 # three digit groups, separate by '.'s or '_'s. Names are extended with
6523 # ".0.0" to ensure at least three elements for the pack.
6524 # -- H.Merijn Brand (m)'06 23-10-2006
6526 # Can't have leading @ because metaconfig interprets it as a command!
6527 ;@inc_version_list=();
6528 # XXX Redo to do opendir/readdir?
6531 ;@candidates = map {
6532 [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
6538 ($pversion, $aversion, $vsn5005) = map {
6539 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
6540 foreach $d (@candidates) {
6541 if ($d->[1] lt $pversion) {
6542 if ($d->[1] ge $aversion) {
6543 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
6545 elsif ($d->[1] ge $vsn5005) {
6546 unshift(@inc_version_list, grep { -d } $d->[0]);
6550 # Skip newer version. I.e. don't look in
6551 # 5.7.0 if we're installing 5.6.1.
6555 if (@inc_version_list) {
6556 print join(' ', @inc_version_list);
6559 # Blank space to preserve value for next Configure run.
6564 case "$inc_version_list" in
6565 '') if test -x "$perl5$exe_ext"; then
6566 dflt=`$perl5 getverlist`
6571 $undef) dflt='none' ;;
6572 *) eval dflt=\"$inc_version_list\" ;;
6575 ''|' ') dflt=none ;;
6582 In order to ease the process of upgrading, this version of perl
6583 can be configured to use modules built and installed with earlier
6584 versions of perl that were installed under $prefix. Specify here
6585 the list of earlier versions that this version of perl should check.
6586 If Configure detected no earlier versions of perl installed under
6587 $prefix, then the list will be empty. Answer 'none' to tell perl
6588 to not search earlier versions.
6590 The default should almost always be sensible, so if you're not sure,
6591 just accept the default.
6594 rp='List of earlier versions to include in @INC?'
6597 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
6598 *) inc_version_list="$ans" ;;
6600 case "$inc_version_list" in
6602 inc_version_list_init='0'
6603 d_inc_version_list="$undef"
6605 *) inc_version_list_init=`echo $inc_version_list |
6606 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6607 d_inc_version_list="$define"
6612 : see if malloc/malloc.h has to be included
6613 set malloc/malloc.h i_mallocmalloc
6616 : see if this is a malloc.h system
6617 : we want a real compile instead of Inhdr because some systems have a
6618 : malloc.h that just gives a compile error saying to use stdlib.h instead
6623 #$i_mallocmalloc I_MALLOCMALLOC
6624 #ifdef I_MALLOCMALLOC
6625 # include <malloc/malloc.h>
6628 int main () { return 0; }
6631 if eval $compile; then
6632 echo "<malloc.h> found." >&4
6635 echo "<malloc.h> NOT found." >&4
6642 : check for void type
6644 echo "Checking to see how well your C compiler groks the void type..." >&4
6645 case "$voidflags" in
6657 extern void moo(); /* function returning void */
6658 void (*goo)(); /* ptr to func returning void */
6660 void *hue; /* generic ptr */
6673 int main() { sub(); }
6675 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
6676 voidflags=$defvoidused
6677 echo "Good. It appears to support void to the level $package wants.">&4
6678 if $contains warning .out >/dev/null 2>&1; then
6679 echo "However, you might get some warnings that look like this:"
6683 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
6684 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
6685 echo "It supports 1..."
6686 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
6687 echo "It also supports 2..."
6688 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
6690 echo "And it supports 4 but not 8 definitely."
6692 echo "It doesn't support 4..."
6693 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
6695 echo "But it supports 8."
6698 echo "Neither does it support 8."
6702 echo "It does not support 2..."
6703 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
6705 echo "But it supports 4 and 8."
6707 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
6709 echo "And it supports 4 but has not heard about 8."
6711 echo "However it supports 8 but not 4."
6716 echo "There is no support at all for void."
6721 case "$voidflags" in
6724 Support flag bits are:
6725 1: basic void declarations.
6726 2: arrays of pointers to functions returning void.
6727 4: operations between pointers to and addresses of void functions.
6728 8: generic void pointers.
6731 rp="Your void support flags add up to what?"
6738 : check for length of pointer
6742 echo "Checking to see how big your pointers are..." >&4
6743 if test "$voidflags" -gt 7; then
6744 echo '#define VOID_PTR char *' > try.c
6746 echo '#define VOID_PTR void *' > try.c
6756 printf("%d\n", (int)sizeof(VOID_PTR));
6761 if eval $compile_ok; then
6762 ptrsize=`$run ./try`
6763 echo "Your pointers are $ptrsize bytes long."
6766 echo "(I can't seem to compile the test program. Guessing...)" >&4
6767 rp="What is the size of a pointer (in bytes)?"
6774 case "$use64bitall" in
6775 "$define"|true|[yY]*)
6779 *** You have chosen a maximally 64-bit build,
6780 *** but your pointers are only 4 bytes wide.
6781 *** Please rerun Configure without -Duse64bitall.
6786 *** Since you have quads, you could possibly try with -Duse64bitint.
6791 *** Cannot continue, aborting.
6802 : determine whether to use malloc wrapping
6804 case "$usemallocwrap" in
6805 [yY]*|true|$define) dflt='y' ;;
6806 [nN]*|false|$undef) dflt='n' ;;
6807 *) case "$usedevel" in
6808 [yY]*|true|$define) dflt='y' ;;
6813 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
6815 usemallocwrap="$ans"
6818 usemallocwrap="$define" ;;
6820 usemallocwrap="$undef" ;;
6823 : determine which malloc to compile in
6825 case "$usemymalloc" in
6826 [yY]*|true|$define) dflt='y' ;;
6827 [nN]*|false|$undef) dflt='n' ;;
6828 *) case "$ptrsize" in
6834 rp="Do you wish to attempt to use the malloc that comes with $package?"
6840 mallocsrc='malloc.c'
6841 mallocobj="malloc$_o"
6842 d_mymalloc="$define"
6845 : Remove malloc from list of libraries to use
6846 echo "Removing unneeded -lmalloc from library list" >&4
6847 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6850 echo "libs = $libs" >&4
6862 : compute the return types of malloc and free
6864 $cat >malloc.c <<END
6868 #include <sys/types.h>
6882 case "$malloctype" in
6884 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6891 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6895 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6902 echo "Your system uses $freetype free(), it would seem." >&4
6904 : determine where site specific architecture-dependent libraries go.
6905 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6906 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6907 : sitelib may have an optional trailing /share.
6909 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6910 dflt="$dflt/$archname"
6915 set sitearch sitearch none
6919 The installation process will also create a directory for
6920 architecture-dependent site-specific extensions and modules.
6924 rp='Pathname for the site-specific architecture-dependent library files?'
6928 if $test X"$sitearch" = X"$sitelib"; then
6931 d_sitearch="$define"
6934 : Set the vendorprefix variables
6937 The installation process will also create a directory for
6938 vendor-supplied add-ons. Vendors who supply perl with their system
6939 may find it convenient to place all vendor-supplied files in this
6940 directory rather than in the main distribution directory. This will
6941 ease upgrades between binary-compatible maintenance versions of perl.
6943 Of course you may also use these directories in whatever way you see
6944 fit. For example, you might use them to access modules shared over a
6945 company-wide network.
6947 The default answer should be fine for most people.
6948 This causes further questions about vendor add-ons to be skipped
6949 and no vendor-specific directories will be configured for perl.
6952 rp='Do you want to configure vendor-specific add-on directories?'
6953 case "$usevendorprefix" in
6954 define|true|[yY]*) dflt=y ;;
6955 *) : User may have set vendorprefix directly on Configure command line.
6956 case "$vendorprefix" in
6965 rp='Installation prefix to use for vendor-supplied add-ons?'
6966 case "$vendorprefix" in
6968 *) dflt=$vendorprefix ;;
6971 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6973 case "$vendorprefix" in
6977 *) oldvendorprefix="$prefix";;
6981 usevendorprefix="$define"
6983 vendorprefixexp="$ansexp"
6985 *) usevendorprefix="$undef"
6991 : Set the vendorlib variables
6992 case "$vendorprefix" in
6993 '') d_vendorlib="$undef"
6997 *) d_vendorlib="$define"
6998 : determine where vendor-supplied modules go.
6999 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
7000 case "$vendorlib" in
7002 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7003 case "$installstyle" in
7004 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
7005 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
7008 *) dflt="$vendorlib"
7012 rp='Pathname for the vendor-supplied library files?'
7015 vendorlibexp="$ansexp"
7018 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
7022 : Set the vendorarch variables
7023 case "$vendorprefix" in
7024 '') d_vendorarch="$undef"
7028 *) d_vendorarch="$define"
7029 : determine where vendor-supplied architecture-dependent libraries go.
7030 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
7031 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
7032 : vendorlib may have an optional trailing /share.
7033 case "$vendorarch" in
7034 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
7035 dflt="$dflt/$archname"
7037 *) dflt="$vendorarch" ;;
7040 rp='Pathname for vendor-supplied architecture-dependent files?'
7043 vendorarchexp="$ansexp"
7046 prefixvar=vendorarch
7048 if $test X"$vendorarch" = X"$vendorlib"; then
7049 d_vendorarch="$undef"
7051 d_vendorarch="$define"
7054 : Final catch-all directories to search
7057 Lastly, you can have perl look in other directories for extensions and
7058 modules in addition to those already specified.
7059 These directories will be searched after
7063 test X"$vendorlib" != "X" && echo ' ' $vendorlib
7064 test X"$vendorarch" != "X" && echo ' ' $vendorarch
7066 case "$otherlibdirs" in
7067 ''|' ') dflt='none' ;;
7068 *) dflt="$otherlibdirs" ;;
7071 Enter a colon-separated set of extra paths to include in perl's @INC
7072 search path, or enter 'none' for no extra paths.
7076 rp='Colon-separated list of additional directories for perl to search?'
7079 ' '|''|none) otherlibdirs=' ' ;;
7080 *) otherlibdirs="$ans" ;;
7082 case "$otherlibdirs" in
7086 set d_perl_otherlibdirs
7089 : Cruising for prototypes
7091 echo "Checking out function prototypes..." >&4
7092 $cat >prototype.c <<EOCP
7097 int main(int argc, char *argv[]) {
7100 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
7101 echo "Your C compiler appears to support function prototypes."
7104 echo "Your C compiler doesn't seem to understand function prototypes."
7111 : Check if ansi2knr is required
7112 case "$prototype" in
7114 *) ansi2knr='ansi2knr'
7119 This version of $package can only be compiled by a compiler that
7120 understands function prototypes. Unfortunately, your C compiler
7122 doesn't seem to understand them. Sorry about that.
7124 If GNU cc is available for your system, perhaps you could try that instead.
7126 Eventually, we hope to support building Perl with pre-ANSI compilers.
7127 If you would like to help in that effort, please contact <perlbug@perl.org>.
7129 Aborting Configure now.
7136 dflt_dtrace='/usr/sbin/dtrace'
7139 Perl can be built to support DTrace on platforms that support it.
7140 DTrace is a diagnosis and performance analysis tool from Sun.
7142 If this doesn't make any sense to you, just accept the default '$dflt'.
7146 case "$usedtrace" in
7152 dflt_dtrace=$usedtrace
7159 rp='Support DTrace if available?'
7162 y|Y) val="$define" ;;
7168 test "X$usedtrace" != "X$define" && break
7171 rp='Where is the dtrace executable?'
7180 if $dtrace -h -s ../perldtrace.d \
7181 -o perldtrace.tmp >/dev/null 2>&1 \
7182 && rm -f perldtrace.tmp
7185 echo "Good: your $dtrace knows about the -h flag."
7189 *** $me: Fatal Error: $dtrace doesn't support -h flag
7191 *** Your installed dtrace doesn't support the -h switch to compile a D
7192 *** program into a C header. Can't continue.
7204 *** $me: Fatal Error: $dtrace not found.
7211 echo "*** $dtrace was not found."
7217 : See if we want extra modules installed
7224 Perl can be built with extra modules or bundles of modules which
7225 will be fetched from the CPAN and installed alongside Perl.
7227 Notice that you will need access to the CPAN; either via the Internet,
7228 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
7229 be asked later to configure the CPAN.pm module which will in turn do
7230 the installation of the rest of the extra modules or bundles.)
7232 Notice also that if the modules require any external software such as
7233 libraries and headers (the libz library and the zlib.h header for the
7234 Compress::Zlib module, for example) you MUST have any such software
7235 already installed, this configuration process will NOT install such
7238 If this doesn't make any sense to you, just accept the default '$dflt'.
7240 rp='Install any extra modules (y or n)?'
7246 Please list any extra modules or bundles to be installed from CPAN,
7247 with spaces between the names. The names can be in any format the
7248 'install' command of CPAN.pm will understand. (Answer 'none',
7249 without the quotes, to install no extra modules or bundles.)
7259 $rm -f ../extras.lst
7261 *) echo "(Saving the list of extras for later...)"
7262 echo "$extras" > ../extras.lst
7270 : determine where html pages for programs go
7271 set html1dir html1dir none
7275 If you wish to install html files for programs in $spackage, indicate
7276 the appropriate directory here. To skip installing html files,
7280 ''|none|$undef|' ') dflt=none ;;
7281 *) dflt=$html1dir ;;
7284 rp="Directory for the main $spackage html pages?"
7288 : Use ' ' for none so value is preserved next time through Configure
7289 $test X"$html1dir" = "X" && html1dir=' '
7291 : determine where html pages for libraries and modules go
7292 set html3dir html3dir none
7296 If you wish to install html files for modules associated with $spackage,
7297 indicate the appropriate directory here. To skip installing html files,
7300 : There is no obvious default. If they have specified html1dir, then
7301 : try to key off that, possibly changing .../html1 into .../html3.
7303 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
7304 *) dflt=$html3dir ;;
7307 rp="Directory for the $spackage module html pages?"
7311 : Use ' ' for none so value is preserved next time through Configure
7312 $test X"$html3dir" = "X" && html3dir=' '
7314 : determine whether to install perl also as /usr/bin/perl
7317 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
7319 Many scripts expect perl to be installed as /usr/bin/perl.
7321 If you want to, I can install the perl you are about to compile
7322 as /usr/bin/perl (in addition to $bin/perl).
7324 if test -f /usr/bin/perl; then
7327 However, please note that because you already have a /usr/bin/perl,
7328 overwriting that with a new Perl would very probably cause problems.
7329 Therefore I'm assuming you don't want to do that (unless you insist).
7332 case "$installusrbinperl" in
7333 "$define"|[yY]*) dflt='y';;
7339 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
7342 case "$installusrbinperl" in
7343 "$undef"|[nN]*) dflt='n';;
7347 rp="Do you want to install perl as /usr/bin/perl?"
7350 [yY]*) val="$define";;
7356 set installusrbinperl
7359 : Check if we are using the GNU C library
7361 echo "Checking for GNU C Library..." >&4
7363 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
7364 alone are insufficient to distinguish different versions, such as
7365 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
7366 libc version 2.1.0. A. Dougherty, June 3, 2002.
7372 # ifdef __GLIBC_MINOR__
7373 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
7374 # include <gnu/libc-version.h>
7375 printf("%s\n", gnu_get_libc_version());
7377 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
7380 printf("%d\n", __GLIBC__);
7389 if eval $compile_ok && $run ./try > glibc.ver; then
7391 gnulibc_version=`$cat glibc.ver`
7392 echo "You are using the GNU C Library version $gnulibc_version"
7396 echo "You are not using the GNU C Library"
7402 : see if nm is to be used to determine whether a symbol is defined or not
7406 case "$d_gnulibc" in
7409 echo "nm probably won't work on the GNU C Library." >&4
7415 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
7417 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
7418 echo "'nm' won't be sufficient on this sytem." >&4
7424 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
7425 if $test $dflt -gt 20; then
7435 true|$define) dflt=y;;
7442 I can use $nm to extract the symbols from your C libraries. This
7443 is a time consuming task which may generate huge output on the disk (up
7444 to 3 megabytes) but that should make the symbols extraction faster. The
7445 alternative is to skip the 'nm' extraction part and to compile a small
7446 test program instead to determine whether each symbol is present. If
7447 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
7448 this may be the best solution.
7450 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
7453 rp="Shall I use $nm to extract C symbols from the libraries?"
7456 [Nn]*) usenm=false;;
7465 : nm options which may be necessary
7467 '') if $test -f /mach_boot; then
7469 elif $test -d /usr/ccs/lib; then
7470 nm_opt='-p' # Solaris (and SunOS?)
7471 elif $test -f /dgux; then
7473 elif $test -f /lib64/rld; then
7474 nm_opt='-p' # 64-bit Irix
7480 : nm options which may be necessary for shared libraries but illegal
7481 : for archive libraries. Thank you, Linux.
7482 case "$nm_so_opt" in
7483 '') case "$myuname" in
7485 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
7486 nm_so_opt='--dynamic'
7493 : Figure out where the libc is located
7496 : get list of predefined functions in a handy place
7501 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
7507 *) for thislib in $libs; do
7510 : Handle C library specially below.
7513 thislib=`echo $thislib | $sed -e 's/^-l//'`
7514 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
7516 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
7518 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
7520 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
7522 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
7524 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
7526 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
7531 libnames="$libnames $try"
7533 *) libnames="$libnames $thislib" ;;
7542 for xxx in $libpth; do
7543 $test -r $1 || set $xxx/libc.$so
7544 : The messy sed command sorts on library version numbers.
7546 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
7547 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
7549 s/[0-9][0-9]*/0000&/g
7550 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
7553 $sort | $sed -e 's/^.* //'`
7556 $test -r $1 || set /usr/ccs/lib/libc.$so
7557 $test -r $1 || set /lib/libsys_s$_a
7563 if $test -r "$1"; then
7564 echo "Your (shared) C library seems to be in $1."
7566 elif $test -r /lib/libc && $test -r /lib/clib; then
7567 echo "Your C library seems to be in both /lib/clib and /lib/libc."
7569 libc='/lib/clib /lib/libc'
7570 if $test -r /lib/syslib; then
7571 echo "(Your math library is in /lib/syslib.)"
7572 libc="$libc /lib/syslib"
7574 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7575 echo "Your C library seems to be in $libc, as you said before."
7576 elif $test -r $incpath/usr/lib/libc$_a; then
7577 libc=$incpath/usr/lib/libc$_a;
7578 echo "Your C library seems to be in $libc. That's fine."
7579 elif $test -r /lib/libc$_a; then
7581 echo "Your C library seems to be in $libc. You're normal."
7583 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
7585 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
7586 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
7587 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
7589 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7591 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7594 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
7596 if $test -r "$tans"; then
7597 echo "Your C library seems to be in $tans, of all places."
7603 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7607 If the guess above is wrong (which it might be if you're using a strange
7608 compiler, or your machine supports multiple models), you can override it here.
7613 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
7615 I can't seem to find your C library. I've looked in the following places:
7618 $sed 's/^/ /' libpath
7621 None of these seems to contain your C library. I need to get its name...
7626 rp='Where is your C library?'
7631 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
7632 set X `cat libnames`
7635 case $# in 1) xxx=file; esac
7636 echo "Extracting names from the following $xxx for later perusal:" >&4
7638 $sed 's/^/ /' libnames >&4
7640 $echo $n "This may take a while...$c" >&4
7644 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
7645 *) $nm $nm_opt $file 2>/dev/null;;
7650 $grep fprintf libc.tmp > libc.ptf
7651 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
7652 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
7654 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
7656 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7658 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
7660 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7662 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
7664 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7666 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
7668 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7670 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
7672 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7674 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
7676 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7678 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
7679 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
7681 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7683 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
7685 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7687 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
7689 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7691 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
7693 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7695 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
7697 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7699 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
7701 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7703 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
7705 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7707 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
7709 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7712 $nm -p $* 2>/dev/null >libc.tmp
7713 $grep fprintf libc.tmp > libc.ptf
7714 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
7715 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
7721 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
7723 if $ar t $libc > libc.tmp && \
7724 $contains '^fprintf$' libc.tmp >/dev/null 2>&1
7726 for thisname in $libnames $libc; do
7727 $ar t $thisname >>libc.tmp
7729 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
7731 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
7732 for thisname in $libnames $libc; do
7733 $ar tv $thisname >>libc.tmp
7734 emximp -o tmp.imp $thisname \
7736 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
7737 < tmp.imp >>libc.tmp
7740 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
7743 echo "$ar didn't seem to work right." >&4
7744 echo "Maybe this is a Cray...trying bld instead..." >&4
7746 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list &&
7749 for thisname in $libnames; do
7751 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
7752 $ar t $thisname >>libc.tmp
7756 echo "That didn't work either. Giving up." >&4
7766 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
7767 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
7769 *) if $test -f /lib/syscalls.exp; then
7771 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
7772 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' \
7773 /lib/syscalls.exp >>libc.list
7779 $rm -f libnames libpath
7781 : see if dld is available
7785 : Check if we are using C++
7787 echo "Checking for C++..." >&4
7788 $cat >try.c <<'EOCP'
7800 if eval $compile_ok && $run ./try; then
7802 echo "You are using a C++ compiler."
7805 echo "You are not using a C++ compiler."
7811 : is a C symbol defined?
7814 -v) tf=libc.tmp; tdc="";;
7815 -a) tf=libc.tmp; tdc="[]";;
7816 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
7818 case "$d_cplusplus" in
7819 $define) extern_C="extern \"C\"" ;;
7820 *) extern_C="extern" ;;
7823 case "$reuseval-$4" in
7825 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
7830 if $test "$runnm" = true; then
7831 if $contains $tlook $tf >/dev/null 2>&1; then
7833 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
7834 echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7835 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
7836 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
7840 echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7841 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
7847 $define) tval=true;;
7854 : define an is-in-libc? function
7855 inlibc='echo " "; td=$define; tu=$undef;
7856 sym=$1; var=$2; eval "was=\$$2";
7858 case "$reuseval$was" in
7868 echo "$sym() found." >&4;
7869 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
7871 echo "$sym() NOT found." >&4;
7872 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
7876 $define) echo "$sym() found." >&4;;
7877 *) echo "$sym() NOT found." >&4;;
7881 : see if dlopen exists
7883 xxx_ccflags="$ccflags"
7885 : with g++ one needs -shared to get is-in-libc to work for dlopen
7886 case "$gccversion" in
7888 *) case "$d_cplusplus" in
7889 "$define") ccflags="$ccflags -shared" ;;
7896 ccflags="$xxx_ccflags"
7898 : see if this is a unistd.h system
7899 set unistd.h i_unistd
7902 : determine which dynamic loading, if any, to compile in
7904 dldir="ext/DynaLoader"
7917 $define) dflt='y' ;;
7920 $define) dflt='y' ;;
7922 : Does a dl_xxx.xs file exist for this operating system
7923 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
7926 rp="Do you wish to use dynamic loading?"
7934 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
7935 dflt="$dldir/dl_${osname}.xs"
7936 elif $test "$d_dlopen" = "$define" ; then
7937 dflt="$dldir/dl_dlopen.xs"
7938 elif $test "$i_dld" = "$define" ; then
7939 dflt="$dldir/dl_dld.xs"
7944 *) dflt="$dldir/$dlsrc"
7947 echo "The following dynamic loading files are available:"
7948 : Can not go over to $dldir because getfile has path hard-coded in.
7949 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
7950 rp="Source file to use for dynamic loading"
7956 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
7960 Some systems may require passing special flags to $cc -c to
7961 compile modules that will be used to create a shared library.
7962 To use no flags, say "none".
7965 case "$cccdlflags" in
7966 '') case "$gccversion" in
7967 '') case "$osname" in
7969 next) dflt='none' ;;
7970 irix*) dflt='-KPIC' ;;
7971 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
7972 sunos) dflt='-pic' ;;
7976 *) case "$osname" in
7977 darwin) dflt='none' ;;
7978 linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
7983 *) dflt="$cccdlflags" ;;
7985 rp="Any special flags to pass to $cc -c to compile shared library modules?"
7988 none) cccdlflags=' ' ;;
7989 *) cccdlflags="$ans" ;;
7994 Some systems use ld to create libraries that can be dynamically loaded,
7995 while other systems (such as those using ELF) use $cc.
7999 '') $cat >try.c <<EOM
8000 /* Test for whether ELF binaries are produced */
8012 int i = open("a.out",O_RDONLY);
8015 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
8016 exit(0); /* succeed (yes, it's ELF) */
8021 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
8023 You appear to have ELF support. I'll use $cc to build dynamic libraries.
8028 echo "I'll use ld to build dynamic libraries."
8037 rp="What command should be used to create dynamic libraries?"
8043 Some systems may require passing special flags to $ld to create a
8044 library that can be dynamically loaded. If your ld flags include
8045 -L/other/path options to locate libraries outside your loader's normal
8046 search path, you may need to specify those -L options here as well. To
8047 use no flags, say "none".
8050 case "$lddlflags" in
8051 '') case "$osname" in
8052 beos) dflt='-nostart' ;;
8053 haiku) dflt='-shared' ;;
8055 case "$gccversion" in
8056 '') dflt="$dflt +vnocompatwarnings" ;;
8059 linux|irix*|gnu*) dflt="-shared $optimize" ;;
8060 next) dflt='none' ;;
8061 solaris) dflt='-G' ;;
8062 sunos) dflt='-assert nodefinitions' ;;
8063 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
8067 *) dflt="$lddlflags" ;;
8070 : Try to guess additional flags to pick up local libraries.
8071 : Be careful not to append to a plain 'none'
8075 for thisflag in $ldflags; do
8080 *) dflt="$dflt $thisflag" ;;
8087 ''|' ') dflt='none' ;;
8091 *-fstack-protector*)
8093 *-fstack-protector*) ;; # Don't add it again
8094 *) dflt="$dflt -fstack-protector" ;;
8100 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
8103 none) lddlflags=' ' ;;
8104 *) lddlflags="$ans" ;;
8109 Some systems may require passing special flags to $cc to indicate that
8110 the resulting executable will use dynamic linking. To use no flags,
8114 case "$ccdlflags" in
8115 '') case "$osname" in
8116 linux|hpux|gnu*) dflt='-Wl,-E' ;;
8117 next|sunos) dflt='none' ;;
8121 *) dflt="$ccdlflags" ;;
8123 rp="Any special flags to pass to $cc to use dynamic linking?"
8126 none) ccdlflags=' ' ;;
8127 *) ccdlflags="$ans" ;;
8138 : Do we want a shared libperl?
8142 # No dynamic loading being used, so don't bother even to prompt.
8145 *) case "$useshrplib" in
8146 '') case "$osname" in
8147 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|haiku|cygwin*)
8149 also='Building a shared libperl is required for dynamic loading to work on your system.'
8154 also='Building a shared libperl is needed for MAB support.'
8172 The perl executable is normally obtained by linking perlmain.c with
8173 libperl${_a}, any static extensions (usually just DynaLoader), and
8174 any other libraries needed on this system (such as -lm, etc.). Since
8175 your system supports dynamic loading, it is probably possible to build
8176 a shared libperl.$so. If you will have more than one executable linked
8177 to libperl.$so, this will significantly reduce the size of each
8178 executable, but it may have a noticeable effect on performance. The
8179 default is probably sensible for your system.
8183 rp="Build a shared libperl.$so (y/n)"
8187 useshrplib='true' ;;
8188 *) useshrplib='false' ;;
8193 case "$useshrplib" in
8195 case "$userelocatableinc" in
8197 echo "Cannot build with both -Duserelocatableinc and -Duseshrplib" >&4
8198 echo "See INSTALL for an explanation why that won't work." >&4
8204 # Figure out a good name for libperl.so. Since it gets stored in
8205 # a version-specific architecture-dependent library, the version
8206 # number isn't really that important, except for making cc/ld happy.
8208 # A name such as libperl.so.10.1
8209 majmin="libperl.$so.$patchlevel.$subversion"
8210 # A name such as libperl.so.100
8211 majonly=`echo $patchlevel $subversion |
8212 $awk '{printf "%d%02d", $1, $2}'`
8213 majonly=libperl.$so.$majonly
8214 # I'd prefer to keep the os-specific stuff here to a minimum, and
8215 # rely on figuring it out from the naming of libc.
8216 case "${osname}${osvers}" in
8219 # XXX How handle the --version stuff for MAB?
8221 linux*|gnu*) # ld won't link with a bare -lperl otherwise.
8224 cygwin*) # ld links now against the dll directly
8225 majmin="cygperl5_${patchlevel}_${subversion}.${so}"
8226 majonly=`echo $patchlevel $subversion |
8227 $awk '{printf "%03d%03d", $1, $2}'`
8228 majonly=cygperl5.$majonly.$so
8231 *) # Try to guess based on whether libc has major.minor.
8233 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8234 *libc.$so.[0-9]*) dflt=$majonly ;;
8235 *) dflt=libperl.$so ;;
8245 I need to select a good name for the shared libperl. If your system uses
8246 library names with major and minor numbers, then you might want something
8247 like $majmin. Alternatively, if your system uses a single version
8248 number for shared libraries, then you might want to use $majonly.
8249 Or, your system might be quite happy with a simple libperl.$so.
8251 Since the shared libperl will get installed into a version-specific
8252 architecture-dependent directory, the version number of the shared perl
8253 library probably isn't important, so the default should be o.k.
8256 rp='What name do you want to give to the shared libperl?'
8259 echo "Ok, I'll use $libperl"
8262 libperl="libperl${_a}"
8266 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8270 WARNING: Use of the shrpdir variable for the installation location of
8271 the shared $libperl is not supported. It was never documented and
8272 will not work in this version. Let me (perlbug@perl.org)
8273 know of any problems this may cause.
8279 But your current setting of $shrpdir is
8280 the default anyway, so it's harmless.
8285 Further, your current attempted setting of $shrpdir
8286 conflicts with the value of $archlibexp/CORE
8287 that installperl will use.
8294 # How will the perl executable find the installed shared $libperl?
8295 # Add $xxx to ccdlflags.
8296 # If we can't figure out a command-line option, use $shrpenv to
8297 # set env LD_RUN_PATH. The main perl makefile uses this.
8298 shrpdir=$archlibexp/CORE
8301 if "$useshrplib"; then
8304 # We'll set it in Makefile.SH...
8309 freebsd|netbsd|openbsd|interix|dragonfly)
8310 xxx="-Wl,-R$shrpdir"
8312 bsdos|linux|irix*|dec_osf|gnu*)
8313 xxx="-Wl,-rpath,$shrpdir"
8316 # next doesn't like the default...
8319 # beos doesn't like the default, either.
8322 # Haiku doesn't like the default, either.
8325 # hpux doesn't like the default, either.
8326 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8329 # cygwin needs only ldlibpth
8332 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8338 # Only add $xxx if it isn't already in ccdlflags.
8339 case " $ccdlflags " in
8341 *) ccdlflags="$ccdlflags $xxx"
8344 Adding $xxx to the flags
8345 passed to $ld so that the perl executable will find the
8346 installed shared $libperl.
8354 # Fix ccdlflags in AIX for building external extensions.
8355 # (For building Perl itself bare -bE:perl.exp is needed,
8356 # Makefile.SH takes care of this.)
8358 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8360 # Respect a hint or command-line value.
8362 '') shrpenv="$tmp_shrpenv" ;;
8364 case "$ldlibpthname" in
8365 '') ldlibpthname=LD_LIBRARY_PATH ;;
8366 none) ldlibpthname='' ;;
8369 : determine where manual pages are on this system
8373 syspath='/usr/share/man/man1 /usr/man/man1'
8374 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8375 syspath="$syspath /usr/man/u_man/man1"
8376 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8377 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8378 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8379 sysman=`./loc . /usr/man/man1 $syspath`
8382 if $test -d "$sysman"; then
8383 echo "System manual is in $sysman." >&4
8385 echo "Could not find manual pages in source form." >&4
8388 : determine where manual pages go
8389 set man1dir man1dir none
8393 $spackage has manual pages available in source form.
8397 echo "However, you don't have nroff, so they're probably useless to you."
8399 '') man1dir="none";;
8402 echo "If you don't want the manual sources installed, answer 'none'."
8407 lookpath="$prefixexp/share/man/man1"
8408 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8409 lookpath="$lookpath $prefixexp/man/p_man/man1"
8410 lookpath="$lookpath $prefixexp/man/u_man/man1"
8411 lookpath="$lookpath $prefixexp/man/man.1"
8413 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8414 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8424 rp="Where do the main $spackage manual pages (source) go?"
8426 if $test "X$man1direxp" != "X$ansexp"; then
8437 : What suffix to use on installed man pages
8444 rp="What suffix should be used for the main $spackage man pages?"
8446 '') case "$man1dir" in
8460 *) dflt="$man1ext";;
8467 : see if we can have long filenames
8469 first=123456789abcdef
8471 if (echo hi >$first) 2>/dev/null; then
8472 if $test -f 123456789abcde; then
8473 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8476 echo 'You can have filenames longer than 14 characters.'>&4
8481 You can't have filenames longer than 14 chars.
8482 You can't even think about them!
8488 $rm -rf 123456789abcde*
8490 : determine where library module manual pages go
8491 set man3dir man3dir none
8495 $spackage has manual pages for many of the library modules.
8501 However, you don't have nroff, so they're probably useless to you.
8504 '') man3dir="none";;
8508 case "$d_flexfnam" in
8511 However, your system can't handle the long file names like File::Basename.3.
8514 '') man3dir="none";;
8518 echo "If you don't want the manual sources installed, answer 'none'."
8519 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8521 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8522 if $test -d "$privlib/man/man3"; then
8525 WARNING: Previous versions of perl installed man3 pages into
8526 $privlib/man/man3. This version will suggest a
8527 new default of $dflt.
8531 rp='Do you wish to preserve the old behavior?(y/n)'
8534 y*) dflt="$privlib/man/man3" ;;
8539 *) dflt="$man3dir" ;;
8546 rp="Where do the $package library man pages (source) go?"
8556 : What suffix to use on installed man pages
8562 rp="What suffix should be used for the $package library man pages?"
8564 '') case "$man3dir" in
8578 *) dflt="$man3ext";;
8585 : see if we have to deal with yellow pages, now NIS.
8586 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8587 if $test -f /usr/etc/nibindd; then
8589 echo "I'm fairly confident you're on a NeXT."
8591 rp='Do you get the hosts file via NetInfo?'
8600 y*) hostcat='nidump hosts .';;
8601 *) case "$hostcat" in
8602 nidump*) hostcat='';;
8612 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8620 rp='Are you getting the hosts file via yellow pages?'
8623 y*) hostcat='ypcat hosts';;
8624 *) hostcat='cat /etc/hosts';;
8630 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8633 '') test -f /etc/group && groupcat='cat /etc/group';;
8636 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8639 : now get the host name
8641 echo "Figuring out host name..." >&4
8642 case "$myhostname" in
8644 echo 'Maybe "hostname" will work...'
8645 if tans=`sh -c hostname 2>&1` ; then
8653 if $test "$cont"; then
8655 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8656 if tans=`cat /etc/systemid 2>&1` ; then
8658 phostname='cat /etc/systemid'
8659 echo "Whadyaknow. Xenix always was a bit strange..."
8662 elif $test -r /etc/systemid; then
8663 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8666 if $test "$cont"; then
8667 echo 'No, maybe "uuname -l" will work...'
8668 if tans=`sh -c 'uuname -l' 2>&1` ; then
8670 phostname='uuname -l'
8672 echo 'Strange. Maybe "uname -n" will work...'
8673 if tans=`sh -c 'uname -n' 2>&1` ; then
8675 phostname='uname -n'
8677 echo 'Oh well, maybe I can mine it out of whoami.h...'
8678 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8679 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8680 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8682 case "$myhostname" in
8683 '') echo "Does this machine have an identity crisis or something?"
8686 echo "Well, you said $myhostname before..."
8687 phostname='echo $myhostname';;
8693 case "$myhostname" in
8694 '') myhostname=noname ;;
8696 : you do not want to know about this
8701 if $test "$myhostname" ; then
8703 rp='Your host name appears to be "'$myhostname'".'" Right?"
8711 : bad guess or no guess
8712 while $test "X$myhostname" = X ; do
8714 rp="Please type the (one word) name of your host:"
8719 : translate upper to lower if necessary
8720 case "$myhostname" in
8722 echo "(Normalizing case in your host name)"
8723 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8727 case "$myhostname" in
8729 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8730 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8731 echo "(Trimming domain name from host name--host name is now $myhostname)"
8733 *) case "$mydomain" in
8736 test "X$hostcat" = "Xypcat hosts" &&
8737 ypmatch "$myhostname" hosts 2>/dev/null |\
8738 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8741 test "X$hostcat" != "X" &&
8742 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8743 /[ ]$myhostname[ . ]/p" > hosts
8746 if $test -f hosts; then
8747 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8748 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8749 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8750 hosts | $sort | $uniq | \
8751 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8752 case `$echo X$dflt` in
8753 X*\ *) echo "(Several hosts in the database matched hostname)"
8756 X.) echo "(You do not have fully-qualified names in the hosts database)"
8760 echo "(I cannot locate a hosts database anywhere)"
8765 tans=`./loc resolv.conf X /etc /usr/etc`
8766 if $test -f "$tans"; then
8767 echo "(Attempting domain name extraction from $tans)"
8768 dflt=.`$sed -n -e 's/ / /g' \
8769 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8772 .) dflt=.`$sed -n -e 's/ / /g' \
8773 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8781 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8782 dflt=.`sh -c domainname 2>/dev/null`
8785 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8789 case "$dflt$osname" in
8790 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
8791 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
8795 .) echo "(Lost all hope -- silly guess then)"
8801 *) dflt="$mydomain";;
8805 rp="What is your domain name?"
8815 : translate upper to lower if necessary
8818 echo "(Normalizing case in your domain name)"
8819 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
8823 : a little sanity check here
8824 case "$phostname" in
8827 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
8828 $myhostname$mydomain|$myhostname) ;;
8830 case "$phostname" in
8832 echo "(That doesn't agree with your whoami.h file, by the way.)"
8835 echo "(That doesn't agree with your $phostname command, by the way.)"
8843 : determine the e-mail address of the user who is running us
8846 I need to get your e-mail address in Internet format if possible, i.e.
8847 something like user@host.domain. Please answer accurately since I have
8848 no easy means to double check it. The default value provided below
8849 is most probably close to reality but may not be valid from outside
8850 your organization...
8854 while test "$cont"; do
8856 '') dflt="$cf_by@$myhostname$mydomain";;
8857 *) dflt="$cf_email";;
8859 rp='What is your e-mail address?'
8865 rp='Address does not look like an Internet one. Use it anyway?'
8879 : Ask e-mail of administrator
8882 If you or somebody else will be maintaining perl at your site, please
8883 fill in the correct e-mail address here so that they may be contacted
8884 if necessary. Currently, the "perlbug" program included with perl
8885 will send mail to this address in addition to perlbug@perl.org. You may
8886 enter "none" for no administrator.
8889 case "$perladmin" in
8890 '') dflt="$cf_email";;
8891 *) dflt="$perladmin";;
8893 rp='Perl administrator e-mail address'
8897 : determine whether to only install version-specific parts.
8900 Do you want to install only the version-specific parts of the perl
8901 distribution? Usually you do *not* want to do this.
8903 case "$versiononly" in
8904 "$define"|[Yy]*|true) dflt='y' ;;
8907 rp="Do you want to install only the version-specific parts of perl?"
8910 [yY]*) val="$define";;
8916 case "$versiononly" in
8917 "$define") inc_version_list=''
8918 inc_version_list_init=0
8922 : figure out how to guarantee perl startup
8923 : XXX Note that this currently takes advantage of the bug that binexp ignores
8924 : the Configure -Dinstallprefix setting, which in turn means that under
8925 : relocatable @INC, initialinstalllocation is what binexp started as.
8926 case "$startperl" in
8928 case "$sharpbang" in
8932 I can use the #! construct to start perl on your system. This will
8933 make startup of perl scripts faster, but may cause problems if you
8934 want to share those scripts and perl is not in a standard place
8935 ($initialinstalllocation/perl) on all your platforms. The alternative
8936 is to force a shell by starting the script with a single ':' character.
8939 case "$versiononly" in
8940 "$define") dflt="$initialinstalllocation/perl$version";;
8941 *) dflt="$initialinstalllocation/perl";;
8943 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
8946 none) startperl=": # use perl";;
8947 *) startperl="#!$ans"
8948 if $test 30 -lt `echo "$ans" | wc -c`; then
8951 WARNING: Some systems limit the #! command to 32 characters.
8952 If you experience difficulty running Perl scripts with #!, try
8953 installing Perl in a directory with a shorter pathname.
8959 *) startperl=": # use perl"
8964 echo "I'll use $startperl to start perl scripts."
8966 : figure best path for perl in scripts
8969 case "$versiononly" in
8970 "$define") perlpath="$initialinstalllocation/perl$version";;
8971 *) perlpath="$initialinstalllocation/perl";;
8973 case "$startperl" in
8978 I will use the "eval 'exec'" idiom to start Perl on your system.
8979 I can use the full path of your Perl binary for this purpose, but
8980 doing so may cause problems if you want to share those scripts and
8981 Perl is not always in a standard place ($initialinstalllocation/perl).
8984 dflt="$initialinstalllocation/perl"
8985 rp="What path shall I use in \"eval 'exec'\"?"
8992 case "$startperl" in
8994 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
8997 : determine where public executable scripts go
8998 set scriptdir scriptdir
9000 case "$scriptdir" in
9003 : guess some guesses
9004 $test -d /usr/share/scripts && dflt=/usr/share/scripts
9005 $test -d /usr/share/bin && dflt=/usr/share/bin
9006 $test -d /usr/local/script && dflt=/usr/local/script
9007 $test -d /usr/local/scripts && dflt=/usr/local/scripts
9008 $test -d $prefixexp/script && dflt=$prefixexp/script
9012 *) dflt="$scriptdir"
9017 Some installations have a separate directory just for executable scripts so
9018 that they can mount it across multiple architectures but keep the scripts in
9019 one spot. You might, for example, have a subdirectory of /usr/share for this.
9020 Or you might just lump your scripts in with all your other executables.
9024 rp='Where do you keep publicly executable scripts?'
9026 if $test "X$ansexp" != "X$scriptdirexp"; then
9032 : A little fix up for an irregularly named variable.
9033 installscript="$installscriptdir"
9035 : determine where add-on public executables go
9037 '') dflt=$siteprefix/bin ;;
9041 rp='Pathname where the add-on public executables should be installed?'
9046 : determine where add-on html pages go
9047 : There is no standard location, so try to copy the previously-selected
9048 : directory structure for the core html pages.
9049 case "$sitehtml1dir" in
9050 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9051 *) dflt=$sitehtml1dir ;;
9054 ''|' ') dflt=none ;;
9057 rp='Pathname where the site-specific html pages should be installed?'
9059 prefixvar=sitehtml1dir
9062 : determine where add-on library html pages go
9063 : There is no standard location, so try to copy the previously-selected
9064 : directory structure for the core html pages.
9065 case "$sitehtml3dir" in
9066 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9067 *) dflt=$sitehtml3dir ;;
9070 ''|' ') dflt=none ;;
9073 rp='Pathname where the site-specific library html pages should be installed?'
9075 prefixvar=sitehtml3dir
9078 : determine where add-on manual pages go
9079 case "$siteman1dir" in
9080 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
9081 *) dflt=$siteman1dir ;;
9084 ''|' ') dflt=none ;;
9087 rp='Pathname where the site-specific manual pages should be installed?'
9089 prefixvar=siteman1dir
9092 : determine where add-on library man pages go
9093 case "$siteman3dir" in
9094 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
9095 *) dflt=$siteman3dir ;;
9098 ''|' ') dflt=none ;;
9101 rp='Pathname where the site-specific library manual pages should be installed?'
9103 prefixvar=siteman3dir
9106 : determine where add-on public executable scripts go
9107 case "$sitescript" in
9108 '') dflt=$siteprefix/script
9109 $test -d $dflt || dflt=$sitebin ;;
9110 *) dflt="$sitescript" ;;
9113 rp='Pathname where add-on public executable scripts should be installed?'
9115 prefixvar=sitescript
9118 : Check if faststdio is requested and available
9119 case "$usefaststdio" in
9120 $define|true|[yY]*|'')
9121 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
9131 Perl can be built to use 'fast stdio', which means using the stdio
9132 library but also directly manipulating the stdio buffers to enable
9133 faster I/O. Using stdio is better for backward compatibility (especially
9134 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
9135 interface has been preferred instead of stdio.
9137 If this doesn't make any sense to you, just accept the default '$dflt'.
9139 rp='Use the "fast stdio" if available?'
9142 y|Y) val="$define" ;;
9149 : define an is-a-typedef? function
9150 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9152 "") inclist="sys/types.h";;
9154 eval "varval=\$$var";
9158 for inc in $inclist; do
9159 echo "#include <$inc>" >>temp.c;
9161 echo "#ifdef $type" >> temp.c;
9162 echo "printf(\"We have $type\");" >> temp.c;
9163 echo "#endif" >> temp.c;
9164 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9165 if $contains $type temp.E >/dev/null 2>&1; then
9171 *) eval "$var=\$varval";;
9174 : define an is-a-typedef? function that prompts if the type is not available.
9175 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9177 "") inclist="sys/types.h";;
9179 eval "varval=\$$var";
9183 for inc in $inclist; do
9184 echo "#include <$inc>" >>temp.c;
9186 echo "#ifdef $type" >> temp.c;
9187 echo "printf(\"We have $type\");" >> temp.c;
9188 echo "#endif" >> temp.c;
9189 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9191 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
9192 if $contains $type temp.E >/dev/null 2>&1; then
9193 echo "$type found." >&4;
9196 echo "$type NOT found." >&4;
9202 *) eval "$var=\$varval";;
9205 : see what type lseek is declared as in the kernel
9206 rp="What is the type used for lseek's offset on this system?"
9207 set off_t lseektype long stdio.h sys/types.h
9211 echo "Checking to see how big your file offsets are..." >&4
9213 #include <sys/types.h>
9217 printf("%d\n", (int)sizeof($lseektype));
9222 if eval $compile_ok; then
9223 lseeksize=`$run ./try`
9224 echo "Your file offsets are $lseeksize bytes long."
9228 echo "(I can't seem to compile the test program. Guessing...)"
9229 rp="What is the size of your file offsets (in bytes)?"
9235 : see what type file positions are declared as in the library
9236 rp="What is the type for file position used by fsetpos()?"
9237 set fpos_t fpostype long stdio.h sys/types.h
9240 : Check size for Fpos_t
9243 *_t) zzz="$fpostype" ;;
9246 echo "Checking the size of $zzz..." >&4
9248 #include <sys/types.h>
9255 printf("%d\n", (int)sizeof($fpostype));
9260 if eval $compile_ok; then
9264 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9267 echo "Your $zzz is $fpossize bytes long."
9273 echo "(I can't compile the test program. Guessing...)" >&4
9274 rp="What is the size of your file positions (in bytes)?"
9279 : Check for large file support
9280 # Backward compatibility (uselfs is deprecated).
9282 "$define"|true|[yY]*)
9285 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9287 uselargefiles="$define"
9291 case "$lseeksize:$fpossize" in
9294 You can have files larger than 2 gigabytes.
9297 *) case "$uselargefiles" in
9298 "$undef"|false|[nN]*) dflt='n' ;;
9303 Perl can be built to understand large files (files larger than 2 gigabytes)
9304 on some systems. To do so, Configure can be run with -Duselargefiles.
9306 If this doesn't make any sense to you, just accept the default '$dflt'.
9308 rp='Try to understand large files, if available?'
9311 y|Y) val="$define" ;;
9318 : Look for a hint-file generated 'call-back-unit'. If the
9319 : user has specified that a large files perl is to be built,
9320 : we may need to set or change some other defaults.
9321 if $test -f uselargefiles.cbu; then
9322 echo "Your platform has some specific hints regarding large file builds, using them..."
9323 . ./uselargefiles.cbu
9325 case "$uselargefiles" in
9327 if $test -f uselargefiles.cbu; then
9329 echo "Rechecking to see how big your file offsets are..." >&4
9331 #include <sys/types.h>
9335 printf("%d\n", (int)sizeof($lseektype));
9340 if eval $compile_ok; then
9341 lseeksize=`$run ./try`
9342 $echo "Your file offsets are now $lseeksize bytes long."
9346 echo "(I can't seem to compile the test program. Guessing...)"
9347 rp="What is the size of your file offsets (in bytes)?"
9352 *_t) zzz="$fpostype" ;;
9355 $echo $n "Rechecking the size of $zzz...$c" >&4
9357 #include <sys/types.h>
9364 printf("%d\n", (int)sizeof($fpostype));
9369 if eval $compile_ok; then
9374 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9377 echo " $fpossize bytes." >&4
9383 echo "(I can't compile the test program. Guessing...)" >&4
9384 rp="What is the size of your file positions (in bytes)?"
9393 : Set the vendorbin variables
9394 case "$vendorprefix" in
9395 '') d_vendorbin="$undef"
9399 *) d_vendorbin="$define"
9400 : determine where vendor-supplied executables go.
9401 case "$vendorbin" in
9402 '') dflt=$vendorprefix/bin ;;
9403 *) dflt="$vendorbin" ;;
9406 rp='Pathname for the vendor-supplied executables directory?'
9409 vendorbinexp="$ansexp"
9415 : Set the vendorhtml1dir variables
9416 case "$vendorprefix" in
9417 '') vendorhtml1dir=''
9418 vendorhtml1direxp=''
9420 *) : determine where vendor-supplied html pages go.
9421 : There is no standard location, so try to copy the previously-selected
9422 : directory structure for the core html pages.
9423 : XXX Better default suggestions would be welcome.
9424 case "$vendorhtml1dir" in
9425 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9426 *) dflt=$vendorhtml1dir ;;
9429 ''|' ') dflt=none ;;
9432 rp='Pathname for the vendor-supplied html pages?'
9434 vendorhtml1dir="$ans"
9435 vendorhtml1direxp="$ansexp"
9438 : Use ' ' for none so value is preserved next time through Configure
9439 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9440 prefixvar=vendorhtml1dir
9443 : Set the vendorhtml3dir variables
9444 case "$vendorprefix" in
9445 '') vendorhtml3dir=''
9446 vendorhtml3direxp=''
9448 *) : determine where vendor-supplied module html pages go.
9449 : There is no standard location, so try to copy the previously-selected
9450 : directory structure for the core html pages.
9451 : XXX Better default suggestions would be welcome.
9452 case "$vendorhtml3dir" in
9453 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9454 *) dflt=$vendorhtml3dir ;;
9457 ''|' ') dflt=none ;;
9460 rp='Pathname for the vendor-supplied html pages?'
9462 vendorhtml3dir="$ans"
9463 vendorhtml3direxp="$ansexp"
9466 : Use ' ' for none so value is preserved next time through Configure
9467 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9468 prefixvar=vendorhtml3dir
9471 : Set the vendorman1dir variables
9472 case "$vendorprefix" in
9473 '') vendorman1dir=''
9476 *) : determine where vendor-supplied manual pages go.
9477 case "$vendorman1dir" in
9478 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9479 *) dflt=$vendorman1dir ;;
9482 ''|' ') dflt=none ;;
9485 rp='Pathname for the vendor-supplied manual section 1 pages?'
9487 vendorman1dir="$ans"
9488 vendorman1direxp="$ansexp"
9491 : Use ' ' for none so value is preserved next time through Configure
9492 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9493 prefixvar=vendorman1dir
9496 : Set the vendorman3dir variables
9497 case "$vendorprefix" in
9498 '') vendorman3dir=''
9501 *) : determine where vendor-supplied module manual pages go.
9502 case "$vendorman3dir" in
9503 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9504 *) dflt=$vendorman3dir ;;
9507 ''|' ') dflt=none ;;
9510 rp='Pathname for the vendor-supplied manual section 3 pages?'
9512 vendorman3dir="$ans"
9513 vendorman3direxp="$ansexp"
9516 : Use ' ' for none so value is preserved next time through Configure
9517 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9518 prefixvar=vendorman3dir
9521 : Set the vendorscript variables
9522 case "$vendorprefix" in
9523 '') d_vendorscript="$undef"
9527 *) d_vendorscript="$define"
9528 : determine where vendor-supplied scripts go.
9529 case "$vendorscript" in
9530 '') dflt=$vendorprefix/script
9531 $test -d $dflt || dflt=$vendorbin ;;
9532 *) dflt="$vendorscript" ;;
9536 The installation process will create a directory for
9537 vendor-supplied scripts.
9541 rp='Pathname for the vendor-supplied scripts directory?'
9544 vendorscriptexp="$ansexp"
9547 prefixvar=vendorscript
9550 : script used to emit important warnings
9553 if test \$# -gt 0; then
9558 echo "*** WARNING:" >&4
9559 sed -e 's/^/*** /' <msg >&4
9561 cat msg >>config.msg
9562 echo " " >>config.msg
9568 : see which of string.h or strings.h is needed
9570 strings=`./findhdr string.h`
9571 if $test "$strings" && $test -r "$strings"; then
9572 echo "Using <string.h> instead of <strings.h>." >&4
9576 strings=`./findhdr strings.h`
9577 if $test "$strings" && $test -r "$strings"; then
9578 echo "Using <strings.h> instead of <string.h>." >&4
9580 ./warn "No string header found -- You'll surely have problems."
9586 "$undef") strings=`./findhdr strings.h`;;
9587 *) strings=`./findhdr string.h`;;
9590 : see if qgcvt exists
9594 : Check print/scan long double stuff
9597 if $test X"$d_longdbl" = X"$define"; then
9599 echo "Checking how to print long doubles..." >&4
9601 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
9602 $cat >try.c <<'EOCP'
9603 #include <sys/types.h>
9607 printf("%.3f\n", d);
9611 if eval $compile; then
9615 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
9616 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
9617 echo "We will use %f."
9623 if $test X"$sPRIfldbl" = X; then
9624 $cat >try.c <<'EOCP'
9625 #include <sys/types.h>
9628 long double d = 123.456;
9629 printf("%.3Lf\n", d);
9633 if eval $compile; then
9637 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
9638 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
9639 echo "We will use %Lf."
9645 if $test X"$sPRIfldbl" = X; then
9646 $cat >try.c <<'EOCP'
9647 #include <sys/types.h>
9650 long double d = 123.456;
9651 printf("%.3llf\n", d);
9655 if eval $compile; then
9659 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
9660 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
9661 echo "We will use %llf."
9667 if $test X"$sPRIfldbl" = X; then
9668 $cat >try.c <<'EOCP'
9669 #include <sys/types.h>
9672 long double d = 123.456;
9673 printf("%.3lf\n", d);
9677 if eval $compile; then
9681 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
9682 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
9683 echo "We will use %lf."
9689 if $test X"$sPRIfldbl" = X; then
9690 echo "Cannot figure out how to print long doubles." >&4
9692 sSCNfldbl=$sPRIfldbl # expect consistency
9699 case "$sPRIfldbl" in
9700 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
9701 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
9702 d_SCNfldbl="$undef";
9704 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
9705 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
9706 d_SCNfldbl="$define";
9710 : Check how to convert floats to strings.
9712 if test "X$d_Gconvert" = X; then
9715 echo "Checking for an efficient way to convert floats to strings."
9717 case "$uselongdouble" in
9718 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
9720 case "$d_longdbl" in
9721 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
9723 case "$d_PRIgldbl" in
9724 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
9728 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
9729 char *myname = "gconvert";
9732 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
9733 char *myname = "gcvt";
9736 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
9737 char *myname = "qgcvt";
9738 #define DOUBLETYPE long double
9741 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9743 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
9745 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
9748 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
9750 char *myname = "sprintf";
9754 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9755 #define DOUBLETYPE long double
9757 #define DOUBLETYPE double
9769 # include <string.h>
9771 # include <strings.h>
9774 int checkit(char *expect, char *got)
9776 if (strcmp(expect, got)) {
9777 printf("%s oddity: Expected %s, got %s\n",
9778 myname, expect, got);
9788 /* This must be 1st test on (which?) platform */
9789 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
9790 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
9791 checkit("0.1", buf);
9793 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
9794 checkit("0.01", buf);
9796 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
9797 checkit("0.001", buf);
9799 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
9800 checkit("0.0001", buf);
9802 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
9803 if (strlen(buf) > 5)
9804 checkit("9e-005", buf); /* for Microsoft ?? */
9806 checkit("9e-05", buf);
9808 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
9811 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
9812 checkit("1.1", buf);
9814 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
9815 checkit("1.01", buf);
9817 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
9818 checkit("1.001", buf);
9820 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
9821 checkit("1.0001", buf);
9823 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
9824 checkit("1.00001", buf);
9826 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
9827 checkit("1.000001", buf);
9829 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
9832 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
9835 /* Some Linux gcvt's give 1.e+5 here. */
9836 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
9837 checkit("100000", buf);
9839 /* Some Linux gcvt's give -1.e+5 here. */
9840 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
9841 checkit("-100000", buf);
9843 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
9844 checkit("123.456", buf);
9846 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
9847 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
9848 /* 34 should be enough to scare even long double
9849 * places into using the e notation. */
9850 if (strlen(buf) > 5)
9851 checkit("1e+034", buf); /* for Microsoft */
9853 checkit("1e+34", buf);
9855 /* For Perl, if you add additional tests here, also add them to
9856 * t/base/num.t for benefit of platforms not using Configure or
9857 * overriding d_Gconvert */
9862 : first add preferred functions to our list
9864 for xxx_convert in $gconvert_preference; do
9865 case $xxx_convert in
9866 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
9867 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
9870 : then add any others
9871 for xxx_convert in gconvert gcvt sprintf; do
9874 *) xxx_list="$xxx_list $xxx_convert" ;;
9878 case "$d_longdbl$uselongdouble" in
9880 : again, add prefered functions to our list first
9882 for xxx_convert in $gconvert_ld_preference; do
9883 case $xxx_convert in
9884 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9885 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
9888 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
9889 for xxx_convert in qgcvt sprintf $xxx_list; do
9890 case "$xxx_ld_list" in
9891 $xxx_convert*|*" $xxx_convert"*) ;;
9892 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9895 : if sprintf cannot do long doubles, move it to the end
9896 if test "$d_PRIgldbl" != "$define"; then
9897 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
9899 : if no qgcvt, remove it
9900 if test "$d_qgcvt" != "$define"; then
9901 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
9904 xxx_list="$xxx_ld_list"
9908 for xxx_convert in $xxx_list; do
9909 echo "Trying $xxx_convert..."
9910 $rm -f try try$_o core
9911 set try -DTRY_$xxx_convert
9912 if eval $compile; then
9913 echo "$xxx_convert() found." >&4
9915 echo "I'll use $xxx_convert to convert floats into a string." >&4
9918 echo "...But $xxx_convert didn't work as I expected."
9922 echo "$xxx_convert NOT found." >&4
9926 if test X$xxx_convert = X; then
9927 echo "*** WHOA THERE!!! ***" >&4
9928 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
9932 case "$xxx_convert" in
9933 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
9934 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
9935 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
9936 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
9937 "$define$define$define")
9938 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
9939 "$define$define$undef")
9940 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
9941 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
9949 : see if _fwalk exists
9953 : Initialize h_fcntl
9956 : Initialize h_sysfile
9959 : access call always available on UNIX
9963 : locate the flags for 'access()'
9967 $cat >access.c <<EOCP
9968 #include <sys/types.h>
9973 #include <sys/file.h>
9986 : check sys/file.h first, no particular reason here
9987 if $test `./findhdr sys/file.h` && \
9988 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
9990 echo "<sys/file.h> defines the *_OK access constants." >&4
9991 elif $test `./findhdr fcntl.h` && \
9992 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
9994 echo "<fcntl.h> defines the *_OK access constants." >&4
9995 elif $test `./findhdr unistd.h` && \
9996 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
9997 echo "<unistd.h> defines the *_OK access constants." >&4
9999 echo "I can't find the four *_OK access constants--I'll use mine." >&4
10005 : see if accessx exists
10006 set accessx d_accessx
10009 : see if aintl exists
10013 : see if alarm exists
10017 : see if 64bit time functions exists
10019 set ctime64 d_ctime64
10022 set localtime64 d_localtime64
10025 set gmtime64 d_gmtime64
10028 set mktime64 d_mktime64
10031 set difftime64 d_difftime64
10034 set asctime64 d_asctime64
10037 : see if POSIX threads are available
10038 set pthread.h i_pthread
10041 : define a fucntion to check prototypes
10042 $cat > protochk <<EOSH
10045 optimize="$optimize"
10047 prototype="$prototype"
10050 usethreads=$usethreads
10051 i_pthread=$i_pthread
10052 pthread_h_first=$pthread_h_first
10055 $cat >> protochk <<'EOSH'
10060 while test $# -ge 2; do
10062 $define) echo "#include <$2>" >> try.c ;;
10063 literal) echo "$2" >> try.c ;;
10065 # Extra magic for the benefit of systems that need pthread.h
10066 # to be included early to correctly detect threadsafe functions.
10067 # Such functions must guarantee themselves, though, that the usethreads
10068 # and i_pthread have been defined, before calling protochk.
10069 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
10070 echo "#include <pthread.h>" >> try.c
10075 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
10076 cat >> try.c <<'EOCP'
10077 #ifdef CAN_PROTOTYPE
10078 #define _(args) args
10083 echo "$foo" >> try.c
10084 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
10085 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
10091 $eunicefix protochk
10093 : Define hasproto macro for Configure internal use
10094 hasproto='varname=$1; func=$2; shift; shift;
10095 while $test $# -ge 2; do
10097 $define) echo "#include <$2>";;
10101 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
10102 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
10103 echo "$func() prototype found.";
10106 echo "$func() prototype NOT found.";
10113 : see if sys/types.h has to be included
10114 set sys/types.h i_systypes
10117 : see if sys/select.h has to be included
10118 set sys/select.h i_sysselct
10121 : Define hasfield macro for Configure internal use
10122 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
10123 while $test $# -ge 2; do
10125 $define) echo "#include <$2>";;
10129 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
10131 if eval $compile; then
10140 : see if we should include time.h, sys/time.h, or both
10142 if test "X$timeincl" = X; then
10143 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
10144 $echo $n "I'm now running the test program...$c"
10146 #include <sys/types.h>
10151 #ifdef SYSTIMEKERNEL
10154 #include <sys/time.h>
10157 #include <sys/select.h>
10159 #$i_stdlib I_STDLIB
10161 #include <stdlib.h>
10167 struct timeval bar;
10170 struct timezone tzp;
10172 if (foo.tm_sec == foo.tm_sec)
10175 if (bar.tv_sec == bar.tv_sec)
10182 for s_timezone in '-DS_TIMEZONE' ''; do
10184 for s_timeval in '-DS_TIMEVAL' ''; do
10185 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10186 for i_time in '' '-DI_TIME'; do
10187 for i_systime in '-DI_SYSTIME' ''; do
10190 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10191 if eval $compile; then
10192 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
10196 $echo $n "Succeeded with $flags$c"
10208 *SYSTIMEKERNEL*) i_systimek="$define"
10209 timeincl=`./findhdr sys/time.h`
10210 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10211 *) i_systimek="$undef";;
10214 *I_TIME*) i_time="$define"
10215 timeincl=`./findhdr time.h`" $timeincl"
10216 echo "We'll include <time.h>." >&4;;
10217 *) i_time="$undef";;
10220 *I_SYSTIME*) i_systime="$define"
10221 timeincl=`./findhdr sys/time.h`" $timeincl"
10222 echo "We'll include <sys/time.h>." >&4;;
10223 *) i_systime="$undef";;
10227 : see if struct tm knows about tm_zone
10228 case "$i_systime$i_time" in
10231 echo "Checking to see if your struct tm has tm_zone field..." >&4
10232 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
10240 case "$d_tm_tm_zone" in
10241 "$define") echo "Yes, it does." ;;
10242 *) echo "No, it doesn't." ;;
10244 : see if struct tm knows about tm_gmtoff
10245 case "$i_systime$i_time" in
10248 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
10249 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
10257 case "$d_tm_tm_gmtoff" in
10258 "$define") echo "Yes, it does." ;;
10259 *) echo "No, it doesn't." ;;
10262 : see if asctime_r exists
10263 set asctime_r d_asctime_r
10265 case "$d_asctime_r" in
10267 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10268 case "$d_asctime_r_proto:$usethreads" in
10269 ":define") d_asctime_r_proto=define
10270 set d_asctime_r_proto asctime_r $hdrs
10274 case "$d_asctime_r_proto" in
10276 case "$asctime_r_proto" in
10277 ''|0) try='char* asctime_r(const struct tm*, char*);'
10278 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SB ;;
10280 case "$asctime_r_proto" in
10281 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
10282 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SBI ;;
10284 case "$asctime_r_proto" in
10285 ''|0) try='int asctime_r(const struct tm*, char*);'
10286 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SB ;;
10288 case "$asctime_r_proto" in
10289 ''|0) try='int asctime_r(const struct tm*, char*, int);'
10290 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SBI ;;
10292 case "$asctime_r_proto" in
10293 ''|0) d_asctime_r=undef
10295 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
10296 * ) case "$asctime_r_proto" in
10297 REENTRANT_PROTO*) ;;
10298 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
10300 echo "Prototype: $try" ;;
10303 *) case "$usethreads" in
10304 define) echo "asctime_r has no prototype, not using it." >&4 ;;
10311 *) asctime_r_proto=0
10315 : see if atolf exists
10319 : see if atoll exists
10323 : Look for GCC-style attribute format
10324 case "$d_attribute_format" in
10327 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
10328 $cat >attrib.c <<'EOCP'
10330 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
10332 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10333 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10334 echo "Your C compiler doesn't support __attribute__((format))."
10337 echo "Your C compiler supports __attribute__((format))."
10341 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10345 *) val="$d_attribute_format" ;;
10347 set d_attribute_format
10351 : Look for GCC-style attribute format with null format allowed
10352 case "$d_printf_format_null" in
10353 '') case "$d_attribute_format" in
10356 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
10357 $cat >attrib.c <<EOCP
10359 #$i_stdlib I_STDLIB
10361 #include <stdlib.h>
10363 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
10364 int null_printf (char* pat,...) { return (int)pat; }
10365 int main () { exit(null_printf(NULL)); }
10367 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
10368 : run the executable in case it produces a run-time warning
10369 if $run ./attrib >>attrib.out 2>&1; then
10370 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10371 echo "Your C compiler doesn't allow __printf__ format to be null."
10374 echo "Your C compiler allows __printf__ format to be null."
10378 echo "Your C compiler executable failed with __printf__ format null."
10382 echo "Your C compiler fails with __printf__ format null."
10389 *) val="$d_printf_format_null" ;;
10391 set d_printf_format_null
10395 : Look for GCC-style attribute malloc
10396 case "$d_attribute_malloc" in
10399 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
10400 $cat >attrib.c <<'EOCP'
10402 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
10404 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10405 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10406 echo "Your C compiler doesn't support __attribute__((malloc))."
10409 echo "Your C compiler supports __attribute__((malloc))."
10413 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10417 *) val="$d_attribute_malloc" ;;
10419 set d_attribute_malloc
10423 : Look for GCC-style attribute nonnull
10424 case "$d_attribute_nonnull" in
10427 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
10428 $cat >attrib.c <<'EOCP'
10430 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
10432 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10433 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10434 echo "Your C compiler doesn't support __attribute__((nonnull))."
10437 echo "Your C compiler supports __attribute__((nonnull))."
10441 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10445 *) val="$d_attribute_nonnull" ;;
10447 set d_attribute_nonnull
10451 : Look for GCC-style attribute noreturn
10452 case "$d_attribute_noreturn" in
10455 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
10456 $cat >attrib.c <<'EOCP'
10458 void fall_over_dead( void ) __attribute__((noreturn));
10460 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10461 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10462 echo "Your C compiler doesn't support __attribute__((noreturn))."
10465 echo "Your C compiler supports __attribute__((noreturn))."
10469 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10473 *) val="$d_attribute_noreturn" ;;
10475 set d_attribute_noreturn
10479 : Look for GCC-style attribute pure
10480 case "$d_attribute_pure" in
10483 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
10484 $cat >attrib.c <<'EOCP'
10486 int square( int n ) __attribute__((pure));
10488 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10489 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10490 echo "Your C compiler doesn't support __attribute__((pure))."
10493 echo "Your C compiler supports __attribute__((pure))."
10497 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10501 *) val="$d_attribute_pure" ;;
10503 set d_attribute_pure
10507 : Look for GCC-style attribute unused
10508 case "$d_attribute_unused" in
10511 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
10512 $cat >attrib.c <<'EOCP'
10514 int do_something( int dummy __attribute__((unused)), int n );
10516 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10517 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10518 echo "Your C compiler doesn't support __attribute__((unused))."
10521 echo "Your C compiler supports __attribute__((unused))."
10525 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10529 *) val="$d_attribute_unused" ;;
10531 set d_attribute_unused
10535 : Look for GCC-style attribute deprecated
10536 case "$d_attribute_deprecated" in
10539 echo "Checking whether your compiler can handle __attribute__((deprecated)) ..." >&4
10540 $cat >attrib.c <<'EOCP'
10542 int I_am_deprecated(void) __attribute__((deprecated));
10544 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10545 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10546 echo "Your C compiler doesn't support __attribute__((deprecated))."
10549 echo "Your C compiler supports __attribute__((deprecated))."
10553 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10557 *) val="$d_attribute_deprecated" ;;
10559 set d_attribute_deprecated
10563 : Look for GCC-style attribute warn_unused_result
10564 case "$d_attribute_warn_unused_result" in
10567 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
10568 $cat >attrib.c <<'EOCP'
10570 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
10572 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10573 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10574 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
10577 echo "Your C compiler supports __attribute__((warn_unused_result))."
10581 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10585 *) val="$d_attribute_warn_unused_result" ;;
10587 set d_attribute_warn_unused_result
10591 : see if bcmp exists
10595 : see if bcopy exists
10599 : see if getpgrp exists
10600 set getpgrp d_getpgrp
10603 case "$d_getpgrp" in
10606 echo "Checking to see which flavor of getpgrp is in use..."
10608 #$i_unistd I_UNISTD
10609 #include <sys/types.h>
10611 # include <unistd.h>
10613 #$i_stdlib I_STDLIB
10615 #include <stdlib.h>
10619 if (getuid() == 0) {
10620 printf("(I see you are running Configure as super-user...)\n");
10623 #ifdef TRY_BSD_PGRP
10624 if (getpgrp(1) == 0)
10633 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10634 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
10636 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10637 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
10640 echo "I can't seem to compile and run the test program."
10642 xxx="a USG one, i.e. you use getpgrp()."
10644 # SVR4 systems can appear rather BSD-ish.
10645 case "$i_unistd" in
10647 xxx="a BSD one, i.e. you use getpgrp(pid)."
10651 xxx="probably a USG one, i.e. you use getpgrp()."
10656 echo "Assuming your getpgrp is $xxx" >&4
10665 : see if setpgrp exists
10666 set setpgrp d_setpgrp
10669 case "$d_setpgrp" in
10672 echo "Checking to see which flavor of setpgrp is in use..."
10674 #$i_unistd I_UNISTD
10675 #include <sys/types.h>
10677 # include <unistd.h>
10679 #$i_stdlib I_STDLIB
10681 #include <stdlib.h>
10685 if (getuid() == 0) {
10686 printf("(I see you are running Configure as super-user...)\n");
10689 #ifdef TRY_BSD_PGRP
10690 if (-1 == setpgrp(1, 1))
10693 if (setpgrp() != -1)
10699 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10700 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
10702 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10703 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
10706 echo "(I can't seem to compile and run the test program.)"
10708 xxx="a USG one, i.e. you use setpgrp()."
10710 # SVR4 systems can appear rather BSD-ish.
10711 case "$i_unistd" in
10713 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
10717 xxx="probably a USG one, i.e. you use setpgrp()."
10722 echo "Assuming your setpgrp is $xxx" >&4
10731 : Look for GCC-style __builtin_choose_expr
10732 case "$d_builtin_choose_expr" in
10735 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
10736 $cat >try.c <<'EOCP'
10737 #include <assert.h>
10738 #include <stdlib.h>
10741 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
10744 assert( SYRINX(1) == 2112 );
10745 assert( SYRINX(1) != 5150 );
10746 assert( SYRINX(0) == 5150 );
10747 assert( SYRINX(0) != 2112 );
10748 puts( "All good!" );
10754 if eval $compile && $run ./try; then
10755 echo "Your C compiler supports __builtin_choose_expr."
10758 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10762 *) val="$d_builtin_choose_expr" ;;
10765 set d_builtin_choose_expr
10769 : Look for GCC-style __builtin_expect
10770 case "$d_builtin_expect" in
10773 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
10774 $cat >try.c <<'EOCP'
10777 if ( __builtin_expect(n, 0) ) n = 1;
10778 /* Remember shell exit code truth is 0, C truth is non-zero */
10783 if eval $compile && $run ./try; then
10784 echo "Your C compiler supports __builtin_expect."
10787 echo "Your C compiler doesn't seem to understand __builtin_expect."
10791 *) val="$d_builtin_expect" ;;
10794 set d_builtin_expect
10798 : see if bzero exists
10802 : see if stdarg is available
10804 if $test `./findhdr stdarg.h`; then
10805 echo "<stdarg.h> found." >&4
10808 echo "<stdarg.h> NOT found." >&4
10812 : see if varags is available
10814 if $test `./findhdr varargs.h`; then
10815 echo "<varargs.h> found." >&4
10817 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
10820 : set up the varargs testing programs
10821 $cat > varargs.c <<EOP
10823 #include <stdarg.h>
10826 #include <varargs.h>
10830 int f(char *p, ...)
10844 p = va_arg(ap, char *);
10850 $cat > varargs <<EOP
10852 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
10861 : now check which varargs header should be included
10866 if `./varargs I_STDARG`; then
10868 elif `./varargs I_VARARGS`; then
10873 if `./varargs I_VARARGS`; then
10880 echo "I could not find the definition for va_dcl... You have problems..." >&4
10881 val="$undef"; set i_stdarg; eval $setvar
10882 val="$undef"; set i_varargs; eval $setvar
10887 case "$i_varhdr" in
10889 val="$define"; set i_stdarg; eval $setvar
10890 val="$undef"; set i_varargs; eval $setvar
10893 val="$undef"; set i_stdarg; eval $setvar
10894 val="$define"; set i_varargs; eval $setvar
10897 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
10901 : see if the Compiler supports C99 variadic macros
10902 case "$i_stdarg$i_stdlib" in
10904 echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
10907 #include <stdarg.h>
10909 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
10913 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
10919 if eval $compile && $run ./try 2>&1 >/dev/null; then
10920 case "`$run ./try`" in
10922 echo "You have C99 variadic macros." >&4
10923 d_c99_variadic_macros="$define"
10926 echo "You don't have functional C99 variadic macros." >&4
10927 d_c99_variadic_macros="$undef"
10931 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
10932 d_c99_variadic_macros="$undef"
10937 echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
10938 d_c99_variadic_macros="$undef"
10942 : see if signal is declared as pointer to function returning int or void
10944 xxx=`./findhdr signal.h`
10945 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
10946 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10947 echo "You have int (*signal())() instead of void." >&4
10949 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10950 echo "You have void (*signal())()." >&4
10952 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
10953 echo "You have int (*signal())() instead of void." >&4
10955 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
10956 echo "You have void (*signal())()." >&4
10959 case "$d_voidsig" in
10961 echo "I can't determine whether signal handler returns void or int..." >&4
10963 rp="What type does your signal handler return?"
10966 v*) val="$define";;
10970 echo "As you already told me, signal handler returns void." >&4
10973 *) echo "As you already told me, signal handler returns int." >&4
10980 case "$d_voidsig" in
10981 "$define") signal_t="void";;
10982 *) signal_t="int";;
10986 : check for ability to cast large floats to 32-bit ints.
10988 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
10989 if $test "$intsize" -ge 4; then
10996 #$i_stdlib I_STDLIB
10998 #include <stdlib.h>
11000 #include <sys/types.h>
11001 #include <signal.h>
11002 $signal_t blech(int s) { exit(3); }
11009 signal(SIGFPE, blech);
11011 /* Don't let compiler optimize the test away. Store the number
11012 in a writable string for gcc to pass to sscanf under HP/UX.
11014 sprintf(str, "2147483647");
11015 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
11019 /* x86 processors will probably give 0x8000 0000, which is a
11020 sign change. We don't want that. We want to mimic SPARC
11021 behavior here, which is to preserve the sign and give
11024 if (i32 != ($xxx) f)
11030 if eval $compile_ok; then
11034 echo "(I can't seem to compile the test program--assuming it can't)"
11039 echo "Yup, it can."
11042 echo "Nope, it can't."
11049 : check for ability to cast negative floats to unsigned
11051 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
11054 #$i_stdlib I_STDLIB
11056 #include <stdlib.h>
11058 #include <sys/types.h>
11059 #include <signal.h>
11060 $signal_t blech(int s) { exit(7); }
11061 $signal_t blech_in_list(int s) { exit(4); }
11062 unsigned long dummy_long(unsigned long p) { return p; }
11063 unsigned int dummy_int(unsigned int p) { return p; }
11064 unsigned short dummy_short(unsigned short p) { return p; }
11068 unsigned long along;
11070 unsigned short ashort;
11074 /* Frustrate gcc-2.7.2's optimizer which failed this test with
11075 a direct f = -123. assignment. gcc-2.8.0 reportedly
11076 optimized the whole file away
11078 /* Store the number in a writable string for gcc to pass to
11079 sscanf under HP/UX.
11081 sprintf(str, "-123");
11082 sscanf(str, "%lf", &f); /* f = -123.; */
11084 signal(SIGFPE, blech);
11085 along = (unsigned long)f;
11086 aint = (unsigned int)f;
11087 ashort = (unsigned short)f;
11088 if (along != (unsigned long)-123)
11090 if (aint != (unsigned int)-123)
11092 if (ashort != (unsigned short)-123)
11094 sprintf(str, "1073741824.");
11095 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
11098 along = (unsigned long)f;
11099 if (along != 0x80000000)
11103 along = (unsigned long)f;
11104 if (along != 0x7fffffff)
11108 along = (unsigned long)f;
11109 if (along != 0x80000001)
11113 signal(SIGFPE, blech_in_list);
11114 sprintf(str, "123.");
11115 sscanf(str, "%lf", &f); /* f = 123.; */
11116 along = dummy_long((unsigned long)f);
11117 aint = dummy_int((unsigned int)f);
11118 ashort = dummy_short((unsigned short)f);
11119 if (along != (unsigned long)123)
11121 if (aint != (unsigned int)123)
11123 if (ashort != (unsigned short)123)
11130 if eval $compile_ok; then
11134 echo "(I can't seem to compile the test program--assuming it can't)"
11137 case "$castflags" in
11139 echo "Yup, it can."
11142 echo "Nope, it can't."
11149 : see if vprintf exists
11151 if set vprintf val -f d_vprintf; eval $csym; $val; then
11152 echo 'vprintf() found.' >&4
11155 #$i_stdarg I_STDARG /* Only one of these can be defined by i_varhrd */
11156 #$i_varargs I_VARARGS
11158 #$i_stdlib I_STDLIB
11159 #$i_unistd I_UNISTD
11162 # include <stdarg.h>
11163 #else /* I_VARARGS */
11164 # include <varargs.h>
11168 # include <unistd.h>
11172 # include <stdlib.h>
11175 #include <stdio.h> /* vsprintf prototype */
11178 void xxx(int n, ...)
11183 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11185 int main() { xxx(1, "foo"); }
11187 #else /* I_VARARGS */
11195 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11197 int main() { xxx("foo"); }
11203 if eval $compile_ok; then
11204 if $run ./try; then
11205 echo "Your vsprintf() returns (int)." >&4
11208 echo "Your vsprintf() returns (char*)." >&4
11212 echo 'I am unable to compile the vsprintf() test program.' >&4
11213 # We shouldn't get here. If we do, assume the standard signature,
11214 # not the old BSD one.
11215 echo 'Guessing that vsprintf() returns (int).' >&4
11219 echo 'vprintf() NOT found.' >&4
11230 : see if chown exists
11234 : see if chroot exists
11235 set chroot d_chroot
11238 : see if chsize exists
11239 set chsize d_chsize
11242 : see if class exists
11246 : see if clearenv exists
11247 set clearenv d_clearenv
11250 : Define hasstruct macro for Configure internal use
11251 hasstruct='varname=$1; struct=$2; shift; shift;
11252 while $test $# -ge 2; do
11254 $define) echo "#include <$2>";;
11258 echo "int main () { struct $struct foo; }" >> try.c;
11260 if eval $compile; then
11269 : see whether socket exists
11273 $echo $n "Hmm... $c" >&4
11274 if set socket val -f d_socket; eval $csym; $val; then
11275 echo "Looks like you have Berkeley networking support." >&4
11277 if set setsockopt val -f; eval $csym; $val; then
11280 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
11281 d_oldsock="$define"
11284 if $contains socklib libc.list >/dev/null 2>&1; then
11285 echo "Looks like you have Berkeley networking support." >&4
11287 : we will have to assume that it supports the 4.2 BSD interface
11290 echo "You don't have Berkeley networking in libc$_a..." >&4
11291 if test "X$d_socket" = "X$define"; then
11292 echo "...but you seem to believe that you have sockets." >&4
11294 for net in net socket
11296 if test -f /usr/lib/lib$net$_a; then
11297 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
11298 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
11299 if $contains socket libc.list >/dev/null 2>&1; then
11304 echo "...but the Wollongong group seems to have hacked it in." >&4
11305 sockethdr="-I/usr/netinclude"
11308 echo "Found Berkeley sockets interface in lib$net." >&4
11309 if $contains setsockopt libc.list >/dev/null 2>&1; then
11312 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
11313 d_oldsock="$define"
11319 if test "X$d_socket" != "X$define"; then
11320 echo "or anywhere else I see." >&4
11328 : see if socketpair exists
11329 set socketpair d_sockpair
11334 echo "Checking the availability of certain socket constants..." >&4
11335 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
11336 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
11338 #include <sys/types.h>
11339 #include <sys/socket.h>
11345 set try; if eval $compile; then
11348 set d_${enum}; eval $setvar
11352 : see if this is a sys/uio.h system
11353 set sys/uio.h i_sysuio
11356 : Check for cmsghdr support
11358 echo "Checking to see if your system supports struct cmsghdr..." >&4
11359 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
11361 case "$d_cmsghdr_s" in
11362 "$define") echo "Yes, it does." ;;
11363 *) echo "No, it doesn't." ;;
11367 : check for const keyword
11369 echo 'Checking to see if your C compiler knows about "const"...' >&4
11370 $cat >const.c <<'EOCP'
11371 typedef struct spug { int drokk; } spug;
11375 const spug y = { 0 };
11378 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
11380 echo "Yup, it does."
11383 echo "Nope, it doesn't."
11388 : see if copysignl exists
11389 set copysignl d_copysignl
11392 : see if crypt exists
11397 $define) cryptlib='' ;;
11398 *) if set crypt val -f d_crypt; eval $csym; $val; then
11399 echo 'crypt() found.' >&4
11403 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
11404 if $test -z "$cryptlib"; then
11405 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
11409 if $test -z "$cryptlib"; then
11410 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
11414 if $test -z "$cryptlib"; then
11415 cryptlib=`./loc libcrypt$_a "" $libpth`
11419 if $test -z "$cryptlib"; then
11420 echo 'crypt() NOT found.' >&4
11431 : see if this is a crypt.h system
11432 set crypt.h i_crypt
11435 : see if crypt_r exists
11436 set crypt_r d_crypt_r
11438 case "$d_crypt_r" in
11440 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
11441 case "$d_crypt_r_proto:$usethreads" in
11442 ":define") d_crypt_r_proto=define
11443 set d_crypt_r_proto crypt_r $hdrs
11447 case "$d_crypt_r_proto" in
11449 case "$crypt_r_proto" in
11450 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
11451 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCS ;;
11453 case "$crypt_r_proto" in
11454 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
11455 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCD ;;
11457 case "$crypt_r_proto" in
11458 ''|0) d_crypt_r=undef
11460 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
11461 * ) case "$crypt_r_proto" in
11462 REENTRANT_PROTO*) ;;
11463 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
11465 echo "Prototype: $try" ;;
11468 *) case "$usethreads" in
11469 define) echo "crypt_r has no prototype, not using it." >&4 ;;
11480 : get csh whereabouts
11482 'csh') val="$undef" ;;
11483 *) val="$define" ;;
11487 : Respect a hint or command line value for full_csh.
11488 case "$full_csh" in
11489 '') full_csh=$csh ;;
11492 : see if ctermid exists
11493 set ctermid d_ctermid
11496 : see if ctermid_r exists
11497 set ctermid_r d_ctermid_r
11499 case "$d_ctermid_r" in
11501 hdrs="$i_systypes sys/types.h define stdio.h "
11502 case "$d_ctermid_r_proto:$usethreads" in
11503 ":define") d_ctermid_r_proto=define
11504 set d_ctermid_r_proto ctermid_r $hdrs
11508 case "$d_ctermid_r_proto" in
11510 case "$ctermid_r_proto" in
11511 ''|0) try='char* ctermid_r(char*);'
11512 ./protochk "$extern_C $try" $hdrs && ctermid_r_proto=B_B ;;
11514 case "$ctermid_r_proto" in
11515 ''|0) d_ctermid_r=undef
11517 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
11518 * ) case "$ctermid_r_proto" in
11519 REENTRANT_PROTO*) ;;
11520 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
11522 echo "Prototype: $try" ;;
11525 *) case "$usethreads" in
11526 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
11533 *) ctermid_r_proto=0
11537 : see if ctime_r exists
11538 set ctime_r d_ctime_r
11540 case "$d_ctime_r" in
11542 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
11543 case "$d_ctime_r_proto:$usethreads" in
11544 ":define") d_ctime_r_proto=define
11545 set d_ctime_r_proto ctime_r $hdrs
11549 case "$d_ctime_r_proto" in
11551 case "$ctime_r_proto" in
11552 ''|0) try='char* ctime_r(const time_t*, char*);'
11553 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SB ;;
11555 case "$ctime_r_proto" in
11556 ''|0) try='char* ctime_r(const time_t*, char*, int);'
11557 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SBI ;;
11559 case "$ctime_r_proto" in
11560 ''|0) try='int ctime_r(const time_t*, char*);'
11561 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SB ;;
11563 case "$ctime_r_proto" in
11564 ''|0) try='int ctime_r(const time_t*, char*, int);'
11565 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SBI ;;
11567 case "$ctime_r_proto" in
11568 ''|0) d_ctime_r=undef
11570 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
11571 * ) case "$ctime_r_proto" in
11572 REENTRANT_PROTO*) ;;
11573 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
11575 echo "Prototype: $try" ;;
11578 *) case "$usethreads" in
11579 define) echo "ctime_r has no prototype, not using it." >&4 ;;
11590 : see if cuserid exists
11591 set cuserid d_cuserid
11594 : see if this is a limits.h system
11595 set limits.h i_limits
11598 : see if this is a float.h system
11599 set float.h i_float
11602 : See if number of significant digits in a double precision number is known
11604 $cat >dbl_dig.c <<EOM
11605 #$i_limits I_LIMITS
11608 #include <limits.h>
11614 printf("Contains DBL_DIG");
11617 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
11618 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
11619 echo "DBL_DIG found." >&4
11622 echo "DBL_DIG NOT found." >&4
11629 : see if dbm.h is available
11630 : see if dbmclose exists
11631 set dbmclose d_dbmclose
11634 case "$d_dbmclose" in
11644 *) set rpcsvc/dbm.h i_rpcsvcdbm
11649 *) echo "We won't be including <dbm.h>"
11659 : see if prototype for dbminit is available
11661 set d_dbminitproto dbminit $i_dbm dbm.h
11664 : see if difftime exists
11665 set difftime d_difftime
11668 : see if this is a dirent system
11670 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
11672 echo "<dirent.h> found." >&4
11675 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
11676 echo "<sys/dir.h> found." >&4
11679 xinc=`./findhdr sys/ndir.h`
11681 echo "<dirent.h> NOT found." >&4
11686 : Look for type of directory structure.
11688 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11690 case "$direntrytype" in
11692 case "$i_dirent" in
11693 $define) guess1='struct dirent' ;;
11694 *) guess1='struct direct' ;;
11697 *) guess1="$direntrytype"
11702 'struct dirent') guess2='struct direct' ;;
11703 *) guess2='struct dirent' ;;
11706 if $contains "$guess1" try.c >/dev/null 2>&1; then
11707 direntrytype="$guess1"
11708 echo "Your directory entries are $direntrytype." >&4
11709 elif $contains "$guess2" try.c >/dev/null 2>&1; then
11710 direntrytype="$guess2"
11711 echo "Your directory entries seem to be $direntrytype." >&4
11713 echo "I don't recognize your system's directory entries." >&4
11714 rp="What type is used for directory entries on this system?"
11717 direntrytype="$ans"
11721 : see if the directory entry stores field length
11723 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11724 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
11725 echo "Good, your directory entry keeps length information in d_namlen." >&4
11728 echo "Your directory entry does not know about the d_namlen field." >&4
11735 : Look for DIR.dd_fd
11736 case "$i_dirent" in
11738 echo "Checking to see if DIR has a dd_fd member variable" >&4
11740 #$i_stdlib I_STDLIB
11742 #include <stdlib.h>
11744 #include <dirent.h>
11754 if eval $compile; then
11755 echo "Yes, it does."
11758 echo "No, it does not."
11763 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
11771 : see if this is an sysdir system
11772 set sys/dir.h i_sysdir
11775 : see if this is an sysndir system
11776 set sys/ndir.h i_sysndir
11781 $cat >dirfd.c <<EOM
11783 #$i_stdlib I_STDLIB
11785 #include <stdlib.h>
11787 #$i_dirent I_DIRENT /**/
11788 #$i_sysdir I_SYS_DIR /**/
11789 #$i_sysndir I_SYS_NDIR /**/
11790 #$i_systypes I_SYS_TYPES /**/
11791 #if defined(I_SYS_TYPES)
11792 #include <sys/types.h>
11794 #if defined(I_DIRENT)
11795 #include <dirent.h>
11796 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
11797 #include <sys/dir.h>
11801 #include <sys/ndir.h>
11805 #include <ndir.h> /* may be wrong in the future */
11807 #include <sys/dir.h>
11813 DIR *dirp = opendir(".");
11814 if (dirfd(dirp) >= 0)
11822 if eval $compile; then
11826 $define) echo "dirfd() found." >&4 ;;
11827 *) echo "dirfd() NOT found." >&4 ;;
11833 : see if dlerror exists
11836 set dlerror d_dlerror
11840 : see if dlfcn is available
11841 set dlfcn.h i_dlfcn
11844 : Check what extension to use for shared libs
11849 On a few systems, the dynamically loaded modules that perl generates and uses
11850 will need a different extension than shared libs. The default will probably
11856 *) dflt="$dlext" ;;
11858 rp='What is the extension of dynamically loaded modules'
11867 : Check if dlsym need a leading underscore
11873 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
11874 $cat >dyna.c <<'EOM'
11881 #$i_stdlib I_STDLIB
11883 #include <stdlib.h>
11887 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
11889 #include <sys/types.h>
11894 extern int fred() ;
11903 int mode = RTLD_LAZY ;
11905 handle = dlopen("./dyna.$dlext", mode) ;
11906 if (handle == NULL) {
11911 symbol = dlsym(handle, "fred") ;
11912 if (symbol == NULL) {
11913 /* try putting a leading underscore */
11914 symbol = dlsym(handle, "_fred") ;
11915 if (symbol == NULL) {
11928 : Call the object file tmp-dyna.o in case dlext=o.
11929 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
11930 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
11931 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
11932 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
11935 1) echo "Test program failed using dlopen." >&4
11936 echo "Perhaps you should not use dynamic loading." >&4;;
11937 2) echo "Test program failed using dlsym." >&4
11938 echo "Perhaps you should not use dynamic loading." >&4;;
11939 3) echo "dlsym needs a leading underscore" >&4
11941 4) echo "dlsym doesn't need a leading underscore." >&4;;
11944 echo "I can't compile and run the test program." >&4
11945 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
11950 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
11955 : see if drand48_r exists
11956 set drand48_r d_drand48_r
11958 case "$d_drand48_r" in
11960 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
11961 case "$d_drand48_r_proto:$usethreads" in
11962 ":define") d_drand48_r_proto=define
11963 set d_drand48_r_proto drand48_r $hdrs
11967 case "$d_drand48_r_proto" in
11969 case "$drand48_r_proto" in
11970 ''|0) try='int drand48_r(struct drand48_data*, double*);'
11971 ./protochk "$extern_C $try" $hdrs && drand48_r_proto=I_ST ;;
11973 case "$drand48_r_proto" in
11974 ''|0) d_drand48_r=undef
11976 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
11977 * ) case "$drand48_r_proto" in
11978 REENTRANT_PROTO*) ;;
11979 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
11981 echo "Prototype: $try" ;;
11984 *) case "$usethreads" in
11985 define) echo "drand48_r has no prototype, not using it." >&4 ;;
11992 *) drand48_r_proto=0
11996 : see if prototype for drand48 is available
11998 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
12001 : see if dup2 exists
12005 : see if eaccess exists
12006 set eaccess d_eaccess
12009 : see if endgrent exists
12010 set endgrent d_endgrent
12013 : see if this is an grp system
12019 xxx=`./findhdr grp.h`
12020 $cppstdin $cppflags $cppminus < $xxx >$$.h
12022 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
12034 set d_grpasswd; eval $setvar
12038 : see if endgrent_r exists
12039 set endgrent_r d_endgrent_r
12041 case "$d_endgrent_r" in
12043 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12044 case "$d_endgrent_r_proto:$usethreads" in
12045 ":define") d_endgrent_r_proto=define
12046 set d_endgrent_r_proto endgrent_r $hdrs
12050 case "$d_endgrent_r_proto" in
12052 case "$endgrent_r_proto" in
12053 ''|0) try='int endgrent_r(FILE**);'
12054 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=I_H ;;
12056 case "$endgrent_r_proto" in
12057 ''|0) try='void endgrent_r(FILE**);'
12058 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=V_H ;;
12060 case "$endgrent_r_proto" in
12061 ''|0) d_endgrent_r=undef
12063 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
12064 * ) case "$endgrent_r_proto" in
12065 REENTRANT_PROTO*) ;;
12066 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
12068 echo "Prototype: $try" ;;
12071 *) case "$usethreads" in
12072 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
12079 *) endgrent_r_proto=0
12083 : see if endhostent exists
12084 set endhostent d_endhent
12087 : see if this is a netdb.h system
12088 set netdb.h i_netdb
12091 : see if endhostent_r exists
12092 set endhostent_r d_endhostent_r
12094 case "$d_endhostent_r" in
12096 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12097 case "$d_endhostent_r_proto:$usethreads" in
12098 ":define") d_endhostent_r_proto=define
12099 set d_endhostent_r_proto endhostent_r $hdrs
12103 case "$d_endhostent_r_proto" in
12105 case "$endhostent_r_proto" in
12106 ''|0) try='int endhostent_r(struct hostent_data*);'
12107 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=I_D ;;
12109 case "$endhostent_r_proto" in
12110 ''|0) try='void endhostent_r(struct hostent_data*);'
12111 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=V_D ;;
12113 case "$endhostent_r_proto" in
12114 ''|0) d_endhostent_r=undef
12115 endhostent_r_proto=0
12116 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
12117 * ) case "$endhostent_r_proto" in
12118 REENTRANT_PROTO*) ;;
12119 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
12121 echo "Prototype: $try" ;;
12124 *) case "$usethreads" in
12125 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
12127 d_endhostent_r=undef
12128 endhostent_r_proto=0
12132 *) endhostent_r_proto=0
12136 : see if endnetent exists
12137 set endnetent d_endnent
12140 : see if endnetent_r exists
12141 set endnetent_r d_endnetent_r
12143 case "$d_endnetent_r" in
12145 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12146 case "$d_endnetent_r_proto:$usethreads" in
12147 ":define") d_endnetent_r_proto=define
12148 set d_endnetent_r_proto endnetent_r $hdrs
12152 case "$d_endnetent_r_proto" in
12154 case "$endnetent_r_proto" in
12155 ''|0) try='int endnetent_r(struct netent_data*);'
12156 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=I_D ;;
12158 case "$endnetent_r_proto" in
12159 ''|0) try='void endnetent_r(struct netent_data*);'
12160 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=V_D ;;
12162 case "$endnetent_r_proto" in
12163 ''|0) d_endnetent_r=undef
12164 endnetent_r_proto=0
12165 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
12166 * ) case "$endnetent_r_proto" in
12167 REENTRANT_PROTO*) ;;
12168 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
12170 echo "Prototype: $try" ;;
12173 *) case "$usethreads" in
12174 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
12176 d_endnetent_r=undef
12177 endnetent_r_proto=0
12181 *) endnetent_r_proto=0
12185 : see if endprotoent exists
12186 set endprotoent d_endpent
12189 : see if endprotoent_r exists
12190 set endprotoent_r d_endprotoent_r
12192 case "$d_endprotoent_r" in
12194 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12195 case "$d_endprotoent_r_proto:$usethreads" in
12196 ":define") d_endprotoent_r_proto=define
12197 set d_endprotoent_r_proto endprotoent_r $hdrs
12201 case "$d_endprotoent_r_proto" in
12203 case "$endprotoent_r_proto" in
12204 ''|0) try='int endprotoent_r(struct protoent_data*);'
12205 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=I_D ;;
12207 case "$endprotoent_r_proto" in
12208 ''|0) try='void endprotoent_r(struct protoent_data*);'
12209 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=V_D ;;
12211 case "$endprotoent_r_proto" in
12212 ''|0) d_endprotoent_r=undef
12213 endprotoent_r_proto=0
12214 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
12215 * ) case "$endprotoent_r_proto" in
12216 REENTRANT_PROTO*) ;;
12217 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
12219 echo "Prototype: $try" ;;
12222 *) case "$usethreads" in
12223 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
12225 d_endprotoent_r=undef
12226 endprotoent_r_proto=0
12230 *) endprotoent_r_proto=0
12234 : see if endpwent exists
12235 set endpwent d_endpwent
12238 : see if this is a pwd.h system
12244 xxx=`./findhdr pwd.h`
12245 $cppstdin $cppflags $cppminus < $xxx >$$.h
12247 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
12255 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
12263 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
12271 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
12279 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
12287 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
12295 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
12303 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
12315 set d_pwquota; eval $setvar
12316 set d_pwage; eval $setvar
12317 set d_pwchange; eval $setvar
12318 set d_pwclass; eval $setvar
12319 set d_pwexpire; eval $setvar
12320 set d_pwcomment; eval $setvar
12321 set d_pwgecos; eval $setvar
12322 set d_pwpasswd; eval $setvar
12326 : see if endpwent_r exists
12327 set endpwent_r d_endpwent_r
12329 case "$d_endpwent_r" in
12331 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
12332 case "$d_endpwent_r_proto:$usethreads" in
12333 ":define") d_endpwent_r_proto=define
12334 set d_endpwent_r_proto endpwent_r $hdrs
12338 case "$d_endpwent_r_proto" in
12340 case "$endpwent_r_proto" in
12341 ''|0) try='int endpwent_r(FILE**);'
12342 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=I_H ;;
12344 case "$endpwent_r_proto" in
12345 ''|0) try='void endpwent_r(FILE**);'
12346 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=V_H ;;
12348 case "$endpwent_r_proto" in
12349 ''|0) d_endpwent_r=undef
12351 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
12352 * ) case "$endpwent_r_proto" in
12353 REENTRANT_PROTO*) ;;
12354 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
12356 echo "Prototype: $try" ;;
12359 *) case "$usethreads" in
12360 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
12367 *) endpwent_r_proto=0
12371 : see if endservent exists
12372 set endservent d_endsent
12375 : see if endservent_r exists
12376 set endservent_r d_endservent_r
12378 case "$d_endservent_r" in
12380 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12381 case "$d_endservent_r_proto:$usethreads" in
12382 ":define") d_endservent_r_proto=define
12383 set d_endservent_r_proto endservent_r $hdrs
12387 case "$d_endservent_r_proto" in
12389 case "$endservent_r_proto" in
12390 ''|0) try='int endservent_r(struct servent_data*);'
12391 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=I_D ;;
12393 case "$endservent_r_proto" in
12394 ''|0) try='void endservent_r(struct servent_data*);'
12395 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=V_D ;;
12397 case "$endservent_r_proto" in
12398 ''|0) d_endservent_r=undef
12399 endservent_r_proto=0
12400 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
12401 * ) case "$endservent_r_proto" in
12402 REENTRANT_PROTO*) ;;
12403 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
12405 echo "Prototype: $try" ;;
12408 *) case "$usethreads" in
12409 define) echo "endservent_r has no prototype, not using it." >&4 ;;
12411 d_endservent_r=undef
12412 endservent_r_proto=0
12416 *) endservent_r_proto=0
12420 : Locate the flags for 'open()'
12423 #include <sys/types.h>
12428 #include <sys/file.h>
12430 #$i_stdlib I_STDLIB
12432 #include <stdlib.h>
12443 : check sys/file.h first to get FREAD on Sun
12444 if $test `./findhdr sys/file.h` && \
12445 set try -DI_SYS_FILE && eval $compile; then
12447 echo "<sys/file.h> defines the O_* constants..." >&4
12448 if $run ./try; then
12449 echo "and you have the 3 argument form of open()." >&4
12452 echo "but not the 3 argument form of open(). Oh, well." >&4
12455 elif $test `./findhdr fcntl.h` && \
12456 set try -DI_FCNTL && eval $compile; then
12458 echo "<fcntl.h> defines the O_* constants..." >&4
12459 if $run ./try; then
12460 echo "and you have the 3 argument form of open()." >&4
12463 echo "but not the 3 argument form of open(). Oh, well." >&4
12468 echo "I can't find the O_* constant definitions! You got problems." >&4
12474 : see if this is a sys/file.h system
12479 : do we need to include sys/file.h ?
12483 if $h_sysfile; then
12485 echo "We'll be including <sys/file.h>." >&4
12488 echo "We won't be including <sys/file.h>." >&4
12498 : see if fcntl.h is there
12503 : see if we can include fcntl.h
12509 echo "We'll be including <fcntl.h>." >&4
12512 if $h_sysfile; then
12513 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
12515 echo "We won't be including <fcntl.h>." >&4
12527 : see if fork exists
12531 : see if pipe exists
12535 : check for non-blocking I/O stuff
12536 case "$h_sysfile" in
12537 true) echo "#include <sys/file.h>" > head.c;;
12540 true) echo "#include <fcntl.h>" > head.c;;
12541 *) echo "#include <sys/fcntl.h>" > head.c;;
12546 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
12547 case "$o_nonblock" in
12549 $cat head.c > try.c
12550 $cat >>try.c <<EOCP
12552 #$i_stdlib I_STDLIB
12554 #include <stdlib.h>
12562 printf("O_NONBLOCK\n");
12566 printf("O_NDELAY\n");
12570 printf("FNDELAY\n");
12577 if eval $compile_ok; then
12578 o_nonblock=`$run ./try`
12579 case "$o_nonblock" in
12580 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
12581 *) echo "Seems like we can use $o_nonblock.";;
12584 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
12587 *) echo "Using $hint value $o_nonblock.";;
12592 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
12595 case "$d_fork:$d_pipe" in
12597 $cat head.c > try.c
12598 $cat >>try.c <<EOCP
12600 #include <sys/types.h>
12601 #include <signal.h>
12603 #$i_stdlib I_STDLIB
12605 #include <stdlib.h>
12611 #define MY_O_NONBLOCK $o_nonblock
12612 #ifndef errno /* XXX need better Configure test */
12615 #$i_unistd I_UNISTD
12617 #include <unistd.h>
12619 #$i_string I_STRING
12621 #include <string.h>
12623 #include <strings.h>
12625 $signal_t blech(int x) { exit(3); }
12627 $cat >> try.c <<'EOCP'
12635 pipe(pd); /* Down: child -> parent */
12636 pipe(pu); /* Up: parent -> child */
12639 close(pd[1]); /* Parent reads from pd[0] */
12640 close(pu[0]); /* Parent writes (blocking) to pu[1] */
12642 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
12647 signal(SIGALRM, blech);
12649 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
12651 sprintf(string, "%d\n", ret);
12652 write(2, string, strlen(string));
12655 if (errno == EAGAIN) {
12656 printf("EAGAIN\n");
12661 if (errno == EWOULDBLOCK)
12662 printf("EWOULDBLOCK\n");
12665 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
12666 sleep(2); /* Give it time to close our pipe */
12668 ret = read(pd[0], buf, 1); /* Should read EOF */
12670 sprintf(string, "%d\n", ret);
12671 write(4, string, strlen(string));
12675 close(pd[0]); /* We write to pd[1] */
12676 close(pu[1]); /* We read from pu[0] */
12677 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
12678 close(pd[1]); /* Pipe pd is now fully closed! */
12679 exit(0); /* Bye bye, thank you for playing! */
12683 if eval $compile_ok; then
12684 echo "$startsh" >mtry
12685 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
12687 ./mtry >/dev/null 2>&1
12689 0) eagain=`$cat try.out`;;
12690 1) echo "Could not perform non-blocking setting!";;
12691 2) echo "I did a successful read() for something that was not there!";;
12692 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
12693 4) echo "Could not find F_SETFL!";;
12694 *) echo "Something terribly wrong happened during testing.";;
12696 rd_nodata=`$cat try.ret`
12697 echo "A read() system call with no data present returns $rd_nodata."
12698 case "$rd_nodata" in
12701 echo "(That's peculiar, fixing that to be -1.)"
12707 echo "Forcing errno EAGAIN on read() with no data available."
12711 echo "Your read() sets errno to $eagain when no data is available."
12714 status=`$cat try.err`
12716 0) echo "And it correctly returns 0 to signal EOF.";;
12717 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
12718 *) echo "However, your read() returns '$status' on EOF??";;
12721 if test "$status" = "$rd_nodata"; then
12722 echo "WARNING: you can't distinguish between EOF and no data!"
12726 echo "I can't compile the test program--assuming errno EAGAIN will do."
12730 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
12739 echo "Using $hint value $eagain."
12740 echo "Your read() returns $rd_nodata when no data is present."
12741 case "$d_eofnblk" in
12742 "$define") echo "And you can see EOF because read() returns 0.";;
12743 "$undef") echo "But you can't see EOF status from read() returned value.";;
12745 echo "(Assuming you can't see EOF status from read anyway.)"
12751 $rm_try head.c mtry
12753 : see if _ptr and _cnt from stdio act std
12756 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
12757 echo "(Looks like you have stdio.h from BSD.)"
12758 case "$stdio_ptr" in
12759 '') stdio_ptr='((fp)->_p)'
12762 *) ptr_lval=$d_stdio_ptr_lval;;
12764 case "$stdio_cnt" in
12765 '') stdio_cnt='((fp)->_r)'
12768 *) cnt_lval=$d_stdio_cnt_lval;;
12770 case "$stdio_base" in
12771 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
12773 case "$stdio_bufsiz" in
12774 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
12776 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
12777 echo "(Looks like you have stdio.h from Linux.)"
12778 case "$stdio_ptr" in
12779 '') stdio_ptr='((fp)->_IO_read_ptr)'
12782 *) ptr_lval=$d_stdio_ptr_lval;;
12784 case "$stdio_cnt" in
12785 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
12788 *) cnt_lval=$d_stdio_cnt_lval;;
12790 case "$stdio_base" in
12791 '') stdio_base='((fp)->_IO_read_base)';;
12793 case "$stdio_bufsiz" in
12794 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
12797 case "$stdio_ptr" in
12798 '') stdio_ptr='((fp)->_ptr)'
12801 *) ptr_lval=$d_stdio_ptr_lval;;
12803 case "$stdio_cnt" in
12804 '') stdio_cnt='((fp)->_cnt)'
12807 *) cnt_lval=$d_stdio_cnt_lval;;
12809 case "$stdio_base" in
12810 '') stdio_base='((fp)->_base)';;
12812 case "$stdio_bufsiz" in
12813 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
12817 : test whether _ptr and _cnt really work
12818 echo "Checking how std your stdio is..." >&4
12821 #$i_stdlib I_STDLIB
12823 #include <stdlib.h>
12825 #define FILE_ptr(fp) $stdio_ptr
12826 #define FILE_cnt(fp) $stdio_cnt
12828 FILE *fp = fopen("try.c", "r");
12831 18 <= FILE_cnt(fp) &&
12832 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12840 if eval $compile && $to try.c; then
12841 if $run ./try; then
12842 echo "Your stdio acts pretty std."
12845 echo "Your stdio isn't very std."
12848 echo "Your stdio doesn't appear very std."
12852 # glibc 2.2.90 and above apparently change stdio streams so Perl's
12853 # direct buffer manipulation no longer works. The Configure tests
12854 # should be changed to correctly detect this, but until then,
12855 # the following check should at least let perl compile and run.
12856 # (This quick fix should be updated before 5.8.1.)
12857 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
12858 # A. Dougherty, June 3, 2002.
12859 case "$d_gnulibc" in
12861 case "$gnulibc_version" in
12865 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
12874 : Can _ptr be used as an lvalue?
12875 case "$d_stdstdio$ptr_lval" in
12876 $define$define) val=$define ;;
12879 set d_stdio_ptr_lval
12882 : Can _cnt be used as an lvalue?
12883 case "$d_stdstdio$cnt_lval" in
12884 $define$define) val=$define ;;
12887 set d_stdio_cnt_lval
12891 : test whether setting _ptr sets _cnt as a side effect
12892 d_stdio_ptr_lval_sets_cnt="$undef"
12893 d_stdio_ptr_lval_nochange_cnt="$undef"
12894 case "$d_stdio_ptr_lval$d_stdstdio" in
12896 echo "Checking to see what happens if we set the stdio ptr..." >&4
12899 /* Can we scream? */
12900 /* Eat dust sed :-) */
12901 /* In the buffer space, no one can hear you scream. */
12902 #$i_stdlib I_STDLIB
12904 #include <stdlib.h>
12906 #define FILE_ptr(fp) $stdio_ptr
12907 #define FILE_cnt(fp) $stdio_cnt
12908 #include <sys/types.h>
12910 FILE *fp = fopen("try.c", "r");
12915 puts("Fail even to read");
12918 c = getc(fp); /* Read away the first # */
12920 puts("Fail even to read");
12924 18 <= FILE_cnt(fp) &&
12925 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12927 puts("Fail even to read");
12930 ptr = (char*) FILE_ptr(fp);
12931 cnt = (size_t)FILE_cnt(fp);
12933 FILE_ptr(fp) += 42;
12935 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
12936 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
12939 if (FILE_cnt(fp) <= 20) {
12940 printf ("Fail (<20 chars to test)");
12943 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
12944 puts("Fail compare");
12947 if (cnt == FILE_cnt(fp)) {
12948 puts("Pass_unchanged");
12951 if (FILE_cnt(fp) == (cnt - 42)) {
12952 puts("Pass_changed");
12955 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
12961 if eval $compile && $to try.c; then
12962 case `$run ./try` in
12964 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
12965 d_stdio_ptr_lval_sets_cnt="$define" ;;
12967 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
12968 d_stdio_ptr_lval_nochange_cnt="$define" ;;
12970 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
12972 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
12975 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
12981 : see if _base is also standard
12983 case "$d_stdstdio" in
12987 #$i_stdlib I_STDLIB
12989 #include <stdlib.h>
12991 #define FILE_base(fp) $stdio_base
12992 #define FILE_bufsiz(fp) $stdio_bufsiz
12994 FILE *fp = fopen("try.c", "r");
12997 19 <= FILE_bufsiz(fp) &&
12998 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
13005 if eval $compile && $to try.c; then
13006 if $run ./try; then
13007 echo "And its _base field acts std."
13010 echo "But its _base field isn't std."
13013 echo "However, it seems to be lacking the _base field."
13021 : see if fast_stdio exists
13023 case "$d_stdstdio:$d_stdio_ptr_lval" in
13025 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
13027 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
13038 : see if fchdir exists
13039 set fchdir d_fchdir
13042 : see if fchmod exists
13043 set fchmod d_fchmod
13046 : see if fchown exists
13047 set fchown d_fchown
13050 : see if this is an fcntl system
13054 : See if fcntl-based locking works.
13057 #$i_stdlib I_STDLIB
13059 #include <stdlib.h>
13061 #include <unistd.h>
13063 #include <signal.h>
13064 $signal_t blech(int x) { exit(3); }
13066 #if defined(F_SETLK) && defined(F_SETLKW)
13067 struct flock flock;
13069 fd = open("try.c", O_RDONLY);
13070 flock.l_type = F_RDLCK;
13071 flock.l_whence = SEEK_SET;
13072 flock.l_start = flock.l_len = 0;
13073 signal(SIGALRM, blech);
13075 retval = fcntl(fd, F_SETLK, &flock);
13077 (retval < 0 ? exit(2) : exit(0));
13083 echo "Checking if fcntl-based file locking works... "
13087 if eval $compile_ok; then
13088 if $run ./try; then
13089 echo "Yes, it seems to work."
13092 echo "Nope, it didn't work."
13097 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
13098 *** This is (almost) impossible.
13099 *** If your NFS lock daemons are not feeling well, something like
13100 *** this may happen, please investigate. Cannot continue, aborting.
13108 echo "I'm unable to compile the test program, so I'll assume not."
13113 echo "Nope, since you don't even have fcntl()."
13116 set d_fcntl_can_lock
13120 : check for fd_set items
13123 Checking to see how well your C compiler handles fd_set and friends ...
13126 #$i_stdlib I_STDLIB
13128 #include <stdlib.h>
13130 #$i_systime I_SYS_TIME
13131 #$i_sysselct I_SYS_SELECT
13132 #$d_socket HAS_SOCKET
13133 #include <sys/types.h>
13135 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
13138 #include <sys/time.h>
13140 #ifdef I_SYS_SELECT
13141 #include <sys/select.h>
13150 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
13158 if eval $compile; then
13159 d_fds_bits="$define"
13161 echo "Well, your system knows about the normal fd_set typedef..." >&4
13162 if $run ./try; then
13163 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
13164 d_fd_macros="$define"
13167 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
13169 d_fd_macros="$undef"
13173 Hmm, your compiler has some difficulty with fd_set. Checking further...
13176 if eval $compile; then
13177 d_fds_bits="$undef"
13179 echo "Well, your system has some sort of fd_set available..." >&4
13180 if $run ./try; then
13181 echo "and you have the normal fd_set macros." >&4
13182 d_fd_macros="$define"
13185 but not the normal fd_set macros! Gross! More work for me...
13187 d_fd_macros="$undef"
13190 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
13192 d_fds_bits="$undef"
13193 d_fd_macros="$undef"
13198 : see if fgetpos exists
13199 set fgetpos d_fgetpos
13202 : see if finite exists
13203 set finite d_finite
13206 : see if finitel exists
13207 set finitel d_finitel
13210 : see if flock exists
13214 : see if prototype for flock is available
13216 set d_flockproto flock $i_sysfile sys/file.h
13219 : see if fp_class exists
13220 set fp_class d_fp_class
13223 : see if pathconf exists
13224 set pathconf d_pathconf
13227 : see if fpathconf exists
13228 set fpathconf d_fpathconf
13231 : see if fpclass exists
13232 set fpclass d_fpclass
13235 : see if fpclassify exists
13236 set fpclassify d_fpclassify
13239 : see if fpclassl exists
13240 set fpclassl d_fpclassl
13243 : check for fpos64_t
13245 echo "Checking to see if you have fpos64_t..." >&4
13248 int main() { fpos64_t x = 7; }
13251 if eval $compile; then
13253 echo "You have fpos64_t."
13256 echo "You do not have fpos64_t."
13257 case "$fpossize" in
13258 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
13265 : see if frexpl exists
13266 set frexpl d_frexpl
13269 : see if this is a sys/param system
13270 set sys/param.h i_sysparam
13273 : see if this is a sys/mount.h system
13274 set sys/mount.h i_sysmount
13277 : Check for fs_data_s
13279 echo "Checking to see if your system supports struct fs_data..." >&4
13280 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
13282 case "$d_fs_data_s" in
13283 "$define") echo "Yes, it does." ;;
13284 *) echo "No, it doesn't." ;;
13287 : see if fseeko exists
13288 set fseeko d_fseeko
13290 case "$longsize" in
13291 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
13294 : see if fsetpos exists
13295 set fsetpos d_fsetpos
13298 : see if fstatfs exists
13299 set fstatfs d_fstatfs
13302 : see if statvfs exists
13303 set statvfs d_statvfs
13306 : see if fstatvfs exists
13307 set fstatvfs d_fstatvfs
13311 : see if fsync exists
13315 : see if ftello exists
13316 set ftello d_ftello
13318 case "$longsize" in
13319 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
13322 : check for a working futimes
13325 echo "Checking if you have a working futimes()" >&4
13328 #include <sys/time.h>
13335 fd = open ("try.c", O_RDWR);
13336 if (-1 == fd) exit (1);
13337 rv = futimes (fd, NULL);
13338 exit (rv == -1 ? errno : 0);
13342 if eval $compile; then
13346 0) echo "Yes, you have" >&4
13347 d_futimes="$define"
13349 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
13353 echo "No, it does not (probably harmless)" >&4
13357 : see if ndbm.h is available
13360 : Compatibility location for RedHat 7.1
13361 set gdbm/ndbm.h i_gdbmndbm
13363 : Compatibility location for Debian 4.0
13364 set gdbm-ndbm.h i_gdbm_ndbm
13368 if $test "$i_ndbm" = "$define" -o "$i_gdbmndbm" = "$define" -o "$i_gdbm_ndbm" = "$define"; then
13369 : see if dbm_open exists
13370 set dbm_open d_dbm_open
13372 case "$d_dbm_open" in
13375 i_gdbmndbm="$undef"
13376 i_gdbm_ndbm="$undef"
13377 echo "We won't be including <ndbm.h>"
13387 ndbm_hdr_protochk='name=$1; hdr=$2;
13388 eval "ihdr=\$""i_$name";
13390 if $test "$ihdr" = "$define"; then
13391 $echo "Checking if your <$hdr> uses prototypes..." >&4;
13392 case "$d_cplusplus" in
13393 $define) ./protochk "$extern_C void dbm_close(DBM *);" literal "extern \"C\" {" $ihdr $hdr literal "}" && val="$define" ;;
13394 *) ./protochk "$extern_C void dbm_close(int, int);" $ihdr $hdr || val="$define" ;;
13397 $define) $echo "Your <$hdr> seems to have prototypes";;
13398 *) $echo "Your <$hdr> does not seem to have prototypes";;
13401 set "d_${name}_h_uses_prototypes";
13405 eval $ndbm_hdr_protochk
13406 set gdbmndbm gdbm/ndbm.h
13407 eval $ndbm_hdr_protochk
13408 set gdbm_ndbm gdbm-ndbm.h
13409 eval $ndbm_hdr_protochk
13411 : see if getaddrinfo exists
13412 set getaddrinfo d_getaddrinfo
13415 : see if getcwd exists
13416 set getcwd d_getcwd
13419 : see if getespwnam exists
13420 set getespwnam d_getespwnam
13423 : see if getfsstat exists
13424 set getfsstat d_getfsstat
13427 : see if getgrent exists
13428 set getgrent d_getgrent
13431 : see if getgrent_r exists
13432 set getgrent_r d_getgrent_r
13434 case "$d_getgrent_r" in
13436 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13437 case "$d_getgrent_r_proto:$usethreads" in
13438 ":define") d_getgrent_r_proto=define
13439 set d_getgrent_r_proto getgrent_r $hdrs
13443 case "$d_getgrent_r_proto" in
13445 case "$getgrent_r_proto" in
13446 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
13447 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBWR ;;
13449 case "$getgrent_r_proto" in
13450 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
13451 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIR ;;
13453 case "$getgrent_r_proto" in
13454 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
13455 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBW ;;
13457 case "$getgrent_r_proto" in
13458 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
13459 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBI ;;
13461 case "$getgrent_r_proto" in
13462 ''|0) try='int getgrent_r(struct group*, char*, int);'
13463 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBI ;;
13465 case "$getgrent_r_proto" in
13466 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
13467 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIH ;;
13469 case "$getgrent_r_proto" in
13470 ''|0) d_getgrent_r=undef
13472 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
13473 * ) case "$getgrent_r_proto" in
13474 REENTRANT_PROTO*) ;;
13475 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
13477 echo "Prototype: $try" ;;
13480 *) case "$usethreads" in
13481 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
13488 *) getgrent_r_proto=0
13492 : see if getgrgid_r exists
13493 set getgrgid_r d_getgrgid_r
13495 case "$d_getgrgid_r" in
13497 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13498 case "$d_getgrgid_r_proto:$usethreads" in
13499 ":define") d_getgrgid_r_proto=define
13500 set d_getgrgid_r_proto getgrgid_r $hdrs
13504 case "$d_getgrgid_r_proto" in
13506 case "$getgrgid_r_proto" in
13507 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
13508 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
13510 case "$getgrgid_r_proto" in
13511 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
13512 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
13514 case "$getgrgid_r_proto" in
13515 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
13516 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
13518 case "$getgrgid_r_proto" in
13519 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
13520 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
13522 case "$getgrgid_r_proto" in
13523 ''|0) d_getgrgid_r=undef
13525 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
13526 * ) case "$getgrgid_r_proto" in
13527 REENTRANT_PROTO*) ;;
13528 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
13530 echo "Prototype: $try" ;;
13533 *) case "$usethreads" in
13534 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
13541 *) getgrgid_r_proto=0
13545 : see if getgrnam_r exists
13546 set getgrnam_r d_getgrnam_r
13548 case "$d_getgrnam_r" in
13550 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13551 case "$d_getgrnam_r_proto:$usethreads" in
13552 ":define") d_getgrnam_r_proto=define
13553 set d_getgrnam_r_proto getgrnam_r $hdrs
13557 case "$d_getgrnam_r_proto" in
13559 case "$getgrnam_r_proto" in
13560 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
13561 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
13563 case "$getgrnam_r_proto" in
13564 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
13565 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
13567 case "$getgrnam_r_proto" in
13568 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
13569 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CBI ;;
13571 case "$getgrnam_r_proto" in
13572 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
13573 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
13575 case "$getgrnam_r_proto" in
13576 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
13577 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
13579 case "$getgrnam_r_proto" in
13580 ''|0) d_getgrnam_r=undef
13582 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
13583 * ) case "$getgrnam_r_proto" in
13584 REENTRANT_PROTO*) ;;
13585 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
13587 echo "Prototype: $try" ;;
13590 *) case "$usethreads" in
13591 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
13598 *) getgrnam_r_proto=0
13602 : see if gethostbyaddr exists
13603 set gethostbyaddr d_gethbyaddr
13606 : see if gethostbyname exists
13607 set gethostbyname d_gethbyname
13610 : see if gethostent exists
13611 set gethostent d_gethent
13614 : see how we will look up host name
13617 if set gethostname val -f d_gethname; eval $csym; $val; then
13618 echo 'gethostname() found.' >&4
13619 d_gethname="$define"
13622 if set uname val -f d_uname; eval $csym; $val; then
13625 uname() was found, but you're running xenix, and older versions of xenix
13626 have a broken uname(). If you don't really know whether your xenix is old
13627 enough to have a broken system call, use the default answer.
13632 "$define") dflt=n;;
13634 rp='Is your uname() broken?'
13637 n*) d_uname="$define"; call=uname;;
13640 echo 'uname() found.' >&4
13647 case "$d_gethname" in
13648 '') d_gethname="$undef";;
13651 '') d_uname="$undef";;
13653 case "$d_uname$d_gethname" in
13658 Every now and then someone has a $call() that lies about the hostname
13659 but can't be fixed for political or economic reasons. If you wish, I can
13660 pretend $call() isn't there and maybe compute hostname at run-time
13661 thanks to the '$phostname' command.
13664 rp="Shall I ignore $call() from now on?"
13667 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
13670 case "$phostname" in
13671 '') aphostname='';;
13672 *) case "$aphostname" in
13674 *) set X $phostname
13678 file=`./loc $file $file $pth`
13679 aphostname=`echo $file $*`
13684 case "$d_uname$d_gethname" in
13687 case "$phostname" in
13689 echo "There will be no way for $package to get your hostname." >&4;;
13691 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
13695 case "$d_phostname" in
13696 '') d_phostname="$undef";;
13699 : see if gethostbyaddr_r exists
13700 set gethostbyaddr_r d_gethostbyaddr_r
13702 case "$d_gethostbyaddr_r" in
13704 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13705 case "$d_gethostbyaddr_r_proto:$usethreads" in
13706 ":define") d_gethostbyaddr_r_proto=define
13707 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
13711 case "$d_gethostbyaddr_r_proto" in
13713 case "$gethostbyaddr_r_proto" in
13714 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13715 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
13717 case "$gethostbyaddr_r_proto" in
13718 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
13719 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
13721 case "$gethostbyaddr_r_proto" in
13722 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
13723 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
13725 case "$gethostbyaddr_r_proto" in
13726 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
13727 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
13729 case "$gethostbyaddr_r_proto" in
13730 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
13731 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
13733 case "$gethostbyaddr_r_proto" in
13734 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
13735 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
13737 case "$gethostbyaddr_r_proto" in
13738 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
13739 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
13741 case "$gethostbyaddr_r_proto" in
13742 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
13743 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
13745 case "$gethostbyaddr_r_proto" in
13746 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
13747 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
13749 case "$gethostbyaddr_r_proto" in
13750 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
13751 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
13753 case "$gethostbyaddr_r_proto" in
13754 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13755 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
13757 case "$gethostbyaddr_r_proto" in
13758 ''|0) d_gethostbyaddr_r=undef
13759 gethostbyaddr_r_proto=0
13760 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
13761 * ) case "$gethostbyaddr_r_proto" in
13762 REENTRANT_PROTO*) ;;
13763 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
13765 echo "Prototype: $try" ;;
13768 *) case "$usethreads" in
13769 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
13771 d_gethostbyaddr_r=undef
13772 gethostbyaddr_r_proto=0
13776 *) gethostbyaddr_r_proto=0
13780 : see if gethostbyname_r exists
13781 set gethostbyname_r d_gethostbyname_r
13783 case "$d_gethostbyname_r" in
13785 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13786 case "$d_gethostbyname_r_proto:$usethreads" in
13787 ":define") d_gethostbyname_r_proto=define
13788 set d_gethostbyname_r_proto gethostbyname_r $hdrs
13792 case "$d_gethostbyname_r_proto" in
13794 case "$gethostbyname_r_proto" in
13795 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
13796 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
13798 case "$gethostbyname_r_proto" in
13799 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
13800 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
13802 case "$gethostbyname_r_proto" in
13803 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
13804 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
13806 case "$gethostbyname_r_proto" in
13807 ''|0) d_gethostbyname_r=undef
13808 gethostbyname_r_proto=0
13809 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
13810 * ) case "$gethostbyname_r_proto" in
13811 REENTRANT_PROTO*) ;;
13812 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
13814 echo "Prototype: $try" ;;
13817 *) case "$usethreads" in
13818 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
13820 d_gethostbyname_r=undef
13821 gethostbyname_r_proto=0
13825 *) gethostbyname_r_proto=0
13829 : see if gethostent_r exists
13830 set gethostent_r d_gethostent_r
13832 case "$d_gethostent_r" in
13834 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13835 case "$d_gethostent_r_proto:$usethreads" in
13836 ":define") d_gethostent_r_proto=define
13837 set d_gethostent_r_proto gethostent_r $hdrs
13841 case "$d_gethostent_r_proto" in
13843 case "$gethostent_r_proto" in
13844 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
13845 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
13847 case "$gethostent_r_proto" in
13848 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
13849 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBIE ;;
13851 case "$gethostent_r_proto" in
13852 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
13853 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBIE ;;
13855 case "$gethostent_r_proto" in
13856 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
13857 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBI ;;
13859 case "$gethostent_r_proto" in
13860 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
13861 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBI ;;
13863 case "$gethostent_r_proto" in
13864 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
13865 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SD ;;
13867 case "$gethostent_r_proto" in
13868 ''|0) d_gethostent_r=undef
13869 gethostent_r_proto=0
13870 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
13871 * ) case "$gethostent_r_proto" in
13872 REENTRANT_PROTO*) ;;
13873 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
13875 echo "Prototype: $try" ;;
13878 *) case "$usethreads" in
13879 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
13881 d_gethostent_r=undef
13882 gethostent_r_proto=0
13886 *) gethostent_r_proto=0
13890 : see if prototypes for various gethostxxx netdb.h functions are available
13892 set d_gethostprotos gethostent $i_netdb netdb.h
13895 : see if getitimer exists
13896 set getitimer d_getitimer
13899 : see if getlogin exists
13900 set getlogin d_getlogin
13903 : see if getlogin_r exists
13904 set getlogin_r d_getlogin_r
13906 case "$d_getlogin_r" in
13908 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
13909 case "$d_getlogin_r_proto:$usethreads" in
13910 ":define") d_getlogin_r_proto=define
13911 set d_getlogin_r_proto getlogin_r $hdrs
13915 case "$d_getlogin_r_proto" in
13917 case "$getlogin_r_proto" in
13918 ''|0) try='int getlogin_r(char*, size_t);'
13919 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BW ;;
13921 case "$getlogin_r_proto" in
13922 ''|0) try='int getlogin_r(char*, int);'
13923 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BI ;;
13925 case "$getlogin_r_proto" in
13926 ''|0) try='char* getlogin_r(char*, size_t);'
13927 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BW ;;
13929 case "$getlogin_r_proto" in
13930 ''|0) try='char* getlogin_r(char*, int);'
13931 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BI ;;
13933 case "$getlogin_r_proto" in
13934 ''|0) d_getlogin_r=undef
13936 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
13937 * ) case "$getlogin_r_proto" in
13938 REENTRANT_PROTO*) ;;
13939 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
13941 echo "Prototype: $try" ;;
13944 *) case "$usethreads" in
13945 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
13952 *) getlogin_r_proto=0
13956 : see if getmnt exists
13957 set getmnt d_getmnt
13960 : see if getmntent exists
13961 set getmntent d_getmntent
13964 : see if getnameinfo exists
13965 set getnameinfo d_getnameinfo
13968 : see if getnetbyaddr exists
13969 set getnetbyaddr d_getnbyaddr
13972 : see if getnetbyname exists
13973 set getnetbyname d_getnbyname
13976 : see if getnetent exists
13977 set getnetent d_getnent
13980 : see if getnetbyaddr_r exists
13981 set getnetbyaddr_r d_getnetbyaddr_r
13983 case "$d_getnetbyaddr_r" in
13985 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13986 case "$d_getnetbyaddr_r_proto:$usethreads" in
13987 ":define") d_getnetbyaddr_r_proto=define
13988 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
13992 case "$d_getnetbyaddr_r_proto" in
13994 case "$getnetbyaddr_r_proto" in
13995 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
13996 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
13998 case "$getnetbyaddr_r_proto" in
13999 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
14000 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
14002 case "$getnetbyaddr_r_proto" in
14003 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
14004 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
14006 case "$getnetbyaddr_r_proto" in
14007 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
14008 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
14010 case "$getnetbyaddr_r_proto" in
14011 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
14012 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
14014 case "$getnetbyaddr_r_proto" in
14015 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
14016 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
14018 case "$getnetbyaddr_r_proto" in
14019 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
14020 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
14022 case "$getnetbyaddr_r_proto" in
14023 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
14024 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
14026 case "$getnetbyaddr_r_proto" in
14027 ''|0) d_getnetbyaddr_r=undef
14028 getnetbyaddr_r_proto=0
14029 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
14030 * ) case "$getnetbyaddr_r_proto" in
14031 REENTRANT_PROTO*) ;;
14032 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
14034 echo "Prototype: $try" ;;
14037 *) case "$usethreads" in
14038 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
14040 d_getnetbyaddr_r=undef
14041 getnetbyaddr_r_proto=0
14045 *) getnetbyaddr_r_proto=0
14049 : see if getnetbyname_r exists
14050 set getnetbyname_r d_getnetbyname_r
14052 case "$d_getnetbyname_r" in
14054 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14055 case "$d_getnetbyname_r_proto:$usethreads" in
14056 ":define") d_getnetbyname_r_proto=define
14057 set d_getnetbyname_r_proto getnetbyname_r $hdrs
14061 case "$d_getnetbyname_r_proto" in
14063 case "$getnetbyname_r_proto" in
14064 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
14065 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
14067 case "$getnetbyname_r_proto" in
14068 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
14069 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
14071 case "$getnetbyname_r_proto" in
14072 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
14073 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
14075 case "$getnetbyname_r_proto" in
14076 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
14077 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
14079 case "$getnetbyname_r_proto" in
14080 ''|0) d_getnetbyname_r=undef
14081 getnetbyname_r_proto=0
14082 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
14083 * ) case "$getnetbyname_r_proto" in
14084 REENTRANT_PROTO*) ;;
14085 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
14087 echo "Prototype: $try" ;;
14090 *) case "$usethreads" in
14091 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
14093 d_getnetbyname_r=undef
14094 getnetbyname_r_proto=0
14098 *) getnetbyname_r_proto=0
14102 : see if getnetent_r exists
14103 set getnetent_r d_getnetent_r
14105 case "$d_getnetent_r" in
14107 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14108 case "$d_getnetent_r_proto:$usethreads" in
14109 ":define") d_getnetent_r_proto=define
14110 set d_getnetent_r_proto getnetent_r $hdrs
14114 case "$d_getnetent_r_proto" in
14116 case "$getnetent_r_proto" in
14117 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
14118 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
14120 case "$getnetent_r_proto" in
14121 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
14122 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBIE ;;
14124 case "$getnetent_r_proto" in
14125 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
14126 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBIE ;;
14128 case "$getnetent_r_proto" in
14129 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
14130 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBI ;;
14132 case "$getnetent_r_proto" in
14133 ''|0) try='int getnetent_r(struct netent*, char*, int);'
14134 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBI ;;
14136 case "$getnetent_r_proto" in
14137 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
14138 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SD ;;
14140 case "$getnetent_r_proto" in
14141 ''|0) d_getnetent_r=undef
14142 getnetent_r_proto=0
14143 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
14144 * ) case "$getnetent_r_proto" in
14145 REENTRANT_PROTO*) ;;
14146 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
14148 echo "Prototype: $try" ;;
14151 *) case "$usethreads" in
14152 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
14154 d_getnetent_r=undef
14155 getnetent_r_proto=0
14159 *) getnetent_r_proto=0
14163 : see if prototypes for various getnetxxx netdb.h functions are available
14165 set d_getnetprotos getnetent $i_netdb netdb.h
14168 : see if getpagesize exists
14169 set getpagesize d_getpagsz
14172 : Optional checks for getprotobyname and getprotobynumber
14174 : see if getprotobyname exists
14175 set getprotobyname d_getpbyname
14178 : see if getprotobynumber exists
14179 set getprotobynumber d_getpbynumber
14182 : see if getprotoent exists
14183 set getprotoent d_getpent
14186 : see if getpgid exists
14187 set getpgid d_getpgid
14190 : see if getpgrp2 exists
14191 set getpgrp2 d_getpgrp2
14194 : see if getppid exists
14195 set getppid d_getppid
14198 : see if getpriority exists
14199 set getpriority d_getprior
14202 : see if getprotobyname_r exists
14203 set getprotobyname_r d_getprotobyname_r
14205 case "$d_getprotobyname_r" in
14207 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14208 case "$d_getprotobyname_r_proto:$usethreads" in
14209 ":define") d_getprotobyname_r_proto=define
14210 set d_getprotobyname_r_proto getprotobyname_r $hdrs
14214 case "$d_getprotobyname_r_proto" in
14216 case "$getprotobyname_r_proto" in
14217 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
14218 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
14220 case "$getprotobyname_r_proto" in
14221 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
14222 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
14224 case "$getprotobyname_r_proto" in
14225 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
14226 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
14228 case "$getprotobyname_r_proto" in
14229 ''|0) d_getprotobyname_r=undef
14230 getprotobyname_r_proto=0
14231 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
14232 * ) case "$getprotobyname_r_proto" in
14233 REENTRANT_PROTO*) ;;
14234 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
14236 echo "Prototype: $try" ;;
14239 *) case "$usethreads" in
14240 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
14242 d_getprotobyname_r=undef
14243 getprotobyname_r_proto=0
14247 *) getprotobyname_r_proto=0
14251 : see if getprotobynumber_r exists
14252 set getprotobynumber_r d_getprotobynumber_r
14254 case "$d_getprotobynumber_r" in
14256 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14257 case "$d_getprotobynumber_r_proto:$usethreads" in
14258 ":define") d_getprotobynumber_r_proto=define
14259 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
14263 case "$d_getprotobynumber_r_proto" in
14265 case "$getprotobynumber_r_proto" in
14266 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
14267 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
14269 case "$getprotobynumber_r_proto" in
14270 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
14271 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
14273 case "$getprotobynumber_r_proto" in
14274 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
14275 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
14277 case "$getprotobynumber_r_proto" in
14278 ''|0) d_getprotobynumber_r=undef
14279 getprotobynumber_r_proto=0
14280 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
14281 * ) case "$getprotobynumber_r_proto" in
14282 REENTRANT_PROTO*) ;;
14283 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
14285 echo "Prototype: $try" ;;
14288 *) case "$usethreads" in
14289 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
14291 d_getprotobynumber_r=undef
14292 getprotobynumber_r_proto=0
14296 *) getprotobynumber_r_proto=0
14300 : see if getprotoent_r exists
14301 set getprotoent_r d_getprotoent_r
14303 case "$d_getprotoent_r" in
14305 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14306 case "$d_getprotoent_r_proto:$usethreads" in
14307 ":define") d_getprotoent_r_proto=define
14308 set d_getprotoent_r_proto getprotoent_r $hdrs
14312 case "$d_getprotoent_r_proto" in
14314 case "$getprotoent_r_proto" in
14315 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
14316 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
14318 case "$getprotoent_r_proto" in
14319 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
14320 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBI ;;
14322 case "$getprotoent_r_proto" in
14323 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
14324 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=S_SBI ;;
14326 case "$getprotoent_r_proto" in
14327 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
14328 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SD ;;
14330 case "$getprotoent_r_proto" in
14331 ''|0) d_getprotoent_r=undef
14332 getprotoent_r_proto=0
14333 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
14334 * ) case "$getprotoent_r_proto" in
14335 REENTRANT_PROTO*) ;;
14336 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
14338 echo "Prototype: $try" ;;
14341 *) case "$usethreads" in
14342 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
14344 d_getprotoent_r=undef
14345 getprotoent_r_proto=0
14349 *) getprotoent_r_proto=0
14353 : see if prototypes for various getprotoxxx netdb.h functions are available
14355 set d_getprotoprotos getprotoent $i_netdb netdb.h
14358 : see if getprpwnam exists
14359 set getprpwnam d_getprpwnam
14362 : see if getpwent exists
14363 set getpwent d_getpwent
14366 : see if getpwent_r exists
14367 set getpwent_r d_getpwent_r
14369 case "$d_getpwent_r" in
14371 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14372 case "$d_getpwent_r_proto:$usethreads" in
14373 ":define") d_getpwent_r_proto=define
14374 set d_getpwent_r_proto getpwent_r $hdrs
14378 case "$d_getpwent_r_proto" in
14380 case "$getpwent_r_proto" in
14381 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
14382 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBWR ;;
14384 case "$getpwent_r_proto" in
14385 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
14386 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIR ;;
14388 case "$getpwent_r_proto" in
14389 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
14390 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBW ;;
14392 case "$getpwent_r_proto" in
14393 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
14394 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBI ;;
14396 case "$getpwent_r_proto" in
14397 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
14398 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBI ;;
14400 case "$getpwent_r_proto" in
14401 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
14402 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIH ;;
14404 case "$getpwent_r_proto" in
14405 ''|0) d_getpwent_r=undef
14407 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
14408 * ) case "$getpwent_r_proto" in
14409 REENTRANT_PROTO*) ;;
14410 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
14412 echo "Prototype: $try" ;;
14415 *) case "$usethreads" in
14416 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
14423 *) getpwent_r_proto=0
14427 : see if getpwnam_r exists
14428 set getpwnam_r d_getpwnam_r
14430 case "$d_getpwnam_r" in
14432 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14433 case "$d_getpwnam_r_proto:$usethreads" in
14434 ":define") d_getpwnam_r_proto=define
14435 set d_getpwnam_r_proto getpwnam_r $hdrs
14439 case "$d_getpwnam_r_proto" in
14441 case "$getpwnam_r_proto" in
14442 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
14443 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
14445 case "$getpwnam_r_proto" in
14446 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
14447 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
14449 case "$getpwnam_r_proto" in
14450 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
14451 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
14453 case "$getpwnam_r_proto" in
14454 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
14455 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
14457 case "$getpwnam_r_proto" in
14458 ''|0) d_getpwnam_r=undef
14460 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
14461 * ) case "$getpwnam_r_proto" in
14462 REENTRANT_PROTO*) ;;
14463 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
14465 echo "Prototype: $try" ;;
14468 *) case "$usethreads" in
14469 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
14476 *) getpwnam_r_proto=0
14480 : see if getpwuid_r exists
14481 set getpwuid_r d_getpwuid_r
14483 case "$d_getpwuid_r" in
14485 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14486 case "$d_getpwuid_r_proto:$usethreads" in
14487 ":define") d_getpwuid_r_proto=define
14488 set d_getpwuid_r_proto getpwuid_r $hdrs
14492 case "$d_getpwuid_r_proto" in
14494 case "$getpwuid_r_proto" in
14495 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
14496 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
14498 case "$getpwuid_r_proto" in
14499 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
14500 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
14502 case "$getpwuid_r_proto" in
14503 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
14504 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
14506 case "$getpwuid_r_proto" in
14507 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
14508 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
14510 case "$getpwuid_r_proto" in
14511 ''|0) d_getpwuid_r=undef
14513 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
14514 * ) case "$getpwuid_r_proto" in
14515 REENTRANT_PROTO*) ;;
14516 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
14518 echo "Prototype: $try" ;;
14521 *) case "$usethreads" in
14522 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
14529 *) getpwuid_r_proto=0
14533 : Optional checks for getsbyname and getsbyport
14535 : see if getservbyname exists
14536 set getservbyname d_getsbyname
14539 : see if getservbyport exists
14540 set getservbyport d_getsbyport
14543 : see if getservent exists
14544 set getservent d_getsent
14547 : see if getservbyname_r exists
14548 set getservbyname_r d_getservbyname_r
14550 case "$d_getservbyname_r" in
14552 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14553 case "$d_getservbyname_r_proto:$usethreads" in
14554 ":define") d_getservbyname_r_proto=define
14555 set d_getservbyname_r_proto getservbyname_r $hdrs
14559 case "$d_getservbyname_r_proto" in
14561 case "$getservbyname_r_proto" in
14562 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
14563 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
14565 case "$getservbyname_r_proto" in
14566 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
14567 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
14569 case "$getservbyname_r_proto" in
14570 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
14571 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
14573 case "$getservbyname_r_proto" in
14574 ''|0) d_getservbyname_r=undef
14575 getservbyname_r_proto=0
14576 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
14577 * ) case "$getservbyname_r_proto" in
14578 REENTRANT_PROTO*) ;;
14579 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
14581 echo "Prototype: $try" ;;
14584 *) case "$usethreads" in
14585 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
14587 d_getservbyname_r=undef
14588 getservbyname_r_proto=0
14592 *) getservbyname_r_proto=0
14596 : see if getservbyport_r exists
14597 set getservbyport_r d_getservbyport_r
14599 case "$d_getservbyport_r" in
14601 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14602 case "$d_getservbyport_r_proto:$usethreads" in
14603 ":define") d_getservbyport_r_proto=define
14604 set d_getservbyport_r_proto getservbyport_r $hdrs
14608 case "$d_getservbyport_r_proto" in
14610 case "$getservbyport_r_proto" in
14611 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
14612 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
14614 case "$getservbyport_r_proto" in
14615 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
14616 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
14618 case "$getservbyport_r_proto" in
14619 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
14620 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
14622 case "$getservbyport_r_proto" in
14623 ''|0) d_getservbyport_r=undef
14624 getservbyport_r_proto=0
14625 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
14626 * ) case "$getservbyport_r_proto" in
14627 REENTRANT_PROTO*) ;;
14628 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
14630 echo "Prototype: $try" ;;
14633 *) case "$usethreads" in
14634 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
14636 d_getservbyport_r=undef
14637 getservbyport_r_proto=0
14641 *) getservbyport_r_proto=0
14645 : see if getservent_r exists
14646 set getservent_r d_getservent_r
14648 case "$d_getservent_r" in
14650 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14651 case "$d_getservent_r_proto:$usethreads" in
14652 ":define") d_getservent_r_proto=define
14653 set d_getservent_r_proto getservent_r $hdrs
14657 case "$d_getservent_r_proto" in
14659 case "$getservent_r_proto" in
14660 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
14661 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBWR ;;
14663 case "$getservent_r_proto" in
14664 ''|0) try='int getservent_r(struct servent*, char*, int);'
14665 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBI ;;
14667 case "$getservent_r_proto" in
14668 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
14669 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=S_SBI ;;
14671 case "$getservent_r_proto" in
14672 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
14673 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SD ;;
14675 case "$getservent_r_proto" in
14676 ''|0) d_getservent_r=undef
14677 getservent_r_proto=0
14678 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
14679 * ) case "$getservent_r_proto" in
14680 REENTRANT_PROTO*) ;;
14681 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
14683 echo "Prototype: $try" ;;
14686 *) case "$usethreads" in
14687 define) echo "getservent_r has no prototype, not using it." >&4 ;;
14689 d_getservent_r=undef
14690 getservent_r_proto=0
14694 *) getservent_r_proto=0
14698 : see if prototypes for various getservxxx netdb.h functions are available
14700 set d_getservprotos getservent $i_netdb netdb.h
14703 : see if getspnam exists
14704 set getspnam d_getspnam
14707 : see if this is a shadow.h system
14708 set shadow.h i_shadow
14711 : see if getspnam_r exists
14712 set getspnam_r d_getspnam_r
14714 case "$d_getspnam_r" in
14716 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
14717 case "$d_getspnam_r_proto:$usethreads" in
14718 ":define") d_getspnam_r_proto=define
14719 set d_getspnam_r_proto getspnam_r $hdrs
14723 case "$d_getspnam_r_proto" in
14725 case "$getspnam_r_proto" in
14726 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
14727 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
14729 case "$getspnam_r_proto" in
14730 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
14731 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=S_CSBI ;;
14733 case "$getspnam_r_proto" in
14734 ''|0) d_getspnam_r=undef
14736 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
14737 * ) case "$getspnam_r_proto" in
14738 REENTRANT_PROTO*) ;;
14739 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
14741 echo "Prototype: $try" ;;
14744 *) case "$usethreads" in
14745 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
14752 *) getspnam_r_proto=0
14756 : see if gettimeofday or ftime exists
14757 set gettimeofday d_gettimeod
14759 case "$d_gettimeod" in
14765 val="$undef"; set d_ftime; eval $setvar
14768 case "$d_gettimeod$d_ftime" in
14771 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
14775 : see if gmtime_r exists
14776 set gmtime_r d_gmtime_r
14778 case "$d_gmtime_r" in
14780 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14781 case "$d_gmtime_r_proto:$usethreads" in
14782 ":define") d_gmtime_r_proto=define
14783 set d_gmtime_r_proto gmtime_r $hdrs
14787 case "$d_gmtime_r_proto" in
14789 case "$gmtime_r_proto" in
14790 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
14791 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=S_TS ;;
14793 case "$gmtime_r_proto" in
14794 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
14795 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=I_TS ;;
14797 case "$gmtime_r_proto" in
14798 ''|0) d_gmtime_r=undef
14800 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
14801 * ) case "$gmtime_r_proto" in
14802 REENTRANT_PROTO*) ;;
14803 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
14805 echo "Prototype: $try" ;;
14808 *) case "$usethreads" in
14809 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
14816 *) gmtime_r_proto=0
14820 : see if hasmntopt exists
14821 set hasmntopt d_hasmntopt
14824 : see if this is a netinet/in.h or sys/in.h system
14825 set netinet/in.h i_niin sys/in.h i_sysin
14828 : see if arpa/inet.h has to be included
14829 set arpa/inet.h i_arpainet
14832 : see if htonl --and friends-- exists
14837 : Maybe they are macros.
14840 $cat >htonl.c <<EOM
14842 #include <sys/types.h>
14843 #$i_niin I_NETINET_IN
14845 #$i_arpainet I_ARPA_INET
14846 #ifdef I_NETINET_IN
14847 #include <netinet/in.h>
14850 #include <sys/in.h>
14853 #include <arpa/inet.h>
14856 printf("Defined as a macro.");
14859 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
14860 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
14862 echo "But it seems to be defined as a macro." >&4
14870 : see if ilogbl exists
14871 set ilogbl d_ilogbl
14876 if set index val -f; eval $csym; $val; then
14877 if set strchr val -f d_strchr; eval $csym; $val; then
14878 if $contains strchr "$strings" >/dev/null 2>&1 ; then
14881 echo "strchr() found." >&4
14885 echo "index() found." >&4
14890 echo "index() found." >&4
14893 if set strchr val -f d_strchr; eval $csym; $val; then
14896 echo "strchr() found." >&4
14898 echo "No index() or strchr() found!" >&4
14903 set d_strchr; eval $setvar
14905 set d_index; eval $setvar
14907 : check whether inet_aton exists
14908 set inet_aton d_inetaton
14911 : see if inet_ntop exists
14912 set inet_ntop d_inetntop
14915 : see if inet_pton exists
14916 set inet_pton d_inetpton
14921 $cat >isascii.c <<EOCP
14924 #$i_stdlib I_STDLIB
14926 #include <stdlib.h>
14937 if eval $compile; then
14938 echo "isascii() found." >&4
14941 echo "isascii() NOT found." >&4
14948 : see if isfinite exists
14949 set isfinite d_isfinite
14952 : see if isinf exists
14956 : see if isnan exists
14960 : see if isnanl exists
14961 set isnanl d_isnanl
14964 : see if killpg exists
14965 set killpg d_killpg
14968 : see if lchown exists
14970 $cat > try.c <<'EOCP'
14971 /* System header to define __stub macros and hopefully few prototypes,
14972 which can conflict with char lchown(); below. */
14973 #include <assert.h>
14974 /* Override any gcc2 internal prototype to avoid an error. */
14975 /* We use char because int might match the return type of a gcc2
14976 builtin and then its argument prototype would still apply. */
14979 /* The GNU C library defines this for functions which it implements
14980 to always fail with ENOSYS. Some functions are actually named
14981 something starting with __ and the normal name is an alias. */
14982 #if defined (__stub_lchown) || defined (__stub___lchown)
14990 if eval $compile; then
14991 $echo "lchown() found." >&4
14994 $echo "lchown() NOT found." >&4
15000 : See if number of significant digits in a double precision number is known
15002 $cat >ldbl_dig.c <<EOM
15003 #$i_limits I_LIMITS
15006 #include <limits.h>
15012 printf("Contains LDBL_DIG");
15015 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
15016 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
15017 echo "LDBL_DIG found." >&4
15020 echo "LDBL_DIG NOT found." >&4
15027 : see if this is a math.h system
15031 : check to see if math.h defines _LIB_VERSION
15032 d_libm_lib_version="$undef"
15036 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
15038 #include <unistd.h>
15040 int main (int argc, char *argv[])
15042 printf ("%d\n", _LIB_VERSION);
15047 if eval $compile; then
15049 echo "Yes, it does ($foo)" >&4
15050 d_libm_lib_version="$define"
15052 echo "No, it does not (probably harmless)" >&4
15059 : see if link exists
15063 : see if localtime_r exists
15064 set localtime_r d_localtime_r
15066 case "$d_localtime_r" in
15068 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15069 case "$d_localtime_r_proto:$usethreads" in
15070 ":define") d_localtime_r_proto=define
15071 set d_localtime_r_proto localtime_r $hdrs
15075 case "$d_localtime_r_proto" in
15077 case "$localtime_r_proto" in
15078 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
15079 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=S_TS ;;
15081 case "$localtime_r_proto" in
15082 ''|0) try='int localtime_r(const time_t*, struct tm*);'
15083 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=I_TS ;;
15085 case "$localtime_r_proto" in
15086 ''|0) d_localtime_r=undef
15087 localtime_r_proto=0
15088 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
15089 * ) case "$localtime_r_proto" in
15090 REENTRANT_PROTO*) ;;
15091 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
15093 echo "Prototype: $try" ;;
15096 *) case "$usethreads" in
15097 define) echo "localtime_r has no prototype, not using it." >&4 ;;
15099 d_localtime_r=undef
15100 localtime_r_proto=0
15104 *) localtime_r_proto=0
15108 : see if localtime_r calls tzset
15109 case "$localtime_r_proto" in
15112 /* Does our libc's localtime_r call tzset ?
15113 * return 0 if so, 1 otherwise.
15115 #$i_systypes I_SYS_TYPES
15116 #$i_unistd I_UNISTD
15118 #$i_stdlib I_STDLIB
15119 #$i_string I_STRING
15120 #$i_malloc I_MALLOC
15122 # include <sys/types.h>
15125 # include <unistd.h>
15131 #include <stdlib.h>
15134 # include <string.h>
15136 # include <strings.h>
15139 # include <malloc.h>
15143 time_t t = time(0L);
15144 char w_tz[]="TZ" "=GMT+5",
15145 e_tz[]="TZ" "=GMT-5",
15146 *tz_e = (char*)malloc(16),
15147 *tz_w = (char*)malloc(16);
15148 struct tm tm_e, tm_w;
15149 memset(&tm_e,'\0',sizeof(struct tm));
15150 memset(&tm_w,'\0',sizeof(struct tm));
15155 localtime_r(&t, &tm_e);
15158 localtime_r(&t, &tm_w);
15160 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
15166 if eval $compile; then
15167 if $run ./try; then
15168 d_localtime_r_needs_tzset=undef;
15170 d_localtime_r_needs_tzset=define;
15173 d_localtime_r_needs_tzset=undef;
15177 d_localtime_r_needs_tzset=undef;
15182 : see if localeconv exists
15183 set localeconv d_locconv
15186 : see if lockf exists
15190 : see if prototype for lseek is available
15192 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
15195 : see if lstat exists
15199 : see if madvise exists
15200 set madvise d_madvise
15203 : see if malloc_size exists
15204 set malloc_size d_malloc_size
15207 : see if malloc_size_good exists
15208 set malloc_good_size d_malloc_good_size
15211 : see if mblen exists
15215 : see if mbstowcs exists
15216 set mbstowcs d_mbstowcs
15219 : see if mbtowc exists
15220 set mbtowc d_mbtowc
15223 : see if memchr exists
15224 set memchr d_memchr
15227 : see if memcmp exists
15228 set memcmp d_memcmp
15231 : see if memcpy exists
15232 set memcpy d_memcpy
15235 : see if memmove exists
15236 set memmove d_memmove
15239 : see if memset exists
15240 set memset d_memset
15243 : see if mkdir exists
15247 : see if mkdtemp exists
15248 set mkdtemp d_mkdtemp
15251 : see if mkfifo exists
15252 set mkfifo d_mkfifo
15255 : see if mkstemp exists
15256 set mkstemp d_mkstemp
15259 : see if mkstemps exists
15260 set mkstemps d_mkstemps
15263 : see if mktime exists
15264 set mktime d_mktime
15267 : see if this is a sys/mman.h system
15268 set sys/mman.h i_sysmman
15271 : see if mmap exists
15274 : see what shmat returns
15275 : default to something harmless
15277 case "$i_sysmman$d_mmap" in
15279 $cat >mmap.c <<'END'
15280 #include <sys/mman.h>
15283 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
15288 echo "and it returns ($mmaptype)." >&4
15294 : see if sqrtl exists
15298 : see if scalbnl exists
15299 set scalbnl d_scalbnl
15302 : see if modfl exists
15306 : see if prototype for modfl is available
15308 set d_modflproto modfl $i_math math.h
15311 d_modfl_pow32_bug="$undef"
15313 case "$d_longdbl$d_modfl" in
15316 Checking to see whether your modfl() is okay for large values...
15322 if $test "X$d_modflproto" != "X$define"; then
15323 $cat >>try.c <<EOCP
15324 /* Sigh. many current glibcs provide the function, but do not prototype it. */
15325 long double modfl (long double, long double *);
15328 $cat >>try.c <<EOCP
15330 long double nv = 4294967303.15;
15336 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
15340 case "$osname:$gccversion" in
15341 aix:) saveccflags="$ccflags"
15342 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
15345 if eval $compile; then
15348 *" 4294967303.150000 1.150000 4294967302.000000")
15349 echo >&4 "Your modfl() is broken for large values."
15350 d_modfl_pow32_bug="$define"
15352 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
15356 *" 4294967303.150000 0.150000 4294967303.000000")
15357 echo >&4 "Your modfl() seems okay for large values."
15359 *) echo >&4 "I don't understand your modfl() at all."
15365 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
15368 case "$osname:$gccversion" in
15369 aix:) ccflags="$saveccflags" ;; # restore
15374 if $test "$uselongdouble" = "$define"; then
15376 if $test "$d_sqrtl" != "$define"; then
15377 message="$message sqrtl"
15379 if $test "$d_modfl" != "$define"; then
15380 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
15381 echo "You have both aintl and copysignl, so I can emulate modfl."
15383 message="$message modfl"
15386 if $test "$d_frexpl" != "$define"; then
15387 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
15388 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
15390 message="$message frexpl"
15394 if $test "$message" != ""; then
15397 *** You requested the use of long doubles but you do not seem to have
15398 *** the following mathematical functions needed for long double support:
15400 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
15401 *** Cannot continue, aborting.
15409 : see if mprotect exists
15410 set mprotect d_mprotect
15413 : see if msgctl exists
15414 set msgctl d_msgctl
15417 : see if msgget exists
15418 set msgget d_msgget
15421 : see if msgsnd exists
15422 set msgsnd d_msgsnd
15425 : see if msgrcv exists
15426 set msgrcv d_msgrcv
15429 : see how much of the 'msg*(2)' library is present.
15432 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
15433 *"$undef"*) h_msg=false;;
15437 case "`ipcs 2>&1`" in
15438 "SVID messages"*"not configured"*)
15439 echo "Your $osname does not have the msg*(2) configured." >&4
15442 set msgctl d_msgctl
15444 set msgget d_msgget
15446 set msgsnd d_msgsnd
15448 set msgrcv d_msgrcv
15454 : we could also check for sys/ipc.h ...
15455 if $h_msg && $test `./findhdr sys/msg.h`; then
15456 echo "You have the full msg*(2) library." >&4
15459 echo "You don't have the full msg*(2) library." >&4
15465 : Check for msghdr_s
15467 echo "Checking to see if your system supports struct msghdr..." >&4
15468 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
15470 case "$d_msghdr_s" in
15471 "$define") echo "Yes, it does." ;;
15472 *) echo "No, it doesn't." ;;
15476 : see if msync exists
15480 : see if munmap exists
15481 set munmap d_munmap
15484 : see if nice exists
15488 : see if this is a langinfo.h system
15489 set langinfo.h i_langinfo
15492 : see if nl_langinfo exists
15493 set nl_langinfo d_nl_langinfo
15496 : check for volatile keyword
15498 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
15499 $cat >try.c <<'EOCP'
15502 typedef struct _goo_struct goo_struct;
15503 goo_struct * volatile goo = ((goo_struct *)0);
15504 struct _goo_struct {
15509 typedef unsigned short foo_t;
15510 char *volatile foo;
15512 volatile foo_t blech;
15516 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
15518 echo "Yup, it does."
15521 echo "Nope, it doesn't."
15527 : Check basic sizes
15529 $echo "Choosing the C types to be used for Perl's internal types..." >&4
15531 case "$use64bitint:$d_quad:$quadtype" in
15534 uvtype="$uquadtype"
15539 uvtype="unsigned long"
15545 case "$uselongdouble:$d_longdbl" in
15547 nvtype="long double"
15548 nvsize=$longdblsize
15555 $echo "(IV will be "$ivtype", $ivsize bytes)"
15556 $echo "(UV will be "$uvtype", $uvsize bytes)"
15557 $echo "(NV will be "$nvtype", $nvsize bytes)"
15560 #$i_inttypes I_INTTYPES
15562 #include <inttypes.h>
15567 int8_t i = INT8_MAX;
15568 uint8_t u = UINT8_MAX;
15569 printf("int8_t\n");
15572 int16_t i = INT16_MAX;
15573 uint16_t i = UINT16_MAX;
15574 printf("int16_t\n");
15577 int32_t i = INT32_MAX;
15578 uint32_t u = UINT32_MAX;
15579 printf("int32_t\n");
15584 i8type="signed char"
15585 u8type="unsigned char"
15590 '') case "$shortsize" in
15592 u16type="unsigned short"
15600 '') set try -DINT16
15601 if eval $compile; then
15602 case "`$run ./try`" in
15614 '') if $test $shortsize -ge 2; then
15616 u16type="unsigned short"
15624 '') case "$longsize" in
15626 u32type="unsigned long"
15630 *) case "$intsize" in
15632 u32type="unsigned int"
15642 '') set try -DINT32
15643 if eval $compile; then
15644 case "`$run ./try`" in
15656 '') if $test $intsize -ge 4; then
15658 u32type="unsigned int"
15666 '') case "$d_quad:$quadtype" in
15668 i64type="$quadtype"
15669 u64type="$uquadtype"
15677 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
15678 : volatile so that the compiler has to store it out to memory.
15679 if test X"$d_volatile" = X"$define"; then
15684 #$i_stdlib I_STDLIB
15686 #include <stdlib.h>
15688 #include <sys/types.h>
15689 #include <signal.h>
15691 $volatile int bletched = 0;
15692 $signal_t blech(int s) { bletched = 1; }
15697 int n = 8 * $uvsize;
15700 signal(SIGFPE, blech);
15703 for (i = 0; i < n; i++) {
15704 u = u << 1 | ($uvtype)1;
15706 if (($uvtype)d != u)
15710 d = ($nvtype)(u - 1);
15711 if (($uvtype)d != (u - 1))
15718 printf("%d\n", ((i == n) ? -n : i));
15724 d_nv_preserves_uv="$undef"
15725 if eval $compile; then
15726 nv_preserves_uv_bits="`$run ./try`"
15728 case "$nv_preserves_uv_bits" in
15730 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
15731 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
15732 d_nv_preserves_uv="$define"
15734 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
15735 d_nv_preserves_uv="$undef" ;;
15736 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
15737 nv_preserves_uv_bits="0" ;;
15741 $echo "Checking to find the largest integer value your NVs can hold..." >&4
15742 : volatile so that the compiler has to store it out to memory.
15743 if test X"$d_volatile" = X"$define"; then
15749 typedef $nvtype NV;
15756 while(count < 256) {
15757 $volatile NV up = value + 1.0;
15758 $volatile NV negated = -value;
15759 $volatile NV down = negated - 1.0;
15760 $volatile NV got_up = up - value;
15761 int up_good = got_up == 1.0;
15762 int got_down = down - negated;
15763 int down_good = got_down == -1.0;
15765 if (down_good != up_good) {
15767 "Inconsistency - up %d %f; down %d %f; for 2**%d (%.20f)\n",
15768 up_good, (double) got_up, down_good, (double) got_down,
15769 count, (double) value);
15776 fputs("256.0", stdout);
15779 fputs("2.0", stdout);
15785 fputs("*", stdout);
15791 fprintf(stderr, "Cannot overflow integer range, even at 2**%d (%.20f)\n",
15792 count, (double) value);
15798 nv_overflows_integers_at='0'
15799 if eval $compile; then
15805 The largest integer your NVs can preserve is equal to $xxx
15807 nv_overflows_integers_at="$xxx"
15810 Cannot determine the largest integer value your NVs can hold, unexpected output
15817 Cannot determine the largest integer value your NVs can hold
15824 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
15825 : volatile so that the compiler has to store it out to memory.
15826 if test X"$d_volatile" = X"$define"; then
15831 #$i_stdlib I_STDLIB
15833 #include <stdlib.h>
15835 #$i_string I_STRING
15837 # include <string.h>
15839 # include <strings.h>
15841 #include <sys/types.h>
15842 #include <signal.h>
15844 $volatile int bletched = 0;
15845 $signal_t blech(int s) { bletched = 1; }
15848 int checkit($nvtype d, char *where) {
15849 unsigned char *p = (char *)&d;
15850 unsigned char *end = p + sizeof(d);
15860 printf("No - %s: 0x", where);
15862 printf ("%02X", *p++);
15867 int main(int argc, char **argv) {
15870 fail += checkit(d, "0.0");
15872 /* The compiler shouldn't be assuming that bletched is 0 */
15875 fail += checkit(d, "bleched");
15878 signal(SIGFPE, blech);
15881 /* Paranoia - the compiler should have no way of knowing that ANSI says
15882 that argv[argc] will always be NULL. Actually, if it did assume this it
15883 would be buggy, as this is C and main() can be called from elsewhere in
15885 d = argv[argc] ? 1 : 0;
15888 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
15891 fail += checkit(d, "ternary");
15893 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
15896 printf("No - memset doesn't give 0.0\n");
15897 /* This might just blow up: */
15898 printf("(gives %g)\n", d);
15904 printf("No - something bleched\n");
15909 printf("No - %d fail(s)\n", fail);
15918 d_nv_zero_is_allbits_zero="$undef"
15919 if eval $compile; then
15925 0.0 is represented as all bits zero in memory
15927 d_nv_zero_is_allbits_zero="$define"
15930 0.0 is not represented as all bits zero in memory
15932 d_nv_zero_is_allbits_zero="$undef"
15937 0.0 is not represented as all bits zero in memory
15939 d_nv_zero_is_allbits_zero="$undef"
15945 : check for off64_t
15947 echo "Checking to see if you have off64_t..." >&4
15949 #include <sys/types.h>
15950 #include <unistd.h>
15951 int main() { off64_t x = 7; }
15954 if eval $compile; then
15956 echo "You have off64_t."
15959 echo "You do not have off64_t."
15960 case "$lseeksize" in
15961 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
15968 : how to create joinable pthreads
15969 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
15971 echo "Checking what constant to use for creating joinable pthreads..." >&4
15972 $cat >try.c <<'EOCP'
15973 #include <pthread.h>
15975 int detachstate = JOINABLE;
15978 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
15979 if eval $compile; then
15980 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
15981 val="$undef" # Yes, undef.
15982 set d_old_pthread_create_joinable
15985 set old_pthread_create_joinable
15988 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
15989 if eval $compile; then
15990 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
15992 set d_old_pthread_create_joinable
15994 val=PTHREAD_CREATE_UNDETACHED
15995 set old_pthread_create_joinable
15998 set try -DJOINABLE=__UNDETACHED
15999 if eval $compile; then
16000 echo "You seem to use __UNDETACHED." >&4
16002 set d_old_pthread_create_joinable
16005 set old_pthread_create_joinable
16008 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
16010 set d_old_pthread_create_joinable
16013 set old_pthread_create_joinable
16020 d_old_pthread_create_joinable="$undef"
16021 old_pthread_create_joinable=""
16024 : see if pause exists
16028 : see if poll exists
16032 : see if readlink exists
16033 set readlink d_readlink
16036 : Check if exe is symlink to abs path of executing program
16040 case "$d_readlink" in
16042 if $issymlink /proc/self/exe ; then
16043 $ls -l /proc/self/exe > reflect
16044 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
16045 echo "You have Linux-like /proc/self/exe."
16046 procselfexe='"/proc/self/exe"'
16050 if $issymlink /proc/curproc/file ; then
16051 $ls -l /proc/curproc/file > reflect
16052 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
16053 echo "You have BSD-like /proc/curproc/file."
16054 procselfexe='"/proc/curproc/file"'
16064 : backward compatibility for d_hvfork
16065 if test X$d_hvfork != X; then
16066 d_vfork="$d_hvfork"
16069 : see if there is a vfork
16074 d_pseudofork=$undef
16076 : Ok, but do we want to use it. vfork is reportedly unreliable in
16077 : perl on Solaris 2.x, and probably elsewhere.
16081 case "$usevfork" in
16087 Perl can only use a vfork() that doesn't suffer from strict
16088 restrictions on calling functions or modifying global data in
16089 the child. For example, glibc-2.1 contains such a vfork()
16090 that is unsuitable. If your system provides a proper fork()
16091 call, chances are that you do NOT want perl to use vfork().
16094 rp="Do you still want to use vfork()?"
16099 echo "Ok, we won't use vfork()."
16108 $define) usevfork='true';;
16109 *) usevfork='false';;
16112 : see whether the pthread_atfork exists
16114 #include <pthread.h>
16117 #ifdef PTHREAD_ATFORK
16118 pthread_atfork(NULL,NULL,NULL);
16123 : see if pthread_atfork exists
16124 set try -DPTHREAD_ATFORK
16125 if eval $compile; then
16130 case "$usethreads" in
16133 $define) echo 'pthread_atfork found.' >&4 ;;
16134 *) echo 'pthread_atfork NOT found.' >&4 ;;
16137 set d_pthread_atfork
16140 : see if pthread_attr_setscope exists
16141 set pthread_attr_setscope d_pthread_attr_setscope
16144 : see whether the various POSIXish _yields exist
16146 #include <pthread.h>
16152 #ifdef PTHREAD_YIELD
16155 #ifdef PTHREAD_YIELD_NULL
16156 pthread_yield(NULL);
16162 : see if sched_yield exists
16163 set try -DSCHED_YIELD
16164 if eval $compile; then
16166 sched_yield='sched_yield()'
16170 case "$usethreads" in
16173 $define) echo 'sched_yield() found.' >&4 ;;
16174 *) echo 'sched_yield() NOT found.' >&4 ;;
16180 : see if pthread_yield exists
16181 set try -DPTHREAD_YIELD
16182 if eval $compile; then
16184 case "$sched_yield" in
16185 '') sched_yield='pthread_yield()' ;;
16188 set try -DPTHREAD_YIELD_NULL
16189 if eval $compile; then
16191 case "$sched_yield" in
16192 '') sched_yield='pthread_yield(NULL)' ;;
16198 case "$usethreads" in
16201 $define) echo 'pthread_yield() found.' >&4 ;;
16202 *) echo 'pthread_yield() NOT found.' >&4 ;;
16206 set d_pthread_yield
16208 case "$sched_yield" in
16209 '') sched_yield=undef ;;
16213 : see if random_r exists
16214 set random_r d_random_r
16216 case "$d_random_r" in
16218 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16219 case "$d_random_r_proto:$usethreads" in
16220 ":define") d_random_r_proto=define
16221 set d_random_r_proto random_r $hdrs
16225 case "$d_random_r_proto" in
16227 case "$random_r_proto" in
16228 ''|0) try='int random_r(int*, struct random_data*);'
16229 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_iS ;;
16231 case "$random_r_proto" in
16232 ''|0) try='int random_r(long*, struct random_data*);'
16233 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_lS ;;
16235 case "$random_r_proto" in
16236 ''|0) try='int random_r(struct random_data*, int32_t*);'
16237 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_St ;;
16239 case "$random_r_proto" in
16240 ''|0) d_random_r=undef
16242 echo "Disabling random_r, cannot determine prototype." >&4 ;;
16243 * ) case "$random_r_proto" in
16244 REENTRANT_PROTO*) ;;
16245 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
16247 echo "Prototype: $try" ;;
16250 *) case "$usethreads" in
16251 define) echo "random_r has no prototype, not using it." >&4 ;;
16258 *) random_r_proto=0
16262 : see if readdir and friends exist
16263 set readdir d_readdir
16265 set seekdir d_seekdir
16267 set telldir d_telldir
16269 set rewinddir d_rewinddir
16272 : see if readdir64_r exists
16273 set readdir64_r d_readdir64_r
16275 case "$d_readdir64_r" in
16277 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16278 case "$d_readdir64_r_proto:$usethreads" in
16279 ":define") d_readdir64_r_proto=define
16280 set d_readdir64_r_proto readdir64_r $hdrs
16284 case "$d_readdir64_r_proto" in
16286 case "$readdir64_r_proto" in
16287 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
16288 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TSR ;;
16290 case "$readdir64_r_proto" in
16291 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
16292 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TS ;;
16294 case "$readdir64_r_proto" in
16295 ''|0) d_readdir64_r=undef
16296 readdir64_r_proto=0
16297 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
16298 * ) case "$readdir64_r_proto" in
16299 REENTRANT_PROTO*) ;;
16300 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
16302 echo "Prototype: $try" ;;
16305 *) case "$usethreads" in
16306 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
16308 d_readdir64_r=undef
16309 readdir64_r_proto=0
16313 *) readdir64_r_proto=0
16317 : see if readdir_r exists
16318 set readdir_r d_readdir_r
16320 case "$d_readdir_r" in
16322 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16323 case "$d_readdir_r_proto:$usethreads" in
16324 ":define") d_readdir_r_proto=define
16325 set d_readdir_r_proto readdir_r $hdrs
16329 case "$d_readdir_r_proto" in
16331 case "$readdir_r_proto" in
16332 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
16333 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TSR ;;
16335 case "$readdir_r_proto" in
16336 ''|0) try='int readdir_r(DIR*, struct dirent*);'
16337 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TS ;;
16339 case "$readdir_r_proto" in
16340 ''|0) d_readdir_r=undef
16342 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
16343 * ) case "$readdir_r_proto" in
16344 REENTRANT_PROTO*) ;;
16345 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
16347 echo "Prototype: $try" ;;
16350 *) case "$usethreads" in
16351 define) echo "readdir_r has no prototype, not using it." >&4 ;;
16358 *) readdir_r_proto=0
16362 : see if readv exists
16366 : see if recvmsg exists
16367 set recvmsg d_recvmsg
16370 : see if rename exists
16371 set rename d_rename
16374 : see if rmdir exists
16378 : see if memory.h is available.
16383 : See if it conflicts with string.h
16389 $cppstdin $cppflags $cppminus < $strings > mem.h
16390 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
16392 echo "We won't be including <memory.h>."
16402 : can bcopy handle overlapping blocks?
16405 case "$d_memmove" in
16406 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
16407 *) case "$d_bcopy" in
16409 echo "Checking to see if bcopy() can do overlapping copies..." >&4
16411 #$i_memory I_MEMORY
16412 #$i_stdlib I_STDLIB
16413 #$i_string I_STRING
16414 #$i_unistd I_UNISTD
16416 $cat >>try.c <<'EOCP'
16419 # include <memory.h>
16422 # include <stdlib.h>
16425 # include <string.h>
16427 # include <strings.h>
16430 # include <unistd.h> /* Needed for NetBSD */
16434 char buf[128], abc[128];
16440 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16441 try to store the string in read-only memory. */
16442 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
16444 for (align = 7; align >= 0; align--) {
16445 for (len = 36; len; len--) {
16447 bcopy(abc, b, len);
16448 for (off = 1; off <= len; off++) {
16449 bcopy(b, b+off, len);
16450 bcopy(b+off, b, len);
16451 if (bcmp(b, abc, len))
16460 if eval $compile_ok; then
16461 if $run ./try 2>/dev/null; then
16462 echo "Yes, it can."
16465 echo "It can't, sorry."
16468 echo "(I can't compile the test program, so we'll assume not...)"
16478 : can memcpy handle overlapping blocks?
16481 case "$d_memmove" in
16482 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
16483 *) case "$d_memcpy" in
16485 echo "Checking to see if memcpy() can do overlapping copies..." >&4
16487 #$i_memory I_MEMORY
16488 #$i_stdlib I_STDLIB
16489 #$i_string I_STRING
16490 #$i_unistd I_UNISTD
16492 $cat >>try.c <<'EOCP'
16495 # include <memory.h>
16498 # include <stdlib.h>
16501 # include <string.h>
16503 # include <strings.h>
16506 # include <unistd.h> /* Needed for NetBSD */
16510 char buf[128], abc[128];
16516 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16517 try to store the string in read-only memory. */
16518 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
16520 for (align = 7; align >= 0; align--) {
16521 for (len = 36; len; len--) {
16523 memcpy(b, abc, len);
16524 for (off = 1; off <= len; off++) {
16525 memcpy(b+off, b, len);
16526 memcpy(b, b+off, len);
16527 if (memcmp(b, abc, len))
16536 if eval $compile_ok; then
16537 if $run ./try 2>/dev/null; then
16538 echo "Yes, it can."
16541 echo "It can't, sorry."
16544 echo "(I can't compile the test program, so we'll assume not...)"
16554 : can memcmp be trusted to compare relative magnitude?
16556 case "$d_memcmp" in
16559 echo "Checking if your memcmp() can compare relative magnitude..." >&4
16561 #$i_memory I_MEMORY
16562 #$i_stdlib I_STDLIB
16563 #$i_string I_STRING
16564 #$i_unistd I_UNISTD
16566 $cat >>try.c <<'EOCP'
16569 # include <memory.h>
16572 # include <stdlib.h>
16575 # include <string.h>
16577 # include <strings.h>
16580 # include <unistd.h> /* Needed for NetBSD */
16586 if ((a < b) && memcmp(&a, &b, 1) < 0)
16592 if eval $compile_ok; then
16593 if $run ./try 2>/dev/null; then
16594 echo "Yes, it can."
16597 echo "No, it can't (it uses signed chars)."
16600 echo "(I can't compile the test program, so we'll assume not...)"
16608 : see if prototype for sbrk is available
16610 set d_sbrkproto sbrk $i_unistd unistd.h
16613 : see if select exists
16614 set select d_select
16617 : see if semctl exists
16618 set semctl d_semctl
16621 : see if semget exists
16622 set semget d_semget
16625 : see if semop exists
16629 : see how much of the 'sem*(2)' library is present.
16632 case "$d_semctl$d_semget$d_semop" in
16633 *"$undef"*) h_sem=false;;
16637 case "`ipcs 2>&1`" in
16638 "SVID messages"*"not configured"*)
16639 echo "Your $osname does not have the sem*(2) configured." >&4
16642 set semctl d_semctl
16644 set semget d_semget
16652 : we could also check for sys/ipc.h ...
16653 if $h_sem && $test `./findhdr sys/sem.h`; then
16654 echo "You have the full sem*(2) library." >&4
16657 echo "You don't have the full sem*(2) library." >&4
16663 : see whether sys/sem.h defines union semun
16665 $cat > try.c <<'END'
16666 #include <sys/types.h>
16667 #include <sys/ipc.h>
16668 #include <sys/sem.h>
16669 int main () { union semun semun; semun.buf = 0; }
16672 if eval $compile; then
16673 echo "You have union semun in <sys/sem.h>." >&4
16676 echo "You do not have union semun in <sys/sem.h>." >&4
16683 : see how to do semctl IPC_STAT
16687 $cat > tryh.h <<END
16690 # define S_IRUSR S_IREAD
16691 # define S_IWUSR S_IWRITE
16692 # define S_IXUSR S_IEXEC
16694 # define S_IRUSR 0400
16695 # define S_IWUSR 0200
16696 # define S_IXUSR 0100
16698 # define S_IRGRP (S_IRUSR>>3)
16699 # define S_IWGRP (S_IWUSR>>3)
16700 # define S_IXGRP (S_IXUSR>>3)
16701 # define S_IROTH (S_IRUSR>>6)
16702 # define S_IWOTH (S_IWUSR>>6)
16703 # define S_IXOTH (S_IXUSR>>6)
16706 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
16707 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
16708 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
16711 : see whether semctl IPC_STAT can use union semun
16712 case "$d_semctl_semun" in
16716 #include <sys/types.h>
16717 #include <sys/ipc.h>
16718 #include <sys/sem.h>
16719 #include <sys/stat.h>
16726 #$d_union_semun HAS_UNION_SEMUN
16729 #ifndef HAS_UNION_SEMUN
16732 struct semid_ds *buf;
16733 unsigned short *array;
16739 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16740 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16742 struct semid_ds argbuf;
16745 st = semctl(sem, 0, IPC_STAT, arg);
16749 # endif /* IPC_STAT */
16750 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16752 if (semctl(sem, 0, IPC_RMID, arg) != 0)
16753 # endif /* IPC_RMID */
16754 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16756 #endif /* IPC_PRIVATE && ... */
16757 printf("semget failed: errno = %d\n", errno);
16762 if eval $compile; then
16765 semun) val="$define" ;;
16773 case "$d_semctl_semun" in
16775 echo "You can use union semun for semctl IPC_STAT." >&4
16778 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
16783 : see whether semctl IPC_STAT can use struct semid_ds pointer
16784 case "$d_semctl_semid_ds" in
16787 $cat > try.c <<'END'
16788 #include <sys/types.h>
16789 #include <sys/ipc.h>
16790 #include <sys/sem.h>
16791 #include <sys/stat.h>
16799 struct semid_ds arg;
16802 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16803 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16806 st = semctl(sem, 0, IPC_STAT, &arg);
16808 printf("semid_ds\n");
16810 # endif /* IPC_STAT */
16811 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16813 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
16814 # endif /* IPC_RMID */
16815 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16817 #endif /* IPC_PRIVATE && ... */
16818 printf("semget failed: errno = %d\n", errno);
16824 if eval $compile; then
16827 semid_ds) val="$define" ;;
16831 set d_semctl_semid_ds
16835 case "$d_semctl_semid_ds" in
16837 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
16839 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
16845 # We do not have the full sem*(2) library, so assume we can not
16851 set d_semctl_semid_ds
16857 : see if sendmsg exists
16858 set sendmsg d_sendmsg
16861 : see if setegid exists
16862 set setegid d_setegid
16865 : see if seteuid exists
16866 set seteuid d_seteuid
16869 : see if setgrent exists
16870 set setgrent d_setgrent
16873 : see if setgrent_r exists
16874 set setgrent_r d_setgrent_r
16876 case "$d_setgrent_r" in
16878 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
16879 case "$d_setgrent_r_proto:$usethreads" in
16880 ":define") d_setgrent_r_proto=define
16881 set d_setgrent_r_proto setgrent_r $hdrs
16885 case "$d_setgrent_r_proto" in
16887 case "$setgrent_r_proto" in
16888 ''|0) try='int setgrent_r(FILE**);'
16889 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=I_H ;;
16891 case "$setgrent_r_proto" in
16892 ''|0) try='void setgrent_r(FILE**);'
16893 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=V_H ;;
16895 case "$setgrent_r_proto" in
16896 ''|0) d_setgrent_r=undef
16898 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
16899 * ) case "$setgrent_r_proto" in
16900 REENTRANT_PROTO*) ;;
16901 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
16903 echo "Prototype: $try" ;;
16906 *) case "$usethreads" in
16907 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
16914 *) setgrent_r_proto=0
16918 : see if sethostent exists
16919 set sethostent d_sethent
16922 : see if sethostent_r exists
16923 set sethostent_r d_sethostent_r
16925 case "$d_sethostent_r" in
16927 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16928 case "$d_sethostent_r_proto:$usethreads" in
16929 ":define") d_sethostent_r_proto=define
16930 set d_sethostent_r_proto sethostent_r $hdrs
16934 case "$d_sethostent_r_proto" in
16936 case "$sethostent_r_proto" in
16937 ''|0) try='int sethostent_r(int, struct hostent_data*);'
16938 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=I_ID ;;
16940 case "$sethostent_r_proto" in
16941 ''|0) try='void sethostent_r(int, struct hostent_data*);'
16942 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=V_ID ;;
16944 case "$sethostent_r_proto" in
16945 ''|0) d_sethostent_r=undef
16946 sethostent_r_proto=0
16947 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
16948 * ) case "$sethostent_r_proto" in
16949 REENTRANT_PROTO*) ;;
16950 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
16952 echo "Prototype: $try" ;;
16955 *) case "$usethreads" in
16956 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
16958 d_sethostent_r=undef
16959 sethostent_r_proto=0
16963 *) sethostent_r_proto=0
16967 : see if setitimer exists
16968 set setitimer d_setitimer
16971 : see if setlinebuf exists
16972 set setlinebuf d_setlinebuf
16975 : see if setlocale exists
16976 set setlocale d_setlocale
16979 : see if locale.h is available
16980 set locale.h i_locale
16983 : see if setlocale_r exists
16984 set setlocale_r d_setlocale_r
16986 case "$d_setlocale_r" in
16988 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
16989 case "$d_setlocale_r_proto:$usethreads" in
16990 ":define") d_setlocale_r_proto=define
16991 set d_setlocale_r_proto setlocale_r $hdrs
16995 case "$d_setlocale_r_proto" in
16997 case "$setlocale_r_proto" in
16998 ''|0) try='int setlocale_r(int, const char*, char*, int);'
16999 ./protochk "$extern_C $try" $hdrs && setlocale_r_proto=I_ICBI ;;
17001 case "$setlocale_r_proto" in
17002 ''|0) d_setlocale_r=undef
17003 setlocale_r_proto=0
17004 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
17005 * ) case "$setlocale_r_proto" in
17006 REENTRANT_PROTO*) ;;
17007 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
17009 echo "Prototype: $try" ;;
17012 *) case "$usethreads" in
17013 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
17015 d_setlocale_r=undef
17016 setlocale_r_proto=0
17020 *) setlocale_r_proto=0
17024 : see if setnetent exists
17025 set setnetent d_setnent
17028 : see if setnetent_r exists
17029 set setnetent_r d_setnetent_r
17031 case "$d_setnetent_r" in
17033 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17034 case "$d_setnetent_r_proto:$usethreads" in
17035 ":define") d_setnetent_r_proto=define
17036 set d_setnetent_r_proto setnetent_r $hdrs
17040 case "$d_setnetent_r_proto" in
17042 case "$setnetent_r_proto" in
17043 ''|0) try='int setnetent_r(int, struct netent_data*);'
17044 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=I_ID ;;
17046 case "$setnetent_r_proto" in
17047 ''|0) try='void setnetent_r(int, struct netent_data*);'
17048 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=V_ID ;;
17050 case "$setnetent_r_proto" in
17051 ''|0) d_setnetent_r=undef
17052 setnetent_r_proto=0
17053 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
17054 * ) case "$setnetent_r_proto" in
17055 REENTRANT_PROTO*) ;;
17056 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
17058 echo "Prototype: $try" ;;
17061 *) case "$usethreads" in
17062 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
17064 d_setnetent_r=undef
17065 setnetent_r_proto=0
17069 *) setnetent_r_proto=0
17073 : see if setprotoent exists
17074 set setprotoent d_setpent
17077 : see if setpgid exists
17078 set setpgid d_setpgid
17081 : see if setpgrp2 exists
17082 set setpgrp2 d_setpgrp2
17085 : see if setpriority exists
17086 set setpriority d_setprior
17089 : see if setproctitle exists
17090 set setproctitle d_setproctitle
17093 : see if setprotoent_r exists
17094 set setprotoent_r d_setprotoent_r
17096 case "$d_setprotoent_r" in
17098 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17099 case "$d_setprotoent_r_proto:$usethreads" in
17100 ":define") d_setprotoent_r_proto=define
17101 set d_setprotoent_r_proto setprotoent_r $hdrs
17105 case "$d_setprotoent_r_proto" in
17107 case "$setprotoent_r_proto" in
17108 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
17109 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=I_ID ;;
17111 case "$setprotoent_r_proto" in
17112 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
17113 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=V_ID ;;
17115 case "$setprotoent_r_proto" in
17116 ''|0) d_setprotoent_r=undef
17117 setprotoent_r_proto=0
17118 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
17119 * ) case "$setprotoent_r_proto" in
17120 REENTRANT_PROTO*) ;;
17121 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
17123 echo "Prototype: $try" ;;
17126 *) case "$usethreads" in
17127 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
17129 d_setprotoent_r=undef
17130 setprotoent_r_proto=0
17134 *) setprotoent_r_proto=0
17138 : see if setpwent exists
17139 set setpwent d_setpwent
17142 : see if setpwent_r exists
17143 set setpwent_r d_setpwent_r
17145 case "$d_setpwent_r" in
17147 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
17148 case "$d_setpwent_r_proto:$usethreads" in
17149 ":define") d_setpwent_r_proto=define
17150 set d_setpwent_r_proto setpwent_r $hdrs
17154 case "$d_setpwent_r_proto" in
17156 case "$setpwent_r_proto" in
17157 ''|0) try='int setpwent_r(FILE**);'
17158 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=I_H ;;
17160 case "$setpwent_r_proto" in
17161 ''|0) try='void setpwent_r(FILE**);'
17162 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=V_H ;;
17164 case "$setpwent_r_proto" in
17165 ''|0) d_setpwent_r=undef
17167 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
17168 * ) case "$setpwent_r_proto" in
17169 REENTRANT_PROTO*) ;;
17170 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
17172 echo "Prototype: $try" ;;
17175 *) case "$usethreads" in
17176 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
17183 *) setpwent_r_proto=0
17187 : see if setregid exists
17188 set setregid d_setregid
17190 set setresgid d_setresgid
17193 : see if setreuid exists
17194 set setreuid d_setreuid
17196 set setresuid d_setresuid
17199 : see if setrgid exists
17200 set setrgid d_setrgid
17203 : see if setruid exists
17204 set setruid d_setruid
17207 : see if setservent exists
17208 set setservent d_setsent
17211 : see if setservent_r exists
17212 set setservent_r d_setservent_r
17214 case "$d_setservent_r" in
17216 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17217 case "$d_setservent_r_proto:$usethreads" in
17218 ":define") d_setservent_r_proto=define
17219 set d_setservent_r_proto setservent_r $hdrs
17223 case "$d_setservent_r_proto" in
17225 case "$setservent_r_proto" in
17226 ''|0) try='int setservent_r(int, struct servent_data*);'
17227 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=I_ID ;;
17229 case "$setservent_r_proto" in
17230 ''|0) try='void setservent_r(int, struct servent_data*);'
17231 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=V_ID ;;
17233 case "$setservent_r_proto" in
17234 ''|0) d_setservent_r=undef
17235 setservent_r_proto=0
17236 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
17237 * ) case "$setservent_r_proto" in
17238 REENTRANT_PROTO*) ;;
17239 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
17241 echo "Prototype: $try" ;;
17244 *) case "$usethreads" in
17245 define) echo "setservent_r has no prototype, not using it." >&4 ;;
17247 d_setservent_r=undef
17248 setservent_r_proto=0
17252 *) setservent_r_proto=0
17256 : see if setsid exists
17257 set setsid d_setsid
17260 : see if setvbuf exists
17261 set setvbuf d_setvbuf
17264 : see if sfio.h is available
17268 : see if sfio library is available
17279 : Ok, but do we want to use it.
17283 true|$define|[yY]*) dflt='y';;
17286 echo "$package can use the sfio library, but it is experimental."
17287 case "$useperlio" in
17289 echo "For sfio also the PerlIO abstraction layer is needed."
17290 echo "Earlier you said you wouldn't want that."
17293 rp="You seem to have sfio available, do you want to try using it?"
17296 y|Y) echo "Ok, turning on both sfio and PerlIO, then."
17297 useperlio="$define"
17300 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
17305 *) case "$usesfio" in
17306 true|$define|[yY]*)
17307 echo "Sorry, cannot find sfio on this machine." >&4
17308 echo "Ignoring your setting of usesfio=$usesfio." >&4
17317 $define) usesfio='true';;
17318 *) usesfio='false';;
17322 *) : Remove sfio from list of libraries to use
17325 echo "Removing unneeded -lsfio from library list" >&4
17326 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
17329 echo "libs = $libs" >&4
17336 : see if shmctl exists
17337 set shmctl d_shmctl
17340 : see if shmget exists
17341 set shmget d_shmget
17344 : see if shmat exists
17347 : see what shmat returns
17350 $cat >shmat.c <<'END'
17351 #include <sys/shm.h>
17354 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
17359 echo "and it returns ($shmattype)." >&4
17360 : see if a prototype for shmat is available
17361 xxx=`./findhdr sys/shm.h`
17362 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
17363 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
17374 set d_shmatprototype
17377 : see if shmdt exists
17381 : see how much of the 'shm*(2)' library is present.
17384 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
17385 *"$undef"*) h_shm=false;;
17389 case "`ipcs 2>&1`" in
17390 "SVID shared memory"*"not configured"*)
17391 echo "Your $osname does not have the shm*(2) configured." >&4
17394 set shmctl d_shmctl
17396 set shmget d_shmget
17406 : we could also check for sys/ipc.h ...
17407 if $h_shm && $test `./findhdr sys/shm.h`; then
17408 echo "You have the full shm*(2) library." >&4
17411 echo "You don't have the full shm*(2) library." >&4
17417 : see if we have sigaction
17419 if set sigaction val -f d_sigaction; eval $csym; $val; then
17420 echo 'sigaction() found.' >&4
17423 #include <sys/types.h>
17424 #include <signal.h>
17425 #$i_stdlib I_STDLIB
17427 #include <stdlib.h>
17431 struct sigaction act, oact;
17433 oact.sa_handler = 0;
17434 /* so that act and oact are used */
17435 exit(act.sa_flags == 0 && oact.sa_handler == 0);
17439 if eval $compile_ok; then
17442 echo "But you don't seem to have a useable struct sigaction." >&4
17446 echo 'sigaction NOT found.' >&4
17449 set d_sigaction; eval $setvar
17452 : see if this is a sunmath.h system
17453 set sunmath.h i_sunmath
17456 : see if signbit exists
17457 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
17460 #$i_sunmath I_SUNMATH
17464 #ifdef I_SUNMATH /* Solaris special math library */
17465 # include <sunmath.h>
17468 int main(int argc, char **argv)
17472 if ((signbit(x) == 0) && (signbit(y) != 0))
17480 if eval $compile; then
17481 if $run ./try; then
17485 $echo "Signbit seems to be available, but doesn't work as I expected."
17486 $echo "I won't use it." >&4
17497 : see if sigprocmask exists
17498 set sigprocmask d_sigprocmask
17501 : see if sigsetjmp exists
17503 case "$d_sigsetjmp" in
17506 #include <setjmp.h>
17507 #$i_stdlib I_STDLIB
17509 #include <stdlib.h>
17515 if (sigsetjmp(env,1))
17518 siglongjmp(env, 1);
17523 if eval $compile; then
17524 if $run ./try >/dev/null 2>&1; then
17525 echo "POSIX sigsetjmp found." >&4
17529 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
17535 echo "sigsetjmp not found." >&4
17539 *) val="$d_sigsetjmp"
17540 case "$d_sigsetjmp" in
17541 $define) echo "POSIX sigsetjmp found." >&4;;
17542 $undef) echo "sigsetjmp not found." >&4;;
17550 : see if snprintf exists
17551 set snprintf d_snprintf
17554 : see if vsnprintf exists
17555 set vsnprintf d_vsnprintf
17558 case "$d_snprintf-$d_vsnprintf" in
17561 Checking whether your snprintf() and vsnprintf() work okay...
17563 $cat >try.c <<'EOCP'
17564 /* v?snprintf testing logic courtesy of Russ Allbery.
17565 * According to C99:
17566 * - if the buffer is too short it still must be \0-terminated
17567 * - if the buffer is too short the potentially required length
17568 * must be returned and not -1
17569 * - if the buffer is NULL the potentially required length
17570 * must be returned and not -1 or core dump
17573 #include <stdarg.h>
17577 int test (char *format, ...)
17582 va_start (args, format);
17583 count = vsnprintf (buf, sizeof buf, format, args);
17590 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
17591 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
17595 if eval $compile; then
17598 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
17600 Your snprintf() and snprintf() don't seem to be working okay.
17602 d_snprintf="$undef"
17603 d_vsnprintf="$undef"
17607 echo "(I can't seem to compile the test program--assuming they don't)"
17608 d_snprintf="$undef"
17609 d_vsnprintf="$undef"
17615 : see if sockatmark exists
17616 set sockatmark d_sockatmark
17619 : see if prototype for sockatmark is available
17621 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
17624 : see if socks5_init exists
17625 set socks5_init d_socks5_init
17628 : see if sprintf returns the length of the string in the buffer as per ANSI
17629 $echo "Checking whether sprintf returns the length of the string..." >&4
17632 #$i_stdlib I_STDLIB
17634 #include <stdlib.h>
17636 #$i_string I_STRING
17638 # include <string.h>
17640 # include <strings.h>
17649 int check (size_t expect, int test) {
17650 size_t got = strlen(buffer);
17654 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
17659 int main(int argc, char **argv) {
17662 check(sprintf(buffer, ""), ++test);
17663 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
17664 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
17671 if eval $compile; then
17675 sprintf returns the length of the string (as ANSI says it should)
17677 d_sprintf_returns_strlen="$define"
17680 sprintf does not return the length of the string (how old is this system?)
17682 d_sprintf_returns_strlen="$undef"
17686 echo "(I can't seem to compile the test program--assuming it doesn't)" >&4
17687 d_sprintf_returns_strlen="$undef"
17691 : see if srand48_r exists
17692 set srand48_r d_srand48_r
17694 case "$d_srand48_r" in
17696 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17697 case "$d_srand48_r_proto:$usethreads" in
17698 ":define") d_srand48_r_proto=define
17699 set d_srand48_r_proto srand48_r $hdrs
17703 case "$d_srand48_r_proto" in
17705 case "$srand48_r_proto" in
17706 ''|0) try='int srand48_r(long, struct drand48_data*);'
17707 ./protochk "$extern_C $try" $hdrs && srand48_r_proto=I_LS ;;
17709 case "$srand48_r_proto" in
17710 ''|0) d_srand48_r=undef
17712 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
17713 * ) case "$srand48_r_proto" in
17714 REENTRANT_PROTO*) ;;
17715 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
17717 echo "Prototype: $try" ;;
17720 *) case "$usethreads" in
17721 define) echo "srand48_r has no prototype, not using it." >&4 ;;
17728 *) srand48_r_proto=0
17732 : see if srandom_r exists
17733 set srandom_r d_srandom_r
17735 case "$d_srandom_r" in
17737 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17738 case "$d_srandom_r_proto:$usethreads" in
17739 ":define") d_srandom_r_proto=define
17740 set d_srandom_r_proto srandom_r $hdrs
17744 case "$d_srandom_r_proto" in
17746 case "$srandom_r_proto" in
17747 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
17748 ./protochk "$extern_C $try" $hdrs && srandom_r_proto=I_TS ;;
17750 case "$srandom_r_proto" in
17751 ''|0) d_srandom_r=undef
17753 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
17754 * ) case "$srandom_r_proto" in
17755 REENTRANT_PROTO*) ;;
17756 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
17758 echo "Prototype: $try" ;;
17761 *) case "$usethreads" in
17762 define) echo "srandom_r has no prototype, not using it." >&4 ;;
17769 *) srandom_r_proto=0
17773 : see if prototype for setresgid is available
17775 set d_sresgproto setresgid $i_unistd unistd.h
17778 : see if prototype for setresuid is available
17780 set d_sresuproto setresuid $i_unistd unistd.h
17783 : see if sys/stat.h is available
17784 set sys/stat.h i_sysstat
17787 : see if stat knows about block sizes
17789 echo "Checking to see if your struct stat has st_blocks field..." >&4
17790 set d_statblks stat st_blocks $i_sysstat sys/stat.h
17793 : see if this is a sys/vfs.h system
17794 set sys/vfs.h i_sysvfs
17797 : see if this is a sys/statfs.h system
17798 set sys/statfs.h i_sysstatfs
17801 : Check for statfs_s
17803 echo "Checking to see if your system supports struct statfs..." >&4
17804 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
17806 case "$d_statfs_s" in
17807 "$define") echo "Yes, it does." ;;
17808 *) echo "No, it doesn't." ;;
17812 : see if struct statfs knows about f_flags
17813 case "$d_statfs_s" in
17816 echo "Checking to see if your struct statfs has f_flags field..." >&4
17817 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
17821 set d_statfs_f_flags
17825 case "$d_statfs_f_flags" in
17826 "$define") echo "Yes, it does." ;;
17827 *) echo "No, it doesn't." ;;
17830 : Check stream access
17832 Checking how to access stdio streams by file descriptor number...
17834 case "$stdio_stream_array" in
17835 '') $cat >try.c <<EOCP
17838 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
17842 for s in _iob __iob __sF
17844 set try -DSTDIO_STREAM_ARRAY=$s
17845 if eval $compile; then
17846 case "`$run ./try`" in
17847 yes) stdio_stream_array=$s; break ;;
17853 case "$stdio_stream_array" in
17855 I can't figure out how to access stdio streams by file descriptor number.
17857 d_stdio_stream_array="$undef"
17860 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
17862 d_stdio_stream_array="$define"
17866 : see if strcoll exists
17867 set strcoll d_strcoll
17870 : check for structure copying
17872 echo "Checking to see if your C compiler can copy structs..." >&4
17873 $cat >try.c <<'EOCP'
17883 if $cc -c try.c >/dev/null 2>&1 ; then
17885 echo "Yup, it can."
17888 echo "Nope, it can't."
17894 : see if strerror and/or sys_errlist[] exist
17896 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
17897 if set strerror val -f d_strerror; eval $csym; $val; then
17898 echo 'strerror() found.' >&4
17899 d_strerror="$define"
17900 d_strerrm='strerror(e)'
17901 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17902 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
17903 d_syserrlst="$define"
17905 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
17906 d_syserrlst="$undef"
17908 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
17909 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
17910 echo 'strerror() found in string header.' >&4
17911 d_strerror="$define"
17912 d_strerrm='strerror(e)'
17913 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17914 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
17915 d_syserrlst="$define"
17917 echo "(You don't appear to have any sys_errlist[], how can this be?)"
17918 d_syserrlst="$undef"
17920 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17921 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
17922 d_strerror="$undef"
17923 d_syserrlst="$define"
17924 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
17926 echo 'strerror() and sys_errlist[] NOT found.' >&4
17927 d_strerror="$undef"
17928 d_syserrlst="$undef"
17929 d_strerrm='"unknown"'
17933 : see if strerror_r exists
17934 set strerror_r d_strerror_r
17936 case "$d_strerror_r" in
17938 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
17939 case "$d_strerror_r_proto:$usethreads" in
17940 ":define") d_strerror_r_proto=define
17941 set d_strerror_r_proto strerror_r $hdrs
17945 case "$d_strerror_r_proto" in
17947 case "$strerror_r_proto" in
17948 ''|0) try='int strerror_r(int, char*, size_t);'
17949 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBW ;;
17951 case "$strerror_r_proto" in
17952 ''|0) try='int strerror_r(int, char*, int);'
17953 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBI ;;
17955 case "$strerror_r_proto" in
17956 ''|0) try='char* strerror_r(int, char*, size_t);'
17957 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=B_IBW ;;
17959 case "$strerror_r_proto" in
17960 ''|0) d_strerror_r=undef
17962 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
17963 * ) case "$strerror_r_proto" in
17964 REENTRANT_PROTO*) ;;
17965 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
17967 echo "Prototype: $try" ;;
17970 *) case "$usethreads" in
17971 define) echo "strerror_r has no prototype, not using it." >&4 ;;
17978 *) strerror_r_proto=0
17982 : see if strftime exists
17983 set strftime d_strftime
17986 : see if strlcat exists
17987 set strlcat d_strlcat
17990 : see if strlcpy exists
17991 set strlcpy d_strlcpy
17994 : see if strtod exists
17995 set strtod d_strtod
17998 : see if strtol exists
17999 set strtol d_strtol
18002 : see if strtold exists
18003 set strtold d_strtold
18006 : see if strtoll exists
18007 set strtoll d_strtoll
18010 case "$d_longlong-$d_strtoll" in
18013 Checking whether your strtoll() works okay...
18015 $cat >try.c <<'EOCP'
18018 #define strtoll __strtoll
18021 #define strtoll _strtoll
18024 extern long long int strtoll(char *s, char **, int);
18025 static int bad = 0;
18026 int check(char *s, long long ell, int een) {
18029 gll = strtoll(s, 0, 10);
18030 if (!((gll == ell) && (errno == een)))
18034 check(" 1", 1LL, 0);
18035 check(" 0", 0LL, 0);
18036 check("-1", -1LL, 0);
18037 check("-9223372036854775808", -9223372036854775808LL, 0);
18038 check("-9223372036854775808", -9223372036854775808LL, 0);
18039 check(" 9223372036854775807", 9223372036854775807LL, 0);
18040 check("-9223372036854775808", -9223372036854775808LL, 0);
18041 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
18042 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
18048 if eval $compile; then
18051 ok) echo "Your strtoll() seems to be working okay." ;;
18053 Your strtoll() doesn't seem to be working okay.
18059 echo "(I can't seem to compile the test program--assuming it doesn't)"
18065 : see if strtoq exists
18066 set strtoq d_strtoq
18069 : see if strtoul exists
18070 set strtoul d_strtoul
18073 case "$d_strtoul" in
18076 Checking whether your strtoul() works okay...
18078 $cat >try.c <<'EOCP'
18081 extern unsigned long int strtoul(char *s, char **, int);
18082 static int bad = 0;
18083 void check(char *s, unsigned long eul, int een) {
18086 gul = strtoul(s, 0, 10);
18087 if (!((gul == eul) && (errno == een)))
18091 check(" 1", 1L, 0);
18092 check(" 0", 0L, 0);
18094 case "$longsize" in
18096 $cat >>try.c <<'EOCP'
18097 check("18446744073709551615", 18446744073709551615UL, 0);
18098 check("18446744073709551616", 18446744073709551615UL, ERANGE);
18099 #if 0 /* strtoul() for /^-/ strings is undefined. */
18100 check("-1", 18446744073709551615UL, 0);
18101 check("-18446744073709551614", 2, 0);
18102 check("-18446744073709551615", 1, 0);
18103 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
18104 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
18109 $cat >>try.c <<'EOCP'
18110 check("4294967295", 4294967295UL, 0);
18111 check("4294967296", 4294967295UL, ERANGE);
18112 #if 0 /* strtoul() for /^-/ strings is undefined. */
18113 check("-1", 4294967295UL, 0);
18114 check("-4294967294", 2, 0);
18115 check("-4294967295", 1, 0);
18116 check("-4294967296", 4294967295UL, ERANGE);
18117 check("-4294967297", 4294967295UL, ERANGE);
18122 : Should we write these tests to be more portable by sprintf-ing
18123 : ~0 and then manipulating that char string as input for strtol?
18126 $cat >>try.c <<'EOCP'
18133 if eval $compile; then
18134 case "`$run ./try`" in
18135 ok) echo "Your strtoul() seems to be working okay." ;;
18137 Your strtoul() doesn't seem to be working okay.
18143 echo "(I can't seem to compile the test program--assuming it doesn't)"
18149 : see if strtoull exists
18150 set strtoull d_strtoull
18153 case "$d_longlong-$d_strtoull" in
18156 Checking whether your strtoull() works okay...
18158 $cat >try.c <<'EOCP'
18161 #define strtoull __strtoull
18164 extern unsigned long long int strtoull(char *s, char **, int);
18165 static int bad = 0;
18166 int check(char *s, long long eull, int een) {
18169 gull = strtoull(s, 0, 10);
18170 if (!((gull == eull) && (errno == een)))
18174 check(" 1", 1LL, 0);
18175 check(" 0", 0LL, 0);
18176 check("18446744073709551615", 18446744073709551615ULL, 0);
18177 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18178 #if 0 /* strtoull() for /^-/ strings is undefined. */
18179 check("-1", 18446744073709551615ULL, 0);
18180 check("-18446744073709551614", 2LL, 0);
18181 check("-18446744073709551615", 1LL, 0);
18182 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18183 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18190 if eval $compile; then
18191 case "`$run ./try`" in
18192 ok) echo "Your strtoull() seems to be working okay." ;;
18194 Your strtoull() doesn't seem to be working okay.
18196 d_strtoull="$undef"
18200 echo "(I can't seem to compile the test program--assuming it doesn't)"
18201 d_strtoull="$undef"
18206 : see if strtouq exists
18207 set strtouq d_strtouq
18210 case "$d_strtouq" in
18213 Checking whether your strtouq() works okay...
18215 $cat >try.c <<'EOCP'
18218 extern unsigned long long int strtouq(char *s, char **, int);
18219 static int bad = 0;
18220 void check(char *s, unsigned long long eull, int een) {
18221 unsigned long long gull;
18223 gull = strtouq(s, 0, 10);
18224 if (!((gull == eull) && (errno == een)))
18228 check(" 1", 1LL, 0);
18229 check(" 0", 0LL, 0);
18230 check("18446744073709551615", 18446744073709551615ULL, 0);
18231 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18232 #if 0 /* strtouq() for /^-/ strings is undefined. */
18233 check("-1", 18446744073709551615ULL, 0);
18234 check("-18446744073709551614", 2LL, 0);
18235 check("-18446744073709551615", 1LL, 0);
18236 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18237 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18245 if eval $compile; then
18246 case "`$run ./try`" in
18247 ok) echo "Your strtouq() seems to be working okay." ;;
18249 Your strtouq() doesn't seem to be working okay.
18255 echo "(I can't seem to compile the test program--assuming it doesn't)"
18261 : see if strxfrm exists
18262 set strxfrm d_strxfrm
18265 : see if symlink exists
18266 set symlink d_symlink
18269 : see if syscall exists
18270 set syscall d_syscall
18273 : see if prototype for syscall is available
18275 set d_syscallproto syscall $i_unistd unistd.h
18278 : see if sysconf exists
18279 set sysconf d_sysconf
18282 : see if system exists
18283 set system d_system
18286 : see if tcgetpgrp exists
18287 set tcgetpgrp d_tcgetpgrp
18290 : see if tcsetpgrp exists
18291 set tcsetpgrp d_tcsetpgrp
18294 : see if prototype for telldir is available
18296 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
18299 : see if time exists
18301 if test "X$d_time" = X -o X"$timetype" = X; then
18302 if set time val -f d_time; eval $csym; $val; then
18303 echo 'time() found.' >&4
18305 rp="What is the type returned by time() on this system?"
18306 set time_t timetype long stdio.h sys/types.h
18309 echo 'time() not found, hope that will do.' >&4
18317 : see if timegm exists
18318 set timegm d_timegm
18321 : see if this is a sys/times.h system
18322 set sys/times.h i_systimes
18325 : see if times exists
18327 if set times val -f d_times; eval $csym; $val; then
18328 echo 'times() found.' >&4
18331 case "$i_systimes" in
18332 "$define") inc='sys/times.h';;
18334 rp="What is the type returned by times() on this system?"
18335 set clock_t clocktype long stdio.h sys/types.h $inc
18338 echo 'times() NOT found, hope that will do.' >&4
18343 : see if tmpnam_r exists
18344 set tmpnam_r d_tmpnam_r
18346 case "$d_tmpnam_r" in
18348 hdrs="$i_systypes sys/types.h define stdio.h "
18349 case "$d_tmpnam_r_proto:$usethreads" in
18350 ":define") d_tmpnam_r_proto=define
18351 set d_tmpnam_r_proto tmpnam_r $hdrs
18355 case "$d_tmpnam_r_proto" in
18357 case "$tmpnam_r_proto" in
18358 ''|0) try='char* tmpnam_r(char*);'
18359 ./protochk "$extern_C $try" $hdrs && tmpnam_r_proto=B_B ;;
18361 case "$tmpnam_r_proto" in
18362 ''|0) d_tmpnam_r=undef
18364 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
18365 * ) case "$tmpnam_r_proto" in
18366 REENTRANT_PROTO*) ;;
18367 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
18369 echo "Prototype: $try" ;;
18372 *) case "$usethreads" in
18373 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
18380 *) tmpnam_r_proto=0
18384 : see if truncate exists
18385 set truncate d_truncate
18388 : see if ttyname_r exists
18389 set ttyname_r d_ttyname_r
18391 case "$d_ttyname_r" in
18393 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
18394 case "$d_ttyname_r_proto:$usethreads" in
18395 ":define") d_ttyname_r_proto=define
18396 set d_ttyname_r_proto ttyname_r $hdrs
18400 case "$d_ttyname_r_proto" in
18402 case "$ttyname_r_proto" in
18403 ''|0) try='int ttyname_r(int, char*, size_t);'
18404 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBW ;;
18406 case "$ttyname_r_proto" in
18407 ''|0) try='int ttyname_r(int, char*, int);'
18408 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBI ;;
18410 case "$ttyname_r_proto" in
18411 ''|0) try='char* ttyname_r(int, char*, int);'
18412 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=B_IBI ;;
18414 case "$ttyname_r_proto" in
18415 ''|0) d_ttyname_r=undef
18417 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
18418 * ) case "$ttyname_r_proto" in
18419 REENTRANT_PROTO*) ;;
18420 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
18422 echo "Prototype: $try" ;;
18425 *) case "$usethreads" in
18426 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
18433 *) ttyname_r_proto=0
18437 : see if tzname[] exists
18439 if set tzname val -a d_tzname; eval $csym; $val; then
18441 echo 'tzname[] found.' >&4
18444 echo 'tzname[] NOT found.' >&4
18449 : Check if is a multiplatform env
18451 next|rhapsody|darwin) multiarch="$define" ;;
18453 case "$multiarch" in
18454 ''|[nN]*) multiarch="$undef" ;;
18457 : check for ordering of bytes in a UV
18459 case "$usecrosscompile$multiarch" in
18462 You seem to be either cross-compiling or doing a multiarchitecture build,
18463 skipping the byteorder check.
18469 case "$byteorder" in
18472 In the following, larger digits indicate more significance. A big-endian
18473 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
18474 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
18475 machines may have weird orders like 3412. A Cray will report 87654321,
18476 an Alpha will report 12345678. If the test program works the default is
18478 I'm now running the test program...
18482 #$i_stdlib I_STDLIB
18484 #include <stdlib.h>
18486 #include <sys/types.h>
18487 typedef $uvtype UV;
18497 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
18499 u.l = (UV)0x04030201;
18500 for (i = 0; i < $uvsize; i++)
18501 printf("%c", u.c[i]+'0');
18508 if eval $compile && $run ./try > /dev/null; then
18511 [1-4][1-4][1-4][1-4]|12345678|87654321)
18512 echo "(The test program ran ok.)"
18513 echo "byteorder=$dflt"
18516 ????|????????) echo "(The test program ran ok.)" ;;
18517 *) echo "(The test program didn't run right for some reason.)" ;;
18522 (I can't seem to compile the test program. Guessing big-endian...)
18525 case "$xxx_prompt" in
18527 rp="What is the order of bytes in $uvtype?"
18540 : Checking 32bit aligndness
18543 Checking to see whether you can access character data unalignedly...
18545 case "$d_u32align" in
18546 '') $cat >try.c <<EOCP
18548 #$i_stdlib I_STDLIB
18550 #include <stdlib.h>
18552 #define U32 $u32type
18553 #define BYTEORDER 0x$byteorder
18555 #include <signal.h>
18557 $signal_t bletch(int s) { exit(4); }
18560 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
18565 if (sizeof(U32) != 4) {
18566 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
18573 signal(SIGBUS, bletch);
18585 for (i = 0; i < 4; i++) {
18586 up = (U32*)(buf + i);
18587 if (! ((*up == 1 << (8*i)) || /* big-endian */
18588 (*up == 1 << (8*(3-i))) /* little-endian */
18592 printf("read failed (%x)\n", *up);
18598 for (i = 0; i < 4; i++) {
18599 up = (U32*)(buf + i);
18601 if (*up != 0xBeef) {
18602 printf("write failed (%x)\n", *up);
18616 if eval $compile_ok; then
18617 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
18618 $run ./try 2>&1 >/dev/null
18621 You can access character data pretty unalignedly.
18623 d_u32align="$undef"
18626 It seems that you must access character data in an aligned manner.
18628 d_u32align="$define"
18632 rp='Can you access character data at unaligned addresses?'
18636 [yY]*) d_u32align="$undef" ;;
18637 *) d_u32align="$define" ;;
18644 : see if ualarm exists
18645 set ualarm d_ualarm
18648 : see if umask exists
18652 : see if unordered exists
18653 set unordered d_unordered
18656 : see if unsetenv exists
18657 set unsetenv d_unsetenv
18660 : see if usleep exists
18661 set usleep d_usleep
18664 : see if prototype for usleep is available
18666 set d_usleepproto usleep $i_unistd unistd.h
18669 : see if ustat exists
18673 : see if closedir exists
18674 set closedir d_closedir
18677 case "$d_closedir" in
18680 echo "Checking whether closedir() returns a status..." >&4
18682 #$i_dirent I_DIRENT /**/
18683 #$i_sysdir I_SYS_DIR /**/
18684 #$i_sysndir I_SYS_NDIR /**/
18685 #$i_systypes I_SYS_TYPES /**/
18687 #if defined(I_SYS_TYPES)
18688 #include <sys/types.h>
18690 #if defined(I_DIRENT)
18691 #include <dirent.h>
18692 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
18693 #include <sys/dir.h>
18697 #include <sys/ndir.h>
18701 #include <ndir.h> /* may be wrong in the future */
18703 #include <sys/dir.h>
18708 int main() { return closedir(opendir(".")); }
18711 if eval $compile_ok; then
18712 if $run ./try > /dev/null 2>&1 ; then
18713 echo "Yes, it does."
18716 echo "No, it doesn't."
18720 echo "(I can't seem to compile the test program--assuming it doesn't)"
18728 set d_void_closedir
18732 : see if there is a wait4
18736 : see if waitpid exists
18737 set waitpid d_waitpid
18740 : see if wcstombs exists
18741 set wcstombs d_wcstombs
18744 : see if wctomb exists
18745 set wctomb d_wctomb
18748 : see if writev exists
18749 set writev d_writev
18752 : preserve RCS keywords in files with variable substitution, grrr
18757 Revision='$Revision'
18759 : check for alignment requirements
18761 case "$usecrosscompile$multiarch" in
18764 You seem to be either cross-compiling or doing a multiarchitecture build,
18765 skipping the memory alignment check.
18768 case "$alignbytes" in
18769 '') alignbytes=8 ;;
18773 case "$alignbytes" in
18774 '') echo "Checking alignment constraints..." >&4
18775 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
18776 $cat >try.c <<'EOCP'
18777 typedef long double NV;
18780 $cat >try.c <<'EOCP'
18784 $cat >>try.c <<'EOCP'
18792 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
18797 if eval $compile_ok; then
18801 echo "(I can't seem to compile the test program...)"
18804 *) dflt="$alignbytes"
18807 rp="Doubles must be aligned on a how-many-byte boundary?"
18815 : set the base revision
18818 : how do we concatenate cpp tokens here?
18820 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
18821 $cat >cpp_stuff.c <<'EOCP'
18822 #define RCAT(a,b)a/**/b
18823 #define ACAT(a,b)a ## b
18827 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
18828 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
18829 echo "Oh! Smells like ANSI's been here." >&4
18830 echo "We can catify or stringify, separately or together!"
18832 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
18833 echo "Ah, yes! The good old days!" >&4
18834 echo "However, in the good old days we don't know how to stringify and"
18835 echo "catify at the same time."
18839 Hmm, I don't seem to be able to concatenate tokens with your cpp.
18840 You're going to have to edit the values of CAT[2-5] in config.h...
18842 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
18846 : see if this is a db.h system
18852 : Check db version.
18854 echo "Checking Berkeley DB version ..." >&4
18860 #include <sys/types.h>
18862 #$i_stdlib I_STDLIB
18864 #include <stdlib.h>
18867 int main(int argc, char *argv[])
18869 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
18870 int Major, Minor, Patch ;
18871 unsigned long Version ;
18872 (void)db_version(&Major, &Minor, &Patch) ;
18874 printf("%d %d %d %d %d %d\n",
18875 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
18876 Major, Minor, Patch);
18879 printf("You have Berkeley DB Version 2 or greater.\n");
18881 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
18882 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
18883 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
18884 Major, Minor, Patch) ;
18886 /* check that db.h & libdb are compatible */
18887 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
18888 printf("db.h and libdb are incompatible.\n") ;
18892 printf("db.h and libdb are compatible.\n") ;
18894 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
18895 + DB_VERSION_PATCH ;
18897 /* needs to be >= 2.3.4 */
18898 if (Version < 2003004) {
18899 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
18900 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
18906 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
18911 printf("You have Berkeley DB Version 1.\n");
18912 exit(0); /* DB version < 2: the coast is clear. */
18914 exit(1); /* <db.h> not Berkeley DB? */
18920 if eval $compile_ok && $run ./try; then
18921 echo 'Looks OK.' >&4
18923 db_version_major=$1
18924 db_version_minor=$2
18925 db_version_patch=$3
18927 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
18931 : Remove db from list of libraries to use
18932 echo "Removing unusable -ldb from library list" >&4
18933 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
18936 echo "libs = $libs" >&4
18946 : Check the return type needed for hash
18948 echo "Checking return type needed for hash for Berkeley DB ..." >&4
18954 #include <sys/types.h>
18957 #ifndef DB_VERSION_MAJOR
18958 u_int32_t hash_cb (ptr, size)
18966 info.hash = hash_cb;
18970 if $cc $ccflags -c try.c >try.out 2>&1 ; then
18971 if $contains warning try.out >>/dev/null 2>&1 ; then
18974 db_hashtype='u_int32_t'
18977 : XXX Maybe we should just give up here.
18978 db_hashtype=u_int32_t
18980 echo "Help: I can't seem to compile the db test program." >&4
18981 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
18984 echo "Your version of Berkeley DB uses $db_hashtype for hash."
18986 *) db_hashtype=u_int32_t
18991 : Check the return type needed for prefix
18993 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
18999 #include <sys/types.h>
19002 #ifndef DB_VERSION_MAJOR
19003 size_t prefix_cb (key1, key2)
19011 info.prefix = prefix_cb;
19015 if $cc $ccflags -c try.c >try.out 2>&1 ; then
19016 if $contains warning try.out >>/dev/null 2>&1 ; then
19017 db_prefixtype='int'
19019 db_prefixtype='size_t'
19022 db_prefixtype='size_t'
19023 : XXX Maybe we should just give up here.
19025 echo "Help: I can't seem to compile the db test program." >&4
19026 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
19029 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
19031 *) db_prefixtype='size_t'
19035 : How can we generate normalized random numbers ?
19037 echo "Looking for a random number function..." >&4
19038 case "$randfunc" in
19040 if set drand48 val -f; eval $csym; $val; then
19042 echo "Good, found drand48()." >&4
19043 elif set random val -f; eval $csym; $val; then
19045 echo "OK, found random()." >&4
19048 echo "Yick, looks like I have to use rand()." >&4
19059 *-Dmy_rand=*|*-Dmy_srand=*)
19060 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
19061 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
19062 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
19063 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
19067 while $test "$cont"; do
19068 rp="Use which function to generate random numbers?"
19070 if $test "$ans" = "$dflt"; then
19076 if set $ans val -f; eval $csym; $val; then
19080 rp="I cannot find function $ans. Use that name anyway?"
19089 case "$randfunc" in
19091 drand01="drand48()"
19097 case "$randbits" in
19099 echo "Checking to see how many bits your $randfunc() function produces..." >&4
19101 #$i_unistd I_UNISTD
19102 #$i_stdlib I_STDLIB
19105 # include <unistd.h>
19108 # include <stdlib.h>
19113 register unsigned long tmp;
19114 register unsigned long max = 0L;
19116 for (i = 1000; i; i--) {
19117 tmp = (unsigned long) $randfunc();
19118 if (tmp > max) max = tmp;
19120 for (i = 0; max; i++)
19126 if eval $compile_ok; then
19130 echo "(I can't seem to compile the test program...)"
19137 rp="How many bits does your $randfunc() function produce?"
19141 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
19142 seedfunc="s$randfunc"
19143 randseedtype=unsigned
19147 rp="How many bits does your $randfunc() function produce?"
19150 seedfunc="s$randfunc"
19151 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
19152 if set $seedfunc val -f; eval $csym; $val; then
19153 echo "(Using $seedfunc() to seed random generator)"
19155 echo "(Warning: no $seedfunc() to seed random generator)"
19158 randseedtype=unsigned
19165 : Determine if this is an EBCDIC system
19167 echo "Determining whether or not we are on an EBCDIC system..." >&4
19168 $cat >try.c <<'EOM'
19171 if ('M'==0xd4) return 0;
19178 if eval $compile_ok; then
19179 if $run ./try; then
19180 echo "You seem to speak EBCDIC." >&4
19183 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
19186 echo "I'm unable to compile the test program." >&4
19187 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
19193 : Check how to flush
19196 Checking how to flush all pending stdio output...
19198 # I only know how to find the first 32 possibly open files on SunOS.
19199 # See also hints/sunos_4_1.sh and util.c --AD
19201 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
19203 $cat >>try.c <<EOCP
19205 #$i_stdlib I_STDLIB
19207 #include <stdlib.h>
19209 #$i_unistd I_UNISTD
19211 # include <unistd.h>
19213 #$d_sysconf HAS_SYSCONF
19214 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
19215 #ifdef HAS_STDIO_STREAM_ARRAY
19216 # define STDIO_STREAM_ARRAY $stdio_stream_array
19221 p = fopen("try.out", "w");
19225 # ifdef TRY_FPRINTF
19229 #ifdef TRY_FFLUSH_NULL
19232 #ifdef TRY_FFLUSH_ALL
19234 long open_max = -1;
19235 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
19236 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
19238 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
19239 open_max = sysconf(_SC_OPEN_MAX);
19242 open_max = FOPEN_MAX;
19245 open_max = OPEN_MAX;
19254 # ifdef HAS_STDIO_STREAM_ARRAY
19255 if (open_max > 0) {
19257 for (i = 0; i < open_max; i++)
19258 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
19259 STDIO_STREAM_ARRAY[i]._file < open_max &&
19260 STDIO_STREAM_ARRAY[i]._flag)
19261 fflush(&STDIO_STREAM_ARRAY[i]);
19269 : first we have to find out how _not_ to flush
19271 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
19273 set try -DTRY_FPUTC
19274 if eval $compile; then
19275 $run ./try 2>/dev/null
19278 if $test ! -s try.out -a "X$code" = X42; then
19284 set try -DTRY_FPRINTF
19285 if eval $compile; then
19286 $run ./try 2>/dev/null
19289 if $test ! -s try.out -a "X$code" = X42; then
19290 output=-DTRY_FPRINTF
19296 : check for fflush NULL behaviour
19297 case "$fflushNULL" in
19298 '') set try -DTRY_FFLUSH_NULL $output
19299 if eval $compile; then
19300 $run ./try 2>/dev/null
19303 if $test -s try.out -a "X$code" = X42; then
19304 fflushNULL="`$cat try.out`"
19306 if $test "X$code" != X42; then
19308 (If this test failed, don't worry, we'll try another method shortly.)
19313 $rm -f core try.core core.try.*
19314 case "$fflushNULL" in
19316 Your fflush(NULL) works okay for output streams.
19317 Let's see if it clobbers input pipes...
19319 # As of mid-March 2000 all versions of Solaris appear to have a stdio
19320 # bug that improperly flushes the input end of pipes. So we avoid the
19321 # autoflush on fork/system/exec support for now. :-(
19322 $cat >tryp.c <<EOCP
19325 main(int argc, char **argv)
19331 while ((i = getc(stdin)) != -1
19332 && (*bp++ = i) != '\n'
19333 && bp < &buf[1024])
19336 fprintf(stdout, "%s", buf);
19344 fflushNULL="$define"
19346 if eval $compile; then
19348 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19349 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19351 fflush(NULL) seems to behave okay with input streams.
19353 fflushNULL="$define"
19356 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
19358 fflushNULL="$undef"
19361 $rm -f core tryp.c tryp.core core.tryp.*
19364 Your fflush(NULL) isn't working (contrary to ANSI C).
19366 fflushNULL="$undef"
19369 Cannot figure out whether your fflush(NULL) works or not.
19370 I'm assuming it doesn't (contrary to ANSI C).
19372 fflushNULL="$undef"
19376 $define|true|[yY]*)
19377 fflushNULL="$define"
19380 fflushNULL="$undef"
19383 : check explicit looping only if NULL did not work, and if the pipe
19384 : bug does not show up on an explicit flush too
19385 case "$fflushNULL" in
19387 $cat >tryp.c <<EOCP
19390 main(int argc, char **argv)
19396 while ((i = getc(stdin)) != -1
19397 && (*bp++ = i) != '\n'
19398 && bp < &buf[1024])
19401 fprintf(stdout, "%s", buf);
19410 if eval $compile; then
19412 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19413 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19415 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
19417 : now check for fflushall behaviour
19418 case "$fflushall" in
19419 '') set try -DTRY_FFLUSH_ALL $output
19420 if eval $compile; then
19422 (Now testing the other method--but note that this also may fail.)
19424 $run ./try 2>/dev/null
19427 if $test -s try.out -a "X$code" = X42; then
19428 fflushall="`$cat try.out`"
19432 case "$fflushall" in
19434 Whew. Flushing explicitly all the stdio streams works.
19436 fflushall="$define"
19439 Sigh. Flushing explicitly all the stdio streams doesn't work.
19444 Cannot figure out whether flushing stdio streams explicitly works or not.
19445 I'm assuming it doesn't.
19451 "$define"|true|[yY]*)
19452 fflushall="$define"
19460 All is futile. Even fflush(stdin) clobbers input pipes!
19467 $rm -f core tryp.c tryp.core core.tryp.*
19469 *) fflushall="$undef"
19473 case "$fflushNULL$fflushall" in
19476 OK, I give up. I cannot figure out how to flush pending stdio output.
19477 We won't be flushing handles at all before fork/exec/popen.
19483 : Store the full pathname to the ar program for use in the C program
19484 : Respect a hint or command line value for full_ar.
19489 : Store the full pathname to the sed program for use in the C program
19492 : see what type gids are declared as in the kernel
19494 echo "Looking for the type for group ids returned by getgid()."
19495 set gid_t gidtype xxx stdio.h sys/types.h
19499 xxx=`./findhdr sys/user.h`
19500 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
19502 unsigned) dflt="$1 $2" ;;
19506 *) dflt="$gidtype";;
19509 gid_t) echo "gid_t found." ;;
19510 *) rp="What is the type for group ids returned by getgid()?"
19516 : Check the size of GID
19519 *_t) zzz="$gidtype" ;;
19522 echo "Checking the size of $zzz..." >&4
19524 #include <sys/types.h>
19526 #$i_stdlib I_STDLIB
19528 #include <stdlib.h>
19531 printf("%d\n", (int)sizeof($gidtype));
19536 if eval $compile_ok; then
19540 echo "(I can't execute the test program--guessing $gidsize.)" >&4
19543 echo "Your $zzz is $gidsize bytes long."
19548 echo "(I can't compile the test program--guessing $gidsize.)" >&4
19552 : Check if GID is signed
19555 *_t) zzz="$gidtype" ;;
19558 echo "Checking the sign of $zzz..." >&4
19560 #include <sys/types.h>
19571 if eval $compile; then
19575 echo "(I can't execute the test program--guessing unsigned.)" >&4
19579 1) echo "Your $zzz is unsigned." ;;
19580 -1) echo "Your $zzz is signed." ;;
19586 echo "(I can't compile the test program--guessing unsigned.)" >&4
19590 : Check 64bit sizes
19593 if $test X"$quadtype" != X; then
19595 echo "Checking how to print 64-bit integers..." >&4
19597 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
19598 $cat >try.c <<'EOCP'
19599 #include <sys/types.h>
19602 int q = 12345678901;
19603 printf("%ld\n", q);
19607 if eval $compile; then
19611 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
19612 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
19613 echo "We will use %d."
19619 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
19620 $cat >try.c <<'EOCP'
19621 #include <sys/types.h>
19624 long q = 12345678901;
19625 printf("%ld\n", q);
19629 if eval $compile; then
19633 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
19634 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
19635 echo "We will use %ld."
19641 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
19642 $cat >try.c <<'EOCP'
19643 #include <sys/types.h>
19644 #include <inttypes.h>
19647 int64_t q = 12345678901;
19648 printf("%" PRId64 "\n", q);
19652 if eval $compile; then
19656 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
19657 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
19658 echo "We will use the C9X style."
19664 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19666 #include <sys/types.h>
19669 $quadtype q = 12345678901;
19670 printf("%Ld\n", q);
19674 if eval $compile; then
19678 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
19679 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
19680 echo "We will use %Ld."
19686 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
19687 $cat >try.c <<'EOCP'
19688 #include <sys/types.h>
19691 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
19692 printf("%lld\n", q);
19696 if eval $compile; then
19700 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
19701 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
19702 echo "We will use the %lld style."
19708 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19710 #include <sys/types.h>
19713 $quadtype q = 12345678901;
19714 printf("%qd\n", q);
19718 if eval $compile; then
19722 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
19723 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
19724 echo "We will use %qd."
19730 if $test X"$sPRId64" = X; then
19731 echo "Cannot figure out how to print 64-bit integers." >&4
19738 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
19739 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
19741 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
19742 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
19746 : Check format strings for internal types
19748 $echo "Checking the format strings to be used for Perl's internal types..." >&4
19750 if $test X"$ivsize" = X8; then
19751 ivdformat="$sPRId64"
19752 uvuformat="$sPRIu64"
19753 uvoformat="$sPRIo64"
19754 uvxformat="$sPRIx64"
19755 uvXUformat="$sPRIXU64"
19757 if $test X"$ivsize" = X"$longsize"; then
19764 if $test X"$ivsize" = X"$intsize"; then
19772 if $test X"$ivsize" = X"$shortsize"; then
19783 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
19784 nveformat="$sPRIeldbl"
19785 nvfformat="$sPRIfldbl"
19786 nvgformat="$sPRIgldbl"
19787 nvEUformat="$sPRIEUldbl"
19788 nvFUformat="$sPRIFUldbl"
19789 nvGUformat="$sPRIGUldbl"
19799 case "$ivdformat" in
19800 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
19805 : Check format string for GID
19808 $echo "Checking the format string to be used for gids..." >&4
19811 -1) if $test X"$gidsize" = X"$ivsize"; then
19812 gidformat="$ivdformat"
19814 if $test X"$gidsize" = X"$longsize"; then
19817 if $test X"$gidsize" = X"$intsize"; then
19820 if $test X"$gidsize" = X"$shortsize"; then
19827 *) if $test X"$gidsize" = X"$uvsize"; then
19828 gidformat="$uvuformat"
19830 if $test X"$gidsize" = X"$longsize"; then
19833 if $test X"$gidsize" = X"$intsize"; then
19836 if $test X"$gidsize" = X"$shortsize"; then
19845 : see if getgroups exists
19846 set getgroups d_getgrps
19849 : see if setgroups exists
19850 set setgroups d_setgrps
19853 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
19855 case "$d_getgrps$d_setgrps" in
19857 case "$groupstype" in
19858 '') dflt="$gidtype" ;;
19859 *) dflt="$groupstype" ;;
19862 What type of pointer is the second argument to getgroups() and setgroups()?
19863 Usually this is the same as group ids, $gidtype, but not always.
19866 rp='What type pointer is the second argument to getgroups() and setgroups()?'
19870 *) groupstype="$gidtype";;
19873 : MAD = Misc Attribute Definition
19875 if $test $patchlevel -lt 9; then
19876 : MAD is not available in 5.8.x or earlier.
19880 $define|true|[yY]*) dflt='y' ;;
19885 Would you like to build with Misc Attribute Decoration? This is development
19886 work leading to a Perl 5 to Perl 6 convertor, which imposes a space and speed
19887 overhead on the interpreter.
19889 If this doesn't make any sense to you, just accept the default '$dflt'.
19891 rp='Build Perl with MAD?'
19896 madlyh='madly.h madly.act madly.tab'
19898 madlyobj="madly$_o" ;;
19907 : check whether make sets MAKE
19909 echo "Checking if your $make program sets \$(MAKE)..." >&4
19910 case "$make_set_make" in
19912 $sed 's/^X //' > testmake.mak << 'EOF'
19914 X @echo 'maketemp="$(MAKE)"'
19916 case "`$make -f testmake.mak 2>/dev/null`" in
19917 *maketemp=*) make_set_make='#' ;;
19918 *) make_set_make="MAKE=$make" ;;
19920 $rm -f testmake.mak
19923 case "$make_set_make" in
19924 '#') echo "Yup, it does.";;
19925 *) echo "Nope, it doesn't.";;
19928 : see what type is used for mode_t
19929 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
19930 set mode_t modetype int stdio.h sys/types.h
19933 : see if we need va_copy
19935 case "$i_stdarg" in
19938 #include <stdarg.h>
19940 #$i_stdlib I_STDLIB
19942 #include <stdlib.h>
19944 #include <signal.h>
19947 ivfprintf(FILE *f, const char *fmt, va_list *valp)
19949 return vfprintf(f, fmt, *valp);
19953 myvfprintf(FILE *f, const char *fmt, va_list val)
19955 return ivfprintf(f, fmt, &val);
19959 myprintf(char *fmt, ...)
19962 va_start(val, fmt);
19963 return myvfprintf(stdout, fmt, val);
19967 main(int ac, char **av)
19969 signal(SIGSEGV, exit);
19971 myprintf("%s%cs all right, then\n", "that", '\'');
19976 if eval $compile && $run ./try 2>&1 >/dev/null; then
19977 case "`$run ./try`" in
19978 "that's all right, then")
19984 yes) echo "It seems that you don't need va_copy()." >&4
19985 need_va_copy="$undef"
19987 *) echo "It seems that va_copy() or similar will be needed." >&4
19988 need_va_copy="$define"
19993 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
19997 : see what type is used for size_t
19998 rp="What is the type used for the length parameter for string functions?"
19999 set size_t sizetype 'unsigned int' stdio.h sys/types.h
20002 : check for type of arguments to gethostbyaddr.
20003 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
20004 case "$d_gethbyaddr" in
20008 Checking to see what type of arguments are accepted by gethostbyaddr().
20010 hdrs="$define sys/types.h
20011 $d_socket sys/socket.h
20012 $i_niin netinet/in.h
20014 $i_unistd unistd.h"
20015 : The first arg can 'char *' or 'void *'
20016 : The second arg is some of integral type
20017 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
20018 for yyy in size_t long int; do
20019 case "$netdb_host_type" in
20020 '') try="$extern_C struct hostent *gethostbyaddr($xxx, $yyy, int);"
20021 if ./protochk "$try" $hdrs; then
20022 echo "Your system accepts $xxx for the first arg."
20023 echo "...and $yyy for the second arg."
20024 netdb_host_type="$xxx"
20025 netdb_hlen_type="$yyy"
20031 : In case none of those worked, prompt the user.
20032 case "$netdb_host_type" in
20033 '') rp='What is the type for the 1st argument to gethostbyaddr?'
20036 netdb_host_type=$ans
20037 rp='What is the type for the 2nd argument to gethostbyaddr?'
20040 netdb_hlen_type=$ans
20044 *) : no gethostbyaddr, so pick harmless defaults
20045 netdb_host_type='char *'
20046 netdb_hlen_type="$sizetype"
20049 # Remove the "const" if needed. -- but then we'll have a
20051 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
20054 : check for type of argument to gethostbyname.
20055 if test "X$netdb_name_type" = X ; then
20056 case "$d_gethbyname" in
20060 Checking to see what type of argument is accepted by gethostbyname().
20062 hdrs="$define sys/types.h
20063 $d_socket sys/socket.h
20064 $i_niin netinet/in.h
20066 $i_unistd unistd.h"
20067 for xxx in "const char *" "char *"; do
20068 case "$netdb_name_type" in
20069 '') try="$extern_C struct hostent *gethostbyname($xxx);"
20070 if ./protochk "$try" $hdrs; then
20071 echo "Your system accepts $xxx."
20072 netdb_name_type="$xxx"
20077 : In case none of those worked, prompt the user.
20078 case "$netdb_name_type" in
20079 '') rp='What is the type for the 1st argument to gethostbyname?'
20082 netdb_name_type=$ans
20086 *) : no gethostbyname, so pick harmless default
20087 netdb_name_type='char *'
20092 : check for type of 1st argument to getnetbyaddr.
20093 if test "X$netdb_net_type" = X ; then
20094 case "$d_getnbyaddr" in
20098 Checking to see what type of 1st argument is accepted by getnetbyaddr().
20100 hdrs="$define sys/types.h
20101 $d_socket sys/socket.h
20102 $i_niin netinet/in.h
20104 $i_unistd unistd.h"
20105 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
20106 case "$netdb_net_type" in
20107 '') try="$extern_C struct netent *getnetbyaddr($xxx, int);"
20108 if ./protochk "$try" $hdrs; then
20109 echo "Your system accepts $xxx."
20110 netdb_net_type="$xxx"
20115 : In case none of those worked, prompt the user.
20116 case "$netdb_net_type" in
20117 '') rp='What is the type for the 1st argument to getnetbyaddr?'
20120 netdb_net_type=$ans
20124 *) : no getnetbyaddr, so pick harmless default
20125 netdb_net_type='long'
20129 : locate the preferred pager for this system
20136 [a-zA-Z]:/*) dflt=$pg;;
20140 [a-zA-Z]:/*) dflt=$more;;
20144 [a-zA-Z]:/*) dflt=$less;;
20147 '') dflt=/usr/ucb/more;;
20155 rp='What pager is used on your system?'
20159 : see what type pids are declared as in the kernel
20160 rp="What is the type of process ids on this system?"
20161 set pid_t pidtype int stdio.h sys/types.h
20164 : see if ar generates random libraries by itself
20166 echo "Checking how to generate random libraries on your machine..." >&4
20167 echo 'int bar1() { return bar2(); }' > bar1.c
20168 echo 'int bar2() { return 2; }' > bar2.c
20170 #$i_stdlib I_STDLIB
20172 #include <stdlib.h>
20174 int main() { printf("%d\n", bar1()); exit(0); }
20176 $cc $ccflags -c bar1.c >/dev/null 2>&1
20177 $cc $ccflags -c bar2.c >/dev/null 2>&1
20178 $cc $ccflags -c foo.c >/dev/null 2>&1
20179 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
20180 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20181 $run ./foobar >/dev/null 2>&1; then
20182 echo "$ar appears to generate random libraries itself."
20184 if [ "X$ranlib" = "X" ]; then
20187 elif $ar s bar$_a >/dev/null 2>&1 &&
20188 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20189 $run ./foobar >/dev/null 2>&1; then
20190 echo "a table of contents needs to be added with '$ar s'."
20193 elif $ar ts bar$_a >/dev/null 2>&1 &&
20194 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20195 $run ./foobar >/dev/null 2>&1; then
20196 echo "a table of contents needs to be added with '$ar ts'."
20203 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
20204 $test -f $ranlib || ranlib=''
20207 if $test -n "$ranlib"; then
20208 echo "your system has '$ranlib'; we'll use that."
20211 echo "your system doesn't seem to support random libraries"
20212 echo "so we'll use lorder and tsort to order the libraries."
20219 : see if this is a values.h system
20220 set values.h i_values
20223 : Check the max offset that gmtime and localtime accept
20224 echo "Checking max offsets that gmtime () accepts"
20227 define) yyy="#include <values.h>" ;;
20231 case "$sGMTIME_min/$sGMTIME_max" in
20234 #include <sys/types.h>
20243 void gm_check (time_t t, int min_year, int max_year)
20246 if ( tmp == NULL ||
20247 /* Check tm_year overflow */
20248 tmp->tm_year < min_year || tmp->tm_year > max_year)
20259 gm_check (MAXLONG, 69, 0x7fffffff);
20261 if (tmp == NULL || tmp->tm_year < 0) {
20262 for (i = 63; i >= 0; i--) {
20263 time_t x = pt | ((time_t)1 << i);
20264 if (x < 0 || x < pt) continue;
20265 gm_check (x, 69, 0x7fffffff);
20268 printf ("sGMTIME_max=%ld\n", pt);
20277 gm_check (MINLONG, -1900, 70);
20280 for (i = 36; i >= 0; i--) {
20281 time_t x = pt - ((time_t)1 << i);
20282 if (x > 0) continue;
20283 gm_check (x, -1900, 70);
20286 printf ("sGMTIME_min=%ld\n", pt);
20290 int main (int argc, char *argv[])
20292 fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t));
20299 if eval $compile; then
20302 echo "Cannot determine sGMTIME_max and sGMTIME_min." >&4
20308 echo "Checking max offsets that localtime () accepts"
20310 case "$sLOCALTIME_min/$sLOCALTIME_max" in
20313 #include <sys/types.h>
20322 void local_check (time_t t, int min_year, int max_year)
20324 if (sizeof (time_t) > 4 && t > 0x7ffffffffffff000LL)
20327 tmp = localtime (&t);
20328 if ( tmp == NULL ||
20329 /* Check tm_year overflow */
20330 tmp->tm_year < min_year || tmp->tm_year > max_year)
20334 } /* local_check */
20341 local_check (MAXLONG, 69, 0x7fffffff);
20343 if (tmp == NULL || tmp->tm_year < 0) {
20344 for (i = 63; i >= 0; i--) {
20345 time_t x = pt | ((time_t)1 << i);
20346 if (x < 0 || x < pt) continue;
20347 local_check (x, 69, 0x7fffffff);
20350 printf ("sLOCALTIME_max=%ld\n", pt);
20359 local_check (MINLONG, -1900, 70);
20362 for (i = 36; i >= 0; i--) {
20363 time_t x = pt - ((time_t)1 << i);
20364 if (x > 0) continue;
20365 local_check (x, -1900, 70);
20368 printf ("sLOCALTIME_min=%ld\n", pt);
20372 int main (int argc, char *argv[])
20380 if eval $compile; then
20383 echo "Cannot determine sLOCALTIME_max and sLOCALTIME_min." >&4
20389 : check for type of arguments to select.
20390 case "$selecttype" in
20391 '') case "$d_select" in
20395 Checking to see what type of arguments are accepted by select().
20397 hdrs="$define sys/types.h
20398 $i_systime sys/time.h
20399 $i_sysselct sys/select.h
20400 $d_socket sys/socket.h"
20401 : The first arg can be int, unsigned, or size_t
20402 : The last arg may or may not be 'const'
20404 : void pointer has been seen but using that
20405 : breaks the selectminbits test
20406 for xxx in 'fd_set *' 'int *'; do
20407 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
20408 for tmo in 'struct timeval *' 'const struct timeval *'; do
20410 '') try="$extern_C select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
20411 if ./protochk "$try" $hdrs; then
20412 echo "Your system accepts $xxx."
20421 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
20422 case "$d_fd_set" in
20423 $define) dflt="fd_set *" ;;
20432 *) : no select, so pick a harmless default
20439 : check for the select 'width'
20440 case "$selectminbits" in
20441 '') safebits=`expr $ptrsize \* 8`
20442 case "$d_select" in
20446 Checking to see on how many bits at a time your select() operates...
20449 #include <sys/types.h>
20451 #$i_systime I_SYS_TIME
20452 #$i_systimek I_SYS_TIME_KERNEL
20457 # ifdef I_SYS_TIME_KERNEL
20460 # include <sys/time.h>
20461 # ifdef I_SYS_TIME_KERNEL
20465 #$i_sysselct I_SYS_SELECT
20466 #ifdef I_SYS_SELECT
20467 #include <sys/select.h>
20469 #$d_socket HAS_SOCKET
20471 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
20474 #$i_stdlib I_STDLIB
20476 #include <stdlib.h>
20479 #define S sizeof(*(b))
20481 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
20482 #define NBITS (NBYTES * 8)
20484 char *s = (char *)malloc(NBYTES);
20493 fp = fopen("try.c", "r");
20499 b = ($selecttype)s;
20500 for (i = 0; i < NBITS; i++)
20504 select(fd + 1, b, 0, 0, &t);
20505 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
20507 printf("%d\n", i + 1);
20512 if eval $compile_ok; then
20513 selectminbits=`$run ./try`
20514 case "$selectminbits" in
20516 Cannot figure out on how many bits at a time your select() operates.
20517 I'll play safe and guess it is $safebits bits.
20519 selectminbits=$safebits
20520 bits="$safebits bits"
20523 *) bits="$selectminbits bits" ;;
20525 echo "Your select() operates on $bits at a time." >&4
20527 rp='What is the minimum number of bits your select() operates on?'
20528 case "$byteorder" in
20529 12345678) dflt=64 ;;
20535 selectminbits="$val"
20539 *) : no select, so pick a harmless default
20540 selectminbits=$safebits
20546 : Trace out the files included by signal.h, then look for SIGxxx names.
20547 if [ "X$fieldn" = X ]; then
20548 : Just make some guesses. We check them later.
20549 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
20551 xxx=`echo '#include <signal.h>' |
20552 $cppstdin $cppminus $cppflags 2>/dev/null |
20553 $grep '^[ ]*#.*include' |
20554 $awk "{print \\$$fieldn}" | $sed 's!"!!g' |\
20555 $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
20558 for xx in $xxx /dev/null ; do
20559 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
20561 case "$xxxfiles" in
20562 '') xxxfiles=`./findhdr signal.h` ;;
20565 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
20566 print substr($2, 4, 20)
20568 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
20569 print substr($3, 4, 20)
20571 : Append some common names just in case the awk scan failed.
20572 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
20573 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
20574 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
20575 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
20576 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
20578 : generate a few handy files for later
20579 $cat > signal.c <<EOCP
20580 #include <sys/types.h>
20581 #include <signal.h>
20582 #$i_stdlib I_STDLIB
20584 #include <stdlib.h>
20589 /* Strange style to avoid deeply-nested #if/#else/#endif */
20592 # define NSIG (_NSIG)
20598 # define NSIG (SIGMAX+1)
20604 # define NSIG (SIG_MAX+1)
20610 # define NSIG (_SIG_MAX+1)
20616 # define NSIG (MAXSIG+1)
20622 # define NSIG (MAX_SIG+1)
20627 # ifdef SIGARRAYSIZE
20628 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
20634 # define NSIG (_sys_nsig) /* Solaris 2.5 */
20638 /* Default to some arbitrary number that's big enough to get most
20639 of the common signals.
20645 printf("NSIG %d\n", NSIG);
20651 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
20653 printf "#ifdef SIG"; printf $1; printf "\n"
20654 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
20655 printf $1; printf ");\n"
20659 printf "#endif /* JUST_NSIG */\n";
20660 printf "exit(0);\n}\n";
20663 $cat >signal.awk <<'EOP'
20664 BEGIN { ndups = 0 }
20665 $1 ~ /^NSIG$/ { nsig = $2 }
20666 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
20667 if ($2 > maxsig) { maxsig = $2 }
20668 if (sig_name[$2]) {
20669 dup_name[ndups] = $1
20670 dup_num[ndups] = $2
20682 printf("NSIG %d\n", nsig);
20683 for (n = 1; n < nsig; n++) {
20685 printf("%s %d\n", sig_name[n], sig_num[n])
20688 printf("NUM%d %d\n", n, n)
20691 for (n = 0; n < ndups; n++) {
20692 printf("%s %d\n", dup_name[n], dup_num[n])
20696 $cat >signal_cmd <<EOS
20698 if $test -s signal.lst; then
20699 echo "Using your existing signal.lst file"
20704 $cat >>signal_cmd <<'EOS'
20707 if eval $compile_ok; then
20708 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) |\
20709 $uniq | $awk -f signal.awk >signal.lst
20711 echo "(I can't seem be able to compile the whole test program)" >&4
20712 echo "(I'll try it in little pieces.)" >&4
20713 set signal -DJUST_NSIG
20714 if eval $compile_ok; then
20715 $run ./signal$_exe > signal.nsg
20718 echo "I can't seem to figure out how many signals you have." >&4
20719 echo "Guessing 50." >&4
20720 echo 'NSIG 50' > signal.nsg
20722 : Now look at all the signal names, one at a time.
20723 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
20724 $cat > signal.c <<EOCP
20725 #include <sys/types.h>
20726 #include <signal.h>
20729 printf("$xx %d\n", SIG${xx});
20734 if eval $compile; then
20735 echo "SIG${xx} found."
20736 $run ./signal$_exe >> signal.ls1
20738 echo "SIG${xx} NOT found."
20741 if $test -s signal.ls1; then
20742 $cat signal.nsg signal.ls1 |
20743 $sort -n | $uniq | $awk -f signal.awk >signal.lst
20747 if $test -s signal.lst; then
20750 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
20751 echo 'kill -l' >signal
20752 set X `csh -f <signal`
20756 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
20758 echo $@ | $tr ' ' $trnl | \
20759 $awk '{ printf "%s %d\n", $1, ++s; }
20760 END { printf "NSIG %d\n", ++s }' >signal.lst
20762 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
20764 chmod a+x signal_cmd
20765 $eunicefix signal_cmd
20767 : generate list of signal names
20769 case "$sig_name_init" in
20771 *) case "$sig_num_init" in
20772 ''|*,*) doinit=yes ;;
20777 echo "Generating a list of signal names and numbers..." >&4
20779 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
20780 sig_name=`$awk 'BEGIN { printf "ZERO " }
20781 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
20782 sig_num=`$awk 'BEGIN { printf "0 " }
20783 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
20784 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
20785 !/^NSIG/ { printf "\"%s\", ", $1 }
20786 END { printf "0\n" }' signal.lst`
20787 sig_num_init=`$awk 'BEGIN { printf "0, " }
20788 !/^NSIG/ { printf "%d, ", $2}
20789 END { printf "0\n"}' signal.lst`
20792 echo "The following $sig_count signals are available:"
20794 echo $sig_name | $awk \
20795 'BEGIN { linelen = 0 }
20797 for (i = 1; i <= NF; i++) {
20798 name = "SIG" $i " "
20799 linelen = linelen + length(name)
20800 if (linelen > 70) {
20802 linelen = length(name)
20808 sig_size=`echo $sig_name | awk '{print NF}'`
20809 $rm -f signal signal.c signal.awk signal.lst signal_cmd
20811 : Check size of size
20813 case "$sizetype" in
20814 *_t) zzz="$sizetype" ;;
20815 *) zzz="filesize" ;;
20817 echo "Checking the size of $zzz..." >&4
20819 #include <sys/types.h>
20821 #$i_stdlib I_STDLIB
20823 #include <stdlib.h>
20826 printf("%d\n", (int)sizeof($sizetype));
20831 if eval $compile_ok; then
20835 echo "(I can't execute the test program--guessing $sizesize.)" >&4
20838 echo "Your $zzz size is $sizesize bytes."
20843 echo "(I can't compile the test program--guessing $sizesize.)" >&4
20847 : check for socklen_t
20849 echo "Checking to see if you have socklen_t..." >&4
20851 #include <sys/types.h>
20852 #$d_socket HAS_SOCKET
20854 #include <sys/socket.h>
20856 int main() { socklen_t x = 16; }
20859 if eval $compile; then
20861 echo "You have socklen_t."
20864 echo "You do not have socklen_t."
20865 case "$sizetype" in
20866 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
20873 : see if this is a socks.h system
20874 set socks.h i_socks
20877 : check for type of the size argument to socket calls
20878 case "$d_socket" in
20882 Checking to see what type is the last argument of accept().
20885 case "$d_socklen_t" in
20886 "$define") yyy="$yyy socklen_t"
20888 yyy="$yyy $sizetype int long unsigned"
20889 for xxx in $yyy; do
20890 case "$socksizetype" in
20891 '') try="$extern_C int accept(int, struct sockaddr *, $xxx *);"
20892 case "$usesocks" in
20894 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
20895 echo "Your system accepts '$xxx *' for the last argument of accept()."
20896 socksizetype="$xxx"
20899 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
20900 echo "Your system accepts '$xxx *' for the last argument of accept()."
20901 socksizetype="$xxx"
20908 : In case none of those worked, prompt the user.
20909 case "$socksizetype" in
20910 '') rp='What is the type for socket address structure sizes?'
20917 *) : no sockets, so pick relatively harmless default
20922 : see what type is used for signed size_t
20923 set ssize_t ssizetype int stdio.h sys/types.h
20928 #$i_stdlib I_STDLIB
20930 #include <stdlib.h>
20932 #include <sys/types.h>
20933 #define Size_t $sizetype
20934 #define SSize_t $dflt
20937 if (sizeof(Size_t) == sizeof(SSize_t))
20939 else if (sizeof(Size_t) == sizeof(int))
20948 if eval $compile_ok && $run ./try > /dev/null; then
20949 ssizetype=`$run ./try`
20950 echo "I'll be using $ssizetype for functions returning a byte count." >&4
20953 Help! I can't compile and run the ssize_t test program: please enlighten me!
20954 (This is probably a misconfiguration in your system or libraries, and
20955 you really ought to fix it. Still, I'll try anyway.)
20957 I need a type that is the same size as $sizetype, but is guaranteed to
20958 be signed. Common values are ssize_t, int and long.
20961 rp="What signed type is the same size as $sizetype?"
20967 : see what type of char stdio uses.
20969 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
20970 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
20971 echo "Your stdio uses unsigned chars." >&4
20972 stdchar="unsigned char"
20974 echo "Your stdio uses signed chars." >&4
20979 : see what type uids are declared as in the kernel
20981 echo "Looking for the type for user ids returned by getuid()."
20982 set uid_t uidtype xxx stdio.h sys/types.h
20986 xxx=`./findhdr sys/user.h`
20987 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
20989 unsigned) dflt="$1 $2" ;;
20993 *) dflt="$uidtype";;
20996 uid_t) echo "uid_t found." ;;
20997 *) rp="What is the type for user ids returned by getuid()?"
21003 : Check size of UID
21006 *_t) zzz="$uidtype" ;;
21009 echo "Checking the size of $zzz..." >&4
21011 #include <sys/types.h>
21013 #$i_stdlib I_STDLIB
21015 #include <stdlib.h>
21018 printf("%d\n", (int)sizeof($uidtype));
21023 if eval $compile_ok; then
21027 echo "(I can't execute the test program--guessing $uidsize.)" >&4
21030 echo "Your $zzz is $uidsize bytes long."
21035 echo "(I can't compile the test program--guessing $uidsize.)" >&4
21038 : Check if UID is signed
21041 *_t) zzz="$uidtype" ;;
21044 echo "Checking the sign of $zzz..." >&4
21046 #include <sys/types.h>
21057 if eval $compile; then
21061 echo "(I can't execute the test program--guessing unsigned.)" >&4
21065 1) echo "Your $zzz is unsigned." ;;
21066 -1) echo "Your $zzz is signed." ;;
21072 echo "(I can't compile the test program--guessing unsigned.)" >&4
21076 : Check format string for UID
21078 $echo "Checking the format string to be used for uids..." >&4
21081 -1) if $test X"$uidsize" = X"$ivsize"; then
21082 uidformat="$ivdformat"
21084 if $test X"$uidsize" = X"$longsize"; then
21087 if $test X"$uidsize" = X"$intsize"; then
21090 if $test X"$uidsize" = X"$shortsize"; then
21097 *) if $test X"$uidsize" = X"$uvsize"; then
21098 uidformat="$uvuformat"
21100 if $test X"$uidsize" = X"$longsize"; then
21103 if $test X"$uidsize" = X"$intsize"; then
21106 if $test X"$uidsize" = X"$shortsize"; then
21115 : Check if site customization support was requested
21116 case "$usesitecustomize" in
21117 $define|true|[Yy]*)
21118 usesitecustomize="$define"
21121 usesitecustomize="$undef"
21125 : determine compiler compiler
21134 if $test -f "$byacc$_exe"; then
21136 comp="byacc or $comp"
21138 if $test -f "$bison$_exe"; then
21139 comp="$comp or bison -y"
21141 rp="Which compiler compiler ($comp) shall I use?"
21150 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
21156 : see if this is a assert.h system
21157 set assert.h i_assert
21160 : see if this is a fp.h system
21164 : see if this is a fp_class.h system
21165 set fp_class.h i_fp_class
21168 : see if gdbm.h is available
21173 : see if gdbm_open exists
21174 set gdbm_open d_gdbm_open
21176 case "$d_gdbm_open" in
21179 echo "We won't be including <gdbm.h>"
21188 : see if this is a ieeefp.h system
21189 case "$i_ieeefp" in
21190 '' ) set ieeefp.h i_ieeefp
21195 : see if this is a libutil.h system
21196 set libutil.h i_libutil
21199 : see if mach cthreads are available
21200 if test "X$usethreads" = "X$define"; then
21201 set mach/cthreads.h i_machcthr
21204 i_machcthr="$undef"
21207 : see if this is a mntent.h system
21208 set mntent.h i_mntent
21211 : see if net/errno.h is available
21213 set net/errno.h val
21216 : Unfortunately, it causes problems on some systems. Arrgh.
21219 cat > try.c <<'EOM'
21222 #include <net/errno.h>
21228 if $cc $ccflags -c try.c >/dev/null 2>&1; then
21229 echo "We'll be including <net/errno.h>." >&4
21231 echo "We won't be including <net/errno.h>." >&4
21240 : see if netinet/tcp.h is available
21241 set netinet/tcp.h i_netinettcp
21244 : see if this is a poll.h system
21248 : see if this is a prot.h system
21252 : Preprocessor symbols
21254 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
21255 $cat <<'EOSH' > Cppsym.know
21256 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
21257 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
21258 alliant alpha am29000 AM29000 AMD64 amd64 amiga AMIGAOS AMIX
21259 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
21260 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
21261 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
21262 bull c cadmus clipper CMU COFF COMPILER_VERSION
21263 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
21264 CYGWIN DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
21265 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
21266 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
21268 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
21269 H3050R H3050RX hbullx20 hcx host_mips
21270 hp200 hp300 hp700 HP700 hp800 hp9000
21271 hp9000s200 hp9000s300 hp9000s400 hp9000s500
21272 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
21273 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
21274 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
21275 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
21276 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
21277 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
21278 LIBCATAMOUNT Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
21279 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
21280 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
21281 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
21282 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
21283 MATH_HAS_NO_SIDE_EFFECTS
21284 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
21285 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
21286 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
21287 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
21288 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
21289 NetBSD news1500 news1700 news1800 news1900 news3700
21290 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
21291 ns32016 ns32332 ns32k nsc32000
21292 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
21293 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
21294 pc532 pdp11 PGC PIC plexus PORTAR posix
21295 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
21296 POSIX_C_SOURCE POSIX_SOURCE POWER
21297 PROTOTYPES PWB pyr QNX QK_USER R3000 REENTRANT RES Rhapsody RISC6000
21298 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
21299 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
21300 sony sony_news sonyrisc sparc sparclite spectrum
21301 stardent stdc STDC_EXT stratos sun sun3 sun386
21302 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
21303 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
21304 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
21305 sysV68 sysV88 Tek4132 Tek4300 titan
21306 TM3200 TM5400 TM5600
21307 tower tower32 tower32_200 tower32_600 tower32_700
21308 tower32_800 tower32_850 tss
21309 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
21310 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
21311 unix UNIX95 UNIX99 unixpc unos
21312 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
21313 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
21314 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
21316 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms x86_64 xenix Xenix286
21317 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
21318 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
21321 # Maybe put other stuff here too.
21322 cat <<EOSH >>Cppsym.know
21325 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
21326 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
21327 $cat Cppsym.know > Cppsym.c
21328 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
21329 $rm -f Cppsym.a Cppsym.b Cppsym.c
21330 cat <<EOSH > Cppsym
21332 if $test \$# -gt 0; then
21333 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
21334 if $test -s Cppsym.got; then
21341 $tr " " "$trnl" | ./Cppsym.try
21347 cat <<EOSH > Cppsym.try
21349 cat <<'EOCP' > try.c
21352 #define STRINGIFY(a) "a"
21354 #if cpp_stuff == 42
21355 #define StGiFy(a) #a
21356 #define STRINGIFY(a) StGiFy(a)
21358 #if $cpp_stuff != 1 && $cpp_stuff != 42
21359 # include "Bletch: How does this C preprocessor stringify macros?"
21365 cat <<'EOSH' >> Cppsym.try
21367 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
21368 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
21369 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
21370 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
21372 echo 'return 0;}' >> try.c
21374 cat <<EOSH >> Cppsym.try
21376 case "$osname-$gccversion" in
21377 irix-) ccflags="\$ccflags -woff 1178" ;;
21378 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
21380 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
21382 chmod +x Cppsym.try
21383 $eunicefix Cppsym.try
21384 ./Cppsym < Cppsym.know > Cppsym.true
21385 : Add in any linux cpp "predefined macros":
21386 case "$osname::$gccversion" in
21389 rm -f $tHdrH'.h' $tHdrH
21391 if cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
21392 sed 's/#define[\ \ ]*//;s/[\ \ ].*$//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
21393 if [ -s $tHdrH'_cppsym.real' ]; then
21394 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
21397 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
21400 : now check the C compiler for additional symbols
21401 postprocess_cc_v=''
21403 aix) postprocess_cc_v="|$tr , ' '" ;;
21410 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
21413 -D*) echo "\$i" | $sed 's/^-D//';;
21414 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
21419 postprocess_cc_v=''
21422 ./ccsym > ccsym1.raw
21423 if $test -s ccsym1.raw; then
21424 $sort ccsym1.raw | $uniq >ccsym.raw
21426 mv ccsym1.raw ccsym.raw
21429 $awk '/\=/ { print $0; next }
21430 { print $0"=1" }' ccsym.raw >ccsym.list
21431 $comm -13 Cppsym.true ccsym.list >ccsym.own
21432 $comm -12 Cppsym.true ccsym.list >ccsym.com
21433 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
21435 if $test -z ccsym.raw; then
21436 echo "Your C compiler doesn't seem to define any symbols!" >&4
21438 echo "However, your C preprocessor defines the following symbols:"
21441 cppsymbols=`$cat Cppsym.true`
21442 cppsymbols=`echo $cppsymbols`
21443 cppccsymbols="$cppsymbols"
21445 if $test -s ccsym.com; then
21446 echo "Your C compiler and pre-processor define these symbols:"
21447 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
21450 cppccsymbols=`$cat ccsym.com`
21451 cppccsymbols=`echo $cppccsymbols`
21452 $test "$silent" || sleep 1
21454 if $test -s ccsym.cpp; then
21455 $test "$also" && echo " "
21456 echo "Your C pre-processor ${also}defines the following symbols:"
21457 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
21459 cppsymbols=`$cat ccsym.cpp`
21460 cppsymbols=`echo $cppsymbols`
21461 $test "$silent" || sleep 1
21463 if $test -s ccsym.own; then
21464 $test "$also" && echo " "
21465 echo "Your C compiler ${also}defines the following cpp symbols:"
21466 $sed -e 's/\(..*\)=1/\1/' ccsym.own
21467 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
21468 ccsymbols=`$cat ccsym.own`
21469 ccsymbols=`echo $ccsymbols`
21470 $test "$silent" || sleep 1
21474 : see if this is a termio system
21478 if $test `./findhdr termios.h`; then
21479 set tcsetattr i_termios
21485 "$define") echo "You have POSIX termios.h... good!" >&4;;
21486 *) if ./Cppsym pyr; then
21487 case "`/bin/universe`" in
21488 ucb) if $test `./findhdr sgtty.h`; then
21490 echo "<sgtty.h> found." >&4
21492 echo "System is pyramid with BSD universe."
21493 ./warn "<sgtty.h> not found--you could have problems."
21495 *) if $test `./findhdr termio.h`; then
21497 echo "<termio.h> found." >&4
21499 echo "System is pyramid with USG universe."
21500 ./warn "<termio.h> not found--you could have problems."
21504 if $test `./findhdr termio.h`; then
21505 echo "<termio.h> found." >&4
21507 elif $test `./findhdr sgtty.h`; then
21508 echo "<sgtty.h> found." >&4
21511 ./warn "Neither <termio.h> nor <sgtty.h> found--cross fingers!"
21514 if $test `./findhdr sgtty.h`; then
21515 echo "<sgtty.h> found." >&4
21517 elif $test `./findhdr termio.h`; then
21518 echo "<termio.h> found." >&4
21521 ./warn "Neither <sgtty.h> nor <termio.h> found--cross fingers!"
21525 set i_termio; eval $setvar
21526 val=$val2; set i_sgtty; eval $setvar
21527 val=$val3; set i_termios; eval $setvar
21529 : see if stddef is available
21530 set stddef.h i_stddef
21533 : see if sys/access.h is available
21534 set sys/access.h i_sysaccess
21537 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
21538 set sys/filio.h i_sysfilio
21541 if $test `./findhdr sys/ioctl.h`; then
21543 echo '<sys/ioctl.h> found.' >&4
21546 if $test $i_sysfilio = "$define"; then
21547 echo '<sys/ioctl.h> NOT found.' >&4
21549 $test $i_sgtty = "$define" && xxx="sgtty.h"
21550 $test $i_termio = "$define" && xxx="termio.h"
21551 $test $i_termios = "$define" && xxx="termios.h"
21552 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
21558 : see if socket ioctl defs are in sys/sockio.h
21560 xxx=`./findhdr sys/sockio.h`
21561 if $test "$xxx"; then
21562 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
21564 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
21567 echo "No socket ioctls found in <sys/sockio.h>." >&4
21572 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
21578 : see if this is a syslog.h system
21579 set syslog.h i_syslog
21582 : see if this is a sys/mode.h system
21583 set sys/mode.h i_sysmode
21586 : see if there is a sys/poll.h file
21587 set sys/poll.h i_syspoll
21590 : see if sys/resource.h has to be included
21591 set sys/resource.h i_sysresrc
21594 : see if sys/security.h is available
21595 set sys/security.h i_syssecrt
21598 : see if this is a sys/statvfs.h system
21599 set sys/statvfs.h i_sysstatvfs
21602 : see if this is a sys/un.h system
21603 set sys/un.h i_sysun
21606 : see if this is a sys/utsname.h system
21607 set sys/utsname.h i_sysutsname
21610 : see if this is a syswait system
21611 set sys/wait.h i_syswait
21614 : see if this is a ustat.h system
21615 set ustat.h i_ustat
21618 : see if this is an utime system
21619 set utime.h i_utime
21622 : see if this is a vfork system
21625 set vfork.h i_vfork
21635 echo "Looking for extensions..." >&4
21636 : If we are using the old config.sh, known_extensions may contain
21637 : old or inaccurate or duplicate values.
21638 known_extensions=''
21639 nonxs_extensions=''
21640 : We do not use find because it might not be available.
21641 : We do not just use MANIFEST because the user may have dropped
21642 : some additional extensions into the source tree and expect them
21645 : Function to recursively find available extensions, ignoring DynaLoader
21646 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
21650 DynaLoader|dynaload) ;;
21652 this_ext=`echo $xxx | $sed -e s/-/\\\//g`;
21653 leaf=`echo $xxx | $sed -e s/.*-//`;
21654 if $test -d File-Glob; then
21655 if $test -f $xxx/$leaf.xs -o -f $xxx/$leaf.c; then
21656 known_extensions="$known_extensions $this_ext";
21657 elif $test -d $xxx; then
21658 nonxs_extensions="$nonxs_extensions $this_ext";
21661 if $test -f $xxx/$leaf.xs -o -f $xxx/$leaf.c; then
21662 known_extensions="$known_extensions $1$this_ext";
21663 elif $test -f $xxx/Makefile.PL; then
21664 nonxs_extensions="$nonxs_extensions $1$this_ext";
21666 if $test -d $xxx -a $# -lt 10; then
21669 eval $find_extensions;
21682 eval $find_extensions
21683 if $test -d File-Glob; then
21684 : All ext/ flattened
21686 # Special case: Add in modules that nest beyond the first level.
21687 # Currently threads/shared and Hash/Util/FieldHash, since they are
21688 # not picked up by the recursive find above (and adding in general
21689 # recursive finding breaks SDBM_File/sdbm).
21690 # A.D. 20011025 (SDBM), ajgough 20071008 (FieldHash)
21691 known_extensions="$known_extensions threads/shared Hash/Util/FieldHash"
21693 set X $known_extensions
21695 known_extensions="$*"
21696 set X $nonxs_extensions
21698 nonxs_extensions="$*"
21701 : Now see which are supported on this system.
21703 for xxx in $known_extensions ; do
21707 $define) avail_ext="$avail_ext $xxx" ;;
21710 GDBM_File|gdbm_fil)
21712 $define) avail_ext="$avail_ext $xxx" ;;
21715 I18N/Langinfo|i18n_lan)
21716 case "$i_langinfo$d_nl_langinfo" in
21717 $define$define) avail_ext="$avail_ext $xxx" ;;
21721 : XXX Do we need a useipcsysv variable here
21722 case "${d_msg}${d_sem}${d_shm}" in
21723 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
21726 NDBM_File|ndbm_fil)
21729 case "$osname-$use64bitint" in
21732 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
21735 *) avail_ext="$avail_ext $xxx" ;;
21740 ODBM_File|odbm_fil)
21741 case "${i_dbm}${i_rpcsvcdbm}" in
21743 case "$d_cplusplus" in
21744 define) ;; # delete as a function name will not work
21745 *) case "$osname-$use64bitint" in
21748 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
21751 *) avail_ext="$avail_ext $xxx" ;;
21759 case "$useopcode" in
21760 true|define|y) avail_ext="$avail_ext $xxx" ;;
21764 case "$useposix" in
21765 true|define|y) avail_ext="$avail_ext $xxx" ;;
21769 case "$d_socket" in
21772 beos) ;; # not unless BONE
21773 *) avail_ext="$avail_ext $xxx" ;;
21778 Sys/Syslog|sys/syslog)
21779 : XXX syslog requires socket
21780 case "$d_socket" in
21781 true|$define|y) avail_ext="$avail_ext $xxx" ;;
21785 case "$usethreads" in
21787 case "$use5005threads" in
21788 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
21792 threads|threads/shared)
21793 # threads and threads::shared are special cases.
21794 # To stop people from asking "Perl 5.8.0 was supposed
21795 # to have this new fancy threads implementation but my
21796 # perl doesn't have it" and from people trying to
21797 # (re)install the threads module using CPAN.pm and
21798 # CPAN.pm then offering to reinstall Perl 5.8.0,
21799 # the threads.pm and threads/shared.pm will always be
21800 # there, croaking informatively ("you need to rebuild
21801 # all of Perl with threads, sorry") when threads haven't
21802 # been compiled in.
21804 avail_ext="$avail_ext $xxx"
21810 cygwin) avail_ext="$avail_ext $xxx" ;;
21813 XS/APItest|xs/apitest)
21814 # This is just for testing. Skip it unless we have dynamic loading.
21817 $define) avail_ext="$avail_ext $xxx" ;;
21820 XS/Typemap|xs/typemap)
21821 # This is just for testing. Skip it unless we have dynamic loading.
21823 $define) avail_ext="$avail_ext $xxx" ;;
21826 *) avail_ext="$avail_ext $xxx"
21835 case "$onlyextensions" in
21837 *) keepextensions=''
21838 echo "You have requested that only certains extensions be included..." >&4
21839 for i in $onlyextensions; do
21840 case " $avail_ext " in
21842 echo "Keeping extension $i."
21843 keepextensions="$keepextensions $i"
21845 *) echo "Ignoring extension $i." ;;
21848 avail_ext="$keepextensions"
21852 case "$noextensions" in
21854 *) keepextensions=''
21855 echo "You have requested that certain extensions be ignored..." >&4
21856 for i in $avail_ext; do
21857 case " $noextensions " in
21858 *" $i "*) echo "Ignoring extension $i." ;;
21859 *) echo "Keeping extension $i.";
21860 keepextensions="$keepextensions $i"
21864 avail_ext="$keepextensions"
21868 : Now see which nonxs extensions are supported on this system.
21869 : For now assume all are.
21871 for xxx in $nonxs_extensions ; do
21873 *) nonxs_ext="$nonxs_ext $xxx"
21885 A number of extensions are supplied with $package. You may choose to
21886 compile these extensions for dynamic loading (the default), compile
21887 them into the $package executable (static loading), or not include
21888 them at all. Answer "none" to include no extensions.
21889 Note that DynaLoader is always built and need not be mentioned here.
21892 case "$dynamic_ext" in
21894 : Exclude those listed in static_ext
21896 for xxx in $avail_ext; do
21897 case " $static_ext " in
21899 *) dflt="$dflt $xxx" ;;
21906 *) dflt="$dynamic_ext"
21907 # Perhaps we are reusing an old out-of-date config.sh.
21910 if test X"$dynamic_ext" != X"$avail_ext"; then
21912 NOTICE: Your previous config.sh list may be incorrect.
21913 The extensions now available to you are
21915 but the default list from your previous config.sh is
21927 rp="What extensions do you wish to load dynamically?"
21930 none) dynamic_ext=' ' ;;
21931 *) dynamic_ext="$ans" ;;
21934 case "$static_ext" in
21936 : Exclude those already listed in dynamic linking
21938 for xxx in $avail_ext; do
21939 case " $dynamic_ext " in
21941 *) dflt="$dflt $xxx" ;;
21948 *) dflt="$static_ext"
21955 rp="What extensions do you wish to load statically?"
21958 none) static_ext=' ' ;;
21959 *) static_ext="$ans" ;;
21964 A number of extensions are supplied with $package. Answer "none"
21965 to include no extensions.
21966 Note that DynaLoader is always built and need not be mentioned here.
21969 case "$static_ext" in
21970 '') dflt="$avail_ext" ;;
21971 *) dflt="$static_ext"
21972 # Perhaps we are reusing an old out-of-date config.sh.
21975 if test X"$static_ext" != X"$avail_ext"; then
21977 NOTICE: Your previous config.sh list may be incorrect.
21978 The extensions now available to you are
21980 but the default list from your previous config.sh is
21989 : Exclude those that are not xs extensions
21993 rp="What extensions do you wish to include?"
21996 none) static_ext=' ' ;;
21997 *) static_ext="$ans" ;;
22002 # Encode is a special case. If we are building Encode as a static
22003 # extension, we need to explicitly list its subextensions as well.
22004 # For other nested extensions, this is handled automatically by
22005 # the appropriate Makefile.PL.
22006 case " $static_ext " in
22007 *" Encode "*) # Add the subextensions of Encode
22009 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
22010 static_ext="$static_ext Encode/$xxx"
22016 set X $dynamic_ext $static_ext $nonxs_ext
22020 # Sanity check: We require an extension suitable for use with
22021 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
22022 # should show up as failures in the test suite, but it's helpful to
22023 # catch them now.) The 'extensions' list is normally sorted
22024 # alphabetically, so we need to accept either
22025 # DB_File ... Fcntl ... IO ....
22026 # or something like
22027 # Fcntl ... NDBM_File ... IO ....
22028 case " $extensions" in
22029 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
22030 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
22031 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
22032 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
22033 echo "WARNING: The Perl you are building will be quite crippled." >& 4
22037 : Remove libraries needed only for extensions
22038 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
22039 : The exception is SunOS 4.x, which needs them.
22040 case "${osname}X${osvers}" in
22044 *) case "$usedl" in
22045 $define|true|[yY]*)
22046 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
22050 *) perllibs="$libs"
22056 : Remove build directory name from cppstdin so it can be used from
22057 : either the present location or the final installed location.
22059 : Get out of the UU directory to get correct path name.
22061 case "$cppstdin" in
22063 echo "Stripping down cppstdin path name"
22069 : end of configuration questions
22071 echo "End of configuration questions."
22074 : back to where it started
22075 if test -d ../UU; then
22079 : configuration may be unconditionally patched via a 'config.arch' file
22080 if $test -f config.arch; then
22081 echo "I see a config.arch file, loading it." >&4
22085 : configuration may be patched via a 'config.over' file
22086 if $test -f config.over; then
22089 rp='I see a config.over file. Do you wish to load it?'
22092 n*) echo "OK, I'll ignore it.";;
22094 echo "Configuration override changes have been loaded."
22099 : in case they want portability, strip down executable paths
22100 case "$d_portable" in
22103 echo "Stripping down executable paths..." >&4
22104 for file in $loclist $trylist; do
22106 eval $file=`basename $temp`
22111 : create config.sh file
22113 echo "Creating config.sh..." >&4
22114 $spitshell <<EOT >config.sh
22117 # This file was produced by running the Configure script. It holds all the
22118 # definitions figured out by Configure. Should you modify one of these values,
22119 # do not forget to propagate your changes by running "Configure -der". You may
22120 # instead choose to run each of the .SH files by yourself, or "Configure -S".
22123 # Package name : $package
22124 # Source directory : $src
22125 # Configuration time: $cf_time
22126 # Configured by : $cf_by
22127 # Target system : $myuname
22130 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
22131 $spitshell <<EOT >>config.sh
22140 Revision='$Revision'
22148 alignbytes='$alignbytes'
22149 ansi2knr='$ansi2knr'
22150 aphostname='$aphostname'
22151 api_revision='$api_revision'
22152 api_subversion='$api_subversion'
22153 api_version='$api_version'
22154 api_versionstring='$api_versionstring'
22157 archlibexp='$archlibexp'
22158 archname64='$archname64'
22159 archname='$archname'
22160 archobjs='$archobjs'
22161 asctime_r_proto='$asctime_r_proto'
22170 byteorder='$byteorder'
22172 castflags='$castflags'
22175 cccdlflags='$cccdlflags'
22176 ccdlflags='$ccdlflags'
22178 ccflags_uselargefiles='$ccflags_uselargefiles'
22180 ccsymbols='$ccsymbols'
22181 ccversion='$ccversion'
22183 cf_email='$cf_email'
22188 clocktype='$clocktype'
22190 compress='$compress'
22191 contains='$contains'
22195 cpp_stuff='$cpp_stuff'
22196 cppccsymbols='$cppccsymbols'
22197 cppflags='$cppflags'
22199 cppminus='$cppminus'
22201 cppstdin='$cppstdin'
22202 cppsymbols='$cppsymbols'
22203 crypt_r_proto='$crypt_r_proto'
22204 cryptlib='$cryptlib'
22206 ctermid_r_proto='$ctermid_r_proto'
22207 ctime_r_proto='$ctime_r_proto'
22208 d_Gconvert='$d_Gconvert'
22209 d_PRIEUldbl='$d_PRIEUldbl'
22210 d_PRIFUldbl='$d_PRIFUldbl'
22211 d_PRIGUldbl='$d_PRIGUldbl'
22212 d_PRIXU64='$d_PRIXU64'
22213 d_PRId64='$d_PRId64'
22214 d_PRIeldbl='$d_PRIeldbl'
22215 d_PRIfldbl='$d_PRIfldbl'
22216 d_PRIgldbl='$d_PRIgldbl'
22217 d_PRIi64='$d_PRIi64'
22218 d_PRIo64='$d_PRIo64'
22219 d_PRIu64='$d_PRIu64'
22220 d_PRIx64='$d_PRIx64'
22221 d_SCNfldbl='$d_SCNfldbl'
22222 d__fwalk='$d__fwalk'
22223 d_access='$d_access'
22224 d_accessx='$d_accessx'
22227 d_archlib='$d_archlib'
22228 d_asctime64='$d_asctime64'
22229 d_asctime_r='$d_asctime_r'
22232 d_attribute_deprecated='$d_attribute_deprecated'
22233 d_attribute_format='$d_attribute_format'
22234 d_attribute_malloc='$d_attribute_malloc'
22235 d_attribute_nonnull='$d_attribute_nonnull'
22236 d_attribute_noreturn='$d_attribute_noreturn'
22237 d_attribute_pure='$d_attribute_pure'
22238 d_attribute_unused='$d_attribute_unused'
22239 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
22243 d_bsdgetpgrp='$d_bsdgetpgrp'
22244 d_bsdsetpgrp='$d_bsdsetpgrp'
22245 d_builtin_choose_expr='$d_builtin_choose_expr'
22246 d_builtin_expect='$d_builtin_expect'
22248 d_c99_variadic_macros='$d_c99_variadic_macros'
22249 d_casti32='$d_casti32'
22250 d_castneg='$d_castneg'
22251 d_charvspr='$d_charvspr'
22253 d_chroot='$d_chroot'
22254 d_chsize='$d_chsize'
22256 d_clearenv='$d_clearenv'
22257 d_closedir='$d_closedir'
22258 d_cmsghdr_s='$d_cmsghdr_s'
22260 d_copysignl='$d_copysignl'
22261 d_cplusplus='$d_cplusplus'
22263 d_crypt_r='$d_crypt_r'
22265 d_ctermid='$d_ctermid'
22266 d_ctermid_r='$d_ctermid_r'
22267 d_ctime64='$d_ctime64'
22268 d_ctime_r='$d_ctime_r'
22269 d_cuserid='$d_cuserid'
22270 d_dbl_dig='$d_dbl_dig'
22271 d_dbminitproto='$d_dbminitproto'
22272 d_difftime64='$d_difftime64'
22273 d_difftime='$d_difftime'
22274 d_dir_dd_fd='$d_dir_dd_fd'
22276 d_dirnamlen='$d_dirnamlen'
22277 d_dlerror='$d_dlerror'
22278 d_dlopen='$d_dlopen'
22279 d_dlsymun='$d_dlsymun'
22280 d_dosuid='$d_dosuid'
22281 d_drand48_r='$d_drand48_r'
22282 d_drand48proto='$d_drand48proto'
22284 d_eaccess='$d_eaccess'
22285 d_endgrent='$d_endgrent'
22286 d_endgrent_r='$d_endgrent_r'
22287 d_endhent='$d_endhent'
22288 d_endhostent_r='$d_endhostent_r'
22289 d_endnent='$d_endnent'
22290 d_endnetent_r='$d_endnetent_r'
22291 d_endpent='$d_endpent'
22292 d_endprotoent_r='$d_endprotoent_r'
22293 d_endpwent='$d_endpwent'
22294 d_endpwent_r='$d_endpwent_r'
22295 d_endsent='$d_endsent'
22296 d_endservent_r='$d_endservent_r'
22297 d_eofnblk='$d_eofnblk'
22298 d_eunice='$d_eunice'
22299 d_faststdio='$d_faststdio'
22300 d_fchdir='$d_fchdir'
22301 d_fchmod='$d_fchmod'
22302 d_fchown='$d_fchown'
22304 d_fcntl_can_lock='$d_fcntl_can_lock'
22305 d_fd_macros='$d_fd_macros'
22306 d_fd_set='$d_fd_set'
22307 d_fds_bits='$d_fds_bits'
22308 d_fgetpos='$d_fgetpos'
22309 d_finite='$d_finite'
22310 d_finitel='$d_finitel'
22311 d_flexfnam='$d_flexfnam'
22313 d_flockproto='$d_flockproto'
22315 d_fp_class='$d_fp_class'
22316 d_fpathconf='$d_fpathconf'
22317 d_fpclass='$d_fpclass'
22318 d_fpclassify='$d_fpclassify'
22319 d_fpclassl='$d_fpclassl'
22320 d_fpos64_t='$d_fpos64_t'
22321 d_frexpl='$d_frexpl'
22322 d_fs_data_s='$d_fs_data_s'
22323 d_fseeko='$d_fseeko'
22324 d_fsetpos='$d_fsetpos'
22325 d_fstatfs='$d_fstatfs'
22326 d_fstatvfs='$d_fstatvfs'
22328 d_ftello='$d_ftello'
22330 d_futimes='$d_futimes'
22331 d_gdbm_ndbm_h_uses_prototypes='$d_gdbm_ndbm_h_uses_prototypes'
22332 d_gdbmndbm_h_uses_prototypes='$d_gdbmndbm_h_uses_prototypes'
22333 d_getaddrinfo='$d_getaddrinfo'
22334 d_getcwd='$d_getcwd'
22335 d_getespwnam='$d_getespwnam'
22336 d_getfsstat='$d_getfsstat'
22337 d_getgrent='$d_getgrent'
22338 d_getgrent_r='$d_getgrent_r'
22339 d_getgrgid_r='$d_getgrgid_r'
22340 d_getgrnam_r='$d_getgrnam_r'
22341 d_getgrps='$d_getgrps'
22342 d_gethbyaddr='$d_gethbyaddr'
22343 d_gethbyname='$d_gethbyname'
22344 d_gethent='$d_gethent'
22345 d_gethname='$d_gethname'
22346 d_gethostbyaddr_r='$d_gethostbyaddr_r'
22347 d_gethostbyname_r='$d_gethostbyname_r'
22348 d_gethostent_r='$d_gethostent_r'
22349 d_gethostprotos='$d_gethostprotos'
22350 d_getitimer='$d_getitimer'
22351 d_getlogin='$d_getlogin'
22352 d_getlogin_r='$d_getlogin_r'
22353 d_getmnt='$d_getmnt'
22354 d_getmntent='$d_getmntent'
22355 d_getnameinfo='$d_getnameinfo'
22356 d_getnbyaddr='$d_getnbyaddr'
22357 d_getnbyname='$d_getnbyname'
22358 d_getnent='$d_getnent'
22359 d_getnetbyaddr_r='$d_getnetbyaddr_r'
22360 d_getnetbyname_r='$d_getnetbyname_r'
22361 d_getnetent_r='$d_getnetent_r'
22362 d_getnetprotos='$d_getnetprotos'
22363 d_getpagsz='$d_getpagsz'
22364 d_getpbyname='$d_getpbyname'
22365 d_getpbynumber='$d_getpbynumber'
22366 d_getpent='$d_getpent'
22367 d_getpgid='$d_getpgid'
22368 d_getpgrp2='$d_getpgrp2'
22369 d_getpgrp='$d_getpgrp'
22370 d_getppid='$d_getppid'
22371 d_getprior='$d_getprior'
22372 d_getprotobyname_r='$d_getprotobyname_r'
22373 d_getprotobynumber_r='$d_getprotobynumber_r'
22374 d_getprotoent_r='$d_getprotoent_r'
22375 d_getprotoprotos='$d_getprotoprotos'
22376 d_getprpwnam='$d_getprpwnam'
22377 d_getpwent='$d_getpwent'
22378 d_getpwent_r='$d_getpwent_r'
22379 d_getpwnam_r='$d_getpwnam_r'
22380 d_getpwuid_r='$d_getpwuid_r'
22381 d_getsbyname='$d_getsbyname'
22382 d_getsbyport='$d_getsbyport'
22383 d_getsent='$d_getsent'
22384 d_getservbyname_r='$d_getservbyname_r'
22385 d_getservbyport_r='$d_getservbyport_r'
22386 d_getservent_r='$d_getservent_r'
22387 d_getservprotos='$d_getservprotos'
22388 d_getspnam='$d_getspnam'
22389 d_getspnam_r='$d_getspnam_r'
22390 d_gettimeod='$d_gettimeod'
22391 d_gmtime64='$d_gmtime64'
22392 d_gmtime_r='$d_gmtime_r'
22393 d_gnulibc='$d_gnulibc'
22394 d_grpasswd='$d_grpasswd'
22395 d_hasmntopt='$d_hasmntopt'
22397 d_ilogbl='$d_ilogbl'
22398 d_inc_version_list='$d_inc_version_list'
22400 d_inetaton='$d_inetaton'
22401 d_inetntop='$d_inetntop'
22402 d_inetpton='$d_inetpton'
22403 d_int64_t='$d_int64_t'
22404 d_isascii='$d_isascii'
22405 d_isfinite='$d_isfinite'
22408 d_isnanl='$d_isnanl'
22409 d_killpg='$d_killpg'
22410 d_lchown='$d_lchown'
22411 d_ldbl_dig='$d_ldbl_dig'
22412 d_libm_lib_version='$d_libm_lib_version'
22414 d_localtime64='$d_localtime64'
22415 d_localtime_r='$d_localtime_r'
22416 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
22417 d_locconv='$d_locconv'
22419 d_longdbl='$d_longdbl'
22420 d_longlong='$d_longlong'
22421 d_lseekproto='$d_lseekproto'
22423 d_madvise='$d_madvise'
22424 d_malloc_good_size='$d_malloc_good_size'
22425 d_malloc_size='$d_malloc_size'
22427 d_mbstowcs='$d_mbstowcs'
22428 d_mbtowc='$d_mbtowc'
22429 d_memchr='$d_memchr'
22430 d_memcmp='$d_memcmp'
22431 d_memcpy='$d_memcpy'
22432 d_memmove='$d_memmove'
22433 d_memset='$d_memset'
22435 d_mkdtemp='$d_mkdtemp'
22436 d_mkfifo='$d_mkfifo'
22437 d_mkstemp='$d_mkstemp'
22438 d_mkstemps='$d_mkstemps'
22439 d_mktime64='$d_mktime64'
22440 d_mktime='$d_mktime'
22443 d_modfl_pow32_bug='$d_modfl_pow32_bug'
22444 d_modflproto='$d_modflproto'
22445 d_mprotect='$d_mprotect'
22447 d_msg_ctrunc='$d_msg_ctrunc'
22448 d_msg_dontroute='$d_msg_dontroute'
22449 d_msg_oob='$d_msg_oob'
22450 d_msg_peek='$d_msg_peek'
22451 d_msg_proxy='$d_msg_proxy'
22452 d_msgctl='$d_msgctl'
22453 d_msgget='$d_msgget'
22454 d_msghdr_s='$d_msghdr_s'
22455 d_msgrcv='$d_msgrcv'
22456 d_msgsnd='$d_msgsnd'
22458 d_munmap='$d_munmap'
22459 d_mymalloc='$d_mymalloc'
22461 d_ndbm_h_uses_prototypes='$d_ndbm_h_uses_prototypes'
22463 d_nl_langinfo='$d_nl_langinfo'
22464 d_nv_preserves_uv='$d_nv_preserves_uv'
22465 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
22466 d_off64_t='$d_off64_t'
22467 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
22468 d_oldpthreads='$d_oldpthreads'
22469 d_oldsock='$d_oldsock'
22471 d_pathconf='$d_pathconf'
22473 d_perl_otherlibdirs='$d_perl_otherlibdirs'
22474 d_phostname='$d_phostname'
22477 d_portable='$d_portable'
22478 d_printf_format_null='$d_printf_format_null'
22479 d_procselfexe='$d_procselfexe'
22480 d_pseudofork='$d_pseudofork'
22481 d_pthread_atfork='$d_pthread_atfork'
22482 d_pthread_attr_setscope='$d_pthread_attr_setscope'
22483 d_pthread_yield='$d_pthread_yield'
22485 d_pwchange='$d_pwchange'
22486 d_pwclass='$d_pwclass'
22487 d_pwcomment='$d_pwcomment'
22488 d_pwexpire='$d_pwexpire'
22489 d_pwgecos='$d_pwgecos'
22490 d_pwpasswd='$d_pwpasswd'
22491 d_pwquota='$d_pwquota'
22494 d_random_r='$d_random_r'
22495 d_readdir64_r='$d_readdir64_r'
22496 d_readdir='$d_readdir'
22497 d_readdir_r='$d_readdir_r'
22498 d_readlink='$d_readlink'
22500 d_recvmsg='$d_recvmsg'
22501 d_rename='$d_rename'
22502 d_rewinddir='$d_rewinddir'
22504 d_safebcpy='$d_safebcpy'
22505 d_safemcpy='$d_safemcpy'
22506 d_sanemcmp='$d_sanemcmp'
22507 d_sbrkproto='$d_sbrkproto'
22508 d_scalbnl='$d_scalbnl'
22509 d_sched_yield='$d_sched_yield'
22510 d_scm_rights='$d_scm_rights'
22511 d_seekdir='$d_seekdir'
22512 d_select='$d_select'
22514 d_semctl='$d_semctl'
22515 d_semctl_semid_ds='$d_semctl_semid_ds'
22516 d_semctl_semun='$d_semctl_semun'
22517 d_semget='$d_semget'
22519 d_sendmsg='$d_sendmsg'
22520 d_setegid='$d_setegid'
22521 d_seteuid='$d_seteuid'
22522 d_setgrent='$d_setgrent'
22523 d_setgrent_r='$d_setgrent_r'
22524 d_setgrps='$d_setgrps'
22525 d_sethent='$d_sethent'
22526 d_sethostent_r='$d_sethostent_r'
22527 d_setitimer='$d_setitimer'
22528 d_setlinebuf='$d_setlinebuf'
22529 d_setlocale='$d_setlocale'
22530 d_setlocale_r='$d_setlocale_r'
22531 d_setnent='$d_setnent'
22532 d_setnetent_r='$d_setnetent_r'
22533 d_setpent='$d_setpent'
22534 d_setpgid='$d_setpgid'
22535 d_setpgrp2='$d_setpgrp2'
22536 d_setpgrp='$d_setpgrp'
22537 d_setprior='$d_setprior'
22538 d_setproctitle='$d_setproctitle'
22539 d_setprotoent_r='$d_setprotoent_r'
22540 d_setpwent='$d_setpwent'
22541 d_setpwent_r='$d_setpwent_r'
22542 d_setregid='$d_setregid'
22543 d_setresgid='$d_setresgid'
22544 d_setresuid='$d_setresuid'
22545 d_setreuid='$d_setreuid'
22546 d_setrgid='$d_setrgid'
22547 d_setruid='$d_setruid'
22548 d_setsent='$d_setsent'
22549 d_setservent_r='$d_setservent_r'
22550 d_setsid='$d_setsid'
22551 d_setvbuf='$d_setvbuf'
22555 d_shmatprototype='$d_shmatprototype'
22556 d_shmctl='$d_shmctl'
22558 d_shmget='$d_shmget'
22559 d_sigaction='$d_sigaction'
22560 d_signbit='$d_signbit'
22561 d_sigprocmask='$d_sigprocmask'
22562 d_sigsetjmp='$d_sigsetjmp'
22563 d_sitearch='$d_sitearch'
22564 d_snprintf='$d_snprintf'
22565 d_sockatmark='$d_sockatmark'
22566 d_sockatmarkproto='$d_sockatmarkproto'
22567 d_socket='$d_socket'
22568 d_socklen_t='$d_socklen_t'
22569 d_sockpair='$d_sockpair'
22570 d_socks5_init='$d_socks5_init'
22571 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
22573 d_srand48_r='$d_srand48_r'
22574 d_srandom_r='$d_srandom_r'
22575 d_sresgproto='$d_sresgproto'
22576 d_sresuproto='$d_sresuproto'
22577 d_statblks='$d_statblks'
22578 d_statfs_f_flags='$d_statfs_f_flags'
22579 d_statfs_s='$d_statfs_s'
22580 d_statvfs='$d_statvfs'
22581 d_stdio_cnt_lval='$d_stdio_cnt_lval'
22582 d_stdio_ptr_lval='$d_stdio_ptr_lval'
22583 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
22584 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
22585 d_stdio_stream_array='$d_stdio_stream_array'
22586 d_stdiobase='$d_stdiobase'
22587 d_stdstdio='$d_stdstdio'
22588 d_strchr='$d_strchr'
22589 d_strcoll='$d_strcoll'
22590 d_strctcpy='$d_strctcpy'
22591 d_strerrm='$d_strerrm'
22592 d_strerror='$d_strerror'
22593 d_strerror_r='$d_strerror_r'
22594 d_strftime='$d_strftime'
22595 d_strlcat='$d_strlcat'
22596 d_strlcpy='$d_strlcpy'
22597 d_strtod='$d_strtod'
22598 d_strtol='$d_strtol'
22599 d_strtold='$d_strtold'
22600 d_strtoll='$d_strtoll'
22601 d_strtoq='$d_strtoq'
22602 d_strtoul='$d_strtoul'
22603 d_strtoull='$d_strtoull'
22604 d_strtouq='$d_strtouq'
22605 d_strxfrm='$d_strxfrm'
22606 d_suidsafe='$d_suidsafe'
22607 d_symlink='$d_symlink'
22608 d_syscall='$d_syscall'
22609 d_syscallproto='$d_syscallproto'
22610 d_sysconf='$d_sysconf'
22611 d_sysernlst='$d_sysernlst'
22612 d_syserrlst='$d_syserrlst'
22613 d_system='$d_system'
22614 d_tcgetpgrp='$d_tcgetpgrp'
22615 d_tcsetpgrp='$d_tcsetpgrp'
22616 d_telldir='$d_telldir'
22617 d_telldirproto='$d_telldirproto'
22619 d_timegm='$d_timegm'
22621 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
22622 d_tm_tm_zone='$d_tm_tm_zone'
22623 d_tmpnam_r='$d_tmpnam_r'
22624 d_truncate='$d_truncate'
22625 d_ttyname_r='$d_ttyname_r'
22626 d_tzname='$d_tzname'
22627 d_u32align='$d_u32align'
22628 d_ualarm='$d_ualarm'
22631 d_union_semun='$d_union_semun'
22632 d_unordered='$d_unordered'
22633 d_unsetenv='$d_unsetenv'
22634 d_usleep='$d_usleep'
22635 d_usleepproto='$d_usleepproto'
22637 d_vendorarch='$d_vendorarch'
22638 d_vendorbin='$d_vendorbin'
22639 d_vendorlib='$d_vendorlib'
22640 d_vendorscript='$d_vendorscript'
22642 d_void_closedir='$d_void_closedir'
22643 d_voidsig='$d_voidsig'
22644 d_voidtty='$d_voidtty'
22645 d_volatile='$d_volatile'
22646 d_vprintf='$d_vprintf'
22647 d_vsnprintf='$d_vsnprintf'
22649 d_waitpid='$d_waitpid'
22650 d_wcstombs='$d_wcstombs'
22651 d_wctomb='$d_wctomb'
22652 d_writev='$d_writev'
22655 db_hashtype='$db_hashtype'
22656 db_prefixtype='$db_prefixtype'
22657 db_version_major='$db_version_major'
22658 db_version_minor='$db_version_minor'
22659 db_version_patch='$db_version_patch'
22660 defvoidused='$defvoidused'
22661 direntrytype='$direntrytype'
22664 doublesize='$doublesize'
22666 drand48_r_proto='$drand48_r_proto'
22668 dynamic_ext='$dynamic_ext'
22674 endgrent_r_proto='$endgrent_r_proto'
22675 endhostent_r_proto='$endhostent_r_proto'
22676 endnetent_r_proto='$endnetent_r_proto'
22677 endprotoent_r_proto='$endprotoent_r_proto'
22678 endpwent_r_proto='$endpwent_r_proto'
22679 endservent_r_proto='$endservent_r_proto'
22680 eunicefix='$eunicefix'
22683 extensions='$extensions'
22684 extern_C='$extern_C'
22686 fflushNULL='$fflushNULL'
22687 fflushall='$fflushall'
22689 firstmakefile='$firstmakefile'
22691 fpossize='$fpossize'
22692 fpostype='$fpostype'
22693 freetype='$freetype'
22696 full_csh='$full_csh'
22697 full_sed='$full_sed'
22698 gccansipedantic='$gccansipedantic'
22699 gccosandvers='$gccosandvers'
22700 gccversion='$gccversion'
22701 getgrent_r_proto='$getgrent_r_proto'
22702 getgrgid_r_proto='$getgrgid_r_proto'
22703 getgrnam_r_proto='$getgrnam_r_proto'
22704 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
22705 gethostbyname_r_proto='$gethostbyname_r_proto'
22706 gethostent_r_proto='$gethostent_r_proto'
22707 getlogin_r_proto='$getlogin_r_proto'
22708 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
22709 getnetbyname_r_proto='$getnetbyname_r_proto'
22710 getnetent_r_proto='$getnetent_r_proto'
22711 getprotobyname_r_proto='$getprotobyname_r_proto'
22712 getprotobynumber_r_proto='$getprotobynumber_r_proto'
22713 getprotoent_r_proto='$getprotoent_r_proto'
22714 getpwent_r_proto='$getpwent_r_proto'
22715 getpwnam_r_proto='$getpwnam_r_proto'
22716 getpwuid_r_proto='$getpwuid_r_proto'
22717 getservbyname_r_proto='$getservbyname_r_proto'
22718 getservbyport_r_proto='$getservbyport_r_proto'
22719 getservent_r_proto='$getservent_r_proto'
22720 getspnam_r_proto='$getspnam_r_proto'
22721 gidformat='$gidformat'
22727 gmtime_r_proto='$gmtime_r_proto'
22728 gnulibc_version='$gnulibc_version'
22730 groupcat='$groupcat'
22731 groupstype='$groupstype'
22734 h_sysfile='$h_sysfile'
22737 html1dir='$html1dir'
22738 html1direxp='$html1direxp'
22739 html3dir='$html3dir'
22740 html3direxp='$html3direxp'
22749 i_arpainet='$i_arpainet'
22750 i_assert='$i_assert'
22751 i_bsdioctl='$i_bsdioctl'
22755 i_dirent='$i_dirent'
22761 i_fp_class='$i_fp_class'
22763 i_gdbm_ndbm='$i_gdbm_ndbm'
22764 i_gdbmndbm='$i_gdbmndbm'
22766 i_ieeefp='$i_ieeefp'
22767 i_inttypes='$i_inttypes'
22768 i_langinfo='$i_langinfo'
22769 i_libutil='$i_libutil'
22770 i_limits='$i_limits'
22771 i_locale='$i_locale'
22772 i_machcthr='$i_machcthr'
22773 i_malloc='$i_malloc'
22774 i_mallocmalloc='$i_mallocmalloc'
22776 i_memory='$i_memory'
22777 i_mntent='$i_mntent'
22780 i_neterrno='$i_neterrno'
22781 i_netinettcp='$i_netinettcp'
22785 i_pthread='$i_pthread'
22787 i_rpcsvcdbm='$i_rpcsvcdbm'
22790 i_shadow='$i_shadow'
22792 i_stdarg='$i_stdarg'
22793 i_stddef='$i_stddef'
22794 i_stdlib='$i_stdlib'
22795 i_string='$i_string'
22796 i_sunmath='$i_sunmath'
22797 i_sysaccess='$i_sysaccess'
22798 i_sysdir='$i_sysdir'
22799 i_sysfile='$i_sysfile'
22800 i_sysfilio='$i_sysfilio'
22802 i_sysioctl='$i_sysioctl'
22803 i_syslog='$i_syslog'
22804 i_sysmman='$i_sysmman'
22805 i_sysmode='$i_sysmode'
22806 i_sysmount='$i_sysmount'
22807 i_sysndir='$i_sysndir'
22808 i_sysparam='$i_sysparam'
22809 i_syspoll='$i_syspoll'
22810 i_sysresrc='$i_sysresrc'
22811 i_syssecrt='$i_syssecrt'
22812 i_sysselct='$i_sysselct'
22813 i_syssockio='$i_syssockio'
22814 i_sysstat='$i_sysstat'
22815 i_sysstatfs='$i_sysstatfs'
22816 i_sysstatvfs='$i_sysstatvfs'
22817 i_systime='$i_systime'
22818 i_systimek='$i_systimek'
22819 i_systimes='$i_systimes'
22820 i_systypes='$i_systypes'
22821 i_sysuio='$i_sysuio'
22823 i_sysutsname='$i_sysutsname'
22824 i_sysvfs='$i_sysvfs'
22825 i_syswait='$i_syswait'
22826 i_termio='$i_termio'
22827 i_termios='$i_termios'
22829 i_unistd='$i_unistd'
22832 i_values='$i_values'
22833 i_varargs='$i_varargs'
22834 i_varhdr='$i_varhdr'
22836 ignore_versioned_solibs='$ignore_versioned_solibs'
22837 inc_version_list='$inc_version_list'
22838 inc_version_list_init='$inc_version_list_init'
22841 initialinstalllocation='$initialinstalllocation'
22842 installarchlib='$installarchlib'
22843 installbin='$installbin'
22844 installhtml1dir='$installhtml1dir'
22845 installhtml3dir='$installhtml3dir'
22846 installman1dir='$installman1dir'
22847 installman3dir='$installman3dir'
22848 installprefix='$installprefix'
22849 installprefixexp='$installprefixexp'
22850 installprivlib='$installprivlib'
22851 installscript='$installscript'
22852 installsitearch='$installsitearch'
22853 installsitebin='$installsitebin'
22854 installsitehtml1dir='$installsitehtml1dir'
22855 installsitehtml3dir='$installsitehtml3dir'
22856 installsitelib='$installsitelib'
22857 installsiteman1dir='$installsiteman1dir'
22858 installsiteman3dir='$installsiteman3dir'
22859 installsitescript='$installsitescript'
22860 installstyle='$installstyle'
22861 installusrbinperl='$installusrbinperl'
22862 installvendorarch='$installvendorarch'
22863 installvendorbin='$installvendorbin'
22864 installvendorhtml1dir='$installvendorhtml1dir'
22865 installvendorhtml3dir='$installvendorhtml3dir'
22866 installvendorlib='$installvendorlib'
22867 installvendorman1dir='$installvendorman1dir'
22868 installvendorman3dir='$installvendorman3dir'
22869 installvendorscript='$installvendorscript'
22871 issymlink='$issymlink'
22872 ivdformat='$ivdformat'
22875 known_extensions='$known_extensions'
22878 lddlflags='$lddlflags'
22880 ldflags_uselargefiles='$ldflags_uselargefiles'
22881 ldlibpthname='$ldlibpthname'
22888 libsdirs='$libsdirs'
22889 libsfiles='$libsfiles'
22890 libsfound='$libsfound'
22891 libspath='$libspath'
22892 libswanted='$libswanted'
22893 libswanted_uselargefiles='$libswanted_uselargefiles'
22899 localtime_r_proto='$localtime_r_proto'
22900 locincpth='$locincpth'
22901 loclibpth='$loclibpth'
22902 longdblsize='$longdblsize'
22903 longlongsize='$longlongsize'
22904 longsize='$longsize'
22908 lseeksize='$lseeksize'
22909 lseektype='$lseektype'
22912 madlyobj='$madlyobj'
22913 madlysrc='$madlysrc'
22917 make_set_make='$make_set_make'
22918 mallocobj='$mallocobj'
22919 mallocsrc='$mallocsrc'
22920 malloctype='$malloctype'
22922 man1direxp='$man1direxp'
22925 man3direxp='$man3direxp'
22927 mips_type='$mips_type'
22928 mistrustnm='$mistrustnm'
22930 mmaptype='$mmaptype'
22931 modetype='$modetype'
22933 multiarch='$multiarch'
22935 myarchname='$myarchname'
22936 mydomain='$mydomain'
22937 myhostname='$myhostname'
22940 need_va_copy='$need_va_copy'
22941 netdb_hlen_type='$netdb_hlen_type'
22942 netdb_host_type='$netdb_host_type'
22943 netdb_name_type='$netdb_name_type'
22944 netdb_net_type='$netdb_net_type'
22947 nm_so_opt='$nm_so_opt'
22948 nonxs_ext='$nonxs_ext'
22950 nvEUformat='$nvEUformat'
22951 nvFUformat='$nvFUformat'
22952 nvGUformat='$nvGUformat'
22953 nv_overflows_integers_at='$nv_overflows_integers_at'
22954 nv_preserves_uv_bits='$nv_preserves_uv_bits'
22955 nveformat='$nveformat'
22956 nvfformat='$nvfformat'
22957 nvgformat='$nvgformat'
22960 o_nonblock='$o_nonblock'
22962 old_pthread_create_joinable='$old_pthread_create_joinable'
22963 optimize='$optimize'
22964 orderlib='$orderlib'
22967 otherlibdirs='$otherlibdirs'
22971 patchlevel='$patchlevel'
22972 path_sep='$path_sep'
22975 perl_patchlevel='$perl_patchlevel'
22976 perladmin='$perladmin'
22977 perllibs='$perllibs'
22978 perlpath='$perlpath'
22980 phostname='$phostname'
22986 prefixexp='$prefixexp'
22988 privlibexp='$privlibexp'
22989 procselfexe='$procselfexe'
22990 prototype='$prototype'
22992 quadkind='$quadkind'
22993 quadtype='$quadtype'
22994 randbits='$randbits'
22995 randfunc='$randfunc'
22996 random_r_proto='$random_r_proto'
22997 randseedtype='$randseedtype'
22999 rd_nodata='$rd_nodata'
23000 readdir64_r_proto='$readdir64_r_proto'
23001 readdir_r_proto='$readdir_r_proto'
23002 revision='$revision'
23008 sGMTIME_max='$sGMTIME_max'
23009 sGMTIME_min='$sGMTIME_min'
23010 sLOCALTIME_max='$sLOCALTIME_max'
23011 sLOCALTIME_min='$sLOCALTIME_min'
23012 sPRIEUldbl='$sPRIEUldbl'
23013 sPRIFUldbl='$sPRIFUldbl'
23014 sPRIGUldbl='$sPRIGUldbl'
23015 sPRIXU64='$sPRIXU64'
23017 sPRIeldbl='$sPRIeldbl'
23018 sPRIfldbl='$sPRIfldbl'
23019 sPRIgldbl='$sPRIgldbl'
23024 sSCNfldbl='$sSCNfldbl'
23025 sched_yield='$sched_yield'
23026 scriptdir='$scriptdir'
23027 scriptdirexp='$scriptdirexp'
23029 seedfunc='$seedfunc'
23030 selectminbits='$selectminbits'
23031 selecttype='$selecttype'
23032 sendmail='$sendmail'
23033 setgrent_r_proto='$setgrent_r_proto'
23034 sethostent_r_proto='$sethostent_r_proto'
23035 setlocale_r_proto='$setlocale_r_proto'
23036 setnetent_r_proto='$setnetent_r_proto'
23037 setprotoent_r_proto='$setprotoent_r_proto'
23038 setpwent_r_proto='$setpwent_r_proto'
23039 setservent_r_proto='$setservent_r_proto'
23042 sharpbang='$sharpbang'
23043 shmattype='$shmattype'
23044 shortsize='$shortsize'
23047 sig_count='$sig_count'
23048 sig_name='$sig_name'
23049 sig_name_init='$sig_name_init'
23051 sig_num_init='$sig_num_init'
23052 sig_size='$sig_size'
23053 signal_t='$signal_t'
23054 sitearch='$sitearch'
23055 sitearchexp='$sitearchexp'
23057 sitebinexp='$sitebinexp'
23058 sitehtml1dir='$sitehtml1dir'
23059 sitehtml1direxp='$sitehtml1direxp'
23060 sitehtml3dir='$sitehtml3dir'
23061 sitehtml3direxp='$sitehtml3direxp'
23063 sitelib_stem='$sitelib_stem'
23064 sitelibexp='$sitelibexp'
23065 siteman1dir='$siteman1dir'
23066 siteman1direxp='$siteman1direxp'
23067 siteman3dir='$siteman3dir'
23068 siteman3direxp='$siteman3direxp'
23069 siteprefix='$siteprefix'
23070 siteprefixexp='$siteprefixexp'
23071 sitescript='$sitescript'
23072 sitescriptexp='$sitescriptexp'
23073 sizesize='$sizesize'
23074 sizetype='$sizetype'
23078 sockethdr='$sockethdr'
23079 socketlib='$socketlib'
23080 socksizetype='$socksizetype'
23082 spackage='$spackage'
23083 spitshell='$spitshell'
23084 srand48_r_proto='$srand48_r_proto'
23085 srandom_r_proto='$srandom_r_proto'
23087 ssizetype='$ssizetype'
23088 startperl='$startperl'
23090 static_ext='$static_ext'
23092 stdio_base='$stdio_base'
23093 stdio_bufsiz='$stdio_bufsiz'
23094 stdio_cnt='$stdio_cnt'
23095 stdio_filbuf='$stdio_filbuf'
23096 stdio_ptr='$stdio_ptr'
23097 stdio_stream_array='$stdio_stream_array'
23098 strerror_r_proto='$strerror_r_proto'
23101 subversion='$subversion'
23105 targetarch='$targetarch'
23109 timeincl='$timeincl'
23110 timetype='$timetype'
23111 tmpnam_r_proto='$tmpnam_r_proto'
23117 ttyname_r_proto='$ttyname_r_proto'
23126 uidformat='$uidformat'
23132 uquadtype='$uquadtype'
23133 use5005threads='$use5005threads'
23134 use64bitall='$use64bitall'
23135 use64bitint='$use64bitint'
23136 usecrosscompile='$usecrosscompile'
23137 usedevel='$usedevel'
23139 usedtrace='$usedtrace'
23140 usefaststdio='$usefaststdio'
23141 useithreads='$useithreads'
23142 uselargefiles='$uselargefiles'
23143 uselongdouble='$uselongdouble'
23144 usemallocwrap='$usemallocwrap'
23145 usemorebits='$usemorebits'
23146 usemultiplicity='$usemultiplicity'
23147 usemymalloc='$usemymalloc'
23149 useopcode='$useopcode'
23150 useperlio='$useperlio'
23151 useposix='$useposix'
23152 usereentrant='$usereentrant'
23153 userelocatableinc='$userelocatableinc'
23155 useshrplib='$useshrplib'
23156 usesitecustomize='$usesitecustomize'
23157 usesocks='$usesocks'
23158 usethreads='$usethreads'
23159 usevendorprefix='$usevendorprefix'
23160 usevfork='$usevfork'
23163 uvXUformat='$uvXUformat'
23164 uvoformat='$uvoformat'
23167 uvuformat='$uvuformat'
23168 uvxformat='$uvxformat'
23169 vendorarch='$vendorarch'
23170 vendorarchexp='$vendorarchexp'
23171 vendorbin='$vendorbin'
23172 vendorbinexp='$vendorbinexp'
23173 vendorhtml1dir='$vendorhtml1dir'
23174 vendorhtml1direxp='$vendorhtml1direxp'
23175 vendorhtml3dir='$vendorhtml3dir'
23176 vendorhtml3direxp='$vendorhtml3direxp'
23177 vendorlib='$vendorlib'
23178 vendorlib_stem='$vendorlib_stem'
23179 vendorlibexp='$vendorlibexp'
23180 vendorman1dir='$vendorman1dir'
23181 vendorman1direxp='$vendorman1direxp'
23182 vendorman3dir='$vendorman3dir'
23183 vendorman3direxp='$vendorman3direxp'
23184 vendorprefix='$vendorprefix'
23185 vendorprefixexp='$vendorprefixexp'
23186 vendorscript='$vendorscript'
23187 vendorscriptexp='$vendorscriptexp'
23189 version_patchlevel_string='$version_patchlevel_string'
23190 versiononly='$versiononly'
23192 voidflags='$voidflags'
23195 yaccflags='$yaccflags'
23200 : Add in command line options if available
23201 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
23203 : add special variables
23204 $test -f $src/patchlevel.h && \
23205 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
23206 echo "PERL_PATCHLEVEL='$perl_patchlevel'" >>config.sh
23207 echo "PERL_CONFIG_SH=true" >>config.sh
23209 : propagate old symbols
23210 if $test -f UU/config.sh; then
23211 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
23212 $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \
23213 config.sh config.sh UU/oldconfig.sh |\
23214 $sort | $uniq -u >UU/oldsyms
23215 set X `cat UU/oldsyms`
23221 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
23223 echo ": Variables propagated from previous config.sh file." >>config.sh
23224 for sym in `cat UU/oldsyms`; do
23225 echo " Propagating $hint variable "'$'"$sym..."
23226 eval 'tmp="$'"${sym}"'"'
23228 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
23234 : Finish up by extracting the .SH files
23238 echo "Extraction done."
23248 If you'd like to make any changes to the config.sh file before I begin
23249 to configure things, do it as a shell escape now (e.g. !vi config.sh).
23252 rp="Press return or use a shell escape to edit config.sh:"
23257 *) : in case they cannot read
23258 sh 1>&4 -c "$ans";;
23263 : if this fails, just run all the .SH files by hand
23272 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
23279 Now you need to generate make dependencies by running "$make depend".
23280 You might prefer to run it in background: "$make depend > makedepend.out &"
23281 It can take a while, so you might not want to run it right now.
23286 rp="Run $make depend now?"
23290 $make depend && echo "Now you must run '$make'."
23293 echo "You must run '$make depend' then '$make'."
23296 elif test -f [Mm]akefile; then
23298 echo "Now you must run a $make."
23300 echo "Configure done."
23303 if $test -f Policy.sh; then
23306 If you compile $package on a different machine or from a different object
23307 directory, copy the Policy.sh file from this object directory to the
23308 new one before you run Configure -- this will help you with most of
23309 the policy defaults.
23313 if $test -f config.msg; then
23314 echo "Hmm. I also noted the following information while running:"
23316 $cat config.msg >&4
23319 $rm -f kit*isdone ark*isdone