3 # If these # comments don't work, trim them. Don't worry about any other
4 # shell scripts, Configure will trim # comments from them for you.
6 # (If you are trying to port this package to a machine without sh,
7 # I would suggest you have a look at the prototypical config_h.SH file
8 # and edit it to reflect your system. Some packages may include samples
9 # of config.h for certain machines, so you might look for one of those.)
11 # Yes, you may rip this off to use in other distribution packages. This
12 # script belongs to the public domain and cannot be copyrighted.
14 # Note: this Configure script was generated automatically. Rather than
15 # working with this copy of Configure, you may wish to get metaconfig.
16 # The dist package (which contains metaconfig) is available via SVN:
17 # svn co https://svn.sourceforge.net/svnroot/dist/trunk/dist
19 # Though this script was generated by metaconfig from metaunits, it is
20 # OK to send patches against Configure itself. It's up to the Configure
21 # pumpkin to backport the patch to the metaunits if it is accepted.
22 # For more information on patching Configure, see pod/perlhack.pod
24 # The metaunits are also available from the public git repository:
25 # http://perl5.git.perl.org/metaconfig.git/ or
26 # $ git clone git://perl5.git.perl.org/metaconfig.git metaconfig
28 # See Porting/pumpkin.pod for more information on metaconfig.
31 # $Id: Head.U 6 2006-08-25 22:21:46Z rmanfredi $
33 # Generated on Fri Dec 10 12:04:58 CET 2010 [metaconfig 3.5 PL0]
34 # (with additional metaconfig patches by perlbug@perl.org)
39 SCO csh still thinks true is false. Write to SCO today and tell them that next
40 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
42 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
43 we'd have to do is go in and swap the && and || tokens, wherever they are.)
45 [End of diatribe. We now return you to your regularly scheduled programming...]
49 OOPS! You naughty creature! You didn't run Configure with sh!
50 I will attempt to remedy the situation by running sh for you...
54 true || exec sh $0 $argv:q
56 (exit $?0) || cat c2$$
57 (exit $?0) || exec sh $0 $argv:q
60 if test -f /dev/cputype -a -f /dev/drivers -a -f /dev/osversion; then
63 *** I'm sorry but this system looks like Plan 9 and Plan 9 doesn't do
64 *** Configure that well. (Plan 9 is close to UNIX but not close enough.)
65 *** Please read the README.plan9 for further instructions.
66 *** Cannot continue, aborting.
72 if test ! -c /dev/null ; then
75 *** I'm sorry, but /dev/null appears to be a file rather than a device.
76 *** Please consult your operating sytem's notes for making a device
78 *** Cannot continue, aborting.
84 : compute my invocation name
88 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
93 : Proper separator for the PATH environment variable
95 : On OS/2 this directory should exist if this is not floppy only system ":-]"
96 if test -d c:/. || ( uname -a | grep -i 'os\(/\|\)2' ) 2>&1 >/dev/null ; then
97 if test -n "$OS2_SHELL"; then
99 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
100 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
102 elif test -n "$DJGPP"; then
103 case "X${MACHTYPE:-nonesuchmach}" in
110 : Proper PATH setting
111 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
112 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
113 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
114 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
115 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
116 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /opt/ansic/bin /usr/ccs/bin"
117 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
118 paths="$paths /sbin /usr/sbin /usr/libexec"
119 paths="$paths /system/gnu_library/bin"
123 case "$p_$PATH$p_" in
125 *) test -d $p && PATH=$PATH$p_$p ;;
132 : shall we be using ksh?
138 if (PATH=.; alias -x) >/dev/null 2>&1; then
141 if test -f /hp-ux -a -f /bin/ksh; then
142 needksh='to avoid sh bug in "here document" expansion'
144 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
145 if test X`/usr/bin/uname -v` = X4; then
146 avoidksh="to avoid AIX 4's /bin/sh"
150 if test -f /osf_boot -a -f /usr/sbin/setld; then
151 if test X`/usr/bin/uname -s` = XOSF1; then
152 avoidksh="to avoid Digital UNIX' ksh"
157 case "$inksh/$needksh" in
164 case "$inksh/$avoidksh" in
170 case "$inksh/$needksh-$avoidksh-" in
173 (I see you are using the Korn shell. Some ksh's blow up on $me,
174 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
181 echo "(Feeding myself to $newsh $reason.)"
183 Configure|*/Configure) exec $newsh $0 "$@";;
184 *) exec $newsh Configure "$@";;
188 test -x "${newsh}" || unset newsh
190 : if needed, set CDPATH to a harmless value that is not chatty
191 : avoid bash 2.02 problems with empty CDPATH.
195 *bash*) CDPATH='.' ;;
201 : Configure runs within the UU subdirectory
202 test -d UU || mkdir UU
342 initialinstalllocation=''
371 d_attribute_deprecated=''
372 d_attribute_format=''
373 d_attribute_malloc=''
374 d_attribute_nonnull=''
375 d_attribute_noreturn=''
377 d_attribute_unused=''
378 d_attribute_warn_unused_result=''
379 d_printf_format_null=''
382 d_builtin_choose_expr=''
385 d_c99_variadic_macros=''
432 endhostent_r_proto=''
438 endprotoent_r_proto=''
444 endservent_r_proto=''
497 gethostbyaddr_r_proto=''
499 gethostbyname_r_proto=''
501 gethostent_r_proto=''
514 getnetbyaddr_r_proto=''
516 getnetbyname_r_proto=''
530 d_getprotobyname_r=''
531 getprotobyname_r_proto=''
532 d_getprotobynumber_r=''
533 getprotobynumber_r_proto=''
535 getprotoent_r_proto=''
547 getservbyname_r_proto=''
549 getservbyport_r_proto=''
551 getservent_r_proto=''
577 d_libm_lib_version=''
580 d_localtime_r_needs_tzset=''
591 d_malloc_good_size=''
635 d_old_pthread_create_joinable=''
636 old_pthread_create_joinable=''
638 d_pthread_attr_setscope=''
677 sethostent_r_proto=''
694 setprotoent_r_proto=''
706 setservent_r_proto=''
741 d_sprintf_returns_strlen=''
753 perl_static_inline=''
758 d_stdio_ptr_lval_nochange_cnt=''
759 d_stdio_ptr_lval_sets_cnt=''
903 d_gdbm_ndbm_h_uses_prototypes=''
904 d_gdbmndbm_h_uses_prototypes=''
906 d_ndbm_h_uses_prototypes=''
980 d_inc_version_list=''
982 inc_version_list_init=''
1001 ignore_versioned_solibs=''
1065 d_perl_otherlibdirs=''
1073 api_versionstring=''
1079 version_patchlevel_string=''
1083 d_nv_preserves_uv=''
1084 d_nv_zero_is_allbits_zero=''
1095 nv_overflows_integers_at=''
1096 nv_preserves_uv_bits=''
1168 installsitehtml1dir=''
1171 installsitehtml3dir=''
1178 installsiteman1dir=''
1181 installsiteman3dir=''
1186 installsitescript=''
1201 d_stdio_stream_array=''
1202 stdio_stream_array=''
1219 ccflags_uselargefiles=''
1220 ldflags_uselargefiles=''
1221 libswanted_uselargefiles=''
1242 installvendorarch=''
1249 installvendorhtml1dir=''
1251 vendorhtml1direxp=''
1252 installvendorhtml3dir=''
1254 vendorhtml3direxp=''
1260 installvendorman1dir=''
1263 installvendorman3dir=''
1270 installvendorscript=''
1283 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1286 : We must find out about Eunice early
1288 if test -f /etc/unixtovms; then
1289 eunicefix=/etc/unixtovms
1291 if test -f /etc/unixtovms.exe; then
1292 eunicefix=/etc/unixtovms.exe
1295 : Set executable suffix now -- needed before hints available
1296 if test -f "/libs/version.library"; then
1299 elif test -f "/system/gnu_library/bin/ar.pm"; then
1302 elif test -n "$DJGPP"; then
1305 elif test -d c:/. -o -n "$is_os2" ; then
1313 : Possible local include directories to search.
1314 : Set locincpth to "" in a hint file to defeat local include searches.
1315 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1316 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1318 : no include file wanted by default
1321 : Enable -DEBUGGING and -DDEBUGGING from the command line
1325 : set usethreads on the Configure command line to enable threads.
1326 usereentrant='undef'
1327 : Trailing extension. Override this in a hint file, if needed.
1328 : Extra object files, if any, needed on this platform.
1331 : change the next line if compiling for Xenix/286 on Xenix/386
1332 xlibpth='/usr/lib/386 /lib/386'
1333 : Possible local library directories to search.
1334 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1335 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1337 : general looking path for locating libraries
1338 glibpth="/lib /usr/lib $xlibpth"
1339 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1340 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1341 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1342 test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
1344 : Private path used by Configure to find libraries. Its value
1345 : is prepended to libpth. This variable takes care of special
1346 : machines, like the mips. Usually, it should be empty.
1349 : default library list
1351 : some systems want to use only the non-versioned libso:s
1352 ignore_versioned_solibs=''
1353 : full support for void wanted by default
1359 : set useposix=false in your hint file to disable the POSIX extension.
1361 : set useopcode=false in your hint file to disable the Opcode extension.
1364 ccflags_uselargefiles=''
1365 ldflags_uselargefiles=''
1366 libswanted_uselargefiles=''
1367 : set usemultiplicity on the Configure command line to enable multiplicity.
1368 : set usesocks on the Configure command line to enable socks.
1369 : List of libraries we want.
1370 : If anyone needs extra -lxxx, put those in a hint file.
1371 libswanted="sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun"
1372 libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
1373 : We probably want to search /usr/shlib before most other libraries.
1374 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1375 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1376 glibpth="/usr/shlib $glibpth"
1377 : Do not use vfork unless overridden by a hint file.
1380 : Find the basic shell for Bourne shell scripts
1384 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1387 if test -f "$xxx"; then
1390 : Build up a list and do a single loop so we can 'break' out.
1391 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1392 for xxx in sh bash ksh pdksh ash; do
1394 try="$try ${p}/${xxx}"
1398 if test -f "$xxx"; then
1401 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1404 elif test -f "$xxx.exe"; then
1415 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1417 Usually it's in /bin/sh. How did you even get this far?
1418 Please contact me (Perl Maintainers) at perlbug@perl.org and
1419 we'll try to straighten this all out.
1425 : see if sh knows # comments
1426 if `$sh -c '#' >/dev/null 2>&1`; then
1430 test -f $xcat$_exe || xcat=/usr/bin/cat
1431 if test ! -f $xcat$_exe; then
1432 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1433 if test -f $p/cat$_exe; then
1438 if test ! -f $xcat$_exe; then
1439 echo "Can't find cat anywhere!"
1443 echo "#!$xcat" >sharp
1446 ./sharp > today 2>/dev/null
1447 if test -s today; then
1450 echo "#! $xcat" > sharp
1453 ./sharp > today 2>/dev/null
1454 if test -s today; then
1462 echo "Your $sh doesn't grok # comments--I will strip them later on."
1465 echo "exec grep -v '^[ ]*#'" >spitshell
1467 $eunicefix spitshell
1468 spitshell=`pwd`/spitshell
1470 echo "I presume that if # doesn't work, #! won't work either!"
1475 : figure out how to guarantee sh startup
1477 '') startsh=${sharpbang}${sh} ;;
1489 : echo "Yup, it does."
1491 echo "Hmm... '$startsh' does not guarantee sh startup..."
1492 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1496 : Save command line options in file UU/cmdline.opt for later use in
1497 : generating config.sh.
1498 cat > cmdline.opt <<EOSH
1499 : Configure command line arguments.
1508 cat >>cmdline.opt <<EOSH
1509 config_arg$argn='$arg'
1511 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1514 arg_exp=`cat cmdl.opt`
1515 args_exp="$args_exp$args_sep'$arg_exp'"
1516 argn=`expr $argn + 1`
1521 : produce awk script to parse command line options
1522 cat >options.awk <<'EOF'
1524 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1526 len = length(optstr);
1527 for (i = 1; i <= len; i++) {
1528 c = substr(optstr, i, 1);
1529 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1540 if (substr(str, 1, 1) != "-") {
1541 printf("'%s'\n", str);
1545 for (i = 2; i <= len; i++) {
1546 c = substr(str, i, 1);
1548 printf("-%s\n", substr(str, i));
1554 printf("'%s'\n", substr(str, i + 1));
1567 : process the command line options
1568 set X `for arg in "$@"; do echo "X$arg"; done |
1569 sed -e s/X// | awk -f options.awk`
1574 : set up default values
1584 rm -f optdef.sh posthint.sh
1585 cat >optdef.sh <<EOS
1591 while test $# -gt 0; do
1593 -d) shift; fastread=yes;;
1594 -e) shift; alldone=cont;;
1598 if test -r "$1"; then
1601 echo "$me: cannot read config file $1." >&2
1607 -h) shift; error=true;;
1608 -r) shift; reuseval=true;;
1609 -s) shift; silent=true; realsilent=true;;
1610 -E) shift; alldone=exit;;
1611 -K) shift; knowitall=true;;
1612 -O) shift; override=true;;
1613 -S) shift; silent=true; extractsh=true;;
1618 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1619 echo "$me: ignoring -D $1" >&2
1622 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1623 *) echo "$1='define'" >> optdef.sh;;
1630 *=) echo "$1" >> optdef.sh;;
1632 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1633 echo "$me: ignoring -U $1" >&2
1635 *) echo "$1='undef'" >> optdef.sh;;
1646 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1650 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1651 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1657 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1658 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1659 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1660 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1661 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1662 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1668 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1670 echo "$yyy=''" >> posthint.sh ;;
1675 echo "$yyy='$zzz'" >> posthint.sh ;;
1677 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1679 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1684 echo "$yyy=$zzz" >> posthint.sh ;;
1685 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1689 -V) echo "$me generated by metaconfig 3.5 PL0." >&2
1692 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1700 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1701 [-U symbol] [-U symbol=] [-A command:symbol...]
1702 -d : use defaults for all answers.
1703 -e : go on without questioning past the production of config.sh.
1704 -f : specify an alternate default configuration file.
1705 -h : print this help message and exit (with an error status).
1706 -r : reuse C symbols value if possible (skips costly nm extraction).
1707 -s : silent mode, only echoes questions and essential information.
1708 -D : define symbol to have some value:
1709 -D symbol symbol gets the value 'define'
1710 -D symbol=value symbol gets the value 'value'
1711 common used examples (see INSTALL for more info):
1712 -Duse64bitint use 64bit integers
1713 -Duse64bitall use 64bit integers and pointers
1714 -Dusethreads use thread support
1715 -Dinc_version_list=none do not include older perl trees in @INC
1716 -DEBUGGING=none DEBUGGING options
1717 -Dcc=gcc choose your compiler
1718 -Dprefix=/opt/perl5 choose your destination
1719 -E : stop at the end of questions, after having produced config.sh.
1720 -K : do not use unless you know what you are doing.
1721 -O : let -D and -U override definitions from loaded configuration file.
1722 -S : perform variable substitutions on all .SH files (can mix with -f)
1723 -U : undefine symbol:
1724 -U symbol symbol gets the value 'undef'
1725 -U symbol= symbol gets completely empty
1727 -A : manipulate symbol after the platform specific hints have been applied:
1728 -A append:symbol=value append value to symbol
1729 -A symbol=value like append:, but with a separating space
1730 -A define:symbol=value define symbol to have value
1731 -A clear:symbol define symbol to be ''
1732 -A define:symbol define symbol to be 'define'
1733 -A eval:symbol=value define symbol to be eval of value
1734 -A prepend:symbol=value prepend value to symbol
1735 -A undef:symbol define symbol to be 'undef'
1736 -A undef:symbol= define symbol to be ''
1737 e.g.: -A prepend:libswanted='cl pthread '
1738 -A ccflags=-DSOME_MACRO
1739 -V : print version number and exit (with a zero status).
1746 case "$fastread$alldone" in
1749 case "$extractsh" in
1752 if test ! -t 0; then
1753 echo "Say 'sh Configure', not 'sh <Configure'"
1763 true) exec 1>/dev/null;;
1766 : run the defines and the undefines, if any, but leave the file out there...
1769 : create the posthint manipulation script and leave the file out there...
1774 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1775 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1776 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1777 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1778 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1781 : Some greps do not return status, grrr.
1782 echo "grimblepritz" >grimble
1783 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1785 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1791 : the following should work in any shell
1795 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1796 cat >contains <<'EOSS'
1797 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1802 : Find the path to the source tree
1805 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1809 *) src=`cd ../$src && pwd` ;;
1822 if test -f $rsrc/Configure && \
1823 $contains "^package='$package'\$" $rsrc/Configure >/dev/null 2>&1
1825 : found it, so we are ok.
1828 for src in . .. ../.. ../../.. ../../../..; do
1829 if test -f ../$src/Configure && \
1830 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1841 Sorry, I can't seem to locate the source dir for $package. Please start
1842 Configure with an explicit path -- i.e. /some/path/Configure.
1850 echo "Sources for $package found in \"$src\"." >&4
1854 : script used to extract .SH files with variable substitutions
1855 cat >extract <<'EOS'
1857 echo "Doing variable substitutions on .SH files..."
1858 if test -f MANIFEST; then
1859 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1861 echo "(Looking for .SH files under the source directory.)"
1862 set x `(cd "$src"; find . -name "*.SH" -print)`
1866 0) set x `(cd "$src"; echo *.SH)`; shift;;
1868 if test ! -f "$src/$1"; then
1874 while test $name; do
1875 if test ! -d "$name"; then
1876 create="$name $create";
1877 name=`echo $name | sed -e "s|^[^/]*$||"`;
1878 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1883 for file in $create; do
1892 dir=`expr X$file : 'X\(.*\)/'`
1893 file=`expr X$file : 'X.*/\(.*\)'`
1894 (cd "$dir" && . ./$file)
1904 dir=`expr X$file : 'X\(.*\)/'`
1905 file=`expr X$file : 'X.*/\(.*\)'`
1906 (set x $dir; shift; eval $mkdir_p)
1907 sh <"$src/$dir/$file"
1916 if test -f "$src/config_h.SH"; then
1917 if test ! -f config.h; then
1918 : oops, they left it out of MANIFEST, probably, so do it anyway.
1919 . "$src/config_h.SH"
1924 : extract files and exit if asked to do so
1925 case "$extractsh" in
1927 case "$realsilent" in
1931 case "$config_sh" in
1932 '') config_sh='config.sh';;
1935 echo "Fetching answers from $config_sh..."
1938 test "$override" && . ./optdef.sh
1942 echo "Extraction done."
1947 : Eunice requires " " instead of "", can you believe it
1950 echo "Beginning of configuration questions for $package."
1952 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1954 : first determine how to suppress newline on echo command
1956 echo "Checking echo to see how to suppress newlines..."
1957 (echo "hi there\c" ; echo " ") >.echotmp
1958 if $contains c .echotmp >/dev/null 2>&1 ; then
1969 echo $n "The star should be here-->$c"
1973 : Now test for existence of everything in MANIFEST
1975 if test -f "$rsrc/MANIFEST"; then
1976 echo "First let's make sure your kit is complete. Checking..." >&4
1977 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | \
1978 (split -l 50 2>/dev/null || split -50)
1981 for filelist in x??; do
1982 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` \
1983 >/dev/null 2>>"$tmppwd/missing")
1985 if test -s missing; then
1989 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1991 You have the option of continuing the configuration process, despite the
1992 distinct possibility that your kit is damaged, by typing 'y'es. If you
1993 do, don't blame me if something goes wrong. I advise you to type 'n'o
1994 and contact the author (perlbug@perl.org).
1997 echo $n "Continue? [n] $c" >&4
2001 echo "Continuing..." >&4
2005 echo "ABORTING..." >&4
2010 echo "Looks good..."
2013 echo "There is no MANIFEST file. I hope your kit is complete !"
2017 : Find the appropriate value for a newline for tr
2019 if test -n "$DJGPP"; then
2022 if test X"$trnl" = X; then
2023 case "`echo foo|tr '\n' x 2>/dev/null`" in
2027 if test X"$trnl" = X; then
2028 case "`echo foo|tr '\012' x 2>/dev/null`" in
2029 foox) trnl='\012' ;;
2032 if test X"$trnl" = X; then
2033 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
2034 fooxy) trnl='\n\r' ;;
2037 if test X"$trnl" = X; then
2040 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
2046 : compute the number of columns on the terminal for proper question formatting
2051 : set up the echo used in my read
2052 myecho="case \"\$xxxm\" in
2053 '') echo $n \"\$rp $c\" >&4;;
2055 '') echo $n \"[\$xxxm] $c\";;
2057 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
2059 echo $n \"[\$xxxm] $c\" >&4
2061 echo $n \"\$rp [\$xxxm] $c\" >&4
2067 : now set up to do reads with possible shell escape and default assignment
2073 case "\$fastread" in
2074 yes) case "\$dflt" in
2077 case "\$silent-\$rp" in
2082 *) case "\$silent" in
2083 true) case "\$rp" in
2088 while expr "X\$ans" : "X!" >/dev/null; do
2092 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2100 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2109 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2114 echo "(OK, I'll run with -d after this question.)" >&4
2117 echo "*** Sorry, \$1 not supported yet." >&4
2127 echo "*** Substitution done -- please confirm."
2129 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2134 echo "*** Error -- try again."
2141 case "\$ans\$xxxm\$nostick" in
2153 : create .config dir to save info across Configure sessions
2154 test -d ../.config || mkdir ../.config
2155 cat >../.config/README <<EOF
2156 This directory created by Configure to save information that should
2157 persist across sessions for $package.
2159 You may safely delete it if you wish.
2162 : See if we are using a devel version and want that
2163 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2166 usedevel="$define" ;;
2167 *) case "$xversion" in
2170 *** WHOA THERE!!! ***
2172 This is an UNSTABLE DEVELOPMENT release.
2173 The version of this $package distribution is $xversion, that is, odd,
2174 (as opposed to even) and that signifies a development release.
2175 If you want a maintenance release, you want an even-numbered version.
2177 Do ***NOT*** install this into production use.
2178 Data corruption and crashes are possible.
2180 It is most seriously suggested that you do not continue any further
2181 unless you want to help in developing and debugging Perl.
2183 If you *still* want to build perl, you can answer 'y' now,
2184 or pass -Dusedevel to Configure.
2187 rp='Do you really want to continue?'
2191 [yY]) echo >&4 "Okay, continuing."
2192 usedevel="$define" ;;
2193 *) echo >&4 "Okay, bye."
2204 case "$versiononly" in
2205 '') versiononly="$define" ;;
2207 case "$installusrbinperl" in
2208 '') installusrbinperl="$undef" ;;
2213 : general instructions
2216 user=`(logname) 2>/dev/null`
2218 '') user=`whoami 2>&1`;;
2220 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2223 rp='Would you like to see the instructions?'
2234 This installation shell script will examine your system and ask you questions
2235 to determine how the perl5 package should be installed. If you get
2236 stuck on a question, you may use a ! shell escape to start a subshell or
2237 execute a command. Many of the questions will have default answers in square
2238 brackets; typing carriage return will give you the default.
2240 On some of the questions which ask for file or directory names you are allowed
2241 to use the ~name construct to specify the login directory belonging to "name",
2242 even if you don't have a shell which knows about that. Questions where this is
2243 allowed will be marked "(~name ok)".
2247 dflt='Type carriage return to continue'
2251 The prompter used in this script allows you to use shell variables and
2252 backticks in your answers. You may use $1, $2, etc... to refer to the words
2253 in the default answer, as if the default line was a set of arguments given to a
2254 script shell. This means you may also use $* to repeat the whole default line,
2255 so you do not have to re-type everything to add something to the default.
2257 Everytime there is a substitution, you will have to confirm. If there is an
2258 error (e.g. an unmatched backtick), the default answer will remain unchanged
2259 and you will be prompted again.
2261 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2262 the questions and use the computed defaults (or the previous answers if there
2263 was already a config.sh file). Type 'Configure -h' for a list of options.
2264 You may also start interactively and then answer '& -d' at any prompt to turn
2265 on the non-interactive behaviour for the remainder of the execution.
2271 Much effort has been expended to ensure that this shell script will run on any
2272 Unix system. If despite that it blows up on yours, your best bet is to edit
2273 Configure and run it again. If you can't run Configure for some reason,
2274 you'll have to generate a config.sh file by hand. Whatever problems you
2275 have, let me (perlbug@perl.org) know how I blew it.
2277 This installation script affects things in two ways:
2279 1) it may do direct variable substitutions on some of the files included
2281 2) it builds a config.h file for inclusion in C programs. You may edit
2282 any of these files as the need arises after running this script.
2284 If you make a mistake on a question, there is no easy way to back up to it
2285 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2286 files. Configure will offer to let you do this before it runs the SH files.
2289 dflt='Type carriage return to continue'
2291 case "$firsttime" in
2292 true) echo $user >>../.config/instruct;;
2296 : find out where common programs are
2298 echo "Locating common programs..." >&4
2311 if test -d \$dir/\$thing; then
2317 for thisthing in \$dir/\$thing; do
2318 : just loop through to pick last item
2320 if test -f \$thisthing; then
2323 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2326 elif test -f \$dir/\$thing.exe; then
2327 if test -n "$DJGPP"; then
2328 echo \$dir/\$thing.exe
2329 elif test "$eunicefix" != ":"; then
2330 : on Eunice apparently
2383 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2384 pth="$pth /lib /usr/lib"
2385 for file in $loclist; do
2389 if test -f "$xxx"; then
2392 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2393 xxx=`./loc $file $file $pth`
2396 '') xxx=`./loc $file $file $pth`;;
2397 *) xxx=`./loc $xxx $xxx $pth`;;
2399 eval $file=$xxx$_exe
2403 echo $file is in $xxx.
2406 echo $file is in $xxx.
2409 echo "I don't know where '$file' is, and my life depends on it." >&4
2410 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2416 echo "Don't worry if any of the following aren't found..."
2418 for file in $trylist; do
2422 if test -f "$xxx"; then
2425 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2426 xxx=`./loc $file $file $pth`
2429 '') xxx=`./loc $file $file $pth`;;
2430 *) xxx=`./loc $xxx $xxx $pth`;;
2432 eval $file=$xxx$_exe
2436 echo $file is in $xxx.
2439 echo $file is in $xxx.
2442 echo "I don't see $file out there, $say."
2449 echo "Substituting grep for egrep."
2456 *) if $less -R </dev/null >/dev/null; then
2457 echo "Substituting less -R for less."
2465 echo "Substituting cp for ln."
2474 echo "I can't find make or gmake, and my life depends on it." >&4
2475 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2483 *) # We can't have osname yet.
2484 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2485 # Assume that gmake, if found, is definitely GNU make
2486 # and prefer it over the system make.
2487 echo "Substituting gmake for make."
2495 echo "Hopefully test is built into your sh."
2498 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2499 echo "Using the test built into your sh."
2507 echo "Hopefully echo is built into your sh."
2512 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2513 $echo $n "hi there$c" >foo1
2514 echo $n "hi there$c" >foo2
2515 if cmp foo1 foo2 >/dev/null 2>&1; then
2516 echo "They are compatible. In fact, they may be identical."
2523 They are not compatible! You are probably running ksh on a non-USG system.
2524 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2525 have echo built in and we may have to run some Bourne shell scripts. That
2526 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2529 $echo $n "The star should be here-->$c"
2536 # This question was auctioned at YAPC::Europe-2007 in Vienna
2537 # I never promised you could answer it. I only auctioned the question.
2539 The following message is sponsored by
2541 Dresden.pm<--The stars should be here.
2543 Dear Perl user, system administrator or package
2544 maintainer, the Perl community sends greetings to
2545 you. Do you (emblematical) greet back [Y/n]? n
2549 : Check what type of C compiler we use
2553 cat <<'EOSC' >>trygcc
2558 int main(int argc, char *argv[]) {
2562 if $cc -o try $ccflags $ldflags try.c; then
2565 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2571 # Skip this test because it gives a false match on output like:
2572 # ./trygcc: line 23: cc: command not found
2573 # case "`$cc -v -c try.c 2>&1`" in
2574 # *gcc*) trygcc=no ;;
2576 if $test X"$trygcc" = Xyes; then
2577 if gcc -o try -c try.c; then
2579 echo "You seem to have a working gcc, though." >&4
2580 # Switching compilers may undo the work of hints files.
2581 # The most common problem is -D_REENTRANT for threads.
2582 # This heuristic catches that case, but gets false positives
2583 # if -Dusethreads was not actually specified. Better to
2584 # bail out here with a useful message than fail
2585 # mysteriously later. Should we perhaps just try to
2586 # re-invoke Configure -Dcc=gcc config_args ?
2587 if $test -f usethreads.cbu; then
2590 *** However, any setting of the C compiler flags (e.g. for thread support)
2591 *** will be lost. It may be necessary for you to restart Configure and
2592 *** add -Dcc=gcc to your Configure command line.
2595 rp="Would you like to go ahead and try gcc anyway?"
2598 rp="Would you like to use it?"
2601 if $test -f myread; then
2604 if $test -f UU/myread; then
2607 echo "Cannot find myread, sorry. Aborting." >&2
2612 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2625 cat <<'EOSC' >>checkcc
2630 int main(int argc, char *argv[]) {
2634 if $cc -o try $ccflags $ldflags try.c; then
2637 if $test X"$despair" = Xyes; then
2638 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2641 You need to find a working C compiler.
2642 Either (purchase and) install the C compiler supplied by your OS vendor,
2643 or for a free C compiler try http://gcc.gnu.org/
2644 I cannot continue any further, aborting.
2653 : determine whether symbolic links are supported
2656 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2657 echo "Symbolic links are supported." >&4
2660 echo "Symbolic links are NOT supported." >&4
2665 : determine whether symbolic links are supported
2669 echo "Checking how to test for symbolic links..." >&4
2671 if $test "X$issymlink" = X; then
2673 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2674 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2676 if test $? = 0; then
2679 echo "Your builtin 'test -h' may be broken." >&4
2682 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2685 if test -f "$p/$test"; then
2694 echo "Trying external '$test -h'." >&4
2695 issymlink="$test -h"
2696 if $test ! -h sym >/dev/null 2>&1; then
2697 echo "External '$test -h' is broken, too." >&4
2705 if $test "X$issymlink" = X; then
2706 if $test -L sym 2>/dev/null; then
2707 issymlink="$test -L"
2708 echo "The builtin '$test -L' worked." >&4
2711 if $test "X$issymlink" != X; then
2712 echo "You can test for symbolic links with '$issymlink'." >&4
2714 echo "I do not know how you can test for symbolic links." >&4
2718 *) echo "No symbolic links, so not testing for their testing..." >&4
2723 : Make symlinks util
2724 case "$mksymlinks" in
2727 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2730 *) case "$lns:$issymlink" in
2731 *"ln"*" -s:"*"test -"?)
2732 echo "Creating the symbolic links..." >&4
2733 echo "(First creating the subdirectories...)" >&4
2735 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2737 test -z "$directory" && break
2741 if test ! -d t/base; then
2742 echo "Failed to create the subdirectories. Aborting." >&4
2745 echo "(Then creating the symlinks...)" >&4
2746 awk '{print $1}' $src/MANIFEST | while true; do
2748 test -z "$filename" && break
2749 if test -f $filename; then
2750 if $issymlink $filename; then
2754 if test -f $filename; then
2755 echo "$filename already exists, not symlinking."
2757 ln -s $src/$filename $filename
2761 if test ! -f t/base/lex.t; then
2762 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2767 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2775 : Check for Cross-Compilation
2776 case "$usecrosscompile" in
2778 $echo "Cross-compiling..."
2781 *-*-gcc) # A cross-compiling gcc, probably.
2782 targetarch=`$echo $cc|$sed 's/-gcc$//'`
2784 # leave out ld, choosing it is more complex
2786 ranlib=$targetarch-ranlib
2787 $echo 'extern int foo;' > try.c
2788 set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
2790 if $test $# -gt 0; then
2792 incpth="`$echo $incpth|$sed 's/^ //'`"
2793 echo "Guessing incpth '$incpth'." >&4
2795 j="`$echo $i|$sed 's,/include$,/lib,'`"
2796 if $test -d $j; then
2800 libpth="`$echo $libpth|$sed 's/^ //'`"
2801 echo "Guessing libpth '$libpth'." >&4
2806 case "$targetarch" in
2807 '') echo "Targetarch not defined." >&4; croak=y ;;
2808 *) echo "Using targetarch $targetarch." >&4 ;;
2811 '') echo "Incpth not defined." >&4; croak=y ;;
2812 *) echo "Using incpth '$incpth'." >&4 ;;
2815 '') echo "Libpth not defined." >&4; croak=y ;;
2816 *) echo "Using libpth '$libpth'." >&4 ;;
2819 '') for i in $incpth; do
2820 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2822 echo "Guessing usrinc $usrinc." >&4
2827 '') echo "Usrinc not defined." >&4; croak=y ;;
2830 *) echo "Using usrinc $usrinc." >&4 ;;
2832 case "$targethost" in
2833 '') echo "Targethost not defined." >&4; croak=y ;;
2834 *) echo "Using targethost $targethost." >&4
2839 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2842 /*) run=$src/Cross/run
2843 targetmkdir=$src/Cross/mkdir
2845 from=$src/Cross/from
2847 *) pwd=`$test -f ../Configure & cd ..; pwd`
2849 targetmkdir=$pwd/Cross/mkdir
2851 from=$pwd/Cross/from
2854 case "$targetrun" in
2855 '') targetrun=ssh ;;
2860 case "$targetfrom" in
2861 '') targetfrom=scp ;;
2865 from=$from-$targetfrom
2866 case "$targetdir" in
2868 echo "Guessing targetdir $targetdir." >&4
2871 case "$targetuser" in
2873 echo "Guessing targetuser $targetuser." >&4
2876 case "$targetfrom" in
2880 case "$targetrun" in
2892 '') cwd=$targetdir ;;
2896 if $test ! -f \$exe.xok; then
2900 $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2903 *) echo "Unknown targetrun '$targetrun'" >&4
2907 case "$targetmkdir" in
2909 cat >$targetmkdir <<EOF
2911 $targetrun -l $targetuser $targethost "mkdir -p \$@"
2913 $chmod a+rx $targetmkdir
2915 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2927 $targetmkdir \`dirname \$f\`
2928 $targetto $q \$f $targetuser@$targethost:\$f || exit 1
2931 $targetmkdir $targetdir/\`dirname \$f\`
2932 $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2945 $mkdir -p $targetdir/\`dirname \$f\`
2946 $cp \$f $targetdir/\$f || exit 1
2949 $targetmkdir $targetdir/\`dirname \$f\`
2950 $cp \$f $targetdir/\$f || exit 1
2957 *) echo "Unknown targetto '$targetto'" >&4
2961 case "$targetfrom" in
2968 $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2973 cp) cat >$from <<EOF
2978 cp $targetdir/\$f . || exit 1
2983 *) echo "Unknown targetfrom '$targetfrom'" >&4
2987 if $test ! -f $run; then
2988 echo "Target 'run' script '$run' not found." >&4
2992 if $test ! -f $to; then
2993 echo "Target 'to' script '$to' not found." >&4
2997 if $test ! -f $from; then
2998 echo "Target 'from' script '$from' not found." >&4
3002 if $test ! -f $run -o ! -f $to -o ! -f $from; then
3006 Using '$run' for remote execution,
3007 and '$from' and '$to'
3008 for remote file transfer.
3014 usecrosscompile='undef'
3019 : see whether [:lower:] and [:upper:] are supported character classes
3021 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
3023 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
3027 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
3028 # (0xd9 and 0xe2), therefore that is a nice testing point.
3029 if test "X$up" = X -o "X$low" = X; then
3030 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
3036 if test "X$up" = X -o "X$low" = X; then
3037 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
3043 if test "X$up" = X -o "X$low" = X; then
3044 case "`echo RS | od -x 2>/dev/null`" in
3046 echo "Hey, this might be EBCDIC." >&4
3047 if test "X$up" = X -o "X$low" = X; then
3048 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
3049 rs) up='[A-IJ-RS-Z]'
3054 if test "X$up" = X -o "X$low" = X; then
3055 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
3065 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
3067 echo "Using $up and $low to convert case." >&4
3070 echo "I don't know how to translate letters from upper to lower case." >&4
3071 echo "Your tr is not acting any way I know of." >&4
3075 : set up the translation script tr, must be called with ./tr of course
3079 '[A-Z][a-z]') exec $tr '$up' '$low';;
3080 '[a-z][A-Z]') exec $tr '$low' '$up';;
3087 : Try to determine whether config.sh was made on this system
3088 case "$config_sh" in
3090 myuname=`$uname -a 2>/dev/null`
3091 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
3092 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
3093 # because the A-Z/a-z are not consecutive.
3094 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e "s,['/],,g" | \
3095 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
3096 newmyuname="$myuname"
3098 case "$knowitall" in
3100 if test -f ../config.sh; then
3101 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3102 eval "`grep myuname= ../config.sh`"
3104 if test "X$myuname" = "X$newmyuname"; then
3112 : Get old answers from old config file if Configure was run on the
3113 : same system, otherwise use the hints.
3116 if test -f config.sh; then
3118 rp="I see a config.sh file. Shall I use it to set the defaults?"
3121 n*|N*) echo "OK, I'll ignore it."
3122 mv config.sh config.sh.old
3123 myuname="$newmyuname"
3125 *) echo "Fetching default answers from your old config.sh file..." >&4
3133 : Older versions did not always set $sh. Catch re-use of such
3143 if test ! -f config.sh; then
3146 First time through, eh? I have some defaults handy for some systems
3147 that need some extra help getting the Configure answers right:
3150 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3152 : Half the following guesses are probably wrong... If you have better
3153 : tests or hints, please send them to perlbug@perl.org
3154 : The metaconfig authors would also appreciate a copy...
3155 $test -f /irix && osname=irix
3156 $test -f /xenix && osname=sco_xenix
3157 $test -f /dynix && osname=dynix
3158 $test -f /dnix && osname=dnix
3159 $test -f /lynx.os && osname=lynxos
3160 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3161 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3162 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3163 $test -f /bin/mips && /bin/mips && osname=mips
3164 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
3165 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
3166 $test -d /usr/apollo/bin && osname=apollo
3167 $test -f /etc/saf/_sactab && osname=svr4
3168 $test -d /usr/include/minix && osname=minix
3169 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3170 if $test -d /MachTen -o -d /MachTen_Folder; then
3172 if $test -x /sbin/version; then
3173 osvers=`/sbin/version | $awk '{print $2}' |
3174 $sed -e 's/[A-Za-z]$//'`
3175 elif $test -x /usr/etc/version; then
3176 osvers=`/usr/etc/version | $awk '{print $2}' |
3177 $sed -e 's/[A-Za-z]$//'`
3183 $test -f /sys/posix.dll &&
3184 $test -f /usr/bin/what &&
3185 set X `/usr/bin/what /sys/posix.dll` &&
3186 $test "$3" = UWIN &&
3190 if $test -f $uname; then
3198 umips) osname=umips ;;
3201 [23]100) osname=mips ;;
3202 next*) osname=next ;;
3204 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3205 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3208 elif $test -f /etc/kconfig; then
3210 if test "$lns" = "$ln -s"; then
3212 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3214 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3221 if test -n "$DJGPP"; then
3230 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3232 # oslevel can fail with:
3233 # oslevel: Unable to acquire lock.
3234 *not\ found) osvers="$4"."$3" ;;
3235 '<3240'|'<>3240') osvers=3.2.0 ;;
3236 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3237 '=3250'|'>3250') osvers=3.2.5 ;;
3241 bsd386) osname=bsd386
3244 cygwin*) osname=cygwin
3247 *dc.osx) osname=dcosx
3253 domainos) osname=apollo
3259 dragonfly) osname=dragonfly
3262 dynixptx*) osname=dynixptx
3263 osvers=`echo "$4"|sed 's/^v//'`
3265 freebsd) osname=freebsd
3267 genix) osname=genix ;;
3271 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3287 netbsd*) osname=netbsd
3290 news-os) osvers="$3"
3292 4*) osname=newsos4 ;;
3296 next*) osname=next ;;
3297 nonstop-ux) osname=nonstopux ;;
3298 openbsd) osname=openbsd
3304 POSIX-BC | posix-bc ) osname=posix-bc
3307 powerux | power_ux | powermax_os | powermaxos | \
3308 powerunix | power_unix) osname=powerux
3314 solaris) osname=solaris
3316 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3323 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3327 titanos) osname=titanos
3336 ultrix) osname=ultrix
3339 osf1|mls+) case "$5" in
3342 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3345 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3348 hp*) osname=hp_osf1 ;;
3349 mips) osname=mips_osf1 ;;
3352 # UnixWare 7.1.2 is known as Open UNIX 8
3353 openunix|unixware) osname=svr5
3361 $2) case "$osname" in
3365 : svr4.x or possibly later
3375 if test -f /stand/boot ; then
3376 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3377 if test -n "$INITPROG" -a -f "$INITPROG"; then
3378 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3379 if test -n "$isesix"; then
3387 *) if test -f /etc/systemid; then
3389 set `echo $3 | $sed 's/\./ /g'` $4
3390 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3392 elif $test -f $src/hints/sco_$1_$2.sh; then
3394 elif $test -f $src/hints/sco_$1.sh; then
3399 '') : Still unknown. Probably a generic Sys V.
3408 *) case "$osname" in
3409 '') : Still unknown. Probably a generic BSD.
3417 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3418 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3419 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3422 $rm -f UU/kernel.what
3423 elif test -d c:/. -o -n "$is_os2" ; then
3430 case "$targetarch" in
3433 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3438 : Now look for a hint file osname_osvers, unless one has been
3439 : specified already.
3442 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3443 : Also try without trailing minor version numbers.
3444 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3445 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3446 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3447 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3450 *) case "$osvers" in
3453 *) if $test -f $src/hints/$file.sh ; then
3455 elif $test -f $src/hints/$xfile.sh ; then
3457 elif $test -f $src/hints/$xxfile.sh ; then
3459 elif $test -f $src/hints/$xxxfile.sh ; then
3461 elif $test -f $src/hints/$xxxxfile.sh ; then
3463 elif $test -f "$src/hints/${osname}.sh" ; then
3472 if $test -f Policy.sh ; then
3475 none) dflt="Policy" ;;
3476 *) dflt="Policy $dflt" ;;
3481 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3485 if $test -f Policy.sh ; then
3488 There's also a Policy hint file available, which should make the
3489 site-specific (policy) questions easier to answer.
3496 You may give one or more space-separated answers, or "none" if appropriate.
3497 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3498 previous run of Configure, you may specify it as well as or instead of
3499 OS-specific hints. If hints are provided for your OS, you should use them:
3500 although Perl can probably be built without hints on many platforms, using
3501 hints often improve performance and may enable features that Configure can't
3502 set up on its own. If there are no hints that match your OS, specify "none";
3503 DO NOT give a wrong version or a wrong OS.
3507 rp="Which of these apply, if any?"
3510 for file in $tans; do
3511 if $test X$file = XPolicy -a -f Policy.sh; then
3513 $cat Policy.sh >> UU/config.sh
3514 elif $test -f $src/hints/$file.sh; then
3515 . $src/hints/$file.sh
3516 $cat $src/hints/$file.sh >> UU/config.sh
3517 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3520 : Give one chance to correct a possible typo.
3521 echo "$file.sh does not exist"
3523 rp="hint to use instead?"
3525 for file in $ans; do
3526 if $test -f "$src/hints/$file.sh"; then
3527 . $src/hints/$file.sh
3528 $cat $src/hints/$file.sh >> UU/config.sh
3529 elif $test X$ans = X -o X$ans = Xnone ; then
3532 echo "$file.sh does not exist -- ignored."
3539 : Remember our hint file for later.
3540 if $test -f "$src/hints/$file.sh" ; then
3550 echo "Fetching default answers from $config_sh..." >&4
3554 cp $config_sh config.sh 2>/dev/null
3564 test "$override" && . ./optdef.sh
3566 : Restore computed paths
3567 for file in $loclist $trylist; do
3568 eval $file="\$_$file"
3573 Configure uses the operating system name and version to set some defaults.
3574 The default value is probably right if the name rings a bell. Otherwise,
3575 since spelling matters for me, either accept the default or answer "none"
3582 ''|' '|none) dflt=none ;;
3583 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3586 *) dflt="$osname" ;;
3588 rp="Operating system name?"
3592 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3598 ''|' '|none) dflt=none ;;
3599 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3600 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3602 ''|' ') dflt=none ;;
3607 *) dflt="$osvers" ;;
3609 rp="Operating system version?"
3619 : who configured the system
3620 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3623 cf_by=`(logname) 2>/dev/null`
3626 cf_by=`(whoami) 2>/dev/null`
3628 "") cf_by=unknown ;;
3633 : decide how portable to be. Allow command line overrides.
3634 case "$d_portable" in
3636 *) d_portable="$define" ;;
3639 : set up shell script to do ~ expansion
3645 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3648 if $test -f /bin/csh; then
3649 /bin/csh -f -c "glob \$1"
3654 name=\`$expr x\$1 : '..\([^/]*\)'\`
3655 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3656 if $test ! -d "\$dir"; then
3658 echo "\$me: can't locate home directory for: \$name" >&2
3663 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3679 : now set up to get a file name
3683 cat <<'EOSC' >>getfile
3699 : getfile will accept an answer from the comma-separated list
3700 : enclosed in parentheses even if it does not meet other criteria.
3701 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3702 fn=`echo $fn | sed 's/(.*)//'`
3708 loc_file=`expr $fn : '.*:\(.*\)'`
3709 fn=`expr $fn : '\(.*\):.*'`
3717 */*) fullpath=true;;
3726 *e*) exp_file=true;;
3729 *p*) nopath_ok=true;;
3734 *d*) type='Directory';;
3735 *l*) type='Locate';;
3740 Locate) what='File';;
3745 case "$d_portable" in
3753 while test "$type"; do
3758 true) rp="$rp (~name ok)";;
3761 if test -f UU/getfile.ok && \
3762 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3781 value=`UU/filexp $ans`
3784 if test "$ans" != "$value"; then
3785 echo "(That expands to $value on this system.)"
3799 /*) value="$ansexp" ;;
3800 [a-zA-Z]:/*) value="$ansexp" ;;
3805 echo "I shall only accept a full path name, as in /bin/ls." >&4
3806 echo "Use a ! shell escape if you wish to check pathnames." >&4
3809 echo "Please give a full path name, starting with slash." >&4
3812 echo "Note that using ~name is ok provided it expands well." >&4
3825 for fp in $gfpth; do
3826 if test "X$fp" = X.; then
3831 if test -f "$pf"; then
3833 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3835 echo "($value is not a plain file, but that's ok.)"
3838 if test X"$type" = X; then
3845 for fp in $gfpth; do
3846 if test "X$fp" = X.; then
3851 direxp="$fp/$ansexp"
3853 if test -d "$direxp"; then
3861 if test -d "$ansexp"; then
3862 echo "(Looking for $loc_file in directory $value.)"
3863 value="$value/$loc_file"
3864 ansexp="$ansexp/$loc_file"
3866 if test -f "$ansexp"; then
3869 case "$nopath_ok" in
3870 true) case "$value" in
3872 *) echo "Assuming $value will be in people's path."
3888 if test "$fastread" = yes; then
3893 rp="$what $value doesn't exist. Use that name anyway?"
3912 test "X$gfpthkeep" != Xy && gfpth=""
3915 : determine root of directory hierarchy where package will be installed.
3918 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
3921 dflt=`echo "$prefix" | sed 's/.$//'`
3929 By default, $package will be installed in $dflt/bin, manual pages
3930 under $dflt/man, etc..., i.e. with $dflt as prefix for all
3931 installation directories. Typically this is something like /usr/local.
3932 If you wish to have binaries under /usr/bin but other parts of the
3933 installation under /usr/local, that's ok: you will be prompted
3934 separately for each of the installation directories, the prefix being
3935 only used to set the defaults.
3939 rp='Installation prefix to use?'
3947 *) oldprefix="$prefix";;
3954 : allow them to override the AFS root
3957 *) afsroot=$afsroot ;;
3963 $define|true) afs=true ;;
3964 $undef|false) afs=false ;;
3965 *) if $test -d $afsroot; then
3973 echo "AFS may be running... I'll be extra cautious then..." >&4
3975 echo "AFS does not seem to be running..." >&4
3978 : determine installation prefix for where package is to be installed.
3982 Since you are running AFS, I need to distinguish the directory in which
3983 files will reside from the directory in which they are installed (and from
3984 which they are presumably copied to the former directory by occult means).
3987 case "$installprefix" in
3988 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
3989 *) dflt="$installprefix";;
3994 In some special cases, particularly when building $package for distribution,
3995 it is convenient to distinguish the directory in which files should be
3996 installed from the directory ($prefix) in which they will
3997 eventually reside. For most users, these two directories are the same.
4000 case "$installprefix" in
4002 *) dflt=$installprefix;;
4006 rp='What installation prefix should I use for installing files?'
4008 installprefix="$ans"
4009 installprefixexp="$ansexp"
4011 : Perform the prefixexp/installprefixexp correction if necessary
4012 cat <<EOS >installprefix
4015 cat <<'EOSC' >>installprefix
4016 : Change installation prefix, if necessary.
4017 if $test X"$prefix" != X"$installprefix"; then
4018 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
4020 eval "install${prefixvar}=\"\$${prefixvar}exp\""
4023 chmod +x installprefix
4024 $eunicefix installprefix
4026 : Set variables such as privlib and privlibexp from the output of ./getfile
4027 : performing the prefixexp/installprefixexp correction if necessary.
4028 cat <<EOS >setprefixvar
4031 cat <<'EOSC' >>setprefixvar
4032 eval "${prefixvar}=\"\$ans\""
4033 eval "${prefixvar}exp=\"\$ansexp\""
4036 chmod +x setprefixvar
4037 $eunicefix setprefixvar
4039 : set up the script used to warn in case of inconsistency
4048 '') echo "The $hint value for \$$var on this machine was \"$was\"!" >&4
4050 *) echo "Hmm. Based on the hints in hints/$hintfile.sh, " >&4
4051 echo "the $hint value for \$$var on this machine was \"$was\"!" >&4
4056 echo "*** WHOA THERE!!! ***" >&4
4057 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
4060 rp=" Keep the $hint value?"
4063 y) td=$was; tu=$was;;
4067 : function used to set '$1' to '$val'
4068 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
4070 $define$undef) . ./whoa; eval "$var=\$td";;
4071 $undef$define) . ./whoa; eval "$var=\$tu";;
4072 *) eval "$var=$val";;
4075 : Check is we will use socks
4077 $define|true|[yY]*) dflt='y';;
4082 Perl can be built to use the SOCKS proxy protocol library. To do so,
4083 Configure must be run with -Dusesocks. If you use SOCKS you also need
4084 to use the PerlIO abstraction layer, this will be implicitly selected.
4086 If this doesn't make any sense to you, just accept the default '$dflt'.
4088 rp='Build Perl for SOCKS?'
4091 y|Y) val="$define" ;;
4098 $define|true|[yY]*) useperlio="$define";;
4101 : Check if we want perlio
4102 case "$useperlio" in
4103 $define|true|[yY]*|'') dflt='y';;
4108 Previous version of $package used the standard IO mechanisms as
4109 defined in <stdio.h>. Versions 5.003_02 and later of $package allow
4110 alternate IO mechanisms via the PerlIO abstraction layer, but the
4111 stdio mechanism is still available if needed. The abstraction layer
4112 can use AT&T's sfio (if you already have sfio installed) or regular stdio.
4113 Using PerlIO with sfio may cause problems with some extension modules.
4115 If this doesn't make any sense to you, just accept the default '$dflt'.
4117 rp='Use the PerlIO abstraction layer?'
4124 echo "Ok, doing things the stdio way."
4133 case "$useperlio" in
4134 $define|true|[yY]*) ;;
4137 You are using the SOCKS proxy protocol library which means that you
4138 should also use the PerlIO layer. You may be headed for trouble.
4146 : get the patchlevel
4148 echo "Getting the current patchlevel..." >&4
4149 if $test -r $rsrc/patchlevel.h;then
4150 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
4151 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4152 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4153 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4154 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4155 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4156 perl_patchlevel=`egrep ',"(MAINT|SMOKE)[0-9][0-9]*"' $rsrc/patchlevel.h|tail -1|sed 's/[^0-9]//g'`
4165 $echo "(You do not have patchlevel.h. Eek.)"
4167 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
4168 version_patchlevel_string="version $patchlevel subversion $subversion"
4169 case "$perl_patchlevel" in
4171 *) perl_patchlevel=`echo $perl_patchlevel | sed 's/.* //'`
4172 version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel"
4176 $echo "(You have $package $version_patchlevel_string.)"
4180 : XXX Should be a Configure test for double-dots in filenames.
4181 version=`echo $revision $patchlevel $subversion | \
4182 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4183 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4184 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4187 version=`echo $revision $patchlevel $subversion | \
4188 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4189 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4190 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4193 : Special case the 5.005_xx maintenance series, which used 5.005
4194 : without any subversion label as a subdirectory in $sitelib
4195 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4196 api_versionstring='5.005'
4199 : Do we want threads support and if so, what type
4200 case "$usethreads" in
4201 $define|true|[yY]*) dflt='y';;
4202 *) # Catch case where user specified ithreads or 5005threads but
4203 # forgot -Dusethreads (A.D. 4/2002)
4204 case "$useithreads$use5005threads" in
4206 case "$useperlio" in
4207 "$define") dflt='y' ;;
4217 Perl can be built to take advantage of threads on some systems.
4218 To do so, Configure can be run with -Dusethreads.
4220 Note that Perl built with threading support runs slightly slower
4221 and uses more memory than plain Perl. The current implementation
4222 is believed to be stable, but it is fairly new, and so should be
4223 treated with caution.
4225 If this doesn't make any sense to you, just accept the default '$dflt'.
4227 rp='Build a threading Perl?'
4230 y|Y) val="$define" ;;
4236 if $test $patchlevel -lt 9; then
4237 case "$usethreads" in
4241 Since release 5.6, Perl has had two different threading implementations,
4242 the newer interpreter-based version (ithreads) with one interpreter per
4243 thread, and the older 5.005 version (5005threads).
4244 The 5005threads version is effectively unmaintained and will probably be
4245 removed in Perl 5.10, so there should be no need to build a Perl using it
4246 unless needed for backwards compatibility with some existing 5.005threads
4250 : Default to ithreads unless overridden on command line or with
4253 case "$use5005threads" in
4254 $define|true|[yY]*) dflt='n';;
4256 case "$useithreads" in
4257 $undef|false|[nN]*) dflt='n';;
4259 rp='Use the newer interpreter-based ithreads?'
4262 y|Y) val="$define" ;;
4267 : Now set use5005threads to the opposite value.
4268 case "$useithreads" in
4269 $define) val="$undef" ;;
4276 useithreads="$undef"
4277 use5005threads="$undef"
4281 case "$useithreads$use5005threads" in
4285 You cannot have both the ithreads and the 5.005 threads enabled
4286 at the same time. Disabling the 5.005 threads since they are
4287 much less stable than the ithreads.
4290 use5005threads="$undef"
4295 : perl-5.9.x and later
4297 if test X"$usethreads" = "X$define"; then
4298 case "$use5005threads" in
4302 5.005 threads has been removed for 5.10. Perl will be built using ithreads.
4309 use5005threads="$undef"
4310 useithreads="$usethreads"
4313 if test X"$usethreads" = "X$define" -a "X$useperlio" = "Xundef"; then
4316 *** To build with ithreads you must also use the PerlIO layer.
4317 *** Cannot continue, aborting.
4323 case "$d_oldpthreads" in
4324 '') : Configure tests would be welcome here. For now, assume undef.
4326 *) val="$d_oldpthreads" ;;
4332 : Look for a hint-file generated 'call-back-unit'. If the
4333 : user has specified that a threading perl is to be built,
4334 : we may need to set or change some other defaults.
4335 if $test -f usethreads.cbu; then
4336 echo "Your platform has some specific hints regarding threaded builds, using them..."
4339 case "$usethreads" in
4340 "$define"|true|[yY]*)
4342 (Your platform does not have any specific hints for threaded builds.
4343 Assuming POSIX threads, then.)
4349 : Check if multiplicity is required
4352 Perl can be built so that multiple Perl interpreters can coexist
4353 within the same Perl executable.
4356 case "$useithreads" in
4359 This multiple interpreter support is required for interpreter-based threads.
4363 *) case "$usemultiplicity" in
4364 $define|true|[yY]*) dflt='y';;
4368 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4369 rp='Build Perl for multiplicity?'
4372 y|Y) val="$define" ;;
4380 : Check if morebits is requested
4381 case "$usemorebits" in
4382 "$define"|true|[yY]*)
4383 use64bitint="$define"
4384 uselongdouble="$define"
4385 usemorebits="$define"
4387 *) usemorebits="$undef"
4391 : Determine the C compiler to be used
4397 rp="Use which C compiler?"
4401 : See whether they have no cc but they do have gcc
4403 if $test -f cc.cbu; then
4408 : make some quick guesses about what we are up against
4410 $echo $n "Hmm... $c"
4420 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
4421 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
4423 echo "Looks kind of like an OSF/1 system, but we'll see..."
4425 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4426 xxx=`./loc addbib blurfl $pth`
4427 if $test -f $xxx; then
4428 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4432 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4433 echo "Looks kind of like an extended USG system, but we'll see..."
4435 echo "Looks kind of like a USG system, but we'll see..."
4439 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4440 echo "Looks kind of like a BSD system, but we'll see..."
4444 echo "Looks kind of like a Version 7 system, but we'll see..."
4447 case "$eunicefix" in
4450 There is, however, a strange, musty smell in the air that reminds me of
4451 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4455 : it so happens the Eunice I know will not run shell scripts in Unix format
4459 echo "Congratulations. You aren't running Eunice."
4463 : Detect OS2. The p_ variable is set above in the Head.U unit.
4464 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4465 : semicolon as a patch separator
4470 I have the feeling something is not exactly right, however...don't tell me...
4471 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4472 (Or you may be running DOS with DJGPP.)
4477 if test -f /xenix; then
4478 echo "Actually, this looks more like a XENIX system..."
4483 echo "It's not Xenix..."
4488 if test -f /venix; then
4489 echo "Actually, this looks more like a VENIX system..."
4496 echo "Nor is it Venix..."
4499 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4500 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4503 : Check if we are using GNU gcc and what its version is
4505 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4509 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4511 printf("%s\n", __VERSION__);
4513 printf("%s\n", "1");
4519 if $cc -o try $ccflags $ldflags try.c; then
4520 gccversion=`$run ./try`
4521 case "$gccversion" in
4522 '') echo "You are not using GNU cc." ;;
4523 *) echo "You are using GNU cc $gccversion."
4529 echo "*** WHOA THERE!!! ***" >&4
4530 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4531 case "$knowitall" in
4533 echo " You'd better start hunting for one and let me know about it." >&4
4539 case "$gccversion" in
4540 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4542 case "$gccversion" in
4543 '') gccosandvers='' ;;
4544 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4545 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4547 case "$gccosandvers" in
4548 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4549 $osname$osvers) ;; # looking good
4550 $osname*) cat <<EOM >&4
4552 *** WHOA THERE!!! ***
4554 Your gcc has not been compiled for the exact release of
4555 your operating system ($gccosandvers versus $osname$osvers).
4557 In general it is a good idea to keep gcc synchronized with
4558 the operating system because otherwise serious problems
4559 may ensue when trying to compile software, like Perl.
4561 I'm trying to be optimistic here, though, and will continue.
4562 If later during the configuration and build icky compilation
4563 problems appear (headerfile conflicts being the most common
4564 manifestation), I suggest reinstalling the gcc to match
4565 your operating system release.
4569 *) gccosandvers='' ;; # failed to parse, better be silent
4577 # gcc 3.* complain about adding -Idirectories that they already know about,
4578 # so we will take those off from locincpth.
4579 case "$gccversion" in
4581 echo "main(){}">try.c
4582 for incdir in $locincpth; do
4583 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4584 grep '^c[cp]p*[01]: warning: changing search order '`
4585 if test "X$warn" != X; then
4586 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4592 : What should the include directory be ?
4594 $echo $n "Hmm... $c"
4598 if $test -f /bin/mips && /bin/mips; then
4599 echo "Looks like a MIPS system..."
4600 $cat >usr.c <<'EOCP'
4601 #ifdef SYSTYPE_BSD43
4605 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4606 dflt='/bsd43/usr/include'
4610 mips_type='System V'
4612 $rm -f usr.c usr.out
4613 echo "and you're compiling with the $mips_type compiler and libraries."
4617 echo "Doesn't look like a MIPS system."
4627 case "$xxx_prompt" in
4630 rp='Where are the include files you want to use?'
4638 : see how we invoke the C preprocessor
4640 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4641 cat <<'EOT' >testcpp.c
4647 if test ! -f cppstdin; then
4648 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4649 # AIX cc -E doesn't show the absolute headerfile
4650 # locations but we'll cheat by using the -M flag.
4651 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
4653 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4656 echo "Keeping your $hint cppstdin wrapper."
4659 wrapper=`pwd`/cppstdin
4663 if $test "X$cppstdin" != "X" && \
4664 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4665 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4667 echo "You used to use $cppstdin $cppminus so we'll use that again."
4669 '') echo "But let's see if we can live without a wrapper..." ;;
4671 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4672 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4674 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4677 echo "(However, $cpprun $cpplast does not work, let's see...)"
4685 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4692 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4693 $cc -E <testcpp.c >testcpp.out 2>&1; \
4694 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4695 echo "Yup, it does."
4698 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4699 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4700 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4701 echo "Yup, it does."
4704 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4705 $cc -P <testcpp.c >testcpp.out 2>&1; \
4706 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4707 echo "Yipee, that works!"
4710 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4711 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4712 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4713 echo "At long last!"
4716 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4717 $cpp <testcpp.c >testcpp.out 2>&1; \
4718 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4722 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4723 $cpp - <testcpp.c >testcpp.out 2>&1; \
4724 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4725 echo "Hooray, it works! I was beginning to wonder."
4728 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4729 $wrapper <testcpp.c >testcpp.out 2>&1; \
4730 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4736 rp="No dice. I can't find a C preprocessor. Name one:"
4740 $x_cpp <testcpp.c >testcpp.out 2>&1
4741 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4742 echo "OK, that will do." >&4
4744 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4759 echo "Perhaps can we force $cc -E using a wrapper..."
4760 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4761 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4767 echo "Nope, we'll have to live without it..."
4781 "$wrapper"|'cppstdin') ;;
4782 *) $rm -f $wrapper;;
4784 $rm -f testcpp.c testcpp.out
4786 : Set private lib path
4789 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4794 '') dlist="$loclibpth $plibpth $glibpth";;
4795 *) dlist="$libpth";;
4798 : Now check and see which directories actually exist, avoiding duplicates
4802 if $test -d $xxx; then
4805 *) libpth="$libpth $xxx";;
4811 Some systems have incompatible or broken versions of libraries. Among
4812 the directories listed in the question below, please remove any you
4813 know not to be holding relevant libraries, and add any that are needed.
4814 Say "none" for none.
4825 rp="Directories to use for library searches?"
4832 : compute shared library extension
4835 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4845 On some systems, shared libraries may be available. Answer 'none' if
4846 you want to suppress searching of shared libraries for the remainder
4847 of this configuration.
4850 rp='What is the file extension used for shared libraries?'
4854 : Define several unixisms.
4855 : Hints files or command line option can be used to override them.
4856 : The convoluted testing is in case hints files set either the old
4859 '') case "$exe_ext" in
4861 *) _exe="$exe_ext" ;;
4866 '') case "$lib_ext" in
4873 '') case "$obj_ext" in
4880 '') case "$path_sep" in
4891 rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
4893 : Which makefile gets called first. This is used by make depend.
4894 case "$firstmakefile" in
4895 '') firstmakefile='makefile';;
4898 : Check for uselongdouble support
4900 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
4903 case "$uselongdouble" in
4904 $define|true|[yY]*) dflt='y';;
4909 Perl can be built to take advantage of long doubles which
4910 (if available) may give more accuracy and range for floating point numbers.
4912 If this doesn't make any sense to you, just accept the default '$dflt'.
4914 rp='Try to use long doubles if available?'
4917 y|Y) val="$define" ;;
4923 case "$uselongdouble" in
4924 true|[yY]*) uselongdouble="$define" ;;
4927 : Look for a hint-file generated 'call-back-unit'. If the
4928 : user has specified that long doubles should be used,
4929 : we may need to set or change some other defaults.
4930 if $test -f uselongdouble.cbu; then
4931 echo "Your platform has some specific hints regarding long doubles, using them..."
4932 . ./uselongdouble.cbu
4934 case "$uselongdouble" in
4937 (Your platform does not have any specific hints for long doubles.)
4943 : Looking for optional libraries
4945 echo "Checking for optional libraries..." >&4
4950 case "$libswanted" in
4951 '') libswanted='c_s';;
4954 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4960 for thisdir in $libpth $xlibpth; do
4961 test -d $thisdir && libspath="$libspath $thisdir"
4963 for thislib in $libswanted; do
4964 for thisdir in $libspath; do
4966 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4967 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
4968 $test -f "$xxx" && eval $libscheck
4969 $test -f "$xxx" && libstyle=shared
4971 if test ! -f "$xxx"; then
4972 xxx=$thisdir/lib$thislib.$so
4973 $test -f "$xxx" && eval $libscheck
4974 $test -f "$xxx" && libstyle=shared
4976 if test ! -f "$xxx"; then
4977 xxx=$thisdir/lib$thislib$_a
4978 $test -f "$xxx" && eval $libscheck
4979 $test -f "$xxx" && libstyle=static
4981 if test ! -f "$xxx"; then
4982 xxx=$thisdir/$thislib$_a
4983 $test -f "$xxx" && eval $libscheck
4984 $test -f "$xxx" && libstyle=static
4986 if test ! -f "$xxx"; then
4987 xxx=$thisdir/lib${thislib}_s$_a
4988 $test -f "$xxx" && eval $libscheck
4989 $test -f "$xxx" && libstyle=static
4990 $test -f "$xxx" && thislib=${thislib}_s
4992 if test ! -f "$xxx"; then
4993 xxx=$thisdir/Slib$thislib$_a
4994 $test -f "$xxx" && eval $libscheck
4995 $test -f "$xxx" && libstyle=static
4997 if $test -f "$xxx"; then
4999 shared) echo "Found -l$thislib (shared)." ;;
5000 static) echo "Found -l$thislib." ;;
5001 *) echo "Found -l$thislib ($libstyle)." ;;
5005 *) dflt="$dflt -l$thislib"
5006 libsfound="$libsfound $xxx"
5008 libsfiles="$libsfiles $yyy"
5009 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
5010 case " $libsdirs " in
5012 *) libsdirs="$libsdirs $yyy" ;;
5019 if $test ! -f "$xxx"; then
5020 echo "No -l$thislib."
5031 ' '|'') dflt='none';;
5036 In order to compile $package on your machine, a number of libraries
5037 are usually needed. Include any other special libraries here as well.
5038 Say "none" for none. The default list is almost always right.
5042 rp="What libraries to use?"
5049 : determine optimization, if desired, or use for debug flag also
5051 ' '|$undef) dflt='none';;
5053 *) dflt="$optimize";;
5057 By default, $package compiles with the -O flag to use the optimizer.
5058 Alternately, you might want to use the symbolic debugger, which uses
5059 the -g flag (on traditional Unix systems). Either flag can be
5060 specified here. To use neither flag, specify the word "none".
5063 rp="What optimizer/debugger flag should be used?"
5067 'none') optimize=" ";;
5070 : Check what DEBUGGING is required from the command line
5071 : -DEBUGGING or -DDEBUGGING or
5072 : -DEBUGGING=both = -g + -DDEBUGGING
5073 : -DEBUGGING=-g or -Doptimize=-g = -g
5074 : -DEBUGGING=none or -UDEBUGGING =
5075 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
5078 *) DEBUGGING=$EBUGGING ;;
5081 case "$DEBUGGING" in
5085 *) optimize="$optimize -g" ;;
5089 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
5097 case "$DEBUGGING" in
5098 both|$define) dflt='-DDEBUGGING'
5101 : argument order is deliberate, as the flag will start with - which set could
5102 : think is an option
5103 checkccflag='check=$1; flag=$2; callback=$3;
5105 echo "Checking if your compiler accepts $flag" 2>&1;
5106 echo "int main(void) { return 0; }" > gcctest.c;
5107 if $cc -O2 $flag -o gcctest gcctest.c 2>gcctest.out && ./gcctest; then
5108 echo "Yes, it does." 2>&1;
5109 if $test -s gcctest.out ; then
5110 echo "But your platform does not like it:";
5115 echo "Leaving current flags $ccflags alone." 2>&1
5117 *) dflt="$dflt $flag";
5123 echo "Nope, it does not, but that is ok." 2>&1;
5127 : We will not override a previous value, but we might want to
5128 : augment a hint file
5130 default|recommended)
5131 case "$gccversion" in
5132 1*) dflt="$dflt -fpcc-struct-return" ;;
5134 case "$optimize:$DEBUGGING" in
5135 *-g*:old) dflt="$dflt -DDEBUGGING";;
5137 case "$gccversion" in
5138 2*) if $test -d /etc/conf/kconfig.d &&
5139 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
5141 # Interactive Systems (ISC) POSIX mode.
5146 case "$gccversion" in
5149 ?*) set strict-aliasing -fno-strict-aliasing
5153 # For gcc, adding -pipe speeds up compilations for some, but apparently
5154 # some assemblers can't read from stdin. (It also slows down compilations
5155 # in other cases, but those are apparently rarer these days.) AD 5/2004.
5156 case "$gccversion" in
5162 # on x86_64 (at least) we require an extra library (libssp) in the
5163 # link command line. This library is not named, so I infer that it is
5164 # an implementation detail that may change. Hence the safest approach
5165 # is to add the flag to the flags passed to the compiler at link time,
5166 # as that way the compiler can do the right implementation dependant
5168 case "$gccversion" in
5169 ?*) set stack-protector -fstack-protector
5176 case "$mips_type" in
5177 *BSD*|'') inclwanted="$locincpth $usrinc";;
5178 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
5180 for thisincl in $inclwanted; do
5181 if $test -d $thisincl; then
5182 if $test x$thisincl != x$usrinc; then
5184 *" -I$thisincl "*);;
5185 *) dflt="$dflt -I$thisincl ";;
5191 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
5193 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5201 *) dflt="$dflt -D$2";;
5205 set signal.h LANGUAGE_C; eval $inctest
5209 ccflags="$ccflags -DSOCKS"
5214 default|recommended) dflt="$ccflags $dflt" ;;
5215 *) dflt="$ccflags";;
5224 Your C compiler may want other flags. For this question you should include
5225 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5226 but you should NOT include libraries or ld flags like -lwhatever. If you
5227 want $package to honor its debug switch, you should include -DDEBUGGING here.
5228 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5230 To use no flags, specify the word "none".
5236 rp="Any additional cc flags?"
5243 : the following weeds options from ccflags that are of no interest to cpp
5245 '') cppflags="$ccflags" ;;
5246 *) cppflags="$cppflags $ccflags" ;;
5248 case "$gccversion" in
5249 1*) cppflags="$cppflags -D__GNUC__"
5251 case "$mips_type" in
5253 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5259 echo "Let me guess what the preprocessor flags are..." >&4
5273 *) ftry="$previous $flag";;
5275 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5276 >cpp1.out 2>/dev/null && \
5277 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5278 >cpp2.out 2>/dev/null && \
5279 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5280 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5282 cppflags="$cppflags $ftry"
5292 *-*) echo "They appear to be: $cppflags";;
5294 $rm -f cpp.c cpp?.out
5298 : flags used in final linking phase
5300 '') if ./venix; then
5306 *-posix*) dflt="$dflt -posix" ;;
5309 *) dflt="$ldflags";;
5311 # See note above about -fstack-protector
5313 *-fstack-protector*)
5315 *-fstack-protector*) ;; # Don't add it again
5316 *) dflt="$dflt -fstack-protector" ;;
5321 : Try to guess additional flags to pick up local libraries.
5322 for thislibdir in $libpth; do
5323 case " $loclibpth " in
5326 *"-L$thislibdir "*) ;;
5327 *) dflt="$dflt -L$thislibdir" ;;
5339 Your C linker may need flags. For this question you should
5340 include -L/whatever and any other flags used by the C linker, but you
5341 should NOT include libraries like -lwhatever.
5343 Make sure you include the appropriate -L/path flags if your C linker
5344 does not normally search all of the directories you specified above,
5347 To use no flags, specify the word "none".
5351 rp="Any additional ld flags (NOT including libraries)?"
5357 rmlist="$rmlist pdp11"
5361 echo "Checking your choice of C compiler and flags for coherency..." >&4
5362 $cat > try.c <<'EOF'
5364 int main() { printf("Ok\n"); return(0); }
5366 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5368 $cat >try.msg <<'EOM'
5369 I've tried to compile and run the following simple program:
5372 $cat try.c >> try.msg
5374 $cat >> try.msg <<EOM
5381 and I got the following output:
5385 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5386 if $sh -c "$run ./try " >>try.msg 2>&1; then
5390 *) echo 'The program compiled OK, but produced no output.' >> try.msg
5393 cat >> try.msg <<'EOQS'
5394 If $libs contains -lsfio, and sfio is mis-configured, then it
5395 sometimes (apparently) runs and exits with a 0 status, but with no
5396 output! It may have to do with sfio's use of _exit vs. exit.
5399 rp="You have a big problem. Shall I abort Configure"
5406 echo "The program compiled OK, but exited with status $?." >>try.msg
5407 rp="You have a problem. Shall I abort Configure"
5411 echo "I can't compile the test program." >>try.msg
5412 rp="You have a BIG problem. Shall I abort Configure"
5418 case "$knowitall" in
5420 echo "(The supplied flags or libraries might be incorrect.)"
5428 *) echo "Ok. Stopping Configure." >&4
5433 n) echo "OK, that should do.";;
5435 $rm_try gcctest gcctest.out
5437 : define a shorthand compile call
5441 case "$usedevel" in $define|true|[yY]*) if $test ! -f "${mc_file}.c"; then
5442 echo "Internal Configure script bug - compiler test file ${mc_file}.c is missing. Please report this to perlbug@perl.org" >&4;
5446 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5447 : define a shorthand compile call for compilations that should be ok.
5451 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5453 : determine filename position in cpp output
5455 echo "Computing filename position in cpp output for #include directives..." >&4
5457 vos) testaccess=-e ;;
5460 echo '#include <stdio.h>' > foo.c
5463 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5464 $grep '^[ ]*#.*stdio\.h' | \
5465 while read cline; do
5468 while $test \$# -gt 0; do
5469 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5474 pos=\`expr \$pos + 1\`
5486 *) pos="${fieldn}th";;
5488 echo "Your cpp writes the filename in the $pos field of the line."
5491 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
5492 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
5495 : locate header file
5500 for usrincdir in $usrinc
5502 if test -f \$usrincdir/\$wanted; then
5503 echo "\$usrincdir/\$wanted"
5507 awkprg='{ print \$$fieldn }'
5508 echo "#include <\$wanted>" > foo\$\$.c
5509 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5510 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5511 while read cline; do
5512 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5514 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5515 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5520 # status = 0: grep returned 0 lines, case statement not executed
5521 # status = 1: headerfile found
5522 # status = 2: while loop executed, no headerfile found
5526 if test \$status -eq 1; then
5533 : define an alternate in-header-list? function
5534 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5535 cont=true; xxf="echo \"<\$1> found.\" >&4";
5536 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5537 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5539 case $# in 4) instead=instead;; *) instead="at last";; esac;
5540 while $test "$cont"; do
5542 var=$2; eval "was=\$$2";
5543 if $test "$xxx" && $test -r "$xxx";
5545 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5548 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5549 set $yyy; shift; shift; yyy=$@;
5550 case $# in 0) cont="";;
5551 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5552 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5553 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5554 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5558 do set $yyy; var=$2; eval "was=\$$2";
5559 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5560 set $yyy; shift; shift; yyy=$@;
5563 : see if stdlib is available
5564 set stdlib.h i_stdlib
5567 : check for lengths of integral types
5571 echo "Checking to see how big your integers are..." >&4
5580 printf("intsize=%d;\n", (int)sizeof(int));
5581 printf("longsize=%d;\n", (int)sizeof(long));
5582 printf("shortsize=%d;\n", (int)sizeof(short));
5587 if eval $compile_ok && $run ./try > /dev/null; then
5589 echo "Your integers are $intsize bytes long."
5590 echo "Your long integers are $longsize bytes long."
5591 echo "Your short integers are $shortsize bytes long."
5595 Help! I can't compile and run the intsize test program: please enlighten me!
5596 (This is probably a misconfiguration in your system or libraries, and
5597 you really ought to fix it. Still, I'll try anyway.)
5601 rp="What is the size of an integer (in bytes)?"
5605 rp="What is the size of a long integer (in bytes)?"
5609 rp="What is the size of a short integer (in bytes)?"
5617 : check for long long
5619 echo "Checking to see if you have long long..." >&4
5620 echo 'int main() { long long x = 7; return 0; }' > try.c
5622 if eval $compile; then
5624 echo "You have long long."
5627 echo "You do not have long long."
5633 : check for length of long long
5634 case "${d_longlong}${longlongsize}" in
5637 echo "Checking to see how big your long longs are..." >&4
5638 $cat >try.c <<'EOCP'
5642 printf("%d\n", (int)sizeof(long long));
5647 if eval $compile_ok; then
5648 longlongsize=`$run ./try`
5649 echo "Your long longs are $longlongsize bytes long."
5653 echo "(I can't seem to compile the test program. Guessing...)"
5654 rp="What is the size of a long long (in bytes)?"
5658 if $test "X$longsize" = "X$longlongsize"; then
5659 echo "(That isn't any different from an ordinary long.)"
5665 : see if inttypes.h is available
5666 : we want a real compile instead of Inhdr because some systems
5667 : have an inttypes.h which includes non-existent headers
5670 #include <inttypes.h>
5672 static int32_t foo32 = 0x12345678;
5676 if eval $compile; then
5677 echo "<inttypes.h> found." >&4
5680 echo "<inttypes.h> NOT found." >&4
5689 echo "Checking to see if you have int64_t..." >&4
5691 #include <sys/types.h>
5692 #$i_inttypes I_INTTYPES
5694 #include <inttypes.h>
5696 int main() { int64_t x = 7; }
5699 if eval $compile; then
5701 echo "You have int64_t."
5704 echo "You do not have int64_t."
5710 : Check if 64bit ints have a quad type
5712 echo "Checking which 64-bit integer type we could use..." >&4
5718 val='"unsigned int"'
5723 *) case "$longsize" in
5727 val='"unsigned long"'
5732 *) case "$d_longlong:$longlongsize" in
5737 val='"unsigned long long"'
5742 *) case "$d_int64_t" in
5761 '') echo "Alas, no 64-bit integer types in sight." >&4
5764 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5769 : Do we want 64bit support
5770 case "$uselonglong" in
5771 "$define"|true|[yY]*)
5774 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5776 use64bitint="$define"
5779 case "$use64bits" in
5780 "$define"|true|[yY]*)
5783 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5785 use64bitint="$define"
5788 case "$use64bitints" in
5789 "$define"|true|[yY]*)
5792 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5794 use64bitint="$define"
5797 case "$use64bitsint" in
5798 "$define"|true|[yY]*)
5801 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5803 use64bitint="$define"
5806 case "$uselonglongs" in
5807 "$define"|true|[yY]*)
5810 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5812 use64bitint="$define"
5815 case "$use64bitsall" in
5816 "$define"|true|[yY]*)
5819 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
5821 use64bitall="$define"
5826 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
5828 case "$use64bitall" in
5829 "$define"|true|[yY]*) use64bitint="$define" ;;
5835 You have natively 64-bit long integers.
5839 *) case "$use64bitint" in
5840 "$define"|true|[yY]*) dflt='y';;
5849 Perl can be built to take advantage of 64-bit integer types
5850 on some systems. To do so, Configure can be run with -Duse64bitint.
5851 Choosing this option will most probably introduce binary incompatibilities.
5853 If this doesn't make any sense to you, just accept the default '$dflt'.
5854 (The default has been chosen based on your configuration.)
5856 rp='Try to use 64-bit integers, if available?'
5859 [yY]*) val="$define" ;;
5867 case "$use64bitall" in
5868 "$define"|true|[yY]*) dflt='y' ;;
5869 *) case "$longsize" in
5877 You may also choose to try maximal 64-bitness. It means using as much
5878 64-bitness as possible on the platform. This in turn means even more
5879 binary incompatibilities. On the other hand, your platform may not
5880 have any more 64-bitness available than what you already have chosen.
5882 If this doesn't make any sense to you, just accept the default '$dflt'.
5883 (The default has been chosen based on your configuration.)
5885 rp='Try to use maximal 64-bit support, if available?'
5888 [yY]*) val="$define" ;;
5893 case "$use64bitall" in
5895 case "$use64bitint" in
5899 Since you have chosen a maximally 64-bit build, I'm also turning on
5900 the use of 64-bit integers.
5902 use64bitint="$define" ;;
5907 : Look for a hint-file generated 'call-back-unit'. If the
5908 : user has specified that a 64-bit perl is to be built,
5909 : we may need to set or change some other defaults.
5910 if $test -f use64bitint.cbu; then
5911 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
5914 case "$use64bitint" in
5915 "$define"|true|[yY]*)
5917 4) case "$archname64" in
5918 '') archname64=64int ;;
5925 : Look for a hint-file generated 'call-back-unit'. If the
5926 : user has specified that a maximally 64-bit perl is to be built,
5927 : we may need to set or change some other defaults.
5928 if $test -f use64bitall.cbu; then
5929 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
5932 case "$use64bitall" in
5933 "$define"|true|[yY]*)
5935 4) case "$archname64" in
5936 ''|64int) archname64=64all ;;
5943 case "$d_quad:$use64bitint" in
5947 *** You have chosen to use 64-bit integers,
5948 *** but none can be found.
5949 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
5950 *** Cannot continue, aborting.
5957 : check for length of double
5959 case "$doublesize" in
5961 echo "Checking to see how big your double precision numbers are..." >&4
5970 printf("%d\n", (int)sizeof(double));
5975 if eval $compile_ok; then
5976 doublesize=`$run ./try`
5977 echo "Your double is $doublesize bytes long."
5980 echo "(I can't seem to compile the test program. Guessing...)"
5981 rp="What is the size of a double precision number (in bytes)?"
5989 : check for long doubles
5991 echo "Checking to see if you have long double..." >&4
5992 echo 'int main() { long double x = 7.0; }' > try.c
5994 if eval $compile; then
5996 echo "You have long double."
5999 echo "You do not have long double."
6005 : check for length of long double
6006 case "${d_longdbl}${longdblsize}" in
6009 echo "Checking to see how big your long doubles are..." >&4
6010 $cat >try.c <<'EOCP'
6014 printf("%d\n", sizeof(long double));
6019 if eval $compile; then
6020 longdblsize=`$run ./try`
6021 echo "Your long doubles are $longdblsize bytes long."
6025 echo "(I can't seem to compile the test program. Guessing...)" >&4
6026 rp="What is the size of a long double (in bytes)?"
6030 if $test "X$doublesize" = "X$longdblsize"; then
6031 echo "That isn't any different from an ordinary double."
6032 echo "I'll keep your setting anyway, but you may see some"
6033 echo "harmless compilation warnings."
6039 : determine the architecture name
6041 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
6042 tarch=`arch`"-$osname"
6043 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
6044 if uname -m > tmparch 2>&1 ; then
6045 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
6046 -e 's/$/'"-$osname/" tmparch`
6054 case "$myarchname" in
6057 echo "(Your architecture name used to be $myarchname.)"
6061 case "$targetarch" in
6063 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
6068 *) dflt="$archname";;
6070 rp='What is your architecture name'
6073 case "$usethreads" in
6075 echo "Threads selected." >&4
6077 *-thread*) echo "...and architecture name already has -thread." >&4
6079 *) archname="$archname-thread"
6080 echo "...setting architecture name to $archname." >&4
6085 case "$usemultiplicity" in
6087 echo "Multiplicity selected." >&4
6089 *-multi*) echo "...and architecture name already has -multi." >&4
6091 *) archname="$archname-multi"
6092 echo "...setting architecture name to $archname." >&4
6097 case "$use64bitint$use64bitall" in
6099 case "$archname64" in
6101 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
6104 case "$use64bitint" in
6105 "$define") echo "64 bit integers selected." >&4 ;;
6107 case "$use64bitall" in
6108 "$define") echo "Maximal 64 bitness selected." >&4 ;;
6111 *-$archname64*) echo "...and architecture name already has $archname64." >&4
6113 *) archname="$archname-$archname64"
6114 echo "...setting architecture name to $archname." >&4
6120 case "$uselongdouble" in
6122 echo "Long doubles selected." >&4
6123 case "$longdblsize" in
6125 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
6129 *-ld*) echo "...and architecture name already has -ld." >&4
6131 *) archname="$archname-ld"
6132 echo "...setting architecture name to $archname." >&4
6139 case "$useperlio" in
6141 echo "Perlio selected." >&4
6144 echo "Perlio not selected, using stdio." >&4
6146 *-stdio*) echo "...and architecture name already has -stdio." >&4
6148 *) archname="$archname-stdio"
6149 echo "...setting architecture name to $archname." >&4
6154 if $test -f archname.cbu; then
6155 echo "Your platform has some specific hints for architecture name, using them..."
6159 : set the prefixit variable, to compute a suitable default value
6160 prefixit='case "$3" in
6162 case "$oldprefix" in
6163 "") eval "$1=\"\$$2\"";;
6170 ""|" ") eval "$1=\"\$$2\"";;
6176 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
6178 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
6179 /*-$oldprefix/*|\~*-$oldprefix/*)
6180 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
6181 *) eval "$1=\"\$$2\"";;
6185 : determine installation style
6186 : For now, try to deduce it from prefix unless it is already set.
6187 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
6188 case "$installstyle" in
6189 '') case "$prefix" in
6190 *perl*) dflt='lib';;
6191 *) dflt='lib/perl5' ;;
6194 *) dflt="$installstyle" ;;
6196 : Probably not worth prompting for this since we prompt for all
6197 : the directories individually, and the prompt would be too long and
6201 : determine where public executables go
6206 rp='Pathname where the public executables will reside?'
6208 if $test "X$ansexp" != "X$binexp"; then
6212 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6213 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
6214 : this via initialinstalllocation
6217 case "$userelocatableinc" in
6218 $define|true|[yY]*) dflt='y' ;;
6223 Would you like to build Perl so that the installation is relocatable, so that
6224 library paths in @INC are determined relative to the path of the perl binary?
6225 This is not advised for system Perl installs, or if you need to run setid
6226 scripts or scripts under taint mode.
6228 If this doesn't make any sense to you, just accept the default '$dflt'.
6230 rp='Use relocatable @INC?'
6233 y|Y) val="$define" ;;
6236 set userelocatableinc
6239 initialinstalllocation="$binexp"
6240 : Default prefix is now "up one level from where the binaries are"
6241 case "$userelocatableinc" in
6247 installprefixexp=".../.."
6251 : determine where private library files go
6252 : Usual default is /usr/local/lib/perl5/$version.
6253 : Also allow things like /opt/perl/lib/$version, since
6254 : /opt/perl/lib/perl5... would be redundant.
6255 : The default "style" setting is made in installstyle.U
6256 case "$installstyle" in
6257 *lib/perl5*) set dflt privlib lib/$package/$version ;;
6258 *) set dflt privlib lib/$version ;;
6263 There are some auxiliary files for $package that need to be put into a
6264 private library directory that is accessible by everyone.
6269 rp='Pathname where the private library files will reside?'
6274 : set the prefixup variable, to restore leading tilda escape
6275 prefixup='case "$prefixexp" in
6277 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
6280 : determine where public architecture dependent libraries go
6283 : privlib default is /usr/local/lib/$package/$version
6284 : archlib default is /usr/local/lib/$package/$version/$archname
6285 : privlib may have an optional trailing /share.
6286 tdflt=`echo $privlib | $sed 's,/share$,,'`
6287 tdflt=$tdflt/$archname
6296 $spackage contains architecture-dependent library files. If you are
6297 sharing libraries in a heterogeneous environment, you might store
6298 these files in a separate location. Otherwise, you can just include
6299 them with the rest of the public library files.
6304 rp='Where do you want to put the public architecture-dependent libraries?'
6308 if $test X"$archlib" = X"$privlib"; then
6314 : see if setuid scripts can be secure
6317 Some kernels have a bug that prevents setuid #! scripts from being
6318 secure. Some sites have disabled setuid #! scripts because of this.
6320 First let's decide if your kernel supports secure setuid #! scripts.
6321 (If setuid #! scripts would be secure but have been disabled anyway,
6322 don't say that they are secure if asked.)
6327 if $test -d /dev/fd; then
6328 echo "#!$ls" >reflect
6329 chmod +x,u+s reflect
6330 ./reflect >flect 2>&1
6331 if $contains "/dev/fd" flect >/dev/null; then
6332 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6336 If you are not sure if they are secure, I can check but I'll need a
6337 username and password different from the one you are using right now.
6338 If you don't have such a username or don't want me to test, simply
6342 rp='Other username to test security of setuid scripts with?'
6347 case "$d_suidsafe" in
6348 '') echo "I'll assume setuid scripts are *not* secure." >&4
6351 echo "Well, the $hint value is *not* secure." >&4
6353 *) echo "Well, the $hint value *is* secure." >&4
6358 $rm -f reflect flect
6359 echo "#!$ls" >reflect
6360 chmod +x,u+s reflect
6363 echo '"su" will (probably) prompt you for '"$ans's password."
6364 su $ans -c './reflect >flect'
6365 if $contains "/dev/fd" flect >/dev/null; then
6366 echo "Okay, it looks like setuid scripts are secure." >&4
6369 echo "I don't think setuid scripts are secure." >&4
6374 rp='Does your kernel have *secure* setuid scripts?'
6377 [yY]*) val="$define";;
6382 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6383 echo "(That's for file descriptors, not floppy disks.)"
6389 $rm -f reflect flect
6391 : now see if they want to do setuid emulation
6392 if $test $patchlevel -lt 11; then
6395 case "$d_suidsafe" in
6398 echo "No need to emulate SUID scripts since they are secure here." >&4
6402 Some systems have disabled setuid scripts, especially systems where
6403 setuid scripts cannot be secure. On systems where setuid scripts have
6404 been disabled, the setuid/setgid bits on scripts are currently
6405 useless. It is possible for $package to detect those bits and emulate
6406 setuid/setgid in a secure fashion. This emulation will only work if
6407 setuid scripts have been disabled in your kernel.
6411 "$define") dflt=y ;;
6414 rp="Do you want to do setuid/setgid emulation?"
6417 [yY]*) val="$define";;
6429 SUID emulation has been removed for 5.12
6430 Please re-run Configure without -Dd_dosuid
6439 : Find perl5.005 or later.
6440 echo "Looking for a previously installed perl5.005 or later... "
6442 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
6443 : Check if this perl is recent and can load a simple module
6444 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6447 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6457 '') echo "None found. That's ok.";;
6458 *) echo "Using $perl5." ;;
6461 : Set the siteprefix variables
6464 After $package is installed, you may wish to install various
6465 add-on modules and utilities. Typically, these add-ons will
6466 be installed under $prefix with the rest
6467 of this package. However, you may wish to install such add-ons
6468 elsewhere under a different prefix.
6470 If you do not wish to put everything under a single prefix, that's
6471 ok. You will be prompted for the individual locations; this siteprefix
6472 is only used to suggest the defaults.
6474 The default should be fine for most people.
6478 rp='Installation prefix to use for add-on modules and utilities?'
6479 : XXX Here might be another good place for an installstyle setting.
6480 case "$siteprefix" in
6482 *) dflt=$siteprefix ;;
6485 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6487 case "$siteprefix" in
6491 *) oldsiteprefix="$prefix";;
6496 siteprefixexp="$ansexp"
6498 : determine where site specific libraries go.
6499 : Usual default is /usr/local/lib/perl5/site_perl/$version
6500 : The default "style" setting is made in installstyle.U
6501 : XXX No longer works with Prefixit stuff.
6502 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6504 '') case "$installstyle" in
6505 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6506 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6514 The installation process will create a directory for
6515 site-specific extensions and modules. Most users find it convenient
6516 to place all site-specific files in this directory rather than in the
6517 main distribution directory.
6521 rp='Pathname for the site-specific library files?'
6525 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6527 : Determine list of previous versions to include in @INC
6528 $cat > getverlist <<EOPL
6531 \$api_versionstring = "$api_versionstring";
6532 \$version = "$version";
6533 \$stem = "$sitelib_stem";
6534 \$archname = "$archname";
6536 $cat >> getverlist <<'EOPL'
6537 # The list found is store twice for each entry: the original name, and
6538 # the binary broken down version as pack "sss", so sorting is easy and
6539 # unambiguous. This will work for all versions that have a maximum of
6540 # three digit groups, separate by '.'s or '_'s. Names are extended with
6541 # ".0.0" to ensure at least three elements for the pack.
6542 # -- H.Merijn Brand (m)'06 23-10-2006
6544 # Can't have leading @ because metaconfig interprets it as a command!
6545 ;@inc_version_list=();
6546 # XXX Redo to do opendir/readdir?
6549 ;@candidates = map {
6550 [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
6551 ;@candidates = sort { $a->[1] cmp $b->[1]} @candidates;
6557 ($pversion, $aversion, $vsn5005) = map {
6558 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
6559 foreach $d (@candidates) {
6560 if ($d->[1] lt $pversion) {
6561 if ($d->[1] ge $aversion) {
6562 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
6564 elsif ($d->[1] ge $vsn5005) {
6565 unshift(@inc_version_list, grep { -d } $d->[0]);
6569 # Skip newer version. I.e. don't look in
6570 # 5.7.0 if we're installing 5.6.1.
6574 if (@inc_version_list) {
6575 print join(' ', @inc_version_list);
6578 # Blank space to preserve value for next Configure run.
6583 case "$inc_version_list" in
6584 '') if test -x "$perl5$exe_ext"; then
6585 dflt=`$perl5 getverlist`
6590 $undef) dflt='none' ;;
6591 *) eval dflt=\"$inc_version_list\" ;;
6594 ''|' ') dflt=none ;;
6601 In order to ease the process of upgrading, this version of perl
6602 can be configured to use modules built and installed with earlier
6603 versions of perl that were installed under $prefix. Specify here
6604 the list of earlier versions that this version of perl should check.
6605 If Configure detected no earlier versions of perl installed under
6606 $prefix, then the list will be empty. Answer 'none' to tell perl
6607 to not search earlier versions.
6609 The default should almost always be sensible, so if you're not sure,
6610 just accept the default.
6613 rp='List of earlier versions to include in @INC?'
6616 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
6617 *) inc_version_list="$ans" ;;
6619 case "$inc_version_list" in
6621 inc_version_list_init='0'
6622 d_inc_version_list="$undef"
6624 *) inc_version_list_init=`echo $inc_version_list |
6625 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6626 d_inc_version_list="$define"
6631 : see if malloc/malloc.h has to be included
6632 set malloc/malloc.h i_mallocmalloc
6635 : see if this is a malloc.h system
6636 : we want a real compile instead of Inhdr because some systems have a
6637 : malloc.h that just gives a compile error saying to use stdlib.h instead
6642 #$i_mallocmalloc I_MALLOCMALLOC
6643 #ifdef I_MALLOCMALLOC
6644 # include <malloc/malloc.h>
6647 int main () { return 0; }
6650 if eval $compile; then
6651 echo "<malloc.h> found." >&4
6654 echo "<malloc.h> NOT found." >&4
6661 : check for void type
6663 echo "Checking to see how well your C compiler groks the void type..." >&4
6664 case "$voidflags" in
6676 extern void moo(); /* function returning void */
6677 void (*goo)(); /* ptr to func returning void */
6679 void *hue; /* generic ptr */
6692 int main() { sub(); }
6694 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
6695 voidflags=$defvoidused
6696 echo "Good. It appears to support void to the level $package wants.">&4
6697 if $contains warning .out >/dev/null 2>&1; then
6698 echo "However, you might get some warnings that look like this:"
6702 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
6703 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
6704 echo "It supports 1..."
6705 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
6706 echo "It also supports 2..."
6707 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
6709 echo "And it supports 4 but not 8 definitely."
6711 echo "It doesn't support 4..."
6712 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
6714 echo "But it supports 8."
6717 echo "Neither does it support 8."
6721 echo "It does not support 2..."
6722 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
6724 echo "But it supports 4 and 8."
6726 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
6728 echo "And it supports 4 but has not heard about 8."
6730 echo "However it supports 8 but not 4."
6735 echo "There is no support at all for void."
6740 case "$voidflags" in
6743 Support flag bits are:
6744 1: basic void declarations.
6745 2: arrays of pointers to functions returning void.
6746 4: operations between pointers to and addresses of void functions.
6747 8: generic void pointers.
6750 rp="Your void support flags add up to what?"
6757 : check for length of pointer
6761 echo "Checking to see how big your pointers are..." >&4
6762 if test "$voidflags" -gt 7; then
6763 echo '#define VOID_PTR char *' > try.c
6765 echo '#define VOID_PTR void *' > try.c
6775 printf("%d\n", (int)sizeof(VOID_PTR));
6780 if eval $compile_ok; then
6781 ptrsize=`$run ./try`
6782 echo "Your pointers are $ptrsize bytes long."
6785 echo "(I can't seem to compile the test program. Guessing...)" >&4
6786 rp="What is the size of a pointer (in bytes)?"
6793 case "$use64bitall" in
6794 "$define"|true|[yY]*)
6798 *** You have chosen a maximally 64-bit build,
6799 *** but your pointers are only 4 bytes wide.
6800 *** Please rerun Configure without -Duse64bitall.
6805 *** Since you have quads, you could possibly try with -Duse64bitint.
6810 *** Cannot continue, aborting.
6821 : determine whether to use malloc wrapping
6823 case "$usemallocwrap" in
6824 [yY]*|true|$define) dflt='y' ;;
6825 [nN]*|false|$undef) dflt='n' ;;
6826 *) case "$usedevel" in
6827 [yY]*|true|$define) dflt='y' ;;
6832 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
6834 usemallocwrap="$ans"
6837 usemallocwrap="$define" ;;
6839 usemallocwrap="$undef" ;;
6842 : determine which malloc to compile in
6844 case "$usemymalloc" in
6845 [yY]*|true|$define) dflt='y' ;;
6846 [nN]*|false|$undef) dflt='n' ;;
6847 *) case "$ptrsize" in
6853 rp="Do you wish to attempt to use the malloc that comes with $package?"
6859 mallocsrc='malloc.c'
6860 mallocobj="malloc$_o"
6861 d_mymalloc="$define"
6864 : Remove malloc from list of libraries to use
6865 echo "Removing unneeded -lmalloc from library list" >&4
6866 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6869 echo "libs = $libs" >&4
6881 : compute the return types of malloc and free
6883 $cat >malloc.c <<END
6887 #include <sys/types.h>
6901 case "$malloctype" in
6903 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6910 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6914 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6921 echo "Your system uses $freetype free(), it would seem." >&4
6923 : determine where site specific architecture-dependent libraries go.
6924 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6925 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6926 : sitelib may have an optional trailing /share.
6928 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6929 dflt="$dflt/$archname"
6934 set sitearch sitearch none
6938 The installation process will also create a directory for
6939 architecture-dependent site-specific extensions and modules.
6943 rp='Pathname for the site-specific architecture-dependent library files?'
6947 if $test X"$sitearch" = X"$sitelib"; then
6950 d_sitearch="$define"
6953 : Set the vendorprefix variables
6956 The installation process will also create a directory for
6957 vendor-supplied add-ons. Vendors who supply perl with their system
6958 may find it convenient to place all vendor-supplied files in this
6959 directory rather than in the main distribution directory. This will
6960 ease upgrades between binary-compatible maintenance versions of perl.
6962 Of course you may also use these directories in whatever way you see
6963 fit. For example, you might use them to access modules shared over a
6964 company-wide network.
6966 The default answer should be fine for most people.
6967 This causes further questions about vendor add-ons to be skipped
6968 and no vendor-specific directories will be configured for perl.
6971 rp='Do you want to configure vendor-specific add-on directories?'
6972 case "$usevendorprefix" in
6973 define|true|[yY]*) dflt=y ;;
6974 *) : User may have set vendorprefix directly on Configure command line.
6975 case "$vendorprefix" in
6984 rp='Installation prefix to use for vendor-supplied add-ons?'
6985 case "$vendorprefix" in
6987 *) dflt=$vendorprefix ;;
6990 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6992 case "$vendorprefix" in
6996 *) oldvendorprefix="$prefix";;
7000 usevendorprefix="$define"
7002 vendorprefixexp="$ansexp"
7004 *) usevendorprefix="$undef"
7010 : Set the vendorlib variables
7011 case "$vendorprefix" in
7012 '') d_vendorlib="$undef"
7016 *) d_vendorlib="$define"
7017 : determine where vendor-supplied modules go.
7018 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
7019 case "$vendorlib" in
7021 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7022 case "$installstyle" in
7023 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
7024 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
7027 *) dflt="$vendorlib"
7031 rp='Pathname for the vendor-supplied library files?'
7034 vendorlibexp="$ansexp"
7037 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
7041 : Set the vendorarch variables
7042 case "$vendorprefix" in
7043 '') d_vendorarch="$undef"
7047 *) d_vendorarch="$define"
7048 : determine where vendor-supplied architecture-dependent libraries go.
7049 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
7050 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
7051 : vendorlib may have an optional trailing /share.
7052 case "$vendorarch" in
7053 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
7054 dflt="$dflt/$archname"
7056 *) dflt="$vendorarch" ;;
7059 rp='Pathname for vendor-supplied architecture-dependent files?'
7062 vendorarchexp="$ansexp"
7065 prefixvar=vendorarch
7067 if $test X"$vendorarch" = X"$vendorlib"; then
7068 d_vendorarch="$undef"
7070 d_vendorarch="$define"
7073 : Final catch-all directories to search
7076 Lastly, you can have perl look in other directories for extensions and
7077 modules in addition to those already specified.
7078 These directories will be searched after
7082 test X"$vendorlib" != "X" && echo ' ' $vendorlib
7083 test X"$vendorarch" != "X" && echo ' ' $vendorarch
7085 case "$otherlibdirs" in
7086 ''|' ') dflt='none' ;;
7087 *) dflt="$otherlibdirs" ;;
7090 Enter a colon-separated set of extra paths to include in perl's @INC
7091 search path, or enter 'none' for no extra paths.
7095 rp='Colon-separated list of additional directories for perl to search?'
7098 ' '|''|none) otherlibdirs=' ' ;;
7099 *) otherlibdirs="$ans" ;;
7101 case "$otherlibdirs" in
7105 set d_perl_otherlibdirs
7108 : Cruising for prototypes
7110 echo "Checking out function prototypes..." >&4
7111 $cat >prototype.c <<EOCP
7116 int main(int argc, char *argv[]) {
7119 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
7120 echo "Your C compiler appears to support function prototypes."
7123 echo "Your C compiler doesn't seem to understand function prototypes."
7130 : Check if ansi2knr is required
7131 case "$prototype" in
7133 *) ansi2knr='ansi2knr'
7138 This version of $package can only be compiled by a compiler that
7139 understands function prototypes. Unfortunately, your C compiler
7141 doesn't seem to understand them. Sorry about that.
7143 If GNU cc is available for your system, perhaps you could try that instead.
7145 Eventually, we hope to support building Perl with pre-ANSI compilers.
7146 If you would like to help in that effort, please contact <perlbug@perl.org>.
7148 Aborting Configure now.
7155 dflt_dtrace='/usr/sbin/dtrace'
7156 $test -x /usr/bin/dtrace && dflt_dtrace='/usr/bin/dtrace'
7160 Perl can be built to support DTrace on platforms that support it.
7161 DTrace is a diagnosis and performance analysis tool from Sun.
7163 If this doesn't make any sense to you, just accept the default '$dflt'.
7167 case "$usedtrace" in
7173 dflt_dtrace=$usedtrace
7180 rp='Support DTrace if available?'
7183 y|Y) val="$define" ;;
7189 test "X$usedtrace" != "X$define" && break
7192 rp='Where is the dtrace executable?'
7201 if $dtrace -h -s ../perldtrace.d \
7202 -o perldtrace.tmp >/dev/null 2>&1 \
7203 && rm -f perldtrace.tmp
7206 echo "Good: your $dtrace knows about the -h flag."
7210 *** $me: Fatal Error: $dtrace doesn't support -h flag
7212 *** Your installed dtrace doesn't support the -h switch to compile a D
7213 *** program into a C header. Can't continue.
7225 *** $me: Fatal Error: $dtrace not found.
7232 echo "*** $dtrace was not found."
7238 : See if we want extra modules installed
7245 Perl can be built with extra modules or bundles of modules which
7246 will be fetched from the CPAN and installed alongside Perl.
7248 Notice that you will need access to the CPAN; either via the Internet,
7249 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
7250 be asked later to configure the CPAN.pm module which will in turn do
7251 the installation of the rest of the extra modules or bundles.)
7253 Notice also that if the modules require any external software such as
7254 libraries and headers (the libz library and the zlib.h header for the
7255 Compress::Zlib module, for example) you MUST have any such software
7256 already installed, this configuration process will NOT install such
7259 If this doesn't make any sense to you, just accept the default '$dflt'.
7261 rp='Install any extra modules (y or n)?'
7267 Please list any extra modules or bundles to be installed from CPAN,
7268 with spaces between the names. The names can be in any format the
7269 'install' command of CPAN.pm will understand. (Answer 'none',
7270 without the quotes, to install no extra modules or bundles.)
7280 $rm -f ../extras.lst
7282 *) echo "(Saving the list of extras for later...)"
7283 echo "$extras" > ../extras.lst
7291 : determine where html pages for programs go
7292 set html1dir html1dir none
7296 If you wish to install html files for programs in $spackage, indicate
7297 the appropriate directory here. To skip installing html files,
7301 ''|none|$undef|' ') dflt=none ;;
7302 *) dflt=$html1dir ;;
7305 rp="Directory for the main $spackage html pages?"
7309 : Use ' ' for none so value is preserved next time through Configure
7310 $test X"$html1dir" = "X" && html1dir=' '
7312 : determine where html pages for libraries and modules go
7313 set html3dir html3dir none
7317 If you wish to install html files for modules associated with $spackage,
7318 indicate the appropriate directory here. To skip installing html files,
7321 : There is no obvious default. If they have specified html1dir, then
7322 : try to key off that, possibly changing .../html1 into .../html3.
7324 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
7325 *) dflt=$html3dir ;;
7328 rp="Directory for the $spackage module html pages?"
7332 : Use ' ' for none so value is preserved next time through Configure
7333 $test X"$html3dir" = "X" && html3dir=' '
7335 : determine whether to install perl also as /usr/bin/perl
7338 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
7340 Many scripts expect perl to be installed as /usr/bin/perl.
7342 If you want to, I can install the perl you are about to compile
7343 as /usr/bin/perl (in addition to $bin/perl).
7345 if test -f /usr/bin/perl; then
7348 However, please note that because you already have a /usr/bin/perl,
7349 overwriting that with a new Perl would very probably cause problems.
7350 Therefore I'm assuming you don't want to do that (unless you insist).
7353 case "$installusrbinperl" in
7354 "$define"|[yY]*) dflt='y';;
7360 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
7363 case "$installusrbinperl" in
7364 "$undef"|[nN]*) dflt='n';;
7368 rp="Do you want to install perl as /usr/bin/perl?"
7371 [yY]*) val="$define";;
7377 set installusrbinperl
7380 : Check if we are using the GNU C library
7382 echo "Checking for GNU C Library..." >&4
7384 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
7385 alone are insufficient to distinguish different versions, such as
7386 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
7387 libc version 2.1.0. A. Dougherty, June 3, 2002.
7393 # ifdef __GLIBC_MINOR__
7394 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
7395 # include <gnu/libc-version.h>
7396 printf("%s\n", gnu_get_libc_version());
7398 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
7401 printf("%d\n", __GLIBC__);
7410 if eval $compile_ok && $run ./try > glibc.ver; then
7412 gnulibc_version=`$cat glibc.ver`
7413 echo "You are using the GNU C Library version $gnulibc_version"
7417 echo "You are not using the GNU C Library"
7423 : see if nm is to be used to determine whether a symbol is defined or not
7427 case "$d_gnulibc" in
7430 echo "nm probably won't work on the GNU C Library." >&4
7436 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
7438 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
7439 echo "'nm' won't be sufficient on this sytem." >&4
7445 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
7446 if $test $dflt -gt 20; then
7456 true|$define) dflt=y;;
7463 I can use $nm to extract the symbols from your C libraries. This
7464 is a time consuming task which may generate huge output on the disk (up
7465 to 3 megabytes) but that should make the symbols extraction faster. The
7466 alternative is to skip the 'nm' extraction part and to compile a small
7467 test program instead to determine whether each symbol is present. If
7468 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
7469 this may be the best solution.
7471 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
7474 rp="Shall I use $nm to extract C symbols from the libraries?"
7477 [Nn]*) usenm=false;;
7486 : nm options which may be necessary
7488 '') if $test -f /mach_boot; then
7490 elif $test -d /usr/ccs/lib; then
7491 nm_opt='-p' # Solaris (and SunOS?)
7492 elif $test -f /dgux; then
7494 elif $test -f /lib64/rld; then
7495 nm_opt='-p' # 64-bit Irix
7501 : nm options which may be necessary for shared libraries but illegal
7502 : for archive libraries. Thank you, Linux.
7503 case "$nm_so_opt" in
7504 '') case "$myuname" in
7506 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
7507 nm_so_opt='--dynamic'
7514 : Figure out where the libc is located
7517 : get list of predefined functions in a handy place
7522 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
7528 *) for thislib in $libs; do
7531 : Handle C library specially below.
7534 thislib=`echo $thislib | $sed -e 's/^-l//'`
7535 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
7537 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
7539 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
7541 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
7543 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
7545 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
7547 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
7552 libnames="$libnames $try"
7554 *) libnames="$libnames $thislib" ;;
7563 for xxx in $libpth; do
7564 $test -r $1 || set $xxx/libc.$so
7565 : The messy sed command sorts on library version numbers.
7567 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
7568 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
7570 s/[0-9][0-9]*/0000&/g
7571 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
7574 $sort | $sed -e 's/^.* //'`
7577 $test -r $1 || set /usr/ccs/lib/libc.$so
7578 $test -r $1 || set /lib/libsys_s$_a
7584 if $test -r "$1"; then
7585 echo "Your (shared) C library seems to be in $1."
7587 elif $test -r /lib/libc && $test -r /lib/clib; then
7588 echo "Your C library seems to be in both /lib/clib and /lib/libc."
7590 libc='/lib/clib /lib/libc'
7591 if $test -r /lib/syslib; then
7592 echo "(Your math library is in /lib/syslib.)"
7593 libc="$libc /lib/syslib"
7595 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7596 echo "Your C library seems to be in $libc, as you said before."
7597 elif $test -r $incpath/usr/lib/libc$_a; then
7598 libc=$incpath/usr/lib/libc$_a;
7599 echo "Your C library seems to be in $libc. That's fine."
7600 elif $test -r /lib/libc$_a; then
7602 echo "Your C library seems to be in $libc. You're normal."
7604 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
7606 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
7607 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
7608 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
7610 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7612 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7615 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
7617 if $test -r "$tans"; then
7618 echo "Your C library seems to be in $tans, of all places."
7624 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7628 If the guess above is wrong (which it might be if you're using a strange
7629 compiler, or your machine supports multiple models), you can override it here.
7634 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
7636 I can't seem to find your C library. I've looked in the following places:
7639 $sed 's/^/ /' libpath
7642 None of these seems to contain your C library. I need to get its name...
7647 rp='Where is your C library?'
7652 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
7653 set X `cat libnames`
7656 case $# in 1) xxx=file; esac
7657 echo "Extracting names from the following $xxx for later perusal:" >&4
7659 $sed 's/^/ /' libnames >&4
7661 $echo $n "This may take a while...$c" >&4
7665 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
7666 *) $nm $nm_opt $file 2>/dev/null;;
7671 $grep fprintf libc.tmp > libc.ptf
7672 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
7673 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
7675 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
7677 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7679 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
7681 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7683 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
7685 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7687 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
7689 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7691 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
7693 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7695 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
7697 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7699 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
7700 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
7702 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7704 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
7706 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7708 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
7710 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7712 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
7714 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7716 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
7718 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7720 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
7722 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7724 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
7726 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7728 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
7730 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7733 $nm -p $* 2>/dev/null >libc.tmp
7734 $grep fprintf libc.tmp > libc.ptf
7735 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
7736 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
7742 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
7744 if $ar t $libc > libc.tmp && \
7745 $contains '^fprintf$' libc.tmp >/dev/null 2>&1
7747 for thisname in $libnames $libc; do
7748 $ar t $thisname >>libc.tmp
7750 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
7752 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
7753 for thisname in $libnames $libc; do
7754 $ar tv $thisname >>libc.tmp
7755 emximp -o tmp.imp $thisname \
7757 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
7758 < tmp.imp >>libc.tmp
7761 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
7764 echo "$ar didn't seem to work right." >&4
7765 echo "Maybe this is a Cray...trying bld instead..." >&4
7767 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list &&
7770 for thisname in $libnames; do
7772 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
7773 $ar t $thisname >>libc.tmp
7777 echo "That didn't work either. Giving up." >&4
7787 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
7788 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
7790 *) if $test -f /lib/syscalls.exp; then
7792 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
7793 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' \
7794 /lib/syscalls.exp >>libc.list
7800 $rm -f libnames libpath
7802 : see if dld is available
7806 : Check if we are using C++
7808 echo "Checking for C++..." >&4
7809 $cat >try.c <<'EOCP'
7821 if eval $compile_ok && $run ./try; then
7823 echo "You are using a C++ compiler."
7826 echo "You are not using a C++ compiler."
7832 : is a C symbol defined?
7835 -v) tf=libc.tmp; tdc="";;
7836 -a) tf=libc.tmp; tdc="[]";;
7837 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
7839 case "$d_cplusplus" in
7840 $define) extern_C="extern \"C\"" ;;
7841 *) extern_C="extern" ;;
7844 case "$reuseval-$4" in
7846 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
7851 if $test "$runnm" = true; then
7852 if $contains $tlook $tf >/dev/null 2>&1; then
7854 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
7855 echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7856 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
7857 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
7861 echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7862 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
7868 $define) tval=true;;
7875 : define an is-in-libc? function
7876 inlibc='echo " "; td=$define; tu=$undef;
7877 sym=$1; var=$2; eval "was=\$$2";
7879 case "$reuseval$was" in
7889 echo "$sym() found." >&4;
7890 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
7892 echo "$sym() NOT found." >&4;
7893 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
7897 $define) echo "$sym() found." >&4;;
7898 *) echo "$sym() NOT found." >&4;;
7902 : see if dlopen exists
7904 xxx_ccflags="$ccflags"
7906 : with g++ one needs -shared to get is-in-libc to work for dlopen
7907 case "$gccversion" in
7909 *) case "$d_cplusplus" in
7910 "$define") ccflags="$ccflags -shared" ;;
7917 ccflags="$xxx_ccflags"
7919 : see if this is a unistd.h system
7920 set unistd.h i_unistd
7923 : determine which dynamic loading, if any, to compile in
7925 dldir="ext/DynaLoader"
7938 $define) dflt='y' ;;
7941 $define) dflt='y' ;;
7943 : Does a dl_xxx.xs file exist for this operating system
7944 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
7947 rp="Do you wish to use dynamic loading?"
7955 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
7956 dflt="$dldir/dl_${osname}.xs"
7957 elif $test "$d_dlopen" = "$define" ; then
7958 dflt="$dldir/dl_dlopen.xs"
7959 elif $test "$i_dld" = "$define" ; then
7960 dflt="$dldir/dl_dld.xs"
7965 *) dflt="$dldir/$dlsrc"
7968 echo "The following dynamic loading files are available:"
7969 : Can not go over to $dldir because getfile has path hard-coded in.
7970 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
7971 rp="Source file to use for dynamic loading"
7977 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
7981 Some systems may require passing special flags to $cc -c to
7982 compile modules that will be used to create a shared library.
7983 To use no flags, say "none".
7986 case "$cccdlflags" in
7987 '') case "$gccversion" in
7988 '') case "$osname" in
7990 next) dflt='none' ;;
7991 irix*) dflt='-KPIC' ;;
7992 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
7993 sunos) dflt='-pic' ;;
7997 *) case "$osname" in
7998 darwin) dflt='none' ;;
7999 linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
8004 *) dflt="$cccdlflags" ;;
8006 rp="Any special flags to pass to $cc -c to compile shared library modules?"
8009 none) cccdlflags=' ' ;;
8010 *) cccdlflags="$ans" ;;
8015 Some systems use ld to create libraries that can be dynamically loaded,
8016 while other systems (such as those using ELF) use $cc.
8020 '') $cat >try.c <<EOM
8021 /* Test for whether ELF binaries are produced */
8033 int i = open("a.out",O_RDONLY);
8036 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
8037 exit(0); /* succeed (yes, it's ELF) */
8042 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
8044 You appear to have ELF support. I'll use $cc to build dynamic libraries.
8049 echo "I'll use ld to build dynamic libraries."
8058 rp="What command should be used to create dynamic libraries?"
8064 Some systems may require passing special flags to $ld to create a
8065 library that can be dynamically loaded. If your ld flags include
8066 -L/other/path options to locate libraries outside your loader's normal
8067 search path, you may need to specify those -L options here as well. To
8068 use no flags, say "none".
8071 case "$lddlflags" in
8072 '') case "$osname" in
8073 beos) dflt='-nostart' ;;
8074 haiku) dflt='-shared' ;;
8076 case "$gccversion" in
8077 '') dflt="$dflt +vnocompatwarnings" ;;
8080 linux|irix*|gnu*) dflt="-shared $optimize" ;;
8081 next) dflt='none' ;;
8082 solaris) dflt='-G' ;;
8083 sunos) dflt='-assert nodefinitions' ;;
8084 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
8088 *) dflt="$lddlflags" ;;
8091 : Try to guess additional flags to pick up local libraries.
8092 : Be careful not to append to a plain 'none'
8096 for thisflag in $ldflags; do
8101 *) dflt="$dflt $thisflag" ;;
8108 ''|' ') dflt='none' ;;
8112 *-fstack-protector*)
8114 *-fstack-protector*) ;; # Don't add it again
8115 *) dflt="$dflt -fstack-protector" ;;
8121 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
8124 none) lddlflags=' ' ;;
8125 *) lddlflags="$ans" ;;
8130 Some systems may require passing special flags to $cc to indicate that
8131 the resulting executable will use dynamic linking. To use no flags,
8135 case "$ccdlflags" in
8136 '') case "$osname" in
8137 linux|hpux|gnu*) dflt='-Wl,-E' ;;
8138 next|sunos) dflt='none' ;;
8142 *) dflt="$ccdlflags" ;;
8144 rp="Any special flags to pass to $cc to use dynamic linking?"
8147 none) ccdlflags=' ' ;;
8148 *) ccdlflags="$ans" ;;
8159 : Do we want a shared libperl?
8163 # No dynamic loading being used, so don't bother even to prompt.
8166 *) case "$useshrplib" in
8167 '') case "$osname" in
8168 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|haiku|cygwin*)
8170 also='Building a shared libperl is required for dynamic loading to work on your system.'
8175 also='Building a shared libperl is needed for MAB support.'
8193 The perl executable is normally obtained by linking perlmain.c with
8194 libperl${_a}, any static extensions (usually just DynaLoader), and
8195 any other libraries needed on this system (such as -lm, etc.). Since
8196 your system supports dynamic loading, it is probably possible to build
8197 a shared libperl.$so. If you will have more than one executable linked
8198 to libperl.$so, this will significantly reduce the size of each
8199 executable, but it may have a noticeable effect on performance. The
8200 default is probably sensible for your system.
8204 rp="Build a shared libperl.$so (y/n)"
8208 useshrplib='true' ;;
8209 *) useshrplib='false' ;;
8214 case "$useshrplib" in
8216 case "$userelocatableinc" in
8218 echo "Cannot build with both -Duserelocatableinc and -Duseshrplib" >&4
8219 echo "See INSTALL for an explanation why that won't work." >&4
8225 # Figure out a good name for libperl.so. Since it gets stored in
8226 # a version-specific architecture-dependent library, the version
8227 # number isn't really that important, except for making cc/ld happy.
8229 # A name such as libperl.so.10.1
8230 majmin="libperl.$so.$patchlevel.$subversion"
8231 # A name such as libperl.so.100
8232 majonly=`echo $patchlevel $subversion |
8233 $awk '{printf "%d%02d", $1, $2}'`
8234 majonly=libperl.$so.$majonly
8235 # I'd prefer to keep the os-specific stuff here to a minimum, and
8236 # rely on figuring it out from the naming of libc.
8237 case "${osname}${osvers}" in
8240 # XXX How handle the --version stuff for MAB?
8242 linux*|gnu*) # ld won't link with a bare -lperl otherwise.
8245 cygwin*) # ld links now against the dll directly
8246 majmin="cygperl5_${patchlevel}_${subversion}.${so}"
8247 majonly=`echo $patchlevel $subversion |
8248 $awk '{printf "%03d%03d", $1, $2}'`
8249 majonly=cygperl5.$majonly.$so
8252 *) # Try to guess based on whether libc has major.minor.
8254 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8255 *libc.$so.[0-9]*) dflt=$majonly ;;
8256 *) dflt=libperl.$so ;;
8266 I need to select a good name for the shared libperl. If your system uses
8267 library names with major and minor numbers, then you might want something
8268 like $majmin. Alternatively, if your system uses a single version
8269 number for shared libraries, then you might want to use $majonly.
8270 Or, your system might be quite happy with a simple libperl.$so.
8272 Since the shared libperl will get installed into a version-specific
8273 architecture-dependent directory, the version number of the shared perl
8274 library probably isn't important, so the default should be o.k.
8277 rp='What name do you want to give to the shared libperl?'
8280 echo "Ok, I'll use $libperl"
8283 libperl="libperl${_a}"
8287 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8291 WARNING: Use of the shrpdir variable for the installation location of
8292 the shared $libperl is not supported. It was never documented and
8293 will not work in this version. Let me (perlbug@perl.org)
8294 know of any problems this may cause.
8300 But your current setting of $shrpdir is
8301 the default anyway, so it's harmless.
8306 Further, your current attempted setting of $shrpdir
8307 conflicts with the value of $archlibexp/CORE
8308 that installperl will use.
8315 # How will the perl executable find the installed shared $libperl?
8316 # Add $xxx to ccdlflags.
8317 # If we can't figure out a command-line option, use $shrpenv to
8318 # set env LD_RUN_PATH. The main perl makefile uses this.
8319 shrpdir=$archlibexp/CORE
8322 if "$useshrplib"; then
8325 # We'll set it in Makefile.SH...
8330 freebsd|netbsd|openbsd|interix|dragonfly)
8331 xxx="-Wl,-R$shrpdir"
8333 bsdos|linux|irix*|dec_osf|gnu*)
8334 xxx="-Wl,-rpath,$shrpdir"
8337 # next doesn't like the default...
8340 # beos doesn't like the default, either.
8343 # Haiku doesn't like the default, either.
8346 # hpux doesn't like the default, either.
8347 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8350 # cygwin needs only ldlibpth
8353 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8359 # Only add $xxx if it isn't already in ccdlflags.
8360 case " $ccdlflags " in
8362 *) ccdlflags="$ccdlflags $xxx"
8365 Adding $xxx to the flags
8366 passed to $ld so that the perl executable will find the
8367 installed shared $libperl.
8375 # Fix ccdlflags in AIX for building external extensions.
8376 # (For building Perl itself bare -bE:perl.exp is needed,
8377 # Makefile.SH takes care of this.)
8379 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8381 # Respect a hint or command-line value.
8383 '') shrpenv="$tmp_shrpenv" ;;
8385 case "$ldlibpthname" in
8386 '') ldlibpthname=LD_LIBRARY_PATH ;;
8387 none) ldlibpthname='' ;;
8390 : determine where manual pages are on this system
8394 syspath='/usr/share/man/man1 /usr/man/man1'
8395 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8396 syspath="$syspath /usr/man/u_man/man1"
8397 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8398 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8399 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8400 sysman=`./loc . /usr/man/man1 $syspath`
8403 if $test -d "$sysman"; then
8404 echo "System manual is in $sysman." >&4
8406 echo "Could not find manual pages in source form." >&4
8409 : determine where manual pages go
8410 set man1dir man1dir none
8414 $spackage has manual pages available in source form.
8418 echo "However, you don't have nroff, so they're probably useless to you."
8420 '') man1dir="none";;
8423 echo "If you don't want the manual sources installed, answer 'none'."
8428 lookpath="$prefixexp/share/man/man1"
8429 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8430 lookpath="$lookpath $prefixexp/man/p_man/man1"
8431 lookpath="$lookpath $prefixexp/man/u_man/man1"
8432 lookpath="$lookpath $prefixexp/man/man.1"
8434 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8435 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8445 rp="Where do the main $spackage manual pages (source) go?"
8447 if $test "X$man1direxp" != "X$ansexp"; then
8458 : What suffix to use on installed man pages
8465 rp="What suffix should be used for the main $spackage man pages?"
8467 '') case "$man1dir" in
8481 *) dflt="$man1ext";;
8488 : see if we can have long filenames
8490 first=123456789abcdef
8492 if (echo hi >$first) 2>/dev/null; then
8493 if $test -f 123456789abcde; then
8494 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8497 echo 'You can have filenames longer than 14 characters.'>&4
8502 You can't have filenames longer than 14 chars.
8503 You can't even think about them!
8509 $rm -rf 123456789abcde*
8511 : determine where library module manual pages go
8512 set man3dir man3dir none
8516 $spackage has manual pages for many of the library modules.
8522 However, you don't have nroff, so they're probably useless to you.
8525 '') man3dir="none";;
8529 case "$d_flexfnam" in
8532 However, your system can't handle the long file names like File::Basename.3.
8535 '') man3dir="none";;
8539 echo "If you don't want the manual sources installed, answer 'none'."
8540 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8542 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8543 if $test -d "$privlib/man/man3"; then
8546 WARNING: Previous versions of perl installed man3 pages into
8547 $privlib/man/man3. This version will suggest a
8548 new default of $dflt.
8552 rp='Do you wish to preserve the old behavior?(y/n)'
8555 y*) dflt="$privlib/man/man3" ;;
8560 *) dflt="$man3dir" ;;
8567 rp="Where do the $package library man pages (source) go?"
8577 : What suffix to use on installed man pages
8583 rp="What suffix should be used for the $package library man pages?"
8585 '') case "$man3dir" in
8599 *) dflt="$man3ext";;
8606 : see if we have to deal with yellow pages, now NIS.
8607 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8608 if $test -f /usr/etc/nibindd; then
8610 echo "I'm fairly confident you're on a NeXT."
8612 rp='Do you get the hosts file via NetInfo?'
8621 y*) hostcat='nidump hosts .';;
8622 *) case "$hostcat" in
8623 nidump*) hostcat='';;
8633 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8641 rp='Are you getting the hosts file via yellow pages?'
8644 y*) hostcat='ypcat hosts';;
8645 *) hostcat='cat /etc/hosts';;
8651 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8654 '') test -f /etc/group && groupcat='cat /etc/group';;
8657 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8660 : now get the host name
8662 echo "Figuring out host name..." >&4
8663 case "$myhostname" in
8665 echo 'Maybe "hostname" will work...'
8666 if tans=`sh -c hostname 2>&1` ; then
8674 if $test "$cont"; then
8676 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8677 if tans=`cat /etc/systemid 2>&1` ; then
8679 phostname='cat /etc/systemid'
8680 echo "Whadyaknow. Xenix always was a bit strange..."
8683 elif $test -r /etc/systemid; then
8684 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8687 if $test "$cont"; then
8688 echo 'No, maybe "uuname -l" will work...'
8689 if tans=`sh -c 'uuname -l' 2>&1` ; then
8691 phostname='uuname -l'
8693 echo 'Strange. Maybe "uname -n" will work...'
8694 if tans=`sh -c 'uname -n' 2>&1` ; then
8696 phostname='uname -n'
8698 echo 'Oh well, maybe I can mine it out of whoami.h...'
8699 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8700 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8701 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8703 case "$myhostname" in
8704 '') echo "Does this machine have an identity crisis or something?"
8707 echo "Well, you said $myhostname before..."
8708 phostname='echo $myhostname';;
8714 case "$myhostname" in
8715 '') myhostname=noname ;;
8717 : you do not want to know about this
8722 if $test "$myhostname" ; then
8724 rp='Your host name appears to be "'$myhostname'".'" Right?"
8732 : bad guess or no guess
8733 while $test "X$myhostname" = X ; do
8735 rp="Please type the (one word) name of your host:"
8740 : translate upper to lower if necessary
8741 case "$myhostname" in
8743 echo "(Normalizing case in your host name)"
8744 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8748 case "$myhostname" in
8750 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8751 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8752 echo "(Trimming domain name from host name--host name is now $myhostname)"
8754 *) case "$mydomain" in
8757 test "X$hostcat" = "Xypcat hosts" &&
8758 ypmatch "$myhostname" hosts 2>/dev/null |\
8759 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8762 test "X$hostcat" != "X" &&
8763 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8764 /[ ]$myhostname[ . ]/p" > hosts
8767 if $test -f hosts; then
8768 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8769 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8770 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8771 hosts | $sort | $uniq | \
8772 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8773 case `$echo X$dflt` in
8774 X*\ *) echo "(Several hosts in the database matched hostname)"
8777 X.) echo "(You do not have fully-qualified names in the hosts database)"
8781 echo "(I cannot locate a hosts database anywhere)"
8786 tans=`./loc resolv.conf X /etc /usr/etc`
8787 if $test -f "$tans"; then
8788 echo "(Attempting domain name extraction from $tans)"
8789 dflt=.`$sed -n -e 's/ / /g' \
8790 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8793 .) dflt=.`$sed -n -e 's/ / /g' \
8794 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8802 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8803 dflt=.`sh -c domainname 2>/dev/null`
8806 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8810 case "$dflt$osname" in
8811 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
8812 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
8816 .) echo "(Lost all hope -- silly guess then)"
8822 *) dflt="$mydomain";;
8826 rp="What is your domain name?"
8836 : translate upper to lower if necessary
8839 echo "(Normalizing case in your domain name)"
8840 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
8844 : a little sanity check here
8845 case "$phostname" in
8848 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
8849 $myhostname$mydomain|$myhostname) ;;
8851 case "$phostname" in
8853 echo "(That doesn't agree with your whoami.h file, by the way.)"
8856 echo "(That doesn't agree with your $phostname command, by the way.)"
8864 : determine the e-mail address of the user who is running us
8867 I need to get your e-mail address in Internet format if possible, i.e.
8868 something like user@host.domain. Please answer accurately since I have
8869 no easy means to double check it. The default value provided below
8870 is most probably close to reality but may not be valid from outside
8871 your organization...
8875 while test "$cont"; do
8877 '') dflt="$cf_by@$myhostname$mydomain";;
8878 *) dflt="$cf_email";;
8880 rp='What is your e-mail address?'
8886 rp='Address does not look like an Internet one. Use it anyway?'
8900 : Ask e-mail of administrator
8903 If you or somebody else will be maintaining perl at your site, please
8904 fill in the correct e-mail address here so that they may be contacted
8905 if necessary. Currently, the "perlbug" program included with perl
8906 will send mail to this address in addition to perlbug@perl.org. You may
8907 enter "none" for no administrator.
8910 case "$perladmin" in
8911 '') dflt="$cf_email";;
8912 *) dflt="$perladmin";;
8914 rp='Perl administrator e-mail address'
8918 : determine whether to only install version-specific parts.
8921 Do you want to install only the version-specific parts of the perl
8922 distribution? Usually you do *not* want to do this.
8924 case "$versiononly" in
8925 "$define"|[Yy]*|true) dflt='y' ;;
8928 rp="Do you want to install only the version-specific parts of perl?"
8931 [yY]*) val="$define";;
8937 case "$versiononly" in
8938 "$define") inc_version_list=''
8939 inc_version_list_init=0
8943 : figure out how to guarantee perl startup
8944 : XXX Note that this currently takes advantage of the bug that binexp ignores
8945 : the Configure -Dinstallprefix setting, which in turn means that under
8946 : relocatable @INC, initialinstalllocation is what binexp started as.
8947 case "$startperl" in
8949 case "$sharpbang" in
8953 I can use the #! construct to start perl on your system. This will
8954 make startup of perl scripts faster, but may cause problems if you
8955 want to share those scripts and perl is not in a standard place
8956 ($initialinstalllocation/perl) on all your platforms. The alternative
8957 is to force a shell by starting the script with a single ':' character.
8960 case "$versiononly" in
8961 "$define") dflt="$initialinstalllocation/perl$version";;
8962 *) dflt="$initialinstalllocation/perl";;
8964 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
8967 none) startperl=": # use perl";;
8968 *) startperl="#!$ans"
8969 if $test 30 -lt `echo "$ans" | wc -c`; then
8972 WARNING: Some systems limit the #! command to 32 characters.
8973 If you experience difficulty running Perl scripts with #!, try
8974 installing Perl in a directory with a shorter pathname.
8980 *) startperl=": # use perl"
8985 echo "I'll use $startperl to start perl scripts."
8987 : figure best path for perl in scripts
8990 case "$versiononly" in
8991 "$define") perlpath="$initialinstalllocation/perl$version";;
8992 *) perlpath="$initialinstalllocation/perl";;
8994 case "$startperl" in
8999 I will use the "eval 'exec'" idiom to start Perl on your system.
9000 I can use the full path of your Perl binary for this purpose, but
9001 doing so may cause problems if you want to share those scripts and
9002 Perl is not always in a standard place ($initialinstalllocation/perl).
9005 dflt="$initialinstalllocation/perl"
9006 rp="What path shall I use in \"eval 'exec'\"?"
9013 case "$startperl" in
9015 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
9018 : determine where public executable scripts go
9019 set scriptdir scriptdir
9021 case "$scriptdir" in
9024 : guess some guesses
9025 $test -d /usr/share/scripts && dflt=/usr/share/scripts
9026 $test -d /usr/share/bin && dflt=/usr/share/bin
9027 $test -d /usr/local/script && dflt=/usr/local/script
9028 $test -d /usr/local/scripts && dflt=/usr/local/scripts
9029 $test -d $prefixexp/script && dflt=$prefixexp/script
9033 *) dflt="$scriptdir"
9038 Some installations have a separate directory just for executable scripts so
9039 that they can mount it across multiple architectures but keep the scripts in
9040 one spot. You might, for example, have a subdirectory of /usr/share for this.
9041 Or you might just lump your scripts in with all your other executables.
9045 rp='Where do you keep publicly executable scripts?'
9047 if $test "X$ansexp" != "X$scriptdirexp"; then
9053 : A little fix up for an irregularly named variable.
9054 installscript="$installscriptdir"
9056 : determine where add-on public executables go
9058 '') dflt=$siteprefix/bin ;;
9062 rp='Pathname where the add-on public executables should be installed?'
9067 : determine where add-on html pages go
9068 : There is no standard location, so try to copy the previously-selected
9069 : directory structure for the core html pages.
9070 case "$sitehtml1dir" in
9071 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9072 *) dflt=$sitehtml1dir ;;
9075 ''|' ') dflt=none ;;
9078 rp='Pathname where the site-specific html pages should be installed?'
9080 prefixvar=sitehtml1dir
9083 : determine where add-on library html pages go
9084 : There is no standard location, so try to copy the previously-selected
9085 : directory structure for the core html pages.
9086 case "$sitehtml3dir" in
9087 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9088 *) dflt=$sitehtml3dir ;;
9091 ''|' ') dflt=none ;;
9094 rp='Pathname where the site-specific library html pages should be installed?'
9096 prefixvar=sitehtml3dir
9099 : determine where add-on manual pages go
9100 case "$siteman1dir" in
9101 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
9102 *) dflt=$siteman1dir ;;
9105 ''|' ') dflt=none ;;
9108 rp='Pathname where the site-specific manual pages should be installed?'
9110 prefixvar=siteman1dir
9113 : determine where add-on library man pages go
9114 case "$siteman3dir" in
9115 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
9116 *) dflt=$siteman3dir ;;
9119 ''|' ') dflt=none ;;
9122 rp='Pathname where the site-specific library manual pages should be installed?'
9124 prefixvar=siteman3dir
9127 : determine where add-on public executable scripts go
9128 case "$sitescript" in
9129 '') dflt=$siteprefix/script
9130 $test -d $dflt || dflt=$sitebin ;;
9131 *) dflt="$sitescript" ;;
9134 rp='Pathname where add-on public executable scripts should be installed?'
9136 prefixvar=sitescript
9139 : Check if faststdio is requested and available
9140 case "$usefaststdio" in
9141 $define|true|[yY]*|'')
9142 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
9152 Perl can be built to use 'fast stdio', which means using the stdio
9153 library but also directly manipulating the stdio buffers to enable
9154 faster I/O. Using stdio is better for backward compatibility (especially
9155 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
9156 interface has been preferred instead of stdio.
9158 If this doesn't make any sense to you, just accept the default '$dflt'.
9160 rp='Use the "fast stdio" if available?'
9163 y|Y) val="$define" ;;
9170 : define an is-a-typedef? function
9171 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9173 "") inclist="sys/types.h";;
9175 eval "varval=\$$var";
9179 for inc in $inclist; do
9180 echo "#include <$inc>" >>temp.c;
9182 echo "#ifdef $type" >> temp.c;
9183 echo "printf(\"We have $type\");" >> temp.c;
9184 echo "#endif" >> temp.c;
9185 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9186 if $contains $type temp.E >/dev/null 2>&1; then
9192 *) eval "$var=\$varval";;
9195 : define an is-a-typedef? function that prompts if the type is not available.
9196 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9198 "") inclist="sys/types.h";;
9200 eval "varval=\$$var";
9204 for inc in $inclist; do
9205 echo "#include <$inc>" >>temp.c;
9207 echo "#ifdef $type" >> temp.c;
9208 echo "printf(\"We have $type\");" >> temp.c;
9209 echo "#endif" >> temp.c;
9210 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9212 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
9213 if $contains $type temp.E >/dev/null 2>&1; then
9214 echo "$type found." >&4;
9217 echo "$type NOT found." >&4;
9223 *) eval "$var=\$varval";;
9226 : see what type lseek is declared as in the kernel
9227 rp="What is the type used for lseek's offset on this system?"
9228 set off_t lseektype long stdio.h sys/types.h
9232 echo "Checking to see how big your file offsets are..." >&4
9234 #include <sys/types.h>
9238 printf("%d\n", (int)sizeof($lseektype));
9243 if eval $compile_ok; then
9244 lseeksize=`$run ./try`
9245 echo "Your file offsets are $lseeksize bytes long."
9249 echo "(I can't seem to compile the test program. Guessing...)"
9250 rp="What is the size of your file offsets (in bytes)?"
9256 : see what type file positions are declared as in the library
9257 rp="What is the type for file position used by fsetpos()?"
9258 set fpos_t fpostype long stdio.h sys/types.h
9261 : Check size for Fpos_t
9264 *_t) zzz="$fpostype" ;;
9267 echo "Checking the size of $zzz..." >&4
9269 #include <sys/types.h>
9276 printf("%d\n", (int)sizeof($fpostype));
9281 if eval $compile_ok; then
9285 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9288 echo "Your $zzz is $fpossize bytes long."
9294 echo "(I can't compile the test program. Guessing...)" >&4
9295 rp="What is the size of your file positions (in bytes)?"
9300 : Check for large file support
9301 # Backward compatibility (uselfs is deprecated).
9303 "$define"|true|[yY]*)
9306 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9308 uselargefiles="$define"
9312 case "$lseeksize:$fpossize" in
9315 You can have files larger than 2 gigabytes.
9318 *) case "$uselargefiles" in
9319 "$undef"|false|[nN]*) dflt='n' ;;
9324 Perl can be built to understand large files (files larger than 2 gigabytes)
9325 on some systems. To do so, Configure can be run with -Duselargefiles.
9327 If this doesn't make any sense to you, just accept the default '$dflt'.
9329 rp='Try to understand large files, if available?'
9332 y|Y) val="$define" ;;
9339 : Look for a hint-file generated 'call-back-unit'. If the
9340 : user has specified that a large files perl is to be built,
9341 : we may need to set or change some other defaults.
9342 if $test -f uselargefiles.cbu; then
9343 echo "Your platform has some specific hints regarding large file builds, using them..."
9344 . ./uselargefiles.cbu
9346 case "$uselargefiles" in
9348 if $test -f uselargefiles.cbu; then
9350 echo "Rechecking to see how big your file offsets are..." >&4
9352 #include <sys/types.h>
9356 printf("%d\n", (int)sizeof($lseektype));
9361 if eval $compile_ok; then
9362 lseeksize=`$run ./try`
9363 $echo "Your file offsets are now $lseeksize bytes long."
9367 echo "(I can't seem to compile the test program. Guessing...)"
9368 rp="What is the size of your file offsets (in bytes)?"
9373 *_t) zzz="$fpostype" ;;
9376 $echo $n "Rechecking the size of $zzz...$c" >&4
9378 #include <sys/types.h>
9385 printf("%d\n", (int)sizeof($fpostype));
9390 if eval $compile_ok; then
9395 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9398 echo " $fpossize bytes." >&4
9404 echo "(I can't compile the test program. Guessing...)" >&4
9405 rp="What is the size of your file positions (in bytes)?"
9414 : Set the vendorbin variables
9415 case "$vendorprefix" in
9416 '') d_vendorbin="$undef"
9420 *) d_vendorbin="$define"
9421 : determine where vendor-supplied executables go.
9422 case "$vendorbin" in
9423 '') dflt=$vendorprefix/bin ;;
9424 *) dflt="$vendorbin" ;;
9427 rp='Pathname for the vendor-supplied executables directory?'
9430 vendorbinexp="$ansexp"
9436 : Set the vendorhtml1dir variables
9437 case "$vendorprefix" in
9438 '') vendorhtml1dir=''
9439 vendorhtml1direxp=''
9441 *) : determine where vendor-supplied html pages go.
9442 : There is no standard location, so try to copy the previously-selected
9443 : directory structure for the core html pages.
9444 : XXX Better default suggestions would be welcome.
9445 case "$vendorhtml1dir" in
9446 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9447 *) dflt=$vendorhtml1dir ;;
9450 ''|' ') dflt=none ;;
9453 rp='Pathname for the vendor-supplied html pages?'
9455 vendorhtml1dir="$ans"
9456 vendorhtml1direxp="$ansexp"
9459 : Use ' ' for none so value is preserved next time through Configure
9460 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9461 prefixvar=vendorhtml1dir
9464 : Set the vendorhtml3dir variables
9465 case "$vendorprefix" in
9466 '') vendorhtml3dir=''
9467 vendorhtml3direxp=''
9469 *) : determine where vendor-supplied module html pages go.
9470 : There is no standard location, so try to copy the previously-selected
9471 : directory structure for the core html pages.
9472 : XXX Better default suggestions would be welcome.
9473 case "$vendorhtml3dir" in
9474 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9475 *) dflt=$vendorhtml3dir ;;
9478 ''|' ') dflt=none ;;
9481 rp='Pathname for the vendor-supplied html pages?'
9483 vendorhtml3dir="$ans"
9484 vendorhtml3direxp="$ansexp"
9487 : Use ' ' for none so value is preserved next time through Configure
9488 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9489 prefixvar=vendorhtml3dir
9492 : Set the vendorman1dir variables
9493 case "$vendorprefix" in
9494 '') vendorman1dir=''
9497 *) : determine where vendor-supplied manual pages go.
9498 case "$vendorman1dir" in
9499 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9500 *) dflt=$vendorman1dir ;;
9503 ''|' ') dflt=none ;;
9506 rp='Pathname for the vendor-supplied manual section 1 pages?'
9508 vendorman1dir="$ans"
9509 vendorman1direxp="$ansexp"
9512 : Use ' ' for none so value is preserved next time through Configure
9513 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9514 prefixvar=vendorman1dir
9517 : Set the vendorman3dir variables
9518 case "$vendorprefix" in
9519 '') vendorman3dir=''
9522 *) : determine where vendor-supplied module manual pages go.
9523 case "$vendorman3dir" in
9524 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9525 *) dflt=$vendorman3dir ;;
9528 ''|' ') dflt=none ;;
9531 rp='Pathname for the vendor-supplied manual section 3 pages?'
9533 vendorman3dir="$ans"
9534 vendorman3direxp="$ansexp"
9537 : Use ' ' for none so value is preserved next time through Configure
9538 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9539 prefixvar=vendorman3dir
9542 : Set the vendorscript variables
9543 case "$vendorprefix" in
9544 '') d_vendorscript="$undef"
9548 *) d_vendorscript="$define"
9549 : determine where vendor-supplied scripts go.
9550 case "$vendorscript" in
9551 '') dflt=$vendorprefix/script
9552 $test -d $dflt || dflt=$vendorbin ;;
9553 *) dflt="$vendorscript" ;;
9557 The installation process will create a directory for
9558 vendor-supplied scripts.
9562 rp='Pathname for the vendor-supplied scripts directory?'
9565 vendorscriptexp="$ansexp"
9568 prefixvar=vendorscript
9571 : script used to emit important warnings
9574 if test \$# -gt 0; then
9579 echo "*** WARNING:" >&4
9580 sed -e 's/^/*** /' <msg >&4
9582 cat msg >>config.msg
9583 echo " " >>config.msg
9589 : see which of string.h or strings.h is needed
9591 strings=`./findhdr string.h`
9592 if $test "$strings" && $test -r "$strings"; then
9593 echo "Using <string.h> instead of <strings.h>." >&4
9597 strings=`./findhdr strings.h`
9598 if $test "$strings" && $test -r "$strings"; then
9599 echo "Using <strings.h> instead of <string.h>." >&4
9601 ./warn "No string header found -- You'll surely have problems."
9607 "$undef") strings=`./findhdr strings.h`;;
9608 *) strings=`./findhdr string.h`;;
9611 : see if qgcvt exists
9615 : Check print/scan long double stuff
9618 if $test X"$d_longdbl" = X"$define"; then
9620 echo "Checking how to print long doubles..." >&4
9622 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
9623 $cat >try.c <<'EOCP'
9624 #include <sys/types.h>
9628 printf("%.3f\n", d);
9632 if eval $compile; then
9636 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
9637 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
9638 echo "We will use %f."
9644 if $test X"$sPRIfldbl" = X; then
9645 $cat >try.c <<'EOCP'
9646 #include <sys/types.h>
9649 long double d = 123.456;
9650 printf("%.3Lf\n", d);
9654 if eval $compile; then
9658 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
9659 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
9660 echo "We will use %Lf."
9666 if $test X"$sPRIfldbl" = X; then
9667 $cat >try.c <<'EOCP'
9668 #include <sys/types.h>
9671 long double d = 123.456;
9672 printf("%.3llf\n", d);
9676 if eval $compile; then
9680 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
9681 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
9682 echo "We will use %llf."
9688 if $test X"$sPRIfldbl" = X; then
9689 $cat >try.c <<'EOCP'
9690 #include <sys/types.h>
9693 long double d = 123.456;
9694 printf("%.3lf\n", d);
9698 if eval $compile; then
9702 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
9703 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
9704 echo "We will use %lf."
9710 if $test X"$sPRIfldbl" = X; then
9711 echo "Cannot figure out how to print long doubles." >&4
9713 sSCNfldbl=$sPRIfldbl # expect consistency
9720 case "$sPRIfldbl" in
9721 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
9722 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
9723 d_SCNfldbl="$undef";
9725 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
9726 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
9727 d_SCNfldbl="$define";
9731 : Check how to convert floats to strings.
9733 if test "X$d_Gconvert" = X; then
9736 echo "Checking for an efficient way to convert floats to strings."
9738 case "$uselongdouble" in
9739 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
9741 case "$d_longdbl" in
9742 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
9744 case "$d_PRIgldbl" in
9745 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
9749 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
9750 char *myname = "gconvert";
9753 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
9754 char *myname = "gcvt";
9757 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
9758 char *myname = "qgcvt";
9759 #define DOUBLETYPE long double
9762 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9764 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
9766 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
9769 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
9771 char *myname = "sprintf";
9775 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9776 #define DOUBLETYPE long double
9778 #define DOUBLETYPE double
9790 # include <string.h>
9792 # include <strings.h>
9795 int checkit(char *expect, char *got)
9797 if (strcmp(expect, got)) {
9798 printf("%s oddity: Expected %s, got %s\n",
9799 myname, expect, got);
9809 /* This must be 1st test on (which?) platform */
9810 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
9811 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
9812 checkit("0.1", buf);
9814 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
9815 checkit("0.01", buf);
9817 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
9818 checkit("0.001", buf);
9820 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
9821 checkit("0.0001", buf);
9823 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
9824 if (strlen(buf) > 5)
9825 checkit("9e-005", buf); /* for Microsoft ?? */
9827 checkit("9e-05", buf);
9829 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
9832 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
9833 checkit("1.1", buf);
9835 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
9836 checkit("1.01", buf);
9838 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
9839 checkit("1.001", buf);
9841 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
9842 checkit("1.0001", buf);
9844 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
9845 checkit("1.00001", buf);
9847 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
9848 checkit("1.000001", buf);
9850 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
9853 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
9856 /* Some Linux gcvt's give 1.e+5 here. */
9857 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
9858 checkit("100000", buf);
9860 /* Some Linux gcvt's give -1.e+5 here. */
9861 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
9862 checkit("-100000", buf);
9864 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
9865 checkit("123.456", buf);
9867 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
9868 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
9869 /* 34 should be enough to scare even long double
9870 * places into using the e notation. */
9871 if (strlen(buf) > 5)
9872 checkit("1e+034", buf); /* for Microsoft */
9874 checkit("1e+34", buf);
9876 /* For Perl, if you add additional tests here, also add them to
9877 * t/base/num.t for benefit of platforms not using Configure or
9878 * overriding d_Gconvert */
9883 : first add preferred functions to our list
9885 for xxx_convert in $gconvert_preference; do
9886 case $xxx_convert in
9887 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
9888 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
9891 : then add any others
9892 for xxx_convert in gconvert gcvt sprintf; do
9895 *) xxx_list="$xxx_list $xxx_convert" ;;
9899 case "$d_longdbl$uselongdouble" in
9901 : again, add prefered functions to our list first
9903 for xxx_convert in $gconvert_ld_preference; do
9904 case $xxx_convert in
9905 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9906 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
9909 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
9910 for xxx_convert in qgcvt sprintf $xxx_list; do
9911 case "$xxx_ld_list" in
9912 $xxx_convert*|*" $xxx_convert"*) ;;
9913 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9916 : if sprintf cannot do long doubles, move it to the end
9917 if test "$d_PRIgldbl" != "$define"; then
9918 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
9920 : if no qgcvt, remove it
9921 if test "$d_qgcvt" != "$define"; then
9922 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
9925 xxx_list="$xxx_ld_list"
9929 for xxx_convert in $xxx_list; do
9930 echo "Trying $xxx_convert..."
9931 $rm -f try try$_o core
9932 set try -DTRY_$xxx_convert
9933 if eval $compile; then
9934 echo "$xxx_convert() found." >&4
9936 echo "I'll use $xxx_convert to convert floats into a string." >&4
9939 echo "...But $xxx_convert didn't work as I expected."
9943 echo "$xxx_convert NOT found." >&4
9947 if test X$xxx_convert = X; then
9948 echo "*** WHOA THERE!!! ***" >&4
9949 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
9953 case "$xxx_convert" in
9954 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
9955 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
9956 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
9957 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
9958 "$define$define$define")
9959 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
9960 "$define$define$undef")
9961 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
9962 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
9970 : see if _fwalk exists
9974 : Initialize h_fcntl
9977 : Initialize h_sysfile
9980 : access call always available on UNIX
9984 : locate the flags for 'access()'
9988 $cat >access.c <<EOCP
9989 #include <sys/types.h>
9994 #include <sys/file.h>
10001 #include <stdlib.h>
10007 : check sys/file.h first, no particular reason here
10008 if $test `./findhdr sys/file.h` && \
10009 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
10011 echo "<sys/file.h> defines the *_OK access constants." >&4
10012 elif $test `./findhdr fcntl.h` && \
10013 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
10015 echo "<fcntl.h> defines the *_OK access constants." >&4
10016 elif $test `./findhdr unistd.h` && \
10017 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
10018 echo "<unistd.h> defines the *_OK access constants." >&4
10020 echo "I can't find the four *_OK access constants--I'll use mine." >&4
10026 : see if accessx exists
10027 set accessx d_accessx
10030 : see if aintl exists
10034 : see if alarm exists
10038 : see if 64bit time functions exists
10040 set ctime64 d_ctime64
10043 set localtime64 d_localtime64
10046 set gmtime64 d_gmtime64
10049 set mktime64 d_mktime64
10052 set difftime64 d_difftime64
10055 set asctime64 d_asctime64
10058 : see if POSIX threads are available
10059 set pthread.h i_pthread
10062 : define a fucntion to check prototypes
10063 $cat > protochk <<EOSH
10066 optimize="$optimize"
10068 prototype="$prototype"
10071 usethreads=$usethreads
10072 i_pthread=$i_pthread
10073 pthread_h_first=$pthread_h_first
10076 $cat >> protochk <<'EOSH'
10081 while test $# -ge 2; do
10083 $define) echo "#include <$2>" >> try.c ;;
10084 literal) echo "$2" >> try.c ;;
10086 # Extra magic for the benefit of systems that need pthread.h
10087 # to be included early to correctly detect threadsafe functions.
10088 # Such functions must guarantee themselves, though, that the usethreads
10089 # and i_pthread have been defined, before calling protochk.
10090 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
10091 echo "#include <pthread.h>" >> try.c
10096 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
10097 cat >> try.c <<'EOCP'
10098 #ifdef CAN_PROTOTYPE
10099 #define _(args) args
10104 echo "$foo" >> try.c
10105 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
10106 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
10112 $eunicefix protochk
10114 : Define hasproto macro for Configure internal use
10115 hasproto='varname=$1; func=$2; shift; shift;
10116 while $test $# -ge 2; do
10118 $define) echo "#include <$2>";;
10122 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
10123 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
10124 echo "$func() prototype found.";
10127 echo "$func() prototype NOT found.";
10134 : see if sys/types.h has to be included
10135 set sys/types.h i_systypes
10138 : see if sys/select.h has to be included
10139 set sys/select.h i_sysselct
10142 : Define hasfield macro for Configure internal use
10143 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
10144 while $test $# -ge 2; do
10146 $define) echo "#include <$2>";;
10150 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
10152 if eval $compile; then
10161 : see if we should include time.h, sys/time.h, or both
10163 if test "X$timeincl" = X; then
10164 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
10165 $echo $n "I'm now running the test program...$c"
10167 #include <sys/types.h>
10172 #ifdef SYSTIMEKERNEL
10175 #include <sys/time.h>
10178 #include <sys/select.h>
10180 #$i_stdlib I_STDLIB
10182 #include <stdlib.h>
10188 struct timeval bar;
10191 struct timezone tzp;
10193 if (foo.tm_sec == foo.tm_sec)
10196 if (bar.tv_sec == bar.tv_sec)
10203 for s_timezone in '-DS_TIMEZONE' ''; do
10205 for s_timeval in '-DS_TIMEVAL' ''; do
10206 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10207 for i_time in '' '-DI_TIME'; do
10208 for i_systime in '-DI_SYSTIME' ''; do
10211 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10212 if eval $compile; then
10213 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
10217 $echo $n "Succeeded with $flags$c"
10229 *SYSTIMEKERNEL*) i_systimek="$define"
10230 timeincl=`./findhdr sys/time.h`
10231 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10232 *) i_systimek="$undef";;
10235 *I_TIME*) i_time="$define"
10236 timeincl=`./findhdr time.h`" $timeincl"
10237 echo "We'll include <time.h>." >&4;;
10238 *) i_time="$undef";;
10241 *I_SYSTIME*) i_systime="$define"
10242 timeincl=`./findhdr sys/time.h`" $timeincl"
10243 echo "We'll include <sys/time.h>." >&4;;
10244 *) i_systime="$undef";;
10248 : see if struct tm knows about tm_zone
10249 case "$i_systime$i_time" in
10252 echo "Checking to see if your struct tm has tm_zone field..." >&4
10253 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
10261 case "$d_tm_tm_zone" in
10262 "$define") echo "Yes, it does." ;;
10263 *) echo "No, it doesn't." ;;
10265 : see if struct tm knows about tm_gmtoff
10266 case "$i_systime$i_time" in
10269 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
10270 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
10278 case "$d_tm_tm_gmtoff" in
10279 "$define") echo "Yes, it does." ;;
10280 *) echo "No, it doesn't." ;;
10283 : see if asctime_r exists
10284 set asctime_r d_asctime_r
10286 case "$d_asctime_r" in
10288 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10289 case "$d_asctime_r_proto:$usethreads" in
10290 ":define") d_asctime_r_proto=define
10291 set d_asctime_r_proto asctime_r $hdrs
10295 case "$d_asctime_r_proto" in
10297 case "$asctime_r_proto" in
10298 ''|0) try='char* asctime_r(const struct tm*, char*);'
10299 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SB ;;
10301 case "$asctime_r_proto" in
10302 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
10303 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SBI ;;
10305 case "$asctime_r_proto" in
10306 ''|0) try='int asctime_r(const struct tm*, char*);'
10307 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SB ;;
10309 case "$asctime_r_proto" in
10310 ''|0) try='int asctime_r(const struct tm*, char*, int);'
10311 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SBI ;;
10313 case "$asctime_r_proto" in
10314 ''|0) d_asctime_r=undef
10316 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
10317 * ) case "$asctime_r_proto" in
10318 REENTRANT_PROTO*) ;;
10319 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
10321 echo "Prototype: $try" ;;
10324 *) case "$usethreads" in
10325 define) echo "asctime_r has no prototype, not using it." >&4 ;;
10332 *) asctime_r_proto=0
10336 : see if atolf exists
10340 : see if atoll exists
10344 : Look for GCC-style attribute format
10345 case "$d_attribute_format" in
10348 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
10349 $cat >attrib.c <<'EOCP'
10351 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
10353 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10354 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10355 echo "Your C compiler doesn't support __attribute__((format))."
10358 echo "Your C compiler supports __attribute__((format))."
10362 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10366 *) val="$d_attribute_format" ;;
10368 set d_attribute_format
10372 : Look for GCC-style attribute format with null format allowed
10373 case "$d_printf_format_null" in
10374 '') case "$d_attribute_format" in
10377 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
10378 $cat >attrib.c <<EOCP
10380 #$i_stdlib I_STDLIB
10382 #include <stdlib.h>
10384 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
10385 int null_printf (char* pat,...) { return (int)pat; }
10386 int main () { exit(null_printf(NULL)); }
10388 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
10389 : run the executable in case it produces a run-time warning
10390 if $run ./attrib >>attrib.out 2>&1; then
10391 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10392 echo "Your C compiler doesn't allow __printf__ format to be null."
10395 echo "Your C compiler allows __printf__ format to be null."
10399 echo "Your C compiler executable failed with __printf__ format null."
10403 echo "Your C compiler fails with __printf__ format null."
10410 *) val="$d_printf_format_null" ;;
10412 set d_printf_format_null
10416 : Look for GCC-style attribute malloc
10417 case "$d_attribute_malloc" in
10420 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
10421 $cat >attrib.c <<'EOCP'
10423 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
10425 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10426 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10427 echo "Your C compiler doesn't support __attribute__((malloc))."
10430 echo "Your C compiler supports __attribute__((malloc))."
10434 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10438 *) val="$d_attribute_malloc" ;;
10440 set d_attribute_malloc
10444 : Look for GCC-style attribute nonnull
10445 case "$d_attribute_nonnull" in
10448 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
10449 $cat >attrib.c <<'EOCP'
10451 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
10453 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10454 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10455 echo "Your C compiler doesn't support __attribute__((nonnull))."
10458 echo "Your C compiler supports __attribute__((nonnull))."
10462 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10466 *) val="$d_attribute_nonnull" ;;
10468 set d_attribute_nonnull
10472 : Look for GCC-style attribute noreturn
10473 case "$d_attribute_noreturn" in
10476 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
10477 $cat >attrib.c <<'EOCP'
10479 void fall_over_dead( void ) __attribute__((noreturn));
10481 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10482 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10483 echo "Your C compiler doesn't support __attribute__((noreturn))."
10486 echo "Your C compiler supports __attribute__((noreturn))."
10490 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10494 *) val="$d_attribute_noreturn" ;;
10496 set d_attribute_noreturn
10500 : Look for GCC-style attribute pure
10501 case "$d_attribute_pure" in
10504 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
10505 $cat >attrib.c <<'EOCP'
10507 int square( int n ) __attribute__((pure));
10509 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10510 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10511 echo "Your C compiler doesn't support __attribute__((pure))."
10514 echo "Your C compiler supports __attribute__((pure))."
10518 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10522 *) val="$d_attribute_pure" ;;
10524 set d_attribute_pure
10528 : Look for GCC-style attribute unused
10529 case "$d_attribute_unused" in
10532 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
10533 $cat >attrib.c <<'EOCP'
10535 int do_something( int dummy __attribute__((unused)), int n );
10537 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10538 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10539 echo "Your C compiler doesn't support __attribute__((unused))."
10542 echo "Your C compiler supports __attribute__((unused))."
10546 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10550 *) val="$d_attribute_unused" ;;
10552 set d_attribute_unused
10556 : Look for GCC-style attribute deprecated
10557 case "$d_attribute_deprecated" in
10560 echo "Checking whether your compiler can handle __attribute__((deprecated)) ..." >&4
10561 $cat >attrib.c <<'EOCP'
10563 int I_am_deprecated(void) __attribute__((deprecated));
10565 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10566 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10567 echo "Your C compiler doesn't support __attribute__((deprecated))."
10570 echo "Your C compiler supports __attribute__((deprecated))."
10574 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10578 *) val="$d_attribute_deprecated" ;;
10580 set d_attribute_deprecated
10584 : Look for GCC-style attribute warn_unused_result
10585 case "$d_attribute_warn_unused_result" in
10588 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
10589 $cat >attrib.c <<'EOCP'
10591 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
10593 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10594 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10595 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
10598 echo "Your C compiler supports __attribute__((warn_unused_result))."
10602 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10606 *) val="$d_attribute_warn_unused_result" ;;
10608 set d_attribute_warn_unused_result
10612 : see if bcmp exists
10616 : see if bcopy exists
10620 : see if getpgrp exists
10621 set getpgrp d_getpgrp
10624 case "$d_getpgrp" in
10627 echo "Checking to see which flavor of getpgrp is in use..."
10629 #$i_unistd I_UNISTD
10630 #include <sys/types.h>
10632 # include <unistd.h>
10634 #$i_stdlib I_STDLIB
10636 #include <stdlib.h>
10640 if (getuid() == 0) {
10641 printf("(I see you are running Configure as super-user...)\n");
10644 #ifdef TRY_BSD_PGRP
10645 if (getpgrp(1) == 0)
10654 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10655 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
10657 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10658 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
10661 echo "I can't seem to compile and run the test program."
10663 xxx="a USG one, i.e. you use getpgrp()."
10665 # SVR4 systems can appear rather BSD-ish.
10666 case "$i_unistd" in
10668 xxx="a BSD one, i.e. you use getpgrp(pid)."
10672 xxx="probably a USG one, i.e. you use getpgrp()."
10677 echo "Assuming your getpgrp is $xxx" >&4
10686 : see if setpgrp exists
10687 set setpgrp d_setpgrp
10690 case "$d_setpgrp" in
10693 echo "Checking to see which flavor of setpgrp is in use..."
10695 #$i_unistd I_UNISTD
10696 #include <sys/types.h>
10698 # include <unistd.h>
10700 #$i_stdlib I_STDLIB
10702 #include <stdlib.h>
10706 if (getuid() == 0) {
10707 printf("(I see you are running Configure as super-user...)\n");
10710 #ifdef TRY_BSD_PGRP
10711 if (-1 == setpgrp(1, 1))
10714 if (setpgrp() != -1)
10720 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10721 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
10723 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10724 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
10727 echo "(I can't seem to compile and run the test program.)"
10729 xxx="a USG one, i.e. you use setpgrp()."
10731 # SVR4 systems can appear rather BSD-ish.
10732 case "$i_unistd" in
10734 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
10738 xxx="probably a USG one, i.e. you use setpgrp()."
10743 echo "Assuming your setpgrp is $xxx" >&4
10752 : Look for GCC-style __builtin_choose_expr
10753 case "$d_builtin_choose_expr" in
10756 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
10757 $cat >try.c <<'EOCP'
10758 #include <assert.h>
10759 #include <stdlib.h>
10762 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
10765 assert( SYRINX(1) == 2112 );
10766 assert( SYRINX(1) != 5150 );
10767 assert( SYRINX(0) == 5150 );
10768 assert( SYRINX(0) != 2112 );
10769 puts( "All good!" );
10775 if eval $compile && $run ./try; then
10776 echo "Your C compiler supports __builtin_choose_expr."
10779 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10783 *) val="$d_builtin_choose_expr" ;;
10786 set d_builtin_choose_expr
10790 : Look for GCC-style __builtin_expect
10791 case "$d_builtin_expect" in
10794 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
10795 $cat >try.c <<'EOCP'
10798 if ( __builtin_expect(n, 0) ) n = 1;
10799 /* Remember shell exit code truth is 0, C truth is non-zero */
10804 if eval $compile && $run ./try; then
10805 echo "Your C compiler supports __builtin_expect."
10808 echo "Your C compiler doesn't seem to understand __builtin_expect."
10812 *) val="$d_builtin_expect" ;;
10815 set d_builtin_expect
10819 : see if bzero exists
10823 : see if stdarg is available
10825 if $test `./findhdr stdarg.h`; then
10826 echo "<stdarg.h> found." >&4
10829 echo "<stdarg.h> NOT found." >&4
10833 : see if varags is available
10835 if $test `./findhdr varargs.h`; then
10836 echo "<varargs.h> found." >&4
10838 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
10841 : set up the varargs testing programs
10842 $cat > varargs.c <<EOP
10844 #include <stdarg.h>
10847 #include <varargs.h>
10851 int f(char *p, ...)
10865 p = va_arg(ap, char *);
10871 $cat > varargs <<EOP
10873 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
10882 : now check which varargs header should be included
10887 if `./varargs I_STDARG`; then
10889 elif `./varargs I_VARARGS`; then
10894 if `./varargs I_VARARGS`; then
10901 echo "I could not find the definition for va_dcl... You have problems..." >&4
10902 val="$undef"; set i_stdarg; eval $setvar
10903 val="$undef"; set i_varargs; eval $setvar
10908 case "$i_varhdr" in
10910 val="$define"; set i_stdarg; eval $setvar
10911 val="$undef"; set i_varargs; eval $setvar
10914 val="$undef"; set i_stdarg; eval $setvar
10915 val="$define"; set i_varargs; eval $setvar
10918 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
10922 : see if the Compiler supports C99 variadic macros
10923 case "$i_stdarg$i_stdlib" in
10925 echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
10928 #include <stdarg.h>
10930 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
10934 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
10940 if eval $compile && $run ./try 2>&1 >/dev/null; then
10941 case "`$run ./try`" in
10943 echo "You have C99 variadic macros." >&4
10944 d_c99_variadic_macros="$define"
10947 echo "You don't have functional C99 variadic macros." >&4
10948 d_c99_variadic_macros="$undef"
10952 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
10953 d_c99_variadic_macros="$undef"
10958 echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
10959 d_c99_variadic_macros="$undef"
10963 : see if signal is declared as pointer to function returning int or void
10965 xxx=`./findhdr signal.h`
10966 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
10967 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10968 echo "You have int (*signal())() instead of void." >&4
10970 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10971 echo "You have void (*signal())()." >&4
10973 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
10974 echo "You have int (*signal())() instead of void." >&4
10976 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
10977 echo "You have void (*signal())()." >&4
10980 case "$d_voidsig" in
10982 echo "I can't determine whether signal handler returns void or int..." >&4
10984 rp="What type does your signal handler return?"
10987 v*) val="$define";;
10991 echo "As you already told me, signal handler returns void." >&4
10994 *) echo "As you already told me, signal handler returns int." >&4
11001 case "$d_voidsig" in
11002 "$define") signal_t="void";;
11003 *) signal_t="int";;
11007 : check for ability to cast large floats to 32-bit ints.
11009 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
11010 if $test "$intsize" -ge 4; then
11017 #$i_stdlib I_STDLIB
11019 #include <stdlib.h>
11021 #include <sys/types.h>
11022 #include <signal.h>
11023 $signal_t blech(int s) { exit(3); }
11030 signal(SIGFPE, blech);
11032 /* Don't let compiler optimize the test away. Store the number
11033 in a writable string for gcc to pass to sscanf under HP-UX.
11035 sprintf(str, "2147483647");
11036 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
11040 /* x86 processors will probably give 0x8000 0000, which is a
11041 sign change. We don't want that. We want to mimic SPARC
11042 behavior here, which is to preserve the sign and give
11045 if (i32 != ($xxx) f)
11051 if eval $compile_ok; then
11055 echo "(I can't seem to compile the test program--assuming it can't)"
11060 echo "Yup, it can."
11063 echo "Nope, it can't."
11070 : check for ability to cast negative floats to unsigned
11072 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
11075 #$i_stdlib I_STDLIB
11077 #include <stdlib.h>
11079 #include <sys/types.h>
11080 #include <signal.h>
11081 $signal_t blech(int s) { exit(7); }
11082 $signal_t blech_in_list(int s) { exit(4); }
11083 unsigned long dummy_long(unsigned long p) { return p; }
11084 unsigned int dummy_int(unsigned int p) { return p; }
11085 unsigned short dummy_short(unsigned short p) { return p; }
11089 unsigned long along;
11091 unsigned short ashort;
11095 /* Frustrate gcc-2.7.2's optimizer which failed this test with
11096 a direct f = -123. assignment. gcc-2.8.0 reportedly
11097 optimized the whole file away
11099 /* Store the number in a writable string for gcc to pass to
11100 sscanf under HP-UX.
11102 sprintf(str, "-123");
11103 sscanf(str, "%lf", &f); /* f = -123.; */
11105 signal(SIGFPE, blech);
11106 along = (unsigned long)f;
11107 aint = (unsigned int)f;
11108 ashort = (unsigned short)f;
11109 if (along != (unsigned long)-123)
11111 if (aint != (unsigned int)-123)
11113 if (ashort != (unsigned short)-123)
11115 sprintf(str, "1073741824.");
11116 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
11119 along = (unsigned long)f;
11120 if (along != 0x80000000)
11124 along = (unsigned long)f;
11125 if (along != 0x7fffffff)
11129 along = (unsigned long)f;
11130 if (along != 0x80000001)
11134 signal(SIGFPE, blech_in_list);
11135 sprintf(str, "123.");
11136 sscanf(str, "%lf", &f); /* f = 123.; */
11137 along = dummy_long((unsigned long)f);
11138 aint = dummy_int((unsigned int)f);
11139 ashort = dummy_short((unsigned short)f);
11140 if (along != (unsigned long)123)
11142 if (aint != (unsigned int)123)
11144 if (ashort != (unsigned short)123)
11151 if eval $compile_ok; then
11155 echo "(I can't seem to compile the test program--assuming it can't)"
11158 case "$castflags" in
11160 echo "Yup, it can."
11163 echo "Nope, it can't."
11170 : see if vprintf exists
11172 if set vprintf val -f d_vprintf; eval $csym; $val; then
11173 echo 'vprintf() found.' >&4
11176 #$i_stdarg I_STDARG /* Only one of these can be defined by i_varhrd */
11177 #$i_varargs I_VARARGS
11179 #$i_stdlib I_STDLIB
11180 #$i_unistd I_UNISTD
11183 # include <stdarg.h>
11184 #else /* I_VARARGS */
11185 # include <varargs.h>
11189 # include <unistd.h>
11193 # include <stdlib.h>
11196 #include <stdio.h> /* vsprintf prototype */
11199 void xxx(int n, ...)
11204 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11206 int main() { xxx(1, "foo"); }
11208 #else /* I_VARARGS */
11216 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11218 int main() { xxx("foo"); }
11224 if eval $compile_ok; then
11225 if $run ./try; then
11226 echo "Your vsprintf() returns (int)." >&4
11229 echo "Your vsprintf() returns (char*)." >&4
11233 echo 'I am unable to compile the vsprintf() test program.' >&4
11234 # We shouldn't get here. If we do, assume the standard signature,
11235 # not the old BSD one.
11236 echo 'Guessing that vsprintf() returns (int).' >&4
11240 echo 'vprintf() NOT found.' >&4
11251 : see if chown exists
11255 : see if chroot exists
11256 set chroot d_chroot
11259 : see if chsize exists
11260 set chsize d_chsize
11263 : see if class exists
11267 : see if clearenv exists
11268 set clearenv d_clearenv
11271 : Define hasstruct macro for Configure internal use
11272 hasstruct='varname=$1; struct=$2; shift; shift;
11273 while $test $# -ge 2; do
11275 $define) echo "#include <$2>";;
11279 echo "int main () { struct $struct foo; }" >> try.c;
11281 if eval $compile; then
11290 : see whether socket exists
11294 $echo $n "Hmm... $c" >&4
11295 if set socket val -f d_socket; eval $csym; $val; then
11296 echo "Looks like you have Berkeley networking support." >&4
11298 if set setsockopt val -f; eval $csym; $val; then
11301 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
11302 d_oldsock="$define"
11305 if $contains socklib libc.list >/dev/null 2>&1; then
11306 echo "Looks like you have Berkeley networking support." >&4
11308 : we will have to assume that it supports the 4.2 BSD interface
11311 echo "You don't have Berkeley networking in libc$_a..." >&4
11312 if test "X$d_socket" = "X$define"; then
11313 echo "...but you seem to believe that you have sockets." >&4
11315 for net in net socket
11317 if test -f /usr/lib/lib$net$_a; then
11318 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
11319 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
11320 if $contains socket libc.list >/dev/null 2>&1; then
11325 echo "...but the Wollongong group seems to have hacked it in." >&4
11326 sockethdr="-I/usr/netinclude"
11329 echo "Found Berkeley sockets interface in lib$net." >&4
11330 if $contains setsockopt libc.list >/dev/null 2>&1; then
11333 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
11334 d_oldsock="$define"
11340 if test "X$d_socket" != "X$define"; then
11341 echo "or anywhere else I see." >&4
11349 : see if socketpair exists
11350 set socketpair d_sockpair
11355 echo "Checking the availability sa_len in the sock struct ..." >&4
11357 #include <sys/types.h>
11358 #include <sys/socket.h>
11360 struct sockaddr sa;
11361 return (sa.sa_len);
11365 set try; if eval $compile; then
11368 set d_sockaddr_sa_len; eval $setvar
11372 echo "Checking the availability of certain socket constants..." >&4
11373 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
11374 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
11376 #include <sys/types.h>
11377 #include <sys/socket.h>
11383 set try; if eval $compile; then
11386 set d_${enum}; eval $setvar
11390 : see if this is a sys/uio.h system
11391 set sys/uio.h i_sysuio
11394 : Check for cmsghdr support
11396 echo "Checking to see if your system supports struct cmsghdr..." >&4
11397 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
11399 case "$d_cmsghdr_s" in
11400 "$define") echo "Yes, it does." ;;
11401 *) echo "No, it doesn't." ;;
11405 : check for const keyword
11407 echo 'Checking to see if your C compiler knows about "const"...' >&4
11408 $cat >const.c <<'EOCP'
11409 typedef struct spug { int drokk; } spug;
11413 const spug y = { 0 };
11416 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
11418 echo "Yup, it does."
11421 echo "Nope, it doesn't."
11426 : see if copysignl exists
11427 set copysignl d_copysignl
11430 : see if crypt exists
11435 $define) cryptlib='' ;;
11436 *) if set crypt val -f d_crypt; eval $csym; $val; then
11437 echo 'crypt() found.' >&4
11441 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
11442 if $test -z "$cryptlib"; then
11443 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
11447 if $test -z "$cryptlib"; then
11448 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
11452 if $test -z "$cryptlib"; then
11453 cryptlib=`./loc libcrypt$_a "" $libpth`
11457 if $test -z "$cryptlib"; then
11458 echo 'crypt() NOT found.' >&4
11469 : see if this is a crypt.h system
11470 set crypt.h i_crypt
11473 : see if crypt_r exists
11474 set crypt_r d_crypt_r
11476 case "$d_crypt_r" in
11478 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
11479 case "$d_crypt_r_proto:$usethreads" in
11480 ":define") d_crypt_r_proto=define
11481 set d_crypt_r_proto crypt_r $hdrs
11485 case "$d_crypt_r_proto" in
11487 case "$crypt_r_proto" in
11488 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
11489 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCS ;;
11491 case "$crypt_r_proto" in
11492 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
11493 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCD ;;
11495 case "$crypt_r_proto" in
11496 ''|0) d_crypt_r=undef
11498 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
11499 * ) case "$crypt_r_proto" in
11500 REENTRANT_PROTO*) ;;
11501 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
11503 echo "Prototype: $try" ;;
11506 *) case "$usethreads" in
11507 define) echo "crypt_r has no prototype, not using it." >&4 ;;
11518 : get csh whereabouts
11520 'csh') val="$undef" ;;
11521 *) val="$define" ;;
11525 : Respect a hint or command line value for full_csh.
11526 case "$full_csh" in
11527 '') full_csh=$csh ;;
11530 : see if ctermid exists
11531 set ctermid d_ctermid
11534 : see if ctermid_r exists
11535 set ctermid_r d_ctermid_r
11537 case "$d_ctermid_r" in
11539 hdrs="$i_systypes sys/types.h define stdio.h "
11540 case "$d_ctermid_r_proto:$usethreads" in
11541 ":define") d_ctermid_r_proto=define
11542 set d_ctermid_r_proto ctermid_r $hdrs
11546 case "$d_ctermid_r_proto" in
11548 case "$ctermid_r_proto" in
11549 ''|0) try='char* ctermid_r(char*);'
11550 ./protochk "$extern_C $try" $hdrs && ctermid_r_proto=B_B ;;
11552 case "$ctermid_r_proto" in
11553 ''|0) d_ctermid_r=undef
11555 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
11556 * ) case "$ctermid_r_proto" in
11557 REENTRANT_PROTO*) ;;
11558 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
11560 echo "Prototype: $try" ;;
11563 *) case "$usethreads" in
11564 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
11571 *) ctermid_r_proto=0
11575 : see if ctime_r exists
11576 set ctime_r d_ctime_r
11578 case "$d_ctime_r" in
11580 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
11581 case "$d_ctime_r_proto:$usethreads" in
11582 ":define") d_ctime_r_proto=define
11583 set d_ctime_r_proto ctime_r $hdrs
11587 case "$d_ctime_r_proto" in
11589 case "$ctime_r_proto" in
11590 ''|0) try='char* ctime_r(const time_t*, char*);'
11591 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SB ;;
11593 case "$ctime_r_proto" in
11594 ''|0) try='char* ctime_r(const time_t*, char*, int);'
11595 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SBI ;;
11597 case "$ctime_r_proto" in
11598 ''|0) try='int ctime_r(const time_t*, char*);'
11599 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SB ;;
11601 case "$ctime_r_proto" in
11602 ''|0) try='int ctime_r(const time_t*, char*, int);'
11603 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SBI ;;
11605 case "$ctime_r_proto" in
11606 ''|0) d_ctime_r=undef
11608 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
11609 * ) case "$ctime_r_proto" in
11610 REENTRANT_PROTO*) ;;
11611 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
11613 echo "Prototype: $try" ;;
11616 *) case "$usethreads" in
11617 define) echo "ctime_r has no prototype, not using it." >&4 ;;
11628 : see if cuserid exists
11629 set cuserid d_cuserid
11632 : see if this is a limits.h system
11633 set limits.h i_limits
11636 : see if this is a float.h system
11637 set float.h i_float
11640 : See if number of significant digits in a double precision number is known
11642 $cat >dbl_dig.c <<EOM
11643 #$i_limits I_LIMITS
11646 #include <limits.h>
11652 printf("Contains DBL_DIG");
11655 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
11656 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
11657 echo "DBL_DIG found." >&4
11660 echo "DBL_DIG NOT found." >&4
11667 : see if dbm.h is available
11668 : see if dbmclose exists
11669 set dbmclose d_dbmclose
11672 case "$d_dbmclose" in
11682 *) set rpcsvc/dbm.h i_rpcsvcdbm
11687 *) echo "We won't be including <dbm.h>"
11697 : see if prototype for dbminit is available
11699 set d_dbminitproto dbminit $i_dbm dbm.h
11702 : see if difftime exists
11703 set difftime d_difftime
11706 : see if this is a dirent system
11708 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
11710 echo "<dirent.h> found." >&4
11713 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
11714 echo "<sys/dir.h> found." >&4
11717 xinc=`./findhdr sys/ndir.h`
11719 echo "<dirent.h> NOT found." >&4
11724 : Look for type of directory structure.
11726 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11728 case "$direntrytype" in
11730 case "$i_dirent" in
11731 $define) guess1='struct dirent' ;;
11732 *) guess1='struct direct' ;;
11735 *) guess1="$direntrytype"
11740 'struct dirent') guess2='struct direct' ;;
11741 *) guess2='struct dirent' ;;
11744 if $contains "$guess1" try.c >/dev/null 2>&1; then
11745 direntrytype="$guess1"
11746 echo "Your directory entries are $direntrytype." >&4
11747 elif $contains "$guess2" try.c >/dev/null 2>&1; then
11748 direntrytype="$guess2"
11749 echo "Your directory entries seem to be $direntrytype." >&4
11751 echo "I don't recognize your system's directory entries." >&4
11752 rp="What type is used for directory entries on this system?"
11755 direntrytype="$ans"
11759 : see if the directory entry stores field length
11761 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11762 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
11763 echo "Good, your directory entry keeps length information in d_namlen." >&4
11766 echo "Your directory entry does not know about the d_namlen field." >&4
11773 : Look for DIR.dd_fd
11774 case "$i_dirent" in
11776 echo "Checking to see if DIR has a dd_fd member variable" >&4
11778 #$i_stdlib I_STDLIB
11780 #include <stdlib.h>
11782 #include <dirent.h>
11792 if eval $compile; then
11793 echo "Yes, it does."
11796 echo "No, it does not."
11801 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
11809 : see if this is an sysdir system
11810 set sys/dir.h i_sysdir
11813 : see if this is an sysndir system
11814 set sys/ndir.h i_sysndir
11819 $cat >dirfd.c <<EOM
11821 #$i_stdlib I_STDLIB
11823 #include <stdlib.h>
11825 #$i_dirent I_DIRENT /**/
11826 #$i_sysdir I_SYS_DIR /**/
11827 #$i_sysndir I_SYS_NDIR /**/
11828 #$i_systypes I_SYS_TYPES /**/
11829 #if defined(I_SYS_TYPES)
11830 #include <sys/types.h>
11832 #if defined(I_DIRENT)
11833 #include <dirent.h>
11834 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
11835 #include <sys/dir.h>
11839 #include <sys/ndir.h>
11843 #include <ndir.h> /* may be wrong in the future */
11845 #include <sys/dir.h>
11851 DIR *dirp = opendir(".");
11852 if (dirfd(dirp) >= 0)
11860 if eval $compile; then
11864 $define) echo "dirfd() found." >&4 ;;
11865 *) echo "dirfd() NOT found." >&4 ;;
11871 : see if dlerror exists
11874 set dlerror d_dlerror
11878 : see if dlfcn is available
11879 set dlfcn.h i_dlfcn
11882 : Check what extension to use for shared libs
11887 On a few systems, the dynamically loaded modules that perl generates and uses
11888 will need a different extension than shared libs. The default will probably
11894 *) dflt="$dlext" ;;
11896 rp='What is the extension of dynamically loaded modules'
11905 : Check if dlsym need a leading underscore
11911 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
11912 $cat >dyna.c <<'EOM'
11919 #$i_stdlib I_STDLIB
11921 #include <stdlib.h>
11925 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
11927 #include <sys/types.h>
11932 extern int fred() ;
11941 int mode = RTLD_LAZY ;
11943 handle = dlopen("./dyna.$dlext", mode) ;
11944 if (handle == NULL) {
11949 symbol = dlsym(handle, "fred") ;
11950 if (symbol == NULL) {
11951 /* try putting a leading underscore */
11952 symbol = dlsym(handle, "_fred") ;
11953 if (symbol == NULL) {
11966 : Call the object file tmp-dyna.o in case dlext=o.
11967 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
11968 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
11969 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
11970 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
11973 1) echo "Test program failed using dlopen." >&4
11974 echo "Perhaps you should not use dynamic loading." >&4;;
11975 2) echo "Test program failed using dlsym." >&4
11976 echo "Perhaps you should not use dynamic loading." >&4;;
11977 3) echo "dlsym needs a leading underscore" >&4
11979 4) echo "dlsym doesn't need a leading underscore." >&4;;
11982 echo "I can't compile and run the test program." >&4
11983 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
11988 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
11993 : see if drand48_r exists
11994 set drand48_r d_drand48_r
11996 case "$d_drand48_r" in
11998 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
11999 case "$d_drand48_r_proto:$usethreads" in
12000 ":define") d_drand48_r_proto=define
12001 set d_drand48_r_proto drand48_r $hdrs
12005 case "$d_drand48_r_proto" in
12007 case "$drand48_r_proto" in
12008 ''|0) try='int drand48_r(struct drand48_data*, double*);'
12009 ./protochk "$extern_C $try" $hdrs && drand48_r_proto=I_ST ;;
12011 case "$drand48_r_proto" in
12012 ''|0) d_drand48_r=undef
12014 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
12015 * ) case "$drand48_r_proto" in
12016 REENTRANT_PROTO*) ;;
12017 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
12019 echo "Prototype: $try" ;;
12022 *) case "$usethreads" in
12023 define) echo "drand48_r has no prototype, not using it." >&4 ;;
12030 *) drand48_r_proto=0
12034 : see if prototype for drand48 is available
12036 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
12039 : see if dup2 exists
12043 : see if eaccess exists
12044 set eaccess d_eaccess
12047 : see if endgrent exists
12048 set endgrent d_endgrent
12051 : see if this is an grp system
12057 xxx=`./findhdr grp.h`
12058 $cppstdin $cppflags $cppminus < $xxx >$$.h
12060 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
12072 set d_grpasswd; eval $setvar
12076 : see if endgrent_r exists
12077 set endgrent_r d_endgrent_r
12079 case "$d_endgrent_r" in
12081 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12082 case "$d_endgrent_r_proto:$usethreads" in
12083 ":define") d_endgrent_r_proto=define
12084 set d_endgrent_r_proto endgrent_r $hdrs
12088 case "$d_endgrent_r_proto" in
12090 case "$endgrent_r_proto" in
12091 ''|0) try='int endgrent_r(FILE**);'
12092 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=I_H ;;
12094 case "$endgrent_r_proto" in
12095 ''|0) try='void endgrent_r(FILE**);'
12096 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=V_H ;;
12098 case "$endgrent_r_proto" in
12099 ''|0) d_endgrent_r=undef
12101 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
12102 * ) case "$endgrent_r_proto" in
12103 REENTRANT_PROTO*) ;;
12104 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
12106 echo "Prototype: $try" ;;
12109 *) case "$usethreads" in
12110 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
12117 *) endgrent_r_proto=0
12121 : see if endhostent exists
12122 set endhostent d_endhent
12125 : see if this is a netdb.h system
12126 set netdb.h i_netdb
12129 : see if endhostent_r exists
12130 set endhostent_r d_endhostent_r
12132 case "$d_endhostent_r" in
12134 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12135 case "$d_endhostent_r_proto:$usethreads" in
12136 ":define") d_endhostent_r_proto=define
12137 set d_endhostent_r_proto endhostent_r $hdrs
12141 case "$d_endhostent_r_proto" in
12143 case "$endhostent_r_proto" in
12144 ''|0) try='int endhostent_r(struct hostent_data*);'
12145 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=I_D ;;
12147 case "$endhostent_r_proto" in
12148 ''|0) try='void endhostent_r(struct hostent_data*);'
12149 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=V_D ;;
12151 case "$endhostent_r_proto" in
12152 ''|0) d_endhostent_r=undef
12153 endhostent_r_proto=0
12154 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
12155 * ) case "$endhostent_r_proto" in
12156 REENTRANT_PROTO*) ;;
12157 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
12159 echo "Prototype: $try" ;;
12162 *) case "$usethreads" in
12163 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
12165 d_endhostent_r=undef
12166 endhostent_r_proto=0
12170 *) endhostent_r_proto=0
12174 : see if endnetent exists
12175 set endnetent d_endnent
12178 : see if endnetent_r exists
12179 set endnetent_r d_endnetent_r
12181 case "$d_endnetent_r" in
12183 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12184 case "$d_endnetent_r_proto:$usethreads" in
12185 ":define") d_endnetent_r_proto=define
12186 set d_endnetent_r_proto endnetent_r $hdrs
12190 case "$d_endnetent_r_proto" in
12192 case "$endnetent_r_proto" in
12193 ''|0) try='int endnetent_r(struct netent_data*);'
12194 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=I_D ;;
12196 case "$endnetent_r_proto" in
12197 ''|0) try='void endnetent_r(struct netent_data*);'
12198 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=V_D ;;
12200 case "$endnetent_r_proto" in
12201 ''|0) d_endnetent_r=undef
12202 endnetent_r_proto=0
12203 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
12204 * ) case "$endnetent_r_proto" in
12205 REENTRANT_PROTO*) ;;
12206 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
12208 echo "Prototype: $try" ;;
12211 *) case "$usethreads" in
12212 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
12214 d_endnetent_r=undef
12215 endnetent_r_proto=0
12219 *) endnetent_r_proto=0
12223 : see if endprotoent exists
12224 set endprotoent d_endpent
12227 : see if endprotoent_r exists
12228 set endprotoent_r d_endprotoent_r
12230 case "$d_endprotoent_r" in
12232 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12233 case "$d_endprotoent_r_proto:$usethreads" in
12234 ":define") d_endprotoent_r_proto=define
12235 set d_endprotoent_r_proto endprotoent_r $hdrs
12239 case "$d_endprotoent_r_proto" in
12241 case "$endprotoent_r_proto" in
12242 ''|0) try='int endprotoent_r(struct protoent_data*);'
12243 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=I_D ;;
12245 case "$endprotoent_r_proto" in
12246 ''|0) try='void endprotoent_r(struct protoent_data*);'
12247 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=V_D ;;
12249 case "$endprotoent_r_proto" in
12250 ''|0) d_endprotoent_r=undef
12251 endprotoent_r_proto=0
12252 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
12253 * ) case "$endprotoent_r_proto" in
12254 REENTRANT_PROTO*) ;;
12255 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
12257 echo "Prototype: $try" ;;
12260 *) case "$usethreads" in
12261 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
12263 d_endprotoent_r=undef
12264 endprotoent_r_proto=0
12268 *) endprotoent_r_proto=0
12272 : see if endpwent exists
12273 set endpwent d_endpwent
12276 : see if this is a pwd.h system
12282 xxx=`./findhdr pwd.h`
12283 $cppstdin $cppflags $cppminus < $xxx >$$.h
12285 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
12293 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
12301 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
12309 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
12317 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
12325 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
12333 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
12341 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
12353 set d_pwquota; eval $setvar
12354 set d_pwage; eval $setvar
12355 set d_pwchange; eval $setvar
12356 set d_pwclass; eval $setvar
12357 set d_pwexpire; eval $setvar
12358 set d_pwcomment; eval $setvar
12359 set d_pwgecos; eval $setvar
12360 set d_pwpasswd; eval $setvar
12364 : see if endpwent_r exists
12365 set endpwent_r d_endpwent_r
12367 case "$d_endpwent_r" in
12369 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
12370 case "$d_endpwent_r_proto:$usethreads" in
12371 ":define") d_endpwent_r_proto=define
12372 set d_endpwent_r_proto endpwent_r $hdrs
12376 case "$d_endpwent_r_proto" in
12378 case "$endpwent_r_proto" in
12379 ''|0) try='int endpwent_r(FILE**);'
12380 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=I_H ;;
12382 case "$endpwent_r_proto" in
12383 ''|0) try='void endpwent_r(FILE**);'
12384 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=V_H ;;
12386 case "$endpwent_r_proto" in
12387 ''|0) d_endpwent_r=undef
12389 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
12390 * ) case "$endpwent_r_proto" in
12391 REENTRANT_PROTO*) ;;
12392 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
12394 echo "Prototype: $try" ;;
12397 *) case "$usethreads" in
12398 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
12405 *) endpwent_r_proto=0
12409 : see if endservent exists
12410 set endservent d_endsent
12413 : see if endservent_r exists
12414 set endservent_r d_endservent_r
12416 case "$d_endservent_r" in
12418 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12419 case "$d_endservent_r_proto:$usethreads" in
12420 ":define") d_endservent_r_proto=define
12421 set d_endservent_r_proto endservent_r $hdrs
12425 case "$d_endservent_r_proto" in
12427 case "$endservent_r_proto" in
12428 ''|0) try='int endservent_r(struct servent_data*);'
12429 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=I_D ;;
12431 case "$endservent_r_proto" in
12432 ''|0) try='void endservent_r(struct servent_data*);'
12433 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=V_D ;;
12435 case "$endservent_r_proto" in
12436 ''|0) d_endservent_r=undef
12437 endservent_r_proto=0
12438 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
12439 * ) case "$endservent_r_proto" in
12440 REENTRANT_PROTO*) ;;
12441 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
12443 echo "Prototype: $try" ;;
12446 *) case "$usethreads" in
12447 define) echo "endservent_r has no prototype, not using it." >&4 ;;
12449 d_endservent_r=undef
12450 endservent_r_proto=0
12454 *) endservent_r_proto=0
12458 : Locate the flags for 'open()'
12461 #include <sys/types.h>
12466 #include <sys/file.h>
12468 #$i_stdlib I_STDLIB
12470 #include <stdlib.h>
12481 : check sys/file.h first to get FREAD on Sun
12482 if $test `./findhdr sys/file.h` && \
12483 set try -DI_SYS_FILE && eval $compile; then
12485 echo "<sys/file.h> defines the O_* constants..." >&4
12486 if $run ./try; then
12487 echo "and you have the 3 argument form of open()." >&4
12490 echo "but not the 3 argument form of open(). Oh, well." >&4
12493 elif $test `./findhdr fcntl.h` && \
12494 set try -DI_FCNTL && eval $compile; then
12496 echo "<fcntl.h> defines the O_* constants..." >&4
12497 if $run ./try; then
12498 echo "and you have the 3 argument form of open()." >&4
12501 echo "but not the 3 argument form of open(). Oh, well." >&4
12506 echo "I can't find the O_* constant definitions! You got problems." >&4
12512 : see if this is a sys/file.h system
12517 : do we need to include sys/file.h ?
12521 if $h_sysfile; then
12523 echo "We'll be including <sys/file.h>." >&4
12526 echo "We won't be including <sys/file.h>." >&4
12536 : see if fcntl.h is there
12541 : see if we can include fcntl.h
12547 echo "We'll be including <fcntl.h>." >&4
12550 if $h_sysfile; then
12551 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
12553 echo "We won't be including <fcntl.h>." >&4
12565 : see if fork exists
12569 : see if pipe exists
12573 : check for non-blocking I/O stuff
12574 case "$h_sysfile" in
12575 true) echo "#include <sys/file.h>" > head.c;;
12578 true) echo "#include <fcntl.h>" > head.c;;
12579 *) echo "#include <sys/fcntl.h>" > head.c;;
12584 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
12585 case "$o_nonblock" in
12587 $cat head.c > try.c
12588 $cat >>try.c <<EOCP
12590 #$i_stdlib I_STDLIB
12592 #include <stdlib.h>
12600 printf("O_NONBLOCK\n");
12604 printf("O_NDELAY\n");
12608 printf("FNDELAY\n");
12615 if eval $compile_ok; then
12616 o_nonblock=`$run ./try`
12617 case "$o_nonblock" in
12618 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
12619 *) echo "Seems like we can use $o_nonblock.";;
12622 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
12625 *) echo "Using $hint value $o_nonblock.";;
12630 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
12633 case "$d_fork:$d_pipe" in
12635 $cat head.c > try.c
12636 $cat >>try.c <<EOCP
12638 #include <sys/types.h>
12639 #include <signal.h>
12641 #$i_stdlib I_STDLIB
12643 #include <stdlib.h>
12649 #define MY_O_NONBLOCK $o_nonblock
12650 #ifndef errno /* XXX need better Configure test */
12653 #$i_unistd I_UNISTD
12655 #include <unistd.h>
12657 #$i_string I_STRING
12659 #include <string.h>
12661 #include <strings.h>
12663 $signal_t blech(int x) { exit(3); }
12665 $cat >> try.c <<'EOCP'
12673 pipe(pd); /* Down: child -> parent */
12674 pipe(pu); /* Up: parent -> child */
12677 close(pd[1]); /* Parent reads from pd[0] */
12678 close(pu[0]); /* Parent writes (blocking) to pu[1] */
12680 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
12685 signal(SIGALRM, blech);
12687 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
12689 sprintf(string, "%d\n", ret);
12690 write(2, string, strlen(string));
12693 if (errno == EAGAIN) {
12694 printf("EAGAIN\n");
12699 if (errno == EWOULDBLOCK)
12700 printf("EWOULDBLOCK\n");
12703 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
12704 sleep(2); /* Give it time to close our pipe */
12706 ret = read(pd[0], buf, 1); /* Should read EOF */
12708 sprintf(string, "%d\n", ret);
12709 write(4, string, strlen(string));
12713 close(pd[0]); /* We write to pd[1] */
12714 close(pu[1]); /* We read from pu[0] */
12715 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
12716 close(pd[1]); /* Pipe pd is now fully closed! */
12717 exit(0); /* Bye bye, thank you for playing! */
12721 if eval $compile_ok; then
12722 echo "$startsh" >mtry
12723 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
12725 ./mtry >/dev/null 2>&1
12727 0) eagain=`$cat try.out`;;
12728 1) echo "Could not perform non-blocking setting!";;
12729 2) echo "I did a successful read() for something that was not there!";;
12730 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
12731 4) echo "Could not find F_SETFL!";;
12732 *) echo "Something terribly wrong happened during testing.";;
12734 rd_nodata=`$cat try.ret`
12735 echo "A read() system call with no data present returns $rd_nodata."
12736 case "$rd_nodata" in
12739 echo "(That's peculiar, fixing that to be -1.)"
12745 echo "Forcing errno EAGAIN on read() with no data available."
12749 echo "Your read() sets errno to $eagain when no data is available."
12752 status=`$cat try.err`
12754 0) echo "And it correctly returns 0 to signal EOF.";;
12755 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
12756 *) echo "However, your read() returns '$status' on EOF??";;
12759 if test "$status" = "$rd_nodata"; then
12760 echo "WARNING: you can't distinguish between EOF and no data!"
12764 echo "I can't compile the test program--assuming errno EAGAIN will do."
12768 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
12777 echo "Using $hint value $eagain."
12778 echo "Your read() returns $rd_nodata when no data is present."
12779 case "$d_eofnblk" in
12780 "$define") echo "And you can see EOF because read() returns 0.";;
12781 "$undef") echo "But you can't see EOF status from read() returned value.";;
12783 echo "(Assuming you can't see EOF status from read anyway.)"
12789 $rm_try head.c mtry
12791 : see if _ptr and _cnt from stdio act std
12794 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
12795 echo "(Looks like you have stdio.h from BSD.)"
12796 case "$stdio_ptr" in
12797 '') stdio_ptr='((fp)->_p)'
12800 *) ptr_lval=$d_stdio_ptr_lval;;
12802 case "$stdio_cnt" in
12803 '') stdio_cnt='((fp)->_r)'
12806 *) cnt_lval=$d_stdio_cnt_lval;;
12808 case "$stdio_base" in
12809 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
12811 case "$stdio_bufsiz" in
12812 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
12814 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
12815 echo "(Looks like you have stdio.h from Linux.)"
12816 case "$stdio_ptr" in
12817 '') stdio_ptr='((fp)->_IO_read_ptr)'
12820 *) ptr_lval=$d_stdio_ptr_lval;;
12822 case "$stdio_cnt" in
12823 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
12826 *) cnt_lval=$d_stdio_cnt_lval;;
12828 case "$stdio_base" in
12829 '') stdio_base='((fp)->_IO_read_base)';;
12831 case "$stdio_bufsiz" in
12832 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
12835 case "$stdio_ptr" in
12836 '') stdio_ptr='((fp)->_ptr)'
12839 *) ptr_lval=$d_stdio_ptr_lval;;
12841 case "$stdio_cnt" in
12842 '') stdio_cnt='((fp)->_cnt)'
12845 *) cnt_lval=$d_stdio_cnt_lval;;
12847 case "$stdio_base" in
12848 '') stdio_base='((fp)->_base)';;
12850 case "$stdio_bufsiz" in
12851 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
12855 : test whether _ptr and _cnt really work
12856 echo "Checking how std your stdio is..." >&4
12859 #$i_stdlib I_STDLIB
12861 #include <stdlib.h>
12863 #define FILE_ptr(fp) $stdio_ptr
12864 #define FILE_cnt(fp) $stdio_cnt
12866 FILE *fp = fopen("try.c", "r");
12869 18 <= FILE_cnt(fp) &&
12870 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12878 if eval $compile && $to try.c; then
12879 if $run ./try; then
12880 echo "Your stdio acts pretty std."
12883 echo "Your stdio isn't very std."
12886 echo "Your stdio doesn't appear very std."
12890 # glibc 2.2.90 and above apparently change stdio streams so Perl's
12891 # direct buffer manipulation no longer works. The Configure tests
12892 # should be changed to correctly detect this, but until then,
12893 # the following check should at least let perl compile and run.
12894 # (This quick fix should be updated before 5.8.1.)
12895 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
12896 # A. Dougherty, June 3, 2002.
12897 case "$d_gnulibc" in
12899 case "$gnulibc_version" in
12903 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
12912 : Can _ptr be used as an lvalue?
12913 case "$d_stdstdio$ptr_lval" in
12914 $define$define) val=$define ;;
12917 set d_stdio_ptr_lval
12920 : Can _cnt be used as an lvalue?
12921 case "$d_stdstdio$cnt_lval" in
12922 $define$define) val=$define ;;
12925 set d_stdio_cnt_lval
12929 : test whether setting _ptr sets _cnt as a side effect
12930 d_stdio_ptr_lval_sets_cnt="$undef"
12931 d_stdio_ptr_lval_nochange_cnt="$undef"
12932 case "$d_stdio_ptr_lval$d_stdstdio" in
12934 echo "Checking to see what happens if we set the stdio ptr..." >&4
12937 /* Can we scream? */
12938 /* Eat dust sed :-) */
12939 /* In the buffer space, no one can hear you scream. */
12940 #$i_stdlib I_STDLIB
12942 #include <stdlib.h>
12944 #define FILE_ptr(fp) $stdio_ptr
12945 #define FILE_cnt(fp) $stdio_cnt
12946 #include <sys/types.h>
12948 FILE *fp = fopen("try.c", "r");
12953 puts("Fail even to read");
12956 c = getc(fp); /* Read away the first # */
12958 puts("Fail even to read");
12962 18 <= FILE_cnt(fp) &&
12963 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12965 puts("Fail even to read");
12968 ptr = (char*) FILE_ptr(fp);
12969 cnt = (size_t)FILE_cnt(fp);
12971 FILE_ptr(fp) += 42;
12973 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
12974 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
12977 if (FILE_cnt(fp) <= 20) {
12978 printf ("Fail (<20 chars to test)");
12981 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
12982 puts("Fail compare");
12985 if (cnt == FILE_cnt(fp)) {
12986 puts("Pass_unchanged");
12989 if (FILE_cnt(fp) == (cnt - 42)) {
12990 puts("Pass_changed");
12993 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
12999 if eval $compile && $to try.c; then
13000 case `$run ./try` in
13002 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
13003 d_stdio_ptr_lval_sets_cnt="$define" ;;
13005 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
13006 d_stdio_ptr_lval_nochange_cnt="$define" ;;
13008 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
13010 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
13013 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
13019 : see if _base is also standard
13021 case "$d_stdstdio" in
13025 #$i_stdlib I_STDLIB
13027 #include <stdlib.h>
13029 #define FILE_base(fp) $stdio_base
13030 #define FILE_bufsiz(fp) $stdio_bufsiz
13032 FILE *fp = fopen("try.c", "r");
13035 19 <= FILE_bufsiz(fp) &&
13036 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
13043 if eval $compile && $to try.c; then
13044 if $run ./try; then
13045 echo "And its _base field acts std."
13048 echo "But its _base field isn't std."
13051 echo "However, it seems to be lacking the _base field."
13059 : see if fast_stdio exists
13061 case "$d_stdstdio:$d_stdio_ptr_lval" in
13063 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
13065 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
13076 : see if fchdir exists
13077 set fchdir d_fchdir
13080 : see if fchmod exists
13081 set fchmod d_fchmod
13084 : see if fchown exists
13085 set fchown d_fchown
13088 : see if this is an fcntl system
13092 : See if fcntl-based locking works.
13095 #$i_stdlib I_STDLIB
13097 #include <stdlib.h>
13099 #include <unistd.h>
13101 #include <signal.h>
13102 $signal_t blech(int x) { exit(3); }
13104 #if defined(F_SETLK) && defined(F_SETLKW)
13105 struct flock flock;
13107 fd = open("try.c", O_RDONLY);
13108 flock.l_type = F_RDLCK;
13109 flock.l_whence = SEEK_SET;
13110 flock.l_start = flock.l_len = 0;
13111 signal(SIGALRM, blech);
13113 retval = fcntl(fd, F_SETLK, &flock);
13115 (retval < 0 ? exit(2) : exit(0));
13121 echo "Checking if fcntl-based file locking works... "
13125 if eval $compile_ok; then
13126 if $run ./try; then
13127 echo "Yes, it seems to work."
13130 echo "Nope, it didn't work."
13135 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
13136 *** This is (almost) impossible.
13137 *** If your NFS lock daemons are not feeling well, something like
13138 *** this may happen, please investigate. Cannot continue, aborting.
13146 echo "I'm unable to compile the test program, so I'll assume not."
13151 echo "Nope, since you don't even have fcntl()."
13154 set d_fcntl_can_lock
13158 : check for fd_set items
13161 Checking to see how well your C compiler handles fd_set and friends ...
13164 #$i_stdlib I_STDLIB
13166 #include <stdlib.h>
13168 #$i_systime I_SYS_TIME
13169 #$i_sysselct I_SYS_SELECT
13170 #$d_socket HAS_SOCKET
13171 #include <sys/types.h>
13173 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
13176 #include <sys/time.h>
13178 #ifdef I_SYS_SELECT
13179 #include <sys/select.h>
13188 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
13196 if eval $compile; then
13197 d_fds_bits="$define"
13199 echo "Well, your system knows about the normal fd_set typedef..." >&4
13200 if $run ./try; then
13201 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
13202 d_fd_macros="$define"
13205 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
13207 d_fd_macros="$undef"
13211 Hmm, your compiler has some difficulty with fd_set. Checking further...
13214 if eval $compile; then
13215 d_fds_bits="$undef"
13217 echo "Well, your system has some sort of fd_set available..." >&4
13218 if $run ./try; then
13219 echo "and you have the normal fd_set macros." >&4
13220 d_fd_macros="$define"
13223 but not the normal fd_set macros! Gross! More work for me...
13225 d_fd_macros="$undef"
13228 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
13230 d_fds_bits="$undef"
13231 d_fd_macros="$undef"
13236 : see if fgetpos exists
13237 set fgetpos d_fgetpos
13240 : see if finite exists
13241 set finite d_finite
13244 : see if finitel exists
13245 set finitel d_finitel
13248 : see if flock exists
13252 : see if prototype for flock is available
13254 set d_flockproto flock $i_sysfile sys/file.h
13257 : see if fp_class exists
13258 set fp_class d_fp_class
13261 : see if pathconf exists
13262 set pathconf d_pathconf
13265 : see if fpathconf exists
13266 set fpathconf d_fpathconf
13269 : see if fpclass exists
13270 set fpclass d_fpclass
13273 : see if fpclassify exists
13274 set fpclassify d_fpclassify
13277 : see if fpclassl exists
13278 set fpclassl d_fpclassl
13281 : check for fpos64_t
13283 echo "Checking to see if you have fpos64_t..." >&4
13286 int main() { fpos64_t x = 7; }
13289 if eval $compile; then
13291 echo "You have fpos64_t."
13294 echo "You do not have fpos64_t."
13295 case "$fpossize" in
13296 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
13303 : see if frexpl exists
13304 set frexpl d_frexpl
13307 : see if this is a sys/param system
13308 set sys/param.h i_sysparam
13311 : see if this is a sys/mount.h system
13312 set sys/mount.h i_sysmount
13315 : Check for fs_data_s
13317 echo "Checking to see if your system supports struct fs_data..." >&4
13318 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
13320 case "$d_fs_data_s" in
13321 "$define") echo "Yes, it does." ;;
13322 *) echo "No, it doesn't." ;;
13325 : see if fseeko exists
13326 set fseeko d_fseeko
13328 case "$longsize" in
13329 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
13332 : see if fsetpos exists
13333 set fsetpos d_fsetpos
13336 : see if fstatfs exists
13337 set fstatfs d_fstatfs
13340 : see if statvfs exists
13341 set statvfs d_statvfs
13344 : see if fstatvfs exists
13345 set fstatvfs d_fstatvfs
13349 : see if fsync exists
13353 : see if ftello exists
13354 set ftello d_ftello
13356 case "$longsize" in
13357 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
13360 : check for a working futimes
13363 echo "Checking if you have a working futimes()" >&4
13366 #include <sys/time.h>
13373 fd = open ("try.c", O_RDWR);
13374 if (-1 == fd) exit (1);
13375 rv = futimes (fd, NULL);
13376 exit (rv == -1 ? errno : 0);
13380 if eval $compile; then
13384 0) echo "Yes, you have" >&4
13385 d_futimes="$define"
13387 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
13391 echo "No, it does not (probably harmless)" >&4
13395 : see if ndbm.h is available
13398 : Compatibility location for RedHat 7.1
13399 set gdbm/ndbm.h i_gdbmndbm
13401 : Compatibility location for Debian 4.0
13402 set gdbm-ndbm.h i_gdbm_ndbm
13406 if $test "$i_ndbm" = "$define" -o "$i_gdbmndbm" = "$define" -o "$i_gdbm_ndbm" = "$define"; then
13407 : see if dbm_open exists
13408 set dbm_open d_dbm_open
13410 case "$d_dbm_open" in
13413 i_gdbmndbm="$undef"
13414 i_gdbm_ndbm="$undef"
13415 echo "We won't be including <ndbm.h>"
13425 ndbm_hdr_protochk='name=$1; hdr=$2;
13426 eval "ihdr=\$""i_$name";
13428 if $test "$ihdr" = "$define"; then
13429 $echo "Checking if your <$hdr> uses prototypes..." >&4;
13430 case "$d_cplusplus" in
13431 $define) ./protochk "$extern_C void dbm_close(DBM *);" literal "extern \"C\" {" $ihdr $hdr literal "}" && val="$define" ;;
13432 *) ./protochk "$extern_C void dbm_close(int, int);" $ihdr $hdr || val="$define" ;;
13435 $define) $echo "Your <$hdr> seems to have prototypes";;
13436 *) $echo "Your <$hdr> does not seem to have prototypes";;
13439 set "d_${name}_h_uses_prototypes";
13443 eval $ndbm_hdr_protochk
13444 set gdbmndbm gdbm/ndbm.h
13445 eval $ndbm_hdr_protochk
13446 set gdbm_ndbm gdbm-ndbm.h
13447 eval $ndbm_hdr_protochk
13449 : see if getaddrinfo exists
13450 set getaddrinfo d_getaddrinfo
13453 : see if getcwd exists
13454 set getcwd d_getcwd
13457 : see if getespwnam exists
13458 set getespwnam d_getespwnam
13461 : see if getfsstat exists
13462 set getfsstat d_getfsstat
13465 : see if getgrent exists
13466 set getgrent d_getgrent
13469 : see if getgrent_r exists
13470 set getgrent_r d_getgrent_r
13472 case "$d_getgrent_r" in
13474 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13475 case "$d_getgrent_r_proto:$usethreads" in
13476 ":define") d_getgrent_r_proto=define
13477 set d_getgrent_r_proto getgrent_r $hdrs
13481 case "$d_getgrent_r_proto" in
13483 case "$getgrent_r_proto" in
13484 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
13485 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBWR ;;
13487 case "$getgrent_r_proto" in
13488 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
13489 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIR ;;
13491 case "$getgrent_r_proto" in
13492 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
13493 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBW ;;
13495 case "$getgrent_r_proto" in
13496 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
13497 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBI ;;
13499 case "$getgrent_r_proto" in
13500 ''|0) try='int getgrent_r(struct group*, char*, int);'
13501 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBI ;;
13503 case "$getgrent_r_proto" in
13504 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
13505 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIH ;;
13507 case "$getgrent_r_proto" in
13508 ''|0) d_getgrent_r=undef
13510 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
13511 * ) case "$getgrent_r_proto" in
13512 REENTRANT_PROTO*) ;;
13513 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
13515 echo "Prototype: $try" ;;
13518 *) case "$usethreads" in
13519 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
13526 *) getgrent_r_proto=0
13530 : see if getgrgid_r exists
13531 set getgrgid_r d_getgrgid_r
13533 case "$d_getgrgid_r" in
13535 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13536 case "$d_getgrgid_r_proto:$usethreads" in
13537 ":define") d_getgrgid_r_proto=define
13538 set d_getgrgid_r_proto getgrgid_r $hdrs
13542 case "$d_getgrgid_r_proto" in
13544 case "$getgrgid_r_proto" in
13545 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
13546 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
13548 case "$getgrgid_r_proto" in
13549 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
13550 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
13552 case "$getgrgid_r_proto" in
13553 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
13554 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
13556 case "$getgrgid_r_proto" in
13557 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
13558 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
13560 case "$getgrgid_r_proto" in
13561 ''|0) d_getgrgid_r=undef
13563 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
13564 * ) case "$getgrgid_r_proto" in
13565 REENTRANT_PROTO*) ;;
13566 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
13568 echo "Prototype: $try" ;;
13571 *) case "$usethreads" in
13572 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
13579 *) getgrgid_r_proto=0
13583 : see if getgrnam_r exists
13584 set getgrnam_r d_getgrnam_r
13586 case "$d_getgrnam_r" in
13588 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13589 case "$d_getgrnam_r_proto:$usethreads" in
13590 ":define") d_getgrnam_r_proto=define
13591 set d_getgrnam_r_proto getgrnam_r $hdrs
13595 case "$d_getgrnam_r_proto" in
13597 case "$getgrnam_r_proto" in
13598 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
13599 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
13601 case "$getgrnam_r_proto" in
13602 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
13603 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
13605 case "$getgrnam_r_proto" in
13606 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
13607 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CBI ;;
13609 case "$getgrnam_r_proto" in
13610 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
13611 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
13613 case "$getgrnam_r_proto" in
13614 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
13615 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
13617 case "$getgrnam_r_proto" in
13618 ''|0) d_getgrnam_r=undef
13620 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
13621 * ) case "$getgrnam_r_proto" in
13622 REENTRANT_PROTO*) ;;
13623 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
13625 echo "Prototype: $try" ;;
13628 *) case "$usethreads" in
13629 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
13636 *) getgrnam_r_proto=0
13640 : see if gethostbyaddr exists
13641 set gethostbyaddr d_gethbyaddr
13644 : see if gethostbyname exists
13645 set gethostbyname d_gethbyname
13648 : see if gethostent exists
13649 set gethostent d_gethent
13652 : see how we will look up host name
13655 if set gethostname val -f d_gethname; eval $csym; $val; then
13656 echo 'gethostname() found.' >&4
13657 d_gethname="$define"
13660 if set uname val -f d_uname; eval $csym; $val; then
13663 uname() was found, but you're running xenix, and older versions of xenix
13664 have a broken uname(). If you don't really know whether your xenix is old
13665 enough to have a broken system call, use the default answer.
13670 "$define") dflt=n;;
13672 rp='Is your uname() broken?'
13675 n*) d_uname="$define"; call=uname;;
13678 echo 'uname() found.' >&4
13685 case "$d_gethname" in
13686 '') d_gethname="$undef";;
13689 '') d_uname="$undef";;
13691 case "$d_uname$d_gethname" in
13696 Every now and then someone has a $call() that lies about the hostname
13697 but can't be fixed for political or economic reasons. If you wish, I can
13698 pretend $call() isn't there and maybe compute hostname at run-time
13699 thanks to the '$phostname' command.
13702 rp="Shall I ignore $call() from now on?"
13705 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
13708 case "$phostname" in
13709 '') aphostname='';;
13710 *) case "$aphostname" in
13712 *) set X $phostname
13716 file=`./loc $file $file $pth`
13717 aphostname=`echo $file $*`
13722 case "$d_uname$d_gethname" in
13725 case "$phostname" in
13727 echo "There will be no way for $package to get your hostname." >&4;;
13729 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
13733 case "$d_phostname" in
13734 '') d_phostname="$undef";;
13737 : see if gethostbyaddr_r exists
13738 set gethostbyaddr_r d_gethostbyaddr_r
13740 case "$d_gethostbyaddr_r" in
13742 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13743 case "$d_gethostbyaddr_r_proto:$usethreads" in
13744 ":define") d_gethostbyaddr_r_proto=define
13745 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
13749 case "$d_gethostbyaddr_r_proto" in
13751 case "$gethostbyaddr_r_proto" in
13752 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13753 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
13755 case "$gethostbyaddr_r_proto" in
13756 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
13757 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
13759 case "$gethostbyaddr_r_proto" in
13760 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
13761 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
13763 case "$gethostbyaddr_r_proto" in
13764 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
13765 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
13767 case "$gethostbyaddr_r_proto" in
13768 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
13769 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
13771 case "$gethostbyaddr_r_proto" in
13772 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
13773 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
13775 case "$gethostbyaddr_r_proto" in
13776 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
13777 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
13779 case "$gethostbyaddr_r_proto" in
13780 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
13781 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
13783 case "$gethostbyaddr_r_proto" in
13784 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
13785 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
13787 case "$gethostbyaddr_r_proto" in
13788 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
13789 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
13791 case "$gethostbyaddr_r_proto" in
13792 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13793 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
13795 case "$gethostbyaddr_r_proto" in
13796 ''|0) d_gethostbyaddr_r=undef
13797 gethostbyaddr_r_proto=0
13798 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
13799 * ) case "$gethostbyaddr_r_proto" in
13800 REENTRANT_PROTO*) ;;
13801 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
13803 echo "Prototype: $try" ;;
13806 *) case "$usethreads" in
13807 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
13809 d_gethostbyaddr_r=undef
13810 gethostbyaddr_r_proto=0
13814 *) gethostbyaddr_r_proto=0
13818 : see if gethostbyname_r exists
13819 set gethostbyname_r d_gethostbyname_r
13821 case "$d_gethostbyname_r" in
13823 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13824 case "$d_gethostbyname_r_proto:$usethreads" in
13825 ":define") d_gethostbyname_r_proto=define
13826 set d_gethostbyname_r_proto gethostbyname_r $hdrs
13830 case "$d_gethostbyname_r_proto" in
13832 case "$gethostbyname_r_proto" in
13833 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
13834 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
13836 case "$gethostbyname_r_proto" in
13837 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
13838 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
13840 case "$gethostbyname_r_proto" in
13841 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
13842 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
13844 case "$gethostbyname_r_proto" in
13845 ''|0) d_gethostbyname_r=undef
13846 gethostbyname_r_proto=0
13847 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
13848 * ) case "$gethostbyname_r_proto" in
13849 REENTRANT_PROTO*) ;;
13850 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
13852 echo "Prototype: $try" ;;
13855 *) case "$usethreads" in
13856 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
13858 d_gethostbyname_r=undef
13859 gethostbyname_r_proto=0
13863 *) gethostbyname_r_proto=0
13867 : see if gethostent_r exists
13868 set gethostent_r d_gethostent_r
13870 case "$d_gethostent_r" in
13872 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13873 case "$d_gethostent_r_proto:$usethreads" in
13874 ":define") d_gethostent_r_proto=define
13875 set d_gethostent_r_proto gethostent_r $hdrs
13879 case "$d_gethostent_r_proto" in
13881 case "$gethostent_r_proto" in
13882 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
13883 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
13885 case "$gethostent_r_proto" in
13886 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
13887 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBIE ;;
13889 case "$gethostent_r_proto" in
13890 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
13891 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBIE ;;
13893 case "$gethostent_r_proto" in
13894 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
13895 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBI ;;
13897 case "$gethostent_r_proto" in
13898 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
13899 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBI ;;
13901 case "$gethostent_r_proto" in
13902 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
13903 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SD ;;
13905 case "$gethostent_r_proto" in
13906 ''|0) d_gethostent_r=undef
13907 gethostent_r_proto=0
13908 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
13909 * ) case "$gethostent_r_proto" in
13910 REENTRANT_PROTO*) ;;
13911 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
13913 echo "Prototype: $try" ;;
13916 *) case "$usethreads" in
13917 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
13919 d_gethostent_r=undef
13920 gethostent_r_proto=0
13924 *) gethostent_r_proto=0
13928 : see if prototypes for various gethostxxx netdb.h functions are available
13930 set d_gethostprotos gethostent $i_netdb netdb.h
13933 : see if getitimer exists
13934 set getitimer d_getitimer
13937 : see if getlogin exists
13938 set getlogin d_getlogin
13941 : see if getlogin_r exists
13942 set getlogin_r d_getlogin_r
13944 case "$d_getlogin_r" in
13946 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
13947 case "$d_getlogin_r_proto:$usethreads" in
13948 ":define") d_getlogin_r_proto=define
13949 set d_getlogin_r_proto getlogin_r $hdrs
13953 case "$d_getlogin_r_proto" in
13955 case "$getlogin_r_proto" in
13956 ''|0) try='int getlogin_r(char*, size_t);'
13957 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BW ;;
13959 case "$getlogin_r_proto" in
13960 ''|0) try='int getlogin_r(char*, int);'
13961 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BI ;;
13963 case "$getlogin_r_proto" in
13964 ''|0) try='char* getlogin_r(char*, size_t);'
13965 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BW ;;
13967 case "$getlogin_r_proto" in
13968 ''|0) try='char* getlogin_r(char*, int);'
13969 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BI ;;
13971 case "$getlogin_r_proto" in
13972 ''|0) d_getlogin_r=undef
13974 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
13975 * ) case "$getlogin_r_proto" in
13976 REENTRANT_PROTO*) ;;
13977 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
13979 echo "Prototype: $try" ;;
13982 *) case "$usethreads" in
13983 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
13990 *) getlogin_r_proto=0
13994 : see if getmnt exists
13995 set getmnt d_getmnt
13998 : see if getmntent exists
13999 set getmntent d_getmntent
14002 : see if getnameinfo exists
14003 set getnameinfo d_getnameinfo
14006 : see if getnetbyaddr exists
14007 set getnetbyaddr d_getnbyaddr
14010 : see if getnetbyname exists
14011 set getnetbyname d_getnbyname
14014 : see if getnetent exists
14015 set getnetent d_getnent
14018 : see if getnetbyaddr_r exists
14019 set getnetbyaddr_r d_getnetbyaddr_r
14021 case "$d_getnetbyaddr_r" in
14023 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14024 case "$d_getnetbyaddr_r_proto:$usethreads" in
14025 ":define") d_getnetbyaddr_r_proto=define
14026 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
14030 case "$d_getnetbyaddr_r_proto" in
14032 case "$getnetbyaddr_r_proto" in
14033 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
14034 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
14036 case "$getnetbyaddr_r_proto" in
14037 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
14038 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
14040 case "$getnetbyaddr_r_proto" in
14041 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
14042 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
14044 case "$getnetbyaddr_r_proto" in
14045 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
14046 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
14048 case "$getnetbyaddr_r_proto" in
14049 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
14050 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
14052 case "$getnetbyaddr_r_proto" in
14053 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
14054 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
14056 case "$getnetbyaddr_r_proto" in
14057 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
14058 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
14060 case "$getnetbyaddr_r_proto" in
14061 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
14062 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
14064 case "$getnetbyaddr_r_proto" in
14065 ''|0) d_getnetbyaddr_r=undef
14066 getnetbyaddr_r_proto=0
14067 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
14068 * ) case "$getnetbyaddr_r_proto" in
14069 REENTRANT_PROTO*) ;;
14070 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
14072 echo "Prototype: $try" ;;
14075 *) case "$usethreads" in
14076 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
14078 d_getnetbyaddr_r=undef
14079 getnetbyaddr_r_proto=0
14083 *) getnetbyaddr_r_proto=0
14087 : see if getnetbyname_r exists
14088 set getnetbyname_r d_getnetbyname_r
14090 case "$d_getnetbyname_r" in
14092 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14093 case "$d_getnetbyname_r_proto:$usethreads" in
14094 ":define") d_getnetbyname_r_proto=define
14095 set d_getnetbyname_r_proto getnetbyname_r $hdrs
14099 case "$d_getnetbyname_r_proto" in
14101 case "$getnetbyname_r_proto" in
14102 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
14103 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
14105 case "$getnetbyname_r_proto" in
14106 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
14107 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
14109 case "$getnetbyname_r_proto" in
14110 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
14111 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
14113 case "$getnetbyname_r_proto" in
14114 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
14115 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
14117 case "$getnetbyname_r_proto" in
14118 ''|0) d_getnetbyname_r=undef
14119 getnetbyname_r_proto=0
14120 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
14121 * ) case "$getnetbyname_r_proto" in
14122 REENTRANT_PROTO*) ;;
14123 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
14125 echo "Prototype: $try" ;;
14128 *) case "$usethreads" in
14129 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
14131 d_getnetbyname_r=undef
14132 getnetbyname_r_proto=0
14136 *) getnetbyname_r_proto=0
14140 : see if getnetent_r exists
14141 set getnetent_r d_getnetent_r
14143 case "$d_getnetent_r" in
14145 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14146 case "$d_getnetent_r_proto:$usethreads" in
14147 ":define") d_getnetent_r_proto=define
14148 set d_getnetent_r_proto getnetent_r $hdrs
14152 case "$d_getnetent_r_proto" in
14154 case "$getnetent_r_proto" in
14155 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
14156 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
14158 case "$getnetent_r_proto" in
14159 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
14160 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBIE ;;
14162 case "$getnetent_r_proto" in
14163 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
14164 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBIE ;;
14166 case "$getnetent_r_proto" in
14167 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
14168 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBI ;;
14170 case "$getnetent_r_proto" in
14171 ''|0) try='int getnetent_r(struct netent*, char*, int);'
14172 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBI ;;
14174 case "$getnetent_r_proto" in
14175 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
14176 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SD ;;
14178 case "$getnetent_r_proto" in
14179 ''|0) d_getnetent_r=undef
14180 getnetent_r_proto=0
14181 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
14182 * ) case "$getnetent_r_proto" in
14183 REENTRANT_PROTO*) ;;
14184 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
14186 echo "Prototype: $try" ;;
14189 *) case "$usethreads" in
14190 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
14192 d_getnetent_r=undef
14193 getnetent_r_proto=0
14197 *) getnetent_r_proto=0
14201 : see if prototypes for various getnetxxx netdb.h functions are available
14203 set d_getnetprotos getnetent $i_netdb netdb.h
14206 : see if getpagesize exists
14207 set getpagesize d_getpagsz
14210 : Optional checks for getprotobyname and getprotobynumber
14212 : see if getprotobyname exists
14213 set getprotobyname d_getpbyname
14216 : see if getprotobynumber exists
14217 set getprotobynumber d_getpbynumber
14220 : see if getprotoent exists
14221 set getprotoent d_getpent
14224 : see if getpgid exists
14225 set getpgid d_getpgid
14228 : see if getpgrp2 exists
14229 set getpgrp2 d_getpgrp2
14232 : see if getppid exists
14233 set getppid d_getppid
14236 : see if getpriority exists
14237 set getpriority d_getprior
14240 : see if getprotobyname_r exists
14241 set getprotobyname_r d_getprotobyname_r
14243 case "$d_getprotobyname_r" in
14245 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14246 case "$d_getprotobyname_r_proto:$usethreads" in
14247 ":define") d_getprotobyname_r_proto=define
14248 set d_getprotobyname_r_proto getprotobyname_r $hdrs
14252 case "$d_getprotobyname_r_proto" in
14254 case "$getprotobyname_r_proto" in
14255 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
14256 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
14258 case "$getprotobyname_r_proto" in
14259 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
14260 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
14262 case "$getprotobyname_r_proto" in
14263 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
14264 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
14266 case "$getprotobyname_r_proto" in
14267 ''|0) d_getprotobyname_r=undef
14268 getprotobyname_r_proto=0
14269 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
14270 * ) case "$getprotobyname_r_proto" in
14271 REENTRANT_PROTO*) ;;
14272 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
14274 echo "Prototype: $try" ;;
14277 *) case "$usethreads" in
14278 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
14280 d_getprotobyname_r=undef
14281 getprotobyname_r_proto=0
14285 *) getprotobyname_r_proto=0
14289 : see if getprotobynumber_r exists
14290 set getprotobynumber_r d_getprotobynumber_r
14292 case "$d_getprotobynumber_r" in
14294 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14295 case "$d_getprotobynumber_r_proto:$usethreads" in
14296 ":define") d_getprotobynumber_r_proto=define
14297 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
14301 case "$d_getprotobynumber_r_proto" in
14303 case "$getprotobynumber_r_proto" in
14304 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
14305 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
14307 case "$getprotobynumber_r_proto" in
14308 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
14309 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
14311 case "$getprotobynumber_r_proto" in
14312 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
14313 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
14315 case "$getprotobynumber_r_proto" in
14316 ''|0) d_getprotobynumber_r=undef
14317 getprotobynumber_r_proto=0
14318 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
14319 * ) case "$getprotobynumber_r_proto" in
14320 REENTRANT_PROTO*) ;;
14321 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
14323 echo "Prototype: $try" ;;
14326 *) case "$usethreads" in
14327 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
14329 d_getprotobynumber_r=undef
14330 getprotobynumber_r_proto=0
14334 *) getprotobynumber_r_proto=0
14338 : see if getprotoent_r exists
14339 set getprotoent_r d_getprotoent_r
14341 case "$d_getprotoent_r" in
14343 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14344 case "$d_getprotoent_r_proto:$usethreads" in
14345 ":define") d_getprotoent_r_proto=define
14346 set d_getprotoent_r_proto getprotoent_r $hdrs
14350 case "$d_getprotoent_r_proto" in
14352 case "$getprotoent_r_proto" in
14353 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
14354 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
14356 case "$getprotoent_r_proto" in
14357 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
14358 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBI ;;
14360 case "$getprotoent_r_proto" in
14361 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
14362 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=S_SBI ;;
14364 case "$getprotoent_r_proto" in
14365 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
14366 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SD ;;
14368 case "$getprotoent_r_proto" in
14369 ''|0) d_getprotoent_r=undef
14370 getprotoent_r_proto=0
14371 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
14372 * ) case "$getprotoent_r_proto" in
14373 REENTRANT_PROTO*) ;;
14374 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
14376 echo "Prototype: $try" ;;
14379 *) case "$usethreads" in
14380 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
14382 d_getprotoent_r=undef
14383 getprotoent_r_proto=0
14387 *) getprotoent_r_proto=0
14391 : see if prototypes for various getprotoxxx netdb.h functions are available
14393 set d_getprotoprotos getprotoent $i_netdb netdb.h
14396 : see if getprpwnam exists
14397 set getprpwnam d_getprpwnam
14400 : see if getpwent exists
14401 set getpwent d_getpwent
14404 : see if getpwent_r exists
14405 set getpwent_r d_getpwent_r
14407 case "$d_getpwent_r" in
14409 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14410 case "$d_getpwent_r_proto:$usethreads" in
14411 ":define") d_getpwent_r_proto=define
14412 set d_getpwent_r_proto getpwent_r $hdrs
14416 case "$d_getpwent_r_proto" in
14418 case "$getpwent_r_proto" in
14419 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
14420 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBWR ;;
14422 case "$getpwent_r_proto" in
14423 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
14424 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIR ;;
14426 case "$getpwent_r_proto" in
14427 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
14428 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBW ;;
14430 case "$getpwent_r_proto" in
14431 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
14432 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBI ;;
14434 case "$getpwent_r_proto" in
14435 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
14436 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBI ;;
14438 case "$getpwent_r_proto" in
14439 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
14440 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIH ;;
14442 case "$getpwent_r_proto" in
14443 ''|0) d_getpwent_r=undef
14445 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
14446 * ) case "$getpwent_r_proto" in
14447 REENTRANT_PROTO*) ;;
14448 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
14450 echo "Prototype: $try" ;;
14453 *) case "$usethreads" in
14454 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
14461 *) getpwent_r_proto=0
14465 : see if getpwnam_r exists
14466 set getpwnam_r d_getpwnam_r
14468 case "$d_getpwnam_r" in
14470 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14471 case "$d_getpwnam_r_proto:$usethreads" in
14472 ":define") d_getpwnam_r_proto=define
14473 set d_getpwnam_r_proto getpwnam_r $hdrs
14477 case "$d_getpwnam_r_proto" in
14479 case "$getpwnam_r_proto" in
14480 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
14481 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
14483 case "$getpwnam_r_proto" in
14484 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
14485 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
14487 case "$getpwnam_r_proto" in
14488 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
14489 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
14491 case "$getpwnam_r_proto" in
14492 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
14493 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
14495 case "$getpwnam_r_proto" in
14496 ''|0) d_getpwnam_r=undef
14498 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
14499 * ) case "$getpwnam_r_proto" in
14500 REENTRANT_PROTO*) ;;
14501 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
14503 echo "Prototype: $try" ;;
14506 *) case "$usethreads" in
14507 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
14514 *) getpwnam_r_proto=0
14518 : see if getpwuid_r exists
14519 set getpwuid_r d_getpwuid_r
14521 case "$d_getpwuid_r" in
14523 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14524 case "$d_getpwuid_r_proto:$usethreads" in
14525 ":define") d_getpwuid_r_proto=define
14526 set d_getpwuid_r_proto getpwuid_r $hdrs
14530 case "$d_getpwuid_r_proto" in
14532 case "$getpwuid_r_proto" in
14533 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
14534 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
14536 case "$getpwuid_r_proto" in
14537 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
14538 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
14540 case "$getpwuid_r_proto" in
14541 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
14542 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
14544 case "$getpwuid_r_proto" in
14545 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
14546 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
14548 case "$getpwuid_r_proto" in
14549 ''|0) d_getpwuid_r=undef
14551 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
14552 * ) case "$getpwuid_r_proto" in
14553 REENTRANT_PROTO*) ;;
14554 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
14556 echo "Prototype: $try" ;;
14559 *) case "$usethreads" in
14560 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
14567 *) getpwuid_r_proto=0
14571 : Optional checks for getsbyname and getsbyport
14573 : see if getservbyname exists
14574 set getservbyname d_getsbyname
14577 : see if getservbyport exists
14578 set getservbyport d_getsbyport
14581 : see if getservent exists
14582 set getservent d_getsent
14585 : see if getservbyname_r exists
14586 set getservbyname_r d_getservbyname_r
14588 case "$d_getservbyname_r" in
14590 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14591 case "$d_getservbyname_r_proto:$usethreads" in
14592 ":define") d_getservbyname_r_proto=define
14593 set d_getservbyname_r_proto getservbyname_r $hdrs
14597 case "$d_getservbyname_r_proto" in
14599 case "$getservbyname_r_proto" in
14600 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
14601 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
14603 case "$getservbyname_r_proto" in
14604 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
14605 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
14607 case "$getservbyname_r_proto" in
14608 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
14609 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
14611 case "$getservbyname_r_proto" in
14612 ''|0) d_getservbyname_r=undef
14613 getservbyname_r_proto=0
14614 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
14615 * ) case "$getservbyname_r_proto" in
14616 REENTRANT_PROTO*) ;;
14617 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
14619 echo "Prototype: $try" ;;
14622 *) case "$usethreads" in
14623 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
14625 d_getservbyname_r=undef
14626 getservbyname_r_proto=0
14630 *) getservbyname_r_proto=0
14634 : see if getservbyport_r exists
14635 set getservbyport_r d_getservbyport_r
14637 case "$d_getservbyport_r" in
14639 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14640 case "$d_getservbyport_r_proto:$usethreads" in
14641 ":define") d_getservbyport_r_proto=define
14642 set d_getservbyport_r_proto getservbyport_r $hdrs
14646 case "$d_getservbyport_r_proto" in
14648 case "$getservbyport_r_proto" in
14649 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
14650 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
14652 case "$getservbyport_r_proto" in
14653 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
14654 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
14656 case "$getservbyport_r_proto" in
14657 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
14658 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
14660 case "$getservbyport_r_proto" in
14661 ''|0) d_getservbyport_r=undef
14662 getservbyport_r_proto=0
14663 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
14664 * ) case "$getservbyport_r_proto" in
14665 REENTRANT_PROTO*) ;;
14666 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
14668 echo "Prototype: $try" ;;
14671 *) case "$usethreads" in
14672 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
14674 d_getservbyport_r=undef
14675 getservbyport_r_proto=0
14679 *) getservbyport_r_proto=0
14683 : see if getservent_r exists
14684 set getservent_r d_getservent_r
14686 case "$d_getservent_r" in
14688 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14689 case "$d_getservent_r_proto:$usethreads" in
14690 ":define") d_getservent_r_proto=define
14691 set d_getservent_r_proto getservent_r $hdrs
14695 case "$d_getservent_r_proto" in
14697 case "$getservent_r_proto" in
14698 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
14699 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBWR ;;
14701 case "$getservent_r_proto" in
14702 ''|0) try='int getservent_r(struct servent*, char*, int);'
14703 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBI ;;
14705 case "$getservent_r_proto" in
14706 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
14707 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=S_SBI ;;
14709 case "$getservent_r_proto" in
14710 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
14711 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SD ;;
14713 case "$getservent_r_proto" in
14714 ''|0) d_getservent_r=undef
14715 getservent_r_proto=0
14716 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
14717 * ) case "$getservent_r_proto" in
14718 REENTRANT_PROTO*) ;;
14719 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
14721 echo "Prototype: $try" ;;
14724 *) case "$usethreads" in
14725 define) echo "getservent_r has no prototype, not using it." >&4 ;;
14727 d_getservent_r=undef
14728 getservent_r_proto=0
14732 *) getservent_r_proto=0
14736 : see if prototypes for various getservxxx netdb.h functions are available
14738 set d_getservprotos getservent $i_netdb netdb.h
14741 : see if getspnam exists
14742 set getspnam d_getspnam
14745 : see if this is a shadow.h system
14746 set shadow.h i_shadow
14749 : see if getspnam_r exists
14750 set getspnam_r d_getspnam_r
14752 case "$d_getspnam_r" in
14754 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
14755 case "$d_getspnam_r_proto:$usethreads" in
14756 ":define") d_getspnam_r_proto=define
14757 set d_getspnam_r_proto getspnam_r $hdrs
14761 case "$d_getspnam_r_proto" in
14763 case "$getspnam_r_proto" in
14764 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
14765 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
14767 case "$getspnam_r_proto" in
14768 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
14769 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=S_CSBI ;;
14771 case "$getspnam_r_proto" in
14772 ''|0) d_getspnam_r=undef
14774 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
14775 * ) case "$getspnam_r_proto" in
14776 REENTRANT_PROTO*) ;;
14777 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
14779 echo "Prototype: $try" ;;
14782 *) case "$usethreads" in
14783 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
14790 *) getspnam_r_proto=0
14794 : see if gettimeofday or ftime exists
14795 set gettimeofday d_gettimeod
14797 case "$d_gettimeod" in
14803 val="$undef"; set d_ftime; eval $setvar
14806 case "$d_gettimeod$d_ftime" in
14809 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
14813 : see if gmtime_r exists
14814 set gmtime_r d_gmtime_r
14816 case "$d_gmtime_r" in
14818 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14819 case "$d_gmtime_r_proto:$usethreads" in
14820 ":define") d_gmtime_r_proto=define
14821 set d_gmtime_r_proto gmtime_r $hdrs
14825 case "$d_gmtime_r_proto" in
14827 case "$gmtime_r_proto" in
14828 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
14829 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=S_TS ;;
14831 case "$gmtime_r_proto" in
14832 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
14833 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=I_TS ;;
14835 case "$gmtime_r_proto" in
14836 ''|0) d_gmtime_r=undef
14838 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
14839 * ) case "$gmtime_r_proto" in
14840 REENTRANT_PROTO*) ;;
14841 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
14843 echo "Prototype: $try" ;;
14846 *) case "$usethreads" in
14847 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
14854 *) gmtime_r_proto=0
14858 : see if hasmntopt exists
14859 set hasmntopt d_hasmntopt
14862 : see if this is a netinet/in.h or sys/in.h system
14863 set netinet/in.h i_niin sys/in.h i_sysin
14866 : see if arpa/inet.h has to be included
14867 set arpa/inet.h i_arpainet
14870 : see if htonl --and friends-- exists
14875 : Maybe they are macros.
14878 $cat >htonl.c <<EOM
14880 #include <sys/types.h>
14881 #$i_niin I_NETINET_IN
14883 #$i_arpainet I_ARPA_INET
14884 #ifdef I_NETINET_IN
14885 #include <netinet/in.h>
14888 #include <sys/in.h>
14891 #include <arpa/inet.h>
14894 printf("Defined as a macro.");
14897 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
14898 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
14900 echo "But it seems to be defined as a macro." >&4
14908 : see if ilogbl exists
14909 set ilogbl d_ilogbl
14914 if set index val -f; eval $csym; $val; then
14915 if set strchr val -f d_strchr; eval $csym; $val; then
14916 if $contains strchr "$strings" >/dev/null 2>&1 ; then
14919 echo "strchr() found." >&4
14923 echo "index() found." >&4
14928 echo "index() found." >&4
14931 if set strchr val -f d_strchr; eval $csym; $val; then
14934 echo "strchr() found." >&4
14936 echo "No index() or strchr() found!" >&4
14941 set d_strchr; eval $setvar
14943 set d_index; eval $setvar
14945 : check whether inet_aton exists
14946 set inet_aton d_inetaton
14949 : see if inet_ntop exists
14950 set inet_ntop d_inetntop
14953 : see if inet_pton exists
14954 set inet_pton d_inetpton
14959 $cat >isascii.c <<EOCP
14962 #$i_stdlib I_STDLIB
14964 #include <stdlib.h>
14975 if eval $compile; then
14976 echo "isascii() found." >&4
14979 echo "isascii() NOT found." >&4
14986 : see if isfinite exists
14987 set isfinite d_isfinite
14990 : see if isinf exists
14994 : see if isnan exists
14998 : see if isnanl exists
14999 set isnanl d_isnanl
15002 : see if killpg exists
15003 set killpg d_killpg
15006 : see if lchown exists
15008 $cat > try.c <<'EOCP'
15009 /* System header to define __stub macros and hopefully few prototypes,
15010 which can conflict with char lchown(); below. */
15011 #include <assert.h>
15012 /* Override any gcc2 internal prototype to avoid an error. */
15013 /* We use char because int might match the return type of a gcc2
15014 builtin and then its argument prototype would still apply. */
15017 /* The GNU C library defines this for functions which it implements
15018 to always fail with ENOSYS. Some functions are actually named
15019 something starting with __ and the normal name is an alias. */
15020 #if defined (__stub_lchown) || defined (__stub___lchown)
15028 if eval $compile; then
15029 $echo "lchown() found." >&4
15032 $echo "lchown() NOT found." >&4
15038 : See if number of significant digits in a double precision number is known
15040 $cat >ldbl_dig.c <<EOM
15041 #$i_limits I_LIMITS
15044 #include <limits.h>
15050 printf("Contains LDBL_DIG");
15053 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
15054 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
15055 echo "LDBL_DIG found." >&4
15058 echo "LDBL_DIG NOT found." >&4
15065 : see if this is a math.h system
15069 : check to see if math.h defines _LIB_VERSION
15070 d_libm_lib_version="$undef"
15074 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
15076 #include <unistd.h>
15078 int main (int argc, char *argv[])
15080 printf ("%d\n", _LIB_VERSION);
15085 if eval $compile; then
15087 echo "Yes, it does ($foo)" >&4
15088 d_libm_lib_version="$define"
15090 echo "No, it does not (probably harmless)" >&4
15097 : see if link exists
15101 : see if localtime_r exists
15102 set localtime_r d_localtime_r
15104 case "$d_localtime_r" in
15106 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15107 case "$d_localtime_r_proto:$usethreads" in
15108 ":define") d_localtime_r_proto=define
15109 set d_localtime_r_proto localtime_r $hdrs
15113 case "$d_localtime_r_proto" in
15115 case "$localtime_r_proto" in
15116 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
15117 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=S_TS ;;
15119 case "$localtime_r_proto" in
15120 ''|0) try='int localtime_r(const time_t*, struct tm*);'
15121 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=I_TS ;;
15123 case "$localtime_r_proto" in
15124 ''|0) d_localtime_r=undef
15125 localtime_r_proto=0
15126 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
15127 * ) case "$localtime_r_proto" in
15128 REENTRANT_PROTO*) ;;
15129 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
15131 echo "Prototype: $try" ;;
15134 *) case "$usethreads" in
15135 define) echo "localtime_r has no prototype, not using it." >&4 ;;
15137 d_localtime_r=undef
15138 localtime_r_proto=0
15142 *) localtime_r_proto=0
15146 : see if localtime_r calls tzset
15147 case "$localtime_r_proto" in
15150 /* Does our libc's localtime_r call tzset ?
15151 * return 0 if so, 1 otherwise.
15153 #$i_systypes I_SYS_TYPES
15154 #$i_unistd I_UNISTD
15156 #$i_stdlib I_STDLIB
15157 #$i_string I_STRING
15158 #$i_malloc I_MALLOC
15160 # include <sys/types.h>
15163 # include <unistd.h>
15169 #include <stdlib.h>
15172 # include <string.h>
15174 # include <strings.h>
15177 # include <malloc.h>
15181 time_t t = time(0L);
15182 char w_tz[]="TZ" "=GMT+5",
15183 e_tz[]="TZ" "=GMT-5",
15184 *tz_e = (char*)malloc(16),
15185 *tz_w = (char*)malloc(16);
15186 struct tm tm_e, tm_w;
15187 memset(&tm_e,'\0',sizeof(struct tm));
15188 memset(&tm_w,'\0',sizeof(struct tm));
15193 localtime_r(&t, &tm_e);
15196 localtime_r(&t, &tm_w);
15198 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
15204 if eval $compile; then
15205 if $run ./try; then
15206 d_localtime_r_needs_tzset=undef;
15208 d_localtime_r_needs_tzset=define;
15211 d_localtime_r_needs_tzset=undef;
15215 d_localtime_r_needs_tzset=undef;
15220 : see if localeconv exists
15221 set localeconv d_locconv
15224 : see if lockf exists
15228 : see if prototype for lseek is available
15230 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
15233 : see if lstat exists
15237 : see if madvise exists
15238 set madvise d_madvise
15241 : see if malloc_size exists
15242 set malloc_size d_malloc_size
15245 : see if malloc_size_good exists
15246 set malloc_good_size d_malloc_good_size
15249 : see if mblen exists
15253 : see if mbstowcs exists
15254 set mbstowcs d_mbstowcs
15257 : see if mbtowc exists
15258 set mbtowc d_mbtowc
15261 : see if memchr exists
15262 set memchr d_memchr
15265 : see if memcmp exists
15266 set memcmp d_memcmp
15269 : see if memcpy exists
15270 set memcpy d_memcpy
15273 : see if memmove exists
15274 set memmove d_memmove
15277 : see if memset exists
15278 set memset d_memset
15281 : see if mkdir exists
15285 : see if mkdtemp exists
15286 set mkdtemp d_mkdtemp
15289 : see if mkfifo exists
15290 set mkfifo d_mkfifo
15293 : see if mkstemp exists
15294 set mkstemp d_mkstemp
15297 : see if mkstemps exists
15298 set mkstemps d_mkstemps
15301 : see if mktime exists
15302 set mktime d_mktime
15305 : see if this is a sys/mman.h system
15306 set sys/mman.h i_sysmman
15309 : see if mmap exists
15312 : see what shmat returns
15313 : default to something harmless
15315 case "$i_sysmman$d_mmap" in
15317 $cat >mmap.c <<'END'
15318 #include <sys/mman.h>
15321 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
15326 echo "and it returns ($mmaptype)." >&4
15332 : see if sqrtl exists
15336 : see if scalbnl exists
15337 set scalbnl d_scalbnl
15340 : see if modfl exists
15344 : see if prototype for modfl is available
15346 set d_modflproto modfl $i_math math.h
15349 d_modfl_pow32_bug="$undef"
15351 case "$d_longdbl$d_modfl" in
15354 Checking to see whether your modfl() is okay for large values...
15360 if $test "X$d_modflproto" != "X$define"; then
15361 $cat >>try.c <<EOCP
15362 /* Sigh. many current glibcs provide the function, but do not prototype it. */
15363 long double modfl (long double, long double *);
15366 $cat >>try.c <<EOCP
15368 long double nv = 4294967303.15;
15374 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
15378 case "$osname:$gccversion" in
15379 aix:) saveccflags="$ccflags"
15380 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
15383 if eval $compile; then
15386 *" 4294967303.150000 1.150000 4294967302.000000")
15387 echo >&4 "Your modfl() is broken for large values."
15388 d_modfl_pow32_bug="$define"
15390 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
15394 *" 4294967303.150000 0.150000 4294967303.000000")
15395 echo >&4 "Your modfl() seems okay for large values."
15397 *) echo >&4 "I don't understand your modfl() at all."
15403 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
15406 case "$osname:$gccversion" in
15407 aix:) ccflags="$saveccflags" ;; # restore
15412 if $test "$uselongdouble" = "$define"; then
15414 if $test "$d_sqrtl" != "$define"; then
15415 message="$message sqrtl"
15417 if $test "$d_modfl" != "$define"; then
15418 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
15419 echo "You have both aintl and copysignl, so I can emulate modfl."
15421 message="$message modfl"
15424 if $test "$d_frexpl" != "$define"; then
15425 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
15426 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
15428 message="$message frexpl"
15432 if $test "$message" != ""; then
15435 *** You requested the use of long doubles but you do not seem to have
15436 *** the following mathematical functions needed for long double support:
15438 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
15439 *** Cannot continue, aborting.
15447 : see if mprotect exists
15448 set mprotect d_mprotect
15451 : see if msgctl exists
15452 set msgctl d_msgctl
15455 : see if msgget exists
15456 set msgget d_msgget
15459 : see if msgsnd exists
15460 set msgsnd d_msgsnd
15463 : see if msgrcv exists
15464 set msgrcv d_msgrcv
15467 : see how much of the 'msg*(2)' library is present.
15470 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
15471 *"$undef"*) h_msg=false;;
15475 case "`ipcs 2>&1`" in
15476 "SVID messages"*"not configured"*)
15477 echo "Your $osname does not have the msg*(2) configured." >&4
15480 set msgctl d_msgctl
15482 set msgget d_msgget
15484 set msgsnd d_msgsnd
15486 set msgrcv d_msgrcv
15492 : we could also check for sys/ipc.h ...
15493 if $h_msg && $test `./findhdr sys/msg.h`; then
15494 echo "You have the full msg*(2) library." >&4
15497 echo "You don't have the full msg*(2) library." >&4
15503 : Check for msghdr_s
15505 echo "Checking to see if your system supports struct msghdr..." >&4
15506 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
15508 case "$d_msghdr_s" in
15509 "$define") echo "Yes, it does." ;;
15510 *) echo "No, it doesn't." ;;
15514 : see if msync exists
15518 : see if munmap exists
15519 set munmap d_munmap
15522 : see if nice exists
15526 : see if this is a langinfo.h system
15527 set langinfo.h i_langinfo
15530 : see if nl_langinfo exists
15531 set nl_langinfo d_nl_langinfo
15534 : check for volatile keyword
15536 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
15537 $cat >try.c <<'EOCP'
15540 typedef struct _goo_struct goo_struct;
15541 goo_struct * volatile goo = ((goo_struct *)0);
15542 struct _goo_struct {
15547 typedef unsigned short foo_t;
15548 char *volatile foo;
15550 volatile foo_t blech;
15554 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
15556 echo "Yup, it does."
15559 echo "Nope, it doesn't."
15565 : Check basic sizes
15567 $echo "Choosing the C types to be used for Perl's internal types..." >&4
15569 case "$use64bitint:$d_quad:$quadtype" in
15572 uvtype="$uquadtype"
15577 uvtype="unsigned long"
15583 case "$uselongdouble:$d_longdbl" in
15585 nvtype="long double"
15586 nvsize=$longdblsize
15593 $echo "(IV will be "$ivtype", $ivsize bytes)"
15594 $echo "(UV will be "$uvtype", $uvsize bytes)"
15595 $echo "(NV will be "$nvtype", $nvsize bytes)"
15598 #$i_inttypes I_INTTYPES
15600 #include <inttypes.h>
15605 int8_t i = INT8_MAX;
15606 uint8_t u = UINT8_MAX;
15607 printf("int8_t\n");
15610 int16_t i = INT16_MAX;
15611 uint16_t i = UINT16_MAX;
15612 printf("int16_t\n");
15615 int32_t i = INT32_MAX;
15616 uint32_t u = UINT32_MAX;
15617 printf("int32_t\n");
15622 i8type="signed char"
15623 u8type="unsigned char"
15628 '') case "$shortsize" in
15630 u16type="unsigned short"
15638 '') set try -DINT16
15639 if eval $compile; then
15640 case "`$run ./try`" in
15652 '') if $test $shortsize -ge 2; then
15654 u16type="unsigned short"
15662 '') case "$longsize" in
15664 u32type="unsigned long"
15668 *) case "$intsize" in
15670 u32type="unsigned int"
15680 '') set try -DINT32
15681 if eval $compile; then
15682 case "`$run ./try`" in
15694 '') if $test $intsize -ge 4; then
15696 u32type="unsigned int"
15704 '') case "$d_quad:$quadtype" in
15706 i64type="$quadtype"
15707 u64type="$uquadtype"
15715 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
15716 : volatile so that the compiler has to store it out to memory.
15717 if test X"$d_volatile" = X"$define"; then
15722 #$i_stdlib I_STDLIB
15724 #include <stdlib.h>
15726 #include <sys/types.h>
15727 #include <signal.h>
15729 $volatile int bletched = 0;
15730 $signal_t blech(int s) { bletched = 1; }
15735 int n = 8 * $uvsize;
15738 signal(SIGFPE, blech);
15741 for (i = 0; i < n; i++) {
15742 u = u << 1 | ($uvtype)1;
15744 if (($uvtype)d != u)
15748 d = ($nvtype)(u - 1);
15749 if (($uvtype)d != (u - 1))
15756 printf("%d\n", ((i == n) ? -n : i));
15762 d_nv_preserves_uv="$undef"
15763 if eval $compile; then
15764 nv_preserves_uv_bits="`$run ./try`"
15766 case "$nv_preserves_uv_bits" in
15768 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
15769 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
15770 d_nv_preserves_uv="$define"
15772 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
15773 d_nv_preserves_uv="$undef" ;;
15774 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
15775 nv_preserves_uv_bits="0" ;;
15779 $echo "Checking to find the largest integer value your NVs can hold..." >&4
15780 : volatile so that the compiler has to store it out to memory.
15781 if test X"$d_volatile" = X"$define"; then
15787 typedef $nvtype NV;
15794 while(count < 256) {
15795 $volatile NV up = value + 1.0;
15796 $volatile NV negated = -value;
15797 $volatile NV down = negated - 1.0;
15798 $volatile NV got_up = up - value;
15799 int up_good = got_up == 1.0;
15800 int got_down = down - negated;
15801 int down_good = got_down == -1.0;
15803 if (down_good != up_good) {
15805 "Inconsistency - up %d %f; down %d %f; for 2**%d (%.20f)\n",
15806 up_good, (double) got_up, down_good, (double) got_down,
15807 count, (double) value);
15814 fputs("256.0", stdout);
15817 fputs("2.0", stdout);
15823 fputs("*", stdout);
15829 fprintf(stderr, "Cannot overflow integer range, even at 2**%d (%.20f)\n",
15830 count, (double) value);
15836 nv_overflows_integers_at='0'
15837 if eval $compile; then
15843 The largest integer your NVs can preserve is equal to $xxx
15845 nv_overflows_integers_at="$xxx"
15848 Cannot determine the largest integer value your NVs can hold, unexpected output
15855 Cannot determine the largest integer value your NVs can hold
15862 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
15863 : volatile so that the compiler has to store it out to memory.
15864 if test X"$d_volatile" = X"$define"; then
15869 #$i_stdlib I_STDLIB
15871 #include <stdlib.h>
15873 #$i_string I_STRING
15875 # include <string.h>
15877 # include <strings.h>
15879 #include <sys/types.h>
15880 #include <signal.h>
15882 $volatile int bletched = 0;
15883 $signal_t blech(int s) { bletched = 1; }
15886 int checkit($nvtype d, char *where) {
15887 unsigned char *p = (char *)&d;
15888 unsigned char *end = p + sizeof(d);
15898 printf("No - %s: 0x", where);
15900 printf ("%02X", *p++);
15905 int main(int argc, char **argv) {
15908 fail += checkit(d, "0.0");
15910 /* The compiler shouldn't be assuming that bletched is 0 */
15913 fail += checkit(d, "bleched");
15916 signal(SIGFPE, blech);
15919 /* Paranoia - the compiler should have no way of knowing that ANSI says
15920 that argv[argc] will always be NULL. Actually, if it did assume this it
15921 would be buggy, as this is C and main() can be called from elsewhere in
15923 d = argv[argc] ? 1 : 0;
15926 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
15929 fail += checkit(d, "ternary");
15931 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
15934 printf("No - memset doesn't give 0.0\n");
15935 /* This might just blow up: */
15936 printf("(gives %g)\n", d);
15942 printf("No - something bleched\n");
15947 printf("No - %d fail(s)\n", fail);
15956 d_nv_zero_is_allbits_zero="$undef"
15957 if eval $compile; then
15963 0.0 is represented as all bits zero in memory
15965 d_nv_zero_is_allbits_zero="$define"
15968 0.0 is not represented as all bits zero in memory
15970 d_nv_zero_is_allbits_zero="$undef"
15975 0.0 is not represented as all bits zero in memory
15977 d_nv_zero_is_allbits_zero="$undef"
15983 : check for off64_t
15985 echo "Checking to see if you have off64_t..." >&4
15987 #include <sys/types.h>
15988 #include <unistd.h>
15989 int main() { off64_t x = 7; }
15992 if eval $compile; then
15994 echo "You have off64_t."
15997 echo "You do not have off64_t."
15998 case "$lseeksize" in
15999 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
16006 : how to create joinable pthreads
16007 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
16009 echo "Checking what constant to use for creating joinable pthreads..." >&4
16010 $cat >try.c <<'EOCP'
16011 #include <pthread.h>
16013 int detachstate = JOINABLE;
16016 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
16017 if eval $compile; then
16018 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
16019 val="$undef" # Yes, undef.
16020 set d_old_pthread_create_joinable
16023 set old_pthread_create_joinable
16026 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
16027 if eval $compile; then
16028 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
16030 set d_old_pthread_create_joinable
16032 val=PTHREAD_CREATE_UNDETACHED
16033 set old_pthread_create_joinable
16036 set try -DJOINABLE=__UNDETACHED
16037 if eval $compile; then
16038 echo "You seem to use __UNDETACHED." >&4
16040 set d_old_pthread_create_joinable
16043 set old_pthread_create_joinable
16046 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
16048 set d_old_pthread_create_joinable
16051 set old_pthread_create_joinable
16058 d_old_pthread_create_joinable="$undef"
16059 old_pthread_create_joinable=""
16062 : see if pause exists
16066 : see if poll exists
16070 : see if prctl exists
16074 : see if prctl supports PR_SET_NAME
16075 d_prctl_set_name=$undef
16079 #include <sys/prctl.h>
16081 int main (int argc, char *argv[])
16083 return (prctl (PR_SET_NAME, "Test"));
16087 if eval $compile_ok && $run ./try; then
16088 echo "Your prctl (PR_SET_NAME, ...) works"
16089 d_prctl_set_name=$define
16095 : see if readlink exists
16096 set readlink d_readlink
16099 : Check if exe is symlink to abs path of executing program
16103 case "$d_readlink" in
16105 if $issymlink /proc/self/exe ; then
16106 $ls -l /proc/self/exe > reflect
16107 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
16108 echo "You have Linux-like /proc/self/exe."
16109 procselfexe='"/proc/self/exe"'
16113 if $issymlink /proc/curproc/file ; then
16114 $ls -l /proc/curproc/file > reflect
16115 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
16116 echo "You have BSD-like /proc/curproc/file."
16117 procselfexe='"/proc/curproc/file"'
16127 : backward compatibility for d_hvfork
16128 if test X$d_hvfork != X; then
16129 d_vfork="$d_hvfork"
16132 : see if there is a vfork
16137 d_pseudofork=$undef
16139 : Ok, but do we want to use it. vfork is reportedly unreliable in
16140 : perl on Solaris 2.x, and probably elsewhere.
16144 case "$usevfork" in
16150 Perl can only use a vfork() that doesn't suffer from strict
16151 restrictions on calling functions or modifying global data in
16152 the child. For example, glibc-2.1 contains such a vfork()
16153 that is unsuitable. If your system provides a proper fork()
16154 call, chances are that you do NOT want perl to use vfork().
16157 rp="Do you still want to use vfork()?"
16162 echo "Ok, we won't use vfork()."
16171 $define) usevfork='true';;
16172 *) usevfork='false';;
16175 : see whether the pthread_atfork exists
16177 #include <pthread.h>
16180 #ifdef PTHREAD_ATFORK
16181 pthread_atfork(NULL,NULL,NULL);
16186 : see if pthread_atfork exists
16187 set try -DPTHREAD_ATFORK
16188 if eval $compile; then
16193 case "$usethreads" in
16196 $define) echo 'pthread_atfork found.' >&4 ;;
16197 *) echo 'pthread_atfork NOT found.' >&4 ;;
16200 set d_pthread_atfork
16203 : see if pthread_attr_setscope exists
16204 set pthread_attr_setscope d_pthread_attr_setscope
16207 : see whether the various POSIXish _yields exist
16209 #include <pthread.h>
16215 #ifdef PTHREAD_YIELD
16218 #ifdef PTHREAD_YIELD_NULL
16219 pthread_yield(NULL);
16225 : see if sched_yield exists
16226 set try -DSCHED_YIELD
16227 if eval $compile; then
16229 sched_yield='sched_yield()'
16233 case "$usethreads" in
16236 $define) echo 'sched_yield() found.' >&4 ;;
16237 *) echo 'sched_yield() NOT found.' >&4 ;;
16243 : see if pthread_yield exists
16244 set try -DPTHREAD_YIELD
16245 if eval $compile; then
16247 case "$sched_yield" in
16248 '') sched_yield='pthread_yield()' ;;
16251 set try -DPTHREAD_YIELD_NULL
16252 if eval $compile; then
16254 case "$sched_yield" in
16255 '') sched_yield='pthread_yield(NULL)' ;;
16261 case "$usethreads" in
16264 $define) echo 'pthread_yield() found.' >&4 ;;
16265 *) echo 'pthread_yield() NOT found.' >&4 ;;
16269 set d_pthread_yield
16271 case "$sched_yield" in
16272 '') sched_yield=undef ;;
16276 : see if random_r exists
16277 set random_r d_random_r
16279 case "$d_random_r" in
16281 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16282 case "$d_random_r_proto:$usethreads" in
16283 ":define") d_random_r_proto=define
16284 set d_random_r_proto random_r $hdrs
16288 case "$d_random_r_proto" in
16290 case "$random_r_proto" in
16291 ''|0) try='int random_r(int*, struct random_data*);'
16292 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_iS ;;
16294 case "$random_r_proto" in
16295 ''|0) try='int random_r(long*, struct random_data*);'
16296 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_lS ;;
16298 case "$random_r_proto" in
16299 ''|0) try='int random_r(struct random_data*, int32_t*);'
16300 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_St ;;
16302 case "$random_r_proto" in
16303 ''|0) d_random_r=undef
16305 echo "Disabling random_r, cannot determine prototype." >&4 ;;
16306 * ) case "$random_r_proto" in
16307 REENTRANT_PROTO*) ;;
16308 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
16310 echo "Prototype: $try" ;;
16313 *) case "$usethreads" in
16314 define) echo "random_r has no prototype, not using it." >&4 ;;
16321 *) random_r_proto=0
16325 : see if readdir and friends exist
16326 set readdir d_readdir
16328 set seekdir d_seekdir
16330 set telldir d_telldir
16332 set rewinddir d_rewinddir
16335 : see if readdir64_r exists
16336 set readdir64_r d_readdir64_r
16338 case "$d_readdir64_r" in
16340 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16341 case "$d_readdir64_r_proto:$usethreads" in
16342 ":define") d_readdir64_r_proto=define
16343 set d_readdir64_r_proto readdir64_r $hdrs
16347 case "$d_readdir64_r_proto" in
16349 case "$readdir64_r_proto" in
16350 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
16351 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TSR ;;
16353 case "$readdir64_r_proto" in
16354 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
16355 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TS ;;
16357 case "$readdir64_r_proto" in
16358 ''|0) d_readdir64_r=undef
16359 readdir64_r_proto=0
16360 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
16361 * ) case "$readdir64_r_proto" in
16362 REENTRANT_PROTO*) ;;
16363 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
16365 echo "Prototype: $try" ;;
16368 *) case "$usethreads" in
16369 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
16371 d_readdir64_r=undef
16372 readdir64_r_proto=0
16376 *) readdir64_r_proto=0
16380 : see if readdir_r exists
16381 set readdir_r d_readdir_r
16383 case "$d_readdir_r" in
16385 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16386 case "$d_readdir_r_proto:$usethreads" in
16387 ":define") d_readdir_r_proto=define
16388 set d_readdir_r_proto readdir_r $hdrs
16392 case "$d_readdir_r_proto" in
16394 case "$readdir_r_proto" in
16395 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
16396 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TSR ;;
16398 case "$readdir_r_proto" in
16399 ''|0) try='int readdir_r(DIR*, struct dirent*);'
16400 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TS ;;
16402 case "$readdir_r_proto" in
16403 ''|0) d_readdir_r=undef
16405 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
16406 * ) case "$readdir_r_proto" in
16407 REENTRANT_PROTO*) ;;
16408 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
16410 echo "Prototype: $try" ;;
16413 *) case "$usethreads" in
16414 define) echo "readdir_r has no prototype, not using it." >&4 ;;
16421 *) readdir_r_proto=0
16425 : see if readv exists
16429 : see if recvmsg exists
16430 set recvmsg d_recvmsg
16433 : see if rename exists
16434 set rename d_rename
16437 : see if rmdir exists
16441 : see if memory.h is available.
16446 : See if it conflicts with string.h
16452 $cppstdin $cppflags $cppminus < $strings > mem.h
16453 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
16455 echo "We won't be including <memory.h>."
16465 : can bcopy handle overlapping blocks?
16468 case "$d_memmove" in
16469 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
16470 *) case "$d_bcopy" in
16472 echo "Checking to see if bcopy() can do overlapping copies..." >&4
16474 #$i_memory I_MEMORY
16475 #$i_stdlib I_STDLIB
16476 #$i_string I_STRING
16477 #$i_unistd I_UNISTD
16479 $cat >>try.c <<'EOCP'
16482 # include <memory.h>
16485 # include <stdlib.h>
16488 # include <string.h>
16490 # include <strings.h>
16493 # include <unistd.h> /* Needed for NetBSD */
16497 char buf[128], abc[128];
16503 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16504 try to store the string in read-only memory. */
16505 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
16507 for (align = 7; align >= 0; align--) {
16508 for (len = 36; len; len--) {
16510 bcopy(abc, b, len);
16511 for (off = 1; off <= len; off++) {
16512 bcopy(b, b+off, len);
16513 bcopy(b+off, b, len);
16514 if (bcmp(b, abc, len))
16523 if eval $compile_ok; then
16524 if $run ./try 2>/dev/null; then
16525 echo "Yes, it can."
16528 echo "It can't, sorry."
16531 echo "(I can't compile the test program, so we'll assume not...)"
16541 : can memcpy handle overlapping blocks?
16544 case "$d_memmove" in
16545 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
16546 *) case "$d_memcpy" in
16548 echo "Checking to see if memcpy() can do overlapping copies..." >&4
16550 #$i_memory I_MEMORY
16551 #$i_stdlib I_STDLIB
16552 #$i_string I_STRING
16553 #$i_unistd I_UNISTD
16555 $cat >>try.c <<'EOCP'
16558 # include <memory.h>
16561 # include <stdlib.h>
16564 # include <string.h>
16566 # include <strings.h>
16569 # include <unistd.h> /* Needed for NetBSD */
16573 char buf[128], abc[128];
16579 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16580 try to store the string in read-only memory. */
16581 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
16583 for (align = 7; align >= 0; align--) {
16584 for (len = 36; len; len--) {
16586 memcpy(b, abc, len);
16587 for (off = 1; off <= len; off++) {
16588 memcpy(b+off, b, len);
16589 memcpy(b, b+off, len);
16590 if (memcmp(b, abc, len))
16599 if eval $compile_ok; then
16600 if $run ./try 2>/dev/null; then
16601 echo "Yes, it can."
16604 echo "It can't, sorry."
16607 echo "(I can't compile the test program, so we'll assume not...)"
16617 : can memcmp be trusted to compare relative magnitude?
16619 case "$d_memcmp" in
16622 echo "Checking if your memcmp() can compare relative magnitude..." >&4
16624 #$i_memory I_MEMORY
16625 #$i_stdlib I_STDLIB
16626 #$i_string I_STRING
16627 #$i_unistd I_UNISTD
16629 $cat >>try.c <<'EOCP'
16632 # include <memory.h>
16635 # include <stdlib.h>
16638 # include <string.h>
16640 # include <strings.h>
16643 # include <unistd.h> /* Needed for NetBSD */
16649 if ((a < b) && memcmp(&a, &b, 1) < 0)
16655 if eval $compile_ok; then
16656 if $run ./try 2>/dev/null; then
16657 echo "Yes, it can."
16660 echo "No, it can't (it uses signed chars)."
16663 echo "(I can't compile the test program, so we'll assume not...)"
16671 : see if prototype for sbrk is available
16673 set d_sbrkproto sbrk $i_unistd unistd.h
16676 : see if select exists
16677 set select d_select
16680 : see if semctl exists
16681 set semctl d_semctl
16684 : see if semget exists
16685 set semget d_semget
16688 : see if semop exists
16692 : see how much of the 'sem*(2)' library is present.
16695 case "$d_semctl$d_semget$d_semop" in
16696 *"$undef"*) h_sem=false;;
16700 case "`ipcs 2>&1`" in
16701 "SVID messages"*"not configured"*)
16702 echo "Your $osname does not have the sem*(2) configured." >&4
16705 set semctl d_semctl
16707 set semget d_semget
16715 : we could also check for sys/ipc.h ...
16716 if $h_sem && $test `./findhdr sys/sem.h`; then
16717 echo "You have the full sem*(2) library." >&4
16720 echo "You don't have the full sem*(2) library." >&4
16726 : see whether sys/sem.h defines union semun
16728 $cat > try.c <<'END'
16729 #include <sys/types.h>
16730 #include <sys/ipc.h>
16731 #include <sys/sem.h>
16732 int main () { union semun semun; semun.buf = 0; }
16735 if eval $compile; then
16736 echo "You have union semun in <sys/sem.h>." >&4
16739 echo "You do not have union semun in <sys/sem.h>." >&4
16746 : see how to do semctl IPC_STAT
16750 $cat > tryh.h <<END
16753 # define S_IRUSR S_IREAD
16754 # define S_IWUSR S_IWRITE
16755 # define S_IXUSR S_IEXEC
16757 # define S_IRUSR 0400
16758 # define S_IWUSR 0200
16759 # define S_IXUSR 0100
16761 # define S_IRGRP (S_IRUSR>>3)
16762 # define S_IWGRP (S_IWUSR>>3)
16763 # define S_IXGRP (S_IXUSR>>3)
16764 # define S_IROTH (S_IRUSR>>6)
16765 # define S_IWOTH (S_IWUSR>>6)
16766 # define S_IXOTH (S_IXUSR>>6)
16769 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
16770 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
16771 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
16774 : see whether semctl IPC_STAT can use union semun
16775 case "$d_semctl_semun" in
16779 #include <sys/types.h>
16780 #include <sys/ipc.h>
16781 #include <sys/sem.h>
16782 #include <sys/stat.h>
16789 #$d_union_semun HAS_UNION_SEMUN
16792 #ifndef HAS_UNION_SEMUN
16795 struct semid_ds *buf;
16796 unsigned short *array;
16802 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16803 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16805 struct semid_ds argbuf;
16808 st = semctl(sem, 0, IPC_STAT, arg);
16812 # endif /* IPC_STAT */
16813 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16815 if (semctl(sem, 0, IPC_RMID, arg) != 0)
16816 # endif /* IPC_RMID */
16817 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16819 #endif /* IPC_PRIVATE && ... */
16820 printf("semget failed: errno = %d\n", errno);
16825 if eval $compile; then
16828 semun) val="$define" ;;
16836 case "$d_semctl_semun" in
16838 echo "You can use union semun for semctl IPC_STAT." >&4
16841 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
16846 : see whether semctl IPC_STAT can use struct semid_ds pointer
16847 case "$d_semctl_semid_ds" in
16850 $cat > try.c <<'END'
16851 #include <sys/types.h>
16852 #include <sys/ipc.h>
16853 #include <sys/sem.h>
16854 #include <sys/stat.h>
16862 struct semid_ds arg;
16865 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16866 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16869 st = semctl(sem, 0, IPC_STAT, &arg);
16871 printf("semid_ds\n");
16873 # endif /* IPC_STAT */
16874 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16876 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
16877 # endif /* IPC_RMID */
16878 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16880 #endif /* IPC_PRIVATE && ... */
16881 printf("semget failed: errno = %d\n", errno);
16887 if eval $compile; then
16890 semid_ds) val="$define" ;;
16894 set d_semctl_semid_ds
16898 case "$d_semctl_semid_ds" in
16900 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
16902 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
16908 # We do not have the full sem*(2) library, so assume we can not
16914 set d_semctl_semid_ds
16920 : see if sendmsg exists
16921 set sendmsg d_sendmsg
16924 : see if setegid exists
16925 set setegid d_setegid
16928 : see if seteuid exists
16929 set seteuid d_seteuid
16932 : see if setgrent exists
16933 set setgrent d_setgrent
16936 : see if setgrent_r exists
16937 set setgrent_r d_setgrent_r
16939 case "$d_setgrent_r" in
16941 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
16942 case "$d_setgrent_r_proto:$usethreads" in
16943 ":define") d_setgrent_r_proto=define
16944 set d_setgrent_r_proto setgrent_r $hdrs
16948 case "$d_setgrent_r_proto" in
16950 case "$setgrent_r_proto" in
16951 ''|0) try='int setgrent_r(FILE**);'
16952 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=I_H ;;
16954 case "$setgrent_r_proto" in
16955 ''|0) try='void setgrent_r(FILE**);'
16956 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=V_H ;;
16958 case "$setgrent_r_proto" in
16959 ''|0) d_setgrent_r=undef
16961 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
16962 * ) case "$setgrent_r_proto" in
16963 REENTRANT_PROTO*) ;;
16964 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
16966 echo "Prototype: $try" ;;
16969 *) case "$usethreads" in
16970 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
16977 *) setgrent_r_proto=0
16981 : see if sethostent exists
16982 set sethostent d_sethent
16985 : see if sethostent_r exists
16986 set sethostent_r d_sethostent_r
16988 case "$d_sethostent_r" in
16990 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16991 case "$d_sethostent_r_proto:$usethreads" in
16992 ":define") d_sethostent_r_proto=define
16993 set d_sethostent_r_proto sethostent_r $hdrs
16997 case "$d_sethostent_r_proto" in
16999 case "$sethostent_r_proto" in
17000 ''|0) try='int sethostent_r(int, struct hostent_data*);'
17001 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=I_ID ;;
17003 case "$sethostent_r_proto" in
17004 ''|0) try='void sethostent_r(int, struct hostent_data*);'
17005 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=V_ID ;;
17007 case "$sethostent_r_proto" in
17008 ''|0) d_sethostent_r=undef
17009 sethostent_r_proto=0
17010 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
17011 * ) case "$sethostent_r_proto" in
17012 REENTRANT_PROTO*) ;;
17013 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
17015 echo "Prototype: $try" ;;
17018 *) case "$usethreads" in
17019 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
17021 d_sethostent_r=undef
17022 sethostent_r_proto=0
17026 *) sethostent_r_proto=0
17030 : see if setitimer exists
17031 set setitimer d_setitimer
17034 : see if setlinebuf exists
17035 set setlinebuf d_setlinebuf
17038 : see if setlocale exists
17039 set setlocale d_setlocale
17042 : see if locale.h is available
17043 set locale.h i_locale
17046 : see if setlocale_r exists
17047 set setlocale_r d_setlocale_r
17049 case "$d_setlocale_r" in
17051 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
17052 case "$d_setlocale_r_proto:$usethreads" in
17053 ":define") d_setlocale_r_proto=define
17054 set d_setlocale_r_proto setlocale_r $hdrs
17058 case "$d_setlocale_r_proto" in
17060 case "$setlocale_r_proto" in
17061 ''|0) try='int setlocale_r(int, const char*, char*, int);'
17062 ./protochk "$extern_C $try" $hdrs && setlocale_r_proto=I_ICBI ;;
17064 case "$setlocale_r_proto" in
17065 ''|0) d_setlocale_r=undef
17066 setlocale_r_proto=0
17067 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
17068 * ) case "$setlocale_r_proto" in
17069 REENTRANT_PROTO*) ;;
17070 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
17072 echo "Prototype: $try" ;;
17075 *) case "$usethreads" in
17076 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
17078 d_setlocale_r=undef
17079 setlocale_r_proto=0
17083 *) setlocale_r_proto=0
17087 : see if setnetent exists
17088 set setnetent d_setnent
17091 : see if setnetent_r exists
17092 set setnetent_r d_setnetent_r
17094 case "$d_setnetent_r" in
17096 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17097 case "$d_setnetent_r_proto:$usethreads" in
17098 ":define") d_setnetent_r_proto=define
17099 set d_setnetent_r_proto setnetent_r $hdrs
17103 case "$d_setnetent_r_proto" in
17105 case "$setnetent_r_proto" in
17106 ''|0) try='int setnetent_r(int, struct netent_data*);'
17107 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=I_ID ;;
17109 case "$setnetent_r_proto" in
17110 ''|0) try='void setnetent_r(int, struct netent_data*);'
17111 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=V_ID ;;
17113 case "$setnetent_r_proto" in
17114 ''|0) d_setnetent_r=undef
17115 setnetent_r_proto=0
17116 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
17117 * ) case "$setnetent_r_proto" in
17118 REENTRANT_PROTO*) ;;
17119 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
17121 echo "Prototype: $try" ;;
17124 *) case "$usethreads" in
17125 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
17127 d_setnetent_r=undef
17128 setnetent_r_proto=0
17132 *) setnetent_r_proto=0
17136 : see if setprotoent exists
17137 set setprotoent d_setpent
17140 : see if setpgid exists
17141 set setpgid d_setpgid
17144 : see if setpgrp2 exists
17145 set setpgrp2 d_setpgrp2
17148 : see if setpriority exists
17149 set setpriority d_setprior
17152 : see if setproctitle exists
17153 set setproctitle d_setproctitle
17156 : see if setprotoent_r exists
17157 set setprotoent_r d_setprotoent_r
17159 case "$d_setprotoent_r" in
17161 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17162 case "$d_setprotoent_r_proto:$usethreads" in
17163 ":define") d_setprotoent_r_proto=define
17164 set d_setprotoent_r_proto setprotoent_r $hdrs
17168 case "$d_setprotoent_r_proto" in
17170 case "$setprotoent_r_proto" in
17171 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
17172 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=I_ID ;;
17174 case "$setprotoent_r_proto" in
17175 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
17176 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=V_ID ;;
17178 case "$setprotoent_r_proto" in
17179 ''|0) d_setprotoent_r=undef
17180 setprotoent_r_proto=0
17181 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
17182 * ) case "$setprotoent_r_proto" in
17183 REENTRANT_PROTO*) ;;
17184 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
17186 echo "Prototype: $try" ;;
17189 *) case "$usethreads" in
17190 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
17192 d_setprotoent_r=undef
17193 setprotoent_r_proto=0
17197 *) setprotoent_r_proto=0
17201 : see if setpwent exists
17202 set setpwent d_setpwent
17205 : see if setpwent_r exists
17206 set setpwent_r d_setpwent_r
17208 case "$d_setpwent_r" in
17210 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
17211 case "$d_setpwent_r_proto:$usethreads" in
17212 ":define") d_setpwent_r_proto=define
17213 set d_setpwent_r_proto setpwent_r $hdrs
17217 case "$d_setpwent_r_proto" in
17219 case "$setpwent_r_proto" in
17220 ''|0) try='int setpwent_r(FILE**);'
17221 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=I_H ;;
17223 case "$setpwent_r_proto" in
17224 ''|0) try='void setpwent_r(FILE**);'
17225 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=V_H ;;
17227 case "$setpwent_r_proto" in
17228 ''|0) d_setpwent_r=undef
17230 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
17231 * ) case "$setpwent_r_proto" in
17232 REENTRANT_PROTO*) ;;
17233 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
17235 echo "Prototype: $try" ;;
17238 *) case "$usethreads" in
17239 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
17246 *) setpwent_r_proto=0
17250 : see if setregid exists
17251 set setregid d_setregid
17253 set setresgid d_setresgid
17256 : see if setreuid exists
17257 set setreuid d_setreuid
17259 set setresuid d_setresuid
17262 : see if setrgid exists
17263 set setrgid d_setrgid
17266 : see if setruid exists
17267 set setruid d_setruid
17270 : see if setservent exists
17271 set setservent d_setsent
17274 : see if setservent_r exists
17275 set setservent_r d_setservent_r
17277 case "$d_setservent_r" in
17279 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17280 case "$d_setservent_r_proto:$usethreads" in
17281 ":define") d_setservent_r_proto=define
17282 set d_setservent_r_proto setservent_r $hdrs
17286 case "$d_setservent_r_proto" in
17288 case "$setservent_r_proto" in
17289 ''|0) try='int setservent_r(int, struct servent_data*);'
17290 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=I_ID ;;
17292 case "$setservent_r_proto" in
17293 ''|0) try='void setservent_r(int, struct servent_data*);'
17294 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=V_ID ;;
17296 case "$setservent_r_proto" in
17297 ''|0) d_setservent_r=undef
17298 setservent_r_proto=0
17299 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
17300 * ) case "$setservent_r_proto" in
17301 REENTRANT_PROTO*) ;;
17302 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
17304 echo "Prototype: $try" ;;
17307 *) case "$usethreads" in
17308 define) echo "setservent_r has no prototype, not using it." >&4 ;;
17310 d_setservent_r=undef
17311 setservent_r_proto=0
17315 *) setservent_r_proto=0
17319 : see if setsid exists
17320 set setsid d_setsid
17323 : see if setvbuf exists
17324 set setvbuf d_setvbuf
17327 : see if sfio.h is available
17331 : see if sfio library is available
17342 : Ok, but do we want to use it.
17346 true|$define|[yY]*) dflt='y';;
17349 echo "$package can use the sfio library, but it is experimental."
17350 case "$useperlio" in
17352 echo "For sfio also the PerlIO abstraction layer is needed."
17353 echo "Earlier you said you wouldn't want that."
17356 rp="You seem to have sfio available, do you want to try using it?"
17359 y|Y) echo "Ok, turning on both sfio and PerlIO, then."
17360 useperlio="$define"
17363 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
17368 *) case "$usesfio" in
17369 true|$define|[yY]*)
17370 echo "Sorry, cannot find sfio on this machine." >&4
17371 echo "Ignoring your setting of usesfio=$usesfio." >&4
17380 $define) usesfio='true';;
17381 *) usesfio='false';;
17385 *) : Remove sfio from list of libraries to use
17388 echo "Removing unneeded -lsfio from library list" >&4
17389 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
17392 echo "libs = $libs" >&4
17399 : see if shmctl exists
17400 set shmctl d_shmctl
17403 : see if shmget exists
17404 set shmget d_shmget
17407 : see if shmat exists
17410 : see what shmat returns
17413 $cat >shmat.c <<'END'
17414 #include <sys/shm.h>
17417 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
17422 echo "and it returns ($shmattype)." >&4
17423 : see if a prototype for shmat is available
17424 xxx=`./findhdr sys/shm.h`
17425 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
17426 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
17437 set d_shmatprototype
17440 : see if shmdt exists
17444 : see how much of the 'shm*(2)' library is present.
17447 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
17448 *"$undef"*) h_shm=false;;
17452 case "`ipcs 2>&1`" in
17453 "SVID shared memory"*"not configured"*)
17454 echo "Your $osname does not have the shm*(2) configured." >&4
17457 set shmctl d_shmctl
17459 set shmget d_shmget
17469 : we could also check for sys/ipc.h ...
17470 if $h_shm && $test `./findhdr sys/shm.h`; then
17471 echo "You have the full shm*(2) library." >&4
17474 echo "You don't have the full shm*(2) library." >&4
17480 : see if we have sigaction
17482 if set sigaction val -f d_sigaction; eval $csym; $val; then
17483 echo 'sigaction() found.' >&4
17486 #include <sys/types.h>
17487 #include <signal.h>
17488 #$i_stdlib I_STDLIB
17490 #include <stdlib.h>
17494 struct sigaction act, oact;
17496 oact.sa_handler = 0;
17497 /* so that act and oact are used */
17498 exit(act.sa_flags == 0 && oact.sa_handler == 0);
17502 if eval $compile_ok; then
17505 echo "But you don't seem to have a useable struct sigaction." >&4
17509 echo 'sigaction NOT found.' >&4
17512 set d_sigaction; eval $setvar
17515 : see if this is a sunmath.h system
17516 set sunmath.h i_sunmath
17519 : see if signbit exists
17520 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
17523 #$i_sunmath I_SUNMATH
17527 #ifdef I_SUNMATH /* Solaris special math library */
17528 # include <sunmath.h>
17531 int main(int argc, char **argv)
17535 if ((signbit(x) == 0) && (signbit(y) != 0))
17543 if eval $compile; then
17544 if $run ./try; then
17548 $echo "Signbit seems to be available, but doesn't work as I expected."
17549 $echo "I won't use it." >&4
17560 : see if sigprocmask exists
17561 set sigprocmask d_sigprocmask
17564 : see if sigsetjmp exists
17566 case "$d_sigsetjmp" in
17569 #include <setjmp.h>
17570 #$i_stdlib I_STDLIB
17572 #include <stdlib.h>
17578 if (sigsetjmp(env,1))
17581 siglongjmp(env, 1);
17586 if eval $compile; then
17587 if $run ./try >/dev/null 2>&1; then
17588 echo "POSIX sigsetjmp found." >&4
17592 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
17598 echo "sigsetjmp not found." >&4
17602 *) val="$d_sigsetjmp"
17603 case "$d_sigsetjmp" in
17604 $define) echo "POSIX sigsetjmp found." >&4;;
17605 $undef) echo "sigsetjmp not found." >&4;;
17613 : see if snprintf exists
17614 set snprintf d_snprintf
17617 : see if vsnprintf exists
17618 set vsnprintf d_vsnprintf
17621 case "$d_snprintf-$d_vsnprintf" in
17624 Checking whether your snprintf() and vsnprintf() work okay...
17626 $cat >try.c <<'EOCP'
17627 /* v?snprintf testing logic courtesy of Russ Allbery.
17628 * According to C99:
17629 * - if the buffer is too short it still must be \0-terminated
17630 * - if the buffer is too short the potentially required length
17631 * must be returned and not -1
17632 * - if the buffer is NULL the potentially required length
17633 * must be returned and not -1 or core dump
17636 #include <stdarg.h>
17640 int test (char *format, ...)
17645 va_start (args, format);
17646 count = vsnprintf (buf, sizeof buf, format, args);
17653 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
17654 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
17658 if eval $compile; then
17661 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
17663 Your snprintf() and snprintf() don't seem to be working okay.
17665 d_snprintf="$undef"
17666 d_vsnprintf="$undef"
17670 echo "(I can't seem to compile the test program--assuming they don't)"
17671 d_snprintf="$undef"
17672 d_vsnprintf="$undef"
17678 : see if sockatmark exists
17679 set sockatmark d_sockatmark
17682 : see if prototype for sockatmark is available
17684 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
17687 : see if socks5_init exists
17688 set socks5_init d_socks5_init
17691 : see if sprintf returns the length of the string in the buffer as per ANSI
17692 $echo "Checking whether sprintf returns the length of the string..." >&4
17695 #$i_stdlib I_STDLIB
17697 #include <stdlib.h>
17699 #$i_string I_STRING
17701 # include <string.h>
17703 # include <strings.h>
17712 int check (size_t expect, int test) {
17713 size_t got = strlen(buffer);
17717 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
17722 int main(int argc, char **argv) {
17725 check(sprintf(buffer, ""), ++test);
17726 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
17727 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
17734 if eval $compile; then
17738 sprintf returns the length of the string (as ANSI says it should)
17740 d_sprintf_returns_strlen="$define"
17743 sprintf does not return the length of the string (how old is this system?)
17745 d_sprintf_returns_strlen="$undef"
17749 echo "(I can't seem to compile the test program--assuming it doesn't)" >&4
17750 d_sprintf_returns_strlen="$undef"
17754 : see if srand48_r exists
17755 set srand48_r d_srand48_r
17757 case "$d_srand48_r" in
17759 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17760 case "$d_srand48_r_proto:$usethreads" in
17761 ":define") d_srand48_r_proto=define
17762 set d_srand48_r_proto srand48_r $hdrs
17766 case "$d_srand48_r_proto" in
17768 case "$srand48_r_proto" in
17769 ''|0) try='int srand48_r(long, struct drand48_data*);'
17770 ./protochk "$extern_C $try" $hdrs && srand48_r_proto=I_LS ;;
17772 case "$srand48_r_proto" in
17773 ''|0) d_srand48_r=undef
17775 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
17776 * ) case "$srand48_r_proto" in
17777 REENTRANT_PROTO*) ;;
17778 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
17780 echo "Prototype: $try" ;;
17783 *) case "$usethreads" in
17784 define) echo "srand48_r has no prototype, not using it." >&4 ;;
17791 *) srand48_r_proto=0
17795 : see if srandom_r exists
17796 set srandom_r d_srandom_r
17798 case "$d_srandom_r" in
17800 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17801 case "$d_srandom_r_proto:$usethreads" in
17802 ":define") d_srandom_r_proto=define
17803 set d_srandom_r_proto srandom_r $hdrs
17807 case "$d_srandom_r_proto" in
17809 case "$srandom_r_proto" in
17810 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
17811 ./protochk "$extern_C $try" $hdrs && srandom_r_proto=I_TS ;;
17813 case "$srandom_r_proto" in
17814 ''|0) d_srandom_r=undef
17816 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
17817 * ) case "$srandom_r_proto" in
17818 REENTRANT_PROTO*) ;;
17819 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
17821 echo "Prototype: $try" ;;
17824 *) case "$usethreads" in
17825 define) echo "srandom_r has no prototype, not using it." >&4 ;;
17832 *) srandom_r_proto=0
17836 : see if prototype for setresgid is available
17838 set d_sresgproto setresgid $i_unistd unistd.h
17841 : see if prototype for setresuid is available
17843 set d_sresuproto setresuid $i_unistd unistd.h
17846 : see if sys/stat.h is available
17847 set sys/stat.h i_sysstat
17850 : see if stat knows about block sizes
17852 echo "Checking to see if your struct stat has st_blocks field..." >&4
17853 set d_statblks stat st_blocks $i_sysstat sys/stat.h
17856 : see if this is a sys/vfs.h system
17857 set sys/vfs.h i_sysvfs
17860 : see if this is a sys/statfs.h system
17861 set sys/statfs.h i_sysstatfs
17864 : Check for statfs_s
17866 echo "Checking to see if your system supports struct statfs..." >&4
17867 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
17869 case "$d_statfs_s" in
17870 "$define") echo "Yes, it does." ;;
17871 *) echo "No, it doesn't." ;;
17875 : see if struct statfs knows about f_flags
17876 case "$d_statfs_s" in
17879 echo "Checking to see if your struct statfs has f_flags field..." >&4
17880 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
17884 set d_statfs_f_flags
17888 case "$d_statfs_f_flags" in
17889 "$define") echo "Yes, it does." ;;
17890 *) echo "No, it doesn't." ;;
17893 : see what flavor, if any, of static inline is supported
17895 echo "Checking to see if your system supports static inline..."
17896 $cat > try.c <<'EOCP'
17897 #include <stdlib.h>
17898 extern int f_via_a(int x);
17899 extern int f_via_b(int x);
17900 int main(int argc, char **argv)
17909 return EXIT_SUCCESS;
17912 return EXIT_FAILURE;
17916 $cat > a.c <<'EOCP'
17917 static INLINE int f(int x) {
17928 $cat > b.c <<'EOCP'
17929 extern int f(int x);
17937 # Respect a hint (or previous) value for perl_static_inline, if there is one.
17938 case "$perl_static_inline" in
17939 '') # Check the various possibilities, and break out on success.
17940 # For gcc, prefer __inline__, which will still permit
17941 # cflags.SH to add in -ansi.
17942 case "$gccversion" in
17943 '') xxx="inline __inline__ __inline _inline";;
17944 *) xxx="__inline__ inline __inline _inline";;
17946 for inline in $xxx; do
17947 set try -DINLINE=$inline a.c
17948 if eval $compile && $run ./try; then
17949 # Now make sure there is no external linkage of static
17951 set try -DINLINE=$inline -DUSE_B a.c b.c
17952 if eval $compile && $run ./try; then
17953 $echo "Your compiler supports static $inline, " >&4
17954 $echo "but it also creates an external definition," >&4
17955 $echo "so I won't use it." >&4
17958 $echo "Your compiler supports static $inline." >&4
17960 perl_static_inline="static $inline";
17964 $echo "Your compiler does NOT support static $inline." >&4
17969 *inline*) # Some variant of inline exists.
17970 echo "Keeping your $hint value of $perl_static_inline."
17973 static) # No inline capabilities
17974 echo "Keeping your $hint value of $perl_static_inline."
17977 *) # Unrecognized previous value -- blindly trust the supplied
17978 # value and hope it makes sense. Use old value for
17979 # d_static_inline, if there is one.
17980 echo "Keeping your $hint value of $perl_static_inline."
17981 case "$d_static_inline" in
17983 *) val=$d_static_inline ;;
17987 # Fallback to plain 'static' if nothing worked.
17988 case "$perl_static_inline" in
17990 perl_static_inline="static"
17994 set d_static_inline
17996 $rm -f a.[co] b.[co]
17999 : Check stream access
18001 Checking how to access stdio streams by file descriptor number...
18003 case "$stdio_stream_array" in
18004 '') $cat >try.c <<EOCP
18007 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
18011 for s in _iob __iob __sF
18013 set try -DSTDIO_STREAM_ARRAY=$s
18014 if eval $compile; then
18015 case "`$run ./try`" in
18016 yes) stdio_stream_array=$s; break ;;
18022 case "$stdio_stream_array" in
18024 I can't figure out how to access stdio streams by file descriptor number.
18026 d_stdio_stream_array="$undef"
18029 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
18031 d_stdio_stream_array="$define"
18035 : see if strcoll exists
18036 set strcoll d_strcoll
18039 : check for structure copying
18041 echo "Checking to see if your C compiler can copy structs..." >&4
18042 $cat >try.c <<'EOCP'
18052 if $cc -c try.c >/dev/null 2>&1 ; then
18054 echo "Yup, it can."
18057 echo "Nope, it can't."
18063 : see if strerror and/or sys_errlist[] exist
18065 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
18066 if set strerror val -f d_strerror; eval $csym; $val; then
18067 echo 'strerror() found.' >&4
18068 d_strerror="$define"
18069 d_strerrm='strerror(e)'
18070 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18071 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
18072 d_syserrlst="$define"
18074 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
18075 d_syserrlst="$undef"
18077 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
18078 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
18079 echo 'strerror() found in string header.' >&4
18080 d_strerror="$define"
18081 d_strerrm='strerror(e)'
18082 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18083 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
18084 d_syserrlst="$define"
18086 echo "(You don't appear to have any sys_errlist[], how can this be?)"
18087 d_syserrlst="$undef"
18089 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18090 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
18091 d_strerror="$undef"
18092 d_syserrlst="$define"
18093 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
18095 echo 'strerror() and sys_errlist[] NOT found.' >&4
18096 d_strerror="$undef"
18097 d_syserrlst="$undef"
18098 d_strerrm='"unknown"'
18102 : see if strerror_r exists
18103 set strerror_r d_strerror_r
18105 case "$d_strerror_r" in
18107 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
18108 case "$d_strerror_r_proto:$usethreads" in
18109 ":define") d_strerror_r_proto=define
18110 set d_strerror_r_proto strerror_r $hdrs
18114 case "$d_strerror_r_proto" in
18116 case "$strerror_r_proto" in
18117 ''|0) try='int strerror_r(int, char*, size_t);'
18118 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBW ;;
18120 case "$strerror_r_proto" in
18121 ''|0) try='int strerror_r(int, char*, int);'
18122 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBI ;;
18124 case "$strerror_r_proto" in
18125 ''|0) try='char* strerror_r(int, char*, size_t);'
18126 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=B_IBW ;;
18128 case "$strerror_r_proto" in
18129 ''|0) d_strerror_r=undef
18131 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
18132 * ) case "$strerror_r_proto" in
18133 REENTRANT_PROTO*) ;;
18134 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
18136 echo "Prototype: $try" ;;
18139 *) case "$usethreads" in
18140 define) echo "strerror_r has no prototype, not using it." >&4 ;;
18147 *) strerror_r_proto=0
18151 : see if strftime exists
18152 set strftime d_strftime
18155 : see if strlcat exists
18156 set strlcat d_strlcat
18159 : see if strlcpy exists
18160 set strlcpy d_strlcpy
18163 : see if strtod exists
18164 set strtod d_strtod
18167 : see if strtol exists
18168 set strtol d_strtol
18171 : see if strtold exists
18172 set strtold d_strtold
18175 : see if strtoll exists
18176 set strtoll d_strtoll
18179 case "$d_longlong-$d_strtoll" in
18182 Checking whether your strtoll() works okay...
18184 $cat >try.c <<'EOCP'
18187 #define strtoll __strtoll
18190 #define strtoll _strtoll
18193 extern long long int strtoll(char *s, char **, int);
18194 static int bad = 0;
18195 int check(char *s, long long ell, int een) {
18198 gll = strtoll(s, 0, 10);
18199 if (!((gll == ell) && (errno == een)))
18203 check(" 1", 1LL, 0);
18204 check(" 0", 0LL, 0);
18205 check("-1", -1LL, 0);
18206 check("-9223372036854775808", -9223372036854775808LL, 0);
18207 check("-9223372036854775808", -9223372036854775808LL, 0);
18208 check(" 9223372036854775807", 9223372036854775807LL, 0);
18209 check("-9223372036854775808", -9223372036854775808LL, 0);
18210 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
18211 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
18217 if eval $compile; then
18220 ok) echo "Your strtoll() seems to be working okay." ;;
18222 Your strtoll() doesn't seem to be working okay.
18228 echo "(I can't seem to compile the test program--assuming it doesn't)"
18234 : see if strtoq exists
18235 set strtoq d_strtoq
18238 : see if strtoul exists
18239 set strtoul d_strtoul
18242 case "$d_strtoul" in
18245 Checking whether your strtoul() works okay...
18247 $cat >try.c <<'EOCP'
18250 extern unsigned long int strtoul(char *s, char **, int);
18251 static int bad = 0;
18252 void check(char *s, unsigned long eul, int een) {
18255 gul = strtoul(s, 0, 10);
18256 if (!((gul == eul) && (errno == een)))
18260 check(" 1", 1L, 0);
18261 check(" 0", 0L, 0);
18263 case "$longsize" in
18265 $cat >>try.c <<'EOCP'
18266 check("18446744073709551615", 18446744073709551615UL, 0);
18267 check("18446744073709551616", 18446744073709551615UL, ERANGE);
18268 #if 0 /* strtoul() for /^-/ strings is undefined. */
18269 check("-1", 18446744073709551615UL, 0);
18270 check("-18446744073709551614", 2, 0);
18271 check("-18446744073709551615", 1, 0);
18272 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
18273 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
18278 $cat >>try.c <<'EOCP'
18279 check("4294967295", 4294967295UL, 0);
18280 check("4294967296", 4294967295UL, ERANGE);
18281 #if 0 /* strtoul() for /^-/ strings is undefined. */
18282 check("-1", 4294967295UL, 0);
18283 check("-4294967294", 2, 0);
18284 check("-4294967295", 1, 0);
18285 check("-4294967296", 4294967295UL, ERANGE);
18286 check("-4294967297", 4294967295UL, ERANGE);
18291 : Should we write these tests to be more portable by sprintf-ing
18292 : ~0 and then manipulating that char string as input for strtol?
18295 $cat >>try.c <<'EOCP'
18302 if eval $compile; then
18303 case "`$run ./try`" in
18304 ok) echo "Your strtoul() seems to be working okay." ;;
18306 Your strtoul() doesn't seem to be working okay.
18312 echo "(I can't seem to compile the test program--assuming it doesn't)"
18318 : see if strtoull exists
18319 set strtoull d_strtoull
18322 case "$d_longlong-$d_strtoull" in
18325 Checking whether your strtoull() works okay...
18327 $cat >try.c <<'EOCP'
18330 #define strtoull __strtoull
18333 extern unsigned long long int strtoull(char *s, char **, int);
18334 static int bad = 0;
18335 int check(char *s, long long eull, int een) {
18338 gull = strtoull(s, 0, 10);
18339 if (!((gull == eull) && (errno == een)))
18343 check(" 1", 1LL, 0);
18344 check(" 0", 0LL, 0);
18345 check("18446744073709551615", 18446744073709551615ULL, 0);
18346 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18347 #if 0 /* strtoull() for /^-/ strings is undefined. */
18348 check("-1", 18446744073709551615ULL, 0);
18349 check("-18446744073709551614", 2LL, 0);
18350 check("-18446744073709551615", 1LL, 0);
18351 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18352 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18359 if eval $compile; then
18360 case "`$run ./try`" in
18361 ok) echo "Your strtoull() seems to be working okay." ;;
18363 Your strtoull() doesn't seem to be working okay.
18365 d_strtoull="$undef"
18369 echo "(I can't seem to compile the test program--assuming it doesn't)"
18370 d_strtoull="$undef"
18375 : see if strtouq exists
18376 set strtouq d_strtouq
18379 case "$d_strtouq" in
18382 Checking whether your strtouq() works okay...
18384 $cat >try.c <<'EOCP'
18387 extern unsigned long long int strtouq(char *s, char **, int);
18388 static int bad = 0;
18389 void check(char *s, unsigned long long eull, int een) {
18390 unsigned long long gull;
18392 gull = strtouq(s, 0, 10);
18393 if (!((gull == eull) && (errno == een)))
18397 check(" 1", 1LL, 0);
18398 check(" 0", 0LL, 0);
18399 check("18446744073709551615", 18446744073709551615ULL, 0);
18400 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18401 #if 0 /* strtouq() for /^-/ strings is undefined. */
18402 check("-1", 18446744073709551615ULL, 0);
18403 check("-18446744073709551614", 2LL, 0);
18404 check("-18446744073709551615", 1LL, 0);
18405 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18406 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18414 if eval $compile; then
18415 case "`$run ./try`" in
18416 ok) echo "Your strtouq() seems to be working okay." ;;
18418 Your strtouq() doesn't seem to be working okay.
18424 echo "(I can't seem to compile the test program--assuming it doesn't)"
18430 : see if strxfrm exists
18431 set strxfrm d_strxfrm
18434 : see if symlink exists
18435 set symlink d_symlink
18438 : see if syscall exists
18439 set syscall d_syscall
18442 : see if prototype for syscall is available
18444 set d_syscallproto syscall $i_unistd unistd.h
18447 : see if sysconf exists
18448 set sysconf d_sysconf
18451 : see if system exists
18452 set system d_system
18455 : see if tcgetpgrp exists
18456 set tcgetpgrp d_tcgetpgrp
18459 : see if tcsetpgrp exists
18460 set tcsetpgrp d_tcsetpgrp
18463 : see if prototype for telldir is available
18465 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
18468 : see if time exists
18470 if test "X$d_time" = X -o X"$timetype" = X; then
18471 if set time val -f d_time; eval $csym; $val; then
18472 echo 'time() found.' >&4
18474 rp="What is the type returned by time() on this system?"
18475 set time_t timetype long stdio.h sys/types.h
18478 echo 'time() not found, hope that will do.' >&4
18486 : see if timegm exists
18487 set timegm d_timegm
18490 : see if this is a sys/times.h system
18491 set sys/times.h i_systimes
18494 : see if times exists
18496 if set times val -f d_times; eval $csym; $val; then
18497 echo 'times() found.' >&4
18500 case "$i_systimes" in
18501 "$define") inc='sys/times.h';;
18503 rp="What is the type returned by times() on this system?"
18504 set clock_t clocktype long stdio.h sys/types.h $inc
18507 echo 'times() NOT found, hope that will do.' >&4
18512 : see if tmpnam_r exists
18513 set tmpnam_r d_tmpnam_r
18515 case "$d_tmpnam_r" in
18517 hdrs="$i_systypes sys/types.h define stdio.h "
18518 case "$d_tmpnam_r_proto:$usethreads" in
18519 ":define") d_tmpnam_r_proto=define
18520 set d_tmpnam_r_proto tmpnam_r $hdrs
18524 case "$d_tmpnam_r_proto" in
18526 case "$tmpnam_r_proto" in
18527 ''|0) try='char* tmpnam_r(char*);'
18528 ./protochk "$extern_C $try" $hdrs && tmpnam_r_proto=B_B ;;
18530 case "$tmpnam_r_proto" in
18531 ''|0) d_tmpnam_r=undef
18533 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
18534 * ) case "$tmpnam_r_proto" in
18535 REENTRANT_PROTO*) ;;
18536 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
18538 echo "Prototype: $try" ;;
18541 *) case "$usethreads" in
18542 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
18549 *) tmpnam_r_proto=0
18553 : see if truncate exists
18554 set truncate d_truncate
18557 : see if ttyname_r exists
18558 set ttyname_r d_ttyname_r
18560 case "$d_ttyname_r" in
18562 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
18563 case "$d_ttyname_r_proto:$usethreads" in
18564 ":define") d_ttyname_r_proto=define
18565 set d_ttyname_r_proto ttyname_r $hdrs
18569 case "$d_ttyname_r_proto" in
18571 case "$ttyname_r_proto" in
18572 ''|0) try='int ttyname_r(int, char*, size_t);'
18573 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBW ;;
18575 case "$ttyname_r_proto" in
18576 ''|0) try='int ttyname_r(int, char*, int);'
18577 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBI ;;
18579 case "$ttyname_r_proto" in
18580 ''|0) try='char* ttyname_r(int, char*, int);'
18581 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=B_IBI ;;
18583 case "$ttyname_r_proto" in
18584 ''|0) d_ttyname_r=undef
18586 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
18587 * ) case "$ttyname_r_proto" in
18588 REENTRANT_PROTO*) ;;
18589 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
18591 echo "Prototype: $try" ;;
18594 *) case "$usethreads" in
18595 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
18602 *) ttyname_r_proto=0
18606 : see if tzname[] exists
18608 if set tzname val -a d_tzname; eval $csym; $val; then
18610 echo 'tzname[] found.' >&4
18613 echo 'tzname[] NOT found.' >&4
18618 : Check if is a multiplatform env
18620 next|rhapsody|darwin) multiarch="$define" ;;
18622 case "$multiarch" in
18623 ''|[nN]*) multiarch="$undef" ;;
18626 : check for ordering of bytes in a UV
18628 case "$usecrosscompile$multiarch" in
18631 You seem to be either cross-compiling or doing a multiarchitecture build,
18632 skipping the byteorder check.
18638 case "$byteorder" in
18641 In the following, larger digits indicate more significance. A big-endian
18642 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
18643 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
18644 machines may have weird orders like 3412. A Cray will report 87654321,
18645 an Alpha will report 12345678. If the test program works the default is
18647 I'm now running the test program...
18651 #$i_stdlib I_STDLIB
18653 #include <stdlib.h>
18655 #include <sys/types.h>
18656 typedef $uvtype UV;
18666 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
18668 u.l = (UV)0x04030201;
18669 for (i = 0; i < $uvsize; i++)
18670 printf("%c", u.c[i]+'0');
18677 if eval $compile && $run ./try > /dev/null; then
18680 [1-4][1-4][1-4][1-4]|12345678|87654321)
18681 echo "(The test program ran ok.)"
18682 echo "byteorder=$dflt"
18685 ????|????????) echo "(The test program ran ok.)" ;;
18686 *) echo "(The test program didn't run right for some reason.)" ;;
18691 (I can't seem to compile the test program. Guessing big-endian...)
18694 case "$xxx_prompt" in
18696 rp="What is the order of bytes in $uvtype?"
18709 : Checking 32bit aligndness
18712 Checking to see whether you can access character data unalignedly...
18714 case "$d_u32align" in
18715 '') $cat >try.c <<EOCP
18717 #$i_stdlib I_STDLIB
18719 #include <stdlib.h>
18721 #define U32 $u32type
18722 #define BYTEORDER 0x$byteorder
18724 #include <signal.h>
18726 $signal_t bletch(int s) { exit(4); }
18729 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
18730 volatile U8 buf[8];
18734 if (sizeof(U32) != 4) {
18735 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
18742 signal(SIGBUS, bletch);
18754 for (i = 0; i < 4; i++) {
18755 up = (U32*)(buf + i);
18756 if (! ((*up == 1 << (8*i)) || /* big-endian */
18757 (*up == 1 << (8*(3-i))) /* little-endian */
18761 printf("read failed (%x)\n", *up);
18767 for (i = 0; i < 4; i++) {
18768 up = (U32*)(buf + i);
18770 if (*up != 0xBeef) {
18771 printf("write failed (%x)\n", *up);
18785 if eval $compile_ok; then
18786 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
18787 $run ./try 2>&1 >/dev/null
18790 You can access character data pretty unalignedly.
18792 d_u32align="$undef"
18795 It seems that you must access character data in an aligned manner.
18797 d_u32align="$define"
18801 rp='Can you access character data at unaligned addresses?'
18805 [yY]*) d_u32align="$undef" ;;
18806 *) d_u32align="$define" ;;
18813 : see if ualarm exists
18814 set ualarm d_ualarm
18817 : see if umask exists
18821 : see if unordered exists
18822 set unordered d_unordered
18825 : see if unsetenv exists
18826 set unsetenv d_unsetenv
18829 : see if usleep exists
18830 set usleep d_usleep
18833 : see if prototype for usleep is available
18835 set d_usleepproto usleep $i_unistd unistd.h
18838 : see if ustat exists
18842 : see if closedir exists
18843 set closedir d_closedir
18846 case "$d_closedir" in
18849 echo "Checking whether closedir() returns a status..." >&4
18851 #$i_dirent I_DIRENT /**/
18852 #$i_sysdir I_SYS_DIR /**/
18853 #$i_sysndir I_SYS_NDIR /**/
18854 #$i_systypes I_SYS_TYPES /**/
18856 #if defined(I_SYS_TYPES)
18857 #include <sys/types.h>
18859 #if defined(I_DIRENT)
18860 #include <dirent.h>
18861 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
18862 #include <sys/dir.h>
18866 #include <sys/ndir.h>
18870 #include <ndir.h> /* may be wrong in the future */
18872 #include <sys/dir.h>
18877 int main() { return closedir(opendir(".")); }
18880 if eval $compile_ok; then
18881 if $run ./try > /dev/null 2>&1 ; then
18882 echo "Yes, it does."
18885 echo "No, it doesn't."
18889 echo "(I can't seem to compile the test program--assuming it doesn't)"
18897 set d_void_closedir
18901 : see if there is a wait4
18905 : see if waitpid exists
18906 set waitpid d_waitpid
18909 : see if wcstombs exists
18910 set wcstombs d_wcstombs
18913 : see if wctomb exists
18914 set wctomb d_wctomb
18917 : see if writev exists
18918 set writev d_writev
18921 : preserve RCS keywords in files with variable substitution, grrr
18926 Revision='$Revision'
18928 : check for alignment requirements
18930 case "$usecrosscompile$multiarch" in
18933 You seem to be either cross-compiling or doing a multiarchitecture build,
18934 skipping the memory alignment check.
18937 case "$alignbytes" in
18938 '') alignbytes=8 ;;
18942 case "$alignbytes" in
18943 '') echo "Checking alignment constraints..." >&4
18944 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
18945 $cat >try.c <<'EOCP'
18946 typedef long double NV;
18949 $cat >try.c <<'EOCP'
18953 $cat >>try.c <<'EOCP'
18961 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
18966 if eval $compile_ok; then
18970 echo "(I can't seem to compile the test program...)"
18973 *) dflt="$alignbytes"
18976 rp="Doubles must be aligned on a how-many-byte boundary?"
18984 : set the base revision
18987 : length of character in bytes. Is always 1, otherwise it isnt C
18988 : This used to be a test using sizeof
18991 : Check for the number of bits in a character
18992 case "$charbits" in
18993 '') echo "Checking how long a character is (in bits)..." >&4
19000 for (c = 1, n = 0; c; c <<= 1, n++) ;
19001 printf ("%d\n", n);
19006 if eval $compile_ok; then
19010 echo "(I can't seem to compile the test program. Guessing...)"
19017 rp="What is the length of a character (in bits)?"
19021 case "$charbits" in
19024 Your system has an unsigned character size of $charbits bits, which
19025 is rather unusual (normally it is 8 bits). Perl likely will not work
19026 correctly on your system, with subtle bugs in various places.
19028 rp='Do you really want to continue?'
19032 [yY]) echo >&4 "Okay, continuing." ;;
19037 : how do we concatenate cpp tokens here?
19039 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
19040 $cat >cpp_stuff.c <<'EOCP'
19041 #define RCAT(a,b)a/**/b
19042 #define ACAT(a,b)a ## b
19046 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
19047 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
19048 echo "Oh! Smells like ANSI's been here." >&4
19049 echo "We can catify or stringify, separately or together!"
19051 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
19052 echo "Ah, yes! The good old days!" >&4
19053 echo "However, in the good old days we don't know how to stringify and"
19054 echo "catify at the same time."
19058 Hmm, I don't seem to be able to concatenate tokens with your cpp.
19059 You're going to have to edit the values of CAT[2-5] in config.h...
19061 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
19065 : see if this is a db.h system
19071 : Check db version.
19073 echo "Checking Berkeley DB version ..." >&4
19079 #include <sys/types.h>
19081 #$i_stdlib I_STDLIB
19083 #include <stdlib.h>
19086 int main(int argc, char *argv[])
19088 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
19089 int Major, Minor, Patch ;
19090 unsigned long Version ;
19091 (void)db_version(&Major, &Minor, &Patch) ;
19093 printf("%d %d %d %d %d %d\n",
19094 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
19095 Major, Minor, Patch);
19098 printf("You have Berkeley DB Version 2 or greater.\n");
19100 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
19101 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
19102 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
19103 Major, Minor, Patch) ;
19105 /* check that db.h & libdb are compatible */
19106 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
19107 printf("db.h and libdb are incompatible.\n") ;
19111 printf("db.h and libdb are compatible.\n") ;
19113 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
19114 + DB_VERSION_PATCH ;
19116 /* needs to be >= 2.3.4 */
19117 if (Version < 2003004) {
19118 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
19119 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
19125 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
19130 printf("You have Berkeley DB Version 1.\n");
19131 exit(0); /* DB version < 2: the coast is clear. */
19133 exit(1); /* <db.h> not Berkeley DB? */
19139 if eval $compile_ok && $run ./try; then
19140 echo 'Looks OK.' >&4
19142 db_version_major=$1
19143 db_version_minor=$2
19144 db_version_patch=$3
19146 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
19150 : Remove db from list of libraries to use
19151 echo "Removing unusable -ldb from library list" >&4
19152 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
19155 echo "libs = $libs" >&4
19165 : Check the return type needed for hash
19167 echo "Checking return type needed for hash for Berkeley DB ..." >&4
19173 #include <sys/types.h>
19176 #ifndef DB_VERSION_MAJOR
19177 u_int32_t hash_cb (ptr, size)
19185 info.hash = hash_cb;
19189 if $cc $ccflags -c try.c >try.out 2>&1 ; then
19190 if $contains warning try.out >>/dev/null 2>&1 ; then
19193 db_hashtype='u_int32_t'
19196 : XXX Maybe we should just give up here.
19197 db_hashtype=u_int32_t
19199 echo "Help: I can't seem to compile the db test program." >&4
19200 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
19203 echo "Your version of Berkeley DB uses $db_hashtype for hash."
19205 *) db_hashtype=u_int32_t
19210 : Check the return type needed for prefix
19212 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
19218 #include <sys/types.h>
19221 #ifndef DB_VERSION_MAJOR
19222 size_t prefix_cb (key1, key2)
19230 info.prefix = prefix_cb;
19234 if $cc $ccflags -c try.c >try.out 2>&1 ; then
19235 if $contains warning try.out >>/dev/null 2>&1 ; then
19236 db_prefixtype='int'
19238 db_prefixtype='size_t'
19241 db_prefixtype='size_t'
19242 : XXX Maybe we should just give up here.
19244 echo "Help: I can't seem to compile the db test program." >&4
19245 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
19248 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
19250 *) db_prefixtype='size_t'
19254 : How can we generate normalized random numbers ?
19256 echo "Looking for a random number function..." >&4
19257 case "$randfunc" in
19259 if set drand48 val -f; eval $csym; $val; then
19261 echo "Good, found drand48()." >&4
19262 elif set random val -f; eval $csym; $val; then
19264 echo "OK, found random()." >&4
19267 echo "Yick, looks like I have to use rand()." >&4
19278 *-Dmy_rand=*|*-Dmy_srand=*)
19279 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
19280 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
19281 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
19282 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
19286 while $test "$cont"; do
19287 rp="Use which function to generate random numbers?"
19289 if $test "$ans" = "$dflt"; then
19295 if set $ans val -f; eval $csym; $val; then
19299 rp="I cannot find function $ans. Use that name anyway?"
19308 case "$randfunc" in
19310 drand01="drand48()"
19316 case "$randbits" in
19318 echo "Checking to see how many bits your $randfunc() function produces..." >&4
19320 #$i_unistd I_UNISTD
19321 #$i_stdlib I_STDLIB
19324 # include <unistd.h>
19327 # include <stdlib.h>
19332 register unsigned long tmp;
19333 register unsigned long max = 0L;
19335 for (i = 1000; i; i--) {
19336 tmp = (unsigned long) $randfunc();
19337 if (tmp > max) max = tmp;
19339 for (i = 0; max; i++)
19345 if eval $compile_ok; then
19349 echo "(I can't seem to compile the test program...)"
19356 rp="How many bits does your $randfunc() function produce?"
19360 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
19361 seedfunc="s$randfunc"
19362 randseedtype=unsigned
19366 rp="How many bits does your $randfunc() function produce?"
19369 seedfunc="s$randfunc"
19370 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
19371 if set $seedfunc val -f; eval $csym; $val; then
19372 echo "(Using $seedfunc() to seed random generator)"
19374 echo "(Warning: no $seedfunc() to seed random generator)"
19377 randseedtype=unsigned
19384 : Determine if this is an EBCDIC system
19386 echo "Determining whether or not we are on an EBCDIC system..." >&4
19387 $cat >try.c <<'EOM'
19390 if ('M'==0xd4) return 0;
19397 if eval $compile_ok; then
19398 if $run ./try; then
19399 echo "You seem to speak EBCDIC." >&4
19402 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
19405 echo "I'm unable to compile the test program." >&4
19406 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
19412 : Check how to flush
19415 Checking how to flush all pending stdio output...
19417 # I only know how to find the first 32 possibly open files on SunOS.
19418 # See also hints/sunos_4_1.sh and util.c --AD
19420 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
19422 $cat >>try.c <<EOCP
19424 #$i_stdlib I_STDLIB
19426 #include <stdlib.h>
19428 #$i_unistd I_UNISTD
19430 # include <unistd.h>
19432 #$d_sysconf HAS_SYSCONF
19433 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
19434 #ifdef HAS_STDIO_STREAM_ARRAY
19435 # define STDIO_STREAM_ARRAY $stdio_stream_array
19440 p = fopen("try.out", "w");
19444 # ifdef TRY_FPRINTF
19448 #ifdef TRY_FFLUSH_NULL
19451 #ifdef TRY_FFLUSH_ALL
19453 long open_max = -1;
19454 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
19455 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
19457 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
19458 open_max = sysconf(_SC_OPEN_MAX);
19461 open_max = FOPEN_MAX;
19464 open_max = OPEN_MAX;
19473 # ifdef HAS_STDIO_STREAM_ARRAY
19474 if (open_max > 0) {
19476 for (i = 0; i < open_max; i++)
19477 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
19478 STDIO_STREAM_ARRAY[i]._file < open_max &&
19479 STDIO_STREAM_ARRAY[i]._flag)
19480 fflush(&STDIO_STREAM_ARRAY[i]);
19488 : first we have to find out how _not_ to flush
19490 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
19492 set try -DTRY_FPUTC
19493 if eval $compile; then
19494 $run ./try 2>/dev/null
19497 if $test ! -s try.out -a "X$code" = X42; then
19503 set try -DTRY_FPRINTF
19504 if eval $compile; then
19505 $run ./try 2>/dev/null
19508 if $test ! -s try.out -a "X$code" = X42; then
19509 output=-DTRY_FPRINTF
19515 : check for fflush NULL behaviour
19516 case "$fflushNULL" in
19517 '') set try -DTRY_FFLUSH_NULL $output
19518 if eval $compile; then
19519 $run ./try 2>/dev/null
19522 if $test -s try.out -a "X$code" = X42; then
19523 fflushNULL="`$cat try.out`"
19525 if $test "X$code" != X42; then
19527 (If this test failed, don't worry, we'll try another method shortly.)
19532 $rm -f core try.core core.try.*
19533 case "$fflushNULL" in
19535 Your fflush(NULL) works okay for output streams.
19536 Let's see if it clobbers input pipes...
19538 # As of mid-March 2000 all versions of Solaris appear to have a stdio
19539 # bug that improperly flushes the input end of pipes. So we avoid the
19540 # autoflush on fork/system/exec support for now. :-(
19541 $cat >tryp.c <<EOCP
19544 main(int argc, char **argv)
19550 while ((i = getc(stdin)) != -1
19551 && (*bp++ = i) != '\n'
19552 && bp < &buf[1024])
19555 fprintf(stdout, "%s", buf);
19563 fflushNULL="$define"
19565 if eval $compile; then
19567 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19568 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19570 fflush(NULL) seems to behave okay with input streams.
19572 fflushNULL="$define"
19575 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
19577 fflushNULL="$undef"
19580 $rm -f core tryp.c tryp.core core.tryp.*
19583 Your fflush(NULL) isn't working (contrary to ANSI C).
19585 fflushNULL="$undef"
19588 Cannot figure out whether your fflush(NULL) works or not.
19589 I'm assuming it doesn't (contrary to ANSI C).
19591 fflushNULL="$undef"
19595 $define|true|[yY]*)
19596 fflushNULL="$define"
19599 fflushNULL="$undef"
19602 : check explicit looping only if NULL did not work, and if the pipe
19603 : bug does not show up on an explicit flush too
19604 case "$fflushNULL" in
19606 $cat >tryp.c <<EOCP
19609 main(int argc, char **argv)
19615 while ((i = getc(stdin)) != -1
19616 && (*bp++ = i) != '\n'
19617 && bp < &buf[1024])
19620 fprintf(stdout, "%s", buf);
19629 if eval $compile; then
19631 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19632 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19634 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
19636 : now check for fflushall behaviour
19637 case "$fflushall" in
19638 '') set try -DTRY_FFLUSH_ALL $output
19639 if eval $compile; then
19641 (Now testing the other method--but note that this also may fail.)
19643 $run ./try 2>/dev/null
19646 if $test -s try.out -a "X$code" = X42; then
19647 fflushall="`$cat try.out`"
19651 case "$fflushall" in
19653 Whew. Flushing explicitly all the stdio streams works.
19655 fflushall="$define"
19658 Sigh. Flushing explicitly all the stdio streams doesn't work.
19663 Cannot figure out whether flushing stdio streams explicitly works or not.
19664 I'm assuming it doesn't.
19670 "$define"|true|[yY]*)
19671 fflushall="$define"
19679 All is futile. Even fflush(stdin) clobbers input pipes!
19686 $rm -f core tryp.c tryp.core core.tryp.*
19688 *) fflushall="$undef"
19692 case "$fflushNULL$fflushall" in
19695 OK, I give up. I cannot figure out how to flush pending stdio output.
19696 We won't be flushing handles at all before fork/exec/popen.
19702 : Store the full pathname to the ar program for use in the C program
19703 : Respect a hint or command line value for full_ar.
19708 : Store the full pathname to the sed program for use in the C program
19711 : see what type gids are declared as in the kernel
19713 echo "Looking for the type for group ids returned by getgid()."
19714 set gid_t gidtype xxx stdio.h sys/types.h
19718 xxx=`./findhdr sys/user.h`
19719 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
19721 unsigned) dflt="$1 $2" ;;
19725 *) dflt="$gidtype";;
19728 gid_t) echo "gid_t found." ;;
19729 *) rp="What is the type for group ids returned by getgid()?"
19735 : Check the size of GID
19738 *_t) zzz="$gidtype" ;;
19741 echo "Checking the size of $zzz..." >&4
19743 #include <sys/types.h>
19745 #$i_stdlib I_STDLIB
19747 #include <stdlib.h>
19750 printf("%d\n", (int)sizeof($gidtype));
19755 if eval $compile_ok; then
19759 echo "(I can't execute the test program--guessing $gidsize.)" >&4
19762 echo "Your $zzz is $gidsize bytes long."
19767 echo "(I can't compile the test program--guessing $gidsize.)" >&4
19771 : Check if GID is signed
19774 *_t) zzz="$gidtype" ;;
19777 echo "Checking the sign of $zzz..." >&4
19779 #include <sys/types.h>
19790 if eval $compile; then
19794 echo "(I can't execute the test program--guessing unsigned.)" >&4
19798 1) echo "Your $zzz is unsigned." ;;
19799 -1) echo "Your $zzz is signed." ;;
19805 echo "(I can't compile the test program--guessing unsigned.)" >&4
19809 : Check 64bit sizes
19812 if $test X"$quadtype" != X; then
19814 echo "Checking how to print 64-bit integers..." >&4
19816 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
19817 $cat >try.c <<'EOCP'
19818 #include <sys/types.h>
19821 int q = 12345678901;
19822 printf("%ld\n", q);
19826 if eval $compile; then
19830 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
19831 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
19832 echo "We will use %d."
19838 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
19839 $cat >try.c <<'EOCP'
19840 #include <sys/types.h>
19843 long q = 12345678901;
19844 printf("%ld\n", q);
19848 if eval $compile; then
19852 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
19853 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
19854 echo "We will use %ld."
19860 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
19861 $cat >try.c <<'EOCP'
19862 #include <sys/types.h>
19863 #include <inttypes.h>
19866 int64_t q = 12345678901;
19867 printf("%" PRId64 "\n", q);
19871 if eval $compile; then
19875 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
19876 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
19877 echo "We will use the C9X style."
19883 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19885 #include <sys/types.h>
19888 $quadtype q = 12345678901;
19889 printf("%Ld\n", q);
19893 if eval $compile; then
19897 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
19898 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
19899 echo "We will use %Ld."
19905 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
19906 $cat >try.c <<'EOCP'
19907 #include <sys/types.h>
19910 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
19911 printf("%lld\n", q);
19915 if eval $compile; then
19919 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
19920 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
19921 echo "We will use the %lld style."
19927 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19929 #include <sys/types.h>
19932 $quadtype q = 12345678901;
19933 printf("%qd\n", q);
19937 if eval $compile; then
19941 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
19942 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
19943 echo "We will use %qd."
19949 if $test X"$sPRId64" = X; then
19950 echo "Cannot figure out how to print 64-bit integers." >&4
19957 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
19958 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
19960 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
19961 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
19965 : Check format strings for internal types
19967 $echo "Checking the format strings to be used for Perl's internal types..." >&4
19969 if $test X"$ivsize" = X8; then
19970 ivdformat="$sPRId64"
19971 uvuformat="$sPRIu64"
19972 uvoformat="$sPRIo64"
19973 uvxformat="$sPRIx64"
19974 uvXUformat="$sPRIXU64"
19976 if $test X"$ivsize" = X"$longsize"; then
19983 if $test X"$ivsize" = X"$intsize"; then
19991 if $test X"$ivsize" = X"$shortsize"; then
20002 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
20003 nveformat="$sPRIeldbl"
20004 nvfformat="$sPRIfldbl"
20005 nvgformat="$sPRIgldbl"
20006 nvEUformat="$sPRIEUldbl"
20007 nvFUformat="$sPRIFUldbl"
20008 nvGUformat="$sPRIGUldbl"
20018 case "$ivdformat" in
20019 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
20024 : Check format string for GID
20027 $echo "Checking the format string to be used for gids..." >&4
20030 -1) if $test X"$gidsize" = X"$ivsize"; then
20031 gidformat="$ivdformat"
20033 if $test X"$gidsize" = X"$longsize"; then
20036 if $test X"$gidsize" = X"$intsize"; then
20039 if $test X"$gidsize" = X"$shortsize"; then
20046 *) if $test X"$gidsize" = X"$uvsize"; then
20047 gidformat="$uvuformat"
20049 if $test X"$gidsize" = X"$longsize"; then
20052 if $test X"$gidsize" = X"$intsize"; then
20055 if $test X"$gidsize" = X"$shortsize"; then
20064 : see if getgroups exists
20065 set getgroups d_getgrps
20068 : see if setgroups exists
20069 set setgroups d_setgrps
20072 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
20074 case "$d_getgrps$d_setgrps" in
20076 case "$groupstype" in
20077 '') dflt="$gidtype" ;;
20078 *) dflt="$groupstype" ;;
20081 What type of pointer is the second argument to getgroups() and setgroups()?
20082 Usually this is the same as group ids, $gidtype, but not always.
20085 rp='What type pointer is the second argument to getgroups() and setgroups()?'
20089 *) groupstype="$gidtype";;
20092 : MAD = Misc Attribute Definition
20094 if $test $patchlevel -lt 9; then
20095 : MAD is not available in 5.8.x or earlier.
20099 $define|true|[yY]*) dflt='y' ;;
20104 Would you like to build with Misc Attribute Decoration? This is development
20105 work leading to a Perl 5 to Perl 6 convertor, which imposes a space and speed
20106 overhead on the interpreter.
20108 If this doesn't make any sense to you, just accept the default '$dflt'.
20110 rp='Build Perl with MAD?'
20115 madlyh='madly.h madly.act madly.tab'
20117 madlyobj="madly$_o" ;;
20126 : check whether make sets MAKE
20128 echo "Checking if your $make program sets \$(MAKE)..." >&4
20129 case "$make_set_make" in
20131 $sed 's/^X //' > testmake.mak << 'EOF'
20133 X @echo 'maketemp="$(MAKE)"'
20135 case "`$make -f testmake.mak 2>/dev/null`" in
20136 *maketemp=*) make_set_make='#' ;;
20137 *) make_set_make="MAKE=$make" ;;
20139 $rm -f testmake.mak
20142 case "$make_set_make" in
20143 '#') echo "Yup, it does.";;
20144 *) echo "Nope, it doesn't.";;
20147 : see what type is used for mode_t
20148 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
20149 set mode_t modetype int stdio.h sys/types.h
20152 : see if we need va_copy
20154 case "$i_stdarg" in
20157 #include <stdarg.h>
20159 #$i_stdlib I_STDLIB
20161 #include <stdlib.h>
20163 #include <signal.h>
20166 ivfprintf(FILE *f, const char *fmt, va_list *valp)
20168 return vfprintf(f, fmt, *valp);
20172 myvfprintf(FILE *f, const char *fmt, va_list val)
20174 return ivfprintf(f, fmt, &val);
20178 myprintf(char *fmt, ...)
20181 va_start(val, fmt);
20182 return myvfprintf(stdout, fmt, val);
20186 main(int ac, char **av)
20188 signal(SIGSEGV, exit);
20190 myprintf("%s%cs all right, then\n", "that", '\'');
20195 if eval $compile && $run ./try 2>&1 >/dev/null; then
20196 case "`$run ./try`" in
20197 "that's all right, then")
20203 yes) echo "It seems that you don't need va_copy()." >&4
20204 need_va_copy="$undef"
20206 *) echo "It seems that va_copy() or similar will be needed." >&4
20207 need_va_copy="$define"
20212 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
20216 : see what type is used for size_t
20217 rp="What is the type used for the length parameter for string functions?"
20218 set size_t sizetype 'unsigned int' stdio.h sys/types.h
20221 : check for type of arguments to gethostbyaddr.
20222 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
20223 case "$d_gethbyaddr" in
20227 Checking to see what type of arguments are accepted by gethostbyaddr().
20229 hdrs="$define sys/types.h
20230 $d_socket sys/socket.h
20231 $i_niin netinet/in.h
20233 $i_unistd unistd.h"
20234 : The first arg can 'char *' or 'void *'
20235 : The second arg is some of integral type
20236 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
20237 for yyy in size_t long int; do
20238 case "$netdb_host_type" in
20239 '') try="$extern_C struct hostent *gethostbyaddr($xxx, $yyy, int);"
20240 if ./protochk "$try" $hdrs; then
20241 echo "Your system accepts $xxx for the first arg."
20242 echo "...and $yyy for the second arg."
20243 netdb_host_type="$xxx"
20244 netdb_hlen_type="$yyy"
20250 : In case none of those worked, prompt the user.
20251 case "$netdb_host_type" in
20252 '') rp='What is the type for the 1st argument to gethostbyaddr?'
20255 netdb_host_type=$ans
20256 rp='What is the type for the 2nd argument to gethostbyaddr?'
20259 netdb_hlen_type=$ans
20263 *) : no gethostbyaddr, so pick harmless defaults
20264 netdb_host_type='char *'
20265 netdb_hlen_type="$sizetype"
20268 # Remove the "const" if needed. -- but then we'll have a
20270 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
20273 : check for type of argument to gethostbyname.
20274 if test "X$netdb_name_type" = X ; then
20275 case "$d_gethbyname" in
20279 Checking to see what type of argument is accepted by gethostbyname().
20281 hdrs="$define sys/types.h
20282 $d_socket sys/socket.h
20283 $i_niin netinet/in.h
20285 $i_unistd unistd.h"
20286 for xxx in "const char *" "char *"; do
20287 case "$netdb_name_type" in
20288 '') try="$extern_C struct hostent *gethostbyname($xxx);"
20289 if ./protochk "$try" $hdrs; then
20290 echo "Your system accepts $xxx."
20291 netdb_name_type="$xxx"
20296 : In case none of those worked, prompt the user.
20297 case "$netdb_name_type" in
20298 '') rp='What is the type for the 1st argument to gethostbyname?'
20301 netdb_name_type=$ans
20305 *) : no gethostbyname, so pick harmless default
20306 netdb_name_type='char *'
20311 : check for type of 1st argument to getnetbyaddr.
20312 if test "X$netdb_net_type" = X ; then
20313 case "$d_getnbyaddr" in
20317 Checking to see what type of 1st argument is accepted by getnetbyaddr().
20319 hdrs="$define sys/types.h
20320 $d_socket sys/socket.h
20321 $i_niin netinet/in.h
20323 $i_unistd unistd.h"
20324 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
20325 case "$netdb_net_type" in
20326 '') try="$extern_C struct netent *getnetbyaddr($xxx, int);"
20327 if ./protochk "$try" $hdrs; then
20328 echo "Your system accepts $xxx."
20329 netdb_net_type="$xxx"
20334 : In case none of those worked, prompt the user.
20335 case "$netdb_net_type" in
20336 '') rp='What is the type for the 1st argument to getnetbyaddr?'
20339 netdb_net_type=$ans
20343 *) : no getnetbyaddr, so pick harmless default
20344 netdb_net_type='long'
20348 : locate the preferred pager for this system
20355 [a-zA-Z]:/*) dflt=$pg;;
20359 [a-zA-Z]:/*) dflt=$more;;
20363 [a-zA-Z]:/*) dflt=$less;;
20366 '') dflt=/usr/ucb/more;;
20374 rp='What pager is used on your system?'
20378 : see what type pids are declared as in the kernel
20379 rp="What is the type of process ids on this system?"
20380 set pid_t pidtype int stdio.h sys/types.h
20383 : see if ar generates random libraries by itself
20385 echo "Checking how to generate random libraries on your machine..." >&4
20386 echo 'int bar1() { return bar2(); }' > bar1.c
20387 echo 'int bar2() { return 2; }' > bar2.c
20389 #$i_stdlib I_STDLIB
20391 #include <stdlib.h>
20393 int main() { printf("%d\n", bar1()); exit(0); }
20395 $cc $ccflags -c bar1.c >/dev/null 2>&1
20396 $cc $ccflags -c bar2.c >/dev/null 2>&1
20397 $cc $ccflags -c foo.c >/dev/null 2>&1
20398 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
20399 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20400 $run ./foobar >/dev/null 2>&1; then
20401 echo "$ar appears to generate random libraries itself."
20403 if [ "X$ranlib" = "X" ]; then
20406 elif $ar s bar$_a >/dev/null 2>&1 &&
20407 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20408 $run ./foobar >/dev/null 2>&1; then
20409 echo "a table of contents needs to be added with '$ar s'."
20412 elif $ar ts bar$_a >/dev/null 2>&1 &&
20413 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20414 $run ./foobar >/dev/null 2>&1; then
20415 echo "a table of contents needs to be added with '$ar ts'."
20422 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
20423 $test -f $ranlib || ranlib=''
20426 if $test -n "$ranlib"; then
20427 echo "your system has '$ranlib'; we'll use that."
20430 echo "your system doesn't seem to support random libraries"
20431 echo "so we'll use lorder and tsort to order the libraries."
20438 : see if this is a values.h system
20439 set values.h i_values
20442 : Check the max offset that gmtime and localtime accept
20443 echo "Checking max offsets that gmtime () accepts"
20446 define) yyy="#include <values.h>" ;;
20450 case "$sGMTIME_min/$sGMTIME_max" in
20453 #include <sys/types.h>
20462 void gm_check (time_t t, int min_year, int max_year)
20465 if ( tmp == NULL ||
20466 /* Check tm_year overflow */
20467 tmp->tm_year < min_year || tmp->tm_year > max_year)
20478 gm_check (MAXLONG, 69, 0x7fffffff);
20480 if (tmp == NULL || tmp->tm_year < 0) {
20481 for (i = 63; i >= 0; i--) {
20482 time_t x = pt | ((time_t)1 << i);
20483 if (x < 0 || x < pt) continue;
20484 gm_check (x, 69, 0x7fffffff);
20487 printf ("sGMTIME_max=%ld\n", pt);
20496 gm_check (MINLONG, -1900, 70);
20499 for (i = 36; i >= 0; i--) {
20500 time_t x = pt - ((time_t)1 << i);
20501 if (x > 0) continue;
20502 gm_check (x, -1900, 70);
20505 printf ("sGMTIME_min=%ld\n", pt);
20509 int main (int argc, char *argv[])
20511 fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t));
20518 if eval $compile; then
20521 echo "Cannot determine sGMTIME_max and sGMTIME_min." >&4
20527 echo "Checking max offsets that localtime () accepts"
20529 case "$sLOCALTIME_min/$sLOCALTIME_max" in
20532 #include <sys/types.h>
20541 void local_check (time_t t, int min_year, int max_year)
20543 if (sizeof (time_t) > 4 && t > 0x7ffffffffffff000LL)
20546 tmp = localtime (&t);
20547 if ( tmp == NULL ||
20548 /* Check tm_year overflow */
20549 tmp->tm_year < min_year || tmp->tm_year > max_year)
20553 } /* local_check */
20560 local_check (MAXLONG, 69, 0x7fffffff);
20562 if (tmp == NULL || tmp->tm_year < 0) {
20563 for (i = 63; i >= 0; i--) {
20564 time_t x = pt | ((time_t)1 << i);
20565 if (x < 0 || x < pt) continue;
20566 local_check (x, 69, 0x7fffffff);
20569 printf ("sLOCALTIME_max=%ld\n", pt);
20578 local_check (MINLONG, -1900, 70);
20581 for (i = 36; i >= 0; i--) {
20582 time_t x = pt - ((time_t)1 << i);
20583 if (x > 0) continue;
20584 local_check (x, -1900, 70);
20587 printf ("sLOCALTIME_min=%ld\n", pt);
20591 int main (int argc, char *argv[])
20599 if eval $compile; then
20602 echo "Cannot determine sLOCALTIME_max and sLOCALTIME_min." >&4
20608 : check for type of arguments to select.
20609 case "$selecttype" in
20610 '') case "$d_select" in
20614 Checking to see what type of arguments are accepted by select().
20616 hdrs="$define sys/types.h
20617 $i_systime sys/time.h
20618 $i_sysselct sys/select.h
20619 $d_socket sys/socket.h"
20620 : The first arg can be int, unsigned, or size_t
20621 : The last arg may or may not be 'const'
20623 : void pointer has been seen but using that
20624 : breaks the selectminbits test
20625 for xxx in 'fd_set *' 'int *'; do
20626 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
20627 for tmo in 'struct timeval *' 'const struct timeval *'; do
20629 '') try="$extern_C select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
20630 if ./protochk "$try" $hdrs; then
20631 echo "Your system accepts $xxx."
20640 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
20641 case "$d_fd_set" in
20642 $define) dflt="fd_set *" ;;
20651 *) : no select, so pick a harmless default
20658 : check for the select 'width'
20659 case "$selectminbits" in
20660 '') safebits=`expr $ptrsize \* 8`
20661 case "$d_select" in
20665 Checking to see on how many bits at a time your select() operates...
20668 #include <sys/types.h>
20670 #$i_systime I_SYS_TIME
20671 #$i_systimek I_SYS_TIME_KERNEL
20676 # ifdef I_SYS_TIME_KERNEL
20679 # include <sys/time.h>
20680 # ifdef I_SYS_TIME_KERNEL
20684 #$i_sysselct I_SYS_SELECT
20685 #ifdef I_SYS_SELECT
20686 #include <sys/select.h>
20688 #$d_socket HAS_SOCKET
20690 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
20693 #$i_stdlib I_STDLIB
20695 #include <stdlib.h>
20698 #define S sizeof(*(b))
20700 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
20701 #define NBITS (NBYTES * 8)
20703 char *s = (char *)malloc(NBYTES);
20712 fp = fopen("try.c", "r");
20718 b = ($selecttype)s;
20719 for (i = 0; i < NBITS; i++)
20723 select(fd + 1, b, 0, 0, &t);
20724 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
20726 printf("%d\n", i + 1);
20731 if eval $compile_ok; then
20732 selectminbits=`$run ./try`
20733 case "$selectminbits" in
20735 Cannot figure out on how many bits at a time your select() operates.
20736 I'll play safe and guess it is $safebits bits.
20738 selectminbits=$safebits
20739 bits="$safebits bits"
20742 *) bits="$selectminbits bits" ;;
20744 echo "Your select() operates on $bits at a time." >&4
20746 rp='What is the minimum number of bits your select() operates on?'
20747 case "$byteorder" in
20748 12345678) dflt=64 ;;
20754 selectminbits="$val"
20758 *) : no select, so pick a harmless default
20759 selectminbits=$safebits
20765 : Trace out the files included by signal.h, then look for SIGxxx names.
20766 if [ "X$fieldn" = X ]; then
20767 : Just make some guesses. We check them later.
20768 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
20770 xxx=`echo '#include <signal.h>' |
20771 $cppstdin $cppminus $cppflags 2>/dev/null |
20772 $grep '^[ ]*#.*include' |
20773 $awk "{print \\$$fieldn}" | $sed 's!"!!g' |\
20774 $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
20777 for xx in $xxx /dev/null ; do
20778 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
20780 case "$xxxfiles" in
20781 '') xxxfiles=`./findhdr signal.h` ;;
20784 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
20785 print substr($2, 4, 20)
20787 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
20788 print substr($3, 4, 20)
20790 : Append some common names just in case the awk scan failed.
20791 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
20792 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
20793 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
20794 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
20795 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
20797 : generate a few handy files for later
20798 $cat > signal.c <<EOCP
20799 #include <sys/types.h>
20800 #include <signal.h>
20801 #$i_stdlib I_STDLIB
20803 #include <stdlib.h>
20808 /* Strange style to avoid deeply-nested #if/#else/#endif */
20811 # define NSIG (_NSIG)
20817 # define NSIG (SIGMAX+1)
20823 # define NSIG (SIG_MAX+1)
20829 # define NSIG (_SIG_MAX+1)
20835 # define NSIG (MAXSIG+1)
20841 # define NSIG (MAX_SIG+1)
20846 # ifdef SIGARRAYSIZE
20847 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
20853 # define NSIG (_sys_nsig) /* Solaris 2.5 */
20857 /* Default to some arbitrary number that's big enough to get most
20858 of the common signals.
20864 printf("NSIG %d\n", NSIG);
20870 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
20872 printf "#ifdef SIG"; printf $1; printf "\n"
20873 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
20874 printf $1; printf ");\n"
20878 printf "#endif /* JUST_NSIG */\n";
20879 printf "exit(0);\n}\n";
20882 $cat >signal.awk <<'EOP'
20883 BEGIN { ndups = 0 }
20884 $1 ~ /^NSIG$/ { nsig = $2 }
20885 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
20886 if ($2 > maxsig) { maxsig = $2 }
20887 if (sig_name[$2]) {
20888 dup_name[ndups] = $1
20889 dup_num[ndups] = $2
20901 printf("NSIG %d\n", nsig);
20902 for (n = 1; n < nsig; n++) {
20904 printf("%s %d\n", sig_name[n], sig_num[n])
20907 printf("NUM%d %d\n", n, n)
20910 for (n = 0; n < ndups; n++) {
20911 printf("%s %d\n", dup_name[n], dup_num[n])
20915 $cat >signal_cmd <<EOS
20917 if $test -s signal.lst; then
20918 echo "Using your existing signal.lst file"
20923 $cat >>signal_cmd <<'EOS'
20926 if eval $compile_ok; then
20927 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) |\
20928 $uniq | $awk -f signal.awk >signal.lst
20930 echo "(I can't seem be able to compile the whole test program)" >&4
20931 echo "(I'll try it in little pieces.)" >&4
20932 set signal -DJUST_NSIG
20933 if eval $compile_ok; then
20934 $run ./signal$_exe > signal.nsg
20937 echo "I can't seem to figure out how many signals you have." >&4
20938 echo "Guessing 50." >&4
20939 echo 'NSIG 50' > signal.nsg
20941 : Now look at all the signal names, one at a time.
20942 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
20943 $cat > signal.c <<EOCP
20944 #include <sys/types.h>
20945 #include <signal.h>
20948 printf("$xx %d\n", SIG${xx});
20953 if eval $compile; then
20954 echo "SIG${xx} found."
20955 $run ./signal$_exe >> signal.ls1
20957 echo "SIG${xx} NOT found."
20960 if $test -s signal.ls1; then
20961 $cat signal.nsg signal.ls1 |
20962 $sort -n | $uniq | $awk -f signal.awk >signal.lst
20966 if $test -s signal.lst; then
20969 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
20970 echo 'kill -l' >signal
20971 set X `csh -f <signal`
20975 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
20977 echo $@ | $tr ' ' $trnl | \
20978 $awk '{ printf "%s %d\n", $1, ++s; }
20979 END { printf "NSIG %d\n", ++s }' >signal.lst
20981 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
20983 chmod a+x signal_cmd
20984 $eunicefix signal_cmd
20986 : generate list of signal names
20988 case "$sig_name_init" in
20990 *) case "$sig_num_init" in
20991 ''|*,*) doinit=yes ;;
20996 echo "Generating a list of signal names and numbers..." >&4
20998 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
20999 sig_name=`$awk 'BEGIN { printf "ZERO " }
21000 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
21001 sig_num=`$awk 'BEGIN { printf "0 " }
21002 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
21003 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
21004 !/^NSIG/ { printf "\"%s\", ", $1 }
21005 END { printf "0\n" }' signal.lst`
21006 sig_num_init=`$awk 'BEGIN { printf "0, " }
21007 !/^NSIG/ { printf "%d, ", $2}
21008 END { printf "0\n"}' signal.lst`
21011 echo "The following $sig_count signals are available:"
21013 echo $sig_name | $awk \
21014 'BEGIN { linelen = 0 }
21016 for (i = 1; i <= NF; i++) {
21017 name = "SIG" $i " "
21018 linelen = linelen + length(name)
21019 if (linelen > 70) {
21021 linelen = length(name)
21027 sig_size=`echo $sig_name | awk '{print NF}'`
21028 $rm -f signal signal.c signal.awk signal.lst signal_cmd
21030 : Check size of size
21032 case "$sizetype" in
21033 *_t) zzz="$sizetype" ;;
21034 *) zzz="filesize" ;;
21036 echo "Checking the size of $zzz..." >&4
21038 #include <sys/types.h>
21040 #$i_stdlib I_STDLIB
21042 #include <stdlib.h>
21045 printf("%d\n", (int)sizeof($sizetype));
21050 if eval $compile_ok; then
21054 echo "(I can't execute the test program--guessing $sizesize.)" >&4
21057 echo "Your $zzz size is $sizesize bytes."
21062 echo "(I can't compile the test program--guessing $sizesize.)" >&4
21066 : check for socklen_t
21068 echo "Checking to see if you have socklen_t..." >&4
21070 #include <sys/types.h>
21071 #$d_socket HAS_SOCKET
21073 #include <sys/socket.h>
21075 int main() { socklen_t x = 16; }
21078 if eval $compile; then
21080 echo "You have socklen_t."
21083 echo "You do not have socklen_t."
21084 case "$sizetype" in
21085 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
21092 : see if this is a socks.h system
21093 set socks.h i_socks
21096 : check for type of the size argument to socket calls
21097 case "$d_socket" in
21101 Checking to see what type is the last argument of accept().
21104 case "$d_socklen_t" in
21105 "$define") yyy="$yyy socklen_t"
21107 yyy="$yyy $sizetype int long unsigned"
21108 for xxx in $yyy; do
21109 case "$socksizetype" in
21110 '') try="$extern_C int accept(int, struct sockaddr *, $xxx *);"
21111 case "$usesocks" in
21113 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
21114 echo "Your system accepts '$xxx *' for the last argument of accept()."
21115 socksizetype="$xxx"
21118 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
21119 echo "Your system accepts '$xxx *' for the last argument of accept()."
21120 socksizetype="$xxx"
21127 : In case none of those worked, prompt the user.
21128 case "$socksizetype" in
21129 '') rp='What is the type for socket address structure sizes?'
21136 *) : no sockets, so pick relatively harmless default
21141 : see what type is used for signed size_t
21142 set ssize_t ssizetype int stdio.h sys/types.h
21147 #$i_stdlib I_STDLIB
21149 #include <stdlib.h>
21151 #include <sys/types.h>
21152 #define Size_t $sizetype
21153 #define SSize_t $dflt
21156 if (sizeof(Size_t) == sizeof(SSize_t))
21158 else if (sizeof(Size_t) == sizeof(int))
21167 if eval $compile_ok && $run ./try > /dev/null; then
21168 ssizetype=`$run ./try`
21169 echo "I'll be using $ssizetype for functions returning a byte count." >&4
21172 Help! I can't compile and run the ssize_t test program: please enlighten me!
21173 (This is probably a misconfiguration in your system or libraries, and
21174 you really ought to fix it. Still, I'll try anyway.)
21176 I need a type that is the same size as $sizetype, but is guaranteed to
21177 be signed. Common values are ssize_t, int and long.
21180 rp="What signed type is the same size as $sizetype?"
21186 : see what type of char stdio uses.
21188 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
21189 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
21190 echo "Your stdio uses unsigned chars." >&4
21191 stdchar="unsigned char"
21193 echo "Your stdio uses signed chars." >&4
21198 : see what type uids are declared as in the kernel
21200 echo "Looking for the type for user ids returned by getuid()."
21201 set uid_t uidtype xxx stdio.h sys/types.h
21205 xxx=`./findhdr sys/user.h`
21206 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
21208 unsigned) dflt="$1 $2" ;;
21212 *) dflt="$uidtype";;
21215 uid_t) echo "uid_t found." ;;
21216 *) rp="What is the type for user ids returned by getuid()?"
21222 : Check size of UID
21225 *_t) zzz="$uidtype" ;;
21228 echo "Checking the size of $zzz..." >&4
21230 #include <sys/types.h>
21232 #$i_stdlib I_STDLIB
21234 #include <stdlib.h>
21237 printf("%d\n", (int)sizeof($uidtype));
21242 if eval $compile_ok; then
21246 echo "(I can't execute the test program--guessing $uidsize.)" >&4
21249 echo "Your $zzz is $uidsize bytes long."
21254 echo "(I can't compile the test program--guessing $uidsize.)" >&4
21257 : Check if UID is signed
21260 *_t) zzz="$uidtype" ;;
21263 echo "Checking the sign of $zzz..." >&4
21265 #include <sys/types.h>
21276 if eval $compile; then
21280 echo "(I can't execute the test program--guessing unsigned.)" >&4
21284 1) echo "Your $zzz is unsigned." ;;
21285 -1) echo "Your $zzz is signed." ;;
21291 echo "(I can't compile the test program--guessing unsigned.)" >&4
21295 : Check format string for UID
21297 $echo "Checking the format string to be used for uids..." >&4
21300 -1) if $test X"$uidsize" = X"$ivsize"; then
21301 uidformat="$ivdformat"
21303 if $test X"$uidsize" = X"$longsize"; then
21306 if $test X"$uidsize" = X"$intsize"; then
21309 if $test X"$uidsize" = X"$shortsize"; then
21316 *) if $test X"$uidsize" = X"$uvsize"; then
21317 uidformat="$uvuformat"
21319 if $test X"$uidsize" = X"$longsize"; then
21322 if $test X"$uidsize" = X"$intsize"; then
21325 if $test X"$uidsize" = X"$shortsize"; then
21334 : Check if site customization support was requested
21335 case "$usesitecustomize" in
21336 $define|true|[Yy]*)
21337 usesitecustomize="$define"
21340 usesitecustomize="$undef"
21344 : see if prototypes support variable argument declarations
21346 case "$prototype$i_stdarg" in
21348 echo "It appears we'll be able to prototype varargs functions." >&4
21352 echo "Too bad... We won't be using prototyped varargs functions..." >&4
21359 : determine compiler compiler
21368 if $test -f "$byacc$_exe"; then
21370 comp="byacc or $comp"
21372 if $test -f "$bison$_exe"; then
21373 comp="$comp or bison -y"
21375 rp="Which compiler compiler ($comp) shall I use?"
21384 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
21390 : see if this is a assert.h system
21391 set assert.h i_assert
21394 : see if this is a fp.h system
21398 : see if this is a fp_class.h system
21399 set fp_class.h i_fp_class
21402 : see if gdbm.h is available
21407 : see if gdbm_open exists
21408 set gdbm_open d_gdbm_open
21410 case "$d_gdbm_open" in
21413 echo "We won't be including <gdbm.h>"
21422 : see if this is a ieeefp.h system
21423 case "$i_ieeefp" in
21424 '' ) set ieeefp.h i_ieeefp
21429 : see if this is a libutil.h system
21430 set libutil.h i_libutil
21433 : see if mach cthreads are available
21434 if test "X$usethreads" = "X$define"; then
21435 set mach/cthreads.h i_machcthr
21438 i_machcthr="$undef"
21441 : see if this is a mntent.h system
21442 set mntent.h i_mntent
21445 : see if net/errno.h is available
21447 set net/errno.h val
21450 : Unfortunately, it causes problems on some systems. Arrgh.
21453 cat > try.c <<'EOM'
21456 #include <net/errno.h>
21462 if $cc $ccflags -c try.c >/dev/null 2>&1; then
21463 echo "We'll be including <net/errno.h>." >&4
21465 echo "We won't be including <net/errno.h>." >&4
21474 : see if netinet/tcp.h is available
21475 set netinet/tcp.h i_netinettcp
21478 : see if this is a poll.h system
21482 : see if this is a prot.h system
21486 : Preprocessor symbols
21488 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
21489 $cat <<'EOSH' > Cppsym.know
21490 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
21491 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
21492 alliant alpha am29000 AM29000 AMD64 amd64 amiga AMIGAOS AMIX
21493 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
21494 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
21495 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
21496 bull c cadmus clipper CMU COFF COMPILER_VERSION
21497 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
21498 CYGWIN DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
21499 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
21500 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
21502 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
21503 H3050R H3050RX hbullx20 hcx host_mips
21504 hp200 hp300 hp700 HP700 hp800 hp9000
21505 hp9000s200 hp9000s300 hp9000s400 hp9000s500
21506 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
21507 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
21508 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
21509 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
21510 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
21511 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
21512 LIBCATAMOUNT Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
21513 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
21514 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
21515 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
21516 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
21517 MATH_HAS_NO_SIDE_EFFECTS
21518 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
21519 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
21520 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
21521 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
21522 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
21523 NetBSD news1500 news1700 news1800 news1900 news3700
21524 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
21525 ns32016 ns32332 ns32k nsc32000
21526 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
21527 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
21528 pc532 pdp11 PGC PIC plexus PORTAR posix
21529 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
21530 POSIX_C_SOURCE POSIX_SOURCE POWER
21531 PROTOTYPES PWB pyr QNX QK_USER R3000 REENTRANT RES Rhapsody RISC6000
21532 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
21533 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
21534 sony sony_news sonyrisc sparc sparclite spectrum
21535 stardent stdc STDC_EXT stratos sun sun3 sun386
21536 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
21537 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
21538 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
21539 sysV68 sysV88 Tek4132 Tek4300 titan
21540 TM3200 TM5400 TM5600
21541 tower tower32 tower32_200 tower32_600 tower32_700
21542 tower32_800 tower32_850 tss
21543 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
21544 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
21545 unix UNIX95 UNIX99 unixpc unos
21546 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
21547 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
21548 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
21550 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms x86_64 xenix Xenix286
21551 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
21552 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
21555 # Maybe put other stuff here too.
21556 cat <<EOSH >>Cppsym.know
21559 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
21560 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
21561 $cat Cppsym.know > Cppsym.c
21562 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
21563 $rm -f Cppsym.a Cppsym.b Cppsym.c
21564 cat <<EOSH > Cppsym
21566 if $test \$# -gt 0; then
21567 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
21568 if $test -s Cppsym.got; then
21575 $tr " " "$trnl" | ./Cppsym.try
21581 cat <<EOSH > Cppsym.try
21583 cat <<'EOCP' > try.c
21586 #define STRINGIFY(a) "a"
21588 #if cpp_stuff == 42
21589 #define StGiFy(a) #a
21590 #define STRINGIFY(a) StGiFy(a)
21592 #if $cpp_stuff != 1 && $cpp_stuff != 42
21593 # include "Bletch: How does this C preprocessor stringify macros?"
21599 cat <<'EOSH' >> Cppsym.try
21601 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
21602 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
21603 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
21604 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
21606 echo 'return 0;}' >> try.c
21608 cat <<EOSH >> Cppsym.try
21610 case "$osname-$gccversion" in
21611 irix-) ccflags="\$ccflags -woff 1178" ;;
21612 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
21614 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
21616 chmod +x Cppsym.try
21617 $eunicefix Cppsym.try
21618 ./Cppsym < Cppsym.know > Cppsym.true
21619 : Add in any linux cpp "predefined macros":
21620 case "$osname::$gccversion" in
21621 *linux*::*.*|*gnukfreebsd*::*.*|gnu::*.*)
21623 rm -f $tHdrH'.h' $tHdrH
21625 if $cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
21626 sed 's/#define[\ \ ]*//;s/[\ \ ].*$//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
21627 if [ -s $tHdrH'_cppsym.real' ]; then
21628 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
21631 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
21634 : now check the C compiler for additional symbols
21635 postprocess_cc_v=''
21637 aix) postprocess_cc_v="|$tr , ' '" ;;
21644 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
21647 -D*) echo "\$i" | $sed 's/^-D//';;
21648 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
21653 postprocess_cc_v=''
21656 ./ccsym > ccsym1.raw
21657 if $test -s ccsym1.raw; then
21658 $sort ccsym1.raw | $uniq >ccsym.raw
21660 mv ccsym1.raw ccsym.raw
21663 $awk '/\=/ { print $0; next }
21664 { print $0"=1" }' ccsym.raw >ccsym.list
21665 $comm -13 Cppsym.true ccsym.list >ccsym.own
21666 $comm -12 Cppsym.true ccsym.list >ccsym.com
21667 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
21669 if $test -z ccsym.raw; then
21670 echo "Your C compiler doesn't seem to define any symbols!" >&4
21672 echo "However, your C preprocessor defines the following symbols:"
21675 cppsymbols=`$cat Cppsym.true`
21676 cppsymbols=`echo $cppsymbols`
21677 cppccsymbols="$cppsymbols"
21679 if $test -s ccsym.com; then
21680 echo "Your C compiler and pre-processor define these symbols:"
21681 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
21684 cppccsymbols=`$cat ccsym.com`
21685 cppccsymbols=`echo $cppccsymbols`
21686 $test "$silent" || sleep 1
21688 if $test -s ccsym.cpp; then
21689 $test "$also" && echo " "
21690 echo "Your C pre-processor ${also}defines the following symbols:"
21691 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
21693 cppsymbols=`$cat ccsym.cpp`
21694 cppsymbols=`echo $cppsymbols`
21695 $test "$silent" || sleep 1
21697 if $test -s ccsym.own; then
21698 $test "$also" && echo " "
21699 echo "Your C compiler ${also}defines the following cpp symbols:"
21700 $sed -e 's/\(..*\)=1/\1/' ccsym.own
21701 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
21702 ccsymbols=`$cat ccsym.own`
21703 ccsymbols=`echo $ccsymbols`
21704 $test "$silent" || sleep 1
21708 : see if this is a termio system
21712 if $test `./findhdr termios.h`; then
21713 set tcsetattr i_termios
21719 "$define") echo "You have POSIX termios.h... good!" >&4;;
21720 *) if ./Cppsym pyr; then
21721 case "`/bin/universe`" in
21722 ucb) if $test `./findhdr sgtty.h`; then
21724 echo "<sgtty.h> found." >&4
21726 echo "System is pyramid with BSD universe."
21727 ./warn "<sgtty.h> not found--you could have problems."
21729 *) if $test `./findhdr termio.h`; then
21731 echo "<termio.h> found." >&4
21733 echo "System is pyramid with USG universe."
21734 ./warn "<termio.h> not found--you could have problems."
21738 if $test `./findhdr termio.h`; then
21739 echo "<termio.h> found." >&4
21741 elif $test `./findhdr sgtty.h`; then
21742 echo "<sgtty.h> found." >&4
21745 ./warn "Neither <termio.h> nor <sgtty.h> found--cross fingers!"
21748 if $test `./findhdr sgtty.h`; then
21749 echo "<sgtty.h> found." >&4
21751 elif $test `./findhdr termio.h`; then
21752 echo "<termio.h> found." >&4
21755 ./warn "Neither <sgtty.h> nor <termio.h> found--cross fingers!"
21759 set i_termio; eval $setvar
21760 val=$val2; set i_sgtty; eval $setvar
21761 val=$val3; set i_termios; eval $setvar
21763 : see if stddef is available
21764 set stddef.h i_stddef
21767 : see if sys/access.h is available
21768 set sys/access.h i_sysaccess
21771 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
21772 set sys/filio.h i_sysfilio
21775 if $test `./findhdr sys/ioctl.h`; then
21777 echo '<sys/ioctl.h> found.' >&4
21780 if $test $i_sysfilio = "$define"; then
21781 echo '<sys/ioctl.h> NOT found.' >&4
21783 $test $i_sgtty = "$define" && xxx="sgtty.h"
21784 $test $i_termio = "$define" && xxx="termio.h"
21785 $test $i_termios = "$define" && xxx="termios.h"
21786 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
21792 : see if socket ioctl defs are in sys/sockio.h
21794 xxx=`./findhdr sys/sockio.h`
21795 if $test "$xxx"; then
21796 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
21798 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
21801 echo "No socket ioctls found in <sys/sockio.h>." >&4
21806 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
21812 : see if this is a syslog.h system
21813 set syslog.h i_syslog
21816 : see if this is a sys/mode.h system
21817 set sys/mode.h i_sysmode
21820 : see if there is a sys/poll.h file
21821 set sys/poll.h i_syspoll
21824 : see if sys/resource.h has to be included
21825 set sys/resource.h i_sysresrc
21828 : see if sys/security.h is available
21829 set sys/security.h i_syssecrt
21832 : see if this is a sys/statvfs.h system
21833 set sys/statvfs.h i_sysstatvfs
21836 : see if this is a sys/un.h system
21837 set sys/un.h i_sysun
21840 : see if this is a sys/utsname.h system
21841 set sys/utsname.h i_sysutsname
21844 : see if this is a syswait system
21845 set sys/wait.h i_syswait
21848 : see if this is a ustat.h system
21849 set ustat.h i_ustat
21852 : see if this is an utime system
21853 set utime.h i_utime
21856 : see if this is a vfork system
21859 set vfork.h i_vfork
21869 echo "Looking for extensions..." >&4
21870 : If we are using the old config.sh, known_extensions may contain
21871 : old or inaccurate or duplicate values.
21872 known_extensions=''
21873 nonxs_extensions=''
21874 : We do not use find because it might not be available.
21875 : We do not just use MANIFEST because the user may have dropped
21876 : some additional extensions into the source tree and expect them
21879 : Function to recursively find available extensions, ignoring DynaLoader
21880 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
21881 : In 5.10.1 and later, extensions are stored in directories
21882 : like File-Glob instead of the older File/Glob/.
21886 DynaLoader|dynaload) ;;
21888 this_ext=`echo $xxx | $sed -e s/-/\\\//g`;
21889 leaf=`echo $xxx | $sed -e s/.*-//`;
21890 if $test -d File; then
21891 if $test -f $xxx/$leaf.xs -o -f $xxx/$leaf.c; then
21892 known_extensions="$known_extensions $1$this_ext";
21893 elif $test -f $xxx/Makefile.PL; then
21894 nonxs_extensions="$nonxs_extensions $1$this_ext";
21896 if $test -d $xxx -a $# -lt 10; then
21899 eval $find_extensions;
21905 $ls -1 $xxx > $$.tmp;
21906 if $contains "\.xs$" $$.tmp > /dev/null 2>&1; then
21907 known_extensions="$known_extensions $this_ext";
21908 elif $contains "\.c$" $$.tmp > /dev/null 2>&1; then
21909 known_extensions="$known_extensions $this_ext";
21910 elif $test -d $xxx; then
21911 nonxs_extensions="$nonxs_extensions $this_ext";
21922 eval $find_extensions
21926 eval $find_extensions
21930 eval $find_extensions
21931 if $test -d File-Glob; then
21932 : All ext/ flattened
21934 # Special case: Add in modules that nest beyond the first level.
21935 # Currently threads/shared and Hash/Util/FieldHash, since they are
21936 # not picked up by the recursive find above (and adding in general
21937 # recursive finding breaks SDBM_File/sdbm).
21938 # A.D. 20011025 (SDBM), ajgough 20071008 (FieldHash)
21939 known_extensions="$known_extensions threads/shared Hash/Util/FieldHash"
21941 set X $known_extensions
21943 known_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
21944 set X $nonxs_extensions
21946 nonxs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
21949 : Now see which are supported on this system.
21951 for xxx in $known_extensions ; do
21955 $define) avail_ext="$avail_ext $xxx" ;;
21958 GDBM_File|gdbm_fil)
21960 $define) avail_ext="$avail_ext $xxx" ;;
21963 I18N/Langinfo|i18n_lan)
21964 case "$i_langinfo$d_nl_langinfo" in
21965 $define$define) avail_ext="$avail_ext $xxx" ;;
21969 : XXX Do we need a useipcsysv variable here
21970 case "${d_msg}${d_sem}${d_shm}" in
21971 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
21974 NDBM_File|ndbm_fil)
21977 case "$osname-$use64bitint" in
21980 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
21983 *) avail_ext="$avail_ext $xxx" ;;
21988 ODBM_File|odbm_fil)
21989 case "${i_dbm}${i_rpcsvcdbm}" in
21991 case "$d_cplusplus" in
21992 define) ;; # delete as a function name will not work
21993 *) case "$osname-$use64bitint" in
21996 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
21999 *) avail_ext="$avail_ext $xxx" ;;
22007 case "$useopcode" in
22008 true|define|y) avail_ext="$avail_ext $xxx" ;;
22012 case "$useposix" in
22013 true|define|y) avail_ext="$avail_ext $xxx" ;;
22017 case "$d_socket" in
22020 beos) ;; # not unless BONE
22021 *) avail_ext="$avail_ext $xxx" ;;
22026 Sys/Syslog|sys/syslog)
22027 : XXX syslog requires socket
22028 case "$d_socket" in
22029 true|$define|y) avail_ext="$avail_ext $xxx" ;;
22033 case "$usethreads" in
22035 case "$use5005threads" in
22036 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
22040 threads|threads/shared)
22041 # threads and threads::shared are special cases.
22042 # To stop people from asking "Perl 5.8.0 was supposed
22043 # to have this new fancy threads implementation but my
22044 # perl doesn't have it" and from people trying to
22045 # (re)install the threads module using CPAN.pm and
22046 # CPAN.pm then offering to reinstall Perl 5.8.0,
22047 # the threads.pm and threads/shared.pm will always be
22048 # there, croaking informatively ("you need to rebuild
22049 # all of Perl with threads, sorry") when threads haven't
22050 # been compiled in.
22052 avail_ext="$avail_ext $xxx"
22058 cygwin) avail_ext="$avail_ext $xxx" ;;
22061 XS/APItest|xs/apitest)
22062 # This is just for testing. Skip it unless we have dynamic loading.
22065 $define) avail_ext="$avail_ext $xxx" ;;
22068 XS/Typemap|xs/typemap)
22069 # This is just for testing. Skip it unless we have dynamic loading.
22071 $define) avail_ext="$avail_ext $xxx" ;;
22074 *) avail_ext="$avail_ext $xxx"
22083 case "$onlyextensions" in
22085 *) keepextensions=''
22086 echo "You have requested that only certains extensions be included..." >&4
22087 for i in $onlyextensions; do
22088 case " $avail_ext " in
22090 echo "Keeping extension $i."
22091 keepextensions="$keepextensions $i"
22093 *) echo "Ignoring extension $i." ;;
22096 avail_ext="$keepextensions"
22100 case "$noextensions" in
22102 *) keepextensions=''
22103 echo "You have requested that certain extensions be ignored..." >&4
22104 for i in $avail_ext; do
22105 case " $noextensions " in
22106 *" $i "*) echo "Ignoring extension $i." ;;
22107 *) echo "Keeping extension $i.";
22108 keepextensions="$keepextensions $i"
22112 avail_ext="$keepextensions"
22116 : Now see which nonxs extensions are supported on this system.
22117 : For now assume all are.
22119 for xxx in $nonxs_extensions ; do
22121 *) nonxs_ext="$nonxs_ext $xxx"
22133 A number of extensions are supplied with $package. You may choose to
22134 compile these extensions for dynamic loading (the default), compile
22135 them into the $package executable (static loading), or not include
22136 them at all. Answer "none" to include no extensions.
22137 Note that DynaLoader is always built and need not be mentioned here.
22140 case "$dynamic_ext" in
22142 : Exclude those listed in static_ext
22144 for xxx in $avail_ext; do
22145 case " $static_ext " in
22147 *) dflt="$dflt $xxx" ;;
22154 *) dflt="$dynamic_ext"
22155 # Perhaps we are reusing an old out-of-date config.sh.
22158 if test X"$dynamic_ext" != X"$avail_ext"; then
22160 NOTICE: Your previous config.sh list may be incorrect.
22161 The extensions now available to you are
22163 but the default list from your previous config.sh is
22175 rp="What extensions do you wish to load dynamically?"
22178 none) dynamic_ext=' ' ;;
22179 *) dynamic_ext="$ans" ;;
22182 case "$static_ext" in
22184 : Exclude those already listed in dynamic linking
22186 for xxx in $avail_ext; do
22187 case " $dynamic_ext " in
22189 *) dflt="$dflt $xxx" ;;
22196 *) dflt="$static_ext"
22203 rp="What extensions do you wish to load statically?"
22206 none) static_ext=' ' ;;
22207 *) static_ext="$ans" ;;
22212 A number of extensions are supplied with $package. Answer "none"
22213 to include no extensions.
22214 Note that DynaLoader is always built and need not be mentioned here.
22217 case "$static_ext" in
22218 '') dflt="$avail_ext" ;;
22219 *) dflt="$static_ext"
22220 # Perhaps we are reusing an old out-of-date config.sh.
22223 if test X"$static_ext" != X"$avail_ext"; then
22225 NOTICE: Your previous config.sh list may be incorrect.
22226 The extensions now available to you are
22228 but the default list from your previous config.sh is
22237 : Exclude those that are not xs extensions
22241 rp="What extensions do you wish to include?"
22244 none) static_ext=' ' ;;
22245 *) static_ext="$ans" ;;
22250 # Encode is a special case. If we are building Encode as a static
22251 # extension, we need to explicitly list its subextensions as well.
22252 # For other nested extensions, this is handled automatically by
22253 # the appropriate Makefile.PL.
22254 case " $static_ext " in
22255 *" Encode "*) # Add the subextensions of Encode
22257 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
22258 static_ext="$static_ext Encode/$xxx"
22264 set X $dynamic_ext $static_ext $nonxs_ext
22268 # Sanity check: We require an extension suitable for use with
22269 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
22270 # should show up as failures in the test suite, but it's helpful to
22271 # catch them now.) The 'extensions' list is normally sorted
22272 # alphabetically, so we need to accept either
22273 # DB_File ... Fcntl ... IO ....
22274 # or something like
22275 # Fcntl ... NDBM_File ... IO ....
22276 case " $extensions" in
22277 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
22278 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
22279 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
22280 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
22281 echo "WARNING: The Perl you are building will be quite crippled." >& 4
22285 : Remove libraries needed only for extensions
22286 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
22287 : The exception is SunOS 4.x, which needs them.
22288 case "${osname}X${osvers}" in
22292 *) case "$usedl" in
22293 $define|true|[yY]*)
22294 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
22298 *) perllibs="$libs"
22304 : Remove build directory name from cppstdin so it can be used from
22305 : either the present location or the final installed location.
22307 : Get out of the UU directory to get correct path name.
22309 case "$cppstdin" in
22311 echo "Stripping down cppstdin path name"
22317 : end of configuration questions
22319 echo "End of configuration questions."
22322 : back to where it started
22323 if test -d ../UU; then
22327 : configuration may be unconditionally patched via a 'config.arch' file
22328 if $test -f config.arch; then
22329 echo "I see a config.arch file, loading it." >&4
22333 : configuration may be patched via a 'config.over' file
22334 if $test -f config.over; then
22337 rp='I see a config.over file. Do you wish to load it?'
22340 n*) echo "OK, I'll ignore it.";;
22342 echo "Configuration override changes have been loaded."
22347 : in case they want portability, strip down executable paths
22348 case "$d_portable" in
22351 echo "Stripping down executable paths..." >&4
22352 for file in $loclist $trylist; do
22354 eval $file=`basename $temp`
22359 : create config.sh file
22361 echo "Creating config.sh..." >&4
22362 $spitshell <<EOT >config.sh
22365 # This file was produced by running the Configure script. It holds all the
22366 # definitions figured out by Configure. Should you modify one of these values,
22367 # do not forget to propagate your changes by running "Configure -der". You may
22368 # instead choose to run each of the .SH files by yourself, or "Configure -S".
22371 # Package name : $package
22372 # Source directory : $src
22373 # Configuration time: $cf_time
22374 # Configured by : $cf_by
22375 # Target system : $myuname
22378 : Add in command line options if available
22379 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
22381 $spitshell <<EOT >>config.sh
22390 Revision='$Revision'
22398 alignbytes='$alignbytes'
22399 ansi2knr='$ansi2knr'
22400 aphostname='$aphostname'
22401 api_revision='$api_revision'
22402 api_subversion='$api_subversion'
22403 api_version='$api_version'
22404 api_versionstring='$api_versionstring'
22407 archlibexp='$archlibexp'
22408 archname64='$archname64'
22409 archname='$archname'
22410 archobjs='$archobjs'
22411 asctime_r_proto='$asctime_r_proto'
22420 byteorder='$byteorder'
22422 castflags='$castflags'
22425 cccdlflags='$cccdlflags'
22426 ccdlflags='$ccdlflags'
22428 ccflags_uselargefiles='$ccflags_uselargefiles'
22430 ccsymbols='$ccsymbols'
22431 ccversion='$ccversion'
22433 cf_email='$cf_email'
22435 charbits='$charbits'
22436 charsize='$charsize'
22440 clocktype='$clocktype'
22442 compress='$compress'
22443 contains='$contains'
22447 cpp_stuff='$cpp_stuff'
22448 cppccsymbols='$cppccsymbols'
22449 cppflags='$cppflags'
22451 cppminus='$cppminus'
22453 cppstdin='$cppstdin'
22454 cppsymbols='$cppsymbols'
22455 crypt_r_proto='$crypt_r_proto'
22456 cryptlib='$cryptlib'
22458 ctermid_r_proto='$ctermid_r_proto'
22459 ctime_r_proto='$ctime_r_proto'
22460 d_Gconvert='$d_Gconvert'
22461 d_PRIEUldbl='$d_PRIEUldbl'
22462 d_PRIFUldbl='$d_PRIFUldbl'
22463 d_PRIGUldbl='$d_PRIGUldbl'
22464 d_PRIXU64='$d_PRIXU64'
22465 d_PRId64='$d_PRId64'
22466 d_PRIeldbl='$d_PRIeldbl'
22467 d_PRIfldbl='$d_PRIfldbl'
22468 d_PRIgldbl='$d_PRIgldbl'
22469 d_PRIi64='$d_PRIi64'
22470 d_PRIo64='$d_PRIo64'
22471 d_PRIu64='$d_PRIu64'
22472 d_PRIx64='$d_PRIx64'
22473 d_SCNfldbl='$d_SCNfldbl'
22474 d__fwalk='$d__fwalk'
22475 d_access='$d_access'
22476 d_accessx='$d_accessx'
22479 d_archlib='$d_archlib'
22480 d_asctime64='$d_asctime64'
22481 d_asctime_r='$d_asctime_r'
22484 d_attribute_deprecated='$d_attribute_deprecated'
22485 d_attribute_format='$d_attribute_format'
22486 d_attribute_malloc='$d_attribute_malloc'
22487 d_attribute_nonnull='$d_attribute_nonnull'
22488 d_attribute_noreturn='$d_attribute_noreturn'
22489 d_attribute_pure='$d_attribute_pure'
22490 d_attribute_unused='$d_attribute_unused'
22491 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
22495 d_bsdgetpgrp='$d_bsdgetpgrp'
22496 d_bsdsetpgrp='$d_bsdsetpgrp'
22497 d_builtin_choose_expr='$d_builtin_choose_expr'
22498 d_builtin_expect='$d_builtin_expect'
22500 d_c99_variadic_macros='$d_c99_variadic_macros'
22501 d_casti32='$d_casti32'
22502 d_castneg='$d_castneg'
22503 d_charvspr='$d_charvspr'
22505 d_chroot='$d_chroot'
22506 d_chsize='$d_chsize'
22508 d_clearenv='$d_clearenv'
22509 d_closedir='$d_closedir'
22510 d_cmsghdr_s='$d_cmsghdr_s'
22512 d_copysignl='$d_copysignl'
22513 d_cplusplus='$d_cplusplus'
22515 d_crypt_r='$d_crypt_r'
22517 d_ctermid='$d_ctermid'
22518 d_ctermid_r='$d_ctermid_r'
22519 d_ctime64='$d_ctime64'
22520 d_ctime_r='$d_ctime_r'
22521 d_cuserid='$d_cuserid'
22522 d_dbl_dig='$d_dbl_dig'
22523 d_dbminitproto='$d_dbminitproto'
22524 d_difftime64='$d_difftime64'
22525 d_difftime='$d_difftime'
22526 d_dir_dd_fd='$d_dir_dd_fd'
22528 d_dirnamlen='$d_dirnamlen'
22529 d_dlerror='$d_dlerror'
22530 d_dlopen='$d_dlopen'
22531 d_dlsymun='$d_dlsymun'
22532 d_dosuid='$d_dosuid'
22533 d_drand48_r='$d_drand48_r'
22534 d_drand48proto='$d_drand48proto'
22536 d_eaccess='$d_eaccess'
22537 d_endgrent='$d_endgrent'
22538 d_endgrent_r='$d_endgrent_r'
22539 d_endhent='$d_endhent'
22540 d_endhostent_r='$d_endhostent_r'
22541 d_endnent='$d_endnent'
22542 d_endnetent_r='$d_endnetent_r'
22543 d_endpent='$d_endpent'
22544 d_endprotoent_r='$d_endprotoent_r'
22545 d_endpwent='$d_endpwent'
22546 d_endpwent_r='$d_endpwent_r'
22547 d_endsent='$d_endsent'
22548 d_endservent_r='$d_endservent_r'
22549 d_eofnblk='$d_eofnblk'
22550 d_eunice='$d_eunice'
22551 d_faststdio='$d_faststdio'
22552 d_fchdir='$d_fchdir'
22553 d_fchmod='$d_fchmod'
22554 d_fchown='$d_fchown'
22556 d_fcntl_can_lock='$d_fcntl_can_lock'
22557 d_fd_macros='$d_fd_macros'
22558 d_fd_set='$d_fd_set'
22559 d_fds_bits='$d_fds_bits'
22560 d_fgetpos='$d_fgetpos'
22561 d_finite='$d_finite'
22562 d_finitel='$d_finitel'
22563 d_flexfnam='$d_flexfnam'
22565 d_flockproto='$d_flockproto'
22567 d_fp_class='$d_fp_class'
22568 d_fpathconf='$d_fpathconf'
22569 d_fpclass='$d_fpclass'
22570 d_fpclassify='$d_fpclassify'
22571 d_fpclassl='$d_fpclassl'
22572 d_fpos64_t='$d_fpos64_t'
22573 d_frexpl='$d_frexpl'
22574 d_fs_data_s='$d_fs_data_s'
22575 d_fseeko='$d_fseeko'
22576 d_fsetpos='$d_fsetpos'
22577 d_fstatfs='$d_fstatfs'
22578 d_fstatvfs='$d_fstatvfs'
22580 d_ftello='$d_ftello'
22582 d_futimes='$d_futimes'
22583 d_gdbm_ndbm_h_uses_prototypes='$d_gdbm_ndbm_h_uses_prototypes'
22584 d_gdbmndbm_h_uses_prototypes='$d_gdbmndbm_h_uses_prototypes'
22585 d_getaddrinfo='$d_getaddrinfo'
22586 d_getcwd='$d_getcwd'
22587 d_getespwnam='$d_getespwnam'
22588 d_getfsstat='$d_getfsstat'
22589 d_getgrent='$d_getgrent'
22590 d_getgrent_r='$d_getgrent_r'
22591 d_getgrgid_r='$d_getgrgid_r'
22592 d_getgrnam_r='$d_getgrnam_r'
22593 d_getgrps='$d_getgrps'
22594 d_gethbyaddr='$d_gethbyaddr'
22595 d_gethbyname='$d_gethbyname'
22596 d_gethent='$d_gethent'
22597 d_gethname='$d_gethname'
22598 d_gethostbyaddr_r='$d_gethostbyaddr_r'
22599 d_gethostbyname_r='$d_gethostbyname_r'
22600 d_gethostent_r='$d_gethostent_r'
22601 d_gethostprotos='$d_gethostprotos'
22602 d_getitimer='$d_getitimer'
22603 d_getlogin='$d_getlogin'
22604 d_getlogin_r='$d_getlogin_r'
22605 d_getmnt='$d_getmnt'
22606 d_getmntent='$d_getmntent'
22607 d_getnameinfo='$d_getnameinfo'
22608 d_getnbyaddr='$d_getnbyaddr'
22609 d_getnbyname='$d_getnbyname'
22610 d_getnent='$d_getnent'
22611 d_getnetbyaddr_r='$d_getnetbyaddr_r'
22612 d_getnetbyname_r='$d_getnetbyname_r'
22613 d_getnetent_r='$d_getnetent_r'
22614 d_getnetprotos='$d_getnetprotos'
22615 d_getpagsz='$d_getpagsz'
22616 d_getpbyname='$d_getpbyname'
22617 d_getpbynumber='$d_getpbynumber'
22618 d_getpent='$d_getpent'
22619 d_getpgid='$d_getpgid'
22620 d_getpgrp2='$d_getpgrp2'
22621 d_getpgrp='$d_getpgrp'
22622 d_getppid='$d_getppid'
22623 d_getprior='$d_getprior'
22624 d_getprotobyname_r='$d_getprotobyname_r'
22625 d_getprotobynumber_r='$d_getprotobynumber_r'
22626 d_getprotoent_r='$d_getprotoent_r'
22627 d_getprotoprotos='$d_getprotoprotos'
22628 d_getprpwnam='$d_getprpwnam'
22629 d_getpwent='$d_getpwent'
22630 d_getpwent_r='$d_getpwent_r'
22631 d_getpwnam_r='$d_getpwnam_r'
22632 d_getpwuid_r='$d_getpwuid_r'
22633 d_getsbyname='$d_getsbyname'
22634 d_getsbyport='$d_getsbyport'
22635 d_getsent='$d_getsent'
22636 d_getservbyname_r='$d_getservbyname_r'
22637 d_getservbyport_r='$d_getservbyport_r'
22638 d_getservent_r='$d_getservent_r'
22639 d_getservprotos='$d_getservprotos'
22640 d_getspnam='$d_getspnam'
22641 d_getspnam_r='$d_getspnam_r'
22642 d_gettimeod='$d_gettimeod'
22643 d_gmtime64='$d_gmtime64'
22644 d_gmtime_r='$d_gmtime_r'
22645 d_gnulibc='$d_gnulibc'
22646 d_grpasswd='$d_grpasswd'
22647 d_hasmntopt='$d_hasmntopt'
22649 d_ilogbl='$d_ilogbl'
22650 d_inc_version_list='$d_inc_version_list'
22652 d_inetaton='$d_inetaton'
22653 d_inetntop='$d_inetntop'
22654 d_inetpton='$d_inetpton'
22655 d_int64_t='$d_int64_t'
22656 d_isascii='$d_isascii'
22657 d_isfinite='$d_isfinite'
22660 d_isnanl='$d_isnanl'
22661 d_killpg='$d_killpg'
22662 d_lchown='$d_lchown'
22663 d_ldbl_dig='$d_ldbl_dig'
22664 d_libm_lib_version='$d_libm_lib_version'
22666 d_localtime64='$d_localtime64'
22667 d_localtime_r='$d_localtime_r'
22668 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
22669 d_locconv='$d_locconv'
22671 d_longdbl='$d_longdbl'
22672 d_longlong='$d_longlong'
22673 d_lseekproto='$d_lseekproto'
22675 d_madvise='$d_madvise'
22676 d_malloc_good_size='$d_malloc_good_size'
22677 d_malloc_size='$d_malloc_size'
22679 d_mbstowcs='$d_mbstowcs'
22680 d_mbtowc='$d_mbtowc'
22681 d_memchr='$d_memchr'
22682 d_memcmp='$d_memcmp'
22683 d_memcpy='$d_memcpy'
22684 d_memmove='$d_memmove'
22685 d_memset='$d_memset'
22687 d_mkdtemp='$d_mkdtemp'
22688 d_mkfifo='$d_mkfifo'
22689 d_mkstemp='$d_mkstemp'
22690 d_mkstemps='$d_mkstemps'
22691 d_mktime64='$d_mktime64'
22692 d_mktime='$d_mktime'
22695 d_modfl_pow32_bug='$d_modfl_pow32_bug'
22696 d_modflproto='$d_modflproto'
22697 d_mprotect='$d_mprotect'
22699 d_msg_ctrunc='$d_msg_ctrunc'
22700 d_msg_dontroute='$d_msg_dontroute'
22701 d_msg_oob='$d_msg_oob'
22702 d_msg_peek='$d_msg_peek'
22703 d_msg_proxy='$d_msg_proxy'
22704 d_msgctl='$d_msgctl'
22705 d_msgget='$d_msgget'
22706 d_msghdr_s='$d_msghdr_s'
22707 d_msgrcv='$d_msgrcv'
22708 d_msgsnd='$d_msgsnd'
22710 d_munmap='$d_munmap'
22711 d_mymalloc='$d_mymalloc'
22713 d_ndbm_h_uses_prototypes='$d_ndbm_h_uses_prototypes'
22715 d_nl_langinfo='$d_nl_langinfo'
22716 d_nv_preserves_uv='$d_nv_preserves_uv'
22717 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
22718 d_off64_t='$d_off64_t'
22719 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
22720 d_oldpthreads='$d_oldpthreads'
22721 d_oldsock='$d_oldsock'
22723 d_pathconf='$d_pathconf'
22725 d_perl_otherlibdirs='$d_perl_otherlibdirs'
22726 d_phostname='$d_phostname'
22729 d_portable='$d_portable'
22731 d_prctl_set_name='$d_prctl_set_name'
22732 d_printf_format_null='$d_printf_format_null'
22733 d_procselfexe='$d_procselfexe'
22734 d_pseudofork='$d_pseudofork'
22735 d_pthread_atfork='$d_pthread_atfork'
22736 d_pthread_attr_setscope='$d_pthread_attr_setscope'
22737 d_pthread_yield='$d_pthread_yield'
22739 d_pwchange='$d_pwchange'
22740 d_pwclass='$d_pwclass'
22741 d_pwcomment='$d_pwcomment'
22742 d_pwexpire='$d_pwexpire'
22743 d_pwgecos='$d_pwgecos'
22744 d_pwpasswd='$d_pwpasswd'
22745 d_pwquota='$d_pwquota'
22748 d_random_r='$d_random_r'
22749 d_readdir64_r='$d_readdir64_r'
22750 d_readdir='$d_readdir'
22751 d_readdir_r='$d_readdir_r'
22752 d_readlink='$d_readlink'
22754 d_recvmsg='$d_recvmsg'
22755 d_rename='$d_rename'
22756 d_rewinddir='$d_rewinddir'
22758 d_safebcpy='$d_safebcpy'
22759 d_safemcpy='$d_safemcpy'
22760 d_sanemcmp='$d_sanemcmp'
22761 d_sbrkproto='$d_sbrkproto'
22762 d_scalbnl='$d_scalbnl'
22763 d_sched_yield='$d_sched_yield'
22764 d_scm_rights='$d_scm_rights'
22765 d_seekdir='$d_seekdir'
22766 d_select='$d_select'
22768 d_semctl='$d_semctl'
22769 d_semctl_semid_ds='$d_semctl_semid_ds'
22770 d_semctl_semun='$d_semctl_semun'
22771 d_semget='$d_semget'
22773 d_sendmsg='$d_sendmsg'
22774 d_setegid='$d_setegid'
22775 d_seteuid='$d_seteuid'
22776 d_setgrent='$d_setgrent'
22777 d_setgrent_r='$d_setgrent_r'
22778 d_setgrps='$d_setgrps'
22779 d_sethent='$d_sethent'
22780 d_sethostent_r='$d_sethostent_r'
22781 d_setitimer='$d_setitimer'
22782 d_setlinebuf='$d_setlinebuf'
22783 d_setlocale='$d_setlocale'
22784 d_setlocale_r='$d_setlocale_r'
22785 d_setnent='$d_setnent'
22786 d_setnetent_r='$d_setnetent_r'
22787 d_setpent='$d_setpent'
22788 d_setpgid='$d_setpgid'
22789 d_setpgrp2='$d_setpgrp2'
22790 d_setpgrp='$d_setpgrp'
22791 d_setprior='$d_setprior'
22792 d_setproctitle='$d_setproctitle'
22793 d_setprotoent_r='$d_setprotoent_r'
22794 d_setpwent='$d_setpwent'
22795 d_setpwent_r='$d_setpwent_r'
22796 d_setregid='$d_setregid'
22797 d_setresgid='$d_setresgid'
22798 d_setresuid='$d_setresuid'
22799 d_setreuid='$d_setreuid'
22800 d_setrgid='$d_setrgid'
22801 d_setruid='$d_setruid'
22802 d_setsent='$d_setsent'
22803 d_setservent_r='$d_setservent_r'
22804 d_setsid='$d_setsid'
22805 d_setvbuf='$d_setvbuf'
22809 d_shmatprototype='$d_shmatprototype'
22810 d_shmctl='$d_shmctl'
22812 d_shmget='$d_shmget'
22813 d_sigaction='$d_sigaction'
22814 d_signbit='$d_signbit'
22815 d_sigprocmask='$d_sigprocmask'
22816 d_sigsetjmp='$d_sigsetjmp'
22817 d_sitearch='$d_sitearch'
22818 d_snprintf='$d_snprintf'
22819 d_sockaddr_sa_len='$d_sockaddr_sa_len'
22820 d_sockatmark='$d_sockatmark'
22821 d_sockatmarkproto='$d_sockatmarkproto'
22822 d_socket='$d_socket'
22823 d_socklen_t='$d_socklen_t'
22824 d_sockpair='$d_sockpair'
22825 d_socks5_init='$d_socks5_init'
22826 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
22828 d_srand48_r='$d_srand48_r'
22829 d_srandom_r='$d_srandom_r'
22830 d_sresgproto='$d_sresgproto'
22831 d_sresuproto='$d_sresuproto'
22832 d_statblks='$d_statblks'
22833 d_statfs_f_flags='$d_statfs_f_flags'
22834 d_statfs_s='$d_statfs_s'
22835 d_static_inline='$d_static_inline'
22836 d_statvfs='$d_statvfs'
22837 d_stdio_cnt_lval='$d_stdio_cnt_lval'
22838 d_stdio_ptr_lval='$d_stdio_ptr_lval'
22839 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
22840 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
22841 d_stdio_stream_array='$d_stdio_stream_array'
22842 d_stdiobase='$d_stdiobase'
22843 d_stdstdio='$d_stdstdio'
22844 d_strchr='$d_strchr'
22845 d_strcoll='$d_strcoll'
22846 d_strctcpy='$d_strctcpy'
22847 d_strerrm='$d_strerrm'
22848 d_strerror='$d_strerror'
22849 d_strerror_r='$d_strerror_r'
22850 d_strftime='$d_strftime'
22851 d_strlcat='$d_strlcat'
22852 d_strlcpy='$d_strlcpy'
22853 d_strtod='$d_strtod'
22854 d_strtol='$d_strtol'
22855 d_strtold='$d_strtold'
22856 d_strtoll='$d_strtoll'
22857 d_strtoq='$d_strtoq'
22858 d_strtoul='$d_strtoul'
22859 d_strtoull='$d_strtoull'
22860 d_strtouq='$d_strtouq'
22861 d_strxfrm='$d_strxfrm'
22862 d_suidsafe='$d_suidsafe'
22863 d_symlink='$d_symlink'
22864 d_syscall='$d_syscall'
22865 d_syscallproto='$d_syscallproto'
22866 d_sysconf='$d_sysconf'
22867 d_sysernlst='$d_sysernlst'
22868 d_syserrlst='$d_syserrlst'
22869 d_system='$d_system'
22870 d_tcgetpgrp='$d_tcgetpgrp'
22871 d_tcsetpgrp='$d_tcsetpgrp'
22872 d_telldir='$d_telldir'
22873 d_telldirproto='$d_telldirproto'
22875 d_timegm='$d_timegm'
22877 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
22878 d_tm_tm_zone='$d_tm_tm_zone'
22879 d_tmpnam_r='$d_tmpnam_r'
22880 d_truncate='$d_truncate'
22881 d_ttyname_r='$d_ttyname_r'
22882 d_tzname='$d_tzname'
22883 d_u32align='$d_u32align'
22884 d_ualarm='$d_ualarm'
22887 d_union_semun='$d_union_semun'
22888 d_unordered='$d_unordered'
22889 d_unsetenv='$d_unsetenv'
22890 d_usleep='$d_usleep'
22891 d_usleepproto='$d_usleepproto'
22893 d_vendorarch='$d_vendorarch'
22894 d_vendorbin='$d_vendorbin'
22895 d_vendorlib='$d_vendorlib'
22896 d_vendorscript='$d_vendorscript'
22898 d_void_closedir='$d_void_closedir'
22899 d_voidsig='$d_voidsig'
22900 d_voidtty='$d_voidtty'
22901 d_volatile='$d_volatile'
22902 d_vprintf='$d_vprintf'
22903 d_vsnprintf='$d_vsnprintf'
22905 d_waitpid='$d_waitpid'
22906 d_wcstombs='$d_wcstombs'
22907 d_wctomb='$d_wctomb'
22908 d_writev='$d_writev'
22911 db_hashtype='$db_hashtype'
22912 db_prefixtype='$db_prefixtype'
22913 db_version_major='$db_version_major'
22914 db_version_minor='$db_version_minor'
22915 db_version_patch='$db_version_patch'
22916 defvoidused='$defvoidused'
22917 direntrytype='$direntrytype'
22920 doublesize='$doublesize'
22922 drand48_r_proto='$drand48_r_proto'
22924 dynamic_ext='$dynamic_ext'
22930 endgrent_r_proto='$endgrent_r_proto'
22931 endhostent_r_proto='$endhostent_r_proto'
22932 endnetent_r_proto='$endnetent_r_proto'
22933 endprotoent_r_proto='$endprotoent_r_proto'
22934 endpwent_r_proto='$endpwent_r_proto'
22935 endservent_r_proto='$endservent_r_proto'
22936 eunicefix='$eunicefix'
22939 extensions='$extensions'
22940 extern_C='$extern_C'
22942 fflushNULL='$fflushNULL'
22943 fflushall='$fflushall'
22945 firstmakefile='$firstmakefile'
22947 fpossize='$fpossize'
22948 fpostype='$fpostype'
22949 freetype='$freetype'
22952 full_csh='$full_csh'
22953 full_sed='$full_sed'
22954 gccansipedantic='$gccansipedantic'
22955 gccosandvers='$gccosandvers'
22956 gccversion='$gccversion'
22957 getgrent_r_proto='$getgrent_r_proto'
22958 getgrgid_r_proto='$getgrgid_r_proto'
22959 getgrnam_r_proto='$getgrnam_r_proto'
22960 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
22961 gethostbyname_r_proto='$gethostbyname_r_proto'
22962 gethostent_r_proto='$gethostent_r_proto'
22963 getlogin_r_proto='$getlogin_r_proto'
22964 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
22965 getnetbyname_r_proto='$getnetbyname_r_proto'
22966 getnetent_r_proto='$getnetent_r_proto'
22967 getprotobyname_r_proto='$getprotobyname_r_proto'
22968 getprotobynumber_r_proto='$getprotobynumber_r_proto'
22969 getprotoent_r_proto='$getprotoent_r_proto'
22970 getpwent_r_proto='$getpwent_r_proto'
22971 getpwnam_r_proto='$getpwnam_r_proto'
22972 getpwuid_r_proto='$getpwuid_r_proto'
22973 getservbyname_r_proto='$getservbyname_r_proto'
22974 getservbyport_r_proto='$getservbyport_r_proto'
22975 getservent_r_proto='$getservent_r_proto'
22976 getspnam_r_proto='$getspnam_r_proto'
22977 gidformat='$gidformat'
22983 gmtime_r_proto='$gmtime_r_proto'
22984 gnulibc_version='$gnulibc_version'
22986 groupcat='$groupcat'
22987 groupstype='$groupstype'
22990 h_sysfile='$h_sysfile'
22993 html1dir='$html1dir'
22994 html1direxp='$html1direxp'
22995 html3dir='$html3dir'
22996 html3direxp='$html3direxp'
23005 i_arpainet='$i_arpainet'
23006 i_assert='$i_assert'
23007 i_bsdioctl='$i_bsdioctl'
23011 i_dirent='$i_dirent'
23017 i_fp_class='$i_fp_class'
23019 i_gdbm_ndbm='$i_gdbm_ndbm'
23020 i_gdbmndbm='$i_gdbmndbm'
23022 i_ieeefp='$i_ieeefp'
23023 i_inttypes='$i_inttypes'
23024 i_langinfo='$i_langinfo'
23025 i_libutil='$i_libutil'
23026 i_limits='$i_limits'
23027 i_locale='$i_locale'
23028 i_machcthr='$i_machcthr'
23029 i_malloc='$i_malloc'
23030 i_mallocmalloc='$i_mallocmalloc'
23032 i_memory='$i_memory'
23033 i_mntent='$i_mntent'
23036 i_neterrno='$i_neterrno'
23037 i_netinettcp='$i_netinettcp'
23041 i_pthread='$i_pthread'
23043 i_rpcsvcdbm='$i_rpcsvcdbm'
23046 i_shadow='$i_shadow'
23048 i_stdarg='$i_stdarg'
23049 i_stddef='$i_stddef'
23050 i_stdlib='$i_stdlib'
23051 i_string='$i_string'
23052 i_sunmath='$i_sunmath'
23053 i_sysaccess='$i_sysaccess'
23054 i_sysdir='$i_sysdir'
23055 i_sysfile='$i_sysfile'
23056 i_sysfilio='$i_sysfilio'
23058 i_sysioctl='$i_sysioctl'
23059 i_syslog='$i_syslog'
23060 i_sysmman='$i_sysmman'
23061 i_sysmode='$i_sysmode'
23062 i_sysmount='$i_sysmount'
23063 i_sysndir='$i_sysndir'
23064 i_sysparam='$i_sysparam'
23065 i_syspoll='$i_syspoll'
23066 i_sysresrc='$i_sysresrc'
23067 i_syssecrt='$i_syssecrt'
23068 i_sysselct='$i_sysselct'
23069 i_syssockio='$i_syssockio'
23070 i_sysstat='$i_sysstat'
23071 i_sysstatfs='$i_sysstatfs'
23072 i_sysstatvfs='$i_sysstatvfs'
23073 i_systime='$i_systime'
23074 i_systimek='$i_systimek'
23075 i_systimes='$i_systimes'
23076 i_systypes='$i_systypes'
23077 i_sysuio='$i_sysuio'
23079 i_sysutsname='$i_sysutsname'
23080 i_sysvfs='$i_sysvfs'
23081 i_syswait='$i_syswait'
23082 i_termio='$i_termio'
23083 i_termios='$i_termios'
23085 i_unistd='$i_unistd'
23088 i_values='$i_values'
23089 i_varargs='$i_varargs'
23090 i_varhdr='$i_varhdr'
23092 ignore_versioned_solibs='$ignore_versioned_solibs'
23093 inc_version_list='$inc_version_list'
23094 inc_version_list_init='$inc_version_list_init'
23097 initialinstalllocation='$initialinstalllocation'
23098 installarchlib='$installarchlib'
23099 installbin='$installbin'
23100 installhtml1dir='$installhtml1dir'
23101 installhtml3dir='$installhtml3dir'
23102 installman1dir='$installman1dir'
23103 installman3dir='$installman3dir'
23104 installprefix='$installprefix'
23105 installprefixexp='$installprefixexp'
23106 installprivlib='$installprivlib'
23107 installscript='$installscript'
23108 installsitearch='$installsitearch'
23109 installsitebin='$installsitebin'
23110 installsitehtml1dir='$installsitehtml1dir'
23111 installsitehtml3dir='$installsitehtml3dir'
23112 installsitelib='$installsitelib'
23113 installsiteman1dir='$installsiteman1dir'
23114 installsiteman3dir='$installsiteman3dir'
23115 installsitescript='$installsitescript'
23116 installstyle='$installstyle'
23117 installusrbinperl='$installusrbinperl'
23118 installvendorarch='$installvendorarch'
23119 installvendorbin='$installvendorbin'
23120 installvendorhtml1dir='$installvendorhtml1dir'
23121 installvendorhtml3dir='$installvendorhtml3dir'
23122 installvendorlib='$installvendorlib'
23123 installvendorman1dir='$installvendorman1dir'
23124 installvendorman3dir='$installvendorman3dir'
23125 installvendorscript='$installvendorscript'
23127 issymlink='$issymlink'
23128 ivdformat='$ivdformat'
23131 known_extensions='$known_extensions'
23134 lddlflags='$lddlflags'
23136 ldflags_uselargefiles='$ldflags_uselargefiles'
23137 ldlibpthname='$ldlibpthname'
23144 libsdirs='$libsdirs'
23145 libsfiles='$libsfiles'
23146 libsfound='$libsfound'
23147 libspath='$libspath'
23148 libswanted='$libswanted'
23149 libswanted_uselargefiles='$libswanted_uselargefiles'
23155 localtime_r_proto='$localtime_r_proto'
23156 locincpth='$locincpth'
23157 loclibpth='$loclibpth'
23158 longdblsize='$longdblsize'
23159 longlongsize='$longlongsize'
23160 longsize='$longsize'
23164 lseeksize='$lseeksize'
23165 lseektype='$lseektype'
23168 madlyobj='$madlyobj'
23169 madlysrc='$madlysrc'
23173 make_set_make='$make_set_make'
23174 mallocobj='$mallocobj'
23175 mallocsrc='$mallocsrc'
23176 malloctype='$malloctype'
23178 man1direxp='$man1direxp'
23181 man3direxp='$man3direxp'
23183 mips_type='$mips_type'
23184 mistrustnm='$mistrustnm'
23186 mmaptype='$mmaptype'
23187 modetype='$modetype'
23189 multiarch='$multiarch'
23191 myarchname='$myarchname'
23192 mydomain='$mydomain'
23193 myhostname='$myhostname'
23196 need_va_copy='$need_va_copy'
23197 netdb_hlen_type='$netdb_hlen_type'
23198 netdb_host_type='$netdb_host_type'
23199 netdb_name_type='$netdb_name_type'
23200 netdb_net_type='$netdb_net_type'
23203 nm_so_opt='$nm_so_opt'
23204 nonxs_ext='$nonxs_ext'
23206 nvEUformat='$nvEUformat'
23207 nvFUformat='$nvFUformat'
23208 nvGUformat='$nvGUformat'
23209 nv_overflows_integers_at='$nv_overflows_integers_at'
23210 nv_preserves_uv_bits='$nv_preserves_uv_bits'
23211 nveformat='$nveformat'
23212 nvfformat='$nvfformat'
23213 nvgformat='$nvgformat'
23216 o_nonblock='$o_nonblock'
23218 old_pthread_create_joinable='$old_pthread_create_joinable'
23219 optimize='$optimize'
23220 orderlib='$orderlib'
23223 otherlibdirs='$otherlibdirs'
23227 patchlevel='$patchlevel'
23228 path_sep='$path_sep'
23231 perl_patchlevel='$perl_patchlevel'
23232 perl_static_inline='$perl_static_inline'
23233 perladmin='$perladmin'
23234 perllibs='$perllibs'
23235 perlpath='$perlpath'
23237 phostname='$phostname'
23243 prefixexp='$prefixexp'
23245 privlibexp='$privlibexp'
23246 procselfexe='$procselfexe'
23247 prototype='$prototype'
23249 quadkind='$quadkind'
23250 quadtype='$quadtype'
23251 randbits='$randbits'
23252 randfunc='$randfunc'
23253 random_r_proto='$random_r_proto'
23254 randseedtype='$randseedtype'
23256 rd_nodata='$rd_nodata'
23257 readdir64_r_proto='$readdir64_r_proto'
23258 readdir_r_proto='$readdir_r_proto'
23259 revision='$revision'
23265 sGMTIME_max='$sGMTIME_max'
23266 sGMTIME_min='$sGMTIME_min'
23267 sLOCALTIME_max='$sLOCALTIME_max'
23268 sLOCALTIME_min='$sLOCALTIME_min'
23269 sPRIEUldbl='$sPRIEUldbl'
23270 sPRIFUldbl='$sPRIFUldbl'
23271 sPRIGUldbl='$sPRIGUldbl'
23272 sPRIXU64='$sPRIXU64'
23274 sPRIeldbl='$sPRIeldbl'
23275 sPRIfldbl='$sPRIfldbl'
23276 sPRIgldbl='$sPRIgldbl'
23281 sSCNfldbl='$sSCNfldbl'
23282 sched_yield='$sched_yield'
23283 scriptdir='$scriptdir'
23284 scriptdirexp='$scriptdirexp'
23286 seedfunc='$seedfunc'
23287 selectminbits='$selectminbits'
23288 selecttype='$selecttype'
23289 sendmail='$sendmail'
23290 setgrent_r_proto='$setgrent_r_proto'
23291 sethostent_r_proto='$sethostent_r_proto'
23292 setlocale_r_proto='$setlocale_r_proto'
23293 setnetent_r_proto='$setnetent_r_proto'
23294 setprotoent_r_proto='$setprotoent_r_proto'
23295 setpwent_r_proto='$setpwent_r_proto'
23296 setservent_r_proto='$setservent_r_proto'
23299 sharpbang='$sharpbang'
23300 shmattype='$shmattype'
23301 shortsize='$shortsize'
23304 sig_count='$sig_count'
23305 sig_name='$sig_name'
23306 sig_name_init='$sig_name_init'
23308 sig_num_init='$sig_num_init'
23309 sig_size='$sig_size'
23310 signal_t='$signal_t'
23311 sitearch='$sitearch'
23312 sitearchexp='$sitearchexp'
23314 sitebinexp='$sitebinexp'
23315 sitehtml1dir='$sitehtml1dir'
23316 sitehtml1direxp='$sitehtml1direxp'
23317 sitehtml3dir='$sitehtml3dir'
23318 sitehtml3direxp='$sitehtml3direxp'
23320 sitelib_stem='$sitelib_stem'
23321 sitelibexp='$sitelibexp'
23322 siteman1dir='$siteman1dir'
23323 siteman1direxp='$siteman1direxp'
23324 siteman3dir='$siteman3dir'
23325 siteman3direxp='$siteman3direxp'
23326 siteprefix='$siteprefix'
23327 siteprefixexp='$siteprefixexp'
23328 sitescript='$sitescript'
23329 sitescriptexp='$sitescriptexp'
23330 sizesize='$sizesize'
23331 sizetype='$sizetype'
23335 sockethdr='$sockethdr'
23336 socketlib='$socketlib'
23337 socksizetype='$socksizetype'
23339 spackage='$spackage'
23340 spitshell='$spitshell'
23341 srand48_r_proto='$srand48_r_proto'
23342 srandom_r_proto='$srandom_r_proto'
23344 ssizetype='$ssizetype'
23345 startperl='$startperl'
23347 static_ext='$static_ext'
23349 stdio_base='$stdio_base'
23350 stdio_bufsiz='$stdio_bufsiz'
23351 stdio_cnt='$stdio_cnt'
23352 stdio_filbuf='$stdio_filbuf'
23353 stdio_ptr='$stdio_ptr'
23354 stdio_stream_array='$stdio_stream_array'
23355 strerror_r_proto='$strerror_r_proto'
23358 subversion='$subversion'
23362 targetarch='$targetarch'
23366 timeincl='$timeincl'
23367 timetype='$timetype'
23368 tmpnam_r_proto='$tmpnam_r_proto'
23374 ttyname_r_proto='$ttyname_r_proto'
23383 uidformat='$uidformat'
23389 uquadtype='$uquadtype'
23390 use5005threads='$use5005threads'
23391 use64bitall='$use64bitall'
23392 use64bitint='$use64bitint'
23393 usecrosscompile='$usecrosscompile'
23394 usedevel='$usedevel'
23396 usedtrace='$usedtrace'
23397 usefaststdio='$usefaststdio'
23398 useithreads='$useithreads'
23399 uselargefiles='$uselargefiles'
23400 uselongdouble='$uselongdouble'
23401 usemallocwrap='$usemallocwrap'
23402 usemorebits='$usemorebits'
23403 usemultiplicity='$usemultiplicity'
23404 usemymalloc='$usemymalloc'
23406 useopcode='$useopcode'
23407 useperlio='$useperlio'
23408 useposix='$useposix'
23409 usereentrant='$usereentrant'
23410 userelocatableinc='$userelocatableinc'
23412 useshrplib='$useshrplib'
23413 usesitecustomize='$usesitecustomize'
23414 usesocks='$usesocks'
23415 usethreads='$usethreads'
23416 usevendorprefix='$usevendorprefix'
23417 usevfork='$usevfork'
23420 uvXUformat='$uvXUformat'
23421 uvoformat='$uvoformat'
23424 uvuformat='$uvuformat'
23425 uvxformat='$uvxformat'
23427 vendorarch='$vendorarch'
23428 vendorarchexp='$vendorarchexp'
23429 vendorbin='$vendorbin'
23430 vendorbinexp='$vendorbinexp'
23431 vendorhtml1dir='$vendorhtml1dir'
23432 vendorhtml1direxp='$vendorhtml1direxp'
23433 vendorhtml3dir='$vendorhtml3dir'
23434 vendorhtml3direxp='$vendorhtml3direxp'
23435 vendorlib='$vendorlib'
23436 vendorlib_stem='$vendorlib_stem'
23437 vendorlibexp='$vendorlibexp'
23438 vendorman1dir='$vendorman1dir'
23439 vendorman1direxp='$vendorman1direxp'
23440 vendorman3dir='$vendorman3dir'
23441 vendorman3direxp='$vendorman3direxp'
23442 vendorprefix='$vendorprefix'
23443 vendorprefixexp='$vendorprefixexp'
23444 vendorscript='$vendorscript'
23445 vendorscriptexp='$vendorscriptexp'
23447 version_patchlevel_string='$version_patchlevel_string'
23448 versiononly='$versiononly'
23450 voidflags='$voidflags'
23453 yaccflags='$yaccflags'
23458 : add special variables
23459 $test -f $src/patchlevel.h && \
23460 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
23461 echo "PERL_PATCHLEVEL='$perl_patchlevel'" >>config.sh
23462 echo "PERL_CONFIG_SH=true" >>config.sh
23464 : propagate old symbols
23465 if $test -f UU/config.sh; then
23466 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
23467 $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \
23468 config.sh config.sh UU/oldconfig.sh |\
23469 $sort | $uniq -u >UU/oldsyms
23470 set X `cat UU/oldsyms`
23476 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
23478 echo ": Variables propagated from previous config.sh file." >>config.sh
23479 for sym in `cat UU/oldsyms`; do
23480 echo " Propagating $hint variable "'$'"$sym..."
23481 eval 'tmp="$'"${sym}"'"'
23483 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
23489 : Finish up by extracting the .SH files
23493 echo "Extraction done."
23503 If you'd like to make any changes to the config.sh file before I begin
23504 to configure things, do it as a shell escape now (e.g. !vi config.sh).
23507 rp="Press return or use a shell escape to edit config.sh:"
23512 *) : in case they cannot read
23513 sh 1>&4 -c "$ans";;
23518 : if this fails, just run all the .SH files by hand
23527 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
23534 Now you need to generate make dependencies by running "$make depend".
23535 You might prefer to run it in background: "$make depend > makedepend.out &"
23536 It can take a while, so you might not want to run it right now.
23541 rp="Run $make depend now?"
23545 $make depend && echo "Now you must run '$make'."
23548 echo "You must run '$make depend' then '$make'."
23551 elif test -f [Mm]akefile; then
23553 echo "Now you must run a $make."
23555 echo "Configure done."
23558 if $test -f Policy.sh; then
23561 If you compile $package on a different machine or from a different object
23562 directory, copy the Policy.sh file from this object directory to the
23563 new one before you run Configure -- this will help you with most of
23564 the policy defaults.
23568 if $test -f config.msg; then
23569 echo "Hmm. I also noted the following information while running:"
23571 $cat config.msg >&4
23574 $rm -f kit*isdone ark*isdone