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 by the tool
15 # called "metaconfig". Rather than working with this copy of Configure,
16 # you may wish to get metaconfig. Perl uses a modified version of this
17 # tool, available in the "dist" folder in the checkout of the git repo
18 # $ git clone git://perl5.git.perl.org/metaconfig.git metaconfig
19 # The original dist package (including metaconfig) is available via SVN:
20 # $ svn co https://svn.code.sf.net/p/dist/code/trunk/dist
22 # Though this script was generated by metaconfig from metaunits, it is
23 # OK to send patches against Configure itself. It's up to the Configure
24 # pumpkin to backport the patch to the metaunits if it is accepted.
25 # For more information on patching Configure, see pod/perlhack.pod
27 # The metaunits are also available from the public git repository:
28 # http://perl5.git.perl.org/metaconfig.git/ or
29 # $ git clone git://perl5.git.perl.org/metaconfig.git metaconfig
31 # See Porting/pumpkin.pod for more information on metaconfig.
33 # Generated using [metaconfig 3.5 PL0]
34 # (with additional metaconfig patches by perlbug@perl.org)
39 SCO csh still thinks true is false. Write to SCO today and tell them that next
40 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
42 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
43 we'd have to do is go in and swap the && and || tokens, wherever they are.)
45 [End of diatribe. We now return you to your regularly scheduled programming...]
49 OOPS! You naughty creature! You didn't run Configure with sh!
50 I will attempt to remedy the situation by running sh for you...
54 true || exec sh $0 $argv:q
56 (exit $?0) || cat c2$$
57 (exit $?0) || exec sh $0 $argv:q
60 if test -f /dev/cputype -a -f /dev/drivers -a -f /dev/osversion; then
63 *** I'm sorry but this system looks like Plan 9 and Plan 9 doesn't do
64 *** Configure that well. (Plan 9 is close to UNIX but not close enough.)
65 *** Please read the README.plan9 for further instructions.
66 *** Cannot continue, aborting.
72 if test -f /sys/utilities/MultiView ; then
73 # AmigaOS, test -c for /dev/null is not useful
75 elif test ! -c /dev/null ; then
78 *** I'm sorry, but /dev/null appears to be a file rather than a device.
79 *** Please consult your operating sytem's notes for making a device
81 *** Cannot continue, aborting.
87 : compute my invocation name
91 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
96 : Proper separator for the PATH environment variable
98 : On OS/2 this directory should exist if this is not floppy only system ":-]"
99 if test -d c:/. || ( uname -a | grep -i 'os\(/\|\)2' 2>&1 ) 2>&1 >/dev/null ; then
100 if test -n "$OS2_SHELL"; then
102 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
103 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
105 elif test -n "$DJGPP"; then
106 case "X${MACHTYPE:-nonesuchmach}" in
113 : Proper PATH setting
114 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
115 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
116 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
117 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
118 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
119 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /opt/ansic/bin /usr/ccs/bin"
120 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
121 paths="$paths /sbin /usr/sbin /usr/libexec"
122 paths="$paths /system/gnu_library/bin"
126 case "$p_$PATH$p_" in
128 *) test -d $p && PATH=$PATH$p_$p ;;
135 : shall we be using ksh?
141 if (PATH=.; alias -x) >/dev/null 2>&1; then
144 if test -f /hp-ux -a -f /bin/ksh; then
145 needksh='to avoid sh bug in "here document" expansion'
147 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
148 if test X`/usr/bin/uname -v` = X4; then
149 avoidksh="to avoid AIX 4's /bin/sh"
153 if test -f /osf_boot -a -f /usr/sbin/setld; then
154 if test X`/usr/bin/uname -s` = XOSF1; then
155 avoidksh="to avoid Digital UNIX' ksh"
160 case "$inksh/$needksh" in
167 case "$inksh/$avoidksh" in
173 case "$inksh/$needksh-$avoidksh-" in
176 (I see you are using the Korn shell. Some ksh's blow up on $me,
177 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
184 echo "(Feeding myself to $newsh $reason.)"
186 Configure|*/Configure) exec $newsh $0 "$@";;
187 *) exec $newsh Configure "$@";;
191 test -x "${newsh}" || unset newsh
193 : if needed, set CDPATH to a harmless value that is not chatty
194 : avoid bash 2.02 problems with empty CDPATH.
198 *bash*) CDPATH='.' ;;
204 : Configure runs within the UU subdirectory
205 test -d UU || mkdir UU
349 useversionedarchname=''
355 initialinstalllocation=''
387 d_attribute_deprecated=''
388 d_attribute_format=''
389 d_attribute_malloc=''
390 d_attribute_nonnull=''
391 d_attribute_noreturn=''
393 d_attribute_unused=''
394 d_attribute_warn_unused_result=''
395 d_printf_format_null=''
399 d_builtin_choose_expr=''
402 d_c99_variadic_macros=''
452 endhostent_r_proto=''
458 endprotoent_r_proto=''
464 endservent_r_proto=''
526 gethostbyaddr_r_proto=''
528 gethostbyname_r_proto=''
530 gethostent_r_proto=''
541 getnetbyaddr_r_proto=''
543 getnetbyname_r_proto=''
557 d_getprotobyname_r=''
558 getprotobyname_r_proto=''
559 d_getprotobynumber_r=''
560 getprotobynumber_r_proto=''
562 getprotoent_r_proto=''
574 getservbyname_r_proto=''
576 getservbyport_r_proto=''
578 getservent_r_proto=''
610 d_lc_monetary_2008=''
615 d_libm_lib_version=''
622 d_localtime_r_needs_tzset=''
642 d_malloc_good_size=''
690 d_old_pthread_create_joinable=''
691 old_pthread_create_joinable=''
693 d_pthread_attr_setscope=''
741 sethostent_r_proto=''
758 setprotoent_r_proto=''
770 setservent_r_proto=''
792 d_ipv6_mreq_source=''
809 d_sprintf_returns_strlen=''
820 perl_static_inline=''
823 d_stdio_ptr_lval_nochange_cnt=''
824 d_stdio_ptr_lval_sets_cnt=''
974 d_gdbm_ndbm_h_uses_prototypes=''
975 d_gdbmndbm_h_uses_prototypes=''
977 d_ndbm_h_uses_prototypes=''
1048 d_inc_version_list=''
1050 inc_version_list_init=''
1058 installusrbinperl=''
1074 ignore_versioned_solibs=''
1138 d_perl_otherlibdirs=''
1146 api_versionstring=''
1152 version_patchlevel_string=''
1156 d_nv_preserves_uv=''
1157 d_nv_zero_is_allbits_zero=''
1168 nv_overflows_integers_at=''
1169 nv_preserves_uv_bits=''
1242 installsitehtml1dir=''
1245 installsitehtml3dir=''
1252 installsiteman1dir=''
1255 installsiteman3dir=''
1260 installsitescript=''
1278 d_stdio_stream_array=''
1279 stdio_stream_array=''
1297 usekernprocpathname=''
1298 ccflags_uselargefiles=''
1299 ldflags_uselargefiles=''
1300 libswanted_uselargefiles=''
1309 usensgetexecutablepath=''
1323 installvendorarch=''
1330 installvendorhtml1dir=''
1332 vendorhtml1direxp=''
1333 installvendorhtml3dir=''
1335 vendorhtml3direxp=''
1341 installvendorman1dir=''
1344 installvendorman3dir=''
1351 installvendorscript=''
1362 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1365 : We must find out about Eunice early
1367 if test -f /etc/unixtovms; then
1368 eunicefix=/etc/unixtovms
1370 if test -f /etc/unixtovms.exe; then
1371 eunicefix=/etc/unixtovms.exe
1374 : Set executable suffix now -- needed before hints available
1375 if test -f "/libs/version.library"; then
1378 elif test -f "/system/gnu_library/bin/ar.pm"; then
1381 elif test -n "$DJGPP"; then
1384 elif test -f /kern/cookiejar; then
1387 elif test -d c:/. -o -n "$is_os2" ; then
1394 : Trailing extension. Override this in a hint file, if needed.
1395 : Extra object files, if any, needed on this platform.
1398 : Possible local include directories to search.
1399 : Set locincpth to "" in a hint file to defeat local include searches.
1400 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1401 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1403 : no include file wanted by default
1406 : Enable -DEBUGGING and -DDEBUGGING from the command line
1411 : change the next line if compiling for Xenix/286 on Xenix/386
1412 xlibpth='/usr/lib/386 /lib/386'
1413 : Possible local library directories to search.
1414 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1415 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1417 : general looking path for locating libraries
1418 glibpth="/lib /usr/lib $xlibpth"
1419 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1420 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1421 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1422 test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
1424 : Private path used by Configure to find libraries. Its value
1425 : is prepended to libpth. This variable takes care of special
1426 : machines, like the mips. Usually, it should be empty.
1429 : default library list
1431 : some systems want to use only the non-versioned libso:s
1432 ignore_versioned_solibs=''
1433 : set usethreads on the Configure command line to enable threads.
1434 usereentrant='undef'
1438 : set useposix=false in your hint file to disable the POSIX extension.
1440 : set useopcode=false in your hint file to disable the Opcode extension.
1443 ccflags_uselargefiles=''
1444 ldflags_uselargefiles=''
1445 libswanted_uselargefiles=''
1446 : set usemultiplicity on the Configure command line to enable multiplicity.
1447 : set usesocks on the Configure command line to enable socks.
1448 : List of libraries we want.
1449 : If anyone needs extra -lxxx, put those in a hint file.
1450 libswanted="cl pthread socket bind inet nsl nm ndbm gdbm dbm db malloc dl ld"
1451 libswanted="$libswanted sun m crypt sec util c cposix posix ucb bsd BSD"
1452 : We probably want to search /usr/shlib before most other libraries.
1453 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1454 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1455 glibpth="/usr/shlib $glibpth"
1456 : Do not use vfork unless overridden by a hint file.
1459 : Find the basic shell for Bourne shell scripts
1463 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1466 if test -f "$xxx"; then
1469 : Build up a list and do a single loop so we can 'break' out.
1470 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1471 for xxx in sh bash ksh pdksh ash; do
1473 try="$try ${p}/${xxx}"
1477 if test -f "$xxx"; then
1480 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1483 elif test -f "$xxx.exe"; then
1494 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1496 Usually it's in /bin/sh. How did you even get this far?
1497 Please contact me (Perl Maintainers) at perlbug@perl.org and
1498 we'll try to straighten this all out.
1504 : When cross-compiling we need to separate the sh-to-run-Configure-with from the sh-to-use-in-Perl
1505 : default both to the same thing, cross-compilers can then set targetsh differently if they like
1508 : see if sh knows # comments
1509 if `$sh -c '#' >/dev/null 2>&1`; then
1513 test -f $xcat$_exe || xcat=/usr/bin/cat
1514 if test ! -f $xcat$_exe; then
1515 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1516 if test -f $p/cat$_exe; then
1521 if test ! -f $xcat$_exe; then
1522 echo "Can't find cat anywhere!"
1526 echo "#!$xcat" >sharp
1529 ./sharp > today 2>/dev/null
1530 if test -s today; then
1533 echo "#! $xcat" > sharp
1536 ./sharp > today 2>/dev/null
1537 if test -s today; then
1545 echo "Your $sh doesn't grok # comments--I will strip them later on."
1548 echo "exec grep -v '^[ ]*#'" >spitshell
1550 $eunicefix spitshell
1551 spitshell=`pwd`/spitshell
1553 echo "I presume that if # doesn't work, #! won't work either!"
1558 : figure out how to guarantee sh startup
1560 '') startsh=${sharpbang}${sh} ;;
1572 : echo "Yup, it does."
1574 echo "Hmm... '$startsh' does not guarantee sh startup..."
1575 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1579 : Save command line options in file UU/cmdline.opt for later use in
1580 : generating config.sh.
1581 cat > cmdline.opt <<EOSH
1582 : Configure command line arguments.
1591 cat >>cmdline.opt <<EOSH
1592 config_arg$argn='$arg'
1594 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1597 arg_exp=`cat cmdl.opt`
1598 args_exp="$args_exp$args_sep'$arg_exp'"
1599 argn=`expr $argn + 1`
1604 : produce awk script to parse command line options
1605 cat >options.awk <<'EOF'
1607 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1609 len = length(optstr);
1610 for (i = 1; i <= len; i++) {
1611 c = substr(optstr, i, 1);
1612 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1623 if (substr(str, 1, 1) != "-") {
1624 printf("'%s'\n", str);
1628 for (i = 2; i <= len; i++) {
1629 c = substr(str, i, 1);
1631 printf("-%s\n", substr(str, i));
1637 printf("'%s'\n", substr(str, i + 1));
1650 : process the command line options
1651 set X `for arg in "$@"; do echo "X$arg"; done |
1652 sed -e s/X// | awk -f options.awk`
1657 : set up default values
1667 rm -f optdef.sh posthint.sh
1668 cat >optdef.sh <<EOS
1674 while test $# -gt 0; do
1676 -d) shift; fastread=yes;;
1677 -e) shift; alldone=cont;;
1681 if test -r "$1"; then
1684 echo "$me: cannot read config file $1." >&2
1690 -h) shift; error=true;;
1691 -r) shift; reuseval=true;;
1692 -s) shift; silent=true; realsilent=true;;
1693 -E) shift; alldone=exit;;
1694 -K) shift; knowitall=true;;
1695 -O) shift; override=true;;
1696 -S) shift; silent=true; extractsh=true;;
1701 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1702 echo "$me: ignoring -D $1" >&2
1705 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1706 *) echo "$1='define'" >> optdef.sh;;
1713 *=) echo "$1" >> optdef.sh;;
1715 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1716 echo "$me: ignoring -U $1" >&2
1718 *) echo "$1='undef'" >> optdef.sh;;
1729 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1733 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1734 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1740 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1741 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1742 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1743 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1744 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1745 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1751 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1753 echo "$yyy=''" >> posthint.sh ;;
1758 echo "$yyy='$zzz'" >> posthint.sh ;;
1760 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1762 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1767 echo "$yyy=$zzz" >> posthint.sh ;;
1768 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1772 -V) echo "$me generated by metaconfig 3.5 PL0." >&2
1775 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1783 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1784 [-U symbol] [-U symbol=] [-A command:symbol...]
1785 -d : use defaults for all answers.
1786 -e : go on without questioning past the production of config.sh.
1787 -f : specify an alternate default configuration file.
1788 -h : print this help message and exit (with an error status).
1789 -r : reuse C symbols value if possible (skips costly nm extraction).
1790 -s : silent mode, only echoes questions and essential information.
1791 -D : define symbol to have some value:
1792 -D symbol symbol gets the value 'define'
1793 -D symbol=value symbol gets the value 'value'
1794 common used examples (see INSTALL for more info):
1795 -Duse64bitint use 64bit integers
1796 -Duse64bitall use 64bit integers and pointers
1797 -Dusethreads use thread support
1798 -Dinc_version_list=none do not include older perl trees in @INC
1799 -DEBUGGING=none DEBUGGING options
1800 -Dcc=gcc choose your compiler
1801 -Dprefix=/opt/perl5 choose your destination
1802 -E : stop at the end of questions, after having produced config.sh.
1803 -K : do not use unless you know what you are doing.
1804 -O : let -D and -U override definitions from loaded configuration file.
1805 -S : perform variable substitutions on all .SH files (can mix with -f)
1806 -U : undefine symbol:
1807 -U symbol symbol gets the value 'undef'
1808 -U symbol= symbol gets completely empty
1810 -A : manipulate symbol after the platform specific hints have been applied:
1811 -A append:symbol=value append value to symbol
1812 -A symbol=value like append:, but with a separating space
1813 -A define:symbol=value define symbol to have value
1814 -A clear:symbol define symbol to be ''
1815 -A define:symbol define symbol to be 'define'
1816 -A eval:symbol=value define symbol to be eval of value
1817 -A prepend:symbol=value prepend value to symbol
1818 -A undef:symbol define symbol to be 'undef'
1819 -A undef:symbol= define symbol to be ''
1820 e.g.: -A prepend:libswanted='cl pthread '
1821 -A ccflags=-DSOME_MACRO
1822 -V : print version number and exit (with a zero status).
1829 case "$fastread$alldone" in
1832 case "$extractsh" in
1835 if test ! -t 0; then
1836 echo "Say 'sh Configure', not 'sh <Configure'"
1846 true) exec 1>/dev/null;;
1849 : run the defines and the undefines, if any, but leave the file out there...
1851 grep -q '\\' optdef.sh
1852 if test $? = 0; then
1853 echo "Configure does not support \\ in -D arguments"
1857 : create the posthint manipulation script and leave the file out there...
1862 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1863 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1864 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`"-"`echo AbyZ | tr '[:upper:]' '[:lower:]' 2>/dev/null`" in
1865 ABYZ-abyz) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1866 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1869 : Some greps do not return status, grrr.
1870 echo "grimblepritz" >grimble
1871 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1873 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1879 : the following should work in any shell
1883 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1884 cat >contains <<'EOSS'
1885 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1890 : Find the path to the source tree
1893 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1897 *) src=`cd ../$src && pwd` ;;
1910 if test -f $rsrc/Configure && \
1911 $contains "^package='$package'\$" $rsrc/Configure >/dev/null 2>&1
1913 : found it, so we are ok.
1916 for src in . .. ../.. ../../.. ../../../..; do
1917 if test -f ../$src/Configure && \
1918 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1929 Sorry, I can't seem to locate the source dir for $package. Please start
1930 Configure with an explicit path -- i.e. /some/path/Configure.
1938 echo "Sources for $package found in \"$src\"." >&4
1942 : script used to extract .SH files with variable substitutions
1943 cat >extract <<'EOS'
1945 echo "Doing variable substitutions on .SH files..."
1946 if test -f MANIFEST; then
1947 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1949 echo "(Looking for .SH files under the source directory.)"
1950 set x `(cd "$src"; find . -name "*.SH" -print)`
1954 0) set x `(cd "$src"; echo *.SH)`; shift;;
1956 if test ! -f "$src/$1"; then
1962 while test $name; do
1963 if test ! -d "$name"; then
1964 create="$name $create";
1965 name=`echo $name | sed -e "s|^[^/]*$||"`;
1966 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1971 for file in $create; do
1980 dir=`expr X$file : 'X\(.*\)/'`
1981 file=`expr X$file : 'X.*/\(.*\)'`
1982 (cd "$dir" && . ./$file)
1992 dir=`expr X$file : 'X\(.*\)/'`
1993 file=`expr X$file : 'X.*/\(.*\)'`
1994 (set x $dir; shift; eval $mkdir_p)
1995 sh <"$src/$dir/$file"
2004 if test -f "$src/config_h.SH"; then
2005 if test ! -f config.h; then
2006 : oops, they left it out of MANIFEST, probably, so do it anyway.
2007 . "$src/config_h.SH"
2012 : extract files and exit if asked to do so
2013 case "$extractsh" in
2015 case "$realsilent" in
2019 case "$config_sh" in
2020 '') config_sh='config.sh';;
2023 echo "Fetching answers from $config_sh..."
2026 test "$override" && . ./optdef.sh
2030 echo "Extraction done."
2035 : Eunice requires " " instead of "", can you believe it
2038 echo "Beginning of configuration questions for $package."
2040 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
2042 : first determine how to suppress newline on echo command
2044 echo "Checking echo to see how to suppress newlines..."
2045 (echo "hi there\c" ; echo " ") >.echotmp
2046 if $contains c .echotmp >/dev/null 2>&1 ; then
2057 echo $n "The star should be here-->$c"
2061 : Now test for existence of everything in MANIFEST
2063 if test -f "$rsrc/MANIFEST"; then
2064 echo "First let's make sure your kit is complete. Checking..." >&4
2065 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | \
2066 (split -l 50 2>/dev/null || split -50)
2069 for filelist in x??; do
2070 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` \
2071 >/dev/null 2>>"$tmppwd/missing")
2073 if test -s missing; then
2077 THIS PACKAGE SEEMS TO BE INCOMPLETE.
2079 You have the option of continuing the configuration process, despite the
2080 distinct possibility that your kit is damaged, by typing 'y'es. If you
2081 do, don't blame me if something goes wrong. I advise you to type 'n'o
2082 and contact the author (perlbug@perl.org).
2085 echo $n "Continue? [n] $c" >&4
2089 echo "Continuing..." >&4
2093 echo "ABORTING..." >&4
2098 echo "Looks good..."
2101 echo "There is no MANIFEST file. I hope your kit is complete !"
2105 : Find the appropriate value for a newline for tr
2107 if test -n "$DJGPP"; then
2110 if test X"$trnl" = X; then
2111 case "`echo foo|tr '\n' x 2>/dev/null`" in
2115 if test X"$trnl" = X; then
2116 case "`echo foo|tr '\012' x 2>/dev/null`" in
2117 foox) trnl='\012' ;;
2120 if test X"$trnl" = X; then
2121 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
2122 fooxy) trnl='\n\r' ;;
2125 if test X"$trnl" = X; then
2128 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
2134 : compute the number of columns on the terminal for proper question formatting
2139 : set up the echo used in my read
2140 myecho="case \"\$xxxm\" in
2141 '') echo $n \"\$rp $c\" >&4;;
2143 '') echo $n \"[\$xxxm] $c\";;
2145 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
2147 echo $n \"[\$xxxm] $c\" >&4
2149 echo $n \"\$rp [\$xxxm] $c\" >&4
2155 : now set up to do reads with possible shell escape and default assignment
2161 case "\$fastread" in
2162 yes) case "\$dflt" in
2165 case "\$silent-\$rp" in
2170 *) case "\$silent" in
2171 true) case "\$rp" in
2176 while expr "X\$ans" : "X!" >/dev/null; do
2180 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2188 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2197 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2202 echo "(OK, I'll run with -d after this question.)" >&4
2205 echo "*** Sorry, \$1 not supported yet." >&4
2215 echo "*** Substitution done -- please confirm."
2217 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2222 echo "*** Error -- try again."
2229 case "\$ans\$xxxm\$nostick" in
2241 : create .config dir to save info across Configure sessions
2242 test -d ../.config || mkdir ../.config
2243 cat >../.config/README <<EOF
2244 This directory created by Configure to save information that should
2245 persist across sessions for $package.
2247 You may safely delete it if you wish.
2250 : See if we are using a devel version and want that
2251 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2254 usedevel="$define" ;;
2255 *) case "$xversion" in
2258 *** WHOA THERE!!! ***
2260 This is an UNSTABLE DEVELOPMENT release.
2261 The version of this $package distribution is $xversion, that is, odd,
2262 (as opposed to even) and that signifies a development release.
2263 If you want a maintenance release, you want an even-numbered version.
2265 Do ***NOT*** install this into production use.
2266 Data corruption and crashes are possible.
2268 It is most seriously suggested that you do not continue any further
2269 unless you want to help in developing and debugging Perl.
2271 If you *still* want to build perl, you can answer 'y' now,
2272 or pass -Dusedevel to Configure.
2275 rp='Do you really want to continue?'
2279 [yY]) echo >&4 "Okay, continuing."
2280 usedevel="$define" ;;
2281 *) echo >&4 "Okay, bye."
2292 case "$versiononly" in
2293 '') versiononly="$define" ;;
2295 case "$installusrbinperl" in
2296 '') installusrbinperl="$undef" ;;
2301 : general instructions
2304 user=`(logname) 2>/dev/null`
2306 '') user=`whoami 2>&1`;;
2308 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2311 rp='Would you like to see the instructions?'
2322 This installation shell script will examine your system and ask you questions
2323 to determine how the perl5 package should be installed. If you get
2324 stuck on a question, you may use a ! shell escape to start a subshell or
2325 execute a command. Many of the questions will have default answers in square
2326 brackets; typing carriage return will give you the default.
2328 On some of the questions which ask for file or directory names you are allowed
2329 to use the ~name construct to specify the login directory belonging to "name",
2330 even if you don't have a shell which knows about that. Questions where this is
2331 allowed will be marked "(~name ok)".
2335 dflt='Type carriage return to continue'
2339 The prompter used in this script allows you to use shell variables and
2340 backticks in your answers. You may use $1, $2, etc... to refer to the words
2341 in the default answer, as if the default line was a set of arguments given to a
2342 script shell. This means you may also use $* to repeat the whole default line,
2343 so you do not have to re-type everything to add something to the default.
2345 Every time there is a substitution, you will have to confirm. If there is an
2346 error (e.g. an unmatched backtick), the default answer will remain unchanged
2347 and you will be prompted again.
2349 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2350 the questions and use the computed defaults (or the previous answers if there
2351 was already a config.sh file). Type 'Configure -h' for a list of options.
2352 You may also start interactively and then answer '& -d' at any prompt to turn
2353 on the non-interactive behaviour for the remainder of the execution.
2359 Much effort has been expended to ensure that this shell script will run on any
2360 Unix system. If despite that it blows up on yours, your best bet is to edit
2361 Configure and run it again. If you can't run Configure for some reason,
2362 you'll have to generate a config.sh file by hand. Whatever problems you
2363 have, let me (perlbug@perl.org) know how I blew it.
2365 This installation script affects things in two ways:
2367 1) it may do direct variable substitutions on some of the files included
2369 2) it builds a config.h file for inclusion in C programs. You may edit
2370 any of these files as the need arises after running this script.
2372 If you make a mistake on a question, there is no easy way to back up to it
2373 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2374 files. Configure will offer to let you do this before it runs the SH files.
2377 dflt='Type carriage return to continue'
2379 case "$firsttime" in
2380 true) echo $user >>../.config/instruct;;
2384 : Set 'sysroot' to change the logical root directory to your headers and libraries see man gcc
2385 : This is primarily meant for cross-compile environments, and may fail to be useful in other cases
2386 if test "X$sysroot" = X; then
2391 echo "Using $sysroot to find your headers and libraries, adding to ccflags"
2392 # _sysroot is used in places where we need --sysroot=foo
2393 # but using the rest of the flags could cause issues.
2394 _sysroot="--sysroot=$sysroot";
2398 ccflags="$ccflags $_sysroot"
2403 ldflags="$ldflags $_sysroot"
2408 cppflags="$cppflags $_sysroot"
2410 # lddlflags updated below in lddlflags section;
2411 # same with cccdlflags
2415 # Adjust some defaults to also use $sysroot
2416 for var in xlibpth loclibpth locincpth glibpth; do
2419 for path in $xxx; do
2420 eval $var=\"\$$var $sysroot$path\"
2426 : find out where common programs are
2428 echo "Locating common programs..." >&4
2441 if test -d \$dir/\$thing; then
2447 for thisthing in \$dir/\$thing; do
2448 : just loop through to pick last item
2450 if test -f \$thisthing; then
2453 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2456 elif test -f \$dir/\$thing.exe; then
2457 if test -n "$DJGPP"; then
2458 echo \$dir/\$thing.exe
2459 elif test "$eunicefix" != ":"; then
2460 : on Eunice apparently
2513 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2514 pth="$pth $sysroot/lib $sysroot/usr/lib"
2515 for file in $loclist; do
2519 if test -f "$xxx"; then
2522 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2523 xxx=`./loc $file $file $pth`
2526 '') xxx=`./loc $file $file $pth`;;
2527 *) xxx=`./loc $xxx $xxx $pth`;;
2529 eval $file=$xxx$_exe
2533 echo $file is in $xxx.
2536 echo $file is in $xxx.
2539 echo "I don't know where '$file' is, and my life depends on it." >&4
2540 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2546 echo "Don't worry if any of the following aren't found..."
2548 for file in $trylist; do
2552 if test -f "$xxx"; then
2555 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2556 xxx=`./loc $file $file $pth`
2559 '') xxx=`./loc $file $file $pth`;;
2560 *) xxx=`./loc $xxx $xxx $pth`;;
2562 eval $file=$xxx$_exe
2566 echo $file is in $xxx.
2569 echo $file is in $xxx.
2572 echo "I don't see $file out there, $say."
2579 echo "Substituting grep for egrep."
2586 *) if $less -R </dev/null >/dev/null 2>&1; then
2587 echo "Substituting less -R for less."
2595 echo "Substituting cp for ln."
2604 echo "I can't find make or gmake, and my life depends on it." >&4
2605 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2613 *) # We can't have osname yet.
2614 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2615 # Assume that gmake, if found, is definitely GNU make
2616 # and prefer it over the system make.
2617 echo "Substituting gmake for make."
2625 echo "Hopefully test is built into your sh."
2628 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2629 echo "Using the test built into your sh."
2637 echo "Hopefully echo is built into your sh."
2642 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2643 $echo $n "hi there$c" >foo1
2644 echo $n "hi there$c" >foo2
2645 if cmp foo1 foo2 >/dev/null 2>&1; then
2646 echo "They are compatible. In fact, they may be identical."
2653 They are not compatible! You are probably running ksh on a non-USG system.
2654 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2655 have echo built in and we may have to run some Bourne shell scripts. That
2656 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2659 $echo $n "The star should be here-->$c"
2666 # This question was auctioned at YAPC::Europe-2007 in Vienna
2667 # I never promised you could answer it. I only auctioned the question.
2669 The following message is sponsored by
2671 Dresden.pm<--The stars should be here.
2673 Dear Perl user, system administrator or package
2674 maintainer, the Perl community sends greetings to
2675 you. Do you (emblematical) greet back [Y/n]? n
2679 : Check what type of C compiler we use
2683 cat <<'EOSC' >>trygcc
2688 int main(int argc, char *argv[]) {
2692 if $cc -o try $ccflags $ldflags try.c; then
2695 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2701 # Skip this test because it gives a false match on output like:
2702 # ./trygcc: line 23: cc: command not found
2703 # case "`$cc -v -c try.c 2>&1`" in
2704 # *gcc*) trygcc=no ;;
2706 if $test X"$trygcc" = Xyes; then
2707 if gcc -o try -c try.c; then
2709 echo "You seem to have a working gcc, though." >&4
2710 # Switching compilers may undo the work of hints files.
2711 # The most common problem is -D_REENTRANT for threads.
2712 # This heuristic catches that case, but gets false positives
2713 # if -Dusethreads was not actually specified. Better to
2714 # bail out here with a useful message than fail
2715 # mysteriously later. Should we perhaps just try to
2716 # re-invoke Configure -Dcc=gcc config_args ?
2717 if $test -f usethreads.cbu; then
2720 *** However, any setting of the C compiler flags (e.g. for thread support)
2721 *** will be lost. It may be necessary for you to restart Configure and
2722 *** add -Dcc=gcc to your Configure command line.
2725 rp="Would you like to go ahead and try gcc anyway?"
2728 rp="Would you like to use it?"
2731 if $test -f myread; then
2734 if $test -f UU/myread; then
2737 echo "Cannot find myread, sorry. Aborting." >&2
2742 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2755 cat <<'EOSC' >>checkcc
2760 int main(int argc, char *argv[]) {
2764 if $cc -o try $ccflags $ldflags try.c; then
2767 if $test X"$despair" = Xyes; then
2768 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2771 You need to find a working C compiler.
2772 Either (purchase and) install the C compiler supplied by your OS vendor,
2773 or for a free C compiler try http://gcc.gnu.org/
2774 I cannot continue any further, aborting.
2783 : determine whether symbolic links are supported
2786 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2787 echo "Symbolic links are supported." >&4
2790 echo "Symbolic links are NOT supported." >&4
2795 : determine whether symbolic links are supported
2799 echo "Checking how to test for symbolic links..." >&4
2801 if $test "X$issymlink" = X; then
2803 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2804 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2806 if test $? = 0; then
2809 echo "Your builtin 'test -h' may be broken." >&4
2812 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2815 if test -f "$p/$test"; then
2824 echo "Trying external '$test -h'." >&4
2825 issymlink="$test -h"
2826 if $test ! -h sym >/dev/null 2>&1; then
2827 echo "External '$test -h' is broken, too." >&4
2835 if $test "X$issymlink" = X; then
2836 if $test -L sym 2>/dev/null; then
2837 issymlink="$test -L"
2838 echo "The builtin '$test -L' worked." >&4
2841 if $test "X$issymlink" != X; then
2842 echo "You can test for symbolic links with '$issymlink'." >&4
2844 echo "I do not know how you can test for symbolic links." >&4
2848 *) echo "No symbolic links, so not testing for their testing..." >&4
2853 : Make symlinks util
2854 case "$mksymlinks" in
2857 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2860 *) case "$lns:$issymlink" in
2861 *"ln"*" -s:"*"test -"?)
2862 echo "Creating the symbolic links..." >&4
2864 awk '{print $1}' $src/MANIFEST | sed -e 's:/\([^/]*\)$: \1:' |
2874 print "# dir = ", dir, "file = ", file
2875 mf[dir] = mf[dir]" "source"/"dir"/"file;
2878 if (d != ".") { print("mkdir -p "d) }
2879 print("ln -sf "mf[d]" "d);
2881 }' source="$src" > UU/mksymlinks.$$
2885 if test ! -d t/base; then
2886 echo "Failed to create the subdirectories. Aborting." >&4
2890 if test ! -f t/base/lex.t; then
2891 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2894 if test ! -f win32/win32.c; then
2895 echo "Failed to create the symlinks (win32/win32.c missing). Aborting." >&4
2900 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2908 : Check for Cross-Compilation
2909 if $test "X$targethost" = "X"; then
2912 if $test "X$targetenv" = "X"; then
2915 case "$usecrosscompile" in
2917 $echo "Cross-compiling..."
2920 *-gcc*|*-g++*) # A cross-compiling gcc, probably.
2921 # arm-linux-androideabi-gcc -> arm-linux-androideabi
2922 # x86_64-w64-mingw32-gcc.exe -> x86_64-w64-mingw32
2923 targetarch=`$echo $cc|$sed 's/-g[c\+][c\+].*$//'`
2924 ar=`$echo $cc|$sed 's/-g[c\+][c\+]/-ar/'`
2925 # leave out ld, choosing it is more complex
2926 nm=`$echo $cc|$sed 's/-g[c\+][c\+]/-nm/'`
2927 ranlib=`$echo $cc|$sed 's/-g[c\+][c\+]/-ranlib/'`
2928 # We are in a weird spot. Just before us, some values
2929 # were 'saved', to be restored after the hints are
2930 # run. This means that the changes we made to ar,
2931 # nm and ranlib will get reverted.
2932 # To avoid that, we hijack the saving mechanism and
2933 # have it save our new values.
2934 for file in ar nm ranlib; do
2936 eval $file=$xxx$_exe
2941 case "$targetarch" in
2942 '') echo "Targetarch not defined." >&4; croak=y ;;
2943 *) echo "Using targetarch $targetarch." >&4 ;;
2945 case "$targethost" in
2946 '') echo "Targethost not defined." >&4; croak=y ;;
2947 *) echo "Using targethost $targethost." >&4
2952 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2954 : compile a host miniperl and generate_uudmap, unless we got passed them
2955 if $test "X$hostperl" = X; then
2956 echo "Building host miniperl and generate_uudmap binaries" >&4
2964 $src/Configure -des -Dusedevel -Dmksymlinks
2966 case "$hostgenerate" in
2967 '') $make generate_uudmap
2968 hostgenerate=$src/host/generate_uudmap
2970 "$undef") hostgenerate=''
2973 hostperl=$src/host/miniperl
2976 hostosname=`$hostperl -le 'print $^O'`
2979 usecrosscompile="$undef"
2983 : Define -Dtargethost=somecomputer to run compiled tests on another machine
2984 case "$targethost" in
2985 '') echo "Checking for cross-compile" >&4
2986 case "$usecrosscompile$multiarch" in
2987 *$define*) echo "Skipping the try tests in the rest of Configure as no targethost was defined when cross-compiling" >&4
2988 if [ -f Makefile ]; then
2990 echo "Now you must ensure config.sh, config.h and the generated headers exist and run a $make."
2992 echo "Configure done."
2996 *) echo "No targethost for running compiler tests against defined, running locally" >&4
3003 *) echo "Using targethost $targethost." >&4
3005 /*) run=$src/Cross/run
3006 targetmkdir=$src/Cross/mkdir
3008 from=$src/Cross/from
3010 *) pwd=`$test -f ../Configure & cd ..; pwd`
3012 targetmkdir=$pwd/Cross/mkdir
3014 from=$pwd/Cross/from
3017 case "$targetrun" in
3018 '') targetrun=ssh ;;
3023 case "$targetfrom" in
3024 '') targetfrom=scp ;;
3028 from=$from-$targetfrom
3029 case "$targetdir" in
3031 echo "Guessing targetdir $targetdir." >&4
3034 case "$targetuser" in
3036 echo "Guessing targetuser $targetuser." >&4
3039 case "$targetport" in
3041 echo "Guessing targetport $targetport." >&4
3044 case "$targetfrom" in
3048 case "$targetrun" in
3068 '') cwd=$targetdir ;;
3073 $targetrun -p $targetport -l $targetuser $targethost "cd \$cwd && \$env \$exe \$@"
3079 *) echo "Unknown targetrun '$targetrun'" >&4
3083 case "$targetmkdir" in
3085 cat >$targetmkdir <<EOF
3087 $targetrun -p $targetport -l $targetuser $targethost "mkdir -p \$@"
3089 $chmod a+rx $targetmkdir
3091 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
3103 $targetmkdir \`dirname \$f\`
3104 $targetto -P $targetport -r $q \$f $targetuser@$targethost:\$f 2>/dev/null || exit 1
3107 $targetmkdir $targetdir/\`dirname \$f\`
3108 $targetto -P $targetport -r $q \$f $targetuser@$targethost:$targetdir/\$f 2>/dev/null || exit 1
3121 $mkdir -p $targetdir/\`dirname \$f\`
3122 $cp \$f $targetdir/\$f || exit 1
3125 $targetmkdir $targetdir/\`dirname \$f\`
3126 $cp \$f $targetdir/\$f || exit 1
3133 *) echo "Unknown targetto '$targetto'" >&4
3137 case "$targetfrom" in
3144 $targetfrom -P $targetport $q $targetuser@$targethost:$targetdir/\$f . || exit 1
3149 cp) cat >$from <<EOF
3154 cp $targetdir/\$f . || exit 1
3159 *) echo "Unknown targetfrom '$targetfrom'" >&4
3163 if $test ! -f $run; then
3164 echo "Target 'run' script '$run' not found." >&4
3168 if $test ! -f $to; then
3169 echo "Target 'to' script '$to' not found." >&4
3173 if $test ! -f $from; then
3174 echo "Target 'from' script '$from' not found." >&4
3178 if $test ! -f $run -o ! -f $to -o ! -f $from; then
3182 Using '$run' for remote execution,
3183 and '$from' and '$to'
3184 for remote file transfer.
3190 usecrosscompile="$undef"
3195 : see whether [:lower:] and [:upper:] are supported character classes
3197 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`"-"`echo AbyZ | $tr '[:upper:]' '[:lower:]' 2>/dev/null`" in
3199 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
3203 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
3204 # (0xd9 and 0xe2), therefore that is a nice testing point.
3205 if test "X$up" = X -o "X$low" = X; then
3206 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
3212 if test "X$up" = X -o "X$low" = X; then
3213 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
3219 if test "X$up" = X -o "X$low" = X; then
3220 case "`echo RS | od -x 2>/dev/null`" in
3222 echo "Hey, this might be EBCDIC." >&4
3223 if test "X$up" = X -o "X$low" = X; then
3224 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
3225 rs) up='[A-IJ-RS-Z]'
3230 if test "X$up" = X -o "X$low" = X; then
3231 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
3241 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
3243 echo "Using $up and $low to convert case." >&4
3246 echo "I don't know how to translate letters from upper to lower case." >&4
3247 echo "Your tr is not acting any way I know of." >&4
3251 : set up the translation script tr, must be called with ./tr of course
3255 '[A-Z][a-z]') exec $tr '$up' '$low';;
3256 '[a-z][A-Z]') exec $tr '$low' '$up';;
3263 : Try to determine whether config.sh was made on this system
3264 case "$config_sh" in
3266 myuname=`$uname -a 2>/dev/null`
3267 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
3268 # Downcase everything to avoid ambiguity.
3269 # Remove slashes and single quotes so we can use parts of this in
3270 # directory and file names.
3271 # Remove newlines so myuname is sane to use elsewhere.
3272 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
3273 # because the A-Z/a-z are not consecutive.
3274 myuname=`echo $myuname | $sed -e "s,['/],,g" | \
3275 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
3276 newmyuname="$myuname"
3278 case "$knowitall" in
3280 if test -f ../config.sh; then
3281 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3282 eval "`grep myuname= ../config.sh`"
3284 if test "X$myuname" = "X$newmyuname"; then
3292 : Get old answers from old config file if Configure was run on the
3293 : same system, otherwise use the hints.
3296 if test -f config.sh; then
3298 rp="I see a config.sh file. Shall I use it to set the defaults?"
3301 n*|N*) echo "OK, I'll ignore it."
3302 mv config.sh config.sh.old
3303 myuname="$newmyuname"
3305 *) echo "Fetching default answers from your old config.sh file..." >&4
3313 : Older versions did not always set $sh. Catch re-use of such
3323 if test ! -f config.sh; then
3326 First time through, eh? I have some defaults handy for some systems
3327 that need some extra help getting the Configure answers right:
3330 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3332 : Half the following guesses are probably wrong... If you have better
3333 : tests or hints, please send them to perlbug@perl.org
3334 : The metaconfig authors would also appreciate a copy...
3335 $test -f /irix && osname=irix
3336 $test -f /xenix && osname=sco_xenix
3337 $test -f /dynix && osname=dynix
3338 $test -f /dnix && osname=dnix
3339 $test -f /lynx.os && osname=lynxos
3340 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3341 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3342 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3343 $test -f /bin/mips && /bin/mips && osname=mips
3344 $test -d /usr/apollo/bin && osname=apollo
3345 $test -f /etc/saf/_sactab && osname=svr4
3346 $test -d /usr/include/minix && osname=minix && osvers=`$uname -r`
3347 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3348 $test -f /sys/utilities/MultiView && osname=amigaos
3349 if $test -d /MachTen -o -d /MachTen_Folder; then
3351 if $test -x /sbin/version; then
3352 osvers=`/sbin/version | $awk '{print $2}' |
3353 $sed -e 's/[A-Za-z]$//'`
3354 elif $test -x /usr/etc/version; then
3355 osvers=`/usr/etc/version | $awk '{print $2}' |
3356 $sed -e 's/[A-Za-z]$//'`
3362 $test -f /sys/posix.dll &&
3363 $test -f /usr/bin/what &&
3364 set X `/usr/bin/what /sys/posix.dll` &&
3365 $test "$3" = UWIN &&
3369 if $test -f $uname; then
3377 umips) osname=umips ;;
3380 [23]100) osname=mips ;;
3382 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3383 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3386 elif $test -f /etc/kconfig; then
3388 if test "$lns" = "$ln -s"; then
3390 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3392 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3399 if test -n "$DJGPP"; then
3408 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3410 # oslevel can fail with:
3411 # oslevel: Unable to acquire lock.
3412 *not\ found) osvers="$4"."$3" ;;
3413 '<3240'|'<>3240') osvers=3.2.0 ;;
3414 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3415 '=3250'|'>3250') osvers=3.2.5 ;;
3419 bitrig) osname=bitrig
3422 bsd386) osname=bsd386
3425 cygwin*) osname=cygwin
3428 *dc.osx) osname=dcosx
3434 domainos) osname=apollo
3440 dragonfly) osname=dragonfly
3443 dynixptx*) osname=dynixptx
3444 osvers=`echo "$4"|sed 's/^v//'`
3446 freebsd) osname=freebsd
3448 genix) osname=genix ;;
3452 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3465 $test -f /system/lib/libandroid.so && osname=linux-android
3469 netbsd*) osname=netbsd
3472 news-os) osvers="$3"
3474 4*) osname=newsos4 ;;
3478 nonstop-ux) osname=nonstopux ;;
3479 openbsd) osname=openbsd
3485 POSIX-BC | posix-bc ) osname=posix-bc
3488 powerux | power_ux | powermax_os | powermaxos | \
3489 powerunix | power_unix) osname=powerux
3495 solaris) osname=solaris
3497 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3504 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3508 titanos) osname=titanos
3517 ultrix) osname=ultrix
3520 osf1|mls+) case "$5" in
3523 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3526 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3529 hp*) osname=hp_osf1 ;;
3530 mips) osname=mips_osf1 ;;
3533 # UnixWare 7.1.2 is known as Open UNIX 8
3534 openunix|unixware) osname=svr5
3542 $2) case "$osname" in
3546 : svr4.x or possibly later
3556 if test -f /stand/boot ; then
3557 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3558 if test -n "$INITPROG" -a -f "$INITPROG"; then
3559 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3560 if test -n "$isesix"; then
3568 *) if test -f /etc/systemid; then
3570 set `echo $3 | $sed 's/\./ /g'` $4
3571 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3573 elif $test -f $src/hints/sco_$1_$2.sh; then
3575 elif $test -f $src/hints/sco_$1.sh; then
3580 '') : Still unknown. Probably a generic Sys V.
3589 *) case "$osname" in
3590 '') : Still unknown. Probably a generic BSD.
3598 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3599 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3600 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3603 $rm -f UU/kernel.what
3604 elif test -d c:/. -o -n "$is_os2" ; then
3611 case "$targetarch" in
3614 case "$targetarch" in
3616 # Will load qnx.sh, which should change osname to nto
3621 # Catch arm-linux-androideabi, mipsel-linux-android,
3622 # and i686-linux-android
3623 osname=linux-android
3627 # Something like arm-linux-gnueabihf is really just
3634 # XXX perhaps we should just assume
3635 # osvers to be 2, or maybe take the value
3636 # from targetarch. Using $run before the
3637 # hints are run is somewhat icky.
3638 set X `$run $uname -a 2>/dev/null`
3641 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3646 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3653 : Now look for a hint file osname_osvers, unless one has been
3654 : specified already.
3657 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3658 : Also try without trailing minor version numbers.
3659 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3660 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3661 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3662 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3665 *) case "$osvers" in
3668 *) if $test -f $src/hints/$file.sh ; then
3670 elif $test -f $src/hints/$xfile.sh ; then
3672 elif $test -f $src/hints/$xxfile.sh ; then
3674 elif $test -f $src/hints/$xxxfile.sh ; then
3676 elif $test -f $src/hints/$xxxxfile.sh ; then
3678 elif $test -f "$src/hints/${osname}.sh" ; then
3687 if $test -f Policy.sh ; then
3690 none) dflt="Policy" ;;
3691 *) dflt="Policy $dflt" ;;
3696 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3700 if $test -f Policy.sh ; then
3703 There's also a Policy hint file available, which should make the
3704 site-specific (policy) questions easier to answer.
3711 You may give one or more space-separated answers, or "none" if appropriate.
3712 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3713 previous run of Configure, you may specify it as well as or instead of
3714 OS-specific hints. If hints are provided for your OS, you should use them:
3715 although Perl can probably be built without hints on many platforms, using
3716 hints often improve performance and may enable features that Configure can't
3717 set up on its own. If there are no hints that match your OS, specify "none";
3718 DO NOT give a wrong version or a wrong OS.
3722 rp="Which of these apply, if any?"
3725 for file in $tans; do
3726 if $test X$file = XPolicy -a -f Policy.sh; then
3728 $cat Policy.sh >> UU/config.sh
3729 elif $test -f $src/hints/$file.sh; then
3730 . $src/hints/$file.sh
3731 $cat $src/hints/$file.sh >> UU/config.sh
3732 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3735 : Give one chance to correct a possible typo.
3736 echo "$file.sh does not exist"
3738 rp="hint to use instead?"
3740 for file in $ans; do
3741 if $test -f "$src/hints/$file.sh"; then
3742 . $src/hints/$file.sh
3743 $cat $src/hints/$file.sh >> UU/config.sh
3744 elif $test X$ans = X -o X$ans = Xnone ; then
3747 echo "$file.sh does not exist -- ignored."
3754 : Remember our hint file for later.
3755 if $test -f "$src/hints/$file.sh" ; then
3765 echo "Fetching default answers from $config_sh..." >&4
3769 cp $config_sh config.sh 2>/dev/null
3779 test "$override" && . ./optdef.sh
3781 : Restore computed paths
3782 for file in $loclist $trylist; do
3783 eval $file="\$_$file"
3788 Configure uses the operating system name and version to set some defaults.
3789 The default value is probably right if the name rings a bell. Otherwise,
3790 since spelling matters for me, either accept the default or answer "none"
3797 ''|' '|none) dflt=none ;;
3798 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3801 *) dflt="$osname" ;;
3803 rp="Operating system name?"
3807 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3813 ''|' '|none) dflt=none ;;
3814 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3815 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3817 ''|' ') dflt=none ;;
3822 *) dflt="$osvers" ;;
3824 rp="Operating system version?"
3834 : who configured the system
3835 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3838 cf_by=`(logname) 2>/dev/null`
3841 cf_by=`(whoami) 2>/dev/null`
3843 "") cf_by=unknown ;;
3848 : decide how portable to be. Allow command line overrides.
3849 case "$d_portable" in
3851 *) d_portable="$define" ;;
3854 : set up shell script to do ~ expansion
3860 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3863 if $test -f /bin/csh; then
3864 /bin/csh -f -c "glob \$1"
3869 name=\`$expr x\$1 : '..\([^/]*\)'\`
3870 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3871 if $test ! -d "\$dir"; then
3873 echo "\$me: can't locate home directory for: \$name" >&2
3878 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3894 : now set up to get a file name
3898 cat <<'EOSC' >>getfile
3914 : getfile will accept an answer from the comma-separated list
3915 : enclosed in parentheses even if it does not meet other criteria.
3916 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3917 fn=`echo $fn | sed 's/(.*)//'`
3923 loc_file=`expr $fn : '.*:\(.*\)'`
3924 fn=`expr $fn : '\(.*\):.*'`
3932 */*) fullpath=true;;
3941 *e*) exp_file=true;;
3944 *p*) nopath_ok=true;;
3949 *d*) type='Directory';;
3950 *l*) type='Locate';;
3955 Locate) what='File';;
3960 case "$d_portable" in
3968 while test "$type"; do
3973 true) rp="$rp (~name ok)";;
3976 if test -f UU/getfile.ok && \
3977 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3996 value=`UU/filexp $ans`
3999 if test "$ans" != "$value"; then
4000 echo "(That expands to $value on this system.)"
4014 /*) value="$ansexp" ;;
4015 [a-zA-Z]:/*) value="$ansexp" ;;
4020 echo "I shall only accept a full path name, as in /bin/ls." >&4
4021 echo "Use a ! shell escape if you wish to check pathnames." >&4
4024 echo "Please give a full path name, starting with slash." >&4
4027 echo "Note that using ~name is ok provided it expands well." >&4
4040 for fp in $gfpth; do
4041 if test "X$fp" = X.; then
4046 if test -f "$pf"; then
4048 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
4050 echo "($value is not a plain file, but that's ok.)"
4053 if test X"$type" = X; then
4060 for fp in $gfpth; do
4061 if test "X$fp" = X.; then
4066 direxp="$fp/$ansexp"
4068 if test -d "$direxp"; then
4076 if test -d "$ansexp"; then
4077 echo "(Looking for $loc_file in directory $value.)"
4078 value="$value/$loc_file"
4079 ansexp="$ansexp/$loc_file"
4081 if test -f "$ansexp"; then
4084 case "$nopath_ok" in
4085 true) case "$value" in
4087 *) echo "Assuming $value will be in people's path."
4103 if test "$fastread" = yes; then
4108 rp="$what $value doesn't exist. Use that name anyway?"
4127 test "X$gfpthkeep" != Xy && gfpth=""
4130 : determine root of directory hierarchy where package will be installed.
4133 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
4136 dflt=`echo "$prefix" | sed 's/.$//'`
4144 By default, $package will be installed in $dflt/bin, manual pages
4145 under $dflt/man, etc..., i.e. with $dflt as prefix for all
4146 installation directories. Typically this is something like /usr/local.
4147 If you wish to have binaries under /usr/bin but other parts of the
4148 installation under /usr/local, that's ok: you will be prompted
4149 separately for each of the installation directories, the prefix being
4150 only used to set the defaults.
4154 rp='Installation prefix to use?'
4162 *) oldprefix="$prefix";;
4169 : allow them to override the AFS root
4172 *) afsroot=$afsroot ;;
4178 $define|true) afs=true ;;
4179 $undef|false) afs=false ;;
4180 *) if $test -d $afsroot; then
4188 echo "AFS may be running... I'll be extra cautious then..." >&4
4190 echo "AFS does not seem to be running..." >&4
4193 : determine installation prefix for where package is to be installed.
4197 Since you are running AFS, I need to distinguish the directory in which
4198 files will reside from the directory in which they are installed (and from
4199 which they are presumably copied to the former directory by occult means).
4202 case "$installprefix" in
4203 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
4204 *) dflt="$installprefix";;
4209 In some special cases, particularly when building $package for distribution,
4210 it is convenient to distinguish the directory in which files should be
4211 installed from the directory ($prefix) in which they will
4212 eventually reside. For most users, these two directories are the same.
4215 case "$installprefix" in
4217 *) dflt=$installprefix;;
4221 rp='What installation prefix should I use for installing files?'
4223 installprefix="$ans"
4224 installprefixexp="$ansexp"
4226 : Perform the prefixexp/installprefixexp correction if necessary
4227 cat <<EOS >installprefix
4230 cat <<'EOSC' >>installprefix
4231 : Change installation prefix, if necessary.
4232 if $test X"$prefix" != X"$installprefix"; then
4233 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
4235 eval "install${prefixvar}=\"\$${prefixvar}exp\""
4238 chmod +x installprefix
4239 $eunicefix installprefix
4241 : Set variables such as privlib and privlibexp from the output of ./getfile
4242 : performing the prefixexp/installprefixexp correction if necessary.
4243 cat <<EOS >setprefixvar
4246 cat <<'EOSC' >>setprefixvar
4247 eval "${prefixvar}=\"\$ans\""
4248 eval "${prefixvar}exp=\"\$ansexp\""
4251 chmod +x setprefixvar
4252 $eunicefix setprefixvar
4254 : set up the script used to warn in case of inconsistency
4263 '') echo "The $hint value for \$$var on this machine was \"$was\"!" >&4
4265 *) echo "Hmm. Based on the hints in hints/$hintfile.sh, " >&4
4266 echo "the $hint value for \$$var on this machine was \"$was\"!" >&4
4271 echo "*** WHOA THERE!!! ***" >&4
4272 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
4275 rp=" Keep the $hint value?"
4278 y) td=$was; tu=$was;;
4282 : function used to set '$1' to '$val'
4283 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
4285 $define$undef) . ./whoa; eval "$var=\$td";;
4286 $undef$define) . ./whoa; eval "$var=\$tu";;
4287 *) eval "$var=$val";;
4290 : get the patchlevel
4292 echo "Getting the current patchlevel..." >&4
4293 if $test -r $rsrc/patchlevel.h;then
4294 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
4295 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4296 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4297 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4298 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4299 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4300 perl_patchlevel=`egrep ',"(MAINT|SMOKE)[0-9][0-9]*"' $rsrc/patchlevel.h|tail -1|sed 's/[^0-9]//g'`
4309 $echo "(You do not have patchlevel.h. Eek.)"
4311 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
4312 version_patchlevel_string="version $patchlevel subversion $subversion"
4313 case "$perl_patchlevel" in
4315 *) perl_patchlevel=`echo $perl_patchlevel | sed 's/.* //'`
4316 version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel"
4320 $echo "(You have $package $version_patchlevel_string.)"
4324 : XXX Should be a Configure test for double-dots in filenames.
4325 version=`echo $revision $patchlevel $subversion | \
4326 $awk '{ printf "%d_%d_%d", $1, $2, $3 }'`
4327 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4328 $awk '{ printf "%d_%d_%d", $1, $2, $3 }'`
4331 version=`echo $revision $patchlevel $subversion | \
4332 $awk '{ printf "%d.%d.%d", $1, $2, $3 }'`
4333 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4334 $awk '{ printf "%d.%d.%d", $1, $2, $3 }'`
4337 : Special case the 5.005_xx maintenance series, which used 5.005
4338 : without any subversion label as a subdirectory in $sitelib
4339 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4340 api_versionstring='5.005'
4343 : Do we want threads support and if so, what type
4344 case "$usethreads" in
4345 $define|true|[yY]*) dflt='y';;
4346 *) # Catch case where user specified ithreads or 5005threads but
4347 # forgot -Dusethreads (A.D. 4/2002)
4348 case "$useithreads$use5005threads" in
4349 *$define*) dflt='y';;
4356 Perl can be built to offer a form of threading support on some systems
4357 To do so, Configure can be run with -Dusethreads.
4359 Note that Perl built with threading support runs slightly slower
4360 and uses slightly more memory than plain Perl.
4362 If this doesn't make any sense to you, just accept the default '$dflt'.
4364 rp='Build a threading Perl?'
4367 y|Y) val="$define" ;;
4373 if $test $patchlevel -lt 9; then
4374 case "$usethreads" in
4376 : Default to ithreads unless overridden on command line or with
4379 case "$use5005threads" in
4381 echo "5.005 threads are no longer supported"
4385 case "$useithreads" in
4386 $undef|false|[nN]*) dflt='n';;
4388 rp='Use the newer interpreter-based ithreads?'
4391 y|Y) val="$define" ;;
4396 : Now set use5005threads to the opposite value.
4397 case "$useithreads" in
4398 $define) val="$undef" ;;
4405 useithreads="$undef"
4406 use5005threads="$undef"
4410 case "$useithreads$use5005threads" in
4414 You cannot have both the ithreads and the 5.005 threads enabled
4415 at the same time. Disabling the 5.005 threads since they are
4416 much less stable than the ithreads.
4419 use5005threads="$undef"
4424 : perl-5.9.x and later
4426 if test X"$usethreads" = "X$define"; then
4427 case "$use5005threads" in
4431 5.005 threads has been removed for 5.10. Perl will be built using ithreads.
4438 use5005threads="$undef"
4439 useithreads="$usethreads"
4442 case "$d_oldpthreads" in
4443 '') : Configure tests would be welcome here. For now, assume undef.
4445 *) val="$d_oldpthreads" ;;
4451 : Look for a hint-file generated 'call-back-unit'. If the
4452 : user has specified that a threading perl is to be built,
4453 : we may need to set or change some other defaults.
4454 if $test -f usethreads.cbu; then
4455 echo "Your platform has some specific hints regarding threaded builds, using them..."
4458 case "$usethreads" in
4459 "$define"|true|[yY]*)
4461 (Your platform does not have any specific hints for threaded builds.
4462 Assuming POSIX threads, then.)
4468 : Check if multiplicity is required
4471 Perl can be built so that multiple Perl interpreters can coexist
4472 within the same Perl executable.
4475 case "$useithreads" in
4478 This multiple interpreter support is required for interpreter-based threads.
4482 *) case "$usemultiplicity" in
4483 $define|true|[yY]*) dflt='y';;
4487 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4488 rp='Build Perl for multiplicity?'
4491 y|Y) val="$define" ;;
4499 : Check if morebits is requested
4500 case "$usemorebits" in
4501 "$define"|true|[yY]*)
4502 use64bitint="$define"
4503 uselongdouble="$define"
4504 usemorebits="$define"
4506 *) usemorebits="$undef"
4510 : Determine the C compiler to be used
4516 rp="Use which C compiler?"
4520 : See whether they have no cc but they do have gcc
4522 if $test -f cc.cbu; then
4527 : make some quick guesses about what we are up against
4529 $echo $n "Hmm... $c"
4539 $cat $sysroot/usr/include/signal.h $sysroot/usr/include/sys/signal.h >foo 2>/dev/null
4540 if test -f /osf_boot || $contains 'OSF/1' $sysroot/usr/include/ctype.h >/dev/null 2>&1
4542 echo "Looks kind of like an OSF/1 system, but we'll see..."
4544 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4545 xxx=`./loc addbib blurfl $pth`
4546 if $test -f $xxx; then
4547 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4551 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4552 echo "Looks kind of like an extended USG system, but we'll see..."
4554 echo "Looks kind of like a USG system, but we'll see..."
4558 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4559 echo "Looks kind of like a BSD system, but we'll see..."
4563 echo "Looks kind of like a Version 7 system, but we'll see..."
4566 case "$eunicefix" in
4569 There is, however, a strange, musty smell in the air that reminds me of
4570 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4574 : it so happens the Eunice I know will not run shell scripts in Unix format
4578 echo "Congratulations. You aren't running Eunice."
4582 : Detect OS2. The p_ variable is set above in the Head.U unit.
4583 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4584 : semicolon as a patch separator
4589 I have the feeling something is not exactly right, however...don't tell me...
4590 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4591 (Or you may be running DOS with DJGPP.)
4596 if test -f /xenix; then
4597 echo "Actually, this looks more like a XENIX system..."
4602 echo "It's not Xenix..."
4607 if test -f /venix; then
4608 echo "Actually, this looks more like a VENIX system..."
4615 echo "Nor is it Venix..."
4618 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4619 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4622 : Check if we are using GNU gcc and what its version is
4624 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4628 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4630 printf("%s\n", __VERSION__);
4632 printf("%s\n", "1");
4638 if $cc -o try $ccflags $ldflags try.c; then
4639 gccversion=`$run ./try`
4640 case "$gccversion" in
4641 '') echo "You are not using GNU cc." ;;
4642 *) echo "You are using GNU cc $gccversion."
4648 echo "*** WHOA THERE!!! ***" >&4
4649 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4650 case "$knowitall" in
4652 echo " You'd better start hunting for one and let me know about it." >&4
4658 case "$gccversion" in
4659 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4661 case "$gccversion" in
4662 '') gccosandvers='' ;;
4663 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4664 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4666 case "$gccosandvers" in
4667 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4668 $osname$osvers) ;; # looking good
4669 $osname*) cat <<EOM >&4
4671 *** WHOA THERE!!! ***
4673 Your gcc has not been compiled for the exact release of
4674 your operating system ($gccosandvers versus $osname$osvers).
4676 In general it is a good idea to keep gcc synchronized with
4677 the operating system because otherwise serious problems
4678 may ensue when trying to compile software, like Perl.
4680 I'm trying to be optimistic here, though, and will continue.
4681 If later during the configuration and build icky compilation
4682 problems appear (headerfile conflicts being the most common
4683 manifestation), I suggest reinstalling the gcc to match
4684 your operating system release.
4688 *) gccosandvers='' ;; # failed to parse, better be silent
4696 # gcc 3.* complain about adding -Idirectories that they already know about,
4697 # so we will take those off from locincpth.
4698 case "$gccversion" in
4700 echo "main(){}">try.c
4701 for incdir in $locincpth; do
4702 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4703 grep '^c[cp]p*[01]: warning: changing search order '`
4704 if test "X$warn" != X; then
4705 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4711 # gcc 4.9 by default does some optimizations that break perl.
4712 # see ticket 121505.
4714 # The -fwrapv disables those optimizations (and probably others,) so
4715 # for gcc 4.9 (and later, since the optimizations probably won't go
4716 # away), add -fwrapv unless the user requests -fno-wrapv, which
4717 # disables -fwrapv, or if the user requests -fsanitize=undefined,
4718 # which turns the overflows -fwrapv ignores into runtime errors.
4719 case "$gccversion" in
4720 4.[3-9].*|4.[1-9][0-9]*|[5-9].*|[1-9][0-9]*)
4722 *-fno-wrapv*|*-fsanitize=undefined*|*-fwrapv*) ;;
4723 *) ccflags="$ccflags -fwrapv" ;;
4727 : What should the include directory be ?
4728 : Use sysroot if set, so findhdr looks in the right place.
4730 $echo $n "Hmm... $c"
4731 dflt="$sysroot/usr/include"
4734 if $test -f /bin/mips && /bin/mips; then
4735 echo "Looks like a MIPS system..."
4736 $cat >usr.c <<'EOCP'
4737 #ifdef SYSTYPE_BSD43
4741 if $cc $cppflags -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4742 dflt='/bsd43/usr/include'
4746 mips_type='System V'
4748 $rm -f usr.c usr.out
4749 echo "and you're compiling with the $mips_type compiler and libraries."
4753 echo "Doesn't look like a MIPS system."
4763 case "$xxx_prompt" in
4766 rp='Where are the include files you want to use?'
4774 : see how we invoke the C preprocessor
4776 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4777 cat <<'EOT' >testcpp.c
4783 if test ! -f cppstdin; then
4784 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4785 # AIX cc -E doesn't show the absolute headerfile
4786 # locations but we'll cheat by using the -M flag.
4787 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
4789 echo 'cat >.$$.c; '"$cc $cppflags"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4792 echo "Keeping your $hint cppstdin wrapper."
4795 wrapper=`pwd`/cppstdin
4799 if $test "X$cppstdin" != "X" && \
4800 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4801 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4803 echo "You used to use $cppstdin $cppminus so we'll use that again."
4805 '') echo "But let's see if we can live without a wrapper..." ;;
4807 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4808 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4810 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4813 echo "(However, $cpprun $cpplast does not work, let's see...)"
4821 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4828 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4829 $cc -E <testcpp.c >testcpp.out 2>&1; \
4830 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4831 echo "Yup, it does."
4832 x_cpp="$cc $cppflags -E"
4834 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4835 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4836 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4837 echo "Yup, it does."
4838 x_cpp="$cc $cppflags -E"
4840 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4841 $cc -P <testcpp.c >testcpp.out 2>&1; \
4842 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4843 echo "Yipee, that works!"
4844 x_cpp="$cc $cppflags -P"
4846 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4847 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4848 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4849 echo "At long last!"
4850 x_cpp="$cc $cppflags -P"
4852 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4853 $cpp <testcpp.c >testcpp.out 2>&1; \
4854 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4856 x_cpp="$cpp $cppflags"
4858 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4859 $cpp - <testcpp.c >testcpp.out 2>&1; \
4860 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4861 echo "Hooray, it works! I was beginning to wonder."
4862 x_cpp="$cpp $cppflags"
4864 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4865 $wrapper <testcpp.c >testcpp.out 2>&1; \
4866 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4872 rp="No dice. I can't find a C preprocessor. Name one:"
4876 $x_cpp <testcpp.c >testcpp.out 2>&1
4877 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4878 echo "OK, that will do." >&4
4880 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4895 echo "Perhaps can we force $cc -E using a wrapper..."
4896 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4897 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4903 echo "Nope, we'll have to live without it..."
4917 "$wrapper"|'cppstdin') ;;
4918 *) $rm -f $wrapper;;
4920 $rm -f testcpp.c testcpp.out
4922 : Adjust cppfilter for path component separator
4924 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
4925 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
4929 : Use gcc to determine libpth and incpth
4930 # If using gcc or clang, we can get better values for libpth, incpth
4931 # and usrinc directly from the compiler.
4932 # Note that ccname for clang is also gcc.
4935 $echo 'extern int foo;' > try.c
4936 set X `$cppstdin -v try.c 2>&1 | $awk '/^#include </,/^End of search /'|$cppfilter $grep '/include'`
4938 if $test $# -gt 0; then
4940 incpth="`$echo $incpth|$sed 's/^ //'`"
4942 j="`$echo $i|$sed 's,/include$,/lib,'`"
4943 if $test -d $j; then
4947 libpth="`$echo $libpth|$sed 's/^ //'`"
4948 for xxx in $libpth $loclibpth $plibpth $glibpth; do
4949 if $test -d $xxx; then
4952 *) libpth="$libpth $xxx";;
4959 '') for i in $incpth; do
4960 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
4968 case "$usecrosscompile" in
4971 '') echo "Incpth not defined." >&4; croak=y ;;
4972 *) echo "Using incpth '$incpth'." >&4 ;;
4975 '') echo "Libpth not defined." >&4; croak=y ;;
4976 *) echo "Using libpth '$libpth'." >&4 ;;
4979 '') echo "Usrinc not defined." >&4; croak=y ;;
4980 *) echo "Using usrinc $usrinc." >&4 ;;
4984 if test "X$sysroot" = X; then
4985 echo "Cannot continue, aborting." >&4; exit 1
4987 echo "Cross-compiling using sysroot $sysroot, failing to guess inc/lib paths is not fatal" >&4
4996 : Default value for incpth is just usrinc
4998 '') incpth="$usrinc";;
5001 : Set private lib path
5004 plibpth="$incpath/usr/lib $sysroot/usr/local/lib $sysroot/usr/ccs/lib"
5009 '') dlist="$loclibpth $plibpth $glibpth";;
5010 *) dlist="$libpth";;
5013 : Now check and see which directories actually exist, avoiding duplicates
5016 if $test -d $xxx; then
5019 *) libpth="$libpth $xxx";;
5025 Some systems have incompatible or broken versions of libraries. Among
5026 the directories listed in the question below, please remove any you
5027 know not to be holding relevant libraries, and add any that are needed.
5028 Say "none" for none.
5032 if test "X$sysroot" != X; then
5034 You have set sysroot to $sysroot, please supply the directories excluding sysroot
5047 rp="Directories to use for library searches?"
5054 : compute shared library extension
5057 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
5067 On some systems, shared libraries may be available. Answer 'none' if
5068 you want to suppress searching of shared libraries for the remainder
5069 of this configuration.
5072 rp='What is the file extension used for shared libraries?'
5076 : Does target system insist that shared library basenames are unique
5079 Some dynamic loaders assume that the *basename* of shared library filenames
5080 are globally unique. We'll default this to undef as we assume your system
5081 is not this weird. Set to defined if you're on one of them.
5086 rp='Make shared library basenames unique?'
5089 y|Y) val="$define" ;;
5092 set d_libname_unique
5095 : Define several unixisms.
5096 : Hints files or command line option can be used to override them.
5097 : The convoluted testing is in case hints files set either the old
5100 '') case "$exe_ext" in
5102 *) _exe="$exe_ext" ;;
5107 '') case "$lib_ext" in
5114 '') case "$obj_ext" in
5121 '') case "$path_sep" in
5132 rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
5134 : Which makefile gets called first. This is used by make depend.
5135 case "$firstmakefile" in
5136 '') firstmakefile='makefile';;
5139 : Check is we will use socks
5141 $define|true|[yY]*) dflt='y';;
5146 Perl can be built to use the SOCKS proxy protocol library. To do so,
5147 Configure must be run with -Dusesocks. If you use SOCKS you also need
5148 to use the PerlIO abstraction layer, this will be implicitly selected.
5150 If this doesn't make any sense to you, just accept the default '$dflt'.
5152 rp='Build Perl for SOCKS?'
5155 y|Y) val="$define" ;;
5161 : Check for uselongdouble support
5163 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
5166 case "$uselongdouble" in
5167 $define|true|[yY]*) dflt='y';;
5172 Perl can be built to take advantage of long doubles which
5173 (if available) may give more accuracy and range for floating point numbers.
5175 If this doesn't make any sense to you, just accept the default '$dflt'.
5177 rp='Try to use long doubles if available?'
5180 y|Y) val="$define" ;;
5186 case "$uselongdouble" in
5187 true|[yY]*) uselongdouble="$define" ;;
5190 : Look for a hint-file generated 'call-back-unit'. If the
5191 : user has specified that long doubles should be used,
5192 : we may need to set or change some other defaults.
5193 if $test -f uselongdouble.cbu; then
5194 echo "Your platform has some specific hints regarding long doubles, using them..."
5195 . ./uselongdouble.cbu
5197 case "$uselongdouble" in
5200 (Your platform does not have any specific hints for long doubles.)
5206 : Check if quadmath is requested
5207 case "$usequadmath" in
5208 "$define"|true|[yY]*) usequadmath="$define" ;;
5209 *) usequadmath="$undef" ;;
5212 : Looking for optional libraries
5214 echo "Checking for optional libraries..." >&4
5219 case "$libswanted" in
5220 '') libswanted='c_s';;
5223 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
5225 case "$usecbacktrace" in
5226 "$define") libswanted="$libswanted bfd" ;;
5228 case "$usequadmath" in
5229 "$define") libswanted="$libswanted quadmath" ;;
5235 for thisdir in $libpth $xlibpth; do
5236 test -d $thisdir && libspath="$libspath $thisdir"
5238 for thislib in $libswanted; do
5239 for thisdir in $libspath; do
5241 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
5242 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
5243 $test -f "$xxx" && eval $libscheck
5244 $test -f "$xxx" && libstyle=shared
5245 xxx=`ls $thisdir/lib$thislib.[0-9].$so 2>/dev/null|sed -n '$p'`
5246 $test -f "$xxx" && eval $libscheck
5247 $test -f "$xxx" && libstyle=shared
5249 if test ! -f "$xxx"; then
5250 xxx=$thisdir/lib$thislib.$so
5251 $test -f "$xxx" && eval $libscheck
5252 $test -f "$xxx" && libstyle=shared
5254 if test ! -f "$xxx"; then
5255 xxx=$thisdir/lib$thislib$_a
5256 $test -f "$xxx" && eval $libscheck
5257 $test -f "$xxx" && libstyle=static
5259 if test ! -f "$xxx"; then
5260 xxx=$thisdir/$thislib$_a
5261 $test -f "$xxx" && eval $libscheck
5262 $test -f "$xxx" && libstyle=static
5264 if test ! -f "$xxx"; then
5265 xxx=$thisdir/lib${thislib}_s$_a
5266 $test -f "$xxx" && eval $libscheck
5267 $test -f "$xxx" && libstyle=static
5268 $test -f "$xxx" && thislib=${thislib}_s
5270 if test ! -f "$xxx"; then
5271 xxx=$thisdir/Slib$thislib$_a
5272 $test -f "$xxx" && eval $libscheck
5273 $test -f "$xxx" && libstyle=static
5275 if $test -f "$xxx"; then
5277 shared) echo "Found -l$thislib (shared)." ;;
5278 static) echo "Found -l$thislib." ;;
5279 *) echo "Found -l$thislib ($libstyle)." ;;
5283 *) dflt="$dflt -l$thislib"
5284 libsfound="$libsfound $xxx"
5286 libsfiles="$libsfiles $yyy"
5287 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
5288 case " $libsdirs " in
5290 *) libsdirs="$libsdirs $yyy" ;;
5297 if $test ! -f "$xxx"; then
5298 echo "No -l$thislib."
5309 ' '|'') dflt='none';;
5314 In order to compile $package on your machine, a number of libraries
5315 are usually needed. Include any other special libraries here as well.
5316 Say "none" for none. The default list is almost always right.
5320 rp="What libraries to use?"
5327 : determine optimization, if desired, or use for debug flag also
5329 ' '|$undef) dflt='none';;
5331 *) dflt="$optimize";;
5335 By default, $package compiles with the -O flag to use the optimizer.
5336 Alternately, you might want to use the symbolic debugger, which uses
5337 the -g flag (on traditional Unix systems). Either flag can be
5338 specified here. To use neither flag, specify the word "none".
5341 rp="What optimizer/debugger flag should be used?"
5345 'none') optimize=" ";;
5348 : Check what DEBUGGING is required from the command line
5349 : -DEBUGGING or -DDEBUGGING or
5350 : -DEBUGGING=both = -g + -DDEBUGGING
5351 : -DEBUGGING=-g or -Doptimize=-g = -g
5352 : -DEBUGGING=none or -UDEBUGGING =
5353 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
5356 *) DEBUGGING=$EBUGGING ;;
5359 case "$DEBUGGING" in
5363 *) optimize="$optimize -g" ;;
5367 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
5375 case "$DEBUGGING" in
5376 both|$define) dflt='-DDEBUGGING'
5379 : argument order is deliberate, as the flag will start with - which set could
5380 : think is an option
5381 checkccflag='check=$1; flag=$2; callback=$3;
5383 echo "Checking if your compiler accepts $flag" 2>&1;
5384 [ "X$sysroot" != "X" ] && echo "For sysroot = $sysroot";
5385 echo "int main(void) { return 0; }" > gcctest.c;
5386 if $cc $_sysroot -O2 $flag -o gcctest gcctest.c 2>gcctest.out && $run ./gcctest; then
5387 echo "Yes, it does." 2>&1;
5388 if $test -s gcctest.out ; then
5389 echo "But your platform does not like it:";
5394 echo "Leaving current flags $ccflags alone." 2>&1
5396 *) dflt="$dflt $flag";
5402 echo "Nope, it does not, but that is ok." 2>&1;
5406 : We will not override a previous value, but we might want to
5407 : augment a hint file
5409 default|recommended)
5410 case "$gccversion" in
5411 1*) dflt="$dflt -fpcc-struct-return" ;;
5413 case "$optimize:$DEBUGGING" in
5414 *-g*:old) dflt="$dflt -DDEBUGGING";;
5416 case "$gccversion" in
5417 2*) if $test -d /etc/conf/kconfig.d &&
5418 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
5420 # Interactive Systems (ISC) POSIX mode.
5425 case "$gccversion" in
5428 ?*) set strict-aliasing -fno-strict-aliasing
5432 # For gcc, adding -pipe speeds up compilations for some, but apparently
5433 # some assemblers can't read from stdin. (It also slows down compilations
5434 # in other cases, but those are apparently rarer these days.) AD 5/2004.
5435 case "$gccversion" in
5441 # on x86_64 (at least) we require an extra library (libssp) in the
5442 # link command line. This library is not named, so I infer that it is
5443 # an implementation detail that may change. Hence the safest approach
5444 # is to add the flag to the flags passed to the compiler at link time,
5445 # as that way the compiler can do the right implementation dependant
5448 amigaos) ;; # -fstack-protector builds but doesn't work
5449 *) case "$gccversion" in
5450 ?*) set stack-protector-strong -fstack-protector-strong
5453 *-fstack-protector-strong*) ;; # It got added.
5454 *) # Try the plain/older -fstack-protector.
5455 set stack-protector -fstack-protector
5466 case "$mips_type" in
5467 *BSD*|'') inclwanted="$locincpth $usrinc";;
5468 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
5470 for thisincl in $inclwanted; do
5471 if $test -d $thisincl; then
5472 if $test x$thisincl != x$usrinc; then
5474 *" -I$thisincl "*);;
5475 *) dflt="$dflt -I$thisincl ";;
5481 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
5483 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5491 *) dflt="$dflt -D$2";;
5495 set signal.h LANGUAGE_C; eval $inctest
5499 ccflags="$ccflags -DSOCKS"
5504 default|recommended) dflt="$ccflags $dflt" ;;
5505 *) dflt="$ccflags";;
5514 Your C compiler may want other flags. For this question you should include
5515 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5516 but you should NOT include libraries or ld flags like -lwhatever. If you
5517 want $package to honor its debug switch, you should include -DDEBUGGING here.
5518 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5520 To use no flags, specify the word "none".
5526 rp="Any additional cc flags?"
5533 : the following weeds options from ccflags that are of no interest to cpp
5535 '') cppflags="$ccflags" ;;
5536 *) cppflags="$cppflags $ccflags" ;;
5538 case "$gccversion" in
5539 1*) cppflags="$cppflags -D__GNUC__"
5541 case "$mips_type" in
5543 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5549 echo "Let me guess what the preprocessor flags are..." >&4
5563 *) ftry="$previous $flag";;
5565 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5566 >cpp1.out 2>/dev/null && \
5567 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5568 >cpp2.out 2>/dev/null && \
5569 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5570 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5572 cppflags="$cppflags $ftry"
5582 *-*) echo "They appear to be: $cppflags";;
5584 $rm -f cpp.c cpp?.out
5588 : flags used in final linking phase
5590 '') if ./venix; then
5596 *-posix*) dflt="$dflt -posix" ;;
5599 *) dflt="$ldflags";;
5601 # See note above about -fstack-protector
5603 *-fstack-protector-strong*)
5605 *-fstack-protector-strong*) ;; # Don't add it again
5606 *) dflt="$dflt -fstack-protector-strong" ;;
5609 *-fstack-protector*)
5611 *-fstack-protector*) ;; # Don't add it again
5612 *) dflt="$dflt -fstack-protector" ;;
5617 : Try to guess additional flags to pick up local libraries.
5618 for thislibdir in $libpth; do
5619 case " $loclibpth " in
5622 *"-L$thislibdir "*) ;;
5623 *) dflt="$dflt -L$thislibdir" ;;
5635 Your C linker may need flags. For this question you should
5636 include -L/whatever and any other flags used by the C linker, but you
5637 should NOT include libraries like -lwhatever.
5639 Make sure you include the appropriate -L/path flags if your C linker
5640 does not normally search all of the directories you specified above,
5643 To use no flags, specify the word "none".
5647 rp="Any additional ld flags (NOT including libraries)?"
5653 rmlist="$rmlist pdp11"
5657 echo "Checking your choice of C compiler and flags for coherency..." >&4
5658 $cat > try.c <<'EOF'
5660 int main() { printf("Ok\n"); return(0); }
5662 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5664 $cat >try.msg <<'EOM'
5665 I've tried to compile and run the following simple program:
5668 $cat try.c >> try.msg
5670 $cat >> try.msg <<EOM
5677 and I got the following output:
5681 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5682 if $sh -c "$run ./try " >>try.msg 2>&1; then
5686 *) echo 'The program compiled OK, but produced no output.' >> try.msg ;;
5689 echo "The program compiled OK, but exited with status $?." >>try.msg
5690 rp="You have a problem. Shall I abort Configure"
5694 echo "I can't compile the test program." >>try.msg
5695 rp="You have a BIG problem. Shall I abort Configure"
5701 case "$knowitall" in
5703 echo "(The supplied flags or libraries might be incorrect.)"
5711 *) echo "Ok. Stopping Configure." >&4
5716 n) echo "OK, that should do.";;
5718 $rm_try gcctest gcctest.out
5720 : define a shorthand compile call
5724 case "$usedevel" in $define|true|[yY]*) if $test ! -f "${mc_file}.c"; then
5725 echo "Internal Configure script bug - compiler test file ${mc_file}.c is missing. Please report this to perlbug@perl.org" >&4;
5729 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5730 : define a shorthand compile call for compilations that should be ok.
5734 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5736 : determine filename position in cpp output
5738 echo "Computing filename position in cpp output for #include directives..." >&4
5740 amigaos) fieldn=3 ;; # Workaround for a bug in abc (pdksh).
5745 vos) testaccess=-e ;;
5748 echo '#include <stdio.h>' > foo.c
5751 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5752 $grep '^[ ]*#.*stdio\.h' | \
5753 while read cline; do
5756 while $test \$# -gt 0; do
5757 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5762 pos=\`expr \$pos + 1\`
5776 *) pos="${fieldn}th";;
5778 echo "Your cpp writes the filename in the $pos field of the line."
5780 : locate header file
5785 for usrincdir in $incpth
5787 if test -f \$usrincdir/\$wanted; then
5788 echo "\$usrincdir/\$wanted"
5792 awkprg='{ print \$$fieldn }'
5793 echo "#include <\$wanted>" > foo\$\$.c
5794 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5795 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5796 while read cline; do
5797 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5799 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5800 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5805 # status = 0: grep returned 0 lines, case statement not executed
5806 # status = 1: headerfile found
5807 # status = 2: while loop executed, no headerfile found
5811 if test \$status -eq 1; then
5818 : define an alternate in-header-list? function
5819 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5820 cont=true; xxf="echo \"<\$1> found.\" >&4";
5821 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5822 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5824 case $# in 4) instead=instead;; *) instead="at last";; esac;
5825 while $test "$cont"; do
5827 var=$2; eval "was=\$$2";
5828 if $test "$xxx" && $test -r "$xxx";
5830 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5833 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5834 set $yyy; shift; shift; yyy=$@;
5835 case $# in 0) cont="";;
5836 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5837 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5838 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5839 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5843 do set $yyy; var=$2; eval "was=\$$2";
5844 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5845 set $yyy; shift; shift; yyy=$@;
5848 : see if stdlib is available
5849 set stdlib.h i_stdlib
5852 : check for lengths of integral types
5856 echo "Checking to see how big your integers are..." >&4
5865 printf("intsize=%d;\n", (int)sizeof(int));
5866 printf("longsize=%d;\n", (int)sizeof(long));
5867 printf("shortsize=%d;\n", (int)sizeof(short));
5872 if eval $compile_ok && $run ./try > /dev/null; then
5874 echo "Your integers are $intsize bytes long."
5875 echo "Your long integers are $longsize bytes long."
5876 echo "Your short integers are $shortsize bytes long."
5880 Help! I can't compile and run the intsize test program: please enlighten me!
5881 (This is probably a misconfiguration in your system or libraries, and
5882 you really ought to fix it. Still, I'll try anyway.)
5886 rp="What is the size of an integer (in bytes)?"
5890 rp="What is the size of a long integer (in bytes)?"
5894 rp="What is the size of a short integer (in bytes)?"
5902 : check for long long
5904 echo "Checking to see if you have long long..." >&4
5905 echo 'int main() { long long x = 7; return 0; }' > try.c
5907 if eval $compile; then
5909 echo "You have long long."
5912 echo "You do not have long long."
5918 : check for length of long long
5919 case "${d_longlong}${longlongsize}" in
5922 echo "Checking to see how big your long longs are..." >&4
5923 $cat >try.c <<'EOCP'
5927 printf("%d\n", (int)sizeof(long long));
5932 if eval $compile_ok; then
5933 longlongsize=`$run ./try`
5934 echo "Your long longs are $longlongsize bytes long."
5938 echo "(I can't seem to compile the test program. Guessing...)"
5939 rp="What is the size of a long long (in bytes)?"
5943 if $test "X$longsize" = "X$longlongsize"; then
5944 echo "(That isn't any different from an ordinary long.)"
5950 : see if inttypes.h is available
5951 : we want a real compile instead of Inhdr because some systems
5952 : have an inttypes.h which includes non-existent headers
5955 #include <inttypes.h>
5957 static int32_t foo32 = 0x12345678;
5961 if eval $compile; then
5962 echo "<inttypes.h> found." >&4
5965 echo "<inttypes.h> NOT found." >&4
5974 echo "Checking to see if you have int64_t..." >&4
5976 #include <sys/types.h>
5977 #$i_inttypes I_INTTYPES
5979 #include <inttypes.h>
5981 int main() { int64_t x = 7; }
5984 if eval $compile; then
5986 echo "You have int64_t."
5989 echo "You do not have int64_t."
5995 : Check if 64bit ints have a quad type
5997 echo "Checking which 64-bit integer type we could use..." >&4
6003 val='"unsigned int"'
6008 *) case "$longsize" in
6012 val='"unsigned long"'
6017 *) case "$d_longlong:$longlongsize" in
6022 val='"unsigned long long"'
6027 *) case "$d_int64_t" in
6046 '') echo "Alas, no 64-bit integer types in sight." >&4
6049 *) echo "We could use '$quadtype' for 64-bit integers." >&4
6054 : Do we want 64bit support
6055 case "$uselonglong" in
6056 "$define"|true|[yY]*)
6059 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
6061 use64bitint="$define"
6064 case "$use64bits" in
6065 "$define"|true|[yY]*)
6068 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
6070 use64bitint="$define"
6073 case "$use64bitints" in
6074 "$define"|true|[yY]*)
6077 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
6079 use64bitint="$define"
6082 case "$use64bitsint" in
6083 "$define"|true|[yY]*)
6086 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
6088 use64bitint="$define"
6091 case "$uselonglongs" in
6092 "$define"|true|[yY]*)
6095 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
6097 use64bitint="$define"
6100 case "$use64bitsall" in
6101 "$define"|true|[yY]*)
6104 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
6106 use64bitall="$define"
6111 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
6113 case "$use64bitall" in
6114 "$define"|true|[yY]*) use64bitint="$define" ;;
6120 You have natively 64-bit long integers.
6124 *) case "$use64bitint" in
6125 "$define"|true|[yY]*) dflt='y';;
6134 Perl can be built to take advantage of 64-bit integer types
6135 on some systems. To do so, Configure can be run with -Duse64bitint.
6136 Choosing this option will most probably introduce binary incompatibilities.
6138 If this doesn't make any sense to you, just accept the default '$dflt'.
6139 (The default has been chosen based on your configuration.)
6141 rp='Try to use 64-bit integers, if available?'
6144 [yY]*) val="$define" ;;
6152 case "$use64bitall" in
6153 "$define"|true|[yY]*) dflt='y' ;;
6154 *) case "$longsize" in
6162 You may also choose to try maximal 64-bitness. It means using as much
6163 64-bitness as possible on the platform. This in turn means even more
6164 binary incompatibilities. On the other hand, your platform may not
6165 have any more 64-bitness available than what you already have chosen.
6167 If this doesn't make any sense to you, just accept the default '$dflt'.
6168 (The default has been chosen based on your configuration.)
6170 rp='Try to use maximal 64-bit support, if available?'
6173 [yY]*) val="$define" ;;
6178 case "$use64bitall" in
6180 case "$use64bitint" in
6184 Since you have chosen a maximally 64-bit build, I'm also turning on
6185 the use of 64-bit integers.
6187 use64bitint="$define" ;;
6192 : Look for a hint-file generated 'call-back-unit'. If the
6193 : user has specified that a 64-bit perl is to be built,
6194 : we may need to set or change some other defaults.
6195 if $test -f use64bitint.cbu; then
6196 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
6199 case "$use64bitint" in
6200 "$define"|true|[yY]*)
6201 : This test was common to all the OpenBSD forks, and seems harmless for
6204 echo "Checking if your C library has broken 64-bit functions..." >&4
6207 typedef $uquadtype myULL;
6214 {4294967303.15, 4294967303ULL},
6215 {4294967294.2, 4294967294ULL},
6216 {4294967295.7, 4294967295ULL},
6219 for (p = test; p->u; p++) {
6220 myULL x = (myULL)p->d;
6231 if eval $compile_ok; then
6232 libcquad=`$run ./try`
6233 echo "Your C library's 64-bit functions are $libcquad."
6235 echo "(I can't seem to compile the test program.)"
6236 echo "Assuming that your C library's 64-bit functions are ok."
6245 *** You have a C library with broken 64-bit functions.
6246 *** 64-bit support does not work reliably in this configuration.
6247 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
6248 *** Cannot continue, aborting.
6255 4) case "$archname64" in
6256 '') archname64=64int ;;
6263 : Look for a hint-file generated 'call-back-unit'. If the
6264 : user has specified that a maximally 64-bit perl is to be built,
6265 : we may need to set or change some other defaults.
6266 if $test -f use64bitall.cbu; then
6267 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
6270 case "$use64bitall" in
6271 "$define"|true|[yY]*)
6273 4) case "$archname64" in
6274 ''|64int) archname64=64all ;;
6281 case "$d_quad:$use64bitint" in
6285 *** You have chosen to use 64-bit integers,
6286 *** but none can be found.
6287 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
6288 *** Cannot continue, aborting.
6295 : Check if we are using the GNU C library
6297 echo "Checking for GNU C Library..." >&4
6299 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
6300 alone are insufficient to distinguish different versions, such as
6301 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
6302 libc version 2.1.0. A. Dougherty, June 3, 2002.
6308 # ifdef __GLIBC_MINOR__
6309 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
6310 # include <gnu/libc-version.h>
6311 printf("%s\n", gnu_get_libc_version());
6313 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
6316 printf("%d\n", __GLIBC__);
6325 if eval $compile_ok && $run ./try > glibc.ver; then
6327 gnulibc_version=`$cat glibc.ver`
6328 echo "You are using the GNU C Library version $gnulibc_version"
6332 echo "You are not using the GNU C Library"
6338 : see if nm is to be used to determine whether a symbol is defined or not
6342 case "$d_gnulibc" in
6345 echo "nm probably won't work on the GNU C Library." >&4
6351 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
6353 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
6354 echo "'nm' won't be sufficient on this system." >&4
6360 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
6361 if $test $dflt -gt 20; then
6371 true|$define) dflt=y;;
6378 I can use $nm to extract the symbols from your C libraries. This
6379 is a time consuming task which may generate huge output on the disk (up
6380 to 3 megabytes) but that should make the symbols extraction faster. The
6381 alternative is to skip the 'nm' extraction part and to compile a small
6382 test program instead to determine whether each symbol is present. If
6383 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
6384 this may be the best solution.
6386 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
6389 rp="Shall I use $nm to extract C symbols from the libraries?"
6392 [Nn]*) usenm=false;;
6401 : nm options which may be necessary
6403 '') if $test -f /mach_boot; then
6405 elif $test -d /usr/ccs/lib; then
6406 nm_opt='-p' # Solaris (and SunOS?)
6407 elif $test -f /dgux; then
6409 elif $test -f /lib64/rld; then
6410 nm_opt='-p' # 64-bit Irix
6416 : nm options which may be necessary for shared libraries but illegal
6417 : for archive libraries. Thank you, Linux.
6418 case "$nm_so_opt" in
6419 '') case "$myuname" in
6421 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
6422 nm_so_opt='--dynamic'
6429 : Figure out where the libc is located
6432 : get list of predefined functions in a handy place
6437 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
6443 *) for thislib in $libs; do
6446 : Handle C library specially below.
6449 thislib=`echo $thislib | $sed -e 's/^-l//'`
6450 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
6452 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
6454 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
6456 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
6458 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
6460 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
6462 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
6467 libnames="$libnames $try"
6469 *) libnames="$libnames $thislib" ;;
6478 for xxx in $libpth; do
6479 $test -r $1 || set $xxx/libc.$so
6480 : The messy sed command sorts on library version numbers.
6482 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
6483 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
6485 s/[0-9][0-9]*/0000&/g
6486 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
6489 $sort | $sed -e 's/^.* //'`
6492 $test -r $1 || set $sysroot/usr/ccs/lib/libc.$so
6493 $test -r $1 || set $sysroot/lib/libsys_s$_a
6499 if $test -r "$1"; then
6500 echo "Your (shared) C library seems to be in $1."
6502 elif $test -r /lib/libc && $test -r /lib/clib; then
6503 echo "Your C library seems to be in both /lib/clib and /lib/libc."
6505 libc='/lib/clib /lib/libc'
6506 if $test -r /lib/syslib; then
6507 echo "(Your math library is in /lib/syslib.)"
6508 libc="$libc /lib/syslib"
6510 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
6511 echo "Your C library seems to be in $libc, as you said before."
6512 elif $test -r $incpath/usr/lib/libc$_a; then
6513 libc=$incpath/usr/lib/libc$_a;
6514 echo "Your C library seems to be in $libc. That's fine."
6515 elif $test -r /lib/libc$_a; then
6517 echo "Your C library seems to be in $libc. You're normal."
6519 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
6521 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
6522 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
6523 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
6525 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
6527 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
6530 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
6532 if $test -r "$tans"; then
6533 echo "Your C library seems to be in $tans, of all places."
6539 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
6543 If the guess above is wrong (which it might be if you're using a strange
6544 compiler, or your machine supports multiple models), you can override it here.
6549 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
6551 I can't seem to find your C library. I've looked in the following places:
6554 $sed 's/^/ /' libpath
6557 None of these seems to contain your C library. I need to get its name...
6562 rp='Where is your C library?'
6567 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
6568 set X `cat libnames`
6571 case $# in 1) xxx=file; esac
6572 echo "Extracting names from the following $xxx for later perusal:" >&4
6574 $sed 's/^/ /' libnames >&4
6576 $echo $n "This may take a while...$c" >&4
6580 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
6581 *) $nm $nm_opt $file 2>/dev/null;;
6586 $grep fprintf libc.tmp > libc.ptf
6587 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
6588 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
6590 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
6592 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6594 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
6596 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6598 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
6600 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6602 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
6604 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6606 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
6608 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6610 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
6612 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6614 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
6615 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
6617 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6619 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
6621 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6623 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
6625 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6627 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
6629 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6631 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
6633 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6635 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
6637 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6639 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
6641 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6643 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
6645 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6648 $nm -p $* 2>/dev/null >libc.tmp
6649 $grep fprintf libc.tmp > libc.ptf
6650 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
6651 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
6657 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
6659 if $ar t $libc > libc.tmp && \
6660 $contains '^fprintf$' libc.tmp >/dev/null 2>&1
6662 for thisname in $libnames $libc; do
6663 $ar t $thisname >>libc.tmp
6665 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
6667 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
6668 for thisname in $libnames $libc; do
6669 $ar tv $thisname >>libc.tmp
6670 emximp -o tmp.imp $thisname \
6672 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
6673 < tmp.imp >>libc.tmp
6676 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
6679 echo "$ar didn't seem to work right." >&4
6680 echo "Maybe this is a Cray...trying bld instead..." >&4
6682 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list &&
6685 for thisname in $libnames; do
6687 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
6688 $ar t $thisname >>libc.tmp
6692 echo "That didn't work either. Giving up." >&4
6702 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
6703 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
6705 *) if $test -f /lib/syscalls.exp; then
6707 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
6708 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' \
6709 /lib/syscalls.exp >>libc.list
6715 $rm -f libnames libpath
6717 : Check if we are using C++
6719 echo "Checking for C++..." >&4
6720 $cat >try.c <<'EOCP'
6732 if eval $compile_ok && $run ./try; then
6734 echo "You are using a C++ compiler."
6737 echo "You are not using a C++ compiler."
6743 : is a C symbol defined?
6746 -v) tf=libc.tmp; tdc="";;
6747 -a) tf=libc.tmp; tdc="[]";;
6748 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
6750 case "$d_cplusplus" in
6751 $define) extern_C="extern \"C\"" ;;
6752 *) extern_C="extern" ;;
6755 case "$reuseval-$4" in
6757 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
6762 if $test "$runnm" = true; then
6763 if $contains $tlook $tf >/dev/null 2>&1; then
6765 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
6766 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;
6767 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
6768 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
6772 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;
6773 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
6779 $define) tval=true;;
6786 : define an is-in-libc? function
6787 inlibc='echo " "; td=$define; tu=$undef;
6788 sym=$1; var=$2; eval "was=\$$2";
6790 case "$reuseval$was" in
6800 echo "$sym() found." >&4;
6801 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
6803 echo "$sym() NOT found." >&4;
6804 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
6808 $define) echo "$sym() found." >&4;;
6809 *) echo "$sym() NOT found." >&4;;
6813 : check for length of double
6815 case "$doublesize" in
6817 echo "Checking to see how big your double precision numbers are..." >&4
6826 printf("%d\n", (int)sizeof(double));
6831 if eval $compile_ok; then
6832 doublesize=`$run ./try`
6833 echo "Your double is $doublesize bytes long."
6836 echo "(I can't seem to compile the test program. Guessing...)"
6837 rp="What is the size of a double precision number (in bytes)?"
6845 : see if this is a float.h system
6849 : check for long doubles
6851 echo "Checking to see if you have long double..." >&4
6852 echo 'int main() { long double x = 7.0; }' > try.c
6854 if eval $compile; then
6856 echo "You have long double."
6859 echo "You do not have long double."
6865 : see if ldexpl exists
6869 : check for length of long double
6870 case "${d_longdbl}${longdblsize}" in
6873 echo "Checking to see how big your long doubles are..." >&4
6874 $cat >try.c <<'EOCP'
6878 printf("%d\n", sizeof(long double));
6883 if eval $compile; then
6884 longdblsize=`$run ./try`
6885 echo "Your long doubles are $longdblsize bytes long."
6889 echo "(I can't seem to compile the test program. Guessing...)" >&4
6890 rp="What is the size of a long double (in bytes)?"
6894 if $test "X$doublesize" = "X$longdblsize"; then
6895 echo "That isn't any different from an ordinary double."
6896 echo "I'll keep your setting anyway, but you may see some"
6897 echo "harmless compilation warnings."
6903 $echo "Checking the kind of long doubles you have..." >&4
6904 case "$d_longdbl" in
6909 #define LONGDBLSIZE $longdblsize
6910 #define DOUBLESIZE $doublesize
6918 static const long double d = -0.1L;
6920 unsigned const char* b = (unsigned const char*)(&d);
6921 #if DOUBLESIZE == LONGDBLSIZE
6922 printf("0\n"); /* if it floats like double */
6925 #if (LDBL_MANT_DIG == 113 || FLT128_MANT_DIG == 113) && LONGDBLSIZE == 16
6926 if (b[0] == 0x9A && b[1] == 0x99 && b[15] == 0xBF) {
6927 /* IEEE 754 128-bit little-endian */
6931 if (b[0] == 0xBF && b[14] == 0x99 && b[15] == 0x9A) {
6932 /* IEEE 128-bit big-endian, e.g. solaris sparc */
6937 /* For alignment 32-bit platforms have the 80 bits in 12 bytes,
6938 * while 64-bits platforms have it in 16 bytes. */
6939 #if LDBL_MANT_DIG == 64 && (LONGDBLSIZE == 16 || LONGDBLSIZE == 12)
6940 if (b[0] == 0xCD && b[9] == 0xBF && b[10] == 0x00) {
6941 /* x86 80-bit little-endian, sizeof 12 (ILP32, Solaris x86)
6942 * or 16 (LP64, Linux and OS X), 4 or 6 bytes of padding.
6943 * Also known as "extended precision". */
6947 if (b[0] == 0xBF && b[9] == 0xCD && b[10] == 0x00) {
6948 /* is there ever big-endian 80-bit, really? */
6953 #if (LDBL_MANT_DIG == 106 || LDBL_MANT_DIG == 107) && LONGDBLSIZE == 16
6954 /* software "double double", the 106 is 53+53.
6955 * but irix thinks it is 107. */
6956 if (b[0] == 0x9A && b[7] == 0x3C && b[8] == 0x9A && b[15] == 0xBF) {
6957 /* double double 128-bit little-endian,
6958 * 9a 99 99 99 99 99 59 3c 9a 99 99 99 99 99 b9 bf */
6962 if (b[0] == 0xBF && b[7] == 0x9A && b[8] == 0x3C && b[15] == 0x9A) {
6963 /* double double 128-bit big-endian, e.g. PPC/Power and MIPS:
6964 * bf b9 99 99 99 99 99 9a 3c 59 99 99 99 99 99 9a */
6969 printf("-1\n"); /* unknown */
6974 if eval $compile; then
6975 longdblkind=`$run ./try`
6982 case "$longdblkind" in
6983 0) echo "Your long doubles are doubles." >&4 ;;
6984 1) echo "You have IEEE 754 128-bit little endian long doubles." >&4 ;;
6985 2) echo "You have IEEE 754 128-bit big endian long doubles." >&4 ;;
6986 3) echo "You have x86 80-bit little endian long doubles." >& 4 ;;
6987 4) echo "You have x86 80-bit big endian long doubles." >& 4 ;;
6988 5) echo "You have 128-bit little-endian double-double long doubles." >& 4 ;;
6989 6) echo "You have 128-bit big-endian double-double long doubles." >& 4 ;;
6990 *) echo "Cannot figure out your long double." >&4 ;;
6994 : determine the architecture name
6996 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
6997 tarch=`arch`"-$osname"
6998 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
6999 if uname -m > tmparch 2>&1 ; then
7000 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
7001 -e 's/$/'"-$osname/" tmparch`
7009 case "$myarchname" in
7012 echo "(Your architecture name used to be $myarchname.)"
7016 case "$targetarch" in
7018 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
7023 *) dflt="$archname";;
7025 rp='What is your architecture name'
7029 : optionally add API version to the architecture for versioned archlibs
7030 case "$useversionedarchname" in
7031 $define|true|[yY]*) dflt='y';;
7034 rp='Add the Perl API version to your archname?'
7037 y|Y) useversionedarchname="$define" ;;
7038 *) useversionedarchname="$undef" ;;
7040 case "$useversionedarchname" in
7043 *-$api_versionstring)
7044 echo "...and architecture name already has -$api_versionstring" >&4
7047 archname="$archname-$api_versionstring"
7048 echo "...setting architecture name to $archname." >&4
7054 case "$usethreads" in
7056 echo "Threads selected." >&4
7058 *-thread*) echo "...and architecture name already has -thread." >&4
7060 *) archname="$archname-thread"
7061 echo "...setting architecture name to $archname." >&4
7066 case "$usemultiplicity" in
7068 echo "Multiplicity selected." >&4
7070 *-multi*) echo "...and architecture name already has -multi." >&4
7072 *) archname="$archname-multi"
7073 echo "...setting architecture name to $archname." >&4
7078 case "$use64bitint$use64bitall" in
7080 case "$archname64" in
7082 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
7085 case "$use64bitint" in
7086 "$define") echo "64 bit integers selected." >&4 ;;
7088 case "$use64bitall" in
7089 "$define") echo "Maximal 64 bitness selected." >&4 ;;
7092 *-$archname64*) echo "...and architecture name already has $archname64." >&4
7094 *) archname="$archname-$archname64"
7095 echo "...setting architecture name to $archname." >&4
7101 case "$uselongdouble" in
7103 echo "Long doubles selected." >&4
7104 case "$longdblsize" in
7106 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
7110 *-ld*) echo "...and architecture name already has -ld." >&4
7112 *) archname="$archname-ld"
7113 echo "...setting architecture name to $archname." >&4
7120 case "$usequadmath" in
7122 echo "quadmath selected." >&4
7124 *-ld*) echo "...and architecture name already has -quadmath." >&4
7126 *) archname="$archname-quadmath"
7127 echo "...setting architecture name to $archname." >&4
7132 if $test -f archname.cbu; then
7133 echo "Your platform has some specific hints for architecture name, using them..."
7137 : set the prefixit variable, to compute a suitable default value
7138 prefixit='case "$3" in
7140 case "$oldprefix" in
7141 "") eval "$1=\"\$$2\"";;
7148 ""|" ") eval "$1=\"\$$2\"";;
7154 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
7156 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
7157 /*-$oldprefix/*|\~*-$oldprefix/*)
7158 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
7159 *) eval "$1=\"\$$2\"";;
7163 : determine installation style
7164 : For now, try to deduce it from prefix unless it is already set.
7165 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
7166 case "$installstyle" in
7167 '') case "$prefix" in
7168 *perl*) dflt='lib';;
7169 *) dflt='lib/perl5' ;;
7172 *) dflt="$installstyle" ;;
7174 : Probably not worth prompting for this since we prompt for all
7175 : the directories individually, and the prompt would be too long and
7179 : determine where public executables go
7184 rp='Pathname where the public executables will reside?'
7186 if $test "X$ansexp" != "X$binexp"; then
7190 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
7191 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
7192 : this via initialinstalllocation
7195 case "$userelocatableinc" in
7196 $define|true|[yY]*) dflt='y' ;;
7201 Would you like to build Perl so that the installation is relocatable, so that
7202 library paths in @INC are determined relative to the path of the perl binary?
7203 This is not advised for system Perl installs, or if you need to run setid
7204 scripts or scripts under taint mode.
7206 If this doesn't make any sense to you, just accept the default '$dflt'.
7208 rp='Use relocatable @INC?'
7211 y|Y) val="$define" ;;
7214 set userelocatableinc
7217 initialinstalllocation="$binexp"
7218 : Default prefix is now "up one level from where the binaries are"
7219 case "$userelocatableinc" in
7225 installprefixexp=".../.."
7229 : determine where private library files go
7230 : Usual default is /usr/local/lib/perl5/$version.
7231 : Also allow things like /opt/perl/lib/$version, since
7232 : /opt/perl/lib/perl5... would be redundant.
7233 : The default "style" setting is made in installstyle.U
7234 case "$installstyle" in
7235 *lib/perl5*) set dflt privlib lib/$package/$version ;;
7236 *) set dflt privlib lib/$version ;;
7241 There are some auxiliary files for $package that need to be put into a
7242 private library directory that is accessible by everyone.
7247 rp='Pathname where the private library files will reside?'
7252 : set the prefixup variable, to restore leading tilda escape
7253 prefixup='case "$prefixexp" in
7255 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
7258 : determine where public architecture dependent libraries go
7261 : privlib default is /usr/local/lib/$package/$version
7262 : archlib default is /usr/local/lib/$package/$version/$archname
7263 : privlib may have an optional trailing /share.
7264 tdflt=`echo $privlib | $sed 's,/share$,,'`
7265 tdflt=$tdflt/$archname
7274 $spackage contains architecture-dependent library files. If you are
7275 sharing libraries in a heterogeneous environment, you might store
7276 these files in a separate location. Otherwise, you can just include
7277 them with the rest of the public library files.
7282 rp='Where do you want to put the public architecture-dependent libraries?'
7286 if $test X"$archlib" = X"$privlib"; then
7292 : see if setuid scripts can be secure
7295 Some kernels have a bug that prevents setuid #! scripts from being
7296 secure. Some sites have disabled setuid #! scripts because of this.
7298 First let's decide if your kernel supports secure setuid #! scripts.
7299 (If setuid #! scripts would be secure but have been disabled anyway,
7300 don't say that they are secure if asked.)
7305 if $test -d /dev/fd; then
7306 echo "#!$ls" >reflect
7307 chmod +x,u+s reflect
7308 ./reflect >flect 2>&1
7309 if $contains "/dev/fd" flect >/dev/null; then
7310 echo "Congratulations, your kernel has secure setuid scripts!" >&4
7314 If you are not sure if they are secure, I can check but I'll need a
7315 username and password different from the one you are using right now.
7316 If you don't have such a username or don't want me to test, simply
7320 rp='Other username to test security of setuid scripts with?'
7325 case "$d_suidsafe" in
7326 '') echo "I'll assume setuid scripts are *not* secure." >&4
7329 echo "Well, the $hint value is *not* secure." >&4
7331 *) echo "Well, the $hint value *is* secure." >&4
7336 $rm -f reflect flect
7337 echo "#!$ls" >reflect
7338 chmod +x,u+s reflect
7341 echo '"su" will (probably) prompt you for '"$ans's password."
7342 su $ans -c './reflect >flect'
7343 if $contains "/dev/fd" flect >/dev/null; then
7344 echo "Okay, it looks like setuid scripts are secure." >&4
7347 echo "I don't think setuid scripts are secure." >&4
7352 rp='Does your kernel have *secure* setuid scripts?'
7355 [yY]*) val="$define";;
7360 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
7361 echo "(That's for file descriptors, not floppy disks.)"
7367 $rm -f reflect flect
7369 : now see if they want to do setuid emulation
7370 if $test $patchlevel -lt 11; then
7373 case "$d_suidsafe" in
7376 echo "No need to emulate SUID scripts since they are secure here." >&4
7380 Some systems have disabled setuid scripts, especially systems where
7381 setuid scripts cannot be secure. On systems where setuid scripts have
7382 been disabled, the setuid/setgid bits on scripts are currently
7383 useless. It is possible for $package to detect those bits and emulate
7384 setuid/setgid in a secure fashion. This emulation will only work if
7385 setuid scripts have been disabled in your kernel.
7389 "$define") dflt=y ;;
7392 rp="Do you want to do setuid/setgid emulation?"
7395 [yY]*) val="$define";;
7407 SUID emulation has been removed for 5.12
7408 Please re-run Configure without -Dd_dosuid
7417 : Find perl5.005 or later.
7418 echo "Looking for a previously installed perl5.005 or later... "
7420 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
7421 : Check if this perl is recent and can load a simple module
7422 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
7425 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
7435 '') echo "None found. That's ok.";;
7436 *) echo "Using $perl5." ;;
7439 : Set the siteprefix variables
7442 After $package is installed, you may wish to install various
7443 add-on modules and utilities. Typically, these add-ons will
7444 be installed under $prefix with the rest
7445 of this package. However, you may wish to install such add-ons
7446 elsewhere under a different prefix.
7448 If you do not wish to put everything under a single prefix, that's
7449 ok. You will be prompted for the individual locations; this siteprefix
7450 is only used to suggest the defaults.
7452 The default should be fine for most people.
7456 rp='Installation prefix to use for add-on modules and utilities?'
7457 : XXX Here might be another good place for an installstyle setting.
7458 case "$siteprefix" in
7460 *) dflt=$siteprefix ;;
7463 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
7465 case "$siteprefix" in
7469 *) oldsiteprefix="$prefix";;
7474 siteprefixexp="$ansexp"
7476 : determine where site specific libraries go.
7477 : Usual default is /usr/local/lib/perl5/site_perl/$version
7478 : The default "style" setting is made in installstyle.U
7479 : XXX No longer works with Prefixit stuff.
7480 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7482 '') case "$installstyle" in
7483 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
7484 *) dflt=$siteprefix/lib/site_$prog/$version ;;
7492 The installation process will create a directory for
7493 site-specific extensions and modules. Most users find it convenient
7494 to place all site-specific files in this directory rather than in the
7495 main distribution directory.
7499 rp='Pathname for the site-specific library files?'
7503 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
7505 : Determine list of previous versions to include in @INC
7506 $cat > getverlist <<EOPL
7509 \$api_versionstring = "$api_versionstring";
7510 \$version = "$version";
7511 \$stem = "$sitelib_stem";
7512 \$archname = "$archname";
7514 $cat >> getverlist <<'EOPL'
7515 # The list found is store twice for each entry: the original name, and
7516 # the binary broken down version as pack "sss", so sorting is easy and
7517 # unambiguous. This will work for all versions that have a maximum of
7518 # three digit groups, separate by '.'s or '_'s. Names are extended with
7519 # ".0.0" to ensure at least three elements for the pack.
7520 # -- H.Merijn Brand (m)'06 23-10-2006
7522 # Can't have leading @ because metaconfig interprets it as a command!
7523 ;@inc_version_list=();
7524 # XXX Redo to do opendir/readdir?
7527 ;@candidates = map {
7528 [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
7529 ;@candidates = sort { $a->[1] cmp $b->[1]} @candidates;
7535 ($pversion, $aversion, $vsn5005) = map {
7536 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
7537 foreach $d (@candidates) {
7538 if ($d->[1] lt $pversion) {
7539 if ($d->[1] ge $aversion) {
7540 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
7542 elsif ($d->[1] ge $vsn5005) {
7543 unshift(@inc_version_list, grep { -d } $d->[0]);
7547 # Skip newer version. I.e. don't look in
7548 # 5.7.0 if we're installing 5.6.1.
7552 if (@inc_version_list) {
7553 print join(' ', @inc_version_list);
7556 # Blank space to preserve value for next Configure run.
7561 case "$inc_version_list" in
7562 '') if test -x "$perl5$exe_ext"; then
7563 dflt=`$perl5 getverlist`
7568 $undef) dflt='none' ;;
7569 *) eval dflt=\"$inc_version_list\" ;;
7572 ''|' ') dflt=none ;;
7579 In order to ease the process of upgrading, this version of perl
7580 can be configured to use modules built and installed with earlier
7581 versions of perl that were installed under $prefix. Specify here
7582 the list of earlier versions that this version of perl should check.
7583 If Configure detected no earlier versions of perl installed under
7584 $prefix, then the list will be empty. Answer 'none' to tell perl
7585 to not search earlier versions.
7587 The default should almost always be sensible, so if you're not sure,
7588 just accept the default.
7591 rp='List of earlier versions to include in @INC?'
7594 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
7595 *) inc_version_list="$ans" ;;
7597 case "$inc_version_list" in
7599 inc_version_list_init='0'
7600 d_inc_version_list="$undef"
7602 *) inc_version_list_init=`echo $inc_version_list |
7603 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
7604 d_inc_version_list="$define"
7609 : see if malloc/malloc.h has to be included
7610 set malloc/malloc.h i_mallocmalloc
7613 : see if this is a malloc.h system
7614 : we want a real compile instead of Inhdr because some systems have a
7615 : malloc.h that just gives a compile error saying to use stdlib.h instead
7620 #$i_mallocmalloc I_MALLOCMALLOC
7621 #ifdef I_MALLOCMALLOC
7622 # include <malloc/malloc.h>
7625 int main () { return 0; }
7628 if eval $compile; then
7629 echo "<malloc.h> found." >&4
7632 echo "<malloc.h> NOT found." >&4
7639 : check for length of pointer
7643 echo "Checking to see how big your pointers are..." >&4
7652 printf("%d\n", (int)sizeof(void *));
7657 if eval $compile_ok; then
7658 ptrsize=`$run ./try`
7659 echo "Your pointers are $ptrsize bytes long."
7662 echo "(I can't seem to compile the test program. Guessing...)" >&4
7663 rp="What is the size of a pointer (in bytes)?"
7670 case "$use64bitall" in
7671 "$define"|true|[yY]*)
7675 *** You have chosen a maximally 64-bit build,
7676 *** but your pointers are only 4 bytes wide.
7677 *** Please rerun Configure without -Duse64bitall.
7682 *** Since you have quads, you could possibly try with -Duse64bitint.
7687 *** Cannot continue, aborting.
7698 : determine whether to use malloc wrapping
7700 case "$usemallocwrap" in
7701 [yY]*|true|$define) dflt='y' ;;
7702 [nN]*|false|$undef) dflt='n' ;;
7703 *) case "$usedevel" in
7704 [yY]*|true|$define) dflt='y' ;;
7709 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
7711 usemallocwrap="$ans"
7714 usemallocwrap="$define" ;;
7716 usemallocwrap="$undef" ;;
7719 : determine which malloc to compile in
7721 case "$usemymalloc" in
7722 [yY]*|true|$define) dflt='y' ;;
7723 [nN]*|false|$undef) dflt='n' ;;
7724 *) case "$ptrsize" in
7728 if test "$useithreads" = "$define"; then dflt='n'; fi
7731 rp="Do you wish to attempt to use the malloc that comes with $package?"
7737 mallocsrc='malloc.c'
7738 mallocobj="malloc$_o"
7739 d_mymalloc="$define"
7742 : Remove malloc from list of libraries to use
7743 echo "Removing unneeded -lmalloc from library list" >&4
7744 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
7747 echo "libs = $libs" >&4
7759 : compute the return types of malloc and free
7761 $cat >malloc.c <<END
7765 #include <sys/types.h>
7779 case "$malloctype" in
7781 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
7788 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
7792 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
7799 echo "Your system uses $freetype free(), it would seem." >&4
7801 : determine where site specific architecture-dependent libraries go.
7802 : sitelib default is /usr/local/lib/perl5/site_perl/$version
7803 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
7804 : sitelib may have an optional trailing /share.
7806 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
7807 dflt="$dflt/$archname"
7812 set sitearch sitearch none
7816 The installation process will also create a directory for
7817 architecture-dependent site-specific extensions and modules.
7821 rp='Pathname for the site-specific architecture-dependent library files?'
7825 if $test X"$sitearch" = X"$sitelib"; then
7828 d_sitearch="$define"
7831 : Set the vendorprefix variables
7834 The installation process will also create a directory for
7835 vendor-supplied add-ons. Vendors who supply perl with their system
7836 may find it convenient to place all vendor-supplied files in this
7837 directory rather than in the main distribution directory. This will
7838 ease upgrades between binary-compatible maintenance versions of perl.
7840 Of course you may also use these directories in whatever way you see
7841 fit. For example, you might use them to access modules shared over a
7842 company-wide network.
7844 The default answer should be fine for most people.
7845 This causes further questions about vendor add-ons to be skipped
7846 and no vendor-specific directories will be configured for perl.
7849 rp='Do you want to configure vendor-specific add-on directories?'
7850 case "$usevendorprefix" in
7851 define|true|[yY]*) dflt=y ;;
7852 *) : User may have set vendorprefix directly on Configure command line.
7853 case "$vendorprefix" in
7862 rp='Installation prefix to use for vendor-supplied add-ons?'
7863 case "$vendorprefix" in
7864 '') dflt="$prefix" ;;
7865 *) dflt=$vendorprefix ;;
7868 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
7870 case "$vendorprefix" in
7874 *) oldvendorprefix="$prefix";;
7878 usevendorprefix="$define"
7880 vendorprefixexp="$ansexp"
7882 *) usevendorprefix="$undef"
7888 : Set the vendorlib variables
7889 case "$vendorprefix" in
7890 '') d_vendorlib="$undef"
7894 *) d_vendorlib="$define"
7895 : determine where vendor-supplied modules go.
7896 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
7897 case "$vendorlib" in
7899 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7900 case "$installstyle" in
7901 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
7902 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
7905 *) dflt="$vendorlib"
7909 rp='Pathname for the vendor-supplied library files?'
7912 vendorlibexp="$ansexp"
7915 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
7919 : Set the vendorarch variables
7920 case "$vendorprefix" in
7921 '') d_vendorarch="$undef"
7925 *) d_vendorarch="$define"
7926 : determine where vendor-supplied architecture-dependent libraries go.
7927 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
7928 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
7929 : vendorlib may have an optional trailing /share.
7930 case "$vendorarch" in
7931 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
7932 dflt="$dflt/$archname"
7934 *) dflt="$vendorarch" ;;
7937 rp='Pathname for vendor-supplied architecture-dependent files?'
7940 vendorarchexp="$ansexp"
7943 prefixvar=vendorarch
7945 if $test X"$vendorarch" = X"$vendorlib"; then
7946 d_vendorarch="$undef"
7948 d_vendorarch="$define"
7951 : Final catch-all directories to search
7954 Lastly, you can have perl look in other directories for extensions and
7955 modules in addition to those already specified.
7956 These directories will be searched after
7960 test X"$vendorlib" != "X" && echo ' ' $vendorlib
7961 test X"$vendorarch" != "X" && echo ' ' $vendorarch
7963 case "$otherlibdirs" in
7964 ''|' ') dflt='none' ;;
7965 *) dflt="$otherlibdirs" ;;
7968 Enter a colon-separated set of extra paths to include in perl's @INC
7969 search path, or enter 'none' for no extra paths.
7973 rp='Colon-separated list of additional directories for perl to search?'
7976 ' '|''|none) otherlibdirs=' ' ;;
7977 *) otherlibdirs="$ans" ;;
7979 case "$otherlibdirs" in
7983 set d_perl_otherlibdirs
7986 : Cruising for prototypes
7988 echo "Checking out function prototypes..." >&4
7989 $cat >prototype.c <<EOCP
7994 int main(int argc, char *argv[]) {
7997 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
7998 echo "Your C compiler appears to support function prototypes."
8001 echo "Your C compiler doesn't seem to understand function prototypes."
8008 : Check if ansi2knr is required
8009 case "$prototype" in
8011 *) ansi2knr='ansi2knr'
8016 This version of $package can only be compiled by a compiler that
8017 understands function prototypes. Unfortunately, your C compiler
8019 doesn't seem to understand them. Sorry about that.
8021 If GNU cc is available for your system, perhaps you could try that instead.
8023 Eventually, we hope to support building Perl with pre-ANSI compilers.
8024 If you would like to help in that effort, please contact <perlbug@perl.org>.
8026 Aborting Configure now.
8033 dflt_dtrace='/usr/sbin/dtrace'
8034 $test -x /usr/bin/dtrace && dflt_dtrace='/usr/bin/dtrace'
8038 Perl can be built to support DTrace on platforms that support it.
8039 DTrace is a diagnosis and performance analysis tool from Sun.
8041 If this doesn't make any sense to you, just accept the default.
8045 case "$usedtrace" in
8051 dflt_dtrace=$usedtrace
8058 rp='Support DTrace if available?'
8061 y|Y) val="$define" ;;
8067 test "X$usedtrace" != "X$define" && break
8070 rp='Where is the dtrace executable?'
8079 if $dtrace -h -s ../perldtrace.d \
8080 -o perldtrace.tmp >/dev/null 2>&1 \
8081 && rm -f perldtrace.tmp
8084 echo "Good: your $dtrace knows about the -h flag."
8088 *** $me: Fatal Error: $dtrace doesn't support -h flag
8090 *** Your installed dtrace doesn't support the -h switch to compile a D
8091 *** program into a C header. Can't continue.
8103 *** $me: Fatal Error: $dtrace not found.
8110 echo "*** $dtrace was not found."
8116 : See if we want extra modules installed
8123 Perl can be built with extra modules or bundles of modules which
8124 will be fetched from the CPAN and installed alongside Perl.
8126 Notice that you will need access to the CPAN; either via the Internet,
8127 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
8128 be asked later to configure the CPAN.pm module which will in turn do
8129 the installation of the rest of the extra modules or bundles.)
8131 Notice also that if the modules require any external software such as
8132 libraries and headers (the libz library and the zlib.h header for the
8133 Compress::Zlib module, for example) you MUST have any such software
8134 already installed, this configuration process will NOT install such
8137 If this doesn't make any sense to you, just accept the default '$dflt'.
8139 rp='Install any extra modules (y or n)?'
8145 Please list any extra modules or bundles to be installed from CPAN,
8146 with spaces between the names. The names can be in any format the
8147 'install' command of CPAN.pm will understand. (Answer 'none',
8148 without the quotes, to install no extra modules or bundles.)
8158 $rm -f ../extras.lst
8160 *) echo "(Saving the list of extras for later...)"
8161 echo "$extras" > ../extras.lst
8169 : determine where html pages for programs go
8170 set html1dir html1dir none
8174 If you wish to install html files for programs in $spackage, indicate
8175 the appropriate directory here. To skip installing html files,
8179 ''|none|$undef|' ') dflt=none ;;
8180 *) dflt=$html1dir ;;
8183 rp="Directory for the main $spackage html pages?"
8187 : Use ' ' for none so value is preserved next time through Configure
8188 $test X"$html1dir" = "X" && html1dir=' '
8190 : determine where html pages for libraries and modules go
8191 set html3dir html3dir none
8195 If you wish to install html files for modules associated with $spackage,
8196 indicate the appropriate directory here. To skip installing html files,
8199 : There is no obvious default. If they have specified html1dir, then
8200 : try to key off that, possibly changing .../html1 into .../html3.
8202 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
8203 *) dflt=$html3dir ;;
8206 rp="Directory for the $spackage module html pages?"
8210 : Use ' ' for none so value is preserved next time through Configure
8211 $test X"$html3dir" = "X" && html3dir=' '
8213 : determine whether to install perl also as /usr/bin/perl
8216 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
8218 Many scripts expect perl to be installed as /usr/bin/perl.
8220 If you want to, I can install the perl you are about to compile
8221 as /usr/bin/perl (in addition to $bin/perl).
8223 if test -f /usr/bin/perl; then
8226 However, please note that because you already have a /usr/bin/perl,
8227 overwriting that with a new Perl would very probably cause problems.
8228 Therefore I'm assuming you don't want to do that (unless you insist).
8231 case "$installusrbinperl" in
8232 "$define"|[yY]*) dflt='y';;
8238 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
8241 case "$installusrbinperl" in
8242 "$undef"|[nN]*) dflt='n';;
8246 rp="Do you want to install perl as /usr/bin/perl?"
8249 [yY]*) val="$define";;
8255 set installusrbinperl
8258 : see if dlopen exists
8260 xxx_ccflags="$ccflags"
8262 : with g++ one needs -shared to get is-in-libc to work for dlopen
8263 case "$gccversion" in
8266 *) case "$d_cplusplus" in
8267 "$define") ccflags="$ccflags -shared" ;;
8274 ccflags="$xxx_ccflags"
8276 : see if this is a unistd.h system
8277 set unistd.h i_unistd
8280 : determine which dynamic loading, if any, to compile in
8282 dldir="ext/DynaLoader"
8295 $define) dflt='y' ;;
8297 : Does a dl_xxx.xs file exist for this operating system
8298 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
8301 rp="Do you wish to use dynamic loading?"
8308 '') if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
8309 dflt="$dldir/dl_${osname}.xs"
8310 elif $test "$d_dlopen" = "$define" ; then
8311 dflt="$dldir/dl_dlopen.xs"
8316 *) dflt="$dldir/$dlsrc"
8319 echo "The following dynamic loading files are available:"
8320 : Can not go over to $dldir because getfile has path hard-coded in.
8321 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
8322 rp="Source file to use for dynamic loading"
8328 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
8332 Some systems may require passing special flags to $cc -c to
8333 compile modules that will be used to create a shared library.
8334 To use no flags, say "none".
8337 case "$cccdlflags" in
8338 '') case "$gccversion" in
8339 '') case "$osname" in
8341 irix*) dflt='-KPIC' ;;
8342 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
8343 sunos) dflt='-pic' ;;
8347 *) case "$osname" in
8348 darwin) dflt='none' ;;
8349 *linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
8354 *) dflt="$cccdlflags" ;;
8361 # If -Dsysroot was specified, now's the time to add it
8363 if test "X$sysroot" != X; then
8364 case "$gccversion" in
8369 dflt="$dflt --sysroot=$sysroot" ;;
8379 rp="Any special flags to pass to $cc -c to compile shared library modules?"
8382 none) cccdlflags=' ' ;;
8383 *) cccdlflags="$ans" ;;
8388 Some systems use ld to create libraries that can be dynamically loaded,
8389 while other systems (such as those using ELF) use $cc.
8393 : Determine if this is ELF
8395 /* Test for whether ELF binaries are produced */
8407 int i = open("a.out",O_RDONLY);
8410 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
8411 exit(0); /* succeed (yes, it is ELF) */
8415 if $cc $ccflags $ldflags -o a.out try.c >/dev/null 2>&1 && $run ./a.out; then
8421 '') if $test $bin_ELF = "$define"; then
8423 You appear to have ELF support. I'll use $cc to build dynamic libraries.
8427 echo "I'll use ld to build dynamic libraries."
8435 rp="What command should be used to create dynamic libraries?"
8441 Some systems may require passing special flags to $ld to create a
8442 library that can be dynamically loaded. If your ld flags include
8443 -L/other/path options to locate libraries outside your loader's normal
8444 search path, you may need to specify those -L options here as well. To
8445 use no flags, say "none".
8448 case "$lddlflags" in
8449 '') case "$osname" in
8450 haiku) dflt='-shared' ;;
8452 case "$gccversion" in
8453 '') dflt="$dflt +vnocompatwarnings" ;;
8456 *linux*|irix*|gnu*) dflt="-shared $optimize" ;;
8457 solaris) # See [perl #66604].
8458 # On Solaris 11, gcc -m64 on amd64
8459 # appears not to understand -G. gcc versions at
8460 # least as old as 3.4.3 support -shared, so just
8461 # use that with Solaris 11 and later, but keep
8462 # the old behavior for older Solaris versions.
8463 case "$gccversion" in
8465 *) case "$osvers" in
8466 2.?|2.10) dflt='-G' ;;
8467 *) dflt='-shared' ;;
8472 sunos) dflt='-assert nodefinitions' ;;
8473 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
8477 *) dflt="$lddlflags" ;;
8480 : Only do this for gcc, since, for example, qcc has no concept
8482 if $test "X$sysroot" != X; then
8483 case "$gccversion" in
8485 *) dflt="$dflt --sysroot $sysroot" ;;
8489 : Try to guess additional flags to pick up local libraries.
8490 : Be careful not to append to a plain 'none'
8494 for thisflag in $ldflags; do
8499 *) dflt="$dflt $thisflag" ;;
8506 ''|' ') dflt='none' ;;
8510 *-fstack-protector-strong*)
8512 *-fstack-protector-strong*) ;; # Don't add it again
8513 *) dflt="$dflt -fstack-protector-strong" ;;
8516 *-fstack-protector*)
8518 *-fstack-protector*) ;; # Don't add it again
8519 *) dflt="$dflt -fstack-protector" ;;
8524 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
8527 none) lddlflags=' ' ;;
8528 *) lddlflags="$ans" ;;
8533 Some systems may require passing special flags to $cc to indicate that
8534 the resulting executable will use dynamic linking. To use no flags,
8538 case "$ccdlflags" in
8539 '') case "$osname" in
8540 *linux*|hpux|gnu*) dflt='-Wl,-E' ;;
8541 sunos) dflt='none' ;;
8545 *) dflt="$ccdlflags" ;;
8547 rp="Any special flags to pass to $cc to use dynamic linking?"
8550 none) ccdlflags=' ' ;;
8551 *) ccdlflags="$ans" ;;
8563 ld_can_script="$undef"
8564 case "$bin_ELF$usedl" in
8566 # Abuse try.h and a.out names for neat cleanup
8578 if $cc $cccdlflags $ccdlflags $ccflags \
8579 $ldflags $lddlflags -o a.out try.c \
8580 -Wl,--version-script=try.h >/dev/null 2>&1 \
8581 && $test -s a.out ; then
8582 echo "ld supports scripting" >&4
8583 ld_can_script="$define"
8585 echo "ld does not support scripting" >&4
8591 : Do we want a shared libperl?
8595 # No dynamic loading being used, so don't bother even to prompt.
8598 *) case "$useshrplib" in
8599 '') case "$osname" in
8600 svr4*|nonstopux|dgux|dynixptx|esix|powerux|haiku|cygwin*)
8602 also='Building a shared libperl is required for dynamic loading to work on your system.'
8616 The perl executable is normally obtained by linking perlmain.c with
8617 libperl${_a}, any static extensions (usually just DynaLoader), and
8618 any other libraries needed on this system (such as -lm, etc.). Since
8619 your system supports dynamic loading, it is probably possible to build
8620 a shared libperl.$so. If you will have more than one executable linked
8621 to libperl.$so, this will significantly reduce the size of each
8622 executable, but it may have a noticeable effect on performance. The
8623 default is probably sensible for your system.
8627 rp="Build a shared libperl.$so (y/n)"
8631 useshrplib='true' ;;
8632 *) useshrplib='false' ;;
8637 case "$useshrplib" in
8639 case "$userelocatableinc" in
8641 echo "Cannot build with both -Duserelocatableinc and -Duseshrplib" >&4
8642 echo "See INSTALL for an explanation why that won't work." >&4
8648 # Figure out a good name for libperl.so. Since it gets stored in
8649 # a version-specific architecture-dependent library, the version
8650 # number isn't really that important, except for making cc/ld happy.
8652 # A name such as libperl.so.10.1
8653 majmin="libperl.$so.$patchlevel.$subversion"
8654 # A name such as libperl.so.100
8655 majonly=`echo $patchlevel $subversion |
8656 $awk '{printf "%d%02d", $1, $2}'`
8657 majonly=libperl.$so.$majonly
8658 # I'd prefer to keep the os-specific stuff here to a minimum, and
8659 # rely on figuring it out from the naming of libc.
8660 case "${osname}${osvers}" in
8661 *linux*|gnu*) # ld won't link with a bare -lperl otherwise.
8664 cygwin*) # ld links now against the dll directly
8665 majmin="cygperl5_${patchlevel}_${subversion}.${so}"
8666 majonly=`echo $patchlevel $subversion |
8667 $awk '{printf "%03d%03d", $1, $2}'`
8668 majonly=cygperl5.$majonly.$so
8671 *) # Try to guess based on whether libc has major.minor.
8673 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8674 *libc.$so.[0-9]*) dflt=$majonly ;;
8675 *) dflt=libperl.$so ;;
8685 I need to select a good name for the shared libperl. If your system uses
8686 library names with major and minor numbers, then you might want something
8687 like $majmin. Alternatively, if your system uses a single version
8688 number for shared libraries, then you might want to use $majonly.
8689 Or, your system might be quite happy with a simple libperl.$so.
8691 Since the shared libperl will get installed into a version-specific
8692 architecture-dependent directory, the version number of the shared perl
8693 library probably isn't important, so the default should be o.k.
8696 rp='What name do you want to give to the shared libperl?'
8699 echo "Ok, I'll use $libperl"
8702 libperl="libperl${_a}"
8706 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8710 WARNING: Use of the shrpdir variable for the installation location of
8711 the shared $libperl is not supported. It was never documented and
8712 will not work in this version. Let me (perlbug@perl.org)
8713 know of any problems this may cause.
8719 But your current setting of $shrpdir is
8720 the default anyway, so it's harmless.
8725 Further, your current attempted setting of $shrpdir
8726 conflicts with the value of $archlibexp/CORE
8727 that installperl will use.
8734 # How will the perl executable find the installed shared $libperl?
8735 # Add $xxx to ccdlflags.
8736 # If we can't figure out a command-line option, use $shrpenv to
8737 # set env LD_RUN_PATH. The main perl makefile uses this.
8738 shrpdir=$archlibexp/CORE
8741 if "$useshrplib"; then
8744 # We'll set it in Makefile.SH...
8749 freebsd|mirbsd|netbsd|openbsd|interix|dragonfly|bitrig)
8750 xxx="-Wl,-R$shrpdir"
8752 bsdos|linux|irix*|dec_osf|gnu*|haiku)
8753 xxx="-Wl,-rpath,$shrpdir"
8756 # hpux doesn't like the default, either.
8757 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8760 # cygwin needs only ldlibpth
8763 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8769 # Only add $xxx if it isn't already in ccdlflags.
8770 case " $ccdlflags " in
8772 *) ccdlflags="$ccdlflags $xxx"
8775 Adding $xxx to the flags
8776 passed to $ld so that the perl executable will find the
8777 installed shared $libperl.
8785 # Fix ccdlflags in AIX for building external extensions.
8786 # (For building Perl itself bare -bE:perl.exp is needed,
8787 # Makefile.SH takes care of this.)
8789 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8791 # Respect a hint or command-line value.
8793 '') shrpenv="$tmp_shrpenv" ;;
8795 case "$ldlibpthname" in
8796 '') ldlibpthname=LD_LIBRARY_PATH ;;
8797 none) ldlibpthname='' ;;
8800 : determine where manual pages are on this system
8804 syspath='/usr/share/man/man1 /usr/man/man1'
8805 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8806 syspath="$syspath /usr/man/u_man/man1"
8807 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8808 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8809 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8810 sysman=`./loc . /usr/man/man1 $syspath`
8813 if $test -d "$sysman"; then
8814 echo "System manual is in $sysman." >&4
8816 echo "Could not find manual pages in source form." >&4
8819 : determine where manual pages go
8820 set man1dir man1dir none
8824 $spackage has manual pages available in source form.
8828 echo "However, you don't have nroff, so they're probably useless to you."
8830 '') man1dir="none";;
8833 echo "If you don't want the manual sources installed, answer 'none'."
8838 lookpath="$prefixexp/share/man/man1"
8839 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8840 lookpath="$lookpath $prefixexp/man/p_man/man1"
8841 lookpath="$lookpath $prefixexp/man/u_man/man1"
8842 lookpath="$lookpath $prefixexp/man/man.1"
8844 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8845 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8855 rp="Where do the main $spackage manual pages (source) go?"
8857 if $test "X$man1direxp" != "X$ansexp"; then
8868 : What suffix to use on installed man pages
8875 rp="What suffix should be used for the main $spackage man pages?"
8877 '') case "$man1dir" in
8891 *) dflt="$man1ext";;
8898 : see if we can have long filenames
8900 first=123456789abcdef
8902 if (echo hi >$first) 2>/dev/null; then
8903 if $test -f 123456789abcde; then
8904 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8907 echo 'You can have filenames longer than 14 characters.'>&4
8912 You can't have filenames longer than 14 chars.
8913 You can't even think about them!
8919 $rm -rf 123456789abcde*
8921 : determine where library module manual pages go
8922 set man3dir man3dir none
8926 $spackage has manual pages for many of the library modules.
8932 However, you don't have nroff, so they're probably useless to you.
8935 '') man3dir="none";;
8939 case "$d_flexfnam" in
8942 However, your system can't handle the long file names like File::Basename.3.
8945 '') man3dir="none";;
8949 echo "If you don't want the manual sources installed, answer 'none'."
8950 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8952 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8953 if $test -d "$privlib/man/man3"; then
8956 WARNING: Previous versions of perl installed man3 pages into
8957 $privlib/man/man3. This version will suggest a
8958 new default of $dflt.
8962 rp='Do you wish to preserve the old behavior?(y/n)'
8965 y*) dflt="$privlib/man/man3" ;;
8970 *) dflt="$man3dir" ;;
8977 rp="Where do the $package library man pages (source) go?"
8987 : What suffix to use on installed man pages
8993 rp="What suffix should be used for the $package library man pages?"
8995 '') case "$man3dir" in
9009 *) dflt="$man3ext";;
9016 : see if we have to deal with yellow pages, now NIS.
9017 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
9023 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
9031 rp='Are you getting the hosts file via yellow pages?'
9034 y*) hostcat='ypcat hosts';;
9035 *) hostcat='cat /etc/hosts';;
9041 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
9044 '') test -f /etc/group && groupcat='cat /etc/group';;
9047 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
9050 : now get the host name
9052 echo "Figuring out host name..." >&4
9053 case "$myhostname" in
9055 echo 'Maybe "hostname" will work...'
9056 if tans=`sh -c hostname 2>&1` ; then
9064 if $test "$cont"; then
9066 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
9067 if tans=`cat /etc/systemid 2>&1` ; then
9069 phostname='cat /etc/systemid'
9070 echo "Whadyaknow. Xenix always was a bit strange..."
9073 elif $test -r /etc/systemid; then
9074 echo "(What is a non-Xenix system doing with /etc/systemid?)"
9077 if $test "$cont"; then
9078 echo 'No, maybe "uuname -l" will work...'
9079 if tans=`sh -c 'uuname -l' 2>&1` ; then
9081 phostname='uuname -l'
9083 echo 'Strange. Maybe "uname -n" will work...'
9084 if tans=`sh -c 'uname -n' 2>&1` ; then
9086 phostname='uname -n'
9088 echo 'Oh well, maybe I can mine it out of whoami.h...'
9089 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
9090 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
9091 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
9093 case "$myhostname" in
9094 '') echo "Does this machine have an identity crisis or something?"
9097 echo "Well, you said $myhostname before..."
9098 phostname='echo $myhostname';;
9104 case "$myhostname" in
9105 '') myhostname=noname ;;
9107 : you do not want to know about this
9112 if $test "$myhostname" ; then
9114 rp='Your host name appears to be "'$myhostname'".'" Right?"
9122 : bad guess or no guess
9123 while $test "X$myhostname" = X ; do
9125 rp="Please type the (one word) name of your host:"
9130 : translate upper to lower if necessary
9131 case "$myhostname" in
9133 echo "(Normalizing case in your host name)"
9134 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
9138 case "$myhostname" in
9140 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
9141 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
9142 echo "(Trimming domain name from host name--host name is now $myhostname)"
9144 *) case "$mydomain" in
9147 test "X$hostcat" = "Xypcat hosts" &&
9148 ypmatch "$myhostname" hosts 2>/dev/null |\
9149 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
9152 test "X$hostcat" != "X" &&
9153 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
9154 /[ ]$myhostname[ . ]/p" > hosts
9157 if $test -f hosts; then
9158 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
9159 END { print sum }" hosts` = x1 || tmp_re="[ ]"
9160 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
9161 hosts | $sort | $uniq | \
9162 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
9163 case `$echo X$dflt` in
9164 X*\ *) echo "(Several hosts in the database matched hostname)"
9167 X.) echo "(You do not have fully-qualified names in the hosts database)"
9171 echo "(I cannot locate a hosts database anywhere)"
9176 tans=`./loc resolv.conf X /etc /usr/etc`
9177 if $test -f "$tans"; then
9178 echo "(Attempting domain name extraction from $tans)"
9179 dflt=.`$sed -n -e 's/ / /g' \
9180 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
9183 .) dflt=.`$sed -n -e 's/ / /g' \
9184 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
9192 .) echo "(No help from resolv.conf either -- attempting clever guess)"
9193 dflt=.`sh -c domainname 2>/dev/null`
9196 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
9200 case "$dflt$osname" in
9201 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
9202 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
9206 .) echo "(Lost all hope -- silly guess then)"
9212 *) dflt="$mydomain";;
9216 rp="What is your domain name?"
9226 : translate upper to lower if necessary
9229 echo "(Normalizing case in your domain name)"
9230 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
9234 : a little sanity check here
9235 case "$phostname" in
9238 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
9239 $myhostname$mydomain|$myhostname) ;;
9241 case "$phostname" in
9243 echo "(That doesn't agree with your whoami.h file, by the way.)"
9246 echo "(That doesn't agree with your $phostname command, by the way.)"
9254 : determine the e-mail address of the user who is running us
9257 I need to get your e-mail address in Internet format if possible, i.e.
9258 something like user@host.domain. Please answer accurately since I have
9259 no easy means to double check it. The default value provided below
9260 is most probably close to reality but may not be valid from outside
9261 your organization...
9265 while test "$cont"; do
9266 case "$MAILDOMAIN" in
9268 if $test -s /etc/mailname; then
9269 maildomain=`$cat /etc/mailname`
9271 maildomain="$myhostname$mydomain"
9274 *) maildomain="$MAILDOMAIN";;
9277 '') dflt="$cf_by@$maildomain";;
9278 *) dflt="$cf_email";;
9280 rp='What is your e-mail address?'
9286 rp='Address does not look like an Internet one. Use it anyway?'
9300 : Ask e-mail of administrator
9303 If you or somebody else will be maintaining perl at your site, please
9304 fill in the correct e-mail address here so that they may be contacted
9305 if necessary. Currently, the "perlbug" program included with perl
9306 will send mail to this address in addition to perlbug@perl.org. You may
9307 enter "none" for no administrator.
9310 case "$perladmin" in
9311 '') dflt="$cf_email";;
9312 *) dflt="$perladmin";;
9314 rp='Perl administrator e-mail address'
9318 : determine whether to only install version-specific parts.
9321 Do you want to install only the version-specific parts of the perl
9322 distribution? Usually you do *not* want to do this.
9324 case "$versiononly" in
9325 "$define"|[Yy]*|true) dflt='y' ;;
9328 rp="Do you want to install only the version-specific parts of perl?"
9331 [yY]*) val="$define";;
9337 case "$versiononly" in
9338 "$define") inc_version_list=''
9339 inc_version_list_init=0
9343 : figure out how to guarantee perl startup
9344 : XXX Note that this currently takes advantage of the bug that binexp ignores
9345 : the Configure -Dinstallprefix setting, which in turn means that under
9346 : relocatable @INC, initialinstalllocation is what binexp started as.
9347 case "$startperl" in
9349 case "$sharpbang" in
9353 I can use the #! construct to start perl on your system. This will
9354 make startup of perl scripts faster, but may cause problems if you
9355 want to share those scripts and perl is not in a standard place
9356 ($initialinstalllocation/perl) on all your platforms. The alternative
9357 is to force a shell by starting the script with a single ':' character.
9360 case "$versiononly" in
9361 "$define") dflt="$initialinstalllocation/perl$version";;
9362 *) dflt="$initialinstalllocation/perl";;
9364 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
9367 none) startperl=": # use perl";;
9368 *) startperl="#!$ans"
9369 if $test 30 -lt `echo "$ans" | wc -c`; then
9372 WARNING: Some systems limit the #! command to 32 characters.
9373 If you experience difficulty running Perl scripts with #!, try
9374 installing Perl in a directory with a shorter pathname.
9380 *) startperl=": # use perl"
9385 echo "I'll use $startperl to start perl scripts."
9387 : figure best path for perl in scripts
9390 case "$versiononly" in
9391 "$define") perlpath="$initialinstalllocation/perl$version";;
9392 *) perlpath="$initialinstalllocation/perl";;
9394 case "$startperl" in
9399 I will use the "eval 'exec'" idiom to start Perl on your system.
9400 I can use the full path of your Perl binary for this purpose, but
9401 doing so may cause problems if you want to share those scripts and
9402 Perl is not always in a standard place ($initialinstalllocation/perl).
9405 dflt="$initialinstalllocation/perl"
9406 rp="What path shall I use in \"eval 'exec'\"?"
9413 case "$startperl" in
9415 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
9418 : determine where public executable scripts go
9419 set scriptdir scriptdir
9421 case "$scriptdir" in
9424 : guess some guesses
9425 $test -d /usr/share/scripts && dflt=/usr/share/scripts
9426 $test -d /usr/share/bin && dflt=/usr/share/bin
9427 $test -d /usr/local/script && dflt=/usr/local/script
9428 $test -d /usr/local/scripts && dflt=/usr/local/scripts
9429 $test -d $prefixexp/script && dflt=$prefixexp/script
9433 *) dflt="$scriptdir"
9438 Some installations have a separate directory just for executable scripts so
9439 that they can mount it across multiple architectures but keep the scripts in
9440 one spot. You might, for example, have a subdirectory of /usr/share for this.
9441 Or you might just lump your scripts in with all your other executables.
9445 rp='Where do you keep publicly executable scripts?'
9447 if $test "X$ansexp" != "X$scriptdirexp"; then
9453 : A little fix up for an irregularly named variable.
9454 installscript="$installscriptdir"
9456 : determine where add-on public executables go
9458 '') dflt=$siteprefix/bin ;;
9462 rp='Pathname where the add-on public executables should be installed?'
9467 : determine where add-on html pages go
9468 : There is no standard location, so try to copy the previously-selected
9469 : directory structure for the core html pages.
9470 case "$sitehtml1dir" in
9471 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9472 *) dflt=$sitehtml1dir ;;
9475 ''|' ') dflt=none ;;
9478 rp='Pathname where the site-specific html pages should be installed?'
9480 prefixvar=sitehtml1dir
9483 : determine where add-on library html pages go
9484 : There is no standard location, so try to copy the previously-selected
9485 : directory structure for the core html pages.
9486 case "$sitehtml3dir" in
9487 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9488 *) dflt=$sitehtml3dir ;;
9491 ''|' ') dflt=none ;;
9494 rp='Pathname where the site-specific library html pages should be installed?'
9496 prefixvar=sitehtml3dir
9499 : determine where add-on manual pages go
9500 case "$siteman1dir" in
9501 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
9502 *) dflt=$siteman1dir ;;
9505 ''|' ') dflt=none ;;
9508 rp='Pathname where the site-specific manual pages should be installed?'
9510 prefixvar=siteman1dir
9513 : determine where add-on library man pages go
9514 case "$siteman3dir" in
9515 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
9516 *) dflt=$siteman3dir ;;
9519 ''|' ') dflt=none ;;
9522 rp='Pathname where the site-specific library manual pages should be installed?'
9524 prefixvar=siteman3dir
9527 : determine where add-on public executable scripts go
9528 case "$sitescript" in
9529 '') dflt=$siteprefix/script
9530 $test -d $dflt || dflt=$sitebin ;;
9531 *) dflt="$sitescript" ;;
9534 rp='Pathname where add-on public executable scripts should be installed?'
9536 prefixvar=sitescript
9539 : see if backtrace exists
9540 set backtrace d_backtrace
9543 : add flags if using c backtrace
9544 case "$usecbacktrace" in
9545 "") usecbacktrace=$undef ;;
9547 case "$d_backtrace" in
9549 case " $ccflags " in
9550 *" -DUSE_C_BACKTRACE "*) ;; # Already there.
9551 *) ccflags="$ccflags -DUSE_C_BACKTRACE -g" ;;
9555 echo "This system does not support backtrace" >&4
9556 usecbacktrace=$undef
9562 : Check if faststdio is requested and available
9563 case "$usefaststdio" in
9564 $define|true|[yY]*|'')
9565 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
9575 Perl can be built to use 'fast stdio', which means using the stdio
9576 library but also directly manipulating the stdio buffers to enable
9577 faster I/O. Using stdio is better for backward compatibility (especially
9578 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
9579 interface has been preferred instead of stdio.
9581 If this doesn't make any sense to you, just accept the default '$dflt'.
9583 rp='Use the "fast stdio" if available?'
9586 y|Y) val="$define" ;;
9593 : define an is-a-typedef? function
9594 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9596 "") inclist="sys/types.h";;
9598 eval "varval=\$$var";
9602 for inc in $inclist; do
9603 echo "#include <$inc>" >>temp.c;
9605 echo "#ifdef $type" >> temp.c;
9606 echo "printf(\"We have $type\");" >> temp.c;
9607 echo "#endif" >> temp.c;
9608 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9609 if $contains $type temp.E >/dev/null 2>&1; then
9615 *) eval "$var=\$varval";;
9618 : define an is-a-typedef? function that prompts if the type is not available.
9619 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9621 "") inclist="sys/types.h";;
9623 eval "varval=\$$var";
9627 for inc in $inclist; do
9628 echo "#include <$inc>" >>temp.c;
9630 echo "#ifdef $type" >> temp.c;
9631 echo "printf(\"We have $type\");" >> temp.c;
9632 echo "#endif" >> temp.c;
9633 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9635 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
9636 if $contains $type temp.E >/dev/null 2>&1; then
9637 echo "$type found." >&4;
9640 echo "$type NOT found." >&4;
9646 *) eval "$var=\$varval";;
9649 : see what type lseek is declared as in the kernel
9650 rp="What is the type used for lseek's offset on this system?"
9651 set off_t lseektype long stdio.h sys/types.h
9655 echo "Checking to see how big your file offsets are..." >&4
9657 #include <sys/types.h>
9661 printf("%d\n", (int)sizeof($lseektype));
9666 if eval $compile_ok; then
9667 lseeksize=`$run ./try`
9668 echo "Your file offsets are $lseeksize bytes long."
9672 echo "(I can't seem to compile the test program. Guessing...)"
9673 rp="What is the size of your file offsets (in bytes)?"
9679 : see what type file positions are declared as in the library
9680 rp="What is the type for file position used by fsetpos()?"
9681 set fpos_t fpostype long stdio.h sys/types.h
9684 : Check size for Fpos_t
9687 *_t) zzz="$fpostype" ;;
9690 echo "Checking the size of $zzz..." >&4
9692 #include <sys/types.h>
9699 printf("%d\n", (int)sizeof($fpostype));
9704 if eval $compile_ok; then
9708 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9711 echo "Your $zzz is $fpossize bytes long."
9717 echo "(I can't compile the test program. Guessing...)" >&4
9718 rp="What is the size of your file positions (in bytes)?"
9723 : Check for large file support
9724 # Backward compatibility (uselfs is deprecated).
9726 "$define"|true|[yY]*)
9729 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9731 uselargefiles="$define"
9735 case "$lseeksize:$fpossize" in
9738 You can have files larger than 2 gigabytes.
9741 *) case "$uselargefiles" in
9742 "$undef"|false|[nN]*) dflt='n' ;;
9747 Perl can be built to understand large files (files larger than 2 gigabytes)
9748 on some systems. To do so, Configure can be run with -Duselargefiles.
9750 If this doesn't make any sense to you, just accept the default '$dflt'.
9752 rp='Try to understand large files, if available?'
9755 y|Y) val="$define" ;;
9762 : Look for a hint-file generated 'call-back-unit'. If the
9763 : user has specified that a large files perl is to be built,
9764 : we may need to set or change some other defaults.
9765 if $test -f uselargefiles.cbu; then
9766 echo "Your platform has some specific hints regarding large file builds, using them..."
9767 . ./uselargefiles.cbu
9769 case "$uselargefiles" in
9771 if $test -f uselargefiles.cbu; then
9773 echo "Rechecking to see how big your file offsets are..." >&4
9775 #include <sys/types.h>
9779 printf("%d\n", (int)sizeof($lseektype));
9784 if eval $compile_ok; then
9785 lseeksize=`$run ./try`
9786 $echo "Your file offsets are now $lseeksize bytes long."
9790 echo "(I can't seem to compile the test program. Guessing...)"
9791 rp="What is the size of your file offsets (in bytes)?"
9796 *_t) zzz="$fpostype" ;;
9799 $echo $n "Rechecking the size of $zzz...$c" >&4
9801 #include <sys/types.h>
9808 printf("%d\n", (int)sizeof($fpostype));
9813 if eval $compile_ok; then
9818 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9821 echo " $fpossize bytes." >&4
9827 echo "(I can't compile the test program. Guessing...)" >&4
9828 rp="What is the size of your file positions (in bytes)?"
9837 : Check if we want perlio
9840 : Set the vendorbin variables
9841 case "$vendorprefix" in
9842 '') d_vendorbin="$undef"
9846 *) d_vendorbin="$define"
9847 : determine where vendor-supplied executables go.
9848 case "$vendorbin" in
9849 '') dflt=$vendorprefix/bin ;;
9850 *) dflt="$vendorbin" ;;
9853 rp='Pathname for the vendor-supplied executables directory?'
9856 vendorbinexp="$ansexp"
9862 : Set the vendorhtml1dir variables
9863 case "$vendorprefix" in
9864 '') vendorhtml1dir=''
9865 vendorhtml1direxp=''
9867 *) : determine where vendor-supplied html pages go.
9868 : There is no standard location, so try to copy the previously-selected
9869 : directory structure for the core html pages.
9870 : XXX Better default suggestions would be welcome.
9871 case "$vendorhtml1dir" in
9872 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9873 *) dflt=$vendorhtml1dir ;;
9876 ''|' ') dflt=none ;;
9879 rp='Pathname for the vendor-supplied html pages?'
9881 vendorhtml1dir="$ans"
9882 vendorhtml1direxp="$ansexp"
9885 : Use ' ' for none so value is preserved next time through Configure
9886 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9887 prefixvar=vendorhtml1dir
9890 : Set the vendorhtml3dir variables
9891 case "$vendorprefix" in
9892 '') vendorhtml3dir=''
9893 vendorhtml3direxp=''
9895 *) : determine where vendor-supplied module html pages go.
9896 : There is no standard location, so try to copy the previously-selected
9897 : directory structure for the core html pages.
9898 : XXX Better default suggestions would be welcome.
9899 case "$vendorhtml3dir" in
9900 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9901 *) dflt=$vendorhtml3dir ;;
9904 ''|' ') dflt=none ;;
9907 rp='Pathname for the vendor-supplied html pages?'
9909 vendorhtml3dir="$ans"
9910 vendorhtml3direxp="$ansexp"
9913 : Use ' ' for none so value is preserved next time through Configure
9914 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9915 prefixvar=vendorhtml3dir
9918 : Set the vendorman1dir variables
9919 case "$vendorprefix" in
9920 '') vendorman1dir=''
9923 *) : determine where vendor-supplied manual pages go.
9924 case "$vendorman1dir" in
9925 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9926 *) dflt=$vendorman1dir ;;
9929 ''|' ') dflt=none ;;
9932 rp='Pathname for the vendor-supplied manual section 1 pages?'
9934 vendorman1dir="$ans"
9935 vendorman1direxp="$ansexp"
9938 : Use ' ' for none so value is preserved next time through Configure
9939 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9940 prefixvar=vendorman1dir
9943 : Set the vendorman3dir variables
9944 case "$vendorprefix" in
9945 '') vendorman3dir=''
9948 *) : determine where vendor-supplied module manual pages go.
9949 case "$vendorman3dir" in
9950 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9951 *) dflt=$vendorman3dir ;;
9954 ''|' ') dflt=none ;;
9957 rp='Pathname for the vendor-supplied manual section 3 pages?'
9959 vendorman3dir="$ans"
9960 vendorman3direxp="$ansexp"
9963 : Use ' ' for none so value is preserved next time through Configure
9964 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9965 prefixvar=vendorman3dir
9968 : Set the vendorscript variables
9969 case "$vendorprefix" in
9970 '') d_vendorscript="$undef"
9974 *) d_vendorscript="$define"
9975 : determine where vendor-supplied scripts go.
9976 case "$vendorscript" in
9977 '') dflt=$vendorprefix/script
9978 $test -d $dflt || dflt=$vendorbin ;;
9979 *) dflt="$vendorscript" ;;
9983 The installation process will create a directory for
9984 vendor-supplied scripts.
9988 rp='Pathname for the vendor-supplied scripts directory?'
9991 vendorscriptexp="$ansexp"
9994 prefixvar=vendorscript
9997 : script used to emit important warnings
10000 if test \$# -gt 0; then
10005 echo "*** WARNING:" >&4
10006 sed -e 's/^/*** /' <msg >&4
10008 cat msg >>config.msg
10009 echo " " >>config.msg
10015 : see which of string.h or strings.h is needed
10017 strings=`./findhdr string.h`
10018 if $test "$strings" && $test -r "$strings"; then
10019 echo "Using <string.h> instead of <strings.h>." >&4
10023 strings=`./findhdr strings.h`
10024 if $test "$strings" && $test -r "$strings"; then
10025 echo "Using <strings.h> instead of <string.h>." >&4
10027 ./warn "No string header found -- You'll surely have problems."
10032 case "$i_string" in
10033 "$undef") strings=`./findhdr strings.h`;;
10034 *) strings=`./findhdr string.h`;;
10037 : see if qgcvt exists
10041 : Check what kind of doubles your system has
10042 $echo "Checking the kind of doubles you have..." >&4
10044 #$i_stdlib I_STDLIB
10045 #define DOUBLESIZE $doublesize
10047 #include <stdlib.h>
10050 static const double d = -0.1;
10052 unsigned const char* b = (unsigned const char*)(&d);
10053 #if DOUBLESIZE == 4
10054 if (b[0] == 0xCD && b[3] == 0xBD) {
10055 /* IEEE 754 32-bit little-endian */
10059 if (b[0] == 0xBD && b[3] == 0xCD) {
10060 /* IEEE 754 32-bit big-endian */
10065 #if DOUBLESIZE == 8
10066 if (b[0] == 0x9A && b[7] == 0xBF) {
10067 /* IEEE 754 64-bit little-endian */
10071 if (b[0] == 0xBF && b[7] == 0x9A) {
10072 /* IEEE 754 64-bit big-endian */
10076 if (b[0] == 0x99 && b[3] == 0xBF && b[4] == 0x9A && b[7] == 0x99) {
10077 /* ARM mixed endian: two little-endian 32-bit floats, in big endian order:
10078 * 4 5 6 7 0 1 2 3 (MSB = 7, LSB = 0)
10079 * 99 99 b9 bf 9a 99 99 99 */
10083 if (b[0] == 0x99 && b[3] == 0x9A && b[4] == 0xBF && b[7] == 0x99) {
10084 /* The opposite of case 7, mixed endian: two big-endian 32-bit floats,
10085 * in little endian order: 3 2 1 0 7 6 5 4 (MSB = 7, LSB = 0)
10086 * 99 99 99 9a bf b9 99 99 */
10091 #if DOUBLESIZE == 16
10092 if (b[0] == 0x9A && b[15] == 0xBF) {
10093 /* IEEE 754 128-bit little-endian */
10097 if (b[0] == 0xBF && b[15] == 0x9A) {
10098 /* IEEE 754 128-bit big-endian */
10103 /* Then there are old mainframe/miniframe formats like VAX, IBM, and CRAY.
10104 * Whether those environments can still build Perl is debatable. */
10105 printf("-1\n"); /* unknown */
10110 if eval $compile; then
10111 doublekind=`$run ./try`
10115 case "$doublekind" in
10116 1) echo "You have IEEE 754 32-bit little endian doubles." >&4 ;;
10117 2) echo "You have IEEE 754 32-bit big endian doubles." >&4 ;;
10118 3) echo "You have IEEE 754 64-bit little endian doubles." >&4 ;;
10119 4) echo "You have IEEE 754 64-bit big endian doubles." >&4 ;;
10120 5) echo "You have IEEE 754 128-bit little endian doubles." >&4 ;;
10121 6) echo "You have IEEE 754 128-bit big endian doubles." >&4 ;;
10122 7) echo "You have IEEE 754 64-bit mixed endian doubles (32-bit LEs in BE)." >&4 ;;
10123 8) echo "You have IEEE 754 64-bit mixed endian doubles (32-bit BEs in LE)." >&4 ;;
10124 *) echo "Cannot figure out your double. You VAX, or something?" >&4 ;;
10128 : Check print/scan long double stuff
10131 if $test X"$d_longdbl" = X"$define"; then
10133 echo "Checking how to print long doubles..." >&4
10135 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
10136 $cat >try.c <<'EOCP'
10137 #include <sys/types.h>
10140 double d = 123.456;
10141 printf("%.3f\n", d);
10145 if eval $compile; then
10149 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
10150 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
10151 echo "We will use %f."
10157 if $test X"$sPRIfldbl" = X; then
10158 $cat >try.c <<'EOCP'
10159 #include <sys/types.h>
10162 long double d = 123.456;
10163 printf("%.3Lf\n", d);
10167 if eval $compile; then
10171 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
10172 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
10173 echo "We will use %Lf."
10179 if $test X"$sPRIfldbl" = X; then
10180 $cat >try.c <<'EOCP'
10181 #include <sys/types.h>
10184 long double d = 123.456;
10185 printf("%.3llf\n", d);
10189 if eval $compile; then
10193 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
10194 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
10195 echo "We will use %llf."
10201 if $test X"$sPRIfldbl" = X; then
10202 $cat >try.c <<'EOCP'
10203 #include <sys/types.h>
10206 long double d = 123.456;
10207 printf("%.3lf\n", d);
10211 if eval $compile; then
10215 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
10216 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
10217 echo "We will use %lf."
10223 if $test X"$sPRIfldbl" = X; then
10224 echo "Cannot figure out how to print long doubles." >&4
10226 sSCNfldbl=$sPRIfldbl # expect consistency
10233 case "$sPRIfldbl" in
10234 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
10235 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
10236 d_SCNfldbl="$undef";
10238 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
10239 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
10240 d_SCNfldbl="$define";
10244 : Before committing on uselongdouble, see whether that looks sane.
10245 if $test "$uselongdouble" = "$define"; then
10248 echo "Checking if your long double math functions work right..." >&4
10253 printf("%"$sPRIgldbl"\n", sqrtl(logl(expl(cosl(sinl(0.0L))))+powl(2.0L, 3.0L)));
10256 case "$osname:$gccversion" in
10257 aix:) saveccflags="$ccflags"
10258 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
10261 if eval $compile_ok; then
10265 3) echo "Your long double math functions are working correctly." >&4 ;;
10266 *) echo "Your long double math functions are broken, not using long doubles." >&4
10267 uselongdouble=$undef
10271 case "$osname:$gccversion" in
10272 aix:) ccflags="$saveccflags" ;; # restore
10276 : Check how to convert floats to strings.
10278 if test "X$d_Gconvert" = X; then
10281 echo "Checking for an efficient way to convert floats to strings."
10283 case "$uselongdouble" in
10284 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
10286 case "$d_longdbl" in
10287 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
10289 case "$d_PRIgldbl" in
10290 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
10293 #ifdef TRY_gconvert
10294 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
10295 char *myname = "gconvert";
10298 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
10299 char *myname = "gcvt";
10302 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
10303 char *myname = "qgcvt";
10304 #define DOUBLETYPE long double
10307 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
10308 #ifdef HAS_PRIgldbl
10309 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
10311 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
10314 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
10316 char *myname = "sprintf";
10320 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
10321 #define DOUBLETYPE long double
10323 #define DOUBLETYPE double
10329 #$i_stdlib I_STDLIB
10331 #include <stdlib.h>
10333 #$i_string I_STRING
10335 # include <string.h>
10337 # include <strings.h>
10340 int checkit(char *expect, char *got)
10342 if (strcmp(expect, got)) {
10343 printf("%s oddity: Expected %s, got %s\n",
10344 myname, expect, got);
10354 /* This must be 1st test on (which?) platform */
10355 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
10356 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
10357 checkit("0.1", buf);
10359 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
10360 checkit("0.01", buf);
10362 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
10363 checkit("0.001", buf);
10365 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
10366 checkit("0.0001", buf);
10368 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
10369 if (strlen(buf) > 5)
10370 checkit("9e-005", buf); /* for Microsoft ?? */
10372 checkit("9e-05", buf);
10374 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
10377 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
10378 checkit("1.1", buf);
10380 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
10381 checkit("1.01", buf);
10383 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
10384 checkit("1.001", buf);
10386 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
10387 checkit("1.0001", buf);
10389 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
10390 checkit("1.00001", buf);
10392 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
10393 checkit("1.000001", buf);
10395 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
10398 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
10399 checkit("-1", buf);
10401 /* Some Linux gcvt's give 1.e+5 here. */
10402 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
10403 checkit("100000", buf);
10405 /* Some Linux gcvt's give -1.e+5 here. */
10406 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
10407 checkit("-100000", buf);
10409 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
10410 checkit("123.456", buf);
10412 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
10413 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
10414 /* 34 should be enough to scare even long double
10415 * places into using the e notation. */
10416 if (strlen(buf) > 5)
10417 checkit("1e+034", buf); /* for Microsoft */
10419 checkit("1e+34", buf);
10421 /* For Perl, if you add additional tests here, also add them to
10422 * t/base/num.t for benefit of platforms not using Configure or
10423 * overriding d_Gconvert */
10428 : first add preferred functions to our list
10430 for xxx_convert in $gconvert_preference; do
10431 case $xxx_convert in
10432 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
10433 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
10436 : then add any others
10437 for xxx_convert in gconvert gcvt sprintf; do
10438 case "$xxx_list" in
10440 *) xxx_list="$xxx_list $xxx_convert" ;;
10444 case "$d_longdbl$uselongdouble" in
10446 : again, add preferred functions to our list first
10448 for xxx_convert in $gconvert_ld_preference; do
10449 case $xxx_convert in
10450 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
10451 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
10454 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
10455 for xxx_convert in qgcvt sprintf $xxx_list; do
10456 case "$xxx_ld_list" in
10457 $xxx_convert*|*" $xxx_convert"*) ;;
10458 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
10461 : if sprintf cannot do long doubles, move it to the end
10462 if test "$d_PRIgldbl" != "$define"; then
10463 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
10465 : if no qgcvt, remove it
10466 if test "$d_qgcvt" != "$define"; then
10467 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
10470 xxx_list="$xxx_ld_list"
10474 for xxx_convert in $xxx_list; do
10475 echo "Trying $xxx_convert..."
10476 $rm -f try try$_o core
10477 set try -DTRY_$xxx_convert
10478 if eval $compile; then
10479 echo "$xxx_convert() found." >&4
10480 if $run ./try; then
10481 echo "I'll use $xxx_convert to convert floats into a string." >&4
10484 echo "...But $xxx_convert didn't work as I expected."
10488 echo "$xxx_convert NOT found." >&4
10492 if test X$xxx_convert = X; then
10493 echo "*** WHOA THERE!!! ***" >&4
10494 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
10495 xxx_convert=sprintf
10498 case "$xxx_convert" in
10499 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
10500 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
10501 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
10502 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
10503 "$define$define$define")
10504 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
10505 "$define$define$undef")
10506 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
10507 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
10515 : see if _fwalk exists
10519 : Initialize h_fcntl
10522 : Initialize h_sysfile
10525 : access call always available on UNIX
10526 set access d_access
10529 : locate the flags for 'access()'
10530 case "$d_access" in
10533 $cat >access.c <<EOCP
10534 #include <sys/types.h>
10539 #include <sys/file.h>
10542 #include <unistd.h>
10544 #$i_stdlib I_STDLIB
10546 #include <stdlib.h>
10552 : check sys/file.h first, no particular reason here
10553 if $test `./findhdr sys/file.h` && \
10554 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
10556 echo "<sys/file.h> defines the *_OK access constants." >&4
10557 elif $test `./findhdr fcntl.h` && \
10558 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
10560 echo "<fcntl.h> defines the *_OK access constants." >&4
10561 elif $test `./findhdr unistd.h` && \
10562 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
10563 echo "<unistd.h> defines the *_OK access constants." >&4
10565 echo "I can't find the four *_OK access constants--I'll use mine." >&4
10571 : see if accessx exists
10572 set accessx d_accessx
10575 : see if acosh exists
10579 : see if aintl exists
10583 : see if alarm exists
10587 : see if 64bit time functions exists
10589 set ctime64 d_ctime64
10592 set localtime64 d_localtime64
10595 set gmtime64 d_gmtime64
10598 set mktime64 d_mktime64
10601 set difftime64 d_difftime64
10604 set asctime64 d_asctime64
10607 : see if POSIX threads are available
10608 set pthread.h i_pthread
10611 : define a function to check prototypes
10612 $cat > protochk <<EOSH
10615 optimize="$optimize"
10617 prototype="$prototype"
10620 usethreads=$usethreads
10621 i_pthread=$i_pthread
10622 pthread_h_first=$pthread_h_first
10625 $cat >> protochk <<'EOSH'
10630 while test $# -ge 2; do
10632 $define) echo "#include <$2>" >> try.c ;;
10633 literal) echo "$2" >> try.c ;;
10635 # Extra magic for the benefit of systems that need pthread.h
10636 # to be included early to correctly detect threadsafe functions.
10637 # Such functions must guarantee themselves, though, that the usethreads
10638 # and i_pthread have been defined, before calling protochk.
10639 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
10640 echo "#include <pthread.h>" >> try.c
10645 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
10646 cat >> try.c <<'EOCP'
10647 #ifdef CAN_PROTOTYPE
10648 #define _(args) args
10653 echo "$foo" >> try.c
10654 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
10655 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
10661 $eunicefix protochk
10663 : Define hasproto macro for Configure internal use
10664 hasproto='varname=$1; func=$2; shift; shift;
10665 while $test $# -ge 2; do
10667 $define) echo "#include <$2>";;
10671 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
10672 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
10673 echo "$func() prototype found.";
10676 echo "$func() prototype NOT found.";
10683 : see if sys/types.h has to be included
10684 set sys/types.h i_systypes
10687 : see if sys/select.h has to be included
10688 set sys/select.h i_sysselct
10691 : Define hasfield macro for Configure internal use
10692 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
10693 while $test $# -ge 2; do
10695 $define) echo "#include <$2>";;
10699 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
10701 if eval $compile; then
10710 : see if we should include time.h, sys/time.h, or both
10712 if test "X$timeincl" = X; then
10713 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
10714 $echo $n "I'm now running the test program...$c"
10716 #include <sys/types.h>
10721 #ifdef SYSTIMEKERNEL
10724 #include <sys/time.h>
10727 #include <sys/select.h>
10729 #$i_stdlib I_STDLIB
10731 #include <stdlib.h>
10737 struct timeval bar;
10740 struct timezone tzp;
10742 if (foo.tm_sec == foo.tm_sec)
10745 if (bar.tv_sec == bar.tv_sec)
10752 for s_timezone in '-DS_TIMEZONE' ''; do
10754 for s_timeval in '-DS_TIMEVAL' ''; do
10755 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10756 for i_time in '' '-DI_TIME'; do
10757 for i_systime in '-DI_SYSTIME' ''; do
10760 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10761 if eval $compile; then
10762 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
10766 $echo $n "Succeeded with $flags$c"
10778 *SYSTIMEKERNEL*) i_systimek="$define"
10779 timeincl=`./findhdr sys/time.h`
10780 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10781 *) i_systimek="$undef";;
10784 *I_TIME*) i_time="$define"
10785 timeincl=`./findhdr time.h`" $timeincl"
10786 echo "We'll include <time.h>." >&4;;
10787 *) i_time="$undef";;
10790 *I_SYSTIME*) i_systime="$define"
10791 timeincl=`./findhdr sys/time.h`" $timeincl"
10792 echo "We'll include <sys/time.h>." >&4;;
10793 *) i_systime="$undef";;
10797 : see if struct tm knows about tm_zone
10798 case "$i_systime$i_time" in
10801 echo "Checking to see if your struct tm has tm_zone field..." >&4
10802 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
10810 case "$d_tm_tm_zone" in
10811 "$define") echo "Yes, it does." ;;
10812 *) echo "No, it doesn't." ;;
10814 : see if struct tm knows about tm_gmtoff
10815 case "$i_systime$i_time" in
10818 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
10819 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
10827 case "$d_tm_tm_gmtoff" in
10828 "$define") echo "Yes, it does." ;;
10829 *) echo "No, it doesn't." ;;
10832 : see if asctime_r exists
10833 set asctime_r d_asctime_r
10835 case "$d_asctime_r" in
10837 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10838 case "$d_asctime_r_proto:$usethreads" in
10839 ":define") d_asctime_r_proto=define
10840 set d_asctime_r_proto asctime_r $hdrs
10844 case "$d_asctime_r_proto" in
10846 case "$asctime_r_proto" in
10847 ''|0) try='char* asctime_r(const struct tm*, char*);'
10848 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SB ;;
10850 case "$asctime_r_proto" in
10851 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
10852 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SBI ;;
10854 case "$asctime_r_proto" in
10855 ''|0) try='int asctime_r(const struct tm*, char*);'
10856 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SB ;;
10858 case "$asctime_r_proto" in
10859 ''|0) try='int asctime_r(const struct tm*, char*, int);'
10860 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SBI ;;
10862 case "$asctime_r_proto" in
10863 ''|0) d_asctime_r=undef
10865 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
10866 * ) case "$asctime_r_proto" in
10867 REENTRANT_PROTO*) ;;
10868 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
10870 echo "Prototype: $try" ;;
10873 *) case "$usethreads" in
10874 define) echo "asctime_r has no prototype, not using it." >&4 ;;
10881 *) asctime_r_proto=0
10885 : see if asinh exists
10889 : see if atanh exists
10893 : see if atolf exists
10897 : see if atoll exists
10901 : Look for GCC-style attribute format
10902 case "$d_attribute_format" in
10905 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
10906 $cat >attrib.c <<'EOCP'
10908 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
10910 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10911 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10912 echo "Your C compiler doesn't support __attribute__((format))."
10915 echo "Your C compiler supports __attribute__((format))."
10919 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10923 *) val="$d_attribute_format" ;;
10925 set d_attribute_format
10929 : Look for GCC-style attribute format with null format allowed
10930 case "$d_printf_format_null" in
10931 '') case "$d_attribute_format" in
10934 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
10935 $cat >attrib.c <<EOCP
10937 #$i_stdlib I_STDLIB
10939 #include <stdlib.h>
10941 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
10942 int null_printf (char* pat,...) { return (int)pat; }
10943 int main () { exit(null_printf(NULL)); }
10945 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
10946 : run the executable in case it produces a run-time warning
10947 if $run ./attrib >>attrib.out 2>&1; then
10948 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10949 echo "Your C compiler doesn't allow __printf__ format to be null."
10952 echo "Your C compiler allows __printf__ format to be null."
10956 echo "Your C compiler executable failed with __printf__ format null."
10960 echo "Your C compiler fails with __printf__ format null."
10967 *) val="$d_printf_format_null" ;;
10969 set d_printf_format_null
10973 : Look for GCC-style attribute malloc
10974 case "$d_attribute_malloc" in
10977 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
10978 $cat >attrib.c <<'EOCP'
10980 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
10982 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10983 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10984 echo "Your C compiler doesn't support __attribute__((malloc))."
10987 echo "Your C compiler supports __attribute__((malloc))."
10991 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10995 *) val="$d_attribute_malloc" ;;
10997 set d_attribute_malloc
11001 : Look for GCC-style attribute nonnull
11002 case "$d_attribute_nonnull" in
11005 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
11006 $cat >attrib.c <<'EOCP'
11008 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
11010 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11011 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11012 echo "Your C compiler doesn't support __attribute__((nonnull))."
11015 echo "Your C compiler supports __attribute__((nonnull))."
11019 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11023 *) val="$d_attribute_nonnull" ;;
11025 set d_attribute_nonnull
11029 : Look for GCC-style attribute noreturn
11030 case "$d_attribute_noreturn" in
11033 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
11034 $cat >attrib.c <<'EOCP'
11036 void fall_over_dead( void ) __attribute__((noreturn));
11038 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11039 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11040 echo "Your C compiler doesn't support __attribute__((noreturn))."
11043 echo "Your C compiler supports __attribute__((noreturn))."
11047 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11051 *) val="$d_attribute_noreturn" ;;
11053 set d_attribute_noreturn
11057 : Look for GCC-style attribute pure
11058 case "$d_attribute_pure" in
11061 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
11062 $cat >attrib.c <<'EOCP'
11064 int square( int n ) __attribute__((pure));
11066 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11067 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11068 echo "Your C compiler doesn't support __attribute__((pure))."
11071 echo "Your C compiler supports __attribute__((pure))."
11075 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11079 *) val="$d_attribute_pure" ;;
11081 set d_attribute_pure
11085 : Look for GCC-style attribute unused
11086 case "$d_attribute_unused" in
11089 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
11090 $cat >attrib.c <<'EOCP'
11092 int do_something( int dummy __attribute__((unused)), int n );
11094 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11095 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11096 echo "Your C compiler doesn't support __attribute__((unused))."
11099 echo "Your C compiler supports __attribute__((unused))."
11103 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11107 *) val="$d_attribute_unused" ;;
11109 set d_attribute_unused
11113 : Look for GCC-style attribute deprecated
11114 case "$d_attribute_deprecated" in
11117 echo "Checking whether your compiler can handle __attribute__((deprecated)) ..." >&4
11118 $cat >attrib.c <<'EOCP'
11120 int I_am_deprecated(void) __attribute__((deprecated));
11122 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11123 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11124 echo "Your C compiler doesn't support __attribute__((deprecated))."
11127 echo "Your C compiler supports __attribute__((deprecated))."
11131 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11135 *) val="$d_attribute_deprecated" ;;
11137 set d_attribute_deprecated
11141 : Look for GCC-style attribute warn_unused_result
11142 case "$d_attribute_warn_unused_result" in
11145 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
11146 $cat >attrib.c <<'EOCP'
11148 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
11150 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11151 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11152 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
11155 echo "Your C compiler supports __attribute__((warn_unused_result))."
11159 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11163 *) val="$d_attribute_warn_unused_result" ;;
11165 set d_attribute_warn_unused_result
11169 : see if bcmp exists
11173 : see if bcopy exists
11177 : see if getpgrp exists
11178 set getpgrp d_getpgrp
11181 case "$d_getpgrp" in
11184 echo "Checking to see which flavor of getpgrp is in use..."
11186 #$i_unistd I_UNISTD
11187 #include <sys/types.h>
11189 # include <unistd.h>
11191 #$i_stdlib I_STDLIB
11193 #include <stdlib.h>
11197 if (getuid() == 0) {
11198 printf("(I see you are running Configure as super-user...)\n");
11201 #ifdef TRY_BSD_PGRP
11202 if (getpgrp(1) == 0)
11211 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11212 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
11214 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11215 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
11218 echo "I can't seem to compile and run the test program."
11220 xxx="a USG one, i.e. you use getpgrp()."
11222 # SVR4 systems can appear rather BSD-ish.
11223 case "$i_unistd" in
11225 xxx="a BSD one, i.e. you use getpgrp(pid)."
11229 xxx="probably a USG one, i.e. you use getpgrp()."
11234 echo "Assuming your getpgrp is $xxx" >&4
11243 : see if setpgrp exists
11244 set setpgrp d_setpgrp
11247 case "$d_setpgrp" in
11250 echo "Checking to see which flavor of setpgrp is in use..."
11252 #$i_unistd I_UNISTD
11253 #include <sys/types.h>
11255 # include <unistd.h>
11257 #$i_stdlib I_STDLIB
11259 #include <stdlib.h>
11263 if (getuid() == 0) {
11264 printf("(I see you are running Configure as super-user...)\n");
11267 #ifdef TRY_BSD_PGRP
11268 if (-1 == setpgrp(1, 1))
11271 if (setpgrp() != -1)
11277 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11278 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
11280 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11281 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
11284 echo "(I can't seem to compile and run the test program.)"
11286 xxx="a USG one, i.e. you use setpgrp()."
11288 # SVR4 systems can appear rather BSD-ish.
11289 case "$i_unistd" in
11291 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
11295 xxx="probably a USG one, i.e. you use setpgrp()."
11300 echo "Assuming your setpgrp is $xxx" >&4
11309 : Look for GCC-style __builtin_choose_expr
11310 case "$d_builtin_choose_expr" in
11313 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
11314 $cat >try.c <<'EOCP'
11315 #include <assert.h>
11316 #include <stdlib.h>
11319 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
11322 assert( SYRINX(1) == 2112 );
11323 assert( SYRINX(1) != 5150 );
11324 assert( SYRINX(0) == 5150 );
11325 assert( SYRINX(0) != 2112 );
11326 puts( "All good!" );
11332 if eval $compile && $run ./try; then
11333 echo "Your C compiler supports __builtin_choose_expr."
11336 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
11340 *) val="$d_builtin_choose_expr" ;;
11343 set d_builtin_choose_expr
11347 : Look for GCC-style __builtin_expect
11348 case "$d_builtin_expect" in
11351 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
11352 $cat >try.c <<'EOCP'
11355 if ( __builtin_expect(n, 0) ) n = 1;
11356 /* Remember shell exit code truth is 0, C truth is non-zero */
11361 if eval $compile && $run ./try; then
11362 echo "Your C compiler supports __builtin_expect."
11365 echo "Your C compiler doesn't seem to understand __builtin_expect."
11369 *) val="$d_builtin_expect" ;;
11372 set d_builtin_expect
11376 : see if bzero exists
11380 : see if stdarg is available
11382 if $test `./findhdr stdarg.h`; then
11383 echo "<stdarg.h> found." >&4
11386 echo "<stdarg.h> NOT found." >&4
11390 : see if varargs is available
11392 if $test `./findhdr varargs.h`; then
11393 echo "<varargs.h> found." >&4
11395 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
11398 : set up the varargs testing programs
11399 $cat > varargs.c <<EOP
11401 #include <stdarg.h>
11404 #include <varargs.h>
11408 int f(char *p, ...)
11422 p = va_arg(ap, char *);
11428 $cat > varargs <<EOP
11430 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
11439 : now check which varargs header should be included
11445 if `./varargs I_STDARG`; then
11447 elif `./varargs I_VARARGS`; then
11452 if `./varargs I_VARARGS`; then
11460 echo "*** WHOA THERE!!! ***" >&4
11461 echo " Your C compiler \"$cc\" doesn't seem to support stdarg or varargs!" >&4
11462 case "$knowitall" in
11464 echo " I'm giving up; maybe you can try again with a different compiler?" >&4
11468 echo "I could not find the definition for va_dcl... You have problems..." >&4
11469 val="$undef"; set i_stdarg; eval $setvar
11470 val="$undef"; set i_varargs; eval $setvar
11475 case "$i_varhdr" in
11477 val="$define"; set i_stdarg; eval $setvar
11478 val="$undef"; set i_varargs; eval $setvar
11481 val="$undef"; set i_stdarg; eval $setvar
11482 val="$define"; set i_varargs; eval $setvar
11485 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
11489 : see if the Compiler supports C99 variadic macros
11490 case "$i_stdarg$i_stdlib" in
11492 echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
11495 #include <stdarg.h>
11497 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
11501 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
11507 if eval $compile && $run ./try 2>&1 >/dev/null; then
11508 case "`$run ./try`" in
11510 echo "You have C99 variadic macros." >&4
11511 d_c99_variadic_macros="$define"
11514 echo "You don't have functional C99 variadic macros." >&4
11515 d_c99_variadic_macros="$undef"
11519 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
11520 d_c99_variadic_macros="$undef"
11525 echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
11526 d_c99_variadic_macros="$undef"
11530 : see if signal is declared as pointer to function returning int or void
11532 xxx=`./findhdr signal.h`
11533 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
11534 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
11535 echo "You have int (*signal())() instead of void." >&4
11537 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
11538 echo "You have void (*signal())()." >&4
11540 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
11541 echo "You have int (*signal())() instead of void." >&4
11543 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
11544 echo "You have void (*signal())()." >&4
11547 case "$d_voidsig" in
11549 echo "I can't determine whether signal handler returns void or int..." >&4
11551 rp="What type does your signal handler return?"
11554 v*) val="$define";;
11558 echo "As you already told me, signal handler returns void." >&4
11561 *) echo "As you already told me, signal handler returns int." >&4
11568 case "$d_voidsig" in
11569 "$define") signal_t="void";;
11570 *) signal_t="int";;
11574 : check for ability to cast large floats to 32-bit ints.
11576 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
11577 if $test "$intsize" -ge 4; then
11584 #$i_stdlib I_STDLIB
11586 #include <stdlib.h>
11588 #include <sys/types.h>
11589 #include <signal.h>
11590 $signal_t blech(int s) { exit(3); }
11597 signal(SIGFPE, blech);
11599 /* Don't let compiler optimize the test away. Store the number
11600 in a writable string for gcc to pass to sscanf under HP-UX.
11602 sprintf(str, "2147483647");
11603 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
11607 /* x86 processors will probably give 0x8000 0000, which is a
11608 sign change. We don't want that. We want to mimic SPARC
11609 behavior here, which is to preserve the sign and give
11612 if (i32 != ($xxx) f)
11618 if eval $compile_ok; then
11619 $run ./try 2>/dev/null
11622 echo "(I can't seem to compile the test program--assuming it can't)"
11627 echo "Yup, it can."
11630 echo "Nope, it can't."
11637 : check for ability to cast negative floats to unsigned
11639 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
11642 #$i_stdlib I_STDLIB
11644 #include <stdlib.h>
11646 #include <sys/types.h>
11647 #include <signal.h>
11648 $signal_t blech(int s) { exit(7); }
11649 $signal_t blech_in_list(int s) { exit(4); }
11650 unsigned long dummy_long(unsigned long p) { return p; }
11651 unsigned int dummy_int(unsigned int p) { return p; }
11652 unsigned short dummy_short(unsigned short p) { return p; }
11656 unsigned long along;
11658 unsigned short ashort;
11662 /* Frustrate gcc-2.7.2's optimizer which failed this test with
11663 a direct f = -123. assignment. gcc-2.8.0 reportedly
11664 optimized the whole file away
11666 /* Store the number in a writable string for gcc to pass to
11667 sscanf under HP-UX.
11669 sprintf(str, "-123");
11670 sscanf(str, "%lf", &f); /* f = -123.; */
11672 signal(SIGFPE, blech);
11673 along = (unsigned long)f;
11674 aint = (unsigned int)f;
11675 ashort = (unsigned short)f;
11676 if (along != (unsigned long)-123)
11678 if (aint != (unsigned int)-123)
11680 if (ashort != (unsigned short)-123)
11682 sprintf(str, "1073741824.");
11683 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
11686 along = (unsigned long)f;
11687 if (along != 0x80000000)
11691 along = (unsigned long)f;
11692 if (along != 0x7fffffff)
11696 along = (unsigned long)f;
11697 if (along != 0x80000001)
11701 signal(SIGFPE, blech_in_list);
11702 sprintf(str, "123.");
11703 sscanf(str, "%lf", &f); /* f = 123.; */
11704 along = dummy_long((unsigned long)f);
11705 aint = dummy_int((unsigned int)f);
11706 ashort = dummy_short((unsigned short)f);
11707 if (along != (unsigned long)123)
11709 if (aint != (unsigned int)123)
11711 if (ashort != (unsigned short)123)
11718 if eval $compile_ok; then
11719 $run ./try 2>/dev/null
11722 echo "(I can't seem to compile the test program--assuming it can't)"
11725 case "$castflags" in
11727 echo "Yup, it can."
11730 echo "Nope, it can't."
11737 : see if cbrt exists
11741 : see if vprintf exists
11743 if set vprintf val -f d_vprintf; eval $csym; $val; then
11744 echo 'vprintf() found.' >&4
11747 #$i_stdarg I_STDARG /* Only one of these can be defined by i_varhrd */
11748 #$i_varargs I_VARARGS
11750 #$i_stdlib I_STDLIB
11751 #$i_unistd I_UNISTD
11754 # include <stdarg.h>
11755 #else /* I_VARARGS */
11756 # include <varargs.h>
11760 # include <unistd.h>
11764 # include <stdlib.h>
11767 #include <stdio.h> /* vsprintf prototype */
11770 void xxx(int n, ...)
11775 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11777 int main() { xxx(1, "foo"); }
11779 #else /* I_VARARGS */
11787 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11789 int main() { xxx("foo"); }
11795 if eval $compile_ok; then
11796 if $run ./try; then
11797 echo "Your vsprintf() returns (int)." >&4
11800 echo "Your vsprintf() returns (char*)." >&4
11804 echo 'I am unable to compile the vsprintf() test program.' >&4
11805 # We shouldn't get here. If we do, assume the standard signature,
11806 # not the old BSD one.
11807 echo 'Guessing that vsprintf() returns (int).' >&4
11811 echo 'vprintf() NOT found.' >&4
11822 : see if chown exists
11826 : see if chroot exists
11827 set chroot d_chroot
11830 : see if chsize exists
11831 set chsize d_chsize
11834 : see if class exists
11838 : see if clearenv exists
11839 set clearenv d_clearenv
11842 : Define hasstruct macro for Configure internal use
11843 hasstruct='varname=$1; struct=$2; shift; shift;
11844 while $test $# -ge 2; do
11846 $define) echo "#include <$2>";;
11850 echo "int main () { struct $struct foo; }" >> try.c;
11852 if eval $compile; then
11861 : see whether socket exists
11865 $echo $n "Hmm... $c" >&4
11866 if set socket val -f d_socket; eval $csym; $val; then
11867 echo "Looks like you have Berkeley networking support." >&4
11869 if set setsockopt val -f; eval $csym; $val; then
11872 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
11873 d_oldsock="$define"
11876 if $contains socklib libc.list >/dev/null 2>&1; then
11877 echo "Looks like you have Berkeley networking support." >&4
11879 : we will have to assume that it supports the 4.2 BSD interface
11882 echo "You don't have Berkeley networking in libc$_a..." >&4
11883 if test "X$d_socket" = "X$define"; then
11884 echo "...but you seem to believe that you have sockets." >&4
11886 for net in net socket
11888 if test -f $sysroot/usr/lib/lib$net$_a; then
11889 ( ($nm $nm_opt $sysroot/usr/lib/lib$net$_a | eval $nm_extract) || \
11890 $ar t $sysroot/usr/lib/lib$net$_a) 2>/dev/null >> libc.list
11891 if $contains socket libc.list >/dev/null 2>&1; then
11896 echo "...but the Wollongong group seems to have hacked it in." >&4
11897 sockethdr="-I$sysroot/usr/netinclude"
11900 echo "Found Berkeley sockets interface in lib$net." >&4
11901 if $contains setsockopt libc.list >/dev/null 2>&1; then
11904 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
11905 d_oldsock="$define"
11911 if test "X$d_socket" != "X$define"; then
11912 echo "or anywhere else I see." >&4
11920 : see if socketpair exists
11921 set socketpair d_sockpair
11926 echo "Checking the availability sa_len in the sock struct ..." >&4
11928 #include <sys/types.h>
11929 #include <sys/socket.h>
11931 struct sockaddr sa;
11932 return (sa.sa_len);
11936 set try; if eval $compile; then
11939 set d_sockaddr_sa_len; eval $setvar
11943 echo "Checking the availability struct sockaddr_in6 ..." >&4
11945 #include <sys/types.h>
11946 #include <sys/socket.h>
11947 #include <netinet/in.h>
11949 struct sockaddr_in6 sin6;
11950 return (sin6.sin6_family);
11954 set try; if eval $compile; then
11957 set d_sockaddr_in6; eval $setvar
11961 echo "Checking the availability sin6_scope_id in struct sockaddr_in6 ..." >&4
11963 #include <sys/types.h>
11964 #include <sys/socket.h>
11965 #include <netinet/in.h>
11967 struct sockaddr_in6 sin6;
11968 return (sin6.sin6_scope_id);
11972 set try; if eval $compile; then
11975 set d_sin6_scope_id; eval $setvar
11979 echo "Checking the availability struct ip_mreq ..." >&4
11981 #include <sys/types.h>
11982 #include <sys/socket.h>
11983 #include <netinet/in.h>
11985 struct ip_mreq mreq;
11986 return (mreq.imr_multiaddr.s_addr);
11990 set try; if eval $compile; then
11993 set d_ip_mreq; eval $setvar
11997 echo "Checking the availability struct ip_mreq_source ..." >&4
11999 #include <sys/types.h>
12000 #include <sys/socket.h>
12001 #include <netinet/in.h>
12003 struct ip_mreq_source mreq;
12004 return (mreq.imr_multiaddr.s_addr);
12008 set try; if eval $compile; then
12011 set d_ip_mreq_source; eval $setvar
12015 echo "Checking the availability struct ipv6_mreq ..." >&4
12017 #include <sys/types.h>
12018 #include <sys/socket.h>
12019 #include <netinet/in.h>
12021 struct ipv6_mreq mreq;
12022 return (mreq.ipv6mr_interface);
12026 set try; if eval $compile; then
12029 set d_ipv6_mreq; eval $setvar
12033 echo "Checking the availability struct ipv6_mreq_source ..." >&4
12035 #include <sys/types.h>
12036 #include <sys/socket.h>
12037 #include <netinet/in.h>
12039 struct ipv6_mreq_source mreq;
12040 return (mreq.imr_multiaddr.s_addr);
12044 set try; if eval $compile; then
12047 set d_ipv6_mreq_source; eval $setvar
12051 echo "Checking the availability of certain socket constants..." >&4
12052 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
12053 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
12055 #include <sys/types.h>
12056 #include <sys/socket.h>
12062 set try; if eval $compile; then
12065 set d_${enum}; eval $setvar
12069 : see if this is a sys/uio.h system
12070 set sys/uio.h i_sysuio
12073 : Check for cmsghdr support
12075 echo "Checking to see if your system supports struct cmsghdr..." >&4
12076 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
12078 case "$d_cmsghdr_s" in
12079 "$define") echo "Yes, it does." ;;
12080 *) echo "No, it doesn't." ;;
12084 : check for const keyword
12086 echo 'Checking to see if your C compiler knows about "const"...' >&4
12087 $cat >const.c <<'EOCP'
12088 typedef struct spug { int drokk; } spug;
12092 const spug y = { 0 };
12095 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
12097 echo "Yup, it does."
12100 echo "Nope, it doesn't."
12105 : see if copysign exists
12106 set copysign d_copysign
12109 : see if copysignl exists
12110 set copysignl d_copysignl
12113 : see if crypt exists
12118 $define) cryptlib='' ;;
12119 *) if set crypt val -f d_crypt; eval $csym; $val; then
12120 echo 'crypt() found.' >&4
12124 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
12125 if $test -z "$cryptlib"; then
12126 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
12130 if $test -z "$cryptlib"; then
12131 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
12135 if $test -z "$cryptlib"; then
12136 cryptlib=`./loc libcrypt$_a "" $libpth`
12140 if $test -z "$cryptlib"; then
12141 echo 'crypt() NOT found.' >&4
12152 : see if this is a crypt.h system
12153 set crypt.h i_crypt
12156 : see if crypt_r exists
12157 set crypt_r d_crypt_r
12159 case "$d_crypt_r" in
12161 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
12162 case "$d_crypt_r_proto:$usethreads" in
12163 ":define") d_crypt_r_proto=define
12164 set d_crypt_r_proto crypt_r $hdrs
12168 case "$d_crypt_r_proto" in
12170 case "$crypt_r_proto" in
12171 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
12172 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCS ;;
12174 case "$crypt_r_proto" in
12175 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
12176 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCD ;;
12178 case "$crypt_r_proto" in
12179 ''|0) d_crypt_r=undef
12181 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
12182 * ) case "$crypt_r_proto" in
12183 REENTRANT_PROTO*) ;;
12184 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
12186 echo "Prototype: $try" ;;
12189 *) case "$usethreads" in
12190 define) echo "crypt_r has no prototype, not using it." >&4 ;;
12201 : get csh whereabouts
12203 'csh') val="$undef" ;;
12204 *) val="$define" ;;
12208 : Respect a hint or command line value for full_csh.
12209 case "$full_csh" in
12210 '') full_csh=$csh ;;
12213 : see if ctermid exists
12214 set ctermid d_ctermid
12217 : see if ctermid_r exists
12218 set ctermid_r d_ctermid_r
12220 case "$d_ctermid_r" in
12222 hdrs="$i_systypes sys/types.h define stdio.h "
12223 case "$d_ctermid_r_proto:$usethreads" in
12224 ":define") d_ctermid_r_proto=define
12225 set d_ctermid_r_proto ctermid_r $hdrs
12229 case "$d_ctermid_r_proto" in
12231 case "$ctermid_r_proto" in
12232 ''|0) try='char* ctermid_r(char*);'
12233 ./protochk "$extern_C $try" $hdrs && ctermid_r_proto=B_B ;;
12235 case "$ctermid_r_proto" in
12236 ''|0) d_ctermid_r=undef
12238 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
12239 * ) case "$ctermid_r_proto" in
12240 REENTRANT_PROTO*) ;;
12241 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
12243 echo "Prototype: $try" ;;
12246 *) case "$usethreads" in
12247 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
12254 *) ctermid_r_proto=0
12258 : see if ctime_r exists
12259 set ctime_r d_ctime_r
12261 case "$d_ctime_r" in
12263 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
12264 case "$d_ctime_r_proto:$usethreads" in
12265 ":define") d_ctime_r_proto=define
12266 set d_ctime_r_proto ctime_r $hdrs
12270 case "$d_ctime_r_proto" in
12272 case "$ctime_r_proto" in
12273 ''|0) try='char* ctime_r(const time_t*, char*);'
12274 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SB ;;
12276 case "$ctime_r_proto" in
12277 ''|0) try='char* ctime_r(const time_t*, char*, int);'
12278 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SBI ;;
12280 case "$ctime_r_proto" in
12281 ''|0) try='int ctime_r(const time_t*, char*);'
12282 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SB ;;
12284 case "$ctime_r_proto" in
12285 ''|0) try='int ctime_r(const time_t*, char*, int);'
12286 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SBI ;;
12288 case "$ctime_r_proto" in
12289 ''|0) d_ctime_r=undef
12291 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
12292 * ) case "$ctime_r_proto" in
12293 REENTRANT_PROTO*) ;;
12294 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
12296 echo "Prototype: $try" ;;
12299 *) case "$usethreads" in
12300 define) echo "ctime_r has no prototype, not using it." >&4 ;;
12311 : see if cuserid exists
12312 set cuserid d_cuserid
12315 : see if this is a limits.h system
12316 set limits.h i_limits
12319 : See if number of significant digits in a double precision number is known
12321 $cat >dbl_dig.c <<EOM
12322 #$i_limits I_LIMITS
12325 #include <limits.h>
12331 printf("Contains DBL_DIG");
12334 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
12335 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
12336 echo "DBL_DIG found." >&4
12339 echo "DBL_DIG NOT found." >&4
12346 : see if dbm.h is available
12347 : see if dbmclose exists
12348 set dbmclose d_dbmclose
12351 case "$d_dbmclose" in
12361 *) set rpcsvc/dbm.h i_rpcsvcdbm
12366 *) echo "We won't be including <dbm.h>"
12376 : see if prototype for dbminit is available
12378 set d_dbminitproto dbminit $i_dbm dbm.h
12381 : see if difftime exists
12382 set difftime d_difftime
12385 : see if this is a dirent system
12387 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
12389 echo "<dirent.h> found." >&4
12392 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
12393 echo "<sys/dir.h> found." >&4
12396 xinc=`./findhdr sys/ndir.h`
12398 echo "<dirent.h> NOT found." >&4
12403 : Look for type of directory structure.
12405 $cppstdin $cppflags $cppminus < "$xinc" > try.c
12407 case "$direntrytype" in
12409 case "$i_dirent" in
12410 $define) guess1='struct dirent' ;;
12411 *) guess1='struct direct' ;;
12414 *) guess1="$direntrytype"
12419 'struct dirent') guess2='struct direct' ;;
12420 *) guess2='struct dirent' ;;
12423 if $contains "$guess1" try.c >/dev/null 2>&1; then
12424 direntrytype="$guess1"
12425 echo "Your directory entries are $direntrytype." >&4
12426 elif $contains "$guess2" try.c >/dev/null 2>&1; then
12427 direntrytype="$guess2"
12428 echo "Your directory entries seem to be $direntrytype." >&4
12430 echo "I don't recognize your system's directory entries." >&4
12431 rp="What type is used for directory entries on this system?"
12434 direntrytype="$ans"
12438 : see if the directory entry stores field length
12440 $cppstdin $cppflags $cppminus < "$xinc" > try.c
12441 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
12442 echo "Good, your directory entry keeps length information in d_namlen." >&4
12445 echo "Your directory entry does not know about the d_namlen field." >&4
12452 : Look for DIR.dd_fd
12453 case "$i_dirent" in
12455 echo "Checking to see if DIR has a dd_fd member variable" >&4
12457 #$i_stdlib I_STDLIB
12459 #include <stdlib.h>
12461 #include <dirent.h>
12471 if eval $compile; then
12472 echo "Yes, it does."
12475 echo "No, it does not."
12480 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
12488 : see if this is an sysdir system
12489 set sys/dir.h i_sysdir
12492 : see if this is an sysndir system
12493 set sys/ndir.h i_sysndir
12498 $cat >dirfd.c <<EOM
12500 #$i_stdlib I_STDLIB
12502 #include <stdlib.h>
12504 #$i_dirent I_DIRENT /**/
12505 #$i_sysdir I_SYS_DIR /**/
12506 #$i_sysndir I_SYS_NDIR /**/
12507 #$i_systypes I_SYS_TYPES /**/
12508 #if defined(I_SYS_TYPES)
12509 #include <sys/types.h>
12511 #if defined(I_DIRENT)
12512 #include <dirent.h>
12515 #include <sys/ndir.h>
12519 #include <ndir.h> /* may be wrong in the future */
12521 #include <sys/dir.h>
12527 DIR *dirp = opendir(".");
12528 if (dirfd(dirp) >= 0)
12536 if eval $compile; then
12540 $define) echo "dirfd() found." >&4 ;;
12541 *) echo "dirfd() NOT found." >&4 ;;
12547 : see if dladdr exists
12548 set dladdr d_dladdr
12551 : see if dlerror exists
12554 set dlerror d_dlerror
12558 : see if dlfcn is available
12559 set dlfcn.h i_dlfcn
12562 : Check what extension to use for shared libs
12567 On a few systems, the dynamically loaded modules that perl generates and uses
12568 will need a different extension than shared libs. The default will probably
12574 *) dflt="$dlext" ;;
12576 rp='What is the extension of dynamically loaded modules'
12585 : Check if dlsym need a leading underscore
12591 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
12592 $cat >dyna.c <<'EOM'
12599 #$i_stdlib I_STDLIB
12601 #include <stdlib.h>
12605 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
12607 #include <sys/types.h>
12612 extern int fred() ;
12621 int mode = RTLD_LAZY ;
12623 handle = dlopen("./dyna.$dlext", mode) ;
12624 if (handle == NULL) {
12629 symbol = dlsym(handle, "fred") ;
12630 if (symbol == NULL) {
12631 /* try putting a leading underscore */
12632 symbol = dlsym(handle, "_fred") ;
12633 if (symbol == NULL) {
12646 : Call the object file tmp-dyna.o in case dlext=o.
12647 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
12648 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
12649 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
12650 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
12653 1) echo "Test program failed using dlopen." >&4
12654 echo "Perhaps you should not use dynamic loading." >&4;;
12655 2) echo "Test program failed using dlsym." >&4
12656 echo "Perhaps you should not use dynamic loading." >&4;;
12657 3) echo "dlsym needs a leading underscore" >&4
12659 4) echo "dlsym doesn't need a leading underscore." >&4;;
12662 echo "I can't compile and run the test program." >&4
12663 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
12668 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
12673 : see if drand48_r exists
12674 set drand48_r d_drand48_r
12676 case "$d_drand48_r" in
12678 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
12679 case "$d_drand48_r_proto:$usethreads" in
12680 ":define") d_drand48_r_proto=define
12681 set d_drand48_r_proto drand48_r $hdrs
12685 case "$d_drand48_r_proto" in
12687 case "$drand48_r_proto" in
12688 ''|0) try='int drand48_r(struct drand48_data*, double*);'
12689 ./protochk "$extern_C $try" $hdrs && drand48_r_proto=I_ST ;;
12691 case "$drand48_r_proto" in
12692 ''|0) d_drand48_r=undef
12694 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
12695 * ) case "$drand48_r_proto" in
12696 REENTRANT_PROTO*) ;;
12697 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
12699 echo "Prototype: $try" ;;
12702 *) case "$usethreads" in
12703 define) echo "drand48_r has no prototype, not using it." >&4 ;;
12710 *) drand48_r_proto=0
12714 : see if prototype for drand48 is available
12716 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
12719 : see if dup2 exists
12723 : see if eaccess exists
12724 set eaccess d_eaccess
12727 : see if endgrent exists
12728 set endgrent d_endgrent
12731 : see if this is an grp system
12737 xxx=`./findhdr grp.h`
12738 $cppstdin $cppflags $cppminus < $xxx >$$.h
12740 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
12752 set d_grpasswd; eval $setvar
12756 : see if endgrent_r exists
12757 set endgrent_r d_endgrent_r
12759 case "$d_endgrent_r" in
12761 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12762 case "$d_endgrent_r_proto:$usethreads" in
12763 ":define") d_endgrent_r_proto=define
12764 set d_endgrent_r_proto endgrent_r $hdrs
12768 case "$d_endgrent_r_proto" in
12770 case "$endgrent_r_proto" in
12771 ''|0) try='int endgrent_r(FILE**);'
12772 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=I_H ;;
12774 case "$endgrent_r_proto" in
12775 ''|0) try='void endgrent_r(FILE**);'
12776 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=V_H ;;
12778 case "$endgrent_r_proto" in
12779 ''|0) d_endgrent_r=undef
12781 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
12782 * ) case "$endgrent_r_proto" in
12783 REENTRANT_PROTO*) ;;
12784 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
12786 echo "Prototype: $try" ;;
12789 *) case "$usethreads" in
12790 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
12797 *) endgrent_r_proto=0
12801 : see if endhostent exists
12802 set endhostent d_endhent
12805 : see if this is a netdb.h system
12806 set netdb.h i_netdb
12809 : see if endhostent_r exists
12810 set endhostent_r d_endhostent_r
12812 case "$d_endhostent_r" in
12814 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12815 case "$d_endhostent_r_proto:$usethreads" in
12816 ":define") d_endhostent_r_proto=define
12817 set d_endhostent_r_proto endhostent_r $hdrs
12821 case "$d_endhostent_r_proto" in
12823 case "$endhostent_r_proto" in
12824 ''|0) try='int endhostent_r(struct hostent_data*);'
12825 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=I_D ;;
12827 case "$endhostent_r_proto" in
12828 ''|0) try='void endhostent_r(struct hostent_data*);'
12829 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=V_D ;;
12831 case "$endhostent_r_proto" in
12832 ''|0) d_endhostent_r=undef
12833 endhostent_r_proto=0
12834 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
12835 * ) case "$endhostent_r_proto" in
12836 REENTRANT_PROTO*) ;;
12837 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
12839 echo "Prototype: $try" ;;
12842 *) case "$usethreads" in
12843 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
12845 d_endhostent_r=undef
12846 endhostent_r_proto=0
12850 *) endhostent_r_proto=0
12854 : see if endnetent exists
12855 set endnetent d_endnent
12858 : see if endnetent_r exists
12859 set endnetent_r d_endnetent_r
12861 case "$d_endnetent_r" in
12863 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12864 case "$d_endnetent_r_proto:$usethreads" in
12865 ":define") d_endnetent_r_proto=define
12866 set d_endnetent_r_proto endnetent_r $hdrs
12870 case "$d_endnetent_r_proto" in
12872 case "$endnetent_r_proto" in
12873 ''|0) try='int endnetent_r(struct netent_data*);'
12874 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=I_D ;;
12876 case "$endnetent_r_proto" in
12877 ''|0) try='void endnetent_r(struct netent_data*);'
12878 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=V_D ;;
12880 case "$endnetent_r_proto" in
12881 ''|0) d_endnetent_r=undef
12882 endnetent_r_proto=0
12883 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
12884 * ) case "$endnetent_r_proto" in
12885 REENTRANT_PROTO*) ;;
12886 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
12888 echo "Prototype: $try" ;;
12891 *) case "$usethreads" in
12892 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
12894 d_endnetent_r=undef
12895 endnetent_r_proto=0
12899 *) endnetent_r_proto=0
12903 : see if endprotoent exists
12904 set endprotoent d_endpent
12907 : see if endprotoent_r exists
12908 set endprotoent_r d_endprotoent_r
12910 case "$d_endprotoent_r" in
12912 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12913 case "$d_endprotoent_r_proto:$usethreads" in
12914 ":define") d_endprotoent_r_proto=define
12915 set d_endprotoent_r_proto endprotoent_r $hdrs
12919 case "$d_endprotoent_r_proto" in
12921 case "$endprotoent_r_proto" in
12922 ''|0) try='int endprotoent_r(struct protoent_data*);'
12923 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=I_D ;;
12925 case "$endprotoent_r_proto" in
12926 ''|0) try='void endprotoent_r(struct protoent_data*);'
12927 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=V_D ;;
12929 case "$endprotoent_r_proto" in
12930 ''|0) d_endprotoent_r=undef
12931 endprotoent_r_proto=0
12932 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
12933 * ) case "$endprotoent_r_proto" in
12934 REENTRANT_PROTO*) ;;
12935 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
12937 echo "Prototype: $try" ;;
12940 *) case "$usethreads" in
12941 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
12943 d_endprotoent_r=undef
12944 endprotoent_r_proto=0
12948 *) endprotoent_r_proto=0
12952 : see if endpwent exists
12953 set endpwent d_endpwent
12956 : see if this is a pwd.h system
12962 xxx=`./findhdr pwd.h`
12963 $cppstdin $cppflags $cppminus < $xxx >$$.h
12965 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
12973 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
12981 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
12989 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
12997 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
13005 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
13013 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
13021 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
13033 set d_pwquota; eval $setvar
13034 set d_pwage; eval $setvar
13035 set d_pwchange; eval $setvar
13036 set d_pwclass; eval $setvar
13037 set d_pwexpire; eval $setvar
13038 set d_pwcomment; eval $setvar
13039 set d_pwgecos; eval $setvar
13040 set d_pwpasswd; eval $setvar
13044 : see if endpwent_r exists
13045 set endpwent_r d_endpwent_r
13047 case "$d_endpwent_r" in
13049 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13050 case "$d_endpwent_r_proto:$usethreads" in
13051 ":define") d_endpwent_r_proto=define
13052 set d_endpwent_r_proto endpwent_r $hdrs
13056 case "$d_endpwent_r_proto" in
13058 case "$endpwent_r_proto" in
13059 ''|0) try='int endpwent_r(FILE**);'
13060 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=I_H ;;
13062 case "$endpwent_r_proto" in
13063 ''|0) try='void endpwent_r(FILE**);'
13064 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=V_H ;;
13066 case "$endpwent_r_proto" in
13067 ''|0) d_endpwent_r=undef
13069 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
13070 * ) case "$endpwent_r_proto" in
13071 REENTRANT_PROTO*) ;;
13072 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
13074 echo "Prototype: $try" ;;
13077 *) case "$usethreads" in
13078 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
13085 *) endpwent_r_proto=0
13089 : see if endservent exists
13090 set endservent d_endsent
13093 : see if endservent_r exists
13094 set endservent_r d_endservent_r
13096 case "$d_endservent_r" in
13098 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13099 case "$d_endservent_r_proto:$usethreads" in
13100 ":define") d_endservent_r_proto=define
13101 set d_endservent_r_proto endservent_r $hdrs
13105 case "$d_endservent_r_proto" in
13107 case "$endservent_r_proto" in
13108 ''|0) try='int endservent_r(struct servent_data*);'
13109 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=I_D ;;
13111 case "$endservent_r_proto" in
13112 ''|0) try='void endservent_r(struct servent_data*);'
13113 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=V_D ;;
13115 case "$endservent_r_proto" in
13116 ''|0) d_endservent_r=undef
13117 endservent_r_proto=0
13118 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
13119 * ) case "$endservent_r_proto" in
13120 REENTRANT_PROTO*) ;;
13121 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
13123 echo "Prototype: $try" ;;
13126 *) case "$usethreads" in
13127 define) echo "endservent_r has no prototype, not using it." >&4 ;;
13129 d_endservent_r=undef
13130 endservent_r_proto=0
13134 *) endservent_r_proto=0
13138 : Locate the flags for 'open()'
13141 #include <sys/types.h>
13146 #include <sys/file.h>
13148 #$i_stdlib I_STDLIB
13150 #include <stdlib.h>
13161 : check sys/file.h first to get FREAD on Sun
13162 if $test `./findhdr sys/file.h` && \
13163 set try -DI_SYS_FILE && eval $compile; then
13165 echo "<sys/file.h> defines the O_* constants..." >&4
13166 if $run ./try; then
13167 echo "and you have the 3 argument form of open()." >&4
13170 echo "but not the 3 argument form of open(). Oh, well." >&4
13173 elif $test `./findhdr fcntl.h` && \
13174 set try -DI_FCNTL && eval $compile; then
13176 echo "<fcntl.h> defines the O_* constants..." >&4
13177 if $run ./try; then
13178 echo "and you have the 3 argument form of open()." >&4
13181 echo "but not the 3 argument form of open(). Oh, well." >&4
13186 echo "I can't find the O_* constant definitions! You got problems." >&4
13192 : see if this is a sys/file.h system
13197 : do we need to include sys/file.h ?
13201 if $h_sysfile; then
13203 echo "We'll be including <sys/file.h>." >&4
13206 echo "We won't be including <sys/file.h>." >&4
13216 : see if fcntl.h is there
13221 : see if we can include fcntl.h
13227 echo "We'll be including <fcntl.h>." >&4
13230 if $h_sysfile; then
13231 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
13233 echo "We won't be including <fcntl.h>." >&4
13245 : see if fork exists
13249 : see if pipe exists
13253 : check for non-blocking I/O stuff
13254 case "$h_sysfile" in
13255 true) echo "#include <sys/file.h>" > head.c;;
13258 true) echo "#include <fcntl.h>" > head.c;;
13259 *) echo "#include <sys/fcntl.h>" > head.c;;
13264 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
13265 case "$o_nonblock" in
13267 $cat head.c > try.c
13268 $cat >>try.c <<EOCP
13270 #$i_stdlib I_STDLIB
13272 #include <stdlib.h>
13280 printf("O_NONBLOCK\n");
13284 printf("O_NDELAY\n");
13288 printf("FNDELAY\n");
13295 if eval $compile_ok; then
13296 o_nonblock=`$run ./try`
13297 case "$o_nonblock" in
13298 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
13299 *) echo "Seems like we can use $o_nonblock.";;
13302 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
13305 *) echo "Using $hint value $o_nonblock.";;
13310 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
13313 case "$d_fork:$d_pipe:$d_alarm" in
13315 $cat head.c > try.c
13316 $cat >>try.c <<EOCP
13318 #include <sys/types.h>
13319 #include <signal.h>
13321 #$i_stdlib I_STDLIB
13323 #include <stdlib.h>
13329 #define MY_O_NONBLOCK $o_nonblock
13330 #ifndef errno /* XXX need better Configure test */
13333 #$i_unistd I_UNISTD
13335 #include <unistd.h>
13337 #$i_string I_STRING
13339 #include <string.h>
13341 #include <strings.h>
13343 $signal_t blech(int x) { exit(3); }
13345 $cat >> try.c <<'EOCP'
13354 ret = pipe(pd); /* Down: child -> parent */
13357 ret = pipe(pu); /* Up: parent -> child */
13361 close(pd[1]); /* Parent reads from pd[0] */
13362 close(pu[0]); /* Parent writes (blocking) to pu[1] */
13364 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
13369 signal(SIGALRM, blech);
13371 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
13373 sprintf(string, "%d\n", ret);
13374 ret = write(2, string, strlen(string));
13375 if (ret != strlen(string))
13379 if (errno == EAGAIN) {
13380 printf("EAGAIN\n");
13385 if (errno == EWOULDBLOCK)
13386 printf("EWOULDBLOCK\n");
13389 ret = write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
13392 sleep(2); /* Give it time to close our pipe */
13394 ret = read(pd[0], buf, 1); /* Should read EOF */
13396 sprintf(string, "%d\n", ret);
13397 ret = write(4, string, strlen(string));
13398 if (ret != strlen(string))
13403 close(pd[0]); /* We write to pd[1] */
13404 close(pu[1]); /* We read from pu[0] */
13405 ret = read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
13408 close(pd[1]); /* Pipe pd is now fully closed! */
13409 exit(0); /* Bye bye, thank you for playing! */
13413 if eval $compile_ok; then
13414 echo "$startsh" >mtry
13415 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
13417 $run ./mtry >/dev/null 2>&1
13419 0) eagain=`$cat try.out`;;
13420 1) echo "Could not perform non-blocking setting!";;
13421 2) echo "I did a successful read() for something that was not there!";;
13422 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
13423 4) echo "Could not find F_SETFL!";;
13424 *) echo "Something terribly wrong happened during testing.";;
13426 rd_nodata=`$cat try.ret`
13427 echo "A read() system call with no data present returns $rd_nodata."
13428 case "$rd_nodata" in
13431 echo "(That's peculiar, fixing that to be -1.)"
13437 echo "Forcing errno EAGAIN on read() with no data available."
13441 echo "Your read() sets errno to $eagain when no data is available."
13444 status=`$cat try.err`
13446 0) echo "And it correctly returns 0 to signal EOF.";;
13447 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
13448 *) echo "However, your read() returns '$status' on EOF??";;
13451 if test "$status" = "$rd_nodata"; then
13452 echo "WARNING: you can't distinguish between EOF and no data!"
13456 echo "I can't compile the test program--assuming errno EAGAIN will do."
13460 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
13469 echo "Using $hint value $eagain."
13470 echo "Your read() returns $rd_nodata when no data is present."
13471 case "$d_eofnblk" in
13472 "$define") echo "And you can see EOF because read() returns 0.";;
13473 "$undef") echo "But you can't see EOF status from read() returned value.";;
13475 echo "(Assuming you can't see EOF status from read anyway.)"
13481 $rm_try head.c mtry
13483 : see if erf exists
13487 : see if erfc exists
13491 : see if exp2 exists
13495 : see if expm1 exists
13499 : see if _ptr and _cnt from stdio act std
13502 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
13503 echo "(Looks like you have stdio.h from BSD.)"
13504 case "$stdio_ptr" in
13505 '') stdio_ptr='((fp)->_p)'
13508 *) ptr_lval=$d_stdio_ptr_lval;;
13510 case "$stdio_cnt" in
13511 '') stdio_cnt='((fp)->_r)'
13514 *) cnt_lval=$d_stdio_cnt_lval;;
13516 case "$stdio_base" in
13517 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
13519 case "$stdio_bufsiz" in
13520 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
13522 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
13523 echo "(Looks like you have stdio.h from Linux.)"
13524 case "$stdio_ptr" in
13525 '') stdio_ptr='((fp)->_IO_read_ptr)'
13528 *) ptr_lval=$d_stdio_ptr_lval;;
13530 case "$stdio_cnt" in
13531 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
13534 *) cnt_lval=$d_stdio_cnt_lval;;
13536 case "$stdio_base" in
13537 '') stdio_base='((fp)->_IO_read_base)';;
13539 case "$stdio_bufsiz" in
13540 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
13543 case "$stdio_ptr" in
13544 '') stdio_ptr='((fp)->_ptr)'
13547 *) ptr_lval=$d_stdio_ptr_lval;;
13549 case "$stdio_cnt" in
13550 '') stdio_cnt='((fp)->_cnt)'
13553 *) cnt_lval=$d_stdio_cnt_lval;;
13555 case "$stdio_base" in
13556 '') stdio_base='((fp)->_base)';;
13558 case "$stdio_bufsiz" in
13559 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
13563 : test whether _ptr and _cnt really work
13564 echo "Checking how std your stdio is..." >&4
13567 #$i_stdlib I_STDLIB
13569 #include <stdlib.h>
13571 #define FILE_ptr(fp) $stdio_ptr
13572 #define FILE_cnt(fp) $stdio_cnt
13574 FILE *fp = fopen("try.c", "r");
13577 18 <= FILE_cnt(fp) &&
13578 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13586 if eval $compile && $to try.c; then
13587 if $run ./try; then
13588 echo "Your stdio acts pretty std."
13591 echo "Your stdio isn't very std."
13594 echo "Your stdio doesn't appear very std."
13598 # glibc 2.2.90 and above apparently change stdio streams so Perl's
13599 # direct buffer manipulation no longer works. The Configure tests
13600 # should be changed to correctly detect this, but until then,
13601 # the following check should at least let perl compile and run.
13602 # (This quick fix should be updated before 5.8.1.)
13603 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
13604 # A. Dougherty, June 3, 2002.
13605 case "$d_gnulibc" in
13607 case "$gnulibc_version" in
13611 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
13620 : Can _ptr be used as an lvalue?
13621 case "$d_stdstdio$ptr_lval" in
13622 $define$define) val=$define ;;
13625 set d_stdio_ptr_lval
13628 : Can _cnt be used as an lvalue?
13629 case "$d_stdstdio$cnt_lval" in
13630 $define$define) val=$define ;;
13633 set d_stdio_cnt_lval
13637 : test whether setting _ptr sets _cnt as a side effect
13638 d_stdio_ptr_lval_sets_cnt="$undef"
13639 d_stdio_ptr_lval_nochange_cnt="$undef"
13640 case "$d_stdio_ptr_lval$d_stdstdio" in
13642 echo "Checking to see what happens if we set the stdio ptr..." >&4
13645 /* Can we scream? */
13646 /* Eat dust sed :-) */
13647 /* In the buffer space, no one can hear you scream. */
13648 #$i_stdlib I_STDLIB
13650 #include <stdlib.h>
13652 #define FILE_ptr(fp) $stdio_ptr
13653 #define FILE_cnt(fp) $stdio_cnt
13654 #include <sys/types.h>
13656 FILE *fp = fopen("try.c", "r");
13661 puts("Fail even to read");
13664 c = getc(fp); /* Read away the first # */
13666 puts("Fail even to read");
13670 18 <= FILE_cnt(fp) &&
13671 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13673 puts("Fail even to read");
13676 ptr = (char*) FILE_ptr(fp);
13677 cnt = (size_t)FILE_cnt(fp);
13679 FILE_ptr(fp) += 42;
13681 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
13682 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
13685 if (FILE_cnt(fp) <= 20) {
13686 printf ("Fail (<20 chars to test)");
13689 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
13690 puts("Fail compare");
13693 if (cnt == FILE_cnt(fp)) {
13694 puts("Pass_unchanged");
13697 if (FILE_cnt(fp) == (cnt - 42)) {
13698 puts("Pass_changed");
13701 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
13707 if eval $compile && $to try.c; then
13708 case `$run ./try` in
13710 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
13711 d_stdio_ptr_lval_sets_cnt="$define" ;;
13713 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
13714 d_stdio_ptr_lval_nochange_cnt="$define" ;;
13716 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
13718 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
13721 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
13727 : see if _base is also standard
13729 case "$d_stdstdio" in
13733 #$i_stdlib I_STDLIB
13735 #include <stdlib.h>
13737 #define FILE_base(fp) $stdio_base
13738 #define FILE_bufsiz(fp) $stdio_bufsiz
13740 FILE *fp = fopen("try.c", "r");
13743 19 <= FILE_bufsiz(fp) &&
13744 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
13751 if eval $compile && $to try.c; then
13752 if $run ./try; then
13753 echo "And its _base field acts std."
13756 echo "But its _base field isn't std."
13759 echo "However, it seems to be lacking the _base field."
13767 : see if fast_stdio exists
13769 case "$d_stdstdio:$d_stdio_ptr_lval" in
13771 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
13773 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
13784 : see if fchdir exists
13785 set fchdir d_fchdir
13788 : see if fchmod exists
13789 set fchmod d_fchmod
13792 : see if fchown exists
13793 set fchown d_fchown
13796 : see if this is an fcntl system
13800 : See if fcntl-based locking works.
13803 #$i_stdlib I_STDLIB
13805 #include <stdlib.h>
13807 #include <unistd.h>
13809 #include <signal.h>
13810 $signal_t blech(int x) { exit(3); }
13812 #if defined(F_SETLK) && defined(F_SETLKW)
13813 struct flock flock;
13815 fd = open("try.c", O_RDONLY);
13816 flock.l_type = F_RDLCK;
13817 flock.l_whence = SEEK_SET;
13818 flock.l_start = flock.l_len = 0;
13819 signal(SIGALRM, blech);
13821 retval = fcntl(fd, F_SETLK, &flock);
13823 (retval < 0 ? exit(2) : exit(0));
13829 echo "Checking if fcntl-based file locking works... "
13833 if eval $compile_ok; then
13834 if $run ./try; then
13835 echo "Yes, it seems to work."
13838 echo "Nope, it didn't work."
13843 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
13844 *** This is (almost) impossible.
13845 *** If your NFS lock daemons are not feeling well, something like
13846 *** this may happen, please investigate. Cannot continue, aborting.
13854 echo "I'm unable to compile the test program, so I'll assume not."
13859 echo "Nope, since you don't even have fcntl()."
13862 set d_fcntl_can_lock
13866 : check for fd_set items
13869 Checking to see how well your C compiler handles fd_set and friends ...
13872 #$i_stdlib I_STDLIB
13874 #include <stdlib.h>
13876 #$i_systime I_SYS_TIME
13877 #$i_sysselct I_SYS_SELECT
13878 #$d_socket HAS_SOCKET
13879 #include <sys/types.h>
13881 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
13884 #include <sys/time.h>
13886 #ifdef I_SYS_SELECT
13887 #include <sys/select.h>
13896 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
13904 if eval $compile; then
13905 d_fds_bits="$define"
13907 echo "Well, your system knows about the normal fd_set typedef..." >&4
13908 if $run ./try; then
13909 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
13910 d_fd_macros="$define"
13913 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
13915 d_fd_macros="$undef"
13919 Hmm, your compiler has some difficulty with fd_set. Checking further...
13922 if eval $compile; then
13923 d_fds_bits="$undef"
13925 echo "Well, your system has some sort of fd_set available..." >&4
13926 if $run ./try; then
13927 echo "and you have the normal fd_set macros." >&4
13928 d_fd_macros="$define"
13931 but not the normal fd_set macros! Gross! More work for me...
13933 d_fd_macros="$undef"
13936 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
13938 d_fds_bits="$undef"
13939 d_fd_macros="$undef"
13944 : see if fdim exists
13948 : see if fegetround exists
13949 set fegetround d_fegetround
13952 : see if fgetpos exists
13953 set fgetpos d_fgetpos
13956 : see if finite exists
13957 set finite d_finite
13960 : see if finitel exists
13961 set finitel d_finitel
13964 : see if flock exists
13968 : see if prototype for flock is available
13970 set d_flockproto flock $i_sysfile sys/file.h
13973 : see if fma exists
13977 : see if fmax exists
13981 : see if fmin exists
13985 : see if fp_class exists
13986 set fp_class d_fp_class
13989 : see if this is a math.h system
13993 : check for fpclassify
13994 echo "Checking to see if you have fpclassify..." >&4
14000 int main() { return fpclassify(1.0) == FP_NORMAL ? 0 : 1; }
14003 if eval $compile; then
14005 echo "You have fpclassify."
14008 echo "You do not have fpclassify."
14014 : see if fp_classify exists
14015 set fp_classify d_fp_classify
14018 : see if fp_classl exists
14019 set fp_classl d_fp_classl
14022 : see if pathconf exists
14023 set pathconf d_pathconf
14026 : see if fpathconf exists
14027 set fpathconf d_fpathconf
14030 : see if fpclass exists
14031 set fpclass d_fpclass
14034 : see if fpclassl exists
14035 set fpclassl d_fpclassl
14038 : see if fpgetround exists
14039 set fpgetround d_fpgetround
14042 : check for fpos64_t
14044 echo "Checking to see if you have fpos64_t..." >&4
14047 int main() { fpos64_t x = 7; }
14050 if eval $compile; then
14052 echo "You have fpos64_t."
14055 echo "You do not have fpos64_t."
14056 case "$fpossize" in
14057 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
14064 : see if frexpl exists
14065 set frexpl d_frexpl
14068 : see if this is a sys/param system
14069 set sys/param.h i_sysparam
14072 : see if fseeko exists
14073 set fseeko d_fseeko
14075 case "$longsize" in
14076 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
14079 : see if fsetpos exists
14080 set fsetpos d_fsetpos
14083 : see if fsync exists
14087 : see if ftello exists
14088 set ftello d_ftello
14090 case "$longsize" in
14091 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
14094 : check for a working futimes
14097 echo "Checking if you have a working futimes()" >&4
14100 #include <sys/time.h>
14107 fd = open ("try.c", O_RDWR);
14108 if (-1 == fd) exit (1);
14109 rv = futimes (fd, NULL);
14110 exit (rv == -1 ? errno : 0);
14114 if eval $compile; then
14118 0) echo "Yes, you have" >&4
14119 d_futimes="$define"
14121 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
14125 echo "No, it does not (probably harmless)" >&4
14129 : see if ndbm.h is available
14132 : Compatibility location for RedHat 7.1
14133 set gdbm/ndbm.h i_gdbmndbm
14135 : Compatibility location for Debian 4.0
14136 set gdbm-ndbm.h i_gdbm_ndbm
14140 if $test "$i_ndbm" = "$define" -o "$i_gdbmndbm" = "$define" -o "$i_gdbm_ndbm" = "$define"; then
14141 : see if dbm_open exists
14142 set dbm_open d_dbm_open
14144 case "$d_dbm_open" in
14147 i_gdbmndbm="$undef"
14148 i_gdbm_ndbm="$undef"
14149 echo "We won't be including <ndbm.h>"
14159 ndbm_hdr_protochk='name=$1; hdr=$2;
14160 eval "ihdr=\$""i_$name";
14162 if $test "$ihdr" = "$define"; then
14163 $echo "Checking if your <$hdr> uses prototypes..." >&4;
14164 case "$d_cplusplus" in
14165 $define) ./protochk "$extern_C void dbm_close(DBM *);" literal "extern \"C\" {" $ihdr $hdr literal "}" && val="$define" ;;
14166 *) ./protochk "$extern_C void dbm_close(int, int);" $ihdr $hdr || val="$define" ;;
14169 $define) $echo "Your <$hdr> seems to have prototypes";;
14170 *) $echo "Your <$hdr> does not seem to have prototypes";;
14173 set "d_${name}_h_uses_prototypes";
14177 eval $ndbm_hdr_protochk
14178 set gdbmndbm gdbm/ndbm.h
14179 eval $ndbm_hdr_protochk
14180 set gdbm_ndbm gdbm-ndbm.h
14181 eval $ndbm_hdr_protochk
14183 : see if getaddrinfo exists
14184 set getaddrinfo d_getaddrinfo
14187 : see if getcwd exists
14188 set getcwd d_getcwd
14191 : see if getespwnam exists
14192 set getespwnam d_getespwnam
14195 : see if getgrent exists
14196 set getgrent d_getgrent
14199 : see if getgrent_r exists
14200 set getgrent_r d_getgrent_r
14202 case "$d_getgrent_r" in
14204 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14205 case "$d_getgrent_r_proto:$usethreads" in
14206 ":define") d_getgrent_r_proto=define
14207 set d_getgrent_r_proto getgrent_r $hdrs
14211 case "$d_getgrent_r_proto" in
14213 case "$getgrent_r_proto" in
14214 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
14215 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBWR ;;
14217 case "$getgrent_r_proto" in
14218 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
14219 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIR ;;
14221 case "$getgrent_r_proto" in
14222 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
14223 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBW ;;
14225 case "$getgrent_r_proto" in
14226 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
14227 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBI ;;
14229 case "$getgrent_r_proto" in
14230 ''|0) try='int getgrent_r(struct group*, char*, int);'
14231 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBI ;;
14233 case "$getgrent_r_proto" in
14234 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
14235 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIH ;;
14237 case "$getgrent_r_proto" in
14238 ''|0) d_getgrent_r=undef
14240 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
14241 * ) case "$getgrent_r_proto" in
14242 REENTRANT_PROTO*) ;;
14243 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
14245 echo "Prototype: $try" ;;
14248 *) case "$usethreads" in
14249 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
14256 *) getgrent_r_proto=0
14260 : see if getgrgid_r exists
14261 set getgrgid_r d_getgrgid_r
14263 case "$d_getgrgid_r" in
14265 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14266 case "$d_getgrgid_r_proto:$usethreads" in
14267 ":define") d_getgrgid_r_proto=define
14268 set d_getgrgid_r_proto getgrgid_r $hdrs
14272 case "$d_getgrgid_r_proto" in
14274 case "$getgrgid_r_proto" in
14275 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
14276 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
14278 case "$getgrgid_r_proto" in
14279 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
14280 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
14282 case "$getgrgid_r_proto" in
14283 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
14284 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
14286 case "$getgrgid_r_proto" in
14287 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
14288 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
14290 case "$getgrgid_r_proto" in
14291 ''|0) d_getgrgid_r=undef
14293 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
14294 * ) case "$getgrgid_r_proto" in
14295 REENTRANT_PROTO*) ;;
14296 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
14298 echo "Prototype: $try" ;;
14301 *) case "$usethreads" in
14302 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
14309 *) getgrgid_r_proto=0
14313 : see if getgrnam_r exists
14314 set getgrnam_r d_getgrnam_r
14316 case "$d_getgrnam_r" in
14318 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14319 case "$d_getgrnam_r_proto:$usethreads" in
14320 ":define") d_getgrnam_r_proto=define
14321 set d_getgrnam_r_proto getgrnam_r $hdrs
14325 case "$d_getgrnam_r_proto" in
14327 case "$getgrnam_r_proto" in
14328 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
14329 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
14331 case "$getgrnam_r_proto" in
14332 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
14333 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
14335 case "$getgrnam_r_proto" in
14336 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
14337 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CBI ;;
14339 case "$getgrnam_r_proto" in
14340 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
14341 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
14343 case "$getgrnam_r_proto" in
14344 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
14345 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
14347 case "$getgrnam_r_proto" in
14348 ''|0) d_getgrnam_r=undef
14350 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
14351 * ) case "$getgrnam_r_proto" in
14352 REENTRANT_PROTO*) ;;
14353 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
14355 echo "Prototype: $try" ;;
14358 *) case "$usethreads" in
14359 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
14366 *) getgrnam_r_proto=0
14370 : see if gethostbyaddr exists
14371 set gethostbyaddr d_gethbyaddr
14374 : see if gethostbyname exists
14375 set gethostbyname d_gethbyname
14378 : see if gethostent exists
14379 set gethostent d_gethent
14382 : see how we will look up host name
14385 if set gethostname val -f d_gethname; eval $csym; $val; then
14386 echo 'gethostname() found.' >&4
14387 d_gethname="$define"
14390 if set uname val -f d_uname; eval $csym; $val; then
14393 uname() was found, but you're running xenix, and older versions of xenix
14394 have a broken uname(). If you don't really know whether your xenix is old
14395 enough to have a broken system call, use the default answer.
14400 "$define") dflt=n;;
14402 rp='Is your uname() broken?'
14405 n*) d_uname="$define"; call=uname;;
14408 echo 'uname() found.' >&4
14415 case "$d_gethname" in
14416 '') d_gethname="$undef";;
14419 '') d_uname="$undef";;
14421 case "$d_uname$d_gethname" in
14426 Every now and then someone has a $call() that lies about the hostname
14427 but can't be fixed for political or economic reasons. If you wish, I can
14428 pretend $call() isn't there and maybe compute hostname at run-time
14429 thanks to the '$phostname' command.
14432 rp="Shall I ignore $call() from now on?"
14435 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
14438 case "$phostname" in
14439 '') aphostname='';;
14440 *) case "$aphostname" in
14442 *) set X $phostname
14446 file=`./loc $file $file $pth`
14447 aphostname=`echo $file $*`
14452 case "$d_uname$d_gethname" in
14455 case "$phostname" in
14457 echo "There will be no way for $package to get your hostname." >&4;;
14459 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
14463 case "$d_phostname" in
14464 '') d_phostname="$undef";;
14467 : see if gethostbyaddr_r exists
14468 set gethostbyaddr_r d_gethostbyaddr_r
14470 case "$d_gethostbyaddr_r" in
14472 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14473 case "$d_gethostbyaddr_r_proto:$usethreads" in
14474 ":define") d_gethostbyaddr_r_proto=define
14475 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
14479 case "$d_gethostbyaddr_r_proto" in
14481 case "$gethostbyaddr_r_proto" in
14482 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
14483 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
14485 case "$gethostbyaddr_r_proto" in
14486 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
14487 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
14489 case "$gethostbyaddr_r_proto" in
14490 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
14491 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
14493 case "$gethostbyaddr_r_proto" in
14494 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
14495 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
14497 case "$gethostbyaddr_r_proto" in
14498 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
14499 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
14501 case "$gethostbyaddr_r_proto" in
14502 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
14503 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
14505 case "$gethostbyaddr_r_proto" in
14506 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
14507 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
14509 case "$gethostbyaddr_r_proto" in
14510 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
14511 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
14513 case "$gethostbyaddr_r_proto" in
14514 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
14515 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
14517 case "$gethostbyaddr_r_proto" in
14518 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
14519 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
14521 case "$gethostbyaddr_r_proto" in
14522 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
14523 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
14525 case "$gethostbyaddr_r_proto" in
14526 ''|0) d_gethostbyaddr_r=undef
14527 gethostbyaddr_r_proto=0
14528 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
14529 * ) case "$gethostbyaddr_r_proto" in
14530 REENTRANT_PROTO*) ;;
14531 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
14533 echo "Prototype: $try" ;;
14536 *) case "$usethreads" in
14537 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
14539 d_gethostbyaddr_r=undef
14540 gethostbyaddr_r_proto=0
14544 *) gethostbyaddr_r_proto=0
14548 : see if gethostbyname_r exists
14549 set gethostbyname_r d_gethostbyname_r
14551 case "$d_gethostbyname_r" in
14553 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14554 case "$d_gethostbyname_r_proto:$usethreads" in
14555 ":define") d_gethostbyname_r_proto=define
14556 set d_gethostbyname_r_proto gethostbyname_r $hdrs
14560 case "$d_gethostbyname_r_proto" in
14562 case "$gethostbyname_r_proto" in
14563 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
14564 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
14566 case "$gethostbyname_r_proto" in
14567 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
14568 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
14570 case "$gethostbyname_r_proto" in
14571 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
14572 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
14574 case "$gethostbyname_r_proto" in
14575 ''|0) d_gethostbyname_r=undef
14576 gethostbyname_r_proto=0
14577 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
14578 * ) case "$gethostbyname_r_proto" in
14579 REENTRANT_PROTO*) ;;
14580 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
14582 echo "Prototype: $try" ;;
14585 *) case "$usethreads" in
14586 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
14588 d_gethostbyname_r=undef
14589 gethostbyname_r_proto=0
14593 *) gethostbyname_r_proto=0
14597 : see if gethostent_r exists
14598 set gethostent_r d_gethostent_r
14600 case "$d_gethostent_r" in
14602 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14603 case "$d_gethostent_r_proto:$usethreads" in
14604 ":define") d_gethostent_r_proto=define
14605 set d_gethostent_r_proto gethostent_r $hdrs
14609 case "$d_gethostent_r_proto" in
14611 case "$gethostent_r_proto" in
14612 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
14613 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
14615 case "$gethostent_r_proto" in
14616 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
14617 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBIE ;;
14619 case "$gethostent_r_proto" in
14620 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
14621 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBIE ;;
14623 case "$gethostent_r_proto" in
14624 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
14625 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBI ;;
14627 case "$gethostent_r_proto" in
14628 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
14629 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBI ;;
14631 case "$gethostent_r_proto" in
14632 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
14633 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SD ;;
14635 case "$gethostent_r_proto" in
14636 ''|0) d_gethostent_r=undef
14637 gethostent_r_proto=0
14638 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
14639 * ) case "$gethostent_r_proto" in
14640 REENTRANT_PROTO*) ;;
14641 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
14643 echo "Prototype: $try" ;;
14646 *) case "$usethreads" in
14647 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
14649 d_gethostent_r=undef
14650 gethostent_r_proto=0
14654 *) gethostent_r_proto=0
14658 : see if prototypes for various gethostxxx netdb.h functions are available
14660 set d_gethostprotos gethostent $i_netdb netdb.h
14663 : see if getitimer exists
14664 set getitimer d_getitimer
14667 : see if getlogin exists
14668 set getlogin d_getlogin
14671 : see if getlogin_r exists
14672 set getlogin_r d_getlogin_r
14674 case "$d_getlogin_r" in
14676 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
14677 case "$d_getlogin_r_proto:$usethreads" in
14678 ":define") d_getlogin_r_proto=define
14679 set d_getlogin_r_proto getlogin_r $hdrs
14683 case "$d_getlogin_r_proto" in
14685 case "$getlogin_r_proto" in
14686 ''|0) try='int getlogin_r(char*, size_t);'
14687 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BW ;;
14689 case "$getlogin_r_proto" in
14690 ''|0) try='int getlogin_r(char*, int);'
14691 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BI ;;
14693 case "$getlogin_r_proto" in
14694 ''|0) try='char* getlogin_r(char*, size_t);'
14695 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BW ;;
14697 case "$getlogin_r_proto" in
14698 ''|0) try='char* getlogin_r(char*, int);'
14699 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BI ;;
14701 case "$getlogin_r_proto" in
14702 ''|0) d_getlogin_r=undef
14704 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
14705 * ) case "$getlogin_r_proto" in
14706 REENTRANT_PROTO*) ;;
14707 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
14709 echo "Prototype: $try" ;;
14712 *) case "$usethreads" in
14713 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
14720 *) getlogin_r_proto=0
14724 : see if getnameinfo exists
14725 set getnameinfo d_getnameinfo
14728 : see if getnetbyaddr exists
14729 set getnetbyaddr d_getnbyaddr
14732 : see if getnetbyname exists
14733 set getnetbyname d_getnbyname
14736 : see if getnetent exists
14737 set getnetent d_getnent
14740 : see if getnetbyaddr_r exists
14741 set getnetbyaddr_r d_getnetbyaddr_r
14743 case "$d_getnetbyaddr_r" in
14745 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14746 case "$d_getnetbyaddr_r_proto:$usethreads" in
14747 ":define") d_getnetbyaddr_r_proto=define
14748 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
14752 case "$d_getnetbyaddr_r_proto" in
14754 case "$getnetbyaddr_r_proto" in
14755 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
14756 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
14758 case "$getnetbyaddr_r_proto" in
14759 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
14760 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
14762 case "$getnetbyaddr_r_proto" in
14763 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
14764 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
14766 case "$getnetbyaddr_r_proto" in
14767 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
14768 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
14770 case "$getnetbyaddr_r_proto" in
14771 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
14772 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
14774 case "$getnetbyaddr_r_proto" in
14775 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
14776 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
14778 case "$getnetbyaddr_r_proto" in
14779 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
14780 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
14782 case "$getnetbyaddr_r_proto" in
14783 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
14784 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
14786 case "$getnetbyaddr_r_proto" in
14787 ''|0) d_getnetbyaddr_r=undef
14788 getnetbyaddr_r_proto=0
14789 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
14790 * ) case "$getnetbyaddr_r_proto" in
14791 REENTRANT_PROTO*) ;;
14792 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
14794 echo "Prototype: $try" ;;
14797 *) case "$usethreads" in
14798 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
14800 d_getnetbyaddr_r=undef
14801 getnetbyaddr_r_proto=0
14805 *) getnetbyaddr_r_proto=0
14809 : see if getnetbyname_r exists
14810 set getnetbyname_r d_getnetbyname_r
14812 case "$d_getnetbyname_r" in
14814 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14815 case "$d_getnetbyname_r_proto:$usethreads" in
14816 ":define") d_getnetbyname_r_proto=define
14817 set d_getnetbyname_r_proto getnetbyname_r $hdrs
14821 case "$d_getnetbyname_r_proto" in
14823 case "$getnetbyname_r_proto" in
14824 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
14825 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
14827 case "$getnetbyname_r_proto" in
14828 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
14829 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
14831 case "$getnetbyname_r_proto" in
14832 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
14833 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
14835 case "$getnetbyname_r_proto" in
14836 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
14837 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
14839 case "$getnetbyname_r_proto" in
14840 ''|0) d_getnetbyname_r=undef
14841 getnetbyname_r_proto=0
14842 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
14843 * ) case "$getnetbyname_r_proto" in
14844 REENTRANT_PROTO*) ;;
14845 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
14847 echo "Prototype: $try" ;;
14850 *) case "$usethreads" in
14851 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
14853 d_getnetbyname_r=undef
14854 getnetbyname_r_proto=0
14858 *) getnetbyname_r_proto=0
14862 : see if getnetent_r exists
14863 set getnetent_r d_getnetent_r
14865 case "$d_getnetent_r" in
14867 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14868 case "$d_getnetent_r_proto:$usethreads" in
14869 ":define") d_getnetent_r_proto=define
14870 set d_getnetent_r_proto getnetent_r $hdrs
14874 case "$d_getnetent_r_proto" in
14876 case "$getnetent_r_proto" in
14877 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
14878 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
14880 case "$getnetent_r_proto" in
14881 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
14882 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBIE ;;
14884 case "$getnetent_r_proto" in
14885 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
14886 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBIE ;;
14888 case "$getnetent_r_proto" in
14889 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
14890 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBI ;;
14892 case "$getnetent_r_proto" in
14893 ''|0) try='int getnetent_r(struct netent*, char*, int);'
14894 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBI ;;
14896 case "$getnetent_r_proto" in
14897 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
14898 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SD ;;
14900 case "$getnetent_r_proto" in
14901 ''|0) d_getnetent_r=undef
14902 getnetent_r_proto=0
14903 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
14904 * ) case "$getnetent_r_proto" in
14905 REENTRANT_PROTO*) ;;
14906 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
14908 echo "Prototype: $try" ;;
14911 *) case "$usethreads" in
14912 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
14914 d_getnetent_r=undef
14915 getnetent_r_proto=0
14919 *) getnetent_r_proto=0
14923 : see if prototypes for various getnetxxx netdb.h functions are available
14925 set d_getnetprotos getnetent $i_netdb netdb.h
14928 : see if getpagesize exists
14929 set getpagesize d_getpagsz
14932 : Optional checks for getprotobyname and getprotobynumber
14934 : see if getprotobyname exists
14935 set getprotobyname d_getpbyname
14938 : see if getprotobynumber exists
14939 set getprotobynumber d_getpbynumber
14942 : see if getprotoent exists
14943 set getprotoent d_getpent
14946 : see if getpgid exists
14947 set getpgid d_getpgid
14950 : see if getpgrp2 exists
14951 set getpgrp2 d_getpgrp2
14954 : see if getppid exists
14955 set getppid d_getppid
14958 : see if getpriority exists
14959 set getpriority d_getprior
14962 : see if getprotobyname_r exists
14963 set getprotobyname_r d_getprotobyname_r
14965 case "$d_getprotobyname_r" in
14967 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14968 case "$d_getprotobyname_r_proto:$usethreads" in
14969 ":define") d_getprotobyname_r_proto=define
14970 set d_getprotobyname_r_proto getprotobyname_r $hdrs
14974 case "$d_getprotobyname_r_proto" in
14976 case "$getprotobyname_r_proto" in
14977 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
14978 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
14980 case "$getprotobyname_r_proto" in
14981 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
14982 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
14984 case "$getprotobyname_r_proto" in
14985 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
14986 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
14988 case "$getprotobyname_r_proto" in
14989 ''|0) d_getprotobyname_r=undef
14990 getprotobyname_r_proto=0
14991 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
14992 * ) case "$getprotobyname_r_proto" in
14993 REENTRANT_PROTO*) ;;
14994 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
14996 echo "Prototype: $try" ;;
14999 *) case "$usethreads" in
15000 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
15002 d_getprotobyname_r=undef
15003 getprotobyname_r_proto=0
15007 *) getprotobyname_r_proto=0
15011 : see if getprotobynumber_r exists
15012 set getprotobynumber_r d_getprotobynumber_r
15014 case "$d_getprotobynumber_r" in
15016 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15017 case "$d_getprotobynumber_r_proto:$usethreads" in
15018 ":define") d_getprotobynumber_r_proto=define
15019 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
15023 case "$d_getprotobynumber_r_proto" in
15025 case "$getprotobynumber_r_proto" in
15026 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
15027 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
15029 case "$getprotobynumber_r_proto" in
15030 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
15031 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
15033 case "$getprotobynumber_r_proto" in
15034 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
15035 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
15037 case "$getprotobynumber_r_proto" in
15038 ''|0) d_getprotobynumber_r=undef
15039 getprotobynumber_r_proto=0
15040 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
15041 * ) case "$getprotobynumber_r_proto" in
15042 REENTRANT_PROTO*) ;;
15043 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
15045 echo "Prototype: $try" ;;
15048 *) case "$usethreads" in
15049 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
15051 d_getprotobynumber_r=undef
15052 getprotobynumber_r_proto=0
15056 *) getprotobynumber_r_proto=0
15060 : see if getprotoent_r exists
15061 set getprotoent_r d_getprotoent_r
15063 case "$d_getprotoent_r" in
15065 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15066 case "$d_getprotoent_r_proto:$usethreads" in
15067 ":define") d_getprotoent_r_proto=define
15068 set d_getprotoent_r_proto getprotoent_r $hdrs
15072 case "$d_getprotoent_r_proto" in
15074 case "$getprotoent_r_proto" in
15075 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
15076 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
15078 case "$getprotoent_r_proto" in
15079 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
15080 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBI ;;
15082 case "$getprotoent_r_proto" in
15083 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
15084 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=S_SBI ;;
15086 case "$getprotoent_r_proto" in
15087 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
15088 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SD ;;
15090 case "$getprotoent_r_proto" in
15091 ''|0) d_getprotoent_r=undef
15092 getprotoent_r_proto=0
15093 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
15094 * ) case "$getprotoent_r_proto" in
15095 REENTRANT_PROTO*) ;;
15096 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
15098 echo "Prototype: $try" ;;
15101 *) case "$usethreads" in
15102 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
15104 d_getprotoent_r=undef
15105 getprotoent_r_proto=0
15109 *) getprotoent_r_proto=0
15113 : see if prototypes for various getprotoxxx netdb.h functions are available
15115 set d_getprotoprotos getprotoent $i_netdb netdb.h
15118 : see if getprpwnam exists
15119 set getprpwnam d_getprpwnam
15122 : see if getpwent exists
15123 set getpwent d_getpwent
15126 : see if getpwent_r exists
15127 set getpwent_r d_getpwent_r
15129 case "$d_getpwent_r" in
15131 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15132 case "$d_getpwent_r_proto:$usethreads" in
15133 ":define") d_getpwent_r_proto=define
15134 set d_getpwent_r_proto getpwent_r $hdrs
15138 case "$d_getpwent_r_proto" in
15140 case "$getpwent_r_proto" in
15141 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
15142 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBWR ;;
15144 case "$getpwent_r_proto" in
15145 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
15146 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIR ;;
15148 case "$getpwent_r_proto" in
15149 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
15150 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBW ;;
15152 case "$getpwent_r_proto" in
15153 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
15154 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBI ;;
15156 case "$getpwent_r_proto" in
15157 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
15158 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBI ;;
15160 case "$getpwent_r_proto" in
15161 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
15162 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIH ;;
15164 case "$getpwent_r_proto" in
15165 ''|0) d_getpwent_r=undef
15167 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
15168 * ) case "$getpwent_r_proto" in
15169 REENTRANT_PROTO*) ;;
15170 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
15172 echo "Prototype: $try" ;;
15175 *) case "$usethreads" in
15176 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
15183 *) getpwent_r_proto=0
15187 : see if getpwnam_r exists
15188 set getpwnam_r d_getpwnam_r
15190 case "$d_getpwnam_r" in
15192 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15193 case "$d_getpwnam_r_proto:$usethreads" in
15194 ":define") d_getpwnam_r_proto=define
15195 set d_getpwnam_r_proto getpwnam_r $hdrs
15199 case "$d_getpwnam_r_proto" in
15201 case "$getpwnam_r_proto" in
15202 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
15203 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
15205 case "$getpwnam_r_proto" in
15206 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
15207 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
15209 case "$getpwnam_r_proto" in
15210 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
15211 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
15213 case "$getpwnam_r_proto" in
15214 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
15215 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
15217 case "$getpwnam_r_proto" in
15218 ''|0) d_getpwnam_r=undef
15220 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
15221 * ) case "$getpwnam_r_proto" in
15222 REENTRANT_PROTO*) ;;
15223 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
15225 echo "Prototype: $try" ;;
15228 *) case "$usethreads" in
15229 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
15236 *) getpwnam_r_proto=0
15240 : see if getpwuid_r exists
15241 set getpwuid_r d_getpwuid_r
15243 case "$d_getpwuid_r" in
15245 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15246 case "$d_getpwuid_r_proto:$usethreads" in
15247 ":define") d_getpwuid_r_proto=define
15248 set d_getpwuid_r_proto getpwuid_r $hdrs
15252 case "$d_getpwuid_r_proto" in
15254 case "$getpwuid_r_proto" in
15255 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
15256 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
15258 case "$getpwuid_r_proto" in
15259 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
15260 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
15262 case "$getpwuid_r_proto" in
15263 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
15264 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
15266 case "$getpwuid_r_proto" in
15267 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
15268 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
15270 case "$getpwuid_r_proto" in
15271 ''|0) d_getpwuid_r=undef
15273 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
15274 * ) case "$getpwuid_r_proto" in
15275 REENTRANT_PROTO*) ;;
15276 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
15278 echo "Prototype: $try" ;;
15281 *) case "$usethreads" in
15282 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
15289 *) getpwuid_r_proto=0
15293 : Optional checks for getsbyname and getsbyport
15295 : see if getservbyname exists
15296 set getservbyname d_getsbyname
15299 : see if getservbyport exists
15300 set getservbyport d_getsbyport
15303 : see if getservent exists
15304 set getservent d_getsent
15307 : see if getservbyname_r exists
15308 set getservbyname_r d_getservbyname_r
15310 case "$d_getservbyname_r" in
15312 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15313 case "$d_getservbyname_r_proto:$usethreads" in
15314 ":define") d_getservbyname_r_proto=define
15315 set d_getservbyname_r_proto getservbyname_r $hdrs
15319 case "$d_getservbyname_r_proto" in
15321 case "$getservbyname_r_proto" in
15322 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
15323 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
15325 case "$getservbyname_r_proto" in
15326 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
15327 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
15329 case "$getservbyname_r_proto" in
15330 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
15331 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
15333 case "$getservbyname_r_proto" in
15334 ''|0) d_getservbyname_r=undef
15335 getservbyname_r_proto=0
15336 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
15337 * ) case "$getservbyname_r_proto" in
15338 REENTRANT_PROTO*) ;;
15339 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
15341 echo "Prototype: $try" ;;
15344 *) case "$usethreads" in
15345 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
15347 d_getservbyname_r=undef
15348 getservbyname_r_proto=0
15352 *) getservbyname_r_proto=0
15356 : see if getservbyport_r exists
15357 set getservbyport_r d_getservbyport_r
15359 case "$d_getservbyport_r" in
15361 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15362 case "$d_getservbyport_r_proto:$usethreads" in
15363 ":define") d_getservbyport_r_proto=define
15364 set d_getservbyport_r_proto getservbyport_r $hdrs
15368 case "$d_getservbyport_r_proto" in
15370 case "$getservbyport_r_proto" in
15371 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
15372 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
15374 case "$getservbyport_r_proto" in
15375 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
15376 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
15378 case "$getservbyport_r_proto" in
15379 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
15380 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
15382 case "$getservbyport_r_proto" in
15383 ''|0) d_getservbyport_r=undef
15384 getservbyport_r_proto=0
15385 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
15386 * ) case "$getservbyport_r_proto" in
15387 REENTRANT_PROTO*) ;;
15388 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
15390 echo "Prototype: $try" ;;
15393 *) case "$usethreads" in
15394 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
15396 d_getservbyport_r=undef
15397 getservbyport_r_proto=0
15401 *) getservbyport_r_proto=0
15405 : see if getservent_r exists
15406 set getservent_r d_getservent_r
15408 case "$d_getservent_r" in
15410 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15411 case "$d_getservent_r_proto:$usethreads" in
15412 ":define") d_getservent_r_proto=define
15413 set d_getservent_r_proto getservent_r $hdrs
15417 case "$d_getservent_r_proto" in
15419 case "$getservent_r_proto" in
15420 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
15421 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBWR ;;
15423 case "$getservent_r_proto" in
15424 ''|0) try='int getservent_r(struct servent*, char*, int);'
15425 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBI ;;
15427 case "$getservent_r_proto" in
15428 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
15429 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=S_SBI ;;
15431 case "$getservent_r_proto" in
15432 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
15433 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SD ;;
15435 case "$getservent_r_proto" in
15436 ''|0) d_getservent_r=undef
15437 getservent_r_proto=0
15438 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
15439 * ) case "$getservent_r_proto" in
15440 REENTRANT_PROTO*) ;;
15441 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
15443 echo "Prototype: $try" ;;
15446 *) case "$usethreads" in
15447 define) echo "getservent_r has no prototype, not using it." >&4 ;;
15449 d_getservent_r=undef
15450 getservent_r_proto=0
15454 *) getservent_r_proto=0
15458 : see if prototypes for various getservxxx netdb.h functions are available
15460 set d_getservprotos getservent $i_netdb netdb.h
15463 : see if getspnam exists
15464 set getspnam d_getspnam
15467 : see if this is a shadow.h system
15468 set shadow.h i_shadow
15471 : see if getspnam_r exists
15472 set getspnam_r d_getspnam_r
15474 case "$d_getspnam_r" in
15476 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
15477 case "$d_getspnam_r_proto:$usethreads" in
15478 ":define") d_getspnam_r_proto=define
15479 set d_getspnam_r_proto getspnam_r $hdrs
15483 case "$d_getspnam_r_proto" in
15485 case "$getspnam_r_proto" in
15486 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
15487 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
15489 case "$getspnam_r_proto" in
15490 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
15491 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=S_CSBI ;;
15493 case "$getspnam_r_proto" in
15494 ''|0) d_getspnam_r=undef
15496 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
15497 * ) case "$getspnam_r_proto" in
15498 REENTRANT_PROTO*) ;;
15499 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
15501 echo "Prototype: $try" ;;
15504 *) case "$usethreads" in
15505 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
15512 *) getspnam_r_proto=0
15516 : see if gettimeofday or ftime exists
15517 set gettimeofday d_gettimeod
15519 case "$d_gettimeod" in
15525 val="$undef"; set d_ftime; eval $setvar
15528 case "$d_gettimeod$d_ftime" in
15531 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
15535 : see if gmtime_r exists
15536 set gmtime_r d_gmtime_r
15538 case "$d_gmtime_r" in
15540 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15541 case "$d_gmtime_r_proto:$usethreads" in
15542 ":define") d_gmtime_r_proto=define
15543 set d_gmtime_r_proto gmtime_r $hdrs
15547 case "$d_gmtime_r_proto" in
15549 case "$gmtime_r_proto" in
15550 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
15551 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=S_TS ;;
15553 case "$gmtime_r_proto" in
15554 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
15555 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=I_TS ;;
15557 case "$gmtime_r_proto" in
15558 ''|0) d_gmtime_r=undef
15560 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
15561 * ) case "$gmtime_r_proto" in
15562 REENTRANT_PROTO*) ;;
15563 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
15565 echo "Prototype: $try" ;;
15568 *) case "$usethreads" in
15569 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
15576 *) gmtime_r_proto=0
15580 : see if this is a netinet/in.h or sys/in.h system
15581 set netinet/in.h i_niin sys/in.h i_sysin
15584 : see if arpa/inet.h has to be included
15585 set arpa/inet.h i_arpainet
15588 : see if htonl --and friends-- exists
15593 : Maybe they are macros.
15596 $cat >htonl.c <<EOM
15598 #include <sys/types.h>
15599 #$i_niin I_NETINET_IN
15601 #$i_arpainet I_ARPA_INET
15602 #ifdef I_NETINET_IN
15603 #include <netinet/in.h>
15606 #include <sys/in.h>
15609 #include <arpa/inet.h>
15612 printf("Defined as a macro.");
15615 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
15616 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
15618 echo "But it seems to be defined as a macro." >&4
15626 : see if hypot exists
15630 : see if ilogb exists
15634 : see if ilogbl exists
15635 set ilogbl d_ilogbl
15640 if set index val -f; eval $csym; $val; then
15641 if set strchr val -f d_strchr; eval $csym; $val; then
15642 if $contains strchr "$strings" >/dev/null 2>&1 ; then
15645 echo "strchr() found." >&4
15649 echo "index() found." >&4
15654 echo "index() found." >&4
15657 if set strchr val -f d_strchr; eval $csym; $val; then
15660 echo "strchr() found." >&4
15662 echo "No index() or strchr() found!" >&4
15667 set d_strchr; eval $setvar
15669 set d_index; eval $setvar
15671 : check whether inet_aton exists
15672 set inet_aton d_inetaton
15675 : see if inet_ntop exists
15676 set inet_ntop d_inetntop
15679 : see if inet_pton exists
15680 set inet_pton d_inetpton
15685 $cat >isascii.c <<EOCP
15688 #$i_stdlib I_STDLIB
15690 #include <stdlib.h>
15701 if eval $compile; then
15702 echo "isascii() found." >&4
15705 echo "isascii() NOT found." >&4
15714 $cat >isblank.c <<'EOCP'
15725 if $cc $ccflags $ldflags -o isblank isblank.c $libs >/dev/null 2>&1 ; then
15726 echo "isblank() found." >&4
15729 echo "isblank() NOT found." >&4
15736 : check for isfinite
15737 echo "Checking to see if you have isfinite..." >&4
15743 int main() { return isfinite(0.0); }
15746 if eval $compile; then
15748 echo "You have isfinite."
15751 echo "You do not have isfinite."
15757 : see if isfinitel exists
15758 set isfinitel d_isfinitel
15762 echo "Checking to see if you have isinf..." >&4
15768 int main() { return isinf(0.0); }
15771 if eval $compile; then
15773 echo "You have isinf."
15776 echo "You do not have isinf."
15782 : see if isinfl exists
15783 set isinfl d_isinfl
15787 echo "Checking to see if you have isless..." >&4
15793 int main() { return isless(0.0); }
15796 if eval $compile; then
15798 echo "You have isless."
15801 echo "You do not have isless."
15808 echo "Checking to see if you have isnan..." >&4
15814 int main() { return isnan(0.0); }
15817 if eval $compile; then
15819 echo "You have isnan."
15822 echo "You do not have isnan."
15828 : see if isnanl exists
15829 set isnanl d_isnanl
15832 : check for isnormal
15833 echo "Checking to see if you have isnormal..." >&4
15839 int main() { return isnormal(0.0); }
15842 if eval $compile; then
15844 echo "You have isnormal."
15847 echo "You do not have isnormal."
15857 : see if j0l exists
15861 : see if killpg exists
15862 set killpg d_killpg
15865 : see if localeconv exists
15866 set localeconv d_locconv
15869 : see if libc has the POSIX.1-2008 currency locale rules
15870 case "$d_locconv:$d_lc_monetary_2008" in
15873 #include <locale.h>
15875 struct lconv *lc = localeconv();
15876 char int_p_cs_precedes = lc->int_p_cs_precedes;
15881 if eval $compile; then
15882 d_lc_monetary_2008="$define"
15884 d_lc_monetary_2008="$undef"
15890 : see if lchown exists
15892 $cat > try.c <<'EOCP'
15893 /* System header to define __stub macros and hopefully few prototypes,
15894 which can conflict with char lchown(); below. */
15895 #include <assert.h>
15896 /* Override any gcc2 internal prototype to avoid an error. */
15897 /* We use char because int might match the return type of a gcc2
15898 builtin and then its argument prototype would still apply. */
15901 /* The GNU C library defines this for functions which it implements
15902 to always fail with ENOSYS. Some functions are actually named
15903 something starting with __ and the normal name is an alias. */
15904 #if defined (__stub_lchown) || defined (__stub___lchown)
15912 if eval $compile; then
15913 $echo "lchown() found." >&4
15916 $echo "lchown() NOT found." >&4
15922 : See if number of significant digits in a double precision number is known
15924 $cat >ldbl_dig.c <<EOM
15925 #$i_limits I_LIMITS
15928 #include <limits.h>
15934 printf("Contains LDBL_DIG");
15937 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
15938 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
15939 echo "LDBL_DIG found." >&4
15942 echo "LDBL_DIG NOT found." >&4
15949 : see if lgamma exists
15950 set lgamma d_lgamma
15953 : see if lgamma_r exists
15954 set lgamma_r d_lgamma_r
15957 : check to see if math.h defines _LIB_VERSION
15958 d_libm_lib_version="$undef"
15962 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
15964 #include <unistd.h>
15966 int main (int argc, char *argv[])
15968 printf ("%d\n", _LIB_VERSION);
15973 if eval $compile; then
15975 echo "Yes, it does ($foo)" >&4
15976 d_libm_lib_version="$define"
15978 echo "No, it does not (probably harmless)" >&4
15985 : see if link exists
15989 : see if llrint exists
15990 set llrint d_llrint
15993 : see if llrintl exists
15994 set llrintl d_llrintl
15997 : see if llround exists
15998 set llround d_llround
16001 : see if llroundl exists
16002 set llroundl d_llroundl
16005 : see if localtime_r exists
16006 set localtime_r d_localtime_r
16008 case "$d_localtime_r" in
16010 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
16011 case "$d_localtime_r_proto:$usethreads" in
16012 ":define") d_localtime_r_proto=define
16013 set d_localtime_r_proto localtime_r $hdrs
16017 case "$d_localtime_r_proto" in
16019 case "$localtime_r_proto" in
16020 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
16021 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=S_TS ;;
16023 case "$localtime_r_proto" in
16024 ''|0) try='int localtime_r(const time_t*, struct tm*);'
16025 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=I_TS ;;
16027 case "$localtime_r_proto" in
16028 ''|0) d_localtime_r=undef
16029 localtime_r_proto=0
16030 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
16031 * ) case "$localtime_r_proto" in
16032 REENTRANT_PROTO*) ;;
16033 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
16035 echo "Prototype: $try" ;;
16038 *) case "$usethreads" in
16039 define) echo "localtime_r has no prototype, not using it." >&4 ;;
16041 d_localtime_r=undef
16042 localtime_r_proto=0
16046 *) localtime_r_proto=0
16050 : see if localtime_r calls tzset
16051 case "$localtime_r_proto" in
16054 /* Does our libc's localtime_r call tzset ?
16055 * return 0 if so, 1 otherwise.
16057 #$i_systypes I_SYS_TYPES
16058 #$i_unistd I_UNISTD
16060 #$i_stdlib I_STDLIB
16061 #$i_string I_STRING
16062 #$i_malloc I_MALLOC
16064 # include <sys/types.h>
16067 # include <unistd.h>
16073 #include <stdlib.h>
16076 # include <string.h>
16078 # include <strings.h>
16081 # include <malloc.h>
16085 time_t t = time(0L);
16086 char w_tz[]="TZ" "=GMT+5",
16087 e_tz[]="TZ" "=GMT-5",
16088 *tz_e = (char*)malloc(16),
16089 *tz_w = (char*)malloc(16);
16090 struct tm tm_e, tm_w;
16091 memset(&tm_e,'\0',sizeof(struct tm));
16092 memset(&tm_w,'\0',sizeof(struct tm));
16097 localtime_r(&t, &tm_e);
16100 localtime_r(&t, &tm_w);
16102 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
16108 if eval $compile; then
16109 if $run ./try; then
16110 d_localtime_r_needs_tzset=undef;
16112 d_localtime_r_needs_tzset=define;
16115 d_localtime_r_needs_tzset=undef;
16119 d_localtime_r_needs_tzset=undef;
16124 : see if lockf exists
16128 : see if log1p exists
16132 : see if log2 exists
16136 : see if logb exists
16140 : see if lrint exists
16144 : see if lrintl exists
16145 set lrintl d_lrintl
16148 : see if lround exists
16149 set lround d_lround
16152 : see if lroundl exists
16153 set lroundl d_lroundl
16156 : see if prototype for lseek is available
16158 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
16161 : see if lstat exists
16165 : see if madvise exists
16166 set madvise d_madvise
16169 : see if malloc_size exists
16170 set malloc_size d_malloc_size
16173 : see if malloc_size_good exists
16174 set malloc_good_size d_malloc_good_size
16177 : see if mblen exists
16181 : see if mbstowcs exists
16182 set mbstowcs d_mbstowcs
16185 : see if mbtowc exists
16186 set mbtowc d_mbtowc
16189 : see if memchr exists
16190 set memchr d_memchr
16193 : see if memcmp exists
16194 set memcmp d_memcmp
16197 : see if memcpy exists
16198 set memcpy d_memcpy
16201 : see if memmove exists
16202 set memmove d_memmove
16205 : see if memset exists
16206 set memset d_memset
16209 : see if mkdir exists
16213 : see if mkdtemp exists
16214 set mkdtemp d_mkdtemp
16217 : see if mkfifo exists
16218 set mkfifo d_mkfifo
16221 : see if mkstemp exists
16222 set mkstemp d_mkstemp
16225 : see if mkstemps exists
16226 set mkstemps d_mkstemps
16229 : see if mktime exists
16230 set mktime d_mktime
16233 : see if this is a sys/mman.h system
16234 set sys/mman.h i_sysmman
16237 : see if mmap exists
16240 : see what shmat returns
16241 : default to something harmless
16243 case "$i_sysmman$d_mmap" in
16245 $cat >mmap.c <<'END'
16246 #include <sys/mman.h>
16249 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
16254 echo "and it returns ($mmaptype)." >&4
16260 : see if sqrtl exists
16264 : see if scalbnl exists
16265 set scalbnl d_scalbnl
16268 : see if truncl exists
16269 set truncl d_truncl
16272 : see if modfl exists
16276 : see if prototype for modfl is available
16278 set d_modflproto modfl $i_math math.h
16281 d_modfl_pow32_bug="$undef"
16283 case "$d_longdbl$d_modfl" in
16286 Checking to see whether your modfl() is okay for large values...
16292 if $test "X$d_modflproto" != "X$define"; then
16293 $cat >>try.c <<EOCP
16294 /* Sigh. many current glibcs provide the function, but do not prototype it. */
16295 long double modfl (long double, long double *);
16298 $cat >>try.c <<EOCP
16300 long double nv = 4294967303.15;
16306 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
16310 case "$osname:$gccversion" in
16311 aix:) saveccflags="$ccflags"
16312 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
16315 if eval $compile; then
16318 *" 4294967303.150000 1.150000 4294967302.000000")
16319 echo >&4 "Your modfl() is broken for large values."
16320 d_modfl_pow32_bug="$define"
16322 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
16326 *" 4294967303.150000 0.150000 4294967303.000000")
16327 echo >&4 "Your modfl() seems okay for large values."
16329 *) echo >&4 "I don't understand your modfl() at all."
16335 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
16338 case "$osname:$gccversion" in
16339 aix:) ccflags="$saveccflags" ;; # restore
16344 if $test "$uselongdouble" = "$define"; then
16346 if $test "$d_sqrtl" != "$define"; then
16347 message="$message sqrtl"
16349 if $test "$d_modfl" != "$define"; then
16350 if $test "$d_truncl:$d_copysignl" = "$define:$define"; then
16351 echo "You have both truncl and copysignl, so I can emulate modfl."
16353 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
16354 echo "You have both aintl and copysignl, so I can emulate modfl."
16356 message="$message modfl"
16360 if $test "$d_frexpl" != "$define"; then
16361 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
16362 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
16364 message="$message frexpl"
16367 if $test "$d_ldexpl" != "$define"; then
16368 message="$message ldexpl"
16371 if $test "$message" != ""; then
16374 *** You requested the use of long doubles but you do not seem to have
16375 *** the following mathematical functions needed for long double support:
16377 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
16378 *** Cannot continue, aborting.
16386 : see if mprotect exists
16387 set mprotect d_mprotect
16390 : see if msgctl exists
16391 set msgctl d_msgctl
16394 : see if msgget exists
16395 set msgget d_msgget
16398 : see if msgsnd exists
16399 set msgsnd d_msgsnd
16402 : see if msgrcv exists
16403 set msgrcv d_msgrcv
16406 : see how much of the 'msg*(2)' library is present.
16409 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
16410 *"$undef"*) h_msg=false;;
16414 case "`ipcs 2>&1`" in
16415 "SVID messages"*"not configured"*)
16416 echo "Your $osname does not have the msg*(2) configured." >&4
16419 set msgctl d_msgctl
16421 set msgget d_msgget
16423 set msgsnd d_msgsnd
16425 set msgrcv d_msgrcv
16431 : we could also check for sys/ipc.h ...
16432 if $h_msg && $test `./findhdr sys/msg.h`; then
16433 echo "You have the full msg*(2) library." >&4
16436 echo "You don't have the full msg*(2) library." >&4
16442 : Check for msghdr_s
16444 echo "Checking to see if your system supports struct msghdr..." >&4
16445 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
16447 case "$d_msghdr_s" in
16448 "$define") echo "Yes, it does." ;;
16449 *) echo "No, it doesn't." ;;
16453 : see if msync exists
16457 : see if munmap exists
16458 set munmap d_munmap
16461 : see if nan exists
16465 : see if nearbyint exists
16466 set nearbyint d_nearbyint
16469 : see if nextafter exists
16470 set nextafter d_nextafter
16473 : see if nexttoward exists
16474 set nexttoward d_nexttoward
16477 : see if nice exists
16481 : see if this is a langinfo.h system
16482 set langinfo.h i_langinfo
16485 : see if nl_langinfo exists
16486 set nl_langinfo d_nl_langinfo
16489 : see if this is a quadmath.h system
16490 set quadmath.h i_quadmath
16493 : check for volatile keyword
16495 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
16496 $cat >try.c <<'EOCP'
16499 typedef struct _goo_struct goo_struct;
16500 goo_struct * volatile goo = ((goo_struct *)0);
16501 struct _goo_struct {
16506 typedef unsigned short foo_t;
16507 char *volatile foo;
16509 volatile foo_t blech;
16513 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
16515 echo "Yup, it does."
16518 echo "Nope, it doesn't."
16524 : Check basic sizes
16526 $echo "Choosing the C types to be used for Perl's internal types..." >&4
16528 case "$use64bitint:$d_quad:$quadtype" in
16531 uvtype="$uquadtype"
16536 uvtype="unsigned long"
16542 case "$uselongdouble:$d_longdbl" in
16544 nvtype="long double"
16545 nvsize=$longdblsize
16552 case "$usequadmath:$i_quadmath" in
16554 nvtype="__float128"
16560 *** You requested the use of the quadmath library, but you
16561 *** do not seem to have the quadmath library installed.
16562 *** Cannot continue, aborting.
16568 define:*) $cat <<EOM >&4
16570 *** You requested the use of the quadmath library, but you
16571 *** do not seem to have the required header, <quadmath.h>.
16573 case "$gccversion" in
16576 *** Your gcc looks a bit old:
16582 *** You are not running a gcc.
16587 *** For the quadmath library you need at least gcc 4.6.
16588 *** Cannot continue, aborting.
16594 $echo "(IV will be "$ivtype", $ivsize bytes)"
16595 $echo "(UV will be "$uvtype", $uvsize bytes)"
16596 $echo "(NV will be "$nvtype", $nvsize bytes)"
16599 #$i_inttypes I_INTTYPES
16601 #include <inttypes.h>
16606 int8_t i = INT8_MAX;
16607 uint8_t u = UINT8_MAX;
16608 printf("int8_t\n");
16611 int16_t i = INT16_MAX;
16612 uint16_t u = UINT16_MAX;
16613 printf("int16_t\n");
16616 int32_t i = INT32_MAX;
16617 uint32_t u = UINT32_MAX;
16618 printf("int32_t\n");
16623 i8type="signed char"
16624 u8type="unsigned char"
16629 '') case "$shortsize" in
16631 u16type="unsigned short"
16639 '') set try -DINT16
16640 if eval $compile; then
16641 case "`$run ./try`" in
16653 '') if $test $shortsize -ge 2; then
16655 u16type="unsigned short"
16663 '') case "$longsize" in
16665 u32type="unsigned long"
16669 *) case "$intsize" in
16671 u32type="unsigned int"
16681 '') set try -DINT32
16682 if eval $compile; then
16683 case "`$run ./try`" in
16695 '') if $test $intsize -ge 4; then
16697 u32type="unsigned int"
16705 '') case "$d_quad:$quadtype" in
16707 i64type="$quadtype"
16708 u64type="$uquadtype"
16716 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
16717 : volatile so that the compiler has to store it out to memory.
16718 if test X"$d_volatile" = X"$define"; then
16723 #$i_stdlib I_STDLIB
16725 #include <stdlib.h>
16727 #include <sys/types.h>
16728 #include <signal.h>
16730 $volatile int bletched = 0;
16731 $signal_t blech(int s) { bletched = 1; }
16736 int n = 8 * $uvsize;
16739 signal(SIGFPE, blech);
16742 for (i = 0; i < n; i++) {
16743 u = u << 1 | ($uvtype)1;
16745 if (($uvtype)d != u)
16749 d = ($nvtype)(u - 1);
16750 if (($uvtype)d != (u - 1))
16757 printf("%d\n", ((i == n) ? -n : i));
16763 d_nv_preserves_uv="$undef"
16764 if eval $compile; then
16765 nv_preserves_uv_bits="`$run ./try`"
16767 case "$nv_preserves_uv_bits" in
16769 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
16770 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
16771 d_nv_preserves_uv="$define"
16773 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
16774 d_nv_preserves_uv="$undef" ;;
16775 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
16776 nv_preserves_uv_bits="0" ;;
16780 $echo "Checking to find the largest integer value your NVs can hold..." >&4
16781 : volatile so that the compiler has to store it out to memory.
16782 if test X"$d_volatile" = X"$define"; then
16788 typedef $nvtype NV;
16795 while(count < 256) {
16796 $volatile NV up = value + 1.0;
16797 $volatile NV negated = -value;
16798 $volatile NV down = negated - 1.0;
16799 $volatile NV got_up = up - value;
16800 int up_good = got_up == 1.0;
16801 int got_down = down - negated;
16802 int down_good = got_down == -1.0;
16804 if (down_good != up_good) {
16806 "Inconsistency - up %d %f; down %d %f; for 2**%d (%.20f)\n",
16807 up_good, (double) got_up, down_good, (double) got_down,
16808 count, (double) value);
16815 fputs("256.0", stdout);
16818 fputs("2.0", stdout);
16824 fputs("*", stdout);
16830 fprintf(stderr, "Cannot overflow integer range, even at 2**%d (%.20f)\n",
16831 count, (double) value);
16837 nv_overflows_integers_at='0'
16838 if eval $compile; then
16844 The largest integer your NVs can preserve is equal to $xxx
16846 nv_overflows_integers_at="$xxx"
16849 Cannot determine the largest integer value your NVs can hold, unexpected output
16856 Cannot determine the largest integer value your NVs can hold
16863 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
16864 : volatile so that the compiler has to store it out to memory.
16865 if test X"$d_volatile" = X"$define"; then
16870 #$i_stdlib I_STDLIB
16872 #include <stdlib.h>
16874 #$i_string I_STRING
16876 # include <string.h>
16878 # include <strings.h>
16880 #include <sys/types.h>
16881 #include <signal.h>
16883 $volatile int bletched = 0;
16884 $signal_t blech(int s) { bletched = 1; }
16887 int checkit($nvtype d, char *where) {
16888 unsigned char *p = (char *)&d;
16889 unsigned char *end = p + sizeof(d);
16899 printf("No - %s: 0x", where);
16901 printf ("%02X", *p++);
16906 int main(int argc, char **argv) {
16909 fail += checkit(d, "0.0");
16911 /* The compiler shouldn't be assuming that bletched is 0 */
16914 fail += checkit(d, "bleched");
16917 signal(SIGFPE, blech);
16920 /* Paranoia - the compiler should have no way of knowing that ANSI says
16921 that argv[argc] will always be NULL. Actually, if it did assume this it
16922 would be buggy, as this is C and main() can be called from elsewhere in
16924 d = argv[argc] ? 1 : 0;
16927 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
16930 fail += checkit(d, "ternary");
16932 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
16935 printf("No - memset doesn't give 0.0\n");
16936 /* This might just blow up: */
16937 printf("(gives %g)\n", d);
16943 printf("No - something bleched\n");
16948 printf("No - %d fail(s)\n", fail);
16957 d_nv_zero_is_allbits_zero="$undef"
16958 if eval $compile; then
16964 0.0 is represented as all bits zero in memory
16966 d_nv_zero_is_allbits_zero="$define"
16969 0.0 is not represented as all bits zero in memory
16971 d_nv_zero_is_allbits_zero="$undef"
16976 0.0 is not represented as all bits zero in memory
16978 d_nv_zero_is_allbits_zero="$undef"
16984 : check for off64_t
16986 echo "Checking to see if you have off64_t..." >&4
16988 #include <sys/types.h>
16989 #include <unistd.h>
16990 int main() { off64_t x = 7; }
16993 if eval $compile; then
16995 echo "You have off64_t."
16998 echo "You do not have off64_t."
16999 case "$lseeksize" in
17000 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
17007 : how to create joinable pthreads
17008 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
17010 echo "Checking what constant to use for creating joinable pthreads..." >&4
17011 $cat >try.c <<'EOCP'
17012 #include <pthread.h>
17014 int detachstate = JOINABLE;
17017 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
17018 if eval $compile; then
17019 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
17020 val="$undef" # Yes, undef.
17021 set d_old_pthread_create_joinable
17024 set old_pthread_create_joinable
17027 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
17028 if eval $compile; then
17029 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
17031 set d_old_pthread_create_joinable
17033 val=PTHREAD_CREATE_UNDETACHED
17034 set old_pthread_create_joinable
17037 set try -DJOINABLE=__UNDETACHED
17038 if eval $compile; then
17039 echo "You seem to use __UNDETACHED." >&4
17041 set d_old_pthread_create_joinable
17044 set old_pthread_create_joinable
17047 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
17049 set d_old_pthread_create_joinable
17052 set old_pthread_create_joinable
17059 d_old_pthread_create_joinable="$undef"
17060 old_pthread_create_joinable=""
17063 : see if pause exists
17067 : see if poll exists
17071 : see if prctl exists
17075 : see if prctl supports PR_SET_NAME
17076 d_prctl_set_name=$undef
17081 #include <unistd.h>
17083 #include <sys/prctl.h>
17085 int main (int argc, char *argv[])
17087 return (prctl (PR_SET_NAME, "Test"));
17091 if eval $compile_ok && $run ./try; then
17092 echo "Your prctl (PR_SET_NAME, ...) works"
17093 d_prctl_set_name=$define
17099 : see if readlink exists
17100 set readlink d_readlink
17103 : Check if exe is symlink to abs path of executing program
17107 case "$d_procselfexe" in
17109 case "$d_readlink" in
17111 : NetBSD first as /proc/self is a symlink to /proc/curproc, and it feels
17112 : more tidy to avoid an extra level of symlink
17113 set NetBSD /proc/curproc/exe Linux /proc/self/exe FreeBSD /proc/curproc/file Solaris /proc/self/path/a.out
17114 while test $# -gt 0; do
17117 if $issymlink $try; then
17118 $ls -l $try > reflect
17119 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
17120 echo "You have $type-like $try."
17121 procselfexe='"'$try'"'
17123 : This will break out of the loop
17136 : backward compatibility for d_hvfork
17137 if test X$d_hvfork != X; then
17138 d_vfork="$d_hvfork"
17141 : see if there is a vfork
17146 d_pseudofork=$undef
17148 : Ok, but do we want to use it. vfork is reportedly unreliable in
17149 : perl on Solaris 2.x, and probably elsewhere.
17153 case "$usevfork" in
17159 Perl can only use a vfork() that doesn't suffer from strict
17160 restrictions on calling functions or modifying global data in
17161 the child. For example, glibc-2.1 contains such a vfork()
17162 that is unsuitable. If your system provides a proper fork()
17163 call, chances are that you do NOT want perl to use vfork().
17166 rp="Do you still want to use vfork()?"
17171 echo "Ok, we won't use vfork()."
17180 $define) usevfork='true';;
17181 *) usevfork='false';;
17184 : see whether the pthread_atfork exists
17186 #include <pthread.h>
17189 #ifdef PTHREAD_ATFORK
17190 pthread_atfork(NULL,NULL,NULL);
17195 : see if pthread_atfork exists
17196 set try -DPTHREAD_ATFORK
17197 if eval $compile; then
17202 case "$usethreads" in
17205 $define) echo 'pthread_atfork found.' >&4 ;;
17206 *) echo 'pthread_atfork NOT found.' >&4 ;;
17209 set d_pthread_atfork
17212 : see if pthread_attr_setscope exists
17213 set pthread_attr_setscope d_pthread_attr_setscope
17216 : see whether the various POSIXish _yields exist
17218 #include <pthread.h>
17224 #ifdef PTHREAD_YIELD
17227 #ifdef PTHREAD_YIELD_NULL
17228 pthread_yield(NULL);
17234 : see if sched_yield exists
17235 set try -DSCHED_YIELD
17236 if eval $compile; then
17238 sched_yield='sched_yield()'
17242 case "$usethreads" in
17245 $define) echo 'sched_yield() found.' >&4 ;;
17246 *) echo 'sched_yield() NOT found.' >&4 ;;
17252 : see if pthread_yield exists
17253 set try -DPTHREAD_YIELD
17254 if eval $compile; then
17256 case "$sched_yield" in
17257 '') sched_yield='pthread_yield()' ;;
17260 set try -DPTHREAD_YIELD_NULL
17261 if eval $compile; then
17263 case "$sched_yield" in
17264 '') sched_yield='pthread_yield(NULL)' ;;
17270 case "$usethreads" in
17273 $define) echo 'pthread_yield() found.' >&4 ;;
17274 *) echo 'pthread_yield() NOT found.' >&4 ;;
17278 set d_pthread_yield
17280 case "$sched_yield" in
17281 '') sched_yield=undef ;;
17285 : check for ptrdiff_t
17287 echo "Checking to see if you have ptrdiff_t..." >&4
17289 #include <stddef.h>
17290 int main() { ptrdiff_t x = 7; }
17293 if eval $compile; then
17295 echo "You have ptrdiff_t."
17298 echo "You do not have ptrdiff_t."
17304 : see if random_r exists
17305 set random_r d_random_r
17307 case "$d_random_r" in
17309 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17310 case "$d_random_r_proto:$usethreads" in
17311 ":define") d_random_r_proto=define
17312 set d_random_r_proto random_r $hdrs
17316 case "$d_random_r_proto" in
17318 case "$random_r_proto" in
17319 ''|0) try='int random_r(int*, struct random_data*);'
17320 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_iS ;;
17322 case "$random_r_proto" in
17323 ''|0) try='int random_r(long*, struct random_data*);'
17324 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_lS ;;
17326 case "$random_r_proto" in
17327 ''|0) try='int random_r(struct random_data*, int32_t*);'
17328 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_St ;;
17330 case "$random_r_proto" in
17331 ''|0) d_random_r=undef
17333 echo "Disabling random_r, cannot determine prototype." >&4 ;;
17334 * ) case "$random_r_proto" in
17335 REENTRANT_PROTO*) ;;
17336 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
17338 echo "Prototype: $try" ;;
17341 *) case "$usethreads" in
17342 define) echo "random_r has no prototype, not using it." >&4 ;;
17349 *) random_r_proto=0
17353 : see if readdir and friends exist
17354 set readdir d_readdir
17356 set seekdir d_seekdir
17358 set telldir d_telldir
17360 set rewinddir d_rewinddir
17363 : see if readdir64_r exists
17364 set readdir64_r d_readdir64_r
17366 case "$d_readdir64_r" in
17368 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
17369 case "$d_readdir64_r_proto:$usethreads" in
17370 ":define") d_readdir64_r_proto=define
17371 set d_readdir64_r_proto readdir64_r $hdrs
17375 case "$d_readdir64_r_proto" in
17377 case "$readdir64_r_proto" in
17378 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
17379 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TSR ;;
17381 case "$readdir64_r_proto" in
17382 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
17383 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TS ;;
17385 case "$readdir64_r_proto" in
17386 ''|0) d_readdir64_r=undef
17387 readdir64_r_proto=0
17388 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
17389 * ) case "$readdir64_r_proto" in
17390 REENTRANT_PROTO*) ;;
17391 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
17393 echo "Prototype: $try" ;;
17396 *) case "$usethreads" in
17397 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
17399 d_readdir64_r=undef
17400 readdir64_r_proto=0
17404 *) readdir64_r_proto=0
17408 : see if readdir_r exists
17409 set readdir_r d_readdir_r
17411 case "$d_readdir_r" in
17413 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
17414 case "$d_readdir_r_proto:$usethreads" in
17415 ":define") d_readdir_r_proto=define
17416 set d_readdir_r_proto readdir_r $hdrs
17420 case "$d_readdir_r_proto" in
17422 case "$readdir_r_proto" in
17423 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
17424 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TSR ;;
17426 case "$readdir_r_proto" in
17427 ''|0) try='int readdir_r(DIR*, struct dirent*);'
17428 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TS ;;
17430 case "$readdir_r_proto" in
17431 ''|0) d_readdir_r=undef
17433 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
17434 * ) case "$readdir_r_proto" in
17435 REENTRANT_PROTO*) ;;
17436 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
17438 echo "Prototype: $try" ;;
17441 *) case "$usethreads" in
17442 define) echo "readdir_r has no prototype, not using it." >&4 ;;
17449 *) readdir_r_proto=0
17453 : see if readv exists
17457 : see if recvmsg exists
17458 set recvmsg d_recvmsg
17461 : see if regcomp, regcmp, or re_comp exist, for regular pattern matching
17463 if set regcomp val -f d_regcomp; eval $csym; $val; then
17464 echo 'regcomp() found.' >&4
17465 d_regcomp="$define"
17468 elif set regcmp val -f d_regcmp; eval $csym; $val; then
17469 echo 'regcmp() found.' >&4
17473 elif set re_comp val -f d_re_comp; eval $csym; $val; then
17474 echo 're_comp() found, assuming re_exec() also exists.' >&4
17475 d_re_comp="$define"
17480 No regcomp(), regcmp() nor re_comp() found !! No regular pattern matching.
17487 : see if remainder exists
17488 set remainder d_remainder
17491 : see if remquo exists
17492 set remquo d_remquo
17495 : see if rename exists
17496 set rename d_rename
17499 : see if rint exists
17503 : see if rmdir exists
17507 : see if round exists
17511 : see if memory.h is available.
17516 : See if it conflicts with string.h
17522 $cppstdin $cppflags $cppminus < $strings > mem.h
17523 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
17525 echo "We won't be including <memory.h>."
17535 : can bcopy handle overlapping blocks?
17538 case "$d_memmove" in
17539 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
17540 *) case "$d_bcopy" in
17542 echo "Checking to see if bcopy() can do overlapping copies..." >&4
17544 #$i_memory I_MEMORY
17545 #$i_stdlib I_STDLIB
17546 #$i_string I_STRING
17547 #$i_unistd I_UNISTD
17549 $cat >>try.c <<'EOCP'
17552 # include <memory.h>
17555 # include <stdlib.h>
17558 # include <string.h>
17560 # include <strings.h>
17563 # include <unistd.h> /* Needed for NetBSD */
17567 char buf[128], abc[128];
17573 /* Copy "abcde..." string to char abc[] so that gcc doesn't
17574 try to store the string in read-only memory. */
17575 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
17577 for (align = 7; align >= 0; align--) {
17578 for (len = 36; len; len--) {
17580 bcopy(abc, b, len);
17581 for (off = 1; off <= len; off++) {
17582 bcopy(b, b+off, len);
17583 bcopy(b+off, b, len);
17584 if (bcmp(b, abc, len))
17593 if eval $compile_ok; then
17594 if $run ./try 2>/dev/null; then
17595 echo "Yes, it can."
17598 echo "It can't, sorry."
17601 echo "(I can't compile the test program, so we'll assume not...)"
17611 : can memcpy handle overlapping blocks?
17614 case "$d_memmove" in
17615 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
17616 *) case "$d_memcpy" in
17618 echo "Checking to see if memcpy() can do overlapping copies..." >&4
17620 #$i_memory I_MEMORY
17621 #$i_stdlib I_STDLIB
17622 #$i_string I_STRING
17623 #$i_unistd I_UNISTD
17625 $cat >>try.c <<'EOCP'
17628 # include <memory.h>
17631 # include <stdlib.h>
17634 # include <string.h>
17636 # include <strings.h>
17639 # include <unistd.h> /* Needed for NetBSD */
17643 char buf[128], abc[128];
17649 /* Copy "abcde..." string to char abc[] so that gcc doesn't
17650 try to store the string in read-only memory. */
17651 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
17653 for (align = 7; align >= 0; align--) {
17654 for (len = 36; len; len--) {
17656 memcpy(b, abc, len);
17657 for (off = 1; off <= len; off++) {
17658 memcpy(b+off, b, len);
17659 memcpy(b, b+off, len);
17660 if (memcmp(b, abc, len))
17669 if eval $compile_ok; then
17670 if $run ./try 2>/dev/null; then
17671 echo "Yes, it can."
17674 echo "It can't, sorry."
17677 echo "(I can't compile the test program, so we'll assume not...)"
17687 : can memcmp be trusted to compare relative magnitude?
17689 case "$d_memcmp" in
17692 echo "Checking if your memcmp() can compare relative magnitude..." >&4
17694 #$i_memory I_MEMORY
17695 #$i_stdlib I_STDLIB
17696 #$i_string I_STRING
17697 #$i_unistd I_UNISTD
17699 $cat >>try.c <<'EOCP'
17702 # include <memory.h>
17705 # include <stdlib.h>
17708 # include <string.h>
17710 # include <strings.h>
17713 # include <unistd.h> /* Needed for NetBSD */
17719 if ((a < b) && memcmp(&a, &b, 1) < 0)
17725 if eval $compile_ok; then
17726 if $run ./try 2>/dev/null; then
17727 echo "Yes, it can."
17730 echo "No, it can't (it uses signed chars)."
17733 echo "(I can't compile the test program, so we'll assume not...)"
17741 : see if prototype for sbrk is available
17743 set d_sbrkproto sbrk $i_unistd unistd.h
17746 : see if scalbn exists
17747 set scalbn d_scalbn
17750 : see if select exists
17751 set select d_select
17754 : see if semctl exists
17755 set semctl d_semctl
17758 : see if semget exists
17759 set semget d_semget
17762 : see if semop exists
17766 : see how much of the 'sem*(2)' library is present.
17769 case "$d_semctl$d_semget$d_semop" in
17770 *"$undef"*) h_sem=false;;
17774 case "`ipcs 2>&1`" in
17775 "SVID messages"*"not configured"*)
17776 echo "Your $osname does not have the sem*(2) configured." >&4
17779 set semctl d_semctl
17781 set semget d_semget
17789 : we could also check for sys/ipc.h ...
17790 if $h_sem && $test `./findhdr sys/sem.h`; then
17791 echo "You have the full sem*(2) library." >&4
17794 echo "You don't have the full sem*(2) library." >&4
17800 : see whether sys/sem.h defines union semun
17802 $cat > try.c <<'END'
17803 #include <sys/types.h>
17804 #include <sys/ipc.h>
17805 #include <sys/sem.h>
17806 int main () { union semun semun; semun.buf = 0; }
17809 if eval $compile; then
17810 echo "You have union semun in <sys/sem.h>." >&4
17813 echo "You do not have union semun in <sys/sem.h>." >&4
17820 : see how to do semctl IPC_STAT
17824 $cat > tryh.h <<END
17827 # define S_IRUSR S_IREAD
17828 # define S_IWUSR S_IWRITE
17829 # define S_IXUSR S_IEXEC
17831 # define S_IRUSR 0400
17832 # define S_IWUSR 0200
17833 # define S_IXUSR 0100
17835 # define S_IRGRP (S_IRUSR>>3)
17836 # define S_IWGRP (S_IWUSR>>3)
17837 # define S_IXGRP (S_IXUSR>>3)
17838 # define S_IROTH (S_IRUSR>>6)
17839 # define S_IWOTH (S_IWUSR>>6)
17840 # define S_IXOTH (S_IXUSR>>6)
17843 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
17844 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
17845 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
17848 : see whether semctl IPC_STAT can use union semun
17849 case "$d_semctl_semun" in
17853 #include <sys/types.h>
17854 #include <sys/ipc.h>
17855 #include <sys/sem.h>
17856 #include <sys/stat.h>
17863 #$d_union_semun HAS_UNION_SEMUN
17866 #ifndef HAS_UNION_SEMUN
17869 struct semid_ds *buf;
17870 unsigned short *array;
17876 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
17877 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
17879 struct semid_ds argbuf;
17882 st = semctl(sem, 0, IPC_STAT, arg);
17886 # endif /* IPC_STAT */
17887 printf("semctl IPC_STAT failed: errno = %d\n", errno);
17889 if (semctl(sem, 0, IPC_RMID, arg) != 0)
17890 # endif /* IPC_RMID */
17891 printf("semctl IPC_RMID failed: errno = %d\n", errno);
17893 #endif /* IPC_PRIVATE && ... */
17894 printf("semget failed: errno = %d\n", errno);
17899 if eval $compile; then
17902 semun) val="$define" ;;
17910 case "$d_semctl_semun" in
17912 echo "You can use union semun for semctl IPC_STAT." >&4
17915 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
17920 : see whether semctl IPC_STAT can use struct semid_ds pointer
17921 case "$d_semctl_semid_ds" in
17924 $cat > try.c <<'END'
17925 #include <sys/types.h>
17926 #include <sys/ipc.h>
17927 #include <sys/sem.h>
17928 #include <sys/stat.h>
17936 struct semid_ds arg;
17939 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
17940 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
17943 st = semctl(sem, 0, IPC_STAT, &arg);
17945 printf("semid_ds\n");
17947 # endif /* IPC_STAT */
17948 printf("semctl IPC_STAT failed: errno = %d\n", errno);
17950 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
17951 # endif /* IPC_RMID */
17952 printf("semctl IPC_RMID failed: errno = %d\n", errno);
17954 #endif /* IPC_PRIVATE && ... */
17955 printf("semget failed: errno = %d\n", errno);
17961 if eval $compile; then
17964 semid_ds) val="$define" ;;
17968 set d_semctl_semid_ds
17972 case "$d_semctl_semid_ds" in
17974 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
17976 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
17982 # We do not have the full sem*(2) library, so assume we can not
17988 set d_semctl_semid_ds
17994 : see if sendmsg exists
17995 set sendmsg d_sendmsg
17998 : see if setegid exists
17999 set setegid d_setegid
18002 : see if seteuid exists
18003 set seteuid d_seteuid
18006 : see if setgrent exists
18007 set setgrent d_setgrent
18010 : see if setgrent_r exists
18011 set setgrent_r d_setgrent_r
18013 case "$d_setgrent_r" in
18015 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
18016 case "$d_setgrent_r_proto:$usethreads" in
18017 ":define") d_setgrent_r_proto=define
18018 set d_setgrent_r_proto setgrent_r $hdrs
18022 case "$d_setgrent_r_proto" in
18024 case "$setgrent_r_proto" in
18025 ''|0) try='int setgrent_r(FILE**);'
18026 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=I_H ;;
18028 case "$setgrent_r_proto" in
18029 ''|0) try='void setgrent_r(FILE**);'
18030 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=V_H ;;
18032 case "$setgrent_r_proto" in
18033 ''|0) d_setgrent_r=undef
18035 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
18036 * ) case "$setgrent_r_proto" in
18037 REENTRANT_PROTO*) ;;
18038 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
18040 echo "Prototype: $try" ;;
18043 *) case "$usethreads" in
18044 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
18051 *) setgrent_r_proto=0
18055 : see if sethostent exists
18056 set sethostent d_sethent
18059 : see if sethostent_r exists
18060 set sethostent_r d_sethostent_r
18062 case "$d_sethostent_r" in
18064 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18065 case "$d_sethostent_r_proto:$usethreads" in
18066 ":define") d_sethostent_r_proto=define
18067 set d_sethostent_r_proto sethostent_r $hdrs
18071 case "$d_sethostent_r_proto" in
18073 case "$sethostent_r_proto" in
18074 ''|0) try='int sethostent_r(int, struct hostent_data*);'
18075 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=I_ID ;;
18077 case "$sethostent_r_proto" in
18078 ''|0) try='void sethostent_r(int, struct hostent_data*);'
18079 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=V_ID ;;
18081 case "$sethostent_r_proto" in
18082 ''|0) d_sethostent_r=undef
18083 sethostent_r_proto=0
18084 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
18085 * ) case "$sethostent_r_proto" in
18086 REENTRANT_PROTO*) ;;
18087 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
18089 echo "Prototype: $try" ;;
18092 *) case "$usethreads" in
18093 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
18095 d_sethostent_r=undef
18096 sethostent_r_proto=0
18100 *) sethostent_r_proto=0
18104 : see if setitimer exists
18105 set setitimer d_setitimer
18108 : see if setlinebuf exists
18109 set setlinebuf d_setlinebuf
18112 : see if setlocale exists
18113 set setlocale d_setlocale
18116 : see if locale.h is available
18117 set locale.h i_locale
18120 : see if setlocale_r exists
18121 set setlocale_r d_setlocale_r
18123 case "$d_setlocale_r" in
18125 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
18126 case "$d_setlocale_r_proto:$usethreads" in
18127 ":define") d_setlocale_r_proto=define
18128 set d_setlocale_r_proto setlocale_r $hdrs
18132 case "$d_setlocale_r_proto" in
18134 case "$setlocale_r_proto" in
18135 ''|0) try='int setlocale_r(int, const char*, char*, int);'
18136 ./protochk "$extern_C $try" $hdrs && setlocale_r_proto=I_ICBI ;;
18138 case "$setlocale_r_proto" in
18139 ''|0) d_setlocale_r=undef
18140 setlocale_r_proto=0
18141 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
18142 * ) case "$setlocale_r_proto" in
18143 REENTRANT_PROTO*) ;;
18144 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
18146 echo "Prototype: $try" ;;
18149 *) case "$usethreads" in
18150 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
18152 d_setlocale_r=undef
18153 setlocale_r_proto=0
18157 *) setlocale_r_proto=0
18161 : see if setnetent exists
18162 set setnetent d_setnent
18165 : see if setnetent_r exists
18166 set setnetent_r d_setnetent_r
18168 case "$d_setnetent_r" in
18170 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18171 case "$d_setnetent_r_proto:$usethreads" in
18172 ":define") d_setnetent_r_proto=define
18173 set d_setnetent_r_proto setnetent_r $hdrs
18177 case "$d_setnetent_r_proto" in
18179 case "$setnetent_r_proto" in
18180 ''|0) try='int setnetent_r(int, struct netent_data*);'
18181 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=I_ID ;;
18183 case "$setnetent_r_proto" in
18184 ''|0) try='void setnetent_r(int, struct netent_data*);'
18185 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=V_ID ;;
18187 case "$setnetent_r_proto" in
18188 ''|0) d_setnetent_r=undef
18189 setnetent_r_proto=0
18190 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
18191 * ) case "$setnetent_r_proto" in
18192 REENTRANT_PROTO*) ;;
18193 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
18195 echo "Prototype: $try" ;;
18198 *) case "$usethreads" in
18199 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
18201 d_setnetent_r=undef
18202 setnetent_r_proto=0
18206 *) setnetent_r_proto=0
18210 : see if setprotoent exists
18211 set setprotoent d_setpent
18214 : see if setpgid exists
18215 set setpgid d_setpgid
18218 : see if setpgrp2 exists
18219 set setpgrp2 d_setpgrp2
18222 : see if setpriority exists
18223 set setpriority d_setprior
18226 : see if setproctitle exists
18227 set setproctitle d_setproctitle
18230 : see if setprotoent_r exists
18231 set setprotoent_r d_setprotoent_r
18233 case "$d_setprotoent_r" in
18235 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18236 case "$d_setprotoent_r_proto:$usethreads" in
18237 ":define") d_setprotoent_r_proto=define
18238 set d_setprotoent_r_proto setprotoent_r $hdrs
18242 case "$d_setprotoent_r_proto" in
18244 case "$setprotoent_r_proto" in
18245 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
18246 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=I_ID ;;
18248 case "$setprotoent_r_proto" in
18249 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
18250 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=V_ID ;;
18252 case "$setprotoent_r_proto" in
18253 ''|0) d_setprotoent_r=undef
18254 setprotoent_r_proto=0
18255 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
18256 * ) case "$setprotoent_r_proto" in
18257 REENTRANT_PROTO*) ;;
18258 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
18260 echo "Prototype: $try" ;;
18263 *) case "$usethreads" in
18264 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
18266 d_setprotoent_r=undef
18267 setprotoent_r_proto=0
18271 *) setprotoent_r_proto=0
18275 : see if setpwent exists
18276 set setpwent d_setpwent
18279 : see if setpwent_r exists
18280 set setpwent_r d_setpwent_r
18282 case "$d_setpwent_r" in
18284 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
18285 case "$d_setpwent_r_proto:$usethreads" in
18286 ":define") d_setpwent_r_proto=define
18287 set d_setpwent_r_proto setpwent_r $hdrs
18291 case "$d_setpwent_r_proto" in
18293 case "$setpwent_r_proto" in
18294 ''|0) try='int setpwent_r(FILE**);'
18295 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=I_H ;;
18297 case "$setpwent_r_proto" in
18298 ''|0) try='void setpwent_r(FILE**);'
18299 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=V_H ;;
18301 case "$setpwent_r_proto" in
18302 ''|0) d_setpwent_r=undef
18304 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
18305 * ) case "$setpwent_r_proto" in
18306 REENTRANT_PROTO*) ;;
18307 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
18309 echo "Prototype: $try" ;;
18312 *) case "$usethreads" in
18313 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
18320 *) setpwent_r_proto=0
18324 : see if setregid exists
18325 set setregid d_setregid
18327 set setresgid d_setresgid
18330 : see if setreuid exists
18331 set setreuid d_setreuid
18333 set setresuid d_setresuid
18336 : see if setrgid exists
18337 set setrgid d_setrgid
18340 : see if setruid exists
18341 set setruid d_setruid
18344 : see if setservent exists
18345 set setservent d_setsent
18348 : see if setservent_r exists
18349 set setservent_r d_setservent_r
18351 case "$d_setservent_r" in
18353 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18354 case "$d_setservent_r_proto:$usethreads" in
18355 ":define") d_setservent_r_proto=define
18356 set d_setservent_r_proto setservent_r $hdrs
18360 case "$d_setservent_r_proto" in
18362 case "$setservent_r_proto" in
18363 ''|0) try='int setservent_r(int, struct servent_data*);'
18364 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=I_ID ;;
18366 case "$setservent_r_proto" in
18367 ''|0) try='void setservent_r(int, struct servent_data*);'
18368 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=V_ID ;;
18370 case "$setservent_r_proto" in
18371 ''|0) d_setservent_r=undef
18372 setservent_r_proto=0
18373 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
18374 * ) case "$setservent_r_proto" in
18375 REENTRANT_PROTO*) ;;
18376 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
18378 echo "Prototype: $try" ;;
18381 *) case "$usethreads" in
18382 define) echo "setservent_r has no prototype, not using it." >&4 ;;
18384 d_setservent_r=undef
18385 setservent_r_proto=0
18389 *) setservent_r_proto=0
18393 : see if setsid exists
18394 set setsid d_setsid
18397 : see if setvbuf exists
18398 set setvbuf d_setvbuf
18401 : see if shmctl exists
18402 set shmctl d_shmctl
18405 : see if shmget exists
18406 set shmget d_shmget
18409 : see if shmat exists
18412 : see what shmat returns
18415 $cat >shmat.c <<'END'
18416 #include <sys/shm.h>
18419 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
18424 echo "and it returns ($shmattype)." >&4
18425 : see if a prototype for shmat is available
18426 xxx=`./findhdr sys/shm.h`
18427 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
18428 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
18439 set d_shmatprototype
18442 : see if shmdt exists
18446 : see how much of the 'shm*(2)' library is present.
18449 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
18450 *"$undef"*) h_shm=false;;
18454 case "`ipcs 2>&1`" in
18455 "SVID shared memory"*"not configured"*)
18456 echo "Your $osname does not have the shm*(2) configured." >&4
18459 set shmctl d_shmctl
18461 set shmget d_shmget
18471 : we could also check for sys/ipc.h ...
18472 if $h_shm && $test `./findhdr sys/shm.h`; then
18473 echo "You have the full shm*(2) library." >&4
18476 echo "You don't have the full shm*(2) library." >&4
18482 : see if we have sigaction
18484 if set sigaction val -f d_sigaction; eval $csym; $val; then
18485 echo 'sigaction() found.' >&4
18488 #include <sys/types.h>
18489 #include <signal.h>
18490 #$i_stdlib I_STDLIB
18492 #include <stdlib.h>
18496 struct sigaction act, oact;
18498 oact.sa_handler = 0;
18499 /* so that act and oact are used */
18500 exit(act.sa_flags == 0 && oact.sa_handler == 0);
18504 if eval $compile_ok; then
18507 echo "But you don't seem to have a usable struct sigaction." >&4
18511 echo 'sigaction NOT found.' >&4
18514 set d_sigaction; eval $setvar
18517 : see if this is a sunmath.h system
18518 set sunmath.h i_sunmath
18521 : see if signbit exists
18522 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
18525 #$i_sunmath I_SUNMATH
18529 #ifdef I_SUNMATH /* Solaris special math library */
18530 # include <sunmath.h>
18533 int main(int argc, char **argv)
18537 if ((signbit(x) == 0) && (signbit(y) != 0))
18545 if eval $compile; then
18546 if $run ./try; then
18550 $echo "Signbit seems to be available, but doesn't work as I expected."
18551 $echo "I won't use it." >&4
18562 : see if sigprocmask exists
18563 set sigprocmask d_sigprocmask
18566 : see if sigsetjmp exists
18568 case "$d_sigsetjmp" in
18571 #include <setjmp.h>
18572 #$i_stdlib I_STDLIB
18574 #include <stdlib.h>
18580 if (sigsetjmp(env,1))
18583 siglongjmp(env, 1);
18588 if eval $compile; then
18589 if $run ./try >/dev/null 2>&1; then
18590 echo "POSIX sigsetjmp found." >&4
18594 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
18600 echo "sigsetjmp not found." >&4
18604 *) val="$d_sigsetjmp"
18605 case "$d_sigsetjmp" in
18606 $define) echo "POSIX sigsetjmp found." >&4;;
18607 $undef) echo "sigsetjmp not found." >&4;;
18615 : see if snprintf exists
18616 set snprintf d_snprintf
18619 : see if vsnprintf exists
18620 set vsnprintf d_vsnprintf
18623 case "$d_snprintf-$d_vsnprintf" in
18626 Checking whether your snprintf() and vsnprintf() work okay...
18628 $cat >try.c <<'EOCP'
18629 /* v?snprintf testing logic courtesy of Russ Allbery.
18630 * According to C99:
18631 * - if the buffer is too short it still must be \0-terminated
18632 * - if the buffer is too short the potentially required length
18633 * must be returned and not -1
18634 * - if the buffer is NULL the potentially required length
18635 * must be returned and not -1 or core dump
18638 #include <stdarg.h>
18642 int test (char *format, ...)
18647 va_start (args, format);
18648 count = vsnprintf (buf, sizeof buf, format, args);
18655 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
18656 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
18660 if eval $compile; then
18663 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
18665 Your snprintf() and snprintf() don't seem to be working okay.
18667 d_snprintf="$undef"
18668 d_vsnprintf="$undef"
18672 echo "(I can't seem to compile the test program--assuming they don't)"
18673 d_snprintf="$undef"
18674 d_vsnprintf="$undef"
18680 : see if sockatmark exists
18681 set sockatmark d_sockatmark
18684 : see if prototype for sockatmark is available
18686 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
18689 : see if socks5_init exists
18690 set socks5_init d_socks5_init
18693 : see if sprintf returns the length of the string in the buffer as per ANSI
18694 $echo "Checking whether sprintf returns the length of the string..." >&4
18697 #$i_stdlib I_STDLIB
18699 #include <stdlib.h>
18701 #$i_string I_STRING
18703 # include <string.h>
18705 # include <strings.h>
18714 int check (size_t expect, int test) {
18715 size_t got = strlen(buffer);
18719 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
18724 int main(int argc, char **argv) {
18727 check(sprintf(buffer, ""), ++test);
18728 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
18729 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
18736 if eval $compile; then
18740 sprintf returns the length of the string (as ANSI says it should)
18742 d_sprintf_returns_strlen="$define"
18745 sprintf does not return the length of the string (how old is this system?)
18747 d_sprintf_returns_strlen="$undef"
18751 echo "(I can't seem to compile the test program--assuming it doesn't)" >&4
18752 d_sprintf_returns_strlen="$undef"
18756 : see if srand48_r exists
18757 set srand48_r d_srand48_r
18759 case "$d_srand48_r" in
18761 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
18762 case "$d_srand48_r_proto:$usethreads" in
18763 ":define") d_srand48_r_proto=define
18764 set d_srand48_r_proto srand48_r $hdrs
18768 case "$d_srand48_r_proto" in
18770 case "$srand48_r_proto" in
18771 ''|0) try='int srand48_r(long, struct drand48_data*);'
18772 ./protochk "$extern_C $try" $hdrs && srand48_r_proto=I_LS ;;
18774 case "$srand48_r_proto" in
18775 ''|0) d_srand48_r=undef
18777 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
18778 * ) case "$srand48_r_proto" in
18779 REENTRANT_PROTO*) ;;
18780 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
18782 echo "Prototype: $try" ;;
18785 *) case "$usethreads" in
18786 define) echo "srand48_r has no prototype, not using it." >&4 ;;
18793 *) srand48_r_proto=0
18797 : see if srandom_r exists
18798 set srandom_r d_srandom_r
18800 case "$d_srandom_r" in
18802 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
18803 case "$d_srandom_r_proto:$usethreads" in
18804 ":define") d_srandom_r_proto=define
18805 set d_srandom_r_proto srandom_r $hdrs
18809 case "$d_srandom_r_proto" in
18811 case "$srandom_r_proto" in
18812 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
18813 ./protochk "$extern_C $try" $hdrs && srandom_r_proto=I_TS ;;
18815 case "$srandom_r_proto" in
18816 ''|0) d_srandom_r=undef
18818 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
18819 * ) case "$srandom_r_proto" in
18820 REENTRANT_PROTO*) ;;
18821 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
18823 echo "Prototype: $try" ;;
18826 *) case "$usethreads" in
18827 define) echo "srandom_r has no prototype, not using it." >&4 ;;
18834 *) srandom_r_proto=0
18838 : see if prototype for setresgid is available
18840 set d_sresgproto setresgid $i_unistd unistd.h
18843 : see if prototype for setresuid is available
18845 set d_sresuproto setresuid $i_unistd unistd.h
18848 : see if stat exists
18852 : see if sys/stat.h is available
18853 set sys/stat.h i_sysstat
18856 : see if stat knows about block sizes
18858 echo "Checking to see if your struct stat has st_blocks field..." >&4
18859 set d_statblks stat st_blocks $i_sysstat sys/stat.h
18862 : see what flavor, if any, of static inline is supported
18864 echo "Checking to see if your system supports static inline..."
18865 $cat > try.c <<'EOCP'
18866 #include <stdlib.h>
18867 extern int f_via_a(int x);
18868 extern int f_via_b(int x);
18869 int main(int argc, char **argv)
18878 return EXIT_SUCCESS;
18881 return EXIT_FAILURE;
18885 $cat > a.c <<'EOCP'
18886 static INLINE int f(int x) {
18897 $cat > b.c <<'EOCP'
18898 extern int f(int x);
18906 # Respect a hint (or previous) value for perl_static_inline, if there is one.
18907 case "$perl_static_inline" in
18908 '') # Check the various possibilities, and break out on success.
18909 # For gcc, prefer __inline__, which will still permit
18910 # cflags.SH to add in -ansi.
18911 case "$gccversion" in
18912 '') xxx="inline __inline__ __inline _inline";;
18913 *) xxx="__inline__ inline __inline _inline";;
18915 for inline in $xxx; do
18916 set try -DINLINE=$inline a.c
18917 if eval $compile && $run ./try; then
18918 # Now make sure there is no external linkage of static
18920 set try -DINLINE=$inline -DUSE_B a.c b.c
18921 if eval $compile && $run ./try; then
18922 $echo "Your compiler supports static $inline, " >&4
18923 $echo "but it also creates an external definition," >&4
18924 $echo "so I won't use it." >&4
18927 $echo "Your compiler supports static $inline." >&4
18929 perl_static_inline="static $inline";
18933 $echo "Your compiler does NOT support static $inline." >&4
18938 *inline*) # Some variant of inline exists.
18939 echo "Keeping your $hint value of $perl_static_inline."
18942 static) # No inline capabilities
18943 echo "Keeping your $hint value of $perl_static_inline."
18946 *) # Unrecognized previous value -- blindly trust the supplied
18947 # value and hope it makes sense. Use old value for
18948 # d_static_inline, if there is one.
18949 echo "Keeping your $hint value of $perl_static_inline."
18950 case "$d_static_inline" in
18952 *) val=$d_static_inline ;;
18956 # Fallback to plain 'static' if nothing worked.
18957 case "$perl_static_inline" in
18959 perl_static_inline="static"
18963 set d_static_inline
18965 $rm -f a.[co] b.[co]
18968 : Check stream access
18970 Checking how to access stdio streams by file descriptor number...
18972 case "$stdio_stream_array" in
18973 '') $cat >try.c <<EOCP
18976 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
18980 for s in _iob __iob __sF
18982 set try -DSTDIO_STREAM_ARRAY=$s
18983 if eval $compile; then
18984 case "`$run ./try`" in
18985 yes) stdio_stream_array=$s; break ;;
18991 case "$stdio_stream_array" in
18993 I can't figure out how to access stdio streams by file descriptor number.
18995 d_stdio_stream_array="$undef"
18998 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
19000 d_stdio_stream_array="$define"
19004 : see if strcoll exists
19005 set strcoll d_strcoll
19008 : check for structure copying
19010 echo "Checking to see if your C compiler can copy structs..." >&4
19011 $cat >try.c <<'EOCP'
19021 if $cc -c try.c >/dev/null 2>&1 ; then
19023 echo "Yup, it can."
19026 echo "Nope, it can't."
19032 : see if strerror and/or sys_errlist[] exist
19034 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
19035 if set strerror val -f d_strerror; eval $csym; $val; then
19036 echo 'strerror() found.' >&4
19037 d_strerror="$define"
19038 d_strerrm='strerror(e)'
19039 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
19040 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
19041 d_syserrlst="$define"
19043 echo "(Since you don't have sys_errlist[], strerror() is welcome.)"
19044 d_syserrlst="$undef"
19046 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
19047 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
19048 echo 'strerror() found in string header.' >&4
19049 d_strerror="$define"
19050 d_strerrm='strerror(e)'
19051 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
19052 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
19053 d_syserrlst="$define"
19055 echo "(You don't appear to have any sys_errlist[], how can this be?)"
19056 d_syserrlst="$undef"
19058 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
19059 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
19060 d_strerror="$undef"
19061 d_syserrlst="$define"
19062 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
19064 echo 'strerror() and sys_errlist[] NOT found.' >&4
19065 d_strerror="$undef"
19066 d_syserrlst="$undef"
19067 d_strerrm='"unknown"'
19071 : see if strerror_r exists
19072 set strerror_r d_strerror_r
19074 case "$d_strerror_r" in
19076 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
19077 case "$d_strerror_r_proto:$usethreads" in
19078 ":define") d_strerror_r_proto=define
19079 set d_strerror_r_proto strerror_r $hdrs
19083 case "$d_strerror_r_proto" in
19085 case "$strerror_r_proto" in
19086 ''|0) try='int strerror_r(int, char*, size_t);'
19087 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBW ;;
19089 case "$strerror_r_proto" in
19090 ''|0) try='int strerror_r(int, char*, int);'
19091 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBI ;;
19093 case "$strerror_r_proto" in
19094 ''|0) try='char* strerror_r(int, char*, size_t);'
19095 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=B_IBW ;;
19097 case "$strerror_r_proto" in
19098 ''|0) d_strerror_r=undef
19100 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
19101 * ) case "$strerror_r_proto" in
19102 REENTRANT_PROTO*) ;;
19103 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
19105 echo "Prototype: $try" ;;
19108 *) case "$usethreads" in
19109 define) echo "strerror_r has no prototype, not using it." >&4 ;;
19116 *) strerror_r_proto=0
19120 : see if strftime exists
19121 set strftime d_strftime
19124 : see if strlcat exists
19125 set strlcat d_strlcat
19128 : see if strlcpy exists
19129 set strlcpy d_strlcpy
19132 : see if strtod exists
19133 set strtod d_strtod
19136 : see if strtol exists
19137 set strtol d_strtol
19140 : see if strtold exists
19141 set strtold d_strtold
19144 : see if strtoll exists
19145 set strtoll d_strtoll
19148 case "$d_longlong-$d_strtoll" in
19151 Checking whether your strtoll() works okay...
19153 $cat >try.c <<'EOCP'
19156 #define strtoll __strtoll
19159 #define strtoll _strtoll
19162 extern long long int strtoll(char *s, char **, int);
19163 static int bad = 0;
19164 int check(char *s, long long ell, int een) {
19167 gll = strtoll(s, 0, 10);
19168 if (!((gll == ell) && (errno == een)))
19172 check(" 1", 1LL, 0);
19173 check(" 0", 0LL, 0);
19174 check("-1", -1LL, 0);
19175 check("-9223372036854775808", -9223372036854775808LL, 0);
19176 check("-9223372036854775808", -9223372036854775808LL, 0);
19177 check(" 9223372036854775807", 9223372036854775807LL, 0);
19178 check("-9223372036854775808", -9223372036854775808LL, 0);
19179 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
19180 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
19186 if eval $compile; then
19189 ok) echo "Your strtoll() seems to be working okay." ;;
19191 Your strtoll() doesn't seem to be working okay.
19197 echo "(I can't seem to compile the test program--assuming it doesn't)"
19203 : see if strtoq exists
19204 set strtoq d_strtoq
19207 : see if strtoul exists
19208 set strtoul d_strtoul
19211 case "$d_strtoul" in
19214 Checking whether your strtoul() works okay...
19216 $cat >try.c <<'EOCP'
19219 extern unsigned long int strtoul(char *s, char **, int);
19220 static int bad = 0;
19221 void check(char *s, unsigned long eul, int een) {
19224 gul = strtoul(s, 0, 10);
19225 if (!((gul == eul) && (errno == een)))
19229 check(" 1", 1L, 0);
19230 check(" 0", 0L, 0);
19232 case "$longsize" in
19234 $cat >>try.c <<'EOCP'
19235 check("18446744073709551615", 18446744073709551615UL, 0);
19236 check("18446744073709551616", 18446744073709551615UL, ERANGE);
19237 #if 0 /* strtoul() for /^-/ strings is undefined. */
19238 check("-1", 18446744073709551615UL, 0);
19239 check("-18446744073709551614", 2, 0);
19240 check("-18446744073709551615", 1, 0);
19241 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
19242 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
19247 $cat >>try.c <<'EOCP'
19248 check("4294967295", 4294967295UL, 0);
19249 check("4294967296", 4294967295UL, ERANGE);
19250 #if 0 /* strtoul() for /^-/ strings is undefined. */
19251 check("-1", 4294967295UL, 0);
19252 check("-4294967294", 2, 0);
19253 check("-4294967295", 1, 0);
19254 check("-4294967296", 4294967295UL, ERANGE);
19255 check("-4294967297", 4294967295UL, ERANGE);
19260 : Should we write these tests to be more portable by sprintf-ing
19261 : ~0 and then manipulating that char string as input for strtol?
19264 $cat >>try.c <<'EOCP'
19271 if eval $compile; then
19272 case "`$run ./try`" in
19273 ok) echo "Your strtoul() seems to be working okay." ;;
19275 Your strtoul() doesn't seem to be working okay.
19281 echo "(I can't seem to compile the test program--assuming it doesn't)"
19287 : see if strtoull exists
19288 set strtoull d_strtoull
19291 case "$d_longlong-$d_strtoull" in
19294 Checking whether your strtoull() works okay...
19296 $cat >try.c <<'EOCP'
19299 #define strtoull __strtoull
19302 extern unsigned long long int strtoull(char *s, char **, int);
19303 static int bad = 0;
19304 int check(char *s, long long eull, int een) {
19307 gull = strtoull(s, 0, 10);
19308 if (!((gull == eull) && (errno == een)))
19312 check(" 1", 1LL, 0);
19313 check(" 0", 0LL, 0);
19314 check("18446744073709551615", 18446744073709551615ULL, 0);
19315 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
19316 #if 0 /* strtoull() for /^-/ strings is undefined. */
19317 check("-1", 18446744073709551615ULL, 0);
19318 check("-18446744073709551614", 2LL, 0);
19319 check("-18446744073709551615", 1LL, 0);
19320 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
19321 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
19328 if eval $compile; then
19329 case "`$run ./try`" in
19330 ok) echo "Your strtoull() seems to be working okay." ;;
19332 Your strtoull() doesn't seem to be working okay.
19334 d_strtoull="$undef"
19338 echo "(I can't seem to compile the test program--assuming it doesn't)"
19339 d_strtoull="$undef"
19344 : see if strtouq exists
19345 set strtouq d_strtouq
19348 case "$d_strtouq" in
19351 Checking whether your strtouq() works okay...
19353 $cat >try.c <<'EOCP'
19356 extern unsigned long long int strtouq(char *s, char **, int);
19357 static int bad = 0;
19358 void check(char *s, unsigned long long eull, int een) {
19359 unsigned long long gull;
19361 gull = strtouq(s, 0, 10);
19362 if (!((gull == eull) && (errno == een)))
19366 check(" 1", 1LL, 0);
19367 check(" 0", 0LL, 0);
19368 check("18446744073709551615", 18446744073709551615ULL, 0);
19369 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
19370 #if 0 /* strtouq() for /^-/ strings is undefined. */
19371 check("-1", 18446744073709551615ULL, 0);
19372 check("-18446744073709551614", 2LL, 0);
19373 check("-18446744073709551615", 1LL, 0);
19374 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
19375 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
19383 if eval $compile; then
19384 case "`$run ./try`" in
19385 ok) echo "Your strtouq() seems to be working okay." ;;
19387 Your strtouq() doesn't seem to be working okay.
19393 echo "(I can't seem to compile the test program--assuming it doesn't)"
19399 : see if strxfrm exists
19400 set strxfrm d_strxfrm
19403 : see if symlink exists
19404 set symlink d_symlink
19407 : see if syscall exists
19408 set syscall d_syscall
19411 : see if prototype for syscall is available
19413 set d_syscallproto syscall $i_unistd unistd.h
19416 : see if sysconf exists
19417 set sysconf d_sysconf
19420 : see if system exists
19421 set system d_system
19424 : see if tcgetpgrp exists
19425 set tcgetpgrp d_tcgetpgrp
19428 : see if tcsetpgrp exists
19429 set tcsetpgrp d_tcsetpgrp
19432 : see if prototype for telldir is available
19434 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
19437 : see if tgamma exists
19438 set tgamma d_tgamma
19441 : see if time exists
19443 if test "X$d_time" = X -o X"$timetype" = X; then
19444 if set time val -f d_time; eval $csym; $val; then
19445 echo 'time() found.' >&4
19447 rp="What is the type returned by time() on this system?"
19448 set time_t timetype long stdio.h sys/types.h
19451 echo 'time() not found, hope that will do.' >&4
19459 : see if timegm exists
19460 set timegm d_timegm
19463 : see if this is a sys/times.h system
19464 set sys/times.h i_systimes
19467 : see if times exists
19469 if set times val -f d_times; eval $csym; $val; then
19470 echo 'times() found.' >&4
19473 case "$i_systimes" in
19474 "$define") inc='sys/times.h';;
19476 rp="What is the type returned by times() on this system?"
19477 set clock_t clocktype long stdio.h sys/types.h $inc
19480 echo 'times() NOT found, hope that will do.' >&4
19485 : see if tmpnam_r exists
19486 set tmpnam_r d_tmpnam_r
19488 case "$d_tmpnam_r" in
19490 hdrs="$i_systypes sys/types.h define stdio.h "
19491 case "$d_tmpnam_r_proto:$usethreads" in
19492 ":define") d_tmpnam_r_proto=define
19493 set d_tmpnam_r_proto tmpnam_r $hdrs
19497 case "$d_tmpnam_r_proto" in
19499 case "$tmpnam_r_proto" in
19500 ''|0) try='char* tmpnam_r(char*);'
19501 ./protochk "$extern_C $try" $hdrs && tmpnam_r_proto=B_B ;;
19503 case "$tmpnam_r_proto" in
19504 ''|0) d_tmpnam_r=undef
19506 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
19507 * ) case "$tmpnam_r_proto" in
19508 REENTRANT_PROTO*) ;;
19509 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
19511 echo "Prototype: $try" ;;
19514 *) case "$usethreads" in
19515 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
19522 *) tmpnam_r_proto=0
19526 : see if trunc exists
19530 : see if truncate exists
19531 set truncate d_truncate
19534 : see if ttyname_r exists
19535 set ttyname_r d_ttyname_r
19537 case "$d_ttyname_r" in
19539 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
19540 case "$d_ttyname_r_proto:$usethreads" in
19541 ":define") d_ttyname_r_proto=define
19542 set d_ttyname_r_proto ttyname_r $hdrs
19546 case "$d_ttyname_r_proto" in
19548 case "$ttyname_r_proto" in
19549 ''|0) try='int ttyname_r(int, char*, size_t);'
19550 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBW ;;
19552 case "$ttyname_r_proto" in
19553 ''|0) try='int ttyname_r(int, char*, int);'
19554 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBI ;;
19556 case "$ttyname_r_proto" in
19557 ''|0) try='char* ttyname_r(int, char*, int);'
19558 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=B_IBI ;;
19560 case "$ttyname_r_proto" in
19561 ''|0) d_ttyname_r=undef
19563 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
19564 * ) case "$ttyname_r_proto" in
19565 REENTRANT_PROTO*) ;;
19566 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
19568 echo "Prototype: $try" ;;
19571 *) case "$usethreads" in
19572 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
19579 *) ttyname_r_proto=0
19583 : see if tzname[] exists
19585 if set tzname val -a d_tzname; eval $csym; $val; then
19587 echo 'tzname[] found.' >&4
19590 echo 'tzname[] NOT found.' >&4
19595 : Check if is a multiplatform env
19597 darwin) multiarch="$define" ;;
19599 case "$multiarch" in
19600 ''|[nN]*) multiarch="$undef" ;;
19603 : check for ordering of bytes in a UV
19605 case "$multiarch" in
19608 You seem to be doing a multiarchitecture build,
19609 skipping the byteorder check.
19615 case "$byteorder" in
19618 In the following, larger digits indicate more significance. A big-endian
19619 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
19620 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
19621 machines may have weird orders like 3412. A Cray will report 87654321,
19622 an Alpha will report 12345678. If the test program works the default is
19624 I'm now running the test program...
19628 #$i_stdlib I_STDLIB
19630 #include <stdlib.h>
19632 #include <sys/types.h>
19633 typedef $uvtype UV;
19643 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
19645 u.l = (UV)0x04030201;
19646 for (i = 0; i < $uvsize; i++)
19647 printf("%c", u.c[i]+'0');
19654 if eval $compile && $run ./try > /dev/null; then
19657 [1-4][1-4][1-4][1-4]|12345678|87654321)
19658 echo "(The test program ran ok.)"
19659 echo "byteorder=$dflt"
19662 ????|????????) echo "(The test program ran ok.)" ;;
19663 *) echo "(The test program didn't run right for some reason.)" ;;
19668 (I can't seem to compile the test program. Guessing big-endian...)
19671 case "$xxx_prompt" in
19673 rp="What is the order of bytes in $uvtype?"
19686 : Checking 32bit alignedness
19689 Checking to see whether you can access character data unalignedly...
19691 case "$d_u32align" in
19692 '') $cat >try.c <<EOCP
19694 #$i_stdlib I_STDLIB
19696 #include <stdlib.h>
19698 #define U32 $u32type
19699 #define BYTEORDER 0x$byteorder
19701 #include <signal.h>
19703 $signal_t bletch(int s) { exit(4); }
19706 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
19707 volatile U8 buf[8];
19711 if (sizeof(U32) != 4) {
19712 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
19719 signal(SIGBUS, bletch);
19731 for (i = 0; i < 4; i++) {
19732 up = (U32*)(buf + i);
19733 if (! ((*up == 1 << (8*i)) || /* big-endian */
19734 (*up == 1 << (8*(3-i))) /* little-endian */
19738 printf("read failed (%x)\n", *up);
19744 for (i = 0; i < 4; i++) {
19745 up = (U32*)(buf + i);
19747 if (*up != 0xBeef) {
19748 printf("write failed (%x)\n", *up);
19762 if eval $compile_ok; then
19763 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
19764 $run ./try 2>&1 >/dev/null
19767 You can access character data pretty unalignedly.
19769 d_u32align="$undef"
19772 It seems that you must access character data in an aligned manner.
19774 d_u32align="$define"
19778 rp='Can you access character data at unaligned addresses?'
19782 [yY]*) d_u32align="$undef" ;;
19783 *) d_u32align="$define" ;;
19790 : see if ualarm exists
19791 set ualarm d_ualarm
19794 : see if umask exists
19798 : see if unordered exists
19799 set unordered d_unordered
19802 : see if unsetenv exists
19803 set unsetenv d_unsetenv
19806 : see if usleep exists
19807 set usleep d_usleep
19810 : see if prototype for usleep is available
19812 set d_usleepproto usleep $i_unistd unistd.h
19815 : see if closedir exists
19816 set closedir d_closedir
19819 case "$d_closedir" in
19822 echo "Checking whether closedir() returns a status..." >&4
19824 #$i_dirent I_DIRENT /**/
19825 #$i_sysdir I_SYS_DIR /**/
19826 #$i_sysndir I_SYS_NDIR /**/
19827 #$i_systypes I_SYS_TYPES /**/
19829 #if defined(I_SYS_TYPES)
19830 #include <sys/types.h>
19832 #if defined(I_DIRENT)
19833 #include <dirent.h>
19836 #include <sys/ndir.h>
19840 #include <ndir.h> /* may be wrong in the future */
19842 #include <sys/dir.h>
19847 int main() { return closedir(opendir(".")); }
19850 if eval $compile_ok; then
19851 if $run ./try > /dev/null 2>&1 ; then
19852 echo "Yes, it does."
19855 echo "No, it doesn't."
19859 echo "(I can't seem to compile the test program--assuming it doesn't)"
19867 set d_void_closedir
19871 : see if there is a wait4
19875 : see if waitpid exists
19876 set waitpid d_waitpid
19881 $cat >try.c <<'EOCP'
19887 return (wcscmp (s, s) ? 1 : 0);
19892 if eval $compile; then
19895 0) echo "A working wcscmp() found." >&4
19897 *) echo "wcscmp() found, but it doesn't work" >&4
19901 echo "wcscmp() NOT found." >&4
19907 : see if wcstombs exists
19908 set wcstombs d_wcstombs
19913 $cat >try.c <<'EOCP'
19918 wchar_t dst[4], *src = L" ";
19920 return (wcsxfrm (dst, src, 1) ? errno ? errno : 0 : 1);
19925 if eval $compile; then
19928 0) echo "A working wcsxfrm() found." >&4
19930 *) echo "wcsxfrm() found, but it doesn't work" >&4
19934 echo "wcsxfrm() NOT found." >&4
19940 : see if wctomb exists
19941 set wctomb d_wctomb
19944 : see if writev exists
19945 set writev d_writev
19948 : check for alignment requirements
19950 case "$alignbytes" in
19951 '') echo "Checking alignment constraints..." >&4
19952 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
19953 $cat >try.c <<'EOCP'
19954 typedef long double NV;
19957 $cat >try.c <<'EOCP'
19961 $cat >>try.c <<'EOCP'
19969 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
19974 if eval $compile_ok; then
19978 echo "(I can't seem to compile the test program...)"
19980 case "$multiarch" in
19982 : The usual safe value is 8, but Darwin with -Duselongdouble
19983 : needs 16. Hence, we will take 8 as a minimum, but allow
19984 : Configure to pick a larger value if needed.
19985 if $test "$dflt" -lt 8; then
19987 echo "Setting alignment to 8 for multiarch support.">&4
19992 *) dflt="$alignbytes"
19995 rp="Doubles must be aligned on a how-many-byte boundary?"
20000 : set the base revision
20003 : length of character in bytes. Is always 1, otherwise it is not C
20004 : This used to be a test using sizeof
20007 : Check for the number of bits in a character
20008 case "$charbits" in
20009 '') echo "Checking how long a character is (in bits)..." >&4
20016 for (c = 1, n = 0; c; c <<= 1, n++) ;
20017 printf ("%d\n", n);
20022 if eval $compile_ok; then
20026 echo "(I can't seem to compile the test program. Guessing...)"
20033 rp="What is the length of a character (in bits)?"
20037 case "$charbits" in
20040 Your system has an unsigned character size of $charbits bits, which
20041 is rather unusual (normally it is 8 bits). Perl likely will not work
20042 correctly on your system, with subtle bugs in various places.
20044 rp='Do you really want to continue?'
20048 [yY]) echo >&4 "Okay, continuing." ;;
20053 : how do we concatenate cpp tokens here?
20055 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
20056 $cat >cpp_stuff.c <<'EOCP'
20057 #define RCAT(a,b)a/**/b
20058 #define ACAT(a,b)a ## b
20062 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
20063 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
20064 echo "Oh! Smells like ANSI's been here." >&4
20065 echo "We can catify or stringify, separately or together!"
20067 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
20068 echo "Ah, yes! The good old days!" >&4
20069 echo "However, in the good old days we don't know how to stringify and"
20070 echo "catify at the same time."
20074 Hmm, I don't seem to be able to concatenate tokens with your cpp.
20075 You're going to have to edit the values of CAT[2-5] in config.h...
20077 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
20081 : see if this is a db.h system
20087 : Check db version.
20089 echo "Checking Berkeley DB version ..." >&4
20095 #include <sys/types.h>
20097 #$i_stdlib I_STDLIB
20099 #include <stdlib.h>
20102 int main(int argc, char *argv[])
20104 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
20105 int Major, Minor, Patch ;
20106 unsigned long Version ;
20107 (void)db_version(&Major, &Minor, &Patch) ;
20109 printf("%d %d %d %d %d %d\n",
20110 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
20111 Major, Minor, Patch);
20114 printf("You have Berkeley DB Version 2 or greater.\n");
20116 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
20117 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
20118 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
20119 Major, Minor, Patch) ;
20121 /* check that db.h & libdb are compatible */
20122 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
20123 printf("db.h and libdb are incompatible.\n") ;
20127 printf("db.h and libdb are compatible.\n") ;
20129 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
20130 + DB_VERSION_PATCH ;
20132 /* needs to be >= 2.3.4 */
20133 if (Version < 2003004) {
20134 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
20135 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
20141 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
20146 printf("You have Berkeley DB Version 1.\n");
20147 exit(0); /* DB version < 2: the coast is clear. */
20149 exit(1); /* <db.h> not Berkeley DB? */
20155 if eval $compile_ok && $run ./try; then
20156 echo 'Looks OK.' >&4
20158 db_version_major=$1
20159 db_version_minor=$2
20160 db_version_patch=$3
20162 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
20166 : Remove db from list of libraries to use
20167 echo "Removing unusable -ldb from library list" >&4
20168 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
20171 echo "libs = $libs" >&4
20181 : Check the return type needed for hash
20183 echo "Checking return type needed for hash for Berkeley DB ..." >&4
20189 #include <sys/types.h>
20192 #ifndef DB_VERSION_MAJOR
20193 u_int32_t hash_cb (const void* ptr, size_t size)
20199 info.hash = hash_cb;
20203 if $cc $ccflags -c try.c >try.out 2>&1 ; then
20204 if $contains warning try.out >>/dev/null 2>&1 ; then
20207 db_hashtype='u_int32_t'
20210 : XXX Maybe we should just give up here.
20211 db_hashtype=u_int32_t
20213 echo "Help: I can't seem to compile the db test program." >&4
20214 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
20217 echo "Your version of Berkeley DB uses $db_hashtype for hash."
20219 *) db_hashtype=u_int32_t
20224 : Check the return type needed for prefix
20226 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
20232 #include <sys/types.h>
20235 #ifndef DB_VERSION_MAJOR
20236 size_t prefix_cb (const DBT *key1, const DBT *key2)
20242 info.prefix = prefix_cb;
20246 if $cc $ccflags -c try.c >try.out 2>&1 ; then
20247 if $contains warning try.out >>/dev/null 2>&1 ; then
20248 db_prefixtype='int'
20250 db_prefixtype='size_t'
20253 db_prefixtype='size_t'
20254 : XXX Maybe we should just give up here.
20256 echo "Help: I can't seem to compile the db test program." >&4
20257 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
20260 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
20262 *) db_prefixtype='size_t'
20266 : Check what kind of inf/nan your system has
20267 $echo "Checking the kind of infinities and nans you have..." >&4
20269 #define DOUBLESIZE $doublesize
20270 #$d_longdbl HAS_LONG_DOUBLE
20271 #ifdef HAS_LONG_DOUBLE
20272 #define LONGDBLSIZE $longdblsize
20273 #define LONGDBLKIND $longdblkind
20280 /* Note that whether the sign bit is on or off
20281 * for NaN depends on the CPU/FPU, and possibly
20282 * can be affected by the build toolchain.
20284 * For example for older MIPS and HP-PA 2.0 the quiet NaN is:
20285 * 0x7f, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
20286 * 0x7f, 0xf4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
20287 * (respectively) as opposed to the more usual
20288 * 0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
20290 static void bytes(unsigned char *p, unsigned int n) {
20292 for (i = 0; i < n; i++) {
20293 printf("0x%02x%s", p[i], i < n - 1 ? ", " : "\n");
20296 int main(int argc, char *argv[]) {
20297 /* We cannot use 1.0/0.0 and 0.0/0.0 (with L suffixes for long double)
20298 * because some compilers are 'smart' and not only warn but refuse to
20299 * compile such 'illegal' values. */
20300 double dinf = exp(1e9);
20301 double dnan = sqrt(-1.0);
20302 #ifdef HAS_LONG_DOUBLE
20303 long double ldinf = (long double)exp(1e9);
20304 long double ldnan = (long double)sqrt(-1.0);
20307 switch (argv[1][0]) {
20308 case '1': bytes(&dinf, sizeof(dinf)); break;
20309 case '2': bytes(&dnan, sizeof(dnan)); break;
20310 #ifdef HAS_LONG_DOUBLE
20311 # if LONG_DOUBLEKIND == 3 || LONG_DOUBLEKIND == 4
20312 /* the 80-bit long doubles might have garbage in their excess bytes */
20313 memset((char *)&ldinf + 10, '\0', LONG_DOUBLESIZE - 10);
20315 case '3': bytes(&ldinf, sizeof(ldinf)); break;
20316 case '4': bytes(&ldnan, sizeof(ldnan)); break;
20324 if eval $compile; then
20325 doubleinfbytes=`$run ./try 1`
20326 doublenanbytes=`$run ./try 2`
20327 case "$d_longdbl" in
20329 longdblinfbytes=`$run ./try 3`
20330 longdblnanbytes=`$run ./try 4`
20334 # Defaults in case the above test program failed.
20335 case "$doublekind" in
20336 1) # IEEE 754 32-bit LE
20337 doubleinfbytes='0x00, 0x00, 0xf0, 0x7f'
20338 doublenanbytes='0x00, 0x00, 0xf8, 0x7f'
20340 2) # IEEE 754 32-bit BE
20341 doubleinfbytes='0x7f, 0xf0, 0x00, 0x00'
20342 doublenanbytes='0x7f, 0xf8, 0x00, 0x00'
20344 3) # IEEE 754 64-bit LE
20345 doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
20346 doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
20348 4) # IEEE 754 64-bit BE
20349 doubleinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20350 doublenanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20352 5) # IEEE 754 128-bit LE
20353 doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
20354 doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
20356 6) # IEEE 754 128-bit BE
20357 doubleinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20358 doublenanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20360 7) # IEEE 754 64-bit mixed: 32-bit LEs in BE
20361 doubleinfbytes='0x00, 0x00, 0xf0, 0x7f, 0x00, 0x00, 0x00, 0x00'
20362 doublenanbytes='0x00, 0x00, 0xf8, 0x7f, 0x00, 0x00, 0x00, 0x00'
20364 8) # IEEE 754 64-bit mixed: 32-bit BEs in LE
20365 doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x7f, 0xf0, 0x00, 0x00'
20366 doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x7f, 0xf8, 0x00, 0x00'
20369 doubleinfbytes=$undef
20370 doublenanbytes=$undef
20373 case "$longdblkind" in
20374 1) # IEEE 754 128-bit LE
20375 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f'
20376 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f'
20378 2) # IEEE 754 128-bit BE
20379 longdblinfbytes='0x7f, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20380 longdblnanbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20382 3) # IEEE 754 80-bit LE, 12 or 16 bytes (x86)
20383 case "$longdblsize" in
20384 12) # x86 32-bit (96 bits, or 4 x 32, or 12 x 8)
20385 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00'
20386 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x7f, 0x00, 0x00'
20389 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20390 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20393 longdblinfbytes=$undef
20394 longdblnanbytes=$undef
20398 4) # IEEE 754 80-bit BE, 12 or 16 bytes
20399 case "$longdblsize" in
20400 12) # 32-bit system
20401 longdblinfbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20402 longdblnanbytes='0x7f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20404 16) # 64-bit system
20405 longdblinfbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20406 longdblnanbytes='0x7f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20409 longdblinfbytes=$undef
20410 longdblnanbytes=$undef
20414 5) # 128-bit LE "double double"
20415 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
20416 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
20418 6) # 128-bit BE "double double"
20419 longdblinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20420 longdblnanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20423 longdblinfbytes=$undef
20424 longdblnanbytes=$undef
20430 : Check the length of the double mantissa
20431 $echo "Checking how many mantissa bits your doubles have..." >&4
20434 #$i_sunmath I_SUNMATH
20436 # include <float.h>
20439 # include <sunmath.h>
20441 #ifdef DBL_MANT_DIG
20442 # define BITS (DBL_MANT_DIG - 1) /* the implicit bit does not count */
20445 int main(int argc, char *argv[]) {
20447 printf("%d\n", BITS);
20453 if eval $compile; then
20454 doublemantbits=`$run ./try`
20456 doublemantbits="$undef"
20460 : Check the length of the longdouble mantissa
20461 $echo "Checking how many mantissa bits your long doubles have..." >&4
20464 #$i_sunmath I_SUNMATH
20466 # include <float.h>
20469 # include <sunmath.h>
20471 #$d_longdbl HAS_LONG_DOUBLE
20472 #if defined(HAS_LONG_DOUBLE) && defined(LDBL_MANT_DIG)
20473 # if ($longdblkind == 3) || ($longdblkind == 4) /* 80-bit extended precision */
20474 /* This format has no implicit bit. Beware, however, that for
20475 * this format the bare LDBL_MANT_DIG is misleading for inf/nan:
20476 * the top three bits are used for inf (100) / qnan (11x) / snan (101),
20477 * and the top bit must have been one since 387, zero is plain invalid.
20478 * For normal fp values, the LDBL_MANT_DIG is fine, though. */
20479 # define BITS LDBL_MANT_DIG
20480 # elif ($longdblkind == 5 || $longdblkind == 6) /* double double */
20481 /* LDBL_MANT_DIG of 106 (twice 53) would be logical, but for some
20482 * reason e.g. Irix thinks 107. But in any case, we want only
20483 * the number of real bits, the implicit bits are of no interest. */
20484 # define BITS 2 * (DBL_MANT_DIG - 1)
20486 # define BITS (LDBL_MANT_DIG - 1) /* the implicit bit does not count */
20490 int main(int argc, char *argv[]) {
20492 printf("%d\n", BITS);
20498 if eval $compile; then
20499 longdblmantbits=`$run ./try`
20501 longdblmantbits="$undef"
20505 : Check the length of the NV mantissa
20506 $echo "Checking how many mantissa bits your NVs have..." >&4
20507 if test "X$usequadmath" = "X$define"; then
20508 nvmantbits=112 # 128-1-15
20510 if test "X$nvsize" = "X$doublesize"; then
20511 nvmantbits="$doublemantbits"
20513 if test "X$nvsize" = "X$longdblsize"; then
20514 nvmantbits="$longdblmantbits"
20516 nvmantbits="$undef"
20521 : How can we generate normalized random numbers ?
20523 echo "Using our internal random number implementation..." >&4
20526 *-Dmy_rand=*|*-Dmy_srand=*)
20527 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
20528 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
20529 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
20530 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
20534 randfunc=Perl_drand48
20535 drand01="Perl_drand48()"
20536 seedfunc="Perl_drand48_init"
20540 : Determine if this is an EBCDIC system
20542 echo "Determining whether or not we are on an EBCDIC system..." >&4
20543 $cat >try.c <<'EOM'
20546 if ('M'==0xd4) return 0;
20553 if eval $compile_ok; then
20554 if $run ./try; then
20555 echo "You seem to speak EBCDIC." >&4
20558 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
20561 echo "I'm unable to compile the test program." >&4
20562 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
20568 : Check how to flush
20571 Checking how to flush all pending stdio output...
20573 # I only know how to find the first 32 possibly open files on SunOS.
20574 # See also hints/sunos_4_1.sh and util.c --AD
20576 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
20578 $cat >>try.c <<EOCP
20580 #$i_stdlib I_STDLIB
20582 #include <stdlib.h>
20584 #$i_unistd I_UNISTD
20586 # include <unistd.h>
20588 #$d_sysconf HAS_SYSCONF
20589 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
20590 #ifdef HAS_STDIO_STREAM_ARRAY
20591 # define STDIO_STREAM_ARRAY $stdio_stream_array
20596 p = fopen("try.out", "w");
20600 # ifdef TRY_FPRINTF
20604 #ifdef TRY_FFLUSH_NULL
20607 #ifdef TRY_FFLUSH_ALL
20609 long open_max = -1;
20610 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
20611 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
20613 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
20614 open_max = sysconf(_SC_OPEN_MAX);
20617 open_max = FOPEN_MAX;
20620 open_max = OPEN_MAX;
20629 # ifdef HAS_STDIO_STREAM_ARRAY
20630 if (open_max > 0) {
20632 for (i = 0; i < open_max; i++)
20633 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
20634 STDIO_STREAM_ARRAY[i]._file < open_max &&
20635 STDIO_STREAM_ARRAY[i]._flag)
20636 fflush(&STDIO_STREAM_ARRAY[i]);
20644 : first we have to find out how _not_ to flush
20646 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
20648 set try -DTRY_FPUTC
20649 if eval $compile; then
20650 $run ./try 2>/dev/null
20653 if $test ! -s try.out -a "X$code" = X42; then
20659 set try -DTRY_FPRINTF
20660 if eval $compile; then
20661 $run ./try 2>/dev/null
20664 if $test ! -s try.out -a "X$code" = X42; then
20665 output=-DTRY_FPRINTF
20671 : check for fflush NULL behavior
20672 case "$fflushNULL" in
20673 '') set try -DTRY_FFLUSH_NULL $output
20674 if eval $compile; then
20675 $run ./try 2>/dev/null
20678 if $test -s try.out -a "X$code" = X42; then
20679 fflushNULL="`$cat try.out`"
20681 if $test "X$code" != X42; then
20683 (If this test failed, don't worry, we'll try another method shortly.)
20688 $rm -f core try.core core.try.*
20689 case "$fflushNULL" in
20691 Your fflush(NULL) works okay for output streams.
20692 Let's see if it clobbers input pipes...
20694 # As of mid-March 2000 all versions of Solaris appear to have a stdio
20695 # bug that improperly flushes the input end of pipes. So we avoid the
20696 # autoflush on fork/system/exec support for now. :-(
20697 $cat >tryp.c <<EOCP
20700 main(int argc, char **argv)
20706 while ((i = getc(stdin)) != -1
20707 && (*bp++ = i) != '\n'
20708 && bp < &buf[1024])
20711 fprintf(stdout, "%s", buf);
20719 fflushNULL="$define"
20721 if eval $compile; then
20723 # Copy the .c file to the remote host ($to is an ssh-alike if targethost is set)
20724 if $test "X$targethost" != X; then
20727 $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
20729 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
20731 if cmp tryp.c tryp.out >/dev/null 2>&1; then
20733 fflush(NULL) seems to behave okay with input streams.
20735 fflushNULL="$define"
20738 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
20740 fflushNULL="$undef"
20743 $rm -f core tryp.c tryp.core core.tryp.*
20746 Your fflush(NULL) isn't working (contrary to ANSI C).
20748 fflushNULL="$undef"
20751 Cannot figure out whether your fflush(NULL) works or not.
20752 I'm assuming it doesn't (contrary to ANSI C).
20754 fflushNULL="$undef"
20758 $define|true|[yY]*)
20759 fflushNULL="$define"
20762 fflushNULL="$undef"
20765 : check explicit looping only if NULL did not work, and if the pipe
20766 : bug does not show up on an explicit flush too
20767 case "$fflushNULL" in
20769 $cat >tryp.c <<EOCP
20772 main(int argc, char **argv)
20778 while ((i = getc(stdin)) != -1
20779 && (*bp++ = i) != '\n'
20780 && bp < &buf[1024])
20783 fprintf(stdout, "%s", buf);
20792 if eval $compile; then
20794 if $test "X$targethost" != X; then
20797 $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
20799 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
20801 if cmp tryp.c tryp.out >/dev/null 2>&1; then
20803 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
20805 : now check for fflushall behaviour
20806 case "$fflushall" in
20807 '') set try -DTRY_FFLUSH_ALL $output
20808 if eval $compile; then
20810 (Now testing the other method--but note that this also may fail.)
20812 $run ./try 2>/dev/null
20815 if $test -s try.out -a "X$code" = X42; then
20816 fflushall="`$cat try.out`"
20820 case "$fflushall" in
20822 Whew. Flushing explicitly all the stdio streams works.
20824 fflushall="$define"
20827 Sigh. Flushing explicitly all the stdio streams doesn't work.
20832 Cannot figure out whether flushing stdio streams explicitly works or not.
20833 I'm assuming it doesn't.
20839 "$define"|true|[yY]*)
20840 fflushall="$define"
20848 All is futile. Even fflush(stdin) clobbers input pipes!
20855 $rm -f core tryp.c tryp.core core.tryp.*
20857 *) fflushall="$undef"
20861 case "$fflushNULL$fflushall" in
20864 OK, I give up. I cannot figure out how to flush pending stdio output.
20865 We won't be flushing handles at all before fork/exec/popen.
20871 : Store the full pathname to the ar program for use in the C program
20872 : Respect a hint or command line value for full_ar.
20877 : Store the full pathname to the sed program for use in the C program
20880 : see what type gids are declared as in the kernel
20882 echo "Looking for the type for group ids returned by getgid()."
20883 set gid_t gidtype xxx stdio.h sys/types.h
20887 xxx=`./findhdr sys/user.h`
20888 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
20890 unsigned) dflt="$1 $2" ;;
20894 *) dflt="$gidtype";;
20897 gid_t) echo "gid_t found." ;;
20898 *) rp="What is the type for group ids returned by getgid()?"
20904 : Check the size of GID
20907 *_t) zzz="$gidtype" ;;
20910 echo "Checking the size of $zzz..." >&4
20912 #include <sys/types.h>
20914 #$i_stdlib I_STDLIB
20916 #include <stdlib.h>
20919 printf("%d\n", (int)sizeof($gidtype));
20924 if eval $compile_ok; then
20928 echo "(I can't execute the test program--guessing $gidsize.)" >&4
20931 echo "Your $zzz is $gidsize bytes long."
20936 echo "(I can't compile the test program--guessing $gidsize.)" >&4
20940 : Check if GID is signed
20943 *_t) zzz="$gidtype" ;;
20946 echo "Checking the sign of $zzz..." >&4
20948 #include <sys/types.h>
20959 if eval $compile; then
20963 echo "(I can't execute the test program--guessing unsigned.)" >&4
20967 1) echo "Your $zzz is unsigned." ;;
20968 -1) echo "Your $zzz is signed." ;;
20974 echo "(I can't compile the test program--guessing unsigned.)" >&4
20978 : Check 64bit sizes
20981 if $test X"$quadtype" != X; then
20983 echo "Checking how to print 64-bit integers..." >&4
20985 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
20986 $cat >try.c <<'EOCP'
20987 #include <sys/types.h>
20990 int q = 12345678901;
20991 printf("%ld\n", q);
20995 if eval $compile; then
20999 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
21000 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
21001 echo "We will use %d."
21007 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
21008 $cat >try.c <<'EOCP'
21009 #include <sys/types.h>
21012 long q = 12345678901;
21013 printf("%ld\n", q);
21017 if eval $compile; then
21021 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
21022 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
21023 echo "We will use %ld."
21029 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
21030 $cat >try.c <<'EOCP'
21031 #include <sys/types.h>
21032 #include <inttypes.h>
21035 int64_t q = 12345678901;
21036 printf("%" PRId64 "\n", q);
21040 if eval $compile; then
21044 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
21045 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
21046 echo "We will use the C9X style."
21052 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
21054 #include <sys/types.h>
21057 $quadtype q = 12345678901;
21058 printf("%Ld\n", q);
21062 if eval $compile; then
21066 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
21067 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
21068 echo "We will use %Ld."
21074 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
21075 $cat >try.c <<'EOCP'
21076 #include <sys/types.h>
21079 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
21080 printf("%lld\n", q);
21084 if eval $compile; then
21088 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
21089 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
21090 echo "We will use the %lld style."
21096 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
21098 #include <sys/types.h>
21101 $quadtype q = 12345678901;
21102 printf("%qd\n", q);
21106 if eval $compile; then
21110 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
21111 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
21112 echo "We will use %qd."
21118 if $test X"$sPRId64" = X; then
21119 echo "Cannot figure out how to print 64-bit integers." >&4
21126 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
21127 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
21129 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
21130 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
21134 : Check format strings for internal types
21136 $echo "Checking the format strings to be used for Perl's internal types..." >&4
21138 if $test X"$ivsize" = X8; then
21139 ivdformat="$sPRId64"
21140 uvuformat="$sPRIu64"
21141 uvoformat="$sPRIo64"
21142 uvxformat="$sPRIx64"
21143 uvXUformat="$sPRIXU64"
21145 if $test X"$ivsize" = X"$longsize"; then
21152 if $test X"$ivsize" = X"$intsize"; then
21160 if $test X"$ivsize" = X"$shortsize"; then
21171 if $test X"$usequadmath" = X"$define"; then
21179 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
21180 nveformat="$sPRIeldbl"
21181 nvfformat="$sPRIfldbl"
21182 nvgformat="$sPRIgldbl"
21183 nvEUformat="$sPRIEUldbl"
21184 nvFUformat="$sPRIFUldbl"
21185 nvGUformat="$sPRIGUldbl"
21196 case "$ivdformat" in
21197 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
21202 : Check format string for GID
21205 $echo "Checking the format string to be used for gids..." >&4
21208 -1) if $test X"$gidsize" = X"$ivsize"; then
21209 gidformat="$ivdformat"
21211 if $test X"$gidsize" = X"$longsize"; then
21214 if $test X"$gidsize" = X"$intsize"; then
21217 if $test X"$gidsize" = X"$shortsize"; then
21224 *) if $test X"$gidsize" = X"$uvsize"; then
21225 gidformat="$uvuformat"
21227 if $test X"$gidsize" = X"$longsize"; then
21230 if $test X"$gidsize" = X"$intsize"; then
21233 if $test X"$gidsize" = X"$shortsize"; then
21242 : see if getgroups exists
21243 set getgroups d_getgrps
21246 : see if setgroups exists
21247 set setgroups d_setgrps
21250 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
21252 case "$d_getgrps$d_setgrps" in
21254 case "$groupstype" in
21255 '') dflt="$gidtype" ;;
21256 *) dflt="$groupstype" ;;
21259 What type of pointer is the second argument to getgroups() and setgroups()?
21260 Usually this is the same as group ids, $gidtype, but not always.
21263 rp='What type pointer is the second argument to getgroups() and setgroups()?'
21267 *) groupstype="$gidtype";;
21270 : check whether make sets MAKE
21272 echo "Checking if your $make program sets \$(MAKE)..." >&4
21273 case "$make_set_make" in
21275 $sed 's/^X //' > testmake.mak << 'EOF'
21277 X @echo 'maketemp="$(MAKE)"'
21279 case "`$make -f testmake.mak 2>/dev/null`" in
21280 *maketemp=*) make_set_make='#' ;;
21281 *) make_set_make="MAKE=$make" ;;
21283 $rm -f testmake.mak
21286 case "$make_set_make" in
21287 '#') echo "Yup, it does.";;
21288 *) echo "Nope, it doesn't.";;
21291 : see what type is used for mode_t
21292 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
21293 set mode_t modetype int stdio.h sys/types.h
21296 : see if we need va_copy
21298 case "$i_stdarg" in
21301 #include <stdarg.h>
21303 #$i_stdlib I_STDLIB
21305 #include <stdlib.h>
21307 #include <signal.h>
21310 ivfprintf(FILE *f, const char *fmt, va_list *valp)
21312 return vfprintf(f, fmt, *valp);
21316 myvfprintf(FILE *f, const char *fmt, va_list val)
21318 return ivfprintf(f, fmt, &val);
21322 myprintf(char *fmt, ...)
21325 va_start(val, fmt);
21326 return myvfprintf(stdout, fmt, val);
21330 main(int ac, char **av)
21332 signal(SIGSEGV, exit);
21334 myprintf("%s%cs all right, then\n", "that", '\'');
21339 if eval $compile && $run ./try 2>&1 >/dev/null; then
21340 case "`$run ./try`" in
21341 "that's all right, then")
21347 yes) echo "It seems that you don't need va_copy()." >&4
21348 need_va_copy="$undef"
21350 *) echo "It seems that va_copy() or similar will be needed." >&4
21351 need_va_copy="$define"
21356 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
21357 need_va_copy="$undef"
21361 : see what type is used for size_t
21362 rp="What is the type used for the length parameter for string functions?"
21363 set size_t sizetype 'unsigned int' stdio.h sys/types.h
21366 : check for type of arguments to gethostbyaddr.
21367 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
21368 case "$d_gethbyaddr" in
21372 Checking to see what type of arguments are accepted by gethostbyaddr().
21374 hdrs="$define sys/types.h
21375 $d_socket sys/socket.h
21376 $i_niin netinet/in.h
21378 $i_unistd unistd.h"
21379 : The first arg can 'char *' or 'void *'
21380 : The second arg is some of integral type
21381 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
21382 for yyy in size_t long int; do
21383 case "$netdb_host_type" in
21384 '') try="$extern_C struct hostent *gethostbyaddr($xxx, $yyy, int);"
21385 if ./protochk "$try" $hdrs; then
21386 echo "Your system accepts $xxx for the first arg."
21387 echo "...and $yyy for the second arg."
21388 netdb_host_type="$xxx"
21389 netdb_hlen_type="$yyy"
21395 : In case none of those worked, prompt the user.
21396 case "$netdb_host_type" in
21397 '') rp='What is the type for the 1st argument to gethostbyaddr?'
21400 netdb_host_type=$ans
21401 rp='What is the type for the 2nd argument to gethostbyaddr?'
21404 netdb_hlen_type=$ans
21408 *) : no gethostbyaddr, so pick harmless defaults
21409 netdb_host_type='char *'
21410 netdb_hlen_type="$sizetype"
21413 # Remove the "const" if needed. -- but then we'll have a
21415 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
21418 : check for type of argument to gethostbyname.
21419 if test "X$netdb_name_type" = X ; then
21420 case "$d_gethbyname" in
21424 Checking to see what type of argument is accepted by gethostbyname().
21426 hdrs="$define sys/types.h
21427 $d_socket sys/socket.h
21428 $i_niin netinet/in.h
21430 $i_unistd unistd.h"
21431 for xxx in "const char *" "char *"; do
21432 case "$netdb_name_type" in
21433 '') try="$extern_C struct hostent *gethostbyname($xxx);"
21434 if ./protochk "$try" $hdrs; then
21435 echo "Your system accepts $xxx."
21436 netdb_name_type="$xxx"
21441 : In case none of those worked, prompt the user.
21442 case "$netdb_name_type" in
21443 '') rp='What is the type for the 1st argument to gethostbyname?'
21446 netdb_name_type=$ans
21450 *) : no gethostbyname, so pick harmless default
21451 netdb_name_type='char *'
21456 : check for type of 1st argument to getnetbyaddr.
21457 if test "X$netdb_net_type" = X ; then
21458 case "$d_getnbyaddr" in
21462 Checking to see what type of 1st argument is accepted by getnetbyaddr().
21464 hdrs="$define sys/types.h
21465 $d_socket sys/socket.h
21466 $i_niin netinet/in.h
21468 $i_unistd unistd.h"
21469 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
21470 case "$netdb_net_type" in
21471 '') try="$extern_C struct netent *getnetbyaddr($xxx, int);"
21472 if ./protochk "$try" $hdrs; then
21473 echo "Your system accepts $xxx."
21474 netdb_net_type="$xxx"
21479 : In case none of those worked, prompt the user.
21480 case "$netdb_net_type" in
21481 '') rp='What is the type for the 1st argument to getnetbyaddr?'
21484 netdb_net_type=$ans
21488 *) : no getnetbyaddr, so pick harmless default
21489 netdb_net_type='long'
21493 : locate the preferred pager for this system
21500 [a-zA-Z]:/*) dflt=$pg;;
21504 [a-zA-Z]:/*) dflt=$more;;
21508 [a-zA-Z]:/*) dflt=$less;;
21511 '') dflt=/usr/ucb/more;;
21519 rp='What pager is used on your system?'
21523 : see what type pids are declared as in the kernel
21524 rp="What is the type of process ids on this system?"
21525 set pid_t pidtype int stdio.h sys/types.h
21528 : see if ar generates random libraries by itself
21530 echo "Checking how to generate random libraries on your machine..." >&4
21531 echo 'int bar1() { return bar2(); }' > bar1.c
21532 echo 'int bar2() { return 2; }' > bar2.c
21534 #$i_stdlib I_STDLIB
21536 #include <stdlib.h>
21538 int main() { printf("%d\n", bar1()); exit(0); }
21540 $cc $ccflags -c bar1.c >/dev/null 2>&1
21541 $cc $ccflags -c bar2.c >/dev/null 2>&1
21542 $cc $ccflags -c foo.c >/dev/null 2>&1
21543 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
21544 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
21545 $run ./foobar >/dev/null 2>&1; then
21546 echo "$ar appears to generate random libraries itself."
21548 if [ "X$ranlib" = "X" ]; then
21551 elif $ar s bar$_a >/dev/null 2>&1 &&
21552 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
21553 $run ./foobar >/dev/null 2>&1; then
21554 echo "a table of contents needs to be added with '$ar s'."
21557 elif $ar ts bar$_a >/dev/null 2>&1 &&
21558 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
21559 $run ./foobar >/dev/null 2>&1; then
21560 echo "a table of contents needs to be added with '$ar ts'."
21567 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
21568 $test -f $ranlib || ranlib=''
21571 if $test -n "$ranlib"; then
21572 echo "your system has '$ranlib'; we'll use that."
21575 echo "your system doesn't seem to support random libraries"
21576 echo "so we'll use lorder and tsort to order the libraries."
21583 : see if this is a values.h system
21584 set values.h i_values
21587 : Check the max offset that gmtime and localtime accept
21588 echo "Checking max offsets that gmtime () accepts"
21591 define) yyy="#include <values.h>" ;;
21595 case "$sGMTIME_min/$sGMTIME_max" in
21598 #include <sys/types.h>
21607 void gm_check (time_t t, int min_year, int max_year)
21610 if ( tmp == NULL ||
21611 /* Check tm_year overflow */
21612 tmp->tm_year < min_year || tmp->tm_year > max_year)
21623 gm_check (MAXLONG, 69, 0x7fffffff);
21625 if (tmp == NULL || tmp->tm_year < 0) {
21626 for (i = 63; i >= 0; i--) {
21627 time_t x = pt | ((time_t)1 << i);
21628 if (x < 0 || x < pt) continue;
21629 gm_check (x, 69, 0x7fffffff);
21632 printf ("sGMTIME_max=%ld\n", pt);
21641 gm_check (MINLONG, -1900, 70);
21644 for (i = 36; i >= 0; i--) {
21645 time_t x = pt - ((time_t)1 << i);
21646 if (x > 0) continue;
21647 gm_check (x, -1900, 70);
21650 printf ("sGMTIME_min=%ld\n", pt);
21654 int main (int argc, char *argv[])
21656 /* fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t)); */
21663 if eval $compile; then
21664 eval `$run ./try 2>/dev/null`
21666 echo "Cannot determine sGMTIME_max and sGMTIME_min." >&4
21672 echo "Checking max offsets that localtime () accepts"
21674 case "$sLOCALTIME_min/$sLOCALTIME_max" in
21677 #include <sys/types.h>
21686 void local_check (time_t t, int min_year, int max_year)
21688 if (sizeof (time_t) > 4 && t > 0x7ffffffffffff000LL)
21691 tmp = localtime (&t);
21692 if ( tmp == NULL ||
21693 /* Check tm_year overflow */
21694 tmp->tm_year < min_year || tmp->tm_year > max_year)
21698 } /* local_check */
21705 local_check (MAXLONG, 69, 0x7fffffff);
21707 if (tmp == NULL || tmp->tm_year < 0) {
21708 for (i = 63; i >= 0; i--) {
21709 time_t x = pt | ((time_t)1 << i);
21710 if (x < 0 || x < pt) continue;
21711 local_check (x, 69, 0x7fffffff);
21714 printf ("sLOCALTIME_max=%ld\n", pt);
21723 local_check (MINLONG, -1900, 70);
21726 for (i = 36; i >= 0; i--) {
21727 time_t x = pt - ((time_t)1 << i);
21728 if (x > 0) continue;
21729 local_check (x, -1900, 70);
21732 printf ("sLOCALTIME_min=%ld\n", pt);
21736 int main (int argc, char *argv[])
21744 if eval $compile; then
21745 eval `$run ./try 2>/dev/null`
21747 echo "Cannot determine sLOCALTIME_max and sLOCALTIME_min." >&4
21753 : check for type of arguments to select.
21754 case "$selecttype" in
21755 '') case "$d_select" in
21759 Checking to see what type of arguments are accepted by select().
21761 hdrs="$define sys/types.h
21762 $i_systime sys/time.h
21763 $i_sysselct sys/select.h
21764 $d_socket sys/socket.h"
21765 : The first arg can be int, unsigned, or size_t
21766 : The last arg may or may not be 'const'
21768 : void pointer has been seen but using that
21769 : breaks the selectminbits test
21770 for xxx in 'fd_set *' 'int *'; do
21771 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
21772 for tmo in 'struct timeval *' 'const struct timeval *'; do
21774 '') try="$extern_C select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
21775 if ./protochk "$try" $hdrs; then
21776 echo "Your system accepts $xxx."
21785 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
21786 case "$d_fd_set" in
21787 $define) dflt="fd_set *" ;;
21796 *) : no select, so pick a harmless default
21803 : check for the select 'width'
21804 case "$selectminbits" in
21805 '') safebits=`expr $ptrsize \* 8`
21806 case "$d_select" in
21810 Checking to see on how many bits at a time your select() operates...
21813 #include <sys/types.h>
21815 #$i_systime I_SYS_TIME
21816 #$i_systimek I_SYS_TIME_KERNEL
21821 # ifdef I_SYS_TIME_KERNEL
21824 # include <sys/time.h>
21825 # ifdef I_SYS_TIME_KERNEL
21829 #$i_sysselct I_SYS_SELECT
21830 #ifdef I_SYS_SELECT
21831 #include <sys/select.h>
21833 #$d_socket HAS_SOCKET
21835 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
21838 #$i_stdlib I_STDLIB
21840 #include <stdlib.h>
21843 #define S sizeof(*(b))
21845 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
21846 #define NBITS (NBYTES * 8)
21848 char *s = (char *)malloc(NBYTES);
21857 fp = fopen("try.c", "r");
21863 b = ($selecttype)s;
21864 for (i = 0; i < NBITS; i++)
21868 select(fd + 1, b, 0, 0, &t);
21869 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
21871 printf("%d\n", i + 1);
21876 if eval $compile_ok; then
21877 selectminbits=`$run ./try 2>/dev/null`
21878 case "$selectminbits" in
21880 Cannot figure out on how many bits at a time your select() operates.
21881 I'll play safe and guess it is $safebits bits.
21883 selectminbits=$safebits
21884 bits="$safebits bits"
21887 *) bits="$selectminbits bits" ;;
21889 echo "Your select() operates on $bits at a time." >&4
21891 rp='What is the minimum number of bits your select() operates on?'
21892 case "$byteorder" in
21893 12345678) dflt=64 ;;
21899 selectminbits="$val"
21903 *) : no select, so pick a harmless default
21904 selectminbits=$safebits
21910 : Trace out the files included by signal.h, then look for SIGxxx names.
21911 case "$sig_num_init" in
21913 if [ "X$fieldn" = X ]; then
21914 : Just make some guesses. We check them later.
21915 xxx="$sysroot/usr/include/signal.h $sysroot/usr/include/sys/signal.h"
21917 xxx=`echo '#include <signal.h>' |
21918 $cppstdin $cppminus $cppflags 2>/dev/null |
21919 $grep '^[ ]*#.*include' |
21920 $awk "{print \\$$fieldn}" | $sed 's!"!!g' |\
21921 $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
21924 for xx in $xxx /dev/null ; do
21925 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
21927 case "$xxxfiles" in
21928 '') xxxfiles=`./findhdr signal.h` ;;
21931 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
21932 print substr($2, 4, 20)
21934 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
21935 print substr($3, 4, 20)
21937 : Append some common names just in case the awk scan failed.
21938 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
21939 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
21940 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
21941 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
21942 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
21944 : generate a few handy files for later
21945 $cat > signal.c <<EOCP
21946 #include <sys/types.h>
21947 #include <signal.h>
21948 #$i_stdlib I_STDLIB
21950 #include <stdlib.h>
21955 /* Strange style to avoid deeply-nested #if/#else/#endif */
21958 # define NSIG (_NSIG)
21964 # define NSIG (SIGMAX+1)
21970 # define NSIG (SIG_MAX+1)
21976 # define NSIG (_SIG_MAX+1)
21982 # define NSIG (MAXSIG+1)
21988 # define NSIG (MAX_SIG+1)
21993 # ifdef SIGARRAYSIZE
21994 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
22000 # define NSIG (_sys_nsig) /* Solaris 2.5 */
22004 /* Default to some arbitrary number that's big enough to get most
22005 of the common signals.
22011 printf("NSIG %d\n", NSIG);
22017 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
22019 printf "#ifdef SIG"; printf $1; printf "\n"
22020 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
22021 printf $1; printf ");\n"
22025 printf "#endif /* JUST_NSIG */\n";
22026 printf "exit(0);\n}\n";
22029 $cat >signal.awk <<'EOP'
22030 BEGIN { ndups = 0 }
22031 $1 ~ /^NSIG$/ { nsig = $2 }
22032 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
22033 if ($2 > maxsig) { maxsig = $2 }
22034 if (sig_name[$2]) {
22035 dup_name[ndups] = $1
22036 dup_num[ndups] = $2
22048 printf("NSIG %d\n", nsig);
22049 for (n = 1; n < nsig; n++) {
22051 printf("%s %d\n", sig_name[n], sig_num[n])
22054 printf("NUM%d %d\n", n, n)
22057 for (n = 0; n < ndups; n++) {
22058 printf("%s %d\n", dup_name[n], dup_num[n])
22062 $cat >signal_cmd <<EOS
22064 if $test -s signal.lst; then
22065 echo "Using your existing signal.lst file"
22070 $cat >>signal_cmd <<'EOS'
22073 if eval $compile_ok; then
22074 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) |\
22075 $uniq | $awk -f signal.awk >signal.lst
22077 echo "(I can't seem be able to compile the whole test program)" >&4
22078 echo "(I'll try it in little pieces.)" >&4
22079 set signal -DJUST_NSIG
22080 if eval $compile_ok; then
22081 $run ./signal$_exe > signal.nsg
22084 echo "I can't seem to figure out how many signals you have." >&4
22085 echo "Guessing 50." >&4
22086 echo 'NSIG 50' > signal.nsg
22088 : Now look at all the signal names, one at a time.
22089 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
22090 $cat > signal.c <<EOCP
22091 #include <sys/types.h>
22092 #include <signal.h>
22095 printf("$xx %d\n", SIG${xx});
22100 if eval $compile; then
22101 echo "SIG${xx} found."
22102 $run ./signal$_exe >> signal.ls1
22104 echo "SIG${xx} NOT found."
22107 if $test -s signal.ls1; then
22108 $cat signal.nsg signal.ls1 |
22109 $sort -n | $uniq | $awk -f signal.awk >signal.lst
22113 if $test -s signal.lst; then
22116 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
22117 echo 'kill -l' >signal
22118 set X `csh -f <signal`
22122 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
22124 echo $@ | $tr ' ' $trnl | \
22125 $awk '{ printf "%s %d\n", $1, ++s; }
22126 END { printf "NSIG %d\n", ++s }' >signal.lst
22128 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
22130 chmod a+x signal_cmd
22131 $eunicefix signal_cmd
22133 : generate list of signal names
22135 case "$sig_name_init" in
22137 *) case "$sig_num_init" in
22138 ''|*,*) doinit=yes ;;
22143 echo "Generating a list of signal names and numbers..." >&4
22145 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
22146 sig_name=`$awk 'BEGIN { printf "ZERO " }
22147 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
22148 sig_num=`$awk 'BEGIN { printf "0 " }
22149 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
22150 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
22151 !/^NSIG/ { printf "\"%s\", ", $1 }
22152 END { printf "0\n" }' signal.lst`
22153 sig_num_init=`$awk 'BEGIN { printf "0, " }
22154 !/^NSIG/ { printf "%d, ", $2}
22155 END { printf "0\n"}' signal.lst`
22158 echo "The following $sig_count signals are available:"
22160 echo $sig_name | $awk \
22161 'BEGIN { linelen = 0 }
22163 for (i = 1; i <= NF; i++) {
22164 name = "SIG" $i " "
22165 linelen = linelen + length(name)
22166 if (linelen > 70) {
22168 linelen = length(name)
22174 sig_size=`echo $sig_name | awk '{print NF}'`
22175 $rm -f signal signal.c signal.awk signal.lst signal_cmd
22179 : Check size of size
22181 case "$sizetype" in
22182 *_t) zzz="$sizetype" ;;
22183 *) zzz="filesize" ;;
22185 echo "Checking the size of $zzz..." >&4
22187 #include <sys/types.h>
22189 #$i_stdlib I_STDLIB
22191 #include <stdlib.h>
22194 printf("%d\n", (int)sizeof($sizetype));
22199 if eval $compile_ok; then
22203 echo "(I can't execute the test program--guessing $sizesize.)" >&4
22206 echo "Your $zzz size is $sizesize bytes."
22211 echo "(I can't compile the test program--guessing $sizesize.)" >&4
22215 : check for socklen_t
22217 echo "Checking to see if you have socklen_t..." >&4
22219 #include <sys/types.h>
22220 #$d_socket HAS_SOCKET
22222 #include <sys/socket.h>
22224 int main() { socklen_t x = 16; }
22227 if eval $compile; then
22229 echo "You have socklen_t."
22232 echo "You do not have socklen_t."
22233 case "$sizetype" in
22234 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
22241 : see if this is a socks.h system
22242 set socks.h i_socks
22245 : check for type of the size argument to socket calls
22246 case "$d_socket" in
22250 Checking to see what type is the last argument of accept().
22253 case "$d_socklen_t" in
22254 "$define") yyy="$yyy socklen_t"
22256 yyy="$yyy $sizetype int long unsigned"
22257 for xxx in $yyy; do
22258 case "$socksizetype" in
22259 '') try="$extern_C int accept(int, struct sockaddr *, $xxx *);"
22260 case "$usesocks" in
22262 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
22263 echo "Your system accepts '$xxx *' for the last argument of accept()."
22264 socksizetype="$xxx"
22267 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
22268 echo "Your system accepts '$xxx *' for the last argument of accept()."
22269 socksizetype="$xxx"
22276 : In case none of those worked, prompt the user.
22277 case "$socksizetype" in
22278 '') rp='What is the type for socket address structure sizes?'
22285 *) : no sockets, so pick relatively harmless default
22290 : see what type is used for signed size_t
22291 set ssize_t ssizetype int stdio.h sys/types.h
22296 #$i_stdlib I_STDLIB
22298 #include <stdlib.h>
22300 #include <sys/types.h>
22301 #define Size_t $sizetype
22302 #define SSize_t $dflt
22305 if (sizeof(Size_t) == sizeof(SSize_t))
22307 else if (sizeof(Size_t) == sizeof(int))
22316 if eval $compile_ok && $run ./try > /dev/null; then
22317 ssizetype=`$run ./try`
22318 echo "I'll be using $ssizetype for functions returning a byte count." >&4
22321 Help! I can't compile and run the ssize_t test program: please enlighten me!
22322 (This is probably a misconfiguration in your system or libraries, and
22323 you really ought to fix it. Still, I'll try anyway.)
22325 I need a type that is the same size as $sizetype, but is guaranteed to
22326 be signed. Common values are ssize_t, int and long.
22329 rp="What signed type is the same size as $sizetype?"
22335 : Check the size of st_ino
22337 $echo "Checking the size of st_ino..." >&4
22338 $cat > try.c <<EOCP
22339 #include <sys/stat.h>
22341 #$i_stdlib I_STDLIB
22343 #include <stdlib.h>
22347 printf("%d\n", (int)sizeof(st.st_ino));
22352 if eval $compile_ok; then
22356 $echo "(I can't execute the test program--guessing $st_ino_size.)" >&4
22358 *) st_ino_size=$val
22359 $echo "Your st_ino is $st_ino_size bytes long."
22364 $echo "(I can't compile the test program--guessing $st_ino_size.)" >&4
22368 : Check if st_ino is signed
22370 $echo "Checking the sign of st_ino..." >&4
22371 $cat > try.c <<EOCP
22372 #include <sys/stat.h>
22377 if (foo.st_ino < 0)
22384 if eval $compile; then
22388 $echo "(I can't execute the test program--guessing unsigned.)" >&4
22390 *) st_ino_sign=$val
22391 case "$st_ino_sign" in
22392 1) $echo "Your st_ino is unsigned." ;;
22393 -1) $echo "Your st_ino is signed." ;;
22399 $echo "(I can't compile the test program--guessing unsigned.)" >&4
22403 : see what type of char stdio uses.
22405 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
22406 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
22407 echo "Your stdio uses unsigned chars." >&4
22408 stdchar="unsigned char"
22410 echo "Your stdio uses signed chars." >&4
22415 : see what type uids are declared as in the kernel
22417 echo "Looking for the type for user ids returned by getuid()."
22418 set uid_t uidtype xxx stdio.h sys/types.h
22422 xxx=`./findhdr sys/user.h`
22423 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
22425 unsigned) dflt="$1 $2" ;;
22429 *) dflt="$uidtype";;
22432 uid_t) echo "uid_t found." ;;
22433 *) rp="What is the type for user ids returned by getuid()?"
22439 : Check size of UID
22442 *_t) zzz="$uidtype" ;;
22445 echo "Checking the size of $zzz..." >&4
22447 #include <sys/types.h>
22449 #$i_stdlib I_STDLIB
22451 #include <stdlib.h>
22454 printf("%d\n", (int)sizeof($uidtype));
22459 if eval $compile_ok; then
22463 echo "(I can't execute the test program--guessing $uidsize.)" >&4
22466 echo "Your $zzz is $uidsize bytes long."
22471 echo "(I can't compile the test program--guessing $uidsize.)" >&4
22474 : Check if UID is signed
22477 *_t) zzz="$uidtype" ;;
22480 echo "Checking the sign of $zzz..." >&4
22482 #include <sys/types.h>
22493 if eval $compile; then
22497 echo "(I can't execute the test program--guessing unsigned.)" >&4
22501 1) echo "Your $zzz is unsigned." ;;
22502 -1) echo "Your $zzz is signed." ;;
22508 echo "(I can't compile the test program--guessing unsigned.)" >&4
22512 : Check format string for UID
22514 $echo "Checking the format string to be used for uids..." >&4
22517 -1) if $test X"$uidsize" = X"$ivsize"; then
22518 uidformat="$ivdformat"
22520 if $test X"$uidsize" = X"$longsize"; then
22523 if $test X"$uidsize" = X"$intsize"; then
22526 if $test X"$uidsize" = X"$shortsize"; then
22533 *) if $test X"$uidsize" = X"$uvsize"; then
22534 uidformat="$uvuformat"
22536 if $test X"$uidsize" = X"$longsize"; then
22539 if $test X"$uidsize" = X"$intsize"; then
22542 if $test X"$uidsize" = X"$shortsize"; then
22551 : Determine if we can use sysctl with KERN_PROC_PATHNAME to find executing program
22553 echo "Determining whether we can use sysctl with KERN_PROC_PATHNAME to find executing program..." >&4
22554 $cat >try.c <<'EOM'
22555 /* Intentionally a long probe as I'd like to sanity check that the exact
22556 approach is going to work, as thinking it will work, but only having it
22557 part working at runtime is worse than not having it. */
22559 #include <sys/types.h>
22560 #include <sys/sysctl.h>
22561 #include <sys/param.h>
22563 #include <string.h>
22564 #include <stdlib.h>
22565 #include <unistd.h>
22568 main(int argc, char **argv) {
22570 char *argv_leaf = strrchr(argv[0], '/');
22576 mib[1] = KERN_PROC;
22577 mib[2] = KERN_PROC_PATHNAME;
22581 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
22585 if (sysctl(mib, 4, NULL, &size, NULL, 0)) {
22590 if (size < strlen(argv_leaf) + 1) {
22591 fprintf(stderr, "size %lu is too short for a path\n",
22592 (unsigned long) size);
22596 if (size > MAXPATHLEN * MAXPATHLEN) {
22597 fprintf(stderr, "size %lu is too long for a path\n",
22598 (unsigned long) size);
22602 buffer = malloc(size);
22608 if (sysctl(mib, 4, buffer, &size, NULL, 0)) {
22613 if (strlen(buffer) + 1 != size) {
22614 fprintf(stderr, "size != strlen(buffer) + 1 (%lu != %lu)\n",
22615 (unsigned long)size, (unsigned long)strlen(buffer) + 1);
22620 if (*buffer != '/') {
22621 fprintf(stderr, "Not an absolute path: '%s'\n", buffer);
22625 if (strstr(buffer, "/./")) {
22626 fprintf(stderr, "Contains /./: '%s'\n", buffer);
22630 if (strstr(buffer, "/../")) {
22631 fprintf(stderr, "Contains /../: '%s'\n", buffer);
22635 buffer_leaf = strrchr(buffer, '/');
22636 if (strcmp(buffer_leaf, argv_leaf) != 0) {
22637 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], buffer);
22649 if eval $compile; then
22650 if $run ./try; then
22651 echo "You can use sysctl with KERN_PROC_PATHNAME to find the executing program." >&4
22654 echo "Nope, sysctl with KERN_PROC_PATHNAME doesn't work here." >&4
22658 echo "I'm unable to compile the test program." >&4
22659 echo "I'll assume no sysctl with KERN_PROC_PATHNAME here." >&4
22663 set usekernprocpathname
22666 : Determine if we can use _NSGetExecutablePath to find executing program
22668 echo "Determining whether we can use _NSGetExecutablePath to find executing program..." >&4
22669 $cat >try.c <<'EOM'
22670 /* Intentionally a long probe as I'd like to sanity check that the exact
22671 approach is going to work, as thinking it will work, but only having it
22672 part working at runtime is worse than not having it. */
22673 #include <mach-o/dyld.h>
22675 #include <stdlib.h>
22676 #include <sys/param.h>
22677 #include <string.h>
22680 main(int argc, char **argv) {
22682 uint32_t size = sizeof(buf);
22686 char *argv_leaf = strrchr(argv[0], '/');
22690 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
22694 _NSGetExecutablePath(buf, &size);
22695 if (size > MAXPATHLEN * MAXPATHLEN) {
22696 fprintf(stderr, "_NSGetExecutablePath size %u is too long for a path\n",
22697 (unsigned int) size);
22701 buffer = malloc(size);
22707 result = _NSGetExecutablePath(buffer, &size);
22709 fprintf(stderr, "_NSGetExecutablePath returned %i for a size of %u\n",
22710 result, (unsigned int) size);
22714 tidied = realpath(buffer, NULL);
22716 perror("realpath");
22722 if (*tidied != '/') {
22723 fprintf(stderr, "Not an absolute path: '%s'\n", tidied);
22727 if (strstr(tidied, "/./")) {
22728 fprintf(stderr, "Contains /./: '%s'\n", tidied);
22732 if (strstr(tidied, "/../")) {
22733 fprintf(stderr, "Contains /../: '%s'\n", tidied);
22737 tidied_leaf = strrchr(tidied, '/');
22738 if (strcmp(tidied_leaf, argv_leaf) != 0) {
22739 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], tidied);
22751 if eval $compile; then
22752 if $run ./try; then
22753 echo "You can use _NSGetExecutablePath to find the executing program." >&4
22756 echo "Nope, _NSGetExecutablePath doesn't work here." >&4
22759 echo "I'm unable to compile the test program." >&4
22760 echo "I'll assume no _NSGetExecutablePath here." >&4
22763 set usensgetexecutablepath
22766 : Check if site customization support was requested
22767 case "$usesitecustomize" in
22768 $define|true|[Yy]*)
22769 usesitecustomize="$define"
22772 usesitecustomize="$undef"
22776 : see if prototypes support variable argument declarations
22778 case "$prototype$i_stdarg" in
22780 echo "It appears we'll be able to prototype varargs functions." >&4
22784 echo "Too bad... We won't be using prototyped varargs functions..." >&4
22791 : determine compiler compiler
22800 if $test -f "$byacc$_exe"; then
22802 comp="byacc or $comp"
22804 if $test -f "$bison$_exe"; then
22805 comp="$comp or bison -y"
22807 rp="Which compiler compiler ($comp) shall I use?"
22816 echo "(Adding -y option to bison to get yacc-compatible behavior.)"
22822 : see if this is a assert.h system
22823 set assert.h i_assert
22826 : see if this is a bfd.h system
22830 : see if this is an execinfo.h system
22831 set execinfo.h i_execinfo
22834 : see if this is a fenv.h system
22838 : see if this is a fp.h system
22842 : see if this is a fp_class.h system
22843 set fp_class.h i_fp_class
22846 : see if gdbm.h is available
22851 : see if gdbm_open exists
22852 set gdbm_open d_gdbm_open
22854 case "$d_gdbm_open" in
22857 echo "We won't be including <gdbm.h>"
22866 : see if this is a ieeefp.h system
22867 case "$i_ieeefp" in
22868 '' ) set ieeefp.h i_ieeefp
22873 : see if this is a libutil.h system
22874 set libutil.h i_libutil
22877 : see if mach cthreads are available
22878 if test "X$usethreads" = "X$define"; then
22879 set mach/cthreads.h i_machcthr
22882 i_machcthr="$undef"
22885 : see if net/errno.h is available
22887 set net/errno.h val
22890 : Unfortunately, it causes problems on some systems. Arrgh.
22893 cat > try.c <<'EOM'
22896 #include <net/errno.h>
22902 if $cc $ccflags -c try.c >/dev/null 2>&1; then
22903 echo "We'll be including <net/errno.h>." >&4
22905 echo "We won't be including <net/errno.h>." >&4
22914 : see if netinet/tcp.h is available
22915 set netinet/tcp.h i_netinettcp
22918 : see if this is a poll.h system
22922 : see if this is a prot.h system
22926 : Preprocessor symbols
22928 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
22929 $cat <<'EOSH' > Cppsym.know
22930 a29k aarch64 ABI64 aegis AES_SOURCE AIX AIX32 AIX370 AIX41 AIX42
22931 AIX43 aixpc AIX_SOURCE alliant ALL_SOURCE alpha AM29000 am29000
22932 AMD64 amd64 amiga AMIGAOS AMIX ansi ANSI_C_SOURCE apollo arch_ppc
22933 arch_pwr ardent ARM ARM32 atarist att386 att3b
22934 BeOS BIG_ENDIAN BIT_MSF BSD bsd bsd43 bsd4_2 BSD4_3 bsd4_3 bsd4_4
22935 BSDCOMPAT bsdi BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES bull
22936 byteorder byte_order
22937 c cadmus clang clipper CMU COFF COMPILER_VERSION concurrent
22938 convex cpu CRAY cray CRAYMPP ctix CX_UX CYGWIN
22939 DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO Dynix DynixPTX
22940 ELF encore EPI EXTENSIONS
22941 FAVOR_BSD FILE_OFFSET_BITS FORTIFY_SOURCE FreeBSD
22942 GCC_NEW_VARARGS gcos gcx gimpel GLIBC GLIBC_MINOR GNUC GNUC_MINOR
22943 GNU_LIBRARY GNU_SOURCE GO32 gould GOULD_PN
22944 H3050R H3050RX hbullx20 hcx host_mips hp200 hp300 HP700 hp700
22945 hp800 hp9000 hp9000s200 hp9000s300 hp9000s400 hp9000s500
22946 hp9000s700 hp9000s800 hp9k8 hppa hpux HPUX_SOURCE hp_osf
22947 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960 IA32 IA64
22948 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
22949 INLINE_INTRINSICS INT64 INTEL interdata INTRINSICS is68k itanium
22951 LANGUAGE_C LARGEFILE64_SOURCE LARGEFILE_SOURCE LARGE_FILE_API
22952 LFS64_LARGEFILE LFS_LARGEFILE LIBCATAMOUNT Linux LITTLE_ENDIAN
22953 LONG64 LONGDOUBLE LONGLONG LONG_DOUBLE LONG_LONG LP64 luna
22955 M68000 m68k m88100 m88k M88KBCS_TARGET MACH machine MachTen
22956 MATH_HAS_NO_SIDE_EFFECTS mc300 mc500 mc68000 mc68010 mc68020
22957 mc68030 mc68040 mc68060 mc68k mc68k32 mc700 mc88000 mc88100
22958 merlin mert MiNT mips MIPSEB MIPSEL MIPS_FPSET MIPS_ISA MIPS_SIM
22959 MIPS_SZINT MIPS_SZLONG MIPS_SZPTR MODERN_C motorola mpeix MSDOS
22960 MTXINU MULTIMAX MVS mvs M_AMD64 M_ARM M_ARMT M_COFF M_I186 M_I286
22961 M_I386 M_I8086 M_I86 M_I86SM M_IA64 M_IX86 M_PPC M_SYS3 M_SYS5
22962 M_SYSIII M_SYSV M_UNIX M_X86 M_XENIX
22963 n16 ncl_el ncl_mr NetBSD news1500 news1700 news1800 news1900
22964 news3700 news700 news800 news900 NeXT NLS nonstopux ns16000
22965 ns32000 ns32016 ns32332 ns32k nsc32000
22966 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
22967 PARAGON parisc pa_risc PA_RISC1_1 PA_RISC2_0 pc532 pdp11 PGC PIC
22968 plexus PORTAR posix POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
22969 POSIX_C_SOURCE POSIX_SOURCE POWER powerpc ppc PROTOTYPES PWB pyr
22971 R3000 REENTRANT RES Rhapsody RISC6000 riscix riscos RT
22972 S390 S390x SA110 SCO scs sequent sgi SGI_SOURCE SH SH3 sinix
22973 SIZE_INT SIZE_LONG SIZE_PTR SOCKETS_SOURCE SOCKET_SOURCE sony
22974 sonyrisc sony_news sparc sparclite sparcv8 sparcv9 spectrum
22975 stardent stdc STDC_EXT stratos sun sun3 sun386 Sun386i svr3 svr4
22976 SVR4_2 SVR4_SOURCE svr5 SX system SYSTYPE_BSD SYSTYPE_BSD43
22977 SYSTYPE_BSD44 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3
22978 SYSV4 SYSV5 sysV68 sysV88
22979 Tek4132 Tek4300 thumb thw_370 thw_intel thw_rs6000 titan TM3200
22980 TM5400 TM5600 tower tower32 tower32_200 tower32_600 tower32_700
22981 tower32_800 tower32_850 tss
22982 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5 ultrix UMAXV UnicomPBB
22983 UnicomPBD UNICOS UNICOSMK unix UNIX95 UNIX99 unixpc unos USE_BSD
22984 USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE
22985 USE_LARGEFILE64 USE_MISC USE_POSIX USE_POSIX199309
22986 USE_POSIX199506 USE_POSIX2 USE_REENTRANT USE_SVID USE_UNIX98
22987 USE_XOPEN USE_XOPEN_EXTENDED USGr4 USGr4_2 UTek Utek UTS UWIN
22989 vax venix VMESA vms
22990 x86_64 xenix Xenix286 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2
22991 XPG2_EXTENDED XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
22994 # Maybe put other stuff here too.
22995 ./tr '-' '_' <<EOSH >>Cppsym.know
22998 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
22999 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
23000 $cat Cppsym.know > Cppsym.c
23001 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
23002 $rm -f Cppsym.a Cppsym.b Cppsym.c
23003 cat <<EOSH > Cppsym
23005 if $test \$# -gt 0; then
23006 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
23007 if $test -s Cppsym.got; then
23014 $tr " " "$trnl" | ./Cppsym.try
23020 cat <<EOSH > Cppsym.try
23022 cat <<'EOCP' > try.c
23025 #define STRINGIFY(a) "a"
23027 #if cpp_stuff == 42
23028 #define StGiFy(a) #a
23029 #define STRINGIFY(a) StGiFy(a)
23031 #if $cpp_stuff != 1 && $cpp_stuff != 42
23032 # include "Bletch: How does this C preprocessor stringify macros?"
23038 cat <<'EOSH' >> Cppsym.try
23040 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
23041 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
23042 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
23043 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
23045 echo 'return 0;}' >> try.c
23047 cat <<EOSH >> Cppsym.try
23049 case "$osname-$gccversion" in
23050 irix-) ccflags="\$ccflags -woff 1178" ;;
23051 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
23053 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
23055 chmod +x Cppsym.try
23056 $eunicefix Cppsym.try
23057 ./Cppsym < Cppsym.know | $sort | $uniq > Cppsym.true
23058 : Add in any Linux cpp "predefined macros":
23059 case "$osname::$gccversion" in
23060 *linux*::*.*|*gnukfreebsd*::*.*|gnu::*.*)
23062 rm -f $tHdrH'.h' $tHdrH
23064 # Filter out macro arguments, such as Linux's __INT8_C(c)
23065 if $cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
23066 sed -e 's/#define[\ \ ]*//;s/[\ \ ].*$//' -e 's/(.*//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
23067 if [ -s $tHdrH'_cppsym.real' ]; then
23068 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
23071 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
23074 : now check the C compiler for additional symbols
23075 postprocess_cc_v=''
23077 aix) postprocess_cc_v="|$tr , ' '" ;;
23084 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
23087 -D*) echo "\$i" | $sed 's/^-D//';;
23088 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
23093 postprocess_cc_v=''
23096 ./ccsym > ccsym1.raw
23097 if $test -s ccsym1.raw; then
23098 $sort ccsym1.raw | $uniq >ccsym.raw
23100 mv ccsym1.raw ccsym.raw
23103 $awk '/\=/ { print $0; next }
23104 { print $0"=1" }' ccsym.raw >ccsym.list
23105 $comm -13 Cppsym.true ccsym.list >ccsym.own
23106 $comm -12 Cppsym.true ccsym.list >ccsym.com
23107 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
23109 if $test -z ccsym.raw; then
23110 echo "Your C compiler doesn't seem to define any symbols!" >&4
23112 echo "However, your C preprocessor defines the following symbols:"
23115 cppsymbols=`$cat Cppsym.true`
23116 cppsymbols=`echo $cppsymbols`
23117 cppccsymbols="$cppsymbols"
23119 if $test -s ccsym.com; then
23120 echo "Your C compiler and pre-processor define these symbols:"
23121 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
23124 cppccsymbols=`$cat ccsym.com`
23125 cppccsymbols=`echo $cppccsymbols`
23126 $test "$silent" || sleep 1
23128 if $test -s ccsym.cpp; then
23129 $test "$also" && echo " "
23130 echo "Your C pre-processor ${also}defines the following symbols:"
23131 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
23133 cppsymbols=`$cat ccsym.cpp`
23134 cppsymbols=`echo $cppsymbols`
23135 $test "$silent" || sleep 1
23137 if $test -s ccsym.own; then
23138 $test "$also" && echo " "
23139 echo "Your C compiler ${also}defines the following cpp symbols:"
23140 $sed -e 's/\(..*\)=1/\1/' ccsym.own
23141 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
23142 ccsymbols=`$cat ccsym.own`
23143 ccsymbols=`echo $ccsymbols`
23144 $test "$silent" || sleep 1
23148 : add -D_FORTIFY_SOURCE if feasible and not already there
23149 case "$gccversion" in
23150 4.*) case "$optimize$ccflags" in
23151 *-O*) case "$ccflags$cppsymbols" in
23152 *_FORTIFY_SOURCE=*) # Don't add it again.
23153 echo "You seem to have -D_FORTIFY_SOURCE already, not adding it." >&4
23155 *) echo "Adding -D_FORTIFY_SOURCE=2 to ccflags..." >&4
23156 ccflags="$ccflags -D_FORTIFY_SOURCE=2"
23160 *) echo "You have gcc 4.* but not optimizing, not adding -D_FORTIFY_SOURCE." >&4
23164 *) echo "You seem not to have gcc 4.*, not adding -D_FORTIFY_SOURCE." >&4
23168 : see if this is a termio system
23172 if $test `./findhdr termios.h`; then
23173 set tcsetattr i_termios
23179 "$define") echo "You have POSIX termios.h... good!" >&4;;
23180 *) if ./Cppsym pyr; then
23181 case "`$run /bin/universe`" in
23182 ucb) if $test `./findhdr sgtty.h`; then
23184 echo "<sgtty.h> found." >&4
23186 echo "System is pyramid with BSD universe."
23187 ./warn "<sgtty.h> not found--you could have problems."
23189 *) if $test `./findhdr termio.h`; then
23191 echo "<termio.h> found." >&4
23193 echo "System is pyramid with USG universe."
23194 ./warn "<termio.h> not found--you could have problems."
23198 if $test `./findhdr termio.h`; then
23199 echo "<termio.h> found." >&4
23201 elif $test `./findhdr sgtty.h`; then
23202 echo "<sgtty.h> found." >&4
23205 ./warn "Neither <termio.h> nor <sgtty.h> found--cross fingers!"
23208 if $test `./findhdr sgtty.h`; then
23209 echo "<sgtty.h> found." >&4
23211 elif $test `./findhdr termio.h`; then
23212 echo "<termio.h> found." >&4
23215 ./warn "Neither <sgtty.h> nor <termio.h> found--cross fingers!"
23219 set i_termio; eval $setvar
23220 val=$val2; set i_sgtty; eval $setvar
23221 val=$val3; set i_termios; eval $setvar
23223 : see if stdbool is available
23224 : we want a real compile instead of Inhdr because some Solaris systems
23225 : have stdbool.h, but it can only be used if the compiler indicates it
23226 : is sufficiently c99-compliant.
23230 #include <stdbool.h>
23235 int main(int argc, char **argv)
23241 if eval $compile; then
23242 echo "<stdbool.h> found." >&4
23245 echo "<stdbool.h> NOT found." >&4
23252 : see if stddef is available
23253 set stddef.h i_stddef
23256 : see if stdint is available
23257 set stdint.h i_stdint
23260 : see if sys/access.h is available
23261 set sys/access.h i_sysaccess
23264 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
23265 set sys/filio.h i_sysfilio
23268 if $test `./findhdr sys/ioctl.h`; then
23270 echo '<sys/ioctl.h> found.' >&4
23273 if $test $i_sysfilio = "$define"; then
23274 echo '<sys/ioctl.h> NOT found.' >&4
23276 $test $i_sgtty = "$define" && xxx="sgtty.h"
23277 $test $i_termio = "$define" && xxx="termio.h"
23278 $test $i_termios = "$define" && xxx="termios.h"
23279 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
23285 : see if socket ioctl defs are in sys/sockio.h
23287 xxx=`./findhdr sys/sockio.h`
23288 if $test "$xxx"; then
23289 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
23291 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
23294 echo "No socket ioctls found in <sys/sockio.h>." >&4
23299 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
23305 : see if this is a syslog.h system
23306 set syslog.h i_syslog
23309 : see if this is a sys/mode.h system
23310 set sys/mode.h i_sysmode
23313 : see if there is a sys/poll.h file
23314 set sys/poll.h i_syspoll
23317 : see if sys/resource.h has to be included
23318 set sys/resource.h i_sysresrc
23321 : see if sys/security.h is available
23322 set sys/security.h i_syssecrt
23325 : see if this is a sys/un.h system
23326 set sys/un.h i_sysun
23329 : see if this is a sys/utsname.h system
23330 set sys/utsname.h i_sysutsname
23333 : see if this is a syswait system
23334 set sys/wait.h i_syswait
23337 : see if this is an utime system
23338 set utime.h i_utime
23341 : see if this is a vfork system
23344 set vfork.h i_vfork
23354 echo "Looking for extensions..." >&4
23355 : If we are using the old config.sh, nonxs_extensions and xs_extensions may
23356 : contain old or inaccurate or duplicate values.
23357 nonxs_extensions=''
23359 : We do not use find because it might not be available.
23360 : We do not just use MANIFEST because the user may have dropped
23361 : some additional extensions into the source tree and expect them
23364 : Function to recursively find available extensions, ignoring DynaLoader
23365 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
23366 : In 5.10.1 and later, extensions are stored in directories
23367 : like File-Glob instead of the older File/Glob/.
23371 DynaLoader|dynaload) ;;
23373 this_ext=`echo "$xxx" | $sed -e s/-/\\\//g`;
23374 case "$this_ext" in
23375 Scalar/List/Utils) this_ext="List/Util" ;;
23376 PathTools) this_ext="Cwd" ;;
23378 echo " $xs_extensions $nonxs_extensions" > "$tdir/$$.tmp";
23379 if $contains " $this_ext " "$tdir/$$.tmp"; then
23381 echo "Duplicate directories detected for extension $xxx" >&4;
23382 echo "Configure cannot correctly recover from this - shall I abort?" >&4;
23383 case "$knowitall" in
23391 echo "Ok. Stopping Configure." >&4;
23392 echo "Please remove the duplicate directory (e.g. using git clean) and then re-run Configure" >&4;
23395 echo "Ok. You will need to correct config.sh before running make." >&4;
23397 $ls -1 "$xxx" > "$tdir/$$.tmp";
23398 if $contains "\.xs$" "$tdir/$$.tmp" > /dev/null 2>&1; then
23399 xs_extensions="$xs_extensions $this_ext";
23400 elif $contains "\.c$" "$tdir/$$.tmp" > /dev/null 2>&1; then
23401 xs_extensions="$xs_extensions $this_ext";
23402 elif $test -d "$xxx"; then
23403 nonxs_extensions="$nonxs_extensions $this_ext";
23405 $rm -f "$tdir/$$.tmp";
23413 eval $find_extensions
23417 eval $find_extensions
23421 eval $find_extensions
23422 set X $xs_extensions
23424 xs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
23425 set X $nonxs_extensions
23427 nonxs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
23429 known_extensions=`echo $nonxs_extensions $xs_extensions | tr ' ' $trnl | $sort | tr $trnl ' '`
23431 : Now see which are supported on this system.
23433 for xxx in $xs_extensions ; do
23437 amigaos) avail_ext="$avail_ext $xxx" ;;
23442 $define) avail_ext="$avail_ext $xxx" ;;
23445 GDBM_File|gdbm_fil)
23447 $define) avail_ext="$avail_ext $xxx" ;;
23450 I18N/Langinfo|i18n_lan)
23451 case "$i_langinfo$d_nl_langinfo" in
23452 $define$define) avail_ext="$avail_ext $xxx" ;;
23456 : XXX Do we need a useipcsysv variable here
23457 case "${d_msg}${d_sem}${d_shm}" in
23458 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
23461 NDBM_File|ndbm_fil)
23464 case "$osname-$use64bitint" in
23467 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
23470 *) avail_ext="$avail_ext $xxx" ;;
23475 ODBM_File|odbm_fil)
23476 case "${i_dbm}${i_rpcsvcdbm}" in
23478 case "$d_cplusplus" in
23479 define) ;; # delete as a function name will not work
23480 *) case "$osname-$use64bitint" in
23483 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
23486 *) avail_ext="$avail_ext $xxx" ;;
23494 case "$useopcode" in
23495 true|define|y) avail_ext="$avail_ext $xxx" ;;
23499 case "$useposix" in
23500 true|define|y) avail_ext="$avail_ext $xxx" ;;
23504 case "$d_socket" in
23505 true|$define|y) avail_ext="$avail_ext $xxx" ;;
23508 Sys/Syslog|sys/syslog)
23510 amigaos) ;; # not really very useful on AmigaOS
23512 : XXX syslog requires socket
23513 case "$d_socket" in
23514 true|$define|y) avail_ext="$avail_ext $xxx" ;;
23520 case "$usethreads" in
23522 case "$use5005threads" in
23523 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
23527 threads|threads/shared)
23528 # threads and threads::shared are special cases.
23529 # To stop people from asking "Perl 5.8.0 was supposed
23530 # to have this new fancy threads implementation but my
23531 # perl doesn't have it" and from people trying to
23532 # (re)install the threads module using CPAN.pm and
23533 # CPAN.pm then offering to reinstall Perl 5.8.0,
23534 # the threads.pm and threads/shared.pm will always be
23535 # there, croaking informatively ("you need to rebuild
23536 # all of Perl with threads, sorry") when threads haven't
23537 # been compiled in.
23539 avail_ext="$avail_ext $xxx"
23545 cygwin) avail_ext="$avail_ext $xxx" ;;
23548 XS/APItest|xs/apitest)
23549 # This is just for testing. Skip it unless we have dynamic loading.
23552 $define) avail_ext="$avail_ext $xxx" ;;
23555 XS/Typemap|xs/typemap)
23556 # This is just for testing. Skip it unless we have dynamic loading.
23558 $define) avail_ext="$avail_ext $xxx" ;;
23561 *) avail_ext="$avail_ext $xxx"
23570 case "$onlyextensions" in
23572 *) keepextensions=''
23573 echo "You have requested that only certain extensions be included..." >&4
23574 for i in $onlyextensions; do
23575 case " $avail_ext " in
23577 echo "Keeping extension $i."
23578 keepextensions="$keepextensions $i"
23580 *) echo "Ignoring extension $i." ;;
23583 avail_ext="$keepextensions"
23587 case "$noextensions" in
23589 *) keepextensions=''
23590 echo "You have requested that certain extensions be ignored..." >&4
23591 for i in $avail_ext; do
23592 case " $noextensions " in
23593 *" $i "*) echo "Ignoring extension $i." ;;
23594 *) echo "Keeping extension $i.";
23595 keepextensions="$keepextensions $i"
23599 avail_ext="$keepextensions"
23603 : Now see which nonxs extensions are supported on this system.
23604 : For now assume all are.
23606 for xxx in $nonxs_extensions ; do
23610 *) nonxs_ext="$nonxs_ext $xxx"
23622 A number of extensions are supplied with $package. You may choose to
23623 compile these extensions for dynamic loading (the default), compile
23624 them into the $package executable (static loading), or not include
23625 them at all. Answer "none" to include no extensions.
23626 Note that DynaLoader is always built and need not be mentioned here.
23629 case "$dynamic_ext" in
23631 : Exclude those listed in static_ext
23633 for xxx in $avail_ext; do
23634 case " $static_ext " in
23636 *) dflt="$dflt $xxx" ;;
23643 *) dflt="$dynamic_ext"
23644 # Perhaps we are reusing an old out-of-date config.sh.
23647 if test X"$dynamic_ext" != X"$avail_ext"; then
23649 NOTICE: Your previous config.sh list may be incorrect.
23650 The extensions now available to you are
23652 but the default list from your previous config.sh is
23664 rp="What extensions do you wish to load dynamically?"
23667 none) dynamic_ext=' ' ;;
23668 *) dynamic_ext="$ans" ;;
23671 case "$static_ext" in
23673 : Exclude those already listed in dynamic linking
23675 for xxx in $avail_ext; do
23676 case " $dynamic_ext " in
23678 *) dflt="$dflt $xxx" ;;
23685 *) dflt="$static_ext"
23692 rp="What extensions do you wish to load statically?"
23695 none) static_ext=' ' ;;
23696 *) static_ext="$ans" ;;
23701 A number of extensions are supplied with $package. Answer "none"
23702 to include no extensions.
23703 Note that DynaLoader is always built and need not be mentioned here.
23706 case "$static_ext" in
23707 '') dflt="$avail_ext" ;;
23708 *) dflt="$static_ext"
23709 # Perhaps we are reusing an old out-of-date config.sh.
23712 if test X"$static_ext" != X"$avail_ext"; then
23714 NOTICE: Your previous config.sh list may be incorrect.
23715 The extensions now available to you are
23717 but the default list from your previous config.sh is
23726 : Exclude those that are not xs extensions
23730 rp="What extensions do you wish to include?"
23733 none) static_ext=' ' ;;
23734 *) static_ext="$ans" ;;
23739 # Encode is a special case. If we are building Encode as a static
23740 # extension, we need to explicitly list its subextensions as well.
23741 # For other nested extensions, this is handled automatically by
23742 # the appropriate Makefile.PL.
23743 case " $static_ext " in
23744 *" Encode "*) # Add the subextensions of Encode
23746 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
23747 static_ext="$static_ext Encode/$xxx"
23748 known_extensions="$known_extensions Encode/$xxx"
23754 set X $dynamic_ext $static_ext $nonxs_ext
23758 # Sanity check: We require an extension suitable for use with
23759 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
23760 # should show up as failures in the test suite, but it's helpful to
23761 # catch them now.) The 'extensions' list is normally sorted
23762 # alphabetically, so we need to accept either
23763 # DB_File ... Fcntl ... IO ....
23764 # or something like
23765 # Fcntl ... NDBM_File ... IO ....
23766 case " $extensions" in
23767 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
23768 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
23769 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
23770 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
23771 echo "WARNING: The Perl you are building will be quite crippled." >& 4
23775 : Remove libraries needed only for extensions
23776 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
23777 : The exception is SunOS 4.x, which needs them.
23778 case "${osname}X${osvers}" in
23782 *) case "$usedl" in
23783 $define|true|[yY]*)
23784 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
23788 *) perllibs="$libs"
23794 : Remove build directory name from cppstdin so it can be used from
23795 : either the present location or the final installed location.
23797 : Get out of the UU directory to get correct path name.
23799 case "$cppstdin" in
23801 echo "Stripping down cppstdin path name"
23807 : end of configuration questions
23809 echo "End of configuration questions."
23812 : back to where it started
23813 if test -d ../UU; then
23817 : configuration may be unconditionally patched via a 'config.arch' file
23818 if $test -f config.arch; then
23819 echo "I see a config.arch file, loading it." >&4
23823 : configuration may be patched via a 'config.over' file
23824 if $test -f config.over; then
23827 rp='I see a config.over file. Do you wish to load it?'
23830 n*) echo "OK, I'll ignore it.";;
23832 echo "Configuration override changes have been loaded."
23837 : in case they want portability, strip down executable paths
23838 case "$d_portable" in
23841 echo "Stripping down executable paths..." >&4
23842 for file in $loclist $trylist; do
23844 eval $file=`basename $temp`
23849 : create config.sh file
23851 echo "Creating config.sh..." >&4
23852 $spitshell <<EOT >config.sh
23855 # This file was produced by running the Configure script. It holds all the
23856 # definitions figured out by Configure. Should you modify one of these values,
23857 # do not forget to propagate your changes by running "Configure -der". You may
23858 # instead choose to run each of the .SH files by yourself, or "Configure -S".
23861 # Package name : $package
23862 # Source directory : $src
23863 # Configuration time: $cf_time
23864 # Configured by : $cf_by
23865 # Target system : $myuname
23868 : Add in command line options if available
23869 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
23871 $spitshell <<EOT >>config.sh
23880 Revision='$Revision'
23888 alignbytes='$alignbytes'
23889 ansi2knr='$ansi2knr'
23890 aphostname='$aphostname'
23891 api_revision='$api_revision'
23892 api_subversion='$api_subversion'
23893 api_version='$api_version'
23894 api_versionstring='$api_versionstring'
23897 archlibexp='$archlibexp'
23898 archname64='$archname64'
23899 archname='$archname'
23900 archobjs='$archobjs'
23901 asctime_r_proto='$asctime_r_proto'
23910 byteorder='$byteorder'
23912 castflags='$castflags'
23915 cccdlflags='$cccdlflags'
23916 ccdlflags='$ccdlflags'
23918 ccflags_uselargefiles='$ccflags_uselargefiles'
23920 ccsymbols='$ccsymbols'
23921 ccversion='$ccversion'
23923 cf_email='$cf_email'
23925 charbits='$charbits'
23926 charsize='$charsize'
23930 clocktype='$clocktype'
23932 compress='$compress'
23933 contains='$contains'
23937 cpp_stuff='$cpp_stuff'
23938 cppccsymbols='$cppccsymbols'
23939 cppflags='$cppflags'
23941 cppminus='$cppminus'
23943 cppstdin='$cppstdin'
23944 cppsymbols='$cppsymbols'
23945 crypt_r_proto='$crypt_r_proto'
23946 cryptlib='$cryptlib'
23948 ctermid_r_proto='$ctermid_r_proto'
23949 ctime_r_proto='$ctime_r_proto'
23950 d_Gconvert='$d_Gconvert'
23951 d_PRIEUldbl='$d_PRIEUldbl'
23952 d_PRIFUldbl='$d_PRIFUldbl'
23953 d_PRIGUldbl='$d_PRIGUldbl'
23954 d_PRIXU64='$d_PRIXU64'
23955 d_PRId64='$d_PRId64'
23956 d_PRIeldbl='$d_PRIeldbl'
23957 d_PRIfldbl='$d_PRIfldbl'
23958 d_PRIgldbl='$d_PRIgldbl'
23959 d_PRIi64='$d_PRIi64'
23960 d_PRIo64='$d_PRIo64'
23961 d_PRIu64='$d_PRIu64'
23962 d_PRIx64='$d_PRIx64'
23963 d_SCNfldbl='$d_SCNfldbl'
23964 d__fwalk='$d__fwalk'
23965 d_access='$d_access'
23966 d_accessx='$d_accessx'
23970 d_archlib='$d_archlib'
23971 d_asctime64='$d_asctime64'
23972 d_asctime_r='$d_asctime_r'
23977 d_attribute_deprecated='$d_attribute_deprecated'
23978 d_attribute_format='$d_attribute_format'
23979 d_attribute_malloc='$d_attribute_malloc'
23980 d_attribute_nonnull='$d_attribute_nonnull'
23981 d_attribute_noreturn='$d_attribute_noreturn'
23982 d_attribute_pure='$d_attribute_pure'
23983 d_attribute_unused='$d_attribute_unused'
23984 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
23985 d_backtrace='$d_backtrace'
23989 d_bsdgetpgrp='$d_bsdgetpgrp'
23990 d_bsdsetpgrp='$d_bsdsetpgrp'
23991 d_builtin_choose_expr='$d_builtin_choose_expr'
23992 d_builtin_expect='$d_builtin_expect'
23994 d_c99_variadic_macros='$d_c99_variadic_macros'
23995 d_casti32='$d_casti32'
23996 d_castneg='$d_castneg'
23998 d_charvspr='$d_charvspr'
24000 d_chroot='$d_chroot'
24001 d_chsize='$d_chsize'
24003 d_clearenv='$d_clearenv'
24004 d_closedir='$d_closedir'
24005 d_cmsghdr_s='$d_cmsghdr_s'
24007 d_copysign='$d_copysign'
24008 d_copysignl='$d_copysignl'
24009 d_cplusplus='$d_cplusplus'
24011 d_crypt_r='$d_crypt_r'
24013 d_ctermid='$d_ctermid'
24014 d_ctermid_r='$d_ctermid_r'
24015 d_ctime64='$d_ctime64'
24016 d_ctime_r='$d_ctime_r'
24017 d_cuserid='$d_cuserid'
24018 d_dbl_dig='$d_dbl_dig'
24019 d_dbminitproto='$d_dbminitproto'
24020 d_difftime64='$d_difftime64'
24021 d_difftime='$d_difftime'
24022 d_dir_dd_fd='$d_dir_dd_fd'
24024 d_dirnamlen='$d_dirnamlen'
24025 d_dladdr='$d_dladdr'
24026 d_dlerror='$d_dlerror'
24027 d_dlopen='$d_dlopen'
24028 d_dlsymun='$d_dlsymun'
24029 d_dosuid='$d_dosuid'
24030 d_drand48_r='$d_drand48_r'
24031 d_drand48proto='$d_drand48proto'
24033 d_eaccess='$d_eaccess'
24034 d_endgrent='$d_endgrent'
24035 d_endgrent_r='$d_endgrent_r'
24036 d_endhent='$d_endhent'
24037 d_endhostent_r='$d_endhostent_r'
24038 d_endnent='$d_endnent'
24039 d_endnetent_r='$d_endnetent_r'
24040 d_endpent='$d_endpent'
24041 d_endprotoent_r='$d_endprotoent_r'
24042 d_endpwent='$d_endpwent'
24043 d_endpwent_r='$d_endpwent_r'
24044 d_endsent='$d_endsent'
24045 d_endservent_r='$d_endservent_r'
24046 d_eofnblk='$d_eofnblk'
24049 d_eunice='$d_eunice'
24052 d_faststdio='$d_faststdio'
24053 d_fchdir='$d_fchdir'
24054 d_fchmod='$d_fchmod'
24055 d_fchown='$d_fchown'
24057 d_fcntl_can_lock='$d_fcntl_can_lock'
24058 d_fd_macros='$d_fd_macros'
24059 d_fd_set='$d_fd_set'
24061 d_fds_bits='$d_fds_bits'
24062 d_fegetround='$d_fegetround'
24063 d_fgetpos='$d_fgetpos'
24064 d_finite='$d_finite'
24065 d_finitel='$d_finitel'
24066 d_flexfnam='$d_flexfnam'
24068 d_flockproto='$d_flockproto'
24073 d_fp_class='$d_fp_class'
24074 d_fp_classify='$d_fp_classify'
24075 d_fp_classl='$d_fp_classl'
24076 d_fpathconf='$d_fpathconf'
24077 d_fpclass='$d_fpclass'
24078 d_fpclassify='$d_fpclassify'
24079 d_fpclassl='$d_fpclassl'
24080 d_fpgetround='$d_fpgetround'
24081 d_fpos64_t='$d_fpos64_t'
24082 d_frexpl='$d_frexpl'
24083 d_fs_data_s='$d_fs_data_s'
24084 d_fseeko='$d_fseeko'
24085 d_fsetpos='$d_fsetpos'
24087 d_ftello='$d_ftello'
24089 d_futimes='$d_futimes'
24090 d_gdbm_ndbm_h_uses_prototypes='$d_gdbm_ndbm_h_uses_prototypes'
24091 d_gdbmndbm_h_uses_prototypes='$d_gdbmndbm_h_uses_prototypes'
24092 d_getaddrinfo='$d_getaddrinfo'
24093 d_getcwd='$d_getcwd'
24094 d_getespwnam='$d_getespwnam'
24095 d_getgrent='$d_getgrent'
24096 d_getgrent_r='$d_getgrent_r'
24097 d_getgrgid_r='$d_getgrgid_r'
24098 d_getgrnam_r='$d_getgrnam_r'
24099 d_getgrps='$d_getgrps'
24100 d_gethbyaddr='$d_gethbyaddr'
24101 d_gethbyname='$d_gethbyname'
24102 d_gethent='$d_gethent'
24103 d_gethname='$d_gethname'
24104 d_gethostbyaddr_r='$d_gethostbyaddr_r'
24105 d_gethostbyname_r='$d_gethostbyname_r'
24106 d_gethostent_r='$d_gethostent_r'
24107 d_gethostprotos='$d_gethostprotos'
24108 d_getitimer='$d_getitimer'
24109 d_getlogin='$d_getlogin'
24110 d_getlogin_r='$d_getlogin_r'
24111 d_getnameinfo='$d_getnameinfo'
24112 d_getnbyaddr='$d_getnbyaddr'
24113 d_getnbyname='$d_getnbyname'
24114 d_getnent='$d_getnent'
24115 d_getnetbyaddr_r='$d_getnetbyaddr_r'
24116 d_getnetbyname_r='$d_getnetbyname_r'
24117 d_getnetent_r='$d_getnetent_r'
24118 d_getnetprotos='$d_getnetprotos'
24119 d_getpagsz='$d_getpagsz'
24120 d_getpbyname='$d_getpbyname'
24121 d_getpbynumber='$d_getpbynumber'
24122 d_getpent='$d_getpent'
24123 d_getpgid='$d_getpgid'
24124 d_getpgrp2='$d_getpgrp2'
24125 d_getpgrp='$d_getpgrp'
24126 d_getppid='$d_getppid'
24127 d_getprior='$d_getprior'
24128 d_getprotobyname_r='$d_getprotobyname_r'
24129 d_getprotobynumber_r='$d_getprotobynumber_r'
24130 d_getprotoent_r='$d_getprotoent_r'
24131 d_getprotoprotos='$d_getprotoprotos'
24132 d_getprpwnam='$d_getprpwnam'
24133 d_getpwent='$d_getpwent'
24134 d_getpwent_r='$d_getpwent_r'
24135 d_getpwnam_r='$d_getpwnam_r'
24136 d_getpwuid_r='$d_getpwuid_r'
24137 d_getsbyname='$d_getsbyname'
24138 d_getsbyport='$d_getsbyport'
24139 d_getsent='$d_getsent'
24140 d_getservbyname_r='$d_getservbyname_r'
24141 d_getservbyport_r='$d_getservbyport_r'
24142 d_getservent_r='$d_getservent_r'
24143 d_getservprotos='$d_getservprotos'
24144 d_getspnam='$d_getspnam'
24145 d_getspnam_r='$d_getspnam_r'
24146 d_gettimeod='$d_gettimeod'
24147 d_gmtime64='$d_gmtime64'
24148 d_gmtime_r='$d_gmtime_r'
24149 d_gnulibc='$d_gnulibc'
24150 d_grpasswd='$d_grpasswd'
24154 d_ilogbl='$d_ilogbl'
24155 d_inc_version_list='$d_inc_version_list'
24157 d_inetaton='$d_inetaton'
24158 d_inetntop='$d_inetntop'
24159 d_inetpton='$d_inetpton'
24160 d_int64_t='$d_int64_t'
24161 d_ip_mreq='$d_ip_mreq'
24162 d_ip_mreq_source='$d_ip_mreq_source'
24163 d_ipv6_mreq='$d_ipv6_mreq'
24164 d_ipv6_mreq_source='$d_ipv6_mreq_source'
24165 d_isascii='$d_isascii'
24166 d_isblank='$d_isblank'
24167 d_isfinite='$d_isfinite'
24168 d_isfinitel='$d_isfinitel'
24170 d_isinfl='$d_isinfl'
24171 d_isless='$d_isless'
24173 d_isnanl='$d_isnanl'
24174 d_isnormal='$d_isnormal'
24177 d_killpg='$d_killpg'
24178 d_lc_monetary_2008='$d_lc_monetary_2008'
24179 d_lchown='$d_lchown'
24180 d_ldbl_dig='$d_ldbl_dig'
24181 d_ldexpl='$d_ldexpl'
24182 d_lgamma='$d_lgamma'
24183 d_lgamma_r='$d_lgamma_r'
24184 d_libm_lib_version='$d_libm_lib_version'
24185 d_libname_unique='$d_libname_unique'
24187 d_llrint='$d_llrint'
24188 d_llrintl='$d_llrintl'
24189 d_llround='$d_llround'
24190 d_llroundl='$d_llroundl'
24191 d_localtime64='$d_localtime64'
24192 d_localtime_r='$d_localtime_r'
24193 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
24194 d_locconv='$d_locconv'
24199 d_longdbl='$d_longdbl'
24200 d_longlong='$d_longlong'
24202 d_lrintl='$d_lrintl'
24203 d_lround='$d_lround'
24204 d_lroundl='$d_lroundl'
24205 d_lseekproto='$d_lseekproto'
24207 d_madvise='$d_madvise'
24208 d_malloc_good_size='$d_malloc_good_size'
24209 d_malloc_size='$d_malloc_size'
24211 d_mbstowcs='$d_mbstowcs'
24212 d_mbtowc='$d_mbtowc'
24213 d_memchr='$d_memchr'
24214 d_memcmp='$d_memcmp'
24215 d_memcpy='$d_memcpy'
24216 d_memmove='$d_memmove'
24217 d_memset='$d_memset'
24219 d_mkdtemp='$d_mkdtemp'
24220 d_mkfifo='$d_mkfifo'
24221 d_mkstemp='$d_mkstemp'
24222 d_mkstemps='$d_mkstemps'
24223 d_mktime64='$d_mktime64'
24224 d_mktime='$d_mktime'
24227 d_modfl_pow32_bug='$d_modfl_pow32_bug'
24228 d_modflproto='$d_modflproto'
24229 d_mprotect='$d_mprotect'
24231 d_msg_ctrunc='$d_msg_ctrunc'
24232 d_msg_dontroute='$d_msg_dontroute'
24233 d_msg_oob='$d_msg_oob'
24234 d_msg_peek='$d_msg_peek'
24235 d_msg_proxy='$d_msg_proxy'
24236 d_msgctl='$d_msgctl'
24237 d_msgget='$d_msgget'
24238 d_msghdr_s='$d_msghdr_s'
24239 d_msgrcv='$d_msgrcv'
24240 d_msgsnd='$d_msgsnd'
24242 d_munmap='$d_munmap'
24243 d_mymalloc='$d_mymalloc'
24246 d_ndbm_h_uses_prototypes='$d_ndbm_h_uses_prototypes'
24247 d_nearbyint='$d_nearbyint'
24248 d_nextafter='$d_nextafter'
24249 d_nexttoward='$d_nexttoward'
24251 d_nl_langinfo='$d_nl_langinfo'
24252 d_nv_preserves_uv='$d_nv_preserves_uv'
24253 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
24254 d_off64_t='$d_off64_t'
24255 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
24256 d_oldpthreads='$d_oldpthreads'
24257 d_oldsock='$d_oldsock'
24259 d_pathconf='$d_pathconf'
24261 d_perl_otherlibdirs='$d_perl_otherlibdirs'
24262 d_phostname='$d_phostname'
24265 d_portable='$d_portable'
24267 d_prctl_set_name='$d_prctl_set_name'
24268 d_printf_format_null='$d_printf_format_null'
24269 d_procselfexe='$d_procselfexe'
24270 d_pseudofork='$d_pseudofork'
24271 d_pthread_atfork='$d_pthread_atfork'
24272 d_pthread_attr_setscope='$d_pthread_attr_setscope'
24273 d_pthread_yield='$d_pthread_yield'
24274 d_ptrdiff_t='$d_ptrdiff_t'
24276 d_pwchange='$d_pwchange'
24277 d_pwclass='$d_pwclass'
24278 d_pwcomment='$d_pwcomment'
24279 d_pwexpire='$d_pwexpire'
24280 d_pwgecos='$d_pwgecos'
24281 d_pwpasswd='$d_pwpasswd'
24282 d_pwquota='$d_pwquota'
24285 d_random_r='$d_random_r'
24286 d_re_comp='$d_re_comp'
24287 d_readdir64_r='$d_readdir64_r'
24288 d_readdir='$d_readdir'
24289 d_readdir_r='$d_readdir_r'
24290 d_readlink='$d_readlink'
24292 d_recvmsg='$d_recvmsg'
24293 d_regcmp='$d_regcmp'
24294 d_regcomp='$d_regcomp'
24295 d_remainder='$d_remainder'
24296 d_remquo='$d_remquo'
24297 d_rename='$d_rename'
24298 d_rewinddir='$d_rewinddir'
24302 d_safebcpy='$d_safebcpy'
24303 d_safemcpy='$d_safemcpy'
24304 d_sanemcmp='$d_sanemcmp'
24305 d_sbrkproto='$d_sbrkproto'
24306 d_scalbn='$d_scalbn'
24307 d_scalbnl='$d_scalbnl'
24308 d_sched_yield='$d_sched_yield'
24309 d_scm_rights='$d_scm_rights'
24310 d_seekdir='$d_seekdir'
24311 d_select='$d_select'
24313 d_semctl='$d_semctl'
24314 d_semctl_semid_ds='$d_semctl_semid_ds'
24315 d_semctl_semun='$d_semctl_semun'
24316 d_semget='$d_semget'
24318 d_sendmsg='$d_sendmsg'
24319 d_setegid='$d_setegid'
24320 d_seteuid='$d_seteuid'
24321 d_setgrent='$d_setgrent'
24322 d_setgrent_r='$d_setgrent_r'
24323 d_setgrps='$d_setgrps'
24324 d_sethent='$d_sethent'
24325 d_sethostent_r='$d_sethostent_r'
24326 d_setitimer='$d_setitimer'
24327 d_setlinebuf='$d_setlinebuf'
24328 d_setlocale='$d_setlocale'
24329 d_setlocale_r='$d_setlocale_r'
24330 d_setnent='$d_setnent'
24331 d_setnetent_r='$d_setnetent_r'
24332 d_setpent='$d_setpent'
24333 d_setpgid='$d_setpgid'
24334 d_setpgrp2='$d_setpgrp2'
24335 d_setpgrp='$d_setpgrp'
24336 d_setprior='$d_setprior'
24337 d_setproctitle='$d_setproctitle'
24338 d_setprotoent_r='$d_setprotoent_r'
24339 d_setpwent='$d_setpwent'
24340 d_setpwent_r='$d_setpwent_r'
24341 d_setregid='$d_setregid'
24342 d_setresgid='$d_setresgid'
24343 d_setresuid='$d_setresuid'
24344 d_setreuid='$d_setreuid'
24345 d_setrgid='$d_setrgid'
24346 d_setruid='$d_setruid'
24347 d_setsent='$d_setsent'
24348 d_setservent_r='$d_setservent_r'
24349 d_setsid='$d_setsid'
24350 d_setvbuf='$d_setvbuf'
24353 d_shmatprototype='$d_shmatprototype'
24354 d_shmctl='$d_shmctl'
24356 d_shmget='$d_shmget'
24357 d_sigaction='$d_sigaction'
24358 d_signbit='$d_signbit'
24359 d_sigprocmask='$d_sigprocmask'
24360 d_sigsetjmp='$d_sigsetjmp'
24361 d_sin6_scope_id='$d_sin6_scope_id'
24362 d_sitearch='$d_sitearch'
24363 d_snprintf='$d_snprintf'
24364 d_sockaddr_in6='$d_sockaddr_in6'
24365 d_sockaddr_sa_len='$d_sockaddr_sa_len'
24366 d_sockatmark='$d_sockatmark'
24367 d_sockatmarkproto='$d_sockatmarkproto'
24368 d_socket='$d_socket'
24369 d_socklen_t='$d_socklen_t'
24370 d_sockpair='$d_sockpair'
24371 d_socks5_init='$d_socks5_init'
24372 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
24374 d_srand48_r='$d_srand48_r'
24375 d_srandom_r='$d_srandom_r'
24376 d_sresgproto='$d_sresgproto'
24377 d_sresuproto='$d_sresuproto'
24379 d_statblks='$d_statblks'
24380 d_static_inline='$d_static_inline'
24381 d_stdio_cnt_lval='$d_stdio_cnt_lval'
24382 d_stdio_ptr_lval='$d_stdio_ptr_lval'
24383 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
24384 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
24385 d_stdio_stream_array='$d_stdio_stream_array'
24386 d_stdiobase='$d_stdiobase'
24387 d_stdstdio='$d_stdstdio'
24388 d_strchr='$d_strchr'
24389 d_strcoll='$d_strcoll'
24390 d_strctcpy='$d_strctcpy'
24391 d_strerrm='$d_strerrm'
24392 d_strerror='$d_strerror'
24393 d_strerror_r='$d_strerror_r'
24394 d_strftime='$d_strftime'
24395 d_strlcat='$d_strlcat'
24396 d_strlcpy='$d_strlcpy'
24397 d_strtod='$d_strtod'
24398 d_strtol='$d_strtol'
24399 d_strtold='$d_strtold'
24400 d_strtoll='$d_strtoll'
24401 d_strtoq='$d_strtoq'
24402 d_strtoul='$d_strtoul'
24403 d_strtoull='$d_strtoull'
24404 d_strtouq='$d_strtouq'
24405 d_strxfrm='$d_strxfrm'
24406 d_suidsafe='$d_suidsafe'
24407 d_symlink='$d_symlink'
24408 d_syscall='$d_syscall'
24409 d_syscallproto='$d_syscallproto'
24410 d_sysconf='$d_sysconf'
24411 d_sysernlst='$d_sysernlst'
24412 d_syserrlst='$d_syserrlst'
24413 d_system='$d_system'
24414 d_tcgetpgrp='$d_tcgetpgrp'
24415 d_tcsetpgrp='$d_tcsetpgrp'
24416 d_telldir='$d_telldir'
24417 d_telldirproto='$d_telldirproto'
24418 d_tgamma='$d_tgamma'
24420 d_timegm='$d_timegm'
24422 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
24423 d_tm_tm_zone='$d_tm_tm_zone'
24424 d_tmpnam_r='$d_tmpnam_r'
24426 d_truncate='$d_truncate'
24427 d_truncl='$d_truncl'
24428 d_ttyname_r='$d_ttyname_r'
24429 d_tzname='$d_tzname'
24430 d_u32align='$d_u32align'
24431 d_ualarm='$d_ualarm'
24434 d_union_semun='$d_union_semun'
24435 d_unordered='$d_unordered'
24436 d_unsetenv='$d_unsetenv'
24437 d_usleep='$d_usleep'
24438 d_usleepproto='$d_usleepproto'
24439 d_vendorarch='$d_vendorarch'
24440 d_vendorbin='$d_vendorbin'
24441 d_vendorlib='$d_vendorlib'
24442 d_vendorscript='$d_vendorscript'
24444 d_void_closedir='$d_void_closedir'
24445 d_voidsig='$d_voidsig'
24446 d_voidtty='$d_voidtty'
24447 d_volatile='$d_volatile'
24448 d_vprintf='$d_vprintf'
24449 d_vsnprintf='$d_vsnprintf'
24451 d_waitpid='$d_waitpid'
24452 d_wcscmp='$d_wcscmp'
24453 d_wcstombs='$d_wcstombs'
24454 d_wcsxfrm='$d_wcsxfrm'
24455 d_wctomb='$d_wctomb'
24456 d_writev='$d_writev'
24459 db_hashtype='$db_hashtype'
24460 db_prefixtype='$db_prefixtype'
24461 db_version_major='$db_version_major'
24462 db_version_minor='$db_version_minor'
24463 db_version_patch='$db_version_patch'
24464 direntrytype='$direntrytype'
24467 doubleinfbytes='$doubleinfbytes'
24468 doublekind='$doublekind'
24469 doublemantbits='$doublemantbits'
24470 doublenanbytes='$doublenanbytes'
24471 doublesize='$doublesize'
24473 drand48_r_proto='$drand48_r_proto'
24475 dynamic_ext='$dynamic_ext'
24481 endgrent_r_proto='$endgrent_r_proto'
24482 endhostent_r_proto='$endhostent_r_proto'
24483 endnetent_r_proto='$endnetent_r_proto'
24484 endprotoent_r_proto='$endprotoent_r_proto'
24485 endpwent_r_proto='$endpwent_r_proto'
24486 endservent_r_proto='$endservent_r_proto'
24487 eunicefix='$eunicefix'
24490 extensions='$extensions'
24491 extern_C='$extern_C'
24493 fflushNULL='$fflushNULL'
24494 fflushall='$fflushall'
24496 firstmakefile='$firstmakefile'
24498 fpossize='$fpossize'
24499 fpostype='$fpostype'
24500 freetype='$freetype'
24503 full_csh='$full_csh'
24504 full_sed='$full_sed'
24505 gccansipedantic='$gccansipedantic'
24506 gccosandvers='$gccosandvers'
24507 gccversion='$gccversion'
24508 getgrent_r_proto='$getgrent_r_proto'
24509 getgrgid_r_proto='$getgrgid_r_proto'
24510 getgrnam_r_proto='$getgrnam_r_proto'
24511 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
24512 gethostbyname_r_proto='$gethostbyname_r_proto'
24513 gethostent_r_proto='$gethostent_r_proto'
24514 getlogin_r_proto='$getlogin_r_proto'
24515 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
24516 getnetbyname_r_proto='$getnetbyname_r_proto'
24517 getnetent_r_proto='$getnetent_r_proto'
24518 getprotobyname_r_proto='$getprotobyname_r_proto'
24519 getprotobynumber_r_proto='$getprotobynumber_r_proto'
24520 getprotoent_r_proto='$getprotoent_r_proto'
24521 getpwent_r_proto='$getpwent_r_proto'
24522 getpwnam_r_proto='$getpwnam_r_proto'
24523 getpwuid_r_proto='$getpwuid_r_proto'
24524 getservbyname_r_proto='$getservbyname_r_proto'
24525 getservbyport_r_proto='$getservbyport_r_proto'
24526 getservent_r_proto='$getservent_r_proto'
24527 getspnam_r_proto='$getspnam_r_proto'
24528 gidformat='$gidformat'
24534 gmtime_r_proto='$gmtime_r_proto'
24535 gnulibc_version='$gnulibc_version'
24537 groupcat='$groupcat'
24538 groupstype='$groupstype'
24541 h_sysfile='$h_sysfile'
24544 hostgenerate='$hostgenerate'
24545 hostosname='$hostosname'
24546 hostperl='$hostperl'
24547 html1dir='$html1dir'
24548 html1direxp='$html1direxp'
24549 html3dir='$html3dir'
24550 html3direxp='$html3direxp'
24559 i_arpainet='$i_arpainet'
24560 i_assert='$i_assert'
24562 i_bsdioctl='$i_bsdioctl'
24566 i_dirent='$i_dirent'
24568 i_execinfo='$i_execinfo'
24573 i_fp_class='$i_fp_class'
24575 i_gdbm_ndbm='$i_gdbm_ndbm'
24576 i_gdbmndbm='$i_gdbmndbm'
24578 i_ieeefp='$i_ieeefp'
24579 i_inttypes='$i_inttypes'
24580 i_langinfo='$i_langinfo'
24581 i_libutil='$i_libutil'
24582 i_limits='$i_limits'
24583 i_locale='$i_locale'
24584 i_machcthr='$i_machcthr'
24585 i_malloc='$i_malloc'
24586 i_mallocmalloc='$i_mallocmalloc'
24588 i_memory='$i_memory'
24591 i_neterrno='$i_neterrno'
24592 i_netinettcp='$i_netinettcp'
24596 i_pthread='$i_pthread'
24598 i_quadmath='$i_quadmath'
24599 i_rpcsvcdbm='$i_rpcsvcdbm'
24601 i_shadow='$i_shadow'
24603 i_stdarg='$i_stdarg'
24604 i_stdbool='$i_stdbool'
24605 i_stddef='$i_stddef'
24606 i_stdint='$i_stdint'
24607 i_stdlib='$i_stdlib'
24608 i_string='$i_string'
24609 i_sunmath='$i_sunmath'
24610 i_sysaccess='$i_sysaccess'
24611 i_sysdir='$i_sysdir'
24612 i_sysfile='$i_sysfile'
24613 i_sysfilio='$i_sysfilio'
24615 i_sysioctl='$i_sysioctl'
24616 i_syslog='$i_syslog'
24617 i_sysmman='$i_sysmman'
24618 i_sysmode='$i_sysmode'
24619 i_sysndir='$i_sysndir'
24620 i_sysparam='$i_sysparam'
24621 i_syspoll='$i_syspoll'
24622 i_sysresrc='$i_sysresrc'
24623 i_syssecrt='$i_syssecrt'
24624 i_sysselct='$i_sysselct'
24625 i_syssockio='$i_syssockio'
24626 i_sysstat='$i_sysstat'
24627 i_systime='$i_systime'
24628 i_systimek='$i_systimek'
24629 i_systimes='$i_systimes'
24630 i_systypes='$i_systypes'
24631 i_sysuio='$i_sysuio'
24633 i_sysutsname='$i_sysutsname'
24634 i_syswait='$i_syswait'
24635 i_termio='$i_termio'
24636 i_termios='$i_termios'
24638 i_unistd='$i_unistd'
24640 i_values='$i_values'
24641 i_varargs='$i_varargs'
24642 i_varhdr='$i_varhdr'
24644 ignore_versioned_solibs='$ignore_versioned_solibs'
24645 inc_version_list='$inc_version_list'
24646 inc_version_list_init='$inc_version_list_init'
24650 initialinstalllocation='$initialinstalllocation'
24651 installarchlib='$installarchlib'
24652 installbin='$installbin'
24653 installhtml1dir='$installhtml1dir'
24654 installhtml3dir='$installhtml3dir'
24655 installman1dir='$installman1dir'
24656 installman3dir='$installman3dir'
24657 installprefix='$installprefix'
24658 installprefixexp='$installprefixexp'
24659 installprivlib='$installprivlib'
24660 installscript='$installscript'
24661 installsitearch='$installsitearch'
24662 installsitebin='$installsitebin'
24663 installsitehtml1dir='$installsitehtml1dir'
24664 installsitehtml3dir='$installsitehtml3dir'
24665 installsitelib='$installsitelib'
24666 installsiteman1dir='$installsiteman1dir'
24667 installsiteman3dir='$installsiteman3dir'
24668 installsitescript='$installsitescript'
24669 installstyle='$installstyle'
24670 installusrbinperl='$installusrbinperl'
24671 installvendorarch='$installvendorarch'
24672 installvendorbin='$installvendorbin'
24673 installvendorhtml1dir='$installvendorhtml1dir'
24674 installvendorhtml3dir='$installvendorhtml3dir'
24675 installvendorlib='$installvendorlib'
24676 installvendorman1dir='$installvendorman1dir'
24677 installvendorman3dir='$installvendorman3dir'
24678 installvendorscript='$installvendorscript'
24680 issymlink='$issymlink'
24681 ivdformat='$ivdformat'
24684 known_extensions='$known_extensions'
24687 ld_can_script='$ld_can_script'
24688 lddlflags='$lddlflags'
24690 ldflags_uselargefiles='$ldflags_uselargefiles'
24691 ldlibpthname='$ldlibpthname'
24698 libsdirs='$libsdirs'
24699 libsfiles='$libsfiles'
24700 libsfound='$libsfound'
24701 libspath='$libspath'
24702 libswanted='$libswanted'
24703 libswanted_uselargefiles='$libswanted_uselargefiles'
24709 localtime_r_proto='$localtime_r_proto'
24710 locincpth='$locincpth'
24711 loclibpth='$loclibpth'
24712 longdblinfbytes='$longdblinfbytes'
24713 longdblkind='$longdblkind'
24714 longdblmantbits='$longdblmantbits'
24715 longdblnanbytes='$longdblnanbytes'
24716 longdblsize='$longdblsize'
24717 longlongsize='$longlongsize'
24718 longsize='$longsize'
24722 lseeksize='$lseeksize'
24723 lseektype='$lseektype'
24727 make_set_make='$make_set_make'
24728 mallocobj='$mallocobj'
24729 mallocsrc='$mallocsrc'
24730 malloctype='$malloctype'
24732 man1direxp='$man1direxp'
24735 man3direxp='$man3direxp'
24737 mips_type='$mips_type'
24738 mistrustnm='$mistrustnm'
24740 mmaptype='$mmaptype'
24741 modetype='$modetype'
24743 multiarch='$multiarch'
24745 myarchname='$myarchname'
24746 mydomain='$mydomain'
24747 myhostname='$myhostname'
24750 need_va_copy='$need_va_copy'
24751 netdb_hlen_type='$netdb_hlen_type'
24752 netdb_host_type='$netdb_host_type'
24753 netdb_name_type='$netdb_name_type'
24754 netdb_net_type='$netdb_net_type'
24757 nm_so_opt='$nm_so_opt'
24758 nonxs_ext='$nonxs_ext'
24760 nvEUformat='$nvEUformat'
24761 nvFUformat='$nvFUformat'
24762 nvGUformat='$nvGUformat'
24763 nv_overflows_integers_at='$nv_overflows_integers_at'
24764 nv_preserves_uv_bits='$nv_preserves_uv_bits'
24765 nveformat='$nveformat'
24766 nvfformat='$nvfformat'
24767 nvgformat='$nvgformat'
24768 nvmantbits='$nvmantbits'
24771 o_nonblock='$o_nonblock'
24773 old_pthread_create_joinable='$old_pthread_create_joinable'
24774 optimize='$optimize'
24775 orderlib='$orderlib'
24778 otherlibdirs='$otherlibdirs'
24782 patchlevel='$patchlevel'
24783 path_sep='$path_sep'
24786 perl_patchlevel='$perl_patchlevel'
24787 perl_static_inline='$perl_static_inline'
24788 perladmin='$perladmin'
24789 perllibs='$perllibs'
24790 perlpath='$perlpath'
24792 phostname='$phostname'
24798 prefixexp='$prefixexp'
24800 privlibexp='$privlibexp'
24801 procselfexe='$procselfexe'
24802 prototype='$prototype'
24804 quadkind='$quadkind'
24805 quadtype='$quadtype'
24806 randbits='$randbits'
24807 randfunc='$randfunc'
24808 random_r_proto='$random_r_proto'
24809 randseedtype='$randseedtype'
24811 rd_nodata='$rd_nodata'
24812 readdir64_r_proto='$readdir64_r_proto'
24813 readdir_r_proto='$readdir_r_proto'
24814 revision='$revision'
24820 sGMTIME_max='$sGMTIME_max'
24821 sGMTIME_min='$sGMTIME_min'
24822 sLOCALTIME_max='$sLOCALTIME_max'
24823 sLOCALTIME_min='$sLOCALTIME_min'
24824 sPRIEUldbl='$sPRIEUldbl'
24825 sPRIFUldbl='$sPRIFUldbl'
24826 sPRIGUldbl='$sPRIGUldbl'
24827 sPRIXU64='$sPRIXU64'
24829 sPRIeldbl='$sPRIeldbl'
24830 sPRIfldbl='$sPRIfldbl'
24831 sPRIgldbl='$sPRIgldbl'
24836 sSCNfldbl='$sSCNfldbl'
24837 sched_yield='$sched_yield'
24838 scriptdir='$scriptdir'
24839 scriptdirexp='$scriptdirexp'
24841 seedfunc='$seedfunc'
24842 selectminbits='$selectminbits'
24843 selecttype='$selecttype'
24844 sendmail='$sendmail'
24845 setgrent_r_proto='$setgrent_r_proto'
24846 sethostent_r_proto='$sethostent_r_proto'
24847 setlocale_r_proto='$setlocale_r_proto'
24848 setnetent_r_proto='$setnetent_r_proto'
24849 setprotoent_r_proto='$setprotoent_r_proto'
24850 setpwent_r_proto='$setpwent_r_proto'
24851 setservent_r_proto='$setservent_r_proto'
24854 sharpbang='$sharpbang'
24855 shmattype='$shmattype'
24856 shortsize='$shortsize'
24859 sig_count='$sig_count'
24860 sig_name='$sig_name'
24861 sig_name_init='$sig_name_init'
24863 sig_num_init='$sig_num_init'
24864 sig_size='$sig_size'
24865 signal_t='$signal_t'
24866 sitearch='$sitearch'
24867 sitearchexp='$sitearchexp'
24869 sitebinexp='$sitebinexp'
24870 sitehtml1dir='$sitehtml1dir'
24871 sitehtml1direxp='$sitehtml1direxp'
24872 sitehtml3dir='$sitehtml3dir'
24873 sitehtml3direxp='$sitehtml3direxp'
24875 sitelib_stem='$sitelib_stem'
24876 sitelibexp='$sitelibexp'
24877 siteman1dir='$siteman1dir'
24878 siteman1direxp='$siteman1direxp'
24879 siteman3dir='$siteman3dir'
24880 siteman3direxp='$siteman3direxp'
24881 siteprefix='$siteprefix'
24882 siteprefixexp='$siteprefixexp'
24883 sitescript='$sitescript'
24884 sitescriptexp='$sitescriptexp'
24885 sizesize='$sizesize'
24886 sizetype='$sizetype'
24890 sockethdr='$sockethdr'
24891 socketlib='$socketlib'
24892 socksizetype='$socksizetype'
24894 spackage='$spackage'
24895 spitshell='$spitshell'
24896 srand48_r_proto='$srand48_r_proto'
24897 srandom_r_proto='$srandom_r_proto'
24899 ssizetype='$ssizetype'
24900 st_ino_sign='$st_ino_sign'
24901 st_ino_size='$st_ino_size'
24902 startperl='$startperl'
24904 static_ext='$static_ext'
24906 stdio_base='$stdio_base'
24907 stdio_bufsiz='$stdio_bufsiz'
24908 stdio_cnt='$stdio_cnt'
24909 stdio_filbuf='$stdio_filbuf'
24910 stdio_ptr='$stdio_ptr'
24911 stdio_stream_array='$stdio_stream_array'
24912 strerror_r_proto='$strerror_r_proto'
24915 subversion='$subversion'
24920 targetarch='$targetarch'
24921 targetdir='$targetdir'
24922 targetenv='$targetenv'
24923 targethost='$targethost'
24924 targetmkdir='$targetmkdir'
24925 targetport='$targetport'
24926 targetsh='$targetsh'
24930 timeincl='$timeincl'
24931 timetype='$timetype'
24932 tmpnam_r_proto='$tmpnam_r_proto'
24938 ttyname_r_proto='$ttyname_r_proto'
24947 uidformat='$uidformat'
24953 uquadtype='$uquadtype'
24954 use5005threads='$use5005threads'
24955 use64bitall='$use64bitall'
24956 use64bitint='$use64bitint'
24957 usecbacktrace='$usecbacktrace'
24958 usecrosscompile='$usecrosscompile'
24959 usedevel='$usedevel'
24961 usedtrace='$usedtrace'
24962 usefaststdio='$usefaststdio'
24963 useithreads='$useithreads'
24964 usekernprocpathname='$usekernprocpathname'
24965 uselargefiles='$uselargefiles'
24966 uselongdouble='$uselongdouble'
24967 usemallocwrap='$usemallocwrap'
24968 usemorebits='$usemorebits'
24969 usemultiplicity='$usemultiplicity'
24970 usemymalloc='$usemymalloc'
24972 usensgetexecutablepath='$usensgetexecutablepath'
24973 useopcode='$useopcode'
24974 useperlio='$useperlio'
24975 useposix='$useposix'
24976 usequadmath='$usequadmath'
24977 usereentrant='$usereentrant'
24978 userelocatableinc='$userelocatableinc'
24979 useshrplib='$useshrplib'
24980 usesitecustomize='$usesitecustomize'
24981 usesocks='$usesocks'
24982 usethreads='$usethreads'
24983 usevendorprefix='$usevendorprefix'
24984 useversionedarchname='$useversionedarchname'
24985 usevfork='$usevfork'
24988 uvXUformat='$uvXUformat'
24989 uvoformat='$uvoformat'
24992 uvuformat='$uvuformat'
24993 uvxformat='$uvxformat'
24995 vendorarch='$vendorarch'
24996 vendorarchexp='$vendorarchexp'
24997 vendorbin='$vendorbin'
24998 vendorbinexp='$vendorbinexp'
24999 vendorhtml1dir='$vendorhtml1dir'
25000 vendorhtml1direxp='$vendorhtml1direxp'
25001 vendorhtml3dir='$vendorhtml3dir'
25002 vendorhtml3direxp='$vendorhtml3direxp'
25003 vendorlib='$vendorlib'
25004 vendorlib_stem='$vendorlib_stem'
25005 vendorlibexp='$vendorlibexp'
25006 vendorman1dir='$vendorman1dir'
25007 vendorman1direxp='$vendorman1direxp'
25008 vendorman3dir='$vendorman3dir'
25009 vendorman3direxp='$vendorman3direxp'
25010 vendorprefix='$vendorprefix'
25011 vendorprefixexp='$vendorprefixexp'
25012 vendorscript='$vendorscript'
25013 vendorscriptexp='$vendorscriptexp'
25015 version_patchlevel_string='$version_patchlevel_string'
25016 versiononly='$versiononly'
25020 yaccflags='$yaccflags'
25025 : add special variables
25026 $test -f $src/patchlevel.h && \
25027 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
25028 echo "PERL_PATCHLEVEL='$perl_patchlevel'" >>config.sh
25029 echo "PERL_CONFIG_SH=true" >>config.sh
25031 : propagate old symbols
25032 if $test -f UU/config.sh; then
25033 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
25034 $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \
25035 config.sh config.sh UU/oldconfig.sh |\
25036 $sort | $uniq -u >UU/oldsyms
25037 set X `$cat UU/oldsyms`
25043 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
25045 echo ": Variables propagated from previous config.sh file." >>config.sh
25046 for sym in `$cat UU/oldsyms`; do
25047 echo " Propagating $hint variable "'$'"$sym..."
25048 eval 'tmp="$'"${sym}"'"'
25050 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
25056 : preserve RCS keywords in files with variable substitution, grrr
25059 : Finish up by extracting the .SH files
25063 echo "Extraction done."
25073 If you'd like to make any changes to the config.sh file before I begin
25074 to configure things, do it as a shell escape now (e.g. !vi config.sh).
25077 rp="Press return or use a shell escape to edit config.sh:"
25082 *) : in case they cannot read
25083 sh 1>&4 -c "$ans";;
25088 : if this fails, just run all the .SH files by hand
25097 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
25104 Now you need to generate make dependencies by running "$make depend".
25105 You might prefer to run it in background: "$make depend > makedepend.out &"
25106 It can take a while, so you might not want to run it right now.
25111 rp="Run $make depend now?"
25115 $make depend && echo "Now you must run '$make'."
25118 echo "You must run '$make depend' then '$make'."
25121 elif test -f [Mm]akefile; then
25123 echo "Now you must run a $make."
25125 echo "Configure done."
25128 if $test -f Policy.sh; then
25131 If you compile $package on a different machine or from a different object
25132 directory, copy the Policy.sh file from this object directory to the
25133 new one before you run Configure -- this will help you with most of
25134 the policy defaults.
25138 if $test -f config.msg; then
25139 echo "Hmm. I also noted the following information while running:"
25141 $cat config.msg >&4
25144 $rm -f kit*isdone ark*isdone