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 Tue Aug 18 19:22:01 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.*");
6533 ;@candidates = sort { $a->[1] cmp $b->[1]} @candidates;
6539 ($pversion, $aversion, $vsn5005) = map {
6540 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
6541 foreach $d (@candidates) {
6542 if ($d->[1] lt $pversion) {
6543 if ($d->[1] ge $aversion) {
6544 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
6546 elsif ($d->[1] ge $vsn5005) {
6547 unshift(@inc_version_list, grep { -d } $d->[0]);
6551 # Skip newer version. I.e. don't look in
6552 # 5.7.0 if we're installing 5.6.1.
6556 if (@inc_version_list) {
6557 print join(' ', @inc_version_list);
6560 # Blank space to preserve value for next Configure run.
6565 case "$inc_version_list" in
6566 '') if test -x "$perl5$exe_ext"; then
6567 dflt=`$perl5 getverlist`
6572 $undef) dflt='none' ;;
6573 *) eval dflt=\"$inc_version_list\" ;;
6576 ''|' ') dflt=none ;;
6583 In order to ease the process of upgrading, this version of perl
6584 can be configured to use modules built and installed with earlier
6585 versions of perl that were installed under $prefix. Specify here
6586 the list of earlier versions that this version of perl should check.
6587 If Configure detected no earlier versions of perl installed under
6588 $prefix, then the list will be empty. Answer 'none' to tell perl
6589 to not search earlier versions.
6591 The default should almost always be sensible, so if you're not sure,
6592 just accept the default.
6595 rp='List of earlier versions to include in @INC?'
6598 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
6599 *) inc_version_list="$ans" ;;
6601 case "$inc_version_list" in
6603 inc_version_list_init='0'
6604 d_inc_version_list="$undef"
6606 *) inc_version_list_init=`echo $inc_version_list |
6607 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6608 d_inc_version_list="$define"
6613 : see if malloc/malloc.h has to be included
6614 set malloc/malloc.h i_mallocmalloc
6617 : see if this is a malloc.h system
6618 : we want a real compile instead of Inhdr because some systems have a
6619 : malloc.h that just gives a compile error saying to use stdlib.h instead
6624 #$i_mallocmalloc I_MALLOCMALLOC
6625 #ifdef I_MALLOCMALLOC
6626 # include <malloc/malloc.h>
6629 int main () { return 0; }
6632 if eval $compile; then
6633 echo "<malloc.h> found." >&4
6636 echo "<malloc.h> NOT found." >&4
6643 : check for void type
6645 echo "Checking to see how well your C compiler groks the void type..." >&4
6646 case "$voidflags" in
6658 extern void moo(); /* function returning void */
6659 void (*goo)(); /* ptr to func returning void */
6661 void *hue; /* generic ptr */
6674 int main() { sub(); }
6676 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
6677 voidflags=$defvoidused
6678 echo "Good. It appears to support void to the level $package wants.">&4
6679 if $contains warning .out >/dev/null 2>&1; then
6680 echo "However, you might get some warnings that look like this:"
6684 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
6685 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
6686 echo "It supports 1..."
6687 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
6688 echo "It also supports 2..."
6689 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
6691 echo "And it supports 4 but not 8 definitely."
6693 echo "It doesn't support 4..."
6694 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
6696 echo "But it supports 8."
6699 echo "Neither does it support 8."
6703 echo "It does not support 2..."
6704 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
6706 echo "But it supports 4 and 8."
6708 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
6710 echo "And it supports 4 but has not heard about 8."
6712 echo "However it supports 8 but not 4."
6717 echo "There is no support at all for void."
6722 case "$voidflags" in
6725 Support flag bits are:
6726 1: basic void declarations.
6727 2: arrays of pointers to functions returning void.
6728 4: operations between pointers to and addresses of void functions.
6729 8: generic void pointers.
6732 rp="Your void support flags add up to what?"
6739 : check for length of pointer
6743 echo "Checking to see how big your pointers are..." >&4
6744 if test "$voidflags" -gt 7; then
6745 echo '#define VOID_PTR char *' > try.c
6747 echo '#define VOID_PTR void *' > try.c
6757 printf("%d\n", (int)sizeof(VOID_PTR));
6762 if eval $compile_ok; then
6763 ptrsize=`$run ./try`
6764 echo "Your pointers are $ptrsize bytes long."
6767 echo "(I can't seem to compile the test program. Guessing...)" >&4
6768 rp="What is the size of a pointer (in bytes)?"
6775 case "$use64bitall" in
6776 "$define"|true|[yY]*)
6780 *** You have chosen a maximally 64-bit build,
6781 *** but your pointers are only 4 bytes wide.
6782 *** Please rerun Configure without -Duse64bitall.
6787 *** Since you have quads, you could possibly try with -Duse64bitint.
6792 *** Cannot continue, aborting.
6803 : determine whether to use malloc wrapping
6805 case "$usemallocwrap" in
6806 [yY]*|true|$define) dflt='y' ;;
6807 [nN]*|false|$undef) dflt='n' ;;
6808 *) case "$usedevel" in
6809 [yY]*|true|$define) dflt='y' ;;
6814 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
6816 usemallocwrap="$ans"
6819 usemallocwrap="$define" ;;
6821 usemallocwrap="$undef" ;;
6824 : determine which malloc to compile in
6826 case "$usemymalloc" in
6827 [yY]*|true|$define) dflt='y' ;;
6828 [nN]*|false|$undef) dflt='n' ;;
6829 *) case "$ptrsize" in
6835 rp="Do you wish to attempt to use the malloc that comes with $package?"
6841 mallocsrc='malloc.c'
6842 mallocobj="malloc$_o"
6843 d_mymalloc="$define"
6846 : Remove malloc from list of libraries to use
6847 echo "Removing unneeded -lmalloc from library list" >&4
6848 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6851 echo "libs = $libs" >&4
6863 : compute the return types of malloc and free
6865 $cat >malloc.c <<END
6869 #include <sys/types.h>
6883 case "$malloctype" in
6885 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6892 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6896 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6903 echo "Your system uses $freetype free(), it would seem." >&4
6905 : determine where site specific architecture-dependent libraries go.
6906 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6907 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6908 : sitelib may have an optional trailing /share.
6910 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6911 dflt="$dflt/$archname"
6916 set sitearch sitearch none
6920 The installation process will also create a directory for
6921 architecture-dependent site-specific extensions and modules.
6925 rp='Pathname for the site-specific architecture-dependent library files?'
6929 if $test X"$sitearch" = X"$sitelib"; then
6932 d_sitearch="$define"
6935 : Set the vendorprefix variables
6938 The installation process will also create a directory for
6939 vendor-supplied add-ons. Vendors who supply perl with their system
6940 may find it convenient to place all vendor-supplied files in this
6941 directory rather than in the main distribution directory. This will
6942 ease upgrades between binary-compatible maintenance versions of perl.
6944 Of course you may also use these directories in whatever way you see
6945 fit. For example, you might use them to access modules shared over a
6946 company-wide network.
6948 The default answer should be fine for most people.
6949 This causes further questions about vendor add-ons to be skipped
6950 and no vendor-specific directories will be configured for perl.
6953 rp='Do you want to configure vendor-specific add-on directories?'
6954 case "$usevendorprefix" in
6955 define|true|[yY]*) dflt=y ;;
6956 *) : User may have set vendorprefix directly on Configure command line.
6957 case "$vendorprefix" in
6966 rp='Installation prefix to use for vendor-supplied add-ons?'
6967 case "$vendorprefix" in
6969 *) dflt=$vendorprefix ;;
6972 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6974 case "$vendorprefix" in
6978 *) oldvendorprefix="$prefix";;
6982 usevendorprefix="$define"
6984 vendorprefixexp="$ansexp"
6986 *) usevendorprefix="$undef"
6992 : Set the vendorlib variables
6993 case "$vendorprefix" in
6994 '') d_vendorlib="$undef"
6998 *) d_vendorlib="$define"
6999 : determine where vendor-supplied modules go.
7000 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
7001 case "$vendorlib" in
7003 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7004 case "$installstyle" in
7005 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
7006 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
7009 *) dflt="$vendorlib"
7013 rp='Pathname for the vendor-supplied library files?'
7016 vendorlibexp="$ansexp"
7019 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
7023 : Set the vendorarch variables
7024 case "$vendorprefix" in
7025 '') d_vendorarch="$undef"
7029 *) d_vendorarch="$define"
7030 : determine where vendor-supplied architecture-dependent libraries go.
7031 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
7032 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
7033 : vendorlib may have an optional trailing /share.
7034 case "$vendorarch" in
7035 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
7036 dflt="$dflt/$archname"
7038 *) dflt="$vendorarch" ;;
7041 rp='Pathname for vendor-supplied architecture-dependent files?'
7044 vendorarchexp="$ansexp"
7047 prefixvar=vendorarch
7049 if $test X"$vendorarch" = X"$vendorlib"; then
7050 d_vendorarch="$undef"
7052 d_vendorarch="$define"
7055 : Final catch-all directories to search
7058 Lastly, you can have perl look in other directories for extensions and
7059 modules in addition to those already specified.
7060 These directories will be searched after
7064 test X"$vendorlib" != "X" && echo ' ' $vendorlib
7065 test X"$vendorarch" != "X" && echo ' ' $vendorarch
7067 case "$otherlibdirs" in
7068 ''|' ') dflt='none' ;;
7069 *) dflt="$otherlibdirs" ;;
7072 Enter a colon-separated set of extra paths to include in perl's @INC
7073 search path, or enter 'none' for no extra paths.
7077 rp='Colon-separated list of additional directories for perl to search?'
7080 ' '|''|none) otherlibdirs=' ' ;;
7081 *) otherlibdirs="$ans" ;;
7083 case "$otherlibdirs" in
7087 set d_perl_otherlibdirs
7090 : Cruising for prototypes
7092 echo "Checking out function prototypes..." >&4
7093 $cat >prototype.c <<EOCP
7098 int main(int argc, char *argv[]) {
7101 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
7102 echo "Your C compiler appears to support function prototypes."
7105 echo "Your C compiler doesn't seem to understand function prototypes."
7112 : Check if ansi2knr is required
7113 case "$prototype" in
7115 *) ansi2knr='ansi2knr'
7120 This version of $package can only be compiled by a compiler that
7121 understands function prototypes. Unfortunately, your C compiler
7123 doesn't seem to understand them. Sorry about that.
7125 If GNU cc is available for your system, perhaps you could try that instead.
7127 Eventually, we hope to support building Perl with pre-ANSI compilers.
7128 If you would like to help in that effort, please contact <perlbug@perl.org>.
7130 Aborting Configure now.
7137 dflt_dtrace='/usr/sbin/dtrace'
7140 Perl can be built to support DTrace on platforms that support it.
7141 DTrace is a diagnosis and performance analysis tool from Sun.
7143 If this doesn't make any sense to you, just accept the default '$dflt'.
7147 case "$usedtrace" in
7153 dflt_dtrace=$usedtrace
7160 rp='Support DTrace if available?'
7163 y|Y) val="$define" ;;
7169 test "X$usedtrace" != "X$define" && break
7172 rp='Where is the dtrace executable?'
7181 if $dtrace -h -s ../perldtrace.d \
7182 -o perldtrace.tmp >/dev/null 2>&1 \
7183 && rm -f perldtrace.tmp
7186 echo "Good: your $dtrace knows about the -h flag."
7190 *** $me: Fatal Error: $dtrace doesn't support -h flag
7192 *** Your installed dtrace doesn't support the -h switch to compile a D
7193 *** program into a C header. Can't continue.
7205 *** $me: Fatal Error: $dtrace not found.
7212 echo "*** $dtrace was not found."
7218 : See if we want extra modules installed
7225 Perl can be built with extra modules or bundles of modules which
7226 will be fetched from the CPAN and installed alongside Perl.
7228 Notice that you will need access to the CPAN; either via the Internet,
7229 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
7230 be asked later to configure the CPAN.pm module which will in turn do
7231 the installation of the rest of the extra modules or bundles.)
7233 Notice also that if the modules require any external software such as
7234 libraries and headers (the libz library and the zlib.h header for the
7235 Compress::Zlib module, for example) you MUST have any such software
7236 already installed, this configuration process will NOT install such
7239 If this doesn't make any sense to you, just accept the default '$dflt'.
7241 rp='Install any extra modules (y or n)?'
7247 Please list any extra modules or bundles to be installed from CPAN,
7248 with spaces between the names. The names can be in any format the
7249 'install' command of CPAN.pm will understand. (Answer 'none',
7250 without the quotes, to install no extra modules or bundles.)
7260 $rm -f ../extras.lst
7262 *) echo "(Saving the list of extras for later...)"
7263 echo "$extras" > ../extras.lst
7271 : determine where html pages for programs go
7272 set html1dir html1dir none
7276 If you wish to install html files for programs in $spackage, indicate
7277 the appropriate directory here. To skip installing html files,
7281 ''|none|$undef|' ') dflt=none ;;
7282 *) dflt=$html1dir ;;
7285 rp="Directory for the main $spackage html pages?"
7289 : Use ' ' for none so value is preserved next time through Configure
7290 $test X"$html1dir" = "X" && html1dir=' '
7292 : determine where html pages for libraries and modules go
7293 set html3dir html3dir none
7297 If you wish to install html files for modules associated with $spackage,
7298 indicate the appropriate directory here. To skip installing html files,
7301 : There is no obvious default. If they have specified html1dir, then
7302 : try to key off that, possibly changing .../html1 into .../html3.
7304 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
7305 *) dflt=$html3dir ;;
7308 rp="Directory for the $spackage module html pages?"
7312 : Use ' ' for none so value is preserved next time through Configure
7313 $test X"$html3dir" = "X" && html3dir=' '
7315 : determine whether to install perl also as /usr/bin/perl
7318 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
7320 Many scripts expect perl to be installed as /usr/bin/perl.
7322 If you want to, I can install the perl you are about to compile
7323 as /usr/bin/perl (in addition to $bin/perl).
7325 if test -f /usr/bin/perl; then
7328 However, please note that because you already have a /usr/bin/perl,
7329 overwriting that with a new Perl would very probably cause problems.
7330 Therefore I'm assuming you don't want to do that (unless you insist).
7333 case "$installusrbinperl" in
7334 "$define"|[yY]*) dflt='y';;
7340 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
7343 case "$installusrbinperl" in
7344 "$undef"|[nN]*) dflt='n';;
7348 rp="Do you want to install perl as /usr/bin/perl?"
7351 [yY]*) val="$define";;
7357 set installusrbinperl
7360 : Check if we are using the GNU C library
7362 echo "Checking for GNU C Library..." >&4
7364 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
7365 alone are insufficient to distinguish different versions, such as
7366 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
7367 libc version 2.1.0. A. Dougherty, June 3, 2002.
7373 # ifdef __GLIBC_MINOR__
7374 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
7375 # include <gnu/libc-version.h>
7376 printf("%s\n", gnu_get_libc_version());
7378 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
7381 printf("%d\n", __GLIBC__);
7390 if eval $compile_ok && $run ./try > glibc.ver; then
7392 gnulibc_version=`$cat glibc.ver`
7393 echo "You are using the GNU C Library version $gnulibc_version"
7397 echo "You are not using the GNU C Library"
7403 : see if nm is to be used to determine whether a symbol is defined or not
7407 case "$d_gnulibc" in
7410 echo "nm probably won't work on the GNU C Library." >&4
7416 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
7418 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
7419 echo "'nm' won't be sufficient on this sytem." >&4
7425 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
7426 if $test $dflt -gt 20; then
7436 true|$define) dflt=y;;
7443 I can use $nm to extract the symbols from your C libraries. This
7444 is a time consuming task which may generate huge output on the disk (up
7445 to 3 megabytes) but that should make the symbols extraction faster. The
7446 alternative is to skip the 'nm' extraction part and to compile a small
7447 test program instead to determine whether each symbol is present. If
7448 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
7449 this may be the best solution.
7451 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
7454 rp="Shall I use $nm to extract C symbols from the libraries?"
7457 [Nn]*) usenm=false;;
7466 : nm options which may be necessary
7468 '') if $test -f /mach_boot; then
7470 elif $test -d /usr/ccs/lib; then
7471 nm_opt='-p' # Solaris (and SunOS?)
7472 elif $test -f /dgux; then
7474 elif $test -f /lib64/rld; then
7475 nm_opt='-p' # 64-bit Irix
7481 : nm options which may be necessary for shared libraries but illegal
7482 : for archive libraries. Thank you, Linux.
7483 case "$nm_so_opt" in
7484 '') case "$myuname" in
7486 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
7487 nm_so_opt='--dynamic'
7494 : Figure out where the libc is located
7497 : get list of predefined functions in a handy place
7502 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
7508 *) for thislib in $libs; do
7511 : Handle C library specially below.
7514 thislib=`echo $thislib | $sed -e 's/^-l//'`
7515 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
7517 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
7519 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
7521 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
7523 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
7525 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
7527 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
7532 libnames="$libnames $try"
7534 *) libnames="$libnames $thislib" ;;
7543 for xxx in $libpth; do
7544 $test -r $1 || set $xxx/libc.$so
7545 : The messy sed command sorts on library version numbers.
7547 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
7548 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
7550 s/[0-9][0-9]*/0000&/g
7551 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
7554 $sort | $sed -e 's/^.* //'`
7557 $test -r $1 || set /usr/ccs/lib/libc.$so
7558 $test -r $1 || set /lib/libsys_s$_a
7564 if $test -r "$1"; then
7565 echo "Your (shared) C library seems to be in $1."
7567 elif $test -r /lib/libc && $test -r /lib/clib; then
7568 echo "Your C library seems to be in both /lib/clib and /lib/libc."
7570 libc='/lib/clib /lib/libc'
7571 if $test -r /lib/syslib; then
7572 echo "(Your math library is in /lib/syslib.)"
7573 libc="$libc /lib/syslib"
7575 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7576 echo "Your C library seems to be in $libc, as you said before."
7577 elif $test -r $incpath/usr/lib/libc$_a; then
7578 libc=$incpath/usr/lib/libc$_a;
7579 echo "Your C library seems to be in $libc. That's fine."
7580 elif $test -r /lib/libc$_a; then
7582 echo "Your C library seems to be in $libc. You're normal."
7584 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
7586 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
7587 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
7588 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
7590 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7592 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7595 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
7597 if $test -r "$tans"; then
7598 echo "Your C library seems to be in $tans, of all places."
7604 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7608 If the guess above is wrong (which it might be if you're using a strange
7609 compiler, or your machine supports multiple models), you can override it here.
7614 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
7616 I can't seem to find your C library. I've looked in the following places:
7619 $sed 's/^/ /' libpath
7622 None of these seems to contain your C library. I need to get its name...
7627 rp='Where is your C library?'
7632 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
7633 set X `cat libnames`
7636 case $# in 1) xxx=file; esac
7637 echo "Extracting names from the following $xxx for later perusal:" >&4
7639 $sed 's/^/ /' libnames >&4
7641 $echo $n "This may take a while...$c" >&4
7645 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
7646 *) $nm $nm_opt $file 2>/dev/null;;
7651 $grep fprintf libc.tmp > libc.ptf
7652 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
7653 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
7655 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
7657 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7659 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
7661 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7663 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
7665 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7667 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
7669 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7671 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
7673 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7675 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
7677 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7679 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
7680 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
7682 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7684 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
7686 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7688 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
7690 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7692 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
7694 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7696 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
7698 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7700 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
7702 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7704 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
7706 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7708 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
7710 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7713 $nm -p $* 2>/dev/null >libc.tmp
7714 $grep fprintf libc.tmp > libc.ptf
7715 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
7716 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
7722 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
7724 if $ar t $libc > libc.tmp && \
7725 $contains '^fprintf$' libc.tmp >/dev/null 2>&1
7727 for thisname in $libnames $libc; do
7728 $ar t $thisname >>libc.tmp
7730 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
7732 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
7733 for thisname in $libnames $libc; do
7734 $ar tv $thisname >>libc.tmp
7735 emximp -o tmp.imp $thisname \
7737 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
7738 < tmp.imp >>libc.tmp
7741 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
7744 echo "$ar didn't seem to work right." >&4
7745 echo "Maybe this is a Cray...trying bld instead..." >&4
7747 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list &&
7750 for thisname in $libnames; do
7752 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
7753 $ar t $thisname >>libc.tmp
7757 echo "That didn't work either. Giving up." >&4
7767 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
7768 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
7770 *) if $test -f /lib/syscalls.exp; then
7772 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
7773 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' \
7774 /lib/syscalls.exp >>libc.list
7780 $rm -f libnames libpath
7782 : see if dld is available
7786 : Check if we are using C++
7788 echo "Checking for C++..." >&4
7789 $cat >try.c <<'EOCP'
7801 if eval $compile_ok && $run ./try; then
7803 echo "You are using a C++ compiler."
7806 echo "You are not using a C++ compiler."
7812 : is a C symbol defined?
7815 -v) tf=libc.tmp; tdc="";;
7816 -a) tf=libc.tmp; tdc="[]";;
7817 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
7819 case "$d_cplusplus" in
7820 $define) extern_C="extern \"C\"" ;;
7821 *) extern_C="extern" ;;
7824 case "$reuseval-$4" in
7826 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
7831 if $test "$runnm" = true; then
7832 if $contains $tlook $tf >/dev/null 2>&1; then
7834 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
7835 echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7836 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
7837 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
7841 echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7842 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
7848 $define) tval=true;;
7855 : define an is-in-libc? function
7856 inlibc='echo " "; td=$define; tu=$undef;
7857 sym=$1; var=$2; eval "was=\$$2";
7859 case "$reuseval$was" in
7869 echo "$sym() found." >&4;
7870 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
7872 echo "$sym() NOT found." >&4;
7873 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
7877 $define) echo "$sym() found." >&4;;
7878 *) echo "$sym() NOT found." >&4;;
7882 : see if dlopen exists
7884 xxx_ccflags="$ccflags"
7886 : with g++ one needs -shared to get is-in-libc to work for dlopen
7887 case "$gccversion" in
7889 *) case "$d_cplusplus" in
7890 "$define") ccflags="$ccflags -shared" ;;
7897 ccflags="$xxx_ccflags"
7899 : see if this is a unistd.h system
7900 set unistd.h i_unistd
7903 : determine which dynamic loading, if any, to compile in
7905 dldir="ext/DynaLoader"
7918 $define) dflt='y' ;;
7921 $define) dflt='y' ;;
7923 : Does a dl_xxx.xs file exist for this operating system
7924 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
7927 rp="Do you wish to use dynamic loading?"
7935 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
7936 dflt="$dldir/dl_${osname}.xs"
7937 elif $test "$d_dlopen" = "$define" ; then
7938 dflt="$dldir/dl_dlopen.xs"
7939 elif $test "$i_dld" = "$define" ; then
7940 dflt="$dldir/dl_dld.xs"
7945 *) dflt="$dldir/$dlsrc"
7948 echo "The following dynamic loading files are available:"
7949 : Can not go over to $dldir because getfile has path hard-coded in.
7950 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
7951 rp="Source file to use for dynamic loading"
7957 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
7961 Some systems may require passing special flags to $cc -c to
7962 compile modules that will be used to create a shared library.
7963 To use no flags, say "none".
7966 case "$cccdlflags" in
7967 '') case "$gccversion" in
7968 '') case "$osname" in
7970 next) dflt='none' ;;
7971 irix*) dflt='-KPIC' ;;
7972 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
7973 sunos) dflt='-pic' ;;
7977 *) case "$osname" in
7978 darwin) dflt='none' ;;
7979 linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
7984 *) dflt="$cccdlflags" ;;
7986 rp="Any special flags to pass to $cc -c to compile shared library modules?"
7989 none) cccdlflags=' ' ;;
7990 *) cccdlflags="$ans" ;;
7995 Some systems use ld to create libraries that can be dynamically loaded,
7996 while other systems (such as those using ELF) use $cc.
8000 '') $cat >try.c <<EOM
8001 /* Test for whether ELF binaries are produced */
8013 int i = open("a.out",O_RDONLY);
8016 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
8017 exit(0); /* succeed (yes, it's ELF) */
8022 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
8024 You appear to have ELF support. I'll use $cc to build dynamic libraries.
8029 echo "I'll use ld to build dynamic libraries."
8038 rp="What command should be used to create dynamic libraries?"
8044 Some systems may require passing special flags to $ld to create a
8045 library that can be dynamically loaded. If your ld flags include
8046 -L/other/path options to locate libraries outside your loader's normal
8047 search path, you may need to specify those -L options here as well. To
8048 use no flags, say "none".
8051 case "$lddlflags" in
8052 '') case "$osname" in
8053 beos) dflt='-nostart' ;;
8054 haiku) dflt='-shared' ;;
8056 case "$gccversion" in
8057 '') dflt="$dflt +vnocompatwarnings" ;;
8060 linux|irix*|gnu*) dflt="-shared $optimize" ;;
8061 next) dflt='none' ;;
8062 solaris) dflt='-G' ;;
8063 sunos) dflt='-assert nodefinitions' ;;
8064 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
8068 *) dflt="$lddlflags" ;;
8071 : Try to guess additional flags to pick up local libraries.
8072 : Be careful not to append to a plain 'none'
8076 for thisflag in $ldflags; do
8081 *) dflt="$dflt $thisflag" ;;
8088 ''|' ') dflt='none' ;;
8092 *-fstack-protector*)
8094 *-fstack-protector*) ;; # Don't add it again
8095 *) dflt="$dflt -fstack-protector" ;;
8101 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
8104 none) lddlflags=' ' ;;
8105 *) lddlflags="$ans" ;;
8110 Some systems may require passing special flags to $cc to indicate that
8111 the resulting executable will use dynamic linking. To use no flags,
8115 case "$ccdlflags" in
8116 '') case "$osname" in
8117 linux|hpux|gnu*) dflt='-Wl,-E' ;;
8118 next|sunos) dflt='none' ;;
8122 *) dflt="$ccdlflags" ;;
8124 rp="Any special flags to pass to $cc to use dynamic linking?"
8127 none) ccdlflags=' ' ;;
8128 *) ccdlflags="$ans" ;;
8139 : Do we want a shared libperl?
8143 # No dynamic loading being used, so don't bother even to prompt.
8146 *) case "$useshrplib" in
8147 '') case "$osname" in
8148 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|haiku|cygwin*)
8150 also='Building a shared libperl is required for dynamic loading to work on your system.'
8155 also='Building a shared libperl is needed for MAB support.'
8173 The perl executable is normally obtained by linking perlmain.c with
8174 libperl${_a}, any static extensions (usually just DynaLoader), and
8175 any other libraries needed on this system (such as -lm, etc.). Since
8176 your system supports dynamic loading, it is probably possible to build
8177 a shared libperl.$so. If you will have more than one executable linked
8178 to libperl.$so, this will significantly reduce the size of each
8179 executable, but it may have a noticeable effect on performance. The
8180 default is probably sensible for your system.
8184 rp="Build a shared libperl.$so (y/n)"
8188 useshrplib='true' ;;
8189 *) useshrplib='false' ;;
8194 case "$useshrplib" in
8196 case "$userelocatableinc" in
8198 echo "Cannot build with both -Duserelocatableinc and -Duseshrplib" >&4
8199 echo "See INSTALL for an explanation why that won't work." >&4
8205 # Figure out a good name for libperl.so. Since it gets stored in
8206 # a version-specific architecture-dependent library, the version
8207 # number isn't really that important, except for making cc/ld happy.
8209 # A name such as libperl.so.10.1
8210 majmin="libperl.$so.$patchlevel.$subversion"
8211 # A name such as libperl.so.100
8212 majonly=`echo $patchlevel $subversion |
8213 $awk '{printf "%d%02d", $1, $2}'`
8214 majonly=libperl.$so.$majonly
8215 # I'd prefer to keep the os-specific stuff here to a minimum, and
8216 # rely on figuring it out from the naming of libc.
8217 case "${osname}${osvers}" in
8220 # XXX How handle the --version stuff for MAB?
8222 linux*|gnu*) # ld won't link with a bare -lperl otherwise.
8225 cygwin*) # ld links now against the dll directly
8226 majmin="cygperl5_${patchlevel}_${subversion}.${so}"
8227 majonly=`echo $patchlevel $subversion |
8228 $awk '{printf "%03d%03d", $1, $2}'`
8229 majonly=cygperl5.$majonly.$so
8232 *) # Try to guess based on whether libc has major.minor.
8234 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8235 *libc.$so.[0-9]*) dflt=$majonly ;;
8236 *) dflt=libperl.$so ;;
8246 I need to select a good name for the shared libperl. If your system uses
8247 library names with major and minor numbers, then you might want something
8248 like $majmin. Alternatively, if your system uses a single version
8249 number for shared libraries, then you might want to use $majonly.
8250 Or, your system might be quite happy with a simple libperl.$so.
8252 Since the shared libperl will get installed into a version-specific
8253 architecture-dependent directory, the version number of the shared perl
8254 library probably isn't important, so the default should be o.k.
8257 rp='What name do you want to give to the shared libperl?'
8260 echo "Ok, I'll use $libperl"
8263 libperl="libperl${_a}"
8267 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8271 WARNING: Use of the shrpdir variable for the installation location of
8272 the shared $libperl is not supported. It was never documented and
8273 will not work in this version. Let me (perlbug@perl.org)
8274 know of any problems this may cause.
8280 But your current setting of $shrpdir is
8281 the default anyway, so it's harmless.
8286 Further, your current attempted setting of $shrpdir
8287 conflicts with the value of $archlibexp/CORE
8288 that installperl will use.
8295 # How will the perl executable find the installed shared $libperl?
8296 # Add $xxx to ccdlflags.
8297 # If we can't figure out a command-line option, use $shrpenv to
8298 # set env LD_RUN_PATH. The main perl makefile uses this.
8299 shrpdir=$archlibexp/CORE
8302 if "$useshrplib"; then
8305 # We'll set it in Makefile.SH...
8310 freebsd|netbsd|openbsd|interix|dragonfly)
8311 xxx="-Wl,-R$shrpdir"
8313 bsdos|linux|irix*|dec_osf|gnu*)
8314 xxx="-Wl,-rpath,$shrpdir"
8317 # next doesn't like the default...
8320 # beos doesn't like the default, either.
8323 # Haiku doesn't like the default, either.
8326 # hpux doesn't like the default, either.
8327 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8330 # cygwin needs only ldlibpth
8333 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8339 # Only add $xxx if it isn't already in ccdlflags.
8340 case " $ccdlflags " in
8342 *) ccdlflags="$ccdlflags $xxx"
8345 Adding $xxx to the flags
8346 passed to $ld so that the perl executable will find the
8347 installed shared $libperl.
8355 # Fix ccdlflags in AIX for building external extensions.
8356 # (For building Perl itself bare -bE:perl.exp is needed,
8357 # Makefile.SH takes care of this.)
8359 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8361 # Respect a hint or command-line value.
8363 '') shrpenv="$tmp_shrpenv" ;;
8365 case "$ldlibpthname" in
8366 '') ldlibpthname=LD_LIBRARY_PATH ;;
8367 none) ldlibpthname='' ;;
8370 : determine where manual pages are on this system
8374 syspath='/usr/share/man/man1 /usr/man/man1'
8375 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8376 syspath="$syspath /usr/man/u_man/man1"
8377 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8378 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8379 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8380 sysman=`./loc . /usr/man/man1 $syspath`
8383 if $test -d "$sysman"; then
8384 echo "System manual is in $sysman." >&4
8386 echo "Could not find manual pages in source form." >&4
8389 : determine where manual pages go
8390 set man1dir man1dir none
8394 $spackage has manual pages available in source form.
8398 echo "However, you don't have nroff, so they're probably useless to you."
8400 '') man1dir="none";;
8403 echo "If you don't want the manual sources installed, answer 'none'."
8408 lookpath="$prefixexp/share/man/man1"
8409 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8410 lookpath="$lookpath $prefixexp/man/p_man/man1"
8411 lookpath="$lookpath $prefixexp/man/u_man/man1"
8412 lookpath="$lookpath $prefixexp/man/man.1"
8414 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8415 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8425 rp="Where do the main $spackage manual pages (source) go?"
8427 if $test "X$man1direxp" != "X$ansexp"; then
8438 : What suffix to use on installed man pages
8445 rp="What suffix should be used for the main $spackage man pages?"
8447 '') case "$man1dir" in
8461 *) dflt="$man1ext";;
8468 : see if we can have long filenames
8470 first=123456789abcdef
8472 if (echo hi >$first) 2>/dev/null; then
8473 if $test -f 123456789abcde; then
8474 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8477 echo 'You can have filenames longer than 14 characters.'>&4
8482 You can't have filenames longer than 14 chars.
8483 You can't even think about them!
8489 $rm -rf 123456789abcde*
8491 : determine where library module manual pages go
8492 set man3dir man3dir none
8496 $spackage has manual pages for many of the library modules.
8502 However, you don't have nroff, so they're probably useless to you.
8505 '') man3dir="none";;
8509 case "$d_flexfnam" in
8512 However, your system can't handle the long file names like File::Basename.3.
8515 '') man3dir="none";;
8519 echo "If you don't want the manual sources installed, answer 'none'."
8520 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8522 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8523 if $test -d "$privlib/man/man3"; then
8526 WARNING: Previous versions of perl installed man3 pages into
8527 $privlib/man/man3. This version will suggest a
8528 new default of $dflt.
8532 rp='Do you wish to preserve the old behavior?(y/n)'
8535 y*) dflt="$privlib/man/man3" ;;
8540 *) dflt="$man3dir" ;;
8547 rp="Where do the $package library man pages (source) go?"
8557 : What suffix to use on installed man pages
8563 rp="What suffix should be used for the $package library man pages?"
8565 '') case "$man3dir" in
8579 *) dflt="$man3ext";;
8586 : see if we have to deal with yellow pages, now NIS.
8587 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8588 if $test -f /usr/etc/nibindd; then
8590 echo "I'm fairly confident you're on a NeXT."
8592 rp='Do you get the hosts file via NetInfo?'
8601 y*) hostcat='nidump hosts .';;
8602 *) case "$hostcat" in
8603 nidump*) hostcat='';;
8613 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8621 rp='Are you getting the hosts file via yellow pages?'
8624 y*) hostcat='ypcat hosts';;
8625 *) hostcat='cat /etc/hosts';;
8631 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8634 '') test -f /etc/group && groupcat='cat /etc/group';;
8637 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8640 : now get the host name
8642 echo "Figuring out host name..." >&4
8643 case "$myhostname" in
8645 echo 'Maybe "hostname" will work...'
8646 if tans=`sh -c hostname 2>&1` ; then
8654 if $test "$cont"; then
8656 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8657 if tans=`cat /etc/systemid 2>&1` ; then
8659 phostname='cat /etc/systemid'
8660 echo "Whadyaknow. Xenix always was a bit strange..."
8663 elif $test -r /etc/systemid; then
8664 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8667 if $test "$cont"; then
8668 echo 'No, maybe "uuname -l" will work...'
8669 if tans=`sh -c 'uuname -l' 2>&1` ; then
8671 phostname='uuname -l'
8673 echo 'Strange. Maybe "uname -n" will work...'
8674 if tans=`sh -c 'uname -n' 2>&1` ; then
8676 phostname='uname -n'
8678 echo 'Oh well, maybe I can mine it out of whoami.h...'
8679 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8680 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8681 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8683 case "$myhostname" in
8684 '') echo "Does this machine have an identity crisis or something?"
8687 echo "Well, you said $myhostname before..."
8688 phostname='echo $myhostname';;
8694 case "$myhostname" in
8695 '') myhostname=noname ;;
8697 : you do not want to know about this
8702 if $test "$myhostname" ; then
8704 rp='Your host name appears to be "'$myhostname'".'" Right?"
8712 : bad guess or no guess
8713 while $test "X$myhostname" = X ; do
8715 rp="Please type the (one word) name of your host:"
8720 : translate upper to lower if necessary
8721 case "$myhostname" in
8723 echo "(Normalizing case in your host name)"
8724 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8728 case "$myhostname" in
8730 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8731 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8732 echo "(Trimming domain name from host name--host name is now $myhostname)"
8734 *) case "$mydomain" in
8737 test "X$hostcat" = "Xypcat hosts" &&
8738 ypmatch "$myhostname" hosts 2>/dev/null |\
8739 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8742 test "X$hostcat" != "X" &&
8743 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8744 /[ ]$myhostname[ . ]/p" > hosts
8747 if $test -f hosts; then
8748 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8749 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8750 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8751 hosts | $sort | $uniq | \
8752 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8753 case `$echo X$dflt` in
8754 X*\ *) echo "(Several hosts in the database matched hostname)"
8757 X.) echo "(You do not have fully-qualified names in the hosts database)"
8761 echo "(I cannot locate a hosts database anywhere)"
8766 tans=`./loc resolv.conf X /etc /usr/etc`
8767 if $test -f "$tans"; then
8768 echo "(Attempting domain name extraction from $tans)"
8769 dflt=.`$sed -n -e 's/ / /g' \
8770 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8773 .) dflt=.`$sed -n -e 's/ / /g' \
8774 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8782 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8783 dflt=.`sh -c domainname 2>/dev/null`
8786 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8790 case "$dflt$osname" in
8791 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
8792 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
8796 .) echo "(Lost all hope -- silly guess then)"
8802 *) dflt="$mydomain";;
8806 rp="What is your domain name?"
8816 : translate upper to lower if necessary
8819 echo "(Normalizing case in your domain name)"
8820 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
8824 : a little sanity check here
8825 case "$phostname" in
8828 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
8829 $myhostname$mydomain|$myhostname) ;;
8831 case "$phostname" in
8833 echo "(That doesn't agree with your whoami.h file, by the way.)"
8836 echo "(That doesn't agree with your $phostname command, by the way.)"
8844 : determine the e-mail address of the user who is running us
8847 I need to get your e-mail address in Internet format if possible, i.e.
8848 something like user@host.domain. Please answer accurately since I have
8849 no easy means to double check it. The default value provided below
8850 is most probably close to reality but may not be valid from outside
8851 your organization...
8855 while test "$cont"; do
8857 '') dflt="$cf_by@$myhostname$mydomain";;
8858 *) dflt="$cf_email";;
8860 rp='What is your e-mail address?'
8866 rp='Address does not look like an Internet one. Use it anyway?'
8880 : Ask e-mail of administrator
8883 If you or somebody else will be maintaining perl at your site, please
8884 fill in the correct e-mail address here so that they may be contacted
8885 if necessary. Currently, the "perlbug" program included with perl
8886 will send mail to this address in addition to perlbug@perl.org. You may
8887 enter "none" for no administrator.
8890 case "$perladmin" in
8891 '') dflt="$cf_email";;
8892 *) dflt="$perladmin";;
8894 rp='Perl administrator e-mail address'
8898 : determine whether to only install version-specific parts.
8901 Do you want to install only the version-specific parts of the perl
8902 distribution? Usually you do *not* want to do this.
8904 case "$versiononly" in
8905 "$define"|[Yy]*|true) dflt='y' ;;
8908 rp="Do you want to install only the version-specific parts of perl?"
8911 [yY]*) val="$define";;
8917 case "$versiononly" in
8918 "$define") inc_version_list=''
8919 inc_version_list_init=0
8923 : figure out how to guarantee perl startup
8924 : XXX Note that this currently takes advantage of the bug that binexp ignores
8925 : the Configure -Dinstallprefix setting, which in turn means that under
8926 : relocatable @INC, initialinstalllocation is what binexp started as.
8927 case "$startperl" in
8929 case "$sharpbang" in
8933 I can use the #! construct to start perl on your system. This will
8934 make startup of perl scripts faster, but may cause problems if you
8935 want to share those scripts and perl is not in a standard place
8936 ($initialinstalllocation/perl) on all your platforms. The alternative
8937 is to force a shell by starting the script with a single ':' character.
8940 case "$versiononly" in
8941 "$define") dflt="$initialinstalllocation/perl$version";;
8942 *) dflt="$initialinstalllocation/perl";;
8944 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
8947 none) startperl=": # use perl";;
8948 *) startperl="#!$ans"
8949 if $test 30 -lt `echo "$ans" | wc -c`; then
8952 WARNING: Some systems limit the #! command to 32 characters.
8953 If you experience difficulty running Perl scripts with #!, try
8954 installing Perl in a directory with a shorter pathname.
8960 *) startperl=": # use perl"
8965 echo "I'll use $startperl to start perl scripts."
8967 : figure best path for perl in scripts
8970 case "$versiononly" in
8971 "$define") perlpath="$initialinstalllocation/perl$version";;
8972 *) perlpath="$initialinstalllocation/perl";;
8974 case "$startperl" in
8979 I will use the "eval 'exec'" idiom to start Perl on your system.
8980 I can use the full path of your Perl binary for this purpose, but
8981 doing so may cause problems if you want to share those scripts and
8982 Perl is not always in a standard place ($initialinstalllocation/perl).
8985 dflt="$initialinstalllocation/perl"
8986 rp="What path shall I use in \"eval 'exec'\"?"
8993 case "$startperl" in
8995 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
8998 : determine where public executable scripts go
8999 set scriptdir scriptdir
9001 case "$scriptdir" in
9004 : guess some guesses
9005 $test -d /usr/share/scripts && dflt=/usr/share/scripts
9006 $test -d /usr/share/bin && dflt=/usr/share/bin
9007 $test -d /usr/local/script && dflt=/usr/local/script
9008 $test -d /usr/local/scripts && dflt=/usr/local/scripts
9009 $test -d $prefixexp/script && dflt=$prefixexp/script
9013 *) dflt="$scriptdir"
9018 Some installations have a separate directory just for executable scripts so
9019 that they can mount it across multiple architectures but keep the scripts in
9020 one spot. You might, for example, have a subdirectory of /usr/share for this.
9021 Or you might just lump your scripts in with all your other executables.
9025 rp='Where do you keep publicly executable scripts?'
9027 if $test "X$ansexp" != "X$scriptdirexp"; then
9033 : A little fix up for an irregularly named variable.
9034 installscript="$installscriptdir"
9036 : determine where add-on public executables go
9038 '') dflt=$siteprefix/bin ;;
9042 rp='Pathname where the add-on public executables should be installed?'
9047 : determine where add-on html pages go
9048 : There is no standard location, so try to copy the previously-selected
9049 : directory structure for the core html pages.
9050 case "$sitehtml1dir" in
9051 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9052 *) dflt=$sitehtml1dir ;;
9055 ''|' ') dflt=none ;;
9058 rp='Pathname where the site-specific html pages should be installed?'
9060 prefixvar=sitehtml1dir
9063 : determine where add-on library html pages go
9064 : There is no standard location, so try to copy the previously-selected
9065 : directory structure for the core html pages.
9066 case "$sitehtml3dir" in
9067 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9068 *) dflt=$sitehtml3dir ;;
9071 ''|' ') dflt=none ;;
9074 rp='Pathname where the site-specific library html pages should be installed?'
9076 prefixvar=sitehtml3dir
9079 : determine where add-on manual pages go
9080 case "$siteman1dir" in
9081 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
9082 *) dflt=$siteman1dir ;;
9085 ''|' ') dflt=none ;;
9088 rp='Pathname where the site-specific manual pages should be installed?'
9090 prefixvar=siteman1dir
9093 : determine where add-on library man pages go
9094 case "$siteman3dir" in
9095 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
9096 *) dflt=$siteman3dir ;;
9099 ''|' ') dflt=none ;;
9102 rp='Pathname where the site-specific library manual pages should be installed?'
9104 prefixvar=siteman3dir
9107 : determine where add-on public executable scripts go
9108 case "$sitescript" in
9109 '') dflt=$siteprefix/script
9110 $test -d $dflt || dflt=$sitebin ;;
9111 *) dflt="$sitescript" ;;
9114 rp='Pathname where add-on public executable scripts should be installed?'
9116 prefixvar=sitescript
9119 : Check if faststdio is requested and available
9120 case "$usefaststdio" in
9121 $define|true|[yY]*|'')
9122 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
9132 Perl can be built to use 'fast stdio', which means using the stdio
9133 library but also directly manipulating the stdio buffers to enable
9134 faster I/O. Using stdio is better for backward compatibility (especially
9135 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
9136 interface has been preferred instead of stdio.
9138 If this doesn't make any sense to you, just accept the default '$dflt'.
9140 rp='Use the "fast stdio" if available?'
9143 y|Y) val="$define" ;;
9150 : define an is-a-typedef? function
9151 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9153 "") inclist="sys/types.h";;
9155 eval "varval=\$$var";
9159 for inc in $inclist; do
9160 echo "#include <$inc>" >>temp.c;
9162 echo "#ifdef $type" >> temp.c;
9163 echo "printf(\"We have $type\");" >> temp.c;
9164 echo "#endif" >> temp.c;
9165 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9166 if $contains $type temp.E >/dev/null 2>&1; then
9172 *) eval "$var=\$varval";;
9175 : define an is-a-typedef? function that prompts if the type is not available.
9176 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9178 "") inclist="sys/types.h";;
9180 eval "varval=\$$var";
9184 for inc in $inclist; do
9185 echo "#include <$inc>" >>temp.c;
9187 echo "#ifdef $type" >> temp.c;
9188 echo "printf(\"We have $type\");" >> temp.c;
9189 echo "#endif" >> temp.c;
9190 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9192 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
9193 if $contains $type temp.E >/dev/null 2>&1; then
9194 echo "$type found." >&4;
9197 echo "$type NOT found." >&4;
9203 *) eval "$var=\$varval";;
9206 : see what type lseek is declared as in the kernel
9207 rp="What is the type used for lseek's offset on this system?"
9208 set off_t lseektype long stdio.h sys/types.h
9212 echo "Checking to see how big your file offsets are..." >&4
9214 #include <sys/types.h>
9218 printf("%d\n", (int)sizeof($lseektype));
9223 if eval $compile_ok; then
9224 lseeksize=`$run ./try`
9225 echo "Your file offsets are $lseeksize bytes long."
9229 echo "(I can't seem to compile the test program. Guessing...)"
9230 rp="What is the size of your file offsets (in bytes)?"
9236 : see what type file positions are declared as in the library
9237 rp="What is the type for file position used by fsetpos()?"
9238 set fpos_t fpostype long stdio.h sys/types.h
9241 : Check size for Fpos_t
9244 *_t) zzz="$fpostype" ;;
9247 echo "Checking the size of $zzz..." >&4
9249 #include <sys/types.h>
9256 printf("%d\n", (int)sizeof($fpostype));
9261 if eval $compile_ok; then
9265 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9268 echo "Your $zzz is $fpossize bytes long."
9274 echo "(I can't compile the test program. Guessing...)" >&4
9275 rp="What is the size of your file positions (in bytes)?"
9280 : Check for large file support
9281 # Backward compatibility (uselfs is deprecated).
9283 "$define"|true|[yY]*)
9286 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9288 uselargefiles="$define"
9292 case "$lseeksize:$fpossize" in
9295 You can have files larger than 2 gigabytes.
9298 *) case "$uselargefiles" in
9299 "$undef"|false|[nN]*) dflt='n' ;;
9304 Perl can be built to understand large files (files larger than 2 gigabytes)
9305 on some systems. To do so, Configure can be run with -Duselargefiles.
9307 If this doesn't make any sense to you, just accept the default '$dflt'.
9309 rp='Try to understand large files, if available?'
9312 y|Y) val="$define" ;;
9319 : Look for a hint-file generated 'call-back-unit'. If the
9320 : user has specified that a large files perl is to be built,
9321 : we may need to set or change some other defaults.
9322 if $test -f uselargefiles.cbu; then
9323 echo "Your platform has some specific hints regarding large file builds, using them..."
9324 . ./uselargefiles.cbu
9326 case "$uselargefiles" in
9328 if $test -f uselargefiles.cbu; then
9330 echo "Rechecking to see how big your file offsets are..." >&4
9332 #include <sys/types.h>
9336 printf("%d\n", (int)sizeof($lseektype));
9341 if eval $compile_ok; then
9342 lseeksize=`$run ./try`
9343 $echo "Your file offsets are now $lseeksize bytes long."
9347 echo "(I can't seem to compile the test program. Guessing...)"
9348 rp="What is the size of your file offsets (in bytes)?"
9353 *_t) zzz="$fpostype" ;;
9356 $echo $n "Rechecking the size of $zzz...$c" >&4
9358 #include <sys/types.h>
9365 printf("%d\n", (int)sizeof($fpostype));
9370 if eval $compile_ok; then
9375 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9378 echo " $fpossize bytes." >&4
9384 echo "(I can't compile the test program. Guessing...)" >&4
9385 rp="What is the size of your file positions (in bytes)?"
9394 : Set the vendorbin variables
9395 case "$vendorprefix" in
9396 '') d_vendorbin="$undef"
9400 *) d_vendorbin="$define"
9401 : determine where vendor-supplied executables go.
9402 case "$vendorbin" in
9403 '') dflt=$vendorprefix/bin ;;
9404 *) dflt="$vendorbin" ;;
9407 rp='Pathname for the vendor-supplied executables directory?'
9410 vendorbinexp="$ansexp"
9416 : Set the vendorhtml1dir variables
9417 case "$vendorprefix" in
9418 '') vendorhtml1dir=''
9419 vendorhtml1direxp=''
9421 *) : determine where vendor-supplied html pages go.
9422 : There is no standard location, so try to copy the previously-selected
9423 : directory structure for the core html pages.
9424 : XXX Better default suggestions would be welcome.
9425 case "$vendorhtml1dir" in
9426 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9427 *) dflt=$vendorhtml1dir ;;
9430 ''|' ') dflt=none ;;
9433 rp='Pathname for the vendor-supplied html pages?'
9435 vendorhtml1dir="$ans"
9436 vendorhtml1direxp="$ansexp"
9439 : Use ' ' for none so value is preserved next time through Configure
9440 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9441 prefixvar=vendorhtml1dir
9444 : Set the vendorhtml3dir variables
9445 case "$vendorprefix" in
9446 '') vendorhtml3dir=''
9447 vendorhtml3direxp=''
9449 *) : determine where vendor-supplied module html pages go.
9450 : There is no standard location, so try to copy the previously-selected
9451 : directory structure for the core html pages.
9452 : XXX Better default suggestions would be welcome.
9453 case "$vendorhtml3dir" in
9454 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9455 *) dflt=$vendorhtml3dir ;;
9458 ''|' ') dflt=none ;;
9461 rp='Pathname for the vendor-supplied html pages?'
9463 vendorhtml3dir="$ans"
9464 vendorhtml3direxp="$ansexp"
9467 : Use ' ' for none so value is preserved next time through Configure
9468 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9469 prefixvar=vendorhtml3dir
9472 : Set the vendorman1dir variables
9473 case "$vendorprefix" in
9474 '') vendorman1dir=''
9477 *) : determine where vendor-supplied manual pages go.
9478 case "$vendorman1dir" in
9479 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9480 *) dflt=$vendorman1dir ;;
9483 ''|' ') dflt=none ;;
9486 rp='Pathname for the vendor-supplied manual section 1 pages?'
9488 vendorman1dir="$ans"
9489 vendorman1direxp="$ansexp"
9492 : Use ' ' for none so value is preserved next time through Configure
9493 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9494 prefixvar=vendorman1dir
9497 : Set the vendorman3dir variables
9498 case "$vendorprefix" in
9499 '') vendorman3dir=''
9502 *) : determine where vendor-supplied module manual pages go.
9503 case "$vendorman3dir" in
9504 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9505 *) dflt=$vendorman3dir ;;
9508 ''|' ') dflt=none ;;
9511 rp='Pathname for the vendor-supplied manual section 3 pages?'
9513 vendorman3dir="$ans"
9514 vendorman3direxp="$ansexp"
9517 : Use ' ' for none so value is preserved next time through Configure
9518 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9519 prefixvar=vendorman3dir
9522 : Set the vendorscript variables
9523 case "$vendorprefix" in
9524 '') d_vendorscript="$undef"
9528 *) d_vendorscript="$define"
9529 : determine where vendor-supplied scripts go.
9530 case "$vendorscript" in
9531 '') dflt=$vendorprefix/script
9532 $test -d $dflt || dflt=$vendorbin ;;
9533 *) dflt="$vendorscript" ;;
9537 The installation process will create a directory for
9538 vendor-supplied scripts.
9542 rp='Pathname for the vendor-supplied scripts directory?'
9545 vendorscriptexp="$ansexp"
9548 prefixvar=vendorscript
9551 : script used to emit important warnings
9554 if test \$# -gt 0; then
9559 echo "*** WARNING:" >&4
9560 sed -e 's/^/*** /' <msg >&4
9562 cat msg >>config.msg
9563 echo " " >>config.msg
9569 : see which of string.h or strings.h is needed
9571 strings=`./findhdr string.h`
9572 if $test "$strings" && $test -r "$strings"; then
9573 echo "Using <string.h> instead of <strings.h>." >&4
9577 strings=`./findhdr strings.h`
9578 if $test "$strings" && $test -r "$strings"; then
9579 echo "Using <strings.h> instead of <string.h>." >&4
9581 ./warn "No string header found -- You'll surely have problems."
9587 "$undef") strings=`./findhdr strings.h`;;
9588 *) strings=`./findhdr string.h`;;
9591 : see if qgcvt exists
9595 : Check print/scan long double stuff
9598 if $test X"$d_longdbl" = X"$define"; then
9600 echo "Checking how to print long doubles..." >&4
9602 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
9603 $cat >try.c <<'EOCP'
9604 #include <sys/types.h>
9608 printf("%.3f\n", d);
9612 if eval $compile; then
9616 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
9617 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
9618 echo "We will use %f."
9624 if $test X"$sPRIfldbl" = X; then
9625 $cat >try.c <<'EOCP'
9626 #include <sys/types.h>
9629 long double d = 123.456;
9630 printf("%.3Lf\n", d);
9634 if eval $compile; then
9638 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
9639 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
9640 echo "We will use %Lf."
9646 if $test X"$sPRIfldbl" = X; then
9647 $cat >try.c <<'EOCP'
9648 #include <sys/types.h>
9651 long double d = 123.456;
9652 printf("%.3llf\n", d);
9656 if eval $compile; then
9660 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
9661 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
9662 echo "We will use %llf."
9668 if $test X"$sPRIfldbl" = X; then
9669 $cat >try.c <<'EOCP'
9670 #include <sys/types.h>
9673 long double d = 123.456;
9674 printf("%.3lf\n", d);
9678 if eval $compile; then
9682 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
9683 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
9684 echo "We will use %lf."
9690 if $test X"$sPRIfldbl" = X; then
9691 echo "Cannot figure out how to print long doubles." >&4
9693 sSCNfldbl=$sPRIfldbl # expect consistency
9700 case "$sPRIfldbl" in
9701 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
9702 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
9703 d_SCNfldbl="$undef";
9705 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
9706 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
9707 d_SCNfldbl="$define";
9711 : Check how to convert floats to strings.
9713 if test "X$d_Gconvert" = X; then
9716 echo "Checking for an efficient way to convert floats to strings."
9718 case "$uselongdouble" in
9719 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
9721 case "$d_longdbl" in
9722 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
9724 case "$d_PRIgldbl" in
9725 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
9729 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
9730 char *myname = "gconvert";
9733 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
9734 char *myname = "gcvt";
9737 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
9738 char *myname = "qgcvt";
9739 #define DOUBLETYPE long double
9742 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9744 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
9746 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
9749 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
9751 char *myname = "sprintf";
9755 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9756 #define DOUBLETYPE long double
9758 #define DOUBLETYPE double
9770 # include <string.h>
9772 # include <strings.h>
9775 int checkit(char *expect, char *got)
9777 if (strcmp(expect, got)) {
9778 printf("%s oddity: Expected %s, got %s\n",
9779 myname, expect, got);
9789 /* This must be 1st test on (which?) platform */
9790 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
9791 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
9792 checkit("0.1", buf);
9794 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
9795 checkit("0.01", buf);
9797 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
9798 checkit("0.001", buf);
9800 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
9801 checkit("0.0001", buf);
9803 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
9804 if (strlen(buf) > 5)
9805 checkit("9e-005", buf); /* for Microsoft ?? */
9807 checkit("9e-05", buf);
9809 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
9812 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
9813 checkit("1.1", buf);
9815 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
9816 checkit("1.01", buf);
9818 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
9819 checkit("1.001", buf);
9821 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
9822 checkit("1.0001", buf);
9824 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
9825 checkit("1.00001", buf);
9827 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
9828 checkit("1.000001", buf);
9830 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
9833 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
9836 /* Some Linux gcvt's give 1.e+5 here. */
9837 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
9838 checkit("100000", buf);
9840 /* Some Linux gcvt's give -1.e+5 here. */
9841 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
9842 checkit("-100000", buf);
9844 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
9845 checkit("123.456", buf);
9847 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
9848 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
9849 /* 34 should be enough to scare even long double
9850 * places into using the e notation. */
9851 if (strlen(buf) > 5)
9852 checkit("1e+034", buf); /* for Microsoft */
9854 checkit("1e+34", buf);
9856 /* For Perl, if you add additional tests here, also add them to
9857 * t/base/num.t for benefit of platforms not using Configure or
9858 * overriding d_Gconvert */
9863 : first add preferred functions to our list
9865 for xxx_convert in $gconvert_preference; do
9866 case $xxx_convert in
9867 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
9868 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
9871 : then add any others
9872 for xxx_convert in gconvert gcvt sprintf; do
9875 *) xxx_list="$xxx_list $xxx_convert" ;;
9879 case "$d_longdbl$uselongdouble" in
9881 : again, add prefered functions to our list first
9883 for xxx_convert in $gconvert_ld_preference; do
9884 case $xxx_convert in
9885 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9886 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
9889 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
9890 for xxx_convert in qgcvt sprintf $xxx_list; do
9891 case "$xxx_ld_list" in
9892 $xxx_convert*|*" $xxx_convert"*) ;;
9893 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9896 : if sprintf cannot do long doubles, move it to the end
9897 if test "$d_PRIgldbl" != "$define"; then
9898 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
9900 : if no qgcvt, remove it
9901 if test "$d_qgcvt" != "$define"; then
9902 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
9905 xxx_list="$xxx_ld_list"
9909 for xxx_convert in $xxx_list; do
9910 echo "Trying $xxx_convert..."
9911 $rm -f try try$_o core
9912 set try -DTRY_$xxx_convert
9913 if eval $compile; then
9914 echo "$xxx_convert() found." >&4
9916 echo "I'll use $xxx_convert to convert floats into a string." >&4
9919 echo "...But $xxx_convert didn't work as I expected."
9923 echo "$xxx_convert NOT found." >&4
9927 if test X$xxx_convert = X; then
9928 echo "*** WHOA THERE!!! ***" >&4
9929 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
9933 case "$xxx_convert" in
9934 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
9935 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
9936 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
9937 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
9938 "$define$define$define")
9939 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
9940 "$define$define$undef")
9941 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
9942 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
9950 : see if _fwalk exists
9954 : Initialize h_fcntl
9957 : Initialize h_sysfile
9960 : access call always available on UNIX
9964 : locate the flags for 'access()'
9968 $cat >access.c <<EOCP
9969 #include <sys/types.h>
9974 #include <sys/file.h>
9987 : check sys/file.h first, no particular reason here
9988 if $test `./findhdr sys/file.h` && \
9989 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
9991 echo "<sys/file.h> defines the *_OK access constants." >&4
9992 elif $test `./findhdr fcntl.h` && \
9993 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
9995 echo "<fcntl.h> defines the *_OK access constants." >&4
9996 elif $test `./findhdr unistd.h` && \
9997 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
9998 echo "<unistd.h> defines the *_OK access constants." >&4
10000 echo "I can't find the four *_OK access constants--I'll use mine." >&4
10006 : see if accessx exists
10007 set accessx d_accessx
10010 : see if aintl exists
10014 : see if alarm exists
10018 : see if 64bit time functions exists
10020 set ctime64 d_ctime64
10023 set localtime64 d_localtime64
10026 set gmtime64 d_gmtime64
10029 set mktime64 d_mktime64
10032 set difftime64 d_difftime64
10035 set asctime64 d_asctime64
10038 : see if POSIX threads are available
10039 set pthread.h i_pthread
10042 : define a fucntion to check prototypes
10043 $cat > protochk <<EOSH
10046 optimize="$optimize"
10048 prototype="$prototype"
10051 usethreads=$usethreads
10052 i_pthread=$i_pthread
10053 pthread_h_first=$pthread_h_first
10056 $cat >> protochk <<'EOSH'
10061 while test $# -ge 2; do
10063 $define) echo "#include <$2>" >> try.c ;;
10064 literal) echo "$2" >> try.c ;;
10066 # Extra magic for the benefit of systems that need pthread.h
10067 # to be included early to correctly detect threadsafe functions.
10068 # Such functions must guarantee themselves, though, that the usethreads
10069 # and i_pthread have been defined, before calling protochk.
10070 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
10071 echo "#include <pthread.h>" >> try.c
10076 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
10077 cat >> try.c <<'EOCP'
10078 #ifdef CAN_PROTOTYPE
10079 #define _(args) args
10084 echo "$foo" >> try.c
10085 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
10086 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
10092 $eunicefix protochk
10094 : Define hasproto macro for Configure internal use
10095 hasproto='varname=$1; func=$2; shift; shift;
10096 while $test $# -ge 2; do
10098 $define) echo "#include <$2>";;
10102 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
10103 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
10104 echo "$func() prototype found.";
10107 echo "$func() prototype NOT found.";
10114 : see if sys/types.h has to be included
10115 set sys/types.h i_systypes
10118 : see if sys/select.h has to be included
10119 set sys/select.h i_sysselct
10122 : Define hasfield macro for Configure internal use
10123 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
10124 while $test $# -ge 2; do
10126 $define) echo "#include <$2>";;
10130 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
10132 if eval $compile; then
10141 : see if we should include time.h, sys/time.h, or both
10143 if test "X$timeincl" = X; then
10144 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
10145 $echo $n "I'm now running the test program...$c"
10147 #include <sys/types.h>
10152 #ifdef SYSTIMEKERNEL
10155 #include <sys/time.h>
10158 #include <sys/select.h>
10160 #$i_stdlib I_STDLIB
10162 #include <stdlib.h>
10168 struct timeval bar;
10171 struct timezone tzp;
10173 if (foo.tm_sec == foo.tm_sec)
10176 if (bar.tv_sec == bar.tv_sec)
10183 for s_timezone in '-DS_TIMEZONE' ''; do
10185 for s_timeval in '-DS_TIMEVAL' ''; do
10186 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10187 for i_time in '' '-DI_TIME'; do
10188 for i_systime in '-DI_SYSTIME' ''; do
10191 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10192 if eval $compile; then
10193 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
10197 $echo $n "Succeeded with $flags$c"
10209 *SYSTIMEKERNEL*) i_systimek="$define"
10210 timeincl=`./findhdr sys/time.h`
10211 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10212 *) i_systimek="$undef";;
10215 *I_TIME*) i_time="$define"
10216 timeincl=`./findhdr time.h`" $timeincl"
10217 echo "We'll include <time.h>." >&4;;
10218 *) i_time="$undef";;
10221 *I_SYSTIME*) i_systime="$define"
10222 timeincl=`./findhdr sys/time.h`" $timeincl"
10223 echo "We'll include <sys/time.h>." >&4;;
10224 *) i_systime="$undef";;
10228 : see if struct tm knows about tm_zone
10229 case "$i_systime$i_time" in
10232 echo "Checking to see if your struct tm has tm_zone field..." >&4
10233 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
10241 case "$d_tm_tm_zone" in
10242 "$define") echo "Yes, it does." ;;
10243 *) echo "No, it doesn't." ;;
10245 : see if struct tm knows about tm_gmtoff
10246 case "$i_systime$i_time" in
10249 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
10250 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
10258 case "$d_tm_tm_gmtoff" in
10259 "$define") echo "Yes, it does." ;;
10260 *) echo "No, it doesn't." ;;
10263 : see if asctime_r exists
10264 set asctime_r d_asctime_r
10266 case "$d_asctime_r" in
10268 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10269 case "$d_asctime_r_proto:$usethreads" in
10270 ":define") d_asctime_r_proto=define
10271 set d_asctime_r_proto asctime_r $hdrs
10275 case "$d_asctime_r_proto" in
10277 case "$asctime_r_proto" in
10278 ''|0) try='char* asctime_r(const struct tm*, char*);'
10279 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SB ;;
10281 case "$asctime_r_proto" in
10282 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
10283 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SBI ;;
10285 case "$asctime_r_proto" in
10286 ''|0) try='int asctime_r(const struct tm*, char*);'
10287 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SB ;;
10289 case "$asctime_r_proto" in
10290 ''|0) try='int asctime_r(const struct tm*, char*, int);'
10291 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SBI ;;
10293 case "$asctime_r_proto" in
10294 ''|0) d_asctime_r=undef
10296 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
10297 * ) case "$asctime_r_proto" in
10298 REENTRANT_PROTO*) ;;
10299 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
10301 echo "Prototype: $try" ;;
10304 *) case "$usethreads" in
10305 define) echo "asctime_r has no prototype, not using it." >&4 ;;
10312 *) asctime_r_proto=0
10316 : see if atolf exists
10320 : see if atoll exists
10324 : Look for GCC-style attribute format
10325 case "$d_attribute_format" in
10328 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
10329 $cat >attrib.c <<'EOCP'
10331 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
10333 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10334 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10335 echo "Your C compiler doesn't support __attribute__((format))."
10338 echo "Your C compiler supports __attribute__((format))."
10342 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10346 *) val="$d_attribute_format" ;;
10348 set d_attribute_format
10352 : Look for GCC-style attribute format with null format allowed
10353 case "$d_printf_format_null" in
10354 '') case "$d_attribute_format" in
10357 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
10358 $cat >attrib.c <<EOCP
10360 #$i_stdlib I_STDLIB
10362 #include <stdlib.h>
10364 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
10365 int null_printf (char* pat,...) { return (int)pat; }
10366 int main () { exit(null_printf(NULL)); }
10368 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
10369 : run the executable in case it produces a run-time warning
10370 if $run ./attrib >>attrib.out 2>&1; then
10371 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10372 echo "Your C compiler doesn't allow __printf__ format to be null."
10375 echo "Your C compiler allows __printf__ format to be null."
10379 echo "Your C compiler executable failed with __printf__ format null."
10383 echo "Your C compiler fails with __printf__ format null."
10390 *) val="$d_printf_format_null" ;;
10392 set d_printf_format_null
10396 : Look for GCC-style attribute malloc
10397 case "$d_attribute_malloc" in
10400 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
10401 $cat >attrib.c <<'EOCP'
10403 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
10405 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10406 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10407 echo "Your C compiler doesn't support __attribute__((malloc))."
10410 echo "Your C compiler supports __attribute__((malloc))."
10414 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10418 *) val="$d_attribute_malloc" ;;
10420 set d_attribute_malloc
10424 : Look for GCC-style attribute nonnull
10425 case "$d_attribute_nonnull" in
10428 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
10429 $cat >attrib.c <<'EOCP'
10431 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
10433 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10434 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10435 echo "Your C compiler doesn't support __attribute__((nonnull))."
10438 echo "Your C compiler supports __attribute__((nonnull))."
10442 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10446 *) val="$d_attribute_nonnull" ;;
10448 set d_attribute_nonnull
10452 : Look for GCC-style attribute noreturn
10453 case "$d_attribute_noreturn" in
10456 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
10457 $cat >attrib.c <<'EOCP'
10459 void fall_over_dead( void ) __attribute__((noreturn));
10461 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10462 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10463 echo "Your C compiler doesn't support __attribute__((noreturn))."
10466 echo "Your C compiler supports __attribute__((noreturn))."
10470 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10474 *) val="$d_attribute_noreturn" ;;
10476 set d_attribute_noreturn
10480 : Look for GCC-style attribute pure
10481 case "$d_attribute_pure" in
10484 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
10485 $cat >attrib.c <<'EOCP'
10487 int square( int n ) __attribute__((pure));
10489 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10490 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10491 echo "Your C compiler doesn't support __attribute__((pure))."
10494 echo "Your C compiler supports __attribute__((pure))."
10498 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10502 *) val="$d_attribute_pure" ;;
10504 set d_attribute_pure
10508 : Look for GCC-style attribute unused
10509 case "$d_attribute_unused" in
10512 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
10513 $cat >attrib.c <<'EOCP'
10515 int do_something( int dummy __attribute__((unused)), int n );
10517 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10518 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10519 echo "Your C compiler doesn't support __attribute__((unused))."
10522 echo "Your C compiler supports __attribute__((unused))."
10526 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10530 *) val="$d_attribute_unused" ;;
10532 set d_attribute_unused
10536 : Look for GCC-style attribute deprecated
10537 case "$d_attribute_deprecated" in
10540 echo "Checking whether your compiler can handle __attribute__((deprecated)) ..." >&4
10541 $cat >attrib.c <<'EOCP'
10543 int I_am_deprecated(void) __attribute__((deprecated));
10545 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10546 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10547 echo "Your C compiler doesn't support __attribute__((deprecated))."
10550 echo "Your C compiler supports __attribute__((deprecated))."
10554 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10558 *) val="$d_attribute_deprecated" ;;
10560 set d_attribute_deprecated
10564 : Look for GCC-style attribute warn_unused_result
10565 case "$d_attribute_warn_unused_result" in
10568 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
10569 $cat >attrib.c <<'EOCP'
10571 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
10573 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10574 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10575 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
10578 echo "Your C compiler supports __attribute__((warn_unused_result))."
10582 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10586 *) val="$d_attribute_warn_unused_result" ;;
10588 set d_attribute_warn_unused_result
10592 : see if bcmp exists
10596 : see if bcopy exists
10600 : see if getpgrp exists
10601 set getpgrp d_getpgrp
10604 case "$d_getpgrp" in
10607 echo "Checking to see which flavor of getpgrp is in use..."
10609 #$i_unistd I_UNISTD
10610 #include <sys/types.h>
10612 # include <unistd.h>
10614 #$i_stdlib I_STDLIB
10616 #include <stdlib.h>
10620 if (getuid() == 0) {
10621 printf("(I see you are running Configure as super-user...)\n");
10624 #ifdef TRY_BSD_PGRP
10625 if (getpgrp(1) == 0)
10634 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10635 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
10637 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10638 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
10641 echo "I can't seem to compile and run the test program."
10643 xxx="a USG one, i.e. you use getpgrp()."
10645 # SVR4 systems can appear rather BSD-ish.
10646 case "$i_unistd" in
10648 xxx="a BSD one, i.e. you use getpgrp(pid)."
10652 xxx="probably a USG one, i.e. you use getpgrp()."
10657 echo "Assuming your getpgrp is $xxx" >&4
10666 : see if setpgrp exists
10667 set setpgrp d_setpgrp
10670 case "$d_setpgrp" in
10673 echo "Checking to see which flavor of setpgrp is in use..."
10675 #$i_unistd I_UNISTD
10676 #include <sys/types.h>
10678 # include <unistd.h>
10680 #$i_stdlib I_STDLIB
10682 #include <stdlib.h>
10686 if (getuid() == 0) {
10687 printf("(I see you are running Configure as super-user...)\n");
10690 #ifdef TRY_BSD_PGRP
10691 if (-1 == setpgrp(1, 1))
10694 if (setpgrp() != -1)
10700 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10701 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
10703 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10704 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
10707 echo "(I can't seem to compile and run the test program.)"
10709 xxx="a USG one, i.e. you use setpgrp()."
10711 # SVR4 systems can appear rather BSD-ish.
10712 case "$i_unistd" in
10714 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
10718 xxx="probably a USG one, i.e. you use setpgrp()."
10723 echo "Assuming your setpgrp is $xxx" >&4
10732 : Look for GCC-style __builtin_choose_expr
10733 case "$d_builtin_choose_expr" in
10736 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
10737 $cat >try.c <<'EOCP'
10738 #include <assert.h>
10739 #include <stdlib.h>
10742 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
10745 assert( SYRINX(1) == 2112 );
10746 assert( SYRINX(1) != 5150 );
10747 assert( SYRINX(0) == 5150 );
10748 assert( SYRINX(0) != 2112 );
10749 puts( "All good!" );
10755 if eval $compile && $run ./try; then
10756 echo "Your C compiler supports __builtin_choose_expr."
10759 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10763 *) val="$d_builtin_choose_expr" ;;
10766 set d_builtin_choose_expr
10770 : Look for GCC-style __builtin_expect
10771 case "$d_builtin_expect" in
10774 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
10775 $cat >try.c <<'EOCP'
10778 if ( __builtin_expect(n, 0) ) n = 1;
10779 /* Remember shell exit code truth is 0, C truth is non-zero */
10784 if eval $compile && $run ./try; then
10785 echo "Your C compiler supports __builtin_expect."
10788 echo "Your C compiler doesn't seem to understand __builtin_expect."
10792 *) val="$d_builtin_expect" ;;
10795 set d_builtin_expect
10799 : see if bzero exists
10803 : see if stdarg is available
10805 if $test `./findhdr stdarg.h`; then
10806 echo "<stdarg.h> found." >&4
10809 echo "<stdarg.h> NOT found." >&4
10813 : see if varags is available
10815 if $test `./findhdr varargs.h`; then
10816 echo "<varargs.h> found." >&4
10818 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
10821 : set up the varargs testing programs
10822 $cat > varargs.c <<EOP
10824 #include <stdarg.h>
10827 #include <varargs.h>
10831 int f(char *p, ...)
10845 p = va_arg(ap, char *);
10851 $cat > varargs <<EOP
10853 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
10862 : now check which varargs header should be included
10867 if `./varargs I_STDARG`; then
10869 elif `./varargs I_VARARGS`; then
10874 if `./varargs I_VARARGS`; then
10881 echo "I could not find the definition for va_dcl... You have problems..." >&4
10882 val="$undef"; set i_stdarg; eval $setvar
10883 val="$undef"; set i_varargs; eval $setvar
10888 case "$i_varhdr" in
10890 val="$define"; set i_stdarg; eval $setvar
10891 val="$undef"; set i_varargs; eval $setvar
10894 val="$undef"; set i_stdarg; eval $setvar
10895 val="$define"; set i_varargs; eval $setvar
10898 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
10902 : see if the Compiler supports C99 variadic macros
10903 case "$i_stdarg$i_stdlib" in
10905 echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
10908 #include <stdarg.h>
10910 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
10914 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
10920 if eval $compile && $run ./try 2>&1 >/dev/null; then
10921 case "`$run ./try`" in
10923 echo "You have C99 variadic macros." >&4
10924 d_c99_variadic_macros="$define"
10927 echo "You don't have functional C99 variadic macros." >&4
10928 d_c99_variadic_macros="$undef"
10932 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
10933 d_c99_variadic_macros="$undef"
10938 echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
10939 d_c99_variadic_macros="$undef"
10943 : see if signal is declared as pointer to function returning int or void
10945 xxx=`./findhdr signal.h`
10946 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
10947 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10948 echo "You have int (*signal())() instead of void." >&4
10950 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10951 echo "You have void (*signal())()." >&4
10953 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
10954 echo "You have int (*signal())() instead of void." >&4
10956 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
10957 echo "You have void (*signal())()." >&4
10960 case "$d_voidsig" in
10962 echo "I can't determine whether signal handler returns void or int..." >&4
10964 rp="What type does your signal handler return?"
10967 v*) val="$define";;
10971 echo "As you already told me, signal handler returns void." >&4
10974 *) echo "As you already told me, signal handler returns int." >&4
10981 case "$d_voidsig" in
10982 "$define") signal_t="void";;
10983 *) signal_t="int";;
10987 : check for ability to cast large floats to 32-bit ints.
10989 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
10990 if $test "$intsize" -ge 4; then
10997 #$i_stdlib I_STDLIB
10999 #include <stdlib.h>
11001 #include <sys/types.h>
11002 #include <signal.h>
11003 $signal_t blech(int s) { exit(3); }
11010 signal(SIGFPE, blech);
11012 /* Don't let compiler optimize the test away. Store the number
11013 in a writable string for gcc to pass to sscanf under HP/UX.
11015 sprintf(str, "2147483647");
11016 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
11020 /* x86 processors will probably give 0x8000 0000, which is a
11021 sign change. We don't want that. We want to mimic SPARC
11022 behavior here, which is to preserve the sign and give
11025 if (i32 != ($xxx) f)
11031 if eval $compile_ok; then
11035 echo "(I can't seem to compile the test program--assuming it can't)"
11040 echo "Yup, it can."
11043 echo "Nope, it can't."
11050 : check for ability to cast negative floats to unsigned
11052 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
11055 #$i_stdlib I_STDLIB
11057 #include <stdlib.h>
11059 #include <sys/types.h>
11060 #include <signal.h>
11061 $signal_t blech(int s) { exit(7); }
11062 $signal_t blech_in_list(int s) { exit(4); }
11063 unsigned long dummy_long(unsigned long p) { return p; }
11064 unsigned int dummy_int(unsigned int p) { return p; }
11065 unsigned short dummy_short(unsigned short p) { return p; }
11069 unsigned long along;
11071 unsigned short ashort;
11075 /* Frustrate gcc-2.7.2's optimizer which failed this test with
11076 a direct f = -123. assignment. gcc-2.8.0 reportedly
11077 optimized the whole file away
11079 /* Store the number in a writable string for gcc to pass to
11080 sscanf under HP/UX.
11082 sprintf(str, "-123");
11083 sscanf(str, "%lf", &f); /* f = -123.; */
11085 signal(SIGFPE, blech);
11086 along = (unsigned long)f;
11087 aint = (unsigned int)f;
11088 ashort = (unsigned short)f;
11089 if (along != (unsigned long)-123)
11091 if (aint != (unsigned int)-123)
11093 if (ashort != (unsigned short)-123)
11095 sprintf(str, "1073741824.");
11096 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
11099 along = (unsigned long)f;
11100 if (along != 0x80000000)
11104 along = (unsigned long)f;
11105 if (along != 0x7fffffff)
11109 along = (unsigned long)f;
11110 if (along != 0x80000001)
11114 signal(SIGFPE, blech_in_list);
11115 sprintf(str, "123.");
11116 sscanf(str, "%lf", &f); /* f = 123.; */
11117 along = dummy_long((unsigned long)f);
11118 aint = dummy_int((unsigned int)f);
11119 ashort = dummy_short((unsigned short)f);
11120 if (along != (unsigned long)123)
11122 if (aint != (unsigned int)123)
11124 if (ashort != (unsigned short)123)
11131 if eval $compile_ok; then
11135 echo "(I can't seem to compile the test program--assuming it can't)"
11138 case "$castflags" in
11140 echo "Yup, it can."
11143 echo "Nope, it can't."
11150 : see if vprintf exists
11152 if set vprintf val -f d_vprintf; eval $csym; $val; then
11153 echo 'vprintf() found.' >&4
11156 #$i_stdarg I_STDARG /* Only one of these can be defined by i_varhrd */
11157 #$i_varargs I_VARARGS
11159 #$i_stdlib I_STDLIB
11160 #$i_unistd I_UNISTD
11163 # include <stdarg.h>
11164 #else /* I_VARARGS */
11165 # include <varargs.h>
11169 # include <unistd.h>
11173 # include <stdlib.h>
11176 #include <stdio.h> /* vsprintf prototype */
11179 void xxx(int n, ...)
11184 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11186 int main() { xxx(1, "foo"); }
11188 #else /* I_VARARGS */
11196 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11198 int main() { xxx("foo"); }
11204 if eval $compile_ok; then
11205 if $run ./try; then
11206 echo "Your vsprintf() returns (int)." >&4
11209 echo "Your vsprintf() returns (char*)." >&4
11213 echo 'I am unable to compile the vsprintf() test program.' >&4
11214 # We shouldn't get here. If we do, assume the standard signature,
11215 # not the old BSD one.
11216 echo 'Guessing that vsprintf() returns (int).' >&4
11220 echo 'vprintf() NOT found.' >&4
11231 : see if chown exists
11235 : see if chroot exists
11236 set chroot d_chroot
11239 : see if chsize exists
11240 set chsize d_chsize
11243 : see if class exists
11247 : see if clearenv exists
11248 set clearenv d_clearenv
11251 : Define hasstruct macro for Configure internal use
11252 hasstruct='varname=$1; struct=$2; shift; shift;
11253 while $test $# -ge 2; do
11255 $define) echo "#include <$2>";;
11259 echo "int main () { struct $struct foo; }" >> try.c;
11261 if eval $compile; then
11270 : see whether socket exists
11274 $echo $n "Hmm... $c" >&4
11275 if set socket val -f d_socket; eval $csym; $val; then
11276 echo "Looks like you have Berkeley networking support." >&4
11278 if set setsockopt val -f; eval $csym; $val; then
11281 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
11282 d_oldsock="$define"
11285 if $contains socklib libc.list >/dev/null 2>&1; then
11286 echo "Looks like you have Berkeley networking support." >&4
11288 : we will have to assume that it supports the 4.2 BSD interface
11291 echo "You don't have Berkeley networking in libc$_a..." >&4
11292 if test "X$d_socket" = "X$define"; then
11293 echo "...but you seem to believe that you have sockets." >&4
11295 for net in net socket
11297 if test -f /usr/lib/lib$net$_a; then
11298 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
11299 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
11300 if $contains socket libc.list >/dev/null 2>&1; then
11305 echo "...but the Wollongong group seems to have hacked it in." >&4
11306 sockethdr="-I/usr/netinclude"
11309 echo "Found Berkeley sockets interface in lib$net." >&4
11310 if $contains setsockopt libc.list >/dev/null 2>&1; then
11313 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
11314 d_oldsock="$define"
11320 if test "X$d_socket" != "X$define"; then
11321 echo "or anywhere else I see." >&4
11329 : see if socketpair exists
11330 set socketpair d_sockpair
11335 echo "Checking the availability of certain socket constants..." >&4
11336 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
11337 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
11339 #include <sys/types.h>
11340 #include <sys/socket.h>
11346 set try; if eval $compile; then
11349 set d_${enum}; eval $setvar
11353 : see if this is a sys/uio.h system
11354 set sys/uio.h i_sysuio
11357 : Check for cmsghdr support
11359 echo "Checking to see if your system supports struct cmsghdr..." >&4
11360 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
11362 case "$d_cmsghdr_s" in
11363 "$define") echo "Yes, it does." ;;
11364 *) echo "No, it doesn't." ;;
11368 : check for const keyword
11370 echo 'Checking to see if your C compiler knows about "const"...' >&4
11371 $cat >const.c <<'EOCP'
11372 typedef struct spug { int drokk; } spug;
11376 const spug y = { 0 };
11379 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
11381 echo "Yup, it does."
11384 echo "Nope, it doesn't."
11389 : see if copysignl exists
11390 set copysignl d_copysignl
11393 : see if crypt exists
11398 $define) cryptlib='' ;;
11399 *) if set crypt val -f d_crypt; eval $csym; $val; then
11400 echo 'crypt() found.' >&4
11404 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
11405 if $test -z "$cryptlib"; then
11406 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
11410 if $test -z "$cryptlib"; then
11411 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
11415 if $test -z "$cryptlib"; then
11416 cryptlib=`./loc libcrypt$_a "" $libpth`
11420 if $test -z "$cryptlib"; then
11421 echo 'crypt() NOT found.' >&4
11432 : see if this is a crypt.h system
11433 set crypt.h i_crypt
11436 : see if crypt_r exists
11437 set crypt_r d_crypt_r
11439 case "$d_crypt_r" in
11441 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
11442 case "$d_crypt_r_proto:$usethreads" in
11443 ":define") d_crypt_r_proto=define
11444 set d_crypt_r_proto crypt_r $hdrs
11448 case "$d_crypt_r_proto" in
11450 case "$crypt_r_proto" in
11451 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
11452 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCS ;;
11454 case "$crypt_r_proto" in
11455 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
11456 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCD ;;
11458 case "$crypt_r_proto" in
11459 ''|0) d_crypt_r=undef
11461 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
11462 * ) case "$crypt_r_proto" in
11463 REENTRANT_PROTO*) ;;
11464 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
11466 echo "Prototype: $try" ;;
11469 *) case "$usethreads" in
11470 define) echo "crypt_r has no prototype, not using it." >&4 ;;
11481 : get csh whereabouts
11483 'csh') val="$undef" ;;
11484 *) val="$define" ;;
11488 : Respect a hint or command line value for full_csh.
11489 case "$full_csh" in
11490 '') full_csh=$csh ;;
11493 : see if ctermid exists
11494 set ctermid d_ctermid
11497 : see if ctermid_r exists
11498 set ctermid_r d_ctermid_r
11500 case "$d_ctermid_r" in
11502 hdrs="$i_systypes sys/types.h define stdio.h "
11503 case "$d_ctermid_r_proto:$usethreads" in
11504 ":define") d_ctermid_r_proto=define
11505 set d_ctermid_r_proto ctermid_r $hdrs
11509 case "$d_ctermid_r_proto" in
11511 case "$ctermid_r_proto" in
11512 ''|0) try='char* ctermid_r(char*);'
11513 ./protochk "$extern_C $try" $hdrs && ctermid_r_proto=B_B ;;
11515 case "$ctermid_r_proto" in
11516 ''|0) d_ctermid_r=undef
11518 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
11519 * ) case "$ctermid_r_proto" in
11520 REENTRANT_PROTO*) ;;
11521 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
11523 echo "Prototype: $try" ;;
11526 *) case "$usethreads" in
11527 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
11534 *) ctermid_r_proto=0
11538 : see if ctime_r exists
11539 set ctime_r d_ctime_r
11541 case "$d_ctime_r" in
11543 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
11544 case "$d_ctime_r_proto:$usethreads" in
11545 ":define") d_ctime_r_proto=define
11546 set d_ctime_r_proto ctime_r $hdrs
11550 case "$d_ctime_r_proto" in
11552 case "$ctime_r_proto" in
11553 ''|0) try='char* ctime_r(const time_t*, char*);'
11554 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SB ;;
11556 case "$ctime_r_proto" in
11557 ''|0) try='char* ctime_r(const time_t*, char*, int);'
11558 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SBI ;;
11560 case "$ctime_r_proto" in
11561 ''|0) try='int ctime_r(const time_t*, char*);'
11562 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SB ;;
11564 case "$ctime_r_proto" in
11565 ''|0) try='int ctime_r(const time_t*, char*, int);'
11566 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SBI ;;
11568 case "$ctime_r_proto" in
11569 ''|0) d_ctime_r=undef
11571 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
11572 * ) case "$ctime_r_proto" in
11573 REENTRANT_PROTO*) ;;
11574 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
11576 echo "Prototype: $try" ;;
11579 *) case "$usethreads" in
11580 define) echo "ctime_r has no prototype, not using it." >&4 ;;
11591 : see if cuserid exists
11592 set cuserid d_cuserid
11595 : see if this is a limits.h system
11596 set limits.h i_limits
11599 : see if this is a float.h system
11600 set float.h i_float
11603 : See if number of significant digits in a double precision number is known
11605 $cat >dbl_dig.c <<EOM
11606 #$i_limits I_LIMITS
11609 #include <limits.h>
11615 printf("Contains DBL_DIG");
11618 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
11619 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
11620 echo "DBL_DIG found." >&4
11623 echo "DBL_DIG NOT found." >&4
11630 : see if dbm.h is available
11631 : see if dbmclose exists
11632 set dbmclose d_dbmclose
11635 case "$d_dbmclose" in
11645 *) set rpcsvc/dbm.h i_rpcsvcdbm
11650 *) echo "We won't be including <dbm.h>"
11660 : see if prototype for dbminit is available
11662 set d_dbminitproto dbminit $i_dbm dbm.h
11665 : see if difftime exists
11666 set difftime d_difftime
11669 : see if this is a dirent system
11671 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
11673 echo "<dirent.h> found." >&4
11676 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
11677 echo "<sys/dir.h> found." >&4
11680 xinc=`./findhdr sys/ndir.h`
11682 echo "<dirent.h> NOT found." >&4
11687 : Look for type of directory structure.
11689 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11691 case "$direntrytype" in
11693 case "$i_dirent" in
11694 $define) guess1='struct dirent' ;;
11695 *) guess1='struct direct' ;;
11698 *) guess1="$direntrytype"
11703 'struct dirent') guess2='struct direct' ;;
11704 *) guess2='struct dirent' ;;
11707 if $contains "$guess1" try.c >/dev/null 2>&1; then
11708 direntrytype="$guess1"
11709 echo "Your directory entries are $direntrytype." >&4
11710 elif $contains "$guess2" try.c >/dev/null 2>&1; then
11711 direntrytype="$guess2"
11712 echo "Your directory entries seem to be $direntrytype." >&4
11714 echo "I don't recognize your system's directory entries." >&4
11715 rp="What type is used for directory entries on this system?"
11718 direntrytype="$ans"
11722 : see if the directory entry stores field length
11724 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11725 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
11726 echo "Good, your directory entry keeps length information in d_namlen." >&4
11729 echo "Your directory entry does not know about the d_namlen field." >&4
11736 : Look for DIR.dd_fd
11737 case "$i_dirent" in
11739 echo "Checking to see if DIR has a dd_fd member variable" >&4
11741 #$i_stdlib I_STDLIB
11743 #include <stdlib.h>
11745 #include <dirent.h>
11755 if eval $compile; then
11756 echo "Yes, it does."
11759 echo "No, it does not."
11764 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
11772 : see if this is an sysdir system
11773 set sys/dir.h i_sysdir
11776 : see if this is an sysndir system
11777 set sys/ndir.h i_sysndir
11782 $cat >dirfd.c <<EOM
11784 #$i_stdlib I_STDLIB
11786 #include <stdlib.h>
11788 #$i_dirent I_DIRENT /**/
11789 #$i_sysdir I_SYS_DIR /**/
11790 #$i_sysndir I_SYS_NDIR /**/
11791 #$i_systypes I_SYS_TYPES /**/
11792 #if defined(I_SYS_TYPES)
11793 #include <sys/types.h>
11795 #if defined(I_DIRENT)
11796 #include <dirent.h>
11797 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
11798 #include <sys/dir.h>
11802 #include <sys/ndir.h>
11806 #include <ndir.h> /* may be wrong in the future */
11808 #include <sys/dir.h>
11814 DIR *dirp = opendir(".");
11815 if (dirfd(dirp) >= 0)
11823 if eval $compile; then
11827 $define) echo "dirfd() found." >&4 ;;
11828 *) echo "dirfd() NOT found." >&4 ;;
11834 : see if dlerror exists
11837 set dlerror d_dlerror
11841 : see if dlfcn is available
11842 set dlfcn.h i_dlfcn
11845 : Check what extension to use for shared libs
11850 On a few systems, the dynamically loaded modules that perl generates and uses
11851 will need a different extension than shared libs. The default will probably
11857 *) dflt="$dlext" ;;
11859 rp='What is the extension of dynamically loaded modules'
11868 : Check if dlsym need a leading underscore
11874 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
11875 $cat >dyna.c <<'EOM'
11882 #$i_stdlib I_STDLIB
11884 #include <stdlib.h>
11888 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
11890 #include <sys/types.h>
11895 extern int fred() ;
11904 int mode = RTLD_LAZY ;
11906 handle = dlopen("./dyna.$dlext", mode) ;
11907 if (handle == NULL) {
11912 symbol = dlsym(handle, "fred") ;
11913 if (symbol == NULL) {
11914 /* try putting a leading underscore */
11915 symbol = dlsym(handle, "_fred") ;
11916 if (symbol == NULL) {
11929 : Call the object file tmp-dyna.o in case dlext=o.
11930 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
11931 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
11932 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
11933 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
11936 1) echo "Test program failed using dlopen." >&4
11937 echo "Perhaps you should not use dynamic loading." >&4;;
11938 2) echo "Test program failed using dlsym." >&4
11939 echo "Perhaps you should not use dynamic loading." >&4;;
11940 3) echo "dlsym needs a leading underscore" >&4
11942 4) echo "dlsym doesn't need a leading underscore." >&4;;
11945 echo "I can't compile and run the test program." >&4
11946 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
11951 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
11956 : see if drand48_r exists
11957 set drand48_r d_drand48_r
11959 case "$d_drand48_r" in
11961 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
11962 case "$d_drand48_r_proto:$usethreads" in
11963 ":define") d_drand48_r_proto=define
11964 set d_drand48_r_proto drand48_r $hdrs
11968 case "$d_drand48_r_proto" in
11970 case "$drand48_r_proto" in
11971 ''|0) try='int drand48_r(struct drand48_data*, double*);'
11972 ./protochk "$extern_C $try" $hdrs && drand48_r_proto=I_ST ;;
11974 case "$drand48_r_proto" in
11975 ''|0) d_drand48_r=undef
11977 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
11978 * ) case "$drand48_r_proto" in
11979 REENTRANT_PROTO*) ;;
11980 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
11982 echo "Prototype: $try" ;;
11985 *) case "$usethreads" in
11986 define) echo "drand48_r has no prototype, not using it." >&4 ;;
11993 *) drand48_r_proto=0
11997 : see if prototype for drand48 is available
11999 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
12002 : see if dup2 exists
12006 : see if eaccess exists
12007 set eaccess d_eaccess
12010 : see if endgrent exists
12011 set endgrent d_endgrent
12014 : see if this is an grp system
12020 xxx=`./findhdr grp.h`
12021 $cppstdin $cppflags $cppminus < $xxx >$$.h
12023 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
12035 set d_grpasswd; eval $setvar
12039 : see if endgrent_r exists
12040 set endgrent_r d_endgrent_r
12042 case "$d_endgrent_r" in
12044 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12045 case "$d_endgrent_r_proto:$usethreads" in
12046 ":define") d_endgrent_r_proto=define
12047 set d_endgrent_r_proto endgrent_r $hdrs
12051 case "$d_endgrent_r_proto" in
12053 case "$endgrent_r_proto" in
12054 ''|0) try='int endgrent_r(FILE**);'
12055 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=I_H ;;
12057 case "$endgrent_r_proto" in
12058 ''|0) try='void endgrent_r(FILE**);'
12059 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=V_H ;;
12061 case "$endgrent_r_proto" in
12062 ''|0) d_endgrent_r=undef
12064 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
12065 * ) case "$endgrent_r_proto" in
12066 REENTRANT_PROTO*) ;;
12067 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
12069 echo "Prototype: $try" ;;
12072 *) case "$usethreads" in
12073 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
12080 *) endgrent_r_proto=0
12084 : see if endhostent exists
12085 set endhostent d_endhent
12088 : see if this is a netdb.h system
12089 set netdb.h i_netdb
12092 : see if endhostent_r exists
12093 set endhostent_r d_endhostent_r
12095 case "$d_endhostent_r" in
12097 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12098 case "$d_endhostent_r_proto:$usethreads" in
12099 ":define") d_endhostent_r_proto=define
12100 set d_endhostent_r_proto endhostent_r $hdrs
12104 case "$d_endhostent_r_proto" in
12106 case "$endhostent_r_proto" in
12107 ''|0) try='int endhostent_r(struct hostent_data*);'
12108 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=I_D ;;
12110 case "$endhostent_r_proto" in
12111 ''|0) try='void endhostent_r(struct hostent_data*);'
12112 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=V_D ;;
12114 case "$endhostent_r_proto" in
12115 ''|0) d_endhostent_r=undef
12116 endhostent_r_proto=0
12117 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
12118 * ) case "$endhostent_r_proto" in
12119 REENTRANT_PROTO*) ;;
12120 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
12122 echo "Prototype: $try" ;;
12125 *) case "$usethreads" in
12126 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
12128 d_endhostent_r=undef
12129 endhostent_r_proto=0
12133 *) endhostent_r_proto=0
12137 : see if endnetent exists
12138 set endnetent d_endnent
12141 : see if endnetent_r exists
12142 set endnetent_r d_endnetent_r
12144 case "$d_endnetent_r" in
12146 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12147 case "$d_endnetent_r_proto:$usethreads" in
12148 ":define") d_endnetent_r_proto=define
12149 set d_endnetent_r_proto endnetent_r $hdrs
12153 case "$d_endnetent_r_proto" in
12155 case "$endnetent_r_proto" in
12156 ''|0) try='int endnetent_r(struct netent_data*);'
12157 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=I_D ;;
12159 case "$endnetent_r_proto" in
12160 ''|0) try='void endnetent_r(struct netent_data*);'
12161 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=V_D ;;
12163 case "$endnetent_r_proto" in
12164 ''|0) d_endnetent_r=undef
12165 endnetent_r_proto=0
12166 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
12167 * ) case "$endnetent_r_proto" in
12168 REENTRANT_PROTO*) ;;
12169 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
12171 echo "Prototype: $try" ;;
12174 *) case "$usethreads" in
12175 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
12177 d_endnetent_r=undef
12178 endnetent_r_proto=0
12182 *) endnetent_r_proto=0
12186 : see if endprotoent exists
12187 set endprotoent d_endpent
12190 : see if endprotoent_r exists
12191 set endprotoent_r d_endprotoent_r
12193 case "$d_endprotoent_r" in
12195 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12196 case "$d_endprotoent_r_proto:$usethreads" in
12197 ":define") d_endprotoent_r_proto=define
12198 set d_endprotoent_r_proto endprotoent_r $hdrs
12202 case "$d_endprotoent_r_proto" in
12204 case "$endprotoent_r_proto" in
12205 ''|0) try='int endprotoent_r(struct protoent_data*);'
12206 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=I_D ;;
12208 case "$endprotoent_r_proto" in
12209 ''|0) try='void endprotoent_r(struct protoent_data*);'
12210 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=V_D ;;
12212 case "$endprotoent_r_proto" in
12213 ''|0) d_endprotoent_r=undef
12214 endprotoent_r_proto=0
12215 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
12216 * ) case "$endprotoent_r_proto" in
12217 REENTRANT_PROTO*) ;;
12218 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
12220 echo "Prototype: $try" ;;
12223 *) case "$usethreads" in
12224 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
12226 d_endprotoent_r=undef
12227 endprotoent_r_proto=0
12231 *) endprotoent_r_proto=0
12235 : see if endpwent exists
12236 set endpwent d_endpwent
12239 : see if this is a pwd.h system
12245 xxx=`./findhdr pwd.h`
12246 $cppstdin $cppflags $cppminus < $xxx >$$.h
12248 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
12256 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
12264 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
12272 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
12280 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
12288 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
12296 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
12304 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
12316 set d_pwquota; eval $setvar
12317 set d_pwage; eval $setvar
12318 set d_pwchange; eval $setvar
12319 set d_pwclass; eval $setvar
12320 set d_pwexpire; eval $setvar
12321 set d_pwcomment; eval $setvar
12322 set d_pwgecos; eval $setvar
12323 set d_pwpasswd; eval $setvar
12327 : see if endpwent_r exists
12328 set endpwent_r d_endpwent_r
12330 case "$d_endpwent_r" in
12332 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
12333 case "$d_endpwent_r_proto:$usethreads" in
12334 ":define") d_endpwent_r_proto=define
12335 set d_endpwent_r_proto endpwent_r $hdrs
12339 case "$d_endpwent_r_proto" in
12341 case "$endpwent_r_proto" in
12342 ''|0) try='int endpwent_r(FILE**);'
12343 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=I_H ;;
12345 case "$endpwent_r_proto" in
12346 ''|0) try='void endpwent_r(FILE**);'
12347 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=V_H ;;
12349 case "$endpwent_r_proto" in
12350 ''|0) d_endpwent_r=undef
12352 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
12353 * ) case "$endpwent_r_proto" in
12354 REENTRANT_PROTO*) ;;
12355 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
12357 echo "Prototype: $try" ;;
12360 *) case "$usethreads" in
12361 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
12368 *) endpwent_r_proto=0
12372 : see if endservent exists
12373 set endservent d_endsent
12376 : see if endservent_r exists
12377 set endservent_r d_endservent_r
12379 case "$d_endservent_r" in
12381 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12382 case "$d_endservent_r_proto:$usethreads" in
12383 ":define") d_endservent_r_proto=define
12384 set d_endservent_r_proto endservent_r $hdrs
12388 case "$d_endservent_r_proto" in
12390 case "$endservent_r_proto" in
12391 ''|0) try='int endservent_r(struct servent_data*);'
12392 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=I_D ;;
12394 case "$endservent_r_proto" in
12395 ''|0) try='void endservent_r(struct servent_data*);'
12396 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=V_D ;;
12398 case "$endservent_r_proto" in
12399 ''|0) d_endservent_r=undef
12400 endservent_r_proto=0
12401 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
12402 * ) case "$endservent_r_proto" in
12403 REENTRANT_PROTO*) ;;
12404 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
12406 echo "Prototype: $try" ;;
12409 *) case "$usethreads" in
12410 define) echo "endservent_r has no prototype, not using it." >&4 ;;
12412 d_endservent_r=undef
12413 endservent_r_proto=0
12417 *) endservent_r_proto=0
12421 : Locate the flags for 'open()'
12424 #include <sys/types.h>
12429 #include <sys/file.h>
12431 #$i_stdlib I_STDLIB
12433 #include <stdlib.h>
12444 : check sys/file.h first to get FREAD on Sun
12445 if $test `./findhdr sys/file.h` && \
12446 set try -DI_SYS_FILE && eval $compile; then
12448 echo "<sys/file.h> defines the O_* constants..." >&4
12449 if $run ./try; then
12450 echo "and you have the 3 argument form of open()." >&4
12453 echo "but not the 3 argument form of open(). Oh, well." >&4
12456 elif $test `./findhdr fcntl.h` && \
12457 set try -DI_FCNTL && eval $compile; then
12459 echo "<fcntl.h> defines the O_* constants..." >&4
12460 if $run ./try; then
12461 echo "and you have the 3 argument form of open()." >&4
12464 echo "but not the 3 argument form of open(). Oh, well." >&4
12469 echo "I can't find the O_* constant definitions! You got problems." >&4
12475 : see if this is a sys/file.h system
12480 : do we need to include sys/file.h ?
12484 if $h_sysfile; then
12486 echo "We'll be including <sys/file.h>." >&4
12489 echo "We won't be including <sys/file.h>." >&4
12499 : see if fcntl.h is there
12504 : see if we can include fcntl.h
12510 echo "We'll be including <fcntl.h>." >&4
12513 if $h_sysfile; then
12514 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
12516 echo "We won't be including <fcntl.h>." >&4
12528 : see if fork exists
12532 : see if pipe exists
12536 : check for non-blocking I/O stuff
12537 case "$h_sysfile" in
12538 true) echo "#include <sys/file.h>" > head.c;;
12541 true) echo "#include <fcntl.h>" > head.c;;
12542 *) echo "#include <sys/fcntl.h>" > head.c;;
12547 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
12548 case "$o_nonblock" in
12550 $cat head.c > try.c
12551 $cat >>try.c <<EOCP
12553 #$i_stdlib I_STDLIB
12555 #include <stdlib.h>
12563 printf("O_NONBLOCK\n");
12567 printf("O_NDELAY\n");
12571 printf("FNDELAY\n");
12578 if eval $compile_ok; then
12579 o_nonblock=`$run ./try`
12580 case "$o_nonblock" in
12581 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
12582 *) echo "Seems like we can use $o_nonblock.";;
12585 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
12588 *) echo "Using $hint value $o_nonblock.";;
12593 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
12596 case "$d_fork:$d_pipe" in
12598 $cat head.c > try.c
12599 $cat >>try.c <<EOCP
12601 #include <sys/types.h>
12602 #include <signal.h>
12604 #$i_stdlib I_STDLIB
12606 #include <stdlib.h>
12612 #define MY_O_NONBLOCK $o_nonblock
12613 #ifndef errno /* XXX need better Configure test */
12616 #$i_unistd I_UNISTD
12618 #include <unistd.h>
12620 #$i_string I_STRING
12622 #include <string.h>
12624 #include <strings.h>
12626 $signal_t blech(int x) { exit(3); }
12628 $cat >> try.c <<'EOCP'
12636 pipe(pd); /* Down: child -> parent */
12637 pipe(pu); /* Up: parent -> child */
12640 close(pd[1]); /* Parent reads from pd[0] */
12641 close(pu[0]); /* Parent writes (blocking) to pu[1] */
12643 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
12648 signal(SIGALRM, blech);
12650 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
12652 sprintf(string, "%d\n", ret);
12653 write(2, string, strlen(string));
12656 if (errno == EAGAIN) {
12657 printf("EAGAIN\n");
12662 if (errno == EWOULDBLOCK)
12663 printf("EWOULDBLOCK\n");
12666 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
12667 sleep(2); /* Give it time to close our pipe */
12669 ret = read(pd[0], buf, 1); /* Should read EOF */
12671 sprintf(string, "%d\n", ret);
12672 write(4, string, strlen(string));
12676 close(pd[0]); /* We write to pd[1] */
12677 close(pu[1]); /* We read from pu[0] */
12678 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
12679 close(pd[1]); /* Pipe pd is now fully closed! */
12680 exit(0); /* Bye bye, thank you for playing! */
12684 if eval $compile_ok; then
12685 echo "$startsh" >mtry
12686 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
12688 ./mtry >/dev/null 2>&1
12690 0) eagain=`$cat try.out`;;
12691 1) echo "Could not perform non-blocking setting!";;
12692 2) echo "I did a successful read() for something that was not there!";;
12693 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
12694 4) echo "Could not find F_SETFL!";;
12695 *) echo "Something terribly wrong happened during testing.";;
12697 rd_nodata=`$cat try.ret`
12698 echo "A read() system call with no data present returns $rd_nodata."
12699 case "$rd_nodata" in
12702 echo "(That's peculiar, fixing that to be -1.)"
12708 echo "Forcing errno EAGAIN on read() with no data available."
12712 echo "Your read() sets errno to $eagain when no data is available."
12715 status=`$cat try.err`
12717 0) echo "And it correctly returns 0 to signal EOF.";;
12718 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
12719 *) echo "However, your read() returns '$status' on EOF??";;
12722 if test "$status" = "$rd_nodata"; then
12723 echo "WARNING: you can't distinguish between EOF and no data!"
12727 echo "I can't compile the test program--assuming errno EAGAIN will do."
12731 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
12740 echo "Using $hint value $eagain."
12741 echo "Your read() returns $rd_nodata when no data is present."
12742 case "$d_eofnblk" in
12743 "$define") echo "And you can see EOF because read() returns 0.";;
12744 "$undef") echo "But you can't see EOF status from read() returned value.";;
12746 echo "(Assuming you can't see EOF status from read anyway.)"
12752 $rm_try head.c mtry
12754 : see if _ptr and _cnt from stdio act std
12757 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
12758 echo "(Looks like you have stdio.h from BSD.)"
12759 case "$stdio_ptr" in
12760 '') stdio_ptr='((fp)->_p)'
12763 *) ptr_lval=$d_stdio_ptr_lval;;
12765 case "$stdio_cnt" in
12766 '') stdio_cnt='((fp)->_r)'
12769 *) cnt_lval=$d_stdio_cnt_lval;;
12771 case "$stdio_base" in
12772 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
12774 case "$stdio_bufsiz" in
12775 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
12777 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
12778 echo "(Looks like you have stdio.h from Linux.)"
12779 case "$stdio_ptr" in
12780 '') stdio_ptr='((fp)->_IO_read_ptr)'
12783 *) ptr_lval=$d_stdio_ptr_lval;;
12785 case "$stdio_cnt" in
12786 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
12789 *) cnt_lval=$d_stdio_cnt_lval;;
12791 case "$stdio_base" in
12792 '') stdio_base='((fp)->_IO_read_base)';;
12794 case "$stdio_bufsiz" in
12795 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
12798 case "$stdio_ptr" in
12799 '') stdio_ptr='((fp)->_ptr)'
12802 *) ptr_lval=$d_stdio_ptr_lval;;
12804 case "$stdio_cnt" in
12805 '') stdio_cnt='((fp)->_cnt)'
12808 *) cnt_lval=$d_stdio_cnt_lval;;
12810 case "$stdio_base" in
12811 '') stdio_base='((fp)->_base)';;
12813 case "$stdio_bufsiz" in
12814 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
12818 : test whether _ptr and _cnt really work
12819 echo "Checking how std your stdio is..." >&4
12822 #$i_stdlib I_STDLIB
12824 #include <stdlib.h>
12826 #define FILE_ptr(fp) $stdio_ptr
12827 #define FILE_cnt(fp) $stdio_cnt
12829 FILE *fp = fopen("try.c", "r");
12832 18 <= FILE_cnt(fp) &&
12833 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12841 if eval $compile && $to try.c; then
12842 if $run ./try; then
12843 echo "Your stdio acts pretty std."
12846 echo "Your stdio isn't very std."
12849 echo "Your stdio doesn't appear very std."
12853 # glibc 2.2.90 and above apparently change stdio streams so Perl's
12854 # direct buffer manipulation no longer works. The Configure tests
12855 # should be changed to correctly detect this, but until then,
12856 # the following check should at least let perl compile and run.
12857 # (This quick fix should be updated before 5.8.1.)
12858 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
12859 # A. Dougherty, June 3, 2002.
12860 case "$d_gnulibc" in
12862 case "$gnulibc_version" in
12866 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
12875 : Can _ptr be used as an lvalue?
12876 case "$d_stdstdio$ptr_lval" in
12877 $define$define) val=$define ;;
12880 set d_stdio_ptr_lval
12883 : Can _cnt be used as an lvalue?
12884 case "$d_stdstdio$cnt_lval" in
12885 $define$define) val=$define ;;
12888 set d_stdio_cnt_lval
12892 : test whether setting _ptr sets _cnt as a side effect
12893 d_stdio_ptr_lval_sets_cnt="$undef"
12894 d_stdio_ptr_lval_nochange_cnt="$undef"
12895 case "$d_stdio_ptr_lval$d_stdstdio" in
12897 echo "Checking to see what happens if we set the stdio ptr..." >&4
12900 /* Can we scream? */
12901 /* Eat dust sed :-) */
12902 /* In the buffer space, no one can hear you scream. */
12903 #$i_stdlib I_STDLIB
12905 #include <stdlib.h>
12907 #define FILE_ptr(fp) $stdio_ptr
12908 #define FILE_cnt(fp) $stdio_cnt
12909 #include <sys/types.h>
12911 FILE *fp = fopen("try.c", "r");
12916 puts("Fail even to read");
12919 c = getc(fp); /* Read away the first # */
12921 puts("Fail even to read");
12925 18 <= FILE_cnt(fp) &&
12926 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12928 puts("Fail even to read");
12931 ptr = (char*) FILE_ptr(fp);
12932 cnt = (size_t)FILE_cnt(fp);
12934 FILE_ptr(fp) += 42;
12936 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
12937 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
12940 if (FILE_cnt(fp) <= 20) {
12941 printf ("Fail (<20 chars to test)");
12944 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
12945 puts("Fail compare");
12948 if (cnt == FILE_cnt(fp)) {
12949 puts("Pass_unchanged");
12952 if (FILE_cnt(fp) == (cnt - 42)) {
12953 puts("Pass_changed");
12956 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
12962 if eval $compile && $to try.c; then
12963 case `$run ./try` in
12965 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
12966 d_stdio_ptr_lval_sets_cnt="$define" ;;
12968 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
12969 d_stdio_ptr_lval_nochange_cnt="$define" ;;
12971 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
12973 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
12976 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
12982 : see if _base is also standard
12984 case "$d_stdstdio" in
12988 #$i_stdlib I_STDLIB
12990 #include <stdlib.h>
12992 #define FILE_base(fp) $stdio_base
12993 #define FILE_bufsiz(fp) $stdio_bufsiz
12995 FILE *fp = fopen("try.c", "r");
12998 19 <= FILE_bufsiz(fp) &&
12999 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
13006 if eval $compile && $to try.c; then
13007 if $run ./try; then
13008 echo "And its _base field acts std."
13011 echo "But its _base field isn't std."
13014 echo "However, it seems to be lacking the _base field."
13022 : see if fast_stdio exists
13024 case "$d_stdstdio:$d_stdio_ptr_lval" in
13026 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
13028 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
13039 : see if fchdir exists
13040 set fchdir d_fchdir
13043 : see if fchmod exists
13044 set fchmod d_fchmod
13047 : see if fchown exists
13048 set fchown d_fchown
13051 : see if this is an fcntl system
13055 : See if fcntl-based locking works.
13058 #$i_stdlib I_STDLIB
13060 #include <stdlib.h>
13062 #include <unistd.h>
13064 #include <signal.h>
13065 $signal_t blech(int x) { exit(3); }
13067 #if defined(F_SETLK) && defined(F_SETLKW)
13068 struct flock flock;
13070 fd = open("try.c", O_RDONLY);
13071 flock.l_type = F_RDLCK;
13072 flock.l_whence = SEEK_SET;
13073 flock.l_start = flock.l_len = 0;
13074 signal(SIGALRM, blech);
13076 retval = fcntl(fd, F_SETLK, &flock);
13078 (retval < 0 ? exit(2) : exit(0));
13084 echo "Checking if fcntl-based file locking works... "
13088 if eval $compile_ok; then
13089 if $run ./try; then
13090 echo "Yes, it seems to work."
13093 echo "Nope, it didn't work."
13098 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
13099 *** This is (almost) impossible.
13100 *** If your NFS lock daemons are not feeling well, something like
13101 *** this may happen, please investigate. Cannot continue, aborting.
13109 echo "I'm unable to compile the test program, so I'll assume not."
13114 echo "Nope, since you don't even have fcntl()."
13117 set d_fcntl_can_lock
13121 : check for fd_set items
13124 Checking to see how well your C compiler handles fd_set and friends ...
13127 #$i_stdlib I_STDLIB
13129 #include <stdlib.h>
13131 #$i_systime I_SYS_TIME
13132 #$i_sysselct I_SYS_SELECT
13133 #$d_socket HAS_SOCKET
13134 #include <sys/types.h>
13136 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
13139 #include <sys/time.h>
13141 #ifdef I_SYS_SELECT
13142 #include <sys/select.h>
13151 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
13159 if eval $compile; then
13160 d_fds_bits="$define"
13162 echo "Well, your system knows about the normal fd_set typedef..." >&4
13163 if $run ./try; then
13164 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
13165 d_fd_macros="$define"
13168 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
13170 d_fd_macros="$undef"
13174 Hmm, your compiler has some difficulty with fd_set. Checking further...
13177 if eval $compile; then
13178 d_fds_bits="$undef"
13180 echo "Well, your system has some sort of fd_set available..." >&4
13181 if $run ./try; then
13182 echo "and you have the normal fd_set macros." >&4
13183 d_fd_macros="$define"
13186 but not the normal fd_set macros! Gross! More work for me...
13188 d_fd_macros="$undef"
13191 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
13193 d_fds_bits="$undef"
13194 d_fd_macros="$undef"
13199 : see if fgetpos exists
13200 set fgetpos d_fgetpos
13203 : see if finite exists
13204 set finite d_finite
13207 : see if finitel exists
13208 set finitel d_finitel
13211 : see if flock exists
13215 : see if prototype for flock is available
13217 set d_flockproto flock $i_sysfile sys/file.h
13220 : see if fp_class exists
13221 set fp_class d_fp_class
13224 : see if pathconf exists
13225 set pathconf d_pathconf
13228 : see if fpathconf exists
13229 set fpathconf d_fpathconf
13232 : see if fpclass exists
13233 set fpclass d_fpclass
13236 : see if fpclassify exists
13237 set fpclassify d_fpclassify
13240 : see if fpclassl exists
13241 set fpclassl d_fpclassl
13244 : check for fpos64_t
13246 echo "Checking to see if you have fpos64_t..." >&4
13249 int main() { fpos64_t x = 7; }
13252 if eval $compile; then
13254 echo "You have fpos64_t."
13257 echo "You do not have fpos64_t."
13258 case "$fpossize" in
13259 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
13266 : see if frexpl exists
13267 set frexpl d_frexpl
13270 : see if this is a sys/param system
13271 set sys/param.h i_sysparam
13274 : see if this is a sys/mount.h system
13275 set sys/mount.h i_sysmount
13278 : Check for fs_data_s
13280 echo "Checking to see if your system supports struct fs_data..." >&4
13281 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
13283 case "$d_fs_data_s" in
13284 "$define") echo "Yes, it does." ;;
13285 *) echo "No, it doesn't." ;;
13288 : see if fseeko exists
13289 set fseeko d_fseeko
13291 case "$longsize" in
13292 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
13295 : see if fsetpos exists
13296 set fsetpos d_fsetpos
13299 : see if fstatfs exists
13300 set fstatfs d_fstatfs
13303 : see if statvfs exists
13304 set statvfs d_statvfs
13307 : see if fstatvfs exists
13308 set fstatvfs d_fstatvfs
13312 : see if fsync exists
13316 : see if ftello exists
13317 set ftello d_ftello
13319 case "$longsize" in
13320 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
13323 : check for a working futimes
13326 echo "Checking if you have a working futimes()" >&4
13329 #include <sys/time.h>
13336 fd = open ("try.c", O_RDWR);
13337 if (-1 == fd) exit (1);
13338 rv = futimes (fd, NULL);
13339 exit (rv == -1 ? errno : 0);
13343 if eval $compile; then
13347 0) echo "Yes, you have" >&4
13348 d_futimes="$define"
13350 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
13354 echo "No, it does not (probably harmless)" >&4
13358 : see if ndbm.h is available
13361 : Compatibility location for RedHat 7.1
13362 set gdbm/ndbm.h i_gdbmndbm
13364 : Compatibility location for Debian 4.0
13365 set gdbm-ndbm.h i_gdbm_ndbm
13369 if $test "$i_ndbm" = "$define" -o "$i_gdbmndbm" = "$define" -o "$i_gdbm_ndbm" = "$define"; then
13370 : see if dbm_open exists
13371 set dbm_open d_dbm_open
13373 case "$d_dbm_open" in
13376 i_gdbmndbm="$undef"
13377 i_gdbm_ndbm="$undef"
13378 echo "We won't be including <ndbm.h>"
13388 ndbm_hdr_protochk='name=$1; hdr=$2;
13389 eval "ihdr=\$""i_$name";
13391 if $test "$ihdr" = "$define"; then
13392 $echo "Checking if your <$hdr> uses prototypes..." >&4;
13393 case "$d_cplusplus" in
13394 $define) ./protochk "$extern_C void dbm_close(DBM *);" literal "extern \"C\" {" $ihdr $hdr literal "}" && val="$define" ;;
13395 *) ./protochk "$extern_C void dbm_close(int, int);" $ihdr $hdr || val="$define" ;;
13398 $define) $echo "Your <$hdr> seems to have prototypes";;
13399 *) $echo "Your <$hdr> does not seem to have prototypes";;
13402 set "d_${name}_h_uses_prototypes";
13406 eval $ndbm_hdr_protochk
13407 set gdbmndbm gdbm/ndbm.h
13408 eval $ndbm_hdr_protochk
13409 set gdbm_ndbm gdbm-ndbm.h
13410 eval $ndbm_hdr_protochk
13412 : see if getaddrinfo exists
13413 set getaddrinfo d_getaddrinfo
13416 : see if getcwd exists
13417 set getcwd d_getcwd
13420 : see if getespwnam exists
13421 set getespwnam d_getespwnam
13424 : see if getfsstat exists
13425 set getfsstat d_getfsstat
13428 : see if getgrent exists
13429 set getgrent d_getgrent
13432 : see if getgrent_r exists
13433 set getgrent_r d_getgrent_r
13435 case "$d_getgrent_r" in
13437 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13438 case "$d_getgrent_r_proto:$usethreads" in
13439 ":define") d_getgrent_r_proto=define
13440 set d_getgrent_r_proto getgrent_r $hdrs
13444 case "$d_getgrent_r_proto" in
13446 case "$getgrent_r_proto" in
13447 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
13448 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBWR ;;
13450 case "$getgrent_r_proto" in
13451 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
13452 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIR ;;
13454 case "$getgrent_r_proto" in
13455 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
13456 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBW ;;
13458 case "$getgrent_r_proto" in
13459 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
13460 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBI ;;
13462 case "$getgrent_r_proto" in
13463 ''|0) try='int getgrent_r(struct group*, char*, int);'
13464 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBI ;;
13466 case "$getgrent_r_proto" in
13467 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
13468 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIH ;;
13470 case "$getgrent_r_proto" in
13471 ''|0) d_getgrent_r=undef
13473 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
13474 * ) case "$getgrent_r_proto" in
13475 REENTRANT_PROTO*) ;;
13476 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
13478 echo "Prototype: $try" ;;
13481 *) case "$usethreads" in
13482 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
13489 *) getgrent_r_proto=0
13493 : see if getgrgid_r exists
13494 set getgrgid_r d_getgrgid_r
13496 case "$d_getgrgid_r" in
13498 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13499 case "$d_getgrgid_r_proto:$usethreads" in
13500 ":define") d_getgrgid_r_proto=define
13501 set d_getgrgid_r_proto getgrgid_r $hdrs
13505 case "$d_getgrgid_r_proto" in
13507 case "$getgrgid_r_proto" in
13508 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
13509 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
13511 case "$getgrgid_r_proto" in
13512 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
13513 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
13515 case "$getgrgid_r_proto" in
13516 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
13517 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
13519 case "$getgrgid_r_proto" in
13520 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
13521 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
13523 case "$getgrgid_r_proto" in
13524 ''|0) d_getgrgid_r=undef
13526 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
13527 * ) case "$getgrgid_r_proto" in
13528 REENTRANT_PROTO*) ;;
13529 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
13531 echo "Prototype: $try" ;;
13534 *) case "$usethreads" in
13535 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
13542 *) getgrgid_r_proto=0
13546 : see if getgrnam_r exists
13547 set getgrnam_r d_getgrnam_r
13549 case "$d_getgrnam_r" in
13551 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13552 case "$d_getgrnam_r_proto:$usethreads" in
13553 ":define") d_getgrnam_r_proto=define
13554 set d_getgrnam_r_proto getgrnam_r $hdrs
13558 case "$d_getgrnam_r_proto" in
13560 case "$getgrnam_r_proto" in
13561 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
13562 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
13564 case "$getgrnam_r_proto" in
13565 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
13566 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
13568 case "$getgrnam_r_proto" in
13569 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
13570 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CBI ;;
13572 case "$getgrnam_r_proto" in
13573 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
13574 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
13576 case "$getgrnam_r_proto" in
13577 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
13578 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
13580 case "$getgrnam_r_proto" in
13581 ''|0) d_getgrnam_r=undef
13583 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
13584 * ) case "$getgrnam_r_proto" in
13585 REENTRANT_PROTO*) ;;
13586 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
13588 echo "Prototype: $try" ;;
13591 *) case "$usethreads" in
13592 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
13599 *) getgrnam_r_proto=0
13603 : see if gethostbyaddr exists
13604 set gethostbyaddr d_gethbyaddr
13607 : see if gethostbyname exists
13608 set gethostbyname d_gethbyname
13611 : see if gethostent exists
13612 set gethostent d_gethent
13615 : see how we will look up host name
13618 if set gethostname val -f d_gethname; eval $csym; $val; then
13619 echo 'gethostname() found.' >&4
13620 d_gethname="$define"
13623 if set uname val -f d_uname; eval $csym; $val; then
13626 uname() was found, but you're running xenix, and older versions of xenix
13627 have a broken uname(). If you don't really know whether your xenix is old
13628 enough to have a broken system call, use the default answer.
13633 "$define") dflt=n;;
13635 rp='Is your uname() broken?'
13638 n*) d_uname="$define"; call=uname;;
13641 echo 'uname() found.' >&4
13648 case "$d_gethname" in
13649 '') d_gethname="$undef";;
13652 '') d_uname="$undef";;
13654 case "$d_uname$d_gethname" in
13659 Every now and then someone has a $call() that lies about the hostname
13660 but can't be fixed for political or economic reasons. If you wish, I can
13661 pretend $call() isn't there and maybe compute hostname at run-time
13662 thanks to the '$phostname' command.
13665 rp="Shall I ignore $call() from now on?"
13668 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
13671 case "$phostname" in
13672 '') aphostname='';;
13673 *) case "$aphostname" in
13675 *) set X $phostname
13679 file=`./loc $file $file $pth`
13680 aphostname=`echo $file $*`
13685 case "$d_uname$d_gethname" in
13688 case "$phostname" in
13690 echo "There will be no way for $package to get your hostname." >&4;;
13692 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
13696 case "$d_phostname" in
13697 '') d_phostname="$undef";;
13700 : see if gethostbyaddr_r exists
13701 set gethostbyaddr_r d_gethostbyaddr_r
13703 case "$d_gethostbyaddr_r" in
13705 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13706 case "$d_gethostbyaddr_r_proto:$usethreads" in
13707 ":define") d_gethostbyaddr_r_proto=define
13708 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
13712 case "$d_gethostbyaddr_r_proto" in
13714 case "$gethostbyaddr_r_proto" in
13715 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13716 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
13718 case "$gethostbyaddr_r_proto" in
13719 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
13720 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
13722 case "$gethostbyaddr_r_proto" in
13723 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
13724 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
13726 case "$gethostbyaddr_r_proto" in
13727 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
13728 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
13730 case "$gethostbyaddr_r_proto" in
13731 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
13732 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
13734 case "$gethostbyaddr_r_proto" in
13735 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
13736 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
13738 case "$gethostbyaddr_r_proto" in
13739 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
13740 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
13742 case "$gethostbyaddr_r_proto" in
13743 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
13744 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
13746 case "$gethostbyaddr_r_proto" in
13747 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
13748 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
13750 case "$gethostbyaddr_r_proto" in
13751 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
13752 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
13754 case "$gethostbyaddr_r_proto" in
13755 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13756 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
13758 case "$gethostbyaddr_r_proto" in
13759 ''|0) d_gethostbyaddr_r=undef
13760 gethostbyaddr_r_proto=0
13761 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
13762 * ) case "$gethostbyaddr_r_proto" in
13763 REENTRANT_PROTO*) ;;
13764 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
13766 echo "Prototype: $try" ;;
13769 *) case "$usethreads" in
13770 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
13772 d_gethostbyaddr_r=undef
13773 gethostbyaddr_r_proto=0
13777 *) gethostbyaddr_r_proto=0
13781 : see if gethostbyname_r exists
13782 set gethostbyname_r d_gethostbyname_r
13784 case "$d_gethostbyname_r" in
13786 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13787 case "$d_gethostbyname_r_proto:$usethreads" in
13788 ":define") d_gethostbyname_r_proto=define
13789 set d_gethostbyname_r_proto gethostbyname_r $hdrs
13793 case "$d_gethostbyname_r_proto" in
13795 case "$gethostbyname_r_proto" in
13796 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
13797 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
13799 case "$gethostbyname_r_proto" in
13800 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
13801 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
13803 case "$gethostbyname_r_proto" in
13804 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
13805 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
13807 case "$gethostbyname_r_proto" in
13808 ''|0) d_gethostbyname_r=undef
13809 gethostbyname_r_proto=0
13810 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
13811 * ) case "$gethostbyname_r_proto" in
13812 REENTRANT_PROTO*) ;;
13813 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
13815 echo "Prototype: $try" ;;
13818 *) case "$usethreads" in
13819 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
13821 d_gethostbyname_r=undef
13822 gethostbyname_r_proto=0
13826 *) gethostbyname_r_proto=0
13830 : see if gethostent_r exists
13831 set gethostent_r d_gethostent_r
13833 case "$d_gethostent_r" in
13835 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13836 case "$d_gethostent_r_proto:$usethreads" in
13837 ":define") d_gethostent_r_proto=define
13838 set d_gethostent_r_proto gethostent_r $hdrs
13842 case "$d_gethostent_r_proto" in
13844 case "$gethostent_r_proto" in
13845 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
13846 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
13848 case "$gethostent_r_proto" in
13849 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
13850 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBIE ;;
13852 case "$gethostent_r_proto" in
13853 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
13854 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBIE ;;
13856 case "$gethostent_r_proto" in
13857 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
13858 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBI ;;
13860 case "$gethostent_r_proto" in
13861 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
13862 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBI ;;
13864 case "$gethostent_r_proto" in
13865 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
13866 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SD ;;
13868 case "$gethostent_r_proto" in
13869 ''|0) d_gethostent_r=undef
13870 gethostent_r_proto=0
13871 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
13872 * ) case "$gethostent_r_proto" in
13873 REENTRANT_PROTO*) ;;
13874 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
13876 echo "Prototype: $try" ;;
13879 *) case "$usethreads" in
13880 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
13882 d_gethostent_r=undef
13883 gethostent_r_proto=0
13887 *) gethostent_r_proto=0
13891 : see if prototypes for various gethostxxx netdb.h functions are available
13893 set d_gethostprotos gethostent $i_netdb netdb.h
13896 : see if getitimer exists
13897 set getitimer d_getitimer
13900 : see if getlogin exists
13901 set getlogin d_getlogin
13904 : see if getlogin_r exists
13905 set getlogin_r d_getlogin_r
13907 case "$d_getlogin_r" in
13909 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
13910 case "$d_getlogin_r_proto:$usethreads" in
13911 ":define") d_getlogin_r_proto=define
13912 set d_getlogin_r_proto getlogin_r $hdrs
13916 case "$d_getlogin_r_proto" in
13918 case "$getlogin_r_proto" in
13919 ''|0) try='int getlogin_r(char*, size_t);'
13920 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BW ;;
13922 case "$getlogin_r_proto" in
13923 ''|0) try='int getlogin_r(char*, int);'
13924 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BI ;;
13926 case "$getlogin_r_proto" in
13927 ''|0) try='char* getlogin_r(char*, size_t);'
13928 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BW ;;
13930 case "$getlogin_r_proto" in
13931 ''|0) try='char* getlogin_r(char*, int);'
13932 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BI ;;
13934 case "$getlogin_r_proto" in
13935 ''|0) d_getlogin_r=undef
13937 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
13938 * ) case "$getlogin_r_proto" in
13939 REENTRANT_PROTO*) ;;
13940 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
13942 echo "Prototype: $try" ;;
13945 *) case "$usethreads" in
13946 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
13953 *) getlogin_r_proto=0
13957 : see if getmnt exists
13958 set getmnt d_getmnt
13961 : see if getmntent exists
13962 set getmntent d_getmntent
13965 : see if getnameinfo exists
13966 set getnameinfo d_getnameinfo
13969 : see if getnetbyaddr exists
13970 set getnetbyaddr d_getnbyaddr
13973 : see if getnetbyname exists
13974 set getnetbyname d_getnbyname
13977 : see if getnetent exists
13978 set getnetent d_getnent
13981 : see if getnetbyaddr_r exists
13982 set getnetbyaddr_r d_getnetbyaddr_r
13984 case "$d_getnetbyaddr_r" in
13986 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13987 case "$d_getnetbyaddr_r_proto:$usethreads" in
13988 ":define") d_getnetbyaddr_r_proto=define
13989 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
13993 case "$d_getnetbyaddr_r_proto" in
13995 case "$getnetbyaddr_r_proto" in
13996 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
13997 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
13999 case "$getnetbyaddr_r_proto" in
14000 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
14001 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
14003 case "$getnetbyaddr_r_proto" in
14004 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
14005 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
14007 case "$getnetbyaddr_r_proto" in
14008 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
14009 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
14011 case "$getnetbyaddr_r_proto" in
14012 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
14013 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
14015 case "$getnetbyaddr_r_proto" in
14016 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
14017 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
14019 case "$getnetbyaddr_r_proto" in
14020 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
14021 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
14023 case "$getnetbyaddr_r_proto" in
14024 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
14025 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
14027 case "$getnetbyaddr_r_proto" in
14028 ''|0) d_getnetbyaddr_r=undef
14029 getnetbyaddr_r_proto=0
14030 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
14031 * ) case "$getnetbyaddr_r_proto" in
14032 REENTRANT_PROTO*) ;;
14033 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
14035 echo "Prototype: $try" ;;
14038 *) case "$usethreads" in
14039 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
14041 d_getnetbyaddr_r=undef
14042 getnetbyaddr_r_proto=0
14046 *) getnetbyaddr_r_proto=0
14050 : see if getnetbyname_r exists
14051 set getnetbyname_r d_getnetbyname_r
14053 case "$d_getnetbyname_r" in
14055 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14056 case "$d_getnetbyname_r_proto:$usethreads" in
14057 ":define") d_getnetbyname_r_proto=define
14058 set d_getnetbyname_r_proto getnetbyname_r $hdrs
14062 case "$d_getnetbyname_r_proto" in
14064 case "$getnetbyname_r_proto" in
14065 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
14066 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
14068 case "$getnetbyname_r_proto" in
14069 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
14070 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
14072 case "$getnetbyname_r_proto" in
14073 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
14074 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
14076 case "$getnetbyname_r_proto" in
14077 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
14078 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
14080 case "$getnetbyname_r_proto" in
14081 ''|0) d_getnetbyname_r=undef
14082 getnetbyname_r_proto=0
14083 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
14084 * ) case "$getnetbyname_r_proto" in
14085 REENTRANT_PROTO*) ;;
14086 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
14088 echo "Prototype: $try" ;;
14091 *) case "$usethreads" in
14092 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
14094 d_getnetbyname_r=undef
14095 getnetbyname_r_proto=0
14099 *) getnetbyname_r_proto=0
14103 : see if getnetent_r exists
14104 set getnetent_r d_getnetent_r
14106 case "$d_getnetent_r" in
14108 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14109 case "$d_getnetent_r_proto:$usethreads" in
14110 ":define") d_getnetent_r_proto=define
14111 set d_getnetent_r_proto getnetent_r $hdrs
14115 case "$d_getnetent_r_proto" in
14117 case "$getnetent_r_proto" in
14118 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
14119 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
14121 case "$getnetent_r_proto" in
14122 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
14123 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBIE ;;
14125 case "$getnetent_r_proto" in
14126 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
14127 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBIE ;;
14129 case "$getnetent_r_proto" in
14130 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
14131 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBI ;;
14133 case "$getnetent_r_proto" in
14134 ''|0) try='int getnetent_r(struct netent*, char*, int);'
14135 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBI ;;
14137 case "$getnetent_r_proto" in
14138 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
14139 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SD ;;
14141 case "$getnetent_r_proto" in
14142 ''|0) d_getnetent_r=undef
14143 getnetent_r_proto=0
14144 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
14145 * ) case "$getnetent_r_proto" in
14146 REENTRANT_PROTO*) ;;
14147 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
14149 echo "Prototype: $try" ;;
14152 *) case "$usethreads" in
14153 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
14155 d_getnetent_r=undef
14156 getnetent_r_proto=0
14160 *) getnetent_r_proto=0
14164 : see if prototypes for various getnetxxx netdb.h functions are available
14166 set d_getnetprotos getnetent $i_netdb netdb.h
14169 : see if getpagesize exists
14170 set getpagesize d_getpagsz
14173 : Optional checks for getprotobyname and getprotobynumber
14175 : see if getprotobyname exists
14176 set getprotobyname d_getpbyname
14179 : see if getprotobynumber exists
14180 set getprotobynumber d_getpbynumber
14183 : see if getprotoent exists
14184 set getprotoent d_getpent
14187 : see if getpgid exists
14188 set getpgid d_getpgid
14191 : see if getpgrp2 exists
14192 set getpgrp2 d_getpgrp2
14195 : see if getppid exists
14196 set getppid d_getppid
14199 : see if getpriority exists
14200 set getpriority d_getprior
14203 : see if getprotobyname_r exists
14204 set getprotobyname_r d_getprotobyname_r
14206 case "$d_getprotobyname_r" in
14208 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14209 case "$d_getprotobyname_r_proto:$usethreads" in
14210 ":define") d_getprotobyname_r_proto=define
14211 set d_getprotobyname_r_proto getprotobyname_r $hdrs
14215 case "$d_getprotobyname_r_proto" in
14217 case "$getprotobyname_r_proto" in
14218 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
14219 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
14221 case "$getprotobyname_r_proto" in
14222 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
14223 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
14225 case "$getprotobyname_r_proto" in
14226 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
14227 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
14229 case "$getprotobyname_r_proto" in
14230 ''|0) d_getprotobyname_r=undef
14231 getprotobyname_r_proto=0
14232 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
14233 * ) case "$getprotobyname_r_proto" in
14234 REENTRANT_PROTO*) ;;
14235 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
14237 echo "Prototype: $try" ;;
14240 *) case "$usethreads" in
14241 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
14243 d_getprotobyname_r=undef
14244 getprotobyname_r_proto=0
14248 *) getprotobyname_r_proto=0
14252 : see if getprotobynumber_r exists
14253 set getprotobynumber_r d_getprotobynumber_r
14255 case "$d_getprotobynumber_r" in
14257 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14258 case "$d_getprotobynumber_r_proto:$usethreads" in
14259 ":define") d_getprotobynumber_r_proto=define
14260 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
14264 case "$d_getprotobynumber_r_proto" in
14266 case "$getprotobynumber_r_proto" in
14267 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
14268 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
14270 case "$getprotobynumber_r_proto" in
14271 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
14272 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
14274 case "$getprotobynumber_r_proto" in
14275 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
14276 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
14278 case "$getprotobynumber_r_proto" in
14279 ''|0) d_getprotobynumber_r=undef
14280 getprotobynumber_r_proto=0
14281 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
14282 * ) case "$getprotobynumber_r_proto" in
14283 REENTRANT_PROTO*) ;;
14284 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
14286 echo "Prototype: $try" ;;
14289 *) case "$usethreads" in
14290 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
14292 d_getprotobynumber_r=undef
14293 getprotobynumber_r_proto=0
14297 *) getprotobynumber_r_proto=0
14301 : see if getprotoent_r exists
14302 set getprotoent_r d_getprotoent_r
14304 case "$d_getprotoent_r" in
14306 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14307 case "$d_getprotoent_r_proto:$usethreads" in
14308 ":define") d_getprotoent_r_proto=define
14309 set d_getprotoent_r_proto getprotoent_r $hdrs
14313 case "$d_getprotoent_r_proto" in
14315 case "$getprotoent_r_proto" in
14316 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
14317 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
14319 case "$getprotoent_r_proto" in
14320 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
14321 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBI ;;
14323 case "$getprotoent_r_proto" in
14324 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
14325 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=S_SBI ;;
14327 case "$getprotoent_r_proto" in
14328 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
14329 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SD ;;
14331 case "$getprotoent_r_proto" in
14332 ''|0) d_getprotoent_r=undef
14333 getprotoent_r_proto=0
14334 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
14335 * ) case "$getprotoent_r_proto" in
14336 REENTRANT_PROTO*) ;;
14337 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
14339 echo "Prototype: $try" ;;
14342 *) case "$usethreads" in
14343 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
14345 d_getprotoent_r=undef
14346 getprotoent_r_proto=0
14350 *) getprotoent_r_proto=0
14354 : see if prototypes for various getprotoxxx netdb.h functions are available
14356 set d_getprotoprotos getprotoent $i_netdb netdb.h
14359 : see if getprpwnam exists
14360 set getprpwnam d_getprpwnam
14363 : see if getpwent exists
14364 set getpwent d_getpwent
14367 : see if getpwent_r exists
14368 set getpwent_r d_getpwent_r
14370 case "$d_getpwent_r" in
14372 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14373 case "$d_getpwent_r_proto:$usethreads" in
14374 ":define") d_getpwent_r_proto=define
14375 set d_getpwent_r_proto getpwent_r $hdrs
14379 case "$d_getpwent_r_proto" in
14381 case "$getpwent_r_proto" in
14382 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
14383 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBWR ;;
14385 case "$getpwent_r_proto" in
14386 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
14387 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIR ;;
14389 case "$getpwent_r_proto" in
14390 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
14391 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBW ;;
14393 case "$getpwent_r_proto" in
14394 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
14395 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBI ;;
14397 case "$getpwent_r_proto" in
14398 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
14399 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBI ;;
14401 case "$getpwent_r_proto" in
14402 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
14403 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIH ;;
14405 case "$getpwent_r_proto" in
14406 ''|0) d_getpwent_r=undef
14408 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
14409 * ) case "$getpwent_r_proto" in
14410 REENTRANT_PROTO*) ;;
14411 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
14413 echo "Prototype: $try" ;;
14416 *) case "$usethreads" in
14417 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
14424 *) getpwent_r_proto=0
14428 : see if getpwnam_r exists
14429 set getpwnam_r d_getpwnam_r
14431 case "$d_getpwnam_r" in
14433 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14434 case "$d_getpwnam_r_proto:$usethreads" in
14435 ":define") d_getpwnam_r_proto=define
14436 set d_getpwnam_r_proto getpwnam_r $hdrs
14440 case "$d_getpwnam_r_proto" in
14442 case "$getpwnam_r_proto" in
14443 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
14444 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
14446 case "$getpwnam_r_proto" in
14447 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
14448 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
14450 case "$getpwnam_r_proto" in
14451 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
14452 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
14454 case "$getpwnam_r_proto" in
14455 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
14456 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
14458 case "$getpwnam_r_proto" in
14459 ''|0) d_getpwnam_r=undef
14461 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
14462 * ) case "$getpwnam_r_proto" in
14463 REENTRANT_PROTO*) ;;
14464 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
14466 echo "Prototype: $try" ;;
14469 *) case "$usethreads" in
14470 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
14477 *) getpwnam_r_proto=0
14481 : see if getpwuid_r exists
14482 set getpwuid_r d_getpwuid_r
14484 case "$d_getpwuid_r" in
14486 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14487 case "$d_getpwuid_r_proto:$usethreads" in
14488 ":define") d_getpwuid_r_proto=define
14489 set d_getpwuid_r_proto getpwuid_r $hdrs
14493 case "$d_getpwuid_r_proto" in
14495 case "$getpwuid_r_proto" in
14496 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
14497 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
14499 case "$getpwuid_r_proto" in
14500 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
14501 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
14503 case "$getpwuid_r_proto" in
14504 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
14505 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
14507 case "$getpwuid_r_proto" in
14508 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
14509 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
14511 case "$getpwuid_r_proto" in
14512 ''|0) d_getpwuid_r=undef
14514 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
14515 * ) case "$getpwuid_r_proto" in
14516 REENTRANT_PROTO*) ;;
14517 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
14519 echo "Prototype: $try" ;;
14522 *) case "$usethreads" in
14523 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
14530 *) getpwuid_r_proto=0
14534 : Optional checks for getsbyname and getsbyport
14536 : see if getservbyname exists
14537 set getservbyname d_getsbyname
14540 : see if getservbyport exists
14541 set getservbyport d_getsbyport
14544 : see if getservent exists
14545 set getservent d_getsent
14548 : see if getservbyname_r exists
14549 set getservbyname_r d_getservbyname_r
14551 case "$d_getservbyname_r" in
14553 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14554 case "$d_getservbyname_r_proto:$usethreads" in
14555 ":define") d_getservbyname_r_proto=define
14556 set d_getservbyname_r_proto getservbyname_r $hdrs
14560 case "$d_getservbyname_r_proto" in
14562 case "$getservbyname_r_proto" in
14563 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
14564 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
14566 case "$getservbyname_r_proto" in
14567 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
14568 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
14570 case "$getservbyname_r_proto" in
14571 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
14572 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
14574 case "$getservbyname_r_proto" in
14575 ''|0) d_getservbyname_r=undef
14576 getservbyname_r_proto=0
14577 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
14578 * ) case "$getservbyname_r_proto" in
14579 REENTRANT_PROTO*) ;;
14580 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
14582 echo "Prototype: $try" ;;
14585 *) case "$usethreads" in
14586 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
14588 d_getservbyname_r=undef
14589 getservbyname_r_proto=0
14593 *) getservbyname_r_proto=0
14597 : see if getservbyport_r exists
14598 set getservbyport_r d_getservbyport_r
14600 case "$d_getservbyport_r" in
14602 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14603 case "$d_getservbyport_r_proto:$usethreads" in
14604 ":define") d_getservbyport_r_proto=define
14605 set d_getservbyport_r_proto getservbyport_r $hdrs
14609 case "$d_getservbyport_r_proto" in
14611 case "$getservbyport_r_proto" in
14612 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
14613 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
14615 case "$getservbyport_r_proto" in
14616 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
14617 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
14619 case "$getservbyport_r_proto" in
14620 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
14621 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
14623 case "$getservbyport_r_proto" in
14624 ''|0) d_getservbyport_r=undef
14625 getservbyport_r_proto=0
14626 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
14627 * ) case "$getservbyport_r_proto" in
14628 REENTRANT_PROTO*) ;;
14629 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
14631 echo "Prototype: $try" ;;
14634 *) case "$usethreads" in
14635 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
14637 d_getservbyport_r=undef
14638 getservbyport_r_proto=0
14642 *) getservbyport_r_proto=0
14646 : see if getservent_r exists
14647 set getservent_r d_getservent_r
14649 case "$d_getservent_r" in
14651 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14652 case "$d_getservent_r_proto:$usethreads" in
14653 ":define") d_getservent_r_proto=define
14654 set d_getservent_r_proto getservent_r $hdrs
14658 case "$d_getservent_r_proto" in
14660 case "$getservent_r_proto" in
14661 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
14662 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBWR ;;
14664 case "$getservent_r_proto" in
14665 ''|0) try='int getservent_r(struct servent*, char*, int);'
14666 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBI ;;
14668 case "$getservent_r_proto" in
14669 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
14670 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=S_SBI ;;
14672 case "$getservent_r_proto" in
14673 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
14674 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SD ;;
14676 case "$getservent_r_proto" in
14677 ''|0) d_getservent_r=undef
14678 getservent_r_proto=0
14679 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
14680 * ) case "$getservent_r_proto" in
14681 REENTRANT_PROTO*) ;;
14682 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
14684 echo "Prototype: $try" ;;
14687 *) case "$usethreads" in
14688 define) echo "getservent_r has no prototype, not using it." >&4 ;;
14690 d_getservent_r=undef
14691 getservent_r_proto=0
14695 *) getservent_r_proto=0
14699 : see if prototypes for various getservxxx netdb.h functions are available
14701 set d_getservprotos getservent $i_netdb netdb.h
14704 : see if getspnam exists
14705 set getspnam d_getspnam
14708 : see if this is a shadow.h system
14709 set shadow.h i_shadow
14712 : see if getspnam_r exists
14713 set getspnam_r d_getspnam_r
14715 case "$d_getspnam_r" in
14717 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
14718 case "$d_getspnam_r_proto:$usethreads" in
14719 ":define") d_getspnam_r_proto=define
14720 set d_getspnam_r_proto getspnam_r $hdrs
14724 case "$d_getspnam_r_proto" in
14726 case "$getspnam_r_proto" in
14727 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
14728 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
14730 case "$getspnam_r_proto" in
14731 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
14732 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=S_CSBI ;;
14734 case "$getspnam_r_proto" in
14735 ''|0) d_getspnam_r=undef
14737 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
14738 * ) case "$getspnam_r_proto" in
14739 REENTRANT_PROTO*) ;;
14740 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
14742 echo "Prototype: $try" ;;
14745 *) case "$usethreads" in
14746 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
14753 *) getspnam_r_proto=0
14757 : see if gettimeofday or ftime exists
14758 set gettimeofday d_gettimeod
14760 case "$d_gettimeod" in
14766 val="$undef"; set d_ftime; eval $setvar
14769 case "$d_gettimeod$d_ftime" in
14772 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
14776 : see if gmtime_r exists
14777 set gmtime_r d_gmtime_r
14779 case "$d_gmtime_r" in
14781 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14782 case "$d_gmtime_r_proto:$usethreads" in
14783 ":define") d_gmtime_r_proto=define
14784 set d_gmtime_r_proto gmtime_r $hdrs
14788 case "$d_gmtime_r_proto" in
14790 case "$gmtime_r_proto" in
14791 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
14792 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=S_TS ;;
14794 case "$gmtime_r_proto" in
14795 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
14796 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=I_TS ;;
14798 case "$gmtime_r_proto" in
14799 ''|0) d_gmtime_r=undef
14801 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
14802 * ) case "$gmtime_r_proto" in
14803 REENTRANT_PROTO*) ;;
14804 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
14806 echo "Prototype: $try" ;;
14809 *) case "$usethreads" in
14810 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
14817 *) gmtime_r_proto=0
14821 : see if hasmntopt exists
14822 set hasmntopt d_hasmntopt
14825 : see if this is a netinet/in.h or sys/in.h system
14826 set netinet/in.h i_niin sys/in.h i_sysin
14829 : see if arpa/inet.h has to be included
14830 set arpa/inet.h i_arpainet
14833 : see if htonl --and friends-- exists
14838 : Maybe they are macros.
14841 $cat >htonl.c <<EOM
14843 #include <sys/types.h>
14844 #$i_niin I_NETINET_IN
14846 #$i_arpainet I_ARPA_INET
14847 #ifdef I_NETINET_IN
14848 #include <netinet/in.h>
14851 #include <sys/in.h>
14854 #include <arpa/inet.h>
14857 printf("Defined as a macro.");
14860 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
14861 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
14863 echo "But it seems to be defined as a macro." >&4
14871 : see if ilogbl exists
14872 set ilogbl d_ilogbl
14877 if set index val -f; eval $csym; $val; then
14878 if set strchr val -f d_strchr; eval $csym; $val; then
14879 if $contains strchr "$strings" >/dev/null 2>&1 ; then
14882 echo "strchr() found." >&4
14886 echo "index() found." >&4
14891 echo "index() found." >&4
14894 if set strchr val -f d_strchr; eval $csym; $val; then
14897 echo "strchr() found." >&4
14899 echo "No index() or strchr() found!" >&4
14904 set d_strchr; eval $setvar
14906 set d_index; eval $setvar
14908 : check whether inet_aton exists
14909 set inet_aton d_inetaton
14912 : see if inet_ntop exists
14913 set inet_ntop d_inetntop
14916 : see if inet_pton exists
14917 set inet_pton d_inetpton
14922 $cat >isascii.c <<EOCP
14925 #$i_stdlib I_STDLIB
14927 #include <stdlib.h>
14938 if eval $compile; then
14939 echo "isascii() found." >&4
14942 echo "isascii() NOT found." >&4
14949 : see if isfinite exists
14950 set isfinite d_isfinite
14953 : see if isinf exists
14957 : see if isnan exists
14961 : see if isnanl exists
14962 set isnanl d_isnanl
14965 : see if killpg exists
14966 set killpg d_killpg
14969 : see if lchown exists
14971 $cat > try.c <<'EOCP'
14972 /* System header to define __stub macros and hopefully few prototypes,
14973 which can conflict with char lchown(); below. */
14974 #include <assert.h>
14975 /* Override any gcc2 internal prototype to avoid an error. */
14976 /* We use char because int might match the return type of a gcc2
14977 builtin and then its argument prototype would still apply. */
14980 /* The GNU C library defines this for functions which it implements
14981 to always fail with ENOSYS. Some functions are actually named
14982 something starting with __ and the normal name is an alias. */
14983 #if defined (__stub_lchown) || defined (__stub___lchown)
14991 if eval $compile; then
14992 $echo "lchown() found." >&4
14995 $echo "lchown() NOT found." >&4
15001 : See if number of significant digits in a double precision number is known
15003 $cat >ldbl_dig.c <<EOM
15004 #$i_limits I_LIMITS
15007 #include <limits.h>
15013 printf("Contains LDBL_DIG");
15016 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
15017 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
15018 echo "LDBL_DIG found." >&4
15021 echo "LDBL_DIG NOT found." >&4
15028 : see if this is a math.h system
15032 : check to see if math.h defines _LIB_VERSION
15033 d_libm_lib_version="$undef"
15037 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
15039 #include <unistd.h>
15041 int main (int argc, char *argv[])
15043 printf ("%d\n", _LIB_VERSION);
15048 if eval $compile; then
15050 echo "Yes, it does ($foo)" >&4
15051 d_libm_lib_version="$define"
15053 echo "No, it does not (probably harmless)" >&4
15060 : see if link exists
15064 : see if localtime_r exists
15065 set localtime_r d_localtime_r
15067 case "$d_localtime_r" in
15069 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15070 case "$d_localtime_r_proto:$usethreads" in
15071 ":define") d_localtime_r_proto=define
15072 set d_localtime_r_proto localtime_r $hdrs
15076 case "$d_localtime_r_proto" in
15078 case "$localtime_r_proto" in
15079 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
15080 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=S_TS ;;
15082 case "$localtime_r_proto" in
15083 ''|0) try='int localtime_r(const time_t*, struct tm*);'
15084 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=I_TS ;;
15086 case "$localtime_r_proto" in
15087 ''|0) d_localtime_r=undef
15088 localtime_r_proto=0
15089 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
15090 * ) case "$localtime_r_proto" in
15091 REENTRANT_PROTO*) ;;
15092 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
15094 echo "Prototype: $try" ;;
15097 *) case "$usethreads" in
15098 define) echo "localtime_r has no prototype, not using it." >&4 ;;
15100 d_localtime_r=undef
15101 localtime_r_proto=0
15105 *) localtime_r_proto=0
15109 : see if localtime_r calls tzset
15110 case "$localtime_r_proto" in
15113 /* Does our libc's localtime_r call tzset ?
15114 * return 0 if so, 1 otherwise.
15116 #$i_systypes I_SYS_TYPES
15117 #$i_unistd I_UNISTD
15119 #$i_stdlib I_STDLIB
15120 #$i_string I_STRING
15121 #$i_malloc I_MALLOC
15123 # include <sys/types.h>
15126 # include <unistd.h>
15132 #include <stdlib.h>
15135 # include <string.h>
15137 # include <strings.h>
15140 # include <malloc.h>
15144 time_t t = time(0L);
15145 char w_tz[]="TZ" "=GMT+5",
15146 e_tz[]="TZ" "=GMT-5",
15147 *tz_e = (char*)malloc(16),
15148 *tz_w = (char*)malloc(16);
15149 struct tm tm_e, tm_w;
15150 memset(&tm_e,'\0',sizeof(struct tm));
15151 memset(&tm_w,'\0',sizeof(struct tm));
15156 localtime_r(&t, &tm_e);
15159 localtime_r(&t, &tm_w);
15161 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
15167 if eval $compile; then
15168 if $run ./try; then
15169 d_localtime_r_needs_tzset=undef;
15171 d_localtime_r_needs_tzset=define;
15174 d_localtime_r_needs_tzset=undef;
15178 d_localtime_r_needs_tzset=undef;
15183 : see if localeconv exists
15184 set localeconv d_locconv
15187 : see if lockf exists
15191 : see if prototype for lseek is available
15193 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
15196 : see if lstat exists
15200 : see if madvise exists
15201 set madvise d_madvise
15204 : see if malloc_size exists
15205 set malloc_size d_malloc_size
15208 : see if malloc_size_good exists
15209 set malloc_good_size d_malloc_good_size
15212 : see if mblen exists
15216 : see if mbstowcs exists
15217 set mbstowcs d_mbstowcs
15220 : see if mbtowc exists
15221 set mbtowc d_mbtowc
15224 : see if memchr exists
15225 set memchr d_memchr
15228 : see if memcmp exists
15229 set memcmp d_memcmp
15232 : see if memcpy exists
15233 set memcpy d_memcpy
15236 : see if memmove exists
15237 set memmove d_memmove
15240 : see if memset exists
15241 set memset d_memset
15244 : see if mkdir exists
15248 : see if mkdtemp exists
15249 set mkdtemp d_mkdtemp
15252 : see if mkfifo exists
15253 set mkfifo d_mkfifo
15256 : see if mkstemp exists
15257 set mkstemp d_mkstemp
15260 : see if mkstemps exists
15261 set mkstemps d_mkstemps
15264 : see if mktime exists
15265 set mktime d_mktime
15268 : see if this is a sys/mman.h system
15269 set sys/mman.h i_sysmman
15272 : see if mmap exists
15275 : see what shmat returns
15276 : default to something harmless
15278 case "$i_sysmman$d_mmap" in
15280 $cat >mmap.c <<'END'
15281 #include <sys/mman.h>
15284 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
15289 echo "and it returns ($mmaptype)." >&4
15295 : see if sqrtl exists
15299 : see if scalbnl exists
15300 set scalbnl d_scalbnl
15303 : see if modfl exists
15307 : see if prototype for modfl is available
15309 set d_modflproto modfl $i_math math.h
15312 d_modfl_pow32_bug="$undef"
15314 case "$d_longdbl$d_modfl" in
15317 Checking to see whether your modfl() is okay for large values...
15323 if $test "X$d_modflproto" != "X$define"; then
15324 $cat >>try.c <<EOCP
15325 /* Sigh. many current glibcs provide the function, but do not prototype it. */
15326 long double modfl (long double, long double *);
15329 $cat >>try.c <<EOCP
15331 long double nv = 4294967303.15;
15337 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
15341 case "$osname:$gccversion" in
15342 aix:) saveccflags="$ccflags"
15343 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
15346 if eval $compile; then
15349 *" 4294967303.150000 1.150000 4294967302.000000")
15350 echo >&4 "Your modfl() is broken for large values."
15351 d_modfl_pow32_bug="$define"
15353 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
15357 *" 4294967303.150000 0.150000 4294967303.000000")
15358 echo >&4 "Your modfl() seems okay for large values."
15360 *) echo >&4 "I don't understand your modfl() at all."
15366 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
15369 case "$osname:$gccversion" in
15370 aix:) ccflags="$saveccflags" ;; # restore
15375 if $test "$uselongdouble" = "$define"; then
15377 if $test "$d_sqrtl" != "$define"; then
15378 message="$message sqrtl"
15380 if $test "$d_modfl" != "$define"; then
15381 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
15382 echo "You have both aintl and copysignl, so I can emulate modfl."
15384 message="$message modfl"
15387 if $test "$d_frexpl" != "$define"; then
15388 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
15389 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
15391 message="$message frexpl"
15395 if $test "$message" != ""; then
15398 *** You requested the use of long doubles but you do not seem to have
15399 *** the following mathematical functions needed for long double support:
15401 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
15402 *** Cannot continue, aborting.
15410 : see if mprotect exists
15411 set mprotect d_mprotect
15414 : see if msgctl exists
15415 set msgctl d_msgctl
15418 : see if msgget exists
15419 set msgget d_msgget
15422 : see if msgsnd exists
15423 set msgsnd d_msgsnd
15426 : see if msgrcv exists
15427 set msgrcv d_msgrcv
15430 : see how much of the 'msg*(2)' library is present.
15433 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
15434 *"$undef"*) h_msg=false;;
15438 case "`ipcs 2>&1`" in
15439 "SVID messages"*"not configured"*)
15440 echo "Your $osname does not have the msg*(2) configured." >&4
15443 set msgctl d_msgctl
15445 set msgget d_msgget
15447 set msgsnd d_msgsnd
15449 set msgrcv d_msgrcv
15455 : we could also check for sys/ipc.h ...
15456 if $h_msg && $test `./findhdr sys/msg.h`; then
15457 echo "You have the full msg*(2) library." >&4
15460 echo "You don't have the full msg*(2) library." >&4
15466 : Check for msghdr_s
15468 echo "Checking to see if your system supports struct msghdr..." >&4
15469 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
15471 case "$d_msghdr_s" in
15472 "$define") echo "Yes, it does." ;;
15473 *) echo "No, it doesn't." ;;
15477 : see if msync exists
15481 : see if munmap exists
15482 set munmap d_munmap
15485 : see if nice exists
15489 : see if this is a langinfo.h system
15490 set langinfo.h i_langinfo
15493 : see if nl_langinfo exists
15494 set nl_langinfo d_nl_langinfo
15497 : check for volatile keyword
15499 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
15500 $cat >try.c <<'EOCP'
15503 typedef struct _goo_struct goo_struct;
15504 goo_struct * volatile goo = ((goo_struct *)0);
15505 struct _goo_struct {
15510 typedef unsigned short foo_t;
15511 char *volatile foo;
15513 volatile foo_t blech;
15517 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
15519 echo "Yup, it does."
15522 echo "Nope, it doesn't."
15528 : Check basic sizes
15530 $echo "Choosing the C types to be used for Perl's internal types..." >&4
15532 case "$use64bitint:$d_quad:$quadtype" in
15535 uvtype="$uquadtype"
15540 uvtype="unsigned long"
15546 case "$uselongdouble:$d_longdbl" in
15548 nvtype="long double"
15549 nvsize=$longdblsize
15556 $echo "(IV will be "$ivtype", $ivsize bytes)"
15557 $echo "(UV will be "$uvtype", $uvsize bytes)"
15558 $echo "(NV will be "$nvtype", $nvsize bytes)"
15561 #$i_inttypes I_INTTYPES
15563 #include <inttypes.h>
15568 int8_t i = INT8_MAX;
15569 uint8_t u = UINT8_MAX;
15570 printf("int8_t\n");
15573 int16_t i = INT16_MAX;
15574 uint16_t i = UINT16_MAX;
15575 printf("int16_t\n");
15578 int32_t i = INT32_MAX;
15579 uint32_t u = UINT32_MAX;
15580 printf("int32_t\n");
15585 i8type="signed char"
15586 u8type="unsigned char"
15591 '') case "$shortsize" in
15593 u16type="unsigned short"
15601 '') set try -DINT16
15602 if eval $compile; then
15603 case "`$run ./try`" in
15615 '') if $test $shortsize -ge 2; then
15617 u16type="unsigned short"
15625 '') case "$longsize" in
15627 u32type="unsigned long"
15631 *) case "$intsize" in
15633 u32type="unsigned int"
15643 '') set try -DINT32
15644 if eval $compile; then
15645 case "`$run ./try`" in
15657 '') if $test $intsize -ge 4; then
15659 u32type="unsigned int"
15667 '') case "$d_quad:$quadtype" in
15669 i64type="$quadtype"
15670 u64type="$uquadtype"
15678 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
15679 : volatile so that the compiler has to store it out to memory.
15680 if test X"$d_volatile" = X"$define"; then
15685 #$i_stdlib I_STDLIB
15687 #include <stdlib.h>
15689 #include <sys/types.h>
15690 #include <signal.h>
15692 $volatile int bletched = 0;
15693 $signal_t blech(int s) { bletched = 1; }
15698 int n = 8 * $uvsize;
15701 signal(SIGFPE, blech);
15704 for (i = 0; i < n; i++) {
15705 u = u << 1 | ($uvtype)1;
15707 if (($uvtype)d != u)
15711 d = ($nvtype)(u - 1);
15712 if (($uvtype)d != (u - 1))
15719 printf("%d\n", ((i == n) ? -n : i));
15725 d_nv_preserves_uv="$undef"
15726 if eval $compile; then
15727 nv_preserves_uv_bits="`$run ./try`"
15729 case "$nv_preserves_uv_bits" in
15731 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
15732 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
15733 d_nv_preserves_uv="$define"
15735 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
15736 d_nv_preserves_uv="$undef" ;;
15737 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
15738 nv_preserves_uv_bits="0" ;;
15742 $echo "Checking to find the largest integer value your NVs can hold..." >&4
15743 : volatile so that the compiler has to store it out to memory.
15744 if test X"$d_volatile" = X"$define"; then
15750 typedef $nvtype NV;
15757 while(count < 256) {
15758 $volatile NV up = value + 1.0;
15759 $volatile NV negated = -value;
15760 $volatile NV down = negated - 1.0;
15761 $volatile NV got_up = up - value;
15762 int up_good = got_up == 1.0;
15763 int got_down = down - negated;
15764 int down_good = got_down == -1.0;
15766 if (down_good != up_good) {
15768 "Inconsistency - up %d %f; down %d %f; for 2**%d (%.20f)\n",
15769 up_good, (double) got_up, down_good, (double) got_down,
15770 count, (double) value);
15777 fputs("256.0", stdout);
15780 fputs("2.0", stdout);
15786 fputs("*", stdout);
15792 fprintf(stderr, "Cannot overflow integer range, even at 2**%d (%.20f)\n",
15793 count, (double) value);
15799 nv_overflows_integers_at='0'
15800 if eval $compile; then
15806 The largest integer your NVs can preserve is equal to $xxx
15808 nv_overflows_integers_at="$xxx"
15811 Cannot determine the largest integer value your NVs can hold, unexpected output
15818 Cannot determine the largest integer value your NVs can hold
15825 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
15826 : volatile so that the compiler has to store it out to memory.
15827 if test X"$d_volatile" = X"$define"; then
15832 #$i_stdlib I_STDLIB
15834 #include <stdlib.h>
15836 #$i_string I_STRING
15838 # include <string.h>
15840 # include <strings.h>
15842 #include <sys/types.h>
15843 #include <signal.h>
15845 $volatile int bletched = 0;
15846 $signal_t blech(int s) { bletched = 1; }
15849 int checkit($nvtype d, char *where) {
15850 unsigned char *p = (char *)&d;
15851 unsigned char *end = p + sizeof(d);
15861 printf("No - %s: 0x", where);
15863 printf ("%02X", *p++);
15868 int main(int argc, char **argv) {
15871 fail += checkit(d, "0.0");
15873 /* The compiler shouldn't be assuming that bletched is 0 */
15876 fail += checkit(d, "bleched");
15879 signal(SIGFPE, blech);
15882 /* Paranoia - the compiler should have no way of knowing that ANSI says
15883 that argv[argc] will always be NULL. Actually, if it did assume this it
15884 would be buggy, as this is C and main() can be called from elsewhere in
15886 d = argv[argc] ? 1 : 0;
15889 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
15892 fail += checkit(d, "ternary");
15894 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
15897 printf("No - memset doesn't give 0.0\n");
15898 /* This might just blow up: */
15899 printf("(gives %g)\n", d);
15905 printf("No - something bleched\n");
15910 printf("No - %d fail(s)\n", fail);
15919 d_nv_zero_is_allbits_zero="$undef"
15920 if eval $compile; then
15926 0.0 is represented as all bits zero in memory
15928 d_nv_zero_is_allbits_zero="$define"
15931 0.0 is not represented as all bits zero in memory
15933 d_nv_zero_is_allbits_zero="$undef"
15938 0.0 is not represented as all bits zero in memory
15940 d_nv_zero_is_allbits_zero="$undef"
15946 : check for off64_t
15948 echo "Checking to see if you have off64_t..." >&4
15950 #include <sys/types.h>
15951 #include <unistd.h>
15952 int main() { off64_t x = 7; }
15955 if eval $compile; then
15957 echo "You have off64_t."
15960 echo "You do not have off64_t."
15961 case "$lseeksize" in
15962 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
15969 : how to create joinable pthreads
15970 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
15972 echo "Checking what constant to use for creating joinable pthreads..." >&4
15973 $cat >try.c <<'EOCP'
15974 #include <pthread.h>
15976 int detachstate = JOINABLE;
15979 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
15980 if eval $compile; then
15981 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
15982 val="$undef" # Yes, undef.
15983 set d_old_pthread_create_joinable
15986 set old_pthread_create_joinable
15989 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
15990 if eval $compile; then
15991 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
15993 set d_old_pthread_create_joinable
15995 val=PTHREAD_CREATE_UNDETACHED
15996 set old_pthread_create_joinable
15999 set try -DJOINABLE=__UNDETACHED
16000 if eval $compile; then
16001 echo "You seem to use __UNDETACHED." >&4
16003 set d_old_pthread_create_joinable
16006 set old_pthread_create_joinable
16009 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
16011 set d_old_pthread_create_joinable
16014 set old_pthread_create_joinable
16021 d_old_pthread_create_joinable="$undef"
16022 old_pthread_create_joinable=""
16025 : see if pause exists
16029 : see if poll exists
16033 : see if readlink exists
16034 set readlink d_readlink
16037 : Check if exe is symlink to abs path of executing program
16041 case "$d_readlink" in
16043 if $issymlink /proc/self/exe ; then
16044 $ls -l /proc/self/exe > reflect
16045 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
16046 echo "You have Linux-like /proc/self/exe."
16047 procselfexe='"/proc/self/exe"'
16051 if $issymlink /proc/curproc/file ; then
16052 $ls -l /proc/curproc/file > reflect
16053 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
16054 echo "You have BSD-like /proc/curproc/file."
16055 procselfexe='"/proc/curproc/file"'
16065 : backward compatibility for d_hvfork
16066 if test X$d_hvfork != X; then
16067 d_vfork="$d_hvfork"
16070 : see if there is a vfork
16075 d_pseudofork=$undef
16077 : Ok, but do we want to use it. vfork is reportedly unreliable in
16078 : perl on Solaris 2.x, and probably elsewhere.
16082 case "$usevfork" in
16088 Perl can only use a vfork() that doesn't suffer from strict
16089 restrictions on calling functions or modifying global data in
16090 the child. For example, glibc-2.1 contains such a vfork()
16091 that is unsuitable. If your system provides a proper fork()
16092 call, chances are that you do NOT want perl to use vfork().
16095 rp="Do you still want to use vfork()?"
16100 echo "Ok, we won't use vfork()."
16109 $define) usevfork='true';;
16110 *) usevfork='false';;
16113 : see whether the pthread_atfork exists
16115 #include <pthread.h>
16118 #ifdef PTHREAD_ATFORK
16119 pthread_atfork(NULL,NULL,NULL);
16124 : see if pthread_atfork exists
16125 set try -DPTHREAD_ATFORK
16126 if eval $compile; then
16131 case "$usethreads" in
16134 $define) echo 'pthread_atfork found.' >&4 ;;
16135 *) echo 'pthread_atfork NOT found.' >&4 ;;
16138 set d_pthread_atfork
16141 : see if pthread_attr_setscope exists
16142 set pthread_attr_setscope d_pthread_attr_setscope
16145 : see whether the various POSIXish _yields exist
16147 #include <pthread.h>
16153 #ifdef PTHREAD_YIELD
16156 #ifdef PTHREAD_YIELD_NULL
16157 pthread_yield(NULL);
16163 : see if sched_yield exists
16164 set try -DSCHED_YIELD
16165 if eval $compile; then
16167 sched_yield='sched_yield()'
16171 case "$usethreads" in
16174 $define) echo 'sched_yield() found.' >&4 ;;
16175 *) echo 'sched_yield() NOT found.' >&4 ;;
16181 : see if pthread_yield exists
16182 set try -DPTHREAD_YIELD
16183 if eval $compile; then
16185 case "$sched_yield" in
16186 '') sched_yield='pthread_yield()' ;;
16189 set try -DPTHREAD_YIELD_NULL
16190 if eval $compile; then
16192 case "$sched_yield" in
16193 '') sched_yield='pthread_yield(NULL)' ;;
16199 case "$usethreads" in
16202 $define) echo 'pthread_yield() found.' >&4 ;;
16203 *) echo 'pthread_yield() NOT found.' >&4 ;;
16207 set d_pthread_yield
16209 case "$sched_yield" in
16210 '') sched_yield=undef ;;
16214 : see if random_r exists
16215 set random_r d_random_r
16217 case "$d_random_r" in
16219 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16220 case "$d_random_r_proto:$usethreads" in
16221 ":define") d_random_r_proto=define
16222 set d_random_r_proto random_r $hdrs
16226 case "$d_random_r_proto" in
16228 case "$random_r_proto" in
16229 ''|0) try='int random_r(int*, struct random_data*);'
16230 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_iS ;;
16232 case "$random_r_proto" in
16233 ''|0) try='int random_r(long*, struct random_data*);'
16234 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_lS ;;
16236 case "$random_r_proto" in
16237 ''|0) try='int random_r(struct random_data*, int32_t*);'
16238 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_St ;;
16240 case "$random_r_proto" in
16241 ''|0) d_random_r=undef
16243 echo "Disabling random_r, cannot determine prototype." >&4 ;;
16244 * ) case "$random_r_proto" in
16245 REENTRANT_PROTO*) ;;
16246 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
16248 echo "Prototype: $try" ;;
16251 *) case "$usethreads" in
16252 define) echo "random_r has no prototype, not using it." >&4 ;;
16259 *) random_r_proto=0
16263 : see if readdir and friends exist
16264 set readdir d_readdir
16266 set seekdir d_seekdir
16268 set telldir d_telldir
16270 set rewinddir d_rewinddir
16273 : see if readdir64_r exists
16274 set readdir64_r d_readdir64_r
16276 case "$d_readdir64_r" in
16278 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16279 case "$d_readdir64_r_proto:$usethreads" in
16280 ":define") d_readdir64_r_proto=define
16281 set d_readdir64_r_proto readdir64_r $hdrs
16285 case "$d_readdir64_r_proto" in
16287 case "$readdir64_r_proto" in
16288 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
16289 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TSR ;;
16291 case "$readdir64_r_proto" in
16292 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
16293 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TS ;;
16295 case "$readdir64_r_proto" in
16296 ''|0) d_readdir64_r=undef
16297 readdir64_r_proto=0
16298 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
16299 * ) case "$readdir64_r_proto" in
16300 REENTRANT_PROTO*) ;;
16301 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
16303 echo "Prototype: $try" ;;
16306 *) case "$usethreads" in
16307 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
16309 d_readdir64_r=undef
16310 readdir64_r_proto=0
16314 *) readdir64_r_proto=0
16318 : see if readdir_r exists
16319 set readdir_r d_readdir_r
16321 case "$d_readdir_r" in
16323 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16324 case "$d_readdir_r_proto:$usethreads" in
16325 ":define") d_readdir_r_proto=define
16326 set d_readdir_r_proto readdir_r $hdrs
16330 case "$d_readdir_r_proto" in
16332 case "$readdir_r_proto" in
16333 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
16334 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TSR ;;
16336 case "$readdir_r_proto" in
16337 ''|0) try='int readdir_r(DIR*, struct dirent*);'
16338 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TS ;;
16340 case "$readdir_r_proto" in
16341 ''|0) d_readdir_r=undef
16343 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
16344 * ) case "$readdir_r_proto" in
16345 REENTRANT_PROTO*) ;;
16346 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
16348 echo "Prototype: $try" ;;
16351 *) case "$usethreads" in
16352 define) echo "readdir_r has no prototype, not using it." >&4 ;;
16359 *) readdir_r_proto=0
16363 : see if readv exists
16367 : see if recvmsg exists
16368 set recvmsg d_recvmsg
16371 : see if rename exists
16372 set rename d_rename
16375 : see if rmdir exists
16379 : see if memory.h is available.
16384 : See if it conflicts with string.h
16390 $cppstdin $cppflags $cppminus < $strings > mem.h
16391 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
16393 echo "We won't be including <memory.h>."
16403 : can bcopy handle overlapping blocks?
16406 case "$d_memmove" in
16407 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
16408 *) case "$d_bcopy" in
16410 echo "Checking to see if bcopy() can do overlapping copies..." >&4
16412 #$i_memory I_MEMORY
16413 #$i_stdlib I_STDLIB
16414 #$i_string I_STRING
16415 #$i_unistd I_UNISTD
16417 $cat >>try.c <<'EOCP'
16420 # include <memory.h>
16423 # include <stdlib.h>
16426 # include <string.h>
16428 # include <strings.h>
16431 # include <unistd.h> /* Needed for NetBSD */
16435 char buf[128], abc[128];
16441 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16442 try to store the string in read-only memory. */
16443 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
16445 for (align = 7; align >= 0; align--) {
16446 for (len = 36; len; len--) {
16448 bcopy(abc, b, len);
16449 for (off = 1; off <= len; off++) {
16450 bcopy(b, b+off, len);
16451 bcopy(b+off, b, len);
16452 if (bcmp(b, abc, len))
16461 if eval $compile_ok; then
16462 if $run ./try 2>/dev/null; then
16463 echo "Yes, it can."
16466 echo "It can't, sorry."
16469 echo "(I can't compile the test program, so we'll assume not...)"
16479 : can memcpy handle overlapping blocks?
16482 case "$d_memmove" in
16483 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
16484 *) case "$d_memcpy" in
16486 echo "Checking to see if memcpy() can do overlapping copies..." >&4
16488 #$i_memory I_MEMORY
16489 #$i_stdlib I_STDLIB
16490 #$i_string I_STRING
16491 #$i_unistd I_UNISTD
16493 $cat >>try.c <<'EOCP'
16496 # include <memory.h>
16499 # include <stdlib.h>
16502 # include <string.h>
16504 # include <strings.h>
16507 # include <unistd.h> /* Needed for NetBSD */
16511 char buf[128], abc[128];
16517 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16518 try to store the string in read-only memory. */
16519 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
16521 for (align = 7; align >= 0; align--) {
16522 for (len = 36; len; len--) {
16524 memcpy(b, abc, len);
16525 for (off = 1; off <= len; off++) {
16526 memcpy(b+off, b, len);
16527 memcpy(b, b+off, len);
16528 if (memcmp(b, abc, len))
16537 if eval $compile_ok; then
16538 if $run ./try 2>/dev/null; then
16539 echo "Yes, it can."
16542 echo "It can't, sorry."
16545 echo "(I can't compile the test program, so we'll assume not...)"
16555 : can memcmp be trusted to compare relative magnitude?
16557 case "$d_memcmp" in
16560 echo "Checking if your memcmp() can compare relative magnitude..." >&4
16562 #$i_memory I_MEMORY
16563 #$i_stdlib I_STDLIB
16564 #$i_string I_STRING
16565 #$i_unistd I_UNISTD
16567 $cat >>try.c <<'EOCP'
16570 # include <memory.h>
16573 # include <stdlib.h>
16576 # include <string.h>
16578 # include <strings.h>
16581 # include <unistd.h> /* Needed for NetBSD */
16587 if ((a < b) && memcmp(&a, &b, 1) < 0)
16593 if eval $compile_ok; then
16594 if $run ./try 2>/dev/null; then
16595 echo "Yes, it can."
16598 echo "No, it can't (it uses signed chars)."
16601 echo "(I can't compile the test program, so we'll assume not...)"
16609 : see if prototype for sbrk is available
16611 set d_sbrkproto sbrk $i_unistd unistd.h
16614 : see if select exists
16615 set select d_select
16618 : see if semctl exists
16619 set semctl d_semctl
16622 : see if semget exists
16623 set semget d_semget
16626 : see if semop exists
16630 : see how much of the 'sem*(2)' library is present.
16633 case "$d_semctl$d_semget$d_semop" in
16634 *"$undef"*) h_sem=false;;
16638 case "`ipcs 2>&1`" in
16639 "SVID messages"*"not configured"*)
16640 echo "Your $osname does not have the sem*(2) configured." >&4
16643 set semctl d_semctl
16645 set semget d_semget
16653 : we could also check for sys/ipc.h ...
16654 if $h_sem && $test `./findhdr sys/sem.h`; then
16655 echo "You have the full sem*(2) library." >&4
16658 echo "You don't have the full sem*(2) library." >&4
16664 : see whether sys/sem.h defines union semun
16666 $cat > try.c <<'END'
16667 #include <sys/types.h>
16668 #include <sys/ipc.h>
16669 #include <sys/sem.h>
16670 int main () { union semun semun; semun.buf = 0; }
16673 if eval $compile; then
16674 echo "You have union semun in <sys/sem.h>." >&4
16677 echo "You do not have union semun in <sys/sem.h>." >&4
16684 : see how to do semctl IPC_STAT
16688 $cat > tryh.h <<END
16691 # define S_IRUSR S_IREAD
16692 # define S_IWUSR S_IWRITE
16693 # define S_IXUSR S_IEXEC
16695 # define S_IRUSR 0400
16696 # define S_IWUSR 0200
16697 # define S_IXUSR 0100
16699 # define S_IRGRP (S_IRUSR>>3)
16700 # define S_IWGRP (S_IWUSR>>3)
16701 # define S_IXGRP (S_IXUSR>>3)
16702 # define S_IROTH (S_IRUSR>>6)
16703 # define S_IWOTH (S_IWUSR>>6)
16704 # define S_IXOTH (S_IXUSR>>6)
16707 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
16708 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
16709 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
16712 : see whether semctl IPC_STAT can use union semun
16713 case "$d_semctl_semun" in
16717 #include <sys/types.h>
16718 #include <sys/ipc.h>
16719 #include <sys/sem.h>
16720 #include <sys/stat.h>
16727 #$d_union_semun HAS_UNION_SEMUN
16730 #ifndef HAS_UNION_SEMUN
16733 struct semid_ds *buf;
16734 unsigned short *array;
16740 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16741 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16743 struct semid_ds argbuf;
16746 st = semctl(sem, 0, IPC_STAT, arg);
16750 # endif /* IPC_STAT */
16751 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16753 if (semctl(sem, 0, IPC_RMID, arg) != 0)
16754 # endif /* IPC_RMID */
16755 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16757 #endif /* IPC_PRIVATE && ... */
16758 printf("semget failed: errno = %d\n", errno);
16763 if eval $compile; then
16766 semun) val="$define" ;;
16774 case "$d_semctl_semun" in
16776 echo "You can use union semun for semctl IPC_STAT." >&4
16779 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
16784 : see whether semctl IPC_STAT can use struct semid_ds pointer
16785 case "$d_semctl_semid_ds" in
16788 $cat > try.c <<'END'
16789 #include <sys/types.h>
16790 #include <sys/ipc.h>
16791 #include <sys/sem.h>
16792 #include <sys/stat.h>
16800 struct semid_ds arg;
16803 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16804 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16807 st = semctl(sem, 0, IPC_STAT, &arg);
16809 printf("semid_ds\n");
16811 # endif /* IPC_STAT */
16812 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16814 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
16815 # endif /* IPC_RMID */
16816 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16818 #endif /* IPC_PRIVATE && ... */
16819 printf("semget failed: errno = %d\n", errno);
16825 if eval $compile; then
16828 semid_ds) val="$define" ;;
16832 set d_semctl_semid_ds
16836 case "$d_semctl_semid_ds" in
16838 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
16840 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
16846 # We do not have the full sem*(2) library, so assume we can not
16852 set d_semctl_semid_ds
16858 : see if sendmsg exists
16859 set sendmsg d_sendmsg
16862 : see if setegid exists
16863 set setegid d_setegid
16866 : see if seteuid exists
16867 set seteuid d_seteuid
16870 : see if setgrent exists
16871 set setgrent d_setgrent
16874 : see if setgrent_r exists
16875 set setgrent_r d_setgrent_r
16877 case "$d_setgrent_r" in
16879 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
16880 case "$d_setgrent_r_proto:$usethreads" in
16881 ":define") d_setgrent_r_proto=define
16882 set d_setgrent_r_proto setgrent_r $hdrs
16886 case "$d_setgrent_r_proto" in
16888 case "$setgrent_r_proto" in
16889 ''|0) try='int setgrent_r(FILE**);'
16890 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=I_H ;;
16892 case "$setgrent_r_proto" in
16893 ''|0) try='void setgrent_r(FILE**);'
16894 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=V_H ;;
16896 case "$setgrent_r_proto" in
16897 ''|0) d_setgrent_r=undef
16899 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
16900 * ) case "$setgrent_r_proto" in
16901 REENTRANT_PROTO*) ;;
16902 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
16904 echo "Prototype: $try" ;;
16907 *) case "$usethreads" in
16908 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
16915 *) setgrent_r_proto=0
16919 : see if sethostent exists
16920 set sethostent d_sethent
16923 : see if sethostent_r exists
16924 set sethostent_r d_sethostent_r
16926 case "$d_sethostent_r" in
16928 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16929 case "$d_sethostent_r_proto:$usethreads" in
16930 ":define") d_sethostent_r_proto=define
16931 set d_sethostent_r_proto sethostent_r $hdrs
16935 case "$d_sethostent_r_proto" in
16937 case "$sethostent_r_proto" in
16938 ''|0) try='int sethostent_r(int, struct hostent_data*);'
16939 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=I_ID ;;
16941 case "$sethostent_r_proto" in
16942 ''|0) try='void sethostent_r(int, struct hostent_data*);'
16943 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=V_ID ;;
16945 case "$sethostent_r_proto" in
16946 ''|0) d_sethostent_r=undef
16947 sethostent_r_proto=0
16948 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
16949 * ) case "$sethostent_r_proto" in
16950 REENTRANT_PROTO*) ;;
16951 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
16953 echo "Prototype: $try" ;;
16956 *) case "$usethreads" in
16957 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
16959 d_sethostent_r=undef
16960 sethostent_r_proto=0
16964 *) sethostent_r_proto=0
16968 : see if setitimer exists
16969 set setitimer d_setitimer
16972 : see if setlinebuf exists
16973 set setlinebuf d_setlinebuf
16976 : see if setlocale exists
16977 set setlocale d_setlocale
16980 : see if locale.h is available
16981 set locale.h i_locale
16984 : see if setlocale_r exists
16985 set setlocale_r d_setlocale_r
16987 case "$d_setlocale_r" in
16989 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
16990 case "$d_setlocale_r_proto:$usethreads" in
16991 ":define") d_setlocale_r_proto=define
16992 set d_setlocale_r_proto setlocale_r $hdrs
16996 case "$d_setlocale_r_proto" in
16998 case "$setlocale_r_proto" in
16999 ''|0) try='int setlocale_r(int, const char*, char*, int);'
17000 ./protochk "$extern_C $try" $hdrs && setlocale_r_proto=I_ICBI ;;
17002 case "$setlocale_r_proto" in
17003 ''|0) d_setlocale_r=undef
17004 setlocale_r_proto=0
17005 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
17006 * ) case "$setlocale_r_proto" in
17007 REENTRANT_PROTO*) ;;
17008 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
17010 echo "Prototype: $try" ;;
17013 *) case "$usethreads" in
17014 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
17016 d_setlocale_r=undef
17017 setlocale_r_proto=0
17021 *) setlocale_r_proto=0
17025 : see if setnetent exists
17026 set setnetent d_setnent
17029 : see if setnetent_r exists
17030 set setnetent_r d_setnetent_r
17032 case "$d_setnetent_r" in
17034 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17035 case "$d_setnetent_r_proto:$usethreads" in
17036 ":define") d_setnetent_r_proto=define
17037 set d_setnetent_r_proto setnetent_r $hdrs
17041 case "$d_setnetent_r_proto" in
17043 case "$setnetent_r_proto" in
17044 ''|0) try='int setnetent_r(int, struct netent_data*);'
17045 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=I_ID ;;
17047 case "$setnetent_r_proto" in
17048 ''|0) try='void setnetent_r(int, struct netent_data*);'
17049 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=V_ID ;;
17051 case "$setnetent_r_proto" in
17052 ''|0) d_setnetent_r=undef
17053 setnetent_r_proto=0
17054 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
17055 * ) case "$setnetent_r_proto" in
17056 REENTRANT_PROTO*) ;;
17057 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
17059 echo "Prototype: $try" ;;
17062 *) case "$usethreads" in
17063 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
17065 d_setnetent_r=undef
17066 setnetent_r_proto=0
17070 *) setnetent_r_proto=0
17074 : see if setprotoent exists
17075 set setprotoent d_setpent
17078 : see if setpgid exists
17079 set setpgid d_setpgid
17082 : see if setpgrp2 exists
17083 set setpgrp2 d_setpgrp2
17086 : see if setpriority exists
17087 set setpriority d_setprior
17090 : see if setproctitle exists
17091 set setproctitle d_setproctitle
17094 : see if setprotoent_r exists
17095 set setprotoent_r d_setprotoent_r
17097 case "$d_setprotoent_r" in
17099 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17100 case "$d_setprotoent_r_proto:$usethreads" in
17101 ":define") d_setprotoent_r_proto=define
17102 set d_setprotoent_r_proto setprotoent_r $hdrs
17106 case "$d_setprotoent_r_proto" in
17108 case "$setprotoent_r_proto" in
17109 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
17110 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=I_ID ;;
17112 case "$setprotoent_r_proto" in
17113 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
17114 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=V_ID ;;
17116 case "$setprotoent_r_proto" in
17117 ''|0) d_setprotoent_r=undef
17118 setprotoent_r_proto=0
17119 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
17120 * ) case "$setprotoent_r_proto" in
17121 REENTRANT_PROTO*) ;;
17122 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
17124 echo "Prototype: $try" ;;
17127 *) case "$usethreads" in
17128 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
17130 d_setprotoent_r=undef
17131 setprotoent_r_proto=0
17135 *) setprotoent_r_proto=0
17139 : see if setpwent exists
17140 set setpwent d_setpwent
17143 : see if setpwent_r exists
17144 set setpwent_r d_setpwent_r
17146 case "$d_setpwent_r" in
17148 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
17149 case "$d_setpwent_r_proto:$usethreads" in
17150 ":define") d_setpwent_r_proto=define
17151 set d_setpwent_r_proto setpwent_r $hdrs
17155 case "$d_setpwent_r_proto" in
17157 case "$setpwent_r_proto" in
17158 ''|0) try='int setpwent_r(FILE**);'
17159 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=I_H ;;
17161 case "$setpwent_r_proto" in
17162 ''|0) try='void setpwent_r(FILE**);'
17163 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=V_H ;;
17165 case "$setpwent_r_proto" in
17166 ''|0) d_setpwent_r=undef
17168 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
17169 * ) case "$setpwent_r_proto" in
17170 REENTRANT_PROTO*) ;;
17171 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
17173 echo "Prototype: $try" ;;
17176 *) case "$usethreads" in
17177 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
17184 *) setpwent_r_proto=0
17188 : see if setregid exists
17189 set setregid d_setregid
17191 set setresgid d_setresgid
17194 : see if setreuid exists
17195 set setreuid d_setreuid
17197 set setresuid d_setresuid
17200 : see if setrgid exists
17201 set setrgid d_setrgid
17204 : see if setruid exists
17205 set setruid d_setruid
17208 : see if setservent exists
17209 set setservent d_setsent
17212 : see if setservent_r exists
17213 set setservent_r d_setservent_r
17215 case "$d_setservent_r" in
17217 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17218 case "$d_setservent_r_proto:$usethreads" in
17219 ":define") d_setservent_r_proto=define
17220 set d_setservent_r_proto setservent_r $hdrs
17224 case "$d_setservent_r_proto" in
17226 case "$setservent_r_proto" in
17227 ''|0) try='int setservent_r(int, struct servent_data*);'
17228 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=I_ID ;;
17230 case "$setservent_r_proto" in
17231 ''|0) try='void setservent_r(int, struct servent_data*);'
17232 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=V_ID ;;
17234 case "$setservent_r_proto" in
17235 ''|0) d_setservent_r=undef
17236 setservent_r_proto=0
17237 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
17238 * ) case "$setservent_r_proto" in
17239 REENTRANT_PROTO*) ;;
17240 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
17242 echo "Prototype: $try" ;;
17245 *) case "$usethreads" in
17246 define) echo "setservent_r has no prototype, not using it." >&4 ;;
17248 d_setservent_r=undef
17249 setservent_r_proto=0
17253 *) setservent_r_proto=0
17257 : see if setsid exists
17258 set setsid d_setsid
17261 : see if setvbuf exists
17262 set setvbuf d_setvbuf
17265 : see if sfio.h is available
17269 : see if sfio library is available
17280 : Ok, but do we want to use it.
17284 true|$define|[yY]*) dflt='y';;
17287 echo "$package can use the sfio library, but it is experimental."
17288 case "$useperlio" in
17290 echo "For sfio also the PerlIO abstraction layer is needed."
17291 echo "Earlier you said you wouldn't want that."
17294 rp="You seem to have sfio available, do you want to try using it?"
17297 y|Y) echo "Ok, turning on both sfio and PerlIO, then."
17298 useperlio="$define"
17301 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
17306 *) case "$usesfio" in
17307 true|$define|[yY]*)
17308 echo "Sorry, cannot find sfio on this machine." >&4
17309 echo "Ignoring your setting of usesfio=$usesfio." >&4
17318 $define) usesfio='true';;
17319 *) usesfio='false';;
17323 *) : Remove sfio from list of libraries to use
17326 echo "Removing unneeded -lsfio from library list" >&4
17327 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
17330 echo "libs = $libs" >&4
17337 : see if shmctl exists
17338 set shmctl d_shmctl
17341 : see if shmget exists
17342 set shmget d_shmget
17345 : see if shmat exists
17348 : see what shmat returns
17351 $cat >shmat.c <<'END'
17352 #include <sys/shm.h>
17355 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
17360 echo "and it returns ($shmattype)." >&4
17361 : see if a prototype for shmat is available
17362 xxx=`./findhdr sys/shm.h`
17363 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
17364 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
17375 set d_shmatprototype
17378 : see if shmdt exists
17382 : see how much of the 'shm*(2)' library is present.
17385 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
17386 *"$undef"*) h_shm=false;;
17390 case "`ipcs 2>&1`" in
17391 "SVID shared memory"*"not configured"*)
17392 echo "Your $osname does not have the shm*(2) configured." >&4
17395 set shmctl d_shmctl
17397 set shmget d_shmget
17407 : we could also check for sys/ipc.h ...
17408 if $h_shm && $test `./findhdr sys/shm.h`; then
17409 echo "You have the full shm*(2) library." >&4
17412 echo "You don't have the full shm*(2) library." >&4
17418 : see if we have sigaction
17420 if set sigaction val -f d_sigaction; eval $csym; $val; then
17421 echo 'sigaction() found.' >&4
17424 #include <sys/types.h>
17425 #include <signal.h>
17426 #$i_stdlib I_STDLIB
17428 #include <stdlib.h>
17432 struct sigaction act, oact;
17434 oact.sa_handler = 0;
17435 /* so that act and oact are used */
17436 exit(act.sa_flags == 0 && oact.sa_handler == 0);
17440 if eval $compile_ok; then
17443 echo "But you don't seem to have a useable struct sigaction." >&4
17447 echo 'sigaction NOT found.' >&4
17450 set d_sigaction; eval $setvar
17453 : see if this is a sunmath.h system
17454 set sunmath.h i_sunmath
17457 : see if signbit exists
17458 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
17461 #$i_sunmath I_SUNMATH
17465 #ifdef I_SUNMATH /* Solaris special math library */
17466 # include <sunmath.h>
17469 int main(int argc, char **argv)
17473 if ((signbit(x) == 0) && (signbit(y) != 0))
17481 if eval $compile; then
17482 if $run ./try; then
17486 $echo "Signbit seems to be available, but doesn't work as I expected."
17487 $echo "I won't use it." >&4
17498 : see if sigprocmask exists
17499 set sigprocmask d_sigprocmask
17502 : see if sigsetjmp exists
17504 case "$d_sigsetjmp" in
17507 #include <setjmp.h>
17508 #$i_stdlib I_STDLIB
17510 #include <stdlib.h>
17516 if (sigsetjmp(env,1))
17519 siglongjmp(env, 1);
17524 if eval $compile; then
17525 if $run ./try >/dev/null 2>&1; then
17526 echo "POSIX sigsetjmp found." >&4
17530 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
17536 echo "sigsetjmp not found." >&4
17540 *) val="$d_sigsetjmp"
17541 case "$d_sigsetjmp" in
17542 $define) echo "POSIX sigsetjmp found." >&4;;
17543 $undef) echo "sigsetjmp not found." >&4;;
17551 : see if snprintf exists
17552 set snprintf d_snprintf
17555 : see if vsnprintf exists
17556 set vsnprintf d_vsnprintf
17559 case "$d_snprintf-$d_vsnprintf" in
17562 Checking whether your snprintf() and vsnprintf() work okay...
17564 $cat >try.c <<'EOCP'
17565 /* v?snprintf testing logic courtesy of Russ Allbery.
17566 * According to C99:
17567 * - if the buffer is too short it still must be \0-terminated
17568 * - if the buffer is too short the potentially required length
17569 * must be returned and not -1
17570 * - if the buffer is NULL the potentially required length
17571 * must be returned and not -1 or core dump
17574 #include <stdarg.h>
17578 int test (char *format, ...)
17583 va_start (args, format);
17584 count = vsnprintf (buf, sizeof buf, format, args);
17591 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
17592 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
17596 if eval $compile; then
17599 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
17601 Your snprintf() and snprintf() don't seem to be working okay.
17603 d_snprintf="$undef"
17604 d_vsnprintf="$undef"
17608 echo "(I can't seem to compile the test program--assuming they don't)"
17609 d_snprintf="$undef"
17610 d_vsnprintf="$undef"
17616 : see if sockatmark exists
17617 set sockatmark d_sockatmark
17620 : see if prototype for sockatmark is available
17622 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
17625 : see if socks5_init exists
17626 set socks5_init d_socks5_init
17629 : see if sprintf returns the length of the string in the buffer as per ANSI
17630 $echo "Checking whether sprintf returns the length of the string..." >&4
17633 #$i_stdlib I_STDLIB
17635 #include <stdlib.h>
17637 #$i_string I_STRING
17639 # include <string.h>
17641 # include <strings.h>
17650 int check (size_t expect, int test) {
17651 size_t got = strlen(buffer);
17655 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
17660 int main(int argc, char **argv) {
17663 check(sprintf(buffer, ""), ++test);
17664 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
17665 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
17672 if eval $compile; then
17676 sprintf returns the length of the string (as ANSI says it should)
17678 d_sprintf_returns_strlen="$define"
17681 sprintf does not return the length of the string (how old is this system?)
17683 d_sprintf_returns_strlen="$undef"
17687 echo "(I can't seem to compile the test program--assuming it doesn't)" >&4
17688 d_sprintf_returns_strlen="$undef"
17692 : see if srand48_r exists
17693 set srand48_r d_srand48_r
17695 case "$d_srand48_r" in
17697 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17698 case "$d_srand48_r_proto:$usethreads" in
17699 ":define") d_srand48_r_proto=define
17700 set d_srand48_r_proto srand48_r $hdrs
17704 case "$d_srand48_r_proto" in
17706 case "$srand48_r_proto" in
17707 ''|0) try='int srand48_r(long, struct drand48_data*);'
17708 ./protochk "$extern_C $try" $hdrs && srand48_r_proto=I_LS ;;
17710 case "$srand48_r_proto" in
17711 ''|0) d_srand48_r=undef
17713 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
17714 * ) case "$srand48_r_proto" in
17715 REENTRANT_PROTO*) ;;
17716 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
17718 echo "Prototype: $try" ;;
17721 *) case "$usethreads" in
17722 define) echo "srand48_r has no prototype, not using it." >&4 ;;
17729 *) srand48_r_proto=0
17733 : see if srandom_r exists
17734 set srandom_r d_srandom_r
17736 case "$d_srandom_r" in
17738 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17739 case "$d_srandom_r_proto:$usethreads" in
17740 ":define") d_srandom_r_proto=define
17741 set d_srandom_r_proto srandom_r $hdrs
17745 case "$d_srandom_r_proto" in
17747 case "$srandom_r_proto" in
17748 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
17749 ./protochk "$extern_C $try" $hdrs && srandom_r_proto=I_TS ;;
17751 case "$srandom_r_proto" in
17752 ''|0) d_srandom_r=undef
17754 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
17755 * ) case "$srandom_r_proto" in
17756 REENTRANT_PROTO*) ;;
17757 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
17759 echo "Prototype: $try" ;;
17762 *) case "$usethreads" in
17763 define) echo "srandom_r has no prototype, not using it." >&4 ;;
17770 *) srandom_r_proto=0
17774 : see if prototype for setresgid is available
17776 set d_sresgproto setresgid $i_unistd unistd.h
17779 : see if prototype for setresuid is available
17781 set d_sresuproto setresuid $i_unistd unistd.h
17784 : see if sys/stat.h is available
17785 set sys/stat.h i_sysstat
17788 : see if stat knows about block sizes
17790 echo "Checking to see if your struct stat has st_blocks field..." >&4
17791 set d_statblks stat st_blocks $i_sysstat sys/stat.h
17794 : see if this is a sys/vfs.h system
17795 set sys/vfs.h i_sysvfs
17798 : see if this is a sys/statfs.h system
17799 set sys/statfs.h i_sysstatfs
17802 : Check for statfs_s
17804 echo "Checking to see if your system supports struct statfs..." >&4
17805 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
17807 case "$d_statfs_s" in
17808 "$define") echo "Yes, it does." ;;
17809 *) echo "No, it doesn't." ;;
17813 : see if struct statfs knows about f_flags
17814 case "$d_statfs_s" in
17817 echo "Checking to see if your struct statfs has f_flags field..." >&4
17818 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
17822 set d_statfs_f_flags
17826 case "$d_statfs_f_flags" in
17827 "$define") echo "Yes, it does." ;;
17828 *) echo "No, it doesn't." ;;
17831 : Check stream access
17833 Checking how to access stdio streams by file descriptor number...
17835 case "$stdio_stream_array" in
17836 '') $cat >try.c <<EOCP
17839 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
17843 for s in _iob __iob __sF
17845 set try -DSTDIO_STREAM_ARRAY=$s
17846 if eval $compile; then
17847 case "`$run ./try`" in
17848 yes) stdio_stream_array=$s; break ;;
17854 case "$stdio_stream_array" in
17856 I can't figure out how to access stdio streams by file descriptor number.
17858 d_stdio_stream_array="$undef"
17861 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
17863 d_stdio_stream_array="$define"
17867 : see if strcoll exists
17868 set strcoll d_strcoll
17871 : check for structure copying
17873 echo "Checking to see if your C compiler can copy structs..." >&4
17874 $cat >try.c <<'EOCP'
17884 if $cc -c try.c >/dev/null 2>&1 ; then
17886 echo "Yup, it can."
17889 echo "Nope, it can't."
17895 : see if strerror and/or sys_errlist[] exist
17897 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
17898 if set strerror val -f d_strerror; eval $csym; $val; then
17899 echo 'strerror() found.' >&4
17900 d_strerror="$define"
17901 d_strerrm='strerror(e)'
17902 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17903 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
17904 d_syserrlst="$define"
17906 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
17907 d_syserrlst="$undef"
17909 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
17910 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
17911 echo 'strerror() found in string header.' >&4
17912 d_strerror="$define"
17913 d_strerrm='strerror(e)'
17914 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17915 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
17916 d_syserrlst="$define"
17918 echo "(You don't appear to have any sys_errlist[], how can this be?)"
17919 d_syserrlst="$undef"
17921 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17922 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
17923 d_strerror="$undef"
17924 d_syserrlst="$define"
17925 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
17927 echo 'strerror() and sys_errlist[] NOT found.' >&4
17928 d_strerror="$undef"
17929 d_syserrlst="$undef"
17930 d_strerrm='"unknown"'
17934 : see if strerror_r exists
17935 set strerror_r d_strerror_r
17937 case "$d_strerror_r" in
17939 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
17940 case "$d_strerror_r_proto:$usethreads" in
17941 ":define") d_strerror_r_proto=define
17942 set d_strerror_r_proto strerror_r $hdrs
17946 case "$d_strerror_r_proto" in
17948 case "$strerror_r_proto" in
17949 ''|0) try='int strerror_r(int, char*, size_t);'
17950 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBW ;;
17952 case "$strerror_r_proto" in
17953 ''|0) try='int strerror_r(int, char*, int);'
17954 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBI ;;
17956 case "$strerror_r_proto" in
17957 ''|0) try='char* strerror_r(int, char*, size_t);'
17958 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=B_IBW ;;
17960 case "$strerror_r_proto" in
17961 ''|0) d_strerror_r=undef
17963 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
17964 * ) case "$strerror_r_proto" in
17965 REENTRANT_PROTO*) ;;
17966 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
17968 echo "Prototype: $try" ;;
17971 *) case "$usethreads" in
17972 define) echo "strerror_r has no prototype, not using it." >&4 ;;
17979 *) strerror_r_proto=0
17983 : see if strftime exists
17984 set strftime d_strftime
17987 : see if strlcat exists
17988 set strlcat d_strlcat
17991 : see if strlcpy exists
17992 set strlcpy d_strlcpy
17995 : see if strtod exists
17996 set strtod d_strtod
17999 : see if strtol exists
18000 set strtol d_strtol
18003 : see if strtold exists
18004 set strtold d_strtold
18007 : see if strtoll exists
18008 set strtoll d_strtoll
18011 case "$d_longlong-$d_strtoll" in
18014 Checking whether your strtoll() works okay...
18016 $cat >try.c <<'EOCP'
18019 #define strtoll __strtoll
18022 #define strtoll _strtoll
18025 extern long long int strtoll(char *s, char **, int);
18026 static int bad = 0;
18027 int check(char *s, long long ell, int een) {
18030 gll = strtoll(s, 0, 10);
18031 if (!((gll == ell) && (errno == een)))
18035 check(" 1", 1LL, 0);
18036 check(" 0", 0LL, 0);
18037 check("-1", -1LL, 0);
18038 check("-9223372036854775808", -9223372036854775808LL, 0);
18039 check("-9223372036854775808", -9223372036854775808LL, 0);
18040 check(" 9223372036854775807", 9223372036854775807LL, 0);
18041 check("-9223372036854775808", -9223372036854775808LL, 0);
18042 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
18043 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
18049 if eval $compile; then
18052 ok) echo "Your strtoll() seems to be working okay." ;;
18054 Your strtoll() doesn't seem to be working okay.
18060 echo "(I can't seem to compile the test program--assuming it doesn't)"
18066 : see if strtoq exists
18067 set strtoq d_strtoq
18070 : see if strtoul exists
18071 set strtoul d_strtoul
18074 case "$d_strtoul" in
18077 Checking whether your strtoul() works okay...
18079 $cat >try.c <<'EOCP'
18082 extern unsigned long int strtoul(char *s, char **, int);
18083 static int bad = 0;
18084 void check(char *s, unsigned long eul, int een) {
18087 gul = strtoul(s, 0, 10);
18088 if (!((gul == eul) && (errno == een)))
18092 check(" 1", 1L, 0);
18093 check(" 0", 0L, 0);
18095 case "$longsize" in
18097 $cat >>try.c <<'EOCP'
18098 check("18446744073709551615", 18446744073709551615UL, 0);
18099 check("18446744073709551616", 18446744073709551615UL, ERANGE);
18100 #if 0 /* strtoul() for /^-/ strings is undefined. */
18101 check("-1", 18446744073709551615UL, 0);
18102 check("-18446744073709551614", 2, 0);
18103 check("-18446744073709551615", 1, 0);
18104 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
18105 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
18110 $cat >>try.c <<'EOCP'
18111 check("4294967295", 4294967295UL, 0);
18112 check("4294967296", 4294967295UL, ERANGE);
18113 #if 0 /* strtoul() for /^-/ strings is undefined. */
18114 check("-1", 4294967295UL, 0);
18115 check("-4294967294", 2, 0);
18116 check("-4294967295", 1, 0);
18117 check("-4294967296", 4294967295UL, ERANGE);
18118 check("-4294967297", 4294967295UL, ERANGE);
18123 : Should we write these tests to be more portable by sprintf-ing
18124 : ~0 and then manipulating that char string as input for strtol?
18127 $cat >>try.c <<'EOCP'
18134 if eval $compile; then
18135 case "`$run ./try`" in
18136 ok) echo "Your strtoul() seems to be working okay." ;;
18138 Your strtoul() doesn't seem to be working okay.
18144 echo "(I can't seem to compile the test program--assuming it doesn't)"
18150 : see if strtoull exists
18151 set strtoull d_strtoull
18154 case "$d_longlong-$d_strtoull" in
18157 Checking whether your strtoull() works okay...
18159 $cat >try.c <<'EOCP'
18162 #define strtoull __strtoull
18165 extern unsigned long long int strtoull(char *s, char **, int);
18166 static int bad = 0;
18167 int check(char *s, long long eull, int een) {
18170 gull = strtoull(s, 0, 10);
18171 if (!((gull == eull) && (errno == een)))
18175 check(" 1", 1LL, 0);
18176 check(" 0", 0LL, 0);
18177 check("18446744073709551615", 18446744073709551615ULL, 0);
18178 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18179 #if 0 /* strtoull() for /^-/ strings is undefined. */
18180 check("-1", 18446744073709551615ULL, 0);
18181 check("-18446744073709551614", 2LL, 0);
18182 check("-18446744073709551615", 1LL, 0);
18183 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18184 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18191 if eval $compile; then
18192 case "`$run ./try`" in
18193 ok) echo "Your strtoull() seems to be working okay." ;;
18195 Your strtoull() doesn't seem to be working okay.
18197 d_strtoull="$undef"
18201 echo "(I can't seem to compile the test program--assuming it doesn't)"
18202 d_strtoull="$undef"
18207 : see if strtouq exists
18208 set strtouq d_strtouq
18211 case "$d_strtouq" in
18214 Checking whether your strtouq() works okay...
18216 $cat >try.c <<'EOCP'
18219 extern unsigned long long int strtouq(char *s, char **, int);
18220 static int bad = 0;
18221 void check(char *s, unsigned long long eull, int een) {
18222 unsigned long long gull;
18224 gull = strtouq(s, 0, 10);
18225 if (!((gull == eull) && (errno == een)))
18229 check(" 1", 1LL, 0);
18230 check(" 0", 0LL, 0);
18231 check("18446744073709551615", 18446744073709551615ULL, 0);
18232 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18233 #if 0 /* strtouq() for /^-/ strings is undefined. */
18234 check("-1", 18446744073709551615ULL, 0);
18235 check("-18446744073709551614", 2LL, 0);
18236 check("-18446744073709551615", 1LL, 0);
18237 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18238 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18246 if eval $compile; then
18247 case "`$run ./try`" in
18248 ok) echo "Your strtouq() seems to be working okay." ;;
18250 Your strtouq() doesn't seem to be working okay.
18256 echo "(I can't seem to compile the test program--assuming it doesn't)"
18262 : see if strxfrm exists
18263 set strxfrm d_strxfrm
18266 : see if symlink exists
18267 set symlink d_symlink
18270 : see if syscall exists
18271 set syscall d_syscall
18274 : see if prototype for syscall is available
18276 set d_syscallproto syscall $i_unistd unistd.h
18279 : see if sysconf exists
18280 set sysconf d_sysconf
18283 : see if system exists
18284 set system d_system
18287 : see if tcgetpgrp exists
18288 set tcgetpgrp d_tcgetpgrp
18291 : see if tcsetpgrp exists
18292 set tcsetpgrp d_tcsetpgrp
18295 : see if prototype for telldir is available
18297 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
18300 : see if time exists
18302 if test "X$d_time" = X -o X"$timetype" = X; then
18303 if set time val -f d_time; eval $csym; $val; then
18304 echo 'time() found.' >&4
18306 rp="What is the type returned by time() on this system?"
18307 set time_t timetype long stdio.h sys/types.h
18310 echo 'time() not found, hope that will do.' >&4
18318 : see if timegm exists
18319 set timegm d_timegm
18322 : see if this is a sys/times.h system
18323 set sys/times.h i_systimes
18326 : see if times exists
18328 if set times val -f d_times; eval $csym; $val; then
18329 echo 'times() found.' >&4
18332 case "$i_systimes" in
18333 "$define") inc='sys/times.h';;
18335 rp="What is the type returned by times() on this system?"
18336 set clock_t clocktype long stdio.h sys/types.h $inc
18339 echo 'times() NOT found, hope that will do.' >&4
18344 : see if tmpnam_r exists
18345 set tmpnam_r d_tmpnam_r
18347 case "$d_tmpnam_r" in
18349 hdrs="$i_systypes sys/types.h define stdio.h "
18350 case "$d_tmpnam_r_proto:$usethreads" in
18351 ":define") d_tmpnam_r_proto=define
18352 set d_tmpnam_r_proto tmpnam_r $hdrs
18356 case "$d_tmpnam_r_proto" in
18358 case "$tmpnam_r_proto" in
18359 ''|0) try='char* tmpnam_r(char*);'
18360 ./protochk "$extern_C $try" $hdrs && tmpnam_r_proto=B_B ;;
18362 case "$tmpnam_r_proto" in
18363 ''|0) d_tmpnam_r=undef
18365 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
18366 * ) case "$tmpnam_r_proto" in
18367 REENTRANT_PROTO*) ;;
18368 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
18370 echo "Prototype: $try" ;;
18373 *) case "$usethreads" in
18374 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
18381 *) tmpnam_r_proto=0
18385 : see if truncate exists
18386 set truncate d_truncate
18389 : see if ttyname_r exists
18390 set ttyname_r d_ttyname_r
18392 case "$d_ttyname_r" in
18394 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
18395 case "$d_ttyname_r_proto:$usethreads" in
18396 ":define") d_ttyname_r_proto=define
18397 set d_ttyname_r_proto ttyname_r $hdrs
18401 case "$d_ttyname_r_proto" in
18403 case "$ttyname_r_proto" in
18404 ''|0) try='int ttyname_r(int, char*, size_t);'
18405 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBW ;;
18407 case "$ttyname_r_proto" in
18408 ''|0) try='int ttyname_r(int, char*, int);'
18409 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBI ;;
18411 case "$ttyname_r_proto" in
18412 ''|0) try='char* ttyname_r(int, char*, int);'
18413 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=B_IBI ;;
18415 case "$ttyname_r_proto" in
18416 ''|0) d_ttyname_r=undef
18418 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
18419 * ) case "$ttyname_r_proto" in
18420 REENTRANT_PROTO*) ;;
18421 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
18423 echo "Prototype: $try" ;;
18426 *) case "$usethreads" in
18427 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
18434 *) ttyname_r_proto=0
18438 : see if tzname[] exists
18440 if set tzname val -a d_tzname; eval $csym; $val; then
18442 echo 'tzname[] found.' >&4
18445 echo 'tzname[] NOT found.' >&4
18450 : Check if is a multiplatform env
18452 next|rhapsody|darwin) multiarch="$define" ;;
18454 case "$multiarch" in
18455 ''|[nN]*) multiarch="$undef" ;;
18458 : check for ordering of bytes in a UV
18460 case "$usecrosscompile$multiarch" in
18463 You seem to be either cross-compiling or doing a multiarchitecture build,
18464 skipping the byteorder check.
18470 case "$byteorder" in
18473 In the following, larger digits indicate more significance. A big-endian
18474 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
18475 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
18476 machines may have weird orders like 3412. A Cray will report 87654321,
18477 an Alpha will report 12345678. If the test program works the default is
18479 I'm now running the test program...
18483 #$i_stdlib I_STDLIB
18485 #include <stdlib.h>
18487 #include <sys/types.h>
18488 typedef $uvtype UV;
18498 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
18500 u.l = (UV)0x04030201;
18501 for (i = 0; i < $uvsize; i++)
18502 printf("%c", u.c[i]+'0');
18509 if eval $compile && $run ./try > /dev/null; then
18512 [1-4][1-4][1-4][1-4]|12345678|87654321)
18513 echo "(The test program ran ok.)"
18514 echo "byteorder=$dflt"
18517 ????|????????) echo "(The test program ran ok.)" ;;
18518 *) echo "(The test program didn't run right for some reason.)" ;;
18523 (I can't seem to compile the test program. Guessing big-endian...)
18526 case "$xxx_prompt" in
18528 rp="What is the order of bytes in $uvtype?"
18541 : Checking 32bit aligndness
18544 Checking to see whether you can access character data unalignedly...
18546 case "$d_u32align" in
18547 '') $cat >try.c <<EOCP
18549 #$i_stdlib I_STDLIB
18551 #include <stdlib.h>
18553 #define U32 $u32type
18554 #define BYTEORDER 0x$byteorder
18556 #include <signal.h>
18558 $signal_t bletch(int s) { exit(4); }
18561 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
18566 if (sizeof(U32) != 4) {
18567 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
18574 signal(SIGBUS, bletch);
18586 for (i = 0; i < 4; i++) {
18587 up = (U32*)(buf + i);
18588 if (! ((*up == 1 << (8*i)) || /* big-endian */
18589 (*up == 1 << (8*(3-i))) /* little-endian */
18593 printf("read failed (%x)\n", *up);
18599 for (i = 0; i < 4; i++) {
18600 up = (U32*)(buf + i);
18602 if (*up != 0xBeef) {
18603 printf("write failed (%x)\n", *up);
18617 if eval $compile_ok; then
18618 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
18619 $run ./try 2>&1 >/dev/null
18622 You can access character data pretty unalignedly.
18624 d_u32align="$undef"
18627 It seems that you must access character data in an aligned manner.
18629 d_u32align="$define"
18633 rp='Can you access character data at unaligned addresses?'
18637 [yY]*) d_u32align="$undef" ;;
18638 *) d_u32align="$define" ;;
18645 : see if ualarm exists
18646 set ualarm d_ualarm
18649 : see if umask exists
18653 : see if unordered exists
18654 set unordered d_unordered
18657 : see if unsetenv exists
18658 set unsetenv d_unsetenv
18661 : see if usleep exists
18662 set usleep d_usleep
18665 : see if prototype for usleep is available
18667 set d_usleepproto usleep $i_unistd unistd.h
18670 : see if ustat exists
18674 : see if closedir exists
18675 set closedir d_closedir
18678 case "$d_closedir" in
18681 echo "Checking whether closedir() returns a status..." >&4
18683 #$i_dirent I_DIRENT /**/
18684 #$i_sysdir I_SYS_DIR /**/
18685 #$i_sysndir I_SYS_NDIR /**/
18686 #$i_systypes I_SYS_TYPES /**/
18688 #if defined(I_SYS_TYPES)
18689 #include <sys/types.h>
18691 #if defined(I_DIRENT)
18692 #include <dirent.h>
18693 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
18694 #include <sys/dir.h>
18698 #include <sys/ndir.h>
18702 #include <ndir.h> /* may be wrong in the future */
18704 #include <sys/dir.h>
18709 int main() { return closedir(opendir(".")); }
18712 if eval $compile_ok; then
18713 if $run ./try > /dev/null 2>&1 ; then
18714 echo "Yes, it does."
18717 echo "No, it doesn't."
18721 echo "(I can't seem to compile the test program--assuming it doesn't)"
18729 set d_void_closedir
18733 : see if there is a wait4
18737 : see if waitpid exists
18738 set waitpid d_waitpid
18741 : see if wcstombs exists
18742 set wcstombs d_wcstombs
18745 : see if wctomb exists
18746 set wctomb d_wctomb
18749 : see if writev exists
18750 set writev d_writev
18753 : preserve RCS keywords in files with variable substitution, grrr
18758 Revision='$Revision'
18760 : check for alignment requirements
18762 case "$usecrosscompile$multiarch" in
18765 You seem to be either cross-compiling or doing a multiarchitecture build,
18766 skipping the memory alignment check.
18769 case "$alignbytes" in
18770 '') alignbytes=8 ;;
18774 case "$alignbytes" in
18775 '') echo "Checking alignment constraints..." >&4
18776 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
18777 $cat >try.c <<'EOCP'
18778 typedef long double NV;
18781 $cat >try.c <<'EOCP'
18785 $cat >>try.c <<'EOCP'
18793 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
18798 if eval $compile_ok; then
18802 echo "(I can't seem to compile the test program...)"
18805 *) dflt="$alignbytes"
18808 rp="Doubles must be aligned on a how-many-byte boundary?"
18816 : set the base revision
18819 : how do we concatenate cpp tokens here?
18821 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
18822 $cat >cpp_stuff.c <<'EOCP'
18823 #define RCAT(a,b)a/**/b
18824 #define ACAT(a,b)a ## b
18828 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
18829 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
18830 echo "Oh! Smells like ANSI's been here." >&4
18831 echo "We can catify or stringify, separately or together!"
18833 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
18834 echo "Ah, yes! The good old days!" >&4
18835 echo "However, in the good old days we don't know how to stringify and"
18836 echo "catify at the same time."
18840 Hmm, I don't seem to be able to concatenate tokens with your cpp.
18841 You're going to have to edit the values of CAT[2-5] in config.h...
18843 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
18847 : see if this is a db.h system
18853 : Check db version.
18855 echo "Checking Berkeley DB version ..." >&4
18861 #include <sys/types.h>
18863 #$i_stdlib I_STDLIB
18865 #include <stdlib.h>
18868 int main(int argc, char *argv[])
18870 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
18871 int Major, Minor, Patch ;
18872 unsigned long Version ;
18873 (void)db_version(&Major, &Minor, &Patch) ;
18875 printf("%d %d %d %d %d %d\n",
18876 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
18877 Major, Minor, Patch);
18880 printf("You have Berkeley DB Version 2 or greater.\n");
18882 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
18883 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
18884 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
18885 Major, Minor, Patch) ;
18887 /* check that db.h & libdb are compatible */
18888 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
18889 printf("db.h and libdb are incompatible.\n") ;
18893 printf("db.h and libdb are compatible.\n") ;
18895 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
18896 + DB_VERSION_PATCH ;
18898 /* needs to be >= 2.3.4 */
18899 if (Version < 2003004) {
18900 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
18901 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
18907 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
18912 printf("You have Berkeley DB Version 1.\n");
18913 exit(0); /* DB version < 2: the coast is clear. */
18915 exit(1); /* <db.h> not Berkeley DB? */
18921 if eval $compile_ok && $run ./try; then
18922 echo 'Looks OK.' >&4
18924 db_version_major=$1
18925 db_version_minor=$2
18926 db_version_patch=$3
18928 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
18932 : Remove db from list of libraries to use
18933 echo "Removing unusable -ldb from library list" >&4
18934 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
18937 echo "libs = $libs" >&4
18947 : Check the return type needed for hash
18949 echo "Checking return type needed for hash for Berkeley DB ..." >&4
18955 #include <sys/types.h>
18958 #ifndef DB_VERSION_MAJOR
18959 u_int32_t hash_cb (ptr, size)
18967 info.hash = hash_cb;
18971 if $cc $ccflags -c try.c >try.out 2>&1 ; then
18972 if $contains warning try.out >>/dev/null 2>&1 ; then
18975 db_hashtype='u_int32_t'
18978 : XXX Maybe we should just give up here.
18979 db_hashtype=u_int32_t
18981 echo "Help: I can't seem to compile the db test program." >&4
18982 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
18985 echo "Your version of Berkeley DB uses $db_hashtype for hash."
18987 *) db_hashtype=u_int32_t
18992 : Check the return type needed for prefix
18994 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
19000 #include <sys/types.h>
19003 #ifndef DB_VERSION_MAJOR
19004 size_t prefix_cb (key1, key2)
19012 info.prefix = prefix_cb;
19016 if $cc $ccflags -c try.c >try.out 2>&1 ; then
19017 if $contains warning try.out >>/dev/null 2>&1 ; then
19018 db_prefixtype='int'
19020 db_prefixtype='size_t'
19023 db_prefixtype='size_t'
19024 : XXX Maybe we should just give up here.
19026 echo "Help: I can't seem to compile the db test program." >&4
19027 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
19030 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
19032 *) db_prefixtype='size_t'
19036 : How can we generate normalized random numbers ?
19038 echo "Looking for a random number function..." >&4
19039 case "$randfunc" in
19041 if set drand48 val -f; eval $csym; $val; then
19043 echo "Good, found drand48()." >&4
19044 elif set random val -f; eval $csym; $val; then
19046 echo "OK, found random()." >&4
19049 echo "Yick, looks like I have to use rand()." >&4
19060 *-Dmy_rand=*|*-Dmy_srand=*)
19061 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
19062 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
19063 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
19064 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
19068 while $test "$cont"; do
19069 rp="Use which function to generate random numbers?"
19071 if $test "$ans" = "$dflt"; then
19077 if set $ans val -f; eval $csym; $val; then
19081 rp="I cannot find function $ans. Use that name anyway?"
19090 case "$randfunc" in
19092 drand01="drand48()"
19098 case "$randbits" in
19100 echo "Checking to see how many bits your $randfunc() function produces..." >&4
19102 #$i_unistd I_UNISTD
19103 #$i_stdlib I_STDLIB
19106 # include <unistd.h>
19109 # include <stdlib.h>
19114 register unsigned long tmp;
19115 register unsigned long max = 0L;
19117 for (i = 1000; i; i--) {
19118 tmp = (unsigned long) $randfunc();
19119 if (tmp > max) max = tmp;
19121 for (i = 0; max; i++)
19127 if eval $compile_ok; then
19131 echo "(I can't seem to compile the test program...)"
19138 rp="How many bits does your $randfunc() function produce?"
19142 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
19143 seedfunc="s$randfunc"
19144 randseedtype=unsigned
19148 rp="How many bits does your $randfunc() function produce?"
19151 seedfunc="s$randfunc"
19152 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
19153 if set $seedfunc val -f; eval $csym; $val; then
19154 echo "(Using $seedfunc() to seed random generator)"
19156 echo "(Warning: no $seedfunc() to seed random generator)"
19159 randseedtype=unsigned
19166 : Determine if this is an EBCDIC system
19168 echo "Determining whether or not we are on an EBCDIC system..." >&4
19169 $cat >try.c <<'EOM'
19172 if ('M'==0xd4) return 0;
19179 if eval $compile_ok; then
19180 if $run ./try; then
19181 echo "You seem to speak EBCDIC." >&4
19184 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
19187 echo "I'm unable to compile the test program." >&4
19188 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
19194 : Check how to flush
19197 Checking how to flush all pending stdio output...
19199 # I only know how to find the first 32 possibly open files on SunOS.
19200 # See also hints/sunos_4_1.sh and util.c --AD
19202 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
19204 $cat >>try.c <<EOCP
19206 #$i_stdlib I_STDLIB
19208 #include <stdlib.h>
19210 #$i_unistd I_UNISTD
19212 # include <unistd.h>
19214 #$d_sysconf HAS_SYSCONF
19215 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
19216 #ifdef HAS_STDIO_STREAM_ARRAY
19217 # define STDIO_STREAM_ARRAY $stdio_stream_array
19222 p = fopen("try.out", "w");
19226 # ifdef TRY_FPRINTF
19230 #ifdef TRY_FFLUSH_NULL
19233 #ifdef TRY_FFLUSH_ALL
19235 long open_max = -1;
19236 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
19237 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
19239 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
19240 open_max = sysconf(_SC_OPEN_MAX);
19243 open_max = FOPEN_MAX;
19246 open_max = OPEN_MAX;
19255 # ifdef HAS_STDIO_STREAM_ARRAY
19256 if (open_max > 0) {
19258 for (i = 0; i < open_max; i++)
19259 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
19260 STDIO_STREAM_ARRAY[i]._file < open_max &&
19261 STDIO_STREAM_ARRAY[i]._flag)
19262 fflush(&STDIO_STREAM_ARRAY[i]);
19270 : first we have to find out how _not_ to flush
19272 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
19274 set try -DTRY_FPUTC
19275 if eval $compile; then
19276 $run ./try 2>/dev/null
19279 if $test ! -s try.out -a "X$code" = X42; then
19285 set try -DTRY_FPRINTF
19286 if eval $compile; then
19287 $run ./try 2>/dev/null
19290 if $test ! -s try.out -a "X$code" = X42; then
19291 output=-DTRY_FPRINTF
19297 : check for fflush NULL behaviour
19298 case "$fflushNULL" in
19299 '') set try -DTRY_FFLUSH_NULL $output
19300 if eval $compile; then
19301 $run ./try 2>/dev/null
19304 if $test -s try.out -a "X$code" = X42; then
19305 fflushNULL="`$cat try.out`"
19307 if $test "X$code" != X42; then
19309 (If this test failed, don't worry, we'll try another method shortly.)
19314 $rm -f core try.core core.try.*
19315 case "$fflushNULL" in
19317 Your fflush(NULL) works okay for output streams.
19318 Let's see if it clobbers input pipes...
19320 # As of mid-March 2000 all versions of Solaris appear to have a stdio
19321 # bug that improperly flushes the input end of pipes. So we avoid the
19322 # autoflush on fork/system/exec support for now. :-(
19323 $cat >tryp.c <<EOCP
19326 main(int argc, char **argv)
19332 while ((i = getc(stdin)) != -1
19333 && (*bp++ = i) != '\n'
19334 && bp < &buf[1024])
19337 fprintf(stdout, "%s", buf);
19345 fflushNULL="$define"
19347 if eval $compile; then
19349 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19350 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19352 fflush(NULL) seems to behave okay with input streams.
19354 fflushNULL="$define"
19357 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
19359 fflushNULL="$undef"
19362 $rm -f core tryp.c tryp.core core.tryp.*
19365 Your fflush(NULL) isn't working (contrary to ANSI C).
19367 fflushNULL="$undef"
19370 Cannot figure out whether your fflush(NULL) works or not.
19371 I'm assuming it doesn't (contrary to ANSI C).
19373 fflushNULL="$undef"
19377 $define|true|[yY]*)
19378 fflushNULL="$define"
19381 fflushNULL="$undef"
19384 : check explicit looping only if NULL did not work, and if the pipe
19385 : bug does not show up on an explicit flush too
19386 case "$fflushNULL" in
19388 $cat >tryp.c <<EOCP
19391 main(int argc, char **argv)
19397 while ((i = getc(stdin)) != -1
19398 && (*bp++ = i) != '\n'
19399 && bp < &buf[1024])
19402 fprintf(stdout, "%s", buf);
19411 if eval $compile; then
19413 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19414 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19416 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
19418 : now check for fflushall behaviour
19419 case "$fflushall" in
19420 '') set try -DTRY_FFLUSH_ALL $output
19421 if eval $compile; then
19423 (Now testing the other method--but note that this also may fail.)
19425 $run ./try 2>/dev/null
19428 if $test -s try.out -a "X$code" = X42; then
19429 fflushall="`$cat try.out`"
19433 case "$fflushall" in
19435 Whew. Flushing explicitly all the stdio streams works.
19437 fflushall="$define"
19440 Sigh. Flushing explicitly all the stdio streams doesn't work.
19445 Cannot figure out whether flushing stdio streams explicitly works or not.
19446 I'm assuming it doesn't.
19452 "$define"|true|[yY]*)
19453 fflushall="$define"
19461 All is futile. Even fflush(stdin) clobbers input pipes!
19468 $rm -f core tryp.c tryp.core core.tryp.*
19470 *) fflushall="$undef"
19474 case "$fflushNULL$fflushall" in
19477 OK, I give up. I cannot figure out how to flush pending stdio output.
19478 We won't be flushing handles at all before fork/exec/popen.
19484 : Store the full pathname to the ar program for use in the C program
19485 : Respect a hint or command line value for full_ar.
19490 : Store the full pathname to the sed program for use in the C program
19493 : see what type gids are declared as in the kernel
19495 echo "Looking for the type for group ids returned by getgid()."
19496 set gid_t gidtype xxx stdio.h sys/types.h
19500 xxx=`./findhdr sys/user.h`
19501 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
19503 unsigned) dflt="$1 $2" ;;
19507 *) dflt="$gidtype";;
19510 gid_t) echo "gid_t found." ;;
19511 *) rp="What is the type for group ids returned by getgid()?"
19517 : Check the size of GID
19520 *_t) zzz="$gidtype" ;;
19523 echo "Checking the size of $zzz..." >&4
19525 #include <sys/types.h>
19527 #$i_stdlib I_STDLIB
19529 #include <stdlib.h>
19532 printf("%d\n", (int)sizeof($gidtype));
19537 if eval $compile_ok; then
19541 echo "(I can't execute the test program--guessing $gidsize.)" >&4
19544 echo "Your $zzz is $gidsize bytes long."
19549 echo "(I can't compile the test program--guessing $gidsize.)" >&4
19553 : Check if GID is signed
19556 *_t) zzz="$gidtype" ;;
19559 echo "Checking the sign of $zzz..." >&4
19561 #include <sys/types.h>
19572 if eval $compile; then
19576 echo "(I can't execute the test program--guessing unsigned.)" >&4
19580 1) echo "Your $zzz is unsigned." ;;
19581 -1) echo "Your $zzz is signed." ;;
19587 echo "(I can't compile the test program--guessing unsigned.)" >&4
19591 : Check 64bit sizes
19594 if $test X"$quadtype" != X; then
19596 echo "Checking how to print 64-bit integers..." >&4
19598 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
19599 $cat >try.c <<'EOCP'
19600 #include <sys/types.h>
19603 int q = 12345678901;
19604 printf("%ld\n", q);
19608 if eval $compile; then
19612 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
19613 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
19614 echo "We will use %d."
19620 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
19621 $cat >try.c <<'EOCP'
19622 #include <sys/types.h>
19625 long q = 12345678901;
19626 printf("%ld\n", q);
19630 if eval $compile; then
19634 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
19635 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
19636 echo "We will use %ld."
19642 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
19643 $cat >try.c <<'EOCP'
19644 #include <sys/types.h>
19645 #include <inttypes.h>
19648 int64_t q = 12345678901;
19649 printf("%" PRId64 "\n", q);
19653 if eval $compile; then
19657 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
19658 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
19659 echo "We will use the C9X style."
19665 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19667 #include <sys/types.h>
19670 $quadtype q = 12345678901;
19671 printf("%Ld\n", q);
19675 if eval $compile; then
19679 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
19680 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
19681 echo "We will use %Ld."
19687 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
19688 $cat >try.c <<'EOCP'
19689 #include <sys/types.h>
19692 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
19693 printf("%lld\n", q);
19697 if eval $compile; then
19701 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
19702 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
19703 echo "We will use the %lld style."
19709 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19711 #include <sys/types.h>
19714 $quadtype q = 12345678901;
19715 printf("%qd\n", q);
19719 if eval $compile; then
19723 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
19724 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
19725 echo "We will use %qd."
19731 if $test X"$sPRId64" = X; then
19732 echo "Cannot figure out how to print 64-bit integers." >&4
19739 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
19740 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
19742 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
19743 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
19747 : Check format strings for internal types
19749 $echo "Checking the format strings to be used for Perl's internal types..." >&4
19751 if $test X"$ivsize" = X8; then
19752 ivdformat="$sPRId64"
19753 uvuformat="$sPRIu64"
19754 uvoformat="$sPRIo64"
19755 uvxformat="$sPRIx64"
19756 uvXUformat="$sPRIXU64"
19758 if $test X"$ivsize" = X"$longsize"; then
19765 if $test X"$ivsize" = X"$intsize"; then
19773 if $test X"$ivsize" = X"$shortsize"; then
19784 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
19785 nveformat="$sPRIeldbl"
19786 nvfformat="$sPRIfldbl"
19787 nvgformat="$sPRIgldbl"
19788 nvEUformat="$sPRIEUldbl"
19789 nvFUformat="$sPRIFUldbl"
19790 nvGUformat="$sPRIGUldbl"
19800 case "$ivdformat" in
19801 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
19806 : Check format string for GID
19809 $echo "Checking the format string to be used for gids..." >&4
19812 -1) if $test X"$gidsize" = X"$ivsize"; then
19813 gidformat="$ivdformat"
19815 if $test X"$gidsize" = X"$longsize"; then
19818 if $test X"$gidsize" = X"$intsize"; then
19821 if $test X"$gidsize" = X"$shortsize"; then
19828 *) if $test X"$gidsize" = X"$uvsize"; then
19829 gidformat="$uvuformat"
19831 if $test X"$gidsize" = X"$longsize"; then
19834 if $test X"$gidsize" = X"$intsize"; then
19837 if $test X"$gidsize" = X"$shortsize"; then
19846 : see if getgroups exists
19847 set getgroups d_getgrps
19850 : see if setgroups exists
19851 set setgroups d_setgrps
19854 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
19856 case "$d_getgrps$d_setgrps" in
19858 case "$groupstype" in
19859 '') dflt="$gidtype" ;;
19860 *) dflt="$groupstype" ;;
19863 What type of pointer is the second argument to getgroups() and setgroups()?
19864 Usually this is the same as group ids, $gidtype, but not always.
19867 rp='What type pointer is the second argument to getgroups() and setgroups()?'
19871 *) groupstype="$gidtype";;
19874 : MAD = Misc Attribute Definition
19876 if $test $patchlevel -lt 9; then
19877 : MAD is not available in 5.8.x or earlier.
19881 $define|true|[yY]*) dflt='y' ;;
19886 Would you like to build with Misc Attribute Decoration? This is development
19887 work leading to a Perl 5 to Perl 6 convertor, which imposes a space and speed
19888 overhead on the interpreter.
19890 If this doesn't make any sense to you, just accept the default '$dflt'.
19892 rp='Build Perl with MAD?'
19897 madlyh='madly.h madly.act madly.tab'
19899 madlyobj="madly$_o" ;;
19908 : check whether make sets MAKE
19910 echo "Checking if your $make program sets \$(MAKE)..." >&4
19911 case "$make_set_make" in
19913 $sed 's/^X //' > testmake.mak << 'EOF'
19915 X @echo 'maketemp="$(MAKE)"'
19917 case "`$make -f testmake.mak 2>/dev/null`" in
19918 *maketemp=*) make_set_make='#' ;;
19919 *) make_set_make="MAKE=$make" ;;
19921 $rm -f testmake.mak
19924 case "$make_set_make" in
19925 '#') echo "Yup, it does.";;
19926 *) echo "Nope, it doesn't.";;
19929 : see what type is used for mode_t
19930 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
19931 set mode_t modetype int stdio.h sys/types.h
19934 : see if we need va_copy
19936 case "$i_stdarg" in
19939 #include <stdarg.h>
19941 #$i_stdlib I_STDLIB
19943 #include <stdlib.h>
19945 #include <signal.h>
19948 ivfprintf(FILE *f, const char *fmt, va_list *valp)
19950 return vfprintf(f, fmt, *valp);
19954 myvfprintf(FILE *f, const char *fmt, va_list val)
19956 return ivfprintf(f, fmt, &val);
19960 myprintf(char *fmt, ...)
19963 va_start(val, fmt);
19964 return myvfprintf(stdout, fmt, val);
19968 main(int ac, char **av)
19970 signal(SIGSEGV, exit);
19972 myprintf("%s%cs all right, then\n", "that", '\'');
19977 if eval $compile && $run ./try 2>&1 >/dev/null; then
19978 case "`$run ./try`" in
19979 "that's all right, then")
19985 yes) echo "It seems that you don't need va_copy()." >&4
19986 need_va_copy="$undef"
19988 *) echo "It seems that va_copy() or similar will be needed." >&4
19989 need_va_copy="$define"
19994 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
19998 : see what type is used for size_t
19999 rp="What is the type used for the length parameter for string functions?"
20000 set size_t sizetype 'unsigned int' stdio.h sys/types.h
20003 : check for type of arguments to gethostbyaddr.
20004 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
20005 case "$d_gethbyaddr" in
20009 Checking to see what type of arguments are accepted by gethostbyaddr().
20011 hdrs="$define sys/types.h
20012 $d_socket sys/socket.h
20013 $i_niin netinet/in.h
20015 $i_unistd unistd.h"
20016 : The first arg can 'char *' or 'void *'
20017 : The second arg is some of integral type
20018 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
20019 for yyy in size_t long int; do
20020 case "$netdb_host_type" in
20021 '') try="$extern_C struct hostent *gethostbyaddr($xxx, $yyy, int);"
20022 if ./protochk "$try" $hdrs; then
20023 echo "Your system accepts $xxx for the first arg."
20024 echo "...and $yyy for the second arg."
20025 netdb_host_type="$xxx"
20026 netdb_hlen_type="$yyy"
20032 : In case none of those worked, prompt the user.
20033 case "$netdb_host_type" in
20034 '') rp='What is the type for the 1st argument to gethostbyaddr?'
20037 netdb_host_type=$ans
20038 rp='What is the type for the 2nd argument to gethostbyaddr?'
20041 netdb_hlen_type=$ans
20045 *) : no gethostbyaddr, so pick harmless defaults
20046 netdb_host_type='char *'
20047 netdb_hlen_type="$sizetype"
20050 # Remove the "const" if needed. -- but then we'll have a
20052 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
20055 : check for type of argument to gethostbyname.
20056 if test "X$netdb_name_type" = X ; then
20057 case "$d_gethbyname" in
20061 Checking to see what type of argument is accepted by gethostbyname().
20063 hdrs="$define sys/types.h
20064 $d_socket sys/socket.h
20065 $i_niin netinet/in.h
20067 $i_unistd unistd.h"
20068 for xxx in "const char *" "char *"; do
20069 case "$netdb_name_type" in
20070 '') try="$extern_C struct hostent *gethostbyname($xxx);"
20071 if ./protochk "$try" $hdrs; then
20072 echo "Your system accepts $xxx."
20073 netdb_name_type="$xxx"
20078 : In case none of those worked, prompt the user.
20079 case "$netdb_name_type" in
20080 '') rp='What is the type for the 1st argument to gethostbyname?'
20083 netdb_name_type=$ans
20087 *) : no gethostbyname, so pick harmless default
20088 netdb_name_type='char *'
20093 : check for type of 1st argument to getnetbyaddr.
20094 if test "X$netdb_net_type" = X ; then
20095 case "$d_getnbyaddr" in
20099 Checking to see what type of 1st argument is accepted by getnetbyaddr().
20101 hdrs="$define sys/types.h
20102 $d_socket sys/socket.h
20103 $i_niin netinet/in.h
20105 $i_unistd unistd.h"
20106 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
20107 case "$netdb_net_type" in
20108 '') try="$extern_C struct netent *getnetbyaddr($xxx, int);"
20109 if ./protochk "$try" $hdrs; then
20110 echo "Your system accepts $xxx."
20111 netdb_net_type="$xxx"
20116 : In case none of those worked, prompt the user.
20117 case "$netdb_net_type" in
20118 '') rp='What is the type for the 1st argument to getnetbyaddr?'
20121 netdb_net_type=$ans
20125 *) : no getnetbyaddr, so pick harmless default
20126 netdb_net_type='long'
20130 : locate the preferred pager for this system
20137 [a-zA-Z]:/*) dflt=$pg;;
20141 [a-zA-Z]:/*) dflt=$more;;
20145 [a-zA-Z]:/*) dflt=$less;;
20148 '') dflt=/usr/ucb/more;;
20156 rp='What pager is used on your system?'
20160 : see what type pids are declared as in the kernel
20161 rp="What is the type of process ids on this system?"
20162 set pid_t pidtype int stdio.h sys/types.h
20165 : see if ar generates random libraries by itself
20167 echo "Checking how to generate random libraries on your machine..." >&4
20168 echo 'int bar1() { return bar2(); }' > bar1.c
20169 echo 'int bar2() { return 2; }' > bar2.c
20171 #$i_stdlib I_STDLIB
20173 #include <stdlib.h>
20175 int main() { printf("%d\n", bar1()); exit(0); }
20177 $cc $ccflags -c bar1.c >/dev/null 2>&1
20178 $cc $ccflags -c bar2.c >/dev/null 2>&1
20179 $cc $ccflags -c foo.c >/dev/null 2>&1
20180 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
20181 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20182 $run ./foobar >/dev/null 2>&1; then
20183 echo "$ar appears to generate random libraries itself."
20185 if [ "X$ranlib" = "X" ]; then
20188 elif $ar s bar$_a >/dev/null 2>&1 &&
20189 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20190 $run ./foobar >/dev/null 2>&1; then
20191 echo "a table of contents needs to be added with '$ar s'."
20194 elif $ar ts bar$_a >/dev/null 2>&1 &&
20195 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20196 $run ./foobar >/dev/null 2>&1; then
20197 echo "a table of contents needs to be added with '$ar ts'."
20204 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
20205 $test -f $ranlib || ranlib=''
20208 if $test -n "$ranlib"; then
20209 echo "your system has '$ranlib'; we'll use that."
20212 echo "your system doesn't seem to support random libraries"
20213 echo "so we'll use lorder and tsort to order the libraries."
20220 : see if this is a values.h system
20221 set values.h i_values
20224 : Check the max offset that gmtime and localtime accept
20225 echo "Checking max offsets that gmtime () accepts"
20228 define) yyy="#include <values.h>" ;;
20232 case "$sGMTIME_min/$sGMTIME_max" in
20235 #include <sys/types.h>
20244 void gm_check (time_t t, int min_year, int max_year)
20247 if ( tmp == NULL ||
20248 /* Check tm_year overflow */
20249 tmp->tm_year < min_year || tmp->tm_year > max_year)
20260 gm_check (MAXLONG, 69, 0x7fffffff);
20262 if (tmp == NULL || tmp->tm_year < 0) {
20263 for (i = 63; i >= 0; i--) {
20264 time_t x = pt | ((time_t)1 << i);
20265 if (x < 0 || x < pt) continue;
20266 gm_check (x, 69, 0x7fffffff);
20269 printf ("sGMTIME_max=%ld\n", pt);
20278 gm_check (MINLONG, -1900, 70);
20281 for (i = 36; i >= 0; i--) {
20282 time_t x = pt - ((time_t)1 << i);
20283 if (x > 0) continue;
20284 gm_check (x, -1900, 70);
20287 printf ("sGMTIME_min=%ld\n", pt);
20291 int main (int argc, char *argv[])
20293 fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t));
20300 if eval $compile; then
20303 echo "Cannot determine sGMTIME_max and sGMTIME_min." >&4
20309 echo "Checking max offsets that localtime () accepts"
20311 case "$sLOCALTIME_min/$sLOCALTIME_max" in
20314 #include <sys/types.h>
20323 void local_check (time_t t, int min_year, int max_year)
20325 if (sizeof (time_t) > 4 && t > 0x7ffffffffffff000LL)
20328 tmp = localtime (&t);
20329 if ( tmp == NULL ||
20330 /* Check tm_year overflow */
20331 tmp->tm_year < min_year || tmp->tm_year > max_year)
20335 } /* local_check */
20342 local_check (MAXLONG, 69, 0x7fffffff);
20344 if (tmp == NULL || tmp->tm_year < 0) {
20345 for (i = 63; i >= 0; i--) {
20346 time_t x = pt | ((time_t)1 << i);
20347 if (x < 0 || x < pt) continue;
20348 local_check (x, 69, 0x7fffffff);
20351 printf ("sLOCALTIME_max=%ld\n", pt);
20360 local_check (MINLONG, -1900, 70);
20363 for (i = 36; i >= 0; i--) {
20364 time_t x = pt - ((time_t)1 << i);
20365 if (x > 0) continue;
20366 local_check (x, -1900, 70);
20369 printf ("sLOCALTIME_min=%ld\n", pt);
20373 int main (int argc, char *argv[])
20381 if eval $compile; then
20384 echo "Cannot determine sLOCALTIME_max and sLOCALTIME_min." >&4
20390 : check for type of arguments to select.
20391 case "$selecttype" in
20392 '') case "$d_select" in
20396 Checking to see what type of arguments are accepted by select().
20398 hdrs="$define sys/types.h
20399 $i_systime sys/time.h
20400 $i_sysselct sys/select.h
20401 $d_socket sys/socket.h"
20402 : The first arg can be int, unsigned, or size_t
20403 : The last arg may or may not be 'const'
20405 : void pointer has been seen but using that
20406 : breaks the selectminbits test
20407 for xxx in 'fd_set *' 'int *'; do
20408 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
20409 for tmo in 'struct timeval *' 'const struct timeval *'; do
20411 '') try="$extern_C select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
20412 if ./protochk "$try" $hdrs; then
20413 echo "Your system accepts $xxx."
20422 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
20423 case "$d_fd_set" in
20424 $define) dflt="fd_set *" ;;
20433 *) : no select, so pick a harmless default
20440 : check for the select 'width'
20441 case "$selectminbits" in
20442 '') safebits=`expr $ptrsize \* 8`
20443 case "$d_select" in
20447 Checking to see on how many bits at a time your select() operates...
20450 #include <sys/types.h>
20452 #$i_systime I_SYS_TIME
20453 #$i_systimek I_SYS_TIME_KERNEL
20458 # ifdef I_SYS_TIME_KERNEL
20461 # include <sys/time.h>
20462 # ifdef I_SYS_TIME_KERNEL
20466 #$i_sysselct I_SYS_SELECT
20467 #ifdef I_SYS_SELECT
20468 #include <sys/select.h>
20470 #$d_socket HAS_SOCKET
20472 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
20475 #$i_stdlib I_STDLIB
20477 #include <stdlib.h>
20480 #define S sizeof(*(b))
20482 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
20483 #define NBITS (NBYTES * 8)
20485 char *s = (char *)malloc(NBYTES);
20494 fp = fopen("try.c", "r");
20500 b = ($selecttype)s;
20501 for (i = 0; i < NBITS; i++)
20505 select(fd + 1, b, 0, 0, &t);
20506 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
20508 printf("%d\n", i + 1);
20513 if eval $compile_ok; then
20514 selectminbits=`$run ./try`
20515 case "$selectminbits" in
20517 Cannot figure out on how many bits at a time your select() operates.
20518 I'll play safe and guess it is $safebits bits.
20520 selectminbits=$safebits
20521 bits="$safebits bits"
20524 *) bits="$selectminbits bits" ;;
20526 echo "Your select() operates on $bits at a time." >&4
20528 rp='What is the minimum number of bits your select() operates on?'
20529 case "$byteorder" in
20530 12345678) dflt=64 ;;
20536 selectminbits="$val"
20540 *) : no select, so pick a harmless default
20541 selectminbits=$safebits
20547 : Trace out the files included by signal.h, then look for SIGxxx names.
20548 if [ "X$fieldn" = X ]; then
20549 : Just make some guesses. We check them later.
20550 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
20552 xxx=`echo '#include <signal.h>' |
20553 $cppstdin $cppminus $cppflags 2>/dev/null |
20554 $grep '^[ ]*#.*include' |
20555 $awk "{print \\$$fieldn}" | $sed 's!"!!g' |\
20556 $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
20559 for xx in $xxx /dev/null ; do
20560 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
20562 case "$xxxfiles" in
20563 '') xxxfiles=`./findhdr signal.h` ;;
20566 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
20567 print substr($2, 4, 20)
20569 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
20570 print substr($3, 4, 20)
20572 : Append some common names just in case the awk scan failed.
20573 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
20574 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
20575 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
20576 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
20577 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
20579 : generate a few handy files for later
20580 $cat > signal.c <<EOCP
20581 #include <sys/types.h>
20582 #include <signal.h>
20583 #$i_stdlib I_STDLIB
20585 #include <stdlib.h>
20590 /* Strange style to avoid deeply-nested #if/#else/#endif */
20593 # define NSIG (_NSIG)
20599 # define NSIG (SIGMAX+1)
20605 # define NSIG (SIG_MAX+1)
20611 # define NSIG (_SIG_MAX+1)
20617 # define NSIG (MAXSIG+1)
20623 # define NSIG (MAX_SIG+1)
20628 # ifdef SIGARRAYSIZE
20629 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
20635 # define NSIG (_sys_nsig) /* Solaris 2.5 */
20639 /* Default to some arbitrary number that's big enough to get most
20640 of the common signals.
20646 printf("NSIG %d\n", NSIG);
20652 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
20654 printf "#ifdef SIG"; printf $1; printf "\n"
20655 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
20656 printf $1; printf ");\n"
20660 printf "#endif /* JUST_NSIG */\n";
20661 printf "exit(0);\n}\n";
20664 $cat >signal.awk <<'EOP'
20665 BEGIN { ndups = 0 }
20666 $1 ~ /^NSIG$/ { nsig = $2 }
20667 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
20668 if ($2 > maxsig) { maxsig = $2 }
20669 if (sig_name[$2]) {
20670 dup_name[ndups] = $1
20671 dup_num[ndups] = $2
20683 printf("NSIG %d\n", nsig);
20684 for (n = 1; n < nsig; n++) {
20686 printf("%s %d\n", sig_name[n], sig_num[n])
20689 printf("NUM%d %d\n", n, n)
20692 for (n = 0; n < ndups; n++) {
20693 printf("%s %d\n", dup_name[n], dup_num[n])
20697 $cat >signal_cmd <<EOS
20699 if $test -s signal.lst; then
20700 echo "Using your existing signal.lst file"
20705 $cat >>signal_cmd <<'EOS'
20708 if eval $compile_ok; then
20709 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) |\
20710 $uniq | $awk -f signal.awk >signal.lst
20712 echo "(I can't seem be able to compile the whole test program)" >&4
20713 echo "(I'll try it in little pieces.)" >&4
20714 set signal -DJUST_NSIG
20715 if eval $compile_ok; then
20716 $run ./signal$_exe > signal.nsg
20719 echo "I can't seem to figure out how many signals you have." >&4
20720 echo "Guessing 50." >&4
20721 echo 'NSIG 50' > signal.nsg
20723 : Now look at all the signal names, one at a time.
20724 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
20725 $cat > signal.c <<EOCP
20726 #include <sys/types.h>
20727 #include <signal.h>
20730 printf("$xx %d\n", SIG${xx});
20735 if eval $compile; then
20736 echo "SIG${xx} found."
20737 $run ./signal$_exe >> signal.ls1
20739 echo "SIG${xx} NOT found."
20742 if $test -s signal.ls1; then
20743 $cat signal.nsg signal.ls1 |
20744 $sort -n | $uniq | $awk -f signal.awk >signal.lst
20748 if $test -s signal.lst; then
20751 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
20752 echo 'kill -l' >signal
20753 set X `csh -f <signal`
20757 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
20759 echo $@ | $tr ' ' $trnl | \
20760 $awk '{ printf "%s %d\n", $1, ++s; }
20761 END { printf "NSIG %d\n", ++s }' >signal.lst
20763 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
20765 chmod a+x signal_cmd
20766 $eunicefix signal_cmd
20768 : generate list of signal names
20770 case "$sig_name_init" in
20772 *) case "$sig_num_init" in
20773 ''|*,*) doinit=yes ;;
20778 echo "Generating a list of signal names and numbers..." >&4
20780 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
20781 sig_name=`$awk 'BEGIN { printf "ZERO " }
20782 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
20783 sig_num=`$awk 'BEGIN { printf "0 " }
20784 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
20785 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
20786 !/^NSIG/ { printf "\"%s\", ", $1 }
20787 END { printf "0\n" }' signal.lst`
20788 sig_num_init=`$awk 'BEGIN { printf "0, " }
20789 !/^NSIG/ { printf "%d, ", $2}
20790 END { printf "0\n"}' signal.lst`
20793 echo "The following $sig_count signals are available:"
20795 echo $sig_name | $awk \
20796 'BEGIN { linelen = 0 }
20798 for (i = 1; i <= NF; i++) {
20799 name = "SIG" $i " "
20800 linelen = linelen + length(name)
20801 if (linelen > 70) {
20803 linelen = length(name)
20809 sig_size=`echo $sig_name | awk '{print NF}'`
20810 $rm -f signal signal.c signal.awk signal.lst signal_cmd
20812 : Check size of size
20814 case "$sizetype" in
20815 *_t) zzz="$sizetype" ;;
20816 *) zzz="filesize" ;;
20818 echo "Checking the size of $zzz..." >&4
20820 #include <sys/types.h>
20822 #$i_stdlib I_STDLIB
20824 #include <stdlib.h>
20827 printf("%d\n", (int)sizeof($sizetype));
20832 if eval $compile_ok; then
20836 echo "(I can't execute the test program--guessing $sizesize.)" >&4
20839 echo "Your $zzz size is $sizesize bytes."
20844 echo "(I can't compile the test program--guessing $sizesize.)" >&4
20848 : check for socklen_t
20850 echo "Checking to see if you have socklen_t..." >&4
20852 #include <sys/types.h>
20853 #$d_socket HAS_SOCKET
20855 #include <sys/socket.h>
20857 int main() { socklen_t x = 16; }
20860 if eval $compile; then
20862 echo "You have socklen_t."
20865 echo "You do not have socklen_t."
20866 case "$sizetype" in
20867 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
20874 : see if this is a socks.h system
20875 set socks.h i_socks
20878 : check for type of the size argument to socket calls
20879 case "$d_socket" in
20883 Checking to see what type is the last argument of accept().
20886 case "$d_socklen_t" in
20887 "$define") yyy="$yyy socklen_t"
20889 yyy="$yyy $sizetype int long unsigned"
20890 for xxx in $yyy; do
20891 case "$socksizetype" in
20892 '') try="$extern_C int accept(int, struct sockaddr *, $xxx *);"
20893 case "$usesocks" in
20895 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
20896 echo "Your system accepts '$xxx *' for the last argument of accept()."
20897 socksizetype="$xxx"
20900 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
20901 echo "Your system accepts '$xxx *' for the last argument of accept()."
20902 socksizetype="$xxx"
20909 : In case none of those worked, prompt the user.
20910 case "$socksizetype" in
20911 '') rp='What is the type for socket address structure sizes?'
20918 *) : no sockets, so pick relatively harmless default
20923 : see what type is used for signed size_t
20924 set ssize_t ssizetype int stdio.h sys/types.h
20929 #$i_stdlib I_STDLIB
20931 #include <stdlib.h>
20933 #include <sys/types.h>
20934 #define Size_t $sizetype
20935 #define SSize_t $dflt
20938 if (sizeof(Size_t) == sizeof(SSize_t))
20940 else if (sizeof(Size_t) == sizeof(int))
20949 if eval $compile_ok && $run ./try > /dev/null; then
20950 ssizetype=`$run ./try`
20951 echo "I'll be using $ssizetype for functions returning a byte count." >&4
20954 Help! I can't compile and run the ssize_t test program: please enlighten me!
20955 (This is probably a misconfiguration in your system or libraries, and
20956 you really ought to fix it. Still, I'll try anyway.)
20958 I need a type that is the same size as $sizetype, but is guaranteed to
20959 be signed. Common values are ssize_t, int and long.
20962 rp="What signed type is the same size as $sizetype?"
20968 : see what type of char stdio uses.
20970 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
20971 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
20972 echo "Your stdio uses unsigned chars." >&4
20973 stdchar="unsigned char"
20975 echo "Your stdio uses signed chars." >&4
20980 : see what type uids are declared as in the kernel
20982 echo "Looking for the type for user ids returned by getuid()."
20983 set uid_t uidtype xxx stdio.h sys/types.h
20987 xxx=`./findhdr sys/user.h`
20988 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
20990 unsigned) dflt="$1 $2" ;;
20994 *) dflt="$uidtype";;
20997 uid_t) echo "uid_t found." ;;
20998 *) rp="What is the type for user ids returned by getuid()?"
21004 : Check size of UID
21007 *_t) zzz="$uidtype" ;;
21010 echo "Checking the size of $zzz..." >&4
21012 #include <sys/types.h>
21014 #$i_stdlib I_STDLIB
21016 #include <stdlib.h>
21019 printf("%d\n", (int)sizeof($uidtype));
21024 if eval $compile_ok; then
21028 echo "(I can't execute the test program--guessing $uidsize.)" >&4
21031 echo "Your $zzz is $uidsize bytes long."
21036 echo "(I can't compile the test program--guessing $uidsize.)" >&4
21039 : Check if UID is signed
21042 *_t) zzz="$uidtype" ;;
21045 echo "Checking the sign of $zzz..." >&4
21047 #include <sys/types.h>
21058 if eval $compile; then
21062 echo "(I can't execute the test program--guessing unsigned.)" >&4
21066 1) echo "Your $zzz is unsigned." ;;
21067 -1) echo "Your $zzz is signed." ;;
21073 echo "(I can't compile the test program--guessing unsigned.)" >&4
21077 : Check format string for UID
21079 $echo "Checking the format string to be used for uids..." >&4
21082 -1) if $test X"$uidsize" = X"$ivsize"; then
21083 uidformat="$ivdformat"
21085 if $test X"$uidsize" = X"$longsize"; then
21088 if $test X"$uidsize" = X"$intsize"; then
21091 if $test X"$uidsize" = X"$shortsize"; then
21098 *) if $test X"$uidsize" = X"$uvsize"; then
21099 uidformat="$uvuformat"
21101 if $test X"$uidsize" = X"$longsize"; then
21104 if $test X"$uidsize" = X"$intsize"; then
21107 if $test X"$uidsize" = X"$shortsize"; then
21116 : Check if site customization support was requested
21117 case "$usesitecustomize" in
21118 $define|true|[Yy]*)
21119 usesitecustomize="$define"
21122 usesitecustomize="$undef"
21126 : determine compiler compiler
21135 if $test -f "$byacc$_exe"; then
21137 comp="byacc or $comp"
21139 if $test -f "$bison$_exe"; then
21140 comp="$comp or bison -y"
21142 rp="Which compiler compiler ($comp) shall I use?"
21151 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
21157 : see if this is a assert.h system
21158 set assert.h i_assert
21161 : see if this is a fp.h system
21165 : see if this is a fp_class.h system
21166 set fp_class.h i_fp_class
21169 : see if gdbm.h is available
21174 : see if gdbm_open exists
21175 set gdbm_open d_gdbm_open
21177 case "$d_gdbm_open" in
21180 echo "We won't be including <gdbm.h>"
21189 : see if this is a ieeefp.h system
21190 case "$i_ieeefp" in
21191 '' ) set ieeefp.h i_ieeefp
21196 : see if this is a libutil.h system
21197 set libutil.h i_libutil
21200 : see if mach cthreads are available
21201 if test "X$usethreads" = "X$define"; then
21202 set mach/cthreads.h i_machcthr
21205 i_machcthr="$undef"
21208 : see if this is a mntent.h system
21209 set mntent.h i_mntent
21212 : see if net/errno.h is available
21214 set net/errno.h val
21217 : Unfortunately, it causes problems on some systems. Arrgh.
21220 cat > try.c <<'EOM'
21223 #include <net/errno.h>
21229 if $cc $ccflags -c try.c >/dev/null 2>&1; then
21230 echo "We'll be including <net/errno.h>." >&4
21232 echo "We won't be including <net/errno.h>." >&4
21241 : see if netinet/tcp.h is available
21242 set netinet/tcp.h i_netinettcp
21245 : see if this is a poll.h system
21249 : see if this is a prot.h system
21253 : Preprocessor symbols
21255 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
21256 $cat <<'EOSH' > Cppsym.know
21257 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
21258 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
21259 alliant alpha am29000 AM29000 AMD64 amd64 amiga AMIGAOS AMIX
21260 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
21261 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
21262 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
21263 bull c cadmus clipper CMU COFF COMPILER_VERSION
21264 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
21265 CYGWIN DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
21266 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
21267 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
21269 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
21270 H3050R H3050RX hbullx20 hcx host_mips
21271 hp200 hp300 hp700 HP700 hp800 hp9000
21272 hp9000s200 hp9000s300 hp9000s400 hp9000s500
21273 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
21274 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
21275 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
21276 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
21277 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
21278 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
21279 LIBCATAMOUNT Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
21280 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
21281 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
21282 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
21283 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
21284 MATH_HAS_NO_SIDE_EFFECTS
21285 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
21286 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
21287 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
21288 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
21289 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
21290 NetBSD news1500 news1700 news1800 news1900 news3700
21291 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
21292 ns32016 ns32332 ns32k nsc32000
21293 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
21294 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
21295 pc532 pdp11 PGC PIC plexus PORTAR posix
21296 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
21297 POSIX_C_SOURCE POSIX_SOURCE POWER
21298 PROTOTYPES PWB pyr QNX QK_USER R3000 REENTRANT RES Rhapsody RISC6000
21299 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
21300 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
21301 sony sony_news sonyrisc sparc sparclite spectrum
21302 stardent stdc STDC_EXT stratos sun sun3 sun386
21303 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
21304 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
21305 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
21306 sysV68 sysV88 Tek4132 Tek4300 titan
21307 TM3200 TM5400 TM5600
21308 tower tower32 tower32_200 tower32_600 tower32_700
21309 tower32_800 tower32_850 tss
21310 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
21311 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
21312 unix UNIX95 UNIX99 unixpc unos
21313 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
21314 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
21315 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
21317 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms x86_64 xenix Xenix286
21318 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
21319 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
21322 # Maybe put other stuff here too.
21323 cat <<EOSH >>Cppsym.know
21326 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
21327 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
21328 $cat Cppsym.know > Cppsym.c
21329 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
21330 $rm -f Cppsym.a Cppsym.b Cppsym.c
21331 cat <<EOSH > Cppsym
21333 if $test \$# -gt 0; then
21334 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
21335 if $test -s Cppsym.got; then
21342 $tr " " "$trnl" | ./Cppsym.try
21348 cat <<EOSH > Cppsym.try
21350 cat <<'EOCP' > try.c
21353 #define STRINGIFY(a) "a"
21355 #if cpp_stuff == 42
21356 #define StGiFy(a) #a
21357 #define STRINGIFY(a) StGiFy(a)
21359 #if $cpp_stuff != 1 && $cpp_stuff != 42
21360 # include "Bletch: How does this C preprocessor stringify macros?"
21366 cat <<'EOSH' >> Cppsym.try
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
21371 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
21373 echo 'return 0;}' >> try.c
21375 cat <<EOSH >> Cppsym.try
21377 case "$osname-$gccversion" in
21378 irix-) ccflags="\$ccflags -woff 1178" ;;
21379 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
21381 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
21383 chmod +x Cppsym.try
21384 $eunicefix Cppsym.try
21385 ./Cppsym < Cppsym.know > Cppsym.true
21386 : Add in any linux cpp "predefined macros":
21387 case "$osname::$gccversion" in
21388 *linux*::*.*|*gnukfreebsd*::*.*)
21390 rm -f $tHdrH'.h' $tHdrH
21392 if cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
21393 sed 's/#define[\ \ ]*//;s/[\ \ ].*$//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
21394 if [ -s $tHdrH'_cppsym.real' ]; then
21395 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
21398 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
21401 : now check the C compiler for additional symbols
21402 postprocess_cc_v=''
21404 aix) postprocess_cc_v="|$tr , ' '" ;;
21411 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
21414 -D*) echo "\$i" | $sed 's/^-D//';;
21415 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
21420 postprocess_cc_v=''
21423 ./ccsym > ccsym1.raw
21424 if $test -s ccsym1.raw; then
21425 $sort ccsym1.raw | $uniq >ccsym.raw
21427 mv ccsym1.raw ccsym.raw
21430 $awk '/\=/ { print $0; next }
21431 { print $0"=1" }' ccsym.raw >ccsym.list
21432 $comm -13 Cppsym.true ccsym.list >ccsym.own
21433 $comm -12 Cppsym.true ccsym.list >ccsym.com
21434 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
21436 if $test -z ccsym.raw; then
21437 echo "Your C compiler doesn't seem to define any symbols!" >&4
21439 echo "However, your C preprocessor defines the following symbols:"
21442 cppsymbols=`$cat Cppsym.true`
21443 cppsymbols=`echo $cppsymbols`
21444 cppccsymbols="$cppsymbols"
21446 if $test -s ccsym.com; then
21447 echo "Your C compiler and pre-processor define these symbols:"
21448 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
21451 cppccsymbols=`$cat ccsym.com`
21452 cppccsymbols=`echo $cppccsymbols`
21453 $test "$silent" || sleep 1
21455 if $test -s ccsym.cpp; then
21456 $test "$also" && echo " "
21457 echo "Your C pre-processor ${also}defines the following symbols:"
21458 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
21460 cppsymbols=`$cat ccsym.cpp`
21461 cppsymbols=`echo $cppsymbols`
21462 $test "$silent" || sleep 1
21464 if $test -s ccsym.own; then
21465 $test "$also" && echo " "
21466 echo "Your C compiler ${also}defines the following cpp symbols:"
21467 $sed -e 's/\(..*\)=1/\1/' ccsym.own
21468 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
21469 ccsymbols=`$cat ccsym.own`
21470 ccsymbols=`echo $ccsymbols`
21471 $test "$silent" || sleep 1
21475 : see if this is a termio system
21479 if $test `./findhdr termios.h`; then
21480 set tcsetattr i_termios
21486 "$define") echo "You have POSIX termios.h... good!" >&4;;
21487 *) if ./Cppsym pyr; then
21488 case "`/bin/universe`" in
21489 ucb) if $test `./findhdr sgtty.h`; then
21491 echo "<sgtty.h> found." >&4
21493 echo "System is pyramid with BSD universe."
21494 ./warn "<sgtty.h> not found--you could have problems."
21496 *) if $test `./findhdr termio.h`; then
21498 echo "<termio.h> found." >&4
21500 echo "System is pyramid with USG universe."
21501 ./warn "<termio.h> not found--you could have problems."
21505 if $test `./findhdr termio.h`; then
21506 echo "<termio.h> found." >&4
21508 elif $test `./findhdr sgtty.h`; then
21509 echo "<sgtty.h> found." >&4
21512 ./warn "Neither <termio.h> nor <sgtty.h> found--cross fingers!"
21515 if $test `./findhdr sgtty.h`; then
21516 echo "<sgtty.h> found." >&4
21518 elif $test `./findhdr termio.h`; then
21519 echo "<termio.h> found." >&4
21522 ./warn "Neither <sgtty.h> nor <termio.h> found--cross fingers!"
21526 set i_termio; eval $setvar
21527 val=$val2; set i_sgtty; eval $setvar
21528 val=$val3; set i_termios; eval $setvar
21530 : see if stddef is available
21531 set stddef.h i_stddef
21534 : see if sys/access.h is available
21535 set sys/access.h i_sysaccess
21538 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
21539 set sys/filio.h i_sysfilio
21542 if $test `./findhdr sys/ioctl.h`; then
21544 echo '<sys/ioctl.h> found.' >&4
21547 if $test $i_sysfilio = "$define"; then
21548 echo '<sys/ioctl.h> NOT found.' >&4
21550 $test $i_sgtty = "$define" && xxx="sgtty.h"
21551 $test $i_termio = "$define" && xxx="termio.h"
21552 $test $i_termios = "$define" && xxx="termios.h"
21553 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
21559 : see if socket ioctl defs are in sys/sockio.h
21561 xxx=`./findhdr sys/sockio.h`
21562 if $test "$xxx"; then
21563 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
21565 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
21568 echo "No socket ioctls found in <sys/sockio.h>." >&4
21573 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
21579 : see if this is a syslog.h system
21580 set syslog.h i_syslog
21583 : see if this is a sys/mode.h system
21584 set sys/mode.h i_sysmode
21587 : see if there is a sys/poll.h file
21588 set sys/poll.h i_syspoll
21591 : see if sys/resource.h has to be included
21592 set sys/resource.h i_sysresrc
21595 : see if sys/security.h is available
21596 set sys/security.h i_syssecrt
21599 : see if this is a sys/statvfs.h system
21600 set sys/statvfs.h i_sysstatvfs
21603 : see if this is a sys/un.h system
21604 set sys/un.h i_sysun
21607 : see if this is a sys/utsname.h system
21608 set sys/utsname.h i_sysutsname
21611 : see if this is a syswait system
21612 set sys/wait.h i_syswait
21615 : see if this is a ustat.h system
21616 set ustat.h i_ustat
21619 : see if this is an utime system
21620 set utime.h i_utime
21623 : see if this is a vfork system
21626 set vfork.h i_vfork
21636 echo "Looking for extensions..." >&4
21637 : If we are using the old config.sh, known_extensions may contain
21638 : old or inaccurate or duplicate values.
21639 known_extensions=''
21640 nonxs_extensions=''
21641 : We do not use find because it might not be available.
21642 : We do not just use MANIFEST because the user may have dropped
21643 : some additional extensions into the source tree and expect them
21646 : Function to recursively find available extensions, ignoring DynaLoader
21647 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
21648 : In 5.10.1 and later, extensions are stored in directories
21649 : like File-Glob instead of the older File/Glob/. In this scheme,
21650 : IO-Compress does not appear to be an XS extension, but we want
21651 : to install it as one. A.D. 8/2009.
21655 DynaLoader|dynaload) ;;
21657 this_ext=`echo $xxx | $sed -e s/-/\\\//g`;
21658 leaf=`echo $xxx | $sed -e s/.*-//`;
21659 if $test -d File; then
21660 if $test -f $xxx/$leaf.xs -o -f $xxx/$leaf.c; then
21661 known_extensions="$known_extensions $1$this_ext";
21662 elif $test -f $xxx/Makefile.PL; then
21663 nonxs_extensions="$nonxs_extensions $1$this_ext";
21665 if $test -d $xxx -a $# -lt 10; then
21668 eval $find_extensions;
21674 $ls -1 $xxx > $$.tmp;
21675 if $contains "\.xs$" $$.tmp > /dev/null 2>&1; then
21676 known_extensions="$known_extensions $this_ext";
21677 elif $contains "\.c$" $$.tmp > /dev/null 2>&1; then
21678 known_extensions="$known_extensions $this_ext";
21679 elif $test "$this_ext" = "IO/Compress"; then
21680 known_extensions="$known_extensions $this_ext";
21681 elif $test -d $xxx; then
21682 nonxs_extensions="$nonxs_extensions $this_ext";
21693 eval $find_extensions
21697 eval $find_extensions
21701 eval $find_extensions
21702 if $test -d File-Glob; then
21703 : All ext/ flattened
21705 # Special case: Add in modules that nest beyond the first level.
21706 # Currently threads/shared and Hash/Util/FieldHash, since they are
21707 # not picked up by the recursive find above (and adding in general
21708 # recursive finding breaks SDBM_File/sdbm).
21709 # A.D. 20011025 (SDBM), ajgough 20071008 (FieldHash)
21710 known_extensions="$known_extensions threads/shared Hash/Util/FieldHash"
21712 set X $known_extensions
21714 known_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
21715 set X $nonxs_extensions
21717 nonxs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
21720 : Now see which are supported on this system.
21722 for xxx in $known_extensions ; do
21726 $define) avail_ext="$avail_ext $xxx" ;;
21729 GDBM_File|gdbm_fil)
21731 $define) avail_ext="$avail_ext $xxx" ;;
21734 I18N/Langinfo|i18n_lan)
21735 case "$i_langinfo$d_nl_langinfo" in
21736 $define$define) avail_ext="$avail_ext $xxx" ;;
21740 : XXX Do we need a useipcsysv variable here
21741 case "${d_msg}${d_sem}${d_shm}" in
21742 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
21745 NDBM_File|ndbm_fil)
21748 case "$osname-$use64bitint" in
21751 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
21754 *) avail_ext="$avail_ext $xxx" ;;
21759 ODBM_File|odbm_fil)
21760 case "${i_dbm}${i_rpcsvcdbm}" in
21762 case "$d_cplusplus" in
21763 define) ;; # delete as a function name will not work
21764 *) case "$osname-$use64bitint" in
21767 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
21770 *) avail_ext="$avail_ext $xxx" ;;
21778 case "$useopcode" in
21779 true|define|y) avail_ext="$avail_ext $xxx" ;;
21783 case "$useposix" in
21784 true|define|y) avail_ext="$avail_ext $xxx" ;;
21788 case "$d_socket" in
21791 beos) ;; # not unless BONE
21792 *) avail_ext="$avail_ext $xxx" ;;
21797 Sys/Syslog|sys/syslog)
21798 : XXX syslog requires socket
21799 case "$d_socket" in
21800 true|$define|y) avail_ext="$avail_ext $xxx" ;;
21804 case "$usethreads" in
21806 case "$use5005threads" in
21807 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
21811 threads|threads/shared)
21812 # threads and threads::shared are special cases.
21813 # To stop people from asking "Perl 5.8.0 was supposed
21814 # to have this new fancy threads implementation but my
21815 # perl doesn't have it" and from people trying to
21816 # (re)install the threads module using CPAN.pm and
21817 # CPAN.pm then offering to reinstall Perl 5.8.0,
21818 # the threads.pm and threads/shared.pm will always be
21819 # there, croaking informatively ("you need to rebuild
21820 # all of Perl with threads, sorry") when threads haven't
21821 # been compiled in.
21823 avail_ext="$avail_ext $xxx"
21829 cygwin) avail_ext="$avail_ext $xxx" ;;
21832 XS/APItest|xs/apitest)
21833 # This is just for testing. Skip it unless we have dynamic loading.
21836 $define) avail_ext="$avail_ext $xxx" ;;
21839 XS/Typemap|xs/typemap)
21840 # This is just for testing. Skip it unless we have dynamic loading.
21842 $define) avail_ext="$avail_ext $xxx" ;;
21845 *) avail_ext="$avail_ext $xxx"
21854 case "$onlyextensions" in
21856 *) keepextensions=''
21857 echo "You have requested that only certains extensions be included..." >&4
21858 for i in $onlyextensions; do
21859 case " $avail_ext " in
21861 echo "Keeping extension $i."
21862 keepextensions="$keepextensions $i"
21864 *) echo "Ignoring extension $i." ;;
21867 avail_ext="$keepextensions"
21871 case "$noextensions" in
21873 *) keepextensions=''
21874 echo "You have requested that certain extensions be ignored..." >&4
21875 for i in $avail_ext; do
21876 case " $noextensions " in
21877 *" $i "*) echo "Ignoring extension $i." ;;
21878 *) echo "Keeping extension $i.";
21879 keepextensions="$keepextensions $i"
21883 avail_ext="$keepextensions"
21887 : Now see which nonxs extensions are supported on this system.
21888 : For now assume all are.
21890 for xxx in $nonxs_extensions ; do
21892 *) nonxs_ext="$nonxs_ext $xxx"
21904 A number of extensions are supplied with $package. You may choose to
21905 compile these extensions for dynamic loading (the default), compile
21906 them into the $package executable (static loading), or not include
21907 them at all. Answer "none" to include no extensions.
21908 Note that DynaLoader is always built and need not be mentioned here.
21911 case "$dynamic_ext" in
21913 : Exclude those listed in static_ext
21915 for xxx in $avail_ext; do
21916 case " $static_ext " in
21918 *) dflt="$dflt $xxx" ;;
21925 *) dflt="$dynamic_ext"
21926 # Perhaps we are reusing an old out-of-date config.sh.
21929 if test X"$dynamic_ext" != X"$avail_ext"; then
21931 NOTICE: Your previous config.sh list may be incorrect.
21932 The extensions now available to you are
21934 but the default list from your previous config.sh is
21946 rp="What extensions do you wish to load dynamically?"
21949 none) dynamic_ext=' ' ;;
21950 *) dynamic_ext="$ans" ;;
21953 case "$static_ext" in
21955 : Exclude those already listed in dynamic linking
21957 for xxx in $avail_ext; do
21958 case " $dynamic_ext " in
21960 *) dflt="$dflt $xxx" ;;
21967 *) dflt="$static_ext"
21974 rp="What extensions do you wish to load statically?"
21977 none) static_ext=' ' ;;
21978 *) static_ext="$ans" ;;
21983 A number of extensions are supplied with $package. Answer "none"
21984 to include no extensions.
21985 Note that DynaLoader is always built and need not be mentioned here.
21988 case "$static_ext" in
21989 '') dflt="$avail_ext" ;;
21990 *) dflt="$static_ext"
21991 # Perhaps we are reusing an old out-of-date config.sh.
21994 if test X"$static_ext" != X"$avail_ext"; then
21996 NOTICE: Your previous config.sh list may be incorrect.
21997 The extensions now available to you are
21999 but the default list from your previous config.sh is
22008 : Exclude those that are not xs extensions
22012 rp="What extensions do you wish to include?"
22015 none) static_ext=' ' ;;
22016 *) static_ext="$ans" ;;
22021 # Encode is a special case. If we are building Encode as a static
22022 # extension, we need to explicitly list its subextensions as well.
22023 # For other nested extensions, this is handled automatically by
22024 # the appropriate Makefile.PL.
22025 case " $static_ext " in
22026 *" Encode "*) # Add the subextensions of Encode
22028 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
22029 static_ext="$static_ext Encode/$xxx"
22035 set X $dynamic_ext $static_ext $nonxs_ext
22039 # Sanity check: We require an extension suitable for use with
22040 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
22041 # should show up as failures in the test suite, but it's helpful to
22042 # catch them now.) The 'extensions' list is normally sorted
22043 # alphabetically, so we need to accept either
22044 # DB_File ... Fcntl ... IO ....
22045 # or something like
22046 # Fcntl ... NDBM_File ... IO ....
22047 case " $extensions" in
22048 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
22049 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
22050 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
22051 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
22052 echo "WARNING: The Perl you are building will be quite crippled." >& 4
22056 : Remove libraries needed only for extensions
22057 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
22058 : The exception is SunOS 4.x, which needs them.
22059 case "${osname}X${osvers}" in
22063 *) case "$usedl" in
22064 $define|true|[yY]*)
22065 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
22069 *) perllibs="$libs"
22075 : Remove build directory name from cppstdin so it can be used from
22076 : either the present location or the final installed location.
22078 : Get out of the UU directory to get correct path name.
22080 case "$cppstdin" in
22082 echo "Stripping down cppstdin path name"
22088 : end of configuration questions
22090 echo "End of configuration questions."
22093 : back to where it started
22094 if test -d ../UU; then
22098 : configuration may be unconditionally patched via a 'config.arch' file
22099 if $test -f config.arch; then
22100 echo "I see a config.arch file, loading it." >&4
22104 : configuration may be patched via a 'config.over' file
22105 if $test -f config.over; then
22108 rp='I see a config.over file. Do you wish to load it?'
22111 n*) echo "OK, I'll ignore it.";;
22113 echo "Configuration override changes have been loaded."
22118 : in case they want portability, strip down executable paths
22119 case "$d_portable" in
22122 echo "Stripping down executable paths..." >&4
22123 for file in $loclist $trylist; do
22125 eval $file=`basename $temp`
22130 : create config.sh file
22132 echo "Creating config.sh..." >&4
22133 $spitshell <<EOT >config.sh
22136 # This file was produced by running the Configure script. It holds all the
22137 # definitions figured out by Configure. Should you modify one of these values,
22138 # do not forget to propagate your changes by running "Configure -der". You may
22139 # instead choose to run each of the .SH files by yourself, or "Configure -S".
22142 # Package name : $package
22143 # Source directory : $src
22144 # Configuration time: $cf_time
22145 # Configured by : $cf_by
22146 # Target system : $myuname
22149 : Add in command line options if available
22150 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
22152 $spitshell <<EOT >>config.sh
22161 Revision='$Revision'
22169 alignbytes='$alignbytes'
22170 ansi2knr='$ansi2knr'
22171 aphostname='$aphostname'
22172 api_revision='$api_revision'
22173 api_subversion='$api_subversion'
22174 api_version='$api_version'
22175 api_versionstring='$api_versionstring'
22178 archlibexp='$archlibexp'
22179 archname64='$archname64'
22180 archname='$archname'
22181 archobjs='$archobjs'
22182 asctime_r_proto='$asctime_r_proto'
22191 byteorder='$byteorder'
22193 castflags='$castflags'
22196 cccdlflags='$cccdlflags'
22197 ccdlflags='$ccdlflags'
22199 ccflags_uselargefiles='$ccflags_uselargefiles'
22201 ccsymbols='$ccsymbols'
22202 ccversion='$ccversion'
22204 cf_email='$cf_email'
22209 clocktype='$clocktype'
22211 compress='$compress'
22212 contains='$contains'
22216 cpp_stuff='$cpp_stuff'
22217 cppccsymbols='$cppccsymbols'
22218 cppflags='$cppflags'
22220 cppminus='$cppminus'
22222 cppstdin='$cppstdin'
22223 cppsymbols='$cppsymbols'
22224 crypt_r_proto='$crypt_r_proto'
22225 cryptlib='$cryptlib'
22227 ctermid_r_proto='$ctermid_r_proto'
22228 ctime_r_proto='$ctime_r_proto'
22229 d_Gconvert='$d_Gconvert'
22230 d_PRIEUldbl='$d_PRIEUldbl'
22231 d_PRIFUldbl='$d_PRIFUldbl'
22232 d_PRIGUldbl='$d_PRIGUldbl'
22233 d_PRIXU64='$d_PRIXU64'
22234 d_PRId64='$d_PRId64'
22235 d_PRIeldbl='$d_PRIeldbl'
22236 d_PRIfldbl='$d_PRIfldbl'
22237 d_PRIgldbl='$d_PRIgldbl'
22238 d_PRIi64='$d_PRIi64'
22239 d_PRIo64='$d_PRIo64'
22240 d_PRIu64='$d_PRIu64'
22241 d_PRIx64='$d_PRIx64'
22242 d_SCNfldbl='$d_SCNfldbl'
22243 d__fwalk='$d__fwalk'
22244 d_access='$d_access'
22245 d_accessx='$d_accessx'
22248 d_archlib='$d_archlib'
22249 d_asctime64='$d_asctime64'
22250 d_asctime_r='$d_asctime_r'
22253 d_attribute_deprecated='$d_attribute_deprecated'
22254 d_attribute_format='$d_attribute_format'
22255 d_attribute_malloc='$d_attribute_malloc'
22256 d_attribute_nonnull='$d_attribute_nonnull'
22257 d_attribute_noreturn='$d_attribute_noreturn'
22258 d_attribute_pure='$d_attribute_pure'
22259 d_attribute_unused='$d_attribute_unused'
22260 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
22264 d_bsdgetpgrp='$d_bsdgetpgrp'
22265 d_bsdsetpgrp='$d_bsdsetpgrp'
22266 d_builtin_choose_expr='$d_builtin_choose_expr'
22267 d_builtin_expect='$d_builtin_expect'
22269 d_c99_variadic_macros='$d_c99_variadic_macros'
22270 d_casti32='$d_casti32'
22271 d_castneg='$d_castneg'
22272 d_charvspr='$d_charvspr'
22274 d_chroot='$d_chroot'
22275 d_chsize='$d_chsize'
22277 d_clearenv='$d_clearenv'
22278 d_closedir='$d_closedir'
22279 d_cmsghdr_s='$d_cmsghdr_s'
22281 d_copysignl='$d_copysignl'
22282 d_cplusplus='$d_cplusplus'
22284 d_crypt_r='$d_crypt_r'
22286 d_ctermid='$d_ctermid'
22287 d_ctermid_r='$d_ctermid_r'
22288 d_ctime64='$d_ctime64'
22289 d_ctime_r='$d_ctime_r'
22290 d_cuserid='$d_cuserid'
22291 d_dbl_dig='$d_dbl_dig'
22292 d_dbminitproto='$d_dbminitproto'
22293 d_difftime64='$d_difftime64'
22294 d_difftime='$d_difftime'
22295 d_dir_dd_fd='$d_dir_dd_fd'
22297 d_dirnamlen='$d_dirnamlen'
22298 d_dlerror='$d_dlerror'
22299 d_dlopen='$d_dlopen'
22300 d_dlsymun='$d_dlsymun'
22301 d_dosuid='$d_dosuid'
22302 d_drand48_r='$d_drand48_r'
22303 d_drand48proto='$d_drand48proto'
22305 d_eaccess='$d_eaccess'
22306 d_endgrent='$d_endgrent'
22307 d_endgrent_r='$d_endgrent_r'
22308 d_endhent='$d_endhent'
22309 d_endhostent_r='$d_endhostent_r'
22310 d_endnent='$d_endnent'
22311 d_endnetent_r='$d_endnetent_r'
22312 d_endpent='$d_endpent'
22313 d_endprotoent_r='$d_endprotoent_r'
22314 d_endpwent='$d_endpwent'
22315 d_endpwent_r='$d_endpwent_r'
22316 d_endsent='$d_endsent'
22317 d_endservent_r='$d_endservent_r'
22318 d_eofnblk='$d_eofnblk'
22319 d_eunice='$d_eunice'
22320 d_faststdio='$d_faststdio'
22321 d_fchdir='$d_fchdir'
22322 d_fchmod='$d_fchmod'
22323 d_fchown='$d_fchown'
22325 d_fcntl_can_lock='$d_fcntl_can_lock'
22326 d_fd_macros='$d_fd_macros'
22327 d_fd_set='$d_fd_set'
22328 d_fds_bits='$d_fds_bits'
22329 d_fgetpos='$d_fgetpos'
22330 d_finite='$d_finite'
22331 d_finitel='$d_finitel'
22332 d_flexfnam='$d_flexfnam'
22334 d_flockproto='$d_flockproto'
22336 d_fp_class='$d_fp_class'
22337 d_fpathconf='$d_fpathconf'
22338 d_fpclass='$d_fpclass'
22339 d_fpclassify='$d_fpclassify'
22340 d_fpclassl='$d_fpclassl'
22341 d_fpos64_t='$d_fpos64_t'
22342 d_frexpl='$d_frexpl'
22343 d_fs_data_s='$d_fs_data_s'
22344 d_fseeko='$d_fseeko'
22345 d_fsetpos='$d_fsetpos'
22346 d_fstatfs='$d_fstatfs'
22347 d_fstatvfs='$d_fstatvfs'
22349 d_ftello='$d_ftello'
22351 d_futimes='$d_futimes'
22352 d_gdbm_ndbm_h_uses_prototypes='$d_gdbm_ndbm_h_uses_prototypes'
22353 d_gdbmndbm_h_uses_prototypes='$d_gdbmndbm_h_uses_prototypes'
22354 d_getaddrinfo='$d_getaddrinfo'
22355 d_getcwd='$d_getcwd'
22356 d_getespwnam='$d_getespwnam'
22357 d_getfsstat='$d_getfsstat'
22358 d_getgrent='$d_getgrent'
22359 d_getgrent_r='$d_getgrent_r'
22360 d_getgrgid_r='$d_getgrgid_r'
22361 d_getgrnam_r='$d_getgrnam_r'
22362 d_getgrps='$d_getgrps'
22363 d_gethbyaddr='$d_gethbyaddr'
22364 d_gethbyname='$d_gethbyname'
22365 d_gethent='$d_gethent'
22366 d_gethname='$d_gethname'
22367 d_gethostbyaddr_r='$d_gethostbyaddr_r'
22368 d_gethostbyname_r='$d_gethostbyname_r'
22369 d_gethostent_r='$d_gethostent_r'
22370 d_gethostprotos='$d_gethostprotos'
22371 d_getitimer='$d_getitimer'
22372 d_getlogin='$d_getlogin'
22373 d_getlogin_r='$d_getlogin_r'
22374 d_getmnt='$d_getmnt'
22375 d_getmntent='$d_getmntent'
22376 d_getnameinfo='$d_getnameinfo'
22377 d_getnbyaddr='$d_getnbyaddr'
22378 d_getnbyname='$d_getnbyname'
22379 d_getnent='$d_getnent'
22380 d_getnetbyaddr_r='$d_getnetbyaddr_r'
22381 d_getnetbyname_r='$d_getnetbyname_r'
22382 d_getnetent_r='$d_getnetent_r'
22383 d_getnetprotos='$d_getnetprotos'
22384 d_getpagsz='$d_getpagsz'
22385 d_getpbyname='$d_getpbyname'
22386 d_getpbynumber='$d_getpbynumber'
22387 d_getpent='$d_getpent'
22388 d_getpgid='$d_getpgid'
22389 d_getpgrp2='$d_getpgrp2'
22390 d_getpgrp='$d_getpgrp'
22391 d_getppid='$d_getppid'
22392 d_getprior='$d_getprior'
22393 d_getprotobyname_r='$d_getprotobyname_r'
22394 d_getprotobynumber_r='$d_getprotobynumber_r'
22395 d_getprotoent_r='$d_getprotoent_r'
22396 d_getprotoprotos='$d_getprotoprotos'
22397 d_getprpwnam='$d_getprpwnam'
22398 d_getpwent='$d_getpwent'
22399 d_getpwent_r='$d_getpwent_r'
22400 d_getpwnam_r='$d_getpwnam_r'
22401 d_getpwuid_r='$d_getpwuid_r'
22402 d_getsbyname='$d_getsbyname'
22403 d_getsbyport='$d_getsbyport'
22404 d_getsent='$d_getsent'
22405 d_getservbyname_r='$d_getservbyname_r'
22406 d_getservbyport_r='$d_getservbyport_r'
22407 d_getservent_r='$d_getservent_r'
22408 d_getservprotos='$d_getservprotos'
22409 d_getspnam='$d_getspnam'
22410 d_getspnam_r='$d_getspnam_r'
22411 d_gettimeod='$d_gettimeod'
22412 d_gmtime64='$d_gmtime64'
22413 d_gmtime_r='$d_gmtime_r'
22414 d_gnulibc='$d_gnulibc'
22415 d_grpasswd='$d_grpasswd'
22416 d_hasmntopt='$d_hasmntopt'
22418 d_ilogbl='$d_ilogbl'
22419 d_inc_version_list='$d_inc_version_list'
22421 d_inetaton='$d_inetaton'
22422 d_inetntop='$d_inetntop'
22423 d_inetpton='$d_inetpton'
22424 d_int64_t='$d_int64_t'
22425 d_isascii='$d_isascii'
22426 d_isfinite='$d_isfinite'
22429 d_isnanl='$d_isnanl'
22430 d_killpg='$d_killpg'
22431 d_lchown='$d_lchown'
22432 d_ldbl_dig='$d_ldbl_dig'
22433 d_libm_lib_version='$d_libm_lib_version'
22435 d_localtime64='$d_localtime64'
22436 d_localtime_r='$d_localtime_r'
22437 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
22438 d_locconv='$d_locconv'
22440 d_longdbl='$d_longdbl'
22441 d_longlong='$d_longlong'
22442 d_lseekproto='$d_lseekproto'
22444 d_madvise='$d_madvise'
22445 d_malloc_good_size='$d_malloc_good_size'
22446 d_malloc_size='$d_malloc_size'
22448 d_mbstowcs='$d_mbstowcs'
22449 d_mbtowc='$d_mbtowc'
22450 d_memchr='$d_memchr'
22451 d_memcmp='$d_memcmp'
22452 d_memcpy='$d_memcpy'
22453 d_memmove='$d_memmove'
22454 d_memset='$d_memset'
22456 d_mkdtemp='$d_mkdtemp'
22457 d_mkfifo='$d_mkfifo'
22458 d_mkstemp='$d_mkstemp'
22459 d_mkstemps='$d_mkstemps'
22460 d_mktime64='$d_mktime64'
22461 d_mktime='$d_mktime'
22464 d_modfl_pow32_bug='$d_modfl_pow32_bug'
22465 d_modflproto='$d_modflproto'
22466 d_mprotect='$d_mprotect'
22468 d_msg_ctrunc='$d_msg_ctrunc'
22469 d_msg_dontroute='$d_msg_dontroute'
22470 d_msg_oob='$d_msg_oob'
22471 d_msg_peek='$d_msg_peek'
22472 d_msg_proxy='$d_msg_proxy'
22473 d_msgctl='$d_msgctl'
22474 d_msgget='$d_msgget'
22475 d_msghdr_s='$d_msghdr_s'
22476 d_msgrcv='$d_msgrcv'
22477 d_msgsnd='$d_msgsnd'
22479 d_munmap='$d_munmap'
22480 d_mymalloc='$d_mymalloc'
22482 d_ndbm_h_uses_prototypes='$d_ndbm_h_uses_prototypes'
22484 d_nl_langinfo='$d_nl_langinfo'
22485 d_nv_preserves_uv='$d_nv_preserves_uv'
22486 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
22487 d_off64_t='$d_off64_t'
22488 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
22489 d_oldpthreads='$d_oldpthreads'
22490 d_oldsock='$d_oldsock'
22492 d_pathconf='$d_pathconf'
22494 d_perl_otherlibdirs='$d_perl_otherlibdirs'
22495 d_phostname='$d_phostname'
22498 d_portable='$d_portable'
22499 d_printf_format_null='$d_printf_format_null'
22500 d_procselfexe='$d_procselfexe'
22501 d_pseudofork='$d_pseudofork'
22502 d_pthread_atfork='$d_pthread_atfork'
22503 d_pthread_attr_setscope='$d_pthread_attr_setscope'
22504 d_pthread_yield='$d_pthread_yield'
22506 d_pwchange='$d_pwchange'
22507 d_pwclass='$d_pwclass'
22508 d_pwcomment='$d_pwcomment'
22509 d_pwexpire='$d_pwexpire'
22510 d_pwgecos='$d_pwgecos'
22511 d_pwpasswd='$d_pwpasswd'
22512 d_pwquota='$d_pwquota'
22515 d_random_r='$d_random_r'
22516 d_readdir64_r='$d_readdir64_r'
22517 d_readdir='$d_readdir'
22518 d_readdir_r='$d_readdir_r'
22519 d_readlink='$d_readlink'
22521 d_recvmsg='$d_recvmsg'
22522 d_rename='$d_rename'
22523 d_rewinddir='$d_rewinddir'
22525 d_safebcpy='$d_safebcpy'
22526 d_safemcpy='$d_safemcpy'
22527 d_sanemcmp='$d_sanemcmp'
22528 d_sbrkproto='$d_sbrkproto'
22529 d_scalbnl='$d_scalbnl'
22530 d_sched_yield='$d_sched_yield'
22531 d_scm_rights='$d_scm_rights'
22532 d_seekdir='$d_seekdir'
22533 d_select='$d_select'
22535 d_semctl='$d_semctl'
22536 d_semctl_semid_ds='$d_semctl_semid_ds'
22537 d_semctl_semun='$d_semctl_semun'
22538 d_semget='$d_semget'
22540 d_sendmsg='$d_sendmsg'
22541 d_setegid='$d_setegid'
22542 d_seteuid='$d_seteuid'
22543 d_setgrent='$d_setgrent'
22544 d_setgrent_r='$d_setgrent_r'
22545 d_setgrps='$d_setgrps'
22546 d_sethent='$d_sethent'
22547 d_sethostent_r='$d_sethostent_r'
22548 d_setitimer='$d_setitimer'
22549 d_setlinebuf='$d_setlinebuf'
22550 d_setlocale='$d_setlocale'
22551 d_setlocale_r='$d_setlocale_r'
22552 d_setnent='$d_setnent'
22553 d_setnetent_r='$d_setnetent_r'
22554 d_setpent='$d_setpent'
22555 d_setpgid='$d_setpgid'
22556 d_setpgrp2='$d_setpgrp2'
22557 d_setpgrp='$d_setpgrp'
22558 d_setprior='$d_setprior'
22559 d_setproctitle='$d_setproctitle'
22560 d_setprotoent_r='$d_setprotoent_r'
22561 d_setpwent='$d_setpwent'
22562 d_setpwent_r='$d_setpwent_r'
22563 d_setregid='$d_setregid'
22564 d_setresgid='$d_setresgid'
22565 d_setresuid='$d_setresuid'
22566 d_setreuid='$d_setreuid'
22567 d_setrgid='$d_setrgid'
22568 d_setruid='$d_setruid'
22569 d_setsent='$d_setsent'
22570 d_setservent_r='$d_setservent_r'
22571 d_setsid='$d_setsid'
22572 d_setvbuf='$d_setvbuf'
22576 d_shmatprototype='$d_shmatprototype'
22577 d_shmctl='$d_shmctl'
22579 d_shmget='$d_shmget'
22580 d_sigaction='$d_sigaction'
22581 d_signbit='$d_signbit'
22582 d_sigprocmask='$d_sigprocmask'
22583 d_sigsetjmp='$d_sigsetjmp'
22584 d_sitearch='$d_sitearch'
22585 d_snprintf='$d_snprintf'
22586 d_sockatmark='$d_sockatmark'
22587 d_sockatmarkproto='$d_sockatmarkproto'
22588 d_socket='$d_socket'
22589 d_socklen_t='$d_socklen_t'
22590 d_sockpair='$d_sockpair'
22591 d_socks5_init='$d_socks5_init'
22592 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
22594 d_srand48_r='$d_srand48_r'
22595 d_srandom_r='$d_srandom_r'
22596 d_sresgproto='$d_sresgproto'
22597 d_sresuproto='$d_sresuproto'
22598 d_statblks='$d_statblks'
22599 d_statfs_f_flags='$d_statfs_f_flags'
22600 d_statfs_s='$d_statfs_s'
22601 d_statvfs='$d_statvfs'
22602 d_stdio_cnt_lval='$d_stdio_cnt_lval'
22603 d_stdio_ptr_lval='$d_stdio_ptr_lval'
22604 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
22605 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
22606 d_stdio_stream_array='$d_stdio_stream_array'
22607 d_stdiobase='$d_stdiobase'
22608 d_stdstdio='$d_stdstdio'
22609 d_strchr='$d_strchr'
22610 d_strcoll='$d_strcoll'
22611 d_strctcpy='$d_strctcpy'
22612 d_strerrm='$d_strerrm'
22613 d_strerror='$d_strerror'
22614 d_strerror_r='$d_strerror_r'
22615 d_strftime='$d_strftime'
22616 d_strlcat='$d_strlcat'
22617 d_strlcpy='$d_strlcpy'
22618 d_strtod='$d_strtod'
22619 d_strtol='$d_strtol'
22620 d_strtold='$d_strtold'
22621 d_strtoll='$d_strtoll'
22622 d_strtoq='$d_strtoq'
22623 d_strtoul='$d_strtoul'
22624 d_strtoull='$d_strtoull'
22625 d_strtouq='$d_strtouq'
22626 d_strxfrm='$d_strxfrm'
22627 d_suidsafe='$d_suidsafe'
22628 d_symlink='$d_symlink'
22629 d_syscall='$d_syscall'
22630 d_syscallproto='$d_syscallproto'
22631 d_sysconf='$d_sysconf'
22632 d_sysernlst='$d_sysernlst'
22633 d_syserrlst='$d_syserrlst'
22634 d_system='$d_system'
22635 d_tcgetpgrp='$d_tcgetpgrp'
22636 d_tcsetpgrp='$d_tcsetpgrp'
22637 d_telldir='$d_telldir'
22638 d_telldirproto='$d_telldirproto'
22640 d_timegm='$d_timegm'
22642 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
22643 d_tm_tm_zone='$d_tm_tm_zone'
22644 d_tmpnam_r='$d_tmpnam_r'
22645 d_truncate='$d_truncate'
22646 d_ttyname_r='$d_ttyname_r'
22647 d_tzname='$d_tzname'
22648 d_u32align='$d_u32align'
22649 d_ualarm='$d_ualarm'
22652 d_union_semun='$d_union_semun'
22653 d_unordered='$d_unordered'
22654 d_unsetenv='$d_unsetenv'
22655 d_usleep='$d_usleep'
22656 d_usleepproto='$d_usleepproto'
22658 d_vendorarch='$d_vendorarch'
22659 d_vendorbin='$d_vendorbin'
22660 d_vendorlib='$d_vendorlib'
22661 d_vendorscript='$d_vendorscript'
22663 d_void_closedir='$d_void_closedir'
22664 d_voidsig='$d_voidsig'
22665 d_voidtty='$d_voidtty'
22666 d_volatile='$d_volatile'
22667 d_vprintf='$d_vprintf'
22668 d_vsnprintf='$d_vsnprintf'
22670 d_waitpid='$d_waitpid'
22671 d_wcstombs='$d_wcstombs'
22672 d_wctomb='$d_wctomb'
22673 d_writev='$d_writev'
22676 db_hashtype='$db_hashtype'
22677 db_prefixtype='$db_prefixtype'
22678 db_version_major='$db_version_major'
22679 db_version_minor='$db_version_minor'
22680 db_version_patch='$db_version_patch'
22681 defvoidused='$defvoidused'
22682 direntrytype='$direntrytype'
22685 doublesize='$doublesize'
22687 drand48_r_proto='$drand48_r_proto'
22689 dynamic_ext='$dynamic_ext'
22695 endgrent_r_proto='$endgrent_r_proto'
22696 endhostent_r_proto='$endhostent_r_proto'
22697 endnetent_r_proto='$endnetent_r_proto'
22698 endprotoent_r_proto='$endprotoent_r_proto'
22699 endpwent_r_proto='$endpwent_r_proto'
22700 endservent_r_proto='$endservent_r_proto'
22701 eunicefix='$eunicefix'
22704 extensions='$extensions'
22705 extern_C='$extern_C'
22707 fflushNULL='$fflushNULL'
22708 fflushall='$fflushall'
22710 firstmakefile='$firstmakefile'
22712 fpossize='$fpossize'
22713 fpostype='$fpostype'
22714 freetype='$freetype'
22717 full_csh='$full_csh'
22718 full_sed='$full_sed'
22719 gccansipedantic='$gccansipedantic'
22720 gccosandvers='$gccosandvers'
22721 gccversion='$gccversion'
22722 getgrent_r_proto='$getgrent_r_proto'
22723 getgrgid_r_proto='$getgrgid_r_proto'
22724 getgrnam_r_proto='$getgrnam_r_proto'
22725 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
22726 gethostbyname_r_proto='$gethostbyname_r_proto'
22727 gethostent_r_proto='$gethostent_r_proto'
22728 getlogin_r_proto='$getlogin_r_proto'
22729 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
22730 getnetbyname_r_proto='$getnetbyname_r_proto'
22731 getnetent_r_proto='$getnetent_r_proto'
22732 getprotobyname_r_proto='$getprotobyname_r_proto'
22733 getprotobynumber_r_proto='$getprotobynumber_r_proto'
22734 getprotoent_r_proto='$getprotoent_r_proto'
22735 getpwent_r_proto='$getpwent_r_proto'
22736 getpwnam_r_proto='$getpwnam_r_proto'
22737 getpwuid_r_proto='$getpwuid_r_proto'
22738 getservbyname_r_proto='$getservbyname_r_proto'
22739 getservbyport_r_proto='$getservbyport_r_proto'
22740 getservent_r_proto='$getservent_r_proto'
22741 getspnam_r_proto='$getspnam_r_proto'
22742 gidformat='$gidformat'
22748 gmtime_r_proto='$gmtime_r_proto'
22749 gnulibc_version='$gnulibc_version'
22751 groupcat='$groupcat'
22752 groupstype='$groupstype'
22755 h_sysfile='$h_sysfile'
22758 html1dir='$html1dir'
22759 html1direxp='$html1direxp'
22760 html3dir='$html3dir'
22761 html3direxp='$html3direxp'
22770 i_arpainet='$i_arpainet'
22771 i_assert='$i_assert'
22772 i_bsdioctl='$i_bsdioctl'
22776 i_dirent='$i_dirent'
22782 i_fp_class='$i_fp_class'
22784 i_gdbm_ndbm='$i_gdbm_ndbm'
22785 i_gdbmndbm='$i_gdbmndbm'
22787 i_ieeefp='$i_ieeefp'
22788 i_inttypes='$i_inttypes'
22789 i_langinfo='$i_langinfo'
22790 i_libutil='$i_libutil'
22791 i_limits='$i_limits'
22792 i_locale='$i_locale'
22793 i_machcthr='$i_machcthr'
22794 i_malloc='$i_malloc'
22795 i_mallocmalloc='$i_mallocmalloc'
22797 i_memory='$i_memory'
22798 i_mntent='$i_mntent'
22801 i_neterrno='$i_neterrno'
22802 i_netinettcp='$i_netinettcp'
22806 i_pthread='$i_pthread'
22808 i_rpcsvcdbm='$i_rpcsvcdbm'
22811 i_shadow='$i_shadow'
22813 i_stdarg='$i_stdarg'
22814 i_stddef='$i_stddef'
22815 i_stdlib='$i_stdlib'
22816 i_string='$i_string'
22817 i_sunmath='$i_sunmath'
22818 i_sysaccess='$i_sysaccess'
22819 i_sysdir='$i_sysdir'
22820 i_sysfile='$i_sysfile'
22821 i_sysfilio='$i_sysfilio'
22823 i_sysioctl='$i_sysioctl'
22824 i_syslog='$i_syslog'
22825 i_sysmman='$i_sysmman'
22826 i_sysmode='$i_sysmode'
22827 i_sysmount='$i_sysmount'
22828 i_sysndir='$i_sysndir'
22829 i_sysparam='$i_sysparam'
22830 i_syspoll='$i_syspoll'
22831 i_sysresrc='$i_sysresrc'
22832 i_syssecrt='$i_syssecrt'
22833 i_sysselct='$i_sysselct'
22834 i_syssockio='$i_syssockio'
22835 i_sysstat='$i_sysstat'
22836 i_sysstatfs='$i_sysstatfs'
22837 i_sysstatvfs='$i_sysstatvfs'
22838 i_systime='$i_systime'
22839 i_systimek='$i_systimek'
22840 i_systimes='$i_systimes'
22841 i_systypes='$i_systypes'
22842 i_sysuio='$i_sysuio'
22844 i_sysutsname='$i_sysutsname'
22845 i_sysvfs='$i_sysvfs'
22846 i_syswait='$i_syswait'
22847 i_termio='$i_termio'
22848 i_termios='$i_termios'
22850 i_unistd='$i_unistd'
22853 i_values='$i_values'
22854 i_varargs='$i_varargs'
22855 i_varhdr='$i_varhdr'
22857 ignore_versioned_solibs='$ignore_versioned_solibs'
22858 inc_version_list='$inc_version_list'
22859 inc_version_list_init='$inc_version_list_init'
22862 initialinstalllocation='$initialinstalllocation'
22863 installarchlib='$installarchlib'
22864 installbin='$installbin'
22865 installhtml1dir='$installhtml1dir'
22866 installhtml3dir='$installhtml3dir'
22867 installman1dir='$installman1dir'
22868 installman3dir='$installman3dir'
22869 installprefix='$installprefix'
22870 installprefixexp='$installprefixexp'
22871 installprivlib='$installprivlib'
22872 installscript='$installscript'
22873 installsitearch='$installsitearch'
22874 installsitebin='$installsitebin'
22875 installsitehtml1dir='$installsitehtml1dir'
22876 installsitehtml3dir='$installsitehtml3dir'
22877 installsitelib='$installsitelib'
22878 installsiteman1dir='$installsiteman1dir'
22879 installsiteman3dir='$installsiteman3dir'
22880 installsitescript='$installsitescript'
22881 installstyle='$installstyle'
22882 installusrbinperl='$installusrbinperl'
22883 installvendorarch='$installvendorarch'
22884 installvendorbin='$installvendorbin'
22885 installvendorhtml1dir='$installvendorhtml1dir'
22886 installvendorhtml3dir='$installvendorhtml3dir'
22887 installvendorlib='$installvendorlib'
22888 installvendorman1dir='$installvendorman1dir'
22889 installvendorman3dir='$installvendorman3dir'
22890 installvendorscript='$installvendorscript'
22892 issymlink='$issymlink'
22893 ivdformat='$ivdformat'
22896 known_extensions='$known_extensions'
22899 lddlflags='$lddlflags'
22901 ldflags_uselargefiles='$ldflags_uselargefiles'
22902 ldlibpthname='$ldlibpthname'
22909 libsdirs='$libsdirs'
22910 libsfiles='$libsfiles'
22911 libsfound='$libsfound'
22912 libspath='$libspath'
22913 libswanted='$libswanted'
22914 libswanted_uselargefiles='$libswanted_uselargefiles'
22920 localtime_r_proto='$localtime_r_proto'
22921 locincpth='$locincpth'
22922 loclibpth='$loclibpth'
22923 longdblsize='$longdblsize'
22924 longlongsize='$longlongsize'
22925 longsize='$longsize'
22929 lseeksize='$lseeksize'
22930 lseektype='$lseektype'
22933 madlyobj='$madlyobj'
22934 madlysrc='$madlysrc'
22938 make_set_make='$make_set_make'
22939 mallocobj='$mallocobj'
22940 mallocsrc='$mallocsrc'
22941 malloctype='$malloctype'
22943 man1direxp='$man1direxp'
22946 man3direxp='$man3direxp'
22948 mips_type='$mips_type'
22949 mistrustnm='$mistrustnm'
22951 mmaptype='$mmaptype'
22952 modetype='$modetype'
22954 multiarch='$multiarch'
22956 myarchname='$myarchname'
22957 mydomain='$mydomain'
22958 myhostname='$myhostname'
22961 need_va_copy='$need_va_copy'
22962 netdb_hlen_type='$netdb_hlen_type'
22963 netdb_host_type='$netdb_host_type'
22964 netdb_name_type='$netdb_name_type'
22965 netdb_net_type='$netdb_net_type'
22968 nm_so_opt='$nm_so_opt'
22969 nonxs_ext='$nonxs_ext'
22971 nvEUformat='$nvEUformat'
22972 nvFUformat='$nvFUformat'
22973 nvGUformat='$nvGUformat'
22974 nv_overflows_integers_at='$nv_overflows_integers_at'
22975 nv_preserves_uv_bits='$nv_preserves_uv_bits'
22976 nveformat='$nveformat'
22977 nvfformat='$nvfformat'
22978 nvgformat='$nvgformat'
22981 o_nonblock='$o_nonblock'
22983 old_pthread_create_joinable='$old_pthread_create_joinable'
22984 optimize='$optimize'
22985 orderlib='$orderlib'
22988 otherlibdirs='$otherlibdirs'
22992 patchlevel='$patchlevel'
22993 path_sep='$path_sep'
22996 perl_patchlevel='$perl_patchlevel'
22997 perladmin='$perladmin'
22998 perllibs='$perllibs'
22999 perlpath='$perlpath'
23001 phostname='$phostname'
23007 prefixexp='$prefixexp'
23009 privlibexp='$privlibexp'
23010 procselfexe='$procselfexe'
23011 prototype='$prototype'
23013 quadkind='$quadkind'
23014 quadtype='$quadtype'
23015 randbits='$randbits'
23016 randfunc='$randfunc'
23017 random_r_proto='$random_r_proto'
23018 randseedtype='$randseedtype'
23020 rd_nodata='$rd_nodata'
23021 readdir64_r_proto='$readdir64_r_proto'
23022 readdir_r_proto='$readdir_r_proto'
23023 revision='$revision'
23029 sGMTIME_max='$sGMTIME_max'
23030 sGMTIME_min='$sGMTIME_min'
23031 sLOCALTIME_max='$sLOCALTIME_max'
23032 sLOCALTIME_min='$sLOCALTIME_min'
23033 sPRIEUldbl='$sPRIEUldbl'
23034 sPRIFUldbl='$sPRIFUldbl'
23035 sPRIGUldbl='$sPRIGUldbl'
23036 sPRIXU64='$sPRIXU64'
23038 sPRIeldbl='$sPRIeldbl'
23039 sPRIfldbl='$sPRIfldbl'
23040 sPRIgldbl='$sPRIgldbl'
23045 sSCNfldbl='$sSCNfldbl'
23046 sched_yield='$sched_yield'
23047 scriptdir='$scriptdir'
23048 scriptdirexp='$scriptdirexp'
23050 seedfunc='$seedfunc'
23051 selectminbits='$selectminbits'
23052 selecttype='$selecttype'
23053 sendmail='$sendmail'
23054 setgrent_r_proto='$setgrent_r_proto'
23055 sethostent_r_proto='$sethostent_r_proto'
23056 setlocale_r_proto='$setlocale_r_proto'
23057 setnetent_r_proto='$setnetent_r_proto'
23058 setprotoent_r_proto='$setprotoent_r_proto'
23059 setpwent_r_proto='$setpwent_r_proto'
23060 setservent_r_proto='$setservent_r_proto'
23063 sharpbang='$sharpbang'
23064 shmattype='$shmattype'
23065 shortsize='$shortsize'
23068 sig_count='$sig_count'
23069 sig_name='$sig_name'
23070 sig_name_init='$sig_name_init'
23072 sig_num_init='$sig_num_init'
23073 sig_size='$sig_size'
23074 signal_t='$signal_t'
23075 sitearch='$sitearch'
23076 sitearchexp='$sitearchexp'
23078 sitebinexp='$sitebinexp'
23079 sitehtml1dir='$sitehtml1dir'
23080 sitehtml1direxp='$sitehtml1direxp'
23081 sitehtml3dir='$sitehtml3dir'
23082 sitehtml3direxp='$sitehtml3direxp'
23084 sitelib_stem='$sitelib_stem'
23085 sitelibexp='$sitelibexp'
23086 siteman1dir='$siteman1dir'
23087 siteman1direxp='$siteman1direxp'
23088 siteman3dir='$siteman3dir'
23089 siteman3direxp='$siteman3direxp'
23090 siteprefix='$siteprefix'
23091 siteprefixexp='$siteprefixexp'
23092 sitescript='$sitescript'
23093 sitescriptexp='$sitescriptexp'
23094 sizesize='$sizesize'
23095 sizetype='$sizetype'
23099 sockethdr='$sockethdr'
23100 socketlib='$socketlib'
23101 socksizetype='$socksizetype'
23103 spackage='$spackage'
23104 spitshell='$spitshell'
23105 srand48_r_proto='$srand48_r_proto'
23106 srandom_r_proto='$srandom_r_proto'
23108 ssizetype='$ssizetype'
23109 startperl='$startperl'
23111 static_ext='$static_ext'
23113 stdio_base='$stdio_base'
23114 stdio_bufsiz='$stdio_bufsiz'
23115 stdio_cnt='$stdio_cnt'
23116 stdio_filbuf='$stdio_filbuf'
23117 stdio_ptr='$stdio_ptr'
23118 stdio_stream_array='$stdio_stream_array'
23119 strerror_r_proto='$strerror_r_proto'
23122 subversion='$subversion'
23126 targetarch='$targetarch'
23130 timeincl='$timeincl'
23131 timetype='$timetype'
23132 tmpnam_r_proto='$tmpnam_r_proto'
23138 ttyname_r_proto='$ttyname_r_proto'
23147 uidformat='$uidformat'
23153 uquadtype='$uquadtype'
23154 use5005threads='$use5005threads'
23155 use64bitall='$use64bitall'
23156 use64bitint='$use64bitint'
23157 usecrosscompile='$usecrosscompile'
23158 usedevel='$usedevel'
23160 usedtrace='$usedtrace'
23161 usefaststdio='$usefaststdio'
23162 useithreads='$useithreads'
23163 uselargefiles='$uselargefiles'
23164 uselongdouble='$uselongdouble'
23165 usemallocwrap='$usemallocwrap'
23166 usemorebits='$usemorebits'
23167 usemultiplicity='$usemultiplicity'
23168 usemymalloc='$usemymalloc'
23170 useopcode='$useopcode'
23171 useperlio='$useperlio'
23172 useposix='$useposix'
23173 usereentrant='$usereentrant'
23174 userelocatableinc='$userelocatableinc'
23176 useshrplib='$useshrplib'
23177 usesitecustomize='$usesitecustomize'
23178 usesocks='$usesocks'
23179 usethreads='$usethreads'
23180 usevendorprefix='$usevendorprefix'
23181 usevfork='$usevfork'
23184 uvXUformat='$uvXUformat'
23185 uvoformat='$uvoformat'
23188 uvuformat='$uvuformat'
23189 uvxformat='$uvxformat'
23190 vendorarch='$vendorarch'
23191 vendorarchexp='$vendorarchexp'
23192 vendorbin='$vendorbin'
23193 vendorbinexp='$vendorbinexp'
23194 vendorhtml1dir='$vendorhtml1dir'
23195 vendorhtml1direxp='$vendorhtml1direxp'
23196 vendorhtml3dir='$vendorhtml3dir'
23197 vendorhtml3direxp='$vendorhtml3direxp'
23198 vendorlib='$vendorlib'
23199 vendorlib_stem='$vendorlib_stem'
23200 vendorlibexp='$vendorlibexp'
23201 vendorman1dir='$vendorman1dir'
23202 vendorman1direxp='$vendorman1direxp'
23203 vendorman3dir='$vendorman3dir'
23204 vendorman3direxp='$vendorman3direxp'
23205 vendorprefix='$vendorprefix'
23206 vendorprefixexp='$vendorprefixexp'
23207 vendorscript='$vendorscript'
23208 vendorscriptexp='$vendorscriptexp'
23210 version_patchlevel_string='$version_patchlevel_string'
23211 versiononly='$versiononly'
23213 voidflags='$voidflags'
23216 yaccflags='$yaccflags'
23221 : add special variables
23222 $test -f $src/patchlevel.h && \
23223 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
23224 echo "PERL_PATCHLEVEL='$perl_patchlevel'" >>config.sh
23225 echo "PERL_CONFIG_SH=true" >>config.sh
23227 : propagate old symbols
23228 if $test -f UU/config.sh; then
23229 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
23230 $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \
23231 config.sh config.sh UU/oldconfig.sh |\
23232 $sort | $uniq -u >UU/oldsyms
23233 set X `cat UU/oldsyms`
23239 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
23241 echo ": Variables propagated from previous config.sh file." >>config.sh
23242 for sym in `cat UU/oldsyms`; do
23243 echo " Propagating $hint variable "'$'"$sym..."
23244 eval 'tmp="$'"${sym}"'"'
23246 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
23252 : Finish up by extracting the .SH files
23256 echo "Extraction done."
23266 If you'd like to make any changes to the config.sh file before I begin
23267 to configure things, do it as a shell escape now (e.g. !vi config.sh).
23270 rp="Press return or use a shell escape to edit config.sh:"
23275 *) : in case they cannot read
23276 sh 1>&4 -c "$ans";;
23281 : if this fails, just run all the .SH files by hand
23290 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
23297 Now you need to generate make dependencies by running "$make depend".
23298 You might prefer to run it in background: "$make depend > makedepend.out &"
23299 It can take a while, so you might not want to run it right now.
23304 rp="Run $make depend now?"
23308 $make depend && echo "Now you must run '$make'."
23311 echo "You must run '$make depend' then '$make'."
23314 elif test -f [Mm]akefile; then
23316 echo "Now you must run a $make."
23318 echo "Configure done."
23321 if $test -f Policy.sh; then
23324 If you compile $package on a different machine or from a different object
23325 directory, copy the Policy.sh file from this object directory to the
23326 new one before you run Configure -- this will help you with most of
23327 the policy defaults.
23331 if $test -f config.msg; then
23332 echo "Hmm. I also noted the following information while running:"
23334 $cat config.msg >&4
23337 $rm -f kit*isdone ark*isdone