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=''
602 d_malloc_good_size=''
646 d_old_pthread_create_joinable=''
647 old_pthread_create_joinable=''
649 d_pthread_attr_setscope=''
688 sethostent_r_proto=''
705 setprotoent_r_proto=''
717 setservent_r_proto=''
739 d_ipv6_mreq_source=''
756 d_sprintf_returns_strlen=''
768 perl_static_inline=''
773 d_stdio_ptr_lval_nochange_cnt=''
774 d_stdio_ptr_lval_sets_cnt=''
922 d_gdbm_ndbm_h_uses_prototypes=''
923 d_gdbmndbm_h_uses_prototypes=''
925 d_ndbm_h_uses_prototypes=''
999 d_inc_version_list=''
1001 inc_version_list_init=''
1005 installusrbinperl=''
1021 ignore_versioned_solibs=''
1085 d_perl_otherlibdirs=''
1093 api_versionstring=''
1099 version_patchlevel_string=''
1103 d_nv_preserves_uv=''
1104 d_nv_zero_is_allbits_zero=''
1115 nv_overflows_integers_at=''
1116 nv_preserves_uv_bits=''
1189 installsitehtml1dir=''
1192 installsitehtml3dir=''
1199 installsiteman1dir=''
1202 installsiteman3dir=''
1207 installsitescript=''
1225 d_stdio_stream_array=''
1226 stdio_stream_array=''
1244 usekernprocpathname=''
1245 ccflags_uselargefiles=''
1246 ldflags_uselargefiles=''
1247 libswanted_uselargefiles=''
1256 usensgetexecutablepath=''
1269 installvendorarch=''
1276 installvendorhtml1dir=''
1278 vendorhtml1direxp=''
1279 installvendorhtml3dir=''
1281 vendorhtml3direxp=''
1287 installvendorman1dir=''
1290 installvendorman3dir=''
1297 installvendorscript=''
1308 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1311 : We must find out about Eunice early
1313 if test -f /etc/unixtovms; then
1314 eunicefix=/etc/unixtovms
1316 if test -f /etc/unixtovms.exe; then
1317 eunicefix=/etc/unixtovms.exe
1320 : Set executable suffix now -- needed before hints available
1321 if test -f "/libs/version.library"; then
1324 elif test -f "/system/gnu_library/bin/ar.pm"; then
1327 elif test -n "$DJGPP"; then
1330 elif test -f /kern/cookiejar; then
1333 elif test -d c:/. -o -n "$is_os2" ; then
1340 : Trailing extension. Override this in a hint file, if needed.
1341 : Extra object files, if any, needed on this platform.
1344 : Possible local include directories to search.
1345 : Set locincpth to "" in a hint file to defeat local include searches.
1346 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1347 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1349 : no include file wanted by default
1352 : Enable -DEBUGGING and -DDEBUGGING from the command line
1357 : change the next line if compiling for Xenix/286 on Xenix/386
1358 xlibpth='/usr/lib/386 /lib/386'
1359 : Possible local library directories to search.
1360 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1361 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1363 : general looking path for locating libraries
1364 glibpth="/lib /usr/lib $xlibpth"
1365 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1366 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1367 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1368 test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
1370 : Private path used by Configure to find libraries. Its value
1371 : is prepended to libpth. This variable takes care of special
1372 : machines, like the mips. Usually, it should be empty.
1375 : default library list
1377 : some systems want to use only the non-versioned libso:s
1378 ignore_versioned_solibs=''
1379 : set usethreads on the Configure command line to enable threads.
1380 usereentrant='undef'
1384 : set useposix=false in your hint file to disable the POSIX extension.
1386 : set useopcode=false in your hint file to disable the Opcode extension.
1389 ccflags_uselargefiles=''
1390 ldflags_uselargefiles=''
1391 libswanted_uselargefiles=''
1392 : set usemultiplicity on the Configure command line to enable multiplicity.
1393 : set usesocks on the Configure command line to enable socks.
1394 : List of libraries we want.
1395 : If anyone needs extra -lxxx, put those in a hint file.
1396 libswanted="socket bind inet nsl nm ndbm gdbm dbm db malloc dl ld sun"
1397 libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
1398 : We probably want to search /usr/shlib before most other libraries.
1399 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1400 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1401 glibpth="/usr/shlib $glibpth"
1402 : Do not use vfork unless overridden by a hint file.
1405 : Find the basic shell for Bourne shell scripts
1409 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1412 if test -f "$xxx"; then
1415 : Build up a list and do a single loop so we can 'break' out.
1416 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1417 for xxx in sh bash ksh pdksh ash; do
1419 try="$try ${p}/${xxx}"
1423 if test -f "$xxx"; then
1426 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1429 elif test -f "$xxx.exe"; then
1440 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1442 Usually it's in /bin/sh. How did you even get this far?
1443 Please contact me (Perl Maintainers) at perlbug@perl.org and
1444 we'll try to straighten this all out.
1450 : When cross-compiling we need to separate the sh-to-run-Configure-with from the sh-to-use-in-Perl
1451 : default both to the same thing, cross-compilers can then set targetsh differently if they like
1454 : see if sh knows # comments
1455 if `$sh -c '#' >/dev/null 2>&1`; then
1459 test -f $xcat$_exe || xcat=/usr/bin/cat
1460 if test ! -f $xcat$_exe; then
1461 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1462 if test -f $p/cat$_exe; then
1467 if test ! -f $xcat$_exe; then
1468 echo "Can't find cat anywhere!"
1472 echo "#!$xcat" >sharp
1475 ./sharp > today 2>/dev/null
1476 if test -s today; then
1479 echo "#! $xcat" > sharp
1482 ./sharp > today 2>/dev/null
1483 if test -s today; then
1491 echo "Your $sh doesn't grok # comments--I will strip them later on."
1494 echo "exec grep -v '^[ ]*#'" >spitshell
1496 $eunicefix spitshell
1497 spitshell=`pwd`/spitshell
1499 echo "I presume that if # doesn't work, #! won't work either!"
1504 : figure out how to guarantee sh startup
1506 '') startsh=${sharpbang}${sh} ;;
1518 : echo "Yup, it does."
1520 echo "Hmm... '$startsh' does not guarantee sh startup..."
1521 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1525 : Save command line options in file UU/cmdline.opt for later use in
1526 : generating config.sh.
1527 cat > cmdline.opt <<EOSH
1528 : Configure command line arguments.
1537 cat >>cmdline.opt <<EOSH
1538 config_arg$argn='$arg'
1540 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1543 arg_exp=`cat cmdl.opt`
1544 args_exp="$args_exp$args_sep'$arg_exp'"
1545 argn=`expr $argn + 1`
1550 : produce awk script to parse command line options
1551 cat >options.awk <<'EOF'
1553 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1555 len = length(optstr);
1556 for (i = 1; i <= len; i++) {
1557 c = substr(optstr, i, 1);
1558 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1569 if (substr(str, 1, 1) != "-") {
1570 printf("'%s'\n", str);
1574 for (i = 2; i <= len; i++) {
1575 c = substr(str, i, 1);
1577 printf("-%s\n", substr(str, i));
1583 printf("'%s'\n", substr(str, i + 1));
1596 : process the command line options
1597 set X `for arg in "$@"; do echo "X$arg"; done |
1598 sed -e s/X// | awk -f options.awk`
1603 : set up default values
1613 rm -f optdef.sh posthint.sh
1614 cat >optdef.sh <<EOS
1620 while test $# -gt 0; do
1622 -d) shift; fastread=yes;;
1623 -e) shift; alldone=cont;;
1627 if test -r "$1"; then
1630 echo "$me: cannot read config file $1." >&2
1636 -h) shift; error=true;;
1637 -r) shift; reuseval=true;;
1638 -s) shift; silent=true; realsilent=true;;
1639 -E) shift; alldone=exit;;
1640 -K) shift; knowitall=true;;
1641 -O) shift; override=true;;
1642 -S) shift; silent=true; extractsh=true;;
1647 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1648 echo "$me: ignoring -D $1" >&2
1651 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1652 *) echo "$1='define'" >> optdef.sh;;
1659 *=) echo "$1" >> optdef.sh;;
1661 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1662 echo "$me: ignoring -U $1" >&2
1664 *) echo "$1='undef'" >> optdef.sh;;
1675 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1679 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1680 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1686 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1687 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1688 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1689 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1690 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1691 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1697 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1699 echo "$yyy=''" >> posthint.sh ;;
1704 echo "$yyy='$zzz'" >> posthint.sh ;;
1706 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1708 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1713 echo "$yyy=$zzz" >> posthint.sh ;;
1714 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1718 -V) echo "$me generated by metaconfig 3.5 PL0." >&2
1721 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1729 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1730 [-U symbol] [-U symbol=] [-A command:symbol...]
1731 -d : use defaults for all answers.
1732 -e : go on without questioning past the production of config.sh.
1733 -f : specify an alternate default configuration file.
1734 -h : print this help message and exit (with an error status).
1735 -r : reuse C symbols value if possible (skips costly nm extraction).
1736 -s : silent mode, only echoes questions and essential information.
1737 -D : define symbol to have some value:
1738 -D symbol symbol gets the value 'define'
1739 -D symbol=value symbol gets the value 'value'
1740 common used examples (see INSTALL for more info):
1741 -Duse64bitint use 64bit integers
1742 -Duse64bitall use 64bit integers and pointers
1743 -Dusethreads use thread support
1744 -Dinc_version_list=none do not include older perl trees in @INC
1745 -DEBUGGING=none DEBUGGING options
1746 -Dcc=gcc choose your compiler
1747 -Dprefix=/opt/perl5 choose your destination
1748 -E : stop at the end of questions, after having produced config.sh.
1749 -K : do not use unless you know what you are doing.
1750 -O : let -D and -U override definitions from loaded configuration file.
1751 -S : perform variable substitutions on all .SH files (can mix with -f)
1752 -U : undefine symbol:
1753 -U symbol symbol gets the value 'undef'
1754 -U symbol= symbol gets completely empty
1756 -A : manipulate symbol after the platform specific hints have been applied:
1757 -A append:symbol=value append value to symbol
1758 -A symbol=value like append:, but with a separating space
1759 -A define:symbol=value define symbol to have value
1760 -A clear:symbol define symbol to be ''
1761 -A define:symbol define symbol to be 'define'
1762 -A eval:symbol=value define symbol to be eval of value
1763 -A prepend:symbol=value prepend value to symbol
1764 -A undef:symbol define symbol to be 'undef'
1765 -A undef:symbol= define symbol to be ''
1766 e.g.: -A prepend:libswanted='cl pthread '
1767 -A ccflags=-DSOME_MACRO
1768 -V : print version number and exit (with a zero status).
1775 case "$fastread$alldone" in
1778 case "$extractsh" in
1781 if test ! -t 0; then
1782 echo "Say 'sh Configure', not 'sh <Configure'"
1792 true) exec 1>/dev/null;;
1795 : run the defines and the undefines, if any, but leave the file out there...
1798 : create the posthint manipulation script and leave the file out there...
1803 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1804 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1805 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1806 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1807 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1810 : Some greps do not return status, grrr.
1811 echo "grimblepritz" >grimble
1812 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1814 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1820 : the following should work in any shell
1824 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1825 cat >contains <<'EOSS'
1826 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1831 : Find the path to the source tree
1834 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1838 *) src=`cd ../$src && pwd` ;;
1851 if test -f $rsrc/Configure && \
1852 $contains "^package='$package'\$" $rsrc/Configure >/dev/null 2>&1
1854 : found it, so we are ok.
1857 for src in . .. ../.. ../../.. ../../../..; do
1858 if test -f ../$src/Configure && \
1859 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1870 Sorry, I can't seem to locate the source dir for $package. Please start
1871 Configure with an explicit path -- i.e. /some/path/Configure.
1879 echo "Sources for $package found in \"$src\"." >&4
1883 : script used to extract .SH files with variable substitutions
1884 cat >extract <<'EOS'
1886 echo "Doing variable substitutions on .SH files..."
1887 if test -f MANIFEST; then
1888 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1890 echo "(Looking for .SH files under the source directory.)"
1891 set x `(cd "$src"; find . -name "*.SH" -print)`
1895 0) set x `(cd "$src"; echo *.SH)`; shift;;
1897 if test ! -f "$src/$1"; then
1903 while test $name; do
1904 if test ! -d "$name"; then
1905 create="$name $create";
1906 name=`echo $name | sed -e "s|^[^/]*$||"`;
1907 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1912 for file in $create; do
1921 dir=`expr X$file : 'X\(.*\)/'`
1922 file=`expr X$file : 'X.*/\(.*\)'`
1923 (cd "$dir" && . ./$file)
1933 dir=`expr X$file : 'X\(.*\)/'`
1934 file=`expr X$file : 'X.*/\(.*\)'`
1935 (set x $dir; shift; eval $mkdir_p)
1936 sh <"$src/$dir/$file"
1945 if test -f "$src/config_h.SH"; then
1946 if test ! -f config.h; then
1947 : oops, they left it out of MANIFEST, probably, so do it anyway.
1948 . "$src/config_h.SH"
1953 : extract files and exit if asked to do so
1954 case "$extractsh" in
1956 case "$realsilent" in
1960 case "$config_sh" in
1961 '') config_sh='config.sh';;
1964 echo "Fetching answers from $config_sh..."
1967 test "$override" && . ./optdef.sh
1971 echo "Extraction done."
1976 : Eunice requires " " instead of "", can you believe it
1979 echo "Beginning of configuration questions for $package."
1981 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1983 : first determine how to suppress newline on echo command
1985 echo "Checking echo to see how to suppress newlines..."
1986 (echo "hi there\c" ; echo " ") >.echotmp
1987 if $contains c .echotmp >/dev/null 2>&1 ; then
1998 echo $n "The star should be here-->$c"
2002 : Now test for existence of everything in MANIFEST
2004 if test -f "$rsrc/MANIFEST"; then
2005 echo "First let's make sure your kit is complete. Checking..." >&4
2006 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | \
2007 (split -l 50 2>/dev/null || split -50)
2010 for filelist in x??; do
2011 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` \
2012 >/dev/null 2>>"$tmppwd/missing")
2014 if test -s missing; then
2018 THIS PACKAGE SEEMS TO BE INCOMPLETE.
2020 You have the option of continuing the configuration process, despite the
2021 distinct possibility that your kit is damaged, by typing 'y'es. If you
2022 do, don't blame me if something goes wrong. I advise you to type 'n'o
2023 and contact the author (perlbug@perl.org).
2026 echo $n "Continue? [n] $c" >&4
2030 echo "Continuing..." >&4
2034 echo "ABORTING..." >&4
2039 echo "Looks good..."
2042 echo "There is no MANIFEST file. I hope your kit is complete !"
2046 : Find the appropriate value for a newline for tr
2048 if test -n "$DJGPP"; then
2051 if test X"$trnl" = X; then
2052 case "`echo foo|tr '\n' x 2>/dev/null`" in
2056 if test X"$trnl" = X; then
2057 case "`echo foo|tr '\012' x 2>/dev/null`" in
2058 foox) trnl='\012' ;;
2061 if test X"$trnl" = X; then
2062 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
2063 fooxy) trnl='\n\r' ;;
2066 if test X"$trnl" = X; then
2069 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
2075 : compute the number of columns on the terminal for proper question formatting
2080 : set up the echo used in my read
2081 myecho="case \"\$xxxm\" in
2082 '') echo $n \"\$rp $c\" >&4;;
2084 '') echo $n \"[\$xxxm] $c\";;
2086 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
2088 echo $n \"[\$xxxm] $c\" >&4
2090 echo $n \"\$rp [\$xxxm] $c\" >&4
2096 : now set up to do reads with possible shell escape and default assignment
2102 case "\$fastread" in
2103 yes) case "\$dflt" in
2106 case "\$silent-\$rp" in
2111 *) case "\$silent" in
2112 true) case "\$rp" in
2117 while expr "X\$ans" : "X!" >/dev/null; do
2121 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2129 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2138 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2143 echo "(OK, I'll run with -d after this question.)" >&4
2146 echo "*** Sorry, \$1 not supported yet." >&4
2156 echo "*** Substitution done -- please confirm."
2158 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2163 echo "*** Error -- try again."
2170 case "\$ans\$xxxm\$nostick" in
2182 : create .config dir to save info across Configure sessions
2183 test -d ../.config || mkdir ../.config
2184 cat >../.config/README <<EOF
2185 This directory created by Configure to save information that should
2186 persist across sessions for $package.
2188 You may safely delete it if you wish.
2191 : See if we are using a devel version and want that
2192 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2195 usedevel="$define" ;;
2196 *) case "$xversion" in
2199 *** WHOA THERE!!! ***
2201 This is an UNSTABLE DEVELOPMENT release.
2202 The version of this $package distribution is $xversion, that is, odd,
2203 (as opposed to even) and that signifies a development release.
2204 If you want a maintenance release, you want an even-numbered version.
2206 Do ***NOT*** install this into production use.
2207 Data corruption and crashes are possible.
2209 It is most seriously suggested that you do not continue any further
2210 unless you want to help in developing and debugging Perl.
2212 If you *still* want to build perl, you can answer 'y' now,
2213 or pass -Dusedevel to Configure.
2216 rp='Do you really want to continue?'
2220 [yY]) echo >&4 "Okay, continuing."
2221 usedevel="$define" ;;
2222 *) echo >&4 "Okay, bye."
2233 case "$versiononly" in
2234 '') versiononly="$define" ;;
2236 case "$installusrbinperl" in
2237 '') installusrbinperl="$undef" ;;
2242 : general instructions
2245 user=`(logname) 2>/dev/null`
2247 '') user=`whoami 2>&1`;;
2249 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2252 rp='Would you like to see the instructions?'
2263 This installation shell script will examine your system and ask you questions
2264 to determine how the perl5 package should be installed. If you get
2265 stuck on a question, you may use a ! shell escape to start a subshell or
2266 execute a command. Many of the questions will have default answers in square
2267 brackets; typing carriage return will give you the default.
2269 On some of the questions which ask for file or directory names you are allowed
2270 to use the ~name construct to specify the login directory belonging to "name",
2271 even if you don't have a shell which knows about that. Questions where this is
2272 allowed will be marked "(~name ok)".
2276 dflt='Type carriage return to continue'
2280 The prompter used in this script allows you to use shell variables and
2281 backticks in your answers. You may use $1, $2, etc... to refer to the words
2282 in the default answer, as if the default line was a set of arguments given to a
2283 script shell. This means you may also use $* to repeat the whole default line,
2284 so you do not have to re-type everything to add something to the default.
2286 Every time there is a substitution, you will have to confirm. If there is an
2287 error (e.g. an unmatched backtick), the default answer will remain unchanged
2288 and you will be prompted again.
2290 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2291 the questions and use the computed defaults (or the previous answers if there
2292 was already a config.sh file). Type 'Configure -h' for a list of options.
2293 You may also start interactively and then answer '& -d' at any prompt to turn
2294 on the non-interactive behaviour for the remainder of the execution.
2300 Much effort has been expended to ensure that this shell script will run on any
2301 Unix system. If despite that it blows up on yours, your best bet is to edit
2302 Configure and run it again. If you can't run Configure for some reason,
2303 you'll have to generate a config.sh file by hand. Whatever problems you
2304 have, let me (perlbug@perl.org) know how I blew it.
2306 This installation script affects things in two ways:
2308 1) it may do direct variable substitutions on some of the files included
2310 2) it builds a config.h file for inclusion in C programs. You may edit
2311 any of these files as the need arises after running this script.
2313 If you make a mistake on a question, there is no easy way to back up to it
2314 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2315 files. Configure will offer to let you do this before it runs the SH files.
2318 dflt='Type carriage return to continue'
2320 case "$firsttime" in
2321 true) echo $user >>../.config/instruct;;
2325 : Set 'sysroot' to change the logical root directory to your headers and libraries see man gcc
2326 : This is primarily meant for cross-compile environments, and may fail to be useful in other cases
2327 if test "X$sysroot" = X; then
2332 echo "Using $sysroot to find your headers and libraries, adding to ccflags"
2333 # _sysroot is used in places where we need --sysroot=foo
2334 # but using the rest of the flags could cause issues.
2335 _sysroot="--sysroot=$sysroot";
2339 ccflags="$ccflags $_sysroot"
2344 ldflags="$ldflags $_sysroot"
2349 cppflags="$cppflags $_sysroot"
2351 # lddlflags updated below in lddlflags section;
2352 # same with cccdlflags
2356 # Adjust some defaults to also use $sysroot
2357 for var in xlibpth loclibpth locincpth glibpth; do
2360 for path in $xxx; do
2361 eval $var=\"\$$var $sysroot$path\"
2367 : find out where common programs are
2369 echo "Locating common programs..." >&4
2382 if test -d \$dir/\$thing; then
2388 for thisthing in \$dir/\$thing; do
2389 : just loop through to pick last item
2391 if test -f \$thisthing; then
2394 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2397 elif test -f \$dir/\$thing.exe; then
2398 if test -n "$DJGPP"; then
2399 echo \$dir/\$thing.exe
2400 elif test "$eunicefix" != ":"; then
2401 : on Eunice apparently
2454 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2455 pth="$pth $sysroot/lib $sysroot/usr/lib"
2456 for file in $loclist; do
2460 if test -f "$xxx"; then
2463 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2464 xxx=`./loc $file $file $pth`
2467 '') xxx=`./loc $file $file $pth`;;
2468 *) xxx=`./loc $xxx $xxx $pth`;;
2470 eval $file=$xxx$_exe
2474 echo $file is in $xxx.
2477 echo $file is in $xxx.
2480 echo "I don't know where '$file' is, and my life depends on it." >&4
2481 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2487 echo "Don't worry if any of the following aren't found..."
2489 for file in $trylist; do
2493 if test -f "$xxx"; then
2496 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2497 xxx=`./loc $file $file $pth`
2500 '') xxx=`./loc $file $file $pth`;;
2501 *) xxx=`./loc $xxx $xxx $pth`;;
2503 eval $file=$xxx$_exe
2507 echo $file is in $xxx.
2510 echo $file is in $xxx.
2513 echo "I don't see $file out there, $say."
2520 echo "Substituting grep for egrep."
2527 *) if $less -R </dev/null >/dev/null; then
2528 echo "Substituting less -R for less."
2536 echo "Substituting cp for ln."
2545 echo "I can't find make or gmake, and my life depends on it." >&4
2546 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2554 *) # We can't have osname yet.
2555 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2556 # Assume that gmake, if found, is definitely GNU make
2557 # and prefer it over the system make.
2558 echo "Substituting gmake for make."
2566 echo "Hopefully test is built into your sh."
2569 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2570 echo "Using the test built into your sh."
2578 echo "Hopefully echo is built into your sh."
2583 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2584 $echo $n "hi there$c" >foo1
2585 echo $n "hi there$c" >foo2
2586 if cmp foo1 foo2 >/dev/null 2>&1; then
2587 echo "They are compatible. In fact, they may be identical."
2594 They are not compatible! You are probably running ksh on a non-USG system.
2595 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2596 have echo built in and we may have to run some Bourne shell scripts. That
2597 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2600 $echo $n "The star should be here-->$c"
2607 # This question was auctioned at YAPC::Europe-2007 in Vienna
2608 # I never promised you could answer it. I only auctioned the question.
2610 The following message is sponsored by
2612 Dresden.pm<--The stars should be here.
2614 Dear Perl user, system administrator or package
2615 maintainer, the Perl community sends greetings to
2616 you. Do you (emblematical) greet back [Y/n]? n
2620 : Check what type of C compiler we use
2624 cat <<'EOSC' >>trygcc
2629 int main(int argc, char *argv[]) {
2633 if $cc -o try $ccflags $ldflags try.c; then
2636 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2642 # Skip this test because it gives a false match on output like:
2643 # ./trygcc: line 23: cc: command not found
2644 # case "`$cc -v -c try.c 2>&1`" in
2645 # *gcc*) trygcc=no ;;
2647 if $test X"$trygcc" = Xyes; then
2648 if gcc -o try -c try.c; then
2650 echo "You seem to have a working gcc, though." >&4
2651 # Switching compilers may undo the work of hints files.
2652 # The most common problem is -D_REENTRANT for threads.
2653 # This heuristic catches that case, but gets false positives
2654 # if -Dusethreads was not actually specified. Better to
2655 # bail out here with a useful message than fail
2656 # mysteriously later. Should we perhaps just try to
2657 # re-invoke Configure -Dcc=gcc config_args ?
2658 if $test -f usethreads.cbu; then
2661 *** However, any setting of the C compiler flags (e.g. for thread support)
2662 *** will be lost. It may be necessary for you to restart Configure and
2663 *** add -Dcc=gcc to your Configure command line.
2666 rp="Would you like to go ahead and try gcc anyway?"
2669 rp="Would you like to use it?"
2672 if $test -f myread; then
2675 if $test -f UU/myread; then
2678 echo "Cannot find myread, sorry. Aborting." >&2
2683 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2696 cat <<'EOSC' >>checkcc
2701 int main(int argc, char *argv[]) {
2705 if $cc -o try $ccflags $ldflags try.c; then
2708 if $test X"$despair" = Xyes; then
2709 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2712 You need to find a working C compiler.
2713 Either (purchase and) install the C compiler supplied by your OS vendor,
2714 or for a free C compiler try http://gcc.gnu.org/
2715 I cannot continue any further, aborting.
2724 : determine whether symbolic links are supported
2727 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2728 echo "Symbolic links are supported." >&4
2731 echo "Symbolic links are NOT supported." >&4
2736 : determine whether symbolic links are supported
2740 echo "Checking how to test for symbolic links..." >&4
2742 if $test "X$issymlink" = X; then
2744 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2745 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2747 if test $? = 0; then
2750 echo "Your builtin 'test -h' may be broken." >&4
2753 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2756 if test -f "$p/$test"; then
2765 echo "Trying external '$test -h'." >&4
2766 issymlink="$test -h"
2767 if $test ! -h sym >/dev/null 2>&1; then
2768 echo "External '$test -h' is broken, too." >&4
2776 if $test "X$issymlink" = X; then
2777 if $test -L sym 2>/dev/null; then
2778 issymlink="$test -L"
2779 echo "The builtin '$test -L' worked." >&4
2782 if $test "X$issymlink" != X; then
2783 echo "You can test for symbolic links with '$issymlink'." >&4
2785 echo "I do not know how you can test for symbolic links." >&4
2789 *) echo "No symbolic links, so not testing for their testing..." >&4
2794 : Make symlinks util
2795 case "$mksymlinks" in
2798 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2801 *) case "$lns:$issymlink" in
2802 *"ln"*" -s:"*"test -"?)
2803 echo "Creating the symbolic links..." >&4
2804 echo "(First creating the subdirectories...)" >&4
2806 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2808 test -z "$directory" && break
2812 if test ! -d t/base; then
2813 echo "Failed to create the subdirectories. Aborting." >&4
2816 echo "(Then creating the symlinks...)" >&4
2817 awk '{print $1}' $src/MANIFEST | while true; do
2819 test -z "$filename" && break
2820 if test -f $filename; then
2821 if $issymlink $filename; then
2825 if test -f $filename; then
2826 echo "$filename already exists, not symlinking."
2828 ln -s $src/$filename $filename
2832 if test ! -f t/base/lex.t; then
2833 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2838 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2846 : Check for Cross-Compilation
2847 if $test "X$targethost" = "X"; then
2850 if $test "X$targetenv" = "X"; then
2853 case "$usecrosscompile" in
2855 $echo "Cross-compiling..."
2858 *-gcc*|*-g++*) # A cross-compiling gcc, probably.
2859 # arm-linux-androideabi-gcc -> arm-linux-androideabi
2860 # x86_64-w64-mingw32-gcc.exe -> x86_64-w64-mingw32
2861 targetarch=`$echo $cc|$sed 's/-g[c\+][c\+].*$//'`
2862 ar=`$echo $cc|$sed 's/-g[c\+][c\+]/-ar/'`
2863 # leave out ld, choosing it is more complex
2864 nm=`$echo $cc|$sed 's/-g[c\+][c\+]/-nm/'`
2865 ranlib=`$echo $cc|$sed 's/-g[c\+][c\+]/-ranlib/'`
2866 # We are in a weird spot. Just before us, some values
2867 # were 'saved', to be restored after the hints are
2868 # run. This means that the changes we made to ar,
2869 # nm and ranlib will get reverted.
2870 # To avoid that, we hijack the saving mechanism and
2871 # have it save our new values.
2872 for file in ar nm ranlib; do
2874 eval $file=$xxx$_exe
2879 case "$targetarch" in
2880 '') echo "Targetarch not defined." >&4; croak=y ;;
2881 *) echo "Using targetarch $targetarch." >&4 ;;
2883 case "$targethost" in
2884 '') echo "Targethost not defined." >&4; croak=y ;;
2885 *) echo "Using targethost $targethost." >&4
2890 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2892 : compile a host miniperl and generate_uudmap, unless we got passed them
2893 if $test "X$hostperl" = X; then
2894 echo "Building host miniperl and generate_uudmap binaries" >&4
2902 $src/Configure -des -Dusedevel -Dmksymlinks
2904 case "$hostgenerate" in
2905 '') $make generate_uudmap
2906 hostgenerate=$src/host/generate_uudmap
2908 "$undef") hostgenerate=''
2911 hostperl=$src/host/miniperl
2914 hostosname=`$hostperl -le 'print $^O'`
2917 usecrosscompile="$undef"
2921 : Define -Dtargethost=somecomputer to run compiled tests on another machine
2922 case "$targethost" in
2923 '') echo "Checking for cross-compile" >&4
2924 case "$usecrosscompile$multiarch" in
2925 *$define*) echo "Skipping the try tests in the rest of Configure as no targethost was defined when cross-compiling" >&4
2926 if [ -f Makefile ]; then
2928 echo "Now you must ensure config.sh, config.h and the generated headers exist and run a $make."
2930 echo "Configure done."
2934 *) echo "No targethost for running compiler tests against defined, running locally" >&4
2941 *) echo "Using targethost $targethost." >&4
2943 /*) run=$src/Cross/run
2944 targetmkdir=$src/Cross/mkdir
2946 from=$src/Cross/from
2948 *) pwd=`$test -f ../Configure & cd ..; pwd`
2950 targetmkdir=$pwd/Cross/mkdir
2952 from=$pwd/Cross/from
2955 case "$targetrun" in
2956 '') targetrun=ssh ;;
2961 case "$targetfrom" in
2962 '') targetfrom=scp ;;
2966 from=$from-$targetfrom
2967 case "$targetdir" in
2969 echo "Guessing targetdir $targetdir." >&4
2972 case "$targetuser" in
2974 echo "Guessing targetuser $targetuser." >&4
2977 case "$targetport" in
2979 echo "Guessing targetport $targetport." >&4
2982 case "$targetfrom" in
2986 case "$targetrun" in
3006 '') cwd=$targetdir ;;
3011 $targetrun -p $targetport -l $targetuser $targethost "cd \$cwd && \$env \$exe \$@"
3017 *) echo "Unknown targetrun '$targetrun'" >&4
3021 case "$targetmkdir" in
3023 cat >$targetmkdir <<EOF
3025 $targetrun -p $targetport -l $targetuser $targethost "mkdir -p \$@"
3027 $chmod a+rx $targetmkdir
3029 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
3041 $targetmkdir \`dirname \$f\`
3042 $targetto -P $targetport -r $q \$f $targetuser@$targethost:\$f 2>/dev/null || exit 1
3045 $targetmkdir $targetdir/\`dirname \$f\`
3046 $targetto -P $targetport -r $q \$f $targetuser@$targethost:$targetdir/\$f 2>/dev/null || exit 1
3059 $mkdir -p $targetdir/\`dirname \$f\`
3060 $cp \$f $targetdir/\$f || exit 1
3063 $targetmkdir $targetdir/\`dirname \$f\`
3064 $cp \$f $targetdir/\$f || exit 1
3071 *) echo "Unknown targetto '$targetto'" >&4
3075 case "$targetfrom" in
3082 $targetfrom -P $targetport $q $targetuser@$targethost:$targetdir/\$f . || exit 1
3087 cp) cat >$from <<EOF
3092 cp $targetdir/\$f . || exit 1
3097 *) echo "Unknown targetfrom '$targetfrom'" >&4
3101 if $test ! -f $run; then
3102 echo "Target 'run' script '$run' not found." >&4
3106 if $test ! -f $to; then
3107 echo "Target 'to' script '$to' not found." >&4
3111 if $test ! -f $from; then
3112 echo "Target 'from' script '$from' not found." >&4
3116 if $test ! -f $run -o ! -f $to -o ! -f $from; then
3120 Using '$run' for remote execution,
3121 and '$from' and '$to'
3122 for remote file transfer.
3128 usecrosscompile="$undef"
3133 : see whether [:lower:] and [:upper:] are supported character classes
3135 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
3137 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
3141 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
3142 # (0xd9 and 0xe2), therefore that is a nice testing point.
3143 if test "X$up" = X -o "X$low" = X; then
3144 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
3150 if test "X$up" = X -o "X$low" = X; then
3151 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
3157 if test "X$up" = X -o "X$low" = X; then
3158 case "`echo RS | od -x 2>/dev/null`" in
3160 echo "Hey, this might be EBCDIC." >&4
3161 if test "X$up" = X -o "X$low" = X; then
3162 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
3163 rs) up='[A-IJ-RS-Z]'
3168 if test "X$up" = X -o "X$low" = X; then
3169 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
3179 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
3181 echo "Using $up and $low to convert case." >&4
3184 echo "I don't know how to translate letters from upper to lower case." >&4
3185 echo "Your tr is not acting any way I know of." >&4
3189 : set up the translation script tr, must be called with ./tr of course
3193 '[A-Z][a-z]') exec $tr '$up' '$low';;
3194 '[a-z][A-Z]') exec $tr '$low' '$up';;
3201 : Try to determine whether config.sh was made on this system
3202 case "$config_sh" in
3204 myuname=`$uname -a 2>/dev/null`
3205 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
3206 # Downcase everything to avoid ambiguity.
3207 # Remove slashes and single quotes so we can use parts of this in
3208 # directory and file names.
3209 # Remove newlines so myuname is sane to use elsewhere.
3210 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
3211 # because the A-Z/a-z are not consecutive.
3212 myuname=`echo $myuname | $sed -e "s,['/],,g" | \
3213 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
3214 newmyuname="$myuname"
3216 case "$knowitall" in
3218 if test -f ../config.sh; then
3219 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3220 eval "`grep myuname= ../config.sh`"
3222 if test "X$myuname" = "X$newmyuname"; then
3230 : Get old answers from old config file if Configure was run on the
3231 : same system, otherwise use the hints.
3234 if test -f config.sh; then
3236 rp="I see a config.sh file. Shall I use it to set the defaults?"
3239 n*|N*) echo "OK, I'll ignore it."
3240 mv config.sh config.sh.old
3241 myuname="$newmyuname"
3243 *) echo "Fetching default answers from your old config.sh file..." >&4
3251 : Older versions did not always set $sh. Catch re-use of such
3261 if test ! -f config.sh; then
3264 First time through, eh? I have some defaults handy for some systems
3265 that need some extra help getting the Configure answers right:
3268 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3270 : Half the following guesses are probably wrong... If you have better
3271 : tests or hints, please send them to perlbug@perl.org
3272 : The metaconfig authors would also appreciate a copy...
3273 $test -f /irix && osname=irix
3274 $test -f /xenix && osname=sco_xenix
3275 $test -f /dynix && osname=dynix
3276 $test -f /dnix && osname=dnix
3277 $test -f /lynx.os && osname=lynxos
3278 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3279 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3280 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3281 $test -f /bin/mips && /bin/mips && osname=mips
3282 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
3283 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
3284 $test -d /usr/apollo/bin && osname=apollo
3285 $test -f /etc/saf/_sactab && osname=svr4
3286 $test -d /usr/include/minix && osname=minix
3287 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3288 if $test -d /MachTen -o -d /MachTen_Folder; then
3290 if $test -x /sbin/version; then
3291 osvers=`/sbin/version | $awk '{print $2}' |
3292 $sed -e 's/[A-Za-z]$//'`
3293 elif $test -x /usr/etc/version; then
3294 osvers=`/usr/etc/version | $awk '{print $2}' |
3295 $sed -e 's/[A-Za-z]$//'`
3301 $test -f /sys/posix.dll &&
3302 $test -f /usr/bin/what &&
3303 set X `/usr/bin/what /sys/posix.dll` &&
3304 $test "$3" = UWIN &&
3308 if $test -f $uname; then
3316 umips) osname=umips ;;
3319 [23]100) osname=mips ;;
3320 next*) osname=next ;;
3322 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3323 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3326 elif $test -f /etc/kconfig; then
3328 if test "$lns" = "$ln -s"; then
3330 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3332 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3339 if test -n "$DJGPP"; then
3348 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3350 # oslevel can fail with:
3351 # oslevel: Unable to acquire lock.
3352 *not\ found) osvers="$4"."$3" ;;
3353 '<3240'|'<>3240') osvers=3.2.0 ;;
3354 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3355 '=3250'|'>3250') osvers=3.2.5 ;;
3359 bitrig) osname=bitrig
3362 bsd386) osname=bsd386
3365 cygwin*) osname=cygwin
3368 *dc.osx) osname=dcosx
3374 domainos) osname=apollo
3380 dragonfly) osname=dragonfly
3383 dynixptx*) osname=dynixptx
3384 osvers=`echo "$4"|sed 's/^v//'`
3386 freebsd) osname=freebsd
3388 genix) osname=genix ;;
3392 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3405 $test -f /system/lib/libandroid.so && osname=linux-android
3409 netbsd*) osname=netbsd
3412 news-os) osvers="$3"
3414 4*) osname=newsos4 ;;
3418 next*) osname=next ;;
3419 nonstop-ux) osname=nonstopux ;;
3420 openbsd) osname=openbsd
3426 POSIX-BC | posix-bc ) osname=posix-bc
3429 powerux | power_ux | powermax_os | powermaxos | \
3430 powerunix | power_unix) osname=powerux
3436 solaris) osname=solaris
3438 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3445 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3449 titanos) osname=titanos
3458 ultrix) osname=ultrix
3461 osf1|mls+) case "$5" in
3464 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3467 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3470 hp*) osname=hp_osf1 ;;
3471 mips) osname=mips_osf1 ;;
3474 # UnixWare 7.1.2 is known as Open UNIX 8
3475 openunix|unixware) osname=svr5
3483 $2) case "$osname" in
3487 : svr4.x or possibly later
3497 if test -f /stand/boot ; then
3498 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3499 if test -n "$INITPROG" -a -f "$INITPROG"; then
3500 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3501 if test -n "$isesix"; then
3509 *) if test -f /etc/systemid; then
3511 set `echo $3 | $sed 's/\./ /g'` $4
3512 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3514 elif $test -f $src/hints/sco_$1_$2.sh; then
3516 elif $test -f $src/hints/sco_$1.sh; then
3521 '') : Still unknown. Probably a generic Sys V.
3530 *) case "$osname" in
3531 '') : Still unknown. Probably a generic BSD.
3539 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3540 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3541 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3544 $rm -f UU/kernel.what
3545 elif test -d c:/. -o -n "$is_os2" ; then
3552 case "$targetarch" in
3555 case "$targetarch" in
3557 # Will load qnx.sh, which should change osname to nto
3562 # Catch arm-linux-androideabi, mipsel-linux-android,
3563 # and i686-linux-android
3564 osname=linux-android
3568 # Something like arm-linux-gnueabihf is really just
3575 # XXX perhaps we should just assume
3576 # osvers to be 2, or maybe take the value
3577 # from targetarch. Using $run before the
3578 # hints are run is somewhat icky.
3579 set X `$run $uname -a 2>/dev/null`
3582 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3587 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3594 : Now look for a hint file osname_osvers, unless one has been
3595 : specified already.
3598 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3599 : Also try without trailing minor version numbers.
3600 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3601 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3602 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3603 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3606 *) case "$osvers" in
3609 *) if $test -f $src/hints/$file.sh ; then
3611 elif $test -f $src/hints/$xfile.sh ; then
3613 elif $test -f $src/hints/$xxfile.sh ; then
3615 elif $test -f $src/hints/$xxxfile.sh ; then
3617 elif $test -f $src/hints/$xxxxfile.sh ; then
3619 elif $test -f "$src/hints/${osname}.sh" ; then
3628 if $test -f Policy.sh ; then
3631 none) dflt="Policy" ;;
3632 *) dflt="Policy $dflt" ;;
3637 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3641 if $test -f Policy.sh ; then
3644 There's also a Policy hint file available, which should make the
3645 site-specific (policy) questions easier to answer.
3652 You may give one or more space-separated answers, or "none" if appropriate.
3653 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3654 previous run of Configure, you may specify it as well as or instead of
3655 OS-specific hints. If hints are provided for your OS, you should use them:
3656 although Perl can probably be built without hints on many platforms, using
3657 hints often improve performance and may enable features that Configure can't
3658 set up on its own. If there are no hints that match your OS, specify "none";
3659 DO NOT give a wrong version or a wrong OS.
3663 rp="Which of these apply, if any?"
3666 for file in $tans; do
3667 if $test X$file = XPolicy -a -f Policy.sh; then
3669 $cat Policy.sh >> UU/config.sh
3670 elif $test -f $src/hints/$file.sh; then
3671 . $src/hints/$file.sh
3672 $cat $src/hints/$file.sh >> UU/config.sh
3673 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3676 : Give one chance to correct a possible typo.
3677 echo "$file.sh does not exist"
3679 rp="hint to use instead?"
3681 for file in $ans; do
3682 if $test -f "$src/hints/$file.sh"; then
3683 . $src/hints/$file.sh
3684 $cat $src/hints/$file.sh >> UU/config.sh
3685 elif $test X$ans = X -o X$ans = Xnone ; then
3688 echo "$file.sh does not exist -- ignored."
3695 : Remember our hint file for later.
3696 if $test -f "$src/hints/$file.sh" ; then
3706 echo "Fetching default answers from $config_sh..." >&4
3710 cp $config_sh config.sh 2>/dev/null
3720 test "$override" && . ./optdef.sh
3722 : Restore computed paths
3723 for file in $loclist $trylist; do
3724 eval $file="\$_$file"
3729 Configure uses the operating system name and version to set some defaults.
3730 The default value is probably right if the name rings a bell. Otherwise,
3731 since spelling matters for me, either accept the default or answer "none"
3738 ''|' '|none) dflt=none ;;
3739 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3742 *) dflt="$osname" ;;
3744 rp="Operating system name?"
3748 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3754 ''|' '|none) dflt=none ;;
3755 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3756 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3758 ''|' ') dflt=none ;;
3763 *) dflt="$osvers" ;;
3765 rp="Operating system version?"
3775 : who configured the system
3776 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3779 cf_by=`(logname) 2>/dev/null`
3782 cf_by=`(whoami) 2>/dev/null`
3784 "") cf_by=unknown ;;
3789 : decide how portable to be. Allow command line overrides.
3790 case "$d_portable" in
3792 *) d_portable="$define" ;;
3795 : set up shell script to do ~ expansion
3801 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3804 if $test -f /bin/csh; then
3805 /bin/csh -f -c "glob \$1"
3810 name=\`$expr x\$1 : '..\([^/]*\)'\`
3811 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3812 if $test ! -d "\$dir"; then
3814 echo "\$me: can't locate home directory for: \$name" >&2
3819 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3835 : now set up to get a file name
3839 cat <<'EOSC' >>getfile
3855 : getfile will accept an answer from the comma-separated list
3856 : enclosed in parentheses even if it does not meet other criteria.
3857 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3858 fn=`echo $fn | sed 's/(.*)//'`
3864 loc_file=`expr $fn : '.*:\(.*\)'`
3865 fn=`expr $fn : '\(.*\):.*'`
3873 */*) fullpath=true;;
3882 *e*) exp_file=true;;
3885 *p*) nopath_ok=true;;
3890 *d*) type='Directory';;
3891 *l*) type='Locate';;
3896 Locate) what='File';;
3901 case "$d_portable" in
3909 while test "$type"; do
3914 true) rp="$rp (~name ok)";;
3917 if test -f UU/getfile.ok && \
3918 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3937 value=`UU/filexp $ans`
3940 if test "$ans" != "$value"; then
3941 echo "(That expands to $value on this system.)"
3955 /*) value="$ansexp" ;;
3956 [a-zA-Z]:/*) value="$ansexp" ;;
3961 echo "I shall only accept a full path name, as in /bin/ls." >&4
3962 echo "Use a ! shell escape if you wish to check pathnames." >&4
3965 echo "Please give a full path name, starting with slash." >&4
3968 echo "Note that using ~name is ok provided it expands well." >&4
3981 for fp in $gfpth; do
3982 if test "X$fp" = X.; then
3987 if test -f "$pf"; then
3989 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3991 echo "($value is not a plain file, but that's ok.)"
3994 if test X"$type" = X; then
4001 for fp in $gfpth; do
4002 if test "X$fp" = X.; then
4007 direxp="$fp/$ansexp"
4009 if test -d "$direxp"; then
4017 if test -d "$ansexp"; then
4018 echo "(Looking for $loc_file in directory $value.)"
4019 value="$value/$loc_file"
4020 ansexp="$ansexp/$loc_file"
4022 if test -f "$ansexp"; then
4025 case "$nopath_ok" in
4026 true) case "$value" in
4028 *) echo "Assuming $value will be in people's path."
4044 if test "$fastread" = yes; then
4049 rp="$what $value doesn't exist. Use that name anyway?"
4068 test "X$gfpthkeep" != Xy && gfpth=""
4071 : determine root of directory hierarchy where package will be installed.
4074 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
4077 dflt=`echo "$prefix" | sed 's/.$//'`
4085 By default, $package will be installed in $dflt/bin, manual pages
4086 under $dflt/man, etc..., i.e. with $dflt as prefix for all
4087 installation directories. Typically this is something like /usr/local.
4088 If you wish to have binaries under /usr/bin but other parts of the
4089 installation under /usr/local, that's ok: you will be prompted
4090 separately for each of the installation directories, the prefix being
4091 only used to set the defaults.
4095 rp='Installation prefix to use?'
4103 *) oldprefix="$prefix";;
4110 : allow them to override the AFS root
4113 *) afsroot=$afsroot ;;
4119 $define|true) afs=true ;;
4120 $undef|false) afs=false ;;
4121 *) if $test -d $afsroot; then
4129 echo "AFS may be running... I'll be extra cautious then..." >&4
4131 echo "AFS does not seem to be running..." >&4
4134 : determine installation prefix for where package is to be installed.
4138 Since you are running AFS, I need to distinguish the directory in which
4139 files will reside from the directory in which they are installed (and from
4140 which they are presumably copied to the former directory by occult means).
4143 case "$installprefix" in
4144 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
4145 *) dflt="$installprefix";;
4150 In some special cases, particularly when building $package for distribution,
4151 it is convenient to distinguish the directory in which files should be
4152 installed from the directory ($prefix) in which they will
4153 eventually reside. For most users, these two directories are the same.
4156 case "$installprefix" in
4158 *) dflt=$installprefix;;
4162 rp='What installation prefix should I use for installing files?'
4164 installprefix="$ans"
4165 installprefixexp="$ansexp"
4167 : Perform the prefixexp/installprefixexp correction if necessary
4168 cat <<EOS >installprefix
4171 cat <<'EOSC' >>installprefix
4172 : Change installation prefix, if necessary.
4173 if $test X"$prefix" != X"$installprefix"; then
4174 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
4176 eval "install${prefixvar}=\"\$${prefixvar}exp\""
4179 chmod +x installprefix
4180 $eunicefix installprefix
4182 : Set variables such as privlib and privlibexp from the output of ./getfile
4183 : performing the prefixexp/installprefixexp correction if necessary.
4184 cat <<EOS >setprefixvar
4187 cat <<'EOSC' >>setprefixvar
4188 eval "${prefixvar}=\"\$ans\""
4189 eval "${prefixvar}exp=\"\$ansexp\""
4192 chmod +x setprefixvar
4193 $eunicefix setprefixvar
4195 : set up the script used to warn in case of inconsistency
4204 '') echo "The $hint value for \$$var on this machine was \"$was\"!" >&4
4206 *) echo "Hmm. Based on the hints in hints/$hintfile.sh, " >&4
4207 echo "the $hint value for \$$var on this machine was \"$was\"!" >&4
4212 echo "*** WHOA THERE!!! ***" >&4
4213 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
4216 rp=" Keep the $hint value?"
4219 y) td=$was; tu=$was;;
4223 : function used to set '$1' to '$val'
4224 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
4226 $define$undef) . ./whoa; eval "$var=\$td";;
4227 $undef$define) . ./whoa; eval "$var=\$tu";;
4228 *) eval "$var=$val";;
4231 : get the patchlevel
4233 echo "Getting the current patchlevel..." >&4
4234 if $test -r $rsrc/patchlevel.h;then
4235 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
4236 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4237 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4238 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4239 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4240 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4241 perl_patchlevel=`egrep ',"(MAINT|SMOKE)[0-9][0-9]*"' $rsrc/patchlevel.h|tail -1|sed 's/[^0-9]//g'`
4250 $echo "(You do not have patchlevel.h. Eek.)"
4252 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
4253 version_patchlevel_string="version $patchlevel subversion $subversion"
4254 case "$perl_patchlevel" in
4256 *) perl_patchlevel=`echo $perl_patchlevel | sed 's/.* //'`
4257 version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel"
4261 $echo "(You have $package $version_patchlevel_string.)"
4265 : XXX Should be a Configure test for double-dots in filenames.
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 version=`echo $revision $patchlevel $subversion | \
4273 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4274 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4275 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4278 : Special case the 5.005_xx maintenance series, which used 5.005
4279 : without any subversion label as a subdirectory in $sitelib
4280 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4281 api_versionstring='5.005'
4284 : Do we want threads support and if so, what type
4285 case "$usethreads" in
4286 $define|true|[yY]*) dflt='y';;
4287 *) # Catch case where user specified ithreads or 5005threads but
4288 # forgot -Dusethreads (A.D. 4/2002)
4289 case "$useithreads$use5005threads" in
4290 *$define*) dflt='y';;
4297 Perl can be built to offer a form of threading support on some systems
4298 To do so, Configure can be run with -Dusethreads.
4300 Note that Perl built with threading support runs slightly slower
4301 and uses slightly more memory than plain Perl.
4303 If this doesn't make any sense to you, just accept the default '$dflt'.
4305 rp='Build a threading Perl?'
4308 y|Y) val="$define" ;;
4314 if $test $patchlevel -lt 9; then
4315 case "$usethreads" in
4317 : Default to ithreads unless overridden on command line or with
4320 case "$use5005threads" in
4322 echo "5.005 threads are no longer supported"
4326 case "$useithreads" in
4327 $undef|false|[nN]*) dflt='n';;
4329 rp='Use the newer interpreter-based ithreads?'
4332 y|Y) val="$define" ;;
4337 : Now set use5005threads to the opposite value.
4338 case "$useithreads" in
4339 $define) val="$undef" ;;
4346 useithreads="$undef"
4347 use5005threads="$undef"
4351 case "$useithreads$use5005threads" in
4355 You cannot have both the ithreads and the 5.005 threads enabled
4356 at the same time. Disabling the 5.005 threads since they are
4357 much less stable than the ithreads.
4360 use5005threads="$undef"
4365 : perl-5.9.x and later
4367 if test X"$usethreads" = "X$define"; then
4368 case "$use5005threads" in
4372 5.005 threads has been removed for 5.10. Perl will be built using ithreads.
4379 use5005threads="$undef"
4380 useithreads="$usethreads"
4383 case "$d_oldpthreads" in
4384 '') : Configure tests would be welcome here. For now, assume undef.
4386 *) val="$d_oldpthreads" ;;
4392 : Look for a hint-file generated 'call-back-unit'. If the
4393 : user has specified that a threading perl is to be built,
4394 : we may need to set or change some other defaults.
4395 if $test -f usethreads.cbu; then
4396 echo "Your platform has some specific hints regarding threaded builds, using them..."
4399 case "$usethreads" in
4400 "$define"|true|[yY]*)
4402 (Your platform does not have any specific hints for threaded builds.
4403 Assuming POSIX threads, then.)
4409 : Check if multiplicity is required
4412 Perl can be built so that multiple Perl interpreters can coexist
4413 within the same Perl executable.
4416 case "$useithreads" in
4419 This multiple interpreter support is required for interpreter-based threads.
4423 *) case "$usemultiplicity" in
4424 $define|true|[yY]*) dflt='y';;
4428 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4429 rp='Build Perl for multiplicity?'
4432 y|Y) val="$define" ;;
4440 : Check if morebits is requested
4441 case "$usemorebits" in
4442 "$define"|true|[yY]*)
4443 use64bitint="$define"
4444 uselongdouble="$define"
4445 usemorebits="$define"
4447 *) usemorebits="$undef"
4451 : Determine the C compiler to be used
4457 rp="Use which C compiler?"
4461 : See whether they have no cc but they do have gcc
4463 if $test -f cc.cbu; then
4468 : make some quick guesses about what we are up against
4470 $echo $n "Hmm... $c"
4480 $cat $sysroot/usr/include/signal.h $sysroot/usr/include/sys/signal.h >foo 2>/dev/null
4481 if test -f /osf_boot || $contains 'OSF/1' $sysroot/usr/include/ctype.h >/dev/null 2>&1
4483 echo "Looks kind of like an OSF/1 system, but we'll see..."
4485 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4486 xxx=`./loc addbib blurfl $pth`
4487 if $test -f $xxx; then
4488 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4492 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4493 echo "Looks kind of like an extended USG system, but we'll see..."
4495 echo "Looks kind of like a USG system, but we'll see..."
4499 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4500 echo "Looks kind of like a BSD system, but we'll see..."
4504 echo "Looks kind of like a Version 7 system, but we'll see..."
4507 case "$eunicefix" in
4510 There is, however, a strange, musty smell in the air that reminds me of
4511 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4515 : it so happens the Eunice I know will not run shell scripts in Unix format
4519 echo "Congratulations. You aren't running Eunice."
4523 : Detect OS2. The p_ variable is set above in the Head.U unit.
4524 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4525 : semicolon as a patch separator
4530 I have the feeling something is not exactly right, however...don't tell me...
4531 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4532 (Or you may be running DOS with DJGPP.)
4537 if test -f /xenix; then
4538 echo "Actually, this looks more like a XENIX system..."
4543 echo "It's not Xenix..."
4548 if test -f /venix; then
4549 echo "Actually, this looks more like a VENIX system..."
4556 echo "Nor is it Venix..."
4559 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4560 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4563 : Check if we are using GNU gcc and what its version is
4565 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4569 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4571 printf("%s\n", __VERSION__);
4573 printf("%s\n", "1");
4579 if $cc -o try $ccflags $ldflags try.c; then
4580 gccversion=`$run ./try`
4581 case "$gccversion" in
4582 '') echo "You are not using GNU cc." ;;
4583 *) echo "You are using GNU cc $gccversion."
4589 echo "*** WHOA THERE!!! ***" >&4
4590 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4591 case "$knowitall" in
4593 echo " You'd better start hunting for one and let me know about it." >&4
4599 case "$gccversion" in
4600 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4602 case "$gccversion" in
4603 '') gccosandvers='' ;;
4604 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4605 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4607 case "$gccosandvers" in
4608 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4609 $osname$osvers) ;; # looking good
4610 $osname*) cat <<EOM >&4
4612 *** WHOA THERE!!! ***
4614 Your gcc has not been compiled for the exact release of
4615 your operating system ($gccosandvers versus $osname$osvers).
4617 In general it is a good idea to keep gcc synchronized with
4618 the operating system because otherwise serious problems
4619 may ensue when trying to compile software, like Perl.
4621 I'm trying to be optimistic here, though, and will continue.
4622 If later during the configuration and build icky compilation
4623 problems appear (headerfile conflicts being the most common
4624 manifestation), I suggest reinstalling the gcc to match
4625 your operating system release.
4629 *) gccosandvers='' ;; # failed to parse, better be silent
4637 # gcc 3.* complain about adding -Idirectories that they already know about,
4638 # so we will take those off from locincpth.
4639 case "$gccversion" in
4641 echo "main(){}">try.c
4642 for incdir in $locincpth; do
4643 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4644 grep '^c[cp]p*[01]: warning: changing search order '`
4645 if test "X$warn" != X; then
4646 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4652 # gcc 4.9 by default does some optimizations that break perl.
4653 # see ticket 121505.
4655 # The -fwrapv disables those optimizations (and probably others,) so
4656 # for gcc 4.9 (and later, since the optimizations probably won't go
4657 # away), add -fwrapv unless the user requests -fno-wrapv, which
4658 # disables -fwrapv, or if the user requests -fsanitize=undefined,
4659 # which turns the overflows -fwrapv ignores into runtime errors.
4660 case "$gccversion" in
4661 4.[3-9].*|4.[1-9][0-9]*|[5-9].*|[1-9][0-9]*)
4663 *-fno-wrapv*|*-fsanitize=undefined*|*-fwrapv*) ;;
4664 *) ccflags="$ccflags -fwrapv" ;;
4668 : What should the include directory be ?
4669 : Use sysroot if set, so findhdr looks in the right place.
4671 $echo $n "Hmm... $c"
4672 dflt="$sysroot/usr/include"
4675 if $test -f /bin/mips && /bin/mips; then
4676 echo "Looks like a MIPS system..."
4677 $cat >usr.c <<'EOCP'
4678 #ifdef SYSTYPE_BSD43
4682 if $cc $cppflags -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4683 dflt='/bsd43/usr/include'
4687 mips_type='System V'
4689 $rm -f usr.c usr.out
4690 echo "and you're compiling with the $mips_type compiler and libraries."
4694 echo "Doesn't look like a MIPS system."
4704 case "$xxx_prompt" in
4707 rp='Where are the include files you want to use?'
4715 : see how we invoke the C preprocessor
4717 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4718 cat <<'EOT' >testcpp.c
4724 if test ! -f cppstdin; then
4725 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4726 # AIX cc -E doesn't show the absolute headerfile
4727 # locations but we'll cheat by using the -M flag.
4728 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
4730 echo 'cat >.$$.c; '"$cc $cppflags"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4733 echo "Keeping your $hint cppstdin wrapper."
4736 wrapper=`pwd`/cppstdin
4740 if $test "X$cppstdin" != "X" && \
4741 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4742 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4744 echo "You used to use $cppstdin $cppminus so we'll use that again."
4746 '') echo "But let's see if we can live without a wrapper..." ;;
4748 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4749 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4751 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4754 echo "(However, $cpprun $cpplast does not work, let's see...)"
4762 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4769 elif echo '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"' -E -" will work...'; \
4776 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4777 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4778 echo "Yup, it does."
4779 x_cpp="$cc $cppflags -E"
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 "Yipee, that works!"
4785 x_cpp="$cc $cppflags -P"
4787 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4788 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4789 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4790 echo "At long last!"
4791 x_cpp="$cc $cppflags -P"
4793 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4794 $cpp <testcpp.c >testcpp.out 2>&1; \
4795 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4797 x_cpp="$cpp $cppflags"
4799 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4800 $cpp - <testcpp.c >testcpp.out 2>&1; \
4801 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4802 echo "Hooray, it works! I was beginning to wonder."
4803 x_cpp="$cpp $cppflags"
4805 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4806 $wrapper <testcpp.c >testcpp.out 2>&1; \
4807 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4813 rp="No dice. I can't find a C preprocessor. Name one:"
4817 $x_cpp <testcpp.c >testcpp.out 2>&1
4818 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4819 echo "OK, that will do." >&4
4821 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4836 echo "Perhaps can we force $cc -E using a wrapper..."
4837 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4838 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4844 echo "Nope, we'll have to live without it..."
4858 "$wrapper"|'cppstdin') ;;
4859 *) $rm -f $wrapper;;
4861 $rm -f testcpp.c testcpp.out
4863 : Adjust cppfilter for path component separator
4865 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
4866 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
4870 : Use gcc to determine libpth and incpth
4871 # If using gcc or clang, we can get better values for libpth, incpth
4872 # and usrinc directly from the compiler.
4873 # Note that ccname for clang is also gcc.
4876 $echo 'extern int foo;' > try.c
4877 set X `$cppstdin -v try.c 2>&1 | $awk '/^#include </,/^End of search /'|$cppfilter $grep '/include'`
4879 if $test $# -gt 0; then
4881 incpth="`$echo $incpth|$sed 's/^ //'`"
4883 j="`$echo $i|$sed 's,/include$,/lib,'`"
4884 if $test -d $j; then
4888 libpth="`$echo $libpth|$sed 's/^ //'`"
4889 for xxx in $libpth $loclibpth $plibpth $glibpth; do
4890 if $test -d $xxx; then
4893 *) libpth="$libpth $xxx";;
4900 '') for i in $incpth; do
4901 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
4909 case "$usecrosscompile" in
4912 '') echo "Incpth not defined." >&4; croak=y ;;
4913 *) echo "Using incpth '$incpth'." >&4 ;;
4916 '') echo "Libpth not defined." >&4; croak=y ;;
4917 *) echo "Using libpth '$libpth'." >&4 ;;
4920 '') echo "Usrinc not defined." >&4; croak=y ;;
4921 *) echo "Using usrinc $usrinc." >&4 ;;
4925 if test "X$sysroot" = X; then
4926 echo "Cannot continue, aborting." >&4; exit 1
4928 echo "Cross-compiling using sysroot $sysroot, failing to guess inc/lib paths is not fatal" >&4
4937 : Default value for incpth is just usrinc
4939 '') incpth="$usrinc";;
4942 : Set private lib path
4945 plibpth="$incpath/usr/lib $sysroot/usr/local/lib $sysroot/usr/ccs/lib"
4950 '') dlist="$loclibpth $plibpth $glibpth";;
4951 *) dlist="$libpth";;
4954 : Now check and see which directories actually exist, avoiding duplicates
4957 if $test -d $xxx; then
4960 *) libpth="$libpth $xxx";;
4966 Some systems have incompatible or broken versions of libraries. Among
4967 the directories listed in the question below, please remove any you
4968 know not to be holding relevant libraries, and add any that are needed.
4969 Say "none" for none.
4973 if test "X$sysroot" != X; then
4975 You have set sysroot to $sysroot, please supply the directories excluding sysroot
4988 rp="Directories to use for library searches?"
4995 : compute shared library extension
4998 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
5008 On some systems, shared libraries may be available. Answer 'none' if
5009 you want to suppress searching of shared libraries for the remainder
5010 of this configuration.
5013 rp='What is the file extension used for shared libraries?'
5017 : Does target system insist that shared library basenames are unique
5020 Some dynamic loaders assume that the *basename* of shared library filenames
5021 are globally unique. We'll default this to undef as we assume your system
5022 is not this weird. Set to defined if you're on one of them.
5027 rp='Make shared library basenames unique?'
5030 y|Y) val="$define" ;;
5033 set d_libname_unique
5036 : Define several unixisms.
5037 : Hints files or command line option can be used to override them.
5038 : The convoluted testing is in case hints files set either the old
5041 '') case "$exe_ext" in
5043 *) _exe="$exe_ext" ;;
5048 '') case "$lib_ext" in
5055 '') case "$obj_ext" in
5062 '') case "$path_sep" in
5073 rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
5075 : Which makefile gets called first. This is used by make depend.
5076 case "$firstmakefile" in
5077 '') firstmakefile='makefile';;
5080 : Check is we will use socks
5082 $define|true|[yY]*) dflt='y';;
5087 Perl can be built to use the SOCKS proxy protocol library. To do so,
5088 Configure must be run with -Dusesocks. If you use SOCKS you also need
5089 to use the PerlIO abstraction layer, this will be implicitly selected.
5091 If this doesn't make any sense to you, just accept the default '$dflt'.
5093 rp='Build Perl for SOCKS?'
5096 y|Y) val="$define" ;;
5102 : Check for uselongdouble support
5104 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
5107 case "$uselongdouble" in
5108 $define|true|[yY]*) dflt='y';;
5113 Perl can be built to take advantage of long doubles which
5114 (if available) may give more accuracy and range for floating point numbers.
5116 If this doesn't make any sense to you, just accept the default '$dflt'.
5118 rp='Try to use long doubles if available?'
5121 y|Y) val="$define" ;;
5127 case "$uselongdouble" in
5128 true|[yY]*) uselongdouble="$define" ;;
5131 : Look for a hint-file generated 'call-back-unit'. If the
5132 : user has specified that long doubles should be used,
5133 : we may need to set or change some other defaults.
5134 if $test -f uselongdouble.cbu; then
5135 echo "Your platform has some specific hints regarding long doubles, using them..."
5136 . ./uselongdouble.cbu
5138 case "$uselongdouble" in
5141 (Your platform does not have any specific hints for long doubles.)
5147 : Looking for optional libraries
5149 echo "Checking for optional libraries..." >&4
5154 case "$libswanted" in
5155 '') libswanted='c_s';;
5158 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
5160 case "$usecbacktrace" in
5161 "$define") libswanted="$libswanted bfd" ;;
5167 for thisdir in $libpth $xlibpth; do
5168 test -d $thisdir && libspath="$libspath $thisdir"
5170 for thislib in $libswanted; do
5171 for thisdir in $libspath; do
5173 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
5174 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
5175 $test -f "$xxx" && eval $libscheck
5176 $test -f "$xxx" && libstyle=shared
5178 if test ! -f "$xxx"; then
5179 xxx=$thisdir/lib$thislib.$so
5180 $test -f "$xxx" && eval $libscheck
5181 $test -f "$xxx" && libstyle=shared
5183 if test ! -f "$xxx"; then
5184 xxx=$thisdir/lib$thislib$_a
5185 $test -f "$xxx" && eval $libscheck
5186 $test -f "$xxx" && libstyle=static
5188 if test ! -f "$xxx"; then
5189 xxx=$thisdir/$thislib$_a
5190 $test -f "$xxx" && eval $libscheck
5191 $test -f "$xxx" && libstyle=static
5193 if test ! -f "$xxx"; then
5194 xxx=$thisdir/lib${thislib}_s$_a
5195 $test -f "$xxx" && eval $libscheck
5196 $test -f "$xxx" && libstyle=static
5197 $test -f "$xxx" && thislib=${thislib}_s
5199 if test ! -f "$xxx"; then
5200 xxx=$thisdir/Slib$thislib$_a
5201 $test -f "$xxx" && eval $libscheck
5202 $test -f "$xxx" && libstyle=static
5204 if $test -f "$xxx"; then
5206 shared) echo "Found -l$thislib (shared)." ;;
5207 static) echo "Found -l$thislib." ;;
5208 *) echo "Found -l$thislib ($libstyle)." ;;
5212 *) dflt="$dflt -l$thislib"
5213 libsfound="$libsfound $xxx"
5215 libsfiles="$libsfiles $yyy"
5216 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
5217 case " $libsdirs " in
5219 *) libsdirs="$libsdirs $yyy" ;;
5226 if $test ! -f "$xxx"; then
5227 echo "No -l$thislib."
5238 ' '|'') dflt='none';;
5243 In order to compile $package on your machine, a number of libraries
5244 are usually needed. Include any other special libraries here as well.
5245 Say "none" for none. The default list is almost always right.
5249 rp="What libraries to use?"
5256 : determine optimization, if desired, or use for debug flag also
5258 ' '|$undef) dflt='none';;
5260 *) dflt="$optimize";;
5264 By default, $package compiles with the -O flag to use the optimizer.
5265 Alternately, you might want to use the symbolic debugger, which uses
5266 the -g flag (on traditional Unix systems). Either flag can be
5267 specified here. To use neither flag, specify the word "none".
5270 rp="What optimizer/debugger flag should be used?"
5274 'none') optimize=" ";;
5277 : Check what DEBUGGING is required from the command line
5278 : -DEBUGGING or -DDEBUGGING or
5279 : -DEBUGGING=both = -g + -DDEBUGGING
5280 : -DEBUGGING=-g or -Doptimize=-g = -g
5281 : -DEBUGGING=none or -UDEBUGGING =
5282 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
5285 *) DEBUGGING=$EBUGGING ;;
5288 case "$DEBUGGING" in
5292 *) optimize="$optimize -g" ;;
5296 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
5304 case "$DEBUGGING" in
5305 both|$define) dflt='-DDEBUGGING'
5308 : argument order is deliberate, as the flag will start with - which set could
5309 : think is an option
5310 checkccflag='check=$1; flag=$2; callback=$3;
5312 echo "Checking if your compiler accepts $flag" 2>&1;
5313 [ "X$sysroot" != "X" ] && echo "For sysroot = $sysroot";
5314 echo "int main(void) { return 0; }" > gcctest.c;
5315 if $cc $_sysroot -O2 $flag -o gcctest gcctest.c 2>gcctest.out && $run ./gcctest; then
5316 echo "Yes, it does." 2>&1;
5317 if $test -s gcctest.out ; then
5318 echo "But your platform does not like it:";
5323 echo "Leaving current flags $ccflags alone." 2>&1
5325 *) dflt="$dflt $flag";
5331 echo "Nope, it does not, but that is ok." 2>&1;
5335 : We will not override a previous value, but we might want to
5336 : augment a hint file
5338 default|recommended)
5339 case "$gccversion" in
5340 1*) dflt="$dflt -fpcc-struct-return" ;;
5342 case "$optimize:$DEBUGGING" in
5343 *-g*:old) dflt="$dflt -DDEBUGGING";;
5345 case "$gccversion" in
5346 2*) if $test -d /etc/conf/kconfig.d &&
5347 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
5349 # Interactive Systems (ISC) POSIX mode.
5354 case "$gccversion" in
5357 ?*) set strict-aliasing -fno-strict-aliasing
5361 # For gcc, adding -pipe speeds up compilations for some, but apparently
5362 # some assemblers can't read from stdin. (It also slows down compilations
5363 # in other cases, but those are apparently rarer these days.) AD 5/2004.
5364 case "$gccversion" in
5370 # on x86_64 (at least) we require an extra library (libssp) in the
5371 # link command line. This library is not named, so I infer that it is
5372 # an implementation detail that may change. Hence the safest approach
5373 # is to add the flag to the flags passed to the compiler at link time,
5374 # as that way the compiler can do the right implementation dependant
5376 case "$gccversion" in
5377 ?*) set stack-protector -fstack-protector
5384 case "$mips_type" in
5385 *BSD*|'') inclwanted="$locincpth $usrinc";;
5386 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
5388 for thisincl in $inclwanted; do
5389 if $test -d $thisincl; then
5390 if $test x$thisincl != x$usrinc; then
5392 *" -I$thisincl "*);;
5393 *) dflt="$dflt -I$thisincl ";;
5399 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
5401 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5409 *) dflt="$dflt -D$2";;
5413 set signal.h LANGUAGE_C; eval $inctest
5417 ccflags="$ccflags -DSOCKS"
5422 default|recommended) dflt="$ccflags $dflt" ;;
5423 *) dflt="$ccflags";;
5432 Your C compiler may want other flags. For this question you should include
5433 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5434 but you should NOT include libraries or ld flags like -lwhatever. If you
5435 want $package to honor its debug switch, you should include -DDEBUGGING here.
5436 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5438 To use no flags, specify the word "none".
5444 rp="Any additional cc flags?"
5451 : the following weeds options from ccflags that are of no interest to cpp
5453 '') cppflags="$ccflags" ;;
5454 *) cppflags="$cppflags $ccflags" ;;
5456 case "$gccversion" in
5457 1*) cppflags="$cppflags -D__GNUC__"
5459 case "$mips_type" in
5461 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5467 echo "Let me guess what the preprocessor flags are..." >&4
5481 *) ftry="$previous $flag";;
5483 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5484 >cpp1.out 2>/dev/null && \
5485 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5486 >cpp2.out 2>/dev/null && \
5487 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5488 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5490 cppflags="$cppflags $ftry"
5500 *-*) echo "They appear to be: $cppflags";;
5502 $rm -f cpp.c cpp?.out
5506 : flags used in final linking phase
5508 '') if ./venix; then
5514 *-posix*) dflt="$dflt -posix" ;;
5517 *) dflt="$ldflags";;
5519 # See note above about -fstack-protector
5521 *-fstack-protector*)
5523 *-fstack-protector*) ;; # Don't add it again
5524 *) dflt="$dflt -fstack-protector" ;;
5529 : Try to guess additional flags to pick up local libraries.
5530 for thislibdir in $libpth; do
5531 case " $loclibpth " in
5534 *"-L$thislibdir "*) ;;
5535 *) dflt="$dflt -L$thislibdir" ;;
5547 Your C linker may need flags. For this question you should
5548 include -L/whatever and any other flags used by the C linker, but you
5549 should NOT include libraries like -lwhatever.
5551 Make sure you include the appropriate -L/path flags if your C linker
5552 does not normally search all of the directories you specified above,
5555 To use no flags, specify the word "none".
5559 rp="Any additional ld flags (NOT including libraries)?"
5565 rmlist="$rmlist pdp11"
5569 echo "Checking your choice of C compiler and flags for coherency..." >&4
5570 $cat > try.c <<'EOF'
5572 int main() { printf("Ok\n"); return(0); }
5574 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5576 $cat >try.msg <<'EOM'
5577 I've tried to compile and run the following simple program:
5580 $cat try.c >> try.msg
5582 $cat >> try.msg <<EOM
5589 and I got the following output:
5593 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5594 if $sh -c "$run ./try " >>try.msg 2>&1; then
5598 *) echo 'The program compiled OK, but produced no output.' >> try.msg ;;
5601 echo "The program compiled OK, but exited with status $?." >>try.msg
5602 rp="You have a problem. Shall I abort Configure"
5606 echo "I can't compile the test program." >>try.msg
5607 rp="You have a BIG problem. Shall I abort Configure"
5613 case "$knowitall" in
5615 echo "(The supplied flags or libraries might be incorrect.)"
5623 *) echo "Ok. Stopping Configure." >&4
5628 n) echo "OK, that should do.";;
5630 $rm_try gcctest gcctest.out
5632 : define a shorthand compile call
5636 case "$usedevel" in $define|true|[yY]*) if $test ! -f "${mc_file}.c"; then
5637 echo "Internal Configure script bug - compiler test file ${mc_file}.c is missing. Please report this to perlbug@perl.org" >&4;
5641 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5642 : define a shorthand compile call for compilations that should be ok.
5646 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5648 : determine filename position in cpp output
5650 echo "Computing filename position in cpp output for #include directives..." >&4
5652 vos) testaccess=-e ;;
5655 echo '#include <stdio.h>' > foo.c
5658 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5659 $grep '^[ ]*#.*stdio\.h' | \
5660 while read cline; do
5663 while $test \$# -gt 0; do
5664 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5669 pos=\`expr \$pos + 1\`
5681 *) pos="${fieldn}th";;
5683 echo "Your cpp writes the filename in the $pos field of the line."
5685 : locate header file
5690 for usrincdir in $incpth
5692 if test -f \$usrincdir/\$wanted; then
5693 echo "\$usrincdir/\$wanted"
5697 awkprg='{ print \$$fieldn }'
5698 echo "#include <\$wanted>" > foo\$\$.c
5699 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5700 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5701 while read cline; do
5702 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5704 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5705 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5710 # status = 0: grep returned 0 lines, case statement not executed
5711 # status = 1: headerfile found
5712 # status = 2: while loop executed, no headerfile found
5716 if test \$status -eq 1; then
5723 : define an alternate in-header-list? function
5724 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5725 cont=true; xxf="echo \"<\$1> found.\" >&4";
5726 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5727 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5729 case $# in 4) instead=instead;; *) instead="at last";; esac;
5730 while $test "$cont"; do
5732 var=$2; eval "was=\$$2";
5733 if $test "$xxx" && $test -r "$xxx";
5735 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5738 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5739 set $yyy; shift; shift; yyy=$@;
5740 case $# in 0) cont="";;
5741 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5742 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5743 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5744 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5748 do set $yyy; var=$2; eval "was=\$$2";
5749 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5750 set $yyy; shift; shift; yyy=$@;
5753 : see if stdlib is available
5754 set stdlib.h i_stdlib
5757 : check for lengths of integral types
5761 echo "Checking to see how big your integers are..." >&4
5770 printf("intsize=%d;\n", (int)sizeof(int));
5771 printf("longsize=%d;\n", (int)sizeof(long));
5772 printf("shortsize=%d;\n", (int)sizeof(short));
5777 if eval $compile_ok && $run ./try > /dev/null; then
5779 echo "Your integers are $intsize bytes long."
5780 echo "Your long integers are $longsize bytes long."
5781 echo "Your short integers are $shortsize bytes long."
5785 Help! I can't compile and run the intsize test program: please enlighten me!
5786 (This is probably a misconfiguration in your system or libraries, and
5787 you really ought to fix it. Still, I'll try anyway.)
5791 rp="What is the size of an integer (in bytes)?"
5795 rp="What is the size of a long integer (in bytes)?"
5799 rp="What is the size of a short integer (in bytes)?"
5807 : check for long long
5809 echo "Checking to see if you have long long..." >&4
5810 echo 'int main() { long long x = 7; return 0; }' > try.c
5812 if eval $compile; then
5814 echo "You have long long."
5817 echo "You do not have long long."
5823 : check for length of long long
5824 case "${d_longlong}${longlongsize}" in
5827 echo "Checking to see how big your long longs are..." >&4
5828 $cat >try.c <<'EOCP'
5832 printf("%d\n", (int)sizeof(long long));
5837 if eval $compile_ok; then
5838 longlongsize=`$run ./try`
5839 echo "Your long longs are $longlongsize bytes long."
5843 echo "(I can't seem to compile the test program. Guessing...)"
5844 rp="What is the size of a long long (in bytes)?"
5848 if $test "X$longsize" = "X$longlongsize"; then
5849 echo "(That isn't any different from an ordinary long.)"
5855 : see if inttypes.h is available
5856 : we want a real compile instead of Inhdr because some systems
5857 : have an inttypes.h which includes non-existent headers
5860 #include <inttypes.h>
5862 static int32_t foo32 = 0x12345678;
5866 if eval $compile; then
5867 echo "<inttypes.h> found." >&4
5870 echo "<inttypes.h> NOT found." >&4
5879 echo "Checking to see if you have int64_t..." >&4
5881 #include <sys/types.h>
5882 #$i_inttypes I_INTTYPES
5884 #include <inttypes.h>
5886 int main() { int64_t x = 7; }
5889 if eval $compile; then
5891 echo "You have int64_t."
5894 echo "You do not have int64_t."
5900 : Check if 64bit ints have a quad type
5902 echo "Checking which 64-bit integer type we could use..." >&4
5908 val='"unsigned int"'
5913 *) case "$longsize" in
5917 val='"unsigned long"'
5922 *) case "$d_longlong:$longlongsize" in
5927 val='"unsigned long long"'
5932 *) case "$d_int64_t" in
5951 '') echo "Alas, no 64-bit integer types in sight." >&4
5954 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5959 : Do we want 64bit support
5960 case "$uselonglong" in
5961 "$define"|true|[yY]*)
5964 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5966 use64bitint="$define"
5969 case "$use64bits" in
5970 "$define"|true|[yY]*)
5973 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5975 use64bitint="$define"
5978 case "$use64bitints" in
5979 "$define"|true|[yY]*)
5982 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5984 use64bitint="$define"
5987 case "$use64bitsint" in
5988 "$define"|true|[yY]*)
5991 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5993 use64bitint="$define"
5996 case "$uselonglongs" in
5997 "$define"|true|[yY]*)
6000 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
6002 use64bitint="$define"
6005 case "$use64bitsall" in
6006 "$define"|true|[yY]*)
6009 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
6011 use64bitall="$define"
6016 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
6018 case "$use64bitall" in
6019 "$define"|true|[yY]*) use64bitint="$define" ;;
6025 You have natively 64-bit long integers.
6029 *) case "$use64bitint" in
6030 "$define"|true|[yY]*) dflt='y';;
6039 Perl can be built to take advantage of 64-bit integer types
6040 on some systems. To do so, Configure can be run with -Duse64bitint.
6041 Choosing this option will most probably introduce binary incompatibilities.
6043 If this doesn't make any sense to you, just accept the default '$dflt'.
6044 (The default has been chosen based on your configuration.)
6046 rp='Try to use 64-bit integers, if available?'
6049 [yY]*) val="$define" ;;
6057 case "$use64bitall" in
6058 "$define"|true|[yY]*) dflt='y' ;;
6059 *) case "$longsize" in
6067 You may also choose to try maximal 64-bitness. It means using as much
6068 64-bitness as possible on the platform. This in turn means even more
6069 binary incompatibilities. On the other hand, your platform may not
6070 have any more 64-bitness available than what you already have chosen.
6072 If this doesn't make any sense to you, just accept the default '$dflt'.
6073 (The default has been chosen based on your configuration.)
6075 rp='Try to use maximal 64-bit support, if available?'
6078 [yY]*) val="$define" ;;
6083 case "$use64bitall" in
6085 case "$use64bitint" in
6089 Since you have chosen a maximally 64-bit build, I'm also turning on
6090 the use of 64-bit integers.
6092 use64bitint="$define" ;;
6097 : Look for a hint-file generated 'call-back-unit'. If the
6098 : user has specified that a 64-bit perl is to be built,
6099 : we may need to set or change some other defaults.
6100 if $test -f use64bitint.cbu; then
6101 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
6104 case "$use64bitint" in
6105 "$define"|true|[yY]*)
6106 : This test was common to all the OpenBSD forks, and seems harmless for
6109 echo "Checking if your C library has broken 64-bit functions..." >&4
6112 typedef $uquadtype myULL;
6119 {4294967303.15, 4294967303ULL},
6120 {4294967294.2, 4294967294ULL},
6121 {4294967295.7, 4294967295ULL},
6124 for (p = test; p->u; p++) {
6125 myULL x = (myULL)p->d;
6136 if eval $compile_ok; then
6137 libcquad=`$run ./try`
6138 echo "Your C library's 64-bit functions are $libcquad."
6140 echo "(I can't seem to compile the test program.)"
6141 echo "Assuming that your C library's 64-bit functions are ok."
6150 *** You have a C library with broken 64-bit functions.
6151 *** 64-bit support does not work reliably in this configuration.
6152 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
6153 *** Cannot continue, aborting.
6160 4) case "$archname64" in
6161 '') archname64=64int ;;
6168 : Look for a hint-file generated 'call-back-unit'. If the
6169 : user has specified that a maximally 64-bit perl is to be built,
6170 : we may need to set or change some other defaults.
6171 if $test -f use64bitall.cbu; then
6172 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
6175 case "$use64bitall" in
6176 "$define"|true|[yY]*)
6178 4) case "$archname64" in
6179 ''|64int) archname64=64all ;;
6186 case "$d_quad:$use64bitint" in
6190 *** You have chosen to use 64-bit integers,
6191 *** but none can be found.
6192 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
6193 *** Cannot continue, aborting.
6200 : check for length of double
6202 case "$doublesize" in
6204 echo "Checking to see how big your double precision numbers are..." >&4
6213 printf("%d\n", (int)sizeof(double));
6218 if eval $compile_ok; then
6219 doublesize=`$run ./try`
6220 echo "Your double is $doublesize bytes long."
6223 echo "(I can't seem to compile the test program. Guessing...)"
6224 rp="What is the size of a double precision number (in bytes)?"
6232 : check for long doubles
6234 echo "Checking to see if you have long double..." >&4
6235 echo 'int main() { long double x = 7.0; }' > try.c
6237 if eval $compile; then
6239 echo "You have long double."
6242 echo "You do not have long double."
6248 : check for length of long double
6249 case "${d_longdbl}${longdblsize}" in
6252 echo "Checking to see how big your long doubles are..." >&4
6253 $cat >try.c <<'EOCP'
6257 printf("%d\n", sizeof(long double));
6262 if eval $compile; then
6263 longdblsize=`$run ./try`
6264 echo "Your long doubles are $longdblsize bytes long."
6268 echo "(I can't seem to compile the test program. Guessing...)" >&4
6269 rp="What is the size of a long double (in bytes)?"
6273 if $test "X$doublesize" = "X$longdblsize"; then
6274 echo "That isn't any different from an ordinary double."
6275 echo "I'll keep your setting anyway, but you may see some"
6276 echo "harmless compilation warnings."
6282 : determine the architecture name
6284 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
6285 tarch=`arch`"-$osname"
6286 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
6287 if uname -m > tmparch 2>&1 ; then
6288 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
6289 -e 's/$/'"-$osname/" tmparch`
6297 case "$myarchname" in
6300 echo "(Your architecture name used to be $myarchname.)"
6304 case "$targetarch" in
6306 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
6311 *) dflt="$archname";;
6313 rp='What is your architecture name'
6317 : optionally add API version to the architecture for versioned archlibs
6318 case "$useversionedarchname" in
6319 $define|true|[yY]*) dflt='y';;
6322 rp='Add the Perl API version to your archname?'
6325 y|Y) useversionedarchname="$define" ;;
6326 *) useversionedarchname="$undef" ;;
6328 case "$useversionedarchname" in
6331 *-$api_versionstring)
6332 echo "...and architecture name already has -$api_versionstring" >&4
6335 archname="$archname-$api_versionstring"
6336 echo "...setting architecture name to $archname." >&4
6342 case "$usethreads" in
6344 echo "Threads selected." >&4
6346 *-thread*) echo "...and architecture name already has -thread." >&4
6348 *) archname="$archname-thread"
6349 echo "...setting architecture name to $archname." >&4
6354 case "$usemultiplicity" in
6356 echo "Multiplicity selected." >&4
6358 *-multi*) echo "...and architecture name already has -multi." >&4
6360 *) archname="$archname-multi"
6361 echo "...setting architecture name to $archname." >&4
6366 case "$use64bitint$use64bitall" in
6368 case "$archname64" in
6370 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
6373 case "$use64bitint" in
6374 "$define") echo "64 bit integers selected." >&4 ;;
6376 case "$use64bitall" in
6377 "$define") echo "Maximal 64 bitness selected." >&4 ;;
6380 *-$archname64*) echo "...and architecture name already has $archname64." >&4
6382 *) archname="$archname-$archname64"
6383 echo "...setting architecture name to $archname." >&4
6389 case "$uselongdouble" in
6391 echo "Long doubles selected." >&4
6392 case "$longdblsize" in
6394 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
6398 *-ld*) echo "...and architecture name already has -ld." >&4
6400 *) archname="$archname-ld"
6401 echo "...setting architecture name to $archname." >&4
6408 if $test -f archname.cbu; then
6409 echo "Your platform has some specific hints for architecture name, using them..."
6413 : set the prefixit variable, to compute a suitable default value
6414 prefixit='case "$3" in
6416 case "$oldprefix" in
6417 "") eval "$1=\"\$$2\"";;
6424 ""|" ") eval "$1=\"\$$2\"";;
6430 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
6432 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
6433 /*-$oldprefix/*|\~*-$oldprefix/*)
6434 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
6435 *) eval "$1=\"\$$2\"";;
6439 : determine installation style
6440 : For now, try to deduce it from prefix unless it is already set.
6441 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
6442 case "$installstyle" in
6443 '') case "$prefix" in
6444 *perl*) dflt='lib';;
6445 *) dflt='lib/perl5' ;;
6448 *) dflt="$installstyle" ;;
6450 : Probably not worth prompting for this since we prompt for all
6451 : the directories individually, and the prompt would be too long and
6455 : determine where public executables go
6460 rp='Pathname where the public executables will reside?'
6462 if $test "X$ansexp" != "X$binexp"; then
6466 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6467 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
6468 : this via initialinstalllocation
6471 case "$userelocatableinc" in
6472 $define|true|[yY]*) dflt='y' ;;
6477 Would you like to build Perl so that the installation is relocatable, so that
6478 library paths in @INC are determined relative to the path of the perl binary?
6479 This is not advised for system Perl installs, or if you need to run setid
6480 scripts or scripts under taint mode.
6482 If this doesn't make any sense to you, just accept the default '$dflt'.
6484 rp='Use relocatable @INC?'
6487 y|Y) val="$define" ;;
6490 set userelocatableinc
6493 initialinstalllocation="$binexp"
6494 : Default prefix is now "up one level from where the binaries are"
6495 case "$userelocatableinc" in
6501 installprefixexp=".../.."
6505 : determine where private library files go
6506 : Usual default is /usr/local/lib/perl5/$version.
6507 : Also allow things like /opt/perl/lib/$version, since
6508 : /opt/perl/lib/perl5... would be redundant.
6509 : The default "style" setting is made in installstyle.U
6510 case "$installstyle" in
6511 *lib/perl5*) set dflt privlib lib/$package/$version ;;
6512 *) set dflt privlib lib/$version ;;
6517 There are some auxiliary files for $package that need to be put into a
6518 private library directory that is accessible by everyone.
6523 rp='Pathname where the private library files will reside?'
6528 : set the prefixup variable, to restore leading tilda escape
6529 prefixup='case "$prefixexp" in
6531 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
6534 : determine where public architecture dependent libraries go
6537 : privlib default is /usr/local/lib/$package/$version
6538 : archlib default is /usr/local/lib/$package/$version/$archname
6539 : privlib may have an optional trailing /share.
6540 tdflt=`echo $privlib | $sed 's,/share$,,'`
6541 tdflt=$tdflt/$archname
6550 $spackage contains architecture-dependent library files. If you are
6551 sharing libraries in a heterogeneous environment, you might store
6552 these files in a separate location. Otherwise, you can just include
6553 them with the rest of the public library files.
6558 rp='Where do you want to put the public architecture-dependent libraries?'
6562 if $test X"$archlib" = X"$privlib"; then
6568 : see if setuid scripts can be secure
6571 Some kernels have a bug that prevents setuid #! scripts from being
6572 secure. Some sites have disabled setuid #! scripts because of this.
6574 First let's decide if your kernel supports secure setuid #! scripts.
6575 (If setuid #! scripts would be secure but have been disabled anyway,
6576 don't say that they are secure if asked.)
6581 if $test -d /dev/fd; then
6582 echo "#!$ls" >reflect
6583 chmod +x,u+s reflect
6584 ./reflect >flect 2>&1
6585 if $contains "/dev/fd" flect >/dev/null; then
6586 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6590 If you are not sure if they are secure, I can check but I'll need a
6591 username and password different from the one you are using right now.
6592 If you don't have such a username or don't want me to test, simply
6596 rp='Other username to test security of setuid scripts with?'
6601 case "$d_suidsafe" in
6602 '') echo "I'll assume setuid scripts are *not* secure." >&4
6605 echo "Well, the $hint value is *not* secure." >&4
6607 *) echo "Well, the $hint value *is* secure." >&4
6612 $rm -f reflect flect
6613 echo "#!$ls" >reflect
6614 chmod +x,u+s reflect
6617 echo '"su" will (probably) prompt you for '"$ans's password."
6618 su $ans -c './reflect >flect'
6619 if $contains "/dev/fd" flect >/dev/null; then
6620 echo "Okay, it looks like setuid scripts are secure." >&4
6623 echo "I don't think setuid scripts are secure." >&4
6628 rp='Does your kernel have *secure* setuid scripts?'
6631 [yY]*) val="$define";;
6636 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6637 echo "(That's for file descriptors, not floppy disks.)"
6643 $rm -f reflect flect
6645 : now see if they want to do setuid emulation
6646 if $test $patchlevel -lt 11; then
6649 case "$d_suidsafe" in
6652 echo "No need to emulate SUID scripts since they are secure here." >&4
6656 Some systems have disabled setuid scripts, especially systems where
6657 setuid scripts cannot be secure. On systems where setuid scripts have
6658 been disabled, the setuid/setgid bits on scripts are currently
6659 useless. It is possible for $package to detect those bits and emulate
6660 setuid/setgid in a secure fashion. This emulation will only work if
6661 setuid scripts have been disabled in your kernel.
6665 "$define") dflt=y ;;
6668 rp="Do you want to do setuid/setgid emulation?"
6671 [yY]*) val="$define";;
6683 SUID emulation has been removed for 5.12
6684 Please re-run Configure without -Dd_dosuid
6693 : Find perl5.005 or later.
6694 echo "Looking for a previously installed perl5.005 or later... "
6696 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
6697 : Check if this perl is recent and can load a simple module
6698 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6701 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6711 '') echo "None found. That's ok.";;
6712 *) echo "Using $perl5." ;;
6715 : Set the siteprefix variables
6718 After $package is installed, you may wish to install various
6719 add-on modules and utilities. Typically, these add-ons will
6720 be installed under $prefix with the rest
6721 of this package. However, you may wish to install such add-ons
6722 elsewhere under a different prefix.
6724 If you do not wish to put everything under a single prefix, that's
6725 ok. You will be prompted for the individual locations; this siteprefix
6726 is only used to suggest the defaults.
6728 The default should be fine for most people.
6732 rp='Installation prefix to use for add-on modules and utilities?'
6733 : XXX Here might be another good place for an installstyle setting.
6734 case "$siteprefix" in
6736 *) dflt=$siteprefix ;;
6739 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6741 case "$siteprefix" in
6745 *) oldsiteprefix="$prefix";;
6750 siteprefixexp="$ansexp"
6752 : determine where site specific libraries go.
6753 : Usual default is /usr/local/lib/perl5/site_perl/$version
6754 : The default "style" setting is made in installstyle.U
6755 : XXX No longer works with Prefixit stuff.
6756 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6758 '') case "$installstyle" in
6759 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6760 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6768 The installation process will create a directory for
6769 site-specific extensions and modules. Most users find it convenient
6770 to place all site-specific files in this directory rather than in the
6771 main distribution directory.
6775 rp='Pathname for the site-specific library files?'
6779 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6781 : Determine list of previous versions to include in @INC
6782 $cat > getverlist <<EOPL
6785 \$api_versionstring = "$api_versionstring";
6786 \$version = "$version";
6787 \$stem = "$sitelib_stem";
6788 \$archname = "$archname";
6790 $cat >> getverlist <<'EOPL'
6791 # The list found is store twice for each entry: the original name, and
6792 # the binary broken down version as pack "sss", so sorting is easy and
6793 # unambiguous. This will work for all versions that have a maximum of
6794 # three digit groups, separate by '.'s or '_'s. Names are extended with
6795 # ".0.0" to ensure at least three elements for the pack.
6796 # -- H.Merijn Brand (m)'06 23-10-2006
6798 # Can't have leading @ because metaconfig interprets it as a command!
6799 ;@inc_version_list=();
6800 # XXX Redo to do opendir/readdir?
6803 ;@candidates = map {
6804 [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
6805 ;@candidates = sort { $a->[1] cmp $b->[1]} @candidates;
6811 ($pversion, $aversion, $vsn5005) = map {
6812 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
6813 foreach $d (@candidates) {
6814 if ($d->[1] lt $pversion) {
6815 if ($d->[1] ge $aversion) {
6816 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
6818 elsif ($d->[1] ge $vsn5005) {
6819 unshift(@inc_version_list, grep { -d } $d->[0]);
6823 # Skip newer version. I.e. don't look in
6824 # 5.7.0 if we're installing 5.6.1.
6828 if (@inc_version_list) {
6829 print join(' ', @inc_version_list);
6832 # Blank space to preserve value for next Configure run.
6837 case "$inc_version_list" in
6838 '') if test -x "$perl5$exe_ext"; then
6839 dflt=`$perl5 getverlist`
6844 $undef) dflt='none' ;;
6845 *) eval dflt=\"$inc_version_list\" ;;
6848 ''|' ') dflt=none ;;
6855 In order to ease the process of upgrading, this version of perl
6856 can be configured to use modules built and installed with earlier
6857 versions of perl that were installed under $prefix. Specify here
6858 the list of earlier versions that this version of perl should check.
6859 If Configure detected no earlier versions of perl installed under
6860 $prefix, then the list will be empty. Answer 'none' to tell perl
6861 to not search earlier versions.
6863 The default should almost always be sensible, so if you're not sure,
6864 just accept the default.
6867 rp='List of earlier versions to include in @INC?'
6870 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
6871 *) inc_version_list="$ans" ;;
6873 case "$inc_version_list" in
6875 inc_version_list_init='0'
6876 d_inc_version_list="$undef"
6878 *) inc_version_list_init=`echo $inc_version_list |
6879 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6880 d_inc_version_list="$define"
6885 : see if malloc/malloc.h has to be included
6886 set malloc/malloc.h i_mallocmalloc
6889 : see if this is a malloc.h system
6890 : we want a real compile instead of Inhdr because some systems have a
6891 : malloc.h that just gives a compile error saying to use stdlib.h instead
6896 #$i_mallocmalloc I_MALLOCMALLOC
6897 #ifdef I_MALLOCMALLOC
6898 # include <malloc/malloc.h>
6901 int main () { return 0; }
6904 if eval $compile; then
6905 echo "<malloc.h> found." >&4
6908 echo "<malloc.h> NOT found." >&4
6915 : check for length of pointer
6919 echo "Checking to see how big your pointers are..." >&4
6928 printf("%d\n", (int)sizeof(void *));
6933 if eval $compile_ok; then
6934 ptrsize=`$run ./try`
6935 echo "Your pointers are $ptrsize bytes long."
6938 echo "(I can't seem to compile the test program. Guessing...)" >&4
6939 rp="What is the size of a pointer (in bytes)?"
6946 case "$use64bitall" in
6947 "$define"|true|[yY]*)
6951 *** You have chosen a maximally 64-bit build,
6952 *** but your pointers are only 4 bytes wide.
6953 *** Please rerun Configure without -Duse64bitall.
6958 *** Since you have quads, you could possibly try with -Duse64bitint.
6963 *** Cannot continue, aborting.
6974 : determine whether to use malloc wrapping
6976 case "$usemallocwrap" in
6977 [yY]*|true|$define) dflt='y' ;;
6978 [nN]*|false|$undef) dflt='n' ;;
6979 *) case "$usedevel" in
6980 [yY]*|true|$define) dflt='y' ;;
6985 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
6987 usemallocwrap="$ans"
6990 usemallocwrap="$define" ;;
6992 usemallocwrap="$undef" ;;
6995 : determine which malloc to compile in
6997 case "$usemymalloc" in
6998 [yY]*|true|$define) dflt='y' ;;
6999 [nN]*|false|$undef) dflt='n' ;;
7000 *) case "$ptrsize" in
7004 if test "$useithreads" = "$define"; then dflt='n'; fi
7007 rp="Do you wish to attempt to use the malloc that comes with $package?"
7013 mallocsrc='malloc.c'
7014 mallocobj="malloc$_o"
7015 d_mymalloc="$define"
7018 : Remove malloc from list of libraries to use
7019 echo "Removing unneeded -lmalloc from library list" >&4
7020 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
7023 echo "libs = $libs" >&4
7035 : compute the return types of malloc and free
7037 $cat >malloc.c <<END
7041 #include <sys/types.h>
7055 case "$malloctype" in
7057 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
7064 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
7068 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
7075 echo "Your system uses $freetype free(), it would seem." >&4
7077 : determine where site specific architecture-dependent libraries go.
7078 : sitelib default is /usr/local/lib/perl5/site_perl/$version
7079 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
7080 : sitelib may have an optional trailing /share.
7082 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
7083 dflt="$dflt/$archname"
7088 set sitearch sitearch none
7092 The installation process will also create a directory for
7093 architecture-dependent site-specific extensions and modules.
7097 rp='Pathname for the site-specific architecture-dependent library files?'
7101 if $test X"$sitearch" = X"$sitelib"; then
7104 d_sitearch="$define"
7107 : Set the vendorprefix variables
7110 The installation process will also create a directory for
7111 vendor-supplied add-ons. Vendors who supply perl with their system
7112 may find it convenient to place all vendor-supplied files in this
7113 directory rather than in the main distribution directory. This will
7114 ease upgrades between binary-compatible maintenance versions of perl.
7116 Of course you may also use these directories in whatever way you see
7117 fit. For example, you might use them to access modules shared over a
7118 company-wide network.
7120 The default answer should be fine for most people.
7121 This causes further questions about vendor add-ons to be skipped
7122 and no vendor-specific directories will be configured for perl.
7125 rp='Do you want to configure vendor-specific add-on directories?'
7126 case "$usevendorprefix" in
7127 define|true|[yY]*) dflt=y ;;
7128 *) : User may have set vendorprefix directly on Configure command line.
7129 case "$vendorprefix" in
7138 rp='Installation prefix to use for vendor-supplied add-ons?'
7139 case "$vendorprefix" in
7140 '') dflt="$prefix" ;;
7141 *) dflt=$vendorprefix ;;
7144 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
7146 case "$vendorprefix" in
7150 *) oldvendorprefix="$prefix";;
7154 usevendorprefix="$define"
7156 vendorprefixexp="$ansexp"
7158 *) usevendorprefix="$undef"
7164 : Set the vendorlib variables
7165 case "$vendorprefix" in
7166 '') d_vendorlib="$undef"
7170 *) d_vendorlib="$define"
7171 : determine where vendor-supplied modules go.
7172 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
7173 case "$vendorlib" in
7175 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7176 case "$installstyle" in
7177 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
7178 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
7181 *) dflt="$vendorlib"
7185 rp='Pathname for the vendor-supplied library files?'
7188 vendorlibexp="$ansexp"
7191 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
7195 : Set the vendorarch variables
7196 case "$vendorprefix" in
7197 '') d_vendorarch="$undef"
7201 *) d_vendorarch="$define"
7202 : determine where vendor-supplied architecture-dependent libraries go.
7203 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
7204 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
7205 : vendorlib may have an optional trailing /share.
7206 case "$vendorarch" in
7207 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
7208 dflt="$dflt/$archname"
7210 *) dflt="$vendorarch" ;;
7213 rp='Pathname for vendor-supplied architecture-dependent files?'
7216 vendorarchexp="$ansexp"
7219 prefixvar=vendorarch
7221 if $test X"$vendorarch" = X"$vendorlib"; then
7222 d_vendorarch="$undef"
7224 d_vendorarch="$define"
7227 : Final catch-all directories to search
7230 Lastly, you can have perl look in other directories for extensions and
7231 modules in addition to those already specified.
7232 These directories will be searched after
7236 test X"$vendorlib" != "X" && echo ' ' $vendorlib
7237 test X"$vendorarch" != "X" && echo ' ' $vendorarch
7239 case "$otherlibdirs" in
7240 ''|' ') dflt='none' ;;
7241 *) dflt="$otherlibdirs" ;;
7244 Enter a colon-separated set of extra paths to include in perl's @INC
7245 search path, or enter 'none' for no extra paths.
7249 rp='Colon-separated list of additional directories for perl to search?'
7252 ' '|''|none) otherlibdirs=' ' ;;
7253 *) otherlibdirs="$ans" ;;
7255 case "$otherlibdirs" in
7259 set d_perl_otherlibdirs
7262 : Cruising for prototypes
7264 echo "Checking out function prototypes..." >&4
7265 $cat >prototype.c <<EOCP
7270 int main(int argc, char *argv[]) {
7273 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
7274 echo "Your C compiler appears to support function prototypes."
7277 echo "Your C compiler doesn't seem to understand function prototypes."
7284 : Check if ansi2knr is required
7285 case "$prototype" in
7287 *) ansi2knr='ansi2knr'
7292 This version of $package can only be compiled by a compiler that
7293 understands function prototypes. Unfortunately, your C compiler
7295 doesn't seem to understand them. Sorry about that.
7297 If GNU cc is available for your system, perhaps you could try that instead.
7299 Eventually, we hope to support building Perl with pre-ANSI compilers.
7300 If you would like to help in that effort, please contact <perlbug@perl.org>.
7302 Aborting Configure now.
7309 dflt_dtrace='/usr/sbin/dtrace'
7310 $test -x /usr/bin/dtrace && dflt_dtrace='/usr/bin/dtrace'
7314 Perl can be built to support DTrace on platforms that support it.
7315 DTrace is a diagnosis and performance analysis tool from Sun.
7317 If this doesn't make any sense to you, just accept the default '$dflt'.
7321 case "$usedtrace" in
7327 dflt_dtrace=$usedtrace
7334 rp='Support DTrace if available?'
7337 y|Y) val="$define" ;;
7343 test "X$usedtrace" != "X$define" && break
7346 rp='Where is the dtrace executable?'
7355 if $dtrace -h -s ../perldtrace.d \
7356 -o perldtrace.tmp >/dev/null 2>&1 \
7357 && rm -f perldtrace.tmp
7360 echo "Good: your $dtrace knows about the -h flag."
7364 *** $me: Fatal Error: $dtrace doesn't support -h flag
7366 *** Your installed dtrace doesn't support the -h switch to compile a D
7367 *** program into a C header. Can't continue.
7379 *** $me: Fatal Error: $dtrace not found.
7386 echo "*** $dtrace was not found."
7392 : See if we want extra modules installed
7399 Perl can be built with extra modules or bundles of modules which
7400 will be fetched from the CPAN and installed alongside Perl.
7402 Notice that you will need access to the CPAN; either via the Internet,
7403 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
7404 be asked later to configure the CPAN.pm module which will in turn do
7405 the installation of the rest of the extra modules or bundles.)
7407 Notice also that if the modules require any external software such as
7408 libraries and headers (the libz library and the zlib.h header for the
7409 Compress::Zlib module, for example) you MUST have any such software
7410 already installed, this configuration process will NOT install such
7413 If this doesn't make any sense to you, just accept the default '$dflt'.
7415 rp='Install any extra modules (y or n)?'
7421 Please list any extra modules or bundles to be installed from CPAN,
7422 with spaces between the names. The names can be in any format the
7423 'install' command of CPAN.pm will understand. (Answer 'none',
7424 without the quotes, to install no extra modules or bundles.)
7434 $rm -f ../extras.lst
7436 *) echo "(Saving the list of extras for later...)"
7437 echo "$extras" > ../extras.lst
7445 : determine where html pages for programs go
7446 set html1dir html1dir none
7450 If you wish to install html files for programs in $spackage, indicate
7451 the appropriate directory here. To skip installing html files,
7455 ''|none|$undef|' ') dflt=none ;;
7456 *) dflt=$html1dir ;;
7459 rp="Directory for the main $spackage html pages?"
7463 : Use ' ' for none so value is preserved next time through Configure
7464 $test X"$html1dir" = "X" && html1dir=' '
7466 : determine where html pages for libraries and modules go
7467 set html3dir html3dir none
7471 If you wish to install html files for modules associated with $spackage,
7472 indicate the appropriate directory here. To skip installing html files,
7475 : There is no obvious default. If they have specified html1dir, then
7476 : try to key off that, possibly changing .../html1 into .../html3.
7478 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
7479 *) dflt=$html3dir ;;
7482 rp="Directory for the $spackage module html pages?"
7486 : Use ' ' for none so value is preserved next time through Configure
7487 $test X"$html3dir" = "X" && html3dir=' '
7489 : determine whether to install perl also as /usr/bin/perl
7492 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
7494 Many scripts expect perl to be installed as /usr/bin/perl.
7496 If you want to, I can install the perl you are about to compile
7497 as /usr/bin/perl (in addition to $bin/perl).
7499 if test -f /usr/bin/perl; then
7502 However, please note that because you already have a /usr/bin/perl,
7503 overwriting that with a new Perl would very probably cause problems.
7504 Therefore I'm assuming you don't want to do that (unless you insist).
7507 case "$installusrbinperl" in
7508 "$define"|[yY]*) dflt='y';;
7514 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
7517 case "$installusrbinperl" in
7518 "$undef"|[nN]*) dflt='n';;
7522 rp="Do you want to install perl as /usr/bin/perl?"
7525 [yY]*) val="$define";;
7531 set installusrbinperl
7534 : Check if we are using the GNU C library
7536 echo "Checking for GNU C Library..." >&4
7538 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
7539 alone are insufficient to distinguish different versions, such as
7540 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
7541 libc version 2.1.0. A. Dougherty, June 3, 2002.
7547 # ifdef __GLIBC_MINOR__
7548 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
7549 # include <gnu/libc-version.h>
7550 printf("%s\n", gnu_get_libc_version());
7552 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
7555 printf("%d\n", __GLIBC__);
7564 if eval $compile_ok && $run ./try > glibc.ver; then
7566 gnulibc_version=`$cat glibc.ver`
7567 echo "You are using the GNU C Library version $gnulibc_version"
7571 echo "You are not using the GNU C Library"
7577 : see if nm is to be used to determine whether a symbol is defined or not
7581 case "$d_gnulibc" in
7584 echo "nm probably won't work on the GNU C Library." >&4
7590 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
7592 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
7593 echo "'nm' won't be sufficient on this system." >&4
7599 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
7600 if $test $dflt -gt 20; then
7610 true|$define) dflt=y;;
7617 I can use $nm to extract the symbols from your C libraries. This
7618 is a time consuming task which may generate huge output on the disk (up
7619 to 3 megabytes) but that should make the symbols extraction faster. The
7620 alternative is to skip the 'nm' extraction part and to compile a small
7621 test program instead to determine whether each symbol is present. If
7622 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
7623 this may be the best solution.
7625 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
7628 rp="Shall I use $nm to extract C symbols from the libraries?"
7631 [Nn]*) usenm=false;;
7640 : nm options which may be necessary
7642 '') if $test -f /mach_boot; then
7644 elif $test -d /usr/ccs/lib; then
7645 nm_opt='-p' # Solaris (and SunOS?)
7646 elif $test -f /dgux; then
7648 elif $test -f /lib64/rld; then
7649 nm_opt='-p' # 64-bit Irix
7655 : nm options which may be necessary for shared libraries but illegal
7656 : for archive libraries. Thank you, Linux.
7657 case "$nm_so_opt" in
7658 '') case "$myuname" in
7660 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
7661 nm_so_opt='--dynamic'
7668 : Figure out where the libc is located
7671 : get list of predefined functions in a handy place
7676 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
7682 *) for thislib in $libs; do
7685 : Handle C library specially below.
7688 thislib=`echo $thislib | $sed -e 's/^-l//'`
7689 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
7691 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
7693 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
7695 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
7697 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
7699 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
7701 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
7706 libnames="$libnames $try"
7708 *) libnames="$libnames $thislib" ;;
7717 for xxx in $libpth; do
7718 $test -r $1 || set $xxx/libc.$so
7719 : The messy sed command sorts on library version numbers.
7721 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
7722 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
7724 s/[0-9][0-9]*/0000&/g
7725 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
7728 $sort | $sed -e 's/^.* //'`
7731 $test -r $1 || set $sysroot/usr/ccs/lib/libc.$so
7732 $test -r $1 || set $sysroot/lib/libsys_s$_a
7738 if $test -r "$1"; then
7739 echo "Your (shared) C library seems to be in $1."
7741 elif $test -r /lib/libc && $test -r /lib/clib; then
7742 echo "Your C library seems to be in both /lib/clib and /lib/libc."
7744 libc='/lib/clib /lib/libc'
7745 if $test -r /lib/syslib; then
7746 echo "(Your math library is in /lib/syslib.)"
7747 libc="$libc /lib/syslib"
7749 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7750 echo "Your C library seems to be in $libc, as you said before."
7751 elif $test -r $incpath/usr/lib/libc$_a; then
7752 libc=$incpath/usr/lib/libc$_a;
7753 echo "Your C library seems to be in $libc. That's fine."
7754 elif $test -r /lib/libc$_a; then
7756 echo "Your C library seems to be in $libc. You're normal."
7758 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
7760 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
7761 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
7762 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
7764 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7766 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7769 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
7771 if $test -r "$tans"; then
7772 echo "Your C library seems to be in $tans, of all places."
7778 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7782 If the guess above is wrong (which it might be if you're using a strange
7783 compiler, or your machine supports multiple models), you can override it here.
7788 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
7790 I can't seem to find your C library. I've looked in the following places:
7793 $sed 's/^/ /' libpath
7796 None of these seems to contain your C library. I need to get its name...
7801 rp='Where is your C library?'
7806 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
7807 set X `cat libnames`
7810 case $# in 1) xxx=file; esac
7811 echo "Extracting names from the following $xxx for later perusal:" >&4
7813 $sed 's/^/ /' libnames >&4
7815 $echo $n "This may take a while...$c" >&4
7819 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
7820 *) $nm $nm_opt $file 2>/dev/null;;
7825 $grep fprintf libc.tmp > libc.ptf
7826 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
7827 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
7829 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
7831 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7833 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
7835 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7837 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
7839 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7841 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
7843 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7845 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
7847 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7849 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
7851 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7853 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
7854 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
7856 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7858 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
7860 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7862 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
7864 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7866 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
7868 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7870 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
7872 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7874 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
7876 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7878 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
7880 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7882 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
7884 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7887 $nm -p $* 2>/dev/null >libc.tmp
7888 $grep fprintf libc.tmp > libc.ptf
7889 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
7890 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
7896 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
7898 if $ar t $libc > libc.tmp && \
7899 $contains '^fprintf$' libc.tmp >/dev/null 2>&1
7901 for thisname in $libnames $libc; do
7902 $ar t $thisname >>libc.tmp
7904 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
7906 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
7907 for thisname in $libnames $libc; do
7908 $ar tv $thisname >>libc.tmp
7909 emximp -o tmp.imp $thisname \
7911 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
7912 < tmp.imp >>libc.tmp
7915 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
7918 echo "$ar didn't seem to work right." >&4
7919 echo "Maybe this is a Cray...trying bld instead..." >&4
7921 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list &&
7924 for thisname in $libnames; do
7926 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
7927 $ar t $thisname >>libc.tmp
7931 echo "That didn't work either. Giving up." >&4
7941 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
7942 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
7944 *) if $test -f /lib/syscalls.exp; then
7946 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
7947 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' \
7948 /lib/syscalls.exp >>libc.list
7954 $rm -f libnames libpath
7956 : Check if we are using C++
7958 echo "Checking for C++..." >&4
7959 $cat >try.c <<'EOCP'
7971 if eval $compile_ok && $run ./try; then
7973 echo "You are using a C++ compiler."
7976 echo "You are not using a C++ compiler."
7982 : is a C symbol defined?
7985 -v) tf=libc.tmp; tdc="";;
7986 -a) tf=libc.tmp; tdc="[]";;
7987 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
7989 case "$d_cplusplus" in
7990 $define) extern_C="extern \"C\"" ;;
7991 *) extern_C="extern" ;;
7994 case "$reuseval-$4" in
7996 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
8001 if $test "$runnm" = true; then
8002 if $contains $tlook $tf >/dev/null 2>&1; then
8004 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
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 >/dev/null 2>&1 $libs && tval=true;
8007 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
8011 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;
8012 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
8018 $define) tval=true;;
8025 : define an is-in-libc? function
8026 inlibc='echo " "; td=$define; tu=$undef;
8027 sym=$1; var=$2; eval "was=\$$2";
8029 case "$reuseval$was" in
8039 echo "$sym() found." >&4;
8040 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
8042 echo "$sym() NOT found." >&4;
8043 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
8047 $define) echo "$sym() found." >&4;;
8048 *) echo "$sym() NOT found." >&4;;
8052 : see if dlopen exists
8054 xxx_ccflags="$ccflags"
8056 : with g++ one needs -shared to get is-in-libc to work for dlopen
8057 case "$gccversion" in
8059 *) case "$d_cplusplus" in
8060 "$define") ccflags="$ccflags -shared" ;;
8067 ccflags="$xxx_ccflags"
8069 : see if this is a unistd.h system
8070 set unistd.h i_unistd
8073 : determine which dynamic loading, if any, to compile in
8075 dldir="ext/DynaLoader"
8088 $define) dflt='y' ;;
8090 : Does a dl_xxx.xs file exist for this operating system
8091 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
8094 rp="Do you wish to use dynamic loading?"
8101 '') if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
8102 dflt="$dldir/dl_${osname}.xs"
8103 elif $test "$d_dlopen" = "$define" ; then
8104 dflt="$dldir/dl_dlopen.xs"
8109 *) dflt="$dldir/$dlsrc"
8112 echo "The following dynamic loading files are available:"
8113 : Can not go over to $dldir because getfile has path hard-coded in.
8114 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
8115 rp="Source file to use for dynamic loading"
8121 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
8125 Some systems may require passing special flags to $cc -c to
8126 compile modules that will be used to create a shared library.
8127 To use no flags, say "none".
8130 case "$cccdlflags" in
8131 '') case "$gccversion" in
8132 '') case "$osname" in
8134 next) dflt='none' ;;
8135 irix*) dflt='-KPIC' ;;
8136 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
8137 sunos) dflt='-pic' ;;
8141 *) case "$osname" in
8142 darwin) dflt='none' ;;
8143 *linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
8148 *) dflt="$cccdlflags" ;;
8155 # If -Dsysroot was specified, now's the time to add it
8157 if test "X$sysroot" != X; then
8158 case "$gccversion" in
8163 dflt="$dflt --sysroot=$sysroot" ;;
8173 rp="Any special flags to pass to $cc -c to compile shared library modules?"
8176 none) cccdlflags=' ' ;;
8177 *) cccdlflags="$ans" ;;
8182 Some systems use ld to create libraries that can be dynamically loaded,
8183 while other systems (such as those using ELF) use $cc.
8187 : Determine if this is ELF
8189 /* Test for whether ELF binaries are produced */
8201 int i = open("a.out",O_RDONLY);
8204 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
8205 exit(0); /* succeed (yes, it is ELF) */
8209 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
8215 '') if $test $bin_ELF = "$define"; then
8217 You appear to have ELF support. I'll use $cc to build dynamic libraries.
8221 echo "I'll use ld to build dynamic libraries."
8229 rp="What command should be used to create dynamic libraries?"
8235 Some systems may require passing special flags to $ld to create a
8236 library that can be dynamically loaded. If your ld flags include
8237 -L/other/path options to locate libraries outside your loader's normal
8238 search path, you may need to specify those -L options here as well. To
8239 use no flags, say "none".
8242 case "$lddlflags" in
8243 '') case "$osname" in
8244 haiku) dflt='-shared' ;;
8246 case "$gccversion" in
8247 '') dflt="$dflt +vnocompatwarnings" ;;
8250 *linux*|irix*|gnu*) dflt="-shared $optimize" ;;
8251 next) dflt='none' ;;
8252 solaris) # See [perl #66604].
8253 # On Solaris 11, gcc -m64 on amd64
8254 # appears not to understand -G. gcc versions at
8255 # least as old as 3.4.3 support -shared, so just
8256 # use that with Solaris 11 and later, but keep
8257 # the old behavior for older Solaris versions.
8258 case "$gccversion" in
8260 *) case "$osvers" in
8261 2.?|2.10) dflt='-G' ;;
8262 *) dflt='-shared' ;;
8267 sunos) dflt='-assert nodefinitions' ;;
8268 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
8272 *) dflt="$lddlflags" ;;
8275 : Only do this for gcc, since, for example, qcc has no concept
8277 if $test "X$sysroot" != X; then
8278 case "$gccversion" in
8280 *) dflt="$dflt --sysroot $sysroot" ;;
8284 : Try to guess additional flags to pick up local libraries.
8285 : Be careful not to append to a plain 'none'
8289 for thisflag in $ldflags; do
8294 *) dflt="$dflt $thisflag" ;;
8301 ''|' ') dflt='none' ;;
8305 *-fstack-protector*)
8307 *-fstack-protector*) ;; # Don't add it again
8308 *) dflt="$dflt -fstack-protector" ;;
8313 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
8316 none) lddlflags=' ' ;;
8317 *) lddlflags="$ans" ;;
8322 Some systems may require passing special flags to $cc to indicate that
8323 the resulting executable will use dynamic linking. To use no flags,
8327 case "$ccdlflags" in
8328 '') case "$osname" in
8329 *linux*|hpux|gnu*) dflt='-Wl,-E' ;;
8330 next|sunos) dflt='none' ;;
8334 *) dflt="$ccdlflags" ;;
8336 rp="Any special flags to pass to $cc to use dynamic linking?"
8339 none) ccdlflags=' ' ;;
8340 *) ccdlflags="$ans" ;;
8352 ld_can_script="$undef"
8353 case "$bin_ELF$usedl" in
8355 # Abuse try.h and a.out names for neat cleanup
8367 if $cc $cccdlflags $ccdlflags $ccflags \
8368 $ldflags $lddlflags -o a.out try.c \
8369 -Wl,--version-script=try.h >/dev/null 2>&1 \
8370 && $test -s a.out ; then
8371 echo "ld supports scripting" >&4
8372 ld_can_script="$define"
8374 echo "ld does not support scripting" >&4
8380 : Do we want a shared libperl?
8384 # No dynamic loading being used, so don't bother even to prompt.
8387 *) case "$useshrplib" in
8388 '') case "$osname" in
8389 svr4*|nonstopux|dgux|dynixptx|esix|powerux|haiku|cygwin*)
8391 also='Building a shared libperl is required for dynamic loading to work on your system.'
8396 also='Building a shared libperl is needed for MAB support.'
8414 The perl executable is normally obtained by linking perlmain.c with
8415 libperl${_a}, any static extensions (usually just DynaLoader), and
8416 any other libraries needed on this system (such as -lm, etc.). Since
8417 your system supports dynamic loading, it is probably possible to build
8418 a shared libperl.$so. If you will have more than one executable linked
8419 to libperl.$so, this will significantly reduce the size of each
8420 executable, but it may have a noticeable effect on performance. The
8421 default is probably sensible for your system.
8425 rp="Build a shared libperl.$so (y/n)"
8429 useshrplib='true' ;;
8430 *) useshrplib='false' ;;
8435 case "$useshrplib" in
8437 case "$userelocatableinc" in
8439 echo "Cannot build with both -Duserelocatableinc and -Duseshrplib" >&4
8440 echo "See INSTALL for an explanation why that won't work." >&4
8446 # Figure out a good name for libperl.so. Since it gets stored in
8447 # a version-specific architecture-dependent library, the version
8448 # number isn't really that important, except for making cc/ld happy.
8450 # A name such as libperl.so.10.1
8451 majmin="libperl.$so.$patchlevel.$subversion"
8452 # A name such as libperl.so.100
8453 majonly=`echo $patchlevel $subversion |
8454 $awk '{printf "%d%02d", $1, $2}'`
8455 majonly=libperl.$so.$majonly
8456 # I'd prefer to keep the os-specific stuff here to a minimum, and
8457 # rely on figuring it out from the naming of libc.
8458 case "${osname}${osvers}" in
8461 # XXX How handle the --version stuff for MAB?
8463 *linux*|gnu*) # ld won't link with a bare -lperl otherwise.
8466 cygwin*) # ld links now against the dll directly
8467 majmin="cygperl5_${patchlevel}_${subversion}.${so}"
8468 majonly=`echo $patchlevel $subversion |
8469 $awk '{printf "%03d%03d", $1, $2}'`
8470 majonly=cygperl5.$majonly.$so
8473 *) # Try to guess based on whether libc has major.minor.
8475 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8476 *libc.$so.[0-9]*) dflt=$majonly ;;
8477 *) dflt=libperl.$so ;;
8487 I need to select a good name for the shared libperl. If your system uses
8488 library names with major and minor numbers, then you might want something
8489 like $majmin. Alternatively, if your system uses a single version
8490 number for shared libraries, then you might want to use $majonly.
8491 Or, your system might be quite happy with a simple libperl.$so.
8493 Since the shared libperl will get installed into a version-specific
8494 architecture-dependent directory, the version number of the shared perl
8495 library probably isn't important, so the default should be o.k.
8498 rp='What name do you want to give to the shared libperl?'
8501 echo "Ok, I'll use $libperl"
8504 libperl="libperl${_a}"
8508 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8512 WARNING: Use of the shrpdir variable for the installation location of
8513 the shared $libperl is not supported. It was never documented and
8514 will not work in this version. Let me (perlbug@perl.org)
8515 know of any problems this may cause.
8521 But your current setting of $shrpdir is
8522 the default anyway, so it's harmless.
8527 Further, your current attempted setting of $shrpdir
8528 conflicts with the value of $archlibexp/CORE
8529 that installperl will use.
8536 # How will the perl executable find the installed shared $libperl?
8537 # Add $xxx to ccdlflags.
8538 # If we can't figure out a command-line option, use $shrpenv to
8539 # set env LD_RUN_PATH. The main perl makefile uses this.
8540 shrpdir=$archlibexp/CORE
8543 if "$useshrplib"; then
8546 # We'll set it in Makefile.SH...
8551 freebsd|mirbsd|netbsd|openbsd|interix|dragonfly|bitrig)
8552 xxx="-Wl,-R$shrpdir"
8554 bsdos|linux|irix*|dec_osf|gnu*)
8555 xxx="-Wl,-rpath,$shrpdir"
8558 # next doesn't like the default...
8561 # Haiku doesn't like the default, either.
8564 # hpux doesn't like the default, either.
8565 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8568 # cygwin needs only ldlibpth
8571 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8577 # Only add $xxx if it isn't already in ccdlflags.
8578 case " $ccdlflags " in
8580 *) ccdlflags="$ccdlflags $xxx"
8583 Adding $xxx to the flags
8584 passed to $ld so that the perl executable will find the
8585 installed shared $libperl.
8593 # Fix ccdlflags in AIX for building external extensions.
8594 # (For building Perl itself bare -bE:perl.exp is needed,
8595 # Makefile.SH takes care of this.)
8597 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8599 # Respect a hint or command-line value.
8601 '') shrpenv="$tmp_shrpenv" ;;
8603 case "$ldlibpthname" in
8604 '') ldlibpthname=LD_LIBRARY_PATH ;;
8605 none) ldlibpthname='' ;;
8608 : determine where manual pages are on this system
8612 syspath='/usr/share/man/man1 /usr/man/man1'
8613 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8614 syspath="$syspath /usr/man/u_man/man1"
8615 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8616 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8617 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8618 sysman=`./loc . /usr/man/man1 $syspath`
8621 if $test -d "$sysman"; then
8622 echo "System manual is in $sysman." >&4
8624 echo "Could not find manual pages in source form." >&4
8627 : determine where manual pages go
8628 set man1dir man1dir none
8632 $spackage has manual pages available in source form.
8636 echo "However, you don't have nroff, so they're probably useless to you."
8638 '') man1dir="none";;
8641 echo "If you don't want the manual sources installed, answer 'none'."
8646 lookpath="$prefixexp/share/man/man1"
8647 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8648 lookpath="$lookpath $prefixexp/man/p_man/man1"
8649 lookpath="$lookpath $prefixexp/man/u_man/man1"
8650 lookpath="$lookpath $prefixexp/man/man.1"
8652 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8653 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8663 rp="Where do the main $spackage manual pages (source) go?"
8665 if $test "X$man1direxp" != "X$ansexp"; then
8676 : What suffix to use on installed man pages
8683 rp="What suffix should be used for the main $spackage man pages?"
8685 '') case "$man1dir" in
8699 *) dflt="$man1ext";;
8706 : see if we can have long filenames
8708 first=123456789abcdef
8710 if (echo hi >$first) 2>/dev/null; then
8711 if $test -f 123456789abcde; then
8712 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8715 echo 'You can have filenames longer than 14 characters.'>&4
8720 You can't have filenames longer than 14 chars.
8721 You can't even think about them!
8727 $rm -rf 123456789abcde*
8729 : determine where library module manual pages go
8730 set man3dir man3dir none
8734 $spackage has manual pages for many of the library modules.
8740 However, you don't have nroff, so they're probably useless to you.
8743 '') man3dir="none";;
8747 case "$d_flexfnam" in
8750 However, your system can't handle the long file names like File::Basename.3.
8753 '') man3dir="none";;
8757 echo "If you don't want the manual sources installed, answer 'none'."
8758 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8760 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8761 if $test -d "$privlib/man/man3"; then
8764 WARNING: Previous versions of perl installed man3 pages into
8765 $privlib/man/man3. This version will suggest a
8766 new default of $dflt.
8770 rp='Do you wish to preserve the old behavior?(y/n)'
8773 y*) dflt="$privlib/man/man3" ;;
8778 *) dflt="$man3dir" ;;
8785 rp="Where do the $package library man pages (source) go?"
8795 : What suffix to use on installed man pages
8801 rp="What suffix should be used for the $package library man pages?"
8803 '') case "$man3dir" in
8817 *) dflt="$man3ext";;
8824 : see if we have to deal with yellow pages, now NIS.
8825 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8826 if $test -f /usr/etc/nibindd; then
8828 echo "I'm fairly confident you're on a NeXT."
8830 rp='Do you get the hosts file via NetInfo?'
8839 y*) hostcat='nidump hosts .';;
8840 *) case "$hostcat" in
8841 nidump*) hostcat='';;
8851 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8859 rp='Are you getting the hosts file via yellow pages?'
8862 y*) hostcat='ypcat hosts';;
8863 *) hostcat='cat /etc/hosts';;
8869 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8872 '') test -f /etc/group && groupcat='cat /etc/group';;
8875 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8878 : now get the host name
8880 echo "Figuring out host name..." >&4
8881 case "$myhostname" in
8883 echo 'Maybe "hostname" will work...'
8884 if tans=`sh -c hostname 2>&1` ; then
8892 if $test "$cont"; then
8894 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8895 if tans=`cat /etc/systemid 2>&1` ; then
8897 phostname='cat /etc/systemid'
8898 echo "Whadyaknow. Xenix always was a bit strange..."
8901 elif $test -r /etc/systemid; then
8902 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8905 if $test "$cont"; then
8906 echo 'No, maybe "uuname -l" will work...'
8907 if tans=`sh -c 'uuname -l' 2>&1` ; then
8909 phostname='uuname -l'
8911 echo 'Strange. Maybe "uname -n" will work...'
8912 if tans=`sh -c 'uname -n' 2>&1` ; then
8914 phostname='uname -n'
8916 echo 'Oh well, maybe I can mine it out of whoami.h...'
8917 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8918 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8919 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8921 case "$myhostname" in
8922 '') echo "Does this machine have an identity crisis or something?"
8925 echo "Well, you said $myhostname before..."
8926 phostname='echo $myhostname';;
8932 case "$myhostname" in
8933 '') myhostname=noname ;;
8935 : you do not want to know about this
8940 if $test "$myhostname" ; then
8942 rp='Your host name appears to be "'$myhostname'".'" Right?"
8950 : bad guess or no guess
8951 while $test "X$myhostname" = X ; do
8953 rp="Please type the (one word) name of your host:"
8958 : translate upper to lower if necessary
8959 case "$myhostname" in
8961 echo "(Normalizing case in your host name)"
8962 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8966 case "$myhostname" in
8968 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8969 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8970 echo "(Trimming domain name from host name--host name is now $myhostname)"
8972 *) case "$mydomain" in
8975 test "X$hostcat" = "Xypcat hosts" &&
8976 ypmatch "$myhostname" hosts 2>/dev/null |\
8977 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8980 test "X$hostcat" != "X" &&
8981 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8982 /[ ]$myhostname[ . ]/p" > hosts
8985 if $test -f hosts; then
8986 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8987 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8988 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8989 hosts | $sort | $uniq | \
8990 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8991 case `$echo X$dflt` in
8992 X*\ *) echo "(Several hosts in the database matched hostname)"
8995 X.) echo "(You do not have fully-qualified names in the hosts database)"
8999 echo "(I cannot locate a hosts database anywhere)"
9004 tans=`./loc resolv.conf X /etc /usr/etc`
9005 if $test -f "$tans"; then
9006 echo "(Attempting domain name extraction from $tans)"
9007 dflt=.`$sed -n -e 's/ / /g' \
9008 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
9011 .) dflt=.`$sed -n -e 's/ / /g' \
9012 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
9020 .) echo "(No help from resolv.conf either -- attempting clever guess)"
9021 dflt=.`sh -c domainname 2>/dev/null`
9024 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
9028 case "$dflt$osname" in
9029 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
9030 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
9034 .) echo "(Lost all hope -- silly guess then)"
9040 *) dflt="$mydomain";;
9044 rp="What is your domain name?"
9054 : translate upper to lower if necessary
9057 echo "(Normalizing case in your domain name)"
9058 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
9062 : a little sanity check here
9063 case "$phostname" in
9066 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
9067 $myhostname$mydomain|$myhostname) ;;
9069 case "$phostname" in
9071 echo "(That doesn't agree with your whoami.h file, by the way.)"
9074 echo "(That doesn't agree with your $phostname command, by the way.)"
9082 : determine the e-mail address of the user who is running us
9085 I need to get your e-mail address in Internet format if possible, i.e.
9086 something like user@host.domain. Please answer accurately since I have
9087 no easy means to double check it. The default value provided below
9088 is most probably close to reality but may not be valid from outside
9089 your organization...
9093 while test "$cont"; do
9094 case "$MAILDOMAIN" in
9096 if $test -s /etc/mailname; then
9097 maildomain=`$cat /etc/mailname`
9099 maildomain="$myhostname$mydomain"
9102 *) maildomain="$MAILDOMAIN";;
9105 '') dflt="$cf_by@$maildomain";;
9106 *) dflt="$cf_email";;
9108 rp='What is your e-mail address?'
9114 rp='Address does not look like an Internet one. Use it anyway?'
9128 : Ask e-mail of administrator
9131 If you or somebody else will be maintaining perl at your site, please
9132 fill in the correct e-mail address here so that they may be contacted
9133 if necessary. Currently, the "perlbug" program included with perl
9134 will send mail to this address in addition to perlbug@perl.org. You may
9135 enter "none" for no administrator.
9138 case "$perladmin" in
9139 '') dflt="$cf_email";;
9140 *) dflt="$perladmin";;
9142 rp='Perl administrator e-mail address'
9146 : determine whether to only install version-specific parts.
9149 Do you want to install only the version-specific parts of the perl
9150 distribution? Usually you do *not* want to do this.
9152 case "$versiononly" in
9153 "$define"|[Yy]*|true) dflt='y' ;;
9156 rp="Do you want to install only the version-specific parts of perl?"
9159 [yY]*) val="$define";;
9165 case "$versiononly" in
9166 "$define") inc_version_list=''
9167 inc_version_list_init=0
9171 : figure out how to guarantee perl startup
9172 : XXX Note that this currently takes advantage of the bug that binexp ignores
9173 : the Configure -Dinstallprefix setting, which in turn means that under
9174 : relocatable @INC, initialinstalllocation is what binexp started as.
9175 case "$startperl" in
9177 case "$sharpbang" in
9181 I can use the #! construct to start perl on your system. This will
9182 make startup of perl scripts faster, but may cause problems if you
9183 want to share those scripts and perl is not in a standard place
9184 ($initialinstalllocation/perl) on all your platforms. The alternative
9185 is to force a shell by starting the script with a single ':' character.
9188 case "$versiononly" in
9189 "$define") dflt="$initialinstalllocation/perl$version";;
9190 *) dflt="$initialinstalllocation/perl";;
9192 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
9195 none) startperl=": # use perl";;
9196 *) startperl="#!$ans"
9197 if $test 30 -lt `echo "$ans" | wc -c`; then
9200 WARNING: Some systems limit the #! command to 32 characters.
9201 If you experience difficulty running Perl scripts with #!, try
9202 installing Perl in a directory with a shorter pathname.
9208 *) startperl=": # use perl"
9213 echo "I'll use $startperl to start perl scripts."
9215 : figure best path for perl in scripts
9218 case "$versiononly" in
9219 "$define") perlpath="$initialinstalllocation/perl$version";;
9220 *) perlpath="$initialinstalllocation/perl";;
9222 case "$startperl" in
9227 I will use the "eval 'exec'" idiom to start Perl on your system.
9228 I can use the full path of your Perl binary for this purpose, but
9229 doing so may cause problems if you want to share those scripts and
9230 Perl is not always in a standard place ($initialinstalllocation/perl).
9233 dflt="$initialinstalllocation/perl"
9234 rp="What path shall I use in \"eval 'exec'\"?"
9241 case "$startperl" in
9243 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
9246 : determine where public executable scripts go
9247 set scriptdir scriptdir
9249 case "$scriptdir" in
9252 : guess some guesses
9253 $test -d /usr/share/scripts && dflt=/usr/share/scripts
9254 $test -d /usr/share/bin && dflt=/usr/share/bin
9255 $test -d /usr/local/script && dflt=/usr/local/script
9256 $test -d /usr/local/scripts && dflt=/usr/local/scripts
9257 $test -d $prefixexp/script && dflt=$prefixexp/script
9261 *) dflt="$scriptdir"
9266 Some installations have a separate directory just for executable scripts so
9267 that they can mount it across multiple architectures but keep the scripts in
9268 one spot. You might, for example, have a subdirectory of /usr/share for this.
9269 Or you might just lump your scripts in with all your other executables.
9273 rp='Where do you keep publicly executable scripts?'
9275 if $test "X$ansexp" != "X$scriptdirexp"; then
9281 : A little fix up for an irregularly named variable.
9282 installscript="$installscriptdir"
9284 : determine where add-on public executables go
9286 '') dflt=$siteprefix/bin ;;
9290 rp='Pathname where the add-on public executables should be installed?'
9295 : determine where add-on html pages go
9296 : There is no standard location, so try to copy the previously-selected
9297 : directory structure for the core html pages.
9298 case "$sitehtml1dir" in
9299 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9300 *) dflt=$sitehtml1dir ;;
9303 ''|' ') dflt=none ;;
9306 rp='Pathname where the site-specific html pages should be installed?'
9308 prefixvar=sitehtml1dir
9311 : determine where add-on library html pages go
9312 : There is no standard location, so try to copy the previously-selected
9313 : directory structure for the core html pages.
9314 case "$sitehtml3dir" in
9315 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9316 *) dflt=$sitehtml3dir ;;
9319 ''|' ') dflt=none ;;
9322 rp='Pathname where the site-specific library html pages should be installed?'
9324 prefixvar=sitehtml3dir
9327 : determine where add-on manual pages go
9328 case "$siteman1dir" in
9329 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
9330 *) dflt=$siteman1dir ;;
9333 ''|' ') dflt=none ;;
9336 rp='Pathname where the site-specific manual pages should be installed?'
9338 prefixvar=siteman1dir
9341 : determine where add-on library man pages go
9342 case "$siteman3dir" in
9343 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
9344 *) dflt=$siteman3dir ;;
9347 ''|' ') dflt=none ;;
9350 rp='Pathname where the site-specific library manual pages should be installed?'
9352 prefixvar=siteman3dir
9355 : determine where add-on public executable scripts go
9356 case "$sitescript" in
9357 '') dflt=$siteprefix/script
9358 $test -d $dflt || dflt=$sitebin ;;
9359 *) dflt="$sitescript" ;;
9362 rp='Pathname where add-on public executable scripts should be installed?'
9364 prefixvar=sitescript
9367 : see if backtrace exists
9368 set backtrace d_backtrace
9371 : add flags if using c backtrace
9372 case "$usecbacktrace" in
9373 "") usecbacktrace=$undef ;;
9375 case "$d_backtrace" in
9377 case " $ccflags " in
9378 *" -DUSE_C_BACKTRACE "*) ;; # Already there.
9379 *) ccflags="$ccflags -DUSE_C_BACKTRACE -g" ;;
9383 echo "This system does not support backtrace" >&4
9384 usecbacktrace=$undef
9390 : Check if faststdio is requested and available
9391 case "$usefaststdio" in
9392 $define|true|[yY]*|'')
9393 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
9403 Perl can be built to use 'fast stdio', which means using the stdio
9404 library but also directly manipulating the stdio buffers to enable
9405 faster I/O. Using stdio is better for backward compatibility (especially
9406 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
9407 interface has been preferred instead of stdio.
9409 If this doesn't make any sense to you, just accept the default '$dflt'.
9411 rp='Use the "fast stdio" if available?'
9414 y|Y) val="$define" ;;
9421 : define an is-a-typedef? function
9422 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9424 "") inclist="sys/types.h";;
9426 eval "varval=\$$var";
9430 for inc in $inclist; do
9431 echo "#include <$inc>" >>temp.c;
9433 echo "#ifdef $type" >> temp.c;
9434 echo "printf(\"We have $type\");" >> temp.c;
9435 echo "#endif" >> temp.c;
9436 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9437 if $contains $type temp.E >/dev/null 2>&1; then
9443 *) eval "$var=\$varval";;
9446 : define an is-a-typedef? function that prompts if the type is not available.
9447 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9449 "") inclist="sys/types.h";;
9451 eval "varval=\$$var";
9455 for inc in $inclist; do
9456 echo "#include <$inc>" >>temp.c;
9458 echo "#ifdef $type" >> temp.c;
9459 echo "printf(\"We have $type\");" >> temp.c;
9460 echo "#endif" >> temp.c;
9461 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9463 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
9464 if $contains $type temp.E >/dev/null 2>&1; then
9465 echo "$type found." >&4;
9468 echo "$type NOT found." >&4;
9474 *) eval "$var=\$varval";;
9477 : see what type lseek is declared as in the kernel
9478 rp="What is the type used for lseek's offset on this system?"
9479 set off_t lseektype long stdio.h sys/types.h
9483 echo "Checking to see how big your file offsets are..." >&4
9485 #include <sys/types.h>
9489 printf("%d\n", (int)sizeof($lseektype));
9494 if eval $compile_ok; then
9495 lseeksize=`$run ./try`
9496 echo "Your file offsets are $lseeksize bytes long."
9500 echo "(I can't seem to compile the test program. Guessing...)"
9501 rp="What is the size of your file offsets (in bytes)?"
9507 : see what type file positions are declared as in the library
9508 rp="What is the type for file position used by fsetpos()?"
9509 set fpos_t fpostype long stdio.h sys/types.h
9512 : Check size for Fpos_t
9515 *_t) zzz="$fpostype" ;;
9518 echo "Checking the size of $zzz..." >&4
9520 #include <sys/types.h>
9527 printf("%d\n", (int)sizeof($fpostype));
9532 if eval $compile_ok; then
9536 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9539 echo "Your $zzz is $fpossize bytes long."
9545 echo "(I can't compile the test program. Guessing...)" >&4
9546 rp="What is the size of your file positions (in bytes)?"
9551 : Check for large file support
9552 # Backward compatibility (uselfs is deprecated).
9554 "$define"|true|[yY]*)
9557 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9559 uselargefiles="$define"
9563 case "$lseeksize:$fpossize" in
9566 You can have files larger than 2 gigabytes.
9569 *) case "$uselargefiles" in
9570 "$undef"|false|[nN]*) dflt='n' ;;
9575 Perl can be built to understand large files (files larger than 2 gigabytes)
9576 on some systems. To do so, Configure can be run with -Duselargefiles.
9578 If this doesn't make any sense to you, just accept the default '$dflt'.
9580 rp='Try to understand large files, if available?'
9583 y|Y) val="$define" ;;
9590 : Look for a hint-file generated 'call-back-unit'. If the
9591 : user has specified that a large files perl is to be built,
9592 : we may need to set or change some other defaults.
9593 if $test -f uselargefiles.cbu; then
9594 echo "Your platform has some specific hints regarding large file builds, using them..."
9595 . ./uselargefiles.cbu
9597 case "$uselargefiles" in
9599 if $test -f uselargefiles.cbu; then
9601 echo "Rechecking to see how big your file offsets are..." >&4
9603 #include <sys/types.h>
9607 printf("%d\n", (int)sizeof($lseektype));
9612 if eval $compile_ok; then
9613 lseeksize=`$run ./try`
9614 $echo "Your file offsets are now $lseeksize bytes long."
9618 echo "(I can't seem to compile the test program. Guessing...)"
9619 rp="What is the size of your file offsets (in bytes)?"
9624 *_t) zzz="$fpostype" ;;
9627 $echo $n "Rechecking the size of $zzz...$c" >&4
9629 #include <sys/types.h>
9636 printf("%d\n", (int)sizeof($fpostype));
9641 if eval $compile_ok; then
9646 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9649 echo " $fpossize bytes." >&4
9655 echo "(I can't compile the test program. Guessing...)" >&4
9656 rp="What is the size of your file positions (in bytes)?"
9665 : Check if we want perlio
9668 : Set the vendorbin variables
9669 case "$vendorprefix" in
9670 '') d_vendorbin="$undef"
9674 *) d_vendorbin="$define"
9675 : determine where vendor-supplied executables go.
9676 case "$vendorbin" in
9677 '') dflt=$vendorprefix/bin ;;
9678 *) dflt="$vendorbin" ;;
9681 rp='Pathname for the vendor-supplied executables directory?'
9684 vendorbinexp="$ansexp"
9690 : Set the vendorhtml1dir variables
9691 case "$vendorprefix" in
9692 '') vendorhtml1dir=''
9693 vendorhtml1direxp=''
9695 *) : determine where vendor-supplied html pages go.
9696 : There is no standard location, so try to copy the previously-selected
9697 : directory structure for the core html pages.
9698 : XXX Better default suggestions would be welcome.
9699 case "$vendorhtml1dir" in
9700 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9701 *) dflt=$vendorhtml1dir ;;
9704 ''|' ') dflt=none ;;
9707 rp='Pathname for the vendor-supplied html pages?'
9709 vendorhtml1dir="$ans"
9710 vendorhtml1direxp="$ansexp"
9713 : Use ' ' for none so value is preserved next time through Configure
9714 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9715 prefixvar=vendorhtml1dir
9718 : Set the vendorhtml3dir variables
9719 case "$vendorprefix" in
9720 '') vendorhtml3dir=''
9721 vendorhtml3direxp=''
9723 *) : determine where vendor-supplied module html pages go.
9724 : There is no standard location, so try to copy the previously-selected
9725 : directory structure for the core html pages.
9726 : XXX Better default suggestions would be welcome.
9727 case "$vendorhtml3dir" in
9728 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9729 *) dflt=$vendorhtml3dir ;;
9732 ''|' ') dflt=none ;;
9735 rp='Pathname for the vendor-supplied html pages?'
9737 vendorhtml3dir="$ans"
9738 vendorhtml3direxp="$ansexp"
9741 : Use ' ' for none so value is preserved next time through Configure
9742 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9743 prefixvar=vendorhtml3dir
9746 : Set the vendorman1dir variables
9747 case "$vendorprefix" in
9748 '') vendorman1dir=''
9751 *) : determine where vendor-supplied manual pages go.
9752 case "$vendorman1dir" in
9753 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9754 *) dflt=$vendorman1dir ;;
9757 ''|' ') dflt=none ;;
9760 rp='Pathname for the vendor-supplied manual section 1 pages?'
9762 vendorman1dir="$ans"
9763 vendorman1direxp="$ansexp"
9766 : Use ' ' for none so value is preserved next time through Configure
9767 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9768 prefixvar=vendorman1dir
9771 : Set the vendorman3dir variables
9772 case "$vendorprefix" in
9773 '') vendorman3dir=''
9776 *) : determine where vendor-supplied module manual pages go.
9777 case "$vendorman3dir" in
9778 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9779 *) dflt=$vendorman3dir ;;
9782 ''|' ') dflt=none ;;
9785 rp='Pathname for the vendor-supplied manual section 3 pages?'
9787 vendorman3dir="$ans"
9788 vendorman3direxp="$ansexp"
9791 : Use ' ' for none so value is preserved next time through Configure
9792 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9793 prefixvar=vendorman3dir
9796 : Set the vendorscript variables
9797 case "$vendorprefix" in
9798 '') d_vendorscript="$undef"
9802 *) d_vendorscript="$define"
9803 : determine where vendor-supplied scripts go.
9804 case "$vendorscript" in
9805 '') dflt=$vendorprefix/script
9806 $test -d $dflt || dflt=$vendorbin ;;
9807 *) dflt="$vendorscript" ;;
9811 The installation process will create a directory for
9812 vendor-supplied scripts.
9816 rp='Pathname for the vendor-supplied scripts directory?'
9819 vendorscriptexp="$ansexp"
9822 prefixvar=vendorscript
9825 : script used to emit important warnings
9828 if test \$# -gt 0; then
9833 echo "*** WARNING:" >&4
9834 sed -e 's/^/*** /' <msg >&4
9836 cat msg >>config.msg
9837 echo " " >>config.msg
9843 : see which of string.h or strings.h is needed
9845 strings=`./findhdr string.h`
9846 if $test "$strings" && $test -r "$strings"; then
9847 echo "Using <string.h> instead of <strings.h>." >&4
9851 strings=`./findhdr strings.h`
9852 if $test "$strings" && $test -r "$strings"; then
9853 echo "Using <strings.h> instead of <string.h>." >&4
9855 ./warn "No string header found -- You'll surely have problems."
9861 "$undef") strings=`./findhdr strings.h`;;
9862 *) strings=`./findhdr string.h`;;
9865 : see if qgcvt exists
9869 : Check print/scan long double stuff
9872 if $test X"$d_longdbl" = X"$define"; then
9874 echo "Checking how to print long doubles..." >&4
9876 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
9877 $cat >try.c <<'EOCP'
9878 #include <sys/types.h>
9882 printf("%.3f\n", d);
9886 if eval $compile; then
9890 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
9891 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
9892 echo "We will use %f."
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 $cat >try.c <<'EOCP'
9922 #include <sys/types.h>
9925 long double d = 123.456;
9926 printf("%.3llf\n", d);
9930 if eval $compile; then
9934 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
9935 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
9936 echo "We will use %llf."
9942 if $test X"$sPRIfldbl" = X; then
9943 $cat >try.c <<'EOCP'
9944 #include <sys/types.h>
9947 long double d = 123.456;
9948 printf("%.3lf\n", d);
9952 if eval $compile; then
9956 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
9957 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
9958 echo "We will use %lf."
9964 if $test X"$sPRIfldbl" = X; then
9965 echo "Cannot figure out how to print long doubles." >&4
9967 sSCNfldbl=$sPRIfldbl # expect consistency
9974 case "$sPRIfldbl" in
9975 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
9976 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
9977 d_SCNfldbl="$undef";
9979 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
9980 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
9981 d_SCNfldbl="$define";
9985 : Check how to convert floats to strings.
9987 if test "X$d_Gconvert" = X; then
9990 echo "Checking for an efficient way to convert floats to strings."
9992 case "$uselongdouble" in
9993 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
9995 case "$d_longdbl" in
9996 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
9998 case "$d_PRIgldbl" in
9999 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
10002 #ifdef TRY_gconvert
10003 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
10004 char *myname = "gconvert";
10007 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
10008 char *myname = "gcvt";
10011 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
10012 char *myname = "qgcvt";
10013 #define DOUBLETYPE long double
10016 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
10017 #ifdef HAS_PRIgldbl
10018 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
10020 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
10023 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
10025 char *myname = "sprintf";
10029 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
10030 #define DOUBLETYPE long double
10032 #define DOUBLETYPE double
10038 #$i_stdlib I_STDLIB
10040 #include <stdlib.h>
10042 #$i_string I_STRING
10044 # include <string.h>
10046 # include <strings.h>
10049 int checkit(char *expect, char *got)
10051 if (strcmp(expect, got)) {
10052 printf("%s oddity: Expected %s, got %s\n",
10053 myname, expect, got);
10063 /* This must be 1st test on (which?) platform */
10064 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
10065 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
10066 checkit("0.1", buf);
10068 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
10069 checkit("0.01", buf);
10071 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
10072 checkit("0.001", buf);
10074 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
10075 checkit("0.0001", buf);
10077 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
10078 if (strlen(buf) > 5)
10079 checkit("9e-005", buf); /* for Microsoft ?? */
10081 checkit("9e-05", buf);
10083 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
10086 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
10087 checkit("1.1", buf);
10089 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
10090 checkit("1.01", buf);
10092 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
10093 checkit("1.001", buf);
10095 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
10096 checkit("1.0001", buf);
10098 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
10099 checkit("1.00001", buf);
10101 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
10102 checkit("1.000001", buf);
10104 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
10107 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
10108 checkit("-1", buf);
10110 /* Some Linux gcvt's give 1.e+5 here. */
10111 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
10112 checkit("100000", buf);
10114 /* Some Linux gcvt's give -1.e+5 here. */
10115 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
10116 checkit("-100000", buf);
10118 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
10119 checkit("123.456", buf);
10121 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
10122 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
10123 /* 34 should be enough to scare even long double
10124 * places into using the e notation. */
10125 if (strlen(buf) > 5)
10126 checkit("1e+034", buf); /* for Microsoft */
10128 checkit("1e+34", buf);
10130 /* For Perl, if you add additional tests here, also add them to
10131 * t/base/num.t for benefit of platforms not using Configure or
10132 * overriding d_Gconvert */
10137 : first add preferred functions to our list
10139 for xxx_convert in $gconvert_preference; do
10140 case $xxx_convert in
10141 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
10142 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
10145 : then add any others
10146 for xxx_convert in gconvert gcvt sprintf; do
10147 case "$xxx_list" in
10149 *) xxx_list="$xxx_list $xxx_convert" ;;
10153 case "$d_longdbl$uselongdouble" in
10155 : again, add preferred functions to our list first
10157 for xxx_convert in $gconvert_ld_preference; do
10158 case $xxx_convert in
10159 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
10160 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
10163 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
10164 for xxx_convert in qgcvt sprintf $xxx_list; do
10165 case "$xxx_ld_list" in
10166 $xxx_convert*|*" $xxx_convert"*) ;;
10167 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
10170 : if sprintf cannot do long doubles, move it to the end
10171 if test "$d_PRIgldbl" != "$define"; then
10172 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
10174 : if no qgcvt, remove it
10175 if test "$d_qgcvt" != "$define"; then
10176 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
10179 xxx_list="$xxx_ld_list"
10183 for xxx_convert in $xxx_list; do
10184 echo "Trying $xxx_convert..."
10185 $rm -f try try$_o core
10186 set try -DTRY_$xxx_convert
10187 if eval $compile; then
10188 echo "$xxx_convert() found." >&4
10189 if $run ./try; then
10190 echo "I'll use $xxx_convert to convert floats into a string." >&4
10193 echo "...But $xxx_convert didn't work as I expected."
10197 echo "$xxx_convert NOT found." >&4
10201 if test X$xxx_convert = X; then
10202 echo "*** WHOA THERE!!! ***" >&4
10203 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
10204 xxx_convert=sprintf
10207 case "$xxx_convert" in
10208 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
10209 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
10210 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
10211 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
10212 "$define$define$define")
10213 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
10214 "$define$define$undef")
10215 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
10216 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
10224 : see if _fwalk exists
10228 : Initialize h_fcntl
10231 : Initialize h_sysfile
10234 : access call always available on UNIX
10235 set access d_access
10238 : locate the flags for 'access()'
10239 case "$d_access" in
10242 $cat >access.c <<EOCP
10243 #include <sys/types.h>
10248 #include <sys/file.h>
10251 #include <unistd.h>
10253 #$i_stdlib I_STDLIB
10255 #include <stdlib.h>
10261 : check sys/file.h first, no particular reason here
10262 if $test `./findhdr sys/file.h` && \
10263 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
10265 echo "<sys/file.h> defines the *_OK access constants." >&4
10266 elif $test `./findhdr fcntl.h` && \
10267 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
10269 echo "<fcntl.h> defines the *_OK access constants." >&4
10270 elif $test `./findhdr unistd.h` && \
10271 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
10272 echo "<unistd.h> defines the *_OK access constants." >&4
10274 echo "I can't find the four *_OK access constants--I'll use mine." >&4
10280 : see if accessx exists
10281 set accessx d_accessx
10284 : see if aintl exists
10288 : see if alarm exists
10292 : see if 64bit time functions exists
10294 set ctime64 d_ctime64
10297 set localtime64 d_localtime64
10300 set gmtime64 d_gmtime64
10303 set mktime64 d_mktime64
10306 set difftime64 d_difftime64
10309 set asctime64 d_asctime64
10312 : see if POSIX threads are available
10313 set pthread.h i_pthread
10316 : define a function to check prototypes
10317 $cat > protochk <<EOSH
10320 optimize="$optimize"
10322 prototype="$prototype"
10325 usethreads=$usethreads
10326 i_pthread=$i_pthread
10327 pthread_h_first=$pthread_h_first
10330 $cat >> protochk <<'EOSH'
10335 while test $# -ge 2; do
10337 $define) echo "#include <$2>" >> try.c ;;
10338 literal) echo "$2" >> try.c ;;
10340 # Extra magic for the benefit of systems that need pthread.h
10341 # to be included early to correctly detect threadsafe functions.
10342 # Such functions must guarantee themselves, though, that the usethreads
10343 # and i_pthread have been defined, before calling protochk.
10344 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
10345 echo "#include <pthread.h>" >> try.c
10350 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
10351 cat >> try.c <<'EOCP'
10352 #ifdef CAN_PROTOTYPE
10353 #define _(args) args
10358 echo "$foo" >> try.c
10359 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
10360 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
10366 $eunicefix protochk
10368 : Define hasproto macro for Configure internal use
10369 hasproto='varname=$1; func=$2; shift; shift;
10370 while $test $# -ge 2; do
10372 $define) echo "#include <$2>";;
10376 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
10377 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
10378 echo "$func() prototype found.";
10381 echo "$func() prototype NOT found.";
10388 : see if sys/types.h has to be included
10389 set sys/types.h i_systypes
10392 : see if sys/select.h has to be included
10393 set sys/select.h i_sysselct
10396 : Define hasfield macro for Configure internal use
10397 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
10398 while $test $# -ge 2; do
10400 $define) echo "#include <$2>";;
10404 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
10406 if eval $compile; then
10415 : see if we should include time.h, sys/time.h, or both
10417 if test "X$timeincl" = X; then
10418 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
10419 $echo $n "I'm now running the test program...$c"
10421 #include <sys/types.h>
10426 #ifdef SYSTIMEKERNEL
10429 #include <sys/time.h>
10432 #include <sys/select.h>
10434 #$i_stdlib I_STDLIB
10436 #include <stdlib.h>
10442 struct timeval bar;
10445 struct timezone tzp;
10447 if (foo.tm_sec == foo.tm_sec)
10450 if (bar.tv_sec == bar.tv_sec)
10457 for s_timezone in '-DS_TIMEZONE' ''; do
10459 for s_timeval in '-DS_TIMEVAL' ''; do
10460 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10461 for i_time in '' '-DI_TIME'; do
10462 for i_systime in '-DI_SYSTIME' ''; do
10465 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10466 if eval $compile; then
10467 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
10471 $echo $n "Succeeded with $flags$c"
10483 *SYSTIMEKERNEL*) i_systimek="$define"
10484 timeincl=`./findhdr sys/time.h`
10485 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10486 *) i_systimek="$undef";;
10489 *I_TIME*) i_time="$define"
10490 timeincl=`./findhdr time.h`" $timeincl"
10491 echo "We'll include <time.h>." >&4;;
10492 *) i_time="$undef";;
10495 *I_SYSTIME*) i_systime="$define"
10496 timeincl=`./findhdr sys/time.h`" $timeincl"
10497 echo "We'll include <sys/time.h>." >&4;;
10498 *) i_systime="$undef";;
10502 : see if struct tm knows about tm_zone
10503 case "$i_systime$i_time" in
10506 echo "Checking to see if your struct tm has tm_zone field..." >&4
10507 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
10515 case "$d_tm_tm_zone" in
10516 "$define") echo "Yes, it does." ;;
10517 *) echo "No, it doesn't." ;;
10519 : see if struct tm knows about tm_gmtoff
10520 case "$i_systime$i_time" in
10523 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
10524 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
10532 case "$d_tm_tm_gmtoff" in
10533 "$define") echo "Yes, it does." ;;
10534 *) echo "No, it doesn't." ;;
10537 : see if asctime_r exists
10538 set asctime_r d_asctime_r
10540 case "$d_asctime_r" in
10542 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10543 case "$d_asctime_r_proto:$usethreads" in
10544 ":define") d_asctime_r_proto=define
10545 set d_asctime_r_proto asctime_r $hdrs
10549 case "$d_asctime_r_proto" in
10551 case "$asctime_r_proto" in
10552 ''|0) try='char* asctime_r(const struct tm*, char*);'
10553 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SB ;;
10555 case "$asctime_r_proto" in
10556 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
10557 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SBI ;;
10559 case "$asctime_r_proto" in
10560 ''|0) try='int asctime_r(const struct tm*, char*);'
10561 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SB ;;
10563 case "$asctime_r_proto" in
10564 ''|0) try='int asctime_r(const struct tm*, char*, int);'
10565 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SBI ;;
10567 case "$asctime_r_proto" in
10568 ''|0) d_asctime_r=undef
10570 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
10571 * ) case "$asctime_r_proto" in
10572 REENTRANT_PROTO*) ;;
10573 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
10575 echo "Prototype: $try" ;;
10578 *) case "$usethreads" in
10579 define) echo "asctime_r has no prototype, not using it." >&4 ;;
10586 *) asctime_r_proto=0
10590 : see if atolf exists
10594 : see if atoll exists
10598 : Look for GCC-style attribute format
10599 case "$d_attribute_format" in
10602 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
10603 $cat >attrib.c <<'EOCP'
10605 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
10607 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10608 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10609 echo "Your C compiler doesn't support __attribute__((format))."
10612 echo "Your C compiler supports __attribute__((format))."
10616 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10620 *) val="$d_attribute_format" ;;
10622 set d_attribute_format
10626 : Look for GCC-style attribute format with null format allowed
10627 case "$d_printf_format_null" in
10628 '') case "$d_attribute_format" in
10631 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
10632 $cat >attrib.c <<EOCP
10634 #$i_stdlib I_STDLIB
10636 #include <stdlib.h>
10638 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
10639 int null_printf (char* pat,...) { return (int)pat; }
10640 int main () { exit(null_printf(NULL)); }
10642 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
10643 : run the executable in case it produces a run-time warning
10644 if $run ./attrib >>attrib.out 2>&1; then
10645 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10646 echo "Your C compiler doesn't allow __printf__ format to be null."
10649 echo "Your C compiler allows __printf__ format to be null."
10653 echo "Your C compiler executable failed with __printf__ format null."
10657 echo "Your C compiler fails with __printf__ format null."
10664 *) val="$d_printf_format_null" ;;
10666 set d_printf_format_null
10670 : Look for GCC-style attribute malloc
10671 case "$d_attribute_malloc" in
10674 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
10675 $cat >attrib.c <<'EOCP'
10677 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
10679 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10680 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10681 echo "Your C compiler doesn't support __attribute__((malloc))."
10684 echo "Your C compiler supports __attribute__((malloc))."
10688 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10692 *) val="$d_attribute_malloc" ;;
10694 set d_attribute_malloc
10698 : Look for GCC-style attribute nonnull
10699 case "$d_attribute_nonnull" in
10702 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
10703 $cat >attrib.c <<'EOCP'
10705 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
10707 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10708 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10709 echo "Your C compiler doesn't support __attribute__((nonnull))."
10712 echo "Your C compiler supports __attribute__((nonnull))."
10716 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10720 *) val="$d_attribute_nonnull" ;;
10722 set d_attribute_nonnull
10726 : Look for GCC-style attribute noreturn
10727 case "$d_attribute_noreturn" in
10730 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
10731 $cat >attrib.c <<'EOCP'
10733 void fall_over_dead( void ) __attribute__((noreturn));
10735 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10736 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10737 echo "Your C compiler doesn't support __attribute__((noreturn))."
10740 echo "Your C compiler supports __attribute__((noreturn))."
10744 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10748 *) val="$d_attribute_noreturn" ;;
10750 set d_attribute_noreturn
10754 : Look for GCC-style attribute pure
10755 case "$d_attribute_pure" in
10758 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
10759 $cat >attrib.c <<'EOCP'
10761 int square( int n ) __attribute__((pure));
10763 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10764 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10765 echo "Your C compiler doesn't support __attribute__((pure))."
10768 echo "Your C compiler supports __attribute__((pure))."
10772 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10776 *) val="$d_attribute_pure" ;;
10778 set d_attribute_pure
10782 : Look for GCC-style attribute unused
10783 case "$d_attribute_unused" in
10786 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
10787 $cat >attrib.c <<'EOCP'
10789 int do_something( int dummy __attribute__((unused)), int n );
10791 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10792 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10793 echo "Your C compiler doesn't support __attribute__((unused))."
10796 echo "Your C compiler supports __attribute__((unused))."
10800 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10804 *) val="$d_attribute_unused" ;;
10806 set d_attribute_unused
10810 : Look for GCC-style attribute deprecated
10811 case "$d_attribute_deprecated" in
10814 echo "Checking whether your compiler can handle __attribute__((deprecated)) ..." >&4
10815 $cat >attrib.c <<'EOCP'
10817 int I_am_deprecated(void) __attribute__((deprecated));
10819 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10820 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10821 echo "Your C compiler doesn't support __attribute__((deprecated))."
10824 echo "Your C compiler supports __attribute__((deprecated))."
10828 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10832 *) val="$d_attribute_deprecated" ;;
10834 set d_attribute_deprecated
10838 : Look for GCC-style attribute warn_unused_result
10839 case "$d_attribute_warn_unused_result" in
10842 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
10843 $cat >attrib.c <<'EOCP'
10845 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
10847 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10848 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10849 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
10852 echo "Your C compiler supports __attribute__((warn_unused_result))."
10856 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10860 *) val="$d_attribute_warn_unused_result" ;;
10862 set d_attribute_warn_unused_result
10866 : see if bcmp exists
10870 : see if bcopy exists
10874 : see if getpgrp exists
10875 set getpgrp d_getpgrp
10878 case "$d_getpgrp" in
10881 echo "Checking to see which flavor of getpgrp is in use..."
10883 #$i_unistd I_UNISTD
10884 #include <sys/types.h>
10886 # include <unistd.h>
10888 #$i_stdlib I_STDLIB
10890 #include <stdlib.h>
10894 if (getuid() == 0) {
10895 printf("(I see you are running Configure as super-user...)\n");
10898 #ifdef TRY_BSD_PGRP
10899 if (getpgrp(1) == 0)
10908 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10909 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
10911 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10912 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
10915 echo "I can't seem to compile and run the test program."
10917 xxx="a USG one, i.e. you use getpgrp()."
10919 # SVR4 systems can appear rather BSD-ish.
10920 case "$i_unistd" in
10922 xxx="a BSD one, i.e. you use getpgrp(pid)."
10926 xxx="probably a USG one, i.e. you use getpgrp()."
10931 echo "Assuming your getpgrp is $xxx" >&4
10940 : see if setpgrp exists
10941 set setpgrp d_setpgrp
10944 case "$d_setpgrp" in
10947 echo "Checking to see which flavor of setpgrp is in use..."
10949 #$i_unistd I_UNISTD
10950 #include <sys/types.h>
10952 # include <unistd.h>
10954 #$i_stdlib I_STDLIB
10956 #include <stdlib.h>
10960 if (getuid() == 0) {
10961 printf("(I see you are running Configure as super-user...)\n");
10964 #ifdef TRY_BSD_PGRP
10965 if (-1 == setpgrp(1, 1))
10968 if (setpgrp() != -1)
10974 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10975 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
10977 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10978 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
10981 echo "(I can't seem to compile and run the test program.)"
10983 xxx="a USG one, i.e. you use setpgrp()."
10985 # SVR4 systems can appear rather BSD-ish.
10986 case "$i_unistd" in
10988 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
10992 xxx="probably a USG one, i.e. you use setpgrp()."
10997 echo "Assuming your setpgrp is $xxx" >&4
11006 : Look for GCC-style __builtin_choose_expr
11007 case "$d_builtin_choose_expr" in
11010 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
11011 $cat >try.c <<'EOCP'
11012 #include <assert.h>
11013 #include <stdlib.h>
11016 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
11019 assert( SYRINX(1) == 2112 );
11020 assert( SYRINX(1) != 5150 );
11021 assert( SYRINX(0) == 5150 );
11022 assert( SYRINX(0) != 2112 );
11023 puts( "All good!" );
11029 if eval $compile && $run ./try; then
11030 echo "Your C compiler supports __builtin_choose_expr."
11033 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
11037 *) val="$d_builtin_choose_expr" ;;
11040 set d_builtin_choose_expr
11044 : Look for GCC-style __builtin_expect
11045 case "$d_builtin_expect" in
11048 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
11049 $cat >try.c <<'EOCP'
11052 if ( __builtin_expect(n, 0) ) n = 1;
11053 /* Remember shell exit code truth is 0, C truth is non-zero */
11058 if eval $compile && $run ./try; then
11059 echo "Your C compiler supports __builtin_expect."
11062 echo "Your C compiler doesn't seem to understand __builtin_expect."
11066 *) val="$d_builtin_expect" ;;
11069 set d_builtin_expect
11073 : see if bzero exists
11077 : see if stdarg is available
11079 if $test `./findhdr stdarg.h`; then
11080 echo "<stdarg.h> found." >&4
11083 echo "<stdarg.h> NOT found." >&4
11087 : see if varargs is available
11089 if $test `./findhdr varargs.h`; then
11090 echo "<varargs.h> found." >&4
11092 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
11095 : set up the varargs testing programs
11096 $cat > varargs.c <<EOP
11098 #include <stdarg.h>
11101 #include <varargs.h>
11105 int f(char *p, ...)
11119 p = va_arg(ap, char *);
11125 $cat > varargs <<EOP
11127 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
11136 : now check which varargs header should be included
11142 if `./varargs I_STDARG`; then
11144 elif `./varargs I_VARARGS`; then
11149 if `./varargs I_VARARGS`; then
11157 echo "*** WHOA THERE!!! ***" >&4
11158 echo " Your C compiler \"$cc\" doesn't seem to support stdarg or varargs!" >&4
11159 case "$knowitall" in
11161 echo " I'm giving up; maybe you can try again with a different compiler?" >&4
11165 echo "I could not find the definition for va_dcl... You have problems..." >&4
11166 val="$undef"; set i_stdarg; eval $setvar
11167 val="$undef"; set i_varargs; eval $setvar
11172 case "$i_varhdr" in
11174 val="$define"; set i_stdarg; eval $setvar
11175 val="$undef"; set i_varargs; eval $setvar
11178 val="$undef"; set i_stdarg; eval $setvar
11179 val="$define"; set i_varargs; eval $setvar
11182 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
11186 : see if the Compiler supports C99 variadic macros
11187 case "$i_stdarg$i_stdlib" in
11189 echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
11192 #include <stdarg.h>
11194 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
11198 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
11204 if eval $compile && $run ./try 2>&1 >/dev/null; then
11205 case "`$run ./try`" in
11207 echo "You have C99 variadic macros." >&4
11208 d_c99_variadic_macros="$define"
11211 echo "You don't have functional C99 variadic macros." >&4
11212 d_c99_variadic_macros="$undef"
11216 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
11217 d_c99_variadic_macros="$undef"
11222 echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
11223 d_c99_variadic_macros="$undef"
11227 : see if signal is declared as pointer to function returning int or void
11229 xxx=`./findhdr signal.h`
11230 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
11231 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
11232 echo "You have int (*signal())() instead of void." >&4
11234 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
11235 echo "You have void (*signal())()." >&4
11237 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
11238 echo "You have int (*signal())() instead of void." >&4
11240 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
11241 echo "You have void (*signal())()." >&4
11244 case "$d_voidsig" in
11246 echo "I can't determine whether signal handler returns void or int..." >&4
11248 rp="What type does your signal handler return?"
11251 v*) val="$define";;
11255 echo "As you already told me, signal handler returns void." >&4
11258 *) echo "As you already told me, signal handler returns int." >&4
11265 case "$d_voidsig" in
11266 "$define") signal_t="void";;
11267 *) signal_t="int";;
11271 : check for ability to cast large floats to 32-bit ints.
11273 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
11274 if $test "$intsize" -ge 4; then
11281 #$i_stdlib I_STDLIB
11283 #include <stdlib.h>
11285 #include <sys/types.h>
11286 #include <signal.h>
11287 $signal_t blech(int s) { exit(3); }
11294 signal(SIGFPE, blech);
11296 /* Don't let compiler optimize the test away. Store the number
11297 in a writable string for gcc to pass to sscanf under HP-UX.
11299 sprintf(str, "2147483647");
11300 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
11304 /* x86 processors will probably give 0x8000 0000, which is a
11305 sign change. We don't want that. We want to mimic SPARC
11306 behavior here, which is to preserve the sign and give
11309 if (i32 != ($xxx) f)
11315 if eval $compile_ok; then
11319 echo "(I can't seem to compile the test program--assuming it can't)"
11324 echo "Yup, it can."
11327 echo "Nope, it can't."
11334 : check for ability to cast negative floats to unsigned
11336 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
11339 #$i_stdlib I_STDLIB
11341 #include <stdlib.h>
11343 #include <sys/types.h>
11344 #include <signal.h>
11345 $signal_t blech(int s) { exit(7); }
11346 $signal_t blech_in_list(int s) { exit(4); }
11347 unsigned long dummy_long(unsigned long p) { return p; }
11348 unsigned int dummy_int(unsigned int p) { return p; }
11349 unsigned short dummy_short(unsigned short p) { return p; }
11353 unsigned long along;
11355 unsigned short ashort;
11359 /* Frustrate gcc-2.7.2's optimizer which failed this test with
11360 a direct f = -123. assignment. gcc-2.8.0 reportedly
11361 optimized the whole file away
11363 /* Store the number in a writable string for gcc to pass to
11364 sscanf under HP-UX.
11366 sprintf(str, "-123");
11367 sscanf(str, "%lf", &f); /* f = -123.; */
11369 signal(SIGFPE, blech);
11370 along = (unsigned long)f;
11371 aint = (unsigned int)f;
11372 ashort = (unsigned short)f;
11373 if (along != (unsigned long)-123)
11375 if (aint != (unsigned int)-123)
11377 if (ashort != (unsigned short)-123)
11379 sprintf(str, "1073741824.");
11380 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
11383 along = (unsigned long)f;
11384 if (along != 0x80000000)
11388 along = (unsigned long)f;
11389 if (along != 0x7fffffff)
11393 along = (unsigned long)f;
11394 if (along != 0x80000001)
11398 signal(SIGFPE, blech_in_list);
11399 sprintf(str, "123.");
11400 sscanf(str, "%lf", &f); /* f = 123.; */
11401 along = dummy_long((unsigned long)f);
11402 aint = dummy_int((unsigned int)f);
11403 ashort = dummy_short((unsigned short)f);
11404 if (along != (unsigned long)123)
11406 if (aint != (unsigned int)123)
11408 if (ashort != (unsigned short)123)
11415 if eval $compile_ok; then
11419 echo "(I can't seem to compile the test program--assuming it can't)"
11422 case "$castflags" in
11424 echo "Yup, it can."
11427 echo "Nope, it can't."
11434 : see if vprintf exists
11436 if set vprintf val -f d_vprintf; eval $csym; $val; then
11437 echo 'vprintf() found.' >&4
11440 #$i_stdarg I_STDARG /* Only one of these can be defined by i_varhrd */
11441 #$i_varargs I_VARARGS
11443 #$i_stdlib I_STDLIB
11444 #$i_unistd I_UNISTD
11447 # include <stdarg.h>
11448 #else /* I_VARARGS */
11449 # include <varargs.h>
11453 # include <unistd.h>
11457 # include <stdlib.h>
11460 #include <stdio.h> /* vsprintf prototype */
11463 void xxx(int n, ...)
11468 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11470 int main() { xxx(1, "foo"); }
11472 #else /* I_VARARGS */
11480 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11482 int main() { xxx("foo"); }
11488 if eval $compile_ok; then
11489 if $run ./try; then
11490 echo "Your vsprintf() returns (int)." >&4
11493 echo "Your vsprintf() returns (char*)." >&4
11497 echo 'I am unable to compile the vsprintf() test program.' >&4
11498 # We shouldn't get here. If we do, assume the standard signature,
11499 # not the old BSD one.
11500 echo 'Guessing that vsprintf() returns (int).' >&4
11504 echo 'vprintf() NOT found.' >&4
11515 : see if chown exists
11519 : see if chroot exists
11520 set chroot d_chroot
11523 : see if chsize exists
11524 set chsize d_chsize
11527 : see if class exists
11531 : see if clearenv exists
11532 set clearenv d_clearenv
11535 : Define hasstruct macro for Configure internal use
11536 hasstruct='varname=$1; struct=$2; shift; shift;
11537 while $test $# -ge 2; do
11539 $define) echo "#include <$2>";;
11543 echo "int main () { struct $struct foo; }" >> try.c;
11545 if eval $compile; then
11554 : see whether socket exists
11558 $echo $n "Hmm... $c" >&4
11559 if set socket val -f d_socket; eval $csym; $val; then
11560 echo "Looks like you have Berkeley networking support." >&4
11562 if set setsockopt val -f; eval $csym; $val; then
11565 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
11566 d_oldsock="$define"
11569 if $contains socklib libc.list >/dev/null 2>&1; then
11570 echo "Looks like you have Berkeley networking support." >&4
11572 : we will have to assume that it supports the 4.2 BSD interface
11575 echo "You don't have Berkeley networking in libc$_a..." >&4
11576 if test "X$d_socket" = "X$define"; then
11577 echo "...but you seem to believe that you have sockets." >&4
11579 for net in net socket
11581 if test -f $sysroot/usr/lib/lib$net$_a; then
11582 ( ($nm $nm_opt $sysroot/usr/lib/lib$net$_a | eval $nm_extract) || \
11583 $ar t $sysroot/usr/lib/lib$net$_a) 2>/dev/null >> libc.list
11584 if $contains socket libc.list >/dev/null 2>&1; then
11589 echo "...but the Wollongong group seems to have hacked it in." >&4
11590 sockethdr="-I$sysroot/usr/netinclude"
11593 echo "Found Berkeley sockets interface in lib$net." >&4
11594 if $contains setsockopt libc.list >/dev/null 2>&1; then
11597 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
11598 d_oldsock="$define"
11604 if test "X$d_socket" != "X$define"; then
11605 echo "or anywhere else I see." >&4
11613 : see if socketpair exists
11614 set socketpair d_sockpair
11619 echo "Checking the availability sa_len in the sock struct ..." >&4
11621 #include <sys/types.h>
11622 #include <sys/socket.h>
11624 struct sockaddr sa;
11625 return (sa.sa_len);
11629 set try; if eval $compile; then
11632 set d_sockaddr_sa_len; eval $setvar
11636 echo "Checking the availability struct sockaddr_in6 ..." >&4
11638 #include <sys/types.h>
11639 #include <sys/socket.h>
11640 #include <netinet/in.h>
11642 struct sockaddr_in6 sin6;
11643 return (sin6.sin6_family);
11647 set try; if eval $compile; then
11650 set d_sockaddr_in6; eval $setvar
11654 echo "Checking the availability sin6_scope_id in struct sockaddr_in6 ..." >&4
11656 #include <sys/types.h>
11657 #include <sys/socket.h>
11658 #include <netinet/in.h>
11660 struct sockaddr_in6 sin6;
11661 return (sin6.sin6_scope_id);
11665 set try; if eval $compile; then
11668 set d_sin6_scope_id; eval $setvar
11672 echo "Checking the availability struct ip_mreq ..." >&4
11674 #include <sys/types.h>
11675 #include <sys/socket.h>
11676 #include <netinet/in.h>
11678 struct ip_mreq mreq;
11679 return (mreq.imr_multiaddr.s_addr);
11683 set try; if eval $compile; then
11686 set d_ip_mreq; eval $setvar
11690 echo "Checking the availability struct ip_mreq_source ..." >&4
11692 #include <sys/types.h>
11693 #include <sys/socket.h>
11694 #include <netinet/in.h>
11696 struct ip_mreq_source mreq;
11697 return (mreq.imr_multiaddr.s_addr);
11701 set try; if eval $compile; then
11704 set d_ip_mreq_source; eval $setvar
11708 echo "Checking the availability struct ipv6_mreq ..." >&4
11710 #include <sys/types.h>
11711 #include <sys/socket.h>
11712 #include <netinet/in.h>
11714 struct ipv6_mreq mreq;
11715 return (mreq.ipv6mr_interface);
11719 set try; if eval $compile; then
11722 set d_ipv6_mreq; eval $setvar
11726 echo "Checking the availability struct ipv6_mreq_source ..." >&4
11728 #include <sys/types.h>
11729 #include <sys/socket.h>
11730 #include <netinet/in.h>
11732 struct ipv6_mreq_source mreq;
11733 return (mreq.imr_multiaddr.s_addr);
11737 set try; if eval $compile; then
11740 set d_ipv6_mreq_source; eval $setvar
11744 echo "Checking the availability of certain socket constants..." >&4
11745 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
11746 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
11748 #include <sys/types.h>
11749 #include <sys/socket.h>
11755 set try; if eval $compile; then
11758 set d_${enum}; eval $setvar
11762 : see if this is a sys/uio.h system
11763 set sys/uio.h i_sysuio
11766 : Check for cmsghdr support
11768 echo "Checking to see if your system supports struct cmsghdr..." >&4
11769 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
11771 case "$d_cmsghdr_s" in
11772 "$define") echo "Yes, it does." ;;
11773 *) echo "No, it doesn't." ;;
11777 : check for const keyword
11779 echo 'Checking to see if your C compiler knows about "const"...' >&4
11780 $cat >const.c <<'EOCP'
11781 typedef struct spug { int drokk; } spug;
11785 const spug y = { 0 };
11788 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
11790 echo "Yup, it does."
11793 echo "Nope, it doesn't."
11798 : see if copysignl exists
11799 set copysignl d_copysignl
11802 : see if crypt exists
11807 $define) cryptlib='' ;;
11808 *) if set crypt val -f d_crypt; eval $csym; $val; then
11809 echo 'crypt() found.' >&4
11813 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
11814 if $test -z "$cryptlib"; then
11815 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
11819 if $test -z "$cryptlib"; then
11820 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
11824 if $test -z "$cryptlib"; then
11825 cryptlib=`./loc libcrypt$_a "" $libpth`
11829 if $test -z "$cryptlib"; then
11830 echo 'crypt() NOT found.' >&4
11841 : see if this is a crypt.h system
11842 set crypt.h i_crypt
11845 : see if crypt_r exists
11846 set crypt_r d_crypt_r
11848 case "$d_crypt_r" in
11850 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
11851 case "$d_crypt_r_proto:$usethreads" in
11852 ":define") d_crypt_r_proto=define
11853 set d_crypt_r_proto crypt_r $hdrs
11857 case "$d_crypt_r_proto" in
11859 case "$crypt_r_proto" in
11860 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
11861 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCS ;;
11863 case "$crypt_r_proto" in
11864 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
11865 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCD ;;
11867 case "$crypt_r_proto" in
11868 ''|0) d_crypt_r=undef
11870 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
11871 * ) case "$crypt_r_proto" in
11872 REENTRANT_PROTO*) ;;
11873 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
11875 echo "Prototype: $try" ;;
11878 *) case "$usethreads" in
11879 define) echo "crypt_r has no prototype, not using it." >&4 ;;
11890 : get csh whereabouts
11892 'csh') val="$undef" ;;
11893 *) val="$define" ;;
11897 : Respect a hint or command line value for full_csh.
11898 case "$full_csh" in
11899 '') full_csh=$csh ;;
11902 : see if ctermid exists
11903 set ctermid d_ctermid
11906 : see if ctermid_r exists
11907 set ctermid_r d_ctermid_r
11909 case "$d_ctermid_r" in
11911 hdrs="$i_systypes sys/types.h define stdio.h "
11912 case "$d_ctermid_r_proto:$usethreads" in
11913 ":define") d_ctermid_r_proto=define
11914 set d_ctermid_r_proto ctermid_r $hdrs
11918 case "$d_ctermid_r_proto" in
11920 case "$ctermid_r_proto" in
11921 ''|0) try='char* ctermid_r(char*);'
11922 ./protochk "$extern_C $try" $hdrs && ctermid_r_proto=B_B ;;
11924 case "$ctermid_r_proto" in
11925 ''|0) d_ctermid_r=undef
11927 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
11928 * ) case "$ctermid_r_proto" in
11929 REENTRANT_PROTO*) ;;
11930 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
11932 echo "Prototype: $try" ;;
11935 *) case "$usethreads" in
11936 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
11943 *) ctermid_r_proto=0
11947 : see if ctime_r exists
11948 set ctime_r d_ctime_r
11950 case "$d_ctime_r" in
11952 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
11953 case "$d_ctime_r_proto:$usethreads" in
11954 ":define") d_ctime_r_proto=define
11955 set d_ctime_r_proto ctime_r $hdrs
11959 case "$d_ctime_r_proto" in
11961 case "$ctime_r_proto" in
11962 ''|0) try='char* ctime_r(const time_t*, char*);'
11963 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SB ;;
11965 case "$ctime_r_proto" in
11966 ''|0) try='char* ctime_r(const time_t*, char*, int);'
11967 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SBI ;;
11969 case "$ctime_r_proto" in
11970 ''|0) try='int ctime_r(const time_t*, char*);'
11971 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SB ;;
11973 case "$ctime_r_proto" in
11974 ''|0) try='int ctime_r(const time_t*, char*, int);'
11975 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SBI ;;
11977 case "$ctime_r_proto" in
11978 ''|0) d_ctime_r=undef
11980 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
11981 * ) case "$ctime_r_proto" in
11982 REENTRANT_PROTO*) ;;
11983 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
11985 echo "Prototype: $try" ;;
11988 *) case "$usethreads" in
11989 define) echo "ctime_r has no prototype, not using it." >&4 ;;
12000 : see if cuserid exists
12001 set cuserid d_cuserid
12004 : see if this is a limits.h system
12005 set limits.h i_limits
12008 : see if this is a float.h system
12009 set float.h i_float
12012 : See if number of significant digits in a double precision number is known
12014 $cat >dbl_dig.c <<EOM
12015 #$i_limits I_LIMITS
12018 #include <limits.h>
12024 printf("Contains DBL_DIG");
12027 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
12028 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
12029 echo "DBL_DIG found." >&4
12032 echo "DBL_DIG NOT found." >&4
12039 : see if dbm.h is available
12040 : see if dbmclose exists
12041 set dbmclose d_dbmclose
12044 case "$d_dbmclose" in
12054 *) set rpcsvc/dbm.h i_rpcsvcdbm
12059 *) echo "We won't be including <dbm.h>"
12069 : see if prototype for dbminit is available
12071 set d_dbminitproto dbminit $i_dbm dbm.h
12074 : see if difftime exists
12075 set difftime d_difftime
12078 : see if this is a dirent system
12080 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
12082 echo "<dirent.h> found." >&4
12085 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
12086 echo "<sys/dir.h> found." >&4
12089 xinc=`./findhdr sys/ndir.h`
12091 echo "<dirent.h> NOT found." >&4
12096 : Look for type of directory structure.
12098 $cppstdin $cppflags $cppminus < "$xinc" > try.c
12100 case "$direntrytype" in
12102 case "$i_dirent" in
12103 $define) guess1='struct dirent' ;;
12104 *) guess1='struct direct' ;;
12107 *) guess1="$direntrytype"
12112 'struct dirent') guess2='struct direct' ;;
12113 *) guess2='struct dirent' ;;
12116 if $contains "$guess1" try.c >/dev/null 2>&1; then
12117 direntrytype="$guess1"
12118 echo "Your directory entries are $direntrytype." >&4
12119 elif $contains "$guess2" try.c >/dev/null 2>&1; then
12120 direntrytype="$guess2"
12121 echo "Your directory entries seem to be $direntrytype." >&4
12123 echo "I don't recognize your system's directory entries." >&4
12124 rp="What type is used for directory entries on this system?"
12127 direntrytype="$ans"
12131 : see if the directory entry stores field length
12133 $cppstdin $cppflags $cppminus < "$xinc" > try.c
12134 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
12135 echo "Good, your directory entry keeps length information in d_namlen." >&4
12138 echo "Your directory entry does not know about the d_namlen field." >&4
12145 : Look for DIR.dd_fd
12146 case "$i_dirent" in
12148 echo "Checking to see if DIR has a dd_fd member variable" >&4
12150 #$i_stdlib I_STDLIB
12152 #include <stdlib.h>
12154 #include <dirent.h>
12164 if eval $compile; then
12165 echo "Yes, it does."
12168 echo "No, it does not."
12173 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
12181 : see if this is an sysdir system
12182 set sys/dir.h i_sysdir
12185 : see if this is an sysndir system
12186 set sys/ndir.h i_sysndir
12191 $cat >dirfd.c <<EOM
12193 #$i_stdlib I_STDLIB
12195 #include <stdlib.h>
12197 #$i_dirent I_DIRENT /**/
12198 #$i_sysdir I_SYS_DIR /**/
12199 #$i_sysndir I_SYS_NDIR /**/
12200 #$i_systypes I_SYS_TYPES /**/
12201 #if defined(I_SYS_TYPES)
12202 #include <sys/types.h>
12204 #if defined(I_DIRENT)
12205 #include <dirent.h>
12206 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
12207 #include <sys/dir.h>
12211 #include <sys/ndir.h>
12215 #include <ndir.h> /* may be wrong in the future */
12217 #include <sys/dir.h>
12223 DIR *dirp = opendir(".");
12224 if (dirfd(dirp) >= 0)
12232 if eval $compile; then
12236 $define) echo "dirfd() found." >&4 ;;
12237 *) echo "dirfd() NOT found." >&4 ;;
12243 : see if dladdr exists
12244 set dladdr d_dladdr
12247 : see if dlerror exists
12250 set dlerror d_dlerror
12254 : see if dlfcn is available
12255 set dlfcn.h i_dlfcn
12258 : Check what extension to use for shared libs
12263 On a few systems, the dynamically loaded modules that perl generates and uses
12264 will need a different extension than shared libs. The default will probably
12270 *) dflt="$dlext" ;;
12272 rp='What is the extension of dynamically loaded modules'
12281 : Check if dlsym need a leading underscore
12287 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
12288 $cat >dyna.c <<'EOM'
12295 #$i_stdlib I_STDLIB
12297 #include <stdlib.h>
12301 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
12303 #include <sys/types.h>
12308 extern int fred() ;
12317 int mode = RTLD_LAZY ;
12319 handle = dlopen("./dyna.$dlext", mode) ;
12320 if (handle == NULL) {
12325 symbol = dlsym(handle, "fred") ;
12326 if (symbol == NULL) {
12327 /* try putting a leading underscore */
12328 symbol = dlsym(handle, "_fred") ;
12329 if (symbol == NULL) {
12342 : Call the object file tmp-dyna.o in case dlext=o.
12343 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
12344 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
12345 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
12346 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
12349 1) echo "Test program failed using dlopen." >&4
12350 echo "Perhaps you should not use dynamic loading." >&4;;
12351 2) echo "Test program failed using dlsym." >&4
12352 echo "Perhaps you should not use dynamic loading." >&4;;
12353 3) echo "dlsym needs a leading underscore" >&4
12355 4) echo "dlsym doesn't need a leading underscore." >&4;;
12358 echo "I can't compile and run the test program." >&4
12359 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
12364 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
12369 : see if drand48_r exists
12370 set drand48_r d_drand48_r
12372 case "$d_drand48_r" in
12374 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
12375 case "$d_drand48_r_proto:$usethreads" in
12376 ":define") d_drand48_r_proto=define
12377 set d_drand48_r_proto drand48_r $hdrs
12381 case "$d_drand48_r_proto" in
12383 case "$drand48_r_proto" in
12384 ''|0) try='int drand48_r(struct drand48_data*, double*);'
12385 ./protochk "$extern_C $try" $hdrs && drand48_r_proto=I_ST ;;
12387 case "$drand48_r_proto" in
12388 ''|0) d_drand48_r=undef
12390 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
12391 * ) case "$drand48_r_proto" in
12392 REENTRANT_PROTO*) ;;
12393 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
12395 echo "Prototype: $try" ;;
12398 *) case "$usethreads" in
12399 define) echo "drand48_r has no prototype, not using it." >&4 ;;
12406 *) drand48_r_proto=0
12410 : see if prototype for drand48 is available
12412 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
12415 : see if dup2 exists
12419 : see if eaccess exists
12420 set eaccess d_eaccess
12423 : see if endgrent exists
12424 set endgrent d_endgrent
12427 : see if this is an grp system
12433 xxx=`./findhdr grp.h`
12434 $cppstdin $cppflags $cppminus < $xxx >$$.h
12436 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
12448 set d_grpasswd; eval $setvar
12452 : see if endgrent_r exists
12453 set endgrent_r d_endgrent_r
12455 case "$d_endgrent_r" in
12457 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12458 case "$d_endgrent_r_proto:$usethreads" in
12459 ":define") d_endgrent_r_proto=define
12460 set d_endgrent_r_proto endgrent_r $hdrs
12464 case "$d_endgrent_r_proto" in
12466 case "$endgrent_r_proto" in
12467 ''|0) try='int endgrent_r(FILE**);'
12468 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=I_H ;;
12470 case "$endgrent_r_proto" in
12471 ''|0) try='void endgrent_r(FILE**);'
12472 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=V_H ;;
12474 case "$endgrent_r_proto" in
12475 ''|0) d_endgrent_r=undef
12477 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
12478 * ) case "$endgrent_r_proto" in
12479 REENTRANT_PROTO*) ;;
12480 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
12482 echo "Prototype: $try" ;;
12485 *) case "$usethreads" in
12486 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
12493 *) endgrent_r_proto=0
12497 : see if endhostent exists
12498 set endhostent d_endhent
12501 : see if this is a netdb.h system
12502 set netdb.h i_netdb
12505 : see if endhostent_r exists
12506 set endhostent_r d_endhostent_r
12508 case "$d_endhostent_r" in
12510 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12511 case "$d_endhostent_r_proto:$usethreads" in
12512 ":define") d_endhostent_r_proto=define
12513 set d_endhostent_r_proto endhostent_r $hdrs
12517 case "$d_endhostent_r_proto" in
12519 case "$endhostent_r_proto" in
12520 ''|0) try='int endhostent_r(struct hostent_data*);'
12521 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=I_D ;;
12523 case "$endhostent_r_proto" in
12524 ''|0) try='void endhostent_r(struct hostent_data*);'
12525 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=V_D ;;
12527 case "$endhostent_r_proto" in
12528 ''|0) d_endhostent_r=undef
12529 endhostent_r_proto=0
12530 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
12531 * ) case "$endhostent_r_proto" in
12532 REENTRANT_PROTO*) ;;
12533 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
12535 echo "Prototype: $try" ;;
12538 *) case "$usethreads" in
12539 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
12541 d_endhostent_r=undef
12542 endhostent_r_proto=0
12546 *) endhostent_r_proto=0
12550 : see if endnetent exists
12551 set endnetent d_endnent
12554 : see if endnetent_r exists
12555 set endnetent_r d_endnetent_r
12557 case "$d_endnetent_r" in
12559 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12560 case "$d_endnetent_r_proto:$usethreads" in
12561 ":define") d_endnetent_r_proto=define
12562 set d_endnetent_r_proto endnetent_r $hdrs
12566 case "$d_endnetent_r_proto" in
12568 case "$endnetent_r_proto" in
12569 ''|0) try='int endnetent_r(struct netent_data*);'
12570 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=I_D ;;
12572 case "$endnetent_r_proto" in
12573 ''|0) try='void endnetent_r(struct netent_data*);'
12574 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=V_D ;;
12576 case "$endnetent_r_proto" in
12577 ''|0) d_endnetent_r=undef
12578 endnetent_r_proto=0
12579 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
12580 * ) case "$endnetent_r_proto" in
12581 REENTRANT_PROTO*) ;;
12582 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
12584 echo "Prototype: $try" ;;
12587 *) case "$usethreads" in
12588 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
12590 d_endnetent_r=undef
12591 endnetent_r_proto=0
12595 *) endnetent_r_proto=0
12599 : see if endprotoent exists
12600 set endprotoent d_endpent
12603 : see if endprotoent_r exists
12604 set endprotoent_r d_endprotoent_r
12606 case "$d_endprotoent_r" in
12608 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12609 case "$d_endprotoent_r_proto:$usethreads" in
12610 ":define") d_endprotoent_r_proto=define
12611 set d_endprotoent_r_proto endprotoent_r $hdrs
12615 case "$d_endprotoent_r_proto" in
12617 case "$endprotoent_r_proto" in
12618 ''|0) try='int endprotoent_r(struct protoent_data*);'
12619 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=I_D ;;
12621 case "$endprotoent_r_proto" in
12622 ''|0) try='void endprotoent_r(struct protoent_data*);'
12623 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=V_D ;;
12625 case "$endprotoent_r_proto" in
12626 ''|0) d_endprotoent_r=undef
12627 endprotoent_r_proto=0
12628 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
12629 * ) case "$endprotoent_r_proto" in
12630 REENTRANT_PROTO*) ;;
12631 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
12633 echo "Prototype: $try" ;;
12636 *) case "$usethreads" in
12637 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
12639 d_endprotoent_r=undef
12640 endprotoent_r_proto=0
12644 *) endprotoent_r_proto=0
12648 : see if endpwent exists
12649 set endpwent d_endpwent
12652 : see if this is a pwd.h system
12658 xxx=`./findhdr pwd.h`
12659 $cppstdin $cppflags $cppminus < $xxx >$$.h
12661 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
12669 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
12677 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
12685 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
12693 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
12701 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
12709 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
12717 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
12729 set d_pwquota; eval $setvar
12730 set d_pwage; eval $setvar
12731 set d_pwchange; eval $setvar
12732 set d_pwclass; eval $setvar
12733 set d_pwexpire; eval $setvar
12734 set d_pwcomment; eval $setvar
12735 set d_pwgecos; eval $setvar
12736 set d_pwpasswd; eval $setvar
12740 : see if endpwent_r exists
12741 set endpwent_r d_endpwent_r
12743 case "$d_endpwent_r" in
12745 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
12746 case "$d_endpwent_r_proto:$usethreads" in
12747 ":define") d_endpwent_r_proto=define
12748 set d_endpwent_r_proto endpwent_r $hdrs
12752 case "$d_endpwent_r_proto" in
12754 case "$endpwent_r_proto" in
12755 ''|0) try='int endpwent_r(FILE**);'
12756 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=I_H ;;
12758 case "$endpwent_r_proto" in
12759 ''|0) try='void endpwent_r(FILE**);'
12760 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=V_H ;;
12762 case "$endpwent_r_proto" in
12763 ''|0) d_endpwent_r=undef
12765 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
12766 * ) case "$endpwent_r_proto" in
12767 REENTRANT_PROTO*) ;;
12768 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
12770 echo "Prototype: $try" ;;
12773 *) case "$usethreads" in
12774 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
12781 *) endpwent_r_proto=0
12785 : see if endservent exists
12786 set endservent d_endsent
12789 : see if endservent_r exists
12790 set endservent_r d_endservent_r
12792 case "$d_endservent_r" in
12794 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12795 case "$d_endservent_r_proto:$usethreads" in
12796 ":define") d_endservent_r_proto=define
12797 set d_endservent_r_proto endservent_r $hdrs
12801 case "$d_endservent_r_proto" in
12803 case "$endservent_r_proto" in
12804 ''|0) try='int endservent_r(struct servent_data*);'
12805 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=I_D ;;
12807 case "$endservent_r_proto" in
12808 ''|0) try='void endservent_r(struct servent_data*);'
12809 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=V_D ;;
12811 case "$endservent_r_proto" in
12812 ''|0) d_endservent_r=undef
12813 endservent_r_proto=0
12814 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
12815 * ) case "$endservent_r_proto" in
12816 REENTRANT_PROTO*) ;;
12817 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
12819 echo "Prototype: $try" ;;
12822 *) case "$usethreads" in
12823 define) echo "endservent_r has no prototype, not using it." >&4 ;;
12825 d_endservent_r=undef
12826 endservent_r_proto=0
12830 *) endservent_r_proto=0
12834 : Locate the flags for 'open()'
12837 #include <sys/types.h>
12842 #include <sys/file.h>
12844 #$i_stdlib I_STDLIB
12846 #include <stdlib.h>
12857 : check sys/file.h first to get FREAD on Sun
12858 if $test `./findhdr sys/file.h` && \
12859 set try -DI_SYS_FILE && eval $compile; then
12861 echo "<sys/file.h> defines the O_* constants..." >&4
12862 if $run ./try; then
12863 echo "and you have the 3 argument form of open()." >&4
12866 echo "but not the 3 argument form of open(). Oh, well." >&4
12869 elif $test `./findhdr fcntl.h` && \
12870 set try -DI_FCNTL && eval $compile; then
12872 echo "<fcntl.h> defines the O_* constants..." >&4
12873 if $run ./try; then
12874 echo "and you have the 3 argument form of open()." >&4
12877 echo "but not the 3 argument form of open(). Oh, well." >&4
12882 echo "I can't find the O_* constant definitions! You got problems." >&4
12888 : see if this is a sys/file.h system
12893 : do we need to include sys/file.h ?
12897 if $h_sysfile; then
12899 echo "We'll be including <sys/file.h>." >&4
12902 echo "We won't be including <sys/file.h>." >&4
12912 : see if fcntl.h is there
12917 : see if we can include fcntl.h
12923 echo "We'll be including <fcntl.h>." >&4
12926 if $h_sysfile; then
12927 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
12929 echo "We won't be including <fcntl.h>." >&4
12941 : see if fork exists
12945 : see if pipe exists
12949 : check for non-blocking I/O stuff
12950 case "$h_sysfile" in
12951 true) echo "#include <sys/file.h>" > head.c;;
12954 true) echo "#include <fcntl.h>" > head.c;;
12955 *) echo "#include <sys/fcntl.h>" > head.c;;
12960 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
12961 case "$o_nonblock" in
12963 $cat head.c > try.c
12964 $cat >>try.c <<EOCP
12966 #$i_stdlib I_STDLIB
12968 #include <stdlib.h>
12976 printf("O_NONBLOCK\n");
12980 printf("O_NDELAY\n");
12984 printf("FNDELAY\n");
12991 if eval $compile_ok; then
12992 o_nonblock=`$run ./try`
12993 case "$o_nonblock" in
12994 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
12995 *) echo "Seems like we can use $o_nonblock.";;
12998 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
13001 *) echo "Using $hint value $o_nonblock.";;
13006 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
13009 case "$d_fork:$d_pipe" in
13011 $cat head.c > try.c
13012 $cat >>try.c <<EOCP
13014 #include <sys/types.h>
13015 #include <signal.h>
13017 #$i_stdlib I_STDLIB
13019 #include <stdlib.h>
13025 #define MY_O_NONBLOCK $o_nonblock
13026 #ifndef errno /* XXX need better Configure test */
13029 #$i_unistd I_UNISTD
13031 #include <unistd.h>
13033 #$i_string I_STRING
13035 #include <string.h>
13037 #include <strings.h>
13039 $signal_t blech(int x) { exit(3); }
13041 $cat >> try.c <<'EOCP'
13049 pipe(pd); /* Down: child -> parent */
13050 pipe(pu); /* Up: parent -> child */
13053 close(pd[1]); /* Parent reads from pd[0] */
13054 close(pu[0]); /* Parent writes (blocking) to pu[1] */
13056 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
13061 signal(SIGALRM, blech);
13063 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
13065 sprintf(string, "%d\n", ret);
13066 write(2, string, strlen(string));
13069 if (errno == EAGAIN) {
13070 printf("EAGAIN\n");
13075 if (errno == EWOULDBLOCK)
13076 printf("EWOULDBLOCK\n");
13079 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
13080 sleep(2); /* Give it time to close our pipe */
13082 ret = read(pd[0], buf, 1); /* Should read EOF */
13084 sprintf(string, "%d\n", ret);
13085 write(4, string, strlen(string));
13089 close(pd[0]); /* We write to pd[1] */
13090 close(pu[1]); /* We read from pu[0] */
13091 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
13092 close(pd[1]); /* Pipe pd is now fully closed! */
13093 exit(0); /* Bye bye, thank you for playing! */
13097 if eval $compile_ok; then
13098 echo "$startsh" >mtry
13099 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
13101 $run ./mtry >/dev/null 2>&1
13103 0) eagain=`$cat try.out`;;
13104 1) echo "Could not perform non-blocking setting!";;
13105 2) echo "I did a successful read() for something that was not there!";;
13106 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
13107 4) echo "Could not find F_SETFL!";;
13108 *) echo "Something terribly wrong happened during testing.";;
13110 rd_nodata=`$cat try.ret`
13111 echo "A read() system call with no data present returns $rd_nodata."
13112 case "$rd_nodata" in
13115 echo "(That's peculiar, fixing that to be -1.)"
13121 echo "Forcing errno EAGAIN on read() with no data available."
13125 echo "Your read() sets errno to $eagain when no data is available."
13128 status=`$cat try.err`
13130 0) echo "And it correctly returns 0 to signal EOF.";;
13131 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
13132 *) echo "However, your read() returns '$status' on EOF??";;
13135 if test "$status" = "$rd_nodata"; then
13136 echo "WARNING: you can't distinguish between EOF and no data!"
13140 echo "I can't compile the test program--assuming errno EAGAIN will do."
13144 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
13153 echo "Using $hint value $eagain."
13154 echo "Your read() returns $rd_nodata when no data is present."
13155 case "$d_eofnblk" in
13156 "$define") echo "And you can see EOF because read() returns 0.";;
13157 "$undef") echo "But you can't see EOF status from read() returned value.";;
13159 echo "(Assuming you can't see EOF status from read anyway.)"
13165 $rm_try head.c mtry
13167 : see if _ptr and _cnt from stdio act std
13170 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
13171 echo "(Looks like you have stdio.h from BSD.)"
13172 case "$stdio_ptr" in
13173 '') stdio_ptr='((fp)->_p)'
13176 *) ptr_lval=$d_stdio_ptr_lval;;
13178 case "$stdio_cnt" in
13179 '') stdio_cnt='((fp)->_r)'
13182 *) cnt_lval=$d_stdio_cnt_lval;;
13184 case "$stdio_base" in
13185 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
13187 case "$stdio_bufsiz" in
13188 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
13190 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
13191 echo "(Looks like you have stdio.h from Linux.)"
13192 case "$stdio_ptr" in
13193 '') stdio_ptr='((fp)->_IO_read_ptr)'
13196 *) ptr_lval=$d_stdio_ptr_lval;;
13198 case "$stdio_cnt" in
13199 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
13202 *) cnt_lval=$d_stdio_cnt_lval;;
13204 case "$stdio_base" in
13205 '') stdio_base='((fp)->_IO_read_base)';;
13207 case "$stdio_bufsiz" in
13208 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
13211 case "$stdio_ptr" in
13212 '') stdio_ptr='((fp)->_ptr)'
13215 *) ptr_lval=$d_stdio_ptr_lval;;
13217 case "$stdio_cnt" in
13218 '') stdio_cnt='((fp)->_cnt)'
13221 *) cnt_lval=$d_stdio_cnt_lval;;
13223 case "$stdio_base" in
13224 '') stdio_base='((fp)->_base)';;
13226 case "$stdio_bufsiz" in
13227 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
13231 : test whether _ptr and _cnt really work
13232 echo "Checking how std your stdio is..." >&4
13235 #$i_stdlib I_STDLIB
13237 #include <stdlib.h>
13239 #define FILE_ptr(fp) $stdio_ptr
13240 #define FILE_cnt(fp) $stdio_cnt
13242 FILE *fp = fopen("try.c", "r");
13245 18 <= FILE_cnt(fp) &&
13246 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13254 if eval $compile && $to try.c; then
13255 if $run ./try; then
13256 echo "Your stdio acts pretty std."
13259 echo "Your stdio isn't very std."
13262 echo "Your stdio doesn't appear very std."
13266 # glibc 2.2.90 and above apparently change stdio streams so Perl's
13267 # direct buffer manipulation no longer works. The Configure tests
13268 # should be changed to correctly detect this, but until then,
13269 # the following check should at least let perl compile and run.
13270 # (This quick fix should be updated before 5.8.1.)
13271 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
13272 # A. Dougherty, June 3, 2002.
13273 case "$d_gnulibc" in
13275 case "$gnulibc_version" in
13279 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
13288 : Can _ptr be used as an lvalue?
13289 case "$d_stdstdio$ptr_lval" in
13290 $define$define) val=$define ;;
13293 set d_stdio_ptr_lval
13296 : Can _cnt be used as an lvalue?
13297 case "$d_stdstdio$cnt_lval" in
13298 $define$define) val=$define ;;
13301 set d_stdio_cnt_lval
13305 : test whether setting _ptr sets _cnt as a side effect
13306 d_stdio_ptr_lval_sets_cnt="$undef"
13307 d_stdio_ptr_lval_nochange_cnt="$undef"
13308 case "$d_stdio_ptr_lval$d_stdstdio" in
13310 echo "Checking to see what happens if we set the stdio ptr..." >&4
13313 /* Can we scream? */
13314 /* Eat dust sed :-) */
13315 /* In the buffer space, no one can hear you scream. */
13316 #$i_stdlib I_STDLIB
13318 #include <stdlib.h>
13320 #define FILE_ptr(fp) $stdio_ptr
13321 #define FILE_cnt(fp) $stdio_cnt
13322 #include <sys/types.h>
13324 FILE *fp = fopen("try.c", "r");
13329 puts("Fail even to read");
13332 c = getc(fp); /* Read away the first # */
13334 puts("Fail even to read");
13338 18 <= FILE_cnt(fp) &&
13339 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13341 puts("Fail even to read");
13344 ptr = (char*) FILE_ptr(fp);
13345 cnt = (size_t)FILE_cnt(fp);
13347 FILE_ptr(fp) += 42;
13349 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
13350 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
13353 if (FILE_cnt(fp) <= 20) {
13354 printf ("Fail (<20 chars to test)");
13357 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
13358 puts("Fail compare");
13361 if (cnt == FILE_cnt(fp)) {
13362 puts("Pass_unchanged");
13365 if (FILE_cnt(fp) == (cnt - 42)) {
13366 puts("Pass_changed");
13369 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
13375 if eval $compile && $to try.c; then
13376 case `$run ./try` in
13378 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
13379 d_stdio_ptr_lval_sets_cnt="$define" ;;
13381 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
13382 d_stdio_ptr_lval_nochange_cnt="$define" ;;
13384 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
13386 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
13389 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
13395 : see if _base is also standard
13397 case "$d_stdstdio" in
13401 #$i_stdlib I_STDLIB
13403 #include <stdlib.h>
13405 #define FILE_base(fp) $stdio_base
13406 #define FILE_bufsiz(fp) $stdio_bufsiz
13408 FILE *fp = fopen("try.c", "r");
13411 19 <= FILE_bufsiz(fp) &&
13412 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
13419 if eval $compile && $to try.c; then
13420 if $run ./try; then
13421 echo "And its _base field acts std."
13424 echo "But its _base field isn't std."
13427 echo "However, it seems to be lacking the _base field."
13435 : see if fast_stdio exists
13437 case "$d_stdstdio:$d_stdio_ptr_lval" in
13439 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
13441 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
13452 : see if fchdir exists
13453 set fchdir d_fchdir
13456 : see if fchmod exists
13457 set fchmod d_fchmod
13460 : see if fchown exists
13461 set fchown d_fchown
13464 : see if this is an fcntl system
13468 : See if fcntl-based locking works.
13471 #$i_stdlib I_STDLIB
13473 #include <stdlib.h>
13475 #include <unistd.h>
13477 #include <signal.h>
13478 $signal_t blech(int x) { exit(3); }
13480 #if defined(F_SETLK) && defined(F_SETLKW)
13481 struct flock flock;
13483 fd = open("try.c", O_RDONLY);
13484 flock.l_type = F_RDLCK;
13485 flock.l_whence = SEEK_SET;
13486 flock.l_start = flock.l_len = 0;
13487 signal(SIGALRM, blech);
13489 retval = fcntl(fd, F_SETLK, &flock);
13491 (retval < 0 ? exit(2) : exit(0));
13497 echo "Checking if fcntl-based file locking works... "
13501 if eval $compile_ok; then
13502 if $run ./try; then
13503 echo "Yes, it seems to work."
13506 echo "Nope, it didn't work."
13511 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
13512 *** This is (almost) impossible.
13513 *** If your NFS lock daemons are not feeling well, something like
13514 *** this may happen, please investigate. Cannot continue, aborting.
13522 echo "I'm unable to compile the test program, so I'll assume not."
13527 echo "Nope, since you don't even have fcntl()."
13530 set d_fcntl_can_lock
13534 : check for fd_set items
13537 Checking to see how well your C compiler handles fd_set and friends ...
13540 #$i_stdlib I_STDLIB
13542 #include <stdlib.h>
13544 #$i_systime I_SYS_TIME
13545 #$i_sysselct I_SYS_SELECT
13546 #$d_socket HAS_SOCKET
13547 #include <sys/types.h>
13549 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
13552 #include <sys/time.h>
13554 #ifdef I_SYS_SELECT
13555 #include <sys/select.h>
13564 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
13572 if eval $compile; then
13573 d_fds_bits="$define"
13575 echo "Well, your system knows about the normal fd_set typedef..." >&4
13576 if $run ./try; then
13577 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
13578 d_fd_macros="$define"
13581 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
13583 d_fd_macros="$undef"
13587 Hmm, your compiler has some difficulty with fd_set. Checking further...
13590 if eval $compile; then
13591 d_fds_bits="$undef"
13593 echo "Well, your system has some sort of fd_set available..." >&4
13594 if $run ./try; then
13595 echo "and you have the normal fd_set macros." >&4
13596 d_fd_macros="$define"
13599 but not the normal fd_set macros! Gross! More work for me...
13601 d_fd_macros="$undef"
13604 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
13606 d_fds_bits="$undef"
13607 d_fd_macros="$undef"
13612 : see if fgetpos exists
13613 set fgetpos d_fgetpos
13616 : see if finite exists
13617 set finite d_finite
13620 : see if finitel exists
13621 set finitel d_finitel
13624 : see if flock exists
13628 : see if prototype for flock is available
13630 set d_flockproto flock $i_sysfile sys/file.h
13633 : see if fp_class exists
13634 set fp_class d_fp_class
13637 : see if pathconf exists
13638 set pathconf d_pathconf
13641 : see if fpathconf exists
13642 set fpathconf d_fpathconf
13645 : see if fpclass exists
13646 set fpclass d_fpclass
13649 : see if fpclassify exists
13650 set fpclassify d_fpclassify
13653 : see if fpclassl exists
13654 set fpclassl d_fpclassl
13657 : check for fpos64_t
13659 echo "Checking to see if you have fpos64_t..." >&4
13662 int main() { fpos64_t x = 7; }
13665 if eval $compile; then
13667 echo "You have fpos64_t."
13670 echo "You do not have fpos64_t."
13671 case "$fpossize" in
13672 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
13679 : see if frexpl exists
13680 set frexpl d_frexpl
13683 : see if this is a sys/param system
13684 set sys/param.h i_sysparam
13687 : see if this is a sys/mount.h system
13688 set sys/mount.h i_sysmount
13691 : Check for fs_data_s
13693 echo "Checking to see if your system supports struct fs_data..." >&4
13694 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
13696 case "$d_fs_data_s" in
13697 "$define") echo "Yes, it does." ;;
13698 *) echo "No, it doesn't." ;;
13701 : see if fseeko exists
13702 set fseeko d_fseeko
13704 case "$longsize" in
13705 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
13708 : see if fsetpos exists
13709 set fsetpos d_fsetpos
13712 : see if fstatfs exists
13713 set fstatfs d_fstatfs
13716 : see if statvfs exists
13717 set statvfs d_statvfs
13720 : see if fstatvfs exists
13721 set fstatvfs d_fstatvfs
13725 : see if fsync exists
13729 : see if ftello exists
13730 set ftello d_ftello
13732 case "$longsize" in
13733 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
13736 : check for a working futimes
13739 echo "Checking if you have a working futimes()" >&4
13742 #include <sys/time.h>
13749 fd = open ("try.c", O_RDWR);
13750 if (-1 == fd) exit (1);
13751 rv = futimes (fd, NULL);
13752 exit (rv == -1 ? errno : 0);
13756 if eval $compile; then
13760 0) echo "Yes, you have" >&4
13761 d_futimes="$define"
13763 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
13767 echo "No, it does not (probably harmless)" >&4
13771 : see if ndbm.h is available
13774 : Compatibility location for RedHat 7.1
13775 set gdbm/ndbm.h i_gdbmndbm
13777 : Compatibility location for Debian 4.0
13778 set gdbm-ndbm.h i_gdbm_ndbm
13782 if $test "$i_ndbm" = "$define" -o "$i_gdbmndbm" = "$define" -o "$i_gdbm_ndbm" = "$define"; then
13783 : see if dbm_open exists
13784 set dbm_open d_dbm_open
13786 case "$d_dbm_open" in
13789 i_gdbmndbm="$undef"
13790 i_gdbm_ndbm="$undef"
13791 echo "We won't be including <ndbm.h>"
13801 ndbm_hdr_protochk='name=$1; hdr=$2;
13802 eval "ihdr=\$""i_$name";
13804 if $test "$ihdr" = "$define"; then
13805 $echo "Checking if your <$hdr> uses prototypes..." >&4;
13806 case "$d_cplusplus" in
13807 $define) ./protochk "$extern_C void dbm_close(DBM *);" literal "extern \"C\" {" $ihdr $hdr literal "}" && val="$define" ;;
13808 *) ./protochk "$extern_C void dbm_close(int, int);" $ihdr $hdr || val="$define" ;;
13811 $define) $echo "Your <$hdr> seems to have prototypes";;
13812 *) $echo "Your <$hdr> does not seem to have prototypes";;
13815 set "d_${name}_h_uses_prototypes";
13819 eval $ndbm_hdr_protochk
13820 set gdbmndbm gdbm/ndbm.h
13821 eval $ndbm_hdr_protochk
13822 set gdbm_ndbm gdbm-ndbm.h
13823 eval $ndbm_hdr_protochk
13825 : see if getaddrinfo exists
13826 set getaddrinfo d_getaddrinfo
13829 : see if getcwd exists
13830 set getcwd d_getcwd
13833 : see if getespwnam exists
13834 set getespwnam d_getespwnam
13837 : see if getfsstat exists
13838 set getfsstat d_getfsstat
13841 : see if getgrent exists
13842 set getgrent d_getgrent
13845 : see if getgrent_r exists
13846 set getgrent_r d_getgrent_r
13848 case "$d_getgrent_r" in
13850 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13851 case "$d_getgrent_r_proto:$usethreads" in
13852 ":define") d_getgrent_r_proto=define
13853 set d_getgrent_r_proto getgrent_r $hdrs
13857 case "$d_getgrent_r_proto" in
13859 case "$getgrent_r_proto" in
13860 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
13861 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBWR ;;
13863 case "$getgrent_r_proto" in
13864 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
13865 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIR ;;
13867 case "$getgrent_r_proto" in
13868 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
13869 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBW ;;
13871 case "$getgrent_r_proto" in
13872 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
13873 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBI ;;
13875 case "$getgrent_r_proto" in
13876 ''|0) try='int getgrent_r(struct group*, char*, int);'
13877 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBI ;;
13879 case "$getgrent_r_proto" in
13880 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
13881 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIH ;;
13883 case "$getgrent_r_proto" in
13884 ''|0) d_getgrent_r=undef
13886 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
13887 * ) case "$getgrent_r_proto" in
13888 REENTRANT_PROTO*) ;;
13889 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
13891 echo "Prototype: $try" ;;
13894 *) case "$usethreads" in
13895 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
13902 *) getgrent_r_proto=0
13906 : see if getgrgid_r exists
13907 set getgrgid_r d_getgrgid_r
13909 case "$d_getgrgid_r" in
13911 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13912 case "$d_getgrgid_r_proto:$usethreads" in
13913 ":define") d_getgrgid_r_proto=define
13914 set d_getgrgid_r_proto getgrgid_r $hdrs
13918 case "$d_getgrgid_r_proto" in
13920 case "$getgrgid_r_proto" in
13921 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
13922 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
13924 case "$getgrgid_r_proto" in
13925 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
13926 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
13928 case "$getgrgid_r_proto" in
13929 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
13930 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
13932 case "$getgrgid_r_proto" in
13933 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
13934 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
13936 case "$getgrgid_r_proto" in
13937 ''|0) d_getgrgid_r=undef
13939 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
13940 * ) case "$getgrgid_r_proto" in
13941 REENTRANT_PROTO*) ;;
13942 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
13944 echo "Prototype: $try" ;;
13947 *) case "$usethreads" in
13948 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
13955 *) getgrgid_r_proto=0
13959 : see if getgrnam_r exists
13960 set getgrnam_r d_getgrnam_r
13962 case "$d_getgrnam_r" in
13964 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13965 case "$d_getgrnam_r_proto:$usethreads" in
13966 ":define") d_getgrnam_r_proto=define
13967 set d_getgrnam_r_proto getgrnam_r $hdrs
13971 case "$d_getgrnam_r_proto" in
13973 case "$getgrnam_r_proto" in
13974 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
13975 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
13977 case "$getgrnam_r_proto" in
13978 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
13979 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
13981 case "$getgrnam_r_proto" in
13982 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
13983 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CBI ;;
13985 case "$getgrnam_r_proto" in
13986 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
13987 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
13989 case "$getgrnam_r_proto" in
13990 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
13991 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
13993 case "$getgrnam_r_proto" in
13994 ''|0) d_getgrnam_r=undef
13996 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
13997 * ) case "$getgrnam_r_proto" in
13998 REENTRANT_PROTO*) ;;
13999 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
14001 echo "Prototype: $try" ;;
14004 *) case "$usethreads" in
14005 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
14012 *) getgrnam_r_proto=0
14016 : see if gethostbyaddr exists
14017 set gethostbyaddr d_gethbyaddr
14020 : see if gethostbyname exists
14021 set gethostbyname d_gethbyname
14024 : see if gethostent exists
14025 set gethostent d_gethent
14028 : see how we will look up host name
14031 if set gethostname val -f d_gethname; eval $csym; $val; then
14032 echo 'gethostname() found.' >&4
14033 d_gethname="$define"
14036 if set uname val -f d_uname; eval $csym; $val; then
14039 uname() was found, but you're running xenix, and older versions of xenix
14040 have a broken uname(). If you don't really know whether your xenix is old
14041 enough to have a broken system call, use the default answer.
14046 "$define") dflt=n;;
14048 rp='Is your uname() broken?'
14051 n*) d_uname="$define"; call=uname;;
14054 echo 'uname() found.' >&4
14061 case "$d_gethname" in
14062 '') d_gethname="$undef";;
14065 '') d_uname="$undef";;
14067 case "$d_uname$d_gethname" in
14072 Every now and then someone has a $call() that lies about the hostname
14073 but can't be fixed for political or economic reasons. If you wish, I can
14074 pretend $call() isn't there and maybe compute hostname at run-time
14075 thanks to the '$phostname' command.
14078 rp="Shall I ignore $call() from now on?"
14081 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
14084 case "$phostname" in
14085 '') aphostname='';;
14086 *) case "$aphostname" in
14088 *) set X $phostname
14092 file=`./loc $file $file $pth`
14093 aphostname=`echo $file $*`
14098 case "$d_uname$d_gethname" in
14101 case "$phostname" in
14103 echo "There will be no way for $package to get your hostname." >&4;;
14105 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
14109 case "$d_phostname" in
14110 '') d_phostname="$undef";;
14113 : see if gethostbyaddr_r exists
14114 set gethostbyaddr_r d_gethostbyaddr_r
14116 case "$d_gethostbyaddr_r" in
14118 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14119 case "$d_gethostbyaddr_r_proto:$usethreads" in
14120 ":define") d_gethostbyaddr_r_proto=define
14121 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
14125 case "$d_gethostbyaddr_r_proto" in
14127 case "$gethostbyaddr_r_proto" in
14128 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
14129 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
14131 case "$gethostbyaddr_r_proto" in
14132 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
14133 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
14135 case "$gethostbyaddr_r_proto" in
14136 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
14137 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
14139 case "$gethostbyaddr_r_proto" in
14140 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
14141 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
14143 case "$gethostbyaddr_r_proto" in
14144 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
14145 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
14147 case "$gethostbyaddr_r_proto" in
14148 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
14149 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
14151 case "$gethostbyaddr_r_proto" in
14152 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
14153 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
14155 case "$gethostbyaddr_r_proto" in
14156 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
14157 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
14159 case "$gethostbyaddr_r_proto" in
14160 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
14161 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
14163 case "$gethostbyaddr_r_proto" in
14164 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
14165 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
14167 case "$gethostbyaddr_r_proto" in
14168 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
14169 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
14171 case "$gethostbyaddr_r_proto" in
14172 ''|0) d_gethostbyaddr_r=undef
14173 gethostbyaddr_r_proto=0
14174 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
14175 * ) case "$gethostbyaddr_r_proto" in
14176 REENTRANT_PROTO*) ;;
14177 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
14179 echo "Prototype: $try" ;;
14182 *) case "$usethreads" in
14183 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
14185 d_gethostbyaddr_r=undef
14186 gethostbyaddr_r_proto=0
14190 *) gethostbyaddr_r_proto=0
14194 : see if gethostbyname_r exists
14195 set gethostbyname_r d_gethostbyname_r
14197 case "$d_gethostbyname_r" in
14199 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14200 case "$d_gethostbyname_r_proto:$usethreads" in
14201 ":define") d_gethostbyname_r_proto=define
14202 set d_gethostbyname_r_proto gethostbyname_r $hdrs
14206 case "$d_gethostbyname_r_proto" in
14208 case "$gethostbyname_r_proto" in
14209 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
14210 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
14212 case "$gethostbyname_r_proto" in
14213 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
14214 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
14216 case "$gethostbyname_r_proto" in
14217 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
14218 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
14220 case "$gethostbyname_r_proto" in
14221 ''|0) d_gethostbyname_r=undef
14222 gethostbyname_r_proto=0
14223 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
14224 * ) case "$gethostbyname_r_proto" in
14225 REENTRANT_PROTO*) ;;
14226 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
14228 echo "Prototype: $try" ;;
14231 *) case "$usethreads" in
14232 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
14234 d_gethostbyname_r=undef
14235 gethostbyname_r_proto=0
14239 *) gethostbyname_r_proto=0
14243 : see if gethostent_r exists
14244 set gethostent_r d_gethostent_r
14246 case "$d_gethostent_r" in
14248 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14249 case "$d_gethostent_r_proto:$usethreads" in
14250 ":define") d_gethostent_r_proto=define
14251 set d_gethostent_r_proto gethostent_r $hdrs
14255 case "$d_gethostent_r_proto" in
14257 case "$gethostent_r_proto" in
14258 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
14259 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
14261 case "$gethostent_r_proto" in
14262 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
14263 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBIE ;;
14265 case "$gethostent_r_proto" in
14266 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
14267 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBIE ;;
14269 case "$gethostent_r_proto" in
14270 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
14271 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBI ;;
14273 case "$gethostent_r_proto" in
14274 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
14275 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBI ;;
14277 case "$gethostent_r_proto" in
14278 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
14279 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SD ;;
14281 case "$gethostent_r_proto" in
14282 ''|0) d_gethostent_r=undef
14283 gethostent_r_proto=0
14284 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
14285 * ) case "$gethostent_r_proto" in
14286 REENTRANT_PROTO*) ;;
14287 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
14289 echo "Prototype: $try" ;;
14292 *) case "$usethreads" in
14293 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
14295 d_gethostent_r=undef
14296 gethostent_r_proto=0
14300 *) gethostent_r_proto=0
14304 : see if prototypes for various gethostxxx netdb.h functions are available
14306 set d_gethostprotos gethostent $i_netdb netdb.h
14309 : see if getitimer exists
14310 set getitimer d_getitimer
14313 : see if getlogin exists
14314 set getlogin d_getlogin
14317 : see if getlogin_r exists
14318 set getlogin_r d_getlogin_r
14320 case "$d_getlogin_r" in
14322 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
14323 case "$d_getlogin_r_proto:$usethreads" in
14324 ":define") d_getlogin_r_proto=define
14325 set d_getlogin_r_proto getlogin_r $hdrs
14329 case "$d_getlogin_r_proto" in
14331 case "$getlogin_r_proto" in
14332 ''|0) try='int getlogin_r(char*, size_t);'
14333 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BW ;;
14335 case "$getlogin_r_proto" in
14336 ''|0) try='int getlogin_r(char*, int);'
14337 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BI ;;
14339 case "$getlogin_r_proto" in
14340 ''|0) try='char* getlogin_r(char*, size_t);'
14341 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BW ;;
14343 case "$getlogin_r_proto" in
14344 ''|0) try='char* getlogin_r(char*, int);'
14345 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BI ;;
14347 case "$getlogin_r_proto" in
14348 ''|0) d_getlogin_r=undef
14350 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
14351 * ) case "$getlogin_r_proto" in
14352 REENTRANT_PROTO*) ;;
14353 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
14355 echo "Prototype: $try" ;;
14358 *) case "$usethreads" in
14359 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
14366 *) getlogin_r_proto=0
14370 : see if getmnt exists
14371 set getmnt d_getmnt
14374 : see if getmntent exists
14375 set getmntent d_getmntent
14378 : see if getnameinfo exists
14379 set getnameinfo d_getnameinfo
14382 : see if getnetbyaddr exists
14383 set getnetbyaddr d_getnbyaddr
14386 : see if getnetbyname exists
14387 set getnetbyname d_getnbyname
14390 : see if getnetent exists
14391 set getnetent d_getnent
14394 : see if getnetbyaddr_r exists
14395 set getnetbyaddr_r d_getnetbyaddr_r
14397 case "$d_getnetbyaddr_r" in
14399 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14400 case "$d_getnetbyaddr_r_proto:$usethreads" in
14401 ":define") d_getnetbyaddr_r_proto=define
14402 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
14406 case "$d_getnetbyaddr_r_proto" in
14408 case "$getnetbyaddr_r_proto" in
14409 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
14410 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
14412 case "$getnetbyaddr_r_proto" in
14413 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
14414 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
14416 case "$getnetbyaddr_r_proto" in
14417 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
14418 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
14420 case "$getnetbyaddr_r_proto" in
14421 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
14422 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
14424 case "$getnetbyaddr_r_proto" in
14425 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
14426 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
14428 case "$getnetbyaddr_r_proto" in
14429 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
14430 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
14432 case "$getnetbyaddr_r_proto" in
14433 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
14434 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
14436 case "$getnetbyaddr_r_proto" in
14437 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
14438 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
14440 case "$getnetbyaddr_r_proto" in
14441 ''|0) d_getnetbyaddr_r=undef
14442 getnetbyaddr_r_proto=0
14443 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
14444 * ) case "$getnetbyaddr_r_proto" in
14445 REENTRANT_PROTO*) ;;
14446 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
14448 echo "Prototype: $try" ;;
14451 *) case "$usethreads" in
14452 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
14454 d_getnetbyaddr_r=undef
14455 getnetbyaddr_r_proto=0
14459 *) getnetbyaddr_r_proto=0
14463 : see if getnetbyname_r exists
14464 set getnetbyname_r d_getnetbyname_r
14466 case "$d_getnetbyname_r" in
14468 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14469 case "$d_getnetbyname_r_proto:$usethreads" in
14470 ":define") d_getnetbyname_r_proto=define
14471 set d_getnetbyname_r_proto getnetbyname_r $hdrs
14475 case "$d_getnetbyname_r_proto" in
14477 case "$getnetbyname_r_proto" in
14478 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
14479 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
14481 case "$getnetbyname_r_proto" in
14482 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
14483 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
14485 case "$getnetbyname_r_proto" in
14486 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
14487 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
14489 case "$getnetbyname_r_proto" in
14490 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
14491 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
14493 case "$getnetbyname_r_proto" in
14494 ''|0) d_getnetbyname_r=undef
14495 getnetbyname_r_proto=0
14496 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
14497 * ) case "$getnetbyname_r_proto" in
14498 REENTRANT_PROTO*) ;;
14499 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
14501 echo "Prototype: $try" ;;
14504 *) case "$usethreads" in
14505 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
14507 d_getnetbyname_r=undef
14508 getnetbyname_r_proto=0
14512 *) getnetbyname_r_proto=0
14516 : see if getnetent_r exists
14517 set getnetent_r d_getnetent_r
14519 case "$d_getnetent_r" in
14521 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14522 case "$d_getnetent_r_proto:$usethreads" in
14523 ":define") d_getnetent_r_proto=define
14524 set d_getnetent_r_proto getnetent_r $hdrs
14528 case "$d_getnetent_r_proto" in
14530 case "$getnetent_r_proto" in
14531 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
14532 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
14534 case "$getnetent_r_proto" in
14535 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
14536 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBIE ;;
14538 case "$getnetent_r_proto" in
14539 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
14540 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBIE ;;
14542 case "$getnetent_r_proto" in
14543 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
14544 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBI ;;
14546 case "$getnetent_r_proto" in
14547 ''|0) try='int getnetent_r(struct netent*, char*, int);'
14548 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBI ;;
14550 case "$getnetent_r_proto" in
14551 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
14552 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SD ;;
14554 case "$getnetent_r_proto" in
14555 ''|0) d_getnetent_r=undef
14556 getnetent_r_proto=0
14557 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
14558 * ) case "$getnetent_r_proto" in
14559 REENTRANT_PROTO*) ;;
14560 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
14562 echo "Prototype: $try" ;;
14565 *) case "$usethreads" in
14566 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
14568 d_getnetent_r=undef
14569 getnetent_r_proto=0
14573 *) getnetent_r_proto=0
14577 : see if prototypes for various getnetxxx netdb.h functions are available
14579 set d_getnetprotos getnetent $i_netdb netdb.h
14582 : see if getpagesize exists
14583 set getpagesize d_getpagsz
14586 : Optional checks for getprotobyname and getprotobynumber
14588 : see if getprotobyname exists
14589 set getprotobyname d_getpbyname
14592 : see if getprotobynumber exists
14593 set getprotobynumber d_getpbynumber
14596 : see if getprotoent exists
14597 set getprotoent d_getpent
14600 : see if getpgid exists
14601 set getpgid d_getpgid
14604 : see if getpgrp2 exists
14605 set getpgrp2 d_getpgrp2
14608 : see if getppid exists
14609 set getppid d_getppid
14612 : see if getpriority exists
14613 set getpriority d_getprior
14616 : see if getprotobyname_r exists
14617 set getprotobyname_r d_getprotobyname_r
14619 case "$d_getprotobyname_r" in
14621 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14622 case "$d_getprotobyname_r_proto:$usethreads" in
14623 ":define") d_getprotobyname_r_proto=define
14624 set d_getprotobyname_r_proto getprotobyname_r $hdrs
14628 case "$d_getprotobyname_r_proto" in
14630 case "$getprotobyname_r_proto" in
14631 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
14632 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
14634 case "$getprotobyname_r_proto" in
14635 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
14636 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
14638 case "$getprotobyname_r_proto" in
14639 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
14640 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
14642 case "$getprotobyname_r_proto" in
14643 ''|0) d_getprotobyname_r=undef
14644 getprotobyname_r_proto=0
14645 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
14646 * ) case "$getprotobyname_r_proto" in
14647 REENTRANT_PROTO*) ;;
14648 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
14650 echo "Prototype: $try" ;;
14653 *) case "$usethreads" in
14654 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
14656 d_getprotobyname_r=undef
14657 getprotobyname_r_proto=0
14661 *) getprotobyname_r_proto=0
14665 : see if getprotobynumber_r exists
14666 set getprotobynumber_r d_getprotobynumber_r
14668 case "$d_getprotobynumber_r" in
14670 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14671 case "$d_getprotobynumber_r_proto:$usethreads" in
14672 ":define") d_getprotobynumber_r_proto=define
14673 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
14677 case "$d_getprotobynumber_r_proto" in
14679 case "$getprotobynumber_r_proto" in
14680 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
14681 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
14683 case "$getprotobynumber_r_proto" in
14684 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
14685 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
14687 case "$getprotobynumber_r_proto" in
14688 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
14689 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
14691 case "$getprotobynumber_r_proto" in
14692 ''|0) d_getprotobynumber_r=undef
14693 getprotobynumber_r_proto=0
14694 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
14695 * ) case "$getprotobynumber_r_proto" in
14696 REENTRANT_PROTO*) ;;
14697 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
14699 echo "Prototype: $try" ;;
14702 *) case "$usethreads" in
14703 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
14705 d_getprotobynumber_r=undef
14706 getprotobynumber_r_proto=0
14710 *) getprotobynumber_r_proto=0
14714 : see if getprotoent_r exists
14715 set getprotoent_r d_getprotoent_r
14717 case "$d_getprotoent_r" in
14719 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14720 case "$d_getprotoent_r_proto:$usethreads" in
14721 ":define") d_getprotoent_r_proto=define
14722 set d_getprotoent_r_proto getprotoent_r $hdrs
14726 case "$d_getprotoent_r_proto" in
14728 case "$getprotoent_r_proto" in
14729 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
14730 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
14732 case "$getprotoent_r_proto" in
14733 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
14734 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBI ;;
14736 case "$getprotoent_r_proto" in
14737 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
14738 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=S_SBI ;;
14740 case "$getprotoent_r_proto" in
14741 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
14742 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SD ;;
14744 case "$getprotoent_r_proto" in
14745 ''|0) d_getprotoent_r=undef
14746 getprotoent_r_proto=0
14747 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
14748 * ) case "$getprotoent_r_proto" in
14749 REENTRANT_PROTO*) ;;
14750 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
14752 echo "Prototype: $try" ;;
14755 *) case "$usethreads" in
14756 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
14758 d_getprotoent_r=undef
14759 getprotoent_r_proto=0
14763 *) getprotoent_r_proto=0
14767 : see if prototypes for various getprotoxxx netdb.h functions are available
14769 set d_getprotoprotos getprotoent $i_netdb netdb.h
14772 : see if getprpwnam exists
14773 set getprpwnam d_getprpwnam
14776 : see if getpwent exists
14777 set getpwent d_getpwent
14780 : see if getpwent_r exists
14781 set getpwent_r d_getpwent_r
14783 case "$d_getpwent_r" in
14785 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14786 case "$d_getpwent_r_proto:$usethreads" in
14787 ":define") d_getpwent_r_proto=define
14788 set d_getpwent_r_proto getpwent_r $hdrs
14792 case "$d_getpwent_r_proto" in
14794 case "$getpwent_r_proto" in
14795 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
14796 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBWR ;;
14798 case "$getpwent_r_proto" in
14799 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
14800 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIR ;;
14802 case "$getpwent_r_proto" in
14803 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
14804 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBW ;;
14806 case "$getpwent_r_proto" in
14807 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
14808 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBI ;;
14810 case "$getpwent_r_proto" in
14811 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
14812 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBI ;;
14814 case "$getpwent_r_proto" in
14815 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
14816 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIH ;;
14818 case "$getpwent_r_proto" in
14819 ''|0) d_getpwent_r=undef
14821 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
14822 * ) case "$getpwent_r_proto" in
14823 REENTRANT_PROTO*) ;;
14824 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
14826 echo "Prototype: $try" ;;
14829 *) case "$usethreads" in
14830 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
14837 *) getpwent_r_proto=0
14841 : see if getpwnam_r exists
14842 set getpwnam_r d_getpwnam_r
14844 case "$d_getpwnam_r" in
14846 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14847 case "$d_getpwnam_r_proto:$usethreads" in
14848 ":define") d_getpwnam_r_proto=define
14849 set d_getpwnam_r_proto getpwnam_r $hdrs
14853 case "$d_getpwnam_r_proto" in
14855 case "$getpwnam_r_proto" in
14856 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
14857 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
14859 case "$getpwnam_r_proto" in
14860 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
14861 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
14863 case "$getpwnam_r_proto" in
14864 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
14865 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
14867 case "$getpwnam_r_proto" in
14868 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
14869 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
14871 case "$getpwnam_r_proto" in
14872 ''|0) d_getpwnam_r=undef
14874 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
14875 * ) case "$getpwnam_r_proto" in
14876 REENTRANT_PROTO*) ;;
14877 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
14879 echo "Prototype: $try" ;;
14882 *) case "$usethreads" in
14883 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
14890 *) getpwnam_r_proto=0
14894 : see if getpwuid_r exists
14895 set getpwuid_r d_getpwuid_r
14897 case "$d_getpwuid_r" in
14899 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14900 case "$d_getpwuid_r_proto:$usethreads" in
14901 ":define") d_getpwuid_r_proto=define
14902 set d_getpwuid_r_proto getpwuid_r $hdrs
14906 case "$d_getpwuid_r_proto" in
14908 case "$getpwuid_r_proto" in
14909 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
14910 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
14912 case "$getpwuid_r_proto" in
14913 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
14914 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
14916 case "$getpwuid_r_proto" in
14917 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
14918 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
14920 case "$getpwuid_r_proto" in
14921 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
14922 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
14924 case "$getpwuid_r_proto" in
14925 ''|0) d_getpwuid_r=undef
14927 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
14928 * ) case "$getpwuid_r_proto" in
14929 REENTRANT_PROTO*) ;;
14930 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
14932 echo "Prototype: $try" ;;
14935 *) case "$usethreads" in
14936 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
14943 *) getpwuid_r_proto=0
14947 : Optional checks for getsbyname and getsbyport
14949 : see if getservbyname exists
14950 set getservbyname d_getsbyname
14953 : see if getservbyport exists
14954 set getservbyport d_getsbyport
14957 : see if getservent exists
14958 set getservent d_getsent
14961 : see if getservbyname_r exists
14962 set getservbyname_r d_getservbyname_r
14964 case "$d_getservbyname_r" in
14966 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14967 case "$d_getservbyname_r_proto:$usethreads" in
14968 ":define") d_getservbyname_r_proto=define
14969 set d_getservbyname_r_proto getservbyname_r $hdrs
14973 case "$d_getservbyname_r_proto" in
14975 case "$getservbyname_r_proto" in
14976 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
14977 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
14979 case "$getservbyname_r_proto" in
14980 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
14981 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
14983 case "$getservbyname_r_proto" in
14984 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
14985 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
14987 case "$getservbyname_r_proto" in
14988 ''|0) d_getservbyname_r=undef
14989 getservbyname_r_proto=0
14990 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
14991 * ) case "$getservbyname_r_proto" in
14992 REENTRANT_PROTO*) ;;
14993 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
14995 echo "Prototype: $try" ;;
14998 *) case "$usethreads" in
14999 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
15001 d_getservbyname_r=undef
15002 getservbyname_r_proto=0
15006 *) getservbyname_r_proto=0
15010 : see if getservbyport_r exists
15011 set getservbyport_r d_getservbyport_r
15013 case "$d_getservbyport_r" in
15015 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15016 case "$d_getservbyport_r_proto:$usethreads" in
15017 ":define") d_getservbyport_r_proto=define
15018 set d_getservbyport_r_proto getservbyport_r $hdrs
15022 case "$d_getservbyport_r_proto" in
15024 case "$getservbyport_r_proto" in
15025 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
15026 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
15028 case "$getservbyport_r_proto" in
15029 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
15030 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
15032 case "$getservbyport_r_proto" in
15033 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
15034 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
15036 case "$getservbyport_r_proto" in
15037 ''|0) d_getservbyport_r=undef
15038 getservbyport_r_proto=0
15039 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
15040 * ) case "$getservbyport_r_proto" in
15041 REENTRANT_PROTO*) ;;
15042 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
15044 echo "Prototype: $try" ;;
15047 *) case "$usethreads" in
15048 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
15050 d_getservbyport_r=undef
15051 getservbyport_r_proto=0
15055 *) getservbyport_r_proto=0
15059 : see if getservent_r exists
15060 set getservent_r d_getservent_r
15062 case "$d_getservent_r" in
15064 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15065 case "$d_getservent_r_proto:$usethreads" in
15066 ":define") d_getservent_r_proto=define
15067 set d_getservent_r_proto getservent_r $hdrs
15071 case "$d_getservent_r_proto" in
15073 case "$getservent_r_proto" in
15074 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
15075 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBWR ;;
15077 case "$getservent_r_proto" in
15078 ''|0) try='int getservent_r(struct servent*, char*, int);'
15079 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBI ;;
15081 case "$getservent_r_proto" in
15082 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
15083 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=S_SBI ;;
15085 case "$getservent_r_proto" in
15086 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
15087 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SD ;;
15089 case "$getservent_r_proto" in
15090 ''|0) d_getservent_r=undef
15091 getservent_r_proto=0
15092 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
15093 * ) case "$getservent_r_proto" in
15094 REENTRANT_PROTO*) ;;
15095 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
15097 echo "Prototype: $try" ;;
15100 *) case "$usethreads" in
15101 define) echo "getservent_r has no prototype, not using it." >&4 ;;
15103 d_getservent_r=undef
15104 getservent_r_proto=0
15108 *) getservent_r_proto=0
15112 : see if prototypes for various getservxxx netdb.h functions are available
15114 set d_getservprotos getservent $i_netdb netdb.h
15117 : see if getspnam exists
15118 set getspnam d_getspnam
15121 : see if this is a shadow.h system
15122 set shadow.h i_shadow
15125 : see if getspnam_r exists
15126 set getspnam_r d_getspnam_r
15128 case "$d_getspnam_r" in
15130 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
15131 case "$d_getspnam_r_proto:$usethreads" in
15132 ":define") d_getspnam_r_proto=define
15133 set d_getspnam_r_proto getspnam_r $hdrs
15137 case "$d_getspnam_r_proto" in
15139 case "$getspnam_r_proto" in
15140 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
15141 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
15143 case "$getspnam_r_proto" in
15144 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
15145 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=S_CSBI ;;
15147 case "$getspnam_r_proto" in
15148 ''|0) d_getspnam_r=undef
15150 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
15151 * ) case "$getspnam_r_proto" in
15152 REENTRANT_PROTO*) ;;
15153 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
15155 echo "Prototype: $try" ;;
15158 *) case "$usethreads" in
15159 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
15166 *) getspnam_r_proto=0
15170 : see if gettimeofday or ftime exists
15171 set gettimeofday d_gettimeod
15173 case "$d_gettimeod" in
15179 val="$undef"; set d_ftime; eval $setvar
15182 case "$d_gettimeod$d_ftime" in
15185 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
15189 : see if gmtime_r exists
15190 set gmtime_r d_gmtime_r
15192 case "$d_gmtime_r" in
15194 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15195 case "$d_gmtime_r_proto:$usethreads" in
15196 ":define") d_gmtime_r_proto=define
15197 set d_gmtime_r_proto gmtime_r $hdrs
15201 case "$d_gmtime_r_proto" in
15203 case "$gmtime_r_proto" in
15204 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
15205 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=S_TS ;;
15207 case "$gmtime_r_proto" in
15208 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
15209 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=I_TS ;;
15211 case "$gmtime_r_proto" in
15212 ''|0) d_gmtime_r=undef
15214 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
15215 * ) case "$gmtime_r_proto" in
15216 REENTRANT_PROTO*) ;;
15217 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
15219 echo "Prototype: $try" ;;
15222 *) case "$usethreads" in
15223 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
15230 *) gmtime_r_proto=0
15234 : see if hasmntopt exists
15235 set hasmntopt d_hasmntopt
15238 : see if this is a netinet/in.h or sys/in.h system
15239 set netinet/in.h i_niin sys/in.h i_sysin
15242 : see if arpa/inet.h has to be included
15243 set arpa/inet.h i_arpainet
15246 : see if htonl --and friends-- exists
15251 : Maybe they are macros.
15254 $cat >htonl.c <<EOM
15256 #include <sys/types.h>
15257 #$i_niin I_NETINET_IN
15259 #$i_arpainet I_ARPA_INET
15260 #ifdef I_NETINET_IN
15261 #include <netinet/in.h>
15264 #include <sys/in.h>
15267 #include <arpa/inet.h>
15270 printf("Defined as a macro.");
15273 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
15274 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
15276 echo "But it seems to be defined as a macro." >&4
15284 : see if ilogbl exists
15285 set ilogbl d_ilogbl
15290 if set index val -f; eval $csym; $val; then
15291 if set strchr val -f d_strchr; eval $csym; $val; then
15292 if $contains strchr "$strings" >/dev/null 2>&1 ; then
15295 echo "strchr() found." >&4
15299 echo "index() found." >&4
15304 echo "index() found." >&4
15307 if set strchr val -f d_strchr; eval $csym; $val; then
15310 echo "strchr() found." >&4
15312 echo "No index() or strchr() found!" >&4
15317 set d_strchr; eval $setvar
15319 set d_index; eval $setvar
15321 : check whether inet_aton exists
15322 set inet_aton d_inetaton
15325 : see if inet_ntop exists
15326 set inet_ntop d_inetntop
15329 : see if inet_pton exists
15330 set inet_pton d_inetpton
15335 $cat >isascii.c <<EOCP
15338 #$i_stdlib I_STDLIB
15340 #include <stdlib.h>
15351 if eval $compile; then
15352 echo "isascii() found." >&4
15355 echo "isascii() NOT found." >&4
15364 $cat >isblank.c <<'EOCP'
15375 if $cc $ccflags $ldflags -o isblank isblank.c $libs >/dev/null 2>&1 ; then
15376 echo "isblank() found." >&4
15379 echo "isblank() NOT found." >&4
15386 : see if isfinite exists
15387 set isfinite d_isfinite
15390 : see if isinf exists
15394 : see if isnan exists
15398 : see if isnanl exists
15399 set isnanl d_isnanl
15402 : see if killpg exists
15403 set killpg d_killpg
15406 : see if lchown exists
15408 $cat > try.c <<'EOCP'
15409 /* System header to define __stub macros and hopefully few prototypes,
15410 which can conflict with char lchown(); below. */
15411 #include <assert.h>
15412 /* Override any gcc2 internal prototype to avoid an error. */
15413 /* We use char because int might match the return type of a gcc2
15414 builtin and then its argument prototype would still apply. */
15417 /* The GNU C library defines this for functions which it implements
15418 to always fail with ENOSYS. Some functions are actually named
15419 something starting with __ and the normal name is an alias. */
15420 #if defined (__stub_lchown) || defined (__stub___lchown)
15428 if eval $compile; then
15429 $echo "lchown() found." >&4
15432 $echo "lchown() NOT found." >&4
15438 : See if number of significant digits in a double precision number is known
15440 $cat >ldbl_dig.c <<EOM
15441 #$i_limits I_LIMITS
15444 #include <limits.h>
15450 printf("Contains LDBL_DIG");
15453 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
15454 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
15455 echo "LDBL_DIG found." >&4
15458 echo "LDBL_DIG NOT found." >&4
15465 : see if this is a math.h system
15469 : check to see if math.h defines _LIB_VERSION
15470 d_libm_lib_version="$undef"
15474 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
15476 #include <unistd.h>
15478 int main (int argc, char *argv[])
15480 printf ("%d\n", _LIB_VERSION);
15485 if eval $compile; then
15487 echo "Yes, it does ($foo)" >&4
15488 d_libm_lib_version="$define"
15490 echo "No, it does not (probably harmless)" >&4
15497 : see if link exists
15501 : see if localtime_r exists
15502 set localtime_r d_localtime_r
15504 case "$d_localtime_r" in
15506 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15507 case "$d_localtime_r_proto:$usethreads" in
15508 ":define") d_localtime_r_proto=define
15509 set d_localtime_r_proto localtime_r $hdrs
15513 case "$d_localtime_r_proto" in
15515 case "$localtime_r_proto" in
15516 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
15517 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=S_TS ;;
15519 case "$localtime_r_proto" in
15520 ''|0) try='int localtime_r(const time_t*, struct tm*);'
15521 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=I_TS ;;
15523 case "$localtime_r_proto" in
15524 ''|0) d_localtime_r=undef
15525 localtime_r_proto=0
15526 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
15527 * ) case "$localtime_r_proto" in
15528 REENTRANT_PROTO*) ;;
15529 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
15531 echo "Prototype: $try" ;;
15534 *) case "$usethreads" in
15535 define) echo "localtime_r has no prototype, not using it." >&4 ;;
15537 d_localtime_r=undef
15538 localtime_r_proto=0
15542 *) localtime_r_proto=0
15546 : see if localtime_r calls tzset
15547 case "$localtime_r_proto" in
15550 /* Does our libc's localtime_r call tzset ?
15551 * return 0 if so, 1 otherwise.
15553 #$i_systypes I_SYS_TYPES
15554 #$i_unistd I_UNISTD
15556 #$i_stdlib I_STDLIB
15557 #$i_string I_STRING
15558 #$i_malloc I_MALLOC
15560 # include <sys/types.h>
15563 # include <unistd.h>
15569 #include <stdlib.h>
15572 # include <string.h>
15574 # include <strings.h>
15577 # include <malloc.h>
15581 time_t t = time(0L);
15582 char w_tz[]="TZ" "=GMT+5",
15583 e_tz[]="TZ" "=GMT-5",
15584 *tz_e = (char*)malloc(16),
15585 *tz_w = (char*)malloc(16);
15586 struct tm tm_e, tm_w;
15587 memset(&tm_e,'\0',sizeof(struct tm));
15588 memset(&tm_w,'\0',sizeof(struct tm));
15593 localtime_r(&t, &tm_e);
15596 localtime_r(&t, &tm_w);
15598 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
15604 if eval $compile; then
15605 if $run ./try; then
15606 d_localtime_r_needs_tzset=undef;
15608 d_localtime_r_needs_tzset=define;
15611 d_localtime_r_needs_tzset=undef;
15615 d_localtime_r_needs_tzset=undef;
15620 : see if localeconv exists
15621 set localeconv d_locconv
15624 : see if lockf exists
15628 : see if prototype for lseek is available
15630 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
15633 : see if lstat exists
15637 : see if madvise exists
15638 set madvise d_madvise
15641 : see if malloc_size exists
15642 set malloc_size d_malloc_size
15645 : see if malloc_size_good exists
15646 set malloc_good_size d_malloc_good_size
15649 : see if mblen exists
15653 : see if mbstowcs exists
15654 set mbstowcs d_mbstowcs
15657 : see if mbtowc exists
15658 set mbtowc d_mbtowc
15661 : see if memchr exists
15662 set memchr d_memchr
15665 : see if memcmp exists
15666 set memcmp d_memcmp
15669 : see if memcpy exists
15670 set memcpy d_memcpy
15673 : see if memmove exists
15674 set memmove d_memmove
15677 : see if memset exists
15678 set memset d_memset
15681 : see if mkdir exists
15685 : see if mkdtemp exists
15686 set mkdtemp d_mkdtemp
15689 : see if mkfifo exists
15690 set mkfifo d_mkfifo
15693 : see if mkstemp exists
15694 set mkstemp d_mkstemp
15697 : see if mkstemps exists
15698 set mkstemps d_mkstemps
15701 : see if mktime exists
15702 set mktime d_mktime
15705 : see if this is a sys/mman.h system
15706 set sys/mman.h i_sysmman
15709 : see if mmap exists
15712 : see what shmat returns
15713 : default to something harmless
15715 case "$i_sysmman$d_mmap" in
15717 $cat >mmap.c <<'END'
15718 #include <sys/mman.h>
15721 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
15726 echo "and it returns ($mmaptype)." >&4
15732 : see if sqrtl exists
15736 : see if scalbnl exists
15737 set scalbnl d_scalbnl
15740 : see if modfl exists
15744 : see if prototype for modfl is available
15746 set d_modflproto modfl $i_math math.h
15749 d_modfl_pow32_bug="$undef"
15751 case "$d_longdbl$d_modfl" in
15754 Checking to see whether your modfl() is okay for large values...
15760 if $test "X$d_modflproto" != "X$define"; then
15761 $cat >>try.c <<EOCP
15762 /* Sigh. many current glibcs provide the function, but do not prototype it. */
15763 long double modfl (long double, long double *);
15766 $cat >>try.c <<EOCP
15768 long double nv = 4294967303.15;
15774 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
15778 case "$osname:$gccversion" in
15779 aix:) saveccflags="$ccflags"
15780 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
15783 if eval $compile; then
15786 *" 4294967303.150000 1.150000 4294967302.000000")
15787 echo >&4 "Your modfl() is broken for large values."
15788 d_modfl_pow32_bug="$define"
15790 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
15794 *" 4294967303.150000 0.150000 4294967303.000000")
15795 echo >&4 "Your modfl() seems okay for large values."
15797 *) echo >&4 "I don't understand your modfl() at all."
15803 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
15806 case "$osname:$gccversion" in
15807 aix:) ccflags="$saveccflags" ;; # restore
15812 if $test "$uselongdouble" = "$define"; then
15814 if $test "$d_sqrtl" != "$define"; then
15815 message="$message sqrtl"
15817 if $test "$d_modfl" != "$define"; then
15818 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
15819 echo "You have both aintl and copysignl, so I can emulate modfl."
15821 message="$message modfl"
15824 if $test "$d_frexpl" != "$define"; then
15825 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
15826 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
15828 message="$message frexpl"
15832 if $test "$message" != ""; then
15835 *** You requested the use of long doubles but you do not seem to have
15836 *** the following mathematical functions needed for long double support:
15838 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
15839 *** Cannot continue, aborting.
15847 : see if mprotect exists
15848 set mprotect d_mprotect
15851 : see if msgctl exists
15852 set msgctl d_msgctl
15855 : see if msgget exists
15856 set msgget d_msgget
15859 : see if msgsnd exists
15860 set msgsnd d_msgsnd
15863 : see if msgrcv exists
15864 set msgrcv d_msgrcv
15867 : see how much of the 'msg*(2)' library is present.
15870 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
15871 *"$undef"*) h_msg=false;;
15875 case "`ipcs 2>&1`" in
15876 "SVID messages"*"not configured"*)
15877 echo "Your $osname does not have the msg*(2) configured." >&4
15880 set msgctl d_msgctl
15882 set msgget d_msgget
15884 set msgsnd d_msgsnd
15886 set msgrcv d_msgrcv
15892 : we could also check for sys/ipc.h ...
15893 if $h_msg && $test `./findhdr sys/msg.h`; then
15894 echo "You have the full msg*(2) library." >&4
15897 echo "You don't have the full msg*(2) library." >&4
15903 : Check for msghdr_s
15905 echo "Checking to see if your system supports struct msghdr..." >&4
15906 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
15908 case "$d_msghdr_s" in
15909 "$define") echo "Yes, it does." ;;
15910 *) echo "No, it doesn't." ;;
15914 : see if msync exists
15918 : see if munmap exists
15919 set munmap d_munmap
15922 : see if nice exists
15926 : see if this is a langinfo.h system
15927 set langinfo.h i_langinfo
15930 : see if nl_langinfo exists
15931 set nl_langinfo d_nl_langinfo
15934 : check for volatile keyword
15936 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
15937 $cat >try.c <<'EOCP'
15940 typedef struct _goo_struct goo_struct;
15941 goo_struct * volatile goo = ((goo_struct *)0);
15942 struct _goo_struct {
15947 typedef unsigned short foo_t;
15948 char *volatile foo;
15950 volatile foo_t blech;
15954 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
15956 echo "Yup, it does."
15959 echo "Nope, it doesn't."
15965 : Check basic sizes
15967 $echo "Choosing the C types to be used for Perl's internal types..." >&4
15969 case "$use64bitint:$d_quad:$quadtype" in
15972 uvtype="$uquadtype"
15977 uvtype="unsigned long"
15983 case "$uselongdouble:$d_longdbl" in
15985 nvtype="long double"
15986 nvsize=$longdblsize
15993 $echo "(IV will be "$ivtype", $ivsize bytes)"
15994 $echo "(UV will be "$uvtype", $uvsize bytes)"
15995 $echo "(NV will be "$nvtype", $nvsize bytes)"
15998 #$i_inttypes I_INTTYPES
16000 #include <inttypes.h>
16005 int8_t i = INT8_MAX;
16006 uint8_t u = UINT8_MAX;
16007 printf("int8_t\n");
16010 int16_t i = INT16_MAX;
16011 uint16_t u = UINT16_MAX;
16012 printf("int16_t\n");
16015 int32_t i = INT32_MAX;
16016 uint32_t u = UINT32_MAX;
16017 printf("int32_t\n");
16022 i8type="signed char"
16023 u8type="unsigned char"
16028 '') case "$shortsize" in
16030 u16type="unsigned short"
16038 '') set try -DINT16
16039 if eval $compile; then
16040 case "`$run ./try`" in
16052 '') if $test $shortsize -ge 2; then
16054 u16type="unsigned short"
16062 '') case "$longsize" in
16064 u32type="unsigned long"
16068 *) case "$intsize" in
16070 u32type="unsigned int"
16080 '') set try -DINT32
16081 if eval $compile; then
16082 case "`$run ./try`" in
16094 '') if $test $intsize -ge 4; then
16096 u32type="unsigned int"
16104 '') case "$d_quad:$quadtype" in
16106 i64type="$quadtype"
16107 u64type="$uquadtype"
16115 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
16116 : volatile so that the compiler has to store it out to memory.
16117 if test X"$d_volatile" = X"$define"; then
16122 #$i_stdlib I_STDLIB
16124 #include <stdlib.h>
16126 #include <sys/types.h>
16127 #include <signal.h>
16129 $volatile int bletched = 0;
16130 $signal_t blech(int s) { bletched = 1; }
16135 int n = 8 * $uvsize;
16138 signal(SIGFPE, blech);
16141 for (i = 0; i < n; i++) {
16142 u = u << 1 | ($uvtype)1;
16144 if (($uvtype)d != u)
16148 d = ($nvtype)(u - 1);
16149 if (($uvtype)d != (u - 1))
16156 printf("%d\n", ((i == n) ? -n : i));
16162 d_nv_preserves_uv="$undef"
16163 if eval $compile; then
16164 nv_preserves_uv_bits="`$run ./try`"
16166 case "$nv_preserves_uv_bits" in
16168 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
16169 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
16170 d_nv_preserves_uv="$define"
16172 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
16173 d_nv_preserves_uv="$undef" ;;
16174 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
16175 nv_preserves_uv_bits="0" ;;
16179 $echo "Checking to find the largest integer value your NVs can hold..." >&4
16180 : volatile so that the compiler has to store it out to memory.
16181 if test X"$d_volatile" = X"$define"; then
16187 typedef $nvtype NV;
16194 while(count < 256) {
16195 $volatile NV up = value + 1.0;
16196 $volatile NV negated = -value;
16197 $volatile NV down = negated - 1.0;
16198 $volatile NV got_up = up - value;
16199 int up_good = got_up == 1.0;
16200 int got_down = down - negated;
16201 int down_good = got_down == -1.0;
16203 if (down_good != up_good) {
16205 "Inconsistency - up %d %f; down %d %f; for 2**%d (%.20f)\n",
16206 up_good, (double) got_up, down_good, (double) got_down,
16207 count, (double) value);
16214 fputs("256.0", stdout);
16217 fputs("2.0", stdout);
16223 fputs("*", stdout);
16229 fprintf(stderr, "Cannot overflow integer range, even at 2**%d (%.20f)\n",
16230 count, (double) value);
16236 nv_overflows_integers_at='0'
16237 if eval $compile; then
16243 The largest integer your NVs can preserve is equal to $xxx
16245 nv_overflows_integers_at="$xxx"
16248 Cannot determine the largest integer value your NVs can hold, unexpected output
16255 Cannot determine the largest integer value your NVs can hold
16262 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
16263 : volatile so that the compiler has to store it out to memory.
16264 if test X"$d_volatile" = X"$define"; then
16269 #$i_stdlib I_STDLIB
16271 #include <stdlib.h>
16273 #$i_string I_STRING
16275 # include <string.h>
16277 # include <strings.h>
16279 #include <sys/types.h>
16280 #include <signal.h>
16282 $volatile int bletched = 0;
16283 $signal_t blech(int s) { bletched = 1; }
16286 int checkit($nvtype d, char *where) {
16287 unsigned char *p = (char *)&d;
16288 unsigned char *end = p + sizeof(d);
16298 printf("No - %s: 0x", where);
16300 printf ("%02X", *p++);
16305 int main(int argc, char **argv) {
16308 fail += checkit(d, "0.0");
16310 /* The compiler shouldn't be assuming that bletched is 0 */
16313 fail += checkit(d, "bleched");
16316 signal(SIGFPE, blech);
16319 /* Paranoia - the compiler should have no way of knowing that ANSI says
16320 that argv[argc] will always be NULL. Actually, if it did assume this it
16321 would be buggy, as this is C and main() can be called from elsewhere in
16323 d = argv[argc] ? 1 : 0;
16326 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
16329 fail += checkit(d, "ternary");
16331 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
16334 printf("No - memset doesn't give 0.0\n");
16335 /* This might just blow up: */
16336 printf("(gives %g)\n", d);
16342 printf("No - something bleched\n");
16347 printf("No - %d fail(s)\n", fail);
16356 d_nv_zero_is_allbits_zero="$undef"
16357 if eval $compile; then
16363 0.0 is represented as all bits zero in memory
16365 d_nv_zero_is_allbits_zero="$define"
16368 0.0 is not represented as all bits zero in memory
16370 d_nv_zero_is_allbits_zero="$undef"
16375 0.0 is not represented as all bits zero in memory
16377 d_nv_zero_is_allbits_zero="$undef"
16383 : check for off64_t
16385 echo "Checking to see if you have off64_t..." >&4
16387 #include <sys/types.h>
16388 #include <unistd.h>
16389 int main() { off64_t x = 7; }
16392 if eval $compile; then
16394 echo "You have off64_t."
16397 echo "You do not have off64_t."
16398 case "$lseeksize" in
16399 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
16406 : how to create joinable pthreads
16407 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
16409 echo "Checking what constant to use for creating joinable pthreads..." >&4
16410 $cat >try.c <<'EOCP'
16411 #include <pthread.h>
16413 int detachstate = JOINABLE;
16416 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
16417 if eval $compile; then
16418 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
16419 val="$undef" # Yes, undef.
16420 set d_old_pthread_create_joinable
16423 set old_pthread_create_joinable
16426 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
16427 if eval $compile; then
16428 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
16430 set d_old_pthread_create_joinable
16432 val=PTHREAD_CREATE_UNDETACHED
16433 set old_pthread_create_joinable
16436 set try -DJOINABLE=__UNDETACHED
16437 if eval $compile; then
16438 echo "You seem to use __UNDETACHED." >&4
16440 set d_old_pthread_create_joinable
16443 set old_pthread_create_joinable
16446 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
16448 set d_old_pthread_create_joinable
16451 set old_pthread_create_joinable
16458 d_old_pthread_create_joinable="$undef"
16459 old_pthread_create_joinable=""
16462 : see if pause exists
16466 : see if poll exists
16470 : see if prctl exists
16474 : see if prctl supports PR_SET_NAME
16475 d_prctl_set_name=$undef
16479 #include <sys/prctl.h>
16481 int main (int argc, char *argv[])
16483 return (prctl (PR_SET_NAME, "Test"));
16487 if eval $compile_ok && $run ./try; then
16488 echo "Your prctl (PR_SET_NAME, ...) works"
16489 d_prctl_set_name=$define
16495 : see if readlink exists
16496 set readlink d_readlink
16499 : Check if exe is symlink to abs path of executing program
16503 case "$d_readlink" in
16505 : NetBSD first as /proc/self is a symlink to /proc/curproc, and it feels
16506 : more tidy to avoid an extra level of symlink
16507 set NetBSD /proc/curproc/exe Linux /proc/self/exe FreeBSD /proc/curproc/file Solaris /proc/self/path/a.out
16508 while test $# -gt 0; do
16511 if $issymlink $try; then
16512 $ls -l $try > reflect
16513 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
16514 echo "You have $type-like $try."
16515 procselfexe='"'$try'"'
16517 : This will break out of the loop
16528 : backward compatibility for d_hvfork
16529 if test X$d_hvfork != X; then
16530 d_vfork="$d_hvfork"
16533 : see if there is a vfork
16538 d_pseudofork=$undef
16540 : Ok, but do we want to use it. vfork is reportedly unreliable in
16541 : perl on Solaris 2.x, and probably elsewhere.
16545 case "$usevfork" in
16551 Perl can only use a vfork() that doesn't suffer from strict
16552 restrictions on calling functions or modifying global data in
16553 the child. For example, glibc-2.1 contains such a vfork()
16554 that is unsuitable. If your system provides a proper fork()
16555 call, chances are that you do NOT want perl to use vfork().
16558 rp="Do you still want to use vfork()?"
16563 echo "Ok, we won't use vfork()."
16572 $define) usevfork='true';;
16573 *) usevfork='false';;
16576 : see whether the pthread_atfork exists
16578 #include <pthread.h>
16581 #ifdef PTHREAD_ATFORK
16582 pthread_atfork(NULL,NULL,NULL);
16587 : see if pthread_atfork exists
16588 set try -DPTHREAD_ATFORK
16589 if eval $compile; then
16594 case "$usethreads" in
16597 $define) echo 'pthread_atfork found.' >&4 ;;
16598 *) echo 'pthread_atfork NOT found.' >&4 ;;
16601 set d_pthread_atfork
16604 : see if pthread_attr_setscope exists
16605 set pthread_attr_setscope d_pthread_attr_setscope
16608 : see whether the various POSIXish _yields exist
16610 #include <pthread.h>
16616 #ifdef PTHREAD_YIELD
16619 #ifdef PTHREAD_YIELD_NULL
16620 pthread_yield(NULL);
16626 : see if sched_yield exists
16627 set try -DSCHED_YIELD
16628 if eval $compile; then
16630 sched_yield='sched_yield()'
16634 case "$usethreads" in
16637 $define) echo 'sched_yield() found.' >&4 ;;
16638 *) echo 'sched_yield() NOT found.' >&4 ;;
16644 : see if pthread_yield exists
16645 set try -DPTHREAD_YIELD
16646 if eval $compile; then
16648 case "$sched_yield" in
16649 '') sched_yield='pthread_yield()' ;;
16652 set try -DPTHREAD_YIELD_NULL
16653 if eval $compile; then
16655 case "$sched_yield" in
16656 '') sched_yield='pthread_yield(NULL)' ;;
16662 case "$usethreads" in
16665 $define) echo 'pthread_yield() found.' >&4 ;;
16666 *) echo 'pthread_yield() NOT found.' >&4 ;;
16670 set d_pthread_yield
16672 case "$sched_yield" in
16673 '') sched_yield=undef ;;
16677 : see if random_r exists
16678 set random_r d_random_r
16680 case "$d_random_r" in
16682 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16683 case "$d_random_r_proto:$usethreads" in
16684 ":define") d_random_r_proto=define
16685 set d_random_r_proto random_r $hdrs
16689 case "$d_random_r_proto" in
16691 case "$random_r_proto" in
16692 ''|0) try='int random_r(int*, struct random_data*);'
16693 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_iS ;;
16695 case "$random_r_proto" in
16696 ''|0) try='int random_r(long*, struct random_data*);'
16697 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_lS ;;
16699 case "$random_r_proto" in
16700 ''|0) try='int random_r(struct random_data*, int32_t*);'
16701 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_St ;;
16703 case "$random_r_proto" in
16704 ''|0) d_random_r=undef
16706 echo "Disabling random_r, cannot determine prototype." >&4 ;;
16707 * ) case "$random_r_proto" in
16708 REENTRANT_PROTO*) ;;
16709 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
16711 echo "Prototype: $try" ;;
16714 *) case "$usethreads" in
16715 define) echo "random_r has no prototype, not using it." >&4 ;;
16722 *) random_r_proto=0
16726 : see if readdir and friends exist
16727 set readdir d_readdir
16729 set seekdir d_seekdir
16731 set telldir d_telldir
16733 set rewinddir d_rewinddir
16736 : see if readdir64_r exists
16737 set readdir64_r d_readdir64_r
16739 case "$d_readdir64_r" in
16741 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16742 case "$d_readdir64_r_proto:$usethreads" in
16743 ":define") d_readdir64_r_proto=define
16744 set d_readdir64_r_proto readdir64_r $hdrs
16748 case "$d_readdir64_r_proto" in
16750 case "$readdir64_r_proto" in
16751 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
16752 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TSR ;;
16754 case "$readdir64_r_proto" in
16755 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
16756 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TS ;;
16758 case "$readdir64_r_proto" in
16759 ''|0) d_readdir64_r=undef
16760 readdir64_r_proto=0
16761 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
16762 * ) case "$readdir64_r_proto" in
16763 REENTRANT_PROTO*) ;;
16764 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
16766 echo "Prototype: $try" ;;
16769 *) case "$usethreads" in
16770 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
16772 d_readdir64_r=undef
16773 readdir64_r_proto=0
16777 *) readdir64_r_proto=0
16781 : see if readdir_r exists
16782 set readdir_r d_readdir_r
16784 case "$d_readdir_r" in
16786 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16787 case "$d_readdir_r_proto:$usethreads" in
16788 ":define") d_readdir_r_proto=define
16789 set d_readdir_r_proto readdir_r $hdrs
16793 case "$d_readdir_r_proto" in
16795 case "$readdir_r_proto" in
16796 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
16797 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TSR ;;
16799 case "$readdir_r_proto" in
16800 ''|0) try='int readdir_r(DIR*, struct dirent*);'
16801 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TS ;;
16803 case "$readdir_r_proto" in
16804 ''|0) d_readdir_r=undef
16806 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
16807 * ) case "$readdir_r_proto" in
16808 REENTRANT_PROTO*) ;;
16809 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
16811 echo "Prototype: $try" ;;
16814 *) case "$usethreads" in
16815 define) echo "readdir_r has no prototype, not using it." >&4 ;;
16822 *) readdir_r_proto=0
16826 : see if readv exists
16830 : see if recvmsg exists
16831 set recvmsg d_recvmsg
16834 : see if rename exists
16835 set rename d_rename
16838 : see if rmdir exists
16842 : see if memory.h is available.
16847 : See if it conflicts with string.h
16853 $cppstdin $cppflags $cppminus < $strings > mem.h
16854 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
16856 echo "We won't be including <memory.h>."
16866 : can bcopy handle overlapping blocks?
16869 case "$d_memmove" in
16870 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
16871 *) case "$d_bcopy" in
16873 echo "Checking to see if bcopy() can do overlapping copies..." >&4
16875 #$i_memory I_MEMORY
16876 #$i_stdlib I_STDLIB
16877 #$i_string I_STRING
16878 #$i_unistd I_UNISTD
16880 $cat >>try.c <<'EOCP'
16883 # include <memory.h>
16886 # include <stdlib.h>
16889 # include <string.h>
16891 # include <strings.h>
16894 # include <unistd.h> /* Needed for NetBSD */
16898 char buf[128], abc[128];
16904 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16905 try to store the string in read-only memory. */
16906 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
16908 for (align = 7; align >= 0; align--) {
16909 for (len = 36; len; len--) {
16911 bcopy(abc, b, len);
16912 for (off = 1; off <= len; off++) {
16913 bcopy(b, b+off, len);
16914 bcopy(b+off, b, len);
16915 if (bcmp(b, abc, len))
16924 if eval $compile_ok; then
16925 if $run ./try 2>/dev/null; then
16926 echo "Yes, it can."
16929 echo "It can't, sorry."
16932 echo "(I can't compile the test program, so we'll assume not...)"
16942 : can memcpy handle overlapping blocks?
16945 case "$d_memmove" in
16946 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
16947 *) case "$d_memcpy" in
16949 echo "Checking to see if memcpy() can do overlapping copies..." >&4
16951 #$i_memory I_MEMORY
16952 #$i_stdlib I_STDLIB
16953 #$i_string I_STRING
16954 #$i_unistd I_UNISTD
16956 $cat >>try.c <<'EOCP'
16959 # include <memory.h>
16962 # include <stdlib.h>
16965 # include <string.h>
16967 # include <strings.h>
16970 # include <unistd.h> /* Needed for NetBSD */
16974 char buf[128], abc[128];
16980 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16981 try to store the string in read-only memory. */
16982 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
16984 for (align = 7; align >= 0; align--) {
16985 for (len = 36; len; len--) {
16987 memcpy(b, abc, len);
16988 for (off = 1; off <= len; off++) {
16989 memcpy(b+off, b, len);
16990 memcpy(b, b+off, len);
16991 if (memcmp(b, abc, len))
17000 if eval $compile_ok; then
17001 if $run ./try 2>/dev/null; then
17002 echo "Yes, it can."
17005 echo "It can't, sorry."
17008 echo "(I can't compile the test program, so we'll assume not...)"
17018 : can memcmp be trusted to compare relative magnitude?
17020 case "$d_memcmp" in
17023 echo "Checking if your memcmp() can compare relative magnitude..." >&4
17025 #$i_memory I_MEMORY
17026 #$i_stdlib I_STDLIB
17027 #$i_string I_STRING
17028 #$i_unistd I_UNISTD
17030 $cat >>try.c <<'EOCP'
17033 # include <memory.h>
17036 # include <stdlib.h>
17039 # include <string.h>
17041 # include <strings.h>
17044 # include <unistd.h> /* Needed for NetBSD */
17050 if ((a < b) && memcmp(&a, &b, 1) < 0)
17056 if eval $compile_ok; then
17057 if $run ./try 2>/dev/null; then
17058 echo "Yes, it can."
17061 echo "No, it can't (it uses signed chars)."
17064 echo "(I can't compile the test program, so we'll assume not...)"
17072 : see if prototype for sbrk is available
17074 set d_sbrkproto sbrk $i_unistd unistd.h
17077 : see if select exists
17078 set select d_select
17081 : see if semctl exists
17082 set semctl d_semctl
17085 : see if semget exists
17086 set semget d_semget
17089 : see if semop exists
17093 : see how much of the 'sem*(2)' library is present.
17096 case "$d_semctl$d_semget$d_semop" in
17097 *"$undef"*) h_sem=false;;
17101 case "`ipcs 2>&1`" in
17102 "SVID messages"*"not configured"*)
17103 echo "Your $osname does not have the sem*(2) configured." >&4
17106 set semctl d_semctl
17108 set semget d_semget
17116 : we could also check for sys/ipc.h ...
17117 if $h_sem && $test `./findhdr sys/sem.h`; then
17118 echo "You have the full sem*(2) library." >&4
17121 echo "You don't have the full sem*(2) library." >&4
17127 : see whether sys/sem.h defines union semun
17129 $cat > try.c <<'END'
17130 #include <sys/types.h>
17131 #include <sys/ipc.h>
17132 #include <sys/sem.h>
17133 int main () { union semun semun; semun.buf = 0; }
17136 if eval $compile; then
17137 echo "You have union semun in <sys/sem.h>." >&4
17140 echo "You do not have union semun in <sys/sem.h>." >&4
17147 : see how to do semctl IPC_STAT
17151 $cat > tryh.h <<END
17154 # define S_IRUSR S_IREAD
17155 # define S_IWUSR S_IWRITE
17156 # define S_IXUSR S_IEXEC
17158 # define S_IRUSR 0400
17159 # define S_IWUSR 0200
17160 # define S_IXUSR 0100
17162 # define S_IRGRP (S_IRUSR>>3)
17163 # define S_IWGRP (S_IWUSR>>3)
17164 # define S_IXGRP (S_IXUSR>>3)
17165 # define S_IROTH (S_IRUSR>>6)
17166 # define S_IWOTH (S_IWUSR>>6)
17167 # define S_IXOTH (S_IXUSR>>6)
17170 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
17171 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
17172 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
17175 : see whether semctl IPC_STAT can use union semun
17176 case "$d_semctl_semun" in
17180 #include <sys/types.h>
17181 #include <sys/ipc.h>
17182 #include <sys/sem.h>
17183 #include <sys/stat.h>
17190 #$d_union_semun HAS_UNION_SEMUN
17193 #ifndef HAS_UNION_SEMUN
17196 struct semid_ds *buf;
17197 unsigned short *array;
17203 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
17204 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
17206 struct semid_ds argbuf;
17209 st = semctl(sem, 0, IPC_STAT, arg);
17213 # endif /* IPC_STAT */
17214 printf("semctl IPC_STAT failed: errno = %d\n", errno);
17216 if (semctl(sem, 0, IPC_RMID, arg) != 0)
17217 # endif /* IPC_RMID */
17218 printf("semctl IPC_RMID failed: errno = %d\n", errno);
17220 #endif /* IPC_PRIVATE && ... */
17221 printf("semget failed: errno = %d\n", errno);
17226 if eval $compile; then
17229 semun) val="$define" ;;
17237 case "$d_semctl_semun" in
17239 echo "You can use union semun for semctl IPC_STAT." >&4
17242 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
17247 : see whether semctl IPC_STAT can use struct semid_ds pointer
17248 case "$d_semctl_semid_ds" in
17251 $cat > try.c <<'END'
17252 #include <sys/types.h>
17253 #include <sys/ipc.h>
17254 #include <sys/sem.h>
17255 #include <sys/stat.h>
17263 struct semid_ds arg;
17266 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
17267 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
17270 st = semctl(sem, 0, IPC_STAT, &arg);
17272 printf("semid_ds\n");
17274 # endif /* IPC_STAT */
17275 printf("semctl IPC_STAT failed: errno = %d\n", errno);
17277 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
17278 # endif /* IPC_RMID */
17279 printf("semctl IPC_RMID failed: errno = %d\n", errno);
17281 #endif /* IPC_PRIVATE && ... */
17282 printf("semget failed: errno = %d\n", errno);
17288 if eval $compile; then
17291 semid_ds) val="$define" ;;
17295 set d_semctl_semid_ds
17299 case "$d_semctl_semid_ds" in
17301 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
17303 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
17309 # We do not have the full sem*(2) library, so assume we can not
17315 set d_semctl_semid_ds
17321 : see if sendmsg exists
17322 set sendmsg d_sendmsg
17325 : see if setegid exists
17326 set setegid d_setegid
17329 : see if seteuid exists
17330 set seteuid d_seteuid
17333 : see if setgrent exists
17334 set setgrent d_setgrent
17337 : see if setgrent_r exists
17338 set setgrent_r d_setgrent_r
17340 case "$d_setgrent_r" in
17342 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
17343 case "$d_setgrent_r_proto:$usethreads" in
17344 ":define") d_setgrent_r_proto=define
17345 set d_setgrent_r_proto setgrent_r $hdrs
17349 case "$d_setgrent_r_proto" in
17351 case "$setgrent_r_proto" in
17352 ''|0) try='int setgrent_r(FILE**);'
17353 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=I_H ;;
17355 case "$setgrent_r_proto" in
17356 ''|0) try='void setgrent_r(FILE**);'
17357 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=V_H ;;
17359 case "$setgrent_r_proto" in
17360 ''|0) d_setgrent_r=undef
17362 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
17363 * ) case "$setgrent_r_proto" in
17364 REENTRANT_PROTO*) ;;
17365 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
17367 echo "Prototype: $try" ;;
17370 *) case "$usethreads" in
17371 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
17378 *) setgrent_r_proto=0
17382 : see if sethostent exists
17383 set sethostent d_sethent
17386 : see if sethostent_r exists
17387 set sethostent_r d_sethostent_r
17389 case "$d_sethostent_r" in
17391 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17392 case "$d_sethostent_r_proto:$usethreads" in
17393 ":define") d_sethostent_r_proto=define
17394 set d_sethostent_r_proto sethostent_r $hdrs
17398 case "$d_sethostent_r_proto" in
17400 case "$sethostent_r_proto" in
17401 ''|0) try='int sethostent_r(int, struct hostent_data*);'
17402 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=I_ID ;;
17404 case "$sethostent_r_proto" in
17405 ''|0) try='void sethostent_r(int, struct hostent_data*);'
17406 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=V_ID ;;
17408 case "$sethostent_r_proto" in
17409 ''|0) d_sethostent_r=undef
17410 sethostent_r_proto=0
17411 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
17412 * ) case "$sethostent_r_proto" in
17413 REENTRANT_PROTO*) ;;
17414 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
17416 echo "Prototype: $try" ;;
17419 *) case "$usethreads" in
17420 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
17422 d_sethostent_r=undef
17423 sethostent_r_proto=0
17427 *) sethostent_r_proto=0
17431 : see if setitimer exists
17432 set setitimer d_setitimer
17435 : see if setlinebuf exists
17436 set setlinebuf d_setlinebuf
17439 : see if setlocale exists
17440 set setlocale d_setlocale
17443 : see if locale.h is available
17444 set locale.h i_locale
17447 : see if setlocale_r exists
17448 set setlocale_r d_setlocale_r
17450 case "$d_setlocale_r" in
17452 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
17453 case "$d_setlocale_r_proto:$usethreads" in
17454 ":define") d_setlocale_r_proto=define
17455 set d_setlocale_r_proto setlocale_r $hdrs
17459 case "$d_setlocale_r_proto" in
17461 case "$setlocale_r_proto" in
17462 ''|0) try='int setlocale_r(int, const char*, char*, int);'
17463 ./protochk "$extern_C $try" $hdrs && setlocale_r_proto=I_ICBI ;;
17465 case "$setlocale_r_proto" in
17466 ''|0) d_setlocale_r=undef
17467 setlocale_r_proto=0
17468 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
17469 * ) case "$setlocale_r_proto" in
17470 REENTRANT_PROTO*) ;;
17471 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
17473 echo "Prototype: $try" ;;
17476 *) case "$usethreads" in
17477 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
17479 d_setlocale_r=undef
17480 setlocale_r_proto=0
17484 *) setlocale_r_proto=0
17488 : see if setnetent exists
17489 set setnetent d_setnent
17492 : see if setnetent_r exists
17493 set setnetent_r d_setnetent_r
17495 case "$d_setnetent_r" in
17497 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17498 case "$d_setnetent_r_proto:$usethreads" in
17499 ":define") d_setnetent_r_proto=define
17500 set d_setnetent_r_proto setnetent_r $hdrs
17504 case "$d_setnetent_r_proto" in
17506 case "$setnetent_r_proto" in
17507 ''|0) try='int setnetent_r(int, struct netent_data*);'
17508 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=I_ID ;;
17510 case "$setnetent_r_proto" in
17511 ''|0) try='void setnetent_r(int, struct netent_data*);'
17512 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=V_ID ;;
17514 case "$setnetent_r_proto" in
17515 ''|0) d_setnetent_r=undef
17516 setnetent_r_proto=0
17517 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
17518 * ) case "$setnetent_r_proto" in
17519 REENTRANT_PROTO*) ;;
17520 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
17522 echo "Prototype: $try" ;;
17525 *) case "$usethreads" in
17526 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
17528 d_setnetent_r=undef
17529 setnetent_r_proto=0
17533 *) setnetent_r_proto=0
17537 : see if setprotoent exists
17538 set setprotoent d_setpent
17541 : see if setpgid exists
17542 set setpgid d_setpgid
17545 : see if setpgrp2 exists
17546 set setpgrp2 d_setpgrp2
17549 : see if setpriority exists
17550 set setpriority d_setprior
17553 : see if setproctitle exists
17554 set setproctitle d_setproctitle
17557 : see if setprotoent_r exists
17558 set setprotoent_r d_setprotoent_r
17560 case "$d_setprotoent_r" in
17562 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17563 case "$d_setprotoent_r_proto:$usethreads" in
17564 ":define") d_setprotoent_r_proto=define
17565 set d_setprotoent_r_proto setprotoent_r $hdrs
17569 case "$d_setprotoent_r_proto" in
17571 case "$setprotoent_r_proto" in
17572 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
17573 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=I_ID ;;
17575 case "$setprotoent_r_proto" in
17576 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
17577 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=V_ID ;;
17579 case "$setprotoent_r_proto" in
17580 ''|0) d_setprotoent_r=undef
17581 setprotoent_r_proto=0
17582 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
17583 * ) case "$setprotoent_r_proto" in
17584 REENTRANT_PROTO*) ;;
17585 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
17587 echo "Prototype: $try" ;;
17590 *) case "$usethreads" in
17591 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
17593 d_setprotoent_r=undef
17594 setprotoent_r_proto=0
17598 *) setprotoent_r_proto=0
17602 : see if setpwent exists
17603 set setpwent d_setpwent
17606 : see if setpwent_r exists
17607 set setpwent_r d_setpwent_r
17609 case "$d_setpwent_r" in
17611 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
17612 case "$d_setpwent_r_proto:$usethreads" in
17613 ":define") d_setpwent_r_proto=define
17614 set d_setpwent_r_proto setpwent_r $hdrs
17618 case "$d_setpwent_r_proto" in
17620 case "$setpwent_r_proto" in
17621 ''|0) try='int setpwent_r(FILE**);'
17622 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=I_H ;;
17624 case "$setpwent_r_proto" in
17625 ''|0) try='void setpwent_r(FILE**);'
17626 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=V_H ;;
17628 case "$setpwent_r_proto" in
17629 ''|0) d_setpwent_r=undef
17631 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
17632 * ) case "$setpwent_r_proto" in
17633 REENTRANT_PROTO*) ;;
17634 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
17636 echo "Prototype: $try" ;;
17639 *) case "$usethreads" in
17640 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
17647 *) setpwent_r_proto=0
17651 : see if setregid exists
17652 set setregid d_setregid
17654 set setresgid d_setresgid
17657 : see if setreuid exists
17658 set setreuid d_setreuid
17660 set setresuid d_setresuid
17663 : see if setrgid exists
17664 set setrgid d_setrgid
17667 : see if setruid exists
17668 set setruid d_setruid
17671 : see if setservent exists
17672 set setservent d_setsent
17675 : see if setservent_r exists
17676 set setservent_r d_setservent_r
17678 case "$d_setservent_r" in
17680 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17681 case "$d_setservent_r_proto:$usethreads" in
17682 ":define") d_setservent_r_proto=define
17683 set d_setservent_r_proto setservent_r $hdrs
17687 case "$d_setservent_r_proto" in
17689 case "$setservent_r_proto" in
17690 ''|0) try='int setservent_r(int, struct servent_data*);'
17691 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=I_ID ;;
17693 case "$setservent_r_proto" in
17694 ''|0) try='void setservent_r(int, struct servent_data*);'
17695 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=V_ID ;;
17697 case "$setservent_r_proto" in
17698 ''|0) d_setservent_r=undef
17699 setservent_r_proto=0
17700 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
17701 * ) case "$setservent_r_proto" in
17702 REENTRANT_PROTO*) ;;
17703 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
17705 echo "Prototype: $try" ;;
17708 *) case "$usethreads" in
17709 define) echo "setservent_r has no prototype, not using it." >&4 ;;
17711 d_setservent_r=undef
17712 setservent_r_proto=0
17716 *) setservent_r_proto=0
17720 : see if setsid exists
17721 set setsid d_setsid
17724 : see if setvbuf exists
17725 set setvbuf d_setvbuf
17728 : see if shmctl exists
17729 set shmctl d_shmctl
17732 : see if shmget exists
17733 set shmget d_shmget
17736 : see if shmat exists
17739 : see what shmat returns
17742 $cat >shmat.c <<'END'
17743 #include <sys/shm.h>
17746 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
17751 echo "and it returns ($shmattype)." >&4
17752 : see if a prototype for shmat is available
17753 xxx=`./findhdr sys/shm.h`
17754 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
17755 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
17766 set d_shmatprototype
17769 : see if shmdt exists
17773 : see how much of the 'shm*(2)' library is present.
17776 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
17777 *"$undef"*) h_shm=false;;
17781 case "`ipcs 2>&1`" in
17782 "SVID shared memory"*"not configured"*)
17783 echo "Your $osname does not have the shm*(2) configured." >&4
17786 set shmctl d_shmctl
17788 set shmget d_shmget
17798 : we could also check for sys/ipc.h ...
17799 if $h_shm && $test `./findhdr sys/shm.h`; then
17800 echo "You have the full shm*(2) library." >&4
17803 echo "You don't have the full shm*(2) library." >&4
17809 : see if we have sigaction
17811 if set sigaction val -f d_sigaction; eval $csym; $val; then
17812 echo 'sigaction() found.' >&4
17815 #include <sys/types.h>
17816 #include <signal.h>
17817 #$i_stdlib I_STDLIB
17819 #include <stdlib.h>
17823 struct sigaction act, oact;
17825 oact.sa_handler = 0;
17826 /* so that act and oact are used */
17827 exit(act.sa_flags == 0 && oact.sa_handler == 0);
17831 if eval $compile_ok; then
17834 echo "But you don't seem to have a usable struct sigaction." >&4
17838 echo 'sigaction NOT found.' >&4
17841 set d_sigaction; eval $setvar
17844 : see if this is a sunmath.h system
17845 set sunmath.h i_sunmath
17848 : see if signbit exists
17849 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
17852 #$i_sunmath I_SUNMATH
17856 #ifdef I_SUNMATH /* Solaris special math library */
17857 # include <sunmath.h>
17860 int main(int argc, char **argv)
17864 if ((signbit(x) == 0) && (signbit(y) != 0))
17872 if eval $compile; then
17873 if $run ./try; then
17877 $echo "Signbit seems to be available, but doesn't work as I expected."
17878 $echo "I won't use it." >&4
17889 : see if sigprocmask exists
17890 set sigprocmask d_sigprocmask
17893 : see if sigsetjmp exists
17895 case "$d_sigsetjmp" in
17898 #include <setjmp.h>
17899 #$i_stdlib I_STDLIB
17901 #include <stdlib.h>
17907 if (sigsetjmp(env,1))
17910 siglongjmp(env, 1);
17915 if eval $compile; then
17916 if $run ./try >/dev/null 2>&1; then
17917 echo "POSIX sigsetjmp found." >&4
17921 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
17927 echo "sigsetjmp not found." >&4
17931 *) val="$d_sigsetjmp"
17932 case "$d_sigsetjmp" in
17933 $define) echo "POSIX sigsetjmp found." >&4;;
17934 $undef) echo "sigsetjmp not found." >&4;;
17942 : see if snprintf exists
17943 set snprintf d_snprintf
17946 : see if vsnprintf exists
17947 set vsnprintf d_vsnprintf
17950 case "$d_snprintf-$d_vsnprintf" in
17953 Checking whether your snprintf() and vsnprintf() work okay...
17955 $cat >try.c <<'EOCP'
17956 /* v?snprintf testing logic courtesy of Russ Allbery.
17957 * According to C99:
17958 * - if the buffer is too short it still must be \0-terminated
17959 * - if the buffer is too short the potentially required length
17960 * must be returned and not -1
17961 * - if the buffer is NULL the potentially required length
17962 * must be returned and not -1 or core dump
17965 #include <stdarg.h>
17969 int test (char *format, ...)
17974 va_start (args, format);
17975 count = vsnprintf (buf, sizeof buf, format, args);
17982 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
17983 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
17987 if eval $compile; then
17990 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
17992 Your snprintf() and snprintf() don't seem to be working okay.
17994 d_snprintf="$undef"
17995 d_vsnprintf="$undef"
17999 echo "(I can't seem to compile the test program--assuming they don't)"
18000 d_snprintf="$undef"
18001 d_vsnprintf="$undef"
18007 : see if sockatmark exists
18008 set sockatmark d_sockatmark
18011 : see if prototype for sockatmark is available
18013 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
18016 : see if socks5_init exists
18017 set socks5_init d_socks5_init
18020 : see if sprintf returns the length of the string in the buffer as per ANSI
18021 $echo "Checking whether sprintf returns the length of the string..." >&4
18024 #$i_stdlib I_STDLIB
18026 #include <stdlib.h>
18028 #$i_string I_STRING
18030 # include <string.h>
18032 # include <strings.h>
18041 int check (size_t expect, int test) {
18042 size_t got = strlen(buffer);
18046 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
18051 int main(int argc, char **argv) {
18054 check(sprintf(buffer, ""), ++test);
18055 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
18056 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
18063 if eval $compile; then
18067 sprintf returns the length of the string (as ANSI says it should)
18069 d_sprintf_returns_strlen="$define"
18072 sprintf does not return the length of the string (how old is this system?)
18074 d_sprintf_returns_strlen="$undef"
18078 echo "(I can't seem to compile the test program--assuming it doesn't)" >&4
18079 d_sprintf_returns_strlen="$undef"
18083 : see if srand48_r exists
18084 set srand48_r d_srand48_r
18086 case "$d_srand48_r" in
18088 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
18089 case "$d_srand48_r_proto:$usethreads" in
18090 ":define") d_srand48_r_proto=define
18091 set d_srand48_r_proto srand48_r $hdrs
18095 case "$d_srand48_r_proto" in
18097 case "$srand48_r_proto" in
18098 ''|0) try='int srand48_r(long, struct drand48_data*);'
18099 ./protochk "$extern_C $try" $hdrs && srand48_r_proto=I_LS ;;
18101 case "$srand48_r_proto" in
18102 ''|0) d_srand48_r=undef
18104 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
18105 * ) case "$srand48_r_proto" in
18106 REENTRANT_PROTO*) ;;
18107 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
18109 echo "Prototype: $try" ;;
18112 *) case "$usethreads" in
18113 define) echo "srand48_r has no prototype, not using it." >&4 ;;
18120 *) srand48_r_proto=0
18124 : see if srandom_r exists
18125 set srandom_r d_srandom_r
18127 case "$d_srandom_r" in
18129 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
18130 case "$d_srandom_r_proto:$usethreads" in
18131 ":define") d_srandom_r_proto=define
18132 set d_srandom_r_proto srandom_r $hdrs
18136 case "$d_srandom_r_proto" in
18138 case "$srandom_r_proto" in
18139 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
18140 ./protochk "$extern_C $try" $hdrs && srandom_r_proto=I_TS ;;
18142 case "$srandom_r_proto" in
18143 ''|0) d_srandom_r=undef
18145 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
18146 * ) case "$srandom_r_proto" in
18147 REENTRANT_PROTO*) ;;
18148 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
18150 echo "Prototype: $try" ;;
18153 *) case "$usethreads" in
18154 define) echo "srandom_r has no prototype, not using it." >&4 ;;
18161 *) srandom_r_proto=0
18165 : see if prototype for setresgid is available
18167 set d_sresgproto setresgid $i_unistd unistd.h
18170 : see if prototype for setresuid is available
18172 set d_sresuproto setresuid $i_unistd unistd.h
18175 : see if sys/stat.h is available
18176 set sys/stat.h i_sysstat
18179 : see if stat knows about block sizes
18181 echo "Checking to see if your struct stat has st_blocks field..." >&4
18182 set d_statblks stat st_blocks $i_sysstat sys/stat.h
18185 : see if this is a sys/vfs.h system
18186 set sys/vfs.h i_sysvfs
18189 : see if this is a sys/statfs.h system
18190 set sys/statfs.h i_sysstatfs
18193 : Check for statfs_s
18195 echo "Checking to see if your system supports struct statfs..." >&4
18196 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
18198 case "$d_statfs_s" in
18199 "$define") echo "Yes, it does." ;;
18200 *) echo "No, it doesn't." ;;
18204 : see if struct statfs knows about f_flags
18205 case "$d_statfs_s" in
18208 echo "Checking to see if your struct statfs has f_flags field..." >&4
18209 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
18213 set d_statfs_f_flags
18217 case "$d_statfs_f_flags" in
18218 "$define") echo "Yes, it does." ;;
18219 *) echo "No, it doesn't." ;;
18222 : see what flavor, if any, of static inline is supported
18224 echo "Checking to see if your system supports static inline..."
18225 $cat > try.c <<'EOCP'
18226 #include <stdlib.h>
18227 extern int f_via_a(int x);
18228 extern int f_via_b(int x);
18229 int main(int argc, char **argv)
18238 return EXIT_SUCCESS;
18241 return EXIT_FAILURE;
18245 $cat > a.c <<'EOCP'
18246 static INLINE int f(int x) {
18257 $cat > b.c <<'EOCP'
18258 extern int f(int x);
18266 # Respect a hint (or previous) value for perl_static_inline, if there is one.
18267 case "$perl_static_inline" in
18268 '') # Check the various possibilities, and break out on success.
18269 # For gcc, prefer __inline__, which will still permit
18270 # cflags.SH to add in -ansi.
18271 case "$gccversion" in
18272 '') xxx="inline __inline__ __inline _inline";;
18273 *) xxx="__inline__ inline __inline _inline";;
18275 for inline in $xxx; do
18276 set try -DINLINE=$inline a.c
18277 if eval $compile && $run ./try; then
18278 # Now make sure there is no external linkage of static
18280 set try -DINLINE=$inline -DUSE_B a.c b.c
18281 if eval $compile && $run ./try; then
18282 $echo "Your compiler supports static $inline, " >&4
18283 $echo "but it also creates an external definition," >&4
18284 $echo "so I won't use it." >&4
18287 $echo "Your compiler supports static $inline." >&4
18289 perl_static_inline="static $inline";
18293 $echo "Your compiler does NOT support static $inline." >&4
18298 *inline*) # Some variant of inline exists.
18299 echo "Keeping your $hint value of $perl_static_inline."
18302 static) # No inline capabilities
18303 echo "Keeping your $hint value of $perl_static_inline."
18306 *) # Unrecognized previous value -- blindly trust the supplied
18307 # value and hope it makes sense. Use old value for
18308 # d_static_inline, if there is one.
18309 echo "Keeping your $hint value of $perl_static_inline."
18310 case "$d_static_inline" in
18312 *) val=$d_static_inline ;;
18316 # Fallback to plain 'static' if nothing worked.
18317 case "$perl_static_inline" in
18319 perl_static_inline="static"
18323 set d_static_inline
18325 $rm -f a.[co] b.[co]
18328 : Check stream access
18330 Checking how to access stdio streams by file descriptor number...
18332 case "$stdio_stream_array" in
18333 '') $cat >try.c <<EOCP
18336 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
18340 for s in _iob __iob __sF
18342 set try -DSTDIO_STREAM_ARRAY=$s
18343 if eval $compile; then
18344 case "`$run ./try`" in
18345 yes) stdio_stream_array=$s; break ;;
18351 case "$stdio_stream_array" in
18353 I can't figure out how to access stdio streams by file descriptor number.
18355 d_stdio_stream_array="$undef"
18358 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
18360 d_stdio_stream_array="$define"
18364 : see if strcoll exists
18365 set strcoll d_strcoll
18368 : check for structure copying
18370 echo "Checking to see if your C compiler can copy structs..." >&4
18371 $cat >try.c <<'EOCP'
18381 if $cc -c try.c >/dev/null 2>&1 ; then
18383 echo "Yup, it can."
18386 echo "Nope, it can't."
18392 : see if strerror and/or sys_errlist[] exist
18394 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
18395 if set strerror val -f d_strerror; eval $csym; $val; then
18396 echo 'strerror() found.' >&4
18397 d_strerror="$define"
18398 d_strerrm='strerror(e)'
18399 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18400 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
18401 d_syserrlst="$define"
18403 echo "(Since you don't have sys_errlist[], strerror() is welcome.)"
18404 d_syserrlst="$undef"
18406 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
18407 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
18408 echo 'strerror() found in string header.' >&4
18409 d_strerror="$define"
18410 d_strerrm='strerror(e)'
18411 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18412 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
18413 d_syserrlst="$define"
18415 echo "(You don't appear to have any sys_errlist[], how can this be?)"
18416 d_syserrlst="$undef"
18418 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18419 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
18420 d_strerror="$undef"
18421 d_syserrlst="$define"
18422 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
18424 echo 'strerror() and sys_errlist[] NOT found.' >&4
18425 d_strerror="$undef"
18426 d_syserrlst="$undef"
18427 d_strerrm='"unknown"'
18431 : see if strerror_r exists
18432 set strerror_r d_strerror_r
18434 case "$d_strerror_r" in
18436 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
18437 case "$d_strerror_r_proto:$usethreads" in
18438 ":define") d_strerror_r_proto=define
18439 set d_strerror_r_proto strerror_r $hdrs
18443 case "$d_strerror_r_proto" in
18445 case "$strerror_r_proto" in
18446 ''|0) try='int strerror_r(int, char*, size_t);'
18447 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBW ;;
18449 case "$strerror_r_proto" in
18450 ''|0) try='int strerror_r(int, char*, int);'
18451 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBI ;;
18453 case "$strerror_r_proto" in
18454 ''|0) try='char* strerror_r(int, char*, size_t);'
18455 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=B_IBW ;;
18457 case "$strerror_r_proto" in
18458 ''|0) d_strerror_r=undef
18460 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
18461 * ) case "$strerror_r_proto" in
18462 REENTRANT_PROTO*) ;;
18463 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
18465 echo "Prototype: $try" ;;
18468 *) case "$usethreads" in
18469 define) echo "strerror_r has no prototype, not using it." >&4 ;;
18476 *) strerror_r_proto=0
18480 : see if strftime exists
18481 set strftime d_strftime
18484 : see if strlcat exists
18485 set strlcat d_strlcat
18488 : see if strlcpy exists
18489 set strlcpy d_strlcpy
18492 : see if strtod exists
18493 set strtod d_strtod
18496 : see if strtol exists
18497 set strtol d_strtol
18500 : see if strtold exists
18501 set strtold d_strtold
18504 : see if strtoll exists
18505 set strtoll d_strtoll
18508 case "$d_longlong-$d_strtoll" in
18511 Checking whether your strtoll() works okay...
18513 $cat >try.c <<'EOCP'
18516 #define strtoll __strtoll
18519 #define strtoll _strtoll
18522 extern long long int strtoll(char *s, char **, int);
18523 static int bad = 0;
18524 int check(char *s, long long ell, int een) {
18527 gll = strtoll(s, 0, 10);
18528 if (!((gll == ell) && (errno == een)))
18532 check(" 1", 1LL, 0);
18533 check(" 0", 0LL, 0);
18534 check("-1", -1LL, 0);
18535 check("-9223372036854775808", -9223372036854775808LL, 0);
18536 check("-9223372036854775808", -9223372036854775808LL, 0);
18537 check(" 9223372036854775807", 9223372036854775807LL, 0);
18538 check("-9223372036854775808", -9223372036854775808LL, 0);
18539 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
18540 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
18546 if eval $compile; then
18549 ok) echo "Your strtoll() seems to be working okay." ;;
18551 Your strtoll() doesn't seem to be working okay.
18557 echo "(I can't seem to compile the test program--assuming it doesn't)"
18563 : see if strtoq exists
18564 set strtoq d_strtoq
18567 : see if strtoul exists
18568 set strtoul d_strtoul
18571 case "$d_strtoul" in
18574 Checking whether your strtoul() works okay...
18576 $cat >try.c <<'EOCP'
18579 extern unsigned long int strtoul(char *s, char **, int);
18580 static int bad = 0;
18581 void check(char *s, unsigned long eul, int een) {
18584 gul = strtoul(s, 0, 10);
18585 if (!((gul == eul) && (errno == een)))
18589 check(" 1", 1L, 0);
18590 check(" 0", 0L, 0);
18592 case "$longsize" in
18594 $cat >>try.c <<'EOCP'
18595 check("18446744073709551615", 18446744073709551615UL, 0);
18596 check("18446744073709551616", 18446744073709551615UL, ERANGE);
18597 #if 0 /* strtoul() for /^-/ strings is undefined. */
18598 check("-1", 18446744073709551615UL, 0);
18599 check("-18446744073709551614", 2, 0);
18600 check("-18446744073709551615", 1, 0);
18601 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
18602 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
18607 $cat >>try.c <<'EOCP'
18608 check("4294967295", 4294967295UL, 0);
18609 check("4294967296", 4294967295UL, ERANGE);
18610 #if 0 /* strtoul() for /^-/ strings is undefined. */
18611 check("-1", 4294967295UL, 0);
18612 check("-4294967294", 2, 0);
18613 check("-4294967295", 1, 0);
18614 check("-4294967296", 4294967295UL, ERANGE);
18615 check("-4294967297", 4294967295UL, ERANGE);
18620 : Should we write these tests to be more portable by sprintf-ing
18621 : ~0 and then manipulating that char string as input for strtol?
18624 $cat >>try.c <<'EOCP'
18631 if eval $compile; then
18632 case "`$run ./try`" in
18633 ok) echo "Your strtoul() seems to be working okay." ;;
18635 Your strtoul() doesn't seem to be working okay.
18641 echo "(I can't seem to compile the test program--assuming it doesn't)"
18647 : see if strtoull exists
18648 set strtoull d_strtoull
18651 case "$d_longlong-$d_strtoull" in
18654 Checking whether your strtoull() works okay...
18656 $cat >try.c <<'EOCP'
18659 #define strtoull __strtoull
18662 extern unsigned long long int strtoull(char *s, char **, int);
18663 static int bad = 0;
18664 int check(char *s, long long eull, int een) {
18667 gull = strtoull(s, 0, 10);
18668 if (!((gull == eull) && (errno == een)))
18672 check(" 1", 1LL, 0);
18673 check(" 0", 0LL, 0);
18674 check("18446744073709551615", 18446744073709551615ULL, 0);
18675 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18676 #if 0 /* strtoull() for /^-/ strings is undefined. */
18677 check("-1", 18446744073709551615ULL, 0);
18678 check("-18446744073709551614", 2LL, 0);
18679 check("-18446744073709551615", 1LL, 0);
18680 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18681 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18688 if eval $compile; then
18689 case "`$run ./try`" in
18690 ok) echo "Your strtoull() seems to be working okay." ;;
18692 Your strtoull() doesn't seem to be working okay.
18694 d_strtoull="$undef"
18698 echo "(I can't seem to compile the test program--assuming it doesn't)"
18699 d_strtoull="$undef"
18704 : see if strtouq exists
18705 set strtouq d_strtouq
18708 case "$d_strtouq" in
18711 Checking whether your strtouq() works okay...
18713 $cat >try.c <<'EOCP'
18716 extern unsigned long long int strtouq(char *s, char **, int);
18717 static int bad = 0;
18718 void check(char *s, unsigned long long eull, int een) {
18719 unsigned long long gull;
18721 gull = strtouq(s, 0, 10);
18722 if (!((gull == eull) && (errno == een)))
18726 check(" 1", 1LL, 0);
18727 check(" 0", 0LL, 0);
18728 check("18446744073709551615", 18446744073709551615ULL, 0);
18729 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18730 #if 0 /* strtouq() for /^-/ strings is undefined. */
18731 check("-1", 18446744073709551615ULL, 0);
18732 check("-18446744073709551614", 2LL, 0);
18733 check("-18446744073709551615", 1LL, 0);
18734 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18735 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18743 if eval $compile; then
18744 case "`$run ./try`" in
18745 ok) echo "Your strtouq() seems to be working okay." ;;
18747 Your strtouq() doesn't seem to be working okay.
18753 echo "(I can't seem to compile the test program--assuming it doesn't)"
18759 : see if strxfrm exists
18760 set strxfrm d_strxfrm
18763 : see if symlink exists
18764 set symlink d_symlink
18767 : see if syscall exists
18768 set syscall d_syscall
18771 : see if prototype for syscall is available
18773 set d_syscallproto syscall $i_unistd unistd.h
18776 : see if sysconf exists
18777 set sysconf d_sysconf
18780 : see if system exists
18781 set system d_system
18784 : see if tcgetpgrp exists
18785 set tcgetpgrp d_tcgetpgrp
18788 : see if tcsetpgrp exists
18789 set tcsetpgrp d_tcsetpgrp
18792 : see if prototype for telldir is available
18794 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
18797 : see if time exists
18799 if test "X$d_time" = X -o X"$timetype" = X; then
18800 if set time val -f d_time; eval $csym; $val; then
18801 echo 'time() found.' >&4
18803 rp="What is the type returned by time() on this system?"
18804 set time_t timetype long stdio.h sys/types.h
18807 echo 'time() not found, hope that will do.' >&4
18815 : see if timegm exists
18816 set timegm d_timegm
18819 : see if this is a sys/times.h system
18820 set sys/times.h i_systimes
18823 : see if times exists
18825 if set times val -f d_times; eval $csym; $val; then
18826 echo 'times() found.' >&4
18829 case "$i_systimes" in
18830 "$define") inc='sys/times.h';;
18832 rp="What is the type returned by times() on this system?"
18833 set clock_t clocktype long stdio.h sys/types.h $inc
18836 echo 'times() NOT found, hope that will do.' >&4
18841 : see if tmpnam_r exists
18842 set tmpnam_r d_tmpnam_r
18844 case "$d_tmpnam_r" in
18846 hdrs="$i_systypes sys/types.h define stdio.h "
18847 case "$d_tmpnam_r_proto:$usethreads" in
18848 ":define") d_tmpnam_r_proto=define
18849 set d_tmpnam_r_proto tmpnam_r $hdrs
18853 case "$d_tmpnam_r_proto" in
18855 case "$tmpnam_r_proto" in
18856 ''|0) try='char* tmpnam_r(char*);'
18857 ./protochk "$extern_C $try" $hdrs && tmpnam_r_proto=B_B ;;
18859 case "$tmpnam_r_proto" in
18860 ''|0) d_tmpnam_r=undef
18862 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
18863 * ) case "$tmpnam_r_proto" in
18864 REENTRANT_PROTO*) ;;
18865 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
18867 echo "Prototype: $try" ;;
18870 *) case "$usethreads" in
18871 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
18878 *) tmpnam_r_proto=0
18882 : see if truncate exists
18883 set truncate d_truncate
18886 : see if ttyname_r exists
18887 set ttyname_r d_ttyname_r
18889 case "$d_ttyname_r" in
18891 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
18892 case "$d_ttyname_r_proto:$usethreads" in
18893 ":define") d_ttyname_r_proto=define
18894 set d_ttyname_r_proto ttyname_r $hdrs
18898 case "$d_ttyname_r_proto" in
18900 case "$ttyname_r_proto" in
18901 ''|0) try='int ttyname_r(int, char*, size_t);'
18902 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBW ;;
18904 case "$ttyname_r_proto" in
18905 ''|0) try='int ttyname_r(int, char*, int);'
18906 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBI ;;
18908 case "$ttyname_r_proto" in
18909 ''|0) try='char* ttyname_r(int, char*, int);'
18910 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=B_IBI ;;
18912 case "$ttyname_r_proto" in
18913 ''|0) d_ttyname_r=undef
18915 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
18916 * ) case "$ttyname_r_proto" in
18917 REENTRANT_PROTO*) ;;
18918 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
18920 echo "Prototype: $try" ;;
18923 *) case "$usethreads" in
18924 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
18931 *) ttyname_r_proto=0
18935 : see if tzname[] exists
18937 if set tzname val -a d_tzname; eval $csym; $val; then
18939 echo 'tzname[] found.' >&4
18942 echo 'tzname[] NOT found.' >&4
18947 : Check if is a multiplatform env
18949 next|darwin) multiarch="$define" ;;
18951 case "$multiarch" in
18952 ''|[nN]*) multiarch="$undef" ;;
18955 : check for ordering of bytes in a UV
18957 case "$multiarch" in
18960 You seem to be doing a multiarchitecture build,
18961 skipping the byteorder check.
18967 case "$byteorder" in
18970 In the following, larger digits indicate more significance. A big-endian
18971 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
18972 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
18973 machines may have weird orders like 3412. A Cray will report 87654321,
18974 an Alpha will report 12345678. If the test program works the default is
18976 I'm now running the test program...
18980 #$i_stdlib I_STDLIB
18982 #include <stdlib.h>
18984 #include <sys/types.h>
18985 typedef $uvtype UV;
18995 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
18997 u.l = (UV)0x04030201;
18998 for (i = 0; i < $uvsize; i++)
18999 printf("%c", u.c[i]+'0');
19006 if eval $compile && $run ./try > /dev/null; then
19009 [1-4][1-4][1-4][1-4]|12345678|87654321)
19010 echo "(The test program ran ok.)"
19011 echo "byteorder=$dflt"
19014 ????|????????) echo "(The test program ran ok.)" ;;
19015 *) echo "(The test program didn't run right for some reason.)" ;;
19020 (I can't seem to compile the test program. Guessing big-endian...)
19023 case "$xxx_prompt" in
19025 rp="What is the order of bytes in $uvtype?"
19038 : Checking 32bit alignedness
19041 Checking to see whether you can access character data unalignedly...
19043 case "$d_u32align" in
19044 '') $cat >try.c <<EOCP
19046 #$i_stdlib I_STDLIB
19048 #include <stdlib.h>
19050 #define U32 $u32type
19051 #define BYTEORDER 0x$byteorder
19053 #include <signal.h>
19055 $signal_t bletch(int s) { exit(4); }
19058 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
19059 volatile U8 buf[8];
19063 if (sizeof(U32) != 4) {
19064 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
19071 signal(SIGBUS, bletch);
19083 for (i = 0; i < 4; i++) {
19084 up = (U32*)(buf + i);
19085 if (! ((*up == 1 << (8*i)) || /* big-endian */
19086 (*up == 1 << (8*(3-i))) /* little-endian */
19090 printf("read failed (%x)\n", *up);
19096 for (i = 0; i < 4; i++) {
19097 up = (U32*)(buf + i);
19099 if (*up != 0xBeef) {
19100 printf("write failed (%x)\n", *up);
19114 if eval $compile_ok; then
19115 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
19116 $run ./try 2>&1 >/dev/null
19119 You can access character data pretty unalignedly.
19121 d_u32align="$undef"
19124 It seems that you must access character data in an aligned manner.
19126 d_u32align="$define"
19130 rp='Can you access character data at unaligned addresses?'
19134 [yY]*) d_u32align="$undef" ;;
19135 *) d_u32align="$define" ;;
19142 : see if ualarm exists
19143 set ualarm d_ualarm
19146 : see if umask exists
19150 : see if unordered exists
19151 set unordered d_unordered
19154 : see if unsetenv exists
19155 set unsetenv d_unsetenv
19158 : see if usleep exists
19159 set usleep d_usleep
19162 : see if prototype for usleep is available
19164 set d_usleepproto usleep $i_unistd unistd.h
19167 : see if ustat exists
19171 : see if closedir exists
19172 set closedir d_closedir
19175 case "$d_closedir" in
19178 echo "Checking whether closedir() returns a status..." >&4
19180 #$i_dirent I_DIRENT /**/
19181 #$i_sysdir I_SYS_DIR /**/
19182 #$i_sysndir I_SYS_NDIR /**/
19183 #$i_systypes I_SYS_TYPES /**/
19185 #if defined(I_SYS_TYPES)
19186 #include <sys/types.h>
19188 #if defined(I_DIRENT)
19189 #include <dirent.h>
19190 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
19191 #include <sys/dir.h>
19195 #include <sys/ndir.h>
19199 #include <ndir.h> /* may be wrong in the future */
19201 #include <sys/dir.h>
19206 int main() { return closedir(opendir(".")); }
19209 if eval $compile_ok; then
19210 if $run ./try > /dev/null 2>&1 ; then
19211 echo "Yes, it does."
19214 echo "No, it doesn't."
19218 echo "(I can't seem to compile the test program--assuming it doesn't)"
19226 set d_void_closedir
19230 : see if there is a wait4
19234 : see if waitpid exists
19235 set waitpid d_waitpid
19240 $cat >try.c <<'EOCP'
19246 return (wcscmp (s, s) ? 1 : 0);
19251 if eval $compile; then
19254 0) echo "A working wcscmp() found." >&4
19256 *) echo "wcscmp() found, but it doesn't work" >&4
19260 echo "wcscmp() NOT found." >&4
19266 : see if wcstombs exists
19267 set wcstombs d_wcstombs
19272 $cat >try.c <<'EOCP'
19277 wchar_t dst[4], *src = L" ";
19279 return (wcsxfrm (dst, src, 1) ? errno ? errno : 0 : 1);
19284 if eval $compile; then
19287 0) echo "A working wcsxfrm() found." >&4
19289 *) echo "wcsxfrm() found, but it doesn't work" >&4
19293 echo "wcsxfrm() NOT found." >&4
19299 : see if wctomb exists
19300 set wctomb d_wctomb
19303 : see if writev exists
19304 set writev d_writev
19307 : check for alignment requirements
19309 case "$alignbytes" in
19310 '') echo "Checking alignment constraints..." >&4
19311 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
19312 $cat >try.c <<'EOCP'
19313 typedef long double NV;
19316 $cat >try.c <<'EOCP'
19320 $cat >>try.c <<'EOCP'
19328 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
19333 if eval $compile_ok; then
19337 echo "(I can't seem to compile the test program...)"
19339 case "$multiarch" in
19341 : The usual safe value is 8, but Darwin with -Duselongdouble
19342 : needs 16. Hence, we will take 8 as a minimum, but allow
19343 : Configure to pick a larger value if needed.
19344 if $test "$dflt" -lt 8; then
19346 echo "Setting alignment to 8 for multiarch support.">&4
19351 *) dflt="$alignbytes"
19354 rp="Doubles must be aligned on a how-many-byte boundary?"
19359 : set the base revision
19362 : length of character in bytes. Is always 1, otherwise it is not C
19363 : This used to be a test using sizeof
19366 : Check for the number of bits in a character
19367 case "$charbits" in
19368 '') echo "Checking how long a character is (in bits)..." >&4
19375 for (c = 1, n = 0; c; c <<= 1, n++) ;
19376 printf ("%d\n", n);
19381 if eval $compile_ok; then
19385 echo "(I can't seem to compile the test program. Guessing...)"
19392 rp="What is the length of a character (in bits)?"
19396 case "$charbits" in
19399 Your system has an unsigned character size of $charbits bits, which
19400 is rather unusual (normally it is 8 bits). Perl likely will not work
19401 correctly on your system, with subtle bugs in various places.
19403 rp='Do you really want to continue?'
19407 [yY]) echo >&4 "Okay, continuing." ;;
19412 : how do we concatenate cpp tokens here?
19414 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
19415 $cat >cpp_stuff.c <<'EOCP'
19416 #define RCAT(a,b)a/**/b
19417 #define ACAT(a,b)a ## b
19421 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
19422 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
19423 echo "Oh! Smells like ANSI's been here." >&4
19424 echo "We can catify or stringify, separately or together!"
19426 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
19427 echo "Ah, yes! The good old days!" >&4
19428 echo "However, in the good old days we don't know how to stringify and"
19429 echo "catify at the same time."
19433 Hmm, I don't seem to be able to concatenate tokens with your cpp.
19434 You're going to have to edit the values of CAT[2-5] in config.h...
19436 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
19440 : see if this is a db.h system
19446 : Check db version.
19448 echo "Checking Berkeley DB version ..." >&4
19454 #include <sys/types.h>
19456 #$i_stdlib I_STDLIB
19458 #include <stdlib.h>
19461 int main(int argc, char *argv[])
19463 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
19464 int Major, Minor, Patch ;
19465 unsigned long Version ;
19466 (void)db_version(&Major, &Minor, &Patch) ;
19468 printf("%d %d %d %d %d %d\n",
19469 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
19470 Major, Minor, Patch);
19473 printf("You have Berkeley DB Version 2 or greater.\n");
19475 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
19476 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
19477 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
19478 Major, Minor, Patch) ;
19480 /* check that db.h & libdb are compatible */
19481 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
19482 printf("db.h and libdb are incompatible.\n") ;
19486 printf("db.h and libdb are compatible.\n") ;
19488 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
19489 + DB_VERSION_PATCH ;
19491 /* needs to be >= 2.3.4 */
19492 if (Version < 2003004) {
19493 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
19494 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
19500 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
19505 printf("You have Berkeley DB Version 1.\n");
19506 exit(0); /* DB version < 2: the coast is clear. */
19508 exit(1); /* <db.h> not Berkeley DB? */
19514 if eval $compile_ok && $run ./try; then
19515 echo 'Looks OK.' >&4
19517 db_version_major=$1
19518 db_version_minor=$2
19519 db_version_patch=$3
19521 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
19525 : Remove db from list of libraries to use
19526 echo "Removing unusable -ldb from library list" >&4
19527 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
19530 echo "libs = $libs" >&4
19540 : Check the return type needed for hash
19542 echo "Checking return type needed for hash for Berkeley DB ..." >&4
19548 #include <sys/types.h>
19551 #ifndef DB_VERSION_MAJOR
19552 u_int32_t hash_cb (ptr, size)
19560 info.hash = hash_cb;
19564 if $cc $ccflags -c try.c >try.out 2>&1 ; then
19565 if $contains warning try.out >>/dev/null 2>&1 ; then
19568 db_hashtype='u_int32_t'
19571 : XXX Maybe we should just give up here.
19572 db_hashtype=u_int32_t
19574 echo "Help: I can't seem to compile the db test program." >&4
19575 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
19578 echo "Your version of Berkeley DB uses $db_hashtype for hash."
19580 *) db_hashtype=u_int32_t
19585 : Check the return type needed for prefix
19587 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
19593 #include <sys/types.h>
19596 #ifndef DB_VERSION_MAJOR
19597 size_t prefix_cb (key1, key2)
19605 info.prefix = prefix_cb;
19609 if $cc $ccflags -c try.c >try.out 2>&1 ; then
19610 if $contains warning try.out >>/dev/null 2>&1 ; then
19611 db_prefixtype='int'
19613 db_prefixtype='size_t'
19616 db_prefixtype='size_t'
19617 : XXX Maybe we should just give up here.
19619 echo "Help: I can't seem to compile the db test program." >&4
19620 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
19623 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
19625 *) db_prefixtype='size_t'
19629 : How can we generate normalized random numbers ?
19631 echo "Using our internal random number implementation..." >&4
19634 *-Dmy_rand=*|*-Dmy_srand=*)
19635 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
19636 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
19637 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
19638 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
19642 randfunc=Perl_drand48
19643 drand01="Perl_drand48()"
19644 seedfunc="Perl_drand48_init"
19648 : Determine if this is an EBCDIC system
19650 echo "Determining whether or not we are on an EBCDIC system..." >&4
19651 $cat >try.c <<'EOM'
19654 if ('M'==0xd4) return 0;
19661 if eval $compile_ok; then
19662 if $run ./try; then
19663 echo "You seem to speak EBCDIC." >&4
19666 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
19669 echo "I'm unable to compile the test program." >&4
19670 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
19676 : Check how to flush
19679 Checking how to flush all pending stdio output...
19681 # I only know how to find the first 32 possibly open files on SunOS.
19682 # See also hints/sunos_4_1.sh and util.c --AD
19684 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
19686 $cat >>try.c <<EOCP
19688 #$i_stdlib I_STDLIB
19690 #include <stdlib.h>
19692 #$i_unistd I_UNISTD
19694 # include <unistd.h>
19696 #$d_sysconf HAS_SYSCONF
19697 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
19698 #ifdef HAS_STDIO_STREAM_ARRAY
19699 # define STDIO_STREAM_ARRAY $stdio_stream_array
19704 p = fopen("try.out", "w");
19708 # ifdef TRY_FPRINTF
19712 #ifdef TRY_FFLUSH_NULL
19715 #ifdef TRY_FFLUSH_ALL
19717 long open_max = -1;
19718 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
19719 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
19721 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
19722 open_max = sysconf(_SC_OPEN_MAX);
19725 open_max = FOPEN_MAX;
19728 open_max = OPEN_MAX;
19737 # ifdef HAS_STDIO_STREAM_ARRAY
19738 if (open_max > 0) {
19740 for (i = 0; i < open_max; i++)
19741 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
19742 STDIO_STREAM_ARRAY[i]._file < open_max &&
19743 STDIO_STREAM_ARRAY[i]._flag)
19744 fflush(&STDIO_STREAM_ARRAY[i]);
19752 : first we have to find out how _not_ to flush
19754 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
19756 set try -DTRY_FPUTC
19757 if eval $compile; then
19758 $run ./try 2>/dev/null
19761 if $test ! -s try.out -a "X$code" = X42; then
19767 set try -DTRY_FPRINTF
19768 if eval $compile; then
19769 $run ./try 2>/dev/null
19772 if $test ! -s try.out -a "X$code" = X42; then
19773 output=-DTRY_FPRINTF
19779 : check for fflush NULL behavior
19780 case "$fflushNULL" in
19781 '') set try -DTRY_FFLUSH_NULL $output
19782 if eval $compile; then
19783 $run ./try 2>/dev/null
19786 if $test -s try.out -a "X$code" = X42; then
19787 fflushNULL="`$cat try.out`"
19789 if $test "X$code" != X42; then
19791 (If this test failed, don't worry, we'll try another method shortly.)
19796 $rm -f core try.core core.try.*
19797 case "$fflushNULL" in
19799 Your fflush(NULL) works okay for output streams.
19800 Let's see if it clobbers input pipes...
19802 # As of mid-March 2000 all versions of Solaris appear to have a stdio
19803 # bug that improperly flushes the input end of pipes. So we avoid the
19804 # autoflush on fork/system/exec support for now. :-(
19805 $cat >tryp.c <<EOCP
19808 main(int argc, char **argv)
19814 while ((i = getc(stdin)) != -1
19815 && (*bp++ = i) != '\n'
19816 && bp < &buf[1024])
19819 fprintf(stdout, "%s", buf);
19827 fflushNULL="$define"
19829 if eval $compile; then
19831 # Copy the .c file to the remote host ($to is an ssh-alike if targethost is set)
19832 if $test "X$targethost" != X; then
19835 $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
19837 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19839 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19841 fflush(NULL) seems to behave okay with input streams.
19843 fflushNULL="$define"
19846 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
19848 fflushNULL="$undef"
19851 $rm -f core tryp.c tryp.core core.tryp.*
19854 Your fflush(NULL) isn't working (contrary to ANSI C).
19856 fflushNULL="$undef"
19859 Cannot figure out whether your fflush(NULL) works or not.
19860 I'm assuming it doesn't (contrary to ANSI C).
19862 fflushNULL="$undef"
19866 $define|true|[yY]*)
19867 fflushNULL="$define"
19870 fflushNULL="$undef"
19873 : check explicit looping only if NULL did not work, and if the pipe
19874 : bug does not show up on an explicit flush too
19875 case "$fflushNULL" in
19877 $cat >tryp.c <<EOCP
19880 main(int argc, char **argv)
19886 while ((i = getc(stdin)) != -1
19887 && (*bp++ = i) != '\n'
19888 && bp < &buf[1024])
19891 fprintf(stdout, "%s", buf);
19900 if eval $compile; then
19902 if $test "X$targethost" != X; then
19905 $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
19907 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19909 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19911 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
19913 : now check for fflushall behaviour
19914 case "$fflushall" in
19915 '') set try -DTRY_FFLUSH_ALL $output
19916 if eval $compile; then
19918 (Now testing the other method--but note that this also may fail.)
19920 $run ./try 2>/dev/null
19923 if $test -s try.out -a "X$code" = X42; then
19924 fflushall="`$cat try.out`"
19928 case "$fflushall" in
19930 Whew. Flushing explicitly all the stdio streams works.
19932 fflushall="$define"
19935 Sigh. Flushing explicitly all the stdio streams doesn't work.
19940 Cannot figure out whether flushing stdio streams explicitly works or not.
19941 I'm assuming it doesn't.
19947 "$define"|true|[yY]*)
19948 fflushall="$define"
19956 All is futile. Even fflush(stdin) clobbers input pipes!
19963 $rm -f core tryp.c tryp.core core.tryp.*
19965 *) fflushall="$undef"
19969 case "$fflushNULL$fflushall" in
19972 OK, I give up. I cannot figure out how to flush pending stdio output.
19973 We won't be flushing handles at all before fork/exec/popen.
19979 : Store the full pathname to the ar program for use in the C program
19980 : Respect a hint or command line value for full_ar.
19985 : Store the full pathname to the sed program for use in the C program
19988 : see what type gids are declared as in the kernel
19990 echo "Looking for the type for group ids returned by getgid()."
19991 set gid_t gidtype xxx stdio.h sys/types.h
19995 xxx=`./findhdr sys/user.h`
19996 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
19998 unsigned) dflt="$1 $2" ;;
20002 *) dflt="$gidtype";;
20005 gid_t) echo "gid_t found." ;;
20006 *) rp="What is the type for group ids returned by getgid()?"
20012 : Check the size of GID
20015 *_t) zzz="$gidtype" ;;
20018 echo "Checking the size of $zzz..." >&4
20020 #include <sys/types.h>
20022 #$i_stdlib I_STDLIB
20024 #include <stdlib.h>
20027 printf("%d\n", (int)sizeof($gidtype));
20032 if eval $compile_ok; then
20036 echo "(I can't execute the test program--guessing $gidsize.)" >&4
20039 echo "Your $zzz is $gidsize bytes long."
20044 echo "(I can't compile the test program--guessing $gidsize.)" >&4
20048 : Check if GID is signed
20051 *_t) zzz="$gidtype" ;;
20054 echo "Checking the sign of $zzz..." >&4
20056 #include <sys/types.h>
20067 if eval $compile; then
20071 echo "(I can't execute the test program--guessing unsigned.)" >&4
20075 1) echo "Your $zzz is unsigned." ;;
20076 -1) echo "Your $zzz is signed." ;;
20082 echo "(I can't compile the test program--guessing unsigned.)" >&4
20086 : Check 64bit sizes
20089 if $test X"$quadtype" != X; then
20091 echo "Checking how to print 64-bit integers..." >&4
20093 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
20094 $cat >try.c <<'EOCP'
20095 #include <sys/types.h>
20098 int q = 12345678901;
20099 printf("%ld\n", q);
20103 if eval $compile; then
20107 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
20108 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
20109 echo "We will use %d."
20115 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
20116 $cat >try.c <<'EOCP'
20117 #include <sys/types.h>
20120 long q = 12345678901;
20121 printf("%ld\n", q);
20125 if eval $compile; then
20129 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
20130 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
20131 echo "We will use %ld."
20137 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
20138 $cat >try.c <<'EOCP'
20139 #include <sys/types.h>
20140 #include <inttypes.h>
20143 int64_t q = 12345678901;
20144 printf("%" PRId64 "\n", q);
20148 if eval $compile; then
20152 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
20153 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
20154 echo "We will use the C9X style."
20160 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
20162 #include <sys/types.h>
20165 $quadtype q = 12345678901;
20166 printf("%Ld\n", q);
20170 if eval $compile; then
20174 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
20175 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
20176 echo "We will use %Ld."
20182 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
20183 $cat >try.c <<'EOCP'
20184 #include <sys/types.h>
20187 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
20188 printf("%lld\n", q);
20192 if eval $compile; then
20196 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
20197 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
20198 echo "We will use the %lld style."
20204 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
20206 #include <sys/types.h>
20209 $quadtype q = 12345678901;
20210 printf("%qd\n", q);
20214 if eval $compile; then
20218 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
20219 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
20220 echo "We will use %qd."
20226 if $test X"$sPRId64" = X; then
20227 echo "Cannot figure out how to print 64-bit integers." >&4
20234 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
20235 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
20237 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
20238 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
20242 : Check format strings for internal types
20244 $echo "Checking the format strings to be used for Perl's internal types..." >&4
20246 if $test X"$ivsize" = X8; then
20247 ivdformat="$sPRId64"
20248 uvuformat="$sPRIu64"
20249 uvoformat="$sPRIo64"
20250 uvxformat="$sPRIx64"
20251 uvXUformat="$sPRIXU64"
20253 if $test X"$ivsize" = X"$longsize"; then
20260 if $test X"$ivsize" = X"$intsize"; then
20268 if $test X"$ivsize" = X"$shortsize"; then
20279 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
20280 nveformat="$sPRIeldbl"
20281 nvfformat="$sPRIfldbl"
20282 nvgformat="$sPRIgldbl"
20283 nvEUformat="$sPRIEUldbl"
20284 nvFUformat="$sPRIFUldbl"
20285 nvGUformat="$sPRIGUldbl"
20295 case "$ivdformat" in
20296 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
20301 : Check format string for GID
20304 $echo "Checking the format string to be used for gids..." >&4
20307 -1) if $test X"$gidsize" = X"$ivsize"; then
20308 gidformat="$ivdformat"
20310 if $test X"$gidsize" = X"$longsize"; then
20313 if $test X"$gidsize" = X"$intsize"; then
20316 if $test X"$gidsize" = X"$shortsize"; then
20323 *) if $test X"$gidsize" = X"$uvsize"; then
20324 gidformat="$uvuformat"
20326 if $test X"$gidsize" = X"$longsize"; then
20329 if $test X"$gidsize" = X"$intsize"; then
20332 if $test X"$gidsize" = X"$shortsize"; then
20341 : see if getgroups exists
20342 set getgroups d_getgrps
20345 : see if setgroups exists
20346 set setgroups d_setgrps
20349 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
20351 case "$d_getgrps$d_setgrps" in
20353 case "$groupstype" in
20354 '') dflt="$gidtype" ;;
20355 *) dflt="$groupstype" ;;
20358 What type of pointer is the second argument to getgroups() and setgroups()?
20359 Usually this is the same as group ids, $gidtype, but not always.
20362 rp='What type pointer is the second argument to getgroups() and setgroups()?'
20366 *) groupstype="$gidtype";;
20369 : MAD = Misc Attribute Definition
20371 if $test $patchlevel -lt 9; then
20372 : MAD is not available in 5.8.x or earlier.
20376 $define|true|[yY]*) dflt='y' ;;
20381 Would you like to build with Misc Attribute Decoration? This is development
20382 work leading to a Perl 5 to Perl 6 convertor, which imposes a space and speed
20383 overhead on the interpreter.
20385 If this doesn't make any sense to you, just accept the default '$dflt'.
20387 rp='Build Perl with MAD?'
20392 madlyh='madly.h madly.act madly.tab'
20394 madlyobj="madly$_o" ;;
20403 : check whether make sets MAKE
20405 echo "Checking if your $make program sets \$(MAKE)..." >&4
20406 case "$make_set_make" in
20408 $sed 's/^X //' > testmake.mak << 'EOF'
20410 X @echo 'maketemp="$(MAKE)"'
20412 case "`$make -f testmake.mak 2>/dev/null`" in
20413 *maketemp=*) make_set_make='#' ;;
20414 *) make_set_make="MAKE=$make" ;;
20416 $rm -f testmake.mak
20419 case "$make_set_make" in
20420 '#') echo "Yup, it does.";;
20421 *) echo "Nope, it doesn't.";;
20424 : see what type is used for mode_t
20425 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
20426 set mode_t modetype int stdio.h sys/types.h
20429 : see if we need va_copy
20431 case "$i_stdarg" in
20434 #include <stdarg.h>
20436 #$i_stdlib I_STDLIB
20438 #include <stdlib.h>
20440 #include <signal.h>
20443 ivfprintf(FILE *f, const char *fmt, va_list *valp)
20445 return vfprintf(f, fmt, *valp);
20449 myvfprintf(FILE *f, const char *fmt, va_list val)
20451 return ivfprintf(f, fmt, &val);
20455 myprintf(char *fmt, ...)
20458 va_start(val, fmt);
20459 return myvfprintf(stdout, fmt, val);
20463 main(int ac, char **av)
20465 signal(SIGSEGV, exit);
20467 myprintf("%s%cs all right, then\n", "that", '\'');
20472 if eval $compile && $run ./try 2>&1 >/dev/null; then
20473 case "`$run ./try`" in
20474 "that's all right, then")
20480 yes) echo "It seems that you don't need va_copy()." >&4
20481 need_va_copy="$undef"
20483 *) echo "It seems that va_copy() or similar will be needed." >&4
20484 need_va_copy="$define"
20489 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
20490 need_va_copy="$undef"
20494 : see what type is used for size_t
20495 rp="What is the type used for the length parameter for string functions?"
20496 set size_t sizetype 'unsigned int' stdio.h sys/types.h
20499 : check for type of arguments to gethostbyaddr.
20500 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
20501 case "$d_gethbyaddr" in
20505 Checking to see what type of arguments are accepted by gethostbyaddr().
20507 hdrs="$define sys/types.h
20508 $d_socket sys/socket.h
20509 $i_niin netinet/in.h
20511 $i_unistd unistd.h"
20512 : The first arg can 'char *' or 'void *'
20513 : The second arg is some of integral type
20514 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
20515 for yyy in size_t long int; do
20516 case "$netdb_host_type" in
20517 '') try="$extern_C struct hostent *gethostbyaddr($xxx, $yyy, int);"
20518 if ./protochk "$try" $hdrs; then
20519 echo "Your system accepts $xxx for the first arg."
20520 echo "...and $yyy for the second arg."
20521 netdb_host_type="$xxx"
20522 netdb_hlen_type="$yyy"
20528 : In case none of those worked, prompt the user.
20529 case "$netdb_host_type" in
20530 '') rp='What is the type for the 1st argument to gethostbyaddr?'
20533 netdb_host_type=$ans
20534 rp='What is the type for the 2nd argument to gethostbyaddr?'
20537 netdb_hlen_type=$ans
20541 *) : no gethostbyaddr, so pick harmless defaults
20542 netdb_host_type='char *'
20543 netdb_hlen_type="$sizetype"
20546 # Remove the "const" if needed. -- but then we'll have a
20548 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
20551 : check for type of argument to gethostbyname.
20552 if test "X$netdb_name_type" = X ; then
20553 case "$d_gethbyname" in
20557 Checking to see what type of argument is accepted by gethostbyname().
20559 hdrs="$define sys/types.h
20560 $d_socket sys/socket.h
20561 $i_niin netinet/in.h
20563 $i_unistd unistd.h"
20564 for xxx in "const char *" "char *"; do
20565 case "$netdb_name_type" in
20566 '') try="$extern_C struct hostent *gethostbyname($xxx);"
20567 if ./protochk "$try" $hdrs; then
20568 echo "Your system accepts $xxx."
20569 netdb_name_type="$xxx"
20574 : In case none of those worked, prompt the user.
20575 case "$netdb_name_type" in
20576 '') rp='What is the type for the 1st argument to gethostbyname?'
20579 netdb_name_type=$ans
20583 *) : no gethostbyname, so pick harmless default
20584 netdb_name_type='char *'
20589 : check for type of 1st argument to getnetbyaddr.
20590 if test "X$netdb_net_type" = X ; then
20591 case "$d_getnbyaddr" in
20595 Checking to see what type of 1st argument is accepted by getnetbyaddr().
20597 hdrs="$define sys/types.h
20598 $d_socket sys/socket.h
20599 $i_niin netinet/in.h
20601 $i_unistd unistd.h"
20602 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
20603 case "$netdb_net_type" in
20604 '') try="$extern_C struct netent *getnetbyaddr($xxx, int);"
20605 if ./protochk "$try" $hdrs; then
20606 echo "Your system accepts $xxx."
20607 netdb_net_type="$xxx"
20612 : In case none of those worked, prompt the user.
20613 case "$netdb_net_type" in
20614 '') rp='What is the type for the 1st argument to getnetbyaddr?'
20617 netdb_net_type=$ans
20621 *) : no getnetbyaddr, so pick harmless default
20622 netdb_net_type='long'
20626 : locate the preferred pager for this system
20633 [a-zA-Z]:/*) dflt=$pg;;
20637 [a-zA-Z]:/*) dflt=$more;;
20641 [a-zA-Z]:/*) dflt=$less;;
20644 '') dflt=/usr/ucb/more;;
20652 rp='What pager is used on your system?'
20656 : see what type pids are declared as in the kernel
20657 rp="What is the type of process ids on this system?"
20658 set pid_t pidtype int stdio.h sys/types.h
20661 : see if ar generates random libraries by itself
20663 echo "Checking how to generate random libraries on your machine..." >&4
20664 echo 'int bar1() { return bar2(); }' > bar1.c
20665 echo 'int bar2() { return 2; }' > bar2.c
20667 #$i_stdlib I_STDLIB
20669 #include <stdlib.h>
20671 int main() { printf("%d\n", bar1()); exit(0); }
20673 $cc $ccflags -c bar1.c >/dev/null 2>&1
20674 $cc $ccflags -c bar2.c >/dev/null 2>&1
20675 $cc $ccflags -c foo.c >/dev/null 2>&1
20676 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
20677 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20678 $run ./foobar >/dev/null 2>&1; then
20679 echo "$ar appears to generate random libraries itself."
20681 if [ "X$ranlib" = "X" ]; then
20684 elif $ar s bar$_a >/dev/null 2>&1 &&
20685 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20686 $run ./foobar >/dev/null 2>&1; then
20687 echo "a table of contents needs to be added with '$ar s'."
20690 elif $ar ts bar$_a >/dev/null 2>&1 &&
20691 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20692 $run ./foobar >/dev/null 2>&1; then
20693 echo "a table of contents needs to be added with '$ar ts'."
20700 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
20701 $test -f $ranlib || ranlib=''
20704 if $test -n "$ranlib"; then
20705 echo "your system has '$ranlib'; we'll use that."
20708 echo "your system doesn't seem to support random libraries"
20709 echo "so we'll use lorder and tsort to order the libraries."
20716 : see if this is a values.h system
20717 set values.h i_values
20720 : Check the max offset that gmtime and localtime accept
20721 echo "Checking max offsets that gmtime () accepts"
20724 define) yyy="#include <values.h>" ;;
20728 case "$sGMTIME_min/$sGMTIME_max" in
20731 #include <sys/types.h>
20740 void gm_check (time_t t, int min_year, int max_year)
20743 if ( tmp == NULL ||
20744 /* Check tm_year overflow */
20745 tmp->tm_year < min_year || tmp->tm_year > max_year)
20756 gm_check (MAXLONG, 69, 0x7fffffff);
20758 if (tmp == NULL || tmp->tm_year < 0) {
20759 for (i = 63; i >= 0; i--) {
20760 time_t x = pt | ((time_t)1 << i);
20761 if (x < 0 || x < pt) continue;
20762 gm_check (x, 69, 0x7fffffff);
20765 printf ("sGMTIME_max=%ld\n", pt);
20774 gm_check (MINLONG, -1900, 70);
20777 for (i = 36; i >= 0; i--) {
20778 time_t x = pt - ((time_t)1 << i);
20779 if (x > 0) continue;
20780 gm_check (x, -1900, 70);
20783 printf ("sGMTIME_min=%ld\n", pt);
20787 int main (int argc, char *argv[])
20789 fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t));
20796 if eval $compile; then
20799 echo "Cannot determine sGMTIME_max and sGMTIME_min." >&4
20805 echo "Checking max offsets that localtime () accepts"
20807 case "$sLOCALTIME_min/$sLOCALTIME_max" in
20810 #include <sys/types.h>
20819 void local_check (time_t t, int min_year, int max_year)
20821 if (sizeof (time_t) > 4 && t > 0x7ffffffffffff000LL)
20824 tmp = localtime (&t);
20825 if ( tmp == NULL ||
20826 /* Check tm_year overflow */
20827 tmp->tm_year < min_year || tmp->tm_year > max_year)
20831 } /* local_check */
20838 local_check (MAXLONG, 69, 0x7fffffff);
20840 if (tmp == NULL || tmp->tm_year < 0) {
20841 for (i = 63; i >= 0; i--) {
20842 time_t x = pt | ((time_t)1 << i);
20843 if (x < 0 || x < pt) continue;
20844 local_check (x, 69, 0x7fffffff);
20847 printf ("sLOCALTIME_max=%ld\n", pt);
20856 local_check (MINLONG, -1900, 70);
20859 for (i = 36; i >= 0; i--) {
20860 time_t x = pt - ((time_t)1 << i);
20861 if (x > 0) continue;
20862 local_check (x, -1900, 70);
20865 printf ("sLOCALTIME_min=%ld\n", pt);
20869 int main (int argc, char *argv[])
20877 if eval $compile; then
20880 echo "Cannot determine sLOCALTIME_max and sLOCALTIME_min." >&4
20886 : check for type of arguments to select.
20887 case "$selecttype" in
20888 '') case "$d_select" in
20892 Checking to see what type of arguments are accepted by select().
20894 hdrs="$define sys/types.h
20895 $i_systime sys/time.h
20896 $i_sysselct sys/select.h
20897 $d_socket sys/socket.h"
20898 : The first arg can be int, unsigned, or size_t
20899 : The last arg may or may not be 'const'
20901 : void pointer has been seen but using that
20902 : breaks the selectminbits test
20903 for xxx in 'fd_set *' 'int *'; do
20904 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
20905 for tmo in 'struct timeval *' 'const struct timeval *'; do
20907 '') try="$extern_C select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
20908 if ./protochk "$try" $hdrs; then
20909 echo "Your system accepts $xxx."
20918 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
20919 case "$d_fd_set" in
20920 $define) dflt="fd_set *" ;;
20929 *) : no select, so pick a harmless default
20936 : check for the select 'width'
20937 case "$selectminbits" in
20938 '') safebits=`expr $ptrsize \* 8`
20939 case "$d_select" in
20943 Checking to see on how many bits at a time your select() operates...
20946 #include <sys/types.h>
20948 #$i_systime I_SYS_TIME
20949 #$i_systimek I_SYS_TIME_KERNEL
20954 # ifdef I_SYS_TIME_KERNEL
20957 # include <sys/time.h>
20958 # ifdef I_SYS_TIME_KERNEL
20962 #$i_sysselct I_SYS_SELECT
20963 #ifdef I_SYS_SELECT
20964 #include <sys/select.h>
20966 #$d_socket HAS_SOCKET
20968 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
20971 #$i_stdlib I_STDLIB
20973 #include <stdlib.h>
20976 #define S sizeof(*(b))
20978 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
20979 #define NBITS (NBYTES * 8)
20981 char *s = (char *)malloc(NBYTES);
20990 fp = fopen("try.c", "r");
20996 b = ($selecttype)s;
20997 for (i = 0; i < NBITS; i++)
21001 select(fd + 1, b, 0, 0, &t);
21002 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
21004 printf("%d\n", i + 1);
21009 if eval $compile_ok; then
21010 selectminbits=`$run ./try`
21011 case "$selectminbits" in
21013 Cannot figure out on how many bits at a time your select() operates.
21014 I'll play safe and guess it is $safebits bits.
21016 selectminbits=$safebits
21017 bits="$safebits bits"
21020 *) bits="$selectminbits bits" ;;
21022 echo "Your select() operates on $bits at a time." >&4
21024 rp='What is the minimum number of bits your select() operates on?'
21025 case "$byteorder" in
21026 12345678) dflt=64 ;;
21032 selectminbits="$val"
21036 *) : no select, so pick a harmless default
21037 selectminbits=$safebits
21043 : Trace out the files included by signal.h, then look for SIGxxx names.
21044 if [ "X$fieldn" = X ]; then
21045 : Just make some guesses. We check them later.
21046 xxx="$sysroot/usr/include/signal.h $sysroot/usr/include/sys/signal.h"
21048 xxx=`echo '#include <signal.h>' |
21049 $cppstdin $cppminus $cppflags 2>/dev/null |
21050 $grep '^[ ]*#.*include' |
21051 $awk "{print \\$$fieldn}" | $sed 's!"!!g' |\
21052 $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
21055 for xx in $xxx /dev/null ; do
21056 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
21058 case "$xxxfiles" in
21059 '') xxxfiles=`./findhdr signal.h` ;;
21062 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
21063 print substr($2, 4, 20)
21065 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
21066 print substr($3, 4, 20)
21068 : Append some common names just in case the awk scan failed.
21069 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
21070 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
21071 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
21072 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
21073 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
21075 : generate a few handy files for later
21076 $cat > signal.c <<EOCP
21077 #include <sys/types.h>
21078 #include <signal.h>
21079 #$i_stdlib I_STDLIB
21081 #include <stdlib.h>
21086 /* Strange style to avoid deeply-nested #if/#else/#endif */
21089 # define NSIG (_NSIG)
21095 # define NSIG (SIGMAX+1)
21101 # define NSIG (SIG_MAX+1)
21107 # define NSIG (_SIG_MAX+1)
21113 # define NSIG (MAXSIG+1)
21119 # define NSIG (MAX_SIG+1)
21124 # ifdef SIGARRAYSIZE
21125 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
21131 # define NSIG (_sys_nsig) /* Solaris 2.5 */
21135 /* Default to some arbitrary number that's big enough to get most
21136 of the common signals.
21142 printf("NSIG %d\n", NSIG);
21148 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
21150 printf "#ifdef SIG"; printf $1; printf "\n"
21151 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
21152 printf $1; printf ");\n"
21156 printf "#endif /* JUST_NSIG */\n";
21157 printf "exit(0);\n}\n";
21160 $cat >signal.awk <<'EOP'
21161 BEGIN { ndups = 0 }
21162 $1 ~ /^NSIG$/ { nsig = $2 }
21163 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
21164 if ($2 > maxsig) { maxsig = $2 }
21165 if (sig_name[$2]) {
21166 dup_name[ndups] = $1
21167 dup_num[ndups] = $2
21179 printf("NSIG %d\n", nsig);
21180 for (n = 1; n < nsig; n++) {
21182 printf("%s %d\n", sig_name[n], sig_num[n])
21185 printf("NUM%d %d\n", n, n)
21188 for (n = 0; n < ndups; n++) {
21189 printf("%s %d\n", dup_name[n], dup_num[n])
21193 $cat >signal_cmd <<EOS
21195 if $test -s signal.lst; then
21196 echo "Using your existing signal.lst file"
21201 $cat >>signal_cmd <<'EOS'
21204 if eval $compile_ok; then
21205 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) |\
21206 $uniq | $awk -f signal.awk >signal.lst
21208 echo "(I can't seem be able to compile the whole test program)" >&4
21209 echo "(I'll try it in little pieces.)" >&4
21210 set signal -DJUST_NSIG
21211 if eval $compile_ok; then
21212 $run ./signal$_exe > signal.nsg
21215 echo "I can't seem to figure out how many signals you have." >&4
21216 echo "Guessing 50." >&4
21217 echo 'NSIG 50' > signal.nsg
21219 : Now look at all the signal names, one at a time.
21220 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
21221 $cat > signal.c <<EOCP
21222 #include <sys/types.h>
21223 #include <signal.h>
21226 printf("$xx %d\n", SIG${xx});
21231 if eval $compile; then
21232 echo "SIG${xx} found."
21233 $run ./signal$_exe >> signal.ls1
21235 echo "SIG${xx} NOT found."
21238 if $test -s signal.ls1; then
21239 $cat signal.nsg signal.ls1 |
21240 $sort -n | $uniq | $awk -f signal.awk >signal.lst
21244 if $test -s signal.lst; then
21247 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
21248 echo 'kill -l' >signal
21249 set X `csh -f <signal`
21253 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
21255 echo $@ | $tr ' ' $trnl | \
21256 $awk '{ printf "%s %d\n", $1, ++s; }
21257 END { printf "NSIG %d\n", ++s }' >signal.lst
21259 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
21261 chmod a+x signal_cmd
21262 $eunicefix signal_cmd
21264 : generate list of signal names
21266 case "$sig_name_init" in
21268 *) case "$sig_num_init" in
21269 ''|*,*) doinit=yes ;;
21274 echo "Generating a list of signal names and numbers..." >&4
21276 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
21277 sig_name=`$awk 'BEGIN { printf "ZERO " }
21278 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
21279 sig_num=`$awk 'BEGIN { printf "0 " }
21280 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
21281 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
21282 !/^NSIG/ { printf "\"%s\", ", $1 }
21283 END { printf "0\n" }' signal.lst`
21284 sig_num_init=`$awk 'BEGIN { printf "0, " }
21285 !/^NSIG/ { printf "%d, ", $2}
21286 END { printf "0\n"}' signal.lst`
21289 echo "The following $sig_count signals are available:"
21291 echo $sig_name | $awk \
21292 'BEGIN { linelen = 0 }
21294 for (i = 1; i <= NF; i++) {
21295 name = "SIG" $i " "
21296 linelen = linelen + length(name)
21297 if (linelen > 70) {
21299 linelen = length(name)
21305 sig_size=`echo $sig_name | awk '{print NF}'`
21306 $rm -f signal signal.c signal.awk signal.lst signal_cmd
21308 : Check size of size
21310 case "$sizetype" in
21311 *_t) zzz="$sizetype" ;;
21312 *) zzz="filesize" ;;
21314 echo "Checking the size of $zzz..." >&4
21316 #include <sys/types.h>
21318 #$i_stdlib I_STDLIB
21320 #include <stdlib.h>
21323 printf("%d\n", (int)sizeof($sizetype));
21328 if eval $compile_ok; then
21332 echo "(I can't execute the test program--guessing $sizesize.)" >&4
21335 echo "Your $zzz size is $sizesize bytes."
21340 echo "(I can't compile the test program--guessing $sizesize.)" >&4
21344 : check for socklen_t
21346 echo "Checking to see if you have socklen_t..." >&4
21348 #include <sys/types.h>
21349 #$d_socket HAS_SOCKET
21351 #include <sys/socket.h>
21353 int main() { socklen_t x = 16; }
21356 if eval $compile; then
21358 echo "You have socklen_t."
21361 echo "You do not have socklen_t."
21362 case "$sizetype" in
21363 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
21370 : see if this is a socks.h system
21371 set socks.h i_socks
21374 : check for type of the size argument to socket calls
21375 case "$d_socket" in
21379 Checking to see what type is the last argument of accept().
21382 case "$d_socklen_t" in
21383 "$define") yyy="$yyy socklen_t"
21385 yyy="$yyy $sizetype int long unsigned"
21386 for xxx in $yyy; do
21387 case "$socksizetype" in
21388 '') try="$extern_C int accept(int, struct sockaddr *, $xxx *);"
21389 case "$usesocks" in
21391 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
21392 echo "Your system accepts '$xxx *' for the last argument of accept()."
21393 socksizetype="$xxx"
21396 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
21397 echo "Your system accepts '$xxx *' for the last argument of accept()."
21398 socksizetype="$xxx"
21405 : In case none of those worked, prompt the user.
21406 case "$socksizetype" in
21407 '') rp='What is the type for socket address structure sizes?'
21414 *) : no sockets, so pick relatively harmless default
21419 : see what type is used for signed size_t
21420 set ssize_t ssizetype int stdio.h sys/types.h
21425 #$i_stdlib I_STDLIB
21427 #include <stdlib.h>
21429 #include <sys/types.h>
21430 #define Size_t $sizetype
21431 #define SSize_t $dflt
21434 if (sizeof(Size_t) == sizeof(SSize_t))
21436 else if (sizeof(Size_t) == sizeof(int))
21445 if eval $compile_ok && $run ./try > /dev/null; then
21446 ssizetype=`$run ./try`
21447 echo "I'll be using $ssizetype for functions returning a byte count." >&4
21450 Help! I can't compile and run the ssize_t test program: please enlighten me!
21451 (This is probably a misconfiguration in your system or libraries, and
21452 you really ought to fix it. Still, I'll try anyway.)
21454 I need a type that is the same size as $sizetype, but is guaranteed to
21455 be signed. Common values are ssize_t, int and long.
21458 rp="What signed type is the same size as $sizetype?"
21464 : Check the size of st_ino
21466 $echo "Checking the size of st_ino..." >&4
21467 $cat > try.c <<EOCP
21468 #include <sys/stat.h>
21470 #$i_stdlib I_STDLIB
21472 #include <stdlib.h>
21476 printf("%d\n", (int)sizeof(st.st_ino));
21481 if eval $compile_ok; then
21485 $echo "(I can't execute the test program--guessing $st_ino_size.)" >&4
21487 *) st_ino_size=$val
21488 $echo "Your st_ino is $st_ino_size bytes long."
21493 $echo "(I can't compile the test program--guessing $st_ino_size.)" >&4
21497 : Check if st_ino is signed
21499 $echo "Checking the sign of st_ino..." >&4
21500 $cat > try.c <<EOCP
21501 #include <sys/stat.h>
21506 if (foo.st_ino < 0)
21513 if eval $compile; then
21517 $echo "(I can't execute the test program--guessing unsigned.)" >&4
21519 *) st_ino_sign=$val
21520 case "$st_ino_sign" in
21521 1) $echo "Your st_ino is unsigned." ;;
21522 -1) $echo "Your st_ino is signed." ;;
21528 $echo "(I can't compile the test program--guessing unsigned.)" >&4
21532 : see what type of char stdio uses.
21534 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
21535 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
21536 echo "Your stdio uses unsigned chars." >&4
21537 stdchar="unsigned char"
21539 echo "Your stdio uses signed chars." >&4
21544 : see what type uids are declared as in the kernel
21546 echo "Looking for the type for user ids returned by getuid()."
21547 set uid_t uidtype xxx stdio.h sys/types.h
21551 xxx=`./findhdr sys/user.h`
21552 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
21554 unsigned) dflt="$1 $2" ;;
21558 *) dflt="$uidtype";;
21561 uid_t) echo "uid_t found." ;;
21562 *) rp="What is the type for user ids returned by getuid()?"
21568 : Check size of UID
21571 *_t) zzz="$uidtype" ;;
21574 echo "Checking the size of $zzz..." >&4
21576 #include <sys/types.h>
21578 #$i_stdlib I_STDLIB
21580 #include <stdlib.h>
21583 printf("%d\n", (int)sizeof($uidtype));
21588 if eval $compile_ok; then
21592 echo "(I can't execute the test program--guessing $uidsize.)" >&4
21595 echo "Your $zzz is $uidsize bytes long."
21600 echo "(I can't compile the test program--guessing $uidsize.)" >&4
21603 : Check if UID is signed
21606 *_t) zzz="$uidtype" ;;
21609 echo "Checking the sign of $zzz..." >&4
21611 #include <sys/types.h>
21622 if eval $compile; then
21626 echo "(I can't execute the test program--guessing unsigned.)" >&4
21630 1) echo "Your $zzz is unsigned." ;;
21631 -1) echo "Your $zzz is signed." ;;
21637 echo "(I can't compile the test program--guessing unsigned.)" >&4
21641 : Check format string for UID
21643 $echo "Checking the format string to be used for uids..." >&4
21646 -1) if $test X"$uidsize" = X"$ivsize"; then
21647 uidformat="$ivdformat"
21649 if $test X"$uidsize" = X"$longsize"; then
21652 if $test X"$uidsize" = X"$intsize"; then
21655 if $test X"$uidsize" = X"$shortsize"; then
21662 *) if $test X"$uidsize" = X"$uvsize"; then
21663 uidformat="$uvuformat"
21665 if $test X"$uidsize" = X"$longsize"; then
21668 if $test X"$uidsize" = X"$intsize"; then
21671 if $test X"$uidsize" = X"$shortsize"; then
21680 : Determine if we can use sysctl with KERN_PROC_PATHNAME to find executing program
21682 echo "Determining whether we can use sysctl with KERN_PROC_PATHNAME to find executing program..." >&4
21683 $cat >try.c <<'EOM'
21684 /* Intentionally a long probe as I'd like to sanity check that the exact
21685 approach is going to work, as thinking it will work, but only having it
21686 part working at runtime is worse than not having it. */
21688 #include <sys/types.h>
21689 #include <sys/sysctl.h>
21690 #include <sys/param.h>
21692 #include <string.h>
21693 #include <stdlib.h>
21694 #include <unistd.h>
21697 main(int argc, char **argv) {
21699 char *argv_leaf = strrchr(argv[0], '/');
21705 mib[1] = KERN_PROC;
21706 mib[2] = KERN_PROC_PATHNAME;
21710 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
21714 if (sysctl(mib, 4, NULL, &size, NULL, 0)) {
21719 if (size < strlen(argv_leaf) + 1) {
21720 fprintf(stderr, "size %lu is too short for a path\n",
21721 (unsigned long) size);
21725 if (size > MAXPATHLEN * MAXPATHLEN) {
21726 fprintf(stderr, "size %lu is too long for a path\n",
21727 (unsigned long) size);
21731 buffer = malloc(size);
21737 if (sysctl(mib, 4, buffer, &size, NULL, 0)) {
21742 if (strlen(buffer) + 1 != size) {
21743 fprintf(stderr, "size != strlen(buffer) + 1 (%lu != %lu)\n",
21744 (unsigned long)size, (unsigned long)strlen(buffer) + 1);
21749 if (*buffer != '/') {
21750 fprintf(stderr, "Not an absolute path: '%s'\n", buffer);
21754 if (strstr(buffer, "/./")) {
21755 fprintf(stderr, "Contains /./: '%s'\n", buffer);
21759 if (strstr(buffer, "/../")) {
21760 fprintf(stderr, "Contains /../: '%s'\n", buffer);
21764 buffer_leaf = strrchr(buffer, '/');
21765 if (strcmp(buffer_leaf, argv_leaf) != 0) {
21766 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], buffer);
21778 if eval $compile; then
21779 if $run ./try; then
21780 echo "You can use sysctl with KERN_PROC_PATHNAME to find the executing program." >&4
21783 echo "Nope, sysctl with KERN_PROC_PATHNAME doesn't work here." >&4
21787 echo "I'm unable to compile the test program." >&4
21788 echo "I'll assume no sysctl with KERN_PROC_PATHNAME here." >&4
21792 set usekernprocpathname
21795 : Determine if we can use _NSGetExecutablePath to find executing program
21797 echo "Determining whether we can use _NSGetExecutablePath to find executing program..." >&4
21798 $cat >try.c <<'EOM'
21799 /* Intentionally a long probe as I'd like to sanity check that the exact
21800 approach is going to work, as thinking it will work, but only having it
21801 part working at runtime is worse than not having it. */
21802 #include <mach-o/dyld.h>
21804 #include <stdlib.h>
21805 #include <sys/param.h>
21806 #include <string.h>
21809 main(int argc, char **argv) {
21811 uint32_t size = sizeof(buf);
21815 char *argv_leaf = strrchr(argv[0], '/');
21819 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
21823 _NSGetExecutablePath(buf, &size);
21824 if (size > MAXPATHLEN * MAXPATHLEN) {
21825 fprintf(stderr, "_NSGetExecutablePath size %u is too long for a path\n",
21826 (unsigned int) size);
21830 buffer = malloc(size);
21836 result = _NSGetExecutablePath(buffer, &size);
21838 fprintf(stderr, "_NSGetExecutablePath returned %i for a size of %u\n",
21839 result, (unsigned int) size);
21843 tidied = realpath(buffer, NULL);
21845 perror("realpath");
21851 if (*tidied != '/') {
21852 fprintf(stderr, "Not an absolute path: '%s'\n", tidied);
21856 if (strstr(tidied, "/./")) {
21857 fprintf(stderr, "Contains /./: '%s'\n", tidied);
21861 if (strstr(tidied, "/../")) {
21862 fprintf(stderr, "Contains /../: '%s'\n", tidied);
21866 tidied_leaf = strrchr(tidied, '/');
21867 if (strcmp(tidied_leaf, argv_leaf) != 0) {
21868 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], tidied);
21880 if eval $compile; then
21881 if $run ./try; then
21882 echo "You can use _NSGetExecutablePath to find the executing program." >&4
21885 echo "Nope, _NSGetExecutablePath doesn't work here." >&4
21888 echo "I'm unable to compile the test program." >&4
21889 echo "I'll assume no _NSGetExecutablePath here." >&4
21892 set usensgetexecutablepath
21895 : Check if site customization support was requested
21896 case "$usesitecustomize" in
21897 $define|true|[Yy]*)
21898 usesitecustomize="$define"
21901 usesitecustomize="$undef"
21905 : see if prototypes support variable argument declarations
21907 case "$prototype$i_stdarg" in
21909 echo "It appears we'll be able to prototype varargs functions." >&4
21913 echo "Too bad... We won't be using prototyped varargs functions..." >&4
21920 : determine compiler compiler
21929 if $test -f "$byacc$_exe"; then
21931 comp="byacc or $comp"
21933 if $test -f "$bison$_exe"; then
21934 comp="$comp or bison -y"
21936 rp="Which compiler compiler ($comp) shall I use?"
21945 echo "(Adding -y option to bison to get yacc-compatible behavior.)"
21951 : see if this is a assert.h system
21952 set assert.h i_assert
21955 : see if this is a bfd.h system
21959 : see if this is an execinfo.h system
21960 set execinfo.h i_execinfo
21963 : see if this is a fp.h system
21967 : see if this is a fp_class.h system
21968 set fp_class.h i_fp_class
21971 : see if gdbm.h is available
21976 : see if gdbm_open exists
21977 set gdbm_open d_gdbm_open
21979 case "$d_gdbm_open" in
21982 echo "We won't be including <gdbm.h>"
21991 : see if this is a ieeefp.h system
21992 case "$i_ieeefp" in
21993 '' ) set ieeefp.h i_ieeefp
21998 : see if this is a libutil.h system
21999 set libutil.h i_libutil
22002 : see if mach cthreads are available
22003 if test "X$usethreads" = "X$define"; then
22004 set mach/cthreads.h i_machcthr
22007 i_machcthr="$undef"
22010 : see if this is a mntent.h system
22011 set mntent.h i_mntent
22014 : see if net/errno.h is available
22016 set net/errno.h val
22019 : Unfortunately, it causes problems on some systems. Arrgh.
22022 cat > try.c <<'EOM'
22025 #include <net/errno.h>
22031 if $cc $ccflags -c try.c >/dev/null 2>&1; then
22032 echo "We'll be including <net/errno.h>." >&4
22034 echo "We won't be including <net/errno.h>." >&4
22043 : see if netinet/tcp.h is available
22044 set netinet/tcp.h i_netinettcp
22047 : see if this is a poll.h system
22051 : see if this is a prot.h system
22055 : Preprocessor symbols
22057 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
22058 $cat <<'EOSH' > Cppsym.know
22059 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
22060 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
22061 alliant alpha am29000 AM29000 AMD64 amd64 amiga AMIGAOS AMIX
22062 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
22063 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
22064 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
22065 bull c cadmus clipper CMU COFF COMPILER_VERSION
22066 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
22067 CYGWIN DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
22068 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
22069 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
22071 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
22072 H3050R H3050RX hbullx20 hcx host_mips
22073 hp200 hp300 hp700 HP700 hp800 hp9000
22074 hp9000s200 hp9000s300 hp9000s400 hp9000s500
22075 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
22076 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
22077 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
22078 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
22079 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
22080 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
22081 LIBCATAMOUNT Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
22082 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
22083 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
22084 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
22085 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
22086 MATH_HAS_NO_SIDE_EFFECTS
22087 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
22088 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
22089 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
22090 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
22091 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
22092 NetBSD news1500 news1700 news1800 news1900 news3700
22093 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
22094 ns32016 ns32332 ns32k nsc32000
22095 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
22096 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
22097 pc532 pdp11 PGC PIC plexus PORTAR posix
22098 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
22099 POSIX_C_SOURCE POSIX_SOURCE POWER
22100 PROTOTYPES PWB pyr QNX QK_USER R3000 REENTRANT RES Rhapsody RISC6000
22101 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
22102 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
22103 sony sony_news sonyrisc sparc sparclite spectrum
22104 stardent stdc STDC_EXT stratos sun sun3 sun386
22105 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
22106 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
22107 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
22108 sysV68 sysV88 Tek4132 Tek4300 titan
22109 TM3200 TM5400 TM5600
22110 tower tower32 tower32_200 tower32_600 tower32_700
22111 tower32_800 tower32_850 tss
22112 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
22113 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
22114 unix UNIX95 UNIX99 unixpc unos
22115 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
22116 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
22117 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
22119 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms x86_64 xenix Xenix286
22120 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
22121 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
22124 # Maybe put other stuff here too.
22125 cat <<EOSH >>Cppsym.know
22128 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
22129 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
22130 $cat Cppsym.know > Cppsym.c
22131 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
22132 $rm -f Cppsym.a Cppsym.b Cppsym.c
22133 cat <<EOSH > Cppsym
22135 if $test \$# -gt 0; then
22136 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
22137 if $test -s Cppsym.got; then
22144 $tr " " "$trnl" | ./Cppsym.try
22150 cat <<EOSH > Cppsym.try
22152 cat <<'EOCP' > try.c
22155 #define STRINGIFY(a) "a"
22157 #if cpp_stuff == 42
22158 #define StGiFy(a) #a
22159 #define STRINGIFY(a) StGiFy(a)
22161 #if $cpp_stuff != 1 && $cpp_stuff != 42
22162 # include "Bletch: How does this C preprocessor stringify macros?"
22168 cat <<'EOSH' >> Cppsym.try
22170 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
22171 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
22172 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
22173 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
22175 echo 'return 0;}' >> try.c
22177 cat <<EOSH >> Cppsym.try
22179 case "$osname-$gccversion" in
22180 irix-) ccflags="\$ccflags -woff 1178" ;;
22181 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
22183 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
22185 chmod +x Cppsym.try
22186 $eunicefix Cppsym.try
22187 ./Cppsym < Cppsym.know | $sort | $uniq > Cppsym.true
22188 : Add in any Linux cpp "predefined macros":
22189 case "$osname::$gccversion" in
22190 *linux*::*.*|*gnukfreebsd*::*.*|gnu::*.*)
22192 rm -f $tHdrH'.h' $tHdrH
22194 # Filter out macro arguments, such as Linux's __INT8_C(c)
22195 if $cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
22196 sed -e 's/#define[\ \ ]*//;s/[\ \ ].*$//' -e 's/(.*//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
22197 if [ -s $tHdrH'_cppsym.real' ]; then
22198 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
22201 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
22204 : now check the C compiler for additional symbols
22205 postprocess_cc_v=''
22207 aix) postprocess_cc_v="|$tr , ' '" ;;
22214 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
22217 -D*) echo "\$i" | $sed 's/^-D//';;
22218 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
22223 postprocess_cc_v=''
22226 ./ccsym > ccsym1.raw
22227 if $test -s ccsym1.raw; then
22228 $sort ccsym1.raw | $uniq >ccsym.raw
22230 mv ccsym1.raw ccsym.raw
22233 $awk '/\=/ { print $0; next }
22234 { print $0"=1" }' ccsym.raw >ccsym.list
22235 $comm -13 Cppsym.true ccsym.list >ccsym.own
22236 $comm -12 Cppsym.true ccsym.list >ccsym.com
22237 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
22239 if $test -z ccsym.raw; then
22240 echo "Your C compiler doesn't seem to define any symbols!" >&4
22242 echo "However, your C preprocessor defines the following symbols:"
22245 cppsymbols=`$cat Cppsym.true`
22246 cppsymbols=`echo $cppsymbols`
22247 cppccsymbols="$cppsymbols"
22249 if $test -s ccsym.com; then
22250 echo "Your C compiler and pre-processor define these symbols:"
22251 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
22254 cppccsymbols=`$cat ccsym.com`
22255 cppccsymbols=`echo $cppccsymbols`
22256 $test "$silent" || sleep 1
22258 if $test -s ccsym.cpp; then
22259 $test "$also" && echo " "
22260 echo "Your C pre-processor ${also}defines the following symbols:"
22261 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
22263 cppsymbols=`$cat ccsym.cpp`
22264 cppsymbols=`echo $cppsymbols`
22265 $test "$silent" || sleep 1
22267 if $test -s ccsym.own; then
22268 $test "$also" && echo " "
22269 echo "Your C compiler ${also}defines the following cpp symbols:"
22270 $sed -e 's/\(..*\)=1/\1/' ccsym.own
22271 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
22272 ccsymbols=`$cat ccsym.own`
22273 ccsymbols=`echo $ccsymbols`
22274 $test "$silent" || sleep 1
22278 : see if this is a termio system
22282 if $test `./findhdr termios.h`; then
22283 set tcsetattr i_termios
22289 "$define") echo "You have POSIX termios.h... good!" >&4;;
22290 *) if ./Cppsym pyr; then
22291 case "`$run /bin/universe`" in
22292 ucb) if $test `./findhdr sgtty.h`; then
22294 echo "<sgtty.h> found." >&4
22296 echo "System is pyramid with BSD universe."
22297 ./warn "<sgtty.h> not found--you could have problems."
22299 *) if $test `./findhdr termio.h`; then
22301 echo "<termio.h> found." >&4
22303 echo "System is pyramid with USG universe."
22304 ./warn "<termio.h> not found--you could have problems."
22308 if $test `./findhdr termio.h`; then
22309 echo "<termio.h> found." >&4
22311 elif $test `./findhdr sgtty.h`; then
22312 echo "<sgtty.h> found." >&4
22315 ./warn "Neither <termio.h> nor <sgtty.h> found--cross fingers!"
22318 if $test `./findhdr sgtty.h`; then
22319 echo "<sgtty.h> found." >&4
22321 elif $test `./findhdr termio.h`; then
22322 echo "<termio.h> found." >&4
22325 ./warn "Neither <sgtty.h> nor <termio.h> found--cross fingers!"
22329 set i_termio; eval $setvar
22330 val=$val2; set i_sgtty; eval $setvar
22331 val=$val3; set i_termios; eval $setvar
22333 : see if stdbool is available
22334 : we want a real compile instead of Inhdr because some Solaris systems
22335 : have stdbool.h, but it can only be used if the compiler indicates it
22336 : is sufficiently c99-compliant.
22340 #include <stdbool.h>
22345 int main(int argc, char **argv)
22351 if eval $compile; then
22352 echo "<stdbool.h> found." >&4
22355 echo "<stdbool.h> NOT found." >&4
22362 : see if stddef is available
22363 set stddef.h i_stddef
22366 : see if sys/access.h is available
22367 set sys/access.h i_sysaccess
22370 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
22371 set sys/filio.h i_sysfilio
22374 if $test `./findhdr sys/ioctl.h`; then
22376 echo '<sys/ioctl.h> found.' >&4
22379 if $test $i_sysfilio = "$define"; then
22380 echo '<sys/ioctl.h> NOT found.' >&4
22382 $test $i_sgtty = "$define" && xxx="sgtty.h"
22383 $test $i_termio = "$define" && xxx="termio.h"
22384 $test $i_termios = "$define" && xxx="termios.h"
22385 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
22391 : see if socket ioctl defs are in sys/sockio.h
22393 xxx=`./findhdr sys/sockio.h`
22394 if $test "$xxx"; then
22395 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
22397 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
22400 echo "No socket ioctls found in <sys/sockio.h>." >&4
22405 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
22411 : see if this is a syslog.h system
22412 set syslog.h i_syslog
22415 : see if this is a sys/mode.h system
22416 set sys/mode.h i_sysmode
22419 : see if there is a sys/poll.h file
22420 set sys/poll.h i_syspoll
22423 : see if sys/resource.h has to be included
22424 set sys/resource.h i_sysresrc
22427 : see if sys/security.h is available
22428 set sys/security.h i_syssecrt
22431 : see if this is a sys/statvfs.h system
22432 set sys/statvfs.h i_sysstatvfs
22435 : see if this is a sys/un.h system
22436 set sys/un.h i_sysun
22439 : see if this is a sys/utsname.h system
22440 set sys/utsname.h i_sysutsname
22443 : see if this is a syswait system
22444 set sys/wait.h i_syswait
22447 : see if this is a ustat.h system
22448 set ustat.h i_ustat
22451 : see if this is an utime system
22452 set utime.h i_utime
22455 : see if this is a vfork system
22458 set vfork.h i_vfork
22468 echo "Looking for extensions..." >&4
22469 : If we are using the old config.sh, nonxs_extensions and xs_extensions may
22470 : contain old or inaccurate or duplicate values.
22471 nonxs_extensions=''
22473 : We do not use find because it might not be available.
22474 : We do not just use MANIFEST because the user may have dropped
22475 : some additional extensions into the source tree and expect them
22478 : Function to recursively find available extensions, ignoring DynaLoader
22479 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
22480 : In 5.10.1 and later, extensions are stored in directories
22481 : like File-Glob instead of the older File/Glob/.
22485 DynaLoader|dynaload) ;;
22487 this_ext=`echo $xxx | $sed -e s/-/\\\//g`;
22488 case "$this_ext" in
22489 Scalar/List/Utils) this_ext="List/Util" ;;
22490 PathTools) this_ext="Cwd" ;;
22492 echo " $xs_extensions $nonxs_extensions" > $tdir/$$.tmp;
22493 if $contains " $this_ext " $tdir/$$.tmp; then
22495 echo "Duplicate directories detected for extension $xxx" >&4;
22496 echo "Configure cannot correctly recover from this - shall I abort?" >&4;
22497 case "$knowitall" in
22505 echo "Ok. Stopping Configure." >&4;
22506 echo "Please remove the duplicate directory (e.g. using git clean) and then re-run Configure" >&4;
22509 echo "Ok. You will need to correct config.sh before running make." >&4;
22511 $ls -1 $xxx > $tdir/$$.tmp;
22512 if $contains "\.xs$" $tdir/$$.tmp > /dev/null 2>&1; then
22513 xs_extensions="$xs_extensions $this_ext";
22514 elif $contains "\.c$" $tdir/$$.tmp > /dev/null 2>&1; then
22515 xs_extensions="$xs_extensions $this_ext";
22516 elif $test -d $xxx; then
22517 nonxs_extensions="$nonxs_extensions $this_ext";
22519 $rm -f $tdir/$$.tmp;
22527 eval $find_extensions
22531 eval $find_extensions
22535 eval $find_extensions
22536 set X $xs_extensions
22538 xs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
22539 set X $nonxs_extensions
22541 nonxs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
22543 known_extensions=`echo $nonxs_extensions $xs_extensions | tr ' ' $trnl | $sort | tr $trnl ' '`
22545 : Now see which are supported on this system.
22547 for xxx in $xs_extensions ; do
22551 $define) avail_ext="$avail_ext $xxx" ;;
22554 GDBM_File|gdbm_fil)
22556 $define) avail_ext="$avail_ext $xxx" ;;
22559 I18N/Langinfo|i18n_lan)
22560 case "$i_langinfo$d_nl_langinfo" in
22561 $define$define) avail_ext="$avail_ext $xxx" ;;
22565 : XXX Do we need a useipcsysv variable here
22566 case "${d_msg}${d_sem}${d_shm}" in
22567 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
22570 NDBM_File|ndbm_fil)
22573 case "$osname-$use64bitint" in
22576 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
22579 *) avail_ext="$avail_ext $xxx" ;;
22584 ODBM_File|odbm_fil)
22585 case "${i_dbm}${i_rpcsvcdbm}" in
22587 case "$d_cplusplus" in
22588 define) ;; # delete as a function name will not work
22589 *) case "$osname-$use64bitint" in
22592 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
22595 *) avail_ext="$avail_ext $xxx" ;;
22603 case "$useopcode" in
22604 true|define|y) avail_ext="$avail_ext $xxx" ;;
22608 case "$useposix" in
22609 true|define|y) avail_ext="$avail_ext $xxx" ;;
22613 case "$d_socket" in
22614 true|$define|y) avail_ext="$avail_ext $xxx" ;;
22617 Sys/Syslog|sys/syslog)
22618 : XXX syslog requires socket
22619 case "$d_socket" in
22620 true|$define|y) avail_ext="$avail_ext $xxx" ;;
22624 case "$usethreads" in
22626 case "$use5005threads" in
22627 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
22631 threads|threads/shared)
22632 # threads and threads::shared are special cases.
22633 # To stop people from asking "Perl 5.8.0 was supposed
22634 # to have this new fancy threads implementation but my
22635 # perl doesn't have it" and from people trying to
22636 # (re)install the threads module using CPAN.pm and
22637 # CPAN.pm then offering to reinstall Perl 5.8.0,
22638 # the threads.pm and threads/shared.pm will always be
22639 # there, croaking informatively ("you need to rebuild
22640 # all of Perl with threads, sorry") when threads haven't
22641 # been compiled in.
22643 avail_ext="$avail_ext $xxx"
22649 cygwin) avail_ext="$avail_ext $xxx" ;;
22652 XS/APItest|xs/apitest)
22653 # This is just for testing. Skip it unless we have dynamic loading.
22656 $define) avail_ext="$avail_ext $xxx" ;;
22659 XS/Typemap|xs/typemap)
22660 # This is just for testing. Skip it unless we have dynamic loading.
22662 $define) avail_ext="$avail_ext $xxx" ;;
22665 *) avail_ext="$avail_ext $xxx"
22674 case "$onlyextensions" in
22676 *) keepextensions=''
22677 echo "You have requested that only certain extensions be included..." >&4
22678 for i in $onlyextensions; do
22679 case " $avail_ext " in
22681 echo "Keeping extension $i."
22682 keepextensions="$keepextensions $i"
22684 *) echo "Ignoring extension $i." ;;
22687 avail_ext="$keepextensions"
22691 case "$noextensions" in
22693 *) keepextensions=''
22694 echo "You have requested that certain extensions be ignored..." >&4
22695 for i in $avail_ext; do
22696 case " $noextensions " in
22697 *" $i "*) echo "Ignoring extension $i." ;;
22698 *) echo "Keeping extension $i.";
22699 keepextensions="$keepextensions $i"
22703 avail_ext="$keepextensions"
22707 : Now see which nonxs extensions are supported on this system.
22708 : For now assume all are.
22710 for xxx in $nonxs_extensions ; do
22714 *) nonxs_ext="$nonxs_ext $xxx"
22726 A number of extensions are supplied with $package. You may choose to
22727 compile these extensions for dynamic loading (the default), compile
22728 them into the $package executable (static loading), or not include
22729 them at all. Answer "none" to include no extensions.
22730 Note that DynaLoader is always built and need not be mentioned here.
22733 case "$dynamic_ext" in
22735 : Exclude those listed in static_ext
22737 for xxx in $avail_ext; do
22738 case " $static_ext " in
22740 *) dflt="$dflt $xxx" ;;
22747 *) dflt="$dynamic_ext"
22748 # Perhaps we are reusing an old out-of-date config.sh.
22751 if test X"$dynamic_ext" != X"$avail_ext"; then
22753 NOTICE: Your previous config.sh list may be incorrect.
22754 The extensions now available to you are
22756 but the default list from your previous config.sh is
22768 rp="What extensions do you wish to load dynamically?"
22771 none) dynamic_ext=' ' ;;
22772 *) dynamic_ext="$ans" ;;
22775 case "$static_ext" in
22777 : Exclude those already listed in dynamic linking
22779 for xxx in $avail_ext; do
22780 case " $dynamic_ext " in
22782 *) dflt="$dflt $xxx" ;;
22789 *) dflt="$static_ext"
22796 rp="What extensions do you wish to load statically?"
22799 none) static_ext=' ' ;;
22800 *) static_ext="$ans" ;;
22805 A number of extensions are supplied with $package. Answer "none"
22806 to include no extensions.
22807 Note that DynaLoader is always built and need not be mentioned here.
22810 case "$static_ext" in
22811 '') dflt="$avail_ext" ;;
22812 *) dflt="$static_ext"
22813 # Perhaps we are reusing an old out-of-date config.sh.
22816 if test X"$static_ext" != X"$avail_ext"; then
22818 NOTICE: Your previous config.sh list may be incorrect.
22819 The extensions now available to you are
22821 but the default list from your previous config.sh is
22830 : Exclude those that are not xs extensions
22834 rp="What extensions do you wish to include?"
22837 none) static_ext=' ' ;;
22838 *) static_ext="$ans" ;;
22843 # Encode is a special case. If we are building Encode as a static
22844 # extension, we need to explicitly list its subextensions as well.
22845 # For other nested extensions, this is handled automatically by
22846 # the appropriate Makefile.PL.
22847 case " $static_ext " in
22848 *" Encode "*) # Add the subextensions of Encode
22850 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
22851 static_ext="$static_ext Encode/$xxx"
22852 known_extensions="$known_extensions Encode/$xxx"
22858 set X $dynamic_ext $static_ext $nonxs_ext
22862 # Sanity check: We require an extension suitable for use with
22863 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
22864 # should show up as failures in the test suite, but it's helpful to
22865 # catch them now.) The 'extensions' list is normally sorted
22866 # alphabetically, so we need to accept either
22867 # DB_File ... Fcntl ... IO ....
22868 # or something like
22869 # Fcntl ... NDBM_File ... IO ....
22870 case " $extensions" in
22871 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
22872 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
22873 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
22874 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
22875 echo "WARNING: The Perl you are building will be quite crippled." >& 4
22879 : Remove libraries needed only for extensions
22880 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
22881 : The exception is SunOS 4.x, which needs them.
22882 case "${osname}X${osvers}" in
22886 *) case "$usedl" in
22887 $define|true|[yY]*)
22888 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
22892 *) perllibs="$libs"
22898 : Remove build directory name from cppstdin so it can be used from
22899 : either the present location or the final installed location.
22901 : Get out of the UU directory to get correct path name.
22903 case "$cppstdin" in
22905 echo "Stripping down cppstdin path name"
22911 : end of configuration questions
22913 echo "End of configuration questions."
22916 : back to where it started
22917 if test -d ../UU; then
22921 : configuration may be unconditionally patched via a 'config.arch' file
22922 if $test -f config.arch; then
22923 echo "I see a config.arch file, loading it." >&4
22927 : configuration may be patched via a 'config.over' file
22928 if $test -f config.over; then
22931 rp='I see a config.over file. Do you wish to load it?'
22934 n*) echo "OK, I'll ignore it.";;
22936 echo "Configuration override changes have been loaded."
22941 : in case they want portability, strip down executable paths
22942 case "$d_portable" in
22945 echo "Stripping down executable paths..." >&4
22946 for file in $loclist $trylist; do
22948 eval $file=`basename $temp`
22953 : create config.sh file
22955 echo "Creating config.sh..." >&4
22956 $spitshell <<EOT >config.sh
22959 # This file was produced by running the Configure script. It holds all the
22960 # definitions figured out by Configure. Should you modify one of these values,
22961 # do not forget to propagate your changes by running "Configure -der". You may
22962 # instead choose to run each of the .SH files by yourself, or "Configure -S".
22965 # Package name : $package
22966 # Source directory : $src
22967 # Configuration time: $cf_time
22968 # Configured by : $cf_by
22969 # Target system : $myuname
22972 : Add in command line options if available
22973 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
22975 $spitshell <<EOT >>config.sh
22984 Revision='$Revision'
22992 alignbytes='$alignbytes'
22993 ansi2knr='$ansi2knr'
22994 aphostname='$aphostname'
22995 api_revision='$api_revision'
22996 api_subversion='$api_subversion'
22997 api_version='$api_version'
22998 api_versionstring='$api_versionstring'
23001 archlibexp='$archlibexp'
23002 archname64='$archname64'
23003 archname='$archname'
23004 archobjs='$archobjs'
23005 asctime_r_proto='$asctime_r_proto'
23014 byteorder='$byteorder'
23016 castflags='$castflags'
23019 cccdlflags='$cccdlflags'
23020 ccdlflags='$ccdlflags'
23022 ccflags_uselargefiles='$ccflags_uselargefiles'
23024 ccsymbols='$ccsymbols'
23025 ccversion='$ccversion'
23027 cf_email='$cf_email'
23029 charbits='$charbits'
23030 charsize='$charsize'
23034 clocktype='$clocktype'
23036 compress='$compress'
23037 contains='$contains'
23041 cpp_stuff='$cpp_stuff'
23042 cppccsymbols='$cppccsymbols'
23043 cppflags='$cppflags'
23045 cppminus='$cppminus'
23047 cppstdin='$cppstdin'
23048 cppsymbols='$cppsymbols'
23049 crypt_r_proto='$crypt_r_proto'
23050 cryptlib='$cryptlib'
23052 ctermid_r_proto='$ctermid_r_proto'
23053 ctime_r_proto='$ctime_r_proto'
23054 d_Gconvert='$d_Gconvert'
23055 d_PRIEUldbl='$d_PRIEUldbl'
23056 d_PRIFUldbl='$d_PRIFUldbl'
23057 d_PRIGUldbl='$d_PRIGUldbl'
23058 d_PRIXU64='$d_PRIXU64'
23059 d_PRId64='$d_PRId64'
23060 d_PRIeldbl='$d_PRIeldbl'
23061 d_PRIfldbl='$d_PRIfldbl'
23062 d_PRIgldbl='$d_PRIgldbl'
23063 d_PRIi64='$d_PRIi64'
23064 d_PRIo64='$d_PRIo64'
23065 d_PRIu64='$d_PRIu64'
23066 d_PRIx64='$d_PRIx64'
23067 d_SCNfldbl='$d_SCNfldbl'
23068 d__fwalk='$d__fwalk'
23069 d_access='$d_access'
23070 d_accessx='$d_accessx'
23073 d_archlib='$d_archlib'
23074 d_asctime64='$d_asctime64'
23075 d_asctime_r='$d_asctime_r'
23078 d_attribute_deprecated='$d_attribute_deprecated'
23079 d_attribute_format='$d_attribute_format'
23080 d_attribute_malloc='$d_attribute_malloc'
23081 d_attribute_nonnull='$d_attribute_nonnull'
23082 d_attribute_noreturn='$d_attribute_noreturn'
23083 d_attribute_pure='$d_attribute_pure'
23084 d_attribute_unused='$d_attribute_unused'
23085 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
23086 d_backtrace='$d_backtrace'
23090 d_bsdgetpgrp='$d_bsdgetpgrp'
23091 d_bsdsetpgrp='$d_bsdsetpgrp'
23092 d_builtin_choose_expr='$d_builtin_choose_expr'
23093 d_builtin_expect='$d_builtin_expect'
23095 d_c99_variadic_macros='$d_c99_variadic_macros'
23096 d_casti32='$d_casti32'
23097 d_castneg='$d_castneg'
23098 d_charvspr='$d_charvspr'
23100 d_chroot='$d_chroot'
23101 d_chsize='$d_chsize'
23103 d_clearenv='$d_clearenv'
23104 d_closedir='$d_closedir'
23105 d_cmsghdr_s='$d_cmsghdr_s'
23107 d_copysignl='$d_copysignl'
23108 d_cplusplus='$d_cplusplus'
23110 d_crypt_r='$d_crypt_r'
23112 d_ctermid='$d_ctermid'
23113 d_ctermid_r='$d_ctermid_r'
23114 d_ctime64='$d_ctime64'
23115 d_ctime_r='$d_ctime_r'
23116 d_cuserid='$d_cuserid'
23117 d_dbl_dig='$d_dbl_dig'
23118 d_dbminitproto='$d_dbminitproto'
23119 d_difftime64='$d_difftime64'
23120 d_difftime='$d_difftime'
23121 d_dir_dd_fd='$d_dir_dd_fd'
23123 d_dirnamlen='$d_dirnamlen'
23124 d_dladdr='$d_dladdr'
23125 d_dlerror='$d_dlerror'
23126 d_dlopen='$d_dlopen'
23127 d_dlsymun='$d_dlsymun'
23128 d_dosuid='$d_dosuid'
23129 d_drand48_r='$d_drand48_r'
23130 d_drand48proto='$d_drand48proto'
23132 d_eaccess='$d_eaccess'
23133 d_endgrent='$d_endgrent'
23134 d_endgrent_r='$d_endgrent_r'
23135 d_endhent='$d_endhent'
23136 d_endhostent_r='$d_endhostent_r'
23137 d_endnent='$d_endnent'
23138 d_endnetent_r='$d_endnetent_r'
23139 d_endpent='$d_endpent'
23140 d_endprotoent_r='$d_endprotoent_r'
23141 d_endpwent='$d_endpwent'
23142 d_endpwent_r='$d_endpwent_r'
23143 d_endsent='$d_endsent'
23144 d_endservent_r='$d_endservent_r'
23145 d_eofnblk='$d_eofnblk'
23146 d_eunice='$d_eunice'
23147 d_faststdio='$d_faststdio'
23148 d_fchdir='$d_fchdir'
23149 d_fchmod='$d_fchmod'
23150 d_fchown='$d_fchown'
23152 d_fcntl_can_lock='$d_fcntl_can_lock'
23153 d_fd_macros='$d_fd_macros'
23154 d_fd_set='$d_fd_set'
23155 d_fds_bits='$d_fds_bits'
23156 d_fgetpos='$d_fgetpos'
23157 d_finite='$d_finite'
23158 d_finitel='$d_finitel'
23159 d_flexfnam='$d_flexfnam'
23161 d_flockproto='$d_flockproto'
23163 d_fp_class='$d_fp_class'
23164 d_fpathconf='$d_fpathconf'
23165 d_fpclass='$d_fpclass'
23166 d_fpclassify='$d_fpclassify'
23167 d_fpclassl='$d_fpclassl'
23168 d_fpos64_t='$d_fpos64_t'
23169 d_frexpl='$d_frexpl'
23170 d_fs_data_s='$d_fs_data_s'
23171 d_fseeko='$d_fseeko'
23172 d_fsetpos='$d_fsetpos'
23173 d_fstatfs='$d_fstatfs'
23174 d_fstatvfs='$d_fstatvfs'
23176 d_ftello='$d_ftello'
23178 d_futimes='$d_futimes'
23179 d_gdbm_ndbm_h_uses_prototypes='$d_gdbm_ndbm_h_uses_prototypes'
23180 d_gdbmndbm_h_uses_prototypes='$d_gdbmndbm_h_uses_prototypes'
23181 d_getaddrinfo='$d_getaddrinfo'
23182 d_getcwd='$d_getcwd'
23183 d_getespwnam='$d_getespwnam'
23184 d_getfsstat='$d_getfsstat'
23185 d_getgrent='$d_getgrent'
23186 d_getgrent_r='$d_getgrent_r'
23187 d_getgrgid_r='$d_getgrgid_r'
23188 d_getgrnam_r='$d_getgrnam_r'
23189 d_getgrps='$d_getgrps'
23190 d_gethbyaddr='$d_gethbyaddr'
23191 d_gethbyname='$d_gethbyname'
23192 d_gethent='$d_gethent'
23193 d_gethname='$d_gethname'
23194 d_gethostbyaddr_r='$d_gethostbyaddr_r'
23195 d_gethostbyname_r='$d_gethostbyname_r'
23196 d_gethostent_r='$d_gethostent_r'
23197 d_gethostprotos='$d_gethostprotos'
23198 d_getitimer='$d_getitimer'
23199 d_getlogin='$d_getlogin'
23200 d_getlogin_r='$d_getlogin_r'
23201 d_getmnt='$d_getmnt'
23202 d_getmntent='$d_getmntent'
23203 d_getnameinfo='$d_getnameinfo'
23204 d_getnbyaddr='$d_getnbyaddr'
23205 d_getnbyname='$d_getnbyname'
23206 d_getnent='$d_getnent'
23207 d_getnetbyaddr_r='$d_getnetbyaddr_r'
23208 d_getnetbyname_r='$d_getnetbyname_r'
23209 d_getnetent_r='$d_getnetent_r'
23210 d_getnetprotos='$d_getnetprotos'
23211 d_getpagsz='$d_getpagsz'
23212 d_getpbyname='$d_getpbyname'
23213 d_getpbynumber='$d_getpbynumber'
23214 d_getpent='$d_getpent'
23215 d_getpgid='$d_getpgid'
23216 d_getpgrp2='$d_getpgrp2'
23217 d_getpgrp='$d_getpgrp'
23218 d_getppid='$d_getppid'
23219 d_getprior='$d_getprior'
23220 d_getprotobyname_r='$d_getprotobyname_r'
23221 d_getprotobynumber_r='$d_getprotobynumber_r'
23222 d_getprotoent_r='$d_getprotoent_r'
23223 d_getprotoprotos='$d_getprotoprotos'
23224 d_getprpwnam='$d_getprpwnam'
23225 d_getpwent='$d_getpwent'
23226 d_getpwent_r='$d_getpwent_r'
23227 d_getpwnam_r='$d_getpwnam_r'
23228 d_getpwuid_r='$d_getpwuid_r'
23229 d_getsbyname='$d_getsbyname'
23230 d_getsbyport='$d_getsbyport'
23231 d_getsent='$d_getsent'
23232 d_getservbyname_r='$d_getservbyname_r'
23233 d_getservbyport_r='$d_getservbyport_r'
23234 d_getservent_r='$d_getservent_r'
23235 d_getservprotos='$d_getservprotos'
23236 d_getspnam='$d_getspnam'
23237 d_getspnam_r='$d_getspnam_r'
23238 d_gettimeod='$d_gettimeod'
23239 d_gmtime64='$d_gmtime64'
23240 d_gmtime_r='$d_gmtime_r'
23241 d_gnulibc='$d_gnulibc'
23242 d_grpasswd='$d_grpasswd'
23243 d_hasmntopt='$d_hasmntopt'
23245 d_ilogbl='$d_ilogbl'
23246 d_inc_version_list='$d_inc_version_list'
23248 d_inetaton='$d_inetaton'
23249 d_inetntop='$d_inetntop'
23250 d_inetpton='$d_inetpton'
23251 d_int64_t='$d_int64_t'
23252 d_ip_mreq='$d_ip_mreq'
23253 d_ip_mreq_source='$d_ip_mreq_source'
23254 d_ipv6_mreq='$d_ipv6_mreq'
23255 d_ipv6_mreq_source='$d_ipv6_mreq_source'
23256 d_isascii='$d_isascii'
23257 d_isblank='$d_isblank'
23258 d_isfinite='$d_isfinite'
23261 d_isnanl='$d_isnanl'
23262 d_killpg='$d_killpg'
23263 d_lchown='$d_lchown'
23264 d_ldbl_dig='$d_ldbl_dig'
23265 d_libm_lib_version='$d_libm_lib_version'
23266 d_libname_unique='$d_libname_unique'
23268 d_localtime64='$d_localtime64'
23269 d_localtime_r='$d_localtime_r'
23270 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
23271 d_locconv='$d_locconv'
23273 d_longdbl='$d_longdbl'
23274 d_longlong='$d_longlong'
23275 d_lseekproto='$d_lseekproto'
23277 d_madvise='$d_madvise'
23278 d_malloc_good_size='$d_malloc_good_size'
23279 d_malloc_size='$d_malloc_size'
23281 d_mbstowcs='$d_mbstowcs'
23282 d_mbtowc='$d_mbtowc'
23283 d_memchr='$d_memchr'
23284 d_memcmp='$d_memcmp'
23285 d_memcpy='$d_memcpy'
23286 d_memmove='$d_memmove'
23287 d_memset='$d_memset'
23289 d_mkdtemp='$d_mkdtemp'
23290 d_mkfifo='$d_mkfifo'
23291 d_mkstemp='$d_mkstemp'
23292 d_mkstemps='$d_mkstemps'
23293 d_mktime64='$d_mktime64'
23294 d_mktime='$d_mktime'
23297 d_modfl_pow32_bug='$d_modfl_pow32_bug'
23298 d_modflproto='$d_modflproto'
23299 d_mprotect='$d_mprotect'
23301 d_msg_ctrunc='$d_msg_ctrunc'
23302 d_msg_dontroute='$d_msg_dontroute'
23303 d_msg_oob='$d_msg_oob'
23304 d_msg_peek='$d_msg_peek'
23305 d_msg_proxy='$d_msg_proxy'
23306 d_msgctl='$d_msgctl'
23307 d_msgget='$d_msgget'
23308 d_msghdr_s='$d_msghdr_s'
23309 d_msgrcv='$d_msgrcv'
23310 d_msgsnd='$d_msgsnd'
23312 d_munmap='$d_munmap'
23313 d_mymalloc='$d_mymalloc'
23315 d_ndbm_h_uses_prototypes='$d_ndbm_h_uses_prototypes'
23317 d_nl_langinfo='$d_nl_langinfo'
23318 d_nv_preserves_uv='$d_nv_preserves_uv'
23319 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
23320 d_off64_t='$d_off64_t'
23321 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
23322 d_oldpthreads='$d_oldpthreads'
23323 d_oldsock='$d_oldsock'
23325 d_pathconf='$d_pathconf'
23327 d_perl_otherlibdirs='$d_perl_otherlibdirs'
23328 d_phostname='$d_phostname'
23331 d_portable='$d_portable'
23333 d_prctl_set_name='$d_prctl_set_name'
23334 d_printf_format_null='$d_printf_format_null'
23335 d_procselfexe='$d_procselfexe'
23336 d_pseudofork='$d_pseudofork'
23337 d_pthread_atfork='$d_pthread_atfork'
23338 d_pthread_attr_setscope='$d_pthread_attr_setscope'
23339 d_pthread_yield='$d_pthread_yield'
23341 d_pwchange='$d_pwchange'
23342 d_pwclass='$d_pwclass'
23343 d_pwcomment='$d_pwcomment'
23344 d_pwexpire='$d_pwexpire'
23345 d_pwgecos='$d_pwgecos'
23346 d_pwpasswd='$d_pwpasswd'
23347 d_pwquota='$d_pwquota'
23350 d_random_r='$d_random_r'
23351 d_readdir64_r='$d_readdir64_r'
23352 d_readdir='$d_readdir'
23353 d_readdir_r='$d_readdir_r'
23354 d_readlink='$d_readlink'
23356 d_recvmsg='$d_recvmsg'
23357 d_rename='$d_rename'
23358 d_rewinddir='$d_rewinddir'
23360 d_safebcpy='$d_safebcpy'
23361 d_safemcpy='$d_safemcpy'
23362 d_sanemcmp='$d_sanemcmp'
23363 d_sbrkproto='$d_sbrkproto'
23364 d_scalbnl='$d_scalbnl'
23365 d_sched_yield='$d_sched_yield'
23366 d_scm_rights='$d_scm_rights'
23367 d_seekdir='$d_seekdir'
23368 d_select='$d_select'
23370 d_semctl='$d_semctl'
23371 d_semctl_semid_ds='$d_semctl_semid_ds'
23372 d_semctl_semun='$d_semctl_semun'
23373 d_semget='$d_semget'
23375 d_sendmsg='$d_sendmsg'
23376 d_setegid='$d_setegid'
23377 d_seteuid='$d_seteuid'
23378 d_setgrent='$d_setgrent'
23379 d_setgrent_r='$d_setgrent_r'
23380 d_setgrps='$d_setgrps'
23381 d_sethent='$d_sethent'
23382 d_sethostent_r='$d_sethostent_r'
23383 d_setitimer='$d_setitimer'
23384 d_setlinebuf='$d_setlinebuf'
23385 d_setlocale='$d_setlocale'
23386 d_setlocale_r='$d_setlocale_r'
23387 d_setnent='$d_setnent'
23388 d_setnetent_r='$d_setnetent_r'
23389 d_setpent='$d_setpent'
23390 d_setpgid='$d_setpgid'
23391 d_setpgrp2='$d_setpgrp2'
23392 d_setpgrp='$d_setpgrp'
23393 d_setprior='$d_setprior'
23394 d_setproctitle='$d_setproctitle'
23395 d_setprotoent_r='$d_setprotoent_r'
23396 d_setpwent='$d_setpwent'
23397 d_setpwent_r='$d_setpwent_r'
23398 d_setregid='$d_setregid'
23399 d_setresgid='$d_setresgid'
23400 d_setresuid='$d_setresuid'
23401 d_setreuid='$d_setreuid'
23402 d_setrgid='$d_setrgid'
23403 d_setruid='$d_setruid'
23404 d_setsent='$d_setsent'
23405 d_setservent_r='$d_setservent_r'
23406 d_setsid='$d_setsid'
23407 d_setvbuf='$d_setvbuf'
23410 d_shmatprototype='$d_shmatprototype'
23411 d_shmctl='$d_shmctl'
23413 d_shmget='$d_shmget'
23414 d_sigaction='$d_sigaction'
23415 d_signbit='$d_signbit'
23416 d_sigprocmask='$d_sigprocmask'
23417 d_sigsetjmp='$d_sigsetjmp'
23418 d_sin6_scope_id='$d_sin6_scope_id'
23419 d_sitearch='$d_sitearch'
23420 d_snprintf='$d_snprintf'
23421 d_sockaddr_in6='$d_sockaddr_in6'
23422 d_sockaddr_sa_len='$d_sockaddr_sa_len'
23423 d_sockatmark='$d_sockatmark'
23424 d_sockatmarkproto='$d_sockatmarkproto'
23425 d_socket='$d_socket'
23426 d_socklen_t='$d_socklen_t'
23427 d_sockpair='$d_sockpair'
23428 d_socks5_init='$d_socks5_init'
23429 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
23431 d_srand48_r='$d_srand48_r'
23432 d_srandom_r='$d_srandom_r'
23433 d_sresgproto='$d_sresgproto'
23434 d_sresuproto='$d_sresuproto'
23435 d_statblks='$d_statblks'
23436 d_statfs_f_flags='$d_statfs_f_flags'
23437 d_statfs_s='$d_statfs_s'
23438 d_static_inline='$d_static_inline'
23439 d_statvfs='$d_statvfs'
23440 d_stdio_cnt_lval='$d_stdio_cnt_lval'
23441 d_stdio_ptr_lval='$d_stdio_ptr_lval'
23442 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
23443 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
23444 d_stdio_stream_array='$d_stdio_stream_array'
23445 d_stdiobase='$d_stdiobase'
23446 d_stdstdio='$d_stdstdio'
23447 d_strchr='$d_strchr'
23448 d_strcoll='$d_strcoll'
23449 d_strctcpy='$d_strctcpy'
23450 d_strerrm='$d_strerrm'
23451 d_strerror='$d_strerror'
23452 d_strerror_r='$d_strerror_r'
23453 d_strftime='$d_strftime'
23454 d_strlcat='$d_strlcat'
23455 d_strlcpy='$d_strlcpy'
23456 d_strtod='$d_strtod'
23457 d_strtol='$d_strtol'
23458 d_strtold='$d_strtold'
23459 d_strtoll='$d_strtoll'
23460 d_strtoq='$d_strtoq'
23461 d_strtoul='$d_strtoul'
23462 d_strtoull='$d_strtoull'
23463 d_strtouq='$d_strtouq'
23464 d_strxfrm='$d_strxfrm'
23465 d_suidsafe='$d_suidsafe'
23466 d_symlink='$d_symlink'
23467 d_syscall='$d_syscall'
23468 d_syscallproto='$d_syscallproto'
23469 d_sysconf='$d_sysconf'
23470 d_sysernlst='$d_sysernlst'
23471 d_syserrlst='$d_syserrlst'
23472 d_system='$d_system'
23473 d_tcgetpgrp='$d_tcgetpgrp'
23474 d_tcsetpgrp='$d_tcsetpgrp'
23475 d_telldir='$d_telldir'
23476 d_telldirproto='$d_telldirproto'
23478 d_timegm='$d_timegm'
23480 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
23481 d_tm_tm_zone='$d_tm_tm_zone'
23482 d_tmpnam_r='$d_tmpnam_r'
23483 d_truncate='$d_truncate'
23484 d_ttyname_r='$d_ttyname_r'
23485 d_tzname='$d_tzname'
23486 d_u32align='$d_u32align'
23487 d_ualarm='$d_ualarm'
23490 d_union_semun='$d_union_semun'
23491 d_unordered='$d_unordered'
23492 d_unsetenv='$d_unsetenv'
23493 d_usleep='$d_usleep'
23494 d_usleepproto='$d_usleepproto'
23496 d_vendorarch='$d_vendorarch'
23497 d_vendorbin='$d_vendorbin'
23498 d_vendorlib='$d_vendorlib'
23499 d_vendorscript='$d_vendorscript'
23501 d_void_closedir='$d_void_closedir'
23502 d_voidsig='$d_voidsig'
23503 d_voidtty='$d_voidtty'
23504 d_volatile='$d_volatile'
23505 d_vprintf='$d_vprintf'
23506 d_vsnprintf='$d_vsnprintf'
23508 d_waitpid='$d_waitpid'
23509 d_wcscmp='$d_wcscmp'
23510 d_wcstombs='$d_wcstombs'
23511 d_wcsxfrm='$d_wcsxfrm'
23512 d_wctomb='$d_wctomb'
23513 d_writev='$d_writev'
23516 db_hashtype='$db_hashtype'
23517 db_prefixtype='$db_prefixtype'
23518 db_version_major='$db_version_major'
23519 db_version_minor='$db_version_minor'
23520 db_version_patch='$db_version_patch'
23521 direntrytype='$direntrytype'
23524 doublesize='$doublesize'
23526 drand48_r_proto='$drand48_r_proto'
23528 dynamic_ext='$dynamic_ext'
23534 endgrent_r_proto='$endgrent_r_proto'
23535 endhostent_r_proto='$endhostent_r_proto'
23536 endnetent_r_proto='$endnetent_r_proto'
23537 endprotoent_r_proto='$endprotoent_r_proto'
23538 endpwent_r_proto='$endpwent_r_proto'
23539 endservent_r_proto='$endservent_r_proto'
23540 eunicefix='$eunicefix'
23543 extensions='$extensions'
23544 extern_C='$extern_C'
23546 fflushNULL='$fflushNULL'
23547 fflushall='$fflushall'
23549 firstmakefile='$firstmakefile'
23551 fpossize='$fpossize'
23552 fpostype='$fpostype'
23553 freetype='$freetype'
23556 full_csh='$full_csh'
23557 full_sed='$full_sed'
23558 gccansipedantic='$gccansipedantic'
23559 gccosandvers='$gccosandvers'
23560 gccversion='$gccversion'
23561 getgrent_r_proto='$getgrent_r_proto'
23562 getgrgid_r_proto='$getgrgid_r_proto'
23563 getgrnam_r_proto='$getgrnam_r_proto'
23564 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
23565 gethostbyname_r_proto='$gethostbyname_r_proto'
23566 gethostent_r_proto='$gethostent_r_proto'
23567 getlogin_r_proto='$getlogin_r_proto'
23568 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
23569 getnetbyname_r_proto='$getnetbyname_r_proto'
23570 getnetent_r_proto='$getnetent_r_proto'
23571 getprotobyname_r_proto='$getprotobyname_r_proto'
23572 getprotobynumber_r_proto='$getprotobynumber_r_proto'
23573 getprotoent_r_proto='$getprotoent_r_proto'
23574 getpwent_r_proto='$getpwent_r_proto'
23575 getpwnam_r_proto='$getpwnam_r_proto'
23576 getpwuid_r_proto='$getpwuid_r_proto'
23577 getservbyname_r_proto='$getservbyname_r_proto'
23578 getservbyport_r_proto='$getservbyport_r_proto'
23579 getservent_r_proto='$getservent_r_proto'
23580 getspnam_r_proto='$getspnam_r_proto'
23581 gidformat='$gidformat'
23587 gmtime_r_proto='$gmtime_r_proto'
23588 gnulibc_version='$gnulibc_version'
23590 groupcat='$groupcat'
23591 groupstype='$groupstype'
23594 h_sysfile='$h_sysfile'
23597 hostgenerate='$hostgenerate'
23598 hostosname='$hostosname'
23599 hostperl='$hostperl'
23600 html1dir='$html1dir'
23601 html1direxp='$html1direxp'
23602 html3dir='$html3dir'
23603 html3direxp='$html3direxp'
23612 i_arpainet='$i_arpainet'
23613 i_assert='$i_assert'
23615 i_bsdioctl='$i_bsdioctl'
23619 i_dirent='$i_dirent'
23621 i_execinfo='$i_execinfo'
23625 i_fp_class='$i_fp_class'
23627 i_gdbm_ndbm='$i_gdbm_ndbm'
23628 i_gdbmndbm='$i_gdbmndbm'
23630 i_ieeefp='$i_ieeefp'
23631 i_inttypes='$i_inttypes'
23632 i_langinfo='$i_langinfo'
23633 i_libutil='$i_libutil'
23634 i_limits='$i_limits'
23635 i_locale='$i_locale'
23636 i_machcthr='$i_machcthr'
23637 i_malloc='$i_malloc'
23638 i_mallocmalloc='$i_mallocmalloc'
23640 i_memory='$i_memory'
23641 i_mntent='$i_mntent'
23644 i_neterrno='$i_neterrno'
23645 i_netinettcp='$i_netinettcp'
23649 i_pthread='$i_pthread'
23651 i_rpcsvcdbm='$i_rpcsvcdbm'
23653 i_shadow='$i_shadow'
23655 i_stdarg='$i_stdarg'
23656 i_stdbool='$i_stdbool'
23657 i_stddef='$i_stddef'
23658 i_stdlib='$i_stdlib'
23659 i_string='$i_string'
23660 i_sunmath='$i_sunmath'
23661 i_sysaccess='$i_sysaccess'
23662 i_sysdir='$i_sysdir'
23663 i_sysfile='$i_sysfile'
23664 i_sysfilio='$i_sysfilio'
23666 i_sysioctl='$i_sysioctl'
23667 i_syslog='$i_syslog'
23668 i_sysmman='$i_sysmman'
23669 i_sysmode='$i_sysmode'
23670 i_sysmount='$i_sysmount'
23671 i_sysndir='$i_sysndir'
23672 i_sysparam='$i_sysparam'
23673 i_syspoll='$i_syspoll'
23674 i_sysresrc='$i_sysresrc'
23675 i_syssecrt='$i_syssecrt'
23676 i_sysselct='$i_sysselct'
23677 i_syssockio='$i_syssockio'
23678 i_sysstat='$i_sysstat'
23679 i_sysstatfs='$i_sysstatfs'
23680 i_sysstatvfs='$i_sysstatvfs'
23681 i_systime='$i_systime'
23682 i_systimek='$i_systimek'
23683 i_systimes='$i_systimes'
23684 i_systypes='$i_systypes'
23685 i_sysuio='$i_sysuio'
23687 i_sysutsname='$i_sysutsname'
23688 i_sysvfs='$i_sysvfs'
23689 i_syswait='$i_syswait'
23690 i_termio='$i_termio'
23691 i_termios='$i_termios'
23693 i_unistd='$i_unistd'
23696 i_values='$i_values'
23697 i_varargs='$i_varargs'
23698 i_varhdr='$i_varhdr'
23700 ignore_versioned_solibs='$ignore_versioned_solibs'
23701 inc_version_list='$inc_version_list'
23702 inc_version_list_init='$inc_version_list_init'
23706 initialinstalllocation='$initialinstalllocation'
23707 installarchlib='$installarchlib'
23708 installbin='$installbin'
23709 installhtml1dir='$installhtml1dir'
23710 installhtml3dir='$installhtml3dir'
23711 installman1dir='$installman1dir'
23712 installman3dir='$installman3dir'
23713 installprefix='$installprefix'
23714 installprefixexp='$installprefixexp'
23715 installprivlib='$installprivlib'
23716 installscript='$installscript'
23717 installsitearch='$installsitearch'
23718 installsitebin='$installsitebin'
23719 installsitehtml1dir='$installsitehtml1dir'
23720 installsitehtml3dir='$installsitehtml3dir'
23721 installsitelib='$installsitelib'
23722 installsiteman1dir='$installsiteman1dir'
23723 installsiteman3dir='$installsiteman3dir'
23724 installsitescript='$installsitescript'
23725 installstyle='$installstyle'
23726 installusrbinperl='$installusrbinperl'
23727 installvendorarch='$installvendorarch'
23728 installvendorbin='$installvendorbin'
23729 installvendorhtml1dir='$installvendorhtml1dir'
23730 installvendorhtml3dir='$installvendorhtml3dir'
23731 installvendorlib='$installvendorlib'
23732 installvendorman1dir='$installvendorman1dir'
23733 installvendorman3dir='$installvendorman3dir'
23734 installvendorscript='$installvendorscript'
23736 issymlink='$issymlink'
23737 ivdformat='$ivdformat'
23740 known_extensions='$known_extensions'
23743 ld_can_script='$ld_can_script'
23744 lddlflags='$lddlflags'
23746 ldflags_uselargefiles='$ldflags_uselargefiles'
23747 ldlibpthname='$ldlibpthname'
23754 libsdirs='$libsdirs'
23755 libsfiles='$libsfiles'
23756 libsfound='$libsfound'
23757 libspath='$libspath'
23758 libswanted='$libswanted'
23759 libswanted_uselargefiles='$libswanted_uselargefiles'
23765 localtime_r_proto='$localtime_r_proto'
23766 locincpth='$locincpth'
23767 loclibpth='$loclibpth'
23768 longdblsize='$longdblsize'
23769 longlongsize='$longlongsize'
23770 longsize='$longsize'
23774 lseeksize='$lseeksize'
23775 lseektype='$lseektype'
23778 madlyobj='$madlyobj'
23779 madlysrc='$madlysrc'
23783 make_set_make='$make_set_make'
23784 mallocobj='$mallocobj'
23785 mallocsrc='$mallocsrc'
23786 malloctype='$malloctype'
23788 man1direxp='$man1direxp'
23791 man3direxp='$man3direxp'
23793 mips_type='$mips_type'
23794 mistrustnm='$mistrustnm'
23796 mmaptype='$mmaptype'
23797 modetype='$modetype'
23799 multiarch='$multiarch'
23801 myarchname='$myarchname'
23802 mydomain='$mydomain'
23803 myhostname='$myhostname'
23806 need_va_copy='$need_va_copy'
23807 netdb_hlen_type='$netdb_hlen_type'
23808 netdb_host_type='$netdb_host_type'
23809 netdb_name_type='$netdb_name_type'
23810 netdb_net_type='$netdb_net_type'
23813 nm_so_opt='$nm_so_opt'
23814 nonxs_ext='$nonxs_ext'
23816 nvEUformat='$nvEUformat'
23817 nvFUformat='$nvFUformat'
23818 nvGUformat='$nvGUformat'
23819 nv_overflows_integers_at='$nv_overflows_integers_at'
23820 nv_preserves_uv_bits='$nv_preserves_uv_bits'
23821 nveformat='$nveformat'
23822 nvfformat='$nvfformat'
23823 nvgformat='$nvgformat'
23826 o_nonblock='$o_nonblock'
23828 old_pthread_create_joinable='$old_pthread_create_joinable'
23829 optimize='$optimize'
23830 orderlib='$orderlib'
23833 otherlibdirs='$otherlibdirs'
23837 patchlevel='$patchlevel'
23838 path_sep='$path_sep'
23841 perl_patchlevel='$perl_patchlevel'
23842 perl_static_inline='$perl_static_inline'
23843 perladmin='$perladmin'
23844 perllibs='$perllibs'
23845 perlpath='$perlpath'
23847 phostname='$phostname'
23853 prefixexp='$prefixexp'
23855 privlibexp='$privlibexp'
23856 procselfexe='$procselfexe'
23857 prototype='$prototype'
23859 quadkind='$quadkind'
23860 quadtype='$quadtype'
23861 randbits='$randbits'
23862 randfunc='$randfunc'
23863 random_r_proto='$random_r_proto'
23864 randseedtype='$randseedtype'
23866 rd_nodata='$rd_nodata'
23867 readdir64_r_proto='$readdir64_r_proto'
23868 readdir_r_proto='$readdir_r_proto'
23869 revision='$revision'
23875 sGMTIME_max='$sGMTIME_max'
23876 sGMTIME_min='$sGMTIME_min'
23877 sLOCALTIME_max='$sLOCALTIME_max'
23878 sLOCALTIME_min='$sLOCALTIME_min'
23879 sPRIEUldbl='$sPRIEUldbl'
23880 sPRIFUldbl='$sPRIFUldbl'
23881 sPRIGUldbl='$sPRIGUldbl'
23882 sPRIXU64='$sPRIXU64'
23884 sPRIeldbl='$sPRIeldbl'
23885 sPRIfldbl='$sPRIfldbl'
23886 sPRIgldbl='$sPRIgldbl'
23891 sSCNfldbl='$sSCNfldbl'
23892 sched_yield='$sched_yield'
23893 scriptdir='$scriptdir'
23894 scriptdirexp='$scriptdirexp'
23896 seedfunc='$seedfunc'
23897 selectminbits='$selectminbits'
23898 selecttype='$selecttype'
23899 sendmail='$sendmail'
23900 setgrent_r_proto='$setgrent_r_proto'
23901 sethostent_r_proto='$sethostent_r_proto'
23902 setlocale_r_proto='$setlocale_r_proto'
23903 setnetent_r_proto='$setnetent_r_proto'
23904 setprotoent_r_proto='$setprotoent_r_proto'
23905 setpwent_r_proto='$setpwent_r_proto'
23906 setservent_r_proto='$setservent_r_proto'
23909 sharpbang='$sharpbang'
23910 shmattype='$shmattype'
23911 shortsize='$shortsize'
23914 sig_count='$sig_count'
23915 sig_name='$sig_name'
23916 sig_name_init='$sig_name_init'
23918 sig_num_init='$sig_num_init'
23919 sig_size='$sig_size'
23920 signal_t='$signal_t'
23921 sitearch='$sitearch'
23922 sitearchexp='$sitearchexp'
23924 sitebinexp='$sitebinexp'
23925 sitehtml1dir='$sitehtml1dir'
23926 sitehtml1direxp='$sitehtml1direxp'
23927 sitehtml3dir='$sitehtml3dir'
23928 sitehtml3direxp='$sitehtml3direxp'
23930 sitelib_stem='$sitelib_stem'
23931 sitelibexp='$sitelibexp'
23932 siteman1dir='$siteman1dir'
23933 siteman1direxp='$siteman1direxp'
23934 siteman3dir='$siteman3dir'
23935 siteman3direxp='$siteman3direxp'
23936 siteprefix='$siteprefix'
23937 siteprefixexp='$siteprefixexp'
23938 sitescript='$sitescript'
23939 sitescriptexp='$sitescriptexp'
23940 sizesize='$sizesize'
23941 sizetype='$sizetype'
23945 sockethdr='$sockethdr'
23946 socketlib='$socketlib'
23947 socksizetype='$socksizetype'
23949 spackage='$spackage'
23950 spitshell='$spitshell'
23951 srand48_r_proto='$srand48_r_proto'
23952 srandom_r_proto='$srandom_r_proto'
23954 ssizetype='$ssizetype'
23955 st_ino_sign='$st_ino_sign'
23956 st_ino_size='$st_ino_size'
23957 startperl='$startperl'
23959 static_ext='$static_ext'
23961 stdio_base='$stdio_base'
23962 stdio_bufsiz='$stdio_bufsiz'
23963 stdio_cnt='$stdio_cnt'
23964 stdio_filbuf='$stdio_filbuf'
23965 stdio_ptr='$stdio_ptr'
23966 stdio_stream_array='$stdio_stream_array'
23967 strerror_r_proto='$strerror_r_proto'
23970 subversion='$subversion'
23975 targetarch='$targetarch'
23976 targetdir='$targetdir'
23977 targetenv='$targetenv'
23978 targethost='$targethost'
23979 targetmkdir='$targetmkdir'
23980 targetport='$targetport'
23981 targetsh='$targetsh'
23985 timeincl='$timeincl'
23986 timetype='$timetype'
23987 tmpnam_r_proto='$tmpnam_r_proto'
23993 ttyname_r_proto='$ttyname_r_proto'
24002 uidformat='$uidformat'
24008 uquadtype='$uquadtype'
24009 use5005threads='$use5005threads'
24010 use64bitall='$use64bitall'
24011 use64bitint='$use64bitint'
24012 usecbacktrace='$usecbacktrace'
24013 usecrosscompile='$usecrosscompile'
24014 usedevel='$usedevel'
24016 usedtrace='$usedtrace'
24017 usefaststdio='$usefaststdio'
24018 useithreads='$useithreads'
24019 usekernprocpathname='$usekernprocpathname'
24020 uselargefiles='$uselargefiles'
24021 uselongdouble='$uselongdouble'
24022 usemallocwrap='$usemallocwrap'
24023 usemorebits='$usemorebits'
24024 usemultiplicity='$usemultiplicity'
24025 usemymalloc='$usemymalloc'
24027 usensgetexecutablepath='$usensgetexecutablepath'
24028 useopcode='$useopcode'
24029 useperlio='$useperlio'
24030 useposix='$useposix'
24031 usereentrant='$usereentrant'
24032 userelocatableinc='$userelocatableinc'
24033 useshrplib='$useshrplib'
24034 usesitecustomize='$usesitecustomize'
24035 usesocks='$usesocks'
24036 usethreads='$usethreads'
24037 usevendorprefix='$usevendorprefix'
24038 useversionedarchname='$useversionedarchname'
24039 usevfork='$usevfork'
24042 uvXUformat='$uvXUformat'
24043 uvoformat='$uvoformat'
24046 uvuformat='$uvuformat'
24047 uvxformat='$uvxformat'
24049 vendorarch='$vendorarch'
24050 vendorarchexp='$vendorarchexp'
24051 vendorbin='$vendorbin'
24052 vendorbinexp='$vendorbinexp'
24053 vendorhtml1dir='$vendorhtml1dir'
24054 vendorhtml1direxp='$vendorhtml1direxp'
24055 vendorhtml3dir='$vendorhtml3dir'
24056 vendorhtml3direxp='$vendorhtml3direxp'
24057 vendorlib='$vendorlib'
24058 vendorlib_stem='$vendorlib_stem'
24059 vendorlibexp='$vendorlibexp'
24060 vendorman1dir='$vendorman1dir'
24061 vendorman1direxp='$vendorman1direxp'
24062 vendorman3dir='$vendorman3dir'
24063 vendorman3direxp='$vendorman3direxp'
24064 vendorprefix='$vendorprefix'
24065 vendorprefixexp='$vendorprefixexp'
24066 vendorscript='$vendorscript'
24067 vendorscriptexp='$vendorscriptexp'
24069 version_patchlevel_string='$version_patchlevel_string'
24070 versiononly='$versiononly'
24074 yaccflags='$yaccflags'
24079 : add special variables
24080 $test -f $src/patchlevel.h && \
24081 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
24082 echo "PERL_PATCHLEVEL='$perl_patchlevel'" >>config.sh
24083 echo "PERL_CONFIG_SH=true" >>config.sh
24085 : propagate old symbols
24086 if $test -f UU/config.sh; then
24087 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
24088 $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \
24089 config.sh config.sh UU/oldconfig.sh |\
24090 $sort | $uniq -u >UU/oldsyms
24091 set X `$cat UU/oldsyms`
24097 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
24099 echo ": Variables propagated from previous config.sh file." >>config.sh
24100 for sym in `$cat UU/oldsyms`; do
24101 echo " Propagating $hint variable "'$'"$sym..."
24102 eval 'tmp="$'"${sym}"'"'
24104 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
24110 : preserve RCS keywords in files with variable substitution, grrr
24113 : Finish up by extracting the .SH files
24117 echo "Extraction done."
24127 If you'd like to make any changes to the config.sh file before I begin
24128 to configure things, do it as a shell escape now (e.g. !vi config.sh).
24131 rp="Press return or use a shell escape to edit config.sh:"
24136 *) : in case they cannot read
24137 sh 1>&4 -c "$ans";;
24142 : if this fails, just run all the .SH files by hand
24151 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
24158 Now you need to generate make dependencies by running "$make depend".
24159 You might prefer to run it in background: "$make depend > makedepend.out &"
24160 It can take a while, so you might not want to run it right now.
24165 rp="Run $make depend now?"
24169 $make depend && echo "Now you must run '$make'."
24172 echo "You must run '$make depend' then '$make'."
24175 elif test -f [Mm]akefile; then
24177 echo "Now you must run a $make."
24179 echo "Configure done."
24182 if $test -f Policy.sh; then
24185 If you compile $package on a different machine or from a different object
24186 directory, copy the Policy.sh file from this object directory to the
24187 new one before you run Configure -- this will help you with most of
24188 the policy defaults.
24192 if $test -f config.msg; then
24193 echo "Hmm. I also noted the following information while running:"
24195 $cat config.msg >&4
24198 $rm -f kit*isdone ark*isdone