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 on Wed Jun 4 08:58:13 CEST 2014 [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=''
390 d_builtin_choose_expr=''
393 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 : Check if faststdio is requested and available
9368 case "$usefaststdio" in
9369 $define|true|[yY]*|'')
9370 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
9380 Perl can be built to use 'fast stdio', which means using the stdio
9381 library but also directly manipulating the stdio buffers to enable
9382 faster I/O. Using stdio is better for backward compatibility (especially
9383 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
9384 interface has been preferred instead of stdio.
9386 If this doesn't make any sense to you, just accept the default '$dflt'.
9388 rp='Use the "fast stdio" if available?'
9391 y|Y) val="$define" ;;
9398 : define an is-a-typedef? function
9399 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9401 "") inclist="sys/types.h";;
9403 eval "varval=\$$var";
9407 for inc in $inclist; do
9408 echo "#include <$inc>" >>temp.c;
9410 echo "#ifdef $type" >> temp.c;
9411 echo "printf(\"We have $type\");" >> temp.c;
9412 echo "#endif" >> temp.c;
9413 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9414 if $contains $type temp.E >/dev/null 2>&1; then
9420 *) eval "$var=\$varval";;
9423 : define an is-a-typedef? function that prompts if the type is not available.
9424 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9426 "") inclist="sys/types.h";;
9428 eval "varval=\$$var";
9432 for inc in $inclist; do
9433 echo "#include <$inc>" >>temp.c;
9435 echo "#ifdef $type" >> temp.c;
9436 echo "printf(\"We have $type\");" >> temp.c;
9437 echo "#endif" >> temp.c;
9438 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9440 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
9441 if $contains $type temp.E >/dev/null 2>&1; then
9442 echo "$type found." >&4;
9445 echo "$type NOT found." >&4;
9451 *) eval "$var=\$varval";;
9454 : see what type lseek is declared as in the kernel
9455 rp="What is the type used for lseek's offset on this system?"
9456 set off_t lseektype long stdio.h sys/types.h
9460 echo "Checking to see how big your file offsets are..." >&4
9462 #include <sys/types.h>
9466 printf("%d\n", (int)sizeof($lseektype));
9471 if eval $compile_ok; then
9472 lseeksize=`$run ./try`
9473 echo "Your file offsets are $lseeksize bytes long."
9477 echo "(I can't seem to compile the test program. Guessing...)"
9478 rp="What is the size of your file offsets (in bytes)?"
9484 : see what type file positions are declared as in the library
9485 rp="What is the type for file position used by fsetpos()?"
9486 set fpos_t fpostype long stdio.h sys/types.h
9489 : Check size for Fpos_t
9492 *_t) zzz="$fpostype" ;;
9495 echo "Checking the size of $zzz..." >&4
9497 #include <sys/types.h>
9504 printf("%d\n", (int)sizeof($fpostype));
9509 if eval $compile_ok; then
9513 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9516 echo "Your $zzz is $fpossize bytes long."
9522 echo "(I can't compile the test program. Guessing...)" >&4
9523 rp="What is the size of your file positions (in bytes)?"
9528 : Check for large file support
9529 # Backward compatibility (uselfs is deprecated).
9531 "$define"|true|[yY]*)
9534 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9536 uselargefiles="$define"
9540 case "$lseeksize:$fpossize" in
9543 You can have files larger than 2 gigabytes.
9546 *) case "$uselargefiles" in
9547 "$undef"|false|[nN]*) dflt='n' ;;
9552 Perl can be built to understand large files (files larger than 2 gigabytes)
9553 on some systems. To do so, Configure can be run with -Duselargefiles.
9555 If this doesn't make any sense to you, just accept the default '$dflt'.
9557 rp='Try to understand large files, if available?'
9560 y|Y) val="$define" ;;
9567 : Look for a hint-file generated 'call-back-unit'. If the
9568 : user has specified that a large files perl is to be built,
9569 : we may need to set or change some other defaults.
9570 if $test -f uselargefiles.cbu; then
9571 echo "Your platform has some specific hints regarding large file builds, using them..."
9572 . ./uselargefiles.cbu
9574 case "$uselargefiles" in
9576 if $test -f uselargefiles.cbu; then
9578 echo "Rechecking to see how big your file offsets are..." >&4
9580 #include <sys/types.h>
9584 printf("%d\n", (int)sizeof($lseektype));
9589 if eval $compile_ok; then
9590 lseeksize=`$run ./try`
9591 $echo "Your file offsets are now $lseeksize bytes long."
9595 echo "(I can't seem to compile the test program. Guessing...)"
9596 rp="What is the size of your file offsets (in bytes)?"
9601 *_t) zzz="$fpostype" ;;
9604 $echo $n "Rechecking the size of $zzz...$c" >&4
9606 #include <sys/types.h>
9613 printf("%d\n", (int)sizeof($fpostype));
9618 if eval $compile_ok; then
9623 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9626 echo " $fpossize bytes." >&4
9632 echo "(I can't compile the test program. Guessing...)" >&4
9633 rp="What is the size of your file positions (in bytes)?"
9642 : Check if we want perlio
9645 : Set the vendorbin variables
9646 case "$vendorprefix" in
9647 '') d_vendorbin="$undef"
9651 *) d_vendorbin="$define"
9652 : determine where vendor-supplied executables go.
9653 case "$vendorbin" in
9654 '') dflt=$vendorprefix/bin ;;
9655 *) dflt="$vendorbin" ;;
9658 rp='Pathname for the vendor-supplied executables directory?'
9661 vendorbinexp="$ansexp"
9667 : Set the vendorhtml1dir variables
9668 case "$vendorprefix" in
9669 '') vendorhtml1dir=''
9670 vendorhtml1direxp=''
9672 *) : determine where vendor-supplied html pages go.
9673 : There is no standard location, so try to copy the previously-selected
9674 : directory structure for the core html pages.
9675 : XXX Better default suggestions would be welcome.
9676 case "$vendorhtml1dir" in
9677 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9678 *) dflt=$vendorhtml1dir ;;
9681 ''|' ') dflt=none ;;
9684 rp='Pathname for the vendor-supplied html pages?'
9686 vendorhtml1dir="$ans"
9687 vendorhtml1direxp="$ansexp"
9690 : Use ' ' for none so value is preserved next time through Configure
9691 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9692 prefixvar=vendorhtml1dir
9695 : Set the vendorhtml3dir variables
9696 case "$vendorprefix" in
9697 '') vendorhtml3dir=''
9698 vendorhtml3direxp=''
9700 *) : determine where vendor-supplied module html pages go.
9701 : There is no standard location, so try to copy the previously-selected
9702 : directory structure for the core html pages.
9703 : XXX Better default suggestions would be welcome.
9704 case "$vendorhtml3dir" in
9705 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9706 *) dflt=$vendorhtml3dir ;;
9709 ''|' ') dflt=none ;;
9712 rp='Pathname for the vendor-supplied html pages?'
9714 vendorhtml3dir="$ans"
9715 vendorhtml3direxp="$ansexp"
9718 : Use ' ' for none so value is preserved next time through Configure
9719 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9720 prefixvar=vendorhtml3dir
9723 : Set the vendorman1dir variables
9724 case "$vendorprefix" in
9725 '') vendorman1dir=''
9728 *) : determine where vendor-supplied manual pages go.
9729 case "$vendorman1dir" in
9730 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9731 *) dflt=$vendorman1dir ;;
9734 ''|' ') dflt=none ;;
9737 rp='Pathname for the vendor-supplied manual section 1 pages?'
9739 vendorman1dir="$ans"
9740 vendorman1direxp="$ansexp"
9743 : Use ' ' for none so value is preserved next time through Configure
9744 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9745 prefixvar=vendorman1dir
9748 : Set the vendorman3dir variables
9749 case "$vendorprefix" in
9750 '') vendorman3dir=''
9753 *) : determine where vendor-supplied module manual pages go.
9754 case "$vendorman3dir" in
9755 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9756 *) dflt=$vendorman3dir ;;
9759 ''|' ') dflt=none ;;
9762 rp='Pathname for the vendor-supplied manual section 3 pages?'
9764 vendorman3dir="$ans"
9765 vendorman3direxp="$ansexp"
9768 : Use ' ' for none so value is preserved next time through Configure
9769 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9770 prefixvar=vendorman3dir
9773 : Set the vendorscript variables
9774 case "$vendorprefix" in
9775 '') d_vendorscript="$undef"
9779 *) d_vendorscript="$define"
9780 : determine where vendor-supplied scripts go.
9781 case "$vendorscript" in
9782 '') dflt=$vendorprefix/script
9783 $test -d $dflt || dflt=$vendorbin ;;
9784 *) dflt="$vendorscript" ;;
9788 The installation process will create a directory for
9789 vendor-supplied scripts.
9793 rp='Pathname for the vendor-supplied scripts directory?'
9796 vendorscriptexp="$ansexp"
9799 prefixvar=vendorscript
9802 : script used to emit important warnings
9805 if test \$# -gt 0; then
9810 echo "*** WARNING:" >&4
9811 sed -e 's/^/*** /' <msg >&4
9813 cat msg >>config.msg
9814 echo " " >>config.msg
9820 : see which of string.h or strings.h is needed
9822 strings=`./findhdr string.h`
9823 if $test "$strings" && $test -r "$strings"; then
9824 echo "Using <string.h> instead of <strings.h>." >&4
9828 strings=`./findhdr strings.h`
9829 if $test "$strings" && $test -r "$strings"; then
9830 echo "Using <strings.h> instead of <string.h>." >&4
9832 ./warn "No string header found -- You'll surely have problems."
9838 "$undef") strings=`./findhdr strings.h`;;
9839 *) strings=`./findhdr string.h`;;
9842 : see if qgcvt exists
9846 : Check print/scan long double stuff
9849 if $test X"$d_longdbl" = X"$define"; then
9851 echo "Checking how to print long doubles..." >&4
9853 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
9854 $cat >try.c <<'EOCP'
9855 #include <sys/types.h>
9859 printf("%.3f\n", d);
9863 if eval $compile; then
9867 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
9868 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
9869 echo "We will use %f."
9875 if $test X"$sPRIfldbl" = X; then
9876 $cat >try.c <<'EOCP'
9877 #include <sys/types.h>
9880 long double d = 123.456;
9881 printf("%.3Lf\n", d);
9885 if eval $compile; then
9889 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
9890 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
9891 echo "We will use %Lf."
9897 if $test X"$sPRIfldbl" = X; then
9898 $cat >try.c <<'EOCP'
9899 #include <sys/types.h>
9902 long double d = 123.456;
9903 printf("%.3llf\n", d);
9907 if eval $compile; then
9911 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
9912 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
9913 echo "We will use %llf."
9919 if $test X"$sPRIfldbl" = X; then
9920 $cat >try.c <<'EOCP'
9921 #include <sys/types.h>
9924 long double d = 123.456;
9925 printf("%.3lf\n", d);
9929 if eval $compile; then
9933 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
9934 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
9935 echo "We will use %lf."
9941 if $test X"$sPRIfldbl" = X; then
9942 echo "Cannot figure out how to print long doubles." >&4
9944 sSCNfldbl=$sPRIfldbl # expect consistency
9951 case "$sPRIfldbl" in
9952 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
9953 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
9954 d_SCNfldbl="$undef";
9956 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
9957 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
9958 d_SCNfldbl="$define";
9962 : Check how to convert floats to strings.
9964 if test "X$d_Gconvert" = X; then
9967 echo "Checking for an efficient way to convert floats to strings."
9969 case "$uselongdouble" in
9970 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
9972 case "$d_longdbl" in
9973 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
9975 case "$d_PRIgldbl" in
9976 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
9980 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
9981 char *myname = "gconvert";
9984 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
9985 char *myname = "gcvt";
9988 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
9989 char *myname = "qgcvt";
9990 #define DOUBLETYPE long double
9993 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9995 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
9997 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
10000 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
10002 char *myname = "sprintf";
10006 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
10007 #define DOUBLETYPE long double
10009 #define DOUBLETYPE double
10015 #$i_stdlib I_STDLIB
10017 #include <stdlib.h>
10019 #$i_string I_STRING
10021 # include <string.h>
10023 # include <strings.h>
10026 int checkit(char *expect, char *got)
10028 if (strcmp(expect, got)) {
10029 printf("%s oddity: Expected %s, got %s\n",
10030 myname, expect, got);
10040 /* This must be 1st test on (which?) platform */
10041 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
10042 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
10043 checkit("0.1", buf);
10045 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
10046 checkit("0.01", buf);
10048 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
10049 checkit("0.001", buf);
10051 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
10052 checkit("0.0001", buf);
10054 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
10055 if (strlen(buf) > 5)
10056 checkit("9e-005", buf); /* for Microsoft ?? */
10058 checkit("9e-05", buf);
10060 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
10063 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
10064 checkit("1.1", buf);
10066 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
10067 checkit("1.01", buf);
10069 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
10070 checkit("1.001", buf);
10072 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
10073 checkit("1.0001", buf);
10075 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
10076 checkit("1.00001", buf);
10078 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
10079 checkit("1.000001", buf);
10081 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
10084 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
10085 checkit("-1", buf);
10087 /* Some Linux gcvt's give 1.e+5 here. */
10088 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
10089 checkit("100000", buf);
10091 /* Some Linux gcvt's give -1.e+5 here. */
10092 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
10093 checkit("-100000", buf);
10095 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
10096 checkit("123.456", buf);
10098 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
10099 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
10100 /* 34 should be enough to scare even long double
10101 * places into using the e notation. */
10102 if (strlen(buf) > 5)
10103 checkit("1e+034", buf); /* for Microsoft */
10105 checkit("1e+34", buf);
10107 /* For Perl, if you add additional tests here, also add them to
10108 * t/base/num.t for benefit of platforms not using Configure or
10109 * overriding d_Gconvert */
10114 : first add preferred functions to our list
10116 for xxx_convert in $gconvert_preference; do
10117 case $xxx_convert in
10118 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
10119 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
10122 : then add any others
10123 for xxx_convert in gconvert gcvt sprintf; do
10124 case "$xxx_list" in
10126 *) xxx_list="$xxx_list $xxx_convert" ;;
10130 case "$d_longdbl$uselongdouble" in
10132 : again, add preferred functions to our list first
10134 for xxx_convert in $gconvert_ld_preference; do
10135 case $xxx_convert in
10136 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
10137 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
10140 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
10141 for xxx_convert in qgcvt sprintf $xxx_list; do
10142 case "$xxx_ld_list" in
10143 $xxx_convert*|*" $xxx_convert"*) ;;
10144 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
10147 : if sprintf cannot do long doubles, move it to the end
10148 if test "$d_PRIgldbl" != "$define"; then
10149 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
10151 : if no qgcvt, remove it
10152 if test "$d_qgcvt" != "$define"; then
10153 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
10156 xxx_list="$xxx_ld_list"
10160 for xxx_convert in $xxx_list; do
10161 echo "Trying $xxx_convert..."
10162 $rm -f try try$_o core
10163 set try -DTRY_$xxx_convert
10164 if eval $compile; then
10165 echo "$xxx_convert() found." >&4
10166 if $run ./try; then
10167 echo "I'll use $xxx_convert to convert floats into a string." >&4
10170 echo "...But $xxx_convert didn't work as I expected."
10174 echo "$xxx_convert NOT found." >&4
10178 if test X$xxx_convert = X; then
10179 echo "*** WHOA THERE!!! ***" >&4
10180 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
10181 xxx_convert=sprintf
10184 case "$xxx_convert" in
10185 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
10186 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
10187 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
10188 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
10189 "$define$define$define")
10190 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
10191 "$define$define$undef")
10192 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
10193 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
10201 : see if _fwalk exists
10205 : Initialize h_fcntl
10208 : Initialize h_sysfile
10211 : access call always available on UNIX
10212 set access d_access
10215 : locate the flags for 'access()'
10216 case "$d_access" in
10219 $cat >access.c <<EOCP
10220 #include <sys/types.h>
10225 #include <sys/file.h>
10228 #include <unistd.h>
10230 #$i_stdlib I_STDLIB
10232 #include <stdlib.h>
10238 : check sys/file.h first, no particular reason here
10239 if $test `./findhdr sys/file.h` && \
10240 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
10242 echo "<sys/file.h> defines the *_OK access constants." >&4
10243 elif $test `./findhdr fcntl.h` && \
10244 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
10246 echo "<fcntl.h> defines the *_OK access constants." >&4
10247 elif $test `./findhdr unistd.h` && \
10248 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
10249 echo "<unistd.h> defines the *_OK access constants." >&4
10251 echo "I can't find the four *_OK access constants--I'll use mine." >&4
10257 : see if accessx exists
10258 set accessx d_accessx
10261 : see if aintl exists
10265 : see if alarm exists
10269 : see if 64bit time functions exists
10271 set ctime64 d_ctime64
10274 set localtime64 d_localtime64
10277 set gmtime64 d_gmtime64
10280 set mktime64 d_mktime64
10283 set difftime64 d_difftime64
10286 set asctime64 d_asctime64
10289 : see if POSIX threads are available
10290 set pthread.h i_pthread
10293 : define a function to check prototypes
10294 $cat > protochk <<EOSH
10297 optimize="$optimize"
10299 prototype="$prototype"
10302 usethreads=$usethreads
10303 i_pthread=$i_pthread
10304 pthread_h_first=$pthread_h_first
10307 $cat >> protochk <<'EOSH'
10312 while test $# -ge 2; do
10314 $define) echo "#include <$2>" >> try.c ;;
10315 literal) echo "$2" >> try.c ;;
10317 # Extra magic for the benefit of systems that need pthread.h
10318 # to be included early to correctly detect threadsafe functions.
10319 # Such functions must guarantee themselves, though, that the usethreads
10320 # and i_pthread have been defined, before calling protochk.
10321 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
10322 echo "#include <pthread.h>" >> try.c
10327 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
10328 cat >> try.c <<'EOCP'
10329 #ifdef CAN_PROTOTYPE
10330 #define _(args) args
10335 echo "$foo" >> try.c
10336 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
10337 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
10343 $eunicefix protochk
10345 : Define hasproto macro for Configure internal use
10346 hasproto='varname=$1; func=$2; shift; shift;
10347 while $test $# -ge 2; do
10349 $define) echo "#include <$2>";;
10353 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
10354 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
10355 echo "$func() prototype found.";
10358 echo "$func() prototype NOT found.";
10365 : see if sys/types.h has to be included
10366 set sys/types.h i_systypes
10369 : see if sys/select.h has to be included
10370 set sys/select.h i_sysselct
10373 : Define hasfield macro for Configure internal use
10374 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
10375 while $test $# -ge 2; do
10377 $define) echo "#include <$2>";;
10381 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
10383 if eval $compile; then
10392 : see if we should include time.h, sys/time.h, or both
10394 if test "X$timeincl" = X; then
10395 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
10396 $echo $n "I'm now running the test program...$c"
10398 #include <sys/types.h>
10403 #ifdef SYSTIMEKERNEL
10406 #include <sys/time.h>
10409 #include <sys/select.h>
10411 #$i_stdlib I_STDLIB
10413 #include <stdlib.h>
10419 struct timeval bar;
10422 struct timezone tzp;
10424 if (foo.tm_sec == foo.tm_sec)
10427 if (bar.tv_sec == bar.tv_sec)
10434 for s_timezone in '-DS_TIMEZONE' ''; do
10436 for s_timeval in '-DS_TIMEVAL' ''; do
10437 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10438 for i_time in '' '-DI_TIME'; do
10439 for i_systime in '-DI_SYSTIME' ''; do
10442 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10443 if eval $compile; then
10444 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
10448 $echo $n "Succeeded with $flags$c"
10460 *SYSTIMEKERNEL*) i_systimek="$define"
10461 timeincl=`./findhdr sys/time.h`
10462 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10463 *) i_systimek="$undef";;
10466 *I_TIME*) i_time="$define"
10467 timeincl=`./findhdr time.h`" $timeincl"
10468 echo "We'll include <time.h>." >&4;;
10469 *) i_time="$undef";;
10472 *I_SYSTIME*) i_systime="$define"
10473 timeincl=`./findhdr sys/time.h`" $timeincl"
10474 echo "We'll include <sys/time.h>." >&4;;
10475 *) i_systime="$undef";;
10479 : see if struct tm knows about tm_zone
10480 case "$i_systime$i_time" in
10483 echo "Checking to see if your struct tm has tm_zone field..." >&4
10484 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
10492 case "$d_tm_tm_zone" in
10493 "$define") echo "Yes, it does." ;;
10494 *) echo "No, it doesn't." ;;
10496 : see if struct tm knows about tm_gmtoff
10497 case "$i_systime$i_time" in
10500 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
10501 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
10509 case "$d_tm_tm_gmtoff" in
10510 "$define") echo "Yes, it does." ;;
10511 *) echo "No, it doesn't." ;;
10514 : see if asctime_r exists
10515 set asctime_r d_asctime_r
10517 case "$d_asctime_r" in
10519 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10520 case "$d_asctime_r_proto:$usethreads" in
10521 ":define") d_asctime_r_proto=define
10522 set d_asctime_r_proto asctime_r $hdrs
10526 case "$d_asctime_r_proto" in
10528 case "$asctime_r_proto" in
10529 ''|0) try='char* asctime_r(const struct tm*, char*);'
10530 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SB ;;
10532 case "$asctime_r_proto" in
10533 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
10534 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SBI ;;
10536 case "$asctime_r_proto" in
10537 ''|0) try='int asctime_r(const struct tm*, char*);'
10538 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SB ;;
10540 case "$asctime_r_proto" in
10541 ''|0) try='int asctime_r(const struct tm*, char*, int);'
10542 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SBI ;;
10544 case "$asctime_r_proto" in
10545 ''|0) d_asctime_r=undef
10547 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
10548 * ) case "$asctime_r_proto" in
10549 REENTRANT_PROTO*) ;;
10550 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
10552 echo "Prototype: $try" ;;
10555 *) case "$usethreads" in
10556 define) echo "asctime_r has no prototype, not using it." >&4 ;;
10563 *) asctime_r_proto=0
10567 : see if atolf exists
10571 : see if atoll exists
10575 : Look for GCC-style attribute format
10576 case "$d_attribute_format" in
10579 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
10580 $cat >attrib.c <<'EOCP'
10582 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
10584 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10585 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10586 echo "Your C compiler doesn't support __attribute__((format))."
10589 echo "Your C compiler supports __attribute__((format))."
10593 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10597 *) val="$d_attribute_format" ;;
10599 set d_attribute_format
10603 : Look for GCC-style attribute format with null format allowed
10604 case "$d_printf_format_null" in
10605 '') case "$d_attribute_format" in
10608 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
10609 $cat >attrib.c <<EOCP
10611 #$i_stdlib I_STDLIB
10613 #include <stdlib.h>
10615 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
10616 int null_printf (char* pat,...) { return (int)pat; }
10617 int main () { exit(null_printf(NULL)); }
10619 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
10620 : run the executable in case it produces a run-time warning
10621 if $run ./attrib >>attrib.out 2>&1; then
10622 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10623 echo "Your C compiler doesn't allow __printf__ format to be null."
10626 echo "Your C compiler allows __printf__ format to be null."
10630 echo "Your C compiler executable failed with __printf__ format null."
10634 echo "Your C compiler fails with __printf__ format null."
10641 *) val="$d_printf_format_null" ;;
10643 set d_printf_format_null
10647 : Look for GCC-style attribute malloc
10648 case "$d_attribute_malloc" in
10651 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
10652 $cat >attrib.c <<'EOCP'
10654 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
10656 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10657 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10658 echo "Your C compiler doesn't support __attribute__((malloc))."
10661 echo "Your C compiler supports __attribute__((malloc))."
10665 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10669 *) val="$d_attribute_malloc" ;;
10671 set d_attribute_malloc
10675 : Look for GCC-style attribute nonnull
10676 case "$d_attribute_nonnull" in
10679 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
10680 $cat >attrib.c <<'EOCP'
10682 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
10684 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10685 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10686 echo "Your C compiler doesn't support __attribute__((nonnull))."
10689 echo "Your C compiler supports __attribute__((nonnull))."
10693 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10697 *) val="$d_attribute_nonnull" ;;
10699 set d_attribute_nonnull
10703 : Look for GCC-style attribute noreturn
10704 case "$d_attribute_noreturn" in
10707 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
10708 $cat >attrib.c <<'EOCP'
10710 void fall_over_dead( void ) __attribute__((noreturn));
10712 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10713 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10714 echo "Your C compiler doesn't support __attribute__((noreturn))."
10717 echo "Your C compiler supports __attribute__((noreturn))."
10721 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10725 *) val="$d_attribute_noreturn" ;;
10727 set d_attribute_noreturn
10731 : Look for GCC-style attribute pure
10732 case "$d_attribute_pure" in
10735 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
10736 $cat >attrib.c <<'EOCP'
10738 int square( int n ) __attribute__((pure));
10740 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10741 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10742 echo "Your C compiler doesn't support __attribute__((pure))."
10745 echo "Your C compiler supports __attribute__((pure))."
10749 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10753 *) val="$d_attribute_pure" ;;
10755 set d_attribute_pure
10759 : Look for GCC-style attribute unused
10760 case "$d_attribute_unused" in
10763 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
10764 $cat >attrib.c <<'EOCP'
10766 int do_something( int dummy __attribute__((unused)), int n );
10768 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10769 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10770 echo "Your C compiler doesn't support __attribute__((unused))."
10773 echo "Your C compiler supports __attribute__((unused))."
10777 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10781 *) val="$d_attribute_unused" ;;
10783 set d_attribute_unused
10787 : Look for GCC-style attribute deprecated
10788 case "$d_attribute_deprecated" in
10791 echo "Checking whether your compiler can handle __attribute__((deprecated)) ..." >&4
10792 $cat >attrib.c <<'EOCP'
10794 int I_am_deprecated(void) __attribute__((deprecated));
10796 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10797 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10798 echo "Your C compiler doesn't support __attribute__((deprecated))."
10801 echo "Your C compiler supports __attribute__((deprecated))."
10805 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10809 *) val="$d_attribute_deprecated" ;;
10811 set d_attribute_deprecated
10815 : Look for GCC-style attribute warn_unused_result
10816 case "$d_attribute_warn_unused_result" in
10819 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
10820 $cat >attrib.c <<'EOCP'
10822 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
10824 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10825 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10826 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
10829 echo "Your C compiler supports __attribute__((warn_unused_result))."
10833 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10837 *) val="$d_attribute_warn_unused_result" ;;
10839 set d_attribute_warn_unused_result
10843 : see if bcmp exists
10847 : see if bcopy exists
10851 : see if getpgrp exists
10852 set getpgrp d_getpgrp
10855 case "$d_getpgrp" in
10858 echo "Checking to see which flavor of getpgrp is in use..."
10860 #$i_unistd I_UNISTD
10861 #include <sys/types.h>
10863 # include <unistd.h>
10865 #$i_stdlib I_STDLIB
10867 #include <stdlib.h>
10871 if (getuid() == 0) {
10872 printf("(I see you are running Configure as super-user...)\n");
10875 #ifdef TRY_BSD_PGRP
10876 if (getpgrp(1) == 0)
10885 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10886 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
10888 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10889 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
10892 echo "I can't seem to compile and run the test program."
10894 xxx="a USG one, i.e. you use getpgrp()."
10896 # SVR4 systems can appear rather BSD-ish.
10897 case "$i_unistd" in
10899 xxx="a BSD one, i.e. you use getpgrp(pid)."
10903 xxx="probably a USG one, i.e. you use getpgrp()."
10908 echo "Assuming your getpgrp is $xxx" >&4
10917 : see if setpgrp exists
10918 set setpgrp d_setpgrp
10921 case "$d_setpgrp" in
10924 echo "Checking to see which flavor of setpgrp is in use..."
10926 #$i_unistd I_UNISTD
10927 #include <sys/types.h>
10929 # include <unistd.h>
10931 #$i_stdlib I_STDLIB
10933 #include <stdlib.h>
10937 if (getuid() == 0) {
10938 printf("(I see you are running Configure as super-user...)\n");
10941 #ifdef TRY_BSD_PGRP
10942 if (-1 == setpgrp(1, 1))
10945 if (setpgrp() != -1)
10951 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10952 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
10954 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10955 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
10958 echo "(I can't seem to compile and run the test program.)"
10960 xxx="a USG one, i.e. you use setpgrp()."
10962 # SVR4 systems can appear rather BSD-ish.
10963 case "$i_unistd" in
10965 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
10969 xxx="probably a USG one, i.e. you use setpgrp()."
10974 echo "Assuming your setpgrp is $xxx" >&4
10983 : Look for GCC-style __builtin_choose_expr
10984 case "$d_builtin_choose_expr" in
10987 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
10988 $cat >try.c <<'EOCP'
10989 #include <assert.h>
10990 #include <stdlib.h>
10993 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
10996 assert( SYRINX(1) == 2112 );
10997 assert( SYRINX(1) != 5150 );
10998 assert( SYRINX(0) == 5150 );
10999 assert( SYRINX(0) != 2112 );
11000 puts( "All good!" );
11006 if eval $compile && $run ./try; then
11007 echo "Your C compiler supports __builtin_choose_expr."
11010 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
11014 *) val="$d_builtin_choose_expr" ;;
11017 set d_builtin_choose_expr
11021 : Look for GCC-style __builtin_expect
11022 case "$d_builtin_expect" in
11025 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
11026 $cat >try.c <<'EOCP'
11029 if ( __builtin_expect(n, 0) ) n = 1;
11030 /* Remember shell exit code truth is 0, C truth is non-zero */
11035 if eval $compile && $run ./try; then
11036 echo "Your C compiler supports __builtin_expect."
11039 echo "Your C compiler doesn't seem to understand __builtin_expect."
11043 *) val="$d_builtin_expect" ;;
11046 set d_builtin_expect
11050 : see if bzero exists
11054 : see if stdarg is available
11056 if $test `./findhdr stdarg.h`; then
11057 echo "<stdarg.h> found." >&4
11060 echo "<stdarg.h> NOT found." >&4
11064 : see if varargs is available
11066 if $test `./findhdr varargs.h`; then
11067 echo "<varargs.h> found." >&4
11069 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
11072 : set up the varargs testing programs
11073 $cat > varargs.c <<EOP
11075 #include <stdarg.h>
11078 #include <varargs.h>
11082 int f(char *p, ...)
11096 p = va_arg(ap, char *);
11102 $cat > varargs <<EOP
11104 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
11113 : now check which varargs header should be included
11119 if `./varargs I_STDARG`; then
11121 elif `./varargs I_VARARGS`; then
11126 if `./varargs I_VARARGS`; then
11134 echo "*** WHOA THERE!!! ***" >&4
11135 echo " Your C compiler \"$cc\" doesn't seem to support stdarg or varargs!" >&4
11136 case "$knowitall" in
11138 echo " I'm giving up; maybe you can try again with a different compiler?" >&4
11142 echo "I could not find the definition for va_dcl... You have problems..." >&4
11143 val="$undef"; set i_stdarg; eval $setvar
11144 val="$undef"; set i_varargs; eval $setvar
11149 case "$i_varhdr" in
11151 val="$define"; set i_stdarg; eval $setvar
11152 val="$undef"; set i_varargs; eval $setvar
11155 val="$undef"; set i_stdarg; eval $setvar
11156 val="$define"; set i_varargs; eval $setvar
11159 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
11163 : see if the Compiler supports C99 variadic macros
11164 case "$i_stdarg$i_stdlib" in
11166 echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
11169 #include <stdarg.h>
11171 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
11175 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
11181 if eval $compile && $run ./try 2>&1 >/dev/null; then
11182 case "`$run ./try`" in
11184 echo "You have C99 variadic macros." >&4
11185 d_c99_variadic_macros="$define"
11188 echo "You don't have functional C99 variadic macros." >&4
11189 d_c99_variadic_macros="$undef"
11193 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
11194 d_c99_variadic_macros="$undef"
11199 echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
11200 d_c99_variadic_macros="$undef"
11204 : see if signal is declared as pointer to function returning int or void
11206 xxx=`./findhdr signal.h`
11207 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
11208 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
11209 echo "You have int (*signal())() instead of void." >&4
11211 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
11212 echo "You have void (*signal())()." >&4
11214 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
11215 echo "You have int (*signal())() instead of void." >&4
11217 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
11218 echo "You have void (*signal())()." >&4
11221 case "$d_voidsig" in
11223 echo "I can't determine whether signal handler returns void or int..." >&4
11225 rp="What type does your signal handler return?"
11228 v*) val="$define";;
11232 echo "As you already told me, signal handler returns void." >&4
11235 *) echo "As you already told me, signal handler returns int." >&4
11242 case "$d_voidsig" in
11243 "$define") signal_t="void";;
11244 *) signal_t="int";;
11248 : check for ability to cast large floats to 32-bit ints.
11250 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
11251 if $test "$intsize" -ge 4; then
11258 #$i_stdlib I_STDLIB
11260 #include <stdlib.h>
11262 #include <sys/types.h>
11263 #include <signal.h>
11264 $signal_t blech(int s) { exit(3); }
11271 signal(SIGFPE, blech);
11273 /* Don't let compiler optimize the test away. Store the number
11274 in a writable string for gcc to pass to sscanf under HP-UX.
11276 sprintf(str, "2147483647");
11277 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
11281 /* x86 processors will probably give 0x8000 0000, which is a
11282 sign change. We don't want that. We want to mimic SPARC
11283 behavior here, which is to preserve the sign and give
11286 if (i32 != ($xxx) f)
11292 if eval $compile_ok; then
11296 echo "(I can't seem to compile the test program--assuming it can't)"
11301 echo "Yup, it can."
11304 echo "Nope, it can't."
11311 : check for ability to cast negative floats to unsigned
11313 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
11316 #$i_stdlib I_STDLIB
11318 #include <stdlib.h>
11320 #include <sys/types.h>
11321 #include <signal.h>
11322 $signal_t blech(int s) { exit(7); }
11323 $signal_t blech_in_list(int s) { exit(4); }
11324 unsigned long dummy_long(unsigned long p) { return p; }
11325 unsigned int dummy_int(unsigned int p) { return p; }
11326 unsigned short dummy_short(unsigned short p) { return p; }
11330 unsigned long along;
11332 unsigned short ashort;
11336 /* Frustrate gcc-2.7.2's optimizer which failed this test with
11337 a direct f = -123. assignment. gcc-2.8.0 reportedly
11338 optimized the whole file away
11340 /* Store the number in a writable string for gcc to pass to
11341 sscanf under HP-UX.
11343 sprintf(str, "-123");
11344 sscanf(str, "%lf", &f); /* f = -123.; */
11346 signal(SIGFPE, blech);
11347 along = (unsigned long)f;
11348 aint = (unsigned int)f;
11349 ashort = (unsigned short)f;
11350 if (along != (unsigned long)-123)
11352 if (aint != (unsigned int)-123)
11354 if (ashort != (unsigned short)-123)
11356 sprintf(str, "1073741824.");
11357 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
11360 along = (unsigned long)f;
11361 if (along != 0x80000000)
11365 along = (unsigned long)f;
11366 if (along != 0x7fffffff)
11370 along = (unsigned long)f;
11371 if (along != 0x80000001)
11375 signal(SIGFPE, blech_in_list);
11376 sprintf(str, "123.");
11377 sscanf(str, "%lf", &f); /* f = 123.; */
11378 along = dummy_long((unsigned long)f);
11379 aint = dummy_int((unsigned int)f);
11380 ashort = dummy_short((unsigned short)f);
11381 if (along != (unsigned long)123)
11383 if (aint != (unsigned int)123)
11385 if (ashort != (unsigned short)123)
11392 if eval $compile_ok; then
11396 echo "(I can't seem to compile the test program--assuming it can't)"
11399 case "$castflags" in
11401 echo "Yup, it can."
11404 echo "Nope, it can't."
11411 : see if vprintf exists
11413 if set vprintf val -f d_vprintf; eval $csym; $val; then
11414 echo 'vprintf() found.' >&4
11417 #$i_stdarg I_STDARG /* Only one of these can be defined by i_varhrd */
11418 #$i_varargs I_VARARGS
11420 #$i_stdlib I_STDLIB
11421 #$i_unistd I_UNISTD
11424 # include <stdarg.h>
11425 #else /* I_VARARGS */
11426 # include <varargs.h>
11430 # include <unistd.h>
11434 # include <stdlib.h>
11437 #include <stdio.h> /* vsprintf prototype */
11440 void xxx(int n, ...)
11445 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11447 int main() { xxx(1, "foo"); }
11449 #else /* I_VARARGS */
11457 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11459 int main() { xxx("foo"); }
11465 if eval $compile_ok; then
11466 if $run ./try; then
11467 echo "Your vsprintf() returns (int)." >&4
11470 echo "Your vsprintf() returns (char*)." >&4
11474 echo 'I am unable to compile the vsprintf() test program.' >&4
11475 # We shouldn't get here. If we do, assume the standard signature,
11476 # not the old BSD one.
11477 echo 'Guessing that vsprintf() returns (int).' >&4
11481 echo 'vprintf() NOT found.' >&4
11492 : see if chown exists
11496 : see if chroot exists
11497 set chroot d_chroot
11500 : see if chsize exists
11501 set chsize d_chsize
11504 : see if class exists
11508 : see if clearenv exists
11509 set clearenv d_clearenv
11512 : Define hasstruct macro for Configure internal use
11513 hasstruct='varname=$1; struct=$2; shift; shift;
11514 while $test $# -ge 2; do
11516 $define) echo "#include <$2>";;
11520 echo "int main () { struct $struct foo; }" >> try.c;
11522 if eval $compile; then
11531 : see whether socket exists
11535 $echo $n "Hmm... $c" >&4
11536 if set socket val -f d_socket; eval $csym; $val; then
11537 echo "Looks like you have Berkeley networking support." >&4
11539 if set setsockopt val -f; eval $csym; $val; then
11542 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
11543 d_oldsock="$define"
11546 if $contains socklib libc.list >/dev/null 2>&1; then
11547 echo "Looks like you have Berkeley networking support." >&4
11549 : we will have to assume that it supports the 4.2 BSD interface
11552 echo "You don't have Berkeley networking in libc$_a..." >&4
11553 if test "X$d_socket" = "X$define"; then
11554 echo "...but you seem to believe that you have sockets." >&4
11556 for net in net socket
11558 if test -f $sysroot/usr/lib/lib$net$_a; then
11559 ( ($nm $nm_opt $sysroot/usr/lib/lib$net$_a | eval $nm_extract) || \
11560 $ar t $sysroot/usr/lib/lib$net$_a) 2>/dev/null >> libc.list
11561 if $contains socket libc.list >/dev/null 2>&1; then
11566 echo "...but the Wollongong group seems to have hacked it in." >&4
11567 sockethdr="-I$sysroot/usr/netinclude"
11570 echo "Found Berkeley sockets interface in lib$net." >&4
11571 if $contains setsockopt libc.list >/dev/null 2>&1; then
11574 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
11575 d_oldsock="$define"
11581 if test "X$d_socket" != "X$define"; then
11582 echo "or anywhere else I see." >&4
11590 : see if socketpair exists
11591 set socketpair d_sockpair
11596 echo "Checking the availability sa_len in the sock struct ..." >&4
11598 #include <sys/types.h>
11599 #include <sys/socket.h>
11601 struct sockaddr sa;
11602 return (sa.sa_len);
11606 set try; if eval $compile; then
11609 set d_sockaddr_sa_len; eval $setvar
11613 echo "Checking the availability struct sockaddr_in6 ..." >&4
11615 #include <sys/types.h>
11616 #include <sys/socket.h>
11617 #include <netinet/in.h>
11619 struct sockaddr_in6 sin6;
11620 return (sin6.sin6_family);
11624 set try; if eval $compile; then
11627 set d_sockaddr_in6; eval $setvar
11631 echo "Checking the availability sin6_scope_id in struct sockaddr_in6 ..." >&4
11633 #include <sys/types.h>
11634 #include <sys/socket.h>
11635 #include <netinet/in.h>
11637 struct sockaddr_in6 sin6;
11638 return (sin6.sin6_scope_id);
11642 set try; if eval $compile; then
11645 set d_sin6_scope_id; eval $setvar
11649 echo "Checking the availability struct ip_mreq ..." >&4
11651 #include <sys/types.h>
11652 #include <sys/socket.h>
11653 #include <netinet/in.h>
11655 struct ip_mreq mreq;
11656 return (mreq.imr_multiaddr.s_addr);
11660 set try; if eval $compile; then
11663 set d_ip_mreq; eval $setvar
11667 echo "Checking the availability struct ip_mreq_source ..." >&4
11669 #include <sys/types.h>
11670 #include <sys/socket.h>
11671 #include <netinet/in.h>
11673 struct ip_mreq_source mreq;
11674 return (mreq.imr_multiaddr.s_addr);
11678 set try; if eval $compile; then
11681 set d_ip_mreq_source; eval $setvar
11685 echo "Checking the availability struct ipv6_mreq ..." >&4
11687 #include <sys/types.h>
11688 #include <sys/socket.h>
11689 #include <netinet/in.h>
11691 struct ipv6_mreq mreq;
11692 return (mreq.ipv6mr_interface);
11696 set try; if eval $compile; then
11699 set d_ipv6_mreq; eval $setvar
11703 echo "Checking the availability struct ipv6_mreq_source ..." >&4
11705 #include <sys/types.h>
11706 #include <sys/socket.h>
11707 #include <netinet/in.h>
11709 struct ipv6_mreq_source mreq;
11710 return (mreq.imr_multiaddr.s_addr);
11714 set try; if eval $compile; then
11717 set d_ipv6_mreq_source; eval $setvar
11721 echo "Checking the availability of certain socket constants..." >&4
11722 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
11723 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
11725 #include <sys/types.h>
11726 #include <sys/socket.h>
11732 set try; if eval $compile; then
11735 set d_${enum}; eval $setvar
11739 : see if this is a sys/uio.h system
11740 set sys/uio.h i_sysuio
11743 : Check for cmsghdr support
11745 echo "Checking to see if your system supports struct cmsghdr..." >&4
11746 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
11748 case "$d_cmsghdr_s" in
11749 "$define") echo "Yes, it does." ;;
11750 *) echo "No, it doesn't." ;;
11754 : check for const keyword
11756 echo 'Checking to see if your C compiler knows about "const"...' >&4
11757 $cat >const.c <<'EOCP'
11758 typedef struct spug { int drokk; } spug;
11762 const spug y = { 0 };
11765 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
11767 echo "Yup, it does."
11770 echo "Nope, it doesn't."
11775 : see if copysignl exists
11776 set copysignl d_copysignl
11779 : see if crypt exists
11784 $define) cryptlib='' ;;
11785 *) if set crypt val -f d_crypt; eval $csym; $val; then
11786 echo 'crypt() found.' >&4
11790 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
11791 if $test -z "$cryptlib"; then
11792 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
11796 if $test -z "$cryptlib"; then
11797 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
11801 if $test -z "$cryptlib"; then
11802 cryptlib=`./loc libcrypt$_a "" $libpth`
11806 if $test -z "$cryptlib"; then
11807 echo 'crypt() NOT found.' >&4
11818 : see if this is a crypt.h system
11819 set crypt.h i_crypt
11822 : see if crypt_r exists
11823 set crypt_r d_crypt_r
11825 case "$d_crypt_r" in
11827 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
11828 case "$d_crypt_r_proto:$usethreads" in
11829 ":define") d_crypt_r_proto=define
11830 set d_crypt_r_proto crypt_r $hdrs
11834 case "$d_crypt_r_proto" in
11836 case "$crypt_r_proto" in
11837 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
11838 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCS ;;
11840 case "$crypt_r_proto" in
11841 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
11842 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCD ;;
11844 case "$crypt_r_proto" in
11845 ''|0) d_crypt_r=undef
11847 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
11848 * ) case "$crypt_r_proto" in
11849 REENTRANT_PROTO*) ;;
11850 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
11852 echo "Prototype: $try" ;;
11855 *) case "$usethreads" in
11856 define) echo "crypt_r has no prototype, not using it." >&4 ;;
11867 : get csh whereabouts
11869 'csh') val="$undef" ;;
11870 *) val="$define" ;;
11874 : Respect a hint or command line value for full_csh.
11875 case "$full_csh" in
11876 '') full_csh=$csh ;;
11879 : see if ctermid exists
11880 set ctermid d_ctermid
11883 : see if ctermid_r exists
11884 set ctermid_r d_ctermid_r
11886 case "$d_ctermid_r" in
11888 hdrs="$i_systypes sys/types.h define stdio.h "
11889 case "$d_ctermid_r_proto:$usethreads" in
11890 ":define") d_ctermid_r_proto=define
11891 set d_ctermid_r_proto ctermid_r $hdrs
11895 case "$d_ctermid_r_proto" in
11897 case "$ctermid_r_proto" in
11898 ''|0) try='char* ctermid_r(char*);'
11899 ./protochk "$extern_C $try" $hdrs && ctermid_r_proto=B_B ;;
11901 case "$ctermid_r_proto" in
11902 ''|0) d_ctermid_r=undef
11904 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
11905 * ) case "$ctermid_r_proto" in
11906 REENTRANT_PROTO*) ;;
11907 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
11909 echo "Prototype: $try" ;;
11912 *) case "$usethreads" in
11913 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
11920 *) ctermid_r_proto=0
11924 : see if ctime_r exists
11925 set ctime_r d_ctime_r
11927 case "$d_ctime_r" in
11929 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
11930 case "$d_ctime_r_proto:$usethreads" in
11931 ":define") d_ctime_r_proto=define
11932 set d_ctime_r_proto ctime_r $hdrs
11936 case "$d_ctime_r_proto" in
11938 case "$ctime_r_proto" in
11939 ''|0) try='char* ctime_r(const time_t*, char*);'
11940 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SB ;;
11942 case "$ctime_r_proto" in
11943 ''|0) try='char* ctime_r(const time_t*, char*, int);'
11944 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SBI ;;
11946 case "$ctime_r_proto" in
11947 ''|0) try='int ctime_r(const time_t*, char*);'
11948 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SB ;;
11950 case "$ctime_r_proto" in
11951 ''|0) try='int ctime_r(const time_t*, char*, int);'
11952 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SBI ;;
11954 case "$ctime_r_proto" in
11955 ''|0) d_ctime_r=undef
11957 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
11958 * ) case "$ctime_r_proto" in
11959 REENTRANT_PROTO*) ;;
11960 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
11962 echo "Prototype: $try" ;;
11965 *) case "$usethreads" in
11966 define) echo "ctime_r has no prototype, not using it." >&4 ;;
11977 : see if cuserid exists
11978 set cuserid d_cuserid
11981 : see if this is a limits.h system
11982 set limits.h i_limits
11985 : see if this is a float.h system
11986 set float.h i_float
11989 : See if number of significant digits in a double precision number is known
11991 $cat >dbl_dig.c <<EOM
11992 #$i_limits I_LIMITS
11995 #include <limits.h>
12001 printf("Contains DBL_DIG");
12004 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
12005 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
12006 echo "DBL_DIG found." >&4
12009 echo "DBL_DIG NOT found." >&4
12016 : see if dbm.h is available
12017 : see if dbmclose exists
12018 set dbmclose d_dbmclose
12021 case "$d_dbmclose" in
12031 *) set rpcsvc/dbm.h i_rpcsvcdbm
12036 *) echo "We won't be including <dbm.h>"
12046 : see if prototype for dbminit is available
12048 set d_dbminitproto dbminit $i_dbm dbm.h
12051 : see if difftime exists
12052 set difftime d_difftime
12055 : see if this is a dirent system
12057 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
12059 echo "<dirent.h> found." >&4
12062 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
12063 echo "<sys/dir.h> found." >&4
12066 xinc=`./findhdr sys/ndir.h`
12068 echo "<dirent.h> NOT found." >&4
12073 : Look for type of directory structure.
12075 $cppstdin $cppflags $cppminus < "$xinc" > try.c
12077 case "$direntrytype" in
12079 case "$i_dirent" in
12080 $define) guess1='struct dirent' ;;
12081 *) guess1='struct direct' ;;
12084 *) guess1="$direntrytype"
12089 'struct dirent') guess2='struct direct' ;;
12090 *) guess2='struct dirent' ;;
12093 if $contains "$guess1" try.c >/dev/null 2>&1; then
12094 direntrytype="$guess1"
12095 echo "Your directory entries are $direntrytype." >&4
12096 elif $contains "$guess2" try.c >/dev/null 2>&1; then
12097 direntrytype="$guess2"
12098 echo "Your directory entries seem to be $direntrytype." >&4
12100 echo "I don't recognize your system's directory entries." >&4
12101 rp="What type is used for directory entries on this system?"
12104 direntrytype="$ans"
12108 : see if the directory entry stores field length
12110 $cppstdin $cppflags $cppminus < "$xinc" > try.c
12111 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
12112 echo "Good, your directory entry keeps length information in d_namlen." >&4
12115 echo "Your directory entry does not know about the d_namlen field." >&4
12122 : Look for DIR.dd_fd
12123 case "$i_dirent" in
12125 echo "Checking to see if DIR has a dd_fd member variable" >&4
12127 #$i_stdlib I_STDLIB
12129 #include <stdlib.h>
12131 #include <dirent.h>
12141 if eval $compile; then
12142 echo "Yes, it does."
12145 echo "No, it does not."
12150 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
12158 : see if this is an sysdir system
12159 set sys/dir.h i_sysdir
12162 : see if this is an sysndir system
12163 set sys/ndir.h i_sysndir
12168 $cat >dirfd.c <<EOM
12170 #$i_stdlib I_STDLIB
12172 #include <stdlib.h>
12174 #$i_dirent I_DIRENT /**/
12175 #$i_sysdir I_SYS_DIR /**/
12176 #$i_sysndir I_SYS_NDIR /**/
12177 #$i_systypes I_SYS_TYPES /**/
12178 #if defined(I_SYS_TYPES)
12179 #include <sys/types.h>
12181 #if defined(I_DIRENT)
12182 #include <dirent.h>
12183 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
12184 #include <sys/dir.h>
12188 #include <sys/ndir.h>
12192 #include <ndir.h> /* may be wrong in the future */
12194 #include <sys/dir.h>
12200 DIR *dirp = opendir(".");
12201 if (dirfd(dirp) >= 0)
12209 if eval $compile; then
12213 $define) echo "dirfd() found." >&4 ;;
12214 *) echo "dirfd() NOT found." >&4 ;;
12220 : see if dladdr exists
12221 set dladdr d_dladdr
12224 : see if dlerror exists
12227 set dlerror d_dlerror
12231 : see if dlfcn is available
12232 set dlfcn.h i_dlfcn
12235 : Check what extension to use for shared libs
12240 On a few systems, the dynamically loaded modules that perl generates and uses
12241 will need a different extension than shared libs. The default will probably
12247 *) dflt="$dlext" ;;
12249 rp='What is the extension of dynamically loaded modules'
12258 : Check if dlsym need a leading underscore
12264 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
12265 $cat >dyna.c <<'EOM'
12272 #$i_stdlib I_STDLIB
12274 #include <stdlib.h>
12278 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
12280 #include <sys/types.h>
12285 extern int fred() ;
12294 int mode = RTLD_LAZY ;
12296 handle = dlopen("./dyna.$dlext", mode) ;
12297 if (handle == NULL) {
12302 symbol = dlsym(handle, "fred") ;
12303 if (symbol == NULL) {
12304 /* try putting a leading underscore */
12305 symbol = dlsym(handle, "_fred") ;
12306 if (symbol == NULL) {
12319 : Call the object file tmp-dyna.o in case dlext=o.
12320 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
12321 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
12322 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
12323 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
12326 1) echo "Test program failed using dlopen." >&4
12327 echo "Perhaps you should not use dynamic loading." >&4;;
12328 2) echo "Test program failed using dlsym." >&4
12329 echo "Perhaps you should not use dynamic loading." >&4;;
12330 3) echo "dlsym needs a leading underscore" >&4
12332 4) echo "dlsym doesn't need a leading underscore." >&4;;
12335 echo "I can't compile and run the test program." >&4
12336 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
12341 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
12346 : see if backtrace exists
12347 set backtrace d_backtrace
12350 : add flags if using c backtrace
12351 case "$usecbacktrace" in
12352 [yY]*|true|$define)
12353 case " $ccflags " in
12354 *" -DUSE_C_BACKTRACE "*) ;; # Already there.
12355 *) ccflags="$ccflags -DUSE_C_BACKTRACE -g"
12361 : see if drand48_r exists
12362 set drand48_r d_drand48_r
12364 case "$d_drand48_r" in
12366 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
12367 case "$d_drand48_r_proto:$usethreads" in
12368 ":define") d_drand48_r_proto=define
12369 set d_drand48_r_proto drand48_r $hdrs
12373 case "$d_drand48_r_proto" in
12375 case "$drand48_r_proto" in
12376 ''|0) try='int drand48_r(struct drand48_data*, double*);'
12377 ./protochk "$extern_C $try" $hdrs && drand48_r_proto=I_ST ;;
12379 case "$drand48_r_proto" in
12380 ''|0) d_drand48_r=undef
12382 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
12383 * ) case "$drand48_r_proto" in
12384 REENTRANT_PROTO*) ;;
12385 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
12387 echo "Prototype: $try" ;;
12390 *) case "$usethreads" in
12391 define) echo "drand48_r has no prototype, not using it." >&4 ;;
12398 *) drand48_r_proto=0
12402 : see if prototype for drand48 is available
12404 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
12407 : see if dup2 exists
12411 : see if eaccess exists
12412 set eaccess d_eaccess
12415 : see if endgrent exists
12416 set endgrent d_endgrent
12419 : see if this is an grp system
12425 xxx=`./findhdr grp.h`
12426 $cppstdin $cppflags $cppminus < $xxx >$$.h
12428 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
12440 set d_grpasswd; eval $setvar
12444 : see if endgrent_r exists
12445 set endgrent_r d_endgrent_r
12447 case "$d_endgrent_r" in
12449 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12450 case "$d_endgrent_r_proto:$usethreads" in
12451 ":define") d_endgrent_r_proto=define
12452 set d_endgrent_r_proto endgrent_r $hdrs
12456 case "$d_endgrent_r_proto" in
12458 case "$endgrent_r_proto" in
12459 ''|0) try='int endgrent_r(FILE**);'
12460 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=I_H ;;
12462 case "$endgrent_r_proto" in
12463 ''|0) try='void endgrent_r(FILE**);'
12464 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=V_H ;;
12466 case "$endgrent_r_proto" in
12467 ''|0) d_endgrent_r=undef
12469 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
12470 * ) case "$endgrent_r_proto" in
12471 REENTRANT_PROTO*) ;;
12472 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
12474 echo "Prototype: $try" ;;
12477 *) case "$usethreads" in
12478 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
12485 *) endgrent_r_proto=0
12489 : see if endhostent exists
12490 set endhostent d_endhent
12493 : see if this is a netdb.h system
12494 set netdb.h i_netdb
12497 : see if endhostent_r exists
12498 set endhostent_r d_endhostent_r
12500 case "$d_endhostent_r" in
12502 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12503 case "$d_endhostent_r_proto:$usethreads" in
12504 ":define") d_endhostent_r_proto=define
12505 set d_endhostent_r_proto endhostent_r $hdrs
12509 case "$d_endhostent_r_proto" in
12511 case "$endhostent_r_proto" in
12512 ''|0) try='int endhostent_r(struct hostent_data*);'
12513 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=I_D ;;
12515 case "$endhostent_r_proto" in
12516 ''|0) try='void endhostent_r(struct hostent_data*);'
12517 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=V_D ;;
12519 case "$endhostent_r_proto" in
12520 ''|0) d_endhostent_r=undef
12521 endhostent_r_proto=0
12522 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
12523 * ) case "$endhostent_r_proto" in
12524 REENTRANT_PROTO*) ;;
12525 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
12527 echo "Prototype: $try" ;;
12530 *) case "$usethreads" in
12531 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
12533 d_endhostent_r=undef
12534 endhostent_r_proto=0
12538 *) endhostent_r_proto=0
12542 : see if endnetent exists
12543 set endnetent d_endnent
12546 : see if endnetent_r exists
12547 set endnetent_r d_endnetent_r
12549 case "$d_endnetent_r" in
12551 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12552 case "$d_endnetent_r_proto:$usethreads" in
12553 ":define") d_endnetent_r_proto=define
12554 set d_endnetent_r_proto endnetent_r $hdrs
12558 case "$d_endnetent_r_proto" in
12560 case "$endnetent_r_proto" in
12561 ''|0) try='int endnetent_r(struct netent_data*);'
12562 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=I_D ;;
12564 case "$endnetent_r_proto" in
12565 ''|0) try='void endnetent_r(struct netent_data*);'
12566 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=V_D ;;
12568 case "$endnetent_r_proto" in
12569 ''|0) d_endnetent_r=undef
12570 endnetent_r_proto=0
12571 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
12572 * ) case "$endnetent_r_proto" in
12573 REENTRANT_PROTO*) ;;
12574 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
12576 echo "Prototype: $try" ;;
12579 *) case "$usethreads" in
12580 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
12582 d_endnetent_r=undef
12583 endnetent_r_proto=0
12587 *) endnetent_r_proto=0
12591 : see if endprotoent exists
12592 set endprotoent d_endpent
12595 : see if endprotoent_r exists
12596 set endprotoent_r d_endprotoent_r
12598 case "$d_endprotoent_r" in
12600 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12601 case "$d_endprotoent_r_proto:$usethreads" in
12602 ":define") d_endprotoent_r_proto=define
12603 set d_endprotoent_r_proto endprotoent_r $hdrs
12607 case "$d_endprotoent_r_proto" in
12609 case "$endprotoent_r_proto" in
12610 ''|0) try='int endprotoent_r(struct protoent_data*);'
12611 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=I_D ;;
12613 case "$endprotoent_r_proto" in
12614 ''|0) try='void endprotoent_r(struct protoent_data*);'
12615 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=V_D ;;
12617 case "$endprotoent_r_proto" in
12618 ''|0) d_endprotoent_r=undef
12619 endprotoent_r_proto=0
12620 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
12621 * ) case "$endprotoent_r_proto" in
12622 REENTRANT_PROTO*) ;;
12623 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
12625 echo "Prototype: $try" ;;
12628 *) case "$usethreads" in
12629 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
12631 d_endprotoent_r=undef
12632 endprotoent_r_proto=0
12636 *) endprotoent_r_proto=0
12640 : see if endpwent exists
12641 set endpwent d_endpwent
12644 : see if this is a pwd.h system
12650 xxx=`./findhdr pwd.h`
12651 $cppstdin $cppflags $cppminus < $xxx >$$.h
12653 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
12661 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
12669 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
12677 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
12685 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
12693 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
12701 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
12709 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
12721 set d_pwquota; eval $setvar
12722 set d_pwage; eval $setvar
12723 set d_pwchange; eval $setvar
12724 set d_pwclass; eval $setvar
12725 set d_pwexpire; eval $setvar
12726 set d_pwcomment; eval $setvar
12727 set d_pwgecos; eval $setvar
12728 set d_pwpasswd; eval $setvar
12732 : see if endpwent_r exists
12733 set endpwent_r d_endpwent_r
12735 case "$d_endpwent_r" in
12737 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
12738 case "$d_endpwent_r_proto:$usethreads" in
12739 ":define") d_endpwent_r_proto=define
12740 set d_endpwent_r_proto endpwent_r $hdrs
12744 case "$d_endpwent_r_proto" in
12746 case "$endpwent_r_proto" in
12747 ''|0) try='int endpwent_r(FILE**);'
12748 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=I_H ;;
12750 case "$endpwent_r_proto" in
12751 ''|0) try='void endpwent_r(FILE**);'
12752 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=V_H ;;
12754 case "$endpwent_r_proto" in
12755 ''|0) d_endpwent_r=undef
12757 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
12758 * ) case "$endpwent_r_proto" in
12759 REENTRANT_PROTO*) ;;
12760 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
12762 echo "Prototype: $try" ;;
12765 *) case "$usethreads" in
12766 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
12773 *) endpwent_r_proto=0
12777 : see if endservent exists
12778 set endservent d_endsent
12781 : see if endservent_r exists
12782 set endservent_r d_endservent_r
12784 case "$d_endservent_r" in
12786 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12787 case "$d_endservent_r_proto:$usethreads" in
12788 ":define") d_endservent_r_proto=define
12789 set d_endservent_r_proto endservent_r $hdrs
12793 case "$d_endservent_r_proto" in
12795 case "$endservent_r_proto" in
12796 ''|0) try='int endservent_r(struct servent_data*);'
12797 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=I_D ;;
12799 case "$endservent_r_proto" in
12800 ''|0) try='void endservent_r(struct servent_data*);'
12801 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=V_D ;;
12803 case "$endservent_r_proto" in
12804 ''|0) d_endservent_r=undef
12805 endservent_r_proto=0
12806 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
12807 * ) case "$endservent_r_proto" in
12808 REENTRANT_PROTO*) ;;
12809 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
12811 echo "Prototype: $try" ;;
12814 *) case "$usethreads" in
12815 define) echo "endservent_r has no prototype, not using it." >&4 ;;
12817 d_endservent_r=undef
12818 endservent_r_proto=0
12822 *) endservent_r_proto=0
12826 : see if this is an execinfo.h system
12827 set execinfo.h i_execinfo
12830 : Locate the flags for 'open()'
12833 #include <sys/types.h>
12838 #include <sys/file.h>
12840 #$i_stdlib I_STDLIB
12842 #include <stdlib.h>
12853 : check sys/file.h first to get FREAD on Sun
12854 if $test `./findhdr sys/file.h` && \
12855 set try -DI_SYS_FILE && eval $compile; then
12857 echo "<sys/file.h> defines the O_* constants..." >&4
12858 if $run ./try; then
12859 echo "and you have the 3 argument form of open()." >&4
12862 echo "but not the 3 argument form of open(). Oh, well." >&4
12865 elif $test `./findhdr fcntl.h` && \
12866 set try -DI_FCNTL && eval $compile; then
12868 echo "<fcntl.h> defines the O_* constants..." >&4
12869 if $run ./try; then
12870 echo "and you have the 3 argument form of open()." >&4
12873 echo "but not the 3 argument form of open(). Oh, well." >&4
12878 echo "I can't find the O_* constant definitions! You got problems." >&4
12884 : see if this is a sys/file.h system
12889 : do we need to include sys/file.h ?
12893 if $h_sysfile; then
12895 echo "We'll be including <sys/file.h>." >&4
12898 echo "We won't be including <sys/file.h>." >&4
12908 : see if fcntl.h is there
12913 : see if we can include fcntl.h
12919 echo "We'll be including <fcntl.h>." >&4
12922 if $h_sysfile; then
12923 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
12925 echo "We won't be including <fcntl.h>." >&4
12937 : see if fork exists
12941 : see if pipe exists
12945 : check for non-blocking I/O stuff
12946 case "$h_sysfile" in
12947 true) echo "#include <sys/file.h>" > head.c;;
12950 true) echo "#include <fcntl.h>" > head.c;;
12951 *) echo "#include <sys/fcntl.h>" > head.c;;
12956 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
12957 case "$o_nonblock" in
12959 $cat head.c > try.c
12960 $cat >>try.c <<EOCP
12962 #$i_stdlib I_STDLIB
12964 #include <stdlib.h>
12972 printf("O_NONBLOCK\n");
12976 printf("O_NDELAY\n");
12980 printf("FNDELAY\n");
12987 if eval $compile_ok; then
12988 o_nonblock=`$run ./try`
12989 case "$o_nonblock" in
12990 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
12991 *) echo "Seems like we can use $o_nonblock.";;
12994 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
12997 *) echo "Using $hint value $o_nonblock.";;
13002 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
13005 case "$d_fork:$d_pipe" in
13007 $cat head.c > try.c
13008 $cat >>try.c <<EOCP
13010 #include <sys/types.h>
13011 #include <signal.h>
13013 #$i_stdlib I_STDLIB
13015 #include <stdlib.h>
13021 #define MY_O_NONBLOCK $o_nonblock
13022 #ifndef errno /* XXX need better Configure test */
13025 #$i_unistd I_UNISTD
13027 #include <unistd.h>
13029 #$i_string I_STRING
13031 #include <string.h>
13033 #include <strings.h>
13035 $signal_t blech(int x) { exit(3); }
13037 $cat >> try.c <<'EOCP'
13045 pipe(pd); /* Down: child -> parent */
13046 pipe(pu); /* Up: parent -> child */
13049 close(pd[1]); /* Parent reads from pd[0] */
13050 close(pu[0]); /* Parent writes (blocking) to pu[1] */
13052 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
13057 signal(SIGALRM, blech);
13059 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
13061 sprintf(string, "%d\n", ret);
13062 write(2, string, strlen(string));
13065 if (errno == EAGAIN) {
13066 printf("EAGAIN\n");
13071 if (errno == EWOULDBLOCK)
13072 printf("EWOULDBLOCK\n");
13075 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
13076 sleep(2); /* Give it time to close our pipe */
13078 ret = read(pd[0], buf, 1); /* Should read EOF */
13080 sprintf(string, "%d\n", ret);
13081 write(4, string, strlen(string));
13085 close(pd[0]); /* We write to pd[1] */
13086 close(pu[1]); /* We read from pu[0] */
13087 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
13088 close(pd[1]); /* Pipe pd is now fully closed! */
13089 exit(0); /* Bye bye, thank you for playing! */
13093 if eval $compile_ok; then
13094 echo "$startsh" >mtry
13095 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
13097 $run ./mtry >/dev/null 2>&1
13099 0) eagain=`$cat try.out`;;
13100 1) echo "Could not perform non-blocking setting!";;
13101 2) echo "I did a successful read() for something that was not there!";;
13102 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
13103 4) echo "Could not find F_SETFL!";;
13104 *) echo "Something terribly wrong happened during testing.";;
13106 rd_nodata=`$cat try.ret`
13107 echo "A read() system call with no data present returns $rd_nodata."
13108 case "$rd_nodata" in
13111 echo "(That's peculiar, fixing that to be -1.)"
13117 echo "Forcing errno EAGAIN on read() with no data available."
13121 echo "Your read() sets errno to $eagain when no data is available."
13124 status=`$cat try.err`
13126 0) echo "And it correctly returns 0 to signal EOF.";;
13127 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
13128 *) echo "However, your read() returns '$status' on EOF??";;
13131 if test "$status" = "$rd_nodata"; then
13132 echo "WARNING: you can't distinguish between EOF and no data!"
13136 echo "I can't compile the test program--assuming errno EAGAIN will do."
13140 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
13149 echo "Using $hint value $eagain."
13150 echo "Your read() returns $rd_nodata when no data is present."
13151 case "$d_eofnblk" in
13152 "$define") echo "And you can see EOF because read() returns 0.";;
13153 "$undef") echo "But you can't see EOF status from read() returned value.";;
13155 echo "(Assuming you can't see EOF status from read anyway.)"
13161 $rm_try head.c mtry
13163 : see if _ptr and _cnt from stdio act std
13166 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
13167 echo "(Looks like you have stdio.h from BSD.)"
13168 case "$stdio_ptr" in
13169 '') stdio_ptr='((fp)->_p)'
13172 *) ptr_lval=$d_stdio_ptr_lval;;
13174 case "$stdio_cnt" in
13175 '') stdio_cnt='((fp)->_r)'
13178 *) cnt_lval=$d_stdio_cnt_lval;;
13180 case "$stdio_base" in
13181 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
13183 case "$stdio_bufsiz" in
13184 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
13186 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
13187 echo "(Looks like you have stdio.h from Linux.)"
13188 case "$stdio_ptr" in
13189 '') stdio_ptr='((fp)->_IO_read_ptr)'
13192 *) ptr_lval=$d_stdio_ptr_lval;;
13194 case "$stdio_cnt" in
13195 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
13198 *) cnt_lval=$d_stdio_cnt_lval;;
13200 case "$stdio_base" in
13201 '') stdio_base='((fp)->_IO_read_base)';;
13203 case "$stdio_bufsiz" in
13204 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
13207 case "$stdio_ptr" in
13208 '') stdio_ptr='((fp)->_ptr)'
13211 *) ptr_lval=$d_stdio_ptr_lval;;
13213 case "$stdio_cnt" in
13214 '') stdio_cnt='((fp)->_cnt)'
13217 *) cnt_lval=$d_stdio_cnt_lval;;
13219 case "$stdio_base" in
13220 '') stdio_base='((fp)->_base)';;
13222 case "$stdio_bufsiz" in
13223 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
13227 : test whether _ptr and _cnt really work
13228 echo "Checking how std your stdio is..." >&4
13231 #$i_stdlib I_STDLIB
13233 #include <stdlib.h>
13235 #define FILE_ptr(fp) $stdio_ptr
13236 #define FILE_cnt(fp) $stdio_cnt
13238 FILE *fp = fopen("try.c", "r");
13241 18 <= FILE_cnt(fp) &&
13242 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13250 if eval $compile && $to try.c; then
13251 if $run ./try; then
13252 echo "Your stdio acts pretty std."
13255 echo "Your stdio isn't very std."
13258 echo "Your stdio doesn't appear very std."
13262 # glibc 2.2.90 and above apparently change stdio streams so Perl's
13263 # direct buffer manipulation no longer works. The Configure tests
13264 # should be changed to correctly detect this, but until then,
13265 # the following check should at least let perl compile and run.
13266 # (This quick fix should be updated before 5.8.1.)
13267 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
13268 # A. Dougherty, June 3, 2002.
13269 case "$d_gnulibc" in
13271 case "$gnulibc_version" in
13275 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
13284 : Can _ptr be used as an lvalue?
13285 case "$d_stdstdio$ptr_lval" in
13286 $define$define) val=$define ;;
13289 set d_stdio_ptr_lval
13292 : Can _cnt be used as an lvalue?
13293 case "$d_stdstdio$cnt_lval" in
13294 $define$define) val=$define ;;
13297 set d_stdio_cnt_lval
13301 : test whether setting _ptr sets _cnt as a side effect
13302 d_stdio_ptr_lval_sets_cnt="$undef"
13303 d_stdio_ptr_lval_nochange_cnt="$undef"
13304 case "$d_stdio_ptr_lval$d_stdstdio" in
13306 echo "Checking to see what happens if we set the stdio ptr..." >&4
13309 /* Can we scream? */
13310 /* Eat dust sed :-) */
13311 /* In the buffer space, no one can hear you scream. */
13312 #$i_stdlib I_STDLIB
13314 #include <stdlib.h>
13316 #define FILE_ptr(fp) $stdio_ptr
13317 #define FILE_cnt(fp) $stdio_cnt
13318 #include <sys/types.h>
13320 FILE *fp = fopen("try.c", "r");
13325 puts("Fail even to read");
13328 c = getc(fp); /* Read away the first # */
13330 puts("Fail even to read");
13334 18 <= FILE_cnt(fp) &&
13335 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13337 puts("Fail even to read");
13340 ptr = (char*) FILE_ptr(fp);
13341 cnt = (size_t)FILE_cnt(fp);
13343 FILE_ptr(fp) += 42;
13345 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
13346 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
13349 if (FILE_cnt(fp) <= 20) {
13350 printf ("Fail (<20 chars to test)");
13353 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
13354 puts("Fail compare");
13357 if (cnt == FILE_cnt(fp)) {
13358 puts("Pass_unchanged");
13361 if (FILE_cnt(fp) == (cnt - 42)) {
13362 puts("Pass_changed");
13365 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
13371 if eval $compile && $to try.c; then
13372 case `$run ./try` in
13374 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
13375 d_stdio_ptr_lval_sets_cnt="$define" ;;
13377 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
13378 d_stdio_ptr_lval_nochange_cnt="$define" ;;
13380 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
13382 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
13385 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
13391 : see if _base is also standard
13393 case "$d_stdstdio" in
13397 #$i_stdlib I_STDLIB
13399 #include <stdlib.h>
13401 #define FILE_base(fp) $stdio_base
13402 #define FILE_bufsiz(fp) $stdio_bufsiz
13404 FILE *fp = fopen("try.c", "r");
13407 19 <= FILE_bufsiz(fp) &&
13408 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
13415 if eval $compile && $to try.c; then
13416 if $run ./try; then
13417 echo "And its _base field acts std."
13420 echo "But its _base field isn't std."
13423 echo "However, it seems to be lacking the _base field."
13431 : see if fast_stdio exists
13433 case "$d_stdstdio:$d_stdio_ptr_lval" in
13435 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
13437 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
13448 : see if fchdir exists
13449 set fchdir d_fchdir
13452 : see if fchmod exists
13453 set fchmod d_fchmod
13456 : see if fchown exists
13457 set fchown d_fchown
13460 : see if this is an fcntl system
13464 : See if fcntl-based locking works.
13467 #$i_stdlib I_STDLIB
13469 #include <stdlib.h>
13471 #include <unistd.h>
13473 #include <signal.h>
13474 $signal_t blech(int x) { exit(3); }
13476 #if defined(F_SETLK) && defined(F_SETLKW)
13477 struct flock flock;
13479 fd = open("try.c", O_RDONLY);
13480 flock.l_type = F_RDLCK;
13481 flock.l_whence = SEEK_SET;
13482 flock.l_start = flock.l_len = 0;
13483 signal(SIGALRM, blech);
13485 retval = fcntl(fd, F_SETLK, &flock);
13487 (retval < 0 ? exit(2) : exit(0));
13493 echo "Checking if fcntl-based file locking works... "
13497 if eval $compile_ok; then
13498 if $run ./try; then
13499 echo "Yes, it seems to work."
13502 echo "Nope, it didn't work."
13507 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
13508 *** This is (almost) impossible.
13509 *** If your NFS lock daemons are not feeling well, something like
13510 *** this may happen, please investigate. Cannot continue, aborting.
13518 echo "I'm unable to compile the test program, so I'll assume not."
13523 echo "Nope, since you don't even have fcntl()."
13526 set d_fcntl_can_lock
13530 : check for fd_set items
13533 Checking to see how well your C compiler handles fd_set and friends ...
13536 #$i_stdlib I_STDLIB
13538 #include <stdlib.h>
13540 #$i_systime I_SYS_TIME
13541 #$i_sysselct I_SYS_SELECT
13542 #$d_socket HAS_SOCKET
13543 #include <sys/types.h>
13545 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
13548 #include <sys/time.h>
13550 #ifdef I_SYS_SELECT
13551 #include <sys/select.h>
13560 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
13568 if eval $compile; then
13569 d_fds_bits="$define"
13571 echo "Well, your system knows about the normal fd_set typedef..." >&4
13572 if $run ./try; then
13573 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
13574 d_fd_macros="$define"
13577 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
13579 d_fd_macros="$undef"
13583 Hmm, your compiler has some difficulty with fd_set. Checking further...
13586 if eval $compile; then
13587 d_fds_bits="$undef"
13589 echo "Well, your system has some sort of fd_set available..." >&4
13590 if $run ./try; then
13591 echo "and you have the normal fd_set macros." >&4
13592 d_fd_macros="$define"
13595 but not the normal fd_set macros! Gross! More work for me...
13597 d_fd_macros="$undef"
13600 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
13602 d_fds_bits="$undef"
13603 d_fd_macros="$undef"
13608 : see if fgetpos exists
13609 set fgetpos d_fgetpos
13612 : see if finite exists
13613 set finite d_finite
13616 : see if finitel exists
13617 set finitel d_finitel
13620 : see if flock exists
13624 : see if prototype for flock is available
13626 set d_flockproto flock $i_sysfile sys/file.h
13629 : see if fp_class exists
13630 set fp_class d_fp_class
13633 : see if pathconf exists
13634 set pathconf d_pathconf
13637 : see if fpathconf exists
13638 set fpathconf d_fpathconf
13641 : see if fpclass exists
13642 set fpclass d_fpclass
13645 : see if fpclassify exists
13646 set fpclassify d_fpclassify
13649 : see if fpclassl exists
13650 set fpclassl d_fpclassl
13653 : check for fpos64_t
13655 echo "Checking to see if you have fpos64_t..." >&4
13658 int main() { fpos64_t x = 7; }
13661 if eval $compile; then
13663 echo "You have fpos64_t."
13666 echo "You do not have fpos64_t."
13667 case "$fpossize" in
13668 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
13675 : see if frexpl exists
13676 set frexpl d_frexpl
13679 : see if this is a sys/param system
13680 set sys/param.h i_sysparam
13683 : see if this is a sys/mount.h system
13684 set sys/mount.h i_sysmount
13687 : Check for fs_data_s
13689 echo "Checking to see if your system supports struct fs_data..." >&4
13690 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
13692 case "$d_fs_data_s" in
13693 "$define") echo "Yes, it does." ;;
13694 *) echo "No, it doesn't." ;;
13697 : see if fseeko exists
13698 set fseeko d_fseeko
13700 case "$longsize" in
13701 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
13704 : see if fsetpos exists
13705 set fsetpos d_fsetpos
13708 : see if fstatfs exists
13709 set fstatfs d_fstatfs
13712 : see if statvfs exists
13713 set statvfs d_statvfs
13716 : see if fstatvfs exists
13717 set fstatvfs d_fstatvfs
13721 : see if fsync exists
13725 : see if ftello exists
13726 set ftello d_ftello
13728 case "$longsize" in
13729 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
13732 : check for a working futimes
13735 echo "Checking if you have a working futimes()" >&4
13738 #include <sys/time.h>
13745 fd = open ("try.c", O_RDWR);
13746 if (-1 == fd) exit (1);
13747 rv = futimes (fd, NULL);
13748 exit (rv == -1 ? errno : 0);
13752 if eval $compile; then
13756 0) echo "Yes, you have" >&4
13757 d_futimes="$define"
13759 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
13763 echo "No, it does not (probably harmless)" >&4
13767 : see if ndbm.h is available
13770 : Compatibility location for RedHat 7.1
13771 set gdbm/ndbm.h i_gdbmndbm
13773 : Compatibility location for Debian 4.0
13774 set gdbm-ndbm.h i_gdbm_ndbm
13778 if $test "$i_ndbm" = "$define" -o "$i_gdbmndbm" = "$define" -o "$i_gdbm_ndbm" = "$define"; then
13779 : see if dbm_open exists
13780 set dbm_open d_dbm_open
13782 case "$d_dbm_open" in
13785 i_gdbmndbm="$undef"
13786 i_gdbm_ndbm="$undef"
13787 echo "We won't be including <ndbm.h>"
13797 ndbm_hdr_protochk='name=$1; hdr=$2;
13798 eval "ihdr=\$""i_$name";
13800 if $test "$ihdr" = "$define"; then
13801 $echo "Checking if your <$hdr> uses prototypes..." >&4;
13802 case "$d_cplusplus" in
13803 $define) ./protochk "$extern_C void dbm_close(DBM *);" literal "extern \"C\" {" $ihdr $hdr literal "}" && val="$define" ;;
13804 *) ./protochk "$extern_C void dbm_close(int, int);" $ihdr $hdr || val="$define" ;;
13807 $define) $echo "Your <$hdr> seems to have prototypes";;
13808 *) $echo "Your <$hdr> does not seem to have prototypes";;
13811 set "d_${name}_h_uses_prototypes";
13815 eval $ndbm_hdr_protochk
13816 set gdbmndbm gdbm/ndbm.h
13817 eval $ndbm_hdr_protochk
13818 set gdbm_ndbm gdbm-ndbm.h
13819 eval $ndbm_hdr_protochk
13821 : see if getaddrinfo exists
13822 set getaddrinfo d_getaddrinfo
13825 : see if getcwd exists
13826 set getcwd d_getcwd
13829 : see if getespwnam exists
13830 set getespwnam d_getespwnam
13833 : see if getfsstat exists
13834 set getfsstat d_getfsstat
13837 : see if getgrent exists
13838 set getgrent d_getgrent
13841 : see if getgrent_r exists
13842 set getgrent_r d_getgrent_r
13844 case "$d_getgrent_r" in
13846 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13847 case "$d_getgrent_r_proto:$usethreads" in
13848 ":define") d_getgrent_r_proto=define
13849 set d_getgrent_r_proto getgrent_r $hdrs
13853 case "$d_getgrent_r_proto" in
13855 case "$getgrent_r_proto" in
13856 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
13857 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBWR ;;
13859 case "$getgrent_r_proto" in
13860 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
13861 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIR ;;
13863 case "$getgrent_r_proto" in
13864 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
13865 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBW ;;
13867 case "$getgrent_r_proto" in
13868 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
13869 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBI ;;
13871 case "$getgrent_r_proto" in
13872 ''|0) try='int getgrent_r(struct group*, char*, int);'
13873 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBI ;;
13875 case "$getgrent_r_proto" in
13876 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
13877 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIH ;;
13879 case "$getgrent_r_proto" in
13880 ''|0) d_getgrent_r=undef
13882 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
13883 * ) case "$getgrent_r_proto" in
13884 REENTRANT_PROTO*) ;;
13885 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
13887 echo "Prototype: $try" ;;
13890 *) case "$usethreads" in
13891 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
13898 *) getgrent_r_proto=0
13902 : see if getgrgid_r exists
13903 set getgrgid_r d_getgrgid_r
13905 case "$d_getgrgid_r" in
13907 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13908 case "$d_getgrgid_r_proto:$usethreads" in
13909 ":define") d_getgrgid_r_proto=define
13910 set d_getgrgid_r_proto getgrgid_r $hdrs
13914 case "$d_getgrgid_r_proto" in
13916 case "$getgrgid_r_proto" in
13917 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
13918 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
13920 case "$getgrgid_r_proto" in
13921 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
13922 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
13924 case "$getgrgid_r_proto" in
13925 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
13926 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
13928 case "$getgrgid_r_proto" in
13929 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
13930 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
13932 case "$getgrgid_r_proto" in
13933 ''|0) d_getgrgid_r=undef
13935 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
13936 * ) case "$getgrgid_r_proto" in
13937 REENTRANT_PROTO*) ;;
13938 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
13940 echo "Prototype: $try" ;;
13943 *) case "$usethreads" in
13944 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
13951 *) getgrgid_r_proto=0
13955 : see if getgrnam_r exists
13956 set getgrnam_r d_getgrnam_r
13958 case "$d_getgrnam_r" in
13960 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13961 case "$d_getgrnam_r_proto:$usethreads" in
13962 ":define") d_getgrnam_r_proto=define
13963 set d_getgrnam_r_proto getgrnam_r $hdrs
13967 case "$d_getgrnam_r_proto" in
13969 case "$getgrnam_r_proto" in
13970 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
13971 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
13973 case "$getgrnam_r_proto" in
13974 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
13975 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
13977 case "$getgrnam_r_proto" in
13978 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
13979 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CBI ;;
13981 case "$getgrnam_r_proto" in
13982 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
13983 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
13985 case "$getgrnam_r_proto" in
13986 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
13987 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
13989 case "$getgrnam_r_proto" in
13990 ''|0) d_getgrnam_r=undef
13992 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
13993 * ) case "$getgrnam_r_proto" in
13994 REENTRANT_PROTO*) ;;
13995 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
13997 echo "Prototype: $try" ;;
14000 *) case "$usethreads" in
14001 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
14008 *) getgrnam_r_proto=0
14012 : see if gethostbyaddr exists
14013 set gethostbyaddr d_gethbyaddr
14016 : see if gethostbyname exists
14017 set gethostbyname d_gethbyname
14020 : see if gethostent exists
14021 set gethostent d_gethent
14024 : see how we will look up host name
14027 if set gethostname val -f d_gethname; eval $csym; $val; then
14028 echo 'gethostname() found.' >&4
14029 d_gethname="$define"
14032 if set uname val -f d_uname; eval $csym; $val; then
14035 uname() was found, but you're running xenix, and older versions of xenix
14036 have a broken uname(). If you don't really know whether your xenix is old
14037 enough to have a broken system call, use the default answer.
14042 "$define") dflt=n;;
14044 rp='Is your uname() broken?'
14047 n*) d_uname="$define"; call=uname;;
14050 echo 'uname() found.' >&4
14057 case "$d_gethname" in
14058 '') d_gethname="$undef";;
14061 '') d_uname="$undef";;
14063 case "$d_uname$d_gethname" in
14068 Every now and then someone has a $call() that lies about the hostname
14069 but can't be fixed for political or economic reasons. If you wish, I can
14070 pretend $call() isn't there and maybe compute hostname at run-time
14071 thanks to the '$phostname' command.
14074 rp="Shall I ignore $call() from now on?"
14077 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
14080 case "$phostname" in
14081 '') aphostname='';;
14082 *) case "$aphostname" in
14084 *) set X $phostname
14088 file=`./loc $file $file $pth`
14089 aphostname=`echo $file $*`
14094 case "$d_uname$d_gethname" in
14097 case "$phostname" in
14099 echo "There will be no way for $package to get your hostname." >&4;;
14101 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
14105 case "$d_phostname" in
14106 '') d_phostname="$undef";;
14109 : see if gethostbyaddr_r exists
14110 set gethostbyaddr_r d_gethostbyaddr_r
14112 case "$d_gethostbyaddr_r" in
14114 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14115 case "$d_gethostbyaddr_r_proto:$usethreads" in
14116 ":define") d_gethostbyaddr_r_proto=define
14117 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
14121 case "$d_gethostbyaddr_r_proto" in
14123 case "$gethostbyaddr_r_proto" in
14124 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
14125 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
14127 case "$gethostbyaddr_r_proto" in
14128 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
14129 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
14131 case "$gethostbyaddr_r_proto" in
14132 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
14133 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
14135 case "$gethostbyaddr_r_proto" in
14136 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
14137 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
14139 case "$gethostbyaddr_r_proto" in
14140 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
14141 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
14143 case "$gethostbyaddr_r_proto" in
14144 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
14145 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
14147 case "$gethostbyaddr_r_proto" in
14148 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
14149 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
14151 case "$gethostbyaddr_r_proto" in
14152 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
14153 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
14155 case "$gethostbyaddr_r_proto" in
14156 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
14157 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
14159 case "$gethostbyaddr_r_proto" in
14160 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
14161 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
14163 case "$gethostbyaddr_r_proto" in
14164 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
14165 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
14167 case "$gethostbyaddr_r_proto" in
14168 ''|0) d_gethostbyaddr_r=undef
14169 gethostbyaddr_r_proto=0
14170 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
14171 * ) case "$gethostbyaddr_r_proto" in
14172 REENTRANT_PROTO*) ;;
14173 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
14175 echo "Prototype: $try" ;;
14178 *) case "$usethreads" in
14179 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
14181 d_gethostbyaddr_r=undef
14182 gethostbyaddr_r_proto=0
14186 *) gethostbyaddr_r_proto=0
14190 : see if gethostbyname_r exists
14191 set gethostbyname_r d_gethostbyname_r
14193 case "$d_gethostbyname_r" in
14195 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14196 case "$d_gethostbyname_r_proto:$usethreads" in
14197 ":define") d_gethostbyname_r_proto=define
14198 set d_gethostbyname_r_proto gethostbyname_r $hdrs
14202 case "$d_gethostbyname_r_proto" in
14204 case "$gethostbyname_r_proto" in
14205 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
14206 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
14208 case "$gethostbyname_r_proto" in
14209 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
14210 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
14212 case "$gethostbyname_r_proto" in
14213 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
14214 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
14216 case "$gethostbyname_r_proto" in
14217 ''|0) d_gethostbyname_r=undef
14218 gethostbyname_r_proto=0
14219 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
14220 * ) case "$gethostbyname_r_proto" in
14221 REENTRANT_PROTO*) ;;
14222 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
14224 echo "Prototype: $try" ;;
14227 *) case "$usethreads" in
14228 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
14230 d_gethostbyname_r=undef
14231 gethostbyname_r_proto=0
14235 *) gethostbyname_r_proto=0
14239 : see if gethostent_r exists
14240 set gethostent_r d_gethostent_r
14242 case "$d_gethostent_r" in
14244 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14245 case "$d_gethostent_r_proto:$usethreads" in
14246 ":define") d_gethostent_r_proto=define
14247 set d_gethostent_r_proto gethostent_r $hdrs
14251 case "$d_gethostent_r_proto" in
14253 case "$gethostent_r_proto" in
14254 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
14255 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
14257 case "$gethostent_r_proto" in
14258 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
14259 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBIE ;;
14261 case "$gethostent_r_proto" in
14262 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
14263 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBIE ;;
14265 case "$gethostent_r_proto" in
14266 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
14267 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBI ;;
14269 case "$gethostent_r_proto" in
14270 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
14271 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBI ;;
14273 case "$gethostent_r_proto" in
14274 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
14275 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SD ;;
14277 case "$gethostent_r_proto" in
14278 ''|0) d_gethostent_r=undef
14279 gethostent_r_proto=0
14280 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
14281 * ) case "$gethostent_r_proto" in
14282 REENTRANT_PROTO*) ;;
14283 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
14285 echo "Prototype: $try" ;;
14288 *) case "$usethreads" in
14289 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
14291 d_gethostent_r=undef
14292 gethostent_r_proto=0
14296 *) gethostent_r_proto=0
14300 : see if prototypes for various gethostxxx netdb.h functions are available
14302 set d_gethostprotos gethostent $i_netdb netdb.h
14305 : see if getitimer exists
14306 set getitimer d_getitimer
14309 : see if getlogin exists
14310 set getlogin d_getlogin
14313 : see if getlogin_r exists
14314 set getlogin_r d_getlogin_r
14316 case "$d_getlogin_r" in
14318 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
14319 case "$d_getlogin_r_proto:$usethreads" in
14320 ":define") d_getlogin_r_proto=define
14321 set d_getlogin_r_proto getlogin_r $hdrs
14325 case "$d_getlogin_r_proto" in
14327 case "$getlogin_r_proto" in
14328 ''|0) try='int getlogin_r(char*, size_t);'
14329 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BW ;;
14331 case "$getlogin_r_proto" in
14332 ''|0) try='int getlogin_r(char*, int);'
14333 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BI ;;
14335 case "$getlogin_r_proto" in
14336 ''|0) try='char* getlogin_r(char*, size_t);'
14337 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BW ;;
14339 case "$getlogin_r_proto" in
14340 ''|0) try='char* getlogin_r(char*, int);'
14341 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BI ;;
14343 case "$getlogin_r_proto" in
14344 ''|0) d_getlogin_r=undef
14346 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
14347 * ) case "$getlogin_r_proto" in
14348 REENTRANT_PROTO*) ;;
14349 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
14351 echo "Prototype: $try" ;;
14354 *) case "$usethreads" in
14355 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
14362 *) getlogin_r_proto=0
14366 : see if getmnt exists
14367 set getmnt d_getmnt
14370 : see if getmntent exists
14371 set getmntent d_getmntent
14374 : see if getnameinfo exists
14375 set getnameinfo d_getnameinfo
14378 : see if getnetbyaddr exists
14379 set getnetbyaddr d_getnbyaddr
14382 : see if getnetbyname exists
14383 set getnetbyname d_getnbyname
14386 : see if getnetent exists
14387 set getnetent d_getnent
14390 : see if getnetbyaddr_r exists
14391 set getnetbyaddr_r d_getnetbyaddr_r
14393 case "$d_getnetbyaddr_r" in
14395 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14396 case "$d_getnetbyaddr_r_proto:$usethreads" in
14397 ":define") d_getnetbyaddr_r_proto=define
14398 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
14402 case "$d_getnetbyaddr_r_proto" in
14404 case "$getnetbyaddr_r_proto" in
14405 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
14406 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
14408 case "$getnetbyaddr_r_proto" in
14409 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
14410 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
14412 case "$getnetbyaddr_r_proto" in
14413 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
14414 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
14416 case "$getnetbyaddr_r_proto" in
14417 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
14418 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
14420 case "$getnetbyaddr_r_proto" in
14421 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
14422 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
14424 case "$getnetbyaddr_r_proto" in
14425 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
14426 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
14428 case "$getnetbyaddr_r_proto" in
14429 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
14430 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
14432 case "$getnetbyaddr_r_proto" in
14433 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
14434 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
14436 case "$getnetbyaddr_r_proto" in
14437 ''|0) d_getnetbyaddr_r=undef
14438 getnetbyaddr_r_proto=0
14439 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
14440 * ) case "$getnetbyaddr_r_proto" in
14441 REENTRANT_PROTO*) ;;
14442 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
14444 echo "Prototype: $try" ;;
14447 *) case "$usethreads" in
14448 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
14450 d_getnetbyaddr_r=undef
14451 getnetbyaddr_r_proto=0
14455 *) getnetbyaddr_r_proto=0
14459 : see if getnetbyname_r exists
14460 set getnetbyname_r d_getnetbyname_r
14462 case "$d_getnetbyname_r" in
14464 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14465 case "$d_getnetbyname_r_proto:$usethreads" in
14466 ":define") d_getnetbyname_r_proto=define
14467 set d_getnetbyname_r_proto getnetbyname_r $hdrs
14471 case "$d_getnetbyname_r_proto" in
14473 case "$getnetbyname_r_proto" in
14474 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
14475 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
14477 case "$getnetbyname_r_proto" in
14478 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
14479 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
14481 case "$getnetbyname_r_proto" in
14482 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
14483 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
14485 case "$getnetbyname_r_proto" in
14486 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
14487 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
14489 case "$getnetbyname_r_proto" in
14490 ''|0) d_getnetbyname_r=undef
14491 getnetbyname_r_proto=0
14492 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
14493 * ) case "$getnetbyname_r_proto" in
14494 REENTRANT_PROTO*) ;;
14495 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
14497 echo "Prototype: $try" ;;
14500 *) case "$usethreads" in
14501 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
14503 d_getnetbyname_r=undef
14504 getnetbyname_r_proto=0
14508 *) getnetbyname_r_proto=0
14512 : see if getnetent_r exists
14513 set getnetent_r d_getnetent_r
14515 case "$d_getnetent_r" in
14517 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14518 case "$d_getnetent_r_proto:$usethreads" in
14519 ":define") d_getnetent_r_proto=define
14520 set d_getnetent_r_proto getnetent_r $hdrs
14524 case "$d_getnetent_r_proto" in
14526 case "$getnetent_r_proto" in
14527 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
14528 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
14530 case "$getnetent_r_proto" in
14531 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
14532 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBIE ;;
14534 case "$getnetent_r_proto" in
14535 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
14536 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBIE ;;
14538 case "$getnetent_r_proto" in
14539 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
14540 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBI ;;
14542 case "$getnetent_r_proto" in
14543 ''|0) try='int getnetent_r(struct netent*, char*, int);'
14544 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBI ;;
14546 case "$getnetent_r_proto" in
14547 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
14548 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SD ;;
14550 case "$getnetent_r_proto" in
14551 ''|0) d_getnetent_r=undef
14552 getnetent_r_proto=0
14553 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
14554 * ) case "$getnetent_r_proto" in
14555 REENTRANT_PROTO*) ;;
14556 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
14558 echo "Prototype: $try" ;;
14561 *) case "$usethreads" in
14562 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
14564 d_getnetent_r=undef
14565 getnetent_r_proto=0
14569 *) getnetent_r_proto=0
14573 : see if prototypes for various getnetxxx netdb.h functions are available
14575 set d_getnetprotos getnetent $i_netdb netdb.h
14578 : see if getpagesize exists
14579 set getpagesize d_getpagsz
14582 : Optional checks for getprotobyname and getprotobynumber
14584 : see if getprotobyname exists
14585 set getprotobyname d_getpbyname
14588 : see if getprotobynumber exists
14589 set getprotobynumber d_getpbynumber
14592 : see if getprotoent exists
14593 set getprotoent d_getpent
14596 : see if getpgid exists
14597 set getpgid d_getpgid
14600 : see if getpgrp2 exists
14601 set getpgrp2 d_getpgrp2
14604 : see if getppid exists
14605 set getppid d_getppid
14608 : see if getpriority exists
14609 set getpriority d_getprior
14612 : see if getprotobyname_r exists
14613 set getprotobyname_r d_getprotobyname_r
14615 case "$d_getprotobyname_r" in
14617 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14618 case "$d_getprotobyname_r_proto:$usethreads" in
14619 ":define") d_getprotobyname_r_proto=define
14620 set d_getprotobyname_r_proto getprotobyname_r $hdrs
14624 case "$d_getprotobyname_r_proto" in
14626 case "$getprotobyname_r_proto" in
14627 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
14628 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
14630 case "$getprotobyname_r_proto" in
14631 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
14632 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
14634 case "$getprotobyname_r_proto" in
14635 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
14636 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
14638 case "$getprotobyname_r_proto" in
14639 ''|0) d_getprotobyname_r=undef
14640 getprotobyname_r_proto=0
14641 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
14642 * ) case "$getprotobyname_r_proto" in
14643 REENTRANT_PROTO*) ;;
14644 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
14646 echo "Prototype: $try" ;;
14649 *) case "$usethreads" in
14650 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
14652 d_getprotobyname_r=undef
14653 getprotobyname_r_proto=0
14657 *) getprotobyname_r_proto=0
14661 : see if getprotobynumber_r exists
14662 set getprotobynumber_r d_getprotobynumber_r
14664 case "$d_getprotobynumber_r" in
14666 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14667 case "$d_getprotobynumber_r_proto:$usethreads" in
14668 ":define") d_getprotobynumber_r_proto=define
14669 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
14673 case "$d_getprotobynumber_r_proto" in
14675 case "$getprotobynumber_r_proto" in
14676 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
14677 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
14679 case "$getprotobynumber_r_proto" in
14680 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
14681 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
14683 case "$getprotobynumber_r_proto" in
14684 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
14685 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
14687 case "$getprotobynumber_r_proto" in
14688 ''|0) d_getprotobynumber_r=undef
14689 getprotobynumber_r_proto=0
14690 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
14691 * ) case "$getprotobynumber_r_proto" in
14692 REENTRANT_PROTO*) ;;
14693 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
14695 echo "Prototype: $try" ;;
14698 *) case "$usethreads" in
14699 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
14701 d_getprotobynumber_r=undef
14702 getprotobynumber_r_proto=0
14706 *) getprotobynumber_r_proto=0
14710 : see if getprotoent_r exists
14711 set getprotoent_r d_getprotoent_r
14713 case "$d_getprotoent_r" in
14715 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14716 case "$d_getprotoent_r_proto:$usethreads" in
14717 ":define") d_getprotoent_r_proto=define
14718 set d_getprotoent_r_proto getprotoent_r $hdrs
14722 case "$d_getprotoent_r_proto" in
14724 case "$getprotoent_r_proto" in
14725 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
14726 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
14728 case "$getprotoent_r_proto" in
14729 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
14730 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBI ;;
14732 case "$getprotoent_r_proto" in
14733 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
14734 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=S_SBI ;;
14736 case "$getprotoent_r_proto" in
14737 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
14738 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SD ;;
14740 case "$getprotoent_r_proto" in
14741 ''|0) d_getprotoent_r=undef
14742 getprotoent_r_proto=0
14743 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
14744 * ) case "$getprotoent_r_proto" in
14745 REENTRANT_PROTO*) ;;
14746 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
14748 echo "Prototype: $try" ;;
14751 *) case "$usethreads" in
14752 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
14754 d_getprotoent_r=undef
14755 getprotoent_r_proto=0
14759 *) getprotoent_r_proto=0
14763 : see if prototypes for various getprotoxxx netdb.h functions are available
14765 set d_getprotoprotos getprotoent $i_netdb netdb.h
14768 : see if getprpwnam exists
14769 set getprpwnam d_getprpwnam
14772 : see if getpwent exists
14773 set getpwent d_getpwent
14776 : see if getpwent_r exists
14777 set getpwent_r d_getpwent_r
14779 case "$d_getpwent_r" in
14781 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14782 case "$d_getpwent_r_proto:$usethreads" in
14783 ":define") d_getpwent_r_proto=define
14784 set d_getpwent_r_proto getpwent_r $hdrs
14788 case "$d_getpwent_r_proto" in
14790 case "$getpwent_r_proto" in
14791 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
14792 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBWR ;;
14794 case "$getpwent_r_proto" in
14795 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
14796 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIR ;;
14798 case "$getpwent_r_proto" in
14799 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
14800 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBW ;;
14802 case "$getpwent_r_proto" in
14803 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
14804 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBI ;;
14806 case "$getpwent_r_proto" in
14807 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
14808 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBI ;;
14810 case "$getpwent_r_proto" in
14811 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
14812 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIH ;;
14814 case "$getpwent_r_proto" in
14815 ''|0) d_getpwent_r=undef
14817 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
14818 * ) case "$getpwent_r_proto" in
14819 REENTRANT_PROTO*) ;;
14820 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
14822 echo "Prototype: $try" ;;
14825 *) case "$usethreads" in
14826 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
14833 *) getpwent_r_proto=0
14837 : see if getpwnam_r exists
14838 set getpwnam_r d_getpwnam_r
14840 case "$d_getpwnam_r" in
14842 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14843 case "$d_getpwnam_r_proto:$usethreads" in
14844 ":define") d_getpwnam_r_proto=define
14845 set d_getpwnam_r_proto getpwnam_r $hdrs
14849 case "$d_getpwnam_r_proto" in
14851 case "$getpwnam_r_proto" in
14852 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
14853 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
14855 case "$getpwnam_r_proto" in
14856 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
14857 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
14859 case "$getpwnam_r_proto" in
14860 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
14861 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
14863 case "$getpwnam_r_proto" in
14864 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
14865 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
14867 case "$getpwnam_r_proto" in
14868 ''|0) d_getpwnam_r=undef
14870 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
14871 * ) case "$getpwnam_r_proto" in
14872 REENTRANT_PROTO*) ;;
14873 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
14875 echo "Prototype: $try" ;;
14878 *) case "$usethreads" in
14879 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
14886 *) getpwnam_r_proto=0
14890 : see if getpwuid_r exists
14891 set getpwuid_r d_getpwuid_r
14893 case "$d_getpwuid_r" in
14895 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14896 case "$d_getpwuid_r_proto:$usethreads" in
14897 ":define") d_getpwuid_r_proto=define
14898 set d_getpwuid_r_proto getpwuid_r $hdrs
14902 case "$d_getpwuid_r_proto" in
14904 case "$getpwuid_r_proto" in
14905 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
14906 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
14908 case "$getpwuid_r_proto" in
14909 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
14910 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
14912 case "$getpwuid_r_proto" in
14913 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
14914 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
14916 case "$getpwuid_r_proto" in
14917 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
14918 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
14920 case "$getpwuid_r_proto" in
14921 ''|0) d_getpwuid_r=undef
14923 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
14924 * ) case "$getpwuid_r_proto" in
14925 REENTRANT_PROTO*) ;;
14926 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
14928 echo "Prototype: $try" ;;
14931 *) case "$usethreads" in
14932 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
14939 *) getpwuid_r_proto=0
14943 : Optional checks for getsbyname and getsbyport
14945 : see if getservbyname exists
14946 set getservbyname d_getsbyname
14949 : see if getservbyport exists
14950 set getservbyport d_getsbyport
14953 : see if getservent exists
14954 set getservent d_getsent
14957 : see if getservbyname_r exists
14958 set getservbyname_r d_getservbyname_r
14960 case "$d_getservbyname_r" in
14962 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14963 case "$d_getservbyname_r_proto:$usethreads" in
14964 ":define") d_getservbyname_r_proto=define
14965 set d_getservbyname_r_proto getservbyname_r $hdrs
14969 case "$d_getservbyname_r_proto" in
14971 case "$getservbyname_r_proto" in
14972 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
14973 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
14975 case "$getservbyname_r_proto" in
14976 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
14977 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
14979 case "$getservbyname_r_proto" in
14980 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
14981 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
14983 case "$getservbyname_r_proto" in
14984 ''|0) d_getservbyname_r=undef
14985 getservbyname_r_proto=0
14986 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
14987 * ) case "$getservbyname_r_proto" in
14988 REENTRANT_PROTO*) ;;
14989 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
14991 echo "Prototype: $try" ;;
14994 *) case "$usethreads" in
14995 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
14997 d_getservbyname_r=undef
14998 getservbyname_r_proto=0
15002 *) getservbyname_r_proto=0
15006 : see if getservbyport_r exists
15007 set getservbyport_r d_getservbyport_r
15009 case "$d_getservbyport_r" in
15011 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15012 case "$d_getservbyport_r_proto:$usethreads" in
15013 ":define") d_getservbyport_r_proto=define
15014 set d_getservbyport_r_proto getservbyport_r $hdrs
15018 case "$d_getservbyport_r_proto" in
15020 case "$getservbyport_r_proto" in
15021 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
15022 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
15024 case "$getservbyport_r_proto" in
15025 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
15026 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
15028 case "$getservbyport_r_proto" in
15029 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
15030 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
15032 case "$getservbyport_r_proto" in
15033 ''|0) d_getservbyport_r=undef
15034 getservbyport_r_proto=0
15035 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
15036 * ) case "$getservbyport_r_proto" in
15037 REENTRANT_PROTO*) ;;
15038 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
15040 echo "Prototype: $try" ;;
15043 *) case "$usethreads" in
15044 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
15046 d_getservbyport_r=undef
15047 getservbyport_r_proto=0
15051 *) getservbyport_r_proto=0
15055 : see if getservent_r exists
15056 set getservent_r d_getservent_r
15058 case "$d_getservent_r" in
15060 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15061 case "$d_getservent_r_proto:$usethreads" in
15062 ":define") d_getservent_r_proto=define
15063 set d_getservent_r_proto getservent_r $hdrs
15067 case "$d_getservent_r_proto" in
15069 case "$getservent_r_proto" in
15070 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
15071 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBWR ;;
15073 case "$getservent_r_proto" in
15074 ''|0) try='int getservent_r(struct servent*, char*, int);'
15075 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBI ;;
15077 case "$getservent_r_proto" in
15078 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
15079 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=S_SBI ;;
15081 case "$getservent_r_proto" in
15082 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
15083 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SD ;;
15085 case "$getservent_r_proto" in
15086 ''|0) d_getservent_r=undef
15087 getservent_r_proto=0
15088 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
15089 * ) case "$getservent_r_proto" in
15090 REENTRANT_PROTO*) ;;
15091 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
15093 echo "Prototype: $try" ;;
15096 *) case "$usethreads" in
15097 define) echo "getservent_r has no prototype, not using it." >&4 ;;
15099 d_getservent_r=undef
15100 getservent_r_proto=0
15104 *) getservent_r_proto=0
15108 : see if prototypes for various getservxxx netdb.h functions are available
15110 set d_getservprotos getservent $i_netdb netdb.h
15113 : see if getspnam exists
15114 set getspnam d_getspnam
15117 : see if this is a shadow.h system
15118 set shadow.h i_shadow
15121 : see if getspnam_r exists
15122 set getspnam_r d_getspnam_r
15124 case "$d_getspnam_r" in
15126 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
15127 case "$d_getspnam_r_proto:$usethreads" in
15128 ":define") d_getspnam_r_proto=define
15129 set d_getspnam_r_proto getspnam_r $hdrs
15133 case "$d_getspnam_r_proto" in
15135 case "$getspnam_r_proto" in
15136 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
15137 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
15139 case "$getspnam_r_proto" in
15140 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
15141 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=S_CSBI ;;
15143 case "$getspnam_r_proto" in
15144 ''|0) d_getspnam_r=undef
15146 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
15147 * ) case "$getspnam_r_proto" in
15148 REENTRANT_PROTO*) ;;
15149 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
15151 echo "Prototype: $try" ;;
15154 *) case "$usethreads" in
15155 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
15162 *) getspnam_r_proto=0
15166 : see if gettimeofday or ftime exists
15167 set gettimeofday d_gettimeod
15169 case "$d_gettimeod" in
15175 val="$undef"; set d_ftime; eval $setvar
15178 case "$d_gettimeod$d_ftime" in
15181 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
15185 : see if gmtime_r exists
15186 set gmtime_r d_gmtime_r
15188 case "$d_gmtime_r" in
15190 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15191 case "$d_gmtime_r_proto:$usethreads" in
15192 ":define") d_gmtime_r_proto=define
15193 set d_gmtime_r_proto gmtime_r $hdrs
15197 case "$d_gmtime_r_proto" in
15199 case "$gmtime_r_proto" in
15200 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
15201 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=S_TS ;;
15203 case "$gmtime_r_proto" in
15204 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
15205 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=I_TS ;;
15207 case "$gmtime_r_proto" in
15208 ''|0) d_gmtime_r=undef
15210 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
15211 * ) case "$gmtime_r_proto" in
15212 REENTRANT_PROTO*) ;;
15213 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
15215 echo "Prototype: $try" ;;
15218 *) case "$usethreads" in
15219 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
15226 *) gmtime_r_proto=0
15230 : see if hasmntopt exists
15231 set hasmntopt d_hasmntopt
15234 : see if this is a netinet/in.h or sys/in.h system
15235 set netinet/in.h i_niin sys/in.h i_sysin
15238 : see if arpa/inet.h has to be included
15239 set arpa/inet.h i_arpainet
15242 : see if htonl --and friends-- exists
15247 : Maybe they are macros.
15250 $cat >htonl.c <<EOM
15252 #include <sys/types.h>
15253 #$i_niin I_NETINET_IN
15255 #$i_arpainet I_ARPA_INET
15256 #ifdef I_NETINET_IN
15257 #include <netinet/in.h>
15260 #include <sys/in.h>
15263 #include <arpa/inet.h>
15266 printf("Defined as a macro.");
15269 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
15270 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
15272 echo "But it seems to be defined as a macro." >&4
15280 : see if ilogbl exists
15281 set ilogbl d_ilogbl
15286 if set index val -f; eval $csym; $val; then
15287 if set strchr val -f d_strchr; eval $csym; $val; then
15288 if $contains strchr "$strings" >/dev/null 2>&1 ; then
15291 echo "strchr() found." >&4
15295 echo "index() found." >&4
15300 echo "index() found." >&4
15303 if set strchr val -f d_strchr; eval $csym; $val; then
15306 echo "strchr() found." >&4
15308 echo "No index() or strchr() found!" >&4
15313 set d_strchr; eval $setvar
15315 set d_index; eval $setvar
15317 : check whether inet_aton exists
15318 set inet_aton d_inetaton
15321 : see if inet_ntop exists
15322 set inet_ntop d_inetntop
15325 : see if inet_pton exists
15326 set inet_pton d_inetpton
15331 $cat >isascii.c <<EOCP
15334 #$i_stdlib I_STDLIB
15336 #include <stdlib.h>
15347 if eval $compile; then
15348 echo "isascii() found." >&4
15351 echo "isascii() NOT found." >&4
15360 $cat >isblank.c <<'EOCP'
15371 if $cc $ccflags $ldflags -o isblank isblank.c $libs >/dev/null 2>&1 ; then
15372 echo "isblank() found." >&4
15375 echo "isblank() NOT found." >&4
15382 : see if isfinite exists
15383 set isfinite d_isfinite
15386 : see if isinf exists
15390 : see if isnan exists
15394 : see if isnanl exists
15395 set isnanl d_isnanl
15398 : see if killpg exists
15399 set killpg d_killpg
15402 : see if lchown exists
15404 $cat > try.c <<'EOCP'
15405 /* System header to define __stub macros and hopefully few prototypes,
15406 which can conflict with char lchown(); below. */
15407 #include <assert.h>
15408 /* Override any gcc2 internal prototype to avoid an error. */
15409 /* We use char because int might match the return type of a gcc2
15410 builtin and then its argument prototype would still apply. */
15413 /* The GNU C library defines this for functions which it implements
15414 to always fail with ENOSYS. Some functions are actually named
15415 something starting with __ and the normal name is an alias. */
15416 #if defined (__stub_lchown) || defined (__stub___lchown)
15424 if eval $compile; then
15425 $echo "lchown() found." >&4
15428 $echo "lchown() NOT found." >&4
15434 : See if number of significant digits in a double precision number is known
15436 $cat >ldbl_dig.c <<EOM
15437 #$i_limits I_LIMITS
15440 #include <limits.h>
15446 printf("Contains LDBL_DIG");
15449 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
15450 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
15451 echo "LDBL_DIG found." >&4
15454 echo "LDBL_DIG NOT found." >&4
15461 : see if this is a math.h system
15465 : check to see if math.h defines _LIB_VERSION
15466 d_libm_lib_version="$undef"
15470 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
15472 #include <unistd.h>
15474 int main (int argc, char *argv[])
15476 printf ("%d\n", _LIB_VERSION);
15481 if eval $compile; then
15483 echo "Yes, it does ($foo)" >&4
15484 d_libm_lib_version="$define"
15486 echo "No, it does not (probably harmless)" >&4
15493 : see if link exists
15497 : see if localtime_r exists
15498 set localtime_r d_localtime_r
15500 case "$d_localtime_r" in
15502 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15503 case "$d_localtime_r_proto:$usethreads" in
15504 ":define") d_localtime_r_proto=define
15505 set d_localtime_r_proto localtime_r $hdrs
15509 case "$d_localtime_r_proto" in
15511 case "$localtime_r_proto" in
15512 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
15513 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=S_TS ;;
15515 case "$localtime_r_proto" in
15516 ''|0) try='int localtime_r(const time_t*, struct tm*);'
15517 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=I_TS ;;
15519 case "$localtime_r_proto" in
15520 ''|0) d_localtime_r=undef
15521 localtime_r_proto=0
15522 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
15523 * ) case "$localtime_r_proto" in
15524 REENTRANT_PROTO*) ;;
15525 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
15527 echo "Prototype: $try" ;;
15530 *) case "$usethreads" in
15531 define) echo "localtime_r has no prototype, not using it." >&4 ;;
15533 d_localtime_r=undef
15534 localtime_r_proto=0
15538 *) localtime_r_proto=0
15542 : see if localtime_r calls tzset
15543 case "$localtime_r_proto" in
15546 /* Does our libc's localtime_r call tzset ?
15547 * return 0 if so, 1 otherwise.
15549 #$i_systypes I_SYS_TYPES
15550 #$i_unistd I_UNISTD
15552 #$i_stdlib I_STDLIB
15553 #$i_string I_STRING
15554 #$i_malloc I_MALLOC
15556 # include <sys/types.h>
15559 # include <unistd.h>
15565 #include <stdlib.h>
15568 # include <string.h>
15570 # include <strings.h>
15573 # include <malloc.h>
15577 time_t t = time(0L);
15578 char w_tz[]="TZ" "=GMT+5",
15579 e_tz[]="TZ" "=GMT-5",
15580 *tz_e = (char*)malloc(16),
15581 *tz_w = (char*)malloc(16);
15582 struct tm tm_e, tm_w;
15583 memset(&tm_e,'\0',sizeof(struct tm));
15584 memset(&tm_w,'\0',sizeof(struct tm));
15589 localtime_r(&t, &tm_e);
15592 localtime_r(&t, &tm_w);
15594 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
15600 if eval $compile; then
15601 if $run ./try; then
15602 d_localtime_r_needs_tzset=undef;
15604 d_localtime_r_needs_tzset=define;
15607 d_localtime_r_needs_tzset=undef;
15611 d_localtime_r_needs_tzset=undef;
15616 : see if localeconv exists
15617 set localeconv d_locconv
15620 : see if lockf exists
15624 : see if prototype for lseek is available
15626 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
15629 : see if lstat exists
15633 : see if madvise exists
15634 set madvise d_madvise
15637 : see if malloc_size exists
15638 set malloc_size d_malloc_size
15641 : see if malloc_size_good exists
15642 set malloc_good_size d_malloc_good_size
15645 : see if mblen exists
15649 : see if mbstowcs exists
15650 set mbstowcs d_mbstowcs
15653 : see if mbtowc exists
15654 set mbtowc d_mbtowc
15657 : see if memchr exists
15658 set memchr d_memchr
15661 : see if memcmp exists
15662 set memcmp d_memcmp
15665 : see if memcpy exists
15666 set memcpy d_memcpy
15669 : see if memmove exists
15670 set memmove d_memmove
15673 : see if memset exists
15674 set memset d_memset
15677 : see if mkdir exists
15681 : see if mkdtemp exists
15682 set mkdtemp d_mkdtemp
15685 : see if mkfifo exists
15686 set mkfifo d_mkfifo
15689 : see if mkstemp exists
15690 set mkstemp d_mkstemp
15693 : see if mkstemps exists
15694 set mkstemps d_mkstemps
15697 : see if mktime exists
15698 set mktime d_mktime
15701 : see if this is a sys/mman.h system
15702 set sys/mman.h i_sysmman
15705 : see if mmap exists
15708 : see what shmat returns
15709 : default to something harmless
15711 case "$i_sysmman$d_mmap" in
15713 $cat >mmap.c <<'END'
15714 #include <sys/mman.h>
15717 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
15722 echo "and it returns ($mmaptype)." >&4
15728 : see if sqrtl exists
15732 : see if scalbnl exists
15733 set scalbnl d_scalbnl
15736 : see if modfl exists
15740 : see if prototype for modfl is available
15742 set d_modflproto modfl $i_math math.h
15745 d_modfl_pow32_bug="$undef"
15747 case "$d_longdbl$d_modfl" in
15750 Checking to see whether your modfl() is okay for large values...
15756 if $test "X$d_modflproto" != "X$define"; then
15757 $cat >>try.c <<EOCP
15758 /* Sigh. many current glibcs provide the function, but do not prototype it. */
15759 long double modfl (long double, long double *);
15762 $cat >>try.c <<EOCP
15764 long double nv = 4294967303.15;
15770 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
15774 case "$osname:$gccversion" in
15775 aix:) saveccflags="$ccflags"
15776 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
15779 if eval $compile; then
15782 *" 4294967303.150000 1.150000 4294967302.000000")
15783 echo >&4 "Your modfl() is broken for large values."
15784 d_modfl_pow32_bug="$define"
15786 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
15790 *" 4294967303.150000 0.150000 4294967303.000000")
15791 echo >&4 "Your modfl() seems okay for large values."
15793 *) echo >&4 "I don't understand your modfl() at all."
15799 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
15802 case "$osname:$gccversion" in
15803 aix:) ccflags="$saveccflags" ;; # restore
15808 if $test "$uselongdouble" = "$define"; then
15810 if $test "$d_sqrtl" != "$define"; then
15811 message="$message sqrtl"
15813 if $test "$d_modfl" != "$define"; then
15814 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
15815 echo "You have both aintl and copysignl, so I can emulate modfl."
15817 message="$message modfl"
15820 if $test "$d_frexpl" != "$define"; then
15821 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
15822 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
15824 message="$message frexpl"
15828 if $test "$message" != ""; then
15831 *** You requested the use of long doubles but you do not seem to have
15832 *** the following mathematical functions needed for long double support:
15834 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
15835 *** Cannot continue, aborting.
15843 : see if mprotect exists
15844 set mprotect d_mprotect
15847 : see if msgctl exists
15848 set msgctl d_msgctl
15851 : see if msgget exists
15852 set msgget d_msgget
15855 : see if msgsnd exists
15856 set msgsnd d_msgsnd
15859 : see if msgrcv exists
15860 set msgrcv d_msgrcv
15863 : see how much of the 'msg*(2)' library is present.
15866 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
15867 *"$undef"*) h_msg=false;;
15871 case "`ipcs 2>&1`" in
15872 "SVID messages"*"not configured"*)
15873 echo "Your $osname does not have the msg*(2) configured." >&4
15876 set msgctl d_msgctl
15878 set msgget d_msgget
15880 set msgsnd d_msgsnd
15882 set msgrcv d_msgrcv
15888 : we could also check for sys/ipc.h ...
15889 if $h_msg && $test `./findhdr sys/msg.h`; then
15890 echo "You have the full msg*(2) library." >&4
15893 echo "You don't have the full msg*(2) library." >&4
15899 : Check for msghdr_s
15901 echo "Checking to see if your system supports struct msghdr..." >&4
15902 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
15904 case "$d_msghdr_s" in
15905 "$define") echo "Yes, it does." ;;
15906 *) echo "No, it doesn't." ;;
15910 : see if msync exists
15914 : see if munmap exists
15915 set munmap d_munmap
15918 : see if nice exists
15922 : see if this is a langinfo.h system
15923 set langinfo.h i_langinfo
15926 : see if nl_langinfo exists
15927 set nl_langinfo d_nl_langinfo
15930 : check for volatile keyword
15932 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
15933 $cat >try.c <<'EOCP'
15936 typedef struct _goo_struct goo_struct;
15937 goo_struct * volatile goo = ((goo_struct *)0);
15938 struct _goo_struct {
15943 typedef unsigned short foo_t;
15944 char *volatile foo;
15946 volatile foo_t blech;
15950 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
15952 echo "Yup, it does."
15955 echo "Nope, it doesn't."
15961 : Check basic sizes
15963 $echo "Choosing the C types to be used for Perl's internal types..." >&4
15965 case "$use64bitint:$d_quad:$quadtype" in
15968 uvtype="$uquadtype"
15973 uvtype="unsigned long"
15979 case "$uselongdouble:$d_longdbl" in
15981 nvtype="long double"
15982 nvsize=$longdblsize
15989 $echo "(IV will be "$ivtype", $ivsize bytes)"
15990 $echo "(UV will be "$uvtype", $uvsize bytes)"
15991 $echo "(NV will be "$nvtype", $nvsize bytes)"
15994 #$i_inttypes I_INTTYPES
15996 #include <inttypes.h>
16001 int8_t i = INT8_MAX;
16002 uint8_t u = UINT8_MAX;
16003 printf("int8_t\n");
16006 int16_t i = INT16_MAX;
16007 uint16_t u = UINT16_MAX;
16008 printf("int16_t\n");
16011 int32_t i = INT32_MAX;
16012 uint32_t u = UINT32_MAX;
16013 printf("int32_t\n");
16018 i8type="signed char"
16019 u8type="unsigned char"
16024 '') case "$shortsize" in
16026 u16type="unsigned short"
16034 '') set try -DINT16
16035 if eval $compile; then
16036 case "`$run ./try`" in
16048 '') if $test $shortsize -ge 2; then
16050 u16type="unsigned short"
16058 '') case "$longsize" in
16060 u32type="unsigned long"
16064 *) case "$intsize" in
16066 u32type="unsigned int"
16076 '') set try -DINT32
16077 if eval $compile; then
16078 case "`$run ./try`" in
16090 '') if $test $intsize -ge 4; then
16092 u32type="unsigned int"
16100 '') case "$d_quad:$quadtype" in
16102 i64type="$quadtype"
16103 u64type="$uquadtype"
16111 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
16112 : volatile so that the compiler has to store it out to memory.
16113 if test X"$d_volatile" = X"$define"; then
16118 #$i_stdlib I_STDLIB
16120 #include <stdlib.h>
16122 #include <sys/types.h>
16123 #include <signal.h>
16125 $volatile int bletched = 0;
16126 $signal_t blech(int s) { bletched = 1; }
16131 int n = 8 * $uvsize;
16134 signal(SIGFPE, blech);
16137 for (i = 0; i < n; i++) {
16138 u = u << 1 | ($uvtype)1;
16140 if (($uvtype)d != u)
16144 d = ($nvtype)(u - 1);
16145 if (($uvtype)d != (u - 1))
16152 printf("%d\n", ((i == n) ? -n : i));
16158 d_nv_preserves_uv="$undef"
16159 if eval $compile; then
16160 nv_preserves_uv_bits="`$run ./try`"
16162 case "$nv_preserves_uv_bits" in
16164 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
16165 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
16166 d_nv_preserves_uv="$define"
16168 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
16169 d_nv_preserves_uv="$undef" ;;
16170 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
16171 nv_preserves_uv_bits="0" ;;
16175 $echo "Checking to find the largest integer value your NVs can hold..." >&4
16176 : volatile so that the compiler has to store it out to memory.
16177 if test X"$d_volatile" = X"$define"; then
16183 typedef $nvtype NV;
16190 while(count < 256) {
16191 $volatile NV up = value + 1.0;
16192 $volatile NV negated = -value;
16193 $volatile NV down = negated - 1.0;
16194 $volatile NV got_up = up - value;
16195 int up_good = got_up == 1.0;
16196 int got_down = down - negated;
16197 int down_good = got_down == -1.0;
16199 if (down_good != up_good) {
16201 "Inconsistency - up %d %f; down %d %f; for 2**%d (%.20f)\n",
16202 up_good, (double) got_up, down_good, (double) got_down,
16203 count, (double) value);
16210 fputs("256.0", stdout);
16213 fputs("2.0", stdout);
16219 fputs("*", stdout);
16225 fprintf(stderr, "Cannot overflow integer range, even at 2**%d (%.20f)\n",
16226 count, (double) value);
16232 nv_overflows_integers_at='0'
16233 if eval $compile; then
16239 The largest integer your NVs can preserve is equal to $xxx
16241 nv_overflows_integers_at="$xxx"
16244 Cannot determine the largest integer value your NVs can hold, unexpected output
16251 Cannot determine the largest integer value your NVs can hold
16258 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
16259 : volatile so that the compiler has to store it out to memory.
16260 if test X"$d_volatile" = X"$define"; then
16265 #$i_stdlib I_STDLIB
16267 #include <stdlib.h>
16269 #$i_string I_STRING
16271 # include <string.h>
16273 # include <strings.h>
16275 #include <sys/types.h>
16276 #include <signal.h>
16278 $volatile int bletched = 0;
16279 $signal_t blech(int s) { bletched = 1; }
16282 int checkit($nvtype d, char *where) {
16283 unsigned char *p = (char *)&d;
16284 unsigned char *end = p + sizeof(d);
16294 printf("No - %s: 0x", where);
16296 printf ("%02X", *p++);
16301 int main(int argc, char **argv) {
16304 fail += checkit(d, "0.0");
16306 /* The compiler shouldn't be assuming that bletched is 0 */
16309 fail += checkit(d, "bleched");
16312 signal(SIGFPE, blech);
16315 /* Paranoia - the compiler should have no way of knowing that ANSI says
16316 that argv[argc] will always be NULL. Actually, if it did assume this it
16317 would be buggy, as this is C and main() can be called from elsewhere in
16319 d = argv[argc] ? 1 : 0;
16322 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
16325 fail += checkit(d, "ternary");
16327 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
16330 printf("No - memset doesn't give 0.0\n");
16331 /* This might just blow up: */
16332 printf("(gives %g)\n", d);
16338 printf("No - something bleched\n");
16343 printf("No - %d fail(s)\n", fail);
16352 d_nv_zero_is_allbits_zero="$undef"
16353 if eval $compile; then
16359 0.0 is represented as all bits zero in memory
16361 d_nv_zero_is_allbits_zero="$define"
16364 0.0 is not represented as all bits zero in memory
16366 d_nv_zero_is_allbits_zero="$undef"
16371 0.0 is not represented as all bits zero in memory
16373 d_nv_zero_is_allbits_zero="$undef"
16379 : check for off64_t
16381 echo "Checking to see if you have off64_t..." >&4
16383 #include <sys/types.h>
16384 #include <unistd.h>
16385 int main() { off64_t x = 7; }
16388 if eval $compile; then
16390 echo "You have off64_t."
16393 echo "You do not have off64_t."
16394 case "$lseeksize" in
16395 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
16402 : how to create joinable pthreads
16403 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
16405 echo "Checking what constant to use for creating joinable pthreads..." >&4
16406 $cat >try.c <<'EOCP'
16407 #include <pthread.h>
16409 int detachstate = JOINABLE;
16412 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
16413 if eval $compile; then
16414 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
16415 val="$undef" # Yes, undef.
16416 set d_old_pthread_create_joinable
16419 set old_pthread_create_joinable
16422 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
16423 if eval $compile; then
16424 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
16426 set d_old_pthread_create_joinable
16428 val=PTHREAD_CREATE_UNDETACHED
16429 set old_pthread_create_joinable
16432 set try -DJOINABLE=__UNDETACHED
16433 if eval $compile; then
16434 echo "You seem to use __UNDETACHED." >&4
16436 set d_old_pthread_create_joinable
16439 set old_pthread_create_joinable
16442 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
16444 set d_old_pthread_create_joinable
16447 set old_pthread_create_joinable
16454 d_old_pthread_create_joinable="$undef"
16455 old_pthread_create_joinable=""
16458 : see if pause exists
16462 : see if poll exists
16466 : see if prctl exists
16470 : see if prctl supports PR_SET_NAME
16471 d_prctl_set_name=$undef
16475 #include <sys/prctl.h>
16477 int main (int argc, char *argv[])
16479 return (prctl (PR_SET_NAME, "Test"));
16483 if eval $compile_ok && $run ./try; then
16484 echo "Your prctl (PR_SET_NAME, ...) works"
16485 d_prctl_set_name=$define
16491 : see if readlink exists
16492 set readlink d_readlink
16495 : Check if exe is symlink to abs path of executing program
16499 case "$d_readlink" in
16501 : NetBSD first as /proc/self is a symlink to /proc/curproc, and it feels
16502 : more tidy to avoid an extra level of symlink
16503 set NetBSD /proc/curproc/exe Linux /proc/self/exe FreeBSD /proc/curproc/file Solaris /proc/self/path/a.out
16504 while test $# -gt 0; do
16507 if $issymlink $try; then
16508 $ls -l $try > reflect
16509 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
16510 echo "You have $type-like $try."
16511 procselfexe='"'$try'"'
16513 : This will break out of the loop
16524 : backward compatibility for d_hvfork
16525 if test X$d_hvfork != X; then
16526 d_vfork="$d_hvfork"
16529 : see if there is a vfork
16534 d_pseudofork=$undef
16536 : Ok, but do we want to use it. vfork is reportedly unreliable in
16537 : perl on Solaris 2.x, and probably elsewhere.
16541 case "$usevfork" in
16547 Perl can only use a vfork() that doesn't suffer from strict
16548 restrictions on calling functions or modifying global data in
16549 the child. For example, glibc-2.1 contains such a vfork()
16550 that is unsuitable. If your system provides a proper fork()
16551 call, chances are that you do NOT want perl to use vfork().
16554 rp="Do you still want to use vfork()?"
16559 echo "Ok, we won't use vfork()."
16568 $define) usevfork='true';;
16569 *) usevfork='false';;
16572 : see whether the pthread_atfork exists
16574 #include <pthread.h>
16577 #ifdef PTHREAD_ATFORK
16578 pthread_atfork(NULL,NULL,NULL);
16583 : see if pthread_atfork exists
16584 set try -DPTHREAD_ATFORK
16585 if eval $compile; then
16590 case "$usethreads" in
16593 $define) echo 'pthread_atfork found.' >&4 ;;
16594 *) echo 'pthread_atfork NOT found.' >&4 ;;
16597 set d_pthread_atfork
16600 : see if pthread_attr_setscope exists
16601 set pthread_attr_setscope d_pthread_attr_setscope
16604 : see whether the various POSIXish _yields exist
16606 #include <pthread.h>
16612 #ifdef PTHREAD_YIELD
16615 #ifdef PTHREAD_YIELD_NULL
16616 pthread_yield(NULL);
16622 : see if sched_yield exists
16623 set try -DSCHED_YIELD
16624 if eval $compile; then
16626 sched_yield='sched_yield()'
16630 case "$usethreads" in
16633 $define) echo 'sched_yield() found.' >&4 ;;
16634 *) echo 'sched_yield() NOT found.' >&4 ;;
16640 : see if pthread_yield exists
16641 set try -DPTHREAD_YIELD
16642 if eval $compile; then
16644 case "$sched_yield" in
16645 '') sched_yield='pthread_yield()' ;;
16648 set try -DPTHREAD_YIELD_NULL
16649 if eval $compile; then
16651 case "$sched_yield" in
16652 '') sched_yield='pthread_yield(NULL)' ;;
16658 case "$usethreads" in
16661 $define) echo 'pthread_yield() found.' >&4 ;;
16662 *) echo 'pthread_yield() NOT found.' >&4 ;;
16666 set d_pthread_yield
16668 case "$sched_yield" in
16669 '') sched_yield=undef ;;
16673 : see if random_r exists
16674 set random_r d_random_r
16676 case "$d_random_r" in
16678 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16679 case "$d_random_r_proto:$usethreads" in
16680 ":define") d_random_r_proto=define
16681 set d_random_r_proto random_r $hdrs
16685 case "$d_random_r_proto" in
16687 case "$random_r_proto" in
16688 ''|0) try='int random_r(int*, struct random_data*);'
16689 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_iS ;;
16691 case "$random_r_proto" in
16692 ''|0) try='int random_r(long*, struct random_data*);'
16693 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_lS ;;
16695 case "$random_r_proto" in
16696 ''|0) try='int random_r(struct random_data*, int32_t*);'
16697 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_St ;;
16699 case "$random_r_proto" in
16700 ''|0) d_random_r=undef
16702 echo "Disabling random_r, cannot determine prototype." >&4 ;;
16703 * ) case "$random_r_proto" in
16704 REENTRANT_PROTO*) ;;
16705 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
16707 echo "Prototype: $try" ;;
16710 *) case "$usethreads" in
16711 define) echo "random_r has no prototype, not using it." >&4 ;;
16718 *) random_r_proto=0
16722 : see if readdir and friends exist
16723 set readdir d_readdir
16725 set seekdir d_seekdir
16727 set telldir d_telldir
16729 set rewinddir d_rewinddir
16732 : see if readdir64_r exists
16733 set readdir64_r d_readdir64_r
16735 case "$d_readdir64_r" in
16737 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16738 case "$d_readdir64_r_proto:$usethreads" in
16739 ":define") d_readdir64_r_proto=define
16740 set d_readdir64_r_proto readdir64_r $hdrs
16744 case "$d_readdir64_r_proto" in
16746 case "$readdir64_r_proto" in
16747 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
16748 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TSR ;;
16750 case "$readdir64_r_proto" in
16751 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
16752 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TS ;;
16754 case "$readdir64_r_proto" in
16755 ''|0) d_readdir64_r=undef
16756 readdir64_r_proto=0
16757 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
16758 * ) case "$readdir64_r_proto" in
16759 REENTRANT_PROTO*) ;;
16760 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
16762 echo "Prototype: $try" ;;
16765 *) case "$usethreads" in
16766 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
16768 d_readdir64_r=undef
16769 readdir64_r_proto=0
16773 *) readdir64_r_proto=0
16777 : see if readdir_r exists
16778 set readdir_r d_readdir_r
16780 case "$d_readdir_r" in
16782 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16783 case "$d_readdir_r_proto:$usethreads" in
16784 ":define") d_readdir_r_proto=define
16785 set d_readdir_r_proto readdir_r $hdrs
16789 case "$d_readdir_r_proto" in
16791 case "$readdir_r_proto" in
16792 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
16793 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TSR ;;
16795 case "$readdir_r_proto" in
16796 ''|0) try='int readdir_r(DIR*, struct dirent*);'
16797 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TS ;;
16799 case "$readdir_r_proto" in
16800 ''|0) d_readdir_r=undef
16802 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
16803 * ) case "$readdir_r_proto" in
16804 REENTRANT_PROTO*) ;;
16805 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
16807 echo "Prototype: $try" ;;
16810 *) case "$usethreads" in
16811 define) echo "readdir_r has no prototype, not using it." >&4 ;;
16818 *) readdir_r_proto=0
16822 : see if readv exists
16826 : see if recvmsg exists
16827 set recvmsg d_recvmsg
16830 : see if rename exists
16831 set rename d_rename
16834 : see if rmdir exists
16838 : see if memory.h is available.
16843 : See if it conflicts with string.h
16849 $cppstdin $cppflags $cppminus < $strings > mem.h
16850 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
16852 echo "We won't be including <memory.h>."
16862 : can bcopy handle overlapping blocks?
16865 case "$d_memmove" in
16866 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
16867 *) case "$d_bcopy" in
16869 echo "Checking to see if bcopy() can do overlapping copies..." >&4
16871 #$i_memory I_MEMORY
16872 #$i_stdlib I_STDLIB
16873 #$i_string I_STRING
16874 #$i_unistd I_UNISTD
16876 $cat >>try.c <<'EOCP'
16879 # include <memory.h>
16882 # include <stdlib.h>
16885 # include <string.h>
16887 # include <strings.h>
16890 # include <unistd.h> /* Needed for NetBSD */
16894 char buf[128], abc[128];
16900 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16901 try to store the string in read-only memory. */
16902 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
16904 for (align = 7; align >= 0; align--) {
16905 for (len = 36; len; len--) {
16907 bcopy(abc, b, len);
16908 for (off = 1; off <= len; off++) {
16909 bcopy(b, b+off, len);
16910 bcopy(b+off, b, len);
16911 if (bcmp(b, abc, len))
16920 if eval $compile_ok; then
16921 if $run ./try 2>/dev/null; then
16922 echo "Yes, it can."
16925 echo "It can't, sorry."
16928 echo "(I can't compile the test program, so we'll assume not...)"
16938 : can memcpy handle overlapping blocks?
16941 case "$d_memmove" in
16942 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
16943 *) case "$d_memcpy" in
16945 echo "Checking to see if memcpy() can do overlapping copies..." >&4
16947 #$i_memory I_MEMORY
16948 #$i_stdlib I_STDLIB
16949 #$i_string I_STRING
16950 #$i_unistd I_UNISTD
16952 $cat >>try.c <<'EOCP'
16955 # include <memory.h>
16958 # include <stdlib.h>
16961 # include <string.h>
16963 # include <strings.h>
16966 # include <unistd.h> /* Needed for NetBSD */
16970 char buf[128], abc[128];
16976 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16977 try to store the string in read-only memory. */
16978 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
16980 for (align = 7; align >= 0; align--) {
16981 for (len = 36; len; len--) {
16983 memcpy(b, abc, len);
16984 for (off = 1; off <= len; off++) {
16985 memcpy(b+off, b, len);
16986 memcpy(b, b+off, len);
16987 if (memcmp(b, abc, len))
16996 if eval $compile_ok; then
16997 if $run ./try 2>/dev/null; then
16998 echo "Yes, it can."
17001 echo "It can't, sorry."
17004 echo "(I can't compile the test program, so we'll assume not...)"
17014 : can memcmp be trusted to compare relative magnitude?
17016 case "$d_memcmp" in
17019 echo "Checking if your memcmp() can compare relative magnitude..." >&4
17021 #$i_memory I_MEMORY
17022 #$i_stdlib I_STDLIB
17023 #$i_string I_STRING
17024 #$i_unistd I_UNISTD
17026 $cat >>try.c <<'EOCP'
17029 # include <memory.h>
17032 # include <stdlib.h>
17035 # include <string.h>
17037 # include <strings.h>
17040 # include <unistd.h> /* Needed for NetBSD */
17046 if ((a < b) && memcmp(&a, &b, 1) < 0)
17052 if eval $compile_ok; then
17053 if $run ./try 2>/dev/null; then
17054 echo "Yes, it can."
17057 echo "No, it can't (it uses signed chars)."
17060 echo "(I can't compile the test program, so we'll assume not...)"
17068 : see if prototype for sbrk is available
17070 set d_sbrkproto sbrk $i_unistd unistd.h
17073 : see if select exists
17074 set select d_select
17077 : see if semctl exists
17078 set semctl d_semctl
17081 : see if semget exists
17082 set semget d_semget
17085 : see if semop exists
17089 : see how much of the 'sem*(2)' library is present.
17092 case "$d_semctl$d_semget$d_semop" in
17093 *"$undef"*) h_sem=false;;
17097 case "`ipcs 2>&1`" in
17098 "SVID messages"*"not configured"*)
17099 echo "Your $osname does not have the sem*(2) configured." >&4
17102 set semctl d_semctl
17104 set semget d_semget
17112 : we could also check for sys/ipc.h ...
17113 if $h_sem && $test `./findhdr sys/sem.h`; then
17114 echo "You have the full sem*(2) library." >&4
17117 echo "You don't have the full sem*(2) library." >&4
17123 : see whether sys/sem.h defines union semun
17125 $cat > try.c <<'END'
17126 #include <sys/types.h>
17127 #include <sys/ipc.h>
17128 #include <sys/sem.h>
17129 int main () { union semun semun; semun.buf = 0; }
17132 if eval $compile; then
17133 echo "You have union semun in <sys/sem.h>." >&4
17136 echo "You do not have union semun in <sys/sem.h>." >&4
17143 : see how to do semctl IPC_STAT
17147 $cat > tryh.h <<END
17150 # define S_IRUSR S_IREAD
17151 # define S_IWUSR S_IWRITE
17152 # define S_IXUSR S_IEXEC
17154 # define S_IRUSR 0400
17155 # define S_IWUSR 0200
17156 # define S_IXUSR 0100
17158 # define S_IRGRP (S_IRUSR>>3)
17159 # define S_IWGRP (S_IWUSR>>3)
17160 # define S_IXGRP (S_IXUSR>>3)
17161 # define S_IROTH (S_IRUSR>>6)
17162 # define S_IWOTH (S_IWUSR>>6)
17163 # define S_IXOTH (S_IXUSR>>6)
17166 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
17167 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
17168 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
17171 : see whether semctl IPC_STAT can use union semun
17172 case "$d_semctl_semun" in
17176 #include <sys/types.h>
17177 #include <sys/ipc.h>
17178 #include <sys/sem.h>
17179 #include <sys/stat.h>
17186 #$d_union_semun HAS_UNION_SEMUN
17189 #ifndef HAS_UNION_SEMUN
17192 struct semid_ds *buf;
17193 unsigned short *array;
17199 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
17200 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
17202 struct semid_ds argbuf;
17205 st = semctl(sem, 0, IPC_STAT, arg);
17209 # endif /* IPC_STAT */
17210 printf("semctl IPC_STAT failed: errno = %d\n", errno);
17212 if (semctl(sem, 0, IPC_RMID, arg) != 0)
17213 # endif /* IPC_RMID */
17214 printf("semctl IPC_RMID failed: errno = %d\n", errno);
17216 #endif /* IPC_PRIVATE && ... */
17217 printf("semget failed: errno = %d\n", errno);
17222 if eval $compile; then
17225 semun) val="$define" ;;
17233 case "$d_semctl_semun" in
17235 echo "You can use union semun for semctl IPC_STAT." >&4
17238 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
17243 : see whether semctl IPC_STAT can use struct semid_ds pointer
17244 case "$d_semctl_semid_ds" in
17247 $cat > try.c <<'END'
17248 #include <sys/types.h>
17249 #include <sys/ipc.h>
17250 #include <sys/sem.h>
17251 #include <sys/stat.h>
17259 struct semid_ds arg;
17262 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
17263 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
17266 st = semctl(sem, 0, IPC_STAT, &arg);
17268 printf("semid_ds\n");
17270 # endif /* IPC_STAT */
17271 printf("semctl IPC_STAT failed: errno = %d\n", errno);
17273 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
17274 # endif /* IPC_RMID */
17275 printf("semctl IPC_RMID failed: errno = %d\n", errno);
17277 #endif /* IPC_PRIVATE && ... */
17278 printf("semget failed: errno = %d\n", errno);
17284 if eval $compile; then
17287 semid_ds) val="$define" ;;
17291 set d_semctl_semid_ds
17295 case "$d_semctl_semid_ds" in
17297 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
17299 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
17305 # We do not have the full sem*(2) library, so assume we can not
17311 set d_semctl_semid_ds
17317 : see if sendmsg exists
17318 set sendmsg d_sendmsg
17321 : see if setegid exists
17322 set setegid d_setegid
17325 : see if seteuid exists
17326 set seteuid d_seteuid
17329 : see if setgrent exists
17330 set setgrent d_setgrent
17333 : see if setgrent_r exists
17334 set setgrent_r d_setgrent_r
17336 case "$d_setgrent_r" in
17338 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
17339 case "$d_setgrent_r_proto:$usethreads" in
17340 ":define") d_setgrent_r_proto=define
17341 set d_setgrent_r_proto setgrent_r $hdrs
17345 case "$d_setgrent_r_proto" in
17347 case "$setgrent_r_proto" in
17348 ''|0) try='int setgrent_r(FILE**);'
17349 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=I_H ;;
17351 case "$setgrent_r_proto" in
17352 ''|0) try='void setgrent_r(FILE**);'
17353 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=V_H ;;
17355 case "$setgrent_r_proto" in
17356 ''|0) d_setgrent_r=undef
17358 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
17359 * ) case "$setgrent_r_proto" in
17360 REENTRANT_PROTO*) ;;
17361 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
17363 echo "Prototype: $try" ;;
17366 *) case "$usethreads" in
17367 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
17374 *) setgrent_r_proto=0
17378 : see if sethostent exists
17379 set sethostent d_sethent
17382 : see if sethostent_r exists
17383 set sethostent_r d_sethostent_r
17385 case "$d_sethostent_r" in
17387 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17388 case "$d_sethostent_r_proto:$usethreads" in
17389 ":define") d_sethostent_r_proto=define
17390 set d_sethostent_r_proto sethostent_r $hdrs
17394 case "$d_sethostent_r_proto" in
17396 case "$sethostent_r_proto" in
17397 ''|0) try='int sethostent_r(int, struct hostent_data*);'
17398 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=I_ID ;;
17400 case "$sethostent_r_proto" in
17401 ''|0) try='void sethostent_r(int, struct hostent_data*);'
17402 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=V_ID ;;
17404 case "$sethostent_r_proto" in
17405 ''|0) d_sethostent_r=undef
17406 sethostent_r_proto=0
17407 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
17408 * ) case "$sethostent_r_proto" in
17409 REENTRANT_PROTO*) ;;
17410 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
17412 echo "Prototype: $try" ;;
17415 *) case "$usethreads" in
17416 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
17418 d_sethostent_r=undef
17419 sethostent_r_proto=0
17423 *) sethostent_r_proto=0
17427 : see if setitimer exists
17428 set setitimer d_setitimer
17431 : see if setlinebuf exists
17432 set setlinebuf d_setlinebuf
17435 : see if setlocale exists
17436 set setlocale d_setlocale
17439 : see if locale.h is available
17440 set locale.h i_locale
17443 : see if setlocale_r exists
17444 set setlocale_r d_setlocale_r
17446 case "$d_setlocale_r" in
17448 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
17449 case "$d_setlocale_r_proto:$usethreads" in
17450 ":define") d_setlocale_r_proto=define
17451 set d_setlocale_r_proto setlocale_r $hdrs
17455 case "$d_setlocale_r_proto" in
17457 case "$setlocale_r_proto" in
17458 ''|0) try='int setlocale_r(int, const char*, char*, int);'
17459 ./protochk "$extern_C $try" $hdrs && setlocale_r_proto=I_ICBI ;;
17461 case "$setlocale_r_proto" in
17462 ''|0) d_setlocale_r=undef
17463 setlocale_r_proto=0
17464 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
17465 * ) case "$setlocale_r_proto" in
17466 REENTRANT_PROTO*) ;;
17467 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
17469 echo "Prototype: $try" ;;
17472 *) case "$usethreads" in
17473 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
17475 d_setlocale_r=undef
17476 setlocale_r_proto=0
17480 *) setlocale_r_proto=0
17484 : see if setnetent exists
17485 set setnetent d_setnent
17488 : see if setnetent_r exists
17489 set setnetent_r d_setnetent_r
17491 case "$d_setnetent_r" in
17493 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17494 case "$d_setnetent_r_proto:$usethreads" in
17495 ":define") d_setnetent_r_proto=define
17496 set d_setnetent_r_proto setnetent_r $hdrs
17500 case "$d_setnetent_r_proto" in
17502 case "$setnetent_r_proto" in
17503 ''|0) try='int setnetent_r(int, struct netent_data*);'
17504 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=I_ID ;;
17506 case "$setnetent_r_proto" in
17507 ''|0) try='void setnetent_r(int, struct netent_data*);'
17508 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=V_ID ;;
17510 case "$setnetent_r_proto" in
17511 ''|0) d_setnetent_r=undef
17512 setnetent_r_proto=0
17513 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
17514 * ) case "$setnetent_r_proto" in
17515 REENTRANT_PROTO*) ;;
17516 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
17518 echo "Prototype: $try" ;;
17521 *) case "$usethreads" in
17522 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
17524 d_setnetent_r=undef
17525 setnetent_r_proto=0
17529 *) setnetent_r_proto=0
17533 : see if setprotoent exists
17534 set setprotoent d_setpent
17537 : see if setpgid exists
17538 set setpgid d_setpgid
17541 : see if setpgrp2 exists
17542 set setpgrp2 d_setpgrp2
17545 : see if setpriority exists
17546 set setpriority d_setprior
17549 : see if setproctitle exists
17550 set setproctitle d_setproctitle
17553 : see if setprotoent_r exists
17554 set setprotoent_r d_setprotoent_r
17556 case "$d_setprotoent_r" in
17558 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17559 case "$d_setprotoent_r_proto:$usethreads" in
17560 ":define") d_setprotoent_r_proto=define
17561 set d_setprotoent_r_proto setprotoent_r $hdrs
17565 case "$d_setprotoent_r_proto" in
17567 case "$setprotoent_r_proto" in
17568 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
17569 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=I_ID ;;
17571 case "$setprotoent_r_proto" in
17572 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
17573 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=V_ID ;;
17575 case "$setprotoent_r_proto" in
17576 ''|0) d_setprotoent_r=undef
17577 setprotoent_r_proto=0
17578 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
17579 * ) case "$setprotoent_r_proto" in
17580 REENTRANT_PROTO*) ;;
17581 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
17583 echo "Prototype: $try" ;;
17586 *) case "$usethreads" in
17587 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
17589 d_setprotoent_r=undef
17590 setprotoent_r_proto=0
17594 *) setprotoent_r_proto=0
17598 : see if setpwent exists
17599 set setpwent d_setpwent
17602 : see if setpwent_r exists
17603 set setpwent_r d_setpwent_r
17605 case "$d_setpwent_r" in
17607 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
17608 case "$d_setpwent_r_proto:$usethreads" in
17609 ":define") d_setpwent_r_proto=define
17610 set d_setpwent_r_proto setpwent_r $hdrs
17614 case "$d_setpwent_r_proto" in
17616 case "$setpwent_r_proto" in
17617 ''|0) try='int setpwent_r(FILE**);'
17618 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=I_H ;;
17620 case "$setpwent_r_proto" in
17621 ''|0) try='void setpwent_r(FILE**);'
17622 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=V_H ;;
17624 case "$setpwent_r_proto" in
17625 ''|0) d_setpwent_r=undef
17627 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
17628 * ) case "$setpwent_r_proto" in
17629 REENTRANT_PROTO*) ;;
17630 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
17632 echo "Prototype: $try" ;;
17635 *) case "$usethreads" in
17636 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
17643 *) setpwent_r_proto=0
17647 : see if setregid exists
17648 set setregid d_setregid
17650 set setresgid d_setresgid
17653 : see if setreuid exists
17654 set setreuid d_setreuid
17656 set setresuid d_setresuid
17659 : see if setrgid exists
17660 set setrgid d_setrgid
17663 : see if setruid exists
17664 set setruid d_setruid
17667 : see if setservent exists
17668 set setservent d_setsent
17671 : see if setservent_r exists
17672 set setservent_r d_setservent_r
17674 case "$d_setservent_r" in
17676 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17677 case "$d_setservent_r_proto:$usethreads" in
17678 ":define") d_setservent_r_proto=define
17679 set d_setservent_r_proto setservent_r $hdrs
17683 case "$d_setservent_r_proto" in
17685 case "$setservent_r_proto" in
17686 ''|0) try='int setservent_r(int, struct servent_data*);'
17687 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=I_ID ;;
17689 case "$setservent_r_proto" in
17690 ''|0) try='void setservent_r(int, struct servent_data*);'
17691 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=V_ID ;;
17693 case "$setservent_r_proto" in
17694 ''|0) d_setservent_r=undef
17695 setservent_r_proto=0
17696 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
17697 * ) case "$setservent_r_proto" in
17698 REENTRANT_PROTO*) ;;
17699 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
17701 echo "Prototype: $try" ;;
17704 *) case "$usethreads" in
17705 define) echo "setservent_r has no prototype, not using it." >&4 ;;
17707 d_setservent_r=undef
17708 setservent_r_proto=0
17712 *) setservent_r_proto=0
17716 : see if setsid exists
17717 set setsid d_setsid
17720 : see if setvbuf exists
17721 set setvbuf d_setvbuf
17724 : see if shmctl exists
17725 set shmctl d_shmctl
17728 : see if shmget exists
17729 set shmget d_shmget
17732 : see if shmat exists
17735 : see what shmat returns
17738 $cat >shmat.c <<'END'
17739 #include <sys/shm.h>
17742 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
17747 echo "and it returns ($shmattype)." >&4
17748 : see if a prototype for shmat is available
17749 xxx=`./findhdr sys/shm.h`
17750 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
17751 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
17762 set d_shmatprototype
17765 : see if shmdt exists
17769 : see how much of the 'shm*(2)' library is present.
17772 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
17773 *"$undef"*) h_shm=false;;
17777 case "`ipcs 2>&1`" in
17778 "SVID shared memory"*"not configured"*)
17779 echo "Your $osname does not have the shm*(2) configured." >&4
17782 set shmctl d_shmctl
17784 set shmget d_shmget
17794 : we could also check for sys/ipc.h ...
17795 if $h_shm && $test `./findhdr sys/shm.h`; then
17796 echo "You have the full shm*(2) library." >&4
17799 echo "You don't have the full shm*(2) library." >&4
17805 : see if we have sigaction
17807 if set sigaction val -f d_sigaction; eval $csym; $val; then
17808 echo 'sigaction() found.' >&4
17811 #include <sys/types.h>
17812 #include <signal.h>
17813 #$i_stdlib I_STDLIB
17815 #include <stdlib.h>
17819 struct sigaction act, oact;
17821 oact.sa_handler = 0;
17822 /* so that act and oact are used */
17823 exit(act.sa_flags == 0 && oact.sa_handler == 0);
17827 if eval $compile_ok; then
17830 echo "But you don't seem to have a usable struct sigaction." >&4
17834 echo 'sigaction NOT found.' >&4
17837 set d_sigaction; eval $setvar
17840 : see if this is a sunmath.h system
17841 set sunmath.h i_sunmath
17844 : see if signbit exists
17845 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
17848 #$i_sunmath I_SUNMATH
17852 #ifdef I_SUNMATH /* Solaris special math library */
17853 # include <sunmath.h>
17856 int main(int argc, char **argv)
17860 if ((signbit(x) == 0) && (signbit(y) != 0))
17868 if eval $compile; then
17869 if $run ./try; then
17873 $echo "Signbit seems to be available, but doesn't work as I expected."
17874 $echo "I won't use it." >&4
17885 : see if sigprocmask exists
17886 set sigprocmask d_sigprocmask
17889 : see if sigsetjmp exists
17891 case "$d_sigsetjmp" in
17894 #include <setjmp.h>
17895 #$i_stdlib I_STDLIB
17897 #include <stdlib.h>
17903 if (sigsetjmp(env,1))
17906 siglongjmp(env, 1);
17911 if eval $compile; then
17912 if $run ./try >/dev/null 2>&1; then
17913 echo "POSIX sigsetjmp found." >&4
17917 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
17923 echo "sigsetjmp not found." >&4
17927 *) val="$d_sigsetjmp"
17928 case "$d_sigsetjmp" in
17929 $define) echo "POSIX sigsetjmp found." >&4;;
17930 $undef) echo "sigsetjmp not found." >&4;;
17938 : see if snprintf exists
17939 set snprintf d_snprintf
17942 : see if vsnprintf exists
17943 set vsnprintf d_vsnprintf
17946 case "$d_snprintf-$d_vsnprintf" in
17949 Checking whether your snprintf() and vsnprintf() work okay...
17951 $cat >try.c <<'EOCP'
17952 /* v?snprintf testing logic courtesy of Russ Allbery.
17953 * According to C99:
17954 * - if the buffer is too short it still must be \0-terminated
17955 * - if the buffer is too short the potentially required length
17956 * must be returned and not -1
17957 * - if the buffer is NULL the potentially required length
17958 * must be returned and not -1 or core dump
17961 #include <stdarg.h>
17965 int test (char *format, ...)
17970 va_start (args, format);
17971 count = vsnprintf (buf, sizeof buf, format, args);
17978 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
17979 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
17983 if eval $compile; then
17986 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
17988 Your snprintf() and snprintf() don't seem to be working okay.
17990 d_snprintf="$undef"
17991 d_vsnprintf="$undef"
17995 echo "(I can't seem to compile the test program--assuming they don't)"
17996 d_snprintf="$undef"
17997 d_vsnprintf="$undef"
18003 : see if sockatmark exists
18004 set sockatmark d_sockatmark
18007 : see if prototype for sockatmark is available
18009 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
18012 : see if socks5_init exists
18013 set socks5_init d_socks5_init
18016 : see if sprintf returns the length of the string in the buffer as per ANSI
18017 $echo "Checking whether sprintf returns the length of the string..." >&4
18020 #$i_stdlib I_STDLIB
18022 #include <stdlib.h>
18024 #$i_string I_STRING
18026 # include <string.h>
18028 # include <strings.h>
18037 int check (size_t expect, int test) {
18038 size_t got = strlen(buffer);
18042 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
18047 int main(int argc, char **argv) {
18050 check(sprintf(buffer, ""), ++test);
18051 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
18052 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
18059 if eval $compile; then
18063 sprintf returns the length of the string (as ANSI says it should)
18065 d_sprintf_returns_strlen="$define"
18068 sprintf does not return the length of the string (how old is this system?)
18070 d_sprintf_returns_strlen="$undef"
18074 echo "(I can't seem to compile the test program--assuming it doesn't)" >&4
18075 d_sprintf_returns_strlen="$undef"
18079 : see if srand48_r exists
18080 set srand48_r d_srand48_r
18082 case "$d_srand48_r" in
18084 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
18085 case "$d_srand48_r_proto:$usethreads" in
18086 ":define") d_srand48_r_proto=define
18087 set d_srand48_r_proto srand48_r $hdrs
18091 case "$d_srand48_r_proto" in
18093 case "$srand48_r_proto" in
18094 ''|0) try='int srand48_r(long, struct drand48_data*);'
18095 ./protochk "$extern_C $try" $hdrs && srand48_r_proto=I_LS ;;
18097 case "$srand48_r_proto" in
18098 ''|0) d_srand48_r=undef
18100 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
18101 * ) case "$srand48_r_proto" in
18102 REENTRANT_PROTO*) ;;
18103 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
18105 echo "Prototype: $try" ;;
18108 *) case "$usethreads" in
18109 define) echo "srand48_r has no prototype, not using it." >&4 ;;
18116 *) srand48_r_proto=0
18120 : see if srandom_r exists
18121 set srandom_r d_srandom_r
18123 case "$d_srandom_r" in
18125 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
18126 case "$d_srandom_r_proto:$usethreads" in
18127 ":define") d_srandom_r_proto=define
18128 set d_srandom_r_proto srandom_r $hdrs
18132 case "$d_srandom_r_proto" in
18134 case "$srandom_r_proto" in
18135 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
18136 ./protochk "$extern_C $try" $hdrs && srandom_r_proto=I_TS ;;
18138 case "$srandom_r_proto" in
18139 ''|0) d_srandom_r=undef
18141 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
18142 * ) case "$srandom_r_proto" in
18143 REENTRANT_PROTO*) ;;
18144 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
18146 echo "Prototype: $try" ;;
18149 *) case "$usethreads" in
18150 define) echo "srandom_r has no prototype, not using it." >&4 ;;
18157 *) srandom_r_proto=0
18161 : see if prototype for setresgid is available
18163 set d_sresgproto setresgid $i_unistd unistd.h
18166 : see if prototype for setresuid is available
18168 set d_sresuproto setresuid $i_unistd unistd.h
18171 : see if sys/stat.h is available
18172 set sys/stat.h i_sysstat
18175 : see if stat knows about block sizes
18177 echo "Checking to see if your struct stat has st_blocks field..." >&4
18178 set d_statblks stat st_blocks $i_sysstat sys/stat.h
18181 : see if this is a sys/vfs.h system
18182 set sys/vfs.h i_sysvfs
18185 : see if this is a sys/statfs.h system
18186 set sys/statfs.h i_sysstatfs
18189 : Check for statfs_s
18191 echo "Checking to see if your system supports struct statfs..." >&4
18192 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
18194 case "$d_statfs_s" in
18195 "$define") echo "Yes, it does." ;;
18196 *) echo "No, it doesn't." ;;
18200 : see if struct statfs knows about f_flags
18201 case "$d_statfs_s" in
18204 echo "Checking to see if your struct statfs has f_flags field..." >&4
18205 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
18209 set d_statfs_f_flags
18213 case "$d_statfs_f_flags" in
18214 "$define") echo "Yes, it does." ;;
18215 *) echo "No, it doesn't." ;;
18218 : see what flavor, if any, of static inline is supported
18220 echo "Checking to see if your system supports static inline..."
18221 $cat > try.c <<'EOCP'
18222 #include <stdlib.h>
18223 extern int f_via_a(int x);
18224 extern int f_via_b(int x);
18225 int main(int argc, char **argv)
18234 return EXIT_SUCCESS;
18237 return EXIT_FAILURE;
18241 $cat > a.c <<'EOCP'
18242 static INLINE int f(int x) {
18253 $cat > b.c <<'EOCP'
18254 extern int f(int x);
18262 # Respect a hint (or previous) value for perl_static_inline, if there is one.
18263 case "$perl_static_inline" in
18264 '') # Check the various possibilities, and break out on success.
18265 # For gcc, prefer __inline__, which will still permit
18266 # cflags.SH to add in -ansi.
18267 case "$gccversion" in
18268 '') xxx="inline __inline__ __inline _inline";;
18269 *) xxx="__inline__ inline __inline _inline";;
18271 for inline in $xxx; do
18272 set try -DINLINE=$inline a.c
18273 if eval $compile && $run ./try; then
18274 # Now make sure there is no external linkage of static
18276 set try -DINLINE=$inline -DUSE_B a.c b.c
18277 if eval $compile && $run ./try; then
18278 $echo "Your compiler supports static $inline, " >&4
18279 $echo "but it also creates an external definition," >&4
18280 $echo "so I won't use it." >&4
18283 $echo "Your compiler supports static $inline." >&4
18285 perl_static_inline="static $inline";
18289 $echo "Your compiler does NOT support static $inline." >&4
18294 *inline*) # Some variant of inline exists.
18295 echo "Keeping your $hint value of $perl_static_inline."
18298 static) # No inline capabilities
18299 echo "Keeping your $hint value of $perl_static_inline."
18302 *) # Unrecognized previous value -- blindly trust the supplied
18303 # value and hope it makes sense. Use old value for
18304 # d_static_inline, if there is one.
18305 echo "Keeping your $hint value of $perl_static_inline."
18306 case "$d_static_inline" in
18308 *) val=$d_static_inline ;;
18312 # Fallback to plain 'static' if nothing worked.
18313 case "$perl_static_inline" in
18315 perl_static_inline="static"
18319 set d_static_inline
18321 $rm -f a.[co] b.[co]
18324 : Check stream access
18326 Checking how to access stdio streams by file descriptor number...
18328 case "$stdio_stream_array" in
18329 '') $cat >try.c <<EOCP
18332 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
18336 for s in _iob __iob __sF
18338 set try -DSTDIO_STREAM_ARRAY=$s
18339 if eval $compile; then
18340 case "`$run ./try`" in
18341 yes) stdio_stream_array=$s; break ;;
18347 case "$stdio_stream_array" in
18349 I can't figure out how to access stdio streams by file descriptor number.
18351 d_stdio_stream_array="$undef"
18354 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
18356 d_stdio_stream_array="$define"
18360 : see if strcoll exists
18361 set strcoll d_strcoll
18364 : check for structure copying
18366 echo "Checking to see if your C compiler can copy structs..." >&4
18367 $cat >try.c <<'EOCP'
18377 if $cc -c try.c >/dev/null 2>&1 ; then
18379 echo "Yup, it can."
18382 echo "Nope, it can't."
18388 : see if strerror and/or sys_errlist[] exist
18390 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
18391 if set strerror val -f d_strerror; eval $csym; $val; then
18392 echo 'strerror() found.' >&4
18393 d_strerror="$define"
18394 d_strerrm='strerror(e)'
18395 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18396 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
18397 d_syserrlst="$define"
18399 echo "(Since you don't have sys_errlist[], strerror() is welcome.)"
18400 d_syserrlst="$undef"
18402 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
18403 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
18404 echo 'strerror() found in string header.' >&4
18405 d_strerror="$define"
18406 d_strerrm='strerror(e)'
18407 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18408 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
18409 d_syserrlst="$define"
18411 echo "(You don't appear to have any sys_errlist[], how can this be?)"
18412 d_syserrlst="$undef"
18414 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18415 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
18416 d_strerror="$undef"
18417 d_syserrlst="$define"
18418 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
18420 echo 'strerror() and sys_errlist[] NOT found.' >&4
18421 d_strerror="$undef"
18422 d_syserrlst="$undef"
18423 d_strerrm='"unknown"'
18427 : see if strerror_r exists
18428 set strerror_r d_strerror_r
18430 case "$d_strerror_r" in
18432 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
18433 case "$d_strerror_r_proto:$usethreads" in
18434 ":define") d_strerror_r_proto=define
18435 set d_strerror_r_proto strerror_r $hdrs
18439 case "$d_strerror_r_proto" in
18441 case "$strerror_r_proto" in
18442 ''|0) try='int strerror_r(int, char*, size_t);'
18443 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBW ;;
18445 case "$strerror_r_proto" in
18446 ''|0) try='int strerror_r(int, char*, int);'
18447 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBI ;;
18449 case "$strerror_r_proto" in
18450 ''|0) try='char* strerror_r(int, char*, size_t);'
18451 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=B_IBW ;;
18453 case "$strerror_r_proto" in
18454 ''|0) d_strerror_r=undef
18456 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
18457 * ) case "$strerror_r_proto" in
18458 REENTRANT_PROTO*) ;;
18459 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
18461 echo "Prototype: $try" ;;
18464 *) case "$usethreads" in
18465 define) echo "strerror_r has no prototype, not using it." >&4 ;;
18472 *) strerror_r_proto=0
18476 : see if strftime exists
18477 set strftime d_strftime
18480 : see if strlcat exists
18481 set strlcat d_strlcat
18484 : see if strlcpy exists
18485 set strlcpy d_strlcpy
18488 : see if strtod exists
18489 set strtod d_strtod
18492 : see if strtol exists
18493 set strtol d_strtol
18496 : see if strtold exists
18497 set strtold d_strtold
18500 : see if strtoll exists
18501 set strtoll d_strtoll
18504 case "$d_longlong-$d_strtoll" in
18507 Checking whether your strtoll() works okay...
18509 $cat >try.c <<'EOCP'
18512 #define strtoll __strtoll
18515 #define strtoll _strtoll
18518 extern long long int strtoll(char *s, char **, int);
18519 static int bad = 0;
18520 int check(char *s, long long ell, int een) {
18523 gll = strtoll(s, 0, 10);
18524 if (!((gll == ell) && (errno == een)))
18528 check(" 1", 1LL, 0);
18529 check(" 0", 0LL, 0);
18530 check("-1", -1LL, 0);
18531 check("-9223372036854775808", -9223372036854775808LL, 0);
18532 check("-9223372036854775808", -9223372036854775808LL, 0);
18533 check(" 9223372036854775807", 9223372036854775807LL, 0);
18534 check("-9223372036854775808", -9223372036854775808LL, 0);
18535 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
18536 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
18542 if eval $compile; then
18545 ok) echo "Your strtoll() seems to be working okay." ;;
18547 Your strtoll() doesn't seem to be working okay.
18553 echo "(I can't seem to compile the test program--assuming it doesn't)"
18559 : see if strtoq exists
18560 set strtoq d_strtoq
18563 : see if strtoul exists
18564 set strtoul d_strtoul
18567 case "$d_strtoul" in
18570 Checking whether your strtoul() works okay...
18572 $cat >try.c <<'EOCP'
18575 extern unsigned long int strtoul(char *s, char **, int);
18576 static int bad = 0;
18577 void check(char *s, unsigned long eul, int een) {
18580 gul = strtoul(s, 0, 10);
18581 if (!((gul == eul) && (errno == een)))
18585 check(" 1", 1L, 0);
18586 check(" 0", 0L, 0);
18588 case "$longsize" in
18590 $cat >>try.c <<'EOCP'
18591 check("18446744073709551615", 18446744073709551615UL, 0);
18592 check("18446744073709551616", 18446744073709551615UL, ERANGE);
18593 #if 0 /* strtoul() for /^-/ strings is undefined. */
18594 check("-1", 18446744073709551615UL, 0);
18595 check("-18446744073709551614", 2, 0);
18596 check("-18446744073709551615", 1, 0);
18597 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
18598 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
18603 $cat >>try.c <<'EOCP'
18604 check("4294967295", 4294967295UL, 0);
18605 check("4294967296", 4294967295UL, ERANGE);
18606 #if 0 /* strtoul() for /^-/ strings is undefined. */
18607 check("-1", 4294967295UL, 0);
18608 check("-4294967294", 2, 0);
18609 check("-4294967295", 1, 0);
18610 check("-4294967296", 4294967295UL, ERANGE);
18611 check("-4294967297", 4294967295UL, ERANGE);
18616 : Should we write these tests to be more portable by sprintf-ing
18617 : ~0 and then manipulating that char string as input for strtol?
18620 $cat >>try.c <<'EOCP'
18627 if eval $compile; then
18628 case "`$run ./try`" in
18629 ok) echo "Your strtoul() seems to be working okay." ;;
18631 Your strtoul() doesn't seem to be working okay.
18637 echo "(I can't seem to compile the test program--assuming it doesn't)"
18643 : see if strtoull exists
18644 set strtoull d_strtoull
18647 case "$d_longlong-$d_strtoull" in
18650 Checking whether your strtoull() works okay...
18652 $cat >try.c <<'EOCP'
18655 #define strtoull __strtoull
18658 extern unsigned long long int strtoull(char *s, char **, int);
18659 static int bad = 0;
18660 int check(char *s, long long eull, int een) {
18663 gull = strtoull(s, 0, 10);
18664 if (!((gull == eull) && (errno == een)))
18668 check(" 1", 1LL, 0);
18669 check(" 0", 0LL, 0);
18670 check("18446744073709551615", 18446744073709551615ULL, 0);
18671 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18672 #if 0 /* strtoull() for /^-/ strings is undefined. */
18673 check("-1", 18446744073709551615ULL, 0);
18674 check("-18446744073709551614", 2LL, 0);
18675 check("-18446744073709551615", 1LL, 0);
18676 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18677 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18684 if eval $compile; then
18685 case "`$run ./try`" in
18686 ok) echo "Your strtoull() seems to be working okay." ;;
18688 Your strtoull() doesn't seem to be working okay.
18690 d_strtoull="$undef"
18694 echo "(I can't seem to compile the test program--assuming it doesn't)"
18695 d_strtoull="$undef"
18700 : see if strtouq exists
18701 set strtouq d_strtouq
18704 case "$d_strtouq" in
18707 Checking whether your strtouq() works okay...
18709 $cat >try.c <<'EOCP'
18712 extern unsigned long long int strtouq(char *s, char **, int);
18713 static int bad = 0;
18714 void check(char *s, unsigned long long eull, int een) {
18715 unsigned long long gull;
18717 gull = strtouq(s, 0, 10);
18718 if (!((gull == eull) && (errno == een)))
18722 check(" 1", 1LL, 0);
18723 check(" 0", 0LL, 0);
18724 check("18446744073709551615", 18446744073709551615ULL, 0);
18725 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18726 #if 0 /* strtouq() for /^-/ strings is undefined. */
18727 check("-1", 18446744073709551615ULL, 0);
18728 check("-18446744073709551614", 2LL, 0);
18729 check("-18446744073709551615", 1LL, 0);
18730 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18731 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18739 if eval $compile; then
18740 case "`$run ./try`" in
18741 ok) echo "Your strtouq() seems to be working okay." ;;
18743 Your strtouq() doesn't seem to be working okay.
18749 echo "(I can't seem to compile the test program--assuming it doesn't)"
18755 : see if strxfrm exists
18756 set strxfrm d_strxfrm
18759 : see if symlink exists
18760 set symlink d_symlink
18763 : see if syscall exists
18764 set syscall d_syscall
18767 : see if prototype for syscall is available
18769 set d_syscallproto syscall $i_unistd unistd.h
18772 : see if sysconf exists
18773 set sysconf d_sysconf
18776 : see if system exists
18777 set system d_system
18780 : see if tcgetpgrp exists
18781 set tcgetpgrp d_tcgetpgrp
18784 : see if tcsetpgrp exists
18785 set tcsetpgrp d_tcsetpgrp
18788 : see if prototype for telldir is available
18790 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
18793 : see if time exists
18795 if test "X$d_time" = X -o X"$timetype" = X; then
18796 if set time val -f d_time; eval $csym; $val; then
18797 echo 'time() found.' >&4
18799 rp="What is the type returned by time() on this system?"
18800 set time_t timetype long stdio.h sys/types.h
18803 echo 'time() not found, hope that will do.' >&4
18811 : see if timegm exists
18812 set timegm d_timegm
18815 : see if this is a sys/times.h system
18816 set sys/times.h i_systimes
18819 : see if times exists
18821 if set times val -f d_times; eval $csym; $val; then
18822 echo 'times() found.' >&4
18825 case "$i_systimes" in
18826 "$define") inc='sys/times.h';;
18828 rp="What is the type returned by times() on this system?"
18829 set clock_t clocktype long stdio.h sys/types.h $inc
18832 echo 'times() NOT found, hope that will do.' >&4
18837 : see if tmpnam_r exists
18838 set tmpnam_r d_tmpnam_r
18840 case "$d_tmpnam_r" in
18842 hdrs="$i_systypes sys/types.h define stdio.h "
18843 case "$d_tmpnam_r_proto:$usethreads" in
18844 ":define") d_tmpnam_r_proto=define
18845 set d_tmpnam_r_proto tmpnam_r $hdrs
18849 case "$d_tmpnam_r_proto" in
18851 case "$tmpnam_r_proto" in
18852 ''|0) try='char* tmpnam_r(char*);'
18853 ./protochk "$extern_C $try" $hdrs && tmpnam_r_proto=B_B ;;
18855 case "$tmpnam_r_proto" in
18856 ''|0) d_tmpnam_r=undef
18858 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
18859 * ) case "$tmpnam_r_proto" in
18860 REENTRANT_PROTO*) ;;
18861 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
18863 echo "Prototype: $try" ;;
18866 *) case "$usethreads" in
18867 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
18874 *) tmpnam_r_proto=0
18878 : see if truncate exists
18879 set truncate d_truncate
18882 : see if ttyname_r exists
18883 set ttyname_r d_ttyname_r
18885 case "$d_ttyname_r" in
18887 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
18888 case "$d_ttyname_r_proto:$usethreads" in
18889 ":define") d_ttyname_r_proto=define
18890 set d_ttyname_r_proto ttyname_r $hdrs
18894 case "$d_ttyname_r_proto" in
18896 case "$ttyname_r_proto" in
18897 ''|0) try='int ttyname_r(int, char*, size_t);'
18898 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBW ;;
18900 case "$ttyname_r_proto" in
18901 ''|0) try='int ttyname_r(int, char*, int);'
18902 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBI ;;
18904 case "$ttyname_r_proto" in
18905 ''|0) try='char* ttyname_r(int, char*, int);'
18906 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=B_IBI ;;
18908 case "$ttyname_r_proto" in
18909 ''|0) d_ttyname_r=undef
18911 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
18912 * ) case "$ttyname_r_proto" in
18913 REENTRANT_PROTO*) ;;
18914 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
18916 echo "Prototype: $try" ;;
18919 *) case "$usethreads" in
18920 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
18927 *) ttyname_r_proto=0
18931 : see if tzname[] exists
18933 if set tzname val -a d_tzname; eval $csym; $val; then
18935 echo 'tzname[] found.' >&4
18938 echo 'tzname[] NOT found.' >&4
18943 : Check if is a multiplatform env
18945 next|darwin) multiarch="$define" ;;
18947 case "$multiarch" in
18948 ''|[nN]*) multiarch="$undef" ;;
18951 : check for ordering of bytes in a UV
18953 case "$multiarch" in
18956 You seem to be doing a multiarchitecture build,
18957 skipping the byteorder check.
18963 case "$byteorder" in
18966 In the following, larger digits indicate more significance. A big-endian
18967 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
18968 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
18969 machines may have weird orders like 3412. A Cray will report 87654321,
18970 an Alpha will report 12345678. If the test program works the default is
18972 I'm now running the test program...
18976 #$i_stdlib I_STDLIB
18978 #include <stdlib.h>
18980 #include <sys/types.h>
18981 typedef $uvtype UV;
18991 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
18993 u.l = (UV)0x04030201;
18994 for (i = 0; i < $uvsize; i++)
18995 printf("%c", u.c[i]+'0');
19002 if eval $compile && $run ./try > /dev/null; then
19005 [1-4][1-4][1-4][1-4]|12345678|87654321)
19006 echo "(The test program ran ok.)"
19007 echo "byteorder=$dflt"
19010 ????|????????) echo "(The test program ran ok.)" ;;
19011 *) echo "(The test program didn't run right for some reason.)" ;;
19016 (I can't seem to compile the test program. Guessing big-endian...)
19019 case "$xxx_prompt" in
19021 rp="What is the order of bytes in $uvtype?"
19034 : Checking 32bit alignedness
19037 Checking to see whether you can access character data unalignedly...
19039 case "$d_u32align" in
19040 '') $cat >try.c <<EOCP
19042 #$i_stdlib I_STDLIB
19044 #include <stdlib.h>
19046 #define U32 $u32type
19047 #define BYTEORDER 0x$byteorder
19049 #include <signal.h>
19051 $signal_t bletch(int s) { exit(4); }
19054 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
19055 volatile U8 buf[8];
19059 if (sizeof(U32) != 4) {
19060 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
19067 signal(SIGBUS, bletch);
19079 for (i = 0; i < 4; i++) {
19080 up = (U32*)(buf + i);
19081 if (! ((*up == 1 << (8*i)) || /* big-endian */
19082 (*up == 1 << (8*(3-i))) /* little-endian */
19086 printf("read failed (%x)\n", *up);
19092 for (i = 0; i < 4; i++) {
19093 up = (U32*)(buf + i);
19095 if (*up != 0xBeef) {
19096 printf("write failed (%x)\n", *up);
19110 if eval $compile_ok; then
19111 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
19112 $run ./try 2>&1 >/dev/null
19115 You can access character data pretty unalignedly.
19117 d_u32align="$undef"
19120 It seems that you must access character data in an aligned manner.
19122 d_u32align="$define"
19126 rp='Can you access character data at unaligned addresses?'
19130 [yY]*) d_u32align="$undef" ;;
19131 *) d_u32align="$define" ;;
19138 : see if ualarm exists
19139 set ualarm d_ualarm
19142 : see if umask exists
19146 : see if unordered exists
19147 set unordered d_unordered
19150 : see if unsetenv exists
19151 set unsetenv d_unsetenv
19154 : see if usleep exists
19155 set usleep d_usleep
19158 : see if prototype for usleep is available
19160 set d_usleepproto usleep $i_unistd unistd.h
19163 : see if ustat exists
19167 : see if closedir exists
19168 set closedir d_closedir
19171 case "$d_closedir" in
19174 echo "Checking whether closedir() returns a status..." >&4
19176 #$i_dirent I_DIRENT /**/
19177 #$i_sysdir I_SYS_DIR /**/
19178 #$i_sysndir I_SYS_NDIR /**/
19179 #$i_systypes I_SYS_TYPES /**/
19181 #if defined(I_SYS_TYPES)
19182 #include <sys/types.h>
19184 #if defined(I_DIRENT)
19185 #include <dirent.h>
19186 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
19187 #include <sys/dir.h>
19191 #include <sys/ndir.h>
19195 #include <ndir.h> /* may be wrong in the future */
19197 #include <sys/dir.h>
19202 int main() { return closedir(opendir(".")); }
19205 if eval $compile_ok; then
19206 if $run ./try > /dev/null 2>&1 ; then
19207 echo "Yes, it does."
19210 echo "No, it doesn't."
19214 echo "(I can't seem to compile the test program--assuming it doesn't)"
19222 set d_void_closedir
19226 : see if there is a wait4
19230 : see if waitpid exists
19231 set waitpid d_waitpid
19236 $cat >try.c <<'EOCP'
19242 return (wcscmp (s, s) ? 1 : 0);
19247 if eval $compile; then
19250 0) echo "A working wcscmp() found." >&4
19252 *) echo "wcscmp() found, but it doesn't work" >&4
19256 echo "wcscmp() NOT found." >&4
19262 : see if wcstombs exists
19263 set wcstombs d_wcstombs
19268 $cat >try.c <<'EOCP'
19273 wchar_t dst[4], *src = L" ";
19275 return (wcsxfrm (dst, src, 1) ? errno ? errno : 0 : 1);
19280 if eval $compile; then
19283 0) echo "A working wcsxfrm() found." >&4
19285 *) echo "wcsxfrm() found, but it doesn't work" >&4
19289 echo "wcsxfrm() NOT found." >&4
19295 : see if wctomb exists
19296 set wctomb d_wctomb
19299 : see if writev exists
19300 set writev d_writev
19303 : preserve RCS keywords in files with variable substitution, grrr
19308 Revision='$Revision'
19310 : check for alignment requirements
19312 case "$alignbytes" in
19313 '') echo "Checking alignment constraints..." >&4
19314 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
19315 $cat >try.c <<'EOCP'
19316 typedef long double NV;
19319 $cat >try.c <<'EOCP'
19323 $cat >>try.c <<'EOCP'
19331 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
19336 if eval $compile_ok; then
19340 echo "(I can't seem to compile the test program...)"
19342 case "$multiarch" in
19344 : The usual safe value is 8, but Darwin with -Duselongdouble
19345 : needs 16. Hence, we will take 8 as a minimum, but allow
19346 : Configure to pick a larger value if needed.
19347 if $test "$dflt" -lt 8; then
19349 echo "Setting alignment to 8 for multiarch support.">&4
19354 *) dflt="$alignbytes"
19357 rp="Doubles must be aligned on a how-many-byte boundary?"
19362 : set the base revision
19365 : length of character in bytes. Is always 1, otherwise it is not C
19366 : This used to be a test using sizeof
19369 : Check for the number of bits in a character
19370 case "$charbits" in
19371 '') echo "Checking how long a character is (in bits)..." >&4
19378 for (c = 1, n = 0; c; c <<= 1, n++) ;
19379 printf ("%d\n", n);
19384 if eval $compile_ok; then
19388 echo "(I can't seem to compile the test program. Guessing...)"
19395 rp="What is the length of a character (in bits)?"
19399 case "$charbits" in
19402 Your system has an unsigned character size of $charbits bits, which
19403 is rather unusual (normally it is 8 bits). Perl likely will not work
19404 correctly on your system, with subtle bugs in various places.
19406 rp='Do you really want to continue?'
19410 [yY]) echo >&4 "Okay, continuing." ;;
19415 : how do we concatenate cpp tokens here?
19417 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
19418 $cat >cpp_stuff.c <<'EOCP'
19419 #define RCAT(a,b)a/**/b
19420 #define ACAT(a,b)a ## b
19424 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
19425 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
19426 echo "Oh! Smells like ANSI's been here." >&4
19427 echo "We can catify or stringify, separately or together!"
19429 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
19430 echo "Ah, yes! The good old days!" >&4
19431 echo "However, in the good old days we don't know how to stringify and"
19432 echo "catify at the same time."
19436 Hmm, I don't seem to be able to concatenate tokens with your cpp.
19437 You're going to have to edit the values of CAT[2-5] in config.h...
19439 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
19443 : see if this is a db.h system
19449 : Check db version.
19451 echo "Checking Berkeley DB version ..." >&4
19457 #include <sys/types.h>
19459 #$i_stdlib I_STDLIB
19461 #include <stdlib.h>
19464 int main(int argc, char *argv[])
19466 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
19467 int Major, Minor, Patch ;
19468 unsigned long Version ;
19469 (void)db_version(&Major, &Minor, &Patch) ;
19471 printf("%d %d %d %d %d %d\n",
19472 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
19473 Major, Minor, Patch);
19476 printf("You have Berkeley DB Version 2 or greater.\n");
19478 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
19479 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
19480 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
19481 Major, Minor, Patch) ;
19483 /* check that db.h & libdb are compatible */
19484 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
19485 printf("db.h and libdb are incompatible.\n") ;
19489 printf("db.h and libdb are compatible.\n") ;
19491 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
19492 + DB_VERSION_PATCH ;
19494 /* needs to be >= 2.3.4 */
19495 if (Version < 2003004) {
19496 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
19497 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
19503 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
19508 printf("You have Berkeley DB Version 1.\n");
19509 exit(0); /* DB version < 2: the coast is clear. */
19511 exit(1); /* <db.h> not Berkeley DB? */
19517 if eval $compile_ok && $run ./try; then
19518 echo 'Looks OK.' >&4
19520 db_version_major=$1
19521 db_version_minor=$2
19522 db_version_patch=$3
19524 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
19528 : Remove db from list of libraries to use
19529 echo "Removing unusable -ldb from library list" >&4
19530 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
19533 echo "libs = $libs" >&4
19543 : Check the return type needed for hash
19545 echo "Checking return type needed for hash for Berkeley DB ..." >&4
19551 #include <sys/types.h>
19554 #ifndef DB_VERSION_MAJOR
19555 u_int32_t hash_cb (ptr, size)
19563 info.hash = hash_cb;
19567 if $cc $ccflags -c try.c >try.out 2>&1 ; then
19568 if $contains warning try.out >>/dev/null 2>&1 ; then
19571 db_hashtype='u_int32_t'
19574 : XXX Maybe we should just give up here.
19575 db_hashtype=u_int32_t
19577 echo "Help: I can't seem to compile the db test program." >&4
19578 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
19581 echo "Your version of Berkeley DB uses $db_hashtype for hash."
19583 *) db_hashtype=u_int32_t
19588 : Check the return type needed for prefix
19590 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
19596 #include <sys/types.h>
19599 #ifndef DB_VERSION_MAJOR
19600 size_t prefix_cb (key1, key2)
19608 info.prefix = prefix_cb;
19612 if $cc $ccflags -c try.c >try.out 2>&1 ; then
19613 if $contains warning try.out >>/dev/null 2>&1 ; then
19614 db_prefixtype='int'
19616 db_prefixtype='size_t'
19619 db_prefixtype='size_t'
19620 : XXX Maybe we should just give up here.
19622 echo "Help: I can't seem to compile the db test program." >&4
19623 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
19626 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
19628 *) db_prefixtype='size_t'
19632 : How can we generate normalized random numbers ?
19634 echo "Using our internal random number implementation..." >&4
19637 *-Dmy_rand=*|*-Dmy_srand=*)
19638 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
19639 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
19640 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
19641 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
19645 randfunc=Perl_drand48
19646 drand01="Perl_drand48()"
19647 seedfunc="Perl_drand48_init"
19651 : Determine if this is an EBCDIC system
19653 echo "Determining whether or not we are on an EBCDIC system..." >&4
19654 $cat >try.c <<'EOM'
19657 if ('M'==0xd4) return 0;
19664 if eval $compile_ok; then
19665 if $run ./try; then
19666 echo "You seem to speak EBCDIC." >&4
19669 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
19672 echo "I'm unable to compile the test program." >&4
19673 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
19679 : Check how to flush
19682 Checking how to flush all pending stdio output...
19684 # I only know how to find the first 32 possibly open files on SunOS.
19685 # See also hints/sunos_4_1.sh and util.c --AD
19687 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
19689 $cat >>try.c <<EOCP
19691 #$i_stdlib I_STDLIB
19693 #include <stdlib.h>
19695 #$i_unistd I_UNISTD
19697 # include <unistd.h>
19699 #$d_sysconf HAS_SYSCONF
19700 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
19701 #ifdef HAS_STDIO_STREAM_ARRAY
19702 # define STDIO_STREAM_ARRAY $stdio_stream_array
19707 p = fopen("try.out", "w");
19711 # ifdef TRY_FPRINTF
19715 #ifdef TRY_FFLUSH_NULL
19718 #ifdef TRY_FFLUSH_ALL
19720 long open_max = -1;
19721 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
19722 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
19724 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
19725 open_max = sysconf(_SC_OPEN_MAX);
19728 open_max = FOPEN_MAX;
19731 open_max = OPEN_MAX;
19740 # ifdef HAS_STDIO_STREAM_ARRAY
19741 if (open_max > 0) {
19743 for (i = 0; i < open_max; i++)
19744 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
19745 STDIO_STREAM_ARRAY[i]._file < open_max &&
19746 STDIO_STREAM_ARRAY[i]._flag)
19747 fflush(&STDIO_STREAM_ARRAY[i]);
19755 : first we have to find out how _not_ to flush
19757 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
19759 set try -DTRY_FPUTC
19760 if eval $compile; then
19761 $run ./try 2>/dev/null
19764 if $test ! -s try.out -a "X$code" = X42; then
19770 set try -DTRY_FPRINTF
19771 if eval $compile; then
19772 $run ./try 2>/dev/null
19775 if $test ! -s try.out -a "X$code" = X42; then
19776 output=-DTRY_FPRINTF
19782 : check for fflush NULL behavior
19783 case "$fflushNULL" in
19784 '') set try -DTRY_FFLUSH_NULL $output
19785 if eval $compile; then
19786 $run ./try 2>/dev/null
19789 if $test -s try.out -a "X$code" = X42; then
19790 fflushNULL="`$cat try.out`"
19792 if $test "X$code" != X42; then
19794 (If this test failed, don't worry, we'll try another method shortly.)
19799 $rm -f core try.core core.try.*
19800 case "$fflushNULL" in
19802 Your fflush(NULL) works okay for output streams.
19803 Let's see if it clobbers input pipes...
19805 # As of mid-March 2000 all versions of Solaris appear to have a stdio
19806 # bug that improperly flushes the input end of pipes. So we avoid the
19807 # autoflush on fork/system/exec support for now. :-(
19808 $cat >tryp.c <<EOCP
19811 main(int argc, char **argv)
19817 while ((i = getc(stdin)) != -1
19818 && (*bp++ = i) != '\n'
19819 && bp < &buf[1024])
19822 fprintf(stdout, "%s", buf);
19830 fflushNULL="$define"
19832 if eval $compile; then
19834 # Copy the .c file to the remote host ($to is an ssh-alike if targethost is set)
19835 if $test "X$targethost" != X; then
19838 $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
19840 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19842 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19844 fflush(NULL) seems to behave okay with input streams.
19846 fflushNULL="$define"
19849 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
19851 fflushNULL="$undef"
19854 $rm -f core tryp.c tryp.core core.tryp.*
19857 Your fflush(NULL) isn't working (contrary to ANSI C).
19859 fflushNULL="$undef"
19862 Cannot figure out whether your fflush(NULL) works or not.
19863 I'm assuming it doesn't (contrary to ANSI C).
19865 fflushNULL="$undef"
19869 $define|true|[yY]*)
19870 fflushNULL="$define"
19873 fflushNULL="$undef"
19876 : check explicit looping only if NULL did not work, and if the pipe
19877 : bug does not show up on an explicit flush too
19878 case "$fflushNULL" in
19880 $cat >tryp.c <<EOCP
19883 main(int argc, char **argv)
19889 while ((i = getc(stdin)) != -1
19890 && (*bp++ = i) != '\n'
19891 && bp < &buf[1024])
19894 fprintf(stdout, "%s", buf);
19903 if eval $compile; then
19905 if $test "X$targethost" != X; then
19908 $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
19910 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19912 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19914 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
19916 : now check for fflushall behaviour
19917 case "$fflushall" in
19918 '') set try -DTRY_FFLUSH_ALL $output
19919 if eval $compile; then
19921 (Now testing the other method--but note that this also may fail.)
19923 $run ./try 2>/dev/null
19926 if $test -s try.out -a "X$code" = X42; then
19927 fflushall="`$cat try.out`"
19931 case "$fflushall" in
19933 Whew. Flushing explicitly all the stdio streams works.
19935 fflushall="$define"
19938 Sigh. Flushing explicitly all the stdio streams doesn't work.
19943 Cannot figure out whether flushing stdio streams explicitly works or not.
19944 I'm assuming it doesn't.
19950 "$define"|true|[yY]*)
19951 fflushall="$define"
19959 All is futile. Even fflush(stdin) clobbers input pipes!
19966 $rm -f core tryp.c tryp.core core.tryp.*
19968 *) fflushall="$undef"
19972 case "$fflushNULL$fflushall" in
19975 OK, I give up. I cannot figure out how to flush pending stdio output.
19976 We won't be flushing handles at all before fork/exec/popen.
19982 : Store the full pathname to the ar program for use in the C program
19983 : Respect a hint or command line value for full_ar.
19988 : Store the full pathname to the sed program for use in the C program
19991 : see what type gids are declared as in the kernel
19993 echo "Looking for the type for group ids returned by getgid()."
19994 set gid_t gidtype xxx stdio.h sys/types.h
19998 xxx=`./findhdr sys/user.h`
19999 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
20001 unsigned) dflt="$1 $2" ;;
20005 *) dflt="$gidtype";;
20008 gid_t) echo "gid_t found." ;;
20009 *) rp="What is the type for group ids returned by getgid()?"
20015 : Check the size of GID
20018 *_t) zzz="$gidtype" ;;
20021 echo "Checking the size of $zzz..." >&4
20023 #include <sys/types.h>
20025 #$i_stdlib I_STDLIB
20027 #include <stdlib.h>
20030 printf("%d\n", (int)sizeof($gidtype));
20035 if eval $compile_ok; then
20039 echo "(I can't execute the test program--guessing $gidsize.)" >&4
20042 echo "Your $zzz is $gidsize bytes long."
20047 echo "(I can't compile the test program--guessing $gidsize.)" >&4
20051 : Check if GID is signed
20054 *_t) zzz="$gidtype" ;;
20057 echo "Checking the sign of $zzz..." >&4
20059 #include <sys/types.h>
20070 if eval $compile; then
20074 echo "(I can't execute the test program--guessing unsigned.)" >&4
20078 1) echo "Your $zzz is unsigned." ;;
20079 -1) echo "Your $zzz is signed." ;;
20085 echo "(I can't compile the test program--guessing unsigned.)" >&4
20089 : Check 64bit sizes
20092 if $test X"$quadtype" != X; then
20094 echo "Checking how to print 64-bit integers..." >&4
20096 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
20097 $cat >try.c <<'EOCP'
20098 #include <sys/types.h>
20101 int q = 12345678901;
20102 printf("%ld\n", q);
20106 if eval $compile; then
20110 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
20111 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
20112 echo "We will use %d."
20118 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
20119 $cat >try.c <<'EOCP'
20120 #include <sys/types.h>
20123 long q = 12345678901;
20124 printf("%ld\n", q);
20128 if eval $compile; then
20132 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
20133 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
20134 echo "We will use %ld."
20140 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
20141 $cat >try.c <<'EOCP'
20142 #include <sys/types.h>
20143 #include <inttypes.h>
20146 int64_t q = 12345678901;
20147 printf("%" PRId64 "\n", q);
20151 if eval $compile; then
20155 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
20156 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
20157 echo "We will use the C9X style."
20163 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
20165 #include <sys/types.h>
20168 $quadtype q = 12345678901;
20169 printf("%Ld\n", q);
20173 if eval $compile; then
20177 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
20178 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
20179 echo "We will use %Ld."
20185 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
20186 $cat >try.c <<'EOCP'
20187 #include <sys/types.h>
20190 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
20191 printf("%lld\n", q);
20195 if eval $compile; then
20199 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
20200 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
20201 echo "We will use the %lld style."
20207 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
20209 #include <sys/types.h>
20212 $quadtype q = 12345678901;
20213 printf("%qd\n", q);
20217 if eval $compile; then
20221 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
20222 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
20223 echo "We will use %qd."
20229 if $test X"$sPRId64" = X; then
20230 echo "Cannot figure out how to print 64-bit integers." >&4
20237 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
20238 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
20240 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
20241 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
20245 : Check format strings for internal types
20247 $echo "Checking the format strings to be used for Perl's internal types..." >&4
20249 if $test X"$ivsize" = X8; then
20250 ivdformat="$sPRId64"
20251 uvuformat="$sPRIu64"
20252 uvoformat="$sPRIo64"
20253 uvxformat="$sPRIx64"
20254 uvXUformat="$sPRIXU64"
20256 if $test X"$ivsize" = X"$longsize"; then
20263 if $test X"$ivsize" = X"$intsize"; then
20271 if $test X"$ivsize" = X"$shortsize"; then
20282 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
20283 nveformat="$sPRIeldbl"
20284 nvfformat="$sPRIfldbl"
20285 nvgformat="$sPRIgldbl"
20286 nvEUformat="$sPRIEUldbl"
20287 nvFUformat="$sPRIFUldbl"
20288 nvGUformat="$sPRIGUldbl"
20298 case "$ivdformat" in
20299 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
20304 : Check format string for GID
20307 $echo "Checking the format string to be used for gids..." >&4
20310 -1) if $test X"$gidsize" = X"$ivsize"; then
20311 gidformat="$ivdformat"
20313 if $test X"$gidsize" = X"$longsize"; then
20316 if $test X"$gidsize" = X"$intsize"; then
20319 if $test X"$gidsize" = X"$shortsize"; then
20326 *) if $test X"$gidsize" = X"$uvsize"; then
20327 gidformat="$uvuformat"
20329 if $test X"$gidsize" = X"$longsize"; then
20332 if $test X"$gidsize" = X"$intsize"; then
20335 if $test X"$gidsize" = X"$shortsize"; then
20344 : see if getgroups exists
20345 set getgroups d_getgrps
20348 : see if setgroups exists
20349 set setgroups d_setgrps
20352 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
20354 case "$d_getgrps$d_setgrps" in
20356 case "$groupstype" in
20357 '') dflt="$gidtype" ;;
20358 *) dflt="$groupstype" ;;
20361 What type of pointer is the second argument to getgroups() and setgroups()?
20362 Usually this is the same as group ids, $gidtype, but not always.
20365 rp='What type pointer is the second argument to getgroups() and setgroups()?'
20369 *) groupstype="$gidtype";;
20372 : MAD = Misc Attribute Definition
20374 if $test $patchlevel -lt 9; then
20375 : MAD is not available in 5.8.x or earlier.
20379 $define|true|[yY]*) dflt='y' ;;
20384 Would you like to build with Misc Attribute Decoration? This is development
20385 work leading to a Perl 5 to Perl 6 convertor, which imposes a space and speed
20386 overhead on the interpreter.
20388 If this doesn't make any sense to you, just accept the default '$dflt'.
20390 rp='Build Perl with MAD?'
20395 madlyh='madly.h madly.act madly.tab'
20397 madlyobj="madly$_o" ;;
20406 : check whether make sets MAKE
20408 echo "Checking if your $make program sets \$(MAKE)..." >&4
20409 case "$make_set_make" in
20411 $sed 's/^X //' > testmake.mak << 'EOF'
20413 X @echo 'maketemp="$(MAKE)"'
20415 case "`$make -f testmake.mak 2>/dev/null`" in
20416 *maketemp=*) make_set_make='#' ;;
20417 *) make_set_make="MAKE=$make" ;;
20419 $rm -f testmake.mak
20422 case "$make_set_make" in
20423 '#') echo "Yup, it does.";;
20424 *) echo "Nope, it doesn't.";;
20427 : see what type is used for mode_t
20428 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
20429 set mode_t modetype int stdio.h sys/types.h
20432 : see if we need va_copy
20434 case "$i_stdarg" in
20437 #include <stdarg.h>
20439 #$i_stdlib I_STDLIB
20441 #include <stdlib.h>
20443 #include <signal.h>
20446 ivfprintf(FILE *f, const char *fmt, va_list *valp)
20448 return vfprintf(f, fmt, *valp);
20452 myvfprintf(FILE *f, const char *fmt, va_list val)
20454 return ivfprintf(f, fmt, &val);
20458 myprintf(char *fmt, ...)
20461 va_start(val, fmt);
20462 return myvfprintf(stdout, fmt, val);
20466 main(int ac, char **av)
20468 signal(SIGSEGV, exit);
20470 myprintf("%s%cs all right, then\n", "that", '\'');
20475 if eval $compile && $run ./try 2>&1 >/dev/null; then
20476 case "`$run ./try`" in
20477 "that's all right, then")
20483 yes) echo "It seems that you don't need va_copy()." >&4
20484 need_va_copy="$undef"
20486 *) echo "It seems that va_copy() or similar will be needed." >&4
20487 need_va_copy="$define"
20492 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
20493 need_va_copy="$undef"
20497 : see what type is used for size_t
20498 rp="What is the type used for the length parameter for string functions?"
20499 set size_t sizetype 'unsigned int' stdio.h sys/types.h
20502 : check for type of arguments to gethostbyaddr.
20503 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
20504 case "$d_gethbyaddr" in
20508 Checking to see what type of arguments are accepted by gethostbyaddr().
20510 hdrs="$define sys/types.h
20511 $d_socket sys/socket.h
20512 $i_niin netinet/in.h
20514 $i_unistd unistd.h"
20515 : The first arg can 'char *' or 'void *'
20516 : The second arg is some of integral type
20517 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
20518 for yyy in size_t long int; do
20519 case "$netdb_host_type" in
20520 '') try="$extern_C struct hostent *gethostbyaddr($xxx, $yyy, int);"
20521 if ./protochk "$try" $hdrs; then
20522 echo "Your system accepts $xxx for the first arg."
20523 echo "...and $yyy for the second arg."
20524 netdb_host_type="$xxx"
20525 netdb_hlen_type="$yyy"
20531 : In case none of those worked, prompt the user.
20532 case "$netdb_host_type" in
20533 '') rp='What is the type for the 1st argument to gethostbyaddr?'
20536 netdb_host_type=$ans
20537 rp='What is the type for the 2nd argument to gethostbyaddr?'
20540 netdb_hlen_type=$ans
20544 *) : no gethostbyaddr, so pick harmless defaults
20545 netdb_host_type='char *'
20546 netdb_hlen_type="$sizetype"
20549 # Remove the "const" if needed. -- but then we'll have a
20551 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
20554 : check for type of argument to gethostbyname.
20555 if test "X$netdb_name_type" = X ; then
20556 case "$d_gethbyname" in
20560 Checking to see what type of argument is accepted by gethostbyname().
20562 hdrs="$define sys/types.h
20563 $d_socket sys/socket.h
20564 $i_niin netinet/in.h
20566 $i_unistd unistd.h"
20567 for xxx in "const char *" "char *"; do
20568 case "$netdb_name_type" in
20569 '') try="$extern_C struct hostent *gethostbyname($xxx);"
20570 if ./protochk "$try" $hdrs; then
20571 echo "Your system accepts $xxx."
20572 netdb_name_type="$xxx"
20577 : In case none of those worked, prompt the user.
20578 case "$netdb_name_type" in
20579 '') rp='What is the type for the 1st argument to gethostbyname?'
20582 netdb_name_type=$ans
20586 *) : no gethostbyname, so pick harmless default
20587 netdb_name_type='char *'
20592 : check for type of 1st argument to getnetbyaddr.
20593 if test "X$netdb_net_type" = X ; then
20594 case "$d_getnbyaddr" in
20598 Checking to see what type of 1st argument is accepted by getnetbyaddr().
20600 hdrs="$define sys/types.h
20601 $d_socket sys/socket.h
20602 $i_niin netinet/in.h
20604 $i_unistd unistd.h"
20605 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
20606 case "$netdb_net_type" in
20607 '') try="$extern_C struct netent *getnetbyaddr($xxx, int);"
20608 if ./protochk "$try" $hdrs; then
20609 echo "Your system accepts $xxx."
20610 netdb_net_type="$xxx"
20615 : In case none of those worked, prompt the user.
20616 case "$netdb_net_type" in
20617 '') rp='What is the type for the 1st argument to getnetbyaddr?'
20620 netdb_net_type=$ans
20624 *) : no getnetbyaddr, so pick harmless default
20625 netdb_net_type='long'
20629 : locate the preferred pager for this system
20636 [a-zA-Z]:/*) dflt=$pg;;
20640 [a-zA-Z]:/*) dflt=$more;;
20644 [a-zA-Z]:/*) dflt=$less;;
20647 '') dflt=/usr/ucb/more;;
20655 rp='What pager is used on your system?'
20659 : see what type pids are declared as in the kernel
20660 rp="What is the type of process ids on this system?"
20661 set pid_t pidtype int stdio.h sys/types.h
20664 : see if ar generates random libraries by itself
20666 echo "Checking how to generate random libraries on your machine..." >&4
20667 echo 'int bar1() { return bar2(); }' > bar1.c
20668 echo 'int bar2() { return 2; }' > bar2.c
20670 #$i_stdlib I_STDLIB
20672 #include <stdlib.h>
20674 int main() { printf("%d\n", bar1()); exit(0); }
20676 $cc $ccflags -c bar1.c >/dev/null 2>&1
20677 $cc $ccflags -c bar2.c >/dev/null 2>&1
20678 $cc $ccflags -c foo.c >/dev/null 2>&1
20679 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
20680 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20681 $run ./foobar >/dev/null 2>&1; then
20682 echo "$ar appears to generate random libraries itself."
20684 if [ "X$ranlib" = "X" ]; then
20687 elif $ar s bar$_a >/dev/null 2>&1 &&
20688 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20689 $run ./foobar >/dev/null 2>&1; then
20690 echo "a table of contents needs to be added with '$ar s'."
20693 elif $ar ts bar$_a >/dev/null 2>&1 &&
20694 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20695 $run ./foobar >/dev/null 2>&1; then
20696 echo "a table of contents needs to be added with '$ar ts'."
20703 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
20704 $test -f $ranlib || ranlib=''
20707 if $test -n "$ranlib"; then
20708 echo "your system has '$ranlib'; we'll use that."
20711 echo "your system doesn't seem to support random libraries"
20712 echo "so we'll use lorder and tsort to order the libraries."
20719 : see if this is a values.h system
20720 set values.h i_values
20723 : Check the max offset that gmtime and localtime accept
20724 echo "Checking max offsets that gmtime () accepts"
20727 define) yyy="#include <values.h>" ;;
20731 case "$sGMTIME_min/$sGMTIME_max" in
20734 #include <sys/types.h>
20743 void gm_check (time_t t, int min_year, int max_year)
20746 if ( tmp == NULL ||
20747 /* Check tm_year overflow */
20748 tmp->tm_year < min_year || tmp->tm_year > max_year)
20759 gm_check (MAXLONG, 69, 0x7fffffff);
20761 if (tmp == NULL || tmp->tm_year < 0) {
20762 for (i = 63; i >= 0; i--) {
20763 time_t x = pt | ((time_t)1 << i);
20764 if (x < 0 || x < pt) continue;
20765 gm_check (x, 69, 0x7fffffff);
20768 printf ("sGMTIME_max=%ld\n", pt);
20777 gm_check (MINLONG, -1900, 70);
20780 for (i = 36; i >= 0; i--) {
20781 time_t x = pt - ((time_t)1 << i);
20782 if (x > 0) continue;
20783 gm_check (x, -1900, 70);
20786 printf ("sGMTIME_min=%ld\n", pt);
20790 int main (int argc, char *argv[])
20792 fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t));
20799 if eval $compile; then
20802 echo "Cannot determine sGMTIME_max and sGMTIME_min." >&4
20808 echo "Checking max offsets that localtime () accepts"
20810 case "$sLOCALTIME_min/$sLOCALTIME_max" in
20813 #include <sys/types.h>
20822 void local_check (time_t t, int min_year, int max_year)
20824 if (sizeof (time_t) > 4 && t > 0x7ffffffffffff000LL)
20827 tmp = localtime (&t);
20828 if ( tmp == NULL ||
20829 /* Check tm_year overflow */
20830 tmp->tm_year < min_year || tmp->tm_year > max_year)
20834 } /* local_check */
20841 local_check (MAXLONG, 69, 0x7fffffff);
20843 if (tmp == NULL || tmp->tm_year < 0) {
20844 for (i = 63; i >= 0; i--) {
20845 time_t x = pt | ((time_t)1 << i);
20846 if (x < 0 || x < pt) continue;
20847 local_check (x, 69, 0x7fffffff);
20850 printf ("sLOCALTIME_max=%ld\n", pt);
20859 local_check (MINLONG, -1900, 70);
20862 for (i = 36; i >= 0; i--) {
20863 time_t x = pt - ((time_t)1 << i);
20864 if (x > 0) continue;
20865 local_check (x, -1900, 70);
20868 printf ("sLOCALTIME_min=%ld\n", pt);
20872 int main (int argc, char *argv[])
20880 if eval $compile; then
20883 echo "Cannot determine sLOCALTIME_max and sLOCALTIME_min." >&4
20889 : check for type of arguments to select.
20890 case "$selecttype" in
20891 '') case "$d_select" in
20895 Checking to see what type of arguments are accepted by select().
20897 hdrs="$define sys/types.h
20898 $i_systime sys/time.h
20899 $i_sysselct sys/select.h
20900 $d_socket sys/socket.h"
20901 : The first arg can be int, unsigned, or size_t
20902 : The last arg may or may not be 'const'
20904 : void pointer has been seen but using that
20905 : breaks the selectminbits test
20906 for xxx in 'fd_set *' 'int *'; do
20907 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
20908 for tmo in 'struct timeval *' 'const struct timeval *'; do
20910 '') try="$extern_C select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
20911 if ./protochk "$try" $hdrs; then
20912 echo "Your system accepts $xxx."
20921 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
20922 case "$d_fd_set" in
20923 $define) dflt="fd_set *" ;;
20932 *) : no select, so pick a harmless default
20939 : check for the select 'width'
20940 case "$selectminbits" in
20941 '') safebits=`expr $ptrsize \* 8`
20942 case "$d_select" in
20946 Checking to see on how many bits at a time your select() operates...
20949 #include <sys/types.h>
20951 #$i_systime I_SYS_TIME
20952 #$i_systimek I_SYS_TIME_KERNEL
20957 # ifdef I_SYS_TIME_KERNEL
20960 # include <sys/time.h>
20961 # ifdef I_SYS_TIME_KERNEL
20965 #$i_sysselct I_SYS_SELECT
20966 #ifdef I_SYS_SELECT
20967 #include <sys/select.h>
20969 #$d_socket HAS_SOCKET
20971 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
20974 #$i_stdlib I_STDLIB
20976 #include <stdlib.h>
20979 #define S sizeof(*(b))
20981 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
20982 #define NBITS (NBYTES * 8)
20984 char *s = (char *)malloc(NBYTES);
20993 fp = fopen("try.c", "r");
20999 b = ($selecttype)s;
21000 for (i = 0; i < NBITS; i++)
21004 select(fd + 1, b, 0, 0, &t);
21005 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
21007 printf("%d\n", i + 1);
21012 if eval $compile_ok; then
21013 selectminbits=`$run ./try`
21014 case "$selectminbits" in
21016 Cannot figure out on how many bits at a time your select() operates.
21017 I'll play safe and guess it is $safebits bits.
21019 selectminbits=$safebits
21020 bits="$safebits bits"
21023 *) bits="$selectminbits bits" ;;
21025 echo "Your select() operates on $bits at a time." >&4
21027 rp='What is the minimum number of bits your select() operates on?'
21028 case "$byteorder" in
21029 12345678) dflt=64 ;;
21035 selectminbits="$val"
21039 *) : no select, so pick a harmless default
21040 selectminbits=$safebits
21046 : Trace out the files included by signal.h, then look for SIGxxx names.
21047 if [ "X$fieldn" = X ]; then
21048 : Just make some guesses. We check them later.
21049 xxx="$sysroot/usr/include/signal.h $sysroot/usr/include/sys/signal.h"
21051 xxx=`echo '#include <signal.h>' |
21052 $cppstdin $cppminus $cppflags 2>/dev/null |
21053 $grep '^[ ]*#.*include' |
21054 $awk "{print \\$$fieldn}" | $sed 's!"!!g' |\
21055 $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
21058 for xx in $xxx /dev/null ; do
21059 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
21061 case "$xxxfiles" in
21062 '') xxxfiles=`./findhdr signal.h` ;;
21065 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
21066 print substr($2, 4, 20)
21068 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
21069 print substr($3, 4, 20)
21071 : Append some common names just in case the awk scan failed.
21072 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
21073 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
21074 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
21075 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
21076 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
21078 : generate a few handy files for later
21079 $cat > signal.c <<EOCP
21080 #include <sys/types.h>
21081 #include <signal.h>
21082 #$i_stdlib I_STDLIB
21084 #include <stdlib.h>
21089 /* Strange style to avoid deeply-nested #if/#else/#endif */
21092 # define NSIG (_NSIG)
21098 # define NSIG (SIGMAX+1)
21104 # define NSIG (SIG_MAX+1)
21110 # define NSIG (_SIG_MAX+1)
21116 # define NSIG (MAXSIG+1)
21122 # define NSIG (MAX_SIG+1)
21127 # ifdef SIGARRAYSIZE
21128 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
21134 # define NSIG (_sys_nsig) /* Solaris 2.5 */
21138 /* Default to some arbitrary number that's big enough to get most
21139 of the common signals.
21145 printf("NSIG %d\n", NSIG);
21151 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
21153 printf "#ifdef SIG"; printf $1; printf "\n"
21154 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
21155 printf $1; printf ");\n"
21159 printf "#endif /* JUST_NSIG */\n";
21160 printf "exit(0);\n}\n";
21163 $cat >signal.awk <<'EOP'
21164 BEGIN { ndups = 0 }
21165 $1 ~ /^NSIG$/ { nsig = $2 }
21166 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
21167 if ($2 > maxsig) { maxsig = $2 }
21168 if (sig_name[$2]) {
21169 dup_name[ndups] = $1
21170 dup_num[ndups] = $2
21182 printf("NSIG %d\n", nsig);
21183 for (n = 1; n < nsig; n++) {
21185 printf("%s %d\n", sig_name[n], sig_num[n])
21188 printf("NUM%d %d\n", n, n)
21191 for (n = 0; n < ndups; n++) {
21192 printf("%s %d\n", dup_name[n], dup_num[n])
21196 $cat >signal_cmd <<EOS
21198 if $test -s signal.lst; then
21199 echo "Using your existing signal.lst file"
21204 $cat >>signal_cmd <<'EOS'
21207 if eval $compile_ok; then
21208 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) |\
21209 $uniq | $awk -f signal.awk >signal.lst
21211 echo "(I can't seem be able to compile the whole test program)" >&4
21212 echo "(I'll try it in little pieces.)" >&4
21213 set signal -DJUST_NSIG
21214 if eval $compile_ok; then
21215 $run ./signal$_exe > signal.nsg
21218 echo "I can't seem to figure out how many signals you have." >&4
21219 echo "Guessing 50." >&4
21220 echo 'NSIG 50' > signal.nsg
21222 : Now look at all the signal names, one at a time.
21223 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
21224 $cat > signal.c <<EOCP
21225 #include <sys/types.h>
21226 #include <signal.h>
21229 printf("$xx %d\n", SIG${xx});
21234 if eval $compile; then
21235 echo "SIG${xx} found."
21236 $run ./signal$_exe >> signal.ls1
21238 echo "SIG${xx} NOT found."
21241 if $test -s signal.ls1; then
21242 $cat signal.nsg signal.ls1 |
21243 $sort -n | $uniq | $awk -f signal.awk >signal.lst
21247 if $test -s signal.lst; then
21250 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
21251 echo 'kill -l' >signal
21252 set X `csh -f <signal`
21256 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
21258 echo $@ | $tr ' ' $trnl | \
21259 $awk '{ printf "%s %d\n", $1, ++s; }
21260 END { printf "NSIG %d\n", ++s }' >signal.lst
21262 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
21264 chmod a+x signal_cmd
21265 $eunicefix signal_cmd
21267 : generate list of signal names
21269 case "$sig_name_init" in
21271 *) case "$sig_num_init" in
21272 ''|*,*) doinit=yes ;;
21277 echo "Generating a list of signal names and numbers..." >&4
21279 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
21280 sig_name=`$awk 'BEGIN { printf "ZERO " }
21281 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
21282 sig_num=`$awk 'BEGIN { printf "0 " }
21283 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
21284 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
21285 !/^NSIG/ { printf "\"%s\", ", $1 }
21286 END { printf "0\n" }' signal.lst`
21287 sig_num_init=`$awk 'BEGIN { printf "0, " }
21288 !/^NSIG/ { printf "%d, ", $2}
21289 END { printf "0\n"}' signal.lst`
21292 echo "The following $sig_count signals are available:"
21294 echo $sig_name | $awk \
21295 'BEGIN { linelen = 0 }
21297 for (i = 1; i <= NF; i++) {
21298 name = "SIG" $i " "
21299 linelen = linelen + length(name)
21300 if (linelen > 70) {
21302 linelen = length(name)
21308 sig_size=`echo $sig_name | awk '{print NF}'`
21309 $rm -f signal signal.c signal.awk signal.lst signal_cmd
21311 : Check size of size
21313 case "$sizetype" in
21314 *_t) zzz="$sizetype" ;;
21315 *) zzz="filesize" ;;
21317 echo "Checking the size of $zzz..." >&4
21319 #include <sys/types.h>
21321 #$i_stdlib I_STDLIB
21323 #include <stdlib.h>
21326 printf("%d\n", (int)sizeof($sizetype));
21331 if eval $compile_ok; then
21335 echo "(I can't execute the test program--guessing $sizesize.)" >&4
21338 echo "Your $zzz size is $sizesize bytes."
21343 echo "(I can't compile the test program--guessing $sizesize.)" >&4
21347 : check for socklen_t
21349 echo "Checking to see if you have socklen_t..." >&4
21351 #include <sys/types.h>
21352 #$d_socket HAS_SOCKET
21354 #include <sys/socket.h>
21356 int main() { socklen_t x = 16; }
21359 if eval $compile; then
21361 echo "You have socklen_t."
21364 echo "You do not have socklen_t."
21365 case "$sizetype" in
21366 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
21373 : see if this is a socks.h system
21374 set socks.h i_socks
21377 : check for type of the size argument to socket calls
21378 case "$d_socket" in
21382 Checking to see what type is the last argument of accept().
21385 case "$d_socklen_t" in
21386 "$define") yyy="$yyy socklen_t"
21388 yyy="$yyy $sizetype int long unsigned"
21389 for xxx in $yyy; do
21390 case "$socksizetype" in
21391 '') try="$extern_C int accept(int, struct sockaddr *, $xxx *);"
21392 case "$usesocks" in
21394 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
21395 echo "Your system accepts '$xxx *' for the last argument of accept()."
21396 socksizetype="$xxx"
21399 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
21400 echo "Your system accepts '$xxx *' for the last argument of accept()."
21401 socksizetype="$xxx"
21408 : In case none of those worked, prompt the user.
21409 case "$socksizetype" in
21410 '') rp='What is the type for socket address structure sizes?'
21417 *) : no sockets, so pick relatively harmless default
21422 : see what type is used for signed size_t
21423 set ssize_t ssizetype int stdio.h sys/types.h
21428 #$i_stdlib I_STDLIB
21430 #include <stdlib.h>
21432 #include <sys/types.h>
21433 #define Size_t $sizetype
21434 #define SSize_t $dflt
21437 if (sizeof(Size_t) == sizeof(SSize_t))
21439 else if (sizeof(Size_t) == sizeof(int))
21448 if eval $compile_ok && $run ./try > /dev/null; then
21449 ssizetype=`$run ./try`
21450 echo "I'll be using $ssizetype for functions returning a byte count." >&4
21453 Help! I can't compile and run the ssize_t test program: please enlighten me!
21454 (This is probably a misconfiguration in your system or libraries, and
21455 you really ought to fix it. Still, I'll try anyway.)
21457 I need a type that is the same size as $sizetype, but is guaranteed to
21458 be signed. Common values are ssize_t, int and long.
21461 rp="What signed type is the same size as $sizetype?"
21467 : Check the size of st_ino
21469 $echo "Checking the size of st_ino..." >&4
21470 $cat > try.c <<EOCP
21471 #include <sys/stat.h>
21473 #$i_stdlib I_STDLIB
21475 #include <stdlib.h>
21479 printf("%d\n", (int)sizeof(st.st_ino));
21484 if eval $compile_ok; then
21488 $echo "(I can't execute the test program--guessing $st_ino_size.)" >&4
21490 *) st_ino_size=$val
21491 $echo "Your st_ino is $st_ino_size bytes long."
21496 $echo "(I can't compile the test program--guessing $st_ino_size.)" >&4
21500 : Check if st_ino is signed
21502 $echo "Checking the sign of st_ino..." >&4
21503 $cat > try.c <<EOCP
21504 #include <sys/stat.h>
21509 if (foo.st_ino < 0)
21516 if eval $compile; then
21520 $echo "(I can't execute the test program--guessing unsigned.)" >&4
21522 *) st_ino_sign=$val
21523 case "$st_ino_sign" in
21524 1) $echo "Your st_ino is unsigned." ;;
21525 -1) $echo "Your st_ino is signed." ;;
21531 $echo "(I can't compile the test program--guessing unsigned.)" >&4
21535 : see what type of char stdio uses.
21537 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
21538 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
21539 echo "Your stdio uses unsigned chars." >&4
21540 stdchar="unsigned char"
21542 echo "Your stdio uses signed chars." >&4
21547 : see what type uids are declared as in the kernel
21549 echo "Looking for the type for user ids returned by getuid()."
21550 set uid_t uidtype xxx stdio.h sys/types.h
21554 xxx=`./findhdr sys/user.h`
21555 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
21557 unsigned) dflt="$1 $2" ;;
21561 *) dflt="$uidtype";;
21564 uid_t) echo "uid_t found." ;;
21565 *) rp="What is the type for user ids returned by getuid()?"
21571 : Check size of UID
21574 *_t) zzz="$uidtype" ;;
21577 echo "Checking the size of $zzz..." >&4
21579 #include <sys/types.h>
21581 #$i_stdlib I_STDLIB
21583 #include <stdlib.h>
21586 printf("%d\n", (int)sizeof($uidtype));
21591 if eval $compile_ok; then
21595 echo "(I can't execute the test program--guessing $uidsize.)" >&4
21598 echo "Your $zzz is $uidsize bytes long."
21603 echo "(I can't compile the test program--guessing $uidsize.)" >&4
21606 : Check if UID is signed
21609 *_t) zzz="$uidtype" ;;
21612 echo "Checking the sign of $zzz..." >&4
21614 #include <sys/types.h>
21625 if eval $compile; then
21629 echo "(I can't execute the test program--guessing unsigned.)" >&4
21633 1) echo "Your $zzz is unsigned." ;;
21634 -1) echo "Your $zzz is signed." ;;
21640 echo "(I can't compile the test program--guessing unsigned.)" >&4
21644 : Check format string for UID
21646 $echo "Checking the format string to be used for uids..." >&4
21649 -1) if $test X"$uidsize" = X"$ivsize"; then
21650 uidformat="$ivdformat"
21652 if $test X"$uidsize" = X"$longsize"; then
21655 if $test X"$uidsize" = X"$intsize"; then
21658 if $test X"$uidsize" = X"$shortsize"; then
21665 *) if $test X"$uidsize" = X"$uvsize"; then
21666 uidformat="$uvuformat"
21668 if $test X"$uidsize" = X"$longsize"; then
21671 if $test X"$uidsize" = X"$intsize"; then
21674 if $test X"$uidsize" = X"$shortsize"; then
21683 : Determine if we can use sysctl with KERN_PROC_PATHNAME to find executing program
21685 echo "Determining whether we can use sysctl with KERN_PROC_PATHNAME to find executing program..." >&4
21686 $cat >try.c <<'EOM'
21687 /* Intentionally a long probe as I'd like to sanity check that the exact
21688 approach is going to work, as thinking it will work, but only having it
21689 part working at runtime is worse than not having it. */
21691 #include <sys/types.h>
21692 #include <sys/sysctl.h>
21693 #include <sys/param.h>
21695 #include <string.h>
21696 #include <stdlib.h>
21697 #include <unistd.h>
21700 main(int argc, char **argv) {
21702 char *argv_leaf = strrchr(argv[0], '/');
21708 mib[1] = KERN_PROC;
21709 mib[2] = KERN_PROC_PATHNAME;
21713 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
21717 if (sysctl(mib, 4, NULL, &size, NULL, 0)) {
21722 if (size < strlen(argv_leaf) + 1) {
21723 fprintf(stderr, "size %lu is too short for a path\n",
21724 (unsigned long) size);
21728 if (size > MAXPATHLEN * MAXPATHLEN) {
21729 fprintf(stderr, "size %lu is too long for a path\n",
21730 (unsigned long) size);
21734 buffer = malloc(size);
21740 if (sysctl(mib, 4, buffer, &size, NULL, 0)) {
21745 if (strlen(buffer) + 1 != size) {
21746 fprintf(stderr, "size != strlen(buffer) + 1 (%lu != %lu)\n",
21747 (unsigned long)size, (unsigned long)strlen(buffer) + 1);
21752 if (*buffer != '/') {
21753 fprintf(stderr, "Not an absolute path: '%s'\n", buffer);
21757 if (strstr(buffer, "/./")) {
21758 fprintf(stderr, "Contains /./: '%s'\n", buffer);
21762 if (strstr(buffer, "/../")) {
21763 fprintf(stderr, "Contains /../: '%s'\n", buffer);
21767 buffer_leaf = strrchr(buffer, '/');
21768 if (strcmp(buffer_leaf, argv_leaf) != 0) {
21769 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], buffer);
21781 if eval $compile; then
21782 if $run ./try; then
21783 echo "You can use sysctl with KERN_PROC_PATHNAME to find the executing program." >&4
21786 echo "Nope, sysctl with KERN_PROC_PATHNAME doesn't work here." >&4
21790 echo "I'm unable to compile the test program." >&4
21791 echo "I'll assume no sysctl with KERN_PROC_PATHNAME here." >&4
21795 set usekernprocpathname
21798 : Determine if we can use _NSGetExecutablePath to find executing program
21800 echo "Determining whether we can use _NSGetExecutablePath to find executing program..." >&4
21801 $cat >try.c <<'EOM'
21802 /* Intentionally a long probe as I'd like to sanity check that the exact
21803 approach is going to work, as thinking it will work, but only having it
21804 part working at runtime is worse than not having it. */
21805 #include <mach-o/dyld.h>
21807 #include <stdlib.h>
21808 #include <sys/param.h>
21809 #include <string.h>
21812 main(int argc, char **argv) {
21814 uint32_t size = sizeof(buf);
21818 char *argv_leaf = strrchr(argv[0], '/');
21822 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
21826 _NSGetExecutablePath(buf, &size);
21827 if (size > MAXPATHLEN * MAXPATHLEN) {
21828 fprintf(stderr, "_NSGetExecutablePath size %u is too long for a path\n",
21829 (unsigned int) size);
21833 buffer = malloc(size);
21839 result = _NSGetExecutablePath(buffer, &size);
21841 fprintf(stderr, "_NSGetExecutablePath returned %i for a size of %u\n",
21842 result, (unsigned int) size);
21846 tidied = realpath(buffer, NULL);
21848 perror("realpath");
21854 if (*tidied != '/') {
21855 fprintf(stderr, "Not an absolute path: '%s'\n", tidied);
21859 if (strstr(tidied, "/./")) {
21860 fprintf(stderr, "Contains /./: '%s'\n", tidied);
21864 if (strstr(tidied, "/../")) {
21865 fprintf(stderr, "Contains /../: '%s'\n", tidied);
21869 tidied_leaf = strrchr(tidied, '/');
21870 if (strcmp(tidied_leaf, argv_leaf) != 0) {
21871 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], tidied);
21883 if eval $compile; then
21884 if $run ./try; then
21885 echo "You can use _NSGetExecutablePath to find the executing program." >&4
21888 echo "Nope, _NSGetExecutablePath doesn't work here." >&4
21891 echo "I'm unable to compile the test program." >&4
21892 echo "I'll assume no _NSGetExecutablePath here." >&4
21895 set usensgetexecutablepath
21898 : Check if site customization support was requested
21899 case "$usesitecustomize" in
21900 $define|true|[Yy]*)
21901 usesitecustomize="$define"
21904 usesitecustomize="$undef"
21908 : see if prototypes support variable argument declarations
21910 case "$prototype$i_stdarg" in
21912 echo "It appears we'll be able to prototype varargs functions." >&4
21916 echo "Too bad... We won't be using prototyped varargs functions..." >&4
21923 : determine compiler compiler
21932 if $test -f "$byacc$_exe"; then
21934 comp="byacc or $comp"
21936 if $test -f "$bison$_exe"; then
21937 comp="$comp or bison -y"
21939 rp="Which compiler compiler ($comp) shall I use?"
21948 echo "(Adding -y option to bison to get yacc-compatible behavior.)"
21954 : see if this is a assert.h system
21955 set assert.h i_assert
21958 : see if this is a bfd.h system
21962 : see if this is a fp.h system
21966 : see if this is a fp_class.h system
21967 set fp_class.h i_fp_class
21970 : see if gdbm.h is available
21975 : see if gdbm_open exists
21976 set gdbm_open d_gdbm_open
21978 case "$d_gdbm_open" in
21981 echo "We won't be including <gdbm.h>"
21990 : see if this is a ieeefp.h system
21991 case "$i_ieeefp" in
21992 '' ) set ieeefp.h i_ieeefp
21997 : see if this is a libutil.h system
21998 set libutil.h i_libutil
22001 : see if mach cthreads are available
22002 if test "X$usethreads" = "X$define"; then
22003 set mach/cthreads.h i_machcthr
22006 i_machcthr="$undef"
22009 : see if this is a mntent.h system
22010 set mntent.h i_mntent
22013 : see if net/errno.h is available
22015 set net/errno.h val
22018 : Unfortunately, it causes problems on some systems. Arrgh.
22021 cat > try.c <<'EOM'
22024 #include <net/errno.h>
22030 if $cc $ccflags -c try.c >/dev/null 2>&1; then
22031 echo "We'll be including <net/errno.h>." >&4
22033 echo "We won't be including <net/errno.h>." >&4
22042 : see if netinet/tcp.h is available
22043 set netinet/tcp.h i_netinettcp
22046 : see if this is a poll.h system
22050 : see if this is a prot.h system
22054 : Preprocessor symbols
22056 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
22057 $cat <<'EOSH' > Cppsym.know
22058 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
22059 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
22060 alliant alpha am29000 AM29000 AMD64 amd64 amiga AMIGAOS AMIX
22061 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
22062 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
22063 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
22064 bull c cadmus clipper CMU COFF COMPILER_VERSION
22065 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
22066 CYGWIN DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
22067 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
22068 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
22070 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
22071 H3050R H3050RX hbullx20 hcx host_mips
22072 hp200 hp300 hp700 HP700 hp800 hp9000
22073 hp9000s200 hp9000s300 hp9000s400 hp9000s500
22074 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
22075 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
22076 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
22077 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
22078 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
22079 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
22080 LIBCATAMOUNT Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
22081 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
22082 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
22083 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
22084 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
22085 MATH_HAS_NO_SIDE_EFFECTS
22086 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
22087 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
22088 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
22089 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
22090 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
22091 NetBSD news1500 news1700 news1800 news1900 news3700
22092 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
22093 ns32016 ns32332 ns32k nsc32000
22094 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
22095 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
22096 pc532 pdp11 PGC PIC plexus PORTAR posix
22097 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
22098 POSIX_C_SOURCE POSIX_SOURCE POWER
22099 PROTOTYPES PWB pyr QNX QK_USER R3000 REENTRANT RES Rhapsody RISC6000
22100 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
22101 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
22102 sony sony_news sonyrisc sparc sparclite spectrum
22103 stardent stdc STDC_EXT stratos sun sun3 sun386
22104 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
22105 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
22106 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
22107 sysV68 sysV88 Tek4132 Tek4300 titan
22108 TM3200 TM5400 TM5600
22109 tower tower32 tower32_200 tower32_600 tower32_700
22110 tower32_800 tower32_850 tss
22111 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
22112 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
22113 unix UNIX95 UNIX99 unixpc unos
22114 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
22115 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
22116 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
22118 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms x86_64 xenix Xenix286
22119 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
22120 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
22123 # Maybe put other stuff here too.
22124 cat <<EOSH >>Cppsym.know
22127 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
22128 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
22129 $cat Cppsym.know > Cppsym.c
22130 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
22131 $rm -f Cppsym.a Cppsym.b Cppsym.c
22132 cat <<EOSH > Cppsym
22134 if $test \$# -gt 0; then
22135 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
22136 if $test -s Cppsym.got; then
22143 $tr " " "$trnl" | ./Cppsym.try
22149 cat <<EOSH > Cppsym.try
22151 cat <<'EOCP' > try.c
22154 #define STRINGIFY(a) "a"
22156 #if cpp_stuff == 42
22157 #define StGiFy(a) #a
22158 #define STRINGIFY(a) StGiFy(a)
22160 #if $cpp_stuff != 1 && $cpp_stuff != 42
22161 # include "Bletch: How does this C preprocessor stringify macros?"
22167 cat <<'EOSH' >> Cppsym.try
22169 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
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
22174 echo 'return 0;}' >> try.c
22176 cat <<EOSH >> Cppsym.try
22178 case "$osname-$gccversion" in
22179 irix-) ccflags="\$ccflags -woff 1178" ;;
22180 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
22182 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
22184 chmod +x Cppsym.try
22185 $eunicefix Cppsym.try
22186 ./Cppsym < Cppsym.know | $sort | $uniq > Cppsym.true
22187 : Add in any Linux cpp "predefined macros":
22188 case "$osname::$gccversion" in
22189 *linux*::*.*|*gnukfreebsd*::*.*|gnu::*.*)
22191 rm -f $tHdrH'.h' $tHdrH
22193 # Filter out macro arguments, such as Linux's __INT8_C(c)
22194 if $cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
22195 sed -e 's/#define[\ \ ]*//;s/[\ \ ].*$//' -e 's/(.*//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
22196 if [ -s $tHdrH'_cppsym.real' ]; then
22197 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
22200 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
22203 : now check the C compiler for additional symbols
22204 postprocess_cc_v=''
22206 aix) postprocess_cc_v="|$tr , ' '" ;;
22213 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
22216 -D*) echo "\$i" | $sed 's/^-D//';;
22217 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
22222 postprocess_cc_v=''
22225 ./ccsym > ccsym1.raw
22226 if $test -s ccsym1.raw; then
22227 $sort ccsym1.raw | $uniq >ccsym.raw
22229 mv ccsym1.raw ccsym.raw
22232 $awk '/\=/ { print $0; next }
22233 { print $0"=1" }' ccsym.raw >ccsym.list
22234 $comm -13 Cppsym.true ccsym.list >ccsym.own
22235 $comm -12 Cppsym.true ccsym.list >ccsym.com
22236 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
22238 if $test -z ccsym.raw; then
22239 echo "Your C compiler doesn't seem to define any symbols!" >&4
22241 echo "However, your C preprocessor defines the following symbols:"
22244 cppsymbols=`$cat Cppsym.true`
22245 cppsymbols=`echo $cppsymbols`
22246 cppccsymbols="$cppsymbols"
22248 if $test -s ccsym.com; then
22249 echo "Your C compiler and pre-processor define these symbols:"
22250 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
22253 cppccsymbols=`$cat ccsym.com`
22254 cppccsymbols=`echo $cppccsymbols`
22255 $test "$silent" || sleep 1
22257 if $test -s ccsym.cpp; then
22258 $test "$also" && echo " "
22259 echo "Your C pre-processor ${also}defines the following symbols:"
22260 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
22262 cppsymbols=`$cat ccsym.cpp`
22263 cppsymbols=`echo $cppsymbols`
22264 $test "$silent" || sleep 1
22266 if $test -s ccsym.own; then
22267 $test "$also" && echo " "
22268 echo "Your C compiler ${also}defines the following cpp symbols:"
22269 $sed -e 's/\(..*\)=1/\1/' ccsym.own
22270 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
22271 ccsymbols=`$cat ccsym.own`
22272 ccsymbols=`echo $ccsymbols`
22273 $test "$silent" || sleep 1
22277 : see if this is a termio system
22281 if $test `./findhdr termios.h`; then
22282 set tcsetattr i_termios
22288 "$define") echo "You have POSIX termios.h... good!" >&4;;
22289 *) if ./Cppsym pyr; then
22290 case "`$run /bin/universe`" in
22291 ucb) if $test `./findhdr sgtty.h`; then
22293 echo "<sgtty.h> found." >&4
22295 echo "System is pyramid with BSD universe."
22296 ./warn "<sgtty.h> not found--you could have problems."
22298 *) if $test `./findhdr termio.h`; then
22300 echo "<termio.h> found." >&4
22302 echo "System is pyramid with USG universe."
22303 ./warn "<termio.h> not found--you could have problems."
22307 if $test `./findhdr termio.h`; then
22308 echo "<termio.h> found." >&4
22310 elif $test `./findhdr sgtty.h`; then
22311 echo "<sgtty.h> found." >&4
22314 ./warn "Neither <termio.h> nor <sgtty.h> found--cross fingers!"
22317 if $test `./findhdr sgtty.h`; then
22318 echo "<sgtty.h> found." >&4
22320 elif $test `./findhdr termio.h`; then
22321 echo "<termio.h> found." >&4
22324 ./warn "Neither <sgtty.h> nor <termio.h> found--cross fingers!"
22328 set i_termio; eval $setvar
22329 val=$val2; set i_sgtty; eval $setvar
22330 val=$val3; set i_termios; eval $setvar
22332 : see if stdbool is available
22333 : we want a real compile instead of Inhdr because some Solaris systems
22334 : have stdbool.h, but it can only be used if the compiler indicates it
22335 : is sufficiently c99-compliant.
22339 #include <stdbool.h>
22344 int main(int argc, char **argv)
22350 if eval $compile; then
22351 echo "<stdbool.h> found." >&4
22354 echo "<stdbool.h> NOT found." >&4
22361 : see if stddef is available
22362 set stddef.h i_stddef
22365 : see if sys/access.h is available
22366 set sys/access.h i_sysaccess
22369 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
22370 set sys/filio.h i_sysfilio
22373 if $test `./findhdr sys/ioctl.h`; then
22375 echo '<sys/ioctl.h> found.' >&4
22378 if $test $i_sysfilio = "$define"; then
22379 echo '<sys/ioctl.h> NOT found.' >&4
22381 $test $i_sgtty = "$define" && xxx="sgtty.h"
22382 $test $i_termio = "$define" && xxx="termio.h"
22383 $test $i_termios = "$define" && xxx="termios.h"
22384 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
22390 : see if socket ioctl defs are in sys/sockio.h
22392 xxx=`./findhdr sys/sockio.h`
22393 if $test "$xxx"; then
22394 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
22396 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
22399 echo "No socket ioctls found in <sys/sockio.h>." >&4
22404 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
22410 : see if this is a syslog.h system
22411 set syslog.h i_syslog
22414 : see if this is a sys/mode.h system
22415 set sys/mode.h i_sysmode
22418 : see if there is a sys/poll.h file
22419 set sys/poll.h i_syspoll
22422 : see if sys/resource.h has to be included
22423 set sys/resource.h i_sysresrc
22426 : see if sys/security.h is available
22427 set sys/security.h i_syssecrt
22430 : see if this is a sys/statvfs.h system
22431 set sys/statvfs.h i_sysstatvfs
22434 : see if this is a sys/un.h system
22435 set sys/un.h i_sysun
22438 : see if this is a sys/utsname.h system
22439 set sys/utsname.h i_sysutsname
22442 : see if this is a syswait system
22443 set sys/wait.h i_syswait
22446 : see if this is a ustat.h system
22447 set ustat.h i_ustat
22450 : see if this is an utime system
22451 set utime.h i_utime
22454 : see if this is a vfork system
22457 set vfork.h i_vfork
22467 echo "Looking for extensions..." >&4
22468 : If we are using the old config.sh, nonxs_extensions and xs_extensions may
22469 : contain old or inaccurate or duplicate values.
22470 nonxs_extensions=''
22472 : We do not use find because it might not be available.
22473 : We do not just use MANIFEST because the user may have dropped
22474 : some additional extensions into the source tree and expect them
22477 : Function to recursively find available extensions, ignoring DynaLoader
22478 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
22479 : In 5.10.1 and later, extensions are stored in directories
22480 : like File-Glob instead of the older File/Glob/.
22484 DynaLoader|dynaload) ;;
22486 this_ext=`echo $xxx | $sed -e s/-/\\\//g`;
22487 case "$this_ext" in
22488 Scalar/List/Utils) this_ext="List/Util" ;;
22489 PathTools) this_ext="Cwd" ;;
22491 echo " $xs_extensions $nonxs_extensions" > $$.tmp;
22492 if $contains " $this_ext " $$.tmp; then
22494 echo "Duplicate directories detected for extension $xxx" >&4;
22495 echo "Configure cannot correctly recover from this - shall I abort?" >&4;
22496 case "$knowitall" in
22504 echo "Ok. Stopping Configure." >&4;
22505 echo "Please remove the duplicate directory (e.g. using git clean) and then re-run Configure" >&4;
22508 echo "Ok. You will need to correct config.sh before running make." >&4;
22510 $ls -1 $xxx > $$.tmp;
22511 if $contains "\.xs$" $$.tmp > /dev/null 2>&1; then
22512 xs_extensions="$xs_extensions $this_ext";
22513 elif $contains "\.c$" $$.tmp > /dev/null 2>&1; then
22514 xs_extensions="$xs_extensions $this_ext";
22515 elif $test -d $xxx; then
22516 nonxs_extensions="$nonxs_extensions $this_ext";
22526 eval $find_extensions
22530 eval $find_extensions
22534 eval $find_extensions
22535 set X $xs_extensions
22537 xs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
22538 set X $nonxs_extensions
22540 nonxs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
22542 known_extensions=`echo $nonxs_extensions $xs_extensions | tr ' ' $trnl | $sort | tr $trnl ' '`
22544 : Now see which are supported on this system.
22546 for xxx in $xs_extensions ; do
22550 $define) avail_ext="$avail_ext $xxx" ;;
22553 GDBM_File|gdbm_fil)
22555 $define) avail_ext="$avail_ext $xxx" ;;
22558 I18N/Langinfo|i18n_lan)
22559 case "$i_langinfo$d_nl_langinfo" in
22560 $define$define) avail_ext="$avail_ext $xxx" ;;
22564 : XXX Do we need a useipcsysv variable here
22565 case "${d_msg}${d_sem}${d_shm}" in
22566 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
22569 NDBM_File|ndbm_fil)
22572 case "$osname-$use64bitint" in
22575 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
22578 *) avail_ext="$avail_ext $xxx" ;;
22583 ODBM_File|odbm_fil)
22584 case "${i_dbm}${i_rpcsvcdbm}" in
22586 case "$d_cplusplus" in
22587 define) ;; # delete as a function name will not work
22588 *) case "$osname-$use64bitint" in
22591 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
22594 *) avail_ext="$avail_ext $xxx" ;;
22602 case "$useopcode" in
22603 true|define|y) avail_ext="$avail_ext $xxx" ;;
22607 case "$useposix" in
22608 true|define|y) avail_ext="$avail_ext $xxx" ;;
22612 case "$d_socket" in
22613 true|$define|y) avail_ext="$avail_ext $xxx" ;;
22616 Sys/Syslog|sys/syslog)
22617 : XXX syslog requires socket
22618 case "$d_socket" in
22619 true|$define|y) avail_ext="$avail_ext $xxx" ;;
22623 case "$usethreads" in
22625 case "$use5005threads" in
22626 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
22630 threads|threads/shared)
22631 # threads and threads::shared are special cases.
22632 # To stop people from asking "Perl 5.8.0 was supposed
22633 # to have this new fancy threads implementation but my
22634 # perl doesn't have it" and from people trying to
22635 # (re)install the threads module using CPAN.pm and
22636 # CPAN.pm then offering to reinstall Perl 5.8.0,
22637 # the threads.pm and threads/shared.pm will always be
22638 # there, croaking informatively ("you need to rebuild
22639 # all of Perl with threads, sorry") when threads haven't
22640 # been compiled in.
22642 avail_ext="$avail_ext $xxx"
22648 cygwin) avail_ext="$avail_ext $xxx" ;;
22651 XS/APItest|xs/apitest)
22652 # This is just for testing. Skip it unless we have dynamic loading.
22655 $define) avail_ext="$avail_ext $xxx" ;;
22658 XS/Typemap|xs/typemap)
22659 # This is just for testing. Skip it unless we have dynamic loading.
22661 $define) avail_ext="$avail_ext $xxx" ;;
22664 *) avail_ext="$avail_ext $xxx"
22673 case "$onlyextensions" in
22675 *) keepextensions=''
22676 echo "You have requested that only certain extensions be included..." >&4
22677 for i in $onlyextensions; do
22678 case " $avail_ext " in
22680 echo "Keeping extension $i."
22681 keepextensions="$keepextensions $i"
22683 *) echo "Ignoring extension $i." ;;
22686 avail_ext="$keepextensions"
22690 case "$noextensions" in
22692 *) keepextensions=''
22693 echo "You have requested that certain extensions be ignored..." >&4
22694 for i in $avail_ext; do
22695 case " $noextensions " in
22696 *" $i "*) echo "Ignoring extension $i." ;;
22697 *) echo "Keeping extension $i.";
22698 keepextensions="$keepextensions $i"
22702 avail_ext="$keepextensions"
22706 : Now see which nonxs extensions are supported on this system.
22707 : For now assume all are.
22709 for xxx in $nonxs_extensions ; do
22713 *) nonxs_ext="$nonxs_ext $xxx"
22725 A number of extensions are supplied with $package. You may choose to
22726 compile these extensions for dynamic loading (the default), compile
22727 them into the $package executable (static loading), or not include
22728 them at all. Answer "none" to include no extensions.
22729 Note that DynaLoader is always built and need not be mentioned here.
22732 case "$dynamic_ext" in
22734 : Exclude those listed in static_ext
22736 for xxx in $avail_ext; do
22737 case " $static_ext " in
22739 *) dflt="$dflt $xxx" ;;
22746 *) dflt="$dynamic_ext"
22747 # Perhaps we are reusing an old out-of-date config.sh.
22750 if test X"$dynamic_ext" != X"$avail_ext"; then
22752 NOTICE: Your previous config.sh list may be incorrect.
22753 The extensions now available to you are
22755 but the default list from your previous config.sh is
22767 rp="What extensions do you wish to load dynamically?"
22770 none) dynamic_ext=' ' ;;
22771 *) dynamic_ext="$ans" ;;
22774 case "$static_ext" in
22776 : Exclude those already listed in dynamic linking
22778 for xxx in $avail_ext; do
22779 case " $dynamic_ext " in
22781 *) dflt="$dflt $xxx" ;;
22788 *) dflt="$static_ext"
22795 rp="What extensions do you wish to load statically?"
22798 none) static_ext=' ' ;;
22799 *) static_ext="$ans" ;;
22804 A number of extensions are supplied with $package. Answer "none"
22805 to include no extensions.
22806 Note that DynaLoader is always built and need not be mentioned here.
22809 case "$static_ext" in
22810 '') dflt="$avail_ext" ;;
22811 *) dflt="$static_ext"
22812 # Perhaps we are reusing an old out-of-date config.sh.
22815 if test X"$static_ext" != X"$avail_ext"; then
22817 NOTICE: Your previous config.sh list may be incorrect.
22818 The extensions now available to you are
22820 but the default list from your previous config.sh is
22829 : Exclude those that are not xs extensions
22833 rp="What extensions do you wish to include?"
22836 none) static_ext=' ' ;;
22837 *) static_ext="$ans" ;;
22842 # Encode is a special case. If we are building Encode as a static
22843 # extension, we need to explicitly list its subextensions as well.
22844 # For other nested extensions, this is handled automatically by
22845 # the appropriate Makefile.PL.
22846 case " $static_ext " in
22847 *" Encode "*) # Add the subextensions of Encode
22849 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
22850 static_ext="$static_ext Encode/$xxx"
22851 known_extensions="$known_extensions Encode/$xxx"
22857 set X $dynamic_ext $static_ext $nonxs_ext
22861 # Sanity check: We require an extension suitable for use with
22862 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
22863 # should show up as failures in the test suite, but it's helpful to
22864 # catch them now.) The 'extensions' list is normally sorted
22865 # alphabetically, so we need to accept either
22866 # DB_File ... Fcntl ... IO ....
22867 # or something like
22868 # Fcntl ... NDBM_File ... IO ....
22869 case " $extensions" in
22870 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
22871 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
22872 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
22873 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
22874 echo "WARNING: The Perl you are building will be quite crippled." >& 4
22878 : Remove libraries needed only for extensions
22879 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
22880 : The exception is SunOS 4.x, which needs them.
22881 case "${osname}X${osvers}" in
22885 *) case "$usedl" in
22886 $define|true|[yY]*)
22887 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
22891 *) perllibs="$libs"
22897 : Remove build directory name from cppstdin so it can be used from
22898 : either the present location or the final installed location.
22900 : Get out of the UU directory to get correct path name.
22902 case "$cppstdin" in
22904 echo "Stripping down cppstdin path name"
22910 : end of configuration questions
22912 echo "End of configuration questions."
22915 : back to where it started
22916 if test -d ../UU; then
22920 : configuration may be unconditionally patched via a 'config.arch' file
22921 if $test -f config.arch; then
22922 echo "I see a config.arch file, loading it." >&4
22926 : configuration may be patched via a 'config.over' file
22927 if $test -f config.over; then
22930 rp='I see a config.over file. Do you wish to load it?'
22933 n*) echo "OK, I'll ignore it.";;
22935 echo "Configuration override changes have been loaded."
22940 : in case they want portability, strip down executable paths
22941 case "$d_portable" in
22944 echo "Stripping down executable paths..." >&4
22945 for file in $loclist $trylist; do
22947 eval $file=`basename $temp`
22952 : create config.sh file
22954 echo "Creating config.sh..." >&4
22955 $spitshell <<EOT >config.sh
22958 # This file was produced by running the Configure script. It holds all the
22959 # definitions figured out by Configure. Should you modify one of these values,
22960 # do not forget to propagate your changes by running "Configure -der". You may
22961 # instead choose to run each of the .SH files by yourself, or "Configure -S".
22964 # Package name : $package
22965 # Source directory : $src
22966 # Configuration time: $cf_time
22967 # Configured by : $cf_by
22968 # Target system : $myuname
22971 : Add in command line options if available
22972 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
22974 $spitshell <<EOT >>config.sh
22983 Revision='$Revision'
22991 alignbytes='$alignbytes'
22992 ansi2knr='$ansi2knr'
22993 aphostname='$aphostname'
22994 api_revision='$api_revision'
22995 api_subversion='$api_subversion'
22996 api_version='$api_version'
22997 api_versionstring='$api_versionstring'
23000 archlibexp='$archlibexp'
23001 archname64='$archname64'
23002 archname='$archname'
23003 archobjs='$archobjs'
23004 asctime_r_proto='$asctime_r_proto'
23013 byteorder='$byteorder'
23015 castflags='$castflags'
23018 cccdlflags='$cccdlflags'
23019 ccdlflags='$ccdlflags'
23021 ccflags_uselargefiles='$ccflags_uselargefiles'
23023 ccsymbols='$ccsymbols'
23024 ccversion='$ccversion'
23026 cf_email='$cf_email'
23028 charbits='$charbits'
23029 charsize='$charsize'
23033 clocktype='$clocktype'
23035 compress='$compress'
23036 contains='$contains'
23040 cpp_stuff='$cpp_stuff'
23041 cppccsymbols='$cppccsymbols'
23042 cppflags='$cppflags'
23044 cppminus='$cppminus'
23046 cppstdin='$cppstdin'
23047 cppsymbols='$cppsymbols'
23048 crypt_r_proto='$crypt_r_proto'
23049 cryptlib='$cryptlib'
23051 ctermid_r_proto='$ctermid_r_proto'
23052 ctime_r_proto='$ctime_r_proto'
23053 d_Gconvert='$d_Gconvert'
23054 d_PRIEUldbl='$d_PRIEUldbl'
23055 d_PRIFUldbl='$d_PRIFUldbl'
23056 d_PRIGUldbl='$d_PRIGUldbl'
23057 d_PRIXU64='$d_PRIXU64'
23058 d_PRId64='$d_PRId64'
23059 d_PRIeldbl='$d_PRIeldbl'
23060 d_PRIfldbl='$d_PRIfldbl'
23061 d_PRIgldbl='$d_PRIgldbl'
23062 d_PRIi64='$d_PRIi64'
23063 d_PRIo64='$d_PRIo64'
23064 d_PRIu64='$d_PRIu64'
23065 d_PRIx64='$d_PRIx64'
23066 d_SCNfldbl='$d_SCNfldbl'
23067 d__fwalk='$d__fwalk'
23068 d_access='$d_access'
23069 d_accessx='$d_accessx'
23072 d_archlib='$d_archlib'
23073 d_asctime64='$d_asctime64'
23074 d_asctime_r='$d_asctime_r'
23077 d_attribute_deprecated='$d_attribute_deprecated'
23078 d_attribute_format='$d_attribute_format'
23079 d_attribute_malloc='$d_attribute_malloc'
23080 d_attribute_nonnull='$d_attribute_nonnull'
23081 d_attribute_noreturn='$d_attribute_noreturn'
23082 d_attribute_pure='$d_attribute_pure'
23083 d_attribute_unused='$d_attribute_unused'
23084 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
23088 d_bsdgetpgrp='$d_bsdgetpgrp'
23089 d_bsdsetpgrp='$d_bsdsetpgrp'
23090 d_builtin_choose_expr='$d_builtin_choose_expr'
23091 d_builtin_expect='$d_builtin_expect'
23093 d_c99_variadic_macros='$d_c99_variadic_macros'
23094 d_casti32='$d_casti32'
23095 d_castneg='$d_castneg'
23096 d_charvspr='$d_charvspr'
23098 d_chroot='$d_chroot'
23099 d_chsize='$d_chsize'
23101 d_clearenv='$d_clearenv'
23102 d_closedir='$d_closedir'
23103 d_cmsghdr_s='$d_cmsghdr_s'
23105 d_copysignl='$d_copysignl'
23106 d_cplusplus='$d_cplusplus'
23108 d_crypt_r='$d_crypt_r'
23110 d_ctermid='$d_ctermid'
23111 d_ctermid_r='$d_ctermid_r'
23112 d_ctime64='$d_ctime64'
23113 d_ctime_r='$d_ctime_r'
23114 d_cuserid='$d_cuserid'
23115 d_dbl_dig='$d_dbl_dig'
23116 d_dbminitproto='$d_dbminitproto'
23117 d_difftime64='$d_difftime64'
23118 d_difftime='$d_difftime'
23119 d_dir_dd_fd='$d_dir_dd_fd'
23121 d_dirnamlen='$d_dirnamlen'
23122 d_dladdr='$d_dladdr'
23123 d_dlerror='$d_dlerror'
23124 d_dlopen='$d_dlopen'
23125 d_dlsymun='$d_dlsymun'
23126 d_backtrace='$d_backtrace'
23127 d_dosuid='$d_dosuid'
23128 d_drand48_r='$d_drand48_r'
23129 d_drand48proto='$d_drand48proto'
23131 d_eaccess='$d_eaccess'
23132 d_endgrent='$d_endgrent'
23133 d_endgrent_r='$d_endgrent_r'
23134 d_endhent='$d_endhent'
23135 d_endhostent_r='$d_endhostent_r'
23136 d_endnent='$d_endnent'
23137 d_endnetent_r='$d_endnetent_r'
23138 d_endpent='$d_endpent'
23139 d_endprotoent_r='$d_endprotoent_r'
23140 d_endpwent='$d_endpwent'
23141 d_endpwent_r='$d_endpwent_r'
23142 d_endsent='$d_endsent'
23143 d_endservent_r='$d_endservent_r'
23144 d_eofnblk='$d_eofnblk'
23145 d_eunice='$d_eunice'
23146 d_faststdio='$d_faststdio'
23147 d_fchdir='$d_fchdir'
23148 d_fchmod='$d_fchmod'
23149 d_fchown='$d_fchown'
23151 d_fcntl_can_lock='$d_fcntl_can_lock'
23152 d_fd_macros='$d_fd_macros'
23153 d_fd_set='$d_fd_set'
23154 d_fds_bits='$d_fds_bits'
23155 d_fgetpos='$d_fgetpos'
23156 d_finite='$d_finite'
23157 d_finitel='$d_finitel'
23158 d_flexfnam='$d_flexfnam'
23160 d_flockproto='$d_flockproto'
23162 d_fp_class='$d_fp_class'
23163 d_fpathconf='$d_fpathconf'
23164 d_fpclass='$d_fpclass'
23165 d_fpclassify='$d_fpclassify'
23166 d_fpclassl='$d_fpclassl'
23167 d_fpos64_t='$d_fpos64_t'
23168 d_frexpl='$d_frexpl'
23169 d_fs_data_s='$d_fs_data_s'
23170 d_fseeko='$d_fseeko'
23171 d_fsetpos='$d_fsetpos'
23172 d_fstatfs='$d_fstatfs'
23173 d_fstatvfs='$d_fstatvfs'
23175 d_ftello='$d_ftello'
23177 d_futimes='$d_futimes'
23178 d_gdbm_ndbm_h_uses_prototypes='$d_gdbm_ndbm_h_uses_prototypes'
23179 d_gdbmndbm_h_uses_prototypes='$d_gdbmndbm_h_uses_prototypes'
23180 d_getaddrinfo='$d_getaddrinfo'
23181 d_getcwd='$d_getcwd'
23182 d_getespwnam='$d_getespwnam'
23183 d_getfsstat='$d_getfsstat'
23184 d_getgrent='$d_getgrent'
23185 d_getgrent_r='$d_getgrent_r'
23186 d_getgrgid_r='$d_getgrgid_r'
23187 d_getgrnam_r='$d_getgrnam_r'
23188 d_getgrps='$d_getgrps'
23189 d_gethbyaddr='$d_gethbyaddr'
23190 d_gethbyname='$d_gethbyname'
23191 d_gethent='$d_gethent'
23192 d_gethname='$d_gethname'
23193 d_gethostbyaddr_r='$d_gethostbyaddr_r'
23194 d_gethostbyname_r='$d_gethostbyname_r'
23195 d_gethostent_r='$d_gethostent_r'
23196 d_gethostprotos='$d_gethostprotos'
23197 d_getitimer='$d_getitimer'
23198 d_getlogin='$d_getlogin'
23199 d_getlogin_r='$d_getlogin_r'
23200 d_getmnt='$d_getmnt'
23201 d_getmntent='$d_getmntent'
23202 d_getnameinfo='$d_getnameinfo'
23203 d_getnbyaddr='$d_getnbyaddr'
23204 d_getnbyname='$d_getnbyname'
23205 d_getnent='$d_getnent'
23206 d_getnetbyaddr_r='$d_getnetbyaddr_r'
23207 d_getnetbyname_r='$d_getnetbyname_r'
23208 d_getnetent_r='$d_getnetent_r'
23209 d_getnetprotos='$d_getnetprotos'
23210 d_getpagsz='$d_getpagsz'
23211 d_getpbyname='$d_getpbyname'
23212 d_getpbynumber='$d_getpbynumber'
23213 d_getpent='$d_getpent'
23214 d_getpgid='$d_getpgid'
23215 d_getpgrp2='$d_getpgrp2'
23216 d_getpgrp='$d_getpgrp'
23217 d_getppid='$d_getppid'
23218 d_getprior='$d_getprior'
23219 d_getprotobyname_r='$d_getprotobyname_r'
23220 d_getprotobynumber_r='$d_getprotobynumber_r'
23221 d_getprotoent_r='$d_getprotoent_r'
23222 d_getprotoprotos='$d_getprotoprotos'
23223 d_getprpwnam='$d_getprpwnam'
23224 d_getpwent='$d_getpwent'
23225 d_getpwent_r='$d_getpwent_r'
23226 d_getpwnam_r='$d_getpwnam_r'
23227 d_getpwuid_r='$d_getpwuid_r'
23228 d_getsbyname='$d_getsbyname'
23229 d_getsbyport='$d_getsbyport'
23230 d_getsent='$d_getsent'
23231 d_getservbyname_r='$d_getservbyname_r'
23232 d_getservbyport_r='$d_getservbyport_r'
23233 d_getservent_r='$d_getservent_r'
23234 d_getservprotos='$d_getservprotos'
23235 d_getspnam='$d_getspnam'
23236 d_getspnam_r='$d_getspnam_r'
23237 d_gettimeod='$d_gettimeod'
23238 d_gmtime64='$d_gmtime64'
23239 d_gmtime_r='$d_gmtime_r'
23240 d_gnulibc='$d_gnulibc'
23241 d_grpasswd='$d_grpasswd'
23242 d_hasmntopt='$d_hasmntopt'
23244 d_ilogbl='$d_ilogbl'
23245 d_inc_version_list='$d_inc_version_list'
23247 d_inetaton='$d_inetaton'
23248 d_inetntop='$d_inetntop'
23249 d_inetpton='$d_inetpton'
23250 d_int64_t='$d_int64_t'
23251 d_ip_mreq='$d_ip_mreq'
23252 d_ip_mreq_source='$d_ip_mreq_source'
23253 d_ipv6_mreq='$d_ipv6_mreq'
23254 d_ipv6_mreq_source='$d_ipv6_mreq_source'
23255 d_isascii='$d_isascii'
23256 d_isblank='$d_isblank'
23257 d_isfinite='$d_isfinite'
23260 d_isnanl='$d_isnanl'
23261 d_killpg='$d_killpg'
23262 d_lchown='$d_lchown'
23263 d_ldbl_dig='$d_ldbl_dig'
23264 d_libm_lib_version='$d_libm_lib_version'
23265 d_libname_unique='$d_libname_unique'
23267 d_localtime64='$d_localtime64'
23268 d_localtime_r='$d_localtime_r'
23269 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
23270 d_locconv='$d_locconv'
23272 d_longdbl='$d_longdbl'
23273 d_longlong='$d_longlong'
23274 d_lseekproto='$d_lseekproto'
23276 d_madvise='$d_madvise'
23277 d_malloc_good_size='$d_malloc_good_size'
23278 d_malloc_size='$d_malloc_size'
23280 d_mbstowcs='$d_mbstowcs'
23281 d_mbtowc='$d_mbtowc'
23282 d_memchr='$d_memchr'
23283 d_memcmp='$d_memcmp'
23284 d_memcpy='$d_memcpy'
23285 d_memmove='$d_memmove'
23286 d_memset='$d_memset'
23288 d_mkdtemp='$d_mkdtemp'
23289 d_mkfifo='$d_mkfifo'
23290 d_mkstemp='$d_mkstemp'
23291 d_mkstemps='$d_mkstemps'
23292 d_mktime64='$d_mktime64'
23293 d_mktime='$d_mktime'
23296 d_modfl_pow32_bug='$d_modfl_pow32_bug'
23297 d_modflproto='$d_modflproto'
23298 d_mprotect='$d_mprotect'
23300 d_msg_ctrunc='$d_msg_ctrunc'
23301 d_msg_dontroute='$d_msg_dontroute'
23302 d_msg_oob='$d_msg_oob'
23303 d_msg_peek='$d_msg_peek'
23304 d_msg_proxy='$d_msg_proxy'
23305 d_msgctl='$d_msgctl'
23306 d_msgget='$d_msgget'
23307 d_msghdr_s='$d_msghdr_s'
23308 d_msgrcv='$d_msgrcv'
23309 d_msgsnd='$d_msgsnd'
23311 d_munmap='$d_munmap'
23312 d_mymalloc='$d_mymalloc'
23314 d_ndbm_h_uses_prototypes='$d_ndbm_h_uses_prototypes'
23316 d_nl_langinfo='$d_nl_langinfo'
23317 d_nv_preserves_uv='$d_nv_preserves_uv'
23318 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
23319 d_off64_t='$d_off64_t'
23320 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
23321 d_oldpthreads='$d_oldpthreads'
23322 d_oldsock='$d_oldsock'
23324 d_pathconf='$d_pathconf'
23326 d_perl_otherlibdirs='$d_perl_otherlibdirs'
23327 d_phostname='$d_phostname'
23330 d_portable='$d_portable'
23332 d_prctl_set_name='$d_prctl_set_name'
23333 d_printf_format_null='$d_printf_format_null'
23334 d_procselfexe='$d_procselfexe'
23335 d_pseudofork='$d_pseudofork'
23336 d_pthread_atfork='$d_pthread_atfork'
23337 d_pthread_attr_setscope='$d_pthread_attr_setscope'
23338 d_pthread_yield='$d_pthread_yield'
23340 d_pwchange='$d_pwchange'
23341 d_pwclass='$d_pwclass'
23342 d_pwcomment='$d_pwcomment'
23343 d_pwexpire='$d_pwexpire'
23344 d_pwgecos='$d_pwgecos'
23345 d_pwpasswd='$d_pwpasswd'
23346 d_pwquota='$d_pwquota'
23349 d_random_r='$d_random_r'
23350 d_readdir64_r='$d_readdir64_r'
23351 d_readdir='$d_readdir'
23352 d_readdir_r='$d_readdir_r'
23353 d_readlink='$d_readlink'
23355 d_recvmsg='$d_recvmsg'
23356 d_rename='$d_rename'
23357 d_rewinddir='$d_rewinddir'
23359 d_safebcpy='$d_safebcpy'
23360 d_safemcpy='$d_safemcpy'
23361 d_sanemcmp='$d_sanemcmp'
23362 d_sbrkproto='$d_sbrkproto'
23363 d_scalbnl='$d_scalbnl'
23364 d_sched_yield='$d_sched_yield'
23365 d_scm_rights='$d_scm_rights'
23366 d_seekdir='$d_seekdir'
23367 d_select='$d_select'
23369 d_semctl='$d_semctl'
23370 d_semctl_semid_ds='$d_semctl_semid_ds'
23371 d_semctl_semun='$d_semctl_semun'
23372 d_semget='$d_semget'
23374 d_sendmsg='$d_sendmsg'
23375 d_setegid='$d_setegid'
23376 d_seteuid='$d_seteuid'
23377 d_setgrent='$d_setgrent'
23378 d_setgrent_r='$d_setgrent_r'
23379 d_setgrps='$d_setgrps'
23380 d_sethent='$d_sethent'
23381 d_sethostent_r='$d_sethostent_r'
23382 d_setitimer='$d_setitimer'
23383 d_setlinebuf='$d_setlinebuf'
23384 d_setlocale='$d_setlocale'
23385 d_setlocale_r='$d_setlocale_r'
23386 d_setnent='$d_setnent'
23387 d_setnetent_r='$d_setnetent_r'
23388 d_setpent='$d_setpent'
23389 d_setpgid='$d_setpgid'
23390 d_setpgrp2='$d_setpgrp2'
23391 d_setpgrp='$d_setpgrp'
23392 d_setprior='$d_setprior'
23393 d_setproctitle='$d_setproctitle'
23394 d_setprotoent_r='$d_setprotoent_r'
23395 d_setpwent='$d_setpwent'
23396 d_setpwent_r='$d_setpwent_r'
23397 d_setregid='$d_setregid'
23398 d_setresgid='$d_setresgid'
23399 d_setresuid='$d_setresuid'
23400 d_setreuid='$d_setreuid'
23401 d_setrgid='$d_setrgid'
23402 d_setruid='$d_setruid'
23403 d_setsent='$d_setsent'
23404 d_setservent_r='$d_setservent_r'
23405 d_setsid='$d_setsid'
23406 d_setvbuf='$d_setvbuf'
23409 d_shmatprototype='$d_shmatprototype'
23410 d_shmctl='$d_shmctl'
23412 d_shmget='$d_shmget'
23413 d_sigaction='$d_sigaction'
23414 d_signbit='$d_signbit'
23415 d_sigprocmask='$d_sigprocmask'
23416 d_sigsetjmp='$d_sigsetjmp'
23417 d_sin6_scope_id='$d_sin6_scope_id'
23418 d_sitearch='$d_sitearch'
23419 d_snprintf='$d_snprintf'
23420 d_sockaddr_in6='$d_sockaddr_in6'
23421 d_sockaddr_sa_len='$d_sockaddr_sa_len'
23422 d_sockatmark='$d_sockatmark'
23423 d_sockatmarkproto='$d_sockatmarkproto'
23424 d_socket='$d_socket'
23425 d_socklen_t='$d_socklen_t'
23426 d_sockpair='$d_sockpair'
23427 d_socks5_init='$d_socks5_init'
23428 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
23430 d_srand48_r='$d_srand48_r'
23431 d_srandom_r='$d_srandom_r'
23432 d_sresgproto='$d_sresgproto'
23433 d_sresuproto='$d_sresuproto'
23434 d_statblks='$d_statblks'
23435 d_statfs_f_flags='$d_statfs_f_flags'
23436 d_statfs_s='$d_statfs_s'
23437 d_static_inline='$d_static_inline'
23438 d_statvfs='$d_statvfs'
23439 d_stdio_cnt_lval='$d_stdio_cnt_lval'
23440 d_stdio_ptr_lval='$d_stdio_ptr_lval'
23441 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
23442 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
23443 d_stdio_stream_array='$d_stdio_stream_array'
23444 d_stdiobase='$d_stdiobase'
23445 d_stdstdio='$d_stdstdio'
23446 d_strchr='$d_strchr'
23447 d_strcoll='$d_strcoll'
23448 d_strctcpy='$d_strctcpy'
23449 d_strerrm='$d_strerrm'
23450 d_strerror='$d_strerror'
23451 d_strerror_r='$d_strerror_r'
23452 d_strftime='$d_strftime'
23453 d_strlcat='$d_strlcat'
23454 d_strlcpy='$d_strlcpy'
23455 d_strtod='$d_strtod'
23456 d_strtol='$d_strtol'
23457 d_strtold='$d_strtold'
23458 d_strtoll='$d_strtoll'
23459 d_strtoq='$d_strtoq'
23460 d_strtoul='$d_strtoul'
23461 d_strtoull='$d_strtoull'
23462 d_strtouq='$d_strtouq'
23463 d_strxfrm='$d_strxfrm'
23464 d_suidsafe='$d_suidsafe'
23465 d_symlink='$d_symlink'
23466 d_syscall='$d_syscall'
23467 d_syscallproto='$d_syscallproto'
23468 d_sysconf='$d_sysconf'
23469 d_sysernlst='$d_sysernlst'
23470 d_syserrlst='$d_syserrlst'
23471 d_system='$d_system'
23472 d_tcgetpgrp='$d_tcgetpgrp'
23473 d_tcsetpgrp='$d_tcsetpgrp'
23474 d_telldir='$d_telldir'
23475 d_telldirproto='$d_telldirproto'
23477 d_timegm='$d_timegm'
23479 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
23480 d_tm_tm_zone='$d_tm_tm_zone'
23481 d_tmpnam_r='$d_tmpnam_r'
23482 d_truncate='$d_truncate'
23483 d_ttyname_r='$d_ttyname_r'
23484 d_tzname='$d_tzname'
23485 d_u32align='$d_u32align'
23486 d_ualarm='$d_ualarm'
23489 d_union_semun='$d_union_semun'
23490 d_unordered='$d_unordered'
23491 d_unsetenv='$d_unsetenv'
23492 d_usleep='$d_usleep'
23493 d_usleepproto='$d_usleepproto'
23495 d_vendorarch='$d_vendorarch'
23496 d_vendorbin='$d_vendorbin'
23497 d_vendorlib='$d_vendorlib'
23498 d_vendorscript='$d_vendorscript'
23500 d_void_closedir='$d_void_closedir'
23501 d_voidsig='$d_voidsig'
23502 d_voidtty='$d_voidtty'
23503 d_volatile='$d_volatile'
23504 d_vprintf='$d_vprintf'
23505 d_vsnprintf='$d_vsnprintf'
23507 d_waitpid='$d_waitpid'
23508 d_wcscmp='$d_wcscmp'
23509 d_wcstombs='$d_wcstombs'
23510 d_wcsxfrm='$d_wcsxfrm'
23511 d_wctomb='$d_wctomb'
23512 d_writev='$d_writev'
23515 db_hashtype='$db_hashtype'
23516 db_prefixtype='$db_prefixtype'
23517 db_version_major='$db_version_major'
23518 db_version_minor='$db_version_minor'
23519 db_version_patch='$db_version_patch'
23520 direntrytype='$direntrytype'
23523 doublesize='$doublesize'
23525 drand48_r_proto='$drand48_r_proto'
23527 dynamic_ext='$dynamic_ext'
23533 endgrent_r_proto='$endgrent_r_proto'
23534 endhostent_r_proto='$endhostent_r_proto'
23535 endnetent_r_proto='$endnetent_r_proto'
23536 endprotoent_r_proto='$endprotoent_r_proto'
23537 endpwent_r_proto='$endpwent_r_proto'
23538 endservent_r_proto='$endservent_r_proto'
23539 eunicefix='$eunicefix'
23542 extensions='$extensions'
23543 extern_C='$extern_C'
23545 fflushNULL='$fflushNULL'
23546 fflushall='$fflushall'
23548 firstmakefile='$firstmakefile'
23550 fpossize='$fpossize'
23551 fpostype='$fpostype'
23552 freetype='$freetype'
23555 full_csh='$full_csh'
23556 full_sed='$full_sed'
23557 gccansipedantic='$gccansipedantic'
23558 gccosandvers='$gccosandvers'
23559 gccversion='$gccversion'
23560 getgrent_r_proto='$getgrent_r_proto'
23561 getgrgid_r_proto='$getgrgid_r_proto'
23562 getgrnam_r_proto='$getgrnam_r_proto'
23563 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
23564 gethostbyname_r_proto='$gethostbyname_r_proto'
23565 gethostent_r_proto='$gethostent_r_proto'
23566 getlogin_r_proto='$getlogin_r_proto'
23567 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
23568 getnetbyname_r_proto='$getnetbyname_r_proto'
23569 getnetent_r_proto='$getnetent_r_proto'
23570 getprotobyname_r_proto='$getprotobyname_r_proto'
23571 getprotobynumber_r_proto='$getprotobynumber_r_proto'
23572 getprotoent_r_proto='$getprotoent_r_proto'
23573 getpwent_r_proto='$getpwent_r_proto'
23574 getpwnam_r_proto='$getpwnam_r_proto'
23575 getpwuid_r_proto='$getpwuid_r_proto'
23576 getservbyname_r_proto='$getservbyname_r_proto'
23577 getservbyport_r_proto='$getservbyport_r_proto'
23578 getservent_r_proto='$getservent_r_proto'
23579 getspnam_r_proto='$getspnam_r_proto'
23580 gidformat='$gidformat'
23586 gmtime_r_proto='$gmtime_r_proto'
23587 gnulibc_version='$gnulibc_version'
23589 groupcat='$groupcat'
23590 groupstype='$groupstype'
23593 h_sysfile='$h_sysfile'
23596 hostgenerate='$hostgenerate'
23597 hostosname='$hostosname'
23598 hostperl='$hostperl'
23599 html1dir='$html1dir'
23600 html1direxp='$html1direxp'
23601 html3dir='$html3dir'
23602 html3direxp='$html3direxp'
23611 i_arpainet='$i_arpainet'
23612 i_assert='$i_assert'
23614 i_bsdioctl='$i_bsdioctl'
23618 i_dirent='$i_dirent'
23620 i_execinfo='$i_execinfo'
23624 i_fp_class='$i_fp_class'
23626 i_gdbm_ndbm='$i_gdbm_ndbm'
23627 i_gdbmndbm='$i_gdbmndbm'
23629 i_ieeefp='$i_ieeefp'
23630 i_inttypes='$i_inttypes'
23631 i_langinfo='$i_langinfo'
23632 i_libutil='$i_libutil'
23633 i_limits='$i_limits'
23634 i_locale='$i_locale'
23635 i_machcthr='$i_machcthr'
23636 i_malloc='$i_malloc'
23637 i_mallocmalloc='$i_mallocmalloc'
23639 i_memory='$i_memory'
23640 i_mntent='$i_mntent'
23643 i_neterrno='$i_neterrno'
23644 i_netinettcp='$i_netinettcp'
23648 i_pthread='$i_pthread'
23650 i_rpcsvcdbm='$i_rpcsvcdbm'
23652 i_shadow='$i_shadow'
23654 i_stdarg='$i_stdarg'
23655 i_stdbool='$i_stdbool'
23656 i_stddef='$i_stddef'
23657 i_stdlib='$i_stdlib'
23658 i_string='$i_string'
23659 i_sunmath='$i_sunmath'
23660 i_sysaccess='$i_sysaccess'
23661 i_sysdir='$i_sysdir'
23662 i_sysfile='$i_sysfile'
23663 i_sysfilio='$i_sysfilio'
23665 i_sysioctl='$i_sysioctl'
23666 i_syslog='$i_syslog'
23667 i_sysmman='$i_sysmman'
23668 i_sysmode='$i_sysmode'
23669 i_sysmount='$i_sysmount'
23670 i_sysndir='$i_sysndir'
23671 i_sysparam='$i_sysparam'
23672 i_syspoll='$i_syspoll'
23673 i_sysresrc='$i_sysresrc'
23674 i_syssecrt='$i_syssecrt'
23675 i_sysselct='$i_sysselct'
23676 i_syssockio='$i_syssockio'
23677 i_sysstat='$i_sysstat'
23678 i_sysstatfs='$i_sysstatfs'
23679 i_sysstatvfs='$i_sysstatvfs'
23680 i_systime='$i_systime'
23681 i_systimek='$i_systimek'
23682 i_systimes='$i_systimes'
23683 i_systypes='$i_systypes'
23684 i_sysuio='$i_sysuio'
23686 i_sysutsname='$i_sysutsname'
23687 i_sysvfs='$i_sysvfs'
23688 i_syswait='$i_syswait'
23689 i_termio='$i_termio'
23690 i_termios='$i_termios'
23692 i_unistd='$i_unistd'
23695 i_values='$i_values'
23696 i_varargs='$i_varargs'
23697 i_varhdr='$i_varhdr'
23699 ignore_versioned_solibs='$ignore_versioned_solibs'
23700 inc_version_list='$inc_version_list'
23701 inc_version_list_init='$inc_version_list_init'
23705 initialinstalllocation='$initialinstalllocation'
23706 installarchlib='$installarchlib'
23707 installbin='$installbin'
23708 installhtml1dir='$installhtml1dir'
23709 installhtml3dir='$installhtml3dir'
23710 installman1dir='$installman1dir'
23711 installman3dir='$installman3dir'
23712 installprefix='$installprefix'
23713 installprefixexp='$installprefixexp'
23714 installprivlib='$installprivlib'
23715 installscript='$installscript'
23716 installsitearch='$installsitearch'
23717 installsitebin='$installsitebin'
23718 installsitehtml1dir='$installsitehtml1dir'
23719 installsitehtml3dir='$installsitehtml3dir'
23720 installsitelib='$installsitelib'
23721 installsiteman1dir='$installsiteman1dir'
23722 installsiteman3dir='$installsiteman3dir'
23723 installsitescript='$installsitescript'
23724 installstyle='$installstyle'
23725 installusrbinperl='$installusrbinperl'
23726 installvendorarch='$installvendorarch'
23727 installvendorbin='$installvendorbin'
23728 installvendorhtml1dir='$installvendorhtml1dir'
23729 installvendorhtml3dir='$installvendorhtml3dir'
23730 installvendorlib='$installvendorlib'
23731 installvendorman1dir='$installvendorman1dir'
23732 installvendorman3dir='$installvendorman3dir'
23733 installvendorscript='$installvendorscript'
23735 issymlink='$issymlink'
23736 ivdformat='$ivdformat'
23739 known_extensions='$known_extensions'
23742 ld_can_script='$ld_can_script'
23743 lddlflags='$lddlflags'
23745 ldflags_uselargefiles='$ldflags_uselargefiles'
23746 ldlibpthname='$ldlibpthname'
23753 libsdirs='$libsdirs'
23754 libsfiles='$libsfiles'
23755 libsfound='$libsfound'
23756 libspath='$libspath'
23757 libswanted='$libswanted'
23758 libswanted_uselargefiles='$libswanted_uselargefiles'
23764 localtime_r_proto='$localtime_r_proto'
23765 locincpth='$locincpth'
23766 loclibpth='$loclibpth'
23767 longdblsize='$longdblsize'
23768 longlongsize='$longlongsize'
23769 longsize='$longsize'
23773 lseeksize='$lseeksize'
23774 lseektype='$lseektype'
23777 madlyobj='$madlyobj'
23778 madlysrc='$madlysrc'
23782 make_set_make='$make_set_make'
23783 mallocobj='$mallocobj'
23784 mallocsrc='$mallocsrc'
23785 malloctype='$malloctype'
23787 man1direxp='$man1direxp'
23790 man3direxp='$man3direxp'
23792 mips_type='$mips_type'
23793 mistrustnm='$mistrustnm'
23795 mmaptype='$mmaptype'
23796 modetype='$modetype'
23798 multiarch='$multiarch'
23800 myarchname='$myarchname'
23801 mydomain='$mydomain'
23802 myhostname='$myhostname'
23805 need_va_copy='$need_va_copy'
23806 netdb_hlen_type='$netdb_hlen_type'
23807 netdb_host_type='$netdb_host_type'
23808 netdb_name_type='$netdb_name_type'
23809 netdb_net_type='$netdb_net_type'
23812 nm_so_opt='$nm_so_opt'
23813 nonxs_ext='$nonxs_ext'
23815 nvEUformat='$nvEUformat'
23816 nvFUformat='$nvFUformat'
23817 nvGUformat='$nvGUformat'
23818 nv_overflows_integers_at='$nv_overflows_integers_at'
23819 nv_preserves_uv_bits='$nv_preserves_uv_bits'
23820 nveformat='$nveformat'
23821 nvfformat='$nvfformat'
23822 nvgformat='$nvgformat'
23825 o_nonblock='$o_nonblock'
23827 old_pthread_create_joinable='$old_pthread_create_joinable'
23828 optimize='$optimize'
23829 orderlib='$orderlib'
23832 otherlibdirs='$otherlibdirs'
23836 patchlevel='$patchlevel'
23837 path_sep='$path_sep'
23840 perl_patchlevel='$perl_patchlevel'
23841 perl_static_inline='$perl_static_inline'
23842 perladmin='$perladmin'
23843 perllibs='$perllibs'
23844 perlpath='$perlpath'
23846 phostname='$phostname'
23852 prefixexp='$prefixexp'
23854 privlibexp='$privlibexp'
23855 procselfexe='$procselfexe'
23856 prototype='$prototype'
23858 quadkind='$quadkind'
23859 quadtype='$quadtype'
23860 randbits='$randbits'
23861 randfunc='$randfunc'
23862 random_r_proto='$random_r_proto'
23863 randseedtype='$randseedtype'
23865 rd_nodata='$rd_nodata'
23866 readdir64_r_proto='$readdir64_r_proto'
23867 readdir_r_proto='$readdir_r_proto'
23868 revision='$revision'
23874 sGMTIME_max='$sGMTIME_max'
23875 sGMTIME_min='$sGMTIME_min'
23876 sLOCALTIME_max='$sLOCALTIME_max'
23877 sLOCALTIME_min='$sLOCALTIME_min'
23878 sPRIEUldbl='$sPRIEUldbl'
23879 sPRIFUldbl='$sPRIFUldbl'
23880 sPRIGUldbl='$sPRIGUldbl'
23881 sPRIXU64='$sPRIXU64'
23883 sPRIeldbl='$sPRIeldbl'
23884 sPRIfldbl='$sPRIfldbl'
23885 sPRIgldbl='$sPRIgldbl'
23890 sSCNfldbl='$sSCNfldbl'
23891 sched_yield='$sched_yield'
23892 scriptdir='$scriptdir'
23893 scriptdirexp='$scriptdirexp'
23895 seedfunc='$seedfunc'
23896 selectminbits='$selectminbits'
23897 selecttype='$selecttype'
23898 sendmail='$sendmail'
23899 setgrent_r_proto='$setgrent_r_proto'
23900 sethostent_r_proto='$sethostent_r_proto'
23901 setlocale_r_proto='$setlocale_r_proto'
23902 setnetent_r_proto='$setnetent_r_proto'
23903 setprotoent_r_proto='$setprotoent_r_proto'
23904 setpwent_r_proto='$setpwent_r_proto'
23905 setservent_r_proto='$setservent_r_proto'
23908 sharpbang='$sharpbang'
23909 shmattype='$shmattype'
23910 shortsize='$shortsize'
23913 sig_count='$sig_count'
23914 sig_name='$sig_name'
23915 sig_name_init='$sig_name_init'
23917 sig_num_init='$sig_num_init'
23918 sig_size='$sig_size'
23919 signal_t='$signal_t'
23920 sitearch='$sitearch'
23921 sitearchexp='$sitearchexp'
23923 sitebinexp='$sitebinexp'
23924 sitehtml1dir='$sitehtml1dir'
23925 sitehtml1direxp='$sitehtml1direxp'
23926 sitehtml3dir='$sitehtml3dir'
23927 sitehtml3direxp='$sitehtml3direxp'
23929 sitelib_stem='$sitelib_stem'
23930 sitelibexp='$sitelibexp'
23931 siteman1dir='$siteman1dir'
23932 siteman1direxp='$siteman1direxp'
23933 siteman3dir='$siteman3dir'
23934 siteman3direxp='$siteman3direxp'
23935 siteprefix='$siteprefix'
23936 siteprefixexp='$siteprefixexp'
23937 sitescript='$sitescript'
23938 sitescriptexp='$sitescriptexp'
23939 sizesize='$sizesize'
23940 sizetype='$sizetype'
23944 sockethdr='$sockethdr'
23945 socketlib='$socketlib'
23946 socksizetype='$socksizetype'
23948 spackage='$spackage'
23949 spitshell='$spitshell'
23950 srand48_r_proto='$srand48_r_proto'
23951 srandom_r_proto='$srandom_r_proto'
23953 ssizetype='$ssizetype'
23954 st_ino_sign='$st_ino_sign'
23955 st_ino_size='$st_ino_size'
23956 startperl='$startperl'
23958 static_ext='$static_ext'
23960 stdio_base='$stdio_base'
23961 stdio_bufsiz='$stdio_bufsiz'
23962 stdio_cnt='$stdio_cnt'
23963 stdio_filbuf='$stdio_filbuf'
23964 stdio_ptr='$stdio_ptr'
23965 stdio_stream_array='$stdio_stream_array'
23966 strerror_r_proto='$strerror_r_proto'
23969 subversion='$subversion'
23974 targetarch='$targetarch'
23975 targetdir='$targetdir'
23976 targetenv='$targetenv'
23977 targethost='$targethost'
23978 targetmkdir='$targetmkdir'
23979 targetport='$targetport'
23980 targetsh='$targetsh'
23984 timeincl='$timeincl'
23985 timetype='$timetype'
23986 tmpnam_r_proto='$tmpnam_r_proto'
23992 ttyname_r_proto='$ttyname_r_proto'
24001 uidformat='$uidformat'
24007 uquadtype='$uquadtype'
24008 use5005threads='$use5005threads'
24009 use64bitall='$use64bitall'
24010 use64bitint='$use64bitint'
24011 usecbacktrace='$usecbacktrace'
24012 usecrosscompile='$usecrosscompile'
24013 usedevel='$usedevel'
24015 usedtrace='$usedtrace'
24016 usefaststdio='$usefaststdio'
24017 useithreads='$useithreads'
24018 usekernprocpathname='$usekernprocpathname'
24019 uselargefiles='$uselargefiles'
24020 uselongdouble='$uselongdouble'
24021 usemallocwrap='$usemallocwrap'
24022 usemorebits='$usemorebits'
24023 usemultiplicity='$usemultiplicity'
24024 usemymalloc='$usemymalloc'
24026 usensgetexecutablepath='$usensgetexecutablepath'
24027 useopcode='$useopcode'
24028 useperlio='$useperlio'
24029 useposix='$useposix'
24030 usereentrant='$usereentrant'
24031 userelocatableinc='$userelocatableinc'
24032 useshrplib='$useshrplib'
24033 usesitecustomize='$usesitecustomize'
24034 usesocks='$usesocks'
24035 usethreads='$usethreads'
24036 usevendorprefix='$usevendorprefix'
24037 useversionedarchname='$useversionedarchname'
24038 usevfork='$usevfork'
24041 uvXUformat='$uvXUformat'
24042 uvoformat='$uvoformat'
24045 uvuformat='$uvuformat'
24046 uvxformat='$uvxformat'
24048 vendorarch='$vendorarch'
24049 vendorarchexp='$vendorarchexp'
24050 vendorbin='$vendorbin'
24051 vendorbinexp='$vendorbinexp'
24052 vendorhtml1dir='$vendorhtml1dir'
24053 vendorhtml1direxp='$vendorhtml1direxp'
24054 vendorhtml3dir='$vendorhtml3dir'
24055 vendorhtml3direxp='$vendorhtml3direxp'
24056 vendorlib='$vendorlib'
24057 vendorlib_stem='$vendorlib_stem'
24058 vendorlibexp='$vendorlibexp'
24059 vendorman1dir='$vendorman1dir'
24060 vendorman1direxp='$vendorman1direxp'
24061 vendorman3dir='$vendorman3dir'
24062 vendorman3direxp='$vendorman3direxp'
24063 vendorprefix='$vendorprefix'
24064 vendorprefixexp='$vendorprefixexp'
24065 vendorscript='$vendorscript'
24066 vendorscriptexp='$vendorscriptexp'
24068 version_patchlevel_string='$version_patchlevel_string'
24069 versiononly='$versiononly'
24073 yaccflags='$yaccflags'
24078 : add special variables
24079 $test -f $src/patchlevel.h && \
24080 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
24081 echo "PERL_PATCHLEVEL='$perl_patchlevel'" >>config.sh
24082 echo "PERL_CONFIG_SH=true" >>config.sh
24084 : propagate old symbols
24085 if $test -f UU/config.sh; then
24086 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
24087 $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \
24088 config.sh config.sh UU/oldconfig.sh |\
24089 $sort | $uniq -u >UU/oldsyms
24090 set X `$cat UU/oldsyms`
24096 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
24098 echo ": Variables propagated from previous config.sh file." >>config.sh
24099 for sym in `$cat UU/oldsyms`; do
24100 echo " Propagating $hint variable "'$'"$sym..."
24101 eval 'tmp="$'"${sym}"'"'
24103 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
24109 : Finish up by extracting the .SH files
24113 echo "Extraction done."
24123 If you'd like to make any changes to the config.sh file before I begin
24124 to configure things, do it as a shell escape now (e.g. !vi config.sh).
24127 rp="Press return or use a shell escape to edit config.sh:"
24132 *) : in case they cannot read
24133 sh 1>&4 -c "$ans";;
24138 : if this fails, just run all the .SH files by hand
24147 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
24154 Now you need to generate make dependencies by running "$make depend".
24155 You might prefer to run it in background: "$make depend > makedepend.out &"
24156 It can take a while, so you might not want to run it right now.
24161 rp="Run $make depend now?"
24165 $make depend && echo "Now you must run '$make'."
24168 echo "You must run '$make depend' then '$make'."
24171 elif test -f [Mm]akefile; then
24173 echo "Now you must run a $make."
24175 echo "Configure done."
24178 if $test -f Policy.sh; then
24181 If you compile $package on a different machine or from a different object
24182 directory, copy the Policy.sh file from this object directory to the
24183 new one before you run Configure -- this will help you with most of
24184 the policy defaults.
24188 if $test -f config.msg; then
24189 echo "Hmm. I also noted the following information while running:"
24191 $cat config.msg >&4
24194 $rm -f kit*isdone ark*isdone