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 ! -c /dev/null ; then
75 *** I'm sorry, but /dev/null appears to be a file rather than a device.
76 *** Please consult your operating sytem's notes for making a device
78 *** Cannot continue, aborting.
84 : compute my invocation name
88 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
93 : Proper separator for the PATH environment variable
95 : On OS/2 this directory should exist if this is not floppy only system ":-]"
96 if test -d c:/. || ( uname -a | grep -i 'os\(/\|\)2' 2>&1 ) 2>&1 >/dev/null ; then
97 if test -n "$OS2_SHELL"; then
99 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
100 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
102 elif test -n "$DJGPP"; then
103 case "X${MACHTYPE:-nonesuchmach}" in
110 : Proper PATH setting
111 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
112 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
113 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
114 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
115 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
116 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /opt/ansic/bin /usr/ccs/bin"
117 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
118 paths="$paths /sbin /usr/sbin /usr/libexec"
119 paths="$paths /system/gnu_library/bin"
123 case "$p_$PATH$p_" in
125 *) test -d $p && PATH=$PATH$p_$p ;;
132 : shall we be using ksh?
138 if (PATH=.; alias -x) >/dev/null 2>&1; then
141 if test -f /hp-ux -a -f /bin/ksh; then
142 needksh='to avoid sh bug in "here document" expansion'
144 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
145 if test X`/usr/bin/uname -v` = X4; then
146 avoidksh="to avoid AIX 4's /bin/sh"
150 if test -f /osf_boot -a -f /usr/sbin/setld; then
151 if test X`/usr/bin/uname -s` = XOSF1; then
152 avoidksh="to avoid Digital UNIX' ksh"
157 case "$inksh/$needksh" in
164 case "$inksh/$avoidksh" in
170 case "$inksh/$needksh-$avoidksh-" in
173 (I see you are using the Korn shell. Some ksh's blow up on $me,
174 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
181 echo "(Feeding myself to $newsh $reason.)"
183 Configure|*/Configure) exec $newsh $0 "$@";;
184 *) exec $newsh Configure "$@";;
188 test -x "${newsh}" || unset newsh
190 : if needed, set CDPATH to a harmless value that is not chatty
191 : avoid bash 2.02 problems with empty CDPATH.
195 *bash*) CDPATH='.' ;;
201 : Configure runs within the UU subdirectory
202 test -d UU || mkdir UU
346 useversionedarchname=''
352 initialinstalllocation=''
384 d_attribute_deprecated=''
385 d_attribute_format=''
386 d_attribute_malloc=''
387 d_attribute_nonnull=''
388 d_attribute_noreturn=''
390 d_attribute_unused=''
391 d_attribute_warn_unused_result=''
392 d_printf_format_null=''
396 d_builtin_choose_expr=''
399 d_c99_variadic_macros=''
449 endhostent_r_proto=''
455 endprotoent_r_proto=''
461 endservent_r_proto=''
526 gethostbyaddr_r_proto=''
528 gethostbyname_r_proto=''
530 gethostent_r_proto=''
543 getnetbyaddr_r_proto=''
545 getnetbyname_r_proto=''
559 d_getprotobyname_r=''
560 getprotobyname_r_proto=''
561 d_getprotobynumber_r=''
562 getprotobynumber_r_proto=''
564 getprotoent_r_proto=''
576 getservbyname_r_proto=''
578 getservbyport_r_proto=''
580 getservent_r_proto=''
613 d_lc_monetary_2008=''
618 d_libm_lib_version=''
625 d_localtime_r_needs_tzset=''
645 d_malloc_good_size=''
693 d_old_pthread_create_joinable=''
694 old_pthread_create_joinable=''
696 d_pthread_attr_setscope=''
744 sethostent_r_proto=''
761 setprotoent_r_proto=''
773 setservent_r_proto=''
795 d_ipv6_mreq_source=''
812 d_sprintf_returns_strlen=''
825 perl_static_inline=''
830 d_stdio_ptr_lval_nochange_cnt=''
831 d_stdio_ptr_lval_sets_cnt=''
983 d_gdbm_ndbm_h_uses_prototypes=''
984 d_gdbmndbm_h_uses_prototypes=''
986 d_ndbm_h_uses_prototypes=''
1062 d_inc_version_list=''
1064 inc_version_list_init=''
1068 installusrbinperl=''
1084 ignore_versioned_solibs=''
1145 d_perl_otherlibdirs=''
1153 api_versionstring=''
1159 version_patchlevel_string=''
1163 d_nv_preserves_uv=''
1164 d_nv_zero_is_allbits_zero=''
1175 nv_overflows_integers_at=''
1176 nv_preserves_uv_bits=''
1249 installsitehtml1dir=''
1252 installsitehtml3dir=''
1259 installsiteman1dir=''
1262 installsiteman3dir=''
1267 installsitescript=''
1285 d_stdio_stream_array=''
1286 stdio_stream_array=''
1304 usekernprocpathname=''
1305 ccflags_uselargefiles=''
1306 ldflags_uselargefiles=''
1307 libswanted_uselargefiles=''
1316 usensgetexecutablepath=''
1330 installvendorarch=''
1337 installvendorhtml1dir=''
1339 vendorhtml1direxp=''
1340 installvendorhtml3dir=''
1342 vendorhtml3direxp=''
1348 installvendorman1dir=''
1351 installvendorman3dir=''
1358 installvendorscript=''
1369 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1372 : We must find out about Eunice early
1374 if test -f /etc/unixtovms; then
1375 eunicefix=/etc/unixtovms
1377 if test -f /etc/unixtovms.exe; then
1378 eunicefix=/etc/unixtovms.exe
1381 : Set executable suffix now -- needed before hints available
1382 if test -f "/libs/version.library"; then
1385 elif test -f "/system/gnu_library/bin/ar.pm"; then
1388 elif test -n "$DJGPP"; then
1391 elif test -f /kern/cookiejar; then
1394 elif test -d c:/. -o -n "$is_os2" ; then
1401 : Trailing extension. Override this in a hint file, if needed.
1402 : Extra object files, if any, needed on this platform.
1405 : Possible local include directories to search.
1406 : Set locincpth to "" in a hint file to defeat local include searches.
1407 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1408 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1410 : no include file wanted by default
1413 : Enable -DEBUGGING and -DDEBUGGING from the command line
1418 : change the next line if compiling for Xenix/286 on Xenix/386
1419 xlibpth='/usr/lib/386 /lib/386'
1420 : Possible local library directories to search.
1421 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1422 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1424 : general looking path for locating libraries
1425 glibpth="/lib /usr/lib $xlibpth"
1426 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1427 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1428 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1429 test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
1431 : Private path used by Configure to find libraries. Its value
1432 : is prepended to libpth. This variable takes care of special
1433 : machines, like the mips. Usually, it should be empty.
1436 : default library list
1438 : some systems want to use only the non-versioned libso:s
1439 ignore_versioned_solibs=''
1440 : set usethreads on the Configure command line to enable threads.
1441 usereentrant='undef'
1445 : set useposix=false in your hint file to disable the POSIX extension.
1447 : set useopcode=false in your hint file to disable the Opcode extension.
1450 ccflags_uselargefiles=''
1451 ldflags_uselargefiles=''
1452 libswanted_uselargefiles=''
1453 : set usemultiplicity on the Configure command line to enable multiplicity.
1454 : set usesocks on the Configure command line to enable socks.
1455 : List of libraries we want.
1456 : If anyone needs extra -lxxx, put those in a hint file.
1457 libswanted="cl pthread socket bind inet nsl nm ndbm gdbm dbm db malloc dl ld"
1458 libswanted="$libswanted sun m crypt sec util c cposix posix ucb bsd BSD"
1459 : We probably want to search /usr/shlib before most other libraries.
1460 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1461 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1462 glibpth="/usr/shlib $glibpth"
1463 : Do not use vfork unless overridden by a hint file.
1466 : Find the basic shell for Bourne shell scripts
1470 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1473 if test -f "$xxx"; then
1476 : Build up a list and do a single loop so we can 'break' out.
1477 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1478 for xxx in sh bash ksh pdksh ash; do
1480 try="$try ${p}/${xxx}"
1484 if test -f "$xxx"; then
1487 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1490 elif test -f "$xxx.exe"; then
1501 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1503 Usually it's in /bin/sh. How did you even get this far?
1504 Please contact me (Perl Maintainers) at perlbug@perl.org and
1505 we'll try to straighten this all out.
1511 : When cross-compiling we need to separate the sh-to-run-Configure-with from the sh-to-use-in-Perl
1512 : default both to the same thing, cross-compilers can then set targetsh differently if they like
1515 : see if sh knows # comments
1516 if `$sh -c '#' >/dev/null 2>&1`; then
1520 test -f $xcat$_exe || xcat=/usr/bin/cat
1521 if test ! -f $xcat$_exe; then
1522 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1523 if test -f $p/cat$_exe; then
1528 if test ! -f $xcat$_exe; then
1529 echo "Can't find cat anywhere!"
1533 echo "#!$xcat" >sharp
1536 ./sharp > today 2>/dev/null
1537 if test -s today; then
1540 echo "#! $xcat" > sharp
1543 ./sharp > today 2>/dev/null
1544 if test -s today; then
1552 echo "Your $sh doesn't grok # comments--I will strip them later on."
1555 echo "exec grep -v '^[ ]*#'" >spitshell
1557 $eunicefix spitshell
1558 spitshell=`pwd`/spitshell
1560 echo "I presume that if # doesn't work, #! won't work either!"
1565 : figure out how to guarantee sh startup
1567 '') startsh=${sharpbang}${sh} ;;
1579 : echo "Yup, it does."
1581 echo "Hmm... '$startsh' does not guarantee sh startup..."
1582 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1586 : Save command line options in file UU/cmdline.opt for later use in
1587 : generating config.sh.
1588 cat > cmdline.opt <<EOSH
1589 : Configure command line arguments.
1598 cat >>cmdline.opt <<EOSH
1599 config_arg$argn='$arg'
1601 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1604 arg_exp=`cat cmdl.opt`
1605 args_exp="$args_exp$args_sep'$arg_exp'"
1606 argn=`expr $argn + 1`
1611 : produce awk script to parse command line options
1612 cat >options.awk <<'EOF'
1614 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1616 len = length(optstr);
1617 for (i = 1; i <= len; i++) {
1618 c = substr(optstr, i, 1);
1619 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1630 if (substr(str, 1, 1) != "-") {
1631 printf("'%s'\n", str);
1635 for (i = 2; i <= len; i++) {
1636 c = substr(str, i, 1);
1638 printf("-%s\n", substr(str, i));
1644 printf("'%s'\n", substr(str, i + 1));
1657 : process the command line options
1658 set X `for arg in "$@"; do echo "X$arg"; done |
1659 sed -e s/X// | awk -f options.awk`
1664 : set up default values
1674 rm -f optdef.sh posthint.sh
1675 cat >optdef.sh <<EOS
1681 while test $# -gt 0; do
1683 -d) shift; fastread=yes;;
1684 -e) shift; alldone=cont;;
1688 if test -r "$1"; then
1691 echo "$me: cannot read config file $1." >&2
1697 -h) shift; error=true;;
1698 -r) shift; reuseval=true;;
1699 -s) shift; silent=true; realsilent=true;;
1700 -E) shift; alldone=exit;;
1701 -K) shift; knowitall=true;;
1702 -O) shift; override=true;;
1703 -S) shift; silent=true; extractsh=true;;
1708 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1709 echo "$me: ignoring -D $1" >&2
1712 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1713 *) echo "$1='define'" >> optdef.sh;;
1720 *=) echo "$1" >> optdef.sh;;
1722 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1723 echo "$me: ignoring -U $1" >&2
1725 *) echo "$1='undef'" >> optdef.sh;;
1736 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1740 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1741 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1747 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1748 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1749 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1750 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1751 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1752 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1758 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1760 echo "$yyy=''" >> posthint.sh ;;
1765 echo "$yyy='$zzz'" >> posthint.sh ;;
1767 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1769 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1774 echo "$yyy=$zzz" >> posthint.sh ;;
1775 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1779 -V) echo "$me generated by metaconfig 3.5 PL0." >&2
1782 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1790 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1791 [-U symbol] [-U symbol=] [-A command:symbol...]
1792 -d : use defaults for all answers.
1793 -e : go on without questioning past the production of config.sh.
1794 -f : specify an alternate default configuration file.
1795 -h : print this help message and exit (with an error status).
1796 -r : reuse C symbols value if possible (skips costly nm extraction).
1797 -s : silent mode, only echoes questions and essential information.
1798 -D : define symbol to have some value:
1799 -D symbol symbol gets the value 'define'
1800 -D symbol=value symbol gets the value 'value'
1801 common used examples (see INSTALL for more info):
1802 -Duse64bitint use 64bit integers
1803 -Duse64bitall use 64bit integers and pointers
1804 -Dusethreads use thread support
1805 -Dinc_version_list=none do not include older perl trees in @INC
1806 -DEBUGGING=none DEBUGGING options
1807 -Dcc=gcc choose your compiler
1808 -Dprefix=/opt/perl5 choose your destination
1809 -E : stop at the end of questions, after having produced config.sh.
1810 -K : do not use unless you know what you are doing.
1811 -O : let -D and -U override definitions from loaded configuration file.
1812 -S : perform variable substitutions on all .SH files (can mix with -f)
1813 -U : undefine symbol:
1814 -U symbol symbol gets the value 'undef'
1815 -U symbol= symbol gets completely empty
1817 -A : manipulate symbol after the platform specific hints have been applied:
1818 -A append:symbol=value append value to symbol
1819 -A symbol=value like append:, but with a separating space
1820 -A define:symbol=value define symbol to have value
1821 -A clear:symbol define symbol to be ''
1822 -A define:symbol define symbol to be 'define'
1823 -A eval:symbol=value define symbol to be eval of value
1824 -A prepend:symbol=value prepend value to symbol
1825 -A undef:symbol define symbol to be 'undef'
1826 -A undef:symbol= define symbol to be ''
1827 e.g.: -A prepend:libswanted='cl pthread '
1828 -A ccflags=-DSOME_MACRO
1829 -V : print version number and exit (with a zero status).
1836 case "$fastread$alldone" in
1839 case "$extractsh" in
1842 if test ! -t 0; then
1843 echo "Say 'sh Configure', not 'sh <Configure'"
1853 true) exec 1>/dev/null;;
1856 : run the defines and the undefines, if any, but leave the file out there...
1859 : create the posthint manipulation script and leave the file out there...
1864 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1865 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1866 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1867 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1868 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1871 : Some greps do not return status, grrr.
1872 echo "grimblepritz" >grimble
1873 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1875 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1881 : the following should work in any shell
1885 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1886 cat >contains <<'EOSS'
1887 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1892 : Find the path to the source tree
1895 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1899 *) src=`cd ../$src && pwd` ;;
1912 if test -f $rsrc/Configure && \
1913 $contains "^package='$package'\$" $rsrc/Configure >/dev/null 2>&1
1915 : found it, so we are ok.
1918 for src in . .. ../.. ../../.. ../../../..; do
1919 if test -f ../$src/Configure && \
1920 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1931 Sorry, I can't seem to locate the source dir for $package. Please start
1932 Configure with an explicit path -- i.e. /some/path/Configure.
1940 echo "Sources for $package found in \"$src\"." >&4
1944 : script used to extract .SH files with variable substitutions
1945 cat >extract <<'EOS'
1947 echo "Doing variable substitutions on .SH files..."
1948 if test -f MANIFEST; then
1949 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1951 echo "(Looking for .SH files under the source directory.)"
1952 set x `(cd "$src"; find . -name "*.SH" -print)`
1956 0) set x `(cd "$src"; echo *.SH)`; shift;;
1958 if test ! -f "$src/$1"; then
1964 while test $name; do
1965 if test ! -d "$name"; then
1966 create="$name $create";
1967 name=`echo $name | sed -e "s|^[^/]*$||"`;
1968 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1973 for file in $create; do
1982 dir=`expr X$file : 'X\(.*\)/'`
1983 file=`expr X$file : 'X.*/\(.*\)'`
1984 (cd "$dir" && . ./$file)
1994 dir=`expr X$file : 'X\(.*\)/'`
1995 file=`expr X$file : 'X.*/\(.*\)'`
1996 (set x $dir; shift; eval $mkdir_p)
1997 sh <"$src/$dir/$file"
2006 if test -f "$src/config_h.SH"; then
2007 if test ! -f config.h; then
2008 : oops, they left it out of MANIFEST, probably, so do it anyway.
2009 . "$src/config_h.SH"
2014 : extract files and exit if asked to do so
2015 case "$extractsh" in
2017 case "$realsilent" in
2021 case "$config_sh" in
2022 '') config_sh='config.sh';;
2025 echo "Fetching answers from $config_sh..."
2028 test "$override" && . ./optdef.sh
2032 echo "Extraction done."
2037 : Eunice requires " " instead of "", can you believe it
2040 echo "Beginning of configuration questions for $package."
2042 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
2044 : first determine how to suppress newline on echo command
2046 echo "Checking echo to see how to suppress newlines..."
2047 (echo "hi there\c" ; echo " ") >.echotmp
2048 if $contains c .echotmp >/dev/null 2>&1 ; then
2059 echo $n "The star should be here-->$c"
2063 : Now test for existence of everything in MANIFEST
2065 if test -f "$rsrc/MANIFEST"; then
2066 echo "First let's make sure your kit is complete. Checking..." >&4
2067 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | \
2068 (split -l 50 2>/dev/null || split -50)
2071 for filelist in x??; do
2072 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` \
2073 >/dev/null 2>>"$tmppwd/missing")
2075 if test -s missing; then
2079 THIS PACKAGE SEEMS TO BE INCOMPLETE.
2081 You have the option of continuing the configuration process, despite the
2082 distinct possibility that your kit is damaged, by typing 'y'es. If you
2083 do, don't blame me if something goes wrong. I advise you to type 'n'o
2084 and contact the author (perlbug@perl.org).
2087 echo $n "Continue? [n] $c" >&4
2091 echo "Continuing..." >&4
2095 echo "ABORTING..." >&4
2100 echo "Looks good..."
2103 echo "There is no MANIFEST file. I hope your kit is complete !"
2107 : Find the appropriate value for a newline for tr
2109 if test -n "$DJGPP"; then
2112 if test X"$trnl" = X; then
2113 case "`echo foo|tr '\n' x 2>/dev/null`" in
2117 if test X"$trnl" = X; then
2118 case "`echo foo|tr '\012' x 2>/dev/null`" in
2119 foox) trnl='\012' ;;
2122 if test X"$trnl" = X; then
2123 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
2124 fooxy) trnl='\n\r' ;;
2127 if test X"$trnl" = X; then
2130 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
2136 : compute the number of columns on the terminal for proper question formatting
2141 : set up the echo used in my read
2142 myecho="case \"\$xxxm\" in
2143 '') echo $n \"\$rp $c\" >&4;;
2145 '') echo $n \"[\$xxxm] $c\";;
2147 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
2149 echo $n \"[\$xxxm] $c\" >&4
2151 echo $n \"\$rp [\$xxxm] $c\" >&4
2157 : now set up to do reads with possible shell escape and default assignment
2163 case "\$fastread" in
2164 yes) case "\$dflt" in
2167 case "\$silent-\$rp" in
2172 *) case "\$silent" in
2173 true) case "\$rp" in
2178 while expr "X\$ans" : "X!" >/dev/null; do
2182 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2190 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2199 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2204 echo "(OK, I'll run with -d after this question.)" >&4
2207 echo "*** Sorry, \$1 not supported yet." >&4
2217 echo "*** Substitution done -- please confirm."
2219 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2224 echo "*** Error -- try again."
2231 case "\$ans\$xxxm\$nostick" in
2243 : create .config dir to save info across Configure sessions
2244 test -d ../.config || mkdir ../.config
2245 cat >../.config/README <<EOF
2246 This directory created by Configure to save information that should
2247 persist across sessions for $package.
2249 You may safely delete it if you wish.
2252 : See if we are using a devel version and want that
2253 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2256 usedevel="$define" ;;
2257 *) case "$xversion" in
2260 *** WHOA THERE!!! ***
2262 This is an UNSTABLE DEVELOPMENT release.
2263 The version of this $package distribution is $xversion, that is, odd,
2264 (as opposed to even) and that signifies a development release.
2265 If you want a maintenance release, you want an even-numbered version.
2267 Do ***NOT*** install this into production use.
2268 Data corruption and crashes are possible.
2270 It is most seriously suggested that you do not continue any further
2271 unless you want to help in developing and debugging Perl.
2273 If you *still* want to build perl, you can answer 'y' now,
2274 or pass -Dusedevel to Configure.
2277 rp='Do you really want to continue?'
2281 [yY]) echo >&4 "Okay, continuing."
2282 usedevel="$define" ;;
2283 *) echo >&4 "Okay, bye."
2294 case "$versiononly" in
2295 '') versiononly="$define" ;;
2297 case "$installusrbinperl" in
2298 '') installusrbinperl="$undef" ;;
2303 : general instructions
2306 user=`(logname) 2>/dev/null`
2308 '') user=`whoami 2>&1`;;
2310 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2313 rp='Would you like to see the instructions?'
2324 This installation shell script will examine your system and ask you questions
2325 to determine how the perl5 package should be installed. If you get
2326 stuck on a question, you may use a ! shell escape to start a subshell or
2327 execute a command. Many of the questions will have default answers in square
2328 brackets; typing carriage return will give you the default.
2330 On some of the questions which ask for file or directory names you are allowed
2331 to use the ~name construct to specify the login directory belonging to "name",
2332 even if you don't have a shell which knows about that. Questions where this is
2333 allowed will be marked "(~name ok)".
2337 dflt='Type carriage return to continue'
2341 The prompter used in this script allows you to use shell variables and
2342 backticks in your answers. You may use $1, $2, etc... to refer to the words
2343 in the default answer, as if the default line was a set of arguments given to a
2344 script shell. This means you may also use $* to repeat the whole default line,
2345 so you do not have to re-type everything to add something to the default.
2347 Every time there is a substitution, you will have to confirm. If there is an
2348 error (e.g. an unmatched backtick), the default answer will remain unchanged
2349 and you will be prompted again.
2351 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2352 the questions and use the computed defaults (or the previous answers if there
2353 was already a config.sh file). Type 'Configure -h' for a list of options.
2354 You may also start interactively and then answer '& -d' at any prompt to turn
2355 on the non-interactive behaviour for the remainder of the execution.
2361 Much effort has been expended to ensure that this shell script will run on any
2362 Unix system. If despite that it blows up on yours, your best bet is to edit
2363 Configure and run it again. If you can't run Configure for some reason,
2364 you'll have to generate a config.sh file by hand. Whatever problems you
2365 have, let me (perlbug@perl.org) know how I blew it.
2367 This installation script affects things in two ways:
2369 1) it may do direct variable substitutions on some of the files included
2371 2) it builds a config.h file for inclusion in C programs. You may edit
2372 any of these files as the need arises after running this script.
2374 If you make a mistake on a question, there is no easy way to back up to it
2375 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2376 files. Configure will offer to let you do this before it runs the SH files.
2379 dflt='Type carriage return to continue'
2381 case "$firsttime" in
2382 true) echo $user >>../.config/instruct;;
2386 : Set 'sysroot' to change the logical root directory to your headers and libraries see man gcc
2387 : This is primarily meant for cross-compile environments, and may fail to be useful in other cases
2388 if test "X$sysroot" = X; then
2393 echo "Using $sysroot to find your headers and libraries, adding to ccflags"
2394 # _sysroot is used in places where we need --sysroot=foo
2395 # but using the rest of the flags could cause issues.
2396 _sysroot="--sysroot=$sysroot";
2400 ccflags="$ccflags $_sysroot"
2405 ldflags="$ldflags $_sysroot"
2410 cppflags="$cppflags $_sysroot"
2412 # lddlflags updated below in lddlflags section;
2413 # same with cccdlflags
2417 # Adjust some defaults to also use $sysroot
2418 for var in xlibpth loclibpth locincpth glibpth; do
2421 for path in $xxx; do
2422 eval $var=\"\$$var $sysroot$path\"
2428 : find out where common programs are
2430 echo "Locating common programs..." >&4
2443 if test -d \$dir/\$thing; then
2449 for thisthing in \$dir/\$thing; do
2450 : just loop through to pick last item
2452 if test -f \$thisthing; then
2455 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2458 elif test -f \$dir/\$thing.exe; then
2459 if test -n "$DJGPP"; then
2460 echo \$dir/\$thing.exe
2461 elif test "$eunicefix" != ":"; then
2462 : on Eunice apparently
2515 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2516 pth="$pth $sysroot/lib $sysroot/usr/lib"
2517 for file in $loclist; do
2521 if test -f "$xxx"; then
2524 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2525 xxx=`./loc $file $file $pth`
2528 '') xxx=`./loc $file $file $pth`;;
2529 *) xxx=`./loc $xxx $xxx $pth`;;
2531 eval $file=$xxx$_exe
2535 echo $file is in $xxx.
2538 echo $file is in $xxx.
2541 echo "I don't know where '$file' is, and my life depends on it." >&4
2542 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2548 echo "Don't worry if any of the following aren't found..."
2550 for file in $trylist; do
2554 if test -f "$xxx"; then
2557 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2558 xxx=`./loc $file $file $pth`
2561 '') xxx=`./loc $file $file $pth`;;
2562 *) xxx=`./loc $xxx $xxx $pth`;;
2564 eval $file=$xxx$_exe
2568 echo $file is in $xxx.
2571 echo $file is in $xxx.
2574 echo "I don't see $file out there, $say."
2581 echo "Substituting grep for egrep."
2588 *) if $less -R </dev/null >/dev/null 2>&1; then
2589 echo "Substituting less -R for less."
2597 echo "Substituting cp for ln."
2606 echo "I can't find make or gmake, and my life depends on it." >&4
2607 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2615 *) # We can't have osname yet.
2616 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2617 # Assume that gmake, if found, is definitely GNU make
2618 # and prefer it over the system make.
2619 echo "Substituting gmake for make."
2627 echo "Hopefully test is built into your sh."
2630 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2631 echo "Using the test built into your sh."
2639 echo "Hopefully echo is built into your sh."
2644 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2645 $echo $n "hi there$c" >foo1
2646 echo $n "hi there$c" >foo2
2647 if cmp foo1 foo2 >/dev/null 2>&1; then
2648 echo "They are compatible. In fact, they may be identical."
2655 They are not compatible! You are probably running ksh on a non-USG system.
2656 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2657 have echo built in and we may have to run some Bourne shell scripts. That
2658 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2661 $echo $n "The star should be here-->$c"
2668 # This question was auctioned at YAPC::Europe-2007 in Vienna
2669 # I never promised you could answer it. I only auctioned the question.
2671 The following message is sponsored by
2673 Dresden.pm<--The stars should be here.
2675 Dear Perl user, system administrator or package
2676 maintainer, the Perl community sends greetings to
2677 you. Do you (emblematical) greet back [Y/n]? n
2681 : Check what type of C compiler we use
2685 cat <<'EOSC' >>trygcc
2690 int main(int argc, char *argv[]) {
2694 if $cc -o try $ccflags $ldflags try.c; then
2697 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2703 # Skip this test because it gives a false match on output like:
2704 # ./trygcc: line 23: cc: command not found
2705 # case "`$cc -v -c try.c 2>&1`" in
2706 # *gcc*) trygcc=no ;;
2708 if $test X"$trygcc" = Xyes; then
2709 if gcc -o try -c try.c; then
2711 echo "You seem to have a working gcc, though." >&4
2712 # Switching compilers may undo the work of hints files.
2713 # The most common problem is -D_REENTRANT for threads.
2714 # This heuristic catches that case, but gets false positives
2715 # if -Dusethreads was not actually specified. Better to
2716 # bail out here with a useful message than fail
2717 # mysteriously later. Should we perhaps just try to
2718 # re-invoke Configure -Dcc=gcc config_args ?
2719 if $test -f usethreads.cbu; then
2722 *** However, any setting of the C compiler flags (e.g. for thread support)
2723 *** will be lost. It may be necessary for you to restart Configure and
2724 *** add -Dcc=gcc to your Configure command line.
2727 rp="Would you like to go ahead and try gcc anyway?"
2730 rp="Would you like to use it?"
2733 if $test -f myread; then
2736 if $test -f UU/myread; then
2739 echo "Cannot find myread, sorry. Aborting." >&2
2744 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2757 cat <<'EOSC' >>checkcc
2762 int main(int argc, char *argv[]) {
2766 if $cc -o try $ccflags $ldflags try.c; then
2769 if $test X"$despair" = Xyes; then
2770 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2773 You need to find a working C compiler.
2774 Either (purchase and) install the C compiler supplied by your OS vendor,
2775 or for a free C compiler try http://gcc.gnu.org/
2776 I cannot continue any further, aborting.
2785 : determine whether symbolic links are supported
2788 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2789 echo "Symbolic links are supported." >&4
2792 echo "Symbolic links are NOT supported." >&4
2797 : determine whether symbolic links are supported
2801 echo "Checking how to test for symbolic links..." >&4
2803 if $test "X$issymlink" = X; then
2805 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2806 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2808 if test $? = 0; then
2811 echo "Your builtin 'test -h' may be broken." >&4
2814 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2817 if test -f "$p/$test"; then
2826 echo "Trying external '$test -h'." >&4
2827 issymlink="$test -h"
2828 if $test ! -h sym >/dev/null 2>&1; then
2829 echo "External '$test -h' is broken, too." >&4
2837 if $test "X$issymlink" = X; then
2838 if $test -L sym 2>/dev/null; then
2839 issymlink="$test -L"
2840 echo "The builtin '$test -L' worked." >&4
2843 if $test "X$issymlink" != X; then
2844 echo "You can test for symbolic links with '$issymlink'." >&4
2846 echo "I do not know how you can test for symbolic links." >&4
2850 *) echo "No symbolic links, so not testing for their testing..." >&4
2855 : Make symlinks util
2856 case "$mksymlinks" in
2859 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2862 *) case "$lns:$issymlink" in
2863 *"ln"*" -s:"*"test -"?)
2864 echo "Creating the symbolic links..." >&4
2866 awk '{print $1}' $src/MANIFEST | sed -e 's:/\([^/]*\)$: \1:' |
2876 print "# dir = ", dir, "file = ", file
2877 mf[dir] = mf[dir]" "source"/"dir"/"file;
2880 if (d != ".") { print("mkdir -p "d) }
2881 print("ln -sf "mf[d]" "d);
2883 }' source="$src" > UU/mksymlinks.$$
2887 if test ! -d t/base; then
2888 echo "Failed to create the subdirectories. Aborting." >&4
2892 if test ! -f t/base/lex.t; then
2893 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2896 if test ! -f win32/win32.c; then
2897 echo "Failed to create the symlinks (win32/win32.c missing). Aborting." >&4
2902 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2910 : Check for Cross-Compilation
2911 if $test "X$targethost" = "X"; then
2914 if $test "X$targetenv" = "X"; then
2917 case "$usecrosscompile" in
2919 $echo "Cross-compiling..."
2922 *-gcc*|*-g++*) # A cross-compiling gcc, probably.
2923 # arm-linux-androideabi-gcc -> arm-linux-androideabi
2924 # x86_64-w64-mingw32-gcc.exe -> x86_64-w64-mingw32
2925 targetarch=`$echo $cc|$sed 's/-g[c\+][c\+].*$//'`
2926 ar=`$echo $cc|$sed 's/-g[c\+][c\+]/-ar/'`
2927 # leave out ld, choosing it is more complex
2928 nm=`$echo $cc|$sed 's/-g[c\+][c\+]/-nm/'`
2929 ranlib=`$echo $cc|$sed 's/-g[c\+][c\+]/-ranlib/'`
2930 # We are in a weird spot. Just before us, some values
2931 # were 'saved', to be restored after the hints are
2932 # run. This means that the changes we made to ar,
2933 # nm and ranlib will get reverted.
2934 # To avoid that, we hijack the saving mechanism and
2935 # have it save our new values.
2936 for file in ar nm ranlib; do
2938 eval $file=$xxx$_exe
2943 case "$targetarch" in
2944 '') echo "Targetarch not defined." >&4; croak=y ;;
2945 *) echo "Using targetarch $targetarch." >&4 ;;
2947 case "$targethost" in
2948 '') echo "Targethost not defined." >&4; croak=y ;;
2949 *) echo "Using targethost $targethost." >&4
2954 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2956 : compile a host miniperl and generate_uudmap, unless we got passed them
2957 if $test "X$hostperl" = X; then
2958 echo "Building host miniperl and generate_uudmap binaries" >&4
2966 $src/Configure -des -Dusedevel -Dmksymlinks
2968 case "$hostgenerate" in
2969 '') $make generate_uudmap
2970 hostgenerate=$src/host/generate_uudmap
2972 "$undef") hostgenerate=''
2975 hostperl=$src/host/miniperl
2978 hostosname=`$hostperl -le 'print $^O'`
2981 usecrosscompile="$undef"
2985 : Define -Dtargethost=somecomputer to run compiled tests on another machine
2986 case "$targethost" in
2987 '') echo "Checking for cross-compile" >&4
2988 case "$usecrosscompile$multiarch" in
2989 *$define*) echo "Skipping the try tests in the rest of Configure as no targethost was defined when cross-compiling" >&4
2990 if [ -f Makefile ]; then
2992 echo "Now you must ensure config.sh, config.h and the generated headers exist and run a $make."
2994 echo "Configure done."
2998 *) echo "No targethost for running compiler tests against defined, running locally" >&4
3005 *) echo "Using targethost $targethost." >&4
3007 /*) run=$src/Cross/run
3008 targetmkdir=$src/Cross/mkdir
3010 from=$src/Cross/from
3012 *) pwd=`$test -f ../Configure & cd ..; pwd`
3014 targetmkdir=$pwd/Cross/mkdir
3016 from=$pwd/Cross/from
3019 case "$targetrun" in
3020 '') targetrun=ssh ;;
3025 case "$targetfrom" in
3026 '') targetfrom=scp ;;
3030 from=$from-$targetfrom
3031 case "$targetdir" in
3033 echo "Guessing targetdir $targetdir." >&4
3036 case "$targetuser" in
3038 echo "Guessing targetuser $targetuser." >&4
3041 case "$targetport" in
3043 echo "Guessing targetport $targetport." >&4
3046 case "$targetfrom" in
3050 case "$targetrun" in
3070 '') cwd=$targetdir ;;
3075 $targetrun -p $targetport -l $targetuser $targethost "cd \$cwd && \$env \$exe \$@"
3081 *) echo "Unknown targetrun '$targetrun'" >&4
3085 case "$targetmkdir" in
3087 cat >$targetmkdir <<EOF
3089 $targetrun -p $targetport -l $targetuser $targethost "mkdir -p \$@"
3091 $chmod a+rx $targetmkdir
3093 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
3105 $targetmkdir \`dirname \$f\`
3106 $targetto -P $targetport -r $q \$f $targetuser@$targethost:\$f 2>/dev/null || exit 1
3109 $targetmkdir $targetdir/\`dirname \$f\`
3110 $targetto -P $targetport -r $q \$f $targetuser@$targethost:$targetdir/\$f 2>/dev/null || exit 1
3123 $mkdir -p $targetdir/\`dirname \$f\`
3124 $cp \$f $targetdir/\$f || exit 1
3127 $targetmkdir $targetdir/\`dirname \$f\`
3128 $cp \$f $targetdir/\$f || exit 1
3135 *) echo "Unknown targetto '$targetto'" >&4
3139 case "$targetfrom" in
3146 $targetfrom -P $targetport $q $targetuser@$targethost:$targetdir/\$f . || exit 1
3151 cp) cat >$from <<EOF
3156 cp $targetdir/\$f . || exit 1
3161 *) echo "Unknown targetfrom '$targetfrom'" >&4
3165 if $test ! -f $run; then
3166 echo "Target 'run' script '$run' not found." >&4
3170 if $test ! -f $to; then
3171 echo "Target 'to' script '$to' not found." >&4
3175 if $test ! -f $from; then
3176 echo "Target 'from' script '$from' not found." >&4
3180 if $test ! -f $run -o ! -f $to -o ! -f $from; then
3184 Using '$run' for remote execution,
3185 and '$from' and '$to'
3186 for remote file transfer.
3192 usecrosscompile="$undef"
3197 : see whether [:lower:] and [:upper:] are supported character classes
3199 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
3201 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
3205 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
3206 # (0xd9 and 0xe2), therefore that is a nice testing point.
3207 if test "X$up" = X -o "X$low" = X; then
3208 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
3214 if test "X$up" = X -o "X$low" = X; then
3215 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
3221 if test "X$up" = X -o "X$low" = X; then
3222 case "`echo RS | od -x 2>/dev/null`" in
3224 echo "Hey, this might be EBCDIC." >&4
3225 if test "X$up" = X -o "X$low" = X; then
3226 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
3227 rs) up='[A-IJ-RS-Z]'
3232 if test "X$up" = X -o "X$low" = X; then
3233 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
3243 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
3245 echo "Using $up and $low to convert case." >&4
3248 echo "I don't know how to translate letters from upper to lower case." >&4
3249 echo "Your tr is not acting any way I know of." >&4
3253 : set up the translation script tr, must be called with ./tr of course
3257 '[A-Z][a-z]') exec $tr '$up' '$low';;
3258 '[a-z][A-Z]') exec $tr '$low' '$up';;
3265 : Try to determine whether config.sh was made on this system
3266 case "$config_sh" in
3268 myuname=`$uname -a 2>/dev/null`
3269 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
3270 # Downcase everything to avoid ambiguity.
3271 # Remove slashes and single quotes so we can use parts of this in
3272 # directory and file names.
3273 # Remove newlines so myuname is sane to use elsewhere.
3274 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
3275 # because the A-Z/a-z are not consecutive.
3276 myuname=`echo $myuname | $sed -e "s,['/],,g" | \
3277 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
3278 newmyuname="$myuname"
3280 case "$knowitall" in
3282 if test -f ../config.sh; then
3283 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3284 eval "`grep myuname= ../config.sh`"
3286 if test "X$myuname" = "X$newmyuname"; then
3294 : Get old answers from old config file if Configure was run on the
3295 : same system, otherwise use the hints.
3298 if test -f config.sh; then
3300 rp="I see a config.sh file. Shall I use it to set the defaults?"
3303 n*|N*) echo "OK, I'll ignore it."
3304 mv config.sh config.sh.old
3305 myuname="$newmyuname"
3307 *) echo "Fetching default answers from your old config.sh file..." >&4
3315 : Older versions did not always set $sh. Catch re-use of such
3325 if test ! -f config.sh; then
3328 First time through, eh? I have some defaults handy for some systems
3329 that need some extra help getting the Configure answers right:
3332 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3334 : Half the following guesses are probably wrong... If you have better
3335 : tests or hints, please send them to perlbug@perl.org
3336 : The metaconfig authors would also appreciate a copy...
3337 $test -f /irix && osname=irix
3338 $test -f /xenix && osname=sco_xenix
3339 $test -f /dynix && osname=dynix
3340 $test -f /dnix && osname=dnix
3341 $test -f /lynx.os && osname=lynxos
3342 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3343 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3344 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3345 $test -f /bin/mips && /bin/mips && osname=mips
3346 $test -d /usr/apollo/bin && osname=apollo
3347 $test -f /etc/saf/_sactab && osname=svr4
3348 $test -d /usr/include/minix && osname=minix && osvers=`$uname -r`
3349 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3350 if $test -d /MachTen -o -d /MachTen_Folder; then
3352 if $test -x /sbin/version; then
3353 osvers=`/sbin/version | $awk '{print $2}' |
3354 $sed -e 's/[A-Za-z]$//'`
3355 elif $test -x /usr/etc/version; then
3356 osvers=`/usr/etc/version | $awk '{print $2}' |
3357 $sed -e 's/[A-Za-z]$//'`
3363 $test -f /sys/posix.dll &&
3364 $test -f /usr/bin/what &&
3365 set X `/usr/bin/what /sys/posix.dll` &&
3366 $test "$3" = UWIN &&
3370 if $test -f $uname; then
3378 umips) osname=umips ;;
3381 [23]100) osname=mips ;;
3383 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3384 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3387 elif $test -f /etc/kconfig; then
3389 if test "$lns" = "$ln -s"; then
3391 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3393 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3400 if test -n "$DJGPP"; then
3409 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3411 # oslevel can fail with:
3412 # oslevel: Unable to acquire lock.
3413 *not\ found) osvers="$4"."$3" ;;
3414 '<3240'|'<>3240') osvers=3.2.0 ;;
3415 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3416 '=3250'|'>3250') osvers=3.2.5 ;;
3420 bitrig) osname=bitrig
3423 bsd386) osname=bsd386
3426 cygwin*) osname=cygwin
3429 *dc.osx) osname=dcosx
3435 domainos) osname=apollo
3441 dragonfly) osname=dragonfly
3444 dynixptx*) osname=dynixptx
3445 osvers=`echo "$4"|sed 's/^v//'`
3447 freebsd) osname=freebsd
3449 genix) osname=genix ;;
3453 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3466 $test -f /system/lib/libandroid.so && osname=linux-android
3470 netbsd*) osname=netbsd
3473 news-os) osvers="$3"
3475 4*) osname=newsos4 ;;
3479 nonstop-ux) osname=nonstopux ;;
3480 openbsd) osname=openbsd
3486 POSIX-BC | posix-bc ) osname=posix-bc
3489 powerux | power_ux | powermax_os | powermaxos | \
3490 powerunix | power_unix) osname=powerux
3496 solaris) osname=solaris
3498 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3505 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3509 titanos) osname=titanos
3518 ultrix) osname=ultrix
3521 osf1|mls+) case "$5" in
3524 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3527 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3530 hp*) osname=hp_osf1 ;;
3531 mips) osname=mips_osf1 ;;
3534 # UnixWare 7.1.2 is known as Open UNIX 8
3535 openunix|unixware) osname=svr5
3543 $2) case "$osname" in
3547 : svr4.x or possibly later
3557 if test -f /stand/boot ; then
3558 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3559 if test -n "$INITPROG" -a -f "$INITPROG"; then
3560 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3561 if test -n "$isesix"; then
3569 *) if test -f /etc/systemid; then
3571 set `echo $3 | $sed 's/\./ /g'` $4
3572 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3574 elif $test -f $src/hints/sco_$1_$2.sh; then
3576 elif $test -f $src/hints/sco_$1.sh; then
3581 '') : Still unknown. Probably a generic Sys V.
3590 *) case "$osname" in
3591 '') : Still unknown. Probably a generic BSD.
3599 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3600 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3601 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3604 $rm -f UU/kernel.what
3605 elif test -d c:/. -o -n "$is_os2" ; then
3612 case "$targetarch" in
3615 case "$targetarch" in
3617 # Will load qnx.sh, which should change osname to nto
3622 # Catch arm-linux-androideabi, mipsel-linux-android,
3623 # and i686-linux-android
3624 osname=linux-android
3628 # Something like arm-linux-gnueabihf is really just
3635 # XXX perhaps we should just assume
3636 # osvers to be 2, or maybe take the value
3637 # from targetarch. Using $run before the
3638 # hints are run is somewhat icky.
3639 set X `$run $uname -a 2>/dev/null`
3642 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3647 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3654 : Now look for a hint file osname_osvers, unless one has been
3655 : specified already.
3658 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3659 : Also try without trailing minor version numbers.
3660 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3661 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3662 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3663 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3666 *) case "$osvers" in
3669 *) if $test -f $src/hints/$file.sh ; then
3671 elif $test -f $src/hints/$xfile.sh ; then
3673 elif $test -f $src/hints/$xxfile.sh ; then
3675 elif $test -f $src/hints/$xxxfile.sh ; then
3677 elif $test -f $src/hints/$xxxxfile.sh ; then
3679 elif $test -f "$src/hints/${osname}.sh" ; then
3688 if $test -f Policy.sh ; then
3691 none) dflt="Policy" ;;
3692 *) dflt="Policy $dflt" ;;
3697 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3701 if $test -f Policy.sh ; then
3704 There's also a Policy hint file available, which should make the
3705 site-specific (policy) questions easier to answer.
3712 You may give one or more space-separated answers, or "none" if appropriate.
3713 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3714 previous run of Configure, you may specify it as well as or instead of
3715 OS-specific hints. If hints are provided for your OS, you should use them:
3716 although Perl can probably be built without hints on many platforms, using
3717 hints often improve performance and may enable features that Configure can't
3718 set up on its own. If there are no hints that match your OS, specify "none";
3719 DO NOT give a wrong version or a wrong OS.
3723 rp="Which of these apply, if any?"
3726 for file in $tans; do
3727 if $test X$file = XPolicy -a -f Policy.sh; then
3729 $cat Policy.sh >> UU/config.sh
3730 elif $test -f $src/hints/$file.sh; then
3731 . $src/hints/$file.sh
3732 $cat $src/hints/$file.sh >> UU/config.sh
3733 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3736 : Give one chance to correct a possible typo.
3737 echo "$file.sh does not exist"
3739 rp="hint to use instead?"
3741 for file in $ans; do
3742 if $test -f "$src/hints/$file.sh"; then
3743 . $src/hints/$file.sh
3744 $cat $src/hints/$file.sh >> UU/config.sh
3745 elif $test X$ans = X -o X$ans = Xnone ; then
3748 echo "$file.sh does not exist -- ignored."
3755 : Remember our hint file for later.
3756 if $test -f "$src/hints/$file.sh" ; then
3766 echo "Fetching default answers from $config_sh..." >&4
3770 cp $config_sh config.sh 2>/dev/null
3780 test "$override" && . ./optdef.sh
3782 : Restore computed paths
3783 for file in $loclist $trylist; do
3784 eval $file="\$_$file"
3789 Configure uses the operating system name and version to set some defaults.
3790 The default value is probably right if the name rings a bell. Otherwise,
3791 since spelling matters for me, either accept the default or answer "none"
3798 ''|' '|none) dflt=none ;;
3799 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3802 *) dflt="$osname" ;;
3804 rp="Operating system name?"
3808 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3814 ''|' '|none) dflt=none ;;
3815 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3816 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3818 ''|' ') dflt=none ;;
3823 *) dflt="$osvers" ;;
3825 rp="Operating system version?"
3835 : who configured the system
3836 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3839 cf_by=`(logname) 2>/dev/null`
3842 cf_by=`(whoami) 2>/dev/null`
3844 "") cf_by=unknown ;;
3849 : decide how portable to be. Allow command line overrides.
3850 case "$d_portable" in
3852 *) d_portable="$define" ;;
3855 : set up shell script to do ~ expansion
3861 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3864 if $test -f /bin/csh; then
3865 /bin/csh -f -c "glob \$1"
3870 name=\`$expr x\$1 : '..\([^/]*\)'\`
3871 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3872 if $test ! -d "\$dir"; then
3874 echo "\$me: can't locate home directory for: \$name" >&2
3879 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3895 : now set up to get a file name
3899 cat <<'EOSC' >>getfile
3915 : getfile will accept an answer from the comma-separated list
3916 : enclosed in parentheses even if it does not meet other criteria.
3917 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3918 fn=`echo $fn | sed 's/(.*)//'`
3924 loc_file=`expr $fn : '.*:\(.*\)'`
3925 fn=`expr $fn : '\(.*\):.*'`
3933 */*) fullpath=true;;
3942 *e*) exp_file=true;;
3945 *p*) nopath_ok=true;;
3950 *d*) type='Directory';;
3951 *l*) type='Locate';;
3956 Locate) what='File';;
3961 case "$d_portable" in
3969 while test "$type"; do
3974 true) rp="$rp (~name ok)";;
3977 if test -f UU/getfile.ok && \
3978 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3997 value=`UU/filexp $ans`
4000 if test "$ans" != "$value"; then
4001 echo "(That expands to $value on this system.)"
4015 /*) value="$ansexp" ;;
4016 [a-zA-Z]:/*) value="$ansexp" ;;
4021 echo "I shall only accept a full path name, as in /bin/ls." >&4
4022 echo "Use a ! shell escape if you wish to check pathnames." >&4
4025 echo "Please give a full path name, starting with slash." >&4
4028 echo "Note that using ~name is ok provided it expands well." >&4
4041 for fp in $gfpth; do
4042 if test "X$fp" = X.; then
4047 if test -f "$pf"; then
4049 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
4051 echo "($value is not a plain file, but that's ok.)"
4054 if test X"$type" = X; then
4061 for fp in $gfpth; do
4062 if test "X$fp" = X.; then
4067 direxp="$fp/$ansexp"
4069 if test -d "$direxp"; then
4077 if test -d "$ansexp"; then
4078 echo "(Looking for $loc_file in directory $value.)"
4079 value="$value/$loc_file"
4080 ansexp="$ansexp/$loc_file"
4082 if test -f "$ansexp"; then
4085 case "$nopath_ok" in
4086 true) case "$value" in
4088 *) echo "Assuming $value will be in people's path."
4104 if test "$fastread" = yes; then
4109 rp="$what $value doesn't exist. Use that name anyway?"
4128 test "X$gfpthkeep" != Xy && gfpth=""
4131 : determine root of directory hierarchy where package will be installed.
4134 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
4137 dflt=`echo "$prefix" | sed 's/.$//'`
4145 By default, $package will be installed in $dflt/bin, manual pages
4146 under $dflt/man, etc..., i.e. with $dflt as prefix for all
4147 installation directories. Typically this is something like /usr/local.
4148 If you wish to have binaries under /usr/bin but other parts of the
4149 installation under /usr/local, that's ok: you will be prompted
4150 separately for each of the installation directories, the prefix being
4151 only used to set the defaults.
4155 rp='Installation prefix to use?'
4163 *) oldprefix="$prefix";;
4170 : allow them to override the AFS root
4173 *) afsroot=$afsroot ;;
4179 $define|true) afs=true ;;
4180 $undef|false) afs=false ;;
4181 *) if $test -d $afsroot; then
4189 echo "AFS may be running... I'll be extra cautious then..." >&4
4191 echo "AFS does not seem to be running..." >&4
4194 : determine installation prefix for where package is to be installed.
4198 Since you are running AFS, I need to distinguish the directory in which
4199 files will reside from the directory in which they are installed (and from
4200 which they are presumably copied to the former directory by occult means).
4203 case "$installprefix" in
4204 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
4205 *) dflt="$installprefix";;
4210 In some special cases, particularly when building $package for distribution,
4211 it is convenient to distinguish the directory in which files should be
4212 installed from the directory ($prefix) in which they will
4213 eventually reside. For most users, these two directories are the same.
4216 case "$installprefix" in
4218 *) dflt=$installprefix;;
4222 rp='What installation prefix should I use for installing files?'
4224 installprefix="$ans"
4225 installprefixexp="$ansexp"
4227 : Perform the prefixexp/installprefixexp correction if necessary
4228 cat <<EOS >installprefix
4231 cat <<'EOSC' >>installprefix
4232 : Change installation prefix, if necessary.
4233 if $test X"$prefix" != X"$installprefix"; then
4234 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
4236 eval "install${prefixvar}=\"\$${prefixvar}exp\""
4239 chmod +x installprefix
4240 $eunicefix installprefix
4242 : Set variables such as privlib and privlibexp from the output of ./getfile
4243 : performing the prefixexp/installprefixexp correction if necessary.
4244 cat <<EOS >setprefixvar
4247 cat <<'EOSC' >>setprefixvar
4248 eval "${prefixvar}=\"\$ans\""
4249 eval "${prefixvar}exp=\"\$ansexp\""
4252 chmod +x setprefixvar
4253 $eunicefix setprefixvar
4255 : set up the script used to warn in case of inconsistency
4264 '') echo "The $hint value for \$$var on this machine was \"$was\"!" >&4
4266 *) echo "Hmm. Based on the hints in hints/$hintfile.sh, " >&4
4267 echo "the $hint value for \$$var on this machine was \"$was\"!" >&4
4272 echo "*** WHOA THERE!!! ***" >&4
4273 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
4276 rp=" Keep the $hint value?"
4279 y) td=$was; tu=$was;;
4283 : function used to set '$1' to '$val'
4284 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
4286 $define$undef) . ./whoa; eval "$var=\$td";;
4287 $undef$define) . ./whoa; eval "$var=\$tu";;
4288 *) eval "$var=$val";;
4291 : get the patchlevel
4293 echo "Getting the current patchlevel..." >&4
4294 if $test -r $rsrc/patchlevel.h;then
4295 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
4296 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4297 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4298 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4299 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4300 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4301 perl_patchlevel=`egrep ',"(MAINT|SMOKE)[0-9][0-9]*"' $rsrc/patchlevel.h|tail -1|sed 's/[^0-9]//g'`
4310 $echo "(You do not have patchlevel.h. Eek.)"
4312 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
4313 version_patchlevel_string="version $patchlevel subversion $subversion"
4314 case "$perl_patchlevel" in
4316 *) perl_patchlevel=`echo $perl_patchlevel | sed 's/.* //'`
4317 version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel"
4321 $echo "(You have $package $version_patchlevel_string.)"
4325 : XXX Should be a Configure test for double-dots in filenames.
4326 version=`echo $revision $patchlevel $subversion | \
4327 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4328 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4329 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4332 version=`echo $revision $patchlevel $subversion | \
4333 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4334 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4335 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4338 : Special case the 5.005_xx maintenance series, which used 5.005
4339 : without any subversion label as a subdirectory in $sitelib
4340 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4341 api_versionstring='5.005'
4344 : Do we want threads support and if so, what type
4345 case "$usethreads" in
4346 $define|true|[yY]*) dflt='y';;
4347 *) # Catch case where user specified ithreads or 5005threads but
4348 # forgot -Dusethreads (A.D. 4/2002)
4349 case "$useithreads$use5005threads" in
4350 *$define*) dflt='y';;
4357 Perl can be built to offer a form of threading support on some systems
4358 To do so, Configure can be run with -Dusethreads.
4360 Note that Perl built with threading support runs slightly slower
4361 and uses slightly more memory than plain Perl.
4363 If this doesn't make any sense to you, just accept the default '$dflt'.
4365 rp='Build a threading Perl?'
4368 y|Y) val="$define" ;;
4374 if $test $patchlevel -lt 9; then
4375 case "$usethreads" in
4377 : Default to ithreads unless overridden on command line or with
4380 case "$use5005threads" in
4382 echo "5.005 threads are no longer supported"
4386 case "$useithreads" in
4387 $undef|false|[nN]*) dflt='n';;
4389 rp='Use the newer interpreter-based ithreads?'
4392 y|Y) val="$define" ;;
4397 : Now set use5005threads to the opposite value.
4398 case "$useithreads" in
4399 $define) val="$undef" ;;
4406 useithreads="$undef"
4407 use5005threads="$undef"
4411 case "$useithreads$use5005threads" in
4415 You cannot have both the ithreads and the 5.005 threads enabled
4416 at the same time. Disabling the 5.005 threads since they are
4417 much less stable than the ithreads.
4420 use5005threads="$undef"
4425 : perl-5.9.x and later
4427 if test X"$usethreads" = "X$define"; then
4428 case "$use5005threads" in
4432 5.005 threads has been removed for 5.10. Perl will be built using ithreads.
4439 use5005threads="$undef"
4440 useithreads="$usethreads"
4443 case "$d_oldpthreads" in
4444 '') : Configure tests would be welcome here. For now, assume undef.
4446 *) val="$d_oldpthreads" ;;
4452 : Look for a hint-file generated 'call-back-unit'. If the
4453 : user has specified that a threading perl is to be built,
4454 : we may need to set or change some other defaults.
4455 if $test -f usethreads.cbu; then
4456 echo "Your platform has some specific hints regarding threaded builds, using them..."
4459 case "$usethreads" in
4460 "$define"|true|[yY]*)
4462 (Your platform does not have any specific hints for threaded builds.
4463 Assuming POSIX threads, then.)
4469 : Check if multiplicity is required
4472 Perl can be built so that multiple Perl interpreters can coexist
4473 within the same Perl executable.
4476 case "$useithreads" in
4479 This multiple interpreter support is required for interpreter-based threads.
4483 *) case "$usemultiplicity" in
4484 $define|true|[yY]*) dflt='y';;
4488 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4489 rp='Build Perl for multiplicity?'
4492 y|Y) val="$define" ;;
4500 : Check if morebits is requested
4501 case "$usemorebits" in
4502 "$define"|true|[yY]*)
4503 use64bitint="$define"
4504 uselongdouble="$define"
4505 usemorebits="$define"
4507 *) usemorebits="$undef"
4511 : Determine the C compiler to be used
4517 rp="Use which C compiler?"
4521 : See whether they have no cc but they do have gcc
4523 if $test -f cc.cbu; then
4528 : make some quick guesses about what we are up against
4530 $echo $n "Hmm... $c"
4540 $cat $sysroot/usr/include/signal.h $sysroot/usr/include/sys/signal.h >foo 2>/dev/null
4541 if test -f /osf_boot || $contains 'OSF/1' $sysroot/usr/include/ctype.h >/dev/null 2>&1
4543 echo "Looks kind of like an OSF/1 system, but we'll see..."
4545 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4546 xxx=`./loc addbib blurfl $pth`
4547 if $test -f $xxx; then
4548 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4552 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4553 echo "Looks kind of like an extended USG system, but we'll see..."
4555 echo "Looks kind of like a USG system, but we'll see..."
4559 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4560 echo "Looks kind of like a BSD system, but we'll see..."
4564 echo "Looks kind of like a Version 7 system, but we'll see..."
4567 case "$eunicefix" in
4570 There is, however, a strange, musty smell in the air that reminds me of
4571 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4575 : it so happens the Eunice I know will not run shell scripts in Unix format
4579 echo "Congratulations. You aren't running Eunice."
4583 : Detect OS2. The p_ variable is set above in the Head.U unit.
4584 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4585 : semicolon as a patch separator
4590 I have the feeling something is not exactly right, however...don't tell me...
4591 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4592 (Or you may be running DOS with DJGPP.)
4597 if test -f /xenix; then
4598 echo "Actually, this looks more like a XENIX system..."
4603 echo "It's not Xenix..."
4608 if test -f /venix; then
4609 echo "Actually, this looks more like a VENIX system..."
4616 echo "Nor is it Venix..."
4619 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4620 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4623 : Check if we are using GNU gcc and what its version is
4625 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4629 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4631 printf("%s\n", __VERSION__);
4633 printf("%s\n", "1");
4639 if $cc -o try $ccflags $ldflags try.c; then
4640 gccversion=`$run ./try`
4641 case "$gccversion" in
4642 '') echo "You are not using GNU cc." ;;
4643 *) echo "You are using GNU cc $gccversion."
4649 echo "*** WHOA THERE!!! ***" >&4
4650 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4651 case "$knowitall" in
4653 echo " You'd better start hunting for one and let me know about it." >&4
4659 case "$gccversion" in
4660 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4662 case "$gccversion" in
4663 '') gccosandvers='' ;;
4664 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4665 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4667 case "$gccosandvers" in
4668 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4669 $osname$osvers) ;; # looking good
4670 $osname*) cat <<EOM >&4
4672 *** WHOA THERE!!! ***
4674 Your gcc has not been compiled for the exact release of
4675 your operating system ($gccosandvers versus $osname$osvers).
4677 In general it is a good idea to keep gcc synchronized with
4678 the operating system because otherwise serious problems
4679 may ensue when trying to compile software, like Perl.
4681 I'm trying to be optimistic here, though, and will continue.
4682 If later during the configuration and build icky compilation
4683 problems appear (headerfile conflicts being the most common
4684 manifestation), I suggest reinstalling the gcc to match
4685 your operating system release.
4689 *) gccosandvers='' ;; # failed to parse, better be silent
4697 # gcc 3.* complain about adding -Idirectories that they already know about,
4698 # so we will take those off from locincpth.
4699 case "$gccversion" in
4701 echo "main(){}">try.c
4702 for incdir in $locincpth; do
4703 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4704 grep '^c[cp]p*[01]: warning: changing search order '`
4705 if test "X$warn" != X; then
4706 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4712 # gcc 4.9 by default does some optimizations that break perl.
4713 # see ticket 121505.
4715 # The -fwrapv disables those optimizations (and probably others,) so
4716 # for gcc 4.9 (and later, since the optimizations probably won't go
4717 # away), add -fwrapv unless the user requests -fno-wrapv, which
4718 # disables -fwrapv, or if the user requests -fsanitize=undefined,
4719 # which turns the overflows -fwrapv ignores into runtime errors.
4720 case "$gccversion" in
4721 4.[3-9].*|4.[1-9][0-9]*|[5-9].*|[1-9][0-9]*)
4723 *-fno-wrapv*|*-fsanitize=undefined*|*-fwrapv*) ;;
4724 *) ccflags="$ccflags -fwrapv" ;;
4728 : What should the include directory be ?
4729 : Use sysroot if set, so findhdr looks in the right place.
4731 $echo $n "Hmm... $c"
4732 dflt="$sysroot/usr/include"
4735 if $test -f /bin/mips && /bin/mips; then
4736 echo "Looks like a MIPS system..."
4737 $cat >usr.c <<'EOCP'
4738 #ifdef SYSTYPE_BSD43
4742 if $cc $cppflags -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4743 dflt='/bsd43/usr/include'
4747 mips_type='System V'
4749 $rm -f usr.c usr.out
4750 echo "and you're compiling with the $mips_type compiler and libraries."
4754 echo "Doesn't look like a MIPS system."
4764 case "$xxx_prompt" in
4767 rp='Where are the include files you want to use?'
4775 : see how we invoke the C preprocessor
4777 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4778 cat <<'EOT' >testcpp.c
4784 if test ! -f cppstdin; then
4785 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4786 # AIX cc -E doesn't show the absolute headerfile
4787 # locations but we'll cheat by using the -M flag.
4788 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
4790 echo 'cat >.$$.c; '"$cc $cppflags"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4793 echo "Keeping your $hint cppstdin wrapper."
4796 wrapper=`pwd`/cppstdin
4800 if $test "X$cppstdin" != "X" && \
4801 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4802 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4804 echo "You used to use $cppstdin $cppminus so we'll use that again."
4806 '') echo "But let's see if we can live without a wrapper..." ;;
4808 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4809 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4811 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4814 echo "(However, $cpprun $cpplast does not work, let's see...)"
4822 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4829 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4830 $cc -E <testcpp.c >testcpp.out 2>&1; \
4831 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4832 echo "Yup, it does."
4833 x_cpp="$cc $cppflags -E"
4835 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4836 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4837 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4838 echo "Yup, it does."
4839 x_cpp="$cc $cppflags -E"
4841 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4842 $cc -P <testcpp.c >testcpp.out 2>&1; \
4843 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4844 echo "Yipee, that works!"
4845 x_cpp="$cc $cppflags -P"
4847 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4848 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4849 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4850 echo "At long last!"
4851 x_cpp="$cc $cppflags -P"
4853 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4854 $cpp <testcpp.c >testcpp.out 2>&1; \
4855 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4857 x_cpp="$cpp $cppflags"
4859 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4860 $cpp - <testcpp.c >testcpp.out 2>&1; \
4861 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4862 echo "Hooray, it works! I was beginning to wonder."
4863 x_cpp="$cpp $cppflags"
4865 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4866 $wrapper <testcpp.c >testcpp.out 2>&1; \
4867 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4873 rp="No dice. I can't find a C preprocessor. Name one:"
4877 $x_cpp <testcpp.c >testcpp.out 2>&1
4878 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4879 echo "OK, that will do." >&4
4881 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4896 echo "Perhaps can we force $cc -E using a wrapper..."
4897 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4898 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4904 echo "Nope, we'll have to live without it..."
4918 "$wrapper"|'cppstdin') ;;
4919 *) $rm -f $wrapper;;
4921 $rm -f testcpp.c testcpp.out
4923 : Adjust cppfilter for path component separator
4925 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
4926 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
4930 : Use gcc to determine libpth and incpth
4931 # If using gcc or clang, we can get better values for libpth, incpth
4932 # and usrinc directly from the compiler.
4933 # Note that ccname for clang is also gcc.
4936 $echo 'extern int foo;' > try.c
4937 set X `$cppstdin -v try.c 2>&1 | $awk '/^#include </,/^End of search /'|$cppfilter $grep '/include'`
4939 if $test $# -gt 0; then
4941 incpth="`$echo $incpth|$sed 's/^ //'`"
4943 j="`$echo $i|$sed 's,/include$,/lib,'`"
4944 if $test -d $j; then
4948 libpth="`$echo $libpth|$sed 's/^ //'`"
4949 for xxx in $libpth $loclibpth $plibpth $glibpth; do
4950 if $test -d $xxx; then
4953 *) libpth="$libpth $xxx";;
4960 '') for i in $incpth; do
4961 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
4969 case "$usecrosscompile" in
4972 '') echo "Incpth not defined." >&4; croak=y ;;
4973 *) echo "Using incpth '$incpth'." >&4 ;;
4976 '') echo "Libpth not defined." >&4; croak=y ;;
4977 *) echo "Using libpth '$libpth'." >&4 ;;
4980 '') echo "Usrinc not defined." >&4; croak=y ;;
4981 *) echo "Using usrinc $usrinc." >&4 ;;
4985 if test "X$sysroot" = X; then
4986 echo "Cannot continue, aborting." >&4; exit 1
4988 echo "Cross-compiling using sysroot $sysroot, failing to guess inc/lib paths is not fatal" >&4
4997 : Default value for incpth is just usrinc
4999 '') incpth="$usrinc";;
5002 : Set private lib path
5005 plibpth="$incpath/usr/lib $sysroot/usr/local/lib $sysroot/usr/ccs/lib"
5010 '') dlist="$loclibpth $plibpth $glibpth";;
5011 *) dlist="$libpth";;
5014 : Now check and see which directories actually exist, avoiding duplicates
5017 if $test -d $xxx; then
5020 *) libpth="$libpth $xxx";;
5026 Some systems have incompatible or broken versions of libraries. Among
5027 the directories listed in the question below, please remove any you
5028 know not to be holding relevant libraries, and add any that are needed.
5029 Say "none" for none.
5033 if test "X$sysroot" != X; then
5035 You have set sysroot to $sysroot, please supply the directories excluding sysroot
5048 rp="Directories to use for library searches?"
5055 : compute shared library extension
5058 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
5068 On some systems, shared libraries may be available. Answer 'none' if
5069 you want to suppress searching of shared libraries for the remainder
5070 of this configuration.
5073 rp='What is the file extension used for shared libraries?'
5077 : Does target system insist that shared library basenames are unique
5080 Some dynamic loaders assume that the *basename* of shared library filenames
5081 are globally unique. We'll default this to undef as we assume your system
5082 is not this weird. Set to defined if you're on one of them.
5087 rp='Make shared library basenames unique?'
5090 y|Y) val="$define" ;;
5093 set d_libname_unique
5096 : Define several unixisms.
5097 : Hints files or command line option can be used to override them.
5098 : The convoluted testing is in case hints files set either the old
5101 '') case "$exe_ext" in
5103 *) _exe="$exe_ext" ;;
5108 '') case "$lib_ext" in
5115 '') case "$obj_ext" in
5122 '') case "$path_sep" in
5133 rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
5135 : Which makefile gets called first. This is used by make depend.
5136 case "$firstmakefile" in
5137 '') firstmakefile='makefile';;
5140 : Check is we will use socks
5142 $define|true|[yY]*) dflt='y';;
5147 Perl can be built to use the SOCKS proxy protocol library. To do so,
5148 Configure must be run with -Dusesocks. If you use SOCKS you also need
5149 to use the PerlIO abstraction layer, this will be implicitly selected.
5151 If this doesn't make any sense to you, just accept the default '$dflt'.
5153 rp='Build Perl for SOCKS?'
5156 y|Y) val="$define" ;;
5162 : Check for uselongdouble support
5164 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
5167 case "$uselongdouble" in
5168 $define|true|[yY]*) dflt='y';;
5173 Perl can be built to take advantage of long doubles which
5174 (if available) may give more accuracy and range for floating point numbers.
5176 If this doesn't make any sense to you, just accept the default '$dflt'.
5178 rp='Try to use long doubles if available?'
5181 y|Y) val="$define" ;;
5187 case "$uselongdouble" in
5188 true|[yY]*) uselongdouble="$define" ;;
5191 : Look for a hint-file generated 'call-back-unit'. If the
5192 : user has specified that long doubles should be used,
5193 : we may need to set or change some other defaults.
5194 if $test -f uselongdouble.cbu; then
5195 echo "Your platform has some specific hints regarding long doubles, using them..."
5196 . ./uselongdouble.cbu
5198 case "$uselongdouble" in
5201 (Your platform does not have any specific hints for long doubles.)
5207 : Check if quadmath is requested
5208 case "$usequadmath" in
5209 "$define"|true|[yY]*) usequadmath="$define" ;;
5210 *) usequadmath="$undef" ;;
5213 : Looking for optional libraries
5215 echo "Checking for optional libraries..." >&4
5220 case "$libswanted" in
5221 '') libswanted='c_s';;
5224 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
5226 case "$usecbacktrace" in
5227 "$define") libswanted="$libswanted bfd" ;;
5229 case "$usequadmath" in
5230 "$define") libswanted="$libswanted quadmath" ;;
5236 for thisdir in $libpth $xlibpth; do
5237 test -d $thisdir && libspath="$libspath $thisdir"
5239 for thislib in $libswanted; do
5240 for thisdir in $libspath; do
5242 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
5243 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
5244 $test -f "$xxx" && eval $libscheck
5245 $test -f "$xxx" && libstyle=shared
5246 xxx=`ls $thisdir/lib$thislib.[0-9].$so 2>/dev/null|sed -n '$p'`
5247 $test -f "$xxx" && eval $libscheck
5248 $test -f "$xxx" && libstyle=shared
5250 if test ! -f "$xxx"; then
5251 xxx=$thisdir/lib$thislib.$so
5252 $test -f "$xxx" && eval $libscheck
5253 $test -f "$xxx" && libstyle=shared
5255 if test ! -f "$xxx"; then
5256 xxx=$thisdir/lib$thislib$_a
5257 $test -f "$xxx" && eval $libscheck
5258 $test -f "$xxx" && libstyle=static
5260 if test ! -f "$xxx"; then
5261 xxx=$thisdir/$thislib$_a
5262 $test -f "$xxx" && eval $libscheck
5263 $test -f "$xxx" && libstyle=static
5265 if test ! -f "$xxx"; then
5266 xxx=$thisdir/lib${thislib}_s$_a
5267 $test -f "$xxx" && eval $libscheck
5268 $test -f "$xxx" && libstyle=static
5269 $test -f "$xxx" && thislib=${thislib}_s
5271 if test ! -f "$xxx"; then
5272 xxx=$thisdir/Slib$thislib$_a
5273 $test -f "$xxx" && eval $libscheck
5274 $test -f "$xxx" && libstyle=static
5276 if $test -f "$xxx"; then
5278 shared) echo "Found -l$thislib (shared)." ;;
5279 static) echo "Found -l$thislib." ;;
5280 *) echo "Found -l$thislib ($libstyle)." ;;
5284 *) dflt="$dflt -l$thislib"
5285 libsfound="$libsfound $xxx"
5287 libsfiles="$libsfiles $yyy"
5288 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
5289 case " $libsdirs " in
5291 *) libsdirs="$libsdirs $yyy" ;;
5298 if $test ! -f "$xxx"; then
5299 echo "No -l$thislib."
5310 ' '|'') dflt='none';;
5315 In order to compile $package on your machine, a number of libraries
5316 are usually needed. Include any other special libraries here as well.
5317 Say "none" for none. The default list is almost always right.
5321 rp="What libraries to use?"
5328 : determine optimization, if desired, or use for debug flag also
5330 ' '|$undef) dflt='none';;
5332 *) dflt="$optimize";;
5336 By default, $package compiles with the -O flag to use the optimizer.
5337 Alternately, you might want to use the symbolic debugger, which uses
5338 the -g flag (on traditional Unix systems). Either flag can be
5339 specified here. To use neither flag, specify the word "none".
5342 rp="What optimizer/debugger flag should be used?"
5346 'none') optimize=" ";;
5349 : Check what DEBUGGING is required from the command line
5350 : -DEBUGGING or -DDEBUGGING or
5351 : -DEBUGGING=both = -g + -DDEBUGGING
5352 : -DEBUGGING=-g or -Doptimize=-g = -g
5353 : -DEBUGGING=none or -UDEBUGGING =
5354 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
5357 *) DEBUGGING=$EBUGGING ;;
5360 case "$DEBUGGING" in
5364 *) optimize="$optimize -g" ;;
5368 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
5376 case "$DEBUGGING" in
5377 both|$define) dflt='-DDEBUGGING'
5380 : argument order is deliberate, as the flag will start with - which set could
5381 : think is an option
5382 checkccflag='check=$1; flag=$2; callback=$3;
5384 echo "Checking if your compiler accepts $flag" 2>&1;
5385 [ "X$sysroot" != "X" ] && echo "For sysroot = $sysroot";
5386 echo "int main(void) { return 0; }" > gcctest.c;
5387 if $cc $_sysroot -O2 $flag -o gcctest gcctest.c 2>gcctest.out && $run ./gcctest; then
5388 echo "Yes, it does." 2>&1;
5389 if $test -s gcctest.out ; then
5390 echo "But your platform does not like it:";
5395 echo "Leaving current flags $ccflags alone." 2>&1
5397 *) dflt="$dflt $flag";
5403 echo "Nope, it does not, but that is ok." 2>&1;
5407 : We will not override a previous value, but we might want to
5408 : augment a hint file
5410 default|recommended)
5411 case "$gccversion" in
5412 1*) dflt="$dflt -fpcc-struct-return" ;;
5414 case "$optimize:$DEBUGGING" in
5415 *-g*:old) dflt="$dflt -DDEBUGGING";;
5417 case "$gccversion" in
5418 2*) if $test -d /etc/conf/kconfig.d &&
5419 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
5421 # Interactive Systems (ISC) POSIX mode.
5426 case "$gccversion" in
5429 ?*) set strict-aliasing -fno-strict-aliasing
5433 # For gcc, adding -pipe speeds up compilations for some, but apparently
5434 # some assemblers can't read from stdin. (It also slows down compilations
5435 # in other cases, but those are apparently rarer these days.) AD 5/2004.
5436 case "$gccversion" in
5442 # on x86_64 (at least) we require an extra library (libssp) in the
5443 # link command line. This library is not named, so I infer that it is
5444 # an implementation detail that may change. Hence the safest approach
5445 # is to add the flag to the flags passed to the compiler at link time,
5446 # as that way the compiler can do the right implementation dependant
5448 case "$gccversion" in
5449 ?*) set stack-protector-strong -fstack-protector-strong
5452 *-fstack-protector-strong*) ;; # It got added.
5453 *) # Try the plain/older -fstack-protector.
5454 set stack-protector -fstack-protector
5463 case "$mips_type" in
5464 *BSD*|'') inclwanted="$locincpth $usrinc";;
5465 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
5467 for thisincl in $inclwanted; do
5468 if $test -d $thisincl; then
5469 if $test x$thisincl != x$usrinc; then
5471 *" -I$thisincl "*);;
5472 *) dflt="$dflt -I$thisincl ";;
5478 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
5480 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5488 *) dflt="$dflt -D$2";;
5492 set signal.h LANGUAGE_C; eval $inctest
5496 ccflags="$ccflags -DSOCKS"
5501 default|recommended) dflt="$ccflags $dflt" ;;
5502 *) dflt="$ccflags";;
5511 Your C compiler may want other flags. For this question you should include
5512 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5513 but you should NOT include libraries or ld flags like -lwhatever. If you
5514 want $package to honor its debug switch, you should include -DDEBUGGING here.
5515 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5517 To use no flags, specify the word "none".
5523 rp="Any additional cc flags?"
5530 : the following weeds options from ccflags that are of no interest to cpp
5532 '') cppflags="$ccflags" ;;
5533 *) cppflags="$cppflags $ccflags" ;;
5535 case "$gccversion" in
5536 1*) cppflags="$cppflags -D__GNUC__"
5538 case "$mips_type" in
5540 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5546 echo "Let me guess what the preprocessor flags are..." >&4
5560 *) ftry="$previous $flag";;
5562 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5563 >cpp1.out 2>/dev/null && \
5564 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5565 >cpp2.out 2>/dev/null && \
5566 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5567 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5569 cppflags="$cppflags $ftry"
5579 *-*) echo "They appear to be: $cppflags";;
5581 $rm -f cpp.c cpp?.out
5585 : flags used in final linking phase
5587 '') if ./venix; then
5593 *-posix*) dflt="$dflt -posix" ;;
5596 *) dflt="$ldflags";;
5598 # See note above about -fstack-protector
5600 *-fstack-protector-strong*)
5602 *-fstack-protector-strong*) ;; # Don't add it again
5603 *) dflt="$dflt -fstack-protector-strong" ;;
5606 *-fstack-protector*)
5608 *-fstack-protector*) ;; # Don't add it again
5609 *) dflt="$dflt -fstack-protector" ;;
5614 : Try to guess additional flags to pick up local libraries.
5615 for thislibdir in $libpth; do
5616 case " $loclibpth " in
5619 *"-L$thislibdir "*) ;;
5620 *) dflt="$dflt -L$thislibdir" ;;
5632 Your C linker may need flags. For this question you should
5633 include -L/whatever and any other flags used by the C linker, but you
5634 should NOT include libraries like -lwhatever.
5636 Make sure you include the appropriate -L/path flags if your C linker
5637 does not normally search all of the directories you specified above,
5640 To use no flags, specify the word "none".
5644 rp="Any additional ld flags (NOT including libraries)?"
5650 rmlist="$rmlist pdp11"
5654 echo "Checking your choice of C compiler and flags for coherency..." >&4
5655 $cat > try.c <<'EOF'
5657 int main() { printf("Ok\n"); return(0); }
5659 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5661 $cat >try.msg <<'EOM'
5662 I've tried to compile and run the following simple program:
5665 $cat try.c >> try.msg
5667 $cat >> try.msg <<EOM
5674 and I got the following output:
5678 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5679 if $sh -c "$run ./try " >>try.msg 2>&1; then
5683 *) echo 'The program compiled OK, but produced no output.' >> try.msg ;;
5686 echo "The program compiled OK, but exited with status $?." >>try.msg
5687 rp="You have a problem. Shall I abort Configure"
5691 echo "I can't compile the test program." >>try.msg
5692 rp="You have a BIG problem. Shall I abort Configure"
5698 case "$knowitall" in
5700 echo "(The supplied flags or libraries might be incorrect.)"
5708 *) echo "Ok. Stopping Configure." >&4
5713 n) echo "OK, that should do.";;
5715 $rm_try gcctest gcctest.out
5717 : define a shorthand compile call
5721 case "$usedevel" in $define|true|[yY]*) if $test ! -f "${mc_file}.c"; then
5722 echo "Internal Configure script bug - compiler test file ${mc_file}.c is missing. Please report this to perlbug@perl.org" >&4;
5726 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5727 : define a shorthand compile call for compilations that should be ok.
5731 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5733 : determine filename position in cpp output
5735 echo "Computing filename position in cpp output for #include directives..." >&4
5737 vos) testaccess=-e ;;
5740 echo '#include <stdio.h>' > foo.c
5743 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5744 $grep '^[ ]*#.*stdio\.h' | \
5745 while read cline; do
5748 while $test \$# -gt 0; do
5749 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5754 pos=\`expr \$pos + 1\`
5766 *) pos="${fieldn}th";;
5768 echo "Your cpp writes the filename in the $pos field of the line."
5770 : locate header file
5775 for usrincdir in $incpth
5777 if test -f \$usrincdir/\$wanted; then
5778 echo "\$usrincdir/\$wanted"
5782 awkprg='{ print \$$fieldn }'
5783 echo "#include <\$wanted>" > foo\$\$.c
5784 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5785 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5786 while read cline; do
5787 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5789 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5790 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5795 # status = 0: grep returned 0 lines, case statement not executed
5796 # status = 1: headerfile found
5797 # status = 2: while loop executed, no headerfile found
5801 if test \$status -eq 1; then
5808 : define an alternate in-header-list? function
5809 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5810 cont=true; xxf="echo \"<\$1> found.\" >&4";
5811 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5812 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5814 case $# in 4) instead=instead;; *) instead="at last";; esac;
5815 while $test "$cont"; do
5817 var=$2; eval "was=\$$2";
5818 if $test "$xxx" && $test -r "$xxx";
5820 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5823 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5824 set $yyy; shift; shift; yyy=$@;
5825 case $# in 0) cont="";;
5826 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5827 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5828 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5829 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5833 do set $yyy; var=$2; eval "was=\$$2";
5834 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5835 set $yyy; shift; shift; yyy=$@;
5838 : see if stdlib is available
5839 set stdlib.h i_stdlib
5842 : check for lengths of integral types
5846 echo "Checking to see how big your integers are..." >&4
5855 printf("intsize=%d;\n", (int)sizeof(int));
5856 printf("longsize=%d;\n", (int)sizeof(long));
5857 printf("shortsize=%d;\n", (int)sizeof(short));
5862 if eval $compile_ok && $run ./try > /dev/null; then
5864 echo "Your integers are $intsize bytes long."
5865 echo "Your long integers are $longsize bytes long."
5866 echo "Your short integers are $shortsize bytes long."
5870 Help! I can't compile and run the intsize test program: please enlighten me!
5871 (This is probably a misconfiguration in your system or libraries, and
5872 you really ought to fix it. Still, I'll try anyway.)
5876 rp="What is the size of an integer (in bytes)?"
5880 rp="What is the size of a long integer (in bytes)?"
5884 rp="What is the size of a short integer (in bytes)?"
5892 : check for long long
5894 echo "Checking to see if you have long long..." >&4
5895 echo 'int main() { long long x = 7; return 0; }' > try.c
5897 if eval $compile; then
5899 echo "You have long long."
5902 echo "You do not have long long."
5908 : check for length of long long
5909 case "${d_longlong}${longlongsize}" in
5912 echo "Checking to see how big your long longs are..." >&4
5913 $cat >try.c <<'EOCP'
5917 printf("%d\n", (int)sizeof(long long));
5922 if eval $compile_ok; then
5923 longlongsize=`$run ./try`
5924 echo "Your long longs are $longlongsize bytes long."
5928 echo "(I can't seem to compile the test program. Guessing...)"
5929 rp="What is the size of a long long (in bytes)?"
5933 if $test "X$longsize" = "X$longlongsize"; then
5934 echo "(That isn't any different from an ordinary long.)"
5940 : see if inttypes.h is available
5941 : we want a real compile instead of Inhdr because some systems
5942 : have an inttypes.h which includes non-existent headers
5945 #include <inttypes.h>
5947 static int32_t foo32 = 0x12345678;
5951 if eval $compile; then
5952 echo "<inttypes.h> found." >&4
5955 echo "<inttypes.h> NOT found." >&4
5964 echo "Checking to see if you have int64_t..." >&4
5966 #include <sys/types.h>
5967 #$i_inttypes I_INTTYPES
5969 #include <inttypes.h>
5971 int main() { int64_t x = 7; }
5974 if eval $compile; then
5976 echo "You have int64_t."
5979 echo "You do not have int64_t."
5985 : Check if 64bit ints have a quad type
5987 echo "Checking which 64-bit integer type we could use..." >&4
5993 val='"unsigned int"'
5998 *) case "$longsize" in
6002 val='"unsigned long"'
6007 *) case "$d_longlong:$longlongsize" in
6012 val='"unsigned long long"'
6017 *) case "$d_int64_t" in
6036 '') echo "Alas, no 64-bit integer types in sight." >&4
6039 *) echo "We could use '$quadtype' for 64-bit integers." >&4
6044 : Do we want 64bit support
6045 case "$uselonglong" in
6046 "$define"|true|[yY]*)
6049 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
6051 use64bitint="$define"
6054 case "$use64bits" in
6055 "$define"|true|[yY]*)
6058 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
6060 use64bitint="$define"
6063 case "$use64bitints" in
6064 "$define"|true|[yY]*)
6067 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
6069 use64bitint="$define"
6072 case "$use64bitsint" in
6073 "$define"|true|[yY]*)
6076 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
6078 use64bitint="$define"
6081 case "$uselonglongs" in
6082 "$define"|true|[yY]*)
6085 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
6087 use64bitint="$define"
6090 case "$use64bitsall" in
6091 "$define"|true|[yY]*)
6094 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
6096 use64bitall="$define"
6101 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
6103 case "$use64bitall" in
6104 "$define"|true|[yY]*) use64bitint="$define" ;;
6110 You have natively 64-bit long integers.
6114 *) case "$use64bitint" in
6115 "$define"|true|[yY]*) dflt='y';;
6124 Perl can be built to take advantage of 64-bit integer types
6125 on some systems. To do so, Configure can be run with -Duse64bitint.
6126 Choosing this option will most probably introduce binary incompatibilities.
6128 If this doesn't make any sense to you, just accept the default '$dflt'.
6129 (The default has been chosen based on your configuration.)
6131 rp='Try to use 64-bit integers, if available?'
6134 [yY]*) val="$define" ;;
6142 case "$use64bitall" in
6143 "$define"|true|[yY]*) dflt='y' ;;
6144 *) case "$longsize" in
6152 You may also choose to try maximal 64-bitness. It means using as much
6153 64-bitness as possible on the platform. This in turn means even more
6154 binary incompatibilities. On the other hand, your platform may not
6155 have any more 64-bitness available than what you already have chosen.
6157 If this doesn't make any sense to you, just accept the default '$dflt'.
6158 (The default has been chosen based on your configuration.)
6160 rp='Try to use maximal 64-bit support, if available?'
6163 [yY]*) val="$define" ;;
6168 case "$use64bitall" in
6170 case "$use64bitint" in
6174 Since you have chosen a maximally 64-bit build, I'm also turning on
6175 the use of 64-bit integers.
6177 use64bitint="$define" ;;
6182 : Look for a hint-file generated 'call-back-unit'. If the
6183 : user has specified that a 64-bit perl is to be built,
6184 : we may need to set or change some other defaults.
6185 if $test -f use64bitint.cbu; then
6186 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
6189 case "$use64bitint" in
6190 "$define"|true|[yY]*)
6191 : This test was common to all the OpenBSD forks, and seems harmless for
6194 echo "Checking if your C library has broken 64-bit functions..." >&4
6197 typedef $uquadtype myULL;
6204 {4294967303.15, 4294967303ULL},
6205 {4294967294.2, 4294967294ULL},
6206 {4294967295.7, 4294967295ULL},
6209 for (p = test; p->u; p++) {
6210 myULL x = (myULL)p->d;
6221 if eval $compile_ok; then
6222 libcquad=`$run ./try`
6223 echo "Your C library's 64-bit functions are $libcquad."
6225 echo "(I can't seem to compile the test program.)"
6226 echo "Assuming that your C library's 64-bit functions are ok."
6235 *** You have a C library with broken 64-bit functions.
6236 *** 64-bit support does not work reliably in this configuration.
6237 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
6238 *** Cannot continue, aborting.
6245 4) case "$archname64" in
6246 '') archname64=64int ;;
6253 : Look for a hint-file generated 'call-back-unit'. If the
6254 : user has specified that a maximally 64-bit perl is to be built,
6255 : we may need to set or change some other defaults.
6256 if $test -f use64bitall.cbu; then
6257 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
6260 case "$use64bitall" in
6261 "$define"|true|[yY]*)
6263 4) case "$archname64" in
6264 ''|64int) archname64=64all ;;
6271 case "$d_quad:$use64bitint" in
6275 *** You have chosen to use 64-bit integers,
6276 *** but none can be found.
6277 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
6278 *** Cannot continue, aborting.
6285 : Check if we are using the GNU C library
6287 echo "Checking for GNU C Library..." >&4
6289 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
6290 alone are insufficient to distinguish different versions, such as
6291 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
6292 libc version 2.1.0. A. Dougherty, June 3, 2002.
6298 # ifdef __GLIBC_MINOR__
6299 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
6300 # include <gnu/libc-version.h>
6301 printf("%s\n", gnu_get_libc_version());
6303 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
6306 printf("%d\n", __GLIBC__);
6315 if eval $compile_ok && $run ./try > glibc.ver; then
6317 gnulibc_version=`$cat glibc.ver`
6318 echo "You are using the GNU C Library version $gnulibc_version"
6322 echo "You are not using the GNU C Library"
6328 : see if nm is to be used to determine whether a symbol is defined or not
6332 case "$d_gnulibc" in
6335 echo "nm probably won't work on the GNU C Library." >&4
6341 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
6343 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
6344 echo "'nm' won't be sufficient on this system." >&4
6350 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
6351 if $test $dflt -gt 20; then
6361 true|$define) dflt=y;;
6368 I can use $nm to extract the symbols from your C libraries. This
6369 is a time consuming task which may generate huge output on the disk (up
6370 to 3 megabytes) but that should make the symbols extraction faster. The
6371 alternative is to skip the 'nm' extraction part and to compile a small
6372 test program instead to determine whether each symbol is present. If
6373 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
6374 this may be the best solution.
6376 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
6379 rp="Shall I use $nm to extract C symbols from the libraries?"
6382 [Nn]*) usenm=false;;
6391 : nm options which may be necessary
6393 '') if $test -f /mach_boot; then
6395 elif $test -d /usr/ccs/lib; then
6396 nm_opt='-p' # Solaris (and SunOS?)
6397 elif $test -f /dgux; then
6399 elif $test -f /lib64/rld; then
6400 nm_opt='-p' # 64-bit Irix
6406 : nm options which may be necessary for shared libraries but illegal
6407 : for archive libraries. Thank you, Linux.
6408 case "$nm_so_opt" in
6409 '') case "$myuname" in
6411 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
6412 nm_so_opt='--dynamic'
6419 : Figure out where the libc is located
6422 : get list of predefined functions in a handy place
6427 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
6433 *) for thislib in $libs; do
6436 : Handle C library specially below.
6439 thislib=`echo $thislib | $sed -e 's/^-l//'`
6440 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
6442 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
6444 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
6446 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
6448 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
6450 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
6452 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
6457 libnames="$libnames $try"
6459 *) libnames="$libnames $thislib" ;;
6468 for xxx in $libpth; do
6469 $test -r $1 || set $xxx/libc.$so
6470 : The messy sed command sorts on library version numbers.
6472 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
6473 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
6475 s/[0-9][0-9]*/0000&/g
6476 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
6479 $sort | $sed -e 's/^.* //'`
6482 $test -r $1 || set $sysroot/usr/ccs/lib/libc.$so
6483 $test -r $1 || set $sysroot/lib/libsys_s$_a
6489 if $test -r "$1"; then
6490 echo "Your (shared) C library seems to be in $1."
6492 elif $test -r /lib/libc && $test -r /lib/clib; then
6493 echo "Your C library seems to be in both /lib/clib and /lib/libc."
6495 libc='/lib/clib /lib/libc'
6496 if $test -r /lib/syslib; then
6497 echo "(Your math library is in /lib/syslib.)"
6498 libc="$libc /lib/syslib"
6500 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
6501 echo "Your C library seems to be in $libc, as you said before."
6502 elif $test -r $incpath/usr/lib/libc$_a; then
6503 libc=$incpath/usr/lib/libc$_a;
6504 echo "Your C library seems to be in $libc. That's fine."
6505 elif $test -r /lib/libc$_a; then
6507 echo "Your C library seems to be in $libc. You're normal."
6509 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
6511 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
6512 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
6513 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
6515 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
6517 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
6520 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
6522 if $test -r "$tans"; then
6523 echo "Your C library seems to be in $tans, of all places."
6529 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
6533 If the guess above is wrong (which it might be if you're using a strange
6534 compiler, or your machine supports multiple models), you can override it here.
6539 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
6541 I can't seem to find your C library. I've looked in the following places:
6544 $sed 's/^/ /' libpath
6547 None of these seems to contain your C library. I need to get its name...
6552 rp='Where is your C library?'
6557 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
6558 set X `cat libnames`
6561 case $# in 1) xxx=file; esac
6562 echo "Extracting names from the following $xxx for later perusal:" >&4
6564 $sed 's/^/ /' libnames >&4
6566 $echo $n "This may take a while...$c" >&4
6570 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
6571 *) $nm $nm_opt $file 2>/dev/null;;
6576 $grep fprintf libc.tmp > libc.ptf
6577 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
6578 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
6580 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
6582 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6584 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
6586 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6588 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
6590 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6592 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
6594 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6596 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
6598 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6600 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
6602 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6604 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
6605 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
6607 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6609 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
6611 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6613 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
6615 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6617 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
6619 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6621 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
6623 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6625 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
6627 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6629 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
6631 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6633 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
6635 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6638 $nm -p $* 2>/dev/null >libc.tmp
6639 $grep fprintf libc.tmp > libc.ptf
6640 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
6641 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
6647 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
6649 if $ar t $libc > libc.tmp && \
6650 $contains '^fprintf$' libc.tmp >/dev/null 2>&1
6652 for thisname in $libnames $libc; do
6653 $ar t $thisname >>libc.tmp
6655 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
6657 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
6658 for thisname in $libnames $libc; do
6659 $ar tv $thisname >>libc.tmp
6660 emximp -o tmp.imp $thisname \
6662 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
6663 < tmp.imp >>libc.tmp
6666 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
6669 echo "$ar didn't seem to work right." >&4
6670 echo "Maybe this is a Cray...trying bld instead..." >&4
6672 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list &&
6675 for thisname in $libnames; do
6677 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
6678 $ar t $thisname >>libc.tmp
6682 echo "That didn't work either. Giving up." >&4
6692 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
6693 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
6695 *) if $test -f /lib/syscalls.exp; then
6697 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
6698 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' \
6699 /lib/syscalls.exp >>libc.list
6705 $rm -f libnames libpath
6707 : Check if we are using C++
6709 echo "Checking for C++..." >&4
6710 $cat >try.c <<'EOCP'
6722 if eval $compile_ok && $run ./try; then
6724 echo "You are using a C++ compiler."
6727 echo "You are not using a C++ compiler."
6733 : is a C symbol defined?
6736 -v) tf=libc.tmp; tdc="";;
6737 -a) tf=libc.tmp; tdc="[]";;
6738 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
6740 case "$d_cplusplus" in
6741 $define) extern_C="extern \"C\"" ;;
6742 *) extern_C="extern" ;;
6745 case "$reuseval-$4" in
6747 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
6752 if $test "$runnm" = true; then
6753 if $contains $tlook $tf >/dev/null 2>&1; then
6755 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
6756 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;
6757 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
6758 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
6762 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;
6763 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
6769 $define) tval=true;;
6776 : define an is-in-libc? function
6777 inlibc='echo " "; td=$define; tu=$undef;
6778 sym=$1; var=$2; eval "was=\$$2";
6780 case "$reuseval$was" in
6790 echo "$sym() found." >&4;
6791 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
6793 echo "$sym() NOT found." >&4;
6794 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
6798 $define) echo "$sym() found." >&4;;
6799 *) echo "$sym() NOT found." >&4;;
6803 : check for length of double
6805 case "$doublesize" in
6807 echo "Checking to see how big your double precision numbers are..." >&4
6816 printf("%d\n", (int)sizeof(double));
6821 if eval $compile_ok; then
6822 doublesize=`$run ./try`
6823 echo "Your double is $doublesize bytes long."
6826 echo "(I can't seem to compile the test program. Guessing...)"
6827 rp="What is the size of a double precision number (in bytes)?"
6835 : see if this is a float.h system
6839 : check for long doubles
6841 echo "Checking to see if you have long double..." >&4
6842 echo 'int main() { long double x = 7.0; }' > try.c
6844 if eval $compile; then
6846 echo "You have long double."
6849 echo "You do not have long double."
6855 : see if ldexpl exists
6859 : check for length of long double
6860 case "${d_longdbl}${longdblsize}" in
6863 echo "Checking to see how big your long doubles are..." >&4
6864 $cat >try.c <<'EOCP'
6868 printf("%d\n", sizeof(long double));
6873 if eval $compile; then
6874 longdblsize=`$run ./try`
6875 echo "Your long doubles are $longdblsize bytes long."
6879 echo "(I can't seem to compile the test program. Guessing...)" >&4
6880 rp="What is the size of a long double (in bytes)?"
6884 if $test "X$doublesize" = "X$longdblsize"; then
6885 echo "That isn't any different from an ordinary double."
6886 echo "I'll keep your setting anyway, but you may see some"
6887 echo "harmless compilation warnings."
6893 $echo "Checking the kind of long doubles you have..." >&4
6894 case "$d_longdbl" in
6899 #define LONGDBLSIZE $longdblsize
6900 #define DOUBLESIZE $doublesize
6908 static const long double d = -0.1L;
6910 unsigned const char* b = (unsigned const char*)(&d);
6911 #if DOUBLESIZE == LONGDBLSIZE
6912 printf("0\n"); /* if it floats like double */
6915 #if (LDBL_MANT_DIG == 113 || FLT128_MANT_DIG == 113) && LONGDBLSIZE == 16
6916 if (b[0] == 0x9A && b[1] == 0x99 && b[15] == 0xBF) {
6917 /* IEEE 754 128-bit little-endian */
6921 if (b[0] == 0xBF && b[14] == 0x99 && b[15] == 0x9A) {
6922 /* IEEE 128-bit big-endian, e.g. solaris sparc */
6927 /* For alignment 32-bit platforms have the 80 bits in 12 bytes,
6928 * while 64-bits platforms have it in 16 bytes. */
6929 #if LDBL_MANT_DIG == 64 && (LONGDBLSIZE == 16 || LONGDBLSIZE == 12)
6930 if (b[0] == 0xCD && b[9] == 0xBF && b[10] == 0x00) {
6931 /* x86 80-bit little-endian, sizeof 12 (ILP32, Solaris x86)
6932 * or 16 (LP64, Linux and OS X), 4 or 6 bytes of padding.
6933 * Also known as "extended precision". */
6937 if (b[0] == 0xBF && b[9] == 0xCD && b[10] == 0x00) {
6938 /* is there ever big-endian 80-bit, really? */
6943 #if (LDBL_MANT_DIG == 106 || LDBL_MANT_DIG == 107) && LONGDBLSIZE == 16
6944 /* software "double double", the 106 is 53+53.
6945 * but irix thinks it is 107. */
6946 if (b[0] == 0x9A && b[7] == 0x3C && b[8] == 0x9A && b[15] == 0xBF) {
6947 /* double double 128-bit little-endian,
6948 * 9a 99 99 99 99 99 59 3c 9a 99 99 99 99 99 b9 bf */
6952 if (b[0] == 0xBF && b[7] == 0x9A && b[8] == 0x3C && b[15] == 0x9A) {
6953 /* double double 128-bit big-endian, e.g. PPC/Power and MIPS:
6954 * bf b9 99 99 99 99 99 9a 3c 59 99 99 99 99 99 9a */
6959 printf("-1\n"); /* unknown */
6964 if eval $compile; then
6965 longdblkind=`$run ./try`
6972 case "$longdblkind" in
6973 0) echo "Your long doubles are doubles." >&4 ;;
6974 1) echo "You have IEEE 754 128-bit little endian long doubles." >&4 ;;
6975 2) echo "You have IEEE 754 128-bit big endian long doubles." >&4 ;;
6976 3) echo "You have x86 80-bit little endian long doubles." >& 4 ;;
6977 4) echo "You have x86 80-bit big endian long doubles." >& 4 ;;
6978 5) echo "You have 128-bit little-endian double-double long doubles." >& 4 ;;
6979 6) echo "You have 128-bit big-endian double-double long doubles." >& 4 ;;
6980 *) echo "Cannot figure out your long double." >&4 ;;
6984 : determine the architecture name
6986 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
6987 tarch=`arch`"-$osname"
6988 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
6989 if uname -m > tmparch 2>&1 ; then
6990 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
6991 -e 's/$/'"-$osname/" tmparch`
6999 case "$myarchname" in
7002 echo "(Your architecture name used to be $myarchname.)"
7006 case "$targetarch" in
7008 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
7013 *) dflt="$archname";;
7015 rp='What is your architecture name'
7019 : optionally add API version to the architecture for versioned archlibs
7020 case "$useversionedarchname" in
7021 $define|true|[yY]*) dflt='y';;
7024 rp='Add the Perl API version to your archname?'
7027 y|Y) useversionedarchname="$define" ;;
7028 *) useversionedarchname="$undef" ;;
7030 case "$useversionedarchname" in
7033 *-$api_versionstring)
7034 echo "...and architecture name already has -$api_versionstring" >&4
7037 archname="$archname-$api_versionstring"
7038 echo "...setting architecture name to $archname." >&4
7044 case "$usethreads" in
7046 echo "Threads selected." >&4
7048 *-thread*) echo "...and architecture name already has -thread." >&4
7050 *) archname="$archname-thread"
7051 echo "...setting architecture name to $archname." >&4
7056 case "$usemultiplicity" in
7058 echo "Multiplicity selected." >&4
7060 *-multi*) echo "...and architecture name already has -multi." >&4
7062 *) archname="$archname-multi"
7063 echo "...setting architecture name to $archname." >&4
7068 case "$use64bitint$use64bitall" in
7070 case "$archname64" in
7072 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
7075 case "$use64bitint" in
7076 "$define") echo "64 bit integers selected." >&4 ;;
7078 case "$use64bitall" in
7079 "$define") echo "Maximal 64 bitness selected." >&4 ;;
7082 *-$archname64*) echo "...and architecture name already has $archname64." >&4
7084 *) archname="$archname-$archname64"
7085 echo "...setting architecture name to $archname." >&4
7091 case "$uselongdouble" in
7093 echo "Long doubles selected." >&4
7094 case "$longdblsize" in
7096 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
7100 *-ld*) echo "...and architecture name already has -ld." >&4
7102 *) archname="$archname-ld"
7103 echo "...setting architecture name to $archname." >&4
7110 case "$usequadmath" in
7112 echo "quadmath selected." >&4
7114 *-ld*) echo "...and architecture name already has -quadmath." >&4
7116 *) archname="$archname-quadmath"
7117 echo "...setting architecture name to $archname." >&4
7122 if $test -f archname.cbu; then
7123 echo "Your platform has some specific hints for architecture name, using them..."
7127 : set the prefixit variable, to compute a suitable default value
7128 prefixit='case "$3" in
7130 case "$oldprefix" in
7131 "") eval "$1=\"\$$2\"";;
7138 ""|" ") eval "$1=\"\$$2\"";;
7144 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
7146 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
7147 /*-$oldprefix/*|\~*-$oldprefix/*)
7148 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
7149 *) eval "$1=\"\$$2\"";;
7153 : determine installation style
7154 : For now, try to deduce it from prefix unless it is already set.
7155 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
7156 case "$installstyle" in
7157 '') case "$prefix" in
7158 *perl*) dflt='lib';;
7159 *) dflt='lib/perl5' ;;
7162 *) dflt="$installstyle" ;;
7164 : Probably not worth prompting for this since we prompt for all
7165 : the directories individually, and the prompt would be too long and
7169 : determine where public executables go
7174 rp='Pathname where the public executables will reside?'
7176 if $test "X$ansexp" != "X$binexp"; then
7180 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
7181 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
7182 : this via initialinstalllocation
7185 case "$userelocatableinc" in
7186 $define|true|[yY]*) dflt='y' ;;
7191 Would you like to build Perl so that the installation is relocatable, so that
7192 library paths in @INC are determined relative to the path of the perl binary?
7193 This is not advised for system Perl installs, or if you need to run setid
7194 scripts or scripts under taint mode.
7196 If this doesn't make any sense to you, just accept the default '$dflt'.
7198 rp='Use relocatable @INC?'
7201 y|Y) val="$define" ;;
7204 set userelocatableinc
7207 initialinstalllocation="$binexp"
7208 : Default prefix is now "up one level from where the binaries are"
7209 case "$userelocatableinc" in
7215 installprefixexp=".../.."
7219 : determine where private library files go
7220 : Usual default is /usr/local/lib/perl5/$version.
7221 : Also allow things like /opt/perl/lib/$version, since
7222 : /opt/perl/lib/perl5... would be redundant.
7223 : The default "style" setting is made in installstyle.U
7224 case "$installstyle" in
7225 *lib/perl5*) set dflt privlib lib/$package/$version ;;
7226 *) set dflt privlib lib/$version ;;
7231 There are some auxiliary files for $package that need to be put into a
7232 private library directory that is accessible by everyone.
7237 rp='Pathname where the private library files will reside?'
7242 : set the prefixup variable, to restore leading tilda escape
7243 prefixup='case "$prefixexp" in
7245 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
7248 : determine where public architecture dependent libraries go
7251 : privlib default is /usr/local/lib/$package/$version
7252 : archlib default is /usr/local/lib/$package/$version/$archname
7253 : privlib may have an optional trailing /share.
7254 tdflt=`echo $privlib | $sed 's,/share$,,'`
7255 tdflt=$tdflt/$archname
7264 $spackage contains architecture-dependent library files. If you are
7265 sharing libraries in a heterogeneous environment, you might store
7266 these files in a separate location. Otherwise, you can just include
7267 them with the rest of the public library files.
7272 rp='Where do you want to put the public architecture-dependent libraries?'
7276 if $test X"$archlib" = X"$privlib"; then
7282 : see if setuid scripts can be secure
7285 Some kernels have a bug that prevents setuid #! scripts from being
7286 secure. Some sites have disabled setuid #! scripts because of this.
7288 First let's decide if your kernel supports secure setuid #! scripts.
7289 (If setuid #! scripts would be secure but have been disabled anyway,
7290 don't say that they are secure if asked.)
7295 if $test -d /dev/fd; then
7296 echo "#!$ls" >reflect
7297 chmod +x,u+s reflect
7298 ./reflect >flect 2>&1
7299 if $contains "/dev/fd" flect >/dev/null; then
7300 echo "Congratulations, your kernel has secure setuid scripts!" >&4
7304 If you are not sure if they are secure, I can check but I'll need a
7305 username and password different from the one you are using right now.
7306 If you don't have such a username or don't want me to test, simply
7310 rp='Other username to test security of setuid scripts with?'
7315 case "$d_suidsafe" in
7316 '') echo "I'll assume setuid scripts are *not* secure." >&4
7319 echo "Well, the $hint value is *not* secure." >&4
7321 *) echo "Well, the $hint value *is* secure." >&4
7326 $rm -f reflect flect
7327 echo "#!$ls" >reflect
7328 chmod +x,u+s reflect
7331 echo '"su" will (probably) prompt you for '"$ans's password."
7332 su $ans -c './reflect >flect'
7333 if $contains "/dev/fd" flect >/dev/null; then
7334 echo "Okay, it looks like setuid scripts are secure." >&4
7337 echo "I don't think setuid scripts are secure." >&4
7342 rp='Does your kernel have *secure* setuid scripts?'
7345 [yY]*) val="$define";;
7350 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
7351 echo "(That's for file descriptors, not floppy disks.)"
7357 $rm -f reflect flect
7359 : now see if they want to do setuid emulation
7360 if $test $patchlevel -lt 11; then
7363 case "$d_suidsafe" in
7366 echo "No need to emulate SUID scripts since they are secure here." >&4
7370 Some systems have disabled setuid scripts, especially systems where
7371 setuid scripts cannot be secure. On systems where setuid scripts have
7372 been disabled, the setuid/setgid bits on scripts are currently
7373 useless. It is possible for $package to detect those bits and emulate
7374 setuid/setgid in a secure fashion. This emulation will only work if
7375 setuid scripts have been disabled in your kernel.
7379 "$define") dflt=y ;;
7382 rp="Do you want to do setuid/setgid emulation?"
7385 [yY]*) val="$define";;
7397 SUID emulation has been removed for 5.12
7398 Please re-run Configure without -Dd_dosuid
7407 : Find perl5.005 or later.
7408 echo "Looking for a previously installed perl5.005 or later... "
7410 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
7411 : Check if this perl is recent and can load a simple module
7412 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
7415 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
7425 '') echo "None found. That's ok.";;
7426 *) echo "Using $perl5." ;;
7429 : Set the siteprefix variables
7432 After $package is installed, you may wish to install various
7433 add-on modules and utilities. Typically, these add-ons will
7434 be installed under $prefix with the rest
7435 of this package. However, you may wish to install such add-ons
7436 elsewhere under a different prefix.
7438 If you do not wish to put everything under a single prefix, that's
7439 ok. You will be prompted for the individual locations; this siteprefix
7440 is only used to suggest the defaults.
7442 The default should be fine for most people.
7446 rp='Installation prefix to use for add-on modules and utilities?'
7447 : XXX Here might be another good place for an installstyle setting.
7448 case "$siteprefix" in
7450 *) dflt=$siteprefix ;;
7453 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
7455 case "$siteprefix" in
7459 *) oldsiteprefix="$prefix";;
7464 siteprefixexp="$ansexp"
7466 : determine where site specific libraries go.
7467 : Usual default is /usr/local/lib/perl5/site_perl/$version
7468 : The default "style" setting is made in installstyle.U
7469 : XXX No longer works with Prefixit stuff.
7470 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7472 '') case "$installstyle" in
7473 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
7474 *) dflt=$siteprefix/lib/site_$prog/$version ;;
7482 The installation process will create a directory for
7483 site-specific extensions and modules. Most users find it convenient
7484 to place all site-specific files in this directory rather than in the
7485 main distribution directory.
7489 rp='Pathname for the site-specific library files?'
7493 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
7495 : Determine list of previous versions to include in @INC
7496 $cat > getverlist <<EOPL
7499 \$api_versionstring = "$api_versionstring";
7500 \$version = "$version";
7501 \$stem = "$sitelib_stem";
7502 \$archname = "$archname";
7504 $cat >> getverlist <<'EOPL'
7505 # The list found is store twice for each entry: the original name, and
7506 # the binary broken down version as pack "sss", so sorting is easy and
7507 # unambiguous. This will work for all versions that have a maximum of
7508 # three digit groups, separate by '.'s or '_'s. Names are extended with
7509 # ".0.0" to ensure at least three elements for the pack.
7510 # -- H.Merijn Brand (m)'06 23-10-2006
7512 # Can't have leading @ because metaconfig interprets it as a command!
7513 ;@inc_version_list=();
7514 # XXX Redo to do opendir/readdir?
7517 ;@candidates = map {
7518 [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
7519 ;@candidates = sort { $a->[1] cmp $b->[1]} @candidates;
7525 ($pversion, $aversion, $vsn5005) = map {
7526 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
7527 foreach $d (@candidates) {
7528 if ($d->[1] lt $pversion) {
7529 if ($d->[1] ge $aversion) {
7530 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
7532 elsif ($d->[1] ge $vsn5005) {
7533 unshift(@inc_version_list, grep { -d } $d->[0]);
7537 # Skip newer version. I.e. don't look in
7538 # 5.7.0 if we're installing 5.6.1.
7542 if (@inc_version_list) {
7543 print join(' ', @inc_version_list);
7546 # Blank space to preserve value for next Configure run.
7551 case "$inc_version_list" in
7552 '') if test -x "$perl5$exe_ext"; then
7553 dflt=`$perl5 getverlist`
7558 $undef) dflt='none' ;;
7559 *) eval dflt=\"$inc_version_list\" ;;
7562 ''|' ') dflt=none ;;
7569 In order to ease the process of upgrading, this version of perl
7570 can be configured to use modules built and installed with earlier
7571 versions of perl that were installed under $prefix. Specify here
7572 the list of earlier versions that this version of perl should check.
7573 If Configure detected no earlier versions of perl installed under
7574 $prefix, then the list will be empty. Answer 'none' to tell perl
7575 to not search earlier versions.
7577 The default should almost always be sensible, so if you're not sure,
7578 just accept the default.
7581 rp='List of earlier versions to include in @INC?'
7584 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
7585 *) inc_version_list="$ans" ;;
7587 case "$inc_version_list" in
7589 inc_version_list_init='0'
7590 d_inc_version_list="$undef"
7592 *) inc_version_list_init=`echo $inc_version_list |
7593 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
7594 d_inc_version_list="$define"
7599 : see if malloc/malloc.h has to be included
7600 set malloc/malloc.h i_mallocmalloc
7603 : see if this is a malloc.h system
7604 : we want a real compile instead of Inhdr because some systems have a
7605 : malloc.h that just gives a compile error saying to use stdlib.h instead
7610 #$i_mallocmalloc I_MALLOCMALLOC
7611 #ifdef I_MALLOCMALLOC
7612 # include <malloc/malloc.h>
7615 int main () { return 0; }
7618 if eval $compile; then
7619 echo "<malloc.h> found." >&4
7622 echo "<malloc.h> NOT found." >&4
7629 : check for length of pointer
7633 echo "Checking to see how big your pointers are..." >&4
7642 printf("%d\n", (int)sizeof(void *));
7647 if eval $compile_ok; then
7648 ptrsize=`$run ./try`
7649 echo "Your pointers are $ptrsize bytes long."
7652 echo "(I can't seem to compile the test program. Guessing...)" >&4
7653 rp="What is the size of a pointer (in bytes)?"
7660 case "$use64bitall" in
7661 "$define"|true|[yY]*)
7665 *** You have chosen a maximally 64-bit build,
7666 *** but your pointers are only 4 bytes wide.
7667 *** Please rerun Configure without -Duse64bitall.
7672 *** Since you have quads, you could possibly try with -Duse64bitint.
7677 *** Cannot continue, aborting.
7688 : determine whether to use malloc wrapping
7690 case "$usemallocwrap" in
7691 [yY]*|true|$define) dflt='y' ;;
7692 [nN]*|false|$undef) dflt='n' ;;
7693 *) case "$usedevel" in
7694 [yY]*|true|$define) dflt='y' ;;
7699 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
7701 usemallocwrap="$ans"
7704 usemallocwrap="$define" ;;
7706 usemallocwrap="$undef" ;;
7709 : determine which malloc to compile in
7711 case "$usemymalloc" in
7712 [yY]*|true|$define) dflt='y' ;;
7713 [nN]*|false|$undef) dflt='n' ;;
7714 *) case "$ptrsize" in
7718 if test "$useithreads" = "$define"; then dflt='n'; fi
7721 rp="Do you wish to attempt to use the malloc that comes with $package?"
7727 mallocsrc='malloc.c'
7728 mallocobj="malloc$_o"
7729 d_mymalloc="$define"
7732 : Remove malloc from list of libraries to use
7733 echo "Removing unneeded -lmalloc from library list" >&4
7734 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
7737 echo "libs = $libs" >&4
7749 : compute the return types of malloc and free
7751 $cat >malloc.c <<END
7755 #include <sys/types.h>
7769 case "$malloctype" in
7771 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
7778 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
7782 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
7789 echo "Your system uses $freetype free(), it would seem." >&4
7791 : determine where site specific architecture-dependent libraries go.
7792 : sitelib default is /usr/local/lib/perl5/site_perl/$version
7793 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
7794 : sitelib may have an optional trailing /share.
7796 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
7797 dflt="$dflt/$archname"
7802 set sitearch sitearch none
7806 The installation process will also create a directory for
7807 architecture-dependent site-specific extensions and modules.
7811 rp='Pathname for the site-specific architecture-dependent library files?'
7815 if $test X"$sitearch" = X"$sitelib"; then
7818 d_sitearch="$define"
7821 : Set the vendorprefix variables
7824 The installation process will also create a directory for
7825 vendor-supplied add-ons. Vendors who supply perl with their system
7826 may find it convenient to place all vendor-supplied files in this
7827 directory rather than in the main distribution directory. This will
7828 ease upgrades between binary-compatible maintenance versions of perl.
7830 Of course you may also use these directories in whatever way you see
7831 fit. For example, you might use them to access modules shared over a
7832 company-wide network.
7834 The default answer should be fine for most people.
7835 This causes further questions about vendor add-ons to be skipped
7836 and no vendor-specific directories will be configured for perl.
7839 rp='Do you want to configure vendor-specific add-on directories?'
7840 case "$usevendorprefix" in
7841 define|true|[yY]*) dflt=y ;;
7842 *) : User may have set vendorprefix directly on Configure command line.
7843 case "$vendorprefix" in
7852 rp='Installation prefix to use for vendor-supplied add-ons?'
7853 case "$vendorprefix" in
7854 '') dflt="$prefix" ;;
7855 *) dflt=$vendorprefix ;;
7858 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
7860 case "$vendorprefix" in
7864 *) oldvendorprefix="$prefix";;
7868 usevendorprefix="$define"
7870 vendorprefixexp="$ansexp"
7872 *) usevendorprefix="$undef"
7878 : Set the vendorlib variables
7879 case "$vendorprefix" in
7880 '') d_vendorlib="$undef"
7884 *) d_vendorlib="$define"
7885 : determine where vendor-supplied modules go.
7886 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
7887 case "$vendorlib" in
7889 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7890 case "$installstyle" in
7891 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
7892 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
7895 *) dflt="$vendorlib"
7899 rp='Pathname for the vendor-supplied library files?'
7902 vendorlibexp="$ansexp"
7905 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
7909 : Set the vendorarch variables
7910 case "$vendorprefix" in
7911 '') d_vendorarch="$undef"
7915 *) d_vendorarch="$define"
7916 : determine where vendor-supplied architecture-dependent libraries go.
7917 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
7918 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
7919 : vendorlib may have an optional trailing /share.
7920 case "$vendorarch" in
7921 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
7922 dflt="$dflt/$archname"
7924 *) dflt="$vendorarch" ;;
7927 rp='Pathname for vendor-supplied architecture-dependent files?'
7930 vendorarchexp="$ansexp"
7933 prefixvar=vendorarch
7935 if $test X"$vendorarch" = X"$vendorlib"; then
7936 d_vendorarch="$undef"
7938 d_vendorarch="$define"
7941 : Final catch-all directories to search
7944 Lastly, you can have perl look in other directories for extensions and
7945 modules in addition to those already specified.
7946 These directories will be searched after
7950 test X"$vendorlib" != "X" && echo ' ' $vendorlib
7951 test X"$vendorarch" != "X" && echo ' ' $vendorarch
7953 case "$otherlibdirs" in
7954 ''|' ') dflt='none' ;;
7955 *) dflt="$otherlibdirs" ;;
7958 Enter a colon-separated set of extra paths to include in perl's @INC
7959 search path, or enter 'none' for no extra paths.
7963 rp='Colon-separated list of additional directories for perl to search?'
7966 ' '|''|none) otherlibdirs=' ' ;;
7967 *) otherlibdirs="$ans" ;;
7969 case "$otherlibdirs" in
7973 set d_perl_otherlibdirs
7976 : Cruising for prototypes
7978 echo "Checking out function prototypes..." >&4
7979 $cat >prototype.c <<EOCP
7984 int main(int argc, char *argv[]) {
7987 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
7988 echo "Your C compiler appears to support function prototypes."
7991 echo "Your C compiler doesn't seem to understand function prototypes."
7998 : Check if ansi2knr is required
7999 case "$prototype" in
8001 *) ansi2knr='ansi2knr'
8006 This version of $package can only be compiled by a compiler that
8007 understands function prototypes. Unfortunately, your C compiler
8009 doesn't seem to understand them. Sorry about that.
8011 If GNU cc is available for your system, perhaps you could try that instead.
8013 Eventually, we hope to support building Perl with pre-ANSI compilers.
8014 If you would like to help in that effort, please contact <perlbug@perl.org>.
8016 Aborting Configure now.
8023 dflt_dtrace='/usr/sbin/dtrace'
8024 $test -x /usr/bin/dtrace && dflt_dtrace='/usr/bin/dtrace'
8028 Perl can be built to support DTrace on platforms that support it.
8029 DTrace is a diagnosis and performance analysis tool from Sun.
8031 If this doesn't make any sense to you, just accept the default '$dflt'.
8035 case "$usedtrace" in
8041 dflt_dtrace=$usedtrace
8048 rp='Support DTrace if available?'
8051 y|Y) val="$define" ;;
8057 test "X$usedtrace" != "X$define" && break
8060 rp='Where is the dtrace executable?'
8069 if $dtrace -h -s ../perldtrace.d \
8070 -o perldtrace.tmp >/dev/null 2>&1 \
8071 && rm -f perldtrace.tmp
8074 echo "Good: your $dtrace knows about the -h flag."
8078 *** $me: Fatal Error: $dtrace doesn't support -h flag
8080 *** Your installed dtrace doesn't support the -h switch to compile a D
8081 *** program into a C header. Can't continue.
8093 *** $me: Fatal Error: $dtrace not found.
8100 echo "*** $dtrace was not found."
8106 : See if we want extra modules installed
8113 Perl can be built with extra modules or bundles of modules which
8114 will be fetched from the CPAN and installed alongside Perl.
8116 Notice that you will need access to the CPAN; either via the Internet,
8117 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
8118 be asked later to configure the CPAN.pm module which will in turn do
8119 the installation of the rest of the extra modules or bundles.)
8121 Notice also that if the modules require any external software such as
8122 libraries and headers (the libz library and the zlib.h header for the
8123 Compress::Zlib module, for example) you MUST have any such software
8124 already installed, this configuration process will NOT install such
8127 If this doesn't make any sense to you, just accept the default '$dflt'.
8129 rp='Install any extra modules (y or n)?'
8135 Please list any extra modules or bundles to be installed from CPAN,
8136 with spaces between the names. The names can be in any format the
8137 'install' command of CPAN.pm will understand. (Answer 'none',
8138 without the quotes, to install no extra modules or bundles.)
8148 $rm -f ../extras.lst
8150 *) echo "(Saving the list of extras for later...)"
8151 echo "$extras" > ../extras.lst
8159 : determine where html pages for programs go
8160 set html1dir html1dir none
8164 If you wish to install html files for programs in $spackage, indicate
8165 the appropriate directory here. To skip installing html files,
8169 ''|none|$undef|' ') dflt=none ;;
8170 *) dflt=$html1dir ;;
8173 rp="Directory for the main $spackage html pages?"
8177 : Use ' ' for none so value is preserved next time through Configure
8178 $test X"$html1dir" = "X" && html1dir=' '
8180 : determine where html pages for libraries and modules go
8181 set html3dir html3dir none
8185 If you wish to install html files for modules associated with $spackage,
8186 indicate the appropriate directory here. To skip installing html files,
8189 : There is no obvious default. If they have specified html1dir, then
8190 : try to key off that, possibly changing .../html1 into .../html3.
8192 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
8193 *) dflt=$html3dir ;;
8196 rp="Directory for the $spackage module html pages?"
8200 : Use ' ' for none so value is preserved next time through Configure
8201 $test X"$html3dir" = "X" && html3dir=' '
8203 : determine whether to install perl also as /usr/bin/perl
8206 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
8208 Many scripts expect perl to be installed as /usr/bin/perl.
8210 If you want to, I can install the perl you are about to compile
8211 as /usr/bin/perl (in addition to $bin/perl).
8213 if test -f /usr/bin/perl; then
8216 However, please note that because you already have a /usr/bin/perl,
8217 overwriting that with a new Perl would very probably cause problems.
8218 Therefore I'm assuming you don't want to do that (unless you insist).
8221 case "$installusrbinperl" in
8222 "$define"|[yY]*) dflt='y';;
8228 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
8231 case "$installusrbinperl" in
8232 "$undef"|[nN]*) dflt='n';;
8236 rp="Do you want to install perl as /usr/bin/perl?"
8239 [yY]*) val="$define";;
8245 set installusrbinperl
8248 : see if dlopen exists
8250 xxx_ccflags="$ccflags"
8252 : with g++ one needs -shared to get is-in-libc to work for dlopen
8253 case "$gccversion" in
8255 *) case "$d_cplusplus" in
8256 "$define") ccflags="$ccflags -shared" ;;
8263 ccflags="$xxx_ccflags"
8265 : see if this is a unistd.h system
8266 set unistd.h i_unistd
8269 : determine which dynamic loading, if any, to compile in
8271 dldir="ext/DynaLoader"
8284 $define) dflt='y' ;;
8286 : Does a dl_xxx.xs file exist for this operating system
8287 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
8290 rp="Do you wish to use dynamic loading?"
8297 '') if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
8298 dflt="$dldir/dl_${osname}.xs"
8299 elif $test "$d_dlopen" = "$define" ; then
8300 dflt="$dldir/dl_dlopen.xs"
8305 *) dflt="$dldir/$dlsrc"
8308 echo "The following dynamic loading files are available:"
8309 : Can not go over to $dldir because getfile has path hard-coded in.
8310 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
8311 rp="Source file to use for dynamic loading"
8317 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
8321 Some systems may require passing special flags to $cc -c to
8322 compile modules that will be used to create a shared library.
8323 To use no flags, say "none".
8326 case "$cccdlflags" in
8327 '') case "$gccversion" in
8328 '') case "$osname" in
8330 irix*) dflt='-KPIC' ;;
8331 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
8332 sunos) dflt='-pic' ;;
8336 *) case "$osname" in
8337 darwin) dflt='none' ;;
8338 *linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
8343 *) dflt="$cccdlflags" ;;
8350 # If -Dsysroot was specified, now's the time to add it
8352 if test "X$sysroot" != X; then
8353 case "$gccversion" in
8358 dflt="$dflt --sysroot=$sysroot" ;;
8368 rp="Any special flags to pass to $cc -c to compile shared library modules?"
8371 none) cccdlflags=' ' ;;
8372 *) cccdlflags="$ans" ;;
8377 Some systems use ld to create libraries that can be dynamically loaded,
8378 while other systems (such as those using ELF) use $cc.
8382 : Determine if this is ELF
8384 /* Test for whether ELF binaries are produced */
8396 int i = open("a.out",O_RDONLY);
8399 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
8400 exit(0); /* succeed (yes, it is ELF) */
8404 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
8410 '') if $test $bin_ELF = "$define"; then
8412 You appear to have ELF support. I'll use $cc to build dynamic libraries.
8416 echo "I'll use ld to build dynamic libraries."
8424 rp="What command should be used to create dynamic libraries?"
8430 Some systems may require passing special flags to $ld to create a
8431 library that can be dynamically loaded. If your ld flags include
8432 -L/other/path options to locate libraries outside your loader's normal
8433 search path, you may need to specify those -L options here as well. To
8434 use no flags, say "none".
8437 case "$lddlflags" in
8438 '') case "$osname" in
8439 haiku) dflt='-shared' ;;
8441 case "$gccversion" in
8442 '') dflt="$dflt +vnocompatwarnings" ;;
8445 *linux*|irix*|gnu*) dflt="-shared $optimize" ;;
8446 solaris) # See [perl #66604].
8447 # On Solaris 11, gcc -m64 on amd64
8448 # appears not to understand -G. gcc versions at
8449 # least as old as 3.4.3 support -shared, so just
8450 # use that with Solaris 11 and later, but keep
8451 # the old behavior for older Solaris versions.
8452 case "$gccversion" in
8454 *) case "$osvers" in
8455 2.?|2.10) dflt='-G' ;;
8456 *) dflt='-shared' ;;
8461 sunos) dflt='-assert nodefinitions' ;;
8462 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
8466 *) dflt="$lddlflags" ;;
8469 : Only do this for gcc, since, for example, qcc has no concept
8471 if $test "X$sysroot" != X; then
8472 case "$gccversion" in
8474 *) dflt="$dflt --sysroot $sysroot" ;;
8478 : Try to guess additional flags to pick up local libraries.
8479 : Be careful not to append to a plain 'none'
8483 for thisflag in $ldflags; do
8488 *) dflt="$dflt $thisflag" ;;
8495 ''|' ') dflt='none' ;;
8499 *-fstack-protector-strong*)
8501 *-fstack-protector-strong*) ;; # Don't add it again
8502 *) dflt="$dflt -fstack-protector-strong" ;;
8505 *-fstack-protector*)
8507 *-fstack-protector*) ;; # Don't add it again
8508 *) dflt="$dflt -fstack-protector" ;;
8513 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
8516 none) lddlflags=' ' ;;
8517 *) lddlflags="$ans" ;;
8522 Some systems may require passing special flags to $cc to indicate that
8523 the resulting executable will use dynamic linking. To use no flags,
8527 case "$ccdlflags" in
8528 '') case "$osname" in
8529 *linux*|hpux|gnu*) dflt='-Wl,-E' ;;
8530 sunos) dflt='none' ;;
8534 *) dflt="$ccdlflags" ;;
8536 rp="Any special flags to pass to $cc to use dynamic linking?"
8539 none) ccdlflags=' ' ;;
8540 *) ccdlflags="$ans" ;;
8552 ld_can_script="$undef"
8553 case "$bin_ELF$usedl" in
8555 # Abuse try.h and a.out names for neat cleanup
8567 if $cc $cccdlflags $ccdlflags $ccflags \
8568 $ldflags $lddlflags -o a.out try.c \
8569 -Wl,--version-script=try.h >/dev/null 2>&1 \
8570 && $test -s a.out ; then
8571 echo "ld supports scripting" >&4
8572 ld_can_script="$define"
8574 echo "ld does not support scripting" >&4
8580 : Do we want a shared libperl?
8584 # No dynamic loading being used, so don't bother even to prompt.
8587 *) case "$useshrplib" in
8588 '') case "$osname" in
8589 svr4*|nonstopux|dgux|dynixptx|esix|powerux|haiku|cygwin*)
8591 also='Building a shared libperl is required for dynamic loading to work on your system.'
8605 The perl executable is normally obtained by linking perlmain.c with
8606 libperl${_a}, any static extensions (usually just DynaLoader), and
8607 any other libraries needed on this system (such as -lm, etc.). Since
8608 your system supports dynamic loading, it is probably possible to build
8609 a shared libperl.$so. If you will have more than one executable linked
8610 to libperl.$so, this will significantly reduce the size of each
8611 executable, but it may have a noticeable effect on performance. The
8612 default is probably sensible for your system.
8616 rp="Build a shared libperl.$so (y/n)"
8620 useshrplib='true' ;;
8621 *) useshrplib='false' ;;
8626 case "$useshrplib" in
8628 case "$userelocatableinc" in
8630 echo "Cannot build with both -Duserelocatableinc and -Duseshrplib" >&4
8631 echo "See INSTALL for an explanation why that won't work." >&4
8637 # Figure out a good name for libperl.so. Since it gets stored in
8638 # a version-specific architecture-dependent library, the version
8639 # number isn't really that important, except for making cc/ld happy.
8641 # A name such as libperl.so.10.1
8642 majmin="libperl.$so.$patchlevel.$subversion"
8643 # A name such as libperl.so.100
8644 majonly=`echo $patchlevel $subversion |
8645 $awk '{printf "%d%02d", $1, $2}'`
8646 majonly=libperl.$so.$majonly
8647 # I'd prefer to keep the os-specific stuff here to a minimum, and
8648 # rely on figuring it out from the naming of libc.
8649 case "${osname}${osvers}" in
8650 *linux*|gnu*) # ld won't link with a bare -lperl otherwise.
8653 cygwin*) # ld links now against the dll directly
8654 majmin="cygperl5_${patchlevel}_${subversion}.${so}"
8655 majonly=`echo $patchlevel $subversion |
8656 $awk '{printf "%03d%03d", $1, $2}'`
8657 majonly=cygperl5.$majonly.$so
8660 *) # Try to guess based on whether libc has major.minor.
8662 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8663 *libc.$so.[0-9]*) dflt=$majonly ;;
8664 *) dflt=libperl.$so ;;
8674 I need to select a good name for the shared libperl. If your system uses
8675 library names with major and minor numbers, then you might want something
8676 like $majmin. Alternatively, if your system uses a single version
8677 number for shared libraries, then you might want to use $majonly.
8678 Or, your system might be quite happy with a simple libperl.$so.
8680 Since the shared libperl will get installed into a version-specific
8681 architecture-dependent directory, the version number of the shared perl
8682 library probably isn't important, so the default should be o.k.
8685 rp='What name do you want to give to the shared libperl?'
8688 echo "Ok, I'll use $libperl"
8691 libperl="libperl${_a}"
8695 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8699 WARNING: Use of the shrpdir variable for the installation location of
8700 the shared $libperl is not supported. It was never documented and
8701 will not work in this version. Let me (perlbug@perl.org)
8702 know of any problems this may cause.
8708 But your current setting of $shrpdir is
8709 the default anyway, so it's harmless.
8714 Further, your current attempted setting of $shrpdir
8715 conflicts with the value of $archlibexp/CORE
8716 that installperl will use.
8723 # How will the perl executable find the installed shared $libperl?
8724 # Add $xxx to ccdlflags.
8725 # If we can't figure out a command-line option, use $shrpenv to
8726 # set env LD_RUN_PATH. The main perl makefile uses this.
8727 shrpdir=$archlibexp/CORE
8730 if "$useshrplib"; then
8733 # We'll set it in Makefile.SH...
8738 freebsd|mirbsd|netbsd|openbsd|interix|dragonfly|bitrig)
8739 xxx="-Wl,-R$shrpdir"
8741 bsdos|linux|irix*|dec_osf|gnu*|haiku)
8742 xxx="-Wl,-rpath,$shrpdir"
8745 # hpux doesn't like the default, either.
8746 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8749 # cygwin needs only ldlibpth
8752 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8758 # Only add $xxx if it isn't already in ccdlflags.
8759 case " $ccdlflags " in
8761 *) ccdlflags="$ccdlflags $xxx"
8764 Adding $xxx to the flags
8765 passed to $ld so that the perl executable will find the
8766 installed shared $libperl.
8774 # Fix ccdlflags in AIX for building external extensions.
8775 # (For building Perl itself bare -bE:perl.exp is needed,
8776 # Makefile.SH takes care of this.)
8778 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8780 # Respect a hint or command-line value.
8782 '') shrpenv="$tmp_shrpenv" ;;
8784 case "$ldlibpthname" in
8785 '') ldlibpthname=LD_LIBRARY_PATH ;;
8786 none) ldlibpthname='' ;;
8789 : determine where manual pages are on this system
8793 syspath='/usr/share/man/man1 /usr/man/man1'
8794 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8795 syspath="$syspath /usr/man/u_man/man1"
8796 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8797 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8798 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8799 sysman=`./loc . /usr/man/man1 $syspath`
8802 if $test -d "$sysman"; then
8803 echo "System manual is in $sysman." >&4
8805 echo "Could not find manual pages in source form." >&4
8808 : determine where manual pages go
8809 set man1dir man1dir none
8813 $spackage has manual pages available in source form.
8817 echo "However, you don't have nroff, so they're probably useless to you."
8819 '') man1dir="none";;
8822 echo "If you don't want the manual sources installed, answer 'none'."
8827 lookpath="$prefixexp/share/man/man1"
8828 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8829 lookpath="$lookpath $prefixexp/man/p_man/man1"
8830 lookpath="$lookpath $prefixexp/man/u_man/man1"
8831 lookpath="$lookpath $prefixexp/man/man.1"
8833 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8834 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8844 rp="Where do the main $spackage manual pages (source) go?"
8846 if $test "X$man1direxp" != "X$ansexp"; then
8857 : What suffix to use on installed man pages
8864 rp="What suffix should be used for the main $spackage man pages?"
8866 '') case "$man1dir" in
8880 *) dflt="$man1ext";;
8887 : see if we can have long filenames
8889 first=123456789abcdef
8891 if (echo hi >$first) 2>/dev/null; then
8892 if $test -f 123456789abcde; then
8893 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8896 echo 'You can have filenames longer than 14 characters.'>&4
8901 You can't have filenames longer than 14 chars.
8902 You can't even think about them!
8908 $rm -rf 123456789abcde*
8910 : determine where library module manual pages go
8911 set man3dir man3dir none
8915 $spackage has manual pages for many of the library modules.
8921 However, you don't have nroff, so they're probably useless to you.
8924 '') man3dir="none";;
8928 case "$d_flexfnam" in
8931 However, your system can't handle the long file names like File::Basename.3.
8934 '') man3dir="none";;
8938 echo "If you don't want the manual sources installed, answer 'none'."
8939 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8941 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8942 if $test -d "$privlib/man/man3"; then
8945 WARNING: Previous versions of perl installed man3 pages into
8946 $privlib/man/man3. This version will suggest a
8947 new default of $dflt.
8951 rp='Do you wish to preserve the old behavior?(y/n)'
8954 y*) dflt="$privlib/man/man3" ;;
8959 *) dflt="$man3dir" ;;
8966 rp="Where do the $package library man pages (source) go?"
8976 : What suffix to use on installed man pages
8982 rp="What suffix should be used for the $package library man pages?"
8984 '') case "$man3dir" in
8998 *) dflt="$man3ext";;
9005 : see if we have to deal with yellow pages, now NIS.
9006 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
9012 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
9020 rp='Are you getting the hosts file via yellow pages?'
9023 y*) hostcat='ypcat hosts';;
9024 *) hostcat='cat /etc/hosts';;
9030 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
9033 '') test -f /etc/group && groupcat='cat /etc/group';;
9036 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
9039 : now get the host name
9041 echo "Figuring out host name..." >&4
9042 case "$myhostname" in
9044 echo 'Maybe "hostname" will work...'
9045 if tans=`sh -c hostname 2>&1` ; then
9053 if $test "$cont"; then
9055 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
9056 if tans=`cat /etc/systemid 2>&1` ; then
9058 phostname='cat /etc/systemid'
9059 echo "Whadyaknow. Xenix always was a bit strange..."
9062 elif $test -r /etc/systemid; then
9063 echo "(What is a non-Xenix system doing with /etc/systemid?)"
9066 if $test "$cont"; then
9067 echo 'No, maybe "uuname -l" will work...'
9068 if tans=`sh -c 'uuname -l' 2>&1` ; then
9070 phostname='uuname -l'
9072 echo 'Strange. Maybe "uname -n" will work...'
9073 if tans=`sh -c 'uname -n' 2>&1` ; then
9075 phostname='uname -n'
9077 echo 'Oh well, maybe I can mine it out of whoami.h...'
9078 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
9079 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
9080 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
9082 case "$myhostname" in
9083 '') echo "Does this machine have an identity crisis or something?"
9086 echo "Well, you said $myhostname before..."
9087 phostname='echo $myhostname';;
9093 case "$myhostname" in
9094 '') myhostname=noname ;;
9096 : you do not want to know about this
9101 if $test "$myhostname" ; then
9103 rp='Your host name appears to be "'$myhostname'".'" Right?"
9111 : bad guess or no guess
9112 while $test "X$myhostname" = X ; do
9114 rp="Please type the (one word) name of your host:"
9119 : translate upper to lower if necessary
9120 case "$myhostname" in
9122 echo "(Normalizing case in your host name)"
9123 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
9127 case "$myhostname" in
9129 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
9130 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
9131 echo "(Trimming domain name from host name--host name is now $myhostname)"
9133 *) case "$mydomain" in
9136 test "X$hostcat" = "Xypcat hosts" &&
9137 ypmatch "$myhostname" hosts 2>/dev/null |\
9138 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
9141 test "X$hostcat" != "X" &&
9142 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
9143 /[ ]$myhostname[ . ]/p" > hosts
9146 if $test -f hosts; then
9147 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
9148 END { print sum }" hosts` = x1 || tmp_re="[ ]"
9149 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
9150 hosts | $sort | $uniq | \
9151 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
9152 case `$echo X$dflt` in
9153 X*\ *) echo "(Several hosts in the database matched hostname)"
9156 X.) echo "(You do not have fully-qualified names in the hosts database)"
9160 echo "(I cannot locate a hosts database anywhere)"
9165 tans=`./loc resolv.conf X /etc /usr/etc`
9166 if $test -f "$tans"; then
9167 echo "(Attempting domain name extraction from $tans)"
9168 dflt=.`$sed -n -e 's/ / /g' \
9169 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
9172 .) dflt=.`$sed -n -e 's/ / /g' \
9173 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
9181 .) echo "(No help from resolv.conf either -- attempting clever guess)"
9182 dflt=.`sh -c domainname 2>/dev/null`
9185 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
9189 case "$dflt$osname" in
9190 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
9191 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
9195 .) echo "(Lost all hope -- silly guess then)"
9201 *) dflt="$mydomain";;
9205 rp="What is your domain name?"
9215 : translate upper to lower if necessary
9218 echo "(Normalizing case in your domain name)"
9219 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
9223 : a little sanity check here
9224 case "$phostname" in
9227 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
9228 $myhostname$mydomain|$myhostname) ;;
9230 case "$phostname" in
9232 echo "(That doesn't agree with your whoami.h file, by the way.)"
9235 echo "(That doesn't agree with your $phostname command, by the way.)"
9243 : determine the e-mail address of the user who is running us
9246 I need to get your e-mail address in Internet format if possible, i.e.
9247 something like user@host.domain. Please answer accurately since I have
9248 no easy means to double check it. The default value provided below
9249 is most probably close to reality but may not be valid from outside
9250 your organization...
9254 while test "$cont"; do
9255 case "$MAILDOMAIN" in
9257 if $test -s /etc/mailname; then
9258 maildomain=`$cat /etc/mailname`
9260 maildomain="$myhostname$mydomain"
9263 *) maildomain="$MAILDOMAIN";;
9266 '') dflt="$cf_by@$maildomain";;
9267 *) dflt="$cf_email";;
9269 rp='What is your e-mail address?'
9275 rp='Address does not look like an Internet one. Use it anyway?'
9289 : Ask e-mail of administrator
9292 If you or somebody else will be maintaining perl at your site, please
9293 fill in the correct e-mail address here so that they may be contacted
9294 if necessary. Currently, the "perlbug" program included with perl
9295 will send mail to this address in addition to perlbug@perl.org. You may
9296 enter "none" for no administrator.
9299 case "$perladmin" in
9300 '') dflt="$cf_email";;
9301 *) dflt="$perladmin";;
9303 rp='Perl administrator e-mail address'
9307 : determine whether to only install version-specific parts.
9310 Do you want to install only the version-specific parts of the perl
9311 distribution? Usually you do *not* want to do this.
9313 case "$versiononly" in
9314 "$define"|[Yy]*|true) dflt='y' ;;
9317 rp="Do you want to install only the version-specific parts of perl?"
9320 [yY]*) val="$define";;
9326 case "$versiononly" in
9327 "$define") inc_version_list=''
9328 inc_version_list_init=0
9332 : figure out how to guarantee perl startup
9333 : XXX Note that this currently takes advantage of the bug that binexp ignores
9334 : the Configure -Dinstallprefix setting, which in turn means that under
9335 : relocatable @INC, initialinstalllocation is what binexp started as.
9336 case "$startperl" in
9338 case "$sharpbang" in
9342 I can use the #! construct to start perl on your system. This will
9343 make startup of perl scripts faster, but may cause problems if you
9344 want to share those scripts and perl is not in a standard place
9345 ($initialinstalllocation/perl) on all your platforms. The alternative
9346 is to force a shell by starting the script with a single ':' character.
9349 case "$versiononly" in
9350 "$define") dflt="$initialinstalllocation/perl$version";;
9351 *) dflt="$initialinstalllocation/perl";;
9353 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
9356 none) startperl=": # use perl";;
9357 *) startperl="#!$ans"
9358 if $test 30 -lt `echo "$ans" | wc -c`; then
9361 WARNING: Some systems limit the #! command to 32 characters.
9362 If you experience difficulty running Perl scripts with #!, try
9363 installing Perl in a directory with a shorter pathname.
9369 *) startperl=": # use perl"
9374 echo "I'll use $startperl to start perl scripts."
9376 : figure best path for perl in scripts
9379 case "$versiononly" in
9380 "$define") perlpath="$initialinstalllocation/perl$version";;
9381 *) perlpath="$initialinstalllocation/perl";;
9383 case "$startperl" in
9388 I will use the "eval 'exec'" idiom to start Perl on your system.
9389 I can use the full path of your Perl binary for this purpose, but
9390 doing so may cause problems if you want to share those scripts and
9391 Perl is not always in a standard place ($initialinstalllocation/perl).
9394 dflt="$initialinstalllocation/perl"
9395 rp="What path shall I use in \"eval 'exec'\"?"
9402 case "$startperl" in
9404 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
9407 : determine where public executable scripts go
9408 set scriptdir scriptdir
9410 case "$scriptdir" in
9413 : guess some guesses
9414 $test -d /usr/share/scripts && dflt=/usr/share/scripts
9415 $test -d /usr/share/bin && dflt=/usr/share/bin
9416 $test -d /usr/local/script && dflt=/usr/local/script
9417 $test -d /usr/local/scripts && dflt=/usr/local/scripts
9418 $test -d $prefixexp/script && dflt=$prefixexp/script
9422 *) dflt="$scriptdir"
9427 Some installations have a separate directory just for executable scripts so
9428 that they can mount it across multiple architectures but keep the scripts in
9429 one spot. You might, for example, have a subdirectory of /usr/share for this.
9430 Or you might just lump your scripts in with all your other executables.
9434 rp='Where do you keep publicly executable scripts?'
9436 if $test "X$ansexp" != "X$scriptdirexp"; then
9442 : A little fix up for an irregularly named variable.
9443 installscript="$installscriptdir"
9445 : determine where add-on public executables go
9447 '') dflt=$siteprefix/bin ;;
9451 rp='Pathname where the add-on public executables should be installed?'
9456 : determine where add-on html pages go
9457 : There is no standard location, so try to copy the previously-selected
9458 : directory structure for the core html pages.
9459 case "$sitehtml1dir" in
9460 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9461 *) dflt=$sitehtml1dir ;;
9464 ''|' ') dflt=none ;;
9467 rp='Pathname where the site-specific html pages should be installed?'
9469 prefixvar=sitehtml1dir
9472 : determine where add-on library html pages go
9473 : There is no standard location, so try to copy the previously-selected
9474 : directory structure for the core html pages.
9475 case "$sitehtml3dir" in
9476 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9477 *) dflt=$sitehtml3dir ;;
9480 ''|' ') dflt=none ;;
9483 rp='Pathname where the site-specific library html pages should be installed?'
9485 prefixvar=sitehtml3dir
9488 : determine where add-on manual pages go
9489 case "$siteman1dir" in
9490 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
9491 *) dflt=$siteman1dir ;;
9494 ''|' ') dflt=none ;;
9497 rp='Pathname where the site-specific manual pages should be installed?'
9499 prefixvar=siteman1dir
9502 : determine where add-on library man pages go
9503 case "$siteman3dir" in
9504 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
9505 *) dflt=$siteman3dir ;;
9508 ''|' ') dflt=none ;;
9511 rp='Pathname where the site-specific library manual pages should be installed?'
9513 prefixvar=siteman3dir
9516 : determine where add-on public executable scripts go
9517 case "$sitescript" in
9518 '') dflt=$siteprefix/script
9519 $test -d $dflt || dflt=$sitebin ;;
9520 *) dflt="$sitescript" ;;
9523 rp='Pathname where add-on public executable scripts should be installed?'
9525 prefixvar=sitescript
9528 : see if backtrace exists
9529 set backtrace d_backtrace
9532 : add flags if using c backtrace
9533 case "$usecbacktrace" in
9534 "") usecbacktrace=$undef ;;
9536 case "$d_backtrace" in
9538 case " $ccflags " in
9539 *" -DUSE_C_BACKTRACE "*) ;; # Already there.
9540 *) ccflags="$ccflags -DUSE_C_BACKTRACE -g" ;;
9544 echo "This system does not support backtrace" >&4
9545 usecbacktrace=$undef
9551 : Check if faststdio is requested and available
9552 case "$usefaststdio" in
9553 $define|true|[yY]*|'')
9554 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
9564 Perl can be built to use 'fast stdio', which means using the stdio
9565 library but also directly manipulating the stdio buffers to enable
9566 faster I/O. Using stdio is better for backward compatibility (especially
9567 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
9568 interface has been preferred instead of stdio.
9570 If this doesn't make any sense to you, just accept the default '$dflt'.
9572 rp='Use the "fast stdio" if available?'
9575 y|Y) val="$define" ;;
9582 : define an is-a-typedef? function
9583 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9585 "") inclist="sys/types.h";;
9587 eval "varval=\$$var";
9591 for inc in $inclist; do
9592 echo "#include <$inc>" >>temp.c;
9594 echo "#ifdef $type" >> temp.c;
9595 echo "printf(\"We have $type\");" >> temp.c;
9596 echo "#endif" >> temp.c;
9597 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9598 if $contains $type temp.E >/dev/null 2>&1; then
9604 *) eval "$var=\$varval";;
9607 : define an is-a-typedef? function that prompts if the type is not available.
9608 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9610 "") inclist="sys/types.h";;
9612 eval "varval=\$$var";
9616 for inc in $inclist; do
9617 echo "#include <$inc>" >>temp.c;
9619 echo "#ifdef $type" >> temp.c;
9620 echo "printf(\"We have $type\");" >> temp.c;
9621 echo "#endif" >> temp.c;
9622 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9624 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
9625 if $contains $type temp.E >/dev/null 2>&1; then
9626 echo "$type found." >&4;
9629 echo "$type NOT found." >&4;
9635 *) eval "$var=\$varval";;
9638 : see what type lseek is declared as in the kernel
9639 rp="What is the type used for lseek's offset on this system?"
9640 set off_t lseektype long stdio.h sys/types.h
9644 echo "Checking to see how big your file offsets are..." >&4
9646 #include <sys/types.h>
9650 printf("%d\n", (int)sizeof($lseektype));
9655 if eval $compile_ok; then
9656 lseeksize=`$run ./try`
9657 echo "Your file offsets are $lseeksize bytes long."
9661 echo "(I can't seem to compile the test program. Guessing...)"
9662 rp="What is the size of your file offsets (in bytes)?"
9668 : see what type file positions are declared as in the library
9669 rp="What is the type for file position used by fsetpos()?"
9670 set fpos_t fpostype long stdio.h sys/types.h
9673 : Check size for Fpos_t
9676 *_t) zzz="$fpostype" ;;
9679 echo "Checking the size of $zzz..." >&4
9681 #include <sys/types.h>
9688 printf("%d\n", (int)sizeof($fpostype));
9693 if eval $compile_ok; then
9697 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9700 echo "Your $zzz is $fpossize bytes long."
9706 echo "(I can't compile the test program. Guessing...)" >&4
9707 rp="What is the size of your file positions (in bytes)?"
9712 : Check for large file support
9713 # Backward compatibility (uselfs is deprecated).
9715 "$define"|true|[yY]*)
9718 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9720 uselargefiles="$define"
9724 case "$lseeksize:$fpossize" in
9727 You can have files larger than 2 gigabytes.
9730 *) case "$uselargefiles" in
9731 "$undef"|false|[nN]*) dflt='n' ;;
9736 Perl can be built to understand large files (files larger than 2 gigabytes)
9737 on some systems. To do so, Configure can be run with -Duselargefiles.
9739 If this doesn't make any sense to you, just accept the default '$dflt'.
9741 rp='Try to understand large files, if available?'
9744 y|Y) val="$define" ;;
9751 : Look for a hint-file generated 'call-back-unit'. If the
9752 : user has specified that a large files perl is to be built,
9753 : we may need to set or change some other defaults.
9754 if $test -f uselargefiles.cbu; then
9755 echo "Your platform has some specific hints regarding large file builds, using them..."
9756 . ./uselargefiles.cbu
9758 case "$uselargefiles" in
9760 if $test -f uselargefiles.cbu; then
9762 echo "Rechecking to see how big your file offsets are..." >&4
9764 #include <sys/types.h>
9768 printf("%d\n", (int)sizeof($lseektype));
9773 if eval $compile_ok; then
9774 lseeksize=`$run ./try`
9775 $echo "Your file offsets are now $lseeksize bytes long."
9779 echo "(I can't seem to compile the test program. Guessing...)"
9780 rp="What is the size of your file offsets (in bytes)?"
9785 *_t) zzz="$fpostype" ;;
9788 $echo $n "Rechecking the size of $zzz...$c" >&4
9790 #include <sys/types.h>
9797 printf("%d\n", (int)sizeof($fpostype));
9802 if eval $compile_ok; then
9807 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9810 echo " $fpossize bytes." >&4
9816 echo "(I can't compile the test program. Guessing...)" >&4
9817 rp="What is the size of your file positions (in bytes)?"
9826 : Check if we want perlio
9829 : Set the vendorbin variables
9830 case "$vendorprefix" in
9831 '') d_vendorbin="$undef"
9835 *) d_vendorbin="$define"
9836 : determine where vendor-supplied executables go.
9837 case "$vendorbin" in
9838 '') dflt=$vendorprefix/bin ;;
9839 *) dflt="$vendorbin" ;;
9842 rp='Pathname for the vendor-supplied executables directory?'
9845 vendorbinexp="$ansexp"
9851 : Set the vendorhtml1dir variables
9852 case "$vendorprefix" in
9853 '') vendorhtml1dir=''
9854 vendorhtml1direxp=''
9856 *) : determine where vendor-supplied html pages go.
9857 : There is no standard location, so try to copy the previously-selected
9858 : directory structure for the core html pages.
9859 : XXX Better default suggestions would be welcome.
9860 case "$vendorhtml1dir" in
9861 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9862 *) dflt=$vendorhtml1dir ;;
9865 ''|' ') dflt=none ;;
9868 rp='Pathname for the vendor-supplied html pages?'
9870 vendorhtml1dir="$ans"
9871 vendorhtml1direxp="$ansexp"
9874 : Use ' ' for none so value is preserved next time through Configure
9875 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9876 prefixvar=vendorhtml1dir
9879 : Set the vendorhtml3dir variables
9880 case "$vendorprefix" in
9881 '') vendorhtml3dir=''
9882 vendorhtml3direxp=''
9884 *) : determine where vendor-supplied module html pages go.
9885 : There is no standard location, so try to copy the previously-selected
9886 : directory structure for the core html pages.
9887 : XXX Better default suggestions would be welcome.
9888 case "$vendorhtml3dir" in
9889 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9890 *) dflt=$vendorhtml3dir ;;
9893 ''|' ') dflt=none ;;
9896 rp='Pathname for the vendor-supplied html pages?'
9898 vendorhtml3dir="$ans"
9899 vendorhtml3direxp="$ansexp"
9902 : Use ' ' for none so value is preserved next time through Configure
9903 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9904 prefixvar=vendorhtml3dir
9907 : Set the vendorman1dir variables
9908 case "$vendorprefix" in
9909 '') vendorman1dir=''
9912 *) : determine where vendor-supplied manual pages go.
9913 case "$vendorman1dir" in
9914 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9915 *) dflt=$vendorman1dir ;;
9918 ''|' ') dflt=none ;;
9921 rp='Pathname for the vendor-supplied manual section 1 pages?'
9923 vendorman1dir="$ans"
9924 vendorman1direxp="$ansexp"
9927 : Use ' ' for none so value is preserved next time through Configure
9928 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9929 prefixvar=vendorman1dir
9932 : Set the vendorman3dir variables
9933 case "$vendorprefix" in
9934 '') vendorman3dir=''
9937 *) : determine where vendor-supplied module manual pages go.
9938 case "$vendorman3dir" in
9939 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9940 *) dflt=$vendorman3dir ;;
9943 ''|' ') dflt=none ;;
9946 rp='Pathname for the vendor-supplied manual section 3 pages?'
9948 vendorman3dir="$ans"
9949 vendorman3direxp="$ansexp"
9952 : Use ' ' for none so value is preserved next time through Configure
9953 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9954 prefixvar=vendorman3dir
9957 : Set the vendorscript variables
9958 case "$vendorprefix" in
9959 '') d_vendorscript="$undef"
9963 *) d_vendorscript="$define"
9964 : determine where vendor-supplied scripts go.
9965 case "$vendorscript" in
9966 '') dflt=$vendorprefix/script
9967 $test -d $dflt || dflt=$vendorbin ;;
9968 *) dflt="$vendorscript" ;;
9972 The installation process will create a directory for
9973 vendor-supplied scripts.
9977 rp='Pathname for the vendor-supplied scripts directory?'
9980 vendorscriptexp="$ansexp"
9983 prefixvar=vendorscript
9986 : script used to emit important warnings
9989 if test \$# -gt 0; then
9994 echo "*** WARNING:" >&4
9995 sed -e 's/^/*** /' <msg >&4
9997 cat msg >>config.msg
9998 echo " " >>config.msg
10004 : see which of string.h or strings.h is needed
10006 strings=`./findhdr string.h`
10007 if $test "$strings" && $test -r "$strings"; then
10008 echo "Using <string.h> instead of <strings.h>." >&4
10012 strings=`./findhdr strings.h`
10013 if $test "$strings" && $test -r "$strings"; then
10014 echo "Using <strings.h> instead of <string.h>." >&4
10016 ./warn "No string header found -- You'll surely have problems."
10021 case "$i_string" in
10022 "$undef") strings=`./findhdr strings.h`;;
10023 *) strings=`./findhdr string.h`;;
10026 : see if qgcvt exists
10030 : Check what kind of doubles your system has
10031 $echo "Checking the kind of doubles you have..." >&4
10033 #$i_stdlib I_STDLIB
10034 #define DOUBLESIZE $doublesize
10036 #include <stdlib.h>
10039 static const double d = -0.1;
10041 unsigned const char* b = (unsigned const char*)(&d);
10042 #if DOUBLESIZE == 4
10043 if (b[0] == 0xCD && b[3] == 0xBD) {
10044 /* IEEE 754 32-bit little-endian */
10048 if (b[0] == 0xBD && b[3] == 0xCD) {
10049 /* IEEE 754 32-bit big-endian */
10054 #if DOUBLESIZE == 8
10055 if (b[0] == 0x9A && b[7] == 0xBF) {
10056 /* IEEE 754 64-bit little-endian */
10060 if (b[0] == 0xBF && b[7] == 0x9A) {
10061 /* IEEE 754 64-bit big-endian */
10065 if (b[0] == 0x99 && b[3] == 0xBF && b[4] == 0x9A && b[7] == 0x99) {
10066 /* ARM mixed endian: two little-endian 32-bit floats, in big endian order:
10067 * 4 5 6 7 0 1 2 3 (MSB = 7, LSB = 0)
10068 * 99 99 b9 bf 9a 99 99 99 */
10072 if (b[0] == 0x99 && b[3] == 0x9A && b[4] == 0xBF && b[7] == 0x99) {
10073 /* The opposite of case 7, mixed endian: two big-endian 32-bit floats,
10074 * in little endian order: 3 2 1 0 7 6 5 4 (MSB = 7, LSB = 0)
10075 * 99 99 99 9a bf b9 99 99 */
10080 #if DOUBLESIZE == 16
10081 if (b[0] == 0x9A && b[15] == 0xBF) {
10082 /* IEEE 754 128-bit little-endian */
10086 if (b[0] == 0xBF && b[15] == 0x9A) {
10087 /* IEEE 754 128-bit big-endian */
10092 /* Then there are old mainframe/miniframe formats like VAX, IBM, and CRAY.
10093 * Whether those environments can still build Perl is debatable. */
10094 printf("-1\n"); /* unknown */
10099 if eval $compile; then
10100 doublekind=`$run ./try`
10104 case "$doublekind" in
10105 1) echo "You have IEEE 754 32-bit little endian doubles." >&4 ;;
10106 2) echo "You have IEEE 754 32-bit big endian doubles." >&4 ;;
10107 3) echo "You have IEEE 754 64-bit little endian doubles." >&4 ;;
10108 4) echo "You have IEEE 754 64-bit big endian doubles." >&4 ;;
10109 5) echo "You have IEEE 754 128-bit little endian doubles." >&4 ;;
10110 6) echo "You have IEEE 754 128-bit big endian doubles." >&4 ;;
10111 *) echo "Cannot figure out your double. You VAX, or something?" >&4 ;;
10115 : Check print/scan long double stuff
10118 if $test X"$d_longdbl" = X"$define"; then
10120 echo "Checking how to print long doubles..." >&4
10122 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
10123 $cat >try.c <<'EOCP'
10124 #include <sys/types.h>
10127 double d = 123.456;
10128 printf("%.3f\n", d);
10132 if eval $compile; then
10136 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
10137 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
10138 echo "We will use %f."
10144 if $test X"$sPRIfldbl" = X; then
10145 $cat >try.c <<'EOCP'
10146 #include <sys/types.h>
10149 long double d = 123.456;
10150 printf("%.3Lf\n", d);
10154 if eval $compile; then
10158 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
10159 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
10160 echo "We will use %Lf."
10166 if $test X"$sPRIfldbl" = X; then
10167 $cat >try.c <<'EOCP'
10168 #include <sys/types.h>
10171 long double d = 123.456;
10172 printf("%.3llf\n", d);
10176 if eval $compile; then
10180 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
10181 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
10182 echo "We will use %llf."
10188 if $test X"$sPRIfldbl" = X; then
10189 $cat >try.c <<'EOCP'
10190 #include <sys/types.h>
10193 long double d = 123.456;
10194 printf("%.3lf\n", d);
10198 if eval $compile; then
10202 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
10203 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
10204 echo "We will use %lf."
10210 if $test X"$sPRIfldbl" = X; then
10211 echo "Cannot figure out how to print long doubles." >&4
10213 sSCNfldbl=$sPRIfldbl # expect consistency
10220 case "$sPRIfldbl" in
10221 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
10222 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
10223 d_SCNfldbl="$undef";
10225 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
10226 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
10227 d_SCNfldbl="$define";
10231 : Before committing on uselongdouble, see whether that looks sane.
10232 if $test "$uselongdouble" = "$define"; then
10235 echo "Checking if your long double math functions work right..." >&4
10240 printf("%"$sPRIgldbl"\n", sqrtl(logl(expl(cosl(sinl(0.0L))))+powl(2.0L, 3.0L)));
10243 case "$osname:$gccversion" in
10244 aix:) saveccflags="$ccflags"
10245 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
10248 if eval $compile_ok; then
10252 3) echo "Your long double math functions are working correctly." >&4 ;;
10253 *) echo "Your long double math functions are broken, not using long doubles." >&4
10254 uselongdouble=$undef
10258 case "$osname:$gccversion" in
10259 aix:) ccflags="$saveccflags" ;; # restore
10263 : Check how to convert floats to strings.
10265 if test "X$d_Gconvert" = X; then
10268 echo "Checking for an efficient way to convert floats to strings."
10270 case "$uselongdouble" in
10271 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
10273 case "$d_longdbl" in
10274 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
10276 case "$d_PRIgldbl" in
10277 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
10280 #ifdef TRY_gconvert
10281 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
10282 char *myname = "gconvert";
10285 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
10286 char *myname = "gcvt";
10289 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
10290 char *myname = "qgcvt";
10291 #define DOUBLETYPE long double
10294 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
10295 #ifdef HAS_PRIgldbl
10296 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
10298 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
10301 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
10303 char *myname = "sprintf";
10307 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
10308 #define DOUBLETYPE long double
10310 #define DOUBLETYPE double
10316 #$i_stdlib I_STDLIB
10318 #include <stdlib.h>
10320 #$i_string I_STRING
10322 # include <string.h>
10324 # include <strings.h>
10327 int checkit(char *expect, char *got)
10329 if (strcmp(expect, got)) {
10330 printf("%s oddity: Expected %s, got %s\n",
10331 myname, expect, got);
10341 /* This must be 1st test on (which?) platform */
10342 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
10343 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
10344 checkit("0.1", buf);
10346 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
10347 checkit("0.01", buf);
10349 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
10350 checkit("0.001", buf);
10352 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
10353 checkit("0.0001", buf);
10355 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
10356 if (strlen(buf) > 5)
10357 checkit("9e-005", buf); /* for Microsoft ?? */
10359 checkit("9e-05", buf);
10361 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
10364 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
10365 checkit("1.1", buf);
10367 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
10368 checkit("1.01", buf);
10370 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
10371 checkit("1.001", buf);
10373 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
10374 checkit("1.0001", buf);
10376 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
10377 checkit("1.00001", buf);
10379 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
10380 checkit("1.000001", buf);
10382 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
10385 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
10386 checkit("-1", buf);
10388 /* Some Linux gcvt's give 1.e+5 here. */
10389 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
10390 checkit("100000", buf);
10392 /* Some Linux gcvt's give -1.e+5 here. */
10393 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
10394 checkit("-100000", buf);
10396 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
10397 checkit("123.456", buf);
10399 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
10400 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
10401 /* 34 should be enough to scare even long double
10402 * places into using the e notation. */
10403 if (strlen(buf) > 5)
10404 checkit("1e+034", buf); /* for Microsoft */
10406 checkit("1e+34", buf);
10408 /* For Perl, if you add additional tests here, also add them to
10409 * t/base/num.t for benefit of platforms not using Configure or
10410 * overriding d_Gconvert */
10415 : first add preferred functions to our list
10417 for xxx_convert in $gconvert_preference; do
10418 case $xxx_convert in
10419 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
10420 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
10423 : then add any others
10424 for xxx_convert in gconvert gcvt sprintf; do
10425 case "$xxx_list" in
10427 *) xxx_list="$xxx_list $xxx_convert" ;;
10431 case "$d_longdbl$uselongdouble" in
10433 : again, add preferred functions to our list first
10435 for xxx_convert in $gconvert_ld_preference; do
10436 case $xxx_convert in
10437 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
10438 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
10441 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
10442 for xxx_convert in qgcvt sprintf $xxx_list; do
10443 case "$xxx_ld_list" in
10444 $xxx_convert*|*" $xxx_convert"*) ;;
10445 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
10448 : if sprintf cannot do long doubles, move it to the end
10449 if test "$d_PRIgldbl" != "$define"; then
10450 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
10452 : if no qgcvt, remove it
10453 if test "$d_qgcvt" != "$define"; then
10454 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
10457 xxx_list="$xxx_ld_list"
10461 for xxx_convert in $xxx_list; do
10462 echo "Trying $xxx_convert..."
10463 $rm -f try try$_o core
10464 set try -DTRY_$xxx_convert
10465 if eval $compile; then
10466 echo "$xxx_convert() found." >&4
10467 if $run ./try; then
10468 echo "I'll use $xxx_convert to convert floats into a string." >&4
10471 echo "...But $xxx_convert didn't work as I expected."
10475 echo "$xxx_convert NOT found." >&4
10479 if test X$xxx_convert = X; then
10480 echo "*** WHOA THERE!!! ***" >&4
10481 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
10482 xxx_convert=sprintf
10485 case "$xxx_convert" in
10486 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
10487 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
10488 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
10489 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
10490 "$define$define$define")
10491 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
10492 "$define$define$undef")
10493 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
10494 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
10502 : see if _fwalk exists
10506 : Initialize h_fcntl
10509 : Initialize h_sysfile
10512 : access call always available on UNIX
10513 set access d_access
10516 : locate the flags for 'access()'
10517 case "$d_access" in
10520 $cat >access.c <<EOCP
10521 #include <sys/types.h>
10526 #include <sys/file.h>
10529 #include <unistd.h>
10531 #$i_stdlib I_STDLIB
10533 #include <stdlib.h>
10539 : check sys/file.h first, no particular reason here
10540 if $test `./findhdr sys/file.h` && \
10541 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
10543 echo "<sys/file.h> defines the *_OK access constants." >&4
10544 elif $test `./findhdr fcntl.h` && \
10545 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
10547 echo "<fcntl.h> defines the *_OK access constants." >&4
10548 elif $test `./findhdr unistd.h` && \
10549 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
10550 echo "<unistd.h> defines the *_OK access constants." >&4
10552 echo "I can't find the four *_OK access constants--I'll use mine." >&4
10558 : see if accessx exists
10559 set accessx d_accessx
10562 : see if acosh exists
10566 : see if aintl exists
10570 : see if alarm exists
10574 : see if 64bit time functions exists
10576 set ctime64 d_ctime64
10579 set localtime64 d_localtime64
10582 set gmtime64 d_gmtime64
10585 set mktime64 d_mktime64
10588 set difftime64 d_difftime64
10591 set asctime64 d_asctime64
10594 : see if POSIX threads are available
10595 set pthread.h i_pthread
10598 : define a function to check prototypes
10599 $cat > protochk <<EOSH
10602 optimize="$optimize"
10604 prototype="$prototype"
10607 usethreads=$usethreads
10608 i_pthread=$i_pthread
10609 pthread_h_first=$pthread_h_first
10612 $cat >> protochk <<'EOSH'
10617 while test $# -ge 2; do
10619 $define) echo "#include <$2>" >> try.c ;;
10620 literal) echo "$2" >> try.c ;;
10622 # Extra magic for the benefit of systems that need pthread.h
10623 # to be included early to correctly detect threadsafe functions.
10624 # Such functions must guarantee themselves, though, that the usethreads
10625 # and i_pthread have been defined, before calling protochk.
10626 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
10627 echo "#include <pthread.h>" >> try.c
10632 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
10633 cat >> try.c <<'EOCP'
10634 #ifdef CAN_PROTOTYPE
10635 #define _(args) args
10640 echo "$foo" >> try.c
10641 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
10642 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
10648 $eunicefix protochk
10650 : Define hasproto macro for Configure internal use
10651 hasproto='varname=$1; func=$2; shift; shift;
10652 while $test $# -ge 2; do
10654 $define) echo "#include <$2>";;
10658 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
10659 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
10660 echo "$func() prototype found.";
10663 echo "$func() prototype NOT found.";
10670 : see if sys/types.h has to be included
10671 set sys/types.h i_systypes
10674 : see if sys/select.h has to be included
10675 set sys/select.h i_sysselct
10678 : Define hasfield macro for Configure internal use
10679 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
10680 while $test $# -ge 2; do
10682 $define) echo "#include <$2>";;
10686 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
10688 if eval $compile; then
10697 : see if we should include time.h, sys/time.h, or both
10699 if test "X$timeincl" = X; then
10700 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
10701 $echo $n "I'm now running the test program...$c"
10703 #include <sys/types.h>
10708 #ifdef SYSTIMEKERNEL
10711 #include <sys/time.h>
10714 #include <sys/select.h>
10716 #$i_stdlib I_STDLIB
10718 #include <stdlib.h>
10724 struct timeval bar;
10727 struct timezone tzp;
10729 if (foo.tm_sec == foo.tm_sec)
10732 if (bar.tv_sec == bar.tv_sec)
10739 for s_timezone in '-DS_TIMEZONE' ''; do
10741 for s_timeval in '-DS_TIMEVAL' ''; do
10742 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10743 for i_time in '' '-DI_TIME'; do
10744 for i_systime in '-DI_SYSTIME' ''; do
10747 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10748 if eval $compile; then
10749 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
10753 $echo $n "Succeeded with $flags$c"
10765 *SYSTIMEKERNEL*) i_systimek="$define"
10766 timeincl=`./findhdr sys/time.h`
10767 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10768 *) i_systimek="$undef";;
10771 *I_TIME*) i_time="$define"
10772 timeincl=`./findhdr time.h`" $timeincl"
10773 echo "We'll include <time.h>." >&4;;
10774 *) i_time="$undef";;
10777 *I_SYSTIME*) i_systime="$define"
10778 timeincl=`./findhdr sys/time.h`" $timeincl"
10779 echo "We'll include <sys/time.h>." >&4;;
10780 *) i_systime="$undef";;
10784 : see if struct tm knows about tm_zone
10785 case "$i_systime$i_time" in
10788 echo "Checking to see if your struct tm has tm_zone field..." >&4
10789 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
10797 case "$d_tm_tm_zone" in
10798 "$define") echo "Yes, it does." ;;
10799 *) echo "No, it doesn't." ;;
10801 : see if struct tm knows about tm_gmtoff
10802 case "$i_systime$i_time" in
10805 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
10806 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
10814 case "$d_tm_tm_gmtoff" in
10815 "$define") echo "Yes, it does." ;;
10816 *) echo "No, it doesn't." ;;
10819 : see if asctime_r exists
10820 set asctime_r d_asctime_r
10822 case "$d_asctime_r" in
10824 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10825 case "$d_asctime_r_proto:$usethreads" in
10826 ":define") d_asctime_r_proto=define
10827 set d_asctime_r_proto asctime_r $hdrs
10831 case "$d_asctime_r_proto" in
10833 case "$asctime_r_proto" in
10834 ''|0) try='char* asctime_r(const struct tm*, char*);'
10835 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SB ;;
10837 case "$asctime_r_proto" in
10838 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
10839 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SBI ;;
10841 case "$asctime_r_proto" in
10842 ''|0) try='int asctime_r(const struct tm*, char*);'
10843 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SB ;;
10845 case "$asctime_r_proto" in
10846 ''|0) try='int asctime_r(const struct tm*, char*, int);'
10847 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SBI ;;
10849 case "$asctime_r_proto" in
10850 ''|0) d_asctime_r=undef
10852 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
10853 * ) case "$asctime_r_proto" in
10854 REENTRANT_PROTO*) ;;
10855 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
10857 echo "Prototype: $try" ;;
10860 *) case "$usethreads" in
10861 define) echo "asctime_r has no prototype, not using it." >&4 ;;
10868 *) asctime_r_proto=0
10872 : see if asinh exists
10876 : see if atanh exists
10880 : see if atolf exists
10884 : see if atoll exists
10888 : Look for GCC-style attribute format
10889 case "$d_attribute_format" in
10892 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
10893 $cat >attrib.c <<'EOCP'
10895 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
10897 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10898 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10899 echo "Your C compiler doesn't support __attribute__((format))."
10902 echo "Your C compiler supports __attribute__((format))."
10906 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10910 *) val="$d_attribute_format" ;;
10912 set d_attribute_format
10916 : Look for GCC-style attribute format with null format allowed
10917 case "$d_printf_format_null" in
10918 '') case "$d_attribute_format" in
10921 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
10922 $cat >attrib.c <<EOCP
10924 #$i_stdlib I_STDLIB
10926 #include <stdlib.h>
10928 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
10929 int null_printf (char* pat,...) { return (int)pat; }
10930 int main () { exit(null_printf(NULL)); }
10932 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
10933 : run the executable in case it produces a run-time warning
10934 if $run ./attrib >>attrib.out 2>&1; then
10935 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10936 echo "Your C compiler doesn't allow __printf__ format to be null."
10939 echo "Your C compiler allows __printf__ format to be null."
10943 echo "Your C compiler executable failed with __printf__ format null."
10947 echo "Your C compiler fails with __printf__ format null."
10954 *) val="$d_printf_format_null" ;;
10956 set d_printf_format_null
10960 : Look for GCC-style attribute malloc
10961 case "$d_attribute_malloc" in
10964 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
10965 $cat >attrib.c <<'EOCP'
10967 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
10969 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10970 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10971 echo "Your C compiler doesn't support __attribute__((malloc))."
10974 echo "Your C compiler supports __attribute__((malloc))."
10978 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10982 *) val="$d_attribute_malloc" ;;
10984 set d_attribute_malloc
10988 : Look for GCC-style attribute nonnull
10989 case "$d_attribute_nonnull" in
10992 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
10993 $cat >attrib.c <<'EOCP'
10995 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
10997 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10998 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10999 echo "Your C compiler doesn't support __attribute__((nonnull))."
11002 echo "Your C compiler supports __attribute__((nonnull))."
11006 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11010 *) val="$d_attribute_nonnull" ;;
11012 set d_attribute_nonnull
11016 : Look for GCC-style attribute noreturn
11017 case "$d_attribute_noreturn" in
11020 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
11021 $cat >attrib.c <<'EOCP'
11023 void fall_over_dead( void ) __attribute__((noreturn));
11025 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11026 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11027 echo "Your C compiler doesn't support __attribute__((noreturn))."
11030 echo "Your C compiler supports __attribute__((noreturn))."
11034 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11038 *) val="$d_attribute_noreturn" ;;
11040 set d_attribute_noreturn
11044 : Look for GCC-style attribute pure
11045 case "$d_attribute_pure" in
11048 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
11049 $cat >attrib.c <<'EOCP'
11051 int square( int n ) __attribute__((pure));
11053 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11054 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11055 echo "Your C compiler doesn't support __attribute__((pure))."
11058 echo "Your C compiler supports __attribute__((pure))."
11062 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11066 *) val="$d_attribute_pure" ;;
11068 set d_attribute_pure
11072 : Look for GCC-style attribute unused
11073 case "$d_attribute_unused" in
11076 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
11077 $cat >attrib.c <<'EOCP'
11079 int do_something( int dummy __attribute__((unused)), int n );
11081 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11082 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11083 echo "Your C compiler doesn't support __attribute__((unused))."
11086 echo "Your C compiler supports __attribute__((unused))."
11090 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11094 *) val="$d_attribute_unused" ;;
11096 set d_attribute_unused
11100 : Look for GCC-style attribute deprecated
11101 case "$d_attribute_deprecated" in
11104 echo "Checking whether your compiler can handle __attribute__((deprecated)) ..." >&4
11105 $cat >attrib.c <<'EOCP'
11107 int I_am_deprecated(void) __attribute__((deprecated));
11109 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11110 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11111 echo "Your C compiler doesn't support __attribute__((deprecated))."
11114 echo "Your C compiler supports __attribute__((deprecated))."
11118 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11122 *) val="$d_attribute_deprecated" ;;
11124 set d_attribute_deprecated
11128 : Look for GCC-style attribute warn_unused_result
11129 case "$d_attribute_warn_unused_result" in
11132 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
11133 $cat >attrib.c <<'EOCP'
11135 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
11137 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11138 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11139 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
11142 echo "Your C compiler supports __attribute__((warn_unused_result))."
11146 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11150 *) val="$d_attribute_warn_unused_result" ;;
11152 set d_attribute_warn_unused_result
11156 : see if bcmp exists
11160 : see if bcopy exists
11164 : see if getpgrp exists
11165 set getpgrp d_getpgrp
11168 case "$d_getpgrp" in
11171 echo "Checking to see which flavor of getpgrp is in use..."
11173 #$i_unistd I_UNISTD
11174 #include <sys/types.h>
11176 # include <unistd.h>
11178 #$i_stdlib I_STDLIB
11180 #include <stdlib.h>
11184 if (getuid() == 0) {
11185 printf("(I see you are running Configure as super-user...)\n");
11188 #ifdef TRY_BSD_PGRP
11189 if (getpgrp(1) == 0)
11198 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11199 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
11201 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11202 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
11205 echo "I can't seem to compile and run the test program."
11207 xxx="a USG one, i.e. you use getpgrp()."
11209 # SVR4 systems can appear rather BSD-ish.
11210 case "$i_unistd" in
11212 xxx="a BSD one, i.e. you use getpgrp(pid)."
11216 xxx="probably a USG one, i.e. you use getpgrp()."
11221 echo "Assuming your getpgrp is $xxx" >&4
11230 : see if setpgrp exists
11231 set setpgrp d_setpgrp
11234 case "$d_setpgrp" in
11237 echo "Checking to see which flavor of setpgrp is in use..."
11239 #$i_unistd I_UNISTD
11240 #include <sys/types.h>
11242 # include <unistd.h>
11244 #$i_stdlib I_STDLIB
11246 #include <stdlib.h>
11250 if (getuid() == 0) {
11251 printf("(I see you are running Configure as super-user...)\n");
11254 #ifdef TRY_BSD_PGRP
11255 if (-1 == setpgrp(1, 1))
11258 if (setpgrp() != -1)
11264 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11265 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
11267 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11268 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
11271 echo "(I can't seem to compile and run the test program.)"
11273 xxx="a USG one, i.e. you use setpgrp()."
11275 # SVR4 systems can appear rather BSD-ish.
11276 case "$i_unistd" in
11278 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
11282 xxx="probably a USG one, i.e. you use setpgrp()."
11287 echo "Assuming your setpgrp is $xxx" >&4
11296 : Look for GCC-style __builtin_choose_expr
11297 case "$d_builtin_choose_expr" in
11300 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
11301 $cat >try.c <<'EOCP'
11302 #include <assert.h>
11303 #include <stdlib.h>
11306 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
11309 assert( SYRINX(1) == 2112 );
11310 assert( SYRINX(1) != 5150 );
11311 assert( SYRINX(0) == 5150 );
11312 assert( SYRINX(0) != 2112 );
11313 puts( "All good!" );
11319 if eval $compile && $run ./try; then
11320 echo "Your C compiler supports __builtin_choose_expr."
11323 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
11327 *) val="$d_builtin_choose_expr" ;;
11330 set d_builtin_choose_expr
11334 : Look for GCC-style __builtin_expect
11335 case "$d_builtin_expect" in
11338 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
11339 $cat >try.c <<'EOCP'
11342 if ( __builtin_expect(n, 0) ) n = 1;
11343 /* Remember shell exit code truth is 0, C truth is non-zero */
11348 if eval $compile && $run ./try; then
11349 echo "Your C compiler supports __builtin_expect."
11352 echo "Your C compiler doesn't seem to understand __builtin_expect."
11356 *) val="$d_builtin_expect" ;;
11359 set d_builtin_expect
11363 : see if bzero exists
11367 : see if stdarg is available
11369 if $test `./findhdr stdarg.h`; then
11370 echo "<stdarg.h> found." >&4
11373 echo "<stdarg.h> NOT found." >&4
11377 : see if varargs is available
11379 if $test `./findhdr varargs.h`; then
11380 echo "<varargs.h> found." >&4
11382 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
11385 : set up the varargs testing programs
11386 $cat > varargs.c <<EOP
11388 #include <stdarg.h>
11391 #include <varargs.h>
11395 int f(char *p, ...)
11409 p = va_arg(ap, char *);
11415 $cat > varargs <<EOP
11417 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
11426 : now check which varargs header should be included
11432 if `./varargs I_STDARG`; then
11434 elif `./varargs I_VARARGS`; then
11439 if `./varargs I_VARARGS`; then
11447 echo "*** WHOA THERE!!! ***" >&4
11448 echo " Your C compiler \"$cc\" doesn't seem to support stdarg or varargs!" >&4
11449 case "$knowitall" in
11451 echo " I'm giving up; maybe you can try again with a different compiler?" >&4
11455 echo "I could not find the definition for va_dcl... You have problems..." >&4
11456 val="$undef"; set i_stdarg; eval $setvar
11457 val="$undef"; set i_varargs; eval $setvar
11462 case "$i_varhdr" in
11464 val="$define"; set i_stdarg; eval $setvar
11465 val="$undef"; set i_varargs; eval $setvar
11468 val="$undef"; set i_stdarg; eval $setvar
11469 val="$define"; set i_varargs; eval $setvar
11472 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
11476 : see if the Compiler supports C99 variadic macros
11477 case "$i_stdarg$i_stdlib" in
11479 echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
11482 #include <stdarg.h>
11484 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
11488 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
11494 if eval $compile && $run ./try 2>&1 >/dev/null; then
11495 case "`$run ./try`" in
11497 echo "You have C99 variadic macros." >&4
11498 d_c99_variadic_macros="$define"
11501 echo "You don't have functional C99 variadic macros." >&4
11502 d_c99_variadic_macros="$undef"
11506 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
11507 d_c99_variadic_macros="$undef"
11512 echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
11513 d_c99_variadic_macros="$undef"
11517 : see if signal is declared as pointer to function returning int or void
11519 xxx=`./findhdr signal.h`
11520 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
11521 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
11522 echo "You have int (*signal())() instead of void." >&4
11524 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
11525 echo "You have void (*signal())()." >&4
11527 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
11528 echo "You have int (*signal())() instead of void." >&4
11530 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
11531 echo "You have void (*signal())()." >&4
11534 case "$d_voidsig" in
11536 echo "I can't determine whether signal handler returns void or int..." >&4
11538 rp="What type does your signal handler return?"
11541 v*) val="$define";;
11545 echo "As you already told me, signal handler returns void." >&4
11548 *) echo "As you already told me, signal handler returns int." >&4
11555 case "$d_voidsig" in
11556 "$define") signal_t="void";;
11557 *) signal_t="int";;
11561 : check for ability to cast large floats to 32-bit ints.
11563 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
11564 if $test "$intsize" -ge 4; then
11571 #$i_stdlib I_STDLIB
11573 #include <stdlib.h>
11575 #include <sys/types.h>
11576 #include <signal.h>
11577 $signal_t blech(int s) { exit(3); }
11584 signal(SIGFPE, blech);
11586 /* Don't let compiler optimize the test away. Store the number
11587 in a writable string for gcc to pass to sscanf under HP-UX.
11589 sprintf(str, "2147483647");
11590 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
11594 /* x86 processors will probably give 0x8000 0000, which is a
11595 sign change. We don't want that. We want to mimic SPARC
11596 behavior here, which is to preserve the sign and give
11599 if (i32 != ($xxx) f)
11605 if eval $compile_ok; then
11606 $run ./try 2>/dev/null
11609 echo "(I can't seem to compile the test program--assuming it can't)"
11614 echo "Yup, it can."
11617 echo "Nope, it can't."
11624 : check for ability to cast negative floats to unsigned
11626 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
11629 #$i_stdlib I_STDLIB
11631 #include <stdlib.h>
11633 #include <sys/types.h>
11634 #include <signal.h>
11635 $signal_t blech(int s) { exit(7); }
11636 $signal_t blech_in_list(int s) { exit(4); }
11637 unsigned long dummy_long(unsigned long p) { return p; }
11638 unsigned int dummy_int(unsigned int p) { return p; }
11639 unsigned short dummy_short(unsigned short p) { return p; }
11643 unsigned long along;
11645 unsigned short ashort;
11649 /* Frustrate gcc-2.7.2's optimizer which failed this test with
11650 a direct f = -123. assignment. gcc-2.8.0 reportedly
11651 optimized the whole file away
11653 /* Store the number in a writable string for gcc to pass to
11654 sscanf under HP-UX.
11656 sprintf(str, "-123");
11657 sscanf(str, "%lf", &f); /* f = -123.; */
11659 signal(SIGFPE, blech);
11660 along = (unsigned long)f;
11661 aint = (unsigned int)f;
11662 ashort = (unsigned short)f;
11663 if (along != (unsigned long)-123)
11665 if (aint != (unsigned int)-123)
11667 if (ashort != (unsigned short)-123)
11669 sprintf(str, "1073741824.");
11670 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
11673 along = (unsigned long)f;
11674 if (along != 0x80000000)
11678 along = (unsigned long)f;
11679 if (along != 0x7fffffff)
11683 along = (unsigned long)f;
11684 if (along != 0x80000001)
11688 signal(SIGFPE, blech_in_list);
11689 sprintf(str, "123.");
11690 sscanf(str, "%lf", &f); /* f = 123.; */
11691 along = dummy_long((unsigned long)f);
11692 aint = dummy_int((unsigned int)f);
11693 ashort = dummy_short((unsigned short)f);
11694 if (along != (unsigned long)123)
11696 if (aint != (unsigned int)123)
11698 if (ashort != (unsigned short)123)
11705 if eval $compile_ok; then
11706 $run ./try 2>/dev/null
11709 echo "(I can't seem to compile the test program--assuming it can't)"
11712 case "$castflags" in
11714 echo "Yup, it can."
11717 echo "Nope, it can't."
11724 : see if cbrt exists
11728 : see if vprintf exists
11730 if set vprintf val -f d_vprintf; eval $csym; $val; then
11731 echo 'vprintf() found.' >&4
11734 #$i_stdarg I_STDARG /* Only one of these can be defined by i_varhrd */
11735 #$i_varargs I_VARARGS
11737 #$i_stdlib I_STDLIB
11738 #$i_unistd I_UNISTD
11741 # include <stdarg.h>
11742 #else /* I_VARARGS */
11743 # include <varargs.h>
11747 # include <unistd.h>
11751 # include <stdlib.h>
11754 #include <stdio.h> /* vsprintf prototype */
11757 void xxx(int n, ...)
11762 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11764 int main() { xxx(1, "foo"); }
11766 #else /* I_VARARGS */
11774 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11776 int main() { xxx("foo"); }
11782 if eval $compile_ok; then
11783 if $run ./try; then
11784 echo "Your vsprintf() returns (int)." >&4
11787 echo "Your vsprintf() returns (char*)." >&4
11791 echo 'I am unable to compile the vsprintf() test program.' >&4
11792 # We shouldn't get here. If we do, assume the standard signature,
11793 # not the old BSD one.
11794 echo 'Guessing that vsprintf() returns (int).' >&4
11798 echo 'vprintf() NOT found.' >&4
11809 : see if chown exists
11813 : see if chroot exists
11814 set chroot d_chroot
11817 : see if chsize exists
11818 set chsize d_chsize
11821 : see if class exists
11825 : see if clearenv exists
11826 set clearenv d_clearenv
11829 : Define hasstruct macro for Configure internal use
11830 hasstruct='varname=$1; struct=$2; shift; shift;
11831 while $test $# -ge 2; do
11833 $define) echo "#include <$2>";;
11837 echo "int main () { struct $struct foo; }" >> try.c;
11839 if eval $compile; then
11848 : see whether socket exists
11852 $echo $n "Hmm... $c" >&4
11853 if set socket val -f d_socket; eval $csym; $val; then
11854 echo "Looks like you have Berkeley networking support." >&4
11856 if set setsockopt val -f; eval $csym; $val; then
11859 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
11860 d_oldsock="$define"
11863 if $contains socklib libc.list >/dev/null 2>&1; then
11864 echo "Looks like you have Berkeley networking support." >&4
11866 : we will have to assume that it supports the 4.2 BSD interface
11869 echo "You don't have Berkeley networking in libc$_a..." >&4
11870 if test "X$d_socket" = "X$define"; then
11871 echo "...but you seem to believe that you have sockets." >&4
11873 for net in net socket
11875 if test -f $sysroot/usr/lib/lib$net$_a; then
11876 ( ($nm $nm_opt $sysroot/usr/lib/lib$net$_a | eval $nm_extract) || \
11877 $ar t $sysroot/usr/lib/lib$net$_a) 2>/dev/null >> libc.list
11878 if $contains socket libc.list >/dev/null 2>&1; then
11883 echo "...but the Wollongong group seems to have hacked it in." >&4
11884 sockethdr="-I$sysroot/usr/netinclude"
11887 echo "Found Berkeley sockets interface in lib$net." >&4
11888 if $contains setsockopt libc.list >/dev/null 2>&1; then
11891 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
11892 d_oldsock="$define"
11898 if test "X$d_socket" != "X$define"; then
11899 echo "or anywhere else I see." >&4
11907 : see if socketpair exists
11908 set socketpair d_sockpair
11913 echo "Checking the availability sa_len in the sock struct ..." >&4
11915 #include <sys/types.h>
11916 #include <sys/socket.h>
11918 struct sockaddr sa;
11919 return (sa.sa_len);
11923 set try; if eval $compile; then
11926 set d_sockaddr_sa_len; eval $setvar
11930 echo "Checking the availability struct sockaddr_in6 ..." >&4
11932 #include <sys/types.h>
11933 #include <sys/socket.h>
11934 #include <netinet/in.h>
11936 struct sockaddr_in6 sin6;
11937 return (sin6.sin6_family);
11941 set try; if eval $compile; then
11944 set d_sockaddr_in6; eval $setvar
11948 echo "Checking the availability sin6_scope_id in struct sockaddr_in6 ..." >&4
11950 #include <sys/types.h>
11951 #include <sys/socket.h>
11952 #include <netinet/in.h>
11954 struct sockaddr_in6 sin6;
11955 return (sin6.sin6_scope_id);
11959 set try; if eval $compile; then
11962 set d_sin6_scope_id; eval $setvar
11966 echo "Checking the availability struct ip_mreq ..." >&4
11968 #include <sys/types.h>
11969 #include <sys/socket.h>
11970 #include <netinet/in.h>
11972 struct ip_mreq mreq;
11973 return (mreq.imr_multiaddr.s_addr);
11977 set try; if eval $compile; then
11980 set d_ip_mreq; eval $setvar
11984 echo "Checking the availability struct ip_mreq_source ..." >&4
11986 #include <sys/types.h>
11987 #include <sys/socket.h>
11988 #include <netinet/in.h>
11990 struct ip_mreq_source mreq;
11991 return (mreq.imr_multiaddr.s_addr);
11995 set try; if eval $compile; then
11998 set d_ip_mreq_source; eval $setvar
12002 echo "Checking the availability struct ipv6_mreq ..." >&4
12004 #include <sys/types.h>
12005 #include <sys/socket.h>
12006 #include <netinet/in.h>
12008 struct ipv6_mreq mreq;
12009 return (mreq.ipv6mr_interface);
12013 set try; if eval $compile; then
12016 set d_ipv6_mreq; eval $setvar
12020 echo "Checking the availability struct ipv6_mreq_source ..." >&4
12022 #include <sys/types.h>
12023 #include <sys/socket.h>
12024 #include <netinet/in.h>
12026 struct ipv6_mreq_source mreq;
12027 return (mreq.imr_multiaddr.s_addr);
12031 set try; if eval $compile; then
12034 set d_ipv6_mreq_source; eval $setvar
12038 echo "Checking the availability of certain socket constants..." >&4
12039 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
12040 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
12042 #include <sys/types.h>
12043 #include <sys/socket.h>
12049 set try; if eval $compile; then
12052 set d_${enum}; eval $setvar
12056 : see if this is a sys/uio.h system
12057 set sys/uio.h i_sysuio
12060 : Check for cmsghdr support
12062 echo "Checking to see if your system supports struct cmsghdr..." >&4
12063 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
12065 case "$d_cmsghdr_s" in
12066 "$define") echo "Yes, it does." ;;
12067 *) echo "No, it doesn't." ;;
12071 : check for const keyword
12073 echo 'Checking to see if your C compiler knows about "const"...' >&4
12074 $cat >const.c <<'EOCP'
12075 typedef struct spug { int drokk; } spug;
12079 const spug y = { 0 };
12082 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
12084 echo "Yup, it does."
12087 echo "Nope, it doesn't."
12092 : see if copysign exists
12093 set copysign d_copysign
12096 : see if copysignl exists
12097 set copysignl d_copysignl
12100 : see if crypt exists
12105 $define) cryptlib='' ;;
12106 *) if set crypt val -f d_crypt; eval $csym; $val; then
12107 echo 'crypt() found.' >&4
12111 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
12112 if $test -z "$cryptlib"; then
12113 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
12117 if $test -z "$cryptlib"; then
12118 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
12122 if $test -z "$cryptlib"; then
12123 cryptlib=`./loc libcrypt$_a "" $libpth`
12127 if $test -z "$cryptlib"; then
12128 echo 'crypt() NOT found.' >&4
12139 : see if this is a crypt.h system
12140 set crypt.h i_crypt
12143 : see if crypt_r exists
12144 set crypt_r d_crypt_r
12146 case "$d_crypt_r" in
12148 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
12149 case "$d_crypt_r_proto:$usethreads" in
12150 ":define") d_crypt_r_proto=define
12151 set d_crypt_r_proto crypt_r $hdrs
12155 case "$d_crypt_r_proto" in
12157 case "$crypt_r_proto" in
12158 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
12159 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCS ;;
12161 case "$crypt_r_proto" in
12162 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
12163 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCD ;;
12165 case "$crypt_r_proto" in
12166 ''|0) d_crypt_r=undef
12168 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
12169 * ) case "$crypt_r_proto" in
12170 REENTRANT_PROTO*) ;;
12171 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
12173 echo "Prototype: $try" ;;
12176 *) case "$usethreads" in
12177 define) echo "crypt_r has no prototype, not using it." >&4 ;;
12188 : get csh whereabouts
12190 'csh') val="$undef" ;;
12191 *) val="$define" ;;
12195 : Respect a hint or command line value for full_csh.
12196 case "$full_csh" in
12197 '') full_csh=$csh ;;
12200 : see if ctermid exists
12201 set ctermid d_ctermid
12204 : see if ctermid_r exists
12205 set ctermid_r d_ctermid_r
12207 case "$d_ctermid_r" in
12209 hdrs="$i_systypes sys/types.h define stdio.h "
12210 case "$d_ctermid_r_proto:$usethreads" in
12211 ":define") d_ctermid_r_proto=define
12212 set d_ctermid_r_proto ctermid_r $hdrs
12216 case "$d_ctermid_r_proto" in
12218 case "$ctermid_r_proto" in
12219 ''|0) try='char* ctermid_r(char*);'
12220 ./protochk "$extern_C $try" $hdrs && ctermid_r_proto=B_B ;;
12222 case "$ctermid_r_proto" in
12223 ''|0) d_ctermid_r=undef
12225 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
12226 * ) case "$ctermid_r_proto" in
12227 REENTRANT_PROTO*) ;;
12228 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
12230 echo "Prototype: $try" ;;
12233 *) case "$usethreads" in
12234 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
12241 *) ctermid_r_proto=0
12245 : see if ctime_r exists
12246 set ctime_r d_ctime_r
12248 case "$d_ctime_r" in
12250 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
12251 case "$d_ctime_r_proto:$usethreads" in
12252 ":define") d_ctime_r_proto=define
12253 set d_ctime_r_proto ctime_r $hdrs
12257 case "$d_ctime_r_proto" in
12259 case "$ctime_r_proto" in
12260 ''|0) try='char* ctime_r(const time_t*, char*);'
12261 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SB ;;
12263 case "$ctime_r_proto" in
12264 ''|0) try='char* ctime_r(const time_t*, char*, int);'
12265 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SBI ;;
12267 case "$ctime_r_proto" in
12268 ''|0) try='int ctime_r(const time_t*, char*);'
12269 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SB ;;
12271 case "$ctime_r_proto" in
12272 ''|0) try='int ctime_r(const time_t*, char*, int);'
12273 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SBI ;;
12275 case "$ctime_r_proto" in
12276 ''|0) d_ctime_r=undef
12278 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
12279 * ) case "$ctime_r_proto" in
12280 REENTRANT_PROTO*) ;;
12281 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
12283 echo "Prototype: $try" ;;
12286 *) case "$usethreads" in
12287 define) echo "ctime_r has no prototype, not using it." >&4 ;;
12298 : see if cuserid exists
12299 set cuserid d_cuserid
12302 : see if this is a limits.h system
12303 set limits.h i_limits
12306 : See if number of significant digits in a double precision number is known
12308 $cat >dbl_dig.c <<EOM
12309 #$i_limits I_LIMITS
12312 #include <limits.h>
12318 printf("Contains DBL_DIG");
12321 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
12322 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
12323 echo "DBL_DIG found." >&4
12326 echo "DBL_DIG NOT found." >&4
12333 : see if dbm.h is available
12334 : see if dbmclose exists
12335 set dbmclose d_dbmclose
12338 case "$d_dbmclose" in
12348 *) set rpcsvc/dbm.h i_rpcsvcdbm
12353 *) echo "We won't be including <dbm.h>"
12363 : see if prototype for dbminit is available
12365 set d_dbminitproto dbminit $i_dbm dbm.h
12368 : see if difftime exists
12369 set difftime d_difftime
12372 : see if this is a dirent system
12374 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
12376 echo "<dirent.h> found." >&4
12379 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
12380 echo "<sys/dir.h> found." >&4
12383 xinc=`./findhdr sys/ndir.h`
12385 echo "<dirent.h> NOT found." >&4
12390 : Look for type of directory structure.
12392 $cppstdin $cppflags $cppminus < "$xinc" > try.c
12394 case "$direntrytype" in
12396 case "$i_dirent" in
12397 $define) guess1='struct dirent' ;;
12398 *) guess1='struct direct' ;;
12401 *) guess1="$direntrytype"
12406 'struct dirent') guess2='struct direct' ;;
12407 *) guess2='struct dirent' ;;
12410 if $contains "$guess1" try.c >/dev/null 2>&1; then
12411 direntrytype="$guess1"
12412 echo "Your directory entries are $direntrytype." >&4
12413 elif $contains "$guess2" try.c >/dev/null 2>&1; then
12414 direntrytype="$guess2"
12415 echo "Your directory entries seem to be $direntrytype." >&4
12417 echo "I don't recognize your system's directory entries." >&4
12418 rp="What type is used for directory entries on this system?"
12421 direntrytype="$ans"
12425 : see if the directory entry stores field length
12427 $cppstdin $cppflags $cppminus < "$xinc" > try.c
12428 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
12429 echo "Good, your directory entry keeps length information in d_namlen." >&4
12432 echo "Your directory entry does not know about the d_namlen field." >&4
12439 : Look for DIR.dd_fd
12440 case "$i_dirent" in
12442 echo "Checking to see if DIR has a dd_fd member variable" >&4
12444 #$i_stdlib I_STDLIB
12446 #include <stdlib.h>
12448 #include <dirent.h>
12458 if eval $compile; then
12459 echo "Yes, it does."
12462 echo "No, it does not."
12467 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
12475 : see if this is an sysdir system
12476 set sys/dir.h i_sysdir
12479 : see if this is an sysndir system
12480 set sys/ndir.h i_sysndir
12485 $cat >dirfd.c <<EOM
12487 #$i_stdlib I_STDLIB
12489 #include <stdlib.h>
12491 #$i_dirent I_DIRENT /**/
12492 #$i_sysdir I_SYS_DIR /**/
12493 #$i_sysndir I_SYS_NDIR /**/
12494 #$i_systypes I_SYS_TYPES /**/
12495 #if defined(I_SYS_TYPES)
12496 #include <sys/types.h>
12498 #if defined(I_DIRENT)
12499 #include <dirent.h>
12502 #include <sys/ndir.h>
12506 #include <ndir.h> /* may be wrong in the future */
12508 #include <sys/dir.h>
12514 DIR *dirp = opendir(".");
12515 if (dirfd(dirp) >= 0)
12523 if eval $compile; then
12527 $define) echo "dirfd() found." >&4 ;;
12528 *) echo "dirfd() NOT found." >&4 ;;
12534 : see if dladdr exists
12535 set dladdr d_dladdr
12538 : see if dlerror exists
12541 set dlerror d_dlerror
12545 : see if dlfcn is available
12546 set dlfcn.h i_dlfcn
12549 : Check what extension to use for shared libs
12554 On a few systems, the dynamically loaded modules that perl generates and uses
12555 will need a different extension than shared libs. The default will probably
12561 *) dflt="$dlext" ;;
12563 rp='What is the extension of dynamically loaded modules'
12572 : Check if dlsym need a leading underscore
12578 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
12579 $cat >dyna.c <<'EOM'
12586 #$i_stdlib I_STDLIB
12588 #include <stdlib.h>
12592 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
12594 #include <sys/types.h>
12599 extern int fred() ;
12608 int mode = RTLD_LAZY ;
12610 handle = dlopen("./dyna.$dlext", mode) ;
12611 if (handle == NULL) {
12616 symbol = dlsym(handle, "fred") ;
12617 if (symbol == NULL) {
12618 /* try putting a leading underscore */
12619 symbol = dlsym(handle, "_fred") ;
12620 if (symbol == NULL) {
12633 : Call the object file tmp-dyna.o in case dlext=o.
12634 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
12635 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
12636 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
12637 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
12640 1) echo "Test program failed using dlopen." >&4
12641 echo "Perhaps you should not use dynamic loading." >&4;;
12642 2) echo "Test program failed using dlsym." >&4
12643 echo "Perhaps you should not use dynamic loading." >&4;;
12644 3) echo "dlsym needs a leading underscore" >&4
12646 4) echo "dlsym doesn't need a leading underscore." >&4;;
12649 echo "I can't compile and run the test program." >&4
12650 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
12655 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
12660 : see if drand48_r exists
12661 set drand48_r d_drand48_r
12663 case "$d_drand48_r" in
12665 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
12666 case "$d_drand48_r_proto:$usethreads" in
12667 ":define") d_drand48_r_proto=define
12668 set d_drand48_r_proto drand48_r $hdrs
12672 case "$d_drand48_r_proto" in
12674 case "$drand48_r_proto" in
12675 ''|0) try='int drand48_r(struct drand48_data*, double*);'
12676 ./protochk "$extern_C $try" $hdrs && drand48_r_proto=I_ST ;;
12678 case "$drand48_r_proto" in
12679 ''|0) d_drand48_r=undef
12681 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
12682 * ) case "$drand48_r_proto" in
12683 REENTRANT_PROTO*) ;;
12684 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
12686 echo "Prototype: $try" ;;
12689 *) case "$usethreads" in
12690 define) echo "drand48_r has no prototype, not using it." >&4 ;;
12697 *) drand48_r_proto=0
12701 : see if prototype for drand48 is available
12703 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
12706 : see if dup2 exists
12710 : see if eaccess exists
12711 set eaccess d_eaccess
12714 : see if endgrent exists
12715 set endgrent d_endgrent
12718 : see if this is an grp system
12724 xxx=`./findhdr grp.h`
12725 $cppstdin $cppflags $cppminus < $xxx >$$.h
12727 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
12739 set d_grpasswd; eval $setvar
12743 : see if endgrent_r exists
12744 set endgrent_r d_endgrent_r
12746 case "$d_endgrent_r" in
12748 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12749 case "$d_endgrent_r_proto:$usethreads" in
12750 ":define") d_endgrent_r_proto=define
12751 set d_endgrent_r_proto endgrent_r $hdrs
12755 case "$d_endgrent_r_proto" in
12757 case "$endgrent_r_proto" in
12758 ''|0) try='int endgrent_r(FILE**);'
12759 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=I_H ;;
12761 case "$endgrent_r_proto" in
12762 ''|0) try='void endgrent_r(FILE**);'
12763 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=V_H ;;
12765 case "$endgrent_r_proto" in
12766 ''|0) d_endgrent_r=undef
12768 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
12769 * ) case "$endgrent_r_proto" in
12770 REENTRANT_PROTO*) ;;
12771 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
12773 echo "Prototype: $try" ;;
12776 *) case "$usethreads" in
12777 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
12784 *) endgrent_r_proto=0
12788 : see if endhostent exists
12789 set endhostent d_endhent
12792 : see if this is a netdb.h system
12793 set netdb.h i_netdb
12796 : see if endhostent_r exists
12797 set endhostent_r d_endhostent_r
12799 case "$d_endhostent_r" in
12801 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12802 case "$d_endhostent_r_proto:$usethreads" in
12803 ":define") d_endhostent_r_proto=define
12804 set d_endhostent_r_proto endhostent_r $hdrs
12808 case "$d_endhostent_r_proto" in
12810 case "$endhostent_r_proto" in
12811 ''|0) try='int endhostent_r(struct hostent_data*);'
12812 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=I_D ;;
12814 case "$endhostent_r_proto" in
12815 ''|0) try='void endhostent_r(struct hostent_data*);'
12816 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=V_D ;;
12818 case "$endhostent_r_proto" in
12819 ''|0) d_endhostent_r=undef
12820 endhostent_r_proto=0
12821 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
12822 * ) case "$endhostent_r_proto" in
12823 REENTRANT_PROTO*) ;;
12824 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
12826 echo "Prototype: $try" ;;
12829 *) case "$usethreads" in
12830 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
12832 d_endhostent_r=undef
12833 endhostent_r_proto=0
12837 *) endhostent_r_proto=0
12841 : see if endnetent exists
12842 set endnetent d_endnent
12845 : see if endnetent_r exists
12846 set endnetent_r d_endnetent_r
12848 case "$d_endnetent_r" in
12850 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12851 case "$d_endnetent_r_proto:$usethreads" in
12852 ":define") d_endnetent_r_proto=define
12853 set d_endnetent_r_proto endnetent_r $hdrs
12857 case "$d_endnetent_r_proto" in
12859 case "$endnetent_r_proto" in
12860 ''|0) try='int endnetent_r(struct netent_data*);'
12861 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=I_D ;;
12863 case "$endnetent_r_proto" in
12864 ''|0) try='void endnetent_r(struct netent_data*);'
12865 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=V_D ;;
12867 case "$endnetent_r_proto" in
12868 ''|0) d_endnetent_r=undef
12869 endnetent_r_proto=0
12870 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
12871 * ) case "$endnetent_r_proto" in
12872 REENTRANT_PROTO*) ;;
12873 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
12875 echo "Prototype: $try" ;;
12878 *) case "$usethreads" in
12879 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
12881 d_endnetent_r=undef
12882 endnetent_r_proto=0
12886 *) endnetent_r_proto=0
12890 : see if endprotoent exists
12891 set endprotoent d_endpent
12894 : see if endprotoent_r exists
12895 set endprotoent_r d_endprotoent_r
12897 case "$d_endprotoent_r" in
12899 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12900 case "$d_endprotoent_r_proto:$usethreads" in
12901 ":define") d_endprotoent_r_proto=define
12902 set d_endprotoent_r_proto endprotoent_r $hdrs
12906 case "$d_endprotoent_r_proto" in
12908 case "$endprotoent_r_proto" in
12909 ''|0) try='int endprotoent_r(struct protoent_data*);'
12910 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=I_D ;;
12912 case "$endprotoent_r_proto" in
12913 ''|0) try='void endprotoent_r(struct protoent_data*);'
12914 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=V_D ;;
12916 case "$endprotoent_r_proto" in
12917 ''|0) d_endprotoent_r=undef
12918 endprotoent_r_proto=0
12919 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
12920 * ) case "$endprotoent_r_proto" in
12921 REENTRANT_PROTO*) ;;
12922 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
12924 echo "Prototype: $try" ;;
12927 *) case "$usethreads" in
12928 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
12930 d_endprotoent_r=undef
12931 endprotoent_r_proto=0
12935 *) endprotoent_r_proto=0
12939 : see if endpwent exists
12940 set endpwent d_endpwent
12943 : see if this is a pwd.h system
12949 xxx=`./findhdr pwd.h`
12950 $cppstdin $cppflags $cppminus < $xxx >$$.h
12952 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
12960 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
12968 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
12976 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
12984 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
12992 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
13000 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
13008 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
13020 set d_pwquota; eval $setvar
13021 set d_pwage; eval $setvar
13022 set d_pwchange; eval $setvar
13023 set d_pwclass; eval $setvar
13024 set d_pwexpire; eval $setvar
13025 set d_pwcomment; eval $setvar
13026 set d_pwgecos; eval $setvar
13027 set d_pwpasswd; eval $setvar
13031 : see if endpwent_r exists
13032 set endpwent_r d_endpwent_r
13034 case "$d_endpwent_r" in
13036 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13037 case "$d_endpwent_r_proto:$usethreads" in
13038 ":define") d_endpwent_r_proto=define
13039 set d_endpwent_r_proto endpwent_r $hdrs
13043 case "$d_endpwent_r_proto" in
13045 case "$endpwent_r_proto" in
13046 ''|0) try='int endpwent_r(FILE**);'
13047 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=I_H ;;
13049 case "$endpwent_r_proto" in
13050 ''|0) try='void endpwent_r(FILE**);'
13051 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=V_H ;;
13053 case "$endpwent_r_proto" in
13054 ''|0) d_endpwent_r=undef
13056 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
13057 * ) case "$endpwent_r_proto" in
13058 REENTRANT_PROTO*) ;;
13059 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
13061 echo "Prototype: $try" ;;
13064 *) case "$usethreads" in
13065 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
13072 *) endpwent_r_proto=0
13076 : see if endservent exists
13077 set endservent d_endsent
13080 : see if endservent_r exists
13081 set endservent_r d_endservent_r
13083 case "$d_endservent_r" in
13085 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13086 case "$d_endservent_r_proto:$usethreads" in
13087 ":define") d_endservent_r_proto=define
13088 set d_endservent_r_proto endservent_r $hdrs
13092 case "$d_endservent_r_proto" in
13094 case "$endservent_r_proto" in
13095 ''|0) try='int endservent_r(struct servent_data*);'
13096 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=I_D ;;
13098 case "$endservent_r_proto" in
13099 ''|0) try='void endservent_r(struct servent_data*);'
13100 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=V_D ;;
13102 case "$endservent_r_proto" in
13103 ''|0) d_endservent_r=undef
13104 endservent_r_proto=0
13105 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
13106 * ) case "$endservent_r_proto" in
13107 REENTRANT_PROTO*) ;;
13108 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
13110 echo "Prototype: $try" ;;
13113 *) case "$usethreads" in
13114 define) echo "endservent_r has no prototype, not using it." >&4 ;;
13116 d_endservent_r=undef
13117 endservent_r_proto=0
13121 *) endservent_r_proto=0
13125 : Locate the flags for 'open()'
13128 #include <sys/types.h>
13133 #include <sys/file.h>
13135 #$i_stdlib I_STDLIB
13137 #include <stdlib.h>
13148 : check sys/file.h first to get FREAD on Sun
13149 if $test `./findhdr sys/file.h` && \
13150 set try -DI_SYS_FILE && eval $compile; then
13152 echo "<sys/file.h> defines the O_* constants..." >&4
13153 if $run ./try; then
13154 echo "and you have the 3 argument form of open()." >&4
13157 echo "but not the 3 argument form of open(). Oh, well." >&4
13160 elif $test `./findhdr fcntl.h` && \
13161 set try -DI_FCNTL && eval $compile; then
13163 echo "<fcntl.h> defines the O_* constants..." >&4
13164 if $run ./try; then
13165 echo "and you have the 3 argument form of open()." >&4
13168 echo "but not the 3 argument form of open(). Oh, well." >&4
13173 echo "I can't find the O_* constant definitions! You got problems." >&4
13179 : see if this is a sys/file.h system
13184 : do we need to include sys/file.h ?
13188 if $h_sysfile; then
13190 echo "We'll be including <sys/file.h>." >&4
13193 echo "We won't be including <sys/file.h>." >&4
13203 : see if fcntl.h is there
13208 : see if we can include fcntl.h
13214 echo "We'll be including <fcntl.h>." >&4
13217 if $h_sysfile; then
13218 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
13220 echo "We won't be including <fcntl.h>." >&4
13232 : see if fork exists
13236 : see if pipe exists
13240 : check for non-blocking I/O stuff
13241 case "$h_sysfile" in
13242 true) echo "#include <sys/file.h>" > head.c;;
13245 true) echo "#include <fcntl.h>" > head.c;;
13246 *) echo "#include <sys/fcntl.h>" > head.c;;
13251 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
13252 case "$o_nonblock" in
13254 $cat head.c > try.c
13255 $cat >>try.c <<EOCP
13257 #$i_stdlib I_STDLIB
13259 #include <stdlib.h>
13267 printf("O_NONBLOCK\n");
13271 printf("O_NDELAY\n");
13275 printf("FNDELAY\n");
13282 if eval $compile_ok; then
13283 o_nonblock=`$run ./try`
13284 case "$o_nonblock" in
13285 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
13286 *) echo "Seems like we can use $o_nonblock.";;
13289 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
13292 *) echo "Using $hint value $o_nonblock.";;
13297 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
13300 case "$d_fork:$d_pipe" in
13302 $cat head.c > try.c
13303 $cat >>try.c <<EOCP
13305 #include <sys/types.h>
13306 #include <signal.h>
13308 #$i_stdlib I_STDLIB
13310 #include <stdlib.h>
13316 #define MY_O_NONBLOCK $o_nonblock
13317 #ifndef errno /* XXX need better Configure test */
13320 #$i_unistd I_UNISTD
13322 #include <unistd.h>
13324 #$i_string I_STRING
13326 #include <string.h>
13328 #include <strings.h>
13330 $signal_t blech(int x) { exit(3); }
13332 $cat >> try.c <<'EOCP'
13341 ret = pipe(pd); /* Down: child -> parent */
13344 ret = pipe(pu); /* Up: parent -> child */
13348 close(pd[1]); /* Parent reads from pd[0] */
13349 close(pu[0]); /* Parent writes (blocking) to pu[1] */
13351 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
13356 signal(SIGALRM, blech);
13358 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
13360 sprintf(string, "%d\n", ret);
13361 ret = write(2, string, strlen(string));
13362 if (ret != strlen(string))
13366 if (errno == EAGAIN) {
13367 printf("EAGAIN\n");
13372 if (errno == EWOULDBLOCK)
13373 printf("EWOULDBLOCK\n");
13376 ret = write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
13379 sleep(2); /* Give it time to close our pipe */
13381 ret = read(pd[0], buf, 1); /* Should read EOF */
13383 sprintf(string, "%d\n", ret);
13384 ret = write(4, string, strlen(string));
13385 if (ret != strlen(string))
13390 close(pd[0]); /* We write to pd[1] */
13391 close(pu[1]); /* We read from pu[0] */
13392 ret = read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
13395 close(pd[1]); /* Pipe pd is now fully closed! */
13396 exit(0); /* Bye bye, thank you for playing! */
13400 if eval $compile_ok; then
13401 echo "$startsh" >mtry
13402 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
13404 $run ./mtry >/dev/null 2>&1
13406 0) eagain=`$cat try.out`;;
13407 1) echo "Could not perform non-blocking setting!";;
13408 2) echo "I did a successful read() for something that was not there!";;
13409 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
13410 4) echo "Could not find F_SETFL!";;
13411 *) echo "Something terribly wrong happened during testing.";;
13413 rd_nodata=`$cat try.ret`
13414 echo "A read() system call with no data present returns $rd_nodata."
13415 case "$rd_nodata" in
13418 echo "(That's peculiar, fixing that to be -1.)"
13424 echo "Forcing errno EAGAIN on read() with no data available."
13428 echo "Your read() sets errno to $eagain when no data is available."
13431 status=`$cat try.err`
13433 0) echo "And it correctly returns 0 to signal EOF.";;
13434 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
13435 *) echo "However, your read() returns '$status' on EOF??";;
13438 if test "$status" = "$rd_nodata"; then
13439 echo "WARNING: you can't distinguish between EOF and no data!"
13443 echo "I can't compile the test program--assuming errno EAGAIN will do."
13447 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
13456 echo "Using $hint value $eagain."
13457 echo "Your read() returns $rd_nodata when no data is present."
13458 case "$d_eofnblk" in
13459 "$define") echo "And you can see EOF because read() returns 0.";;
13460 "$undef") echo "But you can't see EOF status from read() returned value.";;
13462 echo "(Assuming you can't see EOF status from read anyway.)"
13468 $rm_try head.c mtry
13470 : see if erf exists
13474 : see if erfc exists
13478 : see if exp2 exists
13482 : see if expm1 exists
13486 : see if _ptr and _cnt from stdio act std
13489 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
13490 echo "(Looks like you have stdio.h from BSD.)"
13491 case "$stdio_ptr" in
13492 '') stdio_ptr='((fp)->_p)'
13495 *) ptr_lval=$d_stdio_ptr_lval;;
13497 case "$stdio_cnt" in
13498 '') stdio_cnt='((fp)->_r)'
13501 *) cnt_lval=$d_stdio_cnt_lval;;
13503 case "$stdio_base" in
13504 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
13506 case "$stdio_bufsiz" in
13507 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
13509 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
13510 echo "(Looks like you have stdio.h from Linux.)"
13511 case "$stdio_ptr" in
13512 '') stdio_ptr='((fp)->_IO_read_ptr)'
13515 *) ptr_lval=$d_stdio_ptr_lval;;
13517 case "$stdio_cnt" in
13518 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
13521 *) cnt_lval=$d_stdio_cnt_lval;;
13523 case "$stdio_base" in
13524 '') stdio_base='((fp)->_IO_read_base)';;
13526 case "$stdio_bufsiz" in
13527 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
13530 case "$stdio_ptr" in
13531 '') stdio_ptr='((fp)->_ptr)'
13534 *) ptr_lval=$d_stdio_ptr_lval;;
13536 case "$stdio_cnt" in
13537 '') stdio_cnt='((fp)->_cnt)'
13540 *) cnt_lval=$d_stdio_cnt_lval;;
13542 case "$stdio_base" in
13543 '') stdio_base='((fp)->_base)';;
13545 case "$stdio_bufsiz" in
13546 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
13550 : test whether _ptr and _cnt really work
13551 echo "Checking how std your stdio is..." >&4
13554 #$i_stdlib I_STDLIB
13556 #include <stdlib.h>
13558 #define FILE_ptr(fp) $stdio_ptr
13559 #define FILE_cnt(fp) $stdio_cnt
13561 FILE *fp = fopen("try.c", "r");
13564 18 <= FILE_cnt(fp) &&
13565 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13573 if eval $compile && $to try.c; then
13574 if $run ./try; then
13575 echo "Your stdio acts pretty std."
13578 echo "Your stdio isn't very std."
13581 echo "Your stdio doesn't appear very std."
13585 # glibc 2.2.90 and above apparently change stdio streams so Perl's
13586 # direct buffer manipulation no longer works. The Configure tests
13587 # should be changed to correctly detect this, but until then,
13588 # the following check should at least let perl compile and run.
13589 # (This quick fix should be updated before 5.8.1.)
13590 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
13591 # A. Dougherty, June 3, 2002.
13592 case "$d_gnulibc" in
13594 case "$gnulibc_version" in
13598 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
13607 : Can _ptr be used as an lvalue?
13608 case "$d_stdstdio$ptr_lval" in
13609 $define$define) val=$define ;;
13612 set d_stdio_ptr_lval
13615 : Can _cnt be used as an lvalue?
13616 case "$d_stdstdio$cnt_lval" in
13617 $define$define) val=$define ;;
13620 set d_stdio_cnt_lval
13624 : test whether setting _ptr sets _cnt as a side effect
13625 d_stdio_ptr_lval_sets_cnt="$undef"
13626 d_stdio_ptr_lval_nochange_cnt="$undef"
13627 case "$d_stdio_ptr_lval$d_stdstdio" in
13629 echo "Checking to see what happens if we set the stdio ptr..." >&4
13632 /* Can we scream? */
13633 /* Eat dust sed :-) */
13634 /* In the buffer space, no one can hear you scream. */
13635 #$i_stdlib I_STDLIB
13637 #include <stdlib.h>
13639 #define FILE_ptr(fp) $stdio_ptr
13640 #define FILE_cnt(fp) $stdio_cnt
13641 #include <sys/types.h>
13643 FILE *fp = fopen("try.c", "r");
13648 puts("Fail even to read");
13651 c = getc(fp); /* Read away the first # */
13653 puts("Fail even to read");
13657 18 <= FILE_cnt(fp) &&
13658 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13660 puts("Fail even to read");
13663 ptr = (char*) FILE_ptr(fp);
13664 cnt = (size_t)FILE_cnt(fp);
13666 FILE_ptr(fp) += 42;
13668 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
13669 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
13672 if (FILE_cnt(fp) <= 20) {
13673 printf ("Fail (<20 chars to test)");
13676 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
13677 puts("Fail compare");
13680 if (cnt == FILE_cnt(fp)) {
13681 puts("Pass_unchanged");
13684 if (FILE_cnt(fp) == (cnt - 42)) {
13685 puts("Pass_changed");
13688 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
13694 if eval $compile && $to try.c; then
13695 case `$run ./try` in
13697 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
13698 d_stdio_ptr_lval_sets_cnt="$define" ;;
13700 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
13701 d_stdio_ptr_lval_nochange_cnt="$define" ;;
13703 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
13705 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
13708 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
13714 : see if _base is also standard
13716 case "$d_stdstdio" in
13720 #$i_stdlib I_STDLIB
13722 #include <stdlib.h>
13724 #define FILE_base(fp) $stdio_base
13725 #define FILE_bufsiz(fp) $stdio_bufsiz
13727 FILE *fp = fopen("try.c", "r");
13730 19 <= FILE_bufsiz(fp) &&
13731 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
13738 if eval $compile && $to try.c; then
13739 if $run ./try; then
13740 echo "And its _base field acts std."
13743 echo "But its _base field isn't std."
13746 echo "However, it seems to be lacking the _base field."
13754 : see if fast_stdio exists
13756 case "$d_stdstdio:$d_stdio_ptr_lval" in
13758 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
13760 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
13771 : see if fchdir exists
13772 set fchdir d_fchdir
13775 : see if fchmod exists
13776 set fchmod d_fchmod
13779 : see if fchown exists
13780 set fchown d_fchown
13783 : see if this is an fcntl system
13787 : See if fcntl-based locking works.
13790 #$i_stdlib I_STDLIB
13792 #include <stdlib.h>
13794 #include <unistd.h>
13796 #include <signal.h>
13797 $signal_t blech(int x) { exit(3); }
13799 #if defined(F_SETLK) && defined(F_SETLKW)
13800 struct flock flock;
13802 fd = open("try.c", O_RDONLY);
13803 flock.l_type = F_RDLCK;
13804 flock.l_whence = SEEK_SET;
13805 flock.l_start = flock.l_len = 0;
13806 signal(SIGALRM, blech);
13808 retval = fcntl(fd, F_SETLK, &flock);
13810 (retval < 0 ? exit(2) : exit(0));
13816 echo "Checking if fcntl-based file locking works... "
13820 if eval $compile_ok; then
13821 if $run ./try; then
13822 echo "Yes, it seems to work."
13825 echo "Nope, it didn't work."
13830 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
13831 *** This is (almost) impossible.
13832 *** If your NFS lock daemons are not feeling well, something like
13833 *** this may happen, please investigate. Cannot continue, aborting.
13841 echo "I'm unable to compile the test program, so I'll assume not."
13846 echo "Nope, since you don't even have fcntl()."
13849 set d_fcntl_can_lock
13853 : check for fd_set items
13856 Checking to see how well your C compiler handles fd_set and friends ...
13859 #$i_stdlib I_STDLIB
13861 #include <stdlib.h>
13863 #$i_systime I_SYS_TIME
13864 #$i_sysselct I_SYS_SELECT
13865 #$d_socket HAS_SOCKET
13866 #include <sys/types.h>
13868 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
13871 #include <sys/time.h>
13873 #ifdef I_SYS_SELECT
13874 #include <sys/select.h>
13883 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
13891 if eval $compile; then
13892 d_fds_bits="$define"
13894 echo "Well, your system knows about the normal fd_set typedef..." >&4
13895 if $run ./try; then
13896 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
13897 d_fd_macros="$define"
13900 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
13902 d_fd_macros="$undef"
13906 Hmm, your compiler has some difficulty with fd_set. Checking further...
13909 if eval $compile; then
13910 d_fds_bits="$undef"
13912 echo "Well, your system has some sort of fd_set available..." >&4
13913 if $run ./try; then
13914 echo "and you have the normal fd_set macros." >&4
13915 d_fd_macros="$define"
13918 but not the normal fd_set macros! Gross! More work for me...
13920 d_fd_macros="$undef"
13923 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
13925 d_fds_bits="$undef"
13926 d_fd_macros="$undef"
13931 : see if fdim exists
13935 : see if fegetround exists
13936 set fegetround d_fegetround
13939 : see if fgetpos exists
13940 set fgetpos d_fgetpos
13943 : see if finite exists
13944 set finite d_finite
13947 : see if finitel exists
13948 set finitel d_finitel
13951 : see if flock exists
13955 : see if prototype for flock is available
13957 set d_flockproto flock $i_sysfile sys/file.h
13960 : see if fma exists
13964 : see if fmax exists
13968 : see if fmin exists
13972 : see if fp_class exists
13973 set fp_class d_fp_class
13976 : see if this is a math.h system
13980 : check for fpclassify
13981 echo "Checking to see if you have fpclassify..." >&4
13987 int main() { return fpclassify(1.0) == FP_NORMAL ? 0 : 1; }
13990 if eval $compile; then
13992 echo "You have fpclassify."
13995 echo "You do not have fpclassify."
14001 : see if fp_classify exists
14002 set fp_classify d_fp_classify
14005 : see if fp_classl exists
14006 set fp_classl d_fp_classl
14009 : see if pathconf exists
14010 set pathconf d_pathconf
14013 : see if fpathconf exists
14014 set fpathconf d_fpathconf
14017 : see if fpclass exists
14018 set fpclass d_fpclass
14021 : see if fpclassl exists
14022 set fpclassl d_fpclassl
14025 : see if fpgetround exists
14026 set fpgetround d_fpgetround
14029 : check for fpos64_t
14031 echo "Checking to see if you have fpos64_t..." >&4
14034 int main() { fpos64_t x = 7; }
14037 if eval $compile; then
14039 echo "You have fpos64_t."
14042 echo "You do not have fpos64_t."
14043 case "$fpossize" in
14044 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
14051 : see if frexpl exists
14052 set frexpl d_frexpl
14055 : see if this is a sys/param system
14056 set sys/param.h i_sysparam
14059 : see if this is a sys/mount.h system
14060 set sys/mount.h i_sysmount
14063 : Check for fs_data_s
14065 echo "Checking to see if your system supports struct fs_data..." >&4
14066 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
14068 case "$d_fs_data_s" in
14069 "$define") echo "Yes, it does." ;;
14070 *) echo "No, it doesn't." ;;
14073 : see if fseeko exists
14074 set fseeko d_fseeko
14076 case "$longsize" in
14077 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
14080 : see if fsetpos exists
14081 set fsetpos d_fsetpos
14084 : see if fstatfs exists
14085 set fstatfs d_fstatfs
14088 : see if statvfs exists
14089 set statvfs d_statvfs
14092 : see if fstatvfs exists
14093 set fstatvfs d_fstatvfs
14097 : see if fsync exists
14101 : see if ftello exists
14102 set ftello d_ftello
14104 case "$longsize" in
14105 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
14108 : check for a working futimes
14111 echo "Checking if you have a working futimes()" >&4
14114 #include <sys/time.h>
14121 fd = open ("try.c", O_RDWR);
14122 if (-1 == fd) exit (1);
14123 rv = futimes (fd, NULL);
14124 exit (rv == -1 ? errno : 0);
14128 if eval $compile; then
14132 0) echo "Yes, you have" >&4
14133 d_futimes="$define"
14135 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
14139 echo "No, it does not (probably harmless)" >&4
14143 : see if ndbm.h is available
14146 : Compatibility location for RedHat 7.1
14147 set gdbm/ndbm.h i_gdbmndbm
14149 : Compatibility location for Debian 4.0
14150 set gdbm-ndbm.h i_gdbm_ndbm
14154 if $test "$i_ndbm" = "$define" -o "$i_gdbmndbm" = "$define" -o "$i_gdbm_ndbm" = "$define"; then
14155 : see if dbm_open exists
14156 set dbm_open d_dbm_open
14158 case "$d_dbm_open" in
14161 i_gdbmndbm="$undef"
14162 i_gdbm_ndbm="$undef"
14163 echo "We won't be including <ndbm.h>"
14173 ndbm_hdr_protochk='name=$1; hdr=$2;
14174 eval "ihdr=\$""i_$name";
14176 if $test "$ihdr" = "$define"; then
14177 $echo "Checking if your <$hdr> uses prototypes..." >&4;
14178 case "$d_cplusplus" in
14179 $define) ./protochk "$extern_C void dbm_close(DBM *);" literal "extern \"C\" {" $ihdr $hdr literal "}" && val="$define" ;;
14180 *) ./protochk "$extern_C void dbm_close(int, int);" $ihdr $hdr || val="$define" ;;
14183 $define) $echo "Your <$hdr> seems to have prototypes";;
14184 *) $echo "Your <$hdr> does not seem to have prototypes";;
14187 set "d_${name}_h_uses_prototypes";
14191 eval $ndbm_hdr_protochk
14192 set gdbmndbm gdbm/ndbm.h
14193 eval $ndbm_hdr_protochk
14194 set gdbm_ndbm gdbm-ndbm.h
14195 eval $ndbm_hdr_protochk
14197 : see if getaddrinfo exists
14198 set getaddrinfo d_getaddrinfo
14201 : see if getcwd exists
14202 set getcwd d_getcwd
14205 : see if getespwnam exists
14206 set getespwnam d_getespwnam
14209 : see if getfsstat exists
14210 set getfsstat d_getfsstat
14213 : see if getgrent exists
14214 set getgrent d_getgrent
14217 : see if getgrent_r exists
14218 set getgrent_r d_getgrent_r
14220 case "$d_getgrent_r" in
14222 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14223 case "$d_getgrent_r_proto:$usethreads" in
14224 ":define") d_getgrent_r_proto=define
14225 set d_getgrent_r_proto getgrent_r $hdrs
14229 case "$d_getgrent_r_proto" in
14231 case "$getgrent_r_proto" in
14232 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
14233 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBWR ;;
14235 case "$getgrent_r_proto" in
14236 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
14237 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIR ;;
14239 case "$getgrent_r_proto" in
14240 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
14241 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBW ;;
14243 case "$getgrent_r_proto" in
14244 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
14245 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBI ;;
14247 case "$getgrent_r_proto" in
14248 ''|0) try='int getgrent_r(struct group*, char*, int);'
14249 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBI ;;
14251 case "$getgrent_r_proto" in
14252 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
14253 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIH ;;
14255 case "$getgrent_r_proto" in
14256 ''|0) d_getgrent_r=undef
14258 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
14259 * ) case "$getgrent_r_proto" in
14260 REENTRANT_PROTO*) ;;
14261 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
14263 echo "Prototype: $try" ;;
14266 *) case "$usethreads" in
14267 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
14274 *) getgrent_r_proto=0
14278 : see if getgrgid_r exists
14279 set getgrgid_r d_getgrgid_r
14281 case "$d_getgrgid_r" in
14283 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14284 case "$d_getgrgid_r_proto:$usethreads" in
14285 ":define") d_getgrgid_r_proto=define
14286 set d_getgrgid_r_proto getgrgid_r $hdrs
14290 case "$d_getgrgid_r_proto" in
14292 case "$getgrgid_r_proto" in
14293 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
14294 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
14296 case "$getgrgid_r_proto" in
14297 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
14298 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
14300 case "$getgrgid_r_proto" in
14301 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
14302 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
14304 case "$getgrgid_r_proto" in
14305 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
14306 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
14308 case "$getgrgid_r_proto" in
14309 ''|0) d_getgrgid_r=undef
14311 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
14312 * ) case "$getgrgid_r_proto" in
14313 REENTRANT_PROTO*) ;;
14314 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
14316 echo "Prototype: $try" ;;
14319 *) case "$usethreads" in
14320 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
14327 *) getgrgid_r_proto=0
14331 : see if getgrnam_r exists
14332 set getgrnam_r d_getgrnam_r
14334 case "$d_getgrnam_r" in
14336 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14337 case "$d_getgrnam_r_proto:$usethreads" in
14338 ":define") d_getgrnam_r_proto=define
14339 set d_getgrnam_r_proto getgrnam_r $hdrs
14343 case "$d_getgrnam_r_proto" in
14345 case "$getgrnam_r_proto" in
14346 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
14347 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
14349 case "$getgrnam_r_proto" in
14350 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
14351 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
14353 case "$getgrnam_r_proto" in
14354 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
14355 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CBI ;;
14357 case "$getgrnam_r_proto" in
14358 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
14359 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
14361 case "$getgrnam_r_proto" in
14362 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
14363 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
14365 case "$getgrnam_r_proto" in
14366 ''|0) d_getgrnam_r=undef
14368 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
14369 * ) case "$getgrnam_r_proto" in
14370 REENTRANT_PROTO*) ;;
14371 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
14373 echo "Prototype: $try" ;;
14376 *) case "$usethreads" in
14377 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
14384 *) getgrnam_r_proto=0
14388 : see if gethostbyaddr exists
14389 set gethostbyaddr d_gethbyaddr
14392 : see if gethostbyname exists
14393 set gethostbyname d_gethbyname
14396 : see if gethostent exists
14397 set gethostent d_gethent
14400 : see how we will look up host name
14403 if set gethostname val -f d_gethname; eval $csym; $val; then
14404 echo 'gethostname() found.' >&4
14405 d_gethname="$define"
14408 if set uname val -f d_uname; eval $csym; $val; then
14411 uname() was found, but you're running xenix, and older versions of xenix
14412 have a broken uname(). If you don't really know whether your xenix is old
14413 enough to have a broken system call, use the default answer.
14418 "$define") dflt=n;;
14420 rp='Is your uname() broken?'
14423 n*) d_uname="$define"; call=uname;;
14426 echo 'uname() found.' >&4
14433 case "$d_gethname" in
14434 '') d_gethname="$undef";;
14437 '') d_uname="$undef";;
14439 case "$d_uname$d_gethname" in
14444 Every now and then someone has a $call() that lies about the hostname
14445 but can't be fixed for political or economic reasons. If you wish, I can
14446 pretend $call() isn't there and maybe compute hostname at run-time
14447 thanks to the '$phostname' command.
14450 rp="Shall I ignore $call() from now on?"
14453 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
14456 case "$phostname" in
14457 '') aphostname='';;
14458 *) case "$aphostname" in
14460 *) set X $phostname
14464 file=`./loc $file $file $pth`
14465 aphostname=`echo $file $*`
14470 case "$d_uname$d_gethname" in
14473 case "$phostname" in
14475 echo "There will be no way for $package to get your hostname." >&4;;
14477 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
14481 case "$d_phostname" in
14482 '') d_phostname="$undef";;
14485 : see if gethostbyaddr_r exists
14486 set gethostbyaddr_r d_gethostbyaddr_r
14488 case "$d_gethostbyaddr_r" in
14490 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14491 case "$d_gethostbyaddr_r_proto:$usethreads" in
14492 ":define") d_gethostbyaddr_r_proto=define
14493 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
14497 case "$d_gethostbyaddr_r_proto" in
14499 case "$gethostbyaddr_r_proto" in
14500 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
14501 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
14503 case "$gethostbyaddr_r_proto" in
14504 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
14505 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
14507 case "$gethostbyaddr_r_proto" in
14508 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
14509 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
14511 case "$gethostbyaddr_r_proto" in
14512 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
14513 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
14515 case "$gethostbyaddr_r_proto" in
14516 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
14517 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
14519 case "$gethostbyaddr_r_proto" in
14520 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
14521 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
14523 case "$gethostbyaddr_r_proto" in
14524 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
14525 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
14527 case "$gethostbyaddr_r_proto" in
14528 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
14529 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
14531 case "$gethostbyaddr_r_proto" in
14532 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
14533 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
14535 case "$gethostbyaddr_r_proto" in
14536 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
14537 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
14539 case "$gethostbyaddr_r_proto" in
14540 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
14541 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
14543 case "$gethostbyaddr_r_proto" in
14544 ''|0) d_gethostbyaddr_r=undef
14545 gethostbyaddr_r_proto=0
14546 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
14547 * ) case "$gethostbyaddr_r_proto" in
14548 REENTRANT_PROTO*) ;;
14549 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
14551 echo "Prototype: $try" ;;
14554 *) case "$usethreads" in
14555 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
14557 d_gethostbyaddr_r=undef
14558 gethostbyaddr_r_proto=0
14562 *) gethostbyaddr_r_proto=0
14566 : see if gethostbyname_r exists
14567 set gethostbyname_r d_gethostbyname_r
14569 case "$d_gethostbyname_r" in
14571 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14572 case "$d_gethostbyname_r_proto:$usethreads" in
14573 ":define") d_gethostbyname_r_proto=define
14574 set d_gethostbyname_r_proto gethostbyname_r $hdrs
14578 case "$d_gethostbyname_r_proto" in
14580 case "$gethostbyname_r_proto" in
14581 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
14582 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
14584 case "$gethostbyname_r_proto" in
14585 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
14586 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
14588 case "$gethostbyname_r_proto" in
14589 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
14590 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
14592 case "$gethostbyname_r_proto" in
14593 ''|0) d_gethostbyname_r=undef
14594 gethostbyname_r_proto=0
14595 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
14596 * ) case "$gethostbyname_r_proto" in
14597 REENTRANT_PROTO*) ;;
14598 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
14600 echo "Prototype: $try" ;;
14603 *) case "$usethreads" in
14604 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
14606 d_gethostbyname_r=undef
14607 gethostbyname_r_proto=0
14611 *) gethostbyname_r_proto=0
14615 : see if gethostent_r exists
14616 set gethostent_r d_gethostent_r
14618 case "$d_gethostent_r" in
14620 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14621 case "$d_gethostent_r_proto:$usethreads" in
14622 ":define") d_gethostent_r_proto=define
14623 set d_gethostent_r_proto gethostent_r $hdrs
14627 case "$d_gethostent_r_proto" in
14629 case "$gethostent_r_proto" in
14630 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
14631 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
14633 case "$gethostent_r_proto" in
14634 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
14635 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBIE ;;
14637 case "$gethostent_r_proto" in
14638 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
14639 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBIE ;;
14641 case "$gethostent_r_proto" in
14642 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
14643 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBI ;;
14645 case "$gethostent_r_proto" in
14646 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
14647 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBI ;;
14649 case "$gethostent_r_proto" in
14650 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
14651 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SD ;;
14653 case "$gethostent_r_proto" in
14654 ''|0) d_gethostent_r=undef
14655 gethostent_r_proto=0
14656 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
14657 * ) case "$gethostent_r_proto" in
14658 REENTRANT_PROTO*) ;;
14659 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
14661 echo "Prototype: $try" ;;
14664 *) case "$usethreads" in
14665 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
14667 d_gethostent_r=undef
14668 gethostent_r_proto=0
14672 *) gethostent_r_proto=0
14676 : see if prototypes for various gethostxxx netdb.h functions are available
14678 set d_gethostprotos gethostent $i_netdb netdb.h
14681 : see if getitimer exists
14682 set getitimer d_getitimer
14685 : see if getlogin exists
14686 set getlogin d_getlogin
14689 : see if getlogin_r exists
14690 set getlogin_r d_getlogin_r
14692 case "$d_getlogin_r" in
14694 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
14695 case "$d_getlogin_r_proto:$usethreads" in
14696 ":define") d_getlogin_r_proto=define
14697 set d_getlogin_r_proto getlogin_r $hdrs
14701 case "$d_getlogin_r_proto" in
14703 case "$getlogin_r_proto" in
14704 ''|0) try='int getlogin_r(char*, size_t);'
14705 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BW ;;
14707 case "$getlogin_r_proto" in
14708 ''|0) try='int getlogin_r(char*, int);'
14709 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BI ;;
14711 case "$getlogin_r_proto" in
14712 ''|0) try='char* getlogin_r(char*, size_t);'
14713 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BW ;;
14715 case "$getlogin_r_proto" in
14716 ''|0) try='char* getlogin_r(char*, int);'
14717 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BI ;;
14719 case "$getlogin_r_proto" in
14720 ''|0) d_getlogin_r=undef
14722 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
14723 * ) case "$getlogin_r_proto" in
14724 REENTRANT_PROTO*) ;;
14725 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
14727 echo "Prototype: $try" ;;
14730 *) case "$usethreads" in
14731 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
14738 *) getlogin_r_proto=0
14742 : see if getmnt exists
14743 set getmnt d_getmnt
14746 : see if getmntent exists
14747 set getmntent d_getmntent
14750 : see if getnameinfo exists
14751 set getnameinfo d_getnameinfo
14754 : see if getnetbyaddr exists
14755 set getnetbyaddr d_getnbyaddr
14758 : see if getnetbyname exists
14759 set getnetbyname d_getnbyname
14762 : see if getnetent exists
14763 set getnetent d_getnent
14766 : see if getnetbyaddr_r exists
14767 set getnetbyaddr_r d_getnetbyaddr_r
14769 case "$d_getnetbyaddr_r" in
14771 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14772 case "$d_getnetbyaddr_r_proto:$usethreads" in
14773 ":define") d_getnetbyaddr_r_proto=define
14774 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
14778 case "$d_getnetbyaddr_r_proto" in
14780 case "$getnetbyaddr_r_proto" in
14781 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
14782 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
14784 case "$getnetbyaddr_r_proto" in
14785 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
14786 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
14788 case "$getnetbyaddr_r_proto" in
14789 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
14790 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
14792 case "$getnetbyaddr_r_proto" in
14793 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
14794 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
14796 case "$getnetbyaddr_r_proto" in
14797 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
14798 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
14800 case "$getnetbyaddr_r_proto" in
14801 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
14802 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
14804 case "$getnetbyaddr_r_proto" in
14805 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
14806 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
14808 case "$getnetbyaddr_r_proto" in
14809 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
14810 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
14812 case "$getnetbyaddr_r_proto" in
14813 ''|0) d_getnetbyaddr_r=undef
14814 getnetbyaddr_r_proto=0
14815 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
14816 * ) case "$getnetbyaddr_r_proto" in
14817 REENTRANT_PROTO*) ;;
14818 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
14820 echo "Prototype: $try" ;;
14823 *) case "$usethreads" in
14824 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
14826 d_getnetbyaddr_r=undef
14827 getnetbyaddr_r_proto=0
14831 *) getnetbyaddr_r_proto=0
14835 : see if getnetbyname_r exists
14836 set getnetbyname_r d_getnetbyname_r
14838 case "$d_getnetbyname_r" in
14840 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14841 case "$d_getnetbyname_r_proto:$usethreads" in
14842 ":define") d_getnetbyname_r_proto=define
14843 set d_getnetbyname_r_proto getnetbyname_r $hdrs
14847 case "$d_getnetbyname_r_proto" in
14849 case "$getnetbyname_r_proto" in
14850 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
14851 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
14853 case "$getnetbyname_r_proto" in
14854 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
14855 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
14857 case "$getnetbyname_r_proto" in
14858 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
14859 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
14861 case "$getnetbyname_r_proto" in
14862 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
14863 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
14865 case "$getnetbyname_r_proto" in
14866 ''|0) d_getnetbyname_r=undef
14867 getnetbyname_r_proto=0
14868 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
14869 * ) case "$getnetbyname_r_proto" in
14870 REENTRANT_PROTO*) ;;
14871 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
14873 echo "Prototype: $try" ;;
14876 *) case "$usethreads" in
14877 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
14879 d_getnetbyname_r=undef
14880 getnetbyname_r_proto=0
14884 *) getnetbyname_r_proto=0
14888 : see if getnetent_r exists
14889 set getnetent_r d_getnetent_r
14891 case "$d_getnetent_r" in
14893 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14894 case "$d_getnetent_r_proto:$usethreads" in
14895 ":define") d_getnetent_r_proto=define
14896 set d_getnetent_r_proto getnetent_r $hdrs
14900 case "$d_getnetent_r_proto" in
14902 case "$getnetent_r_proto" in
14903 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
14904 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
14906 case "$getnetent_r_proto" in
14907 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
14908 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBIE ;;
14910 case "$getnetent_r_proto" in
14911 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
14912 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBIE ;;
14914 case "$getnetent_r_proto" in
14915 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
14916 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBI ;;
14918 case "$getnetent_r_proto" in
14919 ''|0) try='int getnetent_r(struct netent*, char*, int);'
14920 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBI ;;
14922 case "$getnetent_r_proto" in
14923 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
14924 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SD ;;
14926 case "$getnetent_r_proto" in
14927 ''|0) d_getnetent_r=undef
14928 getnetent_r_proto=0
14929 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
14930 * ) case "$getnetent_r_proto" in
14931 REENTRANT_PROTO*) ;;
14932 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
14934 echo "Prototype: $try" ;;
14937 *) case "$usethreads" in
14938 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
14940 d_getnetent_r=undef
14941 getnetent_r_proto=0
14945 *) getnetent_r_proto=0
14949 : see if prototypes for various getnetxxx netdb.h functions are available
14951 set d_getnetprotos getnetent $i_netdb netdb.h
14954 : see if getpagesize exists
14955 set getpagesize d_getpagsz
14958 : Optional checks for getprotobyname and getprotobynumber
14960 : see if getprotobyname exists
14961 set getprotobyname d_getpbyname
14964 : see if getprotobynumber exists
14965 set getprotobynumber d_getpbynumber
14968 : see if getprotoent exists
14969 set getprotoent d_getpent
14972 : see if getpgid exists
14973 set getpgid d_getpgid
14976 : see if getpgrp2 exists
14977 set getpgrp2 d_getpgrp2
14980 : see if getppid exists
14981 set getppid d_getppid
14984 : see if getpriority exists
14985 set getpriority d_getprior
14988 : see if getprotobyname_r exists
14989 set getprotobyname_r d_getprotobyname_r
14991 case "$d_getprotobyname_r" in
14993 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14994 case "$d_getprotobyname_r_proto:$usethreads" in
14995 ":define") d_getprotobyname_r_proto=define
14996 set d_getprotobyname_r_proto getprotobyname_r $hdrs
15000 case "$d_getprotobyname_r_proto" in
15002 case "$getprotobyname_r_proto" in
15003 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
15004 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
15006 case "$getprotobyname_r_proto" in
15007 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
15008 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
15010 case "$getprotobyname_r_proto" in
15011 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
15012 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
15014 case "$getprotobyname_r_proto" in
15015 ''|0) d_getprotobyname_r=undef
15016 getprotobyname_r_proto=0
15017 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
15018 * ) case "$getprotobyname_r_proto" in
15019 REENTRANT_PROTO*) ;;
15020 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
15022 echo "Prototype: $try" ;;
15025 *) case "$usethreads" in
15026 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
15028 d_getprotobyname_r=undef
15029 getprotobyname_r_proto=0
15033 *) getprotobyname_r_proto=0
15037 : see if getprotobynumber_r exists
15038 set getprotobynumber_r d_getprotobynumber_r
15040 case "$d_getprotobynumber_r" in
15042 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15043 case "$d_getprotobynumber_r_proto:$usethreads" in
15044 ":define") d_getprotobynumber_r_proto=define
15045 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
15049 case "$d_getprotobynumber_r_proto" in
15051 case "$getprotobynumber_r_proto" in
15052 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
15053 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
15055 case "$getprotobynumber_r_proto" in
15056 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
15057 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
15059 case "$getprotobynumber_r_proto" in
15060 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
15061 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
15063 case "$getprotobynumber_r_proto" in
15064 ''|0) d_getprotobynumber_r=undef
15065 getprotobynumber_r_proto=0
15066 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
15067 * ) case "$getprotobynumber_r_proto" in
15068 REENTRANT_PROTO*) ;;
15069 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
15071 echo "Prototype: $try" ;;
15074 *) case "$usethreads" in
15075 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
15077 d_getprotobynumber_r=undef
15078 getprotobynumber_r_proto=0
15082 *) getprotobynumber_r_proto=0
15086 : see if getprotoent_r exists
15087 set getprotoent_r d_getprotoent_r
15089 case "$d_getprotoent_r" in
15091 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15092 case "$d_getprotoent_r_proto:$usethreads" in
15093 ":define") d_getprotoent_r_proto=define
15094 set d_getprotoent_r_proto getprotoent_r $hdrs
15098 case "$d_getprotoent_r_proto" in
15100 case "$getprotoent_r_proto" in
15101 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
15102 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
15104 case "$getprotoent_r_proto" in
15105 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
15106 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBI ;;
15108 case "$getprotoent_r_proto" in
15109 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
15110 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=S_SBI ;;
15112 case "$getprotoent_r_proto" in
15113 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
15114 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SD ;;
15116 case "$getprotoent_r_proto" in
15117 ''|0) d_getprotoent_r=undef
15118 getprotoent_r_proto=0
15119 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
15120 * ) case "$getprotoent_r_proto" in
15121 REENTRANT_PROTO*) ;;
15122 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
15124 echo "Prototype: $try" ;;
15127 *) case "$usethreads" in
15128 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
15130 d_getprotoent_r=undef
15131 getprotoent_r_proto=0
15135 *) getprotoent_r_proto=0
15139 : see if prototypes for various getprotoxxx netdb.h functions are available
15141 set d_getprotoprotos getprotoent $i_netdb netdb.h
15144 : see if getprpwnam exists
15145 set getprpwnam d_getprpwnam
15148 : see if getpwent exists
15149 set getpwent d_getpwent
15152 : see if getpwent_r exists
15153 set getpwent_r d_getpwent_r
15155 case "$d_getpwent_r" in
15157 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15158 case "$d_getpwent_r_proto:$usethreads" in
15159 ":define") d_getpwent_r_proto=define
15160 set d_getpwent_r_proto getpwent_r $hdrs
15164 case "$d_getpwent_r_proto" in
15166 case "$getpwent_r_proto" in
15167 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
15168 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBWR ;;
15170 case "$getpwent_r_proto" in
15171 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
15172 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIR ;;
15174 case "$getpwent_r_proto" in
15175 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
15176 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBW ;;
15178 case "$getpwent_r_proto" in
15179 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
15180 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBI ;;
15182 case "$getpwent_r_proto" in
15183 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
15184 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBI ;;
15186 case "$getpwent_r_proto" in
15187 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
15188 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIH ;;
15190 case "$getpwent_r_proto" in
15191 ''|0) d_getpwent_r=undef
15193 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
15194 * ) case "$getpwent_r_proto" in
15195 REENTRANT_PROTO*) ;;
15196 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
15198 echo "Prototype: $try" ;;
15201 *) case "$usethreads" in
15202 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
15209 *) getpwent_r_proto=0
15213 : see if getpwnam_r exists
15214 set getpwnam_r d_getpwnam_r
15216 case "$d_getpwnam_r" in
15218 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15219 case "$d_getpwnam_r_proto:$usethreads" in
15220 ":define") d_getpwnam_r_proto=define
15221 set d_getpwnam_r_proto getpwnam_r $hdrs
15225 case "$d_getpwnam_r_proto" in
15227 case "$getpwnam_r_proto" in
15228 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
15229 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
15231 case "$getpwnam_r_proto" in
15232 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
15233 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
15235 case "$getpwnam_r_proto" in
15236 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
15237 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
15239 case "$getpwnam_r_proto" in
15240 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
15241 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
15243 case "$getpwnam_r_proto" in
15244 ''|0) d_getpwnam_r=undef
15246 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
15247 * ) case "$getpwnam_r_proto" in
15248 REENTRANT_PROTO*) ;;
15249 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
15251 echo "Prototype: $try" ;;
15254 *) case "$usethreads" in
15255 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
15262 *) getpwnam_r_proto=0
15266 : see if getpwuid_r exists
15267 set getpwuid_r d_getpwuid_r
15269 case "$d_getpwuid_r" in
15271 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15272 case "$d_getpwuid_r_proto:$usethreads" in
15273 ":define") d_getpwuid_r_proto=define
15274 set d_getpwuid_r_proto getpwuid_r $hdrs
15278 case "$d_getpwuid_r_proto" in
15280 case "$getpwuid_r_proto" in
15281 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
15282 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
15284 case "$getpwuid_r_proto" in
15285 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
15286 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
15288 case "$getpwuid_r_proto" in
15289 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
15290 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
15292 case "$getpwuid_r_proto" in
15293 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
15294 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
15296 case "$getpwuid_r_proto" in
15297 ''|0) d_getpwuid_r=undef
15299 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
15300 * ) case "$getpwuid_r_proto" in
15301 REENTRANT_PROTO*) ;;
15302 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
15304 echo "Prototype: $try" ;;
15307 *) case "$usethreads" in
15308 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
15315 *) getpwuid_r_proto=0
15319 : Optional checks for getsbyname and getsbyport
15321 : see if getservbyname exists
15322 set getservbyname d_getsbyname
15325 : see if getservbyport exists
15326 set getservbyport d_getsbyport
15329 : see if getservent exists
15330 set getservent d_getsent
15333 : see if getservbyname_r exists
15334 set getservbyname_r d_getservbyname_r
15336 case "$d_getservbyname_r" in
15338 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15339 case "$d_getservbyname_r_proto:$usethreads" in
15340 ":define") d_getservbyname_r_proto=define
15341 set d_getservbyname_r_proto getservbyname_r $hdrs
15345 case "$d_getservbyname_r_proto" in
15347 case "$getservbyname_r_proto" in
15348 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
15349 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
15351 case "$getservbyname_r_proto" in
15352 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
15353 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
15355 case "$getservbyname_r_proto" in
15356 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
15357 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
15359 case "$getservbyname_r_proto" in
15360 ''|0) d_getservbyname_r=undef
15361 getservbyname_r_proto=0
15362 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
15363 * ) case "$getservbyname_r_proto" in
15364 REENTRANT_PROTO*) ;;
15365 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
15367 echo "Prototype: $try" ;;
15370 *) case "$usethreads" in
15371 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
15373 d_getservbyname_r=undef
15374 getservbyname_r_proto=0
15378 *) getservbyname_r_proto=0
15382 : see if getservbyport_r exists
15383 set getservbyport_r d_getservbyport_r
15385 case "$d_getservbyport_r" in
15387 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15388 case "$d_getservbyport_r_proto:$usethreads" in
15389 ":define") d_getservbyport_r_proto=define
15390 set d_getservbyport_r_proto getservbyport_r $hdrs
15394 case "$d_getservbyport_r_proto" in
15396 case "$getservbyport_r_proto" in
15397 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
15398 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
15400 case "$getservbyport_r_proto" in
15401 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
15402 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
15404 case "$getservbyport_r_proto" in
15405 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
15406 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
15408 case "$getservbyport_r_proto" in
15409 ''|0) d_getservbyport_r=undef
15410 getservbyport_r_proto=0
15411 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
15412 * ) case "$getservbyport_r_proto" in
15413 REENTRANT_PROTO*) ;;
15414 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
15416 echo "Prototype: $try" ;;
15419 *) case "$usethreads" in
15420 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
15422 d_getservbyport_r=undef
15423 getservbyport_r_proto=0
15427 *) getservbyport_r_proto=0
15431 : see if getservent_r exists
15432 set getservent_r d_getservent_r
15434 case "$d_getservent_r" in
15436 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15437 case "$d_getservent_r_proto:$usethreads" in
15438 ":define") d_getservent_r_proto=define
15439 set d_getservent_r_proto getservent_r $hdrs
15443 case "$d_getservent_r_proto" in
15445 case "$getservent_r_proto" in
15446 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
15447 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBWR ;;
15449 case "$getservent_r_proto" in
15450 ''|0) try='int getservent_r(struct servent*, char*, int);'
15451 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBI ;;
15453 case "$getservent_r_proto" in
15454 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
15455 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=S_SBI ;;
15457 case "$getservent_r_proto" in
15458 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
15459 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SD ;;
15461 case "$getservent_r_proto" in
15462 ''|0) d_getservent_r=undef
15463 getservent_r_proto=0
15464 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
15465 * ) case "$getservent_r_proto" in
15466 REENTRANT_PROTO*) ;;
15467 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
15469 echo "Prototype: $try" ;;
15472 *) case "$usethreads" in
15473 define) echo "getservent_r has no prototype, not using it." >&4 ;;
15475 d_getservent_r=undef
15476 getservent_r_proto=0
15480 *) getservent_r_proto=0
15484 : see if prototypes for various getservxxx netdb.h functions are available
15486 set d_getservprotos getservent $i_netdb netdb.h
15489 : see if getspnam exists
15490 set getspnam d_getspnam
15493 : see if this is a shadow.h system
15494 set shadow.h i_shadow
15497 : see if getspnam_r exists
15498 set getspnam_r d_getspnam_r
15500 case "$d_getspnam_r" in
15502 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
15503 case "$d_getspnam_r_proto:$usethreads" in
15504 ":define") d_getspnam_r_proto=define
15505 set d_getspnam_r_proto getspnam_r $hdrs
15509 case "$d_getspnam_r_proto" in
15511 case "$getspnam_r_proto" in
15512 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
15513 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
15515 case "$getspnam_r_proto" in
15516 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
15517 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=S_CSBI ;;
15519 case "$getspnam_r_proto" in
15520 ''|0) d_getspnam_r=undef
15522 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
15523 * ) case "$getspnam_r_proto" in
15524 REENTRANT_PROTO*) ;;
15525 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
15527 echo "Prototype: $try" ;;
15530 *) case "$usethreads" in
15531 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
15538 *) getspnam_r_proto=0
15542 : see if gettimeofday or ftime exists
15543 set gettimeofday d_gettimeod
15545 case "$d_gettimeod" in
15551 val="$undef"; set d_ftime; eval $setvar
15554 case "$d_gettimeod$d_ftime" in
15557 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
15561 : see if gmtime_r exists
15562 set gmtime_r d_gmtime_r
15564 case "$d_gmtime_r" in
15566 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15567 case "$d_gmtime_r_proto:$usethreads" in
15568 ":define") d_gmtime_r_proto=define
15569 set d_gmtime_r_proto gmtime_r $hdrs
15573 case "$d_gmtime_r_proto" in
15575 case "$gmtime_r_proto" in
15576 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
15577 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=S_TS ;;
15579 case "$gmtime_r_proto" in
15580 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
15581 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=I_TS ;;
15583 case "$gmtime_r_proto" in
15584 ''|0) d_gmtime_r=undef
15586 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
15587 * ) case "$gmtime_r_proto" in
15588 REENTRANT_PROTO*) ;;
15589 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
15591 echo "Prototype: $try" ;;
15594 *) case "$usethreads" in
15595 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
15602 *) gmtime_r_proto=0
15606 : see if hasmntopt exists
15607 set hasmntopt d_hasmntopt
15610 : see if this is a netinet/in.h or sys/in.h system
15611 set netinet/in.h i_niin sys/in.h i_sysin
15614 : see if arpa/inet.h has to be included
15615 set arpa/inet.h i_arpainet
15618 : see if htonl --and friends-- exists
15623 : Maybe they are macros.
15626 $cat >htonl.c <<EOM
15628 #include <sys/types.h>
15629 #$i_niin I_NETINET_IN
15631 #$i_arpainet I_ARPA_INET
15632 #ifdef I_NETINET_IN
15633 #include <netinet/in.h>
15636 #include <sys/in.h>
15639 #include <arpa/inet.h>
15642 printf("Defined as a macro.");
15645 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
15646 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
15648 echo "But it seems to be defined as a macro." >&4
15656 : see if hypot exists
15660 : see if ilogb exists
15664 : see if ilogbl exists
15665 set ilogbl d_ilogbl
15670 if set index val -f; eval $csym; $val; then
15671 if set strchr val -f d_strchr; eval $csym; $val; then
15672 if $contains strchr "$strings" >/dev/null 2>&1 ; then
15675 echo "strchr() found." >&4
15679 echo "index() found." >&4
15684 echo "index() found." >&4
15687 if set strchr val -f d_strchr; eval $csym; $val; then
15690 echo "strchr() found." >&4
15692 echo "No index() or strchr() found!" >&4
15697 set d_strchr; eval $setvar
15699 set d_index; eval $setvar
15701 : check whether inet_aton exists
15702 set inet_aton d_inetaton
15705 : see if inet_ntop exists
15706 set inet_ntop d_inetntop
15709 : see if inet_pton exists
15710 set inet_pton d_inetpton
15715 $cat >isascii.c <<EOCP
15718 #$i_stdlib I_STDLIB
15720 #include <stdlib.h>
15731 if eval $compile; then
15732 echo "isascii() found." >&4
15735 echo "isascii() NOT found." >&4
15744 $cat >isblank.c <<'EOCP'
15755 if $cc $ccflags $ldflags -o isblank isblank.c $libs >/dev/null 2>&1 ; then
15756 echo "isblank() found." >&4
15759 echo "isblank() NOT found." >&4
15766 : check for isfinite
15767 echo "Checking to see if you have isfinite..." >&4
15773 int main() { return isfinite(0.0); }
15776 if eval $compile; then
15778 echo "You have isfinite."
15781 echo "You do not have isfinite."
15787 : see if isfinitel exists
15788 set isfinitel d_isfinitel
15792 echo "Checking to see if you have isinf..." >&4
15798 int main() { return isinf(0.0); }
15801 if eval $compile; then
15803 echo "You have isinf."
15806 echo "You do not have isinf."
15812 : see if isinfl exists
15813 set isinfl d_isinfl
15817 echo "Checking to see if you have isless..." >&4
15823 int main() { return isless(0.0); }
15826 if eval $compile; then
15828 echo "You have isless."
15831 echo "You do not have isless."
15838 echo "Checking to see if you have isnan..." >&4
15844 int main() { return isnan(0.0); }
15847 if eval $compile; then
15849 echo "You have isnan."
15852 echo "You do not have isnan."
15858 : see if isnanl exists
15859 set isnanl d_isnanl
15862 : check for isnormal
15863 echo "Checking to see if you have isnormal..." >&4
15869 int main() { return isnormal(0.0); }
15872 if eval $compile; then
15874 echo "You have isnormal."
15877 echo "You do not have isnormal."
15887 : see if j0l exists
15891 : see if killpg exists
15892 set killpg d_killpg
15895 : see if localeconv exists
15896 set localeconv d_locconv
15899 : see if libc has the POSIX.1-2008 currency locale rules
15900 case "$d_locconv:$d_lc_monetary_2008" in
15903 #include <locale.h>
15905 struct lconv *lc = localeconv();
15906 char int_p_cs_precedes = lc->int_p_cs_precedes;
15911 if eval $compile; then
15912 d_lc_monetary_2008="$define"
15914 d_lc_monetary_2008="$undef"
15920 : see if lchown exists
15922 $cat > try.c <<'EOCP'
15923 /* System header to define __stub macros and hopefully few prototypes,
15924 which can conflict with char lchown(); below. */
15925 #include <assert.h>
15926 /* Override any gcc2 internal prototype to avoid an error. */
15927 /* We use char because int might match the return type of a gcc2
15928 builtin and then its argument prototype would still apply. */
15931 /* The GNU C library defines this for functions which it implements
15932 to always fail with ENOSYS. Some functions are actually named
15933 something starting with __ and the normal name is an alias. */
15934 #if defined (__stub_lchown) || defined (__stub___lchown)
15942 if eval $compile; then
15943 $echo "lchown() found." >&4
15946 $echo "lchown() NOT found." >&4
15952 : See if number of significant digits in a double precision number is known
15954 $cat >ldbl_dig.c <<EOM
15955 #$i_limits I_LIMITS
15958 #include <limits.h>
15964 printf("Contains LDBL_DIG");
15967 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
15968 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
15969 echo "LDBL_DIG found." >&4
15972 echo "LDBL_DIG NOT found." >&4
15979 : see if lgamma exists
15980 set lgamma d_lgamma
15983 : see if lgamma_r exists
15984 set lgamma_r d_lgamma_r
15987 : check to see if math.h defines _LIB_VERSION
15988 d_libm_lib_version="$undef"
15992 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
15994 #include <unistd.h>
15996 int main (int argc, char *argv[])
15998 printf ("%d\n", _LIB_VERSION);
16003 if eval $compile; then
16005 echo "Yes, it does ($foo)" >&4
16006 d_libm_lib_version="$define"
16008 echo "No, it does not (probably harmless)" >&4
16015 : see if link exists
16019 : see if llrint exists
16020 set llrint d_llrint
16023 : see if llrintl exists
16024 set llrintl d_llrintl
16027 : see if llround exists
16028 set llround d_llround
16031 : see if llroundl exists
16032 set llroundl d_llroundl
16035 : see if localtime_r exists
16036 set localtime_r d_localtime_r
16038 case "$d_localtime_r" in
16040 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
16041 case "$d_localtime_r_proto:$usethreads" in
16042 ":define") d_localtime_r_proto=define
16043 set d_localtime_r_proto localtime_r $hdrs
16047 case "$d_localtime_r_proto" in
16049 case "$localtime_r_proto" in
16050 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
16051 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=S_TS ;;
16053 case "$localtime_r_proto" in
16054 ''|0) try='int localtime_r(const time_t*, struct tm*);'
16055 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=I_TS ;;
16057 case "$localtime_r_proto" in
16058 ''|0) d_localtime_r=undef
16059 localtime_r_proto=0
16060 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
16061 * ) case "$localtime_r_proto" in
16062 REENTRANT_PROTO*) ;;
16063 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
16065 echo "Prototype: $try" ;;
16068 *) case "$usethreads" in
16069 define) echo "localtime_r has no prototype, not using it." >&4 ;;
16071 d_localtime_r=undef
16072 localtime_r_proto=0
16076 *) localtime_r_proto=0
16080 : see if localtime_r calls tzset
16081 case "$localtime_r_proto" in
16084 /* Does our libc's localtime_r call tzset ?
16085 * return 0 if so, 1 otherwise.
16087 #$i_systypes I_SYS_TYPES
16088 #$i_unistd I_UNISTD
16090 #$i_stdlib I_STDLIB
16091 #$i_string I_STRING
16092 #$i_malloc I_MALLOC
16094 # include <sys/types.h>
16097 # include <unistd.h>
16103 #include <stdlib.h>
16106 # include <string.h>
16108 # include <strings.h>
16111 # include <malloc.h>
16115 time_t t = time(0L);
16116 char w_tz[]="TZ" "=GMT+5",
16117 e_tz[]="TZ" "=GMT-5",
16118 *tz_e = (char*)malloc(16),
16119 *tz_w = (char*)malloc(16);
16120 struct tm tm_e, tm_w;
16121 memset(&tm_e,'\0',sizeof(struct tm));
16122 memset(&tm_w,'\0',sizeof(struct tm));
16127 localtime_r(&t, &tm_e);
16130 localtime_r(&t, &tm_w);
16132 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
16138 if eval $compile; then
16139 if $run ./try; then
16140 d_localtime_r_needs_tzset=undef;
16142 d_localtime_r_needs_tzset=define;
16145 d_localtime_r_needs_tzset=undef;
16149 d_localtime_r_needs_tzset=undef;
16154 : see if lockf exists
16158 : see if log1p exists
16162 : see if log2 exists
16166 : see if logb exists
16170 : see if lrint exists
16174 : see if lrintl exists
16175 set lrintl d_lrintl
16178 : see if lround exists
16179 set lround d_lround
16182 : see if lroundl exists
16183 set lroundl d_lroundl
16186 : see if prototype for lseek is available
16188 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
16191 : see if lstat exists
16195 : see if madvise exists
16196 set madvise d_madvise
16199 : see if malloc_size exists
16200 set malloc_size d_malloc_size
16203 : see if malloc_size_good exists
16204 set malloc_good_size d_malloc_good_size
16207 : see if mblen exists
16211 : see if mbstowcs exists
16212 set mbstowcs d_mbstowcs
16215 : see if mbtowc exists
16216 set mbtowc d_mbtowc
16219 : see if memchr exists
16220 set memchr d_memchr
16223 : see if memcmp exists
16224 set memcmp d_memcmp
16227 : see if memcpy exists
16228 set memcpy d_memcpy
16231 : see if memmove exists
16232 set memmove d_memmove
16235 : see if memset exists
16236 set memset d_memset
16239 : see if mkdir exists
16243 : see if mkdtemp exists
16244 set mkdtemp d_mkdtemp
16247 : see if mkfifo exists
16248 set mkfifo d_mkfifo
16251 : see if mkstemp exists
16252 set mkstemp d_mkstemp
16255 : see if mkstemps exists
16256 set mkstemps d_mkstemps
16259 : see if mktime exists
16260 set mktime d_mktime
16263 : see if this is a sys/mman.h system
16264 set sys/mman.h i_sysmman
16267 : see if mmap exists
16270 : see what shmat returns
16271 : default to something harmless
16273 case "$i_sysmman$d_mmap" in
16275 $cat >mmap.c <<'END'
16276 #include <sys/mman.h>
16279 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
16284 echo "and it returns ($mmaptype)." >&4
16290 : see if sqrtl exists
16294 : see if scalbnl exists
16295 set scalbnl d_scalbnl
16298 : see if truncl exists
16299 set truncl d_truncl
16302 : see if modfl exists
16306 : see if prototype for modfl is available
16308 set d_modflproto modfl $i_math math.h
16311 d_modfl_pow32_bug="$undef"
16313 case "$d_longdbl$d_modfl" in
16316 Checking to see whether your modfl() is okay for large values...
16322 if $test "X$d_modflproto" != "X$define"; then
16323 $cat >>try.c <<EOCP
16324 /* Sigh. many current glibcs provide the function, but do not prototype it. */
16325 long double modfl (long double, long double *);
16328 $cat >>try.c <<EOCP
16330 long double nv = 4294967303.15;
16336 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
16340 case "$osname:$gccversion" in
16341 aix:) saveccflags="$ccflags"
16342 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
16345 if eval $compile; then
16348 *" 4294967303.150000 1.150000 4294967302.000000")
16349 echo >&4 "Your modfl() is broken for large values."
16350 d_modfl_pow32_bug="$define"
16352 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
16356 *" 4294967303.150000 0.150000 4294967303.000000")
16357 echo >&4 "Your modfl() seems okay for large values."
16359 *) echo >&4 "I don't understand your modfl() at all."
16365 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
16368 case "$osname:$gccversion" in
16369 aix:) ccflags="$saveccflags" ;; # restore
16374 if $test "$uselongdouble" = "$define"; then
16376 if $test "$d_sqrtl" != "$define"; then
16377 message="$message sqrtl"
16379 if $test "$d_modfl" != "$define"; then
16380 if $test "$d_truncl:$d_copysignl" = "$define:$define"; then
16381 echo "You have both truncl and copysignl, so I can emulate modfl."
16383 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
16384 echo "You have both aintl and copysignl, so I can emulate modfl."
16386 message="$message modfl"
16390 if $test "$d_frexpl" != "$define"; then
16391 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
16392 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
16394 message="$message frexpl"
16397 if $test "$d_ldexpl" != "$define"; then
16398 message="$message ldexpl"
16401 if $test "$message" != ""; then
16404 *** You requested the use of long doubles but you do not seem to have
16405 *** the following mathematical functions needed for long double support:
16407 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
16408 *** Cannot continue, aborting.
16416 : see if mprotect exists
16417 set mprotect d_mprotect
16420 : see if msgctl exists
16421 set msgctl d_msgctl
16424 : see if msgget exists
16425 set msgget d_msgget
16428 : see if msgsnd exists
16429 set msgsnd d_msgsnd
16432 : see if msgrcv exists
16433 set msgrcv d_msgrcv
16436 : see how much of the 'msg*(2)' library is present.
16439 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
16440 *"$undef"*) h_msg=false;;
16444 case "`ipcs 2>&1`" in
16445 "SVID messages"*"not configured"*)
16446 echo "Your $osname does not have the msg*(2) configured." >&4
16449 set msgctl d_msgctl
16451 set msgget d_msgget
16453 set msgsnd d_msgsnd
16455 set msgrcv d_msgrcv
16461 : we could also check for sys/ipc.h ...
16462 if $h_msg && $test `./findhdr sys/msg.h`; then
16463 echo "You have the full msg*(2) library." >&4
16466 echo "You don't have the full msg*(2) library." >&4
16472 : Check for msghdr_s
16474 echo "Checking to see if your system supports struct msghdr..." >&4
16475 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
16477 case "$d_msghdr_s" in
16478 "$define") echo "Yes, it does." ;;
16479 *) echo "No, it doesn't." ;;
16483 : see if msync exists
16487 : see if munmap exists
16488 set munmap d_munmap
16491 : see if nan exists
16495 : see if nearbyint exists
16496 set nearbyint d_nearbyint
16499 : see if nextafter exists
16500 set nextafter d_nextafter
16503 : see if nexttoward exists
16504 set nexttoward d_nexttoward
16507 : see if nice exists
16511 : see if this is a langinfo.h system
16512 set langinfo.h i_langinfo
16515 : see if nl_langinfo exists
16516 set nl_langinfo d_nl_langinfo
16519 : see if this is a quadmath.h system
16520 set quadmath.h i_quadmath
16523 : check for volatile keyword
16525 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
16526 $cat >try.c <<'EOCP'
16529 typedef struct _goo_struct goo_struct;
16530 goo_struct * volatile goo = ((goo_struct *)0);
16531 struct _goo_struct {
16536 typedef unsigned short foo_t;
16537 char *volatile foo;
16539 volatile foo_t blech;
16543 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
16545 echo "Yup, it does."
16548 echo "Nope, it doesn't."
16554 : Check basic sizes
16556 $echo "Choosing the C types to be used for Perl's internal types..." >&4
16558 case "$use64bitint:$d_quad:$quadtype" in
16561 uvtype="$uquadtype"
16566 uvtype="unsigned long"
16572 case "$uselongdouble:$d_longdbl" in
16574 nvtype="long double"
16575 nvsize=$longdblsize
16582 case "$usequadmath:$i_quadmath" in
16584 nvtype="__float128"
16590 *** You requested the use of the quadmath library, but you
16591 *** do not seem to have the quadmath library installed.
16592 *** Cannot continue, aborting.
16598 define:*) $cat <<EOM >&4
16600 *** You requested the use of the quadmath library, but you
16601 *** do not seem to have the required header, <quadmath.h>.
16603 case "$gccversion" in
16606 *** Your gcc looks a bit old:
16612 *** You are not running a gcc.
16617 *** For the quadmath library you need at least gcc 4.6.
16618 *** Cannot continue, aborting.
16624 $echo "(IV will be "$ivtype", $ivsize bytes)"
16625 $echo "(UV will be "$uvtype", $uvsize bytes)"
16626 $echo "(NV will be "$nvtype", $nvsize bytes)"
16629 #$i_inttypes I_INTTYPES
16631 #include <inttypes.h>
16636 int8_t i = INT8_MAX;
16637 uint8_t u = UINT8_MAX;
16638 printf("int8_t\n");
16641 int16_t i = INT16_MAX;
16642 uint16_t u = UINT16_MAX;
16643 printf("int16_t\n");
16646 int32_t i = INT32_MAX;
16647 uint32_t u = UINT32_MAX;
16648 printf("int32_t\n");
16653 i8type="signed char"
16654 u8type="unsigned char"
16659 '') case "$shortsize" in
16661 u16type="unsigned short"
16669 '') set try -DINT16
16670 if eval $compile; then
16671 case "`$run ./try`" in
16683 '') if $test $shortsize -ge 2; then
16685 u16type="unsigned short"
16693 '') case "$longsize" in
16695 u32type="unsigned long"
16699 *) case "$intsize" in
16701 u32type="unsigned int"
16711 '') set try -DINT32
16712 if eval $compile; then
16713 case "`$run ./try`" in
16725 '') if $test $intsize -ge 4; then
16727 u32type="unsigned int"
16735 '') case "$d_quad:$quadtype" in
16737 i64type="$quadtype"
16738 u64type="$uquadtype"
16746 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
16747 : volatile so that the compiler has to store it out to memory.
16748 if test X"$d_volatile" = X"$define"; then
16753 #$i_stdlib I_STDLIB
16755 #include <stdlib.h>
16757 #include <sys/types.h>
16758 #include <signal.h>
16760 $volatile int bletched = 0;
16761 $signal_t blech(int s) { bletched = 1; }
16766 int n = 8 * $uvsize;
16769 signal(SIGFPE, blech);
16772 for (i = 0; i < n; i++) {
16773 u = u << 1 | ($uvtype)1;
16775 if (($uvtype)d != u)
16779 d = ($nvtype)(u - 1);
16780 if (($uvtype)d != (u - 1))
16787 printf("%d\n", ((i == n) ? -n : i));
16793 d_nv_preserves_uv="$undef"
16794 if eval $compile; then
16795 nv_preserves_uv_bits="`$run ./try`"
16797 case "$nv_preserves_uv_bits" in
16799 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
16800 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
16801 d_nv_preserves_uv="$define"
16803 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
16804 d_nv_preserves_uv="$undef" ;;
16805 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
16806 nv_preserves_uv_bits="0" ;;
16810 $echo "Checking to find the largest integer value your NVs can hold..." >&4
16811 : volatile so that the compiler has to store it out to memory.
16812 if test X"$d_volatile" = X"$define"; then
16818 typedef $nvtype NV;
16825 while(count < 256) {
16826 $volatile NV up = value + 1.0;
16827 $volatile NV negated = -value;
16828 $volatile NV down = negated - 1.0;
16829 $volatile NV got_up = up - value;
16830 int up_good = got_up == 1.0;
16831 int got_down = down - negated;
16832 int down_good = got_down == -1.0;
16834 if (down_good != up_good) {
16836 "Inconsistency - up %d %f; down %d %f; for 2**%d (%.20f)\n",
16837 up_good, (double) got_up, down_good, (double) got_down,
16838 count, (double) value);
16845 fputs("256.0", stdout);
16848 fputs("2.0", stdout);
16854 fputs("*", stdout);
16860 fprintf(stderr, "Cannot overflow integer range, even at 2**%d (%.20f)\n",
16861 count, (double) value);
16867 nv_overflows_integers_at='0'
16868 if eval $compile; then
16874 The largest integer your NVs can preserve is equal to $xxx
16876 nv_overflows_integers_at="$xxx"
16879 Cannot determine the largest integer value your NVs can hold, unexpected output
16886 Cannot determine the largest integer value your NVs can hold
16893 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
16894 : volatile so that the compiler has to store it out to memory.
16895 if test X"$d_volatile" = X"$define"; then
16900 #$i_stdlib I_STDLIB
16902 #include <stdlib.h>
16904 #$i_string I_STRING
16906 # include <string.h>
16908 # include <strings.h>
16910 #include <sys/types.h>
16911 #include <signal.h>
16913 $volatile int bletched = 0;
16914 $signal_t blech(int s) { bletched = 1; }
16917 int checkit($nvtype d, char *where) {
16918 unsigned char *p = (char *)&d;
16919 unsigned char *end = p + sizeof(d);
16929 printf("No - %s: 0x", where);
16931 printf ("%02X", *p++);
16936 int main(int argc, char **argv) {
16939 fail += checkit(d, "0.0");
16941 /* The compiler shouldn't be assuming that bletched is 0 */
16944 fail += checkit(d, "bleched");
16947 signal(SIGFPE, blech);
16950 /* Paranoia - the compiler should have no way of knowing that ANSI says
16951 that argv[argc] will always be NULL. Actually, if it did assume this it
16952 would be buggy, as this is C and main() can be called from elsewhere in
16954 d = argv[argc] ? 1 : 0;
16957 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
16960 fail += checkit(d, "ternary");
16962 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
16965 printf("No - memset doesn't give 0.0\n");
16966 /* This might just blow up: */
16967 printf("(gives %g)\n", d);
16973 printf("No - something bleched\n");
16978 printf("No - %d fail(s)\n", fail);
16987 d_nv_zero_is_allbits_zero="$undef"
16988 if eval $compile; then
16994 0.0 is represented as all bits zero in memory
16996 d_nv_zero_is_allbits_zero="$define"
16999 0.0 is not represented as all bits zero in memory
17001 d_nv_zero_is_allbits_zero="$undef"
17006 0.0 is not represented as all bits zero in memory
17008 d_nv_zero_is_allbits_zero="$undef"
17014 : check for off64_t
17016 echo "Checking to see if you have off64_t..." >&4
17018 #include <sys/types.h>
17019 #include <unistd.h>
17020 int main() { off64_t x = 7; }
17023 if eval $compile; then
17025 echo "You have off64_t."
17028 echo "You do not have off64_t."
17029 case "$lseeksize" in
17030 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
17037 : how to create joinable pthreads
17038 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
17040 echo "Checking what constant to use for creating joinable pthreads..." >&4
17041 $cat >try.c <<'EOCP'
17042 #include <pthread.h>
17044 int detachstate = JOINABLE;
17047 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
17048 if eval $compile; then
17049 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
17050 val="$undef" # Yes, undef.
17051 set d_old_pthread_create_joinable
17054 set old_pthread_create_joinable
17057 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
17058 if eval $compile; then
17059 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
17061 set d_old_pthread_create_joinable
17063 val=PTHREAD_CREATE_UNDETACHED
17064 set old_pthread_create_joinable
17067 set try -DJOINABLE=__UNDETACHED
17068 if eval $compile; then
17069 echo "You seem to use __UNDETACHED." >&4
17071 set d_old_pthread_create_joinable
17074 set old_pthread_create_joinable
17077 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
17079 set d_old_pthread_create_joinable
17082 set old_pthread_create_joinable
17089 d_old_pthread_create_joinable="$undef"
17090 old_pthread_create_joinable=""
17093 : see if pause exists
17097 : see if poll exists
17101 : see if prctl exists
17105 : see if prctl supports PR_SET_NAME
17106 d_prctl_set_name=$undef
17111 #include <unistd.h>
17113 #include <sys/prctl.h>
17115 int main (int argc, char *argv[])
17117 return (prctl (PR_SET_NAME, "Test"));
17121 if eval $compile_ok && $run ./try; then
17122 echo "Your prctl (PR_SET_NAME, ...) works"
17123 d_prctl_set_name=$define
17129 : see if readlink exists
17130 set readlink d_readlink
17133 : Check if exe is symlink to abs path of executing program
17137 case "$d_readlink" in
17139 : NetBSD first as /proc/self is a symlink to /proc/curproc, and it feels
17140 : more tidy to avoid an extra level of symlink
17141 set NetBSD /proc/curproc/exe Linux /proc/self/exe FreeBSD /proc/curproc/file Solaris /proc/self/path/a.out
17142 while test $# -gt 0; do
17145 if $issymlink $try; then
17146 $ls -l $try > reflect
17147 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
17148 echo "You have $type-like $try."
17149 procselfexe='"'$try'"'
17151 : This will break out of the loop
17162 : backward compatibility for d_hvfork
17163 if test X$d_hvfork != X; then
17164 d_vfork="$d_hvfork"
17167 : see if there is a vfork
17172 d_pseudofork=$undef
17174 : Ok, but do we want to use it. vfork is reportedly unreliable in
17175 : perl on Solaris 2.x, and probably elsewhere.
17179 case "$usevfork" in
17185 Perl can only use a vfork() that doesn't suffer from strict
17186 restrictions on calling functions or modifying global data in
17187 the child. For example, glibc-2.1 contains such a vfork()
17188 that is unsuitable. If your system provides a proper fork()
17189 call, chances are that you do NOT want perl to use vfork().
17192 rp="Do you still want to use vfork()?"
17197 echo "Ok, we won't use vfork()."
17206 $define) usevfork='true';;
17207 *) usevfork='false';;
17210 : see whether the pthread_atfork exists
17212 #include <pthread.h>
17215 #ifdef PTHREAD_ATFORK
17216 pthread_atfork(NULL,NULL,NULL);
17221 : see if pthread_atfork exists
17222 set try -DPTHREAD_ATFORK
17223 if eval $compile; then
17228 case "$usethreads" in
17231 $define) echo 'pthread_atfork found.' >&4 ;;
17232 *) echo 'pthread_atfork NOT found.' >&4 ;;
17235 set d_pthread_atfork
17238 : see if pthread_attr_setscope exists
17239 set pthread_attr_setscope d_pthread_attr_setscope
17242 : see whether the various POSIXish _yields exist
17244 #include <pthread.h>
17250 #ifdef PTHREAD_YIELD
17253 #ifdef PTHREAD_YIELD_NULL
17254 pthread_yield(NULL);
17260 : see if sched_yield exists
17261 set try -DSCHED_YIELD
17262 if eval $compile; then
17264 sched_yield='sched_yield()'
17268 case "$usethreads" in
17271 $define) echo 'sched_yield() found.' >&4 ;;
17272 *) echo 'sched_yield() NOT found.' >&4 ;;
17278 : see if pthread_yield exists
17279 set try -DPTHREAD_YIELD
17280 if eval $compile; then
17282 case "$sched_yield" in
17283 '') sched_yield='pthread_yield()' ;;
17286 set try -DPTHREAD_YIELD_NULL
17287 if eval $compile; then
17289 case "$sched_yield" in
17290 '') sched_yield='pthread_yield(NULL)' ;;
17296 case "$usethreads" in
17299 $define) echo 'pthread_yield() found.' >&4 ;;
17300 *) echo 'pthread_yield() NOT found.' >&4 ;;
17304 set d_pthread_yield
17306 case "$sched_yield" in
17307 '') sched_yield=undef ;;
17311 : check for ptrdiff_t
17313 echo "Checking to see if you have ptrdiff_t..." >&4
17315 #include <stddef.h>
17316 int main() { ptrdiff_t x = 7; }
17319 if eval $compile; then
17321 echo "You have ptrdiff_t."
17324 echo "You do not have ptrdiff_t."
17330 : see if random_r exists
17331 set random_r d_random_r
17333 case "$d_random_r" in
17335 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17336 case "$d_random_r_proto:$usethreads" in
17337 ":define") d_random_r_proto=define
17338 set d_random_r_proto random_r $hdrs
17342 case "$d_random_r_proto" in
17344 case "$random_r_proto" in
17345 ''|0) try='int random_r(int*, struct random_data*);'
17346 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_iS ;;
17348 case "$random_r_proto" in
17349 ''|0) try='int random_r(long*, struct random_data*);'
17350 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_lS ;;
17352 case "$random_r_proto" in
17353 ''|0) try='int random_r(struct random_data*, int32_t*);'
17354 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_St ;;
17356 case "$random_r_proto" in
17357 ''|0) d_random_r=undef
17359 echo "Disabling random_r, cannot determine prototype." >&4 ;;
17360 * ) case "$random_r_proto" in
17361 REENTRANT_PROTO*) ;;
17362 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
17364 echo "Prototype: $try" ;;
17367 *) case "$usethreads" in
17368 define) echo "random_r has no prototype, not using it." >&4 ;;
17375 *) random_r_proto=0
17379 : see if readdir and friends exist
17380 set readdir d_readdir
17382 set seekdir d_seekdir
17384 set telldir d_telldir
17386 set rewinddir d_rewinddir
17389 : see if readdir64_r exists
17390 set readdir64_r d_readdir64_r
17392 case "$d_readdir64_r" in
17394 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
17395 case "$d_readdir64_r_proto:$usethreads" in
17396 ":define") d_readdir64_r_proto=define
17397 set d_readdir64_r_proto readdir64_r $hdrs
17401 case "$d_readdir64_r_proto" in
17403 case "$readdir64_r_proto" in
17404 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
17405 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TSR ;;
17407 case "$readdir64_r_proto" in
17408 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
17409 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TS ;;
17411 case "$readdir64_r_proto" in
17412 ''|0) d_readdir64_r=undef
17413 readdir64_r_proto=0
17414 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
17415 * ) case "$readdir64_r_proto" in
17416 REENTRANT_PROTO*) ;;
17417 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
17419 echo "Prototype: $try" ;;
17422 *) case "$usethreads" in
17423 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
17425 d_readdir64_r=undef
17426 readdir64_r_proto=0
17430 *) readdir64_r_proto=0
17434 : see if readdir_r exists
17435 set readdir_r d_readdir_r
17437 case "$d_readdir_r" in
17439 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
17440 case "$d_readdir_r_proto:$usethreads" in
17441 ":define") d_readdir_r_proto=define
17442 set d_readdir_r_proto readdir_r $hdrs
17446 case "$d_readdir_r_proto" in
17448 case "$readdir_r_proto" in
17449 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
17450 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TSR ;;
17452 case "$readdir_r_proto" in
17453 ''|0) try='int readdir_r(DIR*, struct dirent*);'
17454 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TS ;;
17456 case "$readdir_r_proto" in
17457 ''|0) d_readdir_r=undef
17459 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
17460 * ) case "$readdir_r_proto" in
17461 REENTRANT_PROTO*) ;;
17462 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
17464 echo "Prototype: $try" ;;
17467 *) case "$usethreads" in
17468 define) echo "readdir_r has no prototype, not using it." >&4 ;;
17475 *) readdir_r_proto=0
17479 : see if readv exists
17483 : see if recvmsg exists
17484 set recvmsg d_recvmsg
17487 : see if regcomp, regcmp, or re_comp exist, for regular pattern matching
17489 if set regcomp val -f d_regcomp; eval $csym; $val; then
17490 echo 'regcomp() found.' >&4
17491 d_regcomp="$define"
17494 elif set regcmp val -f d_regcmp; eval $csym; $val; then
17495 echo 'regcmp() found.' >&4
17499 elif set re_comp val -f d_re_comp; eval $csym; $val; then
17500 echo 're_comp() found, assuming re_exec() also exists.' >&4
17501 d_re_comp="$define"
17506 No regcomp(), regcmp() nor re_comp() found !! No regular pattern matching.
17513 : see if remainder exists
17514 set remainder d_remainder
17517 : see if remquo exists
17518 set remquo d_remquo
17521 : see if rename exists
17522 set rename d_rename
17525 : see if rint exists
17529 : see if rmdir exists
17533 : see if round exists
17537 : see if memory.h is available.
17542 : See if it conflicts with string.h
17548 $cppstdin $cppflags $cppminus < $strings > mem.h
17549 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
17551 echo "We won't be including <memory.h>."
17561 : can bcopy handle overlapping blocks?
17564 case "$d_memmove" in
17565 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
17566 *) case "$d_bcopy" in
17568 echo "Checking to see if bcopy() can do overlapping copies..." >&4
17570 #$i_memory I_MEMORY
17571 #$i_stdlib I_STDLIB
17572 #$i_string I_STRING
17573 #$i_unistd I_UNISTD
17575 $cat >>try.c <<'EOCP'
17578 # include <memory.h>
17581 # include <stdlib.h>
17584 # include <string.h>
17586 # include <strings.h>
17589 # include <unistd.h> /* Needed for NetBSD */
17593 char buf[128], abc[128];
17599 /* Copy "abcde..." string to char abc[] so that gcc doesn't
17600 try to store the string in read-only memory. */
17601 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
17603 for (align = 7; align >= 0; align--) {
17604 for (len = 36; len; len--) {
17606 bcopy(abc, b, len);
17607 for (off = 1; off <= len; off++) {
17608 bcopy(b, b+off, len);
17609 bcopy(b+off, b, len);
17610 if (bcmp(b, abc, len))
17619 if eval $compile_ok; then
17620 if $run ./try 2>/dev/null; then
17621 echo "Yes, it can."
17624 echo "It can't, sorry."
17627 echo "(I can't compile the test program, so we'll assume not...)"
17637 : can memcpy handle overlapping blocks?
17640 case "$d_memmove" in
17641 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
17642 *) case "$d_memcpy" in
17644 echo "Checking to see if memcpy() can do overlapping copies..." >&4
17646 #$i_memory I_MEMORY
17647 #$i_stdlib I_STDLIB
17648 #$i_string I_STRING
17649 #$i_unistd I_UNISTD
17651 $cat >>try.c <<'EOCP'
17654 # include <memory.h>
17657 # include <stdlib.h>
17660 # include <string.h>
17662 # include <strings.h>
17665 # include <unistd.h> /* Needed for NetBSD */
17669 char buf[128], abc[128];
17675 /* Copy "abcde..." string to char abc[] so that gcc doesn't
17676 try to store the string in read-only memory. */
17677 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
17679 for (align = 7; align >= 0; align--) {
17680 for (len = 36; len; len--) {
17682 memcpy(b, abc, len);
17683 for (off = 1; off <= len; off++) {
17684 memcpy(b+off, b, len);
17685 memcpy(b, b+off, len);
17686 if (memcmp(b, abc, len))
17695 if eval $compile_ok; then
17696 if $run ./try 2>/dev/null; then
17697 echo "Yes, it can."
17700 echo "It can't, sorry."
17703 echo "(I can't compile the test program, so we'll assume not...)"
17713 : can memcmp be trusted to compare relative magnitude?
17715 case "$d_memcmp" in
17718 echo "Checking if your memcmp() can compare relative magnitude..." >&4
17720 #$i_memory I_MEMORY
17721 #$i_stdlib I_STDLIB
17722 #$i_string I_STRING
17723 #$i_unistd I_UNISTD
17725 $cat >>try.c <<'EOCP'
17728 # include <memory.h>
17731 # include <stdlib.h>
17734 # include <string.h>
17736 # include <strings.h>
17739 # include <unistd.h> /* Needed for NetBSD */
17745 if ((a < b) && memcmp(&a, &b, 1) < 0)
17751 if eval $compile_ok; then
17752 if $run ./try 2>/dev/null; then
17753 echo "Yes, it can."
17756 echo "No, it can't (it uses signed chars)."
17759 echo "(I can't compile the test program, so we'll assume not...)"
17767 : see if prototype for sbrk is available
17769 set d_sbrkproto sbrk $i_unistd unistd.h
17772 : see if scalbn exists
17773 set scalbn d_scalbn
17776 : see if select exists
17777 set select d_select
17780 : see if semctl exists
17781 set semctl d_semctl
17784 : see if semget exists
17785 set semget d_semget
17788 : see if semop exists
17792 : see how much of the 'sem*(2)' library is present.
17795 case "$d_semctl$d_semget$d_semop" in
17796 *"$undef"*) h_sem=false;;
17800 case "`ipcs 2>&1`" in
17801 "SVID messages"*"not configured"*)
17802 echo "Your $osname does not have the sem*(2) configured." >&4
17805 set semctl d_semctl
17807 set semget d_semget
17815 : we could also check for sys/ipc.h ...
17816 if $h_sem && $test `./findhdr sys/sem.h`; then
17817 echo "You have the full sem*(2) library." >&4
17820 echo "You don't have the full sem*(2) library." >&4
17826 : see whether sys/sem.h defines union semun
17828 $cat > try.c <<'END'
17829 #include <sys/types.h>
17830 #include <sys/ipc.h>
17831 #include <sys/sem.h>
17832 int main () { union semun semun; semun.buf = 0; }
17835 if eval $compile; then
17836 echo "You have union semun in <sys/sem.h>." >&4
17839 echo "You do not have union semun in <sys/sem.h>." >&4
17846 : see how to do semctl IPC_STAT
17850 $cat > tryh.h <<END
17853 # define S_IRUSR S_IREAD
17854 # define S_IWUSR S_IWRITE
17855 # define S_IXUSR S_IEXEC
17857 # define S_IRUSR 0400
17858 # define S_IWUSR 0200
17859 # define S_IXUSR 0100
17861 # define S_IRGRP (S_IRUSR>>3)
17862 # define S_IWGRP (S_IWUSR>>3)
17863 # define S_IXGRP (S_IXUSR>>3)
17864 # define S_IROTH (S_IRUSR>>6)
17865 # define S_IWOTH (S_IWUSR>>6)
17866 # define S_IXOTH (S_IXUSR>>6)
17869 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
17870 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
17871 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
17874 : see whether semctl IPC_STAT can use union semun
17875 case "$d_semctl_semun" in
17879 #include <sys/types.h>
17880 #include <sys/ipc.h>
17881 #include <sys/sem.h>
17882 #include <sys/stat.h>
17889 #$d_union_semun HAS_UNION_SEMUN
17892 #ifndef HAS_UNION_SEMUN
17895 struct semid_ds *buf;
17896 unsigned short *array;
17902 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
17903 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
17905 struct semid_ds argbuf;
17908 st = semctl(sem, 0, IPC_STAT, arg);
17912 # endif /* IPC_STAT */
17913 printf("semctl IPC_STAT failed: errno = %d\n", errno);
17915 if (semctl(sem, 0, IPC_RMID, arg) != 0)
17916 # endif /* IPC_RMID */
17917 printf("semctl IPC_RMID failed: errno = %d\n", errno);
17919 #endif /* IPC_PRIVATE && ... */
17920 printf("semget failed: errno = %d\n", errno);
17925 if eval $compile; then
17928 semun) val="$define" ;;
17936 case "$d_semctl_semun" in
17938 echo "You can use union semun for semctl IPC_STAT." >&4
17941 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
17946 : see whether semctl IPC_STAT can use struct semid_ds pointer
17947 case "$d_semctl_semid_ds" in
17950 $cat > try.c <<'END'
17951 #include <sys/types.h>
17952 #include <sys/ipc.h>
17953 #include <sys/sem.h>
17954 #include <sys/stat.h>
17962 struct semid_ds arg;
17965 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
17966 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
17969 st = semctl(sem, 0, IPC_STAT, &arg);
17971 printf("semid_ds\n");
17973 # endif /* IPC_STAT */
17974 printf("semctl IPC_STAT failed: errno = %d\n", errno);
17976 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
17977 # endif /* IPC_RMID */
17978 printf("semctl IPC_RMID failed: errno = %d\n", errno);
17980 #endif /* IPC_PRIVATE && ... */
17981 printf("semget failed: errno = %d\n", errno);
17987 if eval $compile; then
17990 semid_ds) val="$define" ;;
17994 set d_semctl_semid_ds
17998 case "$d_semctl_semid_ds" in
18000 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
18002 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
18008 # We do not have the full sem*(2) library, so assume we can not
18014 set d_semctl_semid_ds
18020 : see if sendmsg exists
18021 set sendmsg d_sendmsg
18024 : see if setegid exists
18025 set setegid d_setegid
18028 : see if seteuid exists
18029 set seteuid d_seteuid
18032 : see if setgrent exists
18033 set setgrent d_setgrent
18036 : see if setgrent_r exists
18037 set setgrent_r d_setgrent_r
18039 case "$d_setgrent_r" in
18041 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
18042 case "$d_setgrent_r_proto:$usethreads" in
18043 ":define") d_setgrent_r_proto=define
18044 set d_setgrent_r_proto setgrent_r $hdrs
18048 case "$d_setgrent_r_proto" in
18050 case "$setgrent_r_proto" in
18051 ''|0) try='int setgrent_r(FILE**);'
18052 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=I_H ;;
18054 case "$setgrent_r_proto" in
18055 ''|0) try='void setgrent_r(FILE**);'
18056 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=V_H ;;
18058 case "$setgrent_r_proto" in
18059 ''|0) d_setgrent_r=undef
18061 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
18062 * ) case "$setgrent_r_proto" in
18063 REENTRANT_PROTO*) ;;
18064 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
18066 echo "Prototype: $try" ;;
18069 *) case "$usethreads" in
18070 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
18077 *) setgrent_r_proto=0
18081 : see if sethostent exists
18082 set sethostent d_sethent
18085 : see if sethostent_r exists
18086 set sethostent_r d_sethostent_r
18088 case "$d_sethostent_r" in
18090 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18091 case "$d_sethostent_r_proto:$usethreads" in
18092 ":define") d_sethostent_r_proto=define
18093 set d_sethostent_r_proto sethostent_r $hdrs
18097 case "$d_sethostent_r_proto" in
18099 case "$sethostent_r_proto" in
18100 ''|0) try='int sethostent_r(int, struct hostent_data*);'
18101 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=I_ID ;;
18103 case "$sethostent_r_proto" in
18104 ''|0) try='void sethostent_r(int, struct hostent_data*);'
18105 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=V_ID ;;
18107 case "$sethostent_r_proto" in
18108 ''|0) d_sethostent_r=undef
18109 sethostent_r_proto=0
18110 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
18111 * ) case "$sethostent_r_proto" in
18112 REENTRANT_PROTO*) ;;
18113 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
18115 echo "Prototype: $try" ;;
18118 *) case "$usethreads" in
18119 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
18121 d_sethostent_r=undef
18122 sethostent_r_proto=0
18126 *) sethostent_r_proto=0
18130 : see if setitimer exists
18131 set setitimer d_setitimer
18134 : see if setlinebuf exists
18135 set setlinebuf d_setlinebuf
18138 : see if setlocale exists
18139 set setlocale d_setlocale
18142 : see if locale.h is available
18143 set locale.h i_locale
18146 : see if setlocale_r exists
18147 set setlocale_r d_setlocale_r
18149 case "$d_setlocale_r" in
18151 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
18152 case "$d_setlocale_r_proto:$usethreads" in
18153 ":define") d_setlocale_r_proto=define
18154 set d_setlocale_r_proto setlocale_r $hdrs
18158 case "$d_setlocale_r_proto" in
18160 case "$setlocale_r_proto" in
18161 ''|0) try='int setlocale_r(int, const char*, char*, int);'
18162 ./protochk "$extern_C $try" $hdrs && setlocale_r_proto=I_ICBI ;;
18164 case "$setlocale_r_proto" in
18165 ''|0) d_setlocale_r=undef
18166 setlocale_r_proto=0
18167 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
18168 * ) case "$setlocale_r_proto" in
18169 REENTRANT_PROTO*) ;;
18170 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
18172 echo "Prototype: $try" ;;
18175 *) case "$usethreads" in
18176 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
18178 d_setlocale_r=undef
18179 setlocale_r_proto=0
18183 *) setlocale_r_proto=0
18187 : see if setnetent exists
18188 set setnetent d_setnent
18191 : see if setnetent_r exists
18192 set setnetent_r d_setnetent_r
18194 case "$d_setnetent_r" in
18196 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18197 case "$d_setnetent_r_proto:$usethreads" in
18198 ":define") d_setnetent_r_proto=define
18199 set d_setnetent_r_proto setnetent_r $hdrs
18203 case "$d_setnetent_r_proto" in
18205 case "$setnetent_r_proto" in
18206 ''|0) try='int setnetent_r(int, struct netent_data*);'
18207 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=I_ID ;;
18209 case "$setnetent_r_proto" in
18210 ''|0) try='void setnetent_r(int, struct netent_data*);'
18211 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=V_ID ;;
18213 case "$setnetent_r_proto" in
18214 ''|0) d_setnetent_r=undef
18215 setnetent_r_proto=0
18216 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
18217 * ) case "$setnetent_r_proto" in
18218 REENTRANT_PROTO*) ;;
18219 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
18221 echo "Prototype: $try" ;;
18224 *) case "$usethreads" in
18225 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
18227 d_setnetent_r=undef
18228 setnetent_r_proto=0
18232 *) setnetent_r_proto=0
18236 : see if setprotoent exists
18237 set setprotoent d_setpent
18240 : see if setpgid exists
18241 set setpgid d_setpgid
18244 : see if setpgrp2 exists
18245 set setpgrp2 d_setpgrp2
18248 : see if setpriority exists
18249 set setpriority d_setprior
18252 : see if setproctitle exists
18253 set setproctitle d_setproctitle
18256 : see if setprotoent_r exists
18257 set setprotoent_r d_setprotoent_r
18259 case "$d_setprotoent_r" in
18261 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18262 case "$d_setprotoent_r_proto:$usethreads" in
18263 ":define") d_setprotoent_r_proto=define
18264 set d_setprotoent_r_proto setprotoent_r $hdrs
18268 case "$d_setprotoent_r_proto" in
18270 case "$setprotoent_r_proto" in
18271 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
18272 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=I_ID ;;
18274 case "$setprotoent_r_proto" in
18275 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
18276 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=V_ID ;;
18278 case "$setprotoent_r_proto" in
18279 ''|0) d_setprotoent_r=undef
18280 setprotoent_r_proto=0
18281 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
18282 * ) case "$setprotoent_r_proto" in
18283 REENTRANT_PROTO*) ;;
18284 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
18286 echo "Prototype: $try" ;;
18289 *) case "$usethreads" in
18290 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
18292 d_setprotoent_r=undef
18293 setprotoent_r_proto=0
18297 *) setprotoent_r_proto=0
18301 : see if setpwent exists
18302 set setpwent d_setpwent
18305 : see if setpwent_r exists
18306 set setpwent_r d_setpwent_r
18308 case "$d_setpwent_r" in
18310 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
18311 case "$d_setpwent_r_proto:$usethreads" in
18312 ":define") d_setpwent_r_proto=define
18313 set d_setpwent_r_proto setpwent_r $hdrs
18317 case "$d_setpwent_r_proto" in
18319 case "$setpwent_r_proto" in
18320 ''|0) try='int setpwent_r(FILE**);'
18321 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=I_H ;;
18323 case "$setpwent_r_proto" in
18324 ''|0) try='void setpwent_r(FILE**);'
18325 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=V_H ;;
18327 case "$setpwent_r_proto" in
18328 ''|0) d_setpwent_r=undef
18330 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
18331 * ) case "$setpwent_r_proto" in
18332 REENTRANT_PROTO*) ;;
18333 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
18335 echo "Prototype: $try" ;;
18338 *) case "$usethreads" in
18339 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
18346 *) setpwent_r_proto=0
18350 : see if setregid exists
18351 set setregid d_setregid
18353 set setresgid d_setresgid
18356 : see if setreuid exists
18357 set setreuid d_setreuid
18359 set setresuid d_setresuid
18362 : see if setrgid exists
18363 set setrgid d_setrgid
18366 : see if setruid exists
18367 set setruid d_setruid
18370 : see if setservent exists
18371 set setservent d_setsent
18374 : see if setservent_r exists
18375 set setservent_r d_setservent_r
18377 case "$d_setservent_r" in
18379 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18380 case "$d_setservent_r_proto:$usethreads" in
18381 ":define") d_setservent_r_proto=define
18382 set d_setservent_r_proto setservent_r $hdrs
18386 case "$d_setservent_r_proto" in
18388 case "$setservent_r_proto" in
18389 ''|0) try='int setservent_r(int, struct servent_data*);'
18390 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=I_ID ;;
18392 case "$setservent_r_proto" in
18393 ''|0) try='void setservent_r(int, struct servent_data*);'
18394 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=V_ID ;;
18396 case "$setservent_r_proto" in
18397 ''|0) d_setservent_r=undef
18398 setservent_r_proto=0
18399 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
18400 * ) case "$setservent_r_proto" in
18401 REENTRANT_PROTO*) ;;
18402 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
18404 echo "Prototype: $try" ;;
18407 *) case "$usethreads" in
18408 define) echo "setservent_r has no prototype, not using it." >&4 ;;
18410 d_setservent_r=undef
18411 setservent_r_proto=0
18415 *) setservent_r_proto=0
18419 : see if setsid exists
18420 set setsid d_setsid
18423 : see if setvbuf exists
18424 set setvbuf d_setvbuf
18427 : see if shmctl exists
18428 set shmctl d_shmctl
18431 : see if shmget exists
18432 set shmget d_shmget
18435 : see if shmat exists
18438 : see what shmat returns
18441 $cat >shmat.c <<'END'
18442 #include <sys/shm.h>
18445 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
18450 echo "and it returns ($shmattype)." >&4
18451 : see if a prototype for shmat is available
18452 xxx=`./findhdr sys/shm.h`
18453 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
18454 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
18465 set d_shmatprototype
18468 : see if shmdt exists
18472 : see how much of the 'shm*(2)' library is present.
18475 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
18476 *"$undef"*) h_shm=false;;
18480 case "`ipcs 2>&1`" in
18481 "SVID shared memory"*"not configured"*)
18482 echo "Your $osname does not have the shm*(2) configured." >&4
18485 set shmctl d_shmctl
18487 set shmget d_shmget
18497 : we could also check for sys/ipc.h ...
18498 if $h_shm && $test `./findhdr sys/shm.h`; then
18499 echo "You have the full shm*(2) library." >&4
18502 echo "You don't have the full shm*(2) library." >&4
18508 : see if we have sigaction
18510 if set sigaction val -f d_sigaction; eval $csym; $val; then
18511 echo 'sigaction() found.' >&4
18514 #include <sys/types.h>
18515 #include <signal.h>
18516 #$i_stdlib I_STDLIB
18518 #include <stdlib.h>
18522 struct sigaction act, oact;
18524 oact.sa_handler = 0;
18525 /* so that act and oact are used */
18526 exit(act.sa_flags == 0 && oact.sa_handler == 0);
18530 if eval $compile_ok; then
18533 echo "But you don't seem to have a usable struct sigaction." >&4
18537 echo 'sigaction NOT found.' >&4
18540 set d_sigaction; eval $setvar
18543 : see if this is a sunmath.h system
18544 set sunmath.h i_sunmath
18547 : see if signbit exists
18548 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
18551 #$i_sunmath I_SUNMATH
18555 #ifdef I_SUNMATH /* Solaris special math library */
18556 # include <sunmath.h>
18559 int main(int argc, char **argv)
18563 if ((signbit(x) == 0) && (signbit(y) != 0))
18571 if eval $compile; then
18572 if $run ./try; then
18576 $echo "Signbit seems to be available, but doesn't work as I expected."
18577 $echo "I won't use it." >&4
18588 : see if sigprocmask exists
18589 set sigprocmask d_sigprocmask
18592 : see if sigsetjmp exists
18594 case "$d_sigsetjmp" in
18597 #include <setjmp.h>
18598 #$i_stdlib I_STDLIB
18600 #include <stdlib.h>
18606 if (sigsetjmp(env,1))
18609 siglongjmp(env, 1);
18614 if eval $compile; then
18615 if $run ./try >/dev/null 2>&1; then
18616 echo "POSIX sigsetjmp found." >&4
18620 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
18626 echo "sigsetjmp not found." >&4
18630 *) val="$d_sigsetjmp"
18631 case "$d_sigsetjmp" in
18632 $define) echo "POSIX sigsetjmp found." >&4;;
18633 $undef) echo "sigsetjmp not found." >&4;;
18641 : see if snprintf exists
18642 set snprintf d_snprintf
18645 : see if vsnprintf exists
18646 set vsnprintf d_vsnprintf
18649 case "$d_snprintf-$d_vsnprintf" in
18652 Checking whether your snprintf() and vsnprintf() work okay...
18654 $cat >try.c <<'EOCP'
18655 /* v?snprintf testing logic courtesy of Russ Allbery.
18656 * According to C99:
18657 * - if the buffer is too short it still must be \0-terminated
18658 * - if the buffer is too short the potentially required length
18659 * must be returned and not -1
18660 * - if the buffer is NULL the potentially required length
18661 * must be returned and not -1 or core dump
18664 #include <stdarg.h>
18668 int test (char *format, ...)
18673 va_start (args, format);
18674 count = vsnprintf (buf, sizeof buf, format, args);
18681 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
18682 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
18686 if eval $compile; then
18689 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
18691 Your snprintf() and snprintf() don't seem to be working okay.
18693 d_snprintf="$undef"
18694 d_vsnprintf="$undef"
18698 echo "(I can't seem to compile the test program--assuming they don't)"
18699 d_snprintf="$undef"
18700 d_vsnprintf="$undef"
18706 : see if sockatmark exists
18707 set sockatmark d_sockatmark
18710 : see if prototype for sockatmark is available
18712 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
18715 : see if socks5_init exists
18716 set socks5_init d_socks5_init
18719 : see if sprintf returns the length of the string in the buffer as per ANSI
18720 $echo "Checking whether sprintf returns the length of the string..." >&4
18723 #$i_stdlib I_STDLIB
18725 #include <stdlib.h>
18727 #$i_string I_STRING
18729 # include <string.h>
18731 # include <strings.h>
18740 int check (size_t expect, int test) {
18741 size_t got = strlen(buffer);
18745 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
18750 int main(int argc, char **argv) {
18753 check(sprintf(buffer, ""), ++test);
18754 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
18755 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
18762 if eval $compile; then
18766 sprintf returns the length of the string (as ANSI says it should)
18768 d_sprintf_returns_strlen="$define"
18771 sprintf does not return the length of the string (how old is this system?)
18773 d_sprintf_returns_strlen="$undef"
18777 echo "(I can't seem to compile the test program--assuming it doesn't)" >&4
18778 d_sprintf_returns_strlen="$undef"
18782 : see if srand48_r exists
18783 set srand48_r d_srand48_r
18785 case "$d_srand48_r" in
18787 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
18788 case "$d_srand48_r_proto:$usethreads" in
18789 ":define") d_srand48_r_proto=define
18790 set d_srand48_r_proto srand48_r $hdrs
18794 case "$d_srand48_r_proto" in
18796 case "$srand48_r_proto" in
18797 ''|0) try='int srand48_r(long, struct drand48_data*);'
18798 ./protochk "$extern_C $try" $hdrs && srand48_r_proto=I_LS ;;
18800 case "$srand48_r_proto" in
18801 ''|0) d_srand48_r=undef
18803 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
18804 * ) case "$srand48_r_proto" in
18805 REENTRANT_PROTO*) ;;
18806 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
18808 echo "Prototype: $try" ;;
18811 *) case "$usethreads" in
18812 define) echo "srand48_r has no prototype, not using it." >&4 ;;
18819 *) srand48_r_proto=0
18823 : see if srandom_r exists
18824 set srandom_r d_srandom_r
18826 case "$d_srandom_r" in
18828 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
18829 case "$d_srandom_r_proto:$usethreads" in
18830 ":define") d_srandom_r_proto=define
18831 set d_srandom_r_proto srandom_r $hdrs
18835 case "$d_srandom_r_proto" in
18837 case "$srandom_r_proto" in
18838 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
18839 ./protochk "$extern_C $try" $hdrs && srandom_r_proto=I_TS ;;
18841 case "$srandom_r_proto" in
18842 ''|0) d_srandom_r=undef
18844 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
18845 * ) case "$srandom_r_proto" in
18846 REENTRANT_PROTO*) ;;
18847 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
18849 echo "Prototype: $try" ;;
18852 *) case "$usethreads" in
18853 define) echo "srandom_r has no prototype, not using it." >&4 ;;
18860 *) srandom_r_proto=0
18864 : see if prototype for setresgid is available
18866 set d_sresgproto setresgid $i_unistd unistd.h
18869 : see if prototype for setresuid is available
18871 set d_sresuproto setresuid $i_unistd unistd.h
18874 : see if stat exists
18878 : see if sys/stat.h is available
18879 set sys/stat.h i_sysstat
18882 : see if stat knows about block sizes
18884 echo "Checking to see if your struct stat has st_blocks field..." >&4
18885 set d_statblks stat st_blocks $i_sysstat sys/stat.h
18888 : see if this is a sys/vfs.h system
18889 set sys/vfs.h i_sysvfs
18892 : see if this is a sys/statfs.h system
18893 set sys/statfs.h i_sysstatfs
18896 : Check for statfs_s
18898 echo "Checking to see if your system supports struct statfs..." >&4
18899 set d_statfs_s statfs $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h $i_sysvfs sys/vfs.h $i_sysstatfs sys/statfs.h
18901 case "$d_statfs_s" in
18902 "$define") echo "Yes, it does." ;;
18903 *) echo "No, it doesn't." ;;
18907 : see if struct statfs knows about f_flags
18908 case "$d_statfs_s" in
18911 echo "Checking to see if your struct statfs has f_flags field..." >&4
18912 set d_statfs_f_flags statfs f_flags $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h $i_sysvfs sys/vfs.h $i_sysstatfs sys/statfs.h
18916 set d_statfs_f_flags
18920 case "$d_statfs_f_flags" in
18921 "$define") echo "Yes, it does." ;;
18922 *) echo "No, it doesn't." ;;
18925 : see what flavor, if any, of static inline is supported
18927 echo "Checking to see if your system supports static inline..."
18928 $cat > try.c <<'EOCP'
18929 #include <stdlib.h>
18930 extern int f_via_a(int x);
18931 extern int f_via_b(int x);
18932 int main(int argc, char **argv)
18941 return EXIT_SUCCESS;
18944 return EXIT_FAILURE;
18948 $cat > a.c <<'EOCP'
18949 static INLINE int f(int x) {
18960 $cat > b.c <<'EOCP'
18961 extern int f(int x);
18969 # Respect a hint (or previous) value for perl_static_inline, if there is one.
18970 case "$perl_static_inline" in
18971 '') # Check the various possibilities, and break out on success.
18972 # For gcc, prefer __inline__, which will still permit
18973 # cflags.SH to add in -ansi.
18974 case "$gccversion" in
18975 '') xxx="inline __inline__ __inline _inline";;
18976 *) xxx="__inline__ inline __inline _inline";;
18978 for inline in $xxx; do
18979 set try -DINLINE=$inline a.c
18980 if eval $compile && $run ./try; then
18981 # Now make sure there is no external linkage of static
18983 set try -DINLINE=$inline -DUSE_B a.c b.c
18984 if eval $compile && $run ./try; then
18985 $echo "Your compiler supports static $inline, " >&4
18986 $echo "but it also creates an external definition," >&4
18987 $echo "so I won't use it." >&4
18990 $echo "Your compiler supports static $inline." >&4
18992 perl_static_inline="static $inline";
18996 $echo "Your compiler does NOT support static $inline." >&4
19001 *inline*) # Some variant of inline exists.
19002 echo "Keeping your $hint value of $perl_static_inline."
19005 static) # No inline capabilities
19006 echo "Keeping your $hint value of $perl_static_inline."
19009 *) # Unrecognized previous value -- blindly trust the supplied
19010 # value and hope it makes sense. Use old value for
19011 # d_static_inline, if there is one.
19012 echo "Keeping your $hint value of $perl_static_inline."
19013 case "$d_static_inline" in
19015 *) val=$d_static_inline ;;
19019 # Fallback to plain 'static' if nothing worked.
19020 case "$perl_static_inline" in
19022 perl_static_inline="static"
19026 set d_static_inline
19028 $rm -f a.[co] b.[co]
19031 : Check stream access
19033 Checking how to access stdio streams by file descriptor number...
19035 case "$stdio_stream_array" in
19036 '') $cat >try.c <<EOCP
19039 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
19043 for s in _iob __iob __sF
19045 set try -DSTDIO_STREAM_ARRAY=$s
19046 if eval $compile; then
19047 case "`$run ./try`" in
19048 yes) stdio_stream_array=$s; break ;;
19054 case "$stdio_stream_array" in
19056 I can't figure out how to access stdio streams by file descriptor number.
19058 d_stdio_stream_array="$undef"
19061 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
19063 d_stdio_stream_array="$define"
19067 : see if strcoll exists
19068 set strcoll d_strcoll
19071 : check for structure copying
19073 echo "Checking to see if your C compiler can copy structs..." >&4
19074 $cat >try.c <<'EOCP'
19084 if $cc -c try.c >/dev/null 2>&1 ; then
19086 echo "Yup, it can."
19089 echo "Nope, it can't."
19095 : see if strerror and/or sys_errlist[] exist
19097 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
19098 if set strerror val -f d_strerror; eval $csym; $val; then
19099 echo 'strerror() found.' >&4
19100 d_strerror="$define"
19101 d_strerrm='strerror(e)'
19102 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
19103 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
19104 d_syserrlst="$define"
19106 echo "(Since you don't have sys_errlist[], strerror() is welcome.)"
19107 d_syserrlst="$undef"
19109 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
19110 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
19111 echo 'strerror() found in string header.' >&4
19112 d_strerror="$define"
19113 d_strerrm='strerror(e)'
19114 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
19115 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
19116 d_syserrlst="$define"
19118 echo "(You don't appear to have any sys_errlist[], how can this be?)"
19119 d_syserrlst="$undef"
19121 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
19122 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
19123 d_strerror="$undef"
19124 d_syserrlst="$define"
19125 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
19127 echo 'strerror() and sys_errlist[] NOT found.' >&4
19128 d_strerror="$undef"
19129 d_syserrlst="$undef"
19130 d_strerrm='"unknown"'
19134 : see if strerror_r exists
19135 set strerror_r d_strerror_r
19137 case "$d_strerror_r" in
19139 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
19140 case "$d_strerror_r_proto:$usethreads" in
19141 ":define") d_strerror_r_proto=define
19142 set d_strerror_r_proto strerror_r $hdrs
19146 case "$d_strerror_r_proto" in
19148 case "$strerror_r_proto" in
19149 ''|0) try='int strerror_r(int, char*, size_t);'
19150 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBW ;;
19152 case "$strerror_r_proto" in
19153 ''|0) try='int strerror_r(int, char*, int);'
19154 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBI ;;
19156 case "$strerror_r_proto" in
19157 ''|0) try='char* strerror_r(int, char*, size_t);'
19158 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=B_IBW ;;
19160 case "$strerror_r_proto" in
19161 ''|0) d_strerror_r=undef
19163 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
19164 * ) case "$strerror_r_proto" in
19165 REENTRANT_PROTO*) ;;
19166 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
19168 echo "Prototype: $try" ;;
19171 *) case "$usethreads" in
19172 define) echo "strerror_r has no prototype, not using it." >&4 ;;
19179 *) strerror_r_proto=0
19183 : see if strftime exists
19184 set strftime d_strftime
19187 : see if strlcat exists
19188 set strlcat d_strlcat
19191 : see if strlcpy exists
19192 set strlcpy d_strlcpy
19195 : see if strtod exists
19196 set strtod d_strtod
19199 : see if strtol exists
19200 set strtol d_strtol
19203 : see if strtold exists
19204 set strtold d_strtold
19207 : see if strtoll exists
19208 set strtoll d_strtoll
19211 case "$d_longlong-$d_strtoll" in
19214 Checking whether your strtoll() works okay...
19216 $cat >try.c <<'EOCP'
19219 #define strtoll __strtoll
19222 #define strtoll _strtoll
19225 extern long long int strtoll(char *s, char **, int);
19226 static int bad = 0;
19227 int check(char *s, long long ell, int een) {
19230 gll = strtoll(s, 0, 10);
19231 if (!((gll == ell) && (errno == een)))
19235 check(" 1", 1LL, 0);
19236 check(" 0", 0LL, 0);
19237 check("-1", -1LL, 0);
19238 check("-9223372036854775808", -9223372036854775808LL, 0);
19239 check("-9223372036854775808", -9223372036854775808LL, 0);
19240 check(" 9223372036854775807", 9223372036854775807LL, 0);
19241 check("-9223372036854775808", -9223372036854775808LL, 0);
19242 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
19243 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
19249 if eval $compile; then
19252 ok) echo "Your strtoll() seems to be working okay." ;;
19254 Your strtoll() doesn't seem to be working okay.
19260 echo "(I can't seem to compile the test program--assuming it doesn't)"
19266 : see if strtoq exists
19267 set strtoq d_strtoq
19270 : see if strtoul exists
19271 set strtoul d_strtoul
19274 case "$d_strtoul" in
19277 Checking whether your strtoul() works okay...
19279 $cat >try.c <<'EOCP'
19282 extern unsigned long int strtoul(char *s, char **, int);
19283 static int bad = 0;
19284 void check(char *s, unsigned long eul, int een) {
19287 gul = strtoul(s, 0, 10);
19288 if (!((gul == eul) && (errno == een)))
19292 check(" 1", 1L, 0);
19293 check(" 0", 0L, 0);
19295 case "$longsize" in
19297 $cat >>try.c <<'EOCP'
19298 check("18446744073709551615", 18446744073709551615UL, 0);
19299 check("18446744073709551616", 18446744073709551615UL, ERANGE);
19300 #if 0 /* strtoul() for /^-/ strings is undefined. */
19301 check("-1", 18446744073709551615UL, 0);
19302 check("-18446744073709551614", 2, 0);
19303 check("-18446744073709551615", 1, 0);
19304 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
19305 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
19310 $cat >>try.c <<'EOCP'
19311 check("4294967295", 4294967295UL, 0);
19312 check("4294967296", 4294967295UL, ERANGE);
19313 #if 0 /* strtoul() for /^-/ strings is undefined. */
19314 check("-1", 4294967295UL, 0);
19315 check("-4294967294", 2, 0);
19316 check("-4294967295", 1, 0);
19317 check("-4294967296", 4294967295UL, ERANGE);
19318 check("-4294967297", 4294967295UL, ERANGE);
19323 : Should we write these tests to be more portable by sprintf-ing
19324 : ~0 and then manipulating that char string as input for strtol?
19327 $cat >>try.c <<'EOCP'
19334 if eval $compile; then
19335 case "`$run ./try`" in
19336 ok) echo "Your strtoul() seems to be working okay." ;;
19338 Your strtoul() doesn't seem to be working okay.
19344 echo "(I can't seem to compile the test program--assuming it doesn't)"
19350 : see if strtoull exists
19351 set strtoull d_strtoull
19354 case "$d_longlong-$d_strtoull" in
19357 Checking whether your strtoull() works okay...
19359 $cat >try.c <<'EOCP'
19362 #define strtoull __strtoull
19365 extern unsigned long long int strtoull(char *s, char **, int);
19366 static int bad = 0;
19367 int check(char *s, long long eull, int een) {
19370 gull = strtoull(s, 0, 10);
19371 if (!((gull == eull) && (errno == een)))
19375 check(" 1", 1LL, 0);
19376 check(" 0", 0LL, 0);
19377 check("18446744073709551615", 18446744073709551615ULL, 0);
19378 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
19379 #if 0 /* strtoull() for /^-/ strings is undefined. */
19380 check("-1", 18446744073709551615ULL, 0);
19381 check("-18446744073709551614", 2LL, 0);
19382 check("-18446744073709551615", 1LL, 0);
19383 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
19384 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
19391 if eval $compile; then
19392 case "`$run ./try`" in
19393 ok) echo "Your strtoull() seems to be working okay." ;;
19395 Your strtoull() doesn't seem to be working okay.
19397 d_strtoull="$undef"
19401 echo "(I can't seem to compile the test program--assuming it doesn't)"
19402 d_strtoull="$undef"
19407 : see if strtouq exists
19408 set strtouq d_strtouq
19411 case "$d_strtouq" in
19414 Checking whether your strtouq() works okay...
19416 $cat >try.c <<'EOCP'
19419 extern unsigned long long int strtouq(char *s, char **, int);
19420 static int bad = 0;
19421 void check(char *s, unsigned long long eull, int een) {
19422 unsigned long long gull;
19424 gull = strtouq(s, 0, 10);
19425 if (!((gull == eull) && (errno == een)))
19429 check(" 1", 1LL, 0);
19430 check(" 0", 0LL, 0);
19431 check("18446744073709551615", 18446744073709551615ULL, 0);
19432 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
19433 #if 0 /* strtouq() for /^-/ strings is undefined. */
19434 check("-1", 18446744073709551615ULL, 0);
19435 check("-18446744073709551614", 2LL, 0);
19436 check("-18446744073709551615", 1LL, 0);
19437 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
19438 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
19446 if eval $compile; then
19447 case "`$run ./try`" in
19448 ok) echo "Your strtouq() seems to be working okay." ;;
19450 Your strtouq() doesn't seem to be working okay.
19456 echo "(I can't seem to compile the test program--assuming it doesn't)"
19462 : see if strxfrm exists
19463 set strxfrm d_strxfrm
19466 : see if symlink exists
19467 set symlink d_symlink
19470 : see if syscall exists
19471 set syscall d_syscall
19474 : see if prototype for syscall is available
19476 set d_syscallproto syscall $i_unistd unistd.h
19479 : see if sysconf exists
19480 set sysconf d_sysconf
19483 : see if system exists
19484 set system d_system
19487 : see if tcgetpgrp exists
19488 set tcgetpgrp d_tcgetpgrp
19491 : see if tcsetpgrp exists
19492 set tcsetpgrp d_tcsetpgrp
19495 : see if prototype for telldir is available
19497 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
19500 : see if tgamma exists
19501 set tgamma d_tgamma
19504 : see if time exists
19506 if test "X$d_time" = X -o X"$timetype" = X; then
19507 if set time val -f d_time; eval $csym; $val; then
19508 echo 'time() found.' >&4
19510 rp="What is the type returned by time() on this system?"
19511 set time_t timetype long stdio.h sys/types.h
19514 echo 'time() not found, hope that will do.' >&4
19522 : see if timegm exists
19523 set timegm d_timegm
19526 : see if this is a sys/times.h system
19527 set sys/times.h i_systimes
19530 : see if times exists
19532 if set times val -f d_times; eval $csym; $val; then
19533 echo 'times() found.' >&4
19536 case "$i_systimes" in
19537 "$define") inc='sys/times.h';;
19539 rp="What is the type returned by times() on this system?"
19540 set clock_t clocktype long stdio.h sys/types.h $inc
19543 echo 'times() NOT found, hope that will do.' >&4
19548 : see if tmpnam_r exists
19549 set tmpnam_r d_tmpnam_r
19551 case "$d_tmpnam_r" in
19553 hdrs="$i_systypes sys/types.h define stdio.h "
19554 case "$d_tmpnam_r_proto:$usethreads" in
19555 ":define") d_tmpnam_r_proto=define
19556 set d_tmpnam_r_proto tmpnam_r $hdrs
19560 case "$d_tmpnam_r_proto" in
19562 case "$tmpnam_r_proto" in
19563 ''|0) try='char* tmpnam_r(char*);'
19564 ./protochk "$extern_C $try" $hdrs && tmpnam_r_proto=B_B ;;
19566 case "$tmpnam_r_proto" in
19567 ''|0) d_tmpnam_r=undef
19569 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
19570 * ) case "$tmpnam_r_proto" in
19571 REENTRANT_PROTO*) ;;
19572 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
19574 echo "Prototype: $try" ;;
19577 *) case "$usethreads" in
19578 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
19585 *) tmpnam_r_proto=0
19589 : see if trunc exists
19593 : see if truncate exists
19594 set truncate d_truncate
19597 : see if ttyname_r exists
19598 set ttyname_r d_ttyname_r
19600 case "$d_ttyname_r" in
19602 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
19603 case "$d_ttyname_r_proto:$usethreads" in
19604 ":define") d_ttyname_r_proto=define
19605 set d_ttyname_r_proto ttyname_r $hdrs
19609 case "$d_ttyname_r_proto" in
19611 case "$ttyname_r_proto" in
19612 ''|0) try='int ttyname_r(int, char*, size_t);'
19613 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBW ;;
19615 case "$ttyname_r_proto" in
19616 ''|0) try='int ttyname_r(int, char*, int);'
19617 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBI ;;
19619 case "$ttyname_r_proto" in
19620 ''|0) try='char* ttyname_r(int, char*, int);'
19621 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=B_IBI ;;
19623 case "$ttyname_r_proto" in
19624 ''|0) d_ttyname_r=undef
19626 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
19627 * ) case "$ttyname_r_proto" in
19628 REENTRANT_PROTO*) ;;
19629 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
19631 echo "Prototype: $try" ;;
19634 *) case "$usethreads" in
19635 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
19642 *) ttyname_r_proto=0
19646 : see if tzname[] exists
19648 if set tzname val -a d_tzname; eval $csym; $val; then
19650 echo 'tzname[] found.' >&4
19653 echo 'tzname[] NOT found.' >&4
19658 : Check if is a multiplatform env
19660 darwin) multiarch="$define" ;;
19662 case "$multiarch" in
19663 ''|[nN]*) multiarch="$undef" ;;
19666 : check for ordering of bytes in a UV
19668 case "$multiarch" in
19671 You seem to be doing a multiarchitecture build,
19672 skipping the byteorder check.
19678 case "$byteorder" in
19681 In the following, larger digits indicate more significance. A big-endian
19682 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
19683 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
19684 machines may have weird orders like 3412. A Cray will report 87654321,
19685 an Alpha will report 12345678. If the test program works the default is
19687 I'm now running the test program...
19691 #$i_stdlib I_STDLIB
19693 #include <stdlib.h>
19695 #include <sys/types.h>
19696 typedef $uvtype UV;
19706 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
19708 u.l = (UV)0x04030201;
19709 for (i = 0; i < $uvsize; i++)
19710 printf("%c", u.c[i]+'0');
19717 if eval $compile && $run ./try > /dev/null; then
19720 [1-4][1-4][1-4][1-4]|12345678|87654321)
19721 echo "(The test program ran ok.)"
19722 echo "byteorder=$dflt"
19725 ????|????????) echo "(The test program ran ok.)" ;;
19726 *) echo "(The test program didn't run right for some reason.)" ;;
19731 (I can't seem to compile the test program. Guessing big-endian...)
19734 case "$xxx_prompt" in
19736 rp="What is the order of bytes in $uvtype?"
19749 : Checking 32bit alignedness
19752 Checking to see whether you can access character data unalignedly...
19754 case "$d_u32align" in
19755 '') $cat >try.c <<EOCP
19757 #$i_stdlib I_STDLIB
19759 #include <stdlib.h>
19761 #define U32 $u32type
19762 #define BYTEORDER 0x$byteorder
19764 #include <signal.h>
19766 $signal_t bletch(int s) { exit(4); }
19769 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
19770 volatile U8 buf[8];
19774 if (sizeof(U32) != 4) {
19775 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
19782 signal(SIGBUS, bletch);
19794 for (i = 0; i < 4; i++) {
19795 up = (U32*)(buf + i);
19796 if (! ((*up == 1 << (8*i)) || /* big-endian */
19797 (*up == 1 << (8*(3-i))) /* little-endian */
19801 printf("read failed (%x)\n", *up);
19807 for (i = 0; i < 4; i++) {
19808 up = (U32*)(buf + i);
19810 if (*up != 0xBeef) {
19811 printf("write failed (%x)\n", *up);
19825 if eval $compile_ok; then
19826 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
19827 $run ./try 2>&1 >/dev/null
19830 You can access character data pretty unalignedly.
19832 d_u32align="$undef"
19835 It seems that you must access character data in an aligned manner.
19837 d_u32align="$define"
19841 rp='Can you access character data at unaligned addresses?'
19845 [yY]*) d_u32align="$undef" ;;
19846 *) d_u32align="$define" ;;
19853 : see if ualarm exists
19854 set ualarm d_ualarm
19857 : see if umask exists
19861 : see if unordered exists
19862 set unordered d_unordered
19865 : see if unsetenv exists
19866 set unsetenv d_unsetenv
19869 : see if usleep exists
19870 set usleep d_usleep
19873 : see if prototype for usleep is available
19875 set d_usleepproto usleep $i_unistd unistd.h
19878 : see if ustat exists
19882 : see if closedir exists
19883 set closedir d_closedir
19886 case "$d_closedir" in
19889 echo "Checking whether closedir() returns a status..." >&4
19891 #$i_dirent I_DIRENT /**/
19892 #$i_sysdir I_SYS_DIR /**/
19893 #$i_sysndir I_SYS_NDIR /**/
19894 #$i_systypes I_SYS_TYPES /**/
19896 #if defined(I_SYS_TYPES)
19897 #include <sys/types.h>
19899 #if defined(I_DIRENT)
19900 #include <dirent.h>
19903 #include <sys/ndir.h>
19907 #include <ndir.h> /* may be wrong in the future */
19909 #include <sys/dir.h>
19914 int main() { return closedir(opendir(".")); }
19917 if eval $compile_ok; then
19918 if $run ./try > /dev/null 2>&1 ; then
19919 echo "Yes, it does."
19922 echo "No, it doesn't."
19926 echo "(I can't seem to compile the test program--assuming it doesn't)"
19934 set d_void_closedir
19938 : see if there is a wait4
19942 : see if waitpid exists
19943 set waitpid d_waitpid
19948 $cat >try.c <<'EOCP'
19954 return (wcscmp (s, s) ? 1 : 0);
19959 if eval $compile; then
19962 0) echo "A working wcscmp() found." >&4
19964 *) echo "wcscmp() found, but it doesn't work" >&4
19968 echo "wcscmp() NOT found." >&4
19974 : see if wcstombs exists
19975 set wcstombs d_wcstombs
19980 $cat >try.c <<'EOCP'
19985 wchar_t dst[4], *src = L" ";
19987 return (wcsxfrm (dst, src, 1) ? errno ? errno : 0 : 1);
19992 if eval $compile; then
19995 0) echo "A working wcsxfrm() found." >&4
19997 *) echo "wcsxfrm() found, but it doesn't work" >&4
20001 echo "wcsxfrm() NOT found." >&4
20007 : see if wctomb exists
20008 set wctomb d_wctomb
20011 : see if writev exists
20012 set writev d_writev
20015 : check for alignment requirements
20017 case "$alignbytes" in
20018 '') echo "Checking alignment constraints..." >&4
20019 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
20020 $cat >try.c <<'EOCP'
20021 typedef long double NV;
20024 $cat >try.c <<'EOCP'
20028 $cat >>try.c <<'EOCP'
20036 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
20041 if eval $compile_ok; then
20045 echo "(I can't seem to compile the test program...)"
20047 case "$multiarch" in
20049 : The usual safe value is 8, but Darwin with -Duselongdouble
20050 : needs 16. Hence, we will take 8 as a minimum, but allow
20051 : Configure to pick a larger value if needed.
20052 if $test "$dflt" -lt 8; then
20054 echo "Setting alignment to 8 for multiarch support.">&4
20059 *) dflt="$alignbytes"
20062 rp="Doubles must be aligned on a how-many-byte boundary?"
20067 : set the base revision
20070 : length of character in bytes. Is always 1, otherwise it is not C
20071 : This used to be a test using sizeof
20074 : Check for the number of bits in a character
20075 case "$charbits" in
20076 '') echo "Checking how long a character is (in bits)..." >&4
20083 for (c = 1, n = 0; c; c <<= 1, n++) ;
20084 printf ("%d\n", n);
20089 if eval $compile_ok; then
20093 echo "(I can't seem to compile the test program. Guessing...)"
20100 rp="What is the length of a character (in bits)?"
20104 case "$charbits" in
20107 Your system has an unsigned character size of $charbits bits, which
20108 is rather unusual (normally it is 8 bits). Perl likely will not work
20109 correctly on your system, with subtle bugs in various places.
20111 rp='Do you really want to continue?'
20115 [yY]) echo >&4 "Okay, continuing." ;;
20120 : how do we concatenate cpp tokens here?
20122 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
20123 $cat >cpp_stuff.c <<'EOCP'
20124 #define RCAT(a,b)a/**/b
20125 #define ACAT(a,b)a ## b
20129 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
20130 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
20131 echo "Oh! Smells like ANSI's been here." >&4
20132 echo "We can catify or stringify, separately or together!"
20134 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
20135 echo "Ah, yes! The good old days!" >&4
20136 echo "However, in the good old days we don't know how to stringify and"
20137 echo "catify at the same time."
20141 Hmm, I don't seem to be able to concatenate tokens with your cpp.
20142 You're going to have to edit the values of CAT[2-5] in config.h...
20144 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
20148 : see if this is a db.h system
20154 : Check db version.
20156 echo "Checking Berkeley DB version ..." >&4
20162 #include <sys/types.h>
20164 #$i_stdlib I_STDLIB
20166 #include <stdlib.h>
20169 int main(int argc, char *argv[])
20171 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
20172 int Major, Minor, Patch ;
20173 unsigned long Version ;
20174 (void)db_version(&Major, &Minor, &Patch) ;
20176 printf("%d %d %d %d %d %d\n",
20177 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
20178 Major, Minor, Patch);
20181 printf("You have Berkeley DB Version 2 or greater.\n");
20183 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
20184 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
20185 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
20186 Major, Minor, Patch) ;
20188 /* check that db.h & libdb are compatible */
20189 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
20190 printf("db.h and libdb are incompatible.\n") ;
20194 printf("db.h and libdb are compatible.\n") ;
20196 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
20197 + DB_VERSION_PATCH ;
20199 /* needs to be >= 2.3.4 */
20200 if (Version < 2003004) {
20201 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
20202 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
20208 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
20213 printf("You have Berkeley DB Version 1.\n");
20214 exit(0); /* DB version < 2: the coast is clear. */
20216 exit(1); /* <db.h> not Berkeley DB? */
20222 if eval $compile_ok && $run ./try; then
20223 echo 'Looks OK.' >&4
20225 db_version_major=$1
20226 db_version_minor=$2
20227 db_version_patch=$3
20229 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
20233 : Remove db from list of libraries to use
20234 echo "Removing unusable -ldb from library list" >&4
20235 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
20238 echo "libs = $libs" >&4
20248 : Check the return type needed for hash
20250 echo "Checking return type needed for hash for Berkeley DB ..." >&4
20256 #include <sys/types.h>
20259 #ifndef DB_VERSION_MAJOR
20260 u_int32_t hash_cb (const void* ptr, size_t size)
20266 info.hash = hash_cb;
20270 if $cc $ccflags -c try.c >try.out 2>&1 ; then
20271 if $contains warning try.out >>/dev/null 2>&1 ; then
20274 db_hashtype='u_int32_t'
20277 : XXX Maybe we should just give up here.
20278 db_hashtype=u_int32_t
20280 echo "Help: I can't seem to compile the db test program." >&4
20281 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
20284 echo "Your version of Berkeley DB uses $db_hashtype for hash."
20286 *) db_hashtype=u_int32_t
20291 : Check the return type needed for prefix
20293 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
20299 #include <sys/types.h>
20302 #ifndef DB_VERSION_MAJOR
20303 size_t prefix_cb (const DBT *key1, const DBT *key2)
20309 info.prefix = prefix_cb;
20313 if $cc $ccflags -c try.c >try.out 2>&1 ; then
20314 if $contains warning try.out >>/dev/null 2>&1 ; then
20315 db_prefixtype='int'
20317 db_prefixtype='size_t'
20320 db_prefixtype='size_t'
20321 : XXX Maybe we should just give up here.
20323 echo "Help: I can't seem to compile the db test program." >&4
20324 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
20327 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
20329 *) db_prefixtype='size_t'
20333 : How can we generate normalized random numbers ?
20335 echo "Using our internal random number implementation..." >&4
20338 *-Dmy_rand=*|*-Dmy_srand=*)
20339 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
20340 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
20341 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
20342 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
20346 randfunc=Perl_drand48
20347 drand01="Perl_drand48()"
20348 seedfunc="Perl_drand48_init"
20352 : Determine if this is an EBCDIC system
20354 echo "Determining whether or not we are on an EBCDIC system..." >&4
20355 $cat >try.c <<'EOM'
20358 if ('M'==0xd4) return 0;
20365 if eval $compile_ok; then
20366 if $run ./try; then
20367 echo "You seem to speak EBCDIC." >&4
20370 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
20373 echo "I'm unable to compile the test program." >&4
20374 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
20380 : Check how to flush
20383 Checking how to flush all pending stdio output...
20385 # I only know how to find the first 32 possibly open files on SunOS.
20386 # See also hints/sunos_4_1.sh and util.c --AD
20388 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
20390 $cat >>try.c <<EOCP
20392 #$i_stdlib I_STDLIB
20394 #include <stdlib.h>
20396 #$i_unistd I_UNISTD
20398 # include <unistd.h>
20400 #$d_sysconf HAS_SYSCONF
20401 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
20402 #ifdef HAS_STDIO_STREAM_ARRAY
20403 # define STDIO_STREAM_ARRAY $stdio_stream_array
20408 p = fopen("try.out", "w");
20412 # ifdef TRY_FPRINTF
20416 #ifdef TRY_FFLUSH_NULL
20419 #ifdef TRY_FFLUSH_ALL
20421 long open_max = -1;
20422 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
20423 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
20425 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
20426 open_max = sysconf(_SC_OPEN_MAX);
20429 open_max = FOPEN_MAX;
20432 open_max = OPEN_MAX;
20441 # ifdef HAS_STDIO_STREAM_ARRAY
20442 if (open_max > 0) {
20444 for (i = 0; i < open_max; i++)
20445 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
20446 STDIO_STREAM_ARRAY[i]._file < open_max &&
20447 STDIO_STREAM_ARRAY[i]._flag)
20448 fflush(&STDIO_STREAM_ARRAY[i]);
20456 : first we have to find out how _not_ to flush
20458 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
20460 set try -DTRY_FPUTC
20461 if eval $compile; then
20462 $run ./try 2>/dev/null
20465 if $test ! -s try.out -a "X$code" = X42; then
20471 set try -DTRY_FPRINTF
20472 if eval $compile; then
20473 $run ./try 2>/dev/null
20476 if $test ! -s try.out -a "X$code" = X42; then
20477 output=-DTRY_FPRINTF
20483 : check for fflush NULL behavior
20484 case "$fflushNULL" in
20485 '') set try -DTRY_FFLUSH_NULL $output
20486 if eval $compile; then
20487 $run ./try 2>/dev/null
20490 if $test -s try.out -a "X$code" = X42; then
20491 fflushNULL="`$cat try.out`"
20493 if $test "X$code" != X42; then
20495 (If this test failed, don't worry, we'll try another method shortly.)
20500 $rm -f core try.core core.try.*
20501 case "$fflushNULL" in
20503 Your fflush(NULL) works okay for output streams.
20504 Let's see if it clobbers input pipes...
20506 # As of mid-March 2000 all versions of Solaris appear to have a stdio
20507 # bug that improperly flushes the input end of pipes. So we avoid the
20508 # autoflush on fork/system/exec support for now. :-(
20509 $cat >tryp.c <<EOCP
20512 main(int argc, char **argv)
20518 while ((i = getc(stdin)) != -1
20519 && (*bp++ = i) != '\n'
20520 && bp < &buf[1024])
20523 fprintf(stdout, "%s", buf);
20531 fflushNULL="$define"
20533 if eval $compile; then
20535 # Copy the .c file to the remote host ($to is an ssh-alike if targethost is set)
20536 if $test "X$targethost" != X; then
20539 $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
20541 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
20543 if cmp tryp.c tryp.out >/dev/null 2>&1; then
20545 fflush(NULL) seems to behave okay with input streams.
20547 fflushNULL="$define"
20550 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
20552 fflushNULL="$undef"
20555 $rm -f core tryp.c tryp.core core.tryp.*
20558 Your fflush(NULL) isn't working (contrary to ANSI C).
20560 fflushNULL="$undef"
20563 Cannot figure out whether your fflush(NULL) works or not.
20564 I'm assuming it doesn't (contrary to ANSI C).
20566 fflushNULL="$undef"
20570 $define|true|[yY]*)
20571 fflushNULL="$define"
20574 fflushNULL="$undef"
20577 : check explicit looping only if NULL did not work, and if the pipe
20578 : bug does not show up on an explicit flush too
20579 case "$fflushNULL" in
20581 $cat >tryp.c <<EOCP
20584 main(int argc, char **argv)
20590 while ((i = getc(stdin)) != -1
20591 && (*bp++ = i) != '\n'
20592 && bp < &buf[1024])
20595 fprintf(stdout, "%s", buf);
20604 if eval $compile; then
20606 if $test "X$targethost" != X; then
20609 $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
20611 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
20613 if cmp tryp.c tryp.out >/dev/null 2>&1; then
20615 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
20617 : now check for fflushall behaviour
20618 case "$fflushall" in
20619 '') set try -DTRY_FFLUSH_ALL $output
20620 if eval $compile; then
20622 (Now testing the other method--but note that this also may fail.)
20624 $run ./try 2>/dev/null
20627 if $test -s try.out -a "X$code" = X42; then
20628 fflushall="`$cat try.out`"
20632 case "$fflushall" in
20634 Whew. Flushing explicitly all the stdio streams works.
20636 fflushall="$define"
20639 Sigh. Flushing explicitly all the stdio streams doesn't work.
20644 Cannot figure out whether flushing stdio streams explicitly works or not.
20645 I'm assuming it doesn't.
20651 "$define"|true|[yY]*)
20652 fflushall="$define"
20660 All is futile. Even fflush(stdin) clobbers input pipes!
20667 $rm -f core tryp.c tryp.core core.tryp.*
20669 *) fflushall="$undef"
20673 case "$fflushNULL$fflushall" in
20676 OK, I give up. I cannot figure out how to flush pending stdio output.
20677 We won't be flushing handles at all before fork/exec/popen.
20683 : Store the full pathname to the ar program for use in the C program
20684 : Respect a hint or command line value for full_ar.
20689 : Store the full pathname to the sed program for use in the C program
20692 : see what type gids are declared as in the kernel
20694 echo "Looking for the type for group ids returned by getgid()."
20695 set gid_t gidtype xxx stdio.h sys/types.h
20699 xxx=`./findhdr sys/user.h`
20700 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
20702 unsigned) dflt="$1 $2" ;;
20706 *) dflt="$gidtype";;
20709 gid_t) echo "gid_t found." ;;
20710 *) rp="What is the type for group ids returned by getgid()?"
20716 : Check the size of GID
20719 *_t) zzz="$gidtype" ;;
20722 echo "Checking the size of $zzz..." >&4
20724 #include <sys/types.h>
20726 #$i_stdlib I_STDLIB
20728 #include <stdlib.h>
20731 printf("%d\n", (int)sizeof($gidtype));
20736 if eval $compile_ok; then
20740 echo "(I can't execute the test program--guessing $gidsize.)" >&4
20743 echo "Your $zzz is $gidsize bytes long."
20748 echo "(I can't compile the test program--guessing $gidsize.)" >&4
20752 : Check if GID is signed
20755 *_t) zzz="$gidtype" ;;
20758 echo "Checking the sign of $zzz..." >&4
20760 #include <sys/types.h>
20771 if eval $compile; then
20775 echo "(I can't execute the test program--guessing unsigned.)" >&4
20779 1) echo "Your $zzz is unsigned." ;;
20780 -1) echo "Your $zzz is signed." ;;
20786 echo "(I can't compile the test program--guessing unsigned.)" >&4
20790 : Check 64bit sizes
20793 if $test X"$quadtype" != X; then
20795 echo "Checking how to print 64-bit integers..." >&4
20797 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
20798 $cat >try.c <<'EOCP'
20799 #include <sys/types.h>
20802 int q = 12345678901;
20803 printf("%ld\n", q);
20807 if eval $compile; then
20811 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
20812 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
20813 echo "We will use %d."
20819 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
20820 $cat >try.c <<'EOCP'
20821 #include <sys/types.h>
20824 long q = 12345678901;
20825 printf("%ld\n", q);
20829 if eval $compile; then
20833 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
20834 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
20835 echo "We will use %ld."
20841 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
20842 $cat >try.c <<'EOCP'
20843 #include <sys/types.h>
20844 #include <inttypes.h>
20847 int64_t q = 12345678901;
20848 printf("%" PRId64 "\n", q);
20852 if eval $compile; then
20856 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
20857 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
20858 echo "We will use the C9X style."
20864 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
20866 #include <sys/types.h>
20869 $quadtype q = 12345678901;
20870 printf("%Ld\n", q);
20874 if eval $compile; then
20878 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
20879 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
20880 echo "We will use %Ld."
20886 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
20887 $cat >try.c <<'EOCP'
20888 #include <sys/types.h>
20891 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
20892 printf("%lld\n", q);
20896 if eval $compile; then
20900 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
20901 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
20902 echo "We will use the %lld style."
20908 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
20910 #include <sys/types.h>
20913 $quadtype q = 12345678901;
20914 printf("%qd\n", q);
20918 if eval $compile; then
20922 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
20923 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
20924 echo "We will use %qd."
20930 if $test X"$sPRId64" = X; then
20931 echo "Cannot figure out how to print 64-bit integers." >&4
20938 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
20939 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
20941 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
20942 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
20946 : Check format strings for internal types
20948 $echo "Checking the format strings to be used for Perl's internal types..." >&4
20950 if $test X"$ivsize" = X8; then
20951 ivdformat="$sPRId64"
20952 uvuformat="$sPRIu64"
20953 uvoformat="$sPRIo64"
20954 uvxformat="$sPRIx64"
20955 uvXUformat="$sPRIXU64"
20957 if $test X"$ivsize" = X"$longsize"; then
20964 if $test X"$ivsize" = X"$intsize"; then
20972 if $test X"$ivsize" = X"$shortsize"; then
20983 if $test X"$usequadmath" = X"$define"; then
20991 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
20992 nveformat="$sPRIeldbl"
20993 nvfformat="$sPRIfldbl"
20994 nvgformat="$sPRIgldbl"
20995 nvEUformat="$sPRIEUldbl"
20996 nvFUformat="$sPRIFUldbl"
20997 nvGUformat="$sPRIGUldbl"
21008 case "$ivdformat" in
21009 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
21014 : Check format string for GID
21017 $echo "Checking the format string to be used for gids..." >&4
21020 -1) if $test X"$gidsize" = X"$ivsize"; then
21021 gidformat="$ivdformat"
21023 if $test X"$gidsize" = X"$longsize"; then
21026 if $test X"$gidsize" = X"$intsize"; then
21029 if $test X"$gidsize" = X"$shortsize"; then
21036 *) if $test X"$gidsize" = X"$uvsize"; then
21037 gidformat="$uvuformat"
21039 if $test X"$gidsize" = X"$longsize"; then
21042 if $test X"$gidsize" = X"$intsize"; then
21045 if $test X"$gidsize" = X"$shortsize"; then
21054 : see if getgroups exists
21055 set getgroups d_getgrps
21058 : see if setgroups exists
21059 set setgroups d_setgrps
21062 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
21064 case "$d_getgrps$d_setgrps" in
21066 case "$groupstype" in
21067 '') dflt="$gidtype" ;;
21068 *) dflt="$groupstype" ;;
21071 What type of pointer is the second argument to getgroups() and setgroups()?
21072 Usually this is the same as group ids, $gidtype, but not always.
21075 rp='What type pointer is the second argument to getgroups() and setgroups()?'
21079 *) groupstype="$gidtype";;
21082 : check whether make sets MAKE
21084 echo "Checking if your $make program sets \$(MAKE)..." >&4
21085 case "$make_set_make" in
21087 $sed 's/^X //' > testmake.mak << 'EOF'
21089 X @echo 'maketemp="$(MAKE)"'
21091 case "`$make -f testmake.mak 2>/dev/null`" in
21092 *maketemp=*) make_set_make='#' ;;
21093 *) make_set_make="MAKE=$make" ;;
21095 $rm -f testmake.mak
21098 case "$make_set_make" in
21099 '#') echo "Yup, it does.";;
21100 *) echo "Nope, it doesn't.";;
21103 : see what type is used for mode_t
21104 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
21105 set mode_t modetype int stdio.h sys/types.h
21108 : see if we need va_copy
21110 case "$i_stdarg" in
21113 #include <stdarg.h>
21115 #$i_stdlib I_STDLIB
21117 #include <stdlib.h>
21119 #include <signal.h>
21122 ivfprintf(FILE *f, const char *fmt, va_list *valp)
21124 return vfprintf(f, fmt, *valp);
21128 myvfprintf(FILE *f, const char *fmt, va_list val)
21130 return ivfprintf(f, fmt, &val);
21134 myprintf(char *fmt, ...)
21137 va_start(val, fmt);
21138 return myvfprintf(stdout, fmt, val);
21142 main(int ac, char **av)
21144 signal(SIGSEGV, exit);
21146 myprintf("%s%cs all right, then\n", "that", '\'');
21151 if eval $compile && $run ./try 2>&1 >/dev/null; then
21152 case "`$run ./try`" in
21153 "that's all right, then")
21159 yes) echo "It seems that you don't need va_copy()." >&4
21160 need_va_copy="$undef"
21162 *) echo "It seems that va_copy() or similar will be needed." >&4
21163 need_va_copy="$define"
21168 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
21169 need_va_copy="$undef"
21173 : see what type is used for size_t
21174 rp="What is the type used for the length parameter for string functions?"
21175 set size_t sizetype 'unsigned int' stdio.h sys/types.h
21178 : check for type of arguments to gethostbyaddr.
21179 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
21180 case "$d_gethbyaddr" in
21184 Checking to see what type of arguments are accepted by gethostbyaddr().
21186 hdrs="$define sys/types.h
21187 $d_socket sys/socket.h
21188 $i_niin netinet/in.h
21190 $i_unistd unistd.h"
21191 : The first arg can 'char *' or 'void *'
21192 : The second arg is some of integral type
21193 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
21194 for yyy in size_t long int; do
21195 case "$netdb_host_type" in
21196 '') try="$extern_C struct hostent *gethostbyaddr($xxx, $yyy, int);"
21197 if ./protochk "$try" $hdrs; then
21198 echo "Your system accepts $xxx for the first arg."
21199 echo "...and $yyy for the second arg."
21200 netdb_host_type="$xxx"
21201 netdb_hlen_type="$yyy"
21207 : In case none of those worked, prompt the user.
21208 case "$netdb_host_type" in
21209 '') rp='What is the type for the 1st argument to gethostbyaddr?'
21212 netdb_host_type=$ans
21213 rp='What is the type for the 2nd argument to gethostbyaddr?'
21216 netdb_hlen_type=$ans
21220 *) : no gethostbyaddr, so pick harmless defaults
21221 netdb_host_type='char *'
21222 netdb_hlen_type="$sizetype"
21225 # Remove the "const" if needed. -- but then we'll have a
21227 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
21230 : check for type of argument to gethostbyname.
21231 if test "X$netdb_name_type" = X ; then
21232 case "$d_gethbyname" in
21236 Checking to see what type of argument is accepted by gethostbyname().
21238 hdrs="$define sys/types.h
21239 $d_socket sys/socket.h
21240 $i_niin netinet/in.h
21242 $i_unistd unistd.h"
21243 for xxx in "const char *" "char *"; do
21244 case "$netdb_name_type" in
21245 '') try="$extern_C struct hostent *gethostbyname($xxx);"
21246 if ./protochk "$try" $hdrs; then
21247 echo "Your system accepts $xxx."
21248 netdb_name_type="$xxx"
21253 : In case none of those worked, prompt the user.
21254 case "$netdb_name_type" in
21255 '') rp='What is the type for the 1st argument to gethostbyname?'
21258 netdb_name_type=$ans
21262 *) : no gethostbyname, so pick harmless default
21263 netdb_name_type='char *'
21268 : check for type of 1st argument to getnetbyaddr.
21269 if test "X$netdb_net_type" = X ; then
21270 case "$d_getnbyaddr" in
21274 Checking to see what type of 1st argument is accepted by getnetbyaddr().
21276 hdrs="$define sys/types.h
21277 $d_socket sys/socket.h
21278 $i_niin netinet/in.h
21280 $i_unistd unistd.h"
21281 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
21282 case "$netdb_net_type" in
21283 '') try="$extern_C struct netent *getnetbyaddr($xxx, int);"
21284 if ./protochk "$try" $hdrs; then
21285 echo "Your system accepts $xxx."
21286 netdb_net_type="$xxx"
21291 : In case none of those worked, prompt the user.
21292 case "$netdb_net_type" in
21293 '') rp='What is the type for the 1st argument to getnetbyaddr?'
21296 netdb_net_type=$ans
21300 *) : no getnetbyaddr, so pick harmless default
21301 netdb_net_type='long'
21305 : locate the preferred pager for this system
21312 [a-zA-Z]:/*) dflt=$pg;;
21316 [a-zA-Z]:/*) dflt=$more;;
21320 [a-zA-Z]:/*) dflt=$less;;
21323 '') dflt=/usr/ucb/more;;
21331 rp='What pager is used on your system?'
21335 : see what type pids are declared as in the kernel
21336 rp="What is the type of process ids on this system?"
21337 set pid_t pidtype int stdio.h sys/types.h
21340 : see if ar generates random libraries by itself
21342 echo "Checking how to generate random libraries on your machine..." >&4
21343 echo 'int bar1() { return bar2(); }' > bar1.c
21344 echo 'int bar2() { return 2; }' > bar2.c
21346 #$i_stdlib I_STDLIB
21348 #include <stdlib.h>
21350 int main() { printf("%d\n", bar1()); exit(0); }
21352 $cc $ccflags -c bar1.c >/dev/null 2>&1
21353 $cc $ccflags -c bar2.c >/dev/null 2>&1
21354 $cc $ccflags -c foo.c >/dev/null 2>&1
21355 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
21356 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
21357 $run ./foobar >/dev/null 2>&1; then
21358 echo "$ar appears to generate random libraries itself."
21360 if [ "X$ranlib" = "X" ]; then
21363 elif $ar s bar$_a >/dev/null 2>&1 &&
21364 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
21365 $run ./foobar >/dev/null 2>&1; then
21366 echo "a table of contents needs to be added with '$ar s'."
21369 elif $ar ts bar$_a >/dev/null 2>&1 &&
21370 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
21371 $run ./foobar >/dev/null 2>&1; then
21372 echo "a table of contents needs to be added with '$ar ts'."
21379 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
21380 $test -f $ranlib || ranlib=''
21383 if $test -n "$ranlib"; then
21384 echo "your system has '$ranlib'; we'll use that."
21387 echo "your system doesn't seem to support random libraries"
21388 echo "so we'll use lorder and tsort to order the libraries."
21395 : see if this is a values.h system
21396 set values.h i_values
21399 : Check the max offset that gmtime and localtime accept
21400 echo "Checking max offsets that gmtime () accepts"
21403 define) yyy="#include <values.h>" ;;
21407 case "$sGMTIME_min/$sGMTIME_max" in
21410 #include <sys/types.h>
21419 void gm_check (time_t t, int min_year, int max_year)
21422 if ( tmp == NULL ||
21423 /* Check tm_year overflow */
21424 tmp->tm_year < min_year || tmp->tm_year > max_year)
21435 gm_check (MAXLONG, 69, 0x7fffffff);
21437 if (tmp == NULL || tmp->tm_year < 0) {
21438 for (i = 63; i >= 0; i--) {
21439 time_t x = pt | ((time_t)1 << i);
21440 if (x < 0 || x < pt) continue;
21441 gm_check (x, 69, 0x7fffffff);
21444 printf ("sGMTIME_max=%ld\n", pt);
21453 gm_check (MINLONG, -1900, 70);
21456 for (i = 36; i >= 0; i--) {
21457 time_t x = pt - ((time_t)1 << i);
21458 if (x > 0) continue;
21459 gm_check (x, -1900, 70);
21462 printf ("sGMTIME_min=%ld\n", pt);
21466 int main (int argc, char *argv[])
21468 /* fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t)); */
21475 if eval $compile; then
21476 eval `$run ./try 2>/dev/null`
21478 echo "Cannot determine sGMTIME_max and sGMTIME_min." >&4
21484 echo "Checking max offsets that localtime () accepts"
21486 case "$sLOCALTIME_min/$sLOCALTIME_max" in
21489 #include <sys/types.h>
21498 void local_check (time_t t, int min_year, int max_year)
21500 if (sizeof (time_t) > 4 && t > 0x7ffffffffffff000LL)
21503 tmp = localtime (&t);
21504 if ( tmp == NULL ||
21505 /* Check tm_year overflow */
21506 tmp->tm_year < min_year || tmp->tm_year > max_year)
21510 } /* local_check */
21517 local_check (MAXLONG, 69, 0x7fffffff);
21519 if (tmp == NULL || tmp->tm_year < 0) {
21520 for (i = 63; i >= 0; i--) {
21521 time_t x = pt | ((time_t)1 << i);
21522 if (x < 0 || x < pt) continue;
21523 local_check (x, 69, 0x7fffffff);
21526 printf ("sLOCALTIME_max=%ld\n", pt);
21535 local_check (MINLONG, -1900, 70);
21538 for (i = 36; i >= 0; i--) {
21539 time_t x = pt - ((time_t)1 << i);
21540 if (x > 0) continue;
21541 local_check (x, -1900, 70);
21544 printf ("sLOCALTIME_min=%ld\n", pt);
21548 int main (int argc, char *argv[])
21556 if eval $compile; then
21557 eval `$run ./try 2>/dev/null`
21559 echo "Cannot determine sLOCALTIME_max and sLOCALTIME_min." >&4
21565 : check for type of arguments to select.
21566 case "$selecttype" in
21567 '') case "$d_select" in
21571 Checking to see what type of arguments are accepted by select().
21573 hdrs="$define sys/types.h
21574 $i_systime sys/time.h
21575 $i_sysselct sys/select.h
21576 $d_socket sys/socket.h"
21577 : The first arg can be int, unsigned, or size_t
21578 : The last arg may or may not be 'const'
21580 : void pointer has been seen but using that
21581 : breaks the selectminbits test
21582 for xxx in 'fd_set *' 'int *'; do
21583 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
21584 for tmo in 'struct timeval *' 'const struct timeval *'; do
21586 '') try="$extern_C select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
21587 if ./protochk "$try" $hdrs; then
21588 echo "Your system accepts $xxx."
21597 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
21598 case "$d_fd_set" in
21599 $define) dflt="fd_set *" ;;
21608 *) : no select, so pick a harmless default
21615 : check for the select 'width'
21616 case "$selectminbits" in
21617 '') safebits=`expr $ptrsize \* 8`
21618 case "$d_select" in
21622 Checking to see on how many bits at a time your select() operates...
21625 #include <sys/types.h>
21627 #$i_systime I_SYS_TIME
21628 #$i_systimek I_SYS_TIME_KERNEL
21633 # ifdef I_SYS_TIME_KERNEL
21636 # include <sys/time.h>
21637 # ifdef I_SYS_TIME_KERNEL
21641 #$i_sysselct I_SYS_SELECT
21642 #ifdef I_SYS_SELECT
21643 #include <sys/select.h>
21645 #$d_socket HAS_SOCKET
21647 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
21650 #$i_stdlib I_STDLIB
21652 #include <stdlib.h>
21655 #define S sizeof(*(b))
21657 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
21658 #define NBITS (NBYTES * 8)
21660 char *s = (char *)malloc(NBYTES);
21669 fp = fopen("try.c", "r");
21675 b = ($selecttype)s;
21676 for (i = 0; i < NBITS; i++)
21680 select(fd + 1, b, 0, 0, &t);
21681 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
21683 printf("%d\n", i + 1);
21688 if eval $compile_ok; then
21689 selectminbits=`$run ./try 2>/dev/null`
21690 case "$selectminbits" in
21692 Cannot figure out on how many bits at a time your select() operates.
21693 I'll play safe and guess it is $safebits bits.
21695 selectminbits=$safebits
21696 bits="$safebits bits"
21699 *) bits="$selectminbits bits" ;;
21701 echo "Your select() operates on $bits at a time." >&4
21703 rp='What is the minimum number of bits your select() operates on?'
21704 case "$byteorder" in
21705 12345678) dflt=64 ;;
21711 selectminbits="$val"
21715 *) : no select, so pick a harmless default
21716 selectminbits=$safebits
21722 : Trace out the files included by signal.h, then look for SIGxxx names.
21723 if [ "X$fieldn" = X ]; then
21724 : Just make some guesses. We check them later.
21725 xxx="$sysroot/usr/include/signal.h $sysroot/usr/include/sys/signal.h"
21727 xxx=`echo '#include <signal.h>' |
21728 $cppstdin $cppminus $cppflags 2>/dev/null |
21729 $grep '^[ ]*#.*include' |
21730 $awk "{print \\$$fieldn}" | $sed 's!"!!g' |\
21731 $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
21734 for xx in $xxx /dev/null ; do
21735 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
21737 case "$xxxfiles" in
21738 '') xxxfiles=`./findhdr signal.h` ;;
21741 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
21742 print substr($2, 4, 20)
21744 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
21745 print substr($3, 4, 20)
21747 : Append some common names just in case the awk scan failed.
21748 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
21749 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
21750 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
21751 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
21752 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
21754 : generate a few handy files for later
21755 $cat > signal.c <<EOCP
21756 #include <sys/types.h>
21757 #include <signal.h>
21758 #$i_stdlib I_STDLIB
21760 #include <stdlib.h>
21765 /* Strange style to avoid deeply-nested #if/#else/#endif */
21768 # define NSIG (_NSIG)
21774 # define NSIG (SIGMAX+1)
21780 # define NSIG (SIG_MAX+1)
21786 # define NSIG (_SIG_MAX+1)
21792 # define NSIG (MAXSIG+1)
21798 # define NSIG (MAX_SIG+1)
21803 # ifdef SIGARRAYSIZE
21804 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
21810 # define NSIG (_sys_nsig) /* Solaris 2.5 */
21814 /* Default to some arbitrary number that's big enough to get most
21815 of the common signals.
21821 printf("NSIG %d\n", NSIG);
21827 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
21829 printf "#ifdef SIG"; printf $1; printf "\n"
21830 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
21831 printf $1; printf ");\n"
21835 printf "#endif /* JUST_NSIG */\n";
21836 printf "exit(0);\n}\n";
21839 $cat >signal.awk <<'EOP'
21840 BEGIN { ndups = 0 }
21841 $1 ~ /^NSIG$/ { nsig = $2 }
21842 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
21843 if ($2 > maxsig) { maxsig = $2 }
21844 if (sig_name[$2]) {
21845 dup_name[ndups] = $1
21846 dup_num[ndups] = $2
21858 printf("NSIG %d\n", nsig);
21859 for (n = 1; n < nsig; n++) {
21861 printf("%s %d\n", sig_name[n], sig_num[n])
21864 printf("NUM%d %d\n", n, n)
21867 for (n = 0; n < ndups; n++) {
21868 printf("%s %d\n", dup_name[n], dup_num[n])
21872 $cat >signal_cmd <<EOS
21874 if $test -s signal.lst; then
21875 echo "Using your existing signal.lst file"
21880 $cat >>signal_cmd <<'EOS'
21883 if eval $compile_ok; then
21884 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) |\
21885 $uniq | $awk -f signal.awk >signal.lst
21887 echo "(I can't seem be able to compile the whole test program)" >&4
21888 echo "(I'll try it in little pieces.)" >&4
21889 set signal -DJUST_NSIG
21890 if eval $compile_ok; then
21891 $run ./signal$_exe > signal.nsg
21894 echo "I can't seem to figure out how many signals you have." >&4
21895 echo "Guessing 50." >&4
21896 echo 'NSIG 50' > signal.nsg
21898 : Now look at all the signal names, one at a time.
21899 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
21900 $cat > signal.c <<EOCP
21901 #include <sys/types.h>
21902 #include <signal.h>
21905 printf("$xx %d\n", SIG${xx});
21910 if eval $compile; then
21911 echo "SIG${xx} found."
21912 $run ./signal$_exe >> signal.ls1
21914 echo "SIG${xx} NOT found."
21917 if $test -s signal.ls1; then
21918 $cat signal.nsg signal.ls1 |
21919 $sort -n | $uniq | $awk -f signal.awk >signal.lst
21923 if $test -s signal.lst; then
21926 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
21927 echo 'kill -l' >signal
21928 set X `csh -f <signal`
21932 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
21934 echo $@ | $tr ' ' $trnl | \
21935 $awk '{ printf "%s %d\n", $1, ++s; }
21936 END { printf "NSIG %d\n", ++s }' >signal.lst
21938 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
21940 chmod a+x signal_cmd
21941 $eunicefix signal_cmd
21943 : generate list of signal names
21945 case "$sig_name_init" in
21947 *) case "$sig_num_init" in
21948 ''|*,*) doinit=yes ;;
21953 echo "Generating a list of signal names and numbers..." >&4
21955 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
21956 sig_name=`$awk 'BEGIN { printf "ZERO " }
21957 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
21958 sig_num=`$awk 'BEGIN { printf "0 " }
21959 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
21960 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
21961 !/^NSIG/ { printf "\"%s\", ", $1 }
21962 END { printf "0\n" }' signal.lst`
21963 sig_num_init=`$awk 'BEGIN { printf "0, " }
21964 !/^NSIG/ { printf "%d, ", $2}
21965 END { printf "0\n"}' signal.lst`
21968 echo "The following $sig_count signals are available:"
21970 echo $sig_name | $awk \
21971 'BEGIN { linelen = 0 }
21973 for (i = 1; i <= NF; i++) {
21974 name = "SIG" $i " "
21975 linelen = linelen + length(name)
21976 if (linelen > 70) {
21978 linelen = length(name)
21984 sig_size=`echo $sig_name | awk '{print NF}'`
21985 $rm -f signal signal.c signal.awk signal.lst signal_cmd
21987 : Check size of size
21989 case "$sizetype" in
21990 *_t) zzz="$sizetype" ;;
21991 *) zzz="filesize" ;;
21993 echo "Checking the size of $zzz..." >&4
21995 #include <sys/types.h>
21997 #$i_stdlib I_STDLIB
21999 #include <stdlib.h>
22002 printf("%d\n", (int)sizeof($sizetype));
22007 if eval $compile_ok; then
22011 echo "(I can't execute the test program--guessing $sizesize.)" >&4
22014 echo "Your $zzz size is $sizesize bytes."
22019 echo "(I can't compile the test program--guessing $sizesize.)" >&4
22023 : check for socklen_t
22025 echo "Checking to see if you have socklen_t..." >&4
22027 #include <sys/types.h>
22028 #$d_socket HAS_SOCKET
22030 #include <sys/socket.h>
22032 int main() { socklen_t x = 16; }
22035 if eval $compile; then
22037 echo "You have socklen_t."
22040 echo "You do not have socklen_t."
22041 case "$sizetype" in
22042 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
22049 : see if this is a socks.h system
22050 set socks.h i_socks
22053 : check for type of the size argument to socket calls
22054 case "$d_socket" in
22058 Checking to see what type is the last argument of accept().
22061 case "$d_socklen_t" in
22062 "$define") yyy="$yyy socklen_t"
22064 yyy="$yyy $sizetype int long unsigned"
22065 for xxx in $yyy; do
22066 case "$socksizetype" in
22067 '') try="$extern_C int accept(int, struct sockaddr *, $xxx *);"
22068 case "$usesocks" in
22070 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
22071 echo "Your system accepts '$xxx *' for the last argument of accept()."
22072 socksizetype="$xxx"
22075 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
22076 echo "Your system accepts '$xxx *' for the last argument of accept()."
22077 socksizetype="$xxx"
22084 : In case none of those worked, prompt the user.
22085 case "$socksizetype" in
22086 '') rp='What is the type for socket address structure sizes?'
22093 *) : no sockets, so pick relatively harmless default
22098 : see what type is used for signed size_t
22099 set ssize_t ssizetype int stdio.h sys/types.h
22104 #$i_stdlib I_STDLIB
22106 #include <stdlib.h>
22108 #include <sys/types.h>
22109 #define Size_t $sizetype
22110 #define SSize_t $dflt
22113 if (sizeof(Size_t) == sizeof(SSize_t))
22115 else if (sizeof(Size_t) == sizeof(int))
22124 if eval $compile_ok && $run ./try > /dev/null; then
22125 ssizetype=`$run ./try`
22126 echo "I'll be using $ssizetype for functions returning a byte count." >&4
22129 Help! I can't compile and run the ssize_t test program: please enlighten me!
22130 (This is probably a misconfiguration in your system or libraries, and
22131 you really ought to fix it. Still, I'll try anyway.)
22133 I need a type that is the same size as $sizetype, but is guaranteed to
22134 be signed. Common values are ssize_t, int and long.
22137 rp="What signed type is the same size as $sizetype?"
22143 : Check the size of st_ino
22145 $echo "Checking the size of st_ino..." >&4
22146 $cat > try.c <<EOCP
22147 #include <sys/stat.h>
22149 #$i_stdlib I_STDLIB
22151 #include <stdlib.h>
22155 printf("%d\n", (int)sizeof(st.st_ino));
22160 if eval $compile_ok; then
22164 $echo "(I can't execute the test program--guessing $st_ino_size.)" >&4
22166 *) st_ino_size=$val
22167 $echo "Your st_ino is $st_ino_size bytes long."
22172 $echo "(I can't compile the test program--guessing $st_ino_size.)" >&4
22176 : Check if st_ino is signed
22178 $echo "Checking the sign of st_ino..." >&4
22179 $cat > try.c <<EOCP
22180 #include <sys/stat.h>
22185 if (foo.st_ino < 0)
22192 if eval $compile; then
22196 $echo "(I can't execute the test program--guessing unsigned.)" >&4
22198 *) st_ino_sign=$val
22199 case "$st_ino_sign" in
22200 1) $echo "Your st_ino is unsigned." ;;
22201 -1) $echo "Your st_ino is signed." ;;
22207 $echo "(I can't compile the test program--guessing unsigned.)" >&4
22211 : see what type of char stdio uses.
22213 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
22214 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
22215 echo "Your stdio uses unsigned chars." >&4
22216 stdchar="unsigned char"
22218 echo "Your stdio uses signed chars." >&4
22223 : see what type uids are declared as in the kernel
22225 echo "Looking for the type for user ids returned by getuid()."
22226 set uid_t uidtype xxx stdio.h sys/types.h
22230 xxx=`./findhdr sys/user.h`
22231 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
22233 unsigned) dflt="$1 $2" ;;
22237 *) dflt="$uidtype";;
22240 uid_t) echo "uid_t found." ;;
22241 *) rp="What is the type for user ids returned by getuid()?"
22247 : Check size of UID
22250 *_t) zzz="$uidtype" ;;
22253 echo "Checking the size of $zzz..." >&4
22255 #include <sys/types.h>
22257 #$i_stdlib I_STDLIB
22259 #include <stdlib.h>
22262 printf("%d\n", (int)sizeof($uidtype));
22267 if eval $compile_ok; then
22271 echo "(I can't execute the test program--guessing $uidsize.)" >&4
22274 echo "Your $zzz is $uidsize bytes long."
22279 echo "(I can't compile the test program--guessing $uidsize.)" >&4
22282 : Check if UID is signed
22285 *_t) zzz="$uidtype" ;;
22288 echo "Checking the sign of $zzz..." >&4
22290 #include <sys/types.h>
22301 if eval $compile; then
22305 echo "(I can't execute the test program--guessing unsigned.)" >&4
22309 1) echo "Your $zzz is unsigned." ;;
22310 -1) echo "Your $zzz is signed." ;;
22316 echo "(I can't compile the test program--guessing unsigned.)" >&4
22320 : Check format string for UID
22322 $echo "Checking the format string to be used for uids..." >&4
22325 -1) if $test X"$uidsize" = X"$ivsize"; then
22326 uidformat="$ivdformat"
22328 if $test X"$uidsize" = X"$longsize"; then
22331 if $test X"$uidsize" = X"$intsize"; then
22334 if $test X"$uidsize" = X"$shortsize"; then
22341 *) if $test X"$uidsize" = X"$uvsize"; then
22342 uidformat="$uvuformat"
22344 if $test X"$uidsize" = X"$longsize"; then
22347 if $test X"$uidsize" = X"$intsize"; then
22350 if $test X"$uidsize" = X"$shortsize"; then
22359 : Determine if we can use sysctl with KERN_PROC_PATHNAME to find executing program
22361 echo "Determining whether we can use sysctl with KERN_PROC_PATHNAME to find executing program..." >&4
22362 $cat >try.c <<'EOM'
22363 /* Intentionally a long probe as I'd like to sanity check that the exact
22364 approach is going to work, as thinking it will work, but only having it
22365 part working at runtime is worse than not having it. */
22367 #include <sys/types.h>
22368 #include <sys/sysctl.h>
22369 #include <sys/param.h>
22371 #include <string.h>
22372 #include <stdlib.h>
22373 #include <unistd.h>
22376 main(int argc, char **argv) {
22378 char *argv_leaf = strrchr(argv[0], '/');
22384 mib[1] = KERN_PROC;
22385 mib[2] = KERN_PROC_PATHNAME;
22389 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
22393 if (sysctl(mib, 4, NULL, &size, NULL, 0)) {
22398 if (size < strlen(argv_leaf) + 1) {
22399 fprintf(stderr, "size %lu is too short for a path\n",
22400 (unsigned long) size);
22404 if (size > MAXPATHLEN * MAXPATHLEN) {
22405 fprintf(stderr, "size %lu is too long for a path\n",
22406 (unsigned long) size);
22410 buffer = malloc(size);
22416 if (sysctl(mib, 4, buffer, &size, NULL, 0)) {
22421 if (strlen(buffer) + 1 != size) {
22422 fprintf(stderr, "size != strlen(buffer) + 1 (%lu != %lu)\n",
22423 (unsigned long)size, (unsigned long)strlen(buffer) + 1);
22428 if (*buffer != '/') {
22429 fprintf(stderr, "Not an absolute path: '%s'\n", buffer);
22433 if (strstr(buffer, "/./")) {
22434 fprintf(stderr, "Contains /./: '%s'\n", buffer);
22438 if (strstr(buffer, "/../")) {
22439 fprintf(stderr, "Contains /../: '%s'\n", buffer);
22443 buffer_leaf = strrchr(buffer, '/');
22444 if (strcmp(buffer_leaf, argv_leaf) != 0) {
22445 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], buffer);
22457 if eval $compile; then
22458 if $run ./try; then
22459 echo "You can use sysctl with KERN_PROC_PATHNAME to find the executing program." >&4
22462 echo "Nope, sysctl with KERN_PROC_PATHNAME doesn't work here." >&4
22466 echo "I'm unable to compile the test program." >&4
22467 echo "I'll assume no sysctl with KERN_PROC_PATHNAME here." >&4
22471 set usekernprocpathname
22474 : Determine if we can use _NSGetExecutablePath to find executing program
22476 echo "Determining whether we can use _NSGetExecutablePath to find executing program..." >&4
22477 $cat >try.c <<'EOM'
22478 /* Intentionally a long probe as I'd like to sanity check that the exact
22479 approach is going to work, as thinking it will work, but only having it
22480 part working at runtime is worse than not having it. */
22481 #include <mach-o/dyld.h>
22483 #include <stdlib.h>
22484 #include <sys/param.h>
22485 #include <string.h>
22488 main(int argc, char **argv) {
22490 uint32_t size = sizeof(buf);
22494 char *argv_leaf = strrchr(argv[0], '/');
22498 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
22502 _NSGetExecutablePath(buf, &size);
22503 if (size > MAXPATHLEN * MAXPATHLEN) {
22504 fprintf(stderr, "_NSGetExecutablePath size %u is too long for a path\n",
22505 (unsigned int) size);
22509 buffer = malloc(size);
22515 result = _NSGetExecutablePath(buffer, &size);
22517 fprintf(stderr, "_NSGetExecutablePath returned %i for a size of %u\n",
22518 result, (unsigned int) size);
22522 tidied = realpath(buffer, NULL);
22524 perror("realpath");
22530 if (*tidied != '/') {
22531 fprintf(stderr, "Not an absolute path: '%s'\n", tidied);
22535 if (strstr(tidied, "/./")) {
22536 fprintf(stderr, "Contains /./: '%s'\n", tidied);
22540 if (strstr(tidied, "/../")) {
22541 fprintf(stderr, "Contains /../: '%s'\n", tidied);
22545 tidied_leaf = strrchr(tidied, '/');
22546 if (strcmp(tidied_leaf, argv_leaf) != 0) {
22547 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], tidied);
22559 if eval $compile; then
22560 if $run ./try; then
22561 echo "You can use _NSGetExecutablePath to find the executing program." >&4
22564 echo "Nope, _NSGetExecutablePath doesn't work here." >&4
22567 echo "I'm unable to compile the test program." >&4
22568 echo "I'll assume no _NSGetExecutablePath here." >&4
22571 set usensgetexecutablepath
22574 : Check if site customization support was requested
22575 case "$usesitecustomize" in
22576 $define|true|[Yy]*)
22577 usesitecustomize="$define"
22580 usesitecustomize="$undef"
22584 : see if prototypes support variable argument declarations
22586 case "$prototype$i_stdarg" in
22588 echo "It appears we'll be able to prototype varargs functions." >&4
22592 echo "Too bad... We won't be using prototyped varargs functions..." >&4
22599 : determine compiler compiler
22608 if $test -f "$byacc$_exe"; then
22610 comp="byacc or $comp"
22612 if $test -f "$bison$_exe"; then
22613 comp="$comp or bison -y"
22615 rp="Which compiler compiler ($comp) shall I use?"
22624 echo "(Adding -y option to bison to get yacc-compatible behavior.)"
22630 : see if this is a assert.h system
22631 set assert.h i_assert
22634 : see if this is a bfd.h system
22638 : see if this is an execinfo.h system
22639 set execinfo.h i_execinfo
22642 : see if this is a fenv.h system
22646 : see if this is a fp.h system
22650 : see if this is a fp_class.h system
22651 set fp_class.h i_fp_class
22654 : see if gdbm.h is available
22659 : see if gdbm_open exists
22660 set gdbm_open d_gdbm_open
22662 case "$d_gdbm_open" in
22665 echo "We won't be including <gdbm.h>"
22674 : see if this is a ieeefp.h system
22675 case "$i_ieeefp" in
22676 '' ) set ieeefp.h i_ieeefp
22681 : see if this is a libutil.h system
22682 set libutil.h i_libutil
22685 : see if mach cthreads are available
22686 if test "X$usethreads" = "X$define"; then
22687 set mach/cthreads.h i_machcthr
22690 i_machcthr="$undef"
22693 : see if this is a mntent.h system
22694 set mntent.h i_mntent
22697 : see if net/errno.h is available
22699 set net/errno.h val
22702 : Unfortunately, it causes problems on some systems. Arrgh.
22705 cat > try.c <<'EOM'
22708 #include <net/errno.h>
22714 if $cc $ccflags -c try.c >/dev/null 2>&1; then
22715 echo "We'll be including <net/errno.h>." >&4
22717 echo "We won't be including <net/errno.h>." >&4
22726 : see if netinet/tcp.h is available
22727 set netinet/tcp.h i_netinettcp
22730 : see if this is a poll.h system
22734 : see if this is a prot.h system
22738 : Preprocessor symbols
22740 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
22741 $cat <<'EOSH' > Cppsym.know
22742 a29k aarch64 ABI64 aegis AES_SOURCE AIX AIX32 AIX370 AIX41 AIX42
22743 AIX43 aixpc AIX_SOURCE alliant ALL_SOURCE alpha AM29000 am29000
22744 AMD64 amd64 amiga AMIGAOS AMIX ansi ANSI_C_SOURCE apollo arch_ppc
22745 arch_pwr ardent ARM ARM32 atarist att386 att3b
22746 BeOS BIG_ENDIAN BIT_MSF BSD bsd bsd43 bsd4_2 BSD4_3 bsd4_3 bsd4_4
22747 BSDCOMPAT bsdi BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES bull
22748 byteorder byte_order
22749 c cadmus clang clipper CMU COFF COMPILER_VERSION concurrent
22750 convex cpu CRAY cray CRAYMPP ctix CX_UX CYGWIN
22751 DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO Dynix DynixPTX
22752 ELF encore EPI EXTENSIONS
22753 FAVOR_BSD FILE_OFFSET_BITS FORTIFY_SOURCE FreeBSD
22754 GCC_NEW_VARARGS gcos gcx gimpel GLIBC GLIBC_MINOR GNUC GNUC_MINOR
22755 GNU_LIBRARY GNU_SOURCE GO32 gould GOULD_PN
22756 H3050R H3050RX hbullx20 hcx host_mips hp200 hp300 HP700 hp700
22757 hp800 hp9000 hp9000s200 hp9000s300 hp9000s400 hp9000s500
22758 hp9000s700 hp9000s800 hp9k8 hppa hpux HPUX_SOURCE hp_osf
22759 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960 IA32 IA64
22760 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
22761 INLINE_INTRINSICS INT64 INTEL interdata INTRINSICS is68k itanium
22763 LANGUAGE_C LARGEFILE64_SOURCE LARGEFILE_SOURCE LARGE_FILE_API
22764 LFS64_LARGEFILE LFS_LARGEFILE LIBCATAMOUNT Linux LITTLE_ENDIAN
22765 LONG64 LONGDOUBLE LONGLONG LONG_DOUBLE LONG_LONG LP64 luna
22767 M68000 m68k m88100 m88k M88KBCS_TARGET MACH machine MachTen
22768 MATH_HAS_NO_SIDE_EFFECTS mc300 mc500 mc68000 mc68010 mc68020
22769 mc68030 mc68040 mc68060 mc68k mc68k32 mc700 mc88000 mc88100
22770 merlin mert MiNT mips MIPSEB MIPSEL MIPS_FPSET MIPS_ISA MIPS_SIM
22771 MIPS_SZINT MIPS_SZLONG MIPS_SZPTR MODERN_C motorola mpeix MSDOS
22772 MTXINU MULTIMAX MVS mvs M_AMD64 M_ARM M_ARMT M_COFF M_I186 M_I286
22773 M_I386 M_I8086 M_I86 M_I86SM M_IA64 M_IX86 M_PPC M_SYS3 M_SYS5
22774 M_SYSIII M_SYSV M_UNIX M_X86 M_XENIX
22775 n16 ncl_el ncl_mr NetBSD news1500 news1700 news1800 news1900
22776 news3700 news700 news800 news900 NeXT NLS nonstopux ns16000
22777 ns32000 ns32016 ns32332 ns32k nsc32000
22778 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
22779 PARAGON parisc pa_risc PA_RISC1_1 PA_RISC2_0 pc532 pdp11 PGC PIC
22780 plexus PORTAR posix POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
22781 POSIX_C_SOURCE POSIX_SOURCE POWER powerpc ppc PROTOTYPES PWB pyr
22783 R3000 REENTRANT RES Rhapsody RISC6000 riscix riscos RT
22784 S390 S390x SA110 SCO scs sequent sgi SGI_SOURCE SH SH3 sinix
22785 SIZE_INT SIZE_LONG SIZE_PTR SOCKETS_SOURCE SOCKET_SOURCE sony
22786 sonyrisc sony_news sparc sparclite sparcv8 sparcv9 spectrum
22787 stardent stdc STDC_EXT stratos sun sun3 sun386 Sun386i svr3 svr4
22788 SVR4_2 SVR4_SOURCE svr5 SX system SYSTYPE_BSD SYSTYPE_BSD43
22789 SYSTYPE_BSD44 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3
22790 SYSV4 SYSV5 sysV68 sysV88
22791 Tek4132 Tek4300 thumb thw_370 thw_intel thw_rs6000 titan TM3200
22792 TM5400 TM5600 tower tower32 tower32_200 tower32_600 tower32_700
22793 tower32_800 tower32_850 tss
22794 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5 ultrix UMAXV UnicomPBB
22795 UnicomPBD UNICOS UNICOSMK unix UNIX95 UNIX99 unixpc unos USE_BSD
22796 USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE
22797 USE_LARGEFILE64 USE_MISC USE_POSIX USE_POSIX199309
22798 USE_POSIX199506 USE_POSIX2 USE_REENTRANT USE_SVID USE_UNIX98
22799 USE_XOPEN USE_XOPEN_EXTENDED USGr4 USGr4_2 UTek Utek UTS UWIN
22801 vax venix VMESA vms
22802 x86_64 xenix Xenix286 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2
22803 XPG2_EXTENDED XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
22806 # Maybe put other stuff here too.
22807 ./tr '-' '_' <<EOSH >>Cppsym.know
22810 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
22811 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
22812 $cat Cppsym.know > Cppsym.c
22813 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
22814 $rm -f Cppsym.a Cppsym.b Cppsym.c
22815 cat <<EOSH > Cppsym
22817 if $test \$# -gt 0; then
22818 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
22819 if $test -s Cppsym.got; then
22826 $tr " " "$trnl" | ./Cppsym.try
22832 cat <<EOSH > Cppsym.try
22834 cat <<'EOCP' > try.c
22837 #define STRINGIFY(a) "a"
22839 #if cpp_stuff == 42
22840 #define StGiFy(a) #a
22841 #define STRINGIFY(a) StGiFy(a)
22843 #if $cpp_stuff != 1 && $cpp_stuff != 42
22844 # include "Bletch: How does this C preprocessor stringify macros?"
22850 cat <<'EOSH' >> Cppsym.try
22852 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
22853 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
22854 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
22855 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
22857 echo 'return 0;}' >> try.c
22859 cat <<EOSH >> Cppsym.try
22861 case "$osname-$gccversion" in
22862 irix-) ccflags="\$ccflags -woff 1178" ;;
22863 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
22865 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
22867 chmod +x Cppsym.try
22868 $eunicefix Cppsym.try
22869 ./Cppsym < Cppsym.know | $sort | $uniq > Cppsym.true
22870 : Add in any Linux cpp "predefined macros":
22871 case "$osname::$gccversion" in
22872 *linux*::*.*|*gnukfreebsd*::*.*|gnu::*.*)
22874 rm -f $tHdrH'.h' $tHdrH
22876 # Filter out macro arguments, such as Linux's __INT8_C(c)
22877 if $cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
22878 sed -e 's/#define[\ \ ]*//;s/[\ \ ].*$//' -e 's/(.*//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
22879 if [ -s $tHdrH'_cppsym.real' ]; then
22880 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
22883 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
22886 : now check the C compiler for additional symbols
22887 postprocess_cc_v=''
22889 aix) postprocess_cc_v="|$tr , ' '" ;;
22896 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
22899 -D*) echo "\$i" | $sed 's/^-D//';;
22900 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
22905 postprocess_cc_v=''
22908 ./ccsym > ccsym1.raw
22909 if $test -s ccsym1.raw; then
22910 $sort ccsym1.raw | $uniq >ccsym.raw
22912 mv ccsym1.raw ccsym.raw
22915 $awk '/\=/ { print $0; next }
22916 { print $0"=1" }' ccsym.raw >ccsym.list
22917 $comm -13 Cppsym.true ccsym.list >ccsym.own
22918 $comm -12 Cppsym.true ccsym.list >ccsym.com
22919 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
22921 if $test -z ccsym.raw; then
22922 echo "Your C compiler doesn't seem to define any symbols!" >&4
22924 echo "However, your C preprocessor defines the following symbols:"
22927 cppsymbols=`$cat Cppsym.true`
22928 cppsymbols=`echo $cppsymbols`
22929 cppccsymbols="$cppsymbols"
22931 if $test -s ccsym.com; then
22932 echo "Your C compiler and pre-processor define these symbols:"
22933 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
22936 cppccsymbols=`$cat ccsym.com`
22937 cppccsymbols=`echo $cppccsymbols`
22938 $test "$silent" || sleep 1
22940 if $test -s ccsym.cpp; then
22941 $test "$also" && echo " "
22942 echo "Your C pre-processor ${also}defines the following symbols:"
22943 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
22945 cppsymbols=`$cat ccsym.cpp`
22946 cppsymbols=`echo $cppsymbols`
22947 $test "$silent" || sleep 1
22949 if $test -s ccsym.own; then
22950 $test "$also" && echo " "
22951 echo "Your C compiler ${also}defines the following cpp symbols:"
22952 $sed -e 's/\(..*\)=1/\1/' ccsym.own
22953 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
22954 ccsymbols=`$cat ccsym.own`
22955 ccsymbols=`echo $ccsymbols`
22956 $test "$silent" || sleep 1
22960 : add -D_FORTIFY_SOURCE if feasible and not already there
22961 case "$gccversion" in
22962 4.*) case "$optimize$ccflags" in
22963 *-O*) case "$ccflags$cppsymbols" in
22964 *_FORTIFY_SOURCE=*) # Don't add it again.
22965 echo "You seem to have -D_FORTIFY_SOURCE already, not adding it." >&4
22967 *) echo "Adding -D_FORTIFY_SOURCE=2 to ccflags..." >&4
22968 ccflags="$ccflags -D_FORTIFY_SOURCE=2"
22972 *) echo "You have gcc 4.* but not optimizing, not adding -D_FORTIFY_SOURCE." >&4
22976 *) echo "You seem not to have gcc 4.*, not adding -D_FORTIFY_SOURCE." >&4
22980 : see if this is a termio system
22984 if $test `./findhdr termios.h`; then
22985 set tcsetattr i_termios
22991 "$define") echo "You have POSIX termios.h... good!" >&4;;
22992 *) if ./Cppsym pyr; then
22993 case "`$run /bin/universe`" in
22994 ucb) if $test `./findhdr sgtty.h`; then
22996 echo "<sgtty.h> found." >&4
22998 echo "System is pyramid with BSD universe."
22999 ./warn "<sgtty.h> not found--you could have problems."
23001 *) if $test `./findhdr termio.h`; then
23003 echo "<termio.h> found." >&4
23005 echo "System is pyramid with USG universe."
23006 ./warn "<termio.h> not found--you could have problems."
23010 if $test `./findhdr termio.h`; then
23011 echo "<termio.h> found." >&4
23013 elif $test `./findhdr sgtty.h`; then
23014 echo "<sgtty.h> found." >&4
23017 ./warn "Neither <termio.h> nor <sgtty.h> found--cross fingers!"
23020 if $test `./findhdr sgtty.h`; then
23021 echo "<sgtty.h> found." >&4
23023 elif $test `./findhdr termio.h`; then
23024 echo "<termio.h> found." >&4
23027 ./warn "Neither <sgtty.h> nor <termio.h> found--cross fingers!"
23031 set i_termio; eval $setvar
23032 val=$val2; set i_sgtty; eval $setvar
23033 val=$val3; set i_termios; eval $setvar
23035 : see if stdbool is available
23036 : we want a real compile instead of Inhdr because some Solaris systems
23037 : have stdbool.h, but it can only be used if the compiler indicates it
23038 : is sufficiently c99-compliant.
23042 #include <stdbool.h>
23047 int main(int argc, char **argv)
23053 if eval $compile; then
23054 echo "<stdbool.h> found." >&4
23057 echo "<stdbool.h> NOT found." >&4
23064 : see if stddef is available
23065 set stddef.h i_stddef
23068 : see if stdint is available
23069 set stdint.h i_stdint
23072 : see if sys/access.h is available
23073 set sys/access.h i_sysaccess
23076 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
23077 set sys/filio.h i_sysfilio
23080 if $test `./findhdr sys/ioctl.h`; then
23082 echo '<sys/ioctl.h> found.' >&4
23085 if $test $i_sysfilio = "$define"; then
23086 echo '<sys/ioctl.h> NOT found.' >&4
23088 $test $i_sgtty = "$define" && xxx="sgtty.h"
23089 $test $i_termio = "$define" && xxx="termio.h"
23090 $test $i_termios = "$define" && xxx="termios.h"
23091 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
23097 : see if socket ioctl defs are in sys/sockio.h
23099 xxx=`./findhdr sys/sockio.h`
23100 if $test "$xxx"; then
23101 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
23103 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
23106 echo "No socket ioctls found in <sys/sockio.h>." >&4
23111 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
23117 : see if this is a syslog.h system
23118 set syslog.h i_syslog
23121 : see if this is a sys/mode.h system
23122 set sys/mode.h i_sysmode
23125 : see if there is a sys/poll.h file
23126 set sys/poll.h i_syspoll
23129 : see if sys/resource.h has to be included
23130 set sys/resource.h i_sysresrc
23133 : see if sys/security.h is available
23134 set sys/security.h i_syssecrt
23137 : see if this is a sys/statvfs.h system
23138 set sys/statvfs.h i_sysstatvfs
23141 : see if this is a sys/un.h system
23142 set sys/un.h i_sysun
23145 : see if this is a sys/utsname.h system
23146 set sys/utsname.h i_sysutsname
23149 : see if this is a syswait system
23150 set sys/wait.h i_syswait
23153 : see if this is a ustat.h system
23154 set ustat.h i_ustat
23157 : see if this is an utime system
23158 set utime.h i_utime
23161 : see if this is a vfork system
23164 set vfork.h i_vfork
23174 echo "Looking for extensions..." >&4
23175 : If we are using the old config.sh, nonxs_extensions and xs_extensions may
23176 : contain old or inaccurate or duplicate values.
23177 nonxs_extensions=''
23179 : We do not use find because it might not be available.
23180 : We do not just use MANIFEST because the user may have dropped
23181 : some additional extensions into the source tree and expect them
23184 : Function to recursively find available extensions, ignoring DynaLoader
23185 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
23186 : In 5.10.1 and later, extensions are stored in directories
23187 : like File-Glob instead of the older File/Glob/.
23191 DynaLoader|dynaload) ;;
23193 this_ext=`echo $xxx | $sed -e s/-/\\\//g`;
23194 case "$this_ext" in
23195 Scalar/List/Utils) this_ext="List/Util" ;;
23196 PathTools) this_ext="Cwd" ;;
23198 echo " $xs_extensions $nonxs_extensions" > $tdir/$$.tmp;
23199 if $contains " $this_ext " $tdir/$$.tmp; then
23201 echo "Duplicate directories detected for extension $xxx" >&4;
23202 echo "Configure cannot correctly recover from this - shall I abort?" >&4;
23203 case "$knowitall" in
23211 echo "Ok. Stopping Configure." >&4;
23212 echo "Please remove the duplicate directory (e.g. using git clean) and then re-run Configure" >&4;
23215 echo "Ok. You will need to correct config.sh before running make." >&4;
23217 $ls -1 $xxx > $tdir/$$.tmp;
23218 if $contains "\.xs$" $tdir/$$.tmp > /dev/null 2>&1; then
23219 xs_extensions="$xs_extensions $this_ext";
23220 elif $contains "\.c$" $tdir/$$.tmp > /dev/null 2>&1; then
23221 xs_extensions="$xs_extensions $this_ext";
23222 elif $test -d $xxx; then
23223 nonxs_extensions="$nonxs_extensions $this_ext";
23225 $rm -f $tdir/$$.tmp;
23233 eval $find_extensions
23237 eval $find_extensions
23241 eval $find_extensions
23242 set X $xs_extensions
23244 xs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
23245 set X $nonxs_extensions
23247 nonxs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
23249 known_extensions=`echo $nonxs_extensions $xs_extensions | tr ' ' $trnl | $sort | tr $trnl ' '`
23251 : Now see which are supported on this system.
23253 for xxx in $xs_extensions ; do
23257 $define) avail_ext="$avail_ext $xxx" ;;
23260 GDBM_File|gdbm_fil)
23262 $define) avail_ext="$avail_ext $xxx" ;;
23265 I18N/Langinfo|i18n_lan)
23266 case "$i_langinfo$d_nl_langinfo" in
23267 $define$define) avail_ext="$avail_ext $xxx" ;;
23271 : XXX Do we need a useipcsysv variable here
23272 case "${d_msg}${d_sem}${d_shm}" in
23273 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
23276 NDBM_File|ndbm_fil)
23279 case "$osname-$use64bitint" in
23282 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
23285 *) avail_ext="$avail_ext $xxx" ;;
23290 ODBM_File|odbm_fil)
23291 case "${i_dbm}${i_rpcsvcdbm}" in
23293 case "$d_cplusplus" in
23294 define) ;; # delete as a function name will not work
23295 *) case "$osname-$use64bitint" in
23298 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
23301 *) avail_ext="$avail_ext $xxx" ;;
23309 case "$useopcode" in
23310 true|define|y) avail_ext="$avail_ext $xxx" ;;
23314 case "$useposix" in
23315 true|define|y) avail_ext="$avail_ext $xxx" ;;
23319 case "$d_socket" in
23320 true|$define|y) avail_ext="$avail_ext $xxx" ;;
23323 Sys/Syslog|sys/syslog)
23324 : XXX syslog requires socket
23325 case "$d_socket" in
23326 true|$define|y) avail_ext="$avail_ext $xxx" ;;
23330 case "$usethreads" in
23332 case "$use5005threads" in
23333 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
23337 threads|threads/shared)
23338 # threads and threads::shared are special cases.
23339 # To stop people from asking "Perl 5.8.0 was supposed
23340 # to have this new fancy threads implementation but my
23341 # perl doesn't have it" and from people trying to
23342 # (re)install the threads module using CPAN.pm and
23343 # CPAN.pm then offering to reinstall Perl 5.8.0,
23344 # the threads.pm and threads/shared.pm will always be
23345 # there, croaking informatively ("you need to rebuild
23346 # all of Perl with threads, sorry") when threads haven't
23347 # been compiled in.
23349 avail_ext="$avail_ext $xxx"
23355 cygwin) avail_ext="$avail_ext $xxx" ;;
23358 XS/APItest|xs/apitest)
23359 # This is just for testing. Skip it unless we have dynamic loading.
23362 $define) avail_ext="$avail_ext $xxx" ;;
23365 XS/Typemap|xs/typemap)
23366 # This is just for testing. Skip it unless we have dynamic loading.
23368 $define) avail_ext="$avail_ext $xxx" ;;
23371 *) avail_ext="$avail_ext $xxx"
23380 case "$onlyextensions" in
23382 *) keepextensions=''
23383 echo "You have requested that only certain extensions be included..." >&4
23384 for i in $onlyextensions; do
23385 case " $avail_ext " in
23387 echo "Keeping extension $i."
23388 keepextensions="$keepextensions $i"
23390 *) echo "Ignoring extension $i." ;;
23393 avail_ext="$keepextensions"
23397 case "$noextensions" in
23399 *) keepextensions=''
23400 echo "You have requested that certain extensions be ignored..." >&4
23401 for i in $avail_ext; do
23402 case " $noextensions " in
23403 *" $i "*) echo "Ignoring extension $i." ;;
23404 *) echo "Keeping extension $i.";
23405 keepextensions="$keepextensions $i"
23409 avail_ext="$keepextensions"
23413 : Now see which nonxs extensions are supported on this system.
23414 : For now assume all are.
23416 for xxx in $nonxs_extensions ; do
23420 *) nonxs_ext="$nonxs_ext $xxx"
23432 A number of extensions are supplied with $package. You may choose to
23433 compile these extensions for dynamic loading (the default), compile
23434 them into the $package executable (static loading), or not include
23435 them at all. Answer "none" to include no extensions.
23436 Note that DynaLoader is always built and need not be mentioned here.
23439 case "$dynamic_ext" in
23441 : Exclude those listed in static_ext
23443 for xxx in $avail_ext; do
23444 case " $static_ext " in
23446 *) dflt="$dflt $xxx" ;;
23453 *) dflt="$dynamic_ext"
23454 # Perhaps we are reusing an old out-of-date config.sh.
23457 if test X"$dynamic_ext" != X"$avail_ext"; then
23459 NOTICE: Your previous config.sh list may be incorrect.
23460 The extensions now available to you are
23462 but the default list from your previous config.sh is
23474 rp="What extensions do you wish to load dynamically?"
23477 none) dynamic_ext=' ' ;;
23478 *) dynamic_ext="$ans" ;;
23481 case "$static_ext" in
23483 : Exclude those already listed in dynamic linking
23485 for xxx in $avail_ext; do
23486 case " $dynamic_ext " in
23488 *) dflt="$dflt $xxx" ;;
23495 *) dflt="$static_ext"
23502 rp="What extensions do you wish to load statically?"
23505 none) static_ext=' ' ;;
23506 *) static_ext="$ans" ;;
23511 A number of extensions are supplied with $package. Answer "none"
23512 to include no extensions.
23513 Note that DynaLoader is always built and need not be mentioned here.
23516 case "$static_ext" in
23517 '') dflt="$avail_ext" ;;
23518 *) dflt="$static_ext"
23519 # Perhaps we are reusing an old out-of-date config.sh.
23522 if test X"$static_ext" != X"$avail_ext"; then
23524 NOTICE: Your previous config.sh list may be incorrect.
23525 The extensions now available to you are
23527 but the default list from your previous config.sh is
23536 : Exclude those that are not xs extensions
23540 rp="What extensions do you wish to include?"
23543 none) static_ext=' ' ;;
23544 *) static_ext="$ans" ;;
23549 # Encode is a special case. If we are building Encode as a static
23550 # extension, we need to explicitly list its subextensions as well.
23551 # For other nested extensions, this is handled automatically by
23552 # the appropriate Makefile.PL.
23553 case " $static_ext " in
23554 *" Encode "*) # Add the subextensions of Encode
23556 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
23557 static_ext="$static_ext Encode/$xxx"
23558 known_extensions="$known_extensions Encode/$xxx"
23564 set X $dynamic_ext $static_ext $nonxs_ext
23568 # Sanity check: We require an extension suitable for use with
23569 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
23570 # should show up as failures in the test suite, but it's helpful to
23571 # catch them now.) The 'extensions' list is normally sorted
23572 # alphabetically, so we need to accept either
23573 # DB_File ... Fcntl ... IO ....
23574 # or something like
23575 # Fcntl ... NDBM_File ... IO ....
23576 case " $extensions" in
23577 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
23578 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
23579 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
23580 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
23581 echo "WARNING: The Perl you are building will be quite crippled." >& 4
23585 : Remove libraries needed only for extensions
23586 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
23587 : The exception is SunOS 4.x, which needs them.
23588 case "${osname}X${osvers}" in
23592 *) case "$usedl" in
23593 $define|true|[yY]*)
23594 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
23598 *) perllibs="$libs"
23604 : Remove build directory name from cppstdin so it can be used from
23605 : either the present location or the final installed location.
23607 : Get out of the UU directory to get correct path name.
23609 case "$cppstdin" in
23611 echo "Stripping down cppstdin path name"
23617 : end of configuration questions
23619 echo "End of configuration questions."
23622 : back to where it started
23623 if test -d ../UU; then
23627 : configuration may be unconditionally patched via a 'config.arch' file
23628 if $test -f config.arch; then
23629 echo "I see a config.arch file, loading it." >&4
23633 : configuration may be patched via a 'config.over' file
23634 if $test -f config.over; then
23637 rp='I see a config.over file. Do you wish to load it?'
23640 n*) echo "OK, I'll ignore it.";;
23642 echo "Configuration override changes have been loaded."
23647 : in case they want portability, strip down executable paths
23648 case "$d_portable" in
23651 echo "Stripping down executable paths..." >&4
23652 for file in $loclist $trylist; do
23654 eval $file=`basename $temp`
23659 : create config.sh file
23661 echo "Creating config.sh..." >&4
23662 $spitshell <<EOT >config.sh
23665 # This file was produced by running the Configure script. It holds all the
23666 # definitions figured out by Configure. Should you modify one of these values,
23667 # do not forget to propagate your changes by running "Configure -der". You may
23668 # instead choose to run each of the .SH files by yourself, or "Configure -S".
23671 # Package name : $package
23672 # Source directory : $src
23673 # Configuration time: $cf_time
23674 # Configured by : $cf_by
23675 # Target system : $myuname
23678 : Add in command line options if available
23679 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
23681 $spitshell <<EOT >>config.sh
23690 Revision='$Revision'
23698 alignbytes='$alignbytes'
23699 ansi2knr='$ansi2knr'
23700 aphostname='$aphostname'
23701 api_revision='$api_revision'
23702 api_subversion='$api_subversion'
23703 api_version='$api_version'
23704 api_versionstring='$api_versionstring'
23707 archlibexp='$archlibexp'
23708 archname64='$archname64'
23709 archname='$archname'
23710 archobjs='$archobjs'
23711 asctime_r_proto='$asctime_r_proto'
23720 byteorder='$byteorder'
23722 castflags='$castflags'
23725 cccdlflags='$cccdlflags'
23726 ccdlflags='$ccdlflags'
23728 ccflags_uselargefiles='$ccflags_uselargefiles'
23730 ccsymbols='$ccsymbols'
23731 ccversion='$ccversion'
23733 cf_email='$cf_email'
23735 charbits='$charbits'
23736 charsize='$charsize'
23740 clocktype='$clocktype'
23742 compress='$compress'
23743 contains='$contains'
23747 cpp_stuff='$cpp_stuff'
23748 cppccsymbols='$cppccsymbols'
23749 cppflags='$cppflags'
23751 cppminus='$cppminus'
23753 cppstdin='$cppstdin'
23754 cppsymbols='$cppsymbols'
23755 crypt_r_proto='$crypt_r_proto'
23756 cryptlib='$cryptlib'
23758 ctermid_r_proto='$ctermid_r_proto'
23759 ctime_r_proto='$ctime_r_proto'
23760 d_Gconvert='$d_Gconvert'
23761 d_PRIEUldbl='$d_PRIEUldbl'
23762 d_PRIFUldbl='$d_PRIFUldbl'
23763 d_PRIGUldbl='$d_PRIGUldbl'
23764 d_PRIXU64='$d_PRIXU64'
23765 d_PRId64='$d_PRId64'
23766 d_PRIeldbl='$d_PRIeldbl'
23767 d_PRIfldbl='$d_PRIfldbl'
23768 d_PRIgldbl='$d_PRIgldbl'
23769 d_PRIi64='$d_PRIi64'
23770 d_PRIo64='$d_PRIo64'
23771 d_PRIu64='$d_PRIu64'
23772 d_PRIx64='$d_PRIx64'
23773 d_SCNfldbl='$d_SCNfldbl'
23774 d__fwalk='$d__fwalk'
23775 d_access='$d_access'
23776 d_accessx='$d_accessx'
23780 d_archlib='$d_archlib'
23781 d_asctime64='$d_asctime64'
23782 d_asctime_r='$d_asctime_r'
23787 d_attribute_deprecated='$d_attribute_deprecated'
23788 d_attribute_format='$d_attribute_format'
23789 d_attribute_malloc='$d_attribute_malloc'
23790 d_attribute_nonnull='$d_attribute_nonnull'
23791 d_attribute_noreturn='$d_attribute_noreturn'
23792 d_attribute_pure='$d_attribute_pure'
23793 d_attribute_unused='$d_attribute_unused'
23794 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
23795 d_backtrace='$d_backtrace'
23799 d_bsdgetpgrp='$d_bsdgetpgrp'
23800 d_bsdsetpgrp='$d_bsdsetpgrp'
23801 d_builtin_choose_expr='$d_builtin_choose_expr'
23802 d_builtin_expect='$d_builtin_expect'
23804 d_c99_variadic_macros='$d_c99_variadic_macros'
23805 d_casti32='$d_casti32'
23806 d_castneg='$d_castneg'
23808 d_charvspr='$d_charvspr'
23810 d_chroot='$d_chroot'
23811 d_chsize='$d_chsize'
23813 d_clearenv='$d_clearenv'
23814 d_closedir='$d_closedir'
23815 d_cmsghdr_s='$d_cmsghdr_s'
23817 d_copysign='$d_copysign'
23818 d_copysignl='$d_copysignl'
23819 d_cplusplus='$d_cplusplus'
23821 d_crypt_r='$d_crypt_r'
23823 d_ctermid='$d_ctermid'
23824 d_ctermid_r='$d_ctermid_r'
23825 d_ctime64='$d_ctime64'
23826 d_ctime_r='$d_ctime_r'
23827 d_cuserid='$d_cuserid'
23828 d_dbl_dig='$d_dbl_dig'
23829 d_dbminitproto='$d_dbminitproto'
23830 d_difftime64='$d_difftime64'
23831 d_difftime='$d_difftime'
23832 d_dir_dd_fd='$d_dir_dd_fd'
23834 d_dirnamlen='$d_dirnamlen'
23835 d_dladdr='$d_dladdr'
23836 d_dlerror='$d_dlerror'
23837 d_dlopen='$d_dlopen'
23838 d_dlsymun='$d_dlsymun'
23839 d_dosuid='$d_dosuid'
23840 d_drand48_r='$d_drand48_r'
23841 d_drand48proto='$d_drand48proto'
23843 d_eaccess='$d_eaccess'
23844 d_endgrent='$d_endgrent'
23845 d_endgrent_r='$d_endgrent_r'
23846 d_endhent='$d_endhent'
23847 d_endhostent_r='$d_endhostent_r'
23848 d_endnent='$d_endnent'
23849 d_endnetent_r='$d_endnetent_r'
23850 d_endpent='$d_endpent'
23851 d_endprotoent_r='$d_endprotoent_r'
23852 d_endpwent='$d_endpwent'
23853 d_endpwent_r='$d_endpwent_r'
23854 d_endsent='$d_endsent'
23855 d_endservent_r='$d_endservent_r'
23856 d_eofnblk='$d_eofnblk'
23859 d_eunice='$d_eunice'
23862 d_faststdio='$d_faststdio'
23863 d_fchdir='$d_fchdir'
23864 d_fchmod='$d_fchmod'
23865 d_fchown='$d_fchown'
23867 d_fcntl_can_lock='$d_fcntl_can_lock'
23868 d_fd_macros='$d_fd_macros'
23869 d_fd_set='$d_fd_set'
23871 d_fds_bits='$d_fds_bits'
23872 d_fegetround='$d_fegetround'
23873 d_fgetpos='$d_fgetpos'
23874 d_finite='$d_finite'
23875 d_finitel='$d_finitel'
23876 d_flexfnam='$d_flexfnam'
23878 d_flockproto='$d_flockproto'
23883 d_fp_class='$d_fp_class'
23884 d_fp_classify='$d_fp_classify'
23885 d_fp_classl='$d_fp_classl'
23886 d_fpathconf='$d_fpathconf'
23887 d_fpclass='$d_fpclass'
23888 d_fpclassify='$d_fpclassify'
23889 d_fpclassl='$d_fpclassl'
23890 d_fpgetround='$d_fpgetround'
23891 d_fpos64_t='$d_fpos64_t'
23892 d_frexpl='$d_frexpl'
23893 d_fs_data_s='$d_fs_data_s'
23894 d_fseeko='$d_fseeko'
23895 d_fsetpos='$d_fsetpos'
23896 d_fstatfs='$d_fstatfs'
23897 d_fstatvfs='$d_fstatvfs'
23899 d_ftello='$d_ftello'
23901 d_futimes='$d_futimes'
23902 d_gdbm_ndbm_h_uses_prototypes='$d_gdbm_ndbm_h_uses_prototypes'
23903 d_gdbmndbm_h_uses_prototypes='$d_gdbmndbm_h_uses_prototypes'
23904 d_getaddrinfo='$d_getaddrinfo'
23905 d_getcwd='$d_getcwd'
23906 d_getespwnam='$d_getespwnam'
23907 d_getfsstat='$d_getfsstat'
23908 d_getgrent='$d_getgrent'
23909 d_getgrent_r='$d_getgrent_r'
23910 d_getgrgid_r='$d_getgrgid_r'
23911 d_getgrnam_r='$d_getgrnam_r'
23912 d_getgrps='$d_getgrps'
23913 d_gethbyaddr='$d_gethbyaddr'
23914 d_gethbyname='$d_gethbyname'
23915 d_gethent='$d_gethent'
23916 d_gethname='$d_gethname'
23917 d_gethostbyaddr_r='$d_gethostbyaddr_r'
23918 d_gethostbyname_r='$d_gethostbyname_r'
23919 d_gethostent_r='$d_gethostent_r'
23920 d_gethostprotos='$d_gethostprotos'
23921 d_getitimer='$d_getitimer'
23922 d_getlogin='$d_getlogin'
23923 d_getlogin_r='$d_getlogin_r'
23924 d_getmnt='$d_getmnt'
23925 d_getmntent='$d_getmntent'
23926 d_getnameinfo='$d_getnameinfo'
23927 d_getnbyaddr='$d_getnbyaddr'
23928 d_getnbyname='$d_getnbyname'
23929 d_getnent='$d_getnent'
23930 d_getnetbyaddr_r='$d_getnetbyaddr_r'
23931 d_getnetbyname_r='$d_getnetbyname_r'
23932 d_getnetent_r='$d_getnetent_r'
23933 d_getnetprotos='$d_getnetprotos'
23934 d_getpagsz='$d_getpagsz'
23935 d_getpbyname='$d_getpbyname'
23936 d_getpbynumber='$d_getpbynumber'
23937 d_getpent='$d_getpent'
23938 d_getpgid='$d_getpgid'
23939 d_getpgrp2='$d_getpgrp2'
23940 d_getpgrp='$d_getpgrp'
23941 d_getppid='$d_getppid'
23942 d_getprior='$d_getprior'
23943 d_getprotobyname_r='$d_getprotobyname_r'
23944 d_getprotobynumber_r='$d_getprotobynumber_r'
23945 d_getprotoent_r='$d_getprotoent_r'
23946 d_getprotoprotos='$d_getprotoprotos'
23947 d_getprpwnam='$d_getprpwnam'
23948 d_getpwent='$d_getpwent'
23949 d_getpwent_r='$d_getpwent_r'
23950 d_getpwnam_r='$d_getpwnam_r'
23951 d_getpwuid_r='$d_getpwuid_r'
23952 d_getsbyname='$d_getsbyname'
23953 d_getsbyport='$d_getsbyport'
23954 d_getsent='$d_getsent'
23955 d_getservbyname_r='$d_getservbyname_r'
23956 d_getservbyport_r='$d_getservbyport_r'
23957 d_getservent_r='$d_getservent_r'
23958 d_getservprotos='$d_getservprotos'
23959 d_getspnam='$d_getspnam'
23960 d_getspnam_r='$d_getspnam_r'
23961 d_gettimeod='$d_gettimeod'
23962 d_gmtime64='$d_gmtime64'
23963 d_gmtime_r='$d_gmtime_r'
23964 d_gnulibc='$d_gnulibc'
23965 d_grpasswd='$d_grpasswd'
23966 d_hasmntopt='$d_hasmntopt'
23970 d_ilogbl='$d_ilogbl'
23971 d_inc_version_list='$d_inc_version_list'
23973 d_inetaton='$d_inetaton'
23974 d_inetntop='$d_inetntop'
23975 d_inetpton='$d_inetpton'
23976 d_int64_t='$d_int64_t'
23977 d_ip_mreq='$d_ip_mreq'
23978 d_ip_mreq_source='$d_ip_mreq_source'
23979 d_ipv6_mreq='$d_ipv6_mreq'
23980 d_ipv6_mreq_source='$d_ipv6_mreq_source'
23981 d_isascii='$d_isascii'
23982 d_isblank='$d_isblank'
23983 d_isfinite='$d_isfinite'
23984 d_isfinitel='$d_isfinitel'
23986 d_isinfl='$d_isinfl'
23987 d_isless='$d_isless'
23989 d_isnanl='$d_isnanl'
23990 d_isnormal='$d_isnormal'
23993 d_killpg='$d_killpg'
23994 d_lc_monetary_2008='$d_lc_monetary_2008'
23995 d_lchown='$d_lchown'
23996 d_ldbl_dig='$d_ldbl_dig'
23997 d_ldexpl='$d_ldexpl'
23998 d_lgamma='$d_lgamma'
23999 d_lgamma_r='$d_lgamma_r'
24000 d_libm_lib_version='$d_libm_lib_version'
24001 d_libname_unique='$d_libname_unique'
24003 d_llrint='$d_llrint'
24004 d_llrintl='$d_llrintl'
24005 d_llround='$d_llround'
24006 d_llroundl='$d_llroundl'
24007 d_localtime64='$d_localtime64'
24008 d_localtime_r='$d_localtime_r'
24009 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
24010 d_locconv='$d_locconv'
24015 d_longdbl='$d_longdbl'
24016 d_longlong='$d_longlong'
24018 d_lrintl='$d_lrintl'
24019 d_lround='$d_lround'
24020 d_lroundl='$d_lroundl'
24021 d_lseekproto='$d_lseekproto'
24023 d_madvise='$d_madvise'
24024 d_malloc_good_size='$d_malloc_good_size'
24025 d_malloc_size='$d_malloc_size'
24027 d_mbstowcs='$d_mbstowcs'
24028 d_mbtowc='$d_mbtowc'
24029 d_memchr='$d_memchr'
24030 d_memcmp='$d_memcmp'
24031 d_memcpy='$d_memcpy'
24032 d_memmove='$d_memmove'
24033 d_memset='$d_memset'
24035 d_mkdtemp='$d_mkdtemp'
24036 d_mkfifo='$d_mkfifo'
24037 d_mkstemp='$d_mkstemp'
24038 d_mkstemps='$d_mkstemps'
24039 d_mktime64='$d_mktime64'
24040 d_mktime='$d_mktime'
24043 d_modfl_pow32_bug='$d_modfl_pow32_bug'
24044 d_modflproto='$d_modflproto'
24045 d_mprotect='$d_mprotect'
24047 d_msg_ctrunc='$d_msg_ctrunc'
24048 d_msg_dontroute='$d_msg_dontroute'
24049 d_msg_oob='$d_msg_oob'
24050 d_msg_peek='$d_msg_peek'
24051 d_msg_proxy='$d_msg_proxy'
24052 d_msgctl='$d_msgctl'
24053 d_msgget='$d_msgget'
24054 d_msghdr_s='$d_msghdr_s'
24055 d_msgrcv='$d_msgrcv'
24056 d_msgsnd='$d_msgsnd'
24058 d_munmap='$d_munmap'
24059 d_mymalloc='$d_mymalloc'
24062 d_ndbm_h_uses_prototypes='$d_ndbm_h_uses_prototypes'
24063 d_nearbyint='$d_nearbyint'
24064 d_nextafter='$d_nextafter'
24065 d_nexttoward='$d_nexttoward'
24067 d_nl_langinfo='$d_nl_langinfo'
24068 d_nv_preserves_uv='$d_nv_preserves_uv'
24069 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
24070 d_off64_t='$d_off64_t'
24071 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
24072 d_oldpthreads='$d_oldpthreads'
24073 d_oldsock='$d_oldsock'
24075 d_pathconf='$d_pathconf'
24077 d_perl_otherlibdirs='$d_perl_otherlibdirs'
24078 d_phostname='$d_phostname'
24081 d_portable='$d_portable'
24083 d_prctl_set_name='$d_prctl_set_name'
24084 d_printf_format_null='$d_printf_format_null'
24085 d_procselfexe='$d_procselfexe'
24086 d_pseudofork='$d_pseudofork'
24087 d_pthread_atfork='$d_pthread_atfork'
24088 d_pthread_attr_setscope='$d_pthread_attr_setscope'
24089 d_pthread_yield='$d_pthread_yield'
24090 d_ptrdiff_t='$d_ptrdiff_t'
24092 d_pwchange='$d_pwchange'
24093 d_pwclass='$d_pwclass'
24094 d_pwcomment='$d_pwcomment'
24095 d_pwexpire='$d_pwexpire'
24096 d_pwgecos='$d_pwgecos'
24097 d_pwpasswd='$d_pwpasswd'
24098 d_pwquota='$d_pwquota'
24101 d_random_r='$d_random_r'
24102 d_re_comp='$d_re_comp'
24103 d_readdir64_r='$d_readdir64_r'
24104 d_readdir='$d_readdir'
24105 d_readdir_r='$d_readdir_r'
24106 d_readlink='$d_readlink'
24108 d_recvmsg='$d_recvmsg'
24109 d_regcmp='$d_regcmp'
24110 d_regcomp='$d_regcomp'
24111 d_remainder='$d_remainder'
24112 d_remquo='$d_remquo'
24113 d_rename='$d_rename'
24114 d_rewinddir='$d_rewinddir'
24118 d_safebcpy='$d_safebcpy'
24119 d_safemcpy='$d_safemcpy'
24120 d_sanemcmp='$d_sanemcmp'
24121 d_sbrkproto='$d_sbrkproto'
24122 d_scalbn='$d_scalbn'
24123 d_scalbnl='$d_scalbnl'
24124 d_sched_yield='$d_sched_yield'
24125 d_scm_rights='$d_scm_rights'
24126 d_seekdir='$d_seekdir'
24127 d_select='$d_select'
24129 d_semctl='$d_semctl'
24130 d_semctl_semid_ds='$d_semctl_semid_ds'
24131 d_semctl_semun='$d_semctl_semun'
24132 d_semget='$d_semget'
24134 d_sendmsg='$d_sendmsg'
24135 d_setegid='$d_setegid'
24136 d_seteuid='$d_seteuid'
24137 d_setgrent='$d_setgrent'
24138 d_setgrent_r='$d_setgrent_r'
24139 d_setgrps='$d_setgrps'
24140 d_sethent='$d_sethent'
24141 d_sethostent_r='$d_sethostent_r'
24142 d_setitimer='$d_setitimer'
24143 d_setlinebuf='$d_setlinebuf'
24144 d_setlocale='$d_setlocale'
24145 d_setlocale_r='$d_setlocale_r'
24146 d_setnent='$d_setnent'
24147 d_setnetent_r='$d_setnetent_r'
24148 d_setpent='$d_setpent'
24149 d_setpgid='$d_setpgid'
24150 d_setpgrp2='$d_setpgrp2'
24151 d_setpgrp='$d_setpgrp'
24152 d_setprior='$d_setprior'
24153 d_setproctitle='$d_setproctitle'
24154 d_setprotoent_r='$d_setprotoent_r'
24155 d_setpwent='$d_setpwent'
24156 d_setpwent_r='$d_setpwent_r'
24157 d_setregid='$d_setregid'
24158 d_setresgid='$d_setresgid'
24159 d_setresuid='$d_setresuid'
24160 d_setreuid='$d_setreuid'
24161 d_setrgid='$d_setrgid'
24162 d_setruid='$d_setruid'
24163 d_setsent='$d_setsent'
24164 d_setservent_r='$d_setservent_r'
24165 d_setsid='$d_setsid'
24166 d_setvbuf='$d_setvbuf'
24169 d_shmatprototype='$d_shmatprototype'
24170 d_shmctl='$d_shmctl'
24172 d_shmget='$d_shmget'
24173 d_sigaction='$d_sigaction'
24174 d_signbit='$d_signbit'
24175 d_sigprocmask='$d_sigprocmask'
24176 d_sigsetjmp='$d_sigsetjmp'
24177 d_sin6_scope_id='$d_sin6_scope_id'
24178 d_sitearch='$d_sitearch'
24179 d_snprintf='$d_snprintf'
24180 d_sockaddr_in6='$d_sockaddr_in6'
24181 d_sockaddr_sa_len='$d_sockaddr_sa_len'
24182 d_sockatmark='$d_sockatmark'
24183 d_sockatmarkproto='$d_sockatmarkproto'
24184 d_socket='$d_socket'
24185 d_socklen_t='$d_socklen_t'
24186 d_sockpair='$d_sockpair'
24187 d_socks5_init='$d_socks5_init'
24188 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
24190 d_srand48_r='$d_srand48_r'
24191 d_srandom_r='$d_srandom_r'
24192 d_sresgproto='$d_sresgproto'
24193 d_sresuproto='$d_sresuproto'
24195 d_statblks='$d_statblks'
24196 d_statfs_f_flags='$d_statfs_f_flags'
24197 d_statfs_s='$d_statfs_s'
24198 d_static_inline='$d_static_inline'
24199 d_statvfs='$d_statvfs'
24200 d_stdio_cnt_lval='$d_stdio_cnt_lval'
24201 d_stdio_ptr_lval='$d_stdio_ptr_lval'
24202 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
24203 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
24204 d_stdio_stream_array='$d_stdio_stream_array'
24205 d_stdiobase='$d_stdiobase'
24206 d_stdstdio='$d_stdstdio'
24207 d_strchr='$d_strchr'
24208 d_strcoll='$d_strcoll'
24209 d_strctcpy='$d_strctcpy'
24210 d_strerrm='$d_strerrm'
24211 d_strerror='$d_strerror'
24212 d_strerror_r='$d_strerror_r'
24213 d_strftime='$d_strftime'
24214 d_strlcat='$d_strlcat'
24215 d_strlcpy='$d_strlcpy'
24216 d_strtod='$d_strtod'
24217 d_strtol='$d_strtol'
24218 d_strtold='$d_strtold'
24219 d_strtoll='$d_strtoll'
24220 d_strtoq='$d_strtoq'
24221 d_strtoul='$d_strtoul'
24222 d_strtoull='$d_strtoull'
24223 d_strtouq='$d_strtouq'
24224 d_strxfrm='$d_strxfrm'
24225 d_suidsafe='$d_suidsafe'
24226 d_symlink='$d_symlink'
24227 d_syscall='$d_syscall'
24228 d_syscallproto='$d_syscallproto'
24229 d_sysconf='$d_sysconf'
24230 d_sysernlst='$d_sysernlst'
24231 d_syserrlst='$d_syserrlst'
24232 d_system='$d_system'
24233 d_tcgetpgrp='$d_tcgetpgrp'
24234 d_tcsetpgrp='$d_tcsetpgrp'
24235 d_telldir='$d_telldir'
24236 d_telldirproto='$d_telldirproto'
24237 d_tgamma='$d_tgamma'
24239 d_timegm='$d_timegm'
24241 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
24242 d_tm_tm_zone='$d_tm_tm_zone'
24243 d_tmpnam_r='$d_tmpnam_r'
24245 d_truncate='$d_truncate'
24246 d_truncl='$d_truncl'
24247 d_ttyname_r='$d_ttyname_r'
24248 d_tzname='$d_tzname'
24249 d_u32align='$d_u32align'
24250 d_ualarm='$d_ualarm'
24253 d_union_semun='$d_union_semun'
24254 d_unordered='$d_unordered'
24255 d_unsetenv='$d_unsetenv'
24256 d_usleep='$d_usleep'
24257 d_usleepproto='$d_usleepproto'
24259 d_vendorarch='$d_vendorarch'
24260 d_vendorbin='$d_vendorbin'
24261 d_vendorlib='$d_vendorlib'
24262 d_vendorscript='$d_vendorscript'
24264 d_void_closedir='$d_void_closedir'
24265 d_voidsig='$d_voidsig'
24266 d_voidtty='$d_voidtty'
24267 d_volatile='$d_volatile'
24268 d_vprintf='$d_vprintf'
24269 d_vsnprintf='$d_vsnprintf'
24271 d_waitpid='$d_waitpid'
24272 d_wcscmp='$d_wcscmp'
24273 d_wcstombs='$d_wcstombs'
24274 d_wcsxfrm='$d_wcsxfrm'
24275 d_wctomb='$d_wctomb'
24276 d_writev='$d_writev'
24279 db_hashtype='$db_hashtype'
24280 db_prefixtype='$db_prefixtype'
24281 db_version_major='$db_version_major'
24282 db_version_minor='$db_version_minor'
24283 db_version_patch='$db_version_patch'
24284 direntrytype='$direntrytype'
24287 doublekind='$doublekind'
24288 doublesize='$doublesize'
24290 drand48_r_proto='$drand48_r_proto'
24292 dynamic_ext='$dynamic_ext'
24298 endgrent_r_proto='$endgrent_r_proto'
24299 endhostent_r_proto='$endhostent_r_proto'
24300 endnetent_r_proto='$endnetent_r_proto'
24301 endprotoent_r_proto='$endprotoent_r_proto'
24302 endpwent_r_proto='$endpwent_r_proto'
24303 endservent_r_proto='$endservent_r_proto'
24304 eunicefix='$eunicefix'
24307 extensions='$extensions'
24308 extern_C='$extern_C'
24310 fflushNULL='$fflushNULL'
24311 fflushall='$fflushall'
24313 firstmakefile='$firstmakefile'
24315 fpossize='$fpossize'
24316 fpostype='$fpostype'
24317 freetype='$freetype'
24320 full_csh='$full_csh'
24321 full_sed='$full_sed'
24322 gccansipedantic='$gccansipedantic'
24323 gccosandvers='$gccosandvers'
24324 gccversion='$gccversion'
24325 getgrent_r_proto='$getgrent_r_proto'
24326 getgrgid_r_proto='$getgrgid_r_proto'
24327 getgrnam_r_proto='$getgrnam_r_proto'
24328 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
24329 gethostbyname_r_proto='$gethostbyname_r_proto'
24330 gethostent_r_proto='$gethostent_r_proto'
24331 getlogin_r_proto='$getlogin_r_proto'
24332 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
24333 getnetbyname_r_proto='$getnetbyname_r_proto'
24334 getnetent_r_proto='$getnetent_r_proto'
24335 getprotobyname_r_proto='$getprotobyname_r_proto'
24336 getprotobynumber_r_proto='$getprotobynumber_r_proto'
24337 getprotoent_r_proto='$getprotoent_r_proto'
24338 getpwent_r_proto='$getpwent_r_proto'
24339 getpwnam_r_proto='$getpwnam_r_proto'
24340 getpwuid_r_proto='$getpwuid_r_proto'
24341 getservbyname_r_proto='$getservbyname_r_proto'
24342 getservbyport_r_proto='$getservbyport_r_proto'
24343 getservent_r_proto='$getservent_r_proto'
24344 getspnam_r_proto='$getspnam_r_proto'
24345 gidformat='$gidformat'
24351 gmtime_r_proto='$gmtime_r_proto'
24352 gnulibc_version='$gnulibc_version'
24354 groupcat='$groupcat'
24355 groupstype='$groupstype'
24358 h_sysfile='$h_sysfile'
24361 hostgenerate='$hostgenerate'
24362 hostosname='$hostosname'
24363 hostperl='$hostperl'
24364 html1dir='$html1dir'
24365 html1direxp='$html1direxp'
24366 html3dir='$html3dir'
24367 html3direxp='$html3direxp'
24376 i_arpainet='$i_arpainet'
24377 i_assert='$i_assert'
24379 i_bsdioctl='$i_bsdioctl'
24383 i_dirent='$i_dirent'
24385 i_execinfo='$i_execinfo'
24390 i_fp_class='$i_fp_class'
24392 i_gdbm_ndbm='$i_gdbm_ndbm'
24393 i_gdbmndbm='$i_gdbmndbm'
24395 i_ieeefp='$i_ieeefp'
24396 i_inttypes='$i_inttypes'
24397 i_langinfo='$i_langinfo'
24398 i_libutil='$i_libutil'
24399 i_limits='$i_limits'
24400 i_locale='$i_locale'
24401 i_machcthr='$i_machcthr'
24402 i_malloc='$i_malloc'
24403 i_mallocmalloc='$i_mallocmalloc'
24405 i_memory='$i_memory'
24406 i_mntent='$i_mntent'
24409 i_neterrno='$i_neterrno'
24410 i_netinettcp='$i_netinettcp'
24414 i_pthread='$i_pthread'
24416 i_quadmath='$i_quadmath'
24417 i_rpcsvcdbm='$i_rpcsvcdbm'
24419 i_shadow='$i_shadow'
24421 i_stdarg='$i_stdarg'
24422 i_stdbool='$i_stdbool'
24423 i_stddef='$i_stddef'
24424 i_stdint='$i_stdint'
24425 i_stdlib='$i_stdlib'
24426 i_string='$i_string'
24427 i_sunmath='$i_sunmath'
24428 i_sysaccess='$i_sysaccess'
24429 i_sysdir='$i_sysdir'
24430 i_sysfile='$i_sysfile'
24431 i_sysfilio='$i_sysfilio'
24433 i_sysioctl='$i_sysioctl'
24434 i_syslog='$i_syslog'
24435 i_sysmman='$i_sysmman'
24436 i_sysmode='$i_sysmode'
24437 i_sysmount='$i_sysmount'
24438 i_sysndir='$i_sysndir'
24439 i_sysparam='$i_sysparam'
24440 i_syspoll='$i_syspoll'
24441 i_sysresrc='$i_sysresrc'
24442 i_syssecrt='$i_syssecrt'
24443 i_sysselct='$i_sysselct'
24444 i_syssockio='$i_syssockio'
24445 i_sysstat='$i_sysstat'
24446 i_sysstatfs='$i_sysstatfs'
24447 i_sysstatvfs='$i_sysstatvfs'
24448 i_systime='$i_systime'
24449 i_systimek='$i_systimek'
24450 i_systimes='$i_systimes'
24451 i_systypes='$i_systypes'
24452 i_sysuio='$i_sysuio'
24454 i_sysutsname='$i_sysutsname'
24455 i_sysvfs='$i_sysvfs'
24456 i_syswait='$i_syswait'
24457 i_termio='$i_termio'
24458 i_termios='$i_termios'
24460 i_unistd='$i_unistd'
24463 i_values='$i_values'
24464 i_varargs='$i_varargs'
24465 i_varhdr='$i_varhdr'
24467 ignore_versioned_solibs='$ignore_versioned_solibs'
24468 inc_version_list='$inc_version_list'
24469 inc_version_list_init='$inc_version_list_init'
24473 initialinstalllocation='$initialinstalllocation'
24474 installarchlib='$installarchlib'
24475 installbin='$installbin'
24476 installhtml1dir='$installhtml1dir'
24477 installhtml3dir='$installhtml3dir'
24478 installman1dir='$installman1dir'
24479 installman3dir='$installman3dir'
24480 installprefix='$installprefix'
24481 installprefixexp='$installprefixexp'
24482 installprivlib='$installprivlib'
24483 installscript='$installscript'
24484 installsitearch='$installsitearch'
24485 installsitebin='$installsitebin'
24486 installsitehtml1dir='$installsitehtml1dir'
24487 installsitehtml3dir='$installsitehtml3dir'
24488 installsitelib='$installsitelib'
24489 installsiteman1dir='$installsiteman1dir'
24490 installsiteman3dir='$installsiteman3dir'
24491 installsitescript='$installsitescript'
24492 installstyle='$installstyle'
24493 installusrbinperl='$installusrbinperl'
24494 installvendorarch='$installvendorarch'
24495 installvendorbin='$installvendorbin'
24496 installvendorhtml1dir='$installvendorhtml1dir'
24497 installvendorhtml3dir='$installvendorhtml3dir'
24498 installvendorlib='$installvendorlib'
24499 installvendorman1dir='$installvendorman1dir'
24500 installvendorman3dir='$installvendorman3dir'
24501 installvendorscript='$installvendorscript'
24503 issymlink='$issymlink'
24504 ivdformat='$ivdformat'
24507 known_extensions='$known_extensions'
24510 ld_can_script='$ld_can_script'
24511 lddlflags='$lddlflags'
24513 ldflags_uselargefiles='$ldflags_uselargefiles'
24514 ldlibpthname='$ldlibpthname'
24521 libsdirs='$libsdirs'
24522 libsfiles='$libsfiles'
24523 libsfound='$libsfound'
24524 libspath='$libspath'
24525 libswanted='$libswanted'
24526 libswanted_uselargefiles='$libswanted_uselargefiles'
24532 localtime_r_proto='$localtime_r_proto'
24533 locincpth='$locincpth'
24534 loclibpth='$loclibpth'
24535 longdblkind='$longdblkind'
24536 longdblsize='$longdblsize'
24537 longlongsize='$longlongsize'
24538 longsize='$longsize'
24542 lseeksize='$lseeksize'
24543 lseektype='$lseektype'
24547 make_set_make='$make_set_make'
24548 mallocobj='$mallocobj'
24549 mallocsrc='$mallocsrc'
24550 malloctype='$malloctype'
24552 man1direxp='$man1direxp'
24555 man3direxp='$man3direxp'
24557 mips_type='$mips_type'
24558 mistrustnm='$mistrustnm'
24560 mmaptype='$mmaptype'
24561 modetype='$modetype'
24563 multiarch='$multiarch'
24565 myarchname='$myarchname'
24566 mydomain='$mydomain'
24567 myhostname='$myhostname'
24570 need_va_copy='$need_va_copy'
24571 netdb_hlen_type='$netdb_hlen_type'
24572 netdb_host_type='$netdb_host_type'
24573 netdb_name_type='$netdb_name_type'
24574 netdb_net_type='$netdb_net_type'
24577 nm_so_opt='$nm_so_opt'
24578 nonxs_ext='$nonxs_ext'
24580 nvEUformat='$nvEUformat'
24581 nvFUformat='$nvFUformat'
24582 nvGUformat='$nvGUformat'
24583 nv_overflows_integers_at='$nv_overflows_integers_at'
24584 nv_preserves_uv_bits='$nv_preserves_uv_bits'
24585 nveformat='$nveformat'
24586 nvfformat='$nvfformat'
24587 nvgformat='$nvgformat'
24590 o_nonblock='$o_nonblock'
24592 old_pthread_create_joinable='$old_pthread_create_joinable'
24593 optimize='$optimize'
24594 orderlib='$orderlib'
24597 otherlibdirs='$otherlibdirs'
24601 patchlevel='$patchlevel'
24602 path_sep='$path_sep'
24605 perl_patchlevel='$perl_patchlevel'
24606 perl_static_inline='$perl_static_inline'
24607 perladmin='$perladmin'
24608 perllibs='$perllibs'
24609 perlpath='$perlpath'
24611 phostname='$phostname'
24617 prefixexp='$prefixexp'
24619 privlibexp='$privlibexp'
24620 procselfexe='$procselfexe'
24621 prototype='$prototype'
24623 quadkind='$quadkind'
24624 quadtype='$quadtype'
24625 randbits='$randbits'
24626 randfunc='$randfunc'
24627 random_r_proto='$random_r_proto'
24628 randseedtype='$randseedtype'
24630 rd_nodata='$rd_nodata'
24631 readdir64_r_proto='$readdir64_r_proto'
24632 readdir_r_proto='$readdir_r_proto'
24633 revision='$revision'
24639 sGMTIME_max='$sGMTIME_max'
24640 sGMTIME_min='$sGMTIME_min'
24641 sLOCALTIME_max='$sLOCALTIME_max'
24642 sLOCALTIME_min='$sLOCALTIME_min'
24643 sPRIEUldbl='$sPRIEUldbl'
24644 sPRIFUldbl='$sPRIFUldbl'
24645 sPRIGUldbl='$sPRIGUldbl'
24646 sPRIXU64='$sPRIXU64'
24648 sPRIeldbl='$sPRIeldbl'
24649 sPRIfldbl='$sPRIfldbl'
24650 sPRIgldbl='$sPRIgldbl'
24655 sSCNfldbl='$sSCNfldbl'
24656 sched_yield='$sched_yield'
24657 scriptdir='$scriptdir'
24658 scriptdirexp='$scriptdirexp'
24660 seedfunc='$seedfunc'
24661 selectminbits='$selectminbits'
24662 selecttype='$selecttype'
24663 sendmail='$sendmail'
24664 setgrent_r_proto='$setgrent_r_proto'
24665 sethostent_r_proto='$sethostent_r_proto'
24666 setlocale_r_proto='$setlocale_r_proto'
24667 setnetent_r_proto='$setnetent_r_proto'
24668 setprotoent_r_proto='$setprotoent_r_proto'
24669 setpwent_r_proto='$setpwent_r_proto'
24670 setservent_r_proto='$setservent_r_proto'
24673 sharpbang='$sharpbang'
24674 shmattype='$shmattype'
24675 shortsize='$shortsize'
24678 sig_count='$sig_count'
24679 sig_name='$sig_name'
24680 sig_name_init='$sig_name_init'
24682 sig_num_init='$sig_num_init'
24683 sig_size='$sig_size'
24684 signal_t='$signal_t'
24685 sitearch='$sitearch'
24686 sitearchexp='$sitearchexp'
24688 sitebinexp='$sitebinexp'
24689 sitehtml1dir='$sitehtml1dir'
24690 sitehtml1direxp='$sitehtml1direxp'
24691 sitehtml3dir='$sitehtml3dir'
24692 sitehtml3direxp='$sitehtml3direxp'
24694 sitelib_stem='$sitelib_stem'
24695 sitelibexp='$sitelibexp'
24696 siteman1dir='$siteman1dir'
24697 siteman1direxp='$siteman1direxp'
24698 siteman3dir='$siteman3dir'
24699 siteman3direxp='$siteman3direxp'
24700 siteprefix='$siteprefix'
24701 siteprefixexp='$siteprefixexp'
24702 sitescript='$sitescript'
24703 sitescriptexp='$sitescriptexp'
24704 sizesize='$sizesize'
24705 sizetype='$sizetype'
24709 sockethdr='$sockethdr'
24710 socketlib='$socketlib'
24711 socksizetype='$socksizetype'
24713 spackage='$spackage'
24714 spitshell='$spitshell'
24715 srand48_r_proto='$srand48_r_proto'
24716 srandom_r_proto='$srandom_r_proto'
24718 ssizetype='$ssizetype'
24719 st_ino_sign='$st_ino_sign'
24720 st_ino_size='$st_ino_size'
24721 startperl='$startperl'
24723 static_ext='$static_ext'
24725 stdio_base='$stdio_base'
24726 stdio_bufsiz='$stdio_bufsiz'
24727 stdio_cnt='$stdio_cnt'
24728 stdio_filbuf='$stdio_filbuf'
24729 stdio_ptr='$stdio_ptr'
24730 stdio_stream_array='$stdio_stream_array'
24731 strerror_r_proto='$strerror_r_proto'
24734 subversion='$subversion'
24739 targetarch='$targetarch'
24740 targetdir='$targetdir'
24741 targetenv='$targetenv'
24742 targethost='$targethost'
24743 targetmkdir='$targetmkdir'
24744 targetport='$targetport'
24745 targetsh='$targetsh'
24749 timeincl='$timeincl'
24750 timetype='$timetype'
24751 tmpnam_r_proto='$tmpnam_r_proto'
24757 ttyname_r_proto='$ttyname_r_proto'
24766 uidformat='$uidformat'
24772 uquadtype='$uquadtype'
24773 use5005threads='$use5005threads'
24774 use64bitall='$use64bitall'
24775 use64bitint='$use64bitint'
24776 usecbacktrace='$usecbacktrace'
24777 usecrosscompile='$usecrosscompile'
24778 usedevel='$usedevel'
24780 usedtrace='$usedtrace'
24781 usefaststdio='$usefaststdio'
24782 useithreads='$useithreads'
24783 usekernprocpathname='$usekernprocpathname'
24784 uselargefiles='$uselargefiles'
24785 uselongdouble='$uselongdouble'
24786 usemallocwrap='$usemallocwrap'
24787 usemorebits='$usemorebits'
24788 usemultiplicity='$usemultiplicity'
24789 usemymalloc='$usemymalloc'
24791 usensgetexecutablepath='$usensgetexecutablepath'
24792 useopcode='$useopcode'
24793 useperlio='$useperlio'
24794 useposix='$useposix'
24795 usequadmath='$usequadmath'
24796 usereentrant='$usereentrant'
24797 userelocatableinc='$userelocatableinc'
24798 useshrplib='$useshrplib'
24799 usesitecustomize='$usesitecustomize'
24800 usesocks='$usesocks'
24801 usethreads='$usethreads'
24802 usevendorprefix='$usevendorprefix'
24803 useversionedarchname='$useversionedarchname'
24804 usevfork='$usevfork'
24807 uvXUformat='$uvXUformat'
24808 uvoformat='$uvoformat'
24811 uvuformat='$uvuformat'
24812 uvxformat='$uvxformat'
24814 vendorarch='$vendorarch'
24815 vendorarchexp='$vendorarchexp'
24816 vendorbin='$vendorbin'
24817 vendorbinexp='$vendorbinexp'
24818 vendorhtml1dir='$vendorhtml1dir'
24819 vendorhtml1direxp='$vendorhtml1direxp'
24820 vendorhtml3dir='$vendorhtml3dir'
24821 vendorhtml3direxp='$vendorhtml3direxp'
24822 vendorlib='$vendorlib'
24823 vendorlib_stem='$vendorlib_stem'
24824 vendorlibexp='$vendorlibexp'
24825 vendorman1dir='$vendorman1dir'
24826 vendorman1direxp='$vendorman1direxp'
24827 vendorman3dir='$vendorman3dir'
24828 vendorman3direxp='$vendorman3direxp'
24829 vendorprefix='$vendorprefix'
24830 vendorprefixexp='$vendorprefixexp'
24831 vendorscript='$vendorscript'
24832 vendorscriptexp='$vendorscriptexp'
24834 version_patchlevel_string='$version_patchlevel_string'
24835 versiononly='$versiononly'
24839 yaccflags='$yaccflags'
24844 : add special variables
24845 $test -f $src/patchlevel.h && \
24846 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
24847 echo "PERL_PATCHLEVEL='$perl_patchlevel'" >>config.sh
24848 echo "PERL_CONFIG_SH=true" >>config.sh
24850 : propagate old symbols
24851 if $test -f UU/config.sh; then
24852 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
24853 $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \
24854 config.sh config.sh UU/oldconfig.sh |\
24855 $sort | $uniq -u >UU/oldsyms
24856 set X `$cat UU/oldsyms`
24862 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
24864 echo ": Variables propagated from previous config.sh file." >>config.sh
24865 for sym in `$cat UU/oldsyms`; do
24866 echo " Propagating $hint variable "'$'"$sym..."
24867 eval 'tmp="$'"${sym}"'"'
24869 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
24875 : preserve RCS keywords in files with variable substitution, grrr
24878 : Finish up by extracting the .SH files
24882 echo "Extraction done."
24892 If you'd like to make any changes to the config.sh file before I begin
24893 to configure things, do it as a shell escape now (e.g. !vi config.sh).
24896 rp="Press return or use a shell escape to edit config.sh:"
24901 *) : in case they cannot read
24902 sh 1>&4 -c "$ans";;
24907 : if this fails, just run all the .SH files by hand
24916 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
24923 Now you need to generate make dependencies by running "$make depend".
24924 You might prefer to run it in background: "$make depend > makedepend.out &"
24925 It can take a while, so you might not want to run it right now.
24930 rp="Run $make depend now?"
24934 $make depend && echo "Now you must run '$make'."
24937 echo "You must run '$make depend' then '$make'."
24940 elif test -f [Mm]akefile; then
24942 echo "Now you must run a $make."
24944 echo "Configure done."
24947 if $test -f Policy.sh; then
24950 If you compile $package on a different machine or from a different object
24951 directory, copy the Policy.sh file from this object directory to the
24952 new one before you run Configure -- this will help you with most of
24953 the policy defaults.
24957 if $test -f config.msg; then
24958 echo "Hmm. I also noted the following information while running:"
24960 $cat config.msg >&4
24963 $rm -f kit*isdone ark*isdone