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=''
703 d_old_pthread_create_joinable=''
704 old_pthread_create_joinable=''
706 d_pthread_attr_setscope=''
754 sethostent_r_proto=''
771 setprotoent_r_proto=''
783 setservent_r_proto=''
796 d_siginfo_si_errno=''
799 d_siginfo_si_status=''
801 d_siginfo_si_value=''
813 d_ipv6_mreq_source=''
830 d_sprintf_returns_strlen=''
843 perl_static_inline=''
848 d_stdio_ptr_lval_nochange_cnt=''
849 d_stdio_ptr_lval_sets_cnt=''
1003 d_gdbm_ndbm_h_uses_prototypes=''
1004 d_gdbmndbm_h_uses_prototypes=''
1006 d_ndbm_h_uses_prototypes=''
1082 d_inc_version_list=''
1084 inc_version_list_init=''
1092 installusrbinperl=''
1108 ignore_versioned_solibs=''
1172 d_perl_otherlibdirs=''
1180 api_versionstring=''
1186 version_patchlevel_string=''
1190 d_nv_preserves_uv=''
1191 d_nv_zero_is_allbits_zero=''
1202 nv_overflows_integers_at=''
1203 nv_preserves_uv_bits=''
1276 installsitehtml1dir=''
1279 installsitehtml3dir=''
1286 installsiteman1dir=''
1289 installsiteman3dir=''
1294 installsitescript=''
1312 d_stdio_stream_array=''
1313 stdio_stream_array=''
1331 usekernprocpathname=''
1332 ccflags_uselargefiles=''
1333 ldflags_uselargefiles=''
1334 libswanted_uselargefiles=''
1343 usensgetexecutablepath=''
1357 installvendorarch=''
1364 installvendorhtml1dir=''
1366 vendorhtml1direxp=''
1367 installvendorhtml3dir=''
1369 vendorhtml3direxp=''
1375 installvendorman1dir=''
1378 installvendorman3dir=''
1385 installvendorscript=''
1396 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1399 : We must find out about Eunice early
1401 if test -f /etc/unixtovms; then
1402 eunicefix=/etc/unixtovms
1404 if test -f /etc/unixtovms.exe; then
1405 eunicefix=/etc/unixtovms.exe
1408 : Set executable suffix now -- needed before hints available
1409 if test -f "/libs/version.library"; then
1412 elif test -f "/system/gnu_library/bin/ar.pm"; then
1415 elif test -n "$DJGPP"; then
1418 elif test -f /kern/cookiejar; then
1421 elif test -d c:/. -o -n "$is_os2" ; then
1428 : Possible local include directories to search.
1429 : Set locincpth to "" in a hint file to defeat local include searches.
1430 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1431 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1433 : no include file wanted by default
1436 : Enable -DEBUGGING and -DDEBUGGING from the command line
1440 : Trailing extension. Override this in a hint file, if needed.
1441 : Extra object files, if any, needed on this platform.
1444 : change the next line if compiling for Xenix/286 on Xenix/386
1445 xlibpth='/usr/lib/386 /lib/386'
1446 : Possible local library directories to search.
1447 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1448 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1450 : general looking path for locating libraries
1451 glibpth="/lib /usr/lib $xlibpth"
1452 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1453 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1454 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1455 test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
1457 : Private path used by Configure to find libraries. Its value
1458 : is prepended to libpth. This variable takes care of special
1459 : machines, like the mips. Usually, it should be empty.
1462 : default library list
1464 : some systems want to use only the non-versioned libso:s
1465 ignore_versioned_solibs=''
1469 : set useposix=false in your hint file to disable the POSIX extension.
1471 : set useopcode=false in your hint file to disable the Opcode extension.
1474 ccflags_uselargefiles=''
1475 ldflags_uselargefiles=''
1476 libswanted_uselargefiles=''
1477 : set usemultiplicity on the Configure command line to enable multiplicity.
1478 : set usesocks on the Configure command line to enable socks.
1480 : set usethreads on the Configure command line to enable threads.
1481 usereentrant='undef'
1482 : List of libraries we want.
1483 : If anyone needs extra -lxxx, put those in a hint file.
1484 libswanted="cl pthread socket bind inet nsl ndbm gdbm dbm db malloc dl ld"
1485 libswanted="$libswanted sun m crypt sec util c cposix posix ucb bsd BSD"
1486 : We probably want to search /usr/shlib before most other libraries.
1487 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1488 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1489 glibpth="/usr/shlib $glibpth"
1490 : Do not use vfork unless overridden by a hint file.
1493 : Find the basic shell for Bourne shell scripts
1497 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1500 if test -f "$xxx"; then
1503 : Build up a list and do a single loop so we can 'break' out.
1504 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1505 for xxx in sh bash ksh pdksh ash; do
1507 try="$try ${p}/${xxx}"
1511 if test -f "$xxx"; then
1514 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1517 elif test -f "$xxx.exe"; then
1528 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1530 Usually it's in /bin/sh. How did you even get this far?
1531 Please contact me (Perl Maintainers) at perlbug@perl.org and
1532 we'll try to straighten this all out.
1538 : When cross-compiling we need to separate the sh-to-run-Configure-with from the sh-to-use-in-Perl
1539 : default both to the same thing, cross-compilers can then set targetsh differently if they like
1542 : see if sh knows # comments
1543 if `$sh -c '#' >/dev/null 2>&1`; then
1547 test -f $xcat$_exe || xcat=/usr/bin/cat
1548 if test ! -f $xcat$_exe; then
1549 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1550 if test -f $p/cat$_exe; then
1555 if test ! -f $xcat$_exe; then
1556 echo "Can't find cat anywhere!"
1560 echo "#!$xcat" >sharp
1563 ./sharp > today 2>/dev/null
1564 if test -s today; then
1567 echo "#! $xcat" > sharp
1570 ./sharp > today 2>/dev/null
1571 if test -s today; then
1579 echo "Your $sh doesn't grok # comments--I will strip them later on."
1582 echo "exec grep -v '^[ ]*#'" >spitshell
1584 $eunicefix spitshell
1585 spitshell=`pwd`/spitshell
1587 echo "I presume that if # doesn't work, #! won't work either!"
1592 : figure out how to guarantee sh startup
1594 '') startsh=${sharpbang}${sh} ;;
1606 : echo "Yup, it does."
1608 echo "Hmm... '$startsh' does not guarantee sh startup..."
1609 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1613 : Save command line options in file UU/cmdline.opt for later use in
1614 : generating config.sh.
1615 cat > cmdline.opt <<EOSH
1616 : Configure command line arguments.
1625 cat >>cmdline.opt <<EOSH
1626 config_arg$argn='$arg'
1628 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1631 arg_exp=`cat cmdl.opt`
1632 args_exp="$args_exp$args_sep'$arg_exp'"
1633 argn=`expr $argn + 1`
1638 : produce awk script to parse command line options
1639 cat >options.awk <<'EOF'
1641 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1643 len = length(optstr);
1644 for (i = 1; i <= len; i++) {
1645 c = substr(optstr, i, 1);
1646 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1657 if (substr(str, 1, 1) != "-") {
1658 printf("'%s'\n", str);
1662 for (i = 2; i <= len; i++) {
1663 c = substr(str, i, 1);
1665 printf("-%s\n", substr(str, i));
1671 printf("'%s'\n", substr(str, i + 1));
1684 : process the command line options
1685 set X `for arg in "$@"; do echo "X$arg"; done |
1686 sed -e s/X// | awk -f options.awk`
1691 : set up default values
1700 rm -f optdef.sh posthint.sh
1701 cat >optdef.sh <<EOS
1707 while test $# -gt 0; do
1709 -d) shift; fastread=yes;;
1710 -e) shift; alldone=cont;;
1714 if test -r "$1"; then
1717 echo "$me: cannot read config file $1." >&2
1723 -h) shift; error=true;;
1724 -r) shift; reuseval=true;;
1725 -s) shift; silent=true; realsilent=true;;
1726 -E) shift; alldone=exit;;
1727 -K) shift; knowitall=true;;
1729 -S) shift; silent=true; extractsh=true;;
1734 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1735 echo "$me: ignoring -D $1" >&2
1738 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1739 *) echo "$1='define'" >> optdef.sh;;
1746 *=) echo "$1" >> optdef.sh;;
1748 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1749 echo "$me: ignoring -U $1" >&2
1751 *) echo "$1='undef'" >> optdef.sh;;
1762 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1766 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1767 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1773 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1774 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1775 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1776 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1777 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1778 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1784 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1786 echo "$yyy=''" >> posthint.sh ;;
1791 echo "$yyy='$zzz'" >> posthint.sh ;;
1793 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1795 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1800 echo "$yyy=$zzz" >> posthint.sh ;;
1801 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1805 -V) echo "$me generated by metaconfig 3.5 PL0." >&2
1808 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1816 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1817 [-U symbol] [-U symbol=] [-A command:symbol...]
1818 -d : use defaults for all answers.
1819 -e : go on without questioning past the production of config.sh.
1820 -f : specify an alternate default configuration file.
1821 -h : print this help message and exit (with an error status).
1822 -r : reuse C symbols value if possible (skips costly nm extraction).
1823 -s : silent mode, only echoes questions and essential information.
1824 -D : define symbol to have some value:
1825 -D symbol symbol gets the value 'define'
1826 -D symbol=value symbol gets the value 'value'
1827 common used examples (see INSTALL for more info):
1828 -Duse64bitint use 64bit integers
1829 -Duse64bitall use 64bit integers and pointers
1830 -Dusethreads use thread support
1831 -Dinc_version_list=none do not include older perl trees in @INC
1832 -DEBUGGING=none DEBUGGING options
1833 -Dcc=gcc choose your compiler
1834 -Dprefix=/opt/perl5 choose your destination
1835 -E : stop at the end of questions, after having produced config.sh.
1836 -K : do not use unless you know what you are doing.
1837 -O : ignored for backward compatibility
1838 -S : perform variable substitutions on all .SH files (can mix with -f)
1839 -U : undefine symbol:
1840 -U symbol symbol gets the value 'undef'
1841 -U symbol= symbol gets completely empty
1843 -A : manipulate symbol after the platform specific hints have been applied:
1844 -A append:symbol=value append value to symbol
1845 -A symbol=value like append:, but with a separating space
1846 -A define:symbol=value define symbol to have value
1847 -A clear:symbol define symbol to be ''
1848 -A define:symbol define symbol to be 'define'
1849 -A eval:symbol=value define symbol to be eval of value
1850 -A prepend:symbol=value prepend value to symbol
1851 -A undef:symbol define symbol to be 'undef'
1852 -A undef:symbol= define symbol to be ''
1853 e.g.: -A prepend:libswanted='cl pthread '
1854 -A ccflags=-DSOME_MACRO
1855 -V : print version number and exit (with a zero status).
1862 case "$fastread$alldone" in
1865 case "$extractsh" in
1868 if test ! -t 0; then
1869 echo "Say 'sh Configure', not 'sh <Configure'"
1879 true) exec 1>/dev/null;;
1882 : run the defines and the undefines, if any, but leave the file out there...
1884 grep '\\' optdef.sh >/dev/null 2>&1
1885 if test $? = 0; then
1886 echo "Configure does not support \\ in -D arguments"
1890 : create the posthint manipulation script and leave the file out there...
1895 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1896 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1897 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`"-"`echo AbyZ | tr '[:upper:]' '[:lower:]' 2>/dev/null`" in
1898 ABYZ-abyz) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1899 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1902 : Some greps do not return status, grrr.
1903 echo "grimblepritz" >grimble
1904 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1906 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1912 : the following should work in any shell
1916 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1917 cat >contains <<'EOSS'
1918 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1923 : Find the path to the source tree
1926 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1930 *) src=`cd ../$src && pwd` ;;
1943 if test -f $rsrc/Configure && \
1944 $contains "^package='$package'\$" $rsrc/Configure >/dev/null 2>&1
1946 : found it, so we are ok.
1949 for src in . .. ../.. ../../.. ../../../..; do
1950 if test -f ../$src/Configure && \
1951 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1962 Sorry, I can't seem to locate the source dir for $package. Please start
1963 Configure with an explicit path -- i.e. /some/path/Configure.
1971 echo "Sources for $package found in \"$src\"." >&4
1975 : script used to extract .SH files with variable substitutions
1976 cat >extract <<'EOS'
1978 echo "Doing variable substitutions on .SH files..."
1979 if test -f MANIFEST; then
1980 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1982 echo "(Looking for .SH files under the source directory.)"
1983 set x `(cd "$src"; find . -name "*.SH" -print)`
1987 0) set x `(cd "$src"; echo *.SH)`; shift;;
1989 if test ! -f "$src/$1"; then
1995 while test $name; do
1996 if test ! -d "$name"; then
1997 create="$name $create";
1998 name=`echo $name | sed -e "s|^[^/]*$||"`;
1999 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
2004 for file in $create; do
2013 dir=`expr X$file : 'X\(.*\)/'`
2014 file=`expr X$file : 'X.*/\(.*\)'`
2015 (cd "$dir" && . ./$file)
2025 dir=`expr X$file : 'X\(.*\)/'`
2026 file=`expr X$file : 'X.*/\(.*\)'`
2027 (set x $dir; shift; eval $mkdir_p)
2028 sh <"$src/$dir/$file"
2037 if test -f "$src/config_h.SH"; then
2038 if test ! -f config.h; then
2039 : oops, they left it out of MANIFEST, probably, so do it anyway.
2040 . "$src/config_h.SH"
2045 : extract files and exit if asked to do so
2046 case "$extractsh" in
2048 case "$realsilent" in
2052 case "$config_sh" in
2053 '') config_sh='config.sh';;
2056 echo "Fetching answers from $config_sh..."
2063 echo "Extraction done."
2068 : Eunice requires " " instead of "", can you believe it
2071 echo "Beginning of configuration questions for $package."
2073 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
2075 : first determine how to suppress newline on echo command
2077 echo "Checking echo to see how to suppress newlines..."
2078 (echo "hi there\c" ; echo " ") >.echotmp
2079 if $contains c .echotmp >/dev/null 2>&1 ; then
2090 echo $n "The star should be here-->$c"
2094 : Now test for existence of everything in MANIFEST
2096 if test -f "$rsrc/MANIFEST"; then
2097 echo "First let's make sure your kit is complete. Checking..." >&4
2098 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | \
2099 (split -l 50 2>/dev/null || split -50)
2102 for filelist in x??; do
2103 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` \
2104 >/dev/null 2>>"$tmppwd/missing")
2106 if test -s missing; then
2110 THIS PACKAGE SEEMS TO BE INCOMPLETE.
2112 You have the option of continuing the configuration process, despite the
2113 distinct possibility that your kit is damaged, by typing 'y'es. If you
2114 do, don't blame me if something goes wrong. I advise you to type 'n'o
2115 and contact the author (perlbug@perl.org).
2118 echo $n "Continue? [n] $c" >&4
2122 echo "Continuing..." >&4
2126 echo "ABORTING..." >&4
2131 echo "Looks good..."
2134 echo "There is no MANIFEST file. I hope your kit is complete !"
2138 : Find the appropriate value for a newline for tr
2139 if test -n "$DJGPP"; then
2142 if test X"$trnl" = X; then
2143 case "`echo foo | tr '\n' x 2>/dev/null`" in
2147 if test X"$trnl" = X; then
2148 case "`echo foo | tr '\012' x 2>/dev/null`" in
2149 foox) trnl='\012' ;;
2152 if test X"$trnl" = X; then
2153 case "`echo foo | tr '\r\n' xy 2>/dev/null`" in
2154 fooxy) trnl='\n\r' ;;
2157 if test X"$trnl" = X; then
2160 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
2166 : compute the number of columns on the terminal for proper question formatting
2171 : set up the echo used in my read
2172 myecho="case \"\$xxxm\" in
2173 '') echo $n \"\$rp $c\" >&4;;
2175 '') echo $n \"[\$xxxm] $c\";;
2177 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
2179 echo $n \"[\$xxxm] $c\" >&4
2181 echo $n \"\$rp [\$xxxm] $c\" >&4
2187 : now set up to do reads with possible shell escape and default assignment
2193 case "\$fastread" in
2194 yes) case "\$dflt" in
2197 case "\$silent-\$rp" in
2202 *) case "\$silent" in
2203 true) case "\$rp" in
2208 while expr "X\$ans" : "X!" >/dev/null; do
2212 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2220 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2229 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2234 echo "(OK, I'll run with -d after this question.)" >&4
2237 echo "*** Sorry, \$1 not supported yet." >&4
2247 echo "*** Substitution done -- please confirm."
2249 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2254 echo "*** Error -- try again."
2261 case "\$ans\$xxxm\$nostick" in
2273 : create .config dir to save info across Configure sessions
2274 test -d ../.config || mkdir ../.config
2275 cat >../.config/README <<EOF
2276 This directory created by Configure to save information that should
2277 persist across sessions for $package.
2279 You may safely delete it if you wish.
2282 : See if we are using a devel version and want that
2283 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2286 usedevel="$define" ;;
2287 *) case "$xversion" in
2290 *** WHOA THERE!!! ***
2292 This is an UNSTABLE DEVELOPMENT release.
2293 The version of this $package distribution is $xversion, that is, odd,
2294 (as opposed to even) and that signifies a development release.
2295 If you want a maintenance release, you want an even-numbered version.
2297 Do ***NOT*** install this into production use.
2298 Data corruption and crashes are possible.
2300 It is most seriously suggested that you do not continue any further
2301 unless you want to help in developing and debugging Perl.
2303 If you *still* want to build perl, you can answer 'y' now,
2304 or pass -Dusedevel to Configure.
2307 rp='Do you really want to continue?'
2311 [yY]) echo >&4 "Okay, continuing."
2312 usedevel="$define" ;;
2313 *) echo >&4 "Okay, bye."
2324 case "$versiononly" in
2325 '') versiononly="$define" ;;
2327 case "$installusrbinperl" in
2328 '') installusrbinperl="$undef" ;;
2333 : general instructions
2336 user=`(logname) 2>/dev/null`
2338 '') user=`whoami 2>&1`;;
2340 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2343 rp='Would you like to see the instructions?'
2354 This installation shell script will examine your system and ask you questions
2355 to determine how the perl5 package should be installed. If you get
2356 stuck on a question, you may use a ! shell escape to start a subshell or
2357 execute a command. Many of the questions will have default answers in square
2358 brackets; typing carriage return will give you the default.
2360 On some of the questions which ask for file or directory names you are allowed
2361 to use the ~name construct to specify the login directory belonging to "name",
2362 even if you don't have a shell which knows about that. Questions where this is
2363 allowed will be marked "(~name ok)".
2367 dflt='Type carriage return to continue'
2371 The prompter used in this script allows you to use shell variables and
2372 backticks in your answers. You may use $1, $2, etc... to refer to the words
2373 in the default answer, as if the default line was a set of arguments given to a
2374 script shell. This means you may also use $* to repeat the whole default line,
2375 so you do not have to re-type everything to add something to the default.
2377 Every time there is a substitution, you will have to confirm. If there is an
2378 error (e.g. an unmatched backtick), the default answer will remain unchanged
2379 and you will be prompted again.
2381 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2382 the questions and use the computed defaults (or the previous answers if there
2383 was already a config.sh file). Type 'Configure -h' for a list of options.
2384 You may also start interactively and then answer '& -d' at any prompt to turn
2385 on the non-interactive behaviour for the remainder of the execution.
2391 Much effort has been expended to ensure that this shell script will run on any
2392 Unix system. If despite that it blows up on yours, your best bet is to edit
2393 Configure and run it again. If you can't run Configure for some reason,
2394 you'll have to generate a config.sh file by hand. Whatever problems you
2395 have, let me (perlbug@perl.org) know how I blew it.
2397 This installation script affects things in two ways:
2399 1) it may do direct variable substitutions on some of the files included
2401 2) it builds a config.h file for inclusion in C programs. You may edit
2402 any of these files as the need arises after running this script.
2404 If you make a mistake on a question, there is no easy way to back up to it
2405 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2406 files. Configure will offer to let you do this before it runs the SH files.
2409 dflt='Type carriage return to continue'
2411 case "$firsttime" in
2412 true) echo $user >>../.config/instruct;;
2416 : Set 'sysroot' to change the logical root directory to your headers and libraries see man gcc
2417 : This is primarily meant for cross-compile environments, and may fail to be useful in other cases
2418 if test "X$sysroot" = X; then
2423 echo "Using $sysroot to find your headers and libraries, adding to ccflags"
2424 # _sysroot is used in places where we need --sysroot=foo
2425 # but using the rest of the flags could cause issues.
2426 _sysroot="--sysroot=$sysroot";
2430 ccflags="$ccflags $_sysroot"
2435 ldflags="$ldflags $_sysroot"
2440 cppflags="$cppflags $_sysroot"
2442 # lddlflags updated below in lddlflags section;
2443 # same with cccdlflags
2447 # Adjust some defaults to also use $sysroot
2448 for var in xlibpth loclibpth locincpth glibpth; do
2451 for path in $xxx; do
2452 eval $var=\"\$$var $sysroot$path\"
2458 : find out where common programs are
2460 echo "Locating common programs..." >&4
2473 if test -d \$dir/\$thing; then
2479 for thisthing in \$dir/\$thing; do
2480 : just loop through to pick last item
2482 if test -f \$thisthing; then
2485 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2488 elif test -f \$dir/\$thing.exe; then
2489 if test -n "$DJGPP"; then
2490 echo \$dir/\$thing.exe
2491 elif test "$eunicefix" != ":"; then
2492 : on Eunice apparently
2545 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2546 pth="$pth $sysroot/lib $sysroot/usr/lib"
2547 for file in $loclist; do
2551 if test -f "$xxx"; then
2554 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2555 xxx=`./loc $file $file $pth`
2558 '') xxx=`./loc $file $file $pth`;;
2559 *) xxx=`./loc $xxx $xxx $pth`;;
2561 eval $file=$xxx$_exe
2565 echo $file is in $xxx.
2568 echo $file is in $xxx.
2571 echo "I don't know where '$file' is, and my life depends on it." >&4
2572 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2578 echo "Don't worry if any of the following aren't found..."
2580 for file in $trylist; do
2584 if test -f "$xxx"; then
2587 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2588 xxx=`./loc $file $file $pth`
2591 '') xxx=`./loc $file $file $pth`;;
2592 *) xxx=`./loc $xxx $xxx $pth`;;
2594 eval $file=$xxx$_exe
2598 echo $file is in $xxx.
2601 echo $file is in $xxx.
2604 echo "I don't see $file out there, $say."
2611 echo "Substituting grep for egrep."
2618 *) if $less -R </dev/null >/dev/null 2>&1; then
2619 echo "Substituting less -R for less."
2627 echo "Substituting cp for ln."
2636 echo "I can't find make or gmake, and my life depends on it." >&4
2637 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2645 *) # We can't have osname yet.
2646 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2647 # Assume that gmake, if found, is definitely GNU make
2648 # and prefer it over the system make.
2649 echo "Substituting gmake for make."
2657 echo "Hopefully test is built into your sh."
2660 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2661 echo "Using the test built into your sh."
2669 echo "Hopefully echo is built into your sh."
2674 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2675 $echo $n "hi there$c" >foo1
2676 echo $n "hi there$c" >foo2
2677 if cmp foo1 foo2 >/dev/null 2>&1; then
2678 echo "They are compatible. In fact, they may be identical."
2685 They are not compatible! You are probably running ksh on a non-USG system.
2686 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2687 have echo built in and we may have to run some Bourne shell scripts. That
2688 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2691 $echo $n "The star should be here-->$c"
2698 # This question was auctioned at YAPC::Europe-2007 in Vienna
2699 # I never promised you could answer it. I only auctioned the question.
2701 The following message is sponsored by
2703 Dresden.pm<--The stars should be here.
2705 Dear Perl user, system administrator or package
2706 maintainer, the Perl community sends greetings to
2707 you. Do you (emblematical) greet back [Y/n]? n
2711 : Check what type of C compiler we use
2715 cat <<'EOSC' >>trygcc
2720 int main(int argc, char *argv[]) {
2724 if $cc -o try $ccflags $ldflags try.c; then
2727 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2733 # Skip this test because it gives a false match on output like:
2734 # ./trygcc: line 23: cc: command not found
2735 # case "`$cc -v -c try.c 2>&1`" in
2736 # *gcc*) trygcc=no ;;
2738 if $test X"$trygcc" = Xyes; then
2739 if gcc -o try -c try.c; then
2741 echo "You seem to have a working gcc, though." >&4
2742 # Switching compilers may undo the work of hints files.
2743 # The most common problem is -D_REENTRANT for threads.
2744 # This heuristic catches that case, but gets false positives
2745 # if -Dusethreads was not actually specified. Better to
2746 # bail out here with a useful message than fail
2747 # mysteriously later. Should we perhaps just try to
2748 # re-invoke Configure -Dcc=gcc config_args ?
2749 if $test -f usethreads.cbu; then
2752 *** However, any setting of the C compiler flags (e.g. for thread support)
2753 *** will be lost. It may be necessary for you to restart Configure and
2754 *** add -Dcc=gcc to your Configure command line.
2757 rp="Would you like to go ahead and try gcc anyway?"
2760 rp="Would you like to use it?"
2763 if $test -f myread; then
2766 if $test -f UU/myread; then
2769 echo "Cannot find myread, sorry. Aborting." >&2
2774 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2787 cat <<'EOSC' >>checkcc
2792 int main(int argc, char *argv[]) {
2796 if $cc -o try $ccflags $ldflags try.c; then
2799 if $test X"$despair" = Xyes; then
2800 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2803 You need to find a working C compiler.
2804 Either (purchase and) install the C compiler supplied by your OS vendor,
2805 or for a free C compiler try http://gcc.gnu.org/
2806 I cannot continue any further, aborting.
2815 : determine whether symbolic links are supported
2818 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2819 echo "Symbolic links are supported." >&4
2822 echo "Symbolic links are NOT supported." >&4
2827 : determine whether symbolic links are supported
2831 echo "Checking how to test for symbolic links..." >&4
2833 if $test "X$issymlink" = X; then
2835 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2836 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2838 if test $? = 0; then
2841 echo "Your builtin 'test -h' may be broken." >&4
2844 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2847 if test -f "$p/$test"; then
2856 echo "Trying external '$test -h'." >&4
2857 issymlink="$test -h"
2858 if $test ! -h sym >/dev/null 2>&1; then
2859 echo "External '$test -h' is broken, too." >&4
2867 if $test "X$issymlink" = X; then
2868 if $test -L sym 2>/dev/null; then
2869 issymlink="$test -L"
2870 echo "The builtin '$test -L' worked." >&4
2873 if $test "X$issymlink" != X; then
2874 echo "You can test for symbolic links with '$issymlink'." >&4
2876 echo "I do not know how you can test for symbolic links." >&4
2880 *) echo "No symbolic links, so not testing for their testing..." >&4
2885 : Make symlinks util
2886 case "$mksymlinks" in
2889 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2892 *) case "$lns:$issymlink" in
2893 *"ln"*" -s:"*"test -"?)
2894 echo "Creating the symbolic links..." >&4
2896 awk '{print $1}' $src/MANIFEST | sed -e 's:/\([^/]*\)$: \1:' |
2906 print "# dir = ", dir, "file = ", file
2907 mf[dir] = mf[dir]" "source"/"dir"/"file;
2910 if (d != ".") { print("mkdir -p "d) }
2911 print("ln -sf "mf[d]" "d);
2913 }' source="$src" > UU/mksymlinks.$$
2917 if test ! -d t/base; then
2918 echo "Failed to create the subdirectories. Aborting." >&4
2922 if test ! -f t/base/lex.t; then
2923 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2926 if test ! -f win32/win32.c; then
2927 echo "Failed to create the symlinks (win32/win32.c missing). Aborting." >&4
2932 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2940 : Check for Cross-Compilation
2941 if $test "X$targethost" = "X"; then
2944 if $test "X$targetenv" = "X"; then
2947 case "$usecrosscompile" in
2949 $echo "Cross-compiling..."
2952 *-gcc*|*-g++*) # A cross-compiling gcc, probably.
2953 # arm-linux-androideabi-gcc -> arm-linux-androideabi
2954 # x86_64-w64-mingw32-gcc.exe -> x86_64-w64-mingw32
2955 targetarch=`$echo $cc|$sed 's/-g[c\+][c\+].*$//'`
2956 ar=`$echo $cc|$sed 's/-g[c\+][c\+]/-ar/'`
2957 # leave out ld, choosing it is more complex
2958 nm=`$echo $cc|$sed 's/-g[c\+][c\+]/-nm/'`
2959 ranlib=`$echo $cc|$sed 's/-g[c\+][c\+]/-ranlib/'`
2960 # We are in a weird spot. Just before us, some values
2961 # were 'saved', to be restored after the hints are
2962 # run. This means that the changes we made to ar,
2963 # nm and ranlib will get reverted.
2964 # To avoid that, we hijack the saving mechanism and
2965 # have it save our new values.
2966 for file in ar nm ranlib; do
2968 eval $file=$xxx$_exe
2973 case "$targetarch" in
2974 '') echo "Targetarch not defined." >&4; croak=y ;;
2975 *) echo "Using targetarch $targetarch." >&4 ;;
2977 case "$targethost" in
2978 '') echo "Targethost not defined." >&4; croak=n ;;
2979 *) echo "Using targethost $targethost." >&4
2984 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2986 : compile a host miniperl and generate_uudmap, unless we got passed them
2987 if $test "X$hostperl" = X; then
2988 echo "Building host miniperl and generate_uudmap binaries" >&4
2996 $src/Configure -des -Dusedevel -Dmksymlinks
2998 case "$hostgenerate" in
2999 '') $make generate_uudmap
3000 hostgenerate=$src/host/generate_uudmap
3002 "$undef") hostgenerate=''
3005 hostperl=$src/host/miniperl
3008 hostosname=`$hostperl -le 'print $^O'`
3011 usecrosscompile="$undef"
3015 : Define -Dtargethost=somecomputer to run compiled tests on another machine
3016 case "$targethost" in
3017 '') echo "Checking for cross-compile" >&4
3018 case "$usecrosscompile$multiarch" in
3019 *$define*) echo "Skipping the try tests in the rest of Configure as no targethost was defined when cross-compiling" >&4
3020 if [ -f Makefile ]; then
3022 echo "Now you must ensure config.sh, config.h and the generated headers exist and run a $make."
3024 echo "Configure done."
3028 *) echo "No targethost for running compiler tests against defined, running locally" >&4
3035 *) echo "Using targethost $targethost." >&4
3037 /*) run=$src/Cross/run
3038 targetmkdir=$src/Cross/mkdir
3040 from=$src/Cross/from
3042 *) pwd=`$test -f ../Configure & cd ..; pwd`
3044 targetmkdir=$pwd/Cross/mkdir
3046 from=$pwd/Cross/from
3049 case "$targetrun" in
3050 '') targetrun=ssh ;;
3055 case "$targetfrom" in
3056 '') targetfrom=scp ;;
3060 from=$from-$targetfrom
3061 case "$targetdir" in
3063 echo "Guessing targetdir $targetdir." >&4
3066 case "$targetuser" in
3068 echo "Guessing targetuser $targetuser." >&4
3071 case "$targetport" in
3073 echo "Guessing targetport $targetport." >&4
3076 case "$targetfrom" in
3080 case "$targetrun" in
3100 '') cwd=$targetdir ;;
3105 $targetrun -p $targetport -l $targetuser $targethost "cd \$cwd && \$env \$exe \$@"
3111 *) echo "Unknown targetrun '$targetrun'" >&4
3115 case "$targetmkdir" in
3117 cat >$targetmkdir <<EOF
3119 $targetrun -p $targetport -l $targetuser $targethost "mkdir -p \$@"
3121 $chmod a+rx $targetmkdir
3123 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
3135 $targetmkdir \`dirname \$f\`
3136 $targetto -P $targetport -r $q \$f $targetuser@$targethost:\$f 2>/dev/null || exit 1
3139 $targetmkdir $targetdir/\`dirname \$f\`
3140 $targetto -P $targetport -r $q \$f $targetuser@$targethost:$targetdir/\$f 2>/dev/null || exit 1
3153 $mkdir -p $targetdir/\`dirname \$f\`
3154 $cp \$f $targetdir/\$f || exit 1
3157 $targetmkdir $targetdir/\`dirname \$f\`
3158 $cp \$f $targetdir/\$f || exit 1
3165 *) echo "Unknown targetto '$targetto'" >&4
3169 case "$targetfrom" in
3176 $targetfrom -P $targetport $q $targetuser@$targethost:$targetdir/\$f . || exit 1
3181 cp) cat >$from <<EOF
3186 cp $targetdir/\$f . || exit 1
3191 *) echo "Unknown targetfrom '$targetfrom'" >&4
3195 if $test ! -f $run; then
3196 echo "Target 'run' script '$run' not found." >&4
3200 if $test ! -f $to; then
3201 echo "Target 'to' script '$to' not found." >&4
3205 if $test ! -f $from; then
3206 echo "Target 'from' script '$from' not found." >&4
3210 if $test ! -f $run -o ! -f $to -o ! -f $from; then
3214 Using '$run' for remote execution,
3215 and '$from' and '$to'
3216 for remote file transfer.
3222 usecrosscompile="$undef"
3227 : see whether [:lower:] and [:upper:] are supported character classes
3229 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`"-"`echo AbyZ | $tr '[:upper:]' '[:lower:]' 2>/dev/null`" in
3231 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
3235 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
3236 # (0xd9 and 0xe2), therefore that is a nice testing point.
3237 if test "X$up" = X -o "X$low" = X; then
3238 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
3244 if test "X$up" = X -o "X$low" = X; then
3245 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
3251 if test "X$up" = X -o "X$low" = X; then
3252 case "`echo RS | od -x 2>/dev/null`" in
3254 echo "Hey, this might be EBCDIC." >&4
3255 if test "X$up" = X -o "X$low" = X; then
3256 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
3257 rs) up='[A-IJ-RS-Z]'
3262 if test "X$up" = X -o "X$low" = X; then
3263 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
3273 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
3275 echo "Using $up and $low to convert case." >&4
3278 echo "I don't know how to translate letters from upper to lower case." >&4
3279 echo "Your tr is not acting any way I know of." >&4
3283 : set up the translation script tr, must be called with ./tr of course
3287 '[A-Z][a-z]') exec $tr '$up' '$low';;
3288 '[a-z][A-Z]') exec $tr '$low' '$up';;
3295 : Try to determine whether config.sh was made on this system
3296 case "$config_sh" in
3298 myuname=`$uname -a 2>/dev/null`
3299 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
3300 # Downcase everything to avoid ambiguity.
3301 # Remove slashes and single quotes so we can use parts of this in
3302 # directory and file names.
3303 # Remove newlines so myuname is sane to use elsewhere.
3304 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
3305 # because the A-Z/a-z are not consecutive.
3306 myuname=`echo $myuname | $sed -e "s,['/],,g" | \
3307 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
3308 newmyuname="$myuname"
3310 case "$knowitall" in
3312 if test -f ../config.sh; then
3313 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3314 eval "`grep myuname= ../config.sh`"
3316 if test "X$myuname" = "X$newmyuname"; then
3324 : Get old answers from old config file if Configure was run on the
3325 : same system, otherwise use the hints.
3328 if test -f config.sh; then
3330 rp="I see a config.sh file. Shall I use it to set the defaults?"
3333 n*|N*) echo "OK, I'll ignore it."
3334 mv config.sh config.sh.old
3335 myuname="$newmyuname"
3337 *) echo "Fetching default answers from your old config.sh file..." >&4
3345 : Older versions did not always set $sh. Catch re-use of such
3355 if test ! -f config.sh; then
3358 First time through, eh? I have some defaults handy for some systems
3359 that need some extra help getting the Configure answers right:
3362 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3364 : Half the following guesses are probably wrong... If you have better
3365 : tests or hints, please send them to perlbug@perl.org
3366 : The metaconfig authors would also appreciate a copy...
3367 $test -f /irix && osname=irix
3368 $test -f /xenix && osname=sco_xenix
3369 $test -f /dynix && osname=dynix
3370 $test -f /dnix && osname=dnix
3371 $test -f /lynx.os && osname=lynxos
3372 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3373 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3374 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3375 $test -f /bin/mips && /bin/mips && osname=mips
3376 $test -d /usr/apollo/bin && osname=apollo
3377 $test -f /etc/saf/_sactab && osname=svr4
3378 $test -d /usr/include/minix && osname=minix && osvers=`$uname -r`
3379 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3380 $test -f /sys/utilities/MultiView && osname=amigaos
3381 if $test -d /MachTen -o -d /MachTen_Folder; then
3383 if $test -x /sbin/version; then
3384 osvers=`/sbin/version | $awk '{print $2}' |
3385 $sed -e 's/[A-Za-z]$//'`
3386 elif $test -x /usr/etc/version; then
3387 osvers=`/usr/etc/version | $awk '{print $2}' |
3388 $sed -e 's/[A-Za-z]$//'`
3394 $test -f /sys/posix.dll &&
3395 $test -f /usr/bin/what &&
3396 set X `/usr/bin/what /sys/posix.dll` &&
3397 $test "$3" = UWIN &&
3401 if $test -f $uname; then
3409 umips) osname=umips ;;
3412 [23]100) osname=mips ;;
3414 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3415 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3418 elif $test -f /etc/kconfig; then
3420 if test "$lns" = "$ln -s"; then
3422 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3424 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3431 if test -n "$DJGPP"; then
3440 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3442 # oslevel can fail with:
3443 # oslevel: Unable to acquire lock.
3444 *not\ found) osvers="$4"."$3" ;;
3445 '<3240'|'<>3240') osvers=3.2.0 ;;
3446 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3447 '=3250'|'>3250') osvers=3.2.5 ;;
3451 bitrig) osname=bitrig
3454 bsd386) osname=bsd386
3457 cygwin*) osname=cygwin
3460 *dc.osx) osname=dcosx
3466 domainos) osname=apollo
3472 dragonfly) osname=dragonfly
3475 dynixptx*) osname=dynixptx
3476 osvers=`echo "$4"|sed 's/^v//'`
3478 freebsd) osname=freebsd
3480 genix) osname=genix ;;
3484 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3497 $test -f /system/lib/libandroid.so && osname=linux-android
3501 netbsd*) osname=netbsd
3504 news-os) osvers="$3"
3506 4*) osname=newsos4 ;;
3510 nonstop-ux) osname=nonstopux ;;
3511 openbsd) osname=openbsd
3517 POSIX-BC | posix-bc ) osname=posix-bc
3520 powerux | power_ux | powermax_os | powermaxos | \
3521 powerunix | power_unix) osname=powerux
3527 solaris) osname=solaris
3529 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3536 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3540 titanos) osname=titanos
3549 ultrix) osname=ultrix
3552 osf1|mls+) case "$5" in
3555 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3558 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3561 hp*) osname=hp_osf1 ;;
3562 mips) osname=mips_osf1 ;;
3565 # UnixWare 7.1.2 is known as Open UNIX 8
3566 openunix|unixware) osname=svr5
3574 $2) case "$osname" in
3578 : svr4.x or possibly later
3588 if test -f /stand/boot ; then
3589 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3590 if test -n "$INITPROG" -a -f "$INITPROG"; then
3591 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3592 if test -n "$isesix"; then
3600 *) if test -f /etc/systemid; then
3602 set `echo $3 | $sed 's/\./ /g'` $4
3603 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3605 elif $test -f $src/hints/sco_$1_$2.sh; then
3607 elif $test -f $src/hints/sco_$1.sh; then
3612 '') : Still unknown. Probably a generic Sys V.
3621 *) case "$osname" in
3622 '') : Still unknown. Probably a generic BSD.
3630 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3631 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3632 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3635 $rm -f UU/kernel.what
3636 elif test -d c:/. -o -n "$is_os2" ; then
3643 case "$targetarch" in
3646 case "$targetarch" in
3648 # Will load qnx.sh, which should change osname to nto
3653 # Catch arm-linux-androideabi, mipsel-linux-android,
3654 # and i686-linux-android
3655 osname=linux-android
3659 # Something like arm-linux-gnueabihf is really just
3666 # XXX perhaps we should just assume
3667 # osvers to be 2, or maybe take the value
3668 # from targetarch. Using $run before the
3669 # hints are run is somewhat icky.
3670 set X `$run $uname -a 2>/dev/null`
3673 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3678 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3685 : Now look for a hint file osname_osvers, unless one has been
3686 : specified already.
3689 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3690 : Also try without trailing minor version numbers.
3691 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3692 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3693 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3694 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3697 *) case "$osvers" in
3700 *) if $test -f $src/hints/$file.sh ; then
3702 elif $test -f $src/hints/$xfile.sh ; then
3704 elif $test -f $src/hints/$xxfile.sh ; then
3706 elif $test -f $src/hints/$xxxfile.sh ; then
3708 elif $test -f $src/hints/$xxxxfile.sh ; then
3710 elif $test -f "$src/hints/${osname}.sh" ; then
3719 if $test -f Policy.sh ; then
3722 none) dflt="Policy" ;;
3723 *) dflt="Policy $dflt" ;;
3728 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3732 if $test -f Policy.sh ; then
3735 There's also a Policy hint file available, which should make the
3736 site-specific (policy) questions easier to answer.
3743 You may give one or more space-separated answers, or "none" if appropriate.
3744 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3745 previous run of Configure, you may specify it as well as or instead of
3746 OS-specific hints. If hints are provided for your OS, you should use them:
3747 although Perl can probably be built without hints on many platforms, using
3748 hints often improve performance and may enable features that Configure can't
3749 set up on its own. If there are no hints that match your OS, specify "none";
3750 DO NOT give a wrong version or a wrong OS.
3754 rp="Which of these apply, if any?"
3757 for file in $tans; do
3758 if $test X$file = XPolicy -a -f Policy.sh; then
3760 $cat Policy.sh >> UU/config.sh
3761 elif $test -f $src/hints/$file.sh; then
3762 . $src/hints/$file.sh
3763 $cat $src/hints/$file.sh >> UU/config.sh
3764 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3767 : Give one chance to correct a possible typo.
3768 echo "$file.sh does not exist"
3770 rp="hint to use instead?"
3772 for file in $ans; do
3773 if $test -f "$src/hints/$file.sh"; then
3774 . $src/hints/$file.sh
3775 $cat $src/hints/$file.sh >> UU/config.sh
3776 elif $test X$ans = X -o X$ans = Xnone ; then
3779 echo "$file.sh does not exist -- ignored."
3786 : Remember our hint file for later.
3787 if $test -f "$src/hints/$file.sh" ; then
3797 echo "Fetching default answers from $config_sh..." >&4
3801 cp $config_sh config.sh 2>/dev/null
3813 : Restore computed paths
3814 for file in $loclist $trylist; do
3815 eval $file="\$_$file"
3820 Configure uses the operating system name and version to set some defaults.
3821 The default value is probably right if the name rings a bell. Otherwise,
3822 since spelling matters for me, either accept the default or answer "none"
3829 ''|' '|none) dflt=none ;;
3830 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3833 *) dflt="$osname" ;;
3835 rp="Operating system name?"
3839 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3845 ''|' '|none) dflt=none ;;
3846 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3847 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3849 ''|' ') dflt=none ;;
3854 *) dflt="$osvers" ;;
3856 rp="Operating system version?"
3866 : who configured the system
3867 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3870 cf_by=`(logname) 2>/dev/null`
3873 cf_by=`(whoami) 2>/dev/null`
3875 "") cf_by=unknown ;;
3880 : decide how portable to be. Allow command line overrides.
3881 case "$d_portable" in
3883 *) d_portable="$define" ;;
3886 : set up shell script to do ~ expansion
3892 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3895 if $test -f /bin/csh; then
3896 /bin/csh -f -c "glob \$1"
3901 name=\`$expr x\$1 : '..\([^/]*\)'\`
3902 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3903 if $test ! -d "\$dir"; then
3905 echo "\$me: can't locate home directory for: \$name" >&2
3910 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3926 : now set up to get a file name
3930 cat <<'EOSC' >>getfile
3946 : getfile will accept an answer from the comma-separated list
3947 : enclosed in parentheses even if it does not meet other criteria.
3948 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3949 fn=`echo $fn | sed 's/(.*)//'`
3955 loc_file=`expr $fn : '.*:\(.*\)'`
3956 fn=`expr $fn : '\(.*\):.*'`
3964 */*) fullpath=true;;
3973 *e*) exp_file=true;;
3976 *p*) nopath_ok=true;;
3981 *d*) type='Directory';;
3982 *l*) type='Locate';;
3987 Locate) what='File';;
3992 case "$d_portable" in
4000 while test "$type"; do
4005 true) rp="$rp (~name ok)";;
4008 if test -f UU/getfile.ok && \
4009 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
4028 value=`UU/filexp $ans`
4031 if test "$ans" != "$value"; then
4032 echo "(That expands to $value on this system.)"
4046 /*) value="$ansexp" ;;
4047 [a-zA-Z]:/*) value="$ansexp" ;;
4052 echo "I shall only accept a full path name, as in /bin/ls." >&4
4053 echo "Use a ! shell escape if you wish to check pathnames." >&4
4056 echo "Please give a full path name, starting with slash." >&4
4059 echo "Note that using ~name is ok provided it expands well." >&4
4072 for fp in $gfpth; do
4073 if test "X$fp" = X.; then
4078 if test -f "$pf"; then
4080 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
4082 echo "($value is not a plain file, but that's ok.)"
4085 if test X"$type" = X; then
4092 for fp in $gfpth; do
4093 if test "X$fp" = X.; then
4098 direxp="$fp/$ansexp"
4100 if test -d "$direxp"; then
4108 if test -d "$ansexp"; then
4109 echo "(Looking for $loc_file in directory $value.)"
4110 value="$value/$loc_file"
4111 ansexp="$ansexp/$loc_file"
4113 if test -f "$ansexp"; then
4116 case "$nopath_ok" in
4117 true) case "$value" in
4119 *) echo "Assuming $value will be in people's path."
4135 if test "$fastread" = yes; then
4140 rp="$what $value doesn't exist. Use that name anyway?"
4159 test "X$gfpthkeep" != Xy && gfpth=""
4162 : determine root of directory hierarchy where package will be installed.
4165 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
4168 dflt=`echo "$prefix" | sed 's/.$//'`
4176 By default, $package will be installed in $dflt/bin, manual pages
4177 under $dflt/man, etc..., i.e. with $dflt as prefix for all
4178 installation directories. Typically this is something like /usr/local.
4179 If you wish to have binaries under /usr/bin but other parts of the
4180 installation under /usr/local, that's ok: you will be prompted
4181 separately for each of the installation directories, the prefix being
4182 only used to set the defaults.
4186 rp='Installation prefix to use?'
4194 *) oldprefix="$prefix";;
4201 : allow them to override the AFS root
4204 *) afsroot=$afsroot ;;
4210 $define|true) afs=true ;;
4211 $undef|false) afs=false ;;
4212 *) if $test -d $afsroot; then
4220 echo "AFS may be running... I'll be extra cautious then..." >&4
4222 echo "AFS does not seem to be running..." >&4
4225 : determine installation prefix for where package is to be installed.
4229 Since you are running AFS, I need to distinguish the directory in which
4230 files will reside from the directory in which they are installed (and from
4231 which they are presumably copied to the former directory by occult means).
4234 case "$installprefix" in
4235 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
4236 *) dflt="$installprefix";;
4241 In some special cases, particularly when building $package for distribution,
4242 it is convenient to distinguish the directory in which files should be
4243 installed from the directory ($prefix) in which they will
4244 eventually reside. For most users, these two directories are the same.
4247 case "$installprefix" in
4249 *) dflt=$installprefix;;
4253 rp='What installation prefix should I use for installing files?'
4255 installprefix="$ans"
4256 installprefixexp="$ansexp"
4258 : Perform the prefixexp/installprefixexp correction if necessary
4259 cat <<EOS >installprefix
4262 cat <<'EOSC' >>installprefix
4263 : Change installation prefix, if necessary.
4264 if $test X"$prefix" != X"$installprefix"; then
4265 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
4267 eval "install${prefixvar}=\"\$${prefixvar}exp\""
4270 chmod +x installprefix
4271 $eunicefix installprefix
4273 : Set variables such as privlib and privlibexp from the output of ./getfile
4274 : performing the prefixexp/installprefixexp correction if necessary.
4275 cat <<EOS >setprefixvar
4278 cat <<'EOSC' >>setprefixvar
4279 eval "${prefixvar}=\"\$ans\""
4280 eval "${prefixvar}exp=\"\$ansexp\""
4283 chmod +x setprefixvar
4284 $eunicefix setprefixvar
4286 : set up the script used to warn in case of inconsistency
4295 '') echo "The $hint value for \$$var on this machine was \"$was\"!" >&4
4297 *) echo "Hmm. Based on the hints in hints/$hintfile.sh, " >&4
4298 echo "the $hint value for \$$var on this machine was \"$was\"!" >&4
4303 echo "*** WHOA THERE!!! ***" >&4
4304 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
4307 rp=" Keep the $hint value?"
4310 y) td=$was; tu=$was;;
4314 : function used to set '$1' to '$val'
4315 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
4317 $define$undef) . ./whoa; eval "$var=\$td";;
4318 $undef$define) . ./whoa; eval "$var=\$tu";;
4319 *) eval "$var=$val";;
4322 : get the patchlevel
4324 echo "Getting the current patchlevel..." >&4
4325 if $test -r $rsrc/patchlevel.h;then
4326 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
4327 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4328 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4329 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4330 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4331 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4332 perl_patchlevel=`egrep ',"(MAINT|SMOKE)[0-9][0-9]*"' $rsrc/patchlevel.h|tail -1|sed 's/[^0-9]//g'`
4341 $echo "(You do not have patchlevel.h. Eek.)"
4343 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
4344 version_patchlevel_string="version $patchlevel subversion $subversion"
4345 case "$perl_patchlevel" in
4347 *) perl_patchlevel=`echo $perl_patchlevel | sed 's/.* //'`
4348 version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel"
4352 $echo "(You have $package $version_patchlevel_string.)"
4356 : XXX Should be a Configure test for double-dots in filenames.
4357 version=`echo $revision $patchlevel $subversion | \
4358 $awk '{ printf "%d_%d_%d", $1, $2, $3 }'`
4359 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4360 $awk '{ printf "%d_%d_%d", $1, $2, $3 }'`
4363 version=`echo $revision $patchlevel $subversion | \
4364 $awk '{ printf "%d.%d.%d", $1, $2, $3 }'`
4365 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4366 $awk '{ printf "%d.%d.%d", $1, $2, $3 }'`
4369 : Special case the 5.005_xx maintenance series, which used 5.005
4370 : without any subversion label as a subdirectory in $sitelib
4371 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4372 api_versionstring='5.005'
4375 : Do we want threads support and if so, what type
4376 case "$usethreads" in
4377 $define|true|[yY]*) dflt='y';;
4378 *) # Catch case where user specified ithreads or 5005threads but
4379 # forgot -Dusethreads (A.D. 4/2002)
4380 case "$useithreads$use5005threads" in
4381 *$define*) dflt='y';;
4388 Perl can be built to offer a form of threading support on some systems
4389 To do so, Configure can be run with -Dusethreads.
4391 Note that Perl built with threading support runs slightly slower
4392 and uses slightly more memory than plain Perl.
4394 If this doesn't make any sense to you, just accept the default '$dflt'.
4396 rp='Build a threading Perl?'
4399 y|Y) val="$define" ;;
4405 if $test $patchlevel -lt 9; then
4406 case "$usethreads" in
4408 : Default to ithreads unless overridden on command line or with
4411 case "$use5005threads" in
4413 echo "5.005 threads are no longer supported"
4417 case "$useithreads" in
4418 $undef|false|[nN]*) dflt='n';;
4420 rp='Use the newer interpreter-based ithreads?'
4423 y|Y) val="$define" ;;
4428 : Now set use5005threads to the opposite value.
4429 case "$useithreads" in
4430 $define) val="$undef" ;;
4437 useithreads="$undef"
4438 use5005threads="$undef"
4442 case "$useithreads$use5005threads" in
4446 You cannot have both the ithreads and the 5.005 threads enabled
4447 at the same time. Disabling the 5.005 threads since they are
4448 much less stable than the ithreads.
4451 use5005threads="$undef"
4456 : perl-5.9.x and later
4458 if test X"$usethreads" = "X$define"; then
4459 case "$use5005threads" in
4463 5.005 threads has been removed for 5.10. Perl will be built using ithreads.
4470 use5005threads="$undef"
4471 useithreads="$usethreads"
4474 case "$d_oldpthreads" in
4475 '') : Configure tests would be welcome here. For now, assume undef.
4477 *) val="$d_oldpthreads" ;;
4483 : Look for a hint-file generated 'call-back-unit'. If the
4484 : user has specified that a threading perl is to be built,
4485 : we may need to set or change some other defaults.
4486 if $test -f usethreads.cbu; then
4487 echo "Your platform has some specific hints regarding threaded builds, using them..."
4490 case "$usethreads" in
4491 "$define"|true|[yY]*)
4493 (Your platform does not have any specific hints for threaded builds.
4494 Assuming POSIX threads, then.)
4500 : Check if multiplicity is required
4503 Perl can be built so that multiple Perl interpreters can coexist
4504 within the same Perl executable.
4507 case "$useithreads" in
4510 This multiple interpreter support is required for interpreter-based threads.
4514 *) case "$usemultiplicity" in
4515 $define|true|[yY]*) dflt='y';;
4519 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4520 rp='Build Perl for multiplicity?'
4523 y|Y) val="$define" ;;
4531 : Check if morebits is requested
4532 case "$usemorebits" in
4533 "$define"|true|[yY]*)
4534 use64bitint="$define"
4535 uselongdouble="$define"
4536 usemorebits="$define"
4538 *) usemorebits="$undef"
4542 : Determine the C compiler to be used
4548 rp="Use which C compiler?"
4552 : See whether they have no cc but they do have gcc
4554 if $test -f cc.cbu; then
4559 : make some quick guesses about what we are up against
4561 $echo $n "Hmm... $c"
4571 $cat $sysroot/usr/include/signal.h $sysroot/usr/include/sys/signal.h >foo 2>/dev/null
4572 if test -f /osf_boot || $contains 'OSF/1' $sysroot/usr/include/ctype.h >/dev/null 2>&1
4574 echo "Looks kind of like an OSF/1 system, but we'll see..."
4576 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4577 xxx=`./loc addbib blurfl $pth`
4578 if $test -f $xxx; then
4579 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4583 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4584 echo "Looks kind of like an extended USG system, but we'll see..."
4586 echo "Looks kind of like a USG system, but we'll see..."
4590 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4591 echo "Looks kind of like a BSD system, but we'll see..."
4595 echo "Looks kind of like a Version 7 system, but we'll see..."
4598 case "$eunicefix" in
4601 There is, however, a strange, musty smell in the air that reminds me of
4602 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4606 : it so happens the Eunice I know will not run shell scripts in Unix format
4610 echo "Congratulations. You aren't running Eunice."
4614 : Detect OS2. The p_ variable is set above in the Head.U unit.
4615 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4616 : semicolon as a patch separator
4621 I have the feeling something is not exactly right, however...don't tell me...
4622 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4623 (Or you may be running DOS with DJGPP.)
4628 if test -f /xenix; then
4629 echo "Actually, this looks more like a XENIX system..."
4634 echo "It's not Xenix..."
4639 if test -f /venix; then
4640 echo "Actually, this looks more like a VENIX system..."
4647 echo "Nor is it Venix..."
4650 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4651 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4654 : Check if we are using GNU gcc and what its version is
4656 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4660 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4662 printf("%s\n", __VERSION__);
4664 printf("%s\n", "1");
4670 if $cc -o try $ccflags $ldflags try.c; then
4671 gccversion=`$run ./try`
4672 case "$gccversion" in
4673 '') echo "You are not using GNU cc." ;;
4674 *) echo "You are using GNU cc $gccversion."
4680 echo "*** WHOA THERE!!! ***" >&4
4681 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4682 case "$knowitall" in
4684 echo " You'd better start hunting for one and let me know about it." >&4
4690 case "$gccversion" in
4691 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4693 case "$gccversion" in
4694 '') gccosandvers='' ;;
4695 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4696 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4698 case "$gccosandvers" in
4699 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4700 $osname$osvers) ;; # looking good
4701 $osname*) cat <<EOM >&4
4703 *** WHOA THERE!!! ***
4705 Your gcc has not been compiled for the exact release of
4706 your operating system ($gccosandvers versus $osname$osvers).
4708 In general it is a good idea to keep gcc synchronized with
4709 the operating system because otherwise serious problems
4710 may ensue when trying to compile software, like Perl.
4712 I'm trying to be optimistic here, though, and will continue.
4713 If later during the configuration and build icky compilation
4714 problems appear (headerfile conflicts being the most common
4715 manifestation), I suggest reinstalling the gcc to match
4716 your operating system release.
4720 *) gccosandvers='' ;; # failed to parse, better be silent
4728 # gcc 3.* complain about adding -Idirectories that they already know about,
4729 # so we will take those off from locincpth.
4730 case "$gccversion" in
4732 echo "main(){}">try.c
4733 for incdir in $locincpth; do
4734 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4735 grep '^c[cp]p*[01]: warning: changing search order '`
4736 if test "X$warn" != X; then
4737 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4743 # gcc 4.9 by default does some optimizations that break perl.
4744 # see ticket 121505.
4746 # The -fwrapv disables those optimizations (and probably others,) so
4747 # for gcc 4.9 (and later, since the optimizations probably won't go
4748 # away), add -fwrapv unless the user requests -fno-wrapv, which
4749 # disables -fwrapv, or if the user requests -fsanitize=undefined,
4750 # which turns the overflows -fwrapv ignores into runtime errors.
4751 case "$gccversion" in
4752 4.[3-9].*|4.[1-9][0-9]*|[5-9].*|[1-9][0-9]*)
4754 *-fno-wrapv*|*-fsanitize=undefined*|*-fwrapv*) ;;
4755 *) ccflags="$ccflags -fwrapv" ;;
4759 : What should the include directory be ?
4760 : Use sysroot if set, so findhdr looks in the right place.
4762 $echo $n "Hmm... $c"
4763 dflt="$sysroot/usr/include"
4766 if $test -f /bin/mips && /bin/mips; then
4767 echo "Looks like a MIPS system..."
4768 $cat >usr.c <<'EOCP'
4769 #ifdef SYSTYPE_BSD43
4773 if $cc $cppflags -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4774 dflt='/bsd43/usr/include'
4778 mips_type='System V'
4780 $rm -f usr.c usr.out
4781 echo "and you're compiling with the $mips_type compiler and libraries."
4785 echo "Doesn't look like a MIPS system."
4795 case "$xxx_prompt" in
4798 rp='Where are the include files you want to use?'
4806 : see how we invoke the C preprocessor
4808 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4809 cat <<'EOT' >testcpp.c
4815 if test ! -f cppstdin; then
4816 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4817 # AIX cc -E doesn't show the absolute headerfile
4818 # locations but we'll cheat by using the -M flag.
4819 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
4821 echo 'cat >.$$.c; '"$cc $cppflags"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4824 echo "Keeping your $hint cppstdin wrapper."
4827 wrapper=`pwd`/cppstdin
4831 if $test "X$cppstdin" != "X" && \
4832 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4833 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4835 echo "You used to use $cppstdin $cppminus so we'll use that again."
4837 '') echo "But let's see if we can live without a wrapper..." ;;
4839 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4840 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4842 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4845 echo "(However, $cpprun $cpplast does not work, let's see...)"
4853 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4860 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4861 $cc -E <testcpp.c >testcpp.out 2>&1; \
4862 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4863 echo "Yup, it does."
4864 x_cpp="$cc $cppflags -E"
4866 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4867 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4868 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4869 echo "Yup, it does."
4870 x_cpp="$cc $cppflags -E"
4872 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4873 $cc -P <testcpp.c >testcpp.out 2>&1; \
4874 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4875 echo "Yipee, that works!"
4876 x_cpp="$cc $cppflags -P"
4878 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4879 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4880 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4881 echo "At long last!"
4882 x_cpp="$cc $cppflags -P"
4884 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4885 $cpp <testcpp.c >testcpp.out 2>&1; \
4886 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4888 x_cpp="$cpp $cppflags"
4890 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4891 $cpp - <testcpp.c >testcpp.out 2>&1; \
4892 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4893 echo "Hooray, it works! I was beginning to wonder."
4894 x_cpp="$cpp $cppflags"
4896 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4897 $wrapper <testcpp.c >testcpp.out 2>&1; \
4898 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4904 rp="No dice. I can't find a C preprocessor. Name one:"
4908 $x_cpp <testcpp.c >testcpp.out 2>&1
4909 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4910 echo "OK, that will do." >&4
4912 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4927 echo "Perhaps can we force $cc -E using a wrapper..."
4928 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4929 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4935 echo "Nope, we'll have to live without it..."
4949 "$wrapper"|'cppstdin') ;;
4950 *) $rm -f $wrapper;;
4952 $rm -f testcpp.c testcpp.out
4954 : Adjust cppfilter for path component separator
4956 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
4957 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
4961 : Use gcc to determine libpth and incpth
4962 # If using gcc or clang, we can get better values for libpth, incpth
4963 # and usrinc directly from the compiler.
4964 # Note that ccname for clang is also gcc.
4967 $echo 'extern int foo;' > try.c
4968 set X `$cppstdin -v try.c 2>&1 | $awk '/^#include </,/^End of search /'|$cppfilter $grep '/include'`
4970 if $test $# -gt 0; then
4972 incpth="`$echo $incpth|$sed 's/^ //'`"
4974 j="`$echo $i|$sed 's,/include$,/lib,'`"
4975 if $test -d $j; then
4979 libpth="`$echo $libpth|$sed 's/^ //'`"
4980 for xxx in $libpth $loclibpth $plibpth $glibpth; do
4981 if $test -d $xxx; then
4984 *) libpth="$libpth $xxx";;
4991 '') for i in $incpth; do
4992 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
5000 case "$usecrosscompile" in
5003 '') echo "Incpth not defined." >&4; croak=y ;;
5004 *) echo "Using incpth '$incpth'." >&4 ;;
5007 '') echo "Libpth not defined." >&4; croak=y ;;
5008 *) echo "Using libpth '$libpth'." >&4 ;;
5011 '') echo "Usrinc not defined." >&4; croak=y ;;
5012 *) echo "Using usrinc $usrinc." >&4 ;;
5016 if test "X$sysroot" = X; then
5017 echo "Cannot continue, aborting." >&4; exit 1
5019 echo "Cross-compiling using sysroot $sysroot, failing to guess inc/lib paths is not fatal" >&4
5028 : Default value for incpth is just usrinc
5030 '') incpth="$usrinc";;
5033 : Set private lib path
5036 plibpth="$incpath/usr/lib $sysroot/usr/local/lib $sysroot/usr/ccs/lib"
5041 '') dlist="$loclibpth $plibpth $glibpth";;
5042 *) dlist="$libpth";;
5045 : Now check and see which directories actually exist, avoiding duplicates
5048 if $test -d $xxx; then
5051 *) libpth="$libpth $xxx";;
5057 Some systems have incompatible or broken versions of libraries. Among
5058 the directories listed in the question below, please remove any you
5059 know not to be holding relevant libraries, and add any that are needed.
5060 Say "none" for none.
5064 if test "X$sysroot" != X; then
5066 You have set sysroot to $sysroot, please supply the directories excluding sysroot
5079 rp="Directories to use for library searches?"
5086 : compute shared library extension
5089 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
5099 On some systems, shared libraries may be available. Answer 'none' if
5100 you want to suppress searching of shared libraries for the remainder
5101 of this configuration.
5104 rp='What is the file extension used for shared libraries?'
5108 : Does target system insist that shared library basenames are unique
5111 Some dynamic loaders assume that the *basename* of shared library filenames
5112 are globally unique. We'll default this to undef as we assume your system
5113 is not this weird. Set to defined if you're on one of them.
5118 rp='Make shared library basenames unique?'
5121 y|Y) val="$define" ;;
5124 set d_libname_unique
5127 : Define several unixisms.
5128 : Hints files or command line option can be used to override them.
5129 : The convoluted testing is in case hints files set either the old
5132 '') case "$exe_ext" in
5134 *) _exe="$exe_ext" ;;
5139 '') case "$lib_ext" in
5146 '') case "$obj_ext" in
5153 '') case "$path_sep" in
5164 rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
5166 : Which makefile gets called first. This is used by make depend.
5167 case "$firstmakefile" in
5168 '') firstmakefile='makefile';;
5171 : Check is we will use socks
5173 $define|true|[yY]*) dflt='y';;
5178 Perl can be built to use the SOCKS proxy protocol library. To do so,
5179 Configure must be run with -Dusesocks. If you use SOCKS you also need
5180 to use the PerlIO abstraction layer, this will be implicitly selected.
5182 If this doesn't make any sense to you, just accept the default '$dflt'.
5184 rp='Build Perl for SOCKS?'
5187 y|Y) val="$define" ;;
5193 : Check for uselongdouble support
5195 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
5198 case "$uselongdouble" in
5199 $define|true|[yY]*) dflt='y';;
5204 Perl can be built to take advantage of long doubles which
5205 (if available) may give more accuracy and range for floating point numbers.
5207 If this doesn't make any sense to you, just accept the default '$dflt'.
5209 rp='Try to use long doubles if available?'
5212 y|Y) val="$define" ;;
5218 case "$uselongdouble" in
5219 true|[yY]*) uselongdouble="$define" ;;
5222 : Look for a hint-file generated 'call-back-unit'. If the
5223 : user has specified that long doubles should be used,
5224 : we may need to set or change some other defaults.
5225 if $test -f uselongdouble.cbu; then
5226 echo "Your platform has some specific hints regarding long doubles, using them..."
5227 . ./uselongdouble.cbu
5229 case "$uselongdouble" in
5232 (Your platform does not have any specific hints for long doubles.)
5238 : Check if quadmath is requested
5239 case "$usequadmath" in
5240 "$define"|true|[yY]*) usequadmath="$define" ;;
5241 *) usequadmath="$undef" ;;
5244 : Fail if both uselongdouble and usequadmath are requested
5245 case "$usequadmath:$uselongdouble" in
5249 *** You requested the use of the quadmath library and use
5250 *** of long doubles.
5252 *** Please select one or the other.
5258 : Looking for optional libraries
5260 echo "Checking for optional libraries..." >&4
5265 case "$libswanted" in
5266 '') libswanted='c_s';;
5269 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
5271 case "$usecbacktrace" in
5272 "$define") libswanted="$libswanted bfd" ;;
5274 case "$usequadmath" in
5275 "$define") libswanted="$libswanted quadmath" ;;
5281 for thisdir in $libpth $xlibpth; do
5282 test -d $thisdir && libspath="$libspath $thisdir"
5284 for thislib in $libswanted; do
5285 for thisdir in $libspath; do
5287 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
5288 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
5289 $test -f "$xxx" && eval $libscheck
5290 $test -f "$xxx" && libstyle=shared
5291 xxx=`ls $thisdir/lib$thislib.[0-9].$so 2>/dev/null|sed -n '$p'`
5292 $test -f "$xxx" && eval $libscheck
5293 $test -f "$xxx" && libstyle=shared
5295 if test ! -f "$xxx"; then
5296 xxx=$thisdir/lib$thislib.$so
5297 $test -f "$xxx" && eval $libscheck
5298 $test -f "$xxx" && libstyle=shared
5300 if test ! -f "$xxx"; then
5301 xxx=$thisdir/lib$thislib$_a
5302 $test -f "$xxx" && eval $libscheck
5303 $test -f "$xxx" && libstyle=static
5305 if test ! -f "$xxx"; then
5306 xxx=$thisdir/$thislib$_a
5307 $test -f "$xxx" && eval $libscheck
5308 $test -f "$xxx" && libstyle=static
5310 if test ! -f "$xxx"; then
5311 xxx=$thisdir/lib${thislib}_s$_a
5312 $test -f "$xxx" && eval $libscheck
5313 $test -f "$xxx" && libstyle=static
5314 $test -f "$xxx" && thislib=${thislib}_s
5316 if test ! -f "$xxx"; then
5317 xxx=$thisdir/Slib$thislib$_a
5318 $test -f "$xxx" && eval $libscheck
5319 $test -f "$xxx" && libstyle=static
5321 if $test -f "$xxx"; then
5323 shared) echo "Found -l$thislib (shared)." ;;
5324 static) echo "Found -l$thislib." ;;
5325 *) echo "Found -l$thislib ($libstyle)." ;;
5329 *) dflt="$dflt -l$thislib"
5330 libsfound="$libsfound $xxx"
5332 libsfiles="$libsfiles $yyy"
5333 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
5334 case " $libsdirs " in
5336 *) libsdirs="$libsdirs $yyy" ;;
5343 if $test ! -f "$xxx"; then
5344 echo "No -l$thislib."
5355 ' '|'') dflt='none';;
5360 In order to compile $package on your machine, a number of libraries
5361 are usually needed. Include any other special libraries here as well.
5362 Say "none" for none. The default list is almost always right.
5366 rp="What libraries to use?"
5373 : determine optimization, if desired, or use for debug flag also
5375 ' '|$undef) dflt='none';;
5377 *) dflt="$optimize";;
5381 By default, $package compiles with the -O flag to use the optimizer.
5382 Alternately, you might want to use the symbolic debugger, which uses
5383 the -g flag (on traditional Unix systems). Either flag can be
5384 specified here. To use neither flag, specify the word "none".
5387 rp="What optimizer/debugger flag should be used?"
5391 'none') optimize=" ";;
5394 : Check what DEBUGGING is required from the command line
5395 : -DEBUGGING or -DDEBUGGING or
5396 : -DEBUGGING=both = -g + -DDEBUGGING
5397 : -DEBUGGING=-g or -Doptimize=-g = -g
5398 : -DEBUGGING=none or -UDEBUGGING =
5399 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
5402 *) DEBUGGING=$EBUGGING ;;
5405 case "$DEBUGGING" in
5409 *) optimize="$optimize -g" ;;
5413 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
5421 case "$DEBUGGING" in
5422 both|$define) dflt='-DDEBUGGING'
5425 : argument order is deliberate, as the flag will start with - which set could
5426 : think is an option
5427 checkccflag='check=$1; flag=$2; callback=$3;
5429 echo "Checking if your compiler accepts $flag" 2>&1;
5430 [ "X$sysroot" != "X" ] && echo "For sysroot = $sysroot";
5431 echo "int main(void) { return 0; }" > gcctest.c;
5432 if $cc $_sysroot -O2 $flag -o gcctest gcctest.c 2>gcctest.out && $run ./gcctest; then
5433 echo "Yes, it does." 2>&1;
5434 if $test -s gcctest.out ; then
5435 echo "But your platform does not like it:";
5440 echo "Leaving current flags $ccflags alone." 2>&1
5442 *) dflt="$dflt $flag";
5448 echo "Nope, it does not, but that is ok." 2>&1;
5452 : We will not override a previous value, but we might want to
5453 : augment a hint file
5455 default|recommended)
5456 case "$gccversion" in
5457 1*) dflt="$dflt -fpcc-struct-return" ;;
5459 case "$optimize:$DEBUGGING" in
5460 *-g*:old) dflt="$dflt -DDEBUGGING";;
5462 case "$gccversion" in
5463 2*) if $test -d /etc/conf/kconfig.d &&
5464 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
5466 # Interactive Systems (ISC) POSIX mode.
5471 case "$gccversion" in
5474 ?*) set strict-aliasing -fno-strict-aliasing
5478 # For gcc, adding -pipe speeds up compilations for some, but apparently
5479 # some assemblers can't read from stdin. (It also slows down compilations
5480 # in other cases, but those are apparently rarer these days.) AD 5/2004.
5481 case "$gccversion" in
5487 # on x86_64 (at least) we require an extra library (libssp) in the
5488 # link command line. This library is not named, so I infer that it is
5489 # an implementation detail that may change. Hence the safest approach
5490 # is to add the flag to the flags passed to the compiler at link time,
5491 # as that way the compiler can do the right implementation dependant
5494 amigaos) ;; # -fstack-protector builds but doesn't work
5495 *) case "$gccversion" in
5496 ?*) set stack-protector-strong -fstack-protector-strong
5499 *-fstack-protector-strong*) ;; # It got added.
5500 *) # Try the plain/older -fstack-protector.
5501 set stack-protector -fstack-protector
5512 case "$mips_type" in
5513 *BSD*|'') inclwanted="$locincpth $usrinc";;
5514 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
5516 for thisincl in $inclwanted; do
5517 if $test -d $thisincl; then
5518 if $test x$thisincl != x$usrinc; then
5520 *" -I$thisincl "*);;
5521 *) dflt="$dflt -I$thisincl ";;
5527 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
5529 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5537 *) dflt="$dflt -D$2";;
5541 set signal.h LANGUAGE_C; eval $inctest
5545 ccflags="$ccflags -DSOCKS"
5550 default|recommended) dflt="$ccflags $dflt" ;;
5551 *) dflt="$ccflags";;
5560 Your C compiler may want other flags. For this question you should include
5561 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5562 but you should NOT include libraries or ld flags like -lwhatever. If you
5563 want $package to honor its debug switch, you should include -DDEBUGGING here.
5564 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5566 To use no flags, specify the word "none".
5572 rp="Any additional cc flags?"
5579 : the following weeds options from ccflags that are of no interest to cpp
5581 '') cppflags="$ccflags" ;;
5582 *) set X $ccflags; shift
5583 case " $cppflags " in
5584 *" $1 "*) ;; # Try to avoid doubling the cppflags.
5585 *) cppflags="$cppflags $ccflags" ;;
5589 case "$gccversion" in
5590 1*) cppflags="$cppflags -D__GNUC__"
5592 case "$mips_type" in
5594 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5600 echo "Let me guess what the preprocessor flags are..." >&4
5614 *) ftry="$previous $flag";;
5616 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5617 >cpp1.out 2>/dev/null && \
5618 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5619 >cpp2.out 2>/dev/null && \
5620 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5621 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5623 cppflags="$cppflags $ftry"
5633 *-*) echo "They appear to be: $cppflags";;
5635 $rm -f cpp.c cpp?.out
5639 : flags used in final linking phase
5641 '') if ./venix; then
5647 *-posix*) dflt="$dflt -posix" ;;
5650 *) dflt="$ldflags";;
5652 # See note above about -fstack-protector
5654 *-fstack-protector-strong*)
5656 *-fstack-protector-strong*) ;; # Don't add it again
5657 *) dflt="$dflt -fstack-protector-strong" ;;
5660 *-fstack-protector*)
5662 *-fstack-protector*) ;; # Don't add it again
5663 *) dflt="$dflt -fstack-protector" ;;
5668 : Try to guess additional flags to pick up local libraries.
5669 for thislibdir in $libpth; do
5670 case " $loclibpth " in
5673 *"-L$thislibdir "*) ;;
5674 *) dflt="$dflt -L$thislibdir" ;;
5686 Your C linker may need flags. For this question you should
5687 include -L/whatever and any other flags used by the C linker, but you
5688 should NOT include libraries like -lwhatever.
5690 Make sure you include the appropriate -L/path flags if your C linker
5691 does not normally search all of the directories you specified above,
5694 To use no flags, specify the word "none".
5698 rp="Any additional ld flags (NOT including libraries)?"
5704 rmlist="$rmlist pdp11"
5708 echo "Checking your choice of C compiler and flags for coherency..." >&4
5709 $cat > try.c <<'EOF'
5711 int main() { printf("Ok\n"); return(0); }
5713 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5715 $cat >try.msg <<'EOM'
5716 I've tried to compile and run the following simple program:
5719 $cat try.c >> try.msg
5721 $cat >> try.msg <<EOM
5728 and I got the following output:
5732 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5733 if $sh -c "$run ./try " >>try.msg 2>&1; then
5737 *) echo 'The program compiled OK, but produced no output.' >> try.msg ;;
5740 echo "The program compiled OK, but exited with status $?." >>try.msg
5741 rp="You have a problem. Shall I abort Configure"
5745 echo "I can't compile the test program." >>try.msg
5746 rp="You have a BIG problem. Shall I abort Configure"
5752 case "$knowitall" in
5754 echo "(The supplied flags or libraries might be incorrect.)"
5762 *) echo "Ok. Stopping Configure." >&4
5767 n) echo "OK, that should do.";;
5769 $rm_try gcctest gcctest.out
5771 : define a shorthand compile call
5775 case "$usedevel" in $define|true|[yY]*) if $test ! -f "${mc_file}.c"; then
5776 echo "Internal Configure script bug - compiler test file ${mc_file}.c is missing. Please report this to perlbug@perl.org" >&4;
5780 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5781 : define a shorthand compile call for compilations that should be ok.
5785 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5787 : determine filename position in cpp output
5789 echo "Computing filename position in cpp output for #include directives..." >&4
5791 amigaos) fieldn=3 ;; # Workaround for a bug in abc (pdksh).
5796 vos) testaccess=-e ;;
5799 echo '#include <stdio.h>' > foo.c
5802 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5803 $grep '^[ ]*#.*stdio\.h' | \
5804 while read cline; do
5807 while $test \$# -gt 0; do
5808 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5813 pos=\`expr \$pos + 1\`
5827 *) pos="${fieldn}th";;
5829 echo "Your cpp writes the filename in the $pos field of the line."
5831 : locate header file
5836 for usrincdir in $incpth
5838 if test -f \$usrincdir/\$wanted; then
5839 echo "\$usrincdir/\$wanted"
5843 awkprg='{ print \$$fieldn }'
5844 echo "#include <\$wanted>" > foo\$\$.c
5845 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5846 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5847 while read cline; do
5848 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5850 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5851 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5856 # status = 0: grep returned 0 lines, case statement not executed
5857 # status = 1: headerfile found
5858 # status = 2: while loop executed, no headerfile found
5862 if test \$status -eq 1; then
5869 : define an alternate in-header-list? function
5870 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5871 cont=true; xxf="echo \"<\$1> found.\" >&4";
5872 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5873 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5875 case $# in 4) instead=instead;; *) instead="at last";; esac;
5876 while $test "$cont"; do
5878 var=$2; eval "was=\$$2";
5879 if $test "$xxx" && $test -r "$xxx";
5881 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5884 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5885 set $yyy; shift; shift; yyy=$@;
5886 case $# in 0) cont="";;
5887 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5888 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5889 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5890 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5894 do set $yyy; var=$2; eval "was=\$$2";
5895 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5896 set $yyy; shift; shift; yyy=$@;
5899 : see if stdlib is available
5900 set stdlib.h i_stdlib
5903 : check for lengths of integral types
5907 echo "Checking to see how big your integers are..." >&4
5916 printf("intsize=%d;\n", (int)sizeof(int));
5917 printf("longsize=%d;\n", (int)sizeof(long));
5918 printf("shortsize=%d;\n", (int)sizeof(short));
5923 if eval $compile_ok && $run ./try > /dev/null; then
5925 echo "Your integers are $intsize bytes long."
5926 echo "Your long integers are $longsize bytes long."
5927 echo "Your short integers are $shortsize bytes long."
5931 Help! I can't compile and run the intsize test program: please enlighten me!
5932 (This is probably a misconfiguration in your system or libraries, and
5933 you really ought to fix it. Still, I'll try anyway.)
5937 rp="What is the size of an integer (in bytes)?"
5941 rp="What is the size of a long integer (in bytes)?"
5945 rp="What is the size of a short integer (in bytes)?"
5953 : check for long long
5955 echo "Checking to see if you have long long..." >&4
5956 echo 'int main() { long long x = 7; return 0; }' > try.c
5958 if eval $compile; then
5960 echo "You have long long."
5963 echo "You do not have long long."
5969 : check for length of long long
5970 case "${d_longlong}${longlongsize}" in
5973 echo "Checking to see how big your long longs are..." >&4
5974 $cat >try.c <<'EOCP'
5978 printf("%d\n", (int)sizeof(long long));
5983 if eval $compile_ok; then
5984 longlongsize=`$run ./try`
5985 echo "Your long longs are $longlongsize bytes long."
5989 echo "(I can't seem to compile the test program. Guessing...)"
5990 rp="What is the size of a long long (in bytes)?"
5994 if $test "X$longsize" = "X$longlongsize"; then
5995 echo "(That isn't any different from an ordinary long.)"
6001 : see if inttypes.h is available
6002 : we want a real compile instead of Inhdr because some systems
6003 : have an inttypes.h which includes non-existent headers
6006 #include <inttypes.h>
6008 static int32_t foo32 = 0x12345678;
6012 if eval $compile; then
6013 echo "<inttypes.h> found." >&4
6016 echo "<inttypes.h> NOT found." >&4
6025 echo "Checking to see if you have int64_t..." >&4
6027 #include <sys/types.h>
6028 #$i_inttypes I_INTTYPES
6030 #include <inttypes.h>
6032 int main() { int64_t x = 7; }
6035 if eval $compile; then
6037 echo "You have int64_t."
6040 echo "You do not have int64_t."
6046 : Check if 64bit ints have a quad type
6048 echo "Checking which 64-bit integer type we could use..." >&4
6054 val='"unsigned int"'
6059 *) case "$longsize" in
6063 val='"unsigned long"'
6068 *) case "$d_longlong:$longlongsize" in
6073 val='"unsigned long long"'
6078 *) case "$d_int64_t" in
6097 '') echo "Alas, no 64-bit integer types in sight." >&4
6100 *) echo "We could use '$quadtype' for 64-bit integers." >&4
6105 : Do we want 64bit support
6106 case "$uselonglong" in
6107 "$define"|true|[yY]*)
6110 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
6112 use64bitint="$define"
6115 case "$use64bits" in
6116 "$define"|true|[yY]*)
6119 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
6121 use64bitint="$define"
6124 case "$use64bitints" in
6125 "$define"|true|[yY]*)
6128 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
6130 use64bitint="$define"
6133 case "$use64bitsint" in
6134 "$define"|true|[yY]*)
6137 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
6139 use64bitint="$define"
6142 case "$uselonglongs" in
6143 "$define"|true|[yY]*)
6146 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
6148 use64bitint="$define"
6151 case "$use64bitsall" in
6152 "$define"|true|[yY]*)
6155 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
6157 use64bitall="$define"
6162 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
6164 case "$use64bitall" in
6165 "$define"|true|[yY]*) use64bitint="$define" ;;
6171 You have natively 64-bit long integers.
6175 *) case "$use64bitint" in
6176 "$define"|true|[yY]*) dflt='y';;
6185 Perl can be built to take advantage of 64-bit integer types
6186 on some systems. To do so, Configure can be run with -Duse64bitint.
6187 Choosing this option will most probably introduce binary incompatibilities.
6189 If this doesn't make any sense to you, just accept the default '$dflt'.
6190 (The default has been chosen based on your configuration.)
6192 rp='Try to use 64-bit integers, if available?'
6195 [yY]*) val="$define" ;;
6203 case "$use64bitall" in
6204 "$define"|true|[yY]*) dflt='y' ;;
6205 *) case "$longsize" in
6213 You may also choose to try maximal 64-bitness. It means using as much
6214 64-bitness as possible on the platform. This in turn means even more
6215 binary incompatibilities. On the other hand, your platform may not
6216 have any more 64-bitness available than what you already have chosen.
6218 If this doesn't make any sense to you, just accept the default '$dflt'.
6219 (The default has been chosen based on your configuration.)
6221 rp='Try to use maximal 64-bit support, if available?'
6224 [yY]*) val="$define" ;;
6229 case "$use64bitall" in
6231 case "$use64bitint" in
6235 Since you have chosen a maximally 64-bit build, I'm also turning on
6236 the use of 64-bit integers.
6238 use64bitint="$define" ;;
6243 : Look for a hint-file generated 'call-back-unit'. If the
6244 : user has specified that a 64-bit perl is to be built,
6245 : we may need to set or change some other defaults.
6246 if $test -f use64bitint.cbu; then
6247 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
6250 case "$use64bitint" in
6251 "$define"|true|[yY]*)
6252 : This test was common to all the OpenBSD forks, and seems harmless for
6255 echo "Checking if your C library has broken 64-bit functions..." >&4
6258 typedef $uquadtype myULL;
6265 {4294967303.15, 4294967303ULL},
6266 {4294967294.2, 4294967294ULL},
6267 {4294967295.7, 4294967295ULL},
6270 for (p = test; p->u; p++) {
6271 myULL x = (myULL)p->d;
6282 if eval $compile_ok; then
6283 libcquad=`$run ./try`
6284 echo "Your C library's 64-bit functions are $libcquad."
6286 echo "(I can't seem to compile the test program.)"
6287 echo "Assuming that your C library's 64-bit functions are ok."
6296 *** You have a C library with broken 64-bit functions.
6297 *** 64-bit support does not work reliably in this configuration.
6298 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
6299 *** Cannot continue, aborting.
6306 4) case "$archname64" in
6307 '') archname64=64int ;;
6314 : Look for a hint-file generated 'call-back-unit'. If the
6315 : user has specified that a maximally 64-bit perl is to be built,
6316 : we may need to set or change some other defaults.
6317 if $test -f use64bitall.cbu; then
6318 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
6321 case "$use64bitall" in
6322 "$define"|true|[yY]*)
6324 4) case "$archname64" in
6325 ''|64int) archname64=64all ;;
6332 case "$d_quad:$use64bitint" in
6336 *** You have chosen to use 64-bit integers,
6337 *** but none can be found.
6338 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
6339 *** Cannot continue, aborting.
6346 : Check if we are using the GNU C library
6348 echo "Checking for GNU C Library..." >&4
6350 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
6351 alone are insufficient to distinguish different versions, such as
6352 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
6353 libc version 2.1.0. A. Dougherty, June 3, 2002.
6359 # ifdef __GLIBC_MINOR__
6360 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
6361 # include <gnu/libc-version.h>
6362 printf("%s\n", gnu_get_libc_version());
6364 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
6367 printf("%d\n", __GLIBC__);
6376 if eval $compile_ok && $run ./try > glibc.ver; then
6378 gnulibc_version=`$cat glibc.ver`
6379 echo "You are using the GNU C Library version $gnulibc_version"
6383 echo "You are not using the GNU C Library"
6389 : see if nm is to be used to determine whether a symbol is defined or not
6393 case "$d_gnulibc" in
6396 echo "nm probably won't work on the GNU C Library." >&4
6402 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
6404 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
6405 echo "'nm' won't be sufficient on this system." >&4
6411 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
6412 if $test $dflt -gt 20; then
6422 true|$define) dflt=y;;
6429 I can use $nm to extract the symbols from your C libraries. This
6430 is a time consuming task which may generate huge output on the disk (up
6431 to 3 megabytes) but that should make the symbols extraction faster. The
6432 alternative is to skip the 'nm' extraction part and to compile a small
6433 test program instead to determine whether each symbol is present. If
6434 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
6435 this may be the best solution.
6437 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
6440 rp="Shall I use $nm to extract C symbols from the libraries?"
6443 [Nn]*) usenm=false;;
6452 : nm options which may be necessary
6454 '') if $test -f /mach_boot; then
6456 elif $test -d /usr/ccs/lib; then
6457 nm_opt='-p' # Solaris (and SunOS?)
6458 elif $test -f /dgux; then
6460 elif $test -f /lib64/rld; then
6461 nm_opt='-p' # 64-bit Irix
6467 : nm options which may be necessary for shared libraries but illegal
6468 : for archive libraries. Thank you, Linux.
6469 case "$nm_so_opt" in
6470 '') case "$myuname" in
6472 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
6473 nm_so_opt='--dynamic'
6480 : Figure out where the libc is located
6483 : get list of predefined functions in a handy place
6488 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
6494 *) for thislib in $libs; do
6497 : Handle C library specially below.
6500 thislib=`echo $thislib | $sed -e 's/^-l//'`
6501 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
6503 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
6505 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
6507 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
6509 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
6511 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
6513 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
6518 libnames="$libnames $try"
6520 *) libnames="$libnames $thislib" ;;
6529 for xxx in $libpth; do
6530 $test -r $1 || set $xxx/libc.$so
6531 : The messy sed command sorts on library version numbers.
6533 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
6534 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
6536 s/[0-9][0-9]*/0000&/g
6537 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
6540 $sort | $sed -e 's/^.* //'`
6543 $test -r $1 || set $sysroot/usr/ccs/lib/libc.$so
6544 $test -r $1 || set $sysroot/lib/libsys_s$_a
6550 if $test -r "$1"; then
6551 echo "Your (shared) C library seems to be in $1."
6553 elif $test -r /lib/libc && $test -r /lib/clib; then
6554 echo "Your C library seems to be in both /lib/clib and /lib/libc."
6556 libc='/lib/clib /lib/libc'
6557 if $test -r /lib/syslib; then
6558 echo "(Your math library is in /lib/syslib.)"
6559 libc="$libc /lib/syslib"
6561 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
6562 echo "Your C library seems to be in $libc, as you said before."
6563 elif $test -r $incpath/usr/lib/libc$_a; then
6564 libc=$incpath/usr/lib/libc$_a;
6565 echo "Your C library seems to be in $libc. That's fine."
6566 elif $test -r /lib/libc$_a; then
6568 echo "Your C library seems to be in $libc. You're normal."
6570 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
6572 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
6573 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
6574 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
6576 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
6578 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
6581 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
6583 if $test -r "$tans"; then
6584 echo "Your C library seems to be in $tans, of all places."
6590 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
6594 If the guess above is wrong (which it might be if you're using a strange
6595 compiler, or your machine supports multiple models), you can override it here.
6600 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
6602 I can't seem to find your C library. I've looked in the following places:
6605 $sed 's/^/ /' libpath
6608 None of these seems to contain your C library. I need to get its name...
6613 rp='Where is your C library?'
6618 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
6619 set X `cat libnames`
6622 case $# in 1) xxx=file; esac
6623 echo "Extracting names from the following $xxx for later perusal:" >&4
6625 $sed 's/^/ /' libnames >&4
6627 $echo $n "This may take a while...$c" >&4
6631 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
6632 *) $nm $nm_opt $file 2>/dev/null;;
6637 $grep fprintf libc.tmp > libc.ptf
6638 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
6639 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
6641 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
6643 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6645 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
6647 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6649 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
6651 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6653 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
6655 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6657 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
6659 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6661 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
6663 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6665 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
6666 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
6668 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6670 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
6672 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6674 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
6676 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6678 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
6680 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6682 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
6684 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6686 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
6688 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6690 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
6692 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6694 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
6696 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6699 $nm -p $* 2>/dev/null >libc.tmp
6700 $grep fprintf libc.tmp > libc.ptf
6701 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
6702 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
6708 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
6710 if $ar t $libc > libc.tmp && \
6711 $contains '^fprintf$' libc.tmp >/dev/null 2>&1
6713 for thisname in $libnames $libc; do
6714 $ar t $thisname >>libc.tmp
6716 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
6718 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
6719 for thisname in $libnames $libc; do
6720 $ar tv $thisname >>libc.tmp
6721 emximp -o tmp.imp $thisname \
6723 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
6724 < tmp.imp >>libc.tmp
6727 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
6730 echo "$ar didn't seem to work right." >&4
6731 echo "Maybe this is a Cray...trying bld instead..." >&4
6733 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list &&
6736 for thisname in $libnames; do
6738 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
6739 $ar t $thisname >>libc.tmp
6743 echo "That didn't work either. Giving up." >&4
6753 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
6754 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
6756 *) if $test -f /lib/syscalls.exp; then
6758 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
6759 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' \
6760 /lib/syscalls.exp >>libc.list
6766 $rm -f libnames libpath
6768 : Check if we are using C++
6770 echo "Checking for C++..." >&4
6771 $cat >try.c <<'EOCP'
6783 if eval $compile_ok && $run ./try; then
6785 echo "You are using a C++ compiler."
6788 echo "You are not using a C++ compiler."
6794 : is a C symbol defined?
6797 -v) tf=libc.tmp; tdc="";;
6798 -a) tf=libc.tmp; tdc="[]";;
6799 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
6801 case "$d_cplusplus" in
6802 $define) extern_C="extern \"C\"" ;;
6803 *) extern_C="extern" ;;
6806 case "$reuseval-$4" in
6808 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
6813 if $test "$runnm" = true; then
6814 if $contains $tlook $tf >/dev/null 2>&1; then
6816 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
6817 echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main(int argc, char **argv) { if(p() && p() != (void *)argv[0]) return(0); else return(1); }"> try.c;
6818 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
6819 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
6823 echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main(int argc, char **argv) { if(p() && p() != (void *)argv[0]) return(0); else return(1); }"> try.c;
6824 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
6830 $define) tval=true;;
6837 : define an is-in-libc? function
6838 inlibc='echo " "; td=$define; tu=$undef;
6839 sym=$1; var=$2; eval "was=\$$2";
6841 case "$reuseval$was" in
6851 echo "$sym() found." >&4;
6852 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
6854 echo "$sym() NOT found." >&4;
6855 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
6859 $define) echo "$sym() found." >&4;;
6860 *) echo "$sym() NOT found." >&4;;
6864 : check for length of double
6866 case "$doublesize" in
6868 echo "Checking to see how big your double precision numbers are..." >&4
6877 printf("%d\n", (int)sizeof(double));
6882 if eval $compile_ok; then
6883 doublesize=`$run ./try`
6884 echo "Your double is $doublesize bytes long."
6887 echo "(I can't seem to compile the test program. Guessing...)"
6888 rp="What is the size of a double precision number (in bytes)?"
6896 : see if this is a float.h system
6900 : check for long doubles
6902 echo "Checking to see if you have long double..." >&4
6903 echo 'int main() { long double x = 7.0; }' > try.c
6905 if eval $compile; then
6907 echo "You have long double."
6910 echo "You do not have long double."
6916 : see if ldexpl exists
6920 : check for length of long double
6921 case "${d_longdbl}${longdblsize}" in
6924 echo "Checking to see how big your long doubles are..." >&4
6925 $cat >try.c <<'EOCP'
6929 printf("%d\n", sizeof(long double));
6934 if eval $compile; then
6935 longdblsize=`$run ./try`
6936 echo "Your long doubles are $longdblsize bytes long."
6940 echo "(I can't seem to compile the test program. Guessing...)" >&4
6941 rp="What is the size of a long double (in bytes)?"
6945 if $test "X$doublesize" = "X$longdblsize"; then
6946 echo "That isn't any different from an ordinary double."
6947 echo "I'll keep your setting anyway, but you may see some"
6948 echo "harmless compilation warnings."
6954 $echo "Checking the kind of long doubles you have..." >&4
6955 case "$d_longdbl" in
6960 #define LONGDBLSIZE $longdblsize
6961 #define DOUBLESIZE $doublesize
6969 static const long double d = -0.1L;
6971 unsigned const char* b = (unsigned const char*)(&d);
6972 #if DOUBLESIZE == LONGDBLSIZE
6973 printf("0\n"); /* if it floats like double */
6976 #if (LDBL_MANT_DIG == 113 || FLT128_MANT_DIG == 113) && LONGDBLSIZE == 16
6977 if (b[0] == 0x9A && b[1] == 0x99 && b[15] == 0xBF) {
6978 /* IEEE 754 128-bit little-endian */
6982 if (b[0] == 0xBF && b[14] == 0x99 && b[15] == 0x9A) {
6983 /* IEEE 128-bit big-endian, e.g. solaris sparc */
6988 /* For alignment 32-bit platforms have the 80 bits in 12 bytes,
6989 * while 64-bits platforms have it in 16 bytes. The trailing bytes
6990 * cannot be trusted. */
6991 #if LDBL_MANT_DIG == 64 && (LONGDBLSIZE == 16 || LONGDBLSIZE == 12)
6992 if (b[0] == 0xCD && b[9] == 0xBF) {
6993 /* x86 80-bit little-endian, sizeof 12 (ILP32, Solaris x86)
6994 * or 16 (LP64, Linux and OS X), 4 or 6 bytes of padding.
6995 * Also known as "extended precision". */
6999 if (b[0] == 0xBF && b[9] == 0xCD) {
7000 /* Is there ever big-endian 80-bit, really?
7002 * The Motorola 68881 had another "extended precision" format:
7003 * sign:1 exp:15 zero:16 integer:1 mantissa:63
7004 * for total of 96 bits of bytes. The zero bits were unused.
7005 * See "M68000 FAMILY PROGRAMMER’S REFERENCE MANUAL" for more details.
7006 * If it ever becomes relevant, this format should be allocated
7007 * a new doublekind code since it's quite different from the Intel x87.
7013 #if (LDBL_MANT_DIG == 106 || LDBL_MANT_DIG == 107) && LONGDBLSIZE == 16
7014 /* software "double double", the 106 is 53+53.
7015 * but irix thinks it is 107. */
7016 if (b[0] == 0x9A && b[7] == 0x3C && b[8] == 0x9A && b[15] == 0xBF) {
7017 /* double double 128-bit fully little-endian,
7018 * little-endian doubles in little-endian order,
7019 * 9a 99 99 99 99 99 59 3c 9a 99 99 99 99 99 b9 bf */
7023 if (b[0] == 0xBF && b[7] == 0x9A && b[8] == 0x3C && b[15] == 0x9A) {
7024 /* double double 128-bit fully big-endian,
7025 * big-endian doubles in big-endian order,
7026 * e.g. PPC/Power and MIPS:
7027 * bf b9 99 99 99 99 99 9a 3c 59 99 99 99 99 99 9a */
7031 if (b[0] == 0x9A && b[7] == 0xBF && b[8] == 0x9A && b[15] == 0x3C) {
7032 /* double double 128-bit mixed endian.
7033 * little-endian doubles in big-endian order,
7035 * 9a 99 99 99 99 99 b9 bf 9a 99 99 99 99 99 59 3c */
7039 if (b[0] == 0x3C && b[7] == 0x9A && b[8] == 0xBF && b[15] == 0x9A) {
7040 /* double double 128-bit mixed endian,
7041 * big-endian doubles in little-endian order,
7042 * 3c 59 99 99 99 99 99 9a bf b9 99 99 99 99 99 9a */
7047 printf("-1\n"); /* unknown */
7052 if eval $compile; then
7053 longdblkind=`$run ./try`
7060 case "$longdblkind" in
7061 0) echo "Your long doubles are doubles." >&4 ;;
7062 1) echo "You have IEEE 754 128-bit little endian long doubles." >&4 ;;
7063 2) echo "You have IEEE 754 128-bit big endian long doubles." >&4 ;;
7064 3) echo "You have x86 80-bit little endian long doubles." >& 4 ;;
7065 4) echo "You have x86 80-bit big endian long doubles." >& 4 ;;
7066 5) echo "You have 128-bit fully little-endian double-double long doubles (64-bit LEs in LE)." >& 4 ;;
7067 6) echo "You have 128-bit fully big-endian double-double long doubles (64-bit BEs in BE)." >& 4 ;;
7068 7) echo "You have 128-bit mixed double-double long doubles (64-bit LEs in BE)." >& 4 ;;
7069 8) echo "You have 128-bit mixed double-double long doubles (64-bit BEs in LE)." >& 4 ;;
7070 *) echo "Cannot figure out your long double." >&4 ;;
7074 : determine the architecture name
7076 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
7077 tarch=`arch`"-$osname"
7078 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
7079 if uname -m > tmparch 2>&1 ; then
7080 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
7081 -e 's/$/'"-$osname/" tmparch`
7089 case "$myarchname" in
7092 echo "(Your architecture name used to be $myarchname.)"
7096 case "$targetarch" in
7098 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
7103 *) dflt="$archname";;
7105 rp='What is your architecture name'
7109 : optionally add API version to the architecture for versioned archlibs
7110 case "$useversionedarchname" in
7111 $define|true|[yY]*) dflt='y';;
7114 rp='Add the Perl API version to your archname?'
7117 y|Y) useversionedarchname="$define" ;;
7118 *) useversionedarchname="$undef" ;;
7120 case "$useversionedarchname" in
7123 *-$api_versionstring)
7124 echo "...and architecture name already has -$api_versionstring" >&4
7127 archname="$archname-$api_versionstring"
7128 echo "...setting architecture name to $archname." >&4
7134 case "$usethreads" in
7136 echo "Threads selected." >&4
7138 *-thread*) echo "...and architecture name already has -thread." >&4
7140 *) archname="$archname-thread"
7141 echo "...setting architecture name to $archname." >&4
7146 case "$usemultiplicity" in
7148 echo "Multiplicity selected." >&4
7150 *-multi*) echo "...and architecture name already has -multi." >&4
7152 *) archname="$archname-multi"
7153 echo "...setting architecture name to $archname." >&4
7158 case "$use64bitint$use64bitall" in
7160 case "$archname64" in
7162 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
7165 case "$use64bitint" in
7166 "$define") echo "64 bit integers selected." >&4 ;;
7168 case "$use64bitall" in
7169 "$define") echo "Maximal 64 bitness selected." >&4 ;;
7172 *-$archname64*) echo "...and architecture name already has $archname64." >&4
7174 *) archname="$archname-$archname64"
7175 echo "...setting architecture name to $archname." >&4
7181 case "$uselongdouble" in
7183 echo "Long doubles selected." >&4
7184 case "$longdblsize" in
7186 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
7190 *-ld*) echo "...and architecture name already has -ld." >&4
7192 *) archname="$archname-ld"
7193 echo "...setting architecture name to $archname." >&4
7200 case "$usequadmath" in
7202 echo "quadmath selected." >&4
7204 *-quadmath*) echo "...and architecture name already has -quadmath." >&4
7206 *) archname="$archname-quadmath"
7207 echo "...setting architecture name to $archname." >&4
7212 if $test -f archname.cbu; then
7213 echo "Your platform has some specific hints for architecture name, using them..."
7217 : set the prefixit variable, to compute a suitable default value
7218 prefixit='case "$3" in
7220 case "$oldprefix" in
7221 "") eval "$1=\"\$$2\"";;
7228 ""|" ") eval "$1=\"\$$2\"";;
7234 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
7236 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
7237 /*-$oldprefix/*|\~*-$oldprefix/*)
7238 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
7239 *) eval "$1=\"\$$2\"";;
7243 : determine installation style
7244 : For now, try to deduce it from prefix unless it is already set.
7245 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
7246 case "$installstyle" in
7247 '') case "$prefix" in
7248 *perl*) dflt='lib';;
7249 *) dflt='lib/perl5' ;;
7252 *) dflt="$installstyle" ;;
7254 : Probably not worth prompting for this since we prompt for all
7255 : the directories individually, and the prompt would be too long and
7259 : determine where public executables go
7264 rp='Pathname where the public executables will reside?'
7266 if $test "X$ansexp" != "X$binexp"; then
7270 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
7271 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
7272 : this via initialinstalllocation
7275 case "$userelocatableinc" in
7276 $define|true|[yY]*) dflt='y' ;;
7281 Would you like to build Perl so that the installation is relocatable, so that
7282 library paths in @INC are determined relative to the path of the perl binary?
7283 This is not advised for system Perl installs, or if you need to run setid
7284 scripts or scripts under taint mode.
7286 If this doesn't make any sense to you, just accept the default '$dflt'.
7288 rp='Use relocatable @INC?'
7291 y|Y) val="$define" ;;
7294 set userelocatableinc
7297 initialinstalllocation="$binexp"
7298 : Default prefix is now "up one level from where the binaries are"
7299 case "$userelocatableinc" in
7305 installprefixexp=".../.."
7309 : determine where private library files go
7310 : Usual default is /usr/local/lib/perl5/$version.
7311 : Also allow things like /opt/perl/lib/$version, since
7312 : /opt/perl/lib/perl5... would be redundant.
7313 : The default "style" setting is made in installstyle.U
7314 case "$installstyle" in
7315 *lib/perl5*) set dflt privlib lib/$package/$version ;;
7316 *) set dflt privlib lib/$version ;;
7321 There are some auxiliary files for $package that need to be put into a
7322 private library directory that is accessible by everyone.
7327 rp='Pathname where the private library files will reside?'
7332 : set the prefixup variable, to restore leading tilda escape
7333 prefixup='case "$prefixexp" in
7335 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
7338 : determine where public architecture dependent libraries go
7341 : privlib default is /usr/local/lib/$package/$version
7342 : archlib default is /usr/local/lib/$package/$version/$archname
7343 : privlib may have an optional trailing /share.
7344 tdflt=`echo $privlib | $sed 's,/share$,,'`
7345 tdflt=$tdflt/$archname
7354 $spackage contains architecture-dependent library files. If you are
7355 sharing libraries in a heterogeneous environment, you might store
7356 these files in a separate location. Otherwise, you can just include
7357 them with the rest of the public library files.
7362 rp='Where do you want to put the public architecture-dependent libraries?'
7366 if $test X"$archlib" = X"$privlib"; then
7372 : see if setuid scripts can be secure
7375 Some kernels have a bug that prevents setuid #! scripts from being
7376 secure. Some sites have disabled setuid #! scripts because of this.
7378 First let's decide if your kernel supports secure setuid #! scripts.
7379 (If setuid #! scripts would be secure but have been disabled anyway,
7380 don't say that they are secure if asked.)
7385 if $test -d /dev/fd; then
7386 echo "#!$ls" >reflect
7387 chmod +x,u+s reflect
7388 ./reflect >flect 2>&1
7389 if $contains "/dev/fd" flect >/dev/null; then
7390 echo "Congratulations, your kernel has secure setuid scripts!" >&4
7394 If you are not sure if they are secure, I can check but I'll need a
7395 username and password different from the one you are using right now.
7396 If you don't have such a username or don't want me to test, simply
7400 rp='Other username to test security of setuid scripts with?'
7405 case "$d_suidsafe" in
7406 '') echo "I'll assume setuid scripts are *not* secure." >&4
7409 echo "Well, the $hint value is *not* secure." >&4
7411 *) echo "Well, the $hint value *is* secure." >&4
7416 $rm -f reflect flect
7417 echo "#!$ls" >reflect
7418 chmod +x,u+s reflect
7421 echo '"su" will (probably) prompt you for '"$ans's password."
7422 su $ans -c './reflect >flect'
7423 if $contains "/dev/fd" flect >/dev/null; then
7424 echo "Okay, it looks like setuid scripts are secure." >&4
7427 echo "I don't think setuid scripts are secure." >&4
7432 rp='Does your kernel have *secure* setuid scripts?'
7435 [yY]*) val="$define";;
7440 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
7441 echo "(That's for file descriptors, not floppy disks.)"
7447 $rm -f reflect flect
7449 : now see if they want to do setuid emulation
7450 if $test $patchlevel -lt 11; then
7453 case "$d_suidsafe" in
7456 echo "No need to emulate SUID scripts since they are secure here." >&4
7460 Some systems have disabled setuid scripts, especially systems where
7461 setuid scripts cannot be secure. On systems where setuid scripts have
7462 been disabled, the setuid/setgid bits on scripts are currently
7463 useless. It is possible for $package to detect those bits and emulate
7464 setuid/setgid in a secure fashion. This emulation will only work if
7465 setuid scripts have been disabled in your kernel.
7469 "$define") dflt=y ;;
7472 rp="Do you want to do setuid/setgid emulation?"
7475 [yY]*) val="$define";;
7487 SUID emulation has been removed for 5.12
7488 Please re-run Configure without -Dd_dosuid
7497 : Find perl5.005 or later.
7498 echo "Looking for a previously installed perl5.005 or later... "
7500 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
7501 : Check if this perl is recent and can load a simple module
7502 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
7505 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
7515 '') echo "None found. That's ok.";;
7516 *) echo "Using $perl5." ;;
7519 : Set the siteprefix variables
7522 After $package is installed, you may wish to install various
7523 add-on modules and utilities. Typically, these add-ons will
7524 be installed under $prefix with the rest
7525 of this package. However, you may wish to install such add-ons
7526 elsewhere under a different prefix.
7528 If you do not wish to put everything under a single prefix, that's
7529 ok. You will be prompted for the individual locations; this siteprefix
7530 is only used to suggest the defaults.
7532 The default should be fine for most people.
7536 rp='Installation prefix to use for add-on modules and utilities?'
7537 : XXX Here might be another good place for an installstyle setting.
7538 case "$siteprefix" in
7540 *) dflt=$siteprefix ;;
7543 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
7545 case "$siteprefix" in
7549 *) oldsiteprefix="$prefix";;
7554 siteprefixexp="$ansexp"
7556 : determine where site specific libraries go.
7557 : Usual default is /usr/local/lib/perl5/site_perl/$version
7558 : The default "style" setting is made in installstyle.U
7559 : XXX No longer works with Prefixit stuff.
7560 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7562 '') case "$installstyle" in
7563 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
7564 *) dflt=$siteprefix/lib/site_$prog/$version ;;
7572 The installation process will create a directory for
7573 site-specific extensions and modules. Most users find it convenient
7574 to place all site-specific files in this directory rather than in the
7575 main distribution directory.
7579 rp='Pathname for the site-specific library files?'
7583 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
7585 : Determine list of previous versions to include in @INC
7586 $cat > getverlist <<EOPL
7589 \$api_versionstring = "$api_versionstring";
7590 \$version = "$version";
7591 \$stem = "$sitelib_stem";
7592 \$archname = "$archname";
7594 $cat >> getverlist <<'EOPL'
7595 # The list found is store twice for each entry: the original name, and
7596 # the binary broken down version as pack "sss", so sorting is easy and
7597 # unambiguous. This will work for all versions that have a maximum of
7598 # three digit groups, separate by '.'s or '_'s. Names are extended with
7599 # ".0.0" to ensure at least three elements for the pack.
7600 # -- H.Merijn Brand (m)'06 23-10-2006
7602 # Can't have leading @ because metaconfig interprets it as a command!
7603 ;@inc_version_list=();
7604 # XXX Redo to do opendir/readdir?
7607 ;@candidates = map {
7608 [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
7609 ;@candidates = sort { $a->[1] cmp $b->[1]} @candidates;
7615 ($pversion, $aversion, $vsn5005) = map {
7616 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
7617 foreach $d (@candidates) {
7618 if ($d->[1] lt $pversion) {
7619 if ($d->[1] ge $aversion) {
7620 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
7622 elsif ($d->[1] ge $vsn5005) {
7623 unshift(@inc_version_list, grep { -d } $d->[0]);
7627 # Skip newer version. I.e. don't look in
7628 # 5.7.0 if we're installing 5.6.1.
7632 if (@inc_version_list) {
7633 print join(' ', @inc_version_list);
7636 # Blank space to preserve value for next Configure run.
7641 case "$inc_version_list" in
7642 '') if test -x "$perl5$exe_ext"; then
7643 dflt=`$perl5 getverlist`
7648 $undef) dflt='none' ;;
7649 *) eval dflt=\"$inc_version_list\" ;;
7652 ''|' ') dflt=none ;;
7659 In order to ease the process of upgrading, this version of perl
7660 can be configured to use modules built and installed with earlier
7661 versions of perl that were installed under $prefix. Specify here
7662 the list of earlier versions that this version of perl should check.
7663 If Configure detected no earlier versions of perl installed under
7664 $prefix, then the list will be empty. Answer 'none' to tell perl
7665 to not search earlier versions.
7667 The default should almost always be sensible, so if you're not sure,
7668 just accept the default.
7671 rp='List of earlier versions to include in @INC?'
7674 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
7675 *) inc_version_list="$ans" ;;
7677 case "$inc_version_list" in
7679 inc_version_list_init='0'
7680 d_inc_version_list="$undef"
7682 *) inc_version_list_init=`echo $inc_version_list |
7683 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
7684 d_inc_version_list="$define"
7689 : see if malloc/malloc.h has to be included
7690 set malloc/malloc.h i_mallocmalloc
7693 : see if this is a malloc.h system
7694 : we want a real compile instead of Inhdr because some systems have a
7695 : malloc.h that just gives a compile error saying to use stdlib.h instead
7700 #$i_mallocmalloc I_MALLOCMALLOC
7701 #ifdef I_MALLOCMALLOC
7702 # include <malloc/malloc.h>
7705 int main () { return 0; }
7708 if eval $compile; then
7709 echo "<malloc.h> found." >&4
7712 echo "<malloc.h> NOT found." >&4
7719 : check for length of pointer
7723 echo "Checking to see how big your pointers are..." >&4
7732 printf("%d\n", (int)sizeof(void *));
7737 if eval $compile_ok; then
7738 ptrsize=`$run ./try`
7739 echo "Your pointers are $ptrsize bytes long."
7742 echo "(I can't seem to compile the test program. Guessing...)" >&4
7743 rp="What is the size of a pointer (in bytes)?"
7750 case "$use64bitall" in
7751 "$define"|true|[yY]*)
7755 *** You have chosen a maximally 64-bit build,
7756 *** but your pointers are only 4 bytes wide.
7757 *** Please rerun Configure without -Duse64bitall.
7762 *** Since you have quads, you could possibly try with -Duse64bitint.
7767 *** Cannot continue, aborting.
7778 : determine whether to use malloc wrapping
7780 case "$usemallocwrap" in
7781 [yY]*|true|$define) dflt='y' ;;
7782 [nN]*|false|$undef) dflt='n' ;;
7783 *) case "$usedevel" in
7784 [yY]*|true|$define) dflt='y' ;;
7789 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
7791 usemallocwrap="$ans"
7794 usemallocwrap="$define" ;;
7796 usemallocwrap="$undef" ;;
7799 : determine which malloc to compile in
7801 case "$usemymalloc" in
7802 [yY]*|true|$define) dflt='y' ;;
7803 [nN]*|false|$undef) dflt='n' ;;
7804 *) case "$ptrsize" in
7808 if test "$useithreads" = "$define"; then dflt='n'; fi
7811 rp="Do you wish to attempt to use the malloc that comes with $package?"
7817 mallocsrc='malloc.c'
7818 mallocobj="malloc$_o"
7819 d_mymalloc="$define"
7822 : Remove malloc from list of libraries to use
7823 echo "Removing unneeded -lmalloc from library list" >&4
7824 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
7827 echo "libs = $libs" >&4
7839 : compute the return types of malloc and free
7841 $cat >malloc.c <<END
7845 #include <sys/types.h>
7859 case "$malloctype" in
7861 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
7868 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
7872 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
7879 echo "Your system uses $freetype free(), it would seem." >&4
7881 : determine where site specific architecture-dependent libraries go.
7882 : sitelib default is /usr/local/lib/perl5/site_perl/$version
7883 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
7884 : sitelib may have an optional trailing /share.
7886 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
7887 dflt="$dflt/$archname"
7892 set sitearch sitearch none
7896 The installation process will also create a directory for
7897 architecture-dependent site-specific extensions and modules.
7901 rp='Pathname for the site-specific architecture-dependent library files?'
7905 if $test X"$sitearch" = X"$sitelib"; then
7908 d_sitearch="$define"
7911 : Set the vendorprefix variables
7914 The installation process will also create a directory for
7915 vendor-supplied add-ons. Vendors who supply perl with their system
7916 may find it convenient to place all vendor-supplied files in this
7917 directory rather than in the main distribution directory. This will
7918 ease upgrades between binary-compatible maintenance versions of perl.
7920 Of course you may also use these directories in whatever way you see
7921 fit. For example, you might use them to access modules shared over a
7922 company-wide network.
7924 The default answer should be fine for most people.
7925 This causes further questions about vendor add-ons to be skipped
7926 and no vendor-specific directories will be configured for perl.
7929 rp='Do you want to configure vendor-specific add-on directories?'
7930 case "$usevendorprefix" in
7931 define|true|[yY]*) dflt=y ;;
7932 *) : User may have set vendorprefix directly on Configure command line.
7933 case "$vendorprefix" in
7942 rp='Installation prefix to use for vendor-supplied add-ons?'
7943 case "$vendorprefix" in
7944 '') dflt="$prefix" ;;
7945 *) dflt=$vendorprefix ;;
7948 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
7950 case "$vendorprefix" in
7954 *) oldvendorprefix="$prefix";;
7958 usevendorprefix="$define"
7960 vendorprefixexp="$ansexp"
7962 *) usevendorprefix="$undef"
7968 : Set the vendorlib variables
7969 case "$vendorprefix" in
7970 '') d_vendorlib="$undef"
7974 *) d_vendorlib="$define"
7975 : determine where vendor-supplied modules go.
7976 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
7977 case "$vendorlib" in
7979 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7980 case "$installstyle" in
7981 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
7982 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
7985 *) dflt="$vendorlib"
7989 rp='Pathname for the vendor-supplied library files?'
7992 vendorlibexp="$ansexp"
7995 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
7999 : Set the vendorarch variables
8000 case "$vendorprefix" in
8001 '') d_vendorarch="$undef"
8005 *) d_vendorarch="$define"
8006 : determine where vendor-supplied architecture-dependent libraries go.
8007 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
8008 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
8009 : vendorlib may have an optional trailing /share.
8010 case "$vendorarch" in
8011 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
8012 dflt="$dflt/$archname"
8014 *) dflt="$vendorarch" ;;
8017 rp='Pathname for vendor-supplied architecture-dependent files?'
8020 vendorarchexp="$ansexp"
8023 prefixvar=vendorarch
8025 if $test X"$vendorarch" = X"$vendorlib"; then
8026 d_vendorarch="$undef"
8028 d_vendorarch="$define"
8031 : Final catch-all directories to search
8034 Lastly, you can have perl look in other directories for extensions and
8035 modules in addition to those already specified.
8036 These directories will be searched after
8040 test X"$vendorlib" != "X" && echo ' ' $vendorlib
8041 test X"$vendorarch" != "X" && echo ' ' $vendorarch
8043 case "$otherlibdirs" in
8044 ''|' ') dflt='none' ;;
8045 *) dflt="$otherlibdirs" ;;
8048 Enter a colon-separated set of extra paths to include in perl's @INC
8049 search path, or enter 'none' for no extra paths.
8053 rp='Colon-separated list of additional directories for perl to search?'
8056 ' '|''|none) otherlibdirs=' ' ;;
8057 *) otherlibdirs="$ans" ;;
8059 case "$otherlibdirs" in
8063 set d_perl_otherlibdirs
8066 : Cruising for prototypes
8068 echo "Checking out function prototypes..." >&4
8069 $cat >prototype.c <<EOCP
8074 int main(int argc, char *argv[]) {
8077 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
8078 echo "Your C compiler appears to support function prototypes."
8081 echo "Your C compiler doesn't seem to understand function prototypes."
8088 : Check if ansi2knr is required
8089 case "$prototype" in
8091 *) ansi2knr='ansi2knr'
8096 This version of $package can only be compiled by a compiler that
8097 understands function prototypes. Unfortunately, your C compiler
8099 doesn't seem to understand them. Sorry about that.
8101 If GNU cc is available for your system, perhaps you could try that instead.
8103 Eventually, we hope to support building Perl with pre-ANSI compilers.
8104 If you would like to help in that effort, please contact <perlbug@perl.org>.
8106 Aborting Configure now.
8113 dflt_dtrace='/usr/sbin/dtrace'
8114 $test -x /usr/bin/dtrace && dflt_dtrace='/usr/bin/dtrace'
8118 Perl can be built to support DTrace on platforms that support it.
8119 DTrace is a diagnosis and performance analysis tool from Sun.
8121 If this doesn't make any sense to you, just accept the default.
8125 case "$usedtrace" in
8131 dflt_dtrace=$usedtrace
8138 rp='Support DTrace if available?'
8141 y|Y) val="$define" ;;
8147 test "X$usedtrace" != "X$define" && break
8150 rp='Where is the dtrace executable?'
8159 if $dtrace -h -s ../perldtrace.d \
8160 -o perldtrace.tmp >/dev/null 2>&1 \
8161 && rm -f perldtrace.tmp
8164 echo "Good: your $dtrace knows about the -h flag."
8168 *** $me: Fatal Error: $dtrace doesn't support -h flag
8170 *** Your installed dtrace doesn't support the -h switch to compile a D
8171 *** program into a C header. Can't continue.
8183 *** $me: Fatal Error: $dtrace not found.
8190 echo "*** $dtrace was not found."
8196 : See if we want extra modules installed
8203 Perl can be built with extra modules or bundles of modules which
8204 will be fetched from the CPAN and installed alongside Perl.
8206 Notice that you will need access to the CPAN; either via the Internet,
8207 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
8208 be asked later to configure the CPAN.pm module which will in turn do
8209 the installation of the rest of the extra modules or bundles.)
8211 Notice also that if the modules require any external software such as
8212 libraries and headers (the libz library and the zlib.h header for the
8213 Compress::Zlib module, for example) you MUST have any such software
8214 already installed, this configuration process will NOT install such
8217 If this doesn't make any sense to you, just accept the default '$dflt'.
8219 rp='Install any extra modules (y or n)?'
8225 Please list any extra modules or bundles to be installed from CPAN,
8226 with spaces between the names. The names can be in any format the
8227 'install' command of CPAN.pm will understand. (Answer 'none',
8228 without the quotes, to install no extra modules or bundles.)
8238 $rm -f ../extras.lst
8240 *) echo "(Saving the list of extras for later...)"
8241 echo "$extras" > ../extras.lst
8249 : determine where html pages for programs go
8250 set html1dir html1dir none
8254 If you wish to install html files for programs in $spackage, indicate
8255 the appropriate directory here. To skip installing html files,
8259 ''|none|$undef|' ') dflt=none ;;
8260 *) dflt=$html1dir ;;
8263 rp="Directory for the main $spackage html pages?"
8267 : Use ' ' for none so value is preserved next time through Configure
8268 $test X"$html1dir" = "X" && html1dir=' '
8270 : determine where html pages for libraries and modules go
8271 set html3dir html3dir none
8275 If you wish to install html files for modules associated with $spackage,
8276 indicate the appropriate directory here. To skip installing html files,
8279 : There is no obvious default. If they have specified html1dir, then
8280 : try to key off that, possibly changing .../html1 into .../html3.
8282 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
8283 *) dflt=$html3dir ;;
8286 rp="Directory for the $spackage module html pages?"
8290 : Use ' ' for none so value is preserved next time through Configure
8291 $test X"$html3dir" = "X" && html3dir=' '
8293 : determine whether to install perl also as /usr/bin/perl
8296 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
8298 Many scripts expect perl to be installed as /usr/bin/perl.
8300 If you want to, I can install the perl you are about to compile
8301 as /usr/bin/perl (in addition to $bin/perl).
8303 if test -f /usr/bin/perl; then
8306 However, please note that because you already have a /usr/bin/perl,
8307 overwriting that with a new Perl would very probably cause problems.
8308 Therefore I'm assuming you don't want to do that (unless you insist).
8311 case "$installusrbinperl" in
8312 "$define"|[yY]*) dflt='y';;
8318 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
8321 case "$installusrbinperl" in
8322 "$undef"|[nN]*) dflt='n';;
8326 rp="Do you want to install perl as /usr/bin/perl?"
8329 [yY]*) val="$define";;
8335 set installusrbinperl
8338 : see if dlopen exists
8340 xxx_ccflags="$ccflags"
8342 : with g++ one needs -shared to get is-in-libc to work for dlopen
8343 case "$gccversion" in
8346 *) case "$d_cplusplus" in
8347 "$define") ccflags="$ccflags -shared" ;;
8354 ccflags="$xxx_ccflags"
8356 : see if this is a unistd.h system
8357 set unistd.h i_unistd
8360 : determine which dynamic loading, if any, to compile in
8362 dldir="ext/DynaLoader"
8375 $define) dflt='y' ;;
8377 : Does a dl_xxx.xs file exist for this operating system
8378 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
8381 rp="Do you wish to use dynamic loading?"
8388 '') if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
8389 dflt="$dldir/dl_${osname}.xs"
8390 elif $test "$d_dlopen" = "$define" ; then
8391 dflt="$dldir/dl_dlopen.xs"
8396 *) dflt="$dldir/$dlsrc"
8399 echo "The following dynamic loading files are available:"
8400 : Can not go over to $dldir because getfile has path hard-coded in.
8401 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
8402 rp="Source file to use for dynamic loading"
8408 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
8412 Some systems may require passing special flags to $cc -c to
8413 compile modules that will be used to create a shared library.
8414 To use no flags, say "none".
8417 case "$cccdlflags" in
8418 '') case "$gccversion" in
8419 '') case "$osname" in
8421 irix*) dflt='-KPIC' ;;
8422 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
8423 sunos) dflt='-pic' ;;
8427 *) case "$osname" in
8428 darwin) dflt='none' ;;
8429 *linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
8434 *) dflt="$cccdlflags" ;;
8441 # If -Dsysroot was specified, now's the time to add it
8443 if test "X$sysroot" != X; then
8444 case "$gccversion" in
8449 dflt="$dflt --sysroot=$sysroot" ;;
8459 rp="Any special flags to pass to $cc -c to compile shared library modules?"
8462 none) cccdlflags=' ' ;;
8463 *) cccdlflags="$ans" ;;
8468 Some systems use ld to create libraries that can be dynamically loaded,
8469 while other systems (such as those using ELF) use $cc.
8473 : Determine if this is ELF
8475 /* Test for whether ELF binaries are produced */
8487 int i = open("a.out",O_RDONLY);
8490 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
8491 exit(0); /* succeed (yes, it is ELF) */
8495 if $cc $ccflags $ldflags -o a.out try.c >/dev/null 2>&1 && $run ./a.out; then
8501 '') if $test $bin_ELF = "$define"; then
8503 You appear to have ELF support. I'll use $cc to build dynamic libraries.
8507 echo "I'll use ld to build dynamic libraries."
8515 rp="What command should be used to create dynamic libraries?"
8521 Some systems may require passing special flags to $ld to create a
8522 library that can be dynamically loaded. If your ld flags include
8523 -L/other/path options to locate libraries outside your loader's normal
8524 search path, you may need to specify those -L options here as well. To
8525 use no flags, say "none".
8528 case "$lddlflags" in
8529 '') case "$osname" in
8530 haiku) dflt='-shared' ;;
8532 case "$gccversion" in
8533 '') dflt="$dflt +vnocompatwarnings" ;;
8536 *linux*|irix*|gnu*) dflt="-shared $optimize" ;;
8537 solaris) # See [perl #66604].
8538 # On Solaris 11, gcc -m64 on amd64
8539 # appears not to understand -G. gcc versions at
8540 # least as old as 3.4.3 support -shared, so just
8541 # use that with Solaris 11 and later, but keep
8542 # the old behavior for older Solaris versions.
8543 case "$gccversion" in
8545 *) case "$osvers" in
8546 2.?|2.10) dflt='-G' ;;
8547 *) dflt='-shared' ;;
8552 sunos) dflt='-assert nodefinitions' ;;
8553 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
8557 *) dflt="$lddlflags" ;;
8560 : Only do this for gcc, since, for example, qcc has no concept
8562 if $test "X$sysroot" != X; then
8563 case "$gccversion" in
8565 *) dflt="$dflt --sysroot $sysroot" ;;
8569 : Try to guess additional flags to pick up local libraries.
8570 : Be careful not to append to a plain 'none'
8574 for thisflag in $ldflags; do
8579 *) dflt="$dflt $thisflag" ;;
8586 ''|' ') dflt='none' ;;
8590 *-fstack-protector-strong*)
8592 *-fstack-protector-strong*) ;; # Don't add it again
8593 *) dflt="$dflt -fstack-protector-strong" ;;
8596 *-fstack-protector*)
8598 *-fstack-protector*) ;; # Don't add it again
8599 *) dflt="$dflt -fstack-protector" ;;
8604 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
8607 none) lddlflags=' ' ;;
8608 *) lddlflags="$ans" ;;
8613 Some systems may require passing special flags to $cc to indicate that
8614 the resulting executable will use dynamic linking. To use no flags,
8618 case "$ccdlflags" in
8619 '') case "$osname" in
8620 *linux*|hpux|gnu*) dflt='-Wl,-E' ;;
8621 sunos) dflt='none' ;;
8625 *) dflt="$ccdlflags" ;;
8627 rp="Any special flags to pass to $cc to use dynamic linking?"
8630 none) ccdlflags=' ' ;;
8631 *) ccdlflags="$ans" ;;
8643 ld_can_script="$undef"
8644 case "$bin_ELF$usedl" in
8646 # Abuse try.h and a.out names for neat cleanup
8658 if $cc $cccdlflags $ccdlflags $ccflags \
8659 $ldflags $lddlflags -o a.out try.c \
8660 -Wl,--version-script=try.h >/dev/null 2>&1 \
8661 && $test -s a.out ; then
8662 echo "ld supports scripting" >&4
8663 ld_can_script="$define"
8665 echo "ld does not support scripting" >&4
8671 : Do we want a shared libperl?
8675 # No dynamic loading being used, so don't bother even to prompt.
8678 *) case "$useshrplib" in
8679 '') case "$osname" in
8680 svr4*|nonstopux|dgux|dynixptx|esix|powerux|haiku|cygwin*)
8682 also='Building a shared libperl is required for dynamic loading to work on your system.'
8696 The perl executable is normally obtained by linking perlmain.c with
8697 libperl${_a}, any static extensions (usually just DynaLoader), and
8698 any other libraries needed on this system (such as -lm, etc.). Since
8699 your system supports dynamic loading, it is probably possible to build
8700 a shared libperl.$so. If you will have more than one executable linked
8701 to libperl.$so, this will significantly reduce the size of each
8702 executable, but it may have a noticeable effect on performance. The
8703 default is probably sensible for your system.
8707 rp="Build a shared libperl.$so (y/n)"
8711 useshrplib='true' ;;
8712 *) useshrplib='false' ;;
8717 case "$useshrplib" in
8719 case "$userelocatableinc" in
8721 echo "Cannot build with both -Duserelocatableinc and -Duseshrplib" >&4
8722 echo "See INSTALL for an explanation why that won't work." >&4
8728 # Figure out a good name for libperl.so. Since it gets stored in
8729 # a version-specific architecture-dependent library, the version
8730 # number isn't really that important, except for making cc/ld happy.
8732 # A name such as libperl.so.10.1
8733 majmin="libperl.$so.$patchlevel.$subversion"
8734 # A name such as libperl.so.100
8735 majonly=`echo $patchlevel $subversion |
8736 $awk '{printf "%d%02d", $1, $2}'`
8737 majonly=libperl.$so.$majonly
8738 # I'd prefer to keep the os-specific stuff here to a minimum, and
8739 # rely on figuring it out from the naming of libc.
8740 case "${osname}${osvers}" in
8741 *linux*|gnu*) # ld won't link with a bare -lperl otherwise.
8744 cygwin*) # ld links now against the dll directly
8745 majmin="cygperl5_${patchlevel}_${subversion}.${so}"
8746 majonly=`echo $patchlevel $subversion |
8747 $awk '{printf "%03d%03d", $1, $2}'`
8748 majonly=cygperl5.$majonly.$so
8751 *) # Try to guess based on whether libc has major.minor.
8753 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8754 *libc.$so.[0-9]*) dflt=$majonly ;;
8755 *) dflt=libperl.$so ;;
8765 I need to select a good name for the shared libperl. If your system uses
8766 library names with major and minor numbers, then you might want something
8767 like $majmin. Alternatively, if your system uses a single version
8768 number for shared libraries, then you might want to use $majonly.
8769 Or, your system might be quite happy with a simple libperl.$so.
8771 Since the shared libperl will get installed into a version-specific
8772 architecture-dependent directory, the version number of the shared perl
8773 library probably isn't important, so the default should be o.k.
8776 rp='What name do you want to give to the shared libperl?'
8779 echo "Ok, I'll use $libperl"
8782 libperl="libperl${_a}"
8786 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8790 WARNING: Use of the shrpdir variable for the installation location of
8791 the shared $libperl is not supported. It was never documented and
8792 will not work in this version. Let me (perlbug@perl.org)
8793 know of any problems this may cause.
8799 But your current setting of $shrpdir is
8800 the default anyway, so it's harmless.
8805 Further, your current attempted setting of $shrpdir
8806 conflicts with the value of $archlibexp/CORE
8807 that installperl will use.
8814 # How will the perl executable find the installed shared $libperl?
8815 # Add $xxx to ccdlflags.
8816 # If we can't figure out a command-line option, use $shrpenv to
8817 # set env LD_RUN_PATH. The main perl makefile uses this.
8818 shrpdir=$archlibexp/CORE
8821 if "$useshrplib"; then
8824 # We'll set it in Makefile.SH...
8829 freebsd|mirbsd|netbsd|openbsd|interix|dragonfly|bitrig)
8830 xxx="-Wl,-R$shrpdir"
8832 bsdos|linux|irix*|dec_osf|gnu*|haiku)
8833 xxx="-Wl,-rpath,$shrpdir"
8836 # hpux doesn't like the default, either.
8837 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8840 # cygwin needs only ldlibpth
8843 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8849 # Only add $xxx if it isn't already in ccdlflags.
8850 case " $ccdlflags " in
8852 *) ccdlflags="$ccdlflags $xxx"
8855 Adding $xxx to the flags
8856 passed to $ld so that the perl executable will find the
8857 installed shared $libperl.
8865 # Fix ccdlflags in AIX for building external extensions.
8866 # (For building Perl itself bare -bE:perl.exp is needed,
8867 # Makefile.SH takes care of this.)
8869 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8871 # Respect a hint or command-line value.
8873 '') shrpenv="$tmp_shrpenv" ;;
8875 case "$ldlibpthname" in
8876 '') ldlibpthname=LD_LIBRARY_PATH ;;
8877 none) ldlibpthname='' ;;
8880 : determine where manual pages are on this system
8884 syspath='/usr/share/man/man1 /usr/man/man1'
8885 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8886 syspath="$syspath /usr/man/u_man/man1"
8887 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8888 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8889 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8890 sysman=`./loc . /usr/man/man1 $syspath`
8893 if $test -d "$sysman"; then
8894 echo "System manual is in $sysman." >&4
8896 echo "Could not find manual pages in source form." >&4
8899 : determine where manual pages go
8900 set man1dir man1dir none
8904 $spackage has manual pages available in source form.
8908 echo "However, you don't have nroff, so they're probably useless to you."
8910 '') man1dir="none";;
8913 echo "If you don't want the manual sources installed, answer 'none'."
8918 lookpath="$prefixexp/share/man/man1"
8919 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8920 lookpath="$lookpath $prefixexp/man/p_man/man1"
8921 lookpath="$lookpath $prefixexp/man/u_man/man1"
8922 lookpath="$lookpath $prefixexp/man/man.1"
8924 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8925 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8935 rp="Where do the main $spackage manual pages (source) go?"
8937 if $test "X$man1direxp" != "X$ansexp"; then
8948 : What suffix to use on installed man pages
8955 rp="What suffix should be used for the main $spackage man pages?"
8957 '') case "$man1dir" in
8971 *) dflt="$man1ext";;
8978 : see if we can have long filenames
8980 first=123456789abcdef
8982 if (echo hi >$first) 2>/dev/null; then
8983 if $test -f 123456789abcde; then
8984 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8987 echo 'You can have filenames longer than 14 characters.'>&4
8992 You can't have filenames longer than 14 chars.
8993 You can't even think about them!
8999 $rm -rf 123456789abcde*
9001 : determine where library module manual pages go
9002 set man3dir man3dir none
9006 $spackage has manual pages for many of the library modules.
9012 However, you don't have nroff, so they're probably useless to you.
9015 '') man3dir="none";;
9019 case "$d_flexfnam" in
9022 However, your system can't handle the long file names like File::Basename.3.
9025 '') man3dir="none";;
9029 echo "If you don't want the manual sources installed, answer 'none'."
9030 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
9032 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
9033 if $test -d "$privlib/man/man3"; then
9036 WARNING: Previous versions of perl installed man3 pages into
9037 $privlib/man/man3. This version will suggest a
9038 new default of $dflt.
9042 rp='Do you wish to preserve the old behavior?(y/n)'
9045 y*) dflt="$privlib/man/man3" ;;
9050 *) dflt="$man3dir" ;;
9057 rp="Where do the $package library man pages (source) go?"
9067 : What suffix to use on installed man pages
9073 rp="What suffix should be used for the $package library man pages?"
9075 '') case "$man3dir" in
9089 *) dflt="$man3ext";;
9096 : see if we have to deal with yellow pages, now NIS.
9097 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
9103 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
9111 rp='Are you getting the hosts file via yellow pages?'
9114 y*) hostcat='ypcat hosts';;
9115 *) hostcat='cat /etc/hosts';;
9121 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
9124 '') test -f /etc/group && groupcat='cat /etc/group';;
9127 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
9130 : now get the host name
9132 echo "Figuring out host name..." >&4
9133 case "$myhostname" in
9135 echo 'Maybe "hostname" will work...'
9136 if tans=`sh -c hostname 2>&1` ; then
9144 if $test "$cont"; then
9146 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
9147 if tans=`cat /etc/systemid 2>&1` ; then
9149 phostname='cat /etc/systemid'
9150 echo "Whadyaknow. Xenix always was a bit strange..."
9153 elif $test -r /etc/systemid; then
9154 echo "(What is a non-Xenix system doing with /etc/systemid?)"
9157 if $test "$cont"; then
9158 echo 'No, maybe "uuname -l" will work...'
9159 if tans=`sh -c 'uuname -l' 2>&1` ; then
9161 phostname='uuname -l'
9163 echo 'Strange. Maybe "uname -n" will work...'
9164 if tans=`sh -c 'uname -n' 2>&1` ; then
9166 phostname='uname -n'
9168 echo 'Oh well, maybe I can mine it out of whoami.h...'
9169 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
9170 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
9171 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
9173 case "$myhostname" in
9174 '') echo "Does this machine have an identity crisis or something?"
9177 echo "Well, you said $myhostname before..."
9178 phostname='echo $myhostname';;
9184 case "$myhostname" in
9185 '') myhostname=noname ;;
9187 : you do not want to know about this
9192 if $test "$myhostname" ; then
9194 rp='Your host name appears to be "'$myhostname'".'" Right?"
9202 : bad guess or no guess
9203 while $test "X$myhostname" = X ; do
9205 rp="Please type the (one word) name of your host:"
9210 : translate upper to lower if necessary
9211 case "$myhostname" in
9213 echo "(Normalizing case in your host name)"
9214 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
9218 case "$myhostname" in
9220 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
9221 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
9222 echo "(Trimming domain name from host name--host name is now $myhostname)"
9224 *) case "$mydomain" in
9227 test "X$hostcat" = "Xypcat hosts" &&
9228 ypmatch "$myhostname" hosts 2>/dev/null |\
9229 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
9232 test "X$hostcat" != "X" &&
9233 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
9234 /[ ]$myhostname[ . ]/p" > hosts
9237 if $test -f hosts; then
9238 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
9239 END { print sum }" hosts` = x1 || tmp_re="[ ]"
9240 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
9241 hosts | $sort | $uniq | \
9242 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
9243 case `$echo X$dflt` in
9244 X*\ *) echo "(Several hosts in the database matched hostname)"
9247 X.) echo "(You do not have fully-qualified names in the hosts database)"
9251 echo "(I cannot locate a hosts database anywhere)"
9256 tans=`./loc resolv.conf X /etc /usr/etc`
9257 if $test -f "$tans"; then
9258 echo "(Attempting domain name extraction from $tans)"
9259 dflt=.`$sed -n -e 's/ / /g' \
9260 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
9263 .) dflt=.`$sed -n -e 's/ / /g' \
9264 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
9272 .) echo "(No help from resolv.conf either -- attempting clever guess)"
9273 dflt=.`sh -c domainname 2>/dev/null`
9276 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
9280 case "$dflt$osname" in
9281 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
9282 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
9286 .) echo "(Lost all hope -- silly guess then)"
9292 *) dflt="$mydomain";;
9296 rp="What is your domain name?"
9306 : translate upper to lower if necessary
9309 echo "(Normalizing case in your domain name)"
9310 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
9314 : a little sanity check here
9315 case "$phostname" in
9318 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
9319 $myhostname$mydomain|$myhostname) ;;
9321 case "$phostname" in
9323 echo "(That doesn't agree with your whoami.h file, by the way.)"
9326 echo "(That doesn't agree with your $phostname command, by the way.)"
9334 : determine the e-mail address of the user who is running us
9337 I need to get your e-mail address in Internet format if possible, i.e.
9338 something like user@host.domain. Please answer accurately since I have
9339 no easy means to double check it. The default value provided below
9340 is most probably close to reality but may not be valid from outside
9341 your organization...
9345 while test "$cont"; do
9346 case "$MAILDOMAIN" in
9348 if $test -s /etc/mailname; then
9349 maildomain=`$cat /etc/mailname`
9351 maildomain="$myhostname$mydomain"
9354 *) maildomain="$MAILDOMAIN";;
9357 '') dflt="$cf_by@$maildomain";;
9358 *) dflt="$cf_email";;
9360 rp='What is your e-mail address?'
9366 rp='Address does not look like an Internet one. Use it anyway?'
9380 : Ask e-mail of administrator
9383 If you or somebody else will be maintaining perl at your site, please
9384 fill in the correct e-mail address here so that they may be contacted
9385 if necessary. Currently, the "perlbug" program included with perl
9386 will send mail to this address in addition to perlbug@perl.org. You may
9387 enter "none" for no administrator.
9390 case "$perladmin" in
9391 '') dflt="$cf_email";;
9392 *) dflt="$perladmin";;
9394 rp='Perl administrator e-mail address'
9398 : determine whether to use a version number suffix for installed binaries
9401 Do you want to use a version number suffix for installed binaries? This
9402 will install 'perl$version' instead of 'perl', and likewise for other
9403 binaries like 'perldoc' and 'cpan'. This allows many versions of perl
9404 to be installed side-by-side. Unless you are a developer, you probably
9405 do *not* want to do this.
9407 case "$versiononly" in
9408 "$define"|[Yy]*|true) dflt='y' ;;
9411 rp="Do you want to use a version number suffix for installed binaries?"
9414 [yY]*) val="$define";;
9420 case "$versiononly" in
9421 "$define") inc_version_list=''
9422 inc_version_list_init=0
9426 : figure out how to guarantee perl startup
9427 : XXX Note that this currently takes advantage of the bug that binexp ignores
9428 : the Configure -Dinstallprefix setting, which in turn means that under
9429 : relocatable @INC, initialinstalllocation is what binexp started as.
9430 case "$startperl" in
9432 case "$sharpbang" in
9436 I can use the #! construct to start perl on your system. This will
9437 make startup of perl scripts faster, but may cause problems if you
9438 want to share those scripts and perl is not in a standard place
9439 ($initialinstalllocation/perl) on all your platforms. The alternative
9440 is to force a shell by starting the script with a single ':' character.
9443 case "$versiononly" in
9444 "$define") dflt="$initialinstalllocation/perl$version";;
9445 *) dflt="$initialinstalllocation/perl";;
9447 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
9450 none) startperl=": # use perl";;
9451 *) startperl="#!$ans"
9452 if $test 30 -lt `echo "$ans" | wc -c`; then
9455 WARNING: Some systems limit the #! command to 32 characters.
9456 If you experience difficulty running Perl scripts with #!, try
9457 installing Perl in a directory with a shorter pathname.
9463 *) startperl=": # use perl"
9468 echo "I'll use $startperl to start perl scripts."
9470 : figure best path for perl in scripts
9473 case "$versiononly" in
9474 "$define") perlpath="$initialinstalllocation/perl$version";;
9475 *) perlpath="$initialinstalllocation/perl";;
9477 case "$startperl" in
9482 I will use the "eval 'exec'" idiom to start Perl on your system.
9483 I can use the full path of your Perl binary for this purpose, but
9484 doing so may cause problems if you want to share those scripts and
9485 Perl is not always in a standard place ($initialinstalllocation/perl).
9488 dflt="$initialinstalllocation/perl"
9489 rp="What path shall I use in \"eval 'exec'\"?"
9496 case "$startperl" in
9498 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
9501 : determine where public executable scripts go
9502 set scriptdir scriptdir
9504 case "$scriptdir" in
9507 : guess some guesses
9508 $test -d /usr/share/scripts && dflt=/usr/share/scripts
9509 $test -d /usr/share/bin && dflt=/usr/share/bin
9510 $test -d /usr/local/script && dflt=/usr/local/script
9511 $test -d /usr/local/scripts && dflt=/usr/local/scripts
9512 $test -d $prefixexp/script && dflt=$prefixexp/script
9516 *) dflt="$scriptdir"
9521 Some installations have a separate directory just for executable scripts so
9522 that they can mount it across multiple architectures but keep the scripts in
9523 one spot. You might, for example, have a subdirectory of /usr/share for this.
9524 Or you might just lump your scripts in with all your other executables.
9528 rp='Where do you keep publicly executable scripts?'
9530 if $test "X$ansexp" != "X$scriptdirexp"; then
9536 : A little fix up for an irregularly named variable.
9537 installscript="$installscriptdir"
9539 : determine where add-on public executables go
9541 '') dflt=$siteprefix/bin ;;
9545 rp='Pathname where the add-on public executables should be installed?'
9550 : determine where add-on html pages go
9551 : There is no standard location, so try to copy the previously-selected
9552 : directory structure for the core html pages.
9553 case "$sitehtml1dir" in
9554 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9555 *) dflt=$sitehtml1dir ;;
9558 ''|' ') dflt=none ;;
9561 rp='Pathname where the site-specific html pages should be installed?'
9563 prefixvar=sitehtml1dir
9566 : determine where add-on library html pages go
9567 : There is no standard location, so try to copy the previously-selected
9568 : directory structure for the core html pages.
9569 case "$sitehtml3dir" in
9570 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9571 *) dflt=$sitehtml3dir ;;
9574 ''|' ') dflt=none ;;
9577 rp='Pathname where the site-specific library html pages should be installed?'
9579 prefixvar=sitehtml3dir
9582 : determine where add-on manual pages go
9583 case "$siteman1dir" in
9584 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
9585 *) dflt=$siteman1dir ;;
9588 ''|' ') dflt=none ;;
9591 rp='Pathname where the site-specific manual pages should be installed?'
9593 prefixvar=siteman1dir
9596 : determine where add-on library man pages go
9597 case "$siteman3dir" in
9598 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
9599 *) dflt=$siteman3dir ;;
9602 ''|' ') dflt=none ;;
9605 rp='Pathname where the site-specific library manual pages should be installed?'
9607 prefixvar=siteman3dir
9610 : determine where add-on public executable scripts go
9611 case "$sitescript" in
9612 '') dflt=$siteprefix/script
9613 $test -d $dflt || dflt=$sitebin ;;
9614 *) dflt="$sitescript" ;;
9617 rp='Pathname where add-on public executable scripts should be installed?'
9619 prefixvar=sitescript
9622 : see if backtrace exists
9623 set backtrace d_backtrace
9626 : add flags if using c backtrace
9627 case "$usecbacktrace" in
9628 "") usecbacktrace=$undef ;;
9630 case "$d_backtrace" in
9632 case " $ccflags " in
9633 *" -DUSE_C_BACKTRACE "*) ;; # Already there.
9634 *) ccflags="$ccflags -DUSE_C_BACKTRACE -g" ;;
9638 echo "This system does not support backtrace" >&4
9639 usecbacktrace=$undef
9645 : Check if faststdio is requested and available
9646 case "$usefaststdio" in
9647 $define|true|[yY]*|'')
9648 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
9658 Perl can be built to use 'fast stdio', which means using the stdio
9659 library but also directly manipulating the stdio buffers to enable
9660 faster I/O. Using stdio is better for backward compatibility (especially
9661 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
9662 interface has been preferred instead of stdio.
9664 If this doesn't make any sense to you, just accept the default '$dflt'.
9666 rp='Use the "fast stdio" if available?'
9669 y|Y) val="$define" ;;
9676 : define an is-a-typedef? function
9677 typedef='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;
9692 if $contains $type temp.E >/dev/null 2>&1; then
9698 *) eval "$var=\$varval";;
9701 : define an is-a-typedef? function that prompts if the type is not available.
9702 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9704 "") inclist="sys/types.h";;
9706 eval "varval=\$$var";
9710 for inc in $inclist; do
9711 echo "#include <$inc>" >>temp.c;
9713 echo "#ifdef $type" >> temp.c;
9714 echo "printf(\"We have $type\");" >> temp.c;
9715 echo "#endif" >> temp.c;
9716 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9718 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
9719 if $contains $type temp.E >/dev/null 2>&1; then
9720 echo "$type found." >&4;
9723 echo "$type NOT found." >&4;
9729 *) eval "$var=\$varval";;
9732 : see what type lseek is declared as in the kernel
9733 rp="What is the type used for lseek's offset on this system?"
9734 set off_t lseektype long stdio.h sys/types.h
9738 echo "Checking to see how big your file offsets are..." >&4
9740 #include <sys/types.h>
9744 printf("%d\n", (int)sizeof($lseektype));
9749 if eval $compile_ok; then
9750 lseeksize=`$run ./try`
9751 echo "Your file offsets are $lseeksize bytes long."
9755 echo "(I can't seem to compile the test program. Guessing...)"
9756 rp="What is the size of your file offsets (in bytes)?"
9762 : see what type file positions are declared as in the library
9763 rp="What is the type for file position used by fsetpos()?"
9764 set fpos_t fpostype long stdio.h sys/types.h
9767 : Check size for Fpos_t
9770 *_t) zzz="$fpostype" ;;
9773 echo "Checking the size of $zzz..." >&4
9775 #include <sys/types.h>
9782 printf("%d\n", (int)sizeof($fpostype));
9787 if eval $compile_ok; then
9791 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9794 echo "Your $zzz is $fpossize bytes long."
9800 echo "(I can't compile the test program. Guessing...)" >&4
9801 rp="What is the size of your file positions (in bytes)?"
9806 : Check for large file support
9807 # Backward compatibility (uselfs is deprecated).
9809 "$define"|true|[yY]*)
9812 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9814 uselargefiles="$define"
9818 case "$lseeksize:$fpossize" in
9821 You can have files larger than 2 gigabytes.
9824 *) case "$uselargefiles" in
9825 "$undef"|false|[nN]*) dflt='n' ;;
9830 Perl can be built to understand large files (files larger than 2 gigabytes)
9831 on some systems. To do so, Configure can be run with -Duselargefiles.
9833 If this doesn't make any sense to you, just accept the default '$dflt'.
9835 rp='Try to understand large files, if available?'
9838 y|Y) val="$define" ;;
9845 : Look for a hint-file generated 'call-back-unit'. If the
9846 : user has specified that a large files perl is to be built,
9847 : we may need to set or change some other defaults.
9848 if $test -f uselargefiles.cbu; then
9849 echo "Your platform has some specific hints regarding large file builds, using them..."
9850 . ./uselargefiles.cbu
9852 case "$uselargefiles" in
9854 if $test -f uselargefiles.cbu; then
9856 echo "Rechecking to see how big your file offsets are..." >&4
9858 #include <sys/types.h>
9862 printf("%d\n", (int)sizeof($lseektype));
9867 if eval $compile_ok; then
9868 lseeksize=`$run ./try`
9869 $echo "Your file offsets are now $lseeksize bytes long."
9873 echo "(I can't seem to compile the test program. Guessing...)"
9874 rp="What is the size of your file offsets (in bytes)?"
9879 *_t) zzz="$fpostype" ;;
9882 $echo $n "Rechecking the size of $zzz...$c" >&4
9884 #include <sys/types.h>
9891 printf("%d\n", (int)sizeof($fpostype));
9896 if eval $compile_ok; then
9901 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9904 echo " $fpossize bytes." >&4
9910 echo "(I can't compile the test program. Guessing...)" >&4
9911 rp="What is the size of your file positions (in bytes)?"
9920 : Check if we want perlio
9923 : Set the vendorbin variables
9924 case "$vendorprefix" in
9925 '') d_vendorbin="$undef"
9929 *) d_vendorbin="$define"
9930 : determine where vendor-supplied executables go.
9931 case "$vendorbin" in
9932 '') dflt=$vendorprefix/bin ;;
9933 *) dflt="$vendorbin" ;;
9936 rp='Pathname for the vendor-supplied executables directory?'
9939 vendorbinexp="$ansexp"
9945 : Set the vendorhtml1dir variables
9946 case "$vendorprefix" in
9947 '') vendorhtml1dir=''
9948 vendorhtml1direxp=''
9950 *) : determine where vendor-supplied html pages go.
9951 : There is no standard location, so try to copy the previously-selected
9952 : directory structure for the core html pages.
9953 : XXX Better default suggestions would be welcome.
9954 case "$vendorhtml1dir" in
9955 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9956 *) dflt=$vendorhtml1dir ;;
9959 ''|' ') dflt=none ;;
9962 rp='Pathname for the vendor-supplied html pages?'
9964 vendorhtml1dir="$ans"
9965 vendorhtml1direxp="$ansexp"
9968 : Use ' ' for none so value is preserved next time through Configure
9969 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9970 prefixvar=vendorhtml1dir
9973 : Set the vendorhtml3dir variables
9974 case "$vendorprefix" in
9975 '') vendorhtml3dir=''
9976 vendorhtml3direxp=''
9978 *) : determine where vendor-supplied module html pages go.
9979 : There is no standard location, so try to copy the previously-selected
9980 : directory structure for the core html pages.
9981 : XXX Better default suggestions would be welcome.
9982 case "$vendorhtml3dir" in
9983 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9984 *) dflt=$vendorhtml3dir ;;
9987 ''|' ') dflt=none ;;
9990 rp='Pathname for the vendor-supplied html pages?'
9992 vendorhtml3dir="$ans"
9993 vendorhtml3direxp="$ansexp"
9996 : Use ' ' for none so value is preserved next time through Configure
9997 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9998 prefixvar=vendorhtml3dir
10001 : Set the vendorman1dir variables
10002 case "$vendorprefix" in
10003 '') vendorman1dir=''
10004 vendorman1direxp=''
10006 *) : determine where vendor-supplied manual pages go.
10007 case "$vendorman1dir" in
10008 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
10009 *) dflt=$vendorman1dir ;;
10012 ''|' ') dflt=none ;;
10015 rp='Pathname for the vendor-supplied manual section 1 pages?'
10017 vendorman1dir="$ans"
10018 vendorman1direxp="$ansexp"
10021 : Use ' ' for none so value is preserved next time through Configure
10022 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
10023 prefixvar=vendorman1dir
10026 : Set the vendorman3dir variables
10027 case "$vendorprefix" in
10028 '') vendorman3dir=''
10029 vendorman3direxp=''
10031 *) : determine where vendor-supplied module manual pages go.
10032 case "$vendorman3dir" in
10033 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
10034 *) dflt=$vendorman3dir ;;
10037 ''|' ') dflt=none ;;
10040 rp='Pathname for the vendor-supplied manual section 3 pages?'
10042 vendorman3dir="$ans"
10043 vendorman3direxp="$ansexp"
10046 : Use ' ' for none so value is preserved next time through Configure
10047 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
10048 prefixvar=vendorman3dir
10051 : Set the vendorscript variables
10052 case "$vendorprefix" in
10053 '') d_vendorscript="$undef"
10057 *) d_vendorscript="$define"
10058 : determine where vendor-supplied scripts go.
10059 case "$vendorscript" in
10060 '') dflt=$vendorprefix/script
10061 $test -d $dflt || dflt=$vendorbin ;;
10062 *) dflt="$vendorscript" ;;
10066 The installation process will create a directory for
10067 vendor-supplied scripts.
10071 rp='Pathname for the vendor-supplied scripts directory?'
10073 vendorscript="$ans"
10074 vendorscriptexp="$ansexp"
10077 prefixvar=vendorscript
10080 : script used to emit important warnings
10083 if test \$# -gt 0; then
10088 echo "*** WARNING:" >&4
10089 sed -e 's/^/*** /' <msg >&4
10091 cat msg >>config.msg
10092 echo " " >>config.msg
10098 : see which of string.h or strings.h is needed
10100 strings=`./findhdr string.h`
10101 if $test "$strings" && $test -r "$strings"; then
10102 echo "Using <string.h> instead of <strings.h>." >&4
10106 strings=`./findhdr strings.h`
10107 if $test "$strings" && $test -r "$strings"; then
10108 echo "Using <strings.h> instead of <string.h>." >&4
10110 ./warn "No string header found -- You'll surely have problems."
10115 case "$i_string" in
10116 "$undef") strings=`./findhdr strings.h`;;
10117 *) strings=`./findhdr string.h`;;
10120 : see if qgcvt exists
10124 : Check what kind of doubles your system has
10125 $echo "Checking the kind of doubles you have..." >&4
10127 #$i_stdlib I_STDLIB
10128 #define DOUBLESIZE $doublesize
10130 #include <stdlib.h>
10133 static const double d = -0.1;
10135 unsigned const char* b = (unsigned const char*)(&d);
10136 #if DOUBLESIZE == 4
10137 if (b[0] == 0xCD && b[3] == 0xBD) {
10138 /* IEEE 754 32-bit little-endian */
10142 if (b[0] == 0xBD && b[3] == 0xCD) {
10143 /* IEEE 754 32-bit big-endian */
10147 if (b[0] == 0xCC && b[3] == 0xCC) {
10148 /* VAX format F, 32-bit PDP-style mixed endian. */
10153 #if DOUBLESIZE == 8
10154 if (b[0] == 0x9A && b[7] == 0xBF) {
10155 /* IEEE 754 64-bit little-endian */
10159 if (b[0] == 0xBF && b[7] == 0x9A) {
10160 /* IEEE 754 64-bit big-endian */
10164 if (b[0] == 0x99 && b[3] == 0xBF && b[4] == 0x9A && b[7] == 0x99) {
10165 /* ARM mixed endian: two little-endian 32-bit floats, in big endian order:
10166 * 4 5 6 7 0 1 2 3 (MSB = 7, LSB = 0)
10167 * 99 99 b9 bf 9a 99 99 99 */
10171 if (b[0] == 0x99 && b[3] == 0x9A && b[4] == 0xBF && b[7] == 0x99) {
10172 /* The opposite of case 7, mixed endian: two big-endian 32-bit floats,
10173 * in little endian order: 3 2 1 0 7 6 5 4 (MSB = 7, LSB = 0)
10174 * 99 99 99 9a bf b9 99 99 */
10178 if (b[0] == 0xCC && b[7] == 0xCC) {
10179 /* VAX format D, 64-bit PDP-style mixed endian. */
10183 if (b[0] == 0xD9 && b[7] == 0x99) {
10184 /* VAX format G, 64-bit PDP-style mixed endian. */
10189 #if DOUBLESIZE == 16
10190 if (b[0] == 0x9A && b[15] == 0xBF) {
10191 /* IEEE 754 128-bit little-endian */
10195 if (b[0] == 0xBF && b[15] == 0x9A) {
10196 /* IEEE 754 128-bit big-endian */
10201 /* Then there are old mainframe/miniframe formats like IBM and CRAY.
10202 * Whether those environments can still build Perl is debatable. */
10203 printf("-1\n"); /* unknown */
10208 if eval $compile; then
10209 doublekind=`$run ./try`
10213 case "$doublekind" in
10214 1) echo "You have IEEE 754 32-bit little endian doubles." >&4 ;;
10215 2) echo "You have IEEE 754 32-bit big endian doubles." >&4 ;;
10216 3) echo "You have IEEE 754 64-bit little endian doubles." >&4 ;;
10217 4) echo "You have IEEE 754 64-bit big endian doubles." >&4 ;;
10218 5) echo "You have IEEE 754 128-bit little endian doubles." >&4 ;;
10219 6) echo "You have IEEE 754 128-bit big endian doubles." >&4 ;;
10220 7) echo "You have IEEE 754 64-bit mixed endian doubles (32-bit LEs in BE)." >&4 ;;
10221 8) echo "You have IEEE 754 64-bit mixed endian doubles (32-bit BEs in LE)." >&4 ;;
10222 9) echo "You have VAX format F 32-bit PDP-style mixed endian doubles." >&4 ;;
10223 10) echo "You have VAX format D 64-bit PDP-style mixed endian doubles." >&4 ;;
10224 11) echo "You have VAX format G 64-bit PDP-style mixed endian doubles." >&4 ;;
10225 *) echo "Cannot figure out your double. You CRAY, or something?" >&4 ;;
10229 : Check print/scan long double stuff
10232 if $test X"$d_longdbl" = X"$define"; then
10234 echo "Checking how to print long doubles..." >&4
10236 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
10237 $cat >try.c <<'EOCP'
10238 #include <sys/types.h>
10241 double d = 123.456;
10242 printf("%.3f\n", d);
10246 if eval $compile; then
10250 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
10251 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
10252 echo "We will use %f."
10258 if $test X"$sPRIfldbl" = X; then
10259 $cat >try.c <<'EOCP'
10260 #include <sys/types.h>
10263 long double d = 123.456;
10264 printf("%.3Lf\n", d);
10268 if eval $compile; then
10272 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
10273 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
10274 echo "We will use %Lf."
10280 if $test X"$sPRIfldbl" = X; then
10281 $cat >try.c <<'EOCP'
10282 #include <sys/types.h>
10285 long double d = 123.456;
10286 printf("%.3llf\n", d);
10290 if eval $compile; then
10294 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
10295 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
10296 echo "We will use %llf."
10302 if $test X"$sPRIfldbl" = X; then
10303 $cat >try.c <<'EOCP'
10304 #include <sys/types.h>
10307 long double d = 123.456;
10308 printf("%.3lf\n", d);
10312 if eval $compile; then
10316 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
10317 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
10318 echo "We will use %lf."
10324 if $test X"$sPRIfldbl" = X; then
10325 echo "Cannot figure out how to print long doubles." >&4
10327 sSCNfldbl=$sPRIfldbl # expect consistency
10334 case "$sPRIfldbl" in
10335 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
10336 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
10337 d_SCNfldbl="$undef";
10339 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
10340 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
10341 d_SCNfldbl="$define";
10345 : Before committing on uselongdouble, see whether that looks sane.
10346 if $test "$uselongdouble" = "$define"; then
10349 echo "Checking if your long double math functions work right..." >&4
10354 printf("%"$sPRIgldbl"\n", sqrtl(logl(expl(cosl(sinl(0.0L))))+powl(2.0L, 3.0L)));
10357 case "$osname:$gccversion" in
10358 aix:) saveccflags="$ccflags"
10359 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
10362 if eval $compile_ok; then
10366 3) echo "Your long double math functions are working correctly." >&4 ;;
10367 *) echo "Your long double math functions are broken, not using long doubles." >&4
10368 uselongdouble=$undef
10372 case "$osname:$gccversion" in
10373 aix:) ccflags="$saveccflags" ;; # restore
10377 : Check how to convert floats to strings.
10379 if test "X$d_Gconvert" = X; then
10382 echo "Checking for an efficient way to convert floats to strings."
10384 case "$uselongdouble" in
10385 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
10387 case "$d_longdbl" in
10388 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
10390 case "$d_PRIgldbl" in
10391 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
10394 #ifdef TRY_gconvert
10395 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
10396 char *myname = "gconvert";
10399 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
10400 char *myname = "gcvt";
10403 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
10404 char *myname = "qgcvt";
10405 #define DOUBLETYPE long double
10408 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
10409 #ifdef HAS_PRIgldbl
10410 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
10412 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
10415 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
10417 char *myname = "sprintf";
10421 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
10422 #define DOUBLETYPE long double
10424 #define DOUBLETYPE double
10430 #$i_stdlib I_STDLIB
10432 #include <stdlib.h>
10434 #$i_string I_STRING
10436 # include <string.h>
10438 # include <strings.h>
10441 int checkit(char *expect, char *got)
10443 if (strcmp(expect, got)) {
10444 printf("%s oddity: Expected %s, got %s\n",
10445 myname, expect, got);
10455 /* This must be 1st test on (which?) platform */
10456 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
10457 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
10458 checkit("0.1", buf);
10460 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
10461 checkit("0.01", buf);
10463 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
10464 checkit("0.001", buf);
10466 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
10467 checkit("0.0001", buf);
10469 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
10470 if (strlen(buf) > 5)
10471 checkit("9e-005", buf); /* for Microsoft ?? */
10473 checkit("9e-05", buf);
10475 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
10478 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
10479 checkit("1.1", buf);
10481 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
10482 checkit("1.01", buf);
10484 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
10485 checkit("1.001", buf);
10487 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
10488 checkit("1.0001", buf);
10490 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
10491 checkit("1.00001", buf);
10493 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
10494 checkit("1.000001", buf);
10496 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
10499 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
10500 checkit("-1", buf);
10502 /* Some Linux gcvt's give 1.e+5 here. */
10503 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
10504 checkit("100000", buf);
10506 /* Some Linux gcvt's give -1.e+5 here. */
10507 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
10508 checkit("-100000", buf);
10510 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
10511 checkit("123.456", buf);
10513 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
10514 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
10515 /* 34 should be enough to scare even long double
10516 * places into using the e notation. */
10517 if (strlen(buf) > 5)
10518 checkit("1e+034", buf); /* for Microsoft */
10520 checkit("1e+34", buf);
10522 /* For Perl, if you add additional tests here, also add them to
10523 * t/base/num.t for benefit of platforms not using Configure or
10524 * overriding d_Gconvert */
10529 : first add preferred functions to our list
10531 for xxx_convert in $gconvert_preference; do
10532 case $xxx_convert in
10533 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
10534 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
10537 : then add any others
10538 for xxx_convert in gconvert gcvt sprintf; do
10539 case "$xxx_list" in
10541 *) xxx_list="$xxx_list $xxx_convert" ;;
10545 case "$d_longdbl$uselongdouble" in
10547 : again, add preferred functions to our list first
10549 for xxx_convert in $gconvert_ld_preference; do
10550 case $xxx_convert in
10551 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
10552 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
10555 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
10556 for xxx_convert in qgcvt sprintf $xxx_list; do
10557 case "$xxx_ld_list" in
10558 $xxx_convert*|*" $xxx_convert"*) ;;
10559 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
10562 : if sprintf cannot do long doubles, move it to the end
10563 if test "$d_PRIgldbl" != "$define"; then
10564 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
10566 : if no qgcvt, remove it
10567 if test "$d_qgcvt" != "$define"; then
10568 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
10571 xxx_list="$xxx_ld_list"
10575 for xxx_convert in $xxx_list; do
10576 echo "Trying $xxx_convert..."
10577 $rm -f try try$_o core
10578 set try -DTRY_$xxx_convert
10579 if eval $compile; then
10580 echo "$xxx_convert() found." >&4
10581 if $run ./try; then
10582 echo "I'll use $xxx_convert to convert floats into a string." >&4
10585 echo "...But $xxx_convert didn't work as I expected."
10589 echo "$xxx_convert NOT found." >&4
10593 if test X$xxx_convert = X; then
10594 echo "*** WHOA THERE!!! ***" >&4
10595 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
10596 xxx_convert=sprintf
10599 case "$xxx_convert" in
10600 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
10601 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
10602 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
10603 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
10604 "$define$define$define")
10605 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
10606 "$define$define$undef")
10607 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
10608 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
10616 : see if _fwalk exists
10620 : Initialize h_fcntl
10623 : Initialize h_sysfile
10626 : access call always available on UNIX
10627 set access d_access
10630 : locate the flags for 'access()'
10631 case "$d_access" in
10634 $cat >access.c <<EOCP
10635 #include <sys/types.h>
10640 #include <sys/file.h>
10643 #include <unistd.h>
10645 #$i_stdlib I_STDLIB
10647 #include <stdlib.h>
10653 : check sys/file.h first, no particular reason here
10654 if $test `./findhdr sys/file.h` && \
10655 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
10657 echo "<sys/file.h> defines the *_OK access constants." >&4
10658 elif $test `./findhdr fcntl.h` && \
10659 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
10661 echo "<fcntl.h> defines the *_OK access constants." >&4
10662 elif $test `./findhdr unistd.h` && \
10663 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
10664 echo "<unistd.h> defines the *_OK access constants." >&4
10666 echo "I can't find the four *_OK access constants--I'll use mine." >&4
10672 : see if accessx exists
10673 set accessx d_accessx
10676 : see if acosh exists
10680 : see if aintl exists
10684 : see if alarm exists
10688 : see if 64bit time functions exists
10690 set ctime64 d_ctime64
10693 set localtime64 d_localtime64
10696 set gmtime64 d_gmtime64
10699 set mktime64 d_mktime64
10702 set difftime64 d_difftime64
10705 set asctime64 d_asctime64
10708 : see if POSIX threads are available
10709 set pthread.h i_pthread
10712 : define a function to check prototypes
10713 $cat > protochk <<EOSH
10716 optimize="$optimize"
10718 prototype="$prototype"
10721 usethreads=$usethreads
10722 i_pthread=$i_pthread
10723 pthread_h_first=$pthread_h_first
10726 $cat >> protochk <<'EOSH'
10731 while test $# -ge 2; do
10733 $define) echo "#include <$2>" >> try.c ;;
10734 literal) echo "$2" >> try.c ;;
10736 # Extra magic for the benefit of systems that need pthread.h
10737 # to be included early to correctly detect threadsafe functions.
10738 # Such functions must guarantee themselves, though, that the usethreads
10739 # and i_pthread have been defined, before calling protochk.
10740 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
10741 echo "#include <pthread.h>" >> try.c
10746 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
10747 cat >> try.c <<'EOCP'
10748 #ifdef CAN_PROTOTYPE
10749 #define _(args) args
10754 echo "$foo" >> try.c
10755 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
10756 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
10762 $eunicefix protochk
10764 : Define hasproto macro for Configure internal use
10765 hasproto='varname=$1; func=$2; shift; shift;
10766 while $test $# -ge 2; do
10768 $define) echo "#include <$2>";;
10772 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
10773 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
10774 echo "$func() prototype found.";
10777 echo "$func() prototype NOT found.";
10784 : see if sys/types.h has to be included
10785 set sys/types.h i_systypes
10788 : see if sys/select.h has to be included
10789 set sys/select.h i_sysselct
10792 : Define hasfield macro for Configure internal use
10793 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
10794 while $test $# -ge 2; do
10796 $define) echo "#include <$2>";;
10800 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
10802 if eval $compile; then
10811 : see if we should include time.h, sys/time.h, or both
10813 if test "X$timeincl" = X; then
10814 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
10815 $echo $n "I'm now running the test program...$c"
10817 #include <sys/types.h>
10822 #ifdef SYSTIMEKERNEL
10825 #include <sys/time.h>
10828 #include <sys/select.h>
10830 #$i_stdlib I_STDLIB
10832 #include <stdlib.h>
10838 struct timeval bar;
10841 struct timezone tzp;
10843 if (foo.tm_sec == foo.tm_sec)
10846 if (bar.tv_sec == bar.tv_sec)
10853 for s_timezone in '-DS_TIMEZONE' ''; do
10855 for s_timeval in '-DS_TIMEVAL' ''; do
10856 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10857 for i_time in '' '-DI_TIME'; do
10858 for i_systime in '-DI_SYSTIME' ''; do
10861 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10862 if eval $compile; then
10863 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
10867 $echo $n "Succeeded with $flags$c"
10879 *SYSTIMEKERNEL*) i_systimek="$define"
10880 timeincl=`./findhdr sys/time.h`
10881 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10882 *) i_systimek="$undef";;
10885 *I_TIME*) i_time="$define"
10886 timeincl=`./findhdr time.h`" $timeincl"
10887 echo "We'll include <time.h>." >&4;;
10888 *) i_time="$undef";;
10891 *I_SYSTIME*) i_systime="$define"
10892 timeincl=`./findhdr sys/time.h`" $timeincl"
10893 echo "We'll include <sys/time.h>." >&4;;
10894 *) i_systime="$undef";;
10898 : see if struct tm knows about tm_zone
10899 case "$i_systime$i_time" in
10902 echo "Checking to see if your struct tm has tm_zone field..." >&4
10903 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
10911 case "$d_tm_tm_zone" in
10912 "$define") echo "Yes, it does." ;;
10913 *) echo "No, it doesn't." ;;
10915 : see if struct tm knows about tm_gmtoff
10916 case "$i_systime$i_time" in
10919 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
10920 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
10928 case "$d_tm_tm_gmtoff" in
10929 "$define") echo "Yes, it does." ;;
10930 *) echo "No, it doesn't." ;;
10933 : see if asctime_r exists
10934 set asctime_r d_asctime_r
10936 case "$d_asctime_r" in
10938 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10939 case "$d_asctime_r_proto:$usethreads" in
10940 ":define") d_asctime_r_proto=define
10941 set d_asctime_r_proto asctime_r $hdrs
10945 case "$d_asctime_r_proto" in
10947 case "$asctime_r_proto" in
10948 ''|0) try='char* asctime_r(const struct tm*, char*);'
10949 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SB ;;
10951 case "$asctime_r_proto" in
10952 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
10953 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SBI ;;
10955 case "$asctime_r_proto" in
10956 ''|0) try='int asctime_r(const struct tm*, char*);'
10957 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SB ;;
10959 case "$asctime_r_proto" in
10960 ''|0) try='int asctime_r(const struct tm*, char*, int);'
10961 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SBI ;;
10963 case "$asctime_r_proto" in
10964 ''|0) d_asctime_r=undef
10966 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
10967 * ) case "$asctime_r_proto" in
10968 REENTRANT_PROTO*) ;;
10969 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
10971 echo "Prototype: $try" ;;
10974 *) case "$usethreads" in
10975 define) echo "asctime_r has no prototype, not using it." >&4 ;;
10982 *) asctime_r_proto=0
10986 : see if asinh exists
10990 : see if atanh exists
10994 : see if atolf exists
10998 : see if atoll exists
11002 : Look for GCC-style attribute format
11003 case "$d_attribute_format" in
11006 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
11007 $cat >attrib.c <<'EOCP'
11009 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
11011 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11012 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11013 echo "Your C compiler doesn't support __attribute__((format))."
11016 echo "Your C compiler supports __attribute__((format))."
11020 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11024 *) val="$d_attribute_format" ;;
11026 set d_attribute_format
11030 : Look for GCC-style attribute format with null format allowed
11031 case "$d_printf_format_null" in
11032 '') case "$d_attribute_format" in
11035 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
11036 $cat >attrib.c <<EOCP
11038 #$i_stdlib I_STDLIB
11040 #include <stdlib.h>
11042 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
11043 int null_printf (char* pat,...) { return (int)pat; }
11044 int main () { exit(null_printf(NULL)); }
11046 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
11047 : run the executable in case it produces a run-time warning
11048 if $run ./attrib >>attrib.out 2>&1; then
11049 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11050 echo "Your C compiler doesn't allow __printf__ format to be null."
11053 echo "Your C compiler allows __printf__ format to be null."
11057 echo "Your C compiler executable failed with __printf__ format null."
11061 echo "Your C compiler fails with __printf__ format null."
11068 *) val="$d_printf_format_null" ;;
11070 set d_printf_format_null
11074 : Look for GCC-style attribute malloc
11075 case "$d_attribute_malloc" in
11078 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
11079 $cat >attrib.c <<'EOCP'
11081 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
11083 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11084 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11085 echo "Your C compiler doesn't support __attribute__((malloc))."
11088 echo "Your C compiler supports __attribute__((malloc))."
11092 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11096 *) val="$d_attribute_malloc" ;;
11098 set d_attribute_malloc
11102 : Look for GCC-style attribute nonnull
11103 case "$d_attribute_nonnull" in
11106 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
11107 $cat >attrib.c <<'EOCP'
11109 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
11111 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11112 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11113 echo "Your C compiler doesn't support __attribute__((nonnull))."
11116 echo "Your C compiler supports __attribute__((nonnull))."
11120 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11124 *) val="$d_attribute_nonnull" ;;
11126 set d_attribute_nonnull
11130 : Look for GCC-style attribute noreturn
11131 case "$d_attribute_noreturn" in
11134 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
11135 $cat >attrib.c <<'EOCP'
11137 void fall_over_dead( void ) __attribute__((noreturn));
11139 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11140 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11141 echo "Your C compiler doesn't support __attribute__((noreturn))."
11144 echo "Your C compiler supports __attribute__((noreturn))."
11148 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11152 *) val="$d_attribute_noreturn" ;;
11154 set d_attribute_noreturn
11158 : Look for GCC-style attribute pure
11159 case "$d_attribute_pure" in
11162 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
11163 $cat >attrib.c <<'EOCP'
11165 int square( int n ) __attribute__((pure));
11167 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11168 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11169 echo "Your C compiler doesn't support __attribute__((pure))."
11172 echo "Your C compiler supports __attribute__((pure))."
11176 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11180 *) val="$d_attribute_pure" ;;
11182 set d_attribute_pure
11186 : Look for GCC-style attribute unused
11187 case "$d_attribute_unused" in
11190 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
11191 $cat >attrib.c <<'EOCP'
11193 int do_something( int dummy __attribute__((unused)), int n );
11195 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11196 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11197 echo "Your C compiler doesn't support __attribute__((unused))."
11200 echo "Your C compiler supports __attribute__((unused))."
11204 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11208 *) val="$d_attribute_unused" ;;
11210 set d_attribute_unused
11214 : Look for GCC-style attribute deprecated
11215 case "$d_attribute_deprecated" in
11218 echo "Checking whether your compiler can handle __attribute__((deprecated)) ..." >&4
11219 $cat >attrib.c <<'EOCP'
11221 int I_am_deprecated(void) __attribute__((deprecated));
11223 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11224 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11225 echo "Your C compiler doesn't support __attribute__((deprecated))."
11228 echo "Your C compiler supports __attribute__((deprecated))."
11232 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11236 *) val="$d_attribute_deprecated" ;;
11238 set d_attribute_deprecated
11242 : Look for GCC-style attribute warn_unused_result
11243 case "$d_attribute_warn_unused_result" in
11246 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
11247 $cat >attrib.c <<'EOCP'
11249 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
11251 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11252 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11253 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
11256 echo "Your C compiler supports __attribute__((warn_unused_result))."
11260 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11264 *) val="$d_attribute_warn_unused_result" ;;
11266 set d_attribute_warn_unused_result
11270 : see if bcmp exists
11274 : see if bcopy exists
11278 : see if getpgrp exists
11279 set getpgrp d_getpgrp
11282 case "$d_getpgrp" in
11285 echo "Checking to see which flavor of getpgrp is in use..."
11287 #$i_unistd I_UNISTD
11288 #include <sys/types.h>
11290 # include <unistd.h>
11292 #$i_stdlib I_STDLIB
11294 #include <stdlib.h>
11298 if (getuid() == 0) {
11299 printf("(I see you are running Configure as super-user...)\n");
11302 #ifdef TRY_BSD_PGRP
11303 if (getpgrp(1) == 0)
11312 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11313 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
11315 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11316 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
11319 echo "I can't seem to compile and run the test program."
11321 xxx="a USG one, i.e. you use getpgrp()."
11323 # SVR4 systems can appear rather BSD-ish.
11324 case "$i_unistd" in
11326 xxx="a BSD one, i.e. you use getpgrp(pid)."
11330 xxx="probably a USG one, i.e. you use getpgrp()."
11335 echo "Assuming your getpgrp is $xxx" >&4
11344 : see if setpgrp exists
11345 set setpgrp d_setpgrp
11348 case "$d_setpgrp" in
11351 echo "Checking to see which flavor of setpgrp is in use..."
11353 #$i_unistd I_UNISTD
11354 #include <sys/types.h>
11356 # include <unistd.h>
11358 #$i_stdlib I_STDLIB
11360 #include <stdlib.h>
11364 if (getuid() == 0) {
11365 printf("(I see you are running Configure as super-user...)\n");
11368 #ifdef TRY_BSD_PGRP
11369 if (-1 == setpgrp(1, 1))
11372 if (setpgrp() != -1)
11378 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11379 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
11381 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11382 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
11385 echo "(I can't seem to compile and run the test program.)"
11387 xxx="a USG one, i.e. you use setpgrp()."
11389 # SVR4 systems can appear rather BSD-ish.
11390 case "$i_unistd" in
11392 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
11396 xxx="probably a USG one, i.e. you use setpgrp()."
11401 echo "Assuming your setpgrp is $xxx" >&4
11410 : Look for GCC-style __builtin_choose_expr
11411 case "$d_builtin_choose_expr" in
11414 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
11415 $cat >try.c <<'EOCP'
11416 #include <assert.h>
11417 #include <stdlib.h>
11420 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
11423 assert( SYRINX(1) == 2112 );
11424 assert( SYRINX(1) != 5150 );
11425 assert( SYRINX(0) == 5150 );
11426 assert( SYRINX(0) != 2112 );
11427 puts( "All good!" );
11433 if eval $compile && $run ./try; then
11434 echo "Your C compiler supports __builtin_choose_expr."
11437 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
11441 *) val="$d_builtin_choose_expr" ;;
11444 set d_builtin_choose_expr
11448 : Look for GCC-style __builtin_expect
11449 case "$d_builtin_expect" in
11452 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
11453 $cat >try.c <<'EOCP'
11456 if ( __builtin_expect(n, 0) ) n = 1;
11457 /* Remember shell exit code truth is 0, C truth is non-zero */
11462 if eval $compile && $run ./try; then
11463 echo "Your C compiler supports __builtin_expect."
11466 echo "Your C compiler doesn't seem to understand __builtin_expect."
11470 *) val="$d_builtin_expect" ;;
11473 set d_builtin_expect
11477 : see if bzero exists
11481 : see if stdarg is available
11483 if $test `./findhdr stdarg.h`; then
11484 echo "<stdarg.h> found." >&4
11487 echo "<stdarg.h> NOT found." >&4
11491 : see if varargs is available
11493 if $test `./findhdr varargs.h`; then
11494 echo "<varargs.h> found." >&4
11496 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
11499 : set up the varargs testing programs
11500 $cat > varargs.c <<EOP
11502 #include <stdarg.h>
11505 #include <varargs.h>
11509 int f(char *p, ...)
11523 p = va_arg(ap, char *);
11529 $cat > varargs <<EOP
11531 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
11540 : now check which varargs header should be included
11546 if `./varargs I_STDARG`; then
11548 elif `./varargs I_VARARGS`; then
11553 if `./varargs I_VARARGS`; then
11561 echo "*** WHOA THERE!!! ***" >&4
11562 echo " Your C compiler \"$cc\" doesn't seem to support stdarg or varargs!" >&4
11563 case "$knowitall" in
11565 echo " I'm giving up; maybe you can try again with a different compiler?" >&4
11569 echo "I could not find the definition for va_dcl... You have problems..." >&4
11570 val="$undef"; set i_stdarg; eval $setvar
11571 val="$undef"; set i_varargs; eval $setvar
11576 case "$i_varhdr" in
11578 val="$define"; set i_stdarg; eval $setvar
11579 val="$undef"; set i_varargs; eval $setvar
11582 val="$undef"; set i_stdarg; eval $setvar
11583 val="$define"; set i_varargs; eval $setvar
11586 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
11590 : see if the Compiler supports C99 variadic macros
11591 case "$i_stdarg$i_stdlib" in
11593 echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
11596 #include <stdarg.h>
11598 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
11602 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
11608 if eval $compile && $run ./try 2>&1 >/dev/null; then
11609 case "`$run ./try`" in
11611 echo "You have C99 variadic macros." >&4
11612 d_c99_variadic_macros="$define"
11615 echo "You don't have functional C99 variadic macros." >&4
11616 d_c99_variadic_macros="$undef"
11620 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
11621 d_c99_variadic_macros="$undef"
11626 echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
11627 d_c99_variadic_macros="$undef"
11631 : see if signal is declared as pointer to function returning int or void
11633 xxx=`./findhdr signal.h`
11634 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
11635 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
11636 echo "You have int (*signal())() instead of void." >&4
11638 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
11639 echo "You have void (*signal())()." >&4
11641 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
11642 echo "You have int (*signal())() instead of void." >&4
11644 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
11645 echo "You have void (*signal())()." >&4
11648 case "$d_voidsig" in
11650 echo "I can't determine whether signal handler returns void or int..." >&4
11652 rp="What type does your signal handler return?"
11655 v*) val="$define";;
11659 echo "As you already told me, signal handler returns void." >&4
11662 *) echo "As you already told me, signal handler returns int." >&4
11669 case "$d_voidsig" in
11670 "$define") signal_t="void";;
11671 *) signal_t="int";;
11675 : check for ability to cast large floats to 32-bit ints.
11677 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
11678 if $test "$intsize" -ge 4; then
11685 #$i_stdlib I_STDLIB
11687 #include <stdlib.h>
11689 #include <sys/types.h>
11690 #include <signal.h>
11691 $signal_t blech(int s) { exit(3); }
11698 signal(SIGFPE, blech);
11700 /* Don't let compiler optimize the test away. Store the number
11701 in a writable string for gcc to pass to sscanf under HP-UX.
11703 sprintf(str, "2147483647");
11704 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
11708 /* x86 processors will probably give 0x8000 0000, which is a
11709 sign change. We don't want that. We want to mimic SPARC
11710 behavior here, which is to preserve the sign and give
11713 if (i32 != ($xxx) f)
11719 if eval $compile_ok; then
11720 $run ./try 2>/dev/null
11723 echo "(I can't seem to compile the test program--assuming it can't)"
11728 echo "Yup, it can."
11731 echo "Nope, it can't."
11738 : check for ability to cast negative floats to unsigned
11740 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
11743 #$i_stdlib I_STDLIB
11745 #include <stdlib.h>
11747 #include <sys/types.h>
11748 #include <signal.h>
11749 $signal_t blech(int s) { exit(7); }
11750 $signal_t blech_in_list(int s) { exit(4); }
11751 unsigned long dummy_long(unsigned long p) { return p; }
11752 unsigned int dummy_int(unsigned int p) { return p; }
11753 unsigned short dummy_short(unsigned short p) { return p; }
11757 unsigned long along;
11759 unsigned short ashort;
11763 /* Frustrate gcc-2.7.2's optimizer which failed this test with
11764 a direct f = -123. assignment. gcc-2.8.0 reportedly
11765 optimized the whole file away
11767 /* Store the number in a writable string for gcc to pass to
11768 sscanf under HP-UX.
11770 sprintf(str, "-123");
11771 sscanf(str, "%lf", &f); /* f = -123.; */
11773 signal(SIGFPE, blech);
11774 along = (unsigned long)f;
11775 aint = (unsigned int)f;
11776 ashort = (unsigned short)f;
11777 if (along != (unsigned long)-123)
11779 if (aint != (unsigned int)-123)
11781 if (ashort != (unsigned short)-123)
11783 sprintf(str, "1073741824.");
11784 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
11787 along = (unsigned long)f;
11788 if (along != 0x80000000)
11792 along = (unsigned long)f;
11793 if (along != 0x7fffffff)
11797 along = (unsigned long)f;
11798 if (along != 0x80000001)
11802 signal(SIGFPE, blech_in_list);
11803 sprintf(str, "123.");
11804 sscanf(str, "%lf", &f); /* f = 123.; */
11805 along = dummy_long((unsigned long)f);
11806 aint = dummy_int((unsigned int)f);
11807 ashort = dummy_short((unsigned short)f);
11808 if (along != (unsigned long)123)
11810 if (aint != (unsigned int)123)
11812 if (ashort != (unsigned short)123)
11819 if eval $compile_ok; then
11820 $run ./try 2>/dev/null
11823 echo "(I can't seem to compile the test program--assuming it can't)"
11826 case "$castflags" in
11828 echo "Yup, it can."
11831 echo "Nope, it can't."
11838 : see if cbrt exists
11842 : see if vprintf exists
11844 if set vprintf val -f d_vprintf; eval $csym; $val; then
11845 echo 'vprintf() found.' >&4
11848 #$i_stdarg I_STDARG /* Only one of these can be defined by i_varhrd */
11849 #$i_varargs I_VARARGS
11851 #$i_stdlib I_STDLIB
11852 #$i_unistd I_UNISTD
11855 # include <stdarg.h>
11856 #else /* I_VARARGS */
11857 # include <varargs.h>
11861 # include <unistd.h>
11865 # include <stdlib.h>
11868 #include <stdio.h> /* vsprintf prototype */
11871 void xxx(int n, ...)
11876 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11878 int main() { xxx(1, "foo"); }
11880 #else /* I_VARARGS */
11888 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11890 int main() { xxx("foo"); }
11896 if eval $compile_ok; then
11897 if $run ./try; then
11898 echo "Your vsprintf() returns (int)." >&4
11901 echo "Your vsprintf() returns (char*)." >&4
11905 echo 'I am unable to compile the vsprintf() test program.' >&4
11906 # We shouldn't get here. If we do, assume the standard signature,
11907 # not the old BSD one.
11908 echo 'Guessing that vsprintf() returns (int).' >&4
11912 echo 'vprintf() NOT found.' >&4
11923 : see if chown exists
11927 : see if chroot exists
11928 set chroot d_chroot
11931 : see if chsize exists
11932 set chsize d_chsize
11935 : see if class exists
11939 : see if clearenv exists
11940 set clearenv d_clearenv
11943 : Define hasstruct macro for Configure internal use
11944 hasstruct='varname=$1; struct=$2; shift; shift;
11945 while $test $# -ge 2; do
11947 $define) echo "#include <$2>";;
11951 echo "int main () { struct $struct foo; }" >> try.c;
11953 if eval $compile; then
11962 : see whether socket exists
11966 $echo $n "Hmm... $c" >&4
11967 if set socket val -f d_socket; eval $csym; $val; then
11968 echo "Looks like you have Berkeley networking support." >&4
11970 if set setsockopt val -f; eval $csym; $val; then
11973 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
11974 d_oldsock="$define"
11977 if $contains socklib libc.list >/dev/null 2>&1; then
11978 echo "Looks like you have Berkeley networking support." >&4
11980 : we will have to assume that it supports the 4.2 BSD interface
11983 echo "You don't have Berkeley networking in libc$_a..." >&4
11984 if test "X$d_socket" = "X$define"; then
11985 echo "...but you seem to believe that you have sockets." >&4
11987 for net in net socket
11989 if test -f $sysroot/usr/lib/lib$net$_a; then
11990 ( ($nm $nm_opt $sysroot/usr/lib/lib$net$_a | eval $nm_extract) || \
11991 $ar t $sysroot/usr/lib/lib$net$_a) 2>/dev/null >> libc.list
11992 if $contains socket libc.list >/dev/null 2>&1; then
11997 echo "...but the Wollongong group seems to have hacked it in." >&4
11998 sockethdr="-I$sysroot/usr/netinclude"
12001 echo "Found Berkeley sockets interface in lib$net." >&4
12002 if $contains setsockopt libc.list >/dev/null 2>&1; then
12005 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
12006 d_oldsock="$define"
12012 if test "X$d_socket" != "X$define"; then
12013 echo "or anywhere else I see." >&4
12021 : see if socketpair exists
12022 set socketpair d_sockpair
12027 echo "Checking the availability sa_len in the sock struct ..." >&4
12029 #include <sys/types.h>
12030 #include <sys/socket.h>
12032 struct sockaddr sa;
12033 return (sa.sa_len);
12037 set try; if eval $compile; then
12040 set d_sockaddr_sa_len; eval $setvar
12044 echo "Checking the availability struct sockaddr_in6 ..." >&4
12046 #include <sys/types.h>
12047 #include <sys/socket.h>
12048 #include <netinet/in.h>
12050 struct sockaddr_in6 sin6;
12051 return (sin6.sin6_family);
12055 set try; if eval $compile; then
12058 set d_sockaddr_in6; eval $setvar
12062 echo "Checking the availability sin6_scope_id in struct sockaddr_in6 ..." >&4
12064 #include <sys/types.h>
12065 #include <sys/socket.h>
12066 #include <netinet/in.h>
12068 struct sockaddr_in6 sin6;
12069 return (sin6.sin6_scope_id);
12073 set try; if eval $compile; then
12076 set d_sin6_scope_id; eval $setvar
12080 echo "Checking the availability struct ip_mreq ..." >&4
12082 #include <sys/types.h>
12083 #include <sys/socket.h>
12084 #include <netinet/in.h>
12086 struct ip_mreq mreq;
12087 return (mreq.imr_multiaddr.s_addr);
12091 set try; if eval $compile; then
12094 set d_ip_mreq; eval $setvar
12098 echo "Checking the availability struct ip_mreq_source ..." >&4
12100 #include <sys/types.h>
12101 #include <sys/socket.h>
12102 #include <netinet/in.h>
12104 struct ip_mreq_source mreq;
12105 return (mreq.imr_multiaddr.s_addr);
12109 set try; if eval $compile; then
12112 set d_ip_mreq_source; eval $setvar
12116 echo "Checking the availability struct ipv6_mreq ..." >&4
12118 #include <sys/types.h>
12119 #include <sys/socket.h>
12120 #include <netinet/in.h>
12122 struct ipv6_mreq mreq;
12123 return (mreq.ipv6mr_interface);
12127 set try; if eval $compile; then
12130 set d_ipv6_mreq; eval $setvar
12134 echo "Checking the availability struct ipv6_mreq_source ..." >&4
12136 #include <sys/types.h>
12137 #include <sys/socket.h>
12138 #include <netinet/in.h>
12140 struct ipv6_mreq_source mreq;
12141 return (mreq.imr_multiaddr.s_addr);
12145 set try; if eval $compile; then
12148 set d_ipv6_mreq_source; eval $setvar
12152 echo "Checking the availability of certain socket constants..." >&4
12153 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
12154 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
12156 #include <sys/types.h>
12157 #include <sys/socket.h>
12163 set try; if eval $compile; then
12166 set d_${enum}; eval $setvar
12170 : see if this is a sys/uio.h system
12171 set sys/uio.h i_sysuio
12174 : Check for cmsghdr support
12176 echo "Checking to see if your system supports struct cmsghdr..." >&4
12177 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
12179 case "$d_cmsghdr_s" in
12180 "$define") echo "Yes, it does." ;;
12181 *) echo "No, it doesn't." ;;
12185 : check for const keyword
12187 echo 'Checking to see if your C compiler knows about "const"...' >&4
12188 $cat >const.c <<'EOCP'
12189 typedef struct spug { int drokk; } spug;
12193 const spug y = { 0 };
12196 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
12198 echo "Yup, it does."
12201 echo "Nope, it doesn't."
12206 : see if copysign exists
12207 set copysign d_copysign
12210 : see if copysignl exists
12211 set copysignl d_copysignl
12214 : see if crypt exists
12219 $define) cryptlib='' ;;
12220 *) if set crypt val -f d_crypt; eval $csym; $val; then
12221 echo 'crypt() found.' >&4
12225 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
12226 if $test -z "$cryptlib"; then
12227 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
12231 if $test -z "$cryptlib"; then
12232 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
12236 if $test -z "$cryptlib"; then
12237 cryptlib=`./loc libcrypt$_a "" $libpth`
12241 if $test -z "$cryptlib"; then
12242 echo 'crypt() NOT found.' >&4
12253 : see if this is a crypt.h system
12254 set crypt.h i_crypt
12257 : see if crypt_r exists
12258 set crypt_r d_crypt_r
12260 case "$d_crypt_r" in
12262 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
12263 case "$d_crypt_r_proto:$usethreads" in
12264 ":define") d_crypt_r_proto=define
12265 set d_crypt_r_proto crypt_r $hdrs
12269 case "$d_crypt_r_proto" in
12271 case "$crypt_r_proto" in
12272 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
12273 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCS ;;
12275 case "$crypt_r_proto" in
12276 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
12277 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCD ;;
12279 case "$crypt_r_proto" in
12280 ''|0) d_crypt_r=undef
12282 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
12283 * ) case "$crypt_r_proto" in
12284 REENTRANT_PROTO*) ;;
12285 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
12287 echo "Prototype: $try" ;;
12290 *) case "$usethreads" in
12291 define) echo "crypt_r has no prototype, not using it." >&4 ;;
12302 : get csh whereabouts
12304 'csh') val="$undef" ;;
12305 *) val="$define" ;;
12309 : Respect a hint or command line value for full_csh.
12310 case "$full_csh" in
12311 '') full_csh=$csh ;;
12314 : see if ctermid exists
12315 set ctermid d_ctermid
12318 : see if ctermid_r exists
12319 set ctermid_r d_ctermid_r
12321 case "$d_ctermid_r" in
12323 hdrs="$i_systypes sys/types.h define stdio.h "
12324 case "$d_ctermid_r_proto:$usethreads" in
12325 ":define") d_ctermid_r_proto=define
12326 set d_ctermid_r_proto ctermid_r $hdrs
12330 case "$d_ctermid_r_proto" in
12332 case "$ctermid_r_proto" in
12333 ''|0) try='char* ctermid_r(char*);'
12334 ./protochk "$extern_C $try" $hdrs && ctermid_r_proto=B_B ;;
12336 case "$ctermid_r_proto" in
12337 ''|0) d_ctermid_r=undef
12339 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
12340 * ) case "$ctermid_r_proto" in
12341 REENTRANT_PROTO*) ;;
12342 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
12344 echo "Prototype: $try" ;;
12347 *) case "$usethreads" in
12348 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
12355 *) ctermid_r_proto=0
12359 : see if ctime_r exists
12360 set ctime_r d_ctime_r
12362 case "$d_ctime_r" in
12364 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
12365 case "$d_ctime_r_proto:$usethreads" in
12366 ":define") d_ctime_r_proto=define
12367 set d_ctime_r_proto ctime_r $hdrs
12371 case "$d_ctime_r_proto" in
12373 case "$ctime_r_proto" in
12374 ''|0) try='char* ctime_r(const time_t*, char*);'
12375 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SB ;;
12377 case "$ctime_r_proto" in
12378 ''|0) try='char* ctime_r(const time_t*, char*, int);'
12379 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SBI ;;
12381 case "$ctime_r_proto" in
12382 ''|0) try='int ctime_r(const time_t*, char*);'
12383 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SB ;;
12385 case "$ctime_r_proto" in
12386 ''|0) try='int ctime_r(const time_t*, char*, int);'
12387 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SBI ;;
12389 case "$ctime_r_proto" in
12390 ''|0) d_ctime_r=undef
12392 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
12393 * ) case "$ctime_r_proto" in
12394 REENTRANT_PROTO*) ;;
12395 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
12397 echo "Prototype: $try" ;;
12400 *) case "$usethreads" in
12401 define) echo "ctime_r has no prototype, not using it." >&4 ;;
12412 : see if cuserid exists
12413 set cuserid d_cuserid
12416 : see if this is a limits.h system
12417 set limits.h i_limits
12420 : See if number of significant digits in a double precision number is known
12422 $cat >dbl_dig.c <<EOM
12423 #$i_limits I_LIMITS
12426 #include <limits.h>
12432 printf("Contains DBL_DIG");
12435 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
12436 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
12437 echo "DBL_DIG found." >&4
12440 echo "DBL_DIG NOT found." >&4
12447 : see if dbm.h is available
12448 : see if dbmclose exists
12449 set dbmclose d_dbmclose
12452 case "$d_dbmclose" in
12462 *) set rpcsvc/dbm.h i_rpcsvcdbm
12467 *) echo "We won't be including <dbm.h>"
12477 : see if prototype for dbminit is available
12479 set d_dbminitproto dbminit $i_dbm dbm.h
12482 : see if difftime exists
12483 set difftime d_difftime
12486 : see if this is a dirent system
12488 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
12490 echo "<dirent.h> found." >&4
12493 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
12494 echo "<sys/dir.h> found." >&4
12497 xinc=`./findhdr sys/ndir.h`
12499 echo "<dirent.h> NOT found." >&4
12504 : Look for type of directory structure.
12506 $cppstdin $cppflags $cppminus < "$xinc" > try.c
12508 case "$direntrytype" in
12510 case "$i_dirent" in
12511 $define) guess1='struct dirent' ;;
12512 *) guess1='struct direct' ;;
12515 *) guess1="$direntrytype"
12520 'struct dirent') guess2='struct direct' ;;
12521 *) guess2='struct dirent' ;;
12524 if $contains "$guess1" try.c >/dev/null 2>&1; then
12525 direntrytype="$guess1"
12526 echo "Your directory entries are $direntrytype." >&4
12527 elif $contains "$guess2" try.c >/dev/null 2>&1; then
12528 direntrytype="$guess2"
12529 echo "Your directory entries seem to be $direntrytype." >&4
12531 echo "I don't recognize your system's directory entries." >&4
12532 rp="What type is used for directory entries on this system?"
12535 direntrytype="$ans"
12539 : see if the directory entry stores field length
12541 $cppstdin $cppflags $cppminus < "$xinc" > try.c
12542 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
12543 echo "Good, your directory entry keeps length information in d_namlen." >&4
12546 echo "Your directory entry does not know about the d_namlen field." >&4
12553 : Look for DIR.dd_fd
12554 case "$i_dirent" in
12556 echo "Checking to see if DIR has a dd_fd member variable" >&4
12558 #$i_stdlib I_STDLIB
12560 #include <stdlib.h>
12562 #include <dirent.h>
12572 if eval $compile; then
12573 echo "Yes, it does."
12576 echo "No, it does not."
12581 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
12589 : see if this is an sysdir system
12590 set sys/dir.h i_sysdir
12593 : see if this is an sysndir system
12594 set sys/ndir.h i_sysndir
12599 $cat >dirfd.c <<EOM
12601 #$i_stdlib I_STDLIB
12603 #include <stdlib.h>
12605 #$i_dirent I_DIRENT /**/
12606 #$i_sysdir I_SYS_DIR /**/
12607 #$i_sysndir I_SYS_NDIR /**/
12608 #$i_systypes I_SYS_TYPES /**/
12609 #if defined(I_SYS_TYPES)
12610 #include <sys/types.h>
12612 #if defined(I_DIRENT)
12613 #include <dirent.h>
12616 #include <sys/ndir.h>
12620 #include <ndir.h> /* may be wrong in the future */
12622 #include <sys/dir.h>
12628 DIR *dirp = opendir(".");
12629 if (dirfd(dirp) >= 0)
12637 if eval $compile; then
12641 $define) echo "dirfd() found." >&4 ;;
12642 *) echo "dirfd() NOT found." >&4 ;;
12648 : see if dladdr exists
12649 set dladdr d_dladdr
12652 : see if dlerror exists
12655 set dlerror d_dlerror
12659 : see if dlfcn is available
12660 set dlfcn.h i_dlfcn
12663 : Check what extension to use for shared libs
12668 On a few systems, the dynamically loaded modules that perl generates and uses
12669 will need a different extension than shared libs. The default will probably
12675 *) dflt="$dlext" ;;
12677 rp='What is the extension of dynamically loaded modules'
12686 : Check if dlsym need a leading underscore
12692 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
12693 $cat >dyna.c <<'EOM'
12700 #$i_stdlib I_STDLIB
12702 #include <stdlib.h>
12706 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
12708 #include <sys/types.h>
12713 extern int fred() ;
12722 int mode = RTLD_LAZY ;
12724 handle = dlopen("./dyna.$dlext", mode) ;
12725 if (handle == NULL) {
12730 symbol = dlsym(handle, "fred") ;
12731 if (symbol == NULL) {
12732 /* try putting a leading underscore */
12733 symbol = dlsym(handle, "_fred") ;
12734 if (symbol == NULL) {
12747 : Call the object file tmp-dyna.o in case dlext=o.
12748 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
12749 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
12750 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
12751 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
12754 1) echo "Test program failed using dlopen." >&4
12755 echo "Perhaps you should not use dynamic loading." >&4;;
12756 2) echo "Test program failed using dlsym." >&4
12757 echo "Perhaps you should not use dynamic loading." >&4;;
12758 3) echo "dlsym needs a leading underscore" >&4
12760 4) echo "dlsym doesn't need a leading underscore." >&4;;
12763 echo "I can't compile and run the test program." >&4
12764 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
12769 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
12774 : see if drand48_r exists
12775 set drand48_r d_drand48_r
12777 case "$d_drand48_r" in
12779 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
12780 case "$d_drand48_r_proto:$usethreads" in
12781 ":define") d_drand48_r_proto=define
12782 set d_drand48_r_proto drand48_r $hdrs
12786 case "$d_drand48_r_proto" in
12788 case "$drand48_r_proto" in
12789 ''|0) try='int drand48_r(struct drand48_data*, double*);'
12790 ./protochk "$extern_C $try" $hdrs && drand48_r_proto=I_ST ;;
12792 case "$drand48_r_proto" in
12793 ''|0) d_drand48_r=undef
12795 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
12796 * ) case "$drand48_r_proto" in
12797 REENTRANT_PROTO*) ;;
12798 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
12800 echo "Prototype: $try" ;;
12803 *) case "$usethreads" in
12804 define) echo "drand48_r has no prototype, not using it." >&4 ;;
12811 *) drand48_r_proto=0
12815 : see if prototype for drand48 is available
12817 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
12820 : see if dup2 exists
12824 : see if eaccess exists
12825 set eaccess d_eaccess
12828 : see if endgrent exists
12829 set endgrent d_endgrent
12832 : see if this is an grp system
12838 xxx=`./findhdr grp.h`
12839 $cppstdin $cppflags $cppminus < $xxx >$$.h
12841 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
12853 set d_grpasswd; eval $setvar
12857 : see if endgrent_r exists
12858 set endgrent_r d_endgrent_r
12860 case "$d_endgrent_r" in
12862 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12863 case "$d_endgrent_r_proto:$usethreads" in
12864 ":define") d_endgrent_r_proto=define
12865 set d_endgrent_r_proto endgrent_r $hdrs
12869 case "$d_endgrent_r_proto" in
12871 case "$endgrent_r_proto" in
12872 ''|0) try='int endgrent_r(FILE**);'
12873 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=I_H ;;
12875 case "$endgrent_r_proto" in
12876 ''|0) try='void endgrent_r(FILE**);'
12877 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=V_H ;;
12879 case "$endgrent_r_proto" in
12880 ''|0) d_endgrent_r=undef
12882 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
12883 * ) case "$endgrent_r_proto" in
12884 REENTRANT_PROTO*) ;;
12885 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
12887 echo "Prototype: $try" ;;
12890 *) case "$usethreads" in
12891 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
12898 *) endgrent_r_proto=0
12902 : see if endhostent exists
12903 set endhostent d_endhent
12906 : see if this is a netdb.h system
12907 set netdb.h i_netdb
12910 : see if endhostent_r exists
12911 set endhostent_r d_endhostent_r
12913 case "$d_endhostent_r" in
12915 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12916 case "$d_endhostent_r_proto:$usethreads" in
12917 ":define") d_endhostent_r_proto=define
12918 set d_endhostent_r_proto endhostent_r $hdrs
12922 case "$d_endhostent_r_proto" in
12924 case "$endhostent_r_proto" in
12925 ''|0) try='int endhostent_r(struct hostent_data*);'
12926 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=I_D ;;
12928 case "$endhostent_r_proto" in
12929 ''|0) try='void endhostent_r(struct hostent_data*);'
12930 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=V_D ;;
12932 case "$endhostent_r_proto" in
12933 ''|0) d_endhostent_r=undef
12934 endhostent_r_proto=0
12935 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
12936 * ) case "$endhostent_r_proto" in
12937 REENTRANT_PROTO*) ;;
12938 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
12940 echo "Prototype: $try" ;;
12943 *) case "$usethreads" in
12944 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
12946 d_endhostent_r=undef
12947 endhostent_r_proto=0
12951 *) endhostent_r_proto=0
12955 : see if endnetent exists
12956 set endnetent d_endnent
12959 : see if endnetent_r exists
12960 set endnetent_r d_endnetent_r
12962 case "$d_endnetent_r" in
12964 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12965 case "$d_endnetent_r_proto:$usethreads" in
12966 ":define") d_endnetent_r_proto=define
12967 set d_endnetent_r_proto endnetent_r $hdrs
12971 case "$d_endnetent_r_proto" in
12973 case "$endnetent_r_proto" in
12974 ''|0) try='int endnetent_r(struct netent_data*);'
12975 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=I_D ;;
12977 case "$endnetent_r_proto" in
12978 ''|0) try='void endnetent_r(struct netent_data*);'
12979 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=V_D ;;
12981 case "$endnetent_r_proto" in
12982 ''|0) d_endnetent_r=undef
12983 endnetent_r_proto=0
12984 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
12985 * ) case "$endnetent_r_proto" in
12986 REENTRANT_PROTO*) ;;
12987 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
12989 echo "Prototype: $try" ;;
12992 *) case "$usethreads" in
12993 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
12995 d_endnetent_r=undef
12996 endnetent_r_proto=0
13000 *) endnetent_r_proto=0
13004 : see if endprotoent exists
13005 set endprotoent d_endpent
13008 : see if endprotoent_r exists
13009 set endprotoent_r d_endprotoent_r
13011 case "$d_endprotoent_r" in
13013 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13014 case "$d_endprotoent_r_proto:$usethreads" in
13015 ":define") d_endprotoent_r_proto=define
13016 set d_endprotoent_r_proto endprotoent_r $hdrs
13020 case "$d_endprotoent_r_proto" in
13022 case "$endprotoent_r_proto" in
13023 ''|0) try='int endprotoent_r(struct protoent_data*);'
13024 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=I_D ;;
13026 case "$endprotoent_r_proto" in
13027 ''|0) try='void endprotoent_r(struct protoent_data*);'
13028 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=V_D ;;
13030 case "$endprotoent_r_proto" in
13031 ''|0) d_endprotoent_r=undef
13032 endprotoent_r_proto=0
13033 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
13034 * ) case "$endprotoent_r_proto" in
13035 REENTRANT_PROTO*) ;;
13036 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
13038 echo "Prototype: $try" ;;
13041 *) case "$usethreads" in
13042 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
13044 d_endprotoent_r=undef
13045 endprotoent_r_proto=0
13049 *) endprotoent_r_proto=0
13053 : see if endpwent exists
13054 set endpwent d_endpwent
13057 : see if this is a pwd.h system
13063 xxx=`./findhdr pwd.h`
13064 $cppstdin $cppflags $cppminus < $xxx >$$.h
13066 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
13074 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
13082 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
13090 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
13098 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
13106 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
13114 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
13122 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
13134 set d_pwquota; eval $setvar
13135 set d_pwage; eval $setvar
13136 set d_pwchange; eval $setvar
13137 set d_pwclass; eval $setvar
13138 set d_pwexpire; eval $setvar
13139 set d_pwcomment; eval $setvar
13140 set d_pwgecos; eval $setvar
13141 set d_pwpasswd; eval $setvar
13145 : see if endpwent_r exists
13146 set endpwent_r d_endpwent_r
13148 case "$d_endpwent_r" in
13150 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13151 case "$d_endpwent_r_proto:$usethreads" in
13152 ":define") d_endpwent_r_proto=define
13153 set d_endpwent_r_proto endpwent_r $hdrs
13157 case "$d_endpwent_r_proto" in
13159 case "$endpwent_r_proto" in
13160 ''|0) try='int endpwent_r(FILE**);'
13161 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=I_H ;;
13163 case "$endpwent_r_proto" in
13164 ''|0) try='void endpwent_r(FILE**);'
13165 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=V_H ;;
13167 case "$endpwent_r_proto" in
13168 ''|0) d_endpwent_r=undef
13170 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
13171 * ) case "$endpwent_r_proto" in
13172 REENTRANT_PROTO*) ;;
13173 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
13175 echo "Prototype: $try" ;;
13178 *) case "$usethreads" in
13179 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
13186 *) endpwent_r_proto=0
13190 : see if endservent exists
13191 set endservent d_endsent
13194 : see if endservent_r exists
13195 set endservent_r d_endservent_r
13197 case "$d_endservent_r" in
13199 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13200 case "$d_endservent_r_proto:$usethreads" in
13201 ":define") d_endservent_r_proto=define
13202 set d_endservent_r_proto endservent_r $hdrs
13206 case "$d_endservent_r_proto" in
13208 case "$endservent_r_proto" in
13209 ''|0) try='int endservent_r(struct servent_data*);'
13210 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=I_D ;;
13212 case "$endservent_r_proto" in
13213 ''|0) try='void endservent_r(struct servent_data*);'
13214 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=V_D ;;
13216 case "$endservent_r_proto" in
13217 ''|0) d_endservent_r=undef
13218 endservent_r_proto=0
13219 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
13220 * ) case "$endservent_r_proto" in
13221 REENTRANT_PROTO*) ;;
13222 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
13224 echo "Prototype: $try" ;;
13227 *) case "$usethreads" in
13228 define) echo "endservent_r has no prototype, not using it." >&4 ;;
13230 d_endservent_r=undef
13231 endservent_r_proto=0
13235 *) endservent_r_proto=0
13239 : Locate the flags for 'open()'
13242 #include <sys/types.h>
13247 #include <sys/file.h>
13249 #$i_stdlib I_STDLIB
13251 #include <stdlib.h>
13262 : check sys/file.h first to get FREAD on Sun
13263 if $test `./findhdr sys/file.h` && \
13264 set try -DI_SYS_FILE && eval $compile; then
13266 echo "<sys/file.h> defines the O_* constants..." >&4
13267 if $run ./try; then
13268 echo "and you have the 3 argument form of open()." >&4
13271 echo "but not the 3 argument form of open(). Oh, well." >&4
13274 elif $test `./findhdr fcntl.h` && \
13275 set try -DI_FCNTL && eval $compile; then
13277 echo "<fcntl.h> defines the O_* constants..." >&4
13278 if $run ./try; then
13279 echo "and you have the 3 argument form of open()." >&4
13282 echo "but not the 3 argument form of open(). Oh, well." >&4
13287 echo "I can't find the O_* constant definitions! You got problems." >&4
13293 : see if this is a sys/file.h system
13298 : do we need to include sys/file.h ?
13302 if $h_sysfile; then
13304 echo "We'll be including <sys/file.h>." >&4
13307 echo "We won't be including <sys/file.h>." >&4
13317 : see if fcntl.h is there
13322 : see if we can include fcntl.h
13328 echo "We'll be including <fcntl.h>." >&4
13331 if $h_sysfile; then
13332 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
13334 echo "We won't be including <fcntl.h>." >&4
13346 : see if fork exists
13350 : see if pipe exists
13354 : check for non-blocking I/O stuff
13355 case "$h_sysfile" in
13356 true) echo "#include <sys/file.h>" > head.c;;
13359 true) echo "#include <fcntl.h>" > head.c;;
13360 *) echo "#include <sys/fcntl.h>" > head.c;;
13365 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
13366 case "$o_nonblock" in
13368 $cat head.c > try.c
13369 $cat >>try.c <<EOCP
13371 #$i_stdlib I_STDLIB
13373 #include <stdlib.h>
13381 printf("O_NONBLOCK\n");
13385 printf("O_NDELAY\n");
13389 printf("FNDELAY\n");
13396 if eval $compile_ok; then
13397 o_nonblock=`$run ./try`
13398 case "$o_nonblock" in
13399 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
13400 *) echo "Seems like we can use $o_nonblock.";;
13403 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
13406 *) echo "Using $hint value $o_nonblock.";;
13411 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
13414 case "$d_fork:$d_pipe:$d_alarm" in
13415 define:define:define)
13416 $cat head.c > try.c
13417 $cat >>try.c <<EOCP
13419 #include <sys/types.h>
13420 #include <signal.h>
13422 #$i_stdlib I_STDLIB
13424 #include <stdlib.h>
13430 #define MY_O_NONBLOCK $o_nonblock
13431 #ifndef errno /* XXX need better Configure test */
13434 #$i_unistd I_UNISTD
13436 #include <unistd.h>
13438 #$i_string I_STRING
13440 #include <string.h>
13442 #include <strings.h>
13444 $signal_t blech(int x) { exit(3); }
13446 $cat >> try.c <<'EOCP'
13455 ret = pipe(pd); /* Down: child -> parent */
13458 ret = pipe(pu); /* Up: parent -> child */
13462 close(pd[1]); /* Parent reads from pd[0] */
13463 close(pu[0]); /* Parent writes (blocking) to pu[1] */
13465 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
13470 signal(SIGALRM, blech);
13472 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
13474 sprintf(string, "%d\n", ret);
13475 ret = write(2, string, strlen(string));
13476 if (ret != strlen(string))
13480 if (errno == EAGAIN) {
13481 printf("EAGAIN\n");
13486 if (errno == EWOULDBLOCK)
13487 printf("EWOULDBLOCK\n");
13490 ret = write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
13493 sleep(2); /* Give it time to close our pipe */
13495 ret = read(pd[0], buf, 1); /* Should read EOF */
13497 sprintf(string, "%d\n", ret);
13498 ret = write(4, string, strlen(string));
13499 if (ret != strlen(string))
13504 close(pd[0]); /* We write to pd[1] */
13505 close(pu[1]); /* We read from pu[0] */
13506 ret = read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
13509 close(pd[1]); /* Pipe pd is now fully closed! */
13510 exit(0); /* Bye bye, thank you for playing! */
13514 if eval $compile_ok; then
13515 echo "$startsh" >mtry
13516 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
13518 $run ./mtry >/dev/null 2>&1
13520 0) eagain=`$cat try.out`;;
13521 1) echo "Could not perform non-blocking setting!";;
13522 2) echo "I did a successful read() for something that was not there!";;
13523 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
13524 4) echo "Could not find F_SETFL!";;
13525 *) echo "Something terribly wrong happened during testing.";;
13527 rd_nodata=`$cat try.ret`
13528 echo "A read() system call with no data present returns $rd_nodata."
13529 case "$rd_nodata" in
13532 echo "(That's peculiar, fixing that to be -1.)"
13538 echo "Forcing errno EAGAIN on read() with no data available."
13542 echo "Your read() sets errno to $eagain when no data is available."
13545 status=`$cat try.err`
13547 0) echo "And it correctly returns 0 to signal EOF.";;
13548 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
13549 *) echo "However, your read() returns '$status' on EOF??";;
13552 if test "$status" = "$rd_nodata"; then
13553 echo "WARNING: you can't distinguish between EOF and no data!"
13557 echo "I can't compile the test program--assuming errno EAGAIN will do."
13561 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
13570 echo "Using $hint value $eagain."
13571 echo "Your read() returns $rd_nodata when no data is present."
13572 case "$d_eofnblk" in
13573 "$define") echo "And you can see EOF because read() returns 0.";;
13574 "$undef") echo "But you can't see EOF status from read() returned value.";;
13576 echo "(Assuming you can't see EOF status from read anyway.)"
13582 $rm_try head.c mtry
13584 : see if erf exists
13588 : see if erfc exists
13592 : see if exp2 exists
13596 : see if expm1 exists
13600 : see if _ptr and _cnt from stdio act std
13603 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
13604 echo "(Looks like you have stdio.h from BSD.)"
13605 case "$stdio_ptr" in
13606 '') stdio_ptr='((fp)->_p)'
13609 *) ptr_lval=$d_stdio_ptr_lval;;
13611 case "$stdio_cnt" in
13612 '') stdio_cnt='((fp)->_r)'
13615 *) cnt_lval=$d_stdio_cnt_lval;;
13617 case "$stdio_base" in
13618 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
13620 case "$stdio_bufsiz" in
13621 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
13623 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
13624 echo "(Looks like you have stdio.h from Linux.)"
13625 case "$stdio_ptr" in
13626 '') stdio_ptr='((fp)->_IO_read_ptr)'
13629 *) ptr_lval=$d_stdio_ptr_lval;;
13631 case "$stdio_cnt" in
13632 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
13635 *) cnt_lval=$d_stdio_cnt_lval;;
13637 case "$stdio_base" in
13638 '') stdio_base='((fp)->_IO_read_base)';;
13640 case "$stdio_bufsiz" in
13641 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
13644 case "$stdio_ptr" in
13645 '') stdio_ptr='((fp)->_ptr)'
13648 *) ptr_lval=$d_stdio_ptr_lval;;
13650 case "$stdio_cnt" in
13651 '') stdio_cnt='((fp)->_cnt)'
13654 *) cnt_lval=$d_stdio_cnt_lval;;
13656 case "$stdio_base" in
13657 '') stdio_base='((fp)->_base)';;
13659 case "$stdio_bufsiz" in
13660 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
13664 : test whether _ptr and _cnt really work
13665 echo "Checking how std your stdio is..." >&4
13668 #$i_stdlib I_STDLIB
13670 #include <stdlib.h>
13672 #define FILE_ptr(fp) $stdio_ptr
13673 #define FILE_cnt(fp) $stdio_cnt
13675 FILE *fp = fopen("try.c", "r");
13678 18 <= FILE_cnt(fp) &&
13679 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13687 if eval $compile && $to try.c; then
13688 if $run ./try; then
13689 echo "Your stdio acts pretty std."
13692 echo "Your stdio isn't very std."
13695 echo "Your stdio doesn't appear very std."
13699 # glibc 2.2.90 and above apparently change stdio streams so Perl's
13700 # direct buffer manipulation no longer works. The Configure tests
13701 # should be changed to correctly detect this, but until then,
13702 # the following check should at least let perl compile and run.
13703 # (This quick fix should be updated before 5.8.1.)
13704 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
13705 # A. Dougherty, June 3, 2002.
13706 case "$d_gnulibc" in
13708 case "$gnulibc_version" in
13712 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
13721 : Can _ptr be used as an lvalue?
13722 case "$d_stdstdio$ptr_lval" in
13723 $define$define) val=$define ;;
13726 set d_stdio_ptr_lval
13729 : Can _cnt be used as an lvalue?
13730 case "$d_stdstdio$cnt_lval" in
13731 $define$define) val=$define ;;
13734 set d_stdio_cnt_lval
13738 : test whether setting _ptr sets _cnt as a side effect
13739 d_stdio_ptr_lval_sets_cnt="$undef"
13740 d_stdio_ptr_lval_nochange_cnt="$undef"
13741 case "$d_stdio_ptr_lval$d_stdstdio" in
13743 echo "Checking to see what happens if we set the stdio ptr..." >&4
13746 /* Can we scream? */
13747 /* Eat dust sed :-) */
13748 /* In the buffer space, no one can hear you scream. */
13749 #$i_stdlib I_STDLIB
13751 #include <stdlib.h>
13753 #define FILE_ptr(fp) $stdio_ptr
13754 #define FILE_cnt(fp) $stdio_cnt
13755 #include <sys/types.h>
13757 FILE *fp = fopen("try.c", "r");
13762 puts("Fail even to read");
13765 c = getc(fp); /* Read away the first # */
13767 puts("Fail even to read");
13771 18 <= FILE_cnt(fp) &&
13772 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13774 puts("Fail even to read");
13777 ptr = (char*) FILE_ptr(fp);
13778 cnt = (size_t)FILE_cnt(fp);
13780 FILE_ptr(fp) += 42;
13782 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
13783 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
13786 if (FILE_cnt(fp) <= 20) {
13787 printf ("Fail (<20 chars to test)");
13790 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
13791 puts("Fail compare");
13794 if (cnt == FILE_cnt(fp)) {
13795 puts("Pass_unchanged");
13798 if (FILE_cnt(fp) == (cnt - 42)) {
13799 puts("Pass_changed");
13802 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
13808 if eval $compile && $to try.c; then
13809 case `$run ./try` in
13811 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
13812 d_stdio_ptr_lval_sets_cnt="$define" ;;
13814 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
13815 d_stdio_ptr_lval_nochange_cnt="$define" ;;
13817 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
13819 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
13822 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
13828 : see if _base is also standard
13830 case "$d_stdstdio" in
13834 #$i_stdlib I_STDLIB
13836 #include <stdlib.h>
13838 #define FILE_base(fp) $stdio_base
13839 #define FILE_bufsiz(fp) $stdio_bufsiz
13841 FILE *fp = fopen("try.c", "r");
13844 19 <= FILE_bufsiz(fp) &&
13845 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
13852 if eval $compile && $to try.c; then
13853 if $run ./try; then
13854 echo "And its _base field acts std."
13857 echo "But its _base field isn't std."
13860 echo "However, it seems to be lacking the _base field."
13868 : see if fast_stdio exists
13870 case "$d_stdstdio:$d_stdio_ptr_lval" in
13872 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
13874 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
13885 : see if fchdir exists
13886 set fchdir d_fchdir
13889 : see if fchmod exists
13890 set fchmod d_fchmod
13893 : see if fchown exists
13894 set fchown d_fchown
13897 : see if this is an fcntl system
13901 : See if fcntl-based locking works.
13904 #$i_stdlib I_STDLIB
13906 #include <stdlib.h>
13908 #include <unistd.h>
13910 #include <signal.h>
13911 $signal_t blech(int x) { exit(3); }
13913 #if defined(F_SETLK) && defined(F_SETLKW)
13914 struct flock flock;
13916 fd = open("try.c", O_RDONLY);
13917 flock.l_type = F_RDLCK;
13918 flock.l_whence = SEEK_SET;
13919 flock.l_start = flock.l_len = 0;
13920 signal(SIGALRM, blech);
13922 retval = fcntl(fd, F_SETLK, &flock);
13924 (retval < 0 ? exit(2) : exit(0));
13930 echo "Checking if fcntl-based file locking works... "
13934 if eval $compile_ok; then
13935 if $run ./try; then
13936 echo "Yes, it seems to work."
13939 echo "Nope, it didn't work."
13944 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
13945 *** This is (almost) impossible.
13946 *** If your NFS lock daemons are not feeling well, something like
13947 *** this may happen, please investigate. Cannot continue, aborting.
13955 echo "I'm unable to compile the test program, so I'll assume not."
13960 echo "Nope, since you don't even have fcntl()."
13963 set d_fcntl_can_lock
13967 : check for fd_set items
13970 Checking to see how well your C compiler handles fd_set and friends ...
13973 #$i_stdlib I_STDLIB
13975 #include <stdlib.h>
13977 #$i_systime I_SYS_TIME
13978 #$i_sysselct I_SYS_SELECT
13979 #$d_socket HAS_SOCKET
13980 #include <sys/types.h>
13982 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
13985 #include <sys/time.h>
13987 #ifdef I_SYS_SELECT
13988 #include <sys/select.h>
13997 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
14005 if eval $compile; then
14006 d_fds_bits="$define"
14008 echo "Well, your system knows about the normal fd_set typedef..." >&4
14009 if $run ./try; then
14010 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
14011 d_fd_macros="$define"
14014 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
14016 d_fd_macros="$undef"
14020 Hmm, your compiler has some difficulty with fd_set. Checking further...
14023 if eval $compile; then
14024 d_fds_bits="$undef"
14026 echo "Well, your system has some sort of fd_set available..." >&4
14027 if $run ./try; then
14028 echo "and you have the normal fd_set macros." >&4
14029 d_fd_macros="$define"
14032 but not the normal fd_set macros! Gross! More work for me...
14034 d_fd_macros="$undef"
14037 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
14039 d_fds_bits="$undef"
14040 d_fd_macros="$undef"
14045 : see if fdclose exists
14046 set fdclose d_fdclose
14049 : see if fdim exists
14053 : see if fegetround exists
14054 set fegetround d_fegetround
14057 : see if fgetpos exists
14058 set fgetpos d_fgetpos
14061 : see if finite exists
14062 set finite d_finite
14065 : see if finitel exists
14066 set finitel d_finitel
14069 : see if flock exists
14073 : see if prototype for flock is available
14075 set d_flockproto flock $i_sysfile sys/file.h
14078 : see if fma exists
14082 : see if fmax exists
14086 : see if fmin exists
14090 : see if fp_class exists
14091 set fp_class d_fp_class
14094 : see if this is a math.h system
14098 : check for fpclassify
14099 echo "Checking to see if you have fpclassify..." >&4
14105 int main() { return fpclassify(1.0) == FP_NORMAL ? 0 : 1; }
14108 if eval $compile; then
14110 echo "You have fpclassify."
14113 echo "You do not have fpclassify."
14119 : see if fp_classify exists
14120 set fp_classify d_fp_classify
14123 : see if fp_classl exists
14124 set fp_classl d_fp_classl
14127 : see if pathconf exists
14128 set pathconf d_pathconf
14131 : see if fpathconf exists
14132 set fpathconf d_fpathconf
14135 : see if fpclass exists
14136 set fpclass d_fpclass
14139 : see if fpclassl exists
14140 set fpclassl d_fpclassl
14143 : see if fpgetround exists
14144 set fpgetround d_fpgetround
14147 : check for fpos64_t
14149 echo "Checking to see if you have fpos64_t..." >&4
14152 int main() { fpos64_t x = 7; }
14155 if eval $compile; then
14157 echo "You have fpos64_t."
14160 echo "You do not have fpos64_t."
14161 case "$fpossize" in
14162 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
14169 : see if this is an xlocale.h system
14170 set xlocale.h i_xlocale
14173 : see if newlocale exists
14174 set newlocale d_newlocale
14177 : see if freelocale exists
14178 set freelocale d_freelocale
14181 : see if uselocale exists
14182 set uselocale d_uselocale
14185 : see if duplocale exists
14186 set duplocale d_duplocale
14189 : see if querylocale exists
14190 set querylocale d_querylocale
14193 : see if frexpl exists
14194 set frexpl d_frexpl
14197 : see if this is a sys/param system
14198 set sys/param.h i_sysparam
14201 : see if this is a sys/mount.h system
14202 set sys/mount.h i_sysmount
14205 : Check for fs_data_s
14207 echo "Checking to see if your system supports struct fs_data..." >&4
14208 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
14210 case "$d_fs_data_s" in
14211 "$define") echo "Yes, it does." ;;
14212 *) echo "No, it doesn't." ;;
14215 : see if fseeko exists
14216 set fseeko d_fseeko
14218 case "$longsize" in
14219 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
14222 : see if fsetpos exists
14223 set fsetpos d_fsetpos
14226 : see if fstatfs exists
14227 set fstatfs d_fstatfs
14230 : see if statvfs exists
14231 set statvfs d_statvfs
14234 : see if fstatvfs exists
14235 set fstatvfs d_fstatvfs
14239 : see if fsync exists
14243 : see if ftello exists
14244 set ftello d_ftello
14246 case "$longsize" in
14247 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
14250 : check for a working futimes
14253 echo "Checking if you have a working futimes()" >&4
14256 #include <sys/time.h>
14263 fd = open ("try.c", O_RDWR);
14264 if (-1 == fd) exit (1);
14265 rv = futimes (fd, NULL);
14266 exit (rv == -1 ? errno : 0);
14270 if eval $compile; then
14274 0) echo "Yes, you have" >&4
14275 d_futimes="$define"
14277 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
14281 echo "No, it does not (probably harmless)" >&4
14285 : see if ndbm.h is available
14288 : Compatibility location for RedHat 7.1
14289 set gdbm/ndbm.h i_gdbmndbm
14291 : Compatibility location for Debian 4.0
14292 set gdbm-ndbm.h i_gdbm_ndbm
14296 if $test "$i_ndbm" = "$define" -o "$i_gdbmndbm" = "$define" -o "$i_gdbm_ndbm" = "$define"; then
14297 : see if dbm_open exists
14298 set dbm_open d_dbm_open
14300 case "$d_dbm_open" in
14303 i_gdbmndbm="$undef"
14304 i_gdbm_ndbm="$undef"
14305 echo "We won't be including <ndbm.h>"
14315 ndbm_hdr_protochk='name=$1; hdr=$2;
14316 eval "ihdr=\$""i_$name";
14318 if $test "$ihdr" = "$define"; then
14319 $echo "Checking if your <$hdr> uses prototypes..." >&4;
14320 case "$d_cplusplus" in
14321 $define) ./protochk "$extern_C void dbm_close(DBM *);" literal "extern \"C\" {" $ihdr $hdr literal "}" && val="$define" ;;
14322 *) ./protochk "$extern_C void dbm_close(int, int);" $ihdr $hdr || val="$define" ;;
14325 $define) $echo "Your <$hdr> seems to have prototypes";;
14326 *) $echo "Your <$hdr> does not seem to have prototypes";;
14329 set "d_${name}_h_uses_prototypes";
14333 eval $ndbm_hdr_protochk
14334 set gdbmndbm gdbm/ndbm.h
14335 eval $ndbm_hdr_protochk
14336 set gdbm_ndbm gdbm-ndbm.h
14337 eval $ndbm_hdr_protochk
14339 : see if getaddrinfo exists
14340 set getaddrinfo d_getaddrinfo
14343 : see if getcwd exists
14344 set getcwd d_getcwd
14347 : see if getespwnam exists
14348 set getespwnam d_getespwnam
14351 : see if getfsstat exists
14352 set getfsstat d_getfsstat
14355 : see if getgrent exists
14356 set getgrent d_getgrent
14359 : see if getgrent_r exists
14360 set getgrent_r d_getgrent_r
14362 case "$d_getgrent_r" in
14364 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14365 case "$d_getgrent_r_proto:$usethreads" in
14366 ":define") d_getgrent_r_proto=define
14367 set d_getgrent_r_proto getgrent_r $hdrs
14371 case "$d_getgrent_r_proto" in
14373 case "$getgrent_r_proto" in
14374 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
14375 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBWR ;;
14377 case "$getgrent_r_proto" in
14378 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
14379 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIR ;;
14381 case "$getgrent_r_proto" in
14382 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
14383 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBW ;;
14385 case "$getgrent_r_proto" in
14386 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
14387 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBI ;;
14389 case "$getgrent_r_proto" in
14390 ''|0) try='int getgrent_r(struct group*, char*, int);'
14391 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBI ;;
14393 case "$getgrent_r_proto" in
14394 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
14395 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIH ;;
14397 case "$getgrent_r_proto" in
14398 ''|0) d_getgrent_r=undef
14400 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
14401 * ) case "$getgrent_r_proto" in
14402 REENTRANT_PROTO*) ;;
14403 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
14405 echo "Prototype: $try" ;;
14408 *) case "$usethreads" in
14409 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
14416 *) getgrent_r_proto=0
14420 : see if getgrgid_r exists
14421 set getgrgid_r d_getgrgid_r
14423 case "$d_getgrgid_r" in
14425 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14426 case "$d_getgrgid_r_proto:$usethreads" in
14427 ":define") d_getgrgid_r_proto=define
14428 set d_getgrgid_r_proto getgrgid_r $hdrs
14432 case "$d_getgrgid_r_proto" in
14434 case "$getgrgid_r_proto" in
14435 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
14436 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
14438 case "$getgrgid_r_proto" in
14439 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
14440 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
14442 case "$getgrgid_r_proto" in
14443 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
14444 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
14446 case "$getgrgid_r_proto" in
14447 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
14448 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
14450 case "$getgrgid_r_proto" in
14451 ''|0) d_getgrgid_r=undef
14453 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
14454 * ) case "$getgrgid_r_proto" in
14455 REENTRANT_PROTO*) ;;
14456 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
14458 echo "Prototype: $try" ;;
14461 *) case "$usethreads" in
14462 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
14469 *) getgrgid_r_proto=0
14473 : see if getgrnam_r exists
14474 set getgrnam_r d_getgrnam_r
14476 case "$d_getgrnam_r" in
14478 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14479 case "$d_getgrnam_r_proto:$usethreads" in
14480 ":define") d_getgrnam_r_proto=define
14481 set d_getgrnam_r_proto getgrnam_r $hdrs
14485 case "$d_getgrnam_r_proto" in
14487 case "$getgrnam_r_proto" in
14488 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
14489 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
14491 case "$getgrnam_r_proto" in
14492 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
14493 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
14495 case "$getgrnam_r_proto" in
14496 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
14497 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CBI ;;
14499 case "$getgrnam_r_proto" in
14500 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
14501 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
14503 case "$getgrnam_r_proto" in
14504 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
14505 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
14507 case "$getgrnam_r_proto" in
14508 ''|0) d_getgrnam_r=undef
14510 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
14511 * ) case "$getgrnam_r_proto" in
14512 REENTRANT_PROTO*) ;;
14513 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
14515 echo "Prototype: $try" ;;
14518 *) case "$usethreads" in
14519 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
14526 *) getgrnam_r_proto=0
14530 : see if gethostbyaddr exists
14531 set gethostbyaddr d_gethbyaddr
14534 : see if gethostbyname exists
14535 set gethostbyname d_gethbyname
14538 : see if gethostent exists
14539 set gethostent d_gethent
14542 : see how we will look up host name
14545 if set gethostname val -f d_gethname; eval $csym; $val; then
14546 echo 'gethostname() found.' >&4
14547 d_gethname="$define"
14550 if set uname val -f d_uname; eval $csym; $val; then
14553 uname() was found, but you're running xenix, and older versions of xenix
14554 have a broken uname(). If you don't really know whether your xenix is old
14555 enough to have a broken system call, use the default answer.
14560 "$define") dflt=n;;
14562 rp='Is your uname() broken?'
14565 n*) d_uname="$define"; call=uname;;
14568 echo 'uname() found.' >&4
14575 case "$d_gethname" in
14576 '') d_gethname="$undef";;
14579 '') d_uname="$undef";;
14581 case "$d_uname$d_gethname" in
14586 Every now and then someone has a $call() that lies about the hostname
14587 but can't be fixed for political or economic reasons. If you wish, I can
14588 pretend $call() isn't there and maybe compute hostname at run-time
14589 thanks to the '$phostname' command.
14592 rp="Shall I ignore $call() from now on?"
14595 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
14598 case "$phostname" in
14599 '') aphostname='';;
14600 *) case "$aphostname" in
14602 *) set X $phostname
14606 file=`./loc $file $file $pth`
14607 aphostname=`echo $file $*`
14612 case "$d_uname$d_gethname" in
14615 case "$phostname" in
14617 echo "There will be no way for $package to get your hostname." >&4;;
14619 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
14623 case "$d_phostname" in
14624 '') d_phostname="$undef";;
14627 : see if gethostbyaddr_r exists
14628 set gethostbyaddr_r d_gethostbyaddr_r
14630 case "$d_gethostbyaddr_r" in
14632 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14633 case "$d_gethostbyaddr_r_proto:$usethreads" in
14634 ":define") d_gethostbyaddr_r_proto=define
14635 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
14639 case "$d_gethostbyaddr_r_proto" in
14641 case "$gethostbyaddr_r_proto" in
14642 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
14643 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
14645 case "$gethostbyaddr_r_proto" in
14646 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
14647 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
14649 case "$gethostbyaddr_r_proto" in
14650 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
14651 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
14653 case "$gethostbyaddr_r_proto" in
14654 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
14655 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
14657 case "$gethostbyaddr_r_proto" in
14658 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
14659 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
14661 case "$gethostbyaddr_r_proto" in
14662 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
14663 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
14665 case "$gethostbyaddr_r_proto" in
14666 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
14667 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
14669 case "$gethostbyaddr_r_proto" in
14670 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
14671 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
14673 case "$gethostbyaddr_r_proto" in
14674 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
14675 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
14677 case "$gethostbyaddr_r_proto" in
14678 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
14679 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
14681 case "$gethostbyaddr_r_proto" in
14682 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
14683 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
14685 case "$gethostbyaddr_r_proto" in
14686 ''|0) d_gethostbyaddr_r=undef
14687 gethostbyaddr_r_proto=0
14688 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
14689 * ) case "$gethostbyaddr_r_proto" in
14690 REENTRANT_PROTO*) ;;
14691 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
14693 echo "Prototype: $try" ;;
14696 *) case "$usethreads" in
14697 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
14699 d_gethostbyaddr_r=undef
14700 gethostbyaddr_r_proto=0
14704 *) gethostbyaddr_r_proto=0
14708 : see if gethostbyname_r exists
14709 set gethostbyname_r d_gethostbyname_r
14711 case "$d_gethostbyname_r" in
14713 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14714 case "$d_gethostbyname_r_proto:$usethreads" in
14715 ":define") d_gethostbyname_r_proto=define
14716 set d_gethostbyname_r_proto gethostbyname_r $hdrs
14720 case "$d_gethostbyname_r_proto" in
14722 case "$gethostbyname_r_proto" in
14723 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
14724 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
14726 case "$gethostbyname_r_proto" in
14727 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
14728 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
14730 case "$gethostbyname_r_proto" in
14731 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
14732 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
14734 case "$gethostbyname_r_proto" in
14735 ''|0) d_gethostbyname_r=undef
14736 gethostbyname_r_proto=0
14737 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
14738 * ) case "$gethostbyname_r_proto" in
14739 REENTRANT_PROTO*) ;;
14740 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
14742 echo "Prototype: $try" ;;
14745 *) case "$usethreads" in
14746 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
14748 d_gethostbyname_r=undef
14749 gethostbyname_r_proto=0
14753 *) gethostbyname_r_proto=0
14757 : see if gethostent_r exists
14758 set gethostent_r d_gethostent_r
14760 case "$d_gethostent_r" in
14762 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14763 case "$d_gethostent_r_proto:$usethreads" in
14764 ":define") d_gethostent_r_proto=define
14765 set d_gethostent_r_proto gethostent_r $hdrs
14769 case "$d_gethostent_r_proto" in
14771 case "$gethostent_r_proto" in
14772 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
14773 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
14775 case "$gethostent_r_proto" in
14776 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
14777 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBIE ;;
14779 case "$gethostent_r_proto" in
14780 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
14781 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBIE ;;
14783 case "$gethostent_r_proto" in
14784 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
14785 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBI ;;
14787 case "$gethostent_r_proto" in
14788 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
14789 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBI ;;
14791 case "$gethostent_r_proto" in
14792 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
14793 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SD ;;
14795 case "$gethostent_r_proto" in
14796 ''|0) d_gethostent_r=undef
14797 gethostent_r_proto=0
14798 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
14799 * ) case "$gethostent_r_proto" in
14800 REENTRANT_PROTO*) ;;
14801 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
14803 echo "Prototype: $try" ;;
14806 *) case "$usethreads" in
14807 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
14809 d_gethostent_r=undef
14810 gethostent_r_proto=0
14814 *) gethostent_r_proto=0
14818 : see if prototypes for various gethostxxx netdb.h functions are available
14820 set d_gethostprotos gethostent $i_netdb netdb.h
14823 : see if getitimer exists
14824 set getitimer d_getitimer
14827 : see if getlogin exists
14828 set getlogin d_getlogin
14831 : see if getlogin_r exists
14832 set getlogin_r d_getlogin_r
14834 case "$d_getlogin_r" in
14836 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
14837 case "$d_getlogin_r_proto:$usethreads" in
14838 ":define") d_getlogin_r_proto=define
14839 set d_getlogin_r_proto getlogin_r $hdrs
14843 case "$d_getlogin_r_proto" in
14845 case "$getlogin_r_proto" in
14846 ''|0) try='int getlogin_r(char*, size_t);'
14847 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BW ;;
14849 case "$getlogin_r_proto" in
14850 ''|0) try='int getlogin_r(char*, int);'
14851 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BI ;;
14853 case "$getlogin_r_proto" in
14854 ''|0) try='char* getlogin_r(char*, size_t);'
14855 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BW ;;
14857 case "$getlogin_r_proto" in
14858 ''|0) try='char* getlogin_r(char*, int);'
14859 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BI ;;
14861 case "$getlogin_r_proto" in
14862 ''|0) d_getlogin_r=undef
14864 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
14865 * ) case "$getlogin_r_proto" in
14866 REENTRANT_PROTO*) ;;
14867 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
14869 echo "Prototype: $try" ;;
14872 *) case "$usethreads" in
14873 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
14880 *) getlogin_r_proto=0
14884 : see if getmnt exists
14885 set getmnt d_getmnt
14888 : see if getmntent exists
14889 set getmntent d_getmntent
14892 : see if getnameinfo exists
14893 set getnameinfo d_getnameinfo
14896 : see if getnetbyaddr exists
14897 set getnetbyaddr d_getnbyaddr
14900 : see if getnetbyname exists
14901 set getnetbyname d_getnbyname
14904 : see if getnetent exists
14905 set getnetent d_getnent
14908 : see if getnetbyaddr_r exists
14909 set getnetbyaddr_r d_getnetbyaddr_r
14911 case "$d_getnetbyaddr_r" in
14913 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14914 case "$d_getnetbyaddr_r_proto:$usethreads" in
14915 ":define") d_getnetbyaddr_r_proto=define
14916 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
14920 case "$d_getnetbyaddr_r_proto" in
14922 case "$getnetbyaddr_r_proto" in
14923 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
14924 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
14926 case "$getnetbyaddr_r_proto" in
14927 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
14928 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
14930 case "$getnetbyaddr_r_proto" in
14931 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
14932 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
14934 case "$getnetbyaddr_r_proto" in
14935 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
14936 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
14938 case "$getnetbyaddr_r_proto" in
14939 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
14940 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
14942 case "$getnetbyaddr_r_proto" in
14943 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
14944 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
14946 case "$getnetbyaddr_r_proto" in
14947 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
14948 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
14950 case "$getnetbyaddr_r_proto" in
14951 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
14952 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
14954 case "$getnetbyaddr_r_proto" in
14955 ''|0) d_getnetbyaddr_r=undef
14956 getnetbyaddr_r_proto=0
14957 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
14958 * ) case "$getnetbyaddr_r_proto" in
14959 REENTRANT_PROTO*) ;;
14960 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
14962 echo "Prototype: $try" ;;
14965 *) case "$usethreads" in
14966 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
14968 d_getnetbyaddr_r=undef
14969 getnetbyaddr_r_proto=0
14973 *) getnetbyaddr_r_proto=0
14977 : see if getnetbyname_r exists
14978 set getnetbyname_r d_getnetbyname_r
14980 case "$d_getnetbyname_r" in
14982 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14983 case "$d_getnetbyname_r_proto:$usethreads" in
14984 ":define") d_getnetbyname_r_proto=define
14985 set d_getnetbyname_r_proto getnetbyname_r $hdrs
14989 case "$d_getnetbyname_r_proto" in
14991 case "$getnetbyname_r_proto" in
14992 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
14993 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
14995 case "$getnetbyname_r_proto" in
14996 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
14997 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
14999 case "$getnetbyname_r_proto" in
15000 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
15001 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
15003 case "$getnetbyname_r_proto" in
15004 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
15005 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
15007 case "$getnetbyname_r_proto" in
15008 ''|0) d_getnetbyname_r=undef
15009 getnetbyname_r_proto=0
15010 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
15011 * ) case "$getnetbyname_r_proto" in
15012 REENTRANT_PROTO*) ;;
15013 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
15015 echo "Prototype: $try" ;;
15018 *) case "$usethreads" in
15019 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
15021 d_getnetbyname_r=undef
15022 getnetbyname_r_proto=0
15026 *) getnetbyname_r_proto=0
15030 : see if getnetent_r exists
15031 set getnetent_r d_getnetent_r
15033 case "$d_getnetent_r" in
15035 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15036 case "$d_getnetent_r_proto:$usethreads" in
15037 ":define") d_getnetent_r_proto=define
15038 set d_getnetent_r_proto getnetent_r $hdrs
15042 case "$d_getnetent_r_proto" in
15044 case "$getnetent_r_proto" in
15045 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
15046 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
15048 case "$getnetent_r_proto" in
15049 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
15050 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBIE ;;
15052 case "$getnetent_r_proto" in
15053 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
15054 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBIE ;;
15056 case "$getnetent_r_proto" in
15057 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
15058 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBI ;;
15060 case "$getnetent_r_proto" in
15061 ''|0) try='int getnetent_r(struct netent*, char*, int);'
15062 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBI ;;
15064 case "$getnetent_r_proto" in
15065 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
15066 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SD ;;
15068 case "$getnetent_r_proto" in
15069 ''|0) d_getnetent_r=undef
15070 getnetent_r_proto=0
15071 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
15072 * ) case "$getnetent_r_proto" in
15073 REENTRANT_PROTO*) ;;
15074 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
15076 echo "Prototype: $try" ;;
15079 *) case "$usethreads" in
15080 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
15082 d_getnetent_r=undef
15083 getnetent_r_proto=0
15087 *) getnetent_r_proto=0
15091 : see if prototypes for various getnetxxx netdb.h functions are available
15093 set d_getnetprotos getnetent $i_netdb netdb.h
15096 : see if getpagesize exists
15097 set getpagesize d_getpagsz
15100 : Optional checks for getprotobyname and getprotobynumber
15102 : see if getprotobyname exists
15103 set getprotobyname d_getpbyname
15106 : see if getprotobynumber exists
15107 set getprotobynumber d_getpbynumber
15110 : see if getprotoent exists
15111 set getprotoent d_getpent
15114 : see if getpgid exists
15115 set getpgid d_getpgid
15118 : see if getpgrp2 exists
15119 set getpgrp2 d_getpgrp2
15122 : see if getppid exists
15123 set getppid d_getppid
15126 : see if getpriority exists
15127 set getpriority d_getprior
15130 : see if getprotobyname_r exists
15131 set getprotobyname_r d_getprotobyname_r
15133 case "$d_getprotobyname_r" in
15135 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15136 case "$d_getprotobyname_r_proto:$usethreads" in
15137 ":define") d_getprotobyname_r_proto=define
15138 set d_getprotobyname_r_proto getprotobyname_r $hdrs
15142 case "$d_getprotobyname_r_proto" in
15144 case "$getprotobyname_r_proto" in
15145 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
15146 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
15148 case "$getprotobyname_r_proto" in
15149 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
15150 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
15152 case "$getprotobyname_r_proto" in
15153 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
15154 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
15156 case "$getprotobyname_r_proto" in
15157 ''|0) d_getprotobyname_r=undef
15158 getprotobyname_r_proto=0
15159 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
15160 * ) case "$getprotobyname_r_proto" in
15161 REENTRANT_PROTO*) ;;
15162 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
15164 echo "Prototype: $try" ;;
15167 *) case "$usethreads" in
15168 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
15170 d_getprotobyname_r=undef
15171 getprotobyname_r_proto=0
15175 *) getprotobyname_r_proto=0
15179 : see if getprotobynumber_r exists
15180 set getprotobynumber_r d_getprotobynumber_r
15182 case "$d_getprotobynumber_r" in
15184 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15185 case "$d_getprotobynumber_r_proto:$usethreads" in
15186 ":define") d_getprotobynumber_r_proto=define
15187 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
15191 case "$d_getprotobynumber_r_proto" in
15193 case "$getprotobynumber_r_proto" in
15194 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
15195 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
15197 case "$getprotobynumber_r_proto" in
15198 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
15199 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
15201 case "$getprotobynumber_r_proto" in
15202 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
15203 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
15205 case "$getprotobynumber_r_proto" in
15206 ''|0) d_getprotobynumber_r=undef
15207 getprotobynumber_r_proto=0
15208 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
15209 * ) case "$getprotobynumber_r_proto" in
15210 REENTRANT_PROTO*) ;;
15211 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
15213 echo "Prototype: $try" ;;
15216 *) case "$usethreads" in
15217 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
15219 d_getprotobynumber_r=undef
15220 getprotobynumber_r_proto=0
15224 *) getprotobynumber_r_proto=0
15228 : see if getprotoent_r exists
15229 set getprotoent_r d_getprotoent_r
15231 case "$d_getprotoent_r" in
15233 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15234 case "$d_getprotoent_r_proto:$usethreads" in
15235 ":define") d_getprotoent_r_proto=define
15236 set d_getprotoent_r_proto getprotoent_r $hdrs
15240 case "$d_getprotoent_r_proto" in
15242 case "$getprotoent_r_proto" in
15243 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
15244 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
15246 case "$getprotoent_r_proto" in
15247 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
15248 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBI ;;
15250 case "$getprotoent_r_proto" in
15251 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
15252 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=S_SBI ;;
15254 case "$getprotoent_r_proto" in
15255 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
15256 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SD ;;
15258 case "$getprotoent_r_proto" in
15259 ''|0) d_getprotoent_r=undef
15260 getprotoent_r_proto=0
15261 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
15262 * ) case "$getprotoent_r_proto" in
15263 REENTRANT_PROTO*) ;;
15264 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
15266 echo "Prototype: $try" ;;
15269 *) case "$usethreads" in
15270 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
15272 d_getprotoent_r=undef
15273 getprotoent_r_proto=0
15277 *) getprotoent_r_proto=0
15281 : see if prototypes for various getprotoxxx netdb.h functions are available
15283 set d_getprotoprotos getprotoent $i_netdb netdb.h
15286 : see if getprpwnam exists
15287 set getprpwnam d_getprpwnam
15290 : see if getpwent exists
15291 set getpwent d_getpwent
15294 : see if getpwent_r exists
15295 set getpwent_r d_getpwent_r
15297 case "$d_getpwent_r" in
15299 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15300 case "$d_getpwent_r_proto:$usethreads" in
15301 ":define") d_getpwent_r_proto=define
15302 set d_getpwent_r_proto getpwent_r $hdrs
15306 case "$d_getpwent_r_proto" in
15308 case "$getpwent_r_proto" in
15309 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
15310 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBWR ;;
15312 case "$getpwent_r_proto" in
15313 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
15314 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIR ;;
15316 case "$getpwent_r_proto" in
15317 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
15318 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBW ;;
15320 case "$getpwent_r_proto" in
15321 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
15322 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBI ;;
15324 case "$getpwent_r_proto" in
15325 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
15326 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBI ;;
15328 case "$getpwent_r_proto" in
15329 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
15330 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIH ;;
15332 case "$getpwent_r_proto" in
15333 ''|0) d_getpwent_r=undef
15335 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
15336 * ) case "$getpwent_r_proto" in
15337 REENTRANT_PROTO*) ;;
15338 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
15340 echo "Prototype: $try" ;;
15343 *) case "$usethreads" in
15344 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
15351 *) getpwent_r_proto=0
15355 : see if getpwnam_r exists
15356 set getpwnam_r d_getpwnam_r
15358 case "$d_getpwnam_r" in
15360 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15361 case "$d_getpwnam_r_proto:$usethreads" in
15362 ":define") d_getpwnam_r_proto=define
15363 set d_getpwnam_r_proto getpwnam_r $hdrs
15367 case "$d_getpwnam_r_proto" in
15369 case "$getpwnam_r_proto" in
15370 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
15371 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
15373 case "$getpwnam_r_proto" in
15374 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
15375 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
15377 case "$getpwnam_r_proto" in
15378 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
15379 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
15381 case "$getpwnam_r_proto" in
15382 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
15383 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
15385 case "$getpwnam_r_proto" in
15386 ''|0) d_getpwnam_r=undef
15388 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
15389 * ) case "$getpwnam_r_proto" in
15390 REENTRANT_PROTO*) ;;
15391 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
15393 echo "Prototype: $try" ;;
15396 *) case "$usethreads" in
15397 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
15404 *) getpwnam_r_proto=0
15408 : see if getpwuid_r exists
15409 set getpwuid_r d_getpwuid_r
15411 case "$d_getpwuid_r" in
15413 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15414 case "$d_getpwuid_r_proto:$usethreads" in
15415 ":define") d_getpwuid_r_proto=define
15416 set d_getpwuid_r_proto getpwuid_r $hdrs
15420 case "$d_getpwuid_r_proto" in
15422 case "$getpwuid_r_proto" in
15423 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
15424 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
15426 case "$getpwuid_r_proto" in
15427 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
15428 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
15430 case "$getpwuid_r_proto" in
15431 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
15432 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
15434 case "$getpwuid_r_proto" in
15435 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
15436 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
15438 case "$getpwuid_r_proto" in
15439 ''|0) d_getpwuid_r=undef
15441 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
15442 * ) case "$getpwuid_r_proto" in
15443 REENTRANT_PROTO*) ;;
15444 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
15446 echo "Prototype: $try" ;;
15449 *) case "$usethreads" in
15450 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
15457 *) getpwuid_r_proto=0
15461 : Optional checks for getsbyname and getsbyport
15463 : see if getservbyname exists
15464 set getservbyname d_getsbyname
15467 : see if getservbyport exists
15468 set getservbyport d_getsbyport
15471 : see if getservent exists
15472 set getservent d_getsent
15475 : see if getservbyname_r exists
15476 set getservbyname_r d_getservbyname_r
15478 case "$d_getservbyname_r" in
15480 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15481 case "$d_getservbyname_r_proto:$usethreads" in
15482 ":define") d_getservbyname_r_proto=define
15483 set d_getservbyname_r_proto getservbyname_r $hdrs
15487 case "$d_getservbyname_r_proto" in
15489 case "$getservbyname_r_proto" in
15490 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
15491 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
15493 case "$getservbyname_r_proto" in
15494 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
15495 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
15497 case "$getservbyname_r_proto" in
15498 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
15499 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
15501 case "$getservbyname_r_proto" in
15502 ''|0) d_getservbyname_r=undef
15503 getservbyname_r_proto=0
15504 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
15505 * ) case "$getservbyname_r_proto" in
15506 REENTRANT_PROTO*) ;;
15507 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
15509 echo "Prototype: $try" ;;
15512 *) case "$usethreads" in
15513 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
15515 d_getservbyname_r=undef
15516 getservbyname_r_proto=0
15520 *) getservbyname_r_proto=0
15524 : see if getservbyport_r exists
15525 set getservbyport_r d_getservbyport_r
15527 case "$d_getservbyport_r" in
15529 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15530 case "$d_getservbyport_r_proto:$usethreads" in
15531 ":define") d_getservbyport_r_proto=define
15532 set d_getservbyport_r_proto getservbyport_r $hdrs
15536 case "$d_getservbyport_r_proto" in
15538 case "$getservbyport_r_proto" in
15539 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
15540 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
15542 case "$getservbyport_r_proto" in
15543 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
15544 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
15546 case "$getservbyport_r_proto" in
15547 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
15548 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
15550 case "$getservbyport_r_proto" in
15551 ''|0) d_getservbyport_r=undef
15552 getservbyport_r_proto=0
15553 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
15554 * ) case "$getservbyport_r_proto" in
15555 REENTRANT_PROTO*) ;;
15556 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
15558 echo "Prototype: $try" ;;
15561 *) case "$usethreads" in
15562 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
15564 d_getservbyport_r=undef
15565 getservbyport_r_proto=0
15569 *) getservbyport_r_proto=0
15573 : see if getservent_r exists
15574 set getservent_r d_getservent_r
15576 case "$d_getservent_r" in
15578 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15579 case "$d_getservent_r_proto:$usethreads" in
15580 ":define") d_getservent_r_proto=define
15581 set d_getservent_r_proto getservent_r $hdrs
15585 case "$d_getservent_r_proto" in
15587 case "$getservent_r_proto" in
15588 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
15589 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBWR ;;
15591 case "$getservent_r_proto" in
15592 ''|0) try='int getservent_r(struct servent*, char*, int);'
15593 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBI ;;
15595 case "$getservent_r_proto" in
15596 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
15597 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=S_SBI ;;
15599 case "$getservent_r_proto" in
15600 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
15601 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SD ;;
15603 case "$getservent_r_proto" in
15604 ''|0) d_getservent_r=undef
15605 getservent_r_proto=0
15606 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
15607 * ) case "$getservent_r_proto" in
15608 REENTRANT_PROTO*) ;;
15609 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
15611 echo "Prototype: $try" ;;
15614 *) case "$usethreads" in
15615 define) echo "getservent_r has no prototype, not using it." >&4 ;;
15617 d_getservent_r=undef
15618 getservent_r_proto=0
15622 *) getservent_r_proto=0
15626 : see if prototypes for various getservxxx netdb.h functions are available
15628 set d_getservprotos getservent $i_netdb netdb.h
15631 : see if getspnam exists
15632 set getspnam d_getspnam
15635 : see if this is a shadow.h system
15636 set shadow.h i_shadow
15639 : see if getspnam_r exists
15640 set getspnam_r d_getspnam_r
15642 case "$d_getspnam_r" in
15644 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
15645 case "$d_getspnam_r_proto:$usethreads" in
15646 ":define") d_getspnam_r_proto=define
15647 set d_getspnam_r_proto getspnam_r $hdrs
15651 case "$d_getspnam_r_proto" in
15653 case "$getspnam_r_proto" in
15654 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
15655 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
15657 case "$getspnam_r_proto" in
15658 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
15659 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=S_CSBI ;;
15661 case "$getspnam_r_proto" in
15662 ''|0) d_getspnam_r=undef
15664 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
15665 * ) case "$getspnam_r_proto" in
15666 REENTRANT_PROTO*) ;;
15667 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
15669 echo "Prototype: $try" ;;
15672 *) case "$usethreads" in
15673 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
15680 *) getspnam_r_proto=0
15684 : see if gettimeofday or ftime exists
15685 set gettimeofday d_gettimeod
15687 case "$d_gettimeod" in
15693 val="$undef"; set d_ftime; eval $setvar
15696 case "$d_gettimeod$d_ftime" in
15699 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
15703 : see if gmtime_r exists
15704 set gmtime_r d_gmtime_r
15706 case "$d_gmtime_r" in
15708 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15709 case "$d_gmtime_r_proto:$usethreads" in
15710 ":define") d_gmtime_r_proto=define
15711 set d_gmtime_r_proto gmtime_r $hdrs
15715 case "$d_gmtime_r_proto" in
15717 case "$gmtime_r_proto" in
15718 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
15719 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=S_TS ;;
15721 case "$gmtime_r_proto" in
15722 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
15723 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=I_TS ;;
15725 case "$gmtime_r_proto" in
15726 ''|0) d_gmtime_r=undef
15728 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
15729 * ) case "$gmtime_r_proto" in
15730 REENTRANT_PROTO*) ;;
15731 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
15733 echo "Prototype: $try" ;;
15736 *) case "$usethreads" in
15737 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
15744 *) gmtime_r_proto=0
15748 : see if hasmntopt exists
15749 set hasmntopt d_hasmntopt
15752 : see if this is a netinet/in.h or sys/in.h system
15753 set netinet/in.h i_niin sys/in.h i_sysin
15756 : see if arpa/inet.h has to be included
15757 set arpa/inet.h i_arpainet
15760 : see if htonl --and friends-- exists
15765 : Maybe they are macros.
15768 $cat >htonl.c <<EOM
15770 #include <sys/types.h>
15771 #$i_niin I_NETINET_IN
15773 #$i_arpainet I_ARPA_INET
15774 #ifdef I_NETINET_IN
15775 #include <netinet/in.h>
15778 #include <sys/in.h>
15781 #include <arpa/inet.h>
15784 printf("Defined as a macro.");
15787 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
15788 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
15790 echo "But it seems to be defined as a macro." >&4
15798 : see if hypot exists
15802 : see if ilogb exists
15806 : see if ilogbl exists
15807 set ilogbl d_ilogbl
15812 if set index val -f; eval $csym; $val; then
15813 if set strchr val -f d_strchr; eval $csym; $val; then
15814 if $contains strchr "$strings" >/dev/null 2>&1 ; then
15817 echo "strchr() found." >&4
15821 echo "index() found." >&4
15826 echo "index() found." >&4
15829 if set strchr val -f d_strchr; eval $csym; $val; then
15832 echo "strchr() found." >&4
15834 echo "No index() or strchr() found!" >&4
15839 set d_strchr; eval $setvar
15841 set d_index; eval $setvar
15843 : check whether inet_aton exists
15844 set inet_aton d_inetaton
15847 : see if inet_ntop exists
15848 set inet_ntop d_inetntop
15851 : see if inet_pton exists
15852 set inet_pton d_inetpton
15857 $cat >isascii.c <<EOCP
15860 #$i_stdlib I_STDLIB
15862 #include <stdlib.h>
15873 if eval $compile; then
15874 echo "isascii() found." >&4
15877 echo "isascii() NOT found." >&4
15886 $cat >isblank.c <<'EOCP'
15897 if $cc $ccflags $ldflags -o isblank isblank.c $libs >/dev/null 2>&1 ; then
15898 echo "isblank() found." >&4
15901 echo "isblank() NOT found." >&4
15908 : check for isfinite
15909 echo "Checking to see if you have isfinite..." >&4
15915 int main() { return isfinite(0.0); }
15918 if eval $compile; then
15920 echo "You have isfinite."
15923 echo "You do not have isfinite."
15929 : see if isfinitel exists
15930 set isfinitel d_isfinitel
15934 echo "Checking to see if you have isinf..." >&4
15940 int main() { return isinf(0.0); }
15943 if eval $compile; then
15945 echo "You have isinf."
15948 echo "You do not have isinf."
15954 : see if isinfl exists
15955 set isinfl d_isinfl
15959 echo "Checking to see if you have isless..." >&4
15965 int main() { return isless(0.0); }
15968 if eval $compile; then
15970 echo "You have isless."
15973 echo "You do not have isless."
15980 echo "Checking to see if you have isnan..." >&4
15986 int main() { return isnan(0.0); }
15989 if eval $compile; then
15991 echo "You have isnan."
15994 echo "You do not have isnan."
16000 : see if isnanl exists
16001 set isnanl d_isnanl
16004 : check for isnormal
16005 echo "Checking to see if you have isnormal..." >&4
16011 int main() { return isnormal(0.0); }
16014 if eval $compile; then
16016 echo "You have isnormal."
16019 echo "You do not have isnormal."
16029 : see if j0l exists
16033 : see if killpg exists
16034 set killpg d_killpg
16037 : see if localeconv exists
16038 set localeconv d_locconv
16041 : see if libc has the POSIX.1-2008 currency locale rules
16042 case "$d_locconv:$d_lc_monetary_2008" in
16045 #include <locale.h>
16047 struct lconv *lc = localeconv();
16048 char int_p_cs_precedes = lc->int_p_cs_precedes;
16053 if eval $compile; then
16054 d_lc_monetary_2008="$define"
16056 d_lc_monetary_2008="$undef"
16062 : see if lchown exists
16064 $cat > try.c <<'EOCP'
16065 /* System header to define __stub macros and hopefully few prototypes,
16066 which can conflict with char lchown(); below. */
16067 #include <assert.h>
16068 /* Override any gcc2 internal prototype to avoid an error. */
16069 /* We use char because int might match the return type of a gcc2
16070 builtin and then its argument prototype would still apply. */
16073 /* The GNU C library defines this for functions which it implements
16074 to always fail with ENOSYS. Some functions are actually named
16075 something starting with __ and the normal name is an alias. */
16076 #if defined (__stub_lchown) || defined (__stub___lchown)
16084 if eval $compile; then
16085 $echo "lchown() found." >&4
16088 $echo "lchown() NOT found." >&4
16094 : See if number of significant digits in a double precision number is known
16096 $cat >ldbl_dig.c <<EOM
16097 #$i_limits I_LIMITS
16100 #include <limits.h>
16106 printf("Contains LDBL_DIG");
16109 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
16110 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
16111 echo "LDBL_DIG found." >&4
16114 echo "LDBL_DIG NOT found." >&4
16121 : see if lgamma exists
16122 set lgamma d_lgamma
16125 : see if lgamma_r exists
16126 set lgamma_r d_lgamma_r
16129 : check to see if math.h defines _LIB_VERSION
16130 d_libm_lib_version="$undef"
16134 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
16136 #include <unistd.h>
16138 int main (int argc, char *argv[])
16140 printf ("%d\n", _LIB_VERSION);
16145 if eval $compile; then
16147 echo "Yes, it does ($foo)" >&4
16148 d_libm_lib_version="$define"
16150 echo "No, it does not (probably harmless)" >&4
16157 : see if link exists
16161 : see if llrint exists
16162 set llrint d_llrint
16165 : see if llrintl exists
16166 set llrintl d_llrintl
16169 : see if llround exists
16170 set llround d_llround
16173 : see if llroundl exists
16174 set llroundl d_llroundl
16177 : see if localtime_r exists
16178 set localtime_r d_localtime_r
16180 case "$d_localtime_r" in
16182 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
16183 case "$d_localtime_r_proto:$usethreads" in
16184 ":define") d_localtime_r_proto=define
16185 set d_localtime_r_proto localtime_r $hdrs
16189 case "$d_localtime_r_proto" in
16191 case "$localtime_r_proto" in
16192 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
16193 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=S_TS ;;
16195 case "$localtime_r_proto" in
16196 ''|0) try='int localtime_r(const time_t*, struct tm*);'
16197 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=I_TS ;;
16199 case "$localtime_r_proto" in
16200 ''|0) d_localtime_r=undef
16201 localtime_r_proto=0
16202 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
16203 * ) case "$localtime_r_proto" in
16204 REENTRANT_PROTO*) ;;
16205 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
16207 echo "Prototype: $try" ;;
16210 *) case "$usethreads" in
16211 define) echo "localtime_r has no prototype, not using it." >&4 ;;
16213 d_localtime_r=undef
16214 localtime_r_proto=0
16218 *) localtime_r_proto=0
16222 : see if localtime_r calls tzset
16223 case "$localtime_r_proto" in
16226 /* Does our libc's localtime_r call tzset ?
16227 * return 0 if so, 1 otherwise.
16229 #$i_systypes I_SYS_TYPES
16230 #$i_unistd I_UNISTD
16232 #$i_stdlib I_STDLIB
16233 #$i_string I_STRING
16234 #$i_malloc I_MALLOC
16236 # include <sys/types.h>
16239 # include <unistd.h>
16245 #include <stdlib.h>
16248 # include <string.h>
16250 # include <strings.h>
16253 # include <malloc.h>
16257 time_t t = time(0L);
16258 char w_tz[]="TZ" "=GMT+5",
16259 e_tz[]="TZ" "=GMT-5",
16260 *tz_e = (char*)malloc(16),
16261 *tz_w = (char*)malloc(16);
16262 struct tm tm_e, tm_w;
16263 memset(&tm_e,'\0',sizeof(struct tm));
16264 memset(&tm_w,'\0',sizeof(struct tm));
16269 localtime_r(&t, &tm_e);
16272 localtime_r(&t, &tm_w);
16274 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
16280 if eval $compile; then
16281 if $run ./try; then
16282 d_localtime_r_needs_tzset=undef;
16284 d_localtime_r_needs_tzset=define;
16287 d_localtime_r_needs_tzset=undef;
16291 d_localtime_r_needs_tzset=undef;
16296 : see if lockf exists
16300 : see if log1p exists
16304 : see if log2 exists
16308 : see if logb exists
16312 : see if lrint exists
16316 : see if lrintl exists
16317 set lrintl d_lrintl
16320 : see if lround exists
16321 set lround d_lround
16324 : see if lroundl exists
16325 set lroundl d_lroundl
16328 : see if prototype for lseek is available
16330 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
16333 : see if lstat exists
16337 : see if madvise exists
16338 set madvise d_madvise
16341 : see if malloc_size exists
16342 set malloc_size d_malloc_size
16345 : see if malloc_size_good exists
16346 set malloc_good_size d_malloc_good_size
16349 : see if mblen exists
16353 : see if mbstowcs exists
16354 set mbstowcs d_mbstowcs
16357 : see if mbtowc exists
16358 set mbtowc d_mbtowc
16361 : see if memchr exists
16362 set memchr d_memchr
16365 : see if memcmp exists
16366 set memcmp d_memcmp
16369 : see if memcpy exists
16370 set memcpy d_memcpy
16373 : see if memmem exists
16374 set memmem d_memmem
16377 : see if memmove exists
16378 set memmove d_memmove
16381 : see if memset exists
16382 set memset d_memset
16385 : see if mkdir exists
16389 : see if mkdtemp exists
16390 set mkdtemp d_mkdtemp
16393 : see if mkfifo exists
16394 set mkfifo d_mkfifo
16397 : see if mkstemp exists
16398 set mkstemp d_mkstemp
16401 : see if mkstemps exists
16402 set mkstemps d_mkstemps
16405 : see if mktime exists
16406 set mktime d_mktime
16409 : see if this is a sys/mman.h system
16410 set sys/mman.h i_sysmman
16413 : see if mmap exists
16416 : see what shmat returns
16417 : default to something harmless
16419 case "$i_sysmman$d_mmap" in
16421 $cat >mmap.c <<'END'
16422 #include <sys/mman.h>
16425 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
16430 echo "and it returns ($mmaptype)." >&4
16436 : see if sqrtl exists
16440 : see if scalbnl exists
16441 set scalbnl d_scalbnl
16444 : see if truncl exists
16445 set truncl d_truncl
16448 : see if modfl exists
16452 : see if prototype for modfl is available
16454 set d_modflproto modfl $i_math math.h
16457 if $test "$uselongdouble" = "$define"; then
16459 if $test "$d_sqrtl" != "$define"; then
16460 message="$message sqrtl"
16462 if $test "$d_modfl" != "$define"; then
16463 if $test "$d_truncl:$d_copysignl" = "$define:$define"; then
16464 echo "You have both truncl and copysignl, so I can emulate modfl."
16466 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
16467 echo "You have both aintl and copysignl, so I can emulate modfl."
16469 message="$message modfl"
16473 if $test "$d_frexpl" != "$define"; then
16474 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
16475 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
16477 message="$message frexpl"
16480 if $test "$d_ldexpl" != "$define"; then
16481 message="$message ldexpl"
16484 if $test "$message" != ""; then
16487 *** You requested the use of long doubles but you do not seem to have
16488 *** the following mathematical functions needed for long double support:
16490 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
16491 *** Cannot continue, aborting.
16499 : see if mprotect exists
16500 set mprotect d_mprotect
16503 : see if msgctl exists
16504 set msgctl d_msgctl
16507 : see if msgget exists
16508 set msgget d_msgget
16511 : see if msgsnd exists
16512 set msgsnd d_msgsnd
16515 : see if msgrcv exists
16516 set msgrcv d_msgrcv
16519 : see how much of the 'msg*(2)' library is present.
16522 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
16523 *"$undef"*) h_msg=false;;
16527 case "`ipcs 2>&1`" in
16528 "SVID messages"*"not configured"*)
16529 echo "Your $osname does not have the msg*(2) configured." >&4
16532 set msgctl d_msgctl
16534 set msgget d_msgget
16536 set msgsnd d_msgsnd
16538 set msgrcv d_msgrcv
16544 : we could also check for sys/ipc.h ...
16545 if $h_msg && $test `./findhdr sys/msg.h`; then
16546 echo "You have the full msg*(2) library." >&4
16549 echo "You don't have the full msg*(2) library." >&4
16555 : Check for msghdr_s
16557 echo "Checking to see if your system supports struct msghdr..." >&4
16558 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
16560 case "$d_msghdr_s" in
16561 "$define") echo "Yes, it does." ;;
16562 *) echo "No, it doesn't." ;;
16566 : see if msync exists
16570 : see if munmap exists
16571 set munmap d_munmap
16574 : see if nan exists
16578 : see if nearbyint exists
16579 set nearbyint d_nearbyint
16582 : see if nextafter exists
16583 set nextafter d_nextafter
16586 : see if nexttoward exists
16587 set nexttoward d_nexttoward
16590 : see if nice exists
16594 : see if this is a langinfo.h system
16595 set langinfo.h i_langinfo
16598 : see if nl_langinfo exists
16599 set nl_langinfo d_nl_langinfo
16602 : see if this is a quadmath.h system
16603 set quadmath.h i_quadmath
16606 : check for volatile keyword
16608 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
16609 $cat >try.c <<'EOCP'
16612 typedef struct _goo_struct goo_struct;
16613 goo_struct * volatile goo = ((goo_struct *)0);
16614 struct _goo_struct {
16619 typedef unsigned short foo_t;
16620 char *volatile foo;
16622 volatile foo_t blech;
16626 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
16628 echo "Yup, it does."
16631 echo "Nope, it doesn't."
16637 : Check basic sizes
16639 $echo "Choosing the C types to be used for Perl's internal types..." >&4
16641 case "$use64bitint:$d_quad:$quadtype" in
16644 uvtype="$uquadtype"
16649 uvtype="unsigned long"
16655 case "$uselongdouble:$d_longdbl" in
16657 nvtype="long double"
16658 nvsize=$longdblsize
16665 case "$usequadmath:$i_quadmath" in
16667 nvtype="__float128"
16673 *** You requested the use of the quadmath library, but you
16674 *** do not seem to have the quadmath library installed.
16675 *** Cannot continue, aborting.
16681 define:*) $cat <<EOM >&4
16683 *** You requested the use of the quadmath library, but you
16684 *** do not seem to have the required header, <quadmath.h>.
16686 case "$gccversion" in
16689 *** Your gcc looks a bit old:
16695 *** You are not running a gcc.
16700 *** For the quadmath library you need at least gcc 4.6.
16701 *** Cannot continue, aborting.
16707 $echo "(IV will be "$ivtype", $ivsize bytes)"
16708 $echo "(UV will be "$uvtype", $uvsize bytes)"
16709 $echo "(NV will be "$nvtype", $nvsize bytes)"
16712 #$i_inttypes I_INTTYPES
16714 #include <inttypes.h>
16719 int8_t i = INT8_MAX;
16720 uint8_t u = UINT8_MAX;
16721 printf("int8_t\n");
16724 int16_t i = INT16_MAX;
16725 uint16_t u = UINT16_MAX;
16726 printf("int16_t\n");
16729 int32_t i = INT32_MAX;
16730 uint32_t u = UINT32_MAX;
16731 printf("int32_t\n");
16736 i8type="signed char"
16737 u8type="unsigned char"
16742 '') case "$shortsize" in
16744 u16type="unsigned short"
16752 '') set try -DINT16
16753 if eval $compile; then
16754 case "`$run ./try`" in
16766 '') if $test $shortsize -ge 2; then
16768 u16type="unsigned short"
16776 '') case "$longsize" in
16778 u32type="unsigned long"
16782 *) case "$intsize" in
16784 u32type="unsigned int"
16794 '') set try -DINT32
16795 if eval $compile; then
16796 case "`$run ./try`" in
16808 '') if $test $intsize -ge 4; then
16810 u32type="unsigned int"
16818 '') case "$d_quad:$quadtype" in
16820 i64type="$quadtype"
16821 u64type="$uquadtype"
16829 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
16830 : volatile so that the compiler has to store it out to memory.
16831 if test X"$d_volatile" = X"$define"; then
16836 #$i_stdlib I_STDLIB
16838 #include <stdlib.h>
16840 #include <sys/types.h>
16841 #include <signal.h>
16843 $volatile int bletched = 0;
16844 $signal_t blech(int s) { bletched = 1; }
16849 int n = 8 * $uvsize;
16852 signal(SIGFPE, blech);
16855 for (i = 0; i < n; i++) {
16856 u = u << 1 | ($uvtype)1;
16858 if (($uvtype)d != u)
16862 d = ($nvtype)(u - 1);
16863 if (($uvtype)d != (u - 1))
16870 printf("%d\n", ((i == n) ? -n : i));
16876 d_nv_preserves_uv="$undef"
16877 if eval $compile; then
16878 nv_preserves_uv_bits="`$run ./try`"
16880 case "$nv_preserves_uv_bits" in
16882 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
16883 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
16884 d_nv_preserves_uv="$define"
16886 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
16887 d_nv_preserves_uv="$undef" ;;
16888 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
16889 nv_preserves_uv_bits="0" ;;
16893 $echo "Checking to find the largest integer value your NVs can hold..." >&4
16894 : volatile so that the compiler has to store it out to memory.
16895 if test X"$d_volatile" = X"$define"; then
16901 typedef $nvtype NV;
16908 while(count < 256) {
16909 $volatile NV up = value + 1.0;
16910 $volatile NV negated = -value;
16911 $volatile NV down = negated - 1.0;
16912 $volatile NV got_up = up - value;
16913 int up_good = got_up == 1.0;
16914 int got_down = down - negated;
16915 int down_good = got_down == -1.0;
16917 if (down_good != up_good) {
16919 "Inconsistency - up %d %f; down %d %f; for 2**%d (%.20f)\n",
16920 up_good, (double) got_up, down_good, (double) got_down,
16921 count, (double) value);
16928 fputs("256.0", stdout);
16931 fputs("2.0", stdout);
16937 fputs("*", stdout);
16943 fprintf(stderr, "Cannot overflow integer range, even at 2**%d (%.20f)\n",
16944 count, (double) value);
16950 nv_overflows_integers_at='0'
16951 if eval $compile; then
16957 The largest integer your NVs can preserve is equal to $xxx
16959 nv_overflows_integers_at="$xxx"
16962 Cannot determine the largest integer value your NVs can hold, unexpected output
16969 Cannot determine the largest integer value your NVs can hold
16976 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
16977 : volatile so that the compiler has to store it out to memory.
16978 if test X"$d_volatile" = X"$define"; then
16983 #$i_stdlib I_STDLIB
16985 #include <stdlib.h>
16987 #$i_string I_STRING
16989 # include <string.h>
16991 # include <strings.h>
16993 #include <sys/types.h>
16994 #include <signal.h>
16996 $volatile int bletched = 0;
16997 $signal_t blech(int s) { bletched = 1; }
17000 int checkit($nvtype d, char *where) {
17001 unsigned char *p = (char *)&d;
17002 unsigned char *end = p + sizeof(d);
17012 printf("No - %s: 0x", where);
17014 printf ("%02X", *p++);
17019 int main(int argc, char **argv) {
17022 fail += checkit(d, "0.0");
17024 /* The compiler shouldn't be assuming that bletched is 0 */
17027 fail += checkit(d, "bleched");
17030 signal(SIGFPE, blech);
17033 /* Paranoia - the compiler should have no way of knowing that ANSI says
17034 that argv[argc] will always be NULL. Actually, if it did assume this it
17035 would be buggy, as this is C and main() can be called from elsewhere in
17037 d = argv[argc] ? 1 : 0;
17040 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
17043 fail += checkit(d, "ternary");
17045 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
17048 printf("No - memset doesn't give 0.0\n");
17049 /* This might just blow up: */
17050 printf("(gives %g)\n", d);
17056 printf("No - something bleched\n");
17061 printf("No - %d fail(s)\n", fail);
17070 d_nv_zero_is_allbits_zero="$undef"
17071 if eval $compile; then
17077 0.0 is represented as all bits zero in memory
17079 d_nv_zero_is_allbits_zero="$define"
17082 0.0 is not represented as all bits zero in memory
17084 d_nv_zero_is_allbits_zero="$undef"
17089 0.0 is not represented as all bits zero in memory
17091 d_nv_zero_is_allbits_zero="$undef"
17097 : check for off64_t
17099 echo "Checking to see if you have off64_t..." >&4
17101 #include <sys/types.h>
17102 #include <unistd.h>
17103 int main() { off64_t x = 7; }
17106 if eval $compile; then
17108 echo "You have off64_t."
17111 echo "You do not have off64_t."
17112 case "$lseeksize" in
17113 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
17120 : how to create joinable pthreads
17121 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
17123 echo "Checking what constant to use for creating joinable pthreads..." >&4
17124 $cat >try.c <<'EOCP'
17125 #include <pthread.h>
17127 int detachstate = JOINABLE;
17130 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
17131 if eval $compile; then
17132 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
17133 val="$undef" # Yes, undef.
17134 set d_old_pthread_create_joinable
17137 set old_pthread_create_joinable
17140 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
17141 if eval $compile; then
17142 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
17144 set d_old_pthread_create_joinable
17146 val=PTHREAD_CREATE_UNDETACHED
17147 set old_pthread_create_joinable
17150 set try -DJOINABLE=__UNDETACHED
17151 if eval $compile; then
17152 echo "You seem to use __UNDETACHED." >&4
17154 set d_old_pthread_create_joinable
17157 set old_pthread_create_joinable
17160 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
17162 set d_old_pthread_create_joinable
17165 set old_pthread_create_joinable
17172 d_old_pthread_create_joinable="$undef"
17173 old_pthread_create_joinable=""
17176 : see if pause exists
17180 : see if poll exists
17184 : see if prctl exists
17188 : see if prctl supports PR_SET_NAME
17189 d_prctl_set_name=$undef
17194 #include <unistd.h>
17196 #include <sys/prctl.h>
17198 int main (int argc, char *argv[])
17200 return (prctl (PR_SET_NAME, "Test"));
17204 if eval $compile_ok && $run ./try; then
17205 echo "Your prctl (PR_SET_NAME, ...) works"
17206 d_prctl_set_name=$define
17212 : see if readlink exists
17213 set readlink d_readlink
17216 : Check if there is a /proc symlink to the abs path of
17217 : the executing program. We will honor hints of d_procselfexe=$undef
17218 : or procselfexe being non-empty, otherwise will try to determine both
17219 : if we have readlink.
17220 : AmigaOS will attempt to mount proc: aka /proc, if /proc/... is
17221 : referenced, and AmigaOS does not have a proc filesystem anyway.
17224 if $test "X$d_procselfexe" = Xundef; then
17226 elif $test "X$procselfexe" != X -a "X$procselfexe" != 'X '; then
17228 elif $test "X$d_readlink" = Xdefine; then
17229 : NetBSD first as /proc/self is a symlink to /proc/curproc,
17230 : and it feels more tidy to avoid an extra level of symlink
17231 set NetBSD /proc/curproc/exe Linux /proc/self/exe FreeBSD /proc/curproc/file Solaris /proc/self/path/a.out
17232 while test $# -gt 0; do
17235 if $issymlink $try; then
17236 $ls -l $try > reflect
17237 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
17238 echo "You have $type-like $try."
17239 procselfexe='"'$try'"'
17241 : This will break out of the loop
17251 : backward compatibility for d_hvfork
17252 if test X$d_hvfork != X; then
17253 d_vfork="$d_hvfork"
17256 : see if there is a vfork
17261 d_pseudofork=$undef
17263 : Ok, but do we want to use it. vfork is reportedly unreliable in
17264 : perl on Solaris 2.x, and probably elsewhere.
17268 case "$usevfork" in
17274 Perl can only use a vfork() that doesn't suffer from strict
17275 restrictions on calling functions or modifying global data in
17276 the child. For example, glibc-2.1 contains such a vfork()
17277 that is unsuitable. If your system provides a proper fork()
17278 call, chances are that you do NOT want perl to use vfork().
17281 rp="Do you still want to use vfork()?"
17286 echo "Ok, we won't use vfork()."
17295 $define) usevfork='true';;
17296 *) usevfork='false';;
17299 : see whether the pthread_atfork exists
17301 #include <pthread.h>
17304 #ifdef PTHREAD_ATFORK
17305 pthread_atfork(NULL,NULL,NULL);
17310 : see if pthread_atfork exists
17311 set try -DPTHREAD_ATFORK
17312 if eval $compile; then
17317 case "$usethreads" in
17320 $define) echo 'pthread_atfork found.' >&4 ;;
17321 *) echo 'pthread_atfork NOT found.' >&4 ;;
17324 set d_pthread_atfork
17327 : see if pthread_attr_setscope exists
17328 set pthread_attr_setscope d_pthread_attr_setscope
17331 : see whether the various POSIXish _yields exist
17333 #include <pthread.h>
17339 #ifdef PTHREAD_YIELD
17342 #ifdef PTHREAD_YIELD_NULL
17343 pthread_yield(NULL);
17349 : see if sched_yield exists
17350 set try -DSCHED_YIELD
17351 if eval $compile; then
17353 sched_yield='sched_yield()'
17357 case "$usethreads" in
17360 $define) echo 'sched_yield() found.' >&4 ;;
17361 *) echo 'sched_yield() NOT found.' >&4 ;;
17367 : see if pthread_yield exists
17368 set try -DPTHREAD_YIELD
17369 if eval $compile; then
17371 case "$sched_yield" in
17372 '') sched_yield='pthread_yield()' ;;
17375 set try -DPTHREAD_YIELD_NULL
17376 if eval $compile; then
17378 case "$sched_yield" in
17379 '') sched_yield='pthread_yield(NULL)' ;;
17385 case "$usethreads" in
17388 $define) echo 'pthread_yield() found.' >&4 ;;
17389 *) echo 'pthread_yield() NOT found.' >&4 ;;
17393 set d_pthread_yield
17395 case "$sched_yield" in
17396 '') sched_yield=undef ;;
17400 : check for ptrdiff_t
17402 echo "Checking to see if you have ptrdiff_t..." >&4
17404 #include <stddef.h>
17405 int main() { ptrdiff_t x = 7; }
17408 if eval $compile; then
17410 echo "You have ptrdiff_t."
17413 echo "You do not have ptrdiff_t."
17419 : see if random_r exists
17420 set random_r d_random_r
17422 case "$d_random_r" in
17424 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17425 case "$d_random_r_proto:$usethreads" in
17426 ":define") d_random_r_proto=define
17427 set d_random_r_proto random_r $hdrs
17431 case "$d_random_r_proto" in
17433 case "$random_r_proto" in
17434 ''|0) try='int random_r(int*, struct random_data*);'
17435 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_iS ;;
17437 case "$random_r_proto" in
17438 ''|0) try='int random_r(long*, struct random_data*);'
17439 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_lS ;;
17441 case "$random_r_proto" in
17442 ''|0) try='int random_r(struct random_data*, int32_t*);'
17443 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_St ;;
17445 case "$random_r_proto" in
17446 ''|0) d_random_r=undef
17448 echo "Disabling random_r, cannot determine prototype." >&4 ;;
17449 * ) case "$random_r_proto" in
17450 REENTRANT_PROTO*) ;;
17451 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
17453 echo "Prototype: $try" ;;
17456 *) case "$usethreads" in
17457 define) echo "random_r has no prototype, not using it." >&4 ;;
17464 *) random_r_proto=0
17468 : see if readdir and friends exist
17469 set readdir d_readdir
17471 set seekdir d_seekdir
17473 set telldir d_telldir
17475 set rewinddir d_rewinddir
17478 : see if readdir64_r exists
17479 set readdir64_r d_readdir64_r
17481 case "$d_readdir64_r" in
17483 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
17484 case "$d_readdir64_r_proto:$usethreads" in
17485 ":define") d_readdir64_r_proto=define
17486 set d_readdir64_r_proto readdir64_r $hdrs
17490 case "$d_readdir64_r_proto" in
17492 case "$readdir64_r_proto" in
17493 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
17494 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TSR ;;
17496 case "$readdir64_r_proto" in
17497 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
17498 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TS ;;
17500 case "$readdir64_r_proto" in
17501 ''|0) d_readdir64_r=undef
17502 readdir64_r_proto=0
17503 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
17504 * ) case "$readdir64_r_proto" in
17505 REENTRANT_PROTO*) ;;
17506 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
17508 echo "Prototype: $try" ;;
17511 *) case "$usethreads" in
17512 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
17514 d_readdir64_r=undef
17515 readdir64_r_proto=0
17519 *) readdir64_r_proto=0
17523 : see if readdir_r exists
17524 set readdir_r d_readdir_r
17526 case "$d_readdir_r" in
17528 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
17529 case "$d_readdir_r_proto:$usethreads" in
17530 ":define") d_readdir_r_proto=define
17531 set d_readdir_r_proto readdir_r $hdrs
17535 case "$d_readdir_r_proto" in
17537 case "$readdir_r_proto" in
17538 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
17539 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TSR ;;
17541 case "$readdir_r_proto" in
17542 ''|0) try='int readdir_r(DIR*, struct dirent*);'
17543 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TS ;;
17545 case "$readdir_r_proto" in
17546 ''|0) d_readdir_r=undef
17548 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
17549 * ) case "$readdir_r_proto" in
17550 REENTRANT_PROTO*) ;;
17551 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
17553 echo "Prototype: $try" ;;
17556 *) case "$usethreads" in
17557 define) echo "readdir_r has no prototype, not using it." >&4 ;;
17564 *) readdir_r_proto=0
17568 : see if readv exists
17572 : see if recvmsg exists
17573 set recvmsg d_recvmsg
17576 : see if regcomp, regcmp, or re_comp exist, for regular pattern matching
17578 if set regcomp val -f d_regcomp; eval $csym; $val; then
17579 echo 'regcomp() found.' >&4
17580 d_regcomp="$define"
17583 elif set regcmp val -f d_regcmp; eval $csym; $val; then
17584 echo 'regcmp() found.' >&4
17588 elif set re_comp val -f d_re_comp; eval $csym; $val; then
17589 echo 're_comp() found, assuming re_exec() also exists.' >&4
17590 d_re_comp="$define"
17595 No regcomp(), regcmp() nor re_comp() found !! No regular pattern matching.
17602 : see if remainder exists
17603 set remainder d_remainder
17606 : see if remquo exists
17607 set remquo d_remquo
17610 : see if rename exists
17611 set rename d_rename
17614 : see if rint exists
17618 : see if rmdir exists
17622 : see if round exists
17626 : see if memory.h is available.
17631 : See if it conflicts with string.h
17637 $cppstdin $cppflags $cppminus < $strings > mem.h
17638 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
17640 echo "We won't be including <memory.h>."
17650 : can bcopy handle overlapping blocks?
17653 case "$d_memmove" in
17654 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
17655 *) case "$d_bcopy" in
17657 echo "Checking to see if bcopy() can do overlapping copies..." >&4
17659 #$i_memory I_MEMORY
17660 #$i_stdlib I_STDLIB
17661 #$i_string I_STRING
17662 #$i_unistd I_UNISTD
17664 $cat >>try.c <<'EOCP'
17667 # include <memory.h>
17670 # include <stdlib.h>
17673 # include <string.h>
17675 # include <strings.h>
17678 # include <unistd.h> /* Needed for NetBSD */
17682 char buf[128], abc[128];
17688 /* Copy "abcde..." string to char abc[] so that gcc doesn't
17689 try to store the string in read-only memory. */
17690 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
17692 for (align = 7; align >= 0; align--) {
17693 for (len = 36; len; len--) {
17695 bcopy(abc, b, len);
17696 for (off = 1; off <= len; off++) {
17697 bcopy(b, b+off, len);
17698 bcopy(b+off, b, len);
17699 if (bcmp(b, abc, len))
17708 if eval $compile_ok; then
17709 if $run ./try 2>/dev/null; then
17710 echo "Yes, it can."
17713 echo "It can't, sorry."
17716 echo "(I can't compile the test program, so we'll assume not...)"
17726 : can memcpy handle overlapping blocks?
17729 case "$d_memmove" in
17730 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
17731 *) case "$d_memcpy" in
17733 echo "Checking to see if memcpy() can do overlapping copies..." >&4
17735 #$i_memory I_MEMORY
17736 #$i_stdlib I_STDLIB
17737 #$i_string I_STRING
17738 #$i_unistd I_UNISTD
17740 $cat >>try.c <<'EOCP'
17743 # include <memory.h>
17746 # include <stdlib.h>
17749 # include <string.h>
17751 # include <strings.h>
17754 # include <unistd.h> /* Needed for NetBSD */
17758 char buf[128], abc[128];
17764 /* Copy "abcde..." string to char abc[] so that gcc doesn't
17765 try to store the string in read-only memory. */
17766 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
17768 for (align = 7; align >= 0; align--) {
17769 for (len = 36; len; len--) {
17771 memcpy(b, abc, len);
17772 for (off = 1; off <= len; off++) {
17773 memcpy(b+off, b, len);
17774 memcpy(b, b+off, len);
17775 if (memcmp(b, abc, len))
17784 if eval $compile_ok; then
17785 if $run ./try 2>/dev/null; then
17786 echo "Yes, it can."
17789 echo "It can't, sorry."
17792 echo "(I can't compile the test program, so we'll assume not...)"
17802 : can memcmp be trusted to compare relative magnitude?
17804 case "$d_memcmp" in
17807 echo "Checking if your memcmp() can compare relative magnitude..." >&4
17809 #$i_memory I_MEMORY
17810 #$i_stdlib I_STDLIB
17811 #$i_string I_STRING
17812 #$i_unistd I_UNISTD
17814 $cat >>try.c <<'EOCP'
17817 # include <memory.h>
17820 # include <stdlib.h>
17823 # include <string.h>
17825 # include <strings.h>
17828 # include <unistd.h> /* Needed for NetBSD */
17834 if ((a < b) && memcmp(&a, &b, 1) < 0)
17840 if eval $compile_ok; then
17841 if $run ./try 2>/dev/null; then
17842 echo "Yes, it can."
17845 echo "No, it can't (it uses signed chars)."
17848 echo "(I can't compile the test program, so we'll assume not...)"
17856 : see if prototype for sbrk is available
17858 set d_sbrkproto sbrk $i_unistd unistd.h
17861 : see if scalbn exists
17862 set scalbn d_scalbn
17865 : see if select exists
17866 set select d_select
17869 : see if semctl exists
17870 set semctl d_semctl
17873 : see if semget exists
17874 set semget d_semget
17877 : see if semop exists
17881 : see how much of the 'sem*(2)' library is present.
17884 case "$d_semctl$d_semget$d_semop" in
17885 *"$undef"*) h_sem=false;;
17889 case "`ipcs 2>&1`" in
17890 "SVID messages"*"not configured"*)
17891 echo "Your $osname does not have the sem*(2) configured." >&4
17894 set semctl d_semctl
17896 set semget d_semget
17904 : we could also check for sys/ipc.h ...
17905 if $h_sem && $test `./findhdr sys/sem.h`; then
17906 echo "You have the full sem*(2) library." >&4
17909 echo "You don't have the full sem*(2) library." >&4
17915 : see whether sys/sem.h defines union semun
17917 $cat > try.c <<'END'
17918 #include <sys/types.h>
17919 #include <sys/ipc.h>
17920 #include <sys/sem.h>
17921 int main () { union semun semun; semun.buf = 0; }
17924 if eval $compile; then
17925 echo "You have union semun in <sys/sem.h>." >&4
17928 echo "You do not have union semun in <sys/sem.h>." >&4
17935 : see how to do semctl IPC_STAT
17939 $cat > tryh.h <<END
17942 # define S_IRUSR S_IREAD
17943 # define S_IWUSR S_IWRITE
17944 # define S_IXUSR S_IEXEC
17946 # define S_IRUSR 0400
17947 # define S_IWUSR 0200
17948 # define S_IXUSR 0100
17950 # define S_IRGRP (S_IRUSR>>3)
17951 # define S_IWGRP (S_IWUSR>>3)
17952 # define S_IXGRP (S_IXUSR>>3)
17953 # define S_IROTH (S_IRUSR>>6)
17954 # define S_IWOTH (S_IWUSR>>6)
17955 # define S_IXOTH (S_IXUSR>>6)
17958 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
17959 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
17960 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
17963 : see whether semctl IPC_STAT can use union semun
17964 case "$d_semctl_semun" in
17968 #include <sys/types.h>
17969 #include <sys/ipc.h>
17970 #include <sys/sem.h>
17971 #include <sys/stat.h>
17978 #$d_union_semun HAS_UNION_SEMUN
17981 #ifndef HAS_UNION_SEMUN
17984 struct semid_ds *buf;
17985 unsigned short *array;
17991 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
17992 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
17994 struct semid_ds argbuf;
17997 st = semctl(sem, 0, IPC_STAT, arg);
18001 # endif /* IPC_STAT */
18002 printf("semctl IPC_STAT failed: errno = %d\n", errno);
18004 if (semctl(sem, 0, IPC_RMID, arg) != 0)
18005 # endif /* IPC_RMID */
18006 printf("semctl IPC_RMID failed: errno = %d\n", errno);
18008 #endif /* IPC_PRIVATE && ... */
18009 printf("semget failed: errno = %d\n", errno);
18014 if eval $compile; then
18017 semun) val="$define" ;;
18025 case "$d_semctl_semun" in
18027 echo "You can use union semun for semctl IPC_STAT." >&4
18030 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
18035 : see whether semctl IPC_STAT can use struct semid_ds pointer
18036 case "$d_semctl_semid_ds" in
18039 $cat > try.c <<'END'
18040 #include <sys/types.h>
18041 #include <sys/ipc.h>
18042 #include <sys/sem.h>
18043 #include <sys/stat.h>
18051 struct semid_ds arg;
18054 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
18055 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
18058 st = semctl(sem, 0, IPC_STAT, &arg);
18060 printf("semid_ds\n");
18062 # endif /* IPC_STAT */
18063 printf("semctl IPC_STAT failed: errno = %d\n", errno);
18065 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
18066 # endif /* IPC_RMID */
18067 printf("semctl IPC_RMID failed: errno = %d\n", errno);
18069 #endif /* IPC_PRIVATE && ... */
18070 printf("semget failed: errno = %d\n", errno);
18076 if eval $compile; then
18079 semid_ds) val="$define" ;;
18083 set d_semctl_semid_ds
18087 case "$d_semctl_semid_ds" in
18089 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
18091 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
18097 # We do not have the full sem*(2) library, so assume we can not
18103 set d_semctl_semid_ds
18109 : see if sendmsg exists
18110 set sendmsg d_sendmsg
18113 : see if setegid exists
18114 set setegid d_setegid
18117 : see if seteuid exists
18118 set seteuid d_seteuid
18121 : see if setgrent exists
18122 set setgrent d_setgrent
18125 : see if setgrent_r exists
18126 set setgrent_r d_setgrent_r
18128 case "$d_setgrent_r" in
18130 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
18131 case "$d_setgrent_r_proto:$usethreads" in
18132 ":define") d_setgrent_r_proto=define
18133 set d_setgrent_r_proto setgrent_r $hdrs
18137 case "$d_setgrent_r_proto" in
18139 case "$setgrent_r_proto" in
18140 ''|0) try='int setgrent_r(FILE**);'
18141 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=I_H ;;
18143 case "$setgrent_r_proto" in
18144 ''|0) try='void setgrent_r(FILE**);'
18145 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=V_H ;;
18147 case "$setgrent_r_proto" in
18148 ''|0) d_setgrent_r=undef
18150 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
18151 * ) case "$setgrent_r_proto" in
18152 REENTRANT_PROTO*) ;;
18153 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
18155 echo "Prototype: $try" ;;
18158 *) case "$usethreads" in
18159 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
18166 *) setgrent_r_proto=0
18170 : see if sethostent exists
18171 set sethostent d_sethent
18174 : see if sethostent_r exists
18175 set sethostent_r d_sethostent_r
18177 case "$d_sethostent_r" in
18179 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18180 case "$d_sethostent_r_proto:$usethreads" in
18181 ":define") d_sethostent_r_proto=define
18182 set d_sethostent_r_proto sethostent_r $hdrs
18186 case "$d_sethostent_r_proto" in
18188 case "$sethostent_r_proto" in
18189 ''|0) try='int sethostent_r(int, struct hostent_data*);'
18190 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=I_ID ;;
18192 case "$sethostent_r_proto" in
18193 ''|0) try='void sethostent_r(int, struct hostent_data*);'
18194 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=V_ID ;;
18196 case "$sethostent_r_proto" in
18197 ''|0) d_sethostent_r=undef
18198 sethostent_r_proto=0
18199 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
18200 * ) case "$sethostent_r_proto" in
18201 REENTRANT_PROTO*) ;;
18202 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
18204 echo "Prototype: $try" ;;
18207 *) case "$usethreads" in
18208 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
18210 d_sethostent_r=undef
18211 sethostent_r_proto=0
18215 *) sethostent_r_proto=0
18219 : see if setitimer exists
18220 set setitimer d_setitimer
18223 : see if setlinebuf exists
18224 set setlinebuf d_setlinebuf
18227 : see if setlocale exists
18228 set setlocale d_setlocale
18231 : see if locale.h is available
18232 set locale.h i_locale
18235 : see if setlocale_r exists
18236 set setlocale_r d_setlocale_r
18238 case "$d_setlocale_r" in
18240 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
18241 case "$d_setlocale_r_proto:$usethreads" in
18242 ":define") d_setlocale_r_proto=define
18243 set d_setlocale_r_proto setlocale_r $hdrs
18247 case "$d_setlocale_r_proto" in
18249 case "$setlocale_r_proto" in
18250 ''|0) try='int setlocale_r(int, const char*, char*, int);'
18251 ./protochk "$extern_C $try" $hdrs && setlocale_r_proto=I_ICBI ;;
18253 case "$setlocale_r_proto" in
18254 ''|0) d_setlocale_r=undef
18255 setlocale_r_proto=0
18256 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
18257 * ) case "$setlocale_r_proto" in
18258 REENTRANT_PROTO*) ;;
18259 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
18261 echo "Prototype: $try" ;;
18264 *) case "$usethreads" in
18265 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
18267 d_setlocale_r=undef
18268 setlocale_r_proto=0
18272 *) setlocale_r_proto=0
18276 : see if setnetent exists
18277 set setnetent d_setnent
18280 : see if setnetent_r exists
18281 set setnetent_r d_setnetent_r
18283 case "$d_setnetent_r" in
18285 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18286 case "$d_setnetent_r_proto:$usethreads" in
18287 ":define") d_setnetent_r_proto=define
18288 set d_setnetent_r_proto setnetent_r $hdrs
18292 case "$d_setnetent_r_proto" in
18294 case "$setnetent_r_proto" in
18295 ''|0) try='int setnetent_r(int, struct netent_data*);'
18296 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=I_ID ;;
18298 case "$setnetent_r_proto" in
18299 ''|0) try='void setnetent_r(int, struct netent_data*);'
18300 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=V_ID ;;
18302 case "$setnetent_r_proto" in
18303 ''|0) d_setnetent_r=undef
18304 setnetent_r_proto=0
18305 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
18306 * ) case "$setnetent_r_proto" in
18307 REENTRANT_PROTO*) ;;
18308 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
18310 echo "Prototype: $try" ;;
18313 *) case "$usethreads" in
18314 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
18316 d_setnetent_r=undef
18317 setnetent_r_proto=0
18321 *) setnetent_r_proto=0
18325 : see if setprotoent exists
18326 set setprotoent d_setpent
18329 : see if setpgid exists
18330 set setpgid d_setpgid
18333 : see if setpgrp2 exists
18334 set setpgrp2 d_setpgrp2
18337 : see if setpriority exists
18338 set setpriority d_setprior
18341 : see if setproctitle exists
18342 set setproctitle d_setproctitle
18345 : see if setprotoent_r exists
18346 set setprotoent_r d_setprotoent_r
18348 case "$d_setprotoent_r" in
18350 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18351 case "$d_setprotoent_r_proto:$usethreads" in
18352 ":define") d_setprotoent_r_proto=define
18353 set d_setprotoent_r_proto setprotoent_r $hdrs
18357 case "$d_setprotoent_r_proto" in
18359 case "$setprotoent_r_proto" in
18360 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
18361 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=I_ID ;;
18363 case "$setprotoent_r_proto" in
18364 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
18365 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=V_ID ;;
18367 case "$setprotoent_r_proto" in
18368 ''|0) d_setprotoent_r=undef
18369 setprotoent_r_proto=0
18370 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
18371 * ) case "$setprotoent_r_proto" in
18372 REENTRANT_PROTO*) ;;
18373 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
18375 echo "Prototype: $try" ;;
18378 *) case "$usethreads" in
18379 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
18381 d_setprotoent_r=undef
18382 setprotoent_r_proto=0
18386 *) setprotoent_r_proto=0
18390 : see if setpwent exists
18391 set setpwent d_setpwent
18394 : see if setpwent_r exists
18395 set setpwent_r d_setpwent_r
18397 case "$d_setpwent_r" in
18399 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
18400 case "$d_setpwent_r_proto:$usethreads" in
18401 ":define") d_setpwent_r_proto=define
18402 set d_setpwent_r_proto setpwent_r $hdrs
18406 case "$d_setpwent_r_proto" in
18408 case "$setpwent_r_proto" in
18409 ''|0) try='int setpwent_r(FILE**);'
18410 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=I_H ;;
18412 case "$setpwent_r_proto" in
18413 ''|0) try='void setpwent_r(FILE**);'
18414 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=V_H ;;
18416 case "$setpwent_r_proto" in
18417 ''|0) d_setpwent_r=undef
18419 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
18420 * ) case "$setpwent_r_proto" in
18421 REENTRANT_PROTO*) ;;
18422 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
18424 echo "Prototype: $try" ;;
18427 *) case "$usethreads" in
18428 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
18435 *) setpwent_r_proto=0
18439 : see if setregid exists
18440 set setregid d_setregid
18442 set setresgid d_setresgid
18445 : see if setreuid exists
18446 set setreuid d_setreuid
18448 set setresuid d_setresuid
18451 : see if setrgid exists
18452 set setrgid d_setrgid
18455 : see if setruid exists
18456 set setruid d_setruid
18459 : see if setservent exists
18460 set setservent d_setsent
18463 : see if setservent_r exists
18464 set setservent_r d_setservent_r
18466 case "$d_setservent_r" in
18468 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18469 case "$d_setservent_r_proto:$usethreads" in
18470 ":define") d_setservent_r_proto=define
18471 set d_setservent_r_proto setservent_r $hdrs
18475 case "$d_setservent_r_proto" in
18477 case "$setservent_r_proto" in
18478 ''|0) try='int setservent_r(int, struct servent_data*);'
18479 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=I_ID ;;
18481 case "$setservent_r_proto" in
18482 ''|0) try='void setservent_r(int, struct servent_data*);'
18483 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=V_ID ;;
18485 case "$setservent_r_proto" in
18486 ''|0) d_setservent_r=undef
18487 setservent_r_proto=0
18488 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
18489 * ) case "$setservent_r_proto" in
18490 REENTRANT_PROTO*) ;;
18491 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
18493 echo "Prototype: $try" ;;
18496 *) case "$usethreads" in
18497 define) echo "setservent_r has no prototype, not using it." >&4 ;;
18499 d_setservent_r=undef
18500 setservent_r_proto=0
18504 *) setservent_r_proto=0
18508 : see if setsid exists
18509 set setsid d_setsid
18512 : see if setvbuf exists
18513 set setvbuf d_setvbuf
18516 : see if shmctl exists
18517 set shmctl d_shmctl
18520 : see if shmget exists
18521 set shmget d_shmget
18524 : see if shmat exists
18527 : see what shmat returns
18530 $cat >shmat.c <<'END'
18531 #include <sys/shm.h>
18534 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
18539 echo "and it returns ($shmattype)." >&4
18540 : see if a prototype for shmat is available
18541 xxx=`./findhdr sys/shm.h`
18542 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
18543 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
18554 set d_shmatprototype
18557 : see if shmdt exists
18561 : see how much of the 'shm*(2)' library is present.
18564 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
18565 *"$undef"*) h_shm=false;;
18569 case "`ipcs 2>&1`" in
18570 "SVID shared memory"*"not configured"*)
18571 echo "Your $osname does not have the shm*(2) configured." >&4
18574 set shmctl d_shmctl
18576 set shmget d_shmget
18586 : we could also check for sys/ipc.h ...
18587 if $h_shm && $test `./findhdr sys/shm.h`; then
18588 echo "You have the full shm*(2) library." >&4
18591 echo "You don't have the full shm*(2) library." >&4
18597 : see if we have sigaction
18599 if set sigaction val -f d_sigaction; eval $csym; $val; then
18600 echo 'sigaction() found.' >&4
18603 #include <sys/types.h>
18604 #include <signal.h>
18605 #$i_stdlib I_STDLIB
18607 #include <stdlib.h>
18611 struct sigaction act, oact;
18613 oact.sa_handler = 0;
18614 /* so that act and oact are used */
18615 exit(act.sa_flags == 0 && oact.sa_handler == 0);
18619 if eval $compile_ok; then
18622 echo "But you don't seem to have a usable struct sigaction." >&4
18626 echo 'sigaction NOT found.' >&4
18629 set d_sigaction; eval $setvar
18632 : see what type pids are declared as in the kernel
18633 rp="What is the type of process ids on this system?"
18634 set pid_t pidtype int stdio.h sys/types.h
18637 : see what type uids are declared as in the kernel
18639 echo "Looking for the type for user ids returned by getuid()."
18640 set uid_t uidtype xxx stdio.h sys/types.h
18644 xxx=`./findhdr sys/user.h`
18645 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
18647 unsigned) dflt="$1 $2" ;;
18651 *) dflt="$uidtype";;
18654 uid_t) echo "uid_t found." ;;
18655 *) rp="What is the type for user ids returned by getuid()?"
18661 : Define hasfield_t macro for Configure internal use
18662 hasfield_t='varname=$1; struct=$2; type=$3; field=$4; shift; shift; shift; shift;
18663 while $test $# -ge 2; do
18665 $define) echo "#include <$2>";;
18669 echo "int main () { $struct foo; $type bar = foo.$field; }" >> try.c;
18671 if eval $compile; then
18680 : see what siginfo fields we have
18681 case "$d_sigaction" in
18683 echo "Checking if your siginfo_t has si_errno field...">&4
18684 set d_siginfo_si_errno siginfo_t int si_errno $d_sigaction signal.h
18687 echo "Checking if your siginfo_t has si_pid field...">&4
18688 set d_siginfo_si_pid siginfo_t $pidtype si_pid $d_sigaction signal.h
18691 echo "Checking if your siginfo_t has si_uid field...">&4
18692 set d_siginfo_si_uid siginfo_t $uidtype si_uid $d_sigaction signal.h
18695 echo "Checking if your siginfo_t has si_addr field...">&4
18696 set d_siginfo_si_addr siginfo_t "void *" si_addr $d_sigaction signal.h
18699 echo "Checking if your siginfo_t has si_status field...">&4
18700 set d_siginfo_si_status siginfo_t int si_status $d_sigaction signal.h
18703 echo "Checking if your siginfo_t has si_band field...">&4
18704 set d_siginfo_si_band siginfo_t long si_band $d_sigaction signal.h
18707 echo "Checking if your siginfo_t has si_value field...">&4
18708 set d_siginfo_si_value siginfo_t "union sigval" si_value $d_sigaction signal.h
18711 echo "Checking if your siginfo_t has si_fd field...">&4
18712 set d_siginfo_si_fd siginfo_t int si_fd $d_sigaction signal.h
18717 d_siginfo_si_errno="$undef"
18718 d_siginfo_si_pid="$undef"
18719 d_siginfo_si_uid="$undef"
18720 d_siginfo_si_addr="$undef"
18721 d_siginfo_si_status="$undef"
18722 d_siginfo_si_band="$undef"
18723 d_siginfo_si_value="$undef"
18724 d_siginfo_si_fd="$undef"
18728 : see if this is a sunmath.h system
18729 set sunmath.h i_sunmath
18732 : see if signbit exists
18733 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
18736 #$i_sunmath I_SUNMATH
18740 #ifdef I_SUNMATH /* Solaris special math library */
18741 # include <sunmath.h>
18744 int main(int argc, char **argv)
18748 if ((signbit(x) == 0) && (signbit(y) != 0))
18756 if eval $compile; then
18757 if $run ./try; then
18761 $echo "Signbit seems to be available, but doesn't work as I expected."
18762 $echo "I won't use it." >&4
18773 : see if sigprocmask exists
18774 set sigprocmask d_sigprocmask
18777 : see if sigsetjmp exists
18779 case "$d_sigsetjmp" in
18782 #include <setjmp.h>
18783 #$i_stdlib I_STDLIB
18785 #include <stdlib.h>
18791 if (sigsetjmp(env,1))
18794 siglongjmp(env, 1);
18799 if eval $compile; then
18800 if $run ./try >/dev/null 2>&1; then
18801 echo "POSIX sigsetjmp found." >&4
18805 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
18811 echo "sigsetjmp not found." >&4
18815 *) val="$d_sigsetjmp"
18816 case "$d_sigsetjmp" in
18817 $define) echo "POSIX sigsetjmp found." >&4;;
18818 $undef) echo "sigsetjmp not found." >&4;;
18826 : see if snprintf exists
18827 set snprintf d_snprintf
18830 : see if vsnprintf exists
18831 set vsnprintf d_vsnprintf
18834 case "$d_snprintf-$d_vsnprintf" in
18837 Checking whether your snprintf() and vsnprintf() work okay...
18839 $cat >try.c <<'EOCP'
18840 /* v?snprintf testing logic courtesy of Russ Allbery.
18841 * According to C99:
18842 * - if the buffer is too short it still must be \0-terminated
18843 * - if the buffer is too short the potentially required length
18844 * must be returned and not -1
18845 * - if the buffer is NULL the potentially required length
18846 * must be returned and not -1 or core dump
18849 #include <stdarg.h>
18853 int test (char *format, ...)
18858 va_start (args, format);
18859 count = vsnprintf (buf, sizeof buf, format, args);
18866 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
18867 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
18871 if eval $compile; then
18874 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
18876 Your snprintf() and snprintf() don't seem to be working okay.
18878 d_snprintf="$undef"
18879 d_vsnprintf="$undef"
18883 echo "(I can't seem to compile the test program--assuming they don't)"
18884 d_snprintf="$undef"
18885 d_vsnprintf="$undef"
18891 : see if sockatmark exists
18892 set sockatmark d_sockatmark
18895 : see if prototype for sockatmark is available
18897 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
18900 : see if socks5_init exists
18901 set socks5_init d_socks5_init
18904 : see if sprintf returns the length of the string in the buffer as per ANSI
18905 $echo "Checking whether sprintf returns the length of the string..." >&4
18908 #$i_stdlib I_STDLIB
18910 #include <stdlib.h>
18912 #$i_string I_STRING
18914 # include <string.h>
18916 # include <strings.h>
18925 int check (size_t expect, int test) {
18926 size_t got = strlen(buffer);
18930 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
18935 int main(int argc, char **argv) {
18938 check(sprintf(buffer, ""), ++test);
18939 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
18940 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
18947 if eval $compile; then
18951 sprintf returns the length of the string (as ANSI says it should)
18953 d_sprintf_returns_strlen="$define"
18956 sprintf does not return the length of the string (how old is this system?)
18958 d_sprintf_returns_strlen="$undef"
18962 echo "(I can't seem to compile the test program--assuming it doesn't)" >&4
18963 d_sprintf_returns_strlen="$undef"
18967 : see if srand48_r exists
18968 set srand48_r d_srand48_r
18970 case "$d_srand48_r" in
18972 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
18973 case "$d_srand48_r_proto:$usethreads" in
18974 ":define") d_srand48_r_proto=define
18975 set d_srand48_r_proto srand48_r $hdrs
18979 case "$d_srand48_r_proto" in
18981 case "$srand48_r_proto" in
18982 ''|0) try='int srand48_r(long, struct drand48_data*);'
18983 ./protochk "$extern_C $try" $hdrs && srand48_r_proto=I_LS ;;
18985 case "$srand48_r_proto" in
18986 ''|0) d_srand48_r=undef
18988 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
18989 * ) case "$srand48_r_proto" in
18990 REENTRANT_PROTO*) ;;
18991 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
18993 echo "Prototype: $try" ;;
18996 *) case "$usethreads" in
18997 define) echo "srand48_r has no prototype, not using it." >&4 ;;
19004 *) srand48_r_proto=0
19008 : see if srandom_r exists
19009 set srandom_r d_srandom_r
19011 case "$d_srandom_r" in
19013 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
19014 case "$d_srandom_r_proto:$usethreads" in
19015 ":define") d_srandom_r_proto=define
19016 set d_srandom_r_proto srandom_r $hdrs
19020 case "$d_srandom_r_proto" in
19022 case "$srandom_r_proto" in
19023 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
19024 ./protochk "$extern_C $try" $hdrs && srandom_r_proto=I_TS ;;
19026 case "$srandom_r_proto" in
19027 ''|0) d_srandom_r=undef
19029 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
19030 * ) case "$srandom_r_proto" in
19031 REENTRANT_PROTO*) ;;
19032 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
19034 echo "Prototype: $try" ;;
19037 *) case "$usethreads" in
19038 define) echo "srandom_r has no prototype, not using it." >&4 ;;
19045 *) srandom_r_proto=0
19049 : see if prototype for setresgid is available
19051 set d_sresgproto setresgid $i_unistd unistd.h
19054 : see if prototype for setresuid is available
19056 set d_sresuproto setresuid $i_unistd unistd.h
19059 : see if stat exists
19063 : see if sys/stat.h is available
19064 set sys/stat.h i_sysstat
19067 : see if stat knows about block sizes
19069 echo "Checking to see if your struct stat has st_blocks field..." >&4
19070 set d_statblks stat st_blocks $i_sysstat sys/stat.h
19073 : see if this is a sys/vfs.h system
19074 set sys/vfs.h i_sysvfs
19077 : see if this is a sys/statfs.h system
19078 set sys/statfs.h i_sysstatfs
19081 : Check for statfs_s
19083 echo "Checking to see if your system supports struct statfs..." >&4
19084 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
19086 case "$d_statfs_s" in
19087 "$define") echo "Yes, it does." ;;
19088 *) echo "No, it doesn't." ;;
19092 : see if struct statfs knows about f_flags
19093 case "$d_statfs_s" in
19096 echo "Checking to see if your struct statfs has f_flags field..." >&4
19097 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
19101 set d_statfs_f_flags
19105 case "$d_statfs_f_flags" in
19106 "$define") echo "Yes, it does." ;;
19107 *) echo "No, it doesn't." ;;
19110 : see what flavor, if any, of static inline is supported
19112 echo "Checking to see if your system supports static inline..."
19113 $cat > try.c <<'EOCP'
19114 #include <stdlib.h>
19115 extern int f_via_a(int x);
19116 extern int f_via_b(int x);
19117 int main(int argc, char **argv)
19126 return EXIT_SUCCESS;
19129 return EXIT_FAILURE;
19133 $cat > a.c <<'EOCP'
19134 static INLINE int f(int x) {
19145 $cat > b.c <<'EOCP'
19146 extern int f(int x);
19154 # Respect a hint (or previous) value for perl_static_inline, if there is one.
19155 case "$perl_static_inline" in
19156 '') # Check the various possibilities, and break out on success.
19157 # For gcc, prefer __inline__, which will still permit
19158 # cflags.SH to add in -ansi.
19159 case "$gccversion" in
19160 '') xxx="inline __inline__ __inline _inline";;
19161 *) xxx="__inline__ inline __inline _inline";;
19163 for inline in $xxx; do
19164 set try -DINLINE=$inline a.c
19165 if eval $compile && $run ./try; then
19166 # Now make sure there is no external linkage of static
19168 set try -DINLINE=$inline -DUSE_B a.c b.c
19169 if eval $compile && $run ./try; then
19170 $echo "Your compiler supports static $inline, " >&4
19171 $echo "but it also creates an external definition," >&4
19172 $echo "so I won't use it." >&4
19175 $echo "Your compiler supports static $inline." >&4
19177 perl_static_inline="static $inline";
19181 $echo "Your compiler does NOT support static $inline." >&4
19186 *inline*) # Some variant of inline exists.
19187 echo "Keeping your $hint value of $perl_static_inline."
19190 static) # No inline capabilities
19191 echo "Keeping your $hint value of $perl_static_inline."
19194 *) # Unrecognized previous value -- blindly trust the supplied
19195 # value and hope it makes sense. Use old value for
19196 # d_static_inline, if there is one.
19197 echo "Keeping your $hint value of $perl_static_inline."
19198 case "$d_static_inline" in
19200 *) val=$d_static_inline ;;
19204 # Fallback to plain 'static' if nothing worked.
19205 case "$perl_static_inline" in
19207 perl_static_inline="static"
19211 set d_static_inline
19213 $rm -f a.[co] b.[co]
19216 : Check stream access
19218 Checking how to access stdio streams by file descriptor number...
19220 case "$stdio_stream_array" in
19221 '') $cat >try.c <<EOCP
19224 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
19228 for s in _iob __iob __sF
19230 set try -DSTDIO_STREAM_ARRAY=$s
19231 if eval $compile; then
19232 case "`$run ./try`" in
19233 yes) stdio_stream_array=$s; break ;;
19239 case "$stdio_stream_array" in
19241 I can't figure out how to access stdio streams by file descriptor number.
19243 d_stdio_stream_array="$undef"
19246 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
19248 d_stdio_stream_array="$define"
19252 : see if strcoll exists
19253 set strcoll d_strcoll
19256 : check for structure copying
19258 echo "Checking to see if your C compiler can copy structs..." >&4
19259 $cat >try.c <<'EOCP'
19269 if $cc -c try.c >/dev/null 2>&1 ; then
19271 echo "Yup, it can."
19274 echo "Nope, it can't."
19280 : see if strerror and/or sys_errlist[] exist
19282 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
19283 if set strerror val -f d_strerror; eval $csym; $val; then
19284 echo 'strerror() found.' >&4
19285 d_strerror="$define"
19286 d_strerrm='strerror(e)'
19287 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
19288 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
19289 d_syserrlst="$define"
19291 echo "(Since you don't have sys_errlist[], strerror() is welcome.)"
19292 d_syserrlst="$undef"
19294 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
19295 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
19296 echo 'strerror() found in string header.' >&4
19297 d_strerror="$define"
19298 d_strerrm='strerror(e)'
19299 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
19300 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
19301 d_syserrlst="$define"
19303 echo "(You don't appear to have any sys_errlist[], how can this be?)"
19304 d_syserrlst="$undef"
19306 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
19307 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
19308 d_strerror="$undef"
19309 d_syserrlst="$define"
19310 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
19312 echo 'strerror() and sys_errlist[] NOT found.' >&4
19313 d_strerror="$undef"
19314 d_syserrlst="$undef"
19315 d_strerrm='"unknown"'
19319 : see if strerror_l exists
19320 set strerror_l d_strerror_l
19323 : see if strerror_r exists
19324 set strerror_r d_strerror_r
19326 case "$d_strerror_r" in
19328 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
19329 case "$d_strerror_r_proto:$usethreads" in
19330 ":define") d_strerror_r_proto=define
19331 set d_strerror_r_proto strerror_r $hdrs
19335 case "$d_strerror_r_proto" in
19337 case "$strerror_r_proto" in
19338 ''|0) try='int strerror_r(int, char*, size_t);'
19339 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBW ;;
19341 case "$strerror_r_proto" in
19342 ''|0) try='int strerror_r(int, char*, int);'
19343 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBI ;;
19345 case "$strerror_r_proto" in
19346 ''|0) try='char* strerror_r(int, char*, size_t);'
19347 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=B_IBW ;;
19349 case "$strerror_r_proto" in
19350 ''|0) d_strerror_r=undef
19352 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
19353 * ) case "$strerror_r_proto" in
19354 REENTRANT_PROTO*) ;;
19355 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
19357 echo "Prototype: $try" ;;
19360 *) case "$usethreads" in
19361 define) echo "strerror_r has no prototype, not using it." >&4 ;;
19368 *) strerror_r_proto=0
19372 : see if strftime exists
19373 set strftime d_strftime
19376 : see if strlcat exists
19377 set strlcat d_strlcat
19380 : see if strlcpy exists
19381 set strlcpy d_strlcpy
19384 : see if strtod exists
19385 set strtod d_strtod
19388 : see if strtol exists
19389 set strtol d_strtol
19392 : see if strtold exists
19393 set strtold d_strtold
19396 : see if strtoll exists
19397 set strtoll d_strtoll
19400 case "$d_longlong-$d_strtoll" in
19403 Checking whether your strtoll() works okay...
19405 $cat >try.c <<'EOCP'
19408 #define strtoll __strtoll
19411 #define strtoll _strtoll
19414 extern long long int strtoll(char *s, char **, int);
19415 static int bad = 0;
19416 int check(char *s, long long ell, int een) {
19419 gll = strtoll(s, 0, 10);
19420 if (!((gll == ell) && (errno == een)))
19424 check(" 1", 1LL, 0);
19425 check(" 0", 0LL, 0);
19426 check("-1", -1LL, 0);
19427 check("-9223372036854775808", -9223372036854775808LL, 0);
19428 check("-9223372036854775808", -9223372036854775808LL, 0);
19429 check(" 9223372036854775807", 9223372036854775807LL, 0);
19430 check("-9223372036854775808", -9223372036854775808LL, 0);
19431 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
19432 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
19438 if eval $compile; then
19441 ok) echo "Your strtoll() seems to be working okay." ;;
19443 Your strtoll() doesn't seem to be working okay.
19449 echo "(I can't seem to compile the test program--assuming it doesn't)"
19455 : see if strtoq exists
19456 set strtoq d_strtoq
19459 : see if strtoul exists
19460 set strtoul d_strtoul
19463 case "$d_strtoul" in
19466 Checking whether your strtoul() works okay...
19468 $cat >try.c <<'EOCP'
19471 extern unsigned long int strtoul(char *s, char **, int);
19472 static int bad = 0;
19473 void check(char *s, unsigned long eul, int een) {
19476 gul = strtoul(s, 0, 10);
19477 if (!((gul == eul) && (errno == een)))
19481 check(" 1", 1L, 0);
19482 check(" 0", 0L, 0);
19484 case "$longsize" in
19486 $cat >>try.c <<'EOCP'
19487 check("18446744073709551615", 18446744073709551615UL, 0);
19488 check("18446744073709551616", 18446744073709551615UL, ERANGE);
19489 #if 0 /* strtoul() for /^-/ strings is undefined. */
19490 check("-1", 18446744073709551615UL, 0);
19491 check("-18446744073709551614", 2, 0);
19492 check("-18446744073709551615", 1, 0);
19493 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
19494 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
19499 $cat >>try.c <<'EOCP'
19500 check("4294967295", 4294967295UL, 0);
19501 check("4294967296", 4294967295UL, ERANGE);
19502 #if 0 /* strtoul() for /^-/ strings is undefined. */
19503 check("-1", 4294967295UL, 0);
19504 check("-4294967294", 2, 0);
19505 check("-4294967295", 1, 0);
19506 check("-4294967296", 4294967295UL, ERANGE);
19507 check("-4294967297", 4294967295UL, ERANGE);
19512 : Should we write these tests to be more portable by sprintf-ing
19513 : ~0 and then manipulating that char string as input for strtol?
19516 $cat >>try.c <<'EOCP'
19523 if eval $compile; then
19524 case "`$run ./try`" in
19525 ok) echo "Your strtoul() seems to be working okay." ;;
19527 Your strtoul() doesn't seem to be working okay.
19533 echo "(I can't seem to compile the test program--assuming it doesn't)"
19539 : see if strtoull exists
19540 set strtoull d_strtoull
19543 case "$d_longlong-$d_strtoull" in
19546 Checking whether your strtoull() works okay...
19548 $cat >try.c <<'EOCP'
19551 #define strtoull __strtoull
19554 extern unsigned long long int strtoull(char *s, char **, int);
19555 static int bad = 0;
19556 int check(char *s, long long eull, int een) {
19559 gull = strtoull(s, 0, 10);
19560 if (!((gull == eull) && (errno == een)))
19564 check(" 1", 1LL, 0);
19565 check(" 0", 0LL, 0);
19566 check("18446744073709551615", 18446744073709551615ULL, 0);
19567 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
19568 #if 0 /* strtoull() for /^-/ strings is undefined. */
19569 check("-1", 18446744073709551615ULL, 0);
19570 check("-18446744073709551614", 2LL, 0);
19571 check("-18446744073709551615", 1LL, 0);
19572 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
19573 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
19580 if eval $compile; then
19581 case "`$run ./try`" in
19582 ok) echo "Your strtoull() seems to be working okay." ;;
19584 Your strtoull() doesn't seem to be working okay.
19586 d_strtoull="$undef"
19590 echo "(I can't seem to compile the test program--assuming it doesn't)"
19591 d_strtoull="$undef"
19596 : see if strtouq exists
19597 set strtouq d_strtouq
19600 case "$d_strtouq" in
19603 Checking whether your strtouq() works okay...
19605 $cat >try.c <<'EOCP'
19608 extern unsigned long long int strtouq(char *s, char **, int);
19609 static int bad = 0;
19610 void check(char *s, unsigned long long eull, int een) {
19611 unsigned long long gull;
19613 gull = strtouq(s, 0, 10);
19614 if (!((gull == eull) && (errno == een)))
19618 check(" 1", 1LL, 0);
19619 check(" 0", 0LL, 0);
19620 check("18446744073709551615", 18446744073709551615ULL, 0);
19621 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
19622 #if 0 /* strtouq() for /^-/ strings is undefined. */
19623 check("-1", 18446744073709551615ULL, 0);
19624 check("-18446744073709551614", 2LL, 0);
19625 check("-18446744073709551615", 1LL, 0);
19626 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
19627 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
19635 if eval $compile; then
19636 case "`$run ./try`" in
19637 ok) echo "Your strtouq() seems to be working okay." ;;
19639 Your strtouq() doesn't seem to be working okay.
19645 echo "(I can't seem to compile the test program--assuming it doesn't)"
19651 : see if strxfrm exists
19652 set strxfrm d_strxfrm
19655 : see if symlink exists
19656 set symlink d_symlink
19659 : see if syscall exists
19660 set syscall d_syscall
19663 : see if prototype for syscall is available
19665 set d_syscallproto syscall $i_unistd unistd.h
19668 : see if sysconf exists
19669 set sysconf d_sysconf
19672 : see if system exists
19673 set system d_system
19676 : see if tcgetpgrp exists
19677 set tcgetpgrp d_tcgetpgrp
19680 : see if tcsetpgrp exists
19681 set tcsetpgrp d_tcsetpgrp
19684 : see if prototype for telldir is available
19686 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
19689 : see if tgamma exists
19690 set tgamma d_tgamma
19693 : see if time exists
19695 if test "X$d_time" = X -o X"$timetype" = X; then
19696 if set time val -f d_time; eval $csym; $val; then
19697 echo 'time() found.' >&4
19699 rp="What is the type returned by time() on this system?"
19700 set time_t timetype long stdio.h sys/types.h
19703 echo 'time() not found, hope that will do.' >&4
19711 : see if timegm exists
19712 set timegm d_timegm
19715 : see if this is a sys/times.h system
19716 set sys/times.h i_systimes
19719 : see if times exists
19721 if set times val -f d_times; eval $csym; $val; then
19722 echo 'times() found.' >&4
19725 case "$i_systimes" in
19726 "$define") inc='sys/times.h';;
19728 rp="What is the type returned by times() on this system?"
19729 set clock_t clocktype long stdio.h sys/types.h $inc
19732 echo 'times() NOT found, hope that will do.' >&4
19737 : see if tmpnam_r exists
19738 set tmpnam_r d_tmpnam_r
19740 case "$d_tmpnam_r" in
19742 hdrs="$i_systypes sys/types.h define stdio.h "
19743 case "$d_tmpnam_r_proto:$usethreads" in
19744 ":define") d_tmpnam_r_proto=define
19745 set d_tmpnam_r_proto tmpnam_r $hdrs
19749 case "$d_tmpnam_r_proto" in
19751 case "$tmpnam_r_proto" in
19752 ''|0) try='char* tmpnam_r(char*);'
19753 ./protochk "$extern_C $try" $hdrs && tmpnam_r_proto=B_B ;;
19755 case "$tmpnam_r_proto" in
19756 ''|0) d_tmpnam_r=undef
19758 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
19759 * ) case "$tmpnam_r_proto" in
19760 REENTRANT_PROTO*) ;;
19761 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
19763 echo "Prototype: $try" ;;
19766 *) case "$usethreads" in
19767 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
19774 *) tmpnam_r_proto=0
19778 : see if trunc exists
19782 : see if truncate exists
19783 set truncate d_truncate
19786 : see if ttyname_r exists
19787 set ttyname_r d_ttyname_r
19789 case "$d_ttyname_r" in
19791 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
19792 case "$d_ttyname_r_proto:$usethreads" in
19793 ":define") d_ttyname_r_proto=define
19794 set d_ttyname_r_proto ttyname_r $hdrs
19798 case "$d_ttyname_r_proto" in
19800 case "$ttyname_r_proto" in
19801 ''|0) try='int ttyname_r(int, char*, size_t);'
19802 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBW ;;
19804 case "$ttyname_r_proto" in
19805 ''|0) try='int ttyname_r(int, char*, int);'
19806 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBI ;;
19808 case "$ttyname_r_proto" in
19809 ''|0) try='char* ttyname_r(int, char*, int);'
19810 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=B_IBI ;;
19812 case "$ttyname_r_proto" in
19813 ''|0) d_ttyname_r=undef
19815 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
19816 * ) case "$ttyname_r_proto" in
19817 REENTRANT_PROTO*) ;;
19818 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
19820 echo "Prototype: $try" ;;
19823 *) case "$usethreads" in
19824 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
19831 *) ttyname_r_proto=0
19835 : see if tzname[] exists
19837 if set tzname val -a d_tzname; eval $csym; $val; then
19839 echo 'tzname[] found.' >&4
19842 echo 'tzname[] NOT found.' >&4
19847 : Check if is a multiplatform env
19849 darwin) multiarch="$define" ;;
19851 case "$multiarch" in
19852 ''|[nN]*) multiarch="$undef" ;;
19855 : check for ordering of bytes in a UV
19857 case "$multiarch" in
19860 You seem to be doing a multiarchitecture build,
19861 skipping the byteorder check.
19867 case "$byteorder" in
19870 In the following, larger digits indicate more significance. A big-endian
19871 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
19872 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
19873 machines may have weird orders like 3412. A Cray will report 87654321,
19874 an Alpha will report 12345678. If the test program works the default is
19876 I'm now running the test program...
19880 #$i_stdlib I_STDLIB
19882 #include <stdlib.h>
19884 #include <sys/types.h>
19885 typedef $uvtype UV;
19895 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
19897 u.l = (UV)0x04030201;
19898 for (i = 0; i < $uvsize; i++)
19899 printf("%c", u.c[i]+'0');
19906 if eval $compile && $run ./try > /dev/null; then
19909 [1-4][1-4][1-4][1-4]|12345678|87654321)
19910 echo "(The test program ran ok.)"
19911 echo "byteorder=$dflt"
19914 ????|????????) echo "(The test program ran ok.)" ;;
19915 *) echo "(The test program didn't run right for some reason.)" ;;
19920 (I can't seem to compile the test program. Guessing big-endian...)
19923 case "$xxx_prompt" in
19925 rp="What is the order of bytes in $uvtype?"
19938 : Checking 32bit alignedness
19941 Checking to see whether you can access character data unalignedly...
19943 case "$d_u32align" in
19944 '') $cat >try.c <<EOCP
19946 #$i_stdlib I_STDLIB
19948 #include <stdlib.h>
19950 #define U32 $u32type
19951 #define BYTEORDER 0x$byteorder
19953 #include <signal.h>
19955 $signal_t bletch(int s) { exit(4); }
19958 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
19959 volatile U8 buf[8];
19963 if (sizeof(U32) != 4) {
19964 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
19971 signal(SIGBUS, bletch);
19983 for (i = 0; i < 4; i++) {
19984 up = (U32*)(buf + i);
19985 if (! ((*up == 1 << (8*i)) || /* big-endian */
19986 (*up == 1 << (8*(3-i))) /* little-endian */
19990 printf("read failed (%x)\n", *up);
19996 for (i = 0; i < 4; i++) {
19997 up = (U32*)(buf + i);
19999 if (*up != 0xBeef) {
20000 printf("write failed (%x)\n", *up);
20014 if eval $compile_ok; then
20015 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
20016 $run ./try 2>&1 >/dev/null
20019 You can access character data pretty unalignedly.
20021 d_u32align="$undef"
20024 It seems that you must access character data in an aligned manner.
20026 d_u32align="$define"
20030 rp='Can you access character data at unaligned addresses?'
20034 [yY]*) d_u32align="$undef" ;;
20035 *) d_u32align="$define" ;;
20042 : see if ualarm exists
20043 set ualarm d_ualarm
20046 : see if umask exists
20050 : see if unordered exists
20051 set unordered d_unordered
20054 : see if unsetenv exists
20055 set unsetenv d_unsetenv
20058 : see if usleep exists
20059 set usleep d_usleep
20062 : see if prototype for usleep is available
20064 set d_usleepproto usleep $i_unistd unistd.h
20067 : see if ustat exists
20071 : see if closedir exists
20072 set closedir d_closedir
20075 case "$d_closedir" in
20078 echo "Checking whether closedir() returns a status..." >&4
20080 #$i_dirent I_DIRENT /**/
20081 #$i_sysdir I_SYS_DIR /**/
20082 #$i_sysndir I_SYS_NDIR /**/
20083 #$i_systypes I_SYS_TYPES /**/
20085 #if defined(I_SYS_TYPES)
20086 #include <sys/types.h>
20088 #if defined(I_DIRENT)
20089 #include <dirent.h>
20092 #include <sys/ndir.h>
20096 #include <ndir.h> /* may be wrong in the future */
20098 #include <sys/dir.h>
20103 int main() { return closedir(opendir(".")); }
20106 if eval $compile_ok; then
20107 if $run ./try > /dev/null 2>&1 ; then
20108 echo "Yes, it does."
20111 echo "No, it doesn't."
20115 echo "(I can't seem to compile the test program--assuming it doesn't)"
20123 set d_void_closedir
20127 : see if there is a wait4
20131 : see if waitpid exists
20132 set waitpid d_waitpid
20137 $cat >try.c <<'EOCP'
20143 return (wcscmp (s, s) ? 1 : 0);
20148 if eval $compile; then
20151 0) echo "A working wcscmp() found." >&4
20153 *) echo "wcscmp() found, but it doesn't work" >&4
20157 echo "wcscmp() NOT found." >&4
20163 : see if wcstombs exists
20164 set wcstombs d_wcstombs
20169 $cat >try.c <<'EOCP'
20174 wchar_t dst[4], *src = L" ";
20176 return (wcsxfrm (dst, src, 1) ? errno ? errno : 0 : 1);
20181 if eval $compile; then
20184 0) echo "A working wcsxfrm() found." >&4
20186 *) echo "wcsxfrm() found, but it doesn't work" >&4
20190 echo "wcsxfrm() NOT found." >&4
20196 : see if wctomb exists
20197 set wctomb d_wctomb
20200 : see if writev exists
20201 set writev d_writev
20204 : check for alignment requirements
20206 case "$alignbytes" in
20207 '') echo "Checking alignment constraints..." >&4
20216 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
20221 if eval $compile_ok; then
20225 echo "(I can't seem to compile the test program...)"
20227 case "$multiarch" in
20229 : The usual safe value is 8, but Darwin with -Duselongdouble
20230 : needs 16. Hence, we will take 8 as a minimum, but allow
20231 : Configure to pick a larger value if needed.
20232 if $test "$dflt" -lt 8; then
20234 echo "Setting alignment to 8 for multiarch support.">&4
20239 *) dflt="$alignbytes"
20242 rp="Doubles must be aligned on a how-many-byte boundary?"
20247 : set the base revision
20250 : length of character in bytes. Is always 1, otherwise it is not C
20251 : This used to be a test using sizeof
20254 : Check for the number of bits in a character
20255 case "$charbits" in
20256 '') echo "Checking how long a character is (in bits)..." >&4
20263 for (c = 1, n = 0; c; c <<= 1, n++) ;
20264 printf ("%d\n", n);
20269 if eval $compile_ok; then
20273 echo "(I can't seem to compile the test program. Guessing...)"
20280 rp="What is the length of a character (in bits)?"
20284 case "$charbits" in
20287 Your system has an unsigned character size of $charbits bits, which
20288 is rather unusual (normally it is 8 bits). Perl likely will not work
20289 correctly on your system, with subtle bugs in various places.
20291 rp='Do you really want to continue?'
20295 [yY]) echo >&4 "Okay, continuing." ;;
20300 : how do we concatenate cpp tokens here?
20302 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
20303 $cat >cpp_stuff.c <<'EOCP'
20304 #define RCAT(a,b)a/**/b
20305 #define ACAT(a,b)a ## b
20309 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
20310 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
20311 echo "Oh! Smells like ANSI's been here." >&4
20312 echo "We can catify or stringify, separately or together!"
20314 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
20315 echo "Ah, yes! The good old days!" >&4
20316 echo "However, in the good old days we don't know how to stringify and"
20317 echo "catify at the same time."
20321 Hmm, I don't seem to be able to concatenate tokens with your cpp.
20322 You're going to have to edit the values of CAT[2-5] in config.h...
20324 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
20328 : see if this is a db.h system
20334 : Check db version.
20336 echo "Checking Berkeley DB version ..." >&4
20342 #include <sys/types.h>
20344 #$i_stdlib I_STDLIB
20346 #include <stdlib.h>
20349 int main(int argc, char *argv[])
20351 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
20352 int Major, Minor, Patch ;
20353 unsigned long Version ;
20354 (void)db_version(&Major, &Minor, &Patch) ;
20356 printf("%d %d %d %d %d %d\n",
20357 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
20358 Major, Minor, Patch);
20361 printf("You have Berkeley DB Version 2 or greater.\n");
20363 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
20364 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
20365 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
20366 Major, Minor, Patch) ;
20368 /* check that db.h & libdb are compatible */
20369 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
20370 printf("db.h and libdb are incompatible.\n") ;
20374 printf("db.h and libdb are compatible.\n") ;
20376 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
20377 + DB_VERSION_PATCH ;
20379 /* needs to be >= 2.3.4 */
20380 if (Version < 2003004) {
20381 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
20382 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
20388 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
20393 printf("You have Berkeley DB Version 1.\n");
20394 exit(0); /* DB version < 2: the coast is clear. */
20396 exit(1); /* <db.h> not Berkeley DB? */
20402 if eval $compile_ok && $run ./try; then
20403 echo 'Looks OK.' >&4
20405 db_version_major=$1
20406 db_version_minor=$2
20407 db_version_patch=$3
20409 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
20413 : Remove db from list of libraries to use
20414 echo "Removing unusable -ldb from library list" >&4
20415 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
20418 echo "libs = $libs" >&4
20428 : Check the return type needed for hash
20430 echo "Checking return type needed for hash for Berkeley DB ..." >&4
20436 #include <sys/types.h>
20439 #ifndef DB_VERSION_MAJOR
20440 u_int32_t hash_cb (const void* ptr, size_t size)
20446 info.hash = hash_cb;
20450 if $cc $ccflags -c try.c >try.out 2>&1 ; then
20451 if $contains warning try.out >>/dev/null 2>&1 ; then
20454 db_hashtype='u_int32_t'
20457 : XXX Maybe we should just give up here.
20458 db_hashtype=u_int32_t
20460 echo "Help: I can't seem to compile the db test program." >&4
20461 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
20464 echo "Your version of Berkeley DB uses $db_hashtype for hash."
20466 *) db_hashtype=u_int32_t
20471 : Check the return type needed for prefix
20473 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
20479 #include <sys/types.h>
20482 #ifndef DB_VERSION_MAJOR
20483 size_t prefix_cb (const DBT *key1, const DBT *key2)
20489 info.prefix = prefix_cb;
20493 if $cc $ccflags -c try.c >try.out 2>&1 ; then
20494 if $contains warning try.out >>/dev/null 2>&1 ; then
20495 db_prefixtype='int'
20497 db_prefixtype='size_t'
20500 db_prefixtype='size_t'
20501 : XXX Maybe we should just give up here.
20503 echo "Help: I can't seem to compile the db test program." >&4
20504 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
20507 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
20509 *) db_prefixtype='size_t'
20513 : Check what kind of inf/nan your system has
20514 $echo "Checking the kind of infinities and nans you have..." >&4
20516 #define DOUBLESIZE $doublesize
20517 #$d_longdbl HAS_LONG_DOUBLE
20518 #ifdef HAS_LONG_DOUBLE
20519 #define LONGDBLSIZE $longdblsize
20520 #define LONGDBLKIND $longdblkind
20527 /* Note that whether the sign bit is on or off
20528 * for NaN depends on the CPU/FPU, and possibly
20529 * can be affected by the build toolchain.
20531 * For example for older MIPS and HP-PA 2.0 the quiet NaN is:
20532 * 0x7f, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
20533 * 0x7f, 0xf4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
20534 * (respectively) as opposed to the more usual
20535 * 0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
20537 static void bytes(unsigned char *p, unsigned int n) {
20539 for (i = 0; i < n; i++) {
20540 printf("0x%02x%s", p[i], i < n - 1 ? ", " : "\n");
20543 int main(int argc, char *argv[]) {
20544 /* We cannot use 1.0/0.0 and 0.0/0.0 (with L suffixes for long double)
20545 * because some compilers are 'smart' and not only warn but refuse to
20546 * compile such 'illegal' values. */
20547 double dinf = exp(1e9);
20548 double dnan = sqrt(-1.0);
20549 #ifdef HAS_LONG_DOUBLE
20550 long double ldinf = (long double)exp(1e9);
20551 long double ldnan = (long double)sqrt(-1.0);
20554 switch (argv[1][0]) {
20555 case '1': bytes(&dinf, sizeof(dinf)); break;
20556 case '2': bytes(&dnan, sizeof(dnan)); break;
20557 #ifdef HAS_LONG_DOUBLE
20558 # if LONG_DOUBLEKIND == 3 || LONG_DOUBLEKIND == 4
20559 /* the 80-bit long doubles might have garbage in their excess bytes */
20560 memset((char *)&ldinf + 10, '\0', LONG_DOUBLESIZE - 10);
20562 case '3': bytes(&ldinf, sizeof(ldinf)); break;
20563 case '4': bytes(&ldnan, sizeof(ldnan)); break;
20571 if eval $compile; then
20572 doubleinfbytes=`$run ./try 1`
20573 doublenanbytes=`$run ./try 2`
20574 case "$d_longdbl" in
20576 longdblinfbytes=`$run ./try 3`
20577 longdblnanbytes=`$run ./try 4`
20581 # Defaults in case the above test program failed.
20582 case "$doublekind" in
20583 1) # IEEE 754 32-bit LE
20584 doubleinfbytes='0x00, 0x00, 0xf0, 0x7f'
20585 doublenanbytes='0x00, 0x00, 0xf8, 0x7f'
20587 2) # IEEE 754 32-bit BE
20588 doubleinfbytes='0x7f, 0xf0, 0x00, 0x00'
20589 doublenanbytes='0x7f, 0xf8, 0x00, 0x00'
20591 3) # IEEE 754 64-bit LE
20592 doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
20593 doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
20595 4) # IEEE 754 64-bit BE
20596 doubleinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20597 doublenanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20599 5) # IEEE 754 128-bit LE
20600 doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
20601 doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
20603 6) # IEEE 754 128-bit BE
20604 doubleinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20605 doublenanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20607 7) # IEEE 754 64-bit mixed: 32-bit LEs in BE
20608 doubleinfbytes='0x00, 0x00, 0xf0, 0x7f, 0x00, 0x00, 0x00, 0x00'
20609 doublenanbytes='0x00, 0x00, 0xf8, 0x7f, 0x00, 0x00, 0x00, 0x00'
20611 8) # IEEE 754 64-bit mixed: 32-bit BEs in LE
20612 doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x7f, 0xf0, 0x00, 0x00'
20613 doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x7f, 0xf8, 0x00, 0x00'
20616 doubleinfbytes=$undef
20617 doublenanbytes=$undef
20620 case "$longdblkind" in
20621 1) # IEEE 754 128-bit LE
20622 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f'
20623 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f'
20625 2) # IEEE 754 128-bit BE
20626 longdblinfbytes='0x7f, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20627 longdblnanbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20629 3) # IEEE 754 80-bit LE, 12 or 16 bytes (x86)
20630 case "$longdblsize" in
20631 12) # x86 32-bit (96 bits, or 4 x 32, or 12 x 8)
20632 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00'
20633 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x7f, 0x00, 0x00'
20636 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20637 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20640 longdblinfbytes=$undef
20641 longdblnanbytes=$undef
20645 4) # IEEE 754 80-bit BE, 12 or 16 bytes
20646 case "$longdblsize" in
20647 12) # 32-bit system
20648 longdblinfbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20649 longdblnanbytes='0x7f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20651 16) # 64-bit system
20652 longdblinfbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20653 longdblnanbytes='0x7f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20656 longdblinfbytes=$undef
20657 longdblnanbytes=$undef
20661 5) # 128-bit LE-LE "double double"
20662 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
20663 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
20665 6) # 128-bit BE-BE "double double"
20666 longdblinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20667 longdblnanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20669 7) # 128-bit LE-BE "double double"
20670 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20671 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20673 8) # 128-bit BE-LE "double double"
20674 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20675 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20678 longdblinfbytes=$undef
20679 longdblnanbytes=$undef
20685 : Check the length of the double mantissa
20686 $echo "Checking how many mantissa bits your doubles have..." >&4
20689 #$i_sunmath I_SUNMATH
20691 # include <float.h>
20694 # include <sunmath.h>
20696 #ifdef DBL_MANT_DIG
20697 # define BITS (DBL_MANT_DIG - 1) /* the implicit bit does not count */
20700 int main(int argc, char *argv[]) {
20702 printf("%d\n", BITS);
20708 if eval $compile; then
20709 doublemantbits=`$run ./try`
20711 doublemantbits="$undef"
20715 : Check the length of the longdouble mantissa
20716 $echo "Checking how many mantissa bits your long doubles have..." >&4
20719 #$i_sunmath I_SUNMATH
20721 # include <float.h>
20724 # include <sunmath.h>
20726 #$d_longdbl HAS_LONG_DOUBLE
20727 #if defined(HAS_LONG_DOUBLE) && defined(LDBL_MANT_DIG)
20728 # if ($longdblkind == 3) || ($longdblkind == 4) /* 80-bit extended precision */
20729 /* This format has no implicit bit. Beware, however, that for
20730 * this format the bare LDBL_MANT_DIG is misleading for inf/nan:
20731 * the top three bits are used for inf (100) / qnan (11x) / snan (101),
20732 * and the top bit must have been one since 387, zero is plain invalid.
20733 * For normal fp values, the LDBL_MANT_DIG is fine, though. */
20734 # define BITS LDBL_MANT_DIG
20735 # elif ($longdblkind == 5 || $longdblkind == 6 || $longdblkind == 7 || $longdblkind == 8) /* double double */
20736 /* LDBL_MANT_DIG of 106 (twice 53) would be logical, but for some
20737 * reason e.g. Irix thinks 107. But in any case, we want only
20738 * the number of real bits, the implicit bits are of no interest. */
20739 # define BITS 2 * (DBL_MANT_DIG - 1)
20741 # define BITS (LDBL_MANT_DIG - 1) /* the implicit bit does not count */
20745 int main(int argc, char *argv[]) {
20747 printf("%d\n", BITS);
20753 if eval $compile; then
20754 longdblmantbits=`$run ./try`
20756 longdblmantbits="$undef"
20760 : Check the length of the NV mantissa
20761 $echo "Checking how many mantissa bits your NVs have..." >&4
20762 if test "X$usequadmath" = "X$define"; then
20763 nvmantbits=112 # 128-1-15
20765 if test "X$nvsize" = "X$doublesize"; then
20766 nvmantbits="$doublemantbits"
20768 if test "X$nvsize" = "X$longdblsize"; then
20769 nvmantbits="$longdblmantbits"
20771 nvmantbits="$undef"
20776 : How can we generate normalized random numbers ?
20778 echo "Using our internal random number implementation..." >&4
20781 *-Dmy_rand=*|*-Dmy_srand=*)
20782 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
20783 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
20784 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
20785 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
20789 randfunc=Perl_drand48
20790 drand01="Perl_drand48()"
20791 seedfunc="Perl_drand48_init"
20795 : Probe whether dtrace builds an object, as newer Illumos requires an input
20796 : object file that uses at least one of the probes defined in the .d file
20797 case "$usedtrace" in
20799 case "$dtraceobject" in
20800 $define|true|[yY]*)
20801 dtraceobject=$define
20804 $dtrace -h -s ../perldtrace.d -o perldtrace.h
20806 #include "perldtrace.h"
20808 PERL_LOADED_FILE("dummy");
20812 dtraceobject=$undef
20813 if $cc -c -o try.o $optimize $ccflags try.c \
20814 && $dtrace -G -s ../perldtrace.d try.o >/dev/null 2>&1; then
20815 dtraceobject=$define
20816 echo "Your dtrace builds an object file"
20818 $rm -f try.c try.o perldtrace.o
20820 *) dtraceobject=$undef ;;
20824 : Determine if this is an EBCDIC system
20826 echo "Determining whether or not we are on an EBCDIC system..." >&4
20827 $cat >try.c <<'EOM'
20830 if ('M'==0xd4) return 0;
20837 if eval $compile_ok; then
20838 if $run ./try; then
20839 echo "You seem to speak EBCDIC." >&4
20842 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
20845 echo "I'm unable to compile the test program." >&4
20846 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
20852 : Check how to flush
20855 Checking how to flush all pending stdio output...
20857 # I only know how to find the first 32 possibly open files on SunOS.
20858 # See also hints/sunos_4_1.sh and util.c --AD
20860 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
20862 $cat >>try.c <<EOCP
20864 #$i_stdlib I_STDLIB
20866 #include <stdlib.h>
20868 #$i_unistd I_UNISTD
20870 # include <unistd.h>
20872 #$d_sysconf HAS_SYSCONF
20873 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
20874 #ifdef HAS_STDIO_STREAM_ARRAY
20875 # define STDIO_STREAM_ARRAY $stdio_stream_array
20880 p = fopen("try.out", "w");
20884 # ifdef TRY_FPRINTF
20888 #ifdef TRY_FFLUSH_NULL
20891 #ifdef TRY_FFLUSH_ALL
20893 long open_max = -1;
20894 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
20895 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
20897 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
20898 open_max = sysconf(_SC_OPEN_MAX);
20901 open_max = FOPEN_MAX;
20904 open_max = OPEN_MAX;
20913 # ifdef HAS_STDIO_STREAM_ARRAY
20914 if (open_max > 0) {
20916 for (i = 0; i < open_max; i++)
20917 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
20918 STDIO_STREAM_ARRAY[i]._file < open_max &&
20919 STDIO_STREAM_ARRAY[i]._flag)
20920 fflush(&STDIO_STREAM_ARRAY[i]);
20928 : first we have to find out how _not_ to flush
20930 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
20932 set try -DTRY_FPUTC
20933 if eval $compile; then
20934 $run ./try 2>/dev/null
20937 if $test ! -s try.out -a "X$code" = X42; then
20943 set try -DTRY_FPRINTF
20944 if eval $compile; then
20945 $run ./try 2>/dev/null
20948 if $test ! -s try.out -a "X$code" = X42; then
20949 output=-DTRY_FPRINTF
20955 : check for fflush NULL behavior
20956 case "$fflushNULL" in
20957 '') set try -DTRY_FFLUSH_NULL $output
20958 if eval $compile; then
20959 $run ./try 2>/dev/null
20962 if $test -s try.out -a "X$code" = X42; then
20963 fflushNULL="`$cat try.out`"
20965 if $test "X$code" != X42; then
20967 (If this test failed, don't worry, we'll try another method shortly.)
20972 $rm -f core try.core core.try.*
20973 case "$fflushNULL" in
20975 Your fflush(NULL) works okay for output streams.
20976 Let's see if it clobbers input pipes...
20978 # As of mid-March 2000 all versions of Solaris appear to have a stdio
20979 # bug that improperly flushes the input end of pipes. So we avoid the
20980 # autoflush on fork/system/exec support for now. :-(
20981 $cat >tryp.c <<EOCP
20984 main(int argc, char **argv)
20990 while ((i = getc(stdin)) != -1
20991 && (*bp++ = i) != '\n'
20992 && bp < &buf[1024])
20995 fprintf(stdout, "%s", buf);
21003 fflushNULL="$define"
21005 if eval $compile; then
21007 # Copy the .c file to the remote host ($to is an ssh-alike if targethost is set)
21008 if $test "X$targethost" != X; then
21011 $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
21013 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
21015 if cmp tryp.c tryp.out >/dev/null 2>&1; then
21017 fflush(NULL) seems to behave okay with input streams.
21019 fflushNULL="$define"
21022 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
21024 fflushNULL="$undef"
21027 $rm -f core tryp.c tryp.core core.tryp.*
21030 Your fflush(NULL) isn't working (contrary to ANSI C).
21032 fflushNULL="$undef"
21035 Cannot figure out whether your fflush(NULL) works or not.
21036 I'm assuming it doesn't (contrary to ANSI C).
21038 fflushNULL="$undef"
21042 $define|true|[yY]*)
21043 fflushNULL="$define"
21046 fflushNULL="$undef"
21049 : check explicit looping only if NULL did not work, and if the pipe
21050 : bug does not show up on an explicit flush too
21051 case "$fflushNULL" in
21053 $cat >tryp.c <<EOCP
21056 main(int argc, char **argv)
21062 while ((i = getc(stdin)) != -1
21063 && (*bp++ = i) != '\n'
21064 && bp < &buf[1024])
21067 fprintf(stdout, "%s", buf);
21076 if eval $compile; then
21078 if $test "X$targethost" != X; then
21081 $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
21083 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
21085 if cmp tryp.c tryp.out >/dev/null 2>&1; then
21087 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
21089 : now check for fflushall behaviour
21090 case "$fflushall" in
21091 '') set try -DTRY_FFLUSH_ALL $output
21092 if eval $compile; then
21094 (Now testing the other method--but note that this also may fail.)
21096 $run ./try 2>/dev/null
21099 if $test -s try.out -a "X$code" = X42; then
21100 fflushall="`$cat try.out`"
21104 case "$fflushall" in
21106 Whew. Flushing explicitly all the stdio streams works.
21108 fflushall="$define"
21111 Sigh. Flushing explicitly all the stdio streams doesn't work.
21116 Cannot figure out whether flushing stdio streams explicitly works or not.
21117 I'm assuming it doesn't.
21123 "$define"|true|[yY]*)
21124 fflushall="$define"
21132 All is futile. Even fflush(stdin) clobbers input pipes!
21139 $rm -f core tryp.c tryp.core core.tryp.*
21141 *) fflushall="$undef"
21145 case "$fflushNULL$fflushall" in
21148 OK, I give up. I cannot figure out how to flush pending stdio output.
21149 We won't be flushing handles at all before fork/exec/popen.
21155 : Store the full pathname to the ar program for use in the C program
21156 : Respect a hint or command line value for full_ar.
21161 : Store the full pathname to the sed program for use in the C program
21164 : see what type gids are declared as in the kernel
21166 echo "Looking for the type for group ids returned by getgid()."
21167 set gid_t gidtype xxx stdio.h sys/types.h
21171 xxx=`./findhdr sys/user.h`
21172 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
21174 unsigned) dflt="$1 $2" ;;
21178 *) dflt="$gidtype";;
21181 gid_t) echo "gid_t found." ;;
21182 *) rp="What is the type for group ids returned by getgid()?"
21188 : Check the size of GID
21191 *_t) zzz="$gidtype" ;;
21194 echo "Checking the size of $zzz..." >&4
21196 #include <sys/types.h>
21198 #$i_stdlib I_STDLIB
21200 #include <stdlib.h>
21203 printf("%d\n", (int)sizeof($gidtype));
21208 if eval $compile_ok; then
21212 echo "(I can't execute the test program--guessing $gidsize.)" >&4
21215 echo "Your $zzz is $gidsize bytes long."
21220 echo "(I can't compile the test program--guessing $gidsize.)" >&4
21224 : Check if GID is signed
21227 *_t) zzz="$gidtype" ;;
21230 echo "Checking the sign of $zzz..." >&4
21232 #include <sys/types.h>
21243 if eval $compile; then
21247 echo "(I can't execute the test program--guessing unsigned.)" >&4
21251 1) echo "Your $zzz is unsigned." ;;
21252 -1) echo "Your $zzz is signed." ;;
21258 echo "(I can't compile the test program--guessing unsigned.)" >&4
21262 : Check 64bit sizes
21265 if $test X"$quadtype" != X; then
21267 echo "Checking how to print 64-bit integers..." >&4
21269 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
21270 $cat >try.c <<'EOCP'
21271 #include <sys/types.h>
21274 int q = 12345678901;
21275 printf("%ld\n", q);
21279 if eval $compile; then
21283 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
21284 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
21285 echo "We will use %d."
21291 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
21292 $cat >try.c <<'EOCP'
21293 #include <sys/types.h>
21296 long q = 12345678901;
21297 printf("%ld\n", q);
21301 if eval $compile; then
21305 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
21306 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
21307 echo "We will use %ld."
21313 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
21314 $cat >try.c <<'EOCP'
21315 #include <sys/types.h>
21316 #include <inttypes.h>
21319 int64_t q = 12345678901;
21320 printf("%" PRId64 "\n", q);
21324 if eval $compile; then
21328 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
21329 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
21330 echo "We will use the C9X style."
21336 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
21338 #include <sys/types.h>
21341 $quadtype q = 12345678901;
21342 printf("%Ld\n", q);
21346 if eval $compile; then
21350 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
21351 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
21352 echo "We will use %Ld."
21358 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
21359 $cat >try.c <<'EOCP'
21360 #include <sys/types.h>
21363 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
21364 printf("%lld\n", q);
21368 if eval $compile; then
21372 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
21373 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
21374 echo "We will use the %lld style."
21380 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
21382 #include <sys/types.h>
21385 $quadtype q = 12345678901;
21386 printf("%qd\n", q);
21390 if eval $compile; then
21394 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
21395 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
21396 echo "We will use %qd."
21402 if $test X"$sPRId64" = X; then
21403 echo "Cannot figure out how to print 64-bit integers." >&4
21410 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
21411 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
21413 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
21414 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
21418 : Check format strings for internal types
21420 $echo "Checking the format strings to be used for Perl's internal types..." >&4
21422 if $test X"$ivsize" = X8; then
21423 ivdformat="$sPRId64"
21424 uvuformat="$sPRIu64"
21425 uvoformat="$sPRIo64"
21426 uvxformat="$sPRIx64"
21427 uvXUformat="$sPRIXU64"
21429 if $test X"$ivsize" = X"$longsize"; then
21436 if $test X"$ivsize" = X"$intsize"; then
21444 if $test X"$ivsize" = X"$shortsize"; then
21455 if $test X"$usequadmath" = X"$define"; then
21463 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
21464 nveformat="$sPRIeldbl"
21465 nvfformat="$sPRIfldbl"
21466 nvgformat="$sPRIgldbl"
21467 nvEUformat="$sPRIEUldbl"
21468 nvFUformat="$sPRIFUldbl"
21469 nvGUformat="$sPRIGUldbl"
21480 case "$ivdformat" in
21481 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
21486 : Check format string for GID
21489 $echo "Checking the format string to be used for gids..." >&4
21492 -1) if $test X"$gidsize" = X"$ivsize"; then
21493 gidformat="$ivdformat"
21495 if $test X"$gidsize" = X"$longsize"; then
21498 if $test X"$gidsize" = X"$intsize"; then
21501 if $test X"$gidsize" = X"$shortsize"; then
21508 *) if $test X"$gidsize" = X"$uvsize"; then
21509 gidformat="$uvuformat"
21511 if $test X"$gidsize" = X"$longsize"; then
21514 if $test X"$gidsize" = X"$intsize"; then
21517 if $test X"$gidsize" = X"$shortsize"; then
21526 : see if getgroups exists
21527 set getgroups d_getgrps
21530 : see if setgroups exists
21531 set setgroups d_setgrps
21534 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
21536 case "$d_getgrps$d_setgrps" in
21538 case "$groupstype" in
21539 '') dflt="$gidtype" ;;
21540 *) dflt="$groupstype" ;;
21543 What type of pointer is the second argument to getgroups() and setgroups()?
21544 Usually this is the same as group ids, $gidtype, but not always.
21547 rp='What type pointer is the second argument to getgroups() and setgroups()?'
21551 *) groupstype="$gidtype";;
21554 : check whether make sets MAKE
21556 echo "Checking if your $make program sets \$(MAKE)..." >&4
21557 case "$make_set_make" in
21559 $sed 's/^X //' > testmake.mak << 'EOF'
21561 X @echo 'maketemp="$(MAKE)"'
21563 case "`$make -f testmake.mak 2>/dev/null`" in
21564 *maketemp=*) make_set_make='#' ;;
21565 *) make_set_make="MAKE=$make" ;;
21567 $rm -f testmake.mak
21570 case "$make_set_make" in
21571 '#') echo "Yup, it does.";;
21572 *) echo "Nope, it doesn't.";;
21575 : see what type is used for mode_t
21576 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
21577 set mode_t modetype int stdio.h sys/types.h
21580 : see if we need va_copy
21582 case "$i_stdarg" in
21585 #include <stdarg.h>
21587 #$i_stdlib I_STDLIB
21589 #include <stdlib.h>
21591 #include <signal.h>
21594 ivfprintf(FILE *f, const char *fmt, va_list *valp)
21596 return vfprintf(f, fmt, *valp);
21600 myvfprintf(FILE *f, const char *fmt, va_list val)
21602 return ivfprintf(f, fmt, &val);
21606 myprintf(char *fmt, ...)
21609 va_start(val, fmt);
21610 return myvfprintf(stdout, fmt, val);
21614 main(int ac, char **av)
21616 signal(SIGSEGV, exit);
21618 myprintf("%s%cs all right, then\n", "that", '\'');
21623 if eval $compile && $run ./try 2>&1 >/dev/null; then
21624 case "`$run ./try`" in
21625 "that's all right, then")
21631 yes) echo "It seems that you don't need va_copy()." >&4
21632 need_va_copy="$undef"
21634 *) echo "It seems that va_copy() or similar will be needed." >&4
21635 need_va_copy="$define"
21640 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
21641 need_va_copy="$undef"
21645 : see what type is used for size_t
21646 rp="What is the type used for the length parameter for string functions?"
21647 set size_t sizetype 'unsigned int' stdio.h sys/types.h
21650 : check for type of arguments to gethostbyaddr.
21651 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
21652 case "$d_gethbyaddr" in
21656 Checking to see what type of arguments are accepted by gethostbyaddr().
21658 hdrs="$define sys/types.h
21659 $d_socket sys/socket.h
21660 $i_niin netinet/in.h
21662 $i_unistd unistd.h"
21663 : The first arg can 'char *' or 'void *'
21664 : The second arg is some of integral type
21665 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
21666 for yyy in size_t long int; do
21667 case "$netdb_host_type" in
21668 '') try="$extern_C struct hostent *gethostbyaddr($xxx, $yyy, int);"
21669 if ./protochk "$try" $hdrs; then
21670 echo "Your system accepts $xxx for the first arg."
21671 echo "...and $yyy for the second arg."
21672 netdb_host_type="$xxx"
21673 netdb_hlen_type="$yyy"
21679 : In case none of those worked, prompt the user.
21680 case "$netdb_host_type" in
21681 '') rp='What is the type for the 1st argument to gethostbyaddr?'
21684 netdb_host_type=$ans
21685 rp='What is the type for the 2nd argument to gethostbyaddr?'
21688 netdb_hlen_type=$ans
21692 *) : no gethostbyaddr, so pick harmless defaults
21693 netdb_host_type='char *'
21694 netdb_hlen_type="$sizetype"
21697 # Remove the "const" if needed. -- but then we'll have a
21699 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
21702 : check for type of argument to gethostbyname.
21703 if test "X$netdb_name_type" = X ; then
21704 case "$d_gethbyname" in
21708 Checking to see what type of argument is accepted by gethostbyname().
21710 hdrs="$define sys/types.h
21711 $d_socket sys/socket.h
21712 $i_niin netinet/in.h
21714 $i_unistd unistd.h"
21715 for xxx in "const char *" "char *"; do
21716 case "$netdb_name_type" in
21717 '') try="$extern_C struct hostent *gethostbyname($xxx);"
21718 if ./protochk "$try" $hdrs; then
21719 echo "Your system accepts $xxx."
21720 netdb_name_type="$xxx"
21725 : In case none of those worked, prompt the user.
21726 case "$netdb_name_type" in
21727 '') rp='What is the type for the 1st argument to gethostbyname?'
21730 netdb_name_type=$ans
21734 *) : no gethostbyname, so pick harmless default
21735 netdb_name_type='char *'
21740 : check for type of 1st argument to getnetbyaddr.
21741 if test "X$netdb_net_type" = X ; then
21742 case "$d_getnbyaddr" in
21746 Checking to see what type of 1st argument is accepted by getnetbyaddr().
21748 hdrs="$define sys/types.h
21749 $d_socket sys/socket.h
21750 $i_niin netinet/in.h
21752 $i_unistd unistd.h"
21753 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
21754 case "$netdb_net_type" in
21755 '') try="$extern_C struct netent *getnetbyaddr($xxx, int);"
21756 if ./protochk "$try" $hdrs; then
21757 echo "Your system accepts $xxx."
21758 netdb_net_type="$xxx"
21763 : In case none of those worked, prompt the user.
21764 case "$netdb_net_type" in
21765 '') rp='What is the type for the 1st argument to getnetbyaddr?'
21768 netdb_net_type=$ans
21772 *) : no getnetbyaddr, so pick harmless default
21773 netdb_net_type='long'
21777 : locate the preferred pager for this system
21784 [a-zA-Z]:/*) dflt=$pg;;
21788 [a-zA-Z]:/*) dflt=$more;;
21792 [a-zA-Z]:/*) dflt=$less;;
21795 '') dflt=/usr/ucb/more;;
21803 rp='What pager is used on your system?'
21807 : see if ar generates random libraries by itself
21809 echo "Checking how to generate random libraries on your machine..." >&4
21810 echo 'int bar1() { return bar2(); }' > bar1.c
21811 echo 'int bar2() { return 2; }' > bar2.c
21813 #$i_stdlib I_STDLIB
21815 #include <stdlib.h>
21817 int main() { printf("%d\n", bar1()); exit(0); }
21819 $cc $ccflags -c bar1.c >/dev/null 2>&1
21820 $cc $ccflags -c bar2.c >/dev/null 2>&1
21821 $cc $ccflags -c foo.c >/dev/null 2>&1
21822 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
21823 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
21824 $run ./foobar >/dev/null 2>&1; then
21825 echo "$ar appears to generate random libraries itself."
21827 if [ "X$ranlib" = "X" ]; then
21830 elif $ar s bar$_a >/dev/null 2>&1 &&
21831 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
21832 $run ./foobar >/dev/null 2>&1; then
21833 echo "a table of contents needs to be added with '$ar s'."
21836 elif $ar ts bar$_a >/dev/null 2>&1 &&
21837 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
21838 $run ./foobar >/dev/null 2>&1; then
21839 echo "a table of contents needs to be added with '$ar ts'."
21846 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
21847 $test -f $ranlib || ranlib=''
21850 if $test -n "$ranlib"; then
21851 echo "your system has '$ranlib'; we'll use that."
21854 echo "your system doesn't seem to support random libraries"
21855 echo "so we'll use lorder and tsort to order the libraries."
21862 : see if this is a values.h system
21863 set values.h i_values
21866 : Check the max offset that gmtime and localtime accept
21867 echo "Checking max offsets that gmtime () accepts"
21870 define) yyy="#include <values.h>" ;;
21874 case "$sGMTIME_min/$sGMTIME_max" in
21877 #include <sys/types.h>
21886 void gm_check (time_t t, int min_year, int max_year)
21889 if ( tmp == NULL ||
21890 /* Check tm_year overflow */
21891 tmp->tm_year < min_year || tmp->tm_year > max_year)
21902 gm_check (MAXLONG, 69, 0x7fffffff);
21904 if (tmp == NULL || tmp->tm_year < 0) {
21905 for (i = 63; i >= 0; i--) {
21906 time_t x = pt | ((time_t)1 << i);
21907 if (x < 0 || x < pt) continue;
21908 gm_check (x, 69, 0x7fffffff);
21911 printf ("sGMTIME_max=%ld\n", pt);
21920 gm_check (MINLONG, -1900, 70);
21923 for (i = 36; i >= 0; i--) {
21924 time_t x = pt - ((time_t)1 << i);
21925 if (x > 0) continue;
21926 gm_check (x, -1900, 70);
21929 printf ("sGMTIME_min=%ld\n", pt);
21933 int main (int argc, char *argv[])
21935 /* fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t)); */
21942 if eval $compile; then
21943 eval `$run ./try 2>/dev/null`
21945 echo "Cannot determine sGMTIME_max and sGMTIME_min." >&4
21951 echo "Checking max offsets that localtime () accepts"
21953 case "$sLOCALTIME_min/$sLOCALTIME_max" in
21956 #include <sys/types.h>
21965 void local_check (time_t t, int min_year, int max_year)
21967 if (sizeof (time_t) > 4 && t > 0x7ffffffffffff000LL)
21970 tmp = localtime (&t);
21971 if ( tmp == NULL ||
21972 /* Check tm_year overflow */
21973 tmp->tm_year < min_year || tmp->tm_year > max_year)
21977 } /* local_check */
21984 local_check (MAXLONG, 69, 0x7fffffff);
21986 if (tmp == NULL || tmp->tm_year < 0) {
21987 for (i = 63; i >= 0; i--) {
21988 time_t x = pt | ((time_t)1 << i);
21989 if (x < 0 || x < pt) continue;
21990 local_check (x, 69, 0x7fffffff);
21993 printf ("sLOCALTIME_max=%ld\n", pt);
22002 local_check (MINLONG, -1900, 70);
22005 for (i = 36; i >= 0; i--) {
22006 time_t x = pt - ((time_t)1 << i);
22007 if (x > 0) continue;
22008 local_check (x, -1900, 70);
22011 printf ("sLOCALTIME_min=%ld\n", pt);
22015 int main (int argc, char *argv[])
22023 if eval $compile; then
22024 eval `$run ./try 2>/dev/null`
22026 echo "Cannot determine sLOCALTIME_max and sLOCALTIME_min." >&4
22032 : check for type of arguments to select.
22033 case "$selecttype" in
22034 '') case "$d_select" in
22038 Checking to see what type of arguments are accepted by select().
22040 hdrs="$define sys/types.h
22041 $i_systime sys/time.h
22042 $i_sysselct sys/select.h
22043 $d_socket sys/socket.h"
22044 : The first arg can be int, unsigned, or size_t
22045 : The last arg may or may not be 'const'
22047 : void pointer has been seen but using that
22048 : breaks the selectminbits test
22049 for xxx in 'fd_set *' 'int *'; do
22050 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
22051 for tmo in 'struct timeval *' 'const struct timeval *'; do
22053 '') try="$extern_C select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
22054 if ./protochk "$try" $hdrs; then
22055 echo "Your system accepts $xxx."
22064 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
22065 case "$d_fd_set" in
22066 $define) dflt="fd_set *" ;;
22075 *) : no select, so pick a harmless default
22082 : check for the select 'width'
22083 case "$selectminbits" in
22084 '') safebits=`expr $ptrsize \* 8`
22085 case "$d_select" in
22089 Checking to see on how many bits at a time your select() operates...
22092 #include <sys/types.h>
22094 #$i_systime I_SYS_TIME
22095 #$i_systimek I_SYS_TIME_KERNEL
22100 # ifdef I_SYS_TIME_KERNEL
22103 # include <sys/time.h>
22104 # ifdef I_SYS_TIME_KERNEL
22108 #$i_sysselct I_SYS_SELECT
22109 #ifdef I_SYS_SELECT
22110 #include <sys/select.h>
22112 #$d_socket HAS_SOCKET
22114 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
22117 #$i_stdlib I_STDLIB
22119 #include <stdlib.h>
22122 #define S sizeof(*(b))
22124 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
22125 #define NBITS (NBYTES * 8)
22127 char *s = (char *)malloc(NBYTES);
22136 fp = fopen("try.c", "r");
22142 b = ($selecttype)s;
22143 for (i = 0; i < NBITS; i++)
22147 select(fd + 1, b, 0, 0, &t);
22148 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
22150 printf("%d\n", i + 1);
22155 if eval $compile_ok; then
22156 selectminbits=`$run ./try 2>/dev/null`
22157 case "$selectminbits" in
22159 Cannot figure out on how many bits at a time your select() operates.
22160 I'll play safe and guess it is $safebits bits.
22162 selectminbits=$safebits
22163 bits="$safebits bits"
22166 *) bits="$selectminbits bits" ;;
22168 echo "Your select() operates on $bits at a time." >&4
22170 rp='What is the minimum number of bits your select() operates on?'
22171 case "$byteorder" in
22172 12345678) dflt=64 ;;
22178 selectminbits="$val"
22182 *) : no select, so pick a harmless default
22183 selectminbits=$safebits
22189 : Trace out the files included by signal.h, then look for SIGxxx names.
22190 case "$sig_num_init" in
22192 if [ "X$fieldn" = X ]; then
22193 : Just make some guesses. We check them later.
22194 xxx="$sysroot/usr/include/signal.h $sysroot/usr/include/sys/signal.h"
22196 xxx=`echo '#include <signal.h>' |
22197 $cppstdin $cppminus $cppflags 2>/dev/null |
22198 $grep '^[ ]*#.*include' |
22199 $awk "{print \\$$fieldn}" | $sed 's!"!!g' |\
22200 $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
22203 for xx in $xxx /dev/null ; do
22204 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
22206 case "$xxxfiles" in
22207 '') xxxfiles=`./findhdr signal.h` ;;
22210 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
22211 print substr($2, 4, 20)
22213 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
22214 print substr($3, 4, 20)
22216 : Append some common names just in case the awk scan failed.
22217 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
22218 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
22219 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
22220 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
22221 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
22223 : generate a few handy files for later
22224 $cat > signal.c <<EOCP
22225 #include <sys/types.h>
22226 #include <signal.h>
22227 #$i_stdlib I_STDLIB
22229 #include <stdlib.h>
22234 /* Strange style to avoid deeply-nested #if/#else/#endif */
22237 # define NSIG (_NSIG)
22243 # define NSIG (SIGMAX+1)
22249 # define NSIG (SIG_MAX+1)
22255 # define NSIG (_SIG_MAX+1)
22261 # define NSIG (MAXSIG+1)
22267 # define NSIG (MAX_SIG+1)
22272 # ifdef SIGARRAYSIZE
22273 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
22279 # define NSIG (_sys_nsig) /* Solaris 2.5 */
22283 /* Default to some arbitrary number that's big enough to get most
22284 of the common signals.
22290 printf("NSIG %d\n", NSIG);
22296 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
22298 printf "#ifdef SIG"; printf $1; printf "\n"
22299 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
22300 printf $1; printf ");\n"
22304 printf "#endif /* JUST_NSIG */\n";
22305 printf "exit(0);\n}\n";
22308 $cat >signal.awk <<'EOP'
22309 BEGIN { ndups = 0 }
22310 $1 ~ /^NSIG$/ { nsig = $2 }
22311 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
22312 if ($2 > maxsig) { maxsig = $2 }
22313 if (sig_name[$2]) {
22314 dup_name[ndups] = $1
22315 dup_num[ndups] = $2
22327 printf("NSIG %d\n", nsig);
22328 for (n = 1; n < nsig; n++) {
22330 printf("%s %d\n", sig_name[n], sig_num[n])
22333 printf("NUM%d %d\n", n, n)
22336 for (n = 0; n < ndups; n++) {
22337 printf("%s %d\n", dup_name[n], dup_num[n])
22341 $cat >signal_cmd <<EOS
22343 if $test -s signal.lst; then
22344 echo "Using your existing signal.lst file"
22349 $cat >>signal_cmd <<'EOS'
22352 if eval $compile_ok; then
22353 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) |\
22354 $uniq | $awk -f signal.awk >signal.lst
22356 echo "(I can't seem be able to compile the whole test program)" >&4
22357 echo "(I'll try it in little pieces.)" >&4
22358 set signal -DJUST_NSIG
22359 if eval $compile_ok; then
22360 $run ./signal$_exe > signal.nsg
22363 echo "I can't seem to figure out how many signals you have." >&4
22364 echo "Guessing 50." >&4
22365 echo 'NSIG 50' > signal.nsg
22367 : Now look at all the signal names, one at a time.
22368 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
22369 $cat > signal.c <<EOCP
22370 #include <sys/types.h>
22371 #include <signal.h>
22374 printf("$xx %d\n", SIG${xx});
22379 if eval $compile; then
22380 echo "SIG${xx} found."
22381 $run ./signal$_exe >> signal.ls1
22383 echo "SIG${xx} NOT found."
22386 if $test -s signal.ls1; then
22387 $cat signal.nsg signal.ls1 |
22388 $sort -n | $uniq | $awk -f signal.awk >signal.lst
22392 if $test -s signal.lst; then
22395 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
22396 echo 'kill -l' >signal
22397 set X `csh -f <signal`
22401 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
22403 echo $@ | $tr ' ' $trnl | \
22404 $awk '{ printf "%s %d\n", $1, ++s; }
22405 END { printf "NSIG %d\n", ++s }' >signal.lst
22407 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
22409 chmod a+x signal_cmd
22410 $eunicefix signal_cmd
22414 : generate list of signal names
22415 case "$sig_num_init" in
22418 case "$sig_name_init" in
22420 *) case "$sig_num_init" in
22421 ''|*,*) doinit=yes ;;
22426 echo "Generating a list of signal names and numbers..." >&4
22428 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
22429 sig_name=`$awk 'BEGIN { printf "ZERO " }
22430 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
22431 sig_num=`$awk 'BEGIN { printf "0 " }
22432 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
22433 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
22434 !/^NSIG/ { printf "\"%s\", ", $1 }
22435 END { printf "0\n" }' signal.lst`
22436 sig_num_init=`$awk 'BEGIN { printf "0, " }
22437 !/^NSIG/ { printf "%d, ", $2}
22438 END { printf "0\n"}' signal.lst`
22441 echo "The following $sig_count signals are available:"
22443 echo $sig_name | $awk \
22444 'BEGIN { linelen = 0 }
22446 for (i = 1; i <= NF; i++) {
22447 name = "SIG" $i " "
22448 linelen = linelen + length(name)
22449 if (linelen > 70) {
22451 linelen = length(name)
22457 sig_size=`echo $sig_name | awk '{print NF}'`
22458 $rm -f signal signal.c signal.awk signal.lst signal_cmd
22462 : Check size of size
22464 case "$sizetype" in
22465 *_t) zzz="$sizetype" ;;
22466 *) zzz="filesize" ;;
22468 echo "Checking the size of $zzz..." >&4
22470 #include <sys/types.h>
22472 #$i_stdlib I_STDLIB
22474 #include <stdlib.h>
22477 printf("%d\n", (int)sizeof($sizetype));
22482 if eval $compile_ok; then
22486 echo "(I can't execute the test program--guessing $sizesize.)" >&4
22489 echo "Your $zzz size is $sizesize bytes."
22494 echo "(I can't compile the test program--guessing $sizesize.)" >&4
22498 : check for socklen_t
22500 echo "Checking to see if you have socklen_t..." >&4
22502 #include <sys/types.h>
22503 #$d_socket HAS_SOCKET
22505 #include <sys/socket.h>
22507 int main() { socklen_t x = 16; }
22510 if eval $compile; then
22512 echo "You have socklen_t."
22515 echo "You do not have socklen_t."
22516 case "$sizetype" in
22517 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
22524 : see if this is a socks.h system
22525 set socks.h i_socks
22528 : check for type of the size argument to socket calls
22529 case "$d_socket" in
22533 Checking to see what type is the last argument of accept().
22536 case "$d_socklen_t" in
22537 "$define") yyy="$yyy socklen_t"
22539 yyy="$yyy $sizetype int long unsigned"
22540 for xxx in $yyy; do
22541 case "$socksizetype" in
22542 '') try="$extern_C int accept(int, struct sockaddr *, $xxx *);"
22543 case "$usesocks" in
22545 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
22546 echo "Your system accepts '$xxx *' for the last argument of accept()."
22547 socksizetype="$xxx"
22550 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
22551 echo "Your system accepts '$xxx *' for the last argument of accept()."
22552 socksizetype="$xxx"
22559 : In case none of those worked, prompt the user.
22560 case "$socksizetype" in
22561 '') rp='What is the type for socket address structure sizes?'
22568 *) : no sockets, so pick relatively harmless default
22573 : see what type is used for signed size_t
22574 set ssize_t ssizetype int stdio.h sys/types.h
22579 #$i_stdlib I_STDLIB
22581 #include <stdlib.h>
22583 #include <sys/types.h>
22584 #define Size_t $sizetype
22585 #define SSize_t $dflt
22588 if (sizeof(Size_t) == sizeof(SSize_t))
22590 else if (sizeof(Size_t) == sizeof(int))
22599 if eval $compile_ok && $run ./try > /dev/null; then
22600 ssizetype=`$run ./try`
22601 echo "I'll be using $ssizetype for functions returning a byte count." >&4
22604 Help! I can't compile and run the ssize_t test program: please enlighten me!
22605 (This is probably a misconfiguration in your system or libraries, and
22606 you really ought to fix it. Still, I'll try anyway.)
22608 I need a type that is the same size as $sizetype, but is guaranteed to
22609 be signed. Common values are ssize_t, int and long.
22612 rp="What signed type is the same size as $sizetype?"
22618 : Check the size of st_ino
22620 $echo "Checking the size of st_ino..." >&4
22621 $cat > try.c <<EOCP
22622 #include <sys/stat.h>
22624 #$i_stdlib I_STDLIB
22626 #include <stdlib.h>
22630 printf("%d\n", (int)sizeof(st.st_ino));
22635 if eval $compile_ok; then
22639 $echo "(I can't execute the test program--guessing $st_ino_size.)" >&4
22641 *) st_ino_size=$val
22642 $echo "Your st_ino is $st_ino_size bytes long."
22647 $echo "(I can't compile the test program--guessing $st_ino_size.)" >&4
22651 : Check if st_ino is signed
22653 $echo "Checking the sign of st_ino..." >&4
22654 $cat > try.c <<EOCP
22655 #include <sys/stat.h>
22660 if (foo.st_ino < 0)
22667 if eval $compile; then
22671 $echo "(I can't execute the test program--guessing unsigned.)" >&4
22673 *) st_ino_sign=$val
22674 case "$st_ino_sign" in
22675 1) $echo "Your st_ino is unsigned." ;;
22676 -1) $echo "Your st_ino is signed." ;;
22682 $echo "(I can't compile the test program--guessing unsigned.)" >&4
22686 : see what type of char stdio uses.
22688 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
22689 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
22690 echo "Your stdio uses unsigned chars." >&4
22691 stdchar="unsigned char"
22693 echo "Your stdio uses signed chars." >&4
22698 : Check size of UID
22701 *_t) zzz="$uidtype" ;;
22704 echo "Checking the size of $zzz..." >&4
22706 #include <sys/types.h>
22708 #$i_stdlib I_STDLIB
22710 #include <stdlib.h>
22713 printf("%d\n", (int)sizeof($uidtype));
22718 if eval $compile_ok; then
22722 echo "(I can't execute the test program--guessing $uidsize.)" >&4
22725 echo "Your $zzz is $uidsize bytes long."
22730 echo "(I can't compile the test program--guessing $uidsize.)" >&4
22733 : Check if UID is signed
22736 *_t) zzz="$uidtype" ;;
22739 echo "Checking the sign of $zzz..." >&4
22741 #include <sys/types.h>
22752 if eval $compile; then
22756 echo "(I can't execute the test program--guessing unsigned.)" >&4
22760 1) echo "Your $zzz is unsigned." ;;
22761 -1) echo "Your $zzz is signed." ;;
22767 echo "(I can't compile the test program--guessing unsigned.)" >&4
22771 : Check format string for UID
22773 $echo "Checking the format string to be used for uids..." >&4
22776 -1) if $test X"$uidsize" = X"$ivsize"; then
22777 uidformat="$ivdformat"
22779 if $test X"$uidsize" = X"$longsize"; then
22782 if $test X"$uidsize" = X"$intsize"; then
22785 if $test X"$uidsize" = X"$shortsize"; then
22792 *) if $test X"$uidsize" = X"$uvsize"; then
22793 uidformat="$uvuformat"
22795 if $test X"$uidsize" = X"$longsize"; then
22798 if $test X"$uidsize" = X"$intsize"; then
22801 if $test X"$uidsize" = X"$shortsize"; then
22810 : Determine if we can use sysctl with KERN_PROC_PATHNAME to find executing program
22812 echo "Determining whether we can use sysctl with KERN_PROC_PATHNAME to find executing program..." >&4
22813 $cat >try.c <<'EOM'
22814 /* Intentionally a long probe as I'd like to sanity check that the exact
22815 approach is going to work, as thinking it will work, but only having it
22816 part working at runtime is worse than not having it. */
22818 #include <sys/types.h>
22819 #include <sys/sysctl.h>
22820 #include <sys/param.h>
22822 #include <string.h>
22823 #include <stdlib.h>
22824 #include <unistd.h>
22827 main(int argc, char **argv) {
22829 char *argv_leaf = strrchr(argv[0], '/');
22835 mib[1] = KERN_PROC;
22836 mib[2] = KERN_PROC_PATHNAME;
22840 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
22844 if (sysctl(mib, 4, NULL, &size, NULL, 0)) {
22849 if (size < strlen(argv_leaf) + 1) {
22850 fprintf(stderr, "size %lu is too short for a path\n",
22851 (unsigned long) size);
22855 if (size > MAXPATHLEN * MAXPATHLEN) {
22856 fprintf(stderr, "size %lu is too long for a path\n",
22857 (unsigned long) size);
22861 buffer = malloc(size);
22867 if (sysctl(mib, 4, buffer, &size, NULL, 0)) {
22872 if (strlen(buffer) + 1 != size) {
22873 fprintf(stderr, "size != strlen(buffer) + 1 (%lu != %lu)\n",
22874 (unsigned long)size, (unsigned long)strlen(buffer) + 1);
22879 if (*buffer != '/') {
22880 fprintf(stderr, "Not an absolute path: '%s'\n", buffer);
22884 if (strstr(buffer, "/./")) {
22885 fprintf(stderr, "Contains /./: '%s'\n", buffer);
22889 if (strstr(buffer, "/../")) {
22890 fprintf(stderr, "Contains /../: '%s'\n", buffer);
22894 buffer_leaf = strrchr(buffer, '/');
22895 if (strcmp(buffer_leaf, argv_leaf) != 0) {
22896 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], buffer);
22908 if eval $compile; then
22909 if $run ./try; then
22910 echo "You can use sysctl with KERN_PROC_PATHNAME to find the executing program." >&4
22913 echo "Nope, sysctl with KERN_PROC_PATHNAME doesn't work here." >&4
22917 echo "I'm unable to compile the test program." >&4
22918 echo "I'll assume no sysctl with KERN_PROC_PATHNAME here." >&4
22922 set usekernprocpathname
22925 : Determine if we can use _NSGetExecutablePath to find executing program
22927 echo "Determining whether we can use _NSGetExecutablePath to find executing program..." >&4
22928 $cat >try.c <<'EOM'
22929 /* Intentionally a long probe as I'd like to sanity check that the exact
22930 approach is going to work, as thinking it will work, but only having it
22931 part working at runtime is worse than not having it. */
22932 #include <mach-o/dyld.h>
22934 #include <stdlib.h>
22935 #include <sys/param.h>
22936 #include <string.h>
22939 main(int argc, char **argv) {
22941 uint32_t size = sizeof(buf);
22945 char *argv_leaf = strrchr(argv[0], '/');
22949 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
22953 _NSGetExecutablePath(buf, &size);
22954 if (size > MAXPATHLEN * MAXPATHLEN) {
22955 fprintf(stderr, "_NSGetExecutablePath size %u is too long for a path\n",
22956 (unsigned int) size);
22960 buffer = malloc(size);
22966 result = _NSGetExecutablePath(buffer, &size);
22968 fprintf(stderr, "_NSGetExecutablePath returned %i for a size of %u\n",
22969 result, (unsigned int) size);
22973 tidied = realpath(buffer, NULL);
22975 perror("realpath");
22981 if (*tidied != '/') {
22982 fprintf(stderr, "Not an absolute path: '%s'\n", tidied);
22986 if (strstr(tidied, "/./")) {
22987 fprintf(stderr, "Contains /./: '%s'\n", tidied);
22991 if (strstr(tidied, "/../")) {
22992 fprintf(stderr, "Contains /../: '%s'\n", tidied);
22996 tidied_leaf = strrchr(tidied, '/');
22997 if (strcmp(tidied_leaf, argv_leaf) != 0) {
22998 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], tidied);
23010 if eval $compile; then
23011 if $run ./try; then
23012 echo "You can use _NSGetExecutablePath to find the executing program." >&4
23015 echo "Nope, _NSGetExecutablePath doesn't work here." >&4
23018 echo "I'm unable to compile the test program." >&4
23019 echo "I'll assume no _NSGetExecutablePath here." >&4
23022 set usensgetexecutablepath
23025 : Check if site customization support was requested
23026 case "$usesitecustomize" in
23027 $define|true|[Yy]*)
23028 usesitecustomize="$define"
23031 usesitecustomize="$undef"
23035 : see if prototypes support variable argument declarations
23037 case "$prototype$i_stdarg" in
23039 echo "It appears we'll be able to prototype varargs functions." >&4
23043 echo "Too bad... We won't be using prototyped varargs functions..." >&4
23050 : determine compiler compiler
23059 if $test -f "$byacc$_exe"; then
23061 comp="byacc or $comp"
23063 if $test -f "$bison$_exe"; then
23064 comp="$comp or bison -y"
23066 rp="Which compiler compiler ($comp) shall I use?"
23075 echo "(Adding -y option to bison to get yacc-compatible behavior.)"
23081 : see if this is a assert.h system
23082 set assert.h i_assert
23085 : see if this is a bfd.h system
23089 : see if this is an execinfo.h system
23090 set execinfo.h i_execinfo
23093 : see if this is a fenv.h system
23097 : see if this is a fp.h system
23101 : see if this is a fp_class.h system
23102 set fp_class.h i_fp_class
23105 : see if gdbm.h is available
23110 : see if gdbm_open exists
23111 set gdbm_open d_gdbm_open
23113 case "$d_gdbm_open" in
23116 echo "We won't be including <gdbm.h>"
23125 : see if this is a ieeefp.h system
23126 case "$i_ieeefp" in
23127 '' ) set ieeefp.h i_ieeefp
23132 : see if this is a libutil.h system
23133 set libutil.h i_libutil
23136 : see if mach cthreads are available
23137 if test "X$usethreads" = "X$define"; then
23138 set mach/cthreads.h i_machcthr
23141 i_machcthr="$undef"
23144 : see if this is a mntent.h system
23145 set mntent.h i_mntent
23148 : see if net/errno.h is available
23150 set net/errno.h val
23153 : Unfortunately, it causes problems on some systems. Arrgh.
23156 cat > try.c <<'EOM'
23159 #include <net/errno.h>
23165 if $cc $ccflags -c try.c >/dev/null 2>&1; then
23166 echo "We'll be including <net/errno.h>." >&4
23168 echo "We won't be including <net/errno.h>." >&4
23177 : see if netinet/tcp.h is available
23178 set netinet/tcp.h i_netinettcp
23181 : see if this is a poll.h system
23185 : see if this is a prot.h system
23189 : Preprocessor symbols
23191 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
23192 $cat <<'EOSH' > Cppsym.know
23193 a29k aarch64 ABI64 aegis AES_SOURCE AIX AIX32 AIX370 AIX41 AIX42
23194 AIX43 aixpc AIX_SOURCE alliant ALL_SOURCE alpha AM29000 am29000
23195 AMD64 amd64 amiga AMIGAOS AMIX ansi ANSI_C_SOURCE apollo arch_ppc
23196 arch_pwr ardent ARM ARM32 atarist att386 att3b
23197 BeOS BIG_ENDIAN BIT_MSF BSD bsd bsd43 bsd4_2 BSD4_3 bsd4_3 bsd4_4
23198 BSDCOMPAT bsdi BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES bull
23199 byteorder byte_order
23200 c cadmus clang clipper CMU COFF COMPILER_VERSION concurrent
23201 convex cpu CRAY cray CRAYMPP ctix CX_UX CYGWIN
23202 DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO Dynix DynixPTX
23203 ELF encore EPI EXTENSIONS
23204 FAVOR_BSD FILE_OFFSET_BITS FORTIFY_SOURCE FreeBSD
23205 GCC_NEW_VARARGS gcos gcx gimpel GLIBC GLIBC_MINOR GNUC GNUC_MINOR
23206 GNU_LIBRARY GNU_SOURCE GO32 gould GOULD_PN
23207 H3050R H3050RX hbullx20 hcx host_mips hp200 hp300 HP700 hp700
23208 hp800 hp9000 hp9000s200 hp9000s300 hp9000s400 hp9000s500
23209 hp9000s700 hp9000s800 hp9k8 hppa hpux HPUX_SOURCE hp_osf
23210 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960 IA32 IA64
23211 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
23212 INLINE_INTRINSICS INT64 INTEL interdata INTRINSICS is68k itanium
23214 LANGUAGE_C LARGEFILE64_SOURCE LARGEFILE_SOURCE LARGE_FILE_API
23215 LFS64_LARGEFILE LFS_LARGEFILE LIBCATAMOUNT Linux LITTLE_ENDIAN
23216 LONG64 LONGDOUBLE LONGLONG LONG_DOUBLE LONG_LONG LP64 luna
23218 M68000 m68k m88100 m88k M88KBCS_TARGET MACH machine MachTen
23219 MATH_HAS_NO_SIDE_EFFECTS mc300 mc500 mc68000 mc68010 mc68020
23220 mc68030 mc68040 mc68060 mc68k mc68k32 mc700 mc88000 mc88100
23221 merlin mert MiNT mips MIPSEB MIPSEL MIPS_FPSET MIPS_ISA MIPS_SIM
23222 MIPS_SZINT MIPS_SZLONG MIPS_SZPTR MODERN_C motorola mpeix MSDOS
23223 MTXINU MULTIMAX MVS mvs M_AMD64 M_ARM M_ARMT M_COFF M_I186 M_I286
23224 M_I386 M_I8086 M_I86 M_I86SM M_IA64 M_IX86 M_PPC M_SYS3 M_SYS5
23225 M_SYSIII M_SYSV M_UNIX M_X86 M_XENIX
23226 n16 ncl_el ncl_mr NetBSD news1500 news1700 news1800 news1900
23227 news3700 news700 news800 news900 NeXT NLS nonstopux ns16000
23228 ns32000 ns32016 ns32332 ns32k nsc32000
23229 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
23230 PARAGON parisc pa_risc PA_RISC1_1 PA_RISC2_0 pc532 pdp11 PGC PIC
23231 plexus PORTAR posix POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
23232 POSIX_C_SOURCE POSIX_SOURCE POWER powerpc ppc PROTOTYPES PWB pyr
23234 R3000 REENTRANT RES Rhapsody RISC6000 riscix riscos RT
23235 S390 S390x SA110 SCO scs sequent sgi SGI_SOURCE SH SH3 sinix
23236 SIZE_INT SIZE_LONG SIZE_PTR SOCKETS_SOURCE SOCKET_SOURCE sony
23237 sonyrisc sony_news sparc sparclite sparcv8 sparcv9 spectrum
23238 stardent stdc STDC_EXT stratos sun sun3 sun386 Sun386i svr3 svr4
23239 SVR4_2 SVR4_SOURCE svr5 SX system SYSTYPE_BSD SYSTYPE_BSD43
23240 SYSTYPE_BSD44 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3
23241 SYSV4 SYSV5 sysV68 sysV88
23242 Tek4132 Tek4300 thumb thw_370 thw_intel thw_rs6000 titan TM3200
23243 TM5400 TM5600 tower tower32 tower32_200 tower32_600 tower32_700
23244 tower32_800 tower32_850 tss
23245 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5 ultrix UMAXV UnicomPBB
23246 UnicomPBD UNICOS UNICOSMK unix UNIX95 UNIX99 unixpc unos USE_BSD
23247 USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE
23248 USE_LARGEFILE64 USE_MISC USE_POSIX USE_POSIX199309
23249 USE_POSIX199506 USE_POSIX2 USE_REENTRANT USE_SVID USE_UNIX98
23250 USE_XOPEN USE_XOPEN_EXTENDED USGr4 USGr4_2 UTek Utek UTS UWIN
23252 vax venix VMESA vms
23253 x86_64 xenix Xenix286 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2
23254 XPG2_EXTENDED XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
23257 # Maybe put other stuff here too.
23258 ./tr '-' '_' <<EOSH >>Cppsym.know
23261 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
23262 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
23263 $cat Cppsym.know > Cppsym.c
23264 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
23265 $rm -f Cppsym.a Cppsym.b Cppsym.c
23266 cat <<EOSH > Cppsym
23268 if $test \$# -gt 0; then
23269 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
23270 if $test -s Cppsym.got; then
23277 $tr " " "$trnl" | ./Cppsym.try
23283 cat <<EOSH > Cppsym.try
23285 cat <<'EOCP' > try.c
23288 #define STRINGIFY(a) "a"
23290 #if cpp_stuff == 42
23291 #define StGiFy(a) #a
23292 #define STRINGIFY(a) StGiFy(a)
23294 #if $cpp_stuff != 1 && $cpp_stuff != 42
23295 # include "Bletch: How does this C preprocessor stringify macros?"
23301 cat <<'EOSH' >> Cppsym.try
23303 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
23304 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
23305 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
23306 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
23308 echo 'return 0;}' >> try.c
23310 cat <<EOSH >> Cppsym.try
23312 case "$osname-$gccversion" in
23313 irix-) ccflags="\$ccflags -woff 1178" ;;
23314 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
23316 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs 2>/dev/null && $run ./try | $sed 's/ /\\\\ /g'
23318 chmod +x Cppsym.try
23319 $eunicefix Cppsym.try
23320 ./Cppsym < Cppsym.know | $sort | $uniq > Cppsym.true
23321 : Add in any Linux cpp "predefined macros":
23322 case "$osname::$gccversion" in
23323 *linux*::*.*|*gnukfreebsd*::*.*|gnu::*.*)
23325 rm -f $tHdrH'.h' $tHdrH
23327 # Filter out macro arguments, such as Linux's __INT8_C(c)
23328 if $cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
23329 sed -e 's/#define[\ \ ]*//;s/[\ \ ].*$//' -e 's/(.*//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
23330 if [ -s $tHdrH'_cppsym.real' ]; then
23331 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
23334 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
23337 : now check the C compiler for additional symbols
23338 postprocess_cc_v=''
23340 aix) postprocess_cc_v="|$tr , ' '" ;;
23347 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
23350 -D*) echo "\$i" | $sed 's/^-D//';;
23351 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
23356 postprocess_cc_v=''
23359 ./ccsym > ccsym1.raw
23360 if $test -s ccsym1.raw; then
23361 $sort ccsym1.raw | $uniq >ccsym.raw
23363 mv ccsym1.raw ccsym.raw
23366 $awk '/\=/ { print $0; next }
23367 { print $0"=1" }' ccsym.raw >ccsym.list
23368 $comm -13 Cppsym.true ccsym.list >ccsym.own
23369 $comm -12 Cppsym.true ccsym.list >ccsym.com
23370 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
23372 if $test -z ccsym.raw; then
23373 echo "Your C compiler doesn't seem to define any symbols!" >&4
23375 echo "However, your C preprocessor defines the following symbols:"
23378 cppsymbols=`$cat Cppsym.true`
23379 cppsymbols=`echo $cppsymbols`
23380 cppccsymbols="$cppsymbols"
23382 if $test -s ccsym.com; then
23383 echo "Your C compiler and pre-processor define these symbols:"
23384 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
23387 cppccsymbols=`$cat ccsym.com`
23388 cppccsymbols=`echo $cppccsymbols`
23389 $test "$silent" || sleep 1
23391 if $test -s ccsym.cpp; then
23392 $test "$also" && echo " "
23393 echo "Your C pre-processor ${also}defines the following symbols:"
23394 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
23396 cppsymbols=`$cat ccsym.cpp`
23397 cppsymbols=`echo $cppsymbols`
23398 $test "$silent" || sleep 1
23400 if $test -s ccsym.own; then
23401 $test "$also" && echo " "
23402 echo "Your C compiler ${also}defines the following cpp symbols:"
23403 $sed -e 's/\(..*\)=1/\1/' ccsym.own
23404 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
23405 ccsymbols=`$cat ccsym.own`
23406 ccsymbols=`echo $ccsymbols`
23407 $test "$silent" || sleep 1
23411 : add -D_FORTIFY_SOURCE if feasible and not already there
23412 case "$gccversion" in
23413 [45].*) case "$optimize$ccflags" in
23414 *-O*) case "$ccflags$cppsymbols" in
23415 *_FORTIFY_SOURCE=*) # Don't add it again.
23416 echo "You seem to have -D_FORTIFY_SOURCE already, not adding it." >&4
23418 *) echo "Adding -D_FORTIFY_SOURCE=2 to ccflags..." >&4
23419 ccflags="$ccflags -D_FORTIFY_SOURCE=2"
23423 *) echo "You have gcc 4.* or later but not optimizing, not adding -D_FORTIFY_SOURCE." >&4
23427 *) echo "You seem not to have gcc 4.* or later, not adding -D_FORTIFY_SOURCE." >&4
23431 : see if this is a termio system
23435 if $test `./findhdr termios.h`; then
23436 set tcsetattr i_termios
23442 "$define") echo "You have POSIX termios.h... good!" >&4;;
23443 *) if ./Cppsym pyr; then
23444 case "`$run /bin/universe`" in
23445 ucb) if $test `./findhdr sgtty.h`; then
23447 echo "<sgtty.h> found." >&4
23449 echo "System is pyramid with BSD universe."
23450 ./warn "<sgtty.h> not found--you could have problems."
23452 *) if $test `./findhdr termio.h`; then
23454 echo "<termio.h> found." >&4
23456 echo "System is pyramid with USG universe."
23457 ./warn "<termio.h> not found--you could have problems."
23461 if $test `./findhdr termio.h`; then
23462 echo "<termio.h> found." >&4
23464 elif $test `./findhdr sgtty.h`; then
23465 echo "<sgtty.h> found." >&4
23468 ./warn "Neither <termio.h> nor <sgtty.h> found--cross fingers!"
23471 if $test `./findhdr sgtty.h`; then
23472 echo "<sgtty.h> found." >&4
23474 elif $test `./findhdr termio.h`; then
23475 echo "<termio.h> found." >&4
23478 ./warn "Neither <sgtty.h> nor <termio.h> found--cross fingers!"
23482 set i_termio; eval $setvar
23483 val=$val2; set i_sgtty; eval $setvar
23484 val=$val3; set i_termios; eval $setvar
23486 : see if stdbool is available
23487 : we want a real compile instead of Inhdr because some Solaris systems
23488 : have stdbool.h, but it can only be used if the compiler indicates it
23489 : is sufficiently c99-compliant.
23493 #include <stdbool.h>
23498 int main(int argc, char **argv)
23504 if eval $compile; then
23505 echo "<stdbool.h> found." >&4
23508 echo "<stdbool.h> NOT found." >&4
23515 : see if stddef is available
23516 set stddef.h i_stddef
23519 : see if stdint is available
23520 set stdint.h i_stdint
23523 : see if sys/access.h is available
23524 set sys/access.h i_sysaccess
23527 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
23528 set sys/filio.h i_sysfilio
23531 if $test `./findhdr sys/ioctl.h`; then
23533 echo '<sys/ioctl.h> found.' >&4
23536 if $test $i_sysfilio = "$define"; then
23537 echo '<sys/ioctl.h> NOT found.' >&4
23539 $test $i_sgtty = "$define" && xxx="sgtty.h"
23540 $test $i_termio = "$define" && xxx="termio.h"
23541 $test $i_termios = "$define" && xxx="termios.h"
23542 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
23548 : see if socket ioctl defs are in sys/sockio.h
23550 xxx=`./findhdr sys/sockio.h`
23551 if $test "$xxx"; then
23552 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
23554 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
23557 echo "No socket ioctls found in <sys/sockio.h>." >&4
23562 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
23568 : see if this is a syslog.h system
23569 set syslog.h i_syslog
23572 : see if this is a sys/mode.h system
23573 set sys/mode.h i_sysmode
23576 : see if there is a sys/poll.h file
23577 set sys/poll.h i_syspoll
23580 : see if sys/resource.h has to be included
23581 set sys/resource.h i_sysresrc
23584 : see if sys/security.h is available
23585 set sys/security.h i_syssecrt
23588 : see if this is a sys/statvfs.h system
23589 set sys/statvfs.h i_sysstatvfs
23592 : see if this is a sys/un.h system
23593 set sys/un.h i_sysun
23596 : see if this is a sys/utsname.h system
23597 set sys/utsname.h i_sysutsname
23600 : see if this is a syswait system
23601 set sys/wait.h i_syswait
23604 : see if this is a ustat.h system
23605 set ustat.h i_ustat
23608 : see if this is an utime system
23609 set utime.h i_utime
23612 : see if this is a vfork system
23615 set vfork.h i_vfork
23625 echo "Looking for extensions..." >&4
23626 : If we are using the old config.sh, nonxs_extensions and xs_extensions may
23627 : contain old or inaccurate or duplicate values.
23628 nonxs_extensions=''
23630 : We do not use find because it might not be available.
23631 : We do not just use MANIFEST because the user may have dropped
23632 : some additional extensions into the source tree and expect them
23635 : Function to recursively find available extensions, ignoring DynaLoader
23636 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
23637 : In 5.10.1 and later, extensions are stored in directories
23638 : like File-Glob instead of the older File/Glob/.
23642 DynaLoader|dynaload) ;;
23644 this_ext=`echo "$xxx" | $sed -e s/-/\\\//g`;
23645 case "$this_ext" in
23646 Scalar/List/Utils) this_ext="List/Util" ;;
23647 PathTools) this_ext="Cwd" ;;
23649 echo " $xs_extensions $nonxs_extensions" > "$tdir/$$.tmp";
23650 if $contains " $this_ext " "$tdir/$$.tmp"; then
23652 echo "Duplicate directories detected for extension $xxx" >&4;
23653 echo "Configure cannot correctly recover from this - shall I abort?" >&4;
23654 case "$knowitall" in
23662 echo "Ok. Stopping Configure." >&4;
23663 echo "Please remove the duplicate directory (e.g. using git clean) and then re-run Configure" >&4;
23666 echo "Ok. You will need to correct config.sh before running make." >&4;
23668 $ls -1 "$xxx" > "$tdir/$$.tmp";
23669 if $contains "\.xs$" "$tdir/$$.tmp" > /dev/null 2>&1; then
23670 xs_extensions="$xs_extensions $this_ext";
23671 elif $contains "\.c$" "$tdir/$$.tmp" > /dev/null 2>&1; then
23672 xs_extensions="$xs_extensions $this_ext";
23673 elif $test -d "$xxx"; then
23674 nonxs_extensions="$nonxs_extensions $this_ext";
23676 $rm -f "$tdir/$$.tmp";
23684 eval $find_extensions
23688 eval $find_extensions
23692 eval $find_extensions
23693 set X $xs_extensions
23695 xs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
23696 set X $nonxs_extensions
23698 nonxs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
23700 known_extensions=`echo $nonxs_extensions $xs_extensions | tr ' ' $trnl | $sort | tr $trnl ' '`
23702 : Now see which are supported on this system.
23704 for xxx in $xs_extensions ; do
23708 amigaos) avail_ext="$avail_ext $xxx" ;;
23713 $define) avail_ext="$avail_ext $xxx" ;;
23716 GDBM_File|gdbm_fil)
23718 $define) avail_ext="$avail_ext $xxx" ;;
23721 I18N/Langinfo|i18n_lan)
23722 case "$i_langinfo$d_nl_langinfo" in
23723 $define$define) avail_ext="$avail_ext $xxx" ;;
23727 : XXX Do we need a useipcsysv variable here
23728 case "${d_msg}${d_sem}${d_shm}" in
23729 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
23732 NDBM_File|ndbm_fil)
23735 case "$osname-$use64bitint" in
23738 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
23741 *) avail_ext="$avail_ext $xxx" ;;
23746 ODBM_File|odbm_fil)
23747 case "${i_dbm}${i_rpcsvcdbm}" in
23749 case "$d_cplusplus" in
23750 define) ;; # delete as a function name will not work
23751 *) case "$osname-$use64bitint" in
23754 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
23757 *) avail_ext="$avail_ext $xxx" ;;
23765 case "$useopcode" in
23766 true|define|y) avail_ext="$avail_ext $xxx" ;;
23770 case "$useposix" in
23771 true|define|y) avail_ext="$avail_ext $xxx" ;;
23775 case "$d_socket" in
23776 true|$define|y) avail_ext="$avail_ext $xxx" ;;
23779 Sys/Syslog|sys/syslog)
23781 amigaos) ;; # not really very useful on AmigaOS
23783 : XXX syslog requires socket
23784 case "$d_socket" in
23785 true|$define|y) avail_ext="$avail_ext $xxx" ;;
23791 case "$usethreads" in
23793 case "$use5005threads" in
23794 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
23798 threads|threads/shared)
23799 # threads and threads::shared are special cases.
23800 # To stop people from asking "Perl 5.8.0 was supposed
23801 # to have this new fancy threads implementation but my
23802 # perl doesn't have it" and from people trying to
23803 # (re)install the threads module using CPAN.pm and
23804 # CPAN.pm then offering to reinstall Perl 5.8.0,
23805 # the threads.pm and threads/shared.pm will always be
23806 # there, croaking informatively ("you need to rebuild
23807 # all of Perl with threads, sorry") when threads haven't
23808 # been compiled in.
23810 avail_ext="$avail_ext $xxx"
23816 cygwin) avail_ext="$avail_ext $xxx" ;;
23819 XS/APItest|xs/apitest)
23820 # This is just for testing. Skip it unless we have dynamic loading.
23823 $define) avail_ext="$avail_ext $xxx" ;;
23826 XS/Typemap|xs/typemap)
23827 # This is just for testing. Skip it unless we have dynamic loading.
23829 $define) avail_ext="$avail_ext $xxx" ;;
23832 *) avail_ext="$avail_ext $xxx"
23841 case "$onlyextensions" in
23843 *) keepextensions=''
23844 echo "You have requested that only certain extensions be included..." >&4
23845 for i in $onlyextensions; do
23846 case " $avail_ext " in
23848 echo "Keeping extension $i."
23849 keepextensions="$keepextensions $i"
23851 *) echo "Ignoring extension $i." ;;
23854 avail_ext="$keepextensions"
23858 case "$noextensions" in
23860 *) keepextensions=''
23861 echo "You have requested that certain extensions be ignored..." >&4
23862 for i in $avail_ext; do
23863 case " $noextensions " in
23864 *" $i "*) echo "Ignoring extension $i." ;;
23865 *) echo "Keeping extension $i.";
23866 keepextensions="$keepextensions $i"
23870 avail_ext="$keepextensions"
23874 : Now see which nonxs extensions are supported on this system.
23875 : For now assume all are.
23877 for xxx in $nonxs_extensions ; do
23881 *) nonxs_ext="$nonxs_ext $xxx"
23893 A number of extensions are supplied with $package. You may choose to
23894 compile these extensions for dynamic loading (the default), compile
23895 them into the $package executable (static loading), or not include
23896 them at all. Answer "none" to include no extensions.
23897 Note that DynaLoader is always built and need not be mentioned here.
23900 case "$dynamic_ext" in
23902 : Exclude those listed in static_ext
23904 for xxx in $avail_ext; do
23905 case " $static_ext " in
23907 *) dflt="$dflt $xxx" ;;
23914 *) dflt="$dynamic_ext"
23915 # Perhaps we are reusing an old out-of-date config.sh.
23918 if test X"$dynamic_ext" != X"$avail_ext"; then
23920 NOTICE: Your previous config.sh list may be incorrect.
23921 The extensions now available to you are
23923 but the default list from your previous config.sh is
23935 rp="What extensions do you wish to load dynamically?"
23938 none) dynamic_ext=' ' ;;
23939 *) dynamic_ext="$ans" ;;
23942 case "$static_ext" in
23944 : Exclude those already listed in dynamic linking
23946 for xxx in $avail_ext; do
23947 case " $dynamic_ext " in
23949 *) dflt="$dflt $xxx" ;;
23956 *) dflt="$static_ext"
23963 rp="What extensions do you wish to load statically?"
23966 none) static_ext=' ' ;;
23967 *) static_ext="$ans" ;;
23972 A number of extensions are supplied with $package. Answer "none"
23973 to include no extensions.
23974 Note that DynaLoader is always built and need not be mentioned here.
23977 case "$static_ext" in
23978 '') dflt="$avail_ext" ;;
23979 *) dflt="$static_ext"
23980 # Perhaps we are reusing an old out-of-date config.sh.
23983 if test X"$static_ext" != X"$avail_ext"; then
23985 NOTICE: Your previous config.sh list may be incorrect.
23986 The extensions now available to you are
23988 but the default list from your previous config.sh is
23997 : Exclude those that are not xs extensions
24001 rp="What extensions do you wish to include?"
24004 none) static_ext=' ' ;;
24005 *) static_ext="$ans" ;;
24010 # Encode is a special case. If we are building Encode as a static
24011 # extension, we need to explicitly list its subextensions as well.
24012 # For other nested extensions, this is handled automatically by
24013 # the appropriate Makefile.PL.
24014 case " $static_ext " in
24015 *" Encode "*) # Add the subextensions of Encode
24017 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
24018 static_ext="$static_ext Encode/$xxx"
24019 known_extensions="$known_extensions Encode/$xxx"
24025 set X $dynamic_ext $static_ext $nonxs_ext
24029 # Sanity check: We require an extension suitable for use with
24030 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
24031 # should show up as failures in the test suite, but it's helpful to
24032 # catch them now.) The 'extensions' list is normally sorted
24033 # alphabetically, so we need to accept either
24034 # DB_File ... Fcntl ... IO ....
24035 # or something like
24036 # Fcntl ... NDBM_File ... IO ....
24037 case " $extensions" in
24038 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
24039 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
24040 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
24041 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
24042 echo "WARNING: The Perl you are building will be quite crippled." >& 4
24046 : Remove libraries needed only for extensions
24047 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
24048 : The exception is SunOS 4.x, which needs them.
24049 case "${osname}X${osvers}" in
24053 *) case "$usedl" in
24054 $define|true|[yY]*)
24055 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
24059 *) perllibs="$libs"
24065 : Remove build directory name from cppstdin so it can be used from
24066 : either the present location or the final installed location.
24068 : Get out of the UU directory to get correct path name.
24070 case "$cppstdin" in
24072 echo "Stripping down cppstdin path name"
24078 : end of configuration questions
24080 echo "End of configuration questions."
24083 : back to where it started
24084 if test -d ../UU; then
24088 : configuration may be unconditionally patched via a 'config.arch' file
24089 if $test -f config.arch; then
24090 echo "I see a config.arch file, loading it." >&4
24094 : configuration may be patched via a 'config.over' file
24095 if $test -f config.over; then
24098 rp='I see a config.over file. Do you wish to load it?'
24101 n*) echo "OK, I'll ignore it.";;
24103 echo "Configuration override changes have been loaded."
24108 : in case they want portability, strip down executable paths
24109 case "$d_portable" in
24112 echo "Stripping down executable paths..." >&4
24113 for file in $loclist $trylist; do
24115 eval $file=`basename $temp`
24120 : create config.sh file
24122 echo "Creating config.sh..." >&4
24123 $spitshell <<EOT >config.sh
24126 # This file was produced by running the Configure script. It holds all the
24127 # definitions figured out by Configure. Should you modify one of these values,
24128 # do not forget to propagate your changes by running "Configure -der". You may
24129 # instead choose to run each of the .SH files by yourself, or "Configure -S".
24132 # Package name : $package
24133 # Source directory : $src
24134 # Configuration time: $cf_time
24135 # Configured by : $cf_by
24136 # Target system : $myuname
24139 : Add in command line options if available
24140 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
24142 $spitshell <<EOT >>config.sh
24151 Revision='$Revision'
24159 alignbytes='$alignbytes'
24160 ansi2knr='$ansi2knr'
24161 aphostname='$aphostname'
24162 api_revision='$api_revision'
24163 api_subversion='$api_subversion'
24164 api_version='$api_version'
24165 api_versionstring='$api_versionstring'
24168 archlibexp='$archlibexp'
24169 archname64='$archname64'
24170 archname='$archname'
24171 archobjs='$archobjs'
24172 asctime_r_proto='$asctime_r_proto'
24181 byteorder='$byteorder'
24183 castflags='$castflags'
24186 cccdlflags='$cccdlflags'
24187 ccdlflags='$ccdlflags'
24189 ccflags_uselargefiles='$ccflags_uselargefiles'
24191 ccsymbols='$ccsymbols'
24192 ccversion='$ccversion'
24194 cf_email='$cf_email'
24196 charbits='$charbits'
24197 charsize='$charsize'
24201 clocktype='$clocktype'
24203 compress='$compress'
24204 contains='$contains'
24208 cpp_stuff='$cpp_stuff'
24209 cppccsymbols='$cppccsymbols'
24210 cppflags='$cppflags'
24212 cppminus='$cppminus'
24214 cppstdin='$cppstdin'
24215 cppsymbols='$cppsymbols'
24216 crypt_r_proto='$crypt_r_proto'
24217 cryptlib='$cryptlib'
24219 ctermid_r_proto='$ctermid_r_proto'
24220 ctime_r_proto='$ctime_r_proto'
24221 d_Gconvert='$d_Gconvert'
24222 d_PRIEUldbl='$d_PRIEUldbl'
24223 d_PRIFUldbl='$d_PRIFUldbl'
24224 d_PRIGUldbl='$d_PRIGUldbl'
24225 d_PRIXU64='$d_PRIXU64'
24226 d_PRId64='$d_PRId64'
24227 d_PRIeldbl='$d_PRIeldbl'
24228 d_PRIfldbl='$d_PRIfldbl'
24229 d_PRIgldbl='$d_PRIgldbl'
24230 d_PRIi64='$d_PRIi64'
24231 d_PRIo64='$d_PRIo64'
24232 d_PRIu64='$d_PRIu64'
24233 d_PRIx64='$d_PRIx64'
24234 d_SCNfldbl='$d_SCNfldbl'
24235 d__fwalk='$d__fwalk'
24236 d_access='$d_access'
24237 d_accessx='$d_accessx'
24241 d_archlib='$d_archlib'
24242 d_asctime64='$d_asctime64'
24243 d_asctime_r='$d_asctime_r'
24248 d_attribute_deprecated='$d_attribute_deprecated'
24249 d_attribute_format='$d_attribute_format'
24250 d_attribute_malloc='$d_attribute_malloc'
24251 d_attribute_nonnull='$d_attribute_nonnull'
24252 d_attribute_noreturn='$d_attribute_noreturn'
24253 d_attribute_pure='$d_attribute_pure'
24254 d_attribute_unused='$d_attribute_unused'
24255 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
24256 d_backtrace='$d_backtrace'
24260 d_bsdgetpgrp='$d_bsdgetpgrp'
24261 d_bsdsetpgrp='$d_bsdsetpgrp'
24262 d_builtin_choose_expr='$d_builtin_choose_expr'
24263 d_builtin_expect='$d_builtin_expect'
24265 d_c99_variadic_macros='$d_c99_variadic_macros'
24266 d_casti32='$d_casti32'
24267 d_castneg='$d_castneg'
24269 d_charvspr='$d_charvspr'
24271 d_chroot='$d_chroot'
24272 d_chsize='$d_chsize'
24274 d_clearenv='$d_clearenv'
24275 d_closedir='$d_closedir'
24276 d_cmsghdr_s='$d_cmsghdr_s'
24278 d_copysign='$d_copysign'
24279 d_copysignl='$d_copysignl'
24280 d_cplusplus='$d_cplusplus'
24282 d_crypt_r='$d_crypt_r'
24284 d_ctermid='$d_ctermid'
24285 d_ctermid_r='$d_ctermid_r'
24286 d_ctime64='$d_ctime64'
24287 d_ctime_r='$d_ctime_r'
24288 d_cuserid='$d_cuserid'
24289 d_dbl_dig='$d_dbl_dig'
24290 d_dbminitproto='$d_dbminitproto'
24291 d_difftime64='$d_difftime64'
24292 d_difftime='$d_difftime'
24293 d_dir_dd_fd='$d_dir_dd_fd'
24295 d_dirnamlen='$d_dirnamlen'
24296 d_dladdr='$d_dladdr'
24297 d_dlerror='$d_dlerror'
24298 d_dlopen='$d_dlopen'
24299 d_dlsymun='$d_dlsymun'
24300 d_dosuid='$d_dosuid'
24301 d_drand48_r='$d_drand48_r'
24302 d_drand48proto='$d_drand48proto'
24304 d_duplocale='$d_duplocale'
24305 d_eaccess='$d_eaccess'
24306 d_endgrent='$d_endgrent'
24307 d_endgrent_r='$d_endgrent_r'
24308 d_endhent='$d_endhent'
24309 d_endhostent_r='$d_endhostent_r'
24310 d_endnent='$d_endnent'
24311 d_endnetent_r='$d_endnetent_r'
24312 d_endpent='$d_endpent'
24313 d_endprotoent_r='$d_endprotoent_r'
24314 d_endpwent='$d_endpwent'
24315 d_endpwent_r='$d_endpwent_r'
24316 d_endsent='$d_endsent'
24317 d_endservent_r='$d_endservent_r'
24318 d_eofnblk='$d_eofnblk'
24321 d_eunice='$d_eunice'
24324 d_faststdio='$d_faststdio'
24325 d_fchdir='$d_fchdir'
24326 d_fchmod='$d_fchmod'
24327 d_fchown='$d_fchown'
24329 d_fcntl_can_lock='$d_fcntl_can_lock'
24330 d_fd_macros='$d_fd_macros'
24331 d_fd_set='$d_fd_set'
24332 d_fdclose='$d_fdclose'
24334 d_fds_bits='$d_fds_bits'
24335 d_fegetround='$d_fegetround'
24336 d_fgetpos='$d_fgetpos'
24337 d_finite='$d_finite'
24338 d_finitel='$d_finitel'
24339 d_flexfnam='$d_flexfnam'
24341 d_flockproto='$d_flockproto'
24346 d_fp_class='$d_fp_class'
24347 d_fp_classify='$d_fp_classify'
24348 d_fp_classl='$d_fp_classl'
24349 d_fpathconf='$d_fpathconf'
24350 d_fpclass='$d_fpclass'
24351 d_fpclassify='$d_fpclassify'
24352 d_fpclassl='$d_fpclassl'
24353 d_fpgetround='$d_fpgetround'
24354 d_fpos64_t='$d_fpos64_t'
24355 d_freelocale='$d_freelocale'
24356 d_frexpl='$d_frexpl'
24357 d_fs_data_s='$d_fs_data_s'
24358 d_fseeko='$d_fseeko'
24359 d_fsetpos='$d_fsetpos'
24360 d_fstatfs='$d_fstatfs'
24361 d_fstatvfs='$d_fstatvfs'
24363 d_ftello='$d_ftello'
24365 d_futimes='$d_futimes'
24366 d_gdbm_ndbm_h_uses_prototypes='$d_gdbm_ndbm_h_uses_prototypes'
24367 d_gdbmndbm_h_uses_prototypes='$d_gdbmndbm_h_uses_prototypes'
24368 d_getaddrinfo='$d_getaddrinfo'
24369 d_getcwd='$d_getcwd'
24370 d_getespwnam='$d_getespwnam'
24371 d_getfsstat='$d_getfsstat'
24372 d_getgrent='$d_getgrent'
24373 d_getgrent_r='$d_getgrent_r'
24374 d_getgrgid_r='$d_getgrgid_r'
24375 d_getgrnam_r='$d_getgrnam_r'
24376 d_getgrps='$d_getgrps'
24377 d_gethbyaddr='$d_gethbyaddr'
24378 d_gethbyname='$d_gethbyname'
24379 d_gethent='$d_gethent'
24380 d_gethname='$d_gethname'
24381 d_gethostbyaddr_r='$d_gethostbyaddr_r'
24382 d_gethostbyname_r='$d_gethostbyname_r'
24383 d_gethostent_r='$d_gethostent_r'
24384 d_gethostprotos='$d_gethostprotos'
24385 d_getitimer='$d_getitimer'
24386 d_getlogin='$d_getlogin'
24387 d_getlogin_r='$d_getlogin_r'
24388 d_getmnt='$d_getmnt'
24389 d_getmntent='$d_getmntent'
24390 d_getnameinfo='$d_getnameinfo'
24391 d_getnbyaddr='$d_getnbyaddr'
24392 d_getnbyname='$d_getnbyname'
24393 d_getnent='$d_getnent'
24394 d_getnetbyaddr_r='$d_getnetbyaddr_r'
24395 d_getnetbyname_r='$d_getnetbyname_r'
24396 d_getnetent_r='$d_getnetent_r'
24397 d_getnetprotos='$d_getnetprotos'
24398 d_getpagsz='$d_getpagsz'
24399 d_getpbyname='$d_getpbyname'
24400 d_getpbynumber='$d_getpbynumber'
24401 d_getpent='$d_getpent'
24402 d_getpgid='$d_getpgid'
24403 d_getpgrp2='$d_getpgrp2'
24404 d_getpgrp='$d_getpgrp'
24405 d_getppid='$d_getppid'
24406 d_getprior='$d_getprior'
24407 d_getprotobyname_r='$d_getprotobyname_r'
24408 d_getprotobynumber_r='$d_getprotobynumber_r'
24409 d_getprotoent_r='$d_getprotoent_r'
24410 d_getprotoprotos='$d_getprotoprotos'
24411 d_getprpwnam='$d_getprpwnam'
24412 d_getpwent='$d_getpwent'
24413 d_getpwent_r='$d_getpwent_r'
24414 d_getpwnam_r='$d_getpwnam_r'
24415 d_getpwuid_r='$d_getpwuid_r'
24416 d_getsbyname='$d_getsbyname'
24417 d_getsbyport='$d_getsbyport'
24418 d_getsent='$d_getsent'
24419 d_getservbyname_r='$d_getservbyname_r'
24420 d_getservbyport_r='$d_getservbyport_r'
24421 d_getservent_r='$d_getservent_r'
24422 d_getservprotos='$d_getservprotos'
24423 d_getspnam='$d_getspnam'
24424 d_getspnam_r='$d_getspnam_r'
24425 d_gettimeod='$d_gettimeod'
24426 d_gmtime64='$d_gmtime64'
24427 d_gmtime_r='$d_gmtime_r'
24428 d_gnulibc='$d_gnulibc'
24429 d_grpasswd='$d_grpasswd'
24430 d_hasmntopt='$d_hasmntopt'
24434 d_ilogbl='$d_ilogbl'
24435 d_inc_version_list='$d_inc_version_list'
24437 d_inetaton='$d_inetaton'
24438 d_inetntop='$d_inetntop'
24439 d_inetpton='$d_inetpton'
24440 d_int64_t='$d_int64_t'
24441 d_ip_mreq='$d_ip_mreq'
24442 d_ip_mreq_source='$d_ip_mreq_source'
24443 d_ipv6_mreq='$d_ipv6_mreq'
24444 d_ipv6_mreq_source='$d_ipv6_mreq_source'
24445 d_isascii='$d_isascii'
24446 d_isblank='$d_isblank'
24447 d_isfinite='$d_isfinite'
24448 d_isfinitel='$d_isfinitel'
24450 d_isinfl='$d_isinfl'
24451 d_isless='$d_isless'
24453 d_isnanl='$d_isnanl'
24454 d_isnormal='$d_isnormal'
24457 d_killpg='$d_killpg'
24458 d_lc_monetary_2008='$d_lc_monetary_2008'
24459 d_lchown='$d_lchown'
24460 d_ldbl_dig='$d_ldbl_dig'
24461 d_ldexpl='$d_ldexpl'
24462 d_lgamma='$d_lgamma'
24463 d_lgamma_r='$d_lgamma_r'
24464 d_libm_lib_version='$d_libm_lib_version'
24465 d_libname_unique='$d_libname_unique'
24467 d_llrint='$d_llrint'
24468 d_llrintl='$d_llrintl'
24469 d_llround='$d_llround'
24470 d_llroundl='$d_llroundl'
24471 d_localtime64='$d_localtime64'
24472 d_localtime_r='$d_localtime_r'
24473 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
24474 d_locconv='$d_locconv'
24479 d_longdbl='$d_longdbl'
24480 d_longlong='$d_longlong'
24482 d_lrintl='$d_lrintl'
24483 d_lround='$d_lround'
24484 d_lroundl='$d_lroundl'
24485 d_lseekproto='$d_lseekproto'
24487 d_madvise='$d_madvise'
24488 d_malloc_good_size='$d_malloc_good_size'
24489 d_malloc_size='$d_malloc_size'
24491 d_mbstowcs='$d_mbstowcs'
24492 d_mbtowc='$d_mbtowc'
24493 d_memchr='$d_memchr'
24494 d_memcmp='$d_memcmp'
24495 d_memcpy='$d_memcpy'
24496 d_memmem='$d_memmem'
24497 d_memmove='$d_memmove'
24498 d_memset='$d_memset'
24500 d_mkdtemp='$d_mkdtemp'
24501 d_mkfifo='$d_mkfifo'
24502 d_mkstemp='$d_mkstemp'
24503 d_mkstemps='$d_mkstemps'
24504 d_mktime64='$d_mktime64'
24505 d_mktime='$d_mktime'
24508 d_modflproto='$d_modflproto'
24509 d_mprotect='$d_mprotect'
24511 d_msg_ctrunc='$d_msg_ctrunc'
24512 d_msg_dontroute='$d_msg_dontroute'
24513 d_msg_oob='$d_msg_oob'
24514 d_msg_peek='$d_msg_peek'
24515 d_msg_proxy='$d_msg_proxy'
24516 d_msgctl='$d_msgctl'
24517 d_msgget='$d_msgget'
24518 d_msghdr_s='$d_msghdr_s'
24519 d_msgrcv='$d_msgrcv'
24520 d_msgsnd='$d_msgsnd'
24522 d_munmap='$d_munmap'
24523 d_mymalloc='$d_mymalloc'
24526 d_ndbm_h_uses_prototypes='$d_ndbm_h_uses_prototypes'
24527 d_nearbyint='$d_nearbyint'
24528 d_newlocale='$d_newlocale'
24529 d_nextafter='$d_nextafter'
24530 d_nexttoward='$d_nexttoward'
24532 d_nl_langinfo='$d_nl_langinfo'
24533 d_nv_preserves_uv='$d_nv_preserves_uv'
24534 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
24535 d_off64_t='$d_off64_t'
24536 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
24537 d_oldpthreads='$d_oldpthreads'
24538 d_oldsock='$d_oldsock'
24540 d_pathconf='$d_pathconf'
24542 d_perl_otherlibdirs='$d_perl_otherlibdirs'
24543 d_phostname='$d_phostname'
24546 d_portable='$d_portable'
24548 d_prctl_set_name='$d_prctl_set_name'
24549 d_printf_format_null='$d_printf_format_null'
24550 d_procselfexe='$d_procselfexe'
24551 d_pseudofork='$d_pseudofork'
24552 d_pthread_atfork='$d_pthread_atfork'
24553 d_pthread_attr_setscope='$d_pthread_attr_setscope'
24554 d_pthread_yield='$d_pthread_yield'
24555 d_ptrdiff_t='$d_ptrdiff_t'
24557 d_pwchange='$d_pwchange'
24558 d_pwclass='$d_pwclass'
24559 d_pwcomment='$d_pwcomment'
24560 d_pwexpire='$d_pwexpire'
24561 d_pwgecos='$d_pwgecos'
24562 d_pwpasswd='$d_pwpasswd'
24563 d_pwquota='$d_pwquota'
24566 d_querylocale='$d_querylocale'
24567 d_random_r='$d_random_r'
24568 d_re_comp='$d_re_comp'
24569 d_readdir64_r='$d_readdir64_r'
24570 d_readdir='$d_readdir'
24571 d_readdir_r='$d_readdir_r'
24572 d_readlink='$d_readlink'
24574 d_recvmsg='$d_recvmsg'
24575 d_regcmp='$d_regcmp'
24576 d_regcomp='$d_regcomp'
24577 d_remainder='$d_remainder'
24578 d_remquo='$d_remquo'
24579 d_rename='$d_rename'
24580 d_rewinddir='$d_rewinddir'
24584 d_safebcpy='$d_safebcpy'
24585 d_safemcpy='$d_safemcpy'
24586 d_sanemcmp='$d_sanemcmp'
24587 d_sbrkproto='$d_sbrkproto'
24588 d_scalbn='$d_scalbn'
24589 d_scalbnl='$d_scalbnl'
24590 d_sched_yield='$d_sched_yield'
24591 d_scm_rights='$d_scm_rights'
24592 d_seekdir='$d_seekdir'
24593 d_select='$d_select'
24595 d_semctl='$d_semctl'
24596 d_semctl_semid_ds='$d_semctl_semid_ds'
24597 d_semctl_semun='$d_semctl_semun'
24598 d_semget='$d_semget'
24600 d_sendmsg='$d_sendmsg'
24601 d_setegid='$d_setegid'
24602 d_seteuid='$d_seteuid'
24603 d_setgrent='$d_setgrent'
24604 d_setgrent_r='$d_setgrent_r'
24605 d_setgrps='$d_setgrps'
24606 d_sethent='$d_sethent'
24607 d_sethostent_r='$d_sethostent_r'
24608 d_setitimer='$d_setitimer'
24609 d_setlinebuf='$d_setlinebuf'
24610 d_setlocale='$d_setlocale'
24611 d_setlocale_r='$d_setlocale_r'
24612 d_setnent='$d_setnent'
24613 d_setnetent_r='$d_setnetent_r'
24614 d_setpent='$d_setpent'
24615 d_setpgid='$d_setpgid'
24616 d_setpgrp2='$d_setpgrp2'
24617 d_setpgrp='$d_setpgrp'
24618 d_setprior='$d_setprior'
24619 d_setproctitle='$d_setproctitle'
24620 d_setprotoent_r='$d_setprotoent_r'
24621 d_setpwent='$d_setpwent'
24622 d_setpwent_r='$d_setpwent_r'
24623 d_setregid='$d_setregid'
24624 d_setresgid='$d_setresgid'
24625 d_setresuid='$d_setresuid'
24626 d_setreuid='$d_setreuid'
24627 d_setrgid='$d_setrgid'
24628 d_setruid='$d_setruid'
24629 d_setsent='$d_setsent'
24630 d_setservent_r='$d_setservent_r'
24631 d_setsid='$d_setsid'
24632 d_setvbuf='$d_setvbuf'
24635 d_shmatprototype='$d_shmatprototype'
24636 d_shmctl='$d_shmctl'
24638 d_shmget='$d_shmget'
24639 d_sigaction='$d_sigaction'
24640 d_siginfo_si_addr='$d_siginfo_si_addr'
24641 d_siginfo_si_band='$d_siginfo_si_band'
24642 d_siginfo_si_errno='$d_siginfo_si_errno'
24643 d_siginfo_si_fd='$d_siginfo_si_fd'
24644 d_siginfo_si_pid='$d_siginfo_si_pid'
24645 d_siginfo_si_status='$d_siginfo_si_status'
24646 d_siginfo_si_uid='$d_siginfo_si_uid'
24647 d_siginfo_si_value='$d_siginfo_si_value'
24648 d_signbit='$d_signbit'
24649 d_sigprocmask='$d_sigprocmask'
24650 d_sigsetjmp='$d_sigsetjmp'
24651 d_sin6_scope_id='$d_sin6_scope_id'
24652 d_sitearch='$d_sitearch'
24653 d_snprintf='$d_snprintf'
24654 d_sockaddr_in6='$d_sockaddr_in6'
24655 d_sockaddr_sa_len='$d_sockaddr_sa_len'
24656 d_sockatmark='$d_sockatmark'
24657 d_sockatmarkproto='$d_sockatmarkproto'
24658 d_socket='$d_socket'
24659 d_socklen_t='$d_socklen_t'
24660 d_sockpair='$d_sockpair'
24661 d_socks5_init='$d_socks5_init'
24662 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
24664 d_srand48_r='$d_srand48_r'
24665 d_srandom_r='$d_srandom_r'
24666 d_sresgproto='$d_sresgproto'
24667 d_sresuproto='$d_sresuproto'
24669 d_statblks='$d_statblks'
24670 d_statfs_f_flags='$d_statfs_f_flags'
24671 d_statfs_s='$d_statfs_s'
24672 d_static_inline='$d_static_inline'
24673 d_statvfs='$d_statvfs'
24674 d_stdio_cnt_lval='$d_stdio_cnt_lval'
24675 d_stdio_ptr_lval='$d_stdio_ptr_lval'
24676 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
24677 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
24678 d_stdio_stream_array='$d_stdio_stream_array'
24679 d_stdiobase='$d_stdiobase'
24680 d_stdstdio='$d_stdstdio'
24681 d_strchr='$d_strchr'
24682 d_strcoll='$d_strcoll'
24683 d_strctcpy='$d_strctcpy'
24684 d_strerrm='$d_strerrm'
24685 d_strerror='$d_strerror'
24686 d_strerror_l='$d_strerror_l'
24687 d_strerror_r='$d_strerror_r'
24688 d_strftime='$d_strftime'
24689 d_strlcat='$d_strlcat'
24690 d_strlcpy='$d_strlcpy'
24691 d_strtod='$d_strtod'
24692 d_strtol='$d_strtol'
24693 d_strtold='$d_strtold'
24694 d_strtoll='$d_strtoll'
24695 d_strtoq='$d_strtoq'
24696 d_strtoul='$d_strtoul'
24697 d_strtoull='$d_strtoull'
24698 d_strtouq='$d_strtouq'
24699 d_strxfrm='$d_strxfrm'
24700 d_suidsafe='$d_suidsafe'
24701 d_symlink='$d_symlink'
24702 d_syscall='$d_syscall'
24703 d_syscallproto='$d_syscallproto'
24704 d_sysconf='$d_sysconf'
24705 d_sysernlst='$d_sysernlst'
24706 d_syserrlst='$d_syserrlst'
24707 d_system='$d_system'
24708 d_tcgetpgrp='$d_tcgetpgrp'
24709 d_tcsetpgrp='$d_tcsetpgrp'
24710 d_telldir='$d_telldir'
24711 d_telldirproto='$d_telldirproto'
24712 d_tgamma='$d_tgamma'
24714 d_timegm='$d_timegm'
24716 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
24717 d_tm_tm_zone='$d_tm_tm_zone'
24718 d_tmpnam_r='$d_tmpnam_r'
24720 d_truncate='$d_truncate'
24721 d_truncl='$d_truncl'
24722 d_ttyname_r='$d_ttyname_r'
24723 d_tzname='$d_tzname'
24724 d_u32align='$d_u32align'
24725 d_ualarm='$d_ualarm'
24728 d_union_semun='$d_union_semun'
24729 d_unordered='$d_unordered'
24730 d_unsetenv='$d_unsetenv'
24731 d_uselocale='$d_uselocale'
24732 d_usleep='$d_usleep'
24733 d_usleepproto='$d_usleepproto'
24735 d_vendorarch='$d_vendorarch'
24736 d_vendorbin='$d_vendorbin'
24737 d_vendorlib='$d_vendorlib'
24738 d_vendorscript='$d_vendorscript'
24740 d_void_closedir='$d_void_closedir'
24741 d_voidsig='$d_voidsig'
24742 d_voidtty='$d_voidtty'
24743 d_volatile='$d_volatile'
24744 d_vprintf='$d_vprintf'
24745 d_vsnprintf='$d_vsnprintf'
24747 d_waitpid='$d_waitpid'
24748 d_wcscmp='$d_wcscmp'
24749 d_wcstombs='$d_wcstombs'
24750 d_wcsxfrm='$d_wcsxfrm'
24751 d_wctomb='$d_wctomb'
24752 d_writev='$d_writev'
24755 db_hashtype='$db_hashtype'
24756 db_prefixtype='$db_prefixtype'
24757 db_version_major='$db_version_major'
24758 db_version_minor='$db_version_minor'
24759 db_version_patch='$db_version_patch'
24760 direntrytype='$direntrytype'
24763 doubleinfbytes='$doubleinfbytes'
24764 doublekind='$doublekind'
24765 doublemantbits='$doublemantbits'
24766 doublenanbytes='$doublenanbytes'
24767 doublesize='$doublesize'
24769 drand48_r_proto='$drand48_r_proto'
24771 dtraceobject='$dtraceobject'
24772 dynamic_ext='$dynamic_ext'
24778 endgrent_r_proto='$endgrent_r_proto'
24779 endhostent_r_proto='$endhostent_r_proto'
24780 endnetent_r_proto='$endnetent_r_proto'
24781 endprotoent_r_proto='$endprotoent_r_proto'
24782 endpwent_r_proto='$endpwent_r_proto'
24783 endservent_r_proto='$endservent_r_proto'
24784 eunicefix='$eunicefix'
24787 extensions='$extensions'
24788 extern_C='$extern_C'
24790 fflushNULL='$fflushNULL'
24791 fflushall='$fflushall'
24793 firstmakefile='$firstmakefile'
24795 fpossize='$fpossize'
24796 fpostype='$fpostype'
24797 freetype='$freetype'
24800 full_csh='$full_csh'
24801 full_sed='$full_sed'
24802 gccansipedantic='$gccansipedantic'
24803 gccosandvers='$gccosandvers'
24804 gccversion='$gccversion'
24805 getgrent_r_proto='$getgrent_r_proto'
24806 getgrgid_r_proto='$getgrgid_r_proto'
24807 getgrnam_r_proto='$getgrnam_r_proto'
24808 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
24809 gethostbyname_r_proto='$gethostbyname_r_proto'
24810 gethostent_r_proto='$gethostent_r_proto'
24811 getlogin_r_proto='$getlogin_r_proto'
24812 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
24813 getnetbyname_r_proto='$getnetbyname_r_proto'
24814 getnetent_r_proto='$getnetent_r_proto'
24815 getprotobyname_r_proto='$getprotobyname_r_proto'
24816 getprotobynumber_r_proto='$getprotobynumber_r_proto'
24817 getprotoent_r_proto='$getprotoent_r_proto'
24818 getpwent_r_proto='$getpwent_r_proto'
24819 getpwnam_r_proto='$getpwnam_r_proto'
24820 getpwuid_r_proto='$getpwuid_r_proto'
24821 getservbyname_r_proto='$getservbyname_r_proto'
24822 getservbyport_r_proto='$getservbyport_r_proto'
24823 getservent_r_proto='$getservent_r_proto'
24824 getspnam_r_proto='$getspnam_r_proto'
24825 gidformat='$gidformat'
24831 gmtime_r_proto='$gmtime_r_proto'
24832 gnulibc_version='$gnulibc_version'
24834 groupcat='$groupcat'
24835 groupstype='$groupstype'
24838 h_sysfile='$h_sysfile'
24841 hostgenerate='$hostgenerate'
24842 hostosname='$hostosname'
24843 hostperl='$hostperl'
24844 html1dir='$html1dir'
24845 html1direxp='$html1direxp'
24846 html3dir='$html3dir'
24847 html3direxp='$html3direxp'
24856 i_arpainet='$i_arpainet'
24857 i_assert='$i_assert'
24859 i_bsdioctl='$i_bsdioctl'
24863 i_dirent='$i_dirent'
24865 i_execinfo='$i_execinfo'
24870 i_fp_class='$i_fp_class'
24872 i_gdbm_ndbm='$i_gdbm_ndbm'
24873 i_gdbmndbm='$i_gdbmndbm'
24875 i_ieeefp='$i_ieeefp'
24876 i_inttypes='$i_inttypes'
24877 i_langinfo='$i_langinfo'
24878 i_libutil='$i_libutil'
24879 i_limits='$i_limits'
24880 i_locale='$i_locale'
24881 i_machcthr='$i_machcthr'
24882 i_malloc='$i_malloc'
24883 i_mallocmalloc='$i_mallocmalloc'
24885 i_memory='$i_memory'
24886 i_mntent='$i_mntent'
24889 i_neterrno='$i_neterrno'
24890 i_netinettcp='$i_netinettcp'
24894 i_pthread='$i_pthread'
24896 i_quadmath='$i_quadmath'
24897 i_rpcsvcdbm='$i_rpcsvcdbm'
24899 i_shadow='$i_shadow'
24901 i_stdarg='$i_stdarg'
24902 i_stdbool='$i_stdbool'
24903 i_stddef='$i_stddef'
24904 i_stdint='$i_stdint'
24905 i_stdlib='$i_stdlib'
24906 i_string='$i_string'
24907 i_sunmath='$i_sunmath'
24908 i_sysaccess='$i_sysaccess'
24909 i_sysdir='$i_sysdir'
24910 i_sysfile='$i_sysfile'
24911 i_sysfilio='$i_sysfilio'
24913 i_sysioctl='$i_sysioctl'
24914 i_syslog='$i_syslog'
24915 i_sysmman='$i_sysmman'
24916 i_sysmode='$i_sysmode'
24917 i_sysmount='$i_sysmount'
24918 i_sysndir='$i_sysndir'
24919 i_sysparam='$i_sysparam'
24920 i_syspoll='$i_syspoll'
24921 i_sysresrc='$i_sysresrc'
24922 i_syssecrt='$i_syssecrt'
24923 i_sysselct='$i_sysselct'
24924 i_syssockio='$i_syssockio'
24925 i_sysstat='$i_sysstat'
24926 i_sysstatfs='$i_sysstatfs'
24927 i_sysstatvfs='$i_sysstatvfs'
24928 i_systime='$i_systime'
24929 i_systimek='$i_systimek'
24930 i_systimes='$i_systimes'
24931 i_systypes='$i_systypes'
24932 i_sysuio='$i_sysuio'
24934 i_sysutsname='$i_sysutsname'
24935 i_sysvfs='$i_sysvfs'
24936 i_syswait='$i_syswait'
24937 i_termio='$i_termio'
24938 i_termios='$i_termios'
24940 i_unistd='$i_unistd'
24943 i_values='$i_values'
24944 i_varargs='$i_varargs'
24945 i_varhdr='$i_varhdr'
24947 i_xlocale='$i_xlocale'
24948 ignore_versioned_solibs='$ignore_versioned_solibs'
24949 inc_version_list='$inc_version_list'
24950 inc_version_list_init='$inc_version_list_init'
24954 initialinstalllocation='$initialinstalllocation'
24955 installarchlib='$installarchlib'
24956 installbin='$installbin'
24957 installhtml1dir='$installhtml1dir'
24958 installhtml3dir='$installhtml3dir'
24959 installman1dir='$installman1dir'
24960 installman3dir='$installman3dir'
24961 installprefix='$installprefix'
24962 installprefixexp='$installprefixexp'
24963 installprivlib='$installprivlib'
24964 installscript='$installscript'
24965 installsitearch='$installsitearch'
24966 installsitebin='$installsitebin'
24967 installsitehtml1dir='$installsitehtml1dir'
24968 installsitehtml3dir='$installsitehtml3dir'
24969 installsitelib='$installsitelib'
24970 installsiteman1dir='$installsiteman1dir'
24971 installsiteman3dir='$installsiteman3dir'
24972 installsitescript='$installsitescript'
24973 installstyle='$installstyle'
24974 installusrbinperl='$installusrbinperl'
24975 installvendorarch='$installvendorarch'
24976 installvendorbin='$installvendorbin'
24977 installvendorhtml1dir='$installvendorhtml1dir'
24978 installvendorhtml3dir='$installvendorhtml3dir'
24979 installvendorlib='$installvendorlib'
24980 installvendorman1dir='$installvendorman1dir'
24981 installvendorman3dir='$installvendorman3dir'
24982 installvendorscript='$installvendorscript'
24984 issymlink='$issymlink'
24985 ivdformat='$ivdformat'
24988 known_extensions='$known_extensions'
24991 ld_can_script='$ld_can_script'
24992 lddlflags='$lddlflags'
24994 ldflags_uselargefiles='$ldflags_uselargefiles'
24995 ldlibpthname='$ldlibpthname'
25002 libsdirs='$libsdirs'
25003 libsfiles='$libsfiles'
25004 libsfound='$libsfound'
25005 libspath='$libspath'
25006 libswanted='$libswanted'
25007 libswanted_uselargefiles='$libswanted_uselargefiles'
25013 localtime_r_proto='$localtime_r_proto'
25014 locincpth='$locincpth'
25015 loclibpth='$loclibpth'
25016 longdblinfbytes='$longdblinfbytes'
25017 longdblkind='$longdblkind'
25018 longdblmantbits='$longdblmantbits'
25019 longdblnanbytes='$longdblnanbytes'
25020 longdblsize='$longdblsize'
25021 longlongsize='$longlongsize'
25022 longsize='$longsize'
25026 lseeksize='$lseeksize'
25027 lseektype='$lseektype'
25031 make_set_make='$make_set_make'
25032 mallocobj='$mallocobj'
25033 mallocsrc='$mallocsrc'
25034 malloctype='$malloctype'
25036 man1direxp='$man1direxp'
25039 man3direxp='$man3direxp'
25041 mips_type='$mips_type'
25042 mistrustnm='$mistrustnm'
25044 mmaptype='$mmaptype'
25045 modetype='$modetype'
25047 multiarch='$multiarch'
25049 myarchname='$myarchname'
25050 mydomain='$mydomain'
25051 myhostname='$myhostname'
25054 need_va_copy='$need_va_copy'
25055 netdb_hlen_type='$netdb_hlen_type'
25056 netdb_host_type='$netdb_host_type'
25057 netdb_name_type='$netdb_name_type'
25058 netdb_net_type='$netdb_net_type'
25061 nm_so_opt='$nm_so_opt'
25062 nonxs_ext='$nonxs_ext'
25064 nvEUformat='$nvEUformat'
25065 nvFUformat='$nvFUformat'
25066 nvGUformat='$nvGUformat'
25067 nv_overflows_integers_at='$nv_overflows_integers_at'
25068 nv_preserves_uv_bits='$nv_preserves_uv_bits'
25069 nveformat='$nveformat'
25070 nvfformat='$nvfformat'
25071 nvgformat='$nvgformat'
25072 nvmantbits='$nvmantbits'
25075 o_nonblock='$o_nonblock'
25077 old_pthread_create_joinable='$old_pthread_create_joinable'
25078 optimize='$optimize'
25079 orderlib='$orderlib'
25082 otherlibdirs='$otherlibdirs'
25086 patchlevel='$patchlevel'
25087 path_sep='$path_sep'
25090 perl_patchlevel='$perl_patchlevel'
25091 perl_static_inline='$perl_static_inline'
25092 perladmin='$perladmin'
25093 perllibs='$perllibs'
25094 perlpath='$perlpath'
25096 phostname='$phostname'
25102 prefixexp='$prefixexp'
25104 privlibexp='$privlibexp'
25105 procselfexe='$procselfexe'
25106 prototype='$prototype'
25108 quadkind='$quadkind'
25109 quadtype='$quadtype'
25110 randbits='$randbits'
25111 randfunc='$randfunc'
25112 random_r_proto='$random_r_proto'
25113 randseedtype='$randseedtype'
25115 rd_nodata='$rd_nodata'
25116 readdir64_r_proto='$readdir64_r_proto'
25117 readdir_r_proto='$readdir_r_proto'
25118 revision='$revision'
25124 sGMTIME_max='$sGMTIME_max'
25125 sGMTIME_min='$sGMTIME_min'
25126 sLOCALTIME_max='$sLOCALTIME_max'
25127 sLOCALTIME_min='$sLOCALTIME_min'
25128 sPRIEUldbl='$sPRIEUldbl'
25129 sPRIFUldbl='$sPRIFUldbl'
25130 sPRIGUldbl='$sPRIGUldbl'
25131 sPRIXU64='$sPRIXU64'
25133 sPRIeldbl='$sPRIeldbl'
25134 sPRIfldbl='$sPRIfldbl'
25135 sPRIgldbl='$sPRIgldbl'
25140 sSCNfldbl='$sSCNfldbl'
25141 sched_yield='$sched_yield'
25142 scriptdir='$scriptdir'
25143 scriptdirexp='$scriptdirexp'
25145 seedfunc='$seedfunc'
25146 selectminbits='$selectminbits'
25147 selecttype='$selecttype'
25148 sendmail='$sendmail'
25149 setgrent_r_proto='$setgrent_r_proto'
25150 sethostent_r_proto='$sethostent_r_proto'
25151 setlocale_r_proto='$setlocale_r_proto'
25152 setnetent_r_proto='$setnetent_r_proto'
25153 setprotoent_r_proto='$setprotoent_r_proto'
25154 setpwent_r_proto='$setpwent_r_proto'
25155 setservent_r_proto='$setservent_r_proto'
25158 sharpbang='$sharpbang'
25159 shmattype='$shmattype'
25160 shortsize='$shortsize'
25163 sig_count='$sig_count'
25164 sig_name='$sig_name'
25165 sig_name_init='$sig_name_init'
25167 sig_num_init='$sig_num_init'
25168 sig_size='$sig_size'
25169 signal_t='$signal_t'
25170 sitearch='$sitearch'
25171 sitearchexp='$sitearchexp'
25173 sitebinexp='$sitebinexp'
25174 sitehtml1dir='$sitehtml1dir'
25175 sitehtml1direxp='$sitehtml1direxp'
25176 sitehtml3dir='$sitehtml3dir'
25177 sitehtml3direxp='$sitehtml3direxp'
25179 sitelib_stem='$sitelib_stem'
25180 sitelibexp='$sitelibexp'
25181 siteman1dir='$siteman1dir'
25182 siteman1direxp='$siteman1direxp'
25183 siteman3dir='$siteman3dir'
25184 siteman3direxp='$siteman3direxp'
25185 siteprefix='$siteprefix'
25186 siteprefixexp='$siteprefixexp'
25187 sitescript='$sitescript'
25188 sitescriptexp='$sitescriptexp'
25189 sizesize='$sizesize'
25190 sizetype='$sizetype'
25194 sockethdr='$sockethdr'
25195 socketlib='$socketlib'
25196 socksizetype='$socksizetype'
25198 spackage='$spackage'
25199 spitshell='$spitshell'
25200 srand48_r_proto='$srand48_r_proto'
25201 srandom_r_proto='$srandom_r_proto'
25203 ssizetype='$ssizetype'
25204 st_ino_sign='$st_ino_sign'
25205 st_ino_size='$st_ino_size'
25206 startperl='$startperl'
25208 static_ext='$static_ext'
25210 stdio_base='$stdio_base'
25211 stdio_bufsiz='$stdio_bufsiz'
25212 stdio_cnt='$stdio_cnt'
25213 stdio_filbuf='$stdio_filbuf'
25214 stdio_ptr='$stdio_ptr'
25215 stdio_stream_array='$stdio_stream_array'
25216 strerror_r_proto='$strerror_r_proto'
25219 subversion='$subversion'
25224 targetarch='$targetarch'
25225 targetdir='$targetdir'
25226 targetenv='$targetenv'
25227 targethost='$targethost'
25228 targetmkdir='$targetmkdir'
25229 targetport='$targetport'
25230 targetsh='$targetsh'
25234 timeincl='$timeincl'
25235 timetype='$timetype'
25236 tmpnam_r_proto='$tmpnam_r_proto'
25242 ttyname_r_proto='$ttyname_r_proto'
25251 uidformat='$uidformat'
25257 uquadtype='$uquadtype'
25258 use5005threads='$use5005threads'
25259 use64bitall='$use64bitall'
25260 use64bitint='$use64bitint'
25261 usecbacktrace='$usecbacktrace'
25262 usecrosscompile='$usecrosscompile'
25263 usedevel='$usedevel'
25265 usedtrace='$usedtrace'
25266 usefaststdio='$usefaststdio'
25267 useithreads='$useithreads'
25268 usekernprocpathname='$usekernprocpathname'
25269 uselargefiles='$uselargefiles'
25270 uselongdouble='$uselongdouble'
25271 usemallocwrap='$usemallocwrap'
25272 usemorebits='$usemorebits'
25273 usemultiplicity='$usemultiplicity'
25274 usemymalloc='$usemymalloc'
25276 usensgetexecutablepath='$usensgetexecutablepath'
25277 useopcode='$useopcode'
25278 useperlio='$useperlio'
25279 useposix='$useposix'
25280 usequadmath='$usequadmath'
25281 usereentrant='$usereentrant'
25282 userelocatableinc='$userelocatableinc'
25283 useshrplib='$useshrplib'
25284 usesitecustomize='$usesitecustomize'
25285 usesocks='$usesocks'
25286 usethreads='$usethreads'
25287 usevendorprefix='$usevendorprefix'
25288 useversionedarchname='$useversionedarchname'
25289 usevfork='$usevfork'
25292 uvXUformat='$uvXUformat'
25293 uvoformat='$uvoformat'
25296 uvuformat='$uvuformat'
25297 uvxformat='$uvxformat'
25299 vendorarch='$vendorarch'
25300 vendorarchexp='$vendorarchexp'
25301 vendorbin='$vendorbin'
25302 vendorbinexp='$vendorbinexp'
25303 vendorhtml1dir='$vendorhtml1dir'
25304 vendorhtml1direxp='$vendorhtml1direxp'
25305 vendorhtml3dir='$vendorhtml3dir'
25306 vendorhtml3direxp='$vendorhtml3direxp'
25307 vendorlib='$vendorlib'
25308 vendorlib_stem='$vendorlib_stem'
25309 vendorlibexp='$vendorlibexp'
25310 vendorman1dir='$vendorman1dir'
25311 vendorman1direxp='$vendorman1direxp'
25312 vendorman3dir='$vendorman3dir'
25313 vendorman3direxp='$vendorman3direxp'
25314 vendorprefix='$vendorprefix'
25315 vendorprefixexp='$vendorprefixexp'
25316 vendorscript='$vendorscript'
25317 vendorscriptexp='$vendorscriptexp'
25319 version_patchlevel_string='$version_patchlevel_string'
25320 versiononly='$versiononly'
25324 yaccflags='$yaccflags'
25329 : add special variables
25330 $test -f $src/patchlevel.h && \
25331 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
25332 echo "PERL_PATCHLEVEL='$perl_patchlevel'" >>config.sh
25333 echo "PERL_CONFIG_SH=true" >>config.sh
25335 : propagate old symbols
25336 if $test -f UU/config.sh; then
25337 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
25338 $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \
25339 config.sh config.sh UU/oldconfig.sh |\
25340 $sort | $uniq -u >UU/oldsyms
25341 set X `$cat UU/oldsyms`
25347 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
25349 echo ": Variables propagated from previous config.sh file." >>config.sh
25350 for sym in `$cat UU/oldsyms`; do
25351 echo " Propagating $hint variable "'$'"$sym..."
25352 eval 'tmp="$'"${sym}"'"'
25354 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
25360 : preserve RCS keywords in files with variable substitution, grrr
25363 : Finish up by extracting the .SH files
25366 echo "Stopping at your request, leaving temporary files around."
25376 If you'd like to make any changes to the config.sh file before I begin
25377 to configure things, do it as a shell escape now (e.g. !vi config.sh).
25380 rp="Press return or use a shell escape to edit config.sh:"
25385 *) : in case they cannot read
25386 sh 1>&4 -c "$ans";;
25391 : if this fails, just run all the .SH files by hand
25400 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
25407 Now you need to generate make dependencies by running "$make depend".
25408 You might prefer to run it in background: "$make depend > makedepend.out &"
25409 It can take a while, so you might not want to run it right now.
25414 rp="Run $make depend now?"
25418 $make depend && echo "Now you must run '$make'."
25421 echo "You must run '$make depend' then '$make'."
25424 elif test -f [Mm]akefile; then
25426 echo "Now you must run a $make."
25428 echo "Configure done."
25431 if $test -f Policy.sh; then
25434 If you compile $package on a different machine or from a different object
25435 directory, copy the Policy.sh file from this object directory to the
25436 new one before you run Configure -- this will help you with most of
25437 the policy defaults.
25441 if $test -f UU/config.msg; then
25442 echo "Hmm. I also noted the following information while running:"
25444 $cat UU/config.msg >&4
25446 $rm -f kit*isdone ark*isdone