3 # If these # comments don't work, trim them. Don't worry about any other
4 # shell scripts, Configure will trim # comments from them for you.
6 # (If you are trying to port this package to a machine without sh,
7 # I would suggest you have a look at the prototypical config_h.SH file
8 # and edit it to reflect your system. Some packages may include samples
9 # of config.h for certain machines, so you might look for one of those.)
11 # Yes, you may rip this off to use in other distribution packages. This
12 # script belongs to the public domain and cannot be copyrighted.
14 # Note: this Configure script was generated automatically. Rather than
15 # working with this copy of Configure, you may wish to get metaconfig.
16 # The dist package (which contains metaconfig) is available via SVN:
17 # svn co https://svn.code.sf.net/p/dist/code/trunk/dist
19 # Though this script was generated by metaconfig from metaunits, it is
20 # OK to send patches against Configure itself. It's up to the Configure
21 # pumpkin to backport the patch to the metaunits if it is accepted.
22 # For more information on patching Configure, see pod/perlhack.pod
24 # The metaunits are also available from the public git repository:
25 # http://perl5.git.perl.org/metaconfig.git/ or
26 # $ git clone git://perl5.git.perl.org/metaconfig.git metaconfig
28 # See Porting/pumpkin.pod for more information on metaconfig.
31 # Generated using [metaconfig 3.5 PL0]
32 # (with additional metaconfig patches by perlbug@perl.org)
37 SCO csh still thinks true is false. Write to SCO today and tell them that next
38 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
40 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
41 we'd have to do is go in and swap the && and || tokens, wherever they are.)
43 [End of diatribe. We now return you to your regularly scheduled programming...]
47 OOPS! You naughty creature! You didn't run Configure with sh!
48 I will attempt to remedy the situation by running sh for you...
52 true || exec sh $0 $argv:q
54 (exit $?0) || cat c2$$
55 (exit $?0) || exec sh $0 $argv:q
58 if test -f /dev/cputype -a -f /dev/drivers -a -f /dev/osversion; then
61 *** I'm sorry but this system looks like Plan 9 and Plan 9 doesn't do
62 *** Configure that well. (Plan 9 is close to UNIX but not close enough.)
63 *** Please read the README.plan9 for further instructions.
64 *** Cannot continue, aborting.
70 if test ! -c /dev/null ; then
73 *** I'm sorry, but /dev/null appears to be a file rather than a device.
74 *** Please consult your operating sytem's notes for making a device
76 *** Cannot continue, aborting.
82 : compute my invocation name
86 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
91 : Proper separator for the PATH environment variable
93 : On OS/2 this directory should exist if this is not floppy only system ":-]"
94 if test -d c:/. || ( uname -a | grep -i 'os\(/\|\)2' 2>&1 ) 2>&1 >/dev/null ; then
95 if test -n "$OS2_SHELL"; then
97 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
98 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
100 elif test -n "$DJGPP"; then
101 case "X${MACHTYPE:-nonesuchmach}" in
108 : Proper PATH setting
109 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
110 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
111 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
112 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
113 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
114 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /opt/ansic/bin /usr/ccs/bin"
115 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
116 paths="$paths /sbin /usr/sbin /usr/libexec"
117 paths="$paths /system/gnu_library/bin"
121 case "$p_$PATH$p_" in
123 *) test -d $p && PATH=$PATH$p_$p ;;
130 : shall we be using ksh?
136 if (PATH=.; alias -x) >/dev/null 2>&1; then
139 if test -f /hp-ux -a -f /bin/ksh; then
140 needksh='to avoid sh bug in "here document" expansion'
142 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
143 if test X`/usr/bin/uname -v` = X4; then
144 avoidksh="to avoid AIX 4's /bin/sh"
148 if test -f /osf_boot -a -f /usr/sbin/setld; then
149 if test X`/usr/bin/uname -s` = XOSF1; then
150 avoidksh="to avoid Digital UNIX' ksh"
155 case "$inksh/$needksh" in
162 case "$inksh/$avoidksh" in
168 case "$inksh/$needksh-$avoidksh-" in
171 (I see you are using the Korn shell. Some ksh's blow up on $me,
172 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
179 echo "(Feeding myself to $newsh $reason.)"
181 Configure|*/Configure) exec $newsh $0 "$@";;
182 *) exec $newsh Configure "$@";;
186 test -x "${newsh}" || unset newsh
188 : if needed, set CDPATH to a harmless value that is not chatty
189 : avoid bash 2.02 problems with empty CDPATH.
193 *bash*) CDPATH='.' ;;
199 : Configure runs within the UU subdirectory
200 test -d UU || mkdir UU
344 useversionedarchname=''
350 initialinstalllocation=''
380 d_attribute_deprecated=''
381 d_attribute_format=''
382 d_attribute_malloc=''
383 d_attribute_nonnull=''
384 d_attribute_noreturn=''
386 d_attribute_unused=''
387 d_attribute_warn_unused_result=''
388 d_printf_format_null=''
392 d_builtin_choose_expr=''
395 d_c99_variadic_macros=''
443 endhostent_r_proto=''
449 endprotoent_r_proto=''
455 endservent_r_proto=''
512 gethostbyaddr_r_proto=''
514 gethostbyname_r_proto=''
516 gethostent_r_proto=''
529 getnetbyaddr_r_proto=''
531 getnetbyname_r_proto=''
545 d_getprotobyname_r=''
546 getprotobyname_r_proto=''
547 d_getprotobynumber_r=''
548 getprotobynumber_r_proto=''
550 getprotoent_r_proto=''
562 getservbyname_r_proto=''
564 getservbyport_r_proto=''
566 getservent_r_proto=''
597 d_libm_lib_version=''
600 d_localtime_r_needs_tzset=''
603 d_lc_monetary_2008=''
614 d_malloc_good_size=''
658 d_old_pthread_create_joinable=''
659 old_pthread_create_joinable=''
661 d_pthread_attr_setscope=''
701 sethostent_r_proto=''
718 setprotoent_r_proto=''
730 setservent_r_proto=''
752 d_ipv6_mreq_source=''
769 d_sprintf_returns_strlen=''
781 perl_static_inline=''
786 d_stdio_ptr_lval_nochange_cnt=''
787 d_stdio_ptr_lval_sets_cnt=''
938 d_gdbm_ndbm_h_uses_prototypes=''
939 d_gdbmndbm_h_uses_prototypes=''
941 d_ndbm_h_uses_prototypes=''
1017 d_inc_version_list=''
1019 inc_version_list_init=''
1023 installusrbinperl=''
1039 ignore_versioned_solibs=''
1099 d_perl_otherlibdirs=''
1107 api_versionstring=''
1113 version_patchlevel_string=''
1117 d_nv_preserves_uv=''
1118 d_nv_zero_is_allbits_zero=''
1129 nv_overflows_integers_at=''
1130 nv_preserves_uv_bits=''
1203 installsitehtml1dir=''
1206 installsitehtml3dir=''
1213 installsiteman1dir=''
1216 installsiteman3dir=''
1221 installsitescript=''
1239 d_stdio_stream_array=''
1240 stdio_stream_array=''
1258 usekernprocpathname=''
1259 ccflags_uselargefiles=''
1260 ldflags_uselargefiles=''
1261 libswanted_uselargefiles=''
1271 usensgetexecutablepath=''
1284 installvendorarch=''
1291 installvendorhtml1dir=''
1293 vendorhtml1direxp=''
1294 installvendorhtml3dir=''
1296 vendorhtml3direxp=''
1302 installvendorman1dir=''
1305 installvendorman3dir=''
1312 installvendorscript=''
1323 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1326 : We must find out about Eunice early
1328 if test -f /etc/unixtovms; then
1329 eunicefix=/etc/unixtovms
1331 if test -f /etc/unixtovms.exe; then
1332 eunicefix=/etc/unixtovms.exe
1335 : Set executable suffix now -- needed before hints available
1336 if test -f "/libs/version.library"; then
1339 elif test -f "/system/gnu_library/bin/ar.pm"; then
1342 elif test -n "$DJGPP"; then
1345 elif test -f /kern/cookiejar; then
1348 elif test -d c:/. -o -n "$is_os2" ; then
1355 : Trailing extension. Override this in a hint file, if needed.
1356 : Extra object files, if any, needed on this platform.
1359 : Possible local include directories to search.
1360 : Set locincpth to "" in a hint file to defeat local include searches.
1361 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1362 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1364 : no include file wanted by default
1367 : Enable -DEBUGGING and -DDEBUGGING from the command line
1372 : change the next line if compiling for Xenix/286 on Xenix/386
1373 xlibpth='/usr/lib/386 /lib/386'
1374 : Possible local library directories to search.
1375 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1376 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1378 : general looking path for locating libraries
1379 glibpth="/lib /usr/lib $xlibpth"
1380 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1381 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1382 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1383 test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
1385 : Private path used by Configure to find libraries. Its value
1386 : is prepended to libpth. This variable takes care of special
1387 : machines, like the mips. Usually, it should be empty.
1390 : default library list
1392 : some systems want to use only the non-versioned libso:s
1393 ignore_versioned_solibs=''
1394 : set usethreads on the Configure command line to enable threads.
1395 usereentrant='undef'
1399 : set useposix=false in your hint file to disable the POSIX extension.
1401 : set useopcode=false in your hint file to disable the Opcode extension.
1404 ccflags_uselargefiles=''
1405 ldflags_uselargefiles=''
1406 libswanted_uselargefiles=''
1407 : set usemultiplicity on the Configure command line to enable multiplicity.
1408 : set usesocks on the Configure command line to enable socks.
1409 : List of libraries we want.
1410 : If anyone needs extra -lxxx, put those in a hint file.
1411 libswanted="socket bind inet nsl nm ndbm gdbm dbm db malloc dl ld sun"
1412 libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
1413 : We probably want to search /usr/shlib before most other libraries.
1414 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1415 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1416 glibpth="/usr/shlib $glibpth"
1417 : Do not use vfork unless overridden by a hint file.
1420 : Find the basic shell for Bourne shell scripts
1424 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1427 if test -f "$xxx"; then
1430 : Build up a list and do a single loop so we can 'break' out.
1431 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1432 for xxx in sh bash ksh pdksh ash; do
1434 try="$try ${p}/${xxx}"
1438 if test -f "$xxx"; then
1441 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1444 elif test -f "$xxx.exe"; then
1455 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1457 Usually it's in /bin/sh. How did you even get this far?
1458 Please contact me (Perl Maintainers) at perlbug@perl.org and
1459 we'll try to straighten this all out.
1465 : When cross-compiling we need to separate the sh-to-run-Configure-with from the sh-to-use-in-Perl
1466 : default both to the same thing, cross-compilers can then set targetsh differently if they like
1469 : see if sh knows # comments
1470 if `$sh -c '#' >/dev/null 2>&1`; then
1474 test -f $xcat$_exe || xcat=/usr/bin/cat
1475 if test ! -f $xcat$_exe; then
1476 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1477 if test -f $p/cat$_exe; then
1482 if test ! -f $xcat$_exe; then
1483 echo "Can't find cat anywhere!"
1487 echo "#!$xcat" >sharp
1490 ./sharp > today 2>/dev/null
1491 if test -s today; then
1494 echo "#! $xcat" > sharp
1497 ./sharp > today 2>/dev/null
1498 if test -s today; then
1506 echo "Your $sh doesn't grok # comments--I will strip them later on."
1509 echo "exec grep -v '^[ ]*#'" >spitshell
1511 $eunicefix spitshell
1512 spitshell=`pwd`/spitshell
1514 echo "I presume that if # doesn't work, #! won't work either!"
1519 : figure out how to guarantee sh startup
1521 '') startsh=${sharpbang}${sh} ;;
1533 : echo "Yup, it does."
1535 echo "Hmm... '$startsh' does not guarantee sh startup..."
1536 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1540 : Save command line options in file UU/cmdline.opt for later use in
1541 : generating config.sh.
1542 cat > cmdline.opt <<EOSH
1543 : Configure command line arguments.
1552 cat >>cmdline.opt <<EOSH
1553 config_arg$argn='$arg'
1555 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1558 arg_exp=`cat cmdl.opt`
1559 args_exp="$args_exp$args_sep'$arg_exp'"
1560 argn=`expr $argn + 1`
1565 : produce awk script to parse command line options
1566 cat >options.awk <<'EOF'
1568 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1570 len = length(optstr);
1571 for (i = 1; i <= len; i++) {
1572 c = substr(optstr, i, 1);
1573 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1584 if (substr(str, 1, 1) != "-") {
1585 printf("'%s'\n", str);
1589 for (i = 2; i <= len; i++) {
1590 c = substr(str, i, 1);
1592 printf("-%s\n", substr(str, i));
1598 printf("'%s'\n", substr(str, i + 1));
1611 : process the command line options
1612 set X `for arg in "$@"; do echo "X$arg"; done |
1613 sed -e s/X// | awk -f options.awk`
1618 : set up default values
1628 rm -f optdef.sh posthint.sh
1629 cat >optdef.sh <<EOS
1635 while test $# -gt 0; do
1637 -d) shift; fastread=yes;;
1638 -e) shift; alldone=cont;;
1642 if test -r "$1"; then
1645 echo "$me: cannot read config file $1." >&2
1651 -h) shift; error=true;;
1652 -r) shift; reuseval=true;;
1653 -s) shift; silent=true; realsilent=true;;
1654 -E) shift; alldone=exit;;
1655 -K) shift; knowitall=true;;
1656 -O) shift; override=true;;
1657 -S) shift; silent=true; extractsh=true;;
1662 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1663 echo "$me: ignoring -D $1" >&2
1666 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1667 *) echo "$1='define'" >> optdef.sh;;
1674 *=) echo "$1" >> optdef.sh;;
1676 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1677 echo "$me: ignoring -U $1" >&2
1679 *) echo "$1='undef'" >> optdef.sh;;
1690 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1694 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1695 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1701 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1702 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1703 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1704 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1705 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1706 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1712 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1714 echo "$yyy=''" >> posthint.sh ;;
1719 echo "$yyy='$zzz'" >> posthint.sh ;;
1721 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1723 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1728 echo "$yyy=$zzz" >> posthint.sh ;;
1729 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1733 -V) echo "$me generated by metaconfig 3.5 PL0." >&2
1736 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1744 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1745 [-U symbol] [-U symbol=] [-A command:symbol...]
1746 -d : use defaults for all answers.
1747 -e : go on without questioning past the production of config.sh.
1748 -f : specify an alternate default configuration file.
1749 -h : print this help message and exit (with an error status).
1750 -r : reuse C symbols value if possible (skips costly nm extraction).
1751 -s : silent mode, only echoes questions and essential information.
1752 -D : define symbol to have some value:
1753 -D symbol symbol gets the value 'define'
1754 -D symbol=value symbol gets the value 'value'
1755 common used examples (see INSTALL for more info):
1756 -Duse64bitint use 64bit integers
1757 -Duse64bitall use 64bit integers and pointers
1758 -Dusethreads use thread support
1759 -Dinc_version_list=none do not include older perl trees in @INC
1760 -DEBUGGING=none DEBUGGING options
1761 -Dcc=gcc choose your compiler
1762 -Dprefix=/opt/perl5 choose your destination
1763 -E : stop at the end of questions, after having produced config.sh.
1764 -K : do not use unless you know what you are doing.
1765 -O : let -D and -U override definitions from loaded configuration file.
1766 -S : perform variable substitutions on all .SH files (can mix with -f)
1767 -U : undefine symbol:
1768 -U symbol symbol gets the value 'undef'
1769 -U symbol= symbol gets completely empty
1771 -A : manipulate symbol after the platform specific hints have been applied:
1772 -A append:symbol=value append value to symbol
1773 -A symbol=value like append:, but with a separating space
1774 -A define:symbol=value define symbol to have value
1775 -A clear:symbol define symbol to be ''
1776 -A define:symbol define symbol to be 'define'
1777 -A eval:symbol=value define symbol to be eval of value
1778 -A prepend:symbol=value prepend value to symbol
1779 -A undef:symbol define symbol to be 'undef'
1780 -A undef:symbol= define symbol to be ''
1781 e.g.: -A prepend:libswanted='cl pthread '
1782 -A ccflags=-DSOME_MACRO
1783 -V : print version number and exit (with a zero status).
1790 case "$fastread$alldone" in
1793 case "$extractsh" in
1796 if test ! -t 0; then
1797 echo "Say 'sh Configure', not 'sh <Configure'"
1807 true) exec 1>/dev/null;;
1810 : run the defines and the undefines, if any, but leave the file out there...
1813 : create the posthint manipulation script and leave the file out there...
1818 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1819 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1820 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1821 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1822 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1825 : Some greps do not return status, grrr.
1826 echo "grimblepritz" >grimble
1827 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1829 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1835 : the following should work in any shell
1839 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1840 cat >contains <<'EOSS'
1841 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1846 : Find the path to the source tree
1849 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1853 *) src=`cd ../$src && pwd` ;;
1866 if test -f $rsrc/Configure && \
1867 $contains "^package='$package'\$" $rsrc/Configure >/dev/null 2>&1
1869 : found it, so we are ok.
1872 for src in . .. ../.. ../../.. ../../../..; do
1873 if test -f ../$src/Configure && \
1874 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1885 Sorry, I can't seem to locate the source dir for $package. Please start
1886 Configure with an explicit path -- i.e. /some/path/Configure.
1894 echo "Sources for $package found in \"$src\"." >&4
1898 : script used to extract .SH files with variable substitutions
1899 cat >extract <<'EOS'
1901 echo "Doing variable substitutions on .SH files..."
1902 if test -f MANIFEST; then
1903 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1905 echo "(Looking for .SH files under the source directory.)"
1906 set x `(cd "$src"; find . -name "*.SH" -print)`
1910 0) set x `(cd "$src"; echo *.SH)`; shift;;
1912 if test ! -f "$src/$1"; then
1918 while test $name; do
1919 if test ! -d "$name"; then
1920 create="$name $create";
1921 name=`echo $name | sed -e "s|^[^/]*$||"`;
1922 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1927 for file in $create; do
1936 dir=`expr X$file : 'X\(.*\)/'`
1937 file=`expr X$file : 'X.*/\(.*\)'`
1938 (cd "$dir" && . ./$file)
1948 dir=`expr X$file : 'X\(.*\)/'`
1949 file=`expr X$file : 'X.*/\(.*\)'`
1950 (set x $dir; shift; eval $mkdir_p)
1951 sh <"$src/$dir/$file"
1960 if test -f "$src/config_h.SH"; then
1961 if test ! -f config.h; then
1962 : oops, they left it out of MANIFEST, probably, so do it anyway.
1963 . "$src/config_h.SH"
1968 : extract files and exit if asked to do so
1969 case "$extractsh" in
1971 case "$realsilent" in
1975 case "$config_sh" in
1976 '') config_sh='config.sh';;
1979 echo "Fetching answers from $config_sh..."
1982 test "$override" && . ./optdef.sh
1986 echo "Extraction done."
1991 : Eunice requires " " instead of "", can you believe it
1994 echo "Beginning of configuration questions for $package."
1996 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1998 : first determine how to suppress newline on echo command
2000 echo "Checking echo to see how to suppress newlines..."
2001 (echo "hi there\c" ; echo " ") >.echotmp
2002 if $contains c .echotmp >/dev/null 2>&1 ; then
2013 echo $n "The star should be here-->$c"
2017 : Now test for existence of everything in MANIFEST
2019 if test -f "$rsrc/MANIFEST"; then
2020 echo "First let's make sure your kit is complete. Checking..." >&4
2021 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | \
2022 (split -l 50 2>/dev/null || split -50)
2025 for filelist in x??; do
2026 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` \
2027 >/dev/null 2>>"$tmppwd/missing")
2029 if test -s missing; then
2033 THIS PACKAGE SEEMS TO BE INCOMPLETE.
2035 You have the option of continuing the configuration process, despite the
2036 distinct possibility that your kit is damaged, by typing 'y'es. If you
2037 do, don't blame me if something goes wrong. I advise you to type 'n'o
2038 and contact the author (perlbug@perl.org).
2041 echo $n "Continue? [n] $c" >&4
2045 echo "Continuing..." >&4
2049 echo "ABORTING..." >&4
2054 echo "Looks good..."
2057 echo "There is no MANIFEST file. I hope your kit is complete !"
2061 : Find the appropriate value for a newline for tr
2063 if test -n "$DJGPP"; then
2066 if test X"$trnl" = X; then
2067 case "`echo foo|tr '\n' x 2>/dev/null`" in
2071 if test X"$trnl" = X; then
2072 case "`echo foo|tr '\012' x 2>/dev/null`" in
2073 foox) trnl='\012' ;;
2076 if test X"$trnl" = X; then
2077 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
2078 fooxy) trnl='\n\r' ;;
2081 if test X"$trnl" = X; then
2084 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
2090 : compute the number of columns on the terminal for proper question formatting
2095 : set up the echo used in my read
2096 myecho="case \"\$xxxm\" in
2097 '') echo $n \"\$rp $c\" >&4;;
2099 '') echo $n \"[\$xxxm] $c\";;
2101 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
2103 echo $n \"[\$xxxm] $c\" >&4
2105 echo $n \"\$rp [\$xxxm] $c\" >&4
2111 : now set up to do reads with possible shell escape and default assignment
2117 case "\$fastread" in
2118 yes) case "\$dflt" in
2121 case "\$silent-\$rp" in
2126 *) case "\$silent" in
2127 true) case "\$rp" in
2132 while expr "X\$ans" : "X!" >/dev/null; do
2136 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2144 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2153 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2158 echo "(OK, I'll run with -d after this question.)" >&4
2161 echo "*** Sorry, \$1 not supported yet." >&4
2171 echo "*** Substitution done -- please confirm."
2173 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2178 echo "*** Error -- try again."
2185 case "\$ans\$xxxm\$nostick" in
2197 : create .config dir to save info across Configure sessions
2198 test -d ../.config || mkdir ../.config
2199 cat >../.config/README <<EOF
2200 This directory created by Configure to save information that should
2201 persist across sessions for $package.
2203 You may safely delete it if you wish.
2206 : See if we are using a devel version and want that
2207 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2210 usedevel="$define" ;;
2211 *) case "$xversion" in
2214 *** WHOA THERE!!! ***
2216 This is an UNSTABLE DEVELOPMENT release.
2217 The version of this $package distribution is $xversion, that is, odd,
2218 (as opposed to even) and that signifies a development release.
2219 If you want a maintenance release, you want an even-numbered version.
2221 Do ***NOT*** install this into production use.
2222 Data corruption and crashes are possible.
2224 It is most seriously suggested that you do not continue any further
2225 unless you want to help in developing and debugging Perl.
2227 If you *still* want to build perl, you can answer 'y' now,
2228 or pass -Dusedevel to Configure.
2231 rp='Do you really want to continue?'
2235 [yY]) echo >&4 "Okay, continuing."
2236 usedevel="$define" ;;
2237 *) echo >&4 "Okay, bye."
2248 case "$versiononly" in
2249 '') versiononly="$define" ;;
2251 case "$installusrbinperl" in
2252 '') installusrbinperl="$undef" ;;
2257 : general instructions
2260 user=`(logname) 2>/dev/null`
2262 '') user=`whoami 2>&1`;;
2264 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2267 rp='Would you like to see the instructions?'
2278 This installation shell script will examine your system and ask you questions
2279 to determine how the perl5 package should be installed. If you get
2280 stuck on a question, you may use a ! shell escape to start a subshell or
2281 execute a command. Many of the questions will have default answers in square
2282 brackets; typing carriage return will give you the default.
2284 On some of the questions which ask for file or directory names you are allowed
2285 to use the ~name construct to specify the login directory belonging to "name",
2286 even if you don't have a shell which knows about that. Questions where this is
2287 allowed will be marked "(~name ok)".
2291 dflt='Type carriage return to continue'
2295 The prompter used in this script allows you to use shell variables and
2296 backticks in your answers. You may use $1, $2, etc... to refer to the words
2297 in the default answer, as if the default line was a set of arguments given to a
2298 script shell. This means you may also use $* to repeat the whole default line,
2299 so you do not have to re-type everything to add something to the default.
2301 Every time there is a substitution, you will have to confirm. If there is an
2302 error (e.g. an unmatched backtick), the default answer will remain unchanged
2303 and you will be prompted again.
2305 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2306 the questions and use the computed defaults (or the previous answers if there
2307 was already a config.sh file). Type 'Configure -h' for a list of options.
2308 You may also start interactively and then answer '& -d' at any prompt to turn
2309 on the non-interactive behaviour for the remainder of the execution.
2315 Much effort has been expended to ensure that this shell script will run on any
2316 Unix system. If despite that it blows up on yours, your best bet is to edit
2317 Configure and run it again. If you can't run Configure for some reason,
2318 you'll have to generate a config.sh file by hand. Whatever problems you
2319 have, let me (perlbug@perl.org) know how I blew it.
2321 This installation script affects things in two ways:
2323 1) it may do direct variable substitutions on some of the files included
2325 2) it builds a config.h file for inclusion in C programs. You may edit
2326 any of these files as the need arises after running this script.
2328 If you make a mistake on a question, there is no easy way to back up to it
2329 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2330 files. Configure will offer to let you do this before it runs the SH files.
2333 dflt='Type carriage return to continue'
2335 case "$firsttime" in
2336 true) echo $user >>../.config/instruct;;
2340 : Set 'sysroot' to change the logical root directory to your headers and libraries see man gcc
2341 : This is primarily meant for cross-compile environments, and may fail to be useful in other cases
2342 if test "X$sysroot" = X; then
2347 echo "Using $sysroot to find your headers and libraries, adding to ccflags"
2348 # _sysroot is used in places where we need --sysroot=foo
2349 # but using the rest of the flags could cause issues.
2350 _sysroot="--sysroot=$sysroot";
2354 ccflags="$ccflags $_sysroot"
2359 ldflags="$ldflags $_sysroot"
2364 cppflags="$cppflags $_sysroot"
2366 # lddlflags updated below in lddlflags section;
2367 # same with cccdlflags
2371 # Adjust some defaults to also use $sysroot
2372 for var in xlibpth loclibpth locincpth glibpth; do
2375 for path in $xxx; do
2376 eval $var=\"\$$var $sysroot$path\"
2382 : find out where common programs are
2384 echo "Locating common programs..." >&4
2397 if test -d \$dir/\$thing; then
2403 for thisthing in \$dir/\$thing; do
2404 : just loop through to pick last item
2406 if test -f \$thisthing; then
2409 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2412 elif test -f \$dir/\$thing.exe; then
2413 if test -n "$DJGPP"; then
2414 echo \$dir/\$thing.exe
2415 elif test "$eunicefix" != ":"; then
2416 : on Eunice apparently
2469 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2470 pth="$pth $sysroot/lib $sysroot/usr/lib"
2471 for file in $loclist; do
2475 if test -f "$xxx"; then
2478 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2479 xxx=`./loc $file $file $pth`
2482 '') xxx=`./loc $file $file $pth`;;
2483 *) xxx=`./loc $xxx $xxx $pth`;;
2485 eval $file=$xxx$_exe
2489 echo $file is in $xxx.
2492 echo $file is in $xxx.
2495 echo "I don't know where '$file' is, and my life depends on it." >&4
2496 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2502 echo "Don't worry if any of the following aren't found..."
2504 for file in $trylist; do
2508 if test -f "$xxx"; then
2511 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2512 xxx=`./loc $file $file $pth`
2515 '') xxx=`./loc $file $file $pth`;;
2516 *) xxx=`./loc $xxx $xxx $pth`;;
2518 eval $file=$xxx$_exe
2522 echo $file is in $xxx.
2525 echo $file is in $xxx.
2528 echo "I don't see $file out there, $say."
2535 echo "Substituting grep for egrep."
2542 *) if $less -R </dev/null >/dev/null 2>&1; then
2543 echo "Substituting less -R for less."
2551 echo "Substituting cp for ln."
2560 echo "I can't find make or gmake, and my life depends on it." >&4
2561 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2569 *) # We can't have osname yet.
2570 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2571 # Assume that gmake, if found, is definitely GNU make
2572 # and prefer it over the system make.
2573 echo "Substituting gmake for make."
2581 echo "Hopefully test is built into your sh."
2584 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2585 echo "Using the test built into your sh."
2593 echo "Hopefully echo is built into your sh."
2598 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2599 $echo $n "hi there$c" >foo1
2600 echo $n "hi there$c" >foo2
2601 if cmp foo1 foo2 >/dev/null 2>&1; then
2602 echo "They are compatible. In fact, they may be identical."
2609 They are not compatible! You are probably running ksh on a non-USG system.
2610 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2611 have echo built in and we may have to run some Bourne shell scripts. That
2612 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2615 $echo $n "The star should be here-->$c"
2622 # This question was auctioned at YAPC::Europe-2007 in Vienna
2623 # I never promised you could answer it. I only auctioned the question.
2625 The following message is sponsored by
2627 Dresden.pm<--The stars should be here.
2629 Dear Perl user, system administrator or package
2630 maintainer, the Perl community sends greetings to
2631 you. Do you (emblematical) greet back [Y/n]? n
2635 : Check what type of C compiler we use
2639 cat <<'EOSC' >>trygcc
2644 int main(int argc, char *argv[]) {
2648 if $cc -o try $ccflags $ldflags try.c; then
2651 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2657 # Skip this test because it gives a false match on output like:
2658 # ./trygcc: line 23: cc: command not found
2659 # case "`$cc -v -c try.c 2>&1`" in
2660 # *gcc*) trygcc=no ;;
2662 if $test X"$trygcc" = Xyes; then
2663 if gcc -o try -c try.c; then
2665 echo "You seem to have a working gcc, though." >&4
2666 # Switching compilers may undo the work of hints files.
2667 # The most common problem is -D_REENTRANT for threads.
2668 # This heuristic catches that case, but gets false positives
2669 # if -Dusethreads was not actually specified. Better to
2670 # bail out here with a useful message than fail
2671 # mysteriously later. Should we perhaps just try to
2672 # re-invoke Configure -Dcc=gcc config_args ?
2673 if $test -f usethreads.cbu; then
2676 *** However, any setting of the C compiler flags (e.g. for thread support)
2677 *** will be lost. It may be necessary for you to restart Configure and
2678 *** add -Dcc=gcc to your Configure command line.
2681 rp="Would you like to go ahead and try gcc anyway?"
2684 rp="Would you like to use it?"
2687 if $test -f myread; then
2690 if $test -f UU/myread; then
2693 echo "Cannot find myread, sorry. Aborting." >&2
2698 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2711 cat <<'EOSC' >>checkcc
2716 int main(int argc, char *argv[]) {
2720 if $cc -o try $ccflags $ldflags try.c; then
2723 if $test X"$despair" = Xyes; then
2724 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2727 You need to find a working C compiler.
2728 Either (purchase and) install the C compiler supplied by your OS vendor,
2729 or for a free C compiler try http://gcc.gnu.org/
2730 I cannot continue any further, aborting.
2739 : determine whether symbolic links are supported
2742 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2743 echo "Symbolic links are supported." >&4
2746 echo "Symbolic links are NOT supported." >&4
2751 : determine whether symbolic links are supported
2755 echo "Checking how to test for symbolic links..." >&4
2757 if $test "X$issymlink" = X; then
2759 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2760 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2762 if test $? = 0; then
2765 echo "Your builtin 'test -h' may be broken." >&4
2768 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2771 if test -f "$p/$test"; then
2780 echo "Trying external '$test -h'." >&4
2781 issymlink="$test -h"
2782 if $test ! -h sym >/dev/null 2>&1; then
2783 echo "External '$test -h' is broken, too." >&4
2791 if $test "X$issymlink" = X; then
2792 if $test -L sym 2>/dev/null; then
2793 issymlink="$test -L"
2794 echo "The builtin '$test -L' worked." >&4
2797 if $test "X$issymlink" != X; then
2798 echo "You can test for symbolic links with '$issymlink'." >&4
2800 echo "I do not know how you can test for symbolic links." >&4
2804 *) echo "No symbolic links, so not testing for their testing..." >&4
2809 : Make symlinks util
2810 case "$mksymlinks" in
2813 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2816 *) case "$lns:$issymlink" in
2817 *"ln"*" -s:"*"test -"?)
2818 echo "Creating the symbolic links..." >&4
2820 awk '{print $1}' $src/MANIFEST | sed -e 's:/\([^/]*\)$: \1:' |
2830 print "# dir = ", dir, "file = ", file
2831 mf[dir] = mf[dir]" "src"/"dir"/"file;
2834 if (d != ".") { print("mkdir -p "d) }
2835 print("ln -sf "mf[d]" "d);
2837 }' src="$src" > UU/mksymlinks.$$
2841 if test ! -d t/base; then
2842 echo "Failed to create the subdirectories. Aborting." >&4
2846 if test ! -f t/base/lex.t; then
2847 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2850 if test ! -f win32/win32.c; then
2851 echo "Failed to create the symlinks (win32/win32.c missing). Aborting." >&4
2856 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2864 : Check for Cross-Compilation
2865 if $test "X$targethost" = "X"; then
2868 if $test "X$targetenv" = "X"; then
2871 case "$usecrosscompile" in
2873 $echo "Cross-compiling..."
2876 *-gcc*|*-g++*) # A cross-compiling gcc, probably.
2877 # arm-linux-androideabi-gcc -> arm-linux-androideabi
2878 # x86_64-w64-mingw32-gcc.exe -> x86_64-w64-mingw32
2879 targetarch=`$echo $cc|$sed 's/-g[c\+][c\+].*$//'`
2880 ar=`$echo $cc|$sed 's/-g[c\+][c\+]/-ar/'`
2881 # leave out ld, choosing it is more complex
2882 nm=`$echo $cc|$sed 's/-g[c\+][c\+]/-nm/'`
2883 ranlib=`$echo $cc|$sed 's/-g[c\+][c\+]/-ranlib/'`
2884 # We are in a weird spot. Just before us, some values
2885 # were 'saved', to be restored after the hints are
2886 # run. This means that the changes we made to ar,
2887 # nm and ranlib will get reverted.
2888 # To avoid that, we hijack the saving mechanism and
2889 # have it save our new values.
2890 for file in ar nm ranlib; do
2892 eval $file=$xxx$_exe
2897 case "$targetarch" in
2898 '') echo "Targetarch not defined." >&4; croak=y ;;
2899 *) echo "Using targetarch $targetarch." >&4 ;;
2901 case "$targethost" in
2902 '') echo "Targethost not defined." >&4; croak=y ;;
2903 *) echo "Using targethost $targethost." >&4
2908 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2910 : compile a host miniperl and generate_uudmap, unless we got passed them
2911 if $test "X$hostperl" = X; then
2912 echo "Building host miniperl and generate_uudmap binaries" >&4
2920 $src/Configure -des -Dusedevel -Dmksymlinks
2922 case "$hostgenerate" in
2923 '') $make generate_uudmap
2924 hostgenerate=$src/host/generate_uudmap
2926 "$undef") hostgenerate=''
2929 hostperl=$src/host/miniperl
2932 hostosname=`$hostperl -le 'print $^O'`
2935 usecrosscompile="$undef"
2939 : Define -Dtargethost=somecomputer to run compiled tests on another machine
2940 case "$targethost" in
2941 '') echo "Checking for cross-compile" >&4
2942 case "$usecrosscompile$multiarch" in
2943 *$define*) echo "Skipping the try tests in the rest of Configure as no targethost was defined when cross-compiling" >&4
2944 if [ -f Makefile ]; then
2946 echo "Now you must ensure config.sh, config.h and the generated headers exist and run a $make."
2948 echo "Configure done."
2952 *) echo "No targethost for running compiler tests against defined, running locally" >&4
2959 *) echo "Using targethost $targethost." >&4
2961 /*) run=$src/Cross/run
2962 targetmkdir=$src/Cross/mkdir
2964 from=$src/Cross/from
2966 *) pwd=`$test -f ../Configure & cd ..; pwd`
2968 targetmkdir=$pwd/Cross/mkdir
2970 from=$pwd/Cross/from
2973 case "$targetrun" in
2974 '') targetrun=ssh ;;
2979 case "$targetfrom" in
2980 '') targetfrom=scp ;;
2984 from=$from-$targetfrom
2985 case "$targetdir" in
2987 echo "Guessing targetdir $targetdir." >&4
2990 case "$targetuser" in
2992 echo "Guessing targetuser $targetuser." >&4
2995 case "$targetport" in
2997 echo "Guessing targetport $targetport." >&4
3000 case "$targetfrom" in
3004 case "$targetrun" in
3024 '') cwd=$targetdir ;;
3029 $targetrun -p $targetport -l $targetuser $targethost "cd \$cwd && \$env \$exe \$@"
3035 *) echo "Unknown targetrun '$targetrun'" >&4
3039 case "$targetmkdir" in
3041 cat >$targetmkdir <<EOF
3043 $targetrun -p $targetport -l $targetuser $targethost "mkdir -p \$@"
3045 $chmod a+rx $targetmkdir
3047 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
3059 $targetmkdir \`dirname \$f\`
3060 $targetto -P $targetport -r $q \$f $targetuser@$targethost:\$f 2>/dev/null || exit 1
3063 $targetmkdir $targetdir/\`dirname \$f\`
3064 $targetto -P $targetport -r $q \$f $targetuser@$targethost:$targetdir/\$f 2>/dev/null || exit 1
3077 $mkdir -p $targetdir/\`dirname \$f\`
3078 $cp \$f $targetdir/\$f || exit 1
3081 $targetmkdir $targetdir/\`dirname \$f\`
3082 $cp \$f $targetdir/\$f || exit 1
3089 *) echo "Unknown targetto '$targetto'" >&4
3093 case "$targetfrom" in
3100 $targetfrom -P $targetport $q $targetuser@$targethost:$targetdir/\$f . || exit 1
3105 cp) cat >$from <<EOF
3110 cp $targetdir/\$f . || exit 1
3115 *) echo "Unknown targetfrom '$targetfrom'" >&4
3119 if $test ! -f $run; then
3120 echo "Target 'run' script '$run' not found." >&4
3124 if $test ! -f $to; then
3125 echo "Target 'to' script '$to' not found." >&4
3129 if $test ! -f $from; then
3130 echo "Target 'from' script '$from' not found." >&4
3134 if $test ! -f $run -o ! -f $to -o ! -f $from; then
3138 Using '$run' for remote execution,
3139 and '$from' and '$to'
3140 for remote file transfer.
3146 usecrosscompile="$undef"
3151 : see whether [:lower:] and [:upper:] are supported character classes
3153 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
3155 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
3159 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
3160 # (0xd9 and 0xe2), therefore that is a nice testing point.
3161 if test "X$up" = X -o "X$low" = X; then
3162 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
3168 if test "X$up" = X -o "X$low" = X; then
3169 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
3175 if test "X$up" = X -o "X$low" = X; then
3176 case "`echo RS | od -x 2>/dev/null`" in
3178 echo "Hey, this might be EBCDIC." >&4
3179 if test "X$up" = X -o "X$low" = X; then
3180 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
3181 rs) up='[A-IJ-RS-Z]'
3186 if test "X$up" = X -o "X$low" = X; then
3187 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
3197 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
3199 echo "Using $up and $low to convert case." >&4
3202 echo "I don't know how to translate letters from upper to lower case." >&4
3203 echo "Your tr is not acting any way I know of." >&4
3207 : set up the translation script tr, must be called with ./tr of course
3211 '[A-Z][a-z]') exec $tr '$up' '$low';;
3212 '[a-z][A-Z]') exec $tr '$low' '$up';;
3219 : Try to determine whether config.sh was made on this system
3220 case "$config_sh" in
3222 myuname=`$uname -a 2>/dev/null`
3223 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
3224 # Downcase everything to avoid ambiguity.
3225 # Remove slashes and single quotes so we can use parts of this in
3226 # directory and file names.
3227 # Remove newlines so myuname is sane to use elsewhere.
3228 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
3229 # because the A-Z/a-z are not consecutive.
3230 myuname=`echo $myuname | $sed -e "s,['/],,g" | \
3231 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
3232 newmyuname="$myuname"
3234 case "$knowitall" in
3236 if test -f ../config.sh; then
3237 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3238 eval "`grep myuname= ../config.sh`"
3240 if test "X$myuname" = "X$newmyuname"; then
3248 : Get old answers from old config file if Configure was run on the
3249 : same system, otherwise use the hints.
3252 if test -f config.sh; then
3254 rp="I see a config.sh file. Shall I use it to set the defaults?"
3257 n*|N*) echo "OK, I'll ignore it."
3258 mv config.sh config.sh.old
3259 myuname="$newmyuname"
3261 *) echo "Fetching default answers from your old config.sh file..." >&4
3269 : Older versions did not always set $sh. Catch re-use of such
3279 if test ! -f config.sh; then
3282 First time through, eh? I have some defaults handy for some systems
3283 that need some extra help getting the Configure answers right:
3286 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3288 : Half the following guesses are probably wrong... If you have better
3289 : tests or hints, please send them to perlbug@perl.org
3290 : The metaconfig authors would also appreciate a copy...
3291 $test -f /irix && osname=irix
3292 $test -f /xenix && osname=sco_xenix
3293 $test -f /dynix && osname=dynix
3294 $test -f /dnix && osname=dnix
3295 $test -f /lynx.os && osname=lynxos
3296 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3297 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3298 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3299 $test -f /bin/mips && /bin/mips && osname=mips
3300 $test -d /usr/apollo/bin && osname=apollo
3301 $test -f /etc/saf/_sactab && osname=svr4
3302 $test -d /usr/include/minix && osname=minix
3303 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3304 if $test -d /MachTen -o -d /MachTen_Folder; then
3306 if $test -x /sbin/version; then
3307 osvers=`/sbin/version | $awk '{print $2}' |
3308 $sed -e 's/[A-Za-z]$//'`
3309 elif $test -x /usr/etc/version; then
3310 osvers=`/usr/etc/version | $awk '{print $2}' |
3311 $sed -e 's/[A-Za-z]$//'`
3317 $test -f /sys/posix.dll &&
3318 $test -f /usr/bin/what &&
3319 set X `/usr/bin/what /sys/posix.dll` &&
3320 $test "$3" = UWIN &&
3324 if $test -f $uname; then
3332 umips) osname=umips ;;
3335 [23]100) osname=mips ;;
3337 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3338 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3341 elif $test -f /etc/kconfig; then
3343 if test "$lns" = "$ln -s"; then
3345 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3347 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3354 if test -n "$DJGPP"; then
3363 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3365 # oslevel can fail with:
3366 # oslevel: Unable to acquire lock.
3367 *not\ found) osvers="$4"."$3" ;;
3368 '<3240'|'<>3240') osvers=3.2.0 ;;
3369 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3370 '=3250'|'>3250') osvers=3.2.5 ;;
3374 bitrig) osname=bitrig
3377 bsd386) osname=bsd386
3380 cygwin*) osname=cygwin
3383 *dc.osx) osname=dcosx
3389 domainos) osname=apollo
3395 dragonfly) osname=dragonfly
3398 dynixptx*) osname=dynixptx
3399 osvers=`echo "$4"|sed 's/^v//'`
3401 freebsd) osname=freebsd
3403 genix) osname=genix ;;
3407 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3420 $test -f /system/lib/libandroid.so && osname=linux-android
3424 netbsd*) osname=netbsd
3427 news-os) osvers="$3"
3429 4*) osname=newsos4 ;;
3433 nonstop-ux) osname=nonstopux ;;
3434 openbsd) osname=openbsd
3440 POSIX-BC | posix-bc ) osname=posix-bc
3443 powerux | power_ux | powermax_os | powermaxos | \
3444 powerunix | power_unix) osname=powerux
3450 solaris) osname=solaris
3452 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3459 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3463 titanos) osname=titanos
3472 ultrix) osname=ultrix
3475 osf1|mls+) case "$5" in
3478 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3481 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3484 hp*) osname=hp_osf1 ;;
3485 mips) osname=mips_osf1 ;;
3488 # UnixWare 7.1.2 is known as Open UNIX 8
3489 openunix|unixware) osname=svr5
3497 $2) case "$osname" in
3501 : svr4.x or possibly later
3511 if test -f /stand/boot ; then
3512 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3513 if test -n "$INITPROG" -a -f "$INITPROG"; then
3514 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3515 if test -n "$isesix"; then
3523 *) if test -f /etc/systemid; then
3525 set `echo $3 | $sed 's/\./ /g'` $4
3526 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3528 elif $test -f $src/hints/sco_$1_$2.sh; then
3530 elif $test -f $src/hints/sco_$1.sh; then
3535 '') : Still unknown. Probably a generic Sys V.
3544 *) case "$osname" in
3545 '') : Still unknown. Probably a generic BSD.
3553 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3554 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3555 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3558 $rm -f UU/kernel.what
3559 elif test -d c:/. -o -n "$is_os2" ; then
3566 case "$targetarch" in
3569 case "$targetarch" in
3571 # Will load qnx.sh, which should change osname to nto
3576 # Catch arm-linux-androideabi, mipsel-linux-android,
3577 # and i686-linux-android
3578 osname=linux-android
3582 # Something like arm-linux-gnueabihf is really just
3589 # XXX perhaps we should just assume
3590 # osvers to be 2, or maybe take the value
3591 # from targetarch. Using $run before the
3592 # hints are run is somewhat icky.
3593 set X `$run $uname -a 2>/dev/null`
3596 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3601 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3608 : Now look for a hint file osname_osvers, unless one has been
3609 : specified already.
3612 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3613 : Also try without trailing minor version numbers.
3614 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3615 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3616 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3617 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3620 *) case "$osvers" in
3623 *) if $test -f $src/hints/$file.sh ; then
3625 elif $test -f $src/hints/$xfile.sh ; then
3627 elif $test -f $src/hints/$xxfile.sh ; then
3629 elif $test -f $src/hints/$xxxfile.sh ; then
3631 elif $test -f $src/hints/$xxxxfile.sh ; then
3633 elif $test -f "$src/hints/${osname}.sh" ; then
3642 if $test -f Policy.sh ; then
3645 none) dflt="Policy" ;;
3646 *) dflt="Policy $dflt" ;;
3651 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3655 if $test -f Policy.sh ; then
3658 There's also a Policy hint file available, which should make the
3659 site-specific (policy) questions easier to answer.
3666 You may give one or more space-separated answers, or "none" if appropriate.
3667 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3668 previous run of Configure, you may specify it as well as or instead of
3669 OS-specific hints. If hints are provided for your OS, you should use them:
3670 although Perl can probably be built without hints on many platforms, using
3671 hints often improve performance and may enable features that Configure can't
3672 set up on its own. If there are no hints that match your OS, specify "none";
3673 DO NOT give a wrong version or a wrong OS.
3677 rp="Which of these apply, if any?"
3680 for file in $tans; do
3681 if $test X$file = XPolicy -a -f Policy.sh; then
3683 $cat Policy.sh >> UU/config.sh
3684 elif $test -f $src/hints/$file.sh; then
3685 . $src/hints/$file.sh
3686 $cat $src/hints/$file.sh >> UU/config.sh
3687 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3690 : Give one chance to correct a possible typo.
3691 echo "$file.sh does not exist"
3693 rp="hint to use instead?"
3695 for file in $ans; do
3696 if $test -f "$src/hints/$file.sh"; then
3697 . $src/hints/$file.sh
3698 $cat $src/hints/$file.sh >> UU/config.sh
3699 elif $test X$ans = X -o X$ans = Xnone ; then
3702 echo "$file.sh does not exist -- ignored."
3709 : Remember our hint file for later.
3710 if $test -f "$src/hints/$file.sh" ; then
3720 echo "Fetching default answers from $config_sh..." >&4
3724 cp $config_sh config.sh 2>/dev/null
3734 test "$override" && . ./optdef.sh
3736 : Restore computed paths
3737 for file in $loclist $trylist; do
3738 eval $file="\$_$file"
3743 Configure uses the operating system name and version to set some defaults.
3744 The default value is probably right if the name rings a bell. Otherwise,
3745 since spelling matters for me, either accept the default or answer "none"
3752 ''|' '|none) dflt=none ;;
3753 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3756 *) dflt="$osname" ;;
3758 rp="Operating system name?"
3762 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3768 ''|' '|none) dflt=none ;;
3769 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3770 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3772 ''|' ') dflt=none ;;
3777 *) dflt="$osvers" ;;
3779 rp="Operating system version?"
3789 : who configured the system
3790 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3793 cf_by=`(logname) 2>/dev/null`
3796 cf_by=`(whoami) 2>/dev/null`
3798 "") cf_by=unknown ;;
3803 : decide how portable to be. Allow command line overrides.
3804 case "$d_portable" in
3806 *) d_portable="$define" ;;
3809 : set up shell script to do ~ expansion
3815 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3818 if $test -f /bin/csh; then
3819 /bin/csh -f -c "glob \$1"
3824 name=\`$expr x\$1 : '..\([^/]*\)'\`
3825 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3826 if $test ! -d "\$dir"; then
3828 echo "\$me: can't locate home directory for: \$name" >&2
3833 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3849 : now set up to get a file name
3853 cat <<'EOSC' >>getfile
3869 : getfile will accept an answer from the comma-separated list
3870 : enclosed in parentheses even if it does not meet other criteria.
3871 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3872 fn=`echo $fn | sed 's/(.*)//'`
3878 loc_file=`expr $fn : '.*:\(.*\)'`
3879 fn=`expr $fn : '\(.*\):.*'`
3887 */*) fullpath=true;;
3896 *e*) exp_file=true;;
3899 *p*) nopath_ok=true;;
3904 *d*) type='Directory';;
3905 *l*) type='Locate';;
3910 Locate) what='File';;
3915 case "$d_portable" in
3923 while test "$type"; do
3928 true) rp="$rp (~name ok)";;
3931 if test -f UU/getfile.ok && \
3932 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3951 value=`UU/filexp $ans`
3954 if test "$ans" != "$value"; then
3955 echo "(That expands to $value on this system.)"
3969 /*) value="$ansexp" ;;
3970 [a-zA-Z]:/*) value="$ansexp" ;;
3975 echo "I shall only accept a full path name, as in /bin/ls." >&4
3976 echo "Use a ! shell escape if you wish to check pathnames." >&4
3979 echo "Please give a full path name, starting with slash." >&4
3982 echo "Note that using ~name is ok provided it expands well." >&4
3995 for fp in $gfpth; do
3996 if test "X$fp" = X.; then
4001 if test -f "$pf"; then
4003 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
4005 echo "($value is not a plain file, but that's ok.)"
4008 if test X"$type" = X; then
4015 for fp in $gfpth; do
4016 if test "X$fp" = X.; then
4021 direxp="$fp/$ansexp"
4023 if test -d "$direxp"; then
4031 if test -d "$ansexp"; then
4032 echo "(Looking for $loc_file in directory $value.)"
4033 value="$value/$loc_file"
4034 ansexp="$ansexp/$loc_file"
4036 if test -f "$ansexp"; then
4039 case "$nopath_ok" in
4040 true) case "$value" in
4042 *) echo "Assuming $value will be in people's path."
4058 if test "$fastread" = yes; then
4063 rp="$what $value doesn't exist. Use that name anyway?"
4082 test "X$gfpthkeep" != Xy && gfpth=""
4085 : determine root of directory hierarchy where package will be installed.
4088 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
4091 dflt=`echo "$prefix" | sed 's/.$//'`
4099 By default, $package will be installed in $dflt/bin, manual pages
4100 under $dflt/man, etc..., i.e. with $dflt as prefix for all
4101 installation directories. Typically this is something like /usr/local.
4102 If you wish to have binaries under /usr/bin but other parts of the
4103 installation under /usr/local, that's ok: you will be prompted
4104 separately for each of the installation directories, the prefix being
4105 only used to set the defaults.
4109 rp='Installation prefix to use?'
4117 *) oldprefix="$prefix";;
4124 : allow them to override the AFS root
4127 *) afsroot=$afsroot ;;
4133 $define|true) afs=true ;;
4134 $undef|false) afs=false ;;
4135 *) if $test -d $afsroot; then
4143 echo "AFS may be running... I'll be extra cautious then..." >&4
4145 echo "AFS does not seem to be running..." >&4
4148 : determine installation prefix for where package is to be installed.
4152 Since you are running AFS, I need to distinguish the directory in which
4153 files will reside from the directory in which they are installed (and from
4154 which they are presumably copied to the former directory by occult means).
4157 case "$installprefix" in
4158 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
4159 *) dflt="$installprefix";;
4164 In some special cases, particularly when building $package for distribution,
4165 it is convenient to distinguish the directory in which files should be
4166 installed from the directory ($prefix) in which they will
4167 eventually reside. For most users, these two directories are the same.
4170 case "$installprefix" in
4172 *) dflt=$installprefix;;
4176 rp='What installation prefix should I use for installing files?'
4178 installprefix="$ans"
4179 installprefixexp="$ansexp"
4181 : Perform the prefixexp/installprefixexp correction if necessary
4182 cat <<EOS >installprefix
4185 cat <<'EOSC' >>installprefix
4186 : Change installation prefix, if necessary.
4187 if $test X"$prefix" != X"$installprefix"; then
4188 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
4190 eval "install${prefixvar}=\"\$${prefixvar}exp\""
4193 chmod +x installprefix
4194 $eunicefix installprefix
4196 : Set variables such as privlib and privlibexp from the output of ./getfile
4197 : performing the prefixexp/installprefixexp correction if necessary.
4198 cat <<EOS >setprefixvar
4201 cat <<'EOSC' >>setprefixvar
4202 eval "${prefixvar}=\"\$ans\""
4203 eval "${prefixvar}exp=\"\$ansexp\""
4206 chmod +x setprefixvar
4207 $eunicefix setprefixvar
4209 : set up the script used to warn in case of inconsistency
4218 '') echo "The $hint value for \$$var on this machine was \"$was\"!" >&4
4220 *) echo "Hmm. Based on the hints in hints/$hintfile.sh, " >&4
4221 echo "the $hint value for \$$var on this machine was \"$was\"!" >&4
4226 echo "*** WHOA THERE!!! ***" >&4
4227 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
4230 rp=" Keep the $hint value?"
4233 y) td=$was; tu=$was;;
4237 : function used to set '$1' to '$val'
4238 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
4240 $define$undef) . ./whoa; eval "$var=\$td";;
4241 $undef$define) . ./whoa; eval "$var=\$tu";;
4242 *) eval "$var=$val";;
4245 : get the patchlevel
4247 echo "Getting the current patchlevel..." >&4
4248 if $test -r $rsrc/patchlevel.h;then
4249 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
4250 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4251 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4252 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4253 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4254 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4255 perl_patchlevel=`egrep ',"(MAINT|SMOKE)[0-9][0-9]*"' $rsrc/patchlevel.h|tail -1|sed 's/[^0-9]//g'`
4264 $echo "(You do not have patchlevel.h. Eek.)"
4266 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
4267 version_patchlevel_string="version $patchlevel subversion $subversion"
4268 case "$perl_patchlevel" in
4270 *) perl_patchlevel=`echo $perl_patchlevel | sed 's/.* //'`
4271 version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel"
4275 $echo "(You have $package $version_patchlevel_string.)"
4279 : XXX Should be a Configure test for double-dots in filenames.
4280 version=`echo $revision $patchlevel $subversion | \
4281 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4282 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4283 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4286 version=`echo $revision $patchlevel $subversion | \
4287 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4288 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4289 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4292 : Special case the 5.005_xx maintenance series, which used 5.005
4293 : without any subversion label as a subdirectory in $sitelib
4294 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4295 api_versionstring='5.005'
4298 : Do we want threads support and if so, what type
4299 case "$usethreads" in
4300 $define|true|[yY]*) dflt='y';;
4301 *) # Catch case where user specified ithreads or 5005threads but
4302 # forgot -Dusethreads (A.D. 4/2002)
4303 case "$useithreads$use5005threads" in
4304 *$define*) dflt='y';;
4311 Perl can be built to offer a form of threading support on some systems
4312 To do so, Configure can be run with -Dusethreads.
4314 Note that Perl built with threading support runs slightly slower
4315 and uses slightly more memory than plain Perl.
4317 If this doesn't make any sense to you, just accept the default '$dflt'.
4319 rp='Build a threading Perl?'
4322 y|Y) val="$define" ;;
4328 if $test $patchlevel -lt 9; then
4329 case "$usethreads" in
4331 : Default to ithreads unless overridden on command line or with
4334 case "$use5005threads" in
4336 echo "5.005 threads are no longer supported"
4340 case "$useithreads" in
4341 $undef|false|[nN]*) dflt='n';;
4343 rp='Use the newer interpreter-based ithreads?'
4346 y|Y) val="$define" ;;
4351 : Now set use5005threads to the opposite value.
4352 case "$useithreads" in
4353 $define) val="$undef" ;;
4360 useithreads="$undef"
4361 use5005threads="$undef"
4365 case "$useithreads$use5005threads" in
4369 You cannot have both the ithreads and the 5.005 threads enabled
4370 at the same time. Disabling the 5.005 threads since they are
4371 much less stable than the ithreads.
4374 use5005threads="$undef"
4379 : perl-5.9.x and later
4381 if test X"$usethreads" = "X$define"; then
4382 case "$use5005threads" in
4386 5.005 threads has been removed for 5.10. Perl will be built using ithreads.
4393 use5005threads="$undef"
4394 useithreads="$usethreads"
4397 case "$d_oldpthreads" in
4398 '') : Configure tests would be welcome here. For now, assume undef.
4400 *) val="$d_oldpthreads" ;;
4406 : Look for a hint-file generated 'call-back-unit'. If the
4407 : user has specified that a threading perl is to be built,
4408 : we may need to set or change some other defaults.
4409 if $test -f usethreads.cbu; then
4410 echo "Your platform has some specific hints regarding threaded builds, using them..."
4413 case "$usethreads" in
4414 "$define"|true|[yY]*)
4416 (Your platform does not have any specific hints for threaded builds.
4417 Assuming POSIX threads, then.)
4423 : Check if multiplicity is required
4426 Perl can be built so that multiple Perl interpreters can coexist
4427 within the same Perl executable.
4430 case "$useithreads" in
4433 This multiple interpreter support is required for interpreter-based threads.
4437 *) case "$usemultiplicity" in
4438 $define|true|[yY]*) dflt='y';;
4442 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4443 rp='Build Perl for multiplicity?'
4446 y|Y) val="$define" ;;
4454 : Check if usequadmath is requested
4455 case "$usequadmath" in
4456 "$define"|true|[yY]*)
4457 usequadmath="$define"
4459 *) usequadmath="$undef" ;;
4462 : Check if morebits is requested
4463 case "$usemorebits" in
4464 "$define"|true|[yY]*)
4465 use64bitint="$define"
4466 uselongdouble="$define"
4467 usemorebits="$define"
4469 *) usemorebits="$undef"
4473 : Determine the C compiler to be used
4479 rp="Use which C compiler?"
4483 : See whether they have no cc but they do have gcc
4485 if $test -f cc.cbu; then
4490 : make some quick guesses about what we are up against
4492 $echo $n "Hmm... $c"
4502 $cat $sysroot/usr/include/signal.h $sysroot/usr/include/sys/signal.h >foo 2>/dev/null
4503 if test -f /osf_boot || $contains 'OSF/1' $sysroot/usr/include/ctype.h >/dev/null 2>&1
4505 echo "Looks kind of like an OSF/1 system, but we'll see..."
4507 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4508 xxx=`./loc addbib blurfl $pth`
4509 if $test -f $xxx; then
4510 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4514 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4515 echo "Looks kind of like an extended USG system, but we'll see..."
4517 echo "Looks kind of like a USG system, but we'll see..."
4521 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4522 echo "Looks kind of like a BSD system, but we'll see..."
4526 echo "Looks kind of like a Version 7 system, but we'll see..."
4529 case "$eunicefix" in
4532 There is, however, a strange, musty smell in the air that reminds me of
4533 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4537 : it so happens the Eunice I know will not run shell scripts in Unix format
4541 echo "Congratulations. You aren't running Eunice."
4545 : Detect OS2. The p_ variable is set above in the Head.U unit.
4546 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4547 : semicolon as a patch separator
4552 I have the feeling something is not exactly right, however...don't tell me...
4553 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4554 (Or you may be running DOS with DJGPP.)
4559 if test -f /xenix; then
4560 echo "Actually, this looks more like a XENIX system..."
4565 echo "It's not Xenix..."
4570 if test -f /venix; then
4571 echo "Actually, this looks more like a VENIX system..."
4578 echo "Nor is it Venix..."
4581 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4582 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4585 : Check if we are using GNU gcc and what its version is
4587 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4591 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4593 printf("%s\n", __VERSION__);
4595 printf("%s\n", "1");
4601 if $cc -o try $ccflags $ldflags try.c; then
4602 gccversion=`$run ./try`
4603 case "$gccversion" in
4604 '') echo "You are not using GNU cc." ;;
4605 *) echo "You are using GNU cc $gccversion."
4611 echo "*** WHOA THERE!!! ***" >&4
4612 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4613 case "$knowitall" in
4615 echo " You'd better start hunting for one and let me know about it." >&4
4621 case "$gccversion" in
4622 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4624 case "$gccversion" in
4625 '') gccosandvers='' ;;
4626 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4627 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4629 case "$gccosandvers" in
4630 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4631 $osname$osvers) ;; # looking good
4632 $osname*) cat <<EOM >&4
4634 *** WHOA THERE!!! ***
4636 Your gcc has not been compiled for the exact release of
4637 your operating system ($gccosandvers versus $osname$osvers).
4639 In general it is a good idea to keep gcc synchronized with
4640 the operating system because otherwise serious problems
4641 may ensue when trying to compile software, like Perl.
4643 I'm trying to be optimistic here, though, and will continue.
4644 If later during the configuration and build icky compilation
4645 problems appear (headerfile conflicts being the most common
4646 manifestation), I suggest reinstalling the gcc to match
4647 your operating system release.
4651 *) gccosandvers='' ;; # failed to parse, better be silent
4659 # gcc 3.* complain about adding -Idirectories that they already know about,
4660 # so we will take those off from locincpth.
4661 case "$gccversion" in
4663 echo "main(){}">try.c
4664 for incdir in $locincpth; do
4665 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4666 grep '^c[cp]p*[01]: warning: changing search order '`
4667 if test "X$warn" != X; then
4668 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4674 # gcc 4.9 by default does some optimizations that break perl.
4675 # see ticket 121505.
4677 # The -fwrapv disables those optimizations (and probably others,) so
4678 # for gcc 4.9 (and later, since the optimizations probably won't go
4679 # away), add -fwrapv unless the user requests -fno-wrapv, which
4680 # disables -fwrapv, or if the user requests -fsanitize=undefined,
4681 # which turns the overflows -fwrapv ignores into runtime errors.
4682 case "$gccversion" in
4683 4.[3-9].*|4.[1-9][0-9]*|[5-9].*|[1-9][0-9]*)
4685 *-fno-wrapv*|*-fsanitize=undefined*|*-fwrapv*) ;;
4686 *) ccflags="$ccflags -fwrapv" ;;
4690 : What should the include directory be ?
4691 : Use sysroot if set, so findhdr looks in the right place.
4693 $echo $n "Hmm... $c"
4694 dflt="$sysroot/usr/include"
4697 if $test -f /bin/mips && /bin/mips; then
4698 echo "Looks like a MIPS system..."
4699 $cat >usr.c <<'EOCP'
4700 #ifdef SYSTYPE_BSD43
4704 if $cc $cppflags -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4705 dflt='/bsd43/usr/include'
4709 mips_type='System V'
4711 $rm -f usr.c usr.out
4712 echo "and you're compiling with the $mips_type compiler and libraries."
4716 echo "Doesn't look like a MIPS system."
4726 case "$xxx_prompt" in
4729 rp='Where are the include files you want to use?'
4737 : see how we invoke the C preprocessor
4739 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4740 cat <<'EOT' >testcpp.c
4746 if test ! -f cppstdin; then
4747 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4748 # AIX cc -E doesn't show the absolute headerfile
4749 # locations but we'll cheat by using the -M flag.
4750 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
4752 echo 'cat >.$$.c; '"$cc $cppflags"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4755 echo "Keeping your $hint cppstdin wrapper."
4758 wrapper=`pwd`/cppstdin
4762 if $test "X$cppstdin" != "X" && \
4763 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4764 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4766 echo "You used to use $cppstdin $cppminus so we'll use that again."
4768 '') echo "But let's see if we can live without a wrapper..." ;;
4770 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4771 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4773 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4776 echo "(However, $cpprun $cpplast does not work, let's see...)"
4784 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4791 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4792 $cc -E <testcpp.c >testcpp.out 2>&1; \
4793 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4794 echo "Yup, it does."
4795 x_cpp="$cc $cppflags -E"
4797 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4798 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4799 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4800 echo "Yup, it does."
4801 x_cpp="$cc $cppflags -E"
4803 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4804 $cc -P <testcpp.c >testcpp.out 2>&1; \
4805 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4806 echo "Yipee, that works!"
4807 x_cpp="$cc $cppflags -P"
4809 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4810 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4811 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4812 echo "At long last!"
4813 x_cpp="$cc $cppflags -P"
4815 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4816 $cpp <testcpp.c >testcpp.out 2>&1; \
4817 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4819 x_cpp="$cpp $cppflags"
4821 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4822 $cpp - <testcpp.c >testcpp.out 2>&1; \
4823 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4824 echo "Hooray, it works! I was beginning to wonder."
4825 x_cpp="$cpp $cppflags"
4827 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4828 $wrapper <testcpp.c >testcpp.out 2>&1; \
4829 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4835 rp="No dice. I can't find a C preprocessor. Name one:"
4839 $x_cpp <testcpp.c >testcpp.out 2>&1
4840 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4841 echo "OK, that will do." >&4
4843 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4858 echo "Perhaps can we force $cc -E using a wrapper..."
4859 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4860 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4866 echo "Nope, we'll have to live without it..."
4880 "$wrapper"|'cppstdin') ;;
4881 *) $rm -f $wrapper;;
4883 $rm -f testcpp.c testcpp.out
4885 : Adjust cppfilter for path component separator
4887 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
4888 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
4892 : Use gcc to determine libpth and incpth
4893 # If using gcc or clang, we can get better values for libpth, incpth
4894 # and usrinc directly from the compiler.
4895 # Note that ccname for clang is also gcc.
4898 $echo 'extern int foo;' > try.c
4899 set X `$cppstdin -v try.c 2>&1 | $awk '/^#include </,/^End of search /'|$cppfilter $grep '/include'`
4901 if $test $# -gt 0; then
4903 incpth="`$echo $incpth|$sed 's/^ //'`"
4905 j="`$echo $i|$sed 's,/include$,/lib,'`"
4906 if $test -d $j; then
4910 libpth="`$echo $libpth|$sed 's/^ //'`"
4911 for xxx in $libpth $loclibpth $plibpth $glibpth; do
4912 if $test -d $xxx; then
4915 *) libpth="$libpth $xxx";;
4922 '') for i in $incpth; do
4923 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
4931 case "$usecrosscompile" in
4934 '') echo "Incpth not defined." >&4; croak=y ;;
4935 *) echo "Using incpth '$incpth'." >&4 ;;
4938 '') echo "Libpth not defined." >&4; croak=y ;;
4939 *) echo "Using libpth '$libpth'." >&4 ;;
4942 '') echo "Usrinc not defined." >&4; croak=y ;;
4943 *) echo "Using usrinc $usrinc." >&4 ;;
4947 if test "X$sysroot" = X; then
4948 echo "Cannot continue, aborting." >&4; exit 1
4950 echo "Cross-compiling using sysroot $sysroot, failing to guess inc/lib paths is not fatal" >&4
4959 : Default value for incpth is just usrinc
4961 '') incpth="$usrinc";;
4964 : Set private lib path
4967 plibpth="$incpath/usr/lib $sysroot/usr/local/lib $sysroot/usr/ccs/lib"
4972 '') dlist="$loclibpth $plibpth $glibpth";;
4973 *) dlist="$libpth";;
4976 : Now check and see which directories actually exist, avoiding duplicates
4979 if $test -d $xxx; then
4982 *) libpth="$libpth $xxx";;
4988 Some systems have incompatible or broken versions of libraries. Among
4989 the directories listed in the question below, please remove any you
4990 know not to be holding relevant libraries, and add any that are needed.
4991 Say "none" for none.
4995 if test "X$sysroot" != X; then
4997 You have set sysroot to $sysroot, please supply the directories excluding sysroot
5010 rp="Directories to use for library searches?"
5017 : compute shared library extension
5020 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
5030 On some systems, shared libraries may be available. Answer 'none' if
5031 you want to suppress searching of shared libraries for the remainder
5032 of this configuration.
5035 rp='What is the file extension used for shared libraries?'
5039 : Does target system insist that shared library basenames are unique
5042 Some dynamic loaders assume that the *basename* of shared library filenames
5043 are globally unique. We'll default this to undef as we assume your system
5044 is not this weird. Set to defined if you're on one of them.
5049 rp='Make shared library basenames unique?'
5052 y|Y) val="$define" ;;
5055 set d_libname_unique
5058 : Define several unixisms.
5059 : Hints files or command line option can be used to override them.
5060 : The convoluted testing is in case hints files set either the old
5063 '') case "$exe_ext" in
5065 *) _exe="$exe_ext" ;;
5070 '') case "$lib_ext" in
5077 '') case "$obj_ext" in
5084 '') case "$path_sep" in
5095 rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
5097 : Which makefile gets called first. This is used by make depend.
5098 case "$firstmakefile" in
5099 '') firstmakefile='makefile';;
5102 : Check is we will use socks
5104 $define|true|[yY]*) dflt='y';;
5109 Perl can be built to use the SOCKS proxy protocol library. To do so,
5110 Configure must be run with -Dusesocks. If you use SOCKS you also need
5111 to use the PerlIO abstraction layer, this will be implicitly selected.
5113 If this doesn't make any sense to you, just accept the default '$dflt'.
5115 rp='Build Perl for SOCKS?'
5118 y|Y) val="$define" ;;
5124 : Check for uselongdouble support
5126 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
5129 case "$uselongdouble" in
5130 $define|true|[yY]*) dflt='y';;
5135 Perl can be built to take advantage of long doubles which
5136 (if available) may give more accuracy and range for floating point numbers.
5138 If this doesn't make any sense to you, just accept the default '$dflt'.
5140 rp='Try to use long doubles if available?'
5143 y|Y) val="$define" ;;
5149 case "$uselongdouble" in
5150 true|[yY]*) uselongdouble="$define" ;;
5153 : Look for a hint-file generated 'call-back-unit'. If the
5154 : user has specified that long doubles should be used,
5155 : we may need to set or change some other defaults.
5156 if $test -f uselongdouble.cbu; then
5157 echo "Your platform has some specific hints regarding long doubles, using them..."
5158 . ./uselongdouble.cbu
5160 case "$uselongdouble" in
5163 (Your platform does not have any specific hints for long doubles.)
5169 : Looking for optional libraries
5171 echo "Checking for optional libraries..." >&4
5176 case "$libswanted" in
5177 '') libswanted='c_s';;
5180 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
5182 case "$usecbacktrace" in
5183 "$define") libswanted="$libswanted bfd" ;;
5185 case "$usequadmath" in
5186 "$define") libswanted="$libswanted quadmath" ;;
5192 for thisdir in $libpth $xlibpth; do
5193 test -d $thisdir && libspath="$libspath $thisdir"
5195 for thislib in $libswanted; do
5196 for thisdir in $libspath; do
5198 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
5199 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
5200 $test -f "$xxx" && eval $libscheck
5201 $test -f "$xxx" && libstyle=shared
5202 xxx=`ls $thisdir/lib$thislib.[0-9].$so 2>/dev/null|sed -n '$p'`
5203 $test -f "$xxx" && eval $libscheck
5204 $test -f "$xxx" && libstyle=shared
5206 if test ! -f "$xxx"; then
5207 xxx=$thisdir/lib$thislib.$so
5208 $test -f "$xxx" && eval $libscheck
5209 $test -f "$xxx" && libstyle=shared
5211 if test ! -f "$xxx"; then
5212 xxx=$thisdir/lib$thislib$_a
5213 $test -f "$xxx" && eval $libscheck
5214 $test -f "$xxx" && libstyle=static
5216 if test ! -f "$xxx"; then
5217 xxx=$thisdir/$thislib$_a
5218 $test -f "$xxx" && eval $libscheck
5219 $test -f "$xxx" && libstyle=static
5221 if test ! -f "$xxx"; then
5222 xxx=$thisdir/lib${thislib}_s$_a
5223 $test -f "$xxx" && eval $libscheck
5224 $test -f "$xxx" && libstyle=static
5225 $test -f "$xxx" && thislib=${thislib}_s
5227 if test ! -f "$xxx"; then
5228 xxx=$thisdir/Slib$thislib$_a
5229 $test -f "$xxx" && eval $libscheck
5230 $test -f "$xxx" && libstyle=static
5232 if $test -f "$xxx"; then
5234 shared) echo "Found -l$thislib (shared)." ;;
5235 static) echo "Found -l$thislib." ;;
5236 *) echo "Found -l$thislib ($libstyle)." ;;
5240 *) dflt="$dflt -l$thislib"
5241 libsfound="$libsfound $xxx"
5243 libsfiles="$libsfiles $yyy"
5244 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
5245 case " $libsdirs " in
5247 *) libsdirs="$libsdirs $yyy" ;;
5254 if $test ! -f "$xxx"; then
5255 echo "No -l$thislib."
5266 ' '|'') dflt='none';;
5271 In order to compile $package on your machine, a number of libraries
5272 are usually needed. Include any other special libraries here as well.
5273 Say "none" for none. The default list is almost always right.
5277 rp="What libraries to use?"
5284 : determine optimization, if desired, or use for debug flag also
5286 ' '|$undef) dflt='none';;
5288 *) dflt="$optimize";;
5292 By default, $package compiles with the -O flag to use the optimizer.
5293 Alternately, you might want to use the symbolic debugger, which uses
5294 the -g flag (on traditional Unix systems). Either flag can be
5295 specified here. To use neither flag, specify the word "none".
5298 rp="What optimizer/debugger flag should be used?"
5302 'none') optimize=" ";;
5305 : Check what DEBUGGING is required from the command line
5306 : -DEBUGGING or -DDEBUGGING or
5307 : -DEBUGGING=both = -g + -DDEBUGGING
5308 : -DEBUGGING=-g or -Doptimize=-g = -g
5309 : -DEBUGGING=none or -UDEBUGGING =
5310 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
5313 *) DEBUGGING=$EBUGGING ;;
5316 case "$DEBUGGING" in
5320 *) optimize="$optimize -g" ;;
5324 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
5332 case "$DEBUGGING" in
5333 both|$define) dflt='-DDEBUGGING'
5336 : argument order is deliberate, as the flag will start with - which set could
5337 : think is an option
5338 checkccflag='check=$1; flag=$2; callback=$3;
5340 echo "Checking if your compiler accepts $flag" 2>&1;
5341 [ "X$sysroot" != "X" ] && echo "For sysroot = $sysroot";
5342 echo "int main(void) { return 0; }" > gcctest.c;
5343 if $cc $_sysroot -O2 $flag -o gcctest gcctest.c 2>gcctest.out && $run ./gcctest; then
5344 echo "Yes, it does." 2>&1;
5345 if $test -s gcctest.out ; then
5346 echo "But your platform does not like it:";
5351 echo "Leaving current flags $ccflags alone." 2>&1
5353 *) dflt="$dflt $flag";
5359 echo "Nope, it does not, but that is ok." 2>&1;
5363 : We will not override a previous value, but we might want to
5364 : augment a hint file
5366 default|recommended)
5367 case "$gccversion" in
5368 1*) dflt="$dflt -fpcc-struct-return" ;;
5370 case "$optimize:$DEBUGGING" in
5371 *-g*:old) dflt="$dflt -DDEBUGGING";;
5373 case "$gccversion" in
5374 2*) if $test -d /etc/conf/kconfig.d &&
5375 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
5377 # Interactive Systems (ISC) POSIX mode.
5382 case "$gccversion" in
5385 ?*) set strict-aliasing -fno-strict-aliasing
5389 # For gcc, adding -pipe speeds up compilations for some, but apparently
5390 # some assemblers can't read from stdin. (It also slows down compilations
5391 # in other cases, but those are apparently rarer these days.) AD 5/2004.
5392 case "$gccversion" in
5398 # on x86_64 (at least) we require an extra library (libssp) in the
5399 # link command line. This library is not named, so I infer that it is
5400 # an implementation detail that may change. Hence the safest approach
5401 # is to add the flag to the flags passed to the compiler at link time,
5402 # as that way the compiler can do the right implementation dependant
5404 case "$gccversion" in
5405 ?*) set stack-protector-strong -fstack-protector-strong
5408 *-fstack-protector-strong*) ;; # It got added.
5409 *) # Try the plain/older -fstack-protector.
5410 set stack-protector -fstack-protector
5419 case "$mips_type" in
5420 *BSD*|'') inclwanted="$locincpth $usrinc";;
5421 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
5423 for thisincl in $inclwanted; do
5424 if $test -d $thisincl; then
5425 if $test x$thisincl != x$usrinc; then
5427 *" -I$thisincl "*);;
5428 *) dflt="$dflt -I$thisincl ";;
5434 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
5436 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5444 *) dflt="$dflt -D$2";;
5448 set signal.h LANGUAGE_C; eval $inctest
5452 ccflags="$ccflags -DSOCKS"
5457 default|recommended) dflt="$ccflags $dflt" ;;
5458 *) dflt="$ccflags";;
5467 Your C compiler may want other flags. For this question you should include
5468 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5469 but you should NOT include libraries or ld flags like -lwhatever. If you
5470 want $package to honor its debug switch, you should include -DDEBUGGING here.
5471 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5473 To use no flags, specify the word "none".
5479 rp="Any additional cc flags?"
5486 : the following weeds options from ccflags that are of no interest to cpp
5488 '') cppflags="$ccflags" ;;
5489 *) cppflags="$cppflags $ccflags" ;;
5491 case "$gccversion" in
5492 1*) cppflags="$cppflags -D__GNUC__"
5494 case "$mips_type" in
5496 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5502 echo "Let me guess what the preprocessor flags are..." >&4
5516 *) ftry="$previous $flag";;
5518 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5519 >cpp1.out 2>/dev/null && \
5520 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5521 >cpp2.out 2>/dev/null && \
5522 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5523 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5525 cppflags="$cppflags $ftry"
5535 *-*) echo "They appear to be: $cppflags";;
5537 $rm -f cpp.c cpp?.out
5541 : flags used in final linking phase
5543 '') if ./venix; then
5549 *-posix*) dflt="$dflt -posix" ;;
5552 *) dflt="$ldflags";;
5554 # See note above about -fstack-protector
5556 *-fstack-protector-strong*)
5558 *-fstack-protector-strong*) ;; # Don't add it again
5559 *) dflt="$dflt -fstack-protector-strong" ;;
5562 *-fstack-protector*)
5564 *-fstack-protector*) ;; # Don't add it again
5565 *) dflt="$dflt -fstack-protector" ;;
5570 : Try to guess additional flags to pick up local libraries.
5571 for thislibdir in $libpth; do
5572 case " $loclibpth " in
5575 *"-L$thislibdir "*) ;;
5576 *) dflt="$dflt -L$thislibdir" ;;
5588 Your C linker may need flags. For this question you should
5589 include -L/whatever and any other flags used by the C linker, but you
5590 should NOT include libraries like -lwhatever.
5592 Make sure you include the appropriate -L/path flags if your C linker
5593 does not normally search all of the directories you specified above,
5596 To use no flags, specify the word "none".
5600 rp="Any additional ld flags (NOT including libraries)?"
5606 rmlist="$rmlist pdp11"
5610 echo "Checking your choice of C compiler and flags for coherency..." >&4
5611 $cat > try.c <<'EOF'
5613 int main() { printf("Ok\n"); return(0); }
5615 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5617 $cat >try.msg <<'EOM'
5618 I've tried to compile and run the following simple program:
5621 $cat try.c >> try.msg
5623 $cat >> try.msg <<EOM
5630 and I got the following output:
5634 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5635 if $sh -c "$run ./try " >>try.msg 2>&1; then
5639 *) echo 'The program compiled OK, but produced no output.' >> try.msg ;;
5642 echo "The program compiled OK, but exited with status $?." >>try.msg
5643 rp="You have a problem. Shall I abort Configure"
5647 echo "I can't compile the test program." >>try.msg
5648 rp="You have a BIG problem. Shall I abort Configure"
5654 case "$knowitall" in
5656 echo "(The supplied flags or libraries might be incorrect.)"
5664 *) echo "Ok. Stopping Configure." >&4
5669 n) echo "OK, that should do.";;
5671 $rm_try gcctest gcctest.out
5673 : define a shorthand compile call
5677 case "$usedevel" in $define|true|[yY]*) if $test ! -f "${mc_file}.c"; then
5678 echo "Internal Configure script bug - compiler test file ${mc_file}.c is missing. Please report this to perlbug@perl.org" >&4;
5682 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5683 : define a shorthand compile call for compilations that should be ok.
5687 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5689 : determine filename position in cpp output
5691 echo "Computing filename position in cpp output for #include directives..." >&4
5693 vos) testaccess=-e ;;
5696 echo '#include <stdio.h>' > foo.c
5699 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5700 $grep '^[ ]*#.*stdio\.h' | \
5701 while read cline; do
5704 while $test \$# -gt 0; do
5705 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5710 pos=\`expr \$pos + 1\`
5722 *) pos="${fieldn}th";;
5724 echo "Your cpp writes the filename in the $pos field of the line."
5726 : locate header file
5731 for usrincdir in $incpth
5733 if test -f \$usrincdir/\$wanted; then
5734 echo "\$usrincdir/\$wanted"
5738 awkprg='{ print \$$fieldn }'
5739 echo "#include <\$wanted>" > foo\$\$.c
5740 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5741 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5742 while read cline; do
5743 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5745 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5746 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5751 # status = 0: grep returned 0 lines, case statement not executed
5752 # status = 1: headerfile found
5753 # status = 2: while loop executed, no headerfile found
5757 if test \$status -eq 1; then
5764 : define an alternate in-header-list? function
5765 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5766 cont=true; xxf="echo \"<\$1> found.\" >&4";
5767 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5768 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5770 case $# in 4) instead=instead;; *) instead="at last";; esac;
5771 while $test "$cont"; do
5773 var=$2; eval "was=\$$2";
5774 if $test "$xxx" && $test -r "$xxx";
5776 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5779 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5780 set $yyy; shift; shift; yyy=$@;
5781 case $# in 0) cont="";;
5782 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5783 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5784 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5785 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5789 do set $yyy; var=$2; eval "was=\$$2";
5790 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5791 set $yyy; shift; shift; yyy=$@;
5794 : see if stdlib is available
5795 set stdlib.h i_stdlib
5798 : check for lengths of integral types
5802 echo "Checking to see how big your integers are..." >&4
5811 printf("intsize=%d;\n", (int)sizeof(int));
5812 printf("longsize=%d;\n", (int)sizeof(long));
5813 printf("shortsize=%d;\n", (int)sizeof(short));
5818 if eval $compile_ok && $run ./try > /dev/null; then
5820 echo "Your integers are $intsize bytes long."
5821 echo "Your long integers are $longsize bytes long."
5822 echo "Your short integers are $shortsize bytes long."
5826 Help! I can't compile and run the intsize test program: please enlighten me!
5827 (This is probably a misconfiguration in your system or libraries, and
5828 you really ought to fix it. Still, I'll try anyway.)
5832 rp="What is the size of an integer (in bytes)?"
5836 rp="What is the size of a long integer (in bytes)?"
5840 rp="What is the size of a short integer (in bytes)?"
5848 : check for long long
5850 echo "Checking to see if you have long long..." >&4
5851 echo 'int main() { long long x = 7; return 0; }' > try.c
5853 if eval $compile; then
5855 echo "You have long long."
5858 echo "You do not have long long."
5864 : check for length of long long
5865 case "${d_longlong}${longlongsize}" in
5868 echo "Checking to see how big your long longs are..." >&4
5869 $cat >try.c <<'EOCP'
5873 printf("%d\n", (int)sizeof(long long));
5878 if eval $compile_ok; then
5879 longlongsize=`$run ./try`
5880 echo "Your long longs are $longlongsize bytes long."
5884 echo "(I can't seem to compile the test program. Guessing...)"
5885 rp="What is the size of a long long (in bytes)?"
5889 if $test "X$longsize" = "X$longlongsize"; then
5890 echo "(That isn't any different from an ordinary long.)"
5896 : see if inttypes.h is available
5897 : we want a real compile instead of Inhdr because some systems
5898 : have an inttypes.h which includes non-existent headers
5901 #include <inttypes.h>
5903 static int32_t foo32 = 0x12345678;
5907 if eval $compile; then
5908 echo "<inttypes.h> found." >&4
5911 echo "<inttypes.h> NOT found." >&4
5920 echo "Checking to see if you have int64_t..." >&4
5922 #include <sys/types.h>
5923 #$i_inttypes I_INTTYPES
5925 #include <inttypes.h>
5927 int main() { int64_t x = 7; }
5930 if eval $compile; then
5932 echo "You have int64_t."
5935 echo "You do not have int64_t."
5941 : Check if 64bit ints have a quad type
5943 echo "Checking which 64-bit integer type we could use..." >&4
5949 val='"unsigned int"'
5954 *) case "$longsize" in
5958 val='"unsigned long"'
5963 *) case "$d_longlong:$longlongsize" in
5968 val='"unsigned long long"'
5973 *) case "$d_int64_t" in
5992 '') echo "Alas, no 64-bit integer types in sight." >&4
5995 *) echo "We could use '$quadtype' for 64-bit integers." >&4
6000 : Do we want 64bit support
6001 case "$uselonglong" in
6002 "$define"|true|[yY]*)
6005 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
6007 use64bitint="$define"
6010 case "$use64bits" in
6011 "$define"|true|[yY]*)
6014 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
6016 use64bitint="$define"
6019 case "$use64bitints" in
6020 "$define"|true|[yY]*)
6023 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
6025 use64bitint="$define"
6028 case "$use64bitsint" in
6029 "$define"|true|[yY]*)
6032 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
6034 use64bitint="$define"
6037 case "$uselonglongs" in
6038 "$define"|true|[yY]*)
6041 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
6043 use64bitint="$define"
6046 case "$use64bitsall" in
6047 "$define"|true|[yY]*)
6050 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
6052 use64bitall="$define"
6057 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
6059 case "$use64bitall" in
6060 "$define"|true|[yY]*) use64bitint="$define" ;;
6066 You have natively 64-bit long integers.
6070 *) case "$use64bitint" in
6071 "$define"|true|[yY]*) dflt='y';;
6080 Perl can be built to take advantage of 64-bit integer types
6081 on some systems. To do so, Configure can be run with -Duse64bitint.
6082 Choosing this option will most probably introduce binary incompatibilities.
6084 If this doesn't make any sense to you, just accept the default '$dflt'.
6085 (The default has been chosen based on your configuration.)
6087 rp='Try to use 64-bit integers, if available?'
6090 [yY]*) val="$define" ;;
6098 case "$use64bitall" in
6099 "$define"|true|[yY]*) dflt='y' ;;
6100 *) case "$longsize" in
6108 You may also choose to try maximal 64-bitness. It means using as much
6109 64-bitness as possible on the platform. This in turn means even more
6110 binary incompatibilities. On the other hand, your platform may not
6111 have any more 64-bitness available than what you already have chosen.
6113 If this doesn't make any sense to you, just accept the default '$dflt'.
6114 (The default has been chosen based on your configuration.)
6116 rp='Try to use maximal 64-bit support, if available?'
6119 [yY]*) val="$define" ;;
6124 case "$use64bitall" in
6126 case "$use64bitint" in
6130 Since you have chosen a maximally 64-bit build, I'm also turning on
6131 the use of 64-bit integers.
6133 use64bitint="$define" ;;
6138 : Look for a hint-file generated 'call-back-unit'. If the
6139 : user has specified that a 64-bit perl is to be built,
6140 : we may need to set or change some other defaults.
6141 if $test -f use64bitint.cbu; then
6142 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
6145 case "$use64bitint" in
6146 "$define"|true|[yY]*)
6147 : This test was common to all the OpenBSD forks, and seems harmless for
6150 echo "Checking if your C library has broken 64-bit functions..." >&4
6153 typedef $uquadtype myULL;
6160 {4294967303.15, 4294967303ULL},
6161 {4294967294.2, 4294967294ULL},
6162 {4294967295.7, 4294967295ULL},
6165 for (p = test; p->u; p++) {
6166 myULL x = (myULL)p->d;
6177 if eval $compile_ok; then
6178 libcquad=`$run ./try`
6179 echo "Your C library's 64-bit functions are $libcquad."
6181 echo "(I can't seem to compile the test program.)"
6182 echo "Assuming that your C library's 64-bit functions are ok."
6191 *** You have a C library with broken 64-bit functions.
6192 *** 64-bit support does not work reliably in this configuration.
6193 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
6194 *** Cannot continue, aborting.
6201 4) case "$archname64" in
6202 '') archname64=64int ;;
6209 : Look for a hint-file generated 'call-back-unit'. If the
6210 : user has specified that a maximally 64-bit perl is to be built,
6211 : we may need to set or change some other defaults.
6212 if $test -f use64bitall.cbu; then
6213 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
6216 case "$use64bitall" in
6217 "$define"|true|[yY]*)
6219 4) case "$archname64" in
6220 ''|64int) archname64=64all ;;
6227 case "$d_quad:$use64bitint" in
6231 *** You have chosen to use 64-bit integers,
6232 *** but none can be found.
6233 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
6234 *** Cannot continue, aborting.
6241 : Check if we are using the GNU C library
6243 echo "Checking for GNU C Library..." >&4
6245 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
6246 alone are insufficient to distinguish different versions, such as
6247 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
6248 libc version 2.1.0. A. Dougherty, June 3, 2002.
6254 # ifdef __GLIBC_MINOR__
6255 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
6256 # include <gnu/libc-version.h>
6257 printf("%s\n", gnu_get_libc_version());
6259 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
6262 printf("%d\n", __GLIBC__);
6271 if eval $compile_ok && $run ./try > glibc.ver; then
6273 gnulibc_version=`$cat glibc.ver`
6274 echo "You are using the GNU C Library version $gnulibc_version"
6278 echo "You are not using the GNU C Library"
6284 : see if nm is to be used to determine whether a symbol is defined or not
6288 case "$d_gnulibc" in
6291 echo "nm probably won't work on the GNU C Library." >&4
6297 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
6299 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
6300 echo "'nm' won't be sufficient on this system." >&4
6306 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
6307 if $test $dflt -gt 20; then
6317 true|$define) dflt=y;;
6324 I can use $nm to extract the symbols from your C libraries. This
6325 is a time consuming task which may generate huge output on the disk (up
6326 to 3 megabytes) but that should make the symbols extraction faster. The
6327 alternative is to skip the 'nm' extraction part and to compile a small
6328 test program instead to determine whether each symbol is present. If
6329 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
6330 this may be the best solution.
6332 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
6335 rp="Shall I use $nm to extract C symbols from the libraries?"
6338 [Nn]*) usenm=false;;
6347 : nm options which may be necessary
6349 '') if $test -f /mach_boot; then
6351 elif $test -d /usr/ccs/lib; then
6352 nm_opt='-p' # Solaris (and SunOS?)
6353 elif $test -f /dgux; then
6355 elif $test -f /lib64/rld; then
6356 nm_opt='-p' # 64-bit Irix
6362 : nm options which may be necessary for shared libraries but illegal
6363 : for archive libraries. Thank you, Linux.
6364 case "$nm_so_opt" in
6365 '') case "$myuname" in
6367 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
6368 nm_so_opt='--dynamic'
6375 : Figure out where the libc is located
6378 : get list of predefined functions in a handy place
6383 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
6389 *) for thislib in $libs; do
6392 : Handle C library specially below.
6395 thislib=`echo $thislib | $sed -e 's/^-l//'`
6396 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
6398 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
6400 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
6402 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
6404 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
6406 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
6408 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
6413 libnames="$libnames $try"
6415 *) libnames="$libnames $thislib" ;;
6424 for xxx in $libpth; do
6425 $test -r $1 || set $xxx/libc.$so
6426 : The messy sed command sorts on library version numbers.
6428 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
6429 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
6431 s/[0-9][0-9]*/0000&/g
6432 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
6435 $sort | $sed -e 's/^.* //'`
6438 $test -r $1 || set $sysroot/usr/ccs/lib/libc.$so
6439 $test -r $1 || set $sysroot/lib/libsys_s$_a
6445 if $test -r "$1"; then
6446 echo "Your (shared) C library seems to be in $1."
6448 elif $test -r /lib/libc && $test -r /lib/clib; then
6449 echo "Your C library seems to be in both /lib/clib and /lib/libc."
6451 libc='/lib/clib /lib/libc'
6452 if $test -r /lib/syslib; then
6453 echo "(Your math library is in /lib/syslib.)"
6454 libc="$libc /lib/syslib"
6456 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
6457 echo "Your C library seems to be in $libc, as you said before."
6458 elif $test -r $incpath/usr/lib/libc$_a; then
6459 libc=$incpath/usr/lib/libc$_a;
6460 echo "Your C library seems to be in $libc. That's fine."
6461 elif $test -r /lib/libc$_a; then
6463 echo "Your C library seems to be in $libc. You're normal."
6465 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
6467 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
6468 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
6469 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
6471 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
6473 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
6476 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
6478 if $test -r "$tans"; then
6479 echo "Your C library seems to be in $tans, of all places."
6485 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
6489 If the guess above is wrong (which it might be if you're using a strange
6490 compiler, or your machine supports multiple models), you can override it here.
6495 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
6497 I can't seem to find your C library. I've looked in the following places:
6500 $sed 's/^/ /' libpath
6503 None of these seems to contain your C library. I need to get its name...
6508 rp='Where is your C library?'
6513 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
6514 set X `cat libnames`
6517 case $# in 1) xxx=file; esac
6518 echo "Extracting names from the following $xxx for later perusal:" >&4
6520 $sed 's/^/ /' libnames >&4
6522 $echo $n "This may take a while...$c" >&4
6526 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
6527 *) $nm $nm_opt $file 2>/dev/null;;
6532 $grep fprintf libc.tmp > libc.ptf
6533 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
6534 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
6536 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
6538 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6540 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
6542 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6544 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
6546 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6548 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
6550 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6552 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
6554 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6556 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
6558 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6560 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
6561 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
6563 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6565 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
6567 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6569 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
6571 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6573 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
6575 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6577 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
6579 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6581 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
6583 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6585 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
6587 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6589 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
6591 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6594 $nm -p $* 2>/dev/null >libc.tmp
6595 $grep fprintf libc.tmp > libc.ptf
6596 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
6597 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
6603 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
6605 if $ar t $libc > libc.tmp && \
6606 $contains '^fprintf$' libc.tmp >/dev/null 2>&1
6608 for thisname in $libnames $libc; do
6609 $ar t $thisname >>libc.tmp
6611 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
6613 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
6614 for thisname in $libnames $libc; do
6615 $ar tv $thisname >>libc.tmp
6616 emximp -o tmp.imp $thisname \
6618 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
6619 < tmp.imp >>libc.tmp
6622 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
6625 echo "$ar didn't seem to work right." >&4
6626 echo "Maybe this is a Cray...trying bld instead..." >&4
6628 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list &&
6631 for thisname in $libnames; do
6633 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
6634 $ar t $thisname >>libc.tmp
6638 echo "That didn't work either. Giving up." >&4
6648 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
6649 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
6651 *) if $test -f /lib/syscalls.exp; then
6653 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
6654 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' \
6655 /lib/syscalls.exp >>libc.list
6661 $rm -f libnames libpath
6663 : Check if we are using C++
6665 echo "Checking for C++..." >&4
6666 $cat >try.c <<'EOCP'
6678 if eval $compile_ok && $run ./try; then
6680 echo "You are using a C++ compiler."
6683 echo "You are not using a C++ compiler."
6689 : is a C symbol defined?
6692 -v) tf=libc.tmp; tdc="";;
6693 -a) tf=libc.tmp; tdc="[]";;
6694 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
6696 case "$d_cplusplus" in
6697 $define) extern_C="extern \"C\"" ;;
6698 *) extern_C="extern" ;;
6701 case "$reuseval-$4" in
6703 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
6708 if $test "$runnm" = true; then
6709 if $contains $tlook $tf >/dev/null 2>&1; then
6711 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
6712 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;
6713 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
6714 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
6718 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;
6719 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
6725 $define) tval=true;;
6732 : define an is-in-libc? function
6733 inlibc='echo " "; td=$define; tu=$undef;
6734 sym=$1; var=$2; eval "was=\$$2";
6736 case "$reuseval$was" in
6746 echo "$sym() found." >&4;
6747 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
6749 echo "$sym() NOT found." >&4;
6750 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
6754 $define) echo "$sym() found." >&4;;
6755 *) echo "$sym() NOT found." >&4;;
6759 : check for length of double
6761 case "$doublesize" in
6763 echo "Checking to see how big your double precision numbers are..." >&4
6772 printf("%d\n", (int)sizeof(double));
6777 if eval $compile_ok; then
6778 doublesize=`$run ./try`
6779 echo "Your double is $doublesize bytes long."
6782 echo "(I can't seem to compile the test program. Guessing...)"
6783 rp="What is the size of a double precision number (in bytes)?"
6791 : see if this is a float.h system
6796 $echo "Checking the kind of doubles you have..." >&4
6799 #define DOUBLESIZE $doublesize
6804 static const double d = -0.1;
6806 unsigned const char* b = (unsigned const char*)(&d);
6808 if (b[0] == 0xCD && b[3] == 0xBD) {
6809 /* IEEE 754 32-bit little-endian */
6813 if (b[0] == 0xBD && b[3] == 0xCD) {
6814 /* IEEE 754 32-bit big-endian */
6820 if (b[0] == 0x9A && b[7] == 0xBF) {
6821 /* IEEE 754 64-bit little-endian */
6825 if (b[0] == 0xBF && b[7] == 0x9A) {
6826 /* IEEE 754 64-bit big-endian */
6830 if (b[0] == 0x99 && b[3] == 0xBF && b[4] == 0x9A && b[7] == 0x99) {
6831 /* ARM mixed endian: two little-endian 32-bit floats, in big endian order:
6832 * 4 5 6 7 0 1 2 3 (MSB = 7, LSB = 0)
6833 * 99 99 b9 bf 9a 99 99 99 */
6837 if (b[0] == 0x99 && b[3] == 0x9A && b[4] == 0xBF && b[7] == 0x99) {
6838 /* The opposite of case 7, mixed endian: two big-endian 32-bit floats,
6839 * in little endian order: 3 2 1 0 7 6 5 4 (MSB = 7, LSB = 0)
6840 * 99 99 99 9a bf b9 99 99 */
6845 #if DOUBLESIZE == 16
6846 if (b[0] == 0x9A && b[15] == 0xBF) {
6847 /* IEEE 754 128-bit little-endian */
6851 if (b[0] == 0xBF && b[15] == 0x9A) {
6852 /* IEEE 754 128-bit big-endian */
6857 /* Rumoredly some old ARM processors have 'mixed endian' doubles,
6858 * two 32-bit little endians stored in big-endian order. */
6859 /* Then there are old mainframe/miniframe formats like VAX, IBM, and CRAY.
6860 * Whether those environments can still build Perl is debatable. */
6861 printf("-1\n"); /* unknown */
6866 if eval $compile; then
6867 doublekind=`$run ./try`
6871 case "$doublekind" in
6872 1) echo "You have IEEE 754 32-bit little endian doubles." >&4 ;;
6873 2) echo "You have IEEE 754 32-bit big endian doubles." >&4 ;;
6874 3) echo "You have IEEE 754 64-bit little endian doubles." >&4 ;;
6875 4) echo "You have IEEE 754 64-bit big endian doubles." >&4 ;;
6876 5) echo "You have IEEE 754 128-bit little endian doubles." >&4 ;;
6877 6) echo "You have IEEE 754 128-bit big endian doubles." >&4 ;;
6878 *) echo "Cannot figure out your double. You VAX, or something?" >&4 ;;
6882 : check for long doubles
6884 echo "Checking to see if you have long double..." >&4
6885 echo 'int main() { long double x = 7.0; }' > try.c
6887 if eval $compile; then
6889 echo "You have long double."
6892 echo "You do not have long double."
6898 : see if ldexpl exists
6902 : see if this is a quadmath.h system
6903 set quadmath.h i_quadmath
6906 : check for length of long double
6907 case "${d_longdbl}${longdblsize}" in
6910 echo "Checking to see how big your long doubles are..." >&4
6911 $cat >try.c <<'EOCP'
6915 printf("%d\n", sizeof(long double));
6920 if eval $compile; then
6921 longdblsize=`$run ./try`
6922 echo "Your long doubles are $longdblsize bytes long."
6926 echo "(I can't seem to compile the test program. Guessing...)" >&4
6927 rp="What is the size of a long double (in bytes)?"
6931 if $test "X$doublesize" = "X$longdblsize"; then
6932 echo "That isn't any different from an ordinary double."
6933 echo "I'll keep your setting anyway, but you may see some"
6934 echo "harmless compilation warnings."
6941 $echo "Checking the kind of long doubles you have..." >&4
6942 case "$d_longdbl" in
6947 #define LONGDBLSIZE $longdblsize
6948 #define DOUBLESIZE $doublesize
6955 static const long double d = -0.1L;
6958 unsigned const char* b = (unsigned const char*)(&d);
6959 #if DOUBLESIZE == LONGDBLSIZE
6960 printf("0\n"); /* if it floats like double */
6963 #if (LDBL_MANT_DIG == 113 || FLT128_MANT_DIG == 113) && LONGDBLSIZE == 16
6964 if (b[0] == 0x9A && b[1] == 0x99 && b[15] == 0xBF) {
6965 /* IEEE 754 128-bit little-endian */
6969 if (b[0] == 0xBF && b[14] == 0x99 && b[15] == 0x9A) {
6970 /* IEEE 128-bit big-endian, e.g. solaris sparc */
6975 /* For alignment 32-bit platforms have the 80 bits in 12 bytes,
6976 * while 64-bits platforms have it in 16 bytes. */
6977 #if LDBL_MANT_DIG == 64 && (LONGDBLSIZE == 16 || LONGDBLSIZE == 12)
6978 if (b[0] == 0xCD && b[9] == 0xBF && b[10] == 0x00) {
6979 /* x86 80-bit little-endian, sizeof 12 (ILP32, Solaris x86)
6980 * or 16 (LP64, Linux and OS X), 4 or 6 bytes of padding.
6981 * Also known as "extended precision". */
6985 if (b[0] == 0xBF && b[9] == 0xCD && b[10] == 0x00) {
6986 /* is there ever big-endian 80-bit, really? */
6991 #if (LDBL_MANT_DIG == 106 || LDBL_MANT_DIG == 107) && LONGDBLSIZE == 16
6992 /* software "double double", the 106 is 53+53.
6993 * but irix thinks it is 107. */
6994 if (b[0] == 0x9A && b[7] == 0x3C && b[8] == 0x9A && b[15] == 0xBF) {
6995 /* double double 128-bit little-endian,
6996 * 9a 99 99 99 99 99 59 3c 9a 99 99 99 99 99 b9 bf */
7000 if (b[0] == 0xBF && b[7] == 0x9A && b[8] == 0x3C && b[15] == 0x9A) {
7001 /* double double 128-bit big-endian, e.g. PPC/Power and MIPS:
7002 * bf b9 99 99 99 99 99 9a 3c 59 99 99 99 99 99 9a */
7007 printf("-1\n"); /* unknown */
7012 if eval $compile; then
7013 longdblkind=`$run ./try`
7020 case "$longdblkind" in
7021 0) echo "Your long doubles are doubles." >&4 ;;
7022 1) echo "You have IEEE 754 128-bit little endian long doubles." >&4 ;;
7023 2) echo "You have IEEE 754 128-bit big endian long doubles." >&4 ;;
7024 3) echo "You have x86 80-bit little endian long doubles." >& 4 ;;
7025 4) echo "You have x86 80-bit big endian long doubles." >& 4 ;;
7026 5) echo "You have 128-bit little-endian double-double long doubles." >& 4 ;;
7027 6) echo "You have 128-bit big-endian double-double long doubles." >& 4 ;;
7028 *) echo "Cannot figure out your long double." >&4 ;;
7033 : determine the architecture name
7035 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
7036 tarch=`arch`"-$osname"
7037 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
7038 if uname -m > tmparch 2>&1 ; then
7039 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
7040 -e 's/$/'"-$osname/" tmparch`
7048 case "$myarchname" in
7051 echo "(Your architecture name used to be $myarchname.)"
7055 case "$targetarch" in
7057 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
7062 *) dflt="$archname";;
7064 rp='What is your architecture name'
7068 : optionally add API version to the architecture for versioned archlibs
7069 case "$useversionedarchname" in
7070 $define|true|[yY]*) dflt='y';;
7073 rp='Add the Perl API version to your archname?'
7076 y|Y) useversionedarchname="$define" ;;
7077 *) useversionedarchname="$undef" ;;
7079 case "$useversionedarchname" in
7082 *-$api_versionstring)
7083 echo "...and architecture name already has -$api_versionstring" >&4
7086 archname="$archname-$api_versionstring"
7087 echo "...setting architecture name to $archname." >&4
7093 case "$usethreads" in
7095 echo "Threads selected." >&4
7097 *-thread*) echo "...and architecture name already has -thread." >&4
7099 *) archname="$archname-thread"
7100 echo "...setting architecture name to $archname." >&4
7105 case "$usemultiplicity" in
7107 echo "Multiplicity selected." >&4
7109 *-multi*) echo "...and architecture name already has -multi." >&4
7111 *) archname="$archname-multi"
7112 echo "...setting architecture name to $archname." >&4
7117 case "$use64bitint$use64bitall" in
7119 case "$archname64" in
7121 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
7124 case "$use64bitint" in
7125 "$define") echo "64 bit integers selected." >&4 ;;
7127 case "$use64bitall" in
7128 "$define") echo "Maximal 64 bitness selected." >&4 ;;
7131 *-$archname64*) echo "...and architecture name already has $archname64." >&4
7133 *) archname="$archname-$archname64"
7134 echo "...setting architecture name to $archname." >&4
7140 case "$uselongdouble" in
7142 echo "Long doubles selected." >&4
7143 case "$longdblsize" in
7145 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
7149 *-ld*) echo "...and architecture name already has -ld." >&4
7151 *) archname="$archname-ld"
7152 echo "...setting architecture name to $archname." >&4
7159 case "$usequadmath" in
7161 echo "quadmath selected." >&4
7163 *-ld*) echo "...and architecture name already has -quadmath." >&4
7165 *) archname="$archname-quadmath"
7166 echo "...setting architecture name to $archname." >&4
7171 if $test -f archname.cbu; then
7172 echo "Your platform has some specific hints for architecture name, using them..."
7176 : set the prefixit variable, to compute a suitable default value
7177 prefixit='case "$3" in
7179 case "$oldprefix" in
7180 "") eval "$1=\"\$$2\"";;
7187 ""|" ") eval "$1=\"\$$2\"";;
7193 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
7195 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
7196 /*-$oldprefix/*|\~*-$oldprefix/*)
7197 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
7198 *) eval "$1=\"\$$2\"";;
7202 : determine installation style
7203 : For now, try to deduce it from prefix unless it is already set.
7204 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
7205 case "$installstyle" in
7206 '') case "$prefix" in
7207 *perl*) dflt='lib';;
7208 *) dflt='lib/perl5' ;;
7211 *) dflt="$installstyle" ;;
7213 : Probably not worth prompting for this since we prompt for all
7214 : the directories individually, and the prompt would be too long and
7218 : determine where public executables go
7223 rp='Pathname where the public executables will reside?'
7225 if $test "X$ansexp" != "X$binexp"; then
7229 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
7230 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
7231 : this via initialinstalllocation
7234 case "$userelocatableinc" in
7235 $define|true|[yY]*) dflt='y' ;;
7240 Would you like to build Perl so that the installation is relocatable, so that
7241 library paths in @INC are determined relative to the path of the perl binary?
7242 This is not advised for system Perl installs, or if you need to run setid
7243 scripts or scripts under taint mode.
7245 If this doesn't make any sense to you, just accept the default '$dflt'.
7247 rp='Use relocatable @INC?'
7250 y|Y) val="$define" ;;
7253 set userelocatableinc
7256 initialinstalllocation="$binexp"
7257 : Default prefix is now "up one level from where the binaries are"
7258 case "$userelocatableinc" in
7264 installprefixexp=".../.."
7268 : determine where private library files go
7269 : Usual default is /usr/local/lib/perl5/$version.
7270 : Also allow things like /opt/perl/lib/$version, since
7271 : /opt/perl/lib/perl5... would be redundant.
7272 : The default "style" setting is made in installstyle.U
7273 case "$installstyle" in
7274 *lib/perl5*) set dflt privlib lib/$package/$version ;;
7275 *) set dflt privlib lib/$version ;;
7280 There are some auxiliary files for $package that need to be put into a
7281 private library directory that is accessible by everyone.
7286 rp='Pathname where the private library files will reside?'
7291 : set the prefixup variable, to restore leading tilda escape
7292 prefixup='case "$prefixexp" in
7294 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
7297 : determine where public architecture dependent libraries go
7300 : privlib default is /usr/local/lib/$package/$version
7301 : archlib default is /usr/local/lib/$package/$version/$archname
7302 : privlib may have an optional trailing /share.
7303 tdflt=`echo $privlib | $sed 's,/share$,,'`
7304 tdflt=$tdflt/$archname
7313 $spackage contains architecture-dependent library files. If you are
7314 sharing libraries in a heterogeneous environment, you might store
7315 these files in a separate location. Otherwise, you can just include
7316 them with the rest of the public library files.
7321 rp='Where do you want to put the public architecture-dependent libraries?'
7325 if $test X"$archlib" = X"$privlib"; then
7331 : see if setuid scripts can be secure
7334 Some kernels have a bug that prevents setuid #! scripts from being
7335 secure. Some sites have disabled setuid #! scripts because of this.
7337 First let's decide if your kernel supports secure setuid #! scripts.
7338 (If setuid #! scripts would be secure but have been disabled anyway,
7339 don't say that they are secure if asked.)
7344 if $test -d /dev/fd; then
7345 echo "#!$ls" >reflect
7346 chmod +x,u+s reflect
7347 ./reflect >flect 2>&1
7348 if $contains "/dev/fd" flect >/dev/null; then
7349 echo "Congratulations, your kernel has secure setuid scripts!" >&4
7353 If you are not sure if they are secure, I can check but I'll need a
7354 username and password different from the one you are using right now.
7355 If you don't have such a username or don't want me to test, simply
7359 rp='Other username to test security of setuid scripts with?'
7364 case "$d_suidsafe" in
7365 '') echo "I'll assume setuid scripts are *not* secure." >&4
7368 echo "Well, the $hint value is *not* secure." >&4
7370 *) echo "Well, the $hint value *is* secure." >&4
7375 $rm -f reflect flect
7376 echo "#!$ls" >reflect
7377 chmod +x,u+s reflect
7380 echo '"su" will (probably) prompt you for '"$ans's password."
7381 su $ans -c './reflect >flect'
7382 if $contains "/dev/fd" flect >/dev/null; then
7383 echo "Okay, it looks like setuid scripts are secure." >&4
7386 echo "I don't think setuid scripts are secure." >&4
7391 rp='Does your kernel have *secure* setuid scripts?'
7394 [yY]*) val="$define";;
7399 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
7400 echo "(That's for file descriptors, not floppy disks.)"
7406 $rm -f reflect flect
7408 : now see if they want to do setuid emulation
7409 if $test $patchlevel -lt 11; then
7412 case "$d_suidsafe" in
7415 echo "No need to emulate SUID scripts since they are secure here." >&4
7419 Some systems have disabled setuid scripts, especially systems where
7420 setuid scripts cannot be secure. On systems where setuid scripts have
7421 been disabled, the setuid/setgid bits on scripts are currently
7422 useless. It is possible for $package to detect those bits and emulate
7423 setuid/setgid in a secure fashion. This emulation will only work if
7424 setuid scripts have been disabled in your kernel.
7428 "$define") dflt=y ;;
7431 rp="Do you want to do setuid/setgid emulation?"
7434 [yY]*) val="$define";;
7446 SUID emulation has been removed for 5.12
7447 Please re-run Configure without -Dd_dosuid
7456 : Find perl5.005 or later.
7457 echo "Looking for a previously installed perl5.005 or later... "
7459 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
7460 : Check if this perl is recent and can load a simple module
7461 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
7464 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
7474 '') echo "None found. That's ok.";;
7475 *) echo "Using $perl5." ;;
7478 : Set the siteprefix variables
7481 After $package is installed, you may wish to install various
7482 add-on modules and utilities. Typically, these add-ons will
7483 be installed under $prefix with the rest
7484 of this package. However, you may wish to install such add-ons
7485 elsewhere under a different prefix.
7487 If you do not wish to put everything under a single prefix, that's
7488 ok. You will be prompted for the individual locations; this siteprefix
7489 is only used to suggest the defaults.
7491 The default should be fine for most people.
7495 rp='Installation prefix to use for add-on modules and utilities?'
7496 : XXX Here might be another good place for an installstyle setting.
7497 case "$siteprefix" in
7499 *) dflt=$siteprefix ;;
7502 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
7504 case "$siteprefix" in
7508 *) oldsiteprefix="$prefix";;
7513 siteprefixexp="$ansexp"
7515 : determine where site specific libraries go.
7516 : Usual default is /usr/local/lib/perl5/site_perl/$version
7517 : The default "style" setting is made in installstyle.U
7518 : XXX No longer works with Prefixit stuff.
7519 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7521 '') case "$installstyle" in
7522 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
7523 *) dflt=$siteprefix/lib/site_$prog/$version ;;
7531 The installation process will create a directory for
7532 site-specific extensions and modules. Most users find it convenient
7533 to place all site-specific files in this directory rather than in the
7534 main distribution directory.
7538 rp='Pathname for the site-specific library files?'
7542 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
7544 : Determine list of previous versions to include in @INC
7545 $cat > getverlist <<EOPL
7548 \$api_versionstring = "$api_versionstring";
7549 \$version = "$version";
7550 \$stem = "$sitelib_stem";
7551 \$archname = "$archname";
7553 $cat >> getverlist <<'EOPL'
7554 # The list found is store twice for each entry: the original name, and
7555 # the binary broken down version as pack "sss", so sorting is easy and
7556 # unambiguous. This will work for all versions that have a maximum of
7557 # three digit groups, separate by '.'s or '_'s. Names are extended with
7558 # ".0.0" to ensure at least three elements for the pack.
7559 # -- H.Merijn Brand (m)'06 23-10-2006
7561 # Can't have leading @ because metaconfig interprets it as a command!
7562 ;@inc_version_list=();
7563 # XXX Redo to do opendir/readdir?
7566 ;@candidates = map {
7567 [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
7568 ;@candidates = sort { $a->[1] cmp $b->[1]} @candidates;
7574 ($pversion, $aversion, $vsn5005) = map {
7575 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
7576 foreach $d (@candidates) {
7577 if ($d->[1] lt $pversion) {
7578 if ($d->[1] ge $aversion) {
7579 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
7581 elsif ($d->[1] ge $vsn5005) {
7582 unshift(@inc_version_list, grep { -d } $d->[0]);
7586 # Skip newer version. I.e. don't look in
7587 # 5.7.0 if we're installing 5.6.1.
7591 if (@inc_version_list) {
7592 print join(' ', @inc_version_list);
7595 # Blank space to preserve value for next Configure run.
7600 case "$inc_version_list" in
7601 '') if test -x "$perl5$exe_ext"; then
7602 dflt=`$perl5 getverlist`
7607 $undef) dflt='none' ;;
7608 *) eval dflt=\"$inc_version_list\" ;;
7611 ''|' ') dflt=none ;;
7618 In order to ease the process of upgrading, this version of perl
7619 can be configured to use modules built and installed with earlier
7620 versions of perl that were installed under $prefix. Specify here
7621 the list of earlier versions that this version of perl should check.
7622 If Configure detected no earlier versions of perl installed under
7623 $prefix, then the list will be empty. Answer 'none' to tell perl
7624 to not search earlier versions.
7626 The default should almost always be sensible, so if you're not sure,
7627 just accept the default.
7630 rp='List of earlier versions to include in @INC?'
7633 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
7634 *) inc_version_list="$ans" ;;
7636 case "$inc_version_list" in
7638 inc_version_list_init='0'
7639 d_inc_version_list="$undef"
7641 *) inc_version_list_init=`echo $inc_version_list |
7642 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
7643 d_inc_version_list="$define"
7648 : see if malloc/malloc.h has to be included
7649 set malloc/malloc.h i_mallocmalloc
7652 : see if this is a malloc.h system
7653 : we want a real compile instead of Inhdr because some systems have a
7654 : malloc.h that just gives a compile error saying to use stdlib.h instead
7659 #$i_mallocmalloc I_MALLOCMALLOC
7660 #ifdef I_MALLOCMALLOC
7661 # include <malloc/malloc.h>
7664 int main () { return 0; }
7667 if eval $compile; then
7668 echo "<malloc.h> found." >&4
7671 echo "<malloc.h> NOT found." >&4
7678 : check for length of pointer
7682 echo "Checking to see how big your pointers are..." >&4
7691 printf("%d\n", (int)sizeof(void *));
7696 if eval $compile_ok; then
7697 ptrsize=`$run ./try`
7698 echo "Your pointers are $ptrsize bytes long."
7701 echo "(I can't seem to compile the test program. Guessing...)" >&4
7702 rp="What is the size of a pointer (in bytes)?"
7709 case "$use64bitall" in
7710 "$define"|true|[yY]*)
7714 *** You have chosen a maximally 64-bit build,
7715 *** but your pointers are only 4 bytes wide.
7716 *** Please rerun Configure without -Duse64bitall.
7721 *** Since you have quads, you could possibly try with -Duse64bitint.
7726 *** Cannot continue, aborting.
7737 : determine whether to use malloc wrapping
7739 case "$usemallocwrap" in
7740 [yY]*|true|$define) dflt='y' ;;
7741 [nN]*|false|$undef) dflt='n' ;;
7742 *) case "$usedevel" in
7743 [yY]*|true|$define) dflt='y' ;;
7748 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
7750 usemallocwrap="$ans"
7753 usemallocwrap="$define" ;;
7755 usemallocwrap="$undef" ;;
7758 : determine which malloc to compile in
7760 case "$usemymalloc" in
7761 [yY]*|true|$define) dflt='y' ;;
7762 [nN]*|false|$undef) dflt='n' ;;
7763 *) case "$ptrsize" in
7767 if test "$useithreads" = "$define"; then dflt='n'; fi
7770 rp="Do you wish to attempt to use the malloc that comes with $package?"
7776 mallocsrc='malloc.c'
7777 mallocobj="malloc$_o"
7778 d_mymalloc="$define"
7781 : Remove malloc from list of libraries to use
7782 echo "Removing unneeded -lmalloc from library list" >&4
7783 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
7786 echo "libs = $libs" >&4
7798 : compute the return types of malloc and free
7800 $cat >malloc.c <<END
7804 #include <sys/types.h>
7818 case "$malloctype" in
7820 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
7827 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
7831 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
7838 echo "Your system uses $freetype free(), it would seem." >&4
7840 : determine where site specific architecture-dependent libraries go.
7841 : sitelib default is /usr/local/lib/perl5/site_perl/$version
7842 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
7843 : sitelib may have an optional trailing /share.
7845 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
7846 dflt="$dflt/$archname"
7851 set sitearch sitearch none
7855 The installation process will also create a directory for
7856 architecture-dependent site-specific extensions and modules.
7860 rp='Pathname for the site-specific architecture-dependent library files?'
7864 if $test X"$sitearch" = X"$sitelib"; then
7867 d_sitearch="$define"
7870 : Set the vendorprefix variables
7873 The installation process will also create a directory for
7874 vendor-supplied add-ons. Vendors who supply perl with their system
7875 may find it convenient to place all vendor-supplied files in this
7876 directory rather than in the main distribution directory. This will
7877 ease upgrades between binary-compatible maintenance versions of perl.
7879 Of course you may also use these directories in whatever way you see
7880 fit. For example, you might use them to access modules shared over a
7881 company-wide network.
7883 The default answer should be fine for most people.
7884 This causes further questions about vendor add-ons to be skipped
7885 and no vendor-specific directories will be configured for perl.
7888 rp='Do you want to configure vendor-specific add-on directories?'
7889 case "$usevendorprefix" in
7890 define|true|[yY]*) dflt=y ;;
7891 *) : User may have set vendorprefix directly on Configure command line.
7892 case "$vendorprefix" in
7901 rp='Installation prefix to use for vendor-supplied add-ons?'
7902 case "$vendorprefix" in
7903 '') dflt="$prefix" ;;
7904 *) dflt=$vendorprefix ;;
7907 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
7909 case "$vendorprefix" in
7913 *) oldvendorprefix="$prefix";;
7917 usevendorprefix="$define"
7919 vendorprefixexp="$ansexp"
7921 *) usevendorprefix="$undef"
7927 : Set the vendorlib variables
7928 case "$vendorprefix" in
7929 '') d_vendorlib="$undef"
7933 *) d_vendorlib="$define"
7934 : determine where vendor-supplied modules go.
7935 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
7936 case "$vendorlib" in
7938 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7939 case "$installstyle" in
7940 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
7941 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
7944 *) dflt="$vendorlib"
7948 rp='Pathname for the vendor-supplied library files?'
7951 vendorlibexp="$ansexp"
7954 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
7958 : Set the vendorarch variables
7959 case "$vendorprefix" in
7960 '') d_vendorarch="$undef"
7964 *) d_vendorarch="$define"
7965 : determine where vendor-supplied architecture-dependent libraries go.
7966 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
7967 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
7968 : vendorlib may have an optional trailing /share.
7969 case "$vendorarch" in
7970 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
7971 dflt="$dflt/$archname"
7973 *) dflt="$vendorarch" ;;
7976 rp='Pathname for vendor-supplied architecture-dependent files?'
7979 vendorarchexp="$ansexp"
7982 prefixvar=vendorarch
7984 if $test X"$vendorarch" = X"$vendorlib"; then
7985 d_vendorarch="$undef"
7987 d_vendorarch="$define"
7990 : Final catch-all directories to search
7993 Lastly, you can have perl look in other directories for extensions and
7994 modules in addition to those already specified.
7995 These directories will be searched after
7999 test X"$vendorlib" != "X" && echo ' ' $vendorlib
8000 test X"$vendorarch" != "X" && echo ' ' $vendorarch
8002 case "$otherlibdirs" in
8003 ''|' ') dflt='none' ;;
8004 *) dflt="$otherlibdirs" ;;
8007 Enter a colon-separated set of extra paths to include in perl's @INC
8008 search path, or enter 'none' for no extra paths.
8012 rp='Colon-separated list of additional directories for perl to search?'
8015 ' '|''|none) otherlibdirs=' ' ;;
8016 *) otherlibdirs="$ans" ;;
8018 case "$otherlibdirs" in
8022 set d_perl_otherlibdirs
8025 : Cruising for prototypes
8027 echo "Checking out function prototypes..." >&4
8028 $cat >prototype.c <<EOCP
8033 int main(int argc, char *argv[]) {
8036 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
8037 echo "Your C compiler appears to support function prototypes."
8040 echo "Your C compiler doesn't seem to understand function prototypes."
8047 : Check if ansi2knr is required
8048 case "$prototype" in
8050 *) ansi2knr='ansi2knr'
8055 This version of $package can only be compiled by a compiler that
8056 understands function prototypes. Unfortunately, your C compiler
8058 doesn't seem to understand them. Sorry about that.
8060 If GNU cc is available for your system, perhaps you could try that instead.
8062 Eventually, we hope to support building Perl with pre-ANSI compilers.
8063 If you would like to help in that effort, please contact <perlbug@perl.org>.
8065 Aborting Configure now.
8072 dflt_dtrace='/usr/sbin/dtrace'
8073 $test -x /usr/bin/dtrace && dflt_dtrace='/usr/bin/dtrace'
8077 Perl can be built to support DTrace on platforms that support it.
8078 DTrace is a diagnosis and performance analysis tool from Sun.
8080 If this doesn't make any sense to you, just accept the default '$dflt'.
8084 case "$usedtrace" in
8090 dflt_dtrace=$usedtrace
8097 rp='Support DTrace if available?'
8100 y|Y) val="$define" ;;
8106 test "X$usedtrace" != "X$define" && break
8109 rp='Where is the dtrace executable?'
8118 if $dtrace -h -s ../perldtrace.d \
8119 -o perldtrace.tmp >/dev/null 2>&1 \
8120 && rm -f perldtrace.tmp
8123 echo "Good: your $dtrace knows about the -h flag."
8127 *** $me: Fatal Error: $dtrace doesn't support -h flag
8129 *** Your installed dtrace doesn't support the -h switch to compile a D
8130 *** program into a C header. Can't continue.
8142 *** $me: Fatal Error: $dtrace not found.
8149 echo "*** $dtrace was not found."
8155 : See if we want extra modules installed
8162 Perl can be built with extra modules or bundles of modules which
8163 will be fetched from the CPAN and installed alongside Perl.
8165 Notice that you will need access to the CPAN; either via the Internet,
8166 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
8167 be asked later to configure the CPAN.pm module which will in turn do
8168 the installation of the rest of the extra modules or bundles.)
8170 Notice also that if the modules require any external software such as
8171 libraries and headers (the libz library and the zlib.h header for the
8172 Compress::Zlib module, for example) you MUST have any such software
8173 already installed, this configuration process will NOT install such
8176 If this doesn't make any sense to you, just accept the default '$dflt'.
8178 rp='Install any extra modules (y or n)?'
8184 Please list any extra modules or bundles to be installed from CPAN,
8185 with spaces between the names. The names can be in any format the
8186 'install' command of CPAN.pm will understand. (Answer 'none',
8187 without the quotes, to install no extra modules or bundles.)
8197 $rm -f ../extras.lst
8199 *) echo "(Saving the list of extras for later...)"
8200 echo "$extras" > ../extras.lst
8208 : determine where html pages for programs go
8209 set html1dir html1dir none
8213 If you wish to install html files for programs in $spackage, indicate
8214 the appropriate directory here. To skip installing html files,
8218 ''|none|$undef|' ') dflt=none ;;
8219 *) dflt=$html1dir ;;
8222 rp="Directory for the main $spackage html pages?"
8226 : Use ' ' for none so value is preserved next time through Configure
8227 $test X"$html1dir" = "X" && html1dir=' '
8229 : determine where html pages for libraries and modules go
8230 set html3dir html3dir none
8234 If you wish to install html files for modules associated with $spackage,
8235 indicate the appropriate directory here. To skip installing html files,
8238 : There is no obvious default. If they have specified html1dir, then
8239 : try to key off that, possibly changing .../html1 into .../html3.
8241 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
8242 *) dflt=$html3dir ;;
8245 rp="Directory for the $spackage module html pages?"
8249 : Use ' ' for none so value is preserved next time through Configure
8250 $test X"$html3dir" = "X" && html3dir=' '
8252 : determine whether to install perl also as /usr/bin/perl
8255 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
8257 Many scripts expect perl to be installed as /usr/bin/perl.
8259 If you want to, I can install the perl you are about to compile
8260 as /usr/bin/perl (in addition to $bin/perl).
8262 if test -f /usr/bin/perl; then
8265 However, please note that because you already have a /usr/bin/perl,
8266 overwriting that with a new Perl would very probably cause problems.
8267 Therefore I'm assuming you don't want to do that (unless you insist).
8270 case "$installusrbinperl" in
8271 "$define"|[yY]*) dflt='y';;
8277 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
8280 case "$installusrbinperl" in
8281 "$undef"|[nN]*) dflt='n';;
8285 rp="Do you want to install perl as /usr/bin/perl?"
8288 [yY]*) val="$define";;
8294 set installusrbinperl
8297 : see if dlopen exists
8299 xxx_ccflags="$ccflags"
8301 : with g++ one needs -shared to get is-in-libc to work for dlopen
8302 case "$gccversion" in
8304 *) case "$d_cplusplus" in
8305 "$define") ccflags="$ccflags -shared" ;;
8312 ccflags="$xxx_ccflags"
8314 : see if this is a unistd.h system
8315 set unistd.h i_unistd
8318 : determine which dynamic loading, if any, to compile in
8320 dldir="ext/DynaLoader"
8333 $define) dflt='y' ;;
8335 : Does a dl_xxx.xs file exist for this operating system
8336 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
8339 rp="Do you wish to use dynamic loading?"
8346 '') if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
8347 dflt="$dldir/dl_${osname}.xs"
8348 elif $test "$d_dlopen" = "$define" ; then
8349 dflt="$dldir/dl_dlopen.xs"
8354 *) dflt="$dldir/$dlsrc"
8357 echo "The following dynamic loading files are available:"
8358 : Can not go over to $dldir because getfile has path hard-coded in.
8359 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
8360 rp="Source file to use for dynamic loading"
8366 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
8370 Some systems may require passing special flags to $cc -c to
8371 compile modules that will be used to create a shared library.
8372 To use no flags, say "none".
8375 case "$cccdlflags" in
8376 '') case "$gccversion" in
8377 '') case "$osname" in
8379 irix*) dflt='-KPIC' ;;
8380 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
8381 sunos) dflt='-pic' ;;
8385 *) case "$osname" in
8386 darwin) dflt='none' ;;
8387 *linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
8392 *) dflt="$cccdlflags" ;;
8399 # If -Dsysroot was specified, now's the time to add it
8401 if test "X$sysroot" != X; then
8402 case "$gccversion" in
8407 dflt="$dflt --sysroot=$sysroot" ;;
8417 rp="Any special flags to pass to $cc -c to compile shared library modules?"
8420 none) cccdlflags=' ' ;;
8421 *) cccdlflags="$ans" ;;
8426 Some systems use ld to create libraries that can be dynamically loaded,
8427 while other systems (such as those using ELF) use $cc.
8431 : Determine if this is ELF
8433 /* Test for whether ELF binaries are produced */
8445 int i = open("a.out",O_RDONLY);
8448 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
8449 exit(0); /* succeed (yes, it is ELF) */
8453 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
8459 '') if $test $bin_ELF = "$define"; then
8461 You appear to have ELF support. I'll use $cc to build dynamic libraries.
8465 echo "I'll use ld to build dynamic libraries."
8473 rp="What command should be used to create dynamic libraries?"
8479 Some systems may require passing special flags to $ld to create a
8480 library that can be dynamically loaded. If your ld flags include
8481 -L/other/path options to locate libraries outside your loader's normal
8482 search path, you may need to specify those -L options here as well. To
8483 use no flags, say "none".
8486 case "$lddlflags" in
8487 '') case "$osname" in
8488 haiku) dflt='-shared' ;;
8490 case "$gccversion" in
8491 '') dflt="$dflt +vnocompatwarnings" ;;
8494 *linux*|irix*|gnu*) dflt="-shared $optimize" ;;
8495 solaris) # See [perl #66604].
8496 # On Solaris 11, gcc -m64 on amd64
8497 # appears not to understand -G. gcc versions at
8498 # least as old as 3.4.3 support -shared, so just
8499 # use that with Solaris 11 and later, but keep
8500 # the old behavior for older Solaris versions.
8501 case "$gccversion" in
8503 *) case "$osvers" in
8504 2.?|2.10) dflt='-G' ;;
8505 *) dflt='-shared' ;;
8510 sunos) dflt='-assert nodefinitions' ;;
8511 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
8515 *) dflt="$lddlflags" ;;
8518 : Only do this for gcc, since, for example, qcc has no concept
8520 if $test "X$sysroot" != X; then
8521 case "$gccversion" in
8523 *) dflt="$dflt --sysroot $sysroot" ;;
8527 : Try to guess additional flags to pick up local libraries.
8528 : Be careful not to append to a plain 'none'
8532 for thisflag in $ldflags; do
8537 *) dflt="$dflt $thisflag" ;;
8544 ''|' ') dflt='none' ;;
8548 *-fstack-protector-strong*)
8550 *-fstack-protector-strong*) ;; # Don't add it again
8551 *) dflt="$dflt -fstack-protector-strong" ;;
8554 *-fstack-protector*)
8556 *-fstack-protector*) ;; # Don't add it again
8557 *) dflt="$dflt -fstack-protector" ;;
8562 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
8565 none) lddlflags=' ' ;;
8566 *) lddlflags="$ans" ;;
8571 Some systems may require passing special flags to $cc to indicate that
8572 the resulting executable will use dynamic linking. To use no flags,
8576 case "$ccdlflags" in
8577 '') case "$osname" in
8578 *linux*|hpux|gnu*) dflt='-Wl,-E' ;;
8579 sunos) dflt='none' ;;
8583 *) dflt="$ccdlflags" ;;
8585 rp="Any special flags to pass to $cc to use dynamic linking?"
8588 none) ccdlflags=' ' ;;
8589 *) ccdlflags="$ans" ;;
8601 ld_can_script="$undef"
8602 case "$bin_ELF$usedl" in
8604 # Abuse try.h and a.out names for neat cleanup
8616 if $cc $cccdlflags $ccdlflags $ccflags \
8617 $ldflags $lddlflags -o a.out try.c \
8618 -Wl,--version-script=try.h >/dev/null 2>&1 \
8619 && $test -s a.out ; then
8620 echo "ld supports scripting" >&4
8621 ld_can_script="$define"
8623 echo "ld does not support scripting" >&4
8629 : Do we want a shared libperl?
8633 # No dynamic loading being used, so don't bother even to prompt.
8636 *) case "$useshrplib" in
8637 '') case "$osname" in
8638 svr4*|nonstopux|dgux|dynixptx|esix|powerux|haiku|cygwin*)
8640 also='Building a shared libperl is required for dynamic loading to work on your system.'
8654 The perl executable is normally obtained by linking perlmain.c with
8655 libperl${_a}, any static extensions (usually just DynaLoader), and
8656 any other libraries needed on this system (such as -lm, etc.). Since
8657 your system supports dynamic loading, it is probably possible to build
8658 a shared libperl.$so. If you will have more than one executable linked
8659 to libperl.$so, this will significantly reduce the size of each
8660 executable, but it may have a noticeable effect on performance. The
8661 default is probably sensible for your system.
8665 rp="Build a shared libperl.$so (y/n)"
8669 useshrplib='true' ;;
8670 *) useshrplib='false' ;;
8675 case "$useshrplib" in
8677 case "$userelocatableinc" in
8679 echo "Cannot build with both -Duserelocatableinc and -Duseshrplib" >&4
8680 echo "See INSTALL for an explanation why that won't work." >&4
8686 # Figure out a good name for libperl.so. Since it gets stored in
8687 # a version-specific architecture-dependent library, the version
8688 # number isn't really that important, except for making cc/ld happy.
8690 # A name such as libperl.so.10.1
8691 majmin="libperl.$so.$patchlevel.$subversion"
8692 # A name such as libperl.so.100
8693 majonly=`echo $patchlevel $subversion |
8694 $awk '{printf "%d%02d", $1, $2}'`
8695 majonly=libperl.$so.$majonly
8696 # I'd prefer to keep the os-specific stuff here to a minimum, and
8697 # rely on figuring it out from the naming of libc.
8698 case "${osname}${osvers}" in
8699 *linux*|gnu*) # ld won't link with a bare -lperl otherwise.
8702 cygwin*) # ld links now against the dll directly
8703 majmin="cygperl5_${patchlevel}_${subversion}.${so}"
8704 majonly=`echo $patchlevel $subversion |
8705 $awk '{printf "%03d%03d", $1, $2}'`
8706 majonly=cygperl5.$majonly.$so
8709 *) # Try to guess based on whether libc has major.minor.
8711 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8712 *libc.$so.[0-9]*) dflt=$majonly ;;
8713 *) dflt=libperl.$so ;;
8723 I need to select a good name for the shared libperl. If your system uses
8724 library names with major and minor numbers, then you might want something
8725 like $majmin. Alternatively, if your system uses a single version
8726 number for shared libraries, then you might want to use $majonly.
8727 Or, your system might be quite happy with a simple libperl.$so.
8729 Since the shared libperl will get installed into a version-specific
8730 architecture-dependent directory, the version number of the shared perl
8731 library probably isn't important, so the default should be o.k.
8734 rp='What name do you want to give to the shared libperl?'
8737 echo "Ok, I'll use $libperl"
8740 libperl="libperl${_a}"
8744 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8748 WARNING: Use of the shrpdir variable for the installation location of
8749 the shared $libperl is not supported. It was never documented and
8750 will not work in this version. Let me (perlbug@perl.org)
8751 know of any problems this may cause.
8757 But your current setting of $shrpdir is
8758 the default anyway, so it's harmless.
8763 Further, your current attempted setting of $shrpdir
8764 conflicts with the value of $archlibexp/CORE
8765 that installperl will use.
8772 # How will the perl executable find the installed shared $libperl?
8773 # Add $xxx to ccdlflags.
8774 # If we can't figure out a command-line option, use $shrpenv to
8775 # set env LD_RUN_PATH. The main perl makefile uses this.
8776 shrpdir=$archlibexp/CORE
8779 if "$useshrplib"; then
8782 # We'll set it in Makefile.SH...
8787 freebsd|mirbsd|netbsd|openbsd|interix|dragonfly|bitrig)
8788 xxx="-Wl,-R$shrpdir"
8790 bsdos|linux|irix*|dec_osf|gnu*)
8791 xxx="-Wl,-rpath,$shrpdir"
8794 # Haiku doesn't like the default, either.
8797 # hpux doesn't like the default, either.
8798 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8801 # cygwin needs only ldlibpth
8804 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8810 # Only add $xxx if it isn't already in ccdlflags.
8811 case " $ccdlflags " in
8813 *) ccdlflags="$ccdlflags $xxx"
8816 Adding $xxx to the flags
8817 passed to $ld so that the perl executable will find the
8818 installed shared $libperl.
8826 # Fix ccdlflags in AIX for building external extensions.
8827 # (For building Perl itself bare -bE:perl.exp is needed,
8828 # Makefile.SH takes care of this.)
8830 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8832 # Respect a hint or command-line value.
8834 '') shrpenv="$tmp_shrpenv" ;;
8836 case "$ldlibpthname" in
8837 '') ldlibpthname=LD_LIBRARY_PATH ;;
8838 none) ldlibpthname='' ;;
8841 : determine where manual pages are on this system
8845 syspath='/usr/share/man/man1 /usr/man/man1'
8846 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8847 syspath="$syspath /usr/man/u_man/man1"
8848 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8849 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8850 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8851 sysman=`./loc . /usr/man/man1 $syspath`
8854 if $test -d "$sysman"; then
8855 echo "System manual is in $sysman." >&4
8857 echo "Could not find manual pages in source form." >&4
8860 : determine where manual pages go
8861 set man1dir man1dir none
8865 $spackage has manual pages available in source form.
8869 echo "However, you don't have nroff, so they're probably useless to you."
8871 '') man1dir="none";;
8874 echo "If you don't want the manual sources installed, answer 'none'."
8879 lookpath="$prefixexp/share/man/man1"
8880 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8881 lookpath="$lookpath $prefixexp/man/p_man/man1"
8882 lookpath="$lookpath $prefixexp/man/u_man/man1"
8883 lookpath="$lookpath $prefixexp/man/man.1"
8885 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8886 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8896 rp="Where do the main $spackage manual pages (source) go?"
8898 if $test "X$man1direxp" != "X$ansexp"; then
8909 : What suffix to use on installed man pages
8916 rp="What suffix should be used for the main $spackage man pages?"
8918 '') case "$man1dir" in
8932 *) dflt="$man1ext";;
8939 : see if we can have long filenames
8941 first=123456789abcdef
8943 if (echo hi >$first) 2>/dev/null; then
8944 if $test -f 123456789abcde; then
8945 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8948 echo 'You can have filenames longer than 14 characters.'>&4
8953 You can't have filenames longer than 14 chars.
8954 You can't even think about them!
8960 $rm -rf 123456789abcde*
8962 : determine where library module manual pages go
8963 set man3dir man3dir none
8967 $spackage has manual pages for many of the library modules.
8973 However, you don't have nroff, so they're probably useless to you.
8976 '') man3dir="none";;
8980 case "$d_flexfnam" in
8983 However, your system can't handle the long file names like File::Basename.3.
8986 '') man3dir="none";;
8990 echo "If you don't want the manual sources installed, answer 'none'."
8991 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8993 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8994 if $test -d "$privlib/man/man3"; then
8997 WARNING: Previous versions of perl installed man3 pages into
8998 $privlib/man/man3. This version will suggest a
8999 new default of $dflt.
9003 rp='Do you wish to preserve the old behavior?(y/n)'
9006 y*) dflt="$privlib/man/man3" ;;
9011 *) dflt="$man3dir" ;;
9018 rp="Where do the $package library man pages (source) go?"
9028 : What suffix to use on installed man pages
9034 rp="What suffix should be used for the $package library man pages?"
9036 '') case "$man3dir" in
9050 *) dflt="$man3ext";;
9057 : see if we have to deal with yellow pages, now NIS.
9058 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
9064 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
9072 rp='Are you getting the hosts file via yellow pages?'
9075 y*) hostcat='ypcat hosts';;
9076 *) hostcat='cat /etc/hosts';;
9082 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
9085 '') test -f /etc/group && groupcat='cat /etc/group';;
9088 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
9091 : now get the host name
9093 echo "Figuring out host name..." >&4
9094 case "$myhostname" in
9096 echo 'Maybe "hostname" will work...'
9097 if tans=`sh -c hostname 2>&1` ; then
9105 if $test "$cont"; then
9107 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
9108 if tans=`cat /etc/systemid 2>&1` ; then
9110 phostname='cat /etc/systemid'
9111 echo "Whadyaknow. Xenix always was a bit strange..."
9114 elif $test -r /etc/systemid; then
9115 echo "(What is a non-Xenix system doing with /etc/systemid?)"
9118 if $test "$cont"; then
9119 echo 'No, maybe "uuname -l" will work...'
9120 if tans=`sh -c 'uuname -l' 2>&1` ; then
9122 phostname='uuname -l'
9124 echo 'Strange. Maybe "uname -n" will work...'
9125 if tans=`sh -c 'uname -n' 2>&1` ; then
9127 phostname='uname -n'
9129 echo 'Oh well, maybe I can mine it out of whoami.h...'
9130 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
9131 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
9132 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
9134 case "$myhostname" in
9135 '') echo "Does this machine have an identity crisis or something?"
9138 echo "Well, you said $myhostname before..."
9139 phostname='echo $myhostname';;
9145 case "$myhostname" in
9146 '') myhostname=noname ;;
9148 : you do not want to know about this
9153 if $test "$myhostname" ; then
9155 rp='Your host name appears to be "'$myhostname'".'" Right?"
9163 : bad guess or no guess
9164 while $test "X$myhostname" = X ; do
9166 rp="Please type the (one word) name of your host:"
9171 : translate upper to lower if necessary
9172 case "$myhostname" in
9174 echo "(Normalizing case in your host name)"
9175 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
9179 case "$myhostname" in
9181 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
9182 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
9183 echo "(Trimming domain name from host name--host name is now $myhostname)"
9185 *) case "$mydomain" in
9188 test "X$hostcat" = "Xypcat hosts" &&
9189 ypmatch "$myhostname" hosts 2>/dev/null |\
9190 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
9193 test "X$hostcat" != "X" &&
9194 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
9195 /[ ]$myhostname[ . ]/p" > hosts
9198 if $test -f hosts; then
9199 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
9200 END { print sum }" hosts` = x1 || tmp_re="[ ]"
9201 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
9202 hosts | $sort | $uniq | \
9203 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
9204 case `$echo X$dflt` in
9205 X*\ *) echo "(Several hosts in the database matched hostname)"
9208 X.) echo "(You do not have fully-qualified names in the hosts database)"
9212 echo "(I cannot locate a hosts database anywhere)"
9217 tans=`./loc resolv.conf X /etc /usr/etc`
9218 if $test -f "$tans"; then
9219 echo "(Attempting domain name extraction from $tans)"
9220 dflt=.`$sed -n -e 's/ / /g' \
9221 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
9224 .) dflt=.`$sed -n -e 's/ / /g' \
9225 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
9233 .) echo "(No help from resolv.conf either -- attempting clever guess)"
9234 dflt=.`sh -c domainname 2>/dev/null`
9237 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
9241 case "$dflt$osname" in
9242 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
9243 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
9247 .) echo "(Lost all hope -- silly guess then)"
9253 *) dflt="$mydomain";;
9257 rp="What is your domain name?"
9267 : translate upper to lower if necessary
9270 echo "(Normalizing case in your domain name)"
9271 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
9275 : a little sanity check here
9276 case "$phostname" in
9279 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
9280 $myhostname$mydomain|$myhostname) ;;
9282 case "$phostname" in
9284 echo "(That doesn't agree with your whoami.h file, by the way.)"
9287 echo "(That doesn't agree with your $phostname command, by the way.)"
9295 : determine the e-mail address of the user who is running us
9298 I need to get your e-mail address in Internet format if possible, i.e.
9299 something like user@host.domain. Please answer accurately since I have
9300 no easy means to double check it. The default value provided below
9301 is most probably close to reality but may not be valid from outside
9302 your organization...
9306 while test "$cont"; do
9307 case "$MAILDOMAIN" in
9309 if $test -s /etc/mailname; then
9310 maildomain=`$cat /etc/mailname`
9312 maildomain="$myhostname$mydomain"
9315 *) maildomain="$MAILDOMAIN";;
9318 '') dflt="$cf_by@$maildomain";;
9319 *) dflt="$cf_email";;
9321 rp='What is your e-mail address?'
9327 rp='Address does not look like an Internet one. Use it anyway?'
9341 : Ask e-mail of administrator
9344 If you or somebody else will be maintaining perl at your site, please
9345 fill in the correct e-mail address here so that they may be contacted
9346 if necessary. Currently, the "perlbug" program included with perl
9347 will send mail to this address in addition to perlbug@perl.org. You may
9348 enter "none" for no administrator.
9351 case "$perladmin" in
9352 '') dflt="$cf_email";;
9353 *) dflt="$perladmin";;
9355 rp='Perl administrator e-mail address'
9359 : determine whether to only install version-specific parts.
9362 Do you want to install only the version-specific parts of the perl
9363 distribution? Usually you do *not* want to do this.
9365 case "$versiononly" in
9366 "$define"|[Yy]*|true) dflt='y' ;;
9369 rp="Do you want to install only the version-specific parts of perl?"
9372 [yY]*) val="$define";;
9378 case "$versiononly" in
9379 "$define") inc_version_list=''
9380 inc_version_list_init=0
9384 : figure out how to guarantee perl startup
9385 : XXX Note that this currently takes advantage of the bug that binexp ignores
9386 : the Configure -Dinstallprefix setting, which in turn means that under
9387 : relocatable @INC, initialinstalllocation is what binexp started as.
9388 case "$startperl" in
9390 case "$sharpbang" in
9394 I can use the #! construct to start perl on your system. This will
9395 make startup of perl scripts faster, but may cause problems if you
9396 want to share those scripts and perl is not in a standard place
9397 ($initialinstalllocation/perl) on all your platforms. The alternative
9398 is to force a shell by starting the script with a single ':' character.
9401 case "$versiononly" in
9402 "$define") dflt="$initialinstalllocation/perl$version";;
9403 *) dflt="$initialinstalllocation/perl";;
9405 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
9408 none) startperl=": # use perl";;
9409 *) startperl="#!$ans"
9410 if $test 30 -lt `echo "$ans" | wc -c`; then
9413 WARNING: Some systems limit the #! command to 32 characters.
9414 If you experience difficulty running Perl scripts with #!, try
9415 installing Perl in a directory with a shorter pathname.
9421 *) startperl=": # use perl"
9426 echo "I'll use $startperl to start perl scripts."
9428 : figure best path for perl in scripts
9431 case "$versiononly" in
9432 "$define") perlpath="$initialinstalllocation/perl$version";;
9433 *) perlpath="$initialinstalllocation/perl";;
9435 case "$startperl" in
9440 I will use the "eval 'exec'" idiom to start Perl on your system.
9441 I can use the full path of your Perl binary for this purpose, but
9442 doing so may cause problems if you want to share those scripts and
9443 Perl is not always in a standard place ($initialinstalllocation/perl).
9446 dflt="$initialinstalllocation/perl"
9447 rp="What path shall I use in \"eval 'exec'\"?"
9454 case "$startperl" in
9456 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
9459 : determine where public executable scripts go
9460 set scriptdir scriptdir
9462 case "$scriptdir" in
9465 : guess some guesses
9466 $test -d /usr/share/scripts && dflt=/usr/share/scripts
9467 $test -d /usr/share/bin && dflt=/usr/share/bin
9468 $test -d /usr/local/script && dflt=/usr/local/script
9469 $test -d /usr/local/scripts && dflt=/usr/local/scripts
9470 $test -d $prefixexp/script && dflt=$prefixexp/script
9474 *) dflt="$scriptdir"
9479 Some installations have a separate directory just for executable scripts so
9480 that they can mount it across multiple architectures but keep the scripts in
9481 one spot. You might, for example, have a subdirectory of /usr/share for this.
9482 Or you might just lump your scripts in with all your other executables.
9486 rp='Where do you keep publicly executable scripts?'
9488 if $test "X$ansexp" != "X$scriptdirexp"; then
9494 : A little fix up for an irregularly named variable.
9495 installscript="$installscriptdir"
9497 : determine where add-on public executables go
9499 '') dflt=$siteprefix/bin ;;
9503 rp='Pathname where the add-on public executables should be installed?'
9508 : determine where add-on html pages go
9509 : There is no standard location, so try to copy the previously-selected
9510 : directory structure for the core html pages.
9511 case "$sitehtml1dir" in
9512 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9513 *) dflt=$sitehtml1dir ;;
9516 ''|' ') dflt=none ;;
9519 rp='Pathname where the site-specific html pages should be installed?'
9521 prefixvar=sitehtml1dir
9524 : determine where add-on library html pages go
9525 : There is no standard location, so try to copy the previously-selected
9526 : directory structure for the core html pages.
9527 case "$sitehtml3dir" in
9528 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9529 *) dflt=$sitehtml3dir ;;
9532 ''|' ') dflt=none ;;
9535 rp='Pathname where the site-specific library html pages should be installed?'
9537 prefixvar=sitehtml3dir
9540 : determine where add-on manual pages go
9541 case "$siteman1dir" in
9542 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
9543 *) dflt=$siteman1dir ;;
9546 ''|' ') dflt=none ;;
9549 rp='Pathname where the site-specific manual pages should be installed?'
9551 prefixvar=siteman1dir
9554 : determine where add-on library man pages go
9555 case "$siteman3dir" in
9556 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
9557 *) dflt=$siteman3dir ;;
9560 ''|' ') dflt=none ;;
9563 rp='Pathname where the site-specific library manual pages should be installed?'
9565 prefixvar=siteman3dir
9568 : determine where add-on public executable scripts go
9569 case "$sitescript" in
9570 '') dflt=$siteprefix/script
9571 $test -d $dflt || dflt=$sitebin ;;
9572 *) dflt="$sitescript" ;;
9575 rp='Pathname where add-on public executable scripts should be installed?'
9577 prefixvar=sitescript
9580 : see if backtrace exists
9581 set backtrace d_backtrace
9584 : add flags if using c backtrace
9585 case "$usecbacktrace" in
9586 "") usecbacktrace=$undef ;;
9588 case "$d_backtrace" in
9590 case " $ccflags " in
9591 *" -DUSE_C_BACKTRACE "*) ;; # Already there.
9592 *) ccflags="$ccflags -DUSE_C_BACKTRACE -g" ;;
9596 echo "This system does not support backtrace" >&4
9597 usecbacktrace=$undef
9603 : Check if faststdio is requested and available
9604 case "$usefaststdio" in
9605 $define|true|[yY]*|'')
9606 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
9616 Perl can be built to use 'fast stdio', which means using the stdio
9617 library but also directly manipulating the stdio buffers to enable
9618 faster I/O. Using stdio is better for backward compatibility (especially
9619 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
9620 interface has been preferred instead of stdio.
9622 If this doesn't make any sense to you, just accept the default '$dflt'.
9624 rp='Use the "fast stdio" if available?'
9627 y|Y) val="$define" ;;
9634 : define an is-a-typedef? function
9635 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9637 "") inclist="sys/types.h";;
9639 eval "varval=\$$var";
9643 for inc in $inclist; do
9644 echo "#include <$inc>" >>temp.c;
9646 echo "#ifdef $type" >> temp.c;
9647 echo "printf(\"We have $type\");" >> temp.c;
9648 echo "#endif" >> temp.c;
9649 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9650 if $contains $type temp.E >/dev/null 2>&1; then
9656 *) eval "$var=\$varval";;
9659 : define an is-a-typedef? function that prompts if the type is not available.
9660 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9662 "") inclist="sys/types.h";;
9664 eval "varval=\$$var";
9668 for inc in $inclist; do
9669 echo "#include <$inc>" >>temp.c;
9671 echo "#ifdef $type" >> temp.c;
9672 echo "printf(\"We have $type\");" >> temp.c;
9673 echo "#endif" >> temp.c;
9674 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9676 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
9677 if $contains $type temp.E >/dev/null 2>&1; then
9678 echo "$type found." >&4;
9681 echo "$type NOT found." >&4;
9687 *) eval "$var=\$varval";;
9690 : see what type lseek is declared as in the kernel
9691 rp="What is the type used for lseek's offset on this system?"
9692 set off_t lseektype long stdio.h sys/types.h
9696 echo "Checking to see how big your file offsets are..." >&4
9698 #include <sys/types.h>
9702 printf("%d\n", (int)sizeof($lseektype));
9707 if eval $compile_ok; then
9708 lseeksize=`$run ./try`
9709 echo "Your file offsets are $lseeksize bytes long."
9713 echo "(I can't seem to compile the test program. Guessing...)"
9714 rp="What is the size of your file offsets (in bytes)?"
9720 : see what type file positions are declared as in the library
9721 rp="What is the type for file position used by fsetpos()?"
9722 set fpos_t fpostype long stdio.h sys/types.h
9725 : Check size for Fpos_t
9728 *_t) zzz="$fpostype" ;;
9731 echo "Checking the size of $zzz..." >&4
9733 #include <sys/types.h>
9740 printf("%d\n", (int)sizeof($fpostype));
9745 if eval $compile_ok; then
9749 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9752 echo "Your $zzz is $fpossize bytes long."
9758 echo "(I can't compile the test program. Guessing...)" >&4
9759 rp="What is the size of your file positions (in bytes)?"
9764 : Check for large file support
9765 # Backward compatibility (uselfs is deprecated).
9767 "$define"|true|[yY]*)
9770 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9772 uselargefiles="$define"
9776 case "$lseeksize:$fpossize" in
9779 You can have files larger than 2 gigabytes.
9782 *) case "$uselargefiles" in
9783 "$undef"|false|[nN]*) dflt='n' ;;
9788 Perl can be built to understand large files (files larger than 2 gigabytes)
9789 on some systems. To do so, Configure can be run with -Duselargefiles.
9791 If this doesn't make any sense to you, just accept the default '$dflt'.
9793 rp='Try to understand large files, if available?'
9796 y|Y) val="$define" ;;
9803 : Look for a hint-file generated 'call-back-unit'. If the
9804 : user has specified that a large files perl is to be built,
9805 : we may need to set or change some other defaults.
9806 if $test -f uselargefiles.cbu; then
9807 echo "Your platform has some specific hints regarding large file builds, using them..."
9808 . ./uselargefiles.cbu
9810 case "$uselargefiles" in
9812 if $test -f uselargefiles.cbu; then
9814 echo "Rechecking to see how big your file offsets are..." >&4
9816 #include <sys/types.h>
9820 printf("%d\n", (int)sizeof($lseektype));
9825 if eval $compile_ok; then
9826 lseeksize=`$run ./try`
9827 $echo "Your file offsets are now $lseeksize bytes long."
9831 echo "(I can't seem to compile the test program. Guessing...)"
9832 rp="What is the size of your file offsets (in bytes)?"
9837 *_t) zzz="$fpostype" ;;
9840 $echo $n "Rechecking the size of $zzz...$c" >&4
9842 #include <sys/types.h>
9849 printf("%d\n", (int)sizeof($fpostype));
9854 if eval $compile_ok; then
9859 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9862 echo " $fpossize bytes." >&4
9868 echo "(I can't compile the test program. Guessing...)" >&4
9869 rp="What is the size of your file positions (in bytes)?"
9878 : Check if we want perlio
9881 : Set the vendorbin variables
9882 case "$vendorprefix" in
9883 '') d_vendorbin="$undef"
9887 *) d_vendorbin="$define"
9888 : determine where vendor-supplied executables go.
9889 case "$vendorbin" in
9890 '') dflt=$vendorprefix/bin ;;
9891 *) dflt="$vendorbin" ;;
9894 rp='Pathname for the vendor-supplied executables directory?'
9897 vendorbinexp="$ansexp"
9903 : Set the vendorhtml1dir variables
9904 case "$vendorprefix" in
9905 '') vendorhtml1dir=''
9906 vendorhtml1direxp=''
9908 *) : determine where vendor-supplied html pages go.
9909 : There is no standard location, so try to copy the previously-selected
9910 : directory structure for the core html pages.
9911 : XXX Better default suggestions would be welcome.
9912 case "$vendorhtml1dir" in
9913 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9914 *) dflt=$vendorhtml1dir ;;
9917 ''|' ') dflt=none ;;
9920 rp='Pathname for the vendor-supplied html pages?'
9922 vendorhtml1dir="$ans"
9923 vendorhtml1direxp="$ansexp"
9926 : Use ' ' for none so value is preserved next time through Configure
9927 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9928 prefixvar=vendorhtml1dir
9931 : Set the vendorhtml3dir variables
9932 case "$vendorprefix" in
9933 '') vendorhtml3dir=''
9934 vendorhtml3direxp=''
9936 *) : determine where vendor-supplied module html pages go.
9937 : There is no standard location, so try to copy the previously-selected
9938 : directory structure for the core html pages.
9939 : XXX Better default suggestions would be welcome.
9940 case "$vendorhtml3dir" in
9941 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9942 *) dflt=$vendorhtml3dir ;;
9945 ''|' ') dflt=none ;;
9948 rp='Pathname for the vendor-supplied html pages?'
9950 vendorhtml3dir="$ans"
9951 vendorhtml3direxp="$ansexp"
9954 : Use ' ' for none so value is preserved next time through Configure
9955 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9956 prefixvar=vendorhtml3dir
9959 : Set the vendorman1dir variables
9960 case "$vendorprefix" in
9961 '') vendorman1dir=''
9964 *) : determine where vendor-supplied manual pages go.
9965 case "$vendorman1dir" in
9966 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9967 *) dflt=$vendorman1dir ;;
9970 ''|' ') dflt=none ;;
9973 rp='Pathname for the vendor-supplied manual section 1 pages?'
9975 vendorman1dir="$ans"
9976 vendorman1direxp="$ansexp"
9979 : Use ' ' for none so value is preserved next time through Configure
9980 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9981 prefixvar=vendorman1dir
9984 : Set the vendorman3dir variables
9985 case "$vendorprefix" in
9986 '') vendorman3dir=''
9989 *) : determine where vendor-supplied module manual pages go.
9990 case "$vendorman3dir" in
9991 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9992 *) dflt=$vendorman3dir ;;
9995 ''|' ') dflt=none ;;
9998 rp='Pathname for the vendor-supplied manual section 3 pages?'
10000 vendorman3dir="$ans"
10001 vendorman3direxp="$ansexp"
10004 : Use ' ' for none so value is preserved next time through Configure
10005 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
10006 prefixvar=vendorman3dir
10009 : Set the vendorscript variables
10010 case "$vendorprefix" in
10011 '') d_vendorscript="$undef"
10015 *) d_vendorscript="$define"
10016 : determine where vendor-supplied scripts go.
10017 case "$vendorscript" in
10018 '') dflt=$vendorprefix/script
10019 $test -d $dflt || dflt=$vendorbin ;;
10020 *) dflt="$vendorscript" ;;
10024 The installation process will create a directory for
10025 vendor-supplied scripts.
10029 rp='Pathname for the vendor-supplied scripts directory?'
10031 vendorscript="$ans"
10032 vendorscriptexp="$ansexp"
10035 prefixvar=vendorscript
10038 : script used to emit important warnings
10041 if test \$# -gt 0; then
10046 echo "*** WARNING:" >&4
10047 sed -e 's/^/*** /' <msg >&4
10049 cat msg >>config.msg
10050 echo " " >>config.msg
10056 : see which of string.h or strings.h is needed
10058 strings=`./findhdr string.h`
10059 if $test "$strings" && $test -r "$strings"; then
10060 echo "Using <string.h> instead of <strings.h>." >&4
10064 strings=`./findhdr strings.h`
10065 if $test "$strings" && $test -r "$strings"; then
10066 echo "Using <strings.h> instead of <string.h>." >&4
10068 ./warn "No string header found -- You'll surely have problems."
10073 case "$i_string" in
10074 "$undef") strings=`./findhdr strings.h`;;
10075 *) strings=`./findhdr string.h`;;
10078 : see if qgcvt exists
10082 : Check print/scan long double stuff
10085 if $test X"$d_longdbl" = X"$define"; then
10087 echo "Checking how to print long doubles..." >&4
10089 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
10090 $cat >try.c <<'EOCP'
10091 #include <sys/types.h>
10094 double d = 123.456;
10095 printf("%.3f\n", d);
10099 if eval $compile; then
10103 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
10104 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
10105 echo "We will use %f."
10111 if $test X"$sPRIfldbl" = X; then
10112 $cat >try.c <<'EOCP'
10113 #include <sys/types.h>
10116 long double d = 123.456;
10117 printf("%.3Lf\n", d);
10121 if eval $compile; then
10125 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
10126 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
10127 echo "We will use %Lf."
10133 if $test X"$sPRIfldbl" = X; then
10134 $cat >try.c <<'EOCP'
10135 #include <sys/types.h>
10138 long double d = 123.456;
10139 printf("%.3llf\n", d);
10143 if eval $compile; then
10147 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
10148 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
10149 echo "We will use %llf."
10155 if $test X"$sPRIfldbl" = X; then
10156 $cat >try.c <<'EOCP'
10157 #include <sys/types.h>
10160 long double d = 123.456;
10161 printf("%.3lf\n", d);
10165 if eval $compile; then
10169 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
10170 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
10171 echo "We will use %lf."
10177 if $test X"$sPRIfldbl" = X; then
10178 echo "Cannot figure out how to print long doubles." >&4
10180 sSCNfldbl=$sPRIfldbl # expect consistency
10187 case "$sPRIfldbl" in
10188 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
10189 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
10190 d_SCNfldbl="$undef";
10192 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
10193 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
10194 d_SCNfldbl="$define";
10198 : Check how to convert floats to strings.
10200 if test "X$d_Gconvert" = X; then
10203 echo "Checking for an efficient way to convert floats to strings."
10205 case "$uselongdouble" in
10206 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
10208 case "$d_longdbl" in
10209 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
10211 case "$d_PRIgldbl" in
10212 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
10215 #ifdef TRY_gconvert
10216 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
10217 char *myname = "gconvert";
10220 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
10221 char *myname = "gcvt";
10224 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
10225 char *myname = "qgcvt";
10226 #define DOUBLETYPE long double
10229 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
10230 #ifdef HAS_PRIgldbl
10231 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
10233 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
10236 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
10238 char *myname = "sprintf";
10242 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
10243 #define DOUBLETYPE long double
10245 #define DOUBLETYPE double
10251 #$i_stdlib I_STDLIB
10253 #include <stdlib.h>
10255 #$i_string I_STRING
10257 # include <string.h>
10259 # include <strings.h>
10262 int checkit(char *expect, char *got)
10264 if (strcmp(expect, got)) {
10265 printf("%s oddity: Expected %s, got %s\n",
10266 myname, expect, got);
10276 /* This must be 1st test on (which?) platform */
10277 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
10278 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
10279 checkit("0.1", buf);
10281 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
10282 checkit("0.01", buf);
10284 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
10285 checkit("0.001", buf);
10287 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
10288 checkit("0.0001", buf);
10290 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
10291 if (strlen(buf) > 5)
10292 checkit("9e-005", buf); /* for Microsoft ?? */
10294 checkit("9e-05", buf);
10296 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
10299 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
10300 checkit("1.1", buf);
10302 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
10303 checkit("1.01", buf);
10305 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
10306 checkit("1.001", buf);
10308 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
10309 checkit("1.0001", buf);
10311 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
10312 checkit("1.00001", buf);
10314 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
10315 checkit("1.000001", buf);
10317 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
10320 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
10321 checkit("-1", buf);
10323 /* Some Linux gcvt's give 1.e+5 here. */
10324 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
10325 checkit("100000", buf);
10327 /* Some Linux gcvt's give -1.e+5 here. */
10328 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
10329 checkit("-100000", buf);
10331 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
10332 checkit("123.456", buf);
10334 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
10335 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
10336 /* 34 should be enough to scare even long double
10337 * places into using the e notation. */
10338 if (strlen(buf) > 5)
10339 checkit("1e+034", buf); /* for Microsoft */
10341 checkit("1e+34", buf);
10343 /* For Perl, if you add additional tests here, also add them to
10344 * t/base/num.t for benefit of platforms not using Configure or
10345 * overriding d_Gconvert */
10350 : first add preferred functions to our list
10352 for xxx_convert in $gconvert_preference; do
10353 case $xxx_convert in
10354 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
10355 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
10358 : then add any others
10359 for xxx_convert in gconvert gcvt sprintf; do
10360 case "$xxx_list" in
10362 *) xxx_list="$xxx_list $xxx_convert" ;;
10366 case "$d_longdbl$uselongdouble" in
10368 : again, add preferred functions to our list first
10370 for xxx_convert in $gconvert_ld_preference; do
10371 case $xxx_convert in
10372 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
10373 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
10376 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
10377 for xxx_convert in qgcvt sprintf $xxx_list; do
10378 case "$xxx_ld_list" in
10379 $xxx_convert*|*" $xxx_convert"*) ;;
10380 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
10383 : if sprintf cannot do long doubles, move it to the end
10384 if test "$d_PRIgldbl" != "$define"; then
10385 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
10387 : if no qgcvt, remove it
10388 if test "$d_qgcvt" != "$define"; then
10389 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
10392 xxx_list="$xxx_ld_list"
10396 for xxx_convert in $xxx_list; do
10397 echo "Trying $xxx_convert..."
10398 $rm -f try try$_o core
10399 set try -DTRY_$xxx_convert
10400 if eval $compile; then
10401 echo "$xxx_convert() found." >&4
10402 if $run ./try; then
10403 echo "I'll use $xxx_convert to convert floats into a string." >&4
10406 echo "...But $xxx_convert didn't work as I expected."
10410 echo "$xxx_convert NOT found." >&4
10414 if test X$xxx_convert = X; then
10415 echo "*** WHOA THERE!!! ***" >&4
10416 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
10417 xxx_convert=sprintf
10420 case "$xxx_convert" in
10421 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
10422 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
10423 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
10424 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
10425 "$define$define$define")
10426 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
10427 "$define$define$undef")
10428 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
10429 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
10437 : see if _fwalk exists
10441 : Initialize h_fcntl
10444 : Initialize h_sysfile
10447 : access call always available on UNIX
10448 set access d_access
10451 : locate the flags for 'access()'
10452 case "$d_access" in
10455 $cat >access.c <<EOCP
10456 #include <sys/types.h>
10461 #include <sys/file.h>
10464 #include <unistd.h>
10466 #$i_stdlib I_STDLIB
10468 #include <stdlib.h>
10474 : check sys/file.h first, no particular reason here
10475 if $test `./findhdr sys/file.h` && \
10476 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
10478 echo "<sys/file.h> defines the *_OK access constants." >&4
10479 elif $test `./findhdr fcntl.h` && \
10480 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
10482 echo "<fcntl.h> defines the *_OK access constants." >&4
10483 elif $test `./findhdr unistd.h` && \
10484 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
10485 echo "<unistd.h> defines the *_OK access constants." >&4
10487 echo "I can't find the four *_OK access constants--I'll use mine." >&4
10493 : see if accessx exists
10494 set accessx d_accessx
10497 : see if acosh exists
10501 : see if aintl exists
10505 : see if alarm exists
10509 : see if 64bit time functions exists
10511 set ctime64 d_ctime64
10514 set localtime64 d_localtime64
10517 set gmtime64 d_gmtime64
10520 set mktime64 d_mktime64
10523 set difftime64 d_difftime64
10526 set asctime64 d_asctime64
10529 : see if POSIX threads are available
10530 set pthread.h i_pthread
10533 : define a function to check prototypes
10534 $cat > protochk <<EOSH
10537 optimize="$optimize"
10539 prototype="$prototype"
10542 usethreads=$usethreads
10543 i_pthread=$i_pthread
10544 pthread_h_first=$pthread_h_first
10547 $cat >> protochk <<'EOSH'
10552 while test $# -ge 2; do
10554 $define) echo "#include <$2>" >> try.c ;;
10555 literal) echo "$2" >> try.c ;;
10557 # Extra magic for the benefit of systems that need pthread.h
10558 # to be included early to correctly detect threadsafe functions.
10559 # Such functions must guarantee themselves, though, that the usethreads
10560 # and i_pthread have been defined, before calling protochk.
10561 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
10562 echo "#include <pthread.h>" >> try.c
10567 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
10568 cat >> try.c <<'EOCP'
10569 #ifdef CAN_PROTOTYPE
10570 #define _(args) args
10575 echo "$foo" >> try.c
10576 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
10577 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
10583 $eunicefix protochk
10585 : Define hasproto macro for Configure internal use
10586 hasproto='varname=$1; func=$2; shift; shift;
10587 while $test $# -ge 2; do
10589 $define) echo "#include <$2>";;
10593 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
10594 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
10595 echo "$func() prototype found.";
10598 echo "$func() prototype NOT found.";
10605 : see if sys/types.h has to be included
10606 set sys/types.h i_systypes
10609 : see if sys/select.h has to be included
10610 set sys/select.h i_sysselct
10613 : Define hasfield macro for Configure internal use
10614 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
10615 while $test $# -ge 2; do
10617 $define) echo "#include <$2>";;
10621 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
10623 if eval $compile; then
10632 : see if we should include time.h, sys/time.h, or both
10634 if test "X$timeincl" = X; then
10635 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
10636 $echo $n "I'm now running the test program...$c"
10638 #include <sys/types.h>
10643 #ifdef SYSTIMEKERNEL
10646 #include <sys/time.h>
10649 #include <sys/select.h>
10651 #$i_stdlib I_STDLIB
10653 #include <stdlib.h>
10659 struct timeval bar;
10662 struct timezone tzp;
10664 if (foo.tm_sec == foo.tm_sec)
10667 if (bar.tv_sec == bar.tv_sec)
10674 for s_timezone in '-DS_TIMEZONE' ''; do
10676 for s_timeval in '-DS_TIMEVAL' ''; do
10677 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10678 for i_time in '' '-DI_TIME'; do
10679 for i_systime in '-DI_SYSTIME' ''; do
10682 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10683 if eval $compile; then
10684 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
10688 $echo $n "Succeeded with $flags$c"
10700 *SYSTIMEKERNEL*) i_systimek="$define"
10701 timeincl=`./findhdr sys/time.h`
10702 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10703 *) i_systimek="$undef";;
10706 *I_TIME*) i_time="$define"
10707 timeincl=`./findhdr time.h`" $timeincl"
10708 echo "We'll include <time.h>." >&4;;
10709 *) i_time="$undef";;
10712 *I_SYSTIME*) i_systime="$define"
10713 timeincl=`./findhdr sys/time.h`" $timeincl"
10714 echo "We'll include <sys/time.h>." >&4;;
10715 *) i_systime="$undef";;
10719 : see if struct tm knows about tm_zone
10720 case "$i_systime$i_time" in
10723 echo "Checking to see if your struct tm has tm_zone field..." >&4
10724 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
10732 case "$d_tm_tm_zone" in
10733 "$define") echo "Yes, it does." ;;
10734 *) echo "No, it doesn't." ;;
10736 : see if struct tm knows about tm_gmtoff
10737 case "$i_systime$i_time" in
10740 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
10741 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
10749 case "$d_tm_tm_gmtoff" in
10750 "$define") echo "Yes, it does." ;;
10751 *) echo "No, it doesn't." ;;
10754 : see if asctime_r exists
10755 set asctime_r d_asctime_r
10757 case "$d_asctime_r" in
10759 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10760 case "$d_asctime_r_proto:$usethreads" in
10761 ":define") d_asctime_r_proto=define
10762 set d_asctime_r_proto asctime_r $hdrs
10766 case "$d_asctime_r_proto" in
10768 case "$asctime_r_proto" in
10769 ''|0) try='char* asctime_r(const struct tm*, char*);'
10770 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SB ;;
10772 case "$asctime_r_proto" in
10773 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
10774 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SBI ;;
10776 case "$asctime_r_proto" in
10777 ''|0) try='int asctime_r(const struct tm*, char*);'
10778 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SB ;;
10780 case "$asctime_r_proto" in
10781 ''|0) try='int asctime_r(const struct tm*, char*, int);'
10782 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SBI ;;
10784 case "$asctime_r_proto" in
10785 ''|0) d_asctime_r=undef
10787 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
10788 * ) case "$asctime_r_proto" in
10789 REENTRANT_PROTO*) ;;
10790 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
10792 echo "Prototype: $try" ;;
10795 *) case "$usethreads" in
10796 define) echo "asctime_r has no prototype, not using it." >&4 ;;
10803 *) asctime_r_proto=0
10807 : see if atolf exists
10811 : see if atoll exists
10815 : Look for GCC-style attribute format
10816 case "$d_attribute_format" in
10819 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
10820 $cat >attrib.c <<'EOCP'
10822 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
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__((format))."
10829 echo "Your C compiler supports __attribute__((format))."
10833 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10837 *) val="$d_attribute_format" ;;
10839 set d_attribute_format
10843 : Look for GCC-style attribute format with null format allowed
10844 case "$d_printf_format_null" in
10845 '') case "$d_attribute_format" in
10848 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
10849 $cat >attrib.c <<EOCP
10851 #$i_stdlib I_STDLIB
10853 #include <stdlib.h>
10855 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
10856 int null_printf (char* pat,...) { return (int)pat; }
10857 int main () { exit(null_printf(NULL)); }
10859 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
10860 : run the executable in case it produces a run-time warning
10861 if $run ./attrib >>attrib.out 2>&1; then
10862 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10863 echo "Your C compiler doesn't allow __printf__ format to be null."
10866 echo "Your C compiler allows __printf__ format to be null."
10870 echo "Your C compiler executable failed with __printf__ format null."
10874 echo "Your C compiler fails with __printf__ format null."
10881 *) val="$d_printf_format_null" ;;
10883 set d_printf_format_null
10887 : Look for GCC-style attribute malloc
10888 case "$d_attribute_malloc" in
10891 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
10892 $cat >attrib.c <<'EOCP'
10894 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
10896 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10897 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10898 echo "Your C compiler doesn't support __attribute__((malloc))."
10901 echo "Your C compiler supports __attribute__((malloc))."
10905 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10909 *) val="$d_attribute_malloc" ;;
10911 set d_attribute_malloc
10915 : Look for GCC-style attribute nonnull
10916 case "$d_attribute_nonnull" in
10919 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
10920 $cat >attrib.c <<'EOCP'
10922 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
10924 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10925 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10926 echo "Your C compiler doesn't support __attribute__((nonnull))."
10929 echo "Your C compiler supports __attribute__((nonnull))."
10933 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10937 *) val="$d_attribute_nonnull" ;;
10939 set d_attribute_nonnull
10943 : Look for GCC-style attribute noreturn
10944 case "$d_attribute_noreturn" in
10947 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
10948 $cat >attrib.c <<'EOCP'
10950 void fall_over_dead( void ) __attribute__((noreturn));
10952 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10953 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10954 echo "Your C compiler doesn't support __attribute__((noreturn))."
10957 echo "Your C compiler supports __attribute__((noreturn))."
10961 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10965 *) val="$d_attribute_noreturn" ;;
10967 set d_attribute_noreturn
10971 : Look for GCC-style attribute pure
10972 case "$d_attribute_pure" in
10975 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
10976 $cat >attrib.c <<'EOCP'
10978 int square( int n ) __attribute__((pure));
10980 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10981 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10982 echo "Your C compiler doesn't support __attribute__((pure))."
10985 echo "Your C compiler supports __attribute__((pure))."
10989 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10993 *) val="$d_attribute_pure" ;;
10995 set d_attribute_pure
10999 : Look for GCC-style attribute unused
11000 case "$d_attribute_unused" in
11003 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
11004 $cat >attrib.c <<'EOCP'
11006 int do_something( int dummy __attribute__((unused)), int n );
11008 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11009 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11010 echo "Your C compiler doesn't support __attribute__((unused))."
11013 echo "Your C compiler supports __attribute__((unused))."
11017 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11021 *) val="$d_attribute_unused" ;;
11023 set d_attribute_unused
11027 : Look for GCC-style attribute deprecated
11028 case "$d_attribute_deprecated" in
11031 echo "Checking whether your compiler can handle __attribute__((deprecated)) ..." >&4
11032 $cat >attrib.c <<'EOCP'
11034 int I_am_deprecated(void) __attribute__((deprecated));
11036 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11037 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11038 echo "Your C compiler doesn't support __attribute__((deprecated))."
11041 echo "Your C compiler supports __attribute__((deprecated))."
11045 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11049 *) val="$d_attribute_deprecated" ;;
11051 set d_attribute_deprecated
11055 : Look for GCC-style attribute warn_unused_result
11056 case "$d_attribute_warn_unused_result" in
11059 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
11060 $cat >attrib.c <<'EOCP'
11062 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
11064 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11065 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11066 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
11069 echo "Your C compiler supports __attribute__((warn_unused_result))."
11073 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11077 *) val="$d_attribute_warn_unused_result" ;;
11079 set d_attribute_warn_unused_result
11083 : see if bcmp exists
11087 : see if bcopy exists
11091 : see if getpgrp exists
11092 set getpgrp d_getpgrp
11095 case "$d_getpgrp" in
11098 echo "Checking to see which flavor of getpgrp is in use..."
11100 #$i_unistd I_UNISTD
11101 #include <sys/types.h>
11103 # include <unistd.h>
11105 #$i_stdlib I_STDLIB
11107 #include <stdlib.h>
11111 if (getuid() == 0) {
11112 printf("(I see you are running Configure as super-user...)\n");
11115 #ifdef TRY_BSD_PGRP
11116 if (getpgrp(1) == 0)
11125 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11126 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
11128 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11129 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
11132 echo "I can't seem to compile and run the test program."
11134 xxx="a USG one, i.e. you use getpgrp()."
11136 # SVR4 systems can appear rather BSD-ish.
11137 case "$i_unistd" in
11139 xxx="a BSD one, i.e. you use getpgrp(pid)."
11143 xxx="probably a USG one, i.e. you use getpgrp()."
11148 echo "Assuming your getpgrp is $xxx" >&4
11157 : see if setpgrp exists
11158 set setpgrp d_setpgrp
11161 case "$d_setpgrp" in
11164 echo "Checking to see which flavor of setpgrp is in use..."
11166 #$i_unistd I_UNISTD
11167 #include <sys/types.h>
11169 # include <unistd.h>
11171 #$i_stdlib I_STDLIB
11173 #include <stdlib.h>
11177 if (getuid() == 0) {
11178 printf("(I see you are running Configure as super-user...)\n");
11181 #ifdef TRY_BSD_PGRP
11182 if (-1 == setpgrp(1, 1))
11185 if (setpgrp() != -1)
11191 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11192 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
11194 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11195 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
11198 echo "(I can't seem to compile and run the test program.)"
11200 xxx="a USG one, i.e. you use setpgrp()."
11202 # SVR4 systems can appear rather BSD-ish.
11203 case "$i_unistd" in
11205 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
11209 xxx="probably a USG one, i.e. you use setpgrp()."
11214 echo "Assuming your setpgrp is $xxx" >&4
11223 : Look for GCC-style __builtin_choose_expr
11224 case "$d_builtin_choose_expr" in
11227 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
11228 $cat >try.c <<'EOCP'
11229 #include <assert.h>
11230 #include <stdlib.h>
11233 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
11236 assert( SYRINX(1) == 2112 );
11237 assert( SYRINX(1) != 5150 );
11238 assert( SYRINX(0) == 5150 );
11239 assert( SYRINX(0) != 2112 );
11240 puts( "All good!" );
11246 if eval $compile && $run ./try; then
11247 echo "Your C compiler supports __builtin_choose_expr."
11250 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
11254 *) val="$d_builtin_choose_expr" ;;
11257 set d_builtin_choose_expr
11261 : Look for GCC-style __builtin_expect
11262 case "$d_builtin_expect" in
11265 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
11266 $cat >try.c <<'EOCP'
11269 if ( __builtin_expect(n, 0) ) n = 1;
11270 /* Remember shell exit code truth is 0, C truth is non-zero */
11275 if eval $compile && $run ./try; then
11276 echo "Your C compiler supports __builtin_expect."
11279 echo "Your C compiler doesn't seem to understand __builtin_expect."
11283 *) val="$d_builtin_expect" ;;
11286 set d_builtin_expect
11290 : see if bzero exists
11294 : see if stdarg is available
11296 if $test `./findhdr stdarg.h`; then
11297 echo "<stdarg.h> found." >&4
11300 echo "<stdarg.h> NOT found." >&4
11304 : see if varargs is available
11306 if $test `./findhdr varargs.h`; then
11307 echo "<varargs.h> found." >&4
11309 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
11312 : set up the varargs testing programs
11313 $cat > varargs.c <<EOP
11315 #include <stdarg.h>
11318 #include <varargs.h>
11322 int f(char *p, ...)
11336 p = va_arg(ap, char *);
11342 $cat > varargs <<EOP
11344 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
11353 : now check which varargs header should be included
11359 if `./varargs I_STDARG`; then
11361 elif `./varargs I_VARARGS`; then
11366 if `./varargs I_VARARGS`; then
11374 echo "*** WHOA THERE!!! ***" >&4
11375 echo " Your C compiler \"$cc\" doesn't seem to support stdarg or varargs!" >&4
11376 case "$knowitall" in
11378 echo " I'm giving up; maybe you can try again with a different compiler?" >&4
11382 echo "I could not find the definition for va_dcl... You have problems..." >&4
11383 val="$undef"; set i_stdarg; eval $setvar
11384 val="$undef"; set i_varargs; eval $setvar
11389 case "$i_varhdr" in
11391 val="$define"; set i_stdarg; eval $setvar
11392 val="$undef"; set i_varargs; eval $setvar
11395 val="$undef"; set i_stdarg; eval $setvar
11396 val="$define"; set i_varargs; eval $setvar
11399 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
11403 : see if the Compiler supports C99 variadic macros
11404 case "$i_stdarg$i_stdlib" in
11406 echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
11409 #include <stdarg.h>
11411 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
11415 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
11421 if eval $compile && $run ./try 2>&1 >/dev/null; then
11422 case "`$run ./try`" in
11424 echo "You have C99 variadic macros." >&4
11425 d_c99_variadic_macros="$define"
11428 echo "You don't have functional C99 variadic macros." >&4
11429 d_c99_variadic_macros="$undef"
11433 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
11434 d_c99_variadic_macros="$undef"
11439 echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
11440 d_c99_variadic_macros="$undef"
11444 : see if signal is declared as pointer to function returning int or void
11446 xxx=`./findhdr signal.h`
11447 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
11448 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
11449 echo "You have int (*signal())() instead of void." >&4
11451 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
11452 echo "You have void (*signal())()." >&4
11454 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
11455 echo "You have int (*signal())() instead of void." >&4
11457 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
11458 echo "You have void (*signal())()." >&4
11461 case "$d_voidsig" in
11463 echo "I can't determine whether signal handler returns void or int..." >&4
11465 rp="What type does your signal handler return?"
11468 v*) val="$define";;
11472 echo "As you already told me, signal handler returns void." >&4
11475 *) echo "As you already told me, signal handler returns int." >&4
11482 case "$d_voidsig" in
11483 "$define") signal_t="void";;
11484 *) signal_t="int";;
11488 : check for ability to cast large floats to 32-bit ints.
11490 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
11491 if $test "$intsize" -ge 4; then
11498 #$i_stdlib I_STDLIB
11500 #include <stdlib.h>
11502 #include <sys/types.h>
11503 #include <signal.h>
11504 $signal_t blech(int s) { exit(3); }
11511 signal(SIGFPE, blech);
11513 /* Don't let compiler optimize the test away. Store the number
11514 in a writable string for gcc to pass to sscanf under HP-UX.
11516 sprintf(str, "2147483647");
11517 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
11521 /* x86 processors will probably give 0x8000 0000, which is a
11522 sign change. We don't want that. We want to mimic SPARC
11523 behavior here, which is to preserve the sign and give
11526 if (i32 != ($xxx) f)
11532 if eval $compile_ok; then
11536 echo "(I can't seem to compile the test program--assuming it can't)"
11541 echo "Yup, it can."
11544 echo "Nope, it can't."
11551 : check for ability to cast negative floats to unsigned
11553 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
11556 #$i_stdlib I_STDLIB
11558 #include <stdlib.h>
11560 #include <sys/types.h>
11561 #include <signal.h>
11562 $signal_t blech(int s) { exit(7); }
11563 $signal_t blech_in_list(int s) { exit(4); }
11564 unsigned long dummy_long(unsigned long p) { return p; }
11565 unsigned int dummy_int(unsigned int p) { return p; }
11566 unsigned short dummy_short(unsigned short p) { return p; }
11570 unsigned long along;
11572 unsigned short ashort;
11576 /* Frustrate gcc-2.7.2's optimizer which failed this test with
11577 a direct f = -123. assignment. gcc-2.8.0 reportedly
11578 optimized the whole file away
11580 /* Store the number in a writable string for gcc to pass to
11581 sscanf under HP-UX.
11583 sprintf(str, "-123");
11584 sscanf(str, "%lf", &f); /* f = -123.; */
11586 signal(SIGFPE, blech);
11587 along = (unsigned long)f;
11588 aint = (unsigned int)f;
11589 ashort = (unsigned short)f;
11590 if (along != (unsigned long)-123)
11592 if (aint != (unsigned int)-123)
11594 if (ashort != (unsigned short)-123)
11596 sprintf(str, "1073741824.");
11597 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
11600 along = (unsigned long)f;
11601 if (along != 0x80000000)
11605 along = (unsigned long)f;
11606 if (along != 0x7fffffff)
11610 along = (unsigned long)f;
11611 if (along != 0x80000001)
11615 signal(SIGFPE, blech_in_list);
11616 sprintf(str, "123.");
11617 sscanf(str, "%lf", &f); /* f = 123.; */
11618 along = dummy_long((unsigned long)f);
11619 aint = dummy_int((unsigned int)f);
11620 ashort = dummy_short((unsigned short)f);
11621 if (along != (unsigned long)123)
11623 if (aint != (unsigned int)123)
11625 if (ashort != (unsigned short)123)
11632 if eval $compile_ok; then
11636 echo "(I can't seem to compile the test program--assuming it can't)"
11639 case "$castflags" in
11641 echo "Yup, it can."
11644 echo "Nope, it can't."
11651 : see if vprintf exists
11653 if set vprintf val -f d_vprintf; eval $csym; $val; then
11654 echo 'vprintf() found.' >&4
11657 #$i_stdarg I_STDARG /* Only one of these can be defined by i_varhrd */
11658 #$i_varargs I_VARARGS
11660 #$i_stdlib I_STDLIB
11661 #$i_unistd I_UNISTD
11664 # include <stdarg.h>
11665 #else /* I_VARARGS */
11666 # include <varargs.h>
11670 # include <unistd.h>
11674 # include <stdlib.h>
11677 #include <stdio.h> /* vsprintf prototype */
11680 void xxx(int n, ...)
11685 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11687 int main() { xxx(1, "foo"); }
11689 #else /* I_VARARGS */
11697 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11699 int main() { xxx("foo"); }
11705 if eval $compile_ok; then
11706 if $run ./try; then
11707 echo "Your vsprintf() returns (int)." >&4
11710 echo "Your vsprintf() returns (char*)." >&4
11714 echo 'I am unable to compile the vsprintf() test program.' >&4
11715 # We shouldn't get here. If we do, assume the standard signature,
11716 # not the old BSD one.
11717 echo 'Guessing that vsprintf() returns (int).' >&4
11721 echo 'vprintf() NOT found.' >&4
11732 : see if chown exists
11736 : see if chroot exists
11737 set chroot d_chroot
11740 : see if chsize exists
11741 set chsize d_chsize
11744 : see if class exists
11748 : see if clearenv exists
11749 set clearenv d_clearenv
11752 : Define hasstruct macro for Configure internal use
11753 hasstruct='varname=$1; struct=$2; shift; shift;
11754 while $test $# -ge 2; do
11756 $define) echo "#include <$2>";;
11760 echo "int main () { struct $struct foo; }" >> try.c;
11762 if eval $compile; then
11771 : see whether socket exists
11775 $echo $n "Hmm... $c" >&4
11776 if set socket val -f d_socket; eval $csym; $val; then
11777 echo "Looks like you have Berkeley networking support." >&4
11779 if set setsockopt val -f; eval $csym; $val; then
11782 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
11783 d_oldsock="$define"
11786 if $contains socklib libc.list >/dev/null 2>&1; then
11787 echo "Looks like you have Berkeley networking support." >&4
11789 : we will have to assume that it supports the 4.2 BSD interface
11792 echo "You don't have Berkeley networking in libc$_a..." >&4
11793 if test "X$d_socket" = "X$define"; then
11794 echo "...but you seem to believe that you have sockets." >&4
11796 for net in net socket
11798 if test -f $sysroot/usr/lib/lib$net$_a; then
11799 ( ($nm $nm_opt $sysroot/usr/lib/lib$net$_a | eval $nm_extract) || \
11800 $ar t $sysroot/usr/lib/lib$net$_a) 2>/dev/null >> libc.list
11801 if $contains socket libc.list >/dev/null 2>&1; then
11806 echo "...but the Wollongong group seems to have hacked it in." >&4
11807 sockethdr="-I$sysroot/usr/netinclude"
11810 echo "Found Berkeley sockets interface in lib$net." >&4
11811 if $contains setsockopt libc.list >/dev/null 2>&1; then
11814 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
11815 d_oldsock="$define"
11821 if test "X$d_socket" != "X$define"; then
11822 echo "or anywhere else I see." >&4
11830 : see if socketpair exists
11831 set socketpair d_sockpair
11836 echo "Checking the availability sa_len in the sock struct ..." >&4
11838 #include <sys/types.h>
11839 #include <sys/socket.h>
11841 struct sockaddr sa;
11842 return (sa.sa_len);
11846 set try; if eval $compile; then
11849 set d_sockaddr_sa_len; eval $setvar
11853 echo "Checking the availability struct sockaddr_in6 ..." >&4
11855 #include <sys/types.h>
11856 #include <sys/socket.h>
11857 #include <netinet/in.h>
11859 struct sockaddr_in6 sin6;
11860 return (sin6.sin6_family);
11864 set try; if eval $compile; then
11867 set d_sockaddr_in6; eval $setvar
11871 echo "Checking the availability sin6_scope_id in struct sockaddr_in6 ..." >&4
11873 #include <sys/types.h>
11874 #include <sys/socket.h>
11875 #include <netinet/in.h>
11877 struct sockaddr_in6 sin6;
11878 return (sin6.sin6_scope_id);
11882 set try; if eval $compile; then
11885 set d_sin6_scope_id; eval $setvar
11889 echo "Checking the availability struct ip_mreq ..." >&4
11891 #include <sys/types.h>
11892 #include <sys/socket.h>
11893 #include <netinet/in.h>
11895 struct ip_mreq mreq;
11896 return (mreq.imr_multiaddr.s_addr);
11900 set try; if eval $compile; then
11903 set d_ip_mreq; eval $setvar
11907 echo "Checking the availability struct ip_mreq_source ..." >&4
11909 #include <sys/types.h>
11910 #include <sys/socket.h>
11911 #include <netinet/in.h>
11913 struct ip_mreq_source mreq;
11914 return (mreq.imr_multiaddr.s_addr);
11918 set try; if eval $compile; then
11921 set d_ip_mreq_source; eval $setvar
11925 echo "Checking the availability struct ipv6_mreq ..." >&4
11927 #include <sys/types.h>
11928 #include <sys/socket.h>
11929 #include <netinet/in.h>
11931 struct ipv6_mreq mreq;
11932 return (mreq.ipv6mr_interface);
11936 set try; if eval $compile; then
11939 set d_ipv6_mreq; eval $setvar
11943 echo "Checking the availability struct ipv6_mreq_source ..." >&4
11945 #include <sys/types.h>
11946 #include <sys/socket.h>
11947 #include <netinet/in.h>
11949 struct ipv6_mreq_source mreq;
11950 return (mreq.imr_multiaddr.s_addr);
11954 set try; if eval $compile; then
11957 set d_ipv6_mreq_source; eval $setvar
11961 echo "Checking the availability of certain socket constants..." >&4
11962 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
11963 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
11965 #include <sys/types.h>
11966 #include <sys/socket.h>
11972 set try; if eval $compile; then
11975 set d_${enum}; eval $setvar
11979 : see if this is a sys/uio.h system
11980 set sys/uio.h i_sysuio
11983 : Check for cmsghdr support
11985 echo "Checking to see if your system supports struct cmsghdr..." >&4
11986 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
11988 case "$d_cmsghdr_s" in
11989 "$define") echo "Yes, it does." ;;
11990 *) echo "No, it doesn't." ;;
11994 : check for const keyword
11996 echo 'Checking to see if your C compiler knows about "const"...' >&4
11997 $cat >const.c <<'EOCP'
11998 typedef struct spug { int drokk; } spug;
12002 const spug y = { 0 };
12005 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
12007 echo "Yup, it does."
12010 echo "Nope, it doesn't."
12015 : see if copysignl exists
12016 set copysignl d_copysignl
12019 : see if crypt exists
12024 $define) cryptlib='' ;;
12025 *) if set crypt val -f d_crypt; eval $csym; $val; then
12026 echo 'crypt() found.' >&4
12030 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
12031 if $test -z "$cryptlib"; then
12032 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
12036 if $test -z "$cryptlib"; then
12037 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
12041 if $test -z "$cryptlib"; then
12042 cryptlib=`./loc libcrypt$_a "" $libpth`
12046 if $test -z "$cryptlib"; then
12047 echo 'crypt() NOT found.' >&4
12058 : see if this is a crypt.h system
12059 set crypt.h i_crypt
12062 : see if crypt_r exists
12063 set crypt_r d_crypt_r
12065 case "$d_crypt_r" in
12067 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
12068 case "$d_crypt_r_proto:$usethreads" in
12069 ":define") d_crypt_r_proto=define
12070 set d_crypt_r_proto crypt_r $hdrs
12074 case "$d_crypt_r_proto" in
12076 case "$crypt_r_proto" in
12077 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
12078 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCS ;;
12080 case "$crypt_r_proto" in
12081 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
12082 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCD ;;
12084 case "$crypt_r_proto" in
12085 ''|0) d_crypt_r=undef
12087 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
12088 * ) case "$crypt_r_proto" in
12089 REENTRANT_PROTO*) ;;
12090 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
12092 echo "Prototype: $try" ;;
12095 *) case "$usethreads" in
12096 define) echo "crypt_r has no prototype, not using it." >&4 ;;
12107 : get csh whereabouts
12109 'csh') val="$undef" ;;
12110 *) val="$define" ;;
12114 : Respect a hint or command line value for full_csh.
12115 case "$full_csh" in
12116 '') full_csh=$csh ;;
12119 : see if ctermid exists
12120 set ctermid d_ctermid
12123 : see if ctermid_r exists
12124 set ctermid_r d_ctermid_r
12126 case "$d_ctermid_r" in
12128 hdrs="$i_systypes sys/types.h define stdio.h "
12129 case "$d_ctermid_r_proto:$usethreads" in
12130 ":define") d_ctermid_r_proto=define
12131 set d_ctermid_r_proto ctermid_r $hdrs
12135 case "$d_ctermid_r_proto" in
12137 case "$ctermid_r_proto" in
12138 ''|0) try='char* ctermid_r(char*);'
12139 ./protochk "$extern_C $try" $hdrs && ctermid_r_proto=B_B ;;
12141 case "$ctermid_r_proto" in
12142 ''|0) d_ctermid_r=undef
12144 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
12145 * ) case "$ctermid_r_proto" in
12146 REENTRANT_PROTO*) ;;
12147 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
12149 echo "Prototype: $try" ;;
12152 *) case "$usethreads" in
12153 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
12160 *) ctermid_r_proto=0
12164 : see if ctime_r exists
12165 set ctime_r d_ctime_r
12167 case "$d_ctime_r" in
12169 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
12170 case "$d_ctime_r_proto:$usethreads" in
12171 ":define") d_ctime_r_proto=define
12172 set d_ctime_r_proto ctime_r $hdrs
12176 case "$d_ctime_r_proto" in
12178 case "$ctime_r_proto" in
12179 ''|0) try='char* ctime_r(const time_t*, char*);'
12180 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SB ;;
12182 case "$ctime_r_proto" in
12183 ''|0) try='char* ctime_r(const time_t*, char*, int);'
12184 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SBI ;;
12186 case "$ctime_r_proto" in
12187 ''|0) try='int ctime_r(const time_t*, char*);'
12188 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SB ;;
12190 case "$ctime_r_proto" in
12191 ''|0) try='int ctime_r(const time_t*, char*, int);'
12192 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SBI ;;
12194 case "$ctime_r_proto" in
12195 ''|0) d_ctime_r=undef
12197 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
12198 * ) case "$ctime_r_proto" in
12199 REENTRANT_PROTO*) ;;
12200 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
12202 echo "Prototype: $try" ;;
12205 *) case "$usethreads" in
12206 define) echo "ctime_r has no prototype, not using it." >&4 ;;
12217 : see if cuserid exists
12218 set cuserid d_cuserid
12221 : see if this is a limits.h system
12222 set limits.h i_limits
12225 : See if number of significant digits in a double precision number is known
12227 $cat >dbl_dig.c <<EOM
12228 #$i_limits I_LIMITS
12231 #include <limits.h>
12237 printf("Contains DBL_DIG");
12240 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
12241 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
12242 echo "DBL_DIG found." >&4
12245 echo "DBL_DIG NOT found." >&4
12252 : see if dbm.h is available
12253 : see if dbmclose exists
12254 set dbmclose d_dbmclose
12257 case "$d_dbmclose" in
12267 *) set rpcsvc/dbm.h i_rpcsvcdbm
12272 *) echo "We won't be including <dbm.h>"
12282 : see if prototype for dbminit is available
12284 set d_dbminitproto dbminit $i_dbm dbm.h
12287 : see if difftime exists
12288 set difftime d_difftime
12291 : see if this is a dirent system
12293 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
12295 echo "<dirent.h> found." >&4
12298 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
12299 echo "<sys/dir.h> found." >&4
12302 xinc=`./findhdr sys/ndir.h`
12304 echo "<dirent.h> NOT found." >&4
12309 : Look for type of directory structure.
12311 $cppstdin $cppflags $cppminus < "$xinc" > try.c
12313 case "$direntrytype" in
12315 case "$i_dirent" in
12316 $define) guess1='struct dirent' ;;
12317 *) guess1='struct direct' ;;
12320 *) guess1="$direntrytype"
12325 'struct dirent') guess2='struct direct' ;;
12326 *) guess2='struct dirent' ;;
12329 if $contains "$guess1" try.c >/dev/null 2>&1; then
12330 direntrytype="$guess1"
12331 echo "Your directory entries are $direntrytype." >&4
12332 elif $contains "$guess2" try.c >/dev/null 2>&1; then
12333 direntrytype="$guess2"
12334 echo "Your directory entries seem to be $direntrytype." >&4
12336 echo "I don't recognize your system's directory entries." >&4
12337 rp="What type is used for directory entries on this system?"
12340 direntrytype="$ans"
12344 : see if the directory entry stores field length
12346 $cppstdin $cppflags $cppminus < "$xinc" > try.c
12347 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
12348 echo "Good, your directory entry keeps length information in d_namlen." >&4
12351 echo "Your directory entry does not know about the d_namlen field." >&4
12358 : Look for DIR.dd_fd
12359 case "$i_dirent" in
12361 echo "Checking to see if DIR has a dd_fd member variable" >&4
12363 #$i_stdlib I_STDLIB
12365 #include <stdlib.h>
12367 #include <dirent.h>
12377 if eval $compile; then
12378 echo "Yes, it does."
12381 echo "No, it does not."
12386 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
12394 : see if this is an sysdir system
12395 set sys/dir.h i_sysdir
12398 : see if this is an sysndir system
12399 set sys/ndir.h i_sysndir
12404 $cat >dirfd.c <<EOM
12406 #$i_stdlib I_STDLIB
12408 #include <stdlib.h>
12410 #$i_dirent I_DIRENT /**/
12411 #$i_sysdir I_SYS_DIR /**/
12412 #$i_sysndir I_SYS_NDIR /**/
12413 #$i_systypes I_SYS_TYPES /**/
12414 #if defined(I_SYS_TYPES)
12415 #include <sys/types.h>
12417 #if defined(I_DIRENT)
12418 #include <dirent.h>
12421 #include <sys/ndir.h>
12425 #include <ndir.h> /* may be wrong in the future */
12427 #include <sys/dir.h>
12433 DIR *dirp = opendir(".");
12434 if (dirfd(dirp) >= 0)
12442 if eval $compile; then
12446 $define) echo "dirfd() found." >&4 ;;
12447 *) echo "dirfd() NOT found." >&4 ;;
12453 : see if dladdr exists
12454 set dladdr d_dladdr
12457 : see if dlerror exists
12460 set dlerror d_dlerror
12464 : see if dlfcn is available
12465 set dlfcn.h i_dlfcn
12468 : Check what extension to use for shared libs
12473 On a few systems, the dynamically loaded modules that perl generates and uses
12474 will need a different extension than shared libs. The default will probably
12480 *) dflt="$dlext" ;;
12482 rp='What is the extension of dynamically loaded modules'
12491 : Check if dlsym need a leading underscore
12497 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
12498 $cat >dyna.c <<'EOM'
12505 #$i_stdlib I_STDLIB
12507 #include <stdlib.h>
12511 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
12513 #include <sys/types.h>
12518 extern int fred() ;
12527 int mode = RTLD_LAZY ;
12529 handle = dlopen("./dyna.$dlext", mode) ;
12530 if (handle == NULL) {
12535 symbol = dlsym(handle, "fred") ;
12536 if (symbol == NULL) {
12537 /* try putting a leading underscore */
12538 symbol = dlsym(handle, "_fred") ;
12539 if (symbol == NULL) {
12552 : Call the object file tmp-dyna.o in case dlext=o.
12553 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
12554 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
12555 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
12556 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
12559 1) echo "Test program failed using dlopen." >&4
12560 echo "Perhaps you should not use dynamic loading." >&4;;
12561 2) echo "Test program failed using dlsym." >&4
12562 echo "Perhaps you should not use dynamic loading." >&4;;
12563 3) echo "dlsym needs a leading underscore" >&4
12565 4) echo "dlsym doesn't need a leading underscore." >&4;;
12568 echo "I can't compile and run the test program." >&4
12569 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
12574 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
12579 : see if drand48_r exists
12580 set drand48_r d_drand48_r
12582 case "$d_drand48_r" in
12584 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
12585 case "$d_drand48_r_proto:$usethreads" in
12586 ":define") d_drand48_r_proto=define
12587 set d_drand48_r_proto drand48_r $hdrs
12591 case "$d_drand48_r_proto" in
12593 case "$drand48_r_proto" in
12594 ''|0) try='int drand48_r(struct drand48_data*, double*);'
12595 ./protochk "$extern_C $try" $hdrs && drand48_r_proto=I_ST ;;
12597 case "$drand48_r_proto" in
12598 ''|0) d_drand48_r=undef
12600 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
12601 * ) case "$drand48_r_proto" in
12602 REENTRANT_PROTO*) ;;
12603 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
12605 echo "Prototype: $try" ;;
12608 *) case "$usethreads" in
12609 define) echo "drand48_r has no prototype, not using it." >&4 ;;
12616 *) drand48_r_proto=0
12620 : see if prototype for drand48 is available
12622 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
12625 : see if dup2 exists
12629 : see if eaccess exists
12630 set eaccess d_eaccess
12633 : see if endgrent exists
12634 set endgrent d_endgrent
12637 : see if this is an grp system
12643 xxx=`./findhdr grp.h`
12644 $cppstdin $cppflags $cppminus < $xxx >$$.h
12646 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
12658 set d_grpasswd; eval $setvar
12662 : see if endgrent_r exists
12663 set endgrent_r d_endgrent_r
12665 case "$d_endgrent_r" in
12667 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12668 case "$d_endgrent_r_proto:$usethreads" in
12669 ":define") d_endgrent_r_proto=define
12670 set d_endgrent_r_proto endgrent_r $hdrs
12674 case "$d_endgrent_r_proto" in
12676 case "$endgrent_r_proto" in
12677 ''|0) try='int endgrent_r(FILE**);'
12678 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=I_H ;;
12680 case "$endgrent_r_proto" in
12681 ''|0) try='void endgrent_r(FILE**);'
12682 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=V_H ;;
12684 case "$endgrent_r_proto" in
12685 ''|0) d_endgrent_r=undef
12687 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
12688 * ) case "$endgrent_r_proto" in
12689 REENTRANT_PROTO*) ;;
12690 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
12692 echo "Prototype: $try" ;;
12695 *) case "$usethreads" in
12696 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
12703 *) endgrent_r_proto=0
12707 : see if endhostent exists
12708 set endhostent d_endhent
12711 : see if this is a netdb.h system
12712 set netdb.h i_netdb
12715 : see if endhostent_r exists
12716 set endhostent_r d_endhostent_r
12718 case "$d_endhostent_r" in
12720 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12721 case "$d_endhostent_r_proto:$usethreads" in
12722 ":define") d_endhostent_r_proto=define
12723 set d_endhostent_r_proto endhostent_r $hdrs
12727 case "$d_endhostent_r_proto" in
12729 case "$endhostent_r_proto" in
12730 ''|0) try='int endhostent_r(struct hostent_data*);'
12731 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=I_D ;;
12733 case "$endhostent_r_proto" in
12734 ''|0) try='void endhostent_r(struct hostent_data*);'
12735 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=V_D ;;
12737 case "$endhostent_r_proto" in
12738 ''|0) d_endhostent_r=undef
12739 endhostent_r_proto=0
12740 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
12741 * ) case "$endhostent_r_proto" in
12742 REENTRANT_PROTO*) ;;
12743 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
12745 echo "Prototype: $try" ;;
12748 *) case "$usethreads" in
12749 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
12751 d_endhostent_r=undef
12752 endhostent_r_proto=0
12756 *) endhostent_r_proto=0
12760 : see if endnetent exists
12761 set endnetent d_endnent
12764 : see if endnetent_r exists
12765 set endnetent_r d_endnetent_r
12767 case "$d_endnetent_r" in
12769 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12770 case "$d_endnetent_r_proto:$usethreads" in
12771 ":define") d_endnetent_r_proto=define
12772 set d_endnetent_r_proto endnetent_r $hdrs
12776 case "$d_endnetent_r_proto" in
12778 case "$endnetent_r_proto" in
12779 ''|0) try='int endnetent_r(struct netent_data*);'
12780 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=I_D ;;
12782 case "$endnetent_r_proto" in
12783 ''|0) try='void endnetent_r(struct netent_data*);'
12784 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=V_D ;;
12786 case "$endnetent_r_proto" in
12787 ''|0) d_endnetent_r=undef
12788 endnetent_r_proto=0
12789 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
12790 * ) case "$endnetent_r_proto" in
12791 REENTRANT_PROTO*) ;;
12792 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
12794 echo "Prototype: $try" ;;
12797 *) case "$usethreads" in
12798 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
12800 d_endnetent_r=undef
12801 endnetent_r_proto=0
12805 *) endnetent_r_proto=0
12809 : see if endprotoent exists
12810 set endprotoent d_endpent
12813 : see if endprotoent_r exists
12814 set endprotoent_r d_endprotoent_r
12816 case "$d_endprotoent_r" in
12818 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12819 case "$d_endprotoent_r_proto:$usethreads" in
12820 ":define") d_endprotoent_r_proto=define
12821 set d_endprotoent_r_proto endprotoent_r $hdrs
12825 case "$d_endprotoent_r_proto" in
12827 case "$endprotoent_r_proto" in
12828 ''|0) try='int endprotoent_r(struct protoent_data*);'
12829 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=I_D ;;
12831 case "$endprotoent_r_proto" in
12832 ''|0) try='void endprotoent_r(struct protoent_data*);'
12833 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=V_D ;;
12835 case "$endprotoent_r_proto" in
12836 ''|0) d_endprotoent_r=undef
12837 endprotoent_r_proto=0
12838 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
12839 * ) case "$endprotoent_r_proto" in
12840 REENTRANT_PROTO*) ;;
12841 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
12843 echo "Prototype: $try" ;;
12846 *) case "$usethreads" in
12847 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
12849 d_endprotoent_r=undef
12850 endprotoent_r_proto=0
12854 *) endprotoent_r_proto=0
12858 : see if endpwent exists
12859 set endpwent d_endpwent
12862 : see if this is a pwd.h system
12868 xxx=`./findhdr pwd.h`
12869 $cppstdin $cppflags $cppminus < $xxx >$$.h
12871 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
12879 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
12887 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
12895 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
12903 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
12911 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
12919 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
12927 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
12939 set d_pwquota; eval $setvar
12940 set d_pwage; eval $setvar
12941 set d_pwchange; eval $setvar
12942 set d_pwclass; eval $setvar
12943 set d_pwexpire; eval $setvar
12944 set d_pwcomment; eval $setvar
12945 set d_pwgecos; eval $setvar
12946 set d_pwpasswd; eval $setvar
12950 : see if endpwent_r exists
12951 set endpwent_r d_endpwent_r
12953 case "$d_endpwent_r" in
12955 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
12956 case "$d_endpwent_r_proto:$usethreads" in
12957 ":define") d_endpwent_r_proto=define
12958 set d_endpwent_r_proto endpwent_r $hdrs
12962 case "$d_endpwent_r_proto" in
12964 case "$endpwent_r_proto" in
12965 ''|0) try='int endpwent_r(FILE**);'
12966 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=I_H ;;
12968 case "$endpwent_r_proto" in
12969 ''|0) try='void endpwent_r(FILE**);'
12970 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=V_H ;;
12972 case "$endpwent_r_proto" in
12973 ''|0) d_endpwent_r=undef
12975 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
12976 * ) case "$endpwent_r_proto" in
12977 REENTRANT_PROTO*) ;;
12978 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
12980 echo "Prototype: $try" ;;
12983 *) case "$usethreads" in
12984 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
12991 *) endpwent_r_proto=0
12995 : see if endservent exists
12996 set endservent d_endsent
12999 : see if endservent_r exists
13000 set endservent_r d_endservent_r
13002 case "$d_endservent_r" in
13004 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13005 case "$d_endservent_r_proto:$usethreads" in
13006 ":define") d_endservent_r_proto=define
13007 set d_endservent_r_proto endservent_r $hdrs
13011 case "$d_endservent_r_proto" in
13013 case "$endservent_r_proto" in
13014 ''|0) try='int endservent_r(struct servent_data*);'
13015 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=I_D ;;
13017 case "$endservent_r_proto" in
13018 ''|0) try='void endservent_r(struct servent_data*);'
13019 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=V_D ;;
13021 case "$endservent_r_proto" in
13022 ''|0) d_endservent_r=undef
13023 endservent_r_proto=0
13024 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
13025 * ) case "$endservent_r_proto" in
13026 REENTRANT_PROTO*) ;;
13027 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
13029 echo "Prototype: $try" ;;
13032 *) case "$usethreads" in
13033 define) echo "endservent_r has no prototype, not using it." >&4 ;;
13035 d_endservent_r=undef
13036 endservent_r_proto=0
13040 *) endservent_r_proto=0
13044 : Locate the flags for 'open()'
13047 #include <sys/types.h>
13052 #include <sys/file.h>
13054 #$i_stdlib I_STDLIB
13056 #include <stdlib.h>
13067 : check sys/file.h first to get FREAD on Sun
13068 if $test `./findhdr sys/file.h` && \
13069 set try -DI_SYS_FILE && eval $compile; then
13071 echo "<sys/file.h> defines the O_* constants..." >&4
13072 if $run ./try; then
13073 echo "and you have the 3 argument form of open()." >&4
13076 echo "but not the 3 argument form of open(). Oh, well." >&4
13079 elif $test `./findhdr fcntl.h` && \
13080 set try -DI_FCNTL && eval $compile; then
13082 echo "<fcntl.h> defines the O_* constants..." >&4
13083 if $run ./try; then
13084 echo "and you have the 3 argument form of open()." >&4
13087 echo "but not the 3 argument form of open(). Oh, well." >&4
13092 echo "I can't find the O_* constant definitions! You got problems." >&4
13098 : see if this is a sys/file.h system
13103 : do we need to include sys/file.h ?
13107 if $h_sysfile; then
13109 echo "We'll be including <sys/file.h>." >&4
13112 echo "We won't be including <sys/file.h>." >&4
13122 : see if fcntl.h is there
13127 : see if we can include fcntl.h
13133 echo "We'll be including <fcntl.h>." >&4
13136 if $h_sysfile; then
13137 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
13139 echo "We won't be including <fcntl.h>." >&4
13151 : see if fork exists
13155 : see if pipe exists
13159 : check for non-blocking I/O stuff
13160 case "$h_sysfile" in
13161 true) echo "#include <sys/file.h>" > head.c;;
13164 true) echo "#include <fcntl.h>" > head.c;;
13165 *) echo "#include <sys/fcntl.h>" > head.c;;
13170 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
13171 case "$o_nonblock" in
13173 $cat head.c > try.c
13174 $cat >>try.c <<EOCP
13176 #$i_stdlib I_STDLIB
13178 #include <stdlib.h>
13186 printf("O_NONBLOCK\n");
13190 printf("O_NDELAY\n");
13194 printf("FNDELAY\n");
13201 if eval $compile_ok; then
13202 o_nonblock=`$run ./try`
13203 case "$o_nonblock" in
13204 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
13205 *) echo "Seems like we can use $o_nonblock.";;
13208 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
13211 *) echo "Using $hint value $o_nonblock.";;
13216 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
13219 case "$d_fork:$d_pipe" in
13221 $cat head.c > try.c
13222 $cat >>try.c <<EOCP
13224 #include <sys/types.h>
13225 #include <signal.h>
13227 #$i_stdlib I_STDLIB
13229 #include <stdlib.h>
13235 #define MY_O_NONBLOCK $o_nonblock
13236 #ifndef errno /* XXX need better Configure test */
13239 #$i_unistd I_UNISTD
13241 #include <unistd.h>
13243 #$i_string I_STRING
13245 #include <string.h>
13247 #include <strings.h>
13249 $signal_t blech(int x) { exit(3); }
13251 $cat >> try.c <<'EOCP'
13260 ret = pipe(pd); /* Down: child -> parent */
13263 ret = pipe(pu); /* Up: parent -> child */
13267 close(pd[1]); /* Parent reads from pd[0] */
13268 close(pu[0]); /* Parent writes (blocking) to pu[1] */
13270 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
13275 signal(SIGALRM, blech);
13277 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
13279 sprintf(string, "%d\n", ret);
13280 ret = write(2, string, strlen(string));
13281 if (ret != strlen(string))
13285 if (errno == EAGAIN) {
13286 printf("EAGAIN\n");
13291 if (errno == EWOULDBLOCK)
13292 printf("EWOULDBLOCK\n");
13295 ret = write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
13298 sleep(2); /* Give it time to close our pipe */
13300 ret = read(pd[0], buf, 1); /* Should read EOF */
13302 sprintf(string, "%d\n", ret);
13303 ret = write(4, string, strlen(string));
13304 if (ret != strlen(string))
13309 close(pd[0]); /* We write to pd[1] */
13310 close(pu[1]); /* We read from pu[0] */
13311 ret = read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
13314 close(pd[1]); /* Pipe pd is now fully closed! */
13315 exit(0); /* Bye bye, thank you for playing! */
13319 if eval $compile_ok; then
13320 echo "$startsh" >mtry
13321 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
13323 $run ./mtry >/dev/null 2>&1
13325 0) eagain=`$cat try.out`;;
13326 1) echo "Could not perform non-blocking setting!";;
13327 2) echo "I did a successful read() for something that was not there!";;
13328 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
13329 4) echo "Could not find F_SETFL!";;
13330 *) echo "Something terribly wrong happened during testing.";;
13332 rd_nodata=`$cat try.ret`
13333 echo "A read() system call with no data present returns $rd_nodata."
13334 case "$rd_nodata" in
13337 echo "(That's peculiar, fixing that to be -1.)"
13343 echo "Forcing errno EAGAIN on read() with no data available."
13347 echo "Your read() sets errno to $eagain when no data is available."
13350 status=`$cat try.err`
13352 0) echo "And it correctly returns 0 to signal EOF.";;
13353 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
13354 *) echo "However, your read() returns '$status' on EOF??";;
13357 if test "$status" = "$rd_nodata"; then
13358 echo "WARNING: you can't distinguish between EOF and no data!"
13362 echo "I can't compile the test program--assuming errno EAGAIN will do."
13366 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
13375 echo "Using $hint value $eagain."
13376 echo "Your read() returns $rd_nodata when no data is present."
13377 case "$d_eofnblk" in
13378 "$define") echo "And you can see EOF because read() returns 0.";;
13379 "$undef") echo "But you can't see EOF status from read() returned value.";;
13381 echo "(Assuming you can't see EOF status from read anyway.)"
13387 $rm_try head.c mtry
13389 : see if _ptr and _cnt from stdio act std
13392 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
13393 echo "(Looks like you have stdio.h from BSD.)"
13394 case "$stdio_ptr" in
13395 '') stdio_ptr='((fp)->_p)'
13398 *) ptr_lval=$d_stdio_ptr_lval;;
13400 case "$stdio_cnt" in
13401 '') stdio_cnt='((fp)->_r)'
13404 *) cnt_lval=$d_stdio_cnt_lval;;
13406 case "$stdio_base" in
13407 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
13409 case "$stdio_bufsiz" in
13410 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
13412 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
13413 echo "(Looks like you have stdio.h from Linux.)"
13414 case "$stdio_ptr" in
13415 '') stdio_ptr='((fp)->_IO_read_ptr)'
13418 *) ptr_lval=$d_stdio_ptr_lval;;
13420 case "$stdio_cnt" in
13421 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
13424 *) cnt_lval=$d_stdio_cnt_lval;;
13426 case "$stdio_base" in
13427 '') stdio_base='((fp)->_IO_read_base)';;
13429 case "$stdio_bufsiz" in
13430 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
13433 case "$stdio_ptr" in
13434 '') stdio_ptr='((fp)->_ptr)'
13437 *) ptr_lval=$d_stdio_ptr_lval;;
13439 case "$stdio_cnt" in
13440 '') stdio_cnt='((fp)->_cnt)'
13443 *) cnt_lval=$d_stdio_cnt_lval;;
13445 case "$stdio_base" in
13446 '') stdio_base='((fp)->_base)';;
13448 case "$stdio_bufsiz" in
13449 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
13453 : test whether _ptr and _cnt really work
13454 echo "Checking how std your stdio is..." >&4
13457 #$i_stdlib I_STDLIB
13459 #include <stdlib.h>
13461 #define FILE_ptr(fp) $stdio_ptr
13462 #define FILE_cnt(fp) $stdio_cnt
13464 FILE *fp = fopen("try.c", "r");
13467 18 <= FILE_cnt(fp) &&
13468 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13476 if eval $compile && $to try.c; then
13477 if $run ./try; then
13478 echo "Your stdio acts pretty std."
13481 echo "Your stdio isn't very std."
13484 echo "Your stdio doesn't appear very std."
13488 # glibc 2.2.90 and above apparently change stdio streams so Perl's
13489 # direct buffer manipulation no longer works. The Configure tests
13490 # should be changed to correctly detect this, but until then,
13491 # the following check should at least let perl compile and run.
13492 # (This quick fix should be updated before 5.8.1.)
13493 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
13494 # A. Dougherty, June 3, 2002.
13495 case "$d_gnulibc" in
13497 case "$gnulibc_version" in
13501 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
13510 : Can _ptr be used as an lvalue?
13511 case "$d_stdstdio$ptr_lval" in
13512 $define$define) val=$define ;;
13515 set d_stdio_ptr_lval
13518 : Can _cnt be used as an lvalue?
13519 case "$d_stdstdio$cnt_lval" in
13520 $define$define) val=$define ;;
13523 set d_stdio_cnt_lval
13527 : test whether setting _ptr sets _cnt as a side effect
13528 d_stdio_ptr_lval_sets_cnt="$undef"
13529 d_stdio_ptr_lval_nochange_cnt="$undef"
13530 case "$d_stdio_ptr_lval$d_stdstdio" in
13532 echo "Checking to see what happens if we set the stdio ptr..." >&4
13535 /* Can we scream? */
13536 /* Eat dust sed :-) */
13537 /* In the buffer space, no one can hear you scream. */
13538 #$i_stdlib I_STDLIB
13540 #include <stdlib.h>
13542 #define FILE_ptr(fp) $stdio_ptr
13543 #define FILE_cnt(fp) $stdio_cnt
13544 #include <sys/types.h>
13546 FILE *fp = fopen("try.c", "r");
13551 puts("Fail even to read");
13554 c = getc(fp); /* Read away the first # */
13556 puts("Fail even to read");
13560 18 <= FILE_cnt(fp) &&
13561 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13563 puts("Fail even to read");
13566 ptr = (char*) FILE_ptr(fp);
13567 cnt = (size_t)FILE_cnt(fp);
13569 FILE_ptr(fp) += 42;
13571 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
13572 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
13575 if (FILE_cnt(fp) <= 20) {
13576 printf ("Fail (<20 chars to test)");
13579 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
13580 puts("Fail compare");
13583 if (cnt == FILE_cnt(fp)) {
13584 puts("Pass_unchanged");
13587 if (FILE_cnt(fp) == (cnt - 42)) {
13588 puts("Pass_changed");
13591 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
13597 if eval $compile && $to try.c; then
13598 case `$run ./try` in
13600 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
13601 d_stdio_ptr_lval_sets_cnt="$define" ;;
13603 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
13604 d_stdio_ptr_lval_nochange_cnt="$define" ;;
13606 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
13608 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
13611 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
13617 : see if _base is also standard
13619 case "$d_stdstdio" in
13623 #$i_stdlib I_STDLIB
13625 #include <stdlib.h>
13627 #define FILE_base(fp) $stdio_base
13628 #define FILE_bufsiz(fp) $stdio_bufsiz
13630 FILE *fp = fopen("try.c", "r");
13633 19 <= FILE_bufsiz(fp) &&
13634 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
13641 if eval $compile && $to try.c; then
13642 if $run ./try; then
13643 echo "And its _base field acts std."
13646 echo "But its _base field isn't std."
13649 echo "However, it seems to be lacking the _base field."
13657 : see if fast_stdio exists
13659 case "$d_stdstdio:$d_stdio_ptr_lval" in
13661 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
13663 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
13674 : see if fchdir exists
13675 set fchdir d_fchdir
13678 : see if fchmod exists
13679 set fchmod d_fchmod
13682 : see if fchown exists
13683 set fchown d_fchown
13686 : see if this is an fcntl system
13690 : See if fcntl-based locking works.
13693 #$i_stdlib I_STDLIB
13695 #include <stdlib.h>
13697 #include <unistd.h>
13699 #include <signal.h>
13700 $signal_t blech(int x) { exit(3); }
13702 #if defined(F_SETLK) && defined(F_SETLKW)
13703 struct flock flock;
13705 fd = open("try.c", O_RDONLY);
13706 flock.l_type = F_RDLCK;
13707 flock.l_whence = SEEK_SET;
13708 flock.l_start = flock.l_len = 0;
13709 signal(SIGALRM, blech);
13711 retval = fcntl(fd, F_SETLK, &flock);
13713 (retval < 0 ? exit(2) : exit(0));
13719 echo "Checking if fcntl-based file locking works... "
13723 if eval $compile_ok; then
13724 if $run ./try; then
13725 echo "Yes, it seems to work."
13728 echo "Nope, it didn't work."
13733 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
13734 *** This is (almost) impossible.
13735 *** If your NFS lock daemons are not feeling well, something like
13736 *** this may happen, please investigate. Cannot continue, aborting.
13744 echo "I'm unable to compile the test program, so I'll assume not."
13749 echo "Nope, since you don't even have fcntl()."
13752 set d_fcntl_can_lock
13756 : check for fd_set items
13759 Checking to see how well your C compiler handles fd_set and friends ...
13762 #$i_stdlib I_STDLIB
13764 #include <stdlib.h>
13766 #$i_systime I_SYS_TIME
13767 #$i_sysselct I_SYS_SELECT
13768 #$d_socket HAS_SOCKET
13769 #include <sys/types.h>
13771 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
13774 #include <sys/time.h>
13776 #ifdef I_SYS_SELECT
13777 #include <sys/select.h>
13786 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
13794 if eval $compile; then
13795 d_fds_bits="$define"
13797 echo "Well, your system knows about the normal fd_set typedef..." >&4
13798 if $run ./try; then
13799 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
13800 d_fd_macros="$define"
13803 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
13805 d_fd_macros="$undef"
13809 Hmm, your compiler has some difficulty with fd_set. Checking further...
13812 if eval $compile; then
13813 d_fds_bits="$undef"
13815 echo "Well, your system has some sort of fd_set available..." >&4
13816 if $run ./try; then
13817 echo "and you have the normal fd_set macros." >&4
13818 d_fd_macros="$define"
13821 but not the normal fd_set macros! Gross! More work for me...
13823 d_fd_macros="$undef"
13826 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
13828 d_fds_bits="$undef"
13829 d_fd_macros="$undef"
13834 : see if fegetround exists
13835 set fegetround d_fegetround
13838 : see if fgetpos exists
13839 set fgetpos d_fgetpos
13842 : see if finite exists
13843 set finite d_finite
13846 : see if finitel exists
13847 set finitel d_finitel
13850 : see if flock exists
13854 : see if prototype for flock is available
13856 set d_flockproto flock $i_sysfile sys/file.h
13859 : see if fp_class exists
13860 set fp_class d_fp_class
13863 : see if this is a math.h system
13867 : check for fpclassify
13868 echo "Checking to see if you have fpclassify..." >&4
13874 int main() { return fpclassify(1.0) == FP_NORMAL ? 0 : 1; }
13877 if eval $compile; then
13879 echo "You have fpclassify."
13882 echo "You do not have fpclassify."
13888 : see if fp_classify exists
13889 set fp_classify d_fp_classify
13892 : see if fp_classl exists
13893 set fp_classl d_fp_classl
13896 : see if pathconf exists
13897 set pathconf d_pathconf
13900 : see if fpathconf exists
13901 set fpathconf d_fpathconf
13904 : see if fpclass exists
13905 set fpclass d_fpclass
13908 : see if fpclassl exists
13909 set fpclassl d_fpclassl
13912 : see if fpgetround exists
13913 set fpgetround d_fpgetround
13916 : check for fpos64_t
13918 echo "Checking to see if you have fpos64_t..." >&4
13921 int main() { fpos64_t x = 7; }
13924 if eval $compile; then
13926 echo "You have fpos64_t."
13929 echo "You do not have fpos64_t."
13930 case "$fpossize" in
13931 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
13938 : see if frexpl exists
13939 set frexpl d_frexpl
13942 : see if this is a sys/param system
13943 set sys/param.h i_sysparam
13946 : see if this is a sys/mount.h system
13947 set sys/mount.h i_sysmount
13950 : Check for fs_data_s
13952 echo "Checking to see if your system supports struct fs_data..." >&4
13953 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
13955 case "$d_fs_data_s" in
13956 "$define") echo "Yes, it does." ;;
13957 *) echo "No, it doesn't." ;;
13960 : see if fseeko exists
13961 set fseeko d_fseeko
13963 case "$longsize" in
13964 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
13967 : see if fsetpos exists
13968 set fsetpos d_fsetpos
13971 : see if fstatfs exists
13972 set fstatfs d_fstatfs
13975 : see if statvfs exists
13976 set statvfs d_statvfs
13979 : see if fstatvfs exists
13980 set fstatvfs d_fstatvfs
13984 : see if fsync exists
13988 : see if ftello exists
13989 set ftello d_ftello
13991 case "$longsize" in
13992 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
13995 : check for a working futimes
13998 echo "Checking if you have a working futimes()" >&4
14001 #include <sys/time.h>
14008 fd = open ("try.c", O_RDWR);
14009 if (-1 == fd) exit (1);
14010 rv = futimes (fd, NULL);
14011 exit (rv == -1 ? errno : 0);
14015 if eval $compile; then
14019 0) echo "Yes, you have" >&4
14020 d_futimes="$define"
14022 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
14026 echo "No, it does not (probably harmless)" >&4
14030 : see if ndbm.h is available
14033 : Compatibility location for RedHat 7.1
14034 set gdbm/ndbm.h i_gdbmndbm
14036 : Compatibility location for Debian 4.0
14037 set gdbm-ndbm.h i_gdbm_ndbm
14041 if $test "$i_ndbm" = "$define" -o "$i_gdbmndbm" = "$define" -o "$i_gdbm_ndbm" = "$define"; then
14042 : see if dbm_open exists
14043 set dbm_open d_dbm_open
14045 case "$d_dbm_open" in
14048 i_gdbmndbm="$undef"
14049 i_gdbm_ndbm="$undef"
14050 echo "We won't be including <ndbm.h>"
14060 ndbm_hdr_protochk='name=$1; hdr=$2;
14061 eval "ihdr=\$""i_$name";
14063 if $test "$ihdr" = "$define"; then
14064 $echo "Checking if your <$hdr> uses prototypes..." >&4;
14065 case "$d_cplusplus" in
14066 $define) ./protochk "$extern_C void dbm_close(DBM *);" literal "extern \"C\" {" $ihdr $hdr literal "}" && val="$define" ;;
14067 *) ./protochk "$extern_C void dbm_close(int, int);" $ihdr $hdr || val="$define" ;;
14070 $define) $echo "Your <$hdr> seems to have prototypes";;
14071 *) $echo "Your <$hdr> does not seem to have prototypes";;
14074 set "d_${name}_h_uses_prototypes";
14078 eval $ndbm_hdr_protochk
14079 set gdbmndbm gdbm/ndbm.h
14080 eval $ndbm_hdr_protochk
14081 set gdbm_ndbm gdbm-ndbm.h
14082 eval $ndbm_hdr_protochk
14084 : see if getaddrinfo exists
14085 set getaddrinfo d_getaddrinfo
14088 : see if getcwd exists
14089 set getcwd d_getcwd
14092 : see if getespwnam exists
14093 set getespwnam d_getespwnam
14096 : see if getfsstat exists
14097 set getfsstat d_getfsstat
14100 : see if getgrent exists
14101 set getgrent d_getgrent
14104 : see if getgrent_r exists
14105 set getgrent_r d_getgrent_r
14107 case "$d_getgrent_r" in
14109 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14110 case "$d_getgrent_r_proto:$usethreads" in
14111 ":define") d_getgrent_r_proto=define
14112 set d_getgrent_r_proto getgrent_r $hdrs
14116 case "$d_getgrent_r_proto" in
14118 case "$getgrent_r_proto" in
14119 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
14120 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBWR ;;
14122 case "$getgrent_r_proto" in
14123 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
14124 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIR ;;
14126 case "$getgrent_r_proto" in
14127 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
14128 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBW ;;
14130 case "$getgrent_r_proto" in
14131 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
14132 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBI ;;
14134 case "$getgrent_r_proto" in
14135 ''|0) try='int getgrent_r(struct group*, char*, int);'
14136 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBI ;;
14138 case "$getgrent_r_proto" in
14139 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
14140 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIH ;;
14142 case "$getgrent_r_proto" in
14143 ''|0) d_getgrent_r=undef
14145 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
14146 * ) case "$getgrent_r_proto" in
14147 REENTRANT_PROTO*) ;;
14148 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
14150 echo "Prototype: $try" ;;
14153 *) case "$usethreads" in
14154 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
14161 *) getgrent_r_proto=0
14165 : see if getgrgid_r exists
14166 set getgrgid_r d_getgrgid_r
14168 case "$d_getgrgid_r" in
14170 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14171 case "$d_getgrgid_r_proto:$usethreads" in
14172 ":define") d_getgrgid_r_proto=define
14173 set d_getgrgid_r_proto getgrgid_r $hdrs
14177 case "$d_getgrgid_r_proto" in
14179 case "$getgrgid_r_proto" in
14180 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
14181 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
14183 case "$getgrgid_r_proto" in
14184 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
14185 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
14187 case "$getgrgid_r_proto" in
14188 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
14189 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
14191 case "$getgrgid_r_proto" in
14192 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
14193 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
14195 case "$getgrgid_r_proto" in
14196 ''|0) d_getgrgid_r=undef
14198 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
14199 * ) case "$getgrgid_r_proto" in
14200 REENTRANT_PROTO*) ;;
14201 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
14203 echo "Prototype: $try" ;;
14206 *) case "$usethreads" in
14207 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
14214 *) getgrgid_r_proto=0
14218 : see if getgrnam_r exists
14219 set getgrnam_r d_getgrnam_r
14221 case "$d_getgrnam_r" in
14223 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14224 case "$d_getgrnam_r_proto:$usethreads" in
14225 ":define") d_getgrnam_r_proto=define
14226 set d_getgrnam_r_proto getgrnam_r $hdrs
14230 case "$d_getgrnam_r_proto" in
14232 case "$getgrnam_r_proto" in
14233 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
14234 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
14236 case "$getgrnam_r_proto" in
14237 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
14238 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
14240 case "$getgrnam_r_proto" in
14241 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
14242 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CBI ;;
14244 case "$getgrnam_r_proto" in
14245 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
14246 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
14248 case "$getgrnam_r_proto" in
14249 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
14250 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
14252 case "$getgrnam_r_proto" in
14253 ''|0) d_getgrnam_r=undef
14255 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
14256 * ) case "$getgrnam_r_proto" in
14257 REENTRANT_PROTO*) ;;
14258 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
14260 echo "Prototype: $try" ;;
14263 *) case "$usethreads" in
14264 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
14271 *) getgrnam_r_proto=0
14275 : see if gethostbyaddr exists
14276 set gethostbyaddr d_gethbyaddr
14279 : see if gethostbyname exists
14280 set gethostbyname d_gethbyname
14283 : see if gethostent exists
14284 set gethostent d_gethent
14287 : see how we will look up host name
14290 if set gethostname val -f d_gethname; eval $csym; $val; then
14291 echo 'gethostname() found.' >&4
14292 d_gethname="$define"
14295 if set uname val -f d_uname; eval $csym; $val; then
14298 uname() was found, but you're running xenix, and older versions of xenix
14299 have a broken uname(). If you don't really know whether your xenix is old
14300 enough to have a broken system call, use the default answer.
14305 "$define") dflt=n;;
14307 rp='Is your uname() broken?'
14310 n*) d_uname="$define"; call=uname;;
14313 echo 'uname() found.' >&4
14320 case "$d_gethname" in
14321 '') d_gethname="$undef";;
14324 '') d_uname="$undef";;
14326 case "$d_uname$d_gethname" in
14331 Every now and then someone has a $call() that lies about the hostname
14332 but can't be fixed for political or economic reasons. If you wish, I can
14333 pretend $call() isn't there and maybe compute hostname at run-time
14334 thanks to the '$phostname' command.
14337 rp="Shall I ignore $call() from now on?"
14340 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
14343 case "$phostname" in
14344 '') aphostname='';;
14345 *) case "$aphostname" in
14347 *) set X $phostname
14351 file=`./loc $file $file $pth`
14352 aphostname=`echo $file $*`
14357 case "$d_uname$d_gethname" in
14360 case "$phostname" in
14362 echo "There will be no way for $package to get your hostname." >&4;;
14364 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
14368 case "$d_phostname" in
14369 '') d_phostname="$undef";;
14372 : see if gethostbyaddr_r exists
14373 set gethostbyaddr_r d_gethostbyaddr_r
14375 case "$d_gethostbyaddr_r" in
14377 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14378 case "$d_gethostbyaddr_r_proto:$usethreads" in
14379 ":define") d_gethostbyaddr_r_proto=define
14380 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
14384 case "$d_gethostbyaddr_r_proto" in
14386 case "$gethostbyaddr_r_proto" in
14387 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
14388 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
14390 case "$gethostbyaddr_r_proto" in
14391 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
14392 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
14394 case "$gethostbyaddr_r_proto" in
14395 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
14396 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
14398 case "$gethostbyaddr_r_proto" in
14399 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
14400 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
14402 case "$gethostbyaddr_r_proto" in
14403 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
14404 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
14406 case "$gethostbyaddr_r_proto" in
14407 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
14408 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
14410 case "$gethostbyaddr_r_proto" in
14411 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
14412 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
14414 case "$gethostbyaddr_r_proto" in
14415 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
14416 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
14418 case "$gethostbyaddr_r_proto" in
14419 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
14420 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
14422 case "$gethostbyaddr_r_proto" in
14423 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
14424 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
14426 case "$gethostbyaddr_r_proto" in
14427 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
14428 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
14430 case "$gethostbyaddr_r_proto" in
14431 ''|0) d_gethostbyaddr_r=undef
14432 gethostbyaddr_r_proto=0
14433 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
14434 * ) case "$gethostbyaddr_r_proto" in
14435 REENTRANT_PROTO*) ;;
14436 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
14438 echo "Prototype: $try" ;;
14441 *) case "$usethreads" in
14442 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
14444 d_gethostbyaddr_r=undef
14445 gethostbyaddr_r_proto=0
14449 *) gethostbyaddr_r_proto=0
14453 : see if gethostbyname_r exists
14454 set gethostbyname_r d_gethostbyname_r
14456 case "$d_gethostbyname_r" in
14458 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14459 case "$d_gethostbyname_r_proto:$usethreads" in
14460 ":define") d_gethostbyname_r_proto=define
14461 set d_gethostbyname_r_proto gethostbyname_r $hdrs
14465 case "$d_gethostbyname_r_proto" in
14467 case "$gethostbyname_r_proto" in
14468 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
14469 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
14471 case "$gethostbyname_r_proto" in
14472 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
14473 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
14475 case "$gethostbyname_r_proto" in
14476 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
14477 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
14479 case "$gethostbyname_r_proto" in
14480 ''|0) d_gethostbyname_r=undef
14481 gethostbyname_r_proto=0
14482 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
14483 * ) case "$gethostbyname_r_proto" in
14484 REENTRANT_PROTO*) ;;
14485 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
14487 echo "Prototype: $try" ;;
14490 *) case "$usethreads" in
14491 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
14493 d_gethostbyname_r=undef
14494 gethostbyname_r_proto=0
14498 *) gethostbyname_r_proto=0
14502 : see if gethostent_r exists
14503 set gethostent_r d_gethostent_r
14505 case "$d_gethostent_r" in
14507 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14508 case "$d_gethostent_r_proto:$usethreads" in
14509 ":define") d_gethostent_r_proto=define
14510 set d_gethostent_r_proto gethostent_r $hdrs
14514 case "$d_gethostent_r_proto" in
14516 case "$gethostent_r_proto" in
14517 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
14518 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
14520 case "$gethostent_r_proto" in
14521 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
14522 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBIE ;;
14524 case "$gethostent_r_proto" in
14525 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
14526 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBIE ;;
14528 case "$gethostent_r_proto" in
14529 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
14530 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBI ;;
14532 case "$gethostent_r_proto" in
14533 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
14534 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBI ;;
14536 case "$gethostent_r_proto" in
14537 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
14538 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SD ;;
14540 case "$gethostent_r_proto" in
14541 ''|0) d_gethostent_r=undef
14542 gethostent_r_proto=0
14543 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
14544 * ) case "$gethostent_r_proto" in
14545 REENTRANT_PROTO*) ;;
14546 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
14548 echo "Prototype: $try" ;;
14551 *) case "$usethreads" in
14552 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
14554 d_gethostent_r=undef
14555 gethostent_r_proto=0
14559 *) gethostent_r_proto=0
14563 : see if prototypes for various gethostxxx netdb.h functions are available
14565 set d_gethostprotos gethostent $i_netdb netdb.h
14568 : see if getitimer exists
14569 set getitimer d_getitimer
14572 : see if getlogin exists
14573 set getlogin d_getlogin
14576 : see if getlogin_r exists
14577 set getlogin_r d_getlogin_r
14579 case "$d_getlogin_r" in
14581 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
14582 case "$d_getlogin_r_proto:$usethreads" in
14583 ":define") d_getlogin_r_proto=define
14584 set d_getlogin_r_proto getlogin_r $hdrs
14588 case "$d_getlogin_r_proto" in
14590 case "$getlogin_r_proto" in
14591 ''|0) try='int getlogin_r(char*, size_t);'
14592 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BW ;;
14594 case "$getlogin_r_proto" in
14595 ''|0) try='int getlogin_r(char*, int);'
14596 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BI ;;
14598 case "$getlogin_r_proto" in
14599 ''|0) try='char* getlogin_r(char*, size_t);'
14600 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BW ;;
14602 case "$getlogin_r_proto" in
14603 ''|0) try='char* getlogin_r(char*, int);'
14604 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BI ;;
14606 case "$getlogin_r_proto" in
14607 ''|0) d_getlogin_r=undef
14609 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
14610 * ) case "$getlogin_r_proto" in
14611 REENTRANT_PROTO*) ;;
14612 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
14614 echo "Prototype: $try" ;;
14617 *) case "$usethreads" in
14618 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
14625 *) getlogin_r_proto=0
14629 : see if getmnt exists
14630 set getmnt d_getmnt
14633 : see if getmntent exists
14634 set getmntent d_getmntent
14637 : see if getnameinfo exists
14638 set getnameinfo d_getnameinfo
14641 : see if getnetbyaddr exists
14642 set getnetbyaddr d_getnbyaddr
14645 : see if getnetbyname exists
14646 set getnetbyname d_getnbyname
14649 : see if getnetent exists
14650 set getnetent d_getnent
14653 : see if getnetbyaddr_r exists
14654 set getnetbyaddr_r d_getnetbyaddr_r
14656 case "$d_getnetbyaddr_r" in
14658 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14659 case "$d_getnetbyaddr_r_proto:$usethreads" in
14660 ":define") d_getnetbyaddr_r_proto=define
14661 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
14665 case "$d_getnetbyaddr_r_proto" in
14667 case "$getnetbyaddr_r_proto" in
14668 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
14669 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
14671 case "$getnetbyaddr_r_proto" in
14672 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
14673 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
14675 case "$getnetbyaddr_r_proto" in
14676 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
14677 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
14679 case "$getnetbyaddr_r_proto" in
14680 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
14681 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
14683 case "$getnetbyaddr_r_proto" in
14684 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
14685 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
14687 case "$getnetbyaddr_r_proto" in
14688 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
14689 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
14691 case "$getnetbyaddr_r_proto" in
14692 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
14693 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
14695 case "$getnetbyaddr_r_proto" in
14696 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
14697 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
14699 case "$getnetbyaddr_r_proto" in
14700 ''|0) d_getnetbyaddr_r=undef
14701 getnetbyaddr_r_proto=0
14702 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
14703 * ) case "$getnetbyaddr_r_proto" in
14704 REENTRANT_PROTO*) ;;
14705 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
14707 echo "Prototype: $try" ;;
14710 *) case "$usethreads" in
14711 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
14713 d_getnetbyaddr_r=undef
14714 getnetbyaddr_r_proto=0
14718 *) getnetbyaddr_r_proto=0
14722 : see if getnetbyname_r exists
14723 set getnetbyname_r d_getnetbyname_r
14725 case "$d_getnetbyname_r" in
14727 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14728 case "$d_getnetbyname_r_proto:$usethreads" in
14729 ":define") d_getnetbyname_r_proto=define
14730 set d_getnetbyname_r_proto getnetbyname_r $hdrs
14734 case "$d_getnetbyname_r_proto" in
14736 case "$getnetbyname_r_proto" in
14737 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
14738 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
14740 case "$getnetbyname_r_proto" in
14741 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
14742 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
14744 case "$getnetbyname_r_proto" in
14745 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
14746 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
14748 case "$getnetbyname_r_proto" in
14749 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
14750 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
14752 case "$getnetbyname_r_proto" in
14753 ''|0) d_getnetbyname_r=undef
14754 getnetbyname_r_proto=0
14755 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
14756 * ) case "$getnetbyname_r_proto" in
14757 REENTRANT_PROTO*) ;;
14758 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
14760 echo "Prototype: $try" ;;
14763 *) case "$usethreads" in
14764 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
14766 d_getnetbyname_r=undef
14767 getnetbyname_r_proto=0
14771 *) getnetbyname_r_proto=0
14775 : see if getnetent_r exists
14776 set getnetent_r d_getnetent_r
14778 case "$d_getnetent_r" in
14780 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14781 case "$d_getnetent_r_proto:$usethreads" in
14782 ":define") d_getnetent_r_proto=define
14783 set d_getnetent_r_proto getnetent_r $hdrs
14787 case "$d_getnetent_r_proto" in
14789 case "$getnetent_r_proto" in
14790 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
14791 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
14793 case "$getnetent_r_proto" in
14794 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
14795 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBIE ;;
14797 case "$getnetent_r_proto" in
14798 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
14799 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBIE ;;
14801 case "$getnetent_r_proto" in
14802 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
14803 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBI ;;
14805 case "$getnetent_r_proto" in
14806 ''|0) try='int getnetent_r(struct netent*, char*, int);'
14807 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBI ;;
14809 case "$getnetent_r_proto" in
14810 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
14811 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SD ;;
14813 case "$getnetent_r_proto" in
14814 ''|0) d_getnetent_r=undef
14815 getnetent_r_proto=0
14816 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
14817 * ) case "$getnetent_r_proto" in
14818 REENTRANT_PROTO*) ;;
14819 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
14821 echo "Prototype: $try" ;;
14824 *) case "$usethreads" in
14825 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
14827 d_getnetent_r=undef
14828 getnetent_r_proto=0
14832 *) getnetent_r_proto=0
14836 : see if prototypes for various getnetxxx netdb.h functions are available
14838 set d_getnetprotos getnetent $i_netdb netdb.h
14841 : see if getpagesize exists
14842 set getpagesize d_getpagsz
14845 : Optional checks for getprotobyname and getprotobynumber
14847 : see if getprotobyname exists
14848 set getprotobyname d_getpbyname
14851 : see if getprotobynumber exists
14852 set getprotobynumber d_getpbynumber
14855 : see if getprotoent exists
14856 set getprotoent d_getpent
14859 : see if getpgid exists
14860 set getpgid d_getpgid
14863 : see if getpgrp2 exists
14864 set getpgrp2 d_getpgrp2
14867 : see if getppid exists
14868 set getppid d_getppid
14871 : see if getpriority exists
14872 set getpriority d_getprior
14875 : see if getprotobyname_r exists
14876 set getprotobyname_r d_getprotobyname_r
14878 case "$d_getprotobyname_r" in
14880 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14881 case "$d_getprotobyname_r_proto:$usethreads" in
14882 ":define") d_getprotobyname_r_proto=define
14883 set d_getprotobyname_r_proto getprotobyname_r $hdrs
14887 case "$d_getprotobyname_r_proto" in
14889 case "$getprotobyname_r_proto" in
14890 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
14891 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
14893 case "$getprotobyname_r_proto" in
14894 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
14895 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
14897 case "$getprotobyname_r_proto" in
14898 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
14899 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
14901 case "$getprotobyname_r_proto" in
14902 ''|0) d_getprotobyname_r=undef
14903 getprotobyname_r_proto=0
14904 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
14905 * ) case "$getprotobyname_r_proto" in
14906 REENTRANT_PROTO*) ;;
14907 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
14909 echo "Prototype: $try" ;;
14912 *) case "$usethreads" in
14913 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
14915 d_getprotobyname_r=undef
14916 getprotobyname_r_proto=0
14920 *) getprotobyname_r_proto=0
14924 : see if getprotobynumber_r exists
14925 set getprotobynumber_r d_getprotobynumber_r
14927 case "$d_getprotobynumber_r" in
14929 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14930 case "$d_getprotobynumber_r_proto:$usethreads" in
14931 ":define") d_getprotobynumber_r_proto=define
14932 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
14936 case "$d_getprotobynumber_r_proto" in
14938 case "$getprotobynumber_r_proto" in
14939 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
14940 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
14942 case "$getprotobynumber_r_proto" in
14943 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
14944 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
14946 case "$getprotobynumber_r_proto" in
14947 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
14948 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
14950 case "$getprotobynumber_r_proto" in
14951 ''|0) d_getprotobynumber_r=undef
14952 getprotobynumber_r_proto=0
14953 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
14954 * ) case "$getprotobynumber_r_proto" in
14955 REENTRANT_PROTO*) ;;
14956 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
14958 echo "Prototype: $try" ;;
14961 *) case "$usethreads" in
14962 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
14964 d_getprotobynumber_r=undef
14965 getprotobynumber_r_proto=0
14969 *) getprotobynumber_r_proto=0
14973 : see if getprotoent_r exists
14974 set getprotoent_r d_getprotoent_r
14976 case "$d_getprotoent_r" in
14978 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14979 case "$d_getprotoent_r_proto:$usethreads" in
14980 ":define") d_getprotoent_r_proto=define
14981 set d_getprotoent_r_proto getprotoent_r $hdrs
14985 case "$d_getprotoent_r_proto" in
14987 case "$getprotoent_r_proto" in
14988 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
14989 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
14991 case "$getprotoent_r_proto" in
14992 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
14993 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBI ;;
14995 case "$getprotoent_r_proto" in
14996 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
14997 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=S_SBI ;;
14999 case "$getprotoent_r_proto" in
15000 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
15001 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SD ;;
15003 case "$getprotoent_r_proto" in
15004 ''|0) d_getprotoent_r=undef
15005 getprotoent_r_proto=0
15006 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
15007 * ) case "$getprotoent_r_proto" in
15008 REENTRANT_PROTO*) ;;
15009 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
15011 echo "Prototype: $try" ;;
15014 *) case "$usethreads" in
15015 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
15017 d_getprotoent_r=undef
15018 getprotoent_r_proto=0
15022 *) getprotoent_r_proto=0
15026 : see if prototypes for various getprotoxxx netdb.h functions are available
15028 set d_getprotoprotos getprotoent $i_netdb netdb.h
15031 : see if getprpwnam exists
15032 set getprpwnam d_getprpwnam
15035 : see if getpwent exists
15036 set getpwent d_getpwent
15039 : see if getpwent_r exists
15040 set getpwent_r d_getpwent_r
15042 case "$d_getpwent_r" in
15044 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15045 case "$d_getpwent_r_proto:$usethreads" in
15046 ":define") d_getpwent_r_proto=define
15047 set d_getpwent_r_proto getpwent_r $hdrs
15051 case "$d_getpwent_r_proto" in
15053 case "$getpwent_r_proto" in
15054 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
15055 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBWR ;;
15057 case "$getpwent_r_proto" in
15058 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
15059 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIR ;;
15061 case "$getpwent_r_proto" in
15062 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
15063 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBW ;;
15065 case "$getpwent_r_proto" in
15066 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
15067 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBI ;;
15069 case "$getpwent_r_proto" in
15070 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
15071 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBI ;;
15073 case "$getpwent_r_proto" in
15074 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
15075 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIH ;;
15077 case "$getpwent_r_proto" in
15078 ''|0) d_getpwent_r=undef
15080 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
15081 * ) case "$getpwent_r_proto" in
15082 REENTRANT_PROTO*) ;;
15083 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
15085 echo "Prototype: $try" ;;
15088 *) case "$usethreads" in
15089 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
15096 *) getpwent_r_proto=0
15100 : see if getpwnam_r exists
15101 set getpwnam_r d_getpwnam_r
15103 case "$d_getpwnam_r" in
15105 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15106 case "$d_getpwnam_r_proto:$usethreads" in
15107 ":define") d_getpwnam_r_proto=define
15108 set d_getpwnam_r_proto getpwnam_r $hdrs
15112 case "$d_getpwnam_r_proto" in
15114 case "$getpwnam_r_proto" in
15115 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
15116 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
15118 case "$getpwnam_r_proto" in
15119 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
15120 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
15122 case "$getpwnam_r_proto" in
15123 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
15124 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
15126 case "$getpwnam_r_proto" in
15127 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
15128 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
15130 case "$getpwnam_r_proto" in
15131 ''|0) d_getpwnam_r=undef
15133 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
15134 * ) case "$getpwnam_r_proto" in
15135 REENTRANT_PROTO*) ;;
15136 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
15138 echo "Prototype: $try" ;;
15141 *) case "$usethreads" in
15142 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
15149 *) getpwnam_r_proto=0
15153 : see if getpwuid_r exists
15154 set getpwuid_r d_getpwuid_r
15156 case "$d_getpwuid_r" in
15158 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15159 case "$d_getpwuid_r_proto:$usethreads" in
15160 ":define") d_getpwuid_r_proto=define
15161 set d_getpwuid_r_proto getpwuid_r $hdrs
15165 case "$d_getpwuid_r_proto" in
15167 case "$getpwuid_r_proto" in
15168 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
15169 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
15171 case "$getpwuid_r_proto" in
15172 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
15173 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
15175 case "$getpwuid_r_proto" in
15176 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
15177 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
15179 case "$getpwuid_r_proto" in
15180 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
15181 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
15183 case "$getpwuid_r_proto" in
15184 ''|0) d_getpwuid_r=undef
15186 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
15187 * ) case "$getpwuid_r_proto" in
15188 REENTRANT_PROTO*) ;;
15189 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
15191 echo "Prototype: $try" ;;
15194 *) case "$usethreads" in
15195 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
15202 *) getpwuid_r_proto=0
15206 : Optional checks for getsbyname and getsbyport
15208 : see if getservbyname exists
15209 set getservbyname d_getsbyname
15212 : see if getservbyport exists
15213 set getservbyport d_getsbyport
15216 : see if getservent exists
15217 set getservent d_getsent
15220 : see if getservbyname_r exists
15221 set getservbyname_r d_getservbyname_r
15223 case "$d_getservbyname_r" in
15225 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15226 case "$d_getservbyname_r_proto:$usethreads" in
15227 ":define") d_getservbyname_r_proto=define
15228 set d_getservbyname_r_proto getservbyname_r $hdrs
15232 case "$d_getservbyname_r_proto" in
15234 case "$getservbyname_r_proto" in
15235 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
15236 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
15238 case "$getservbyname_r_proto" in
15239 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
15240 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
15242 case "$getservbyname_r_proto" in
15243 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
15244 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
15246 case "$getservbyname_r_proto" in
15247 ''|0) d_getservbyname_r=undef
15248 getservbyname_r_proto=0
15249 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
15250 * ) case "$getservbyname_r_proto" in
15251 REENTRANT_PROTO*) ;;
15252 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
15254 echo "Prototype: $try" ;;
15257 *) case "$usethreads" in
15258 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
15260 d_getservbyname_r=undef
15261 getservbyname_r_proto=0
15265 *) getservbyname_r_proto=0
15269 : see if getservbyport_r exists
15270 set getservbyport_r d_getservbyport_r
15272 case "$d_getservbyport_r" in
15274 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15275 case "$d_getservbyport_r_proto:$usethreads" in
15276 ":define") d_getservbyport_r_proto=define
15277 set d_getservbyport_r_proto getservbyport_r $hdrs
15281 case "$d_getservbyport_r_proto" in
15283 case "$getservbyport_r_proto" in
15284 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
15285 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
15287 case "$getservbyport_r_proto" in
15288 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
15289 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
15291 case "$getservbyport_r_proto" in
15292 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
15293 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
15295 case "$getservbyport_r_proto" in
15296 ''|0) d_getservbyport_r=undef
15297 getservbyport_r_proto=0
15298 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
15299 * ) case "$getservbyport_r_proto" in
15300 REENTRANT_PROTO*) ;;
15301 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
15303 echo "Prototype: $try" ;;
15306 *) case "$usethreads" in
15307 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
15309 d_getservbyport_r=undef
15310 getservbyport_r_proto=0
15314 *) getservbyport_r_proto=0
15318 : see if getservent_r exists
15319 set getservent_r d_getservent_r
15321 case "$d_getservent_r" in
15323 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15324 case "$d_getservent_r_proto:$usethreads" in
15325 ":define") d_getservent_r_proto=define
15326 set d_getservent_r_proto getservent_r $hdrs
15330 case "$d_getservent_r_proto" in
15332 case "$getservent_r_proto" in
15333 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
15334 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBWR ;;
15336 case "$getservent_r_proto" in
15337 ''|0) try='int getservent_r(struct servent*, char*, int);'
15338 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBI ;;
15340 case "$getservent_r_proto" in
15341 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
15342 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=S_SBI ;;
15344 case "$getservent_r_proto" in
15345 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
15346 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SD ;;
15348 case "$getservent_r_proto" in
15349 ''|0) d_getservent_r=undef
15350 getservent_r_proto=0
15351 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
15352 * ) case "$getservent_r_proto" in
15353 REENTRANT_PROTO*) ;;
15354 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
15356 echo "Prototype: $try" ;;
15359 *) case "$usethreads" in
15360 define) echo "getservent_r has no prototype, not using it." >&4 ;;
15362 d_getservent_r=undef
15363 getservent_r_proto=0
15367 *) getservent_r_proto=0
15371 : see if prototypes for various getservxxx netdb.h functions are available
15373 set d_getservprotos getservent $i_netdb netdb.h
15376 : see if getspnam exists
15377 set getspnam d_getspnam
15380 : see if this is a shadow.h system
15381 set shadow.h i_shadow
15384 : see if getspnam_r exists
15385 set getspnam_r d_getspnam_r
15387 case "$d_getspnam_r" in
15389 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
15390 case "$d_getspnam_r_proto:$usethreads" in
15391 ":define") d_getspnam_r_proto=define
15392 set d_getspnam_r_proto getspnam_r $hdrs
15396 case "$d_getspnam_r_proto" in
15398 case "$getspnam_r_proto" in
15399 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
15400 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
15402 case "$getspnam_r_proto" in
15403 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
15404 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=S_CSBI ;;
15406 case "$getspnam_r_proto" in
15407 ''|0) d_getspnam_r=undef
15409 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
15410 * ) case "$getspnam_r_proto" in
15411 REENTRANT_PROTO*) ;;
15412 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
15414 echo "Prototype: $try" ;;
15417 *) case "$usethreads" in
15418 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
15425 *) getspnam_r_proto=0
15429 : see if gettimeofday or ftime exists
15430 set gettimeofday d_gettimeod
15432 case "$d_gettimeod" in
15438 val="$undef"; set d_ftime; eval $setvar
15441 case "$d_gettimeod$d_ftime" in
15444 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
15448 : see if gmtime_r exists
15449 set gmtime_r d_gmtime_r
15451 case "$d_gmtime_r" in
15453 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15454 case "$d_gmtime_r_proto:$usethreads" in
15455 ":define") d_gmtime_r_proto=define
15456 set d_gmtime_r_proto gmtime_r $hdrs
15460 case "$d_gmtime_r_proto" in
15462 case "$gmtime_r_proto" in
15463 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
15464 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=S_TS ;;
15466 case "$gmtime_r_proto" in
15467 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
15468 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=I_TS ;;
15470 case "$gmtime_r_proto" in
15471 ''|0) d_gmtime_r=undef
15473 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
15474 * ) case "$gmtime_r_proto" in
15475 REENTRANT_PROTO*) ;;
15476 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
15478 echo "Prototype: $try" ;;
15481 *) case "$usethreads" in
15482 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
15489 *) gmtime_r_proto=0
15493 : see if hasmntopt exists
15494 set hasmntopt d_hasmntopt
15497 : see if this is a netinet/in.h or sys/in.h system
15498 set netinet/in.h i_niin sys/in.h i_sysin
15501 : see if arpa/inet.h has to be included
15502 set arpa/inet.h i_arpainet
15505 : see if htonl --and friends-- exists
15510 : Maybe they are macros.
15513 $cat >htonl.c <<EOM
15515 #include <sys/types.h>
15516 #$i_niin I_NETINET_IN
15518 #$i_arpainet I_ARPA_INET
15519 #ifdef I_NETINET_IN
15520 #include <netinet/in.h>
15523 #include <sys/in.h>
15526 #include <arpa/inet.h>
15529 printf("Defined as a macro.");
15532 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
15533 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
15535 echo "But it seems to be defined as a macro." >&4
15543 : see if ilogbl exists
15544 set ilogbl d_ilogbl
15549 if set index val -f; eval $csym; $val; then
15550 if set strchr val -f d_strchr; eval $csym; $val; then
15551 if $contains strchr "$strings" >/dev/null 2>&1 ; then
15554 echo "strchr() found." >&4
15558 echo "index() found." >&4
15563 echo "index() found." >&4
15566 if set strchr val -f d_strchr; eval $csym; $val; then
15569 echo "strchr() found." >&4
15571 echo "No index() or strchr() found!" >&4
15576 set d_strchr; eval $setvar
15578 set d_index; eval $setvar
15580 : check whether inet_aton exists
15581 set inet_aton d_inetaton
15584 : see if inet_ntop exists
15585 set inet_ntop d_inetntop
15588 : see if inet_pton exists
15589 set inet_pton d_inetpton
15594 $cat >isascii.c <<EOCP
15597 #$i_stdlib I_STDLIB
15599 #include <stdlib.h>
15610 if eval $compile; then
15611 echo "isascii() found." >&4
15614 echo "isascii() NOT found." >&4
15623 $cat >isblank.c <<'EOCP'
15634 if $cc $ccflags $ldflags -o isblank isblank.c $libs >/dev/null 2>&1 ; then
15635 echo "isblank() found." >&4
15638 echo "isblank() NOT found." >&4
15645 : check for isfinite
15646 echo "Checking to see if you have isfinite..." >&4
15652 int main() { return isfinite(0.0); }
15655 if eval $compile; then
15657 echo "You have isfinite."
15660 echo "You do not have isfinite."
15666 : see if isfinitel exists
15667 set isfinitel d_isfinitel
15671 echo "Checking to see if you have isinf..." >&4
15677 int main() { return isinf(0.0); }
15680 if eval $compile; then
15682 echo "You have isinf."
15685 echo "You do not have isinf."
15691 : see if isinfl exists
15692 set isinfl d_isinfl
15696 echo "Checking to see if you have isnan..." >&4
15702 int main() { return isnan(0.0); }
15705 if eval $compile; then
15707 echo "You have isnan."
15710 echo "You do not have isnan."
15716 : see if isnanl exists
15717 set isnanl d_isnanl
15724 : see if j0l exists
15728 : see if killpg exists
15729 set killpg d_killpg
15732 : see if lchown exists
15734 $cat > try.c <<'EOCP'
15735 /* System header to define __stub macros and hopefully few prototypes,
15736 which can conflict with char lchown(); below. */
15737 #include <assert.h>
15738 /* Override any gcc2 internal prototype to avoid an error. */
15739 /* We use char because int might match the return type of a gcc2
15740 builtin and then its argument prototype would still apply. */
15743 /* The GNU C library defines this for functions which it implements
15744 to always fail with ENOSYS. Some functions are actually named
15745 something starting with __ and the normal name is an alias. */
15746 #if defined (__stub_lchown) || defined (__stub___lchown)
15754 if eval $compile; then
15755 $echo "lchown() found." >&4
15758 $echo "lchown() NOT found." >&4
15764 : See if number of significant digits in a double precision number is known
15766 $cat >ldbl_dig.c <<EOM
15767 #$i_limits I_LIMITS
15770 #include <limits.h>
15776 printf("Contains LDBL_DIG");
15779 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
15780 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
15781 echo "LDBL_DIG found." >&4
15784 echo "LDBL_DIG NOT found." >&4
15791 : check to see if math.h defines _LIB_VERSION
15792 d_libm_lib_version="$undef"
15796 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
15798 #include <unistd.h>
15800 int main (int argc, char *argv[])
15802 printf ("%d\n", _LIB_VERSION);
15807 if eval $compile; then
15809 echo "Yes, it does ($foo)" >&4
15810 d_libm_lib_version="$define"
15812 echo "No, it does not (probably harmless)" >&4
15819 : check for fpclassify
15821 echo "Checking to see if you have fpclassify..." >&4
15827 int main() { return fpclassify(1.0) == FP_NORMAL ? 0 : 1; }
15830 if eval $compile; then
15832 echo "You have fpclassify."
15835 echo "You do not have fpclassify."
15841 : check for isfinite
15843 echo "Checking to see if you have isfinite..." >&4
15849 int main() { return isfinite(0.0); }
15852 if eval $compile; then
15854 echo "You have isfinite."
15857 echo "You do not have isfinite."
15865 echo "Checking to see if you have isinf..." >&4
15871 int main() { return isinf(0.0); }
15874 if eval $compile; then
15876 echo "You have isinf."
15879 echo "You do not have isinf."
15887 echo "Checking to see if you have isnan..." >&4
15893 int main() { return isnan(0.0); }
15896 if eval $compile; then
15898 echo "You have isnan."
15901 echo "You do not have isnan."
15907 : see if this is a quadmath.h system
15908 set quadmath.h i_quadmath
15911 : see if link exists
15915 : see if localtime_r exists
15916 set localtime_r d_localtime_r
15918 case "$d_localtime_r" in
15920 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15921 case "$d_localtime_r_proto:$usethreads" in
15922 ":define") d_localtime_r_proto=define
15923 set d_localtime_r_proto localtime_r $hdrs
15927 case "$d_localtime_r_proto" in
15929 case "$localtime_r_proto" in
15930 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
15931 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=S_TS ;;
15933 case "$localtime_r_proto" in
15934 ''|0) try='int localtime_r(const time_t*, struct tm*);'
15935 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=I_TS ;;
15937 case "$localtime_r_proto" in
15938 ''|0) d_localtime_r=undef
15939 localtime_r_proto=0
15940 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
15941 * ) case "$localtime_r_proto" in
15942 REENTRANT_PROTO*) ;;
15943 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
15945 echo "Prototype: $try" ;;
15948 *) case "$usethreads" in
15949 define) echo "localtime_r has no prototype, not using it." >&4 ;;
15951 d_localtime_r=undef
15952 localtime_r_proto=0
15956 *) localtime_r_proto=0
15960 : see if localtime_r calls tzset
15961 case "$localtime_r_proto" in
15964 /* Does our libc's localtime_r call tzset ?
15965 * return 0 if so, 1 otherwise.
15967 #$i_systypes I_SYS_TYPES
15968 #$i_unistd I_UNISTD
15970 #$i_stdlib I_STDLIB
15971 #$i_string I_STRING
15972 #$i_malloc I_MALLOC
15974 # include <sys/types.h>
15977 # include <unistd.h>
15983 #include <stdlib.h>
15986 # include <string.h>
15988 # include <strings.h>
15991 # include <malloc.h>
15995 time_t t = time(0L);
15996 char w_tz[]="TZ" "=GMT+5",
15997 e_tz[]="TZ" "=GMT-5",
15998 *tz_e = (char*)malloc(16),
15999 *tz_w = (char*)malloc(16);
16000 struct tm tm_e, tm_w;
16001 memset(&tm_e,'\0',sizeof(struct tm));
16002 memset(&tm_w,'\0',sizeof(struct tm));
16007 localtime_r(&t, &tm_e);
16010 localtime_r(&t, &tm_w);
16012 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
16018 if eval $compile; then
16019 if $run ./try; then
16020 d_localtime_r_needs_tzset=undef;
16022 d_localtime_r_needs_tzset=define;
16025 d_localtime_r_needs_tzset=undef;
16029 d_localtime_r_needs_tzset=undef;
16034 : see if localeconv exists
16035 set localeconv d_locconv
16038 : see if libc has the POSIX.1-2008 currency locale rules
16039 case "$d_locconv:$d_lc_monetary_2008" in
16042 #include <locale.h>
16044 struct lconv *lc = localeconv();
16045 char int_p_cs_precedes = lc->int_p_cs_precedes;
16050 if eval $compile; then
16051 d_lc_monetary_2008="$define"
16053 d_lc_monetary_2008="$undef"
16059 : see if lockf exists
16063 : see if prototype for lseek is available
16065 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
16068 : see if lstat exists
16072 : see if madvise exists
16073 set madvise d_madvise
16076 : see if malloc_size exists
16077 set malloc_size d_malloc_size
16080 : see if malloc_size_good exists
16081 set malloc_good_size d_malloc_good_size
16084 : see if mblen exists
16088 : see if mbstowcs exists
16089 set mbstowcs d_mbstowcs
16092 : see if mbtowc exists
16093 set mbtowc d_mbtowc
16096 : see if memchr exists
16097 set memchr d_memchr
16100 : see if memcmp exists
16101 set memcmp d_memcmp
16104 : see if memcpy exists
16105 set memcpy d_memcpy
16108 : see if memmove exists
16109 set memmove d_memmove
16112 : see if memset exists
16113 set memset d_memset
16116 : see if mkdir exists
16120 : see if mkdtemp exists
16121 set mkdtemp d_mkdtemp
16124 : see if mkfifo exists
16125 set mkfifo d_mkfifo
16128 : see if mkstemp exists
16129 set mkstemp d_mkstemp
16132 : see if mkstemps exists
16133 set mkstemps d_mkstemps
16136 : see if mktime exists
16137 set mktime d_mktime
16140 : see if this is a sys/mman.h system
16141 set sys/mman.h i_sysmman
16144 : see if mmap exists
16147 : see what shmat returns
16148 : default to something harmless
16150 case "$i_sysmman$d_mmap" in
16152 $cat >mmap.c <<'END'
16153 #include <sys/mman.h>
16156 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
16161 echo "and it returns ($mmaptype)." >&4
16167 : see if sqrtl exists
16171 : see if scalbnl exists
16172 set scalbnl d_scalbnl
16175 : see if truncl exists
16176 set truncl d_truncl
16179 : see if modfl exists
16183 : see if prototype for modfl is available
16185 set d_modflproto modfl $i_math math.h
16188 d_modfl_pow32_bug="$undef"
16190 case "$d_longdbl$d_modfl" in
16193 Checking to see whether your modfl() is okay for large values...
16199 if $test "X$d_modflproto" != "X$define"; then
16200 $cat >>try.c <<EOCP
16201 /* Sigh. many current glibcs provide the function, but do not prototype it. */
16202 long double modfl (long double, long double *);
16205 $cat >>try.c <<EOCP
16207 long double nv = 4294967303.15;
16213 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
16217 case "$osname:$gccversion" in
16218 aix:) saveccflags="$ccflags"
16219 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
16222 if eval $compile; then
16225 *" 4294967303.150000 1.150000 4294967302.000000")
16226 echo >&4 "Your modfl() is broken for large values."
16227 d_modfl_pow32_bug="$define"
16229 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
16233 *" 4294967303.150000 0.150000 4294967303.000000")
16234 echo >&4 "Your modfl() seems okay for large values."
16236 *) echo >&4 "I don't understand your modfl() at all."
16242 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
16245 case "$osname:$gccversion" in
16246 aix:) ccflags="$saveccflags" ;; # restore
16251 if $test "$uselongdouble" = "$define"; then
16253 if $test "$d_sqrtl" != "$define"; then
16254 message="$message sqrtl"
16256 if $test "$d_modfl" != "$define"; then
16257 if $test "$d_truncl:$d_copysignl" = "$define:$define"; then
16258 echo "You have both truncl and copysignl, so I can emulate modfl."
16260 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
16261 echo "You have both aintl and copysignl, so I can emulate modfl."
16263 message="$message modfl"
16267 if $test "$d_frexpl" != "$define"; then
16268 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
16269 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
16271 message="$message frexpl"
16274 if $test "$d_ldexpl" != "$define"; then
16275 message="$message ldexpl"
16278 if $test "$message" != ""; then
16281 *** You requested the use of long doubles but you do not seem to have
16282 *** the following mathematical functions needed for long double support:
16284 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
16285 *** Cannot continue, aborting.
16293 : see if mprotect exists
16294 set mprotect d_mprotect
16297 : see if msgctl exists
16298 set msgctl d_msgctl
16301 : see if msgget exists
16302 set msgget d_msgget
16305 : see if msgsnd exists
16306 set msgsnd d_msgsnd
16309 : see if msgrcv exists
16310 set msgrcv d_msgrcv
16313 : see how much of the 'msg*(2)' library is present.
16316 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
16317 *"$undef"*) h_msg=false;;
16321 case "`ipcs 2>&1`" in
16322 "SVID messages"*"not configured"*)
16323 echo "Your $osname does not have the msg*(2) configured." >&4
16326 set msgctl d_msgctl
16328 set msgget d_msgget
16330 set msgsnd d_msgsnd
16332 set msgrcv d_msgrcv
16338 : we could also check for sys/ipc.h ...
16339 if $h_msg && $test `./findhdr sys/msg.h`; then
16340 echo "You have the full msg*(2) library." >&4
16343 echo "You don't have the full msg*(2) library." >&4
16349 : Check for msghdr_s
16351 echo "Checking to see if your system supports struct msghdr..." >&4
16352 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
16354 case "$d_msghdr_s" in
16355 "$define") echo "Yes, it does." ;;
16356 *) echo "No, it doesn't." ;;
16360 : see if msync exists
16364 : see if munmap exists
16365 set munmap d_munmap
16368 : see if nice exists
16372 : see if this is a langinfo.h system
16373 set langinfo.h i_langinfo
16376 : see if nl_langinfo exists
16377 set nl_langinfo d_nl_langinfo
16380 : check for volatile keyword
16382 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
16383 $cat >try.c <<'EOCP'
16386 typedef struct _goo_struct goo_struct;
16387 goo_struct * volatile goo = ((goo_struct *)0);
16388 struct _goo_struct {
16393 typedef unsigned short foo_t;
16394 char *volatile foo;
16396 volatile foo_t blech;
16400 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
16402 echo "Yup, it does."
16405 echo "Nope, it doesn't."
16411 : Check basic sizes
16413 $echo "Choosing the C types to be used for Perl's internal types..." >&4
16415 case "$use64bitint:$d_quad:$quadtype" in
16418 uvtype="$uquadtype"
16423 uvtype="unsigned long"
16429 case "$uselongdouble:$d_longdbl" in
16431 nvtype="long double"
16432 nvsize=$longdblsize
16439 case "$usequadmath:$i_quadmath" in
16441 nvtype="__float128"
16447 *** You requested the use of the quadmath library, but you
16448 *** do not seem to have the quadmath library installed.
16449 *** Cannot continue, aborting.
16455 define:*) $cat <<EOM >&4
16457 *** You requested the use of the quadmath library, but you
16458 *** do not seem to have the required header, <quadmath.h>.
16460 case "$gccversion" in
16463 *** Your gcc looks a bit old:
16469 *** You are not running a gcc.
16474 *** For the quadmath library you need at least gcc 4.6.
16475 *** Cannot continue, aborting.
16481 $echo "(IV will be "$ivtype", $ivsize bytes)"
16482 $echo "(UV will be "$uvtype", $uvsize bytes)"
16483 $echo "(NV will be "$nvtype", $nvsize bytes)"
16486 #$i_inttypes I_INTTYPES
16488 #include <inttypes.h>
16493 int8_t i = INT8_MAX;
16494 uint8_t u = UINT8_MAX;
16495 printf("int8_t\n");
16498 int16_t i = INT16_MAX;
16499 uint16_t u = UINT16_MAX;
16500 printf("int16_t\n");
16503 int32_t i = INT32_MAX;
16504 uint32_t u = UINT32_MAX;
16505 printf("int32_t\n");
16510 i8type="signed char"
16511 u8type="unsigned char"
16516 '') case "$shortsize" in
16518 u16type="unsigned short"
16526 '') set try -DINT16
16527 if eval $compile; then
16528 case "`$run ./try`" in
16540 '') if $test $shortsize -ge 2; then
16542 u16type="unsigned short"
16550 '') case "$longsize" in
16552 u32type="unsigned long"
16556 *) case "$intsize" in
16558 u32type="unsigned int"
16568 '') set try -DINT32
16569 if eval $compile; then
16570 case "`$run ./try`" in
16582 '') if $test $intsize -ge 4; then
16584 u32type="unsigned int"
16592 '') case "$d_quad:$quadtype" in
16594 i64type="$quadtype"
16595 u64type="$uquadtype"
16603 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
16604 : volatile so that the compiler has to store it out to memory.
16605 if test X"$d_volatile" = X"$define"; then
16610 #$i_stdlib I_STDLIB
16612 #include <stdlib.h>
16614 #include <sys/types.h>
16615 #include <signal.h>
16617 $volatile int bletched = 0;
16618 $signal_t blech(int s) { bletched = 1; }
16623 int n = 8 * $uvsize;
16626 signal(SIGFPE, blech);
16629 for (i = 0; i < n; i++) {
16630 u = u << 1 | ($uvtype)1;
16632 if (($uvtype)d != u)
16636 d = ($nvtype)(u - 1);
16637 if (($uvtype)d != (u - 1))
16644 printf("%d\n", ((i == n) ? -n : i));
16650 d_nv_preserves_uv="$undef"
16651 if eval $compile; then
16652 nv_preserves_uv_bits="`$run ./try`"
16654 case "$nv_preserves_uv_bits" in
16656 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
16657 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
16658 d_nv_preserves_uv="$define"
16660 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
16661 d_nv_preserves_uv="$undef" ;;
16662 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
16663 nv_preserves_uv_bits="0" ;;
16667 $echo "Checking to find the largest integer value your NVs can hold..." >&4
16668 : volatile so that the compiler has to store it out to memory.
16669 if test X"$d_volatile" = X"$define"; then
16675 typedef $nvtype NV;
16682 while(count < 256) {
16683 $volatile NV up = value + 1.0;
16684 $volatile NV negated = -value;
16685 $volatile NV down = negated - 1.0;
16686 $volatile NV got_up = up - value;
16687 int up_good = got_up == 1.0;
16688 int got_down = down - negated;
16689 int down_good = got_down == -1.0;
16691 if (down_good != up_good) {
16693 "Inconsistency - up %d %f; down %d %f; for 2**%d (%.20f)\n",
16694 up_good, (double) got_up, down_good, (double) got_down,
16695 count, (double) value);
16702 fputs("256.0", stdout);
16705 fputs("2.0", stdout);
16711 fputs("*", stdout);
16717 fprintf(stderr, "Cannot overflow integer range, even at 2**%d (%.20f)\n",
16718 count, (double) value);
16724 nv_overflows_integers_at='0'
16725 if eval $compile; then
16731 The largest integer your NVs can preserve is equal to $xxx
16733 nv_overflows_integers_at="$xxx"
16736 Cannot determine the largest integer value your NVs can hold, unexpected output
16743 Cannot determine the largest integer value your NVs can hold
16750 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
16751 : volatile so that the compiler has to store it out to memory.
16752 if test X"$d_volatile" = X"$define"; then
16757 #$i_stdlib I_STDLIB
16759 #include <stdlib.h>
16761 #$i_string I_STRING
16763 # include <string.h>
16765 # include <strings.h>
16767 #include <sys/types.h>
16768 #include <signal.h>
16770 $volatile int bletched = 0;
16771 $signal_t blech(int s) { bletched = 1; }
16774 int checkit($nvtype d, char *where) {
16775 unsigned char *p = (char *)&d;
16776 unsigned char *end = p + sizeof(d);
16786 printf("No - %s: 0x", where);
16788 printf ("%02X", *p++);
16793 int main(int argc, char **argv) {
16796 fail += checkit(d, "0.0");
16798 /* The compiler shouldn't be assuming that bletched is 0 */
16801 fail += checkit(d, "bleched");
16804 signal(SIGFPE, blech);
16807 /* Paranoia - the compiler should have no way of knowing that ANSI says
16808 that argv[argc] will always be NULL. Actually, if it did assume this it
16809 would be buggy, as this is C and main() can be called from elsewhere in
16811 d = argv[argc] ? 1 : 0;
16814 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
16817 fail += checkit(d, "ternary");
16819 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
16822 printf("No - memset doesn't give 0.0\n");
16823 /* This might just blow up: */
16824 printf("(gives %g)\n", d);
16830 printf("No - something bleched\n");
16835 printf("No - %d fail(s)\n", fail);
16844 d_nv_zero_is_allbits_zero="$undef"
16845 if eval $compile; then
16851 0.0 is represented as all bits zero in memory
16853 d_nv_zero_is_allbits_zero="$define"
16856 0.0 is not represented as all bits zero in memory
16858 d_nv_zero_is_allbits_zero="$undef"
16863 0.0 is not represented as all bits zero in memory
16865 d_nv_zero_is_allbits_zero="$undef"
16871 : check for off64_t
16873 echo "Checking to see if you have off64_t..." >&4
16875 #include <sys/types.h>
16876 #include <unistd.h>
16877 int main() { off64_t x = 7; }
16880 if eval $compile; then
16882 echo "You have off64_t."
16885 echo "You do not have off64_t."
16886 case "$lseeksize" in
16887 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
16894 : how to create joinable pthreads
16895 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
16897 echo "Checking what constant to use for creating joinable pthreads..." >&4
16898 $cat >try.c <<'EOCP'
16899 #include <pthread.h>
16901 int detachstate = JOINABLE;
16904 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
16905 if eval $compile; then
16906 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
16907 val="$undef" # Yes, undef.
16908 set d_old_pthread_create_joinable
16911 set old_pthread_create_joinable
16914 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
16915 if eval $compile; then
16916 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
16918 set d_old_pthread_create_joinable
16920 val=PTHREAD_CREATE_UNDETACHED
16921 set old_pthread_create_joinable
16924 set try -DJOINABLE=__UNDETACHED
16925 if eval $compile; then
16926 echo "You seem to use __UNDETACHED." >&4
16928 set d_old_pthread_create_joinable
16931 set old_pthread_create_joinable
16934 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
16936 set d_old_pthread_create_joinable
16939 set old_pthread_create_joinable
16946 d_old_pthread_create_joinable="$undef"
16947 old_pthread_create_joinable=""
16950 : see if pause exists
16954 : see if poll exists
16958 : see if prctl exists
16962 : see if prctl supports PR_SET_NAME
16963 d_prctl_set_name=$undef
16968 #include <unistd.h>
16970 #include <sys/prctl.h>
16972 int main (int argc, char *argv[])
16974 return (prctl (PR_SET_NAME, "Test"));
16978 if eval $compile_ok && $run ./try; then
16979 echo "Your prctl (PR_SET_NAME, ...) works"
16980 d_prctl_set_name=$define
16986 : see if readlink exists
16987 set readlink d_readlink
16990 : Check if exe is symlink to abs path of executing program
16994 case "$d_readlink" in
16996 : NetBSD first as /proc/self is a symlink to /proc/curproc, and it feels
16997 : more tidy to avoid an extra level of symlink
16998 set NetBSD /proc/curproc/exe Linux /proc/self/exe FreeBSD /proc/curproc/file Solaris /proc/self/path/a.out
16999 while test $# -gt 0; do
17002 if $issymlink $try; then
17003 $ls -l $try > reflect
17004 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
17005 echo "You have $type-like $try."
17006 procselfexe='"'$try'"'
17008 : This will break out of the loop
17019 : backward compatibility for d_hvfork
17020 if test X$d_hvfork != X; then
17021 d_vfork="$d_hvfork"
17024 : see if there is a vfork
17029 d_pseudofork=$undef
17031 : Ok, but do we want to use it. vfork is reportedly unreliable in
17032 : perl on Solaris 2.x, and probably elsewhere.
17036 case "$usevfork" in
17042 Perl can only use a vfork() that doesn't suffer from strict
17043 restrictions on calling functions or modifying global data in
17044 the child. For example, glibc-2.1 contains such a vfork()
17045 that is unsuitable. If your system provides a proper fork()
17046 call, chances are that you do NOT want perl to use vfork().
17049 rp="Do you still want to use vfork()?"
17054 echo "Ok, we won't use vfork()."
17063 $define) usevfork='true';;
17064 *) usevfork='false';;
17067 : see whether the pthread_atfork exists
17069 #include <pthread.h>
17072 #ifdef PTHREAD_ATFORK
17073 pthread_atfork(NULL,NULL,NULL);
17078 : see if pthread_atfork exists
17079 set try -DPTHREAD_ATFORK
17080 if eval $compile; then
17085 case "$usethreads" in
17088 $define) echo 'pthread_atfork found.' >&4 ;;
17089 *) echo 'pthread_atfork NOT found.' >&4 ;;
17092 set d_pthread_atfork
17095 : see if pthread_attr_setscope exists
17096 set pthread_attr_setscope d_pthread_attr_setscope
17099 : see whether the various POSIXish _yields exist
17101 #include <pthread.h>
17107 #ifdef PTHREAD_YIELD
17110 #ifdef PTHREAD_YIELD_NULL
17111 pthread_yield(NULL);
17117 : see if sched_yield exists
17118 set try -DSCHED_YIELD
17119 if eval $compile; then
17121 sched_yield='sched_yield()'
17125 case "$usethreads" in
17128 $define) echo 'sched_yield() found.' >&4 ;;
17129 *) echo 'sched_yield() NOT found.' >&4 ;;
17135 : see if pthread_yield exists
17136 set try -DPTHREAD_YIELD
17137 if eval $compile; then
17139 case "$sched_yield" in
17140 '') sched_yield='pthread_yield()' ;;
17143 set try -DPTHREAD_YIELD_NULL
17144 if eval $compile; then
17146 case "$sched_yield" in
17147 '') sched_yield='pthread_yield(NULL)' ;;
17153 case "$usethreads" in
17156 $define) echo 'pthread_yield() found.' >&4 ;;
17157 *) echo 'pthread_yield() NOT found.' >&4 ;;
17161 set d_pthread_yield
17163 case "$sched_yield" in
17164 '') sched_yield=undef ;;
17168 : check for ptrdiff_t
17170 echo "Checking to see if you have ptrdiff_t..." >&4
17172 #include <stddef.h>
17173 int main() { ptrdiff_t x = 7; }
17176 if eval $compile; then
17178 echo "You have ptrdiff_t."
17181 echo "You do not have ptrdiff_t."
17187 : see if random_r exists
17188 set random_r d_random_r
17190 case "$d_random_r" in
17192 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17193 case "$d_random_r_proto:$usethreads" in
17194 ":define") d_random_r_proto=define
17195 set d_random_r_proto random_r $hdrs
17199 case "$d_random_r_proto" in
17201 case "$random_r_proto" in
17202 ''|0) try='int random_r(int*, struct random_data*);'
17203 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_iS ;;
17205 case "$random_r_proto" in
17206 ''|0) try='int random_r(long*, struct random_data*);'
17207 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_lS ;;
17209 case "$random_r_proto" in
17210 ''|0) try='int random_r(struct random_data*, int32_t*);'
17211 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_St ;;
17213 case "$random_r_proto" in
17214 ''|0) d_random_r=undef
17216 echo "Disabling random_r, cannot determine prototype." >&4 ;;
17217 * ) case "$random_r_proto" in
17218 REENTRANT_PROTO*) ;;
17219 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
17221 echo "Prototype: $try" ;;
17224 *) case "$usethreads" in
17225 define) echo "random_r has no prototype, not using it." >&4 ;;
17232 *) random_r_proto=0
17236 : see if readdir and friends exist
17237 set readdir d_readdir
17239 set seekdir d_seekdir
17241 set telldir d_telldir
17243 set rewinddir d_rewinddir
17246 : see if readdir64_r exists
17247 set readdir64_r d_readdir64_r
17249 case "$d_readdir64_r" in
17251 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
17252 case "$d_readdir64_r_proto:$usethreads" in
17253 ":define") d_readdir64_r_proto=define
17254 set d_readdir64_r_proto readdir64_r $hdrs
17258 case "$d_readdir64_r_proto" in
17260 case "$readdir64_r_proto" in
17261 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
17262 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TSR ;;
17264 case "$readdir64_r_proto" in
17265 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
17266 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TS ;;
17268 case "$readdir64_r_proto" in
17269 ''|0) d_readdir64_r=undef
17270 readdir64_r_proto=0
17271 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
17272 * ) case "$readdir64_r_proto" in
17273 REENTRANT_PROTO*) ;;
17274 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
17276 echo "Prototype: $try" ;;
17279 *) case "$usethreads" in
17280 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
17282 d_readdir64_r=undef
17283 readdir64_r_proto=0
17287 *) readdir64_r_proto=0
17291 : see if readdir_r exists
17292 set readdir_r d_readdir_r
17294 case "$d_readdir_r" in
17296 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
17297 case "$d_readdir_r_proto:$usethreads" in
17298 ":define") d_readdir_r_proto=define
17299 set d_readdir_r_proto readdir_r $hdrs
17303 case "$d_readdir_r_proto" in
17305 case "$readdir_r_proto" in
17306 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
17307 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TSR ;;
17309 case "$readdir_r_proto" in
17310 ''|0) try='int readdir_r(DIR*, struct dirent*);'
17311 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TS ;;
17313 case "$readdir_r_proto" in
17314 ''|0) d_readdir_r=undef
17316 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
17317 * ) case "$readdir_r_proto" in
17318 REENTRANT_PROTO*) ;;
17319 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
17321 echo "Prototype: $try" ;;
17324 *) case "$usethreads" in
17325 define) echo "readdir_r has no prototype, not using it." >&4 ;;
17332 *) readdir_r_proto=0
17336 : see if readv exists
17340 : see if recvmsg exists
17341 set recvmsg d_recvmsg
17344 : see if rename exists
17345 set rename d_rename
17348 : see if rmdir exists
17352 : see if memory.h is available.
17357 : See if it conflicts with string.h
17363 $cppstdin $cppflags $cppminus < $strings > mem.h
17364 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
17366 echo "We won't be including <memory.h>."
17376 : can bcopy handle overlapping blocks?
17379 case "$d_memmove" in
17380 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
17381 *) case "$d_bcopy" in
17383 echo "Checking to see if bcopy() can do overlapping copies..." >&4
17385 #$i_memory I_MEMORY
17386 #$i_stdlib I_STDLIB
17387 #$i_string I_STRING
17388 #$i_unistd I_UNISTD
17390 $cat >>try.c <<'EOCP'
17393 # include <memory.h>
17396 # include <stdlib.h>
17399 # include <string.h>
17401 # include <strings.h>
17404 # include <unistd.h> /* Needed for NetBSD */
17408 char buf[128], abc[128];
17414 /* Copy "abcde..." string to char abc[] so that gcc doesn't
17415 try to store the string in read-only memory. */
17416 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
17418 for (align = 7; align >= 0; align--) {
17419 for (len = 36; len; len--) {
17421 bcopy(abc, b, len);
17422 for (off = 1; off <= len; off++) {
17423 bcopy(b, b+off, len);
17424 bcopy(b+off, b, len);
17425 if (bcmp(b, abc, len))
17434 if eval $compile_ok; then
17435 if $run ./try 2>/dev/null; then
17436 echo "Yes, it can."
17439 echo "It can't, sorry."
17442 echo "(I can't compile the test program, so we'll assume not...)"
17452 : can memcpy handle overlapping blocks?
17455 case "$d_memmove" in
17456 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
17457 *) case "$d_memcpy" in
17459 echo "Checking to see if memcpy() can do overlapping copies..." >&4
17461 #$i_memory I_MEMORY
17462 #$i_stdlib I_STDLIB
17463 #$i_string I_STRING
17464 #$i_unistd I_UNISTD
17466 $cat >>try.c <<'EOCP'
17469 # include <memory.h>
17472 # include <stdlib.h>
17475 # include <string.h>
17477 # include <strings.h>
17480 # include <unistd.h> /* Needed for NetBSD */
17484 char buf[128], abc[128];
17490 /* Copy "abcde..." string to char abc[] so that gcc doesn't
17491 try to store the string in read-only memory. */
17492 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
17494 for (align = 7; align >= 0; align--) {
17495 for (len = 36; len; len--) {
17497 memcpy(b, abc, len);
17498 for (off = 1; off <= len; off++) {
17499 memcpy(b+off, b, len);
17500 memcpy(b, b+off, len);
17501 if (memcmp(b, abc, len))
17510 if eval $compile_ok; then
17511 if $run ./try 2>/dev/null; then
17512 echo "Yes, it can."
17515 echo "It can't, sorry."
17518 echo "(I can't compile the test program, so we'll assume not...)"
17528 : can memcmp be trusted to compare relative magnitude?
17530 case "$d_memcmp" in
17533 echo "Checking if your memcmp() can compare relative magnitude..." >&4
17535 #$i_memory I_MEMORY
17536 #$i_stdlib I_STDLIB
17537 #$i_string I_STRING
17538 #$i_unistd I_UNISTD
17540 $cat >>try.c <<'EOCP'
17543 # include <memory.h>
17546 # include <stdlib.h>
17549 # include <string.h>
17551 # include <strings.h>
17554 # include <unistd.h> /* Needed for NetBSD */
17560 if ((a < b) && memcmp(&a, &b, 1) < 0)
17566 if eval $compile_ok; then
17567 if $run ./try 2>/dev/null; then
17568 echo "Yes, it can."
17571 echo "No, it can't (it uses signed chars)."
17574 echo "(I can't compile the test program, so we'll assume not...)"
17582 : see if prototype for sbrk is available
17584 set d_sbrkproto sbrk $i_unistd unistd.h
17587 : see if select exists
17588 set select d_select
17591 : see if semctl exists
17592 set semctl d_semctl
17595 : see if semget exists
17596 set semget d_semget
17599 : see if semop exists
17603 : see how much of the 'sem*(2)' library is present.
17606 case "$d_semctl$d_semget$d_semop" in
17607 *"$undef"*) h_sem=false;;
17611 case "`ipcs 2>&1`" in
17612 "SVID messages"*"not configured"*)
17613 echo "Your $osname does not have the sem*(2) configured." >&4
17616 set semctl d_semctl
17618 set semget d_semget
17626 : we could also check for sys/ipc.h ...
17627 if $h_sem && $test `./findhdr sys/sem.h`; then
17628 echo "You have the full sem*(2) library." >&4
17631 echo "You don't have the full sem*(2) library." >&4
17637 : see whether sys/sem.h defines union semun
17639 $cat > try.c <<'END'
17640 #include <sys/types.h>
17641 #include <sys/ipc.h>
17642 #include <sys/sem.h>
17643 int main () { union semun semun; semun.buf = 0; }
17646 if eval $compile; then
17647 echo "You have union semun in <sys/sem.h>." >&4
17650 echo "You do not have union semun in <sys/sem.h>." >&4
17657 : see how to do semctl IPC_STAT
17661 $cat > tryh.h <<END
17664 # define S_IRUSR S_IREAD
17665 # define S_IWUSR S_IWRITE
17666 # define S_IXUSR S_IEXEC
17668 # define S_IRUSR 0400
17669 # define S_IWUSR 0200
17670 # define S_IXUSR 0100
17672 # define S_IRGRP (S_IRUSR>>3)
17673 # define S_IWGRP (S_IWUSR>>3)
17674 # define S_IXGRP (S_IXUSR>>3)
17675 # define S_IROTH (S_IRUSR>>6)
17676 # define S_IWOTH (S_IWUSR>>6)
17677 # define S_IXOTH (S_IXUSR>>6)
17680 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
17681 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
17682 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
17685 : see whether semctl IPC_STAT can use union semun
17686 case "$d_semctl_semun" in
17690 #include <sys/types.h>
17691 #include <sys/ipc.h>
17692 #include <sys/sem.h>
17693 #include <sys/stat.h>
17700 #$d_union_semun HAS_UNION_SEMUN
17703 #ifndef HAS_UNION_SEMUN
17706 struct semid_ds *buf;
17707 unsigned short *array;
17713 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
17714 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
17716 struct semid_ds argbuf;
17719 st = semctl(sem, 0, IPC_STAT, arg);
17723 # endif /* IPC_STAT */
17724 printf("semctl IPC_STAT failed: errno = %d\n", errno);
17726 if (semctl(sem, 0, IPC_RMID, arg) != 0)
17727 # endif /* IPC_RMID */
17728 printf("semctl IPC_RMID failed: errno = %d\n", errno);
17730 #endif /* IPC_PRIVATE && ... */
17731 printf("semget failed: errno = %d\n", errno);
17736 if eval $compile; then
17739 semun) val="$define" ;;
17747 case "$d_semctl_semun" in
17749 echo "You can use union semun for semctl IPC_STAT." >&4
17752 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
17757 : see whether semctl IPC_STAT can use struct semid_ds pointer
17758 case "$d_semctl_semid_ds" in
17761 $cat > try.c <<'END'
17762 #include <sys/types.h>
17763 #include <sys/ipc.h>
17764 #include <sys/sem.h>
17765 #include <sys/stat.h>
17773 struct semid_ds arg;
17776 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
17777 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
17780 st = semctl(sem, 0, IPC_STAT, &arg);
17782 printf("semid_ds\n");
17784 # endif /* IPC_STAT */
17785 printf("semctl IPC_STAT failed: errno = %d\n", errno);
17787 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
17788 # endif /* IPC_RMID */
17789 printf("semctl IPC_RMID failed: errno = %d\n", errno);
17791 #endif /* IPC_PRIVATE && ... */
17792 printf("semget failed: errno = %d\n", errno);
17798 if eval $compile; then
17801 semid_ds) val="$define" ;;
17805 set d_semctl_semid_ds
17809 case "$d_semctl_semid_ds" in
17811 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
17813 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
17819 # We do not have the full sem*(2) library, so assume we can not
17825 set d_semctl_semid_ds
17831 : see if sendmsg exists
17832 set sendmsg d_sendmsg
17835 : see if setegid exists
17836 set setegid d_setegid
17839 : see if seteuid exists
17840 set seteuid d_seteuid
17843 : see if setgrent exists
17844 set setgrent d_setgrent
17847 : see if setgrent_r exists
17848 set setgrent_r d_setgrent_r
17850 case "$d_setgrent_r" in
17852 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
17853 case "$d_setgrent_r_proto:$usethreads" in
17854 ":define") d_setgrent_r_proto=define
17855 set d_setgrent_r_proto setgrent_r $hdrs
17859 case "$d_setgrent_r_proto" in
17861 case "$setgrent_r_proto" in
17862 ''|0) try='int setgrent_r(FILE**);'
17863 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=I_H ;;
17865 case "$setgrent_r_proto" in
17866 ''|0) try='void setgrent_r(FILE**);'
17867 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=V_H ;;
17869 case "$setgrent_r_proto" in
17870 ''|0) d_setgrent_r=undef
17872 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
17873 * ) case "$setgrent_r_proto" in
17874 REENTRANT_PROTO*) ;;
17875 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
17877 echo "Prototype: $try" ;;
17880 *) case "$usethreads" in
17881 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
17888 *) setgrent_r_proto=0
17892 : see if sethostent exists
17893 set sethostent d_sethent
17896 : see if sethostent_r exists
17897 set sethostent_r d_sethostent_r
17899 case "$d_sethostent_r" in
17901 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17902 case "$d_sethostent_r_proto:$usethreads" in
17903 ":define") d_sethostent_r_proto=define
17904 set d_sethostent_r_proto sethostent_r $hdrs
17908 case "$d_sethostent_r_proto" in
17910 case "$sethostent_r_proto" in
17911 ''|0) try='int sethostent_r(int, struct hostent_data*);'
17912 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=I_ID ;;
17914 case "$sethostent_r_proto" in
17915 ''|0) try='void sethostent_r(int, struct hostent_data*);'
17916 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=V_ID ;;
17918 case "$sethostent_r_proto" in
17919 ''|0) d_sethostent_r=undef
17920 sethostent_r_proto=0
17921 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
17922 * ) case "$sethostent_r_proto" in
17923 REENTRANT_PROTO*) ;;
17924 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
17926 echo "Prototype: $try" ;;
17929 *) case "$usethreads" in
17930 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
17932 d_sethostent_r=undef
17933 sethostent_r_proto=0
17937 *) sethostent_r_proto=0
17941 : see if setitimer exists
17942 set setitimer d_setitimer
17945 : see if setlinebuf exists
17946 set setlinebuf d_setlinebuf
17949 : see if setlocale exists
17950 set setlocale d_setlocale
17953 : see if locale.h is available
17954 set locale.h i_locale
17957 : see if setlocale_r exists
17958 set setlocale_r d_setlocale_r
17960 case "$d_setlocale_r" in
17962 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
17963 case "$d_setlocale_r_proto:$usethreads" in
17964 ":define") d_setlocale_r_proto=define
17965 set d_setlocale_r_proto setlocale_r $hdrs
17969 case "$d_setlocale_r_proto" in
17971 case "$setlocale_r_proto" in
17972 ''|0) try='int setlocale_r(int, const char*, char*, int);'
17973 ./protochk "$extern_C $try" $hdrs && setlocale_r_proto=I_ICBI ;;
17975 case "$setlocale_r_proto" in
17976 ''|0) d_setlocale_r=undef
17977 setlocale_r_proto=0
17978 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
17979 * ) case "$setlocale_r_proto" in
17980 REENTRANT_PROTO*) ;;
17981 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
17983 echo "Prototype: $try" ;;
17986 *) case "$usethreads" in
17987 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
17989 d_setlocale_r=undef
17990 setlocale_r_proto=0
17994 *) setlocale_r_proto=0
17998 : see if setnetent exists
17999 set setnetent d_setnent
18002 : see if setnetent_r exists
18003 set setnetent_r d_setnetent_r
18005 case "$d_setnetent_r" in
18007 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18008 case "$d_setnetent_r_proto:$usethreads" in
18009 ":define") d_setnetent_r_proto=define
18010 set d_setnetent_r_proto setnetent_r $hdrs
18014 case "$d_setnetent_r_proto" in
18016 case "$setnetent_r_proto" in
18017 ''|0) try='int setnetent_r(int, struct netent_data*);'
18018 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=I_ID ;;
18020 case "$setnetent_r_proto" in
18021 ''|0) try='void setnetent_r(int, struct netent_data*);'
18022 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=V_ID ;;
18024 case "$setnetent_r_proto" in
18025 ''|0) d_setnetent_r=undef
18026 setnetent_r_proto=0
18027 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
18028 * ) case "$setnetent_r_proto" in
18029 REENTRANT_PROTO*) ;;
18030 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
18032 echo "Prototype: $try" ;;
18035 *) case "$usethreads" in
18036 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
18038 d_setnetent_r=undef
18039 setnetent_r_proto=0
18043 *) setnetent_r_proto=0
18047 : see if setprotoent exists
18048 set setprotoent d_setpent
18051 : see if setpgid exists
18052 set setpgid d_setpgid
18055 : see if setpgrp2 exists
18056 set setpgrp2 d_setpgrp2
18059 : see if setpriority exists
18060 set setpriority d_setprior
18063 : see if setproctitle exists
18064 set setproctitle d_setproctitle
18067 : see if setprotoent_r exists
18068 set setprotoent_r d_setprotoent_r
18070 case "$d_setprotoent_r" in
18072 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18073 case "$d_setprotoent_r_proto:$usethreads" in
18074 ":define") d_setprotoent_r_proto=define
18075 set d_setprotoent_r_proto setprotoent_r $hdrs
18079 case "$d_setprotoent_r_proto" in
18081 case "$setprotoent_r_proto" in
18082 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
18083 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=I_ID ;;
18085 case "$setprotoent_r_proto" in
18086 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
18087 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=V_ID ;;
18089 case "$setprotoent_r_proto" in
18090 ''|0) d_setprotoent_r=undef
18091 setprotoent_r_proto=0
18092 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
18093 * ) case "$setprotoent_r_proto" in
18094 REENTRANT_PROTO*) ;;
18095 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
18097 echo "Prototype: $try" ;;
18100 *) case "$usethreads" in
18101 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
18103 d_setprotoent_r=undef
18104 setprotoent_r_proto=0
18108 *) setprotoent_r_proto=0
18112 : see if setpwent exists
18113 set setpwent d_setpwent
18116 : see if setpwent_r exists
18117 set setpwent_r d_setpwent_r
18119 case "$d_setpwent_r" in
18121 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
18122 case "$d_setpwent_r_proto:$usethreads" in
18123 ":define") d_setpwent_r_proto=define
18124 set d_setpwent_r_proto setpwent_r $hdrs
18128 case "$d_setpwent_r_proto" in
18130 case "$setpwent_r_proto" in
18131 ''|0) try='int setpwent_r(FILE**);'
18132 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=I_H ;;
18134 case "$setpwent_r_proto" in
18135 ''|0) try='void setpwent_r(FILE**);'
18136 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=V_H ;;
18138 case "$setpwent_r_proto" in
18139 ''|0) d_setpwent_r=undef
18141 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
18142 * ) case "$setpwent_r_proto" in
18143 REENTRANT_PROTO*) ;;
18144 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
18146 echo "Prototype: $try" ;;
18149 *) case "$usethreads" in
18150 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
18157 *) setpwent_r_proto=0
18161 : see if setregid exists
18162 set setregid d_setregid
18164 set setresgid d_setresgid
18167 : see if setreuid exists
18168 set setreuid d_setreuid
18170 set setresuid d_setresuid
18173 : see if setrgid exists
18174 set setrgid d_setrgid
18177 : see if setruid exists
18178 set setruid d_setruid
18181 : see if setservent exists
18182 set setservent d_setsent
18185 : see if setservent_r exists
18186 set setservent_r d_setservent_r
18188 case "$d_setservent_r" in
18190 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18191 case "$d_setservent_r_proto:$usethreads" in
18192 ":define") d_setservent_r_proto=define
18193 set d_setservent_r_proto setservent_r $hdrs
18197 case "$d_setservent_r_proto" in
18199 case "$setservent_r_proto" in
18200 ''|0) try='int setservent_r(int, struct servent_data*);'
18201 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=I_ID ;;
18203 case "$setservent_r_proto" in
18204 ''|0) try='void setservent_r(int, struct servent_data*);'
18205 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=V_ID ;;
18207 case "$setservent_r_proto" in
18208 ''|0) d_setservent_r=undef
18209 setservent_r_proto=0
18210 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
18211 * ) case "$setservent_r_proto" in
18212 REENTRANT_PROTO*) ;;
18213 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
18215 echo "Prototype: $try" ;;
18218 *) case "$usethreads" in
18219 define) echo "setservent_r has no prototype, not using it." >&4 ;;
18221 d_setservent_r=undef
18222 setservent_r_proto=0
18226 *) setservent_r_proto=0
18230 : see if setsid exists
18231 set setsid d_setsid
18234 : see if setvbuf exists
18235 set setvbuf d_setvbuf
18238 : see if shmctl exists
18239 set shmctl d_shmctl
18242 : see if shmget exists
18243 set shmget d_shmget
18246 : see if shmat exists
18249 : see what shmat returns
18252 $cat >shmat.c <<'END'
18253 #include <sys/shm.h>
18256 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
18261 echo "and it returns ($shmattype)." >&4
18262 : see if a prototype for shmat is available
18263 xxx=`./findhdr sys/shm.h`
18264 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
18265 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
18276 set d_shmatprototype
18279 : see if shmdt exists
18283 : see how much of the 'shm*(2)' library is present.
18286 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
18287 *"$undef"*) h_shm=false;;
18291 case "`ipcs 2>&1`" in
18292 "SVID shared memory"*"not configured"*)
18293 echo "Your $osname does not have the shm*(2) configured." >&4
18296 set shmctl d_shmctl
18298 set shmget d_shmget
18308 : we could also check for sys/ipc.h ...
18309 if $h_shm && $test `./findhdr sys/shm.h`; then
18310 echo "You have the full shm*(2) library." >&4
18313 echo "You don't have the full shm*(2) library." >&4
18319 : see if we have sigaction
18321 if set sigaction val -f d_sigaction; eval $csym; $val; then
18322 echo 'sigaction() found.' >&4
18325 #include <sys/types.h>
18326 #include <signal.h>
18327 #$i_stdlib I_STDLIB
18329 #include <stdlib.h>
18333 struct sigaction act, oact;
18335 oact.sa_handler = 0;
18336 /* so that act and oact are used */
18337 exit(act.sa_flags == 0 && oact.sa_handler == 0);
18341 if eval $compile_ok; then
18344 echo "But you don't seem to have a usable struct sigaction." >&4
18348 echo 'sigaction NOT found.' >&4
18351 set d_sigaction; eval $setvar
18354 : see if this is a sunmath.h system
18355 set sunmath.h i_sunmath
18358 : see if signbit exists
18359 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
18362 #$i_sunmath I_SUNMATH
18366 #ifdef I_SUNMATH /* Solaris special math library */
18367 # include <sunmath.h>
18370 int main(int argc, char **argv)
18374 if ((signbit(x) == 0) && (signbit(y) != 0))
18382 if eval $compile; then
18383 if $run ./try; then
18387 $echo "Signbit seems to be available, but doesn't work as I expected."
18388 $echo "I won't use it." >&4
18399 : see if sigprocmask exists
18400 set sigprocmask d_sigprocmask
18403 : see if sigsetjmp exists
18405 case "$d_sigsetjmp" in
18408 #include <setjmp.h>
18409 #$i_stdlib I_STDLIB
18411 #include <stdlib.h>
18417 if (sigsetjmp(env,1))
18420 siglongjmp(env, 1);
18425 if eval $compile; then
18426 if $run ./try >/dev/null 2>&1; then
18427 echo "POSIX sigsetjmp found." >&4
18431 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
18437 echo "sigsetjmp not found." >&4
18441 *) val="$d_sigsetjmp"
18442 case "$d_sigsetjmp" in
18443 $define) echo "POSIX sigsetjmp found." >&4;;
18444 $undef) echo "sigsetjmp not found." >&4;;
18452 : see if snprintf exists
18453 set snprintf d_snprintf
18456 : see if vsnprintf exists
18457 set vsnprintf d_vsnprintf
18460 case "$d_snprintf-$d_vsnprintf" in
18463 Checking whether your snprintf() and vsnprintf() work okay...
18465 $cat >try.c <<'EOCP'
18466 /* v?snprintf testing logic courtesy of Russ Allbery.
18467 * According to C99:
18468 * - if the buffer is too short it still must be \0-terminated
18469 * - if the buffer is too short the potentially required length
18470 * must be returned and not -1
18471 * - if the buffer is NULL the potentially required length
18472 * must be returned and not -1 or core dump
18475 #include <stdarg.h>
18479 int test (char *format, ...)
18484 va_start (args, format);
18485 count = vsnprintf (buf, sizeof buf, format, args);
18492 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
18493 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
18497 if eval $compile; then
18500 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
18502 Your snprintf() and snprintf() don't seem to be working okay.
18504 d_snprintf="$undef"
18505 d_vsnprintf="$undef"
18509 echo "(I can't seem to compile the test program--assuming they don't)"
18510 d_snprintf="$undef"
18511 d_vsnprintf="$undef"
18517 : see if sockatmark exists
18518 set sockatmark d_sockatmark
18521 : see if prototype for sockatmark is available
18523 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
18526 : see if socks5_init exists
18527 set socks5_init d_socks5_init
18530 : see if sprintf returns the length of the string in the buffer as per ANSI
18531 $echo "Checking whether sprintf returns the length of the string..." >&4
18534 #$i_stdlib I_STDLIB
18536 #include <stdlib.h>
18538 #$i_string I_STRING
18540 # include <string.h>
18542 # include <strings.h>
18551 int check (size_t expect, int test) {
18552 size_t got = strlen(buffer);
18556 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
18561 int main(int argc, char **argv) {
18564 check(sprintf(buffer, ""), ++test);
18565 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
18566 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
18573 if eval $compile; then
18577 sprintf returns the length of the string (as ANSI says it should)
18579 d_sprintf_returns_strlen="$define"
18582 sprintf does not return the length of the string (how old is this system?)
18584 d_sprintf_returns_strlen="$undef"
18588 echo "(I can't seem to compile the test program--assuming it doesn't)" >&4
18589 d_sprintf_returns_strlen="$undef"
18593 : see if srand48_r exists
18594 set srand48_r d_srand48_r
18596 case "$d_srand48_r" in
18598 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
18599 case "$d_srand48_r_proto:$usethreads" in
18600 ":define") d_srand48_r_proto=define
18601 set d_srand48_r_proto srand48_r $hdrs
18605 case "$d_srand48_r_proto" in
18607 case "$srand48_r_proto" in
18608 ''|0) try='int srand48_r(long, struct drand48_data*);'
18609 ./protochk "$extern_C $try" $hdrs && srand48_r_proto=I_LS ;;
18611 case "$srand48_r_proto" in
18612 ''|0) d_srand48_r=undef
18614 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
18615 * ) case "$srand48_r_proto" in
18616 REENTRANT_PROTO*) ;;
18617 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
18619 echo "Prototype: $try" ;;
18622 *) case "$usethreads" in
18623 define) echo "srand48_r has no prototype, not using it." >&4 ;;
18630 *) srand48_r_proto=0
18634 : see if srandom_r exists
18635 set srandom_r d_srandom_r
18637 case "$d_srandom_r" in
18639 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
18640 case "$d_srandom_r_proto:$usethreads" in
18641 ":define") d_srandom_r_proto=define
18642 set d_srandom_r_proto srandom_r $hdrs
18646 case "$d_srandom_r_proto" in
18648 case "$srandom_r_proto" in
18649 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
18650 ./protochk "$extern_C $try" $hdrs && srandom_r_proto=I_TS ;;
18652 case "$srandom_r_proto" in
18653 ''|0) d_srandom_r=undef
18655 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
18656 * ) case "$srandom_r_proto" in
18657 REENTRANT_PROTO*) ;;
18658 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
18660 echo "Prototype: $try" ;;
18663 *) case "$usethreads" in
18664 define) echo "srandom_r has no prototype, not using it." >&4 ;;
18671 *) srandom_r_proto=0
18675 : see if prototype for setresgid is available
18677 set d_sresgproto setresgid $i_unistd unistd.h
18680 : see if prototype for setresuid is available
18682 set d_sresuproto setresuid $i_unistd unistd.h
18685 : see if sys/stat.h is available
18686 set sys/stat.h i_sysstat
18689 : see if stat knows about block sizes
18691 echo "Checking to see if your struct stat has st_blocks field..." >&4
18692 set d_statblks stat st_blocks $i_sysstat sys/stat.h
18695 : see if this is a sys/vfs.h system
18696 set sys/vfs.h i_sysvfs
18699 : see if this is a sys/statfs.h system
18700 set sys/statfs.h i_sysstatfs
18703 : Check for statfs_s
18705 echo "Checking to see if your system supports struct statfs..." >&4
18706 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
18708 case "$d_statfs_s" in
18709 "$define") echo "Yes, it does." ;;
18710 *) echo "No, it doesn't." ;;
18714 : see if struct statfs knows about f_flags
18715 case "$d_statfs_s" in
18718 echo "Checking to see if your struct statfs has f_flags field..." >&4
18719 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
18723 set d_statfs_f_flags
18727 case "$d_statfs_f_flags" in
18728 "$define") echo "Yes, it does." ;;
18729 *) echo "No, it doesn't." ;;
18732 : see what flavor, if any, of static inline is supported
18734 echo "Checking to see if your system supports static inline..."
18735 $cat > try.c <<'EOCP'
18736 #include <stdlib.h>
18737 extern int f_via_a(int x);
18738 extern int f_via_b(int x);
18739 int main(int argc, char **argv)
18748 return EXIT_SUCCESS;
18751 return EXIT_FAILURE;
18755 $cat > a.c <<'EOCP'
18756 static INLINE int f(int x) {
18767 $cat > b.c <<'EOCP'
18768 extern int f(int x);
18776 # Respect a hint (or previous) value for perl_static_inline, if there is one.
18777 case "$perl_static_inline" in
18778 '') # Check the various possibilities, and break out on success.
18779 # For gcc, prefer __inline__, which will still permit
18780 # cflags.SH to add in -ansi.
18781 case "$gccversion" in
18782 '') xxx="inline __inline__ __inline _inline";;
18783 *) xxx="__inline__ inline __inline _inline";;
18785 for inline in $xxx; do
18786 set try -DINLINE=$inline a.c
18787 if eval $compile && $run ./try; then
18788 # Now make sure there is no external linkage of static
18790 set try -DINLINE=$inline -DUSE_B a.c b.c
18791 if eval $compile && $run ./try; then
18792 $echo "Your compiler supports static $inline, " >&4
18793 $echo "but it also creates an external definition," >&4
18794 $echo "so I won't use it." >&4
18797 $echo "Your compiler supports static $inline." >&4
18799 perl_static_inline="static $inline";
18803 $echo "Your compiler does NOT support static $inline." >&4
18808 *inline*) # Some variant of inline exists.
18809 echo "Keeping your $hint value of $perl_static_inline."
18812 static) # No inline capabilities
18813 echo "Keeping your $hint value of $perl_static_inline."
18816 *) # Unrecognized previous value -- blindly trust the supplied
18817 # value and hope it makes sense. Use old value for
18818 # d_static_inline, if there is one.
18819 echo "Keeping your $hint value of $perl_static_inline."
18820 case "$d_static_inline" in
18822 *) val=$d_static_inline ;;
18826 # Fallback to plain 'static' if nothing worked.
18827 case "$perl_static_inline" in
18829 perl_static_inline="static"
18833 set d_static_inline
18835 $rm -f a.[co] b.[co]
18838 : Check stream access
18840 Checking how to access stdio streams by file descriptor number...
18842 case "$stdio_stream_array" in
18843 '') $cat >try.c <<EOCP
18846 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
18850 for s in _iob __iob __sF
18852 set try -DSTDIO_STREAM_ARRAY=$s
18853 if eval $compile; then
18854 case "`$run ./try`" in
18855 yes) stdio_stream_array=$s; break ;;
18861 case "$stdio_stream_array" in
18863 I can't figure out how to access stdio streams by file descriptor number.
18865 d_stdio_stream_array="$undef"
18868 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
18870 d_stdio_stream_array="$define"
18874 : see if strcoll exists
18875 set strcoll d_strcoll
18878 : check for structure copying
18880 echo "Checking to see if your C compiler can copy structs..." >&4
18881 $cat >try.c <<'EOCP'
18891 if $cc -c try.c >/dev/null 2>&1 ; then
18893 echo "Yup, it can."
18896 echo "Nope, it can't."
18902 : see if strerror and/or sys_errlist[] exist
18904 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
18905 if set strerror val -f d_strerror; eval $csym; $val; then
18906 echo 'strerror() found.' >&4
18907 d_strerror="$define"
18908 d_strerrm='strerror(e)'
18909 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18910 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
18911 d_syserrlst="$define"
18913 echo "(Since you don't have sys_errlist[], strerror() is welcome.)"
18914 d_syserrlst="$undef"
18916 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
18917 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
18918 echo 'strerror() found in string header.' >&4
18919 d_strerror="$define"
18920 d_strerrm='strerror(e)'
18921 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18922 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
18923 d_syserrlst="$define"
18925 echo "(You don't appear to have any sys_errlist[], how can this be?)"
18926 d_syserrlst="$undef"
18928 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18929 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
18930 d_strerror="$undef"
18931 d_syserrlst="$define"
18932 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
18934 echo 'strerror() and sys_errlist[] NOT found.' >&4
18935 d_strerror="$undef"
18936 d_syserrlst="$undef"
18937 d_strerrm='"unknown"'
18941 : see if strerror_r exists
18942 set strerror_r d_strerror_r
18944 case "$d_strerror_r" in
18946 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
18947 case "$d_strerror_r_proto:$usethreads" in
18948 ":define") d_strerror_r_proto=define
18949 set d_strerror_r_proto strerror_r $hdrs
18953 case "$d_strerror_r_proto" in
18955 case "$strerror_r_proto" in
18956 ''|0) try='int strerror_r(int, char*, size_t);'
18957 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBW ;;
18959 case "$strerror_r_proto" in
18960 ''|0) try='int strerror_r(int, char*, int);'
18961 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBI ;;
18963 case "$strerror_r_proto" in
18964 ''|0) try='char* strerror_r(int, char*, size_t);'
18965 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=B_IBW ;;
18967 case "$strerror_r_proto" in
18968 ''|0) d_strerror_r=undef
18970 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
18971 * ) case "$strerror_r_proto" in
18972 REENTRANT_PROTO*) ;;
18973 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
18975 echo "Prototype: $try" ;;
18978 *) case "$usethreads" in
18979 define) echo "strerror_r has no prototype, not using it." >&4 ;;
18986 *) strerror_r_proto=0
18990 : see if strftime exists
18991 set strftime d_strftime
18994 : see if strlcat exists
18995 set strlcat d_strlcat
18998 : see if strlcpy exists
18999 set strlcpy d_strlcpy
19002 : see if strtod exists
19003 set strtod d_strtod
19006 : see if strtol exists
19007 set strtol d_strtol
19010 : see if strtold exists
19011 set strtold d_strtold
19014 : see if strtoll exists
19015 set strtoll d_strtoll
19018 case "$d_longlong-$d_strtoll" in
19021 Checking whether your strtoll() works okay...
19023 $cat >try.c <<'EOCP'
19026 #define strtoll __strtoll
19029 #define strtoll _strtoll
19032 extern long long int strtoll(char *s, char **, int);
19033 static int bad = 0;
19034 int check(char *s, long long ell, int een) {
19037 gll = strtoll(s, 0, 10);
19038 if (!((gll == ell) && (errno == een)))
19042 check(" 1", 1LL, 0);
19043 check(" 0", 0LL, 0);
19044 check("-1", -1LL, 0);
19045 check("-9223372036854775808", -9223372036854775808LL, 0);
19046 check("-9223372036854775808", -9223372036854775808LL, 0);
19047 check(" 9223372036854775807", 9223372036854775807LL, 0);
19048 check("-9223372036854775808", -9223372036854775808LL, 0);
19049 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
19050 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
19056 if eval $compile; then
19059 ok) echo "Your strtoll() seems to be working okay." ;;
19061 Your strtoll() doesn't seem to be working okay.
19067 echo "(I can't seem to compile the test program--assuming it doesn't)"
19073 : see if strtoq exists
19074 set strtoq d_strtoq
19077 : see if strtoul exists
19078 set strtoul d_strtoul
19081 case "$d_strtoul" in
19084 Checking whether your strtoul() works okay...
19086 $cat >try.c <<'EOCP'
19089 extern unsigned long int strtoul(char *s, char **, int);
19090 static int bad = 0;
19091 void check(char *s, unsigned long eul, int een) {
19094 gul = strtoul(s, 0, 10);
19095 if (!((gul == eul) && (errno == een)))
19099 check(" 1", 1L, 0);
19100 check(" 0", 0L, 0);
19102 case "$longsize" in
19104 $cat >>try.c <<'EOCP'
19105 check("18446744073709551615", 18446744073709551615UL, 0);
19106 check("18446744073709551616", 18446744073709551615UL, ERANGE);
19107 #if 0 /* strtoul() for /^-/ strings is undefined. */
19108 check("-1", 18446744073709551615UL, 0);
19109 check("-18446744073709551614", 2, 0);
19110 check("-18446744073709551615", 1, 0);
19111 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
19112 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
19117 $cat >>try.c <<'EOCP'
19118 check("4294967295", 4294967295UL, 0);
19119 check("4294967296", 4294967295UL, ERANGE);
19120 #if 0 /* strtoul() for /^-/ strings is undefined. */
19121 check("-1", 4294967295UL, 0);
19122 check("-4294967294", 2, 0);
19123 check("-4294967295", 1, 0);
19124 check("-4294967296", 4294967295UL, ERANGE);
19125 check("-4294967297", 4294967295UL, ERANGE);
19130 : Should we write these tests to be more portable by sprintf-ing
19131 : ~0 and then manipulating that char string as input for strtol?
19134 $cat >>try.c <<'EOCP'
19141 if eval $compile; then
19142 case "`$run ./try`" in
19143 ok) echo "Your strtoul() seems to be working okay." ;;
19145 Your strtoul() doesn't seem to be working okay.
19151 echo "(I can't seem to compile the test program--assuming it doesn't)"
19157 : see if strtoull exists
19158 set strtoull d_strtoull
19161 case "$d_longlong-$d_strtoull" in
19164 Checking whether your strtoull() works okay...
19166 $cat >try.c <<'EOCP'
19169 #define strtoull __strtoull
19172 extern unsigned long long int strtoull(char *s, char **, int);
19173 static int bad = 0;
19174 int check(char *s, long long eull, int een) {
19177 gull = strtoull(s, 0, 10);
19178 if (!((gull == eull) && (errno == een)))
19182 check(" 1", 1LL, 0);
19183 check(" 0", 0LL, 0);
19184 check("18446744073709551615", 18446744073709551615ULL, 0);
19185 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
19186 #if 0 /* strtoull() for /^-/ strings is undefined. */
19187 check("-1", 18446744073709551615ULL, 0);
19188 check("-18446744073709551614", 2LL, 0);
19189 check("-18446744073709551615", 1LL, 0);
19190 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
19191 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
19198 if eval $compile; then
19199 case "`$run ./try`" in
19200 ok) echo "Your strtoull() seems to be working okay." ;;
19202 Your strtoull() doesn't seem to be working okay.
19204 d_strtoull="$undef"
19208 echo "(I can't seem to compile the test program--assuming it doesn't)"
19209 d_strtoull="$undef"
19214 : see if strtouq exists
19215 set strtouq d_strtouq
19218 case "$d_strtouq" in
19221 Checking whether your strtouq() works okay...
19223 $cat >try.c <<'EOCP'
19226 extern unsigned long long int strtouq(char *s, char **, int);
19227 static int bad = 0;
19228 void check(char *s, unsigned long long eull, int een) {
19229 unsigned long long gull;
19231 gull = strtouq(s, 0, 10);
19232 if (!((gull == eull) && (errno == een)))
19236 check(" 1", 1LL, 0);
19237 check(" 0", 0LL, 0);
19238 check("18446744073709551615", 18446744073709551615ULL, 0);
19239 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
19240 #if 0 /* strtouq() for /^-/ strings is undefined. */
19241 check("-1", 18446744073709551615ULL, 0);
19242 check("-18446744073709551614", 2LL, 0);
19243 check("-18446744073709551615", 1LL, 0);
19244 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
19245 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
19253 if eval $compile; then
19254 case "`$run ./try`" in
19255 ok) echo "Your strtouq() seems to be working okay." ;;
19257 Your strtouq() doesn't seem to be working okay.
19263 echo "(I can't seem to compile the test program--assuming it doesn't)"
19269 : see if strxfrm exists
19270 set strxfrm d_strxfrm
19273 : see if symlink exists
19274 set symlink d_symlink
19277 : see if syscall exists
19278 set syscall d_syscall
19281 : see if prototype for syscall is available
19283 set d_syscallproto syscall $i_unistd unistd.h
19286 : see if sysconf exists
19287 set sysconf d_sysconf
19290 : see if system exists
19291 set system d_system
19294 : see if tcgetpgrp exists
19295 set tcgetpgrp d_tcgetpgrp
19298 : see if tcsetpgrp exists
19299 set tcsetpgrp d_tcsetpgrp
19302 : see if prototype for telldir is available
19304 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
19307 : see if time exists
19309 if test "X$d_time" = X -o X"$timetype" = X; then
19310 if set time val -f d_time; eval $csym; $val; then
19311 echo 'time() found.' >&4
19313 rp="What is the type returned by time() on this system?"
19314 set time_t timetype long stdio.h sys/types.h
19317 echo 'time() not found, hope that will do.' >&4
19325 : see if timegm exists
19326 set timegm d_timegm
19329 : see if this is a sys/times.h system
19330 set sys/times.h i_systimes
19333 : see if times exists
19335 if set times val -f d_times; eval $csym; $val; then
19336 echo 'times() found.' >&4
19339 case "$i_systimes" in
19340 "$define") inc='sys/times.h';;
19342 rp="What is the type returned by times() on this system?"
19343 set clock_t clocktype long stdio.h sys/types.h $inc
19346 echo 'times() NOT found, hope that will do.' >&4
19351 : see if tmpnam_r exists
19352 set tmpnam_r d_tmpnam_r
19354 case "$d_tmpnam_r" in
19356 hdrs="$i_systypes sys/types.h define stdio.h "
19357 case "$d_tmpnam_r_proto:$usethreads" in
19358 ":define") d_tmpnam_r_proto=define
19359 set d_tmpnam_r_proto tmpnam_r $hdrs
19363 case "$d_tmpnam_r_proto" in
19365 case "$tmpnam_r_proto" in
19366 ''|0) try='char* tmpnam_r(char*);'
19367 ./protochk "$extern_C $try" $hdrs && tmpnam_r_proto=B_B ;;
19369 case "$tmpnam_r_proto" in
19370 ''|0) d_tmpnam_r=undef
19372 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
19373 * ) case "$tmpnam_r_proto" in
19374 REENTRANT_PROTO*) ;;
19375 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
19377 echo "Prototype: $try" ;;
19380 *) case "$usethreads" in
19381 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
19388 *) tmpnam_r_proto=0
19392 : see if truncate exists
19393 set truncate d_truncate
19396 : see if ttyname_r exists
19397 set ttyname_r d_ttyname_r
19399 case "$d_ttyname_r" in
19401 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
19402 case "$d_ttyname_r_proto:$usethreads" in
19403 ":define") d_ttyname_r_proto=define
19404 set d_ttyname_r_proto ttyname_r $hdrs
19408 case "$d_ttyname_r_proto" in
19410 case "$ttyname_r_proto" in
19411 ''|0) try='int ttyname_r(int, char*, size_t);'
19412 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBW ;;
19414 case "$ttyname_r_proto" in
19415 ''|0) try='int ttyname_r(int, char*, int);'
19416 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBI ;;
19418 case "$ttyname_r_proto" in
19419 ''|0) try='char* ttyname_r(int, char*, int);'
19420 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=B_IBI ;;
19422 case "$ttyname_r_proto" in
19423 ''|0) d_ttyname_r=undef
19425 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
19426 * ) case "$ttyname_r_proto" in
19427 REENTRANT_PROTO*) ;;
19428 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
19430 echo "Prototype: $try" ;;
19433 *) case "$usethreads" in
19434 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
19441 *) ttyname_r_proto=0
19445 : see if tzname[] exists
19447 if set tzname val -a d_tzname; eval $csym; $val; then
19449 echo 'tzname[] found.' >&4
19452 echo 'tzname[] NOT found.' >&4
19457 : Check if is a multiplatform env
19459 darwin) multiarch="$define" ;;
19461 case "$multiarch" in
19462 ''|[nN]*) multiarch="$undef" ;;
19465 : check for ordering of bytes in a UV
19467 case "$multiarch" in
19470 You seem to be doing a multiarchitecture build,
19471 skipping the byteorder check.
19477 case "$byteorder" in
19480 In the following, larger digits indicate more significance. A big-endian
19481 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
19482 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
19483 machines may have weird orders like 3412. A Cray will report 87654321,
19484 an Alpha will report 12345678. If the test program works the default is
19486 I'm now running the test program...
19490 #$i_stdlib I_STDLIB
19492 #include <stdlib.h>
19494 #include <sys/types.h>
19495 typedef $uvtype UV;
19505 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
19507 u.l = (UV)0x04030201;
19508 for (i = 0; i < $uvsize; i++)
19509 printf("%c", u.c[i]+'0');
19516 if eval $compile && $run ./try > /dev/null; then
19519 [1-4][1-4][1-4][1-4]|12345678|87654321)
19520 echo "(The test program ran ok.)"
19521 echo "byteorder=$dflt"
19524 ????|????????) echo "(The test program ran ok.)" ;;
19525 *) echo "(The test program didn't run right for some reason.)" ;;
19530 (I can't seem to compile the test program. Guessing big-endian...)
19533 case "$xxx_prompt" in
19535 rp="What is the order of bytes in $uvtype?"
19548 : Checking 32bit alignedness
19551 Checking to see whether you can access character data unalignedly...
19553 case "$d_u32align" in
19554 '') $cat >try.c <<EOCP
19556 #$i_stdlib I_STDLIB
19558 #include <stdlib.h>
19560 #define U32 $u32type
19561 #define BYTEORDER 0x$byteorder
19563 #include <signal.h>
19565 $signal_t bletch(int s) { exit(4); }
19568 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
19569 volatile U8 buf[8];
19573 if (sizeof(U32) != 4) {
19574 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
19581 signal(SIGBUS, bletch);
19593 for (i = 0; i < 4; i++) {
19594 up = (U32*)(buf + i);
19595 if (! ((*up == 1 << (8*i)) || /* big-endian */
19596 (*up == 1 << (8*(3-i))) /* little-endian */
19600 printf("read failed (%x)\n", *up);
19606 for (i = 0; i < 4; i++) {
19607 up = (U32*)(buf + i);
19609 if (*up != 0xBeef) {
19610 printf("write failed (%x)\n", *up);
19624 if eval $compile_ok; then
19625 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
19626 $run ./try 2>&1 >/dev/null
19629 You can access character data pretty unalignedly.
19631 d_u32align="$undef"
19634 It seems that you must access character data in an aligned manner.
19636 d_u32align="$define"
19640 rp='Can you access character data at unaligned addresses?'
19644 [yY]*) d_u32align="$undef" ;;
19645 *) d_u32align="$define" ;;
19652 : see if ualarm exists
19653 set ualarm d_ualarm
19656 : see if umask exists
19660 : see if unordered exists
19661 set unordered d_unordered
19664 : see if unsetenv exists
19665 set unsetenv d_unsetenv
19668 : see if usleep exists
19669 set usleep d_usleep
19672 : see if prototype for usleep is available
19674 set d_usleepproto usleep $i_unistd unistd.h
19677 : see if ustat exists
19681 : see if closedir exists
19682 set closedir d_closedir
19685 case "$d_closedir" in
19688 echo "Checking whether closedir() returns a status..." >&4
19690 #$i_dirent I_DIRENT /**/
19691 #$i_sysdir I_SYS_DIR /**/
19692 #$i_sysndir I_SYS_NDIR /**/
19693 #$i_systypes I_SYS_TYPES /**/
19695 #if defined(I_SYS_TYPES)
19696 #include <sys/types.h>
19698 #if defined(I_DIRENT)
19699 #include <dirent.h>
19702 #include <sys/ndir.h>
19706 #include <ndir.h> /* may be wrong in the future */
19708 #include <sys/dir.h>
19713 int main() { return closedir(opendir(".")); }
19716 if eval $compile_ok; then
19717 if $run ./try > /dev/null 2>&1 ; then
19718 echo "Yes, it does."
19721 echo "No, it doesn't."
19725 echo "(I can't seem to compile the test program--assuming it doesn't)"
19733 set d_void_closedir
19737 : see if there is a wait4
19741 : see if waitpid exists
19742 set waitpid d_waitpid
19747 $cat >try.c <<'EOCP'
19753 return (wcscmp (s, s) ? 1 : 0);
19758 if eval $compile; then
19761 0) echo "A working wcscmp() found." >&4
19763 *) echo "wcscmp() found, but it doesn't work" >&4
19767 echo "wcscmp() NOT found." >&4
19773 : see if wcstombs exists
19774 set wcstombs d_wcstombs
19779 $cat >try.c <<'EOCP'
19784 wchar_t dst[4], *src = L" ";
19786 return (wcsxfrm (dst, src, 1) ? errno ? errno : 0 : 1);
19791 if eval $compile; then
19794 0) echo "A working wcsxfrm() found." >&4
19796 *) echo "wcsxfrm() found, but it doesn't work" >&4
19800 echo "wcsxfrm() NOT found." >&4
19806 : see if wctomb exists
19807 set wctomb d_wctomb
19810 : see if writev exists
19811 set writev d_writev
19814 : check for alignment requirements
19816 case "$alignbytes" in
19817 '') echo "Checking alignment constraints..." >&4
19818 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
19819 $cat >try.c <<'EOCP'
19820 typedef long double NV;
19823 $cat >try.c <<'EOCP'
19827 $cat >>try.c <<'EOCP'
19835 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
19840 if eval $compile_ok; then
19844 echo "(I can't seem to compile the test program...)"
19846 case "$multiarch" in
19848 : The usual safe value is 8, but Darwin with -Duselongdouble
19849 : needs 16. Hence, we will take 8 as a minimum, but allow
19850 : Configure to pick a larger value if needed.
19851 if $test "$dflt" -lt 8; then
19853 echo "Setting alignment to 8 for multiarch support.">&4
19858 *) dflt="$alignbytes"
19861 rp="Doubles must be aligned on a how-many-byte boundary?"
19866 : set the base revision
19869 : length of character in bytes. Is always 1, otherwise it is not C
19870 : This used to be a test using sizeof
19873 : Check for the number of bits in a character
19874 case "$charbits" in
19875 '') echo "Checking how long a character is (in bits)..." >&4
19882 for (c = 1, n = 0; c; c <<= 1, n++) ;
19883 printf ("%d\n", n);
19888 if eval $compile_ok; then
19892 echo "(I can't seem to compile the test program. Guessing...)"
19899 rp="What is the length of a character (in bits)?"
19903 case "$charbits" in
19906 Your system has an unsigned character size of $charbits bits, which
19907 is rather unusual (normally it is 8 bits). Perl likely will not work
19908 correctly on your system, with subtle bugs in various places.
19910 rp='Do you really want to continue?'
19914 [yY]) echo >&4 "Okay, continuing." ;;
19919 : how do we concatenate cpp tokens here?
19921 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
19922 $cat >cpp_stuff.c <<'EOCP'
19923 #define RCAT(a,b)a/**/b
19924 #define ACAT(a,b)a ## b
19928 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
19929 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
19930 echo "Oh! Smells like ANSI's been here." >&4
19931 echo "We can catify or stringify, separately or together!"
19933 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
19934 echo "Ah, yes! The good old days!" >&4
19935 echo "However, in the good old days we don't know how to stringify and"
19936 echo "catify at the same time."
19940 Hmm, I don't seem to be able to concatenate tokens with your cpp.
19941 You're going to have to edit the values of CAT[2-5] in config.h...
19943 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
19947 : see if this is a db.h system
19953 : Check db version.
19955 echo "Checking Berkeley DB version ..." >&4
19961 #include <sys/types.h>
19963 #$i_stdlib I_STDLIB
19965 #include <stdlib.h>
19968 int main(int argc, char *argv[])
19970 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
19971 int Major, Minor, Patch ;
19972 unsigned long Version ;
19973 (void)db_version(&Major, &Minor, &Patch) ;
19975 printf("%d %d %d %d %d %d\n",
19976 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
19977 Major, Minor, Patch);
19980 printf("You have Berkeley DB Version 2 or greater.\n");
19982 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
19983 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
19984 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
19985 Major, Minor, Patch) ;
19987 /* check that db.h & libdb are compatible */
19988 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
19989 printf("db.h and libdb are incompatible.\n") ;
19993 printf("db.h and libdb are compatible.\n") ;
19995 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
19996 + DB_VERSION_PATCH ;
19998 /* needs to be >= 2.3.4 */
19999 if (Version < 2003004) {
20000 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
20001 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
20007 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
20012 printf("You have Berkeley DB Version 1.\n");
20013 exit(0); /* DB version < 2: the coast is clear. */
20015 exit(1); /* <db.h> not Berkeley DB? */
20021 if eval $compile_ok && $run ./try; then
20022 echo 'Looks OK.' >&4
20024 db_version_major=$1
20025 db_version_minor=$2
20026 db_version_patch=$3
20028 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
20032 : Remove db from list of libraries to use
20033 echo "Removing unusable -ldb from library list" >&4
20034 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
20037 echo "libs = $libs" >&4
20047 : Check the return type needed for hash
20049 echo "Checking return type needed for hash for Berkeley DB ..." >&4
20055 #include <sys/types.h>
20058 #ifndef DB_VERSION_MAJOR
20059 u_int32_t hash_cb (const void* ptr, size_t size)
20065 info.hash = hash_cb;
20069 if $cc $ccflags -c try.c >try.out 2>&1 ; then
20070 if $contains warning try.out >>/dev/null 2>&1 ; then
20073 db_hashtype='u_int32_t'
20076 : XXX Maybe we should just give up here.
20077 db_hashtype=u_int32_t
20079 echo "Help: I can't seem to compile the db test program." >&4
20080 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
20083 echo "Your version of Berkeley DB uses $db_hashtype for hash."
20085 *) db_hashtype=u_int32_t
20090 : Check the return type needed for prefix
20092 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
20098 #include <sys/types.h>
20101 #ifndef DB_VERSION_MAJOR
20102 size_t prefix_cb (const DBT *key1, const DBT *key2)
20108 info.prefix = prefix_cb;
20112 if $cc $ccflags -c try.c >try.out 2>&1 ; then
20113 if $contains warning try.out >>/dev/null 2>&1 ; then
20114 db_prefixtype='int'
20116 db_prefixtype='size_t'
20119 db_prefixtype='size_t'
20120 : XXX Maybe we should just give up here.
20122 echo "Help: I can't seem to compile the db test program." >&4
20123 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
20126 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
20128 *) db_prefixtype='size_t'
20132 : How can we generate normalized random numbers ?
20134 echo "Using our internal random number implementation..." >&4
20137 *-Dmy_rand=*|*-Dmy_srand=*)
20138 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
20139 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
20140 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
20141 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
20145 randfunc=Perl_drand48
20146 drand01="Perl_drand48()"
20147 seedfunc="Perl_drand48_init"
20151 : Determine if this is an EBCDIC system
20153 echo "Determining whether or not we are on an EBCDIC system..." >&4
20154 $cat >try.c <<'EOM'
20157 if ('M'==0xd4) return 0;
20164 if eval $compile_ok; then
20165 if $run ./try; then
20166 echo "You seem to speak EBCDIC." >&4
20169 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
20172 echo "I'm unable to compile the test program." >&4
20173 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
20179 : Check how to flush
20182 Checking how to flush all pending stdio output...
20184 # I only know how to find the first 32 possibly open files on SunOS.
20185 # See also hints/sunos_4_1.sh and util.c --AD
20187 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
20189 $cat >>try.c <<EOCP
20191 #$i_stdlib I_STDLIB
20193 #include <stdlib.h>
20195 #$i_unistd I_UNISTD
20197 # include <unistd.h>
20199 #$d_sysconf HAS_SYSCONF
20200 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
20201 #ifdef HAS_STDIO_STREAM_ARRAY
20202 # define STDIO_STREAM_ARRAY $stdio_stream_array
20207 p = fopen("try.out", "w");
20211 # ifdef TRY_FPRINTF
20215 #ifdef TRY_FFLUSH_NULL
20218 #ifdef TRY_FFLUSH_ALL
20220 long open_max = -1;
20221 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
20222 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
20224 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
20225 open_max = sysconf(_SC_OPEN_MAX);
20228 open_max = FOPEN_MAX;
20231 open_max = OPEN_MAX;
20240 # ifdef HAS_STDIO_STREAM_ARRAY
20241 if (open_max > 0) {
20243 for (i = 0; i < open_max; i++)
20244 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
20245 STDIO_STREAM_ARRAY[i]._file < open_max &&
20246 STDIO_STREAM_ARRAY[i]._flag)
20247 fflush(&STDIO_STREAM_ARRAY[i]);
20255 : first we have to find out how _not_ to flush
20257 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
20259 set try -DTRY_FPUTC
20260 if eval $compile; then
20261 $run ./try 2>/dev/null
20264 if $test ! -s try.out -a "X$code" = X42; then
20270 set try -DTRY_FPRINTF
20271 if eval $compile; then
20272 $run ./try 2>/dev/null
20275 if $test ! -s try.out -a "X$code" = X42; then
20276 output=-DTRY_FPRINTF
20282 : check for fflush NULL behavior
20283 case "$fflushNULL" in
20284 '') set try -DTRY_FFLUSH_NULL $output
20285 if eval $compile; then
20286 $run ./try 2>/dev/null
20289 if $test -s try.out -a "X$code" = X42; then
20290 fflushNULL="`$cat try.out`"
20292 if $test "X$code" != X42; then
20294 (If this test failed, don't worry, we'll try another method shortly.)
20299 $rm -f core try.core core.try.*
20300 case "$fflushNULL" in
20302 Your fflush(NULL) works okay for output streams.
20303 Let's see if it clobbers input pipes...
20305 # As of mid-March 2000 all versions of Solaris appear to have a stdio
20306 # bug that improperly flushes the input end of pipes. So we avoid the
20307 # autoflush on fork/system/exec support for now. :-(
20308 $cat >tryp.c <<EOCP
20311 main(int argc, char **argv)
20317 while ((i = getc(stdin)) != -1
20318 && (*bp++ = i) != '\n'
20319 && bp < &buf[1024])
20322 fprintf(stdout, "%s", buf);
20330 fflushNULL="$define"
20332 if eval $compile; then
20334 # Copy the .c file to the remote host ($to is an ssh-alike if targethost is set)
20335 if $test "X$targethost" != X; then
20338 $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
20340 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
20342 if cmp tryp.c tryp.out >/dev/null 2>&1; then
20344 fflush(NULL) seems to behave okay with input streams.
20346 fflushNULL="$define"
20349 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
20351 fflushNULL="$undef"
20354 $rm -f core tryp.c tryp.core core.tryp.*
20357 Your fflush(NULL) isn't working (contrary to ANSI C).
20359 fflushNULL="$undef"
20362 Cannot figure out whether your fflush(NULL) works or not.
20363 I'm assuming it doesn't (contrary to ANSI C).
20365 fflushNULL="$undef"
20369 $define|true|[yY]*)
20370 fflushNULL="$define"
20373 fflushNULL="$undef"
20376 : check explicit looping only if NULL did not work, and if the pipe
20377 : bug does not show up on an explicit flush too
20378 case "$fflushNULL" in
20380 $cat >tryp.c <<EOCP
20383 main(int argc, char **argv)
20389 while ((i = getc(stdin)) != -1
20390 && (*bp++ = i) != '\n'
20391 && bp < &buf[1024])
20394 fprintf(stdout, "%s", buf);
20403 if eval $compile; then
20405 if $test "X$targethost" != X; then
20408 $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
20410 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
20412 if cmp tryp.c tryp.out >/dev/null 2>&1; then
20414 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
20416 : now check for fflushall behaviour
20417 case "$fflushall" in
20418 '') set try -DTRY_FFLUSH_ALL $output
20419 if eval $compile; then
20421 (Now testing the other method--but note that this also may fail.)
20423 $run ./try 2>/dev/null
20426 if $test -s try.out -a "X$code" = X42; then
20427 fflushall="`$cat try.out`"
20431 case "$fflushall" in
20433 Whew. Flushing explicitly all the stdio streams works.
20435 fflushall="$define"
20438 Sigh. Flushing explicitly all the stdio streams doesn't work.
20443 Cannot figure out whether flushing stdio streams explicitly works or not.
20444 I'm assuming it doesn't.
20450 "$define"|true|[yY]*)
20451 fflushall="$define"
20459 All is futile. Even fflush(stdin) clobbers input pipes!
20466 $rm -f core tryp.c tryp.core core.tryp.*
20468 *) fflushall="$undef"
20472 case "$fflushNULL$fflushall" in
20475 OK, I give up. I cannot figure out how to flush pending stdio output.
20476 We won't be flushing handles at all before fork/exec/popen.
20482 : Store the full pathname to the ar program for use in the C program
20483 : Respect a hint or command line value for full_ar.
20488 : Store the full pathname to the sed program for use in the C program
20491 : see what type gids are declared as in the kernel
20493 echo "Looking for the type for group ids returned by getgid()."
20494 set gid_t gidtype xxx stdio.h sys/types.h
20498 xxx=`./findhdr sys/user.h`
20499 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
20501 unsigned) dflt="$1 $2" ;;
20505 *) dflt="$gidtype";;
20508 gid_t) echo "gid_t found." ;;
20509 *) rp="What is the type for group ids returned by getgid()?"
20515 : Check the size of GID
20518 *_t) zzz="$gidtype" ;;
20521 echo "Checking the size of $zzz..." >&4
20523 #include <sys/types.h>
20525 #$i_stdlib I_STDLIB
20527 #include <stdlib.h>
20530 printf("%d\n", (int)sizeof($gidtype));
20535 if eval $compile_ok; then
20539 echo "(I can't execute the test program--guessing $gidsize.)" >&4
20542 echo "Your $zzz is $gidsize bytes long."
20547 echo "(I can't compile the test program--guessing $gidsize.)" >&4
20551 : Check if GID is signed
20554 *_t) zzz="$gidtype" ;;
20557 echo "Checking the sign of $zzz..." >&4
20559 #include <sys/types.h>
20570 if eval $compile; then
20574 echo "(I can't execute the test program--guessing unsigned.)" >&4
20578 1) echo "Your $zzz is unsigned." ;;
20579 -1) echo "Your $zzz is signed." ;;
20585 echo "(I can't compile the test program--guessing unsigned.)" >&4
20589 : Check 64bit sizes
20592 if $test X"$quadtype" != X; then
20594 echo "Checking how to print 64-bit integers..." >&4
20596 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
20597 $cat >try.c <<'EOCP'
20598 #include <sys/types.h>
20601 int q = 12345678901;
20602 printf("%ld\n", q);
20606 if eval $compile; then
20610 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
20611 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
20612 echo "We will use %d."
20618 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
20619 $cat >try.c <<'EOCP'
20620 #include <sys/types.h>
20623 long q = 12345678901;
20624 printf("%ld\n", q);
20628 if eval $compile; then
20632 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
20633 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
20634 echo "We will use %ld."
20640 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
20641 $cat >try.c <<'EOCP'
20642 #include <sys/types.h>
20643 #include <inttypes.h>
20646 int64_t q = 12345678901;
20647 printf("%" PRId64 "\n", q);
20651 if eval $compile; then
20655 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
20656 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
20657 echo "We will use the C9X style."
20663 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
20665 #include <sys/types.h>
20668 $quadtype q = 12345678901;
20669 printf("%Ld\n", q);
20673 if eval $compile; then
20677 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
20678 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
20679 echo "We will use %Ld."
20685 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
20686 $cat >try.c <<'EOCP'
20687 #include <sys/types.h>
20690 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
20691 printf("%lld\n", q);
20695 if eval $compile; then
20699 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
20700 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
20701 echo "We will use the %lld style."
20707 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
20709 #include <sys/types.h>
20712 $quadtype q = 12345678901;
20713 printf("%qd\n", q);
20717 if eval $compile; then
20721 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
20722 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
20723 echo "We will use %qd."
20729 if $test X"$sPRId64" = X; then
20730 echo "Cannot figure out how to print 64-bit integers." >&4
20737 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
20738 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
20740 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
20741 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
20745 : Check format strings for internal types
20747 $echo "Checking the format strings to be used for Perl's internal types..." >&4
20749 if $test X"$ivsize" = X8; then
20750 ivdformat="$sPRId64"
20751 uvuformat="$sPRIu64"
20752 uvoformat="$sPRIo64"
20753 uvxformat="$sPRIx64"
20754 uvXUformat="$sPRIXU64"
20756 if $test X"$ivsize" = X"$longsize"; then
20763 if $test X"$ivsize" = X"$intsize"; then
20771 if $test X"$ivsize" = X"$shortsize"; then
20782 if $test X"$usequadmath" = X"$define"; then
20790 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
20791 nveformat="$sPRIeldbl"
20792 nvfformat="$sPRIfldbl"
20793 nvgformat="$sPRIgldbl"
20794 nvEUformat="$sPRIEUldbl"
20795 nvFUformat="$sPRIFUldbl"
20796 nvGUformat="$sPRIGUldbl"
20807 case "$ivdformat" in
20808 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
20813 : Check format string for GID
20816 $echo "Checking the format string to be used for gids..." >&4
20819 -1) if $test X"$gidsize" = X"$ivsize"; then
20820 gidformat="$ivdformat"
20822 if $test X"$gidsize" = X"$longsize"; then
20825 if $test X"$gidsize" = X"$intsize"; then
20828 if $test X"$gidsize" = X"$shortsize"; then
20835 *) if $test X"$gidsize" = X"$uvsize"; then
20836 gidformat="$uvuformat"
20838 if $test X"$gidsize" = X"$longsize"; then
20841 if $test X"$gidsize" = X"$intsize"; then
20844 if $test X"$gidsize" = X"$shortsize"; then
20853 : see if getgroups exists
20854 set getgroups d_getgrps
20857 : see if setgroups exists
20858 set setgroups d_setgrps
20861 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
20863 case "$d_getgrps$d_setgrps" in
20865 case "$groupstype" in
20866 '') dflt="$gidtype" ;;
20867 *) dflt="$groupstype" ;;
20870 What type of pointer is the second argument to getgroups() and setgroups()?
20871 Usually this is the same as group ids, $gidtype, but not always.
20874 rp='What type pointer is the second argument to getgroups() and setgroups()?'
20878 *) groupstype="$gidtype";;
20881 : check whether make sets MAKE
20883 echo "Checking if your $make program sets \$(MAKE)..." >&4
20884 case "$make_set_make" in
20886 $sed 's/^X //' > testmake.mak << 'EOF'
20888 X @echo 'maketemp="$(MAKE)"'
20890 case "`$make -f testmake.mak 2>/dev/null`" in
20891 *maketemp=*) make_set_make='#' ;;
20892 *) make_set_make="MAKE=$make" ;;
20894 $rm -f testmake.mak
20897 case "$make_set_make" in
20898 '#') echo "Yup, it does.";;
20899 *) echo "Nope, it doesn't.";;
20902 : see what type is used for mode_t
20903 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
20904 set mode_t modetype int stdio.h sys/types.h
20907 : see if we need va_copy
20909 case "$i_stdarg" in
20912 #include <stdarg.h>
20914 #$i_stdlib I_STDLIB
20916 #include <stdlib.h>
20918 #include <signal.h>
20921 ivfprintf(FILE *f, const char *fmt, va_list *valp)
20923 return vfprintf(f, fmt, *valp);
20927 myvfprintf(FILE *f, const char *fmt, va_list val)
20929 return ivfprintf(f, fmt, &val);
20933 myprintf(char *fmt, ...)
20936 va_start(val, fmt);
20937 return myvfprintf(stdout, fmt, val);
20941 main(int ac, char **av)
20943 signal(SIGSEGV, exit);
20945 myprintf("%s%cs all right, then\n", "that", '\'');
20950 if eval $compile && $run ./try 2>&1 >/dev/null; then
20951 case "`$run ./try`" in
20952 "that's all right, then")
20958 yes) echo "It seems that you don't need va_copy()." >&4
20959 need_va_copy="$undef"
20961 *) echo "It seems that va_copy() or similar will be needed." >&4
20962 need_va_copy="$define"
20967 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
20968 need_va_copy="$undef"
20972 : see what type is used for size_t
20973 rp="What is the type used for the length parameter for string functions?"
20974 set size_t sizetype 'unsigned int' stdio.h sys/types.h
20977 : check for type of arguments to gethostbyaddr.
20978 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
20979 case "$d_gethbyaddr" in
20983 Checking to see what type of arguments are accepted by gethostbyaddr().
20985 hdrs="$define sys/types.h
20986 $d_socket sys/socket.h
20987 $i_niin netinet/in.h
20989 $i_unistd unistd.h"
20990 : The first arg can 'char *' or 'void *'
20991 : The second arg is some of integral type
20992 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
20993 for yyy in size_t long int; do
20994 case "$netdb_host_type" in
20995 '') try="$extern_C struct hostent *gethostbyaddr($xxx, $yyy, int);"
20996 if ./protochk "$try" $hdrs; then
20997 echo "Your system accepts $xxx for the first arg."
20998 echo "...and $yyy for the second arg."
20999 netdb_host_type="$xxx"
21000 netdb_hlen_type="$yyy"
21006 : In case none of those worked, prompt the user.
21007 case "$netdb_host_type" in
21008 '') rp='What is the type for the 1st argument to gethostbyaddr?'
21011 netdb_host_type=$ans
21012 rp='What is the type for the 2nd argument to gethostbyaddr?'
21015 netdb_hlen_type=$ans
21019 *) : no gethostbyaddr, so pick harmless defaults
21020 netdb_host_type='char *'
21021 netdb_hlen_type="$sizetype"
21024 # Remove the "const" if needed. -- but then we'll have a
21026 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
21029 : check for type of argument to gethostbyname.
21030 if test "X$netdb_name_type" = X ; then
21031 case "$d_gethbyname" in
21035 Checking to see what type of argument is accepted by gethostbyname().
21037 hdrs="$define sys/types.h
21038 $d_socket sys/socket.h
21039 $i_niin netinet/in.h
21041 $i_unistd unistd.h"
21042 for xxx in "const char *" "char *"; do
21043 case "$netdb_name_type" in
21044 '') try="$extern_C struct hostent *gethostbyname($xxx);"
21045 if ./protochk "$try" $hdrs; then
21046 echo "Your system accepts $xxx."
21047 netdb_name_type="$xxx"
21052 : In case none of those worked, prompt the user.
21053 case "$netdb_name_type" in
21054 '') rp='What is the type for the 1st argument to gethostbyname?'
21057 netdb_name_type=$ans
21061 *) : no gethostbyname, so pick harmless default
21062 netdb_name_type='char *'
21067 : check for type of 1st argument to getnetbyaddr.
21068 if test "X$netdb_net_type" = X ; then
21069 case "$d_getnbyaddr" in
21073 Checking to see what type of 1st argument is accepted by getnetbyaddr().
21075 hdrs="$define sys/types.h
21076 $d_socket sys/socket.h
21077 $i_niin netinet/in.h
21079 $i_unistd unistd.h"
21080 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
21081 case "$netdb_net_type" in
21082 '') try="$extern_C struct netent *getnetbyaddr($xxx, int);"
21083 if ./protochk "$try" $hdrs; then
21084 echo "Your system accepts $xxx."
21085 netdb_net_type="$xxx"
21090 : In case none of those worked, prompt the user.
21091 case "$netdb_net_type" in
21092 '') rp='What is the type for the 1st argument to getnetbyaddr?'
21095 netdb_net_type=$ans
21099 *) : no getnetbyaddr, so pick harmless default
21100 netdb_net_type='long'
21104 : locate the preferred pager for this system
21111 [a-zA-Z]:/*) dflt=$pg;;
21115 [a-zA-Z]:/*) dflt=$more;;
21119 [a-zA-Z]:/*) dflt=$less;;
21122 '') dflt=/usr/ucb/more;;
21130 rp='What pager is used on your system?'
21134 : see what type pids are declared as in the kernel
21135 rp="What is the type of process ids on this system?"
21136 set pid_t pidtype int stdio.h sys/types.h
21139 : see if ar generates random libraries by itself
21141 echo "Checking how to generate random libraries on your machine..." >&4
21142 echo 'int bar1() { return bar2(); }' > bar1.c
21143 echo 'int bar2() { return 2; }' > bar2.c
21145 #$i_stdlib I_STDLIB
21147 #include <stdlib.h>
21149 int main() { printf("%d\n", bar1()); exit(0); }
21151 $cc $ccflags -c bar1.c >/dev/null 2>&1
21152 $cc $ccflags -c bar2.c >/dev/null 2>&1
21153 $cc $ccflags -c foo.c >/dev/null 2>&1
21154 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
21155 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
21156 $run ./foobar >/dev/null 2>&1; then
21157 echo "$ar appears to generate random libraries itself."
21159 if [ "X$ranlib" = "X" ]; then
21162 elif $ar s bar$_a >/dev/null 2>&1 &&
21163 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
21164 $run ./foobar >/dev/null 2>&1; then
21165 echo "a table of contents needs to be added with '$ar s'."
21168 elif $ar ts bar$_a >/dev/null 2>&1 &&
21169 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
21170 $run ./foobar >/dev/null 2>&1; then
21171 echo "a table of contents needs to be added with '$ar ts'."
21178 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
21179 $test -f $ranlib || ranlib=''
21182 if $test -n "$ranlib"; then
21183 echo "your system has '$ranlib'; we'll use that."
21186 echo "your system doesn't seem to support random libraries"
21187 echo "so we'll use lorder and tsort to order the libraries."
21194 : see if this is a values.h system
21195 set values.h i_values
21198 : Check the max offset that gmtime and localtime accept
21199 echo "Checking max offsets that gmtime () accepts"
21202 define) yyy="#include <values.h>" ;;
21206 case "$sGMTIME_min/$sGMTIME_max" in
21209 #include <sys/types.h>
21218 void gm_check (time_t t, int min_year, int max_year)
21221 if ( tmp == NULL ||
21222 /* Check tm_year overflow */
21223 tmp->tm_year < min_year || tmp->tm_year > max_year)
21234 gm_check (MAXLONG, 69, 0x7fffffff);
21236 if (tmp == NULL || tmp->tm_year < 0) {
21237 for (i = 63; i >= 0; i--) {
21238 time_t x = pt | ((time_t)1 << i);
21239 if (x < 0 || x < pt) continue;
21240 gm_check (x, 69, 0x7fffffff);
21243 printf ("sGMTIME_max=%ld\n", pt);
21252 gm_check (MINLONG, -1900, 70);
21255 for (i = 36; i >= 0; i--) {
21256 time_t x = pt - ((time_t)1 << i);
21257 if (x > 0) continue;
21258 gm_check (x, -1900, 70);
21261 printf ("sGMTIME_min=%ld\n", pt);
21265 int main (int argc, char *argv[])
21267 fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t));
21274 if eval $compile; then
21277 echo "Cannot determine sGMTIME_max and sGMTIME_min." >&4
21283 echo "Checking max offsets that localtime () accepts"
21285 case "$sLOCALTIME_min/$sLOCALTIME_max" in
21288 #include <sys/types.h>
21297 void local_check (time_t t, int min_year, int max_year)
21299 if (sizeof (time_t) > 4 && t > 0x7ffffffffffff000LL)
21302 tmp = localtime (&t);
21303 if ( tmp == NULL ||
21304 /* Check tm_year overflow */
21305 tmp->tm_year < min_year || tmp->tm_year > max_year)
21309 } /* local_check */
21316 local_check (MAXLONG, 69, 0x7fffffff);
21318 if (tmp == NULL || tmp->tm_year < 0) {
21319 for (i = 63; i >= 0; i--) {
21320 time_t x = pt | ((time_t)1 << i);
21321 if (x < 0 || x < pt) continue;
21322 local_check (x, 69, 0x7fffffff);
21325 printf ("sLOCALTIME_max=%ld\n", pt);
21334 local_check (MINLONG, -1900, 70);
21337 for (i = 36; i >= 0; i--) {
21338 time_t x = pt - ((time_t)1 << i);
21339 if (x > 0) continue;
21340 local_check (x, -1900, 70);
21343 printf ("sLOCALTIME_min=%ld\n", pt);
21347 int main (int argc, char *argv[])
21355 if eval $compile; then
21358 echo "Cannot determine sLOCALTIME_max and sLOCALTIME_min." >&4
21364 : check for type of arguments to select.
21365 case "$selecttype" in
21366 '') case "$d_select" in
21370 Checking to see what type of arguments are accepted by select().
21372 hdrs="$define sys/types.h
21373 $i_systime sys/time.h
21374 $i_sysselct sys/select.h
21375 $d_socket sys/socket.h"
21376 : The first arg can be int, unsigned, or size_t
21377 : The last arg may or may not be 'const'
21379 : void pointer has been seen but using that
21380 : breaks the selectminbits test
21381 for xxx in 'fd_set *' 'int *'; do
21382 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
21383 for tmo in 'struct timeval *' 'const struct timeval *'; do
21385 '') try="$extern_C select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
21386 if ./protochk "$try" $hdrs; then
21387 echo "Your system accepts $xxx."
21396 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
21397 case "$d_fd_set" in
21398 $define) dflt="fd_set *" ;;
21407 *) : no select, so pick a harmless default
21414 : check for the select 'width'
21415 case "$selectminbits" in
21416 '') safebits=`expr $ptrsize \* 8`
21417 case "$d_select" in
21421 Checking to see on how many bits at a time your select() operates...
21424 #include <sys/types.h>
21426 #$i_systime I_SYS_TIME
21427 #$i_systimek I_SYS_TIME_KERNEL
21432 # ifdef I_SYS_TIME_KERNEL
21435 # include <sys/time.h>
21436 # ifdef I_SYS_TIME_KERNEL
21440 #$i_sysselct I_SYS_SELECT
21441 #ifdef I_SYS_SELECT
21442 #include <sys/select.h>
21444 #$d_socket HAS_SOCKET
21446 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
21449 #$i_stdlib I_STDLIB
21451 #include <stdlib.h>
21454 #define S sizeof(*(b))
21456 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
21457 #define NBITS (NBYTES * 8)
21459 char *s = (char *)malloc(NBYTES);
21468 fp = fopen("try.c", "r");
21474 b = ($selecttype)s;
21475 for (i = 0; i < NBITS; i++)
21479 select(fd + 1, b, 0, 0, &t);
21480 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
21482 printf("%d\n", i + 1);
21487 if eval $compile_ok; then
21488 selectminbits=`$run ./try`
21489 case "$selectminbits" in
21491 Cannot figure out on how many bits at a time your select() operates.
21492 I'll play safe and guess it is $safebits bits.
21494 selectminbits=$safebits
21495 bits="$safebits bits"
21498 *) bits="$selectminbits bits" ;;
21500 echo "Your select() operates on $bits at a time." >&4
21502 rp='What is the minimum number of bits your select() operates on?'
21503 case "$byteorder" in
21504 12345678) dflt=64 ;;
21510 selectminbits="$val"
21514 *) : no select, so pick a harmless default
21515 selectminbits=$safebits
21521 : Trace out the files included by signal.h, then look for SIGxxx names.
21522 if [ "X$fieldn" = X ]; then
21523 : Just make some guesses. We check them later.
21524 xxx="$sysroot/usr/include/signal.h $sysroot/usr/include/sys/signal.h"
21526 xxx=`echo '#include <signal.h>' |
21527 $cppstdin $cppminus $cppflags 2>/dev/null |
21528 $grep '^[ ]*#.*include' |
21529 $awk "{print \\$$fieldn}" | $sed 's!"!!g' |\
21530 $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
21533 for xx in $xxx /dev/null ; do
21534 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
21536 case "$xxxfiles" in
21537 '') xxxfiles=`./findhdr signal.h` ;;
21540 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
21541 print substr($2, 4, 20)
21543 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
21544 print substr($3, 4, 20)
21546 : Append some common names just in case the awk scan failed.
21547 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
21548 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
21549 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
21550 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
21551 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
21553 : generate a few handy files for later
21554 $cat > signal.c <<EOCP
21555 #include <sys/types.h>
21556 #include <signal.h>
21557 #$i_stdlib I_STDLIB
21559 #include <stdlib.h>
21564 /* Strange style to avoid deeply-nested #if/#else/#endif */
21567 # define NSIG (_NSIG)
21573 # define NSIG (SIGMAX+1)
21579 # define NSIG (SIG_MAX+1)
21585 # define NSIG (_SIG_MAX+1)
21591 # define NSIG (MAXSIG+1)
21597 # define NSIG (MAX_SIG+1)
21602 # ifdef SIGARRAYSIZE
21603 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
21609 # define NSIG (_sys_nsig) /* Solaris 2.5 */
21613 /* Default to some arbitrary number that's big enough to get most
21614 of the common signals.
21620 printf("NSIG %d\n", NSIG);
21626 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
21628 printf "#ifdef SIG"; printf $1; printf "\n"
21629 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
21630 printf $1; printf ");\n"
21634 printf "#endif /* JUST_NSIG */\n";
21635 printf "exit(0);\n}\n";
21638 $cat >signal.awk <<'EOP'
21639 BEGIN { ndups = 0 }
21640 $1 ~ /^NSIG$/ { nsig = $2 }
21641 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
21642 if ($2 > maxsig) { maxsig = $2 }
21643 if (sig_name[$2]) {
21644 dup_name[ndups] = $1
21645 dup_num[ndups] = $2
21657 printf("NSIG %d\n", nsig);
21658 for (n = 1; n < nsig; n++) {
21660 printf("%s %d\n", sig_name[n], sig_num[n])
21663 printf("NUM%d %d\n", n, n)
21666 for (n = 0; n < ndups; n++) {
21667 printf("%s %d\n", dup_name[n], dup_num[n])
21671 $cat >signal_cmd <<EOS
21673 if $test -s signal.lst; then
21674 echo "Using your existing signal.lst file"
21679 $cat >>signal_cmd <<'EOS'
21682 if eval $compile_ok; then
21683 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) |\
21684 $uniq | $awk -f signal.awk >signal.lst
21686 echo "(I can't seem be able to compile the whole test program)" >&4
21687 echo "(I'll try it in little pieces.)" >&4
21688 set signal -DJUST_NSIG
21689 if eval $compile_ok; then
21690 $run ./signal$_exe > signal.nsg
21693 echo "I can't seem to figure out how many signals you have." >&4
21694 echo "Guessing 50." >&4
21695 echo 'NSIG 50' > signal.nsg
21697 : Now look at all the signal names, one at a time.
21698 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
21699 $cat > signal.c <<EOCP
21700 #include <sys/types.h>
21701 #include <signal.h>
21704 printf("$xx %d\n", SIG${xx});
21709 if eval $compile; then
21710 echo "SIG${xx} found."
21711 $run ./signal$_exe >> signal.ls1
21713 echo "SIG${xx} NOT found."
21716 if $test -s signal.ls1; then
21717 $cat signal.nsg signal.ls1 |
21718 $sort -n | $uniq | $awk -f signal.awk >signal.lst
21722 if $test -s signal.lst; then
21725 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
21726 echo 'kill -l' >signal
21727 set X `csh -f <signal`
21731 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
21733 echo $@ | $tr ' ' $trnl | \
21734 $awk '{ printf "%s %d\n", $1, ++s; }
21735 END { printf "NSIG %d\n", ++s }' >signal.lst
21737 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
21739 chmod a+x signal_cmd
21740 $eunicefix signal_cmd
21742 : generate list of signal names
21744 case "$sig_name_init" in
21746 *) case "$sig_num_init" in
21747 ''|*,*) doinit=yes ;;
21752 echo "Generating a list of signal names and numbers..." >&4
21754 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
21755 sig_name=`$awk 'BEGIN { printf "ZERO " }
21756 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
21757 sig_num=`$awk 'BEGIN { printf "0 " }
21758 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
21759 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
21760 !/^NSIG/ { printf "\"%s\", ", $1 }
21761 END { printf "0\n" }' signal.lst`
21762 sig_num_init=`$awk 'BEGIN { printf "0, " }
21763 !/^NSIG/ { printf "%d, ", $2}
21764 END { printf "0\n"}' signal.lst`
21767 echo "The following $sig_count signals are available:"
21769 echo $sig_name | $awk \
21770 'BEGIN { linelen = 0 }
21772 for (i = 1; i <= NF; i++) {
21773 name = "SIG" $i " "
21774 linelen = linelen + length(name)
21775 if (linelen > 70) {
21777 linelen = length(name)
21783 sig_size=`echo $sig_name | awk '{print NF}'`
21784 $rm -f signal signal.c signal.awk signal.lst signal_cmd
21786 : Check size of size
21788 case "$sizetype" in
21789 *_t) zzz="$sizetype" ;;
21790 *) zzz="filesize" ;;
21792 echo "Checking the size of $zzz..." >&4
21794 #include <sys/types.h>
21796 #$i_stdlib I_STDLIB
21798 #include <stdlib.h>
21801 printf("%d\n", (int)sizeof($sizetype));
21806 if eval $compile_ok; then
21810 echo "(I can't execute the test program--guessing $sizesize.)" >&4
21813 echo "Your $zzz size is $sizesize bytes."
21818 echo "(I can't compile the test program--guessing $sizesize.)" >&4
21822 : check for socklen_t
21824 echo "Checking to see if you have socklen_t..." >&4
21826 #include <sys/types.h>
21827 #$d_socket HAS_SOCKET
21829 #include <sys/socket.h>
21831 int main() { socklen_t x = 16; }
21834 if eval $compile; then
21836 echo "You have socklen_t."
21839 echo "You do not have socklen_t."
21840 case "$sizetype" in
21841 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
21848 : see if this is a socks.h system
21849 set socks.h i_socks
21852 : check for type of the size argument to socket calls
21853 case "$d_socket" in
21857 Checking to see what type is the last argument of accept().
21860 case "$d_socklen_t" in
21861 "$define") yyy="$yyy socklen_t"
21863 yyy="$yyy $sizetype int long unsigned"
21864 for xxx in $yyy; do
21865 case "$socksizetype" in
21866 '') try="$extern_C int accept(int, struct sockaddr *, $xxx *);"
21867 case "$usesocks" in
21869 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
21870 echo "Your system accepts '$xxx *' for the last argument of accept()."
21871 socksizetype="$xxx"
21874 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
21875 echo "Your system accepts '$xxx *' for the last argument of accept()."
21876 socksizetype="$xxx"
21883 : In case none of those worked, prompt the user.
21884 case "$socksizetype" in
21885 '') rp='What is the type for socket address structure sizes?'
21892 *) : no sockets, so pick relatively harmless default
21897 : see what type is used for signed size_t
21898 set ssize_t ssizetype int stdio.h sys/types.h
21903 #$i_stdlib I_STDLIB
21905 #include <stdlib.h>
21907 #include <sys/types.h>
21908 #define Size_t $sizetype
21909 #define SSize_t $dflt
21912 if (sizeof(Size_t) == sizeof(SSize_t))
21914 else if (sizeof(Size_t) == sizeof(int))
21923 if eval $compile_ok && $run ./try > /dev/null; then
21924 ssizetype=`$run ./try`
21925 echo "I'll be using $ssizetype for functions returning a byte count." >&4
21928 Help! I can't compile and run the ssize_t test program: please enlighten me!
21929 (This is probably a misconfiguration in your system or libraries, and
21930 you really ought to fix it. Still, I'll try anyway.)
21932 I need a type that is the same size as $sizetype, but is guaranteed to
21933 be signed. Common values are ssize_t, int and long.
21936 rp="What signed type is the same size as $sizetype?"
21942 : Check the size of st_ino
21944 $echo "Checking the size of st_ino..." >&4
21945 $cat > try.c <<EOCP
21946 #include <sys/stat.h>
21948 #$i_stdlib I_STDLIB
21950 #include <stdlib.h>
21954 printf("%d\n", (int)sizeof(st.st_ino));
21959 if eval $compile_ok; then
21963 $echo "(I can't execute the test program--guessing $st_ino_size.)" >&4
21965 *) st_ino_size=$val
21966 $echo "Your st_ino is $st_ino_size bytes long."
21971 $echo "(I can't compile the test program--guessing $st_ino_size.)" >&4
21975 : Check if st_ino is signed
21977 $echo "Checking the sign of st_ino..." >&4
21978 $cat > try.c <<EOCP
21979 #include <sys/stat.h>
21984 if (foo.st_ino < 0)
21991 if eval $compile; then
21995 $echo "(I can't execute the test program--guessing unsigned.)" >&4
21997 *) st_ino_sign=$val
21998 case "$st_ino_sign" in
21999 1) $echo "Your st_ino is unsigned." ;;
22000 -1) $echo "Your st_ino is signed." ;;
22006 $echo "(I can't compile the test program--guessing unsigned.)" >&4
22010 : see what type of char stdio uses.
22012 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
22013 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
22014 echo "Your stdio uses unsigned chars." >&4
22015 stdchar="unsigned char"
22017 echo "Your stdio uses signed chars." >&4
22022 : see what type uids are declared as in the kernel
22024 echo "Looking for the type for user ids returned by getuid()."
22025 set uid_t uidtype xxx stdio.h sys/types.h
22029 xxx=`./findhdr sys/user.h`
22030 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
22032 unsigned) dflt="$1 $2" ;;
22036 *) dflt="$uidtype";;
22039 uid_t) echo "uid_t found." ;;
22040 *) rp="What is the type for user ids returned by getuid()?"
22046 : Check size of UID
22049 *_t) zzz="$uidtype" ;;
22052 echo "Checking the size of $zzz..." >&4
22054 #include <sys/types.h>
22056 #$i_stdlib I_STDLIB
22058 #include <stdlib.h>
22061 printf("%d\n", (int)sizeof($uidtype));
22066 if eval $compile_ok; then
22070 echo "(I can't execute the test program--guessing $uidsize.)" >&4
22073 echo "Your $zzz is $uidsize bytes long."
22078 echo "(I can't compile the test program--guessing $uidsize.)" >&4
22081 : Check if UID is signed
22084 *_t) zzz="$uidtype" ;;
22087 echo "Checking the sign of $zzz..." >&4
22089 #include <sys/types.h>
22100 if eval $compile; then
22104 echo "(I can't execute the test program--guessing unsigned.)" >&4
22108 1) echo "Your $zzz is unsigned." ;;
22109 -1) echo "Your $zzz is signed." ;;
22115 echo "(I can't compile the test program--guessing unsigned.)" >&4
22119 : Check format string for UID
22121 $echo "Checking the format string to be used for uids..." >&4
22124 -1) if $test X"$uidsize" = X"$ivsize"; then
22125 uidformat="$ivdformat"
22127 if $test X"$uidsize" = X"$longsize"; then
22130 if $test X"$uidsize" = X"$intsize"; then
22133 if $test X"$uidsize" = X"$shortsize"; then
22140 *) if $test X"$uidsize" = X"$uvsize"; then
22141 uidformat="$uvuformat"
22143 if $test X"$uidsize" = X"$longsize"; then
22146 if $test X"$uidsize" = X"$intsize"; then
22149 if $test X"$uidsize" = X"$shortsize"; then
22158 : Determine if we can use sysctl with KERN_PROC_PATHNAME to find executing program
22160 echo "Determining whether we can use sysctl with KERN_PROC_PATHNAME to find executing program..." >&4
22161 $cat >try.c <<'EOM'
22162 /* Intentionally a long probe as I'd like to sanity check that the exact
22163 approach is going to work, as thinking it will work, but only having it
22164 part working at runtime is worse than not having it. */
22166 #include <sys/types.h>
22167 #include <sys/sysctl.h>
22168 #include <sys/param.h>
22170 #include <string.h>
22171 #include <stdlib.h>
22172 #include <unistd.h>
22175 main(int argc, char **argv) {
22177 char *argv_leaf = strrchr(argv[0], '/');
22183 mib[1] = KERN_PROC;
22184 mib[2] = KERN_PROC_PATHNAME;
22188 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
22192 if (sysctl(mib, 4, NULL, &size, NULL, 0)) {
22197 if (size < strlen(argv_leaf) + 1) {
22198 fprintf(stderr, "size %lu is too short for a path\n",
22199 (unsigned long) size);
22203 if (size > MAXPATHLEN * MAXPATHLEN) {
22204 fprintf(stderr, "size %lu is too long for a path\n",
22205 (unsigned long) size);
22209 buffer = malloc(size);
22215 if (sysctl(mib, 4, buffer, &size, NULL, 0)) {
22220 if (strlen(buffer) + 1 != size) {
22221 fprintf(stderr, "size != strlen(buffer) + 1 (%lu != %lu)\n",
22222 (unsigned long)size, (unsigned long)strlen(buffer) + 1);
22227 if (*buffer != '/') {
22228 fprintf(stderr, "Not an absolute path: '%s'\n", buffer);
22232 if (strstr(buffer, "/./")) {
22233 fprintf(stderr, "Contains /./: '%s'\n", buffer);
22237 if (strstr(buffer, "/../")) {
22238 fprintf(stderr, "Contains /../: '%s'\n", buffer);
22242 buffer_leaf = strrchr(buffer, '/');
22243 if (strcmp(buffer_leaf, argv_leaf) != 0) {
22244 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], buffer);
22256 if eval $compile; then
22257 if $run ./try; then
22258 echo "You can use sysctl with KERN_PROC_PATHNAME to find the executing program." >&4
22261 echo "Nope, sysctl with KERN_PROC_PATHNAME doesn't work here." >&4
22265 echo "I'm unable to compile the test program." >&4
22266 echo "I'll assume no sysctl with KERN_PROC_PATHNAME here." >&4
22270 set usekernprocpathname
22273 : Determine if we can use _NSGetExecutablePath to find executing program
22275 echo "Determining whether we can use _NSGetExecutablePath to find executing program..." >&4
22276 $cat >try.c <<'EOM'
22277 /* Intentionally a long probe as I'd like to sanity check that the exact
22278 approach is going to work, as thinking it will work, but only having it
22279 part working at runtime is worse than not having it. */
22280 #include <mach-o/dyld.h>
22282 #include <stdlib.h>
22283 #include <sys/param.h>
22284 #include <string.h>
22287 main(int argc, char **argv) {
22289 uint32_t size = sizeof(buf);
22293 char *argv_leaf = strrchr(argv[0], '/');
22297 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
22301 _NSGetExecutablePath(buf, &size);
22302 if (size > MAXPATHLEN * MAXPATHLEN) {
22303 fprintf(stderr, "_NSGetExecutablePath size %u is too long for a path\n",
22304 (unsigned int) size);
22308 buffer = malloc(size);
22314 result = _NSGetExecutablePath(buffer, &size);
22316 fprintf(stderr, "_NSGetExecutablePath returned %i for a size of %u\n",
22317 result, (unsigned int) size);
22321 tidied = realpath(buffer, NULL);
22323 perror("realpath");
22329 if (*tidied != '/') {
22330 fprintf(stderr, "Not an absolute path: '%s'\n", tidied);
22334 if (strstr(tidied, "/./")) {
22335 fprintf(stderr, "Contains /./: '%s'\n", tidied);
22339 if (strstr(tidied, "/../")) {
22340 fprintf(stderr, "Contains /../: '%s'\n", tidied);
22344 tidied_leaf = strrchr(tidied, '/');
22345 if (strcmp(tidied_leaf, argv_leaf) != 0) {
22346 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], tidied);
22358 if eval $compile; then
22359 if $run ./try; then
22360 echo "You can use _NSGetExecutablePath to find the executing program." >&4
22363 echo "Nope, _NSGetExecutablePath doesn't work here." >&4
22366 echo "I'm unable to compile the test program." >&4
22367 echo "I'll assume no _NSGetExecutablePath here." >&4
22370 set usensgetexecutablepath
22373 : Check if site customization support was requested
22374 case "$usesitecustomize" in
22375 $define|true|[Yy]*)
22376 usesitecustomize="$define"
22379 usesitecustomize="$undef"
22383 : see if prototypes support variable argument declarations
22385 case "$prototype$i_stdarg" in
22387 echo "It appears we'll be able to prototype varargs functions." >&4
22391 echo "Too bad... We won't be using prototyped varargs functions..." >&4
22398 : determine compiler compiler
22407 if $test -f "$byacc$_exe"; then
22409 comp="byacc or $comp"
22411 if $test -f "$bison$_exe"; then
22412 comp="$comp or bison -y"
22414 rp="Which compiler compiler ($comp) shall I use?"
22423 echo "(Adding -y option to bison to get yacc-compatible behavior.)"
22429 : see if this is a assert.h system
22430 set assert.h i_assert
22433 : see if this is a bfd.h system
22437 : see if this is an execinfo.h system
22438 set execinfo.h i_execinfo
22441 : see if this is a fenv.h system
22445 : see if this is a fp.h system
22449 : see if this is a fp_class.h system
22450 set fp_class.h i_fp_class
22453 : see if gdbm.h is available
22458 : see if gdbm_open exists
22459 set gdbm_open d_gdbm_open
22461 case "$d_gdbm_open" in
22464 echo "We won't be including <gdbm.h>"
22473 : see if this is a ieeefp.h system
22474 case "$i_ieeefp" in
22475 '' ) set ieeefp.h i_ieeefp
22480 : see if this is a libutil.h system
22481 set libutil.h i_libutil
22484 : see if mach cthreads are available
22485 if test "X$usethreads" = "X$define"; then
22486 set mach/cthreads.h i_machcthr
22489 i_machcthr="$undef"
22492 : see if this is a mntent.h system
22493 set mntent.h i_mntent
22496 : see if net/errno.h is available
22498 set net/errno.h val
22501 : Unfortunately, it causes problems on some systems. Arrgh.
22504 cat > try.c <<'EOM'
22507 #include <net/errno.h>
22513 if $cc $ccflags -c try.c >/dev/null 2>&1; then
22514 echo "We'll be including <net/errno.h>." >&4
22516 echo "We won't be including <net/errno.h>." >&4
22525 : see if netinet/tcp.h is available
22526 set netinet/tcp.h i_netinettcp
22529 : see if this is a poll.h system
22533 : see if this is a prot.h system
22537 : Preprocessor symbols
22539 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
22540 $cat <<'EOSH' > Cppsym.know
22541 a29k aarch64 ABI64 aegis AES_SOURCE AIX AIX32 AIX370 AIX41 AIX42
22542 AIX43 aixpc AIX_SOURCE alliant ALL_SOURCE alpha AM29000 am29000
22543 AMD64 amd64 amiga AMIGAOS AMIX ansi ANSI_C_SOURCE apollo arch_ppc
22544 arch_pwr ardent ARM ARM32 atarist att386 att3b
22545 BeOS BIG_ENDIAN BIT_MSF BSD bsd bsd43 bsd4_2 BSD4_3 bsd4_3 bsd4_4
22546 BSDCOMPAT bsdi BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES bull
22547 byteorder byte_order
22548 c cadmus clang clipper CMU COFF COMPILER_VERSION concurrent
22549 convex cpu CRAY cray CRAYMPP ctix CX_UX CYGWIN
22550 DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO Dynix DynixPTX
22551 ELF encore EPI EXTENSIONS
22552 FAVOR_BSD FILE_OFFSET_BITS FORTIFY_SOURCE FreeBSD
22553 GCC_NEW_VARARGS gcos gcx gimpel GLIBC GLIBC_MINOR GNUC GNUC_MINOR
22554 GNU_LIBRARY GNU_SOURCE GO32 gould GOULD_PN
22555 H3050R H3050RX hbullx20 hcx host_mips hp200 hp300 HP700 hp700
22556 hp800 hp9000 hp9000s200 hp9000s300 hp9000s400 hp9000s500
22557 hp9000s700 hp9000s800 hp9k8 hppa hpux HPUX_SOURCE hp_osf
22558 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960 IA32 IA64
22559 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
22560 INLINE_INTRINSICS INT64 INTEL interdata INTRINSICS is68k itanium
22562 LANGUAGE_C LARGEFILE64_SOURCE LARGEFILE_SOURCE LARGE_FILE_API
22563 LFS64_LARGEFILE LFS_LARGEFILE LIBCATAMOUNT Linux LITTLE_ENDIAN
22564 LONG64 LONGDOUBLE LONGLONG LONG_DOUBLE LONG_LONG LP64 luna
22566 M68000 m68k m88100 m88k M88KBCS_TARGET MACH machine MachTen
22567 MATH_HAS_NO_SIDE_EFFECTS mc300 mc500 mc68000 mc68010 mc68020
22568 mc68030 mc68040 mc68060 mc68k mc68k32 mc700 mc88000 mc88100
22569 merlin mert MiNT mips MIPSEB MIPSEL MIPS_FPSET MIPS_ISA MIPS_SIM
22570 MIPS_SZINT MIPS_SZLONG MIPS_SZPTR MODERN_C motorola mpeix MSDOS
22571 MTXINU MULTIMAX MVS mvs M_AMD64 M_ARM M_ARMT M_COFF M_I186 M_I286
22572 M_I386 M_I8086 M_I86 M_I86SM M_IA64 M_IX86 M_PPC M_SYS3 M_SYS5
22573 M_SYSIII M_SYSV M_UNIX M_X86 M_XENIX
22574 n16 ncl_el ncl_mr NetBSD news1500 news1700 news1800 news1900
22575 news3700 news700 news800 news900 NeXT NLS nonstopux ns16000
22576 ns32000 ns32016 ns32332 ns32k nsc32000
22577 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
22578 PARAGON parisc pa_risc PA_RISC1_1 PA_RISC2_0 pc532 pdp11 PGC PIC
22579 plexus PORTAR posix POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
22580 POSIX_C_SOURCE POSIX_SOURCE POWER powerpc ppc PROTOTYPES PWB pyr
22582 R3000 REENTRANT RES Rhapsody RISC6000 riscix riscos RT
22583 S390 S390x SA110 SCO scs sequent sgi SGI_SOURCE SH SH3 sinix
22584 SIZE_INT SIZE_LONG SIZE_PTR SOCKETS_SOURCE SOCKET_SOURCE sony
22585 sonyrisc sony_news sparc sparclite sparcv8 sparcv9 spectrum
22586 stardent stdc STDC_EXT stratos sun sun3 sun386 Sun386i svr3 svr4
22587 SVR4_2 SVR4_SOURCE svr5 SX system SYSTYPE_BSD SYSTYPE_BSD43
22588 SYSTYPE_BSD44 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3
22589 SYSV4 SYSV5 sysV68 sysV88
22590 Tek4132 Tek4300 thumb thw_370 thw_intel thw_rs6000 titan TM3200
22591 TM5400 TM5600 tower tower32 tower32_200 tower32_600 tower32_700
22592 tower32_800 tower32_850 tss
22593 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5 ultrix UMAXV UnicomPBB
22594 UnicomPBD UNICOS UNICOSMK unix UNIX95 UNIX99 unixpc unos USE_BSD
22595 USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE
22596 USE_LARGEFILE64 USE_MISC USE_POSIX USE_POSIX199309
22597 USE_POSIX199506 USE_POSIX2 USE_REENTRANT USE_SVID USE_UNIX98
22598 USE_XOPEN USE_XOPEN_EXTENDED USGr4 USGr4_2 UTek Utek UTS UWIN
22600 vax venix VMESA vms
22601 x86_64 xenix Xenix286 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2
22602 XPG2_EXTENDED XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
22605 # Maybe put other stuff here too.
22606 ./tr '-' '_' <<EOSH >>Cppsym.know
22609 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
22610 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
22611 $cat Cppsym.know > Cppsym.c
22612 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
22613 $rm -f Cppsym.a Cppsym.b Cppsym.c
22614 cat <<EOSH > Cppsym
22616 if $test \$# -gt 0; then
22617 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
22618 if $test -s Cppsym.got; then
22625 $tr " " "$trnl" | ./Cppsym.try
22631 cat <<EOSH > Cppsym.try
22633 cat <<'EOCP' > try.c
22636 #define STRINGIFY(a) "a"
22638 #if cpp_stuff == 42
22639 #define StGiFy(a) #a
22640 #define STRINGIFY(a) StGiFy(a)
22642 #if $cpp_stuff != 1 && $cpp_stuff != 42
22643 # include "Bletch: How does this C preprocessor stringify macros?"
22649 cat <<'EOSH' >> Cppsym.try
22651 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
22652 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
22653 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
22654 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
22656 echo 'return 0;}' >> try.c
22658 cat <<EOSH >> Cppsym.try
22660 case "$osname-$gccversion" in
22661 irix-) ccflags="\$ccflags -woff 1178" ;;
22662 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
22664 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
22666 chmod +x Cppsym.try
22667 $eunicefix Cppsym.try
22668 ./Cppsym < Cppsym.know | $sort | $uniq > Cppsym.true
22669 : Add in any Linux cpp "predefined macros":
22670 case "$osname::$gccversion" in
22671 *linux*::*.*|*gnukfreebsd*::*.*|gnu::*.*)
22673 rm -f $tHdrH'.h' $tHdrH
22675 # Filter out macro arguments, such as Linux's __INT8_C(c)
22676 if $cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
22677 sed -e 's/#define[\ \ ]*//;s/[\ \ ].*$//' -e 's/(.*//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
22678 if [ -s $tHdrH'_cppsym.real' ]; then
22679 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
22682 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
22685 : now check the C compiler for additional symbols
22686 postprocess_cc_v=''
22688 aix) postprocess_cc_v="|$tr , ' '" ;;
22695 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
22698 -D*) echo "\$i" | $sed 's/^-D//';;
22699 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
22704 postprocess_cc_v=''
22707 ./ccsym > ccsym1.raw
22708 if $test -s ccsym1.raw; then
22709 $sort ccsym1.raw | $uniq >ccsym.raw
22711 mv ccsym1.raw ccsym.raw
22714 $awk '/\=/ { print $0; next }
22715 { print $0"=1" }' ccsym.raw >ccsym.list
22716 $comm -13 Cppsym.true ccsym.list >ccsym.own
22717 $comm -12 Cppsym.true ccsym.list >ccsym.com
22718 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
22720 if $test -z ccsym.raw; then
22721 echo "Your C compiler doesn't seem to define any symbols!" >&4
22723 echo "However, your C preprocessor defines the following symbols:"
22726 cppsymbols=`$cat Cppsym.true`
22727 cppsymbols=`echo $cppsymbols`
22728 cppccsymbols="$cppsymbols"
22730 if $test -s ccsym.com; then
22731 echo "Your C compiler and pre-processor define these symbols:"
22732 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
22735 cppccsymbols=`$cat ccsym.com`
22736 cppccsymbols=`echo $cppccsymbols`
22737 $test "$silent" || sleep 1
22739 if $test -s ccsym.cpp; then
22740 $test "$also" && echo " "
22741 echo "Your C pre-processor ${also}defines the following symbols:"
22742 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
22744 cppsymbols=`$cat ccsym.cpp`
22745 cppsymbols=`echo $cppsymbols`
22746 $test "$silent" || sleep 1
22748 if $test -s ccsym.own; then
22749 $test "$also" && echo " "
22750 echo "Your C compiler ${also}defines the following cpp symbols:"
22751 $sed -e 's/\(..*\)=1/\1/' ccsym.own
22752 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
22753 ccsymbols=`$cat ccsym.own`
22754 ccsymbols=`echo $ccsymbols`
22755 $test "$silent" || sleep 1
22759 : add -D_FORTIFY_SOURCE if feasible and not already there
22760 case "$gccversion" in
22761 4.*) case "$optimize$ccflags" in
22762 *-O*) case "$ccflags$cppsymbols" in
22763 *_FORTIFY_SOURCE=*) # Don't add it again.
22764 echo "You seem to have -D_FORTIFY_SOURCE already, not adding it." >&4
22766 *) echo "Adding -D_FORTIFY_SOURCE=2 to ccflags..." >&4
22767 ccflags="$ccflags -D_FORTIFY_SOURCE=2"
22771 *) echo "You have gcc 4.* but not optimizing, not adding -D_FORTIFY_SOURCE." >&4
22775 *) echo "You seem not to have gcc 4.*, not adding -D_FORTIFY_SOURCE." >&4
22779 : see if this is a termio system
22783 if $test `./findhdr termios.h`; then
22784 set tcsetattr i_termios
22790 "$define") echo "You have POSIX termios.h... good!" >&4;;
22791 *) if ./Cppsym pyr; then
22792 case "`$run /bin/universe`" in
22793 ucb) if $test `./findhdr sgtty.h`; then
22795 echo "<sgtty.h> found." >&4
22797 echo "System is pyramid with BSD universe."
22798 ./warn "<sgtty.h> not found--you could have problems."
22800 *) if $test `./findhdr termio.h`; then
22802 echo "<termio.h> found." >&4
22804 echo "System is pyramid with USG universe."
22805 ./warn "<termio.h> not found--you could have problems."
22809 if $test `./findhdr termio.h`; then
22810 echo "<termio.h> found." >&4
22812 elif $test `./findhdr sgtty.h`; then
22813 echo "<sgtty.h> found." >&4
22816 ./warn "Neither <termio.h> nor <sgtty.h> found--cross fingers!"
22819 if $test `./findhdr sgtty.h`; then
22820 echo "<sgtty.h> found." >&4
22822 elif $test `./findhdr termio.h`; then
22823 echo "<termio.h> found." >&4
22826 ./warn "Neither <sgtty.h> nor <termio.h> found--cross fingers!"
22830 set i_termio; eval $setvar
22831 val=$val2; set i_sgtty; eval $setvar
22832 val=$val3; set i_termios; eval $setvar
22834 : see if stdbool is available
22835 : we want a real compile instead of Inhdr because some Solaris systems
22836 : have stdbool.h, but it can only be used if the compiler indicates it
22837 : is sufficiently c99-compliant.
22841 #include <stdbool.h>
22846 int main(int argc, char **argv)
22852 if eval $compile; then
22853 echo "<stdbool.h> found." >&4
22856 echo "<stdbool.h> NOT found." >&4
22863 : see if stddef is available
22864 set stddef.h i_stddef
22867 : see if stdint is available
22868 set stdint.h i_stdint
22871 : see if sys/access.h is available
22872 set sys/access.h i_sysaccess
22875 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
22876 set sys/filio.h i_sysfilio
22879 if $test `./findhdr sys/ioctl.h`; then
22881 echo '<sys/ioctl.h> found.' >&4
22884 if $test $i_sysfilio = "$define"; then
22885 echo '<sys/ioctl.h> NOT found.' >&4
22887 $test $i_sgtty = "$define" && xxx="sgtty.h"
22888 $test $i_termio = "$define" && xxx="termio.h"
22889 $test $i_termios = "$define" && xxx="termios.h"
22890 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
22896 : see if socket ioctl defs are in sys/sockio.h
22898 xxx=`./findhdr sys/sockio.h`
22899 if $test "$xxx"; then
22900 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
22902 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
22905 echo "No socket ioctls found in <sys/sockio.h>." >&4
22910 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
22916 : see if this is a syslog.h system
22917 set syslog.h i_syslog
22920 : see if this is a sys/mode.h system
22921 set sys/mode.h i_sysmode
22924 : see if there is a sys/poll.h file
22925 set sys/poll.h i_syspoll
22928 : see if sys/resource.h has to be included
22929 set sys/resource.h i_sysresrc
22932 : see if sys/security.h is available
22933 set sys/security.h i_syssecrt
22936 : see if this is a sys/statvfs.h system
22937 set sys/statvfs.h i_sysstatvfs
22940 : see if this is a sys/un.h system
22941 set sys/un.h i_sysun
22944 : see if this is a sys/utsname.h system
22945 set sys/utsname.h i_sysutsname
22948 : see if this is a syswait system
22949 set sys/wait.h i_syswait
22952 : see if this is a ustat.h system
22953 set ustat.h i_ustat
22956 : see if this is an utime system
22957 set utime.h i_utime
22960 : see if this is a vfork system
22963 set vfork.h i_vfork
22973 echo "Looking for extensions..." >&4
22974 : If we are using the old config.sh, nonxs_extensions and xs_extensions may
22975 : contain old or inaccurate or duplicate values.
22976 nonxs_extensions=''
22978 : We do not use find because it might not be available.
22979 : We do not just use MANIFEST because the user may have dropped
22980 : some additional extensions into the source tree and expect them
22983 : Function to recursively find available extensions, ignoring DynaLoader
22984 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
22985 : In 5.10.1 and later, extensions are stored in directories
22986 : like File-Glob instead of the older File/Glob/.
22990 DynaLoader|dynaload) ;;
22992 this_ext=`echo $xxx | $sed -e s/-/\\\//g`;
22993 case "$this_ext" in
22994 Scalar/List/Utils) this_ext="List/Util" ;;
22995 PathTools) this_ext="Cwd" ;;
22997 echo " $xs_extensions $nonxs_extensions" > $tdir/$$.tmp;
22998 if $contains " $this_ext " $tdir/$$.tmp; then
23000 echo "Duplicate directories detected for extension $xxx" >&4;
23001 echo "Configure cannot correctly recover from this - shall I abort?" >&4;
23002 case "$knowitall" in
23010 echo "Ok. Stopping Configure." >&4;
23011 echo "Please remove the duplicate directory (e.g. using git clean) and then re-run Configure" >&4;
23014 echo "Ok. You will need to correct config.sh before running make." >&4;
23016 $ls -1 $xxx > $tdir/$$.tmp;
23017 if $contains "\.xs$" $tdir/$$.tmp > /dev/null 2>&1; then
23018 xs_extensions="$xs_extensions $this_ext";
23019 elif $contains "\.c$" $tdir/$$.tmp > /dev/null 2>&1; then
23020 xs_extensions="$xs_extensions $this_ext";
23021 elif $test -d $xxx; then
23022 nonxs_extensions="$nonxs_extensions $this_ext";
23024 $rm -f $tdir/$$.tmp;
23032 eval $find_extensions
23036 eval $find_extensions
23040 eval $find_extensions
23041 set X $xs_extensions
23043 xs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
23044 set X $nonxs_extensions
23046 nonxs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
23048 known_extensions=`echo $nonxs_extensions $xs_extensions | tr ' ' $trnl | $sort | tr $trnl ' '`
23050 : Now see which are supported on this system.
23052 for xxx in $xs_extensions ; do
23056 $define) avail_ext="$avail_ext $xxx" ;;
23059 GDBM_File|gdbm_fil)
23061 $define) avail_ext="$avail_ext $xxx" ;;
23064 I18N/Langinfo|i18n_lan)
23065 case "$i_langinfo$d_nl_langinfo" in
23066 $define$define) avail_ext="$avail_ext $xxx" ;;
23070 : XXX Do we need a useipcsysv variable here
23071 case "${d_msg}${d_sem}${d_shm}" in
23072 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
23075 NDBM_File|ndbm_fil)
23078 case "$osname-$use64bitint" in
23081 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
23084 *) avail_ext="$avail_ext $xxx" ;;
23089 ODBM_File|odbm_fil)
23090 case "${i_dbm}${i_rpcsvcdbm}" in
23092 case "$d_cplusplus" in
23093 define) ;; # delete as a function name will not work
23094 *) case "$osname-$use64bitint" in
23097 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
23100 *) avail_ext="$avail_ext $xxx" ;;
23108 case "$useopcode" in
23109 true|define|y) avail_ext="$avail_ext $xxx" ;;
23113 case "$useposix" in
23114 true|define|y) avail_ext="$avail_ext $xxx" ;;
23118 case "$d_socket" in
23119 true|$define|y) avail_ext="$avail_ext $xxx" ;;
23122 Sys/Syslog|sys/syslog)
23123 : XXX syslog requires socket
23124 case "$d_socket" in
23125 true|$define|y) avail_ext="$avail_ext $xxx" ;;
23129 case "$usethreads" in
23131 case "$use5005threads" in
23132 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
23136 threads|threads/shared)
23137 # threads and threads::shared are special cases.
23138 # To stop people from asking "Perl 5.8.0 was supposed
23139 # to have this new fancy threads implementation but my
23140 # perl doesn't have it" and from people trying to
23141 # (re)install the threads module using CPAN.pm and
23142 # CPAN.pm then offering to reinstall Perl 5.8.0,
23143 # the threads.pm and threads/shared.pm will always be
23144 # there, croaking informatively ("you need to rebuild
23145 # all of Perl with threads, sorry") when threads haven't
23146 # been compiled in.
23148 avail_ext="$avail_ext $xxx"
23154 cygwin) avail_ext="$avail_ext $xxx" ;;
23157 XS/APItest|xs/apitest)
23158 # This is just for testing. Skip it unless we have dynamic loading.
23161 $define) avail_ext="$avail_ext $xxx" ;;
23164 XS/Typemap|xs/typemap)
23165 # This is just for testing. Skip it unless we have dynamic loading.
23167 $define) avail_ext="$avail_ext $xxx" ;;
23170 *) avail_ext="$avail_ext $xxx"
23179 case "$onlyextensions" in
23181 *) keepextensions=''
23182 echo "You have requested that only certain extensions be included..." >&4
23183 for i in $onlyextensions; do
23184 case " $avail_ext " in
23186 echo "Keeping extension $i."
23187 keepextensions="$keepextensions $i"
23189 *) echo "Ignoring extension $i." ;;
23192 avail_ext="$keepextensions"
23196 case "$noextensions" in
23198 *) keepextensions=''
23199 echo "You have requested that certain extensions be ignored..." >&4
23200 for i in $avail_ext; do
23201 case " $noextensions " in
23202 *" $i "*) echo "Ignoring extension $i." ;;
23203 *) echo "Keeping extension $i.";
23204 keepextensions="$keepextensions $i"
23208 avail_ext="$keepextensions"
23212 : Now see which nonxs extensions are supported on this system.
23213 : For now assume all are.
23215 for xxx in $nonxs_extensions ; do
23219 *) nonxs_ext="$nonxs_ext $xxx"
23231 A number of extensions are supplied with $package. You may choose to
23232 compile these extensions for dynamic loading (the default), compile
23233 them into the $package executable (static loading), or not include
23234 them at all. Answer "none" to include no extensions.
23235 Note that DynaLoader is always built and need not be mentioned here.
23238 case "$dynamic_ext" in
23240 : Exclude those listed in static_ext
23242 for xxx in $avail_ext; do
23243 case " $static_ext " in
23245 *) dflt="$dflt $xxx" ;;
23252 *) dflt="$dynamic_ext"
23253 # Perhaps we are reusing an old out-of-date config.sh.
23256 if test X"$dynamic_ext" != X"$avail_ext"; then
23258 NOTICE: Your previous config.sh list may be incorrect.
23259 The extensions now available to you are
23261 but the default list from your previous config.sh is
23273 rp="What extensions do you wish to load dynamically?"
23276 none) dynamic_ext=' ' ;;
23277 *) dynamic_ext="$ans" ;;
23280 case "$static_ext" in
23282 : Exclude those already listed in dynamic linking
23284 for xxx in $avail_ext; do
23285 case " $dynamic_ext " in
23287 *) dflt="$dflt $xxx" ;;
23294 *) dflt="$static_ext"
23301 rp="What extensions do you wish to load statically?"
23304 none) static_ext=' ' ;;
23305 *) static_ext="$ans" ;;
23310 A number of extensions are supplied with $package. Answer "none"
23311 to include no extensions.
23312 Note that DynaLoader is always built and need not be mentioned here.
23315 case "$static_ext" in
23316 '') dflt="$avail_ext" ;;
23317 *) dflt="$static_ext"
23318 # Perhaps we are reusing an old out-of-date config.sh.
23321 if test X"$static_ext" != X"$avail_ext"; then
23323 NOTICE: Your previous config.sh list may be incorrect.
23324 The extensions now available to you are
23326 but the default list from your previous config.sh is
23335 : Exclude those that are not xs extensions
23339 rp="What extensions do you wish to include?"
23342 none) static_ext=' ' ;;
23343 *) static_ext="$ans" ;;
23348 # Encode is a special case. If we are building Encode as a static
23349 # extension, we need to explicitly list its subextensions as well.
23350 # For other nested extensions, this is handled automatically by
23351 # the appropriate Makefile.PL.
23352 case " $static_ext " in
23353 *" Encode "*) # Add the subextensions of Encode
23355 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
23356 static_ext="$static_ext Encode/$xxx"
23357 known_extensions="$known_extensions Encode/$xxx"
23363 set X $dynamic_ext $static_ext $nonxs_ext
23367 # Sanity check: We require an extension suitable for use with
23368 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
23369 # should show up as failures in the test suite, but it's helpful to
23370 # catch them now.) The 'extensions' list is normally sorted
23371 # alphabetically, so we need to accept either
23372 # DB_File ... Fcntl ... IO ....
23373 # or something like
23374 # Fcntl ... NDBM_File ... IO ....
23375 case " $extensions" in
23376 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
23377 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
23378 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
23379 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
23380 echo "WARNING: The Perl you are building will be quite crippled." >& 4
23384 : Remove libraries needed only for extensions
23385 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
23386 : The exception is SunOS 4.x, which needs them.
23387 case "${osname}X${osvers}" in
23391 *) case "$usedl" in
23392 $define|true|[yY]*)
23393 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
23397 *) perllibs="$libs"
23403 : Remove build directory name from cppstdin so it can be used from
23404 : either the present location or the final installed location.
23406 : Get out of the UU directory to get correct path name.
23408 case "$cppstdin" in
23410 echo "Stripping down cppstdin path name"
23416 : end of configuration questions
23418 echo "End of configuration questions."
23421 : back to where it started
23422 if test -d ../UU; then
23426 : configuration may be unconditionally patched via a 'config.arch' file
23427 if $test -f config.arch; then
23428 echo "I see a config.arch file, loading it." >&4
23432 : configuration may be patched via a 'config.over' file
23433 if $test -f config.over; then
23436 rp='I see a config.over file. Do you wish to load it?'
23439 n*) echo "OK, I'll ignore it.";;
23441 echo "Configuration override changes have been loaded."
23446 : in case they want portability, strip down executable paths
23447 case "$d_portable" in
23450 echo "Stripping down executable paths..." >&4
23451 for file in $loclist $trylist; do
23453 eval $file=`basename $temp`
23458 : create config.sh file
23460 echo "Creating config.sh..." >&4
23461 $spitshell <<EOT >config.sh
23464 # This file was produced by running the Configure script. It holds all the
23465 # definitions figured out by Configure. Should you modify one of these values,
23466 # do not forget to propagate your changes by running "Configure -der". You may
23467 # instead choose to run each of the .SH files by yourself, or "Configure -S".
23470 # Package name : $package
23471 # Source directory : $src
23472 # Configuration time: $cf_time
23473 # Configured by : $cf_by
23474 # Target system : $myuname
23477 : Add in command line options if available
23478 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
23480 $spitshell <<EOT >>config.sh
23489 Revision='$Revision'
23497 alignbytes='$alignbytes'
23498 ansi2knr='$ansi2knr'
23499 aphostname='$aphostname'
23500 api_revision='$api_revision'
23501 api_subversion='$api_subversion'
23502 api_version='$api_version'
23503 api_versionstring='$api_versionstring'
23506 archlibexp='$archlibexp'
23507 archname64='$archname64'
23508 archname='$archname'
23509 archobjs='$archobjs'
23510 asctime_r_proto='$asctime_r_proto'
23519 byteorder='$byteorder'
23521 castflags='$castflags'
23524 cccdlflags='$cccdlflags'
23525 ccdlflags='$ccdlflags'
23527 ccflags_uselargefiles='$ccflags_uselargefiles'
23529 ccsymbols='$ccsymbols'
23530 ccversion='$ccversion'
23532 cf_email='$cf_email'
23534 charbits='$charbits'
23535 charsize='$charsize'
23539 clocktype='$clocktype'
23541 compress='$compress'
23542 contains='$contains'
23546 cpp_stuff='$cpp_stuff'
23547 cppccsymbols='$cppccsymbols'
23548 cppflags='$cppflags'
23550 cppminus='$cppminus'
23552 cppstdin='$cppstdin'
23553 cppsymbols='$cppsymbols'
23554 crypt_r_proto='$crypt_r_proto'
23555 cryptlib='$cryptlib'
23557 ctermid_r_proto='$ctermid_r_proto'
23558 ctime_r_proto='$ctime_r_proto'
23559 d_Gconvert='$d_Gconvert'
23560 d_PRIEUldbl='$d_PRIEUldbl'
23561 d_PRIFUldbl='$d_PRIFUldbl'
23562 d_PRIGUldbl='$d_PRIGUldbl'
23563 d_PRIXU64='$d_PRIXU64'
23564 d_PRId64='$d_PRId64'
23565 d_PRIeldbl='$d_PRIeldbl'
23566 d_PRIfldbl='$d_PRIfldbl'
23567 d_PRIgldbl='$d_PRIgldbl'
23568 d_PRIi64='$d_PRIi64'
23569 d_PRIo64='$d_PRIo64'
23570 d_PRIu64='$d_PRIu64'
23571 d_PRIx64='$d_PRIx64'
23572 d_SCNfldbl='$d_SCNfldbl'
23573 d__fwalk='$d__fwalk'
23574 d_access='$d_access'
23575 d_accessx='$d_accessx'
23579 d_archlib='$d_archlib'
23580 d_asctime64='$d_asctime64'
23581 d_asctime_r='$d_asctime_r'
23584 d_attribute_deprecated='$d_attribute_deprecated'
23585 d_attribute_format='$d_attribute_format'
23586 d_attribute_malloc='$d_attribute_malloc'
23587 d_attribute_nonnull='$d_attribute_nonnull'
23588 d_attribute_noreturn='$d_attribute_noreturn'
23589 d_attribute_pure='$d_attribute_pure'
23590 d_attribute_unused='$d_attribute_unused'
23591 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
23592 d_backtrace='$d_backtrace'
23596 d_bsdgetpgrp='$d_bsdgetpgrp'
23597 d_bsdsetpgrp='$d_bsdsetpgrp'
23598 d_builtin_choose_expr='$d_builtin_choose_expr'
23599 d_builtin_expect='$d_builtin_expect'
23601 d_c99_variadic_macros='$d_c99_variadic_macros'
23602 d_casti32='$d_casti32'
23603 d_castneg='$d_castneg'
23604 d_charvspr='$d_charvspr'
23606 d_chroot='$d_chroot'
23607 d_chsize='$d_chsize'
23609 d_clearenv='$d_clearenv'
23610 d_closedir='$d_closedir'
23611 d_cmsghdr_s='$d_cmsghdr_s'
23613 d_copysignl='$d_copysignl'
23614 d_cplusplus='$d_cplusplus'
23616 d_crypt_r='$d_crypt_r'
23618 d_ctermid='$d_ctermid'
23619 d_ctermid_r='$d_ctermid_r'
23620 d_ctime64='$d_ctime64'
23621 d_ctime_r='$d_ctime_r'
23622 d_cuserid='$d_cuserid'
23623 d_dbl_dig='$d_dbl_dig'
23624 d_dbminitproto='$d_dbminitproto'
23625 d_difftime64='$d_difftime64'
23626 d_difftime='$d_difftime'
23627 d_dir_dd_fd='$d_dir_dd_fd'
23629 d_dirnamlen='$d_dirnamlen'
23630 d_dladdr='$d_dladdr'
23631 d_dlerror='$d_dlerror'
23632 d_dlopen='$d_dlopen'
23633 d_dlsymun='$d_dlsymun'
23634 d_dosuid='$d_dosuid'
23635 d_drand48_r='$d_drand48_r'
23636 d_drand48proto='$d_drand48proto'
23638 d_eaccess='$d_eaccess'
23639 d_endgrent='$d_endgrent'
23640 d_endgrent_r='$d_endgrent_r'
23641 d_endhent='$d_endhent'
23642 d_endhostent_r='$d_endhostent_r'
23643 d_endnent='$d_endnent'
23644 d_endnetent_r='$d_endnetent_r'
23645 d_endpent='$d_endpent'
23646 d_endprotoent_r='$d_endprotoent_r'
23647 d_endpwent='$d_endpwent'
23648 d_endpwent_r='$d_endpwent_r'
23649 d_endsent='$d_endsent'
23650 d_endservent_r='$d_endservent_r'
23651 d_eofnblk='$d_eofnblk'
23652 d_eunice='$d_eunice'
23653 d_faststdio='$d_faststdio'
23654 d_fchdir='$d_fchdir'
23655 d_fchmod='$d_fchmod'
23656 d_fchown='$d_fchown'
23658 d_fcntl_can_lock='$d_fcntl_can_lock'
23659 d_fd_macros='$d_fd_macros'
23660 d_fd_set='$d_fd_set'
23661 d_fds_bits='$d_fds_bits'
23662 d_fegetround='$d_fegetround'
23663 d_fgetpos='$d_fgetpos'
23664 d_finite='$d_finite'
23665 d_finitel='$d_finitel'
23666 d_flexfnam='$d_flexfnam'
23668 d_flockproto='$d_flockproto'
23670 d_fp_class='$d_fp_class'
23671 d_fp_classify='$d_fp_classify'
23672 d_fp_classl='$d_fp_classl'
23673 d_fpathconf='$d_fpathconf'
23674 d_fpclass='$d_fpclass'
23675 d_fpclassify='$d_fpclassify'
23676 d_fpclassl='$d_fpclassl'
23677 d_fpgetround='$d_fpgetround'
23678 d_fpos64_t='$d_fpos64_t'
23679 d_frexpl='$d_frexpl'
23680 d_fs_data_s='$d_fs_data_s'
23681 d_fseeko='$d_fseeko'
23682 d_fsetpos='$d_fsetpos'
23683 d_fstatfs='$d_fstatfs'
23684 d_fstatvfs='$d_fstatvfs'
23686 d_ftello='$d_ftello'
23688 d_futimes='$d_futimes'
23689 d_gdbm_ndbm_h_uses_prototypes='$d_gdbm_ndbm_h_uses_prototypes'
23690 d_gdbmndbm_h_uses_prototypes='$d_gdbmndbm_h_uses_prototypes'
23691 d_getaddrinfo='$d_getaddrinfo'
23692 d_getcwd='$d_getcwd'
23693 d_getespwnam='$d_getespwnam'
23694 d_getfsstat='$d_getfsstat'
23695 d_getgrent='$d_getgrent'
23696 d_getgrent_r='$d_getgrent_r'
23697 d_getgrgid_r='$d_getgrgid_r'
23698 d_getgrnam_r='$d_getgrnam_r'
23699 d_getgrps='$d_getgrps'
23700 d_gethbyaddr='$d_gethbyaddr'
23701 d_gethbyname='$d_gethbyname'
23702 d_gethent='$d_gethent'
23703 d_gethname='$d_gethname'
23704 d_gethostbyaddr_r='$d_gethostbyaddr_r'
23705 d_gethostbyname_r='$d_gethostbyname_r'
23706 d_gethostent_r='$d_gethostent_r'
23707 d_gethostprotos='$d_gethostprotos'
23708 d_getitimer='$d_getitimer'
23709 d_getlogin='$d_getlogin'
23710 d_getlogin_r='$d_getlogin_r'
23711 d_getmnt='$d_getmnt'
23712 d_getmntent='$d_getmntent'
23713 d_getnameinfo='$d_getnameinfo'
23714 d_getnbyaddr='$d_getnbyaddr'
23715 d_getnbyname='$d_getnbyname'
23716 d_getnent='$d_getnent'
23717 d_getnetbyaddr_r='$d_getnetbyaddr_r'
23718 d_getnetbyname_r='$d_getnetbyname_r'
23719 d_getnetent_r='$d_getnetent_r'
23720 d_getnetprotos='$d_getnetprotos'
23721 d_getpagsz='$d_getpagsz'
23722 d_getpbyname='$d_getpbyname'
23723 d_getpbynumber='$d_getpbynumber'
23724 d_getpent='$d_getpent'
23725 d_getpgid='$d_getpgid'
23726 d_getpgrp2='$d_getpgrp2'
23727 d_getpgrp='$d_getpgrp'
23728 d_getppid='$d_getppid'
23729 d_getprior='$d_getprior'
23730 d_getprotobyname_r='$d_getprotobyname_r'
23731 d_getprotobynumber_r='$d_getprotobynumber_r'
23732 d_getprotoent_r='$d_getprotoent_r'
23733 d_getprotoprotos='$d_getprotoprotos'
23734 d_getprpwnam='$d_getprpwnam'
23735 d_getpwent='$d_getpwent'
23736 d_getpwent_r='$d_getpwent_r'
23737 d_getpwnam_r='$d_getpwnam_r'
23738 d_getpwuid_r='$d_getpwuid_r'
23739 d_getsbyname='$d_getsbyname'
23740 d_getsbyport='$d_getsbyport'
23741 d_getsent='$d_getsent'
23742 d_getservbyname_r='$d_getservbyname_r'
23743 d_getservbyport_r='$d_getservbyport_r'
23744 d_getservent_r='$d_getservent_r'
23745 d_getservprotos='$d_getservprotos'
23746 d_getspnam='$d_getspnam'
23747 d_getspnam_r='$d_getspnam_r'
23748 d_gettimeod='$d_gettimeod'
23749 d_gmtime64='$d_gmtime64'
23750 d_gmtime_r='$d_gmtime_r'
23751 d_gnulibc='$d_gnulibc'
23752 d_grpasswd='$d_grpasswd'
23753 d_hasmntopt='$d_hasmntopt'
23755 d_ilogbl='$d_ilogbl'
23756 d_inc_version_list='$d_inc_version_list'
23758 d_inetaton='$d_inetaton'
23759 d_inetntop='$d_inetntop'
23760 d_inetpton='$d_inetpton'
23761 d_int64_t='$d_int64_t'
23762 d_ip_mreq='$d_ip_mreq'
23763 d_ip_mreq_source='$d_ip_mreq_source'
23764 d_ipv6_mreq='$d_ipv6_mreq'
23765 d_ipv6_mreq_source='$d_ipv6_mreq_source'
23766 d_isascii='$d_isascii'
23767 d_isblank='$d_isblank'
23768 d_isfinite='$d_isfinite'
23769 d_isfinitel='$d_isfinitel'
23771 d_isinfl='$d_isinfl'
23773 d_isnanl='$d_isnanl'
23776 d_killpg='$d_killpg'
23777 d_lchown='$d_lchown'
23778 d_ldbl_dig='$d_ldbl_dig'
23779 d_ldexpl='$d_ldexpl'
23780 d_libm_lib_version='$d_libm_lib_version'
23781 d_libname_unique='$d_libname_unique'
23783 d_localtime64='$d_localtime64'
23784 d_localtime_r='$d_localtime_r'
23785 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
23786 d_locconv='$d_locconv'
23787 d_lc_monetary_2008='$d_lc_monetary_2008'
23789 d_longdbl='$d_longdbl'
23790 d_longlong='$d_longlong'
23791 d_lseekproto='$d_lseekproto'
23793 d_madvise='$d_madvise'
23794 d_malloc_good_size='$d_malloc_good_size'
23795 d_malloc_size='$d_malloc_size'
23797 d_mbstowcs='$d_mbstowcs'
23798 d_mbtowc='$d_mbtowc'
23799 d_memchr='$d_memchr'
23800 d_memcmp='$d_memcmp'
23801 d_memcpy='$d_memcpy'
23802 d_memmove='$d_memmove'
23803 d_memset='$d_memset'
23805 d_mkdtemp='$d_mkdtemp'
23806 d_mkfifo='$d_mkfifo'
23807 d_mkstemp='$d_mkstemp'
23808 d_mkstemps='$d_mkstemps'
23809 d_mktime64='$d_mktime64'
23810 d_mktime='$d_mktime'
23813 d_modfl_pow32_bug='$d_modfl_pow32_bug'
23814 d_modflproto='$d_modflproto'
23815 d_mprotect='$d_mprotect'
23817 d_msg_ctrunc='$d_msg_ctrunc'
23818 d_msg_dontroute='$d_msg_dontroute'
23819 d_msg_oob='$d_msg_oob'
23820 d_msg_peek='$d_msg_peek'
23821 d_msg_proxy='$d_msg_proxy'
23822 d_msgctl='$d_msgctl'
23823 d_msgget='$d_msgget'
23824 d_msghdr_s='$d_msghdr_s'
23825 d_msgrcv='$d_msgrcv'
23826 d_msgsnd='$d_msgsnd'
23828 d_munmap='$d_munmap'
23829 d_mymalloc='$d_mymalloc'
23831 d_ndbm_h_uses_prototypes='$d_ndbm_h_uses_prototypes'
23833 d_nl_langinfo='$d_nl_langinfo'
23834 d_nv_preserves_uv='$d_nv_preserves_uv'
23835 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
23836 d_off64_t='$d_off64_t'
23837 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
23838 d_oldpthreads='$d_oldpthreads'
23839 d_oldsock='$d_oldsock'
23841 d_pathconf='$d_pathconf'
23843 d_perl_otherlibdirs='$d_perl_otherlibdirs'
23844 d_phostname='$d_phostname'
23847 d_portable='$d_portable'
23849 d_prctl_set_name='$d_prctl_set_name'
23850 d_printf_format_null='$d_printf_format_null'
23851 d_procselfexe='$d_procselfexe'
23852 d_pseudofork='$d_pseudofork'
23853 d_pthread_atfork='$d_pthread_atfork'
23854 d_pthread_attr_setscope='$d_pthread_attr_setscope'
23855 d_pthread_yield='$d_pthread_yield'
23856 d_ptrdiff_t='$d_ptrdiff_t'
23858 d_pwchange='$d_pwchange'
23859 d_pwclass='$d_pwclass'
23860 d_pwcomment='$d_pwcomment'
23861 d_pwexpire='$d_pwexpire'
23862 d_pwgecos='$d_pwgecos'
23863 d_pwpasswd='$d_pwpasswd'
23864 d_pwquota='$d_pwquota'
23867 d_random_r='$d_random_r'
23868 d_readdir64_r='$d_readdir64_r'
23869 d_readdir='$d_readdir'
23870 d_readdir_r='$d_readdir_r'
23871 d_readlink='$d_readlink'
23873 d_recvmsg='$d_recvmsg'
23874 d_rename='$d_rename'
23875 d_rewinddir='$d_rewinddir'
23877 d_safebcpy='$d_safebcpy'
23878 d_safemcpy='$d_safemcpy'
23879 d_sanemcmp='$d_sanemcmp'
23880 d_sbrkproto='$d_sbrkproto'
23881 d_scalbnl='$d_scalbnl'
23882 d_sched_yield='$d_sched_yield'
23883 d_scm_rights='$d_scm_rights'
23884 d_seekdir='$d_seekdir'
23885 d_select='$d_select'
23887 d_semctl='$d_semctl'
23888 d_semctl_semid_ds='$d_semctl_semid_ds'
23889 d_semctl_semun='$d_semctl_semun'
23890 d_semget='$d_semget'
23892 d_sendmsg='$d_sendmsg'
23893 d_setegid='$d_setegid'
23894 d_seteuid='$d_seteuid'
23895 d_setgrent='$d_setgrent'
23896 d_setgrent_r='$d_setgrent_r'
23897 d_setgrps='$d_setgrps'
23898 d_sethent='$d_sethent'
23899 d_sethostent_r='$d_sethostent_r'
23900 d_setitimer='$d_setitimer'
23901 d_setlinebuf='$d_setlinebuf'
23902 d_setlocale='$d_setlocale'
23903 d_setlocale_r='$d_setlocale_r'
23904 d_setnent='$d_setnent'
23905 d_setnetent_r='$d_setnetent_r'
23906 d_setpent='$d_setpent'
23907 d_setpgid='$d_setpgid'
23908 d_setpgrp2='$d_setpgrp2'
23909 d_setpgrp='$d_setpgrp'
23910 d_setprior='$d_setprior'
23911 d_setproctitle='$d_setproctitle'
23912 d_setprotoent_r='$d_setprotoent_r'
23913 d_setpwent='$d_setpwent'
23914 d_setpwent_r='$d_setpwent_r'
23915 d_setregid='$d_setregid'
23916 d_setresgid='$d_setresgid'
23917 d_setresuid='$d_setresuid'
23918 d_setreuid='$d_setreuid'
23919 d_setrgid='$d_setrgid'
23920 d_setruid='$d_setruid'
23921 d_setsent='$d_setsent'
23922 d_setservent_r='$d_setservent_r'
23923 d_setsid='$d_setsid'
23924 d_setvbuf='$d_setvbuf'
23927 d_shmatprototype='$d_shmatprototype'
23928 d_shmctl='$d_shmctl'
23930 d_shmget='$d_shmget'
23931 d_sigaction='$d_sigaction'
23932 d_signbit='$d_signbit'
23933 d_sigprocmask='$d_sigprocmask'
23934 d_sigsetjmp='$d_sigsetjmp'
23935 d_sin6_scope_id='$d_sin6_scope_id'
23936 d_sitearch='$d_sitearch'
23937 d_snprintf='$d_snprintf'
23938 d_sockaddr_in6='$d_sockaddr_in6'
23939 d_sockaddr_sa_len='$d_sockaddr_sa_len'
23940 d_sockatmark='$d_sockatmark'
23941 d_sockatmarkproto='$d_sockatmarkproto'
23942 d_socket='$d_socket'
23943 d_socklen_t='$d_socklen_t'
23944 d_sockpair='$d_sockpair'
23945 d_socks5_init='$d_socks5_init'
23946 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
23948 d_srand48_r='$d_srand48_r'
23949 d_srandom_r='$d_srandom_r'
23950 d_sresgproto='$d_sresgproto'
23951 d_sresuproto='$d_sresuproto'
23952 d_statblks='$d_statblks'
23953 d_statfs_f_flags='$d_statfs_f_flags'
23954 d_statfs_s='$d_statfs_s'
23955 d_static_inline='$d_static_inline'
23956 d_statvfs='$d_statvfs'
23957 d_stdio_cnt_lval='$d_stdio_cnt_lval'
23958 d_stdio_ptr_lval='$d_stdio_ptr_lval'
23959 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
23960 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
23961 d_stdio_stream_array='$d_stdio_stream_array'
23962 d_stdiobase='$d_stdiobase'
23963 d_stdstdio='$d_stdstdio'
23964 d_strchr='$d_strchr'
23965 d_strcoll='$d_strcoll'
23966 d_strctcpy='$d_strctcpy'
23967 d_strerrm='$d_strerrm'
23968 d_strerror='$d_strerror'
23969 d_strerror_r='$d_strerror_r'
23970 d_strftime='$d_strftime'
23971 d_strlcat='$d_strlcat'
23972 d_strlcpy='$d_strlcpy'
23973 d_strtod='$d_strtod'
23974 d_strtol='$d_strtol'
23975 d_strtold='$d_strtold'
23976 d_strtoll='$d_strtoll'
23977 d_strtoq='$d_strtoq'
23978 d_strtoul='$d_strtoul'
23979 d_strtoull='$d_strtoull'
23980 d_strtouq='$d_strtouq'
23981 d_strxfrm='$d_strxfrm'
23982 d_suidsafe='$d_suidsafe'
23983 d_symlink='$d_symlink'
23984 d_syscall='$d_syscall'
23985 d_syscallproto='$d_syscallproto'
23986 d_sysconf='$d_sysconf'
23987 d_sysernlst='$d_sysernlst'
23988 d_syserrlst='$d_syserrlst'
23989 d_system='$d_system'
23990 d_tcgetpgrp='$d_tcgetpgrp'
23991 d_tcsetpgrp='$d_tcsetpgrp'
23992 d_telldir='$d_telldir'
23993 d_telldirproto='$d_telldirproto'
23995 d_timegm='$d_timegm'
23997 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
23998 d_tm_tm_zone='$d_tm_tm_zone'
23999 d_tmpnam_r='$d_tmpnam_r'
24000 d_truncate='$d_truncate'
24001 d_truncl='$d_truncl'
24002 d_ttyname_r='$d_ttyname_r'
24003 d_tzname='$d_tzname'
24004 d_u32align='$d_u32align'
24005 d_ualarm='$d_ualarm'
24008 d_union_semun='$d_union_semun'
24009 d_unordered='$d_unordered'
24010 d_unsetenv='$d_unsetenv'
24011 d_usleep='$d_usleep'
24012 d_usleepproto='$d_usleepproto'
24014 d_vendorarch='$d_vendorarch'
24015 d_vendorbin='$d_vendorbin'
24016 d_vendorlib='$d_vendorlib'
24017 d_vendorscript='$d_vendorscript'
24019 d_void_closedir='$d_void_closedir'
24020 d_voidsig='$d_voidsig'
24021 d_voidtty='$d_voidtty'
24022 d_volatile='$d_volatile'
24023 d_vprintf='$d_vprintf'
24024 d_vsnprintf='$d_vsnprintf'
24026 d_waitpid='$d_waitpid'
24027 d_wcscmp='$d_wcscmp'
24028 d_wcstombs='$d_wcstombs'
24029 d_wcsxfrm='$d_wcsxfrm'
24030 d_wctomb='$d_wctomb'
24031 d_writev='$d_writev'
24034 db_hashtype='$db_hashtype'
24035 db_prefixtype='$db_prefixtype'
24036 db_version_major='$db_version_major'
24037 db_version_minor='$db_version_minor'
24038 db_version_patch='$db_version_patch'
24039 direntrytype='$direntrytype'
24042 doublekind='$doublekind'
24043 doublesize='$doublesize'
24045 drand48_r_proto='$drand48_r_proto'
24047 dynamic_ext='$dynamic_ext'
24053 endgrent_r_proto='$endgrent_r_proto'
24054 endhostent_r_proto='$endhostent_r_proto'
24055 endnetent_r_proto='$endnetent_r_proto'
24056 endprotoent_r_proto='$endprotoent_r_proto'
24057 endpwent_r_proto='$endpwent_r_proto'
24058 endservent_r_proto='$endservent_r_proto'
24059 eunicefix='$eunicefix'
24062 extensions='$extensions'
24063 extern_C='$extern_C'
24065 fflushNULL='$fflushNULL'
24066 fflushall='$fflushall'
24068 firstmakefile='$firstmakefile'
24070 fpossize='$fpossize'
24071 fpostype='$fpostype'
24072 freetype='$freetype'
24075 full_csh='$full_csh'
24076 full_sed='$full_sed'
24077 gccansipedantic='$gccansipedantic'
24078 gccosandvers='$gccosandvers'
24079 gccversion='$gccversion'
24080 getgrent_r_proto='$getgrent_r_proto'
24081 getgrgid_r_proto='$getgrgid_r_proto'
24082 getgrnam_r_proto='$getgrnam_r_proto'
24083 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
24084 gethostbyname_r_proto='$gethostbyname_r_proto'
24085 gethostent_r_proto='$gethostent_r_proto'
24086 getlogin_r_proto='$getlogin_r_proto'
24087 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
24088 getnetbyname_r_proto='$getnetbyname_r_proto'
24089 getnetent_r_proto='$getnetent_r_proto'
24090 getprotobyname_r_proto='$getprotobyname_r_proto'
24091 getprotobynumber_r_proto='$getprotobynumber_r_proto'
24092 getprotoent_r_proto='$getprotoent_r_proto'
24093 getpwent_r_proto='$getpwent_r_proto'
24094 getpwnam_r_proto='$getpwnam_r_proto'
24095 getpwuid_r_proto='$getpwuid_r_proto'
24096 getservbyname_r_proto='$getservbyname_r_proto'
24097 getservbyport_r_proto='$getservbyport_r_proto'
24098 getservent_r_proto='$getservent_r_proto'
24099 getspnam_r_proto='$getspnam_r_proto'
24100 gidformat='$gidformat'
24106 gmtime_r_proto='$gmtime_r_proto'
24107 gnulibc_version='$gnulibc_version'
24109 groupcat='$groupcat'
24110 groupstype='$groupstype'
24113 h_sysfile='$h_sysfile'
24116 hostgenerate='$hostgenerate'
24117 hostosname='$hostosname'
24118 hostperl='$hostperl'
24119 html1dir='$html1dir'
24120 html1direxp='$html1direxp'
24121 html3dir='$html3dir'
24122 html3direxp='$html3direxp'
24131 i_arpainet='$i_arpainet'
24132 i_assert='$i_assert'
24134 i_bsdioctl='$i_bsdioctl'
24138 i_dirent='$i_dirent'
24140 i_execinfo='$i_execinfo'
24145 i_fp_class='$i_fp_class'
24147 i_gdbm_ndbm='$i_gdbm_ndbm'
24148 i_gdbmndbm='$i_gdbmndbm'
24150 i_ieeefp='$i_ieeefp'
24151 i_inttypes='$i_inttypes'
24152 i_langinfo='$i_langinfo'
24153 i_libutil='$i_libutil'
24154 i_limits='$i_limits'
24155 i_locale='$i_locale'
24156 i_machcthr='$i_machcthr'
24157 i_malloc='$i_malloc'
24158 i_mallocmalloc='$i_mallocmalloc'
24160 i_memory='$i_memory'
24161 i_mntent='$i_mntent'
24164 i_neterrno='$i_neterrno'
24165 i_netinettcp='$i_netinettcp'
24169 i_pthread='$i_pthread'
24171 i_quadmath='$i_quadmath'
24172 i_rpcsvcdbm='$i_rpcsvcdbm'
24174 i_shadow='$i_shadow'
24176 i_stdarg='$i_stdarg'
24177 i_stdbool='$i_stdbool'
24178 i_stddef='$i_stddef'
24179 i_stdint='$i_stdint'
24180 i_stdlib='$i_stdlib'
24181 i_string='$i_string'
24182 i_sunmath='$i_sunmath'
24183 i_sysaccess='$i_sysaccess'
24184 i_sysdir='$i_sysdir'
24185 i_sysfile='$i_sysfile'
24186 i_sysfilio='$i_sysfilio'
24188 i_sysioctl='$i_sysioctl'
24189 i_syslog='$i_syslog'
24190 i_sysmman='$i_sysmman'
24191 i_sysmode='$i_sysmode'
24192 i_sysmount='$i_sysmount'
24193 i_sysndir='$i_sysndir'
24194 i_sysparam='$i_sysparam'
24195 i_syspoll='$i_syspoll'
24196 i_sysresrc='$i_sysresrc'
24197 i_syssecrt='$i_syssecrt'
24198 i_sysselct='$i_sysselct'
24199 i_syssockio='$i_syssockio'
24200 i_sysstat='$i_sysstat'
24201 i_sysstatfs='$i_sysstatfs'
24202 i_sysstatvfs='$i_sysstatvfs'
24203 i_systime='$i_systime'
24204 i_systimek='$i_systimek'
24205 i_systimes='$i_systimes'
24206 i_systypes='$i_systypes'
24207 i_sysuio='$i_sysuio'
24209 i_sysutsname='$i_sysutsname'
24210 i_sysvfs='$i_sysvfs'
24211 i_syswait='$i_syswait'
24212 i_termio='$i_termio'
24213 i_termios='$i_termios'
24215 i_unistd='$i_unistd'
24218 i_values='$i_values'
24219 i_varargs='$i_varargs'
24220 i_varhdr='$i_varhdr'
24222 ignore_versioned_solibs='$ignore_versioned_solibs'
24223 inc_version_list='$inc_version_list'
24224 inc_version_list_init='$inc_version_list_init'
24228 initialinstalllocation='$initialinstalllocation'
24229 installarchlib='$installarchlib'
24230 installbin='$installbin'
24231 installhtml1dir='$installhtml1dir'
24232 installhtml3dir='$installhtml3dir'
24233 installman1dir='$installman1dir'
24234 installman3dir='$installman3dir'
24235 installprefix='$installprefix'
24236 installprefixexp='$installprefixexp'
24237 installprivlib='$installprivlib'
24238 installscript='$installscript'
24239 installsitearch='$installsitearch'
24240 installsitebin='$installsitebin'
24241 installsitehtml1dir='$installsitehtml1dir'
24242 installsitehtml3dir='$installsitehtml3dir'
24243 installsitelib='$installsitelib'
24244 installsiteman1dir='$installsiteman1dir'
24245 installsiteman3dir='$installsiteman3dir'
24246 installsitescript='$installsitescript'
24247 installstyle='$installstyle'
24248 installusrbinperl='$installusrbinperl'
24249 installvendorarch='$installvendorarch'
24250 installvendorbin='$installvendorbin'
24251 installvendorhtml1dir='$installvendorhtml1dir'
24252 installvendorhtml3dir='$installvendorhtml3dir'
24253 installvendorlib='$installvendorlib'
24254 installvendorman1dir='$installvendorman1dir'
24255 installvendorman3dir='$installvendorman3dir'
24256 installvendorscript='$installvendorscript'
24258 issymlink='$issymlink'
24259 ivdformat='$ivdformat'
24262 known_extensions='$known_extensions'
24265 ld_can_script='$ld_can_script'
24266 lddlflags='$lddlflags'
24268 ldflags_uselargefiles='$ldflags_uselargefiles'
24269 ldlibpthname='$ldlibpthname'
24276 libsdirs='$libsdirs'
24277 libsfiles='$libsfiles'
24278 libsfound='$libsfound'
24279 libspath='$libspath'
24280 libswanted='$libswanted'
24281 libswanted_uselargefiles='$libswanted_uselargefiles'
24287 localtime_r_proto='$localtime_r_proto'
24288 locincpth='$locincpth'
24289 loclibpth='$loclibpth'
24290 longdblkind='$longdblkind'
24291 longdblsize='$longdblsize'
24292 longlongsize='$longlongsize'
24293 longsize='$longsize'
24297 lseeksize='$lseeksize'
24298 lseektype='$lseektype'
24302 make_set_make='$make_set_make'
24303 mallocobj='$mallocobj'
24304 mallocsrc='$mallocsrc'
24305 malloctype='$malloctype'
24307 man1direxp='$man1direxp'
24310 man3direxp='$man3direxp'
24312 mips_type='$mips_type'
24313 mistrustnm='$mistrustnm'
24315 mmaptype='$mmaptype'
24316 modetype='$modetype'
24318 multiarch='$multiarch'
24320 myarchname='$myarchname'
24321 mydomain='$mydomain'
24322 myhostname='$myhostname'
24325 need_va_copy='$need_va_copy'
24326 netdb_hlen_type='$netdb_hlen_type'
24327 netdb_host_type='$netdb_host_type'
24328 netdb_name_type='$netdb_name_type'
24329 netdb_net_type='$netdb_net_type'
24332 nm_so_opt='$nm_so_opt'
24333 nonxs_ext='$nonxs_ext'
24335 nvEUformat='$nvEUformat'
24336 nvFUformat='$nvFUformat'
24337 nvGUformat='$nvGUformat'
24338 nv_overflows_integers_at='$nv_overflows_integers_at'
24339 nv_preserves_uv_bits='$nv_preserves_uv_bits'
24340 nveformat='$nveformat'
24341 nvfformat='$nvfformat'
24342 nvgformat='$nvgformat'
24345 o_nonblock='$o_nonblock'
24347 old_pthread_create_joinable='$old_pthread_create_joinable'
24348 optimize='$optimize'
24349 orderlib='$orderlib'
24352 otherlibdirs='$otherlibdirs'
24356 patchlevel='$patchlevel'
24357 path_sep='$path_sep'
24360 perl_patchlevel='$perl_patchlevel'
24361 perl_static_inline='$perl_static_inline'
24362 perladmin='$perladmin'
24363 perllibs='$perllibs'
24364 perlpath='$perlpath'
24366 phostname='$phostname'
24372 prefixexp='$prefixexp'
24374 privlibexp='$privlibexp'
24375 procselfexe='$procselfexe'
24376 prototype='$prototype'
24378 quadkind='$quadkind'
24379 quadtype='$quadtype'
24380 randbits='$randbits'
24381 randfunc='$randfunc'
24382 random_r_proto='$random_r_proto'
24383 randseedtype='$randseedtype'
24385 rd_nodata='$rd_nodata'
24386 readdir64_r_proto='$readdir64_r_proto'
24387 readdir_r_proto='$readdir_r_proto'
24388 revision='$revision'
24394 sGMTIME_max='$sGMTIME_max'
24395 sGMTIME_min='$sGMTIME_min'
24396 sLOCALTIME_max='$sLOCALTIME_max'
24397 sLOCALTIME_min='$sLOCALTIME_min'
24398 sPRIEUldbl='$sPRIEUldbl'
24399 sPRIFUldbl='$sPRIFUldbl'
24400 sPRIGUldbl='$sPRIGUldbl'
24401 sPRIXU64='$sPRIXU64'
24403 sPRIeldbl='$sPRIeldbl'
24404 sPRIfldbl='$sPRIfldbl'
24405 sPRIgldbl='$sPRIgldbl'
24410 sSCNfldbl='$sSCNfldbl'
24411 sched_yield='$sched_yield'
24412 scriptdir='$scriptdir'
24413 scriptdirexp='$scriptdirexp'
24415 seedfunc='$seedfunc'
24416 selectminbits='$selectminbits'
24417 selecttype='$selecttype'
24418 sendmail='$sendmail'
24419 setgrent_r_proto='$setgrent_r_proto'
24420 sethostent_r_proto='$sethostent_r_proto'
24421 setlocale_r_proto='$setlocale_r_proto'
24422 setnetent_r_proto='$setnetent_r_proto'
24423 setprotoent_r_proto='$setprotoent_r_proto'
24424 setpwent_r_proto='$setpwent_r_proto'
24425 setservent_r_proto='$setservent_r_proto'
24428 sharpbang='$sharpbang'
24429 shmattype='$shmattype'
24430 shortsize='$shortsize'
24433 sig_count='$sig_count'
24434 sig_name='$sig_name'
24435 sig_name_init='$sig_name_init'
24437 sig_num_init='$sig_num_init'
24438 sig_size='$sig_size'
24439 signal_t='$signal_t'
24440 sitearch='$sitearch'
24441 sitearchexp='$sitearchexp'
24443 sitebinexp='$sitebinexp'
24444 sitehtml1dir='$sitehtml1dir'
24445 sitehtml1direxp='$sitehtml1direxp'
24446 sitehtml3dir='$sitehtml3dir'
24447 sitehtml3direxp='$sitehtml3direxp'
24449 sitelib_stem='$sitelib_stem'
24450 sitelibexp='$sitelibexp'
24451 siteman1dir='$siteman1dir'
24452 siteman1direxp='$siteman1direxp'
24453 siteman3dir='$siteman3dir'
24454 siteman3direxp='$siteman3direxp'
24455 siteprefix='$siteprefix'
24456 siteprefixexp='$siteprefixexp'
24457 sitescript='$sitescript'
24458 sitescriptexp='$sitescriptexp'
24459 sizesize='$sizesize'
24460 sizetype='$sizetype'
24464 sockethdr='$sockethdr'
24465 socketlib='$socketlib'
24466 socksizetype='$socksizetype'
24468 spackage='$spackage'
24469 spitshell='$spitshell'
24470 srand48_r_proto='$srand48_r_proto'
24471 srandom_r_proto='$srandom_r_proto'
24473 ssizetype='$ssizetype'
24474 st_ino_sign='$st_ino_sign'
24475 st_ino_size='$st_ino_size'
24476 startperl='$startperl'
24478 static_ext='$static_ext'
24480 stdio_base='$stdio_base'
24481 stdio_bufsiz='$stdio_bufsiz'
24482 stdio_cnt='$stdio_cnt'
24483 stdio_filbuf='$stdio_filbuf'
24484 stdio_ptr='$stdio_ptr'
24485 stdio_stream_array='$stdio_stream_array'
24486 strerror_r_proto='$strerror_r_proto'
24489 subversion='$subversion'
24494 targetarch='$targetarch'
24495 targetdir='$targetdir'
24496 targetenv='$targetenv'
24497 targethost='$targethost'
24498 targetmkdir='$targetmkdir'
24499 targetport='$targetport'
24500 targetsh='$targetsh'
24504 timeincl='$timeincl'
24505 timetype='$timetype'
24506 tmpnam_r_proto='$tmpnam_r_proto'
24512 ttyname_r_proto='$ttyname_r_proto'
24521 uidformat='$uidformat'
24527 uquadtype='$uquadtype'
24528 use5005threads='$use5005threads'
24529 use64bitall='$use64bitall'
24530 use64bitint='$use64bitint'
24531 usecbacktrace='$usecbacktrace'
24532 usecrosscompile='$usecrosscompile'
24533 usedevel='$usedevel'
24535 usedtrace='$usedtrace'
24536 usefaststdio='$usefaststdio'
24537 useithreads='$useithreads'
24538 usekernprocpathname='$usekernprocpathname'
24539 uselargefiles='$uselargefiles'
24540 uselongdouble='$uselongdouble'
24541 usemallocwrap='$usemallocwrap'
24542 usemorebits='$usemorebits'
24543 usemultiplicity='$usemultiplicity'
24544 usemymalloc='$usemymalloc'
24546 usensgetexecutablepath='$usensgetexecutablepath'
24547 useopcode='$useopcode'
24548 useperlio='$useperlio'
24549 useposix='$useposix'
24550 usequadmath='$usequadmath'
24551 usereentrant='$usereentrant'
24552 userelocatableinc='$userelocatableinc'
24553 useshrplib='$useshrplib'
24554 usesitecustomize='$usesitecustomize'
24555 usesocks='$usesocks'
24556 usethreads='$usethreads'
24557 usevendorprefix='$usevendorprefix'
24558 useversionedarchname='$useversionedarchname'
24559 usevfork='$usevfork'
24562 uvXUformat='$uvXUformat'
24563 uvoformat='$uvoformat'
24566 uvuformat='$uvuformat'
24567 uvxformat='$uvxformat'
24569 vendorarch='$vendorarch'
24570 vendorarchexp='$vendorarchexp'
24571 vendorbin='$vendorbin'
24572 vendorbinexp='$vendorbinexp'
24573 vendorhtml1dir='$vendorhtml1dir'
24574 vendorhtml1direxp='$vendorhtml1direxp'
24575 vendorhtml3dir='$vendorhtml3dir'
24576 vendorhtml3direxp='$vendorhtml3direxp'
24577 vendorlib='$vendorlib'
24578 vendorlib_stem='$vendorlib_stem'
24579 vendorlibexp='$vendorlibexp'
24580 vendorman1dir='$vendorman1dir'
24581 vendorman1direxp='$vendorman1direxp'
24582 vendorman3dir='$vendorman3dir'
24583 vendorman3direxp='$vendorman3direxp'
24584 vendorprefix='$vendorprefix'
24585 vendorprefixexp='$vendorprefixexp'
24586 vendorscript='$vendorscript'
24587 vendorscriptexp='$vendorscriptexp'
24589 version_patchlevel_string='$version_patchlevel_string'
24590 versiononly='$versiononly'
24594 yaccflags='$yaccflags'
24599 : add special variables
24600 $test -f $src/patchlevel.h && \
24601 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
24602 echo "PERL_PATCHLEVEL='$perl_patchlevel'" >>config.sh
24603 echo "PERL_CONFIG_SH=true" >>config.sh
24605 : propagate old symbols
24606 if $test -f UU/config.sh; then
24607 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
24608 $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \
24609 config.sh config.sh UU/oldconfig.sh |\
24610 $sort | $uniq -u >UU/oldsyms
24611 set X `$cat UU/oldsyms`
24617 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
24619 echo ": Variables propagated from previous config.sh file." >>config.sh
24620 for sym in `$cat UU/oldsyms`; do
24621 echo " Propagating $hint variable "'$'"$sym..."
24622 eval 'tmp="$'"${sym}"'"'
24624 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
24630 : preserve RCS keywords in files with variable substitution, grrr
24633 : Finish up by extracting the .SH files
24637 echo "Extraction done."
24647 If you'd like to make any changes to the config.sh file before I begin
24648 to configure things, do it as a shell escape now (e.g. !vi config.sh).
24651 rp="Press return or use a shell escape to edit config.sh:"
24656 *) : in case they cannot read
24657 sh 1>&4 -c "$ans";;
24662 : if this fails, just run all the .SH files by hand
24671 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
24678 Now you need to generate make dependencies by running "$make depend".
24679 You might prefer to run it in background: "$make depend > makedepend.out &"
24680 It can take a while, so you might not want to run it right now.
24685 rp="Run $make depend now?"
24689 $make depend && echo "Now you must run '$make'."
24692 echo "You must run '$make depend' then '$make'."
24695 elif test -f [Mm]akefile; then
24697 echo "Now you must run a $make."
24699 echo "Configure done."
24702 if $test -f Policy.sh; then
24705 If you compile $package on a different machine or from a different object
24706 directory, copy the Policy.sh file from this object directory to the
24707 new one before you run Configure -- this will help you with most of
24708 the policy defaults.
24712 if $test -f config.msg; then
24713 echo "Hmm. I also noted the following information while running:"
24715 $cat config.msg >&4
24718 $rm -f kit*isdone ark*isdone