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.code.sf.net/p/dist/code/trunk/dist
19 # Though this script was generated by metaconfig from metaunits, it is
20 # OK to send patches against Configure itself. It's up to the Configure
21 # pumpkin to backport the patch to the metaunits if it is accepted.
22 # For more information on patching Configure, see pod/perlhack.pod
24 # The metaunits are also available from the public git repository:
25 # http://perl5.git.perl.org/metaconfig.git/ or
26 # $ git clone git://perl5.git.perl.org/metaconfig.git metaconfig
28 # See Porting/pumpkin.pod for more information on metaconfig.
31 # Generated using [metaconfig 3.5 PL0]
32 # (with additional metaconfig patches by perlbug@perl.org)
37 SCO csh still thinks true is false. Write to SCO today and tell them that next
38 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
40 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
41 we'd have to do is go in and swap the && and || tokens, wherever they are.)
43 [End of diatribe. We now return you to your regularly scheduled programming...]
47 OOPS! You naughty creature! You didn't run Configure with sh!
48 I will attempt to remedy the situation by running sh for you...
52 true || exec sh $0 $argv:q
54 (exit $?0) || cat c2$$
55 (exit $?0) || exec sh $0 $argv:q
58 if test -f /dev/cputype -a -f /dev/drivers -a -f /dev/osversion; then
61 *** I'm sorry but this system looks like Plan 9 and Plan 9 doesn't do
62 *** Configure that well. (Plan 9 is close to UNIX but not close enough.)
63 *** Please read the README.plan9 for further instructions.
64 *** Cannot continue, aborting.
70 if test ! -c /dev/null ; then
73 *** I'm sorry, but /dev/null appears to be a file rather than a device.
74 *** Please consult your operating sytem's notes for making a device
76 *** Cannot continue, aborting.
82 : compute my invocation name
86 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
91 : Proper separator for the PATH environment variable
93 : On OS/2 this directory should exist if this is not floppy only system ":-]"
94 if test -d c:/. || ( uname -a | grep -i 'os\(/\|\)2' 2>&1 ) 2>&1 >/dev/null ; then
95 if test -n "$OS2_SHELL"; then
97 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
98 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
100 elif test -n "$DJGPP"; then
101 case "X${MACHTYPE:-nonesuchmach}" in
108 : Proper PATH setting
109 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
110 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
111 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
112 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
113 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
114 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /opt/ansic/bin /usr/ccs/bin"
115 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
116 paths="$paths /sbin /usr/sbin /usr/libexec"
117 paths="$paths /system/gnu_library/bin"
121 case "$p_$PATH$p_" in
123 *) test -d $p && PATH=$PATH$p_$p ;;
130 : shall we be using ksh?
136 if (PATH=.; alias -x) >/dev/null 2>&1; then
139 if test -f /hp-ux -a -f /bin/ksh; then
140 needksh='to avoid sh bug in "here document" expansion'
142 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
143 if test X`/usr/bin/uname -v` = X4; then
144 avoidksh="to avoid AIX 4's /bin/sh"
148 if test -f /osf_boot -a -f /usr/sbin/setld; then
149 if test X`/usr/bin/uname -s` = XOSF1; then
150 avoidksh="to avoid Digital UNIX' ksh"
155 case "$inksh/$needksh" in
162 case "$inksh/$avoidksh" in
168 case "$inksh/$needksh-$avoidksh-" in
171 (I see you are using the Korn shell. Some ksh's blow up on $me,
172 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
179 echo "(Feeding myself to $newsh $reason.)"
181 Configure|*/Configure) exec $newsh $0 "$@";;
182 *) exec $newsh Configure "$@";;
186 test -x "${newsh}" || unset newsh
188 : if needed, set CDPATH to a harmless value that is not chatty
189 : avoid bash 2.02 problems with empty CDPATH.
193 *bash*) CDPATH='.' ;;
199 : Configure runs within the UU subdirectory
200 test -d UU || mkdir UU
344 useversionedarchname=''
350 initialinstalllocation=''
379 d_attribute_deprecated=''
380 d_attribute_format=''
381 d_attribute_malloc=''
382 d_attribute_nonnull=''
383 d_attribute_noreturn=''
385 d_attribute_unused=''
386 d_attribute_warn_unused_result=''
387 d_printf_format_null=''
391 d_builtin_choose_expr=''
394 d_c99_variadic_macros=''
442 endhostent_r_proto=''
448 endprotoent_r_proto=''
454 endservent_r_proto=''
507 gethostbyaddr_r_proto=''
509 gethostbyname_r_proto=''
511 gethostent_r_proto=''
524 getnetbyaddr_r_proto=''
526 getnetbyname_r_proto=''
540 d_getprotobyname_r=''
541 getprotobyname_r_proto=''
542 d_getprotobynumber_r=''
543 getprotobynumber_r_proto=''
545 getprotoent_r_proto=''
557 getservbyname_r_proto=''
559 getservbyport_r_proto=''
561 getservent_r_proto=''
588 d_libm_lib_version=''
591 d_localtime_r_needs_tzset=''
603 d_malloc_good_size=''
647 d_old_pthread_create_joinable=''
648 old_pthread_create_joinable=''
650 d_pthread_attr_setscope=''
690 sethostent_r_proto=''
707 setprotoent_r_proto=''
719 setservent_r_proto=''
741 d_ipv6_mreq_source=''
758 d_sprintf_returns_strlen=''
770 perl_static_inline=''
775 d_stdio_ptr_lval_nochange_cnt=''
776 d_stdio_ptr_lval_sets_cnt=''
924 d_gdbm_ndbm_h_uses_prototypes=''
925 d_gdbmndbm_h_uses_prototypes=''
927 d_ndbm_h_uses_prototypes=''
1001 d_inc_version_list=''
1003 inc_version_list_init=''
1007 installusrbinperl=''
1023 ignore_versioned_solibs=''
1083 d_perl_otherlibdirs=''
1091 api_versionstring=''
1097 version_patchlevel_string=''
1101 d_nv_preserves_uv=''
1102 d_nv_zero_is_allbits_zero=''
1113 nv_overflows_integers_at=''
1114 nv_preserves_uv_bits=''
1187 installsitehtml1dir=''
1190 installsitehtml3dir=''
1197 installsiteman1dir=''
1200 installsiteman3dir=''
1205 installsitescript=''
1223 d_stdio_stream_array=''
1224 stdio_stream_array=''
1242 usekernprocpathname=''
1243 ccflags_uselargefiles=''
1244 ldflags_uselargefiles=''
1245 libswanted_uselargefiles=''
1254 usensgetexecutablepath=''
1267 installvendorarch=''
1274 installvendorhtml1dir=''
1276 vendorhtml1direxp=''
1277 installvendorhtml3dir=''
1279 vendorhtml3direxp=''
1285 installvendorman1dir=''
1288 installvendorman3dir=''
1295 installvendorscript=''
1306 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1309 : We must find out about Eunice early
1311 if test -f /etc/unixtovms; then
1312 eunicefix=/etc/unixtovms
1314 if test -f /etc/unixtovms.exe; then
1315 eunicefix=/etc/unixtovms.exe
1318 : Set executable suffix now -- needed before hints available
1319 if test -f "/libs/version.library"; then
1322 elif test -f "/system/gnu_library/bin/ar.pm"; then
1325 elif test -n "$DJGPP"; then
1328 elif test -f /kern/cookiejar; then
1331 elif test -d c:/. -o -n "$is_os2" ; then
1338 : Trailing extension. Override this in a hint file, if needed.
1339 : Extra object files, if any, needed on this platform.
1342 : Possible local include directories to search.
1343 : Set locincpth to "" in a hint file to defeat local include searches.
1344 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1345 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1347 : no include file wanted by default
1350 : Enable -DEBUGGING and -DDEBUGGING from the command line
1355 : change the next line if compiling for Xenix/286 on Xenix/386
1356 xlibpth='/usr/lib/386 /lib/386'
1357 : Possible local library directories to search.
1358 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1359 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1361 : general looking path for locating libraries
1362 glibpth="/lib /usr/lib $xlibpth"
1363 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1364 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1365 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1366 test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
1368 : Private path used by Configure to find libraries. Its value
1369 : is prepended to libpth. This variable takes care of special
1370 : machines, like the mips. Usually, it should be empty.
1373 : default library list
1375 : some systems want to use only the non-versioned libso:s
1376 ignore_versioned_solibs=''
1377 : set usethreads on the Configure command line to enable threads.
1378 usereentrant='undef'
1382 : set useposix=false in your hint file to disable the POSIX extension.
1384 : set useopcode=false in your hint file to disable the Opcode extension.
1387 ccflags_uselargefiles=''
1388 ldflags_uselargefiles=''
1389 libswanted_uselargefiles=''
1390 : set usemultiplicity on the Configure command line to enable multiplicity.
1391 : set usesocks on the Configure command line to enable socks.
1392 : List of libraries we want.
1393 : If anyone needs extra -lxxx, put those in a hint file.
1394 libswanted="socket bind inet nsl nm ndbm gdbm dbm db malloc dl ld sun"
1395 libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
1396 : We probably want to search /usr/shlib before most other libraries.
1397 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1398 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1399 glibpth="/usr/shlib $glibpth"
1400 : Do not use vfork unless overridden by a hint file.
1403 : Find the basic shell for Bourne shell scripts
1407 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1410 if test -f "$xxx"; then
1413 : Build up a list and do a single loop so we can 'break' out.
1414 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1415 for xxx in sh bash ksh pdksh ash; do
1417 try="$try ${p}/${xxx}"
1421 if test -f "$xxx"; then
1424 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1427 elif test -f "$xxx.exe"; then
1438 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1440 Usually it's in /bin/sh. How did you even get this far?
1441 Please contact me (Perl Maintainers) at perlbug@perl.org and
1442 we'll try to straighten this all out.
1448 : When cross-compiling we need to separate the sh-to-run-Configure-with from the sh-to-use-in-Perl
1449 : default both to the same thing, cross-compilers can then set targetsh differently if they like
1452 : see if sh knows # comments
1453 if `$sh -c '#' >/dev/null 2>&1`; then
1457 test -f $xcat$_exe || xcat=/usr/bin/cat
1458 if test ! -f $xcat$_exe; then
1459 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1460 if test -f $p/cat$_exe; then
1465 if test ! -f $xcat$_exe; then
1466 echo "Can't find cat anywhere!"
1470 echo "#!$xcat" >sharp
1473 ./sharp > today 2>/dev/null
1474 if test -s today; then
1477 echo "#! $xcat" > sharp
1480 ./sharp > today 2>/dev/null
1481 if test -s today; then
1489 echo "Your $sh doesn't grok # comments--I will strip them later on."
1492 echo "exec grep -v '^[ ]*#'" >spitshell
1494 $eunicefix spitshell
1495 spitshell=`pwd`/spitshell
1497 echo "I presume that if # doesn't work, #! won't work either!"
1502 : figure out how to guarantee sh startup
1504 '') startsh=${sharpbang}${sh} ;;
1516 : echo "Yup, it does."
1518 echo "Hmm... '$startsh' does not guarantee sh startup..."
1519 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1523 : Save command line options in file UU/cmdline.opt for later use in
1524 : generating config.sh.
1525 cat > cmdline.opt <<EOSH
1526 : Configure command line arguments.
1535 cat >>cmdline.opt <<EOSH
1536 config_arg$argn='$arg'
1538 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1541 arg_exp=`cat cmdl.opt`
1542 args_exp="$args_exp$args_sep'$arg_exp'"
1543 argn=`expr $argn + 1`
1548 : produce awk script to parse command line options
1549 cat >options.awk <<'EOF'
1551 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1553 len = length(optstr);
1554 for (i = 1; i <= len; i++) {
1555 c = substr(optstr, i, 1);
1556 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1567 if (substr(str, 1, 1) != "-") {
1568 printf("'%s'\n", str);
1572 for (i = 2; i <= len; i++) {
1573 c = substr(str, i, 1);
1575 printf("-%s\n", substr(str, i));
1581 printf("'%s'\n", substr(str, i + 1));
1594 : process the command line options
1595 set X `for arg in "$@"; do echo "X$arg"; done |
1596 sed -e s/X// | awk -f options.awk`
1601 : set up default values
1611 rm -f optdef.sh posthint.sh
1612 cat >optdef.sh <<EOS
1618 while test $# -gt 0; do
1620 -d) shift; fastread=yes;;
1621 -e) shift; alldone=cont;;
1625 if test -r "$1"; then
1628 echo "$me: cannot read config file $1." >&2
1634 -h) shift; error=true;;
1635 -r) shift; reuseval=true;;
1636 -s) shift; silent=true; realsilent=true;;
1637 -E) shift; alldone=exit;;
1638 -K) shift; knowitall=true;;
1639 -O) shift; override=true;;
1640 -S) shift; silent=true; extractsh=true;;
1645 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1646 echo "$me: ignoring -D $1" >&2
1649 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1650 *) echo "$1='define'" >> optdef.sh;;
1657 *=) echo "$1" >> optdef.sh;;
1659 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1660 echo "$me: ignoring -U $1" >&2
1662 *) echo "$1='undef'" >> optdef.sh;;
1673 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1677 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1678 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1684 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1685 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1686 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1687 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1688 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1689 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1695 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1697 echo "$yyy=''" >> posthint.sh ;;
1702 echo "$yyy='$zzz'" >> posthint.sh ;;
1704 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1706 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1711 echo "$yyy=$zzz" >> posthint.sh ;;
1712 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1716 -V) echo "$me generated by metaconfig 3.5 PL0." >&2
1719 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1727 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1728 [-U symbol] [-U symbol=] [-A command:symbol...]
1729 -d : use defaults for all answers.
1730 -e : go on without questioning past the production of config.sh.
1731 -f : specify an alternate default configuration file.
1732 -h : print this help message and exit (with an error status).
1733 -r : reuse C symbols value if possible (skips costly nm extraction).
1734 -s : silent mode, only echoes questions and essential information.
1735 -D : define symbol to have some value:
1736 -D symbol symbol gets the value 'define'
1737 -D symbol=value symbol gets the value 'value'
1738 common used examples (see INSTALL for more info):
1739 -Duse64bitint use 64bit integers
1740 -Duse64bitall use 64bit integers and pointers
1741 -Dusethreads use thread support
1742 -Dinc_version_list=none do not include older perl trees in @INC
1743 -DEBUGGING=none DEBUGGING options
1744 -Dcc=gcc choose your compiler
1745 -Dprefix=/opt/perl5 choose your destination
1746 -E : stop at the end of questions, after having produced config.sh.
1747 -K : do not use unless you know what you are doing.
1748 -O : let -D and -U override definitions from loaded configuration file.
1749 -S : perform variable substitutions on all .SH files (can mix with -f)
1750 -U : undefine symbol:
1751 -U symbol symbol gets the value 'undef'
1752 -U symbol= symbol gets completely empty
1754 -A : manipulate symbol after the platform specific hints have been applied:
1755 -A append:symbol=value append value to symbol
1756 -A symbol=value like append:, but with a separating space
1757 -A define:symbol=value define symbol to have value
1758 -A clear:symbol define symbol to be ''
1759 -A define:symbol define symbol to be 'define'
1760 -A eval:symbol=value define symbol to be eval of value
1761 -A prepend:symbol=value prepend value to symbol
1762 -A undef:symbol define symbol to be 'undef'
1763 -A undef:symbol= define symbol to be ''
1764 e.g.: -A prepend:libswanted='cl pthread '
1765 -A ccflags=-DSOME_MACRO
1766 -V : print version number and exit (with a zero status).
1773 case "$fastread$alldone" in
1776 case "$extractsh" in
1779 if test ! -t 0; then
1780 echo "Say 'sh Configure', not 'sh <Configure'"
1790 true) exec 1>/dev/null;;
1793 : run the defines and the undefines, if any, but leave the file out there...
1796 : create the posthint manipulation script and leave the file out there...
1801 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1802 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1803 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1804 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1805 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1808 : Some greps do not return status, grrr.
1809 echo "grimblepritz" >grimble
1810 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1812 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1818 : the following should work in any shell
1822 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1823 cat >contains <<'EOSS'
1824 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1829 : Find the path to the source tree
1832 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1836 *) src=`cd ../$src && pwd` ;;
1849 if test -f $rsrc/Configure && \
1850 $contains "^package='$package'\$" $rsrc/Configure >/dev/null 2>&1
1852 : found it, so we are ok.
1855 for src in . .. ../.. ../../.. ../../../..; do
1856 if test -f ../$src/Configure && \
1857 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1868 Sorry, I can't seem to locate the source dir for $package. Please start
1869 Configure with an explicit path -- i.e. /some/path/Configure.
1877 echo "Sources for $package found in \"$src\"." >&4
1881 : script used to extract .SH files with variable substitutions
1882 cat >extract <<'EOS'
1884 echo "Doing variable substitutions on .SH files..."
1885 if test -f MANIFEST; then
1886 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1888 echo "(Looking for .SH files under the source directory.)"
1889 set x `(cd "$src"; find . -name "*.SH" -print)`
1893 0) set x `(cd "$src"; echo *.SH)`; shift;;
1895 if test ! -f "$src/$1"; then
1901 while test $name; do
1902 if test ! -d "$name"; then
1903 create="$name $create";
1904 name=`echo $name | sed -e "s|^[^/]*$||"`;
1905 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1910 for file in $create; do
1919 dir=`expr X$file : 'X\(.*\)/'`
1920 file=`expr X$file : 'X.*/\(.*\)'`
1921 (cd "$dir" && . ./$file)
1931 dir=`expr X$file : 'X\(.*\)/'`
1932 file=`expr X$file : 'X.*/\(.*\)'`
1933 (set x $dir; shift; eval $mkdir_p)
1934 sh <"$src/$dir/$file"
1943 if test -f "$src/config_h.SH"; then
1944 if test ! -f config.h; then
1945 : oops, they left it out of MANIFEST, probably, so do it anyway.
1946 . "$src/config_h.SH"
1951 : extract files and exit if asked to do so
1952 case "$extractsh" in
1954 case "$realsilent" in
1958 case "$config_sh" in
1959 '') config_sh='config.sh';;
1962 echo "Fetching answers from $config_sh..."
1965 test "$override" && . ./optdef.sh
1969 echo "Extraction done."
1974 : Eunice requires " " instead of "", can you believe it
1977 echo "Beginning of configuration questions for $package."
1979 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1981 : first determine how to suppress newline on echo command
1983 echo "Checking echo to see how to suppress newlines..."
1984 (echo "hi there\c" ; echo " ") >.echotmp
1985 if $contains c .echotmp >/dev/null 2>&1 ; then
1996 echo $n "The star should be here-->$c"
2000 : Now test for existence of everything in MANIFEST
2002 if test -f "$rsrc/MANIFEST"; then
2003 echo "First let's make sure your kit is complete. Checking..." >&4
2004 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | \
2005 (split -l 50 2>/dev/null || split -50)
2008 for filelist in x??; do
2009 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` \
2010 >/dev/null 2>>"$tmppwd/missing")
2012 if test -s missing; then
2016 THIS PACKAGE SEEMS TO BE INCOMPLETE.
2018 You have the option of continuing the configuration process, despite the
2019 distinct possibility that your kit is damaged, by typing 'y'es. If you
2020 do, don't blame me if something goes wrong. I advise you to type 'n'o
2021 and contact the author (perlbug@perl.org).
2024 echo $n "Continue? [n] $c" >&4
2028 echo "Continuing..." >&4
2032 echo "ABORTING..." >&4
2037 echo "Looks good..."
2040 echo "There is no MANIFEST file. I hope your kit is complete !"
2044 : Find the appropriate value for a newline for tr
2046 if test -n "$DJGPP"; then
2049 if test X"$trnl" = X; then
2050 case "`echo foo|tr '\n' x 2>/dev/null`" in
2054 if test X"$trnl" = X; then
2055 case "`echo foo|tr '\012' x 2>/dev/null`" in
2056 foox) trnl='\012' ;;
2059 if test X"$trnl" = X; then
2060 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
2061 fooxy) trnl='\n\r' ;;
2064 if test X"$trnl" = X; then
2067 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
2073 : compute the number of columns on the terminal for proper question formatting
2078 : set up the echo used in my read
2079 myecho="case \"\$xxxm\" in
2080 '') echo $n \"\$rp $c\" >&4;;
2082 '') echo $n \"[\$xxxm] $c\";;
2084 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
2086 echo $n \"[\$xxxm] $c\" >&4
2088 echo $n \"\$rp [\$xxxm] $c\" >&4
2094 : now set up to do reads with possible shell escape and default assignment
2100 case "\$fastread" in
2101 yes) case "\$dflt" in
2104 case "\$silent-\$rp" in
2109 *) case "\$silent" in
2110 true) case "\$rp" in
2115 while expr "X\$ans" : "X!" >/dev/null; do
2119 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2127 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2136 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2141 echo "(OK, I'll run with -d after this question.)" >&4
2144 echo "*** Sorry, \$1 not supported yet." >&4
2154 echo "*** Substitution done -- please confirm."
2156 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2161 echo "*** Error -- try again."
2168 case "\$ans\$xxxm\$nostick" in
2180 : create .config dir to save info across Configure sessions
2181 test -d ../.config || mkdir ../.config
2182 cat >../.config/README <<EOF
2183 This directory created by Configure to save information that should
2184 persist across sessions for $package.
2186 You may safely delete it if you wish.
2189 : See if we are using a devel version and want that
2190 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2193 usedevel="$define" ;;
2194 *) case "$xversion" in
2197 *** WHOA THERE!!! ***
2199 This is an UNSTABLE DEVELOPMENT release.
2200 The version of this $package distribution is $xversion, that is, odd,
2201 (as opposed to even) and that signifies a development release.
2202 If you want a maintenance release, you want an even-numbered version.
2204 Do ***NOT*** install this into production use.
2205 Data corruption and crashes are possible.
2207 It is most seriously suggested that you do not continue any further
2208 unless you want to help in developing and debugging Perl.
2210 If you *still* want to build perl, you can answer 'y' now,
2211 or pass -Dusedevel to Configure.
2214 rp='Do you really want to continue?'
2218 [yY]) echo >&4 "Okay, continuing."
2219 usedevel="$define" ;;
2220 *) echo >&4 "Okay, bye."
2231 case "$versiononly" in
2232 '') versiononly="$define" ;;
2234 case "$installusrbinperl" in
2235 '') installusrbinperl="$undef" ;;
2240 : general instructions
2243 user=`(logname) 2>/dev/null`
2245 '') user=`whoami 2>&1`;;
2247 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2250 rp='Would you like to see the instructions?'
2261 This installation shell script will examine your system and ask you questions
2262 to determine how the perl5 package should be installed. If you get
2263 stuck on a question, you may use a ! shell escape to start a subshell or
2264 execute a command. Many of the questions will have default answers in square
2265 brackets; typing carriage return will give you the default.
2267 On some of the questions which ask for file or directory names you are allowed
2268 to use the ~name construct to specify the login directory belonging to "name",
2269 even if you don't have a shell which knows about that. Questions where this is
2270 allowed will be marked "(~name ok)".
2274 dflt='Type carriage return to continue'
2278 The prompter used in this script allows you to use shell variables and
2279 backticks in your answers. You may use $1, $2, etc... to refer to the words
2280 in the default answer, as if the default line was a set of arguments given to a
2281 script shell. This means you may also use $* to repeat the whole default line,
2282 so you do not have to re-type everything to add something to the default.
2284 Every time there is a substitution, you will have to confirm. If there is an
2285 error (e.g. an unmatched backtick), the default answer will remain unchanged
2286 and you will be prompted again.
2288 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2289 the questions and use the computed defaults (or the previous answers if there
2290 was already a config.sh file). Type 'Configure -h' for a list of options.
2291 You may also start interactively and then answer '& -d' at any prompt to turn
2292 on the non-interactive behaviour for the remainder of the execution.
2298 Much effort has been expended to ensure that this shell script will run on any
2299 Unix system. If despite that it blows up on yours, your best bet is to edit
2300 Configure and run it again. If you can't run Configure for some reason,
2301 you'll have to generate a config.sh file by hand. Whatever problems you
2302 have, let me (perlbug@perl.org) know how I blew it.
2304 This installation script affects things in two ways:
2306 1) it may do direct variable substitutions on some of the files included
2308 2) it builds a config.h file for inclusion in C programs. You may edit
2309 any of these files as the need arises after running this script.
2311 If you make a mistake on a question, there is no easy way to back up to it
2312 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2313 files. Configure will offer to let you do this before it runs the SH files.
2316 dflt='Type carriage return to continue'
2318 case "$firsttime" in
2319 true) echo $user >>../.config/instruct;;
2323 : Set 'sysroot' to change the logical root directory to your headers and libraries see man gcc
2324 : This is primarily meant for cross-compile environments, and may fail to be useful in other cases
2325 if test "X$sysroot" = X; then
2330 echo "Using $sysroot to find your headers and libraries, adding to ccflags"
2331 # _sysroot is used in places where we need --sysroot=foo
2332 # but using the rest of the flags could cause issues.
2333 _sysroot="--sysroot=$sysroot";
2337 ccflags="$ccflags $_sysroot"
2342 ldflags="$ldflags $_sysroot"
2347 cppflags="$cppflags $_sysroot"
2349 # lddlflags updated below in lddlflags section;
2350 # same with cccdlflags
2354 # Adjust some defaults to also use $sysroot
2355 for var in xlibpth loclibpth locincpth glibpth; do
2358 for path in $xxx; do
2359 eval $var=\"\$$var $sysroot$path\"
2365 : find out where common programs are
2367 echo "Locating common programs..." >&4
2380 if test -d \$dir/\$thing; then
2386 for thisthing in \$dir/\$thing; do
2387 : just loop through to pick last item
2389 if test -f \$thisthing; then
2392 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2395 elif test -f \$dir/\$thing.exe; then
2396 if test -n "$DJGPP"; then
2397 echo \$dir/\$thing.exe
2398 elif test "$eunicefix" != ":"; then
2399 : on Eunice apparently
2452 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2453 pth="$pth $sysroot/lib $sysroot/usr/lib"
2454 for file in $loclist; do
2458 if test -f "$xxx"; then
2461 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2462 xxx=`./loc $file $file $pth`
2465 '') xxx=`./loc $file $file $pth`;;
2466 *) xxx=`./loc $xxx $xxx $pth`;;
2468 eval $file=$xxx$_exe
2472 echo $file is in $xxx.
2475 echo $file is in $xxx.
2478 echo "I don't know where '$file' is, and my life depends on it." >&4
2479 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2485 echo "Don't worry if any of the following aren't found..."
2487 for file in $trylist; do
2491 if test -f "$xxx"; then
2494 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2495 xxx=`./loc $file $file $pth`
2498 '') xxx=`./loc $file $file $pth`;;
2499 *) xxx=`./loc $xxx $xxx $pth`;;
2501 eval $file=$xxx$_exe
2505 echo $file is in $xxx.
2508 echo $file is in $xxx.
2511 echo "I don't see $file out there, $say."
2518 echo "Substituting grep for egrep."
2525 *) if $less -R </dev/null >/dev/null 2>&1; then
2526 echo "Substituting less -R for less."
2534 echo "Substituting cp for ln."
2543 echo "I can't find make or gmake, and my life depends on it." >&4
2544 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2552 *) # We can't have osname yet.
2553 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2554 # Assume that gmake, if found, is definitely GNU make
2555 # and prefer it over the system make.
2556 echo "Substituting gmake for make."
2564 echo "Hopefully test is built into your sh."
2567 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2568 echo "Using the test built into your sh."
2576 echo "Hopefully echo is built into your sh."
2581 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2582 $echo $n "hi there$c" >foo1
2583 echo $n "hi there$c" >foo2
2584 if cmp foo1 foo2 >/dev/null 2>&1; then
2585 echo "They are compatible. In fact, they may be identical."
2592 They are not compatible! You are probably running ksh on a non-USG system.
2593 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2594 have echo built in and we may have to run some Bourne shell scripts. That
2595 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2598 $echo $n "The star should be here-->$c"
2605 # This question was auctioned at YAPC::Europe-2007 in Vienna
2606 # I never promised you could answer it. I only auctioned the question.
2608 The following message is sponsored by
2610 Dresden.pm<--The stars should be here.
2612 Dear Perl user, system administrator or package
2613 maintainer, the Perl community sends greetings to
2614 you. Do you (emblematical) greet back [Y/n]? n
2618 : Check what type of C compiler we use
2622 cat <<'EOSC' >>trygcc
2627 int main(int argc, char *argv[]) {
2631 if $cc -o try $ccflags $ldflags try.c; then
2634 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2640 # Skip this test because it gives a false match on output like:
2641 # ./trygcc: line 23: cc: command not found
2642 # case "`$cc -v -c try.c 2>&1`" in
2643 # *gcc*) trygcc=no ;;
2645 if $test X"$trygcc" = Xyes; then
2646 if gcc -o try -c try.c; then
2648 echo "You seem to have a working gcc, though." >&4
2649 # Switching compilers may undo the work of hints files.
2650 # The most common problem is -D_REENTRANT for threads.
2651 # This heuristic catches that case, but gets false positives
2652 # if -Dusethreads was not actually specified. Better to
2653 # bail out here with a useful message than fail
2654 # mysteriously later. Should we perhaps just try to
2655 # re-invoke Configure -Dcc=gcc config_args ?
2656 if $test -f usethreads.cbu; then
2659 *** However, any setting of the C compiler flags (e.g. for thread support)
2660 *** will be lost. It may be necessary for you to restart Configure and
2661 *** add -Dcc=gcc to your Configure command line.
2664 rp="Would you like to go ahead and try gcc anyway?"
2667 rp="Would you like to use it?"
2670 if $test -f myread; then
2673 if $test -f UU/myread; then
2676 echo "Cannot find myread, sorry. Aborting." >&2
2681 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2694 cat <<'EOSC' >>checkcc
2699 int main(int argc, char *argv[]) {
2703 if $cc -o try $ccflags $ldflags try.c; then
2706 if $test X"$despair" = Xyes; then
2707 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2710 You need to find a working C compiler.
2711 Either (purchase and) install the C compiler supplied by your OS vendor,
2712 or for a free C compiler try http://gcc.gnu.org/
2713 I cannot continue any further, aborting.
2722 : determine whether symbolic links are supported
2725 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2726 echo "Symbolic links are supported." >&4
2729 echo "Symbolic links are NOT supported." >&4
2734 : determine whether symbolic links are supported
2738 echo "Checking how to test for symbolic links..." >&4
2740 if $test "X$issymlink" = X; then
2742 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2743 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2745 if test $? = 0; then
2748 echo "Your builtin 'test -h' may be broken." >&4
2751 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2754 if test -f "$p/$test"; then
2763 echo "Trying external '$test -h'." >&4
2764 issymlink="$test -h"
2765 if $test ! -h sym >/dev/null 2>&1; then
2766 echo "External '$test -h' is broken, too." >&4
2774 if $test "X$issymlink" = X; then
2775 if $test -L sym 2>/dev/null; then
2776 issymlink="$test -L"
2777 echo "The builtin '$test -L' worked." >&4
2780 if $test "X$issymlink" != X; then
2781 echo "You can test for symbolic links with '$issymlink'." >&4
2783 echo "I do not know how you can test for symbolic links." >&4
2787 *) echo "No symbolic links, so not testing for their testing..." >&4
2792 : Make symlinks util
2793 case "$mksymlinks" in
2796 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2799 *) case "$lns:$issymlink" in
2800 *"ln"*" -s:"*"test -"?)
2801 echo "Creating the symbolic links..." >&4
2802 echo "(First creating the subdirectories...)" >&4
2804 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2806 test -z "$directory" && break
2810 if test ! -d t/base; then
2811 echo "Failed to create the subdirectories. Aborting." >&4
2814 echo "(Then creating the symlinks...)" >&4
2815 awk '{print $1}' $src/MANIFEST | while true; do
2817 test -z "$filename" && break
2818 if test -f $filename; then
2819 if $issymlink $filename; then
2823 if test -f $filename; then
2824 echo "$filename already exists, not symlinking."
2826 ln -s $src/$filename $filename
2830 if test ! -f t/base/lex.t; then
2831 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2836 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2844 : Check for Cross-Compilation
2845 if $test "X$targethost" = "X"; then
2848 if $test "X$targetenv" = "X"; then
2851 case "$usecrosscompile" in
2853 $echo "Cross-compiling..."
2856 *-gcc*|*-g++*) # A cross-compiling gcc, probably.
2857 # arm-linux-androideabi-gcc -> arm-linux-androideabi
2858 # x86_64-w64-mingw32-gcc.exe -> x86_64-w64-mingw32
2859 targetarch=`$echo $cc|$sed 's/-g[c\+][c\+].*$//'`
2860 ar=`$echo $cc|$sed 's/-g[c\+][c\+]/-ar/'`
2861 # leave out ld, choosing it is more complex
2862 nm=`$echo $cc|$sed 's/-g[c\+][c\+]/-nm/'`
2863 ranlib=`$echo $cc|$sed 's/-g[c\+][c\+]/-ranlib/'`
2864 # We are in a weird spot. Just before us, some values
2865 # were 'saved', to be restored after the hints are
2866 # run. This means that the changes we made to ar,
2867 # nm and ranlib will get reverted.
2868 # To avoid that, we hijack the saving mechanism and
2869 # have it save our new values.
2870 for file in ar nm ranlib; do
2872 eval $file=$xxx$_exe
2877 case "$targetarch" in
2878 '') echo "Targetarch not defined." >&4; croak=y ;;
2879 *) echo "Using targetarch $targetarch." >&4 ;;
2881 case "$targethost" in
2882 '') echo "Targethost not defined." >&4; croak=y ;;
2883 *) echo "Using targethost $targethost." >&4
2888 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2890 : compile a host miniperl and generate_uudmap, unless we got passed them
2891 if $test "X$hostperl" = X; then
2892 echo "Building host miniperl and generate_uudmap binaries" >&4
2900 $src/Configure -des -Dusedevel -Dmksymlinks
2902 case "$hostgenerate" in
2903 '') $make generate_uudmap
2904 hostgenerate=$src/host/generate_uudmap
2906 "$undef") hostgenerate=''
2909 hostperl=$src/host/miniperl
2912 hostosname=`$hostperl -le 'print $^O'`
2915 usecrosscompile="$undef"
2919 : Define -Dtargethost=somecomputer to run compiled tests on another machine
2920 case "$targethost" in
2921 '') echo "Checking for cross-compile" >&4
2922 case "$usecrosscompile$multiarch" in
2923 *$define*) echo "Skipping the try tests in the rest of Configure as no targethost was defined when cross-compiling" >&4
2924 if [ -f Makefile ]; then
2926 echo "Now you must ensure config.sh, config.h and the generated headers exist and run a $make."
2928 echo "Configure done."
2932 *) echo "No targethost for running compiler tests against defined, running locally" >&4
2939 *) echo "Using targethost $targethost." >&4
2941 /*) run=$src/Cross/run
2942 targetmkdir=$src/Cross/mkdir
2944 from=$src/Cross/from
2946 *) pwd=`$test -f ../Configure & cd ..; pwd`
2948 targetmkdir=$pwd/Cross/mkdir
2950 from=$pwd/Cross/from
2953 case "$targetrun" in
2954 '') targetrun=ssh ;;
2959 case "$targetfrom" in
2960 '') targetfrom=scp ;;
2964 from=$from-$targetfrom
2965 case "$targetdir" in
2967 echo "Guessing targetdir $targetdir." >&4
2970 case "$targetuser" in
2972 echo "Guessing targetuser $targetuser." >&4
2975 case "$targetport" in
2977 echo "Guessing targetport $targetport." >&4
2980 case "$targetfrom" in
2984 case "$targetrun" in
3004 '') cwd=$targetdir ;;
3009 $targetrun -p $targetport -l $targetuser $targethost "cd \$cwd && \$env \$exe \$@"
3015 *) echo "Unknown targetrun '$targetrun'" >&4
3019 case "$targetmkdir" in
3021 cat >$targetmkdir <<EOF
3023 $targetrun -p $targetport -l $targetuser $targethost "mkdir -p \$@"
3025 $chmod a+rx $targetmkdir
3027 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
3039 $targetmkdir \`dirname \$f\`
3040 $targetto -P $targetport -r $q \$f $targetuser@$targethost:\$f 2>/dev/null || exit 1
3043 $targetmkdir $targetdir/\`dirname \$f\`
3044 $targetto -P $targetport -r $q \$f $targetuser@$targethost:$targetdir/\$f 2>/dev/null || exit 1
3057 $mkdir -p $targetdir/\`dirname \$f\`
3058 $cp \$f $targetdir/\$f || exit 1
3061 $targetmkdir $targetdir/\`dirname \$f\`
3062 $cp \$f $targetdir/\$f || exit 1
3069 *) echo "Unknown targetto '$targetto'" >&4
3073 case "$targetfrom" in
3080 $targetfrom -P $targetport $q $targetuser@$targethost:$targetdir/\$f . || exit 1
3085 cp) cat >$from <<EOF
3090 cp $targetdir/\$f . || exit 1
3095 *) echo "Unknown targetfrom '$targetfrom'" >&4
3099 if $test ! -f $run; then
3100 echo "Target 'run' script '$run' not found." >&4
3104 if $test ! -f $to; then
3105 echo "Target 'to' script '$to' not found." >&4
3109 if $test ! -f $from; then
3110 echo "Target 'from' script '$from' not found." >&4
3114 if $test ! -f $run -o ! -f $to -o ! -f $from; then
3118 Using '$run' for remote execution,
3119 and '$from' and '$to'
3120 for remote file transfer.
3126 usecrosscompile="$undef"
3131 : see whether [:lower:] and [:upper:] are supported character classes
3133 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
3135 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
3139 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
3140 # (0xd9 and 0xe2), therefore that is a nice testing point.
3141 if test "X$up" = X -o "X$low" = X; then
3142 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
3148 if test "X$up" = X -o "X$low" = X; then
3149 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
3155 if test "X$up" = X -o "X$low" = X; then
3156 case "`echo RS | od -x 2>/dev/null`" in
3158 echo "Hey, this might be EBCDIC." >&4
3159 if test "X$up" = X -o "X$low" = X; then
3160 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
3161 rs) up='[A-IJ-RS-Z]'
3166 if test "X$up" = X -o "X$low" = X; then
3167 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
3177 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
3179 echo "Using $up and $low to convert case." >&4
3182 echo "I don't know how to translate letters from upper to lower case." >&4
3183 echo "Your tr is not acting any way I know of." >&4
3187 : set up the translation script tr, must be called with ./tr of course
3191 '[A-Z][a-z]') exec $tr '$up' '$low';;
3192 '[a-z][A-Z]') exec $tr '$low' '$up';;
3199 : Try to determine whether config.sh was made on this system
3200 case "$config_sh" in
3202 myuname=`$uname -a 2>/dev/null`
3203 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
3204 # Downcase everything to avoid ambiguity.
3205 # Remove slashes and single quotes so we can use parts of this in
3206 # directory and file names.
3207 # Remove newlines so myuname is sane to use elsewhere.
3208 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
3209 # because the A-Z/a-z are not consecutive.
3210 myuname=`echo $myuname | $sed -e "s,['/],,g" | \
3211 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
3212 newmyuname="$myuname"
3214 case "$knowitall" in
3216 if test -f ../config.sh; then
3217 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3218 eval "`grep myuname= ../config.sh`"
3220 if test "X$myuname" = "X$newmyuname"; then
3228 : Get old answers from old config file if Configure was run on the
3229 : same system, otherwise use the hints.
3232 if test -f config.sh; then
3234 rp="I see a config.sh file. Shall I use it to set the defaults?"
3237 n*|N*) echo "OK, I'll ignore it."
3238 mv config.sh config.sh.old
3239 myuname="$newmyuname"
3241 *) echo "Fetching default answers from your old config.sh file..." >&4
3249 : Older versions did not always set $sh. Catch re-use of such
3259 if test ! -f config.sh; then
3262 First time through, eh? I have some defaults handy for some systems
3263 that need some extra help getting the Configure answers right:
3266 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3268 : Half the following guesses are probably wrong... If you have better
3269 : tests or hints, please send them to perlbug@perl.org
3270 : The metaconfig authors would also appreciate a copy...
3271 $test -f /irix && osname=irix
3272 $test -f /xenix && osname=sco_xenix
3273 $test -f /dynix && osname=dynix
3274 $test -f /dnix && osname=dnix
3275 $test -f /lynx.os && osname=lynxos
3276 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3277 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3278 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3279 $test -f /bin/mips && /bin/mips && osname=mips
3280 $test -d /usr/apollo/bin && osname=apollo
3281 $test -f /etc/saf/_sactab && osname=svr4
3282 $test -d /usr/include/minix && osname=minix
3283 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3284 if $test -d /MachTen -o -d /MachTen_Folder; then
3286 if $test -x /sbin/version; then
3287 osvers=`/sbin/version | $awk '{print $2}' |
3288 $sed -e 's/[A-Za-z]$//'`
3289 elif $test -x /usr/etc/version; then
3290 osvers=`/usr/etc/version | $awk '{print $2}' |
3291 $sed -e 's/[A-Za-z]$//'`
3297 $test -f /sys/posix.dll &&
3298 $test -f /usr/bin/what &&
3299 set X `/usr/bin/what /sys/posix.dll` &&
3300 $test "$3" = UWIN &&
3304 if $test -f $uname; then
3312 umips) osname=umips ;;
3315 [23]100) osname=mips ;;
3317 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3318 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3321 elif $test -f /etc/kconfig; then
3323 if test "$lns" = "$ln -s"; then
3325 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3327 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3334 if test -n "$DJGPP"; then
3343 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3345 # oslevel can fail with:
3346 # oslevel: Unable to acquire lock.
3347 *not\ found) osvers="$4"."$3" ;;
3348 '<3240'|'<>3240') osvers=3.2.0 ;;
3349 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3350 '=3250'|'>3250') osvers=3.2.5 ;;
3354 bitrig) osname=bitrig
3357 bsd386) osname=bsd386
3360 cygwin*) osname=cygwin
3363 *dc.osx) osname=dcosx
3369 domainos) osname=apollo
3375 dragonfly) osname=dragonfly
3378 dynixptx*) osname=dynixptx
3379 osvers=`echo "$4"|sed 's/^v//'`
3381 freebsd) osname=freebsd
3383 genix) osname=genix ;;
3387 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3400 $test -f /system/lib/libandroid.so && osname=linux-android
3404 netbsd*) osname=netbsd
3407 news-os) osvers="$3"
3409 4*) osname=newsos4 ;;
3413 nonstop-ux) osname=nonstopux ;;
3414 openbsd) osname=openbsd
3420 POSIX-BC | posix-bc ) osname=posix-bc
3423 powerux | power_ux | powermax_os | powermaxos | \
3424 powerunix | power_unix) osname=powerux
3430 solaris) osname=solaris
3432 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3439 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3443 titanos) osname=titanos
3452 ultrix) osname=ultrix
3455 osf1|mls+) case "$5" in
3458 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3461 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3464 hp*) osname=hp_osf1 ;;
3465 mips) osname=mips_osf1 ;;
3468 # UnixWare 7.1.2 is known as Open UNIX 8
3469 openunix|unixware) osname=svr5
3477 $2) case "$osname" in
3481 : svr4.x or possibly later
3491 if test -f /stand/boot ; then
3492 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3493 if test -n "$INITPROG" -a -f "$INITPROG"; then
3494 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3495 if test -n "$isesix"; then
3503 *) if test -f /etc/systemid; then
3505 set `echo $3 | $sed 's/\./ /g'` $4
3506 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3508 elif $test -f $src/hints/sco_$1_$2.sh; then
3510 elif $test -f $src/hints/sco_$1.sh; then
3515 '') : Still unknown. Probably a generic Sys V.
3524 *) case "$osname" in
3525 '') : Still unknown. Probably a generic BSD.
3533 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3534 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3535 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3538 $rm -f UU/kernel.what
3539 elif test -d c:/. -o -n "$is_os2" ; then
3546 case "$targetarch" in
3549 case "$targetarch" in
3551 # Will load qnx.sh, which should change osname to nto
3556 # Catch arm-linux-androideabi, mipsel-linux-android,
3557 # and i686-linux-android
3558 osname=linux-android
3562 # Something like arm-linux-gnueabihf is really just
3569 # XXX perhaps we should just assume
3570 # osvers to be 2, or maybe take the value
3571 # from targetarch. Using $run before the
3572 # hints are run is somewhat icky.
3573 set X `$run $uname -a 2>/dev/null`
3576 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3581 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3588 : Now look for a hint file osname_osvers, unless one has been
3589 : specified already.
3592 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3593 : Also try without trailing minor version numbers.
3594 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3595 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3596 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3597 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3600 *) case "$osvers" in
3603 *) if $test -f $src/hints/$file.sh ; then
3605 elif $test -f $src/hints/$xfile.sh ; then
3607 elif $test -f $src/hints/$xxfile.sh ; then
3609 elif $test -f $src/hints/$xxxfile.sh ; then
3611 elif $test -f $src/hints/$xxxxfile.sh ; then
3613 elif $test -f "$src/hints/${osname}.sh" ; then
3622 if $test -f Policy.sh ; then
3625 none) dflt="Policy" ;;
3626 *) dflt="Policy $dflt" ;;
3631 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3635 if $test -f Policy.sh ; then
3638 There's also a Policy hint file available, which should make the
3639 site-specific (policy) questions easier to answer.
3646 You may give one or more space-separated answers, or "none" if appropriate.
3647 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3648 previous run of Configure, you may specify it as well as or instead of
3649 OS-specific hints. If hints are provided for your OS, you should use them:
3650 although Perl can probably be built without hints on many platforms, using
3651 hints often improve performance and may enable features that Configure can't
3652 set up on its own. If there are no hints that match your OS, specify "none";
3653 DO NOT give a wrong version or a wrong OS.
3657 rp="Which of these apply, if any?"
3660 for file in $tans; do
3661 if $test X$file = XPolicy -a -f Policy.sh; then
3663 $cat Policy.sh >> UU/config.sh
3664 elif $test -f $src/hints/$file.sh; then
3665 . $src/hints/$file.sh
3666 $cat $src/hints/$file.sh >> UU/config.sh
3667 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3670 : Give one chance to correct a possible typo.
3671 echo "$file.sh does not exist"
3673 rp="hint to use instead?"
3675 for file in $ans; do
3676 if $test -f "$src/hints/$file.sh"; then
3677 . $src/hints/$file.sh
3678 $cat $src/hints/$file.sh >> UU/config.sh
3679 elif $test X$ans = X -o X$ans = Xnone ; then
3682 echo "$file.sh does not exist -- ignored."
3689 : Remember our hint file for later.
3690 if $test -f "$src/hints/$file.sh" ; then
3700 echo "Fetching default answers from $config_sh..." >&4
3704 cp $config_sh config.sh 2>/dev/null
3714 test "$override" && . ./optdef.sh
3716 : Restore computed paths
3717 for file in $loclist $trylist; do
3718 eval $file="\$_$file"
3723 Configure uses the operating system name and version to set some defaults.
3724 The default value is probably right if the name rings a bell. Otherwise,
3725 since spelling matters for me, either accept the default or answer "none"
3732 ''|' '|none) dflt=none ;;
3733 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3736 *) dflt="$osname" ;;
3738 rp="Operating system name?"
3742 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3748 ''|' '|none) dflt=none ;;
3749 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3750 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3752 ''|' ') dflt=none ;;
3757 *) dflt="$osvers" ;;
3759 rp="Operating system version?"
3769 : who configured the system
3770 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3773 cf_by=`(logname) 2>/dev/null`
3776 cf_by=`(whoami) 2>/dev/null`
3778 "") cf_by=unknown ;;
3783 : decide how portable to be. Allow command line overrides.
3784 case "$d_portable" in
3786 *) d_portable="$define" ;;
3789 : set up shell script to do ~ expansion
3795 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3798 if $test -f /bin/csh; then
3799 /bin/csh -f -c "glob \$1"
3804 name=\`$expr x\$1 : '..\([^/]*\)'\`
3805 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3806 if $test ! -d "\$dir"; then
3808 echo "\$me: can't locate home directory for: \$name" >&2
3813 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3829 : now set up to get a file name
3833 cat <<'EOSC' >>getfile
3849 : getfile will accept an answer from the comma-separated list
3850 : enclosed in parentheses even if it does not meet other criteria.
3851 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3852 fn=`echo $fn | sed 's/(.*)//'`
3858 loc_file=`expr $fn : '.*:\(.*\)'`
3859 fn=`expr $fn : '\(.*\):.*'`
3867 */*) fullpath=true;;
3876 *e*) exp_file=true;;
3879 *p*) nopath_ok=true;;
3884 *d*) type='Directory';;
3885 *l*) type='Locate';;
3890 Locate) what='File';;
3895 case "$d_portable" in
3903 while test "$type"; do
3908 true) rp="$rp (~name ok)";;
3911 if test -f UU/getfile.ok && \
3912 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3931 value=`UU/filexp $ans`
3934 if test "$ans" != "$value"; then
3935 echo "(That expands to $value on this system.)"
3949 /*) value="$ansexp" ;;
3950 [a-zA-Z]:/*) value="$ansexp" ;;
3955 echo "I shall only accept a full path name, as in /bin/ls." >&4
3956 echo "Use a ! shell escape if you wish to check pathnames." >&4
3959 echo "Please give a full path name, starting with slash." >&4
3962 echo "Note that using ~name is ok provided it expands well." >&4
3975 for fp in $gfpth; do
3976 if test "X$fp" = X.; then
3981 if test -f "$pf"; then
3983 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3985 echo "($value is not a plain file, but that's ok.)"
3988 if test X"$type" = X; then
3995 for fp in $gfpth; do
3996 if test "X$fp" = X.; then
4001 direxp="$fp/$ansexp"
4003 if test -d "$direxp"; then
4011 if test -d "$ansexp"; then
4012 echo "(Looking for $loc_file in directory $value.)"
4013 value="$value/$loc_file"
4014 ansexp="$ansexp/$loc_file"
4016 if test -f "$ansexp"; then
4019 case "$nopath_ok" in
4020 true) case "$value" in
4022 *) echo "Assuming $value will be in people's path."
4038 if test "$fastread" = yes; then
4043 rp="$what $value doesn't exist. Use that name anyway?"
4062 test "X$gfpthkeep" != Xy && gfpth=""
4065 : determine root of directory hierarchy where package will be installed.
4068 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
4071 dflt=`echo "$prefix" | sed 's/.$//'`
4079 By default, $package will be installed in $dflt/bin, manual pages
4080 under $dflt/man, etc..., i.e. with $dflt as prefix for all
4081 installation directories. Typically this is something like /usr/local.
4082 If you wish to have binaries under /usr/bin but other parts of the
4083 installation under /usr/local, that's ok: you will be prompted
4084 separately for each of the installation directories, the prefix being
4085 only used to set the defaults.
4089 rp='Installation prefix to use?'
4097 *) oldprefix="$prefix";;
4104 : allow them to override the AFS root
4107 *) afsroot=$afsroot ;;
4113 $define|true) afs=true ;;
4114 $undef|false) afs=false ;;
4115 *) if $test -d $afsroot; then
4123 echo "AFS may be running... I'll be extra cautious then..." >&4
4125 echo "AFS does not seem to be running..." >&4
4128 : determine installation prefix for where package is to be installed.
4132 Since you are running AFS, I need to distinguish the directory in which
4133 files will reside from the directory in which they are installed (and from
4134 which they are presumably copied to the former directory by occult means).
4137 case "$installprefix" in
4138 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
4139 *) dflt="$installprefix";;
4144 In some special cases, particularly when building $package for distribution,
4145 it is convenient to distinguish the directory in which files should be
4146 installed from the directory ($prefix) in which they will
4147 eventually reside. For most users, these two directories are the same.
4150 case "$installprefix" in
4152 *) dflt=$installprefix;;
4156 rp='What installation prefix should I use for installing files?'
4158 installprefix="$ans"
4159 installprefixexp="$ansexp"
4161 : Perform the prefixexp/installprefixexp correction if necessary
4162 cat <<EOS >installprefix
4165 cat <<'EOSC' >>installprefix
4166 : Change installation prefix, if necessary.
4167 if $test X"$prefix" != X"$installprefix"; then
4168 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
4170 eval "install${prefixvar}=\"\$${prefixvar}exp\""
4173 chmod +x installprefix
4174 $eunicefix installprefix
4176 : Set variables such as privlib and privlibexp from the output of ./getfile
4177 : performing the prefixexp/installprefixexp correction if necessary.
4178 cat <<EOS >setprefixvar
4181 cat <<'EOSC' >>setprefixvar
4182 eval "${prefixvar}=\"\$ans\""
4183 eval "${prefixvar}exp=\"\$ansexp\""
4186 chmod +x setprefixvar
4187 $eunicefix setprefixvar
4189 : set up the script used to warn in case of inconsistency
4198 '') echo "The $hint value for \$$var on this machine was \"$was\"!" >&4
4200 *) echo "Hmm. Based on the hints in hints/$hintfile.sh, " >&4
4201 echo "the $hint value for \$$var on this machine was \"$was\"!" >&4
4206 echo "*** WHOA THERE!!! ***" >&4
4207 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
4210 rp=" Keep the $hint value?"
4213 y) td=$was; tu=$was;;
4217 : function used to set '$1' to '$val'
4218 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
4220 $define$undef) . ./whoa; eval "$var=\$td";;
4221 $undef$define) . ./whoa; eval "$var=\$tu";;
4222 *) eval "$var=$val";;
4225 : get the patchlevel
4227 echo "Getting the current patchlevel..." >&4
4228 if $test -r $rsrc/patchlevel.h;then
4229 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
4230 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4231 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4232 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4233 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4234 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4235 perl_patchlevel=`egrep ',"(MAINT|SMOKE)[0-9][0-9]*"' $rsrc/patchlevel.h|tail -1|sed 's/[^0-9]//g'`
4244 $echo "(You do not have patchlevel.h. Eek.)"
4246 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
4247 version_patchlevel_string="version $patchlevel subversion $subversion"
4248 case "$perl_patchlevel" in
4250 *) perl_patchlevel=`echo $perl_patchlevel | sed 's/.* //'`
4251 version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel"
4255 $echo "(You have $package $version_patchlevel_string.)"
4259 : XXX Should be a Configure test for double-dots in filenames.
4260 version=`echo $revision $patchlevel $subversion | \
4261 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4262 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4263 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4266 version=`echo $revision $patchlevel $subversion | \
4267 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4268 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4269 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4272 : Special case the 5.005_xx maintenance series, which used 5.005
4273 : without any subversion label as a subdirectory in $sitelib
4274 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4275 api_versionstring='5.005'
4278 : Do we want threads support and if so, what type
4279 case "$usethreads" in
4280 $define|true|[yY]*) dflt='y';;
4281 *) # Catch case where user specified ithreads or 5005threads but
4282 # forgot -Dusethreads (A.D. 4/2002)
4283 case "$useithreads$use5005threads" in
4284 *$define*) dflt='y';;
4291 Perl can be built to offer a form of threading support on some systems
4292 To do so, Configure can be run with -Dusethreads.
4294 Note that Perl built with threading support runs slightly slower
4295 and uses slightly more memory than plain Perl.
4297 If this doesn't make any sense to you, just accept the default '$dflt'.
4299 rp='Build a threading Perl?'
4302 y|Y) val="$define" ;;
4308 if $test $patchlevel -lt 9; then
4309 case "$usethreads" in
4311 : Default to ithreads unless overridden on command line or with
4314 case "$use5005threads" in
4316 echo "5.005 threads are no longer supported"
4320 case "$useithreads" in
4321 $undef|false|[nN]*) dflt='n';;
4323 rp='Use the newer interpreter-based ithreads?'
4326 y|Y) val="$define" ;;
4331 : Now set use5005threads to the opposite value.
4332 case "$useithreads" in
4333 $define) val="$undef" ;;
4340 useithreads="$undef"
4341 use5005threads="$undef"
4345 case "$useithreads$use5005threads" in
4349 You cannot have both the ithreads and the 5.005 threads enabled
4350 at the same time. Disabling the 5.005 threads since they are
4351 much less stable than the ithreads.
4354 use5005threads="$undef"
4359 : perl-5.9.x and later
4361 if test X"$usethreads" = "X$define"; then
4362 case "$use5005threads" in
4366 5.005 threads has been removed for 5.10. Perl will be built using ithreads.
4373 use5005threads="$undef"
4374 useithreads="$usethreads"
4377 case "$d_oldpthreads" in
4378 '') : Configure tests would be welcome here. For now, assume undef.
4380 *) val="$d_oldpthreads" ;;
4386 : Look for a hint-file generated 'call-back-unit'. If the
4387 : user has specified that a threading perl is to be built,
4388 : we may need to set or change some other defaults.
4389 if $test -f usethreads.cbu; then
4390 echo "Your platform has some specific hints regarding threaded builds, using them..."
4393 case "$usethreads" in
4394 "$define"|true|[yY]*)
4396 (Your platform does not have any specific hints for threaded builds.
4397 Assuming POSIX threads, then.)
4403 : Check if multiplicity is required
4406 Perl can be built so that multiple Perl interpreters can coexist
4407 within the same Perl executable.
4410 case "$useithreads" in
4413 This multiple interpreter support is required for interpreter-based threads.
4417 *) case "$usemultiplicity" in
4418 $define|true|[yY]*) dflt='y';;
4422 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4423 rp='Build Perl for multiplicity?'
4426 y|Y) val="$define" ;;
4434 : Check if morebits is requested
4435 case "$usemorebits" in
4436 "$define"|true|[yY]*)
4437 use64bitint="$define"
4438 uselongdouble="$define"
4439 usemorebits="$define"
4441 *) usemorebits="$undef"
4445 : Determine the C compiler to be used
4451 rp="Use which C compiler?"
4455 : See whether they have no cc but they do have gcc
4457 if $test -f cc.cbu; then
4462 : make some quick guesses about what we are up against
4464 $echo $n "Hmm... $c"
4474 $cat $sysroot/usr/include/signal.h $sysroot/usr/include/sys/signal.h >foo 2>/dev/null
4475 if test -f /osf_boot || $contains 'OSF/1' $sysroot/usr/include/ctype.h >/dev/null 2>&1
4477 echo "Looks kind of like an OSF/1 system, but we'll see..."
4479 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4480 xxx=`./loc addbib blurfl $pth`
4481 if $test -f $xxx; then
4482 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4486 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4487 echo "Looks kind of like an extended USG system, but we'll see..."
4489 echo "Looks kind of like a USG system, but we'll see..."
4493 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4494 echo "Looks kind of like a BSD system, but we'll see..."
4498 echo "Looks kind of like a Version 7 system, but we'll see..."
4501 case "$eunicefix" in
4504 There is, however, a strange, musty smell in the air that reminds me of
4505 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4509 : it so happens the Eunice I know will not run shell scripts in Unix format
4513 echo "Congratulations. You aren't running Eunice."
4517 : Detect OS2. The p_ variable is set above in the Head.U unit.
4518 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4519 : semicolon as a patch separator
4524 I have the feeling something is not exactly right, however...don't tell me...
4525 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4526 (Or you may be running DOS with DJGPP.)
4531 if test -f /xenix; then
4532 echo "Actually, this looks more like a XENIX system..."
4537 echo "It's not Xenix..."
4542 if test -f /venix; then
4543 echo "Actually, this looks more like a VENIX system..."
4550 echo "Nor is it Venix..."
4553 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4554 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4557 : Check if we are using GNU gcc and what its version is
4559 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4563 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4565 printf("%s\n", __VERSION__);
4567 printf("%s\n", "1");
4573 if $cc -o try $ccflags $ldflags try.c; then
4574 gccversion=`$run ./try`
4575 case "$gccversion" in
4576 '') echo "You are not using GNU cc." ;;
4577 *) echo "You are using GNU cc $gccversion."
4583 echo "*** WHOA THERE!!! ***" >&4
4584 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4585 case "$knowitall" in
4587 echo " You'd better start hunting for one and let me know about it." >&4
4593 case "$gccversion" in
4594 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4596 case "$gccversion" in
4597 '') gccosandvers='' ;;
4598 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4599 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4601 case "$gccosandvers" in
4602 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4603 $osname$osvers) ;; # looking good
4604 $osname*) cat <<EOM >&4
4606 *** WHOA THERE!!! ***
4608 Your gcc has not been compiled for the exact release of
4609 your operating system ($gccosandvers versus $osname$osvers).
4611 In general it is a good idea to keep gcc synchronized with
4612 the operating system because otherwise serious problems
4613 may ensue when trying to compile software, like Perl.
4615 I'm trying to be optimistic here, though, and will continue.
4616 If later during the configuration and build icky compilation
4617 problems appear (headerfile conflicts being the most common
4618 manifestation), I suggest reinstalling the gcc to match
4619 your operating system release.
4623 *) gccosandvers='' ;; # failed to parse, better be silent
4631 # gcc 3.* complain about adding -Idirectories that they already know about,
4632 # so we will take those off from locincpth.
4633 case "$gccversion" in
4635 echo "main(){}">try.c
4636 for incdir in $locincpth; do
4637 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4638 grep '^c[cp]p*[01]: warning: changing search order '`
4639 if test "X$warn" != X; then
4640 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4646 # gcc 4.9 by default does some optimizations that break perl.
4647 # see ticket 121505.
4649 # The -fwrapv disables those optimizations (and probably others,) so
4650 # for gcc 4.9 (and later, since the optimizations probably won't go
4651 # away), add -fwrapv unless the user requests -fno-wrapv, which
4652 # disables -fwrapv, or if the user requests -fsanitize=undefined,
4653 # which turns the overflows -fwrapv ignores into runtime errors.
4654 case "$gccversion" in
4655 4.[3-9].*|4.[1-9][0-9]*|[5-9].*|[1-9][0-9]*)
4657 *-fno-wrapv*|*-fsanitize=undefined*|*-fwrapv*) ;;
4658 *) ccflags="$ccflags -fwrapv" ;;
4662 : What should the include directory be ?
4663 : Use sysroot if set, so findhdr looks in the right place.
4665 $echo $n "Hmm... $c"
4666 dflt="$sysroot/usr/include"
4669 if $test -f /bin/mips && /bin/mips; then
4670 echo "Looks like a MIPS system..."
4671 $cat >usr.c <<'EOCP'
4672 #ifdef SYSTYPE_BSD43
4676 if $cc $cppflags -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4677 dflt='/bsd43/usr/include'
4681 mips_type='System V'
4683 $rm -f usr.c usr.out
4684 echo "and you're compiling with the $mips_type compiler and libraries."
4688 echo "Doesn't look like a MIPS system."
4698 case "$xxx_prompt" in
4701 rp='Where are the include files you want to use?'
4709 : see how we invoke the C preprocessor
4711 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4712 cat <<'EOT' >testcpp.c
4718 if test ! -f cppstdin; then
4719 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4720 # AIX cc -E doesn't show the absolute headerfile
4721 # locations but we'll cheat by using the -M flag.
4722 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
4724 echo 'cat >.$$.c; '"$cc $cppflags"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4727 echo "Keeping your $hint cppstdin wrapper."
4730 wrapper=`pwd`/cppstdin
4734 if $test "X$cppstdin" != "X" && \
4735 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4736 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4738 echo "You used to use $cppstdin $cppminus so we'll use that again."
4740 '') echo "But let's see if we can live without a wrapper..." ;;
4742 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4743 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4745 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4748 echo "(However, $cpprun $cpplast does not work, let's see...)"
4756 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4763 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4764 $cc -E <testcpp.c >testcpp.out 2>&1; \
4765 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4766 echo "Yup, it does."
4767 x_cpp="$cc $cppflags -E"
4769 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4770 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4771 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4772 echo "Yup, it does."
4773 x_cpp="$cc $cppflags -E"
4775 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4776 $cc -P <testcpp.c >testcpp.out 2>&1; \
4777 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4778 echo "Yipee, that works!"
4779 x_cpp="$cc $cppflags -P"
4781 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4782 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4783 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4784 echo "At long last!"
4785 x_cpp="$cc $cppflags -P"
4787 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4788 $cpp <testcpp.c >testcpp.out 2>&1; \
4789 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4791 x_cpp="$cpp $cppflags"
4793 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4794 $cpp - <testcpp.c >testcpp.out 2>&1; \
4795 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4796 echo "Hooray, it works! I was beginning to wonder."
4797 x_cpp="$cpp $cppflags"
4799 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4800 $wrapper <testcpp.c >testcpp.out 2>&1; \
4801 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4807 rp="No dice. I can't find a C preprocessor. Name one:"
4811 $x_cpp <testcpp.c >testcpp.out 2>&1
4812 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4813 echo "OK, that will do." >&4
4815 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4830 echo "Perhaps can we force $cc -E using a wrapper..."
4831 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4832 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4838 echo "Nope, we'll have to live without it..."
4852 "$wrapper"|'cppstdin') ;;
4853 *) $rm -f $wrapper;;
4855 $rm -f testcpp.c testcpp.out
4857 : Adjust cppfilter for path component separator
4859 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
4860 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
4864 : Use gcc to determine libpth and incpth
4865 # If using gcc or clang, we can get better values for libpth, incpth
4866 # and usrinc directly from the compiler.
4867 # Note that ccname for clang is also gcc.
4870 $echo 'extern int foo;' > try.c
4871 set X `$cppstdin -v try.c 2>&1 | $awk '/^#include </,/^End of search /'|$cppfilter $grep '/include'`
4873 if $test $# -gt 0; then
4875 incpth="`$echo $incpth|$sed 's/^ //'`"
4877 j="`$echo $i|$sed 's,/include$,/lib,'`"
4878 if $test -d $j; then
4882 libpth="`$echo $libpth|$sed 's/^ //'`"
4883 for xxx in $libpth $loclibpth $plibpth $glibpth; do
4884 if $test -d $xxx; then
4887 *) libpth="$libpth $xxx";;
4894 '') for i in $incpth; do
4895 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
4903 case "$usecrosscompile" in
4906 '') echo "Incpth not defined." >&4; croak=y ;;
4907 *) echo "Using incpth '$incpth'." >&4 ;;
4910 '') echo "Libpth not defined." >&4; croak=y ;;
4911 *) echo "Using libpth '$libpth'." >&4 ;;
4914 '') echo "Usrinc not defined." >&4; croak=y ;;
4915 *) echo "Using usrinc $usrinc." >&4 ;;
4919 if test "X$sysroot" = X; then
4920 echo "Cannot continue, aborting." >&4; exit 1
4922 echo "Cross-compiling using sysroot $sysroot, failing to guess inc/lib paths is not fatal" >&4
4931 : Default value for incpth is just usrinc
4933 '') incpth="$usrinc";;
4936 : Set private lib path
4939 plibpth="$incpath/usr/lib $sysroot/usr/local/lib $sysroot/usr/ccs/lib"
4944 '') dlist="$loclibpth $plibpth $glibpth";;
4945 *) dlist="$libpth";;
4948 : Now check and see which directories actually exist, avoiding duplicates
4951 if $test -d $xxx; then
4954 *) libpth="$libpth $xxx";;
4960 Some systems have incompatible or broken versions of libraries. Among
4961 the directories listed in the question below, please remove any you
4962 know not to be holding relevant libraries, and add any that are needed.
4963 Say "none" for none.
4967 if test "X$sysroot" != X; then
4969 You have set sysroot to $sysroot, please supply the directories excluding sysroot
4982 rp="Directories to use for library searches?"
4989 : compute shared library extension
4992 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
5002 On some systems, shared libraries may be available. Answer 'none' if
5003 you want to suppress searching of shared libraries for the remainder
5004 of this configuration.
5007 rp='What is the file extension used for shared libraries?'
5011 : Does target system insist that shared library basenames are unique
5014 Some dynamic loaders assume that the *basename* of shared library filenames
5015 are globally unique. We'll default this to undef as we assume your system
5016 is not this weird. Set to defined if you're on one of them.
5021 rp='Make shared library basenames unique?'
5024 y|Y) val="$define" ;;
5027 set d_libname_unique
5030 : Define several unixisms.
5031 : Hints files or command line option can be used to override them.
5032 : The convoluted testing is in case hints files set either the old
5035 '') case "$exe_ext" in
5037 *) _exe="$exe_ext" ;;
5042 '') case "$lib_ext" in
5049 '') case "$obj_ext" in
5056 '') case "$path_sep" in
5067 rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
5069 : Which makefile gets called first. This is used by make depend.
5070 case "$firstmakefile" in
5071 '') firstmakefile='makefile';;
5074 : Check is we will use socks
5076 $define|true|[yY]*) dflt='y';;
5081 Perl can be built to use the SOCKS proxy protocol library. To do so,
5082 Configure must be run with -Dusesocks. If you use SOCKS you also need
5083 to use the PerlIO abstraction layer, this will be implicitly selected.
5085 If this doesn't make any sense to you, just accept the default '$dflt'.
5087 rp='Build Perl for SOCKS?'
5090 y|Y) val="$define" ;;
5096 : Check for uselongdouble support
5098 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
5101 case "$uselongdouble" in
5102 $define|true|[yY]*) dflt='y';;
5107 Perl can be built to take advantage of long doubles which
5108 (if available) may give more accuracy and range for floating point numbers.
5110 If this doesn't make any sense to you, just accept the default '$dflt'.
5112 rp='Try to use long doubles if available?'
5115 y|Y) val="$define" ;;
5121 case "$uselongdouble" in
5122 true|[yY]*) uselongdouble="$define" ;;
5125 : Look for a hint-file generated 'call-back-unit'. If the
5126 : user has specified that long doubles should be used,
5127 : we may need to set or change some other defaults.
5128 if $test -f uselongdouble.cbu; then
5129 echo "Your platform has some specific hints regarding long doubles, using them..."
5130 . ./uselongdouble.cbu
5132 case "$uselongdouble" in
5135 (Your platform does not have any specific hints for long doubles.)
5141 : Looking for optional libraries
5143 echo "Checking for optional libraries..." >&4
5148 case "$libswanted" in
5149 '') libswanted='c_s';;
5152 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
5154 case "$usecbacktrace" in
5155 "$define") libswanted="$libswanted bfd" ;;
5161 for thisdir in $libpth $xlibpth; do
5162 test -d $thisdir && libspath="$libspath $thisdir"
5164 for thislib in $libswanted; do
5165 for thisdir in $libspath; do
5167 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
5168 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
5169 $test -f "$xxx" && eval $libscheck
5170 $test -f "$xxx" && libstyle=shared
5172 if test ! -f "$xxx"; then
5173 xxx=$thisdir/lib$thislib.$so
5174 $test -f "$xxx" && eval $libscheck
5175 $test -f "$xxx" && libstyle=shared
5177 if test ! -f "$xxx"; then
5178 xxx=$thisdir/lib$thislib$_a
5179 $test -f "$xxx" && eval $libscheck
5180 $test -f "$xxx" && libstyle=static
5182 if test ! -f "$xxx"; then
5183 xxx=$thisdir/$thislib$_a
5184 $test -f "$xxx" && eval $libscheck
5185 $test -f "$xxx" && libstyle=static
5187 if test ! -f "$xxx"; then
5188 xxx=$thisdir/lib${thislib}_s$_a
5189 $test -f "$xxx" && eval $libscheck
5190 $test -f "$xxx" && libstyle=static
5191 $test -f "$xxx" && thislib=${thislib}_s
5193 if test ! -f "$xxx"; then
5194 xxx=$thisdir/Slib$thislib$_a
5195 $test -f "$xxx" && eval $libscheck
5196 $test -f "$xxx" && libstyle=static
5198 if $test -f "$xxx"; then
5200 shared) echo "Found -l$thislib (shared)." ;;
5201 static) echo "Found -l$thislib." ;;
5202 *) echo "Found -l$thislib ($libstyle)." ;;
5206 *) dflt="$dflt -l$thislib"
5207 libsfound="$libsfound $xxx"
5209 libsfiles="$libsfiles $yyy"
5210 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
5211 case " $libsdirs " in
5213 *) libsdirs="$libsdirs $yyy" ;;
5220 if $test ! -f "$xxx"; then
5221 echo "No -l$thislib."
5232 ' '|'') dflt='none';;
5237 In order to compile $package on your machine, a number of libraries
5238 are usually needed. Include any other special libraries here as well.
5239 Say "none" for none. The default list is almost always right.
5243 rp="What libraries to use?"
5250 : determine optimization, if desired, or use for debug flag also
5252 ' '|$undef) dflt='none';;
5254 *) dflt="$optimize";;
5258 By default, $package compiles with the -O flag to use the optimizer.
5259 Alternately, you might want to use the symbolic debugger, which uses
5260 the -g flag (on traditional Unix systems). Either flag can be
5261 specified here. To use neither flag, specify the word "none".
5264 rp="What optimizer/debugger flag should be used?"
5268 'none') optimize=" ";;
5271 : Check what DEBUGGING is required from the command line
5272 : -DEBUGGING or -DDEBUGGING or
5273 : -DEBUGGING=both = -g + -DDEBUGGING
5274 : -DEBUGGING=-g or -Doptimize=-g = -g
5275 : -DEBUGGING=none or -UDEBUGGING =
5276 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
5279 *) DEBUGGING=$EBUGGING ;;
5282 case "$DEBUGGING" in
5286 *) optimize="$optimize -g" ;;
5290 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
5298 case "$DEBUGGING" in
5299 both|$define) dflt='-DDEBUGGING'
5302 : argument order is deliberate, as the flag will start with - which set could
5303 : think is an option
5304 checkccflag='check=$1; flag=$2; callback=$3;
5306 echo "Checking if your compiler accepts $flag" 2>&1;
5307 [ "X$sysroot" != "X" ] && echo "For sysroot = $sysroot";
5308 echo "int main(void) { return 0; }" > gcctest.c;
5309 if $cc $_sysroot -O2 $flag -o gcctest gcctest.c 2>gcctest.out && $run ./gcctest; then
5310 echo "Yes, it does." 2>&1;
5311 if $test -s gcctest.out ; then
5312 echo "But your platform does not like it:";
5317 echo "Leaving current flags $ccflags alone." 2>&1
5319 *) dflt="$dflt $flag";
5325 echo "Nope, it does not, but that is ok." 2>&1;
5329 : We will not override a previous value, but we might want to
5330 : augment a hint file
5332 default|recommended)
5333 case "$gccversion" in
5334 1*) dflt="$dflt -fpcc-struct-return" ;;
5336 case "$optimize:$DEBUGGING" in
5337 *-g*:old) dflt="$dflt -DDEBUGGING";;
5339 case "$gccversion" in
5340 2*) if $test -d /etc/conf/kconfig.d &&
5341 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
5343 # Interactive Systems (ISC) POSIX mode.
5348 case "$gccversion" in
5351 ?*) set strict-aliasing -fno-strict-aliasing
5355 # For gcc, adding -pipe speeds up compilations for some, but apparently
5356 # some assemblers can't read from stdin. (It also slows down compilations
5357 # in other cases, but those are apparently rarer these days.) AD 5/2004.
5358 case "$gccversion" in
5364 # on x86_64 (at least) we require an extra library (libssp) in the
5365 # link command line. This library is not named, so I infer that it is
5366 # an implementation detail that may change. Hence the safest approach
5367 # is to add the flag to the flags passed to the compiler at link time,
5368 # as that way the compiler can do the right implementation dependant
5370 case "$gccversion" in
5371 ?*) set stack-protector -fstack-protector
5378 case "$mips_type" in
5379 *BSD*|'') inclwanted="$locincpth $usrinc";;
5380 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
5382 for thisincl in $inclwanted; do
5383 if $test -d $thisincl; then
5384 if $test x$thisincl != x$usrinc; then
5386 *" -I$thisincl "*);;
5387 *) dflt="$dflt -I$thisincl ";;
5393 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
5395 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5403 *) dflt="$dflt -D$2";;
5407 set signal.h LANGUAGE_C; eval $inctest
5411 ccflags="$ccflags -DSOCKS"
5416 default|recommended) dflt="$ccflags $dflt" ;;
5417 *) dflt="$ccflags";;
5426 Your C compiler may want other flags. For this question you should include
5427 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5428 but you should NOT include libraries or ld flags like -lwhatever. If you
5429 want $package to honor its debug switch, you should include -DDEBUGGING here.
5430 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5432 To use no flags, specify the word "none".
5438 rp="Any additional cc flags?"
5445 : the following weeds options from ccflags that are of no interest to cpp
5447 '') cppflags="$ccflags" ;;
5448 *) cppflags="$cppflags $ccflags" ;;
5450 case "$gccversion" in
5451 1*) cppflags="$cppflags -D__GNUC__"
5453 case "$mips_type" in
5455 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5461 echo "Let me guess what the preprocessor flags are..." >&4
5475 *) ftry="$previous $flag";;
5477 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5478 >cpp1.out 2>/dev/null && \
5479 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5480 >cpp2.out 2>/dev/null && \
5481 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5482 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5484 cppflags="$cppflags $ftry"
5494 *-*) echo "They appear to be: $cppflags";;
5496 $rm -f cpp.c cpp?.out
5500 : flags used in final linking phase
5502 '') if ./venix; then
5508 *-posix*) dflt="$dflt -posix" ;;
5511 *) dflt="$ldflags";;
5513 # See note above about -fstack-protector
5515 *-fstack-protector*)
5517 *-fstack-protector*) ;; # Don't add it again
5518 *) dflt="$dflt -fstack-protector" ;;
5523 : Try to guess additional flags to pick up local libraries.
5524 for thislibdir in $libpth; do
5525 case " $loclibpth " in
5528 *"-L$thislibdir "*) ;;
5529 *) dflt="$dflt -L$thislibdir" ;;
5541 Your C linker may need flags. For this question you should
5542 include -L/whatever and any other flags used by the C linker, but you
5543 should NOT include libraries like -lwhatever.
5545 Make sure you include the appropriate -L/path flags if your C linker
5546 does not normally search all of the directories you specified above,
5549 To use no flags, specify the word "none".
5553 rp="Any additional ld flags (NOT including libraries)?"
5559 rmlist="$rmlist pdp11"
5563 echo "Checking your choice of C compiler and flags for coherency..." >&4
5564 $cat > try.c <<'EOF'
5566 int main() { printf("Ok\n"); return(0); }
5568 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5570 $cat >try.msg <<'EOM'
5571 I've tried to compile and run the following simple program:
5574 $cat try.c >> try.msg
5576 $cat >> try.msg <<EOM
5583 and I got the following output:
5587 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5588 if $sh -c "$run ./try " >>try.msg 2>&1; then
5592 *) echo 'The program compiled OK, but produced no output.' >> try.msg ;;
5595 echo "The program compiled OK, but exited with status $?." >>try.msg
5596 rp="You have a problem. Shall I abort Configure"
5600 echo "I can't compile the test program." >>try.msg
5601 rp="You have a BIG problem. Shall I abort Configure"
5607 case "$knowitall" in
5609 echo "(The supplied flags or libraries might be incorrect.)"
5617 *) echo "Ok. Stopping Configure." >&4
5622 n) echo "OK, that should do.";;
5624 $rm_try gcctest gcctest.out
5626 : define a shorthand compile call
5630 case "$usedevel" in $define|true|[yY]*) if $test ! -f "${mc_file}.c"; then
5631 echo "Internal Configure script bug - compiler test file ${mc_file}.c is missing. Please report this to perlbug@perl.org" >&4;
5635 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5636 : define a shorthand compile call for compilations that should be ok.
5640 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5642 : determine filename position in cpp output
5644 echo "Computing filename position in cpp output for #include directives..." >&4
5646 vos) testaccess=-e ;;
5649 echo '#include <stdio.h>' > foo.c
5652 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5653 $grep '^[ ]*#.*stdio\.h' | \
5654 while read cline; do
5657 while $test \$# -gt 0; do
5658 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5663 pos=\`expr \$pos + 1\`
5675 *) pos="${fieldn}th";;
5677 echo "Your cpp writes the filename in the $pos field of the line."
5679 : locate header file
5684 for usrincdir in $incpth
5686 if test -f \$usrincdir/\$wanted; then
5687 echo "\$usrincdir/\$wanted"
5691 awkprg='{ print \$$fieldn }'
5692 echo "#include <\$wanted>" > foo\$\$.c
5693 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5694 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5695 while read cline; do
5696 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5698 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5699 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5704 # status = 0: grep returned 0 lines, case statement not executed
5705 # status = 1: headerfile found
5706 # status = 2: while loop executed, no headerfile found
5710 if test \$status -eq 1; then
5717 : define an alternate in-header-list? function
5718 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5719 cont=true; xxf="echo \"<\$1> found.\" >&4";
5720 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5721 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5723 case $# in 4) instead=instead;; *) instead="at last";; esac;
5724 while $test "$cont"; do
5726 var=$2; eval "was=\$$2";
5727 if $test "$xxx" && $test -r "$xxx";
5729 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5732 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5733 set $yyy; shift; shift; yyy=$@;
5734 case $# in 0) cont="";;
5735 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5736 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5737 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5738 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5742 do set $yyy; var=$2; eval "was=\$$2";
5743 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5744 set $yyy; shift; shift; yyy=$@;
5747 : see if stdlib is available
5748 set stdlib.h i_stdlib
5751 : check for lengths of integral types
5755 echo "Checking to see how big your integers are..." >&4
5764 printf("intsize=%d;\n", (int)sizeof(int));
5765 printf("longsize=%d;\n", (int)sizeof(long));
5766 printf("shortsize=%d;\n", (int)sizeof(short));
5771 if eval $compile_ok && $run ./try > /dev/null; then
5773 echo "Your integers are $intsize bytes long."
5774 echo "Your long integers are $longsize bytes long."
5775 echo "Your short integers are $shortsize bytes long."
5779 Help! I can't compile and run the intsize test program: please enlighten me!
5780 (This is probably a misconfiguration in your system or libraries, and
5781 you really ought to fix it. Still, I'll try anyway.)
5785 rp="What is the size of an integer (in bytes)?"
5789 rp="What is the size of a long integer (in bytes)?"
5793 rp="What is the size of a short integer (in bytes)?"
5801 : check for long long
5803 echo "Checking to see if you have long long..." >&4
5804 echo 'int main() { long long x = 7; return 0; }' > try.c
5806 if eval $compile; then
5808 echo "You have long long."
5811 echo "You do not have long long."
5817 : check for length of long long
5818 case "${d_longlong}${longlongsize}" in
5821 echo "Checking to see how big your long longs are..." >&4
5822 $cat >try.c <<'EOCP'
5826 printf("%d\n", (int)sizeof(long long));
5831 if eval $compile_ok; then
5832 longlongsize=`$run ./try`
5833 echo "Your long longs are $longlongsize bytes long."
5837 echo "(I can't seem to compile the test program. Guessing...)"
5838 rp="What is the size of a long long (in bytes)?"
5842 if $test "X$longsize" = "X$longlongsize"; then
5843 echo "(That isn't any different from an ordinary long.)"
5849 : see if inttypes.h is available
5850 : we want a real compile instead of Inhdr because some systems
5851 : have an inttypes.h which includes non-existent headers
5854 #include <inttypes.h>
5856 static int32_t foo32 = 0x12345678;
5860 if eval $compile; then
5861 echo "<inttypes.h> found." >&4
5864 echo "<inttypes.h> NOT found." >&4
5873 echo "Checking to see if you have int64_t..." >&4
5875 #include <sys/types.h>
5876 #$i_inttypes I_INTTYPES
5878 #include <inttypes.h>
5880 int main() { int64_t x = 7; }
5883 if eval $compile; then
5885 echo "You have int64_t."
5888 echo "You do not have int64_t."
5894 : Check if 64bit ints have a quad type
5896 echo "Checking which 64-bit integer type we could use..." >&4
5902 val='"unsigned int"'
5907 *) case "$longsize" in
5911 val='"unsigned long"'
5916 *) case "$d_longlong:$longlongsize" in
5921 val='"unsigned long long"'
5926 *) case "$d_int64_t" in
5945 '') echo "Alas, no 64-bit integer types in sight." >&4
5948 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5953 : Do we want 64bit support
5954 case "$uselonglong" in
5955 "$define"|true|[yY]*)
5958 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5960 use64bitint="$define"
5963 case "$use64bits" in
5964 "$define"|true|[yY]*)
5967 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5969 use64bitint="$define"
5972 case "$use64bitints" in
5973 "$define"|true|[yY]*)
5976 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5978 use64bitint="$define"
5981 case "$use64bitsint" in
5982 "$define"|true|[yY]*)
5985 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5987 use64bitint="$define"
5990 case "$uselonglongs" in
5991 "$define"|true|[yY]*)
5994 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5996 use64bitint="$define"
5999 case "$use64bitsall" in
6000 "$define"|true|[yY]*)
6003 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
6005 use64bitall="$define"
6010 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
6012 case "$use64bitall" in
6013 "$define"|true|[yY]*) use64bitint="$define" ;;
6019 You have natively 64-bit long integers.
6023 *) case "$use64bitint" in
6024 "$define"|true|[yY]*) dflt='y';;
6033 Perl can be built to take advantage of 64-bit integer types
6034 on some systems. To do so, Configure can be run with -Duse64bitint.
6035 Choosing this option will most probably introduce binary incompatibilities.
6037 If this doesn't make any sense to you, just accept the default '$dflt'.
6038 (The default has been chosen based on your configuration.)
6040 rp='Try to use 64-bit integers, if available?'
6043 [yY]*) val="$define" ;;
6051 case "$use64bitall" in
6052 "$define"|true|[yY]*) dflt='y' ;;
6053 *) case "$longsize" in
6061 You may also choose to try maximal 64-bitness. It means using as much
6062 64-bitness as possible on the platform. This in turn means even more
6063 binary incompatibilities. On the other hand, your platform may not
6064 have any more 64-bitness available than what you already have chosen.
6066 If this doesn't make any sense to you, just accept the default '$dflt'.
6067 (The default has been chosen based on your configuration.)
6069 rp='Try to use maximal 64-bit support, if available?'
6072 [yY]*) val="$define" ;;
6077 case "$use64bitall" in
6079 case "$use64bitint" in
6083 Since you have chosen a maximally 64-bit build, I'm also turning on
6084 the use of 64-bit integers.
6086 use64bitint="$define" ;;
6091 : Look for a hint-file generated 'call-back-unit'. If the
6092 : user has specified that a 64-bit perl is to be built,
6093 : we may need to set or change some other defaults.
6094 if $test -f use64bitint.cbu; then
6095 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
6098 case "$use64bitint" in
6099 "$define"|true|[yY]*)
6100 : This test was common to all the OpenBSD forks, and seems harmless for
6103 echo "Checking if your C library has broken 64-bit functions..." >&4
6106 typedef $uquadtype myULL;
6113 {4294967303.15, 4294967303ULL},
6114 {4294967294.2, 4294967294ULL},
6115 {4294967295.7, 4294967295ULL},
6118 for (p = test; p->u; p++) {
6119 myULL x = (myULL)p->d;
6130 if eval $compile_ok; then
6131 libcquad=`$run ./try`
6132 echo "Your C library's 64-bit functions are $libcquad."
6134 echo "(I can't seem to compile the test program.)"
6135 echo "Assuming that your C library's 64-bit functions are ok."
6144 *** You have a C library with broken 64-bit functions.
6145 *** 64-bit support does not work reliably in this configuration.
6146 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
6147 *** Cannot continue, aborting.
6154 4) case "$archname64" in
6155 '') archname64=64int ;;
6162 : Look for a hint-file generated 'call-back-unit'. If the
6163 : user has specified that a maximally 64-bit perl is to be built,
6164 : we may need to set or change some other defaults.
6165 if $test -f use64bitall.cbu; then
6166 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
6169 case "$use64bitall" in
6170 "$define"|true|[yY]*)
6172 4) case "$archname64" in
6173 ''|64int) archname64=64all ;;
6180 case "$d_quad:$use64bitint" in
6184 *** You have chosen to use 64-bit integers,
6185 *** but none can be found.
6186 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
6187 *** Cannot continue, aborting.
6194 : check for length of double
6196 case "$doublesize" in
6198 echo "Checking to see how big your double precision numbers are..." >&4
6207 printf("%d\n", (int)sizeof(double));
6212 if eval $compile_ok; then
6213 doublesize=`$run ./try`
6214 echo "Your double is $doublesize bytes long."
6217 echo "(I can't seem to compile the test program. Guessing...)"
6218 rp="What is the size of a double precision number (in bytes)?"
6226 : check for long doubles
6228 echo "Checking to see if you have long double..." >&4
6229 echo 'int main() { long double x = 7.0; }' > try.c
6231 if eval $compile; then
6233 echo "You have long double."
6236 echo "You do not have long double."
6242 : check for length of long double
6243 case "${d_longdbl}${longdblsize}" in
6246 echo "Checking to see how big your long doubles are..." >&4
6247 $cat >try.c <<'EOCP'
6251 printf("%d\n", sizeof(long double));
6256 if eval $compile; then
6257 longdblsize=`$run ./try`
6258 echo "Your long doubles are $longdblsize bytes long."
6262 echo "(I can't seem to compile the test program. Guessing...)" >&4
6263 rp="What is the size of a long double (in bytes)?"
6267 if $test "X$doublesize" = "X$longdblsize"; then
6268 echo "That isn't any different from an ordinary double."
6269 echo "I'll keep your setting anyway, but you may see some"
6270 echo "harmless compilation warnings."
6276 : determine the architecture name
6278 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
6279 tarch=`arch`"-$osname"
6280 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
6281 if uname -m > tmparch 2>&1 ; then
6282 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
6283 -e 's/$/'"-$osname/" tmparch`
6291 case "$myarchname" in
6294 echo "(Your architecture name used to be $myarchname.)"
6298 case "$targetarch" in
6300 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
6305 *) dflt="$archname";;
6307 rp='What is your architecture name'
6311 : optionally add API version to the architecture for versioned archlibs
6312 case "$useversionedarchname" in
6313 $define|true|[yY]*) dflt='y';;
6316 rp='Add the Perl API version to your archname?'
6319 y|Y) useversionedarchname="$define" ;;
6320 *) useversionedarchname="$undef" ;;
6322 case "$useversionedarchname" in
6325 *-$api_versionstring)
6326 echo "...and architecture name already has -$api_versionstring" >&4
6329 archname="$archname-$api_versionstring"
6330 echo "...setting architecture name to $archname." >&4
6336 case "$usethreads" in
6338 echo "Threads selected." >&4
6340 *-thread*) echo "...and architecture name already has -thread." >&4
6342 *) archname="$archname-thread"
6343 echo "...setting architecture name to $archname." >&4
6348 case "$usemultiplicity" in
6350 echo "Multiplicity selected." >&4
6352 *-multi*) echo "...and architecture name already has -multi." >&4
6354 *) archname="$archname-multi"
6355 echo "...setting architecture name to $archname." >&4
6360 case "$use64bitint$use64bitall" in
6362 case "$archname64" in
6364 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
6367 case "$use64bitint" in
6368 "$define") echo "64 bit integers selected." >&4 ;;
6370 case "$use64bitall" in
6371 "$define") echo "Maximal 64 bitness selected." >&4 ;;
6374 *-$archname64*) echo "...and architecture name already has $archname64." >&4
6376 *) archname="$archname-$archname64"
6377 echo "...setting architecture name to $archname." >&4
6383 case "$uselongdouble" in
6385 echo "Long doubles selected." >&4
6386 case "$longdblsize" in
6388 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
6392 *-ld*) echo "...and architecture name already has -ld." >&4
6394 *) archname="$archname-ld"
6395 echo "...setting architecture name to $archname." >&4
6402 if $test -f archname.cbu; then
6403 echo "Your platform has some specific hints for architecture name, using them..."
6407 : set the prefixit variable, to compute a suitable default value
6408 prefixit='case "$3" in
6410 case "$oldprefix" in
6411 "") eval "$1=\"\$$2\"";;
6418 ""|" ") eval "$1=\"\$$2\"";;
6424 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
6426 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
6427 /*-$oldprefix/*|\~*-$oldprefix/*)
6428 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
6429 *) eval "$1=\"\$$2\"";;
6433 : determine installation style
6434 : For now, try to deduce it from prefix unless it is already set.
6435 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
6436 case "$installstyle" in
6437 '') case "$prefix" in
6438 *perl*) dflt='lib';;
6439 *) dflt='lib/perl5' ;;
6442 *) dflt="$installstyle" ;;
6444 : Probably not worth prompting for this since we prompt for all
6445 : the directories individually, and the prompt would be too long and
6449 : determine where public executables go
6454 rp='Pathname where the public executables will reside?'
6456 if $test "X$ansexp" != "X$binexp"; then
6460 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6461 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
6462 : this via initialinstalllocation
6465 case "$userelocatableinc" in
6466 $define|true|[yY]*) dflt='y' ;;
6471 Would you like to build Perl so that the installation is relocatable, so that
6472 library paths in @INC are determined relative to the path of the perl binary?
6473 This is not advised for system Perl installs, or if you need to run setid
6474 scripts or scripts under taint mode.
6476 If this doesn't make any sense to you, just accept the default '$dflt'.
6478 rp='Use relocatable @INC?'
6481 y|Y) val="$define" ;;
6484 set userelocatableinc
6487 initialinstalllocation="$binexp"
6488 : Default prefix is now "up one level from where the binaries are"
6489 case "$userelocatableinc" in
6495 installprefixexp=".../.."
6499 : determine where private library files go
6500 : Usual default is /usr/local/lib/perl5/$version.
6501 : Also allow things like /opt/perl/lib/$version, since
6502 : /opt/perl/lib/perl5... would be redundant.
6503 : The default "style" setting is made in installstyle.U
6504 case "$installstyle" in
6505 *lib/perl5*) set dflt privlib lib/$package/$version ;;
6506 *) set dflt privlib lib/$version ;;
6511 There are some auxiliary files for $package that need to be put into a
6512 private library directory that is accessible by everyone.
6517 rp='Pathname where the private library files will reside?'
6522 : set the prefixup variable, to restore leading tilda escape
6523 prefixup='case "$prefixexp" in
6525 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
6528 : determine where public architecture dependent libraries go
6531 : privlib default is /usr/local/lib/$package/$version
6532 : archlib default is /usr/local/lib/$package/$version/$archname
6533 : privlib may have an optional trailing /share.
6534 tdflt=`echo $privlib | $sed 's,/share$,,'`
6535 tdflt=$tdflt/$archname
6544 $spackage contains architecture-dependent library files. If you are
6545 sharing libraries in a heterogeneous environment, you might store
6546 these files in a separate location. Otherwise, you can just include
6547 them with the rest of the public library files.
6552 rp='Where do you want to put the public architecture-dependent libraries?'
6556 if $test X"$archlib" = X"$privlib"; then
6562 : see if setuid scripts can be secure
6565 Some kernels have a bug that prevents setuid #! scripts from being
6566 secure. Some sites have disabled setuid #! scripts because of this.
6568 First let's decide if your kernel supports secure setuid #! scripts.
6569 (If setuid #! scripts would be secure but have been disabled anyway,
6570 don't say that they are secure if asked.)
6575 if $test -d /dev/fd; then
6576 echo "#!$ls" >reflect
6577 chmod +x,u+s reflect
6578 ./reflect >flect 2>&1
6579 if $contains "/dev/fd" flect >/dev/null; then
6580 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6584 If you are not sure if they are secure, I can check but I'll need a
6585 username and password different from the one you are using right now.
6586 If you don't have such a username or don't want me to test, simply
6590 rp='Other username to test security of setuid scripts with?'
6595 case "$d_suidsafe" in
6596 '') echo "I'll assume setuid scripts are *not* secure." >&4
6599 echo "Well, the $hint value is *not* secure." >&4
6601 *) echo "Well, the $hint value *is* secure." >&4
6606 $rm -f reflect flect
6607 echo "#!$ls" >reflect
6608 chmod +x,u+s reflect
6611 echo '"su" will (probably) prompt you for '"$ans's password."
6612 su $ans -c './reflect >flect'
6613 if $contains "/dev/fd" flect >/dev/null; then
6614 echo "Okay, it looks like setuid scripts are secure." >&4
6617 echo "I don't think setuid scripts are secure." >&4
6622 rp='Does your kernel have *secure* setuid scripts?'
6625 [yY]*) val="$define";;
6630 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6631 echo "(That's for file descriptors, not floppy disks.)"
6637 $rm -f reflect flect
6639 : now see if they want to do setuid emulation
6640 if $test $patchlevel -lt 11; then
6643 case "$d_suidsafe" in
6646 echo "No need to emulate SUID scripts since they are secure here." >&4
6650 Some systems have disabled setuid scripts, especially systems where
6651 setuid scripts cannot be secure. On systems where setuid scripts have
6652 been disabled, the setuid/setgid bits on scripts are currently
6653 useless. It is possible for $package to detect those bits and emulate
6654 setuid/setgid in a secure fashion. This emulation will only work if
6655 setuid scripts have been disabled in your kernel.
6659 "$define") dflt=y ;;
6662 rp="Do you want to do setuid/setgid emulation?"
6665 [yY]*) val="$define";;
6677 SUID emulation has been removed for 5.12
6678 Please re-run Configure without -Dd_dosuid
6687 : Find perl5.005 or later.
6688 echo "Looking for a previously installed perl5.005 or later... "
6690 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
6691 : Check if this perl is recent and can load a simple module
6692 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6695 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6705 '') echo "None found. That's ok.";;
6706 *) echo "Using $perl5." ;;
6709 : Set the siteprefix variables
6712 After $package is installed, you may wish to install various
6713 add-on modules and utilities. Typically, these add-ons will
6714 be installed under $prefix with the rest
6715 of this package. However, you may wish to install such add-ons
6716 elsewhere under a different prefix.
6718 If you do not wish to put everything under a single prefix, that's
6719 ok. You will be prompted for the individual locations; this siteprefix
6720 is only used to suggest the defaults.
6722 The default should be fine for most people.
6726 rp='Installation prefix to use for add-on modules and utilities?'
6727 : XXX Here might be another good place for an installstyle setting.
6728 case "$siteprefix" in
6730 *) dflt=$siteprefix ;;
6733 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6735 case "$siteprefix" in
6739 *) oldsiteprefix="$prefix";;
6744 siteprefixexp="$ansexp"
6746 : determine where site specific libraries go.
6747 : Usual default is /usr/local/lib/perl5/site_perl/$version
6748 : The default "style" setting is made in installstyle.U
6749 : XXX No longer works with Prefixit stuff.
6750 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6752 '') case "$installstyle" in
6753 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6754 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6762 The installation process will create a directory for
6763 site-specific extensions and modules. Most users find it convenient
6764 to place all site-specific files in this directory rather than in the
6765 main distribution directory.
6769 rp='Pathname for the site-specific library files?'
6773 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6775 : Determine list of previous versions to include in @INC
6776 $cat > getverlist <<EOPL
6779 \$api_versionstring = "$api_versionstring";
6780 \$version = "$version";
6781 \$stem = "$sitelib_stem";
6782 \$archname = "$archname";
6784 $cat >> getverlist <<'EOPL'
6785 # The list found is store twice for each entry: the original name, and
6786 # the binary broken down version as pack "sss", so sorting is easy and
6787 # unambiguous. This will work for all versions that have a maximum of
6788 # three digit groups, separate by '.'s or '_'s. Names are extended with
6789 # ".0.0" to ensure at least three elements for the pack.
6790 # -- H.Merijn Brand (m)'06 23-10-2006
6792 # Can't have leading @ because metaconfig interprets it as a command!
6793 ;@inc_version_list=();
6794 # XXX Redo to do opendir/readdir?
6797 ;@candidates = map {
6798 [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
6799 ;@candidates = sort { $a->[1] cmp $b->[1]} @candidates;
6805 ($pversion, $aversion, $vsn5005) = map {
6806 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
6807 foreach $d (@candidates) {
6808 if ($d->[1] lt $pversion) {
6809 if ($d->[1] ge $aversion) {
6810 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
6812 elsif ($d->[1] ge $vsn5005) {
6813 unshift(@inc_version_list, grep { -d } $d->[0]);
6817 # Skip newer version. I.e. don't look in
6818 # 5.7.0 if we're installing 5.6.1.
6822 if (@inc_version_list) {
6823 print join(' ', @inc_version_list);
6826 # Blank space to preserve value for next Configure run.
6831 case "$inc_version_list" in
6832 '') if test -x "$perl5$exe_ext"; then
6833 dflt=`$perl5 getverlist`
6838 $undef) dflt='none' ;;
6839 *) eval dflt=\"$inc_version_list\" ;;
6842 ''|' ') dflt=none ;;
6849 In order to ease the process of upgrading, this version of perl
6850 can be configured to use modules built and installed with earlier
6851 versions of perl that were installed under $prefix. Specify here
6852 the list of earlier versions that this version of perl should check.
6853 If Configure detected no earlier versions of perl installed under
6854 $prefix, then the list will be empty. Answer 'none' to tell perl
6855 to not search earlier versions.
6857 The default should almost always be sensible, so if you're not sure,
6858 just accept the default.
6861 rp='List of earlier versions to include in @INC?'
6864 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
6865 *) inc_version_list="$ans" ;;
6867 case "$inc_version_list" in
6869 inc_version_list_init='0'
6870 d_inc_version_list="$undef"
6872 *) inc_version_list_init=`echo $inc_version_list |
6873 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6874 d_inc_version_list="$define"
6879 : see if malloc/malloc.h has to be included
6880 set malloc/malloc.h i_mallocmalloc
6883 : see if this is a malloc.h system
6884 : we want a real compile instead of Inhdr because some systems have a
6885 : malloc.h that just gives a compile error saying to use stdlib.h instead
6890 #$i_mallocmalloc I_MALLOCMALLOC
6891 #ifdef I_MALLOCMALLOC
6892 # include <malloc/malloc.h>
6895 int main () { return 0; }
6898 if eval $compile; then
6899 echo "<malloc.h> found." >&4
6902 echo "<malloc.h> NOT found." >&4
6909 : check for length of pointer
6913 echo "Checking to see how big your pointers are..." >&4
6922 printf("%d\n", (int)sizeof(void *));
6927 if eval $compile_ok; then
6928 ptrsize=`$run ./try`
6929 echo "Your pointers are $ptrsize bytes long."
6932 echo "(I can't seem to compile the test program. Guessing...)" >&4
6933 rp="What is the size of a pointer (in bytes)?"
6940 case "$use64bitall" in
6941 "$define"|true|[yY]*)
6945 *** You have chosen a maximally 64-bit build,
6946 *** but your pointers are only 4 bytes wide.
6947 *** Please rerun Configure without -Duse64bitall.
6952 *** Since you have quads, you could possibly try with -Duse64bitint.
6957 *** Cannot continue, aborting.
6968 : determine whether to use malloc wrapping
6970 case "$usemallocwrap" in
6971 [yY]*|true|$define) dflt='y' ;;
6972 [nN]*|false|$undef) dflt='n' ;;
6973 *) case "$usedevel" in
6974 [yY]*|true|$define) dflt='y' ;;
6979 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
6981 usemallocwrap="$ans"
6984 usemallocwrap="$define" ;;
6986 usemallocwrap="$undef" ;;
6989 : determine which malloc to compile in
6991 case "$usemymalloc" in
6992 [yY]*|true|$define) dflt='y' ;;
6993 [nN]*|false|$undef) dflt='n' ;;
6994 *) case "$ptrsize" in
6998 if test "$useithreads" = "$define"; then dflt='n'; fi
7001 rp="Do you wish to attempt to use the malloc that comes with $package?"
7007 mallocsrc='malloc.c'
7008 mallocobj="malloc$_o"
7009 d_mymalloc="$define"
7012 : Remove malloc from list of libraries to use
7013 echo "Removing unneeded -lmalloc from library list" >&4
7014 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
7017 echo "libs = $libs" >&4
7029 : compute the return types of malloc and free
7031 $cat >malloc.c <<END
7035 #include <sys/types.h>
7049 case "$malloctype" in
7051 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
7058 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
7062 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
7069 echo "Your system uses $freetype free(), it would seem." >&4
7071 : determine where site specific architecture-dependent libraries go.
7072 : sitelib default is /usr/local/lib/perl5/site_perl/$version
7073 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
7074 : sitelib may have an optional trailing /share.
7076 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
7077 dflt="$dflt/$archname"
7082 set sitearch sitearch none
7086 The installation process will also create a directory for
7087 architecture-dependent site-specific extensions and modules.
7091 rp='Pathname for the site-specific architecture-dependent library files?'
7095 if $test X"$sitearch" = X"$sitelib"; then
7098 d_sitearch="$define"
7101 : Set the vendorprefix variables
7104 The installation process will also create a directory for
7105 vendor-supplied add-ons. Vendors who supply perl with their system
7106 may find it convenient to place all vendor-supplied files in this
7107 directory rather than in the main distribution directory. This will
7108 ease upgrades between binary-compatible maintenance versions of perl.
7110 Of course you may also use these directories in whatever way you see
7111 fit. For example, you might use them to access modules shared over a
7112 company-wide network.
7114 The default answer should be fine for most people.
7115 This causes further questions about vendor add-ons to be skipped
7116 and no vendor-specific directories will be configured for perl.
7119 rp='Do you want to configure vendor-specific add-on directories?'
7120 case "$usevendorprefix" in
7121 define|true|[yY]*) dflt=y ;;
7122 *) : User may have set vendorprefix directly on Configure command line.
7123 case "$vendorprefix" in
7132 rp='Installation prefix to use for vendor-supplied add-ons?'
7133 case "$vendorprefix" in
7134 '') dflt="$prefix" ;;
7135 *) dflt=$vendorprefix ;;
7138 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
7140 case "$vendorprefix" in
7144 *) oldvendorprefix="$prefix";;
7148 usevendorprefix="$define"
7150 vendorprefixexp="$ansexp"
7152 *) usevendorprefix="$undef"
7158 : Set the vendorlib variables
7159 case "$vendorprefix" in
7160 '') d_vendorlib="$undef"
7164 *) d_vendorlib="$define"
7165 : determine where vendor-supplied modules go.
7166 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
7167 case "$vendorlib" in
7169 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7170 case "$installstyle" in
7171 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
7172 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
7175 *) dflt="$vendorlib"
7179 rp='Pathname for the vendor-supplied library files?'
7182 vendorlibexp="$ansexp"
7185 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
7189 : Set the vendorarch variables
7190 case "$vendorprefix" in
7191 '') d_vendorarch="$undef"
7195 *) d_vendorarch="$define"
7196 : determine where vendor-supplied architecture-dependent libraries go.
7197 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
7198 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
7199 : vendorlib may have an optional trailing /share.
7200 case "$vendorarch" in
7201 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
7202 dflt="$dflt/$archname"
7204 *) dflt="$vendorarch" ;;
7207 rp='Pathname for vendor-supplied architecture-dependent files?'
7210 vendorarchexp="$ansexp"
7213 prefixvar=vendorarch
7215 if $test X"$vendorarch" = X"$vendorlib"; then
7216 d_vendorarch="$undef"
7218 d_vendorarch="$define"
7221 : Final catch-all directories to search
7224 Lastly, you can have perl look in other directories for extensions and
7225 modules in addition to those already specified.
7226 These directories will be searched after
7230 test X"$vendorlib" != "X" && echo ' ' $vendorlib
7231 test X"$vendorarch" != "X" && echo ' ' $vendorarch
7233 case "$otherlibdirs" in
7234 ''|' ') dflt='none' ;;
7235 *) dflt="$otherlibdirs" ;;
7238 Enter a colon-separated set of extra paths to include in perl's @INC
7239 search path, or enter 'none' for no extra paths.
7243 rp='Colon-separated list of additional directories for perl to search?'
7246 ' '|''|none) otherlibdirs=' ' ;;
7247 *) otherlibdirs="$ans" ;;
7249 case "$otherlibdirs" in
7253 set d_perl_otherlibdirs
7256 : Cruising for prototypes
7258 echo "Checking out function prototypes..." >&4
7259 $cat >prototype.c <<EOCP
7264 int main(int argc, char *argv[]) {
7267 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
7268 echo "Your C compiler appears to support function prototypes."
7271 echo "Your C compiler doesn't seem to understand function prototypes."
7278 : Check if ansi2knr is required
7279 case "$prototype" in
7281 *) ansi2knr='ansi2knr'
7286 This version of $package can only be compiled by a compiler that
7287 understands function prototypes. Unfortunately, your C compiler
7289 doesn't seem to understand them. Sorry about that.
7291 If GNU cc is available for your system, perhaps you could try that instead.
7293 Eventually, we hope to support building Perl with pre-ANSI compilers.
7294 If you would like to help in that effort, please contact <perlbug@perl.org>.
7296 Aborting Configure now.
7303 dflt_dtrace='/usr/sbin/dtrace'
7304 $test -x /usr/bin/dtrace && dflt_dtrace='/usr/bin/dtrace'
7308 Perl can be built to support DTrace on platforms that support it.
7309 DTrace is a diagnosis and performance analysis tool from Sun.
7311 If this doesn't make any sense to you, just accept the default '$dflt'.
7315 case "$usedtrace" in
7321 dflt_dtrace=$usedtrace
7328 rp='Support DTrace if available?'
7331 y|Y) val="$define" ;;
7337 test "X$usedtrace" != "X$define" && break
7340 rp='Where is the dtrace executable?'
7349 if $dtrace -h -s ../perldtrace.d \
7350 -o perldtrace.tmp >/dev/null 2>&1 \
7351 && rm -f perldtrace.tmp
7354 echo "Good: your $dtrace knows about the -h flag."
7358 *** $me: Fatal Error: $dtrace doesn't support -h flag
7360 *** Your installed dtrace doesn't support the -h switch to compile a D
7361 *** program into a C header. Can't continue.
7373 *** $me: Fatal Error: $dtrace not found.
7380 echo "*** $dtrace was not found."
7386 : See if we want extra modules installed
7393 Perl can be built with extra modules or bundles of modules which
7394 will be fetched from the CPAN and installed alongside Perl.
7396 Notice that you will need access to the CPAN; either via the Internet,
7397 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
7398 be asked later to configure the CPAN.pm module which will in turn do
7399 the installation of the rest of the extra modules or bundles.)
7401 Notice also that if the modules require any external software such as
7402 libraries and headers (the libz library and the zlib.h header for the
7403 Compress::Zlib module, for example) you MUST have any such software
7404 already installed, this configuration process will NOT install such
7407 If this doesn't make any sense to you, just accept the default '$dflt'.
7409 rp='Install any extra modules (y or n)?'
7415 Please list any extra modules or bundles to be installed from CPAN,
7416 with spaces between the names. The names can be in any format the
7417 'install' command of CPAN.pm will understand. (Answer 'none',
7418 without the quotes, to install no extra modules or bundles.)
7428 $rm -f ../extras.lst
7430 *) echo "(Saving the list of extras for later...)"
7431 echo "$extras" > ../extras.lst
7439 : determine where html pages for programs go
7440 set html1dir html1dir none
7444 If you wish to install html files for programs in $spackage, indicate
7445 the appropriate directory here. To skip installing html files,
7449 ''|none|$undef|' ') dflt=none ;;
7450 *) dflt=$html1dir ;;
7453 rp="Directory for the main $spackage html pages?"
7457 : Use ' ' for none so value is preserved next time through Configure
7458 $test X"$html1dir" = "X" && html1dir=' '
7460 : determine where html pages for libraries and modules go
7461 set html3dir html3dir none
7465 If you wish to install html files for modules associated with $spackage,
7466 indicate the appropriate directory here. To skip installing html files,
7469 : There is no obvious default. If they have specified html1dir, then
7470 : try to key off that, possibly changing .../html1 into .../html3.
7472 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
7473 *) dflt=$html3dir ;;
7476 rp="Directory for the $spackage module html pages?"
7480 : Use ' ' for none so value is preserved next time through Configure
7481 $test X"$html3dir" = "X" && html3dir=' '
7483 : determine whether to install perl also as /usr/bin/perl
7486 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
7488 Many scripts expect perl to be installed as /usr/bin/perl.
7490 If you want to, I can install the perl you are about to compile
7491 as /usr/bin/perl (in addition to $bin/perl).
7493 if test -f /usr/bin/perl; then
7496 However, please note that because you already have a /usr/bin/perl,
7497 overwriting that with a new Perl would very probably cause problems.
7498 Therefore I'm assuming you don't want to do that (unless you insist).
7501 case "$installusrbinperl" in
7502 "$define"|[yY]*) dflt='y';;
7508 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
7511 case "$installusrbinperl" in
7512 "$undef"|[nN]*) dflt='n';;
7516 rp="Do you want to install perl as /usr/bin/perl?"
7519 [yY]*) val="$define";;
7525 set installusrbinperl
7528 : Check if we are using the GNU C library
7530 echo "Checking for GNU C Library..." >&4
7532 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
7533 alone are insufficient to distinguish different versions, such as
7534 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
7535 libc version 2.1.0. A. Dougherty, June 3, 2002.
7541 # ifdef __GLIBC_MINOR__
7542 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
7543 # include <gnu/libc-version.h>
7544 printf("%s\n", gnu_get_libc_version());
7546 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
7549 printf("%d\n", __GLIBC__);
7558 if eval $compile_ok && $run ./try > glibc.ver; then
7560 gnulibc_version=`$cat glibc.ver`
7561 echo "You are using the GNU C Library version $gnulibc_version"
7565 echo "You are not using the GNU C Library"
7571 : see if nm is to be used to determine whether a symbol is defined or not
7575 case "$d_gnulibc" in
7578 echo "nm probably won't work on the GNU C Library." >&4
7584 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
7586 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
7587 echo "'nm' won't be sufficient on this system." >&4
7593 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
7594 if $test $dflt -gt 20; then
7604 true|$define) dflt=y;;
7611 I can use $nm to extract the symbols from your C libraries. This
7612 is a time consuming task which may generate huge output on the disk (up
7613 to 3 megabytes) but that should make the symbols extraction faster. The
7614 alternative is to skip the 'nm' extraction part and to compile a small
7615 test program instead to determine whether each symbol is present. If
7616 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
7617 this may be the best solution.
7619 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
7622 rp="Shall I use $nm to extract C symbols from the libraries?"
7625 [Nn]*) usenm=false;;
7634 : nm options which may be necessary
7636 '') if $test -f /mach_boot; then
7638 elif $test -d /usr/ccs/lib; then
7639 nm_opt='-p' # Solaris (and SunOS?)
7640 elif $test -f /dgux; then
7642 elif $test -f /lib64/rld; then
7643 nm_opt='-p' # 64-bit Irix
7649 : nm options which may be necessary for shared libraries but illegal
7650 : for archive libraries. Thank you, Linux.
7651 case "$nm_so_opt" in
7652 '') case "$myuname" in
7654 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
7655 nm_so_opt='--dynamic'
7662 : Figure out where the libc is located
7665 : get list of predefined functions in a handy place
7670 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
7676 *) for thislib in $libs; do
7679 : Handle C library specially below.
7682 thislib=`echo $thislib | $sed -e 's/^-l//'`
7683 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
7685 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
7687 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
7689 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
7691 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
7693 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
7695 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
7700 libnames="$libnames $try"
7702 *) libnames="$libnames $thislib" ;;
7711 for xxx in $libpth; do
7712 $test -r $1 || set $xxx/libc.$so
7713 : The messy sed command sorts on library version numbers.
7715 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
7716 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
7718 s/[0-9][0-9]*/0000&/g
7719 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
7722 $sort | $sed -e 's/^.* //'`
7725 $test -r $1 || set $sysroot/usr/ccs/lib/libc.$so
7726 $test -r $1 || set $sysroot/lib/libsys_s$_a
7732 if $test -r "$1"; then
7733 echo "Your (shared) C library seems to be in $1."
7735 elif $test -r /lib/libc && $test -r /lib/clib; then
7736 echo "Your C library seems to be in both /lib/clib and /lib/libc."
7738 libc='/lib/clib /lib/libc'
7739 if $test -r /lib/syslib; then
7740 echo "(Your math library is in /lib/syslib.)"
7741 libc="$libc /lib/syslib"
7743 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7744 echo "Your C library seems to be in $libc, as you said before."
7745 elif $test -r $incpath/usr/lib/libc$_a; then
7746 libc=$incpath/usr/lib/libc$_a;
7747 echo "Your C library seems to be in $libc. That's fine."
7748 elif $test -r /lib/libc$_a; then
7750 echo "Your C library seems to be in $libc. You're normal."
7752 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
7754 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
7755 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
7756 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
7758 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7760 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7763 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
7765 if $test -r "$tans"; then
7766 echo "Your C library seems to be in $tans, of all places."
7772 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7776 If the guess above is wrong (which it might be if you're using a strange
7777 compiler, or your machine supports multiple models), you can override it here.
7782 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
7784 I can't seem to find your C library. I've looked in the following places:
7787 $sed 's/^/ /' libpath
7790 None of these seems to contain your C library. I need to get its name...
7795 rp='Where is your C library?'
7800 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
7801 set X `cat libnames`
7804 case $# in 1) xxx=file; esac
7805 echo "Extracting names from the following $xxx for later perusal:" >&4
7807 $sed 's/^/ /' libnames >&4
7809 $echo $n "This may take a while...$c" >&4
7813 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
7814 *) $nm $nm_opt $file 2>/dev/null;;
7819 $grep fprintf libc.tmp > libc.ptf
7820 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
7821 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
7823 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
7825 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7827 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
7829 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7831 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
7833 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7835 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
7837 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7839 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
7841 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7843 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
7845 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7847 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
7848 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
7850 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7852 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
7854 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7856 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
7858 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7860 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
7862 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7864 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
7866 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7868 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
7870 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7872 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
7874 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7876 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
7878 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7881 $nm -p $* 2>/dev/null >libc.tmp
7882 $grep fprintf libc.tmp > libc.ptf
7883 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
7884 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
7890 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
7892 if $ar t $libc > libc.tmp && \
7893 $contains '^fprintf$' libc.tmp >/dev/null 2>&1
7895 for thisname in $libnames $libc; do
7896 $ar t $thisname >>libc.tmp
7898 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
7900 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
7901 for thisname in $libnames $libc; do
7902 $ar tv $thisname >>libc.tmp
7903 emximp -o tmp.imp $thisname \
7905 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
7906 < tmp.imp >>libc.tmp
7909 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
7912 echo "$ar didn't seem to work right." >&4
7913 echo "Maybe this is a Cray...trying bld instead..." >&4
7915 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list &&
7918 for thisname in $libnames; do
7920 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
7921 $ar t $thisname >>libc.tmp
7925 echo "That didn't work either. Giving up." >&4
7935 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
7936 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
7938 *) if $test -f /lib/syscalls.exp; then
7940 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
7941 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' \
7942 /lib/syscalls.exp >>libc.list
7948 $rm -f libnames libpath
7950 : Check if we are using C++
7952 echo "Checking for C++..." >&4
7953 $cat >try.c <<'EOCP'
7965 if eval $compile_ok && $run ./try; then
7967 echo "You are using a C++ compiler."
7970 echo "You are not using a C++ compiler."
7976 : is a C symbol defined?
7979 -v) tf=libc.tmp; tdc="";;
7980 -a) tf=libc.tmp; tdc="[]";;
7981 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
7983 case "$d_cplusplus" in
7984 $define) extern_C="extern \"C\"" ;;
7985 *) extern_C="extern" ;;
7988 case "$reuseval-$4" in
7990 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
7995 if $test "$runnm" = true; then
7996 if $contains $tlook $tf >/dev/null 2>&1; then
7998 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
7999 echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p() && p() != (void *)main) return(0); else return(1); }"> try.c;
8000 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
8001 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
8005 echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p() && p() != (void *)main) return(0); else return(1); }"> try.c;
8006 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
8012 $define) tval=true;;
8019 : define an is-in-libc? function
8020 inlibc='echo " "; td=$define; tu=$undef;
8021 sym=$1; var=$2; eval "was=\$$2";
8023 case "$reuseval$was" in
8033 echo "$sym() found." >&4;
8034 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
8036 echo "$sym() NOT found." >&4;
8037 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
8041 $define) echo "$sym() found." >&4;;
8042 *) echo "$sym() NOT found." >&4;;
8046 : see if dlopen exists
8048 xxx_ccflags="$ccflags"
8050 : with g++ one needs -shared to get is-in-libc to work for dlopen
8051 case "$gccversion" in
8053 *) case "$d_cplusplus" in
8054 "$define") ccflags="$ccflags -shared" ;;
8061 ccflags="$xxx_ccflags"
8063 : see if this is a unistd.h system
8064 set unistd.h i_unistd
8067 : determine which dynamic loading, if any, to compile in
8069 dldir="ext/DynaLoader"
8082 $define) dflt='y' ;;
8084 : Does a dl_xxx.xs file exist for this operating system
8085 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
8088 rp="Do you wish to use dynamic loading?"
8095 '') if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
8096 dflt="$dldir/dl_${osname}.xs"
8097 elif $test "$d_dlopen" = "$define" ; then
8098 dflt="$dldir/dl_dlopen.xs"
8103 *) dflt="$dldir/$dlsrc"
8106 echo "The following dynamic loading files are available:"
8107 : Can not go over to $dldir because getfile has path hard-coded in.
8108 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
8109 rp="Source file to use for dynamic loading"
8115 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
8119 Some systems may require passing special flags to $cc -c to
8120 compile modules that will be used to create a shared library.
8121 To use no flags, say "none".
8124 case "$cccdlflags" in
8125 '') case "$gccversion" in
8126 '') case "$osname" in
8128 irix*) dflt='-KPIC' ;;
8129 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
8130 sunos) dflt='-pic' ;;
8134 *) case "$osname" in
8135 darwin) dflt='none' ;;
8136 *linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
8141 *) dflt="$cccdlflags" ;;
8148 # If -Dsysroot was specified, now's the time to add it
8150 if test "X$sysroot" != X; then
8151 case "$gccversion" in
8156 dflt="$dflt --sysroot=$sysroot" ;;
8166 rp="Any special flags to pass to $cc -c to compile shared library modules?"
8169 none) cccdlflags=' ' ;;
8170 *) cccdlflags="$ans" ;;
8175 Some systems use ld to create libraries that can be dynamically loaded,
8176 while other systems (such as those using ELF) use $cc.
8180 : Determine if this is ELF
8182 /* Test for whether ELF binaries are produced */
8194 int i = open("a.out",O_RDONLY);
8197 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
8198 exit(0); /* succeed (yes, it is ELF) */
8202 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
8208 '') if $test $bin_ELF = "$define"; then
8210 You appear to have ELF support. I'll use $cc to build dynamic libraries.
8214 echo "I'll use ld to build dynamic libraries."
8222 rp="What command should be used to create dynamic libraries?"
8228 Some systems may require passing special flags to $ld to create a
8229 library that can be dynamically loaded. If your ld flags include
8230 -L/other/path options to locate libraries outside your loader's normal
8231 search path, you may need to specify those -L options here as well. To
8232 use no flags, say "none".
8235 case "$lddlflags" in
8236 '') case "$osname" in
8237 haiku) dflt='-shared' ;;
8239 case "$gccversion" in
8240 '') dflt="$dflt +vnocompatwarnings" ;;
8243 *linux*|irix*|gnu*) dflt="-shared $optimize" ;;
8244 solaris) # See [perl #66604].
8245 # On Solaris 11, gcc -m64 on amd64
8246 # appears not to understand -G. gcc versions at
8247 # least as old as 3.4.3 support -shared, so just
8248 # use that with Solaris 11 and later, but keep
8249 # the old behavior for older Solaris versions.
8250 case "$gccversion" in
8252 *) case "$osvers" in
8253 2.?|2.10) dflt='-G' ;;
8254 *) dflt='-shared' ;;
8259 sunos) dflt='-assert nodefinitions' ;;
8260 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
8264 *) dflt="$lddlflags" ;;
8267 : Only do this for gcc, since, for example, qcc has no concept
8269 if $test "X$sysroot" != X; then
8270 case "$gccversion" in
8272 *) dflt="$dflt --sysroot $sysroot" ;;
8276 : Try to guess additional flags to pick up local libraries.
8277 : Be careful not to append to a plain 'none'
8281 for thisflag in $ldflags; do
8286 *) dflt="$dflt $thisflag" ;;
8293 ''|' ') dflt='none' ;;
8297 *-fstack-protector*)
8299 *-fstack-protector*) ;; # Don't add it again
8300 *) dflt="$dflt -fstack-protector" ;;
8305 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
8308 none) lddlflags=' ' ;;
8309 *) lddlflags="$ans" ;;
8314 Some systems may require passing special flags to $cc to indicate that
8315 the resulting executable will use dynamic linking. To use no flags,
8319 case "$ccdlflags" in
8320 '') case "$osname" in
8321 *linux*|hpux|gnu*) dflt='-Wl,-E' ;;
8322 sunos) dflt='none' ;;
8326 *) dflt="$ccdlflags" ;;
8328 rp="Any special flags to pass to $cc to use dynamic linking?"
8331 none) ccdlflags=' ' ;;
8332 *) ccdlflags="$ans" ;;
8344 ld_can_script="$undef"
8345 case "$bin_ELF$usedl" in
8347 # Abuse try.h and a.out names for neat cleanup
8359 if $cc $cccdlflags $ccdlflags $ccflags \
8360 $ldflags $lddlflags -o a.out try.c \
8361 -Wl,--version-script=try.h >/dev/null 2>&1 \
8362 && $test -s a.out ; then
8363 echo "ld supports scripting" >&4
8364 ld_can_script="$define"
8366 echo "ld does not support scripting" >&4
8372 : Do we want a shared libperl?
8376 # No dynamic loading being used, so don't bother even to prompt.
8379 *) case "$useshrplib" in
8380 '') case "$osname" in
8381 svr4*|nonstopux|dgux|dynixptx|esix|powerux|haiku|cygwin*)
8383 also='Building a shared libperl is required for dynamic loading to work on your system.'
8397 The perl executable is normally obtained by linking perlmain.c with
8398 libperl${_a}, any static extensions (usually just DynaLoader), and
8399 any other libraries needed on this system (such as -lm, etc.). Since
8400 your system supports dynamic loading, it is probably possible to build
8401 a shared libperl.$so. If you will have more than one executable linked
8402 to libperl.$so, this will significantly reduce the size of each
8403 executable, but it may have a noticeable effect on performance. The
8404 default is probably sensible for your system.
8408 rp="Build a shared libperl.$so (y/n)"
8412 useshrplib='true' ;;
8413 *) useshrplib='false' ;;
8418 case "$useshrplib" in
8420 case "$userelocatableinc" in
8422 echo "Cannot build with both -Duserelocatableinc and -Duseshrplib" >&4
8423 echo "See INSTALL for an explanation why that won't work." >&4
8429 # Figure out a good name for libperl.so. Since it gets stored in
8430 # a version-specific architecture-dependent library, the version
8431 # number isn't really that important, except for making cc/ld happy.
8433 # A name such as libperl.so.10.1
8434 majmin="libperl.$so.$patchlevel.$subversion"
8435 # A name such as libperl.so.100
8436 majonly=`echo $patchlevel $subversion |
8437 $awk '{printf "%d%02d", $1, $2}'`
8438 majonly=libperl.$so.$majonly
8439 # I'd prefer to keep the os-specific stuff here to a minimum, and
8440 # rely on figuring it out from the naming of libc.
8441 case "${osname}${osvers}" in
8442 *linux*|gnu*) # ld won't link with a bare -lperl otherwise.
8445 cygwin*) # ld links now against the dll directly
8446 majmin="cygperl5_${patchlevel}_${subversion}.${so}"
8447 majonly=`echo $patchlevel $subversion |
8448 $awk '{printf "%03d%03d", $1, $2}'`
8449 majonly=cygperl5.$majonly.$so
8452 *) # Try to guess based on whether libc has major.minor.
8454 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8455 *libc.$so.[0-9]*) dflt=$majonly ;;
8456 *) dflt=libperl.$so ;;
8466 I need to select a good name for the shared libperl. If your system uses
8467 library names with major and minor numbers, then you might want something
8468 like $majmin. Alternatively, if your system uses a single version
8469 number for shared libraries, then you might want to use $majonly.
8470 Or, your system might be quite happy with a simple libperl.$so.
8472 Since the shared libperl will get installed into a version-specific
8473 architecture-dependent directory, the version number of the shared perl
8474 library probably isn't important, so the default should be o.k.
8477 rp='What name do you want to give to the shared libperl?'
8480 echo "Ok, I'll use $libperl"
8483 libperl="libperl${_a}"
8487 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8491 WARNING: Use of the shrpdir variable for the installation location of
8492 the shared $libperl is not supported. It was never documented and
8493 will not work in this version. Let me (perlbug@perl.org)
8494 know of any problems this may cause.
8500 But your current setting of $shrpdir is
8501 the default anyway, so it's harmless.
8506 Further, your current attempted setting of $shrpdir
8507 conflicts with the value of $archlibexp/CORE
8508 that installperl will use.
8515 # How will the perl executable find the installed shared $libperl?
8516 # Add $xxx to ccdlflags.
8517 # If we can't figure out a command-line option, use $shrpenv to
8518 # set env LD_RUN_PATH. The main perl makefile uses this.
8519 shrpdir=$archlibexp/CORE
8522 if "$useshrplib"; then
8525 # We'll set it in Makefile.SH...
8530 freebsd|mirbsd|netbsd|openbsd|interix|dragonfly|bitrig)
8531 xxx="-Wl,-R$shrpdir"
8533 bsdos|linux|irix*|dec_osf|gnu*)
8534 xxx="-Wl,-rpath,$shrpdir"
8537 # Haiku doesn't like the default, either.
8540 # hpux doesn't like the default, either.
8541 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8544 # cygwin needs only ldlibpth
8547 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8553 # Only add $xxx if it isn't already in ccdlflags.
8554 case " $ccdlflags " in
8556 *) ccdlflags="$ccdlflags $xxx"
8559 Adding $xxx to the flags
8560 passed to $ld so that the perl executable will find the
8561 installed shared $libperl.
8569 # Fix ccdlflags in AIX for building external extensions.
8570 # (For building Perl itself bare -bE:perl.exp is needed,
8571 # Makefile.SH takes care of this.)
8573 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8575 # Respect a hint or command-line value.
8577 '') shrpenv="$tmp_shrpenv" ;;
8579 case "$ldlibpthname" in
8580 '') ldlibpthname=LD_LIBRARY_PATH ;;
8581 none) ldlibpthname='' ;;
8584 : determine where manual pages are on this system
8588 syspath='/usr/share/man/man1 /usr/man/man1'
8589 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8590 syspath="$syspath /usr/man/u_man/man1"
8591 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8592 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8593 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8594 sysman=`./loc . /usr/man/man1 $syspath`
8597 if $test -d "$sysman"; then
8598 echo "System manual is in $sysman." >&4
8600 echo "Could not find manual pages in source form." >&4
8603 : determine where manual pages go
8604 set man1dir man1dir none
8608 $spackage has manual pages available in source form.
8612 echo "However, you don't have nroff, so they're probably useless to you."
8614 '') man1dir="none";;
8617 echo "If you don't want the manual sources installed, answer 'none'."
8622 lookpath="$prefixexp/share/man/man1"
8623 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8624 lookpath="$lookpath $prefixexp/man/p_man/man1"
8625 lookpath="$lookpath $prefixexp/man/u_man/man1"
8626 lookpath="$lookpath $prefixexp/man/man.1"
8628 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8629 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8639 rp="Where do the main $spackage manual pages (source) go?"
8641 if $test "X$man1direxp" != "X$ansexp"; then
8652 : What suffix to use on installed man pages
8659 rp="What suffix should be used for the main $spackage man pages?"
8661 '') case "$man1dir" in
8675 *) dflt="$man1ext";;
8682 : see if we can have long filenames
8684 first=123456789abcdef
8686 if (echo hi >$first) 2>/dev/null; then
8687 if $test -f 123456789abcde; then
8688 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8691 echo 'You can have filenames longer than 14 characters.'>&4
8696 You can't have filenames longer than 14 chars.
8697 You can't even think about them!
8703 $rm -rf 123456789abcde*
8705 : determine where library module manual pages go
8706 set man3dir man3dir none
8710 $spackage has manual pages for many of the library modules.
8716 However, you don't have nroff, so they're probably useless to you.
8719 '') man3dir="none";;
8723 case "$d_flexfnam" in
8726 However, your system can't handle the long file names like File::Basename.3.
8729 '') man3dir="none";;
8733 echo "If you don't want the manual sources installed, answer 'none'."
8734 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8736 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8737 if $test -d "$privlib/man/man3"; then
8740 WARNING: Previous versions of perl installed man3 pages into
8741 $privlib/man/man3. This version will suggest a
8742 new default of $dflt.
8746 rp='Do you wish to preserve the old behavior?(y/n)'
8749 y*) dflt="$privlib/man/man3" ;;
8754 *) dflt="$man3dir" ;;
8761 rp="Where do the $package library man pages (source) go?"
8771 : What suffix to use on installed man pages
8777 rp="What suffix should be used for the $package library man pages?"
8779 '') case "$man3dir" in
8793 *) dflt="$man3ext";;
8800 : see if we have to deal with yellow pages, now NIS.
8801 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8807 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8815 rp='Are you getting the hosts file via yellow pages?'
8818 y*) hostcat='ypcat hosts';;
8819 *) hostcat='cat /etc/hosts';;
8825 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8828 '') test -f /etc/group && groupcat='cat /etc/group';;
8831 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8834 : now get the host name
8836 echo "Figuring out host name..." >&4
8837 case "$myhostname" in
8839 echo 'Maybe "hostname" will work...'
8840 if tans=`sh -c hostname 2>&1` ; then
8848 if $test "$cont"; then
8850 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8851 if tans=`cat /etc/systemid 2>&1` ; then
8853 phostname='cat /etc/systemid'
8854 echo "Whadyaknow. Xenix always was a bit strange..."
8857 elif $test -r /etc/systemid; then
8858 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8861 if $test "$cont"; then
8862 echo 'No, maybe "uuname -l" will work...'
8863 if tans=`sh -c 'uuname -l' 2>&1` ; then
8865 phostname='uuname -l'
8867 echo 'Strange. Maybe "uname -n" will work...'
8868 if tans=`sh -c 'uname -n' 2>&1` ; then
8870 phostname='uname -n'
8872 echo 'Oh well, maybe I can mine it out of whoami.h...'
8873 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8874 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8875 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8877 case "$myhostname" in
8878 '') echo "Does this machine have an identity crisis or something?"
8881 echo "Well, you said $myhostname before..."
8882 phostname='echo $myhostname';;
8888 case "$myhostname" in
8889 '') myhostname=noname ;;
8891 : you do not want to know about this
8896 if $test "$myhostname" ; then
8898 rp='Your host name appears to be "'$myhostname'".'" Right?"
8906 : bad guess or no guess
8907 while $test "X$myhostname" = X ; do
8909 rp="Please type the (one word) name of your host:"
8914 : translate upper to lower if necessary
8915 case "$myhostname" in
8917 echo "(Normalizing case in your host name)"
8918 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8922 case "$myhostname" in
8924 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8925 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8926 echo "(Trimming domain name from host name--host name is now $myhostname)"
8928 *) case "$mydomain" in
8931 test "X$hostcat" = "Xypcat hosts" &&
8932 ypmatch "$myhostname" hosts 2>/dev/null |\
8933 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8936 test "X$hostcat" != "X" &&
8937 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8938 /[ ]$myhostname[ . ]/p" > hosts
8941 if $test -f hosts; then
8942 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8943 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8944 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8945 hosts | $sort | $uniq | \
8946 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8947 case `$echo X$dflt` in
8948 X*\ *) echo "(Several hosts in the database matched hostname)"
8951 X.) echo "(You do not have fully-qualified names in the hosts database)"
8955 echo "(I cannot locate a hosts database anywhere)"
8960 tans=`./loc resolv.conf X /etc /usr/etc`
8961 if $test -f "$tans"; then
8962 echo "(Attempting domain name extraction from $tans)"
8963 dflt=.`$sed -n -e 's/ / /g' \
8964 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8967 .) dflt=.`$sed -n -e 's/ / /g' \
8968 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8976 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8977 dflt=.`sh -c domainname 2>/dev/null`
8980 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8984 case "$dflt$osname" in
8985 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
8986 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
8990 .) echo "(Lost all hope -- silly guess then)"
8996 *) dflt="$mydomain";;
9000 rp="What is your domain name?"
9010 : translate upper to lower if necessary
9013 echo "(Normalizing case in your domain name)"
9014 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
9018 : a little sanity check here
9019 case "$phostname" in
9022 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
9023 $myhostname$mydomain|$myhostname) ;;
9025 case "$phostname" in
9027 echo "(That doesn't agree with your whoami.h file, by the way.)"
9030 echo "(That doesn't agree with your $phostname command, by the way.)"
9038 : determine the e-mail address of the user who is running us
9041 I need to get your e-mail address in Internet format if possible, i.e.
9042 something like user@host.domain. Please answer accurately since I have
9043 no easy means to double check it. The default value provided below
9044 is most probably close to reality but may not be valid from outside
9045 your organization...
9049 while test "$cont"; do
9050 case "$MAILDOMAIN" in
9052 if $test -s /etc/mailname; then
9053 maildomain=`$cat /etc/mailname`
9055 maildomain="$myhostname$mydomain"
9058 *) maildomain="$MAILDOMAIN";;
9061 '') dflt="$cf_by@$maildomain";;
9062 *) dflt="$cf_email";;
9064 rp='What is your e-mail address?'
9070 rp='Address does not look like an Internet one. Use it anyway?'
9084 : Ask e-mail of administrator
9087 If you or somebody else will be maintaining perl at your site, please
9088 fill in the correct e-mail address here so that they may be contacted
9089 if necessary. Currently, the "perlbug" program included with perl
9090 will send mail to this address in addition to perlbug@perl.org. You may
9091 enter "none" for no administrator.
9094 case "$perladmin" in
9095 '') dflt="$cf_email";;
9096 *) dflt="$perladmin";;
9098 rp='Perl administrator e-mail address'
9102 : determine whether to only install version-specific parts.
9105 Do you want to install only the version-specific parts of the perl
9106 distribution? Usually you do *not* want to do this.
9108 case "$versiononly" in
9109 "$define"|[Yy]*|true) dflt='y' ;;
9112 rp="Do you want to install only the version-specific parts of perl?"
9115 [yY]*) val="$define";;
9121 case "$versiononly" in
9122 "$define") inc_version_list=''
9123 inc_version_list_init=0
9127 : figure out how to guarantee perl startup
9128 : XXX Note that this currently takes advantage of the bug that binexp ignores
9129 : the Configure -Dinstallprefix setting, which in turn means that under
9130 : relocatable @INC, initialinstalllocation is what binexp started as.
9131 case "$startperl" in
9133 case "$sharpbang" in
9137 I can use the #! construct to start perl on your system. This will
9138 make startup of perl scripts faster, but may cause problems if you
9139 want to share those scripts and perl is not in a standard place
9140 ($initialinstalllocation/perl) on all your platforms. The alternative
9141 is to force a shell by starting the script with a single ':' character.
9144 case "$versiononly" in
9145 "$define") dflt="$initialinstalllocation/perl$version";;
9146 *) dflt="$initialinstalllocation/perl";;
9148 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
9151 none) startperl=": # use perl";;
9152 *) startperl="#!$ans"
9153 if $test 30 -lt `echo "$ans" | wc -c`; then
9156 WARNING: Some systems limit the #! command to 32 characters.
9157 If you experience difficulty running Perl scripts with #!, try
9158 installing Perl in a directory with a shorter pathname.
9164 *) startperl=": # use perl"
9169 echo "I'll use $startperl to start perl scripts."
9171 : figure best path for perl in scripts
9174 case "$versiononly" in
9175 "$define") perlpath="$initialinstalllocation/perl$version";;
9176 *) perlpath="$initialinstalllocation/perl";;
9178 case "$startperl" in
9183 I will use the "eval 'exec'" idiom to start Perl on your system.
9184 I can use the full path of your Perl binary for this purpose, but
9185 doing so may cause problems if you want to share those scripts and
9186 Perl is not always in a standard place ($initialinstalllocation/perl).
9189 dflt="$initialinstalllocation/perl"
9190 rp="What path shall I use in \"eval 'exec'\"?"
9197 case "$startperl" in
9199 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
9202 : determine where public executable scripts go
9203 set scriptdir scriptdir
9205 case "$scriptdir" in
9208 : guess some guesses
9209 $test -d /usr/share/scripts && dflt=/usr/share/scripts
9210 $test -d /usr/share/bin && dflt=/usr/share/bin
9211 $test -d /usr/local/script && dflt=/usr/local/script
9212 $test -d /usr/local/scripts && dflt=/usr/local/scripts
9213 $test -d $prefixexp/script && dflt=$prefixexp/script
9217 *) dflt="$scriptdir"
9222 Some installations have a separate directory just for executable scripts so
9223 that they can mount it across multiple architectures but keep the scripts in
9224 one spot. You might, for example, have a subdirectory of /usr/share for this.
9225 Or you might just lump your scripts in with all your other executables.
9229 rp='Where do you keep publicly executable scripts?'
9231 if $test "X$ansexp" != "X$scriptdirexp"; then
9237 : A little fix up for an irregularly named variable.
9238 installscript="$installscriptdir"
9240 : determine where add-on public executables go
9242 '') dflt=$siteprefix/bin ;;
9246 rp='Pathname where the add-on public executables should be installed?'
9251 : determine where add-on html pages go
9252 : There is no standard location, so try to copy the previously-selected
9253 : directory structure for the core html pages.
9254 case "$sitehtml1dir" in
9255 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9256 *) dflt=$sitehtml1dir ;;
9259 ''|' ') dflt=none ;;
9262 rp='Pathname where the site-specific html pages should be installed?'
9264 prefixvar=sitehtml1dir
9267 : determine where add-on library html pages go
9268 : There is no standard location, so try to copy the previously-selected
9269 : directory structure for the core html pages.
9270 case "$sitehtml3dir" in
9271 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9272 *) dflt=$sitehtml3dir ;;
9275 ''|' ') dflt=none ;;
9278 rp='Pathname where the site-specific library html pages should be installed?'
9280 prefixvar=sitehtml3dir
9283 : determine where add-on manual pages go
9284 case "$siteman1dir" in
9285 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
9286 *) dflt=$siteman1dir ;;
9289 ''|' ') dflt=none ;;
9292 rp='Pathname where the site-specific manual pages should be installed?'
9294 prefixvar=siteman1dir
9297 : determine where add-on library man pages go
9298 case "$siteman3dir" in
9299 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
9300 *) dflt=$siteman3dir ;;
9303 ''|' ') dflt=none ;;
9306 rp='Pathname where the site-specific library manual pages should be installed?'
9308 prefixvar=siteman3dir
9311 : determine where add-on public executable scripts go
9312 case "$sitescript" in
9313 '') dflt=$siteprefix/script
9314 $test -d $dflt || dflt=$sitebin ;;
9315 *) dflt="$sitescript" ;;
9318 rp='Pathname where add-on public executable scripts should be installed?'
9320 prefixvar=sitescript
9323 : see if backtrace exists
9324 set backtrace d_backtrace
9327 : add flags if using c backtrace
9328 case "$usecbacktrace" in
9329 "") usecbacktrace=$undef ;;
9331 case "$d_backtrace" in
9333 case " $ccflags " in
9334 *" -DUSE_C_BACKTRACE "*) ;; # Already there.
9335 *) ccflags="$ccflags -DUSE_C_BACKTRACE -g" ;;
9339 echo "This system does not support backtrace" >&4
9340 usecbacktrace=$undef
9346 : Check if faststdio is requested and available
9347 case "$usefaststdio" in
9348 $define|true|[yY]*|'')
9349 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
9359 Perl can be built to use 'fast stdio', which means using the stdio
9360 library but also directly manipulating the stdio buffers to enable
9361 faster I/O. Using stdio is better for backward compatibility (especially
9362 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
9363 interface has been preferred instead of stdio.
9365 If this doesn't make any sense to you, just accept the default '$dflt'.
9367 rp='Use the "fast stdio" if available?'
9370 y|Y) val="$define" ;;
9377 : define an is-a-typedef? function
9378 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9380 "") inclist="sys/types.h";;
9382 eval "varval=\$$var";
9386 for inc in $inclist; do
9387 echo "#include <$inc>" >>temp.c;
9389 echo "#ifdef $type" >> temp.c;
9390 echo "printf(\"We have $type\");" >> temp.c;
9391 echo "#endif" >> temp.c;
9392 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9393 if $contains $type temp.E >/dev/null 2>&1; then
9399 *) eval "$var=\$varval";;
9402 : define an is-a-typedef? function that prompts if the type is not available.
9403 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9405 "") inclist="sys/types.h";;
9407 eval "varval=\$$var";
9411 for inc in $inclist; do
9412 echo "#include <$inc>" >>temp.c;
9414 echo "#ifdef $type" >> temp.c;
9415 echo "printf(\"We have $type\");" >> temp.c;
9416 echo "#endif" >> temp.c;
9417 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9419 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
9420 if $contains $type temp.E >/dev/null 2>&1; then
9421 echo "$type found." >&4;
9424 echo "$type NOT found." >&4;
9430 *) eval "$var=\$varval";;
9433 : see what type lseek is declared as in the kernel
9434 rp="What is the type used for lseek's offset on this system?"
9435 set off_t lseektype long stdio.h sys/types.h
9439 echo "Checking to see how big your file offsets are..." >&4
9441 #include <sys/types.h>
9445 printf("%d\n", (int)sizeof($lseektype));
9450 if eval $compile_ok; then
9451 lseeksize=`$run ./try`
9452 echo "Your file offsets are $lseeksize bytes long."
9456 echo "(I can't seem to compile the test program. Guessing...)"
9457 rp="What is the size of your file offsets (in bytes)?"
9463 : see what type file positions are declared as in the library
9464 rp="What is the type for file position used by fsetpos()?"
9465 set fpos_t fpostype long stdio.h sys/types.h
9468 : Check size for Fpos_t
9471 *_t) zzz="$fpostype" ;;
9474 echo "Checking the size of $zzz..." >&4
9476 #include <sys/types.h>
9483 printf("%d\n", (int)sizeof($fpostype));
9488 if eval $compile_ok; then
9492 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9495 echo "Your $zzz is $fpossize bytes long."
9501 echo "(I can't compile the test program. Guessing...)" >&4
9502 rp="What is the size of your file positions (in bytes)?"
9507 : Check for large file support
9508 # Backward compatibility (uselfs is deprecated).
9510 "$define"|true|[yY]*)
9513 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9515 uselargefiles="$define"
9519 case "$lseeksize:$fpossize" in
9522 You can have files larger than 2 gigabytes.
9525 *) case "$uselargefiles" in
9526 "$undef"|false|[nN]*) dflt='n' ;;
9531 Perl can be built to understand large files (files larger than 2 gigabytes)
9532 on some systems. To do so, Configure can be run with -Duselargefiles.
9534 If this doesn't make any sense to you, just accept the default '$dflt'.
9536 rp='Try to understand large files, if available?'
9539 y|Y) val="$define" ;;
9546 : Look for a hint-file generated 'call-back-unit'. If the
9547 : user has specified that a large files perl is to be built,
9548 : we may need to set or change some other defaults.
9549 if $test -f uselargefiles.cbu; then
9550 echo "Your platform has some specific hints regarding large file builds, using them..."
9551 . ./uselargefiles.cbu
9553 case "$uselargefiles" in
9555 if $test -f uselargefiles.cbu; then
9557 echo "Rechecking to see how big your file offsets are..." >&4
9559 #include <sys/types.h>
9563 printf("%d\n", (int)sizeof($lseektype));
9568 if eval $compile_ok; then
9569 lseeksize=`$run ./try`
9570 $echo "Your file offsets are now $lseeksize bytes long."
9574 echo "(I can't seem to compile the test program. Guessing...)"
9575 rp="What is the size of your file offsets (in bytes)?"
9580 *_t) zzz="$fpostype" ;;
9583 $echo $n "Rechecking the size of $zzz...$c" >&4
9585 #include <sys/types.h>
9592 printf("%d\n", (int)sizeof($fpostype));
9597 if eval $compile_ok; then
9602 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9605 echo " $fpossize bytes." >&4
9611 echo "(I can't compile the test program. Guessing...)" >&4
9612 rp="What is the size of your file positions (in bytes)?"
9621 : Check if we want perlio
9624 : Set the vendorbin variables
9625 case "$vendorprefix" in
9626 '') d_vendorbin="$undef"
9630 *) d_vendorbin="$define"
9631 : determine where vendor-supplied executables go.
9632 case "$vendorbin" in
9633 '') dflt=$vendorprefix/bin ;;
9634 *) dflt="$vendorbin" ;;
9637 rp='Pathname for the vendor-supplied executables directory?'
9640 vendorbinexp="$ansexp"
9646 : Set the vendorhtml1dir variables
9647 case "$vendorprefix" in
9648 '') vendorhtml1dir=''
9649 vendorhtml1direxp=''
9651 *) : determine where vendor-supplied html pages go.
9652 : There is no standard location, so try to copy the previously-selected
9653 : directory structure for the core html pages.
9654 : XXX Better default suggestions would be welcome.
9655 case "$vendorhtml1dir" in
9656 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9657 *) dflt=$vendorhtml1dir ;;
9660 ''|' ') dflt=none ;;
9663 rp='Pathname for the vendor-supplied html pages?'
9665 vendorhtml1dir="$ans"
9666 vendorhtml1direxp="$ansexp"
9669 : Use ' ' for none so value is preserved next time through Configure
9670 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9671 prefixvar=vendorhtml1dir
9674 : Set the vendorhtml3dir variables
9675 case "$vendorprefix" in
9676 '') vendorhtml3dir=''
9677 vendorhtml3direxp=''
9679 *) : determine where vendor-supplied module html pages go.
9680 : There is no standard location, so try to copy the previously-selected
9681 : directory structure for the core html pages.
9682 : XXX Better default suggestions would be welcome.
9683 case "$vendorhtml3dir" in
9684 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9685 *) dflt=$vendorhtml3dir ;;
9688 ''|' ') dflt=none ;;
9691 rp='Pathname for the vendor-supplied html pages?'
9693 vendorhtml3dir="$ans"
9694 vendorhtml3direxp="$ansexp"
9697 : Use ' ' for none so value is preserved next time through Configure
9698 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9699 prefixvar=vendorhtml3dir
9702 : Set the vendorman1dir variables
9703 case "$vendorprefix" in
9704 '') vendorman1dir=''
9707 *) : determine where vendor-supplied manual pages go.
9708 case "$vendorman1dir" in
9709 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9710 *) dflt=$vendorman1dir ;;
9713 ''|' ') dflt=none ;;
9716 rp='Pathname for the vendor-supplied manual section 1 pages?'
9718 vendorman1dir="$ans"
9719 vendorman1direxp="$ansexp"
9722 : Use ' ' for none so value is preserved next time through Configure
9723 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9724 prefixvar=vendorman1dir
9727 : Set the vendorman3dir variables
9728 case "$vendorprefix" in
9729 '') vendorman3dir=''
9732 *) : determine where vendor-supplied module manual pages go.
9733 case "$vendorman3dir" in
9734 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9735 *) dflt=$vendorman3dir ;;
9738 ''|' ') dflt=none ;;
9741 rp='Pathname for the vendor-supplied manual section 3 pages?'
9743 vendorman3dir="$ans"
9744 vendorman3direxp="$ansexp"
9747 : Use ' ' for none so value is preserved next time through Configure
9748 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9749 prefixvar=vendorman3dir
9752 : Set the vendorscript variables
9753 case "$vendorprefix" in
9754 '') d_vendorscript="$undef"
9758 *) d_vendorscript="$define"
9759 : determine where vendor-supplied scripts go.
9760 case "$vendorscript" in
9761 '') dflt=$vendorprefix/script
9762 $test -d $dflt || dflt=$vendorbin ;;
9763 *) dflt="$vendorscript" ;;
9767 The installation process will create a directory for
9768 vendor-supplied scripts.
9772 rp='Pathname for the vendor-supplied scripts directory?'
9775 vendorscriptexp="$ansexp"
9778 prefixvar=vendorscript
9781 : script used to emit important warnings
9784 if test \$# -gt 0; then
9789 echo "*** WARNING:" >&4
9790 sed -e 's/^/*** /' <msg >&4
9792 cat msg >>config.msg
9793 echo " " >>config.msg
9799 : see which of string.h or strings.h is needed
9801 strings=`./findhdr string.h`
9802 if $test "$strings" && $test -r "$strings"; then
9803 echo "Using <string.h> instead of <strings.h>." >&4
9807 strings=`./findhdr strings.h`
9808 if $test "$strings" && $test -r "$strings"; then
9809 echo "Using <strings.h> instead of <string.h>." >&4
9811 ./warn "No string header found -- You'll surely have problems."
9817 "$undef") strings=`./findhdr strings.h`;;
9818 *) strings=`./findhdr string.h`;;
9821 : see if qgcvt exists
9825 : Check print/scan long double stuff
9828 if $test X"$d_longdbl" = X"$define"; then
9830 echo "Checking how to print long doubles..." >&4
9832 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
9833 $cat >try.c <<'EOCP'
9834 #include <sys/types.h>
9838 printf("%.3f\n", d);
9842 if eval $compile; then
9846 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
9847 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
9848 echo "We will use %f."
9854 if $test X"$sPRIfldbl" = X; then
9855 $cat >try.c <<'EOCP'
9856 #include <sys/types.h>
9859 long double d = 123.456;
9860 printf("%.3Lf\n", d);
9864 if eval $compile; then
9868 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
9869 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
9870 echo "We will use %Lf."
9876 if $test X"$sPRIfldbl" = X; then
9877 $cat >try.c <<'EOCP'
9878 #include <sys/types.h>
9881 long double d = 123.456;
9882 printf("%.3llf\n", d);
9886 if eval $compile; then
9890 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
9891 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
9892 echo "We will use %llf."
9898 if $test X"$sPRIfldbl" = X; then
9899 $cat >try.c <<'EOCP'
9900 #include <sys/types.h>
9903 long double d = 123.456;
9904 printf("%.3lf\n", d);
9908 if eval $compile; then
9912 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
9913 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
9914 echo "We will use %lf."
9920 if $test X"$sPRIfldbl" = X; then
9921 echo "Cannot figure out how to print long doubles." >&4
9923 sSCNfldbl=$sPRIfldbl # expect consistency
9930 case "$sPRIfldbl" in
9931 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
9932 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
9933 d_SCNfldbl="$undef";
9935 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
9936 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
9937 d_SCNfldbl="$define";
9941 : Check how to convert floats to strings.
9943 if test "X$d_Gconvert" = X; then
9946 echo "Checking for an efficient way to convert floats to strings."
9948 case "$uselongdouble" in
9949 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
9951 case "$d_longdbl" in
9952 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
9954 case "$d_PRIgldbl" in
9955 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
9959 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
9960 char *myname = "gconvert";
9963 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
9964 char *myname = "gcvt";
9967 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
9968 char *myname = "qgcvt";
9969 #define DOUBLETYPE long double
9972 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9974 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
9976 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
9979 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
9981 char *myname = "sprintf";
9985 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9986 #define DOUBLETYPE long double
9988 #define DOUBLETYPE double
10000 # include <string.h>
10002 # include <strings.h>
10005 int checkit(char *expect, char *got)
10007 if (strcmp(expect, got)) {
10008 printf("%s oddity: Expected %s, got %s\n",
10009 myname, expect, got);
10019 /* This must be 1st test on (which?) platform */
10020 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
10021 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
10022 checkit("0.1", buf);
10024 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
10025 checkit("0.01", buf);
10027 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
10028 checkit("0.001", buf);
10030 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
10031 checkit("0.0001", buf);
10033 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
10034 if (strlen(buf) > 5)
10035 checkit("9e-005", buf); /* for Microsoft ?? */
10037 checkit("9e-05", buf);
10039 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
10042 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
10043 checkit("1.1", buf);
10045 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
10046 checkit("1.01", buf);
10048 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
10049 checkit("1.001", buf);
10051 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
10052 checkit("1.0001", buf);
10054 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
10055 checkit("1.00001", buf);
10057 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
10058 checkit("1.000001", buf);
10060 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
10063 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
10064 checkit("-1", buf);
10066 /* Some Linux gcvt's give 1.e+5 here. */
10067 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
10068 checkit("100000", buf);
10070 /* Some Linux gcvt's give -1.e+5 here. */
10071 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
10072 checkit("-100000", buf);
10074 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
10075 checkit("123.456", buf);
10077 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
10078 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
10079 /* 34 should be enough to scare even long double
10080 * places into using the e notation. */
10081 if (strlen(buf) > 5)
10082 checkit("1e+034", buf); /* for Microsoft */
10084 checkit("1e+34", buf);
10086 /* For Perl, if you add additional tests here, also add them to
10087 * t/base/num.t for benefit of platforms not using Configure or
10088 * overriding d_Gconvert */
10093 : first add preferred functions to our list
10095 for xxx_convert in $gconvert_preference; do
10096 case $xxx_convert in
10097 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
10098 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
10101 : then add any others
10102 for xxx_convert in gconvert gcvt sprintf; do
10103 case "$xxx_list" in
10105 *) xxx_list="$xxx_list $xxx_convert" ;;
10109 case "$d_longdbl$uselongdouble" in
10111 : again, add preferred functions to our list first
10113 for xxx_convert in $gconvert_ld_preference; do
10114 case $xxx_convert in
10115 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
10116 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
10119 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
10120 for xxx_convert in qgcvt sprintf $xxx_list; do
10121 case "$xxx_ld_list" in
10122 $xxx_convert*|*" $xxx_convert"*) ;;
10123 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
10126 : if sprintf cannot do long doubles, move it to the end
10127 if test "$d_PRIgldbl" != "$define"; then
10128 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
10130 : if no qgcvt, remove it
10131 if test "$d_qgcvt" != "$define"; then
10132 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
10135 xxx_list="$xxx_ld_list"
10139 for xxx_convert in $xxx_list; do
10140 echo "Trying $xxx_convert..."
10141 $rm -f try try$_o core
10142 set try -DTRY_$xxx_convert
10143 if eval $compile; then
10144 echo "$xxx_convert() found." >&4
10145 if $run ./try; then
10146 echo "I'll use $xxx_convert to convert floats into a string." >&4
10149 echo "...But $xxx_convert didn't work as I expected."
10153 echo "$xxx_convert NOT found." >&4
10157 if test X$xxx_convert = X; then
10158 echo "*** WHOA THERE!!! ***" >&4
10159 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
10160 xxx_convert=sprintf
10163 case "$xxx_convert" in
10164 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
10165 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
10166 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
10167 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
10168 "$define$define$define")
10169 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
10170 "$define$define$undef")
10171 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
10172 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
10180 : see if _fwalk exists
10184 : Initialize h_fcntl
10187 : Initialize h_sysfile
10190 : access call always available on UNIX
10191 set access d_access
10194 : locate the flags for 'access()'
10195 case "$d_access" in
10198 $cat >access.c <<EOCP
10199 #include <sys/types.h>
10204 #include <sys/file.h>
10207 #include <unistd.h>
10209 #$i_stdlib I_STDLIB
10211 #include <stdlib.h>
10217 : check sys/file.h first, no particular reason here
10218 if $test `./findhdr sys/file.h` && \
10219 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
10221 echo "<sys/file.h> defines the *_OK access constants." >&4
10222 elif $test `./findhdr fcntl.h` && \
10223 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
10225 echo "<fcntl.h> defines the *_OK access constants." >&4
10226 elif $test `./findhdr unistd.h` && \
10227 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
10228 echo "<unistd.h> defines the *_OK access constants." >&4
10230 echo "I can't find the four *_OK access constants--I'll use mine." >&4
10236 : see if accessx exists
10237 set accessx d_accessx
10240 : see if aintl exists
10244 : see if alarm exists
10248 : see if 64bit time functions exists
10250 set ctime64 d_ctime64
10253 set localtime64 d_localtime64
10256 set gmtime64 d_gmtime64
10259 set mktime64 d_mktime64
10262 set difftime64 d_difftime64
10265 set asctime64 d_asctime64
10268 : see if POSIX threads are available
10269 set pthread.h i_pthread
10272 : define a function to check prototypes
10273 $cat > protochk <<EOSH
10276 optimize="$optimize"
10278 prototype="$prototype"
10281 usethreads=$usethreads
10282 i_pthread=$i_pthread
10283 pthread_h_first=$pthread_h_first
10286 $cat >> protochk <<'EOSH'
10291 while test $# -ge 2; do
10293 $define) echo "#include <$2>" >> try.c ;;
10294 literal) echo "$2" >> try.c ;;
10296 # Extra magic for the benefit of systems that need pthread.h
10297 # to be included early to correctly detect threadsafe functions.
10298 # Such functions must guarantee themselves, though, that the usethreads
10299 # and i_pthread have been defined, before calling protochk.
10300 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
10301 echo "#include <pthread.h>" >> try.c
10306 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
10307 cat >> try.c <<'EOCP'
10308 #ifdef CAN_PROTOTYPE
10309 #define _(args) args
10314 echo "$foo" >> try.c
10315 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
10316 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
10322 $eunicefix protochk
10324 : Define hasproto macro for Configure internal use
10325 hasproto='varname=$1; func=$2; shift; shift;
10326 while $test $# -ge 2; do
10328 $define) echo "#include <$2>";;
10332 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
10333 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
10334 echo "$func() prototype found.";
10337 echo "$func() prototype NOT found.";
10344 : see if sys/types.h has to be included
10345 set sys/types.h i_systypes
10348 : see if sys/select.h has to be included
10349 set sys/select.h i_sysselct
10352 : Define hasfield macro for Configure internal use
10353 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
10354 while $test $# -ge 2; do
10356 $define) echo "#include <$2>";;
10360 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
10362 if eval $compile; then
10371 : see if we should include time.h, sys/time.h, or both
10373 if test "X$timeincl" = X; then
10374 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
10375 $echo $n "I'm now running the test program...$c"
10377 #include <sys/types.h>
10382 #ifdef SYSTIMEKERNEL
10385 #include <sys/time.h>
10388 #include <sys/select.h>
10390 #$i_stdlib I_STDLIB
10392 #include <stdlib.h>
10398 struct timeval bar;
10401 struct timezone tzp;
10403 if (foo.tm_sec == foo.tm_sec)
10406 if (bar.tv_sec == bar.tv_sec)
10413 for s_timezone in '-DS_TIMEZONE' ''; do
10415 for s_timeval in '-DS_TIMEVAL' ''; do
10416 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10417 for i_time in '' '-DI_TIME'; do
10418 for i_systime in '-DI_SYSTIME' ''; do
10421 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10422 if eval $compile; then
10423 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
10427 $echo $n "Succeeded with $flags$c"
10439 *SYSTIMEKERNEL*) i_systimek="$define"
10440 timeincl=`./findhdr sys/time.h`
10441 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10442 *) i_systimek="$undef";;
10445 *I_TIME*) i_time="$define"
10446 timeincl=`./findhdr time.h`" $timeincl"
10447 echo "We'll include <time.h>." >&4;;
10448 *) i_time="$undef";;
10451 *I_SYSTIME*) i_systime="$define"
10452 timeincl=`./findhdr sys/time.h`" $timeincl"
10453 echo "We'll include <sys/time.h>." >&4;;
10454 *) i_systime="$undef";;
10458 : see if struct tm knows about tm_zone
10459 case "$i_systime$i_time" in
10462 echo "Checking to see if your struct tm has tm_zone field..." >&4
10463 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
10471 case "$d_tm_tm_zone" in
10472 "$define") echo "Yes, it does." ;;
10473 *) echo "No, it doesn't." ;;
10475 : see if struct tm knows about tm_gmtoff
10476 case "$i_systime$i_time" in
10479 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
10480 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
10488 case "$d_tm_tm_gmtoff" in
10489 "$define") echo "Yes, it does." ;;
10490 *) echo "No, it doesn't." ;;
10493 : see if asctime_r exists
10494 set asctime_r d_asctime_r
10496 case "$d_asctime_r" in
10498 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10499 case "$d_asctime_r_proto:$usethreads" in
10500 ":define") d_asctime_r_proto=define
10501 set d_asctime_r_proto asctime_r $hdrs
10505 case "$d_asctime_r_proto" in
10507 case "$asctime_r_proto" in
10508 ''|0) try='char* asctime_r(const struct tm*, char*);'
10509 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SB ;;
10511 case "$asctime_r_proto" in
10512 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
10513 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SBI ;;
10515 case "$asctime_r_proto" in
10516 ''|0) try='int asctime_r(const struct tm*, char*);'
10517 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SB ;;
10519 case "$asctime_r_proto" in
10520 ''|0) try='int asctime_r(const struct tm*, char*, int);'
10521 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SBI ;;
10523 case "$asctime_r_proto" in
10524 ''|0) d_asctime_r=undef
10526 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
10527 * ) case "$asctime_r_proto" in
10528 REENTRANT_PROTO*) ;;
10529 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
10531 echo "Prototype: $try" ;;
10534 *) case "$usethreads" in
10535 define) echo "asctime_r has no prototype, not using it." >&4 ;;
10542 *) asctime_r_proto=0
10546 : see if atolf exists
10550 : see if atoll exists
10554 : Look for GCC-style attribute format
10555 case "$d_attribute_format" in
10558 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
10559 $cat >attrib.c <<'EOCP'
10561 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
10563 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10564 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10565 echo "Your C compiler doesn't support __attribute__((format))."
10568 echo "Your C compiler supports __attribute__((format))."
10572 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10576 *) val="$d_attribute_format" ;;
10578 set d_attribute_format
10582 : Look for GCC-style attribute format with null format allowed
10583 case "$d_printf_format_null" in
10584 '') case "$d_attribute_format" in
10587 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
10588 $cat >attrib.c <<EOCP
10590 #$i_stdlib I_STDLIB
10592 #include <stdlib.h>
10594 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
10595 int null_printf (char* pat,...) { return (int)pat; }
10596 int main () { exit(null_printf(NULL)); }
10598 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
10599 : run the executable in case it produces a run-time warning
10600 if $run ./attrib >>attrib.out 2>&1; then
10601 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10602 echo "Your C compiler doesn't allow __printf__ format to be null."
10605 echo "Your C compiler allows __printf__ format to be null."
10609 echo "Your C compiler executable failed with __printf__ format null."
10613 echo "Your C compiler fails with __printf__ format null."
10620 *) val="$d_printf_format_null" ;;
10622 set d_printf_format_null
10626 : Look for GCC-style attribute malloc
10627 case "$d_attribute_malloc" in
10630 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
10631 $cat >attrib.c <<'EOCP'
10633 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
10635 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10636 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10637 echo "Your C compiler doesn't support __attribute__((malloc))."
10640 echo "Your C compiler supports __attribute__((malloc))."
10644 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10648 *) val="$d_attribute_malloc" ;;
10650 set d_attribute_malloc
10654 : Look for GCC-style attribute nonnull
10655 case "$d_attribute_nonnull" in
10658 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
10659 $cat >attrib.c <<'EOCP'
10661 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
10663 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10664 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10665 echo "Your C compiler doesn't support __attribute__((nonnull))."
10668 echo "Your C compiler supports __attribute__((nonnull))."
10672 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10676 *) val="$d_attribute_nonnull" ;;
10678 set d_attribute_nonnull
10682 : Look for GCC-style attribute noreturn
10683 case "$d_attribute_noreturn" in
10686 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
10687 $cat >attrib.c <<'EOCP'
10689 void fall_over_dead( void ) __attribute__((noreturn));
10691 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10692 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10693 echo "Your C compiler doesn't support __attribute__((noreturn))."
10696 echo "Your C compiler supports __attribute__((noreturn))."
10700 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10704 *) val="$d_attribute_noreturn" ;;
10706 set d_attribute_noreturn
10710 : Look for GCC-style attribute pure
10711 case "$d_attribute_pure" in
10714 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
10715 $cat >attrib.c <<'EOCP'
10717 int square( int n ) __attribute__((pure));
10719 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10720 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10721 echo "Your C compiler doesn't support __attribute__((pure))."
10724 echo "Your C compiler supports __attribute__((pure))."
10728 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10732 *) val="$d_attribute_pure" ;;
10734 set d_attribute_pure
10738 : Look for GCC-style attribute unused
10739 case "$d_attribute_unused" in
10742 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
10743 $cat >attrib.c <<'EOCP'
10745 int do_something( int dummy __attribute__((unused)), int n );
10747 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10748 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10749 echo "Your C compiler doesn't support __attribute__((unused))."
10752 echo "Your C compiler supports __attribute__((unused))."
10756 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10760 *) val="$d_attribute_unused" ;;
10762 set d_attribute_unused
10766 : Look for GCC-style attribute deprecated
10767 case "$d_attribute_deprecated" in
10770 echo "Checking whether your compiler can handle __attribute__((deprecated)) ..." >&4
10771 $cat >attrib.c <<'EOCP'
10773 int I_am_deprecated(void) __attribute__((deprecated));
10775 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10776 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10777 echo "Your C compiler doesn't support __attribute__((deprecated))."
10780 echo "Your C compiler supports __attribute__((deprecated))."
10784 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10788 *) val="$d_attribute_deprecated" ;;
10790 set d_attribute_deprecated
10794 : Look for GCC-style attribute warn_unused_result
10795 case "$d_attribute_warn_unused_result" in
10798 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
10799 $cat >attrib.c <<'EOCP'
10801 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
10803 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10804 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10805 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
10808 echo "Your C compiler supports __attribute__((warn_unused_result))."
10812 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10816 *) val="$d_attribute_warn_unused_result" ;;
10818 set d_attribute_warn_unused_result
10822 : see if bcmp exists
10826 : see if bcopy exists
10830 : see if getpgrp exists
10831 set getpgrp d_getpgrp
10834 case "$d_getpgrp" in
10837 echo "Checking to see which flavor of getpgrp is in use..."
10839 #$i_unistd I_UNISTD
10840 #include <sys/types.h>
10842 # include <unistd.h>
10844 #$i_stdlib I_STDLIB
10846 #include <stdlib.h>
10850 if (getuid() == 0) {
10851 printf("(I see you are running Configure as super-user...)\n");
10854 #ifdef TRY_BSD_PGRP
10855 if (getpgrp(1) == 0)
10864 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10865 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
10867 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10868 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
10871 echo "I can't seem to compile and run the test program."
10873 xxx="a USG one, i.e. you use getpgrp()."
10875 # SVR4 systems can appear rather BSD-ish.
10876 case "$i_unistd" in
10878 xxx="a BSD one, i.e. you use getpgrp(pid)."
10882 xxx="probably a USG one, i.e. you use getpgrp()."
10887 echo "Assuming your getpgrp is $xxx" >&4
10896 : see if setpgrp exists
10897 set setpgrp d_setpgrp
10900 case "$d_setpgrp" in
10903 echo "Checking to see which flavor of setpgrp is in use..."
10905 #$i_unistd I_UNISTD
10906 #include <sys/types.h>
10908 # include <unistd.h>
10910 #$i_stdlib I_STDLIB
10912 #include <stdlib.h>
10916 if (getuid() == 0) {
10917 printf("(I see you are running Configure as super-user...)\n");
10920 #ifdef TRY_BSD_PGRP
10921 if (-1 == setpgrp(1, 1))
10924 if (setpgrp() != -1)
10930 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10931 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
10933 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10934 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
10937 echo "(I can't seem to compile and run the test program.)"
10939 xxx="a USG one, i.e. you use setpgrp()."
10941 # SVR4 systems can appear rather BSD-ish.
10942 case "$i_unistd" in
10944 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
10948 xxx="probably a USG one, i.e. you use setpgrp()."
10953 echo "Assuming your setpgrp is $xxx" >&4
10962 : Look for GCC-style __builtin_choose_expr
10963 case "$d_builtin_choose_expr" in
10966 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
10967 $cat >try.c <<'EOCP'
10968 #include <assert.h>
10969 #include <stdlib.h>
10972 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
10975 assert( SYRINX(1) == 2112 );
10976 assert( SYRINX(1) != 5150 );
10977 assert( SYRINX(0) == 5150 );
10978 assert( SYRINX(0) != 2112 );
10979 puts( "All good!" );
10985 if eval $compile && $run ./try; then
10986 echo "Your C compiler supports __builtin_choose_expr."
10989 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10993 *) val="$d_builtin_choose_expr" ;;
10996 set d_builtin_choose_expr
11000 : Look for GCC-style __builtin_expect
11001 case "$d_builtin_expect" in
11004 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
11005 $cat >try.c <<'EOCP'
11008 if ( __builtin_expect(n, 0) ) n = 1;
11009 /* Remember shell exit code truth is 0, C truth is non-zero */
11014 if eval $compile && $run ./try; then
11015 echo "Your C compiler supports __builtin_expect."
11018 echo "Your C compiler doesn't seem to understand __builtin_expect."
11022 *) val="$d_builtin_expect" ;;
11025 set d_builtin_expect
11029 : see if bzero exists
11033 : see if stdarg is available
11035 if $test `./findhdr stdarg.h`; then
11036 echo "<stdarg.h> found." >&4
11039 echo "<stdarg.h> NOT found." >&4
11043 : see if varargs is available
11045 if $test `./findhdr varargs.h`; then
11046 echo "<varargs.h> found." >&4
11048 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
11051 : set up the varargs testing programs
11052 $cat > varargs.c <<EOP
11054 #include <stdarg.h>
11057 #include <varargs.h>
11061 int f(char *p, ...)
11075 p = va_arg(ap, char *);
11081 $cat > varargs <<EOP
11083 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
11092 : now check which varargs header should be included
11098 if `./varargs I_STDARG`; then
11100 elif `./varargs I_VARARGS`; then
11105 if `./varargs I_VARARGS`; then
11113 echo "*** WHOA THERE!!! ***" >&4
11114 echo " Your C compiler \"$cc\" doesn't seem to support stdarg or varargs!" >&4
11115 case "$knowitall" in
11117 echo " I'm giving up; maybe you can try again with a different compiler?" >&4
11121 echo "I could not find the definition for va_dcl... You have problems..." >&4
11122 val="$undef"; set i_stdarg; eval $setvar
11123 val="$undef"; set i_varargs; eval $setvar
11128 case "$i_varhdr" in
11130 val="$define"; set i_stdarg; eval $setvar
11131 val="$undef"; set i_varargs; eval $setvar
11134 val="$undef"; set i_stdarg; eval $setvar
11135 val="$define"; set i_varargs; eval $setvar
11138 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
11142 : see if the Compiler supports C99 variadic macros
11143 case "$i_stdarg$i_stdlib" in
11145 echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
11148 #include <stdarg.h>
11150 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
11154 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
11160 if eval $compile && $run ./try 2>&1 >/dev/null; then
11161 case "`$run ./try`" in
11163 echo "You have C99 variadic macros." >&4
11164 d_c99_variadic_macros="$define"
11167 echo "You don't have functional C99 variadic macros." >&4
11168 d_c99_variadic_macros="$undef"
11172 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
11173 d_c99_variadic_macros="$undef"
11178 echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
11179 d_c99_variadic_macros="$undef"
11183 : see if signal is declared as pointer to function returning int or void
11185 xxx=`./findhdr signal.h`
11186 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
11187 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
11188 echo "You have int (*signal())() instead of void." >&4
11190 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
11191 echo "You have void (*signal())()." >&4
11193 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
11194 echo "You have int (*signal())() instead of void." >&4
11196 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
11197 echo "You have void (*signal())()." >&4
11200 case "$d_voidsig" in
11202 echo "I can't determine whether signal handler returns void or int..." >&4
11204 rp="What type does your signal handler return?"
11207 v*) val="$define";;
11211 echo "As you already told me, signal handler returns void." >&4
11214 *) echo "As you already told me, signal handler returns int." >&4
11221 case "$d_voidsig" in
11222 "$define") signal_t="void";;
11223 *) signal_t="int";;
11227 : check for ability to cast large floats to 32-bit ints.
11229 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
11230 if $test "$intsize" -ge 4; then
11237 #$i_stdlib I_STDLIB
11239 #include <stdlib.h>
11241 #include <sys/types.h>
11242 #include <signal.h>
11243 $signal_t blech(int s) { exit(3); }
11250 signal(SIGFPE, blech);
11252 /* Don't let compiler optimize the test away. Store the number
11253 in a writable string for gcc to pass to sscanf under HP-UX.
11255 sprintf(str, "2147483647");
11256 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
11260 /* x86 processors will probably give 0x8000 0000, which is a
11261 sign change. We don't want that. We want to mimic SPARC
11262 behavior here, which is to preserve the sign and give
11265 if (i32 != ($xxx) f)
11271 if eval $compile_ok; then
11275 echo "(I can't seem to compile the test program--assuming it can't)"
11280 echo "Yup, it can."
11283 echo "Nope, it can't."
11290 : check for ability to cast negative floats to unsigned
11292 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
11295 #$i_stdlib I_STDLIB
11297 #include <stdlib.h>
11299 #include <sys/types.h>
11300 #include <signal.h>
11301 $signal_t blech(int s) { exit(7); }
11302 $signal_t blech_in_list(int s) { exit(4); }
11303 unsigned long dummy_long(unsigned long p) { return p; }
11304 unsigned int dummy_int(unsigned int p) { return p; }
11305 unsigned short dummy_short(unsigned short p) { return p; }
11309 unsigned long along;
11311 unsigned short ashort;
11315 /* Frustrate gcc-2.7.2's optimizer which failed this test with
11316 a direct f = -123. assignment. gcc-2.8.0 reportedly
11317 optimized the whole file away
11319 /* Store the number in a writable string for gcc to pass to
11320 sscanf under HP-UX.
11322 sprintf(str, "-123");
11323 sscanf(str, "%lf", &f); /* f = -123.; */
11325 signal(SIGFPE, blech);
11326 along = (unsigned long)f;
11327 aint = (unsigned int)f;
11328 ashort = (unsigned short)f;
11329 if (along != (unsigned long)-123)
11331 if (aint != (unsigned int)-123)
11333 if (ashort != (unsigned short)-123)
11335 sprintf(str, "1073741824.");
11336 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
11339 along = (unsigned long)f;
11340 if (along != 0x80000000)
11344 along = (unsigned long)f;
11345 if (along != 0x7fffffff)
11349 along = (unsigned long)f;
11350 if (along != 0x80000001)
11354 signal(SIGFPE, blech_in_list);
11355 sprintf(str, "123.");
11356 sscanf(str, "%lf", &f); /* f = 123.; */
11357 along = dummy_long((unsigned long)f);
11358 aint = dummy_int((unsigned int)f);
11359 ashort = dummy_short((unsigned short)f);
11360 if (along != (unsigned long)123)
11362 if (aint != (unsigned int)123)
11364 if (ashort != (unsigned short)123)
11371 if eval $compile_ok; then
11375 echo "(I can't seem to compile the test program--assuming it can't)"
11378 case "$castflags" in
11380 echo "Yup, it can."
11383 echo "Nope, it can't."
11390 : see if vprintf exists
11392 if set vprintf val -f d_vprintf; eval $csym; $val; then
11393 echo 'vprintf() found.' >&4
11396 #$i_stdarg I_STDARG /* Only one of these can be defined by i_varhrd */
11397 #$i_varargs I_VARARGS
11399 #$i_stdlib I_STDLIB
11400 #$i_unistd I_UNISTD
11403 # include <stdarg.h>
11404 #else /* I_VARARGS */
11405 # include <varargs.h>
11409 # include <unistd.h>
11413 # include <stdlib.h>
11416 #include <stdio.h> /* vsprintf prototype */
11419 void xxx(int n, ...)
11424 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11426 int main() { xxx(1, "foo"); }
11428 #else /* I_VARARGS */
11436 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11438 int main() { xxx("foo"); }
11444 if eval $compile_ok; then
11445 if $run ./try; then
11446 echo "Your vsprintf() returns (int)." >&4
11449 echo "Your vsprintf() returns (char*)." >&4
11453 echo 'I am unable to compile the vsprintf() test program.' >&4
11454 # We shouldn't get here. If we do, assume the standard signature,
11455 # not the old BSD one.
11456 echo 'Guessing that vsprintf() returns (int).' >&4
11460 echo 'vprintf() NOT found.' >&4
11471 : see if chown exists
11475 : see if chroot exists
11476 set chroot d_chroot
11479 : see if chsize exists
11480 set chsize d_chsize
11483 : see if class exists
11487 : see if clearenv exists
11488 set clearenv d_clearenv
11491 : Define hasstruct macro for Configure internal use
11492 hasstruct='varname=$1; struct=$2; shift; shift;
11493 while $test $# -ge 2; do
11495 $define) echo "#include <$2>";;
11499 echo "int main () { struct $struct foo; }" >> try.c;
11501 if eval $compile; then
11510 : see whether socket exists
11514 $echo $n "Hmm... $c" >&4
11515 if set socket val -f d_socket; eval $csym; $val; then
11516 echo "Looks like you have Berkeley networking support." >&4
11518 if set setsockopt val -f; eval $csym; $val; then
11521 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
11522 d_oldsock="$define"
11525 if $contains socklib libc.list >/dev/null 2>&1; then
11526 echo "Looks like you have Berkeley networking support." >&4
11528 : we will have to assume that it supports the 4.2 BSD interface
11531 echo "You don't have Berkeley networking in libc$_a..." >&4
11532 if test "X$d_socket" = "X$define"; then
11533 echo "...but you seem to believe that you have sockets." >&4
11535 for net in net socket
11537 if test -f $sysroot/usr/lib/lib$net$_a; then
11538 ( ($nm $nm_opt $sysroot/usr/lib/lib$net$_a | eval $nm_extract) || \
11539 $ar t $sysroot/usr/lib/lib$net$_a) 2>/dev/null >> libc.list
11540 if $contains socket libc.list >/dev/null 2>&1; then
11545 echo "...but the Wollongong group seems to have hacked it in." >&4
11546 sockethdr="-I$sysroot/usr/netinclude"
11549 echo "Found Berkeley sockets interface in lib$net." >&4
11550 if $contains setsockopt libc.list >/dev/null 2>&1; then
11553 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
11554 d_oldsock="$define"
11560 if test "X$d_socket" != "X$define"; then
11561 echo "or anywhere else I see." >&4
11569 : see if socketpair exists
11570 set socketpair d_sockpair
11575 echo "Checking the availability sa_len in the sock struct ..." >&4
11577 #include <sys/types.h>
11578 #include <sys/socket.h>
11580 struct sockaddr sa;
11581 return (sa.sa_len);
11585 set try; if eval $compile; then
11588 set d_sockaddr_sa_len; eval $setvar
11592 echo "Checking the availability struct sockaddr_in6 ..." >&4
11594 #include <sys/types.h>
11595 #include <sys/socket.h>
11596 #include <netinet/in.h>
11598 struct sockaddr_in6 sin6;
11599 return (sin6.sin6_family);
11603 set try; if eval $compile; then
11606 set d_sockaddr_in6; eval $setvar
11610 echo "Checking the availability sin6_scope_id in struct sockaddr_in6 ..." >&4
11612 #include <sys/types.h>
11613 #include <sys/socket.h>
11614 #include <netinet/in.h>
11616 struct sockaddr_in6 sin6;
11617 return (sin6.sin6_scope_id);
11621 set try; if eval $compile; then
11624 set d_sin6_scope_id; eval $setvar
11628 echo "Checking the availability struct ip_mreq ..." >&4
11630 #include <sys/types.h>
11631 #include <sys/socket.h>
11632 #include <netinet/in.h>
11634 struct ip_mreq mreq;
11635 return (mreq.imr_multiaddr.s_addr);
11639 set try; if eval $compile; then
11642 set d_ip_mreq; eval $setvar
11646 echo "Checking the availability struct ip_mreq_source ..." >&4
11648 #include <sys/types.h>
11649 #include <sys/socket.h>
11650 #include <netinet/in.h>
11652 struct ip_mreq_source mreq;
11653 return (mreq.imr_multiaddr.s_addr);
11657 set try; if eval $compile; then
11660 set d_ip_mreq_source; eval $setvar
11664 echo "Checking the availability struct ipv6_mreq ..." >&4
11666 #include <sys/types.h>
11667 #include <sys/socket.h>
11668 #include <netinet/in.h>
11670 struct ipv6_mreq mreq;
11671 return (mreq.ipv6mr_interface);
11675 set try; if eval $compile; then
11678 set d_ipv6_mreq; eval $setvar
11682 echo "Checking the availability struct ipv6_mreq_source ..." >&4
11684 #include <sys/types.h>
11685 #include <sys/socket.h>
11686 #include <netinet/in.h>
11688 struct ipv6_mreq_source mreq;
11689 return (mreq.imr_multiaddr.s_addr);
11693 set try; if eval $compile; then
11696 set d_ipv6_mreq_source; eval $setvar
11700 echo "Checking the availability of certain socket constants..." >&4
11701 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
11702 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
11704 #include <sys/types.h>
11705 #include <sys/socket.h>
11711 set try; if eval $compile; then
11714 set d_${enum}; eval $setvar
11718 : see if this is a sys/uio.h system
11719 set sys/uio.h i_sysuio
11722 : Check for cmsghdr support
11724 echo "Checking to see if your system supports struct cmsghdr..." >&4
11725 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
11727 case "$d_cmsghdr_s" in
11728 "$define") echo "Yes, it does." ;;
11729 *) echo "No, it doesn't." ;;
11733 : check for const keyword
11735 echo 'Checking to see if your C compiler knows about "const"...' >&4
11736 $cat >const.c <<'EOCP'
11737 typedef struct spug { int drokk; } spug;
11741 const spug y = { 0 };
11744 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
11746 echo "Yup, it does."
11749 echo "Nope, it doesn't."
11754 : see if copysignl exists
11755 set copysignl d_copysignl
11758 : see if crypt exists
11763 $define) cryptlib='' ;;
11764 *) if set crypt val -f d_crypt; eval $csym; $val; then
11765 echo 'crypt() found.' >&4
11769 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
11770 if $test -z "$cryptlib"; then
11771 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
11775 if $test -z "$cryptlib"; then
11776 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
11780 if $test -z "$cryptlib"; then
11781 cryptlib=`./loc libcrypt$_a "" $libpth`
11785 if $test -z "$cryptlib"; then
11786 echo 'crypt() NOT found.' >&4
11797 : see if this is a crypt.h system
11798 set crypt.h i_crypt
11801 : see if crypt_r exists
11802 set crypt_r d_crypt_r
11804 case "$d_crypt_r" in
11806 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
11807 case "$d_crypt_r_proto:$usethreads" in
11808 ":define") d_crypt_r_proto=define
11809 set d_crypt_r_proto crypt_r $hdrs
11813 case "$d_crypt_r_proto" in
11815 case "$crypt_r_proto" in
11816 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
11817 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCS ;;
11819 case "$crypt_r_proto" in
11820 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
11821 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCD ;;
11823 case "$crypt_r_proto" in
11824 ''|0) d_crypt_r=undef
11826 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
11827 * ) case "$crypt_r_proto" in
11828 REENTRANT_PROTO*) ;;
11829 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
11831 echo "Prototype: $try" ;;
11834 *) case "$usethreads" in
11835 define) echo "crypt_r has no prototype, not using it." >&4 ;;
11846 : get csh whereabouts
11848 'csh') val="$undef" ;;
11849 *) val="$define" ;;
11853 : Respect a hint or command line value for full_csh.
11854 case "$full_csh" in
11855 '') full_csh=$csh ;;
11858 : see if ctermid exists
11859 set ctermid d_ctermid
11862 : see if ctermid_r exists
11863 set ctermid_r d_ctermid_r
11865 case "$d_ctermid_r" in
11867 hdrs="$i_systypes sys/types.h define stdio.h "
11868 case "$d_ctermid_r_proto:$usethreads" in
11869 ":define") d_ctermid_r_proto=define
11870 set d_ctermid_r_proto ctermid_r $hdrs
11874 case "$d_ctermid_r_proto" in
11876 case "$ctermid_r_proto" in
11877 ''|0) try='char* ctermid_r(char*);'
11878 ./protochk "$extern_C $try" $hdrs && ctermid_r_proto=B_B ;;
11880 case "$ctermid_r_proto" in
11881 ''|0) d_ctermid_r=undef
11883 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
11884 * ) case "$ctermid_r_proto" in
11885 REENTRANT_PROTO*) ;;
11886 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
11888 echo "Prototype: $try" ;;
11891 *) case "$usethreads" in
11892 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
11899 *) ctermid_r_proto=0
11903 : see if ctime_r exists
11904 set ctime_r d_ctime_r
11906 case "$d_ctime_r" in
11908 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
11909 case "$d_ctime_r_proto:$usethreads" in
11910 ":define") d_ctime_r_proto=define
11911 set d_ctime_r_proto ctime_r $hdrs
11915 case "$d_ctime_r_proto" in
11917 case "$ctime_r_proto" in
11918 ''|0) try='char* ctime_r(const time_t*, char*);'
11919 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SB ;;
11921 case "$ctime_r_proto" in
11922 ''|0) try='char* ctime_r(const time_t*, char*, int);'
11923 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SBI ;;
11925 case "$ctime_r_proto" in
11926 ''|0) try='int ctime_r(const time_t*, char*);'
11927 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SB ;;
11929 case "$ctime_r_proto" in
11930 ''|0) try='int ctime_r(const time_t*, char*, int);'
11931 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SBI ;;
11933 case "$ctime_r_proto" in
11934 ''|0) d_ctime_r=undef
11936 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
11937 * ) case "$ctime_r_proto" in
11938 REENTRANT_PROTO*) ;;
11939 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
11941 echo "Prototype: $try" ;;
11944 *) case "$usethreads" in
11945 define) echo "ctime_r has no prototype, not using it." >&4 ;;
11956 : see if cuserid exists
11957 set cuserid d_cuserid
11960 : see if this is a limits.h system
11961 set limits.h i_limits
11964 : see if this is a float.h system
11965 set float.h i_float
11968 : See if number of significant digits in a double precision number is known
11970 $cat >dbl_dig.c <<EOM
11971 #$i_limits I_LIMITS
11974 #include <limits.h>
11980 printf("Contains DBL_DIG");
11983 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
11984 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
11985 echo "DBL_DIG found." >&4
11988 echo "DBL_DIG NOT found." >&4
11995 : see if dbm.h is available
11996 : see if dbmclose exists
11997 set dbmclose d_dbmclose
12000 case "$d_dbmclose" in
12010 *) set rpcsvc/dbm.h i_rpcsvcdbm
12015 *) echo "We won't be including <dbm.h>"
12025 : see if prototype for dbminit is available
12027 set d_dbminitproto dbminit $i_dbm dbm.h
12030 : see if difftime exists
12031 set difftime d_difftime
12034 : see if this is a dirent system
12036 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
12038 echo "<dirent.h> found." >&4
12041 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
12042 echo "<sys/dir.h> found." >&4
12045 xinc=`./findhdr sys/ndir.h`
12047 echo "<dirent.h> NOT found." >&4
12052 : Look for type of directory structure.
12054 $cppstdin $cppflags $cppminus < "$xinc" > try.c
12056 case "$direntrytype" in
12058 case "$i_dirent" in
12059 $define) guess1='struct dirent' ;;
12060 *) guess1='struct direct' ;;
12063 *) guess1="$direntrytype"
12068 'struct dirent') guess2='struct direct' ;;
12069 *) guess2='struct dirent' ;;
12072 if $contains "$guess1" try.c >/dev/null 2>&1; then
12073 direntrytype="$guess1"
12074 echo "Your directory entries are $direntrytype." >&4
12075 elif $contains "$guess2" try.c >/dev/null 2>&1; then
12076 direntrytype="$guess2"
12077 echo "Your directory entries seem to be $direntrytype." >&4
12079 echo "I don't recognize your system's directory entries." >&4
12080 rp="What type is used for directory entries on this system?"
12083 direntrytype="$ans"
12087 : see if the directory entry stores field length
12089 $cppstdin $cppflags $cppminus < "$xinc" > try.c
12090 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
12091 echo "Good, your directory entry keeps length information in d_namlen." >&4
12094 echo "Your directory entry does not know about the d_namlen field." >&4
12101 : Look for DIR.dd_fd
12102 case "$i_dirent" in
12104 echo "Checking to see if DIR has a dd_fd member variable" >&4
12106 #$i_stdlib I_STDLIB
12108 #include <stdlib.h>
12110 #include <dirent.h>
12120 if eval $compile; then
12121 echo "Yes, it does."
12124 echo "No, it does not."
12129 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
12137 : see if this is an sysdir system
12138 set sys/dir.h i_sysdir
12141 : see if this is an sysndir system
12142 set sys/ndir.h i_sysndir
12147 $cat >dirfd.c <<EOM
12149 #$i_stdlib I_STDLIB
12151 #include <stdlib.h>
12153 #$i_dirent I_DIRENT /**/
12154 #$i_sysdir I_SYS_DIR /**/
12155 #$i_sysndir I_SYS_NDIR /**/
12156 #$i_systypes I_SYS_TYPES /**/
12157 #if defined(I_SYS_TYPES)
12158 #include <sys/types.h>
12160 #if defined(I_DIRENT)
12161 #include <dirent.h>
12164 #include <sys/ndir.h>
12168 #include <ndir.h> /* may be wrong in the future */
12170 #include <sys/dir.h>
12176 DIR *dirp = opendir(".");
12177 if (dirfd(dirp) >= 0)
12185 if eval $compile; then
12189 $define) echo "dirfd() found." >&4 ;;
12190 *) echo "dirfd() NOT found." >&4 ;;
12196 : see if dladdr exists
12197 set dladdr d_dladdr
12200 : see if dlerror exists
12203 set dlerror d_dlerror
12207 : see if dlfcn is available
12208 set dlfcn.h i_dlfcn
12211 : Check what extension to use for shared libs
12216 On a few systems, the dynamically loaded modules that perl generates and uses
12217 will need a different extension than shared libs. The default will probably
12223 *) dflt="$dlext" ;;
12225 rp='What is the extension of dynamically loaded modules'
12234 : Check if dlsym need a leading underscore
12240 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
12241 $cat >dyna.c <<'EOM'
12248 #$i_stdlib I_STDLIB
12250 #include <stdlib.h>
12254 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
12256 #include <sys/types.h>
12261 extern int fred() ;
12270 int mode = RTLD_LAZY ;
12272 handle = dlopen("./dyna.$dlext", mode) ;
12273 if (handle == NULL) {
12278 symbol = dlsym(handle, "fred") ;
12279 if (symbol == NULL) {
12280 /* try putting a leading underscore */
12281 symbol = dlsym(handle, "_fred") ;
12282 if (symbol == NULL) {
12295 : Call the object file tmp-dyna.o in case dlext=o.
12296 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
12297 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
12298 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
12299 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
12302 1) echo "Test program failed using dlopen." >&4
12303 echo "Perhaps you should not use dynamic loading." >&4;;
12304 2) echo "Test program failed using dlsym." >&4
12305 echo "Perhaps you should not use dynamic loading." >&4;;
12306 3) echo "dlsym needs a leading underscore" >&4
12308 4) echo "dlsym doesn't need a leading underscore." >&4;;
12311 echo "I can't compile and run the test program." >&4
12312 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
12317 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
12322 : see if drand48_r exists
12323 set drand48_r d_drand48_r
12325 case "$d_drand48_r" in
12327 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
12328 case "$d_drand48_r_proto:$usethreads" in
12329 ":define") d_drand48_r_proto=define
12330 set d_drand48_r_proto drand48_r $hdrs
12334 case "$d_drand48_r_proto" in
12336 case "$drand48_r_proto" in
12337 ''|0) try='int drand48_r(struct drand48_data*, double*);'
12338 ./protochk "$extern_C $try" $hdrs && drand48_r_proto=I_ST ;;
12340 case "$drand48_r_proto" in
12341 ''|0) d_drand48_r=undef
12343 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
12344 * ) case "$drand48_r_proto" in
12345 REENTRANT_PROTO*) ;;
12346 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
12348 echo "Prototype: $try" ;;
12351 *) case "$usethreads" in
12352 define) echo "drand48_r has no prototype, not using it." >&4 ;;
12359 *) drand48_r_proto=0
12363 : see if prototype for drand48 is available
12365 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
12368 : see if dup2 exists
12372 : see if eaccess exists
12373 set eaccess d_eaccess
12376 : see if endgrent exists
12377 set endgrent d_endgrent
12380 : see if this is an grp system
12386 xxx=`./findhdr grp.h`
12387 $cppstdin $cppflags $cppminus < $xxx >$$.h
12389 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
12401 set d_grpasswd; eval $setvar
12405 : see if endgrent_r exists
12406 set endgrent_r d_endgrent_r
12408 case "$d_endgrent_r" in
12410 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12411 case "$d_endgrent_r_proto:$usethreads" in
12412 ":define") d_endgrent_r_proto=define
12413 set d_endgrent_r_proto endgrent_r $hdrs
12417 case "$d_endgrent_r_proto" in
12419 case "$endgrent_r_proto" in
12420 ''|0) try='int endgrent_r(FILE**);'
12421 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=I_H ;;
12423 case "$endgrent_r_proto" in
12424 ''|0) try='void endgrent_r(FILE**);'
12425 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=V_H ;;
12427 case "$endgrent_r_proto" in
12428 ''|0) d_endgrent_r=undef
12430 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
12431 * ) case "$endgrent_r_proto" in
12432 REENTRANT_PROTO*) ;;
12433 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
12435 echo "Prototype: $try" ;;
12438 *) case "$usethreads" in
12439 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
12446 *) endgrent_r_proto=0
12450 : see if endhostent exists
12451 set endhostent d_endhent
12454 : see if this is a netdb.h system
12455 set netdb.h i_netdb
12458 : see if endhostent_r exists
12459 set endhostent_r d_endhostent_r
12461 case "$d_endhostent_r" in
12463 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12464 case "$d_endhostent_r_proto:$usethreads" in
12465 ":define") d_endhostent_r_proto=define
12466 set d_endhostent_r_proto endhostent_r $hdrs
12470 case "$d_endhostent_r_proto" in
12472 case "$endhostent_r_proto" in
12473 ''|0) try='int endhostent_r(struct hostent_data*);'
12474 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=I_D ;;
12476 case "$endhostent_r_proto" in
12477 ''|0) try='void endhostent_r(struct hostent_data*);'
12478 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=V_D ;;
12480 case "$endhostent_r_proto" in
12481 ''|0) d_endhostent_r=undef
12482 endhostent_r_proto=0
12483 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
12484 * ) case "$endhostent_r_proto" in
12485 REENTRANT_PROTO*) ;;
12486 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
12488 echo "Prototype: $try" ;;
12491 *) case "$usethreads" in
12492 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
12494 d_endhostent_r=undef
12495 endhostent_r_proto=0
12499 *) endhostent_r_proto=0
12503 : see if endnetent exists
12504 set endnetent d_endnent
12507 : see if endnetent_r exists
12508 set endnetent_r d_endnetent_r
12510 case "$d_endnetent_r" in
12512 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12513 case "$d_endnetent_r_proto:$usethreads" in
12514 ":define") d_endnetent_r_proto=define
12515 set d_endnetent_r_proto endnetent_r $hdrs
12519 case "$d_endnetent_r_proto" in
12521 case "$endnetent_r_proto" in
12522 ''|0) try='int endnetent_r(struct netent_data*);'
12523 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=I_D ;;
12525 case "$endnetent_r_proto" in
12526 ''|0) try='void endnetent_r(struct netent_data*);'
12527 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=V_D ;;
12529 case "$endnetent_r_proto" in
12530 ''|0) d_endnetent_r=undef
12531 endnetent_r_proto=0
12532 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
12533 * ) case "$endnetent_r_proto" in
12534 REENTRANT_PROTO*) ;;
12535 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
12537 echo "Prototype: $try" ;;
12540 *) case "$usethreads" in
12541 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
12543 d_endnetent_r=undef
12544 endnetent_r_proto=0
12548 *) endnetent_r_proto=0
12552 : see if endprotoent exists
12553 set endprotoent d_endpent
12556 : see if endprotoent_r exists
12557 set endprotoent_r d_endprotoent_r
12559 case "$d_endprotoent_r" in
12561 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12562 case "$d_endprotoent_r_proto:$usethreads" in
12563 ":define") d_endprotoent_r_proto=define
12564 set d_endprotoent_r_proto endprotoent_r $hdrs
12568 case "$d_endprotoent_r_proto" in
12570 case "$endprotoent_r_proto" in
12571 ''|0) try='int endprotoent_r(struct protoent_data*);'
12572 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=I_D ;;
12574 case "$endprotoent_r_proto" in
12575 ''|0) try='void endprotoent_r(struct protoent_data*);'
12576 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=V_D ;;
12578 case "$endprotoent_r_proto" in
12579 ''|0) d_endprotoent_r=undef
12580 endprotoent_r_proto=0
12581 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
12582 * ) case "$endprotoent_r_proto" in
12583 REENTRANT_PROTO*) ;;
12584 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
12586 echo "Prototype: $try" ;;
12589 *) case "$usethreads" in
12590 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
12592 d_endprotoent_r=undef
12593 endprotoent_r_proto=0
12597 *) endprotoent_r_proto=0
12601 : see if endpwent exists
12602 set endpwent d_endpwent
12605 : see if this is a pwd.h system
12611 xxx=`./findhdr pwd.h`
12612 $cppstdin $cppflags $cppminus < $xxx >$$.h
12614 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
12622 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
12630 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
12638 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
12646 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
12654 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
12662 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
12670 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
12682 set d_pwquota; eval $setvar
12683 set d_pwage; eval $setvar
12684 set d_pwchange; eval $setvar
12685 set d_pwclass; eval $setvar
12686 set d_pwexpire; eval $setvar
12687 set d_pwcomment; eval $setvar
12688 set d_pwgecos; eval $setvar
12689 set d_pwpasswd; eval $setvar
12693 : see if endpwent_r exists
12694 set endpwent_r d_endpwent_r
12696 case "$d_endpwent_r" in
12698 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
12699 case "$d_endpwent_r_proto:$usethreads" in
12700 ":define") d_endpwent_r_proto=define
12701 set d_endpwent_r_proto endpwent_r $hdrs
12705 case "$d_endpwent_r_proto" in
12707 case "$endpwent_r_proto" in
12708 ''|0) try='int endpwent_r(FILE**);'
12709 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=I_H ;;
12711 case "$endpwent_r_proto" in
12712 ''|0) try='void endpwent_r(FILE**);'
12713 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=V_H ;;
12715 case "$endpwent_r_proto" in
12716 ''|0) d_endpwent_r=undef
12718 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
12719 * ) case "$endpwent_r_proto" in
12720 REENTRANT_PROTO*) ;;
12721 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
12723 echo "Prototype: $try" ;;
12726 *) case "$usethreads" in
12727 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
12734 *) endpwent_r_proto=0
12738 : see if endservent exists
12739 set endservent d_endsent
12742 : see if endservent_r exists
12743 set endservent_r d_endservent_r
12745 case "$d_endservent_r" in
12747 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12748 case "$d_endservent_r_proto:$usethreads" in
12749 ":define") d_endservent_r_proto=define
12750 set d_endservent_r_proto endservent_r $hdrs
12754 case "$d_endservent_r_proto" in
12756 case "$endservent_r_proto" in
12757 ''|0) try='int endservent_r(struct servent_data*);'
12758 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=I_D ;;
12760 case "$endservent_r_proto" in
12761 ''|0) try='void endservent_r(struct servent_data*);'
12762 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=V_D ;;
12764 case "$endservent_r_proto" in
12765 ''|0) d_endservent_r=undef
12766 endservent_r_proto=0
12767 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
12768 * ) case "$endservent_r_proto" in
12769 REENTRANT_PROTO*) ;;
12770 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
12772 echo "Prototype: $try" ;;
12775 *) case "$usethreads" in
12776 define) echo "endservent_r has no prototype, not using it." >&4 ;;
12778 d_endservent_r=undef
12779 endservent_r_proto=0
12783 *) endservent_r_proto=0
12787 : Locate the flags for 'open()'
12790 #include <sys/types.h>
12795 #include <sys/file.h>
12797 #$i_stdlib I_STDLIB
12799 #include <stdlib.h>
12810 : check sys/file.h first to get FREAD on Sun
12811 if $test `./findhdr sys/file.h` && \
12812 set try -DI_SYS_FILE && eval $compile; then
12814 echo "<sys/file.h> defines the O_* constants..." >&4
12815 if $run ./try; then
12816 echo "and you have the 3 argument form of open()." >&4
12819 echo "but not the 3 argument form of open(). Oh, well." >&4
12822 elif $test `./findhdr fcntl.h` && \
12823 set try -DI_FCNTL && eval $compile; then
12825 echo "<fcntl.h> defines the O_* constants..." >&4
12826 if $run ./try; then
12827 echo "and you have the 3 argument form of open()." >&4
12830 echo "but not the 3 argument form of open(). Oh, well." >&4
12835 echo "I can't find the O_* constant definitions! You got problems." >&4
12841 : see if this is a sys/file.h system
12846 : do we need to include sys/file.h ?
12850 if $h_sysfile; then
12852 echo "We'll be including <sys/file.h>." >&4
12855 echo "We won't be including <sys/file.h>." >&4
12865 : see if fcntl.h is there
12870 : see if we can include fcntl.h
12876 echo "We'll be including <fcntl.h>." >&4
12879 if $h_sysfile; then
12880 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
12882 echo "We won't be including <fcntl.h>." >&4
12894 : see if fork exists
12898 : see if pipe exists
12902 : check for non-blocking I/O stuff
12903 case "$h_sysfile" in
12904 true) echo "#include <sys/file.h>" > head.c;;
12907 true) echo "#include <fcntl.h>" > head.c;;
12908 *) echo "#include <sys/fcntl.h>" > head.c;;
12913 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
12914 case "$o_nonblock" in
12916 $cat head.c > try.c
12917 $cat >>try.c <<EOCP
12919 #$i_stdlib I_STDLIB
12921 #include <stdlib.h>
12929 printf("O_NONBLOCK\n");
12933 printf("O_NDELAY\n");
12937 printf("FNDELAY\n");
12944 if eval $compile_ok; then
12945 o_nonblock=`$run ./try`
12946 case "$o_nonblock" in
12947 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
12948 *) echo "Seems like we can use $o_nonblock.";;
12951 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
12954 *) echo "Using $hint value $o_nonblock.";;
12959 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
12962 case "$d_fork:$d_pipe" in
12964 $cat head.c > try.c
12965 $cat >>try.c <<EOCP
12967 #include <sys/types.h>
12968 #include <signal.h>
12970 #$i_stdlib I_STDLIB
12972 #include <stdlib.h>
12978 #define MY_O_NONBLOCK $o_nonblock
12979 #ifndef errno /* XXX need better Configure test */
12982 #$i_unistd I_UNISTD
12984 #include <unistd.h>
12986 #$i_string I_STRING
12988 #include <string.h>
12990 #include <strings.h>
12992 $signal_t blech(int x) { exit(3); }
12994 $cat >> try.c <<'EOCP'
13003 ret = pipe(pd); /* Down: child -> parent */
13006 ret = pipe(pu); /* Up: parent -> child */
13010 close(pd[1]); /* Parent reads from pd[0] */
13011 close(pu[0]); /* Parent writes (blocking) to pu[1] */
13013 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
13018 signal(SIGALRM, blech);
13020 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
13022 sprintf(string, "%d\n", ret);
13023 ret = write(2, string, strlen(string));
13024 if (ret != strlen(string))
13028 if (errno == EAGAIN) {
13029 printf("EAGAIN\n");
13034 if (errno == EWOULDBLOCK)
13035 printf("EWOULDBLOCK\n");
13038 ret = write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
13041 sleep(2); /* Give it time to close our pipe */
13043 ret = read(pd[0], buf, 1); /* Should read EOF */
13045 sprintf(string, "%d\n", ret);
13046 ret = write(4, string, strlen(string));
13047 if (ret != strlen(string))
13052 close(pd[0]); /* We write to pd[1] */
13053 close(pu[1]); /* We read from pu[0] */
13054 ret = read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
13057 close(pd[1]); /* Pipe pd is now fully closed! */
13058 exit(0); /* Bye bye, thank you for playing! */
13062 if eval $compile_ok; then
13063 echo "$startsh" >mtry
13064 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
13066 $run ./mtry >/dev/null 2>&1
13068 0) eagain=`$cat try.out`;;
13069 1) echo "Could not perform non-blocking setting!";;
13070 2) echo "I did a successful read() for something that was not there!";;
13071 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
13072 4) echo "Could not find F_SETFL!";;
13073 *) echo "Something terribly wrong happened during testing.";;
13075 rd_nodata=`$cat try.ret`
13076 echo "A read() system call with no data present returns $rd_nodata."
13077 case "$rd_nodata" in
13080 echo "(That's peculiar, fixing that to be -1.)"
13086 echo "Forcing errno EAGAIN on read() with no data available."
13090 echo "Your read() sets errno to $eagain when no data is available."
13093 status=`$cat try.err`
13095 0) echo "And it correctly returns 0 to signal EOF.";;
13096 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
13097 *) echo "However, your read() returns '$status' on EOF??";;
13100 if test "$status" = "$rd_nodata"; then
13101 echo "WARNING: you can't distinguish between EOF and no data!"
13105 echo "I can't compile the test program--assuming errno EAGAIN will do."
13109 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
13118 echo "Using $hint value $eagain."
13119 echo "Your read() returns $rd_nodata when no data is present."
13120 case "$d_eofnblk" in
13121 "$define") echo "And you can see EOF because read() returns 0.";;
13122 "$undef") echo "But you can't see EOF status from read() returned value.";;
13124 echo "(Assuming you can't see EOF status from read anyway.)"
13130 $rm_try head.c mtry
13132 : see if _ptr and _cnt from stdio act std
13135 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
13136 echo "(Looks like you have stdio.h from BSD.)"
13137 case "$stdio_ptr" in
13138 '') stdio_ptr='((fp)->_p)'
13141 *) ptr_lval=$d_stdio_ptr_lval;;
13143 case "$stdio_cnt" in
13144 '') stdio_cnt='((fp)->_r)'
13147 *) cnt_lval=$d_stdio_cnt_lval;;
13149 case "$stdio_base" in
13150 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
13152 case "$stdio_bufsiz" in
13153 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
13155 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
13156 echo "(Looks like you have stdio.h from Linux.)"
13157 case "$stdio_ptr" in
13158 '') stdio_ptr='((fp)->_IO_read_ptr)'
13161 *) ptr_lval=$d_stdio_ptr_lval;;
13163 case "$stdio_cnt" in
13164 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
13167 *) cnt_lval=$d_stdio_cnt_lval;;
13169 case "$stdio_base" in
13170 '') stdio_base='((fp)->_IO_read_base)';;
13172 case "$stdio_bufsiz" in
13173 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
13176 case "$stdio_ptr" in
13177 '') stdio_ptr='((fp)->_ptr)'
13180 *) ptr_lval=$d_stdio_ptr_lval;;
13182 case "$stdio_cnt" in
13183 '') stdio_cnt='((fp)->_cnt)'
13186 *) cnt_lval=$d_stdio_cnt_lval;;
13188 case "$stdio_base" in
13189 '') stdio_base='((fp)->_base)';;
13191 case "$stdio_bufsiz" in
13192 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
13196 : test whether _ptr and _cnt really work
13197 echo "Checking how std your stdio is..." >&4
13200 #$i_stdlib I_STDLIB
13202 #include <stdlib.h>
13204 #define FILE_ptr(fp) $stdio_ptr
13205 #define FILE_cnt(fp) $stdio_cnt
13207 FILE *fp = fopen("try.c", "r");
13210 18 <= FILE_cnt(fp) &&
13211 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13219 if eval $compile && $to try.c; then
13220 if $run ./try; then
13221 echo "Your stdio acts pretty std."
13224 echo "Your stdio isn't very std."
13227 echo "Your stdio doesn't appear very std."
13231 # glibc 2.2.90 and above apparently change stdio streams so Perl's
13232 # direct buffer manipulation no longer works. The Configure tests
13233 # should be changed to correctly detect this, but until then,
13234 # the following check should at least let perl compile and run.
13235 # (This quick fix should be updated before 5.8.1.)
13236 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
13237 # A. Dougherty, June 3, 2002.
13238 case "$d_gnulibc" in
13240 case "$gnulibc_version" in
13244 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
13253 : Can _ptr be used as an lvalue?
13254 case "$d_stdstdio$ptr_lval" in
13255 $define$define) val=$define ;;
13258 set d_stdio_ptr_lval
13261 : Can _cnt be used as an lvalue?
13262 case "$d_stdstdio$cnt_lval" in
13263 $define$define) val=$define ;;
13266 set d_stdio_cnt_lval
13270 : test whether setting _ptr sets _cnt as a side effect
13271 d_stdio_ptr_lval_sets_cnt="$undef"
13272 d_stdio_ptr_lval_nochange_cnt="$undef"
13273 case "$d_stdio_ptr_lval$d_stdstdio" in
13275 echo "Checking to see what happens if we set the stdio ptr..." >&4
13278 /* Can we scream? */
13279 /* Eat dust sed :-) */
13280 /* In the buffer space, no one can hear you scream. */
13281 #$i_stdlib I_STDLIB
13283 #include <stdlib.h>
13285 #define FILE_ptr(fp) $stdio_ptr
13286 #define FILE_cnt(fp) $stdio_cnt
13287 #include <sys/types.h>
13289 FILE *fp = fopen("try.c", "r");
13294 puts("Fail even to read");
13297 c = getc(fp); /* Read away the first # */
13299 puts("Fail even to read");
13303 18 <= FILE_cnt(fp) &&
13304 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13306 puts("Fail even to read");
13309 ptr = (char*) FILE_ptr(fp);
13310 cnt = (size_t)FILE_cnt(fp);
13312 FILE_ptr(fp) += 42;
13314 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
13315 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
13318 if (FILE_cnt(fp) <= 20) {
13319 printf ("Fail (<20 chars to test)");
13322 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
13323 puts("Fail compare");
13326 if (cnt == FILE_cnt(fp)) {
13327 puts("Pass_unchanged");
13330 if (FILE_cnt(fp) == (cnt - 42)) {
13331 puts("Pass_changed");
13334 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
13340 if eval $compile && $to try.c; then
13341 case `$run ./try` in
13343 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
13344 d_stdio_ptr_lval_sets_cnt="$define" ;;
13346 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
13347 d_stdio_ptr_lval_nochange_cnt="$define" ;;
13349 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
13351 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
13354 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
13360 : see if _base is also standard
13362 case "$d_stdstdio" in
13366 #$i_stdlib I_STDLIB
13368 #include <stdlib.h>
13370 #define FILE_base(fp) $stdio_base
13371 #define FILE_bufsiz(fp) $stdio_bufsiz
13373 FILE *fp = fopen("try.c", "r");
13376 19 <= FILE_bufsiz(fp) &&
13377 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
13384 if eval $compile && $to try.c; then
13385 if $run ./try; then
13386 echo "And its _base field acts std."
13389 echo "But its _base field isn't std."
13392 echo "However, it seems to be lacking the _base field."
13400 : see if fast_stdio exists
13402 case "$d_stdstdio:$d_stdio_ptr_lval" in
13404 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
13406 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
13417 : see if fchdir exists
13418 set fchdir d_fchdir
13421 : see if fchmod exists
13422 set fchmod d_fchmod
13425 : see if fchown exists
13426 set fchown d_fchown
13429 : see if this is an fcntl system
13433 : See if fcntl-based locking works.
13436 #$i_stdlib I_STDLIB
13438 #include <stdlib.h>
13440 #include <unistd.h>
13442 #include <signal.h>
13443 $signal_t blech(int x) { exit(3); }
13445 #if defined(F_SETLK) && defined(F_SETLKW)
13446 struct flock flock;
13448 fd = open("try.c", O_RDONLY);
13449 flock.l_type = F_RDLCK;
13450 flock.l_whence = SEEK_SET;
13451 flock.l_start = flock.l_len = 0;
13452 signal(SIGALRM, blech);
13454 retval = fcntl(fd, F_SETLK, &flock);
13456 (retval < 0 ? exit(2) : exit(0));
13462 echo "Checking if fcntl-based file locking works... "
13466 if eval $compile_ok; then
13467 if $run ./try; then
13468 echo "Yes, it seems to work."
13471 echo "Nope, it didn't work."
13476 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
13477 *** This is (almost) impossible.
13478 *** If your NFS lock daemons are not feeling well, something like
13479 *** this may happen, please investigate. Cannot continue, aborting.
13487 echo "I'm unable to compile the test program, so I'll assume not."
13492 echo "Nope, since you don't even have fcntl()."
13495 set d_fcntl_can_lock
13499 : check for fd_set items
13502 Checking to see how well your C compiler handles fd_set and friends ...
13505 #$i_stdlib I_STDLIB
13507 #include <stdlib.h>
13509 #$i_systime I_SYS_TIME
13510 #$i_sysselct I_SYS_SELECT
13511 #$d_socket HAS_SOCKET
13512 #include <sys/types.h>
13514 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
13517 #include <sys/time.h>
13519 #ifdef I_SYS_SELECT
13520 #include <sys/select.h>
13529 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
13537 if eval $compile; then
13538 d_fds_bits="$define"
13540 echo "Well, your system knows about the normal fd_set typedef..." >&4
13541 if $run ./try; then
13542 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
13543 d_fd_macros="$define"
13546 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
13548 d_fd_macros="$undef"
13552 Hmm, your compiler has some difficulty with fd_set. Checking further...
13555 if eval $compile; then
13556 d_fds_bits="$undef"
13558 echo "Well, your system has some sort of fd_set available..." >&4
13559 if $run ./try; then
13560 echo "and you have the normal fd_set macros." >&4
13561 d_fd_macros="$define"
13564 but not the normal fd_set macros! Gross! More work for me...
13566 d_fd_macros="$undef"
13569 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
13571 d_fds_bits="$undef"
13572 d_fd_macros="$undef"
13577 : see if fgetpos exists
13578 set fgetpos d_fgetpos
13581 : see if finite exists
13582 set finite d_finite
13585 : see if finitel exists
13586 set finitel d_finitel
13589 : see if flock exists
13593 : see if prototype for flock is available
13595 set d_flockproto flock $i_sysfile sys/file.h
13598 : see if fp_class exists
13599 set fp_class d_fp_class
13602 : see if pathconf exists
13603 set pathconf d_pathconf
13606 : see if fpathconf exists
13607 set fpathconf d_fpathconf
13610 : see if fpclass exists
13611 set fpclass d_fpclass
13614 : see if fpclassify exists
13615 set fpclassify d_fpclassify
13618 : see if fpclassl exists
13619 set fpclassl d_fpclassl
13622 : check for fpos64_t
13624 echo "Checking to see if you have fpos64_t..." >&4
13627 int main() { fpos64_t x = 7; }
13630 if eval $compile; then
13632 echo "You have fpos64_t."
13635 echo "You do not have fpos64_t."
13636 case "$fpossize" in
13637 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
13644 : see if frexpl exists
13645 set frexpl d_frexpl
13648 : see if this is a sys/param system
13649 set sys/param.h i_sysparam
13652 : see if this is a sys/mount.h system
13653 set sys/mount.h i_sysmount
13656 : Check for fs_data_s
13658 echo "Checking to see if your system supports struct fs_data..." >&4
13659 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
13661 case "$d_fs_data_s" in
13662 "$define") echo "Yes, it does." ;;
13663 *) echo "No, it doesn't." ;;
13666 : see if fseeko exists
13667 set fseeko d_fseeko
13669 case "$longsize" in
13670 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
13673 : see if fsetpos exists
13674 set fsetpos d_fsetpos
13677 : see if fstatfs exists
13678 set fstatfs d_fstatfs
13681 : see if statvfs exists
13682 set statvfs d_statvfs
13685 : see if fstatvfs exists
13686 set fstatvfs d_fstatvfs
13690 : see if fsync exists
13694 : see if ftello exists
13695 set ftello d_ftello
13697 case "$longsize" in
13698 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
13701 : check for a working futimes
13704 echo "Checking if you have a working futimes()" >&4
13707 #include <sys/time.h>
13714 fd = open ("try.c", O_RDWR);
13715 if (-1 == fd) exit (1);
13716 rv = futimes (fd, NULL);
13717 exit (rv == -1 ? errno : 0);
13721 if eval $compile; then
13725 0) echo "Yes, you have" >&4
13726 d_futimes="$define"
13728 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
13732 echo "No, it does not (probably harmless)" >&4
13736 : see if ndbm.h is available
13739 : Compatibility location for RedHat 7.1
13740 set gdbm/ndbm.h i_gdbmndbm
13742 : Compatibility location for Debian 4.0
13743 set gdbm-ndbm.h i_gdbm_ndbm
13747 if $test "$i_ndbm" = "$define" -o "$i_gdbmndbm" = "$define" -o "$i_gdbm_ndbm" = "$define"; then
13748 : see if dbm_open exists
13749 set dbm_open d_dbm_open
13751 case "$d_dbm_open" in
13754 i_gdbmndbm="$undef"
13755 i_gdbm_ndbm="$undef"
13756 echo "We won't be including <ndbm.h>"
13766 ndbm_hdr_protochk='name=$1; hdr=$2;
13767 eval "ihdr=\$""i_$name";
13769 if $test "$ihdr" = "$define"; then
13770 $echo "Checking if your <$hdr> uses prototypes..." >&4;
13771 case "$d_cplusplus" in
13772 $define) ./protochk "$extern_C void dbm_close(DBM *);" literal "extern \"C\" {" $ihdr $hdr literal "}" && val="$define" ;;
13773 *) ./protochk "$extern_C void dbm_close(int, int);" $ihdr $hdr || val="$define" ;;
13776 $define) $echo "Your <$hdr> seems to have prototypes";;
13777 *) $echo "Your <$hdr> does not seem to have prototypes";;
13780 set "d_${name}_h_uses_prototypes";
13784 eval $ndbm_hdr_protochk
13785 set gdbmndbm gdbm/ndbm.h
13786 eval $ndbm_hdr_protochk
13787 set gdbm_ndbm gdbm-ndbm.h
13788 eval $ndbm_hdr_protochk
13790 : see if getaddrinfo exists
13791 set getaddrinfo d_getaddrinfo
13794 : see if getcwd exists
13795 set getcwd d_getcwd
13798 : see if getespwnam exists
13799 set getespwnam d_getespwnam
13802 : see if getfsstat exists
13803 set getfsstat d_getfsstat
13806 : see if getgrent exists
13807 set getgrent d_getgrent
13810 : see if getgrent_r exists
13811 set getgrent_r d_getgrent_r
13813 case "$d_getgrent_r" in
13815 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13816 case "$d_getgrent_r_proto:$usethreads" in
13817 ":define") d_getgrent_r_proto=define
13818 set d_getgrent_r_proto getgrent_r $hdrs
13822 case "$d_getgrent_r_proto" in
13824 case "$getgrent_r_proto" in
13825 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
13826 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBWR ;;
13828 case "$getgrent_r_proto" in
13829 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
13830 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIR ;;
13832 case "$getgrent_r_proto" in
13833 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
13834 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBW ;;
13836 case "$getgrent_r_proto" in
13837 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
13838 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBI ;;
13840 case "$getgrent_r_proto" in
13841 ''|0) try='int getgrent_r(struct group*, char*, int);'
13842 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBI ;;
13844 case "$getgrent_r_proto" in
13845 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
13846 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIH ;;
13848 case "$getgrent_r_proto" in
13849 ''|0) d_getgrent_r=undef
13851 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
13852 * ) case "$getgrent_r_proto" in
13853 REENTRANT_PROTO*) ;;
13854 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
13856 echo "Prototype: $try" ;;
13859 *) case "$usethreads" in
13860 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
13867 *) getgrent_r_proto=0
13871 : see if getgrgid_r exists
13872 set getgrgid_r d_getgrgid_r
13874 case "$d_getgrgid_r" in
13876 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13877 case "$d_getgrgid_r_proto:$usethreads" in
13878 ":define") d_getgrgid_r_proto=define
13879 set d_getgrgid_r_proto getgrgid_r $hdrs
13883 case "$d_getgrgid_r_proto" in
13885 case "$getgrgid_r_proto" in
13886 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
13887 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
13889 case "$getgrgid_r_proto" in
13890 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
13891 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
13893 case "$getgrgid_r_proto" in
13894 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
13895 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
13897 case "$getgrgid_r_proto" in
13898 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
13899 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
13901 case "$getgrgid_r_proto" in
13902 ''|0) d_getgrgid_r=undef
13904 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
13905 * ) case "$getgrgid_r_proto" in
13906 REENTRANT_PROTO*) ;;
13907 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
13909 echo "Prototype: $try" ;;
13912 *) case "$usethreads" in
13913 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
13920 *) getgrgid_r_proto=0
13924 : see if getgrnam_r exists
13925 set getgrnam_r d_getgrnam_r
13927 case "$d_getgrnam_r" in
13929 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13930 case "$d_getgrnam_r_proto:$usethreads" in
13931 ":define") d_getgrnam_r_proto=define
13932 set d_getgrnam_r_proto getgrnam_r $hdrs
13936 case "$d_getgrnam_r_proto" in
13938 case "$getgrnam_r_proto" in
13939 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
13940 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
13942 case "$getgrnam_r_proto" in
13943 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
13944 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
13946 case "$getgrnam_r_proto" in
13947 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
13948 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CBI ;;
13950 case "$getgrnam_r_proto" in
13951 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
13952 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
13954 case "$getgrnam_r_proto" in
13955 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
13956 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
13958 case "$getgrnam_r_proto" in
13959 ''|0) d_getgrnam_r=undef
13961 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
13962 * ) case "$getgrnam_r_proto" in
13963 REENTRANT_PROTO*) ;;
13964 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
13966 echo "Prototype: $try" ;;
13969 *) case "$usethreads" in
13970 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
13977 *) getgrnam_r_proto=0
13981 : see if gethostbyaddr exists
13982 set gethostbyaddr d_gethbyaddr
13985 : see if gethostbyname exists
13986 set gethostbyname d_gethbyname
13989 : see if gethostent exists
13990 set gethostent d_gethent
13993 : see how we will look up host name
13996 if set gethostname val -f d_gethname; eval $csym; $val; then
13997 echo 'gethostname() found.' >&4
13998 d_gethname="$define"
14001 if set uname val -f d_uname; eval $csym; $val; then
14004 uname() was found, but you're running xenix, and older versions of xenix
14005 have a broken uname(). If you don't really know whether your xenix is old
14006 enough to have a broken system call, use the default answer.
14011 "$define") dflt=n;;
14013 rp='Is your uname() broken?'
14016 n*) d_uname="$define"; call=uname;;
14019 echo 'uname() found.' >&4
14026 case "$d_gethname" in
14027 '') d_gethname="$undef";;
14030 '') d_uname="$undef";;
14032 case "$d_uname$d_gethname" in
14037 Every now and then someone has a $call() that lies about the hostname
14038 but can't be fixed for political or economic reasons. If you wish, I can
14039 pretend $call() isn't there and maybe compute hostname at run-time
14040 thanks to the '$phostname' command.
14043 rp="Shall I ignore $call() from now on?"
14046 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
14049 case "$phostname" in
14050 '') aphostname='';;
14051 *) case "$aphostname" in
14053 *) set X $phostname
14057 file=`./loc $file $file $pth`
14058 aphostname=`echo $file $*`
14063 case "$d_uname$d_gethname" in
14066 case "$phostname" in
14068 echo "There will be no way for $package to get your hostname." >&4;;
14070 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
14074 case "$d_phostname" in
14075 '') d_phostname="$undef";;
14078 : see if gethostbyaddr_r exists
14079 set gethostbyaddr_r d_gethostbyaddr_r
14081 case "$d_gethostbyaddr_r" in
14083 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14084 case "$d_gethostbyaddr_r_proto:$usethreads" in
14085 ":define") d_gethostbyaddr_r_proto=define
14086 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
14090 case "$d_gethostbyaddr_r_proto" in
14092 case "$gethostbyaddr_r_proto" in
14093 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
14094 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
14096 case "$gethostbyaddr_r_proto" in
14097 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
14098 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
14100 case "$gethostbyaddr_r_proto" in
14101 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
14102 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
14104 case "$gethostbyaddr_r_proto" in
14105 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
14106 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
14108 case "$gethostbyaddr_r_proto" in
14109 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
14110 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
14112 case "$gethostbyaddr_r_proto" in
14113 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
14114 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
14116 case "$gethostbyaddr_r_proto" in
14117 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
14118 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
14120 case "$gethostbyaddr_r_proto" in
14121 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
14122 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
14124 case "$gethostbyaddr_r_proto" in
14125 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
14126 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
14128 case "$gethostbyaddr_r_proto" in
14129 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
14130 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
14132 case "$gethostbyaddr_r_proto" in
14133 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
14134 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
14136 case "$gethostbyaddr_r_proto" in
14137 ''|0) d_gethostbyaddr_r=undef
14138 gethostbyaddr_r_proto=0
14139 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
14140 * ) case "$gethostbyaddr_r_proto" in
14141 REENTRANT_PROTO*) ;;
14142 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
14144 echo "Prototype: $try" ;;
14147 *) case "$usethreads" in
14148 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
14150 d_gethostbyaddr_r=undef
14151 gethostbyaddr_r_proto=0
14155 *) gethostbyaddr_r_proto=0
14159 : see if gethostbyname_r exists
14160 set gethostbyname_r d_gethostbyname_r
14162 case "$d_gethostbyname_r" in
14164 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14165 case "$d_gethostbyname_r_proto:$usethreads" in
14166 ":define") d_gethostbyname_r_proto=define
14167 set d_gethostbyname_r_proto gethostbyname_r $hdrs
14171 case "$d_gethostbyname_r_proto" in
14173 case "$gethostbyname_r_proto" in
14174 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
14175 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
14177 case "$gethostbyname_r_proto" in
14178 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
14179 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
14181 case "$gethostbyname_r_proto" in
14182 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
14183 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
14185 case "$gethostbyname_r_proto" in
14186 ''|0) d_gethostbyname_r=undef
14187 gethostbyname_r_proto=0
14188 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
14189 * ) case "$gethostbyname_r_proto" in
14190 REENTRANT_PROTO*) ;;
14191 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
14193 echo "Prototype: $try" ;;
14196 *) case "$usethreads" in
14197 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
14199 d_gethostbyname_r=undef
14200 gethostbyname_r_proto=0
14204 *) gethostbyname_r_proto=0
14208 : see if gethostent_r exists
14209 set gethostent_r d_gethostent_r
14211 case "$d_gethostent_r" in
14213 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14214 case "$d_gethostent_r_proto:$usethreads" in
14215 ":define") d_gethostent_r_proto=define
14216 set d_gethostent_r_proto gethostent_r $hdrs
14220 case "$d_gethostent_r_proto" in
14222 case "$gethostent_r_proto" in
14223 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
14224 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
14226 case "$gethostent_r_proto" in
14227 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
14228 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBIE ;;
14230 case "$gethostent_r_proto" in
14231 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
14232 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBIE ;;
14234 case "$gethostent_r_proto" in
14235 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
14236 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBI ;;
14238 case "$gethostent_r_proto" in
14239 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
14240 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBI ;;
14242 case "$gethostent_r_proto" in
14243 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
14244 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SD ;;
14246 case "$gethostent_r_proto" in
14247 ''|0) d_gethostent_r=undef
14248 gethostent_r_proto=0
14249 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
14250 * ) case "$gethostent_r_proto" in
14251 REENTRANT_PROTO*) ;;
14252 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
14254 echo "Prototype: $try" ;;
14257 *) case "$usethreads" in
14258 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
14260 d_gethostent_r=undef
14261 gethostent_r_proto=0
14265 *) gethostent_r_proto=0
14269 : see if prototypes for various gethostxxx netdb.h functions are available
14271 set d_gethostprotos gethostent $i_netdb netdb.h
14274 : see if getitimer exists
14275 set getitimer d_getitimer
14278 : see if getlogin exists
14279 set getlogin d_getlogin
14282 : see if getlogin_r exists
14283 set getlogin_r d_getlogin_r
14285 case "$d_getlogin_r" in
14287 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
14288 case "$d_getlogin_r_proto:$usethreads" in
14289 ":define") d_getlogin_r_proto=define
14290 set d_getlogin_r_proto getlogin_r $hdrs
14294 case "$d_getlogin_r_proto" in
14296 case "$getlogin_r_proto" in
14297 ''|0) try='int getlogin_r(char*, size_t);'
14298 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BW ;;
14300 case "$getlogin_r_proto" in
14301 ''|0) try='int getlogin_r(char*, int);'
14302 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BI ;;
14304 case "$getlogin_r_proto" in
14305 ''|0) try='char* getlogin_r(char*, size_t);'
14306 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BW ;;
14308 case "$getlogin_r_proto" in
14309 ''|0) try='char* getlogin_r(char*, int);'
14310 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BI ;;
14312 case "$getlogin_r_proto" in
14313 ''|0) d_getlogin_r=undef
14315 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
14316 * ) case "$getlogin_r_proto" in
14317 REENTRANT_PROTO*) ;;
14318 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
14320 echo "Prototype: $try" ;;
14323 *) case "$usethreads" in
14324 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
14331 *) getlogin_r_proto=0
14335 : see if getmnt exists
14336 set getmnt d_getmnt
14339 : see if getmntent exists
14340 set getmntent d_getmntent
14343 : see if getnameinfo exists
14344 set getnameinfo d_getnameinfo
14347 : see if getnetbyaddr exists
14348 set getnetbyaddr d_getnbyaddr
14351 : see if getnetbyname exists
14352 set getnetbyname d_getnbyname
14355 : see if getnetent exists
14356 set getnetent d_getnent
14359 : see if getnetbyaddr_r exists
14360 set getnetbyaddr_r d_getnetbyaddr_r
14362 case "$d_getnetbyaddr_r" in
14364 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14365 case "$d_getnetbyaddr_r_proto:$usethreads" in
14366 ":define") d_getnetbyaddr_r_proto=define
14367 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
14371 case "$d_getnetbyaddr_r_proto" in
14373 case "$getnetbyaddr_r_proto" in
14374 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
14375 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
14377 case "$getnetbyaddr_r_proto" in
14378 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
14379 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
14381 case "$getnetbyaddr_r_proto" in
14382 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
14383 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
14385 case "$getnetbyaddr_r_proto" in
14386 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
14387 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
14389 case "$getnetbyaddr_r_proto" in
14390 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
14391 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
14393 case "$getnetbyaddr_r_proto" in
14394 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
14395 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
14397 case "$getnetbyaddr_r_proto" in
14398 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
14399 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
14401 case "$getnetbyaddr_r_proto" in
14402 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
14403 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
14405 case "$getnetbyaddr_r_proto" in
14406 ''|0) d_getnetbyaddr_r=undef
14407 getnetbyaddr_r_proto=0
14408 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
14409 * ) case "$getnetbyaddr_r_proto" in
14410 REENTRANT_PROTO*) ;;
14411 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
14413 echo "Prototype: $try" ;;
14416 *) case "$usethreads" in
14417 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
14419 d_getnetbyaddr_r=undef
14420 getnetbyaddr_r_proto=0
14424 *) getnetbyaddr_r_proto=0
14428 : see if getnetbyname_r exists
14429 set getnetbyname_r d_getnetbyname_r
14431 case "$d_getnetbyname_r" in
14433 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14434 case "$d_getnetbyname_r_proto:$usethreads" in
14435 ":define") d_getnetbyname_r_proto=define
14436 set d_getnetbyname_r_proto getnetbyname_r $hdrs
14440 case "$d_getnetbyname_r_proto" in
14442 case "$getnetbyname_r_proto" in
14443 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
14444 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
14446 case "$getnetbyname_r_proto" in
14447 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
14448 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
14450 case "$getnetbyname_r_proto" in
14451 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
14452 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
14454 case "$getnetbyname_r_proto" in
14455 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
14456 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
14458 case "$getnetbyname_r_proto" in
14459 ''|0) d_getnetbyname_r=undef
14460 getnetbyname_r_proto=0
14461 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
14462 * ) case "$getnetbyname_r_proto" in
14463 REENTRANT_PROTO*) ;;
14464 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
14466 echo "Prototype: $try" ;;
14469 *) case "$usethreads" in
14470 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
14472 d_getnetbyname_r=undef
14473 getnetbyname_r_proto=0
14477 *) getnetbyname_r_proto=0
14481 : see if getnetent_r exists
14482 set getnetent_r d_getnetent_r
14484 case "$d_getnetent_r" in
14486 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14487 case "$d_getnetent_r_proto:$usethreads" in
14488 ":define") d_getnetent_r_proto=define
14489 set d_getnetent_r_proto getnetent_r $hdrs
14493 case "$d_getnetent_r_proto" in
14495 case "$getnetent_r_proto" in
14496 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
14497 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
14499 case "$getnetent_r_proto" in
14500 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
14501 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBIE ;;
14503 case "$getnetent_r_proto" in
14504 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
14505 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBIE ;;
14507 case "$getnetent_r_proto" in
14508 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
14509 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBI ;;
14511 case "$getnetent_r_proto" in
14512 ''|0) try='int getnetent_r(struct netent*, char*, int);'
14513 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBI ;;
14515 case "$getnetent_r_proto" in
14516 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
14517 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SD ;;
14519 case "$getnetent_r_proto" in
14520 ''|0) d_getnetent_r=undef
14521 getnetent_r_proto=0
14522 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
14523 * ) case "$getnetent_r_proto" in
14524 REENTRANT_PROTO*) ;;
14525 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
14527 echo "Prototype: $try" ;;
14530 *) case "$usethreads" in
14531 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
14533 d_getnetent_r=undef
14534 getnetent_r_proto=0
14538 *) getnetent_r_proto=0
14542 : see if prototypes for various getnetxxx netdb.h functions are available
14544 set d_getnetprotos getnetent $i_netdb netdb.h
14547 : see if getpagesize exists
14548 set getpagesize d_getpagsz
14551 : Optional checks for getprotobyname and getprotobynumber
14553 : see if getprotobyname exists
14554 set getprotobyname d_getpbyname
14557 : see if getprotobynumber exists
14558 set getprotobynumber d_getpbynumber
14561 : see if getprotoent exists
14562 set getprotoent d_getpent
14565 : see if getpgid exists
14566 set getpgid d_getpgid
14569 : see if getpgrp2 exists
14570 set getpgrp2 d_getpgrp2
14573 : see if getppid exists
14574 set getppid d_getppid
14577 : see if getpriority exists
14578 set getpriority d_getprior
14581 : see if getprotobyname_r exists
14582 set getprotobyname_r d_getprotobyname_r
14584 case "$d_getprotobyname_r" in
14586 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14587 case "$d_getprotobyname_r_proto:$usethreads" in
14588 ":define") d_getprotobyname_r_proto=define
14589 set d_getprotobyname_r_proto getprotobyname_r $hdrs
14593 case "$d_getprotobyname_r_proto" in
14595 case "$getprotobyname_r_proto" in
14596 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
14597 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
14599 case "$getprotobyname_r_proto" in
14600 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
14601 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
14603 case "$getprotobyname_r_proto" in
14604 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
14605 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
14607 case "$getprotobyname_r_proto" in
14608 ''|0) d_getprotobyname_r=undef
14609 getprotobyname_r_proto=0
14610 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
14611 * ) case "$getprotobyname_r_proto" in
14612 REENTRANT_PROTO*) ;;
14613 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
14615 echo "Prototype: $try" ;;
14618 *) case "$usethreads" in
14619 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
14621 d_getprotobyname_r=undef
14622 getprotobyname_r_proto=0
14626 *) getprotobyname_r_proto=0
14630 : see if getprotobynumber_r exists
14631 set getprotobynumber_r d_getprotobynumber_r
14633 case "$d_getprotobynumber_r" in
14635 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14636 case "$d_getprotobynumber_r_proto:$usethreads" in
14637 ":define") d_getprotobynumber_r_proto=define
14638 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
14642 case "$d_getprotobynumber_r_proto" in
14644 case "$getprotobynumber_r_proto" in
14645 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
14646 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
14648 case "$getprotobynumber_r_proto" in
14649 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
14650 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
14652 case "$getprotobynumber_r_proto" in
14653 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
14654 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
14656 case "$getprotobynumber_r_proto" in
14657 ''|0) d_getprotobynumber_r=undef
14658 getprotobynumber_r_proto=0
14659 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
14660 * ) case "$getprotobynumber_r_proto" in
14661 REENTRANT_PROTO*) ;;
14662 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
14664 echo "Prototype: $try" ;;
14667 *) case "$usethreads" in
14668 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
14670 d_getprotobynumber_r=undef
14671 getprotobynumber_r_proto=0
14675 *) getprotobynumber_r_proto=0
14679 : see if getprotoent_r exists
14680 set getprotoent_r d_getprotoent_r
14682 case "$d_getprotoent_r" in
14684 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14685 case "$d_getprotoent_r_proto:$usethreads" in
14686 ":define") d_getprotoent_r_proto=define
14687 set d_getprotoent_r_proto getprotoent_r $hdrs
14691 case "$d_getprotoent_r_proto" in
14693 case "$getprotoent_r_proto" in
14694 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
14695 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
14697 case "$getprotoent_r_proto" in
14698 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
14699 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBI ;;
14701 case "$getprotoent_r_proto" in
14702 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
14703 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=S_SBI ;;
14705 case "$getprotoent_r_proto" in
14706 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
14707 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SD ;;
14709 case "$getprotoent_r_proto" in
14710 ''|0) d_getprotoent_r=undef
14711 getprotoent_r_proto=0
14712 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
14713 * ) case "$getprotoent_r_proto" in
14714 REENTRANT_PROTO*) ;;
14715 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
14717 echo "Prototype: $try" ;;
14720 *) case "$usethreads" in
14721 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
14723 d_getprotoent_r=undef
14724 getprotoent_r_proto=0
14728 *) getprotoent_r_proto=0
14732 : see if prototypes for various getprotoxxx netdb.h functions are available
14734 set d_getprotoprotos getprotoent $i_netdb netdb.h
14737 : see if getprpwnam exists
14738 set getprpwnam d_getprpwnam
14741 : see if getpwent exists
14742 set getpwent d_getpwent
14745 : see if getpwent_r exists
14746 set getpwent_r d_getpwent_r
14748 case "$d_getpwent_r" in
14750 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14751 case "$d_getpwent_r_proto:$usethreads" in
14752 ":define") d_getpwent_r_proto=define
14753 set d_getpwent_r_proto getpwent_r $hdrs
14757 case "$d_getpwent_r_proto" in
14759 case "$getpwent_r_proto" in
14760 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
14761 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBWR ;;
14763 case "$getpwent_r_proto" in
14764 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
14765 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIR ;;
14767 case "$getpwent_r_proto" in
14768 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
14769 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBW ;;
14771 case "$getpwent_r_proto" in
14772 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
14773 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBI ;;
14775 case "$getpwent_r_proto" in
14776 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
14777 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBI ;;
14779 case "$getpwent_r_proto" in
14780 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
14781 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIH ;;
14783 case "$getpwent_r_proto" in
14784 ''|0) d_getpwent_r=undef
14786 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
14787 * ) case "$getpwent_r_proto" in
14788 REENTRANT_PROTO*) ;;
14789 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
14791 echo "Prototype: $try" ;;
14794 *) case "$usethreads" in
14795 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
14802 *) getpwent_r_proto=0
14806 : see if getpwnam_r exists
14807 set getpwnam_r d_getpwnam_r
14809 case "$d_getpwnam_r" in
14811 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14812 case "$d_getpwnam_r_proto:$usethreads" in
14813 ":define") d_getpwnam_r_proto=define
14814 set d_getpwnam_r_proto getpwnam_r $hdrs
14818 case "$d_getpwnam_r_proto" in
14820 case "$getpwnam_r_proto" in
14821 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
14822 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
14824 case "$getpwnam_r_proto" in
14825 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
14826 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
14828 case "$getpwnam_r_proto" in
14829 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
14830 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
14832 case "$getpwnam_r_proto" in
14833 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
14834 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
14836 case "$getpwnam_r_proto" in
14837 ''|0) d_getpwnam_r=undef
14839 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
14840 * ) case "$getpwnam_r_proto" in
14841 REENTRANT_PROTO*) ;;
14842 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
14844 echo "Prototype: $try" ;;
14847 *) case "$usethreads" in
14848 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
14855 *) getpwnam_r_proto=0
14859 : see if getpwuid_r exists
14860 set getpwuid_r d_getpwuid_r
14862 case "$d_getpwuid_r" in
14864 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14865 case "$d_getpwuid_r_proto:$usethreads" in
14866 ":define") d_getpwuid_r_proto=define
14867 set d_getpwuid_r_proto getpwuid_r $hdrs
14871 case "$d_getpwuid_r_proto" in
14873 case "$getpwuid_r_proto" in
14874 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
14875 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
14877 case "$getpwuid_r_proto" in
14878 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
14879 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
14881 case "$getpwuid_r_proto" in
14882 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
14883 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
14885 case "$getpwuid_r_proto" in
14886 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
14887 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
14889 case "$getpwuid_r_proto" in
14890 ''|0) d_getpwuid_r=undef
14892 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
14893 * ) case "$getpwuid_r_proto" in
14894 REENTRANT_PROTO*) ;;
14895 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
14897 echo "Prototype: $try" ;;
14900 *) case "$usethreads" in
14901 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
14908 *) getpwuid_r_proto=0
14912 : Optional checks for getsbyname and getsbyport
14914 : see if getservbyname exists
14915 set getservbyname d_getsbyname
14918 : see if getservbyport exists
14919 set getservbyport d_getsbyport
14922 : see if getservent exists
14923 set getservent d_getsent
14926 : see if getservbyname_r exists
14927 set getservbyname_r d_getservbyname_r
14929 case "$d_getservbyname_r" in
14931 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14932 case "$d_getservbyname_r_proto:$usethreads" in
14933 ":define") d_getservbyname_r_proto=define
14934 set d_getservbyname_r_proto getservbyname_r $hdrs
14938 case "$d_getservbyname_r_proto" in
14940 case "$getservbyname_r_proto" in
14941 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
14942 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
14944 case "$getservbyname_r_proto" in
14945 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
14946 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
14948 case "$getservbyname_r_proto" in
14949 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
14950 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
14952 case "$getservbyname_r_proto" in
14953 ''|0) d_getservbyname_r=undef
14954 getservbyname_r_proto=0
14955 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
14956 * ) case "$getservbyname_r_proto" in
14957 REENTRANT_PROTO*) ;;
14958 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
14960 echo "Prototype: $try" ;;
14963 *) case "$usethreads" in
14964 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
14966 d_getservbyname_r=undef
14967 getservbyname_r_proto=0
14971 *) getservbyname_r_proto=0
14975 : see if getservbyport_r exists
14976 set getservbyport_r d_getservbyport_r
14978 case "$d_getservbyport_r" in
14980 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14981 case "$d_getservbyport_r_proto:$usethreads" in
14982 ":define") d_getservbyport_r_proto=define
14983 set d_getservbyport_r_proto getservbyport_r $hdrs
14987 case "$d_getservbyport_r_proto" in
14989 case "$getservbyport_r_proto" in
14990 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
14991 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
14993 case "$getservbyport_r_proto" in
14994 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
14995 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
14997 case "$getservbyport_r_proto" in
14998 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
14999 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
15001 case "$getservbyport_r_proto" in
15002 ''|0) d_getservbyport_r=undef
15003 getservbyport_r_proto=0
15004 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
15005 * ) case "$getservbyport_r_proto" in
15006 REENTRANT_PROTO*) ;;
15007 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
15009 echo "Prototype: $try" ;;
15012 *) case "$usethreads" in
15013 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
15015 d_getservbyport_r=undef
15016 getservbyport_r_proto=0
15020 *) getservbyport_r_proto=0
15024 : see if getservent_r exists
15025 set getservent_r d_getservent_r
15027 case "$d_getservent_r" in
15029 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15030 case "$d_getservent_r_proto:$usethreads" in
15031 ":define") d_getservent_r_proto=define
15032 set d_getservent_r_proto getservent_r $hdrs
15036 case "$d_getservent_r_proto" in
15038 case "$getservent_r_proto" in
15039 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
15040 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBWR ;;
15042 case "$getservent_r_proto" in
15043 ''|0) try='int getservent_r(struct servent*, char*, int);'
15044 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBI ;;
15046 case "$getservent_r_proto" in
15047 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
15048 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=S_SBI ;;
15050 case "$getservent_r_proto" in
15051 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
15052 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SD ;;
15054 case "$getservent_r_proto" in
15055 ''|0) d_getservent_r=undef
15056 getservent_r_proto=0
15057 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
15058 * ) case "$getservent_r_proto" in
15059 REENTRANT_PROTO*) ;;
15060 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
15062 echo "Prototype: $try" ;;
15065 *) case "$usethreads" in
15066 define) echo "getservent_r has no prototype, not using it." >&4 ;;
15068 d_getservent_r=undef
15069 getservent_r_proto=0
15073 *) getservent_r_proto=0
15077 : see if prototypes for various getservxxx netdb.h functions are available
15079 set d_getservprotos getservent $i_netdb netdb.h
15082 : see if getspnam exists
15083 set getspnam d_getspnam
15086 : see if this is a shadow.h system
15087 set shadow.h i_shadow
15090 : see if getspnam_r exists
15091 set getspnam_r d_getspnam_r
15093 case "$d_getspnam_r" in
15095 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
15096 case "$d_getspnam_r_proto:$usethreads" in
15097 ":define") d_getspnam_r_proto=define
15098 set d_getspnam_r_proto getspnam_r $hdrs
15102 case "$d_getspnam_r_proto" in
15104 case "$getspnam_r_proto" in
15105 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
15106 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
15108 case "$getspnam_r_proto" in
15109 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
15110 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=S_CSBI ;;
15112 case "$getspnam_r_proto" in
15113 ''|0) d_getspnam_r=undef
15115 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
15116 * ) case "$getspnam_r_proto" in
15117 REENTRANT_PROTO*) ;;
15118 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
15120 echo "Prototype: $try" ;;
15123 *) case "$usethreads" in
15124 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
15131 *) getspnam_r_proto=0
15135 : see if gettimeofday or ftime exists
15136 set gettimeofday d_gettimeod
15138 case "$d_gettimeod" in
15144 val="$undef"; set d_ftime; eval $setvar
15147 case "$d_gettimeod$d_ftime" in
15150 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
15154 : see if gmtime_r exists
15155 set gmtime_r d_gmtime_r
15157 case "$d_gmtime_r" in
15159 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15160 case "$d_gmtime_r_proto:$usethreads" in
15161 ":define") d_gmtime_r_proto=define
15162 set d_gmtime_r_proto gmtime_r $hdrs
15166 case "$d_gmtime_r_proto" in
15168 case "$gmtime_r_proto" in
15169 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
15170 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=S_TS ;;
15172 case "$gmtime_r_proto" in
15173 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
15174 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=I_TS ;;
15176 case "$gmtime_r_proto" in
15177 ''|0) d_gmtime_r=undef
15179 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
15180 * ) case "$gmtime_r_proto" in
15181 REENTRANT_PROTO*) ;;
15182 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
15184 echo "Prototype: $try" ;;
15187 *) case "$usethreads" in
15188 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
15195 *) gmtime_r_proto=0
15199 : see if hasmntopt exists
15200 set hasmntopt d_hasmntopt
15203 : see if this is a netinet/in.h or sys/in.h system
15204 set netinet/in.h i_niin sys/in.h i_sysin
15207 : see if arpa/inet.h has to be included
15208 set arpa/inet.h i_arpainet
15211 : see if htonl --and friends-- exists
15216 : Maybe they are macros.
15219 $cat >htonl.c <<EOM
15221 #include <sys/types.h>
15222 #$i_niin I_NETINET_IN
15224 #$i_arpainet I_ARPA_INET
15225 #ifdef I_NETINET_IN
15226 #include <netinet/in.h>
15229 #include <sys/in.h>
15232 #include <arpa/inet.h>
15235 printf("Defined as a macro.");
15238 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
15239 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
15241 echo "But it seems to be defined as a macro." >&4
15249 : see if ilogbl exists
15250 set ilogbl d_ilogbl
15255 if set index val -f; eval $csym; $val; then
15256 if set strchr val -f d_strchr; eval $csym; $val; then
15257 if $contains strchr "$strings" >/dev/null 2>&1 ; then
15260 echo "strchr() found." >&4
15264 echo "index() found." >&4
15269 echo "index() found." >&4
15272 if set strchr val -f d_strchr; eval $csym; $val; then
15275 echo "strchr() found." >&4
15277 echo "No index() or strchr() found!" >&4
15282 set d_strchr; eval $setvar
15284 set d_index; eval $setvar
15286 : check whether inet_aton exists
15287 set inet_aton d_inetaton
15290 : see if inet_ntop exists
15291 set inet_ntop d_inetntop
15294 : see if inet_pton exists
15295 set inet_pton d_inetpton
15300 $cat >isascii.c <<EOCP
15303 #$i_stdlib I_STDLIB
15305 #include <stdlib.h>
15316 if eval $compile; then
15317 echo "isascii() found." >&4
15320 echo "isascii() NOT found." >&4
15329 $cat >isblank.c <<'EOCP'
15340 if $cc $ccflags $ldflags -o isblank isblank.c $libs >/dev/null 2>&1 ; then
15341 echo "isblank() found." >&4
15344 echo "isblank() NOT found." >&4
15351 : see if isfinite exists
15352 set isfinite d_isfinite
15355 : see if isinf exists
15359 : see if isnan exists
15363 : see if isnanl exists
15364 set isnanl d_isnanl
15367 : see if killpg exists
15368 set killpg d_killpg
15371 : see if lchown exists
15373 $cat > try.c <<'EOCP'
15374 /* System header to define __stub macros and hopefully few prototypes,
15375 which can conflict with char lchown(); below. */
15376 #include <assert.h>
15377 /* Override any gcc2 internal prototype to avoid an error. */
15378 /* We use char because int might match the return type of a gcc2
15379 builtin and then its argument prototype would still apply. */
15382 /* The GNU C library defines this for functions which it implements
15383 to always fail with ENOSYS. Some functions are actually named
15384 something starting with __ and the normal name is an alias. */
15385 #if defined (__stub_lchown) || defined (__stub___lchown)
15393 if eval $compile; then
15394 $echo "lchown() found." >&4
15397 $echo "lchown() NOT found." >&4
15403 : See if number of significant digits in a double precision number is known
15405 $cat >ldbl_dig.c <<EOM
15406 #$i_limits I_LIMITS
15409 #include <limits.h>
15415 printf("Contains LDBL_DIG");
15418 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
15419 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
15420 echo "LDBL_DIG found." >&4
15423 echo "LDBL_DIG NOT found." >&4
15430 : see if this is a math.h system
15434 : check to see if math.h defines _LIB_VERSION
15435 d_libm_lib_version="$undef"
15439 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
15441 #include <unistd.h>
15443 int main (int argc, char *argv[])
15445 printf ("%d\n", _LIB_VERSION);
15450 if eval $compile; then
15452 echo "Yes, it does ($foo)" >&4
15453 d_libm_lib_version="$define"
15455 echo "No, it does not (probably harmless)" >&4
15462 : see if link exists
15466 : see if localtime_r exists
15467 set localtime_r d_localtime_r
15469 case "$d_localtime_r" in
15471 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15472 case "$d_localtime_r_proto:$usethreads" in
15473 ":define") d_localtime_r_proto=define
15474 set d_localtime_r_proto localtime_r $hdrs
15478 case "$d_localtime_r_proto" in
15480 case "$localtime_r_proto" in
15481 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
15482 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=S_TS ;;
15484 case "$localtime_r_proto" in
15485 ''|0) try='int localtime_r(const time_t*, struct tm*);'
15486 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=I_TS ;;
15488 case "$localtime_r_proto" in
15489 ''|0) d_localtime_r=undef
15490 localtime_r_proto=0
15491 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
15492 * ) case "$localtime_r_proto" in
15493 REENTRANT_PROTO*) ;;
15494 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
15496 echo "Prototype: $try" ;;
15499 *) case "$usethreads" in
15500 define) echo "localtime_r has no prototype, not using it." >&4 ;;
15502 d_localtime_r=undef
15503 localtime_r_proto=0
15507 *) localtime_r_proto=0
15511 : see if localtime_r calls tzset
15512 case "$localtime_r_proto" in
15515 /* Does our libc's localtime_r call tzset ?
15516 * return 0 if so, 1 otherwise.
15518 #$i_systypes I_SYS_TYPES
15519 #$i_unistd I_UNISTD
15521 #$i_stdlib I_STDLIB
15522 #$i_string I_STRING
15523 #$i_malloc I_MALLOC
15525 # include <sys/types.h>
15528 # include <unistd.h>
15534 #include <stdlib.h>
15537 # include <string.h>
15539 # include <strings.h>
15542 # include <malloc.h>
15546 time_t t = time(0L);
15547 char w_tz[]="TZ" "=GMT+5",
15548 e_tz[]="TZ" "=GMT-5",
15549 *tz_e = (char*)malloc(16),
15550 *tz_w = (char*)malloc(16);
15551 struct tm tm_e, tm_w;
15552 memset(&tm_e,'\0',sizeof(struct tm));
15553 memset(&tm_w,'\0',sizeof(struct tm));
15558 localtime_r(&t, &tm_e);
15561 localtime_r(&t, &tm_w);
15563 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
15569 if eval $compile; then
15570 if $run ./try; then
15571 d_localtime_r_needs_tzset=undef;
15573 d_localtime_r_needs_tzset=define;
15576 d_localtime_r_needs_tzset=undef;
15580 d_localtime_r_needs_tzset=undef;
15585 : see if localeconv exists
15586 set localeconv d_locconv
15589 : see if lockf exists
15593 : see if prototype for lseek is available
15595 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
15598 : see if lstat exists
15602 : see if madvise exists
15603 set madvise d_madvise
15606 : see if malloc_size exists
15607 set malloc_size d_malloc_size
15610 : see if malloc_size_good exists
15611 set malloc_good_size d_malloc_good_size
15614 : see if mblen exists
15618 : see if mbstowcs exists
15619 set mbstowcs d_mbstowcs
15622 : see if mbtowc exists
15623 set mbtowc d_mbtowc
15626 : see if memchr exists
15627 set memchr d_memchr
15630 : see if memcmp exists
15631 set memcmp d_memcmp
15634 : see if memcpy exists
15635 set memcpy d_memcpy
15638 : see if memmove exists
15639 set memmove d_memmove
15642 : see if memset exists
15643 set memset d_memset
15646 : see if mkdir exists
15650 : see if mkdtemp exists
15651 set mkdtemp d_mkdtemp
15654 : see if mkfifo exists
15655 set mkfifo d_mkfifo
15658 : see if mkstemp exists
15659 set mkstemp d_mkstemp
15662 : see if mkstemps exists
15663 set mkstemps d_mkstemps
15666 : see if mktime exists
15667 set mktime d_mktime
15670 : see if this is a sys/mman.h system
15671 set sys/mman.h i_sysmman
15674 : see if mmap exists
15677 : see what shmat returns
15678 : default to something harmless
15680 case "$i_sysmman$d_mmap" in
15682 $cat >mmap.c <<'END'
15683 #include <sys/mman.h>
15686 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
15691 echo "and it returns ($mmaptype)." >&4
15697 : see if sqrtl exists
15701 : see if scalbnl exists
15702 set scalbnl d_scalbnl
15705 : see if modfl exists
15709 : see if prototype for modfl is available
15711 set d_modflproto modfl $i_math math.h
15714 d_modfl_pow32_bug="$undef"
15716 case "$d_longdbl$d_modfl" in
15719 Checking to see whether your modfl() is okay for large values...
15725 if $test "X$d_modflproto" != "X$define"; then
15726 $cat >>try.c <<EOCP
15727 /* Sigh. many current glibcs provide the function, but do not prototype it. */
15728 long double modfl (long double, long double *);
15731 $cat >>try.c <<EOCP
15733 long double nv = 4294967303.15;
15739 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
15743 case "$osname:$gccversion" in
15744 aix:) saveccflags="$ccflags"
15745 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
15748 if eval $compile; then
15751 *" 4294967303.150000 1.150000 4294967302.000000")
15752 echo >&4 "Your modfl() is broken for large values."
15753 d_modfl_pow32_bug="$define"
15755 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
15759 *" 4294967303.150000 0.150000 4294967303.000000")
15760 echo >&4 "Your modfl() seems okay for large values."
15762 *) echo >&4 "I don't understand your modfl() at all."
15768 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
15771 case "$osname:$gccversion" in
15772 aix:) ccflags="$saveccflags" ;; # restore
15777 if $test "$uselongdouble" = "$define"; then
15779 if $test "$d_sqrtl" != "$define"; then
15780 message="$message sqrtl"
15782 if $test "$d_modfl" != "$define"; then
15783 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
15784 echo "You have both aintl and copysignl, so I can emulate modfl."
15786 message="$message modfl"
15789 if $test "$d_frexpl" != "$define"; then
15790 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
15791 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
15793 message="$message frexpl"
15797 if $test "$message" != ""; then
15800 *** You requested the use of long doubles but you do not seem to have
15801 *** the following mathematical functions needed for long double support:
15803 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
15804 *** Cannot continue, aborting.
15812 : see if mprotect exists
15813 set mprotect d_mprotect
15816 : see if msgctl exists
15817 set msgctl d_msgctl
15820 : see if msgget exists
15821 set msgget d_msgget
15824 : see if msgsnd exists
15825 set msgsnd d_msgsnd
15828 : see if msgrcv exists
15829 set msgrcv d_msgrcv
15832 : see how much of the 'msg*(2)' library is present.
15835 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
15836 *"$undef"*) h_msg=false;;
15840 case "`ipcs 2>&1`" in
15841 "SVID messages"*"not configured"*)
15842 echo "Your $osname does not have the msg*(2) configured." >&4
15845 set msgctl d_msgctl
15847 set msgget d_msgget
15849 set msgsnd d_msgsnd
15851 set msgrcv d_msgrcv
15857 : we could also check for sys/ipc.h ...
15858 if $h_msg && $test `./findhdr sys/msg.h`; then
15859 echo "You have the full msg*(2) library." >&4
15862 echo "You don't have the full msg*(2) library." >&4
15868 : Check for msghdr_s
15870 echo "Checking to see if your system supports struct msghdr..." >&4
15871 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
15873 case "$d_msghdr_s" in
15874 "$define") echo "Yes, it does." ;;
15875 *) echo "No, it doesn't." ;;
15879 : see if msync exists
15883 : see if munmap exists
15884 set munmap d_munmap
15887 : see if nice exists
15891 : see if this is a langinfo.h system
15892 set langinfo.h i_langinfo
15895 : see if nl_langinfo exists
15896 set nl_langinfo d_nl_langinfo
15899 : check for volatile keyword
15901 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
15902 $cat >try.c <<'EOCP'
15905 typedef struct _goo_struct goo_struct;
15906 goo_struct * volatile goo = ((goo_struct *)0);
15907 struct _goo_struct {
15912 typedef unsigned short foo_t;
15913 char *volatile foo;
15915 volatile foo_t blech;
15919 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
15921 echo "Yup, it does."
15924 echo "Nope, it doesn't."
15930 : Check basic sizes
15932 $echo "Choosing the C types to be used for Perl's internal types..." >&4
15934 case "$use64bitint:$d_quad:$quadtype" in
15937 uvtype="$uquadtype"
15942 uvtype="unsigned long"
15948 case "$uselongdouble:$d_longdbl" in
15950 nvtype="long double"
15951 nvsize=$longdblsize
15958 $echo "(IV will be "$ivtype", $ivsize bytes)"
15959 $echo "(UV will be "$uvtype", $uvsize bytes)"
15960 $echo "(NV will be "$nvtype", $nvsize bytes)"
15962 $echo "Checking the kind of long doubles you have..." >&4
15963 : volatile so that the compiler has to store it out to memory.
15964 if test X"$d_volatile" = X"$define"; then
15967 case "$d_longdbl" in
15971 #$i_stdlib I_STDLIB
15972 #define LONGDBLSIZE $longdblsize
15977 #include <stdlib.h>
15980 static const long double d = -0.1L;
15982 unsigned const char* b = (unsigned const char*)(&d);
15983 #if LDBL_MANT_DIG == 113 && LONGDBLSIZE == 16
15984 if (b[0] == 0x9A && b[1] == 0x99 && b[15] == 0xBF) {
15985 /* IEEE 754 128-bit little-endian */
15989 if (b[0] == 0xBF && b[14] == 0x99 && b[15] == 0x9A) {
15990 /* IEEE 128-bit big-endian, e.g. solaris sparc */
15995 #if LDBL_MANT_DIG == 64 && (LONGDBLSIZE == 16 || LONGDBLSIZE == 12)
15996 if (b[0] == 0xCD && b[9] == 0xBF && b[10] == 0x00) {
15997 /* x86 80-bit little-endian, sizeof 12 (ILP32, Solaris x86)
15998 * or 16 (LP64, Linux and OS X), 4 or 6 bytes of padding.
15999 * Also known as "extended precision". */
16003 if (b[LONGDBLSIZE - 11] == 0x00 && b[LONGDBLSIZE - 10] == 0xBF &&
16004 b[LONGDBLSIZE - 1] == 0xCD) {
16005 /* is there ever big-endian 80-bit, really? */
16010 #if LDBL_MANT_DIG == 106 && LONGDBLSIZE == 16
16011 /* software "double double", the 106 is 53+53 */
16012 if (b[0] == 0xCD && b[7] == 0x3C && b[8] == 0x9A && b[15] == 0xBF) {
16013 /* double double 128-bit little-endian */
16017 if (b[0] == 0xBF && b[7] == 0x9A && b[8] == 0x3C && b[15] == 0x9A) {
16018 /* double double 128-bit big-endian, e.g. PPC/Power and MIPS:
16019 * bf b9 99 99 99 99 99 9a 3c 59 99 99 99 99 99 9a */
16024 printf("-1\n"); /* unknown */
16029 if eval $compile; then
16030 longdblkind=`$run ./try`
16035 *) longdblkind=0 ;;
16037 case "$longdblkind" in
16038 0) echo "Your long doubles are doubles." >&4 ;;
16039 1) echo "You have IEEE 754 128-bit little endian long doubles." >&4 ;;
16040 2) echo "You have IEEE 754 128-bit big endian long doubles." >&4 ;;
16041 3) echo "You have x86 80-bit little endian long doubles." >& 4 ;;
16042 *) echo "Cannot figure out your long double." >&4 ;;
16047 #$i_inttypes I_INTTYPES
16049 #include <inttypes.h>
16054 int8_t i = INT8_MAX;
16055 uint8_t u = UINT8_MAX;
16056 printf("int8_t\n");
16059 int16_t i = INT16_MAX;
16060 uint16_t u = UINT16_MAX;
16061 printf("int16_t\n");
16064 int32_t i = INT32_MAX;
16065 uint32_t u = UINT32_MAX;
16066 printf("int32_t\n");
16071 i8type="signed char"
16072 u8type="unsigned char"
16077 '') case "$shortsize" in
16079 u16type="unsigned short"
16087 '') set try -DINT16
16088 if eval $compile; then
16089 case "`$run ./try`" in
16101 '') if $test $shortsize -ge 2; then
16103 u16type="unsigned short"
16111 '') case "$longsize" in
16113 u32type="unsigned long"
16117 *) case "$intsize" in
16119 u32type="unsigned int"
16129 '') set try -DINT32
16130 if eval $compile; then
16131 case "`$run ./try`" in
16143 '') if $test $intsize -ge 4; then
16145 u32type="unsigned int"
16153 '') case "$d_quad:$quadtype" in
16155 i64type="$quadtype"
16156 u64type="$uquadtype"
16164 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
16165 : volatile so that the compiler has to store it out to memory.
16166 if test X"$d_volatile" = X"$define"; then
16171 #$i_stdlib I_STDLIB
16173 #include <stdlib.h>
16175 #include <sys/types.h>
16176 #include <signal.h>
16178 $volatile int bletched = 0;
16179 $signal_t blech(int s) { bletched = 1; }
16184 int n = 8 * $uvsize;
16187 signal(SIGFPE, blech);
16190 for (i = 0; i < n; i++) {
16191 u = u << 1 | ($uvtype)1;
16193 if (($uvtype)d != u)
16197 d = ($nvtype)(u - 1);
16198 if (($uvtype)d != (u - 1))
16205 printf("%d\n", ((i == n) ? -n : i));
16211 d_nv_preserves_uv="$undef"
16212 if eval $compile; then
16213 nv_preserves_uv_bits="`$run ./try`"
16215 case "$nv_preserves_uv_bits" in
16217 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
16218 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
16219 d_nv_preserves_uv="$define"
16221 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
16222 d_nv_preserves_uv="$undef" ;;
16223 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
16224 nv_preserves_uv_bits="0" ;;
16228 $echo "Checking to find the largest integer value your NVs can hold..." >&4
16229 : volatile so that the compiler has to store it out to memory.
16230 if test X"$d_volatile" = X"$define"; then
16236 typedef $nvtype NV;
16243 while(count < 256) {
16244 $volatile NV up = value + 1.0;
16245 $volatile NV negated = -value;
16246 $volatile NV down = negated - 1.0;
16247 $volatile NV got_up = up - value;
16248 int up_good = got_up == 1.0;
16249 int got_down = down - negated;
16250 int down_good = got_down == -1.0;
16252 if (down_good != up_good) {
16254 "Inconsistency - up %d %f; down %d %f; for 2**%d (%.20f)\n",
16255 up_good, (double) got_up, down_good, (double) got_down,
16256 count, (double) value);
16263 fputs("256.0", stdout);
16266 fputs("2.0", stdout);
16272 fputs("*", stdout);
16278 fprintf(stderr, "Cannot overflow integer range, even at 2**%d (%.20f)\n",
16279 count, (double) value);
16285 nv_overflows_integers_at='0'
16286 if eval $compile; then
16292 The largest integer your NVs can preserve is equal to $xxx
16294 nv_overflows_integers_at="$xxx"
16297 Cannot determine the largest integer value your NVs can hold, unexpected output
16304 Cannot determine the largest integer value your NVs can hold
16311 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
16312 : volatile so that the compiler has to store it out to memory.
16313 if test X"$d_volatile" = X"$define"; then
16318 #$i_stdlib I_STDLIB
16320 #include <stdlib.h>
16322 #$i_string I_STRING
16324 # include <string.h>
16326 # include <strings.h>
16328 #include <sys/types.h>
16329 #include <signal.h>
16331 $volatile int bletched = 0;
16332 $signal_t blech(int s) { bletched = 1; }
16335 int checkit($nvtype d, char *where) {
16336 unsigned char *p = (char *)&d;
16337 unsigned char *end = p + sizeof(d);
16347 printf("No - %s: 0x", where);
16349 printf ("%02X", *p++);
16354 int main(int argc, char **argv) {
16357 fail += checkit(d, "0.0");
16359 /* The compiler shouldn't be assuming that bletched is 0 */
16362 fail += checkit(d, "bleched");
16365 signal(SIGFPE, blech);
16368 /* Paranoia - the compiler should have no way of knowing that ANSI says
16369 that argv[argc] will always be NULL. Actually, if it did assume this it
16370 would be buggy, as this is C and main() can be called from elsewhere in
16372 d = argv[argc] ? 1 : 0;
16375 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
16378 fail += checkit(d, "ternary");
16380 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
16383 printf("No - memset doesn't give 0.0\n");
16384 /* This might just blow up: */
16385 printf("(gives %g)\n", d);
16391 printf("No - something bleched\n");
16396 printf("No - %d fail(s)\n", fail);
16405 d_nv_zero_is_allbits_zero="$undef"
16406 if eval $compile; then
16412 0.0 is represented as all bits zero in memory
16414 d_nv_zero_is_allbits_zero="$define"
16417 0.0 is not represented as all bits zero in memory
16419 d_nv_zero_is_allbits_zero="$undef"
16424 0.0 is not represented as all bits zero in memory
16426 d_nv_zero_is_allbits_zero="$undef"
16432 : check for off64_t
16434 echo "Checking to see if you have off64_t..." >&4
16436 #include <sys/types.h>
16437 #include <unistd.h>
16438 int main() { off64_t x = 7; }
16441 if eval $compile; then
16443 echo "You have off64_t."
16446 echo "You do not have off64_t."
16447 case "$lseeksize" in
16448 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
16455 : how to create joinable pthreads
16456 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
16458 echo "Checking what constant to use for creating joinable pthreads..." >&4
16459 $cat >try.c <<'EOCP'
16460 #include <pthread.h>
16462 int detachstate = JOINABLE;
16465 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
16466 if eval $compile; then
16467 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
16468 val="$undef" # Yes, undef.
16469 set d_old_pthread_create_joinable
16472 set old_pthread_create_joinable
16475 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
16476 if eval $compile; then
16477 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
16479 set d_old_pthread_create_joinable
16481 val=PTHREAD_CREATE_UNDETACHED
16482 set old_pthread_create_joinable
16485 set try -DJOINABLE=__UNDETACHED
16486 if eval $compile; then
16487 echo "You seem to use __UNDETACHED." >&4
16489 set d_old_pthread_create_joinable
16492 set old_pthread_create_joinable
16495 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
16497 set d_old_pthread_create_joinable
16500 set old_pthread_create_joinable
16507 d_old_pthread_create_joinable="$undef"
16508 old_pthread_create_joinable=""
16511 : see if pause exists
16515 : see if poll exists
16519 : see if prctl exists
16523 : see if prctl supports PR_SET_NAME
16524 d_prctl_set_name=$undef
16528 #include <sys/prctl.h>
16530 int main (int argc, char *argv[])
16532 return (prctl (PR_SET_NAME, "Test"));
16536 if eval $compile_ok && $run ./try; then
16537 echo "Your prctl (PR_SET_NAME, ...) works"
16538 d_prctl_set_name=$define
16544 : see if readlink exists
16545 set readlink d_readlink
16548 : Check if exe is symlink to abs path of executing program
16552 case "$d_readlink" in
16554 : NetBSD first as /proc/self is a symlink to /proc/curproc, and it feels
16555 : more tidy to avoid an extra level of symlink
16556 set NetBSD /proc/curproc/exe Linux /proc/self/exe FreeBSD /proc/curproc/file Solaris /proc/self/path/a.out
16557 while test $# -gt 0; do
16560 if $issymlink $try; then
16561 $ls -l $try > reflect
16562 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
16563 echo "You have $type-like $try."
16564 procselfexe='"'$try'"'
16566 : This will break out of the loop
16577 : backward compatibility for d_hvfork
16578 if test X$d_hvfork != X; then
16579 d_vfork="$d_hvfork"
16582 : see if there is a vfork
16587 d_pseudofork=$undef
16589 : Ok, but do we want to use it. vfork is reportedly unreliable in
16590 : perl on Solaris 2.x, and probably elsewhere.
16594 case "$usevfork" in
16600 Perl can only use a vfork() that doesn't suffer from strict
16601 restrictions on calling functions or modifying global data in
16602 the child. For example, glibc-2.1 contains such a vfork()
16603 that is unsuitable. If your system provides a proper fork()
16604 call, chances are that you do NOT want perl to use vfork().
16607 rp="Do you still want to use vfork()?"
16612 echo "Ok, we won't use vfork()."
16621 $define) usevfork='true';;
16622 *) usevfork='false';;
16625 : see whether the pthread_atfork exists
16627 #include <pthread.h>
16630 #ifdef PTHREAD_ATFORK
16631 pthread_atfork(NULL,NULL,NULL);
16636 : see if pthread_atfork exists
16637 set try -DPTHREAD_ATFORK
16638 if eval $compile; then
16643 case "$usethreads" in
16646 $define) echo 'pthread_atfork found.' >&4 ;;
16647 *) echo 'pthread_atfork NOT found.' >&4 ;;
16650 set d_pthread_atfork
16653 : see if pthread_attr_setscope exists
16654 set pthread_attr_setscope d_pthread_attr_setscope
16657 : see whether the various POSIXish _yields exist
16659 #include <pthread.h>
16665 #ifdef PTHREAD_YIELD
16668 #ifdef PTHREAD_YIELD_NULL
16669 pthread_yield(NULL);
16675 : see if sched_yield exists
16676 set try -DSCHED_YIELD
16677 if eval $compile; then
16679 sched_yield='sched_yield()'
16683 case "$usethreads" in
16686 $define) echo 'sched_yield() found.' >&4 ;;
16687 *) echo 'sched_yield() NOT found.' >&4 ;;
16693 : see if pthread_yield exists
16694 set try -DPTHREAD_YIELD
16695 if eval $compile; then
16697 case "$sched_yield" in
16698 '') sched_yield='pthread_yield()' ;;
16701 set try -DPTHREAD_YIELD_NULL
16702 if eval $compile; then
16704 case "$sched_yield" in
16705 '') sched_yield='pthread_yield(NULL)' ;;
16711 case "$usethreads" in
16714 $define) echo 'pthread_yield() found.' >&4 ;;
16715 *) echo 'pthread_yield() NOT found.' >&4 ;;
16719 set d_pthread_yield
16721 case "$sched_yield" in
16722 '') sched_yield=undef ;;
16726 : check for ptrdiff_t
16728 echo "Checking to see if you have ptrdiff_t..." >&4
16730 #include <stddef.h>
16731 int main() { ptrdiff_t x = 7; }
16734 if eval $compile; then
16736 echo "You have ptrdiff_t."
16739 echo "You do not have ptrdiff_t."
16745 : see if random_r exists
16746 set random_r d_random_r
16748 case "$d_random_r" in
16750 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16751 case "$d_random_r_proto:$usethreads" in
16752 ":define") d_random_r_proto=define
16753 set d_random_r_proto random_r $hdrs
16757 case "$d_random_r_proto" in
16759 case "$random_r_proto" in
16760 ''|0) try='int random_r(int*, struct random_data*);'
16761 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_iS ;;
16763 case "$random_r_proto" in
16764 ''|0) try='int random_r(long*, struct random_data*);'
16765 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_lS ;;
16767 case "$random_r_proto" in
16768 ''|0) try='int random_r(struct random_data*, int32_t*);'
16769 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_St ;;
16771 case "$random_r_proto" in
16772 ''|0) d_random_r=undef
16774 echo "Disabling random_r, cannot determine prototype." >&4 ;;
16775 * ) case "$random_r_proto" in
16776 REENTRANT_PROTO*) ;;
16777 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
16779 echo "Prototype: $try" ;;
16782 *) case "$usethreads" in
16783 define) echo "random_r has no prototype, not using it." >&4 ;;
16790 *) random_r_proto=0
16794 : see if readdir and friends exist
16795 set readdir d_readdir
16797 set seekdir d_seekdir
16799 set telldir d_telldir
16801 set rewinddir d_rewinddir
16804 : see if readdir64_r exists
16805 set readdir64_r d_readdir64_r
16807 case "$d_readdir64_r" in
16809 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16810 case "$d_readdir64_r_proto:$usethreads" in
16811 ":define") d_readdir64_r_proto=define
16812 set d_readdir64_r_proto readdir64_r $hdrs
16816 case "$d_readdir64_r_proto" in
16818 case "$readdir64_r_proto" in
16819 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
16820 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TSR ;;
16822 case "$readdir64_r_proto" in
16823 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
16824 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TS ;;
16826 case "$readdir64_r_proto" in
16827 ''|0) d_readdir64_r=undef
16828 readdir64_r_proto=0
16829 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
16830 * ) case "$readdir64_r_proto" in
16831 REENTRANT_PROTO*) ;;
16832 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
16834 echo "Prototype: $try" ;;
16837 *) case "$usethreads" in
16838 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
16840 d_readdir64_r=undef
16841 readdir64_r_proto=0
16845 *) readdir64_r_proto=0
16849 : see if readdir_r exists
16850 set readdir_r d_readdir_r
16852 case "$d_readdir_r" in
16854 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16855 case "$d_readdir_r_proto:$usethreads" in
16856 ":define") d_readdir_r_proto=define
16857 set d_readdir_r_proto readdir_r $hdrs
16861 case "$d_readdir_r_proto" in
16863 case "$readdir_r_proto" in
16864 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
16865 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TSR ;;
16867 case "$readdir_r_proto" in
16868 ''|0) try='int readdir_r(DIR*, struct dirent*);'
16869 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TS ;;
16871 case "$readdir_r_proto" in
16872 ''|0) d_readdir_r=undef
16874 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
16875 * ) case "$readdir_r_proto" in
16876 REENTRANT_PROTO*) ;;
16877 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
16879 echo "Prototype: $try" ;;
16882 *) case "$usethreads" in
16883 define) echo "readdir_r has no prototype, not using it." >&4 ;;
16890 *) readdir_r_proto=0
16894 : see if readv exists
16898 : see if recvmsg exists
16899 set recvmsg d_recvmsg
16902 : see if rename exists
16903 set rename d_rename
16906 : see if rmdir exists
16910 : see if memory.h is available.
16915 : See if it conflicts with string.h
16921 $cppstdin $cppflags $cppminus < $strings > mem.h
16922 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
16924 echo "We won't be including <memory.h>."
16934 : can bcopy handle overlapping blocks?
16937 case "$d_memmove" in
16938 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
16939 *) case "$d_bcopy" in
16941 echo "Checking to see if bcopy() can do overlapping copies..." >&4
16943 #$i_memory I_MEMORY
16944 #$i_stdlib I_STDLIB
16945 #$i_string I_STRING
16946 #$i_unistd I_UNISTD
16948 $cat >>try.c <<'EOCP'
16951 # include <memory.h>
16954 # include <stdlib.h>
16957 # include <string.h>
16959 # include <strings.h>
16962 # include <unistd.h> /* Needed for NetBSD */
16966 char buf[128], abc[128];
16972 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16973 try to store the string in read-only memory. */
16974 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
16976 for (align = 7; align >= 0; align--) {
16977 for (len = 36; len; len--) {
16979 bcopy(abc, b, len);
16980 for (off = 1; off <= len; off++) {
16981 bcopy(b, b+off, len);
16982 bcopy(b+off, b, len);
16983 if (bcmp(b, abc, len))
16992 if eval $compile_ok; then
16993 if $run ./try 2>/dev/null; then
16994 echo "Yes, it can."
16997 echo "It can't, sorry."
17000 echo "(I can't compile the test program, so we'll assume not...)"
17010 : can memcpy handle overlapping blocks?
17013 case "$d_memmove" in
17014 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
17015 *) case "$d_memcpy" in
17017 echo "Checking to see if memcpy() can do overlapping copies..." >&4
17019 #$i_memory I_MEMORY
17020 #$i_stdlib I_STDLIB
17021 #$i_string I_STRING
17022 #$i_unistd I_UNISTD
17024 $cat >>try.c <<'EOCP'
17027 # include <memory.h>
17030 # include <stdlib.h>
17033 # include <string.h>
17035 # include <strings.h>
17038 # include <unistd.h> /* Needed for NetBSD */
17042 char buf[128], abc[128];
17048 /* Copy "abcde..." string to char abc[] so that gcc doesn't
17049 try to store the string in read-only memory. */
17050 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
17052 for (align = 7; align >= 0; align--) {
17053 for (len = 36; len; len--) {
17055 memcpy(b, abc, len);
17056 for (off = 1; off <= len; off++) {
17057 memcpy(b+off, b, len);
17058 memcpy(b, b+off, len);
17059 if (memcmp(b, abc, len))
17068 if eval $compile_ok; then
17069 if $run ./try 2>/dev/null; then
17070 echo "Yes, it can."
17073 echo "It can't, sorry."
17076 echo "(I can't compile the test program, so we'll assume not...)"
17086 : can memcmp be trusted to compare relative magnitude?
17088 case "$d_memcmp" in
17091 echo "Checking if your memcmp() can compare relative magnitude..." >&4
17093 #$i_memory I_MEMORY
17094 #$i_stdlib I_STDLIB
17095 #$i_string I_STRING
17096 #$i_unistd I_UNISTD
17098 $cat >>try.c <<'EOCP'
17101 # include <memory.h>
17104 # include <stdlib.h>
17107 # include <string.h>
17109 # include <strings.h>
17112 # include <unistd.h> /* Needed for NetBSD */
17118 if ((a < b) && memcmp(&a, &b, 1) < 0)
17124 if eval $compile_ok; then
17125 if $run ./try 2>/dev/null; then
17126 echo "Yes, it can."
17129 echo "No, it can't (it uses signed chars)."
17132 echo "(I can't compile the test program, so we'll assume not...)"
17140 : see if prototype for sbrk is available
17142 set d_sbrkproto sbrk $i_unistd unistd.h
17145 : see if select exists
17146 set select d_select
17149 : see if semctl exists
17150 set semctl d_semctl
17153 : see if semget exists
17154 set semget d_semget
17157 : see if semop exists
17161 : see how much of the 'sem*(2)' library is present.
17164 case "$d_semctl$d_semget$d_semop" in
17165 *"$undef"*) h_sem=false;;
17169 case "`ipcs 2>&1`" in
17170 "SVID messages"*"not configured"*)
17171 echo "Your $osname does not have the sem*(2) configured." >&4
17174 set semctl d_semctl
17176 set semget d_semget
17184 : we could also check for sys/ipc.h ...
17185 if $h_sem && $test `./findhdr sys/sem.h`; then
17186 echo "You have the full sem*(2) library." >&4
17189 echo "You don't have the full sem*(2) library." >&4
17195 : see whether sys/sem.h defines union semun
17197 $cat > try.c <<'END'
17198 #include <sys/types.h>
17199 #include <sys/ipc.h>
17200 #include <sys/sem.h>
17201 int main () { union semun semun; semun.buf = 0; }
17204 if eval $compile; then
17205 echo "You have union semun in <sys/sem.h>." >&4
17208 echo "You do not have union semun in <sys/sem.h>." >&4
17215 : see how to do semctl IPC_STAT
17219 $cat > tryh.h <<END
17222 # define S_IRUSR S_IREAD
17223 # define S_IWUSR S_IWRITE
17224 # define S_IXUSR S_IEXEC
17226 # define S_IRUSR 0400
17227 # define S_IWUSR 0200
17228 # define S_IXUSR 0100
17230 # define S_IRGRP (S_IRUSR>>3)
17231 # define S_IWGRP (S_IWUSR>>3)
17232 # define S_IXGRP (S_IXUSR>>3)
17233 # define S_IROTH (S_IRUSR>>6)
17234 # define S_IWOTH (S_IWUSR>>6)
17235 # define S_IXOTH (S_IXUSR>>6)
17238 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
17239 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
17240 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
17243 : see whether semctl IPC_STAT can use union semun
17244 case "$d_semctl_semun" in
17248 #include <sys/types.h>
17249 #include <sys/ipc.h>
17250 #include <sys/sem.h>
17251 #include <sys/stat.h>
17258 #$d_union_semun HAS_UNION_SEMUN
17261 #ifndef HAS_UNION_SEMUN
17264 struct semid_ds *buf;
17265 unsigned short *array;
17271 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
17272 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
17274 struct semid_ds argbuf;
17277 st = semctl(sem, 0, IPC_STAT, arg);
17281 # endif /* IPC_STAT */
17282 printf("semctl IPC_STAT failed: errno = %d\n", errno);
17284 if (semctl(sem, 0, IPC_RMID, arg) != 0)
17285 # endif /* IPC_RMID */
17286 printf("semctl IPC_RMID failed: errno = %d\n", errno);
17288 #endif /* IPC_PRIVATE && ... */
17289 printf("semget failed: errno = %d\n", errno);
17294 if eval $compile; then
17297 semun) val="$define" ;;
17305 case "$d_semctl_semun" in
17307 echo "You can use union semun for semctl IPC_STAT." >&4
17310 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
17315 : see whether semctl IPC_STAT can use struct semid_ds pointer
17316 case "$d_semctl_semid_ds" in
17319 $cat > try.c <<'END'
17320 #include <sys/types.h>
17321 #include <sys/ipc.h>
17322 #include <sys/sem.h>
17323 #include <sys/stat.h>
17331 struct semid_ds arg;
17334 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
17335 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
17338 st = semctl(sem, 0, IPC_STAT, &arg);
17340 printf("semid_ds\n");
17342 # endif /* IPC_STAT */
17343 printf("semctl IPC_STAT failed: errno = %d\n", errno);
17345 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
17346 # endif /* IPC_RMID */
17347 printf("semctl IPC_RMID failed: errno = %d\n", errno);
17349 #endif /* IPC_PRIVATE && ... */
17350 printf("semget failed: errno = %d\n", errno);
17356 if eval $compile; then
17359 semid_ds) val="$define" ;;
17363 set d_semctl_semid_ds
17367 case "$d_semctl_semid_ds" in
17369 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
17371 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
17377 # We do not have the full sem*(2) library, so assume we can not
17383 set d_semctl_semid_ds
17389 : see if sendmsg exists
17390 set sendmsg d_sendmsg
17393 : see if setegid exists
17394 set setegid d_setegid
17397 : see if seteuid exists
17398 set seteuid d_seteuid
17401 : see if setgrent exists
17402 set setgrent d_setgrent
17405 : see if setgrent_r exists
17406 set setgrent_r d_setgrent_r
17408 case "$d_setgrent_r" in
17410 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
17411 case "$d_setgrent_r_proto:$usethreads" in
17412 ":define") d_setgrent_r_proto=define
17413 set d_setgrent_r_proto setgrent_r $hdrs
17417 case "$d_setgrent_r_proto" in
17419 case "$setgrent_r_proto" in
17420 ''|0) try='int setgrent_r(FILE**);'
17421 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=I_H ;;
17423 case "$setgrent_r_proto" in
17424 ''|0) try='void setgrent_r(FILE**);'
17425 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=V_H ;;
17427 case "$setgrent_r_proto" in
17428 ''|0) d_setgrent_r=undef
17430 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
17431 * ) case "$setgrent_r_proto" in
17432 REENTRANT_PROTO*) ;;
17433 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
17435 echo "Prototype: $try" ;;
17438 *) case "$usethreads" in
17439 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
17446 *) setgrent_r_proto=0
17450 : see if sethostent exists
17451 set sethostent d_sethent
17454 : see if sethostent_r exists
17455 set sethostent_r d_sethostent_r
17457 case "$d_sethostent_r" in
17459 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17460 case "$d_sethostent_r_proto:$usethreads" in
17461 ":define") d_sethostent_r_proto=define
17462 set d_sethostent_r_proto sethostent_r $hdrs
17466 case "$d_sethostent_r_proto" in
17468 case "$sethostent_r_proto" in
17469 ''|0) try='int sethostent_r(int, struct hostent_data*);'
17470 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=I_ID ;;
17472 case "$sethostent_r_proto" in
17473 ''|0) try='void sethostent_r(int, struct hostent_data*);'
17474 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=V_ID ;;
17476 case "$sethostent_r_proto" in
17477 ''|0) d_sethostent_r=undef
17478 sethostent_r_proto=0
17479 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
17480 * ) case "$sethostent_r_proto" in
17481 REENTRANT_PROTO*) ;;
17482 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
17484 echo "Prototype: $try" ;;
17487 *) case "$usethreads" in
17488 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
17490 d_sethostent_r=undef
17491 sethostent_r_proto=0
17495 *) sethostent_r_proto=0
17499 : see if setitimer exists
17500 set setitimer d_setitimer
17503 : see if setlinebuf exists
17504 set setlinebuf d_setlinebuf
17507 : see if setlocale exists
17508 set setlocale d_setlocale
17511 : see if locale.h is available
17512 set locale.h i_locale
17515 : see if setlocale_r exists
17516 set setlocale_r d_setlocale_r
17518 case "$d_setlocale_r" in
17520 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
17521 case "$d_setlocale_r_proto:$usethreads" in
17522 ":define") d_setlocale_r_proto=define
17523 set d_setlocale_r_proto setlocale_r $hdrs
17527 case "$d_setlocale_r_proto" in
17529 case "$setlocale_r_proto" in
17530 ''|0) try='int setlocale_r(int, const char*, char*, int);'
17531 ./protochk "$extern_C $try" $hdrs && setlocale_r_proto=I_ICBI ;;
17533 case "$setlocale_r_proto" in
17534 ''|0) d_setlocale_r=undef
17535 setlocale_r_proto=0
17536 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
17537 * ) case "$setlocale_r_proto" in
17538 REENTRANT_PROTO*) ;;
17539 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
17541 echo "Prototype: $try" ;;
17544 *) case "$usethreads" in
17545 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
17547 d_setlocale_r=undef
17548 setlocale_r_proto=0
17552 *) setlocale_r_proto=0
17556 : see if setnetent exists
17557 set setnetent d_setnent
17560 : see if setnetent_r exists
17561 set setnetent_r d_setnetent_r
17563 case "$d_setnetent_r" in
17565 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17566 case "$d_setnetent_r_proto:$usethreads" in
17567 ":define") d_setnetent_r_proto=define
17568 set d_setnetent_r_proto setnetent_r $hdrs
17572 case "$d_setnetent_r_proto" in
17574 case "$setnetent_r_proto" in
17575 ''|0) try='int setnetent_r(int, struct netent_data*);'
17576 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=I_ID ;;
17578 case "$setnetent_r_proto" in
17579 ''|0) try='void setnetent_r(int, struct netent_data*);'
17580 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=V_ID ;;
17582 case "$setnetent_r_proto" in
17583 ''|0) d_setnetent_r=undef
17584 setnetent_r_proto=0
17585 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
17586 * ) case "$setnetent_r_proto" in
17587 REENTRANT_PROTO*) ;;
17588 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
17590 echo "Prototype: $try" ;;
17593 *) case "$usethreads" in
17594 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
17596 d_setnetent_r=undef
17597 setnetent_r_proto=0
17601 *) setnetent_r_proto=0
17605 : see if setprotoent exists
17606 set setprotoent d_setpent
17609 : see if setpgid exists
17610 set setpgid d_setpgid
17613 : see if setpgrp2 exists
17614 set setpgrp2 d_setpgrp2
17617 : see if setpriority exists
17618 set setpriority d_setprior
17621 : see if setproctitle exists
17622 set setproctitle d_setproctitle
17625 : see if setprotoent_r exists
17626 set setprotoent_r d_setprotoent_r
17628 case "$d_setprotoent_r" in
17630 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17631 case "$d_setprotoent_r_proto:$usethreads" in
17632 ":define") d_setprotoent_r_proto=define
17633 set d_setprotoent_r_proto setprotoent_r $hdrs
17637 case "$d_setprotoent_r_proto" in
17639 case "$setprotoent_r_proto" in
17640 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
17641 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=I_ID ;;
17643 case "$setprotoent_r_proto" in
17644 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
17645 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=V_ID ;;
17647 case "$setprotoent_r_proto" in
17648 ''|0) d_setprotoent_r=undef
17649 setprotoent_r_proto=0
17650 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
17651 * ) case "$setprotoent_r_proto" in
17652 REENTRANT_PROTO*) ;;
17653 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
17655 echo "Prototype: $try" ;;
17658 *) case "$usethreads" in
17659 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
17661 d_setprotoent_r=undef
17662 setprotoent_r_proto=0
17666 *) setprotoent_r_proto=0
17670 : see if setpwent exists
17671 set setpwent d_setpwent
17674 : see if setpwent_r exists
17675 set setpwent_r d_setpwent_r
17677 case "$d_setpwent_r" in
17679 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
17680 case "$d_setpwent_r_proto:$usethreads" in
17681 ":define") d_setpwent_r_proto=define
17682 set d_setpwent_r_proto setpwent_r $hdrs
17686 case "$d_setpwent_r_proto" in
17688 case "$setpwent_r_proto" in
17689 ''|0) try='int setpwent_r(FILE**);'
17690 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=I_H ;;
17692 case "$setpwent_r_proto" in
17693 ''|0) try='void setpwent_r(FILE**);'
17694 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=V_H ;;
17696 case "$setpwent_r_proto" in
17697 ''|0) d_setpwent_r=undef
17699 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
17700 * ) case "$setpwent_r_proto" in
17701 REENTRANT_PROTO*) ;;
17702 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
17704 echo "Prototype: $try" ;;
17707 *) case "$usethreads" in
17708 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
17715 *) setpwent_r_proto=0
17719 : see if setregid exists
17720 set setregid d_setregid
17722 set setresgid d_setresgid
17725 : see if setreuid exists
17726 set setreuid d_setreuid
17728 set setresuid d_setresuid
17731 : see if setrgid exists
17732 set setrgid d_setrgid
17735 : see if setruid exists
17736 set setruid d_setruid
17739 : see if setservent exists
17740 set setservent d_setsent
17743 : see if setservent_r exists
17744 set setservent_r d_setservent_r
17746 case "$d_setservent_r" in
17748 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17749 case "$d_setservent_r_proto:$usethreads" in
17750 ":define") d_setservent_r_proto=define
17751 set d_setservent_r_proto setservent_r $hdrs
17755 case "$d_setservent_r_proto" in
17757 case "$setservent_r_proto" in
17758 ''|0) try='int setservent_r(int, struct servent_data*);'
17759 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=I_ID ;;
17761 case "$setservent_r_proto" in
17762 ''|0) try='void setservent_r(int, struct servent_data*);'
17763 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=V_ID ;;
17765 case "$setservent_r_proto" in
17766 ''|0) d_setservent_r=undef
17767 setservent_r_proto=0
17768 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
17769 * ) case "$setservent_r_proto" in
17770 REENTRANT_PROTO*) ;;
17771 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
17773 echo "Prototype: $try" ;;
17776 *) case "$usethreads" in
17777 define) echo "setservent_r has no prototype, not using it." >&4 ;;
17779 d_setservent_r=undef
17780 setservent_r_proto=0
17784 *) setservent_r_proto=0
17788 : see if setsid exists
17789 set setsid d_setsid
17792 : see if setvbuf exists
17793 set setvbuf d_setvbuf
17796 : see if shmctl exists
17797 set shmctl d_shmctl
17800 : see if shmget exists
17801 set shmget d_shmget
17804 : see if shmat exists
17807 : see what shmat returns
17810 $cat >shmat.c <<'END'
17811 #include <sys/shm.h>
17814 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
17819 echo "and it returns ($shmattype)." >&4
17820 : see if a prototype for shmat is available
17821 xxx=`./findhdr sys/shm.h`
17822 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
17823 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
17834 set d_shmatprototype
17837 : see if shmdt exists
17841 : see how much of the 'shm*(2)' library is present.
17844 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
17845 *"$undef"*) h_shm=false;;
17849 case "`ipcs 2>&1`" in
17850 "SVID shared memory"*"not configured"*)
17851 echo "Your $osname does not have the shm*(2) configured." >&4
17854 set shmctl d_shmctl
17856 set shmget d_shmget
17866 : we could also check for sys/ipc.h ...
17867 if $h_shm && $test `./findhdr sys/shm.h`; then
17868 echo "You have the full shm*(2) library." >&4
17871 echo "You don't have the full shm*(2) library." >&4
17877 : see if we have sigaction
17879 if set sigaction val -f d_sigaction; eval $csym; $val; then
17880 echo 'sigaction() found.' >&4
17883 #include <sys/types.h>
17884 #include <signal.h>
17885 #$i_stdlib I_STDLIB
17887 #include <stdlib.h>
17891 struct sigaction act, oact;
17893 oact.sa_handler = 0;
17894 /* so that act and oact are used */
17895 exit(act.sa_flags == 0 && oact.sa_handler == 0);
17899 if eval $compile_ok; then
17902 echo "But you don't seem to have a usable struct sigaction." >&4
17906 echo 'sigaction NOT found.' >&4
17909 set d_sigaction; eval $setvar
17912 : see if this is a sunmath.h system
17913 set sunmath.h i_sunmath
17916 : see if signbit exists
17917 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
17920 #$i_sunmath I_SUNMATH
17924 #ifdef I_SUNMATH /* Solaris special math library */
17925 # include <sunmath.h>
17928 int main(int argc, char **argv)
17932 if ((signbit(x) == 0) && (signbit(y) != 0))
17940 if eval $compile; then
17941 if $run ./try; then
17945 $echo "Signbit seems to be available, but doesn't work as I expected."
17946 $echo "I won't use it." >&4
17957 : see if sigprocmask exists
17958 set sigprocmask d_sigprocmask
17961 : see if sigsetjmp exists
17963 case "$d_sigsetjmp" in
17966 #include <setjmp.h>
17967 #$i_stdlib I_STDLIB
17969 #include <stdlib.h>
17975 if (sigsetjmp(env,1))
17978 siglongjmp(env, 1);
17983 if eval $compile; then
17984 if $run ./try >/dev/null 2>&1; then
17985 echo "POSIX sigsetjmp found." >&4
17989 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
17995 echo "sigsetjmp not found." >&4
17999 *) val="$d_sigsetjmp"
18000 case "$d_sigsetjmp" in
18001 $define) echo "POSIX sigsetjmp found." >&4;;
18002 $undef) echo "sigsetjmp not found." >&4;;
18010 : see if snprintf exists
18011 set snprintf d_snprintf
18014 : see if vsnprintf exists
18015 set vsnprintf d_vsnprintf
18018 case "$d_snprintf-$d_vsnprintf" in
18021 Checking whether your snprintf() and vsnprintf() work okay...
18023 $cat >try.c <<'EOCP'
18024 /* v?snprintf testing logic courtesy of Russ Allbery.
18025 * According to C99:
18026 * - if the buffer is too short it still must be \0-terminated
18027 * - if the buffer is too short the potentially required length
18028 * must be returned and not -1
18029 * - if the buffer is NULL the potentially required length
18030 * must be returned and not -1 or core dump
18033 #include <stdarg.h>
18037 int test (char *format, ...)
18042 va_start (args, format);
18043 count = vsnprintf (buf, sizeof buf, format, args);
18050 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
18051 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
18055 if eval $compile; then
18058 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
18060 Your snprintf() and snprintf() don't seem to be working okay.
18062 d_snprintf="$undef"
18063 d_vsnprintf="$undef"
18067 echo "(I can't seem to compile the test program--assuming they don't)"
18068 d_snprintf="$undef"
18069 d_vsnprintf="$undef"
18075 : see if sockatmark exists
18076 set sockatmark d_sockatmark
18079 : see if prototype for sockatmark is available
18081 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
18084 : see if socks5_init exists
18085 set socks5_init d_socks5_init
18088 : see if sprintf returns the length of the string in the buffer as per ANSI
18089 $echo "Checking whether sprintf returns the length of the string..." >&4
18092 #$i_stdlib I_STDLIB
18094 #include <stdlib.h>
18096 #$i_string I_STRING
18098 # include <string.h>
18100 # include <strings.h>
18109 int check (size_t expect, int test) {
18110 size_t got = strlen(buffer);
18114 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
18119 int main(int argc, char **argv) {
18122 check(sprintf(buffer, ""), ++test);
18123 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
18124 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
18131 if eval $compile; then
18135 sprintf returns the length of the string (as ANSI says it should)
18137 d_sprintf_returns_strlen="$define"
18140 sprintf does not return the length of the string (how old is this system?)
18142 d_sprintf_returns_strlen="$undef"
18146 echo "(I can't seem to compile the test program--assuming it doesn't)" >&4
18147 d_sprintf_returns_strlen="$undef"
18151 : see if srand48_r exists
18152 set srand48_r d_srand48_r
18154 case "$d_srand48_r" in
18156 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
18157 case "$d_srand48_r_proto:$usethreads" in
18158 ":define") d_srand48_r_proto=define
18159 set d_srand48_r_proto srand48_r $hdrs
18163 case "$d_srand48_r_proto" in
18165 case "$srand48_r_proto" in
18166 ''|0) try='int srand48_r(long, struct drand48_data*);'
18167 ./protochk "$extern_C $try" $hdrs && srand48_r_proto=I_LS ;;
18169 case "$srand48_r_proto" in
18170 ''|0) d_srand48_r=undef
18172 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
18173 * ) case "$srand48_r_proto" in
18174 REENTRANT_PROTO*) ;;
18175 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
18177 echo "Prototype: $try" ;;
18180 *) case "$usethreads" in
18181 define) echo "srand48_r has no prototype, not using it." >&4 ;;
18188 *) srand48_r_proto=0
18192 : see if srandom_r exists
18193 set srandom_r d_srandom_r
18195 case "$d_srandom_r" in
18197 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
18198 case "$d_srandom_r_proto:$usethreads" in
18199 ":define") d_srandom_r_proto=define
18200 set d_srandom_r_proto srandom_r $hdrs
18204 case "$d_srandom_r_proto" in
18206 case "$srandom_r_proto" in
18207 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
18208 ./protochk "$extern_C $try" $hdrs && srandom_r_proto=I_TS ;;
18210 case "$srandom_r_proto" in
18211 ''|0) d_srandom_r=undef
18213 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
18214 * ) case "$srandom_r_proto" in
18215 REENTRANT_PROTO*) ;;
18216 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
18218 echo "Prototype: $try" ;;
18221 *) case "$usethreads" in
18222 define) echo "srandom_r has no prototype, not using it." >&4 ;;
18229 *) srandom_r_proto=0
18233 : see if prototype for setresgid is available
18235 set d_sresgproto setresgid $i_unistd unistd.h
18238 : see if prototype for setresuid is available
18240 set d_sresuproto setresuid $i_unistd unistd.h
18243 : see if sys/stat.h is available
18244 set sys/stat.h i_sysstat
18247 : see if stat knows about block sizes
18249 echo "Checking to see if your struct stat has st_blocks field..." >&4
18250 set d_statblks stat st_blocks $i_sysstat sys/stat.h
18253 : see if this is a sys/vfs.h system
18254 set sys/vfs.h i_sysvfs
18257 : see if this is a sys/statfs.h system
18258 set sys/statfs.h i_sysstatfs
18261 : Check for statfs_s
18263 echo "Checking to see if your system supports struct statfs..." >&4
18264 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
18266 case "$d_statfs_s" in
18267 "$define") echo "Yes, it does." ;;
18268 *) echo "No, it doesn't." ;;
18272 : see if struct statfs knows about f_flags
18273 case "$d_statfs_s" in
18276 echo "Checking to see if your struct statfs has f_flags field..." >&4
18277 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
18281 set d_statfs_f_flags
18285 case "$d_statfs_f_flags" in
18286 "$define") echo "Yes, it does." ;;
18287 *) echo "No, it doesn't." ;;
18290 : see what flavor, if any, of static inline is supported
18292 echo "Checking to see if your system supports static inline..."
18293 $cat > try.c <<'EOCP'
18294 #include <stdlib.h>
18295 extern int f_via_a(int x);
18296 extern int f_via_b(int x);
18297 int main(int argc, char **argv)
18306 return EXIT_SUCCESS;
18309 return EXIT_FAILURE;
18313 $cat > a.c <<'EOCP'
18314 static INLINE int f(int x) {
18325 $cat > b.c <<'EOCP'
18326 extern int f(int x);
18334 # Respect a hint (or previous) value for perl_static_inline, if there is one.
18335 case "$perl_static_inline" in
18336 '') # Check the various possibilities, and break out on success.
18337 # For gcc, prefer __inline__, which will still permit
18338 # cflags.SH to add in -ansi.
18339 case "$gccversion" in
18340 '') xxx="inline __inline__ __inline _inline";;
18341 *) xxx="__inline__ inline __inline _inline";;
18343 for inline in $xxx; do
18344 set try -DINLINE=$inline a.c
18345 if eval $compile && $run ./try; then
18346 # Now make sure there is no external linkage of static
18348 set try -DINLINE=$inline -DUSE_B a.c b.c
18349 if eval $compile && $run ./try; then
18350 $echo "Your compiler supports static $inline, " >&4
18351 $echo "but it also creates an external definition," >&4
18352 $echo "so I won't use it." >&4
18355 $echo "Your compiler supports static $inline." >&4
18357 perl_static_inline="static $inline";
18361 $echo "Your compiler does NOT support static $inline." >&4
18366 *inline*) # Some variant of inline exists.
18367 echo "Keeping your $hint value of $perl_static_inline."
18370 static) # No inline capabilities
18371 echo "Keeping your $hint value of $perl_static_inline."
18374 *) # Unrecognized previous value -- blindly trust the supplied
18375 # value and hope it makes sense. Use old value for
18376 # d_static_inline, if there is one.
18377 echo "Keeping your $hint value of $perl_static_inline."
18378 case "$d_static_inline" in
18380 *) val=$d_static_inline ;;
18384 # Fallback to plain 'static' if nothing worked.
18385 case "$perl_static_inline" in
18387 perl_static_inline="static"
18391 set d_static_inline
18393 $rm -f a.[co] b.[co]
18396 : Check stream access
18398 Checking how to access stdio streams by file descriptor number...
18400 case "$stdio_stream_array" in
18401 '') $cat >try.c <<EOCP
18404 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
18408 for s in _iob __iob __sF
18410 set try -DSTDIO_STREAM_ARRAY=$s
18411 if eval $compile; then
18412 case "`$run ./try`" in
18413 yes) stdio_stream_array=$s; break ;;
18419 case "$stdio_stream_array" in
18421 I can't figure out how to access stdio streams by file descriptor number.
18423 d_stdio_stream_array="$undef"
18426 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
18428 d_stdio_stream_array="$define"
18432 : see if strcoll exists
18433 set strcoll d_strcoll
18436 : check for structure copying
18438 echo "Checking to see if your C compiler can copy structs..." >&4
18439 $cat >try.c <<'EOCP'
18449 if $cc -c try.c >/dev/null 2>&1 ; then
18451 echo "Yup, it can."
18454 echo "Nope, it can't."
18460 : see if strerror and/or sys_errlist[] exist
18462 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
18463 if set strerror val -f d_strerror; eval $csym; $val; then
18464 echo 'strerror() found.' >&4
18465 d_strerror="$define"
18466 d_strerrm='strerror(e)'
18467 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18468 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
18469 d_syserrlst="$define"
18471 echo "(Since you don't have sys_errlist[], strerror() is welcome.)"
18472 d_syserrlst="$undef"
18474 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
18475 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
18476 echo 'strerror() found in string header.' >&4
18477 d_strerror="$define"
18478 d_strerrm='strerror(e)'
18479 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18480 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
18481 d_syserrlst="$define"
18483 echo "(You don't appear to have any sys_errlist[], how can this be?)"
18484 d_syserrlst="$undef"
18486 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18487 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
18488 d_strerror="$undef"
18489 d_syserrlst="$define"
18490 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
18492 echo 'strerror() and sys_errlist[] NOT found.' >&4
18493 d_strerror="$undef"
18494 d_syserrlst="$undef"
18495 d_strerrm='"unknown"'
18499 : see if strerror_r exists
18500 set strerror_r d_strerror_r
18502 case "$d_strerror_r" in
18504 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
18505 case "$d_strerror_r_proto:$usethreads" in
18506 ":define") d_strerror_r_proto=define
18507 set d_strerror_r_proto strerror_r $hdrs
18511 case "$d_strerror_r_proto" in
18513 case "$strerror_r_proto" in
18514 ''|0) try='int strerror_r(int, char*, size_t);'
18515 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBW ;;
18517 case "$strerror_r_proto" in
18518 ''|0) try='int strerror_r(int, char*, int);'
18519 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBI ;;
18521 case "$strerror_r_proto" in
18522 ''|0) try='char* strerror_r(int, char*, size_t);'
18523 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=B_IBW ;;
18525 case "$strerror_r_proto" in
18526 ''|0) d_strerror_r=undef
18528 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
18529 * ) case "$strerror_r_proto" in
18530 REENTRANT_PROTO*) ;;
18531 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
18533 echo "Prototype: $try" ;;
18536 *) case "$usethreads" in
18537 define) echo "strerror_r has no prototype, not using it." >&4 ;;
18544 *) strerror_r_proto=0
18548 : see if strftime exists
18549 set strftime d_strftime
18552 : see if strlcat exists
18553 set strlcat d_strlcat
18556 : see if strlcpy exists
18557 set strlcpy d_strlcpy
18560 : see if strtod exists
18561 set strtod d_strtod
18564 : see if strtol exists
18565 set strtol d_strtol
18568 : see if strtold exists
18569 set strtold d_strtold
18572 : see if strtoll exists
18573 set strtoll d_strtoll
18576 case "$d_longlong-$d_strtoll" in
18579 Checking whether your strtoll() works okay...
18581 $cat >try.c <<'EOCP'
18584 #define strtoll __strtoll
18587 #define strtoll _strtoll
18590 extern long long int strtoll(char *s, char **, int);
18591 static int bad = 0;
18592 int check(char *s, long long ell, int een) {
18595 gll = strtoll(s, 0, 10);
18596 if (!((gll == ell) && (errno == een)))
18600 check(" 1", 1LL, 0);
18601 check(" 0", 0LL, 0);
18602 check("-1", -1LL, 0);
18603 check("-9223372036854775808", -9223372036854775808LL, 0);
18604 check("-9223372036854775808", -9223372036854775808LL, 0);
18605 check(" 9223372036854775807", 9223372036854775807LL, 0);
18606 check("-9223372036854775808", -9223372036854775808LL, 0);
18607 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
18608 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
18614 if eval $compile; then
18617 ok) echo "Your strtoll() seems to be working okay." ;;
18619 Your strtoll() doesn't seem to be working okay.
18625 echo "(I can't seem to compile the test program--assuming it doesn't)"
18631 : see if strtoq exists
18632 set strtoq d_strtoq
18635 : see if strtoul exists
18636 set strtoul d_strtoul
18639 case "$d_strtoul" in
18642 Checking whether your strtoul() works okay...
18644 $cat >try.c <<'EOCP'
18647 extern unsigned long int strtoul(char *s, char **, int);
18648 static int bad = 0;
18649 void check(char *s, unsigned long eul, int een) {
18652 gul = strtoul(s, 0, 10);
18653 if (!((gul == eul) && (errno == een)))
18657 check(" 1", 1L, 0);
18658 check(" 0", 0L, 0);
18660 case "$longsize" in
18662 $cat >>try.c <<'EOCP'
18663 check("18446744073709551615", 18446744073709551615UL, 0);
18664 check("18446744073709551616", 18446744073709551615UL, ERANGE);
18665 #if 0 /* strtoul() for /^-/ strings is undefined. */
18666 check("-1", 18446744073709551615UL, 0);
18667 check("-18446744073709551614", 2, 0);
18668 check("-18446744073709551615", 1, 0);
18669 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
18670 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
18675 $cat >>try.c <<'EOCP'
18676 check("4294967295", 4294967295UL, 0);
18677 check("4294967296", 4294967295UL, ERANGE);
18678 #if 0 /* strtoul() for /^-/ strings is undefined. */
18679 check("-1", 4294967295UL, 0);
18680 check("-4294967294", 2, 0);
18681 check("-4294967295", 1, 0);
18682 check("-4294967296", 4294967295UL, ERANGE);
18683 check("-4294967297", 4294967295UL, ERANGE);
18688 : Should we write these tests to be more portable by sprintf-ing
18689 : ~0 and then manipulating that char string as input for strtol?
18692 $cat >>try.c <<'EOCP'
18699 if eval $compile; then
18700 case "`$run ./try`" in
18701 ok) echo "Your strtoul() seems to be working okay." ;;
18703 Your strtoul() doesn't seem to be working okay.
18709 echo "(I can't seem to compile the test program--assuming it doesn't)"
18715 : see if strtoull exists
18716 set strtoull d_strtoull
18719 case "$d_longlong-$d_strtoull" in
18722 Checking whether your strtoull() works okay...
18724 $cat >try.c <<'EOCP'
18727 #define strtoull __strtoull
18730 extern unsigned long long int strtoull(char *s, char **, int);
18731 static int bad = 0;
18732 int check(char *s, long long eull, int een) {
18735 gull = strtoull(s, 0, 10);
18736 if (!((gull == eull) && (errno == een)))
18740 check(" 1", 1LL, 0);
18741 check(" 0", 0LL, 0);
18742 check("18446744073709551615", 18446744073709551615ULL, 0);
18743 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18744 #if 0 /* strtoull() for /^-/ strings is undefined. */
18745 check("-1", 18446744073709551615ULL, 0);
18746 check("-18446744073709551614", 2LL, 0);
18747 check("-18446744073709551615", 1LL, 0);
18748 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18749 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18756 if eval $compile; then
18757 case "`$run ./try`" in
18758 ok) echo "Your strtoull() seems to be working okay." ;;
18760 Your strtoull() doesn't seem to be working okay.
18762 d_strtoull="$undef"
18766 echo "(I can't seem to compile the test program--assuming it doesn't)"
18767 d_strtoull="$undef"
18772 : see if strtouq exists
18773 set strtouq d_strtouq
18776 case "$d_strtouq" in
18779 Checking whether your strtouq() works okay...
18781 $cat >try.c <<'EOCP'
18784 extern unsigned long long int strtouq(char *s, char **, int);
18785 static int bad = 0;
18786 void check(char *s, unsigned long long eull, int een) {
18787 unsigned long long gull;
18789 gull = strtouq(s, 0, 10);
18790 if (!((gull == eull) && (errno == een)))
18794 check(" 1", 1LL, 0);
18795 check(" 0", 0LL, 0);
18796 check("18446744073709551615", 18446744073709551615ULL, 0);
18797 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18798 #if 0 /* strtouq() for /^-/ strings is undefined. */
18799 check("-1", 18446744073709551615ULL, 0);
18800 check("-18446744073709551614", 2LL, 0);
18801 check("-18446744073709551615", 1LL, 0);
18802 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18803 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18811 if eval $compile; then
18812 case "`$run ./try`" in
18813 ok) echo "Your strtouq() seems to be working okay." ;;
18815 Your strtouq() doesn't seem to be working okay.
18821 echo "(I can't seem to compile the test program--assuming it doesn't)"
18827 : see if strxfrm exists
18828 set strxfrm d_strxfrm
18831 : see if symlink exists
18832 set symlink d_symlink
18835 : see if syscall exists
18836 set syscall d_syscall
18839 : see if prototype for syscall is available
18841 set d_syscallproto syscall $i_unistd unistd.h
18844 : see if sysconf exists
18845 set sysconf d_sysconf
18848 : see if system exists
18849 set system d_system
18852 : see if tcgetpgrp exists
18853 set tcgetpgrp d_tcgetpgrp
18856 : see if tcsetpgrp exists
18857 set tcsetpgrp d_tcsetpgrp
18860 : see if prototype for telldir is available
18862 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
18865 : see if time exists
18867 if test "X$d_time" = X -o X"$timetype" = X; then
18868 if set time val -f d_time; eval $csym; $val; then
18869 echo 'time() found.' >&4
18871 rp="What is the type returned by time() on this system?"
18872 set time_t timetype long stdio.h sys/types.h
18875 echo 'time() not found, hope that will do.' >&4
18883 : see if timegm exists
18884 set timegm d_timegm
18887 : see if this is a sys/times.h system
18888 set sys/times.h i_systimes
18891 : see if times exists
18893 if set times val -f d_times; eval $csym; $val; then
18894 echo 'times() found.' >&4
18897 case "$i_systimes" in
18898 "$define") inc='sys/times.h';;
18900 rp="What is the type returned by times() on this system?"
18901 set clock_t clocktype long stdio.h sys/types.h $inc
18904 echo 'times() NOT found, hope that will do.' >&4
18909 : see if tmpnam_r exists
18910 set tmpnam_r d_tmpnam_r
18912 case "$d_tmpnam_r" in
18914 hdrs="$i_systypes sys/types.h define stdio.h "
18915 case "$d_tmpnam_r_proto:$usethreads" in
18916 ":define") d_tmpnam_r_proto=define
18917 set d_tmpnam_r_proto tmpnam_r $hdrs
18921 case "$d_tmpnam_r_proto" in
18923 case "$tmpnam_r_proto" in
18924 ''|0) try='char* tmpnam_r(char*);'
18925 ./protochk "$extern_C $try" $hdrs && tmpnam_r_proto=B_B ;;
18927 case "$tmpnam_r_proto" in
18928 ''|0) d_tmpnam_r=undef
18930 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
18931 * ) case "$tmpnam_r_proto" in
18932 REENTRANT_PROTO*) ;;
18933 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
18935 echo "Prototype: $try" ;;
18938 *) case "$usethreads" in
18939 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
18946 *) tmpnam_r_proto=0
18950 : see if truncate exists
18951 set truncate d_truncate
18954 : see if ttyname_r exists
18955 set ttyname_r d_ttyname_r
18957 case "$d_ttyname_r" in
18959 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
18960 case "$d_ttyname_r_proto:$usethreads" in
18961 ":define") d_ttyname_r_proto=define
18962 set d_ttyname_r_proto ttyname_r $hdrs
18966 case "$d_ttyname_r_proto" in
18968 case "$ttyname_r_proto" in
18969 ''|0) try='int ttyname_r(int, char*, size_t);'
18970 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBW ;;
18972 case "$ttyname_r_proto" in
18973 ''|0) try='int ttyname_r(int, char*, int);'
18974 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBI ;;
18976 case "$ttyname_r_proto" in
18977 ''|0) try='char* ttyname_r(int, char*, int);'
18978 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=B_IBI ;;
18980 case "$ttyname_r_proto" in
18981 ''|0) d_ttyname_r=undef
18983 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
18984 * ) case "$ttyname_r_proto" in
18985 REENTRANT_PROTO*) ;;
18986 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
18988 echo "Prototype: $try" ;;
18991 *) case "$usethreads" in
18992 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
18999 *) ttyname_r_proto=0
19003 : see if tzname[] exists
19005 if set tzname val -a d_tzname; eval $csym; $val; then
19007 echo 'tzname[] found.' >&4
19010 echo 'tzname[] NOT found.' >&4
19015 : Check if is a multiplatform env
19017 darwin) multiarch="$define" ;;
19019 case "$multiarch" in
19020 ''|[nN]*) multiarch="$undef" ;;
19023 : check for ordering of bytes in a UV
19025 case "$multiarch" in
19028 You seem to be doing a multiarchitecture build,
19029 skipping the byteorder check.
19035 case "$byteorder" in
19038 In the following, larger digits indicate more significance. A big-endian
19039 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
19040 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
19041 machines may have weird orders like 3412. A Cray will report 87654321,
19042 an Alpha will report 12345678. If the test program works the default is
19044 I'm now running the test program...
19048 #$i_stdlib I_STDLIB
19050 #include <stdlib.h>
19052 #include <sys/types.h>
19053 typedef $uvtype UV;
19063 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
19065 u.l = (UV)0x04030201;
19066 for (i = 0; i < $uvsize; i++)
19067 printf("%c", u.c[i]+'0');
19074 if eval $compile && $run ./try > /dev/null; then
19077 [1-4][1-4][1-4][1-4]|12345678|87654321)
19078 echo "(The test program ran ok.)"
19079 echo "byteorder=$dflt"
19082 ????|????????) echo "(The test program ran ok.)" ;;
19083 *) echo "(The test program didn't run right for some reason.)" ;;
19088 (I can't seem to compile the test program. Guessing big-endian...)
19091 case "$xxx_prompt" in
19093 rp="What is the order of bytes in $uvtype?"
19106 : Checking 32bit alignedness
19109 Checking to see whether you can access character data unalignedly...
19111 case "$d_u32align" in
19112 '') $cat >try.c <<EOCP
19114 #$i_stdlib I_STDLIB
19116 #include <stdlib.h>
19118 #define U32 $u32type
19119 #define BYTEORDER 0x$byteorder
19121 #include <signal.h>
19123 $signal_t bletch(int s) { exit(4); }
19126 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
19127 volatile U8 buf[8];
19131 if (sizeof(U32) != 4) {
19132 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
19139 signal(SIGBUS, bletch);
19151 for (i = 0; i < 4; i++) {
19152 up = (U32*)(buf + i);
19153 if (! ((*up == 1 << (8*i)) || /* big-endian */
19154 (*up == 1 << (8*(3-i))) /* little-endian */
19158 printf("read failed (%x)\n", *up);
19164 for (i = 0; i < 4; i++) {
19165 up = (U32*)(buf + i);
19167 if (*up != 0xBeef) {
19168 printf("write failed (%x)\n", *up);
19182 if eval $compile_ok; then
19183 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
19184 $run ./try 2>&1 >/dev/null
19187 You can access character data pretty unalignedly.
19189 d_u32align="$undef"
19192 It seems that you must access character data in an aligned manner.
19194 d_u32align="$define"
19198 rp='Can you access character data at unaligned addresses?'
19202 [yY]*) d_u32align="$undef" ;;
19203 *) d_u32align="$define" ;;
19210 : see if ualarm exists
19211 set ualarm d_ualarm
19214 : see if umask exists
19218 : see if unordered exists
19219 set unordered d_unordered
19222 : see if unsetenv exists
19223 set unsetenv d_unsetenv
19226 : see if usleep exists
19227 set usleep d_usleep
19230 : see if prototype for usleep is available
19232 set d_usleepproto usleep $i_unistd unistd.h
19235 : see if ustat exists
19239 : see if closedir exists
19240 set closedir d_closedir
19243 case "$d_closedir" in
19246 echo "Checking whether closedir() returns a status..." >&4
19248 #$i_dirent I_DIRENT /**/
19249 #$i_sysdir I_SYS_DIR /**/
19250 #$i_sysndir I_SYS_NDIR /**/
19251 #$i_systypes I_SYS_TYPES /**/
19253 #if defined(I_SYS_TYPES)
19254 #include <sys/types.h>
19256 #if defined(I_DIRENT)
19257 #include <dirent.h>
19260 #include <sys/ndir.h>
19264 #include <ndir.h> /* may be wrong in the future */
19266 #include <sys/dir.h>
19271 int main() { return closedir(opendir(".")); }
19274 if eval $compile_ok; then
19275 if $run ./try > /dev/null 2>&1 ; then
19276 echo "Yes, it does."
19279 echo "No, it doesn't."
19283 echo "(I can't seem to compile the test program--assuming it doesn't)"
19291 set d_void_closedir
19295 : see if there is a wait4
19299 : see if waitpid exists
19300 set waitpid d_waitpid
19305 $cat >try.c <<'EOCP'
19311 return (wcscmp (s, s) ? 1 : 0);
19316 if eval $compile; then
19319 0) echo "A working wcscmp() found." >&4
19321 *) echo "wcscmp() found, but it doesn't work" >&4
19325 echo "wcscmp() NOT found." >&4
19331 : see if wcstombs exists
19332 set wcstombs d_wcstombs
19337 $cat >try.c <<'EOCP'
19342 wchar_t dst[4], *src = L" ";
19344 return (wcsxfrm (dst, src, 1) ? errno ? errno : 0 : 1);
19349 if eval $compile; then
19352 0) echo "A working wcsxfrm() found." >&4
19354 *) echo "wcsxfrm() found, but it doesn't work" >&4
19358 echo "wcsxfrm() NOT found." >&4
19364 : see if wctomb exists
19365 set wctomb d_wctomb
19368 : see if writev exists
19369 set writev d_writev
19372 : check for alignment requirements
19374 case "$alignbytes" in
19375 '') echo "Checking alignment constraints..." >&4
19376 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
19377 $cat >try.c <<'EOCP'
19378 typedef long double NV;
19381 $cat >try.c <<'EOCP'
19385 $cat >>try.c <<'EOCP'
19393 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
19398 if eval $compile_ok; then
19402 echo "(I can't seem to compile the test program...)"
19404 case "$multiarch" in
19406 : The usual safe value is 8, but Darwin with -Duselongdouble
19407 : needs 16. Hence, we will take 8 as a minimum, but allow
19408 : Configure to pick a larger value if needed.
19409 if $test "$dflt" -lt 8; then
19411 echo "Setting alignment to 8 for multiarch support.">&4
19416 *) dflt="$alignbytes"
19419 rp="Doubles must be aligned on a how-many-byte boundary?"
19424 : set the base revision
19427 : length of character in bytes. Is always 1, otherwise it is not C
19428 : This used to be a test using sizeof
19431 : Check for the number of bits in a character
19432 case "$charbits" in
19433 '') echo "Checking how long a character is (in bits)..." >&4
19440 for (c = 1, n = 0; c; c <<= 1, n++) ;
19441 printf ("%d\n", n);
19446 if eval $compile_ok; then
19450 echo "(I can't seem to compile the test program. Guessing...)"
19457 rp="What is the length of a character (in bits)?"
19461 case "$charbits" in
19464 Your system has an unsigned character size of $charbits bits, which
19465 is rather unusual (normally it is 8 bits). Perl likely will not work
19466 correctly on your system, with subtle bugs in various places.
19468 rp='Do you really want to continue?'
19472 [yY]) echo >&4 "Okay, continuing." ;;
19477 : how do we concatenate cpp tokens here?
19479 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
19480 $cat >cpp_stuff.c <<'EOCP'
19481 #define RCAT(a,b)a/**/b
19482 #define ACAT(a,b)a ## b
19486 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
19487 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
19488 echo "Oh! Smells like ANSI's been here." >&4
19489 echo "We can catify or stringify, separately or together!"
19491 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
19492 echo "Ah, yes! The good old days!" >&4
19493 echo "However, in the good old days we don't know how to stringify and"
19494 echo "catify at the same time."
19498 Hmm, I don't seem to be able to concatenate tokens with your cpp.
19499 You're going to have to edit the values of CAT[2-5] in config.h...
19501 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
19505 : see if this is a db.h system
19511 : Check db version.
19513 echo "Checking Berkeley DB version ..." >&4
19519 #include <sys/types.h>
19521 #$i_stdlib I_STDLIB
19523 #include <stdlib.h>
19526 int main(int argc, char *argv[])
19528 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
19529 int Major, Minor, Patch ;
19530 unsigned long Version ;
19531 (void)db_version(&Major, &Minor, &Patch) ;
19533 printf("%d %d %d %d %d %d\n",
19534 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
19535 Major, Minor, Patch);
19538 printf("You have Berkeley DB Version 2 or greater.\n");
19540 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
19541 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
19542 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
19543 Major, Minor, Patch) ;
19545 /* check that db.h & libdb are compatible */
19546 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
19547 printf("db.h and libdb are incompatible.\n") ;
19551 printf("db.h and libdb are compatible.\n") ;
19553 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
19554 + DB_VERSION_PATCH ;
19556 /* needs to be >= 2.3.4 */
19557 if (Version < 2003004) {
19558 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
19559 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
19565 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
19570 printf("You have Berkeley DB Version 1.\n");
19571 exit(0); /* DB version < 2: the coast is clear. */
19573 exit(1); /* <db.h> not Berkeley DB? */
19579 if eval $compile_ok && $run ./try; then
19580 echo 'Looks OK.' >&4
19582 db_version_major=$1
19583 db_version_minor=$2
19584 db_version_patch=$3
19586 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
19590 : Remove db from list of libraries to use
19591 echo "Removing unusable -ldb from library list" >&4
19592 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
19595 echo "libs = $libs" >&4
19605 : Check the return type needed for hash
19607 echo "Checking return type needed for hash for Berkeley DB ..." >&4
19613 #include <sys/types.h>
19616 #ifndef DB_VERSION_MAJOR
19617 u_int32_t hash_cb (const void* ptr, size_t size)
19623 info.hash = hash_cb;
19627 if $cc $ccflags -c try.c >try.out 2>&1 ; then
19628 if $contains warning try.out >>/dev/null 2>&1 ; then
19631 db_hashtype='u_int32_t'
19634 : XXX Maybe we should just give up here.
19635 db_hashtype=u_int32_t
19637 echo "Help: I can't seem to compile the db test program." >&4
19638 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
19641 echo "Your version of Berkeley DB uses $db_hashtype for hash."
19643 *) db_hashtype=u_int32_t
19648 : Check the return type needed for prefix
19650 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
19656 #include <sys/types.h>
19659 #ifndef DB_VERSION_MAJOR
19660 size_t prefix_cb (const DBT *key1, const DBT *key2)
19666 info.prefix = prefix_cb;
19670 if $cc $ccflags -c try.c >try.out 2>&1 ; then
19671 if $contains warning try.out >>/dev/null 2>&1 ; then
19672 db_prefixtype='int'
19674 db_prefixtype='size_t'
19677 db_prefixtype='size_t'
19678 : XXX Maybe we should just give up here.
19680 echo "Help: I can't seem to compile the db test program." >&4
19681 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
19684 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
19686 *) db_prefixtype='size_t'
19690 : How can we generate normalized random numbers ?
19692 echo "Using our internal random number implementation..." >&4
19695 *-Dmy_rand=*|*-Dmy_srand=*)
19696 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
19697 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
19698 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
19699 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
19703 randfunc=Perl_drand48
19704 drand01="Perl_drand48()"
19705 seedfunc="Perl_drand48_init"
19709 : Determine if this is an EBCDIC system
19711 echo "Determining whether or not we are on an EBCDIC system..." >&4
19712 $cat >try.c <<'EOM'
19715 if ('M'==0xd4) return 0;
19722 if eval $compile_ok; then
19723 if $run ./try; then
19724 echo "You seem to speak EBCDIC." >&4
19727 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
19730 echo "I'm unable to compile the test program." >&4
19731 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
19737 : Check how to flush
19740 Checking how to flush all pending stdio output...
19742 # I only know how to find the first 32 possibly open files on SunOS.
19743 # See also hints/sunos_4_1.sh and util.c --AD
19745 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
19747 $cat >>try.c <<EOCP
19749 #$i_stdlib I_STDLIB
19751 #include <stdlib.h>
19753 #$i_unistd I_UNISTD
19755 # include <unistd.h>
19757 #$d_sysconf HAS_SYSCONF
19758 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
19759 #ifdef HAS_STDIO_STREAM_ARRAY
19760 # define STDIO_STREAM_ARRAY $stdio_stream_array
19765 p = fopen("try.out", "w");
19769 # ifdef TRY_FPRINTF
19773 #ifdef TRY_FFLUSH_NULL
19776 #ifdef TRY_FFLUSH_ALL
19778 long open_max = -1;
19779 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
19780 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
19782 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
19783 open_max = sysconf(_SC_OPEN_MAX);
19786 open_max = FOPEN_MAX;
19789 open_max = OPEN_MAX;
19798 # ifdef HAS_STDIO_STREAM_ARRAY
19799 if (open_max > 0) {
19801 for (i = 0; i < open_max; i++)
19802 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
19803 STDIO_STREAM_ARRAY[i]._file < open_max &&
19804 STDIO_STREAM_ARRAY[i]._flag)
19805 fflush(&STDIO_STREAM_ARRAY[i]);
19813 : first we have to find out how _not_ to flush
19815 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
19817 set try -DTRY_FPUTC
19818 if eval $compile; then
19819 $run ./try 2>/dev/null
19822 if $test ! -s try.out -a "X$code" = X42; then
19828 set try -DTRY_FPRINTF
19829 if eval $compile; then
19830 $run ./try 2>/dev/null
19833 if $test ! -s try.out -a "X$code" = X42; then
19834 output=-DTRY_FPRINTF
19840 : check for fflush NULL behavior
19841 case "$fflushNULL" in
19842 '') set try -DTRY_FFLUSH_NULL $output
19843 if eval $compile; then
19844 $run ./try 2>/dev/null
19847 if $test -s try.out -a "X$code" = X42; then
19848 fflushNULL="`$cat try.out`"
19850 if $test "X$code" != X42; then
19852 (If this test failed, don't worry, we'll try another method shortly.)
19857 $rm -f core try.core core.try.*
19858 case "$fflushNULL" in
19860 Your fflush(NULL) works okay for output streams.
19861 Let's see if it clobbers input pipes...
19863 # As of mid-March 2000 all versions of Solaris appear to have a stdio
19864 # bug that improperly flushes the input end of pipes. So we avoid the
19865 # autoflush on fork/system/exec support for now. :-(
19866 $cat >tryp.c <<EOCP
19869 main(int argc, char **argv)
19875 while ((i = getc(stdin)) != -1
19876 && (*bp++ = i) != '\n'
19877 && bp < &buf[1024])
19880 fprintf(stdout, "%s", buf);
19888 fflushNULL="$define"
19890 if eval $compile; then
19892 # Copy the .c file to the remote host ($to is an ssh-alike if targethost is set)
19893 if $test "X$targethost" != X; then
19896 $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
19898 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19900 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19902 fflush(NULL) seems to behave okay with input streams.
19904 fflushNULL="$define"
19907 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
19909 fflushNULL="$undef"
19912 $rm -f core tryp.c tryp.core core.tryp.*
19915 Your fflush(NULL) isn't working (contrary to ANSI C).
19917 fflushNULL="$undef"
19920 Cannot figure out whether your fflush(NULL) works or not.
19921 I'm assuming it doesn't (contrary to ANSI C).
19923 fflushNULL="$undef"
19927 $define|true|[yY]*)
19928 fflushNULL="$define"
19931 fflushNULL="$undef"
19934 : check explicit looping only if NULL did not work, and if the pipe
19935 : bug does not show up on an explicit flush too
19936 case "$fflushNULL" in
19938 $cat >tryp.c <<EOCP
19941 main(int argc, char **argv)
19947 while ((i = getc(stdin)) != -1
19948 && (*bp++ = i) != '\n'
19949 && bp < &buf[1024])
19952 fprintf(stdout, "%s", buf);
19961 if eval $compile; then
19963 if $test "X$targethost" != X; then
19966 $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
19968 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19970 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19972 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
19974 : now check for fflushall behaviour
19975 case "$fflushall" in
19976 '') set try -DTRY_FFLUSH_ALL $output
19977 if eval $compile; then
19979 (Now testing the other method--but note that this also may fail.)
19981 $run ./try 2>/dev/null
19984 if $test -s try.out -a "X$code" = X42; then
19985 fflushall="`$cat try.out`"
19989 case "$fflushall" in
19991 Whew. Flushing explicitly all the stdio streams works.
19993 fflushall="$define"
19996 Sigh. Flushing explicitly all the stdio streams doesn't work.
20001 Cannot figure out whether flushing stdio streams explicitly works or not.
20002 I'm assuming it doesn't.
20008 "$define"|true|[yY]*)
20009 fflushall="$define"
20017 All is futile. Even fflush(stdin) clobbers input pipes!
20024 $rm -f core tryp.c tryp.core core.tryp.*
20026 *) fflushall="$undef"
20030 case "$fflushNULL$fflushall" in
20033 OK, I give up. I cannot figure out how to flush pending stdio output.
20034 We won't be flushing handles at all before fork/exec/popen.
20040 : Store the full pathname to the ar program for use in the C program
20041 : Respect a hint or command line value for full_ar.
20046 : Store the full pathname to the sed program for use in the C program
20049 : see what type gids are declared as in the kernel
20051 echo "Looking for the type for group ids returned by getgid()."
20052 set gid_t gidtype xxx stdio.h sys/types.h
20056 xxx=`./findhdr sys/user.h`
20057 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
20059 unsigned) dflt="$1 $2" ;;
20063 *) dflt="$gidtype";;
20066 gid_t) echo "gid_t found." ;;
20067 *) rp="What is the type for group ids returned by getgid()?"
20073 : Check the size of GID
20076 *_t) zzz="$gidtype" ;;
20079 echo "Checking the size of $zzz..." >&4
20081 #include <sys/types.h>
20083 #$i_stdlib I_STDLIB
20085 #include <stdlib.h>
20088 printf("%d\n", (int)sizeof($gidtype));
20093 if eval $compile_ok; then
20097 echo "(I can't execute the test program--guessing $gidsize.)" >&4
20100 echo "Your $zzz is $gidsize bytes long."
20105 echo "(I can't compile the test program--guessing $gidsize.)" >&4
20109 : Check if GID is signed
20112 *_t) zzz="$gidtype" ;;
20115 echo "Checking the sign of $zzz..." >&4
20117 #include <sys/types.h>
20128 if eval $compile; then
20132 echo "(I can't execute the test program--guessing unsigned.)" >&4
20136 1) echo "Your $zzz is unsigned." ;;
20137 -1) echo "Your $zzz is signed." ;;
20143 echo "(I can't compile the test program--guessing unsigned.)" >&4
20147 : Check 64bit sizes
20150 if $test X"$quadtype" != X; then
20152 echo "Checking how to print 64-bit integers..." >&4
20154 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
20155 $cat >try.c <<'EOCP'
20156 #include <sys/types.h>
20159 int q = 12345678901;
20160 printf("%ld\n", q);
20164 if eval $compile; then
20168 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
20169 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
20170 echo "We will use %d."
20176 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
20177 $cat >try.c <<'EOCP'
20178 #include <sys/types.h>
20181 long q = 12345678901;
20182 printf("%ld\n", q);
20186 if eval $compile; then
20190 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
20191 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
20192 echo "We will use %ld."
20198 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
20199 $cat >try.c <<'EOCP'
20200 #include <sys/types.h>
20201 #include <inttypes.h>
20204 int64_t q = 12345678901;
20205 printf("%" PRId64 "\n", q);
20209 if eval $compile; then
20213 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
20214 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
20215 echo "We will use the C9X style."
20221 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
20223 #include <sys/types.h>
20226 $quadtype q = 12345678901;
20227 printf("%Ld\n", q);
20231 if eval $compile; then
20235 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
20236 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
20237 echo "We will use %Ld."
20243 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
20244 $cat >try.c <<'EOCP'
20245 #include <sys/types.h>
20248 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
20249 printf("%lld\n", q);
20253 if eval $compile; then
20257 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
20258 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
20259 echo "We will use the %lld style."
20265 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
20267 #include <sys/types.h>
20270 $quadtype q = 12345678901;
20271 printf("%qd\n", q);
20275 if eval $compile; then
20279 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
20280 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
20281 echo "We will use %qd."
20287 if $test X"$sPRId64" = X; then
20288 echo "Cannot figure out how to print 64-bit integers." >&4
20295 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
20296 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
20298 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
20299 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
20303 : Check format strings for internal types
20305 $echo "Checking the format strings to be used for Perl's internal types..." >&4
20307 if $test X"$ivsize" = X8; then
20308 ivdformat="$sPRId64"
20309 uvuformat="$sPRIu64"
20310 uvoformat="$sPRIo64"
20311 uvxformat="$sPRIx64"
20312 uvXUformat="$sPRIXU64"
20314 if $test X"$ivsize" = X"$longsize"; then
20321 if $test X"$ivsize" = X"$intsize"; then
20329 if $test X"$ivsize" = X"$shortsize"; then
20340 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
20341 nveformat="$sPRIeldbl"
20342 nvfformat="$sPRIfldbl"
20343 nvgformat="$sPRIgldbl"
20344 nvEUformat="$sPRIEUldbl"
20345 nvFUformat="$sPRIFUldbl"
20346 nvGUformat="$sPRIGUldbl"
20356 case "$ivdformat" in
20357 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
20362 : Check format string for GID
20365 $echo "Checking the format string to be used for gids..." >&4
20368 -1) if $test X"$gidsize" = X"$ivsize"; then
20369 gidformat="$ivdformat"
20371 if $test X"$gidsize" = X"$longsize"; then
20374 if $test X"$gidsize" = X"$intsize"; then
20377 if $test X"$gidsize" = X"$shortsize"; then
20384 *) if $test X"$gidsize" = X"$uvsize"; then
20385 gidformat="$uvuformat"
20387 if $test X"$gidsize" = X"$longsize"; then
20390 if $test X"$gidsize" = X"$intsize"; then
20393 if $test X"$gidsize" = X"$shortsize"; then
20402 : see if getgroups exists
20403 set getgroups d_getgrps
20406 : see if setgroups exists
20407 set setgroups d_setgrps
20410 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
20412 case "$d_getgrps$d_setgrps" in
20414 case "$groupstype" in
20415 '') dflt="$gidtype" ;;
20416 *) dflt="$groupstype" ;;
20419 What type of pointer is the second argument to getgroups() and setgroups()?
20420 Usually this is the same as group ids, $gidtype, but not always.
20423 rp='What type pointer is the second argument to getgroups() and setgroups()?'
20427 *) groupstype="$gidtype";;
20430 : check whether make sets MAKE
20432 echo "Checking if your $make program sets \$(MAKE)..." >&4
20433 case "$make_set_make" in
20435 $sed 's/^X //' > testmake.mak << 'EOF'
20437 X @echo 'maketemp="$(MAKE)"'
20439 case "`$make -f testmake.mak 2>/dev/null`" in
20440 *maketemp=*) make_set_make='#' ;;
20441 *) make_set_make="MAKE=$make" ;;
20443 $rm -f testmake.mak
20446 case "$make_set_make" in
20447 '#') echo "Yup, it does.";;
20448 *) echo "Nope, it doesn't.";;
20451 : see what type is used for mode_t
20452 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
20453 set mode_t modetype int stdio.h sys/types.h
20456 : see if we need va_copy
20458 case "$i_stdarg" in
20461 #include <stdarg.h>
20463 #$i_stdlib I_STDLIB
20465 #include <stdlib.h>
20467 #include <signal.h>
20470 ivfprintf(FILE *f, const char *fmt, va_list *valp)
20472 return vfprintf(f, fmt, *valp);
20476 myvfprintf(FILE *f, const char *fmt, va_list val)
20478 return ivfprintf(f, fmt, &val);
20482 myprintf(char *fmt, ...)
20485 va_start(val, fmt);
20486 return myvfprintf(stdout, fmt, val);
20490 main(int ac, char **av)
20492 signal(SIGSEGV, exit);
20494 myprintf("%s%cs all right, then\n", "that", '\'');
20499 if eval $compile && $run ./try 2>&1 >/dev/null; then
20500 case "`$run ./try`" in
20501 "that's all right, then")
20507 yes) echo "It seems that you don't need va_copy()." >&4
20508 need_va_copy="$undef"
20510 *) echo "It seems that va_copy() or similar will be needed." >&4
20511 need_va_copy="$define"
20516 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
20517 need_va_copy="$undef"
20521 : see what type is used for size_t
20522 rp="What is the type used for the length parameter for string functions?"
20523 set size_t sizetype 'unsigned int' stdio.h sys/types.h
20526 : check for type of arguments to gethostbyaddr.
20527 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
20528 case "$d_gethbyaddr" in
20532 Checking to see what type of arguments are accepted by gethostbyaddr().
20534 hdrs="$define sys/types.h
20535 $d_socket sys/socket.h
20536 $i_niin netinet/in.h
20538 $i_unistd unistd.h"
20539 : The first arg can 'char *' or 'void *'
20540 : The second arg is some of integral type
20541 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
20542 for yyy in size_t long int; do
20543 case "$netdb_host_type" in
20544 '') try="$extern_C struct hostent *gethostbyaddr($xxx, $yyy, int);"
20545 if ./protochk "$try" $hdrs; then
20546 echo "Your system accepts $xxx for the first arg."
20547 echo "...and $yyy for the second arg."
20548 netdb_host_type="$xxx"
20549 netdb_hlen_type="$yyy"
20555 : In case none of those worked, prompt the user.
20556 case "$netdb_host_type" in
20557 '') rp='What is the type for the 1st argument to gethostbyaddr?'
20560 netdb_host_type=$ans
20561 rp='What is the type for the 2nd argument to gethostbyaddr?'
20564 netdb_hlen_type=$ans
20568 *) : no gethostbyaddr, so pick harmless defaults
20569 netdb_host_type='char *'
20570 netdb_hlen_type="$sizetype"
20573 # Remove the "const" if needed. -- but then we'll have a
20575 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
20578 : check for type of argument to gethostbyname.
20579 if test "X$netdb_name_type" = X ; then
20580 case "$d_gethbyname" in
20584 Checking to see what type of argument is accepted by gethostbyname().
20586 hdrs="$define sys/types.h
20587 $d_socket sys/socket.h
20588 $i_niin netinet/in.h
20590 $i_unistd unistd.h"
20591 for xxx in "const char *" "char *"; do
20592 case "$netdb_name_type" in
20593 '') try="$extern_C struct hostent *gethostbyname($xxx);"
20594 if ./protochk "$try" $hdrs; then
20595 echo "Your system accepts $xxx."
20596 netdb_name_type="$xxx"
20601 : In case none of those worked, prompt the user.
20602 case "$netdb_name_type" in
20603 '') rp='What is the type for the 1st argument to gethostbyname?'
20606 netdb_name_type=$ans
20610 *) : no gethostbyname, so pick harmless default
20611 netdb_name_type='char *'
20616 : check for type of 1st argument to getnetbyaddr.
20617 if test "X$netdb_net_type" = X ; then
20618 case "$d_getnbyaddr" in
20622 Checking to see what type of 1st argument is accepted by getnetbyaddr().
20624 hdrs="$define sys/types.h
20625 $d_socket sys/socket.h
20626 $i_niin netinet/in.h
20628 $i_unistd unistd.h"
20629 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
20630 case "$netdb_net_type" in
20631 '') try="$extern_C struct netent *getnetbyaddr($xxx, int);"
20632 if ./protochk "$try" $hdrs; then
20633 echo "Your system accepts $xxx."
20634 netdb_net_type="$xxx"
20639 : In case none of those worked, prompt the user.
20640 case "$netdb_net_type" in
20641 '') rp='What is the type for the 1st argument to getnetbyaddr?'
20644 netdb_net_type=$ans
20648 *) : no getnetbyaddr, so pick harmless default
20649 netdb_net_type='long'
20653 : locate the preferred pager for this system
20660 [a-zA-Z]:/*) dflt=$pg;;
20664 [a-zA-Z]:/*) dflt=$more;;
20668 [a-zA-Z]:/*) dflt=$less;;
20671 '') dflt=/usr/ucb/more;;
20679 rp='What pager is used on your system?'
20683 : see what type pids are declared as in the kernel
20684 rp="What is the type of process ids on this system?"
20685 set pid_t pidtype int stdio.h sys/types.h
20688 : see if ar generates random libraries by itself
20690 echo "Checking how to generate random libraries on your machine..." >&4
20691 echo 'int bar1() { return bar2(); }' > bar1.c
20692 echo 'int bar2() { return 2; }' > bar2.c
20694 #$i_stdlib I_STDLIB
20696 #include <stdlib.h>
20698 int main() { printf("%d\n", bar1()); exit(0); }
20700 $cc $ccflags -c bar1.c >/dev/null 2>&1
20701 $cc $ccflags -c bar2.c >/dev/null 2>&1
20702 $cc $ccflags -c foo.c >/dev/null 2>&1
20703 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
20704 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20705 $run ./foobar >/dev/null 2>&1; then
20706 echo "$ar appears to generate random libraries itself."
20708 if [ "X$ranlib" = "X" ]; then
20711 elif $ar s bar$_a >/dev/null 2>&1 &&
20712 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20713 $run ./foobar >/dev/null 2>&1; then
20714 echo "a table of contents needs to be added with '$ar s'."
20717 elif $ar ts bar$_a >/dev/null 2>&1 &&
20718 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20719 $run ./foobar >/dev/null 2>&1; then
20720 echo "a table of contents needs to be added with '$ar ts'."
20727 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
20728 $test -f $ranlib || ranlib=''
20731 if $test -n "$ranlib"; then
20732 echo "your system has '$ranlib'; we'll use that."
20735 echo "your system doesn't seem to support random libraries"
20736 echo "so we'll use lorder and tsort to order the libraries."
20743 : see if this is a values.h system
20744 set values.h i_values
20747 : Check the max offset that gmtime and localtime accept
20748 echo "Checking max offsets that gmtime () accepts"
20751 define) yyy="#include <values.h>" ;;
20755 case "$sGMTIME_min/$sGMTIME_max" in
20758 #include <sys/types.h>
20767 void gm_check (time_t t, int min_year, int max_year)
20770 if ( tmp == NULL ||
20771 /* Check tm_year overflow */
20772 tmp->tm_year < min_year || tmp->tm_year > max_year)
20783 gm_check (MAXLONG, 69, 0x7fffffff);
20785 if (tmp == NULL || tmp->tm_year < 0) {
20786 for (i = 63; i >= 0; i--) {
20787 time_t x = pt | ((time_t)1 << i);
20788 if (x < 0 || x < pt) continue;
20789 gm_check (x, 69, 0x7fffffff);
20792 printf ("sGMTIME_max=%ld\n", pt);
20801 gm_check (MINLONG, -1900, 70);
20804 for (i = 36; i >= 0; i--) {
20805 time_t x = pt - ((time_t)1 << i);
20806 if (x > 0) continue;
20807 gm_check (x, -1900, 70);
20810 printf ("sGMTIME_min=%ld\n", pt);
20814 int main (int argc, char *argv[])
20816 fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t));
20823 if eval $compile; then
20826 echo "Cannot determine sGMTIME_max and sGMTIME_min." >&4
20832 echo "Checking max offsets that localtime () accepts"
20834 case "$sLOCALTIME_min/$sLOCALTIME_max" in
20837 #include <sys/types.h>
20846 void local_check (time_t t, int min_year, int max_year)
20848 if (sizeof (time_t) > 4 && t > 0x7ffffffffffff000LL)
20851 tmp = localtime (&t);
20852 if ( tmp == NULL ||
20853 /* Check tm_year overflow */
20854 tmp->tm_year < min_year || tmp->tm_year > max_year)
20858 } /* local_check */
20865 local_check (MAXLONG, 69, 0x7fffffff);
20867 if (tmp == NULL || tmp->tm_year < 0) {
20868 for (i = 63; i >= 0; i--) {
20869 time_t x = pt | ((time_t)1 << i);
20870 if (x < 0 || x < pt) continue;
20871 local_check (x, 69, 0x7fffffff);
20874 printf ("sLOCALTIME_max=%ld\n", pt);
20883 local_check (MINLONG, -1900, 70);
20886 for (i = 36; i >= 0; i--) {
20887 time_t x = pt - ((time_t)1 << i);
20888 if (x > 0) continue;
20889 local_check (x, -1900, 70);
20892 printf ("sLOCALTIME_min=%ld\n", pt);
20896 int main (int argc, char *argv[])
20904 if eval $compile; then
20907 echo "Cannot determine sLOCALTIME_max and sLOCALTIME_min." >&4
20913 : check for type of arguments to select.
20914 case "$selecttype" in
20915 '') case "$d_select" in
20919 Checking to see what type of arguments are accepted by select().
20921 hdrs="$define sys/types.h
20922 $i_systime sys/time.h
20923 $i_sysselct sys/select.h
20924 $d_socket sys/socket.h"
20925 : The first arg can be int, unsigned, or size_t
20926 : The last arg may or may not be 'const'
20928 : void pointer has been seen but using that
20929 : breaks the selectminbits test
20930 for xxx in 'fd_set *' 'int *'; do
20931 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
20932 for tmo in 'struct timeval *' 'const struct timeval *'; do
20934 '') try="$extern_C select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
20935 if ./protochk "$try" $hdrs; then
20936 echo "Your system accepts $xxx."
20945 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
20946 case "$d_fd_set" in
20947 $define) dflt="fd_set *" ;;
20956 *) : no select, so pick a harmless default
20963 : check for the select 'width'
20964 case "$selectminbits" in
20965 '') safebits=`expr $ptrsize \* 8`
20966 case "$d_select" in
20970 Checking to see on how many bits at a time your select() operates...
20973 #include <sys/types.h>
20975 #$i_systime I_SYS_TIME
20976 #$i_systimek I_SYS_TIME_KERNEL
20981 # ifdef I_SYS_TIME_KERNEL
20984 # include <sys/time.h>
20985 # ifdef I_SYS_TIME_KERNEL
20989 #$i_sysselct I_SYS_SELECT
20990 #ifdef I_SYS_SELECT
20991 #include <sys/select.h>
20993 #$d_socket HAS_SOCKET
20995 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
20998 #$i_stdlib I_STDLIB
21000 #include <stdlib.h>
21003 #define S sizeof(*(b))
21005 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
21006 #define NBITS (NBYTES * 8)
21008 char *s = (char *)malloc(NBYTES);
21017 fp = fopen("try.c", "r");
21023 b = ($selecttype)s;
21024 for (i = 0; i < NBITS; i++)
21028 select(fd + 1, b, 0, 0, &t);
21029 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
21031 printf("%d\n", i + 1);
21036 if eval $compile_ok; then
21037 selectminbits=`$run ./try`
21038 case "$selectminbits" in
21040 Cannot figure out on how many bits at a time your select() operates.
21041 I'll play safe and guess it is $safebits bits.
21043 selectminbits=$safebits
21044 bits="$safebits bits"
21047 *) bits="$selectminbits bits" ;;
21049 echo "Your select() operates on $bits at a time." >&4
21051 rp='What is the minimum number of bits your select() operates on?'
21052 case "$byteorder" in
21053 12345678) dflt=64 ;;
21059 selectminbits="$val"
21063 *) : no select, so pick a harmless default
21064 selectminbits=$safebits
21070 : Trace out the files included by signal.h, then look for SIGxxx names.
21071 if [ "X$fieldn" = X ]; then
21072 : Just make some guesses. We check them later.
21073 xxx="$sysroot/usr/include/signal.h $sysroot/usr/include/sys/signal.h"
21075 xxx=`echo '#include <signal.h>' |
21076 $cppstdin $cppminus $cppflags 2>/dev/null |
21077 $grep '^[ ]*#.*include' |
21078 $awk "{print \\$$fieldn}" | $sed 's!"!!g' |\
21079 $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
21082 for xx in $xxx /dev/null ; do
21083 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
21085 case "$xxxfiles" in
21086 '') xxxfiles=`./findhdr signal.h` ;;
21089 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
21090 print substr($2, 4, 20)
21092 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
21093 print substr($3, 4, 20)
21095 : Append some common names just in case the awk scan failed.
21096 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
21097 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
21098 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
21099 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
21100 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
21102 : generate a few handy files for later
21103 $cat > signal.c <<EOCP
21104 #include <sys/types.h>
21105 #include <signal.h>
21106 #$i_stdlib I_STDLIB
21108 #include <stdlib.h>
21113 /* Strange style to avoid deeply-nested #if/#else/#endif */
21116 # define NSIG (_NSIG)
21122 # define NSIG (SIGMAX+1)
21128 # define NSIG (SIG_MAX+1)
21134 # define NSIG (_SIG_MAX+1)
21140 # define NSIG (MAXSIG+1)
21146 # define NSIG (MAX_SIG+1)
21151 # ifdef SIGARRAYSIZE
21152 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
21158 # define NSIG (_sys_nsig) /* Solaris 2.5 */
21162 /* Default to some arbitrary number that's big enough to get most
21163 of the common signals.
21169 printf("NSIG %d\n", NSIG);
21175 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
21177 printf "#ifdef SIG"; printf $1; printf "\n"
21178 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
21179 printf $1; printf ");\n"
21183 printf "#endif /* JUST_NSIG */\n";
21184 printf "exit(0);\n}\n";
21187 $cat >signal.awk <<'EOP'
21188 BEGIN { ndups = 0 }
21189 $1 ~ /^NSIG$/ { nsig = $2 }
21190 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
21191 if ($2 > maxsig) { maxsig = $2 }
21192 if (sig_name[$2]) {
21193 dup_name[ndups] = $1
21194 dup_num[ndups] = $2
21206 printf("NSIG %d\n", nsig);
21207 for (n = 1; n < nsig; n++) {
21209 printf("%s %d\n", sig_name[n], sig_num[n])
21212 printf("NUM%d %d\n", n, n)
21215 for (n = 0; n < ndups; n++) {
21216 printf("%s %d\n", dup_name[n], dup_num[n])
21220 $cat >signal_cmd <<EOS
21222 if $test -s signal.lst; then
21223 echo "Using your existing signal.lst file"
21228 $cat >>signal_cmd <<'EOS'
21231 if eval $compile_ok; then
21232 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) |\
21233 $uniq | $awk -f signal.awk >signal.lst
21235 echo "(I can't seem be able to compile the whole test program)" >&4
21236 echo "(I'll try it in little pieces.)" >&4
21237 set signal -DJUST_NSIG
21238 if eval $compile_ok; then
21239 $run ./signal$_exe > signal.nsg
21242 echo "I can't seem to figure out how many signals you have." >&4
21243 echo "Guessing 50." >&4
21244 echo 'NSIG 50' > signal.nsg
21246 : Now look at all the signal names, one at a time.
21247 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
21248 $cat > signal.c <<EOCP
21249 #include <sys/types.h>
21250 #include <signal.h>
21253 printf("$xx %d\n", SIG${xx});
21258 if eval $compile; then
21259 echo "SIG${xx} found."
21260 $run ./signal$_exe >> signal.ls1
21262 echo "SIG${xx} NOT found."
21265 if $test -s signal.ls1; then
21266 $cat signal.nsg signal.ls1 |
21267 $sort -n | $uniq | $awk -f signal.awk >signal.lst
21271 if $test -s signal.lst; then
21274 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
21275 echo 'kill -l' >signal
21276 set X `csh -f <signal`
21280 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
21282 echo $@ | $tr ' ' $trnl | \
21283 $awk '{ printf "%s %d\n", $1, ++s; }
21284 END { printf "NSIG %d\n", ++s }' >signal.lst
21286 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
21288 chmod a+x signal_cmd
21289 $eunicefix signal_cmd
21291 : generate list of signal names
21293 case "$sig_name_init" in
21295 *) case "$sig_num_init" in
21296 ''|*,*) doinit=yes ;;
21301 echo "Generating a list of signal names and numbers..." >&4
21303 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
21304 sig_name=`$awk 'BEGIN { printf "ZERO " }
21305 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
21306 sig_num=`$awk 'BEGIN { printf "0 " }
21307 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
21308 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
21309 !/^NSIG/ { printf "\"%s\", ", $1 }
21310 END { printf "0\n" }' signal.lst`
21311 sig_num_init=`$awk 'BEGIN { printf "0, " }
21312 !/^NSIG/ { printf "%d, ", $2}
21313 END { printf "0\n"}' signal.lst`
21316 echo "The following $sig_count signals are available:"
21318 echo $sig_name | $awk \
21319 'BEGIN { linelen = 0 }
21321 for (i = 1; i <= NF; i++) {
21322 name = "SIG" $i " "
21323 linelen = linelen + length(name)
21324 if (linelen > 70) {
21326 linelen = length(name)
21332 sig_size=`echo $sig_name | awk '{print NF}'`
21333 $rm -f signal signal.c signal.awk signal.lst signal_cmd
21335 : Check size of size
21337 case "$sizetype" in
21338 *_t) zzz="$sizetype" ;;
21339 *) zzz="filesize" ;;
21341 echo "Checking the size of $zzz..." >&4
21343 #include <sys/types.h>
21345 #$i_stdlib I_STDLIB
21347 #include <stdlib.h>
21350 printf("%d\n", (int)sizeof($sizetype));
21355 if eval $compile_ok; then
21359 echo "(I can't execute the test program--guessing $sizesize.)" >&4
21362 echo "Your $zzz size is $sizesize bytes."
21367 echo "(I can't compile the test program--guessing $sizesize.)" >&4
21371 : check for socklen_t
21373 echo "Checking to see if you have socklen_t..." >&4
21375 #include <sys/types.h>
21376 #$d_socket HAS_SOCKET
21378 #include <sys/socket.h>
21380 int main() { socklen_t x = 16; }
21383 if eval $compile; then
21385 echo "You have socklen_t."
21388 echo "You do not have socklen_t."
21389 case "$sizetype" in
21390 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
21397 : see if this is a socks.h system
21398 set socks.h i_socks
21401 : check for type of the size argument to socket calls
21402 case "$d_socket" in
21406 Checking to see what type is the last argument of accept().
21409 case "$d_socklen_t" in
21410 "$define") yyy="$yyy socklen_t"
21412 yyy="$yyy $sizetype int long unsigned"
21413 for xxx in $yyy; do
21414 case "$socksizetype" in
21415 '') try="$extern_C int accept(int, struct sockaddr *, $xxx *);"
21416 case "$usesocks" in
21418 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
21419 echo "Your system accepts '$xxx *' for the last argument of accept()."
21420 socksizetype="$xxx"
21423 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
21424 echo "Your system accepts '$xxx *' for the last argument of accept()."
21425 socksizetype="$xxx"
21432 : In case none of those worked, prompt the user.
21433 case "$socksizetype" in
21434 '') rp='What is the type for socket address structure sizes?'
21441 *) : no sockets, so pick relatively harmless default
21446 : see what type is used for signed size_t
21447 set ssize_t ssizetype int stdio.h sys/types.h
21452 #$i_stdlib I_STDLIB
21454 #include <stdlib.h>
21456 #include <sys/types.h>
21457 #define Size_t $sizetype
21458 #define SSize_t $dflt
21461 if (sizeof(Size_t) == sizeof(SSize_t))
21463 else if (sizeof(Size_t) == sizeof(int))
21472 if eval $compile_ok && $run ./try > /dev/null; then
21473 ssizetype=`$run ./try`
21474 echo "I'll be using $ssizetype for functions returning a byte count." >&4
21477 Help! I can't compile and run the ssize_t test program: please enlighten me!
21478 (This is probably a misconfiguration in your system or libraries, and
21479 you really ought to fix it. Still, I'll try anyway.)
21481 I need a type that is the same size as $sizetype, but is guaranteed to
21482 be signed. Common values are ssize_t, int and long.
21485 rp="What signed type is the same size as $sizetype?"
21491 : Check the size of st_ino
21493 $echo "Checking the size of st_ino..." >&4
21494 $cat > try.c <<EOCP
21495 #include <sys/stat.h>
21497 #$i_stdlib I_STDLIB
21499 #include <stdlib.h>
21503 printf("%d\n", (int)sizeof(st.st_ino));
21508 if eval $compile_ok; then
21512 $echo "(I can't execute the test program--guessing $st_ino_size.)" >&4
21514 *) st_ino_size=$val
21515 $echo "Your st_ino is $st_ino_size bytes long."
21520 $echo "(I can't compile the test program--guessing $st_ino_size.)" >&4
21524 : Check if st_ino is signed
21526 $echo "Checking the sign of st_ino..." >&4
21527 $cat > try.c <<EOCP
21528 #include <sys/stat.h>
21533 if (foo.st_ino < 0)
21540 if eval $compile; then
21544 $echo "(I can't execute the test program--guessing unsigned.)" >&4
21546 *) st_ino_sign=$val
21547 case "$st_ino_sign" in
21548 1) $echo "Your st_ino is unsigned." ;;
21549 -1) $echo "Your st_ino is signed." ;;
21555 $echo "(I can't compile the test program--guessing unsigned.)" >&4
21559 : see what type of char stdio uses.
21561 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
21562 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
21563 echo "Your stdio uses unsigned chars." >&4
21564 stdchar="unsigned char"
21566 echo "Your stdio uses signed chars." >&4
21571 : see what type uids are declared as in the kernel
21573 echo "Looking for the type for user ids returned by getuid()."
21574 set uid_t uidtype xxx stdio.h sys/types.h
21578 xxx=`./findhdr sys/user.h`
21579 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
21581 unsigned) dflt="$1 $2" ;;
21585 *) dflt="$uidtype";;
21588 uid_t) echo "uid_t found." ;;
21589 *) rp="What is the type for user ids returned by getuid()?"
21595 : Check size of UID
21598 *_t) zzz="$uidtype" ;;
21601 echo "Checking the size of $zzz..." >&4
21603 #include <sys/types.h>
21605 #$i_stdlib I_STDLIB
21607 #include <stdlib.h>
21610 printf("%d\n", (int)sizeof($uidtype));
21615 if eval $compile_ok; then
21619 echo "(I can't execute the test program--guessing $uidsize.)" >&4
21622 echo "Your $zzz is $uidsize bytes long."
21627 echo "(I can't compile the test program--guessing $uidsize.)" >&4
21630 : Check if UID is signed
21633 *_t) zzz="$uidtype" ;;
21636 echo "Checking the sign of $zzz..." >&4
21638 #include <sys/types.h>
21649 if eval $compile; then
21653 echo "(I can't execute the test program--guessing unsigned.)" >&4
21657 1) echo "Your $zzz is unsigned." ;;
21658 -1) echo "Your $zzz is signed." ;;
21664 echo "(I can't compile the test program--guessing unsigned.)" >&4
21668 : Check format string for UID
21670 $echo "Checking the format string to be used for uids..." >&4
21673 -1) if $test X"$uidsize" = X"$ivsize"; then
21674 uidformat="$ivdformat"
21676 if $test X"$uidsize" = X"$longsize"; then
21679 if $test X"$uidsize" = X"$intsize"; then
21682 if $test X"$uidsize" = X"$shortsize"; then
21689 *) if $test X"$uidsize" = X"$uvsize"; then
21690 uidformat="$uvuformat"
21692 if $test X"$uidsize" = X"$longsize"; then
21695 if $test X"$uidsize" = X"$intsize"; then
21698 if $test X"$uidsize" = X"$shortsize"; then
21707 : Determine if we can use sysctl with KERN_PROC_PATHNAME to find executing program
21709 echo "Determining whether we can use sysctl with KERN_PROC_PATHNAME to find executing program..." >&4
21710 $cat >try.c <<'EOM'
21711 /* Intentionally a long probe as I'd like to sanity check that the exact
21712 approach is going to work, as thinking it will work, but only having it
21713 part working at runtime is worse than not having it. */
21715 #include <sys/types.h>
21716 #include <sys/sysctl.h>
21717 #include <sys/param.h>
21719 #include <string.h>
21720 #include <stdlib.h>
21721 #include <unistd.h>
21724 main(int argc, char **argv) {
21726 char *argv_leaf = strrchr(argv[0], '/');
21732 mib[1] = KERN_PROC;
21733 mib[2] = KERN_PROC_PATHNAME;
21737 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
21741 if (sysctl(mib, 4, NULL, &size, NULL, 0)) {
21746 if (size < strlen(argv_leaf) + 1) {
21747 fprintf(stderr, "size %lu is too short for a path\n",
21748 (unsigned long) size);
21752 if (size > MAXPATHLEN * MAXPATHLEN) {
21753 fprintf(stderr, "size %lu is too long for a path\n",
21754 (unsigned long) size);
21758 buffer = malloc(size);
21764 if (sysctl(mib, 4, buffer, &size, NULL, 0)) {
21769 if (strlen(buffer) + 1 != size) {
21770 fprintf(stderr, "size != strlen(buffer) + 1 (%lu != %lu)\n",
21771 (unsigned long)size, (unsigned long)strlen(buffer) + 1);
21776 if (*buffer != '/') {
21777 fprintf(stderr, "Not an absolute path: '%s'\n", buffer);
21781 if (strstr(buffer, "/./")) {
21782 fprintf(stderr, "Contains /./: '%s'\n", buffer);
21786 if (strstr(buffer, "/../")) {
21787 fprintf(stderr, "Contains /../: '%s'\n", buffer);
21791 buffer_leaf = strrchr(buffer, '/');
21792 if (strcmp(buffer_leaf, argv_leaf) != 0) {
21793 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], buffer);
21805 if eval $compile; then
21806 if $run ./try; then
21807 echo "You can use sysctl with KERN_PROC_PATHNAME to find the executing program." >&4
21810 echo "Nope, sysctl with KERN_PROC_PATHNAME doesn't work here." >&4
21814 echo "I'm unable to compile the test program." >&4
21815 echo "I'll assume no sysctl with KERN_PROC_PATHNAME here." >&4
21819 set usekernprocpathname
21822 : Determine if we can use _NSGetExecutablePath to find executing program
21824 echo "Determining whether we can use _NSGetExecutablePath to find executing program..." >&4
21825 $cat >try.c <<'EOM'
21826 /* Intentionally a long probe as I'd like to sanity check that the exact
21827 approach is going to work, as thinking it will work, but only having it
21828 part working at runtime is worse than not having it. */
21829 #include <mach-o/dyld.h>
21831 #include <stdlib.h>
21832 #include <sys/param.h>
21833 #include <string.h>
21836 main(int argc, char **argv) {
21838 uint32_t size = sizeof(buf);
21842 char *argv_leaf = strrchr(argv[0], '/');
21846 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
21850 _NSGetExecutablePath(buf, &size);
21851 if (size > MAXPATHLEN * MAXPATHLEN) {
21852 fprintf(stderr, "_NSGetExecutablePath size %u is too long for a path\n",
21853 (unsigned int) size);
21857 buffer = malloc(size);
21863 result = _NSGetExecutablePath(buffer, &size);
21865 fprintf(stderr, "_NSGetExecutablePath returned %i for a size of %u\n",
21866 result, (unsigned int) size);
21870 tidied = realpath(buffer, NULL);
21872 perror("realpath");
21878 if (*tidied != '/') {
21879 fprintf(stderr, "Not an absolute path: '%s'\n", tidied);
21883 if (strstr(tidied, "/./")) {
21884 fprintf(stderr, "Contains /./: '%s'\n", tidied);
21888 if (strstr(tidied, "/../")) {
21889 fprintf(stderr, "Contains /../: '%s'\n", tidied);
21893 tidied_leaf = strrchr(tidied, '/');
21894 if (strcmp(tidied_leaf, argv_leaf) != 0) {
21895 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], tidied);
21907 if eval $compile; then
21908 if $run ./try; then
21909 echo "You can use _NSGetExecutablePath to find the executing program." >&4
21912 echo "Nope, _NSGetExecutablePath doesn't work here." >&4
21915 echo "I'm unable to compile the test program." >&4
21916 echo "I'll assume no _NSGetExecutablePath here." >&4
21919 set usensgetexecutablepath
21922 : Check if site customization support was requested
21923 case "$usesitecustomize" in
21924 $define|true|[Yy]*)
21925 usesitecustomize="$define"
21928 usesitecustomize="$undef"
21932 : see if prototypes support variable argument declarations
21934 case "$prototype$i_stdarg" in
21936 echo "It appears we'll be able to prototype varargs functions." >&4
21940 echo "Too bad... We won't be using prototyped varargs functions..." >&4
21947 : determine compiler compiler
21956 if $test -f "$byacc$_exe"; then
21958 comp="byacc or $comp"
21960 if $test -f "$bison$_exe"; then
21961 comp="$comp or bison -y"
21963 rp="Which compiler compiler ($comp) shall I use?"
21972 echo "(Adding -y option to bison to get yacc-compatible behavior.)"
21978 : see if this is a assert.h system
21979 set assert.h i_assert
21982 : see if this is a bfd.h system
21986 : see if this is an execinfo.h system
21987 set execinfo.h i_execinfo
21990 : see if this is a fp.h system
21994 : see if this is a fp_class.h system
21995 set fp_class.h i_fp_class
21998 : see if gdbm.h is available
22003 : see if gdbm_open exists
22004 set gdbm_open d_gdbm_open
22006 case "$d_gdbm_open" in
22009 echo "We won't be including <gdbm.h>"
22018 : see if this is a ieeefp.h system
22019 case "$i_ieeefp" in
22020 '' ) set ieeefp.h i_ieeefp
22025 : see if this is a libutil.h system
22026 set libutil.h i_libutil
22029 : see if mach cthreads are available
22030 if test "X$usethreads" = "X$define"; then
22031 set mach/cthreads.h i_machcthr
22034 i_machcthr="$undef"
22037 : see if this is a mntent.h system
22038 set mntent.h i_mntent
22041 : see if net/errno.h is available
22043 set net/errno.h val
22046 : Unfortunately, it causes problems on some systems. Arrgh.
22049 cat > try.c <<'EOM'
22052 #include <net/errno.h>
22058 if $cc $ccflags -c try.c >/dev/null 2>&1; then
22059 echo "We'll be including <net/errno.h>." >&4
22061 echo "We won't be including <net/errno.h>." >&4
22070 : see if netinet/tcp.h is available
22071 set netinet/tcp.h i_netinettcp
22074 : see if this is a poll.h system
22078 : see if this is a prot.h system
22082 : Preprocessor symbols
22084 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
22085 $cat <<'EOSH' > Cppsym.know
22086 a29k aarch64 ABI64 aegis AES_SOURCE AIX AIX32 AIX370 AIX41 AIX42
22087 AIX43 aixpc AIX_SOURCE alliant ALL_SOURCE alpha AM29000 am29000
22088 AMD64 amd64 amiga AMIGAOS AMIX ansi ANSI_C_SOURCE apollo arch_ppc
22089 arch_pwr ardent ARM ARM32 atarist att386 att3b
22090 BeOS BIG_ENDIAN BIT_MSF BSD bsd bsd43 bsd4_2 BSD4_3 bsd4_3 bsd4_4
22091 BSDCOMPAT bsdi BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES bull
22092 byteorder byte_order
22093 c cadmus clang clipper CMU COFF COMPILER_VERSION concurrent
22094 convex cpu CRAY cray CRAYMPP ctix CX_UX CYGWIN
22095 DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO Dynix DynixPTX
22096 ELF encore EPI EXTENSIONS
22097 FAVOR_BSD FILE_OFFSET_BITS FORTIFY_SOURCE FreeBSD
22098 GCC_NEW_VARARGS gcos gcx gimpel GLIBC GLIBC_MINOR GNUC GNUC_MINOR
22099 GNU_LIBRARY GNU_SOURCE GO32 gould GOULD_PN
22100 H3050R H3050RX hbullx20 hcx host_mips hp200 hp300 HP700 hp700
22101 hp800 hp9000 hp9000s200 hp9000s300 hp9000s400 hp9000s500
22102 hp9000s700 hp9000s800 hp9k8 hppa hpux HPUX_SOURCE hp_osf
22103 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960 IA32 IA64
22104 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
22105 INLINE_INTRINSICS INT64 INTEL interdata INTRINSICS is68k itanium
22107 LANGUAGE_C LARGEFILE64_SOURCE LARGEFILE_SOURCE LARGE_FILE_API
22108 LFS64_LARGEFILE LFS_LARGEFILE LIBCATAMOUNT Linux LITTLE_ENDIAN
22109 LONG64 LONGDOUBLE LONGLONG LONG_DOUBLE LONG_LONG LP64 luna
22111 M68000 m68k m88100 m88k M88KBCS_TARGET MACH machine MachTen
22112 MATH_HAS_NO_SIDE_EFFECTS mc300 mc500 mc68000 mc68010 mc68020
22113 mc68030 mc68040 mc68060 mc68k mc68k32 mc700 mc88000 mc88100
22114 merlin mert MiNT mips MIPSEB MIPSEL MIPS_FPSET MIPS_ISA MIPS_SIM
22115 MIPS_SZINT MIPS_SZLONG MIPS_SZPTR MODERN_C motorola mpeix MSDOS
22116 MTXINU MULTIMAX MVS mvs M_AMD64 M_ARM M_ARMT M_COFF M_I186 M_I286
22117 M_I386 M_I8086 M_I86 M_I86SM M_IA64 M_IX86 M_PPC M_SYS3 M_SYS5
22118 M_SYSIII M_SYSV M_UNIX M_X86 M_XENIX
22119 n16 ncl_el ncl_mr NetBSD news1500 news1700 news1800 news1900
22120 news3700 news700 news800 news900 NeXT NLS nonstopux ns16000
22121 ns32000 ns32016 ns32332 ns32k nsc32000
22122 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
22123 PARAGON parisc pa_risc PA_RISC1_1 PA_RISC2_0 pc532 pdp11 PGC PIC
22124 plexus PORTAR posix POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
22125 POSIX_C_SOURCE POSIX_SOURCE POWER powerpc ppc PROTOTYPES PWB pyr
22127 R3000 REENTRANT RES Rhapsody RISC6000 riscix riscos RT
22128 S390 S390x SA110 SCO scs sequent sgi SGI_SOURCE SH SH3 sinix
22129 SIZE_INT SIZE_LONG SIZE_PTR SOCKETS_SOURCE SOCKET_SOURCE sony
22130 sonyrisc sony_news sparc sparclite sparcv8 sparcv9 spectrum
22131 stardent stdc STDC_EXT stratos sun sun3 sun386 Sun386i svr3 svr4
22132 SVR4_2 SVR4_SOURCE svr5 SX system SYSTYPE_BSD SYSTYPE_BSD43
22133 SYSTYPE_BSD44 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3
22134 SYSV4 SYSV5 sysV68 sysV88
22135 Tek4132 Tek4300 thumb thw_370 thw_intel thw_rs6000 titan TM3200
22136 TM5400 TM5600 tower tower32 tower32_200 tower32_600 tower32_700
22137 tower32_800 tower32_850 tss
22138 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5 ultrix UMAXV UnicomPBB
22139 UnicomPBD UNICOS UNICOSMK unix UNIX95 UNIX99 unixpc unos USE_BSD
22140 USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE
22141 USE_LARGEFILE64 USE_MISC USE_POSIX USE_POSIX199309
22142 USE_POSIX199506 USE_POSIX2 USE_REENTRANT USE_SVID USE_UNIX98
22143 USE_XOPEN USE_XOPEN_EXTENDED USGr4 USGr4_2 UTek Utek UTS UWIN
22145 vax venix VMESA vms
22146 x86_64 xenix Xenix286 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2
22147 XPG2_EXTENDED XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
22150 # Maybe put other stuff here too.
22151 ./tr '-' '_' <<EOSH >>Cppsym.know
22154 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
22155 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
22156 $cat Cppsym.know > Cppsym.c
22157 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
22158 $rm -f Cppsym.a Cppsym.b Cppsym.c
22159 cat <<EOSH > Cppsym
22161 if $test \$# -gt 0; then
22162 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
22163 if $test -s Cppsym.got; then
22170 $tr " " "$trnl" | ./Cppsym.try
22176 cat <<EOSH > Cppsym.try
22178 cat <<'EOCP' > try.c
22181 #define STRINGIFY(a) "a"
22183 #if cpp_stuff == 42
22184 #define StGiFy(a) #a
22185 #define STRINGIFY(a) StGiFy(a)
22187 #if $cpp_stuff != 1 && $cpp_stuff != 42
22188 # include "Bletch: How does this C preprocessor stringify macros?"
22194 cat <<'EOSH' >> Cppsym.try
22196 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
22197 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
22198 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
22199 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
22201 echo 'return 0;}' >> try.c
22203 cat <<EOSH >> Cppsym.try
22205 case "$osname-$gccversion" in
22206 irix-) ccflags="\$ccflags -woff 1178" ;;
22207 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
22209 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
22211 chmod +x Cppsym.try
22212 $eunicefix Cppsym.try
22213 ./Cppsym < Cppsym.know | $sort | $uniq > Cppsym.true
22214 : Add in any Linux cpp "predefined macros":
22215 case "$osname::$gccversion" in
22216 *linux*::*.*|*gnukfreebsd*::*.*|gnu::*.*)
22218 rm -f $tHdrH'.h' $tHdrH
22220 # Filter out macro arguments, such as Linux's __INT8_C(c)
22221 if $cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
22222 sed -e 's/#define[\ \ ]*//;s/[\ \ ].*$//' -e 's/(.*//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
22223 if [ -s $tHdrH'_cppsym.real' ]; then
22224 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
22227 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
22230 : now check the C compiler for additional symbols
22231 postprocess_cc_v=''
22233 aix) postprocess_cc_v="|$tr , ' '" ;;
22240 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
22243 -D*) echo "\$i" | $sed 's/^-D//';;
22244 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
22249 postprocess_cc_v=''
22252 ./ccsym > ccsym1.raw
22253 if $test -s ccsym1.raw; then
22254 $sort ccsym1.raw | $uniq >ccsym.raw
22256 mv ccsym1.raw ccsym.raw
22259 $awk '/\=/ { print $0; next }
22260 { print $0"=1" }' ccsym.raw >ccsym.list
22261 $comm -13 Cppsym.true ccsym.list >ccsym.own
22262 $comm -12 Cppsym.true ccsym.list >ccsym.com
22263 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
22265 if $test -z ccsym.raw; then
22266 echo "Your C compiler doesn't seem to define any symbols!" >&4
22268 echo "However, your C preprocessor defines the following symbols:"
22271 cppsymbols=`$cat Cppsym.true`
22272 cppsymbols=`echo $cppsymbols`
22273 cppccsymbols="$cppsymbols"
22275 if $test -s ccsym.com; then
22276 echo "Your C compiler and pre-processor define these symbols:"
22277 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
22280 cppccsymbols=`$cat ccsym.com`
22281 cppccsymbols=`echo $cppccsymbols`
22282 $test "$silent" || sleep 1
22284 if $test -s ccsym.cpp; then
22285 $test "$also" && echo " "
22286 echo "Your C pre-processor ${also}defines the following symbols:"
22287 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
22289 cppsymbols=`$cat ccsym.cpp`
22290 cppsymbols=`echo $cppsymbols`
22291 $test "$silent" || sleep 1
22293 if $test -s ccsym.own; then
22294 $test "$also" && echo " "
22295 echo "Your C compiler ${also}defines the following cpp symbols:"
22296 $sed -e 's/\(..*\)=1/\1/' ccsym.own
22297 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
22298 ccsymbols=`$cat ccsym.own`
22299 ccsymbols=`echo $ccsymbols`
22300 $test "$silent" || sleep 1
22304 : add -D_FORTIFY_SOURCE if feasible and not already there
22305 case "$gccversion" in
22306 4.*) case "$optimize$ccflags" in
22307 *-O*) case "$ccflags$cppsymbols" in
22308 *_FORTIFY_SOURCE=*) # Don't add it again.
22309 echo "You seem to have -D_FORTIFY_SOURCE already, not adding it." >&4
22311 *) echo "Adding -D_FORTIFY_SOURCE=2 to ccflags..." >&4
22312 ccflags="$ccflags -D_FORTIFY_SOURCE=2"
22316 *) echo "You have gcc 4.* but not optimizing, not adding -D_FORTIFY_SOURCE." >&4
22320 *) echo "You seem not to have gcc 4.*, not adding -D_FORTIFY_SOURCE." >&4
22324 : see if this is a termio system
22328 if $test `./findhdr termios.h`; then
22329 set tcsetattr i_termios
22335 "$define") echo "You have POSIX termios.h... good!" >&4;;
22336 *) if ./Cppsym pyr; then
22337 case "`$run /bin/universe`" in
22338 ucb) if $test `./findhdr sgtty.h`; then
22340 echo "<sgtty.h> found." >&4
22342 echo "System is pyramid with BSD universe."
22343 ./warn "<sgtty.h> not found--you could have problems."
22345 *) if $test `./findhdr termio.h`; then
22347 echo "<termio.h> found." >&4
22349 echo "System is pyramid with USG universe."
22350 ./warn "<termio.h> not found--you could have problems."
22354 if $test `./findhdr termio.h`; then
22355 echo "<termio.h> found." >&4
22357 elif $test `./findhdr sgtty.h`; then
22358 echo "<sgtty.h> found." >&4
22361 ./warn "Neither <termio.h> nor <sgtty.h> found--cross fingers!"
22364 if $test `./findhdr sgtty.h`; then
22365 echo "<sgtty.h> found." >&4
22367 elif $test `./findhdr termio.h`; then
22368 echo "<termio.h> found." >&4
22371 ./warn "Neither <sgtty.h> nor <termio.h> found--cross fingers!"
22375 set i_termio; eval $setvar
22376 val=$val2; set i_sgtty; eval $setvar
22377 val=$val3; set i_termios; eval $setvar
22379 : see if stdbool is available
22380 : we want a real compile instead of Inhdr because some Solaris systems
22381 : have stdbool.h, but it can only be used if the compiler indicates it
22382 : is sufficiently c99-compliant.
22386 #include <stdbool.h>
22391 int main(int argc, char **argv)
22397 if eval $compile; then
22398 echo "<stdbool.h> found." >&4
22401 echo "<stdbool.h> NOT found." >&4
22408 : see if stddef is available
22409 set stddef.h i_stddef
22412 : see if sys/access.h is available
22413 set sys/access.h i_sysaccess
22416 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
22417 set sys/filio.h i_sysfilio
22420 if $test `./findhdr sys/ioctl.h`; then
22422 echo '<sys/ioctl.h> found.' >&4
22425 if $test $i_sysfilio = "$define"; then
22426 echo '<sys/ioctl.h> NOT found.' >&4
22428 $test $i_sgtty = "$define" && xxx="sgtty.h"
22429 $test $i_termio = "$define" && xxx="termio.h"
22430 $test $i_termios = "$define" && xxx="termios.h"
22431 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
22437 : see if socket ioctl defs are in sys/sockio.h
22439 xxx=`./findhdr sys/sockio.h`
22440 if $test "$xxx"; then
22441 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
22443 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
22446 echo "No socket ioctls found in <sys/sockio.h>." >&4
22451 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
22457 : see if this is a syslog.h system
22458 set syslog.h i_syslog
22461 : see if this is a sys/mode.h system
22462 set sys/mode.h i_sysmode
22465 : see if there is a sys/poll.h file
22466 set sys/poll.h i_syspoll
22469 : see if sys/resource.h has to be included
22470 set sys/resource.h i_sysresrc
22473 : see if sys/security.h is available
22474 set sys/security.h i_syssecrt
22477 : see if this is a sys/statvfs.h system
22478 set sys/statvfs.h i_sysstatvfs
22481 : see if this is a sys/un.h system
22482 set sys/un.h i_sysun
22485 : see if this is a sys/utsname.h system
22486 set sys/utsname.h i_sysutsname
22489 : see if this is a syswait system
22490 set sys/wait.h i_syswait
22493 : see if this is a ustat.h system
22494 set ustat.h i_ustat
22497 : see if this is an utime system
22498 set utime.h i_utime
22501 : see if this is a vfork system
22504 set vfork.h i_vfork
22514 echo "Looking for extensions..." >&4
22515 : If we are using the old config.sh, nonxs_extensions and xs_extensions may
22516 : contain old or inaccurate or duplicate values.
22517 nonxs_extensions=''
22519 : We do not use find because it might not be available.
22520 : We do not just use MANIFEST because the user may have dropped
22521 : some additional extensions into the source tree and expect them
22524 : Function to recursively find available extensions, ignoring DynaLoader
22525 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
22526 : In 5.10.1 and later, extensions are stored in directories
22527 : like File-Glob instead of the older File/Glob/.
22531 DynaLoader|dynaload) ;;
22533 this_ext=`echo $xxx | $sed -e s/-/\\\//g`;
22534 case "$this_ext" in
22535 Scalar/List/Utils) this_ext="List/Util" ;;
22536 PathTools) this_ext="Cwd" ;;
22538 echo " $xs_extensions $nonxs_extensions" > $tdir/$$.tmp;
22539 if $contains " $this_ext " $tdir/$$.tmp; then
22541 echo "Duplicate directories detected for extension $xxx" >&4;
22542 echo "Configure cannot correctly recover from this - shall I abort?" >&4;
22543 case "$knowitall" in
22551 echo "Ok. Stopping Configure." >&4;
22552 echo "Please remove the duplicate directory (e.g. using git clean) and then re-run Configure" >&4;
22555 echo "Ok. You will need to correct config.sh before running make." >&4;
22557 $ls -1 $xxx > $tdir/$$.tmp;
22558 if $contains "\.xs$" $tdir/$$.tmp > /dev/null 2>&1; then
22559 xs_extensions="$xs_extensions $this_ext";
22560 elif $contains "\.c$" $tdir/$$.tmp > /dev/null 2>&1; then
22561 xs_extensions="$xs_extensions $this_ext";
22562 elif $test -d $xxx; then
22563 nonxs_extensions="$nonxs_extensions $this_ext";
22565 $rm -f $tdir/$$.tmp;
22573 eval $find_extensions
22577 eval $find_extensions
22581 eval $find_extensions
22582 set X $xs_extensions
22584 xs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
22585 set X $nonxs_extensions
22587 nonxs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
22589 known_extensions=`echo $nonxs_extensions $xs_extensions | tr ' ' $trnl | $sort | tr $trnl ' '`
22591 : Now see which are supported on this system.
22593 for xxx in $xs_extensions ; do
22597 $define) avail_ext="$avail_ext $xxx" ;;
22600 GDBM_File|gdbm_fil)
22602 $define) avail_ext="$avail_ext $xxx" ;;
22605 I18N/Langinfo|i18n_lan)
22606 case "$i_langinfo$d_nl_langinfo" in
22607 $define$define) avail_ext="$avail_ext $xxx" ;;
22611 : XXX Do we need a useipcsysv variable here
22612 case "${d_msg}${d_sem}${d_shm}" in
22613 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
22616 NDBM_File|ndbm_fil)
22619 case "$osname-$use64bitint" in
22622 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
22625 *) avail_ext="$avail_ext $xxx" ;;
22630 ODBM_File|odbm_fil)
22631 case "${i_dbm}${i_rpcsvcdbm}" in
22633 case "$d_cplusplus" in
22634 define) ;; # delete as a function name will not work
22635 *) case "$osname-$use64bitint" in
22638 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
22641 *) avail_ext="$avail_ext $xxx" ;;
22649 case "$useopcode" in
22650 true|define|y) avail_ext="$avail_ext $xxx" ;;
22654 case "$useposix" in
22655 true|define|y) avail_ext="$avail_ext $xxx" ;;
22659 case "$d_socket" in
22660 true|$define|y) avail_ext="$avail_ext $xxx" ;;
22663 Sys/Syslog|sys/syslog)
22664 : XXX syslog requires socket
22665 case "$d_socket" in
22666 true|$define|y) avail_ext="$avail_ext $xxx" ;;
22670 case "$usethreads" in
22672 case "$use5005threads" in
22673 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
22677 threads|threads/shared)
22678 # threads and threads::shared are special cases.
22679 # To stop people from asking "Perl 5.8.0 was supposed
22680 # to have this new fancy threads implementation but my
22681 # perl doesn't have it" and from people trying to
22682 # (re)install the threads module using CPAN.pm and
22683 # CPAN.pm then offering to reinstall Perl 5.8.0,
22684 # the threads.pm and threads/shared.pm will always be
22685 # there, croaking informatively ("you need to rebuild
22686 # all of Perl with threads, sorry") when threads haven't
22687 # been compiled in.
22689 avail_ext="$avail_ext $xxx"
22695 cygwin) avail_ext="$avail_ext $xxx" ;;
22698 XS/APItest|xs/apitest)
22699 # This is just for testing. Skip it unless we have dynamic loading.
22702 $define) avail_ext="$avail_ext $xxx" ;;
22705 XS/Typemap|xs/typemap)
22706 # This is just for testing. Skip it unless we have dynamic loading.
22708 $define) avail_ext="$avail_ext $xxx" ;;
22711 *) avail_ext="$avail_ext $xxx"
22720 case "$onlyextensions" in
22722 *) keepextensions=''
22723 echo "You have requested that only certain extensions be included..." >&4
22724 for i in $onlyextensions; do
22725 case " $avail_ext " in
22727 echo "Keeping extension $i."
22728 keepextensions="$keepextensions $i"
22730 *) echo "Ignoring extension $i." ;;
22733 avail_ext="$keepextensions"
22737 case "$noextensions" in
22739 *) keepextensions=''
22740 echo "You have requested that certain extensions be ignored..." >&4
22741 for i in $avail_ext; do
22742 case " $noextensions " in
22743 *" $i "*) echo "Ignoring extension $i." ;;
22744 *) echo "Keeping extension $i.";
22745 keepextensions="$keepextensions $i"
22749 avail_ext="$keepextensions"
22753 : Now see which nonxs extensions are supported on this system.
22754 : For now assume all are.
22756 for xxx in $nonxs_extensions ; do
22760 *) nonxs_ext="$nonxs_ext $xxx"
22772 A number of extensions are supplied with $package. You may choose to
22773 compile these extensions for dynamic loading (the default), compile
22774 them into the $package executable (static loading), or not include
22775 them at all. Answer "none" to include no extensions.
22776 Note that DynaLoader is always built and need not be mentioned here.
22779 case "$dynamic_ext" in
22781 : Exclude those listed in static_ext
22783 for xxx in $avail_ext; do
22784 case " $static_ext " in
22786 *) dflt="$dflt $xxx" ;;
22793 *) dflt="$dynamic_ext"
22794 # Perhaps we are reusing an old out-of-date config.sh.
22797 if test X"$dynamic_ext" != X"$avail_ext"; then
22799 NOTICE: Your previous config.sh list may be incorrect.
22800 The extensions now available to you are
22802 but the default list from your previous config.sh is
22814 rp="What extensions do you wish to load dynamically?"
22817 none) dynamic_ext=' ' ;;
22818 *) dynamic_ext="$ans" ;;
22821 case "$static_ext" in
22823 : Exclude those already listed in dynamic linking
22825 for xxx in $avail_ext; do
22826 case " $dynamic_ext " in
22828 *) dflt="$dflt $xxx" ;;
22835 *) dflt="$static_ext"
22842 rp="What extensions do you wish to load statically?"
22845 none) static_ext=' ' ;;
22846 *) static_ext="$ans" ;;
22851 A number of extensions are supplied with $package. Answer "none"
22852 to include no extensions.
22853 Note that DynaLoader is always built and need not be mentioned here.
22856 case "$static_ext" in
22857 '') dflt="$avail_ext" ;;
22858 *) dflt="$static_ext"
22859 # Perhaps we are reusing an old out-of-date config.sh.
22862 if test X"$static_ext" != X"$avail_ext"; then
22864 NOTICE: Your previous config.sh list may be incorrect.
22865 The extensions now available to you are
22867 but the default list from your previous config.sh is
22876 : Exclude those that are not xs extensions
22880 rp="What extensions do you wish to include?"
22883 none) static_ext=' ' ;;
22884 *) static_ext="$ans" ;;
22889 # Encode is a special case. If we are building Encode as a static
22890 # extension, we need to explicitly list its subextensions as well.
22891 # For other nested extensions, this is handled automatically by
22892 # the appropriate Makefile.PL.
22893 case " $static_ext " in
22894 *" Encode "*) # Add the subextensions of Encode
22896 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
22897 static_ext="$static_ext Encode/$xxx"
22898 known_extensions="$known_extensions Encode/$xxx"
22904 set X $dynamic_ext $static_ext $nonxs_ext
22908 # Sanity check: We require an extension suitable for use with
22909 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
22910 # should show up as failures in the test suite, but it's helpful to
22911 # catch them now.) The 'extensions' list is normally sorted
22912 # alphabetically, so we need to accept either
22913 # DB_File ... Fcntl ... IO ....
22914 # or something like
22915 # Fcntl ... NDBM_File ... IO ....
22916 case " $extensions" in
22917 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
22918 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
22919 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
22920 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
22921 echo "WARNING: The Perl you are building will be quite crippled." >& 4
22925 : Remove libraries needed only for extensions
22926 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
22927 : The exception is SunOS 4.x, which needs them.
22928 case "${osname}X${osvers}" in
22932 *) case "$usedl" in
22933 $define|true|[yY]*)
22934 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
22938 *) perllibs="$libs"
22944 : Remove build directory name from cppstdin so it can be used from
22945 : either the present location or the final installed location.
22947 : Get out of the UU directory to get correct path name.
22949 case "$cppstdin" in
22951 echo "Stripping down cppstdin path name"
22957 : end of configuration questions
22959 echo "End of configuration questions."
22962 : back to where it started
22963 if test -d ../UU; then
22967 : configuration may be unconditionally patched via a 'config.arch' file
22968 if $test -f config.arch; then
22969 echo "I see a config.arch file, loading it." >&4
22973 : configuration may be patched via a 'config.over' file
22974 if $test -f config.over; then
22977 rp='I see a config.over file. Do you wish to load it?'
22980 n*) echo "OK, I'll ignore it.";;
22982 echo "Configuration override changes have been loaded."
22987 : in case they want portability, strip down executable paths
22988 case "$d_portable" in
22991 echo "Stripping down executable paths..." >&4
22992 for file in $loclist $trylist; do
22994 eval $file=`basename $temp`
22999 : create config.sh file
23001 echo "Creating config.sh..." >&4
23002 $spitshell <<EOT >config.sh
23005 # This file was produced by running the Configure script. It holds all the
23006 # definitions figured out by Configure. Should you modify one of these values,
23007 # do not forget to propagate your changes by running "Configure -der". You may
23008 # instead choose to run each of the .SH files by yourself, or "Configure -S".
23011 # Package name : $package
23012 # Source directory : $src
23013 # Configuration time: $cf_time
23014 # Configured by : $cf_by
23015 # Target system : $myuname
23018 : Add in command line options if available
23019 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
23021 $spitshell <<EOT >>config.sh
23030 Revision='$Revision'
23038 alignbytes='$alignbytes'
23039 ansi2knr='$ansi2knr'
23040 aphostname='$aphostname'
23041 api_revision='$api_revision'
23042 api_subversion='$api_subversion'
23043 api_version='$api_version'
23044 api_versionstring='$api_versionstring'
23047 archlibexp='$archlibexp'
23048 archname64='$archname64'
23049 archname='$archname'
23050 archobjs='$archobjs'
23051 asctime_r_proto='$asctime_r_proto'
23060 byteorder='$byteorder'
23062 castflags='$castflags'
23065 cccdlflags='$cccdlflags'
23066 ccdlflags='$ccdlflags'
23068 ccflags_uselargefiles='$ccflags_uselargefiles'
23070 ccsymbols='$ccsymbols'
23071 ccversion='$ccversion'
23073 cf_email='$cf_email'
23075 charbits='$charbits'
23076 charsize='$charsize'
23080 clocktype='$clocktype'
23082 compress='$compress'
23083 contains='$contains'
23087 cpp_stuff='$cpp_stuff'
23088 cppccsymbols='$cppccsymbols'
23089 cppflags='$cppflags'
23091 cppminus='$cppminus'
23093 cppstdin='$cppstdin'
23094 cppsymbols='$cppsymbols'
23095 crypt_r_proto='$crypt_r_proto'
23096 cryptlib='$cryptlib'
23098 ctermid_r_proto='$ctermid_r_proto'
23099 ctime_r_proto='$ctime_r_proto'
23100 d_Gconvert='$d_Gconvert'
23101 d_PRIEUldbl='$d_PRIEUldbl'
23102 d_PRIFUldbl='$d_PRIFUldbl'
23103 d_PRIGUldbl='$d_PRIGUldbl'
23104 d_PRIXU64='$d_PRIXU64'
23105 d_PRId64='$d_PRId64'
23106 d_PRIeldbl='$d_PRIeldbl'
23107 d_PRIfldbl='$d_PRIfldbl'
23108 d_PRIgldbl='$d_PRIgldbl'
23109 d_PRIi64='$d_PRIi64'
23110 d_PRIo64='$d_PRIo64'
23111 d_PRIu64='$d_PRIu64'
23112 d_PRIx64='$d_PRIx64'
23113 d_SCNfldbl='$d_SCNfldbl'
23114 d__fwalk='$d__fwalk'
23115 d_access='$d_access'
23116 d_accessx='$d_accessx'
23119 d_archlib='$d_archlib'
23120 d_asctime64='$d_asctime64'
23121 d_asctime_r='$d_asctime_r'
23124 d_attribute_deprecated='$d_attribute_deprecated'
23125 d_attribute_format='$d_attribute_format'
23126 d_attribute_malloc='$d_attribute_malloc'
23127 d_attribute_nonnull='$d_attribute_nonnull'
23128 d_attribute_noreturn='$d_attribute_noreturn'
23129 d_attribute_pure='$d_attribute_pure'
23130 d_attribute_unused='$d_attribute_unused'
23131 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
23132 d_backtrace='$d_backtrace'
23136 d_bsdgetpgrp='$d_bsdgetpgrp'
23137 d_bsdsetpgrp='$d_bsdsetpgrp'
23138 d_builtin_choose_expr='$d_builtin_choose_expr'
23139 d_builtin_expect='$d_builtin_expect'
23141 d_c99_variadic_macros='$d_c99_variadic_macros'
23142 d_casti32='$d_casti32'
23143 d_castneg='$d_castneg'
23144 d_charvspr='$d_charvspr'
23146 d_chroot='$d_chroot'
23147 d_chsize='$d_chsize'
23149 d_clearenv='$d_clearenv'
23150 d_closedir='$d_closedir'
23151 d_cmsghdr_s='$d_cmsghdr_s'
23153 d_copysignl='$d_copysignl'
23154 d_cplusplus='$d_cplusplus'
23156 d_crypt_r='$d_crypt_r'
23158 d_ctermid='$d_ctermid'
23159 d_ctermid_r='$d_ctermid_r'
23160 d_ctime64='$d_ctime64'
23161 d_ctime_r='$d_ctime_r'
23162 d_cuserid='$d_cuserid'
23163 d_dbl_dig='$d_dbl_dig'
23164 d_dbminitproto='$d_dbminitproto'
23165 d_difftime64='$d_difftime64'
23166 d_difftime='$d_difftime'
23167 d_dir_dd_fd='$d_dir_dd_fd'
23169 d_dirnamlen='$d_dirnamlen'
23170 d_dladdr='$d_dladdr'
23171 d_dlerror='$d_dlerror'
23172 d_dlopen='$d_dlopen'
23173 d_dlsymun='$d_dlsymun'
23174 d_dosuid='$d_dosuid'
23175 d_drand48_r='$d_drand48_r'
23176 d_drand48proto='$d_drand48proto'
23178 d_eaccess='$d_eaccess'
23179 d_endgrent='$d_endgrent'
23180 d_endgrent_r='$d_endgrent_r'
23181 d_endhent='$d_endhent'
23182 d_endhostent_r='$d_endhostent_r'
23183 d_endnent='$d_endnent'
23184 d_endnetent_r='$d_endnetent_r'
23185 d_endpent='$d_endpent'
23186 d_endprotoent_r='$d_endprotoent_r'
23187 d_endpwent='$d_endpwent'
23188 d_endpwent_r='$d_endpwent_r'
23189 d_endsent='$d_endsent'
23190 d_endservent_r='$d_endservent_r'
23191 d_eofnblk='$d_eofnblk'
23192 d_eunice='$d_eunice'
23193 d_faststdio='$d_faststdio'
23194 d_fchdir='$d_fchdir'
23195 d_fchmod='$d_fchmod'
23196 d_fchown='$d_fchown'
23198 d_fcntl_can_lock='$d_fcntl_can_lock'
23199 d_fd_macros='$d_fd_macros'
23200 d_fd_set='$d_fd_set'
23201 d_fds_bits='$d_fds_bits'
23202 d_fgetpos='$d_fgetpos'
23203 d_finite='$d_finite'
23204 d_finitel='$d_finitel'
23205 d_flexfnam='$d_flexfnam'
23207 d_flockproto='$d_flockproto'
23209 d_fp_class='$d_fp_class'
23210 d_fpathconf='$d_fpathconf'
23211 d_fpclass='$d_fpclass'
23212 d_fpclassify='$d_fpclassify'
23213 d_fpclassl='$d_fpclassl'
23214 d_fpos64_t='$d_fpos64_t'
23215 d_frexpl='$d_frexpl'
23216 d_fs_data_s='$d_fs_data_s'
23217 d_fseeko='$d_fseeko'
23218 d_fsetpos='$d_fsetpos'
23219 d_fstatfs='$d_fstatfs'
23220 d_fstatvfs='$d_fstatvfs'
23222 d_ftello='$d_ftello'
23224 d_futimes='$d_futimes'
23225 d_gdbm_ndbm_h_uses_prototypes='$d_gdbm_ndbm_h_uses_prototypes'
23226 d_gdbmndbm_h_uses_prototypes='$d_gdbmndbm_h_uses_prototypes'
23227 d_getaddrinfo='$d_getaddrinfo'
23228 d_getcwd='$d_getcwd'
23229 d_getespwnam='$d_getespwnam'
23230 d_getfsstat='$d_getfsstat'
23231 d_getgrent='$d_getgrent'
23232 d_getgrent_r='$d_getgrent_r'
23233 d_getgrgid_r='$d_getgrgid_r'
23234 d_getgrnam_r='$d_getgrnam_r'
23235 d_getgrps='$d_getgrps'
23236 d_gethbyaddr='$d_gethbyaddr'
23237 d_gethbyname='$d_gethbyname'
23238 d_gethent='$d_gethent'
23239 d_gethname='$d_gethname'
23240 d_gethostbyaddr_r='$d_gethostbyaddr_r'
23241 d_gethostbyname_r='$d_gethostbyname_r'
23242 d_gethostent_r='$d_gethostent_r'
23243 d_gethostprotos='$d_gethostprotos'
23244 d_getitimer='$d_getitimer'
23245 d_getlogin='$d_getlogin'
23246 d_getlogin_r='$d_getlogin_r'
23247 d_getmnt='$d_getmnt'
23248 d_getmntent='$d_getmntent'
23249 d_getnameinfo='$d_getnameinfo'
23250 d_getnbyaddr='$d_getnbyaddr'
23251 d_getnbyname='$d_getnbyname'
23252 d_getnent='$d_getnent'
23253 d_getnetbyaddr_r='$d_getnetbyaddr_r'
23254 d_getnetbyname_r='$d_getnetbyname_r'
23255 d_getnetent_r='$d_getnetent_r'
23256 d_getnetprotos='$d_getnetprotos'
23257 d_getpagsz='$d_getpagsz'
23258 d_getpbyname='$d_getpbyname'
23259 d_getpbynumber='$d_getpbynumber'
23260 d_getpent='$d_getpent'
23261 d_getpgid='$d_getpgid'
23262 d_getpgrp2='$d_getpgrp2'
23263 d_getpgrp='$d_getpgrp'
23264 d_getppid='$d_getppid'
23265 d_getprior='$d_getprior'
23266 d_getprotobyname_r='$d_getprotobyname_r'
23267 d_getprotobynumber_r='$d_getprotobynumber_r'
23268 d_getprotoent_r='$d_getprotoent_r'
23269 d_getprotoprotos='$d_getprotoprotos'
23270 d_getprpwnam='$d_getprpwnam'
23271 d_getpwent='$d_getpwent'
23272 d_getpwent_r='$d_getpwent_r'
23273 d_getpwnam_r='$d_getpwnam_r'
23274 d_getpwuid_r='$d_getpwuid_r'
23275 d_getsbyname='$d_getsbyname'
23276 d_getsbyport='$d_getsbyport'
23277 d_getsent='$d_getsent'
23278 d_getservbyname_r='$d_getservbyname_r'
23279 d_getservbyport_r='$d_getservbyport_r'
23280 d_getservent_r='$d_getservent_r'
23281 d_getservprotos='$d_getservprotos'
23282 d_getspnam='$d_getspnam'
23283 d_getspnam_r='$d_getspnam_r'
23284 d_gettimeod='$d_gettimeod'
23285 d_gmtime64='$d_gmtime64'
23286 d_gmtime_r='$d_gmtime_r'
23287 d_gnulibc='$d_gnulibc'
23288 d_grpasswd='$d_grpasswd'
23289 d_hasmntopt='$d_hasmntopt'
23291 d_ilogbl='$d_ilogbl'
23292 d_inc_version_list='$d_inc_version_list'
23294 d_inetaton='$d_inetaton'
23295 d_inetntop='$d_inetntop'
23296 d_inetpton='$d_inetpton'
23297 d_int64_t='$d_int64_t'
23298 d_ip_mreq='$d_ip_mreq'
23299 d_ip_mreq_source='$d_ip_mreq_source'
23300 d_ipv6_mreq='$d_ipv6_mreq'
23301 d_ipv6_mreq_source='$d_ipv6_mreq_source'
23302 d_isascii='$d_isascii'
23303 d_isblank='$d_isblank'
23304 d_isfinite='$d_isfinite'
23307 d_isnanl='$d_isnanl'
23308 d_killpg='$d_killpg'
23309 d_lchown='$d_lchown'
23310 d_ldbl_dig='$d_ldbl_dig'
23311 d_libm_lib_version='$d_libm_lib_version'
23312 d_libname_unique='$d_libname_unique'
23314 d_localtime64='$d_localtime64'
23315 d_localtime_r='$d_localtime_r'
23316 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
23317 d_locconv='$d_locconv'
23319 d_longdbl='$d_longdbl'
23320 d_longlong='$d_longlong'
23321 d_lseekproto='$d_lseekproto'
23323 d_madvise='$d_madvise'
23324 d_malloc_good_size='$d_malloc_good_size'
23325 d_malloc_size='$d_malloc_size'
23327 d_mbstowcs='$d_mbstowcs'
23328 d_mbtowc='$d_mbtowc'
23329 d_memchr='$d_memchr'
23330 d_memcmp='$d_memcmp'
23331 d_memcpy='$d_memcpy'
23332 d_memmove='$d_memmove'
23333 d_memset='$d_memset'
23335 d_mkdtemp='$d_mkdtemp'
23336 d_mkfifo='$d_mkfifo'
23337 d_mkstemp='$d_mkstemp'
23338 d_mkstemps='$d_mkstemps'
23339 d_mktime64='$d_mktime64'
23340 d_mktime='$d_mktime'
23343 d_modfl_pow32_bug='$d_modfl_pow32_bug'
23344 d_modflproto='$d_modflproto'
23345 d_mprotect='$d_mprotect'
23347 d_msg_ctrunc='$d_msg_ctrunc'
23348 d_msg_dontroute='$d_msg_dontroute'
23349 d_msg_oob='$d_msg_oob'
23350 d_msg_peek='$d_msg_peek'
23351 d_msg_proxy='$d_msg_proxy'
23352 d_msgctl='$d_msgctl'
23353 d_msgget='$d_msgget'
23354 d_msghdr_s='$d_msghdr_s'
23355 d_msgrcv='$d_msgrcv'
23356 d_msgsnd='$d_msgsnd'
23358 d_munmap='$d_munmap'
23359 d_mymalloc='$d_mymalloc'
23361 d_ndbm_h_uses_prototypes='$d_ndbm_h_uses_prototypes'
23363 d_nl_langinfo='$d_nl_langinfo'
23364 d_nv_preserves_uv='$d_nv_preserves_uv'
23365 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
23366 d_off64_t='$d_off64_t'
23367 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
23368 d_oldpthreads='$d_oldpthreads'
23369 d_oldsock='$d_oldsock'
23371 d_pathconf='$d_pathconf'
23373 d_perl_otherlibdirs='$d_perl_otherlibdirs'
23374 d_phostname='$d_phostname'
23377 d_portable='$d_portable'
23379 d_prctl_set_name='$d_prctl_set_name'
23380 d_printf_format_null='$d_printf_format_null'
23381 d_procselfexe='$d_procselfexe'
23382 d_pseudofork='$d_pseudofork'
23383 d_pthread_atfork='$d_pthread_atfork'
23384 d_pthread_attr_setscope='$d_pthread_attr_setscope'
23385 d_pthread_yield='$d_pthread_yield'
23386 d_ptrdiff_t='$d_ptrdiff_t'
23388 d_pwchange='$d_pwchange'
23389 d_pwclass='$d_pwclass'
23390 d_pwcomment='$d_pwcomment'
23391 d_pwexpire='$d_pwexpire'
23392 d_pwgecos='$d_pwgecos'
23393 d_pwpasswd='$d_pwpasswd'
23394 d_pwquota='$d_pwquota'
23397 d_random_r='$d_random_r'
23398 d_readdir64_r='$d_readdir64_r'
23399 d_readdir='$d_readdir'
23400 d_readdir_r='$d_readdir_r'
23401 d_readlink='$d_readlink'
23403 d_recvmsg='$d_recvmsg'
23404 d_rename='$d_rename'
23405 d_rewinddir='$d_rewinddir'
23407 d_safebcpy='$d_safebcpy'
23408 d_safemcpy='$d_safemcpy'
23409 d_sanemcmp='$d_sanemcmp'
23410 d_sbrkproto='$d_sbrkproto'
23411 d_scalbnl='$d_scalbnl'
23412 d_sched_yield='$d_sched_yield'
23413 d_scm_rights='$d_scm_rights'
23414 d_seekdir='$d_seekdir'
23415 d_select='$d_select'
23417 d_semctl='$d_semctl'
23418 d_semctl_semid_ds='$d_semctl_semid_ds'
23419 d_semctl_semun='$d_semctl_semun'
23420 d_semget='$d_semget'
23422 d_sendmsg='$d_sendmsg'
23423 d_setegid='$d_setegid'
23424 d_seteuid='$d_seteuid'
23425 d_setgrent='$d_setgrent'
23426 d_setgrent_r='$d_setgrent_r'
23427 d_setgrps='$d_setgrps'
23428 d_sethent='$d_sethent'
23429 d_sethostent_r='$d_sethostent_r'
23430 d_setitimer='$d_setitimer'
23431 d_setlinebuf='$d_setlinebuf'
23432 d_setlocale='$d_setlocale'
23433 d_setlocale_r='$d_setlocale_r'
23434 d_setnent='$d_setnent'
23435 d_setnetent_r='$d_setnetent_r'
23436 d_setpent='$d_setpent'
23437 d_setpgid='$d_setpgid'
23438 d_setpgrp2='$d_setpgrp2'
23439 d_setpgrp='$d_setpgrp'
23440 d_setprior='$d_setprior'
23441 d_setproctitle='$d_setproctitle'
23442 d_setprotoent_r='$d_setprotoent_r'
23443 d_setpwent='$d_setpwent'
23444 d_setpwent_r='$d_setpwent_r'
23445 d_setregid='$d_setregid'
23446 d_setresgid='$d_setresgid'
23447 d_setresuid='$d_setresuid'
23448 d_setreuid='$d_setreuid'
23449 d_setrgid='$d_setrgid'
23450 d_setruid='$d_setruid'
23451 d_setsent='$d_setsent'
23452 d_setservent_r='$d_setservent_r'
23453 d_setsid='$d_setsid'
23454 d_setvbuf='$d_setvbuf'
23457 d_shmatprototype='$d_shmatprototype'
23458 d_shmctl='$d_shmctl'
23460 d_shmget='$d_shmget'
23461 d_sigaction='$d_sigaction'
23462 d_signbit='$d_signbit'
23463 d_sigprocmask='$d_sigprocmask'
23464 d_sigsetjmp='$d_sigsetjmp'
23465 d_sin6_scope_id='$d_sin6_scope_id'
23466 d_sitearch='$d_sitearch'
23467 d_snprintf='$d_snprintf'
23468 d_sockaddr_in6='$d_sockaddr_in6'
23469 d_sockaddr_sa_len='$d_sockaddr_sa_len'
23470 d_sockatmark='$d_sockatmark'
23471 d_sockatmarkproto='$d_sockatmarkproto'
23472 d_socket='$d_socket'
23473 d_socklen_t='$d_socklen_t'
23474 d_sockpair='$d_sockpair'
23475 d_socks5_init='$d_socks5_init'
23476 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
23478 d_srand48_r='$d_srand48_r'
23479 d_srandom_r='$d_srandom_r'
23480 d_sresgproto='$d_sresgproto'
23481 d_sresuproto='$d_sresuproto'
23482 d_statblks='$d_statblks'
23483 d_statfs_f_flags='$d_statfs_f_flags'
23484 d_statfs_s='$d_statfs_s'
23485 d_static_inline='$d_static_inline'
23486 d_statvfs='$d_statvfs'
23487 d_stdio_cnt_lval='$d_stdio_cnt_lval'
23488 d_stdio_ptr_lval='$d_stdio_ptr_lval'
23489 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
23490 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
23491 d_stdio_stream_array='$d_stdio_stream_array'
23492 d_stdiobase='$d_stdiobase'
23493 d_stdstdio='$d_stdstdio'
23494 d_strchr='$d_strchr'
23495 d_strcoll='$d_strcoll'
23496 d_strctcpy='$d_strctcpy'
23497 d_strerrm='$d_strerrm'
23498 d_strerror='$d_strerror'
23499 d_strerror_r='$d_strerror_r'
23500 d_strftime='$d_strftime'
23501 d_strlcat='$d_strlcat'
23502 d_strlcpy='$d_strlcpy'
23503 d_strtod='$d_strtod'
23504 d_strtol='$d_strtol'
23505 d_strtold='$d_strtold'
23506 d_strtoll='$d_strtoll'
23507 d_strtoq='$d_strtoq'
23508 d_strtoul='$d_strtoul'
23509 d_strtoull='$d_strtoull'
23510 d_strtouq='$d_strtouq'
23511 d_strxfrm='$d_strxfrm'
23512 d_suidsafe='$d_suidsafe'
23513 d_symlink='$d_symlink'
23514 d_syscall='$d_syscall'
23515 d_syscallproto='$d_syscallproto'
23516 d_sysconf='$d_sysconf'
23517 d_sysernlst='$d_sysernlst'
23518 d_syserrlst='$d_syserrlst'
23519 d_system='$d_system'
23520 d_tcgetpgrp='$d_tcgetpgrp'
23521 d_tcsetpgrp='$d_tcsetpgrp'
23522 d_telldir='$d_telldir'
23523 d_telldirproto='$d_telldirproto'
23525 d_timegm='$d_timegm'
23527 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
23528 d_tm_tm_zone='$d_tm_tm_zone'
23529 d_tmpnam_r='$d_tmpnam_r'
23530 d_truncate='$d_truncate'
23531 d_ttyname_r='$d_ttyname_r'
23532 d_tzname='$d_tzname'
23533 d_u32align='$d_u32align'
23534 d_ualarm='$d_ualarm'
23537 d_union_semun='$d_union_semun'
23538 d_unordered='$d_unordered'
23539 d_unsetenv='$d_unsetenv'
23540 d_usleep='$d_usleep'
23541 d_usleepproto='$d_usleepproto'
23543 d_vendorarch='$d_vendorarch'
23544 d_vendorbin='$d_vendorbin'
23545 d_vendorlib='$d_vendorlib'
23546 d_vendorscript='$d_vendorscript'
23548 d_void_closedir='$d_void_closedir'
23549 d_voidsig='$d_voidsig'
23550 d_voidtty='$d_voidtty'
23551 d_volatile='$d_volatile'
23552 d_vprintf='$d_vprintf'
23553 d_vsnprintf='$d_vsnprintf'
23555 d_waitpid='$d_waitpid'
23556 d_wcscmp='$d_wcscmp'
23557 d_wcstombs='$d_wcstombs'
23558 d_wcsxfrm='$d_wcsxfrm'
23559 d_wctomb='$d_wctomb'
23560 d_writev='$d_writev'
23563 db_hashtype='$db_hashtype'
23564 db_prefixtype='$db_prefixtype'
23565 db_version_major='$db_version_major'
23566 db_version_minor='$db_version_minor'
23567 db_version_patch='$db_version_patch'
23568 direntrytype='$direntrytype'
23571 doublesize='$doublesize'
23573 drand48_r_proto='$drand48_r_proto'
23575 dynamic_ext='$dynamic_ext'
23581 endgrent_r_proto='$endgrent_r_proto'
23582 endhostent_r_proto='$endhostent_r_proto'
23583 endnetent_r_proto='$endnetent_r_proto'
23584 endprotoent_r_proto='$endprotoent_r_proto'
23585 endpwent_r_proto='$endpwent_r_proto'
23586 endservent_r_proto='$endservent_r_proto'
23587 eunicefix='$eunicefix'
23590 extensions='$extensions'
23591 extern_C='$extern_C'
23593 fflushNULL='$fflushNULL'
23594 fflushall='$fflushall'
23596 firstmakefile='$firstmakefile'
23598 fpossize='$fpossize'
23599 fpostype='$fpostype'
23600 freetype='$freetype'
23603 full_csh='$full_csh'
23604 full_sed='$full_sed'
23605 gccansipedantic='$gccansipedantic'
23606 gccosandvers='$gccosandvers'
23607 gccversion='$gccversion'
23608 getgrent_r_proto='$getgrent_r_proto'
23609 getgrgid_r_proto='$getgrgid_r_proto'
23610 getgrnam_r_proto='$getgrnam_r_proto'
23611 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
23612 gethostbyname_r_proto='$gethostbyname_r_proto'
23613 gethostent_r_proto='$gethostent_r_proto'
23614 getlogin_r_proto='$getlogin_r_proto'
23615 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
23616 getnetbyname_r_proto='$getnetbyname_r_proto'
23617 getnetent_r_proto='$getnetent_r_proto'
23618 getprotobyname_r_proto='$getprotobyname_r_proto'
23619 getprotobynumber_r_proto='$getprotobynumber_r_proto'
23620 getprotoent_r_proto='$getprotoent_r_proto'
23621 getpwent_r_proto='$getpwent_r_proto'
23622 getpwnam_r_proto='$getpwnam_r_proto'
23623 getpwuid_r_proto='$getpwuid_r_proto'
23624 getservbyname_r_proto='$getservbyname_r_proto'
23625 getservbyport_r_proto='$getservbyport_r_proto'
23626 getservent_r_proto='$getservent_r_proto'
23627 getspnam_r_proto='$getspnam_r_proto'
23628 gidformat='$gidformat'
23634 gmtime_r_proto='$gmtime_r_proto'
23635 gnulibc_version='$gnulibc_version'
23637 groupcat='$groupcat'
23638 groupstype='$groupstype'
23641 h_sysfile='$h_sysfile'
23644 hostgenerate='$hostgenerate'
23645 hostosname='$hostosname'
23646 hostperl='$hostperl'
23647 html1dir='$html1dir'
23648 html1direxp='$html1direxp'
23649 html3dir='$html3dir'
23650 html3direxp='$html3direxp'
23659 i_arpainet='$i_arpainet'
23660 i_assert='$i_assert'
23662 i_bsdioctl='$i_bsdioctl'
23666 i_dirent='$i_dirent'
23668 i_execinfo='$i_execinfo'
23672 i_fp_class='$i_fp_class'
23674 i_gdbm_ndbm='$i_gdbm_ndbm'
23675 i_gdbmndbm='$i_gdbmndbm'
23677 i_ieeefp='$i_ieeefp'
23678 i_inttypes='$i_inttypes'
23679 i_langinfo='$i_langinfo'
23680 i_libutil='$i_libutil'
23681 i_limits='$i_limits'
23682 i_locale='$i_locale'
23683 i_machcthr='$i_machcthr'
23684 i_malloc='$i_malloc'
23685 i_mallocmalloc='$i_mallocmalloc'
23687 i_memory='$i_memory'
23688 i_mntent='$i_mntent'
23691 i_neterrno='$i_neterrno'
23692 i_netinettcp='$i_netinettcp'
23696 i_pthread='$i_pthread'
23698 i_rpcsvcdbm='$i_rpcsvcdbm'
23700 i_shadow='$i_shadow'
23702 i_stdarg='$i_stdarg'
23703 i_stdbool='$i_stdbool'
23704 i_stddef='$i_stddef'
23705 i_stdlib='$i_stdlib'
23706 i_string='$i_string'
23707 i_sunmath='$i_sunmath'
23708 i_sysaccess='$i_sysaccess'
23709 i_sysdir='$i_sysdir'
23710 i_sysfile='$i_sysfile'
23711 i_sysfilio='$i_sysfilio'
23713 i_sysioctl='$i_sysioctl'
23714 i_syslog='$i_syslog'
23715 i_sysmman='$i_sysmman'
23716 i_sysmode='$i_sysmode'
23717 i_sysmount='$i_sysmount'
23718 i_sysndir='$i_sysndir'
23719 i_sysparam='$i_sysparam'
23720 i_syspoll='$i_syspoll'
23721 i_sysresrc='$i_sysresrc'
23722 i_syssecrt='$i_syssecrt'
23723 i_sysselct='$i_sysselct'
23724 i_syssockio='$i_syssockio'
23725 i_sysstat='$i_sysstat'
23726 i_sysstatfs='$i_sysstatfs'
23727 i_sysstatvfs='$i_sysstatvfs'
23728 i_systime='$i_systime'
23729 i_systimek='$i_systimek'
23730 i_systimes='$i_systimes'
23731 i_systypes='$i_systypes'
23732 i_sysuio='$i_sysuio'
23734 i_sysutsname='$i_sysutsname'
23735 i_sysvfs='$i_sysvfs'
23736 i_syswait='$i_syswait'
23737 i_termio='$i_termio'
23738 i_termios='$i_termios'
23740 i_unistd='$i_unistd'
23743 i_values='$i_values'
23744 i_varargs='$i_varargs'
23745 i_varhdr='$i_varhdr'
23747 ignore_versioned_solibs='$ignore_versioned_solibs'
23748 inc_version_list='$inc_version_list'
23749 inc_version_list_init='$inc_version_list_init'
23753 initialinstalllocation='$initialinstalllocation'
23754 installarchlib='$installarchlib'
23755 installbin='$installbin'
23756 installhtml1dir='$installhtml1dir'
23757 installhtml3dir='$installhtml3dir'
23758 installman1dir='$installman1dir'
23759 installman3dir='$installman3dir'
23760 installprefix='$installprefix'
23761 installprefixexp='$installprefixexp'
23762 installprivlib='$installprivlib'
23763 installscript='$installscript'
23764 installsitearch='$installsitearch'
23765 installsitebin='$installsitebin'
23766 installsitehtml1dir='$installsitehtml1dir'
23767 installsitehtml3dir='$installsitehtml3dir'
23768 installsitelib='$installsitelib'
23769 installsiteman1dir='$installsiteman1dir'
23770 installsiteman3dir='$installsiteman3dir'
23771 installsitescript='$installsitescript'
23772 installstyle='$installstyle'
23773 installusrbinperl='$installusrbinperl'
23774 installvendorarch='$installvendorarch'
23775 installvendorbin='$installvendorbin'
23776 installvendorhtml1dir='$installvendorhtml1dir'
23777 installvendorhtml3dir='$installvendorhtml3dir'
23778 installvendorlib='$installvendorlib'
23779 installvendorman1dir='$installvendorman1dir'
23780 installvendorman3dir='$installvendorman3dir'
23781 installvendorscript='$installvendorscript'
23783 issymlink='$issymlink'
23784 ivdformat='$ivdformat'
23787 known_extensions='$known_extensions'
23790 ld_can_script='$ld_can_script'
23791 lddlflags='$lddlflags'
23793 ldflags_uselargefiles='$ldflags_uselargefiles'
23794 ldlibpthname='$ldlibpthname'
23801 libsdirs='$libsdirs'
23802 libsfiles='$libsfiles'
23803 libsfound='$libsfound'
23804 libspath='$libspath'
23805 libswanted='$libswanted'
23806 libswanted_uselargefiles='$libswanted_uselargefiles'
23812 localtime_r_proto='$localtime_r_proto'
23813 locincpth='$locincpth'
23814 loclibpth='$loclibpth'
23815 longdblkind='$longdblkind'
23816 longdblsize='$longdblsize'
23817 longlongsize='$longlongsize'
23818 longsize='$longsize'
23822 lseeksize='$lseeksize'
23823 lseektype='$lseektype'
23827 make_set_make='$make_set_make'
23828 mallocobj='$mallocobj'
23829 mallocsrc='$mallocsrc'
23830 malloctype='$malloctype'
23832 man1direxp='$man1direxp'
23835 man3direxp='$man3direxp'
23837 mips_type='$mips_type'
23838 mistrustnm='$mistrustnm'
23840 mmaptype='$mmaptype'
23841 modetype='$modetype'
23843 multiarch='$multiarch'
23845 myarchname='$myarchname'
23846 mydomain='$mydomain'
23847 myhostname='$myhostname'
23850 need_va_copy='$need_va_copy'
23851 netdb_hlen_type='$netdb_hlen_type'
23852 netdb_host_type='$netdb_host_type'
23853 netdb_name_type='$netdb_name_type'
23854 netdb_net_type='$netdb_net_type'
23857 nm_so_opt='$nm_so_opt'
23858 nonxs_ext='$nonxs_ext'
23860 nvEUformat='$nvEUformat'
23861 nvFUformat='$nvFUformat'
23862 nvGUformat='$nvGUformat'
23863 nv_overflows_integers_at='$nv_overflows_integers_at'
23864 nv_preserves_uv_bits='$nv_preserves_uv_bits'
23865 nveformat='$nveformat'
23866 nvfformat='$nvfformat'
23867 nvgformat='$nvgformat'
23870 o_nonblock='$o_nonblock'
23872 old_pthread_create_joinable='$old_pthread_create_joinable'
23873 optimize='$optimize'
23874 orderlib='$orderlib'
23877 otherlibdirs='$otherlibdirs'
23881 patchlevel='$patchlevel'
23882 path_sep='$path_sep'
23885 perl_patchlevel='$perl_patchlevel'
23886 perl_static_inline='$perl_static_inline'
23887 perladmin='$perladmin'
23888 perllibs='$perllibs'
23889 perlpath='$perlpath'
23891 phostname='$phostname'
23897 prefixexp='$prefixexp'
23899 privlibexp='$privlibexp'
23900 procselfexe='$procselfexe'
23901 prototype='$prototype'
23903 quadkind='$quadkind'
23904 quadtype='$quadtype'
23905 randbits='$randbits'
23906 randfunc='$randfunc'
23907 random_r_proto='$random_r_proto'
23908 randseedtype='$randseedtype'
23910 rd_nodata='$rd_nodata'
23911 readdir64_r_proto='$readdir64_r_proto'
23912 readdir_r_proto='$readdir_r_proto'
23913 revision='$revision'
23919 sGMTIME_max='$sGMTIME_max'
23920 sGMTIME_min='$sGMTIME_min'
23921 sLOCALTIME_max='$sLOCALTIME_max'
23922 sLOCALTIME_min='$sLOCALTIME_min'
23923 sPRIEUldbl='$sPRIEUldbl'
23924 sPRIFUldbl='$sPRIFUldbl'
23925 sPRIGUldbl='$sPRIGUldbl'
23926 sPRIXU64='$sPRIXU64'
23928 sPRIeldbl='$sPRIeldbl'
23929 sPRIfldbl='$sPRIfldbl'
23930 sPRIgldbl='$sPRIgldbl'
23935 sSCNfldbl='$sSCNfldbl'
23936 sched_yield='$sched_yield'
23937 scriptdir='$scriptdir'
23938 scriptdirexp='$scriptdirexp'
23940 seedfunc='$seedfunc'
23941 selectminbits='$selectminbits'
23942 selecttype='$selecttype'
23943 sendmail='$sendmail'
23944 setgrent_r_proto='$setgrent_r_proto'
23945 sethostent_r_proto='$sethostent_r_proto'
23946 setlocale_r_proto='$setlocale_r_proto'
23947 setnetent_r_proto='$setnetent_r_proto'
23948 setprotoent_r_proto='$setprotoent_r_proto'
23949 setpwent_r_proto='$setpwent_r_proto'
23950 setservent_r_proto='$setservent_r_proto'
23953 sharpbang='$sharpbang'
23954 shmattype='$shmattype'
23955 shortsize='$shortsize'
23958 sig_count='$sig_count'
23959 sig_name='$sig_name'
23960 sig_name_init='$sig_name_init'
23962 sig_num_init='$sig_num_init'
23963 sig_size='$sig_size'
23964 signal_t='$signal_t'
23965 sitearch='$sitearch'
23966 sitearchexp='$sitearchexp'
23968 sitebinexp='$sitebinexp'
23969 sitehtml1dir='$sitehtml1dir'
23970 sitehtml1direxp='$sitehtml1direxp'
23971 sitehtml3dir='$sitehtml3dir'
23972 sitehtml3direxp='$sitehtml3direxp'
23974 sitelib_stem='$sitelib_stem'
23975 sitelibexp='$sitelibexp'
23976 siteman1dir='$siteman1dir'
23977 siteman1direxp='$siteman1direxp'
23978 siteman3dir='$siteman3dir'
23979 siteman3direxp='$siteman3direxp'
23980 siteprefix='$siteprefix'
23981 siteprefixexp='$siteprefixexp'
23982 sitescript='$sitescript'
23983 sitescriptexp='$sitescriptexp'
23984 sizesize='$sizesize'
23985 sizetype='$sizetype'
23989 sockethdr='$sockethdr'
23990 socketlib='$socketlib'
23991 socksizetype='$socksizetype'
23993 spackage='$spackage'
23994 spitshell='$spitshell'
23995 srand48_r_proto='$srand48_r_proto'
23996 srandom_r_proto='$srandom_r_proto'
23998 ssizetype='$ssizetype'
23999 st_ino_sign='$st_ino_sign'
24000 st_ino_size='$st_ino_size'
24001 startperl='$startperl'
24003 static_ext='$static_ext'
24005 stdio_base='$stdio_base'
24006 stdio_bufsiz='$stdio_bufsiz'
24007 stdio_cnt='$stdio_cnt'
24008 stdio_filbuf='$stdio_filbuf'
24009 stdio_ptr='$stdio_ptr'
24010 stdio_stream_array='$stdio_stream_array'
24011 strerror_r_proto='$strerror_r_proto'
24014 subversion='$subversion'
24019 targetarch='$targetarch'
24020 targetdir='$targetdir'
24021 targetenv='$targetenv'
24022 targethost='$targethost'
24023 targetmkdir='$targetmkdir'
24024 targetport='$targetport'
24025 targetsh='$targetsh'
24029 timeincl='$timeincl'
24030 timetype='$timetype'
24031 tmpnam_r_proto='$tmpnam_r_proto'
24037 ttyname_r_proto='$ttyname_r_proto'
24046 uidformat='$uidformat'
24052 uquadtype='$uquadtype'
24053 use5005threads='$use5005threads'
24054 use64bitall='$use64bitall'
24055 use64bitint='$use64bitint'
24056 usecbacktrace='$usecbacktrace'
24057 usecrosscompile='$usecrosscompile'
24058 usedevel='$usedevel'
24060 usedtrace='$usedtrace'
24061 usefaststdio='$usefaststdio'
24062 useithreads='$useithreads'
24063 usekernprocpathname='$usekernprocpathname'
24064 uselargefiles='$uselargefiles'
24065 uselongdouble='$uselongdouble'
24066 usemallocwrap='$usemallocwrap'
24067 usemorebits='$usemorebits'
24068 usemultiplicity='$usemultiplicity'
24069 usemymalloc='$usemymalloc'
24071 usensgetexecutablepath='$usensgetexecutablepath'
24072 useopcode='$useopcode'
24073 useperlio='$useperlio'
24074 useposix='$useposix'
24075 usereentrant='$usereentrant'
24076 userelocatableinc='$userelocatableinc'
24077 useshrplib='$useshrplib'
24078 usesitecustomize='$usesitecustomize'
24079 usesocks='$usesocks'
24080 usethreads='$usethreads'
24081 usevendorprefix='$usevendorprefix'
24082 useversionedarchname='$useversionedarchname'
24083 usevfork='$usevfork'
24086 uvXUformat='$uvXUformat'
24087 uvoformat='$uvoformat'
24090 uvuformat='$uvuformat'
24091 uvxformat='$uvxformat'
24093 vendorarch='$vendorarch'
24094 vendorarchexp='$vendorarchexp'
24095 vendorbin='$vendorbin'
24096 vendorbinexp='$vendorbinexp'
24097 vendorhtml1dir='$vendorhtml1dir'
24098 vendorhtml1direxp='$vendorhtml1direxp'
24099 vendorhtml3dir='$vendorhtml3dir'
24100 vendorhtml3direxp='$vendorhtml3direxp'
24101 vendorlib='$vendorlib'
24102 vendorlib_stem='$vendorlib_stem'
24103 vendorlibexp='$vendorlibexp'
24104 vendorman1dir='$vendorman1dir'
24105 vendorman1direxp='$vendorman1direxp'
24106 vendorman3dir='$vendorman3dir'
24107 vendorman3direxp='$vendorman3direxp'
24108 vendorprefix='$vendorprefix'
24109 vendorprefixexp='$vendorprefixexp'
24110 vendorscript='$vendorscript'
24111 vendorscriptexp='$vendorscriptexp'
24113 version_patchlevel_string='$version_patchlevel_string'
24114 versiononly='$versiononly'
24118 yaccflags='$yaccflags'
24123 : add special variables
24124 $test -f $src/patchlevel.h && \
24125 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
24126 echo "PERL_PATCHLEVEL='$perl_patchlevel'" >>config.sh
24127 echo "PERL_CONFIG_SH=true" >>config.sh
24129 : propagate old symbols
24130 if $test -f UU/config.sh; then
24131 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
24132 $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \
24133 config.sh config.sh UU/oldconfig.sh |\
24134 $sort | $uniq -u >UU/oldsyms
24135 set X `$cat UU/oldsyms`
24141 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
24143 echo ": Variables propagated from previous config.sh file." >>config.sh
24144 for sym in `$cat UU/oldsyms`; do
24145 echo " Propagating $hint variable "'$'"$sym..."
24146 eval 'tmp="$'"${sym}"'"'
24148 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
24154 : preserve RCS keywords in files with variable substitution, grrr
24157 : Finish up by extracting the .SH files
24161 echo "Extraction done."
24171 If you'd like to make any changes to the config.sh file before I begin
24172 to configure things, do it as a shell escape now (e.g. !vi config.sh).
24175 rp="Press return or use a shell escape to edit config.sh:"
24180 *) : in case they cannot read
24181 sh 1>&4 -c "$ans";;
24186 : if this fails, just run all the .SH files by hand
24195 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
24202 Now you need to generate make dependencies by running "$make depend".
24203 You might prefer to run it in background: "$make depend > makedepend.out &"
24204 It can take a while, so you might not want to run it right now.
24209 rp="Run $make depend now?"
24213 $make depend && echo "Now you must run '$make'."
24216 echo "You must run '$make depend' then '$make'."
24219 elif test -f [Mm]akefile; then
24221 echo "Now you must run a $make."
24223 echo "Configure done."
24226 if $test -f Policy.sh; then
24229 If you compile $package on a different machine or from a different object
24230 directory, copy the Policy.sh file from this object directory to the
24231 new one before you run Configure -- this will help you with most of
24232 the policy defaults.
24236 if $test -f config.msg; then
24237 echo "Hmm. I also noted the following information while running:"
24239 $cat config.msg >&4
24242 $rm -f kit*isdone ark*isdone