3 # If these # comments don't work, trim them. Don't worry about any other
4 # shell scripts, Configure will trim # comments from them for you.
6 # (If you are trying to port this package to a machine without sh,
7 # I would suggest you have a look at the prototypical config_h.SH file
8 # and edit it to reflect your system. Some packages may include samples
9 # of config.h for certain machines, so you might look for one of those.)
11 # Yes, you may rip this off to use in other distribution packages. This
12 # script belongs to the public domain and cannot be copyrighted.
14 # Note: this Configure script was generated automatically by the tool
15 # called "metaconfig". Rather than working with this copy of Configure,
16 # you may wish to get metaconfig. Perl uses a modified version of this
17 # tool, available in the "dist" folder in the checkout of the git repo
18 # $ git clone git://perl5.git.perl.org/metaconfig.git metaconfig
19 # The original dist package (including metaconfig) is available via SVN:
20 # $ svn co https://svn.code.sf.net/p/dist/code/trunk/dist
22 # Though this script was generated by metaconfig from metaunits, it is
23 # OK to send patches against Configure itself. It's up to the Configure
24 # pumpkin to backport the patch to the metaunits if it is accepted.
25 # For more information on patching Configure, see pod/perlhack.pod
27 # The metaunits are also available from the public git repository:
28 # http://perl5.git.perl.org/metaconfig.git/ or
29 # $ git clone git://perl5.git.perl.org/metaconfig.git metaconfig
31 # See Porting/pumpkin.pod for more information on metaconfig.
33 # Generated using [metaconfig 3.5 PL0]
34 # (with additional metaconfig patches by perlbug@perl.org)
39 SCO csh still thinks true is false. Write to SCO today and tell them that next
40 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
42 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
43 we'd have to do is go in and swap the && and || tokens, wherever they are.)
45 [End of diatribe. We now return you to your regularly scheduled programming...]
49 OOPS! You naughty creature! You didn't run Configure with sh!
50 I will attempt to remedy the situation by running sh for you...
54 true || exec sh $0 $argv:q
56 (exit $?0) || cat c2$$
57 (exit $?0) || exec sh $0 $argv:q
60 if test -f /dev/cputype -a -f /dev/drivers -a -f /dev/osversion; then
63 *** I'm sorry but this system looks like Plan 9 and Plan 9 doesn't do
64 *** Configure that well. (Plan 9 is close to UNIX but not close enough.)
65 *** Please read the README.plan9 for further instructions.
66 *** Cannot continue, aborting.
72 if test -f /sys/utilities/MultiView ; then
73 # AmigaOS, test -c for /dev/null is not useful
75 elif test ! -c /dev/null ; then
78 *** I'm sorry, but /dev/null appears to be a file rather than a device.
79 *** Please consult your operating sytem's notes for making a device
81 *** Cannot continue, aborting.
87 : compute my invocation name
91 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
96 : Proper separator for the PATH environment variable
98 : On OS/2 this directory should exist if this is not floppy only system ":-]"
99 if test -d c:/. || ( uname -a | grep -i 'os\(/\|\)2' 2>&1 ) 2>&1 >/dev/null ; then
100 if test -n "$OS2_SHELL"; then
102 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
103 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
105 elif test -n "$DJGPP"; then
106 case "X${MACHTYPE:-nonesuchmach}" in
113 : Proper PATH setting
114 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
115 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
116 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
117 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
118 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
119 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /opt/ansic/bin /usr/ccs/bin"
120 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
121 paths="$paths /sbin /usr/sbin /usr/libexec"
122 paths="$paths /system/gnu_library/bin"
126 case "$p_$PATH$p_" in
128 *) test -d $p && PATH=$PATH$p_$p ;;
135 : shall we be using ksh?
141 if (PATH=.; alias -x) >/dev/null 2>&1; then
144 if test -f /hp-ux -a -f /bin/ksh; then
145 needksh='to avoid sh bug in "here document" expansion'
147 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
148 if test X`/usr/bin/uname -v` = X4; then
149 avoidksh="to avoid AIX 4's /bin/sh"
153 if test -f /osf_boot -a -f /usr/sbin/setld; then
154 if test X`/usr/bin/uname -s` = XOSF1; then
155 avoidksh="to avoid Digital UNIX' ksh"
160 case "$inksh/$needksh" in
167 case "$inksh/$avoidksh" in
173 case "$inksh/$needksh-$avoidksh-" in
176 (I see you are using the Korn shell. Some ksh's blow up on $me,
177 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
184 echo "(Feeding myself to $newsh $reason.)"
186 Configure|*/Configure) exec $newsh $0 "$@";;
187 *) exec $newsh Configure "$@";;
191 test -x "${newsh}" || unset newsh
193 : if needed, set CDPATH to a harmless value that is not chatty
194 : avoid bash 2.02 problems with empty CDPATH.
198 *bash*) CDPATH='.' ;;
204 : Configure runs within the UU subdirectory
205 test -d UU || mkdir UU
349 useversionedarchname=''
355 initialinstalllocation=''
387 d_attribute_deprecated=''
388 d_attribute_format=''
389 d_attribute_malloc=''
390 d_attribute_nonnull=''
391 d_attribute_noreturn=''
393 d_attribute_unused=''
394 d_attribute_warn_unused_result=''
395 d_printf_format_null=''
399 d_builtin_choose_expr=''
402 d_c99_variadic_macros=''
452 endhostent_r_proto=''
458 endprotoent_r_proto=''
464 endservent_r_proto=''
530 gethostbyaddr_r_proto=''
532 gethostbyname_r_proto=''
534 gethostent_r_proto=''
547 getnetbyaddr_r_proto=''
549 getnetbyname_r_proto=''
563 d_getprotobyname_r=''
564 getprotobyname_r_proto=''
565 d_getprotobynumber_r=''
566 getprotobynumber_r_proto=''
568 getprotoent_r_proto=''
580 getservbyname_r_proto=''
582 getservbyport_r_proto=''
584 getservent_r_proto=''
617 d_lc_monetary_2008=''
622 d_libm_lib_version=''
629 d_localtime_r_needs_tzset=''
649 d_malloc_good_size=''
697 d_old_pthread_create_joinable=''
698 old_pthread_create_joinable=''
700 d_pthread_attr_setscope=''
748 sethostent_r_proto=''
765 setprotoent_r_proto=''
777 setservent_r_proto=''
788 d_siginfo_si_errno=''
792 d_siginfo_si_status=''
794 d_siginfo_si_value=''
806 d_ipv6_mreq_source=''
823 d_sprintf_returns_strlen=''
836 perl_static_inline=''
841 d_stdio_ptr_lval_nochange_cnt=''
842 d_stdio_ptr_lval_sets_cnt=''
994 d_gdbm_ndbm_h_uses_prototypes=''
995 d_gdbmndbm_h_uses_prototypes=''
997 d_ndbm_h_uses_prototypes=''
1073 d_inc_version_list=''
1075 inc_version_list_init=''
1083 installusrbinperl=''
1099 ignore_versioned_solibs=''
1163 d_perl_otherlibdirs=''
1171 api_versionstring=''
1177 version_patchlevel_string=''
1181 d_nv_preserves_uv=''
1182 d_nv_zero_is_allbits_zero=''
1193 nv_overflows_integers_at=''
1194 nv_preserves_uv_bits=''
1267 installsitehtml1dir=''
1270 installsitehtml3dir=''
1277 installsiteman1dir=''
1280 installsiteman3dir=''
1285 installsitescript=''
1303 d_stdio_stream_array=''
1304 stdio_stream_array=''
1322 usekernprocpathname=''
1323 ccflags_uselargefiles=''
1324 ldflags_uselargefiles=''
1325 libswanted_uselargefiles=''
1334 usensgetexecutablepath=''
1348 installvendorarch=''
1355 installvendorhtml1dir=''
1357 vendorhtml1direxp=''
1358 installvendorhtml3dir=''
1360 vendorhtml3direxp=''
1366 installvendorman1dir=''
1369 installvendorman3dir=''
1376 installvendorscript=''
1387 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1390 : We must find out about Eunice early
1392 if test -f /etc/unixtovms; then
1393 eunicefix=/etc/unixtovms
1395 if test -f /etc/unixtovms.exe; then
1396 eunicefix=/etc/unixtovms.exe
1399 : Set executable suffix now -- needed before hints available
1400 if test -f "/libs/version.library"; then
1403 elif test -f "/system/gnu_library/bin/ar.pm"; then
1406 elif test -n "$DJGPP"; then
1409 elif test -f /kern/cookiejar; then
1412 elif test -d c:/. -o -n "$is_os2" ; then
1419 : Trailing extension. Override this in a hint file, if needed.
1420 : Extra object files, if any, needed on this platform.
1423 : Possible local include directories to search.
1424 : Set locincpth to "" in a hint file to defeat local include searches.
1425 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1426 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1428 : no include file wanted by default
1431 : Enable -DEBUGGING and -DDEBUGGING from the command line
1436 : change the next line if compiling for Xenix/286 on Xenix/386
1437 xlibpth='/usr/lib/386 /lib/386'
1438 : Possible local library directories to search.
1439 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1440 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1442 : general looking path for locating libraries
1443 glibpth="/lib /usr/lib $xlibpth"
1444 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1445 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1446 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1447 test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
1449 : Private path used by Configure to find libraries. Its value
1450 : is prepended to libpth. This variable takes care of special
1451 : machines, like the mips. Usually, it should be empty.
1454 : default library list
1456 : some systems want to use only the non-versioned libso:s
1457 ignore_versioned_solibs=''
1458 : set usethreads on the Configure command line to enable threads.
1459 usereentrant='undef'
1463 : set useposix=false in your hint file to disable the POSIX extension.
1465 : set useopcode=false in your hint file to disable the Opcode extension.
1468 ccflags_uselargefiles=''
1469 ldflags_uselargefiles=''
1470 libswanted_uselargefiles=''
1471 : set usemultiplicity on the Configure command line to enable multiplicity.
1472 : set usesocks on the Configure command line to enable socks.
1473 : List of libraries we want.
1474 : If anyone needs extra -lxxx, put those in a hint file.
1475 libswanted="cl pthread socket bind inet nsl ndbm gdbm dbm db malloc dl ld"
1476 libswanted="$libswanted sun m crypt sec util c cposix posix ucb bsd BSD"
1477 : We probably want to search /usr/shlib before most other libraries.
1478 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1479 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1480 glibpth="/usr/shlib $glibpth"
1481 : Do not use vfork unless overridden by a hint file.
1484 : Find the basic shell for Bourne shell scripts
1488 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1491 if test -f "$xxx"; then
1494 : Build up a list and do a single loop so we can 'break' out.
1495 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1496 for xxx in sh bash ksh pdksh ash; do
1498 try="$try ${p}/${xxx}"
1502 if test -f "$xxx"; then
1505 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1508 elif test -f "$xxx.exe"; then
1519 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1521 Usually it's in /bin/sh. How did you even get this far?
1522 Please contact me (Perl Maintainers) at perlbug@perl.org and
1523 we'll try to straighten this all out.
1529 : When cross-compiling we need to separate the sh-to-run-Configure-with from the sh-to-use-in-Perl
1530 : default both to the same thing, cross-compilers can then set targetsh differently if they like
1533 : see if sh knows # comments
1534 if `$sh -c '#' >/dev/null 2>&1`; then
1538 test -f $xcat$_exe || xcat=/usr/bin/cat
1539 if test ! -f $xcat$_exe; then
1540 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1541 if test -f $p/cat$_exe; then
1546 if test ! -f $xcat$_exe; then
1547 echo "Can't find cat anywhere!"
1551 echo "#!$xcat" >sharp
1554 ./sharp > today 2>/dev/null
1555 if test -s today; then
1558 echo "#! $xcat" > sharp
1561 ./sharp > today 2>/dev/null
1562 if test -s today; then
1570 echo "Your $sh doesn't grok # comments--I will strip them later on."
1573 echo "exec grep -v '^[ ]*#'" >spitshell
1575 $eunicefix spitshell
1576 spitshell=`pwd`/spitshell
1578 echo "I presume that if # doesn't work, #! won't work either!"
1583 : figure out how to guarantee sh startup
1585 '') startsh=${sharpbang}${sh} ;;
1597 : echo "Yup, it does."
1599 echo "Hmm... '$startsh' does not guarantee sh startup..."
1600 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1604 : Save command line options in file UU/cmdline.opt for later use in
1605 : generating config.sh.
1606 cat > cmdline.opt <<EOSH
1607 : Configure command line arguments.
1616 cat >>cmdline.opt <<EOSH
1617 config_arg$argn='$arg'
1619 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1622 arg_exp=`cat cmdl.opt`
1623 args_exp="$args_exp$args_sep'$arg_exp'"
1624 argn=`expr $argn + 1`
1629 : produce awk script to parse command line options
1630 cat >options.awk <<'EOF'
1632 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1634 len = length(optstr);
1635 for (i = 1; i <= len; i++) {
1636 c = substr(optstr, i, 1);
1637 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1648 if (substr(str, 1, 1) != "-") {
1649 printf("'%s'\n", str);
1653 for (i = 2; i <= len; i++) {
1654 c = substr(str, i, 1);
1656 printf("-%s\n", substr(str, i));
1662 printf("'%s'\n", substr(str, i + 1));
1675 : process the command line options
1676 set X `for arg in "$@"; do echo "X$arg"; done |
1677 sed -e s/X// | awk -f options.awk`
1682 : set up default values
1691 rm -f optdef.sh posthint.sh
1692 cat >optdef.sh <<EOS
1698 while test $# -gt 0; do
1700 -d) shift; fastread=yes;;
1701 -e) shift; alldone=cont;;
1705 if test -r "$1"; then
1708 echo "$me: cannot read config file $1." >&2
1714 -h) shift; error=true;;
1715 -r) shift; reuseval=true;;
1716 -s) shift; silent=true; realsilent=true;;
1717 -E) shift; alldone=exit;;
1718 -K) shift; knowitall=true;;
1720 -S) shift; silent=true; extractsh=true;;
1725 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1726 echo "$me: ignoring -D $1" >&2
1729 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1730 *) echo "$1='define'" >> optdef.sh;;
1737 *=) echo "$1" >> optdef.sh;;
1739 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1740 echo "$me: ignoring -U $1" >&2
1742 *) echo "$1='undef'" >> optdef.sh;;
1753 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1757 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1758 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1764 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1765 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1766 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1767 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1768 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1769 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1775 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1777 echo "$yyy=''" >> posthint.sh ;;
1782 echo "$yyy='$zzz'" >> posthint.sh ;;
1784 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1786 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1791 echo "$yyy=$zzz" >> posthint.sh ;;
1792 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1796 -V) echo "$me generated by metaconfig 3.5 PL0." >&2
1799 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1807 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1808 [-U symbol] [-U symbol=] [-A command:symbol...]
1809 -d : use defaults for all answers.
1810 -e : go on without questioning past the production of config.sh.
1811 -f : specify an alternate default configuration file.
1812 -h : print this help message and exit (with an error status).
1813 -r : reuse C symbols value if possible (skips costly nm extraction).
1814 -s : silent mode, only echoes questions and essential information.
1815 -D : define symbol to have some value:
1816 -D symbol symbol gets the value 'define'
1817 -D symbol=value symbol gets the value 'value'
1818 common used examples (see INSTALL for more info):
1819 -Duse64bitint use 64bit integers
1820 -Duse64bitall use 64bit integers and pointers
1821 -Dusethreads use thread support
1822 -Dinc_version_list=none do not include older perl trees in @INC
1823 -DEBUGGING=none DEBUGGING options
1824 -Dcc=gcc choose your compiler
1825 -Dprefix=/opt/perl5 choose your destination
1826 -E : stop at the end of questions, after having produced config.sh.
1827 -K : do not use unless you know what you are doing.
1828 -O : ignored for backward compatibility
1829 -S : perform variable substitutions on all .SH files (can mix with -f)
1830 -U : undefine symbol:
1831 -U symbol symbol gets the value 'undef'
1832 -U symbol= symbol gets completely empty
1834 -A : manipulate symbol after the platform specific hints have been applied:
1835 -A append:symbol=value append value to symbol
1836 -A symbol=value like append:, but with a separating space
1837 -A define:symbol=value define symbol to have value
1838 -A clear:symbol define symbol to be ''
1839 -A define:symbol define symbol to be 'define'
1840 -A eval:symbol=value define symbol to be eval of value
1841 -A prepend:symbol=value prepend value to symbol
1842 -A undef:symbol define symbol to be 'undef'
1843 -A undef:symbol= define symbol to be ''
1844 e.g.: -A prepend:libswanted='cl pthread '
1845 -A ccflags=-DSOME_MACRO
1846 -V : print version number and exit (with a zero status).
1853 case "$fastread$alldone" in
1856 case "$extractsh" in
1859 if test ! -t 0; then
1860 echo "Say 'sh Configure', not 'sh <Configure'"
1870 true) exec 1>/dev/null;;
1873 : run the defines and the undefines, if any, but leave the file out there...
1875 grep '\\' optdef.sh >/dev/null 2>&1
1876 if test $? = 0; then
1877 echo "Configure does not support \\ in -D arguments"
1881 : create the posthint manipulation script and leave the file out there...
1886 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1887 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1888 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`"-"`echo AbyZ | tr '[:upper:]' '[:lower:]' 2>/dev/null`" in
1889 ABYZ-abyz) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1890 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1893 : Some greps do not return status, grrr.
1894 echo "grimblepritz" >grimble
1895 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1897 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1903 : the following should work in any shell
1907 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1908 cat >contains <<'EOSS'
1909 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1914 : Find the path to the source tree
1917 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1921 *) src=`cd ../$src && pwd` ;;
1934 if test -f $rsrc/Configure && \
1935 $contains "^package='$package'\$" $rsrc/Configure >/dev/null 2>&1
1937 : found it, so we are ok.
1940 for src in . .. ../.. ../../.. ../../../..; do
1941 if test -f ../$src/Configure && \
1942 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1953 Sorry, I can't seem to locate the source dir for $package. Please start
1954 Configure with an explicit path -- i.e. /some/path/Configure.
1962 echo "Sources for $package found in \"$src\"." >&4
1966 : script used to extract .SH files with variable substitutions
1967 cat >extract <<'EOS'
1969 echo "Doing variable substitutions on .SH files..."
1970 if test -f MANIFEST; then
1971 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1973 echo "(Looking for .SH files under the source directory.)"
1974 set x `(cd "$src"; find . -name "*.SH" -print)`
1978 0) set x `(cd "$src"; echo *.SH)`; shift;;
1980 if test ! -f "$src/$1"; then
1986 while test $name; do
1987 if test ! -d "$name"; then
1988 create="$name $create";
1989 name=`echo $name | sed -e "s|^[^/]*$||"`;
1990 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1995 for file in $create; do
2004 dir=`expr X$file : 'X\(.*\)/'`
2005 file=`expr X$file : 'X.*/\(.*\)'`
2006 (cd "$dir" && . ./$file)
2016 dir=`expr X$file : 'X\(.*\)/'`
2017 file=`expr X$file : 'X.*/\(.*\)'`
2018 (set x $dir; shift; eval $mkdir_p)
2019 sh <"$src/$dir/$file"
2028 if test -f "$src/config_h.SH"; then
2029 if test ! -f config.h; then
2030 : oops, they left it out of MANIFEST, probably, so do it anyway.
2031 . "$src/config_h.SH"
2036 : extract files and exit if asked to do so
2037 case "$extractsh" in
2039 case "$realsilent" in
2043 case "$config_sh" in
2044 '') config_sh='config.sh';;
2047 echo "Fetching answers from $config_sh..."
2054 echo "Extraction done."
2059 : Eunice requires " " instead of "", can you believe it
2062 echo "Beginning of configuration questions for $package."
2064 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
2066 : first determine how to suppress newline on echo command
2068 echo "Checking echo to see how to suppress newlines..."
2069 (echo "hi there\c" ; echo " ") >.echotmp
2070 if $contains c .echotmp >/dev/null 2>&1 ; then
2081 echo $n "The star should be here-->$c"
2085 : Now test for existence of everything in MANIFEST
2087 if test -f "$rsrc/MANIFEST"; then
2088 echo "First let's make sure your kit is complete. Checking..." >&4
2089 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | \
2090 (split -l 50 2>/dev/null || split -50)
2093 for filelist in x??; do
2094 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` \
2095 >/dev/null 2>>"$tmppwd/missing")
2097 if test -s missing; then
2101 THIS PACKAGE SEEMS TO BE INCOMPLETE.
2103 You have the option of continuing the configuration process, despite the
2104 distinct possibility that your kit is damaged, by typing 'y'es. If you
2105 do, don't blame me if something goes wrong. I advise you to type 'n'o
2106 and contact the author (perlbug@perl.org).
2109 echo $n "Continue? [n] $c" >&4
2113 echo "Continuing..." >&4
2117 echo "ABORTING..." >&4
2122 echo "Looks good..."
2125 echo "There is no MANIFEST file. I hope your kit is complete !"
2129 : Find the appropriate value for a newline for tr
2131 if test -n "$DJGPP"; then
2134 if test X"$trnl" = X; then
2135 case "`echo foo|tr '\n' x 2>/dev/null`" in
2139 if test X"$trnl" = X; then
2140 case "`echo foo|tr '\012' x 2>/dev/null`" in
2141 foox) trnl='\012' ;;
2144 if test X"$trnl" = X; then
2145 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
2146 fooxy) trnl='\n\r' ;;
2149 if test X"$trnl" = X; then
2152 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
2158 : compute the number of columns on the terminal for proper question formatting
2163 : set up the echo used in my read
2164 myecho="case \"\$xxxm\" in
2165 '') echo $n \"\$rp $c\" >&4;;
2167 '') echo $n \"[\$xxxm] $c\";;
2169 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
2171 echo $n \"[\$xxxm] $c\" >&4
2173 echo $n \"\$rp [\$xxxm] $c\" >&4
2179 : now set up to do reads with possible shell escape and default assignment
2185 case "\$fastread" in
2186 yes) case "\$dflt" in
2189 case "\$silent-\$rp" in
2194 *) case "\$silent" in
2195 true) case "\$rp" in
2200 while expr "X\$ans" : "X!" >/dev/null; do
2204 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2212 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2221 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2226 echo "(OK, I'll run with -d after this question.)" >&4
2229 echo "*** Sorry, \$1 not supported yet." >&4
2239 echo "*** Substitution done -- please confirm."
2241 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2246 echo "*** Error -- try again."
2253 case "\$ans\$xxxm\$nostick" in
2265 : create .config dir to save info across Configure sessions
2266 test -d ../.config || mkdir ../.config
2267 cat >../.config/README <<EOF
2268 This directory created by Configure to save information that should
2269 persist across sessions for $package.
2271 You may safely delete it if you wish.
2274 : See if we are using a devel version and want that
2275 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2278 usedevel="$define" ;;
2279 *) case "$xversion" in
2282 *** WHOA THERE!!! ***
2284 This is an UNSTABLE DEVELOPMENT release.
2285 The version of this $package distribution is $xversion, that is, odd,
2286 (as opposed to even) and that signifies a development release.
2287 If you want a maintenance release, you want an even-numbered version.
2289 Do ***NOT*** install this into production use.
2290 Data corruption and crashes are possible.
2292 It is most seriously suggested that you do not continue any further
2293 unless you want to help in developing and debugging Perl.
2295 If you *still* want to build perl, you can answer 'y' now,
2296 or pass -Dusedevel to Configure.
2299 rp='Do you really want to continue?'
2303 [yY]) echo >&4 "Okay, continuing."
2304 usedevel="$define" ;;
2305 *) echo >&4 "Okay, bye."
2316 case "$versiononly" in
2317 '') versiononly="$define" ;;
2319 case "$installusrbinperl" in
2320 '') installusrbinperl="$undef" ;;
2325 : general instructions
2328 user=`(logname) 2>/dev/null`
2330 '') user=`whoami 2>&1`;;
2332 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2335 rp='Would you like to see the instructions?'
2346 This installation shell script will examine your system and ask you questions
2347 to determine how the perl5 package should be installed. If you get
2348 stuck on a question, you may use a ! shell escape to start a subshell or
2349 execute a command. Many of the questions will have default answers in square
2350 brackets; typing carriage return will give you the default.
2352 On some of the questions which ask for file or directory names you are allowed
2353 to use the ~name construct to specify the login directory belonging to "name",
2354 even if you don't have a shell which knows about that. Questions where this is
2355 allowed will be marked "(~name ok)".
2359 dflt='Type carriage return to continue'
2363 The prompter used in this script allows you to use shell variables and
2364 backticks in your answers. You may use $1, $2, etc... to refer to the words
2365 in the default answer, as if the default line was a set of arguments given to a
2366 script shell. This means you may also use $* to repeat the whole default line,
2367 so you do not have to re-type everything to add something to the default.
2369 Every time there is a substitution, you will have to confirm. If there is an
2370 error (e.g. an unmatched backtick), the default answer will remain unchanged
2371 and you will be prompted again.
2373 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2374 the questions and use the computed defaults (or the previous answers if there
2375 was already a config.sh file). Type 'Configure -h' for a list of options.
2376 You may also start interactively and then answer '& -d' at any prompt to turn
2377 on the non-interactive behaviour for the remainder of the execution.
2383 Much effort has been expended to ensure that this shell script will run on any
2384 Unix system. If despite that it blows up on yours, your best bet is to edit
2385 Configure and run it again. If you can't run Configure for some reason,
2386 you'll have to generate a config.sh file by hand. Whatever problems you
2387 have, let me (perlbug@perl.org) know how I blew it.
2389 This installation script affects things in two ways:
2391 1) it may do direct variable substitutions on some of the files included
2393 2) it builds a config.h file for inclusion in C programs. You may edit
2394 any of these files as the need arises after running this script.
2396 If you make a mistake on a question, there is no easy way to back up to it
2397 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2398 files. Configure will offer to let you do this before it runs the SH files.
2401 dflt='Type carriage return to continue'
2403 case "$firsttime" in
2404 true) echo $user >>../.config/instruct;;
2408 : Set 'sysroot' to change the logical root directory to your headers and libraries see man gcc
2409 : This is primarily meant for cross-compile environments, and may fail to be useful in other cases
2410 if test "X$sysroot" = X; then
2415 echo "Using $sysroot to find your headers and libraries, adding to ccflags"
2416 # _sysroot is used in places where we need --sysroot=foo
2417 # but using the rest of the flags could cause issues.
2418 _sysroot="--sysroot=$sysroot";
2422 ccflags="$ccflags $_sysroot"
2427 ldflags="$ldflags $_sysroot"
2432 cppflags="$cppflags $_sysroot"
2434 # lddlflags updated below in lddlflags section;
2435 # same with cccdlflags
2439 # Adjust some defaults to also use $sysroot
2440 for var in xlibpth loclibpth locincpth glibpth; do
2443 for path in $xxx; do
2444 eval $var=\"\$$var $sysroot$path\"
2450 : find out where common programs are
2452 echo "Locating common programs..." >&4
2465 if test -d \$dir/\$thing; then
2471 for thisthing in \$dir/\$thing; do
2472 : just loop through to pick last item
2474 if test -f \$thisthing; then
2477 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2480 elif test -f \$dir/\$thing.exe; then
2481 if test -n "$DJGPP"; then
2482 echo \$dir/\$thing.exe
2483 elif test "$eunicefix" != ":"; then
2484 : on Eunice apparently
2537 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2538 pth="$pth $sysroot/lib $sysroot/usr/lib"
2539 for file in $loclist; do
2543 if test -f "$xxx"; then
2546 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2547 xxx=`./loc $file $file $pth`
2550 '') xxx=`./loc $file $file $pth`;;
2551 *) xxx=`./loc $xxx $xxx $pth`;;
2553 eval $file=$xxx$_exe
2557 echo $file is in $xxx.
2560 echo $file is in $xxx.
2563 echo "I don't know where '$file' is, and my life depends on it." >&4
2564 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2570 echo "Don't worry if any of the following aren't found..."
2572 for file in $trylist; do
2576 if test -f "$xxx"; then
2579 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2580 xxx=`./loc $file $file $pth`
2583 '') xxx=`./loc $file $file $pth`;;
2584 *) xxx=`./loc $xxx $xxx $pth`;;
2586 eval $file=$xxx$_exe
2590 echo $file is in $xxx.
2593 echo $file is in $xxx.
2596 echo "I don't see $file out there, $say."
2603 echo "Substituting grep for egrep."
2610 *) if $less -R </dev/null >/dev/null 2>&1; then
2611 echo "Substituting less -R for less."
2619 echo "Substituting cp for ln."
2628 echo "I can't find make or gmake, and my life depends on it." >&4
2629 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2637 *) # We can't have osname yet.
2638 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2639 # Assume that gmake, if found, is definitely GNU make
2640 # and prefer it over the system make.
2641 echo "Substituting gmake for make."
2649 echo "Hopefully test is built into your sh."
2652 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2653 echo "Using the test built into your sh."
2661 echo "Hopefully echo is built into your sh."
2666 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2667 $echo $n "hi there$c" >foo1
2668 echo $n "hi there$c" >foo2
2669 if cmp foo1 foo2 >/dev/null 2>&1; then
2670 echo "They are compatible. In fact, they may be identical."
2677 They are not compatible! You are probably running ksh on a non-USG system.
2678 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2679 have echo built in and we may have to run some Bourne shell scripts. That
2680 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2683 $echo $n "The star should be here-->$c"
2690 # This question was auctioned at YAPC::Europe-2007 in Vienna
2691 # I never promised you could answer it. I only auctioned the question.
2693 The following message is sponsored by
2695 Dresden.pm<--The stars should be here.
2697 Dear Perl user, system administrator or package
2698 maintainer, the Perl community sends greetings to
2699 you. Do you (emblematical) greet back [Y/n]? n
2703 : Check what type of C compiler we use
2707 cat <<'EOSC' >>trygcc
2712 int main(int argc, char *argv[]) {
2716 if $cc -o try $ccflags $ldflags try.c; then
2719 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2725 # Skip this test because it gives a false match on output like:
2726 # ./trygcc: line 23: cc: command not found
2727 # case "`$cc -v -c try.c 2>&1`" in
2728 # *gcc*) trygcc=no ;;
2730 if $test X"$trygcc" = Xyes; then
2731 if gcc -o try -c try.c; then
2733 echo "You seem to have a working gcc, though." >&4
2734 # Switching compilers may undo the work of hints files.
2735 # The most common problem is -D_REENTRANT for threads.
2736 # This heuristic catches that case, but gets false positives
2737 # if -Dusethreads was not actually specified. Better to
2738 # bail out here with a useful message than fail
2739 # mysteriously later. Should we perhaps just try to
2740 # re-invoke Configure -Dcc=gcc config_args ?
2741 if $test -f usethreads.cbu; then
2744 *** However, any setting of the C compiler flags (e.g. for thread support)
2745 *** will be lost. It may be necessary for you to restart Configure and
2746 *** add -Dcc=gcc to your Configure command line.
2749 rp="Would you like to go ahead and try gcc anyway?"
2752 rp="Would you like to use it?"
2755 if $test -f myread; then
2758 if $test -f UU/myread; then
2761 echo "Cannot find myread, sorry. Aborting." >&2
2766 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2779 cat <<'EOSC' >>checkcc
2784 int main(int argc, char *argv[]) {
2788 if $cc -o try $ccflags $ldflags try.c; then
2791 if $test X"$despair" = Xyes; then
2792 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2795 You need to find a working C compiler.
2796 Either (purchase and) install the C compiler supplied by your OS vendor,
2797 or for a free C compiler try http://gcc.gnu.org/
2798 I cannot continue any further, aborting.
2807 : determine whether symbolic links are supported
2810 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2811 echo "Symbolic links are supported." >&4
2814 echo "Symbolic links are NOT supported." >&4
2819 : determine whether symbolic links are supported
2823 echo "Checking how to test for symbolic links..." >&4
2825 if $test "X$issymlink" = X; then
2827 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2828 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2830 if test $? = 0; then
2833 echo "Your builtin 'test -h' may be broken." >&4
2836 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2839 if test -f "$p/$test"; then
2848 echo "Trying external '$test -h'." >&4
2849 issymlink="$test -h"
2850 if $test ! -h sym >/dev/null 2>&1; then
2851 echo "External '$test -h' is broken, too." >&4
2859 if $test "X$issymlink" = X; then
2860 if $test -L sym 2>/dev/null; then
2861 issymlink="$test -L"
2862 echo "The builtin '$test -L' worked." >&4
2865 if $test "X$issymlink" != X; then
2866 echo "You can test for symbolic links with '$issymlink'." >&4
2868 echo "I do not know how you can test for symbolic links." >&4
2872 *) echo "No symbolic links, so not testing for their testing..." >&4
2877 : Make symlinks util
2878 case "$mksymlinks" in
2881 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2884 *) case "$lns:$issymlink" in
2885 *"ln"*" -s:"*"test -"?)
2886 echo "Creating the symbolic links..." >&4
2888 awk '{print $1}' $src/MANIFEST | sed -e 's:/\([^/]*\)$: \1:' |
2898 print "# dir = ", dir, "file = ", file
2899 mf[dir] = mf[dir]" "source"/"dir"/"file;
2902 if (d != ".") { print("mkdir -p "d) }
2903 print("ln -sf "mf[d]" "d);
2905 }' source="$src" > UU/mksymlinks.$$
2909 if test ! -d t/base; then
2910 echo "Failed to create the subdirectories. Aborting." >&4
2914 if test ! -f t/base/lex.t; then
2915 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2918 if test ! -f win32/win32.c; then
2919 echo "Failed to create the symlinks (win32/win32.c missing). Aborting." >&4
2924 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2932 : Check for Cross-Compilation
2933 if $test "X$targethost" = "X"; then
2936 if $test "X$targetenv" = "X"; then
2939 case "$usecrosscompile" in
2941 $echo "Cross-compiling..."
2944 *-gcc*|*-g++*) # A cross-compiling gcc, probably.
2945 # arm-linux-androideabi-gcc -> arm-linux-androideabi
2946 # x86_64-w64-mingw32-gcc.exe -> x86_64-w64-mingw32
2947 targetarch=`$echo $cc|$sed 's/-g[c\+][c\+].*$//'`
2948 ar=`$echo $cc|$sed 's/-g[c\+][c\+]/-ar/'`
2949 # leave out ld, choosing it is more complex
2950 nm=`$echo $cc|$sed 's/-g[c\+][c\+]/-nm/'`
2951 ranlib=`$echo $cc|$sed 's/-g[c\+][c\+]/-ranlib/'`
2952 # We are in a weird spot. Just before us, some values
2953 # were 'saved', to be restored after the hints are
2954 # run. This means that the changes we made to ar,
2955 # nm and ranlib will get reverted.
2956 # To avoid that, we hijack the saving mechanism and
2957 # have it save our new values.
2958 for file in ar nm ranlib; do
2960 eval $file=$xxx$_exe
2965 case "$targetarch" in
2966 '') echo "Targetarch not defined." >&4; croak=y ;;
2967 *) echo "Using targetarch $targetarch." >&4 ;;
2969 case "$targethost" in
2970 '') echo "Targethost not defined." >&4; croak=y ;;
2971 *) echo "Using targethost $targethost." >&4
2976 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2978 : compile a host miniperl and generate_uudmap, unless we got passed them
2979 if $test "X$hostperl" = X; then
2980 echo "Building host miniperl and generate_uudmap binaries" >&4
2988 $src/Configure -des -Dusedevel -Dmksymlinks
2990 case "$hostgenerate" in
2991 '') $make generate_uudmap
2992 hostgenerate=$src/host/generate_uudmap
2994 "$undef") hostgenerate=''
2997 hostperl=$src/host/miniperl
3000 hostosname=`$hostperl -le 'print $^O'`
3003 usecrosscompile="$undef"
3007 : Define -Dtargethost=somecomputer to run compiled tests on another machine
3008 case "$targethost" in
3009 '') echo "Checking for cross-compile" >&4
3010 case "$usecrosscompile$multiarch" in
3011 *$define*) echo "Skipping the try tests in the rest of Configure as no targethost was defined when cross-compiling" >&4
3012 if [ -f Makefile ]; then
3014 echo "Now you must ensure config.sh, config.h and the generated headers exist and run a $make."
3016 echo "Configure done."
3020 *) echo "No targethost for running compiler tests against defined, running locally" >&4
3027 *) echo "Using targethost $targethost." >&4
3029 /*) run=$src/Cross/run
3030 targetmkdir=$src/Cross/mkdir
3032 from=$src/Cross/from
3034 *) pwd=`$test -f ../Configure & cd ..; pwd`
3036 targetmkdir=$pwd/Cross/mkdir
3038 from=$pwd/Cross/from
3041 case "$targetrun" in
3042 '') targetrun=ssh ;;
3047 case "$targetfrom" in
3048 '') targetfrom=scp ;;
3052 from=$from-$targetfrom
3053 case "$targetdir" in
3055 echo "Guessing targetdir $targetdir." >&4
3058 case "$targetuser" in
3060 echo "Guessing targetuser $targetuser." >&4
3063 case "$targetport" in
3065 echo "Guessing targetport $targetport." >&4
3068 case "$targetfrom" in
3072 case "$targetrun" in
3092 '') cwd=$targetdir ;;
3097 $targetrun -p $targetport -l $targetuser $targethost "cd \$cwd && \$env \$exe \$@"
3103 *) echo "Unknown targetrun '$targetrun'" >&4
3107 case "$targetmkdir" in
3109 cat >$targetmkdir <<EOF
3111 $targetrun -p $targetport -l $targetuser $targethost "mkdir -p \$@"
3113 $chmod a+rx $targetmkdir
3115 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
3127 $targetmkdir \`dirname \$f\`
3128 $targetto -P $targetport -r $q \$f $targetuser@$targethost:\$f 2>/dev/null || exit 1
3131 $targetmkdir $targetdir/\`dirname \$f\`
3132 $targetto -P $targetport -r $q \$f $targetuser@$targethost:$targetdir/\$f 2>/dev/null || exit 1
3145 $mkdir -p $targetdir/\`dirname \$f\`
3146 $cp \$f $targetdir/\$f || exit 1
3149 $targetmkdir $targetdir/\`dirname \$f\`
3150 $cp \$f $targetdir/\$f || exit 1
3157 *) echo "Unknown targetto '$targetto'" >&4
3161 case "$targetfrom" in
3168 $targetfrom -P $targetport $q $targetuser@$targethost:$targetdir/\$f . || exit 1
3173 cp) cat >$from <<EOF
3178 cp $targetdir/\$f . || exit 1
3183 *) echo "Unknown targetfrom '$targetfrom'" >&4
3187 if $test ! -f $run; then
3188 echo "Target 'run' script '$run' not found." >&4
3192 if $test ! -f $to; then
3193 echo "Target 'to' script '$to' not found." >&4
3197 if $test ! -f $from; then
3198 echo "Target 'from' script '$from' not found." >&4
3202 if $test ! -f $run -o ! -f $to -o ! -f $from; then
3206 Using '$run' for remote execution,
3207 and '$from' and '$to'
3208 for remote file transfer.
3214 usecrosscompile="$undef"
3219 : see whether [:lower:] and [:upper:] are supported character classes
3221 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`"-"`echo AbyZ | $tr '[:upper:]' '[:lower:]' 2>/dev/null`" in
3223 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
3227 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
3228 # (0xd9 and 0xe2), therefore that is a nice testing point.
3229 if test "X$up" = X -o "X$low" = X; then
3230 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
3236 if test "X$up" = X -o "X$low" = X; then
3237 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
3243 if test "X$up" = X -o "X$low" = X; then
3244 case "`echo RS | od -x 2>/dev/null`" in
3246 echo "Hey, this might be EBCDIC." >&4
3247 if test "X$up" = X -o "X$low" = X; then
3248 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
3249 rs) up='[A-IJ-RS-Z]'
3254 if test "X$up" = X -o "X$low" = X; then
3255 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
3265 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
3267 echo "Using $up and $low to convert case." >&4
3270 echo "I don't know how to translate letters from upper to lower case." >&4
3271 echo "Your tr is not acting any way I know of." >&4
3275 : set up the translation script tr, must be called with ./tr of course
3279 '[A-Z][a-z]') exec $tr '$up' '$low';;
3280 '[a-z][A-Z]') exec $tr '$low' '$up';;
3287 : Try to determine whether config.sh was made on this system
3288 case "$config_sh" in
3290 myuname=`$uname -a 2>/dev/null`
3291 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
3292 # Downcase everything to avoid ambiguity.
3293 # Remove slashes and single quotes so we can use parts of this in
3294 # directory and file names.
3295 # Remove newlines so myuname is sane to use elsewhere.
3296 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
3297 # because the A-Z/a-z are not consecutive.
3298 myuname=`echo $myuname | $sed -e "s,['/],,g" | \
3299 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
3300 newmyuname="$myuname"
3302 case "$knowitall" in
3304 if test -f ../config.sh; then
3305 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3306 eval "`grep myuname= ../config.sh`"
3308 if test "X$myuname" = "X$newmyuname"; then
3316 : Get old answers from old config file if Configure was run on the
3317 : same system, otherwise use the hints.
3320 if test -f config.sh; then
3322 rp="I see a config.sh file. Shall I use it to set the defaults?"
3325 n*|N*) echo "OK, I'll ignore it."
3326 mv config.sh config.sh.old
3327 myuname="$newmyuname"
3329 *) echo "Fetching default answers from your old config.sh file..." >&4
3337 : Older versions did not always set $sh. Catch re-use of such
3347 if test ! -f config.sh; then
3350 First time through, eh? I have some defaults handy for some systems
3351 that need some extra help getting the Configure answers right:
3354 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3356 : Half the following guesses are probably wrong... If you have better
3357 : tests or hints, please send them to perlbug@perl.org
3358 : The metaconfig authors would also appreciate a copy...
3359 $test -f /irix && osname=irix
3360 $test -f /xenix && osname=sco_xenix
3361 $test -f /dynix && osname=dynix
3362 $test -f /dnix && osname=dnix
3363 $test -f /lynx.os && osname=lynxos
3364 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3365 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3366 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3367 $test -f /bin/mips && /bin/mips && osname=mips
3368 $test -d /usr/apollo/bin && osname=apollo
3369 $test -f /etc/saf/_sactab && osname=svr4
3370 $test -d /usr/include/minix && osname=minix && osvers=`$uname -r`
3371 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3372 $test -f /sys/utilities/MultiView && osname=amigaos
3373 if $test -d /MachTen -o -d /MachTen_Folder; then
3375 if $test -x /sbin/version; then
3376 osvers=`/sbin/version | $awk '{print $2}' |
3377 $sed -e 's/[A-Za-z]$//'`
3378 elif $test -x /usr/etc/version; then
3379 osvers=`/usr/etc/version | $awk '{print $2}' |
3380 $sed -e 's/[A-Za-z]$//'`
3386 $test -f /sys/posix.dll &&
3387 $test -f /usr/bin/what &&
3388 set X `/usr/bin/what /sys/posix.dll` &&
3389 $test "$3" = UWIN &&
3393 if $test -f $uname; then
3401 umips) osname=umips ;;
3404 [23]100) osname=mips ;;
3406 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3407 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3410 elif $test -f /etc/kconfig; then
3412 if test "$lns" = "$ln -s"; then
3414 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3416 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3423 if test -n "$DJGPP"; then
3432 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3434 # oslevel can fail with:
3435 # oslevel: Unable to acquire lock.
3436 *not\ found) osvers="$4"."$3" ;;
3437 '<3240'|'<>3240') osvers=3.2.0 ;;
3438 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3439 '=3250'|'>3250') osvers=3.2.5 ;;
3443 bitrig) osname=bitrig
3446 bsd386) osname=bsd386
3449 cygwin*) osname=cygwin
3452 *dc.osx) osname=dcosx
3458 domainos) osname=apollo
3464 dragonfly) osname=dragonfly
3467 dynixptx*) osname=dynixptx
3468 osvers=`echo "$4"|sed 's/^v//'`
3470 freebsd) osname=freebsd
3472 genix) osname=genix ;;
3476 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3489 $test -f /system/lib/libandroid.so && osname=linux-android
3493 netbsd*) osname=netbsd
3496 news-os) osvers="$3"
3498 4*) osname=newsos4 ;;
3502 nonstop-ux) osname=nonstopux ;;
3503 openbsd) osname=openbsd
3509 POSIX-BC | posix-bc ) osname=posix-bc
3512 powerux | power_ux | powermax_os | powermaxos | \
3513 powerunix | power_unix) osname=powerux
3519 solaris) osname=solaris
3521 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3528 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3532 titanos) osname=titanos
3541 ultrix) osname=ultrix
3544 osf1|mls+) case "$5" in
3547 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3550 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3553 hp*) osname=hp_osf1 ;;
3554 mips) osname=mips_osf1 ;;
3557 # UnixWare 7.1.2 is known as Open UNIX 8
3558 openunix|unixware) osname=svr5
3566 $2) case "$osname" in
3570 : svr4.x or possibly later
3580 if test -f /stand/boot ; then
3581 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3582 if test -n "$INITPROG" -a -f "$INITPROG"; then
3583 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3584 if test -n "$isesix"; then
3592 *) if test -f /etc/systemid; then
3594 set `echo $3 | $sed 's/\./ /g'` $4
3595 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3597 elif $test -f $src/hints/sco_$1_$2.sh; then
3599 elif $test -f $src/hints/sco_$1.sh; then
3604 '') : Still unknown. Probably a generic Sys V.
3613 *) case "$osname" in
3614 '') : Still unknown. Probably a generic BSD.
3622 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3623 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3624 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3627 $rm -f UU/kernel.what
3628 elif test -d c:/. -o -n "$is_os2" ; then
3635 case "$targetarch" in
3638 case "$targetarch" in
3640 # Will load qnx.sh, which should change osname to nto
3645 # Catch arm-linux-androideabi, mipsel-linux-android,
3646 # and i686-linux-android
3647 osname=linux-android
3651 # Something like arm-linux-gnueabihf is really just
3658 # XXX perhaps we should just assume
3659 # osvers to be 2, or maybe take the value
3660 # from targetarch. Using $run before the
3661 # hints are run is somewhat icky.
3662 set X `$run $uname -a 2>/dev/null`
3665 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3670 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3677 : Now look for a hint file osname_osvers, unless one has been
3678 : specified already.
3681 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3682 : Also try without trailing minor version numbers.
3683 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3684 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3685 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3686 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3689 *) case "$osvers" in
3692 *) if $test -f $src/hints/$file.sh ; then
3694 elif $test -f $src/hints/$xfile.sh ; then
3696 elif $test -f $src/hints/$xxfile.sh ; then
3698 elif $test -f $src/hints/$xxxfile.sh ; then
3700 elif $test -f $src/hints/$xxxxfile.sh ; then
3702 elif $test -f "$src/hints/${osname}.sh" ; then
3711 if $test -f Policy.sh ; then
3714 none) dflt="Policy" ;;
3715 *) dflt="Policy $dflt" ;;
3720 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3724 if $test -f Policy.sh ; then
3727 There's also a Policy hint file available, which should make the
3728 site-specific (policy) questions easier to answer.
3735 You may give one or more space-separated answers, or "none" if appropriate.
3736 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3737 previous run of Configure, you may specify it as well as or instead of
3738 OS-specific hints. If hints are provided for your OS, you should use them:
3739 although Perl can probably be built without hints on many platforms, using
3740 hints often improve performance and may enable features that Configure can't
3741 set up on its own. If there are no hints that match your OS, specify "none";
3742 DO NOT give a wrong version or a wrong OS.
3746 rp="Which of these apply, if any?"
3749 for file in $tans; do
3750 if $test X$file = XPolicy -a -f Policy.sh; then
3752 $cat Policy.sh >> UU/config.sh
3753 elif $test -f $src/hints/$file.sh; then
3754 . $src/hints/$file.sh
3755 $cat $src/hints/$file.sh >> UU/config.sh
3756 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3759 : Give one chance to correct a possible typo.
3760 echo "$file.sh does not exist"
3762 rp="hint to use instead?"
3764 for file in $ans; do
3765 if $test -f "$src/hints/$file.sh"; then
3766 . $src/hints/$file.sh
3767 $cat $src/hints/$file.sh >> UU/config.sh
3768 elif $test X$ans = X -o X$ans = Xnone ; then
3771 echo "$file.sh does not exist -- ignored."
3778 : Remember our hint file for later.
3779 if $test -f "$src/hints/$file.sh" ; then
3789 echo "Fetching default answers from $config_sh..." >&4
3793 cp $config_sh config.sh 2>/dev/null
3805 : Restore computed paths
3806 for file in $loclist $trylist; do
3807 eval $file="\$_$file"
3812 Configure uses the operating system name and version to set some defaults.
3813 The default value is probably right if the name rings a bell. Otherwise,
3814 since spelling matters for me, either accept the default or answer "none"
3821 ''|' '|none) dflt=none ;;
3822 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3825 *) dflt="$osname" ;;
3827 rp="Operating system name?"
3831 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3837 ''|' '|none) dflt=none ;;
3838 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3839 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3841 ''|' ') dflt=none ;;
3846 *) dflt="$osvers" ;;
3848 rp="Operating system version?"
3858 : who configured the system
3859 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3862 cf_by=`(logname) 2>/dev/null`
3865 cf_by=`(whoami) 2>/dev/null`
3867 "") cf_by=unknown ;;
3872 : decide how portable to be. Allow command line overrides.
3873 case "$d_portable" in
3875 *) d_portable="$define" ;;
3878 : set up shell script to do ~ expansion
3884 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3887 if $test -f /bin/csh; then
3888 /bin/csh -f -c "glob \$1"
3893 name=\`$expr x\$1 : '..\([^/]*\)'\`
3894 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3895 if $test ! -d "\$dir"; then
3897 echo "\$me: can't locate home directory for: \$name" >&2
3902 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3918 : now set up to get a file name
3922 cat <<'EOSC' >>getfile
3938 : getfile will accept an answer from the comma-separated list
3939 : enclosed in parentheses even if it does not meet other criteria.
3940 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3941 fn=`echo $fn | sed 's/(.*)//'`
3947 loc_file=`expr $fn : '.*:\(.*\)'`
3948 fn=`expr $fn : '\(.*\):.*'`
3956 */*) fullpath=true;;
3965 *e*) exp_file=true;;
3968 *p*) nopath_ok=true;;
3973 *d*) type='Directory';;
3974 *l*) type='Locate';;
3979 Locate) what='File';;
3984 case "$d_portable" in
3992 while test "$type"; do
3997 true) rp="$rp (~name ok)";;
4000 if test -f UU/getfile.ok && \
4001 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
4020 value=`UU/filexp $ans`
4023 if test "$ans" != "$value"; then
4024 echo "(That expands to $value on this system.)"
4038 /*) value="$ansexp" ;;
4039 [a-zA-Z]:/*) value="$ansexp" ;;
4044 echo "I shall only accept a full path name, as in /bin/ls." >&4
4045 echo "Use a ! shell escape if you wish to check pathnames." >&4
4048 echo "Please give a full path name, starting with slash." >&4
4051 echo "Note that using ~name is ok provided it expands well." >&4
4064 for fp in $gfpth; do
4065 if test "X$fp" = X.; then
4070 if test -f "$pf"; then
4072 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
4074 echo "($value is not a plain file, but that's ok.)"
4077 if test X"$type" = X; then
4084 for fp in $gfpth; do
4085 if test "X$fp" = X.; then
4090 direxp="$fp/$ansexp"
4092 if test -d "$direxp"; then
4100 if test -d "$ansexp"; then
4101 echo "(Looking for $loc_file in directory $value.)"
4102 value="$value/$loc_file"
4103 ansexp="$ansexp/$loc_file"
4105 if test -f "$ansexp"; then
4108 case "$nopath_ok" in
4109 true) case "$value" in
4111 *) echo "Assuming $value will be in people's path."
4127 if test "$fastread" = yes; then
4132 rp="$what $value doesn't exist. Use that name anyway?"
4151 test "X$gfpthkeep" != Xy && gfpth=""
4154 : determine root of directory hierarchy where package will be installed.
4157 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
4160 dflt=`echo "$prefix" | sed 's/.$//'`
4168 By default, $package will be installed in $dflt/bin, manual pages
4169 under $dflt/man, etc..., i.e. with $dflt as prefix for all
4170 installation directories. Typically this is something like /usr/local.
4171 If you wish to have binaries under /usr/bin but other parts of the
4172 installation under /usr/local, that's ok: you will be prompted
4173 separately for each of the installation directories, the prefix being
4174 only used to set the defaults.
4178 rp='Installation prefix to use?'
4186 *) oldprefix="$prefix";;
4193 : allow them to override the AFS root
4196 *) afsroot=$afsroot ;;
4202 $define|true) afs=true ;;
4203 $undef|false) afs=false ;;
4204 *) if $test -d $afsroot; then
4212 echo "AFS may be running... I'll be extra cautious then..." >&4
4214 echo "AFS does not seem to be running..." >&4
4217 : determine installation prefix for where package is to be installed.
4221 Since you are running AFS, I need to distinguish the directory in which
4222 files will reside from the directory in which they are installed (and from
4223 which they are presumably copied to the former directory by occult means).
4226 case "$installprefix" in
4227 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
4228 *) dflt="$installprefix";;
4233 In some special cases, particularly when building $package for distribution,
4234 it is convenient to distinguish the directory in which files should be
4235 installed from the directory ($prefix) in which they will
4236 eventually reside. For most users, these two directories are the same.
4239 case "$installprefix" in
4241 *) dflt=$installprefix;;
4245 rp='What installation prefix should I use for installing files?'
4247 installprefix="$ans"
4248 installprefixexp="$ansexp"
4250 : Perform the prefixexp/installprefixexp correction if necessary
4251 cat <<EOS >installprefix
4254 cat <<'EOSC' >>installprefix
4255 : Change installation prefix, if necessary.
4256 if $test X"$prefix" != X"$installprefix"; then
4257 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
4259 eval "install${prefixvar}=\"\$${prefixvar}exp\""
4262 chmod +x installprefix
4263 $eunicefix installprefix
4265 : Set variables such as privlib and privlibexp from the output of ./getfile
4266 : performing the prefixexp/installprefixexp correction if necessary.
4267 cat <<EOS >setprefixvar
4270 cat <<'EOSC' >>setprefixvar
4271 eval "${prefixvar}=\"\$ans\""
4272 eval "${prefixvar}exp=\"\$ansexp\""
4275 chmod +x setprefixvar
4276 $eunicefix setprefixvar
4278 : set up the script used to warn in case of inconsistency
4287 '') echo "The $hint value for \$$var on this machine was \"$was\"!" >&4
4289 *) echo "Hmm. Based on the hints in hints/$hintfile.sh, " >&4
4290 echo "the $hint value for \$$var on this machine was \"$was\"!" >&4
4295 echo "*** WHOA THERE!!! ***" >&4
4296 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
4299 rp=" Keep the $hint value?"
4302 y) td=$was; tu=$was;;
4306 : function used to set '$1' to '$val'
4307 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
4309 $define$undef) . ./whoa; eval "$var=\$td";;
4310 $undef$define) . ./whoa; eval "$var=\$tu";;
4311 *) eval "$var=$val";;
4314 : get the patchlevel
4316 echo "Getting the current patchlevel..." >&4
4317 if $test -r $rsrc/patchlevel.h;then
4318 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
4319 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4320 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4321 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4322 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4323 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4324 perl_patchlevel=`egrep ',"(MAINT|SMOKE)[0-9][0-9]*"' $rsrc/patchlevel.h|tail -1|sed 's/[^0-9]//g'`
4333 $echo "(You do not have patchlevel.h. Eek.)"
4335 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
4336 version_patchlevel_string="version $patchlevel subversion $subversion"
4337 case "$perl_patchlevel" in
4339 *) perl_patchlevel=`echo $perl_patchlevel | sed 's/.* //'`
4340 version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel"
4344 $echo "(You have $package $version_patchlevel_string.)"
4348 : XXX Should be a Configure test for double-dots in filenames.
4349 version=`echo $revision $patchlevel $subversion | \
4350 $awk '{ printf "%d_%d_%d", $1, $2, $3 }'`
4351 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4352 $awk '{ printf "%d_%d_%d", $1, $2, $3 }'`
4355 version=`echo $revision $patchlevel $subversion | \
4356 $awk '{ printf "%d.%d.%d", $1, $2, $3 }'`
4357 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4358 $awk '{ printf "%d.%d.%d", $1, $2, $3 }'`
4361 : Special case the 5.005_xx maintenance series, which used 5.005
4362 : without any subversion label as a subdirectory in $sitelib
4363 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4364 api_versionstring='5.005'
4367 : Do we want threads support and if so, what type
4368 case "$usethreads" in
4369 $define|true|[yY]*) dflt='y';;
4370 *) # Catch case where user specified ithreads or 5005threads but
4371 # forgot -Dusethreads (A.D. 4/2002)
4372 case "$useithreads$use5005threads" in
4373 *$define*) dflt='y';;
4380 Perl can be built to offer a form of threading support on some systems
4381 To do so, Configure can be run with -Dusethreads.
4383 Note that Perl built with threading support runs slightly slower
4384 and uses slightly more memory than plain Perl.
4386 If this doesn't make any sense to you, just accept the default '$dflt'.
4388 rp='Build a threading Perl?'
4391 y|Y) val="$define" ;;
4397 if $test $patchlevel -lt 9; then
4398 case "$usethreads" in
4400 : Default to ithreads unless overridden on command line or with
4403 case "$use5005threads" in
4405 echo "5.005 threads are no longer supported"
4409 case "$useithreads" in
4410 $undef|false|[nN]*) dflt='n';;
4412 rp='Use the newer interpreter-based ithreads?'
4415 y|Y) val="$define" ;;
4420 : Now set use5005threads to the opposite value.
4421 case "$useithreads" in
4422 $define) val="$undef" ;;
4429 useithreads="$undef"
4430 use5005threads="$undef"
4434 case "$useithreads$use5005threads" in
4438 You cannot have both the ithreads and the 5.005 threads enabled
4439 at the same time. Disabling the 5.005 threads since they are
4440 much less stable than the ithreads.
4443 use5005threads="$undef"
4448 : perl-5.9.x and later
4450 if test X"$usethreads" = "X$define"; then
4451 case "$use5005threads" in
4455 5.005 threads has been removed for 5.10. Perl will be built using ithreads.
4462 use5005threads="$undef"
4463 useithreads="$usethreads"
4466 case "$d_oldpthreads" in
4467 '') : Configure tests would be welcome here. For now, assume undef.
4469 *) val="$d_oldpthreads" ;;
4475 : Look for a hint-file generated 'call-back-unit'. If the
4476 : user has specified that a threading perl is to be built,
4477 : we may need to set or change some other defaults.
4478 if $test -f usethreads.cbu; then
4479 echo "Your platform has some specific hints regarding threaded builds, using them..."
4482 case "$usethreads" in
4483 "$define"|true|[yY]*)
4485 (Your platform does not have any specific hints for threaded builds.
4486 Assuming POSIX threads, then.)
4492 : Check if multiplicity is required
4495 Perl can be built so that multiple Perl interpreters can coexist
4496 within the same Perl executable.
4499 case "$useithreads" in
4502 This multiple interpreter support is required for interpreter-based threads.
4506 *) case "$usemultiplicity" in
4507 $define|true|[yY]*) dflt='y';;
4511 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4512 rp='Build Perl for multiplicity?'
4515 y|Y) val="$define" ;;
4523 : Check if morebits is requested
4524 case "$usemorebits" in
4525 "$define"|true|[yY]*)
4526 use64bitint="$define"
4527 uselongdouble="$define"
4528 usemorebits="$define"
4530 *) usemorebits="$undef"
4534 : Determine the C compiler to be used
4540 rp="Use which C compiler?"
4544 : See whether they have no cc but they do have gcc
4546 if $test -f cc.cbu; then
4551 : make some quick guesses about what we are up against
4553 $echo $n "Hmm... $c"
4563 $cat $sysroot/usr/include/signal.h $sysroot/usr/include/sys/signal.h >foo 2>/dev/null
4564 if test -f /osf_boot || $contains 'OSF/1' $sysroot/usr/include/ctype.h >/dev/null 2>&1
4566 echo "Looks kind of like an OSF/1 system, but we'll see..."
4568 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4569 xxx=`./loc addbib blurfl $pth`
4570 if $test -f $xxx; then
4571 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4575 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4576 echo "Looks kind of like an extended USG system, but we'll see..."
4578 echo "Looks kind of like a USG system, but we'll see..."
4582 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4583 echo "Looks kind of like a BSD system, but we'll see..."
4587 echo "Looks kind of like a Version 7 system, but we'll see..."
4590 case "$eunicefix" in
4593 There is, however, a strange, musty smell in the air that reminds me of
4594 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4598 : it so happens the Eunice I know will not run shell scripts in Unix format
4602 echo "Congratulations. You aren't running Eunice."
4606 : Detect OS2. The p_ variable is set above in the Head.U unit.
4607 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4608 : semicolon as a patch separator
4613 I have the feeling something is not exactly right, however...don't tell me...
4614 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4615 (Or you may be running DOS with DJGPP.)
4620 if test -f /xenix; then
4621 echo "Actually, this looks more like a XENIX system..."
4626 echo "It's not Xenix..."
4631 if test -f /venix; then
4632 echo "Actually, this looks more like a VENIX system..."
4639 echo "Nor is it Venix..."
4642 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4643 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4646 : Check if we are using GNU gcc and what its version is
4648 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4652 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4654 printf("%s\n", __VERSION__);
4656 printf("%s\n", "1");
4662 if $cc -o try $ccflags $ldflags try.c; then
4663 gccversion=`$run ./try`
4664 case "$gccversion" in
4665 '') echo "You are not using GNU cc." ;;
4666 *) echo "You are using GNU cc $gccversion."
4672 echo "*** WHOA THERE!!! ***" >&4
4673 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4674 case "$knowitall" in
4676 echo " You'd better start hunting for one and let me know about it." >&4
4682 case "$gccversion" in
4683 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4685 case "$gccversion" in
4686 '') gccosandvers='' ;;
4687 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4688 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4690 case "$gccosandvers" in
4691 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4692 $osname$osvers) ;; # looking good
4693 $osname*) cat <<EOM >&4
4695 *** WHOA THERE!!! ***
4697 Your gcc has not been compiled for the exact release of
4698 your operating system ($gccosandvers versus $osname$osvers).
4700 In general it is a good idea to keep gcc synchronized with
4701 the operating system because otherwise serious problems
4702 may ensue when trying to compile software, like Perl.
4704 I'm trying to be optimistic here, though, and will continue.
4705 If later during the configuration and build icky compilation
4706 problems appear (headerfile conflicts being the most common
4707 manifestation), I suggest reinstalling the gcc to match
4708 your operating system release.
4712 *) gccosandvers='' ;; # failed to parse, better be silent
4720 # gcc 3.* complain about adding -Idirectories that they already know about,
4721 # so we will take those off from locincpth.
4722 case "$gccversion" in
4724 echo "main(){}">try.c
4725 for incdir in $locincpth; do
4726 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4727 grep '^c[cp]p*[01]: warning: changing search order '`
4728 if test "X$warn" != X; then
4729 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4735 # gcc 4.9 by default does some optimizations that break perl.
4736 # see ticket 121505.
4738 # The -fwrapv disables those optimizations (and probably others,) so
4739 # for gcc 4.9 (and later, since the optimizations probably won't go
4740 # away), add -fwrapv unless the user requests -fno-wrapv, which
4741 # disables -fwrapv, or if the user requests -fsanitize=undefined,
4742 # which turns the overflows -fwrapv ignores into runtime errors.
4743 case "$gccversion" in
4744 4.[3-9].*|4.[1-9][0-9]*|[5-9].*|[1-9][0-9]*)
4746 *-fno-wrapv*|*-fsanitize=undefined*|*-fwrapv*) ;;
4747 *) ccflags="$ccflags -fwrapv" ;;
4751 : What should the include directory be ?
4752 : Use sysroot if set, so findhdr looks in the right place.
4754 $echo $n "Hmm... $c"
4755 dflt="$sysroot/usr/include"
4758 if $test -f /bin/mips && /bin/mips; then
4759 echo "Looks like a MIPS system..."
4760 $cat >usr.c <<'EOCP'
4761 #ifdef SYSTYPE_BSD43
4765 if $cc $cppflags -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4766 dflt='/bsd43/usr/include'
4770 mips_type='System V'
4772 $rm -f usr.c usr.out
4773 echo "and you're compiling with the $mips_type compiler and libraries."
4777 echo "Doesn't look like a MIPS system."
4787 case "$xxx_prompt" in
4790 rp='Where are the include files you want to use?'
4798 : see how we invoke the C preprocessor
4800 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4801 cat <<'EOT' >testcpp.c
4807 if test ! -f cppstdin; then
4808 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4809 # AIX cc -E doesn't show the absolute headerfile
4810 # locations but we'll cheat by using the -M flag.
4811 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
4813 echo 'cat >.$$.c; '"$cc $cppflags"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4816 echo "Keeping your $hint cppstdin wrapper."
4819 wrapper=`pwd`/cppstdin
4823 if $test "X$cppstdin" != "X" && \
4824 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4825 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4827 echo "You used to use $cppstdin $cppminus so we'll use that again."
4829 '') echo "But let's see if we can live without a wrapper..." ;;
4831 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4832 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4834 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4837 echo "(However, $cpprun $cpplast does not work, let's see...)"
4845 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4852 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4853 $cc -E <testcpp.c >testcpp.out 2>&1; \
4854 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4855 echo "Yup, it does."
4856 x_cpp="$cc $cppflags -E"
4858 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4859 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4860 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4861 echo "Yup, it does."
4862 x_cpp="$cc $cppflags -E"
4864 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4865 $cc -P <testcpp.c >testcpp.out 2>&1; \
4866 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4867 echo "Yipee, that works!"
4868 x_cpp="$cc $cppflags -P"
4870 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4871 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4872 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4873 echo "At long last!"
4874 x_cpp="$cc $cppflags -P"
4876 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4877 $cpp <testcpp.c >testcpp.out 2>&1; \
4878 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4880 x_cpp="$cpp $cppflags"
4882 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4883 $cpp - <testcpp.c >testcpp.out 2>&1; \
4884 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4885 echo "Hooray, it works! I was beginning to wonder."
4886 x_cpp="$cpp $cppflags"
4888 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4889 $wrapper <testcpp.c >testcpp.out 2>&1; \
4890 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4896 rp="No dice. I can't find a C preprocessor. Name one:"
4900 $x_cpp <testcpp.c >testcpp.out 2>&1
4901 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4902 echo "OK, that will do." >&4
4904 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4919 echo "Perhaps can we force $cc -E using a wrapper..."
4920 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4921 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4927 echo "Nope, we'll have to live without it..."
4941 "$wrapper"|'cppstdin') ;;
4942 *) $rm -f $wrapper;;
4944 $rm -f testcpp.c testcpp.out
4946 : Adjust cppfilter for path component separator
4948 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
4949 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
4953 : Use gcc to determine libpth and incpth
4954 # If using gcc or clang, we can get better values for libpth, incpth
4955 # and usrinc directly from the compiler.
4956 # Note that ccname for clang is also gcc.
4959 $echo 'extern int foo;' > try.c
4960 set X `$cppstdin -v try.c 2>&1 | $awk '/^#include </,/^End of search /'|$cppfilter $grep '/include'`
4962 if $test $# -gt 0; then
4964 incpth="`$echo $incpth|$sed 's/^ //'`"
4966 j="`$echo $i|$sed 's,/include$,/lib,'`"
4967 if $test -d $j; then
4971 libpth="`$echo $libpth|$sed 's/^ //'`"
4972 for xxx in $libpth $loclibpth $plibpth $glibpth; do
4973 if $test -d $xxx; then
4976 *) libpth="$libpth $xxx";;
4983 '') for i in $incpth; do
4984 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
4992 case "$usecrosscompile" in
4995 '') echo "Incpth not defined." >&4; croak=y ;;
4996 *) echo "Using incpth '$incpth'." >&4 ;;
4999 '') echo "Libpth not defined." >&4; croak=y ;;
5000 *) echo "Using libpth '$libpth'." >&4 ;;
5003 '') echo "Usrinc not defined." >&4; croak=y ;;
5004 *) echo "Using usrinc $usrinc." >&4 ;;
5008 if test "X$sysroot" = X; then
5009 echo "Cannot continue, aborting." >&4; exit 1
5011 echo "Cross-compiling using sysroot $sysroot, failing to guess inc/lib paths is not fatal" >&4
5020 : Default value for incpth is just usrinc
5022 '') incpth="$usrinc";;
5025 : Set private lib path
5028 plibpth="$incpath/usr/lib $sysroot/usr/local/lib $sysroot/usr/ccs/lib"
5033 '') dlist="$loclibpth $plibpth $glibpth";;
5034 *) dlist="$libpth";;
5037 : Now check and see which directories actually exist, avoiding duplicates
5040 if $test -d $xxx; then
5043 *) libpth="$libpth $xxx";;
5049 Some systems have incompatible or broken versions of libraries. Among
5050 the directories listed in the question below, please remove any you
5051 know not to be holding relevant libraries, and add any that are needed.
5052 Say "none" for none.
5056 if test "X$sysroot" != X; then
5058 You have set sysroot to $sysroot, please supply the directories excluding sysroot
5071 rp="Directories to use for library searches?"
5078 : compute shared library extension
5081 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
5091 On some systems, shared libraries may be available. Answer 'none' if
5092 you want to suppress searching of shared libraries for the remainder
5093 of this configuration.
5096 rp='What is the file extension used for shared libraries?'
5100 : Does target system insist that shared library basenames are unique
5103 Some dynamic loaders assume that the *basename* of shared library filenames
5104 are globally unique. We'll default this to undef as we assume your system
5105 is not this weird. Set to defined if you're on one of them.
5110 rp='Make shared library basenames unique?'
5113 y|Y) val="$define" ;;
5116 set d_libname_unique
5119 : Define several unixisms.
5120 : Hints files or command line option can be used to override them.
5121 : The convoluted testing is in case hints files set either the old
5124 '') case "$exe_ext" in
5126 *) _exe="$exe_ext" ;;
5131 '') case "$lib_ext" in
5138 '') case "$obj_ext" in
5145 '') case "$path_sep" in
5156 rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
5158 : Which makefile gets called first. This is used by make depend.
5159 case "$firstmakefile" in
5160 '') firstmakefile='makefile';;
5163 : Check is we will use socks
5165 $define|true|[yY]*) dflt='y';;
5170 Perl can be built to use the SOCKS proxy protocol library. To do so,
5171 Configure must be run with -Dusesocks. If you use SOCKS you also need
5172 to use the PerlIO abstraction layer, this will be implicitly selected.
5174 If this doesn't make any sense to you, just accept the default '$dflt'.
5176 rp='Build Perl for SOCKS?'
5179 y|Y) val="$define" ;;
5185 : Check for uselongdouble support
5187 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
5190 case "$uselongdouble" in
5191 $define|true|[yY]*) dflt='y';;
5196 Perl can be built to take advantage of long doubles which
5197 (if available) may give more accuracy and range for floating point numbers.
5199 If this doesn't make any sense to you, just accept the default '$dflt'.
5201 rp='Try to use long doubles if available?'
5204 y|Y) val="$define" ;;
5210 case "$uselongdouble" in
5211 true|[yY]*) uselongdouble="$define" ;;
5214 : Look for a hint-file generated 'call-back-unit'. If the
5215 : user has specified that long doubles should be used,
5216 : we may need to set or change some other defaults.
5217 if $test -f uselongdouble.cbu; then
5218 echo "Your platform has some specific hints regarding long doubles, using them..."
5219 . ./uselongdouble.cbu
5221 case "$uselongdouble" in
5224 (Your platform does not have any specific hints for long doubles.)
5230 : Check if quadmath is requested
5231 case "$usequadmath" in
5232 "$define"|true|[yY]*) usequadmath="$define" ;;
5233 *) usequadmath="$undef" ;;
5236 : Looking for optional libraries
5238 echo "Checking for optional libraries..." >&4
5243 case "$libswanted" in
5244 '') libswanted='c_s';;
5247 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
5249 case "$usecbacktrace" in
5250 "$define") libswanted="$libswanted bfd" ;;
5252 case "$usequadmath" in
5253 "$define") libswanted="$libswanted quadmath" ;;
5259 for thisdir in $libpth $xlibpth; do
5260 test -d $thisdir && libspath="$libspath $thisdir"
5262 for thislib in $libswanted; do
5263 for thisdir in $libspath; do
5265 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
5266 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
5267 $test -f "$xxx" && eval $libscheck
5268 $test -f "$xxx" && libstyle=shared
5269 xxx=`ls $thisdir/lib$thislib.[0-9].$so 2>/dev/null|sed -n '$p'`
5270 $test -f "$xxx" && eval $libscheck
5271 $test -f "$xxx" && libstyle=shared
5273 if test ! -f "$xxx"; then
5274 xxx=$thisdir/lib$thislib.$so
5275 $test -f "$xxx" && eval $libscheck
5276 $test -f "$xxx" && libstyle=shared
5278 if test ! -f "$xxx"; then
5279 xxx=$thisdir/lib$thislib$_a
5280 $test -f "$xxx" && eval $libscheck
5281 $test -f "$xxx" && libstyle=static
5283 if test ! -f "$xxx"; then
5284 xxx=$thisdir/$thislib$_a
5285 $test -f "$xxx" && eval $libscheck
5286 $test -f "$xxx" && libstyle=static
5288 if test ! -f "$xxx"; then
5289 xxx=$thisdir/lib${thislib}_s$_a
5290 $test -f "$xxx" && eval $libscheck
5291 $test -f "$xxx" && libstyle=static
5292 $test -f "$xxx" && thislib=${thislib}_s
5294 if test ! -f "$xxx"; then
5295 xxx=$thisdir/Slib$thislib$_a
5296 $test -f "$xxx" && eval $libscheck
5297 $test -f "$xxx" && libstyle=static
5299 if $test -f "$xxx"; then
5301 shared) echo "Found -l$thislib (shared)." ;;
5302 static) echo "Found -l$thislib." ;;
5303 *) echo "Found -l$thislib ($libstyle)." ;;
5307 *) dflt="$dflt -l$thislib"
5308 libsfound="$libsfound $xxx"
5310 libsfiles="$libsfiles $yyy"
5311 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
5312 case " $libsdirs " in
5314 *) libsdirs="$libsdirs $yyy" ;;
5321 if $test ! -f "$xxx"; then
5322 echo "No -l$thislib."
5333 ' '|'') dflt='none';;
5338 In order to compile $package on your machine, a number of libraries
5339 are usually needed. Include any other special libraries here as well.
5340 Say "none" for none. The default list is almost always right.
5344 rp="What libraries to use?"
5351 : determine optimization, if desired, or use for debug flag also
5353 ' '|$undef) dflt='none';;
5355 *) dflt="$optimize";;
5359 By default, $package compiles with the -O flag to use the optimizer.
5360 Alternately, you might want to use the symbolic debugger, which uses
5361 the -g flag (on traditional Unix systems). Either flag can be
5362 specified here. To use neither flag, specify the word "none".
5365 rp="What optimizer/debugger flag should be used?"
5369 'none') optimize=" ";;
5372 : Check what DEBUGGING is required from the command line
5373 : -DEBUGGING or -DDEBUGGING or
5374 : -DEBUGGING=both = -g + -DDEBUGGING
5375 : -DEBUGGING=-g or -Doptimize=-g = -g
5376 : -DEBUGGING=none or -UDEBUGGING =
5377 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
5380 *) DEBUGGING=$EBUGGING ;;
5383 case "$DEBUGGING" in
5387 *) optimize="$optimize -g" ;;
5391 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
5399 case "$DEBUGGING" in
5400 both|$define) dflt='-DDEBUGGING'
5403 : argument order is deliberate, as the flag will start with - which set could
5404 : think is an option
5405 checkccflag='check=$1; flag=$2; callback=$3;
5407 echo "Checking if your compiler accepts $flag" 2>&1;
5408 [ "X$sysroot" != "X" ] && echo "For sysroot = $sysroot";
5409 echo "int main(void) { return 0; }" > gcctest.c;
5410 if $cc $_sysroot -O2 $flag -o gcctest gcctest.c 2>gcctest.out && $run ./gcctest; then
5411 echo "Yes, it does." 2>&1;
5412 if $test -s gcctest.out ; then
5413 echo "But your platform does not like it:";
5418 echo "Leaving current flags $ccflags alone." 2>&1
5420 *) dflt="$dflt $flag";
5426 echo "Nope, it does not, but that is ok." 2>&1;
5430 : We will not override a previous value, but we might want to
5431 : augment a hint file
5433 default|recommended)
5434 case "$gccversion" in
5435 1*) dflt="$dflt -fpcc-struct-return" ;;
5437 case "$optimize:$DEBUGGING" in
5438 *-g*:old) dflt="$dflt -DDEBUGGING";;
5440 case "$gccversion" in
5441 2*) if $test -d /etc/conf/kconfig.d &&
5442 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
5444 # Interactive Systems (ISC) POSIX mode.
5449 case "$gccversion" in
5452 ?*) set strict-aliasing -fno-strict-aliasing
5456 # For gcc, adding -pipe speeds up compilations for some, but apparently
5457 # some assemblers can't read from stdin. (It also slows down compilations
5458 # in other cases, but those are apparently rarer these days.) AD 5/2004.
5459 case "$gccversion" in
5465 # on x86_64 (at least) we require an extra library (libssp) in the
5466 # link command line. This library is not named, so I infer that it is
5467 # an implementation detail that may change. Hence the safest approach
5468 # is to add the flag to the flags passed to the compiler at link time,
5469 # as that way the compiler can do the right implementation dependant
5472 amigaos) ;; # -fstack-protector builds but doesn't work
5473 *) case "$gccversion" in
5474 ?*) set stack-protector-strong -fstack-protector-strong
5477 *-fstack-protector-strong*) ;; # It got added.
5478 *) # Try the plain/older -fstack-protector.
5479 set stack-protector -fstack-protector
5490 case "$mips_type" in
5491 *BSD*|'') inclwanted="$locincpth $usrinc";;
5492 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
5494 for thisincl in $inclwanted; do
5495 if $test -d $thisincl; then
5496 if $test x$thisincl != x$usrinc; then
5498 *" -I$thisincl "*);;
5499 *) dflt="$dflt -I$thisincl ";;
5505 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
5507 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5515 *) dflt="$dflt -D$2";;
5519 set signal.h LANGUAGE_C; eval $inctest
5523 ccflags="$ccflags -DSOCKS"
5528 default|recommended) dflt="$ccflags $dflt" ;;
5529 *) dflt="$ccflags";;
5538 Your C compiler may want other flags. For this question you should include
5539 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5540 but you should NOT include libraries or ld flags like -lwhatever. If you
5541 want $package to honor its debug switch, you should include -DDEBUGGING here.
5542 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5544 To use no flags, specify the word "none".
5550 rp="Any additional cc flags?"
5557 : the following weeds options from ccflags that are of no interest to cpp
5559 '') cppflags="$ccflags" ;;
5560 *) set X $ccflags; shift
5561 case " $cppflags " in
5562 *" $1 "*) ;; # Try to avoid doubling the cppflags.
5563 *) cppflags="$cppflags $ccflags" ;;
5567 case "$gccversion" in
5568 1*) cppflags="$cppflags -D__GNUC__"
5570 case "$mips_type" in
5572 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5578 echo "Let me guess what the preprocessor flags are..." >&4
5592 *) ftry="$previous $flag";;
5594 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5595 >cpp1.out 2>/dev/null && \
5596 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5597 >cpp2.out 2>/dev/null && \
5598 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5599 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5601 cppflags="$cppflags $ftry"
5611 *-*) echo "They appear to be: $cppflags";;
5613 $rm -f cpp.c cpp?.out
5617 : flags used in final linking phase
5619 '') if ./venix; then
5625 *-posix*) dflt="$dflt -posix" ;;
5628 *) dflt="$ldflags";;
5630 # See note above about -fstack-protector
5632 *-fstack-protector-strong*)
5634 *-fstack-protector-strong*) ;; # Don't add it again
5635 *) dflt="$dflt -fstack-protector-strong" ;;
5638 *-fstack-protector*)
5640 *-fstack-protector*) ;; # Don't add it again
5641 *) dflt="$dflt -fstack-protector" ;;
5646 : Try to guess additional flags to pick up local libraries.
5647 for thislibdir in $libpth; do
5648 case " $loclibpth " in
5651 *"-L$thislibdir "*) ;;
5652 *) dflt="$dflt -L$thislibdir" ;;
5664 Your C linker may need flags. For this question you should
5665 include -L/whatever and any other flags used by the C linker, but you
5666 should NOT include libraries like -lwhatever.
5668 Make sure you include the appropriate -L/path flags if your C linker
5669 does not normally search all of the directories you specified above,
5672 To use no flags, specify the word "none".
5676 rp="Any additional ld flags (NOT including libraries)?"
5682 rmlist="$rmlist pdp11"
5686 echo "Checking your choice of C compiler and flags for coherency..." >&4
5687 $cat > try.c <<'EOF'
5689 int main() { printf("Ok\n"); return(0); }
5691 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5693 $cat >try.msg <<'EOM'
5694 I've tried to compile and run the following simple program:
5697 $cat try.c >> try.msg
5699 $cat >> try.msg <<EOM
5706 and I got the following output:
5710 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5711 if $sh -c "$run ./try " >>try.msg 2>&1; then
5715 *) echo 'The program compiled OK, but produced no output.' >> try.msg ;;
5718 echo "The program compiled OK, but exited with status $?." >>try.msg
5719 rp="You have a problem. Shall I abort Configure"
5723 echo "I can't compile the test program." >>try.msg
5724 rp="You have a BIG problem. Shall I abort Configure"
5730 case "$knowitall" in
5732 echo "(The supplied flags or libraries might be incorrect.)"
5740 *) echo "Ok. Stopping Configure." >&4
5745 n) echo "OK, that should do.";;
5747 $rm_try gcctest gcctest.out
5749 : define a shorthand compile call
5753 case "$usedevel" in $define|true|[yY]*) if $test ! -f "${mc_file}.c"; then
5754 echo "Internal Configure script bug - compiler test file ${mc_file}.c is missing. Please report this to perlbug@perl.org" >&4;
5758 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5759 : define a shorthand compile call for compilations that should be ok.
5763 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5765 : determine filename position in cpp output
5767 echo "Computing filename position in cpp output for #include directives..." >&4
5769 amigaos) fieldn=3 ;; # Workaround for a bug in abc (pdksh).
5774 vos) testaccess=-e ;;
5777 echo '#include <stdio.h>' > foo.c
5780 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5781 $grep '^[ ]*#.*stdio\.h' | \
5782 while read cline; do
5785 while $test \$# -gt 0; do
5786 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5791 pos=\`expr \$pos + 1\`
5805 *) pos="${fieldn}th";;
5807 echo "Your cpp writes the filename in the $pos field of the line."
5809 : locate header file
5814 for usrincdir in $incpth
5816 if test -f \$usrincdir/\$wanted; then
5817 echo "\$usrincdir/\$wanted"
5821 awkprg='{ print \$$fieldn }'
5822 echo "#include <\$wanted>" > foo\$\$.c
5823 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5824 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5825 while read cline; do
5826 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5828 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5829 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5834 # status = 0: grep returned 0 lines, case statement not executed
5835 # status = 1: headerfile found
5836 # status = 2: while loop executed, no headerfile found
5840 if test \$status -eq 1; then
5847 : define an alternate in-header-list? function
5848 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5849 cont=true; xxf="echo \"<\$1> found.\" >&4";
5850 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5851 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5853 case $# in 4) instead=instead;; *) instead="at last";; esac;
5854 while $test "$cont"; do
5856 var=$2; eval "was=\$$2";
5857 if $test "$xxx" && $test -r "$xxx";
5859 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5862 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5863 set $yyy; shift; shift; yyy=$@;
5864 case $# in 0) cont="";;
5865 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5866 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5867 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5868 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5872 do set $yyy; var=$2; eval "was=\$$2";
5873 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5874 set $yyy; shift; shift; yyy=$@;
5877 : see if stdlib is available
5878 set stdlib.h i_stdlib
5881 : check for lengths of integral types
5885 echo "Checking to see how big your integers are..." >&4
5894 printf("intsize=%d;\n", (int)sizeof(int));
5895 printf("longsize=%d;\n", (int)sizeof(long));
5896 printf("shortsize=%d;\n", (int)sizeof(short));
5901 if eval $compile_ok && $run ./try > /dev/null; then
5903 echo "Your integers are $intsize bytes long."
5904 echo "Your long integers are $longsize bytes long."
5905 echo "Your short integers are $shortsize bytes long."
5909 Help! I can't compile and run the intsize test program: please enlighten me!
5910 (This is probably a misconfiguration in your system or libraries, and
5911 you really ought to fix it. Still, I'll try anyway.)
5915 rp="What is the size of an integer (in bytes)?"
5919 rp="What is the size of a long integer (in bytes)?"
5923 rp="What is the size of a short integer (in bytes)?"
5931 : check for long long
5933 echo "Checking to see if you have long long..." >&4
5934 echo 'int main() { long long x = 7; return 0; }' > try.c
5936 if eval $compile; then
5938 echo "You have long long."
5941 echo "You do not have long long."
5947 : check for length of long long
5948 case "${d_longlong}${longlongsize}" in
5951 echo "Checking to see how big your long longs are..." >&4
5952 $cat >try.c <<'EOCP'
5956 printf("%d\n", (int)sizeof(long long));
5961 if eval $compile_ok; then
5962 longlongsize=`$run ./try`
5963 echo "Your long longs are $longlongsize bytes long."
5967 echo "(I can't seem to compile the test program. Guessing...)"
5968 rp="What is the size of a long long (in bytes)?"
5972 if $test "X$longsize" = "X$longlongsize"; then
5973 echo "(That isn't any different from an ordinary long.)"
5979 : see if inttypes.h is available
5980 : we want a real compile instead of Inhdr because some systems
5981 : have an inttypes.h which includes non-existent headers
5984 #include <inttypes.h>
5986 static int32_t foo32 = 0x12345678;
5990 if eval $compile; then
5991 echo "<inttypes.h> found." >&4
5994 echo "<inttypes.h> NOT found." >&4
6003 echo "Checking to see if you have int64_t..." >&4
6005 #include <sys/types.h>
6006 #$i_inttypes I_INTTYPES
6008 #include <inttypes.h>
6010 int main() { int64_t x = 7; }
6013 if eval $compile; then
6015 echo "You have int64_t."
6018 echo "You do not have int64_t."
6024 : Check if 64bit ints have a quad type
6026 echo "Checking which 64-bit integer type we could use..." >&4
6032 val='"unsigned int"'
6037 *) case "$longsize" in
6041 val='"unsigned long"'
6046 *) case "$d_longlong:$longlongsize" in
6051 val='"unsigned long long"'
6056 *) case "$d_int64_t" in
6075 '') echo "Alas, no 64-bit integer types in sight." >&4
6078 *) echo "We could use '$quadtype' for 64-bit integers." >&4
6083 : Do we want 64bit support
6084 case "$uselonglong" in
6085 "$define"|true|[yY]*)
6088 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
6090 use64bitint="$define"
6093 case "$use64bits" in
6094 "$define"|true|[yY]*)
6097 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
6099 use64bitint="$define"
6102 case "$use64bitints" in
6103 "$define"|true|[yY]*)
6106 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
6108 use64bitint="$define"
6111 case "$use64bitsint" in
6112 "$define"|true|[yY]*)
6115 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
6117 use64bitint="$define"
6120 case "$uselonglongs" in
6121 "$define"|true|[yY]*)
6124 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
6126 use64bitint="$define"
6129 case "$use64bitsall" in
6130 "$define"|true|[yY]*)
6133 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
6135 use64bitall="$define"
6140 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
6142 case "$use64bitall" in
6143 "$define"|true|[yY]*) use64bitint="$define" ;;
6149 You have natively 64-bit long integers.
6153 *) case "$use64bitint" in
6154 "$define"|true|[yY]*) dflt='y';;
6163 Perl can be built to take advantage of 64-bit integer types
6164 on some systems. To do so, Configure can be run with -Duse64bitint.
6165 Choosing this option will most probably introduce binary incompatibilities.
6167 If this doesn't make any sense to you, just accept the default '$dflt'.
6168 (The default has been chosen based on your configuration.)
6170 rp='Try to use 64-bit integers, if available?'
6173 [yY]*) val="$define" ;;
6181 case "$use64bitall" in
6182 "$define"|true|[yY]*) dflt='y' ;;
6183 *) case "$longsize" in
6191 You may also choose to try maximal 64-bitness. It means using as much
6192 64-bitness as possible on the platform. This in turn means even more
6193 binary incompatibilities. On the other hand, your platform may not
6194 have any more 64-bitness available than what you already have chosen.
6196 If this doesn't make any sense to you, just accept the default '$dflt'.
6197 (The default has been chosen based on your configuration.)
6199 rp='Try to use maximal 64-bit support, if available?'
6202 [yY]*) val="$define" ;;
6207 case "$use64bitall" in
6209 case "$use64bitint" in
6213 Since you have chosen a maximally 64-bit build, I'm also turning on
6214 the use of 64-bit integers.
6216 use64bitint="$define" ;;
6221 : Look for a hint-file generated 'call-back-unit'. If the
6222 : user has specified that a 64-bit perl is to be built,
6223 : we may need to set or change some other defaults.
6224 if $test -f use64bitint.cbu; then
6225 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
6228 case "$use64bitint" in
6229 "$define"|true|[yY]*)
6230 : This test was common to all the OpenBSD forks, and seems harmless for
6233 echo "Checking if your C library has broken 64-bit functions..." >&4
6236 typedef $uquadtype myULL;
6243 {4294967303.15, 4294967303ULL},
6244 {4294967294.2, 4294967294ULL},
6245 {4294967295.7, 4294967295ULL},
6248 for (p = test; p->u; p++) {
6249 myULL x = (myULL)p->d;
6260 if eval $compile_ok; then
6261 libcquad=`$run ./try`
6262 echo "Your C library's 64-bit functions are $libcquad."
6264 echo "(I can't seem to compile the test program.)"
6265 echo "Assuming that your C library's 64-bit functions are ok."
6274 *** You have a C library with broken 64-bit functions.
6275 *** 64-bit support does not work reliably in this configuration.
6276 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
6277 *** Cannot continue, aborting.
6284 4) case "$archname64" in
6285 '') archname64=64int ;;
6292 : Look for a hint-file generated 'call-back-unit'. If the
6293 : user has specified that a maximally 64-bit perl is to be built,
6294 : we may need to set or change some other defaults.
6295 if $test -f use64bitall.cbu; then
6296 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
6299 case "$use64bitall" in
6300 "$define"|true|[yY]*)
6302 4) case "$archname64" in
6303 ''|64int) archname64=64all ;;
6310 case "$d_quad:$use64bitint" in
6314 *** You have chosen to use 64-bit integers,
6315 *** but none can be found.
6316 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
6317 *** Cannot continue, aborting.
6324 : Check if we are using the GNU C library
6326 echo "Checking for GNU C Library..." >&4
6328 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
6329 alone are insufficient to distinguish different versions, such as
6330 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
6331 libc version 2.1.0. A. Dougherty, June 3, 2002.
6337 # ifdef __GLIBC_MINOR__
6338 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
6339 # include <gnu/libc-version.h>
6340 printf("%s\n", gnu_get_libc_version());
6342 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
6345 printf("%d\n", __GLIBC__);
6354 if eval $compile_ok && $run ./try > glibc.ver; then
6356 gnulibc_version=`$cat glibc.ver`
6357 echo "You are using the GNU C Library version $gnulibc_version"
6361 echo "You are not using the GNU C Library"
6367 : see if nm is to be used to determine whether a symbol is defined or not
6371 case "$d_gnulibc" in
6374 echo "nm probably won't work on the GNU C Library." >&4
6380 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
6382 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
6383 echo "'nm' won't be sufficient on this system." >&4
6389 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
6390 if $test $dflt -gt 20; then
6400 true|$define) dflt=y;;
6407 I can use $nm to extract the symbols from your C libraries. This
6408 is a time consuming task which may generate huge output on the disk (up
6409 to 3 megabytes) but that should make the symbols extraction faster. The
6410 alternative is to skip the 'nm' extraction part and to compile a small
6411 test program instead to determine whether each symbol is present. If
6412 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
6413 this may be the best solution.
6415 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
6418 rp="Shall I use $nm to extract C symbols from the libraries?"
6421 [Nn]*) usenm=false;;
6430 : nm options which may be necessary
6432 '') if $test -f /mach_boot; then
6434 elif $test -d /usr/ccs/lib; then
6435 nm_opt='-p' # Solaris (and SunOS?)
6436 elif $test -f /dgux; then
6438 elif $test -f /lib64/rld; then
6439 nm_opt='-p' # 64-bit Irix
6445 : nm options which may be necessary for shared libraries but illegal
6446 : for archive libraries. Thank you, Linux.
6447 case "$nm_so_opt" in
6448 '') case "$myuname" in
6450 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
6451 nm_so_opt='--dynamic'
6458 : Figure out where the libc is located
6461 : get list of predefined functions in a handy place
6466 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
6472 *) for thislib in $libs; do
6475 : Handle C library specially below.
6478 thislib=`echo $thislib | $sed -e 's/^-l//'`
6479 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
6481 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
6483 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
6485 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
6487 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
6489 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
6491 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
6496 libnames="$libnames $try"
6498 *) libnames="$libnames $thislib" ;;
6507 for xxx in $libpth; do
6508 $test -r $1 || set $xxx/libc.$so
6509 : The messy sed command sorts on library version numbers.
6511 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
6512 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
6514 s/[0-9][0-9]*/0000&/g
6515 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
6518 $sort | $sed -e 's/^.* //'`
6521 $test -r $1 || set $sysroot/usr/ccs/lib/libc.$so
6522 $test -r $1 || set $sysroot/lib/libsys_s$_a
6528 if $test -r "$1"; then
6529 echo "Your (shared) C library seems to be in $1."
6531 elif $test -r /lib/libc && $test -r /lib/clib; then
6532 echo "Your C library seems to be in both /lib/clib and /lib/libc."
6534 libc='/lib/clib /lib/libc'
6535 if $test -r /lib/syslib; then
6536 echo "(Your math library is in /lib/syslib.)"
6537 libc="$libc /lib/syslib"
6539 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
6540 echo "Your C library seems to be in $libc, as you said before."
6541 elif $test -r $incpath/usr/lib/libc$_a; then
6542 libc=$incpath/usr/lib/libc$_a;
6543 echo "Your C library seems to be in $libc. That's fine."
6544 elif $test -r /lib/libc$_a; then
6546 echo "Your C library seems to be in $libc. You're normal."
6548 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
6550 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
6551 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
6552 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
6554 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
6556 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
6559 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
6561 if $test -r "$tans"; then
6562 echo "Your C library seems to be in $tans, of all places."
6568 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
6572 If the guess above is wrong (which it might be if you're using a strange
6573 compiler, or your machine supports multiple models), you can override it here.
6578 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
6580 I can't seem to find your C library. I've looked in the following places:
6583 $sed 's/^/ /' libpath
6586 None of these seems to contain your C library. I need to get its name...
6591 rp='Where is your C library?'
6596 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
6597 set X `cat libnames`
6600 case $# in 1) xxx=file; esac
6601 echo "Extracting names from the following $xxx for later perusal:" >&4
6603 $sed 's/^/ /' libnames >&4
6605 $echo $n "This may take a while...$c" >&4
6609 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
6610 *) $nm $nm_opt $file 2>/dev/null;;
6615 $grep fprintf libc.tmp > libc.ptf
6616 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
6617 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
6619 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
6621 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6623 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
6625 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6627 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
6629 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6631 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
6633 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6635 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
6637 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6639 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
6641 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6643 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
6644 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
6646 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6648 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
6650 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6652 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
6654 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6656 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
6658 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6660 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
6662 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6664 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
6666 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6668 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
6670 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6672 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
6674 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6677 $nm -p $* 2>/dev/null >libc.tmp
6678 $grep fprintf libc.tmp > libc.ptf
6679 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
6680 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
6686 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
6688 if $ar t $libc > libc.tmp && \
6689 $contains '^fprintf$' libc.tmp >/dev/null 2>&1
6691 for thisname in $libnames $libc; do
6692 $ar t $thisname >>libc.tmp
6694 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
6696 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
6697 for thisname in $libnames $libc; do
6698 $ar tv $thisname >>libc.tmp
6699 emximp -o tmp.imp $thisname \
6701 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
6702 < tmp.imp >>libc.tmp
6705 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
6708 echo "$ar didn't seem to work right." >&4
6709 echo "Maybe this is a Cray...trying bld instead..." >&4
6711 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list &&
6714 for thisname in $libnames; do
6716 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
6717 $ar t $thisname >>libc.tmp
6721 echo "That didn't work either. Giving up." >&4
6731 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
6732 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
6734 *) if $test -f /lib/syscalls.exp; then
6736 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
6737 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' \
6738 /lib/syscalls.exp >>libc.list
6744 $rm -f libnames libpath
6746 : Check if we are using C++
6748 echo "Checking for C++..." >&4
6749 $cat >try.c <<'EOCP'
6761 if eval $compile_ok && $run ./try; then
6763 echo "You are using a C++ compiler."
6766 echo "You are not using a C++ compiler."
6772 : is a C symbol defined?
6775 -v) tf=libc.tmp; tdc="";;
6776 -a) tf=libc.tmp; tdc="[]";;
6777 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
6779 case "$d_cplusplus" in
6780 $define) extern_C="extern \"C\"" ;;
6781 *) extern_C="extern" ;;
6784 case "$reuseval-$4" in
6786 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
6791 if $test "$runnm" = true; then
6792 if $contains $tlook $tf >/dev/null 2>&1; then
6794 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
6795 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;
6796 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
6797 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
6801 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;
6802 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
6808 $define) tval=true;;
6815 : define an is-in-libc? function
6816 inlibc='echo " "; td=$define; tu=$undef;
6817 sym=$1; var=$2; eval "was=\$$2";
6819 case "$reuseval$was" in
6829 echo "$sym() found." >&4;
6830 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
6832 echo "$sym() NOT found." >&4;
6833 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
6837 $define) echo "$sym() found." >&4;;
6838 *) echo "$sym() NOT found." >&4;;
6842 : check for length of double
6844 case "$doublesize" in
6846 echo "Checking to see how big your double precision numbers are..." >&4
6855 printf("%d\n", (int)sizeof(double));
6860 if eval $compile_ok; then
6861 doublesize=`$run ./try`
6862 echo "Your double is $doublesize bytes long."
6865 echo "(I can't seem to compile the test program. Guessing...)"
6866 rp="What is the size of a double precision number (in bytes)?"
6874 : see if this is a float.h system
6878 : check for long doubles
6880 echo "Checking to see if you have long double..." >&4
6881 echo 'int main() { long double x = 7.0; }' > try.c
6883 if eval $compile; then
6885 echo "You have long double."
6888 echo "You do not have long double."
6894 : see if ldexpl exists
6898 : check for length of long double
6899 case "${d_longdbl}${longdblsize}" in
6902 echo "Checking to see how big your long doubles are..." >&4
6903 $cat >try.c <<'EOCP'
6907 printf("%d\n", sizeof(long double));
6912 if eval $compile; then
6913 longdblsize=`$run ./try`
6914 echo "Your long doubles are $longdblsize bytes long."
6918 echo "(I can't seem to compile the test program. Guessing...)" >&4
6919 rp="What is the size of a long double (in bytes)?"
6923 if $test "X$doublesize" = "X$longdblsize"; then
6924 echo "That isn't any different from an ordinary double."
6925 echo "I'll keep your setting anyway, but you may see some"
6926 echo "harmless compilation warnings."
6932 $echo "Checking the kind of long doubles you have..." >&4
6933 case "$d_longdbl" in
6938 #define LONGDBLSIZE $longdblsize
6939 #define DOUBLESIZE $doublesize
6947 static const long double d = -0.1L;
6949 unsigned const char* b = (unsigned const char*)(&d);
6950 #if DOUBLESIZE == LONGDBLSIZE
6951 printf("0\n"); /* if it floats like double */
6954 #if (LDBL_MANT_DIG == 113 || FLT128_MANT_DIG == 113) && LONGDBLSIZE == 16
6955 if (b[0] == 0x9A && b[1] == 0x99 && b[15] == 0xBF) {
6956 /* IEEE 754 128-bit little-endian */
6960 if (b[0] == 0xBF && b[14] == 0x99 && b[15] == 0x9A) {
6961 /* IEEE 128-bit big-endian, e.g. solaris sparc */
6966 /* For alignment 32-bit platforms have the 80 bits in 12 bytes,
6967 * while 64-bits platforms have it in 16 bytes. The trailing bytes
6968 * cannot be trusted. */
6969 #if LDBL_MANT_DIG == 64 && (LONGDBLSIZE == 16 || LONGDBLSIZE == 12)
6970 if (b[0] == 0xCD && b[9] == 0xBF) {
6971 /* x86 80-bit little-endian, sizeof 12 (ILP32, Solaris x86)
6972 * or 16 (LP64, Linux and OS X), 4 or 6 bytes of padding.
6973 * Also known as "extended precision". */
6977 if (b[0] == 0xBF && b[9] == 0xCD) {
6978 /* Is there ever big-endian 80-bit, really?
6980 * The Motorola 68881 had another "extended precision" format:
6981 * sign:1 exp:15 zero:16 integer:1 mantissa:63
6982 * for total of 96 bits of bytes. The zero bits were unused.
6983 * See "M68000 FAMILY PROGRAMMER’S REFERENCE MANUAL" for more details.
6984 * If it ever becomes relevant, this format should be allocated
6985 * a new doublekind code since it's quite different from the Intel x87.
6991 #if (LDBL_MANT_DIG == 106 || LDBL_MANT_DIG == 107) && LONGDBLSIZE == 16
6992 /* software "double double", the 106 is 53+53.
6993 * but irix thinks it is 107. */
6994 if (b[0] == 0x9A && b[7] == 0x3C && b[8] == 0x9A && b[15] == 0xBF) {
6995 /* double double 128-bit fully little-endian,
6996 * little-endian doubles in little-endian order,
6997 * 9a 99 99 99 99 99 59 3c 9a 99 99 99 99 99 b9 bf */
7001 if (b[0] == 0xBF && b[7] == 0x9A && b[8] == 0x3C && b[15] == 0x9A) {
7002 /* double double 128-bit fully big-endian,
7003 * big-endian doubles in big-endian order,
7004 * e.g. PPC/Power and MIPS:
7005 * bf b9 99 99 99 99 99 9a 3c 59 99 99 99 99 99 9a */
7009 if (b[0] == 0x9A && b[7] == 0xBF && b[8] == 0x9A && b[15] == 0x3C) {
7010 /* double double 128-bit mixed endian.
7011 * little-endian doubles in big-endian order,
7013 * 9a 99 99 99 99 99 b9 bf 9a 99 99 99 99 99 59 3c */
7017 if (b[0] == 0x3C && b[7] == 0x9A && b[8] == 0xBF && b[15] == 0x9A) {
7018 /* double double 128-bit mixed endian,
7019 * big-endian doubles in little-endian order,
7020 * 3c 59 99 99 99 99 99 9a bf b9 99 99 99 99 99 9a */
7025 printf("-1\n"); /* unknown */
7030 if eval $compile; then
7031 longdblkind=`$run ./try`
7038 case "$longdblkind" in
7039 0) echo "Your long doubles are doubles." >&4 ;;
7040 1) echo "You have IEEE 754 128-bit little endian long doubles." >&4 ;;
7041 2) echo "You have IEEE 754 128-bit big endian long doubles." >&4 ;;
7042 3) echo "You have x86 80-bit little endian long doubles." >& 4 ;;
7043 4) echo "You have x86 80-bit big endian long doubles." >& 4 ;;
7044 5) echo "You have 128-bit fully little-endian double-double long doubles (64-bit LEs in LE)." >& 4 ;;
7045 6) echo "You have 128-bit fully big-endian double-double long doubles (64-bit BEs in BE)." >& 4 ;;
7046 7) echo "You have 128-bit mixed double-double long doubles (64-bit LEs in BE)." >& 4 ;;
7047 8) echo "You have 128-bit mixed double-double long doubles (64-bit BEs in LE)." >& 4 ;;
7048 *) echo "Cannot figure out your long double." >&4 ;;
7052 : determine the architecture name
7054 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
7055 tarch=`arch`"-$osname"
7056 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
7057 if uname -m > tmparch 2>&1 ; then
7058 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
7059 -e 's/$/'"-$osname/" tmparch`
7067 case "$myarchname" in
7070 echo "(Your architecture name used to be $myarchname.)"
7074 case "$targetarch" in
7076 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
7081 *) dflt="$archname";;
7083 rp='What is your architecture name'
7087 : optionally add API version to the architecture for versioned archlibs
7088 case "$useversionedarchname" in
7089 $define|true|[yY]*) dflt='y';;
7092 rp='Add the Perl API version to your archname?'
7095 y|Y) useversionedarchname="$define" ;;
7096 *) useversionedarchname="$undef" ;;
7098 case "$useversionedarchname" in
7101 *-$api_versionstring)
7102 echo "...and architecture name already has -$api_versionstring" >&4
7105 archname="$archname-$api_versionstring"
7106 echo "...setting architecture name to $archname." >&4
7112 case "$usethreads" in
7114 echo "Threads selected." >&4
7116 *-thread*) echo "...and architecture name already has -thread." >&4
7118 *) archname="$archname-thread"
7119 echo "...setting architecture name to $archname." >&4
7124 case "$usemultiplicity" in
7126 echo "Multiplicity selected." >&4
7128 *-multi*) echo "...and architecture name already has -multi." >&4
7130 *) archname="$archname-multi"
7131 echo "...setting architecture name to $archname." >&4
7136 case "$use64bitint$use64bitall" in
7138 case "$archname64" in
7140 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
7143 case "$use64bitint" in
7144 "$define") echo "64 bit integers selected." >&4 ;;
7146 case "$use64bitall" in
7147 "$define") echo "Maximal 64 bitness selected." >&4 ;;
7150 *-$archname64*) echo "...and architecture name already has $archname64." >&4
7152 *) archname="$archname-$archname64"
7153 echo "...setting architecture name to $archname." >&4
7159 case "$uselongdouble" in
7161 echo "Long doubles selected." >&4
7162 case "$longdblsize" in
7164 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
7168 *-ld*) echo "...and architecture name already has -ld." >&4
7170 *) archname="$archname-ld"
7171 echo "...setting architecture name to $archname." >&4
7178 case "$usequadmath" in
7180 echo "quadmath selected." >&4
7182 *-ld*) echo "...and architecture name already has -quadmath." >&4
7184 *) archname="$archname-quadmath"
7185 echo "...setting architecture name to $archname." >&4
7190 if $test -f archname.cbu; then
7191 echo "Your platform has some specific hints for architecture name, using them..."
7195 : set the prefixit variable, to compute a suitable default value
7196 prefixit='case "$3" in
7198 case "$oldprefix" in
7199 "") eval "$1=\"\$$2\"";;
7206 ""|" ") eval "$1=\"\$$2\"";;
7212 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
7214 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
7215 /*-$oldprefix/*|\~*-$oldprefix/*)
7216 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
7217 *) eval "$1=\"\$$2\"";;
7221 : determine installation style
7222 : For now, try to deduce it from prefix unless it is already set.
7223 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
7224 case "$installstyle" in
7225 '') case "$prefix" in
7226 *perl*) dflt='lib';;
7227 *) dflt='lib/perl5' ;;
7230 *) dflt="$installstyle" ;;
7232 : Probably not worth prompting for this since we prompt for all
7233 : the directories individually, and the prompt would be too long and
7237 : determine where public executables go
7242 rp='Pathname where the public executables will reside?'
7244 if $test "X$ansexp" != "X$binexp"; then
7248 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
7249 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
7250 : this via initialinstalllocation
7253 case "$userelocatableinc" in
7254 $define|true|[yY]*) dflt='y' ;;
7259 Would you like to build Perl so that the installation is relocatable, so that
7260 library paths in @INC are determined relative to the path of the perl binary?
7261 This is not advised for system Perl installs, or if you need to run setid
7262 scripts or scripts under taint mode.
7264 If this doesn't make any sense to you, just accept the default '$dflt'.
7266 rp='Use relocatable @INC?'
7269 y|Y) val="$define" ;;
7272 set userelocatableinc
7275 initialinstalllocation="$binexp"
7276 : Default prefix is now "up one level from where the binaries are"
7277 case "$userelocatableinc" in
7283 installprefixexp=".../.."
7287 : determine where private library files go
7288 : Usual default is /usr/local/lib/perl5/$version.
7289 : Also allow things like /opt/perl/lib/$version, since
7290 : /opt/perl/lib/perl5... would be redundant.
7291 : The default "style" setting is made in installstyle.U
7292 case "$installstyle" in
7293 *lib/perl5*) set dflt privlib lib/$package/$version ;;
7294 *) set dflt privlib lib/$version ;;
7299 There are some auxiliary files for $package that need to be put into a
7300 private library directory that is accessible by everyone.
7305 rp='Pathname where the private library files will reside?'
7310 : set the prefixup variable, to restore leading tilda escape
7311 prefixup='case "$prefixexp" in
7313 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
7316 : determine where public architecture dependent libraries go
7319 : privlib default is /usr/local/lib/$package/$version
7320 : archlib default is /usr/local/lib/$package/$version/$archname
7321 : privlib may have an optional trailing /share.
7322 tdflt=`echo $privlib | $sed 's,/share$,,'`
7323 tdflt=$tdflt/$archname
7332 $spackage contains architecture-dependent library files. If you are
7333 sharing libraries in a heterogeneous environment, you might store
7334 these files in a separate location. Otherwise, you can just include
7335 them with the rest of the public library files.
7340 rp='Where do you want to put the public architecture-dependent libraries?'
7344 if $test X"$archlib" = X"$privlib"; then
7350 : see if setuid scripts can be secure
7353 Some kernels have a bug that prevents setuid #! scripts from being
7354 secure. Some sites have disabled setuid #! scripts because of this.
7356 First let's decide if your kernel supports secure setuid #! scripts.
7357 (If setuid #! scripts would be secure but have been disabled anyway,
7358 don't say that they are secure if asked.)
7363 if $test -d /dev/fd; then
7364 echo "#!$ls" >reflect
7365 chmod +x,u+s reflect
7366 ./reflect >flect 2>&1
7367 if $contains "/dev/fd" flect >/dev/null; then
7368 echo "Congratulations, your kernel has secure setuid scripts!" >&4
7372 If you are not sure if they are secure, I can check but I'll need a
7373 username and password different from the one you are using right now.
7374 If you don't have such a username or don't want me to test, simply
7378 rp='Other username to test security of setuid scripts with?'
7383 case "$d_suidsafe" in
7384 '') echo "I'll assume setuid scripts are *not* secure." >&4
7387 echo "Well, the $hint value is *not* secure." >&4
7389 *) echo "Well, the $hint value *is* secure." >&4
7394 $rm -f reflect flect
7395 echo "#!$ls" >reflect
7396 chmod +x,u+s reflect
7399 echo '"su" will (probably) prompt you for '"$ans's password."
7400 su $ans -c './reflect >flect'
7401 if $contains "/dev/fd" flect >/dev/null; then
7402 echo "Okay, it looks like setuid scripts are secure." >&4
7405 echo "I don't think setuid scripts are secure." >&4
7410 rp='Does your kernel have *secure* setuid scripts?'
7413 [yY]*) val="$define";;
7418 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
7419 echo "(That's for file descriptors, not floppy disks.)"
7425 $rm -f reflect flect
7427 : now see if they want to do setuid emulation
7428 if $test $patchlevel -lt 11; then
7431 case "$d_suidsafe" in
7434 echo "No need to emulate SUID scripts since they are secure here." >&4
7438 Some systems have disabled setuid scripts, especially systems where
7439 setuid scripts cannot be secure. On systems where setuid scripts have
7440 been disabled, the setuid/setgid bits on scripts are currently
7441 useless. It is possible for $package to detect those bits and emulate
7442 setuid/setgid in a secure fashion. This emulation will only work if
7443 setuid scripts have been disabled in your kernel.
7447 "$define") dflt=y ;;
7450 rp="Do you want to do setuid/setgid emulation?"
7453 [yY]*) val="$define";;
7465 SUID emulation has been removed for 5.12
7466 Please re-run Configure without -Dd_dosuid
7475 : Find perl5.005 or later.
7476 echo "Looking for a previously installed perl5.005 or later... "
7478 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
7479 : Check if this perl is recent and can load a simple module
7480 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
7483 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
7493 '') echo "None found. That's ok.";;
7494 *) echo "Using $perl5." ;;
7497 : Set the siteprefix variables
7500 After $package is installed, you may wish to install various
7501 add-on modules and utilities. Typically, these add-ons will
7502 be installed under $prefix with the rest
7503 of this package. However, you may wish to install such add-ons
7504 elsewhere under a different prefix.
7506 If you do not wish to put everything under a single prefix, that's
7507 ok. You will be prompted for the individual locations; this siteprefix
7508 is only used to suggest the defaults.
7510 The default should be fine for most people.
7514 rp='Installation prefix to use for add-on modules and utilities?'
7515 : XXX Here might be another good place for an installstyle setting.
7516 case "$siteprefix" in
7518 *) dflt=$siteprefix ;;
7521 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
7523 case "$siteprefix" in
7527 *) oldsiteprefix="$prefix";;
7532 siteprefixexp="$ansexp"
7534 : determine where site specific libraries go.
7535 : Usual default is /usr/local/lib/perl5/site_perl/$version
7536 : The default "style" setting is made in installstyle.U
7537 : XXX No longer works with Prefixit stuff.
7538 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7540 '') case "$installstyle" in
7541 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
7542 *) dflt=$siteprefix/lib/site_$prog/$version ;;
7550 The installation process will create a directory for
7551 site-specific extensions and modules. Most users find it convenient
7552 to place all site-specific files in this directory rather than in the
7553 main distribution directory.
7557 rp='Pathname for the site-specific library files?'
7561 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
7563 : Determine list of previous versions to include in @INC
7564 $cat > getverlist <<EOPL
7567 \$api_versionstring = "$api_versionstring";
7568 \$version = "$version";
7569 \$stem = "$sitelib_stem";
7570 \$archname = "$archname";
7572 $cat >> getverlist <<'EOPL'
7573 # The list found is store twice for each entry: the original name, and
7574 # the binary broken down version as pack "sss", so sorting is easy and
7575 # unambiguous. This will work for all versions that have a maximum of
7576 # three digit groups, separate by '.'s or '_'s. Names are extended with
7577 # ".0.0" to ensure at least three elements for the pack.
7578 # -- H.Merijn Brand (m)'06 23-10-2006
7580 # Can't have leading @ because metaconfig interprets it as a command!
7581 ;@inc_version_list=();
7582 # XXX Redo to do opendir/readdir?
7585 ;@candidates = map {
7586 [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
7587 ;@candidates = sort { $a->[1] cmp $b->[1]} @candidates;
7593 ($pversion, $aversion, $vsn5005) = map {
7594 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
7595 foreach $d (@candidates) {
7596 if ($d->[1] lt $pversion) {
7597 if ($d->[1] ge $aversion) {
7598 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
7600 elsif ($d->[1] ge $vsn5005) {
7601 unshift(@inc_version_list, grep { -d } $d->[0]);
7605 # Skip newer version. I.e. don't look in
7606 # 5.7.0 if we're installing 5.6.1.
7610 if (@inc_version_list) {
7611 print join(' ', @inc_version_list);
7614 # Blank space to preserve value for next Configure run.
7619 case "$inc_version_list" in
7620 '') if test -x "$perl5$exe_ext"; then
7621 dflt=`$perl5 getverlist`
7626 $undef) dflt='none' ;;
7627 *) eval dflt=\"$inc_version_list\" ;;
7630 ''|' ') dflt=none ;;
7637 In order to ease the process of upgrading, this version of perl
7638 can be configured to use modules built and installed with earlier
7639 versions of perl that were installed under $prefix. Specify here
7640 the list of earlier versions that this version of perl should check.
7641 If Configure detected no earlier versions of perl installed under
7642 $prefix, then the list will be empty. Answer 'none' to tell perl
7643 to not search earlier versions.
7645 The default should almost always be sensible, so if you're not sure,
7646 just accept the default.
7649 rp='List of earlier versions to include in @INC?'
7652 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
7653 *) inc_version_list="$ans" ;;
7655 case "$inc_version_list" in
7657 inc_version_list_init='0'
7658 d_inc_version_list="$undef"
7660 *) inc_version_list_init=`echo $inc_version_list |
7661 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
7662 d_inc_version_list="$define"
7667 : see if malloc/malloc.h has to be included
7668 set malloc/malloc.h i_mallocmalloc
7671 : see if this is a malloc.h system
7672 : we want a real compile instead of Inhdr because some systems have a
7673 : malloc.h that just gives a compile error saying to use stdlib.h instead
7678 #$i_mallocmalloc I_MALLOCMALLOC
7679 #ifdef I_MALLOCMALLOC
7680 # include <malloc/malloc.h>
7683 int main () { return 0; }
7686 if eval $compile; then
7687 echo "<malloc.h> found." >&4
7690 echo "<malloc.h> NOT found." >&4
7697 : check for length of pointer
7701 echo "Checking to see how big your pointers are..." >&4
7710 printf("%d\n", (int)sizeof(void *));
7715 if eval $compile_ok; then
7716 ptrsize=`$run ./try`
7717 echo "Your pointers are $ptrsize bytes long."
7720 echo "(I can't seem to compile the test program. Guessing...)" >&4
7721 rp="What is the size of a pointer (in bytes)?"
7728 case "$use64bitall" in
7729 "$define"|true|[yY]*)
7733 *** You have chosen a maximally 64-bit build,
7734 *** but your pointers are only 4 bytes wide.
7735 *** Please rerun Configure without -Duse64bitall.
7740 *** Since you have quads, you could possibly try with -Duse64bitint.
7745 *** Cannot continue, aborting.
7756 : determine whether to use malloc wrapping
7758 case "$usemallocwrap" in
7759 [yY]*|true|$define) dflt='y' ;;
7760 [nN]*|false|$undef) dflt='n' ;;
7761 *) case "$usedevel" in
7762 [yY]*|true|$define) dflt='y' ;;
7767 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
7769 usemallocwrap="$ans"
7772 usemallocwrap="$define" ;;
7774 usemallocwrap="$undef" ;;
7777 : determine which malloc to compile in
7779 case "$usemymalloc" in
7780 [yY]*|true|$define) dflt='y' ;;
7781 [nN]*|false|$undef) dflt='n' ;;
7782 *) case "$ptrsize" in
7786 if test "$useithreads" = "$define"; then dflt='n'; fi
7789 rp="Do you wish to attempt to use the malloc that comes with $package?"
7795 mallocsrc='malloc.c'
7796 mallocobj="malloc$_o"
7797 d_mymalloc="$define"
7800 : Remove malloc from list of libraries to use
7801 echo "Removing unneeded -lmalloc from library list" >&4
7802 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
7805 echo "libs = $libs" >&4
7817 : compute the return types of malloc and free
7819 $cat >malloc.c <<END
7823 #include <sys/types.h>
7837 case "$malloctype" in
7839 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
7846 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
7850 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
7857 echo "Your system uses $freetype free(), it would seem." >&4
7859 : determine where site specific architecture-dependent libraries go.
7860 : sitelib default is /usr/local/lib/perl5/site_perl/$version
7861 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
7862 : sitelib may have an optional trailing /share.
7864 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
7865 dflt="$dflt/$archname"
7870 set sitearch sitearch none
7874 The installation process will also create a directory for
7875 architecture-dependent site-specific extensions and modules.
7879 rp='Pathname for the site-specific architecture-dependent library files?'
7883 if $test X"$sitearch" = X"$sitelib"; then
7886 d_sitearch="$define"
7889 : Set the vendorprefix variables
7892 The installation process will also create a directory for
7893 vendor-supplied add-ons. Vendors who supply perl with their system
7894 may find it convenient to place all vendor-supplied files in this
7895 directory rather than in the main distribution directory. This will
7896 ease upgrades between binary-compatible maintenance versions of perl.
7898 Of course you may also use these directories in whatever way you see
7899 fit. For example, you might use them to access modules shared over a
7900 company-wide network.
7902 The default answer should be fine for most people.
7903 This causes further questions about vendor add-ons to be skipped
7904 and no vendor-specific directories will be configured for perl.
7907 rp='Do you want to configure vendor-specific add-on directories?'
7908 case "$usevendorprefix" in
7909 define|true|[yY]*) dflt=y ;;
7910 *) : User may have set vendorprefix directly on Configure command line.
7911 case "$vendorprefix" in
7920 rp='Installation prefix to use for vendor-supplied add-ons?'
7921 case "$vendorprefix" in
7922 '') dflt="$prefix" ;;
7923 *) dflt=$vendorprefix ;;
7926 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
7928 case "$vendorprefix" in
7932 *) oldvendorprefix="$prefix";;
7936 usevendorprefix="$define"
7938 vendorprefixexp="$ansexp"
7940 *) usevendorprefix="$undef"
7946 : Set the vendorlib variables
7947 case "$vendorprefix" in
7948 '') d_vendorlib="$undef"
7952 *) d_vendorlib="$define"
7953 : determine where vendor-supplied modules go.
7954 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
7955 case "$vendorlib" in
7957 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7958 case "$installstyle" in
7959 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
7960 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
7963 *) dflt="$vendorlib"
7967 rp='Pathname for the vendor-supplied library files?'
7970 vendorlibexp="$ansexp"
7973 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
7977 : Set the vendorarch variables
7978 case "$vendorprefix" in
7979 '') d_vendorarch="$undef"
7983 *) d_vendorarch="$define"
7984 : determine where vendor-supplied architecture-dependent libraries go.
7985 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
7986 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
7987 : vendorlib may have an optional trailing /share.
7988 case "$vendorarch" in
7989 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
7990 dflt="$dflt/$archname"
7992 *) dflt="$vendorarch" ;;
7995 rp='Pathname for vendor-supplied architecture-dependent files?'
7998 vendorarchexp="$ansexp"
8001 prefixvar=vendorarch
8003 if $test X"$vendorarch" = X"$vendorlib"; then
8004 d_vendorarch="$undef"
8006 d_vendorarch="$define"
8009 : Final catch-all directories to search
8012 Lastly, you can have perl look in other directories for extensions and
8013 modules in addition to those already specified.
8014 These directories will be searched after
8018 test X"$vendorlib" != "X" && echo ' ' $vendorlib
8019 test X"$vendorarch" != "X" && echo ' ' $vendorarch
8021 case "$otherlibdirs" in
8022 ''|' ') dflt='none' ;;
8023 *) dflt="$otherlibdirs" ;;
8026 Enter a colon-separated set of extra paths to include in perl's @INC
8027 search path, or enter 'none' for no extra paths.
8031 rp='Colon-separated list of additional directories for perl to search?'
8034 ' '|''|none) otherlibdirs=' ' ;;
8035 *) otherlibdirs="$ans" ;;
8037 case "$otherlibdirs" in
8041 set d_perl_otherlibdirs
8044 : Cruising for prototypes
8046 echo "Checking out function prototypes..." >&4
8047 $cat >prototype.c <<EOCP
8052 int main(int argc, char *argv[]) {
8055 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
8056 echo "Your C compiler appears to support function prototypes."
8059 echo "Your C compiler doesn't seem to understand function prototypes."
8066 : Check if ansi2knr is required
8067 case "$prototype" in
8069 *) ansi2knr='ansi2knr'
8074 This version of $package can only be compiled by a compiler that
8075 understands function prototypes. Unfortunately, your C compiler
8077 doesn't seem to understand them. Sorry about that.
8079 If GNU cc is available for your system, perhaps you could try that instead.
8081 Eventually, we hope to support building Perl with pre-ANSI compilers.
8082 If you would like to help in that effort, please contact <perlbug@perl.org>.
8084 Aborting Configure now.
8091 dflt_dtrace='/usr/sbin/dtrace'
8092 $test -x /usr/bin/dtrace && dflt_dtrace='/usr/bin/dtrace'
8096 Perl can be built to support DTrace on platforms that support it.
8097 DTrace is a diagnosis and performance analysis tool from Sun.
8099 If this doesn't make any sense to you, just accept the default.
8103 case "$usedtrace" in
8109 dflt_dtrace=$usedtrace
8116 rp='Support DTrace if available?'
8119 y|Y) val="$define" ;;
8125 test "X$usedtrace" != "X$define" && break
8128 rp='Where is the dtrace executable?'
8137 if $dtrace -h -s ../perldtrace.d \
8138 -o perldtrace.tmp >/dev/null 2>&1 \
8139 && rm -f perldtrace.tmp
8142 echo "Good: your $dtrace knows about the -h flag."
8146 *** $me: Fatal Error: $dtrace doesn't support -h flag
8148 *** Your installed dtrace doesn't support the -h switch to compile a D
8149 *** program into a C header. Can't continue.
8161 *** $me: Fatal Error: $dtrace not found.
8168 echo "*** $dtrace was not found."
8174 : See if we want extra modules installed
8181 Perl can be built with extra modules or bundles of modules which
8182 will be fetched from the CPAN and installed alongside Perl.
8184 Notice that you will need access to the CPAN; either via the Internet,
8185 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
8186 be asked later to configure the CPAN.pm module which will in turn do
8187 the installation of the rest of the extra modules or bundles.)
8189 Notice also that if the modules require any external software such as
8190 libraries and headers (the libz library and the zlib.h header for the
8191 Compress::Zlib module, for example) you MUST have any such software
8192 already installed, this configuration process will NOT install such
8195 If this doesn't make any sense to you, just accept the default '$dflt'.
8197 rp='Install any extra modules (y or n)?'
8203 Please list any extra modules or bundles to be installed from CPAN,
8204 with spaces between the names. The names can be in any format the
8205 'install' command of CPAN.pm will understand. (Answer 'none',
8206 without the quotes, to install no extra modules or bundles.)
8216 $rm -f ../extras.lst
8218 *) echo "(Saving the list of extras for later...)"
8219 echo "$extras" > ../extras.lst
8227 : determine where html pages for programs go
8228 set html1dir html1dir none
8232 If you wish to install html files for programs in $spackage, indicate
8233 the appropriate directory here. To skip installing html files,
8237 ''|none|$undef|' ') dflt=none ;;
8238 *) dflt=$html1dir ;;
8241 rp="Directory for the main $spackage html pages?"
8245 : Use ' ' for none so value is preserved next time through Configure
8246 $test X"$html1dir" = "X" && html1dir=' '
8248 : determine where html pages for libraries and modules go
8249 set html3dir html3dir none
8253 If you wish to install html files for modules associated with $spackage,
8254 indicate the appropriate directory here. To skip installing html files,
8257 : There is no obvious default. If they have specified html1dir, then
8258 : try to key off that, possibly changing .../html1 into .../html3.
8260 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
8261 *) dflt=$html3dir ;;
8264 rp="Directory for the $spackage module html pages?"
8268 : Use ' ' for none so value is preserved next time through Configure
8269 $test X"$html3dir" = "X" && html3dir=' '
8271 : determine whether to install perl also as /usr/bin/perl
8274 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
8276 Many scripts expect perl to be installed as /usr/bin/perl.
8278 If you want to, I can install the perl you are about to compile
8279 as /usr/bin/perl (in addition to $bin/perl).
8281 if test -f /usr/bin/perl; then
8284 However, please note that because you already have a /usr/bin/perl,
8285 overwriting that with a new Perl would very probably cause problems.
8286 Therefore I'm assuming you don't want to do that (unless you insist).
8289 case "$installusrbinperl" in
8290 "$define"|[yY]*) dflt='y';;
8296 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
8299 case "$installusrbinperl" in
8300 "$undef"|[nN]*) dflt='n';;
8304 rp="Do you want to install perl as /usr/bin/perl?"
8307 [yY]*) val="$define";;
8313 set installusrbinperl
8316 : see if dlopen exists
8318 xxx_ccflags="$ccflags"
8320 : with g++ one needs -shared to get is-in-libc to work for dlopen
8321 case "$gccversion" in
8324 *) case "$d_cplusplus" in
8325 "$define") ccflags="$ccflags -shared" ;;
8332 ccflags="$xxx_ccflags"
8334 : see if this is a unistd.h system
8335 set unistd.h i_unistd
8338 : determine which dynamic loading, if any, to compile in
8340 dldir="ext/DynaLoader"
8353 $define) dflt='y' ;;
8355 : Does a dl_xxx.xs file exist for this operating system
8356 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
8359 rp="Do you wish to use dynamic loading?"
8366 '') if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
8367 dflt="$dldir/dl_${osname}.xs"
8368 elif $test "$d_dlopen" = "$define" ; then
8369 dflt="$dldir/dl_dlopen.xs"
8374 *) dflt="$dldir/$dlsrc"
8377 echo "The following dynamic loading files are available:"
8378 : Can not go over to $dldir because getfile has path hard-coded in.
8379 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
8380 rp="Source file to use for dynamic loading"
8386 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
8390 Some systems may require passing special flags to $cc -c to
8391 compile modules that will be used to create a shared library.
8392 To use no flags, say "none".
8395 case "$cccdlflags" in
8396 '') case "$gccversion" in
8397 '') case "$osname" in
8399 irix*) dflt='-KPIC' ;;
8400 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
8401 sunos) dflt='-pic' ;;
8405 *) case "$osname" in
8406 darwin) dflt='none' ;;
8407 *linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
8412 *) dflt="$cccdlflags" ;;
8419 # If -Dsysroot was specified, now's the time to add it
8421 if test "X$sysroot" != X; then
8422 case "$gccversion" in
8427 dflt="$dflt --sysroot=$sysroot" ;;
8437 rp="Any special flags to pass to $cc -c to compile shared library modules?"
8440 none) cccdlflags=' ' ;;
8441 *) cccdlflags="$ans" ;;
8446 Some systems use ld to create libraries that can be dynamically loaded,
8447 while other systems (such as those using ELF) use $cc.
8451 : Determine if this is ELF
8453 /* Test for whether ELF binaries are produced */
8465 int i = open("a.out",O_RDONLY);
8468 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
8469 exit(0); /* succeed (yes, it is ELF) */
8473 if $cc $ccflags $ldflags -o a.out try.c >/dev/null 2>&1 && $run ./a.out; then
8479 '') if $test $bin_ELF = "$define"; then
8481 You appear to have ELF support. I'll use $cc to build dynamic libraries.
8485 echo "I'll use ld to build dynamic libraries."
8493 rp="What command should be used to create dynamic libraries?"
8499 Some systems may require passing special flags to $ld to create a
8500 library that can be dynamically loaded. If your ld flags include
8501 -L/other/path options to locate libraries outside your loader's normal
8502 search path, you may need to specify those -L options here as well. To
8503 use no flags, say "none".
8506 case "$lddlflags" in
8507 '') case "$osname" in
8508 haiku) dflt='-shared' ;;
8510 case "$gccversion" in
8511 '') dflt="$dflt +vnocompatwarnings" ;;
8514 *linux*|irix*|gnu*) dflt="-shared $optimize" ;;
8515 solaris) # See [perl #66604].
8516 # On Solaris 11, gcc -m64 on amd64
8517 # appears not to understand -G. gcc versions at
8518 # least as old as 3.4.3 support -shared, so just
8519 # use that with Solaris 11 and later, but keep
8520 # the old behavior for older Solaris versions.
8521 case "$gccversion" in
8523 *) case "$osvers" in
8524 2.?|2.10) dflt='-G' ;;
8525 *) dflt='-shared' ;;
8530 sunos) dflt='-assert nodefinitions' ;;
8531 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
8535 *) dflt="$lddlflags" ;;
8538 : Only do this for gcc, since, for example, qcc has no concept
8540 if $test "X$sysroot" != X; then
8541 case "$gccversion" in
8543 *) dflt="$dflt --sysroot $sysroot" ;;
8547 : Try to guess additional flags to pick up local libraries.
8548 : Be careful not to append to a plain 'none'
8552 for thisflag in $ldflags; do
8557 *) dflt="$dflt $thisflag" ;;
8564 ''|' ') dflt='none' ;;
8568 *-fstack-protector-strong*)
8570 *-fstack-protector-strong*) ;; # Don't add it again
8571 *) dflt="$dflt -fstack-protector-strong" ;;
8574 *-fstack-protector*)
8576 *-fstack-protector*) ;; # Don't add it again
8577 *) dflt="$dflt -fstack-protector" ;;
8582 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
8585 none) lddlflags=' ' ;;
8586 *) lddlflags="$ans" ;;
8591 Some systems may require passing special flags to $cc to indicate that
8592 the resulting executable will use dynamic linking. To use no flags,
8596 case "$ccdlflags" in
8597 '') case "$osname" in
8598 *linux*|hpux|gnu*) dflt='-Wl,-E' ;;
8599 sunos) dflt='none' ;;
8603 *) dflt="$ccdlflags" ;;
8605 rp="Any special flags to pass to $cc to use dynamic linking?"
8608 none) ccdlflags=' ' ;;
8609 *) ccdlflags="$ans" ;;
8621 ld_can_script="$undef"
8622 case "$bin_ELF$usedl" in
8624 # Abuse try.h and a.out names for neat cleanup
8636 if $cc $cccdlflags $ccdlflags $ccflags \
8637 $ldflags $lddlflags -o a.out try.c \
8638 -Wl,--version-script=try.h >/dev/null 2>&1 \
8639 && $test -s a.out ; then
8640 echo "ld supports scripting" >&4
8641 ld_can_script="$define"
8643 echo "ld does not support scripting" >&4
8649 : Do we want a shared libperl?
8653 # No dynamic loading being used, so don't bother even to prompt.
8656 *) case "$useshrplib" in
8657 '') case "$osname" in
8658 svr4*|nonstopux|dgux|dynixptx|esix|powerux|haiku|cygwin*)
8660 also='Building a shared libperl is required for dynamic loading to work on your system.'
8674 The perl executable is normally obtained by linking perlmain.c with
8675 libperl${_a}, any static extensions (usually just DynaLoader), and
8676 any other libraries needed on this system (such as -lm, etc.). Since
8677 your system supports dynamic loading, it is probably possible to build
8678 a shared libperl.$so. If you will have more than one executable linked
8679 to libperl.$so, this will significantly reduce the size of each
8680 executable, but it may have a noticeable effect on performance. The
8681 default is probably sensible for your system.
8685 rp="Build a shared libperl.$so (y/n)"
8689 useshrplib='true' ;;
8690 *) useshrplib='false' ;;
8695 case "$useshrplib" in
8697 case "$userelocatableinc" in
8699 echo "Cannot build with both -Duserelocatableinc and -Duseshrplib" >&4
8700 echo "See INSTALL for an explanation why that won't work." >&4
8706 # Figure out a good name for libperl.so. Since it gets stored in
8707 # a version-specific architecture-dependent library, the version
8708 # number isn't really that important, except for making cc/ld happy.
8710 # A name such as libperl.so.10.1
8711 majmin="libperl.$so.$patchlevel.$subversion"
8712 # A name such as libperl.so.100
8713 majonly=`echo $patchlevel $subversion |
8714 $awk '{printf "%d%02d", $1, $2}'`
8715 majonly=libperl.$so.$majonly
8716 # I'd prefer to keep the os-specific stuff here to a minimum, and
8717 # rely on figuring it out from the naming of libc.
8718 case "${osname}${osvers}" in
8719 *linux*|gnu*) # ld won't link with a bare -lperl otherwise.
8722 cygwin*) # ld links now against the dll directly
8723 majmin="cygperl5_${patchlevel}_${subversion}.${so}"
8724 majonly=`echo $patchlevel $subversion |
8725 $awk '{printf "%03d%03d", $1, $2}'`
8726 majonly=cygperl5.$majonly.$so
8729 *) # Try to guess based on whether libc has major.minor.
8731 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8732 *libc.$so.[0-9]*) dflt=$majonly ;;
8733 *) dflt=libperl.$so ;;
8743 I need to select a good name for the shared libperl. If your system uses
8744 library names with major and minor numbers, then you might want something
8745 like $majmin. Alternatively, if your system uses a single version
8746 number for shared libraries, then you might want to use $majonly.
8747 Or, your system might be quite happy with a simple libperl.$so.
8749 Since the shared libperl will get installed into a version-specific
8750 architecture-dependent directory, the version number of the shared perl
8751 library probably isn't important, so the default should be o.k.
8754 rp='What name do you want to give to the shared libperl?'
8757 echo "Ok, I'll use $libperl"
8760 libperl="libperl${_a}"
8764 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8768 WARNING: Use of the shrpdir variable for the installation location of
8769 the shared $libperl is not supported. It was never documented and
8770 will not work in this version. Let me (perlbug@perl.org)
8771 know of any problems this may cause.
8777 But your current setting of $shrpdir is
8778 the default anyway, so it's harmless.
8783 Further, your current attempted setting of $shrpdir
8784 conflicts with the value of $archlibexp/CORE
8785 that installperl will use.
8792 # How will the perl executable find the installed shared $libperl?
8793 # Add $xxx to ccdlflags.
8794 # If we can't figure out a command-line option, use $shrpenv to
8795 # set env LD_RUN_PATH. The main perl makefile uses this.
8796 shrpdir=$archlibexp/CORE
8799 if "$useshrplib"; then
8802 # We'll set it in Makefile.SH...
8807 freebsd|mirbsd|netbsd|openbsd|interix|dragonfly|bitrig)
8808 xxx="-Wl,-R$shrpdir"
8810 bsdos|linux|irix*|dec_osf|gnu*|haiku)
8811 xxx="-Wl,-rpath,$shrpdir"
8814 # hpux doesn't like the default, either.
8815 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8818 # cygwin needs only ldlibpth
8821 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8827 # Only add $xxx if it isn't already in ccdlflags.
8828 case " $ccdlflags " in
8830 *) ccdlflags="$ccdlflags $xxx"
8833 Adding $xxx to the flags
8834 passed to $ld so that the perl executable will find the
8835 installed shared $libperl.
8843 # Fix ccdlflags in AIX for building external extensions.
8844 # (For building Perl itself bare -bE:perl.exp is needed,
8845 # Makefile.SH takes care of this.)
8847 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8849 # Respect a hint or command-line value.
8851 '') shrpenv="$tmp_shrpenv" ;;
8853 case "$ldlibpthname" in
8854 '') ldlibpthname=LD_LIBRARY_PATH ;;
8855 none) ldlibpthname='' ;;
8858 : determine where manual pages are on this system
8862 syspath='/usr/share/man/man1 /usr/man/man1'
8863 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8864 syspath="$syspath /usr/man/u_man/man1"
8865 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8866 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8867 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8868 sysman=`./loc . /usr/man/man1 $syspath`
8871 if $test -d "$sysman"; then
8872 echo "System manual is in $sysman." >&4
8874 echo "Could not find manual pages in source form." >&4
8877 : determine where manual pages go
8878 set man1dir man1dir none
8882 $spackage has manual pages available in source form.
8886 echo "However, you don't have nroff, so they're probably useless to you."
8888 '') man1dir="none";;
8891 echo "If you don't want the manual sources installed, answer 'none'."
8896 lookpath="$prefixexp/share/man/man1"
8897 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8898 lookpath="$lookpath $prefixexp/man/p_man/man1"
8899 lookpath="$lookpath $prefixexp/man/u_man/man1"
8900 lookpath="$lookpath $prefixexp/man/man.1"
8902 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8903 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8913 rp="Where do the main $spackage manual pages (source) go?"
8915 if $test "X$man1direxp" != "X$ansexp"; then
8926 : What suffix to use on installed man pages
8933 rp="What suffix should be used for the main $spackage man pages?"
8935 '') case "$man1dir" in
8949 *) dflt="$man1ext";;
8956 : see if we can have long filenames
8958 first=123456789abcdef
8960 if (echo hi >$first) 2>/dev/null; then
8961 if $test -f 123456789abcde; then
8962 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8965 echo 'You can have filenames longer than 14 characters.'>&4
8970 You can't have filenames longer than 14 chars.
8971 You can't even think about them!
8977 $rm -rf 123456789abcde*
8979 : determine where library module manual pages go
8980 set man3dir man3dir none
8984 $spackage has manual pages for many of the library modules.
8990 However, you don't have nroff, so they're probably useless to you.
8993 '') man3dir="none";;
8997 case "$d_flexfnam" in
9000 However, your system can't handle the long file names like File::Basename.3.
9003 '') man3dir="none";;
9007 echo "If you don't want the manual sources installed, answer 'none'."
9008 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
9010 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
9011 if $test -d "$privlib/man/man3"; then
9014 WARNING: Previous versions of perl installed man3 pages into
9015 $privlib/man/man3. This version will suggest a
9016 new default of $dflt.
9020 rp='Do you wish to preserve the old behavior?(y/n)'
9023 y*) dflt="$privlib/man/man3" ;;
9028 *) dflt="$man3dir" ;;
9035 rp="Where do the $package library man pages (source) go?"
9045 : What suffix to use on installed man pages
9051 rp="What suffix should be used for the $package library man pages?"
9053 '') case "$man3dir" in
9067 *) dflt="$man3ext";;
9074 : see if we have to deal with yellow pages, now NIS.
9075 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
9081 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
9089 rp='Are you getting the hosts file via yellow pages?'
9092 y*) hostcat='ypcat hosts';;
9093 *) hostcat='cat /etc/hosts';;
9099 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
9102 '') test -f /etc/group && groupcat='cat /etc/group';;
9105 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
9108 : now get the host name
9110 echo "Figuring out host name..." >&4
9111 case "$myhostname" in
9113 echo 'Maybe "hostname" will work...'
9114 if tans=`sh -c hostname 2>&1` ; then
9122 if $test "$cont"; then
9124 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
9125 if tans=`cat /etc/systemid 2>&1` ; then
9127 phostname='cat /etc/systemid'
9128 echo "Whadyaknow. Xenix always was a bit strange..."
9131 elif $test -r /etc/systemid; then
9132 echo "(What is a non-Xenix system doing with /etc/systemid?)"
9135 if $test "$cont"; then
9136 echo 'No, maybe "uuname -l" will work...'
9137 if tans=`sh -c 'uuname -l' 2>&1` ; then
9139 phostname='uuname -l'
9141 echo 'Strange. Maybe "uname -n" will work...'
9142 if tans=`sh -c 'uname -n' 2>&1` ; then
9144 phostname='uname -n'
9146 echo 'Oh well, maybe I can mine it out of whoami.h...'
9147 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
9148 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
9149 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
9151 case "$myhostname" in
9152 '') echo "Does this machine have an identity crisis or something?"
9155 echo "Well, you said $myhostname before..."
9156 phostname='echo $myhostname';;
9162 case "$myhostname" in
9163 '') myhostname=noname ;;
9165 : you do not want to know about this
9170 if $test "$myhostname" ; then
9172 rp='Your host name appears to be "'$myhostname'".'" Right?"
9180 : bad guess or no guess
9181 while $test "X$myhostname" = X ; do
9183 rp="Please type the (one word) name of your host:"
9188 : translate upper to lower if necessary
9189 case "$myhostname" in
9191 echo "(Normalizing case in your host name)"
9192 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
9196 case "$myhostname" in
9198 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
9199 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
9200 echo "(Trimming domain name from host name--host name is now $myhostname)"
9202 *) case "$mydomain" in
9205 test "X$hostcat" = "Xypcat hosts" &&
9206 ypmatch "$myhostname" hosts 2>/dev/null |\
9207 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
9210 test "X$hostcat" != "X" &&
9211 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
9212 /[ ]$myhostname[ . ]/p" > hosts
9215 if $test -f hosts; then
9216 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
9217 END { print sum }" hosts` = x1 || tmp_re="[ ]"
9218 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
9219 hosts | $sort | $uniq | \
9220 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
9221 case `$echo X$dflt` in
9222 X*\ *) echo "(Several hosts in the database matched hostname)"
9225 X.) echo "(You do not have fully-qualified names in the hosts database)"
9229 echo "(I cannot locate a hosts database anywhere)"
9234 tans=`./loc resolv.conf X /etc /usr/etc`
9235 if $test -f "$tans"; then
9236 echo "(Attempting domain name extraction from $tans)"
9237 dflt=.`$sed -n -e 's/ / /g' \
9238 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
9241 .) dflt=.`$sed -n -e 's/ / /g' \
9242 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
9250 .) echo "(No help from resolv.conf either -- attempting clever guess)"
9251 dflt=.`sh -c domainname 2>/dev/null`
9254 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
9258 case "$dflt$osname" in
9259 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
9260 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
9264 .) echo "(Lost all hope -- silly guess then)"
9270 *) dflt="$mydomain";;
9274 rp="What is your domain name?"
9284 : translate upper to lower if necessary
9287 echo "(Normalizing case in your domain name)"
9288 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
9292 : a little sanity check here
9293 case "$phostname" in
9296 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
9297 $myhostname$mydomain|$myhostname) ;;
9299 case "$phostname" in
9301 echo "(That doesn't agree with your whoami.h file, by the way.)"
9304 echo "(That doesn't agree with your $phostname command, by the way.)"
9312 : determine the e-mail address of the user who is running us
9315 I need to get your e-mail address in Internet format if possible, i.e.
9316 something like user@host.domain. Please answer accurately since I have
9317 no easy means to double check it. The default value provided below
9318 is most probably close to reality but may not be valid from outside
9319 your organization...
9323 while test "$cont"; do
9324 case "$MAILDOMAIN" in
9326 if $test -s /etc/mailname; then
9327 maildomain=`$cat /etc/mailname`
9329 maildomain="$myhostname$mydomain"
9332 *) maildomain="$MAILDOMAIN";;
9335 '') dflt="$cf_by@$maildomain";;
9336 *) dflt="$cf_email";;
9338 rp='What is your e-mail address?'
9344 rp='Address does not look like an Internet one. Use it anyway?'
9358 : Ask e-mail of administrator
9361 If you or somebody else will be maintaining perl at your site, please
9362 fill in the correct e-mail address here so that they may be contacted
9363 if necessary. Currently, the "perlbug" program included with perl
9364 will send mail to this address in addition to perlbug@perl.org. You may
9365 enter "none" for no administrator.
9368 case "$perladmin" in
9369 '') dflt="$cf_email";;
9370 *) dflt="$perladmin";;
9372 rp='Perl administrator e-mail address'
9376 : determine whether to only install version-specific parts.
9379 Do you want to install only the version-specific parts of the perl
9380 distribution? Usually you do *not* want to do this.
9382 case "$versiononly" in
9383 "$define"|[Yy]*|true) dflt='y' ;;
9386 rp="Do you want to install only the version-specific parts of perl?"
9389 [yY]*) val="$define";;
9395 case "$versiononly" in
9396 "$define") inc_version_list=''
9397 inc_version_list_init=0
9401 : figure out how to guarantee perl startup
9402 : XXX Note that this currently takes advantage of the bug that binexp ignores
9403 : the Configure -Dinstallprefix setting, which in turn means that under
9404 : relocatable @INC, initialinstalllocation is what binexp started as.
9405 case "$startperl" in
9407 case "$sharpbang" in
9411 I can use the #! construct to start perl on your system. This will
9412 make startup of perl scripts faster, but may cause problems if you
9413 want to share those scripts and perl is not in a standard place
9414 ($initialinstalllocation/perl) on all your platforms. The alternative
9415 is to force a shell by starting the script with a single ':' character.
9418 case "$versiononly" in
9419 "$define") dflt="$initialinstalllocation/perl$version";;
9420 *) dflt="$initialinstalllocation/perl";;
9422 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
9425 none) startperl=": # use perl";;
9426 *) startperl="#!$ans"
9427 if $test 30 -lt `echo "$ans" | wc -c`; then
9430 WARNING: Some systems limit the #! command to 32 characters.
9431 If you experience difficulty running Perl scripts with #!, try
9432 installing Perl in a directory with a shorter pathname.
9438 *) startperl=": # use perl"
9443 echo "I'll use $startperl to start perl scripts."
9445 : figure best path for perl in scripts
9448 case "$versiononly" in
9449 "$define") perlpath="$initialinstalllocation/perl$version";;
9450 *) perlpath="$initialinstalllocation/perl";;
9452 case "$startperl" in
9457 I will use the "eval 'exec'" idiom to start Perl on your system.
9458 I can use the full path of your Perl binary for this purpose, but
9459 doing so may cause problems if you want to share those scripts and
9460 Perl is not always in a standard place ($initialinstalllocation/perl).
9463 dflt="$initialinstalllocation/perl"
9464 rp="What path shall I use in \"eval 'exec'\"?"
9471 case "$startperl" in
9473 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
9476 : determine where public executable scripts go
9477 set scriptdir scriptdir
9479 case "$scriptdir" in
9482 : guess some guesses
9483 $test -d /usr/share/scripts && dflt=/usr/share/scripts
9484 $test -d /usr/share/bin && dflt=/usr/share/bin
9485 $test -d /usr/local/script && dflt=/usr/local/script
9486 $test -d /usr/local/scripts && dflt=/usr/local/scripts
9487 $test -d $prefixexp/script && dflt=$prefixexp/script
9491 *) dflt="$scriptdir"
9496 Some installations have a separate directory just for executable scripts so
9497 that they can mount it across multiple architectures but keep the scripts in
9498 one spot. You might, for example, have a subdirectory of /usr/share for this.
9499 Or you might just lump your scripts in with all your other executables.
9503 rp='Where do you keep publicly executable scripts?'
9505 if $test "X$ansexp" != "X$scriptdirexp"; then
9511 : A little fix up for an irregularly named variable.
9512 installscript="$installscriptdir"
9514 : determine where add-on public executables go
9516 '') dflt=$siteprefix/bin ;;
9520 rp='Pathname where the add-on public executables should be installed?'
9525 : determine where add-on html pages go
9526 : There is no standard location, so try to copy the previously-selected
9527 : directory structure for the core html pages.
9528 case "$sitehtml1dir" in
9529 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9530 *) dflt=$sitehtml1dir ;;
9533 ''|' ') dflt=none ;;
9536 rp='Pathname where the site-specific html pages should be installed?'
9538 prefixvar=sitehtml1dir
9541 : determine where add-on library html pages go
9542 : There is no standard location, so try to copy the previously-selected
9543 : directory structure for the core html pages.
9544 case "$sitehtml3dir" in
9545 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9546 *) dflt=$sitehtml3dir ;;
9549 ''|' ') dflt=none ;;
9552 rp='Pathname where the site-specific library html pages should be installed?'
9554 prefixvar=sitehtml3dir
9557 : determine where add-on manual pages go
9558 case "$siteman1dir" in
9559 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
9560 *) dflt=$siteman1dir ;;
9563 ''|' ') dflt=none ;;
9566 rp='Pathname where the site-specific manual pages should be installed?'
9568 prefixvar=siteman1dir
9571 : determine where add-on library man pages go
9572 case "$siteman3dir" in
9573 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
9574 *) dflt=$siteman3dir ;;
9577 ''|' ') dflt=none ;;
9580 rp='Pathname where the site-specific library manual pages should be installed?'
9582 prefixvar=siteman3dir
9585 : determine where add-on public executable scripts go
9586 case "$sitescript" in
9587 '') dflt=$siteprefix/script
9588 $test -d $dflt || dflt=$sitebin ;;
9589 *) dflt="$sitescript" ;;
9592 rp='Pathname where add-on public executable scripts should be installed?'
9594 prefixvar=sitescript
9597 : see if backtrace exists
9598 set backtrace d_backtrace
9601 : add flags if using c backtrace
9602 case "$usecbacktrace" in
9603 "") usecbacktrace=$undef ;;
9605 case "$d_backtrace" in
9607 case " $ccflags " in
9608 *" -DUSE_C_BACKTRACE "*) ;; # Already there.
9609 *) ccflags="$ccflags -DUSE_C_BACKTRACE -g" ;;
9613 echo "This system does not support backtrace" >&4
9614 usecbacktrace=$undef
9620 : Check if faststdio is requested and available
9621 case "$usefaststdio" in
9622 $define|true|[yY]*|'')
9623 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
9633 Perl can be built to use 'fast stdio', which means using the stdio
9634 library but also directly manipulating the stdio buffers to enable
9635 faster I/O. Using stdio is better for backward compatibility (especially
9636 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
9637 interface has been preferred instead of stdio.
9639 If this doesn't make any sense to you, just accept the default '$dflt'.
9641 rp='Use the "fast stdio" if available?'
9644 y|Y) val="$define" ;;
9651 : define an is-a-typedef? function
9652 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9654 "") inclist="sys/types.h";;
9656 eval "varval=\$$var";
9660 for inc in $inclist; do
9661 echo "#include <$inc>" >>temp.c;
9663 echo "#ifdef $type" >> temp.c;
9664 echo "printf(\"We have $type\");" >> temp.c;
9665 echo "#endif" >> temp.c;
9666 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9667 if $contains $type temp.E >/dev/null 2>&1; then
9673 *) eval "$var=\$varval";;
9676 : define an is-a-typedef? function that prompts if the type is not available.
9677 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9679 "") inclist="sys/types.h";;
9681 eval "varval=\$$var";
9685 for inc in $inclist; do
9686 echo "#include <$inc>" >>temp.c;
9688 echo "#ifdef $type" >> temp.c;
9689 echo "printf(\"We have $type\");" >> temp.c;
9690 echo "#endif" >> temp.c;
9691 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9693 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
9694 if $contains $type temp.E >/dev/null 2>&1; then
9695 echo "$type found." >&4;
9698 echo "$type NOT found." >&4;
9704 *) eval "$var=\$varval";;
9707 : see what type lseek is declared as in the kernel
9708 rp="What is the type used for lseek's offset on this system?"
9709 set off_t lseektype long stdio.h sys/types.h
9713 echo "Checking to see how big your file offsets are..." >&4
9715 #include <sys/types.h>
9719 printf("%d\n", (int)sizeof($lseektype));
9724 if eval $compile_ok; then
9725 lseeksize=`$run ./try`
9726 echo "Your file offsets are $lseeksize bytes long."
9730 echo "(I can't seem to compile the test program. Guessing...)"
9731 rp="What is the size of your file offsets (in bytes)?"
9737 : see what type file positions are declared as in the library
9738 rp="What is the type for file position used by fsetpos()?"
9739 set fpos_t fpostype long stdio.h sys/types.h
9742 : Check size for Fpos_t
9745 *_t) zzz="$fpostype" ;;
9748 echo "Checking the size of $zzz..." >&4
9750 #include <sys/types.h>
9757 printf("%d\n", (int)sizeof($fpostype));
9762 if eval $compile_ok; then
9766 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9769 echo "Your $zzz is $fpossize bytes long."
9775 echo "(I can't compile the test program. Guessing...)" >&4
9776 rp="What is the size of your file positions (in bytes)?"
9781 : Check for large file support
9782 # Backward compatibility (uselfs is deprecated).
9784 "$define"|true|[yY]*)
9787 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9789 uselargefiles="$define"
9793 case "$lseeksize:$fpossize" in
9796 You can have files larger than 2 gigabytes.
9799 *) case "$uselargefiles" in
9800 "$undef"|false|[nN]*) dflt='n' ;;
9805 Perl can be built to understand large files (files larger than 2 gigabytes)
9806 on some systems. To do so, Configure can be run with -Duselargefiles.
9808 If this doesn't make any sense to you, just accept the default '$dflt'.
9810 rp='Try to understand large files, if available?'
9813 y|Y) val="$define" ;;
9820 : Look for a hint-file generated 'call-back-unit'. If the
9821 : user has specified that a large files perl is to be built,
9822 : we may need to set or change some other defaults.
9823 if $test -f uselargefiles.cbu; then
9824 echo "Your platform has some specific hints regarding large file builds, using them..."
9825 . ./uselargefiles.cbu
9827 case "$uselargefiles" in
9829 if $test -f uselargefiles.cbu; then
9831 echo "Rechecking to see how big your file offsets are..." >&4
9833 #include <sys/types.h>
9837 printf("%d\n", (int)sizeof($lseektype));
9842 if eval $compile_ok; then
9843 lseeksize=`$run ./try`
9844 $echo "Your file offsets are now $lseeksize bytes long."
9848 echo "(I can't seem to compile the test program. Guessing...)"
9849 rp="What is the size of your file offsets (in bytes)?"
9854 *_t) zzz="$fpostype" ;;
9857 $echo $n "Rechecking the size of $zzz...$c" >&4
9859 #include <sys/types.h>
9866 printf("%d\n", (int)sizeof($fpostype));
9871 if eval $compile_ok; then
9876 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9879 echo " $fpossize bytes." >&4
9885 echo "(I can't compile the test program. Guessing...)" >&4
9886 rp="What is the size of your file positions (in bytes)?"
9895 : Check if we want perlio
9898 : Set the vendorbin variables
9899 case "$vendorprefix" in
9900 '') d_vendorbin="$undef"
9904 *) d_vendorbin="$define"
9905 : determine where vendor-supplied executables go.
9906 case "$vendorbin" in
9907 '') dflt=$vendorprefix/bin ;;
9908 *) dflt="$vendorbin" ;;
9911 rp='Pathname for the vendor-supplied executables directory?'
9914 vendorbinexp="$ansexp"
9920 : Set the vendorhtml1dir variables
9921 case "$vendorprefix" in
9922 '') vendorhtml1dir=''
9923 vendorhtml1direxp=''
9925 *) : determine where vendor-supplied html pages go.
9926 : There is no standard location, so try to copy the previously-selected
9927 : directory structure for the core html pages.
9928 : XXX Better default suggestions would be welcome.
9929 case "$vendorhtml1dir" in
9930 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9931 *) dflt=$vendorhtml1dir ;;
9934 ''|' ') dflt=none ;;
9937 rp='Pathname for the vendor-supplied html pages?'
9939 vendorhtml1dir="$ans"
9940 vendorhtml1direxp="$ansexp"
9943 : Use ' ' for none so value is preserved next time through Configure
9944 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9945 prefixvar=vendorhtml1dir
9948 : Set the vendorhtml3dir variables
9949 case "$vendorprefix" in
9950 '') vendorhtml3dir=''
9951 vendorhtml3direxp=''
9953 *) : determine where vendor-supplied module html pages go.
9954 : There is no standard location, so try to copy the previously-selected
9955 : directory structure for the core html pages.
9956 : XXX Better default suggestions would be welcome.
9957 case "$vendorhtml3dir" in
9958 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9959 *) dflt=$vendorhtml3dir ;;
9962 ''|' ') dflt=none ;;
9965 rp='Pathname for the vendor-supplied html pages?'
9967 vendorhtml3dir="$ans"
9968 vendorhtml3direxp="$ansexp"
9971 : Use ' ' for none so value is preserved next time through Configure
9972 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9973 prefixvar=vendorhtml3dir
9976 : Set the vendorman1dir variables
9977 case "$vendorprefix" in
9978 '') vendorman1dir=''
9981 *) : determine where vendor-supplied manual pages go.
9982 case "$vendorman1dir" in
9983 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9984 *) dflt=$vendorman1dir ;;
9987 ''|' ') dflt=none ;;
9990 rp='Pathname for the vendor-supplied manual section 1 pages?'
9992 vendorman1dir="$ans"
9993 vendorman1direxp="$ansexp"
9996 : Use ' ' for none so value is preserved next time through Configure
9997 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9998 prefixvar=vendorman1dir
10001 : Set the vendorman3dir variables
10002 case "$vendorprefix" in
10003 '') vendorman3dir=''
10004 vendorman3direxp=''
10006 *) : determine where vendor-supplied module manual pages go.
10007 case "$vendorman3dir" in
10008 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
10009 *) dflt=$vendorman3dir ;;
10012 ''|' ') dflt=none ;;
10015 rp='Pathname for the vendor-supplied manual section 3 pages?'
10017 vendorman3dir="$ans"
10018 vendorman3direxp="$ansexp"
10021 : Use ' ' for none so value is preserved next time through Configure
10022 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
10023 prefixvar=vendorman3dir
10026 : Set the vendorscript variables
10027 case "$vendorprefix" in
10028 '') d_vendorscript="$undef"
10032 *) d_vendorscript="$define"
10033 : determine where vendor-supplied scripts go.
10034 case "$vendorscript" in
10035 '') dflt=$vendorprefix/script
10036 $test -d $dflt || dflt=$vendorbin ;;
10037 *) dflt="$vendorscript" ;;
10041 The installation process will create a directory for
10042 vendor-supplied scripts.
10046 rp='Pathname for the vendor-supplied scripts directory?'
10048 vendorscript="$ans"
10049 vendorscriptexp="$ansexp"
10052 prefixvar=vendorscript
10055 : script used to emit important warnings
10058 if test \$# -gt 0; then
10063 echo "*** WARNING:" >&4
10064 sed -e 's/^/*** /' <msg >&4
10066 cat msg >>config.msg
10067 echo " " >>config.msg
10073 : see which of string.h or strings.h is needed
10075 strings=`./findhdr string.h`
10076 if $test "$strings" && $test -r "$strings"; then
10077 echo "Using <string.h> instead of <strings.h>." >&4
10081 strings=`./findhdr strings.h`
10082 if $test "$strings" && $test -r "$strings"; then
10083 echo "Using <strings.h> instead of <string.h>." >&4
10085 ./warn "No string header found -- You'll surely have problems."
10090 case "$i_string" in
10091 "$undef") strings=`./findhdr strings.h`;;
10092 *) strings=`./findhdr string.h`;;
10095 : see if qgcvt exists
10099 : Check what kind of doubles your system has
10100 $echo "Checking the kind of doubles you have..." >&4
10102 #$i_stdlib I_STDLIB
10103 #define DOUBLESIZE $doublesize
10105 #include <stdlib.h>
10108 static const double d = -0.1;
10110 unsigned const char* b = (unsigned const char*)(&d);
10111 #if DOUBLESIZE == 4
10112 if (b[0] == 0xCD && b[3] == 0xBD) {
10113 /* IEEE 754 32-bit little-endian */
10117 if (b[0] == 0xBD && b[3] == 0xCD) {
10118 /* IEEE 754 32-bit big-endian */
10123 #if DOUBLESIZE == 8
10124 if (b[0] == 0x9A && b[7] == 0xBF) {
10125 /* IEEE 754 64-bit little-endian */
10129 if (b[0] == 0xBF && b[7] == 0x9A) {
10130 /* IEEE 754 64-bit big-endian */
10134 if (b[0] == 0x99 && b[3] == 0xBF && b[4] == 0x9A && b[7] == 0x99) {
10135 /* ARM mixed endian: two little-endian 32-bit floats, in big endian order:
10136 * 4 5 6 7 0 1 2 3 (MSB = 7, LSB = 0)
10137 * 99 99 b9 bf 9a 99 99 99 */
10141 if (b[0] == 0x99 && b[3] == 0x9A && b[4] == 0xBF && b[7] == 0x99) {
10142 /* The opposite of case 7, mixed endian: two big-endian 32-bit floats,
10143 * in little endian order: 3 2 1 0 7 6 5 4 (MSB = 7, LSB = 0)
10144 * 99 99 99 9a bf b9 99 99 */
10149 #if DOUBLESIZE == 16
10150 if (b[0] == 0x9A && b[15] == 0xBF) {
10151 /* IEEE 754 128-bit little-endian */
10155 if (b[0] == 0xBF && b[15] == 0x9A) {
10156 /* IEEE 754 128-bit big-endian */
10161 /* Then there are old mainframe/miniframe formats like VAX, IBM, and CRAY.
10162 * Whether those environments can still build Perl is debatable. */
10163 printf("-1\n"); /* unknown */
10168 if eval $compile; then
10169 doublekind=`$run ./try`
10173 case "$doublekind" in
10174 1) echo "You have IEEE 754 32-bit little endian doubles." >&4 ;;
10175 2) echo "You have IEEE 754 32-bit big endian doubles." >&4 ;;
10176 3) echo "You have IEEE 754 64-bit little endian doubles." >&4 ;;
10177 4) echo "You have IEEE 754 64-bit big endian doubles." >&4 ;;
10178 5) echo "You have IEEE 754 128-bit little endian doubles." >&4 ;;
10179 6) echo "You have IEEE 754 128-bit big endian doubles." >&4 ;;
10180 7) echo "You have IEEE 754 64-bit mixed endian doubles (32-bit LEs in BE)." >&4 ;;
10181 8) echo "You have IEEE 754 64-bit mixed endian doubles (32-bit BEs in LE)." >&4 ;;
10182 *) echo "Cannot figure out your double. You VAX, or something?" >&4 ;;
10186 : Check print/scan long double stuff
10189 if $test X"$d_longdbl" = X"$define"; then
10191 echo "Checking how to print long doubles..." >&4
10193 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
10194 $cat >try.c <<'EOCP'
10195 #include <sys/types.h>
10198 double d = 123.456;
10199 printf("%.3f\n", d);
10203 if eval $compile; then
10207 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
10208 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
10209 echo "We will use %f."
10215 if $test X"$sPRIfldbl" = X; then
10216 $cat >try.c <<'EOCP'
10217 #include <sys/types.h>
10220 long double d = 123.456;
10221 printf("%.3Lf\n", d);
10225 if eval $compile; then
10229 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
10230 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
10231 echo "We will use %Lf."
10237 if $test X"$sPRIfldbl" = X; then
10238 $cat >try.c <<'EOCP'
10239 #include <sys/types.h>
10242 long double d = 123.456;
10243 printf("%.3llf\n", d);
10247 if eval $compile; then
10251 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
10252 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
10253 echo "We will use %llf."
10259 if $test X"$sPRIfldbl" = X; then
10260 $cat >try.c <<'EOCP'
10261 #include <sys/types.h>
10264 long double d = 123.456;
10265 printf("%.3lf\n", d);
10269 if eval $compile; then
10273 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
10274 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
10275 echo "We will use %lf."
10281 if $test X"$sPRIfldbl" = X; then
10282 echo "Cannot figure out how to print long doubles." >&4
10284 sSCNfldbl=$sPRIfldbl # expect consistency
10291 case "$sPRIfldbl" in
10292 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
10293 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
10294 d_SCNfldbl="$undef";
10296 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
10297 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
10298 d_SCNfldbl="$define";
10302 : Before committing on uselongdouble, see whether that looks sane.
10303 if $test "$uselongdouble" = "$define"; then
10306 echo "Checking if your long double math functions work right..." >&4
10311 printf("%"$sPRIgldbl"\n", sqrtl(logl(expl(cosl(sinl(0.0L))))+powl(2.0L, 3.0L)));
10314 case "$osname:$gccversion" in
10315 aix:) saveccflags="$ccflags"
10316 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
10319 if eval $compile_ok; then
10323 3) echo "Your long double math functions are working correctly." >&4 ;;
10324 *) echo "Your long double math functions are broken, not using long doubles." >&4
10325 uselongdouble=$undef
10329 case "$osname:$gccversion" in
10330 aix:) ccflags="$saveccflags" ;; # restore
10334 : Check how to convert floats to strings.
10336 if test "X$d_Gconvert" = X; then
10339 echo "Checking for an efficient way to convert floats to strings."
10341 case "$uselongdouble" in
10342 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
10344 case "$d_longdbl" in
10345 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
10347 case "$d_PRIgldbl" in
10348 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
10351 #ifdef TRY_gconvert
10352 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
10353 char *myname = "gconvert";
10356 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
10357 char *myname = "gcvt";
10360 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
10361 char *myname = "qgcvt";
10362 #define DOUBLETYPE long double
10365 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
10366 #ifdef HAS_PRIgldbl
10367 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
10369 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
10372 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
10374 char *myname = "sprintf";
10378 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
10379 #define DOUBLETYPE long double
10381 #define DOUBLETYPE double
10387 #$i_stdlib I_STDLIB
10389 #include <stdlib.h>
10391 #$i_string I_STRING
10393 # include <string.h>
10395 # include <strings.h>
10398 int checkit(char *expect, char *got)
10400 if (strcmp(expect, got)) {
10401 printf("%s oddity: Expected %s, got %s\n",
10402 myname, expect, got);
10412 /* This must be 1st test on (which?) platform */
10413 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
10414 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
10415 checkit("0.1", buf);
10417 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
10418 checkit("0.01", buf);
10420 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
10421 checkit("0.001", buf);
10423 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
10424 checkit("0.0001", buf);
10426 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
10427 if (strlen(buf) > 5)
10428 checkit("9e-005", buf); /* for Microsoft ?? */
10430 checkit("9e-05", buf);
10432 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
10435 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
10436 checkit("1.1", buf);
10438 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
10439 checkit("1.01", buf);
10441 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
10442 checkit("1.001", buf);
10444 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
10445 checkit("1.0001", buf);
10447 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
10448 checkit("1.00001", buf);
10450 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
10451 checkit("1.000001", buf);
10453 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
10456 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
10457 checkit("-1", buf);
10459 /* Some Linux gcvt's give 1.e+5 here. */
10460 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
10461 checkit("100000", buf);
10463 /* Some Linux gcvt's give -1.e+5 here. */
10464 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
10465 checkit("-100000", buf);
10467 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
10468 checkit("123.456", buf);
10470 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
10471 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
10472 /* 34 should be enough to scare even long double
10473 * places into using the e notation. */
10474 if (strlen(buf) > 5)
10475 checkit("1e+034", buf); /* for Microsoft */
10477 checkit("1e+34", buf);
10479 /* For Perl, if you add additional tests here, also add them to
10480 * t/base/num.t for benefit of platforms not using Configure or
10481 * overriding d_Gconvert */
10486 : first add preferred functions to our list
10488 for xxx_convert in $gconvert_preference; do
10489 case $xxx_convert in
10490 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
10491 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
10494 : then add any others
10495 for xxx_convert in gconvert gcvt sprintf; do
10496 case "$xxx_list" in
10498 *) xxx_list="$xxx_list $xxx_convert" ;;
10502 case "$d_longdbl$uselongdouble" in
10504 : again, add preferred functions to our list first
10506 for xxx_convert in $gconvert_ld_preference; do
10507 case $xxx_convert in
10508 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
10509 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
10512 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
10513 for xxx_convert in qgcvt sprintf $xxx_list; do
10514 case "$xxx_ld_list" in
10515 $xxx_convert*|*" $xxx_convert"*) ;;
10516 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
10519 : if sprintf cannot do long doubles, move it to the end
10520 if test "$d_PRIgldbl" != "$define"; then
10521 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
10523 : if no qgcvt, remove it
10524 if test "$d_qgcvt" != "$define"; then
10525 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
10528 xxx_list="$xxx_ld_list"
10532 for xxx_convert in $xxx_list; do
10533 echo "Trying $xxx_convert..."
10534 $rm -f try try$_o core
10535 set try -DTRY_$xxx_convert
10536 if eval $compile; then
10537 echo "$xxx_convert() found." >&4
10538 if $run ./try; then
10539 echo "I'll use $xxx_convert to convert floats into a string." >&4
10542 echo "...But $xxx_convert didn't work as I expected."
10546 echo "$xxx_convert NOT found." >&4
10550 if test X$xxx_convert = X; then
10551 echo "*** WHOA THERE!!! ***" >&4
10552 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
10553 xxx_convert=sprintf
10556 case "$xxx_convert" in
10557 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
10558 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
10559 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
10560 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
10561 "$define$define$define")
10562 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
10563 "$define$define$undef")
10564 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
10565 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
10573 : see if _fwalk exists
10577 : Initialize h_fcntl
10580 : Initialize h_sysfile
10583 : access call always available on UNIX
10584 set access d_access
10587 : locate the flags for 'access()'
10588 case "$d_access" in
10591 $cat >access.c <<EOCP
10592 #include <sys/types.h>
10597 #include <sys/file.h>
10600 #include <unistd.h>
10602 #$i_stdlib I_STDLIB
10604 #include <stdlib.h>
10610 : check sys/file.h first, no particular reason here
10611 if $test `./findhdr sys/file.h` && \
10612 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
10614 echo "<sys/file.h> defines the *_OK access constants." >&4
10615 elif $test `./findhdr fcntl.h` && \
10616 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
10618 echo "<fcntl.h> defines the *_OK access constants." >&4
10619 elif $test `./findhdr unistd.h` && \
10620 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
10621 echo "<unistd.h> defines the *_OK access constants." >&4
10623 echo "I can't find the four *_OK access constants--I'll use mine." >&4
10629 : see if accessx exists
10630 set accessx d_accessx
10633 : see if acosh exists
10637 : see if aintl exists
10641 : see if alarm exists
10645 : see if 64bit time functions exists
10647 set ctime64 d_ctime64
10650 set localtime64 d_localtime64
10653 set gmtime64 d_gmtime64
10656 set mktime64 d_mktime64
10659 set difftime64 d_difftime64
10662 set asctime64 d_asctime64
10665 : see if POSIX threads are available
10666 set pthread.h i_pthread
10669 : define a function to check prototypes
10670 $cat > protochk <<EOSH
10673 optimize="$optimize"
10675 prototype="$prototype"
10678 usethreads=$usethreads
10679 i_pthread=$i_pthread
10680 pthread_h_first=$pthread_h_first
10683 $cat >> protochk <<'EOSH'
10688 while test $# -ge 2; do
10690 $define) echo "#include <$2>" >> try.c ;;
10691 literal) echo "$2" >> try.c ;;
10693 # Extra magic for the benefit of systems that need pthread.h
10694 # to be included early to correctly detect threadsafe functions.
10695 # Such functions must guarantee themselves, though, that the usethreads
10696 # and i_pthread have been defined, before calling protochk.
10697 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
10698 echo "#include <pthread.h>" >> try.c
10703 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
10704 cat >> try.c <<'EOCP'
10705 #ifdef CAN_PROTOTYPE
10706 #define _(args) args
10711 echo "$foo" >> try.c
10712 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
10713 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
10719 $eunicefix protochk
10721 : Define hasproto macro for Configure internal use
10722 hasproto='varname=$1; func=$2; shift; shift;
10723 while $test $# -ge 2; do
10725 $define) echo "#include <$2>";;
10729 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
10730 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
10731 echo "$func() prototype found.";
10734 echo "$func() prototype NOT found.";
10741 : see if sys/types.h has to be included
10742 set sys/types.h i_systypes
10745 : see if sys/select.h has to be included
10746 set sys/select.h i_sysselct
10749 : Define hasfield macro for Configure internal use
10750 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
10751 while $test $# -ge 2; do
10753 $define) echo "#include <$2>";;
10757 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
10759 if eval $compile; then
10768 : Define hasfield_t macro for Configure internal use
10769 hasfield_t='varname=$1; struct=$2; type=$3; field=$4; shift; shift; shift; shift;
10770 while $test $# -ge 2; do
10772 $define) echo "#include <$2>";;
10776 echo "int main () { $struct foo; $type bar = foo.$field; }" >> try.c;
10778 if eval $compile; then
10787 : see if we should include time.h, sys/time.h, or both
10789 if test "X$timeincl" = X; then
10790 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
10791 $echo $n "I'm now running the test program...$c"
10793 #include <sys/types.h>
10798 #ifdef SYSTIMEKERNEL
10801 #include <sys/time.h>
10804 #include <sys/select.h>
10806 #$i_stdlib I_STDLIB
10808 #include <stdlib.h>
10814 struct timeval bar;
10817 struct timezone tzp;
10819 if (foo.tm_sec == foo.tm_sec)
10822 if (bar.tv_sec == bar.tv_sec)
10829 for s_timezone in '-DS_TIMEZONE' ''; do
10831 for s_timeval in '-DS_TIMEVAL' ''; do
10832 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10833 for i_time in '' '-DI_TIME'; do
10834 for i_systime in '-DI_SYSTIME' ''; do
10837 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10838 if eval $compile; then
10839 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
10843 $echo $n "Succeeded with $flags$c"
10855 *SYSTIMEKERNEL*) i_systimek="$define"
10856 timeincl=`./findhdr sys/time.h`
10857 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10858 *) i_systimek="$undef";;
10861 *I_TIME*) i_time="$define"
10862 timeincl=`./findhdr time.h`" $timeincl"
10863 echo "We'll include <time.h>." >&4;;
10864 *) i_time="$undef";;
10867 *I_SYSTIME*) i_systime="$define"
10868 timeincl=`./findhdr sys/time.h`" $timeincl"
10869 echo "We'll include <sys/time.h>." >&4;;
10870 *) i_systime="$undef";;
10874 : see if struct tm knows about tm_zone
10875 case "$i_systime$i_time" in
10878 echo "Checking to see if your struct tm has tm_zone field..." >&4
10879 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
10887 case "$d_tm_tm_zone" in
10888 "$define") echo "Yes, it does." ;;
10889 *) echo "No, it doesn't." ;;
10891 : see if struct tm knows about tm_gmtoff
10892 case "$i_systime$i_time" in
10895 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
10896 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
10904 case "$d_tm_tm_gmtoff" in
10905 "$define") echo "Yes, it does." ;;
10906 *) echo "No, it doesn't." ;;
10909 : see if asctime_r exists
10910 set asctime_r d_asctime_r
10912 case "$d_asctime_r" in
10914 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10915 case "$d_asctime_r_proto:$usethreads" in
10916 ":define") d_asctime_r_proto=define
10917 set d_asctime_r_proto asctime_r $hdrs
10921 case "$d_asctime_r_proto" in
10923 case "$asctime_r_proto" in
10924 ''|0) try='char* asctime_r(const struct tm*, char*);'
10925 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SB ;;
10927 case "$asctime_r_proto" in
10928 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
10929 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SBI ;;
10931 case "$asctime_r_proto" in
10932 ''|0) try='int asctime_r(const struct tm*, char*);'
10933 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SB ;;
10935 case "$asctime_r_proto" in
10936 ''|0) try='int asctime_r(const struct tm*, char*, int);'
10937 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SBI ;;
10939 case "$asctime_r_proto" in
10940 ''|0) d_asctime_r=undef
10942 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
10943 * ) case "$asctime_r_proto" in
10944 REENTRANT_PROTO*) ;;
10945 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
10947 echo "Prototype: $try" ;;
10950 *) case "$usethreads" in
10951 define) echo "asctime_r has no prototype, not using it." >&4 ;;
10958 *) asctime_r_proto=0
10962 : see if asinh exists
10966 : see if atanh exists
10970 : see if atolf exists
10974 : see if atoll exists
10978 : Look for GCC-style attribute format
10979 case "$d_attribute_format" in
10982 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
10983 $cat >attrib.c <<'EOCP'
10985 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
10987 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10988 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10989 echo "Your C compiler doesn't support __attribute__((format))."
10992 echo "Your C compiler supports __attribute__((format))."
10996 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11000 *) val="$d_attribute_format" ;;
11002 set d_attribute_format
11006 : Look for GCC-style attribute format with null format allowed
11007 case "$d_printf_format_null" in
11008 '') case "$d_attribute_format" in
11011 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
11012 $cat >attrib.c <<EOCP
11014 #$i_stdlib I_STDLIB
11016 #include <stdlib.h>
11018 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
11019 int null_printf (char* pat,...) { return (int)pat; }
11020 int main () { exit(null_printf(NULL)); }
11022 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
11023 : run the executable in case it produces a run-time warning
11024 if $run ./attrib >>attrib.out 2>&1; then
11025 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11026 echo "Your C compiler doesn't allow __printf__ format to be null."
11029 echo "Your C compiler allows __printf__ format to be null."
11033 echo "Your C compiler executable failed with __printf__ format null."
11037 echo "Your C compiler fails with __printf__ format null."
11044 *) val="$d_printf_format_null" ;;
11046 set d_printf_format_null
11050 : Look for GCC-style attribute malloc
11051 case "$d_attribute_malloc" in
11054 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
11055 $cat >attrib.c <<'EOCP'
11057 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
11059 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11060 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11061 echo "Your C compiler doesn't support __attribute__((malloc))."
11064 echo "Your C compiler supports __attribute__((malloc))."
11068 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11072 *) val="$d_attribute_malloc" ;;
11074 set d_attribute_malloc
11078 : Look for GCC-style attribute nonnull
11079 case "$d_attribute_nonnull" in
11082 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
11083 $cat >attrib.c <<'EOCP'
11085 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
11087 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11088 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11089 echo "Your C compiler doesn't support __attribute__((nonnull))."
11092 echo "Your C compiler supports __attribute__((nonnull))."
11096 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11100 *) val="$d_attribute_nonnull" ;;
11102 set d_attribute_nonnull
11106 : Look for GCC-style attribute noreturn
11107 case "$d_attribute_noreturn" in
11110 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
11111 $cat >attrib.c <<'EOCP'
11113 void fall_over_dead( void ) __attribute__((noreturn));
11115 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11116 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11117 echo "Your C compiler doesn't support __attribute__((noreturn))."
11120 echo "Your C compiler supports __attribute__((noreturn))."
11124 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11128 *) val="$d_attribute_noreturn" ;;
11130 set d_attribute_noreturn
11134 : Look for GCC-style attribute pure
11135 case "$d_attribute_pure" in
11138 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
11139 $cat >attrib.c <<'EOCP'
11141 int square( int n ) __attribute__((pure));
11143 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11144 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11145 echo "Your C compiler doesn't support __attribute__((pure))."
11148 echo "Your C compiler supports __attribute__((pure))."
11152 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11156 *) val="$d_attribute_pure" ;;
11158 set d_attribute_pure
11162 : Look for GCC-style attribute unused
11163 case "$d_attribute_unused" in
11166 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
11167 $cat >attrib.c <<'EOCP'
11169 int do_something( int dummy __attribute__((unused)), int n );
11171 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11172 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11173 echo "Your C compiler doesn't support __attribute__((unused))."
11176 echo "Your C compiler supports __attribute__((unused))."
11180 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11184 *) val="$d_attribute_unused" ;;
11186 set d_attribute_unused
11190 : Look for GCC-style attribute deprecated
11191 case "$d_attribute_deprecated" in
11194 echo "Checking whether your compiler can handle __attribute__((deprecated)) ..." >&4
11195 $cat >attrib.c <<'EOCP'
11197 int I_am_deprecated(void) __attribute__((deprecated));
11199 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11200 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11201 echo "Your C compiler doesn't support __attribute__((deprecated))."
11204 echo "Your C compiler supports __attribute__((deprecated))."
11208 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11212 *) val="$d_attribute_deprecated" ;;
11214 set d_attribute_deprecated
11218 : Look for GCC-style attribute warn_unused_result
11219 case "$d_attribute_warn_unused_result" in
11222 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
11223 $cat >attrib.c <<'EOCP'
11225 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
11227 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11228 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11229 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
11232 echo "Your C compiler supports __attribute__((warn_unused_result))."
11236 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11240 *) val="$d_attribute_warn_unused_result" ;;
11242 set d_attribute_warn_unused_result
11246 : see if bcmp exists
11250 : see if bcopy exists
11254 : see if getpgrp exists
11255 set getpgrp d_getpgrp
11258 case "$d_getpgrp" in
11261 echo "Checking to see which flavor of getpgrp is in use..."
11263 #$i_unistd I_UNISTD
11264 #include <sys/types.h>
11266 # include <unistd.h>
11268 #$i_stdlib I_STDLIB
11270 #include <stdlib.h>
11274 if (getuid() == 0) {
11275 printf("(I see you are running Configure as super-user...)\n");
11278 #ifdef TRY_BSD_PGRP
11279 if (getpgrp(1) == 0)
11288 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11289 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
11291 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11292 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
11295 echo "I can't seem to compile and run the test program."
11297 xxx="a USG one, i.e. you use getpgrp()."
11299 # SVR4 systems can appear rather BSD-ish.
11300 case "$i_unistd" in
11302 xxx="a BSD one, i.e. you use getpgrp(pid)."
11306 xxx="probably a USG one, i.e. you use getpgrp()."
11311 echo "Assuming your getpgrp is $xxx" >&4
11320 : see if setpgrp exists
11321 set setpgrp d_setpgrp
11324 case "$d_setpgrp" in
11327 echo "Checking to see which flavor of setpgrp is in use..."
11329 #$i_unistd I_UNISTD
11330 #include <sys/types.h>
11332 # include <unistd.h>
11334 #$i_stdlib I_STDLIB
11336 #include <stdlib.h>
11340 if (getuid() == 0) {
11341 printf("(I see you are running Configure as super-user...)\n");
11344 #ifdef TRY_BSD_PGRP
11345 if (-1 == setpgrp(1, 1))
11348 if (setpgrp() != -1)
11354 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11355 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
11357 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11358 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
11361 echo "(I can't seem to compile and run the test program.)"
11363 xxx="a USG one, i.e. you use setpgrp()."
11365 # SVR4 systems can appear rather BSD-ish.
11366 case "$i_unistd" in
11368 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
11372 xxx="probably a USG one, i.e. you use setpgrp()."
11377 echo "Assuming your setpgrp is $xxx" >&4
11386 : Look for GCC-style __builtin_choose_expr
11387 case "$d_builtin_choose_expr" in
11390 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
11391 $cat >try.c <<'EOCP'
11392 #include <assert.h>
11393 #include <stdlib.h>
11396 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
11399 assert( SYRINX(1) == 2112 );
11400 assert( SYRINX(1) != 5150 );
11401 assert( SYRINX(0) == 5150 );
11402 assert( SYRINX(0) != 2112 );
11403 puts( "All good!" );
11409 if eval $compile && $run ./try; then
11410 echo "Your C compiler supports __builtin_choose_expr."
11413 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
11417 *) val="$d_builtin_choose_expr" ;;
11420 set d_builtin_choose_expr
11424 : Look for GCC-style __builtin_expect
11425 case "$d_builtin_expect" in
11428 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
11429 $cat >try.c <<'EOCP'
11432 if ( __builtin_expect(n, 0) ) n = 1;
11433 /* Remember shell exit code truth is 0, C truth is non-zero */
11438 if eval $compile && $run ./try; then
11439 echo "Your C compiler supports __builtin_expect."
11442 echo "Your C compiler doesn't seem to understand __builtin_expect."
11446 *) val="$d_builtin_expect" ;;
11449 set d_builtin_expect
11453 : see if bzero exists
11457 : see if stdarg is available
11459 if $test `./findhdr stdarg.h`; then
11460 echo "<stdarg.h> found." >&4
11463 echo "<stdarg.h> NOT found." >&4
11467 : see if varargs is available
11469 if $test `./findhdr varargs.h`; then
11470 echo "<varargs.h> found." >&4
11472 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
11475 : set up the varargs testing programs
11476 $cat > varargs.c <<EOP
11478 #include <stdarg.h>
11481 #include <varargs.h>
11485 int f(char *p, ...)
11499 p = va_arg(ap, char *);
11505 $cat > varargs <<EOP
11507 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
11516 : now check which varargs header should be included
11522 if `./varargs I_STDARG`; then
11524 elif `./varargs I_VARARGS`; then
11529 if `./varargs I_VARARGS`; then
11537 echo "*** WHOA THERE!!! ***" >&4
11538 echo " Your C compiler \"$cc\" doesn't seem to support stdarg or varargs!" >&4
11539 case "$knowitall" in
11541 echo " I'm giving up; maybe you can try again with a different compiler?" >&4
11545 echo "I could not find the definition for va_dcl... You have problems..." >&4
11546 val="$undef"; set i_stdarg; eval $setvar
11547 val="$undef"; set i_varargs; eval $setvar
11552 case "$i_varhdr" in
11554 val="$define"; set i_stdarg; eval $setvar
11555 val="$undef"; set i_varargs; eval $setvar
11558 val="$undef"; set i_stdarg; eval $setvar
11559 val="$define"; set i_varargs; eval $setvar
11562 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
11566 : see if the Compiler supports C99 variadic macros
11567 case "$i_stdarg$i_stdlib" in
11569 echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
11572 #include <stdarg.h>
11574 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
11578 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
11584 if eval $compile && $run ./try 2>&1 >/dev/null; then
11585 case "`$run ./try`" in
11587 echo "You have C99 variadic macros." >&4
11588 d_c99_variadic_macros="$define"
11591 echo "You don't have functional C99 variadic macros." >&4
11592 d_c99_variadic_macros="$undef"
11596 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
11597 d_c99_variadic_macros="$undef"
11602 echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
11603 d_c99_variadic_macros="$undef"
11607 : see if signal is declared as pointer to function returning int or void
11609 xxx=`./findhdr signal.h`
11610 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
11611 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
11612 echo "You have int (*signal())() instead of void." >&4
11614 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
11615 echo "You have void (*signal())()." >&4
11617 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
11618 echo "You have int (*signal())() instead of void." >&4
11620 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
11621 echo "You have void (*signal())()." >&4
11624 case "$d_voidsig" in
11626 echo "I can't determine whether signal handler returns void or int..." >&4
11628 rp="What type does your signal handler return?"
11631 v*) val="$define";;
11635 echo "As you already told me, signal handler returns void." >&4
11638 *) echo "As you already told me, signal handler returns int." >&4
11645 case "$d_voidsig" in
11646 "$define") signal_t="void";;
11647 *) signal_t="int";;
11651 : check for ability to cast large floats to 32-bit ints.
11653 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
11654 if $test "$intsize" -ge 4; then
11661 #$i_stdlib I_STDLIB
11663 #include <stdlib.h>
11665 #include <sys/types.h>
11666 #include <signal.h>
11667 $signal_t blech(int s) { exit(3); }
11674 signal(SIGFPE, blech);
11676 /* Don't let compiler optimize the test away. Store the number
11677 in a writable string for gcc to pass to sscanf under HP-UX.
11679 sprintf(str, "2147483647");
11680 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
11684 /* x86 processors will probably give 0x8000 0000, which is a
11685 sign change. We don't want that. We want to mimic SPARC
11686 behavior here, which is to preserve the sign and give
11689 if (i32 != ($xxx) f)
11695 if eval $compile_ok; then
11696 $run ./try 2>/dev/null
11699 echo "(I can't seem to compile the test program--assuming it can't)"
11704 echo "Yup, it can."
11707 echo "Nope, it can't."
11714 : check for ability to cast negative floats to unsigned
11716 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
11719 #$i_stdlib I_STDLIB
11721 #include <stdlib.h>
11723 #include <sys/types.h>
11724 #include <signal.h>
11725 $signal_t blech(int s) { exit(7); }
11726 $signal_t blech_in_list(int s) { exit(4); }
11727 unsigned long dummy_long(unsigned long p) { return p; }
11728 unsigned int dummy_int(unsigned int p) { return p; }
11729 unsigned short dummy_short(unsigned short p) { return p; }
11733 unsigned long along;
11735 unsigned short ashort;
11739 /* Frustrate gcc-2.7.2's optimizer which failed this test with
11740 a direct f = -123. assignment. gcc-2.8.0 reportedly
11741 optimized the whole file away
11743 /* Store the number in a writable string for gcc to pass to
11744 sscanf under HP-UX.
11746 sprintf(str, "-123");
11747 sscanf(str, "%lf", &f); /* f = -123.; */
11749 signal(SIGFPE, blech);
11750 along = (unsigned long)f;
11751 aint = (unsigned int)f;
11752 ashort = (unsigned short)f;
11753 if (along != (unsigned long)-123)
11755 if (aint != (unsigned int)-123)
11757 if (ashort != (unsigned short)-123)
11759 sprintf(str, "1073741824.");
11760 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
11763 along = (unsigned long)f;
11764 if (along != 0x80000000)
11768 along = (unsigned long)f;
11769 if (along != 0x7fffffff)
11773 along = (unsigned long)f;
11774 if (along != 0x80000001)
11778 signal(SIGFPE, blech_in_list);
11779 sprintf(str, "123.");
11780 sscanf(str, "%lf", &f); /* f = 123.; */
11781 along = dummy_long((unsigned long)f);
11782 aint = dummy_int((unsigned int)f);
11783 ashort = dummy_short((unsigned short)f);
11784 if (along != (unsigned long)123)
11786 if (aint != (unsigned int)123)
11788 if (ashort != (unsigned short)123)
11795 if eval $compile_ok; then
11796 $run ./try 2>/dev/null
11799 echo "(I can't seem to compile the test program--assuming it can't)"
11802 case "$castflags" in
11804 echo "Yup, it can."
11807 echo "Nope, it can't."
11814 : see if cbrt exists
11818 : see if vprintf exists
11820 if set vprintf val -f d_vprintf; eval $csym; $val; then
11821 echo 'vprintf() found.' >&4
11824 #$i_stdarg I_STDARG /* Only one of these can be defined by i_varhrd */
11825 #$i_varargs I_VARARGS
11827 #$i_stdlib I_STDLIB
11828 #$i_unistd I_UNISTD
11831 # include <stdarg.h>
11832 #else /* I_VARARGS */
11833 # include <varargs.h>
11837 # include <unistd.h>
11841 # include <stdlib.h>
11844 #include <stdio.h> /* vsprintf prototype */
11847 void xxx(int n, ...)
11852 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11854 int main() { xxx(1, "foo"); }
11856 #else /* I_VARARGS */
11864 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11866 int main() { xxx("foo"); }
11872 if eval $compile_ok; then
11873 if $run ./try; then
11874 echo "Your vsprintf() returns (int)." >&4
11877 echo "Your vsprintf() returns (char*)." >&4
11881 echo 'I am unable to compile the vsprintf() test program.' >&4
11882 # We shouldn't get here. If we do, assume the standard signature,
11883 # not the old BSD one.
11884 echo 'Guessing that vsprintf() returns (int).' >&4
11888 echo 'vprintf() NOT found.' >&4
11899 : see if chown exists
11903 : see if chroot exists
11904 set chroot d_chroot
11907 : see if chsize exists
11908 set chsize d_chsize
11911 : see if class exists
11915 : see if clearenv exists
11916 set clearenv d_clearenv
11919 : Define hasstruct macro for Configure internal use
11920 hasstruct='varname=$1; struct=$2; shift; shift;
11921 while $test $# -ge 2; do
11923 $define) echo "#include <$2>";;
11927 echo "int main () { struct $struct foo; }" >> try.c;
11929 if eval $compile; then
11938 : see whether socket exists
11942 $echo $n "Hmm... $c" >&4
11943 if set socket val -f d_socket; eval $csym; $val; then
11944 echo "Looks like you have Berkeley networking support." >&4
11946 if set setsockopt val -f; eval $csym; $val; then
11949 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
11950 d_oldsock="$define"
11953 if $contains socklib libc.list >/dev/null 2>&1; then
11954 echo "Looks like you have Berkeley networking support." >&4
11956 : we will have to assume that it supports the 4.2 BSD interface
11959 echo "You don't have Berkeley networking in libc$_a..." >&4
11960 if test "X$d_socket" = "X$define"; then
11961 echo "...but you seem to believe that you have sockets." >&4
11963 for net in net socket
11965 if test -f $sysroot/usr/lib/lib$net$_a; then
11966 ( ($nm $nm_opt $sysroot/usr/lib/lib$net$_a | eval $nm_extract) || \
11967 $ar t $sysroot/usr/lib/lib$net$_a) 2>/dev/null >> libc.list
11968 if $contains socket libc.list >/dev/null 2>&1; then
11973 echo "...but the Wollongong group seems to have hacked it in." >&4
11974 sockethdr="-I$sysroot/usr/netinclude"
11977 echo "Found Berkeley sockets interface in lib$net." >&4
11978 if $contains setsockopt libc.list >/dev/null 2>&1; then
11981 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
11982 d_oldsock="$define"
11988 if test "X$d_socket" != "X$define"; then
11989 echo "or anywhere else I see." >&4
11997 : see if socketpair exists
11998 set socketpair d_sockpair
12003 echo "Checking the availability sa_len in the sock struct ..." >&4
12005 #include <sys/types.h>
12006 #include <sys/socket.h>
12008 struct sockaddr sa;
12009 return (sa.sa_len);
12013 set try; if eval $compile; then
12016 set d_sockaddr_sa_len; eval $setvar
12020 echo "Checking the availability struct sockaddr_in6 ..." >&4
12022 #include <sys/types.h>
12023 #include <sys/socket.h>
12024 #include <netinet/in.h>
12026 struct sockaddr_in6 sin6;
12027 return (sin6.sin6_family);
12031 set try; if eval $compile; then
12034 set d_sockaddr_in6; eval $setvar
12038 echo "Checking the availability sin6_scope_id in struct sockaddr_in6 ..." >&4
12040 #include <sys/types.h>
12041 #include <sys/socket.h>
12042 #include <netinet/in.h>
12044 struct sockaddr_in6 sin6;
12045 return (sin6.sin6_scope_id);
12049 set try; if eval $compile; then
12052 set d_sin6_scope_id; eval $setvar
12056 echo "Checking the availability struct ip_mreq ..." >&4
12058 #include <sys/types.h>
12059 #include <sys/socket.h>
12060 #include <netinet/in.h>
12062 struct ip_mreq mreq;
12063 return (mreq.imr_multiaddr.s_addr);
12067 set try; if eval $compile; then
12070 set d_ip_mreq; eval $setvar
12074 echo "Checking the availability struct ip_mreq_source ..." >&4
12076 #include <sys/types.h>
12077 #include <sys/socket.h>
12078 #include <netinet/in.h>
12080 struct ip_mreq_source mreq;
12081 return (mreq.imr_multiaddr.s_addr);
12085 set try; if eval $compile; then
12088 set d_ip_mreq_source; eval $setvar
12092 echo "Checking the availability struct ipv6_mreq ..." >&4
12094 #include <sys/types.h>
12095 #include <sys/socket.h>
12096 #include <netinet/in.h>
12098 struct ipv6_mreq mreq;
12099 return (mreq.ipv6mr_interface);
12103 set try; if eval $compile; then
12106 set d_ipv6_mreq; eval $setvar
12110 echo "Checking the availability struct ipv6_mreq_source ..." >&4
12112 #include <sys/types.h>
12113 #include <sys/socket.h>
12114 #include <netinet/in.h>
12116 struct ipv6_mreq_source mreq;
12117 return (mreq.imr_multiaddr.s_addr);
12121 set try; if eval $compile; then
12124 set d_ipv6_mreq_source; eval $setvar
12128 echo "Checking the availability of certain socket constants..." >&4
12129 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
12130 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
12132 #include <sys/types.h>
12133 #include <sys/socket.h>
12139 set try; if eval $compile; then
12142 set d_${enum}; eval $setvar
12146 : see if this is a sys/uio.h system
12147 set sys/uio.h i_sysuio
12150 : Check for cmsghdr support
12152 echo "Checking to see if your system supports struct cmsghdr..." >&4
12153 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
12155 case "$d_cmsghdr_s" in
12156 "$define") echo "Yes, it does." ;;
12157 *) echo "No, it doesn't." ;;
12161 : check for const keyword
12163 echo 'Checking to see if your C compiler knows about "const"...' >&4
12164 $cat >const.c <<'EOCP'
12165 typedef struct spug { int drokk; } spug;
12169 const spug y = { 0 };
12172 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
12174 echo "Yup, it does."
12177 echo "Nope, it doesn't."
12182 : see if copysign exists
12183 set copysign d_copysign
12186 : see if copysignl exists
12187 set copysignl d_copysignl
12190 : see if crypt exists
12195 $define) cryptlib='' ;;
12196 *) if set crypt val -f d_crypt; eval $csym; $val; then
12197 echo 'crypt() found.' >&4
12201 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
12202 if $test -z "$cryptlib"; then
12203 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
12207 if $test -z "$cryptlib"; then
12208 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
12212 if $test -z "$cryptlib"; then
12213 cryptlib=`./loc libcrypt$_a "" $libpth`
12217 if $test -z "$cryptlib"; then
12218 echo 'crypt() NOT found.' >&4
12229 : see if this is a crypt.h system
12230 set crypt.h i_crypt
12233 : see if crypt_r exists
12234 set crypt_r d_crypt_r
12236 case "$d_crypt_r" in
12238 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
12239 case "$d_crypt_r_proto:$usethreads" in
12240 ":define") d_crypt_r_proto=define
12241 set d_crypt_r_proto crypt_r $hdrs
12245 case "$d_crypt_r_proto" in
12247 case "$crypt_r_proto" in
12248 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
12249 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCS ;;
12251 case "$crypt_r_proto" in
12252 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
12253 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCD ;;
12255 case "$crypt_r_proto" in
12256 ''|0) d_crypt_r=undef
12258 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
12259 * ) case "$crypt_r_proto" in
12260 REENTRANT_PROTO*) ;;
12261 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
12263 echo "Prototype: $try" ;;
12266 *) case "$usethreads" in
12267 define) echo "crypt_r has no prototype, not using it." >&4 ;;
12278 : get csh whereabouts
12280 'csh') val="$undef" ;;
12281 *) val="$define" ;;
12285 : Respect a hint or command line value for full_csh.
12286 case "$full_csh" in
12287 '') full_csh=$csh ;;
12290 : see if ctermid exists
12291 set ctermid d_ctermid
12294 : see if ctermid_r exists
12295 set ctermid_r d_ctermid_r
12297 case "$d_ctermid_r" in
12299 hdrs="$i_systypes sys/types.h define stdio.h "
12300 case "$d_ctermid_r_proto:$usethreads" in
12301 ":define") d_ctermid_r_proto=define
12302 set d_ctermid_r_proto ctermid_r $hdrs
12306 case "$d_ctermid_r_proto" in
12308 case "$ctermid_r_proto" in
12309 ''|0) try='char* ctermid_r(char*);'
12310 ./protochk "$extern_C $try" $hdrs && ctermid_r_proto=B_B ;;
12312 case "$ctermid_r_proto" in
12313 ''|0) d_ctermid_r=undef
12315 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
12316 * ) case "$ctermid_r_proto" in
12317 REENTRANT_PROTO*) ;;
12318 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
12320 echo "Prototype: $try" ;;
12323 *) case "$usethreads" in
12324 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
12331 *) ctermid_r_proto=0
12335 : see if ctime_r exists
12336 set ctime_r d_ctime_r
12338 case "$d_ctime_r" in
12340 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
12341 case "$d_ctime_r_proto:$usethreads" in
12342 ":define") d_ctime_r_proto=define
12343 set d_ctime_r_proto ctime_r $hdrs
12347 case "$d_ctime_r_proto" in
12349 case "$ctime_r_proto" in
12350 ''|0) try='char* ctime_r(const time_t*, char*);'
12351 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SB ;;
12353 case "$ctime_r_proto" in
12354 ''|0) try='char* ctime_r(const time_t*, char*, int);'
12355 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SBI ;;
12357 case "$ctime_r_proto" in
12358 ''|0) try='int ctime_r(const time_t*, char*);'
12359 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SB ;;
12361 case "$ctime_r_proto" in
12362 ''|0) try='int ctime_r(const time_t*, char*, int);'
12363 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SBI ;;
12365 case "$ctime_r_proto" in
12366 ''|0) d_ctime_r=undef
12368 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
12369 * ) case "$ctime_r_proto" in
12370 REENTRANT_PROTO*) ;;
12371 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
12373 echo "Prototype: $try" ;;
12376 *) case "$usethreads" in
12377 define) echo "ctime_r has no prototype, not using it." >&4 ;;
12388 : see if cuserid exists
12389 set cuserid d_cuserid
12392 : see if this is a limits.h system
12393 set limits.h i_limits
12396 : See if number of significant digits in a double precision number is known
12398 $cat >dbl_dig.c <<EOM
12399 #$i_limits I_LIMITS
12402 #include <limits.h>
12408 printf("Contains DBL_DIG");
12411 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
12412 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
12413 echo "DBL_DIG found." >&4
12416 echo "DBL_DIG NOT found." >&4
12423 : see if dbm.h is available
12424 : see if dbmclose exists
12425 set dbmclose d_dbmclose
12428 case "$d_dbmclose" in
12438 *) set rpcsvc/dbm.h i_rpcsvcdbm
12443 *) echo "We won't be including <dbm.h>"
12453 : see if prototype for dbminit is available
12455 set d_dbminitproto dbminit $i_dbm dbm.h
12458 : see if difftime exists
12459 set difftime d_difftime
12462 : see if this is a dirent system
12464 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
12466 echo "<dirent.h> found." >&4
12469 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
12470 echo "<sys/dir.h> found." >&4
12473 xinc=`./findhdr sys/ndir.h`
12475 echo "<dirent.h> NOT found." >&4
12480 : Look for type of directory structure.
12482 $cppstdin $cppflags $cppminus < "$xinc" > try.c
12484 case "$direntrytype" in
12486 case "$i_dirent" in
12487 $define) guess1='struct dirent' ;;
12488 *) guess1='struct direct' ;;
12491 *) guess1="$direntrytype"
12496 'struct dirent') guess2='struct direct' ;;
12497 *) guess2='struct dirent' ;;
12500 if $contains "$guess1" try.c >/dev/null 2>&1; then
12501 direntrytype="$guess1"
12502 echo "Your directory entries are $direntrytype." >&4
12503 elif $contains "$guess2" try.c >/dev/null 2>&1; then
12504 direntrytype="$guess2"
12505 echo "Your directory entries seem to be $direntrytype." >&4
12507 echo "I don't recognize your system's directory entries." >&4
12508 rp="What type is used for directory entries on this system?"
12511 direntrytype="$ans"
12515 : see if the directory entry stores field length
12517 $cppstdin $cppflags $cppminus < "$xinc" > try.c
12518 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
12519 echo "Good, your directory entry keeps length information in d_namlen." >&4
12522 echo "Your directory entry does not know about the d_namlen field." >&4
12529 : Look for DIR.dd_fd
12530 case "$i_dirent" in
12532 echo "Checking to see if DIR has a dd_fd member variable" >&4
12534 #$i_stdlib I_STDLIB
12536 #include <stdlib.h>
12538 #include <dirent.h>
12548 if eval $compile; then
12549 echo "Yes, it does."
12552 echo "No, it does not."
12557 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
12565 : see if this is an sysdir system
12566 set sys/dir.h i_sysdir
12569 : see if this is an sysndir system
12570 set sys/ndir.h i_sysndir
12575 $cat >dirfd.c <<EOM
12577 #$i_stdlib I_STDLIB
12579 #include <stdlib.h>
12581 #$i_dirent I_DIRENT /**/
12582 #$i_sysdir I_SYS_DIR /**/
12583 #$i_sysndir I_SYS_NDIR /**/
12584 #$i_systypes I_SYS_TYPES /**/
12585 #if defined(I_SYS_TYPES)
12586 #include <sys/types.h>
12588 #if defined(I_DIRENT)
12589 #include <dirent.h>
12592 #include <sys/ndir.h>
12596 #include <ndir.h> /* may be wrong in the future */
12598 #include <sys/dir.h>
12604 DIR *dirp = opendir(".");
12605 if (dirfd(dirp) >= 0)
12613 if eval $compile; then
12617 $define) echo "dirfd() found." >&4 ;;
12618 *) echo "dirfd() NOT found." >&4 ;;
12624 : see if dladdr exists
12625 set dladdr d_dladdr
12628 : see if dlerror exists
12631 set dlerror d_dlerror
12635 : see if dlfcn is available
12636 set dlfcn.h i_dlfcn
12639 : Check what extension to use for shared libs
12644 On a few systems, the dynamically loaded modules that perl generates and uses
12645 will need a different extension than shared libs. The default will probably
12651 *) dflt="$dlext" ;;
12653 rp='What is the extension of dynamically loaded modules'
12662 : Check if dlsym need a leading underscore
12668 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
12669 $cat >dyna.c <<'EOM'
12676 #$i_stdlib I_STDLIB
12678 #include <stdlib.h>
12682 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
12684 #include <sys/types.h>
12689 extern int fred() ;
12698 int mode = RTLD_LAZY ;
12700 handle = dlopen("./dyna.$dlext", mode) ;
12701 if (handle == NULL) {
12706 symbol = dlsym(handle, "fred") ;
12707 if (symbol == NULL) {
12708 /* try putting a leading underscore */
12709 symbol = dlsym(handle, "_fred") ;
12710 if (symbol == NULL) {
12723 : Call the object file tmp-dyna.o in case dlext=o.
12724 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
12725 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
12726 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
12727 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
12730 1) echo "Test program failed using dlopen." >&4
12731 echo "Perhaps you should not use dynamic loading." >&4;;
12732 2) echo "Test program failed using dlsym." >&4
12733 echo "Perhaps you should not use dynamic loading." >&4;;
12734 3) echo "dlsym needs a leading underscore" >&4
12736 4) echo "dlsym doesn't need a leading underscore." >&4;;
12739 echo "I can't compile and run the test program." >&4
12740 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
12745 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
12750 : see if drand48_r exists
12751 set drand48_r d_drand48_r
12753 case "$d_drand48_r" in
12755 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
12756 case "$d_drand48_r_proto:$usethreads" in
12757 ":define") d_drand48_r_proto=define
12758 set d_drand48_r_proto drand48_r $hdrs
12762 case "$d_drand48_r_proto" in
12764 case "$drand48_r_proto" in
12765 ''|0) try='int drand48_r(struct drand48_data*, double*);'
12766 ./protochk "$extern_C $try" $hdrs && drand48_r_proto=I_ST ;;
12768 case "$drand48_r_proto" in
12769 ''|0) d_drand48_r=undef
12771 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
12772 * ) case "$drand48_r_proto" in
12773 REENTRANT_PROTO*) ;;
12774 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
12776 echo "Prototype: $try" ;;
12779 *) case "$usethreads" in
12780 define) echo "drand48_r has no prototype, not using it." >&4 ;;
12787 *) drand48_r_proto=0
12791 : see if prototype for drand48 is available
12793 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
12796 : see if dup2 exists
12800 : see if eaccess exists
12801 set eaccess d_eaccess
12804 : see if endgrent exists
12805 set endgrent d_endgrent
12808 : see if this is an grp system
12814 xxx=`./findhdr grp.h`
12815 $cppstdin $cppflags $cppminus < $xxx >$$.h
12817 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
12829 set d_grpasswd; eval $setvar
12833 : see if endgrent_r exists
12834 set endgrent_r d_endgrent_r
12836 case "$d_endgrent_r" in
12838 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12839 case "$d_endgrent_r_proto:$usethreads" in
12840 ":define") d_endgrent_r_proto=define
12841 set d_endgrent_r_proto endgrent_r $hdrs
12845 case "$d_endgrent_r_proto" in
12847 case "$endgrent_r_proto" in
12848 ''|0) try='int endgrent_r(FILE**);'
12849 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=I_H ;;
12851 case "$endgrent_r_proto" in
12852 ''|0) try='void endgrent_r(FILE**);'
12853 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=V_H ;;
12855 case "$endgrent_r_proto" in
12856 ''|0) d_endgrent_r=undef
12858 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
12859 * ) case "$endgrent_r_proto" in
12860 REENTRANT_PROTO*) ;;
12861 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
12863 echo "Prototype: $try" ;;
12866 *) case "$usethreads" in
12867 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
12874 *) endgrent_r_proto=0
12878 : see if endhostent exists
12879 set endhostent d_endhent
12882 : see if this is a netdb.h system
12883 set netdb.h i_netdb
12886 : see if endhostent_r exists
12887 set endhostent_r d_endhostent_r
12889 case "$d_endhostent_r" in
12891 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12892 case "$d_endhostent_r_proto:$usethreads" in
12893 ":define") d_endhostent_r_proto=define
12894 set d_endhostent_r_proto endhostent_r $hdrs
12898 case "$d_endhostent_r_proto" in
12900 case "$endhostent_r_proto" in
12901 ''|0) try='int endhostent_r(struct hostent_data*);'
12902 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=I_D ;;
12904 case "$endhostent_r_proto" in
12905 ''|0) try='void endhostent_r(struct hostent_data*);'
12906 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=V_D ;;
12908 case "$endhostent_r_proto" in
12909 ''|0) d_endhostent_r=undef
12910 endhostent_r_proto=0
12911 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
12912 * ) case "$endhostent_r_proto" in
12913 REENTRANT_PROTO*) ;;
12914 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
12916 echo "Prototype: $try" ;;
12919 *) case "$usethreads" in
12920 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
12922 d_endhostent_r=undef
12923 endhostent_r_proto=0
12927 *) endhostent_r_proto=0
12931 : see if endnetent exists
12932 set endnetent d_endnent
12935 : see if endnetent_r exists
12936 set endnetent_r d_endnetent_r
12938 case "$d_endnetent_r" in
12940 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12941 case "$d_endnetent_r_proto:$usethreads" in
12942 ":define") d_endnetent_r_proto=define
12943 set d_endnetent_r_proto endnetent_r $hdrs
12947 case "$d_endnetent_r_proto" in
12949 case "$endnetent_r_proto" in
12950 ''|0) try='int endnetent_r(struct netent_data*);'
12951 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=I_D ;;
12953 case "$endnetent_r_proto" in
12954 ''|0) try='void endnetent_r(struct netent_data*);'
12955 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=V_D ;;
12957 case "$endnetent_r_proto" in
12958 ''|0) d_endnetent_r=undef
12959 endnetent_r_proto=0
12960 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
12961 * ) case "$endnetent_r_proto" in
12962 REENTRANT_PROTO*) ;;
12963 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
12965 echo "Prototype: $try" ;;
12968 *) case "$usethreads" in
12969 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
12971 d_endnetent_r=undef
12972 endnetent_r_proto=0
12976 *) endnetent_r_proto=0
12980 : see if endprotoent exists
12981 set endprotoent d_endpent
12984 : see if endprotoent_r exists
12985 set endprotoent_r d_endprotoent_r
12987 case "$d_endprotoent_r" in
12989 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12990 case "$d_endprotoent_r_proto:$usethreads" in
12991 ":define") d_endprotoent_r_proto=define
12992 set d_endprotoent_r_proto endprotoent_r $hdrs
12996 case "$d_endprotoent_r_proto" in
12998 case "$endprotoent_r_proto" in
12999 ''|0) try='int endprotoent_r(struct protoent_data*);'
13000 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=I_D ;;
13002 case "$endprotoent_r_proto" in
13003 ''|0) try='void endprotoent_r(struct protoent_data*);'
13004 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=V_D ;;
13006 case "$endprotoent_r_proto" in
13007 ''|0) d_endprotoent_r=undef
13008 endprotoent_r_proto=0
13009 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
13010 * ) case "$endprotoent_r_proto" in
13011 REENTRANT_PROTO*) ;;
13012 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
13014 echo "Prototype: $try" ;;
13017 *) case "$usethreads" in
13018 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
13020 d_endprotoent_r=undef
13021 endprotoent_r_proto=0
13025 *) endprotoent_r_proto=0
13029 : see if endpwent exists
13030 set endpwent d_endpwent
13033 : see if this is a pwd.h system
13039 xxx=`./findhdr pwd.h`
13040 $cppstdin $cppflags $cppminus < $xxx >$$.h
13042 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
13050 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
13058 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
13066 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
13074 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
13082 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
13090 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
13098 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
13110 set d_pwquota; eval $setvar
13111 set d_pwage; eval $setvar
13112 set d_pwchange; eval $setvar
13113 set d_pwclass; eval $setvar
13114 set d_pwexpire; eval $setvar
13115 set d_pwcomment; eval $setvar
13116 set d_pwgecos; eval $setvar
13117 set d_pwpasswd; eval $setvar
13121 : see if endpwent_r exists
13122 set endpwent_r d_endpwent_r
13124 case "$d_endpwent_r" in
13126 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13127 case "$d_endpwent_r_proto:$usethreads" in
13128 ":define") d_endpwent_r_proto=define
13129 set d_endpwent_r_proto endpwent_r $hdrs
13133 case "$d_endpwent_r_proto" in
13135 case "$endpwent_r_proto" in
13136 ''|0) try='int endpwent_r(FILE**);'
13137 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=I_H ;;
13139 case "$endpwent_r_proto" in
13140 ''|0) try='void endpwent_r(FILE**);'
13141 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=V_H ;;
13143 case "$endpwent_r_proto" in
13144 ''|0) d_endpwent_r=undef
13146 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
13147 * ) case "$endpwent_r_proto" in
13148 REENTRANT_PROTO*) ;;
13149 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
13151 echo "Prototype: $try" ;;
13154 *) case "$usethreads" in
13155 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
13162 *) endpwent_r_proto=0
13166 : see if endservent exists
13167 set endservent d_endsent
13170 : see if endservent_r exists
13171 set endservent_r d_endservent_r
13173 case "$d_endservent_r" in
13175 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13176 case "$d_endservent_r_proto:$usethreads" in
13177 ":define") d_endservent_r_proto=define
13178 set d_endservent_r_proto endservent_r $hdrs
13182 case "$d_endservent_r_proto" in
13184 case "$endservent_r_proto" in
13185 ''|0) try='int endservent_r(struct servent_data*);'
13186 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=I_D ;;
13188 case "$endservent_r_proto" in
13189 ''|0) try='void endservent_r(struct servent_data*);'
13190 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=V_D ;;
13192 case "$endservent_r_proto" in
13193 ''|0) d_endservent_r=undef
13194 endservent_r_proto=0
13195 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
13196 * ) case "$endservent_r_proto" in
13197 REENTRANT_PROTO*) ;;
13198 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
13200 echo "Prototype: $try" ;;
13203 *) case "$usethreads" in
13204 define) echo "endservent_r has no prototype, not using it." >&4 ;;
13206 d_endservent_r=undef
13207 endservent_r_proto=0
13211 *) endservent_r_proto=0
13215 : Locate the flags for 'open()'
13218 #include <sys/types.h>
13223 #include <sys/file.h>
13225 #$i_stdlib I_STDLIB
13227 #include <stdlib.h>
13238 : check sys/file.h first to get FREAD on Sun
13239 if $test `./findhdr sys/file.h` && \
13240 set try -DI_SYS_FILE && eval $compile; then
13242 echo "<sys/file.h> defines the O_* constants..." >&4
13243 if $run ./try; then
13244 echo "and you have the 3 argument form of open()." >&4
13247 echo "but not the 3 argument form of open(). Oh, well." >&4
13250 elif $test `./findhdr fcntl.h` && \
13251 set try -DI_FCNTL && eval $compile; then
13253 echo "<fcntl.h> defines the O_* constants..." >&4
13254 if $run ./try; then
13255 echo "and you have the 3 argument form of open()." >&4
13258 echo "but not the 3 argument form of open(). Oh, well." >&4
13263 echo "I can't find the O_* constant definitions! You got problems." >&4
13269 : see if this is a sys/file.h system
13274 : do we need to include sys/file.h ?
13278 if $h_sysfile; then
13280 echo "We'll be including <sys/file.h>." >&4
13283 echo "We won't be including <sys/file.h>." >&4
13293 : see if fcntl.h is there
13298 : see if we can include fcntl.h
13304 echo "We'll be including <fcntl.h>." >&4
13307 if $h_sysfile; then
13308 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
13310 echo "We won't be including <fcntl.h>." >&4
13322 : see if fork exists
13326 : see if pipe exists
13330 : check for non-blocking I/O stuff
13331 case "$h_sysfile" in
13332 true) echo "#include <sys/file.h>" > head.c;;
13335 true) echo "#include <fcntl.h>" > head.c;;
13336 *) echo "#include <sys/fcntl.h>" > head.c;;
13341 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
13342 case "$o_nonblock" in
13344 $cat head.c > try.c
13345 $cat >>try.c <<EOCP
13347 #$i_stdlib I_STDLIB
13349 #include <stdlib.h>
13357 printf("O_NONBLOCK\n");
13361 printf("O_NDELAY\n");
13365 printf("FNDELAY\n");
13372 if eval $compile_ok; then
13373 o_nonblock=`$run ./try`
13374 case "$o_nonblock" in
13375 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
13376 *) echo "Seems like we can use $o_nonblock.";;
13379 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
13382 *) echo "Using $hint value $o_nonblock.";;
13387 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
13390 case "$d_fork:$d_pipe:$d_alarm" in
13391 define:define:define)
13392 $cat head.c > try.c
13393 $cat >>try.c <<EOCP
13395 #include <sys/types.h>
13396 #include <signal.h>
13398 #$i_stdlib I_STDLIB
13400 #include <stdlib.h>
13406 #define MY_O_NONBLOCK $o_nonblock
13407 #ifndef errno /* XXX need better Configure test */
13410 #$i_unistd I_UNISTD
13412 #include <unistd.h>
13414 #$i_string I_STRING
13416 #include <string.h>
13418 #include <strings.h>
13420 $signal_t blech(int x) { exit(3); }
13422 $cat >> try.c <<'EOCP'
13431 ret = pipe(pd); /* Down: child -> parent */
13434 ret = pipe(pu); /* Up: parent -> child */
13438 close(pd[1]); /* Parent reads from pd[0] */
13439 close(pu[0]); /* Parent writes (blocking) to pu[1] */
13441 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
13446 signal(SIGALRM, blech);
13448 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
13450 sprintf(string, "%d\n", ret);
13451 ret = write(2, string, strlen(string));
13452 if (ret != strlen(string))
13456 if (errno == EAGAIN) {
13457 printf("EAGAIN\n");
13462 if (errno == EWOULDBLOCK)
13463 printf("EWOULDBLOCK\n");
13466 ret = write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
13469 sleep(2); /* Give it time to close our pipe */
13471 ret = read(pd[0], buf, 1); /* Should read EOF */
13473 sprintf(string, "%d\n", ret);
13474 ret = write(4, string, strlen(string));
13475 if (ret != strlen(string))
13480 close(pd[0]); /* We write to pd[1] */
13481 close(pu[1]); /* We read from pu[0] */
13482 ret = read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
13485 close(pd[1]); /* Pipe pd is now fully closed! */
13486 exit(0); /* Bye bye, thank you for playing! */
13490 if eval $compile_ok; then
13491 echo "$startsh" >mtry
13492 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
13494 $run ./mtry >/dev/null 2>&1
13496 0) eagain=`$cat try.out`;;
13497 1) echo "Could not perform non-blocking setting!";;
13498 2) echo "I did a successful read() for something that was not there!";;
13499 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
13500 4) echo "Could not find F_SETFL!";;
13501 *) echo "Something terribly wrong happened during testing.";;
13503 rd_nodata=`$cat try.ret`
13504 echo "A read() system call with no data present returns $rd_nodata."
13505 case "$rd_nodata" in
13508 echo "(That's peculiar, fixing that to be -1.)"
13514 echo "Forcing errno EAGAIN on read() with no data available."
13518 echo "Your read() sets errno to $eagain when no data is available."
13521 status=`$cat try.err`
13523 0) echo "And it correctly returns 0 to signal EOF.";;
13524 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
13525 *) echo "However, your read() returns '$status' on EOF??";;
13528 if test "$status" = "$rd_nodata"; then
13529 echo "WARNING: you can't distinguish between EOF and no data!"
13533 echo "I can't compile the test program--assuming errno EAGAIN will do."
13537 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
13546 echo "Using $hint value $eagain."
13547 echo "Your read() returns $rd_nodata when no data is present."
13548 case "$d_eofnblk" in
13549 "$define") echo "And you can see EOF because read() returns 0.";;
13550 "$undef") echo "But you can't see EOF status from read() returned value.";;
13552 echo "(Assuming you can't see EOF status from read anyway.)"
13558 $rm_try head.c mtry
13560 : see if erf exists
13564 : see if erfc exists
13568 : see if exp2 exists
13572 : see if expm1 exists
13576 : see if _ptr and _cnt from stdio act std
13579 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
13580 echo "(Looks like you have stdio.h from BSD.)"
13581 case "$stdio_ptr" in
13582 '') stdio_ptr='((fp)->_p)'
13585 *) ptr_lval=$d_stdio_ptr_lval;;
13587 case "$stdio_cnt" in
13588 '') stdio_cnt='((fp)->_r)'
13591 *) cnt_lval=$d_stdio_cnt_lval;;
13593 case "$stdio_base" in
13594 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
13596 case "$stdio_bufsiz" in
13597 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
13599 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
13600 echo "(Looks like you have stdio.h from Linux.)"
13601 case "$stdio_ptr" in
13602 '') stdio_ptr='((fp)->_IO_read_ptr)'
13605 *) ptr_lval=$d_stdio_ptr_lval;;
13607 case "$stdio_cnt" in
13608 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
13611 *) cnt_lval=$d_stdio_cnt_lval;;
13613 case "$stdio_base" in
13614 '') stdio_base='((fp)->_IO_read_base)';;
13616 case "$stdio_bufsiz" in
13617 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
13620 case "$stdio_ptr" in
13621 '') stdio_ptr='((fp)->_ptr)'
13624 *) ptr_lval=$d_stdio_ptr_lval;;
13626 case "$stdio_cnt" in
13627 '') stdio_cnt='((fp)->_cnt)'
13630 *) cnt_lval=$d_stdio_cnt_lval;;
13632 case "$stdio_base" in
13633 '') stdio_base='((fp)->_base)';;
13635 case "$stdio_bufsiz" in
13636 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
13640 : test whether _ptr and _cnt really work
13641 echo "Checking how std your stdio is..." >&4
13644 #$i_stdlib I_STDLIB
13646 #include <stdlib.h>
13648 #define FILE_ptr(fp) $stdio_ptr
13649 #define FILE_cnt(fp) $stdio_cnt
13651 FILE *fp = fopen("try.c", "r");
13654 18 <= FILE_cnt(fp) &&
13655 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13663 if eval $compile && $to try.c; then
13664 if $run ./try; then
13665 echo "Your stdio acts pretty std."
13668 echo "Your stdio isn't very std."
13671 echo "Your stdio doesn't appear very std."
13675 # glibc 2.2.90 and above apparently change stdio streams so Perl's
13676 # direct buffer manipulation no longer works. The Configure tests
13677 # should be changed to correctly detect this, but until then,
13678 # the following check should at least let perl compile and run.
13679 # (This quick fix should be updated before 5.8.1.)
13680 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
13681 # A. Dougherty, June 3, 2002.
13682 case "$d_gnulibc" in
13684 case "$gnulibc_version" in
13688 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
13697 : Can _ptr be used as an lvalue?
13698 case "$d_stdstdio$ptr_lval" in
13699 $define$define) val=$define ;;
13702 set d_stdio_ptr_lval
13705 : Can _cnt be used as an lvalue?
13706 case "$d_stdstdio$cnt_lval" in
13707 $define$define) val=$define ;;
13710 set d_stdio_cnt_lval
13714 : test whether setting _ptr sets _cnt as a side effect
13715 d_stdio_ptr_lval_sets_cnt="$undef"
13716 d_stdio_ptr_lval_nochange_cnt="$undef"
13717 case "$d_stdio_ptr_lval$d_stdstdio" in
13719 echo "Checking to see what happens if we set the stdio ptr..." >&4
13722 /* Can we scream? */
13723 /* Eat dust sed :-) */
13724 /* In the buffer space, no one can hear you scream. */
13725 #$i_stdlib I_STDLIB
13727 #include <stdlib.h>
13729 #define FILE_ptr(fp) $stdio_ptr
13730 #define FILE_cnt(fp) $stdio_cnt
13731 #include <sys/types.h>
13733 FILE *fp = fopen("try.c", "r");
13738 puts("Fail even to read");
13741 c = getc(fp); /* Read away the first # */
13743 puts("Fail even to read");
13747 18 <= FILE_cnt(fp) &&
13748 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13750 puts("Fail even to read");
13753 ptr = (char*) FILE_ptr(fp);
13754 cnt = (size_t)FILE_cnt(fp);
13756 FILE_ptr(fp) += 42;
13758 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
13759 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
13762 if (FILE_cnt(fp) <= 20) {
13763 printf ("Fail (<20 chars to test)");
13766 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
13767 puts("Fail compare");
13770 if (cnt == FILE_cnt(fp)) {
13771 puts("Pass_unchanged");
13774 if (FILE_cnt(fp) == (cnt - 42)) {
13775 puts("Pass_changed");
13778 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
13784 if eval $compile && $to try.c; then
13785 case `$run ./try` in
13787 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
13788 d_stdio_ptr_lval_sets_cnt="$define" ;;
13790 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
13791 d_stdio_ptr_lval_nochange_cnt="$define" ;;
13793 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
13795 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
13798 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
13804 : see if _base is also standard
13806 case "$d_stdstdio" in
13810 #$i_stdlib I_STDLIB
13812 #include <stdlib.h>
13814 #define FILE_base(fp) $stdio_base
13815 #define FILE_bufsiz(fp) $stdio_bufsiz
13817 FILE *fp = fopen("try.c", "r");
13820 19 <= FILE_bufsiz(fp) &&
13821 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
13828 if eval $compile && $to try.c; then
13829 if $run ./try; then
13830 echo "And its _base field acts std."
13833 echo "But its _base field isn't std."
13836 echo "However, it seems to be lacking the _base field."
13844 : see if fast_stdio exists
13846 case "$d_stdstdio:$d_stdio_ptr_lval" in
13848 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
13850 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
13861 : see if fchdir exists
13862 set fchdir d_fchdir
13865 : see if fchmod exists
13866 set fchmod d_fchmod
13869 : see if fchown exists
13870 set fchown d_fchown
13873 : see if this is an fcntl system
13877 : See if fcntl-based locking works.
13880 #$i_stdlib I_STDLIB
13882 #include <stdlib.h>
13884 #include <unistd.h>
13886 #include <signal.h>
13887 $signal_t blech(int x) { exit(3); }
13889 #if defined(F_SETLK) && defined(F_SETLKW)
13890 struct flock flock;
13892 fd = open("try.c", O_RDONLY);
13893 flock.l_type = F_RDLCK;
13894 flock.l_whence = SEEK_SET;
13895 flock.l_start = flock.l_len = 0;
13896 signal(SIGALRM, blech);
13898 retval = fcntl(fd, F_SETLK, &flock);
13900 (retval < 0 ? exit(2) : exit(0));
13906 echo "Checking if fcntl-based file locking works... "
13910 if eval $compile_ok; then
13911 if $run ./try; then
13912 echo "Yes, it seems to work."
13915 echo "Nope, it didn't work."
13920 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
13921 *** This is (almost) impossible.
13922 *** If your NFS lock daemons are not feeling well, something like
13923 *** this may happen, please investigate. Cannot continue, aborting.
13931 echo "I'm unable to compile the test program, so I'll assume not."
13936 echo "Nope, since you don't even have fcntl()."
13939 set d_fcntl_can_lock
13943 : check for fd_set items
13946 Checking to see how well your C compiler handles fd_set and friends ...
13949 #$i_stdlib I_STDLIB
13951 #include <stdlib.h>
13953 #$i_systime I_SYS_TIME
13954 #$i_sysselct I_SYS_SELECT
13955 #$d_socket HAS_SOCKET
13956 #include <sys/types.h>
13958 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
13961 #include <sys/time.h>
13963 #ifdef I_SYS_SELECT
13964 #include <sys/select.h>
13973 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
13981 if eval $compile; then
13982 d_fds_bits="$define"
13984 echo "Well, your system knows about the normal fd_set typedef..." >&4
13985 if $run ./try; then
13986 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
13987 d_fd_macros="$define"
13990 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
13992 d_fd_macros="$undef"
13996 Hmm, your compiler has some difficulty with fd_set. Checking further...
13999 if eval $compile; then
14000 d_fds_bits="$undef"
14002 echo "Well, your system has some sort of fd_set available..." >&4
14003 if $run ./try; then
14004 echo "and you have the normal fd_set macros." >&4
14005 d_fd_macros="$define"
14008 but not the normal fd_set macros! Gross! More work for me...
14010 d_fd_macros="$undef"
14013 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
14015 d_fds_bits="$undef"
14016 d_fd_macros="$undef"
14021 : see if fdclose exists
14022 set fdclose d_fdclose
14025 : see if fdim exists
14029 : see if fegetround exists
14030 set fegetround d_fegetround
14033 : see if fgetpos exists
14034 set fgetpos d_fgetpos
14037 : see if finite exists
14038 set finite d_finite
14041 : see if finitel exists
14042 set finitel d_finitel
14045 : see if flock exists
14049 : see if prototype for flock is available
14051 set d_flockproto flock $i_sysfile sys/file.h
14054 : see if fma exists
14058 : see if fmax exists
14062 : see if fmin exists
14066 : see if fp_class exists
14067 set fp_class d_fp_class
14070 : see if this is a math.h system
14074 : check for fpclassify
14075 echo "Checking to see if you have fpclassify..." >&4
14081 int main() { return fpclassify(1.0) == FP_NORMAL ? 0 : 1; }
14084 if eval $compile; then
14086 echo "You have fpclassify."
14089 echo "You do not have fpclassify."
14095 : see if fp_classify exists
14096 set fp_classify d_fp_classify
14099 : see if fp_classl exists
14100 set fp_classl d_fp_classl
14103 : see if pathconf exists
14104 set pathconf d_pathconf
14107 : see if fpathconf exists
14108 set fpathconf d_fpathconf
14111 : see if fpclass exists
14112 set fpclass d_fpclass
14115 : see if fpclassl exists
14116 set fpclassl d_fpclassl
14119 : see if fpgetround exists
14120 set fpgetround d_fpgetround
14123 : check for fpos64_t
14125 echo "Checking to see if you have fpos64_t..." >&4
14128 int main() { fpos64_t x = 7; }
14131 if eval $compile; then
14133 echo "You have fpos64_t."
14136 echo "You do not have fpos64_t."
14137 case "$fpossize" in
14138 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
14145 : see if frexpl exists
14146 set frexpl d_frexpl
14149 : see if this is a sys/param system
14150 set sys/param.h i_sysparam
14153 : see if this is a sys/mount.h system
14154 set sys/mount.h i_sysmount
14157 : Check for fs_data_s
14159 echo "Checking to see if your system supports struct fs_data..." >&4
14160 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
14162 case "$d_fs_data_s" in
14163 "$define") echo "Yes, it does." ;;
14164 *) echo "No, it doesn't." ;;
14167 : see if fseeko exists
14168 set fseeko d_fseeko
14170 case "$longsize" in
14171 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
14174 : see if fsetpos exists
14175 set fsetpos d_fsetpos
14178 : see if fstatfs exists
14179 set fstatfs d_fstatfs
14182 : see if statvfs exists
14183 set statvfs d_statvfs
14186 : see if fstatvfs exists
14187 set fstatvfs d_fstatvfs
14191 : see if fsync exists
14195 : see if ftello exists
14196 set ftello d_ftello
14198 case "$longsize" in
14199 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
14202 : check for a working futimes
14205 echo "Checking if you have a working futimes()" >&4
14208 #include <sys/time.h>
14215 fd = open ("try.c", O_RDWR);
14216 if (-1 == fd) exit (1);
14217 rv = futimes (fd, NULL);
14218 exit (rv == -1 ? errno : 0);
14222 if eval $compile; then
14226 0) echo "Yes, you have" >&4
14227 d_futimes="$define"
14229 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
14233 echo "No, it does not (probably harmless)" >&4
14237 : see if ndbm.h is available
14240 : Compatibility location for RedHat 7.1
14241 set gdbm/ndbm.h i_gdbmndbm
14243 : Compatibility location for Debian 4.0
14244 set gdbm-ndbm.h i_gdbm_ndbm
14248 if $test "$i_ndbm" = "$define" -o "$i_gdbmndbm" = "$define" -o "$i_gdbm_ndbm" = "$define"; then
14249 : see if dbm_open exists
14250 set dbm_open d_dbm_open
14252 case "$d_dbm_open" in
14255 i_gdbmndbm="$undef"
14256 i_gdbm_ndbm="$undef"
14257 echo "We won't be including <ndbm.h>"
14267 ndbm_hdr_protochk='name=$1; hdr=$2;
14268 eval "ihdr=\$""i_$name";
14270 if $test "$ihdr" = "$define"; then
14271 $echo "Checking if your <$hdr> uses prototypes..." >&4;
14272 case "$d_cplusplus" in
14273 $define) ./protochk "$extern_C void dbm_close(DBM *);" literal "extern \"C\" {" $ihdr $hdr literal "}" && val="$define" ;;
14274 *) ./protochk "$extern_C void dbm_close(int, int);" $ihdr $hdr || val="$define" ;;
14277 $define) $echo "Your <$hdr> seems to have prototypes";;
14278 *) $echo "Your <$hdr> does not seem to have prototypes";;
14281 set "d_${name}_h_uses_prototypes";
14285 eval $ndbm_hdr_protochk
14286 set gdbmndbm gdbm/ndbm.h
14287 eval $ndbm_hdr_protochk
14288 set gdbm_ndbm gdbm-ndbm.h
14289 eval $ndbm_hdr_protochk
14291 : see if getaddrinfo exists
14292 set getaddrinfo d_getaddrinfo
14295 : see if getcwd exists
14296 set getcwd d_getcwd
14299 : see if getespwnam exists
14300 set getespwnam d_getespwnam
14303 : see if getfsstat exists
14304 set getfsstat d_getfsstat
14307 : see if getgrent exists
14308 set getgrent d_getgrent
14311 : see if getgrent_r exists
14312 set getgrent_r d_getgrent_r
14314 case "$d_getgrent_r" in
14316 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14317 case "$d_getgrent_r_proto:$usethreads" in
14318 ":define") d_getgrent_r_proto=define
14319 set d_getgrent_r_proto getgrent_r $hdrs
14323 case "$d_getgrent_r_proto" in
14325 case "$getgrent_r_proto" in
14326 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
14327 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBWR ;;
14329 case "$getgrent_r_proto" in
14330 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
14331 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIR ;;
14333 case "$getgrent_r_proto" in
14334 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
14335 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBW ;;
14337 case "$getgrent_r_proto" in
14338 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
14339 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBI ;;
14341 case "$getgrent_r_proto" in
14342 ''|0) try='int getgrent_r(struct group*, char*, int);'
14343 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBI ;;
14345 case "$getgrent_r_proto" in
14346 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
14347 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIH ;;
14349 case "$getgrent_r_proto" in
14350 ''|0) d_getgrent_r=undef
14352 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
14353 * ) case "$getgrent_r_proto" in
14354 REENTRANT_PROTO*) ;;
14355 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
14357 echo "Prototype: $try" ;;
14360 *) case "$usethreads" in
14361 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
14368 *) getgrent_r_proto=0
14372 : see if getgrgid_r exists
14373 set getgrgid_r d_getgrgid_r
14375 case "$d_getgrgid_r" in
14377 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14378 case "$d_getgrgid_r_proto:$usethreads" in
14379 ":define") d_getgrgid_r_proto=define
14380 set d_getgrgid_r_proto getgrgid_r $hdrs
14384 case "$d_getgrgid_r_proto" in
14386 case "$getgrgid_r_proto" in
14387 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
14388 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
14390 case "$getgrgid_r_proto" in
14391 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
14392 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
14394 case "$getgrgid_r_proto" in
14395 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
14396 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
14398 case "$getgrgid_r_proto" in
14399 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
14400 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
14402 case "$getgrgid_r_proto" in
14403 ''|0) d_getgrgid_r=undef
14405 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
14406 * ) case "$getgrgid_r_proto" in
14407 REENTRANT_PROTO*) ;;
14408 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
14410 echo "Prototype: $try" ;;
14413 *) case "$usethreads" in
14414 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
14421 *) getgrgid_r_proto=0
14425 : see if getgrnam_r exists
14426 set getgrnam_r d_getgrnam_r
14428 case "$d_getgrnam_r" in
14430 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14431 case "$d_getgrnam_r_proto:$usethreads" in
14432 ":define") d_getgrnam_r_proto=define
14433 set d_getgrnam_r_proto getgrnam_r $hdrs
14437 case "$d_getgrnam_r_proto" in
14439 case "$getgrnam_r_proto" in
14440 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
14441 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
14443 case "$getgrnam_r_proto" in
14444 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
14445 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
14447 case "$getgrnam_r_proto" in
14448 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
14449 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CBI ;;
14451 case "$getgrnam_r_proto" in
14452 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
14453 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
14455 case "$getgrnam_r_proto" in
14456 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
14457 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
14459 case "$getgrnam_r_proto" in
14460 ''|0) d_getgrnam_r=undef
14462 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
14463 * ) case "$getgrnam_r_proto" in
14464 REENTRANT_PROTO*) ;;
14465 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
14467 echo "Prototype: $try" ;;
14470 *) case "$usethreads" in
14471 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
14478 *) getgrnam_r_proto=0
14482 : see if gethostbyaddr exists
14483 set gethostbyaddr d_gethbyaddr
14486 : see if gethostbyname exists
14487 set gethostbyname d_gethbyname
14490 : see if gethostent exists
14491 set gethostent d_gethent
14494 : see how we will look up host name
14497 if set gethostname val -f d_gethname; eval $csym; $val; then
14498 echo 'gethostname() found.' >&4
14499 d_gethname="$define"
14502 if set uname val -f d_uname; eval $csym; $val; then
14505 uname() was found, but you're running xenix, and older versions of xenix
14506 have a broken uname(). If you don't really know whether your xenix is old
14507 enough to have a broken system call, use the default answer.
14512 "$define") dflt=n;;
14514 rp='Is your uname() broken?'
14517 n*) d_uname="$define"; call=uname;;
14520 echo 'uname() found.' >&4
14527 case "$d_gethname" in
14528 '') d_gethname="$undef";;
14531 '') d_uname="$undef";;
14533 case "$d_uname$d_gethname" in
14538 Every now and then someone has a $call() that lies about the hostname
14539 but can't be fixed for political or economic reasons. If you wish, I can
14540 pretend $call() isn't there and maybe compute hostname at run-time
14541 thanks to the '$phostname' command.
14544 rp="Shall I ignore $call() from now on?"
14547 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
14550 case "$phostname" in
14551 '') aphostname='';;
14552 *) case "$aphostname" in
14554 *) set X $phostname
14558 file=`./loc $file $file $pth`
14559 aphostname=`echo $file $*`
14564 case "$d_uname$d_gethname" in
14567 case "$phostname" in
14569 echo "There will be no way for $package to get your hostname." >&4;;
14571 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
14575 case "$d_phostname" in
14576 '') d_phostname="$undef";;
14579 : see if gethostbyaddr_r exists
14580 set gethostbyaddr_r d_gethostbyaddr_r
14582 case "$d_gethostbyaddr_r" in
14584 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14585 case "$d_gethostbyaddr_r_proto:$usethreads" in
14586 ":define") d_gethostbyaddr_r_proto=define
14587 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
14591 case "$d_gethostbyaddr_r_proto" in
14593 case "$gethostbyaddr_r_proto" in
14594 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
14595 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
14597 case "$gethostbyaddr_r_proto" in
14598 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
14599 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
14601 case "$gethostbyaddr_r_proto" in
14602 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
14603 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
14605 case "$gethostbyaddr_r_proto" in
14606 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
14607 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
14609 case "$gethostbyaddr_r_proto" in
14610 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
14611 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
14613 case "$gethostbyaddr_r_proto" in
14614 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
14615 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
14617 case "$gethostbyaddr_r_proto" in
14618 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
14619 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
14621 case "$gethostbyaddr_r_proto" in
14622 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
14623 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
14625 case "$gethostbyaddr_r_proto" in
14626 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
14627 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
14629 case "$gethostbyaddr_r_proto" in
14630 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
14631 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
14633 case "$gethostbyaddr_r_proto" in
14634 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
14635 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
14637 case "$gethostbyaddr_r_proto" in
14638 ''|0) d_gethostbyaddr_r=undef
14639 gethostbyaddr_r_proto=0
14640 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
14641 * ) case "$gethostbyaddr_r_proto" in
14642 REENTRANT_PROTO*) ;;
14643 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
14645 echo "Prototype: $try" ;;
14648 *) case "$usethreads" in
14649 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
14651 d_gethostbyaddr_r=undef
14652 gethostbyaddr_r_proto=0
14656 *) gethostbyaddr_r_proto=0
14660 : see if gethostbyname_r exists
14661 set gethostbyname_r d_gethostbyname_r
14663 case "$d_gethostbyname_r" in
14665 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14666 case "$d_gethostbyname_r_proto:$usethreads" in
14667 ":define") d_gethostbyname_r_proto=define
14668 set d_gethostbyname_r_proto gethostbyname_r $hdrs
14672 case "$d_gethostbyname_r_proto" in
14674 case "$gethostbyname_r_proto" in
14675 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
14676 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
14678 case "$gethostbyname_r_proto" in
14679 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
14680 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
14682 case "$gethostbyname_r_proto" in
14683 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
14684 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
14686 case "$gethostbyname_r_proto" in
14687 ''|0) d_gethostbyname_r=undef
14688 gethostbyname_r_proto=0
14689 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
14690 * ) case "$gethostbyname_r_proto" in
14691 REENTRANT_PROTO*) ;;
14692 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
14694 echo "Prototype: $try" ;;
14697 *) case "$usethreads" in
14698 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
14700 d_gethostbyname_r=undef
14701 gethostbyname_r_proto=0
14705 *) gethostbyname_r_proto=0
14709 : see if gethostent_r exists
14710 set gethostent_r d_gethostent_r
14712 case "$d_gethostent_r" in
14714 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14715 case "$d_gethostent_r_proto:$usethreads" in
14716 ":define") d_gethostent_r_proto=define
14717 set d_gethostent_r_proto gethostent_r $hdrs
14721 case "$d_gethostent_r_proto" in
14723 case "$gethostent_r_proto" in
14724 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
14725 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
14727 case "$gethostent_r_proto" in
14728 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
14729 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBIE ;;
14731 case "$gethostent_r_proto" in
14732 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
14733 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBIE ;;
14735 case "$gethostent_r_proto" in
14736 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
14737 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBI ;;
14739 case "$gethostent_r_proto" in
14740 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
14741 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBI ;;
14743 case "$gethostent_r_proto" in
14744 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
14745 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SD ;;
14747 case "$gethostent_r_proto" in
14748 ''|0) d_gethostent_r=undef
14749 gethostent_r_proto=0
14750 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
14751 * ) case "$gethostent_r_proto" in
14752 REENTRANT_PROTO*) ;;
14753 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
14755 echo "Prototype: $try" ;;
14758 *) case "$usethreads" in
14759 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
14761 d_gethostent_r=undef
14762 gethostent_r_proto=0
14766 *) gethostent_r_proto=0
14770 : see if prototypes for various gethostxxx netdb.h functions are available
14772 set d_gethostprotos gethostent $i_netdb netdb.h
14775 : see if getitimer exists
14776 set getitimer d_getitimer
14779 : see if getlogin exists
14780 set getlogin d_getlogin
14783 : see if getlogin_r exists
14784 set getlogin_r d_getlogin_r
14786 case "$d_getlogin_r" in
14788 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
14789 case "$d_getlogin_r_proto:$usethreads" in
14790 ":define") d_getlogin_r_proto=define
14791 set d_getlogin_r_proto getlogin_r $hdrs
14795 case "$d_getlogin_r_proto" in
14797 case "$getlogin_r_proto" in
14798 ''|0) try='int getlogin_r(char*, size_t);'
14799 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BW ;;
14801 case "$getlogin_r_proto" in
14802 ''|0) try='int getlogin_r(char*, int);'
14803 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BI ;;
14805 case "$getlogin_r_proto" in
14806 ''|0) try='char* getlogin_r(char*, size_t);'
14807 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BW ;;
14809 case "$getlogin_r_proto" in
14810 ''|0) try='char* getlogin_r(char*, int);'
14811 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BI ;;
14813 case "$getlogin_r_proto" in
14814 ''|0) d_getlogin_r=undef
14816 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
14817 * ) case "$getlogin_r_proto" in
14818 REENTRANT_PROTO*) ;;
14819 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
14821 echo "Prototype: $try" ;;
14824 *) case "$usethreads" in
14825 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
14832 *) getlogin_r_proto=0
14836 : see if getmnt exists
14837 set getmnt d_getmnt
14840 : see if getmntent exists
14841 set getmntent d_getmntent
14844 : see if getnameinfo exists
14845 set getnameinfo d_getnameinfo
14848 : see if getnetbyaddr exists
14849 set getnetbyaddr d_getnbyaddr
14852 : see if getnetbyname exists
14853 set getnetbyname d_getnbyname
14856 : see if getnetent exists
14857 set getnetent d_getnent
14860 : see if getnetbyaddr_r exists
14861 set getnetbyaddr_r d_getnetbyaddr_r
14863 case "$d_getnetbyaddr_r" in
14865 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14866 case "$d_getnetbyaddr_r_proto:$usethreads" in
14867 ":define") d_getnetbyaddr_r_proto=define
14868 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
14872 case "$d_getnetbyaddr_r_proto" in
14874 case "$getnetbyaddr_r_proto" in
14875 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
14876 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
14878 case "$getnetbyaddr_r_proto" in
14879 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
14880 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
14882 case "$getnetbyaddr_r_proto" in
14883 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
14884 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
14886 case "$getnetbyaddr_r_proto" in
14887 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
14888 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
14890 case "$getnetbyaddr_r_proto" in
14891 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
14892 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
14894 case "$getnetbyaddr_r_proto" in
14895 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
14896 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
14898 case "$getnetbyaddr_r_proto" in
14899 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
14900 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
14902 case "$getnetbyaddr_r_proto" in
14903 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
14904 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
14906 case "$getnetbyaddr_r_proto" in
14907 ''|0) d_getnetbyaddr_r=undef
14908 getnetbyaddr_r_proto=0
14909 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
14910 * ) case "$getnetbyaddr_r_proto" in
14911 REENTRANT_PROTO*) ;;
14912 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
14914 echo "Prototype: $try" ;;
14917 *) case "$usethreads" in
14918 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
14920 d_getnetbyaddr_r=undef
14921 getnetbyaddr_r_proto=0
14925 *) getnetbyaddr_r_proto=0
14929 : see if getnetbyname_r exists
14930 set getnetbyname_r d_getnetbyname_r
14932 case "$d_getnetbyname_r" in
14934 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14935 case "$d_getnetbyname_r_proto:$usethreads" in
14936 ":define") d_getnetbyname_r_proto=define
14937 set d_getnetbyname_r_proto getnetbyname_r $hdrs
14941 case "$d_getnetbyname_r_proto" in
14943 case "$getnetbyname_r_proto" in
14944 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
14945 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
14947 case "$getnetbyname_r_proto" in
14948 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
14949 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
14951 case "$getnetbyname_r_proto" in
14952 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
14953 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
14955 case "$getnetbyname_r_proto" in
14956 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
14957 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
14959 case "$getnetbyname_r_proto" in
14960 ''|0) d_getnetbyname_r=undef
14961 getnetbyname_r_proto=0
14962 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
14963 * ) case "$getnetbyname_r_proto" in
14964 REENTRANT_PROTO*) ;;
14965 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
14967 echo "Prototype: $try" ;;
14970 *) case "$usethreads" in
14971 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
14973 d_getnetbyname_r=undef
14974 getnetbyname_r_proto=0
14978 *) getnetbyname_r_proto=0
14982 : see if getnetent_r exists
14983 set getnetent_r d_getnetent_r
14985 case "$d_getnetent_r" in
14987 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14988 case "$d_getnetent_r_proto:$usethreads" in
14989 ":define") d_getnetent_r_proto=define
14990 set d_getnetent_r_proto getnetent_r $hdrs
14994 case "$d_getnetent_r_proto" in
14996 case "$getnetent_r_proto" in
14997 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
14998 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
15000 case "$getnetent_r_proto" in
15001 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
15002 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBIE ;;
15004 case "$getnetent_r_proto" in
15005 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
15006 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBIE ;;
15008 case "$getnetent_r_proto" in
15009 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
15010 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBI ;;
15012 case "$getnetent_r_proto" in
15013 ''|0) try='int getnetent_r(struct netent*, char*, int);'
15014 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBI ;;
15016 case "$getnetent_r_proto" in
15017 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
15018 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SD ;;
15020 case "$getnetent_r_proto" in
15021 ''|0) d_getnetent_r=undef
15022 getnetent_r_proto=0
15023 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
15024 * ) case "$getnetent_r_proto" in
15025 REENTRANT_PROTO*) ;;
15026 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
15028 echo "Prototype: $try" ;;
15031 *) case "$usethreads" in
15032 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
15034 d_getnetent_r=undef
15035 getnetent_r_proto=0
15039 *) getnetent_r_proto=0
15043 : see if prototypes for various getnetxxx netdb.h functions are available
15045 set d_getnetprotos getnetent $i_netdb netdb.h
15048 : see if getpagesize exists
15049 set getpagesize d_getpagsz
15052 : Optional checks for getprotobyname and getprotobynumber
15054 : see if getprotobyname exists
15055 set getprotobyname d_getpbyname
15058 : see if getprotobynumber exists
15059 set getprotobynumber d_getpbynumber
15062 : see if getprotoent exists
15063 set getprotoent d_getpent
15066 : see if getpgid exists
15067 set getpgid d_getpgid
15070 : see if getpgrp2 exists
15071 set getpgrp2 d_getpgrp2
15074 : see if getppid exists
15075 set getppid d_getppid
15078 : see if getpriority exists
15079 set getpriority d_getprior
15082 : see if getprotobyname_r exists
15083 set getprotobyname_r d_getprotobyname_r
15085 case "$d_getprotobyname_r" in
15087 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15088 case "$d_getprotobyname_r_proto:$usethreads" in
15089 ":define") d_getprotobyname_r_proto=define
15090 set d_getprotobyname_r_proto getprotobyname_r $hdrs
15094 case "$d_getprotobyname_r_proto" in
15096 case "$getprotobyname_r_proto" in
15097 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
15098 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
15100 case "$getprotobyname_r_proto" in
15101 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
15102 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
15104 case "$getprotobyname_r_proto" in
15105 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
15106 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
15108 case "$getprotobyname_r_proto" in
15109 ''|0) d_getprotobyname_r=undef
15110 getprotobyname_r_proto=0
15111 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
15112 * ) case "$getprotobyname_r_proto" in
15113 REENTRANT_PROTO*) ;;
15114 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
15116 echo "Prototype: $try" ;;
15119 *) case "$usethreads" in
15120 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
15122 d_getprotobyname_r=undef
15123 getprotobyname_r_proto=0
15127 *) getprotobyname_r_proto=0
15131 : see if getprotobynumber_r exists
15132 set getprotobynumber_r d_getprotobynumber_r
15134 case "$d_getprotobynumber_r" in
15136 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15137 case "$d_getprotobynumber_r_proto:$usethreads" in
15138 ":define") d_getprotobynumber_r_proto=define
15139 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
15143 case "$d_getprotobynumber_r_proto" in
15145 case "$getprotobynumber_r_proto" in
15146 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
15147 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
15149 case "$getprotobynumber_r_proto" in
15150 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
15151 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
15153 case "$getprotobynumber_r_proto" in
15154 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
15155 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
15157 case "$getprotobynumber_r_proto" in
15158 ''|0) d_getprotobynumber_r=undef
15159 getprotobynumber_r_proto=0
15160 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
15161 * ) case "$getprotobynumber_r_proto" in
15162 REENTRANT_PROTO*) ;;
15163 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
15165 echo "Prototype: $try" ;;
15168 *) case "$usethreads" in
15169 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
15171 d_getprotobynumber_r=undef
15172 getprotobynumber_r_proto=0
15176 *) getprotobynumber_r_proto=0
15180 : see if getprotoent_r exists
15181 set getprotoent_r d_getprotoent_r
15183 case "$d_getprotoent_r" in
15185 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15186 case "$d_getprotoent_r_proto:$usethreads" in
15187 ":define") d_getprotoent_r_proto=define
15188 set d_getprotoent_r_proto getprotoent_r $hdrs
15192 case "$d_getprotoent_r_proto" in
15194 case "$getprotoent_r_proto" in
15195 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
15196 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
15198 case "$getprotoent_r_proto" in
15199 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
15200 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBI ;;
15202 case "$getprotoent_r_proto" in
15203 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
15204 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=S_SBI ;;
15206 case "$getprotoent_r_proto" in
15207 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
15208 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SD ;;
15210 case "$getprotoent_r_proto" in
15211 ''|0) d_getprotoent_r=undef
15212 getprotoent_r_proto=0
15213 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
15214 * ) case "$getprotoent_r_proto" in
15215 REENTRANT_PROTO*) ;;
15216 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
15218 echo "Prototype: $try" ;;
15221 *) case "$usethreads" in
15222 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
15224 d_getprotoent_r=undef
15225 getprotoent_r_proto=0
15229 *) getprotoent_r_proto=0
15233 : see if prototypes for various getprotoxxx netdb.h functions are available
15235 set d_getprotoprotos getprotoent $i_netdb netdb.h
15238 : see if getprpwnam exists
15239 set getprpwnam d_getprpwnam
15242 : see if getpwent exists
15243 set getpwent d_getpwent
15246 : see if getpwent_r exists
15247 set getpwent_r d_getpwent_r
15249 case "$d_getpwent_r" in
15251 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15252 case "$d_getpwent_r_proto:$usethreads" in
15253 ":define") d_getpwent_r_proto=define
15254 set d_getpwent_r_proto getpwent_r $hdrs
15258 case "$d_getpwent_r_proto" in
15260 case "$getpwent_r_proto" in
15261 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
15262 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBWR ;;
15264 case "$getpwent_r_proto" in
15265 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
15266 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIR ;;
15268 case "$getpwent_r_proto" in
15269 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
15270 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBW ;;
15272 case "$getpwent_r_proto" in
15273 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
15274 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBI ;;
15276 case "$getpwent_r_proto" in
15277 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
15278 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBI ;;
15280 case "$getpwent_r_proto" in
15281 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
15282 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIH ;;
15284 case "$getpwent_r_proto" in
15285 ''|0) d_getpwent_r=undef
15287 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
15288 * ) case "$getpwent_r_proto" in
15289 REENTRANT_PROTO*) ;;
15290 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
15292 echo "Prototype: $try" ;;
15295 *) case "$usethreads" in
15296 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
15303 *) getpwent_r_proto=0
15307 : see if getpwnam_r exists
15308 set getpwnam_r d_getpwnam_r
15310 case "$d_getpwnam_r" in
15312 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15313 case "$d_getpwnam_r_proto:$usethreads" in
15314 ":define") d_getpwnam_r_proto=define
15315 set d_getpwnam_r_proto getpwnam_r $hdrs
15319 case "$d_getpwnam_r_proto" in
15321 case "$getpwnam_r_proto" in
15322 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
15323 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
15325 case "$getpwnam_r_proto" in
15326 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
15327 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
15329 case "$getpwnam_r_proto" in
15330 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
15331 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
15333 case "$getpwnam_r_proto" in
15334 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
15335 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
15337 case "$getpwnam_r_proto" in
15338 ''|0) d_getpwnam_r=undef
15340 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
15341 * ) case "$getpwnam_r_proto" in
15342 REENTRANT_PROTO*) ;;
15343 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
15345 echo "Prototype: $try" ;;
15348 *) case "$usethreads" in
15349 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
15356 *) getpwnam_r_proto=0
15360 : see if getpwuid_r exists
15361 set getpwuid_r d_getpwuid_r
15363 case "$d_getpwuid_r" in
15365 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15366 case "$d_getpwuid_r_proto:$usethreads" in
15367 ":define") d_getpwuid_r_proto=define
15368 set d_getpwuid_r_proto getpwuid_r $hdrs
15372 case "$d_getpwuid_r_proto" in
15374 case "$getpwuid_r_proto" in
15375 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
15376 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
15378 case "$getpwuid_r_proto" in
15379 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
15380 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
15382 case "$getpwuid_r_proto" in
15383 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
15384 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
15386 case "$getpwuid_r_proto" in
15387 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
15388 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
15390 case "$getpwuid_r_proto" in
15391 ''|0) d_getpwuid_r=undef
15393 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
15394 * ) case "$getpwuid_r_proto" in
15395 REENTRANT_PROTO*) ;;
15396 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
15398 echo "Prototype: $try" ;;
15401 *) case "$usethreads" in
15402 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
15409 *) getpwuid_r_proto=0
15413 : Optional checks for getsbyname and getsbyport
15415 : see if getservbyname exists
15416 set getservbyname d_getsbyname
15419 : see if getservbyport exists
15420 set getservbyport d_getsbyport
15423 : see if getservent exists
15424 set getservent d_getsent
15427 : see if getservbyname_r exists
15428 set getservbyname_r d_getservbyname_r
15430 case "$d_getservbyname_r" in
15432 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15433 case "$d_getservbyname_r_proto:$usethreads" in
15434 ":define") d_getservbyname_r_proto=define
15435 set d_getservbyname_r_proto getservbyname_r $hdrs
15439 case "$d_getservbyname_r_proto" in
15441 case "$getservbyname_r_proto" in
15442 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
15443 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
15445 case "$getservbyname_r_proto" in
15446 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
15447 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
15449 case "$getservbyname_r_proto" in
15450 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
15451 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
15453 case "$getservbyname_r_proto" in
15454 ''|0) d_getservbyname_r=undef
15455 getservbyname_r_proto=0
15456 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
15457 * ) case "$getservbyname_r_proto" in
15458 REENTRANT_PROTO*) ;;
15459 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
15461 echo "Prototype: $try" ;;
15464 *) case "$usethreads" in
15465 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
15467 d_getservbyname_r=undef
15468 getservbyname_r_proto=0
15472 *) getservbyname_r_proto=0
15476 : see if getservbyport_r exists
15477 set getservbyport_r d_getservbyport_r
15479 case "$d_getservbyport_r" in
15481 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15482 case "$d_getservbyport_r_proto:$usethreads" in
15483 ":define") d_getservbyport_r_proto=define
15484 set d_getservbyport_r_proto getservbyport_r $hdrs
15488 case "$d_getservbyport_r_proto" in
15490 case "$getservbyport_r_proto" in
15491 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
15492 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
15494 case "$getservbyport_r_proto" in
15495 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
15496 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
15498 case "$getservbyport_r_proto" in
15499 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
15500 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
15502 case "$getservbyport_r_proto" in
15503 ''|0) d_getservbyport_r=undef
15504 getservbyport_r_proto=0
15505 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
15506 * ) case "$getservbyport_r_proto" in
15507 REENTRANT_PROTO*) ;;
15508 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
15510 echo "Prototype: $try" ;;
15513 *) case "$usethreads" in
15514 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
15516 d_getservbyport_r=undef
15517 getservbyport_r_proto=0
15521 *) getservbyport_r_proto=0
15525 : see if getservent_r exists
15526 set getservent_r d_getservent_r
15528 case "$d_getservent_r" in
15530 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15531 case "$d_getservent_r_proto:$usethreads" in
15532 ":define") d_getservent_r_proto=define
15533 set d_getservent_r_proto getservent_r $hdrs
15537 case "$d_getservent_r_proto" in
15539 case "$getservent_r_proto" in
15540 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
15541 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBWR ;;
15543 case "$getservent_r_proto" in
15544 ''|0) try='int getservent_r(struct servent*, char*, int);'
15545 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBI ;;
15547 case "$getservent_r_proto" in
15548 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
15549 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=S_SBI ;;
15551 case "$getservent_r_proto" in
15552 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
15553 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SD ;;
15555 case "$getservent_r_proto" in
15556 ''|0) d_getservent_r=undef
15557 getservent_r_proto=0
15558 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
15559 * ) case "$getservent_r_proto" in
15560 REENTRANT_PROTO*) ;;
15561 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
15563 echo "Prototype: $try" ;;
15566 *) case "$usethreads" in
15567 define) echo "getservent_r has no prototype, not using it." >&4 ;;
15569 d_getservent_r=undef
15570 getservent_r_proto=0
15574 *) getservent_r_proto=0
15578 : see if prototypes for various getservxxx netdb.h functions are available
15580 set d_getservprotos getservent $i_netdb netdb.h
15583 : see if getspnam exists
15584 set getspnam d_getspnam
15587 : see if this is a shadow.h system
15588 set shadow.h i_shadow
15591 : see if getspnam_r exists
15592 set getspnam_r d_getspnam_r
15594 case "$d_getspnam_r" in
15596 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
15597 case "$d_getspnam_r_proto:$usethreads" in
15598 ":define") d_getspnam_r_proto=define
15599 set d_getspnam_r_proto getspnam_r $hdrs
15603 case "$d_getspnam_r_proto" in
15605 case "$getspnam_r_proto" in
15606 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
15607 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
15609 case "$getspnam_r_proto" in
15610 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
15611 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=S_CSBI ;;
15613 case "$getspnam_r_proto" in
15614 ''|0) d_getspnam_r=undef
15616 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
15617 * ) case "$getspnam_r_proto" in
15618 REENTRANT_PROTO*) ;;
15619 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
15621 echo "Prototype: $try" ;;
15624 *) case "$usethreads" in
15625 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
15632 *) getspnam_r_proto=0
15636 : see if gettimeofday or ftime exists
15637 set gettimeofday d_gettimeod
15639 case "$d_gettimeod" in
15645 val="$undef"; set d_ftime; eval $setvar
15648 case "$d_gettimeod$d_ftime" in
15651 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
15655 : see if gmtime_r exists
15656 set gmtime_r d_gmtime_r
15658 case "$d_gmtime_r" in
15660 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15661 case "$d_gmtime_r_proto:$usethreads" in
15662 ":define") d_gmtime_r_proto=define
15663 set d_gmtime_r_proto gmtime_r $hdrs
15667 case "$d_gmtime_r_proto" in
15669 case "$gmtime_r_proto" in
15670 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
15671 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=S_TS ;;
15673 case "$gmtime_r_proto" in
15674 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
15675 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=I_TS ;;
15677 case "$gmtime_r_proto" in
15678 ''|0) d_gmtime_r=undef
15680 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
15681 * ) case "$gmtime_r_proto" in
15682 REENTRANT_PROTO*) ;;
15683 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
15685 echo "Prototype: $try" ;;
15688 *) case "$usethreads" in
15689 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
15696 *) gmtime_r_proto=0
15700 : see if hasmntopt exists
15701 set hasmntopt d_hasmntopt
15704 : see if this is a netinet/in.h or sys/in.h system
15705 set netinet/in.h i_niin sys/in.h i_sysin
15708 : see if arpa/inet.h has to be included
15709 set arpa/inet.h i_arpainet
15712 : see if htonl --and friends-- exists
15717 : Maybe they are macros.
15720 $cat >htonl.c <<EOM
15722 #include <sys/types.h>
15723 #$i_niin I_NETINET_IN
15725 #$i_arpainet I_ARPA_INET
15726 #ifdef I_NETINET_IN
15727 #include <netinet/in.h>
15730 #include <sys/in.h>
15733 #include <arpa/inet.h>
15736 printf("Defined as a macro.");
15739 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
15740 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
15742 echo "But it seems to be defined as a macro." >&4
15750 : see if hypot exists
15754 : see if ilogb exists
15758 : see if ilogbl exists
15759 set ilogbl d_ilogbl
15764 if set index val -f; eval $csym; $val; then
15765 if set strchr val -f d_strchr; eval $csym; $val; then
15766 if $contains strchr "$strings" >/dev/null 2>&1 ; then
15769 echo "strchr() found." >&4
15773 echo "index() found." >&4
15778 echo "index() found." >&4
15781 if set strchr val -f d_strchr; eval $csym; $val; then
15784 echo "strchr() found." >&4
15786 echo "No index() or strchr() found!" >&4
15791 set d_strchr; eval $setvar
15793 set d_index; eval $setvar
15795 : check whether inet_aton exists
15796 set inet_aton d_inetaton
15799 : see if inet_ntop exists
15800 set inet_ntop d_inetntop
15803 : see if inet_pton exists
15804 set inet_pton d_inetpton
15809 $cat >isascii.c <<EOCP
15812 #$i_stdlib I_STDLIB
15814 #include <stdlib.h>
15825 if eval $compile; then
15826 echo "isascii() found." >&4
15829 echo "isascii() NOT found." >&4
15838 $cat >isblank.c <<'EOCP'
15849 if $cc $ccflags $ldflags -o isblank isblank.c $libs >/dev/null 2>&1 ; then
15850 echo "isblank() found." >&4
15853 echo "isblank() NOT found." >&4
15860 : check for isfinite
15861 echo "Checking to see if you have isfinite..." >&4
15867 int main() { return isfinite(0.0); }
15870 if eval $compile; then
15872 echo "You have isfinite."
15875 echo "You do not have isfinite."
15881 : see if isfinitel exists
15882 set isfinitel d_isfinitel
15886 echo "Checking to see if you have isinf..." >&4
15892 int main() { return isinf(0.0); }
15895 if eval $compile; then
15897 echo "You have isinf."
15900 echo "You do not have isinf."
15906 : see if isinfl exists
15907 set isinfl d_isinfl
15911 echo "Checking to see if you have isless..." >&4
15917 int main() { return isless(0.0); }
15920 if eval $compile; then
15922 echo "You have isless."
15925 echo "You do not have isless."
15932 echo "Checking to see if you have isnan..." >&4
15938 int main() { return isnan(0.0); }
15941 if eval $compile; then
15943 echo "You have isnan."
15946 echo "You do not have isnan."
15952 : see if isnanl exists
15953 set isnanl d_isnanl
15956 : check for isnormal
15957 echo "Checking to see if you have isnormal..." >&4
15963 int main() { return isnormal(0.0); }
15966 if eval $compile; then
15968 echo "You have isnormal."
15971 echo "You do not have isnormal."
15981 : see if j0l exists
15985 : see if killpg exists
15986 set killpg d_killpg
15989 : see if localeconv exists
15990 set localeconv d_locconv
15993 : see if libc has the POSIX.1-2008 currency locale rules
15994 case "$d_locconv:$d_lc_monetary_2008" in
15997 #include <locale.h>
15999 struct lconv *lc = localeconv();
16000 char int_p_cs_precedes = lc->int_p_cs_precedes;
16005 if eval $compile; then
16006 d_lc_monetary_2008="$define"
16008 d_lc_monetary_2008="$undef"
16014 : see if lchown exists
16016 $cat > try.c <<'EOCP'
16017 /* System header to define __stub macros and hopefully few prototypes,
16018 which can conflict with char lchown(); below. */
16019 #include <assert.h>
16020 /* Override any gcc2 internal prototype to avoid an error. */
16021 /* We use char because int might match the return type of a gcc2
16022 builtin and then its argument prototype would still apply. */
16025 /* The GNU C library defines this for functions which it implements
16026 to always fail with ENOSYS. Some functions are actually named
16027 something starting with __ and the normal name is an alias. */
16028 #if defined (__stub_lchown) || defined (__stub___lchown)
16036 if eval $compile; then
16037 $echo "lchown() found." >&4
16040 $echo "lchown() NOT found." >&4
16046 : See if number of significant digits in a double precision number is known
16048 $cat >ldbl_dig.c <<EOM
16049 #$i_limits I_LIMITS
16052 #include <limits.h>
16058 printf("Contains LDBL_DIG");
16061 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
16062 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
16063 echo "LDBL_DIG found." >&4
16066 echo "LDBL_DIG NOT found." >&4
16073 : see if lgamma exists
16074 set lgamma d_lgamma
16077 : see if lgamma_r exists
16078 set lgamma_r d_lgamma_r
16081 : check to see if math.h defines _LIB_VERSION
16082 d_libm_lib_version="$undef"
16086 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
16088 #include <unistd.h>
16090 int main (int argc, char *argv[])
16092 printf ("%d\n", _LIB_VERSION);
16097 if eval $compile; then
16099 echo "Yes, it does ($foo)" >&4
16100 d_libm_lib_version="$define"
16102 echo "No, it does not (probably harmless)" >&4
16109 : see if link exists
16113 : see if llrint exists
16114 set llrint d_llrint
16117 : see if llrintl exists
16118 set llrintl d_llrintl
16121 : see if llround exists
16122 set llround d_llround
16125 : see if llroundl exists
16126 set llroundl d_llroundl
16129 : see if localtime_r exists
16130 set localtime_r d_localtime_r
16132 case "$d_localtime_r" in
16134 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
16135 case "$d_localtime_r_proto:$usethreads" in
16136 ":define") d_localtime_r_proto=define
16137 set d_localtime_r_proto localtime_r $hdrs
16141 case "$d_localtime_r_proto" in
16143 case "$localtime_r_proto" in
16144 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
16145 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=S_TS ;;
16147 case "$localtime_r_proto" in
16148 ''|0) try='int localtime_r(const time_t*, struct tm*);'
16149 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=I_TS ;;
16151 case "$localtime_r_proto" in
16152 ''|0) d_localtime_r=undef
16153 localtime_r_proto=0
16154 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
16155 * ) case "$localtime_r_proto" in
16156 REENTRANT_PROTO*) ;;
16157 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
16159 echo "Prototype: $try" ;;
16162 *) case "$usethreads" in
16163 define) echo "localtime_r has no prototype, not using it." >&4 ;;
16165 d_localtime_r=undef
16166 localtime_r_proto=0
16170 *) localtime_r_proto=0
16174 : see if localtime_r calls tzset
16175 case "$localtime_r_proto" in
16178 /* Does our libc's localtime_r call tzset ?
16179 * return 0 if so, 1 otherwise.
16181 #$i_systypes I_SYS_TYPES
16182 #$i_unistd I_UNISTD
16184 #$i_stdlib I_STDLIB
16185 #$i_string I_STRING
16186 #$i_malloc I_MALLOC
16188 # include <sys/types.h>
16191 # include <unistd.h>
16197 #include <stdlib.h>
16200 # include <string.h>
16202 # include <strings.h>
16205 # include <malloc.h>
16209 time_t t = time(0L);
16210 char w_tz[]="TZ" "=GMT+5",
16211 e_tz[]="TZ" "=GMT-5",
16212 *tz_e = (char*)malloc(16),
16213 *tz_w = (char*)malloc(16);
16214 struct tm tm_e, tm_w;
16215 memset(&tm_e,'\0',sizeof(struct tm));
16216 memset(&tm_w,'\0',sizeof(struct tm));
16221 localtime_r(&t, &tm_e);
16224 localtime_r(&t, &tm_w);
16226 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
16232 if eval $compile; then
16233 if $run ./try; then
16234 d_localtime_r_needs_tzset=undef;
16236 d_localtime_r_needs_tzset=define;
16239 d_localtime_r_needs_tzset=undef;
16243 d_localtime_r_needs_tzset=undef;
16248 : see if lockf exists
16252 : see if log1p exists
16256 : see if log2 exists
16260 : see if logb exists
16264 : see if lrint exists
16268 : see if lrintl exists
16269 set lrintl d_lrintl
16272 : see if lround exists
16273 set lround d_lround
16276 : see if lroundl exists
16277 set lroundl d_lroundl
16280 : see if prototype for lseek is available
16282 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
16285 : see if lstat exists
16289 : see if madvise exists
16290 set madvise d_madvise
16293 : see if malloc_size exists
16294 set malloc_size d_malloc_size
16297 : see if malloc_size_good exists
16298 set malloc_good_size d_malloc_good_size
16301 : see if mblen exists
16305 : see if mbstowcs exists
16306 set mbstowcs d_mbstowcs
16309 : see if mbtowc exists
16310 set mbtowc d_mbtowc
16313 : see if memchr exists
16314 set memchr d_memchr
16317 : see if memcmp exists
16318 set memcmp d_memcmp
16321 : see if memcpy exists
16322 set memcpy d_memcpy
16325 : see if memmove exists
16326 set memmove d_memmove
16329 : see if memset exists
16330 set memset d_memset
16333 : see if mkdir exists
16337 : see if mkdtemp exists
16338 set mkdtemp d_mkdtemp
16341 : see if mkfifo exists
16342 set mkfifo d_mkfifo
16345 : see if mkstemp exists
16346 set mkstemp d_mkstemp
16349 : see if mkstemps exists
16350 set mkstemps d_mkstemps
16353 : see if mktime exists
16354 set mktime d_mktime
16357 : see if this is a sys/mman.h system
16358 set sys/mman.h i_sysmman
16361 : see if mmap exists
16364 : see what shmat returns
16365 : default to something harmless
16367 case "$i_sysmman$d_mmap" in
16369 $cat >mmap.c <<'END'
16370 #include <sys/mman.h>
16373 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
16378 echo "and it returns ($mmaptype)." >&4
16384 : see if sqrtl exists
16388 : see if scalbnl exists
16389 set scalbnl d_scalbnl
16392 : see if truncl exists
16393 set truncl d_truncl
16396 : see if modfl exists
16400 : see if prototype for modfl is available
16402 set d_modflproto modfl $i_math math.h
16405 d_modfl_pow32_bug="$undef"
16407 case "$d_longdbl$d_modfl" in
16410 Checking to see whether your modfl() is okay for large values...
16416 if $test "X$d_modflproto" != "X$define"; then
16417 $cat >>try.c <<EOCP
16418 /* Sigh. many current glibcs provide the function, but do not prototype it. */
16419 long double modfl (long double, long double *);
16422 $cat >>try.c <<EOCP
16424 long double nv = 4294967303.15;
16430 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
16434 case "$osname:$gccversion" in
16435 aix:) saveccflags="$ccflags"
16436 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
16439 if eval $compile; then
16442 *" 4294967303.150000 1.150000 4294967302.000000")
16443 echo >&4 "Your modfl() is broken for large values."
16444 d_modfl_pow32_bug="$define"
16446 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
16450 *" 4294967303.150000 0.150000 4294967303.000000")
16451 echo >&4 "Your modfl() seems okay for large values."
16453 *) echo >&4 "I don't understand your modfl() at all."
16459 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
16462 case "$osname:$gccversion" in
16463 aix:) ccflags="$saveccflags" ;; # restore
16468 if $test "$uselongdouble" = "$define"; then
16470 if $test "$d_sqrtl" != "$define"; then
16471 message="$message sqrtl"
16473 if $test "$d_modfl" != "$define"; then
16474 if $test "$d_truncl:$d_copysignl" = "$define:$define"; then
16475 echo "You have both truncl and copysignl, so I can emulate modfl."
16477 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
16478 echo "You have both aintl and copysignl, so I can emulate modfl."
16480 message="$message modfl"
16484 if $test "$d_frexpl" != "$define"; then
16485 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
16486 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
16488 message="$message frexpl"
16491 if $test "$d_ldexpl" != "$define"; then
16492 message="$message ldexpl"
16495 if $test "$message" != ""; then
16498 *** You requested the use of long doubles but you do not seem to have
16499 *** the following mathematical functions needed for long double support:
16501 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
16502 *** Cannot continue, aborting.
16510 : see if mprotect exists
16511 set mprotect d_mprotect
16514 : see if msgctl exists
16515 set msgctl d_msgctl
16518 : see if msgget exists
16519 set msgget d_msgget
16522 : see if msgsnd exists
16523 set msgsnd d_msgsnd
16526 : see if msgrcv exists
16527 set msgrcv d_msgrcv
16530 : see how much of the 'msg*(2)' library is present.
16533 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
16534 *"$undef"*) h_msg=false;;
16538 case "`ipcs 2>&1`" in
16539 "SVID messages"*"not configured"*)
16540 echo "Your $osname does not have the msg*(2) configured." >&4
16543 set msgctl d_msgctl
16545 set msgget d_msgget
16547 set msgsnd d_msgsnd
16549 set msgrcv d_msgrcv
16555 : we could also check for sys/ipc.h ...
16556 if $h_msg && $test `./findhdr sys/msg.h`; then
16557 echo "You have the full msg*(2) library." >&4
16560 echo "You don't have the full msg*(2) library." >&4
16566 : Check for msghdr_s
16568 echo "Checking to see if your system supports struct msghdr..." >&4
16569 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
16571 case "$d_msghdr_s" in
16572 "$define") echo "Yes, it does." ;;
16573 *) echo "No, it doesn't." ;;
16577 : see if msync exists
16581 : see if munmap exists
16582 set munmap d_munmap
16585 : see if nan exists
16589 : see if nearbyint exists
16590 set nearbyint d_nearbyint
16593 : see if nextafter exists
16594 set nextafter d_nextafter
16597 : see if nexttoward exists
16598 set nexttoward d_nexttoward
16601 : see if nice exists
16605 : see if this is a langinfo.h system
16606 set langinfo.h i_langinfo
16609 : see if nl_langinfo exists
16610 set nl_langinfo d_nl_langinfo
16613 : see if this is a quadmath.h system
16614 set quadmath.h i_quadmath
16617 : check for volatile keyword
16619 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
16620 $cat >try.c <<'EOCP'
16623 typedef struct _goo_struct goo_struct;
16624 goo_struct * volatile goo = ((goo_struct *)0);
16625 struct _goo_struct {
16630 typedef unsigned short foo_t;
16631 char *volatile foo;
16633 volatile foo_t blech;
16637 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
16639 echo "Yup, it does."
16642 echo "Nope, it doesn't."
16648 : Check basic sizes
16650 $echo "Choosing the C types to be used for Perl's internal types..." >&4
16652 case "$use64bitint:$d_quad:$quadtype" in
16655 uvtype="$uquadtype"
16660 uvtype="unsigned long"
16666 case "$uselongdouble:$d_longdbl" in
16668 nvtype="long double"
16669 nvsize=$longdblsize
16676 case "$usequadmath:$i_quadmath" in
16678 nvtype="__float128"
16684 *** You requested the use of the quadmath library, but you
16685 *** do not seem to have the quadmath library installed.
16686 *** Cannot continue, aborting.
16692 define:*) $cat <<EOM >&4
16694 *** You requested the use of the quadmath library, but you
16695 *** do not seem to have the required header, <quadmath.h>.
16697 case "$gccversion" in
16700 *** Your gcc looks a bit old:
16706 *** You are not running a gcc.
16711 *** For the quadmath library you need at least gcc 4.6.
16712 *** Cannot continue, aborting.
16718 $echo "(IV will be "$ivtype", $ivsize bytes)"
16719 $echo "(UV will be "$uvtype", $uvsize bytes)"
16720 $echo "(NV will be "$nvtype", $nvsize bytes)"
16723 #$i_inttypes I_INTTYPES
16725 #include <inttypes.h>
16730 int8_t i = INT8_MAX;
16731 uint8_t u = UINT8_MAX;
16732 printf("int8_t\n");
16735 int16_t i = INT16_MAX;
16736 uint16_t u = UINT16_MAX;
16737 printf("int16_t\n");
16740 int32_t i = INT32_MAX;
16741 uint32_t u = UINT32_MAX;
16742 printf("int32_t\n");
16747 i8type="signed char"
16748 u8type="unsigned char"
16753 '') case "$shortsize" in
16755 u16type="unsigned short"
16763 '') set try -DINT16
16764 if eval $compile; then
16765 case "`$run ./try`" in
16777 '') if $test $shortsize -ge 2; then
16779 u16type="unsigned short"
16787 '') case "$longsize" in
16789 u32type="unsigned long"
16793 *) case "$intsize" in
16795 u32type="unsigned int"
16805 '') set try -DINT32
16806 if eval $compile; then
16807 case "`$run ./try`" in
16819 '') if $test $intsize -ge 4; then
16821 u32type="unsigned int"
16829 '') case "$d_quad:$quadtype" in
16831 i64type="$quadtype"
16832 u64type="$uquadtype"
16840 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
16841 : volatile so that the compiler has to store it out to memory.
16842 if test X"$d_volatile" = X"$define"; then
16847 #$i_stdlib I_STDLIB
16849 #include <stdlib.h>
16851 #include <sys/types.h>
16852 #include <signal.h>
16854 $volatile int bletched = 0;
16855 $signal_t blech(int s) { bletched = 1; }
16860 int n = 8 * $uvsize;
16863 signal(SIGFPE, blech);
16866 for (i = 0; i < n; i++) {
16867 u = u << 1 | ($uvtype)1;
16869 if (($uvtype)d != u)
16873 d = ($nvtype)(u - 1);
16874 if (($uvtype)d != (u - 1))
16881 printf("%d\n", ((i == n) ? -n : i));
16887 d_nv_preserves_uv="$undef"
16888 if eval $compile; then
16889 nv_preserves_uv_bits="`$run ./try`"
16891 case "$nv_preserves_uv_bits" in
16893 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
16894 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
16895 d_nv_preserves_uv="$define"
16897 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
16898 d_nv_preserves_uv="$undef" ;;
16899 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
16900 nv_preserves_uv_bits="0" ;;
16904 $echo "Checking to find the largest integer value your NVs can hold..." >&4
16905 : volatile so that the compiler has to store it out to memory.
16906 if test X"$d_volatile" = X"$define"; then
16912 typedef $nvtype NV;
16919 while(count < 256) {
16920 $volatile NV up = value + 1.0;
16921 $volatile NV negated = -value;
16922 $volatile NV down = negated - 1.0;
16923 $volatile NV got_up = up - value;
16924 int up_good = got_up == 1.0;
16925 int got_down = down - negated;
16926 int down_good = got_down == -1.0;
16928 if (down_good != up_good) {
16930 "Inconsistency - up %d %f; down %d %f; for 2**%d (%.20f)\n",
16931 up_good, (double) got_up, down_good, (double) got_down,
16932 count, (double) value);
16939 fputs("256.0", stdout);
16942 fputs("2.0", stdout);
16948 fputs("*", stdout);
16954 fprintf(stderr, "Cannot overflow integer range, even at 2**%d (%.20f)\n",
16955 count, (double) value);
16961 nv_overflows_integers_at='0'
16962 if eval $compile; then
16968 The largest integer your NVs can preserve is equal to $xxx
16970 nv_overflows_integers_at="$xxx"
16973 Cannot determine the largest integer value your NVs can hold, unexpected output
16980 Cannot determine the largest integer value your NVs can hold
16987 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
16988 : volatile so that the compiler has to store it out to memory.
16989 if test X"$d_volatile" = X"$define"; then
16994 #$i_stdlib I_STDLIB
16996 #include <stdlib.h>
16998 #$i_string I_STRING
17000 # include <string.h>
17002 # include <strings.h>
17004 #include <sys/types.h>
17005 #include <signal.h>
17007 $volatile int bletched = 0;
17008 $signal_t blech(int s) { bletched = 1; }
17011 int checkit($nvtype d, char *where) {
17012 unsigned char *p = (char *)&d;
17013 unsigned char *end = p + sizeof(d);
17023 printf("No - %s: 0x", where);
17025 printf ("%02X", *p++);
17030 int main(int argc, char **argv) {
17033 fail += checkit(d, "0.0");
17035 /* The compiler shouldn't be assuming that bletched is 0 */
17038 fail += checkit(d, "bleched");
17041 signal(SIGFPE, blech);
17044 /* Paranoia - the compiler should have no way of knowing that ANSI says
17045 that argv[argc] will always be NULL. Actually, if it did assume this it
17046 would be buggy, as this is C and main() can be called from elsewhere in
17048 d = argv[argc] ? 1 : 0;
17051 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
17054 fail += checkit(d, "ternary");
17056 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
17059 printf("No - memset doesn't give 0.0\n");
17060 /* This might just blow up: */
17061 printf("(gives %g)\n", d);
17067 printf("No - something bleched\n");
17072 printf("No - %d fail(s)\n", fail);
17081 d_nv_zero_is_allbits_zero="$undef"
17082 if eval $compile; then
17088 0.0 is represented as all bits zero in memory
17090 d_nv_zero_is_allbits_zero="$define"
17093 0.0 is not represented as all bits zero in memory
17095 d_nv_zero_is_allbits_zero="$undef"
17100 0.0 is not represented as all bits zero in memory
17102 d_nv_zero_is_allbits_zero="$undef"
17108 : check for off64_t
17110 echo "Checking to see if you have off64_t..." >&4
17112 #include <sys/types.h>
17113 #include <unistd.h>
17114 int main() { off64_t x = 7; }
17117 if eval $compile; then
17119 echo "You have off64_t."
17122 echo "You do not have off64_t."
17123 case "$lseeksize" in
17124 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
17131 : how to create joinable pthreads
17132 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
17134 echo "Checking what constant to use for creating joinable pthreads..." >&4
17135 $cat >try.c <<'EOCP'
17136 #include <pthread.h>
17138 int detachstate = JOINABLE;
17141 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
17142 if eval $compile; then
17143 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
17144 val="$undef" # Yes, undef.
17145 set d_old_pthread_create_joinable
17148 set old_pthread_create_joinable
17151 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
17152 if eval $compile; then
17153 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
17155 set d_old_pthread_create_joinable
17157 val=PTHREAD_CREATE_UNDETACHED
17158 set old_pthread_create_joinable
17161 set try -DJOINABLE=__UNDETACHED
17162 if eval $compile; then
17163 echo "You seem to use __UNDETACHED." >&4
17165 set d_old_pthread_create_joinable
17168 set old_pthread_create_joinable
17171 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
17173 set d_old_pthread_create_joinable
17176 set old_pthread_create_joinable
17183 d_old_pthread_create_joinable="$undef"
17184 old_pthread_create_joinable=""
17187 : see if pause exists
17191 : see if poll exists
17195 : see if prctl exists
17199 : see if prctl supports PR_SET_NAME
17200 d_prctl_set_name=$undef
17205 #include <unistd.h>
17207 #include <sys/prctl.h>
17209 int main (int argc, char *argv[])
17211 return (prctl (PR_SET_NAME, "Test"));
17215 if eval $compile_ok && $run ./try; then
17216 echo "Your prctl (PR_SET_NAME, ...) works"
17217 d_prctl_set_name=$define
17223 : see if readlink exists
17224 set readlink d_readlink
17227 : Check if there is a /proc symlink to the abs path of
17228 : the executing program. We will honor hints of d_procselfexe=$undef
17229 : or procselfexe being non-empty, otherwise will try to determine both
17230 : if we have readlink.
17231 : AmigaOS will attempt to mount proc: aka /proc, if /proc/... is
17232 : referenced, and AmigaOS does not have a proc filesystem anyway.
17235 if $test "X$d_procselfexe" = Xundef; then
17237 elif $test "X$procselfexe" != X -a "X$procselfexe" != 'X '; then
17239 elif $test "X$d_readlink" = Xdefine; then
17240 : NetBSD first as /proc/self is a symlink to /proc/curproc,
17241 : and it feels more tidy to avoid an extra level of symlink
17242 set NetBSD /proc/curproc/exe Linux /proc/self/exe FreeBSD /proc/curproc/file Solaris /proc/self/path/a.out
17243 while test $# -gt 0; do
17246 if $issymlink $try; then
17247 $ls -l $try > reflect
17248 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
17249 echo "You have $type-like $try."
17250 procselfexe='"'$try'"'
17252 : This will break out of the loop
17262 : backward compatibility for d_hvfork
17263 if test X$d_hvfork != X; then
17264 d_vfork="$d_hvfork"
17267 : see if there is a vfork
17272 d_pseudofork=$undef
17274 : Ok, but do we want to use it. vfork is reportedly unreliable in
17275 : perl on Solaris 2.x, and probably elsewhere.
17279 case "$usevfork" in
17285 Perl can only use a vfork() that doesn't suffer from strict
17286 restrictions on calling functions or modifying global data in
17287 the child. For example, glibc-2.1 contains such a vfork()
17288 that is unsuitable. If your system provides a proper fork()
17289 call, chances are that you do NOT want perl to use vfork().
17292 rp="Do you still want to use vfork()?"
17297 echo "Ok, we won't use vfork()."
17306 $define) usevfork='true';;
17307 *) usevfork='false';;
17310 : see whether the pthread_atfork exists
17312 #include <pthread.h>
17315 #ifdef PTHREAD_ATFORK
17316 pthread_atfork(NULL,NULL,NULL);
17321 : see if pthread_atfork exists
17322 set try -DPTHREAD_ATFORK
17323 if eval $compile; then
17328 case "$usethreads" in
17331 $define) echo 'pthread_atfork found.' >&4 ;;
17332 *) echo 'pthread_atfork NOT found.' >&4 ;;
17335 set d_pthread_atfork
17338 : see if pthread_attr_setscope exists
17339 set pthread_attr_setscope d_pthread_attr_setscope
17342 : see whether the various POSIXish _yields exist
17344 #include <pthread.h>
17350 #ifdef PTHREAD_YIELD
17353 #ifdef PTHREAD_YIELD_NULL
17354 pthread_yield(NULL);
17360 : see if sched_yield exists
17361 set try -DSCHED_YIELD
17362 if eval $compile; then
17364 sched_yield='sched_yield()'
17368 case "$usethreads" in
17371 $define) echo 'sched_yield() found.' >&4 ;;
17372 *) echo 'sched_yield() NOT found.' >&4 ;;
17378 : see if pthread_yield exists
17379 set try -DPTHREAD_YIELD
17380 if eval $compile; then
17382 case "$sched_yield" in
17383 '') sched_yield='pthread_yield()' ;;
17386 set try -DPTHREAD_YIELD_NULL
17387 if eval $compile; then
17389 case "$sched_yield" in
17390 '') sched_yield='pthread_yield(NULL)' ;;
17396 case "$usethreads" in
17399 $define) echo 'pthread_yield() found.' >&4 ;;
17400 *) echo 'pthread_yield() NOT found.' >&4 ;;
17404 set d_pthread_yield
17406 case "$sched_yield" in
17407 '') sched_yield=undef ;;
17411 : check for ptrdiff_t
17413 echo "Checking to see if you have ptrdiff_t..." >&4
17415 #include <stddef.h>
17416 int main() { ptrdiff_t x = 7; }
17419 if eval $compile; then
17421 echo "You have ptrdiff_t."
17424 echo "You do not have ptrdiff_t."
17430 : see if random_r exists
17431 set random_r d_random_r
17433 case "$d_random_r" in
17435 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17436 case "$d_random_r_proto:$usethreads" in
17437 ":define") d_random_r_proto=define
17438 set d_random_r_proto random_r $hdrs
17442 case "$d_random_r_proto" in
17444 case "$random_r_proto" in
17445 ''|0) try='int random_r(int*, struct random_data*);'
17446 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_iS ;;
17448 case "$random_r_proto" in
17449 ''|0) try='int random_r(long*, struct random_data*);'
17450 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_lS ;;
17452 case "$random_r_proto" in
17453 ''|0) try='int random_r(struct random_data*, int32_t*);'
17454 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_St ;;
17456 case "$random_r_proto" in
17457 ''|0) d_random_r=undef
17459 echo "Disabling random_r, cannot determine prototype." >&4 ;;
17460 * ) case "$random_r_proto" in
17461 REENTRANT_PROTO*) ;;
17462 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
17464 echo "Prototype: $try" ;;
17467 *) case "$usethreads" in
17468 define) echo "random_r has no prototype, not using it." >&4 ;;
17475 *) random_r_proto=0
17479 : see if readdir and friends exist
17480 set readdir d_readdir
17482 set seekdir d_seekdir
17484 set telldir d_telldir
17486 set rewinddir d_rewinddir
17489 : see if readdir64_r exists
17490 set readdir64_r d_readdir64_r
17492 case "$d_readdir64_r" in
17494 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
17495 case "$d_readdir64_r_proto:$usethreads" in
17496 ":define") d_readdir64_r_proto=define
17497 set d_readdir64_r_proto readdir64_r $hdrs
17501 case "$d_readdir64_r_proto" in
17503 case "$readdir64_r_proto" in
17504 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
17505 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TSR ;;
17507 case "$readdir64_r_proto" in
17508 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
17509 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TS ;;
17511 case "$readdir64_r_proto" in
17512 ''|0) d_readdir64_r=undef
17513 readdir64_r_proto=0
17514 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
17515 * ) case "$readdir64_r_proto" in
17516 REENTRANT_PROTO*) ;;
17517 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
17519 echo "Prototype: $try" ;;
17522 *) case "$usethreads" in
17523 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
17525 d_readdir64_r=undef
17526 readdir64_r_proto=0
17530 *) readdir64_r_proto=0
17534 : see if readdir_r exists
17535 set readdir_r d_readdir_r
17537 case "$d_readdir_r" in
17539 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
17540 case "$d_readdir_r_proto:$usethreads" in
17541 ":define") d_readdir_r_proto=define
17542 set d_readdir_r_proto readdir_r $hdrs
17546 case "$d_readdir_r_proto" in
17548 case "$readdir_r_proto" in
17549 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
17550 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TSR ;;
17552 case "$readdir_r_proto" in
17553 ''|0) try='int readdir_r(DIR*, struct dirent*);'
17554 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TS ;;
17556 case "$readdir_r_proto" in
17557 ''|0) d_readdir_r=undef
17559 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
17560 * ) case "$readdir_r_proto" in
17561 REENTRANT_PROTO*) ;;
17562 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
17564 echo "Prototype: $try" ;;
17567 *) case "$usethreads" in
17568 define) echo "readdir_r has no prototype, not using it." >&4 ;;
17575 *) readdir_r_proto=0
17579 : see if readv exists
17583 : see if recvmsg exists
17584 set recvmsg d_recvmsg
17587 : see if regcomp, regcmp, or re_comp exist, for regular pattern matching
17589 if set regcomp val -f d_regcomp; eval $csym; $val; then
17590 echo 'regcomp() found.' >&4
17591 d_regcomp="$define"
17594 elif set regcmp val -f d_regcmp; eval $csym; $val; then
17595 echo 'regcmp() found.' >&4
17599 elif set re_comp val -f d_re_comp; eval $csym; $val; then
17600 echo 're_comp() found, assuming re_exec() also exists.' >&4
17601 d_re_comp="$define"
17606 No regcomp(), regcmp() nor re_comp() found !! No regular pattern matching.
17613 : see if remainder exists
17614 set remainder d_remainder
17617 : see if remquo exists
17618 set remquo d_remquo
17621 : see if rename exists
17622 set rename d_rename
17625 : see if rint exists
17629 : see if rmdir exists
17633 : see if round exists
17637 : see if memory.h is available.
17642 : See if it conflicts with string.h
17648 $cppstdin $cppflags $cppminus < $strings > mem.h
17649 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
17651 echo "We won't be including <memory.h>."
17661 : can bcopy handle overlapping blocks?
17664 case "$d_memmove" in
17665 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
17666 *) case "$d_bcopy" in
17668 echo "Checking to see if bcopy() can do overlapping copies..." >&4
17670 #$i_memory I_MEMORY
17671 #$i_stdlib I_STDLIB
17672 #$i_string I_STRING
17673 #$i_unistd I_UNISTD
17675 $cat >>try.c <<'EOCP'
17678 # include <memory.h>
17681 # include <stdlib.h>
17684 # include <string.h>
17686 # include <strings.h>
17689 # include <unistd.h> /* Needed for NetBSD */
17693 char buf[128], abc[128];
17699 /* Copy "abcde..." string to char abc[] so that gcc doesn't
17700 try to store the string in read-only memory. */
17701 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
17703 for (align = 7; align >= 0; align--) {
17704 for (len = 36; len; len--) {
17706 bcopy(abc, b, len);
17707 for (off = 1; off <= len; off++) {
17708 bcopy(b, b+off, len);
17709 bcopy(b+off, b, len);
17710 if (bcmp(b, abc, len))
17719 if eval $compile_ok; then
17720 if $run ./try 2>/dev/null; then
17721 echo "Yes, it can."
17724 echo "It can't, sorry."
17727 echo "(I can't compile the test program, so we'll assume not...)"
17737 : can memcpy handle overlapping blocks?
17740 case "$d_memmove" in
17741 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
17742 *) case "$d_memcpy" in
17744 echo "Checking to see if memcpy() can do overlapping copies..." >&4
17746 #$i_memory I_MEMORY
17747 #$i_stdlib I_STDLIB
17748 #$i_string I_STRING
17749 #$i_unistd I_UNISTD
17751 $cat >>try.c <<'EOCP'
17754 # include <memory.h>
17757 # include <stdlib.h>
17760 # include <string.h>
17762 # include <strings.h>
17765 # include <unistd.h> /* Needed for NetBSD */
17769 char buf[128], abc[128];
17775 /* Copy "abcde..." string to char abc[] so that gcc doesn't
17776 try to store the string in read-only memory. */
17777 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
17779 for (align = 7; align >= 0; align--) {
17780 for (len = 36; len; len--) {
17782 memcpy(b, abc, len);
17783 for (off = 1; off <= len; off++) {
17784 memcpy(b+off, b, len);
17785 memcpy(b, b+off, len);
17786 if (memcmp(b, abc, len))
17795 if eval $compile_ok; then
17796 if $run ./try 2>/dev/null; then
17797 echo "Yes, it can."
17800 echo "It can't, sorry."
17803 echo "(I can't compile the test program, so we'll assume not...)"
17813 : can memcmp be trusted to compare relative magnitude?
17815 case "$d_memcmp" in
17818 echo "Checking if your memcmp() can compare relative magnitude..." >&4
17820 #$i_memory I_MEMORY
17821 #$i_stdlib I_STDLIB
17822 #$i_string I_STRING
17823 #$i_unistd I_UNISTD
17825 $cat >>try.c <<'EOCP'
17828 # include <memory.h>
17831 # include <stdlib.h>
17834 # include <string.h>
17836 # include <strings.h>
17839 # include <unistd.h> /* Needed for NetBSD */
17845 if ((a < b) && memcmp(&a, &b, 1) < 0)
17851 if eval $compile_ok; then
17852 if $run ./try 2>/dev/null; then
17853 echo "Yes, it can."
17856 echo "No, it can't (it uses signed chars)."
17859 echo "(I can't compile the test program, so we'll assume not...)"
17867 : see if prototype for sbrk is available
17869 set d_sbrkproto sbrk $i_unistd unistd.h
17872 : see if scalbn exists
17873 set scalbn d_scalbn
17876 : see if select exists
17877 set select d_select
17880 : see if semctl exists
17881 set semctl d_semctl
17884 : see if semget exists
17885 set semget d_semget
17888 : see if semop exists
17892 : see how much of the 'sem*(2)' library is present.
17895 case "$d_semctl$d_semget$d_semop" in
17896 *"$undef"*) h_sem=false;;
17900 case "`ipcs 2>&1`" in
17901 "SVID messages"*"not configured"*)
17902 echo "Your $osname does not have the sem*(2) configured." >&4
17905 set semctl d_semctl
17907 set semget d_semget
17915 : we could also check for sys/ipc.h ...
17916 if $h_sem && $test `./findhdr sys/sem.h`; then
17917 echo "You have the full sem*(2) library." >&4
17920 echo "You don't have the full sem*(2) library." >&4
17926 : see whether sys/sem.h defines union semun
17928 $cat > try.c <<'END'
17929 #include <sys/types.h>
17930 #include <sys/ipc.h>
17931 #include <sys/sem.h>
17932 int main () { union semun semun; semun.buf = 0; }
17935 if eval $compile; then
17936 echo "You have union semun in <sys/sem.h>." >&4
17939 echo "You do not have union semun in <sys/sem.h>." >&4
17946 : see how to do semctl IPC_STAT
17950 $cat > tryh.h <<END
17953 # define S_IRUSR S_IREAD
17954 # define S_IWUSR S_IWRITE
17955 # define S_IXUSR S_IEXEC
17957 # define S_IRUSR 0400
17958 # define S_IWUSR 0200
17959 # define S_IXUSR 0100
17961 # define S_IRGRP (S_IRUSR>>3)
17962 # define S_IWGRP (S_IWUSR>>3)
17963 # define S_IXGRP (S_IXUSR>>3)
17964 # define S_IROTH (S_IRUSR>>6)
17965 # define S_IWOTH (S_IWUSR>>6)
17966 # define S_IXOTH (S_IXUSR>>6)
17969 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
17970 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
17971 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
17974 : see whether semctl IPC_STAT can use union semun
17975 case "$d_semctl_semun" in
17979 #include <sys/types.h>
17980 #include <sys/ipc.h>
17981 #include <sys/sem.h>
17982 #include <sys/stat.h>
17989 #$d_union_semun HAS_UNION_SEMUN
17992 #ifndef HAS_UNION_SEMUN
17995 struct semid_ds *buf;
17996 unsigned short *array;
18002 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
18003 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
18005 struct semid_ds argbuf;
18008 st = semctl(sem, 0, IPC_STAT, arg);
18012 # endif /* IPC_STAT */
18013 printf("semctl IPC_STAT failed: errno = %d\n", errno);
18015 if (semctl(sem, 0, IPC_RMID, arg) != 0)
18016 # endif /* IPC_RMID */
18017 printf("semctl IPC_RMID failed: errno = %d\n", errno);
18019 #endif /* IPC_PRIVATE && ... */
18020 printf("semget failed: errno = %d\n", errno);
18025 if eval $compile; then
18028 semun) val="$define" ;;
18036 case "$d_semctl_semun" in
18038 echo "You can use union semun for semctl IPC_STAT." >&4
18041 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
18046 : see whether semctl IPC_STAT can use struct semid_ds pointer
18047 case "$d_semctl_semid_ds" in
18050 $cat > try.c <<'END'
18051 #include <sys/types.h>
18052 #include <sys/ipc.h>
18053 #include <sys/sem.h>
18054 #include <sys/stat.h>
18062 struct semid_ds arg;
18065 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
18066 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
18069 st = semctl(sem, 0, IPC_STAT, &arg);
18071 printf("semid_ds\n");
18073 # endif /* IPC_STAT */
18074 printf("semctl IPC_STAT failed: errno = %d\n", errno);
18076 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
18077 # endif /* IPC_RMID */
18078 printf("semctl IPC_RMID failed: errno = %d\n", errno);
18080 #endif /* IPC_PRIVATE && ... */
18081 printf("semget failed: errno = %d\n", errno);
18087 if eval $compile; then
18090 semid_ds) val="$define" ;;
18094 set d_semctl_semid_ds
18098 case "$d_semctl_semid_ds" in
18100 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
18102 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
18108 # We do not have the full sem*(2) library, so assume we can not
18114 set d_semctl_semid_ds
18120 : see if sendmsg exists
18121 set sendmsg d_sendmsg
18124 : see if setegid exists
18125 set setegid d_setegid
18128 : see if seteuid exists
18129 set seteuid d_seteuid
18132 : see if setgrent exists
18133 set setgrent d_setgrent
18136 : see if setgrent_r exists
18137 set setgrent_r d_setgrent_r
18139 case "$d_setgrent_r" in
18141 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
18142 case "$d_setgrent_r_proto:$usethreads" in
18143 ":define") d_setgrent_r_proto=define
18144 set d_setgrent_r_proto setgrent_r $hdrs
18148 case "$d_setgrent_r_proto" in
18150 case "$setgrent_r_proto" in
18151 ''|0) try='int setgrent_r(FILE**);'
18152 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=I_H ;;
18154 case "$setgrent_r_proto" in
18155 ''|0) try='void setgrent_r(FILE**);'
18156 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=V_H ;;
18158 case "$setgrent_r_proto" in
18159 ''|0) d_setgrent_r=undef
18161 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
18162 * ) case "$setgrent_r_proto" in
18163 REENTRANT_PROTO*) ;;
18164 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
18166 echo "Prototype: $try" ;;
18169 *) case "$usethreads" in
18170 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
18177 *) setgrent_r_proto=0
18181 : see if sethostent exists
18182 set sethostent d_sethent
18185 : see if sethostent_r exists
18186 set sethostent_r d_sethostent_r
18188 case "$d_sethostent_r" in
18190 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18191 case "$d_sethostent_r_proto:$usethreads" in
18192 ":define") d_sethostent_r_proto=define
18193 set d_sethostent_r_proto sethostent_r $hdrs
18197 case "$d_sethostent_r_proto" in
18199 case "$sethostent_r_proto" in
18200 ''|0) try='int sethostent_r(int, struct hostent_data*);'
18201 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=I_ID ;;
18203 case "$sethostent_r_proto" in
18204 ''|0) try='void sethostent_r(int, struct hostent_data*);'
18205 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=V_ID ;;
18207 case "$sethostent_r_proto" in
18208 ''|0) d_sethostent_r=undef
18209 sethostent_r_proto=0
18210 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
18211 * ) case "$sethostent_r_proto" in
18212 REENTRANT_PROTO*) ;;
18213 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
18215 echo "Prototype: $try" ;;
18218 *) case "$usethreads" in
18219 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
18221 d_sethostent_r=undef
18222 sethostent_r_proto=0
18226 *) sethostent_r_proto=0
18230 : see if setitimer exists
18231 set setitimer d_setitimer
18234 : see if setlinebuf exists
18235 set setlinebuf d_setlinebuf
18238 : see if setlocale exists
18239 set setlocale d_setlocale
18242 : see if locale.h is available
18243 set locale.h i_locale
18246 : see if setlocale_r exists
18247 set setlocale_r d_setlocale_r
18249 case "$d_setlocale_r" in
18251 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
18252 case "$d_setlocale_r_proto:$usethreads" in
18253 ":define") d_setlocale_r_proto=define
18254 set d_setlocale_r_proto setlocale_r $hdrs
18258 case "$d_setlocale_r_proto" in
18260 case "$setlocale_r_proto" in
18261 ''|0) try='int setlocale_r(int, const char*, char*, int);'
18262 ./protochk "$extern_C $try" $hdrs && setlocale_r_proto=I_ICBI ;;
18264 case "$setlocale_r_proto" in
18265 ''|0) d_setlocale_r=undef
18266 setlocale_r_proto=0
18267 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
18268 * ) case "$setlocale_r_proto" in
18269 REENTRANT_PROTO*) ;;
18270 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
18272 echo "Prototype: $try" ;;
18275 *) case "$usethreads" in
18276 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
18278 d_setlocale_r=undef
18279 setlocale_r_proto=0
18283 *) setlocale_r_proto=0
18287 : see if setnetent exists
18288 set setnetent d_setnent
18291 : see if setnetent_r exists
18292 set setnetent_r d_setnetent_r
18294 case "$d_setnetent_r" in
18296 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18297 case "$d_setnetent_r_proto:$usethreads" in
18298 ":define") d_setnetent_r_proto=define
18299 set d_setnetent_r_proto setnetent_r $hdrs
18303 case "$d_setnetent_r_proto" in
18305 case "$setnetent_r_proto" in
18306 ''|0) try='int setnetent_r(int, struct netent_data*);'
18307 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=I_ID ;;
18309 case "$setnetent_r_proto" in
18310 ''|0) try='void setnetent_r(int, struct netent_data*);'
18311 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=V_ID ;;
18313 case "$setnetent_r_proto" in
18314 ''|0) d_setnetent_r=undef
18315 setnetent_r_proto=0
18316 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
18317 * ) case "$setnetent_r_proto" in
18318 REENTRANT_PROTO*) ;;
18319 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
18321 echo "Prototype: $try" ;;
18324 *) case "$usethreads" in
18325 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
18327 d_setnetent_r=undef
18328 setnetent_r_proto=0
18332 *) setnetent_r_proto=0
18336 : see if setprotoent exists
18337 set setprotoent d_setpent
18340 : see if setpgid exists
18341 set setpgid d_setpgid
18344 : see if setpgrp2 exists
18345 set setpgrp2 d_setpgrp2
18348 : see if setpriority exists
18349 set setpriority d_setprior
18352 : see if setproctitle exists
18353 set setproctitle d_setproctitle
18356 : see if setprotoent_r exists
18357 set setprotoent_r d_setprotoent_r
18359 case "$d_setprotoent_r" in
18361 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18362 case "$d_setprotoent_r_proto:$usethreads" in
18363 ":define") d_setprotoent_r_proto=define
18364 set d_setprotoent_r_proto setprotoent_r $hdrs
18368 case "$d_setprotoent_r_proto" in
18370 case "$setprotoent_r_proto" in
18371 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
18372 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=I_ID ;;
18374 case "$setprotoent_r_proto" in
18375 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
18376 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=V_ID ;;
18378 case "$setprotoent_r_proto" in
18379 ''|0) d_setprotoent_r=undef
18380 setprotoent_r_proto=0
18381 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
18382 * ) case "$setprotoent_r_proto" in
18383 REENTRANT_PROTO*) ;;
18384 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
18386 echo "Prototype: $try" ;;
18389 *) case "$usethreads" in
18390 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
18392 d_setprotoent_r=undef
18393 setprotoent_r_proto=0
18397 *) setprotoent_r_proto=0
18401 : see if setpwent exists
18402 set setpwent d_setpwent
18405 : see if setpwent_r exists
18406 set setpwent_r d_setpwent_r
18408 case "$d_setpwent_r" in
18410 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
18411 case "$d_setpwent_r_proto:$usethreads" in
18412 ":define") d_setpwent_r_proto=define
18413 set d_setpwent_r_proto setpwent_r $hdrs
18417 case "$d_setpwent_r_proto" in
18419 case "$setpwent_r_proto" in
18420 ''|0) try='int setpwent_r(FILE**);'
18421 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=I_H ;;
18423 case "$setpwent_r_proto" in
18424 ''|0) try='void setpwent_r(FILE**);'
18425 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=V_H ;;
18427 case "$setpwent_r_proto" in
18428 ''|0) d_setpwent_r=undef
18430 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
18431 * ) case "$setpwent_r_proto" in
18432 REENTRANT_PROTO*) ;;
18433 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
18435 echo "Prototype: $try" ;;
18438 *) case "$usethreads" in
18439 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
18446 *) setpwent_r_proto=0
18450 : see if setregid exists
18451 set setregid d_setregid
18453 set setresgid d_setresgid
18456 : see if setreuid exists
18457 set setreuid d_setreuid
18459 set setresuid d_setresuid
18462 : see if setrgid exists
18463 set setrgid d_setrgid
18466 : see if setruid exists
18467 set setruid d_setruid
18470 : see if setservent exists
18471 set setservent d_setsent
18474 : see if setservent_r exists
18475 set setservent_r d_setservent_r
18477 case "$d_setservent_r" in
18479 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18480 case "$d_setservent_r_proto:$usethreads" in
18481 ":define") d_setservent_r_proto=define
18482 set d_setservent_r_proto setservent_r $hdrs
18486 case "$d_setservent_r_proto" in
18488 case "$setservent_r_proto" in
18489 ''|0) try='int setservent_r(int, struct servent_data*);'
18490 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=I_ID ;;
18492 case "$setservent_r_proto" in
18493 ''|0) try='void setservent_r(int, struct servent_data*);'
18494 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=V_ID ;;
18496 case "$setservent_r_proto" in
18497 ''|0) d_setservent_r=undef
18498 setservent_r_proto=0
18499 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
18500 * ) case "$setservent_r_proto" in
18501 REENTRANT_PROTO*) ;;
18502 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
18504 echo "Prototype: $try" ;;
18507 *) case "$usethreads" in
18508 define) echo "setservent_r has no prototype, not using it." >&4 ;;
18510 d_setservent_r=undef
18511 setservent_r_proto=0
18515 *) setservent_r_proto=0
18519 : see if setsid exists
18520 set setsid d_setsid
18523 : see if setvbuf exists
18524 set setvbuf d_setvbuf
18527 : see if shmctl exists
18528 set shmctl d_shmctl
18531 : see if shmget exists
18532 set shmget d_shmget
18535 : see if shmat exists
18538 : see what shmat returns
18541 $cat >shmat.c <<'END'
18542 #include <sys/shm.h>
18545 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
18550 echo "and it returns ($shmattype)." >&4
18551 : see if a prototype for shmat is available
18552 xxx=`./findhdr sys/shm.h`
18553 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
18554 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
18565 set d_shmatprototype
18568 : see if shmdt exists
18572 : see how much of the 'shm*(2)' library is present.
18575 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
18576 *"$undef"*) h_shm=false;;
18580 case "`ipcs 2>&1`" in
18581 "SVID shared memory"*"not configured"*)
18582 echo "Your $osname does not have the shm*(2) configured." >&4
18585 set shmctl d_shmctl
18587 set shmget d_shmget
18597 : we could also check for sys/ipc.h ...
18598 if $h_shm && $test `./findhdr sys/shm.h`; then
18599 echo "You have the full shm*(2) library." >&4
18602 echo "You don't have the full shm*(2) library." >&4
18608 : see if we have sigaction
18610 if set sigaction val -f d_sigaction; eval $csym; $val; then
18611 echo 'sigaction() found.' >&4
18614 #include <sys/types.h>
18615 #include <signal.h>
18616 #$i_stdlib I_STDLIB
18618 #include <stdlib.h>
18622 struct sigaction act, oact;
18624 oact.sa_handler = 0;
18625 /* so that act and oact are used */
18626 exit(act.sa_flags == 0 && oact.sa_handler == 0);
18630 if eval $compile_ok; then
18633 echo "But you don't seem to have a usable struct sigaction." >&4
18637 echo 'sigaction NOT found.' >&4
18640 set d_sigaction; eval $setvar
18643 : see if this is a sunmath.h system
18644 set sunmath.h i_sunmath
18647 : see if signbit exists
18648 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
18651 #$i_sunmath I_SUNMATH
18655 #ifdef I_SUNMATH /* Solaris special math library */
18656 # include <sunmath.h>
18659 int main(int argc, char **argv)
18663 if ((signbit(x) == 0) && (signbit(y) != 0))
18671 if eval $compile; then
18672 if $run ./try; then
18676 $echo "Signbit seems to be available, but doesn't work as I expected."
18677 $echo "I won't use it." >&4
18688 : see if sigprocmask exists
18689 set sigprocmask d_sigprocmask
18692 : see if sigsetjmp exists
18694 case "$d_sigsetjmp" in
18697 #include <setjmp.h>
18698 #$i_stdlib I_STDLIB
18700 #include <stdlib.h>
18706 if (sigsetjmp(env,1))
18709 siglongjmp(env, 1);
18714 if eval $compile; then
18715 if $run ./try >/dev/null 2>&1; then
18716 echo "POSIX sigsetjmp found." >&4
18720 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
18726 echo "sigsetjmp not found." >&4
18730 *) val="$d_sigsetjmp"
18731 case "$d_sigsetjmp" in
18732 $define) echo "POSIX sigsetjmp found." >&4;;
18733 $undef) echo "sigsetjmp not found." >&4;;
18741 : see if snprintf exists
18742 set snprintf d_snprintf
18745 : see if vsnprintf exists
18746 set vsnprintf d_vsnprintf
18749 case "$d_snprintf-$d_vsnprintf" in
18752 Checking whether your snprintf() and vsnprintf() work okay...
18754 $cat >try.c <<'EOCP'
18755 /* v?snprintf testing logic courtesy of Russ Allbery.
18756 * According to C99:
18757 * - if the buffer is too short it still must be \0-terminated
18758 * - if the buffer is too short the potentially required length
18759 * must be returned and not -1
18760 * - if the buffer is NULL the potentially required length
18761 * must be returned and not -1 or core dump
18764 #include <stdarg.h>
18768 int test (char *format, ...)
18773 va_start (args, format);
18774 count = vsnprintf (buf, sizeof buf, format, args);
18781 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
18782 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
18786 if eval $compile; then
18789 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
18791 Your snprintf() and snprintf() don't seem to be working okay.
18793 d_snprintf="$undef"
18794 d_vsnprintf="$undef"
18798 echo "(I can't seem to compile the test program--assuming they don't)"
18799 d_snprintf="$undef"
18800 d_vsnprintf="$undef"
18806 : see if sockatmark exists
18807 set sockatmark d_sockatmark
18810 : see if prototype for sockatmark is available
18812 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
18815 : see if socks5_init exists
18816 set socks5_init d_socks5_init
18819 : see if sprintf returns the length of the string in the buffer as per ANSI
18820 $echo "Checking whether sprintf returns the length of the string..." >&4
18823 #$i_stdlib I_STDLIB
18825 #include <stdlib.h>
18827 #$i_string I_STRING
18829 # include <string.h>
18831 # include <strings.h>
18840 int check (size_t expect, int test) {
18841 size_t got = strlen(buffer);
18845 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
18850 int main(int argc, char **argv) {
18853 check(sprintf(buffer, ""), ++test);
18854 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
18855 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
18862 if eval $compile; then
18866 sprintf returns the length of the string (as ANSI says it should)
18868 d_sprintf_returns_strlen="$define"
18871 sprintf does not return the length of the string (how old is this system?)
18873 d_sprintf_returns_strlen="$undef"
18877 echo "(I can't seem to compile the test program--assuming it doesn't)" >&4
18878 d_sprintf_returns_strlen="$undef"
18882 : see if srand48_r exists
18883 set srand48_r d_srand48_r
18885 case "$d_srand48_r" in
18887 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
18888 case "$d_srand48_r_proto:$usethreads" in
18889 ":define") d_srand48_r_proto=define
18890 set d_srand48_r_proto srand48_r $hdrs
18894 case "$d_srand48_r_proto" in
18896 case "$srand48_r_proto" in
18897 ''|0) try='int srand48_r(long, struct drand48_data*);'
18898 ./protochk "$extern_C $try" $hdrs && srand48_r_proto=I_LS ;;
18900 case "$srand48_r_proto" in
18901 ''|0) d_srand48_r=undef
18903 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
18904 * ) case "$srand48_r_proto" in
18905 REENTRANT_PROTO*) ;;
18906 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
18908 echo "Prototype: $try" ;;
18911 *) case "$usethreads" in
18912 define) echo "srand48_r has no prototype, not using it." >&4 ;;
18919 *) srand48_r_proto=0
18923 : see if srandom_r exists
18924 set srandom_r d_srandom_r
18926 case "$d_srandom_r" in
18928 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
18929 case "$d_srandom_r_proto:$usethreads" in
18930 ":define") d_srandom_r_proto=define
18931 set d_srandom_r_proto srandom_r $hdrs
18935 case "$d_srandom_r_proto" in
18937 case "$srandom_r_proto" in
18938 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
18939 ./protochk "$extern_C $try" $hdrs && srandom_r_proto=I_TS ;;
18941 case "$srandom_r_proto" in
18942 ''|0) d_srandom_r=undef
18944 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
18945 * ) case "$srandom_r_proto" in
18946 REENTRANT_PROTO*) ;;
18947 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
18949 echo "Prototype: $try" ;;
18952 *) case "$usethreads" in
18953 define) echo "srandom_r has no prototype, not using it." >&4 ;;
18960 *) srandom_r_proto=0
18964 : see if prototype for setresgid is available
18966 set d_sresgproto setresgid $i_unistd unistd.h
18969 : see if prototype for setresuid is available
18971 set d_sresuproto setresuid $i_unistd unistd.h
18974 : see if stat exists
18978 : see if sys/stat.h is available
18979 set sys/stat.h i_sysstat
18982 : see if stat knows about block sizes
18984 echo "Checking to see if your struct stat has st_blocks field..." >&4
18985 set d_statblks stat st_blocks $i_sysstat sys/stat.h
18988 : see if this is a sys/vfs.h system
18989 set sys/vfs.h i_sysvfs
18992 : see if this is a sys/statfs.h system
18993 set sys/statfs.h i_sysstatfs
18996 : Check for statfs_s
18998 echo "Checking to see if your system supports struct statfs..." >&4
18999 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
19001 case "$d_statfs_s" in
19002 "$define") echo "Yes, it does." ;;
19003 *) echo "No, it doesn't." ;;
19007 : see if struct statfs knows about f_flags
19008 case "$d_statfs_s" in
19011 echo "Checking to see if your struct statfs has f_flags field..." >&4
19012 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
19016 set d_statfs_f_flags
19020 case "$d_statfs_f_flags" in
19021 "$define") echo "Yes, it does." ;;
19022 *) echo "No, it doesn't." ;;
19025 : see what flavor, if any, of static inline is supported
19027 echo "Checking to see if your system supports static inline..."
19028 $cat > try.c <<'EOCP'
19029 #include <stdlib.h>
19030 extern int f_via_a(int x);
19031 extern int f_via_b(int x);
19032 int main(int argc, char **argv)
19041 return EXIT_SUCCESS;
19044 return EXIT_FAILURE;
19048 $cat > a.c <<'EOCP'
19049 static INLINE int f(int x) {
19060 $cat > b.c <<'EOCP'
19061 extern int f(int x);
19069 # Respect a hint (or previous) value for perl_static_inline, if there is one.
19070 case "$perl_static_inline" in
19071 '') # Check the various possibilities, and break out on success.
19072 # For gcc, prefer __inline__, which will still permit
19073 # cflags.SH to add in -ansi.
19074 case "$gccversion" in
19075 '') xxx="inline __inline__ __inline _inline";;
19076 *) xxx="__inline__ inline __inline _inline";;
19078 for inline in $xxx; do
19079 set try -DINLINE=$inline a.c
19080 if eval $compile && $run ./try; then
19081 # Now make sure there is no external linkage of static
19083 set try -DINLINE=$inline -DUSE_B a.c b.c
19084 if eval $compile && $run ./try; then
19085 $echo "Your compiler supports static $inline, " >&4
19086 $echo "but it also creates an external definition," >&4
19087 $echo "so I won't use it." >&4
19090 $echo "Your compiler supports static $inline." >&4
19092 perl_static_inline="static $inline";
19096 $echo "Your compiler does NOT support static $inline." >&4
19101 *inline*) # Some variant of inline exists.
19102 echo "Keeping your $hint value of $perl_static_inline."
19105 static) # No inline capabilities
19106 echo "Keeping your $hint value of $perl_static_inline."
19109 *) # Unrecognized previous value -- blindly trust the supplied
19110 # value and hope it makes sense. Use old value for
19111 # d_static_inline, if there is one.
19112 echo "Keeping your $hint value of $perl_static_inline."
19113 case "$d_static_inline" in
19115 *) val=$d_static_inline ;;
19119 # Fallback to plain 'static' if nothing worked.
19120 case "$perl_static_inline" in
19122 perl_static_inline="static"
19126 set d_static_inline
19128 $rm -f a.[co] b.[co]
19131 : Check stream access
19133 Checking how to access stdio streams by file descriptor number...
19135 case "$stdio_stream_array" in
19136 '') $cat >try.c <<EOCP
19139 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
19143 for s in _iob __iob __sF
19145 set try -DSTDIO_STREAM_ARRAY=$s
19146 if eval $compile; then
19147 case "`$run ./try`" in
19148 yes) stdio_stream_array=$s; break ;;
19154 case "$stdio_stream_array" in
19156 I can't figure out how to access stdio streams by file descriptor number.
19158 d_stdio_stream_array="$undef"
19161 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
19163 d_stdio_stream_array="$define"
19167 : see if strcoll exists
19168 set strcoll d_strcoll
19171 : check for structure copying
19173 echo "Checking to see if your C compiler can copy structs..." >&4
19174 $cat >try.c <<'EOCP'
19184 if $cc -c try.c >/dev/null 2>&1 ; then
19186 echo "Yup, it can."
19189 echo "Nope, it can't."
19195 : see if strerror and/or sys_errlist[] exist
19197 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
19198 if set strerror val -f d_strerror; eval $csym; $val; then
19199 echo 'strerror() found.' >&4
19200 d_strerror="$define"
19201 d_strerrm='strerror(e)'
19202 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
19203 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
19204 d_syserrlst="$define"
19206 echo "(Since you don't have sys_errlist[], strerror() is welcome.)"
19207 d_syserrlst="$undef"
19209 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
19210 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
19211 echo 'strerror() found in string header.' >&4
19212 d_strerror="$define"
19213 d_strerrm='strerror(e)'
19214 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
19215 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
19216 d_syserrlst="$define"
19218 echo "(You don't appear to have any sys_errlist[], how can this be?)"
19219 d_syserrlst="$undef"
19221 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
19222 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
19223 d_strerror="$undef"
19224 d_syserrlst="$define"
19225 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
19227 echo 'strerror() and sys_errlist[] NOT found.' >&4
19228 d_strerror="$undef"
19229 d_syserrlst="$undef"
19230 d_strerrm='"unknown"'
19234 : see if strerror_r exists
19235 set strerror_r d_strerror_r
19237 case "$d_strerror_r" in
19239 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
19240 case "$d_strerror_r_proto:$usethreads" in
19241 ":define") d_strerror_r_proto=define
19242 set d_strerror_r_proto strerror_r $hdrs
19246 case "$d_strerror_r_proto" in
19248 case "$strerror_r_proto" in
19249 ''|0) try='int strerror_r(int, char*, size_t);'
19250 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBW ;;
19252 case "$strerror_r_proto" in
19253 ''|0) try='int strerror_r(int, char*, int);'
19254 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBI ;;
19256 case "$strerror_r_proto" in
19257 ''|0) try='char* strerror_r(int, char*, size_t);'
19258 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=B_IBW ;;
19260 case "$strerror_r_proto" in
19261 ''|0) d_strerror_r=undef
19263 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
19264 * ) case "$strerror_r_proto" in
19265 REENTRANT_PROTO*) ;;
19266 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
19268 echo "Prototype: $try" ;;
19271 *) case "$usethreads" in
19272 define) echo "strerror_r has no prototype, not using it." >&4 ;;
19279 *) strerror_r_proto=0
19283 : see if strftime exists
19284 set strftime d_strftime
19287 : see if strlcat exists
19288 set strlcat d_strlcat
19291 : see if strlcpy exists
19292 set strlcpy d_strlcpy
19295 : see if strtod exists
19296 set strtod d_strtod
19299 : see if strtol exists
19300 set strtol d_strtol
19303 : see if strtold exists
19304 set strtold d_strtold
19307 : see if strtoll exists
19308 set strtoll d_strtoll
19311 case "$d_longlong-$d_strtoll" in
19314 Checking whether your strtoll() works okay...
19316 $cat >try.c <<'EOCP'
19319 #define strtoll __strtoll
19322 #define strtoll _strtoll
19325 extern long long int strtoll(char *s, char **, int);
19326 static int bad = 0;
19327 int check(char *s, long long ell, int een) {
19330 gll = strtoll(s, 0, 10);
19331 if (!((gll == ell) && (errno == een)))
19335 check(" 1", 1LL, 0);
19336 check(" 0", 0LL, 0);
19337 check("-1", -1LL, 0);
19338 check("-9223372036854775808", -9223372036854775808LL, 0);
19339 check("-9223372036854775808", -9223372036854775808LL, 0);
19340 check(" 9223372036854775807", 9223372036854775807LL, 0);
19341 check("-9223372036854775808", -9223372036854775808LL, 0);
19342 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
19343 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
19349 if eval $compile; then
19352 ok) echo "Your strtoll() seems to be working okay." ;;
19354 Your strtoll() doesn't seem to be working okay.
19360 echo "(I can't seem to compile the test program--assuming it doesn't)"
19366 : see if strtoq exists
19367 set strtoq d_strtoq
19370 : see if strtoul exists
19371 set strtoul d_strtoul
19374 case "$d_strtoul" in
19377 Checking whether your strtoul() works okay...
19379 $cat >try.c <<'EOCP'
19382 extern unsigned long int strtoul(char *s, char **, int);
19383 static int bad = 0;
19384 void check(char *s, unsigned long eul, int een) {
19387 gul = strtoul(s, 0, 10);
19388 if (!((gul == eul) && (errno == een)))
19392 check(" 1", 1L, 0);
19393 check(" 0", 0L, 0);
19395 case "$longsize" in
19397 $cat >>try.c <<'EOCP'
19398 check("18446744073709551615", 18446744073709551615UL, 0);
19399 check("18446744073709551616", 18446744073709551615UL, ERANGE);
19400 #if 0 /* strtoul() for /^-/ strings is undefined. */
19401 check("-1", 18446744073709551615UL, 0);
19402 check("-18446744073709551614", 2, 0);
19403 check("-18446744073709551615", 1, 0);
19404 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
19405 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
19410 $cat >>try.c <<'EOCP'
19411 check("4294967295", 4294967295UL, 0);
19412 check("4294967296", 4294967295UL, ERANGE);
19413 #if 0 /* strtoul() for /^-/ strings is undefined. */
19414 check("-1", 4294967295UL, 0);
19415 check("-4294967294", 2, 0);
19416 check("-4294967295", 1, 0);
19417 check("-4294967296", 4294967295UL, ERANGE);
19418 check("-4294967297", 4294967295UL, ERANGE);
19423 : Should we write these tests to be more portable by sprintf-ing
19424 : ~0 and then manipulating that char string as input for strtol?
19427 $cat >>try.c <<'EOCP'
19434 if eval $compile; then
19435 case "`$run ./try`" in
19436 ok) echo "Your strtoul() seems to be working okay." ;;
19438 Your strtoul() doesn't seem to be working okay.
19444 echo "(I can't seem to compile the test program--assuming it doesn't)"
19450 : see if strtoull exists
19451 set strtoull d_strtoull
19454 case "$d_longlong-$d_strtoull" in
19457 Checking whether your strtoull() works okay...
19459 $cat >try.c <<'EOCP'
19462 #define strtoull __strtoull
19465 extern unsigned long long int strtoull(char *s, char **, int);
19466 static int bad = 0;
19467 int check(char *s, long long eull, int een) {
19470 gull = strtoull(s, 0, 10);
19471 if (!((gull == eull) && (errno == een)))
19475 check(" 1", 1LL, 0);
19476 check(" 0", 0LL, 0);
19477 check("18446744073709551615", 18446744073709551615ULL, 0);
19478 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
19479 #if 0 /* strtoull() for /^-/ strings is undefined. */
19480 check("-1", 18446744073709551615ULL, 0);
19481 check("-18446744073709551614", 2LL, 0);
19482 check("-18446744073709551615", 1LL, 0);
19483 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
19484 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
19491 if eval $compile; then
19492 case "`$run ./try`" in
19493 ok) echo "Your strtoull() seems to be working okay." ;;
19495 Your strtoull() doesn't seem to be working okay.
19497 d_strtoull="$undef"
19501 echo "(I can't seem to compile the test program--assuming it doesn't)"
19502 d_strtoull="$undef"
19507 : see if strtouq exists
19508 set strtouq d_strtouq
19511 case "$d_strtouq" in
19514 Checking whether your strtouq() works okay...
19516 $cat >try.c <<'EOCP'
19519 extern unsigned long long int strtouq(char *s, char **, int);
19520 static int bad = 0;
19521 void check(char *s, unsigned long long eull, int een) {
19522 unsigned long long gull;
19524 gull = strtouq(s, 0, 10);
19525 if (!((gull == eull) && (errno == een)))
19529 check(" 1", 1LL, 0);
19530 check(" 0", 0LL, 0);
19531 check("18446744073709551615", 18446744073709551615ULL, 0);
19532 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
19533 #if 0 /* strtouq() for /^-/ strings is undefined. */
19534 check("-1", 18446744073709551615ULL, 0);
19535 check("-18446744073709551614", 2LL, 0);
19536 check("-18446744073709551615", 1LL, 0);
19537 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
19538 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
19546 if eval $compile; then
19547 case "`$run ./try`" in
19548 ok) echo "Your strtouq() seems to be working okay." ;;
19550 Your strtouq() doesn't seem to be working okay.
19556 echo "(I can't seem to compile the test program--assuming it doesn't)"
19562 : see if strxfrm exists
19563 set strxfrm d_strxfrm
19566 : see if symlink exists
19567 set symlink d_symlink
19570 : see if syscall exists
19571 set syscall d_syscall
19574 : see if prototype for syscall is available
19576 set d_syscallproto syscall $i_unistd unistd.h
19579 : see if sysconf exists
19580 set sysconf d_sysconf
19583 : see if system exists
19584 set system d_system
19587 : see if tcgetpgrp exists
19588 set tcgetpgrp d_tcgetpgrp
19591 : see if tcsetpgrp exists
19592 set tcsetpgrp d_tcsetpgrp
19595 : see if prototype for telldir is available
19597 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
19600 : see if tgamma exists
19601 set tgamma d_tgamma
19604 : see if time exists
19606 if test "X$d_time" = X -o X"$timetype" = X; then
19607 if set time val -f d_time; eval $csym; $val; then
19608 echo 'time() found.' >&4
19610 rp="What is the type returned by time() on this system?"
19611 set time_t timetype long stdio.h sys/types.h
19614 echo 'time() not found, hope that will do.' >&4
19622 : see if timegm exists
19623 set timegm d_timegm
19626 : see if this is a sys/times.h system
19627 set sys/times.h i_systimes
19630 : see if times exists
19632 if set times val -f d_times; eval $csym; $val; then
19633 echo 'times() found.' >&4
19636 case "$i_systimes" in
19637 "$define") inc='sys/times.h';;
19639 rp="What is the type returned by times() on this system?"
19640 set clock_t clocktype long stdio.h sys/types.h $inc
19643 echo 'times() NOT found, hope that will do.' >&4
19648 : see if tmpnam_r exists
19649 set tmpnam_r d_tmpnam_r
19651 case "$d_tmpnam_r" in
19653 hdrs="$i_systypes sys/types.h define stdio.h "
19654 case "$d_tmpnam_r_proto:$usethreads" in
19655 ":define") d_tmpnam_r_proto=define
19656 set d_tmpnam_r_proto tmpnam_r $hdrs
19660 case "$d_tmpnam_r_proto" in
19662 case "$tmpnam_r_proto" in
19663 ''|0) try='char* tmpnam_r(char*);'
19664 ./protochk "$extern_C $try" $hdrs && tmpnam_r_proto=B_B ;;
19666 case "$tmpnam_r_proto" in
19667 ''|0) d_tmpnam_r=undef
19669 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
19670 * ) case "$tmpnam_r_proto" in
19671 REENTRANT_PROTO*) ;;
19672 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
19674 echo "Prototype: $try" ;;
19677 *) case "$usethreads" in
19678 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
19685 *) tmpnam_r_proto=0
19689 : see if trunc exists
19693 : see if truncate exists
19694 set truncate d_truncate
19697 : see if ttyname_r exists
19698 set ttyname_r d_ttyname_r
19700 case "$d_ttyname_r" in
19702 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
19703 case "$d_ttyname_r_proto:$usethreads" in
19704 ":define") d_ttyname_r_proto=define
19705 set d_ttyname_r_proto ttyname_r $hdrs
19709 case "$d_ttyname_r_proto" in
19711 case "$ttyname_r_proto" in
19712 ''|0) try='int ttyname_r(int, char*, size_t);'
19713 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBW ;;
19715 case "$ttyname_r_proto" in
19716 ''|0) try='int ttyname_r(int, char*, int);'
19717 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBI ;;
19719 case "$ttyname_r_proto" in
19720 ''|0) try='char* ttyname_r(int, char*, int);'
19721 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=B_IBI ;;
19723 case "$ttyname_r_proto" in
19724 ''|0) d_ttyname_r=undef
19726 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
19727 * ) case "$ttyname_r_proto" in
19728 REENTRANT_PROTO*) ;;
19729 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
19731 echo "Prototype: $try" ;;
19734 *) case "$usethreads" in
19735 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
19742 *) ttyname_r_proto=0
19746 : see if tzname[] exists
19748 if set tzname val -a d_tzname; eval $csym; $val; then
19750 echo 'tzname[] found.' >&4
19753 echo 'tzname[] NOT found.' >&4
19758 : Check if is a multiplatform env
19760 darwin) multiarch="$define" ;;
19762 case "$multiarch" in
19763 ''|[nN]*) multiarch="$undef" ;;
19766 : check for ordering of bytes in a UV
19768 case "$multiarch" in
19771 You seem to be doing a multiarchitecture build,
19772 skipping the byteorder check.
19778 case "$byteorder" in
19781 In the following, larger digits indicate more significance. A big-endian
19782 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
19783 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
19784 machines may have weird orders like 3412. A Cray will report 87654321,
19785 an Alpha will report 12345678. If the test program works the default is
19787 I'm now running the test program...
19791 #$i_stdlib I_STDLIB
19793 #include <stdlib.h>
19795 #include <sys/types.h>
19796 typedef $uvtype UV;
19806 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
19808 u.l = (UV)0x04030201;
19809 for (i = 0; i < $uvsize; i++)
19810 printf("%c", u.c[i]+'0');
19817 if eval $compile && $run ./try > /dev/null; then
19820 [1-4][1-4][1-4][1-4]|12345678|87654321)
19821 echo "(The test program ran ok.)"
19822 echo "byteorder=$dflt"
19825 ????|????????) echo "(The test program ran ok.)" ;;
19826 *) echo "(The test program didn't run right for some reason.)" ;;
19831 (I can't seem to compile the test program. Guessing big-endian...)
19834 case "$xxx_prompt" in
19836 rp="What is the order of bytes in $uvtype?"
19849 : Checking 32bit alignedness
19852 Checking to see whether you can access character data unalignedly...
19854 case "$d_u32align" in
19855 '') $cat >try.c <<EOCP
19857 #$i_stdlib I_STDLIB
19859 #include <stdlib.h>
19861 #define U32 $u32type
19862 #define BYTEORDER 0x$byteorder
19864 #include <signal.h>
19866 $signal_t bletch(int s) { exit(4); }
19869 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
19870 volatile U8 buf[8];
19874 if (sizeof(U32) != 4) {
19875 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
19882 signal(SIGBUS, bletch);
19894 for (i = 0; i < 4; i++) {
19895 up = (U32*)(buf + i);
19896 if (! ((*up == 1 << (8*i)) || /* big-endian */
19897 (*up == 1 << (8*(3-i))) /* little-endian */
19901 printf("read failed (%x)\n", *up);
19907 for (i = 0; i < 4; i++) {
19908 up = (U32*)(buf + i);
19910 if (*up != 0xBeef) {
19911 printf("write failed (%x)\n", *up);
19925 if eval $compile_ok; then
19926 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
19927 $run ./try 2>&1 >/dev/null
19930 You can access character data pretty unalignedly.
19932 d_u32align="$undef"
19935 It seems that you must access character data in an aligned manner.
19937 d_u32align="$define"
19941 rp='Can you access character data at unaligned addresses?'
19945 [yY]*) d_u32align="$undef" ;;
19946 *) d_u32align="$define" ;;
19953 : see if ualarm exists
19954 set ualarm d_ualarm
19957 : see if umask exists
19961 : see if unordered exists
19962 set unordered d_unordered
19965 : see if unsetenv exists
19966 set unsetenv d_unsetenv
19969 : see if usleep exists
19970 set usleep d_usleep
19973 : see if prototype for usleep is available
19975 set d_usleepproto usleep $i_unistd unistd.h
19978 : see if ustat exists
19982 : see if closedir exists
19983 set closedir d_closedir
19986 case "$d_closedir" in
19989 echo "Checking whether closedir() returns a status..." >&4
19991 #$i_dirent I_DIRENT /**/
19992 #$i_sysdir I_SYS_DIR /**/
19993 #$i_sysndir I_SYS_NDIR /**/
19994 #$i_systypes I_SYS_TYPES /**/
19996 #if defined(I_SYS_TYPES)
19997 #include <sys/types.h>
19999 #if defined(I_DIRENT)
20000 #include <dirent.h>
20003 #include <sys/ndir.h>
20007 #include <ndir.h> /* may be wrong in the future */
20009 #include <sys/dir.h>
20014 int main() { return closedir(opendir(".")); }
20017 if eval $compile_ok; then
20018 if $run ./try > /dev/null 2>&1 ; then
20019 echo "Yes, it does."
20022 echo "No, it doesn't."
20026 echo "(I can't seem to compile the test program--assuming it doesn't)"
20034 set d_void_closedir
20038 : see if there is a wait4
20042 : see if waitpid exists
20043 set waitpid d_waitpid
20048 $cat >try.c <<'EOCP'
20054 return (wcscmp (s, s) ? 1 : 0);
20059 if eval $compile; then
20062 0) echo "A working wcscmp() found." >&4
20064 *) echo "wcscmp() found, but it doesn't work" >&4
20068 echo "wcscmp() NOT found." >&4
20074 : see if wcstombs exists
20075 set wcstombs d_wcstombs
20080 $cat >try.c <<'EOCP'
20085 wchar_t dst[4], *src = L" ";
20087 return (wcsxfrm (dst, src, 1) ? errno ? errno : 0 : 1);
20092 if eval $compile; then
20095 0) echo "A working wcsxfrm() found." >&4
20097 *) echo "wcsxfrm() found, but it doesn't work" >&4
20101 echo "wcsxfrm() NOT found." >&4
20107 : see if wctomb exists
20108 set wctomb d_wctomb
20111 : see if writev exists
20112 set writev d_writev
20115 : check for alignment requirements
20117 case "$alignbytes" in
20118 '') echo "Checking alignment constraints..." >&4
20119 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
20120 $cat >try.c <<'EOCP'
20121 typedef long double NV;
20124 $cat >try.c <<'EOCP'
20128 $cat >>try.c <<'EOCP'
20136 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
20141 if eval $compile_ok; then
20145 echo "(I can't seem to compile the test program...)"
20147 case "$multiarch" in
20149 : The usual safe value is 8, but Darwin with -Duselongdouble
20150 : needs 16. Hence, we will take 8 as a minimum, but allow
20151 : Configure to pick a larger value if needed.
20152 if $test "$dflt" -lt 8; then
20154 echo "Setting alignment to 8 for multiarch support.">&4
20159 *) dflt="$alignbytes"
20162 rp="Doubles must be aligned on a how-many-byte boundary?"
20167 : set the base revision
20170 : length of character in bytes. Is always 1, otherwise it is not C
20171 : This used to be a test using sizeof
20174 : Check for the number of bits in a character
20175 case "$charbits" in
20176 '') echo "Checking how long a character is (in bits)..." >&4
20183 for (c = 1, n = 0; c; c <<= 1, n++) ;
20184 printf ("%d\n", n);
20189 if eval $compile_ok; then
20193 echo "(I can't seem to compile the test program. Guessing...)"
20200 rp="What is the length of a character (in bits)?"
20204 case "$charbits" in
20207 Your system has an unsigned character size of $charbits bits, which
20208 is rather unusual (normally it is 8 bits). Perl likely will not work
20209 correctly on your system, with subtle bugs in various places.
20211 rp='Do you really want to continue?'
20215 [yY]) echo >&4 "Okay, continuing." ;;
20220 : how do we concatenate cpp tokens here?
20222 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
20223 $cat >cpp_stuff.c <<'EOCP'
20224 #define RCAT(a,b)a/**/b
20225 #define ACAT(a,b)a ## b
20229 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
20230 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
20231 echo "Oh! Smells like ANSI's been here." >&4
20232 echo "We can catify or stringify, separately or together!"
20234 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
20235 echo "Ah, yes! The good old days!" >&4
20236 echo "However, in the good old days we don't know how to stringify and"
20237 echo "catify at the same time."
20241 Hmm, I don't seem to be able to concatenate tokens with your cpp.
20242 You're going to have to edit the values of CAT[2-5] in config.h...
20244 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
20248 : see if this is a db.h system
20254 : Check db version.
20256 echo "Checking Berkeley DB version ..." >&4
20262 #include <sys/types.h>
20264 #$i_stdlib I_STDLIB
20266 #include <stdlib.h>
20269 int main(int argc, char *argv[])
20271 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
20272 int Major, Minor, Patch ;
20273 unsigned long Version ;
20274 (void)db_version(&Major, &Minor, &Patch) ;
20276 printf("%d %d %d %d %d %d\n",
20277 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
20278 Major, Minor, Patch);
20281 printf("You have Berkeley DB Version 2 or greater.\n");
20283 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
20284 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
20285 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
20286 Major, Minor, Patch) ;
20288 /* check that db.h & libdb are compatible */
20289 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
20290 printf("db.h and libdb are incompatible.\n") ;
20294 printf("db.h and libdb are compatible.\n") ;
20296 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
20297 + DB_VERSION_PATCH ;
20299 /* needs to be >= 2.3.4 */
20300 if (Version < 2003004) {
20301 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
20302 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
20308 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
20313 printf("You have Berkeley DB Version 1.\n");
20314 exit(0); /* DB version < 2: the coast is clear. */
20316 exit(1); /* <db.h> not Berkeley DB? */
20322 if eval $compile_ok && $run ./try; then
20323 echo 'Looks OK.' >&4
20325 db_version_major=$1
20326 db_version_minor=$2
20327 db_version_patch=$3
20329 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
20333 : Remove db from list of libraries to use
20334 echo "Removing unusable -ldb from library list" >&4
20335 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
20338 echo "libs = $libs" >&4
20348 : Check the return type needed for hash
20350 echo "Checking return type needed for hash for Berkeley DB ..." >&4
20356 #include <sys/types.h>
20359 #ifndef DB_VERSION_MAJOR
20360 u_int32_t hash_cb (const void* ptr, size_t size)
20366 info.hash = hash_cb;
20370 if $cc $ccflags -c try.c >try.out 2>&1 ; then
20371 if $contains warning try.out >>/dev/null 2>&1 ; then
20374 db_hashtype='u_int32_t'
20377 : XXX Maybe we should just give up here.
20378 db_hashtype=u_int32_t
20380 echo "Help: I can't seem to compile the db test program." >&4
20381 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
20384 echo "Your version of Berkeley DB uses $db_hashtype for hash."
20386 *) db_hashtype=u_int32_t
20391 : Check the return type needed for prefix
20393 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
20399 #include <sys/types.h>
20402 #ifndef DB_VERSION_MAJOR
20403 size_t prefix_cb (const DBT *key1, const DBT *key2)
20409 info.prefix = prefix_cb;
20413 if $cc $ccflags -c try.c >try.out 2>&1 ; then
20414 if $contains warning try.out >>/dev/null 2>&1 ; then
20415 db_prefixtype='int'
20417 db_prefixtype='size_t'
20420 db_prefixtype='size_t'
20421 : XXX Maybe we should just give up here.
20423 echo "Help: I can't seem to compile the db test program." >&4
20424 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
20427 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
20429 *) db_prefixtype='size_t'
20433 : Check what kind of inf/nan your system has
20434 $echo "Checking the kind of infinities and nans you have..." >&4
20436 #define DOUBLESIZE $doublesize
20437 #$d_longdbl HAS_LONG_DOUBLE
20438 #ifdef HAS_LONG_DOUBLE
20439 #define LONGDBLSIZE $longdblsize
20440 #define LONGDBLKIND $longdblkind
20447 /* Note that whether the sign bit is on or off
20448 * for NaN depends on the CPU/FPU, and possibly
20449 * can be affected by the build toolchain.
20451 * For example for older MIPS and HP-PA 2.0 the quiet NaN is:
20452 * 0x7f, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
20453 * 0x7f, 0xf4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
20454 * (respectively) as opposed to the more usual
20455 * 0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
20457 static void bytes(unsigned char *p, unsigned int n) {
20459 for (i = 0; i < n; i++) {
20460 printf("0x%02x%s", p[i], i < n - 1 ? ", " : "\n");
20463 int main(int argc, char *argv[]) {
20464 /* We cannot use 1.0/0.0 and 0.0/0.0 (with L suffixes for long double)
20465 * because some compilers are 'smart' and not only warn but refuse to
20466 * compile such 'illegal' values. */
20467 double dinf = exp(1e9);
20468 double dnan = sqrt(-1.0);
20469 #ifdef HAS_LONG_DOUBLE
20470 long double ldinf = (long double)exp(1e9);
20471 long double ldnan = (long double)sqrt(-1.0);
20474 switch (argv[1][0]) {
20475 case '1': bytes(&dinf, sizeof(dinf)); break;
20476 case '2': bytes(&dnan, sizeof(dnan)); break;
20477 #ifdef HAS_LONG_DOUBLE
20478 # if LONG_DOUBLEKIND == 3 || LONG_DOUBLEKIND == 4
20479 /* the 80-bit long doubles might have garbage in their excess bytes */
20480 memset((char *)&ldinf + 10, '\0', LONG_DOUBLESIZE - 10);
20482 case '3': bytes(&ldinf, sizeof(ldinf)); break;
20483 case '4': bytes(&ldnan, sizeof(ldnan)); break;
20491 if eval $compile; then
20492 doubleinfbytes=`$run ./try 1`
20493 doublenanbytes=`$run ./try 2`
20494 case "$d_longdbl" in
20496 longdblinfbytes=`$run ./try 3`
20497 longdblnanbytes=`$run ./try 4`
20501 # Defaults in case the above test program failed.
20502 case "$doublekind" in
20503 1) # IEEE 754 32-bit LE
20504 doubleinfbytes='0x00, 0x00, 0xf0, 0x7f'
20505 doublenanbytes='0x00, 0x00, 0xf8, 0x7f'
20507 2) # IEEE 754 32-bit BE
20508 doubleinfbytes='0x7f, 0xf0, 0x00, 0x00'
20509 doublenanbytes='0x7f, 0xf8, 0x00, 0x00'
20511 3) # IEEE 754 64-bit LE
20512 doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
20513 doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
20515 4) # IEEE 754 64-bit BE
20516 doubleinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20517 doublenanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20519 5) # IEEE 754 128-bit LE
20520 doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
20521 doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
20523 6) # IEEE 754 128-bit BE
20524 doubleinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20525 doublenanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20527 7) # IEEE 754 64-bit mixed: 32-bit LEs in BE
20528 doubleinfbytes='0x00, 0x00, 0xf0, 0x7f, 0x00, 0x00, 0x00, 0x00'
20529 doublenanbytes='0x00, 0x00, 0xf8, 0x7f, 0x00, 0x00, 0x00, 0x00'
20531 8) # IEEE 754 64-bit mixed: 32-bit BEs in LE
20532 doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x7f, 0xf0, 0x00, 0x00'
20533 doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x7f, 0xf8, 0x00, 0x00'
20536 doubleinfbytes=$undef
20537 doublenanbytes=$undef
20540 case "$longdblkind" in
20541 1) # IEEE 754 128-bit LE
20542 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f'
20543 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f'
20545 2) # IEEE 754 128-bit BE
20546 longdblinfbytes='0x7f, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20547 longdblnanbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20549 3) # IEEE 754 80-bit LE, 12 or 16 bytes (x86)
20550 case "$longdblsize" in
20551 12) # x86 32-bit (96 bits, or 4 x 32, or 12 x 8)
20552 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00'
20553 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x7f, 0x00, 0x00'
20556 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20557 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20560 longdblinfbytes=$undef
20561 longdblnanbytes=$undef
20565 4) # IEEE 754 80-bit BE, 12 or 16 bytes
20566 case "$longdblsize" in
20567 12) # 32-bit system
20568 longdblinfbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20569 longdblnanbytes='0x7f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20571 16) # 64-bit system
20572 longdblinfbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20573 longdblnanbytes='0x7f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20576 longdblinfbytes=$undef
20577 longdblnanbytes=$undef
20581 5) # 128-bit LE-LE "double double"
20582 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
20583 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
20585 6) # 128-bit BE-BE "double double"
20586 longdblinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20587 longdblnanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20589 7) # 128-bit LE-BE "double double"
20590 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20591 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20593 8) # 128-bit BE-LE "double double"
20594 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20595 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20598 longdblinfbytes=$undef
20599 longdblnanbytes=$undef
20605 : Check the length of the double mantissa
20606 $echo "Checking how many mantissa bits your doubles have..." >&4
20609 #$i_sunmath I_SUNMATH
20611 # include <float.h>
20614 # include <sunmath.h>
20616 #ifdef DBL_MANT_DIG
20617 # define BITS (DBL_MANT_DIG - 1) /* the implicit bit does not count */
20620 int main(int argc, char *argv[]) {
20622 printf("%d\n", BITS);
20628 if eval $compile; then
20629 doublemantbits=`$run ./try`
20631 doublemantbits="$undef"
20635 : Check the length of the longdouble mantissa
20636 $echo "Checking how many mantissa bits your long doubles have..." >&4
20639 #$i_sunmath I_SUNMATH
20641 # include <float.h>
20644 # include <sunmath.h>
20646 #$d_longdbl HAS_LONG_DOUBLE
20647 #if defined(HAS_LONG_DOUBLE) && defined(LDBL_MANT_DIG)
20648 # if ($longdblkind == 3) || ($longdblkind == 4) /* 80-bit extended precision */
20649 /* This format has no implicit bit. Beware, however, that for
20650 * this format the bare LDBL_MANT_DIG is misleading for inf/nan:
20651 * the top three bits are used for inf (100) / qnan (11x) / snan (101),
20652 * and the top bit must have been one since 387, zero is plain invalid.
20653 * For normal fp values, the LDBL_MANT_DIG is fine, though. */
20654 # define BITS LDBL_MANT_DIG
20655 # elif ($longdblkind == 5 || $longdblkind == 6 || $longdblkind == 7 || $longdblkind == 8) /* double double */
20656 /* LDBL_MANT_DIG of 106 (twice 53) would be logical, but for some
20657 * reason e.g. Irix thinks 107. But in any case, we want only
20658 * the number of real bits, the implicit bits are of no interest. */
20659 # define BITS 2 * (DBL_MANT_DIG - 1)
20661 # define BITS (LDBL_MANT_DIG - 1) /* the implicit bit does not count */
20665 int main(int argc, char *argv[]) {
20667 printf("%d\n", BITS);
20673 if eval $compile; then
20674 longdblmantbits=`$run ./try`
20676 longdblmantbits="$undef"
20680 : Check the length of the NV mantissa
20681 $echo "Checking how many mantissa bits your NVs have..." >&4
20682 if test "X$usequadmath" = "X$define"; then
20683 nvmantbits=112 # 128-1-15
20685 if test "X$nvsize" = "X$doublesize"; then
20686 nvmantbits="$doublemantbits"
20688 if test "X$nvsize" = "X$longdblsize"; then
20689 nvmantbits="$longdblmantbits"
20691 nvmantbits="$undef"
20696 : How can we generate normalized random numbers ?
20698 echo "Using our internal random number implementation..." >&4
20701 *-Dmy_rand=*|*-Dmy_srand=*)
20702 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
20703 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
20704 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
20705 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
20709 randfunc=Perl_drand48
20710 drand01="Perl_drand48()"
20711 seedfunc="Perl_drand48_init"
20715 : Determine if this is an EBCDIC system
20717 echo "Determining whether or not we are on an EBCDIC system..." >&4
20718 $cat >try.c <<'EOM'
20721 if ('M'==0xd4) return 0;
20728 if eval $compile_ok; then
20729 if $run ./try; then
20730 echo "You seem to speak EBCDIC." >&4
20733 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
20736 echo "I'm unable to compile the test program." >&4
20737 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
20743 : Check how to flush
20746 Checking how to flush all pending stdio output...
20748 # I only know how to find the first 32 possibly open files on SunOS.
20749 # See also hints/sunos_4_1.sh and util.c --AD
20751 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
20753 $cat >>try.c <<EOCP
20755 #$i_stdlib I_STDLIB
20757 #include <stdlib.h>
20759 #$i_unistd I_UNISTD
20761 # include <unistd.h>
20763 #$d_sysconf HAS_SYSCONF
20764 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
20765 #ifdef HAS_STDIO_STREAM_ARRAY
20766 # define STDIO_STREAM_ARRAY $stdio_stream_array
20771 p = fopen("try.out", "w");
20775 # ifdef TRY_FPRINTF
20779 #ifdef TRY_FFLUSH_NULL
20782 #ifdef TRY_FFLUSH_ALL
20784 long open_max = -1;
20785 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
20786 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
20788 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
20789 open_max = sysconf(_SC_OPEN_MAX);
20792 open_max = FOPEN_MAX;
20795 open_max = OPEN_MAX;
20804 # ifdef HAS_STDIO_STREAM_ARRAY
20805 if (open_max > 0) {
20807 for (i = 0; i < open_max; i++)
20808 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
20809 STDIO_STREAM_ARRAY[i]._file < open_max &&
20810 STDIO_STREAM_ARRAY[i]._flag)
20811 fflush(&STDIO_STREAM_ARRAY[i]);
20819 : first we have to find out how _not_ to flush
20821 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
20823 set try -DTRY_FPUTC
20824 if eval $compile; then
20825 $run ./try 2>/dev/null
20828 if $test ! -s try.out -a "X$code" = X42; then
20834 set try -DTRY_FPRINTF
20835 if eval $compile; then
20836 $run ./try 2>/dev/null
20839 if $test ! -s try.out -a "X$code" = X42; then
20840 output=-DTRY_FPRINTF
20846 : check for fflush NULL behavior
20847 case "$fflushNULL" in
20848 '') set try -DTRY_FFLUSH_NULL $output
20849 if eval $compile; then
20850 $run ./try 2>/dev/null
20853 if $test -s try.out -a "X$code" = X42; then
20854 fflushNULL="`$cat try.out`"
20856 if $test "X$code" != X42; then
20858 (If this test failed, don't worry, we'll try another method shortly.)
20863 $rm -f core try.core core.try.*
20864 case "$fflushNULL" in
20866 Your fflush(NULL) works okay for output streams.
20867 Let's see if it clobbers input pipes...
20869 # As of mid-March 2000 all versions of Solaris appear to have a stdio
20870 # bug that improperly flushes the input end of pipes. So we avoid the
20871 # autoflush on fork/system/exec support for now. :-(
20872 $cat >tryp.c <<EOCP
20875 main(int argc, char **argv)
20881 while ((i = getc(stdin)) != -1
20882 && (*bp++ = i) != '\n'
20883 && bp < &buf[1024])
20886 fprintf(stdout, "%s", buf);
20894 fflushNULL="$define"
20896 if eval $compile; then
20898 # Copy the .c file to the remote host ($to is an ssh-alike if targethost is set)
20899 if $test "X$targethost" != X; then
20902 $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
20904 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
20906 if cmp tryp.c tryp.out >/dev/null 2>&1; then
20908 fflush(NULL) seems to behave okay with input streams.
20910 fflushNULL="$define"
20913 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
20915 fflushNULL="$undef"
20918 $rm -f core tryp.c tryp.core core.tryp.*
20921 Your fflush(NULL) isn't working (contrary to ANSI C).
20923 fflushNULL="$undef"
20926 Cannot figure out whether your fflush(NULL) works or not.
20927 I'm assuming it doesn't (contrary to ANSI C).
20929 fflushNULL="$undef"
20933 $define|true|[yY]*)
20934 fflushNULL="$define"
20937 fflushNULL="$undef"
20940 : check explicit looping only if NULL did not work, and if the pipe
20941 : bug does not show up on an explicit flush too
20942 case "$fflushNULL" in
20944 $cat >tryp.c <<EOCP
20947 main(int argc, char **argv)
20953 while ((i = getc(stdin)) != -1
20954 && (*bp++ = i) != '\n'
20955 && bp < &buf[1024])
20958 fprintf(stdout, "%s", buf);
20967 if eval $compile; then
20969 if $test "X$targethost" != X; then
20972 $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
20974 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
20976 if cmp tryp.c tryp.out >/dev/null 2>&1; then
20978 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
20980 : now check for fflushall behaviour
20981 case "$fflushall" in
20982 '') set try -DTRY_FFLUSH_ALL $output
20983 if eval $compile; then
20985 (Now testing the other method--but note that this also may fail.)
20987 $run ./try 2>/dev/null
20990 if $test -s try.out -a "X$code" = X42; then
20991 fflushall="`$cat try.out`"
20995 case "$fflushall" in
20997 Whew. Flushing explicitly all the stdio streams works.
20999 fflushall="$define"
21002 Sigh. Flushing explicitly all the stdio streams doesn't work.
21007 Cannot figure out whether flushing stdio streams explicitly works or not.
21008 I'm assuming it doesn't.
21014 "$define"|true|[yY]*)
21015 fflushall="$define"
21023 All is futile. Even fflush(stdin) clobbers input pipes!
21030 $rm -f core tryp.c tryp.core core.tryp.*
21032 *) fflushall="$undef"
21036 case "$fflushNULL$fflushall" in
21039 OK, I give up. I cannot figure out how to flush pending stdio output.
21040 We won't be flushing handles at all before fork/exec/popen.
21046 : Store the full pathname to the ar program for use in the C program
21047 : Respect a hint or command line value for full_ar.
21052 : Store the full pathname to the sed program for use in the C program
21055 : see what type gids are declared as in the kernel
21057 echo "Looking for the type for group ids returned by getgid()."
21058 set gid_t gidtype xxx stdio.h sys/types.h
21062 xxx=`./findhdr sys/user.h`
21063 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
21065 unsigned) dflt="$1 $2" ;;
21069 *) dflt="$gidtype";;
21072 gid_t) echo "gid_t found." ;;
21073 *) rp="What is the type for group ids returned by getgid()?"
21079 : Check the size of GID
21082 *_t) zzz="$gidtype" ;;
21085 echo "Checking the size of $zzz..." >&4
21087 #include <sys/types.h>
21089 #$i_stdlib I_STDLIB
21091 #include <stdlib.h>
21094 printf("%d\n", (int)sizeof($gidtype));
21099 if eval $compile_ok; then
21103 echo "(I can't execute the test program--guessing $gidsize.)" >&4
21106 echo "Your $zzz is $gidsize bytes long."
21111 echo "(I can't compile the test program--guessing $gidsize.)" >&4
21115 : Check if GID is signed
21118 *_t) zzz="$gidtype" ;;
21121 echo "Checking the sign of $zzz..." >&4
21123 #include <sys/types.h>
21134 if eval $compile; then
21138 echo "(I can't execute the test program--guessing unsigned.)" >&4
21142 1) echo "Your $zzz is unsigned." ;;
21143 -1) echo "Your $zzz is signed." ;;
21149 echo "(I can't compile the test program--guessing unsigned.)" >&4
21153 : Check 64bit sizes
21156 if $test X"$quadtype" != X; then
21158 echo "Checking how to print 64-bit integers..." >&4
21160 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
21161 $cat >try.c <<'EOCP'
21162 #include <sys/types.h>
21165 int q = 12345678901;
21166 printf("%ld\n", q);
21170 if eval $compile; then
21174 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
21175 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
21176 echo "We will use %d."
21182 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
21183 $cat >try.c <<'EOCP'
21184 #include <sys/types.h>
21187 long q = 12345678901;
21188 printf("%ld\n", q);
21192 if eval $compile; then
21196 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
21197 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
21198 echo "We will use %ld."
21204 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
21205 $cat >try.c <<'EOCP'
21206 #include <sys/types.h>
21207 #include <inttypes.h>
21210 int64_t q = 12345678901;
21211 printf("%" PRId64 "\n", q);
21215 if eval $compile; then
21219 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
21220 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
21221 echo "We will use the C9X style."
21227 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
21229 #include <sys/types.h>
21232 $quadtype q = 12345678901;
21233 printf("%Ld\n", q);
21237 if eval $compile; then
21241 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
21242 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
21243 echo "We will use %Ld."
21249 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
21250 $cat >try.c <<'EOCP'
21251 #include <sys/types.h>
21254 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
21255 printf("%lld\n", q);
21259 if eval $compile; then
21263 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
21264 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
21265 echo "We will use the %lld style."
21271 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
21273 #include <sys/types.h>
21276 $quadtype q = 12345678901;
21277 printf("%qd\n", q);
21281 if eval $compile; then
21285 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
21286 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
21287 echo "We will use %qd."
21293 if $test X"$sPRId64" = X; then
21294 echo "Cannot figure out how to print 64-bit integers." >&4
21301 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
21302 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
21304 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
21305 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
21309 : Check format strings for internal types
21311 $echo "Checking the format strings to be used for Perl's internal types..." >&4
21313 if $test X"$ivsize" = X8; then
21314 ivdformat="$sPRId64"
21315 uvuformat="$sPRIu64"
21316 uvoformat="$sPRIo64"
21317 uvxformat="$sPRIx64"
21318 uvXUformat="$sPRIXU64"
21320 if $test X"$ivsize" = X"$longsize"; then
21327 if $test X"$ivsize" = X"$intsize"; then
21335 if $test X"$ivsize" = X"$shortsize"; then
21346 if $test X"$usequadmath" = X"$define"; then
21354 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
21355 nveformat="$sPRIeldbl"
21356 nvfformat="$sPRIfldbl"
21357 nvgformat="$sPRIgldbl"
21358 nvEUformat="$sPRIEUldbl"
21359 nvFUformat="$sPRIFUldbl"
21360 nvGUformat="$sPRIGUldbl"
21371 case "$ivdformat" in
21372 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
21377 : Check format string for GID
21380 $echo "Checking the format string to be used for gids..." >&4
21383 -1) if $test X"$gidsize" = X"$ivsize"; then
21384 gidformat="$ivdformat"
21386 if $test X"$gidsize" = X"$longsize"; then
21389 if $test X"$gidsize" = X"$intsize"; then
21392 if $test X"$gidsize" = X"$shortsize"; then
21399 *) if $test X"$gidsize" = X"$uvsize"; then
21400 gidformat="$uvuformat"
21402 if $test X"$gidsize" = X"$longsize"; then
21405 if $test X"$gidsize" = X"$intsize"; then
21408 if $test X"$gidsize" = X"$shortsize"; then
21417 : see if getgroups exists
21418 set getgroups d_getgrps
21421 : see if setgroups exists
21422 set setgroups d_setgrps
21425 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
21427 case "$d_getgrps$d_setgrps" in
21429 case "$groupstype" in
21430 '') dflt="$gidtype" ;;
21431 *) dflt="$groupstype" ;;
21434 What type of pointer is the second argument to getgroups() and setgroups()?
21435 Usually this is the same as group ids, $gidtype, but not always.
21438 rp='What type pointer is the second argument to getgroups() and setgroups()?'
21442 *) groupstype="$gidtype";;
21445 : check whether make sets MAKE
21447 echo "Checking if your $make program sets \$(MAKE)..." >&4
21448 case "$make_set_make" in
21450 $sed 's/^X //' > testmake.mak << 'EOF'
21452 X @echo 'maketemp="$(MAKE)"'
21454 case "`$make -f testmake.mak 2>/dev/null`" in
21455 *maketemp=*) make_set_make='#' ;;
21456 *) make_set_make="MAKE=$make" ;;
21458 $rm -f testmake.mak
21461 case "$make_set_make" in
21462 '#') echo "Yup, it does.";;
21463 *) echo "Nope, it doesn't.";;
21466 : see what type is used for mode_t
21467 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
21468 set mode_t modetype int stdio.h sys/types.h
21471 : see if we need va_copy
21473 case "$i_stdarg" in
21476 #include <stdarg.h>
21478 #$i_stdlib I_STDLIB
21480 #include <stdlib.h>
21482 #include <signal.h>
21485 ivfprintf(FILE *f, const char *fmt, va_list *valp)
21487 return vfprintf(f, fmt, *valp);
21491 myvfprintf(FILE *f, const char *fmt, va_list val)
21493 return ivfprintf(f, fmt, &val);
21497 myprintf(char *fmt, ...)
21500 va_start(val, fmt);
21501 return myvfprintf(stdout, fmt, val);
21505 main(int ac, char **av)
21507 signal(SIGSEGV, exit);
21509 myprintf("%s%cs all right, then\n", "that", '\'');
21514 if eval $compile && $run ./try 2>&1 >/dev/null; then
21515 case "`$run ./try`" in
21516 "that's all right, then")
21522 yes) echo "It seems that you don't need va_copy()." >&4
21523 need_va_copy="$undef"
21525 *) echo "It seems that va_copy() or similar will be needed." >&4
21526 need_va_copy="$define"
21531 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
21532 need_va_copy="$undef"
21536 : see what type is used for size_t
21537 rp="What is the type used for the length parameter for string functions?"
21538 set size_t sizetype 'unsigned int' stdio.h sys/types.h
21541 : check for type of arguments to gethostbyaddr.
21542 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
21543 case "$d_gethbyaddr" in
21547 Checking to see what type of arguments are accepted by gethostbyaddr().
21549 hdrs="$define sys/types.h
21550 $d_socket sys/socket.h
21551 $i_niin netinet/in.h
21553 $i_unistd unistd.h"
21554 : The first arg can 'char *' or 'void *'
21555 : The second arg is some of integral type
21556 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
21557 for yyy in size_t long int; do
21558 case "$netdb_host_type" in
21559 '') try="$extern_C struct hostent *gethostbyaddr($xxx, $yyy, int);"
21560 if ./protochk "$try" $hdrs; then
21561 echo "Your system accepts $xxx for the first arg."
21562 echo "...and $yyy for the second arg."
21563 netdb_host_type="$xxx"
21564 netdb_hlen_type="$yyy"
21570 : In case none of those worked, prompt the user.
21571 case "$netdb_host_type" in
21572 '') rp='What is the type for the 1st argument to gethostbyaddr?'
21575 netdb_host_type=$ans
21576 rp='What is the type for the 2nd argument to gethostbyaddr?'
21579 netdb_hlen_type=$ans
21583 *) : no gethostbyaddr, so pick harmless defaults
21584 netdb_host_type='char *'
21585 netdb_hlen_type="$sizetype"
21588 # Remove the "const" if needed. -- but then we'll have a
21590 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
21593 : check for type of argument to gethostbyname.
21594 if test "X$netdb_name_type" = X ; then
21595 case "$d_gethbyname" in
21599 Checking to see what type of argument is accepted by gethostbyname().
21601 hdrs="$define sys/types.h
21602 $d_socket sys/socket.h
21603 $i_niin netinet/in.h
21605 $i_unistd unistd.h"
21606 for xxx in "const char *" "char *"; do
21607 case "$netdb_name_type" in
21608 '') try="$extern_C struct hostent *gethostbyname($xxx);"
21609 if ./protochk "$try" $hdrs; then
21610 echo "Your system accepts $xxx."
21611 netdb_name_type="$xxx"
21616 : In case none of those worked, prompt the user.
21617 case "$netdb_name_type" in
21618 '') rp='What is the type for the 1st argument to gethostbyname?'
21621 netdb_name_type=$ans
21625 *) : no gethostbyname, so pick harmless default
21626 netdb_name_type='char *'
21631 : check for type of 1st argument to getnetbyaddr.
21632 if test "X$netdb_net_type" = X ; then
21633 case "$d_getnbyaddr" in
21637 Checking to see what type of 1st argument is accepted by getnetbyaddr().
21639 hdrs="$define sys/types.h
21640 $d_socket sys/socket.h
21641 $i_niin netinet/in.h
21643 $i_unistd unistd.h"
21644 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
21645 case "$netdb_net_type" in
21646 '') try="$extern_C struct netent *getnetbyaddr($xxx, int);"
21647 if ./protochk "$try" $hdrs; then
21648 echo "Your system accepts $xxx."
21649 netdb_net_type="$xxx"
21654 : In case none of those worked, prompt the user.
21655 case "$netdb_net_type" in
21656 '') rp='What is the type for the 1st argument to getnetbyaddr?'
21659 netdb_net_type=$ans
21663 *) : no getnetbyaddr, so pick harmless default
21664 netdb_net_type='long'
21668 : locate the preferred pager for this system
21675 [a-zA-Z]:/*) dflt=$pg;;
21679 [a-zA-Z]:/*) dflt=$more;;
21683 [a-zA-Z]:/*) dflt=$less;;
21686 '') dflt=/usr/ucb/more;;
21694 rp='What pager is used on your system?'
21698 : see what type pids are declared as in the kernel
21699 rp="What is the type of process ids on this system?"
21700 set pid_t pidtype int stdio.h sys/types.h
21703 : see if ar generates random libraries by itself
21705 echo "Checking how to generate random libraries on your machine..." >&4
21706 echo 'int bar1() { return bar2(); }' > bar1.c
21707 echo 'int bar2() { return 2; }' > bar2.c
21709 #$i_stdlib I_STDLIB
21711 #include <stdlib.h>
21713 int main() { printf("%d\n", bar1()); exit(0); }
21715 $cc $ccflags -c bar1.c >/dev/null 2>&1
21716 $cc $ccflags -c bar2.c >/dev/null 2>&1
21717 $cc $ccflags -c foo.c >/dev/null 2>&1
21718 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
21719 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
21720 $run ./foobar >/dev/null 2>&1; then
21721 echo "$ar appears to generate random libraries itself."
21723 if [ "X$ranlib" = "X" ]; then
21726 elif $ar s bar$_a >/dev/null 2>&1 &&
21727 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
21728 $run ./foobar >/dev/null 2>&1; then
21729 echo "a table of contents needs to be added with '$ar s'."
21732 elif $ar ts bar$_a >/dev/null 2>&1 &&
21733 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
21734 $run ./foobar >/dev/null 2>&1; then
21735 echo "a table of contents needs to be added with '$ar ts'."
21742 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
21743 $test -f $ranlib || ranlib=''
21746 if $test -n "$ranlib"; then
21747 echo "your system has '$ranlib'; we'll use that."
21750 echo "your system doesn't seem to support random libraries"
21751 echo "so we'll use lorder and tsort to order the libraries."
21758 : see if this is a values.h system
21759 set values.h i_values
21762 : Check the max offset that gmtime and localtime accept
21763 echo "Checking max offsets that gmtime () accepts"
21766 define) yyy="#include <values.h>" ;;
21770 case "$sGMTIME_min/$sGMTIME_max" in
21773 #include <sys/types.h>
21782 void gm_check (time_t t, int min_year, int max_year)
21785 if ( tmp == NULL ||
21786 /* Check tm_year overflow */
21787 tmp->tm_year < min_year || tmp->tm_year > max_year)
21798 gm_check (MAXLONG, 69, 0x7fffffff);
21800 if (tmp == NULL || tmp->tm_year < 0) {
21801 for (i = 63; i >= 0; i--) {
21802 time_t x = pt | ((time_t)1 << i);
21803 if (x < 0 || x < pt) continue;
21804 gm_check (x, 69, 0x7fffffff);
21807 printf ("sGMTIME_max=%ld\n", pt);
21816 gm_check (MINLONG, -1900, 70);
21819 for (i = 36; i >= 0; i--) {
21820 time_t x = pt - ((time_t)1 << i);
21821 if (x > 0) continue;
21822 gm_check (x, -1900, 70);
21825 printf ("sGMTIME_min=%ld\n", pt);
21829 int main (int argc, char *argv[])
21831 /* fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t)); */
21838 if eval $compile; then
21839 eval `$run ./try 2>/dev/null`
21841 echo "Cannot determine sGMTIME_max and sGMTIME_min." >&4
21847 echo "Checking max offsets that localtime () accepts"
21849 case "$sLOCALTIME_min/$sLOCALTIME_max" in
21852 #include <sys/types.h>
21861 void local_check (time_t t, int min_year, int max_year)
21863 if (sizeof (time_t) > 4 && t > 0x7ffffffffffff000LL)
21866 tmp = localtime (&t);
21867 if ( tmp == NULL ||
21868 /* Check tm_year overflow */
21869 tmp->tm_year < min_year || tmp->tm_year > max_year)
21873 } /* local_check */
21880 local_check (MAXLONG, 69, 0x7fffffff);
21882 if (tmp == NULL || tmp->tm_year < 0) {
21883 for (i = 63; i >= 0; i--) {
21884 time_t x = pt | ((time_t)1 << i);
21885 if (x < 0 || x < pt) continue;
21886 local_check (x, 69, 0x7fffffff);
21889 printf ("sLOCALTIME_max=%ld\n", pt);
21898 local_check (MINLONG, -1900, 70);
21901 for (i = 36; i >= 0; i--) {
21902 time_t x = pt - ((time_t)1 << i);
21903 if (x > 0) continue;
21904 local_check (x, -1900, 70);
21907 printf ("sLOCALTIME_min=%ld\n", pt);
21911 int main (int argc, char *argv[])
21919 if eval $compile; then
21920 eval `$run ./try 2>/dev/null`
21922 echo "Cannot determine sLOCALTIME_max and sLOCALTIME_min." >&4
21928 : check for type of arguments to select.
21929 case "$selecttype" in
21930 '') case "$d_select" in
21934 Checking to see what type of arguments are accepted by select().
21936 hdrs="$define sys/types.h
21937 $i_systime sys/time.h
21938 $i_sysselct sys/select.h
21939 $d_socket sys/socket.h"
21940 : The first arg can be int, unsigned, or size_t
21941 : The last arg may or may not be 'const'
21943 : void pointer has been seen but using that
21944 : breaks the selectminbits test
21945 for xxx in 'fd_set *' 'int *'; do
21946 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
21947 for tmo in 'struct timeval *' 'const struct timeval *'; do
21949 '') try="$extern_C select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
21950 if ./protochk "$try" $hdrs; then
21951 echo "Your system accepts $xxx."
21960 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
21961 case "$d_fd_set" in
21962 $define) dflt="fd_set *" ;;
21971 *) : no select, so pick a harmless default
21978 : check for the select 'width'
21979 case "$selectminbits" in
21980 '') safebits=`expr $ptrsize \* 8`
21981 case "$d_select" in
21985 Checking to see on how many bits at a time your select() operates...
21988 #include <sys/types.h>
21990 #$i_systime I_SYS_TIME
21991 #$i_systimek I_SYS_TIME_KERNEL
21996 # ifdef I_SYS_TIME_KERNEL
21999 # include <sys/time.h>
22000 # ifdef I_SYS_TIME_KERNEL
22004 #$i_sysselct I_SYS_SELECT
22005 #ifdef I_SYS_SELECT
22006 #include <sys/select.h>
22008 #$d_socket HAS_SOCKET
22010 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
22013 #$i_stdlib I_STDLIB
22015 #include <stdlib.h>
22018 #define S sizeof(*(b))
22020 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
22021 #define NBITS (NBYTES * 8)
22023 char *s = (char *)malloc(NBYTES);
22032 fp = fopen("try.c", "r");
22038 b = ($selecttype)s;
22039 for (i = 0; i < NBITS; i++)
22043 select(fd + 1, b, 0, 0, &t);
22044 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
22046 printf("%d\n", i + 1);
22051 if eval $compile_ok; then
22052 selectminbits=`$run ./try 2>/dev/null`
22053 case "$selectminbits" in
22055 Cannot figure out on how many bits at a time your select() operates.
22056 I'll play safe and guess it is $safebits bits.
22058 selectminbits=$safebits
22059 bits="$safebits bits"
22062 *) bits="$selectminbits bits" ;;
22064 echo "Your select() operates on $bits at a time." >&4
22066 rp='What is the minimum number of bits your select() operates on?'
22067 case "$byteorder" in
22068 12345678) dflt=64 ;;
22074 selectminbits="$val"
22078 *) : no select, so pick a harmless default
22079 selectminbits=$safebits
22085 : Trace out the files included by signal.h, then look for SIGxxx names.
22086 case "$sig_num_init" in
22088 if [ "X$fieldn" = X ]; then
22089 : Just make some guesses. We check them later.
22090 xxx="$sysroot/usr/include/signal.h $sysroot/usr/include/sys/signal.h"
22092 xxx=`echo '#include <signal.h>' |
22093 $cppstdin $cppminus $cppflags 2>/dev/null |
22094 $grep '^[ ]*#.*include' |
22095 $awk "{print \\$$fieldn}" | $sed 's!"!!g' |\
22096 $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
22099 for xx in $xxx /dev/null ; do
22100 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
22102 case "$xxxfiles" in
22103 '') xxxfiles=`./findhdr signal.h` ;;
22106 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
22107 print substr($2, 4, 20)
22109 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
22110 print substr($3, 4, 20)
22112 : Append some common names just in case the awk scan failed.
22113 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
22114 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
22115 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
22116 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
22117 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
22119 : generate a few handy files for later
22120 $cat > signal.c <<EOCP
22121 #include <sys/types.h>
22122 #include <signal.h>
22123 #$i_stdlib I_STDLIB
22125 #include <stdlib.h>
22130 /* Strange style to avoid deeply-nested #if/#else/#endif */
22133 # define NSIG (_NSIG)
22139 # define NSIG (SIGMAX+1)
22145 # define NSIG (SIG_MAX+1)
22151 # define NSIG (_SIG_MAX+1)
22157 # define NSIG (MAXSIG+1)
22163 # define NSIG (MAX_SIG+1)
22168 # ifdef SIGARRAYSIZE
22169 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
22175 # define NSIG (_sys_nsig) /* Solaris 2.5 */
22179 /* Default to some arbitrary number that's big enough to get most
22180 of the common signals.
22186 printf("NSIG %d\n", NSIG);
22192 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
22194 printf "#ifdef SIG"; printf $1; printf "\n"
22195 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
22196 printf $1; printf ");\n"
22200 printf "#endif /* JUST_NSIG */\n";
22201 printf "exit(0);\n}\n";
22204 $cat >signal.awk <<'EOP'
22205 BEGIN { ndups = 0 }
22206 $1 ~ /^NSIG$/ { nsig = $2 }
22207 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
22208 if ($2 > maxsig) { maxsig = $2 }
22209 if (sig_name[$2]) {
22210 dup_name[ndups] = $1
22211 dup_num[ndups] = $2
22223 printf("NSIG %d\n", nsig);
22224 for (n = 1; n < nsig; n++) {
22226 printf("%s %d\n", sig_name[n], sig_num[n])
22229 printf("NUM%d %d\n", n, n)
22232 for (n = 0; n < ndups; n++) {
22233 printf("%s %d\n", dup_name[n], dup_num[n])
22237 $cat >signal_cmd <<EOS
22239 if $test -s signal.lst; then
22240 echo "Using your existing signal.lst file"
22245 $cat >>signal_cmd <<'EOS'
22248 if eval $compile_ok; then
22249 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) |\
22250 $uniq | $awk -f signal.awk >signal.lst
22252 echo "(I can't seem be able to compile the whole test program)" >&4
22253 echo "(I'll try it in little pieces.)" >&4
22254 set signal -DJUST_NSIG
22255 if eval $compile_ok; then
22256 $run ./signal$_exe > signal.nsg
22259 echo "I can't seem to figure out how many signals you have." >&4
22260 echo "Guessing 50." >&4
22261 echo 'NSIG 50' > signal.nsg
22263 : Now look at all the signal names, one at a time.
22264 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
22265 $cat > signal.c <<EOCP
22266 #include <sys/types.h>
22267 #include <signal.h>
22270 printf("$xx %d\n", SIG${xx});
22275 if eval $compile; then
22276 echo "SIG${xx} found."
22277 $run ./signal$_exe >> signal.ls1
22279 echo "SIG${xx} NOT found."
22282 if $test -s signal.ls1; then
22283 $cat signal.nsg signal.ls1 |
22284 $sort -n | $uniq | $awk -f signal.awk >signal.lst
22288 if $test -s signal.lst; then
22291 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
22292 echo 'kill -l' >signal
22293 set X `csh -f <signal`
22297 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
22299 echo $@ | $tr ' ' $trnl | \
22300 $awk '{ printf "%s %d\n", $1, ++s; }
22301 END { printf "NSIG %d\n", ++s }' >signal.lst
22303 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
22305 chmod a+x signal_cmd
22306 $eunicefix signal_cmd
22308 : generate list of signal names
22310 case "$sig_name_init" in
22312 *) case "$sig_num_init" in
22313 ''|*,*) doinit=yes ;;
22318 echo "Generating a list of signal names and numbers..." >&4
22320 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
22321 sig_name=`$awk 'BEGIN { printf "ZERO " }
22322 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
22323 sig_num=`$awk 'BEGIN { printf "0 " }
22324 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
22325 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
22326 !/^NSIG/ { printf "\"%s\", ", $1 }
22327 END { printf "0\n" }' signal.lst`
22328 sig_num_init=`$awk 'BEGIN { printf "0, " }
22329 !/^NSIG/ { printf "%d, ", $2}
22330 END { printf "0\n"}' signal.lst`
22333 echo "The following $sig_count signals are available:"
22335 echo $sig_name | $awk \
22336 'BEGIN { linelen = 0 }
22338 for (i = 1; i <= NF; i++) {
22339 name = "SIG" $i " "
22340 linelen = linelen + length(name)
22341 if (linelen > 70) {
22343 linelen = length(name)
22349 sig_size=`echo $sig_name | awk '{print NF}'`
22350 $rm -f signal signal.c signal.awk signal.lst signal_cmd
22354 : Check size of size
22356 case "$sizetype" in
22357 *_t) zzz="$sizetype" ;;
22358 *) zzz="filesize" ;;
22360 echo "Checking the size of $zzz..." >&4
22362 #include <sys/types.h>
22364 #$i_stdlib I_STDLIB
22366 #include <stdlib.h>
22369 printf("%d\n", (int)sizeof($sizetype));
22374 if eval $compile_ok; then
22378 echo "(I can't execute the test program--guessing $sizesize.)" >&4
22381 echo "Your $zzz size is $sizesize bytes."
22386 echo "(I can't compile the test program--guessing $sizesize.)" >&4
22390 : check for socklen_t
22392 echo "Checking to see if you have socklen_t..." >&4
22394 #include <sys/types.h>
22395 #$d_socket HAS_SOCKET
22397 #include <sys/socket.h>
22399 int main() { socklen_t x = 16; }
22402 if eval $compile; then
22404 echo "You have socklen_t."
22407 echo "You do not have socklen_t."
22408 case "$sizetype" in
22409 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
22416 : see if this is a socks.h system
22417 set socks.h i_socks
22420 : check for type of the size argument to socket calls
22421 case "$d_socket" in
22425 Checking to see what type is the last argument of accept().
22428 case "$d_socklen_t" in
22429 "$define") yyy="$yyy socklen_t"
22431 yyy="$yyy $sizetype int long unsigned"
22432 for xxx in $yyy; do
22433 case "$socksizetype" in
22434 '') try="$extern_C int accept(int, struct sockaddr *, $xxx *);"
22435 case "$usesocks" in
22437 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
22438 echo "Your system accepts '$xxx *' for the last argument of accept()."
22439 socksizetype="$xxx"
22442 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
22443 echo "Your system accepts '$xxx *' for the last argument of accept()."
22444 socksizetype="$xxx"
22451 : In case none of those worked, prompt the user.
22452 case "$socksizetype" in
22453 '') rp='What is the type for socket address structure sizes?'
22460 *) : no sockets, so pick relatively harmless default
22465 : see what type is used for signed size_t
22466 set ssize_t ssizetype int stdio.h sys/types.h
22471 #$i_stdlib I_STDLIB
22473 #include <stdlib.h>
22475 #include <sys/types.h>
22476 #define Size_t $sizetype
22477 #define SSize_t $dflt
22480 if (sizeof(Size_t) == sizeof(SSize_t))
22482 else if (sizeof(Size_t) == sizeof(int))
22491 if eval $compile_ok && $run ./try > /dev/null; then
22492 ssizetype=`$run ./try`
22493 echo "I'll be using $ssizetype for functions returning a byte count." >&4
22496 Help! I can't compile and run the ssize_t test program: please enlighten me!
22497 (This is probably a misconfiguration in your system or libraries, and
22498 you really ought to fix it. Still, I'll try anyway.)
22500 I need a type that is the same size as $sizetype, but is guaranteed to
22501 be signed. Common values are ssize_t, int and long.
22504 rp="What signed type is the same size as $sizetype?"
22510 : Check the size of st_ino
22512 $echo "Checking the size of st_ino..." >&4
22513 $cat > try.c <<EOCP
22514 #include <sys/stat.h>
22516 #$i_stdlib I_STDLIB
22518 #include <stdlib.h>
22522 printf("%d\n", (int)sizeof(st.st_ino));
22527 if eval $compile_ok; then
22531 $echo "(I can't execute the test program--guessing $st_ino_size.)" >&4
22533 *) st_ino_size=$val
22534 $echo "Your st_ino is $st_ino_size bytes long."
22539 $echo "(I can't compile the test program--guessing $st_ino_size.)" >&4
22543 : Check if st_ino is signed
22545 $echo "Checking the sign of st_ino..." >&4
22546 $cat > try.c <<EOCP
22547 #include <sys/stat.h>
22552 if (foo.st_ino < 0)
22559 if eval $compile; then
22563 $echo "(I can't execute the test program--guessing unsigned.)" >&4
22565 *) st_ino_sign=$val
22566 case "$st_ino_sign" in
22567 1) $echo "Your st_ino is unsigned." ;;
22568 -1) $echo "Your st_ino is signed." ;;
22574 $echo "(I can't compile the test program--guessing unsigned.)" >&4
22578 : see what type of char stdio uses.
22580 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
22581 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
22582 echo "Your stdio uses unsigned chars." >&4
22583 stdchar="unsigned char"
22585 echo "Your stdio uses signed chars." >&4
22590 : see what type uids are declared as in the kernel
22592 echo "Looking for the type for user ids returned by getuid()."
22593 set uid_t uidtype xxx stdio.h sys/types.h
22597 xxx=`./findhdr sys/user.h`
22598 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
22600 unsigned) dflt="$1 $2" ;;
22604 *) dflt="$uidtype";;
22607 uid_t) echo "uid_t found." ;;
22608 *) rp="What is the type for user ids returned by getuid()?"
22614 : Check size of UID
22617 *_t) zzz="$uidtype" ;;
22620 echo "Checking the size of $zzz..." >&4
22622 #include <sys/types.h>
22624 #$i_stdlib I_STDLIB
22626 #include <stdlib.h>
22629 printf("%d\n", (int)sizeof($uidtype));
22634 if eval $compile_ok; then
22638 echo "(I can't execute the test program--guessing $uidsize.)" >&4
22641 echo "Your $zzz is $uidsize bytes long."
22646 echo "(I can't compile the test program--guessing $uidsize.)" >&4
22649 : Check if UID is signed
22652 *_t) zzz="$uidtype" ;;
22655 echo "Checking the sign of $zzz..." >&4
22657 #include <sys/types.h>
22668 if eval $compile; then
22672 echo "(I can't execute the test program--guessing unsigned.)" >&4
22676 1) echo "Your $zzz is unsigned." ;;
22677 -1) echo "Your $zzz is signed." ;;
22683 echo "(I can't compile the test program--guessing unsigned.)" >&4
22687 : Check format string for UID
22689 $echo "Checking the format string to be used for uids..." >&4
22692 -1) if $test X"$uidsize" = X"$ivsize"; then
22693 uidformat="$ivdformat"
22695 if $test X"$uidsize" = X"$longsize"; then
22698 if $test X"$uidsize" = X"$intsize"; then
22701 if $test X"$uidsize" = X"$shortsize"; then
22708 *) if $test X"$uidsize" = X"$uvsize"; then
22709 uidformat="$uvuformat"
22711 if $test X"$uidsize" = X"$longsize"; then
22714 if $test X"$uidsize" = X"$intsize"; then
22717 if $test X"$uidsize" = X"$shortsize"; then
22726 : see what siginfo fields we have
22727 case "$d_sigaction" in
22729 echo "Checking if your siginfo_t has si_errno field...">&4
22730 set d_siginfo_si_errno siginfo_t int si_errno $d_sigaction signal.h
22733 echo "Checking if your siginfo_t has si_pid field...">&4
22734 set d_siginfo_si_pid siginfo_t $pidtype si_pid $d_sigaction signal.h
22737 echo "Checking if your siginfo_t has si_uid field...">&4
22738 set d_siginfo_si_uid siginfo_t $uidtype si_uid $d_sigaction signal.h
22741 echo "Checking if your siginfo_t has si_addr field...">&4
22742 set d_siginfo_si_addr siginfo_t "void *" si_addr $d_sigaction signal.h
22745 echo "Checking if your siginfo_t has si_status field...">&4
22746 set d_siginfo_si_status siginfo_t int si_status $d_sigaction signal.h
22749 echo "Checking if your siginfo_t has si_band field...">&4
22750 set d_siginfo_si_band siginfo_t long si_band $d_sigaction signal.h
22753 echo "Checking if your siginfo_t has si_value field...">&4
22754 set d_siginfo_si_value siginfo_t "union sigval" si_value $d_sigaction signal.h
22760 : Determine if we can use sysctl with KERN_PROC_PATHNAME to find executing program
22762 echo "Determining whether we can use sysctl with KERN_PROC_PATHNAME to find executing program..." >&4
22763 $cat >try.c <<'EOM'
22764 /* Intentionally a long probe as I'd like to sanity check that the exact
22765 approach is going to work, as thinking it will work, but only having it
22766 part working at runtime is worse than not having it. */
22768 #include <sys/types.h>
22769 #include <sys/sysctl.h>
22770 #include <sys/param.h>
22772 #include <string.h>
22773 #include <stdlib.h>
22774 #include <unistd.h>
22777 main(int argc, char **argv) {
22779 char *argv_leaf = strrchr(argv[0], '/');
22785 mib[1] = KERN_PROC;
22786 mib[2] = KERN_PROC_PATHNAME;
22790 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
22794 if (sysctl(mib, 4, NULL, &size, NULL, 0)) {
22799 if (size < strlen(argv_leaf) + 1) {
22800 fprintf(stderr, "size %lu is too short for a path\n",
22801 (unsigned long) size);
22805 if (size > MAXPATHLEN * MAXPATHLEN) {
22806 fprintf(stderr, "size %lu is too long for a path\n",
22807 (unsigned long) size);
22811 buffer = malloc(size);
22817 if (sysctl(mib, 4, buffer, &size, NULL, 0)) {
22822 if (strlen(buffer) + 1 != size) {
22823 fprintf(stderr, "size != strlen(buffer) + 1 (%lu != %lu)\n",
22824 (unsigned long)size, (unsigned long)strlen(buffer) + 1);
22829 if (*buffer != '/') {
22830 fprintf(stderr, "Not an absolute path: '%s'\n", buffer);
22834 if (strstr(buffer, "/./")) {
22835 fprintf(stderr, "Contains /./: '%s'\n", buffer);
22839 if (strstr(buffer, "/../")) {
22840 fprintf(stderr, "Contains /../: '%s'\n", buffer);
22844 buffer_leaf = strrchr(buffer, '/');
22845 if (strcmp(buffer_leaf, argv_leaf) != 0) {
22846 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], buffer);
22858 if eval $compile; then
22859 if $run ./try; then
22860 echo "You can use sysctl with KERN_PROC_PATHNAME to find the executing program." >&4
22863 echo "Nope, sysctl with KERN_PROC_PATHNAME doesn't work here." >&4
22867 echo "I'm unable to compile the test program." >&4
22868 echo "I'll assume no sysctl with KERN_PROC_PATHNAME here." >&4
22872 set usekernprocpathname
22875 : Determine if we can use _NSGetExecutablePath to find executing program
22877 echo "Determining whether we can use _NSGetExecutablePath to find executing program..." >&4
22878 $cat >try.c <<'EOM'
22879 /* Intentionally a long probe as I'd like to sanity check that the exact
22880 approach is going to work, as thinking it will work, but only having it
22881 part working at runtime is worse than not having it. */
22882 #include <mach-o/dyld.h>
22884 #include <stdlib.h>
22885 #include <sys/param.h>
22886 #include <string.h>
22889 main(int argc, char **argv) {
22891 uint32_t size = sizeof(buf);
22895 char *argv_leaf = strrchr(argv[0], '/');
22899 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
22903 _NSGetExecutablePath(buf, &size);
22904 if (size > MAXPATHLEN * MAXPATHLEN) {
22905 fprintf(stderr, "_NSGetExecutablePath size %u is too long for a path\n",
22906 (unsigned int) size);
22910 buffer = malloc(size);
22916 result = _NSGetExecutablePath(buffer, &size);
22918 fprintf(stderr, "_NSGetExecutablePath returned %i for a size of %u\n",
22919 result, (unsigned int) size);
22923 tidied = realpath(buffer, NULL);
22925 perror("realpath");
22931 if (*tidied != '/') {
22932 fprintf(stderr, "Not an absolute path: '%s'\n", tidied);
22936 if (strstr(tidied, "/./")) {
22937 fprintf(stderr, "Contains /./: '%s'\n", tidied);
22941 if (strstr(tidied, "/../")) {
22942 fprintf(stderr, "Contains /../: '%s'\n", tidied);
22946 tidied_leaf = strrchr(tidied, '/');
22947 if (strcmp(tidied_leaf, argv_leaf) != 0) {
22948 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], tidied);
22960 if eval $compile; then
22961 if $run ./try; then
22962 echo "You can use _NSGetExecutablePath to find the executing program." >&4
22965 echo "Nope, _NSGetExecutablePath doesn't work here." >&4
22968 echo "I'm unable to compile the test program." >&4
22969 echo "I'll assume no _NSGetExecutablePath here." >&4
22972 set usensgetexecutablepath
22975 : Check if site customization support was requested
22976 case "$usesitecustomize" in
22977 $define|true|[Yy]*)
22978 usesitecustomize="$define"
22981 usesitecustomize="$undef"
22985 : see if prototypes support variable argument declarations
22987 case "$prototype$i_stdarg" in
22989 echo "It appears we'll be able to prototype varargs functions." >&4
22993 echo "Too bad... We won't be using prototyped varargs functions..." >&4
23000 : determine compiler compiler
23009 if $test -f "$byacc$_exe"; then
23011 comp="byacc or $comp"
23013 if $test -f "$bison$_exe"; then
23014 comp="$comp or bison -y"
23016 rp="Which compiler compiler ($comp) shall I use?"
23025 echo "(Adding -y option to bison to get yacc-compatible behavior.)"
23031 : see if this is a assert.h system
23032 set assert.h i_assert
23035 : see if this is a bfd.h system
23039 : see if this is an execinfo.h system
23040 set execinfo.h i_execinfo
23043 : see if this is a fenv.h system
23047 : see if this is a fp.h system
23051 : see if this is a fp_class.h system
23052 set fp_class.h i_fp_class
23055 : see if gdbm.h is available
23060 : see if gdbm_open exists
23061 set gdbm_open d_gdbm_open
23063 case "$d_gdbm_open" in
23066 echo "We won't be including <gdbm.h>"
23075 : see if this is a ieeefp.h system
23076 case "$i_ieeefp" in
23077 '' ) set ieeefp.h i_ieeefp
23082 : see if this is a libutil.h system
23083 set libutil.h i_libutil
23086 : see if mach cthreads are available
23087 if test "X$usethreads" = "X$define"; then
23088 set mach/cthreads.h i_machcthr
23091 i_machcthr="$undef"
23094 : see if this is a mntent.h system
23095 set mntent.h i_mntent
23098 : see if net/errno.h is available
23100 set net/errno.h val
23103 : Unfortunately, it causes problems on some systems. Arrgh.
23106 cat > try.c <<'EOM'
23109 #include <net/errno.h>
23115 if $cc $ccflags -c try.c >/dev/null 2>&1; then
23116 echo "We'll be including <net/errno.h>." >&4
23118 echo "We won't be including <net/errno.h>." >&4
23127 : see if netinet/tcp.h is available
23128 set netinet/tcp.h i_netinettcp
23131 : see if this is a poll.h system
23135 : see if this is a prot.h system
23139 : Preprocessor symbols
23141 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
23142 $cat <<'EOSH' > Cppsym.know
23143 a29k aarch64 ABI64 aegis AES_SOURCE AIX AIX32 AIX370 AIX41 AIX42
23144 AIX43 aixpc AIX_SOURCE alliant ALL_SOURCE alpha AM29000 am29000
23145 AMD64 amd64 amiga AMIGAOS AMIX ansi ANSI_C_SOURCE apollo arch_ppc
23146 arch_pwr ardent ARM ARM32 atarist att386 att3b
23147 BeOS BIG_ENDIAN BIT_MSF BSD bsd bsd43 bsd4_2 BSD4_3 bsd4_3 bsd4_4
23148 BSDCOMPAT bsdi BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES bull
23149 byteorder byte_order
23150 c cadmus clang clipper CMU COFF COMPILER_VERSION concurrent
23151 convex cpu CRAY cray CRAYMPP ctix CX_UX CYGWIN
23152 DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO Dynix DynixPTX
23153 ELF encore EPI EXTENSIONS
23154 FAVOR_BSD FILE_OFFSET_BITS FORTIFY_SOURCE FreeBSD
23155 GCC_NEW_VARARGS gcos gcx gimpel GLIBC GLIBC_MINOR GNUC GNUC_MINOR
23156 GNU_LIBRARY GNU_SOURCE GO32 gould GOULD_PN
23157 H3050R H3050RX hbullx20 hcx host_mips hp200 hp300 HP700 hp700
23158 hp800 hp9000 hp9000s200 hp9000s300 hp9000s400 hp9000s500
23159 hp9000s700 hp9000s800 hp9k8 hppa hpux HPUX_SOURCE hp_osf
23160 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960 IA32 IA64
23161 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
23162 INLINE_INTRINSICS INT64 INTEL interdata INTRINSICS is68k itanium
23164 LANGUAGE_C LARGEFILE64_SOURCE LARGEFILE_SOURCE LARGE_FILE_API
23165 LFS64_LARGEFILE LFS_LARGEFILE LIBCATAMOUNT Linux LITTLE_ENDIAN
23166 LONG64 LONGDOUBLE LONGLONG LONG_DOUBLE LONG_LONG LP64 luna
23168 M68000 m68k m88100 m88k M88KBCS_TARGET MACH machine MachTen
23169 MATH_HAS_NO_SIDE_EFFECTS mc300 mc500 mc68000 mc68010 mc68020
23170 mc68030 mc68040 mc68060 mc68k mc68k32 mc700 mc88000 mc88100
23171 merlin mert MiNT mips MIPSEB MIPSEL MIPS_FPSET MIPS_ISA MIPS_SIM
23172 MIPS_SZINT MIPS_SZLONG MIPS_SZPTR MODERN_C motorola mpeix MSDOS
23173 MTXINU MULTIMAX MVS mvs M_AMD64 M_ARM M_ARMT M_COFF M_I186 M_I286
23174 M_I386 M_I8086 M_I86 M_I86SM M_IA64 M_IX86 M_PPC M_SYS3 M_SYS5
23175 M_SYSIII M_SYSV M_UNIX M_X86 M_XENIX
23176 n16 ncl_el ncl_mr NetBSD news1500 news1700 news1800 news1900
23177 news3700 news700 news800 news900 NeXT NLS nonstopux ns16000
23178 ns32000 ns32016 ns32332 ns32k nsc32000
23179 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
23180 PARAGON parisc pa_risc PA_RISC1_1 PA_RISC2_0 pc532 pdp11 PGC PIC
23181 plexus PORTAR posix POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
23182 POSIX_C_SOURCE POSIX_SOURCE POWER powerpc ppc PROTOTYPES PWB pyr
23184 R3000 REENTRANT RES Rhapsody RISC6000 riscix riscos RT
23185 S390 S390x SA110 SCO scs sequent sgi SGI_SOURCE SH SH3 sinix
23186 SIZE_INT SIZE_LONG SIZE_PTR SOCKETS_SOURCE SOCKET_SOURCE sony
23187 sonyrisc sony_news sparc sparclite sparcv8 sparcv9 spectrum
23188 stardent stdc STDC_EXT stratos sun sun3 sun386 Sun386i svr3 svr4
23189 SVR4_2 SVR4_SOURCE svr5 SX system SYSTYPE_BSD SYSTYPE_BSD43
23190 SYSTYPE_BSD44 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3
23191 SYSV4 SYSV5 sysV68 sysV88
23192 Tek4132 Tek4300 thumb thw_370 thw_intel thw_rs6000 titan TM3200
23193 TM5400 TM5600 tower tower32 tower32_200 tower32_600 tower32_700
23194 tower32_800 tower32_850 tss
23195 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5 ultrix UMAXV UnicomPBB
23196 UnicomPBD UNICOS UNICOSMK unix UNIX95 UNIX99 unixpc unos USE_BSD
23197 USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE
23198 USE_LARGEFILE64 USE_MISC USE_POSIX USE_POSIX199309
23199 USE_POSIX199506 USE_POSIX2 USE_REENTRANT USE_SVID USE_UNIX98
23200 USE_XOPEN USE_XOPEN_EXTENDED USGr4 USGr4_2 UTek Utek UTS UWIN
23202 vax venix VMESA vms
23203 x86_64 xenix Xenix286 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2
23204 XPG2_EXTENDED XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
23207 # Maybe put other stuff here too.
23208 ./tr '-' '_' <<EOSH >>Cppsym.know
23211 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
23212 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
23213 $cat Cppsym.know > Cppsym.c
23214 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
23215 $rm -f Cppsym.a Cppsym.b Cppsym.c
23216 cat <<EOSH > Cppsym
23218 if $test \$# -gt 0; then
23219 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
23220 if $test -s Cppsym.got; then
23227 $tr " " "$trnl" | ./Cppsym.try
23233 cat <<EOSH > Cppsym.try
23235 cat <<'EOCP' > try.c
23238 #define STRINGIFY(a) "a"
23240 #if cpp_stuff == 42
23241 #define StGiFy(a) #a
23242 #define STRINGIFY(a) StGiFy(a)
23244 #if $cpp_stuff != 1 && $cpp_stuff != 42
23245 # include "Bletch: How does this C preprocessor stringify macros?"
23251 cat <<'EOSH' >> Cppsym.try
23253 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
23254 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
23255 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
23256 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
23258 echo 'return 0;}' >> try.c
23260 cat <<EOSH >> Cppsym.try
23262 case "$osname-$gccversion" in
23263 irix-) ccflags="\$ccflags -woff 1178" ;;
23264 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
23266 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
23268 chmod +x Cppsym.try
23269 $eunicefix Cppsym.try
23270 ./Cppsym < Cppsym.know | $sort | $uniq > Cppsym.true
23271 : Add in any Linux cpp "predefined macros":
23272 case "$osname::$gccversion" in
23273 *linux*::*.*|*gnukfreebsd*::*.*|gnu::*.*)
23275 rm -f $tHdrH'.h' $tHdrH
23277 # Filter out macro arguments, such as Linux's __INT8_C(c)
23278 if $cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
23279 sed -e 's/#define[\ \ ]*//;s/[\ \ ].*$//' -e 's/(.*//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
23280 if [ -s $tHdrH'_cppsym.real' ]; then
23281 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
23284 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
23287 : now check the C compiler for additional symbols
23288 postprocess_cc_v=''
23290 aix) postprocess_cc_v="|$tr , ' '" ;;
23297 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
23300 -D*) echo "\$i" | $sed 's/^-D//';;
23301 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
23306 postprocess_cc_v=''
23309 ./ccsym > ccsym1.raw
23310 if $test -s ccsym1.raw; then
23311 $sort ccsym1.raw | $uniq >ccsym.raw
23313 mv ccsym1.raw ccsym.raw
23316 $awk '/\=/ { print $0; next }
23317 { print $0"=1" }' ccsym.raw >ccsym.list
23318 $comm -13 Cppsym.true ccsym.list >ccsym.own
23319 $comm -12 Cppsym.true ccsym.list >ccsym.com
23320 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
23322 if $test -z ccsym.raw; then
23323 echo "Your C compiler doesn't seem to define any symbols!" >&4
23325 echo "However, your C preprocessor defines the following symbols:"
23328 cppsymbols=`$cat Cppsym.true`
23329 cppsymbols=`echo $cppsymbols`
23330 cppccsymbols="$cppsymbols"
23332 if $test -s ccsym.com; then
23333 echo "Your C compiler and pre-processor define these symbols:"
23334 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
23337 cppccsymbols=`$cat ccsym.com`
23338 cppccsymbols=`echo $cppccsymbols`
23339 $test "$silent" || sleep 1
23341 if $test -s ccsym.cpp; then
23342 $test "$also" && echo " "
23343 echo "Your C pre-processor ${also}defines the following symbols:"
23344 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
23346 cppsymbols=`$cat ccsym.cpp`
23347 cppsymbols=`echo $cppsymbols`
23348 $test "$silent" || sleep 1
23350 if $test -s ccsym.own; then
23351 $test "$also" && echo " "
23352 echo "Your C compiler ${also}defines the following cpp symbols:"
23353 $sed -e 's/\(..*\)=1/\1/' ccsym.own
23354 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
23355 ccsymbols=`$cat ccsym.own`
23356 ccsymbols=`echo $ccsymbols`
23357 $test "$silent" || sleep 1
23361 : add -D_FORTIFY_SOURCE if feasible and not already there
23362 case "$gccversion" in
23363 [45].*) case "$optimize$ccflags" in
23364 *-O*) case "$ccflags$cppsymbols" in
23365 *_FORTIFY_SOURCE=*) # Don't add it again.
23366 echo "You seem to have -D_FORTIFY_SOURCE already, not adding it." >&4
23368 *) echo "Adding -D_FORTIFY_SOURCE=2 to ccflags..." >&4
23369 ccflags="$ccflags -D_FORTIFY_SOURCE=2"
23373 *) echo "You have gcc 4.* or later but not optimizing, not adding -D_FORTIFY_SOURCE." >&4
23377 *) echo "You seem not to have gcc 4.* or later, not adding -D_FORTIFY_SOURCE." >&4
23381 : see if this is a termio system
23385 if $test `./findhdr termios.h`; then
23386 set tcsetattr i_termios
23392 "$define") echo "You have POSIX termios.h... good!" >&4;;
23393 *) if ./Cppsym pyr; then
23394 case "`$run /bin/universe`" in
23395 ucb) if $test `./findhdr sgtty.h`; then
23397 echo "<sgtty.h> found." >&4
23399 echo "System is pyramid with BSD universe."
23400 ./warn "<sgtty.h> not found--you could have problems."
23402 *) if $test `./findhdr termio.h`; then
23404 echo "<termio.h> found." >&4
23406 echo "System is pyramid with USG universe."
23407 ./warn "<termio.h> not found--you could have problems."
23411 if $test `./findhdr termio.h`; then
23412 echo "<termio.h> found." >&4
23414 elif $test `./findhdr sgtty.h`; then
23415 echo "<sgtty.h> found." >&4
23418 ./warn "Neither <termio.h> nor <sgtty.h> found--cross fingers!"
23421 if $test `./findhdr sgtty.h`; then
23422 echo "<sgtty.h> found." >&4
23424 elif $test `./findhdr termio.h`; then
23425 echo "<termio.h> found." >&4
23428 ./warn "Neither <sgtty.h> nor <termio.h> found--cross fingers!"
23432 set i_termio; eval $setvar
23433 val=$val2; set i_sgtty; eval $setvar
23434 val=$val3; set i_termios; eval $setvar
23436 : see if stdbool is available
23437 : we want a real compile instead of Inhdr because some Solaris systems
23438 : have stdbool.h, but it can only be used if the compiler indicates it
23439 : is sufficiently c99-compliant.
23443 #include <stdbool.h>
23448 int main(int argc, char **argv)
23454 if eval $compile; then
23455 echo "<stdbool.h> found." >&4
23458 echo "<stdbool.h> NOT found." >&4
23465 : see if stddef is available
23466 set stddef.h i_stddef
23469 : see if stdint is available
23470 set stdint.h i_stdint
23473 : see if sys/access.h is available
23474 set sys/access.h i_sysaccess
23477 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
23478 set sys/filio.h i_sysfilio
23481 if $test `./findhdr sys/ioctl.h`; then
23483 echo '<sys/ioctl.h> found.' >&4
23486 if $test $i_sysfilio = "$define"; then
23487 echo '<sys/ioctl.h> NOT found.' >&4
23489 $test $i_sgtty = "$define" && xxx="sgtty.h"
23490 $test $i_termio = "$define" && xxx="termio.h"
23491 $test $i_termios = "$define" && xxx="termios.h"
23492 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
23498 : see if socket ioctl defs are in sys/sockio.h
23500 xxx=`./findhdr sys/sockio.h`
23501 if $test "$xxx"; then
23502 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
23504 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
23507 echo "No socket ioctls found in <sys/sockio.h>." >&4
23512 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
23518 : see if this is a syslog.h system
23519 set syslog.h i_syslog
23522 : see if this is a sys/mode.h system
23523 set sys/mode.h i_sysmode
23526 : see if there is a sys/poll.h file
23527 set sys/poll.h i_syspoll
23530 : see if sys/resource.h has to be included
23531 set sys/resource.h i_sysresrc
23534 : see if sys/security.h is available
23535 set sys/security.h i_syssecrt
23538 : see if this is a sys/statvfs.h system
23539 set sys/statvfs.h i_sysstatvfs
23542 : see if this is a sys/un.h system
23543 set sys/un.h i_sysun
23546 : see if this is a sys/utsname.h system
23547 set sys/utsname.h i_sysutsname
23550 : see if this is a syswait system
23551 set sys/wait.h i_syswait
23554 : see if this is a ustat.h system
23555 set ustat.h i_ustat
23558 : see if this is an utime system
23559 set utime.h i_utime
23562 : see if this is a vfork system
23565 set vfork.h i_vfork
23575 echo "Looking for extensions..." >&4
23576 : If we are using the old config.sh, nonxs_extensions and xs_extensions may
23577 : contain old or inaccurate or duplicate values.
23578 nonxs_extensions=''
23580 : We do not use find because it might not be available.
23581 : We do not just use MANIFEST because the user may have dropped
23582 : some additional extensions into the source tree and expect them
23585 : Function to recursively find available extensions, ignoring DynaLoader
23586 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
23587 : In 5.10.1 and later, extensions are stored in directories
23588 : like File-Glob instead of the older File/Glob/.
23592 DynaLoader|dynaload) ;;
23594 this_ext=`echo "$xxx" | $sed -e s/-/\\\//g`;
23595 case "$this_ext" in
23596 Scalar/List/Utils) this_ext="List/Util" ;;
23597 PathTools) this_ext="Cwd" ;;
23599 echo " $xs_extensions $nonxs_extensions" > "$tdir/$$.tmp";
23600 if $contains " $this_ext " "$tdir/$$.tmp"; then
23602 echo "Duplicate directories detected for extension $xxx" >&4;
23603 echo "Configure cannot correctly recover from this - shall I abort?" >&4;
23604 case "$knowitall" in
23612 echo "Ok. Stopping Configure." >&4;
23613 echo "Please remove the duplicate directory (e.g. using git clean) and then re-run Configure" >&4;
23616 echo "Ok. You will need to correct config.sh before running make." >&4;
23618 $ls -1 "$xxx" > "$tdir/$$.tmp";
23619 if $contains "\.xs$" "$tdir/$$.tmp" > /dev/null 2>&1; then
23620 xs_extensions="$xs_extensions $this_ext";
23621 elif $contains "\.c$" "$tdir/$$.tmp" > /dev/null 2>&1; then
23622 xs_extensions="$xs_extensions $this_ext";
23623 elif $test -d "$xxx"; then
23624 nonxs_extensions="$nonxs_extensions $this_ext";
23626 $rm -f "$tdir/$$.tmp";
23634 eval $find_extensions
23638 eval $find_extensions
23642 eval $find_extensions
23643 set X $xs_extensions
23645 xs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
23646 set X $nonxs_extensions
23648 nonxs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
23650 known_extensions=`echo $nonxs_extensions $xs_extensions | tr ' ' $trnl | $sort | tr $trnl ' '`
23652 : Now see which are supported on this system.
23654 for xxx in $xs_extensions ; do
23658 amigaos) avail_ext="$avail_ext $xxx" ;;
23663 $define) avail_ext="$avail_ext $xxx" ;;
23666 GDBM_File|gdbm_fil)
23668 $define) avail_ext="$avail_ext $xxx" ;;
23671 I18N/Langinfo|i18n_lan)
23672 case "$i_langinfo$d_nl_langinfo" in
23673 $define$define) avail_ext="$avail_ext $xxx" ;;
23677 : XXX Do we need a useipcsysv variable here
23678 case "${d_msg}${d_sem}${d_shm}" in
23679 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
23682 NDBM_File|ndbm_fil)
23685 case "$osname-$use64bitint" in
23688 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
23691 *) avail_ext="$avail_ext $xxx" ;;
23696 ODBM_File|odbm_fil)
23697 case "${i_dbm}${i_rpcsvcdbm}" in
23699 case "$d_cplusplus" in
23700 define) ;; # delete as a function name will not work
23701 *) case "$osname-$use64bitint" in
23704 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
23707 *) avail_ext="$avail_ext $xxx" ;;
23715 case "$useopcode" in
23716 true|define|y) avail_ext="$avail_ext $xxx" ;;
23720 case "$useposix" in
23721 true|define|y) avail_ext="$avail_ext $xxx" ;;
23725 case "$d_socket" in
23726 true|$define|y) avail_ext="$avail_ext $xxx" ;;
23729 Sys/Syslog|sys/syslog)
23731 amigaos) ;; # not really very useful on AmigaOS
23733 : XXX syslog requires socket
23734 case "$d_socket" in
23735 true|$define|y) avail_ext="$avail_ext $xxx" ;;
23741 case "$usethreads" in
23743 case "$use5005threads" in
23744 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
23748 threads|threads/shared)
23749 # threads and threads::shared are special cases.
23750 # To stop people from asking "Perl 5.8.0 was supposed
23751 # to have this new fancy threads implementation but my
23752 # perl doesn't have it" and from people trying to
23753 # (re)install the threads module using CPAN.pm and
23754 # CPAN.pm then offering to reinstall Perl 5.8.0,
23755 # the threads.pm and threads/shared.pm will always be
23756 # there, croaking informatively ("you need to rebuild
23757 # all of Perl with threads, sorry") when threads haven't
23758 # been compiled in.
23760 avail_ext="$avail_ext $xxx"
23766 cygwin) avail_ext="$avail_ext $xxx" ;;
23769 XS/APItest|xs/apitest)
23770 # This is just for testing. Skip it unless we have dynamic loading.
23773 $define) avail_ext="$avail_ext $xxx" ;;
23776 XS/Typemap|xs/typemap)
23777 # This is just for testing. Skip it unless we have dynamic loading.
23779 $define) avail_ext="$avail_ext $xxx" ;;
23782 *) avail_ext="$avail_ext $xxx"
23791 case "$onlyextensions" in
23793 *) keepextensions=''
23794 echo "You have requested that only certain extensions be included..." >&4
23795 for i in $onlyextensions; do
23796 case " $avail_ext " in
23798 echo "Keeping extension $i."
23799 keepextensions="$keepextensions $i"
23801 *) echo "Ignoring extension $i." ;;
23804 avail_ext="$keepextensions"
23808 case "$noextensions" in
23810 *) keepextensions=''
23811 echo "You have requested that certain extensions be ignored..." >&4
23812 for i in $avail_ext; do
23813 case " $noextensions " in
23814 *" $i "*) echo "Ignoring extension $i." ;;
23815 *) echo "Keeping extension $i.";
23816 keepextensions="$keepextensions $i"
23820 avail_ext="$keepextensions"
23824 : Now see which nonxs extensions are supported on this system.
23825 : For now assume all are.
23827 for xxx in $nonxs_extensions ; do
23831 *) nonxs_ext="$nonxs_ext $xxx"
23843 A number of extensions are supplied with $package. You may choose to
23844 compile these extensions for dynamic loading (the default), compile
23845 them into the $package executable (static loading), or not include
23846 them at all. Answer "none" to include no extensions.
23847 Note that DynaLoader is always built and need not be mentioned here.
23850 case "$dynamic_ext" in
23852 : Exclude those listed in static_ext
23854 for xxx in $avail_ext; do
23855 case " $static_ext " in
23857 *) dflt="$dflt $xxx" ;;
23864 *) dflt="$dynamic_ext"
23865 # Perhaps we are reusing an old out-of-date config.sh.
23868 if test X"$dynamic_ext" != X"$avail_ext"; then
23870 NOTICE: Your previous config.sh list may be incorrect.
23871 The extensions now available to you are
23873 but the default list from your previous config.sh is
23885 rp="What extensions do you wish to load dynamically?"
23888 none) dynamic_ext=' ' ;;
23889 *) dynamic_ext="$ans" ;;
23892 case "$static_ext" in
23894 : Exclude those already listed in dynamic linking
23896 for xxx in $avail_ext; do
23897 case " $dynamic_ext " in
23899 *) dflt="$dflt $xxx" ;;
23906 *) dflt="$static_ext"
23913 rp="What extensions do you wish to load statically?"
23916 none) static_ext=' ' ;;
23917 *) static_ext="$ans" ;;
23922 A number of extensions are supplied with $package. Answer "none"
23923 to include no extensions.
23924 Note that DynaLoader is always built and need not be mentioned here.
23927 case "$static_ext" in
23928 '') dflt="$avail_ext" ;;
23929 *) dflt="$static_ext"
23930 # Perhaps we are reusing an old out-of-date config.sh.
23933 if test X"$static_ext" != X"$avail_ext"; then
23935 NOTICE: Your previous config.sh list may be incorrect.
23936 The extensions now available to you are
23938 but the default list from your previous config.sh is
23947 : Exclude those that are not xs extensions
23951 rp="What extensions do you wish to include?"
23954 none) static_ext=' ' ;;
23955 *) static_ext="$ans" ;;
23960 # Encode is a special case. If we are building Encode as a static
23961 # extension, we need to explicitly list its subextensions as well.
23962 # For other nested extensions, this is handled automatically by
23963 # the appropriate Makefile.PL.
23964 case " $static_ext " in
23965 *" Encode "*) # Add the subextensions of Encode
23967 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
23968 static_ext="$static_ext Encode/$xxx"
23969 known_extensions="$known_extensions Encode/$xxx"
23975 set X $dynamic_ext $static_ext $nonxs_ext
23979 # Sanity check: We require an extension suitable for use with
23980 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
23981 # should show up as failures in the test suite, but it's helpful to
23982 # catch them now.) The 'extensions' list is normally sorted
23983 # alphabetically, so we need to accept either
23984 # DB_File ... Fcntl ... IO ....
23985 # or something like
23986 # Fcntl ... NDBM_File ... IO ....
23987 case " $extensions" in
23988 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
23989 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
23990 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
23991 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
23992 echo "WARNING: The Perl you are building will be quite crippled." >& 4
23996 : Remove libraries needed only for extensions
23997 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
23998 : The exception is SunOS 4.x, which needs them.
23999 case "${osname}X${osvers}" in
24003 *) case "$usedl" in
24004 $define|true|[yY]*)
24005 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
24009 *) perllibs="$libs"
24015 : Remove build directory name from cppstdin so it can be used from
24016 : either the present location or the final installed location.
24018 : Get out of the UU directory to get correct path name.
24020 case "$cppstdin" in
24022 echo "Stripping down cppstdin path name"
24028 : end of configuration questions
24030 echo "End of configuration questions."
24033 : back to where it started
24034 if test -d ../UU; then
24038 : configuration may be unconditionally patched via a 'config.arch' file
24039 if $test -f config.arch; then
24040 echo "I see a config.arch file, loading it." >&4
24044 : configuration may be patched via a 'config.over' file
24045 if $test -f config.over; then
24048 rp='I see a config.over file. Do you wish to load it?'
24051 n*) echo "OK, I'll ignore it.";;
24053 echo "Configuration override changes have been loaded."
24058 : in case they want portability, strip down executable paths
24059 case "$d_portable" in
24062 echo "Stripping down executable paths..." >&4
24063 for file in $loclist $trylist; do
24065 eval $file=`basename $temp`
24070 : create config.sh file
24072 echo "Creating config.sh..." >&4
24073 $spitshell <<EOT >config.sh
24076 # This file was produced by running the Configure script. It holds all the
24077 # definitions figured out by Configure. Should you modify one of these values,
24078 # do not forget to propagate your changes by running "Configure -der". You may
24079 # instead choose to run each of the .SH files by yourself, or "Configure -S".
24082 # Package name : $package
24083 # Source directory : $src
24084 # Configuration time: $cf_time
24085 # Configured by : $cf_by
24086 # Target system : $myuname
24089 : Add in command line options if available
24090 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
24092 $spitshell <<EOT >>config.sh
24101 Revision='$Revision'
24109 alignbytes='$alignbytes'
24110 ansi2knr='$ansi2knr'
24111 aphostname='$aphostname'
24112 api_revision='$api_revision'
24113 api_subversion='$api_subversion'
24114 api_version='$api_version'
24115 api_versionstring='$api_versionstring'
24118 archlibexp='$archlibexp'
24119 archname64='$archname64'
24120 archname='$archname'
24121 archobjs='$archobjs'
24122 asctime_r_proto='$asctime_r_proto'
24131 byteorder='$byteorder'
24133 castflags='$castflags'
24136 cccdlflags='$cccdlflags'
24137 ccdlflags='$ccdlflags'
24139 ccflags_uselargefiles='$ccflags_uselargefiles'
24141 ccsymbols='$ccsymbols'
24142 ccversion='$ccversion'
24144 cf_email='$cf_email'
24146 charbits='$charbits'
24147 charsize='$charsize'
24151 clocktype='$clocktype'
24153 compress='$compress'
24154 contains='$contains'
24158 cpp_stuff='$cpp_stuff'
24159 cppccsymbols='$cppccsymbols'
24160 cppflags='$cppflags'
24162 cppminus='$cppminus'
24164 cppstdin='$cppstdin'
24165 cppsymbols='$cppsymbols'
24166 crypt_r_proto='$crypt_r_proto'
24167 cryptlib='$cryptlib'
24169 ctermid_r_proto='$ctermid_r_proto'
24170 ctime_r_proto='$ctime_r_proto'
24171 d_Gconvert='$d_Gconvert'
24172 d_PRIEUldbl='$d_PRIEUldbl'
24173 d_PRIFUldbl='$d_PRIFUldbl'
24174 d_PRIGUldbl='$d_PRIGUldbl'
24175 d_PRIXU64='$d_PRIXU64'
24176 d_PRId64='$d_PRId64'
24177 d_PRIeldbl='$d_PRIeldbl'
24178 d_PRIfldbl='$d_PRIfldbl'
24179 d_PRIgldbl='$d_PRIgldbl'
24180 d_PRIi64='$d_PRIi64'
24181 d_PRIo64='$d_PRIo64'
24182 d_PRIu64='$d_PRIu64'
24183 d_PRIx64='$d_PRIx64'
24184 d_SCNfldbl='$d_SCNfldbl'
24185 d__fwalk='$d__fwalk'
24186 d_access='$d_access'
24187 d_accessx='$d_accessx'
24191 d_archlib='$d_archlib'
24192 d_asctime64='$d_asctime64'
24193 d_asctime_r='$d_asctime_r'
24198 d_attribute_deprecated='$d_attribute_deprecated'
24199 d_attribute_format='$d_attribute_format'
24200 d_attribute_malloc='$d_attribute_malloc'
24201 d_attribute_nonnull='$d_attribute_nonnull'
24202 d_attribute_noreturn='$d_attribute_noreturn'
24203 d_attribute_pure='$d_attribute_pure'
24204 d_attribute_unused='$d_attribute_unused'
24205 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
24206 d_backtrace='$d_backtrace'
24210 d_bsdgetpgrp='$d_bsdgetpgrp'
24211 d_bsdsetpgrp='$d_bsdsetpgrp'
24212 d_builtin_choose_expr='$d_builtin_choose_expr'
24213 d_builtin_expect='$d_builtin_expect'
24215 d_c99_variadic_macros='$d_c99_variadic_macros'
24216 d_casti32='$d_casti32'
24217 d_castneg='$d_castneg'
24219 d_charvspr='$d_charvspr'
24221 d_chroot='$d_chroot'
24222 d_chsize='$d_chsize'
24224 d_clearenv='$d_clearenv'
24225 d_closedir='$d_closedir'
24226 d_cmsghdr_s='$d_cmsghdr_s'
24228 d_copysign='$d_copysign'
24229 d_copysignl='$d_copysignl'
24230 d_cplusplus='$d_cplusplus'
24232 d_crypt_r='$d_crypt_r'
24234 d_ctermid='$d_ctermid'
24235 d_ctermid_r='$d_ctermid_r'
24236 d_ctime64='$d_ctime64'
24237 d_ctime_r='$d_ctime_r'
24238 d_cuserid='$d_cuserid'
24239 d_dbl_dig='$d_dbl_dig'
24240 d_dbminitproto='$d_dbminitproto'
24241 d_difftime64='$d_difftime64'
24242 d_difftime='$d_difftime'
24243 d_dir_dd_fd='$d_dir_dd_fd'
24245 d_dirnamlen='$d_dirnamlen'
24246 d_dladdr='$d_dladdr'
24247 d_dlerror='$d_dlerror'
24248 d_dlopen='$d_dlopen'
24249 d_dlsymun='$d_dlsymun'
24250 d_dosuid='$d_dosuid'
24251 d_drand48_r='$d_drand48_r'
24252 d_drand48proto='$d_drand48proto'
24254 d_eaccess='$d_eaccess'
24255 d_endgrent='$d_endgrent'
24256 d_endgrent_r='$d_endgrent_r'
24257 d_endhent='$d_endhent'
24258 d_endhostent_r='$d_endhostent_r'
24259 d_endnent='$d_endnent'
24260 d_endnetent_r='$d_endnetent_r'
24261 d_endpent='$d_endpent'
24262 d_endprotoent_r='$d_endprotoent_r'
24263 d_endpwent='$d_endpwent'
24264 d_endpwent_r='$d_endpwent_r'
24265 d_endsent='$d_endsent'
24266 d_endservent_r='$d_endservent_r'
24267 d_eofnblk='$d_eofnblk'
24270 d_eunice='$d_eunice'
24273 d_faststdio='$d_faststdio'
24274 d_fchdir='$d_fchdir'
24275 d_fchmod='$d_fchmod'
24276 d_fchown='$d_fchown'
24278 d_fcntl_can_lock='$d_fcntl_can_lock'
24279 d_fd_macros='$d_fd_macros'
24280 d_fd_set='$d_fd_set'
24281 d_fdclose='$d_fdclose'
24283 d_fds_bits='$d_fds_bits'
24284 d_fegetround='$d_fegetround'
24285 d_fgetpos='$d_fgetpos'
24286 d_finite='$d_finite'
24287 d_finitel='$d_finitel'
24288 d_flexfnam='$d_flexfnam'
24290 d_flockproto='$d_flockproto'
24295 d_fp_class='$d_fp_class'
24296 d_fp_classify='$d_fp_classify'
24297 d_fp_classl='$d_fp_classl'
24298 d_fpathconf='$d_fpathconf'
24299 d_fpclass='$d_fpclass'
24300 d_fpclassify='$d_fpclassify'
24301 d_fpclassl='$d_fpclassl'
24302 d_fpgetround='$d_fpgetround'
24303 d_fpos64_t='$d_fpos64_t'
24304 d_frexpl='$d_frexpl'
24305 d_fs_data_s='$d_fs_data_s'
24306 d_fseeko='$d_fseeko'
24307 d_fsetpos='$d_fsetpos'
24308 d_fstatfs='$d_fstatfs'
24309 d_fstatvfs='$d_fstatvfs'
24311 d_ftello='$d_ftello'
24313 d_futimes='$d_futimes'
24314 d_gdbm_ndbm_h_uses_prototypes='$d_gdbm_ndbm_h_uses_prototypes'
24315 d_gdbmndbm_h_uses_prototypes='$d_gdbmndbm_h_uses_prototypes'
24316 d_getaddrinfo='$d_getaddrinfo'
24317 d_getcwd='$d_getcwd'
24318 d_getespwnam='$d_getespwnam'
24319 d_getfsstat='$d_getfsstat'
24320 d_getgrent='$d_getgrent'
24321 d_getgrent_r='$d_getgrent_r'
24322 d_getgrgid_r='$d_getgrgid_r'
24323 d_getgrnam_r='$d_getgrnam_r'
24324 d_getgrps='$d_getgrps'
24325 d_gethbyaddr='$d_gethbyaddr'
24326 d_gethbyname='$d_gethbyname'
24327 d_gethent='$d_gethent'
24328 d_gethname='$d_gethname'
24329 d_gethostbyaddr_r='$d_gethostbyaddr_r'
24330 d_gethostbyname_r='$d_gethostbyname_r'
24331 d_gethostent_r='$d_gethostent_r'
24332 d_gethostprotos='$d_gethostprotos'
24333 d_getitimer='$d_getitimer'
24334 d_getlogin='$d_getlogin'
24335 d_getlogin_r='$d_getlogin_r'
24336 d_getmnt='$d_getmnt'
24337 d_getmntent='$d_getmntent'
24338 d_getnameinfo='$d_getnameinfo'
24339 d_getnbyaddr='$d_getnbyaddr'
24340 d_getnbyname='$d_getnbyname'
24341 d_getnent='$d_getnent'
24342 d_getnetbyaddr_r='$d_getnetbyaddr_r'
24343 d_getnetbyname_r='$d_getnetbyname_r'
24344 d_getnetent_r='$d_getnetent_r'
24345 d_getnetprotos='$d_getnetprotos'
24346 d_getpagsz='$d_getpagsz'
24347 d_getpbyname='$d_getpbyname'
24348 d_getpbynumber='$d_getpbynumber'
24349 d_getpent='$d_getpent'
24350 d_getpgid='$d_getpgid'
24351 d_getpgrp2='$d_getpgrp2'
24352 d_getpgrp='$d_getpgrp'
24353 d_getppid='$d_getppid'
24354 d_getprior='$d_getprior'
24355 d_getprotobyname_r='$d_getprotobyname_r'
24356 d_getprotobynumber_r='$d_getprotobynumber_r'
24357 d_getprotoent_r='$d_getprotoent_r'
24358 d_getprotoprotos='$d_getprotoprotos'
24359 d_getprpwnam='$d_getprpwnam'
24360 d_getpwent='$d_getpwent'
24361 d_getpwent_r='$d_getpwent_r'
24362 d_getpwnam_r='$d_getpwnam_r'
24363 d_getpwuid_r='$d_getpwuid_r'
24364 d_getsbyname='$d_getsbyname'
24365 d_getsbyport='$d_getsbyport'
24366 d_getsent='$d_getsent'
24367 d_getservbyname_r='$d_getservbyname_r'
24368 d_getservbyport_r='$d_getservbyport_r'
24369 d_getservent_r='$d_getservent_r'
24370 d_getservprotos='$d_getservprotos'
24371 d_getspnam='$d_getspnam'
24372 d_getspnam_r='$d_getspnam_r'
24373 d_gettimeod='$d_gettimeod'
24374 d_gmtime64='$d_gmtime64'
24375 d_gmtime_r='$d_gmtime_r'
24376 d_gnulibc='$d_gnulibc'
24377 d_grpasswd='$d_grpasswd'
24378 d_hasmntopt='$d_hasmntopt'
24382 d_ilogbl='$d_ilogbl'
24383 d_inc_version_list='$d_inc_version_list'
24385 d_inetaton='$d_inetaton'
24386 d_inetntop='$d_inetntop'
24387 d_inetpton='$d_inetpton'
24388 d_int64_t='$d_int64_t'
24389 d_ip_mreq='$d_ip_mreq'
24390 d_ip_mreq_source='$d_ip_mreq_source'
24391 d_ipv6_mreq='$d_ipv6_mreq'
24392 d_ipv6_mreq_source='$d_ipv6_mreq_source'
24393 d_isascii='$d_isascii'
24394 d_isblank='$d_isblank'
24395 d_isfinite='$d_isfinite'
24396 d_isfinitel='$d_isfinitel'
24398 d_isinfl='$d_isinfl'
24399 d_isless='$d_isless'
24401 d_isnanl='$d_isnanl'
24402 d_isnormal='$d_isnormal'
24405 d_killpg='$d_killpg'
24406 d_lc_monetary_2008='$d_lc_monetary_2008'
24407 d_lchown='$d_lchown'
24408 d_ldbl_dig='$d_ldbl_dig'
24409 d_ldexpl='$d_ldexpl'
24410 d_lgamma='$d_lgamma'
24411 d_lgamma_r='$d_lgamma_r'
24412 d_libm_lib_version='$d_libm_lib_version'
24413 d_libname_unique='$d_libname_unique'
24415 d_llrint='$d_llrint'
24416 d_llrintl='$d_llrintl'
24417 d_llround='$d_llround'
24418 d_llroundl='$d_llroundl'
24419 d_localtime64='$d_localtime64'
24420 d_localtime_r='$d_localtime_r'
24421 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
24422 d_locconv='$d_locconv'
24427 d_longdbl='$d_longdbl'
24428 d_longlong='$d_longlong'
24430 d_lrintl='$d_lrintl'
24431 d_lround='$d_lround'
24432 d_lroundl='$d_lroundl'
24433 d_lseekproto='$d_lseekproto'
24435 d_madvise='$d_madvise'
24436 d_malloc_good_size='$d_malloc_good_size'
24437 d_malloc_size='$d_malloc_size'
24439 d_mbstowcs='$d_mbstowcs'
24440 d_mbtowc='$d_mbtowc'
24441 d_memchr='$d_memchr'
24442 d_memcmp='$d_memcmp'
24443 d_memcpy='$d_memcpy'
24444 d_memmove='$d_memmove'
24445 d_memset='$d_memset'
24447 d_mkdtemp='$d_mkdtemp'
24448 d_mkfifo='$d_mkfifo'
24449 d_mkstemp='$d_mkstemp'
24450 d_mkstemps='$d_mkstemps'
24451 d_mktime64='$d_mktime64'
24452 d_mktime='$d_mktime'
24455 d_modfl_pow32_bug='$d_modfl_pow32_bug'
24456 d_modflproto='$d_modflproto'
24457 d_mprotect='$d_mprotect'
24459 d_msg_ctrunc='$d_msg_ctrunc'
24460 d_msg_dontroute='$d_msg_dontroute'
24461 d_msg_oob='$d_msg_oob'
24462 d_msg_peek='$d_msg_peek'
24463 d_msg_proxy='$d_msg_proxy'
24464 d_msgctl='$d_msgctl'
24465 d_msgget='$d_msgget'
24466 d_msghdr_s='$d_msghdr_s'
24467 d_msgrcv='$d_msgrcv'
24468 d_msgsnd='$d_msgsnd'
24470 d_munmap='$d_munmap'
24471 d_mymalloc='$d_mymalloc'
24474 d_ndbm_h_uses_prototypes='$d_ndbm_h_uses_prototypes'
24475 d_nearbyint='$d_nearbyint'
24476 d_nextafter='$d_nextafter'
24477 d_nexttoward='$d_nexttoward'
24479 d_nl_langinfo='$d_nl_langinfo'
24480 d_nv_preserves_uv='$d_nv_preserves_uv'
24481 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
24482 d_off64_t='$d_off64_t'
24483 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
24484 d_oldpthreads='$d_oldpthreads'
24485 d_oldsock='$d_oldsock'
24487 d_pathconf='$d_pathconf'
24489 d_perl_otherlibdirs='$d_perl_otherlibdirs'
24490 d_phostname='$d_phostname'
24493 d_portable='$d_portable'
24495 d_prctl_set_name='$d_prctl_set_name'
24496 d_printf_format_null='$d_printf_format_null'
24497 d_procselfexe='$d_procselfexe'
24498 d_pseudofork='$d_pseudofork'
24499 d_pthread_atfork='$d_pthread_atfork'
24500 d_pthread_attr_setscope='$d_pthread_attr_setscope'
24501 d_pthread_yield='$d_pthread_yield'
24502 d_ptrdiff_t='$d_ptrdiff_t'
24504 d_pwchange='$d_pwchange'
24505 d_pwclass='$d_pwclass'
24506 d_pwcomment='$d_pwcomment'
24507 d_pwexpire='$d_pwexpire'
24508 d_pwgecos='$d_pwgecos'
24509 d_pwpasswd='$d_pwpasswd'
24510 d_pwquota='$d_pwquota'
24513 d_random_r='$d_random_r'
24514 d_re_comp='$d_re_comp'
24515 d_readdir64_r='$d_readdir64_r'
24516 d_readdir='$d_readdir'
24517 d_readdir_r='$d_readdir_r'
24518 d_readlink='$d_readlink'
24520 d_recvmsg='$d_recvmsg'
24521 d_regcmp='$d_regcmp'
24522 d_regcomp='$d_regcomp'
24523 d_remainder='$d_remainder'
24524 d_remquo='$d_remquo'
24525 d_rename='$d_rename'
24526 d_rewinddir='$d_rewinddir'
24530 d_safebcpy='$d_safebcpy'
24531 d_safemcpy='$d_safemcpy'
24532 d_sanemcmp='$d_sanemcmp'
24533 d_sbrkproto='$d_sbrkproto'
24534 d_scalbn='$d_scalbn'
24535 d_scalbnl='$d_scalbnl'
24536 d_sched_yield='$d_sched_yield'
24537 d_scm_rights='$d_scm_rights'
24538 d_seekdir='$d_seekdir'
24539 d_select='$d_select'
24541 d_semctl='$d_semctl'
24542 d_semctl_semid_ds='$d_semctl_semid_ds'
24543 d_semctl_semun='$d_semctl_semun'
24544 d_semget='$d_semget'
24546 d_sendmsg='$d_sendmsg'
24547 d_setegid='$d_setegid'
24548 d_seteuid='$d_seteuid'
24549 d_setgrent='$d_setgrent'
24550 d_setgrent_r='$d_setgrent_r'
24551 d_setgrps='$d_setgrps'
24552 d_sethent='$d_sethent'
24553 d_sethostent_r='$d_sethostent_r'
24554 d_setitimer='$d_setitimer'
24555 d_setlinebuf='$d_setlinebuf'
24556 d_setlocale='$d_setlocale'
24557 d_setlocale_r='$d_setlocale_r'
24558 d_setnent='$d_setnent'
24559 d_setnetent_r='$d_setnetent_r'
24560 d_setpent='$d_setpent'
24561 d_setpgid='$d_setpgid'
24562 d_setpgrp2='$d_setpgrp2'
24563 d_setpgrp='$d_setpgrp'
24564 d_setprior='$d_setprior'
24565 d_setproctitle='$d_setproctitle'
24566 d_setprotoent_r='$d_setprotoent_r'
24567 d_setpwent='$d_setpwent'
24568 d_setpwent_r='$d_setpwent_r'
24569 d_setregid='$d_setregid'
24570 d_setresgid='$d_setresgid'
24571 d_setresuid='$d_setresuid'
24572 d_setreuid='$d_setreuid'
24573 d_setrgid='$d_setrgid'
24574 d_setruid='$d_setruid'
24575 d_setsent='$d_setsent'
24576 d_setservent_r='$d_setservent_r'
24577 d_setsid='$d_setsid'
24578 d_setvbuf='$d_setvbuf'
24581 d_shmatprototype='$d_shmatprototype'
24582 d_shmctl='$d_shmctl'
24584 d_shmget='$d_shmget'
24585 d_sigaction='$d_sigaction'
24586 d_siginfo_si_errno='$d_siginfo_si_errno'
24587 d_siginfo_si_pid='$d_siginfo_si_pid'
24588 d_siginfo_si_uid='$d_siginfo_si_uid'
24589 d_siginfo_si_addr='$d_siginfo_si_addr'
24590 d_siginfo_si_status='$d_siginfo_si_status'
24591 d_siginfo_si_band='$d_siginfo_si_band'
24592 d_siginfo_si_value='$d_siginfo_si_value'
24593 d_signbit='$d_signbit'
24594 d_sigprocmask='$d_sigprocmask'
24595 d_sigsetjmp='$d_sigsetjmp'
24596 d_sin6_scope_id='$d_sin6_scope_id'
24597 d_sitearch='$d_sitearch'
24598 d_snprintf='$d_snprintf'
24599 d_sockaddr_in6='$d_sockaddr_in6'
24600 d_sockaddr_sa_len='$d_sockaddr_sa_len'
24601 d_sockatmark='$d_sockatmark'
24602 d_sockatmarkproto='$d_sockatmarkproto'
24603 d_socket='$d_socket'
24604 d_socklen_t='$d_socklen_t'
24605 d_sockpair='$d_sockpair'
24606 d_socks5_init='$d_socks5_init'
24607 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
24609 d_srand48_r='$d_srand48_r'
24610 d_srandom_r='$d_srandom_r'
24611 d_sresgproto='$d_sresgproto'
24612 d_sresuproto='$d_sresuproto'
24614 d_statblks='$d_statblks'
24615 d_statfs_f_flags='$d_statfs_f_flags'
24616 d_statfs_s='$d_statfs_s'
24617 d_static_inline='$d_static_inline'
24618 d_statvfs='$d_statvfs'
24619 d_stdio_cnt_lval='$d_stdio_cnt_lval'
24620 d_stdio_ptr_lval='$d_stdio_ptr_lval'
24621 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
24622 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
24623 d_stdio_stream_array='$d_stdio_stream_array'
24624 d_stdiobase='$d_stdiobase'
24625 d_stdstdio='$d_stdstdio'
24626 d_strchr='$d_strchr'
24627 d_strcoll='$d_strcoll'
24628 d_strctcpy='$d_strctcpy'
24629 d_strerrm='$d_strerrm'
24630 d_strerror='$d_strerror'
24631 d_strerror_r='$d_strerror_r'
24632 d_strftime='$d_strftime'
24633 d_strlcat='$d_strlcat'
24634 d_strlcpy='$d_strlcpy'
24635 d_strtod='$d_strtod'
24636 d_strtol='$d_strtol'
24637 d_strtold='$d_strtold'
24638 d_strtoll='$d_strtoll'
24639 d_strtoq='$d_strtoq'
24640 d_strtoul='$d_strtoul'
24641 d_strtoull='$d_strtoull'
24642 d_strtouq='$d_strtouq'
24643 d_strxfrm='$d_strxfrm'
24644 d_suidsafe='$d_suidsafe'
24645 d_symlink='$d_symlink'
24646 d_syscall='$d_syscall'
24647 d_syscallproto='$d_syscallproto'
24648 d_sysconf='$d_sysconf'
24649 d_sysernlst='$d_sysernlst'
24650 d_syserrlst='$d_syserrlst'
24651 d_system='$d_system'
24652 d_tcgetpgrp='$d_tcgetpgrp'
24653 d_tcsetpgrp='$d_tcsetpgrp'
24654 d_telldir='$d_telldir'
24655 d_telldirproto='$d_telldirproto'
24656 d_tgamma='$d_tgamma'
24658 d_timegm='$d_timegm'
24660 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
24661 d_tm_tm_zone='$d_tm_tm_zone'
24662 d_tmpnam_r='$d_tmpnam_r'
24664 d_truncate='$d_truncate'
24665 d_truncl='$d_truncl'
24666 d_ttyname_r='$d_ttyname_r'
24667 d_tzname='$d_tzname'
24668 d_u32align='$d_u32align'
24669 d_ualarm='$d_ualarm'
24672 d_union_semun='$d_union_semun'
24673 d_unordered='$d_unordered'
24674 d_unsetenv='$d_unsetenv'
24675 d_usleep='$d_usleep'
24676 d_usleepproto='$d_usleepproto'
24678 d_vendorarch='$d_vendorarch'
24679 d_vendorbin='$d_vendorbin'
24680 d_vendorlib='$d_vendorlib'
24681 d_vendorscript='$d_vendorscript'
24683 d_void_closedir='$d_void_closedir'
24684 d_voidsig='$d_voidsig'
24685 d_voidtty='$d_voidtty'
24686 d_volatile='$d_volatile'
24687 d_vprintf='$d_vprintf'
24688 d_vsnprintf='$d_vsnprintf'
24690 d_waitpid='$d_waitpid'
24691 d_wcscmp='$d_wcscmp'
24692 d_wcstombs='$d_wcstombs'
24693 d_wcsxfrm='$d_wcsxfrm'
24694 d_wctomb='$d_wctomb'
24695 d_writev='$d_writev'
24698 db_hashtype='$db_hashtype'
24699 db_prefixtype='$db_prefixtype'
24700 db_version_major='$db_version_major'
24701 db_version_minor='$db_version_minor'
24702 db_version_patch='$db_version_patch'
24703 direntrytype='$direntrytype'
24706 doubleinfbytes='$doubleinfbytes'
24707 doublekind='$doublekind'
24708 doublemantbits='$doublemantbits'
24709 doublenanbytes='$doublenanbytes'
24710 doublesize='$doublesize'
24712 drand48_r_proto='$drand48_r_proto'
24714 dynamic_ext='$dynamic_ext'
24720 endgrent_r_proto='$endgrent_r_proto'
24721 endhostent_r_proto='$endhostent_r_proto'
24722 endnetent_r_proto='$endnetent_r_proto'
24723 endprotoent_r_proto='$endprotoent_r_proto'
24724 endpwent_r_proto='$endpwent_r_proto'
24725 endservent_r_proto='$endservent_r_proto'
24726 eunicefix='$eunicefix'
24729 extensions='$extensions'
24730 extern_C='$extern_C'
24732 fflushNULL='$fflushNULL'
24733 fflushall='$fflushall'
24735 firstmakefile='$firstmakefile'
24737 fpossize='$fpossize'
24738 fpostype='$fpostype'
24739 freetype='$freetype'
24742 full_csh='$full_csh'
24743 full_sed='$full_sed'
24744 gccansipedantic='$gccansipedantic'
24745 gccosandvers='$gccosandvers'
24746 gccversion='$gccversion'
24747 getgrent_r_proto='$getgrent_r_proto'
24748 getgrgid_r_proto='$getgrgid_r_proto'
24749 getgrnam_r_proto='$getgrnam_r_proto'
24750 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
24751 gethostbyname_r_proto='$gethostbyname_r_proto'
24752 gethostent_r_proto='$gethostent_r_proto'
24753 getlogin_r_proto='$getlogin_r_proto'
24754 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
24755 getnetbyname_r_proto='$getnetbyname_r_proto'
24756 getnetent_r_proto='$getnetent_r_proto'
24757 getprotobyname_r_proto='$getprotobyname_r_proto'
24758 getprotobynumber_r_proto='$getprotobynumber_r_proto'
24759 getprotoent_r_proto='$getprotoent_r_proto'
24760 getpwent_r_proto='$getpwent_r_proto'
24761 getpwnam_r_proto='$getpwnam_r_proto'
24762 getpwuid_r_proto='$getpwuid_r_proto'
24763 getservbyname_r_proto='$getservbyname_r_proto'
24764 getservbyport_r_proto='$getservbyport_r_proto'
24765 getservent_r_proto='$getservent_r_proto'
24766 getspnam_r_proto='$getspnam_r_proto'
24767 gidformat='$gidformat'
24773 gmtime_r_proto='$gmtime_r_proto'
24774 gnulibc_version='$gnulibc_version'
24776 groupcat='$groupcat'
24777 groupstype='$groupstype'
24780 h_sysfile='$h_sysfile'
24783 hostgenerate='$hostgenerate'
24784 hostosname='$hostosname'
24785 hostperl='$hostperl'
24786 html1dir='$html1dir'
24787 html1direxp='$html1direxp'
24788 html3dir='$html3dir'
24789 html3direxp='$html3direxp'
24798 i_arpainet='$i_arpainet'
24799 i_assert='$i_assert'
24801 i_bsdioctl='$i_bsdioctl'
24805 i_dirent='$i_dirent'
24807 i_execinfo='$i_execinfo'
24812 i_fp_class='$i_fp_class'
24814 i_gdbm_ndbm='$i_gdbm_ndbm'
24815 i_gdbmndbm='$i_gdbmndbm'
24817 i_ieeefp='$i_ieeefp'
24818 i_inttypes='$i_inttypes'
24819 i_langinfo='$i_langinfo'
24820 i_libutil='$i_libutil'
24821 i_limits='$i_limits'
24822 i_locale='$i_locale'
24823 i_machcthr='$i_machcthr'
24824 i_malloc='$i_malloc'
24825 i_mallocmalloc='$i_mallocmalloc'
24827 i_memory='$i_memory'
24828 i_mntent='$i_mntent'
24831 i_neterrno='$i_neterrno'
24832 i_netinettcp='$i_netinettcp'
24836 i_pthread='$i_pthread'
24838 i_quadmath='$i_quadmath'
24839 i_rpcsvcdbm='$i_rpcsvcdbm'
24841 i_shadow='$i_shadow'
24843 i_stdarg='$i_stdarg'
24844 i_stdbool='$i_stdbool'
24845 i_stddef='$i_stddef'
24846 i_stdint='$i_stdint'
24847 i_stdlib='$i_stdlib'
24848 i_string='$i_string'
24849 i_sunmath='$i_sunmath'
24850 i_sysaccess='$i_sysaccess'
24851 i_sysdir='$i_sysdir'
24852 i_sysfile='$i_sysfile'
24853 i_sysfilio='$i_sysfilio'
24855 i_sysioctl='$i_sysioctl'
24856 i_syslog='$i_syslog'
24857 i_sysmman='$i_sysmman'
24858 i_sysmode='$i_sysmode'
24859 i_sysmount='$i_sysmount'
24860 i_sysndir='$i_sysndir'
24861 i_sysparam='$i_sysparam'
24862 i_syspoll='$i_syspoll'
24863 i_sysresrc='$i_sysresrc'
24864 i_syssecrt='$i_syssecrt'
24865 i_sysselct='$i_sysselct'
24866 i_syssockio='$i_syssockio'
24867 i_sysstat='$i_sysstat'
24868 i_sysstatfs='$i_sysstatfs'
24869 i_sysstatvfs='$i_sysstatvfs'
24870 i_systime='$i_systime'
24871 i_systimek='$i_systimek'
24872 i_systimes='$i_systimes'
24873 i_systypes='$i_systypes'
24874 i_sysuio='$i_sysuio'
24876 i_sysutsname='$i_sysutsname'
24877 i_sysvfs='$i_sysvfs'
24878 i_syswait='$i_syswait'
24879 i_termio='$i_termio'
24880 i_termios='$i_termios'
24882 i_unistd='$i_unistd'
24885 i_values='$i_values'
24886 i_varargs='$i_varargs'
24887 i_varhdr='$i_varhdr'
24889 ignore_versioned_solibs='$ignore_versioned_solibs'
24890 inc_version_list='$inc_version_list'
24891 inc_version_list_init='$inc_version_list_init'
24895 initialinstalllocation='$initialinstalllocation'
24896 installarchlib='$installarchlib'
24897 installbin='$installbin'
24898 installhtml1dir='$installhtml1dir'
24899 installhtml3dir='$installhtml3dir'
24900 installman1dir='$installman1dir'
24901 installman3dir='$installman3dir'
24902 installprefix='$installprefix'
24903 installprefixexp='$installprefixexp'
24904 installprivlib='$installprivlib'
24905 installscript='$installscript'
24906 installsitearch='$installsitearch'
24907 installsitebin='$installsitebin'
24908 installsitehtml1dir='$installsitehtml1dir'
24909 installsitehtml3dir='$installsitehtml3dir'
24910 installsitelib='$installsitelib'
24911 installsiteman1dir='$installsiteman1dir'
24912 installsiteman3dir='$installsiteman3dir'
24913 installsitescript='$installsitescript'
24914 installstyle='$installstyle'
24915 installusrbinperl='$installusrbinperl'
24916 installvendorarch='$installvendorarch'
24917 installvendorbin='$installvendorbin'
24918 installvendorhtml1dir='$installvendorhtml1dir'
24919 installvendorhtml3dir='$installvendorhtml3dir'
24920 installvendorlib='$installvendorlib'
24921 installvendorman1dir='$installvendorman1dir'
24922 installvendorman3dir='$installvendorman3dir'
24923 installvendorscript='$installvendorscript'
24925 issymlink='$issymlink'
24926 ivdformat='$ivdformat'
24929 known_extensions='$known_extensions'
24932 ld_can_script='$ld_can_script'
24933 lddlflags='$lddlflags'
24935 ldflags_uselargefiles='$ldflags_uselargefiles'
24936 ldlibpthname='$ldlibpthname'
24943 libsdirs='$libsdirs'
24944 libsfiles='$libsfiles'
24945 libsfound='$libsfound'
24946 libspath='$libspath'
24947 libswanted='$libswanted'
24948 libswanted_uselargefiles='$libswanted_uselargefiles'
24954 localtime_r_proto='$localtime_r_proto'
24955 locincpth='$locincpth'
24956 loclibpth='$loclibpth'
24957 longdblinfbytes='$longdblinfbytes'
24958 longdblkind='$longdblkind'
24959 longdblmantbits='$longdblmantbits'
24960 longdblnanbytes='$longdblnanbytes'
24961 longdblsize='$longdblsize'
24962 longlongsize='$longlongsize'
24963 longsize='$longsize'
24967 lseeksize='$lseeksize'
24968 lseektype='$lseektype'
24972 make_set_make='$make_set_make'
24973 mallocobj='$mallocobj'
24974 mallocsrc='$mallocsrc'
24975 malloctype='$malloctype'
24977 man1direxp='$man1direxp'
24980 man3direxp='$man3direxp'
24982 mips_type='$mips_type'
24983 mistrustnm='$mistrustnm'
24985 mmaptype='$mmaptype'
24986 modetype='$modetype'
24988 multiarch='$multiarch'
24990 myarchname='$myarchname'
24991 mydomain='$mydomain'
24992 myhostname='$myhostname'
24995 need_va_copy='$need_va_copy'
24996 netdb_hlen_type='$netdb_hlen_type'
24997 netdb_host_type='$netdb_host_type'
24998 netdb_name_type='$netdb_name_type'
24999 netdb_net_type='$netdb_net_type'
25002 nm_so_opt='$nm_so_opt'
25003 nonxs_ext='$nonxs_ext'
25005 nvEUformat='$nvEUformat'
25006 nvFUformat='$nvFUformat'
25007 nvGUformat='$nvGUformat'
25008 nv_overflows_integers_at='$nv_overflows_integers_at'
25009 nv_preserves_uv_bits='$nv_preserves_uv_bits'
25010 nveformat='$nveformat'
25011 nvfformat='$nvfformat'
25012 nvgformat='$nvgformat'
25013 nvmantbits='$nvmantbits'
25016 o_nonblock='$o_nonblock'
25018 old_pthread_create_joinable='$old_pthread_create_joinable'
25019 optimize='$optimize'
25020 orderlib='$orderlib'
25023 otherlibdirs='$otherlibdirs'
25027 patchlevel='$patchlevel'
25028 path_sep='$path_sep'
25031 perl_patchlevel='$perl_patchlevel'
25032 perl_static_inline='$perl_static_inline'
25033 perladmin='$perladmin'
25034 perllibs='$perllibs'
25035 perlpath='$perlpath'
25037 phostname='$phostname'
25043 prefixexp='$prefixexp'
25045 privlibexp='$privlibexp'
25046 procselfexe='$procselfexe'
25047 prototype='$prototype'
25049 quadkind='$quadkind'
25050 quadtype='$quadtype'
25051 randbits='$randbits'
25052 randfunc='$randfunc'
25053 random_r_proto='$random_r_proto'
25054 randseedtype='$randseedtype'
25056 rd_nodata='$rd_nodata'
25057 readdir64_r_proto='$readdir64_r_proto'
25058 readdir_r_proto='$readdir_r_proto'
25059 revision='$revision'
25065 sGMTIME_max='$sGMTIME_max'
25066 sGMTIME_min='$sGMTIME_min'
25067 sLOCALTIME_max='$sLOCALTIME_max'
25068 sLOCALTIME_min='$sLOCALTIME_min'
25069 sPRIEUldbl='$sPRIEUldbl'
25070 sPRIFUldbl='$sPRIFUldbl'
25071 sPRIGUldbl='$sPRIGUldbl'
25072 sPRIXU64='$sPRIXU64'
25074 sPRIeldbl='$sPRIeldbl'
25075 sPRIfldbl='$sPRIfldbl'
25076 sPRIgldbl='$sPRIgldbl'
25081 sSCNfldbl='$sSCNfldbl'
25082 sched_yield='$sched_yield'
25083 scriptdir='$scriptdir'
25084 scriptdirexp='$scriptdirexp'
25086 seedfunc='$seedfunc'
25087 selectminbits='$selectminbits'
25088 selecttype='$selecttype'
25089 sendmail='$sendmail'
25090 setgrent_r_proto='$setgrent_r_proto'
25091 sethostent_r_proto='$sethostent_r_proto'
25092 setlocale_r_proto='$setlocale_r_proto'
25093 setnetent_r_proto='$setnetent_r_proto'
25094 setprotoent_r_proto='$setprotoent_r_proto'
25095 setpwent_r_proto='$setpwent_r_proto'
25096 setservent_r_proto='$setservent_r_proto'
25099 sharpbang='$sharpbang'
25100 shmattype='$shmattype'
25101 shortsize='$shortsize'
25104 sig_count='$sig_count'
25105 sig_name='$sig_name'
25106 sig_name_init='$sig_name_init'
25108 sig_num_init='$sig_num_init'
25109 sig_size='$sig_size'
25110 signal_t='$signal_t'
25111 sitearch='$sitearch'
25112 sitearchexp='$sitearchexp'
25114 sitebinexp='$sitebinexp'
25115 sitehtml1dir='$sitehtml1dir'
25116 sitehtml1direxp='$sitehtml1direxp'
25117 sitehtml3dir='$sitehtml3dir'
25118 sitehtml3direxp='$sitehtml3direxp'
25120 sitelib_stem='$sitelib_stem'
25121 sitelibexp='$sitelibexp'
25122 siteman1dir='$siteman1dir'
25123 siteman1direxp='$siteman1direxp'
25124 siteman3dir='$siteman3dir'
25125 siteman3direxp='$siteman3direxp'
25126 siteprefix='$siteprefix'
25127 siteprefixexp='$siteprefixexp'
25128 sitescript='$sitescript'
25129 sitescriptexp='$sitescriptexp'
25130 sizesize='$sizesize'
25131 sizetype='$sizetype'
25135 sockethdr='$sockethdr'
25136 socketlib='$socketlib'
25137 socksizetype='$socksizetype'
25139 spackage='$spackage'
25140 spitshell='$spitshell'
25141 srand48_r_proto='$srand48_r_proto'
25142 srandom_r_proto='$srandom_r_proto'
25144 ssizetype='$ssizetype'
25145 st_ino_sign='$st_ino_sign'
25146 st_ino_size='$st_ino_size'
25147 startperl='$startperl'
25149 static_ext='$static_ext'
25151 stdio_base='$stdio_base'
25152 stdio_bufsiz='$stdio_bufsiz'
25153 stdio_cnt='$stdio_cnt'
25154 stdio_filbuf='$stdio_filbuf'
25155 stdio_ptr='$stdio_ptr'
25156 stdio_stream_array='$stdio_stream_array'
25157 strerror_r_proto='$strerror_r_proto'
25160 subversion='$subversion'
25165 targetarch='$targetarch'
25166 targetdir='$targetdir'
25167 targetenv='$targetenv'
25168 targethost='$targethost'
25169 targetmkdir='$targetmkdir'
25170 targetport='$targetport'
25171 targetsh='$targetsh'
25175 timeincl='$timeincl'
25176 timetype='$timetype'
25177 tmpnam_r_proto='$tmpnam_r_proto'
25183 ttyname_r_proto='$ttyname_r_proto'
25192 uidformat='$uidformat'
25198 uquadtype='$uquadtype'
25199 use5005threads='$use5005threads'
25200 use64bitall='$use64bitall'
25201 use64bitint='$use64bitint'
25202 usecbacktrace='$usecbacktrace'
25203 usecrosscompile='$usecrosscompile'
25204 usedevel='$usedevel'
25206 usedtrace='$usedtrace'
25207 usefaststdio='$usefaststdio'
25208 useithreads='$useithreads'
25209 usekernprocpathname='$usekernprocpathname'
25210 uselargefiles='$uselargefiles'
25211 uselongdouble='$uselongdouble'
25212 usemallocwrap='$usemallocwrap'
25213 usemorebits='$usemorebits'
25214 usemultiplicity='$usemultiplicity'
25215 usemymalloc='$usemymalloc'
25217 usensgetexecutablepath='$usensgetexecutablepath'
25218 useopcode='$useopcode'
25219 useperlio='$useperlio'
25220 useposix='$useposix'
25221 usequadmath='$usequadmath'
25222 usereentrant='$usereentrant'
25223 userelocatableinc='$userelocatableinc'
25224 useshrplib='$useshrplib'
25225 usesitecustomize='$usesitecustomize'
25226 usesocks='$usesocks'
25227 usethreads='$usethreads'
25228 usevendorprefix='$usevendorprefix'
25229 useversionedarchname='$useversionedarchname'
25230 usevfork='$usevfork'
25233 uvXUformat='$uvXUformat'
25234 uvoformat='$uvoformat'
25237 uvuformat='$uvuformat'
25238 uvxformat='$uvxformat'
25240 vendorarch='$vendorarch'
25241 vendorarchexp='$vendorarchexp'
25242 vendorbin='$vendorbin'
25243 vendorbinexp='$vendorbinexp'
25244 vendorhtml1dir='$vendorhtml1dir'
25245 vendorhtml1direxp='$vendorhtml1direxp'
25246 vendorhtml3dir='$vendorhtml3dir'
25247 vendorhtml3direxp='$vendorhtml3direxp'
25248 vendorlib='$vendorlib'
25249 vendorlib_stem='$vendorlib_stem'
25250 vendorlibexp='$vendorlibexp'
25251 vendorman1dir='$vendorman1dir'
25252 vendorman1direxp='$vendorman1direxp'
25253 vendorman3dir='$vendorman3dir'
25254 vendorman3direxp='$vendorman3direxp'
25255 vendorprefix='$vendorprefix'
25256 vendorprefixexp='$vendorprefixexp'
25257 vendorscript='$vendorscript'
25258 vendorscriptexp='$vendorscriptexp'
25260 version_patchlevel_string='$version_patchlevel_string'
25261 versiononly='$versiononly'
25265 yaccflags='$yaccflags'
25270 : add special variables
25271 $test -f $src/patchlevel.h && \
25272 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
25273 echo "PERL_PATCHLEVEL='$perl_patchlevel'" >>config.sh
25274 echo "PERL_CONFIG_SH=true" >>config.sh
25276 : propagate old symbols
25277 if $test -f UU/config.sh; then
25278 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
25279 $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \
25280 config.sh config.sh UU/oldconfig.sh |\
25281 $sort | $uniq -u >UU/oldsyms
25282 set X `$cat UU/oldsyms`
25288 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
25290 echo ": Variables propagated from previous config.sh file." >>config.sh
25291 for sym in `$cat UU/oldsyms`; do
25292 echo " Propagating $hint variable "'$'"$sym..."
25293 eval 'tmp="$'"${sym}"'"'
25295 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
25301 : preserve RCS keywords in files with variable substitution, grrr
25304 : Finish up by extracting the .SH files
25308 echo "Extraction done."
25318 If you'd like to make any changes to the config.sh file before I begin
25319 to configure things, do it as a shell escape now (e.g. !vi config.sh).
25322 rp="Press return or use a shell escape to edit config.sh:"
25327 *) : in case they cannot read
25328 sh 1>&4 -c "$ans";;
25333 : if this fails, just run all the .SH files by hand
25342 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
25349 Now you need to generate make dependencies by running "$make depend".
25350 You might prefer to run it in background: "$make depend > makedepend.out &"
25351 It can take a while, so you might not want to run it right now.
25356 rp="Run $make depend now?"
25360 $make depend && echo "Now you must run '$make'."
25363 echo "You must run '$make depend' then '$make'."
25366 elif test -f [Mm]akefile; then
25368 echo "Now you must run a $make."
25370 echo "Configure done."
25373 if $test -f Policy.sh; then
25376 If you compile $package on a different machine or from a different object
25377 directory, copy the Policy.sh file from this object directory to the
25378 new one before you run Configure -- this will help you with most of
25379 the policy defaults.
25383 if $test -f config.msg; then
25384 echo "Hmm. I also noted the following information while running:"
25386 $cat config.msg >&4
25389 $rm -f kit*isdone ark*isdone