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 should use metaconfig. Perl uses a modified version of this
17 # tool, and this, together with the metaconfig units, are available
18 # in the git repository:
19 # $ git clone https://github.com/perl5-metaconfig/metaconfig metaconfig
20 # The original dist package (including metaconfig) is available on github:
21 # $ git clone https://github.com/rmanfredi/dist.git dist-git
23 # Though this script was generated by metaconfig from metaunits, it is
24 # OK to send patches against Configure itself (but not to commit them
25 # to blead). It's up to
26 # the Configure maintainers to backport the patch to the metaunits if it
27 # is accepted. Exceptions to this rule, and more information, is in
28 # Porting/pumpkin.pod.
30 # Generated using [metaconfig 3.5 PL0]
31 # (with additional metaconfig patches by perlbug@perl.org)
36 SCO csh still thinks true is false. Write to SCO today and tell them that next
37 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
39 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
40 we'd have to do is go in and swap the && and || tokens, wherever they are.)
42 [End of diatribe. We now return you to your regularly scheduled programming...]
46 OOPS! You naughty creature! You didn't run Configure with sh!
47 I will attempt to remedy the situation by running sh for you...
51 true || exec sh $0 $argv:q
53 (exit $?0) || cat c2$$
54 (exit $?0) || exec sh $0 $argv:q
57 if test -f /dev/cputype -a -f /dev/drivers -a -f /dev/osversion; then
60 *** I'm sorry but this system looks like Plan 9 and Plan 9 doesn't do
61 *** Configure that well. (Plan 9 is close to UNIX but not close enough.)
62 *** Please read the README.plan9 for further instructions.
63 *** Cannot continue, aborting.
69 if test -f /sys/utilities/MultiView ; then
70 # AmigaOS, test -c for /dev/null is not useful
72 elif test ! -c /dev/null ; then
75 *** I'm sorry, but /dev/null appears to be a file rather than a device.
76 *** Please consult your operating sytem's notes for making a device
78 *** Cannot continue, aborting.
84 : compute my invocation name
88 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
93 : Proper separator for the PATH environment variable
95 : On OS/2 this directory should exist if this is not floppy only system ":-]"
96 if test -d c:/. || ( uname -a | grep -i 'os\(/\|\)2' 2>&1 ) 2>&1 >/dev/null ; then
97 if test -n "$OS2_SHELL"; then
99 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
100 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
102 elif test -n "$DJGPP"; then
103 case "X${MACHTYPE:-nonesuchmach}" in
110 : Proper PATH setting
111 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
112 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
113 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
114 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
115 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
116 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /opt/ansic/bin /usr/ccs/bin"
117 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
118 paths="$paths /sbin /usr/sbin /usr/libexec"
119 paths="$paths /system/gnu_library/bin"
123 case "$p_$PATH$p_" in
125 *) test -d $p && PATH=$PATH$p_$p ;;
132 : shall we be using ksh?
138 if (PATH=.; alias -x) >/dev/null 2>&1; then
141 if test -f /hp-ux -a -f /bin/ksh; then
142 needksh='to avoid sh bug in "here document" expansion'
144 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
145 if test X`/usr/bin/uname -v` = X4; then
146 avoidksh="to avoid AIX 4's /bin/sh"
150 if test -f /osf_boot -a -f /usr/sbin/setld; then
151 if test X`/usr/bin/uname -s` = XOSF1; then
152 avoidksh="to avoid Digital UNIX' ksh"
157 case "$inksh/$needksh" in
164 case "$inksh/$avoidksh" in
170 case "$inksh/$needksh-$avoidksh-" in
173 (I see you are using the Korn shell. Some ksh's blow up on $me,
174 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
181 echo "(Feeding myself to $newsh $reason.)"
183 Configure|*/Configure) exec $newsh $0 "$@";;
184 *) exec $newsh Configure "$@";;
188 test -x "${newsh}" || unset newsh
190 : if needed, set CDPATH to a harmless value that is not chatty
191 : avoid bash 2.02 problems with empty CDPATH.
195 *bash*) CDPATH='.' ;;
201 : Configure runs within the UU subdirectory
202 test -d UU || mkdir UU
345 useversionedarchname=''
351 initialinstalllocation=''
384 d_attribute_deprecated=''
385 d_attribute_format=''
386 d_attribute_malloc=''
387 d_attribute_nonnull=''
388 d_attribute_noreturn=''
390 d_attribute_unused=''
391 d_attribute_warn_unused_result=''
392 d_printf_format_null=''
394 d_builtin_choose_expr=''
396 d_builtin_add_overflow=''
397 d_builtin_mul_overflow=''
398 d_builtin_sub_overflow=''
399 d_c99_variadic_macros=''
449 endhostent_r_proto=''
455 endprotoent_r_proto=''
461 endservent_r_proto=''
533 gethostbyaddr_r_proto=''
535 gethostbyname_r_proto=''
537 gethostent_r_proto=''
550 getnetbyaddr_r_proto=''
552 getnetbyname_r_proto=''
566 d_getprotobyname_r=''
567 getprotobyname_r_proto=''
568 d_getprotobynumber_r=''
569 getprotobynumber_r_proto=''
571 getprotoent_r_proto=''
583 getservbyname_r_proto=''
585 getservbyport_r_proto=''
587 getservent_r_proto=''
620 d_lc_monetary_2008=''
625 d_libm_lib_version=''
633 d_localtime_r_needs_tzset=''
641 d_long_double_style_ieee=''
642 d_long_double_style_ieee_doubledouble=''
643 d_long_double_style_ieee_extended=''
644 d_long_double_style_ieee_std=''
645 d_long_double_style_vax=''
658 d_malloc_good_size=''
699 d_thread_safe_nl_langinfo_l=''
713 d_old_pthread_create_joinable=''
714 old_pthread_create_joinable=''
716 d_pthread_attr_setscope=''
761 sethostent_r_proto=''
778 setprotoent_r_proto=''
790 setservent_r_proto=''
803 d_siginfo_si_errno=''
806 d_siginfo_si_status=''
808 d_siginfo_si_value=''
820 d_ipv6_mreq_source=''
849 perl_static_inline=''
854 d_stdio_ptr_lval_nochange_cnt=''
855 d_stdio_ptr_lval_sets_cnt=''
934 default_inc_excludes_dot=''
1000 d_gdbm_ndbm_h_uses_prototypes=''
1001 d_gdbmndbm_h_uses_prototypes=''
1003 d_ndbm_h_uses_prototypes=''
1073 d_inc_version_list=''
1075 inc_version_list_init=''
1083 installusrbinperl=''
1099 ignore_versioned_solibs=''
1115 d_double_has_negative_zero=''
1116 d_double_has_subnormals=''
1117 d_double_style_cray=''
1118 d_double_style_ibm=''
1119 d_double_style_ieee=''
1120 d_double_style_vax=''
1171 d_perl_otherlibdirs=''
1179 api_versionstring=''
1185 version_patchlevel_string=''
1189 d_nv_preserves_uv=''
1190 d_nv_zero_is_allbits_zero=''
1201 nv_overflows_integers_at=''
1202 nv_preserves_uv_bits=''
1274 installsitehtml1dir=''
1277 installsitehtml3dir=''
1284 installsiteman1dir=''
1287 installsiteman3dir=''
1292 installsitescript=''
1310 d_stdio_stream_array=''
1311 stdio_stream_array=''
1329 usekernprocpathname=''
1330 ccflags_uselargefiles=''
1331 ldflags_uselargefiles=''
1332 libswanted_uselargefiles=''
1341 usensgetexecutablepath=''
1354 installvendorarch=''
1361 installvendorhtml1dir=''
1363 vendorhtml1direxp=''
1364 installvendorhtml3dir=''
1366 vendorhtml3direxp=''
1372 installvendorman1dir=''
1375 installvendorman3dir=''
1382 installvendorscript=''
1393 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1396 : We must find out about Eunice early
1398 if test -f /etc/unixtovms; then
1399 eunicefix=/etc/unixtovms
1401 if test -f /etc/unixtovms.exe; then
1402 eunicefix=/etc/unixtovms.exe
1405 : Set executable suffix now -- needed before hints available
1406 if test -f "/libs/version.library"; then
1409 elif test -f "/system/gnu_library/bin/ar.pm"; then
1412 elif test -n "$DJGPP"; then
1415 elif test -f /kern/cookiejar; then
1418 elif test -d c:/. -o -n "$is_os2" ; then
1425 : Possible local include directories to search.
1426 : Set locincpth to "" in a hint file to defeat local include searches.
1427 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1428 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1430 : no include file wanted by default
1433 : Enable -DEBUGGING and -DDEBUGGING from the command line
1437 : Trailing extension. Override this in a hint file, if needed.
1438 : Extra object files, if any, needed on this platform.
1441 : change the next line if compiling for Xenix/286 on Xenix/386
1442 xlibpth='/usr/lib/386 /lib/386'
1443 : Possible local library directories to search.
1444 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1445 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1447 : general looking path for locating libraries
1448 glibpth="/lib /usr/lib $xlibpth"
1449 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1450 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1451 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1452 test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
1454 : Private path used by Configure to find libraries. Its value
1455 : is prepended to libpth. This variable takes care of special
1456 : machines, like the mips. Usually, it should be empty.
1459 : default library list
1461 : some systems want to use only the non-versioned libso:s
1462 ignore_versioned_solibs=''
1466 : set useposix=false in your hint file to disable the POSIX extension.
1468 : set useopcode=false in your hint file to disable the Opcode extension.
1471 ccflags_uselargefiles=''
1472 ldflags_uselargefiles=''
1473 libswanted_uselargefiles=''
1474 : set usemultiplicity on the Configure command line to enable multiplicity.
1475 : set usesocks on the Configure command line to enable socks.
1477 : set usethreads on the Configure command line to enable threads.
1478 usereentrant='undef'
1479 : List of libraries we want.
1480 : If anyone needs extra -lxxx, put those in a hint file.
1481 libswanted="cl pthread socket bind inet nsl ndbm gdbm dbm db malloc dl ld"
1482 libswanted="$libswanted sun m crypt sec util c cposix posix ucb bsd BSD"
1483 : We probably want to search /usr/shlib before most other libraries.
1484 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1485 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1486 glibpth="/usr/shlib $glibpth"
1487 : Do not use vfork unless overridden by a hint file.
1490 : Find the basic shell for Bourne shell scripts
1494 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1497 if test -f "$xxx"; then
1500 : Build up a list and do a single loop so we can 'break' out.
1501 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1502 for xxx in sh bash ksh pdksh ash; do
1504 try="$try ${p}/${xxx}"
1508 if test -f "$xxx"; then
1511 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1514 elif test -f "$xxx.exe"; then
1525 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1527 Usually it's in /bin/sh. How did you even get this far?
1528 Please contact me (Perl Maintainers) at perlbug@perl.org and
1529 we'll try to straighten this all out.
1535 : When cross-compiling we need to separate the sh-to-run-Configure-with from the sh-to-use-in-Perl
1536 : default both to the same thing, cross-compilers can then set targetsh differently if they like
1539 : see if sh knows # comments
1540 if `$sh -c '#' >/dev/null 2>&1`; then
1544 test -f $xcat$_exe || xcat=/usr/bin/cat
1545 if test ! -f $xcat$_exe; then
1546 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1547 if test -f $p/cat$_exe; then
1552 if test ! -f $xcat$_exe; then
1553 echo "Can't find cat anywhere!"
1557 echo "#!$xcat" >sharp
1560 ./sharp > today 2>/dev/null
1561 if test -s today; then
1564 echo "#! $xcat" > sharp
1567 ./sharp > today 2>/dev/null
1568 if test -s today; then
1576 echo "Your $sh doesn't grok # comments--I will strip them later on."
1579 echo "exec grep -v '^[ ]*#'" >spitshell
1581 $eunicefix spitshell
1582 spitshell=`pwd`/spitshell
1584 echo "I presume that if # doesn't work, #! won't work either!"
1589 : figure out how to guarantee sh startup
1591 '') startsh=${sharpbang}${sh} ;;
1603 : echo "Yup, it does."
1605 echo "Hmm... '$startsh' does not guarantee sh startup..."
1606 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1610 : Save command line options in file UU/cmdline.opt for later use in
1611 : generating config.sh.
1612 cat > cmdline.opt <<EOSH
1613 : Configure command line arguments.
1622 cat >>cmdline.opt <<EOSH
1623 config_arg$argn='$arg'
1625 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1628 arg_exp=`cat cmdl.opt`
1629 args_exp="$args_exp$args_sep'$arg_exp'"
1630 argn=`expr $argn + 1`
1635 : produce awk script to parse command line options
1636 cat >options.awk <<'EOF'
1638 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1640 len = length(optstr);
1641 for (i = 1; i <= len; i++) {
1642 c = substr(optstr, i, 1);
1643 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1654 if (substr(str, 1, 1) != "-") {
1655 printf("'%s'\n", str);
1659 for (i = 2; i <= len; i++) {
1660 c = substr(str, i, 1);
1662 printf("-%s\n", substr(str, i));
1668 printf("'%s'\n", substr(str, i + 1));
1681 : process the command line options
1682 set X `for arg in "$@"; do echo "X$arg"; done |
1683 sed -e s/X// | awk -f options.awk`
1688 : set up default values
1697 rm -f optdef.sh posthint.sh
1698 cat >optdef.sh <<EOS
1704 while test $# -gt 0; do
1706 -d) shift; fastread=yes;;
1707 -e) shift; alldone=cont;;
1711 if test -r "$1"; then
1714 echo "$me: cannot read config file $1." >&2
1720 -h) shift; error=true;;
1721 -r) shift; reuseval=true;;
1722 -s) shift; silent=true; realsilent=true;;
1723 -E) shift; alldone=exit;;
1724 -K) shift; knowitall=true;;
1726 -S) shift; silent=true; extractsh=true;;
1731 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1732 echo "$me: ignoring -D $1" >&2
1735 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1736 *) echo "$1='define'" >> optdef.sh;;
1743 *=) echo "$1" >> optdef.sh;;
1745 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1746 echo "$me: ignoring -U $1" >&2
1748 *) echo "$1='undef'" >> optdef.sh;;
1759 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1763 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1764 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1770 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1771 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1772 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1773 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1774 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1775 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1781 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1783 echo "$yyy=''" >> posthint.sh ;;
1788 echo "$yyy='$zzz'" >> posthint.sh ;;
1790 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1792 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1797 echo "$yyy=$zzz" >> posthint.sh ;;
1798 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1802 -V) echo "$me generated by metaconfig 3.5 PL0." >&2
1805 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1813 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1814 [-U symbol] [-U symbol=] [-A command:symbol...]
1815 -d : use defaults for all answers.
1816 -e : go on without questioning past the production of config.sh.
1817 -f : specify an alternate default configuration file.
1818 -h : print this help message and exit (with an error status).
1819 -r : reuse C symbols value if possible (skips costly nm extraction).
1820 -s : silent mode, only echoes questions and essential information.
1821 -D : define symbol to have some value:
1822 -D symbol symbol gets the value 'define'
1823 -D symbol=value symbol gets the value 'value'
1824 common used examples (see INSTALL for more info):
1825 -Duse64bitint use 64bit integers
1826 -Duse64bitall use 64bit integers and pointers
1827 -Dusethreads use thread support
1828 -Dinc_version_list=none do not include older perl trees in @INC
1829 -DEBUGGING=none DEBUGGING options
1830 -Dcc=gcc choose your compiler
1831 -Dprefix=/opt/perl5 choose your destination
1832 -E : stop at the end of questions, after having produced config.sh.
1833 -K : do not use unless you know what you are doing.
1834 -O : ignored for backward compatibility
1835 -S : perform variable substitutions on all .SH files (can mix with -f)
1836 -U : undefine symbol:
1837 -U symbol symbol gets the value 'undef'
1838 -U symbol= symbol gets completely empty
1840 -A : manipulate symbol after the platform specific hints have been applied:
1841 -A append:symbol=value append value to symbol
1842 -A symbol=value like append:, but with a separating space
1843 -A define:symbol=value define symbol to have value
1844 -A clear:symbol define symbol to be ''
1845 -A define:symbol define symbol to be 'define'
1846 -A eval:symbol=value define symbol to be eval of value
1847 -A prepend:symbol=value prepend value to symbol
1848 -A undef:symbol define symbol to be 'undef'
1849 -A undef:symbol= define symbol to be ''
1850 e.g.: -A prepend:libswanted='cl pthread '
1851 -A ccflags=-DSOME_MACRO
1852 -V : print version number and exit (with a zero status).
1859 case "$fastread$alldone" in
1862 case "$extractsh" in
1865 if test ! -t 0; then
1866 echo "Say 'sh Configure', not 'sh <Configure'"
1876 true) exec 1>/dev/null;;
1879 : run the defines and the undefines, if any, but leave the file out there...
1881 grep '\\' optdef.sh >/dev/null 2>&1
1882 if test $? = 0; then
1883 echo "Configure does not support \\ in -D arguments"
1887 : create the posthint manipulation script and leave the file out there...
1892 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1893 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1894 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`"-"`echo AbyZ | tr '[:upper:]' '[:lower:]' 2>/dev/null`" in
1895 ABYZ-abyz) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1896 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1899 : Some greps do not return status, grrr.
1900 echo "grimblepritz" >grimble
1901 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1903 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1909 : the following should work in any shell
1913 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1914 cat >contains <<'EOSS'
1915 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1920 : Find the path to the source tree
1923 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1927 *) src=`cd ../$src && pwd` ;;
1940 if test -f $rsrc/Configure && \
1941 $contains "^package='$package'\$" $rsrc/Configure >/dev/null 2>&1
1943 : found it, so we are ok.
1946 for src in . .. ../.. ../../.. ../../../..; do
1947 if test -f ../$src/Configure && \
1948 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1959 Sorry, I can't seem to locate the source dir for $package. Please start
1960 Configure with an explicit path -- i.e. /some/path/Configure.
1968 echo "Sources for $package found in \"$src\"." >&4
1972 : script used to extract .SH files with variable substitutions
1973 cat >extract <<'EOS'
1975 echo "Doing variable substitutions on .SH files..."
1976 if test -f MANIFEST; then
1977 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1979 echo "(Looking for .SH files under the source directory.)"
1980 set x `(cd "$src"; find . -name "*.SH" -print)`
1984 0) set x `(cd "$src"; echo *.SH)`; shift;;
1986 if test ! -f "$src/$1"; then
1992 while test $name; do
1993 if test ! -d "$name"; then
1994 create="$name $create";
1995 name=`echo $name | sed -e "s|^[^/]*$||"`;
1996 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
2001 for file in $create; do
2010 dir=`expr X$file : 'X\(.*\)/'`
2011 file=`expr X$file : 'X.*/\(.*\)'`
2012 (cd "$dir" && . ./$file)
2022 dir=`expr X$file : 'X\(.*\)/'`
2023 file=`expr X$file : 'X.*/\(.*\)'`
2024 (set x $dir; shift; eval $mkdir_p)
2025 sh <"$src/$dir/$file"
2034 if test -f "$src/config_h.SH"; then
2035 if test ! -f config.h; then
2036 : oops, they left it out of MANIFEST, probably, so do it anyway.
2037 . "$src/config_h.SH"
2042 : extract files and exit if asked to do so
2043 case "$extractsh" in
2045 case "$realsilent" in
2049 case "$config_sh" in
2050 '') config_sh='config.sh';;
2053 echo "Fetching answers from $config_sh..."
2060 echo "Extraction done."
2065 : Eunice requires " " instead of "", can you believe it
2068 echo "Beginning of configuration questions for $package."
2070 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
2072 : first determine how to suppress newline on echo command
2074 echo "Checking echo to see how to suppress newlines..."
2075 (echo "hi there\c" ; echo " ") >.echotmp
2076 if $contains c .echotmp >/dev/null 2>&1 ; then
2087 echo $n "The star should be here-->$c"
2091 : Now test for existence of everything in MANIFEST
2093 if test -f "$rsrc/MANIFEST"; then
2094 echo "First let's make sure your kit is complete. Checking..." >&4
2095 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | \
2096 (split -l 50 2>/dev/null || split -50)
2099 for filelist in x??; do
2100 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` \
2101 >/dev/null 2>>"$tmppwd/missing")
2103 if test -s missing; then
2107 THIS PACKAGE SEEMS TO BE INCOMPLETE.
2109 You have the option of continuing the configuration process, despite the
2110 distinct possibility that your kit is damaged, by typing 'y'es. If you
2111 do, don't blame me if something goes wrong. I advise you to type 'n'o
2112 and contact the author (perlbug@perl.org).
2115 echo $n "Continue? [n] $c" >&4
2119 echo "Continuing..." >&4
2123 echo "ABORTING..." >&4
2128 echo "Looks good..."
2131 echo "There is no MANIFEST file. I hope your kit is complete !"
2135 : Find the appropriate value for a newline for tr
2136 if test -n "$DJGPP"; then
2139 if test X"$trnl" = X; then
2140 case "`echo foo | tr '\n' x 2>/dev/null`" in
2144 if test X"$trnl" = X; then
2145 case "`echo foo | tr '\012' x 2>/dev/null`" in
2146 foox) trnl='\012' ;;
2149 if test X"$trnl" = X; then
2150 case "`echo foo | tr '\r\n' xy 2>/dev/null`" in
2151 fooxy) trnl='\n\r' ;;
2154 if test X"$trnl" = X; then
2157 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
2163 : compute the number of columns on the terminal for proper question formatting
2168 : set up the echo used in my read
2169 myecho="case \"\$xxxm\" in
2170 '') echo $n \"\$rp $c\" >&4;;
2172 '') echo $n \"[\$xxxm] $c\";;
2174 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
2176 echo $n \"[\$xxxm] $c\" >&4
2178 echo $n \"\$rp [\$xxxm] $c\" >&4
2184 : now set up to do reads with possible shell escape and default assignment
2190 case "\$fastread" in
2191 yes) case "\$dflt" in
2194 case "\$silent-\$rp" in
2199 *) case "\$silent" in
2200 true) case "\$rp" in
2205 while expr "X\$ans" : "X!" >/dev/null; do
2209 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2217 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2226 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2231 echo "(OK, I'll run with -d after this question.)" >&4
2234 echo "*** Sorry, \$1 not supported yet." >&4
2244 echo "*** Substitution done -- please confirm."
2246 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2251 echo "*** Error -- try again."
2258 case "\$ans\$xxxm\$nostick" in
2270 : create .config dir to save info across Configure sessions
2271 test -d ../.config || mkdir ../.config
2272 cat >../.config/README <<EOF
2273 This directory created by Configure to save information that should
2274 persist across sessions for $package.
2276 You may safely delete it if you wish.
2279 : See if we are using a devel version and want that
2280 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2283 usedevel="$define" ;;
2284 *) case "$xversion" in
2287 *** WHOA THERE!!! ***
2289 This is an UNSTABLE DEVELOPMENT release.
2290 The version of this $package distribution is $xversion, that is, odd,
2291 (as opposed to even) and that signifies a development release.
2292 If you want a maintenance release, you want an even-numbered version.
2294 Do ***NOT*** install this into production use.
2295 Data corruption and crashes are possible.
2297 It is most seriously suggested that you do not continue any further
2298 unless you want to help in developing and debugging Perl.
2300 If you *still* want to build perl, you can answer 'y' now,
2301 or pass -Dusedevel to Configure.
2304 rp='Do you really want to continue?'
2308 [yY]) echo >&4 "Okay, continuing."
2309 usedevel="$define" ;;
2310 *) echo >&4 "Okay, bye."
2321 case "$versiononly" in
2322 '') versiononly="$define" ;;
2324 case "$installusrbinperl" in
2325 '') installusrbinperl="$undef" ;;
2330 : general instructions
2333 user=`(logname) 2>/dev/null`
2335 '') user=`whoami 2>&1`;;
2337 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2340 rp='Would you like to see the instructions?'
2351 This installation shell script will examine your system and ask you questions
2352 to determine how the perl5 package should be installed. If you get
2353 stuck on a question, you may use a ! shell escape to start a subshell or
2354 execute a command. Many of the questions will have default answers in square
2355 brackets; typing carriage return will give you the default.
2357 On some of the questions which ask for file or directory names you are allowed
2358 to use the ~name construct to specify the login directory belonging to "name",
2359 even if you don't have a shell which knows about that. Questions where this is
2360 allowed will be marked "(~name ok)".
2364 dflt='Type carriage return to continue'
2368 The prompter used in this script allows you to use shell variables and
2369 backticks in your answers. You may use $1, $2, etc... to refer to the words
2370 in the default answer, as if the default line was a set of arguments given to a
2371 script shell. This means you may also use $* to repeat the whole default line,
2372 so you do not have to re-type everything to add something to the default.
2374 Every time there is a substitution, you will have to confirm. If there is an
2375 error (e.g. an unmatched backtick), the default answer will remain unchanged
2376 and you will be prompted again.
2378 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2379 the questions and use the computed defaults (or the previous answers if there
2380 was already a config.sh file). Type 'Configure -h' for a list of options.
2381 You may also start interactively and then answer '& -d' at any prompt to turn
2382 on the non-interactive behaviour for the remainder of the execution.
2388 Much effort has been expended to ensure that this shell script will run on any
2389 Unix system. If despite that it blows up on yours, your best bet is to edit
2390 Configure and run it again. If you can't run Configure for some reason,
2391 you'll have to generate a config.sh file by hand. Whatever problems you
2392 have, let me (perlbug@perl.org) know how I blew it.
2394 This installation script affects things in two ways:
2396 1) it may do direct variable substitutions on some of the files included
2398 2) it builds a config.h file for inclusion in C programs. You may edit
2399 any of these files as the need arises after running this script.
2401 If you make a mistake on a question, there is no easy way to back up to it
2402 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2403 files. Configure will offer to let you do this before it runs the SH files.
2406 dflt='Type carriage return to continue'
2408 case "$firsttime" in
2409 true) echo $user >>../.config/instruct;;
2413 : Set 'sysroot' to change the logical root directory to your headers and libraries see man gcc
2414 : This is primarily meant for cross-compile environments, and may fail to be useful in other cases
2415 if test "X$sysroot" = X; then
2420 echo "Using $sysroot to find your headers and libraries, adding to ccflags"
2421 # _sysroot is used in places where we need --sysroot=foo
2422 # but using the rest of the flags could cause issues.
2423 _sysroot="--sysroot=$sysroot";
2427 ccflags="$ccflags $_sysroot"
2432 ldflags="$ldflags $_sysroot"
2437 cppflags="$cppflags $_sysroot"
2439 # lddlflags updated below in lddlflags section;
2440 # same with cccdlflags
2444 # Adjust some defaults to also use $sysroot
2445 for var in xlibpth loclibpth locincpth glibpth; do
2448 for path in $xxx; do
2449 eval $var=\"\$$var $sysroot$path\"
2455 : find out where common programs are
2457 echo "Locating common programs..." >&4
2470 if test -d \$dir/\$thing; then
2476 for thisthing in \$dir/\$thing; do
2477 : just loop through to pick last item
2479 if test -f \$thisthing; then
2482 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2485 elif test -f \$dir/\$thing.exe; then
2486 if test -n "$DJGPP"; then
2487 echo \$dir/\$thing.exe
2488 elif test "$eunicefix" != ":"; then
2489 : on Eunice apparently
2542 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2543 pth="$pth $sysroot/lib $sysroot/usr/lib"
2544 for file in $loclist; do
2548 if test -f "$xxx"; then
2551 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2552 xxx=`./loc $file $file $pth`
2555 '') xxx=`./loc $file $file $pth`;;
2556 *) xxx=`./loc $xxx $xxx $pth`;;
2558 eval $file=$xxx$_exe
2562 echo $file is in $xxx.
2565 echo $file is in $xxx.
2568 echo "I don't know where '$file' is, and my life depends on it." >&4
2569 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2575 echo "Don't worry if any of the following aren't found..."
2577 for file in $trylist; do
2581 if test -f "$xxx"; then
2584 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2585 xxx=`./loc $file $file $pth`
2588 '') xxx=`./loc $file $file $pth`;;
2589 *) xxx=`./loc $xxx $xxx $pth`;;
2591 eval $file=$xxx$_exe
2595 echo $file is in $xxx.
2598 echo $file is in $xxx.
2601 echo "I don't see $file out there, $say."
2608 echo "Substituting grep for egrep."
2615 *) if $less -R </dev/null >/dev/null 2>&1; then
2616 echo "Substituting less -R for less."
2624 echo "Substituting cp for ln."
2633 echo "I can't find make or gmake, and my life depends on it." >&4
2634 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2642 *) # We can't have osname yet.
2643 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2644 # Assume that gmake, if found, is definitely GNU make
2645 # and prefer it over the system make.
2646 echo "Substituting gmake for make."
2654 echo "Hopefully test is built into your sh."
2657 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2658 echo "Using the test built into your sh."
2666 echo "Hopefully echo is built into your sh."
2671 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2672 $echo $n "hi there$c" >foo1
2673 echo $n "hi there$c" >foo2
2674 if cmp foo1 foo2 >/dev/null 2>&1; then
2675 echo "They are compatible. In fact, they may be identical."
2682 They are not compatible! You are probably running ksh on a non-USG system.
2683 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2684 have echo built in and we may have to run some Bourne shell scripts. That
2685 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2688 $echo $n "The star should be here-->$c"
2695 # This question was auctioned at YAPC::Europe-2007 in Vienna
2696 # I never promised you could answer it. I only auctioned the question.
2698 The following message is sponsored by
2700 Dresden.pm<--The stars should be here.
2702 Dear Perl user, system administrator or package
2703 maintainer, the Perl community sends greetings to
2704 you. Do you (emblematical) greet back [Y/n]? n
2708 : Check what type of C compiler we use
2712 cat <<'EOSC' >>trygcc
2717 int main(int argc, char *argv[]) {
2721 if $cc -o try $ccflags $ldflags try.c; then
2724 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2730 # Skip this test because it gives a false match on output like:
2731 # ./trygcc: line 23: cc: command not found
2732 # case "`$cc -v -c try.c 2>&1`" in
2733 # *gcc*) trygcc=no ;;
2735 if $test X"$trygcc" = Xyes; then
2736 if gcc -o try -c try.c; then
2738 echo "You seem to have a working gcc, though." >&4
2739 # Switching compilers may undo the work of hints files.
2740 # The most common problem is -D_REENTRANT for threads.
2741 # This heuristic catches that case, but gets false positives
2742 # if -Dusethreads was not actually specified. Better to
2743 # bail out here with a useful message than fail
2744 # mysteriously later. Should we perhaps just try to
2745 # re-invoke Configure -Dcc=gcc config_args ?
2746 if $test -f usethreads.cbu; then
2749 *** However, any setting of the C compiler flags (e.g. for thread support)
2750 *** will be lost. It may be necessary for you to restart Configure and
2751 *** add -Dcc=gcc to your Configure command line.
2754 rp="Would you like to go ahead and try gcc anyway?"
2757 rp="Would you like to use it?"
2760 if $test -f myread; then
2763 if $test -f UU/myread; then
2766 echo "Cannot find myread, sorry. Aborting." >&2
2771 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2784 cat <<'EOSC' >>checkcc
2789 int main(int argc, char *argv[]) {
2793 if $cc -o try $ccflags $ldflags try.c; then
2796 if $test X"$despair" = Xyes; then
2797 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2800 You need to find a working C compiler.
2801 Either (purchase and) install the C compiler supplied by your OS vendor,
2802 or for a free C compiler try http://gcc.gnu.org/
2803 I cannot continue any further, aborting.
2812 : determine whether symbolic links are supported
2815 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2816 echo "Symbolic links are supported." >&4
2819 echo "Symbolic links are NOT supported." >&4
2824 : determine whether symbolic links are supported
2828 echo "Checking how to test for symbolic links..." >&4
2830 if $test "X$issymlink" = X; then
2832 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2833 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2835 if test $? = 0; then
2838 echo "Your builtin 'test -h' may be broken." >&4
2841 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2844 if test -f "$p/$test"; then
2853 echo "Trying external '$test -h'." >&4
2854 issymlink="$test -h"
2855 if $test ! -h sym >/dev/null 2>&1; then
2856 echo "External '$test -h' is broken, too." >&4
2864 if $test "X$issymlink" = X; then
2865 if $test -L sym 2>/dev/null; then
2866 issymlink="$test -L"
2867 echo "The builtin '$test -L' worked." >&4
2870 if $test "X$issymlink" != X; then
2871 echo "You can test for symbolic links with '$issymlink'." >&4
2873 echo "I do not know how you can test for symbolic links." >&4
2877 *) echo "No symbolic links, so not testing for their testing..." >&4
2881 : Make symlinks util
2882 case "$mksymlinks" in
2885 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2888 *) case "$lns:$issymlink" in
2889 *"ln"*" -s:"*"test -"?)
2890 echo "Creating the symbolic links..." >&4
2892 awk '{print $1}' $src/MANIFEST | sed -e 's:/\([^/]*\)$: \1:' |
2902 print "# dir = ", dir, "file = ", file
2903 mf[dir] = mf[dir]" "source"/"dir"/"file;
2906 if (d != ".") { print("mkdir -p "d) }
2907 print("ln -sf "mf[d]" "d);
2909 }' source="$src" > UU/mksymlinks.$$
2913 if test ! -d t/base; then
2914 echo "Failed to create the subdirectories. Aborting." >&4
2918 if test ! -f t/base/lex.t; then
2919 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2922 if test ! -f win32/win32.c; then
2923 echo "Failed to create the symlinks (win32/win32.c missing). Aborting." >&4
2928 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2936 : Check for Cross-Compilation
2937 if $test "X$targethost" = "X"; then
2940 if $test "X$targetenv" = "X"; then
2943 case "$usecrosscompile" in
2945 $echo "Cross-compiling..."
2948 *-gcc*|*-g++*) # A cross-compiling gcc, probably.
2949 # arm-linux-androideabi-gcc -> arm-linux-androideabi
2950 # x86_64-w64-mingw32-gcc.exe -> x86_64-w64-mingw32
2951 targetarch=`$echo $cc|$sed 's/-g[c\+][c\+].*$//'`
2952 ar=`$echo $cc|$sed 's/-g[c\+][c\+]/-ar/'`
2953 # leave out ld, choosing it is more complex
2954 nm=`$echo $cc|$sed 's/-g[c\+][c\+]/-nm/'`
2955 ranlib=`$echo $cc|$sed 's/-g[c\+][c\+]/-ranlib/'`
2956 # We are in a weird spot. Just before us, some values
2957 # were 'saved', to be restored after the hints are
2958 # run. This means that the changes we made to ar,
2959 # nm and ranlib will get reverted.
2960 # To avoid that, we hijack the saving mechanism and
2961 # have it save our new values.
2962 for file in ar nm ranlib; do
2964 eval $file=$xxx$_exe
2969 case "$targetarch" in
2970 '') echo "Targetarch not defined." >&4; croak=y ;;
2971 *) echo "Using targetarch $targetarch." >&4 ;;
2973 case "$targethost" in
2974 '') echo "Targethost not defined." >&4; croak=n ;;
2975 *) echo "Using targethost $targethost." >&4
2980 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2982 : compile a host miniperl and generate_uudmap, unless we got passed them
2983 if $test "X$hostperl" = X; then
2984 echo "Building host miniperl and generate_uudmap binaries" >&4
2992 $src/Configure -des -Dusedevel -Dmksymlinks
2994 case "$hostgenerate" in
2995 '') $make generate_uudmap
2996 hostgenerate=$src/host/generate_uudmap
2998 "$undef") hostgenerate=''
3001 hostperl=$src/host/miniperl
3004 hostosname=`$hostperl -le 'print $^O'`
3007 usecrosscompile="$undef"
3011 : Define -Dtargethost=somecomputer to run compiled tests on another machine
3012 case "$targethost" in
3013 '') echo "Checking for cross-compile" >&4
3014 case "$usecrosscompile$multiarch" in
3015 *$define*) echo "Skipping the try tests in the rest of Configure as no targethost was defined when cross-compiling" >&4
3016 if [ -f Makefile ]; then
3018 echo "Now you must ensure config.sh, config.h and the generated headers exist and run a $make."
3020 echo "Configure done."
3024 *) echo "No targethost for running compiler tests against defined, running locally" >&4
3031 *) echo "Using targethost $targethost." >&4
3033 /*) run=$src/Cross/run
3034 targetmkdir=$src/Cross/mkdir
3036 from=$src/Cross/from
3038 *) pwd=`$test -f ../Configure & cd ..; pwd`
3040 targetmkdir=$pwd/Cross/mkdir
3042 from=$pwd/Cross/from
3045 case "$targetrun" in
3046 '') targetrun=ssh ;;
3051 case "$targetfrom" in
3052 '') targetfrom=scp ;;
3056 from=$from-$targetfrom
3057 case "$targetdir" in
3059 echo "Guessing targetdir $targetdir." >&4
3062 case "$targetuser" in
3064 echo "Guessing targetuser $targetuser." >&4
3067 case "$targetport" in
3069 echo "Guessing targetport $targetport." >&4
3072 case "$targetfrom" in
3076 case "$targetrun" in
3096 '') cwd=$targetdir ;;
3101 $targetrun -p $targetport -l $targetuser $targethost "cd \$cwd && \$env \$exe \$@"
3107 *) echo "Unknown targetrun '$targetrun'" >&4
3111 case "$targetmkdir" in
3113 cat >$targetmkdir <<EOF
3115 $targetrun -p $targetport -l $targetuser $targethost "mkdir -p \$@"
3117 $chmod a+rx $targetmkdir
3119 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
3131 $targetmkdir \`dirname \$f\`
3132 $targetto -P $targetport -r $q \$f $targetuser@$targethost:\$f 2>/dev/null || exit 1
3135 $targetmkdir $targetdir/\`dirname \$f\`
3136 $targetto -P $targetport -r $q \$f $targetuser@$targethost:$targetdir/\$f 2>/dev/null || exit 1
3149 $mkdir -p $targetdir/\`dirname \$f\`
3150 $cp \$f $targetdir/\$f || exit 1
3153 $targetmkdir $targetdir/\`dirname \$f\`
3154 $cp \$f $targetdir/\$f || exit 1
3161 *) echo "Unknown targetto '$targetto'" >&4
3165 case "$targetfrom" in
3172 $targetfrom -P $targetport $q $targetuser@$targethost:$targetdir/\$f . || exit 1
3177 cp) cat >$from <<EOF
3182 cp $targetdir/\$f . || exit 1
3187 *) echo "Unknown targetfrom '$targetfrom'" >&4
3191 if $test ! -f $run; then
3192 echo "Target 'run' script '$run' not found." >&4
3196 if $test ! -f $to; then
3197 echo "Target 'to' script '$to' not found." >&4
3201 if $test ! -f $from; then
3202 echo "Target 'from' script '$from' not found." >&4
3206 if $test ! -f $run -o ! -f $to -o ! -f $from; then
3210 Using '$run' for remote execution,
3211 and '$from' and '$to'
3212 for remote file transfer.
3218 usecrosscompile="$undef"
3223 : see whether [:lower:] and [:upper:] are supported character classes
3225 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`"-"`echo AbyZ | $tr '[:upper:]' '[:lower:]' 2>/dev/null`" in
3227 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
3231 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
3232 # (0xd9 and 0xe2), therefore that is a nice testing point.
3233 if test "X$up" = X -o "X$low" = X; then
3234 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
3240 if test "X$up" = X -o "X$low" = X; then
3241 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
3247 if test "X$up" = X -o "X$low" = X; then
3248 case "`echo RS | od -x 2>/dev/null`" in
3250 echo "Hey, this might be EBCDIC." >&4
3251 if test "X$up" = X -o "X$low" = X; then
3252 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
3253 rs) up='[A-IJ-RS-Z]'
3258 if test "X$up" = X -o "X$low" = X; then
3259 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
3269 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
3271 echo "Using $up and $low to convert case." >&4
3274 echo "I don't know how to translate letters from upper to lower case." >&4
3275 echo "Your tr is not acting any way I know of." >&4
3279 : set up the translation script tr, must be called with ./tr of course
3283 '[A-Z][a-z]') exec $tr '$up' '$low';;
3284 '[a-z][A-Z]') exec $tr '$low' '$up';;
3291 : Try to determine whether config.sh was made on this system
3292 case "$config_sh" in
3294 myuname=`$uname -a 2>/dev/null`
3295 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
3296 # Downcase everything to avoid ambiguity.
3297 # Remove slashes and single quotes so we can use parts of this in
3298 # directory and file names.
3299 # Remove newlines so myuname is sane to use elsewhere.
3300 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
3301 # because the A-Z/a-z are not consecutive.
3302 myuname=`echo $myuname | $sed -e "s,['/],,g" | \
3303 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
3304 newmyuname="$myuname"
3306 case "$knowitall" in
3308 if test -f ../config.sh; then
3309 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3310 eval "`grep myuname= ../config.sh`"
3312 if test "X$myuname" = "X$newmyuname"; then
3320 : Get old answers from old config file if Configure was run on the
3321 : same system, otherwise use the hints.
3324 if test -f config.sh; then
3326 rp="I see a config.sh file. Shall I use it to set the defaults?"
3329 n*|N*) echo "OK, I'll ignore it."
3330 mv config.sh config.sh.old
3331 myuname="$newmyuname"
3333 *) echo "Fetching default answers from your old config.sh file..." >&4
3341 : Older versions did not always set $sh. Catch re-use of such
3351 if test ! -f config.sh; then
3354 First time through, eh? I have some defaults handy for some systems
3355 that need some extra help getting the Configure answers right:
3358 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3360 : Half the following guesses are probably wrong... If you have better
3361 : tests or hints, please send them to perlbug@perl.org
3362 : The metaconfig authors would also appreciate a copy...
3363 $test -f /irix && osname=irix
3364 $test -f /xenix && osname=sco_xenix
3365 $test -f /dynix && osname=dynix
3366 $test -f /dnix && osname=dnix
3367 $test -f /lynx.os && osname=lynxos
3368 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3369 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3370 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3371 $test -f /bin/mips && /bin/mips && osname=mips
3372 $test -d /usr/apollo/bin && osname=apollo
3373 $test -f /etc/saf/_sactab && osname=svr4
3374 $test -d /usr/include/minix && osname=minix && osvers=`$uname -r`
3375 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3376 $test -f /sys/utilities/MultiView && osname=amigaos
3377 if $test -d /MachTen -o -d /MachTen_Folder; then
3379 if $test -x /sbin/version; then
3380 osvers=`/sbin/version | $awk '{print $2}' |
3381 $sed -e 's/[A-Za-z]$//'`
3382 elif $test -x /usr/etc/version; then
3383 osvers=`/usr/etc/version | $awk '{print $2}' |
3384 $sed -e 's/[A-Za-z]$//'`
3390 $test -f /sys/posix.dll &&
3391 $test -f /usr/bin/what &&
3392 set X `/usr/bin/what /sys/posix.dll` &&
3393 $test "$3" = UWIN &&
3397 if $test -f $uname; then
3405 umips) osname=umips ;;
3408 [23]100) osname=mips ;;
3410 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3411 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3414 elif $test -f /etc/kconfig; then
3416 if test "$lns" = "$ln -s"; then
3418 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3420 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3427 if test -n "$DJGPP"; then
3436 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3438 # oslevel can fail with:
3439 # oslevel: Unable to acquire lock.
3440 *not\ found) osvers="$4"."$3" ;;
3441 '<3240'|'<>3240') osvers=3.2.0 ;;
3442 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3443 '=3250'|'>3250') osvers=3.2.5 ;;
3447 bitrig) osname=bitrig
3450 bsd386) osname=bsd386
3453 cygwin*) osname=cygwin
3456 *dc.osx) osname=dcosx
3462 domainos) osname=apollo
3468 dragonfly) osname=dragonfly
3471 dynixptx*) osname=dynixptx
3472 osvers=`echo "$4"|sed 's/^v//'`
3474 freebsd) osname=freebsd
3476 genix) osname=genix ;;
3480 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3493 $test -f /system/lib/libandroid.so && osname=linux-android
3497 netbsd*) osname=netbsd
3500 news-os) osvers="$3"
3502 4*) osname=newsos4 ;;
3506 nonstop-ux) osname=nonstopux ;;
3507 openbsd) osname=openbsd
3513 POSIX-BC | posix-bc ) osname=posix-bc
3516 powerux | power_ux | powermax_os | powermaxos | \
3517 powerunix | power_unix) osname=powerux
3523 solaris) osname=solaris
3525 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3532 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3536 titanos) osname=titanos
3545 ultrix) osname=ultrix
3548 osf1|mls+) case "$5" in
3551 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3554 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3557 hp*) osname=hp_osf1 ;;
3558 mips) osname=mips_osf1 ;;
3561 # UnixWare 7.1.2 is known as Open UNIX 8
3562 openunix|unixware) osname=svr5
3570 $2) case "$osname" in
3574 : svr4.x or possibly later
3584 if test -f /stand/boot ; then
3585 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3586 if test -n "$INITPROG" -a -f "$INITPROG"; then
3587 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3588 if test -n "$isesix"; then
3596 *) if test -f /etc/systemid; then
3598 set `echo $3 | $sed 's/\./ /g'` $4
3599 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3601 elif $test -f $src/hints/sco_$1_$2.sh; then
3603 elif $test -f $src/hints/sco_$1.sh; then
3608 '') : Still unknown. Probably a generic Sys V.
3617 *) case "$osname" in
3618 '') : Still unknown. Probably a generic BSD.
3626 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3627 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3628 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3631 $rm -f UU/kernel.what
3632 elif test -d c:/. -o -n "$is_os2" ; then
3639 case "$targetarch" in
3642 case "$targetarch" in
3644 # Will load qnx.sh, which should change osname to nto
3649 # Catch arm-linux-androideabi, mipsel-linux-android,
3650 # and i686-linux-android
3651 osname=linux-android
3655 # Something like arm-linux-gnueabihf is really just
3662 # XXX perhaps we should just assume
3663 # osvers to be 2, or maybe take the value
3664 # from targetarch. Using $run before the
3665 # hints are run is somewhat icky.
3666 set X `$run $uname -a 2>/dev/null`
3669 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3674 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3681 : Now look for a hint file osname_osvers, unless one has been
3682 : specified already.
3685 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3686 : Also try without trailing minor version numbers.
3687 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3688 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3689 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3690 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3693 *) case "$osvers" in
3696 *) if $test -f $src/hints/$file.sh ; then
3698 elif $test -f $src/hints/$xfile.sh ; then
3700 elif $test -f $src/hints/$xxfile.sh ; then
3702 elif $test -f $src/hints/$xxxfile.sh ; then
3704 elif $test -f $src/hints/$xxxxfile.sh ; then
3706 elif $test -f "$src/hints/${osname}.sh" ; then
3715 if $test -f Policy.sh ; then
3718 none) dflt="Policy" ;;
3719 *) dflt="Policy $dflt" ;;
3724 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3728 if $test -f Policy.sh ; then
3731 There's also a Policy hint file available, which should make the
3732 site-specific (policy) questions easier to answer.
3739 You may give one or more space-separated answers, or "none" if appropriate.
3740 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3741 previous run of Configure, you may specify it as well as or instead of
3742 OS-specific hints. If hints are provided for your OS, you should use them:
3743 although Perl can probably be built without hints on many platforms, using
3744 hints often improve performance and may enable features that Configure can't
3745 set up on its own. If there are no hints that match your OS, specify "none";
3746 DO NOT give a wrong version or a wrong OS.
3750 rp="Which of these apply, if any?"
3753 for file in $tans; do
3754 if $test X$file = XPolicy -a -f Policy.sh; then
3756 $cat Policy.sh >> UU/config.sh
3757 elif $test -f $src/hints/$file.sh; then
3758 . $src/hints/$file.sh
3759 $cat $src/hints/$file.sh >> UU/config.sh
3760 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3763 : Give one chance to correct a possible typo.
3764 echo "$file.sh does not exist"
3766 rp="hint to use instead?"
3768 for file in $ans; do
3769 if $test -f "$src/hints/$file.sh"; then
3770 . $src/hints/$file.sh
3771 $cat $src/hints/$file.sh >> UU/config.sh
3772 elif $test X$ans = X -o X$ans = Xnone ; then
3775 echo "$file.sh does not exist -- ignored."
3782 : Remember our hint file for later.
3783 if $test -f "$src/hints/$file.sh" ; then
3793 echo "Fetching default answers from $config_sh..." >&4
3797 cp $config_sh config.sh 2>/dev/null
3809 : Restore computed paths
3810 for file in $loclist $trylist; do
3811 eval $file="\$_$file"
3816 Configure uses the operating system name and version to set some defaults.
3817 The default value is probably right if the name rings a bell. Otherwise,
3818 since spelling matters for me, either accept the default or answer "none"
3825 ''|' '|none) dflt=none ;;
3826 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3829 *) dflt="$osname" ;;
3831 rp="Operating system name?"
3835 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3841 ''|' '|none) dflt=none ;;
3842 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3843 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3845 ''|' ') dflt=none ;;
3850 *) dflt="$osvers" ;;
3852 rp="Operating system version?"
3862 : who configured the system
3863 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3866 cf_by=`(logname) 2>/dev/null`
3869 cf_by=`(whoami) 2>/dev/null`
3871 "") cf_by=unknown ;;
3876 : decide how portable to be. Allow command line overrides.
3877 case "$d_portable" in
3879 *) d_portable="$define" ;;
3882 : set up shell script to do ~ expansion
3888 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3891 if $test -f /bin/csh; then
3892 /bin/csh -f -c "glob \$1"
3897 name=\`$expr x\$1 : '..\([^/]*\)'\`
3898 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3899 if $test ! -d "\$dir"; then
3901 echo "\$me: can't locate home directory for: \$name" >&2
3906 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3922 : now set up to get a file name
3926 cat <<'EOSC' >>getfile
3942 : getfile will accept an answer from the comma-separated list
3943 : enclosed in parentheses even if it does not meet other criteria.
3944 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3945 fn=`echo $fn | sed 's/(.*)//'`
3951 loc_file=`expr $fn : '.*:\(.*\)'`
3952 fn=`expr $fn : '\(.*\):.*'`
3960 */*) fullpath=true;;
3969 *e*) exp_file=true;;
3972 *p*) nopath_ok=true;;
3977 *d*) type='Directory';;
3978 *l*) type='Locate';;
3983 Locate) what='File';;
3988 case "$d_portable" in
3996 while test "$type"; do
4001 true) rp="$rp (~name ok)";;
4004 if test -f UU/getfile.ok && \
4005 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
4024 value=`UU/filexp $ans`
4027 if test "$ans" != "$value"; then
4028 echo "(That expands to $value on this system.)"
4042 /*) value="$ansexp" ;;
4043 [a-zA-Z]:/*) value="$ansexp" ;;
4048 echo "I shall only accept a full path name, as in /bin/ls." >&4
4049 echo "Use a ! shell escape if you wish to check pathnames." >&4
4052 echo "Please give a full path name, starting with slash." >&4
4055 echo "Note that using ~name is ok provided it expands well." >&4
4068 for fp in $gfpth; do
4069 if test "X$fp" = X.; then
4074 if test -f "$pf"; then
4076 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
4078 echo "($value is not a plain file, but that's ok.)"
4081 if test X"$type" = X; then
4088 for fp in $gfpth; do
4089 if test "X$fp" = X.; then
4094 direxp="$fp/$ansexp"
4096 if test -d "$direxp"; then
4104 if test -d "$ansexp"; then
4105 echo "(Looking for $loc_file in directory $value.)"
4106 value="$value/$loc_file"
4107 ansexp="$ansexp/$loc_file"
4109 if test -f "$ansexp"; then
4112 case "$nopath_ok" in
4113 true) case "$value" in
4115 *) echo "Assuming $value will be in people's path."
4131 if test "$fastread" = yes; then
4136 rp="$what $value doesn't exist. Use that name anyway?"
4155 test "X$gfpthkeep" != Xy && gfpth=""
4158 : determine root of directory hierarchy where package will be installed.
4161 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
4164 dflt=`echo "$prefix" | sed 's/.$//'`
4172 By default, $package will be installed in $dflt/bin, manual pages
4173 under $dflt/man, etc..., i.e. with $dflt as prefix for all
4174 installation directories. Typically this is something like /usr/local.
4175 If you wish to have binaries under /usr/bin but other parts of the
4176 installation under /usr/local, that's ok: you will be prompted
4177 separately for each of the installation directories, the prefix being
4178 only used to set the defaults.
4182 rp='Installation prefix to use?'
4190 *) oldprefix="$prefix";;
4197 : allow them to override the AFS root
4200 *) afsroot=$afsroot ;;
4206 $define|true) afs=true ;;
4207 $undef|false) afs=false ;;
4208 *) if $test -d $afsroot; then
4216 echo "AFS may be running... I'll be extra cautious then..." >&4
4218 echo "AFS does not seem to be running..." >&4
4221 : determine installation prefix for where package is to be installed.
4225 Since you are running AFS, I need to distinguish the directory in which
4226 files will reside from the directory in which they are installed (and from
4227 which they are presumably copied to the former directory by occult means).
4230 case "$installprefix" in
4231 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
4232 *) dflt="$installprefix";;
4237 In some special cases, particularly when building $package for distribution,
4238 it is convenient to distinguish the directory in which files should be
4239 installed from the directory ($prefix) in which they will
4240 eventually reside. For most users, these two directories are the same.
4243 case "$installprefix" in
4245 *) dflt=$installprefix;;
4249 rp='What installation prefix should I use for installing files?'
4251 installprefix="$ans"
4252 installprefixexp="$ansexp"
4254 : Perform the prefixexp/installprefixexp correction if necessary
4255 cat <<EOS >installprefix
4258 cat <<'EOSC' >>installprefix
4259 : Change installation prefix, if necessary.
4260 if $test X"$prefix" != X"$installprefix"; then
4261 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
4263 eval "install${prefixvar}=\"\$${prefixvar}exp\""
4266 chmod +x installprefix
4267 $eunicefix installprefix
4269 : Set variables such as privlib and privlibexp from the output of ./getfile
4270 : performing the prefixexp/installprefixexp correction if necessary.
4271 cat <<EOS >setprefixvar
4274 cat <<'EOSC' >>setprefixvar
4275 eval "${prefixvar}=\"\$ans\""
4276 eval "${prefixvar}exp=\"\$ansexp\""
4279 chmod +x setprefixvar
4280 $eunicefix setprefixvar
4282 : set up the script used to warn in case of inconsistency
4291 '') echo "The $hint value for \$$var on this machine was \"$was\"!" >&4
4293 *) echo "Hmm. Based on the hints in hints/$hintfile.sh, " >&4
4294 echo "the $hint value for \$$var on this machine was \"$was\"!" >&4
4299 echo "*** WHOA THERE!!! ***" >&4
4300 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
4303 rp=" Keep the $hint value?"
4306 y) td=$was; tu=$was;;
4310 : function used to set '$1' to '$val'
4311 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
4313 $define$undef) . ./whoa; eval "$var=\$td";;
4314 $undef$define) . ./whoa; eval "$var=\$tu";;
4315 *) eval "$var=$val";;
4318 : get the patchlevel
4320 echo "Getting the current patchlevel..." >&4
4321 if $test -r $rsrc/patchlevel.h;then
4322 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
4323 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4324 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4325 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4326 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4327 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4328 perl_patchlevel=`egrep ',"(MAINT|SMOKE)[0-9][0-9]*"' $rsrc/patchlevel.h|tail -1|sed 's/[^0-9]//g'`
4337 $echo "(You do not have patchlevel.h. Eek.)"
4339 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
4340 version_patchlevel_string="version $patchlevel subversion $subversion"
4341 case "$perl_patchlevel" in
4343 *) perl_patchlevel=`echo $perl_patchlevel | sed 's/.* //'`
4344 version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel"
4348 $echo "(You have $package $version_patchlevel_string.)"
4352 : XXX Should be a Configure test for double-dots in filenames.
4353 version=`echo $revision $patchlevel $subversion | \
4354 $awk '{ printf "%d_%d_%d", $1, $2, $3 }'`
4355 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4356 $awk '{ printf "%d_%d_%d", $1, $2, $3 }'`
4359 version=`echo $revision $patchlevel $subversion | \
4360 $awk '{ printf "%d.%d.%d", $1, $2, $3 }'`
4361 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4362 $awk '{ printf "%d.%d.%d", $1, $2, $3 }'`
4365 : Special case the 5.005_xx maintenance series, which used 5.005
4366 : without any subversion label as a subdirectory in $sitelib
4367 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4368 api_versionstring='5.005'
4371 : Do we want threads support and if so, what type
4372 case "$usethreads" in
4373 $define|true|[yY]*) dflt='y';;
4374 *) # Catch case where user specified ithreads or 5005threads but
4375 # forgot -Dusethreads (A.D. 4/2002)
4376 case "$useithreads$use5005threads" in
4377 *$define*) dflt='y';;
4384 Perl can be built to offer a form of threading support on some systems
4385 To do so, Configure can be run with -Dusethreads.
4387 Note that Perl built with threading support runs slightly slower
4388 and uses slightly more memory than plain Perl.
4390 If this doesn't make any sense to you, just accept the default '$dflt'.
4392 rp='Build a threading Perl?'
4395 y|Y) val="$define" ;;
4401 if $test $patchlevel -lt 9; then
4402 case "$usethreads" in
4404 : Default to ithreads unless overridden on command line or with
4407 case "$use5005threads" in
4409 echo "5.005 threads are no longer supported"
4413 case "$useithreads" in
4414 $undef|false|[nN]*) dflt='n';;
4416 rp='Use the newer interpreter-based ithreads?'
4419 y|Y) val="$define" ;;
4424 : Now set use5005threads to the opposite value.
4425 case "$useithreads" in
4426 $define) val="$undef" ;;
4433 useithreads="$undef"
4434 use5005threads="$undef"
4438 case "$useithreads$use5005threads" in
4442 You cannot have both the ithreads and the 5.005 threads enabled
4443 at the same time. Disabling the 5.005 threads since they are
4444 much less stable than the ithreads.
4447 use5005threads="$undef"
4452 : perl-5.9.x and later
4454 if test X"$usethreads" = "X$define"; then
4455 case "$use5005threads" in
4459 5.005 threads has been removed for 5.10. Perl will be built using ithreads.
4466 use5005threads="$undef"
4467 useithreads="$usethreads"
4470 case "$d_oldpthreads" in
4471 '') : Configure tests would be welcome here. For now, assume undef.
4473 *) val="$d_oldpthreads" ;;
4479 : Look for a hint-file generated 'call-back-unit'. If the
4480 : user has specified that a threading perl is to be built,
4481 : we may need to set or change some other defaults.
4482 if $test -f usethreads.cbu; then
4483 echo "Your platform has some specific hints regarding threaded builds, using them..."
4486 case "$usethreads" in
4487 "$define"|true|[yY]*)
4489 (Your platform does not have any specific hints for threaded builds.
4490 Assuming POSIX threads, then.)
4496 : Check if multiplicity is required
4499 Perl can be built so that multiple Perl interpreters can coexist
4500 within the same Perl executable.
4503 case "$useithreads" in
4506 This multiple interpreter support is required for interpreter-based threads.
4510 *) case "$usemultiplicity" in
4511 $define|true|[yY]*) dflt='y';;
4515 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4516 rp='Build Perl for multiplicity?'
4519 y|Y) val="$define" ;;
4527 : Check if morebits is requested
4528 case "$usemorebits" in
4529 "$define"|true|[yY]*)
4530 use64bitint="$define"
4531 uselongdouble="$define"
4532 usemorebits="$define"
4534 *) usemorebits="$undef"
4538 : Determine the C compiler to be used
4544 rp="Use which C compiler?"
4548 : See whether they have no cc but they do have gcc
4550 if $test -f cc.cbu; then
4555 : make some quick guesses about what we are up against
4557 $echo $n "Hmm... $c"
4567 $cat $sysroot/usr/include/signal.h $sysroot/usr/include/sys/signal.h >foo 2>/dev/null
4568 if test -f /osf_boot || $contains 'OSF/1' $sysroot/usr/include/ctype.h >/dev/null 2>&1
4570 echo "Looks kind of like an OSF/1 system, but we'll see..."
4572 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4573 xxx=`./loc addbib blurfl $pth`
4574 if $test -f $xxx; then
4575 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4579 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4580 echo "Looks kind of like an extended USG system, but we'll see..."
4582 echo "Looks kind of like a USG system, but we'll see..."
4586 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4587 echo "Looks kind of like a BSD system, but we'll see..."
4591 echo "Looks kind of like a Version 7 system, but we'll see..."
4594 case "$eunicefix" in
4597 There is, however, a strange, musty smell in the air that reminds me of
4598 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4602 : it so happens the Eunice I know will not run shell scripts in Unix format
4606 echo "Congratulations. You aren't running Eunice."
4610 : Detect OS2. The p_ variable is set above in the Head.U unit.
4611 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4612 : semicolon as a patch separator
4617 I have the feeling something is not exactly right, however...don't tell me...
4618 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4619 (Or you may be running DOS with DJGPP.)
4624 if test -f /xenix; then
4625 echo "Actually, this looks more like a XENIX system..."
4630 echo "It's not Xenix..."
4635 if test -f /venix; then
4636 echo "Actually, this looks more like a VENIX system..."
4643 echo "Nor is it Venix..."
4646 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4647 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4650 : Check if we are using GNU gcc and what its version is
4652 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4656 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4658 printf("%s\n", __VERSION__);
4660 printf("%s\n", "1");
4666 if $cc -o try $ccflags $ldflags try.c; then
4667 gccversion=`$run ./try`
4668 case "$gccversion" in
4669 '') echo "You are not using GNU cc." ;;
4670 *) echo "You are using GNU cc $gccversion."
4676 echo "*** WHOA THERE!!! ***" >&4
4677 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4678 case "$knowitall" in
4680 echo " You'd better start hunting for one and let me know about it." >&4
4686 case "$gccversion" in
4687 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4689 case "$gccversion" in
4690 '') gccosandvers='' ;;
4691 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4692 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4694 case "$gccosandvers" in
4695 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4696 $osname$osvers) ;; # looking good
4697 $osname*) cat <<EOM >&4
4699 *** WHOA THERE!!! ***
4701 Your gcc has not been compiled for the exact release of
4702 your operating system ($gccosandvers versus $osname$osvers).
4704 In general it is a good idea to keep gcc synchronized with
4705 the operating system because otherwise serious problems
4706 may ensue when trying to compile software, like Perl.
4708 I'm trying to be optimistic here, though, and will continue.
4709 If later during the configuration and build icky compilation
4710 problems appear (headerfile conflicts being the most common
4711 manifestation), I suggest reinstalling the gcc to match
4712 your operating system release.
4716 *) gccosandvers='' ;; # failed to parse, better be silent
4724 # gcc 3.* complain about adding -Idirectories that they already know about,
4725 # so we will take those off from locincpth.
4726 case "$gccversion" in
4728 echo "main(){}">try.c
4729 for incdir in $locincpth; do
4730 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4731 grep '^c[cp]p*[01]: warning: changing search order '`
4732 if test "X$warn" != X; then
4733 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4739 # gcc 4.9 by default does some optimizations that break perl.
4740 # see ticket 121505.
4742 # The -fwrapv disables those optimizations (and probably others,) so
4743 # for gcc 4.9 (and later, since the optimizations probably won't go
4744 # away), add -fwrapv unless the user requests -fno-wrapv, which
4745 # disables -fwrapv, or if the user requests -fsanitize=undefined,
4746 # which turns the overflows -fwrapv ignores into runtime errors.
4747 case "$gccversion" in
4748 4.[3-9].*|4.[1-9][0-9]*|[5-9].*|[1-9][0-9]*)
4750 *-fno-wrapv*|*-fsanitize=undefined*|*-fwrapv*) ;;
4751 *) ccflags="$ccflags -fwrapv" ;;
4755 : What should the include directory be ?
4756 : Use sysroot if set, so findhdr looks in the right place.
4758 $echo $n "Hmm... $c"
4759 dflt="$sysroot/usr/include"
4762 if $test -f /bin/mips && /bin/mips; then
4763 echo "Looks like a MIPS system..."
4764 $cat >usr.c <<'EOCP'
4765 #ifdef SYSTYPE_BSD43
4769 if $cc $cppflags -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4770 dflt='/bsd43/usr/include'
4774 mips_type='System V'
4776 $rm -f usr.c usr.out
4777 echo "and you're compiling with the $mips_type compiler and libraries."
4781 echo "Doesn't look like a MIPS system."
4791 case "$xxx_prompt" in
4794 rp='Where are the include files you want to use?'
4802 : see how we invoke the C preprocessor
4804 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4805 cat <<'EOT' >testcpp.c
4811 if test ! -f cppstdin; then
4812 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4813 # AIX cc -E doesn't show the absolute headerfile
4814 # locations but we'll cheat by using the -M flag.
4815 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
4817 echo 'cat >.$$.c; '"$cc $cppflags"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4820 echo "Keeping your $hint cppstdin wrapper."
4823 wrapper=`pwd`/cppstdin
4827 if $test "X$cppstdin" != "X" && \
4828 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4829 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4831 echo "You used to use $cppstdin $cppminus so we'll use that again."
4833 '') echo "But let's see if we can live without a wrapper..." ;;
4835 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4836 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4838 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4841 echo "(However, $cpprun $cpplast does not work, let's see...)"
4849 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4856 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4857 $cc -E <testcpp.c >testcpp.out 2>&1; \
4858 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4859 echo "Yup, it does."
4860 x_cpp="$cc $cppflags -E"
4862 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4863 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4864 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4865 echo "Yup, it does."
4866 x_cpp="$cc $cppflags -E"
4868 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4869 $cc -P <testcpp.c >testcpp.out 2>&1; \
4870 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4871 echo "Yipee, that works!"
4872 x_cpp="$cc $cppflags -P"
4874 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4875 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4876 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4877 echo "At long last!"
4878 x_cpp="$cc $cppflags -P"
4880 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4881 $cpp <testcpp.c >testcpp.out 2>&1; \
4882 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4884 x_cpp="$cpp $cppflags"
4886 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4887 $cpp - <testcpp.c >testcpp.out 2>&1; \
4888 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4889 echo "Hooray, it works! I was beginning to wonder."
4890 x_cpp="$cpp $cppflags"
4892 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4893 $wrapper <testcpp.c >testcpp.out 2>&1; \
4894 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4900 rp="No dice. I can't find a C preprocessor. Name one:"
4904 $x_cpp <testcpp.c >testcpp.out 2>&1
4905 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4906 echo "OK, that will do." >&4
4908 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4923 echo "Perhaps can we force $cc -E using a wrapper..."
4924 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4925 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4931 echo "Nope, we'll have to live without it..."
4945 "$wrapper"|'cppstdin') ;;
4946 *) $rm -f $wrapper;;
4948 $rm -f testcpp.c testcpp.out
4950 : Adjust cppfilter for path component separator
4952 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
4953 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
4957 : Use gcc to determine libpth and incpth
4958 # If using gcc or clang, we can get better values for libpth, incpth
4959 # and usrinc directly from the compiler.
4960 # Note that ccname for clang is also gcc.
4963 $echo 'extern int foo;' > try.c
4964 set X `$cppstdin -v try.c 2>&1 | $awk '/^#include </,/^End of search /'|$cppfilter $grep '/include'`
4966 if $test $# -gt 0; then
4968 incpth="`$echo $incpth|$sed 's/^ //'`"
4970 j="`$echo $i|$sed 's,/include$,/lib,'`"
4971 if $test -d $j; then
4975 libpth="`$echo $libpth|$sed 's/^ //'`"
4976 for xxx in $libpth $loclibpth $plibpth $glibpth; do
4977 if $test -d $xxx; then
4980 *) libpth="$libpth $xxx";;
4987 '') for i in $incpth; do
4988 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
4996 case "$usecrosscompile" in
4999 '') echo "Incpth not defined." >&4; croak=y ;;
5000 *) echo "Using incpth '$incpth'." >&4 ;;
5003 '') echo "Libpth not defined." >&4; croak=y ;;
5004 *) echo "Using libpth '$libpth'." >&4 ;;
5007 '') echo "Usrinc not defined." >&4; croak=y ;;
5008 *) echo "Using usrinc $usrinc." >&4 ;;
5012 if test "X$sysroot" = X; then
5013 echo "Cannot continue, aborting." >&4; exit 1
5015 echo "Cross-compiling using sysroot $sysroot, failing to guess inc/lib paths is not fatal" >&4
5024 : Default value for incpth is just usrinc
5026 '') incpth="$usrinc";;
5029 : Set private lib path
5032 plibpth="$incpath/usr/lib $sysroot/usr/local/lib $sysroot/usr/ccs/lib"
5037 '') dlist="$loclibpth $plibpth $glibpth";;
5038 *) dlist="$libpth";;
5041 : Now check and see which directories actually exist, avoiding duplicates
5044 if $test -d $xxx; then
5047 *) libpth="$libpth $xxx";;
5053 Some systems have incompatible or broken versions of libraries. Among
5054 the directories listed in the question below, please remove any you
5055 know not to be holding relevant libraries, and add any that are needed.
5056 Say "none" for none.
5060 if test "X$sysroot" != X; then
5062 You have set sysroot to $sysroot, please supply the directories excluding sysroot
5075 rp="Directories to use for library searches?"
5082 : compute shared library extension
5085 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
5095 On some systems, shared libraries may be available. Answer 'none' if
5096 you want to suppress searching of shared libraries for the remainder
5097 of this configuration.
5100 rp='What is the file extension used for shared libraries?'
5104 : Does target system insist that shared library basenames are unique
5107 Some dynamic loaders assume that the *basename* of shared library filenames
5108 are globally unique. We'll default this to undef as we assume your system
5109 is not this weird. Set to defined if you're on one of them.
5114 rp='Make shared library basenames unique?'
5117 y|Y) val="$define" ;;
5120 set d_libname_unique
5123 : Define several unixisms.
5124 : Hints files or command line option can be used to override them.
5125 : The convoluted testing is in case hints files set either the old
5128 '') case "$exe_ext" in
5130 *) _exe="$exe_ext" ;;
5135 '') case "$lib_ext" in
5142 '') case "$obj_ext" in
5149 '') case "$path_sep" in
5160 rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
5162 : Which makefile gets called first. This is used by make depend.
5163 case "$firstmakefile" in
5164 '') firstmakefile='makefile';;
5167 : Check is we will use socks
5169 $define|true|[yY]*) dflt='y';;
5174 Perl can be built to use the SOCKS proxy protocol library. To do so,
5175 Configure must be run with -Dusesocks. If you use SOCKS you also need
5176 to use the PerlIO abstraction layer, this will be implicitly selected.
5178 If this doesn't make any sense to you, just accept the default '$dflt'.
5180 rp='Build Perl for SOCKS?'
5183 y|Y) val="$define" ;;
5189 : Check for uselongdouble support
5191 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
5194 case "$uselongdouble" in
5195 $define|true|[yY]*) dflt='y';;
5200 Perl can be built to take advantage of long doubles which
5201 (if available) may give more accuracy and range for floating point numbers.
5203 If this doesn't make any sense to you, just accept the default '$dflt'.
5205 rp='Try to use long doubles if available?'
5208 y|Y) val="$define" ;;
5214 case "$uselongdouble" in
5215 true|[yY]*) uselongdouble="$define" ;;
5218 : Look for a hint-file generated 'call-back-unit'. If the
5219 : user has specified that long doubles should be used,
5220 : we may need to set or change some other defaults.
5221 if $test -f uselongdouble.cbu; then
5222 echo "Your platform has some specific hints regarding long doubles, using them..."
5223 . ./uselongdouble.cbu
5225 case "$uselongdouble" in
5228 (Your platform does not have any specific hints for long doubles.)
5234 : Check if quadmath is requested
5235 case "$usequadmath" in
5236 "$define"|true|[yY]*) usequadmath="$define" ;;
5237 *) usequadmath="$undef" ;;
5240 : Fail if both uselongdouble and usequadmath are requested
5241 case "$usequadmath:$uselongdouble" in
5245 *** You requested the use of the quadmath library and use
5246 *** of long doubles.
5248 *** Please select one or the other.
5254 : Looking for optional libraries
5256 echo "Checking for optional libraries..." >&4
5261 case "$libswanted" in
5262 '') libswanted='c_s';;
5265 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
5267 case "$usecbacktrace" in
5268 "$define") libswanted="$libswanted bfd" ;;
5270 case "$usequadmath" in
5271 "$define") libswanted="$libswanted quadmath" ;;
5277 for thisdir in $libpth $xlibpth; do
5278 test -d $thisdir && libspath="$libspath $thisdir"
5280 for thislib in $libswanted; do
5281 for thisdir in $libspath; do
5283 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
5284 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
5285 $test -f "$xxx" && eval $libscheck
5286 $test -f "$xxx" && libstyle=shared
5287 xxx=`ls $thisdir/lib$thislib.[0-9].$so 2>/dev/null|sed -n '$p'`
5288 $test -f "$xxx" && eval $libscheck
5289 $test -f "$xxx" && libstyle=shared
5291 if test ! -f "$xxx"; then
5292 xxx=$thisdir/lib$thislib.$so
5293 $test -f "$xxx" && eval $libscheck
5294 $test -f "$xxx" && libstyle=shared
5296 if test ! -f "$xxx"; then
5297 xxx=$thisdir/lib$thislib$_a
5298 $test -f "$xxx" && eval $libscheck
5299 $test -f "$xxx" && libstyle=static
5301 if test ! -f "$xxx"; then
5302 xxx=$thisdir/$thislib$_a
5303 $test -f "$xxx" && eval $libscheck
5304 $test -f "$xxx" && libstyle=static
5306 if test ! -f "$xxx"; then
5307 xxx=$thisdir/lib${thislib}_s$_a
5308 $test -f "$xxx" && eval $libscheck
5309 $test -f "$xxx" && libstyle=static
5310 $test -f "$xxx" && thislib=${thislib}_s
5312 if test ! -f "$xxx"; then
5313 xxx=$thisdir/Slib$thislib$_a
5314 $test -f "$xxx" && eval $libscheck
5315 $test -f "$xxx" && libstyle=static
5317 if $test -f "$xxx"; then
5319 shared) echo "Found -l$thislib (shared)." ;;
5320 static) echo "Found -l$thislib." ;;
5321 *) echo "Found -l$thislib ($libstyle)." ;;
5325 *) dflt="$dflt -l$thislib"
5326 libsfound="$libsfound $xxx"
5328 libsfiles="$libsfiles $yyy"
5329 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
5330 case " $libsdirs " in
5332 *) libsdirs="$libsdirs $yyy" ;;
5339 if $test ! -f "$xxx"; then
5340 echo "No -l$thislib."
5351 ' '|'') dflt='none';;
5356 In order to compile $package on your machine, a number of libraries
5357 are usually needed. Include any other special libraries here as well.
5358 Say "none" for none. The default list is almost always right.
5362 rp="What libraries to use?"
5369 : determine optimization, if desired, or use for debug flag also
5371 ' '|$undef) dflt='none';;
5373 *) dflt="$optimize";;
5377 By default, $package compiles with the -O flag to use the optimizer.
5378 Alternately, you might want to use the symbolic debugger, which uses
5379 the -g flag (on traditional Unix systems). Either flag can be
5380 specified here. To use neither flag, specify the word "none".
5383 rp="What optimizer/debugger flag should be used?"
5387 'none') optimize=" ";;
5390 : Check what DEBUGGING is required from the command line
5391 : -DEBUGGING or -DDEBUGGING or
5392 : -DEBUGGING=both = -g + -DDEBUGGING
5393 : -DEBUGGING=-g or -Doptimize=-g = -g
5394 : -DEBUGGING=none or -UDEBUGGING =
5395 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
5398 *) DEBUGGING=$EBUGGING ;;
5401 case "$DEBUGGING" in
5405 *) optimize="$optimize -g" ;;
5409 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
5417 case "$DEBUGGING" in
5418 both|$define) dflt='-DDEBUGGING'
5421 : argument order is deliberate, as the flag will start with - which set could
5422 : think is an option
5423 checkccflag='check=$1; flag=$2; callback=$3;
5425 echo "Checking if your compiler accepts $flag" 2>&1;
5426 [ "X$sysroot" != "X" ] && echo "For sysroot = $sysroot";
5427 echo "int main(void) { return 0; }" > gcctest.c;
5428 if $cc $_sysroot -O2 $flag -o gcctest gcctest.c 2>gcctest.out && $run ./gcctest; then
5429 echo "Yes, it does." 2>&1;
5430 if $test -s gcctest.out ; then
5431 echo "But your platform does not like it:";
5436 echo "Leaving current flags $ccflags alone." 2>&1
5438 *) dflt="$dflt $flag";
5444 echo "Nope, it does not, but that is ok." 2>&1;
5448 : We will not override a previous value, but we might want to
5449 : augment a hint file
5451 default|recommended)
5452 case "$gccversion" in
5453 1*) dflt="$dflt -fpcc-struct-return" ;;
5455 case "$optimize:$DEBUGGING" in
5456 *-g*:old) dflt="$dflt -DDEBUGGING";;
5458 case "$gccversion" in
5459 2*) if $test -d /etc/conf/kconfig.d &&
5460 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
5462 # Interactive Systems (ISC) POSIX mode.
5467 case "$gccversion" in
5470 ?*) set strict-aliasing -fno-strict-aliasing
5474 # For gcc, adding -pipe speeds up compilations for some, but apparently
5475 # some assemblers can't read from stdin. (It also slows down compilations
5476 # in other cases, but those are apparently rarer these days.) AD 5/2004.
5477 case "$gccversion" in
5483 # on x86_64 (at least) we require an extra library (libssp) in the
5484 # link command line. This library is not named, so I infer that it is
5485 # an implementation detail that may change. Hence the safest approach
5486 # is to add the flag to the flags passed to the compiler at link time,
5487 # as that way the compiler can do the right implementation dependant
5490 amigaos) ;; # -fstack-protector builds but doesn't work
5491 *) case "$gccversion" in
5492 ?*) set stack-protector-strong -fstack-protector-strong
5495 *-fstack-protector-strong*) ;; # It got added.
5496 *) # Try the plain/older -fstack-protector.
5497 set stack-protector -fstack-protector
5508 case "$mips_type" in
5509 *BSD*|'') inclwanted="$locincpth $usrinc";;
5510 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
5512 for thisincl in $inclwanted; do
5513 if $test -d $thisincl; then
5514 if $test x$thisincl != x$usrinc; then
5516 *" -I$thisincl "*);;
5517 *) dflt="$dflt -I$thisincl ";;
5523 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
5525 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5533 *) dflt="$dflt -D$2";;
5537 set signal.h LANGUAGE_C; eval $inctest
5541 ccflags="$ccflags -DSOCKS"
5546 default|recommended) dflt="$ccflags $dflt" ;;
5547 *) dflt="$ccflags";;
5556 Your C compiler may want other flags. For this question you should include
5557 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5558 but you should NOT include libraries or ld flags like -lwhatever. If you
5559 want $package to honor its debug switch, you should include -DDEBUGGING here.
5560 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5562 To use no flags, specify the word "none".
5568 rp="Any additional cc flags?"
5575 : the following weeds options from ccflags that are of no interest to cpp
5577 '') cppflags="$ccflags" ;;
5578 *) set X $ccflags; shift
5579 case " $cppflags " in
5580 *" $1 "*) ;; # Try to avoid doubling the cppflags.
5581 *) cppflags="$cppflags $ccflags" ;;
5585 case "$gccversion" in
5586 1*) cppflags="$cppflags -D__GNUC__"
5588 case "$mips_type" in
5590 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5596 echo "Let me guess what the preprocessor flags are..." >&4
5610 *) ftry="$previous $flag";;
5612 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5613 >cpp1.out 2>/dev/null && \
5614 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5615 >cpp2.out 2>/dev/null && \
5616 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5617 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5619 cppflags="$cppflags $ftry"
5629 *-*) echo "They appear to be: $cppflags";;
5631 $rm -f cpp.c cpp?.out
5635 : flags used in final linking phase
5637 '') if ./venix; then
5643 *-posix*) dflt="$dflt -posix" ;;
5646 *) dflt="$ldflags";;
5648 # See note above about -fstack-protector
5650 *-fstack-protector-strong*)
5652 *-fstack-protector-strong*) ;; # Don't add it again
5653 *) dflt="$dflt -fstack-protector-strong" ;;
5656 *-fstack-protector*)
5658 *-fstack-protector*) ;; # Don't add it again
5659 *) dflt="$dflt -fstack-protector" ;;
5664 : Try to guess additional flags to pick up local libraries.
5665 for thislibdir in $libpth; do
5666 case " $loclibpth " in
5669 *"-L$thislibdir "*) ;;
5670 *) dflt="$dflt -L$thislibdir" ;;
5682 Your C linker may need flags. For this question you should
5683 include -L/whatever and any other flags used by the C linker, but you
5684 should NOT include libraries like -lwhatever.
5686 Make sure you include the appropriate -L/path flags if your C linker
5687 does not normally search all of the directories you specified above,
5690 To use no flags, specify the word "none".
5694 rp="Any additional ld flags (NOT including libraries)?"
5700 rmlist="$rmlist pdp11"
5704 echo "Checking your choice of C compiler and flags for coherency..." >&4
5705 $cat > try.c <<'EOF'
5707 int main() { printf("Ok\n"); return(0); }
5709 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5711 $cat >try.msg <<'EOM'
5712 I've tried to compile and run the following simple program:
5715 $cat try.c >> try.msg
5717 $cat >> try.msg <<EOM
5724 and I got the following output:
5728 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5729 if $sh -c "$run ./try " >>try.msg 2>&1; then
5733 *) echo 'The program compiled OK, but produced no output.' >> try.msg ;;
5736 echo "The program compiled OK, but exited with status $?." >>try.msg
5737 rp="You have a problem. Shall I abort Configure"
5741 echo "I can't compile the test program." >>try.msg
5742 rp="You have a BIG problem. Shall I abort Configure"
5748 case "$knowitall" in
5750 echo "(The supplied flags or libraries might be incorrect.)"
5758 *) echo "Ok. Stopping Configure." >&4
5763 n) echo "OK, that should do.";;
5765 $rm_try gcctest gcctest.out
5767 : define a shorthand compile call
5771 case "$usedevel" in $define|true|[yY]*) if $test ! -f "${mc_file}.c"; then
5772 echo "Internal Configure script bug - compiler test file ${mc_file}.c is missing. Please report this to perlbug@perl.org" >&4;
5776 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5777 : define a shorthand compile call for compilations that should be ok.
5781 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5783 : stub, used only to satisfy other units
5786 : check for lengths of integral types
5790 echo "Checking to see how big your integers are..." >&4
5799 printf("intsize=%d;\n", (int)sizeof(int));
5800 printf("longsize=%d;\n", (int)sizeof(long));
5801 printf("shortsize=%d;\n", (int)sizeof(short));
5806 if eval $compile_ok && $run ./try > /dev/null; then
5808 echo "Your integers are $intsize bytes long."
5809 echo "Your long integers are $longsize bytes long."
5810 echo "Your short integers are $shortsize bytes long."
5814 Help! I can't compile and run the intsize test program: please enlighten me!
5815 (This is probably a misconfiguration in your system or libraries, and
5816 you really ought to fix it. Still, I'll try anyway.)
5820 rp="What is the size of an integer (in bytes)?"
5824 rp="What is the size of a long integer (in bytes)?"
5828 rp="What is the size of a short integer (in bytes)?"
5836 : check for long long
5838 echo "Checking to see if you have long long..." >&4
5839 echo 'int main() { long long x = 7; return 0; }' > try.c
5841 if eval $compile; then
5843 echo "You have long long."
5846 echo "You do not have long long."
5852 : check for length of long long
5853 case "${d_longlong}${longlongsize}" in
5856 echo "Checking to see how big your long longs are..." >&4
5857 $cat >try.c <<'EOCP'
5861 printf("%d\n", (int)sizeof(long long));
5866 if eval $compile_ok; then
5867 longlongsize=`$run ./try`
5868 echo "Your long longs are $longlongsize bytes long."
5872 echo "(I can't seem to compile the test program. Guessing...)"
5873 rp="What is the size of a long long (in bytes)?"
5877 if $test "X$longsize" = "X$longlongsize"; then
5878 echo "(That isn't any different from an ordinary long.)"
5884 : determine filename position in cpp output
5886 echo "Computing filename position in cpp output for #include directives..." >&4
5888 amigaos) fieldn=3 ;; # Workaround for a bug in abc (pdksh).
5893 vos) testaccess=-e ;;
5896 echo '#include <stdio.h>' > foo.c
5899 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5900 $grep '^[ ]*#.*stdio\.h' | \
5901 while read cline; do
5904 while $test \$# -gt 0; do
5905 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5910 pos=\`expr \$pos + 1\`
5924 *) pos="${fieldn}th";;
5926 echo "Your cpp writes the filename in the $pos field of the line."
5928 : locate header file
5933 for usrincdir in $incpth
5935 if test -f \$usrincdir/\$wanted; then
5936 echo "\$usrincdir/\$wanted"
5940 awkprg='{ print \$$fieldn }'
5941 echo "#include <\$wanted>" > foo\$\$.c
5942 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5943 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5944 while read cline; do
5945 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5947 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5948 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5953 # status = 0: grep returned 0 lines, case statement not executed
5954 # status = 1: headerfile found
5955 # status = 2: while loop executed, no headerfile found
5959 if test \$status -eq 1; then
5966 : define an alternate in-header-list? function
5967 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5968 cont=true; xxf="echo \"<\$1> found.\" >&4";
5969 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5970 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5972 case $# in 4) instead=instead;; *) instead="at last";; esac;
5973 while $test "$cont"; do
5975 var=$2; eval "was=\$$2";
5976 if $test "$xxx" && $test -r "$xxx";
5978 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5981 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5982 set $yyy; shift; shift; yyy=$@;
5983 case $# in 0) cont="";;
5984 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5985 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5986 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5987 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5991 do set $yyy; var=$2; eval "was=\$$2";
5992 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5993 set $yyy; shift; shift; yyy=$@;
5996 : see if inttypes.h is available
5997 : we want a real compile instead of Inhdr because some systems
5998 : have an inttypes.h which includes non-existent headers
6001 #include <inttypes.h>
6003 static int32_t foo32 = 0x12345678;
6007 if eval $compile; then
6008 echo "<inttypes.h> found." >&4
6011 echo "<inttypes.h> NOT found." >&4
6020 echo "Checking to see if you have int64_t..." >&4
6022 #include <sys/types.h>
6023 #$i_inttypes I_INTTYPES
6025 #include <inttypes.h>
6027 int main() { int64_t x = 7; }
6030 if eval $compile; then
6032 echo "You have int64_t."
6035 echo "You do not have int64_t."
6041 : Check if 64bit ints have a quad type
6043 echo "Checking which 64-bit integer type we could use..." >&4
6049 val='"unsigned int"'
6054 *) case "$longsize" in
6058 val='"unsigned long"'
6063 *) case "$d_longlong:$longlongsize" in
6068 val='"unsigned long long"'
6073 *) case "$d_int64_t" in
6092 '') echo "Alas, no 64-bit integer types in sight." >&4
6095 *) echo "We could use '$quadtype' for 64-bit integers." >&4
6100 : Do we want 64bit support
6101 case "$uselonglong" in
6102 "$define"|true|[yY]*)
6105 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
6107 use64bitint="$define"
6110 case "$use64bits" in
6111 "$define"|true|[yY]*)
6114 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
6116 use64bitint="$define"
6119 case "$use64bitints" in
6120 "$define"|true|[yY]*)
6123 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
6125 use64bitint="$define"
6128 case "$use64bitsint" in
6129 "$define"|true|[yY]*)
6132 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
6134 use64bitint="$define"
6137 case "$uselonglongs" in
6138 "$define"|true|[yY]*)
6141 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
6143 use64bitint="$define"
6146 case "$use64bitsall" in
6147 "$define"|true|[yY]*)
6150 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
6152 use64bitall="$define"
6157 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
6159 case "$use64bitall" in
6160 "$define"|true|[yY]*) use64bitint="$define" ;;
6166 You have natively 64-bit long integers.
6170 *) case "$use64bitint" in
6171 "$define"|true|[yY]*) dflt='y';;
6180 Perl can be built to take advantage of 64-bit integer types
6181 on some systems. To do so, Configure can be run with -Duse64bitint.
6182 Choosing this option will most probably introduce binary incompatibilities.
6184 If this doesn't make any sense to you, just accept the default '$dflt'.
6185 (The default has been chosen based on your configuration.)
6187 rp='Try to use 64-bit integers, if available?'
6190 [yY]*) val="$define" ;;
6198 case "$use64bitall" in
6199 "$define"|true|[yY]*) dflt='y' ;;
6200 *) case "$longsize" in
6208 You may also choose to try maximal 64-bitness. It means using as much
6209 64-bitness as possible on the platform. This in turn means even more
6210 binary incompatibilities. On the other hand, your platform may not
6211 have any more 64-bitness available than what you already have chosen.
6213 If this doesn't make any sense to you, just accept the default '$dflt'.
6214 (The default has been chosen based on your configuration.)
6216 rp='Try to use maximal 64-bit support, if available?'
6219 [yY]*) val="$define" ;;
6224 case "$use64bitall" in
6226 case "$use64bitint" in
6230 Since you have chosen a maximally 64-bit build, I'm also turning on
6231 the use of 64-bit integers.
6233 use64bitint="$define" ;;
6238 : Look for a hint-file generated 'call-back-unit'. If the
6239 : user has specified that a 64-bit perl is to be built,
6240 : we may need to set or change some other defaults.
6241 if $test -f use64bitint.cbu; then
6242 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
6245 case "$use64bitint" in
6246 "$define"|true|[yY]*)
6247 : This test was common to all the OpenBSD forks, and seems harmless for
6250 echo "Checking if your C library has broken 64-bit functions..." >&4
6253 typedef $uquadtype myULL;
6260 {4294967303.15, 4294967303ULL},
6261 {4294967294.2, 4294967294ULL},
6262 {4294967295.7, 4294967295ULL},
6265 for (p = test; p->u; p++) {
6266 myULL x = (myULL)p->d;
6277 if eval $compile_ok; then
6278 libcquad=`$run ./try`
6279 echo "Your C library's 64-bit functions are $libcquad."
6281 echo "(I can't seem to compile the test program.)"
6282 echo "Assuming that your C library's 64-bit functions are ok."
6291 *** You have a C library with broken 64-bit functions.
6292 *** 64-bit support does not work reliably in this configuration.
6293 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
6294 *** Cannot continue, aborting.
6301 4) case "$archname64" in
6302 '') archname64=64int ;;
6309 : Look for a hint-file generated 'call-back-unit'. If the
6310 : user has specified that a maximally 64-bit perl is to be built,
6311 : we may need to set or change some other defaults.
6312 if $test -f use64bitall.cbu; then
6313 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
6316 case "$use64bitall" in
6317 "$define"|true|[yY]*)
6319 4) case "$archname64" in
6320 ''|64int) archname64=64all ;;
6327 case "$d_quad:$use64bitint" in
6331 *** You have chosen to use 64-bit integers,
6332 *** but none can be found.
6333 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
6334 *** Cannot continue, aborting.
6341 : Check if we are using the GNU C library
6343 echo "Checking for GNU C Library..." >&4
6345 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
6346 alone are insufficient to distinguish different versions, such as
6347 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
6348 libc version 2.1.0. A. Dougherty, June 3, 2002.
6354 # ifdef __GLIBC_MINOR__
6355 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
6356 # include <gnu/libc-version.h>
6357 printf("%s\n", gnu_get_libc_version());
6359 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
6362 printf("%d\n", __GLIBC__);
6371 if eval $compile_ok && $run ./try > glibc.ver; then
6373 gnulibc_version=`$cat glibc.ver`
6374 echo "You are using the GNU C Library version $gnulibc_version"
6378 echo "You are not using the GNU C Library"
6384 : see if nm is to be used to determine whether a symbol is defined or not
6388 case "$d_gnulibc" in
6391 echo "nm probably won't work on the GNU C Library." >&4
6397 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
6399 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
6400 echo "'nm' won't be sufficient on this system." >&4
6406 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
6407 if $test $dflt -gt 20; then
6417 true|$define) dflt=y;;
6424 I can use $nm to extract the symbols from your C libraries. This
6425 is a time consuming task which may generate huge output on the disk (up
6426 to 3 megabytes) but that should make the symbols extraction faster. The
6427 alternative is to skip the 'nm' extraction part and to compile a small
6428 test program instead to determine whether each symbol is present. If
6429 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
6430 this may be the best solution.
6432 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
6435 rp="Shall I use $nm to extract C symbols from the libraries?"
6438 [Nn]*) usenm=false;;
6447 : nm options which may be necessary
6449 '') if $test -f /mach_boot; then
6451 elif $test -d /usr/ccs/lib; then
6452 nm_opt='-p' # Solaris (and SunOS?)
6453 elif $test -f /dgux; then
6455 elif $test -f /lib64/rld; then
6456 nm_opt='-p' # 64-bit Irix
6462 : nm options which may be necessary for shared libraries but illegal
6463 : for archive libraries. Thank you, Linux.
6464 case "$nm_so_opt" in
6465 '') case "$myuname" in
6467 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
6468 nm_so_opt='--dynamic'
6475 : Figure out where the libc is located
6478 : get list of predefined functions in a handy place
6483 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
6489 *) for thislib in $libs; do
6492 : Handle C library specially below.
6495 thislib=`echo $thislib | $sed -e 's/^-l//'`
6496 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
6498 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
6500 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
6502 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
6504 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
6506 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
6508 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
6513 libnames="$libnames $try"
6515 *) libnames="$libnames $thislib" ;;
6524 for xxx in $libpth; do
6525 $test -r $1 || set $xxx/libc.$so
6526 : The messy sed command sorts on library version numbers.
6528 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
6529 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
6531 s/[0-9][0-9]*/0000&/g
6532 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
6535 $sort | $sed -e 's/^.* //'`
6538 $test -r $1 || set $sysroot/usr/ccs/lib/libc.$so
6539 $test -r $1 || set $sysroot/lib/libsys_s$_a
6545 if $test -r "$1"; then
6546 echo "Your (shared) C library seems to be in $1."
6548 elif $test -r /lib/libc && $test -r /lib/clib; then
6549 echo "Your C library seems to be in both /lib/clib and /lib/libc."
6551 libc='/lib/clib /lib/libc'
6552 if $test -r /lib/syslib; then
6553 echo "(Your math library is in /lib/syslib.)"
6554 libc="$libc /lib/syslib"
6556 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
6557 echo "Your C library seems to be in $libc, as you said before."
6558 elif $test -r $incpath/usr/lib/libc$_a; then
6559 libc=$incpath/usr/lib/libc$_a;
6560 echo "Your C library seems to be in $libc. That's fine."
6561 elif $test -r /lib/libc$_a; then
6563 echo "Your C library seems to be in $libc. You're normal."
6565 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
6567 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
6568 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
6569 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
6571 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
6573 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
6576 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
6578 if $test -r "$tans"; then
6579 echo "Your C library seems to be in $tans, of all places."
6585 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
6589 If the guess above is wrong (which it might be if you're using a strange
6590 compiler, or your machine supports multiple models), you can override it here.
6595 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
6597 I can't seem to find your C library. I've looked in the following places:
6600 $sed 's/^/ /' libpath
6603 None of these seems to contain your C library. I need to get its name...
6608 rp='Where is your C library?'
6613 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
6614 set X `cat libnames`
6617 case $# in 1) xxx=file; esac
6618 echo "Extracting names from the following $xxx for later perusal:" >&4
6620 $sed 's/^/ /' libnames >&4
6622 $echo $n "This may take a while...$c" >&4
6626 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
6627 *) $nm $nm_opt $file 2>/dev/null;;
6632 $grep fprintf libc.tmp > libc.ptf
6633 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
6634 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
6636 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
6638 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6640 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
6642 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6644 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
6646 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6648 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
6650 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6652 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
6654 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6656 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
6658 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6660 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
6661 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
6663 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6665 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
6667 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6669 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
6671 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6673 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
6675 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6677 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
6679 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6681 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
6683 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6685 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
6687 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6689 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
6691 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6694 $nm -p $* 2>/dev/null >libc.tmp
6695 $grep fprintf libc.tmp > libc.ptf
6696 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
6697 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
6703 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
6705 if $ar t $libc > libc.tmp && \
6706 $contains '^fprintf$' libc.tmp >/dev/null 2>&1
6708 for thisname in $libnames $libc; do
6709 $ar t $thisname >>libc.tmp
6711 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
6713 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
6714 for thisname in $libnames $libc; do
6715 $ar tv $thisname >>libc.tmp
6716 emximp -o tmp.imp $thisname \
6718 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
6719 < tmp.imp >>libc.tmp
6722 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
6725 echo "$ar didn't seem to work right." >&4
6726 echo "Maybe this is a Cray...trying bld instead..." >&4
6728 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list &&
6731 for thisname in $libnames; do
6733 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
6734 $ar t $thisname >>libc.tmp
6738 echo "That didn't work either. Giving up." >&4
6748 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
6749 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
6751 *) if $test -f /lib/syscalls.exp; then
6753 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
6754 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' \
6755 /lib/syscalls.exp >>libc.list
6761 $rm -f libnames libpath
6763 : Check if we are using C++
6765 echo "Checking for C++..." >&4
6766 $cat >try.c <<'EOCP'
6778 if eval $compile_ok && $run ./try; then
6780 echo "You are using a C++ compiler."
6783 echo "You are not using a C++ compiler."
6789 : is a C symbol defined?
6792 -v) tf=libc.tmp; tdc="";;
6793 -a) tf=libc.tmp; tdc="[]";;
6794 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
6796 case "$d_cplusplus" in
6797 $define) extern_C="extern \"C\"" ;;
6798 *) extern_C="extern" ;;
6801 case "$reuseval-$4" in
6803 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
6808 if $test "$runnm" = true; then
6809 if $contains $tlook $tf >/dev/null 2>&1; then
6811 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
6812 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;
6813 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
6814 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
6818 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;
6819 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
6825 $define) tval=true;;
6832 : define an is-in-libc? function
6833 inlibc='echo " "; td=$define; tu=$undef;
6834 sym=$1; var=$2; eval "was=\$$2";
6836 case "$reuseval$was" in
6846 echo "$sym() found." >&4;
6847 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
6849 echo "$sym() NOT found." >&4;
6850 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
6854 $define) echo "$sym() found." >&4;;
6855 *) echo "$sym() NOT found." >&4;;
6859 : check for length of double
6861 case "$doublesize" in
6863 echo "Checking to see how big your double precision numbers are..." >&4
6872 printf("%d\n", (int)sizeof(double));
6877 if eval $compile_ok; then
6878 doublesize=`$run ./try`
6879 echo "Your double is $doublesize bytes long."
6882 echo "(I can't seem to compile the test program. Guessing...)"
6883 rp="What is the size of a double precision number (in bytes)?"
6891 : check for long doubles
6893 echo "Checking to see if you have long double..." >&4
6894 echo 'int main() { long double x = 7.0; }' > try.c
6896 if eval $compile; then
6898 echo "You have long double."
6901 echo "You do not have long double."
6907 : see if ldexpl exists
6911 : check for length of long double
6912 case "${d_longdbl}${longdblsize}" in
6915 echo "Checking to see how big your long doubles are..." >&4
6916 $cat >try.c <<'EOCP'
6920 printf("%d\n", sizeof(long double));
6925 if eval $compile; then
6926 longdblsize=`$run ./try`
6927 echo "Your long doubles are $longdblsize bytes long."
6931 echo "(I can't seem to compile the test program. Guessing...)" >&4
6932 rp="What is the size of a long double (in bytes)?"
6936 if $test "X$doublesize" = "X$longdblsize"; then
6937 echo "That isn't any different from an ordinary double."
6938 echo "I'll keep your setting anyway, but you may see some"
6939 echo "harmless compilation warnings."
6945 $echo "Checking the kind of long doubles you have..." >&4
6946 case "$d_longdbl" in
6950 #define LONGDBLSIZE $longdblsize
6951 #define DOUBLESIZE $doublesize
6957 static const long double d = -0.1L;
6959 unsigned const char* b = (unsigned const char*)(&d);
6960 #if DOUBLESIZE == LONGDBLSIZE
6961 printf("0\n"); /* if it floats like double */
6964 #if (LDBL_MANT_DIG == 113 || FLT128_MANT_DIG == 113) && LONGDBLSIZE == 16
6965 if (b[0] == 0x9A && b[1] == 0x99 && b[15] == 0xBF) {
6966 /* IEEE 754 128-bit little-endian */
6970 if (b[0] == 0xBF && b[14] == 0x99 && b[15] == 0x9A) {
6971 /* IEEE 128-bit big-endian, e.g. solaris sparc */
6976 /* For alignment 32-bit platforms have the 80 bits in 12 bytes,
6977 * while 64-bits platforms have it in 16 bytes. The trailing bytes
6978 * cannot be trusted. */
6979 #if LDBL_MANT_DIG == 64 && (LONGDBLSIZE == 16 || LONGDBLSIZE == 12)
6980 if (b[0] == 0xCD && b[9] == 0xBF) {
6981 /* x86 80-bit little-endian, sizeof 12 (ILP32, Solaris x86)
6982 * or 16 (LP64, Linux and OS X), 4 or 6 bytes of padding.
6983 * Also known as "extended precision". */
6987 if (b[0] == 0xBF && b[9] == 0xCD) {
6988 /* Is there ever big-endian 80-bit, really?
6990 * The Motorola 68881 had another "extended precision" format:
6991 * sign:1 exp:15 zero:16 integer:1 mantissa:63
6992 * for total of 96 bits of bytes. The zero bits were unused.
6993 * See "M68000 FAMILY PROGRAMMER’S REFERENCE MANUAL" for more details.
6994 * If it ever becomes relevant, this format should be allocated
6995 * a new doublekind code since it's quite different from the Intel x87.
7001 #if (LDBL_MANT_DIG == 106 || LDBL_MANT_DIG == 107) && LONGDBLSIZE == 16
7002 /* software "double double", the 106 is 53+53.
7003 * but irix thinks it is 107. */
7004 if (b[0] == 0x9A && b[7] == 0x3C && b[8] == 0x9A && b[15] == 0xBF) {
7005 /* double double 128-bit fully little-endian,
7006 * little-endian doubles in little-endian order,
7007 * 9a 99 99 99 99 99 59 3c 9a 99 99 99 99 99 b9 bf */
7011 if (b[0] == 0xBF && b[7] == 0x9A && b[8] == 0x3C && b[15] == 0x9A) {
7012 /* double double 128-bit fully big-endian,
7013 * big-endian doubles in big-endian order,
7014 * e.g. PPC/Power and MIPS:
7015 * bf b9 99 99 99 99 99 9a 3c 59 99 99 99 99 99 9a */
7019 if (b[0] == 0x9A && b[7] == 0xBF && b[8] == 0x9A && b[15] == 0x3C) {
7020 /* double double 128-bit mixed endian.
7021 * little-endian doubles in big-endian order,
7023 * 9a 99 99 99 99 99 b9 bf 9a 99 99 99 99 99 59 3c */
7027 if (b[0] == 0x3C && b[7] == 0x9A && b[8] == 0xBF && b[15] == 0x9A) {
7028 /* double double 128-bit mixed endian,
7029 * big-endian doubles in little-endian order,
7030 * 3c 59 99 99 99 99 99 9a bf b9 99 99 99 99 99 9a */
7035 /* We are largely making this up because it may well be
7036 * that the VAX format H was never made available to C,
7037 * only to Fortran. */
7038 #if LONGDBLSIZE == 16 && defined(__vax__)
7039 if (b[0] == 0xFD && b[15] == 0x99) {
7040 /* VAX format H, PDP-11 mixed endian. */
7045 printf("-1\n"); /* unknown */
7050 if eval $compile; then
7051 longdblkind=`$run ./try`
7058 case "$longdblkind" in
7059 0) echo "Your long doubles are doubles." >&4 ;;
7060 1) echo "You have IEEE 754 128-bit little endian long doubles." >&4 ;;
7061 2) echo "You have IEEE 754 128-bit big endian long doubles." >&4 ;;
7062 3) echo "You have x86 80-bit little endian long doubles." >& 4 ;;
7063 4) echo "You have x86 80-bit big endian long doubles." >& 4 ;;
7064 5) echo "You have 128-bit fully little-endian double-double long doubles (64-bit LEs in LE)." >& 4 ;;
7065 6) echo "You have 128-bit fully big-endian double-double long doubles (64-bit BEs in BE)." >& 4 ;;
7066 7) echo "You have 128-bit mixed-endian double-double long doubles (64-bit LEs in BE)." >& 4 ;;
7067 8) echo "You have 128-bit mixed-endian double-double long doubles (64-bit BEs in LE)." >& 4 ;;
7068 9) echo "You have 128-bit PDP-style mixed-endian long doubles (VAX format H)." >& 4 ;;
7069 *) echo "Cannot figure out your long double." >&4 ;;
7071 d_long_double_style_ieee=$undef
7072 d_long_double_style_ieee_std=$undef
7073 d_long_double_style_ieee_extended=$undef
7074 d_long_double_style_ieee_doubledouble=$undef
7075 d_long_double_style_vax=$undef
7076 case "$longdblkind" in
7077 1|2|3|4|5|6|7|8) d_long_double_style_ieee=$define ;;
7079 case "$longdblkind" in
7080 1|2) d_long_double_style_ieee_std=$define ;;
7082 case "$longdblkind" in
7083 3|4) d_long_double_style_ieee_extended=$define ;;
7085 case "$longdblkind" in
7086 5|6|7|8) d_long_double_style_ieee_doubledouble=$define ;;
7088 case "$longdblkind" in
7089 9) d_long_double_style_vax=$define ;;
7093 : determine the architecture name
7095 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
7096 tarch=`arch`"-$osname"
7097 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
7098 if uname -m > tmparch 2>&1 ; then
7099 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
7100 -e 's/$/'"-$osname/" tmparch`
7108 case "$myarchname" in
7111 echo "(Your architecture name used to be $myarchname.)"
7115 case "$targetarch" in
7117 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
7122 *) dflt="$archname";;
7124 rp='What is your architecture name'
7128 : optionally add API version to the architecture for versioned archlibs
7129 case "$useversionedarchname" in
7130 $define|true|[yY]*) dflt='y';;
7133 rp='Add the Perl API version to your archname?'
7136 y|Y) useversionedarchname="$define" ;;
7137 *) useversionedarchname="$undef" ;;
7139 case "$useversionedarchname" in
7142 *-$api_versionstring)
7143 echo "...and architecture name already has -$api_versionstring" >&4
7146 archname="$archname-$api_versionstring"
7147 echo "...setting architecture name to $archname." >&4
7153 case "$usethreads" in
7155 echo "Threads selected." >&4
7157 *-thread*) echo "...and architecture name already has -thread." >&4
7159 *) archname="$archname-thread"
7160 echo "...setting architecture name to $archname." >&4
7165 case "$usemultiplicity" in
7167 echo "Multiplicity selected." >&4
7169 *-multi*) echo "...and architecture name already has -multi." >&4
7171 *) archname="$archname-multi"
7172 echo "...setting architecture name to $archname." >&4
7177 case "$use64bitint$use64bitall" in
7179 case "$archname64" in
7181 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
7184 case "$use64bitint" in
7185 "$define") echo "64 bit integers selected." >&4 ;;
7187 case "$use64bitall" in
7188 "$define") echo "Maximal 64 bitness selected." >&4 ;;
7191 *-$archname64*) echo "...and architecture name already has $archname64." >&4
7193 *) archname="$archname-$archname64"
7194 echo "...setting architecture name to $archname." >&4
7200 case "$uselongdouble" in
7202 echo "Long doubles selected." >&4
7203 case "$longdblsize" in
7205 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
7209 *-ld*) echo "...and architecture name already has -ld." >&4
7211 *) archname="$archname-ld"
7212 echo "...setting architecture name to $archname." >&4
7219 case "$usequadmath" in
7221 echo "quadmath selected." >&4
7223 *-quadmath*) echo "...and architecture name already has -quadmath." >&4
7225 *) archname="$archname-quadmath"
7226 echo "...setting architecture name to $archname." >&4
7231 if $test -f archname.cbu; then
7232 echo "Your platform has some specific hints for architecture name, using them..."
7236 : set the prefixit variable, to compute a suitable default value
7237 prefixit='case "$3" in
7239 case "$oldprefix" in
7240 "") eval "$1=\"\$$2\"";;
7247 ""|" ") eval "$1=\"\$$2\"";;
7253 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
7255 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
7256 /*-$oldprefix/*|\~*-$oldprefix/*)
7257 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
7258 *) eval "$1=\"\$$2\"";;
7262 : determine installation style
7263 : For now, try to deduce it from prefix unless it is already set.
7264 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
7265 case "$installstyle" in
7266 '') case "$prefix" in
7267 *perl*) dflt='lib';;
7268 *) dflt='lib/perl5' ;;
7271 *) dflt="$installstyle" ;;
7273 : Probably not worth prompting for this since we prompt for all
7274 : the directories individually, and the prompt would be too long and
7278 : determine where public executables go
7283 rp='Pathname where the public executables will reside?'
7285 if $test "X$ansexp" != "X$binexp"; then
7289 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
7290 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
7291 : this via initialinstalllocation
7294 case "$userelocatableinc" in
7295 $define|true|[yY]*) dflt='y' ;;
7300 Would you like to build Perl so that the installation is relocatable, so that
7301 library paths in @INC are determined relative to the path of the perl binary?
7302 This is not advised for system Perl installs, or if you need to run setid
7303 scripts or scripts under taint mode.
7305 If this doesn't make any sense to you, just accept the default '$dflt'.
7307 rp='Use relocatable @INC?'
7310 y|Y) val="$define" ;;
7313 set userelocatableinc
7316 initialinstalllocation="$binexp"
7317 : Default prefix is now "up one level from where the binaries are"
7318 case "$userelocatableinc" in
7324 installprefixexp=".../.."
7328 : determine where private library files go
7329 : Usual default is /usr/local/lib/perl5/$version.
7330 : Also allow things like /opt/perl/lib/$version, since
7331 : /opt/perl/lib/perl5... would be redundant.
7332 : The default "style" setting is made in installstyle.U
7333 case "$installstyle" in
7334 *lib/perl5*) set dflt privlib lib/$package/$version ;;
7335 *) set dflt privlib lib/$version ;;
7340 There are some auxiliary files for $package that need to be put into a
7341 private library directory that is accessible by everyone.
7346 rp='Pathname where the private library files will reside?'
7351 : set the prefixup variable, to restore leading tilda escape
7352 prefixup='case "$prefixexp" in
7354 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
7357 : determine where public architecture dependent libraries go
7360 : privlib default is /usr/local/lib/$package/$version
7361 : archlib default is /usr/local/lib/$package/$version/$archname
7362 : privlib may have an optional trailing /share.
7363 tdflt=`echo $privlib | $sed 's,/share$,,'`
7364 tdflt=$tdflt/$archname
7373 $spackage contains architecture-dependent library files. If you are
7374 sharing libraries in a heterogeneous environment, you might store
7375 these files in a separate location. Otherwise, you can just include
7376 them with the rest of the public library files.
7381 rp='Where do you want to put the public architecture-dependent libraries?'
7385 if $test X"$archlib" = X"$privlib"; then
7391 : see if setuid scripts can be secure
7394 Some kernels have a bug that prevents setuid #! scripts from being
7395 secure. Some sites have disabled setuid #! scripts because of this.
7397 First let's decide if your kernel supports secure setuid #! scripts.
7398 (If setuid #! scripts would be secure but have been disabled anyway,
7399 don't say that they are secure if asked.)
7404 if $test -d /dev/fd; then
7405 echo "#!$ls" >reflect
7406 chmod +x,u+s reflect
7407 ./reflect >flect 2>&1
7408 if $contains "/dev/fd" flect >/dev/null; then
7409 echo "Congratulations, your kernel has secure setuid scripts!" >&4
7413 If you are not sure if they are secure, I can check but I'll need a
7414 username and password different from the one you are using right now.
7415 If you don't have such a username or don't want me to test, simply
7419 rp='Other username to test security of setuid scripts with?'
7424 case "$d_suidsafe" in
7425 '') echo "I'll assume setuid scripts are *not* secure." >&4
7428 echo "Well, the $hint value is *not* secure." >&4
7430 *) echo "Well, the $hint value *is* secure." >&4
7435 $rm -f reflect flect
7436 echo "#!$ls" >reflect
7437 chmod +x,u+s reflect
7440 echo '"su" will (probably) prompt you for '"$ans's password."
7441 su $ans -c './reflect >flect'
7442 if $contains "/dev/fd" flect >/dev/null; then
7443 echo "Okay, it looks like setuid scripts are secure." >&4
7446 echo "I don't think setuid scripts are secure." >&4
7451 rp='Does your kernel have *secure* setuid scripts?'
7454 [yY]*) val="$define";;
7459 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
7460 echo "(That's for file descriptors, not floppy disks.)"
7466 $rm -f reflect flect
7468 : now see if they want to do setuid emulation
7469 if $test $patchlevel -lt 11; then
7472 case "$d_suidsafe" in
7475 echo "No need to emulate SUID scripts since they are secure here." >&4
7479 Some systems have disabled setuid scripts, especially systems where
7480 setuid scripts cannot be secure. On systems where setuid scripts have
7481 been disabled, the setuid/setgid bits on scripts are currently
7482 useless. It is possible for $package to detect those bits and emulate
7483 setuid/setgid in a secure fashion. This emulation will only work if
7484 setuid scripts have been disabled in your kernel.
7488 "$define") dflt=y ;;
7491 rp="Do you want to do setuid/setgid emulation?"
7494 [yY]*) val="$define";;
7506 SUID emulation has been removed for 5.12
7507 Please re-run Configure without -Dd_dosuid
7516 : Find perl5.005 or later.
7517 echo "Looking for a previously installed perl5.005 or later... "
7519 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
7520 : Check if this perl is recent and can load a simple module
7521 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
7524 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
7534 '') echo "None found. That's ok.";;
7535 *) echo "Using $perl5." ;;
7538 : Set the siteprefix variables
7541 After $package is installed, you may wish to install various
7542 add-on modules and utilities. Typically, these add-ons will
7543 be installed under $prefix with the rest
7544 of this package. However, you may wish to install such add-ons
7545 elsewhere under a different prefix.
7547 If you do not wish to put everything under a single prefix, that's
7548 ok. You will be prompted for the individual locations; this siteprefix
7549 is only used to suggest the defaults.
7551 The default should be fine for most people.
7555 rp='Installation prefix to use for add-on modules and utilities?'
7556 : XXX Here might be another good place for an installstyle setting.
7557 case "$siteprefix" in
7559 *) dflt=$siteprefix ;;
7562 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
7564 case "$siteprefix" in
7568 *) oldsiteprefix="$prefix";;
7573 siteprefixexp="$ansexp"
7575 : determine where site specific libraries go.
7576 : Usual default is /usr/local/lib/perl5/site_perl/$version
7577 : The default "style" setting is made in installstyle.U
7578 : XXX No longer works with Prefixit stuff.
7579 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7581 '') case "$installstyle" in
7582 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
7583 *) dflt=$siteprefix/lib/site_$prog/$version ;;
7591 The installation process will create a directory for
7592 site-specific extensions and modules. Most users find it convenient
7593 to place all site-specific files in this directory rather than in the
7594 main distribution directory.
7598 rp='Pathname for the site-specific library files?'
7602 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
7604 : Determine list of previous versions to include in @INC
7605 $cat > getverlist <<EOPL
7608 \$api_versionstring = "$api_versionstring";
7609 \$version = "$version";
7610 \$stem = "$sitelib_stem";
7611 \$archname = "$archname";
7613 $cat >> getverlist <<'EOPL'
7614 # The list found is store twice for each entry: the original name, and
7615 # the binary broken down version as pack "sss", so sorting is easy and
7616 # unambiguous. This will work for all versions that have a maximum of
7617 # three digit groups, separate by '.'s or '_'s. Names are extended with
7618 # ".0.0" to ensure at least three elements for the pack.
7619 # -- H.Merijn Brand (m)'06 23-10-2006
7621 # Can't have leading @ because metaconfig interprets it as a command!
7622 ;@inc_version_list=();
7623 # XXX Redo to do opendir/readdir?
7626 ;@candidates = map {
7627 [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
7628 ;@candidates = sort { $a->[1] cmp $b->[1]} @candidates;
7634 ($pversion, $aversion, $vsn5005) = map {
7635 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
7636 foreach $d (@candidates) {
7637 if ($d->[1] lt $pversion) {
7638 if ($d->[1] ge $aversion) {
7639 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
7641 elsif ($d->[1] ge $vsn5005) {
7642 unshift(@inc_version_list, grep { -d } $d->[0]);
7646 # Skip newer version. I.e. don't look in
7647 # 5.7.0 if we're installing 5.6.1.
7651 if (@inc_version_list) {
7652 print join(' ', @inc_version_list);
7655 # Blank space to preserve value for next Configure run.
7660 case "$inc_version_list" in
7661 '') if test -x "$perl5$exe_ext"; then
7662 dflt=`$perl5 getverlist`
7667 $undef) dflt='none' ;;
7668 *) eval dflt=\"$inc_version_list\" ;;
7671 ''|' ') dflt=none ;;
7678 In order to ease the process of upgrading, this version of perl
7679 can be configured to use modules built and installed with earlier
7680 versions of perl that were installed under $prefix. Specify here
7681 the list of earlier versions that this version of perl should check.
7682 If Configure detected no earlier versions of perl installed under
7683 $prefix, then the list will be empty. Answer 'none' to tell perl
7684 to not search earlier versions.
7686 The default should almost always be sensible, so if you're not sure,
7687 just accept the default.
7690 rp='List of earlier versions to include in @INC?'
7693 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
7694 *) inc_version_list="$ans" ;;
7696 case "$inc_version_list" in
7698 inc_version_list_init='0'
7699 d_inc_version_list="$undef"
7701 *) inc_version_list_init=`echo $inc_version_list |
7702 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
7703 d_inc_version_list="$define"
7708 : see if malloc/malloc.h has to be included
7709 set malloc/malloc.h i_mallocmalloc
7712 : see if this is a malloc.h system
7713 : we want a real compile instead of Inhdr because some systems have a
7714 : malloc.h that just gives a compile error saying to use stdlib.h instead
7719 #$i_mallocmalloc I_MALLOCMALLOC
7720 #ifdef I_MALLOCMALLOC
7721 # include <malloc/malloc.h>
7724 int main () { return 0; }
7727 if eval $compile; then
7728 echo "<malloc.h> found." >&4
7731 echo "<malloc.h> NOT found." >&4
7738 : check for length of pointer
7742 echo "Checking to see how big your pointers are..." >&4
7751 printf("%d\n", (int)sizeof(void *));
7756 if eval $compile_ok; then
7757 ptrsize=`$run ./try`
7758 echo "Your pointers are $ptrsize bytes long."
7761 echo "(I can't seem to compile the test program. Guessing...)" >&4
7762 rp="What is the size of a pointer (in bytes)?"
7769 case "$use64bitall" in
7770 "$define"|true|[yY]*)
7774 *** You have chosen a maximally 64-bit build,
7775 *** but your pointers are only 4 bytes wide.
7776 *** Please rerun Configure without -Duse64bitall.
7781 *** Since you have quads, you could possibly try with -Duse64bitint.
7786 *** Cannot continue, aborting.
7797 : determine whether to use malloc wrapping
7799 case "$usemallocwrap" in
7800 [yY]*|true|$define) dflt='y' ;;
7801 [nN]*|false|$undef) dflt='n' ;;
7802 *) case "$usedevel" in
7803 [yY]*|true|$define) dflt='y' ;;
7808 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
7810 usemallocwrap="$ans"
7813 usemallocwrap="$define" ;;
7815 usemallocwrap="$undef" ;;
7818 : determine which malloc to compile in
7820 case "$usemymalloc" in
7821 [yY]*|true|$define) dflt='y' ;;
7822 [nN]*|false|$undef) dflt='n' ;;
7823 *) case "$ptrsize" in
7827 if test "$useithreads" = "$define"; then dflt='n'; fi
7830 rp="Do you wish to attempt to use the malloc that comes with $package?"
7836 mallocsrc='malloc.c'
7837 mallocobj="malloc$_o"
7838 d_mymalloc="$define"
7841 : Remove malloc from list of libraries to use
7842 echo "Removing unneeded -lmalloc from library list" >&4
7843 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
7846 echo "libs = $libs" >&4
7858 : compute the return types of malloc and free
7860 $cat >malloc.c <<END
7864 #include <sys/types.h>
7878 case "$malloctype" in
7880 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
7887 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
7891 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
7898 echo "Your system uses $freetype free(), it would seem." >&4
7900 : determine where site specific architecture-dependent libraries go.
7901 : sitelib default is /usr/local/lib/perl5/site_perl/$version
7902 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
7903 : sitelib may have an optional trailing /share.
7905 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
7906 dflt="$dflt/$archname"
7911 set sitearch sitearch none
7915 The installation process will also create a directory for
7916 architecture-dependent site-specific extensions and modules.
7920 rp='Pathname for the site-specific architecture-dependent library files?'
7924 if $test X"$sitearch" = X"$sitelib"; then
7927 d_sitearch="$define"
7930 : Set the vendorprefix variables
7933 The installation process will also create a directory for
7934 vendor-supplied add-ons. Vendors who supply perl with their system
7935 may find it convenient to place all vendor-supplied files in this
7936 directory rather than in the main distribution directory. This will
7937 ease upgrades between binary-compatible maintenance versions of perl.
7939 Of course you may also use these directories in whatever way you see
7940 fit. For example, you might use them to access modules shared over a
7941 company-wide network.
7943 The default answer should be fine for most people.
7944 This causes further questions about vendor add-ons to be skipped
7945 and no vendor-specific directories will be configured for perl.
7948 rp='Do you want to configure vendor-specific add-on directories?'
7949 case "$usevendorprefix" in
7950 define|true|[yY]*) dflt=y ;;
7951 *) : User may have set vendorprefix directly on Configure command line.
7952 case "$vendorprefix" in
7961 rp='Installation prefix to use for vendor-supplied add-ons?'
7962 case "$vendorprefix" in
7963 '') dflt="$prefix" ;;
7964 *) dflt=$vendorprefix ;;
7967 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
7969 case "$vendorprefix" in
7973 *) oldvendorprefix="$prefix";;
7977 usevendorprefix="$define"
7979 vendorprefixexp="$ansexp"
7981 *) usevendorprefix="$undef"
7987 : Set the vendorlib variables
7988 case "$vendorprefix" in
7989 '') d_vendorlib="$undef"
7993 *) d_vendorlib="$define"
7994 : determine where vendor-supplied modules go.
7995 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
7996 case "$vendorlib" in
7998 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7999 case "$installstyle" in
8000 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
8001 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
8004 *) dflt="$vendorlib"
8008 rp='Pathname for the vendor-supplied library files?'
8011 vendorlibexp="$ansexp"
8014 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
8018 : Set the vendorarch variables
8019 case "$vendorprefix" in
8020 '') d_vendorarch="$undef"
8024 *) d_vendorarch="$define"
8025 : determine where vendor-supplied architecture-dependent libraries go.
8026 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
8027 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
8028 : vendorlib may have an optional trailing /share.
8029 case "$vendorarch" in
8030 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
8031 dflt="$dflt/$archname"
8033 *) dflt="$vendorarch" ;;
8036 rp='Pathname for vendor-supplied architecture-dependent files?'
8039 vendorarchexp="$ansexp"
8042 prefixvar=vendorarch
8044 if $test X"$vendorarch" = X"$vendorlib"; then
8045 d_vendorarch="$undef"
8047 d_vendorarch="$define"
8050 : Final catch-all directories to search
8053 Lastly, you can have perl look in other directories for extensions and
8054 modules in addition to those already specified.
8055 These directories will be searched after
8059 test X"$vendorlib" != "X" && echo ' ' $vendorlib
8060 test X"$vendorarch" != "X" && echo ' ' $vendorarch
8062 case "$otherlibdirs" in
8063 ''|' ') dflt='none' ;;
8064 *) dflt="$otherlibdirs" ;;
8067 Enter a colon-separated set of extra paths to include in perl's @INC
8068 search path, or enter 'none' for no extra paths.
8072 rp='Colon-separated list of additional directories for perl to search?'
8075 ' '|''|none) otherlibdirs=' ' ;;
8076 *) otherlibdirs="$ans" ;;
8078 case "$otherlibdirs" in
8082 set d_perl_otherlibdirs
8086 dflt_dtrace='/usr/sbin/dtrace'
8087 $test -x /usr/bin/dtrace && dflt_dtrace='/usr/bin/dtrace'
8091 Perl can be built to support DTrace on platforms that support it.
8092 DTrace is a diagnosis and performance analysis tool from Sun.
8094 If this doesn't make any sense to you, just accept the default.
8098 case "$usedtrace" in
8104 dflt_dtrace=$usedtrace
8111 rp='Support DTrace if available?'
8114 y|Y) val="$define" ;;
8120 test "X$usedtrace" != "X$define" && break
8123 rp='Where is the dtrace executable?'
8132 if $dtrace -h -s ../perldtrace.d \
8133 -o perldtrace.tmp >/dev/null 2>&1 \
8134 && rm -f perldtrace.tmp
8137 echo "Good: your $dtrace knows about the -h flag."
8141 *** $me: Fatal Error: $dtrace doesn't support -h flag
8143 *** Your installed dtrace doesn't support the -h switch to compile a D
8144 *** program into a C header. Can't continue.
8156 *** $me: Fatal Error: $dtrace not found.
8163 echo "*** $dtrace was not found."
8169 : See if we want extra modules installed
8176 Perl can be built with extra modules or bundles of modules which
8177 will be fetched from the CPAN and installed alongside Perl.
8179 Notice that you will need access to the CPAN; either via the Internet,
8180 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
8181 be asked later to configure the CPAN.pm module which will in turn do
8182 the installation of the rest of the extra modules or bundles.)
8184 Notice also that if the modules require any external software such as
8185 libraries and headers (the libz library and the zlib.h header for the
8186 Compress::Zlib module, for example) you MUST have any such software
8187 already installed, this configuration process will NOT install such
8190 If this doesn't make any sense to you, just accept the default '$dflt'.
8192 rp='Install any extra modules (y or n)?'
8198 Please list any extra modules or bundles to be installed from CPAN,
8199 with spaces between the names. The names can be in any format the
8200 'install' command of CPAN.pm will understand. (Answer 'none',
8201 without the quotes, to install no extra modules or bundles.)
8211 $rm -f ../extras.lst
8213 *) echo "(Saving the list of extras for later...)"
8214 echo "$extras" > ../extras.lst
8222 : determine where html pages for programs go
8223 set html1dir html1dir none
8227 If you wish to install html files for programs in $spackage, indicate
8228 the appropriate directory here. To skip installing html files,
8232 ''|none|$undef|' ') dflt=none ;;
8233 *) dflt=$html1dir ;;
8236 rp="Directory for the main $spackage html pages?"
8240 : Use ' ' for none so value is preserved next time through Configure
8241 $test X"$html1dir" = "X" && html1dir=' '
8243 : determine where html pages for libraries and modules go
8244 set html3dir html3dir none
8248 If you wish to install html files for modules associated with $spackage,
8249 indicate the appropriate directory here. To skip installing html files,
8252 : There is no obvious default. If they have specified html1dir, then
8253 : try to key off that, possibly changing .../html1 into .../html3.
8255 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
8256 *) dflt=$html3dir ;;
8259 rp="Directory for the $spackage module html pages?"
8263 : Use ' ' for none so value is preserved next time through Configure
8264 $test X"$html3dir" = "X" && html3dir=' '
8266 : determine whether to install perl also as /usr/bin/perl
8269 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
8271 Many scripts expect perl to be installed as /usr/bin/perl.
8273 If you want to, I can install the perl you are about to compile
8274 as /usr/bin/perl (in addition to $bin/perl).
8276 if test -f /usr/bin/perl; then
8279 However, please note that because you already have a /usr/bin/perl,
8280 overwriting that with a new Perl would very probably cause problems.
8281 Therefore I'm assuming you don't want to do that (unless you insist).
8284 case "$installusrbinperl" in
8285 "$define"|[yY]*) dflt='y';;
8291 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
8294 case "$installusrbinperl" in
8295 "$undef"|[nN]*) dflt='n';;
8299 rp="Do you want to install perl as /usr/bin/perl?"
8302 [yY]*) val="$define";;
8308 set installusrbinperl
8311 : see if dlopen exists
8313 xxx_ccflags="$ccflags"
8315 : with g++ one needs -shared to get is-in-libc to work for dlopen
8316 case "$gccversion" in
8319 *) case "$d_cplusplus" in
8320 "$define") ccflags="$ccflags -shared" ;;
8327 ccflags="$xxx_ccflags"
8329 : see if this is a unistd.h system
8330 set unistd.h i_unistd
8333 : determine which dynamic loading, if any, to compile in
8335 dldir="ext/DynaLoader"
8348 $define) dflt='y' ;;
8350 : Does a dl_xxx.xs file exist for this operating system
8351 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
8354 rp="Do you wish to use dynamic loading?"
8361 '') if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
8362 dflt="$dldir/dl_${osname}.xs"
8363 elif $test "$d_dlopen" = "$define" ; then
8364 dflt="$dldir/dl_dlopen.xs"
8369 *) dflt="$dldir/$dlsrc"
8372 echo "The following dynamic loading files are available:"
8373 : Can not go over to $dldir because getfile has path hard-coded in.
8374 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
8375 rp="Source file to use for dynamic loading"
8381 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
8385 Some systems may require passing special flags to $cc -c to
8386 compile modules that will be used to create a shared library.
8387 To use no flags, say "none".
8390 case "$cccdlflags" in
8391 '') case "$gccversion" in
8392 '') case "$osname" in
8394 irix*) dflt='-KPIC' ;;
8395 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
8396 sunos) dflt='-pic' ;;
8400 *) case "$osname" in
8401 darwin) dflt='none' ;;
8402 *linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
8407 *) dflt="$cccdlflags" ;;
8414 # If -Dsysroot was specified, now's the time to add it
8416 if test "X$sysroot" != X; then
8417 case "$gccversion" in
8422 dflt="$dflt --sysroot=$sysroot" ;;
8432 rp="Any special flags to pass to $cc -c to compile shared library modules?"
8435 none) cccdlflags=' ' ;;
8436 *) cccdlflags="$ans" ;;
8441 Some systems use ld to create libraries that can be dynamically loaded,
8442 while other systems (such as those using ELF) use $cc.
8446 : Determine if this is ELF
8448 /* Test for whether ELF binaries are produced */
8460 int i = open("a.out",O_RDONLY);
8463 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
8464 exit(0); /* succeed (yes, it is ELF) */
8468 if $cc $ccflags $ldflags -o a.out try.c >/dev/null 2>&1 && $run ./a.out; then
8474 '') if $test $bin_ELF = "$define"; then
8476 You appear to have ELF support. I'll use $cc to build dynamic libraries.
8480 echo "I'll use ld to build dynamic libraries."
8488 rp="What command should be used to create dynamic libraries?"
8494 Some systems may require passing special flags to $ld to create a
8495 library that can be dynamically loaded. If your ld flags include
8496 -L/other/path options to locate libraries outside your loader's normal
8497 search path, you may need to specify those -L options here as well. To
8498 use no flags, say "none".
8501 case "$lddlflags" in
8502 '') case "$osname" in
8503 haiku) dflt='-shared' ;;
8505 case "$gccversion" in
8506 '') dflt="$dflt +vnocompatwarnings" ;;
8509 *linux*|irix*|gnu*) dflt="-shared $optimize" ;;
8510 solaris) # See [perl #66604].
8511 # On Solaris 11, gcc -m64 on amd64
8512 # appears not to understand -G. gcc versions at
8513 # least as old as 3.4.3 support -shared, so just
8514 # use that with Solaris 11 and later, but keep
8515 # the old behavior for older Solaris versions.
8516 case "$gccversion" in
8518 *) case "$osvers" in
8519 2.?|2.10) dflt='-G' ;;
8520 *) dflt='-shared' ;;
8525 sunos) dflt='-assert nodefinitions' ;;
8526 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
8530 *) dflt="$lddlflags" ;;
8533 : Only do this for gcc, since, for example, qcc has no concept
8535 if $test "X$sysroot" != X; then
8536 case "$gccversion" in
8538 *) dflt="$dflt --sysroot $sysroot" ;;
8542 : Try to guess additional flags to pick up local libraries.
8543 : Be careful not to append to a plain 'none'
8547 for thisflag in $ldflags; do
8552 *) dflt="$dflt $thisflag" ;;
8559 ''|' ') dflt='none' ;;
8563 *-fstack-protector-strong*)
8565 *-fstack-protector-strong*) ;; # Don't add it again
8566 *) dflt="$dflt -fstack-protector-strong" ;;
8569 *-fstack-protector*)
8571 *-fstack-protector*) ;; # Don't add it again
8572 *) dflt="$dflt -fstack-protector" ;;
8577 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
8580 none) lddlflags=' ' ;;
8581 *) lddlflags="$ans" ;;
8586 Some systems may require passing special flags to $cc to indicate that
8587 the resulting executable will use dynamic linking. To use no flags,
8591 case "$ccdlflags" in
8592 '') case "$osname" in
8593 *linux*|hpux|gnu*) dflt='-Wl,-E' ;;
8594 sunos) dflt='none' ;;
8598 *) dflt="$ccdlflags" ;;
8600 rp="Any special flags to pass to $cc to use dynamic linking?"
8603 none) ccdlflags=' ' ;;
8604 *) ccdlflags="$ans" ;;
8616 ld_can_script="$undef"
8617 case "$bin_ELF$usedl" in
8619 # Abuse try.h and a.out names for neat cleanup
8631 if $cc $cccdlflags $ccdlflags $ccflags \
8632 $ldflags $lddlflags -o a.out try.c \
8633 -Wl,--version-script=try.h >/dev/null 2>&1 \
8634 && $test -s a.out ; then
8635 echo "ld supports scripting" >&4
8636 ld_can_script="$define"
8638 echo "ld does not support scripting" >&4
8644 : Do we want a shared libperl?
8648 # No dynamic loading being used, so don't bother even to prompt.
8651 *) case "$useshrplib" in
8652 '') case "$osname" in
8653 svr4*|nonstopux|dgux|dynixptx|esix|powerux|haiku|cygwin*)
8655 also='Building a shared libperl is required for dynamic loading to work on your system.'
8669 The perl executable is normally obtained by linking perlmain.c with
8670 libperl${_a}, any static extensions (usually just DynaLoader), and
8671 any other libraries needed on this system (such as -lm, etc.). Since
8672 your system supports dynamic loading, it is probably possible to build
8673 a shared libperl.$so. If you will have more than one executable linked
8674 to libperl.$so, this will significantly reduce the size of each
8675 executable, but it may have a noticeable effect on performance. The
8676 default is probably sensible for your system.
8680 rp="Build a shared libperl.$so (y/n)"
8684 useshrplib='true' ;;
8685 *) useshrplib='false' ;;
8690 case "$useshrplib" in
8692 case "$userelocatableinc" in
8694 echo "Cannot build with both -Duserelocatableinc and -Duseshrplib" >&4
8695 echo "See INSTALL for an explanation why that won't work." >&4
8701 # Figure out a good name for libperl.so. Since it gets stored in
8702 # a version-specific architecture-dependent library, the version
8703 # number isn't really that important, except for making cc/ld happy.
8705 # A name such as libperl.so.10.1
8706 majmin="libperl.$so.$patchlevel.$subversion"
8707 # A name such as libperl.so.100
8708 majonly=`echo $patchlevel $subversion |
8709 $awk '{printf "%d%02d", $1, $2}'`
8710 majonly=libperl.$so.$majonly
8711 # I'd prefer to keep the os-specific stuff here to a minimum, and
8712 # rely on figuring it out from the naming of libc.
8713 case "${osname}${osvers}" in
8714 *linux*|gnu*) # ld won't link with a bare -lperl otherwise.
8717 cygwin*) # ld links now against the dll directly
8718 majmin="cygperl5_${patchlevel}_${subversion}.${so}"
8719 majonly=`echo $patchlevel $subversion |
8720 $awk '{printf "%03d%03d", $1, $2}'`
8721 majonly=cygperl5.$majonly.$so
8724 *) # Try to guess based on whether libc has major.minor.
8726 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8727 *libc.$so.[0-9]*) dflt=$majonly ;;
8728 *) dflt=libperl.$so ;;
8738 I need to select a good name for the shared libperl. If your system uses
8739 library names with major and minor numbers, then you might want something
8740 like $majmin. Alternatively, if your system uses a single version
8741 number for shared libraries, then you might want to use $majonly.
8742 Or, your system might be quite happy with a simple libperl.$so.
8744 Since the shared libperl will get installed into a version-specific
8745 architecture-dependent directory, the version number of the shared perl
8746 library probably isn't important, so the default should be o.k.
8749 rp='What name do you want to give to the shared libperl?'
8752 echo "Ok, I'll use $libperl"
8755 libperl="libperl${_a}"
8759 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8763 WARNING: Use of the shrpdir variable for the installation location of
8764 the shared $libperl is not supported. It was never documented and
8765 will not work in this version. Let me (perlbug@perl.org)
8766 know of any problems this may cause.
8772 But your current setting of $shrpdir is
8773 the default anyway, so it's harmless.
8778 Further, your current attempted setting of $shrpdir
8779 conflicts with the value of $archlibexp/CORE
8780 that installperl will use.
8787 # How will the perl executable find the installed shared $libperl?
8788 # Add $xxx to ccdlflags.
8789 # If we can't figure out a command-line option, use $shrpenv to
8790 # set env LD_RUN_PATH. The main perl makefile uses this.
8791 shrpdir=$archlibexp/CORE
8794 if "$useshrplib"; then
8797 # We'll set it in Makefile.SH...
8802 freebsd|mirbsd|netbsd|openbsd|interix|dragonfly|bitrig)
8803 xxx="-Wl,-R$shrpdir"
8805 bsdos|linux|irix*|dec_osf|gnu*|haiku)
8806 xxx="-Wl,-rpath,$shrpdir"
8809 # hpux doesn't like the default, either.
8810 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8813 # cygwin needs only ldlibpth
8816 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8822 # Only add $xxx if it isn't already in ccdlflags.
8823 case " $ccdlflags " in
8825 *) ccdlflags="$ccdlflags $xxx"
8828 Adding $xxx to the flags
8829 passed to $ld so that the perl executable will find the
8830 installed shared $libperl.
8838 # Fix ccdlflags in AIX for building external extensions.
8839 # (For building Perl itself bare -bE:perl.exp is needed,
8840 # Makefile.SH takes care of this.)
8842 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8844 # Respect a hint or command-line value.
8846 '') shrpenv="$tmp_shrpenv" ;;
8848 case "$ldlibpthname" in
8849 '') ldlibpthname=LD_LIBRARY_PATH ;;
8850 none) ldlibpthname='' ;;
8853 : determine where manual pages are on this system
8857 syspath='/usr/share/man/man1 /usr/man/man1'
8858 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8859 syspath="$syspath /usr/man/u_man/man1"
8860 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8861 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8862 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8863 sysman=`./loc . /usr/man/man1 $syspath`
8866 if $test -d "$sysman"; then
8867 echo "System manual is in $sysman." >&4
8869 echo "Could not find manual pages in source form." >&4
8872 : determine where manual pages go
8873 set man1dir man1dir none
8877 $spackage has manual pages available in source form.
8881 echo "However, you don't have nroff, so they're probably useless to you."
8883 '') man1dir="none";;
8886 echo "If you don't want the manual sources installed, answer 'none'."
8891 lookpath="$prefixexp/share/man/man1"
8892 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8893 lookpath="$lookpath $prefixexp/man/p_man/man1"
8894 lookpath="$lookpath $prefixexp/man/u_man/man1"
8895 lookpath="$lookpath $prefixexp/man/man.1"
8897 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8898 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8908 rp="Where do the main $spackage manual pages (source) go?"
8910 if $test "X$man1direxp" != "X$ansexp"; then
8921 : What suffix to use on installed man pages
8928 rp="What suffix should be used for the main $spackage man pages?"
8930 '') case "$man1dir" in
8944 *) dflt="$man1ext";;
8951 : see if we can have long filenames
8953 first=123456789abcdef
8955 if (echo hi >$first) 2>/dev/null; then
8956 if $test -f 123456789abcde; then
8957 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8960 echo 'You can have filenames longer than 14 characters.'>&4
8965 You can't have filenames longer than 14 chars.
8966 You can't even think about them!
8972 $rm -rf 123456789abcde*
8974 : determine where library module manual pages go
8975 set man3dir man3dir none
8979 $spackage has manual pages for many of the library modules.
8985 However, you don't have nroff, so they're probably useless to you.
8988 '') man3dir="none";;
8992 case "$d_flexfnam" in
8995 However, your system can't handle the long file names like File::Basename.3.
8998 '') man3dir="none";;
9002 echo "If you don't want the manual sources installed, answer 'none'."
9003 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
9005 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
9006 if $test -d "$privlib/man/man3"; then
9009 WARNING: Previous versions of perl installed man3 pages into
9010 $privlib/man/man3. This version will suggest a
9011 new default of $dflt.
9015 rp='Do you wish to preserve the old behavior?(y/n)'
9018 y*) dflt="$privlib/man/man3" ;;
9023 *) dflt="$man3dir" ;;
9030 rp="Where do the $package library man pages (source) go?"
9040 : What suffix to use on installed man pages
9046 rp="What suffix should be used for the $package library man pages?"
9048 '') case "$man3dir" in
9062 *) dflt="$man3ext";;
9069 : see if we have to deal with yellow pages, now NIS.
9070 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
9076 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
9084 rp='Are you getting the hosts file via yellow pages?'
9087 y*) hostcat='ypcat hosts';;
9088 *) hostcat='cat /etc/hosts';;
9094 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
9097 '') test -f /etc/group && groupcat='cat /etc/group';;
9100 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
9103 : now get the host name
9105 echo "Figuring out host name..." >&4
9106 case "$myhostname" in
9108 echo 'Maybe "hostname" will work...'
9109 if tans=`sh -c hostname 2>&1` ; then
9117 if $test "$cont"; then
9119 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
9120 if tans=`cat /etc/systemid 2>&1` ; then
9122 phostname='cat /etc/systemid'
9123 echo "Whadyaknow. Xenix always was a bit strange..."
9126 elif $test -r /etc/systemid; then
9127 echo "(What is a non-Xenix system doing with /etc/systemid?)"
9130 if $test "$cont"; then
9131 echo 'No, maybe "uuname -l" will work...'
9132 if tans=`sh -c 'uuname -l' 2>&1` ; then
9134 phostname='uuname -l'
9136 echo 'Strange. Maybe "uname -n" will work...'
9137 if tans=`sh -c 'uname -n' 2>&1` ; then
9139 phostname='uname -n'
9141 echo 'Oh well, maybe I can mine it out of whoami.h...'
9142 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
9143 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
9144 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
9146 case "$myhostname" in
9147 '') echo "Does this machine have an identity crisis or something?"
9150 echo "Well, you said $myhostname before..."
9151 phostname='echo $myhostname';;
9157 case "$myhostname" in
9158 '') myhostname=noname ;;
9160 : you do not want to know about this
9165 if $test "$myhostname" ; then
9167 rp='Your host name appears to be "'$myhostname'".'" Right?"
9175 : bad guess or no guess
9176 while $test "X$myhostname" = X ; do
9178 rp="Please type the (one word) name of your host:"
9183 : translate upper to lower if necessary
9184 case "$myhostname" in
9186 echo "(Normalizing case in your host name)"
9187 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
9191 case "$myhostname" in
9193 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
9194 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
9195 echo "(Trimming domain name from host name--host name is now $myhostname)"
9197 *) case "$mydomain" in
9200 test "X$hostcat" = "Xypcat hosts" &&
9201 ypmatch "$myhostname" hosts 2>/dev/null |\
9202 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
9205 test "X$hostcat" != "X" &&
9206 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
9207 /[ ]$myhostname[ . ]/p" > hosts
9210 if $test -f hosts; then
9211 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
9212 END { print sum }" hosts` = x1 || tmp_re="[ ]"
9213 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
9214 hosts | $sort | $uniq | \
9215 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
9216 case `$echo X$dflt` in
9217 X*\ *) echo "(Several hosts in the database matched hostname)"
9220 X.) echo "(You do not have fully-qualified names in the hosts database)"
9224 echo "(I cannot locate a hosts database anywhere)"
9229 tans=`./loc resolv.conf X /etc /usr/etc`
9230 if $test -f "$tans"; then
9231 echo "(Attempting domain name extraction from $tans)"
9232 dflt=.`$sed -n -e 's/ / /g' \
9233 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
9236 .) dflt=.`$sed -n -e 's/ / /g' \
9237 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
9245 .) echo "(No help from resolv.conf either -- attempting clever guess)"
9246 dflt=.`sh -c domainname 2>/dev/null`
9249 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
9253 case "$dflt$osname" in
9254 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
9255 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
9259 .) echo "(Lost all hope -- silly guess then)"
9265 *) dflt="$mydomain";;
9269 rp="What is your domain name?"
9279 : translate upper to lower if necessary
9282 echo "(Normalizing case in your domain name)"
9283 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
9287 : a little sanity check here
9288 case "$phostname" in
9291 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
9292 $myhostname$mydomain|$myhostname) ;;
9294 case "$phostname" in
9296 echo "(That doesn't agree with your whoami.h file, by the way.)"
9299 echo "(That doesn't agree with your $phostname command, by the way.)"
9307 : determine the e-mail address of the user who is running us
9310 I need to get your e-mail address in Internet format if possible, i.e.
9311 something like user@host.domain. Please answer accurately since I have
9312 no easy means to double check it. The default value provided below
9313 is most probably close to reality but may not be valid from outside
9314 your organization...
9318 while test "$cont"; do
9319 case "$MAILDOMAIN" in
9321 if $test -s /etc/mailname; then
9322 maildomain=`$cat /etc/mailname`
9324 maildomain="$myhostname$mydomain"
9327 *) maildomain="$MAILDOMAIN";;
9330 '') dflt="$cf_by@$maildomain";;
9331 *) dflt="$cf_email";;
9333 rp='What is your e-mail address?'
9339 rp='Address does not look like an Internet one. Use it anyway?'
9353 : Ask e-mail of administrator
9356 If you or somebody else will be maintaining perl at your site, please
9357 fill in the correct e-mail address here so that they may be contacted
9358 if necessary. Currently, the "perlbug" program included with perl
9359 will send mail to this address in addition to perlbug@perl.org. You may
9360 enter "none" for no administrator.
9363 case "$perladmin" in
9364 '') dflt="$cf_email";;
9365 *) dflt="$perladmin";;
9367 rp='Perl administrator e-mail address'
9371 : determine whether to use a version number suffix for installed binaries
9374 Do you want to use a version number suffix for installed binaries? This
9375 will install 'perl$version' instead of 'perl', and likewise for other
9376 binaries like 'perldoc' and 'cpan'. This allows many versions of perl
9377 to be installed side-by-side. Unless you are a developer, you probably
9378 do *not* want to do this.
9380 case "$versiononly" in
9381 "$define"|[Yy]*|true) dflt='y' ;;
9384 rp="Do you want to use a version number suffix for installed binaries?"
9387 [yY]*) val="$define";;
9393 case "$versiononly" in
9394 "$define") inc_version_list=''
9395 inc_version_list_init=0
9399 : figure out how to guarantee perl startup
9400 : XXX Note that this currently takes advantage of the bug that binexp ignores
9401 : the Configure -Dinstallprefix setting, which in turn means that under
9402 : relocatable @INC, initialinstalllocation is what binexp started as.
9403 case "$startperl" in
9405 case "$sharpbang" in
9409 I can use the #! construct to start perl on your system. This will
9410 make startup of perl scripts faster, but may cause problems if you
9411 want to share those scripts and perl is not in a standard place
9412 ($initialinstalllocation/perl) on all your platforms. The alternative
9413 is to force a shell by starting the script with a single ':' character.
9416 case "$versiononly" in
9417 "$define") dflt="$initialinstalllocation/perl$version";;
9418 *) dflt="$initialinstalllocation/perl";;
9420 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
9423 none) startperl=": # use perl";;
9424 *) startperl="#!$ans"
9425 if $test 30 -lt `echo "$ans" | wc -c`; then
9428 WARNING: Some systems limit the #! command to 32 characters.
9429 If you experience difficulty running Perl scripts with #!, try
9430 installing Perl in a directory with a shorter pathname.
9436 *) startperl=": # use perl"
9441 echo "I'll use $startperl to start perl scripts."
9443 : figure best path for perl in scripts
9446 case "$versiononly" in
9447 "$define") perlpath="$initialinstalllocation/perl$version";;
9448 *) perlpath="$initialinstalllocation/perl";;
9450 case "$startperl" in
9455 I will use the "eval 'exec'" idiom to start Perl on your system.
9456 I can use the full path of your Perl binary for this purpose, but
9457 doing so may cause problems if you want to share those scripts and
9458 Perl is not always in a standard place ($initialinstalllocation/perl).
9461 dflt="$initialinstalllocation/perl"
9462 rp="What path shall I use in \"eval 'exec'\"?"
9469 case "$startperl" in
9471 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
9474 : determine where public executable scripts go
9475 set scriptdir scriptdir
9477 case "$scriptdir" in
9480 : guess some guesses
9481 $test -d /usr/share/scripts && dflt=/usr/share/scripts
9482 $test -d /usr/share/bin && dflt=/usr/share/bin
9483 $test -d /usr/local/script && dflt=/usr/local/script
9484 $test -d /usr/local/scripts && dflt=/usr/local/scripts
9485 $test -d $prefixexp/script && dflt=$prefixexp/script
9489 *) dflt="$scriptdir"
9494 Some installations have a separate directory just for executable scripts so
9495 that they can mount it across multiple architectures but keep the scripts in
9496 one spot. You might, for example, have a subdirectory of /usr/share for this.
9497 Or you might just lump your scripts in with all your other executables.
9501 rp='Where do you keep publicly executable scripts?'
9503 if $test "X$ansexp" != "X$scriptdirexp"; then
9509 : A little fix up for an irregularly named variable.
9510 installscript="$installscriptdir"
9512 : determine where add-on public executables go
9514 '') dflt=$siteprefix/bin ;;
9518 rp='Pathname where the add-on public executables should be installed?'
9523 : determine where add-on html pages go
9524 : There is no standard location, so try to copy the previously-selected
9525 : directory structure for the core html pages.
9526 case "$sitehtml1dir" in
9527 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9528 *) dflt=$sitehtml1dir ;;
9531 ''|' ') dflt=none ;;
9534 rp='Pathname where the site-specific html pages should be installed?'
9536 prefixvar=sitehtml1dir
9539 : determine where add-on library html pages go
9540 : There is no standard location, so try to copy the previously-selected
9541 : directory structure for the core html pages.
9542 case "$sitehtml3dir" in
9543 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9544 *) dflt=$sitehtml3dir ;;
9547 ''|' ') dflt=none ;;
9550 rp='Pathname where the site-specific library html pages should be installed?'
9552 prefixvar=sitehtml3dir
9555 : determine where add-on manual pages go
9556 case "$siteman1dir" in
9557 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
9558 *) dflt=$siteman1dir ;;
9561 ''|' ') dflt=none ;;
9564 rp='Pathname where the site-specific manual pages should be installed?'
9566 prefixvar=siteman1dir
9569 : determine where add-on library man pages go
9570 case "$siteman3dir" in
9571 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
9572 *) dflt=$siteman3dir ;;
9575 ''|' ') dflt=none ;;
9578 rp='Pathname where the site-specific library manual pages should be installed?'
9580 prefixvar=siteman3dir
9583 : determine where add-on public executable scripts go
9584 case "$sitescript" in
9585 '') dflt=$siteprefix/script
9586 $test -d $dflt || dflt=$sitebin ;;
9587 *) dflt="$sitescript" ;;
9590 rp='Pathname where add-on public executable scripts should be installed?'
9592 prefixvar=sitescript
9595 : see if backtrace exists
9596 set backtrace d_backtrace
9599 : add flags if using c backtrace
9600 case "$usecbacktrace" in
9601 "") usecbacktrace=$undef ;;
9603 case "$d_backtrace" in
9605 case " $ccflags " in
9606 *" -DUSE_C_BACKTRACE "*) ;; # Already there.
9607 *) ccflags="$ccflags -DUSE_C_BACKTRACE -g" ;;
9611 echo "This system does not support backtrace" >&4
9612 usecbacktrace=$undef
9618 : Check if faststdio is requested and available
9619 case "$usefaststdio" in
9620 $define|true|[yY]*|'')
9621 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
9631 Perl can be built to use 'fast stdio', which means using the stdio
9632 library but also directly manipulating the stdio buffers to enable
9633 faster I/O. Using stdio is better for backward compatibility (especially
9634 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
9635 interface has been preferred instead of stdio.
9637 If this doesn't make any sense to you, just accept the default '$dflt'.
9639 rp='Use the "fast stdio" if available?'
9642 y|Y) val="$define" ;;
9649 : define an is-a-typedef? function
9650 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9652 "") inclist="sys/types.h";;
9654 eval "varval=\$$var";
9658 for inc in $inclist; do
9659 echo "#include <$inc>" >>temp.c;
9661 echo "#ifdef $type" >> temp.c;
9662 echo "printf(\"We have $type\");" >> temp.c;
9663 echo "#endif" >> temp.c;
9664 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9665 if $contains $type temp.E >/dev/null 2>&1; then
9671 *) eval "$var=\$varval";;
9674 : define an is-a-typedef? function that prompts if the type is not available.
9675 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9677 "") inclist="sys/types.h";;
9679 eval "varval=\$$var";
9683 for inc in $inclist; do
9684 echo "#include <$inc>" >>temp.c;
9686 echo "#ifdef $type" >> temp.c;
9687 echo "printf(\"We have $type\");" >> temp.c;
9688 echo "#endif" >> temp.c;
9689 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9691 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
9692 if $contains $type temp.E >/dev/null 2>&1; then
9693 echo "$type found." >&4;
9696 echo "$type NOT found." >&4;
9702 *) eval "$var=\$varval";;
9705 : see what type lseek is declared as in the kernel
9706 rp="What is the type used for lseek's offset on this system?"
9707 set off_t lseektype long stdio.h sys/types.h
9711 echo "Checking to see how big your file offsets are..." >&4
9713 #include <sys/types.h>
9717 printf("%d\n", (int)sizeof($lseektype));
9722 if eval $compile_ok; then
9723 lseeksize=`$run ./try`
9724 echo "Your file offsets are $lseeksize bytes long."
9728 echo "(I can't seem to compile the test program. Guessing...)"
9729 rp="What is the size of your file offsets (in bytes)?"
9735 : see what type file positions are declared as in the library
9736 rp="What is the type for file position used by fsetpos()?"
9737 set fpos_t fpostype long stdio.h sys/types.h
9740 : Check size for Fpos_t
9743 *_t) zzz="$fpostype" ;;
9746 echo "Checking the size of $zzz..." >&4
9748 #include <sys/types.h>
9755 printf("%d\n", (int)sizeof($fpostype));
9760 if eval $compile_ok; then
9764 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9767 echo "Your $zzz is $fpossize bytes long."
9773 echo "(I can't compile the test program. Guessing...)" >&4
9774 rp="What is the size of your file positions (in bytes)?"
9779 : Check for large file support
9780 # Backward compatibility (uselfs is deprecated).
9782 "$define"|true|[yY]*)
9785 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9787 uselargefiles="$define"
9791 case "$lseeksize:$fpossize" in
9794 You can have files larger than 2 gigabytes.
9797 *) case "$uselargefiles" in
9798 "$undef"|false|[nN]*) dflt='n' ;;
9803 Perl can be built to understand large files (files larger than 2 gigabytes)
9804 on some systems. To do so, Configure can be run with -Duselargefiles.
9806 If this doesn't make any sense to you, just accept the default '$dflt'.
9808 rp='Try to understand large files, if available?'
9811 y|Y) val="$define" ;;
9818 : Look for a hint-file generated 'call-back-unit'. If the
9819 : user has specified that a large files perl is to be built,
9820 : we may need to set or change some other defaults.
9821 if $test -f uselargefiles.cbu; then
9822 echo "Your platform has some specific hints regarding large file builds, using them..."
9823 . ./uselargefiles.cbu
9825 case "$uselargefiles" in
9827 if $test -f uselargefiles.cbu; then
9829 echo "Rechecking to see how big your file offsets are..." >&4
9831 #include <sys/types.h>
9835 printf("%d\n", (int)sizeof($lseektype));
9840 if eval $compile_ok; then
9841 lseeksize=`$run ./try`
9842 $echo "Your file offsets are now $lseeksize bytes long."
9846 echo "(I can't seem to compile the test program. Guessing...)"
9847 rp="What is the size of your file offsets (in bytes)?"
9852 *_t) zzz="$fpostype" ;;
9855 $echo $n "Rechecking the size of $zzz...$c" >&4
9857 #include <sys/types.h>
9864 printf("%d\n", (int)sizeof($fpostype));
9869 if eval $compile_ok; then
9874 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9877 echo " $fpossize bytes." >&4
9883 echo "(I can't compile the test program. Guessing...)" >&4
9884 rp="What is the size of your file positions (in bytes)?"
9893 : Check if we want perlio
9896 : Set the vendorbin variables
9897 case "$vendorprefix" in
9898 '') d_vendorbin="$undef"
9902 *) d_vendorbin="$define"
9903 : determine where vendor-supplied executables go.
9904 case "$vendorbin" in
9905 '') dflt=$vendorprefix/bin ;;
9906 *) dflt="$vendorbin" ;;
9909 rp='Pathname for the vendor-supplied executables directory?'
9912 vendorbinexp="$ansexp"
9918 : Set the vendorhtml1dir variables
9919 case "$vendorprefix" in
9920 '') vendorhtml1dir=''
9921 vendorhtml1direxp=''
9923 *) : determine where vendor-supplied html pages go.
9924 : There is no standard location, so try to copy the previously-selected
9925 : directory structure for the core html pages.
9926 : XXX Better default suggestions would be welcome.
9927 case "$vendorhtml1dir" in
9928 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9929 *) dflt=$vendorhtml1dir ;;
9932 ''|' ') dflt=none ;;
9935 rp='Pathname for the vendor-supplied html pages?'
9937 vendorhtml1dir="$ans"
9938 vendorhtml1direxp="$ansexp"
9941 : Use ' ' for none so value is preserved next time through Configure
9942 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9943 prefixvar=vendorhtml1dir
9946 : Set the vendorhtml3dir variables
9947 case "$vendorprefix" in
9948 '') vendorhtml3dir=''
9949 vendorhtml3direxp=''
9951 *) : determine where vendor-supplied module html pages go.
9952 : There is no standard location, so try to copy the previously-selected
9953 : directory structure for the core html pages.
9954 : XXX Better default suggestions would be welcome.
9955 case "$vendorhtml3dir" in
9956 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9957 *) dflt=$vendorhtml3dir ;;
9960 ''|' ') dflt=none ;;
9963 rp='Pathname for the vendor-supplied html pages?'
9965 vendorhtml3dir="$ans"
9966 vendorhtml3direxp="$ansexp"
9969 : Use ' ' for none so value is preserved next time through Configure
9970 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9971 prefixvar=vendorhtml3dir
9974 : Set the vendorman1dir variables
9975 case "$vendorprefix" in
9976 '') vendorman1dir=''
9979 *) : determine where vendor-supplied manual pages go.
9980 case "$vendorman1dir" in
9981 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9982 *) dflt=$vendorman1dir ;;
9985 ''|' ') dflt=none ;;
9988 rp='Pathname for the vendor-supplied manual section 1 pages?'
9990 vendorman1dir="$ans"
9991 vendorman1direxp="$ansexp"
9994 : Use ' ' for none so value is preserved next time through Configure
9995 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9996 prefixvar=vendorman1dir
9999 : Set the vendorman3dir variables
10000 case "$vendorprefix" in
10001 '') vendorman3dir=''
10002 vendorman3direxp=''
10004 *) : determine where vendor-supplied module manual pages go.
10005 case "$vendorman3dir" in
10006 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
10007 *) dflt=$vendorman3dir ;;
10010 ''|' ') dflt=none ;;
10013 rp='Pathname for the vendor-supplied manual section 3 pages?'
10015 vendorman3dir="$ans"
10016 vendorman3direxp="$ansexp"
10019 : Use ' ' for none so value is preserved next time through Configure
10020 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
10021 prefixvar=vendorman3dir
10024 : Set the vendorscript variables
10025 case "$vendorprefix" in
10026 '') d_vendorscript="$undef"
10030 *) d_vendorscript="$define"
10031 : determine where vendor-supplied scripts go.
10032 case "$vendorscript" in
10033 '') dflt=$vendorprefix/script
10034 $test -d $dflt || dflt=$vendorbin ;;
10035 *) dflt="$vendorscript" ;;
10039 The installation process will create a directory for
10040 vendor-supplied scripts.
10044 rp='Pathname for the vendor-supplied scripts directory?'
10046 vendorscript="$ans"
10047 vendorscriptexp="$ansexp"
10050 prefixvar=vendorscript
10053 : see if qgcvt exists
10057 : Check what kind of doubles your system has
10058 $echo "Checking the kind of doubles you have..." >&4
10060 #$i_stdlib I_STDLIB
10061 #define DOUBLESIZE $doublesize
10063 #include <stdlib.h>
10066 static const double d = -0.1;
10068 unsigned const char* b = (unsigned const char*)(&d);
10069 #if DOUBLESIZE == 4
10070 if (b[0] == 0xCD && b[3] == 0xBD) {
10071 /* IEEE 754 32-bit little-endian */
10075 if (b[0] == 0xBD && b[3] == 0xCD) {
10076 /* IEEE 754 32-bit big-endian */
10080 if (b[0] == 0xCC && b[3] == 0xCC) {
10081 /* VAX format F, 32-bit PDP-style mixed endian. */
10085 if (b[0] == 0xC0 && b[3] == 0x9A) {
10086 /* IBM single 32-bit */
10091 #if DOUBLESIZE == 8
10092 if (b[0] == 0x9A && b[7] == 0xBF) {
10093 /* IEEE 754 64-bit little-endian */
10097 if (b[0] == 0xBF && b[7] == 0x9A) {
10098 /* IEEE 754 64-bit big-endian */
10102 if (b[0] == 0x99 && b[3] == 0xBF && b[4] == 0x9A && b[7] == 0x99) {
10103 /* ARM mixed endian: two little-endian 32-bit floats, in big endian order:
10104 * 4 5 6 7 0 1 2 3 (MSB = 7, LSB = 0)
10105 * 99 99 b9 bf 9a 99 99 99 */
10109 if (b[0] == 0x99 && b[3] == 0x9A && b[4] == 0xBF && b[7] == 0x99) {
10110 /* The opposite of case 7, mixed endian: two big-endian 32-bit floats,
10111 * in little endian order: 3 2 1 0 7 6 5 4 (MSB = 7, LSB = 0)
10112 * 99 99 99 9a bf b9 99 99 */
10116 if (b[0] == 0xCC && b[7] == 0xCC) {
10117 /* VAX format D, 64-bit PDP-style mixed endian. */
10121 if (b[0] == 0xD9 && b[7] == 0x99) {
10122 /* VAX format G, 64-bit PDP-style mixed endian. */
10126 if (b[0] == 0xC0 && b[7] == 0x9A) {
10127 /* IBM double 64-bit */
10131 if (b[0] == 0xBF && b[7] == 0xCD) {
10132 /* CRAY single 64-bit */
10137 #if DOUBLESIZE == 16
10138 if (b[0] == 0x9A && b[15] == 0xBF) {
10139 /* IEEE 754 128-bit little-endian */
10143 if (b[0] == 0xBF && b[15] == 0x9A) {
10144 /* IEEE 754 128-bit big-endian */
10149 /* Then there are old mainframe/miniframe formats like IBM and CRAY.
10150 * Whether those environments can still build Perl is debatable. */
10151 printf("-1\n"); /* unknown */
10156 if eval $compile; then
10157 doublekind=`$run ./try`
10161 case "$doublekind" in
10162 1) echo "You have IEEE 754 32-bit little endian doubles." >&4 ;;
10163 2) echo "You have IEEE 754 32-bit big endian doubles." >&4 ;;
10164 3) echo "You have IEEE 754 64-bit little endian doubles." >&4 ;;
10165 4) echo "You have IEEE 754 64-bit big endian doubles." >&4 ;;
10166 5) echo "You have IEEE 754 128-bit little endian doubles." >&4 ;;
10167 6) echo "You have IEEE 754 128-bit big endian doubles." >&4 ;;
10168 7) echo "You have IEEE 754 64-bit mixed endian doubles (32-bit LEs in BE)." >&4 ;;
10169 8) echo "You have IEEE 754 64-bit mixed endian doubles (32-bit BEs in LE)." >&4 ;;
10170 9) echo "You have VAX format F 32-bit PDP-style mixed endian doubles." >&4 ;;
10171 10) echo "You have VAX format D 64-bit PDP-style mixed endian doubles." >&4 ;;
10172 11) echo "You have VAX format G 64-bit PDP-style mixed endian doubles." >&4 ;;
10173 12) echo "You have IBM short 32-bit doubles." >&4 ;;
10174 13) echo "You have IBM long 64-bit doubles." >&4 ;;
10175 14) echo "You have Cray single 64-bit doubles." >&4 ;;
10176 *) echo "Cannot figure out your double. You Cyber, or something?" >&4 ;;
10178 d_double_style_ieee=$undef
10179 d_double_style_vax=$undef
10180 d_double_style_ibm=$undef
10181 d_double_style_cray=$undef
10182 case "$doublekind" in
10183 1|2|3|4|5|6|7|8) d_double_style_ieee=$define ;;
10184 9|10|11) d_double_style_vax=$define ;;
10185 12|13) d_double_style_ibm=$define ;;
10186 14) d_double_style_cray=$define ;;
10188 case "$d_double_style_ieee" in
10190 d_double_has_inf=$define
10191 d_double_has_nan=$define
10192 d_double_has_negative_zero=$define
10193 d_double_has_subnormals=$define
10196 d_double_has_inf=$undef
10197 d_double_has_nan=$undef
10198 d_double_has_negative_zero=$undef
10199 d_double_has_subnormals=$undef
10204 : Check print/scan long double stuff
10207 if $test X"$d_longdbl" = X"$define"; then
10209 echo "Checking how to print long doubles..." >&4
10211 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
10212 $cat >try.c <<'EOCP'
10213 #include <sys/types.h>
10216 double d = 123.456;
10217 printf("%.3f\n", d);
10221 if eval $compile; then
10225 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
10226 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
10227 echo "We will use %f."
10233 if $test X"$sPRIfldbl" = X; then
10234 $cat >try.c <<'EOCP'
10235 #include <sys/types.h>
10238 long double d = 123.456;
10239 printf("%.3Lf\n", d);
10243 if eval $compile; then
10247 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
10248 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
10249 echo "We will use %Lf."
10255 if $test X"$sPRIfldbl" = X; then
10256 $cat >try.c <<'EOCP'
10257 #include <sys/types.h>
10260 long double d = 123.456;
10261 printf("%.3llf\n", d);
10265 if eval $compile; then
10269 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
10270 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
10271 echo "We will use %llf."
10277 if $test X"$sPRIfldbl" = X; then
10278 $cat >try.c <<'EOCP'
10279 #include <sys/types.h>
10282 long double d = 123.456;
10283 printf("%.3lf\n", d);
10287 if eval $compile; then
10291 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
10292 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
10293 echo "We will use %lf."
10299 if $test X"$sPRIfldbl" = X; then
10300 echo "Cannot figure out how to print long doubles." >&4
10302 sSCNfldbl=$sPRIfldbl # expect consistency
10309 case "$sPRIfldbl" in
10310 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
10311 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
10312 d_SCNfldbl="$undef";
10314 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
10315 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
10316 d_SCNfldbl="$define";
10320 : Before committing on uselongdouble, see whether that looks sane.
10321 if $test "$uselongdouble" = "$define"; then
10324 echo "Checking if your long double math functions work right..." >&4
10329 printf("%"$sPRIgldbl"\n", sqrtl(logl(expl(cosl(sinl(0.0L))))+powl(2.0L, 3.0L)));
10332 case "$osname:$gccversion" in
10333 aix:) saveccflags="$ccflags"
10334 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
10337 if eval $compile_ok; then
10341 3) echo "Your long double math functions are working correctly." >&4 ;;
10342 *) echo "Your long double math functions are broken, not using long doubles." >&4
10343 uselongdouble=$undef
10347 case "$osname:$gccversion" in
10348 aix:) ccflags="$saveccflags" ;; # restore
10352 : Check how to convert floats to strings.
10354 if test "X$d_Gconvert" = X; then
10357 echo "Checking for an efficient way to convert floats to strings."
10359 case "$uselongdouble" in
10360 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
10362 case "$d_longdbl" in
10363 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
10365 case "$d_PRIgldbl" in
10366 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
10369 #ifdef TRY_gconvert
10370 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
10371 char *myname = "gconvert";
10374 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
10375 char *myname = "gcvt";
10378 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
10379 char *myname = "qgcvt";
10380 #define DOUBLETYPE long double
10383 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
10384 #ifdef HAS_PRIgldbl
10385 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
10387 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
10390 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
10392 char *myname = "sprintf";
10396 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
10397 #define DOUBLETYPE long double
10399 #define DOUBLETYPE double
10405 #$i_stdlib I_STDLIB
10407 #include <stdlib.h>
10409 #include <string.h>
10411 int checkit(char *expect, char *got)
10413 if (strcmp(expect, got)) {
10414 printf("%s oddity: Expected %s, got %s\n",
10415 myname, expect, got);
10425 /* This must be 1st test on (which?) platform */
10426 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
10427 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
10428 checkit("0.1", buf);
10430 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
10431 checkit("0.01", buf);
10433 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
10434 checkit("0.001", buf);
10436 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
10437 checkit("0.0001", buf);
10439 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
10440 if (strlen(buf) > 5)
10441 checkit("9e-005", buf); /* for Microsoft ?? */
10443 checkit("9e-05", buf);
10445 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
10448 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
10449 checkit("1.1", buf);
10451 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
10452 checkit("1.01", buf);
10454 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
10455 checkit("1.001", buf);
10457 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
10458 checkit("1.0001", buf);
10460 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
10461 checkit("1.00001", buf);
10463 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
10464 checkit("1.000001", buf);
10466 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
10469 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
10470 checkit("-1", buf);
10472 /* Some Linux gcvt's give 1.e+5 here. */
10473 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
10474 checkit("100000", buf);
10476 /* Some Linux gcvt's give -1.e+5 here. */
10477 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
10478 checkit("-100000", buf);
10480 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
10481 checkit("123.456", buf);
10483 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
10484 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
10485 /* 34 should be enough to scare even long double
10486 * places into using the e notation. */
10487 if (strlen(buf) > 5)
10488 checkit("1e+034", buf); /* for Microsoft */
10490 checkit("1e+34", buf);
10492 /* For Perl, if you add additional tests here, also add them to
10493 * t/base/num.t for benefit of platforms not using Configure or
10494 * overriding d_Gconvert */
10499 : first add preferred functions to our list
10501 for xxx_convert in $gconvert_preference; do
10502 case $xxx_convert in
10503 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
10504 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
10507 : then add any others
10508 for xxx_convert in gconvert gcvt sprintf; do
10509 case "$xxx_list" in
10511 *) xxx_list="$xxx_list $xxx_convert" ;;
10515 case "$d_longdbl$uselongdouble" in
10517 : again, add preferred functions to our list first
10519 for xxx_convert in $gconvert_ld_preference; do
10520 case $xxx_convert in
10521 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
10522 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
10525 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
10526 for xxx_convert in qgcvt sprintf $xxx_list; do
10527 case "$xxx_ld_list" in
10528 $xxx_convert*|*" $xxx_convert"*) ;;
10529 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
10532 : if sprintf cannot do long doubles, move it to the end
10533 if test "$d_PRIgldbl" != "$define"; then
10534 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
10536 : if no qgcvt, remove it
10537 if test "$d_qgcvt" != "$define"; then
10538 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
10541 xxx_list="$xxx_ld_list"
10545 for xxx_convert in $xxx_list; do
10546 echo "Trying $xxx_convert..."
10547 $rm -f try try$_o core
10548 set try -DTRY_$xxx_convert
10549 if eval $compile; then
10550 echo "$xxx_convert() found." >&4
10551 if $run ./try; then
10552 echo "I'll use $xxx_convert to convert floats into a string." >&4
10555 echo "...But $xxx_convert didn't work as I expected."
10559 echo "$xxx_convert NOT found." >&4
10563 if test X$xxx_convert = X; then
10564 echo "*** WHOA THERE!!! ***" >&4
10565 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
10566 xxx_convert=sprintf
10569 case "$xxx_convert" in
10570 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
10571 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
10572 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
10573 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
10574 "$define$define$define")
10575 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
10576 "$define$define$undef")
10577 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
10578 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
10586 : see if _fwalk exists
10590 : see if accept4 exists
10591 set accept4 d_accept4
10594 : Initialize h_fcntl
10597 : Initialize h_sysfile
10600 : access call always available on UNIX
10601 set access d_access
10604 : locate the flags for 'access()'
10605 case "$d_access" in
10608 $cat >access.c <<EOCP
10609 #include <sys/types.h>
10614 #include <sys/file.h>
10617 #include <unistd.h>
10619 #$i_stdlib I_STDLIB
10621 #include <stdlib.h>
10627 : check sys/file.h first, no particular reason here
10628 if $test `./findhdr sys/file.h` && \
10629 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
10631 echo "<sys/file.h> defines the *_OK access constants." >&4
10632 elif $test `./findhdr fcntl.h` && \
10633 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
10635 echo "<fcntl.h> defines the *_OK access constants." >&4
10636 elif $test `./findhdr unistd.h` && \
10637 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
10638 echo "<unistd.h> defines the *_OK access constants." >&4
10640 echo "I can't find the four *_OK access constants--I'll use mine." >&4
10646 : see if accessx exists
10647 set accessx d_accessx
10650 : see if acosh exists
10654 : see if aintl exists
10658 : see if alarm exists
10662 : see if 64bit time functions exists
10664 set ctime64 d_ctime64
10667 set localtime64 d_localtime64
10670 set gmtime64 d_gmtime64
10673 set mktime64 d_mktime64
10676 set difftime64 d_difftime64
10679 set asctime64 d_asctime64
10682 : see if POSIX threads are available
10683 set pthread.h i_pthread
10686 : define a function to check prototypes
10687 $cat > protochk <<EOSH
10690 optimize="$optimize"
10694 usethreads=$usethreads
10695 i_pthread=$i_pthread
10696 pthread_h_first=$pthread_h_first
10699 $cat >> protochk <<'EOSH'
10704 while test $# -ge 2; do
10706 $define) echo "#include <$2>" >> try.c ;;
10707 literal) echo "$2" >> try.c ;;
10709 # Extra magic for the benefit of systems that need pthread.h
10710 # to be included early to correctly detect threadsafe functions.
10711 # Such functions must guarantee themselves, though, that the usethreads
10712 # and i_pthread have been defined, before calling protochk.
10713 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
10714 echo "#include <pthread.h>" >> try.c
10719 cat >> try.c <<'EOCP'
10720 #define _(args) args
10722 echo "$foo" >> try.c
10723 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
10724 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
10730 $eunicefix protochk
10732 : Define hasproto macro for Configure internal use
10733 hasproto='varname=$1; func=$2; shift; shift;
10734 while $test $# -ge 2; do
10736 $define) echo "#include <$2>";;
10740 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
10741 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
10742 echo "$func() prototype found.";
10745 echo "$func() prototype NOT found.";
10752 : see if sys/types.h has to be included
10753 set sys/types.h i_systypes
10756 : see if sys/select.h has to be included
10757 set sys/select.h i_sysselct
10760 : Define hasfield macro for Configure internal use
10761 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
10762 while $test $# -ge 2; do
10764 $define) echo "#include <$2>";;
10768 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
10770 if eval $compile; then
10779 : see if we should include sys/time.h
10782 if test "X$timeincl" = X; then
10783 echo "Testing to see if we should include <sys/time.h>." >&4
10784 $echo $n "I'm now running the test program...$c"
10786 #include <sys/types.h>
10789 #ifdef SYSTIMEKERNEL
10792 #include <sys/time.h>
10795 #include <sys/select.h>
10797 #$i_stdlib I_STDLIB
10799 #include <stdlib.h>
10805 struct timeval bar;
10808 struct timezone tzp;
10810 if (foo.tm_sec == foo.tm_sec)
10813 if (bar.tv_sec == bar.tv_sec)
10820 for s_timezone in '-DS_TIMEZONE' ''; do
10822 for s_timeval in '-DS_TIMEVAL' ''; do
10823 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10824 for i_systime in '-DI_SYSTIME' ''; do
10827 set try $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10828 if eval $compile; then
10829 set X $i_systime $i_systimek $sysselect $s_timeval
10833 $echo $n "Succeeded with $flags$c"
10844 *SYSTIMEKERNEL*) i_systimek="$define"
10845 timeincl=`./findhdr sys/time.h`
10846 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10847 *) i_systimek="$undef";;
10850 *I_SYSTIME*) i_systime="$define"
10851 timeincl=`./findhdr sys/time.h`" $timeincl"
10852 echo "We'll include <sys/time.h>." >&4;;
10853 *) i_systime="$undef";;
10857 : see if struct tm knows about tm_zone
10858 case "$i_systime$i_time" in
10861 echo "Checking to see if your struct tm has tm_zone field..." >&4
10862 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
10870 case "$d_tm_tm_zone" in
10871 "$define") echo "Yes, it does." ;;
10872 *) echo "No, it doesn't." ;;
10874 : see if struct tm knows about tm_gmtoff
10875 case "$i_systime$i_time" in
10878 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
10879 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
10887 case "$d_tm_tm_gmtoff" in
10888 "$define") echo "Yes, it does." ;;
10889 *) echo "No, it doesn't." ;;
10892 : see if asctime_r exists
10893 set asctime_r d_asctime_r
10895 case "$d_asctime_r" in
10897 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10898 case "$d_asctime_r_proto:$usethreads" in
10899 ":define") d_asctime_r_proto=define
10900 set d_asctime_r_proto asctime_r $hdrs
10904 case "$d_asctime_r_proto" in
10906 case "$asctime_r_proto" in
10907 ''|0) try='char* asctime_r(const struct tm*, char*);'
10908 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SB ;;
10910 case "$asctime_r_proto" in
10911 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
10912 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SBI ;;
10914 case "$asctime_r_proto" in
10915 ''|0) try='int asctime_r(const struct tm*, char*);'
10916 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SB ;;
10918 case "$asctime_r_proto" in
10919 ''|0) try='int asctime_r(const struct tm*, char*, int);'
10920 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SBI ;;
10922 case "$asctime_r_proto" in
10923 ''|0) d_asctime_r=undef
10925 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
10926 * ) case "$asctime_r_proto" in
10927 REENTRANT_PROTO*) ;;
10928 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
10930 echo "Prototype: $try" ;;
10933 *) case "$usethreads" in
10934 define) echo "asctime_r has no prototype, not using it." >&4 ;;
10941 *) asctime_r_proto=0
10945 : see if asinh exists
10949 : see if atanh exists
10953 : see if atolf exists
10957 : see if atoll exists
10961 : Look for GCC-style attribute format
10962 case "$d_attribute_format" in
10965 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
10966 $cat >attrib.c <<'EOCP'
10968 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
10970 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10971 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10972 echo "Your C compiler doesn't support __attribute__((format))."
10975 echo "Your C compiler supports __attribute__((format))."
10979 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10983 *) val="$d_attribute_format" ;;
10985 set d_attribute_format
10989 : Look for GCC-style attribute format with null format allowed
10990 case "$d_printf_format_null" in
10991 '') case "$d_attribute_format" in
10994 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
10995 $cat >attrib.c <<EOCP
10997 #$i_stdlib I_STDLIB
10999 #include <stdlib.h>
11001 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
11002 int null_printf (char* pat,...) { return (int)pat; }
11003 int main () { exit(null_printf(NULL)); }
11005 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
11006 : run the executable in case it produces a run-time warning
11007 if $run ./attrib >>attrib.out 2>&1; then
11008 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11009 echo "Your C compiler doesn't allow __printf__ format to be null."
11012 echo "Your C compiler allows __printf__ format to be null."
11016 echo "Your C compiler executable failed with __printf__ format null."
11020 echo "Your C compiler fails with __printf__ format null."
11027 *) val="$d_printf_format_null" ;;
11029 set d_printf_format_null
11033 : Look for GCC-style attribute malloc
11034 case "$d_attribute_malloc" in
11037 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
11038 $cat >attrib.c <<'EOCP'
11040 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
11042 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11043 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11044 echo "Your C compiler doesn't support __attribute__((malloc))."
11047 echo "Your C compiler supports __attribute__((malloc))."
11051 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11055 *) val="$d_attribute_malloc" ;;
11057 set d_attribute_malloc
11061 : Look for GCC-style attribute nonnull
11062 case "$d_attribute_nonnull" in
11065 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
11066 $cat >attrib.c <<'EOCP'
11068 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
11070 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11071 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11072 echo "Your C compiler doesn't support __attribute__((nonnull))."
11075 echo "Your C compiler supports __attribute__((nonnull))."
11079 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11083 *) val="$d_attribute_nonnull" ;;
11085 set d_attribute_nonnull
11089 : Look for GCC-style attribute noreturn
11090 case "$d_attribute_noreturn" in
11093 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
11094 $cat >attrib.c <<'EOCP'
11096 void fall_over_dead( void ) __attribute__((noreturn));
11098 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11099 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11100 echo "Your C compiler doesn't support __attribute__((noreturn))."
11103 echo "Your C compiler supports __attribute__((noreturn))."
11107 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11111 *) val="$d_attribute_noreturn" ;;
11113 set d_attribute_noreturn
11117 : Look for GCC-style attribute pure
11118 case "$d_attribute_pure" in
11121 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
11122 $cat >attrib.c <<'EOCP'
11124 int square( int n ) __attribute__((pure));
11126 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11127 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11128 echo "Your C compiler doesn't support __attribute__((pure))."
11131 echo "Your C compiler supports __attribute__((pure))."
11135 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11139 *) val="$d_attribute_pure" ;;
11141 set d_attribute_pure
11145 : Look for GCC-style attribute unused
11146 case "$d_attribute_unused" in
11149 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
11150 $cat >attrib.c <<'EOCP'
11152 int do_something( int dummy __attribute__((unused)), int n );
11154 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11155 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11156 echo "Your C compiler doesn't support __attribute__((unused))."
11159 echo "Your C compiler supports __attribute__((unused))."
11163 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11167 *) val="$d_attribute_unused" ;;
11169 set d_attribute_unused
11173 : Look for GCC-style attribute deprecated
11174 case "$d_attribute_deprecated" in
11177 echo "Checking whether your compiler can handle __attribute__((deprecated)) ..." >&4
11178 $cat >attrib.c <<'EOCP'
11180 int I_am_deprecated(void) __attribute__((deprecated));
11182 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11183 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11184 echo "Your C compiler doesn't support __attribute__((deprecated))."
11187 echo "Your C compiler supports __attribute__((deprecated))."
11191 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11195 *) val="$d_attribute_deprecated" ;;
11197 set d_attribute_deprecated
11201 : Look for GCC-style attribute warn_unused_result
11202 case "$d_attribute_warn_unused_result" in
11205 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
11206 $cat >attrib.c <<'EOCP'
11208 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
11210 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11211 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11212 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
11215 echo "Your C compiler supports __attribute__((warn_unused_result))."
11219 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11223 *) val="$d_attribute_warn_unused_result" ;;
11225 set d_attribute_warn_unused_result
11229 : see if getpgrp exists
11230 set getpgrp d_getpgrp
11233 case "$d_getpgrp" in
11236 echo "Checking to see which flavor of getpgrp is in use..."
11238 #$i_unistd I_UNISTD
11239 #include <sys/types.h>
11241 # include <unistd.h>
11243 #$i_stdlib I_STDLIB
11245 #include <stdlib.h>
11249 if (getuid() == 0) {
11250 printf("(I see you are running Configure as super-user...)\n");
11253 #ifdef TRY_BSD_PGRP
11254 if (getpgrp(1) == 0)
11263 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11264 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
11266 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11267 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
11270 echo "I can't seem to compile and run the test program."
11272 xxx="a USG one, i.e. you use getpgrp()."
11274 # SVR4 systems can appear rather BSD-ish.
11275 case "$i_unistd" in
11277 xxx="a BSD one, i.e. you use getpgrp(pid)."
11281 xxx="probably a USG one, i.e. you use getpgrp()."
11286 echo "Assuming your getpgrp is $xxx" >&4
11295 : see if setpgrp exists
11296 set setpgrp d_setpgrp
11299 case "$d_setpgrp" in
11302 echo "Checking to see which flavor of setpgrp is in use..."
11304 #$i_unistd I_UNISTD
11305 #include <sys/types.h>
11307 # include <unistd.h>
11309 #$i_stdlib I_STDLIB
11311 #include <stdlib.h>
11315 if (getuid() == 0) {
11316 printf("(I see you are running Configure as super-user...)\n");
11319 #ifdef TRY_BSD_PGRP
11320 if (-1 == setpgrp(1, 1))
11323 if (setpgrp() != -1)
11329 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11330 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
11332 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11333 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
11336 echo "(I can't seem to compile and run the test program.)"
11338 xxx="a USG one, i.e. you use setpgrp()."
11340 # SVR4 systems can appear rather BSD-ish.
11341 case "$i_unistd" in
11343 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
11347 xxx="probably a USG one, i.e. you use setpgrp()."
11352 echo "Assuming your setpgrp is $xxx" >&4
11361 : Look for GCC-style __builtin_add_overflow
11362 case "$d_builtin_add_overflow" in
11365 echo "Checking whether your compiler can handle __builtin_add_overflow ..." >&4
11366 $cat >try.c <<'EOCP'
11368 const unsigned int uint_max = ~0u;
11369 int target_int = 0;
11370 if (__builtin_add_overflow(1, 2, &target_int) || target_int != 3) {
11373 if (!__builtin_add_overflow((int)(uint_max >> 1), 1, &target_int)) {
11376 if (!__builtin_add_overflow(uint_max, -1, &target_int)) {
11383 if eval $compile && $run ./try; then
11384 echo "Your C compiler supports __builtin_add_overflow."
11387 echo "Your C compiler doesn't seem to understand __builtin_add_overflow."
11391 *) val="$d_builtin_add_overflow" ;;
11394 set d_builtin_add_overflow
11398 : Look for GCC-style __builtin_sub_overflow
11399 case "$d_builtin_sub_overflow" in
11402 echo "Checking whether your compiler can handle __builtin_sub_overflow ..." >&4
11403 $cat >try.c <<'EOCP'
11405 const unsigned int uint_max = ~0u;
11406 int target_int = 0;
11407 if (__builtin_sub_overflow(1, -2, &target_int) || target_int != 3) {
11410 if (!__builtin_sub_overflow(-(int)(uint_max >> 1), 2, &target_int)) {
11413 if (!__builtin_sub_overflow(uint_max, 1, &target_int)) {
11420 if eval $compile && $run ./try; then
11421 echo "Your C compiler supports __builtin_sub_overflow."
11424 echo "Your C compiler doesn't seem to understand __builtin_sub_overflow."
11428 *) val="$d_builtin_sub_overflow" ;;
11431 set d_builtin_sub_overflow
11435 : Look for GCC-style __builtin_mul_overflow
11436 case "$d_builtin_mul_overflow" in
11439 echo "Checking whether your compiler can handle __builtin_mul_overflow ..." >&4
11440 $cat >try.c <<'EOCP'
11442 const unsigned int uint_max = ~0u;
11443 int target_int = 0;
11444 if (__builtin_mul_overflow(2, 3, &target_int) || target_int != 6) {
11447 if (!__builtin_mul_overflow((int)(uint_max >> 1), 2, &target_int)) {
11450 if (!__builtin_mul_overflow(uint_max, 1, &target_int)) {
11457 if eval $compile && $run ./try; then
11458 echo "Your C compiler supports __builtin_mul_overflow."
11461 echo "Your C compiler doesn't seem to understand __builtin_mul_overflow."
11465 *) val="$d_builtin_mul_overflow" ;;
11468 set d_builtin_mul_overflow
11472 : Look for GCC-style __builtin_choose_expr
11473 case "$d_builtin_choose_expr" in
11476 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
11477 $cat >try.c <<'EOCP'
11478 #include <assert.h>
11479 #include <stdlib.h>
11482 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
11485 assert( SYRINX(1) == 2112 );
11486 assert( SYRINX(1) != 5150 );
11487 assert( SYRINX(0) == 5150 );
11488 assert( SYRINX(0) != 2112 );
11489 puts( "All good!" );
11495 if eval $compile && $run ./try; then
11496 echo "Your C compiler supports __builtin_choose_expr."
11499 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
11503 *) val="$d_builtin_choose_expr" ;;
11506 set d_builtin_choose_expr
11510 : Look for GCC-style __builtin_expect
11511 case "$d_builtin_expect" in
11514 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
11515 $cat >try.c <<'EOCP'
11518 if ( __builtin_expect(n, 0) ) n = 1;
11519 /* Remember shell exit code truth is 0, C truth is non-zero */
11524 if eval $compile && $run ./try; then
11525 echo "Your C compiler supports __builtin_expect."
11528 echo "Your C compiler doesn't seem to understand __builtin_expect."
11532 *) val="$d_builtin_expect" ;;
11535 set d_builtin_expect
11539 : see if the Compiler supports C99 variadic macros
11540 echo "Checking for C99 variadic macros." >&4
11543 #include <stdarg.h>
11545 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
11549 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
11555 if eval $compile && $run ./try 2>&1 >/dev/null; then
11556 case "`$run ./try`" in
11558 echo "You have C99 variadic macros." >&4
11559 d_c99_variadic_macros="$define"
11562 echo "You don't have functional C99 variadic macros." >&4
11563 d_c99_variadic_macros="$undef"
11567 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
11568 d_c99_variadic_macros="$undef"
11572 : see if signal is declared as pointer to function returning int or void
11574 xxx=`./findhdr signal.h`
11575 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
11576 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
11577 echo "You have int (*signal())() instead of void." >&4
11579 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
11580 echo "You have void (*signal())()." >&4
11582 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
11583 echo "You have int (*signal())() instead of void." >&4
11585 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
11586 echo "You have void (*signal())()." >&4
11589 case "$d_voidsig" in
11591 echo "I can't determine whether signal handler returns void or int..." >&4
11593 rp="What type does your signal handler return?"
11596 v*) val="$define";;
11600 echo "As you already told me, signal handler returns void." >&4
11603 *) echo "As you already told me, signal handler returns int." >&4
11610 case "$d_voidsig" in
11611 "$define") signal_t="void";;
11612 *) signal_t="int";;
11616 : check for ability to cast large floats to 32-bit ints.
11618 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
11619 if $test "$intsize" -ge 4; then
11626 #$i_stdlib I_STDLIB
11628 #include <stdlib.h>
11630 #include <sys/types.h>
11631 #include <signal.h>
11632 $signal_t blech(int s) { exit(3); }
11639 signal(SIGFPE, blech);
11641 /* Don't let compiler optimize the test away. Store the number
11642 in a writable string for gcc to pass to sscanf under HP-UX.
11644 sprintf(str, "2147483647");
11645 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
11649 /* x86 processors will probably give 0x8000 0000, which is a
11650 sign change. We don't want that. We want to mimic SPARC
11651 behavior here, which is to preserve the sign and give
11654 if (i32 != ($xxx) f)
11660 if eval $compile_ok; then
11661 $run ./try 2>/dev/null
11664 echo "(I can't seem to compile the test program--assuming it can't)"
11669 echo "Yup, it can."
11672 echo "Nope, it can't."
11679 : check for ability to cast negative floats to unsigned
11681 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
11684 #$i_stdlib I_STDLIB
11686 #include <stdlib.h>
11688 #include <sys/types.h>
11689 #include <signal.h>
11690 $signal_t blech(int s) { exit(7); }
11691 $signal_t blech_in_list(int s) { exit(4); }
11692 unsigned long dummy_long(unsigned long p) { return p; }
11693 unsigned int dummy_int(unsigned int p) { return p; }
11694 unsigned short dummy_short(unsigned short p) { return p; }
11698 unsigned long along;
11700 unsigned short ashort;
11704 /* Frustrate gcc-2.7.2's optimizer which failed this test with
11705 a direct f = -123. assignment. gcc-2.8.0 reportedly
11706 optimized the whole file away
11708 /* Store the number in a writable string for gcc to pass to
11709 sscanf under HP-UX.
11711 sprintf(str, "-123");
11712 sscanf(str, "%lf", &f); /* f = -123.; */
11714 signal(SIGFPE, blech);
11715 along = (unsigned long)f;
11716 aint = (unsigned int)f;
11717 ashort = (unsigned short)f;
11718 if (along != (unsigned long)-123)
11720 if (aint != (unsigned int)-123)
11722 if (ashort != (unsigned short)-123)
11724 sprintf(str, "1073741824.");
11725 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
11728 along = (unsigned long)f;
11729 if (along != 0x80000000)
11733 along = (unsigned long)f;
11734 if (along != 0x7fffffff)
11738 along = (unsigned long)f;
11739 if (along != 0x80000001)
11743 signal(SIGFPE, blech_in_list);
11744 sprintf(str, "123.");
11745 sscanf(str, "%lf", &f); /* f = 123.; */
11746 along = dummy_long((unsigned long)f);
11747 aint = dummy_int((unsigned int)f);
11748 ashort = dummy_short((unsigned short)f);
11749 if (along != (unsigned long)123)
11751 if (aint != (unsigned int)123)
11753 if (ashort != (unsigned short)123)
11760 if eval $compile_ok; then
11761 $run ./try 2>/dev/null
11764 echo "(I can't seem to compile the test program--assuming it can't)"
11767 case "$castflags" in
11769 echo "Yup, it can."
11772 echo "Nope, it can't."
11779 : see if cbrt exists
11783 : see if chown exists
11787 : see if chroot exists
11788 set chroot d_chroot
11791 : see if chsize exists
11792 set chsize d_chsize
11795 : see if class exists
11799 : see if clearenv exists
11800 set clearenv d_clearenv
11803 : Define hasstruct macro for Configure internal use
11804 hasstruct='varname=$1; struct=$2; shift; shift;
11805 while $test $# -ge 2; do
11807 $define) echo "#include <$2>";;
11811 echo "int main () { struct $struct foo; }" >> try.c;
11813 if eval $compile; then
11822 : see whether socket exists
11826 $echo $n "Hmm... $c" >&4
11827 if set socket val -f d_socket; eval $csym; $val; then
11828 echo "Looks like you have Berkeley networking support." >&4
11830 if set setsockopt val -f; eval $csym; $val; then
11833 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
11834 d_oldsock="$define"
11837 if $contains socklib libc.list >/dev/null 2>&1; then
11838 echo "Looks like you have Berkeley networking support." >&4
11840 : we will have to assume that it supports the 4.2 BSD interface
11843 echo "You don't have Berkeley networking in libc$_a..." >&4
11844 if test "X$d_socket" = "X$define"; then
11845 echo "...but you seem to believe that you have sockets." >&4
11847 for net in net socket
11849 if test -f $sysroot/usr/lib/lib$net$_a; then
11850 ( ($nm $nm_opt $sysroot/usr/lib/lib$net$_a | eval $nm_extract) || \
11851 $ar t $sysroot/usr/lib/lib$net$_a) 2>/dev/null >> libc.list
11852 if $contains socket libc.list >/dev/null 2>&1; then
11857 echo "...but the Wollongong group seems to have hacked it in." >&4
11858 sockethdr="-I$sysroot/usr/netinclude"
11861 echo "Found Berkeley sockets interface in lib$net." >&4
11862 if $contains setsockopt libc.list >/dev/null 2>&1; then
11865 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
11866 d_oldsock="$define"
11872 if test "X$d_socket" != "X$define"; then
11873 echo "or anywhere else I see." >&4
11881 : see if socketpair exists
11882 set socketpair d_sockpair
11887 echo "Checking the availability sa_len in the sock struct ..." >&4
11889 #include <sys/types.h>
11890 #include <sys/socket.h>
11892 struct sockaddr sa;
11893 return (sa.sa_len);
11897 set try; if eval $compile; then
11900 set d_sockaddr_sa_len; eval $setvar
11904 echo "Checking the availability struct sockaddr_in6 ..." >&4
11906 #include <sys/types.h>
11907 #include <sys/socket.h>
11908 #include <netinet/in.h>
11910 struct sockaddr_in6 sin6;
11911 return (sin6.sin6_family);
11915 set try; if eval $compile; then
11918 set d_sockaddr_in6; eval $setvar
11922 echo "Checking the availability sin6_scope_id in struct sockaddr_in6 ..." >&4
11924 #include <sys/types.h>
11925 #include <sys/socket.h>
11926 #include <netinet/in.h>
11928 struct sockaddr_in6 sin6;
11929 return (sin6.sin6_scope_id);
11933 set try; if eval $compile; then
11936 set d_sin6_scope_id; eval $setvar
11940 echo "Checking the availability struct ip_mreq ..." >&4
11942 #include <sys/types.h>
11943 #include <sys/socket.h>
11944 #include <netinet/in.h>
11946 struct ip_mreq mreq;
11947 return (mreq.imr_multiaddr.s_addr);
11951 set try; if eval $compile; then
11954 set d_ip_mreq; eval $setvar
11958 echo "Checking the availability struct ip_mreq_source ..." >&4
11960 #include <sys/types.h>
11961 #include <sys/socket.h>
11962 #include <netinet/in.h>
11964 struct ip_mreq_source mreq;
11965 return (mreq.imr_multiaddr.s_addr);
11969 set try; if eval $compile; then
11972 set d_ip_mreq_source; eval $setvar
11976 echo "Checking the availability struct ipv6_mreq ..." >&4
11978 #include <sys/types.h>
11979 #include <sys/socket.h>
11980 #include <netinet/in.h>
11982 struct ipv6_mreq mreq;
11983 return (mreq.ipv6mr_interface);
11987 set try; if eval $compile; then
11990 set d_ipv6_mreq; eval $setvar
11994 echo "Checking the availability struct ipv6_mreq_source ..." >&4
11996 #include <sys/types.h>
11997 #include <sys/socket.h>
11998 #include <netinet/in.h>
12000 struct ipv6_mreq_source mreq;
12001 return (mreq.imr_multiaddr.s_addr);
12005 set try; if eval $compile; then
12008 set d_ipv6_mreq_source; eval $setvar
12012 echo "Checking the availability of certain socket constants..." >&4
12013 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
12014 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
12016 #include <sys/types.h>
12017 #include <sys/socket.h>
12023 set try; if eval $compile; then
12026 set d_${enum}; eval $setvar
12030 : see if this is a sys/uio.h system
12031 set sys/uio.h i_sysuio
12034 : Check for cmsghdr support
12036 echo "Checking to see if your system supports struct cmsghdr..." >&4
12037 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
12039 case "$d_cmsghdr_s" in
12040 "$define") echo "Yes, it does." ;;
12041 *) echo "No, it doesn't." ;;
12045 : check for const keyword
12047 echo 'Checking to see if your C compiler knows about "const"...' >&4
12048 $cat >const.c <<'EOCP'
12049 typedef struct spug { int drokk; } spug;
12053 const spug y = { 0 };
12056 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
12058 echo "Yup, it does."
12061 echo "Nope, it doesn't."
12066 : see if copysign exists
12067 set copysign d_copysign
12070 : see if copysignl exists
12071 set copysignl d_copysignl
12074 : see if crypt exists
12079 $define) cryptlib='' ;;
12080 *) if set crypt val -f d_crypt; eval $csym; $val; then
12081 echo 'crypt() found.' >&4
12085 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
12086 if $test -z "$cryptlib"; then
12087 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
12091 if $test -z "$cryptlib"; then
12092 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
12096 if $test -z "$cryptlib"; then
12097 cryptlib=`./loc libcrypt$_a "" $libpth`
12101 if $test -z "$cryptlib"; then
12102 echo 'crypt() NOT found.' >&4
12113 : see if this is a crypt.h system
12114 set crypt.h i_crypt
12117 : see if crypt_r exists
12118 set crypt_r d_crypt_r
12120 case "$d_crypt_r" in
12122 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
12123 case "$d_crypt_r_proto:$usethreads" in
12124 ":define") d_crypt_r_proto=define
12125 set d_crypt_r_proto crypt_r $hdrs
12129 case "$d_crypt_r_proto" in
12131 case "$crypt_r_proto" in
12132 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
12133 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCS ;;
12135 case "$crypt_r_proto" in
12136 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
12137 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCD ;;
12139 case "$crypt_r_proto" in
12140 ''|0) d_crypt_r=undef
12142 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
12143 * ) case "$crypt_r_proto" in
12144 REENTRANT_PROTO*) ;;
12145 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
12147 echo "Prototype: $try" ;;
12150 *) case "$usethreads" in
12151 define) echo "crypt_r has no prototype, not using it." >&4 ;;
12162 : get csh whereabouts
12164 'csh') val="$undef" ;;
12165 *) val="$define" ;;
12169 : Respect a hint or command line value for full_csh.
12170 case "$full_csh" in
12171 '') full_csh=$csh ;;
12174 : see if ctermid exists
12175 set ctermid d_ctermid
12178 : see if ctermid_r exists
12179 set ctermid_r d_ctermid_r
12181 case "$d_ctermid_r" in
12183 hdrs="$i_systypes sys/types.h define stdio.h "
12184 case "$d_ctermid_r_proto:$usethreads" in
12185 ":define") d_ctermid_r_proto=define
12186 set d_ctermid_r_proto ctermid_r $hdrs
12190 case "$d_ctermid_r_proto" in
12192 case "$ctermid_r_proto" in
12193 ''|0) try='char* ctermid_r(char*);'
12194 ./protochk "$extern_C $try" $hdrs && ctermid_r_proto=B_B ;;
12196 case "$ctermid_r_proto" in
12197 ''|0) d_ctermid_r=undef
12199 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
12200 * ) case "$ctermid_r_proto" in
12201 REENTRANT_PROTO*) ;;
12202 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
12204 echo "Prototype: $try" ;;
12207 *) case "$usethreads" in
12208 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
12215 *) ctermid_r_proto=0
12219 : see if ctime_r exists
12220 set ctime_r d_ctime_r
12222 case "$d_ctime_r" in
12224 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
12225 case "$d_ctime_r_proto:$usethreads" in
12226 ":define") d_ctime_r_proto=define
12227 set d_ctime_r_proto ctime_r $hdrs
12231 case "$d_ctime_r_proto" in
12233 case "$ctime_r_proto" in
12234 ''|0) try='char* ctime_r(const time_t*, char*);'
12235 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SB ;;
12237 case "$ctime_r_proto" in
12238 ''|0) try='char* ctime_r(const time_t*, char*, int);'
12239 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SBI ;;
12241 case "$ctime_r_proto" in
12242 ''|0) try='int ctime_r(const time_t*, char*);'
12243 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SB ;;
12245 case "$ctime_r_proto" in
12246 ''|0) try='int ctime_r(const time_t*, char*, int);'
12247 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SBI ;;
12249 case "$ctime_r_proto" in
12250 ''|0) d_ctime_r=undef
12252 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
12253 * ) case "$ctime_r_proto" in
12254 REENTRANT_PROTO*) ;;
12255 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
12257 echo "Prototype: $try" ;;
12260 *) case "$usethreads" in
12261 define) echo "ctime_r has no prototype, not using it." >&4 ;;
12272 : see if cuserid exists
12273 set cuserid d_cuserid
12276 : see if dbm.h is available
12277 : see if dbmclose exists
12278 set dbmclose d_dbmclose
12281 case "$d_dbmclose" in
12291 *) set rpcsvc/dbm.h i_rpcsvcdbm
12296 *) echo "We won't be including <dbm.h>"
12306 : see if prototype for dbminit is available
12308 set d_dbminitproto dbminit $i_dbm dbm.h
12311 : see if difftime exists
12312 set difftime d_difftime
12315 : see if this is a dirent system
12317 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
12319 echo "<dirent.h> found." >&4
12322 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
12323 echo "<sys/dir.h> found." >&4
12326 xinc=`./findhdr sys/ndir.h`
12328 echo "<dirent.h> NOT found." >&4
12333 : Look for type of directory structure.
12335 $cppstdin $cppflags $cppminus < "$xinc" > try.c
12337 case "$direntrytype" in
12339 case "$i_dirent" in
12340 $define) guess1='struct dirent' ;;
12341 *) guess1='struct direct' ;;
12344 *) guess1="$direntrytype"
12349 'struct dirent') guess2='struct direct' ;;
12350 *) guess2='struct dirent' ;;
12353 if $contains "$guess1" try.c >/dev/null 2>&1; then
12354 direntrytype="$guess1"
12355 echo "Your directory entries are $direntrytype." >&4
12356 elif $contains "$guess2" try.c >/dev/null 2>&1; then
12357 direntrytype="$guess2"
12358 echo "Your directory entries seem to be $direntrytype." >&4
12360 echo "I don't recognize your system's directory entries." >&4
12361 rp="What type is used for directory entries on this system?"
12364 direntrytype="$ans"
12368 : see if the directory entry stores field length
12370 $cppstdin $cppflags $cppminus < "$xinc" > try.c
12371 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
12372 echo "Good, your directory entry keeps length information in d_namlen." >&4
12375 echo "Your directory entry does not know about the d_namlen field." >&4
12382 : Look for DIR.dd_fd
12383 case "$i_dirent" in
12385 echo "Checking to see if DIR has a dd_fd member variable" >&4
12387 #$i_stdlib I_STDLIB
12389 #include <stdlib.h>
12391 #include <dirent.h>
12401 if eval $compile; then
12402 echo "Yes, it does."
12405 echo "No, it does not."
12410 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
12418 : see if this is an sysdir system
12419 set sys/dir.h i_sysdir
12422 : see if this is an sysndir system
12423 set sys/ndir.h i_sysndir
12428 $cat >dirfd.c <<EOM
12430 #$i_stdlib I_STDLIB
12432 #include <stdlib.h>
12434 #$i_dirent I_DIRENT /**/
12435 #$i_sysdir I_SYS_DIR /**/
12436 #$i_sysndir I_SYS_NDIR /**/
12437 #$i_systypes I_SYS_TYPES /**/
12438 #if defined(I_SYS_TYPES)
12439 #include <sys/types.h>
12441 #if defined(I_DIRENT)
12442 #include <dirent.h>
12445 #include <sys/ndir.h>
12448 #include <sys/dir.h>
12453 DIR *dirp = opendir(".");
12454 if (dirfd(dirp) >= 0)
12462 if eval $compile; then
12466 $define) echo "dirfd() found." >&4 ;;
12467 *) echo "dirfd() NOT found." >&4 ;;
12473 : see if dladdr exists
12474 set dladdr d_dladdr
12477 : see if dlerror exists
12480 set dlerror d_dlerror
12484 : see if dlfcn is available
12485 set dlfcn.h i_dlfcn
12488 : Check what extension to use for shared libs
12493 On a few systems, the dynamically loaded modules that perl generates and uses
12494 will need a different extension than shared libs. The default will probably
12500 *) dflt="$dlext" ;;
12502 rp='What is the extension of dynamically loaded modules'
12511 : Check if dlsym need a leading underscore
12517 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
12518 $cat >dyna.c <<'EOM'
12525 #$i_stdlib I_STDLIB
12527 #include <stdlib.h>
12531 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
12533 #include <sys/types.h>
12538 extern int fred() ;
12547 int mode = RTLD_LAZY ;
12549 handle = dlopen("./dyna.$dlext", mode) ;
12550 if (handle == NULL) {
12555 symbol = dlsym(handle, "fred") ;
12556 if (symbol == NULL) {
12557 /* try putting a leading underscore */
12558 symbol = dlsym(handle, "_fred") ;
12559 if (symbol == NULL) {
12572 : Call the object file tmp-dyna.o in case dlext=o.
12573 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
12574 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
12575 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
12576 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
12579 1) echo "Test program failed using dlopen." >&4
12580 echo "Perhaps you should not use dynamic loading." >&4;;
12581 2) echo "Test program failed using dlsym." >&4
12582 echo "Perhaps you should not use dynamic loading." >&4;;
12583 3) echo "dlsym needs a leading underscore" >&4
12585 4) echo "dlsym doesn't need a leading underscore." >&4;;
12588 echo "I can't compile and run the test program." >&4
12589 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
12594 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
12599 : see if drand48_r exists
12600 set drand48_r d_drand48_r
12602 case "$d_drand48_r" in
12604 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
12605 case "$d_drand48_r_proto:$usethreads" in
12606 ":define") d_drand48_r_proto=define
12607 set d_drand48_r_proto drand48_r $hdrs
12611 case "$d_drand48_r_proto" in
12613 case "$drand48_r_proto" in
12614 ''|0) try='int drand48_r(struct drand48_data*, double*);'
12615 ./protochk "$extern_C $try" $hdrs && drand48_r_proto=I_ST ;;
12617 case "$drand48_r_proto" in
12618 ''|0) d_drand48_r=undef
12620 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
12621 * ) case "$drand48_r_proto" in
12622 REENTRANT_PROTO*) ;;
12623 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
12625 echo "Prototype: $try" ;;
12628 *) case "$usethreads" in
12629 define) echo "drand48_r has no prototype, not using it." >&4 ;;
12636 *) drand48_r_proto=0
12640 : see if prototype for drand48 is available
12642 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
12645 : see if dup2 exists
12649 : see if dup3 exists
12653 : see if eaccess exists
12654 set eaccess d_eaccess
12657 : see if endgrent exists
12658 set endgrent d_endgrent
12661 : see if this is an grp system
12667 xxx=`./findhdr grp.h`
12668 $cppstdin $cppflags $cppminus < $xxx >$$.h
12670 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
12682 set d_grpasswd; eval $setvar
12686 : see if endgrent_r exists
12687 set endgrent_r d_endgrent_r
12689 case "$d_endgrent_r" in
12691 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12692 case "$d_endgrent_r_proto:$usethreads" in
12693 ":define") d_endgrent_r_proto=define
12694 set d_endgrent_r_proto endgrent_r $hdrs
12698 case "$d_endgrent_r_proto" in
12700 case "$endgrent_r_proto" in
12701 ''|0) try='int endgrent_r(FILE**);'
12702 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=I_H ;;
12704 case "$endgrent_r_proto" in
12705 ''|0) try='void endgrent_r(FILE**);'
12706 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=V_H ;;
12708 case "$endgrent_r_proto" in
12709 ''|0) d_endgrent_r=undef
12711 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
12712 * ) case "$endgrent_r_proto" in
12713 REENTRANT_PROTO*) ;;
12714 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
12716 echo "Prototype: $try" ;;
12719 *) case "$usethreads" in
12720 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
12727 *) endgrent_r_proto=0
12731 : see if endhostent exists
12732 set endhostent d_endhent
12735 : see if this is a netdb.h system
12736 set netdb.h i_netdb
12739 : see if endhostent_r exists
12740 set endhostent_r d_endhostent_r
12742 case "$d_endhostent_r" in
12744 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12745 case "$d_endhostent_r_proto:$usethreads" in
12746 ":define") d_endhostent_r_proto=define
12747 set d_endhostent_r_proto endhostent_r $hdrs
12751 case "$d_endhostent_r_proto" in
12753 case "$endhostent_r_proto" in
12754 ''|0) try='int endhostent_r(struct hostent_data*);'
12755 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=I_D ;;
12757 case "$endhostent_r_proto" in
12758 ''|0) try='void endhostent_r(struct hostent_data*);'
12759 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=V_D ;;
12761 case "$endhostent_r_proto" in
12762 ''|0) d_endhostent_r=undef
12763 endhostent_r_proto=0
12764 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
12765 * ) case "$endhostent_r_proto" in
12766 REENTRANT_PROTO*) ;;
12767 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
12769 echo "Prototype: $try" ;;
12772 *) case "$usethreads" in
12773 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
12775 d_endhostent_r=undef
12776 endhostent_r_proto=0
12780 *) endhostent_r_proto=0
12784 : see if endnetent exists
12785 set endnetent d_endnent
12788 : see if endnetent_r exists
12789 set endnetent_r d_endnetent_r
12791 case "$d_endnetent_r" in
12793 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12794 case "$d_endnetent_r_proto:$usethreads" in
12795 ":define") d_endnetent_r_proto=define
12796 set d_endnetent_r_proto endnetent_r $hdrs
12800 case "$d_endnetent_r_proto" in
12802 case "$endnetent_r_proto" in
12803 ''|0) try='int endnetent_r(struct netent_data*);'
12804 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=I_D ;;
12806 case "$endnetent_r_proto" in
12807 ''|0) try='void endnetent_r(struct netent_data*);'
12808 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=V_D ;;
12810 case "$endnetent_r_proto" in
12811 ''|0) d_endnetent_r=undef
12812 endnetent_r_proto=0
12813 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
12814 * ) case "$endnetent_r_proto" in
12815 REENTRANT_PROTO*) ;;
12816 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
12818 echo "Prototype: $try" ;;
12821 *) case "$usethreads" in
12822 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
12824 d_endnetent_r=undef
12825 endnetent_r_proto=0
12829 *) endnetent_r_proto=0
12833 : see if endprotoent exists
12834 set endprotoent d_endpent
12837 : see if endprotoent_r exists
12838 set endprotoent_r d_endprotoent_r
12840 case "$d_endprotoent_r" in
12842 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12843 case "$d_endprotoent_r_proto:$usethreads" in
12844 ":define") d_endprotoent_r_proto=define
12845 set d_endprotoent_r_proto endprotoent_r $hdrs
12849 case "$d_endprotoent_r_proto" in
12851 case "$endprotoent_r_proto" in
12852 ''|0) try='int endprotoent_r(struct protoent_data*);'
12853 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=I_D ;;
12855 case "$endprotoent_r_proto" in
12856 ''|0) try='void endprotoent_r(struct protoent_data*);'
12857 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=V_D ;;
12859 case "$endprotoent_r_proto" in
12860 ''|0) d_endprotoent_r=undef
12861 endprotoent_r_proto=0
12862 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
12863 * ) case "$endprotoent_r_proto" in
12864 REENTRANT_PROTO*) ;;
12865 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
12867 echo "Prototype: $try" ;;
12870 *) case "$usethreads" in
12871 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
12873 d_endprotoent_r=undef
12874 endprotoent_r_proto=0
12878 *) endprotoent_r_proto=0
12882 : see if endpwent exists
12883 set endpwent d_endpwent
12886 : see if this is a pwd.h system
12892 xxx=`./findhdr pwd.h`
12893 $cppstdin $cppflags $cppminus < $xxx >$$.h
12895 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
12903 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
12911 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
12919 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
12927 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
12935 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
12943 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
12951 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
12963 set d_pwquota; eval $setvar
12964 set d_pwage; eval $setvar
12965 set d_pwchange; eval $setvar
12966 set d_pwclass; eval $setvar
12967 set d_pwexpire; eval $setvar
12968 set d_pwcomment; eval $setvar
12969 set d_pwgecos; eval $setvar
12970 set d_pwpasswd; eval $setvar
12974 : see if endpwent_r exists
12975 set endpwent_r d_endpwent_r
12977 case "$d_endpwent_r" in
12979 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
12980 case "$d_endpwent_r_proto:$usethreads" in
12981 ":define") d_endpwent_r_proto=define
12982 set d_endpwent_r_proto endpwent_r $hdrs
12986 case "$d_endpwent_r_proto" in
12988 case "$endpwent_r_proto" in
12989 ''|0) try='int endpwent_r(FILE**);'
12990 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=I_H ;;
12992 case "$endpwent_r_proto" in
12993 ''|0) try='void endpwent_r(FILE**);'
12994 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=V_H ;;
12996 case "$endpwent_r_proto" in
12997 ''|0) d_endpwent_r=undef
12999 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
13000 * ) case "$endpwent_r_proto" in
13001 REENTRANT_PROTO*) ;;
13002 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
13004 echo "Prototype: $try" ;;
13007 *) case "$usethreads" in
13008 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
13015 *) endpwent_r_proto=0
13019 : see if endservent exists
13020 set endservent d_endsent
13023 : see if endservent_r exists
13024 set endservent_r d_endservent_r
13026 case "$d_endservent_r" in
13028 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13029 case "$d_endservent_r_proto:$usethreads" in
13030 ":define") d_endservent_r_proto=define
13031 set d_endservent_r_proto endservent_r $hdrs
13035 case "$d_endservent_r_proto" in
13037 case "$endservent_r_proto" in
13038 ''|0) try='int endservent_r(struct servent_data*);'
13039 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=I_D ;;
13041 case "$endservent_r_proto" in
13042 ''|0) try='void endservent_r(struct servent_data*);'
13043 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=V_D ;;
13045 case "$endservent_r_proto" in
13046 ''|0) d_endservent_r=undef
13047 endservent_r_proto=0
13048 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
13049 * ) case "$endservent_r_proto" in
13050 REENTRANT_PROTO*) ;;
13051 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
13053 echo "Prototype: $try" ;;
13056 *) case "$usethreads" in
13057 define) echo "endservent_r has no prototype, not using it." >&4 ;;
13059 d_endservent_r=undef
13060 endservent_r_proto=0
13064 *) endservent_r_proto=0
13068 : Locate the flags for 'open()'
13071 #include <sys/types.h>
13076 #include <sys/file.h>
13078 #$i_stdlib I_STDLIB
13080 #include <stdlib.h>
13091 : check sys/file.h first to get FREAD on Sun
13092 if $test `./findhdr sys/file.h` && \
13093 set try -DI_SYS_FILE && eval $compile; then
13095 echo "<sys/file.h> defines the O_* constants..." >&4
13096 if $run ./try; then
13097 echo "and you have the 3 argument form of open()." >&4
13100 echo "but not the 3 argument form of open(). Oh, well." >&4
13103 elif $test `./findhdr fcntl.h` && \
13104 set try -DI_FCNTL && eval $compile; then
13106 echo "<fcntl.h> defines the O_* constants..." >&4
13107 if $run ./try; then
13108 echo "and you have the 3 argument form of open()." >&4
13111 echo "but not the 3 argument form of open(). Oh, well." >&4
13116 echo "I can't find the O_* constant definitions! You got problems." >&4
13122 : see if this is a sys/file.h system
13127 : do we need to include sys/file.h ?
13131 if $h_sysfile; then
13133 echo "We'll be including <sys/file.h>." >&4
13136 echo "We won't be including <sys/file.h>." >&4
13146 : see if fcntl.h is there
13151 : see if we can include fcntl.h
13157 echo "We'll be including <fcntl.h>." >&4
13160 if $h_sysfile; then
13161 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
13163 echo "We won't be including <fcntl.h>." >&4
13175 : see if fork exists
13179 : see if pipe exists
13183 : check for non-blocking I/O stuff
13184 case "$h_sysfile" in
13185 true) echo "#include <sys/file.h>" > head.c;;
13188 true) echo "#include <fcntl.h>" > head.c;;
13189 *) echo "#include <sys/fcntl.h>" > head.c;;
13194 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
13195 case "$o_nonblock" in
13197 $cat head.c > try.c
13198 $cat >>try.c <<EOCP
13200 #$i_stdlib I_STDLIB
13202 #include <stdlib.h>
13210 printf("O_NONBLOCK\n");
13214 printf("O_NDELAY\n");
13218 printf("FNDELAY\n");
13225 if eval $compile_ok; then
13226 o_nonblock=`$run ./try`
13227 case "$o_nonblock" in
13228 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
13229 *) echo "Seems like we can use $o_nonblock.";;
13232 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
13235 *) echo "Using $hint value $o_nonblock.";;
13240 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
13243 case "$d_fork:$d_pipe:$d_alarm" in
13244 define:define:define)
13245 $cat head.c > try.c
13246 $cat >>try.c <<EOCP
13248 #include <sys/types.h>
13249 #include <signal.h>
13251 #$i_stdlib I_STDLIB
13253 #include <stdlib.h>
13259 #define MY_O_NONBLOCK $o_nonblock
13260 #ifndef errno /* XXX need better Configure test */
13263 #$i_unistd I_UNISTD
13265 #include <unistd.h>
13267 #include <string.h>
13268 $signal_t blech(int x) { exit(3); }
13270 $cat >> try.c <<'EOCP'
13279 ret = pipe(pd); /* Down: child -> parent */
13282 ret = pipe(pu); /* Up: parent -> child */
13286 close(pd[1]); /* Parent reads from pd[0] */
13287 close(pu[0]); /* Parent writes (blocking) to pu[1] */
13289 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
13294 signal(SIGALRM, blech);
13296 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
13298 sprintf(string, "%d\n", ret);
13299 ret = write(2, string, strlen(string));
13300 if (ret != strlen(string))
13304 if (errno == EAGAIN) {
13305 printf("EAGAIN\n");
13310 if (errno == EWOULDBLOCK)
13311 printf("EWOULDBLOCK\n");
13314 ret = write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
13317 sleep(2); /* Give it time to close our pipe */
13319 ret = read(pd[0], buf, 1); /* Should read EOF */
13321 sprintf(string, "%d\n", ret);
13322 ret = write(4, string, strlen(string));
13323 if (ret != strlen(string))
13328 close(pd[0]); /* We write to pd[1] */
13329 close(pu[1]); /* We read from pu[0] */
13330 ret = read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
13333 close(pd[1]); /* Pipe pd is now fully closed! */
13334 exit(0); /* Bye bye, thank you for playing! */
13338 if eval $compile_ok; then
13339 echo "$startsh" >mtry
13340 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
13342 $run ./mtry >/dev/null 2>&1
13344 0) eagain=`$cat try.out`;;
13345 1) echo "Could not perform non-blocking setting!";;
13346 2) echo "I did a successful read() for something that was not there!";;
13347 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
13348 4) echo "Could not find F_SETFL!";;
13349 *) echo "Something terribly wrong happened during testing.";;
13351 rd_nodata=`$cat try.ret`
13352 echo "A read() system call with no data present returns $rd_nodata."
13353 case "$rd_nodata" in
13356 echo "(That's peculiar, fixing that to be -1.)"
13362 echo "Forcing errno EAGAIN on read() with no data available."
13366 echo "Your read() sets errno to $eagain when no data is available."
13369 status=`$cat try.err`
13371 0) echo "And it correctly returns 0 to signal EOF.";;
13372 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
13373 *) echo "However, your read() returns '$status' on EOF??";;
13376 if test "$status" = "$rd_nodata"; then
13377 echo "WARNING: you can't distinguish between EOF and no data!"
13381 echo "I can't compile the test program--assuming errno EAGAIN will do."
13385 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
13394 echo "Using $hint value $eagain."
13395 echo "Your read() returns $rd_nodata when no data is present."
13396 case "$d_eofnblk" in
13397 "$define") echo "And you can see EOF because read() returns 0.";;
13398 "$undef") echo "But you can't see EOF status from read() returned value.";;
13400 echo "(Assuming you can't see EOF status from read anyway.)"
13406 $rm_try head.c mtry
13408 : see if erf exists
13412 : see if erfc exists
13416 : see if exp2 exists
13420 : see if expm1 exists
13424 : see if _ptr and _cnt from stdio act std
13427 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
13428 echo "(Looks like you have stdio.h from BSD.)"
13429 case "$stdio_ptr" in
13430 '') stdio_ptr='((fp)->_p)'
13433 *) ptr_lval=$d_stdio_ptr_lval;;
13435 case "$stdio_cnt" in
13436 '') stdio_cnt='((fp)->_r)'
13439 *) cnt_lval=$d_stdio_cnt_lval;;
13441 case "$stdio_base" in
13442 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
13444 case "$stdio_bufsiz" in
13445 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
13447 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
13448 echo "(Looks like you have stdio.h from Linux.)"
13449 case "$stdio_ptr" in
13450 '') stdio_ptr='((fp)->_IO_read_ptr)'
13453 *) ptr_lval=$d_stdio_ptr_lval;;
13455 case "$stdio_cnt" in
13456 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
13459 *) cnt_lval=$d_stdio_cnt_lval;;
13461 case "$stdio_base" in
13462 '') stdio_base='((fp)->_IO_read_base)';;
13464 case "$stdio_bufsiz" in
13465 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
13468 case "$stdio_ptr" in
13469 '') stdio_ptr='((fp)->_ptr)'
13472 *) ptr_lval=$d_stdio_ptr_lval;;
13474 case "$stdio_cnt" in
13475 '') stdio_cnt='((fp)->_cnt)'
13478 *) cnt_lval=$d_stdio_cnt_lval;;
13480 case "$stdio_base" in
13481 '') stdio_base='((fp)->_base)';;
13483 case "$stdio_bufsiz" in
13484 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
13488 : test whether _ptr and _cnt really work
13489 echo "Checking how std your stdio is..." >&4
13492 #$i_stdlib I_STDLIB
13494 #include <stdlib.h>
13496 #define FILE_ptr(fp) $stdio_ptr
13497 #define FILE_cnt(fp) $stdio_cnt
13499 FILE *fp = fopen("try.c", "r");
13502 18 <= FILE_cnt(fp) &&
13503 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13511 if eval $compile && $to try.c; then
13512 if $run ./try; then
13513 echo "Your stdio acts pretty std."
13516 echo "Your stdio isn't very std."
13519 echo "Your stdio doesn't appear very std."
13523 # glibc 2.2.90 and above apparently change stdio streams so Perl's
13524 # direct buffer manipulation no longer works. The Configure tests
13525 # should be changed to correctly detect this, but until then,
13526 # the following check should at least let perl compile and run.
13527 # (This quick fix should be updated before 5.8.1.)
13528 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
13529 # A. Dougherty, June 3, 2002.
13530 case "$d_gnulibc" in
13532 case "$gnulibc_version" in
13536 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
13545 : Can _ptr be used as an lvalue?
13546 case "$d_stdstdio$ptr_lval" in
13547 $define$define) val=$define ;;
13550 set d_stdio_ptr_lval
13553 : Can _cnt be used as an lvalue?
13554 case "$d_stdstdio$cnt_lval" in
13555 $define$define) val=$define ;;
13558 set d_stdio_cnt_lval
13562 : test whether setting _ptr sets _cnt as a side effect
13563 d_stdio_ptr_lval_sets_cnt="$undef"
13564 d_stdio_ptr_lval_nochange_cnt="$undef"
13565 case "$d_stdio_ptr_lval$d_stdstdio" in
13567 echo "Checking to see what happens if we set the stdio ptr..." >&4
13570 /* Can we scream? */
13571 /* Eat dust sed :-) */
13572 /* In the buffer space, no one can hear you scream. */
13573 #$i_stdlib I_STDLIB
13575 #include <stdlib.h>
13577 #define FILE_ptr(fp) $stdio_ptr
13578 #define FILE_cnt(fp) $stdio_cnt
13579 #include <sys/types.h>
13581 FILE *fp = fopen("try.c", "r");
13586 puts("Fail even to read");
13589 c = getc(fp); /* Read away the first # */
13591 puts("Fail even to read");
13595 18 <= FILE_cnt(fp) &&
13596 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13598 puts("Fail even to read");
13601 ptr = (char*) FILE_ptr(fp);
13602 cnt = (size_t)FILE_cnt(fp);
13604 FILE_ptr(fp) += 42;
13606 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
13607 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
13610 if (FILE_cnt(fp) <= 20) {
13611 printf ("Fail (<20 chars to test)");
13614 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
13615 puts("Fail compare");
13618 if (cnt == FILE_cnt(fp)) {
13619 puts("Pass_unchanged");
13622 if (FILE_cnt(fp) == (cnt - 42)) {
13623 puts("Pass_changed");
13626 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
13632 if eval $compile && $to try.c; then
13633 case `$run ./try` in
13635 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
13636 d_stdio_ptr_lval_sets_cnt="$define" ;;
13638 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
13639 d_stdio_ptr_lval_nochange_cnt="$define" ;;
13641 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
13643 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
13646 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
13652 : see if _base is also standard
13654 case "$d_stdstdio" in
13658 #$i_stdlib I_STDLIB
13660 #include <stdlib.h>
13662 #define FILE_base(fp) $stdio_base
13663 #define FILE_bufsiz(fp) $stdio_bufsiz
13665 FILE *fp = fopen("try.c", "r");
13668 19 <= FILE_bufsiz(fp) &&
13669 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
13676 if eval $compile && $to try.c; then
13677 if $run ./try; then
13678 echo "And its _base field acts std."
13681 echo "But its _base field isn't std."
13684 echo "However, it seems to be lacking the _base field."
13692 : see if fast_stdio exists
13694 case "$d_stdstdio:$d_stdio_ptr_lval" in
13696 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
13698 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
13709 : see if fchdir exists
13710 set fchdir d_fchdir
13713 : see if fchmod exists
13714 set fchmod d_fchmod
13717 : check for openat, unlinkat, renameat, linkat, fchmodat
13718 set openat d_openat
13721 set unlinkat d_unlinkat
13724 set renameat d_renameat
13727 set linkat d_linkat
13730 set fchmodat d_fchmodat
13733 : see if fchown exists
13734 set fchown d_fchown
13737 : see if this is an fcntl system
13741 : See if fcntl-based locking works.
13744 #$i_stdlib I_STDLIB
13746 #include <stdlib.h>
13748 #include <unistd.h>
13750 #include <signal.h>
13751 $signal_t blech(int x) { exit(3); }
13753 #if defined(F_SETLK) && defined(F_SETLKW)
13754 struct flock flock;
13756 fd = open("try.c", O_RDONLY);
13757 flock.l_type = F_RDLCK;
13758 flock.l_whence = SEEK_SET;
13759 flock.l_start = flock.l_len = 0;
13760 signal(SIGALRM, blech);
13762 retval = fcntl(fd, F_SETLK, &flock);
13764 (retval < 0 ? exit(2) : exit(0));
13770 echo "Checking if fcntl-based file locking works... "
13774 if eval $compile_ok; then
13775 if $run ./try; then
13776 echo "Yes, it seems to work."
13779 echo "Nope, it didn't work."
13784 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
13785 *** This is (almost) impossible.
13786 *** If your NFS lock daemons are not feeling well, something like
13787 *** this may happen, please investigate. Cannot continue, aborting.
13795 echo "I'm unable to compile the test program, so I'll assume not."
13800 echo "Nope, since you don't even have fcntl()."
13803 set d_fcntl_can_lock
13807 : check for fd_set items
13810 Checking to see how well your C compiler handles fd_set and friends ...
13813 #$i_stdlib I_STDLIB
13815 #include <stdlib.h>
13817 #$i_systime I_SYS_TIME
13818 #$i_sysselct I_SYS_SELECT
13819 #$d_socket HAS_SOCKET
13820 #include <sys/types.h>
13822 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
13825 #include <sys/time.h>
13827 #ifdef I_SYS_SELECT
13828 #include <sys/select.h>
13837 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
13845 if eval $compile; then
13846 d_fds_bits="$define"
13848 echo "Well, your system knows about the normal fd_set typedef..." >&4
13849 if $run ./try; then
13850 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
13851 d_fd_macros="$define"
13854 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
13856 d_fd_macros="$undef"
13860 Hmm, your compiler has some difficulty with fd_set. Checking further...
13863 if eval $compile; then
13864 d_fds_bits="$undef"
13866 echo "Well, your system has some sort of fd_set available..." >&4
13867 if $run ./try; then
13868 echo "and you have the normal fd_set macros." >&4
13869 d_fd_macros="$define"
13872 but not the normal fd_set macros! Gross! More work for me...
13874 d_fd_macros="$undef"
13877 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
13879 d_fds_bits="$undef"
13880 d_fd_macros="$undef"
13885 : see if fdclose exists
13886 set fdclose d_fdclose
13889 : see if fdim exists
13893 : see if fegetround exists
13894 set fegetround d_fegetround
13897 : see if fgetpos exists
13898 set fgetpos d_fgetpos
13901 : see if finite exists
13902 set finite d_finite
13905 : see if finitel exists
13906 set finitel d_finitel
13909 : see if flock exists
13913 : see if prototype for flock is available
13915 set d_flockproto flock $i_sysfile sys/file.h
13918 : see if fma exists
13922 : see if fmax exists
13926 : see if fmin exists
13930 : see if fp_class exists
13931 set fp_class d_fp_class
13934 : check for fpclassify
13935 echo "Checking to see if you have fpclassify..." >&4
13938 int main() { return fpclassify(1.0) == FP_NORMAL ? 0 : 1; }
13941 if eval $compile; then
13943 echo "You have fpclassify."
13946 echo "You do not have fpclassify."
13952 : see if fp_classify exists
13953 set fp_classify d_fp_classify
13956 : see if fp_classl exists
13957 set fp_classl d_fp_classl
13960 : see if pathconf exists
13961 set pathconf d_pathconf
13964 : see if fpathconf exists
13965 set fpathconf d_fpathconf
13968 : see if fpclass exists
13969 set fpclass d_fpclass
13972 : see if fpclassl exists
13973 set fpclassl d_fpclassl
13976 : see if fpgetround exists
13977 set fpgetround d_fpgetround
13980 : check for fpos64_t
13982 echo "Checking to see if you have fpos64_t..." >&4
13985 int main() { fpos64_t x = 7; }
13988 if eval $compile; then
13990 echo "You have fpos64_t."
13993 echo "You do not have fpos64_t."
13994 case "$fpossize" in
13995 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
14002 : see if this is an xlocale.h system
14003 set xlocale.h i_xlocale
14006 : see if newlocale exists
14007 set newlocale d_newlocale
14010 : see if freelocale exists
14011 set freelocale d_freelocale
14014 : see if uselocale exists
14015 set uselocale d_uselocale
14018 : see if duplocale exists
14019 set duplocale d_duplocale
14022 : see if querylocale exists
14023 set querylocale d_querylocale
14026 : see if frexpl exists
14027 set frexpl d_frexpl
14030 : see if this is a sys/param system
14031 set sys/param.h i_sysparam
14034 : see if this is a sys/mount.h system
14035 set sys/mount.h i_sysmount
14038 : Check for fs_data_s
14040 echo "Checking to see if your system supports struct fs_data..." >&4
14041 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
14043 case "$d_fs_data_s" in
14044 "$define") echo "Yes, it does." ;;
14045 *) echo "No, it doesn't." ;;
14048 : see if fseeko exists
14049 set fseeko d_fseeko
14051 case "$longsize" in
14052 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
14055 : see if fsetpos exists
14056 set fsetpos d_fsetpos
14059 : see if fstatfs exists
14060 set fstatfs d_fstatfs
14063 : see if statvfs exists
14064 set statvfs d_statvfs
14067 : see if fstatvfs exists
14068 set fstatvfs d_fstatvfs
14072 : see if fsync exists
14076 : see if ftello exists
14077 set ftello d_ftello
14079 case "$longsize" in
14080 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
14083 : check for a working futimes
14086 echo "Checking if you have a working futimes()" >&4
14089 #include <sys/time.h>
14096 fd = open ("try.c", O_RDWR);
14097 if (-1 == fd) exit (1);
14098 rv = futimes (fd, NULL);
14099 exit (rv == -1 ? errno : 0);
14103 if eval $compile; then
14107 0) echo "Yes, you have" >&4
14108 d_futimes="$define"
14110 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
14114 echo "No, it does not (probably harmless)" >&4
14118 : look for gai_strerror
14120 $cat >try.c <<'EOCP'
14121 #include <sys/types.h>
14122 #include <sys/socket.h>
14126 return (gai_strerror (0) ? 0 : 1);
14131 if eval $compile; then
14134 0) echo "A working gai_strerror() found." >&4
14136 *) echo "gai_strerror() found, but it doesn't work" >&4
14140 echo "gai_strerror() NOT found." >&4
14146 : see if ndbm.h is available
14149 : Compatibility location for RedHat 7.1
14150 set gdbm/ndbm.h i_gdbmndbm
14152 : Compatibility location for Debian 4.0
14153 set gdbm-ndbm.h i_gdbm_ndbm
14157 if $test "$i_ndbm" = "$define" -o "$i_gdbmndbm" = "$define" -o "$i_gdbm_ndbm" = "$define"; then
14158 : see if dbm_open exists
14159 set dbm_open d_dbm_open
14161 case "$d_dbm_open" in
14164 i_gdbmndbm="$undef"
14165 i_gdbm_ndbm="$undef"
14166 echo "We won't be including <ndbm.h>"
14176 ndbm_hdr_protochk='name=$1; hdr=$2;
14177 eval "ihdr=\$""i_$name";
14179 if $test "$ihdr" = "$define"; then
14180 $echo "Checking if your <$hdr> uses prototypes..." >&4;
14181 case "$d_cplusplus" in
14182 $define) ./protochk "$extern_C void dbm_close(DBM *);" literal "extern \"C\" {" $ihdr $hdr literal "}" && val="$define" ;;
14183 *) ./protochk "$extern_C void dbm_close(int, int);" $ihdr $hdr || val="$define" ;;
14186 $define) $echo "Your <$hdr> seems to have prototypes";;
14187 *) $echo "Your <$hdr> does not seem to have prototypes";;
14190 set "d_${name}_h_uses_prototypes";
14194 eval $ndbm_hdr_protochk
14195 set gdbmndbm gdbm/ndbm.h
14196 eval $ndbm_hdr_protochk
14197 set gdbm_ndbm gdbm-ndbm.h
14198 eval $ndbm_hdr_protochk
14200 : see if getaddrinfo exists
14201 set getaddrinfo d_getaddrinfo
14204 : see if getcwd exists
14205 set getcwd d_getcwd
14208 : see if getespwnam exists
14209 set getespwnam d_getespwnam
14212 : see if getfsstat exists
14213 set getfsstat d_getfsstat
14216 : see if getgrent exists
14217 set getgrent d_getgrent
14220 : see if getgrent_r exists
14221 set getgrent_r d_getgrent_r
14223 case "$d_getgrent_r" in
14225 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14226 case "$d_getgrent_r_proto:$usethreads" in
14227 ":define") d_getgrent_r_proto=define
14228 set d_getgrent_r_proto getgrent_r $hdrs
14232 case "$d_getgrent_r_proto" in
14234 case "$getgrent_r_proto" in
14235 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
14236 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBWR ;;
14238 case "$getgrent_r_proto" in
14239 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
14240 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIR ;;
14242 case "$getgrent_r_proto" in
14243 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
14244 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBW ;;
14246 case "$getgrent_r_proto" in
14247 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
14248 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBI ;;
14250 case "$getgrent_r_proto" in
14251 ''|0) try='int getgrent_r(struct group*, char*, int);'
14252 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBI ;;
14254 case "$getgrent_r_proto" in
14255 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
14256 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIH ;;
14258 case "$getgrent_r_proto" in
14259 ''|0) d_getgrent_r=undef
14261 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
14262 * ) case "$getgrent_r_proto" in
14263 REENTRANT_PROTO*) ;;
14264 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
14266 echo "Prototype: $try" ;;
14269 *) case "$usethreads" in
14270 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
14277 *) getgrent_r_proto=0
14281 : see if getgrgid_r exists
14282 set getgrgid_r d_getgrgid_r
14284 case "$d_getgrgid_r" in
14286 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14287 case "$d_getgrgid_r_proto:$usethreads" in
14288 ":define") d_getgrgid_r_proto=define
14289 set d_getgrgid_r_proto getgrgid_r $hdrs
14293 case "$d_getgrgid_r_proto" in
14295 case "$getgrgid_r_proto" in
14296 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
14297 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
14299 case "$getgrgid_r_proto" in
14300 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
14301 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
14303 case "$getgrgid_r_proto" in
14304 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
14305 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
14307 case "$getgrgid_r_proto" in
14308 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
14309 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
14311 case "$getgrgid_r_proto" in
14312 ''|0) d_getgrgid_r=undef
14314 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
14315 * ) case "$getgrgid_r_proto" in
14316 REENTRANT_PROTO*) ;;
14317 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
14319 echo "Prototype: $try" ;;
14322 *) case "$usethreads" in
14323 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
14330 *) getgrgid_r_proto=0
14334 : see if getgrnam_r exists
14335 set getgrnam_r d_getgrnam_r
14337 case "$d_getgrnam_r" in
14339 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14340 case "$d_getgrnam_r_proto:$usethreads" in
14341 ":define") d_getgrnam_r_proto=define
14342 set d_getgrnam_r_proto getgrnam_r $hdrs
14346 case "$d_getgrnam_r_proto" in
14348 case "$getgrnam_r_proto" in
14349 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
14350 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
14352 case "$getgrnam_r_proto" in
14353 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
14354 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
14356 case "$getgrnam_r_proto" in
14357 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
14358 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CBI ;;
14360 case "$getgrnam_r_proto" in
14361 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
14362 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
14364 case "$getgrnam_r_proto" in
14365 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
14366 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
14368 case "$getgrnam_r_proto" in
14369 ''|0) d_getgrnam_r=undef
14371 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
14372 * ) case "$getgrnam_r_proto" in
14373 REENTRANT_PROTO*) ;;
14374 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
14376 echo "Prototype: $try" ;;
14379 *) case "$usethreads" in
14380 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
14387 *) getgrnam_r_proto=0
14391 : see if gethostbyaddr exists
14392 set gethostbyaddr d_gethbyaddr
14395 : see if gethostbyname exists
14396 set gethostbyname d_gethbyname
14399 : see if gethostent exists
14400 set gethostent d_gethent
14403 : see how we will look up host name
14406 if set gethostname val -f d_gethname; eval $csym; $val; then
14407 echo 'gethostname() found.' >&4
14408 d_gethname="$define"
14411 if set uname val -f d_uname; eval $csym; $val; then
14414 uname() was found, but you're running xenix, and older versions of xenix
14415 have a broken uname(). If you don't really know whether your xenix is old
14416 enough to have a broken system call, use the default answer.
14421 "$define") dflt=n;;
14423 rp='Is your uname() broken?'
14426 n*) d_uname="$define"; call=uname;;
14429 echo 'uname() found.' >&4
14436 case "$d_gethname" in
14437 '') d_gethname="$undef";;
14440 '') d_uname="$undef";;
14442 case "$d_uname$d_gethname" in
14447 Every now and then someone has a $call() that lies about the hostname
14448 but can't be fixed for political or economic reasons. If you wish, I can
14449 pretend $call() isn't there and maybe compute hostname at run-time
14450 thanks to the '$phostname' command.
14453 rp="Shall I ignore $call() from now on?"
14456 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
14459 case "$phostname" in
14460 '') aphostname='';;
14461 *) case "$aphostname" in
14463 *) set X $phostname
14467 file=`./loc $file $file $pth`
14468 aphostname=`echo $file $*`
14473 case "$d_uname$d_gethname" in
14476 case "$phostname" in
14478 echo "There will be no way for $package to get your hostname." >&4;;
14480 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
14484 case "$d_phostname" in
14485 '') d_phostname="$undef";;
14488 : see if gethostbyaddr_r exists
14489 set gethostbyaddr_r d_gethostbyaddr_r
14491 case "$d_gethostbyaddr_r" in
14493 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14494 case "$d_gethostbyaddr_r_proto:$usethreads" in
14495 ":define") d_gethostbyaddr_r_proto=define
14496 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
14500 case "$d_gethostbyaddr_r_proto" in
14502 case "$gethostbyaddr_r_proto" in
14503 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
14504 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
14506 case "$gethostbyaddr_r_proto" in
14507 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
14508 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
14510 case "$gethostbyaddr_r_proto" in
14511 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
14512 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
14514 case "$gethostbyaddr_r_proto" in
14515 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
14516 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
14518 case "$gethostbyaddr_r_proto" in
14519 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
14520 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
14522 case "$gethostbyaddr_r_proto" in
14523 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
14524 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
14526 case "$gethostbyaddr_r_proto" in
14527 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
14528 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
14530 case "$gethostbyaddr_r_proto" in
14531 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
14532 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
14534 case "$gethostbyaddr_r_proto" in
14535 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
14536 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
14538 case "$gethostbyaddr_r_proto" in
14539 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
14540 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
14542 case "$gethostbyaddr_r_proto" in
14543 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
14544 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
14546 case "$gethostbyaddr_r_proto" in
14547 ''|0) d_gethostbyaddr_r=undef
14548 gethostbyaddr_r_proto=0
14549 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
14550 * ) case "$gethostbyaddr_r_proto" in
14551 REENTRANT_PROTO*) ;;
14552 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
14554 echo "Prototype: $try" ;;
14557 *) case "$usethreads" in
14558 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
14560 d_gethostbyaddr_r=undef
14561 gethostbyaddr_r_proto=0
14565 *) gethostbyaddr_r_proto=0
14569 : see if gethostbyname_r exists
14570 set gethostbyname_r d_gethostbyname_r
14572 case "$d_gethostbyname_r" in
14574 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14575 case "$d_gethostbyname_r_proto:$usethreads" in
14576 ":define") d_gethostbyname_r_proto=define
14577 set d_gethostbyname_r_proto gethostbyname_r $hdrs
14581 case "$d_gethostbyname_r_proto" in
14583 case "$gethostbyname_r_proto" in
14584 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
14585 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
14587 case "$gethostbyname_r_proto" in
14588 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
14589 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
14591 case "$gethostbyname_r_proto" in
14592 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
14593 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
14595 case "$gethostbyname_r_proto" in
14596 ''|0) d_gethostbyname_r=undef
14597 gethostbyname_r_proto=0
14598 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
14599 * ) case "$gethostbyname_r_proto" in
14600 REENTRANT_PROTO*) ;;
14601 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
14603 echo "Prototype: $try" ;;
14606 *) case "$usethreads" in
14607 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
14609 d_gethostbyname_r=undef
14610 gethostbyname_r_proto=0
14614 *) gethostbyname_r_proto=0
14618 : see if gethostent_r exists
14619 set gethostent_r d_gethostent_r
14621 case "$d_gethostent_r" in
14623 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14624 case "$d_gethostent_r_proto:$usethreads" in
14625 ":define") d_gethostent_r_proto=define
14626 set d_gethostent_r_proto gethostent_r $hdrs
14630 case "$d_gethostent_r_proto" in
14632 case "$gethostent_r_proto" in
14633 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
14634 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
14636 case "$gethostent_r_proto" in
14637 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
14638 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBIE ;;
14640 case "$gethostent_r_proto" in
14641 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
14642 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBIE ;;
14644 case "$gethostent_r_proto" in
14645 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
14646 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBI ;;
14648 case "$gethostent_r_proto" in
14649 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
14650 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBI ;;
14652 case "$gethostent_r_proto" in
14653 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
14654 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SD ;;
14656 case "$gethostent_r_proto" in
14657 ''|0) d_gethostent_r=undef
14658 gethostent_r_proto=0
14659 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
14660 * ) case "$gethostent_r_proto" in
14661 REENTRANT_PROTO*) ;;
14662 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
14664 echo "Prototype: $try" ;;
14667 *) case "$usethreads" in
14668 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
14670 d_gethostent_r=undef
14671 gethostent_r_proto=0
14675 *) gethostent_r_proto=0
14679 : see if prototypes for various gethostxxx netdb.h functions are available
14681 set d_gethostprotos gethostent $i_netdb netdb.h
14684 : see if getitimer exists
14685 set getitimer d_getitimer
14688 : see if getlogin exists
14689 set getlogin d_getlogin
14692 : see if getlogin_r exists
14693 set getlogin_r d_getlogin_r
14695 case "$d_getlogin_r" in
14697 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
14698 case "$d_getlogin_r_proto:$usethreads" in
14699 ":define") d_getlogin_r_proto=define
14700 set d_getlogin_r_proto getlogin_r $hdrs
14704 case "$d_getlogin_r_proto" in
14706 case "$getlogin_r_proto" in
14707 ''|0) try='int getlogin_r(char*, size_t);'
14708 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BW ;;
14710 case "$getlogin_r_proto" in
14711 ''|0) try='int getlogin_r(char*, int);'
14712 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BI ;;
14714 case "$getlogin_r_proto" in
14715 ''|0) try='char* getlogin_r(char*, size_t);'
14716 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BW ;;
14718 case "$getlogin_r_proto" in
14719 ''|0) try='char* getlogin_r(char*, int);'
14720 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BI ;;
14722 case "$getlogin_r_proto" in
14723 ''|0) d_getlogin_r=undef
14725 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
14726 * ) case "$getlogin_r_proto" in
14727 REENTRANT_PROTO*) ;;
14728 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
14730 echo "Prototype: $try" ;;
14733 *) case "$usethreads" in
14734 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
14741 *) getlogin_r_proto=0
14745 : see if getmnt exists
14746 set getmnt d_getmnt
14749 : see if getmntent exists
14750 set getmntent d_getmntent
14753 : see if getnameinfo exists
14754 set getnameinfo d_getnameinfo
14757 : see if getnetbyaddr exists
14758 set getnetbyaddr d_getnbyaddr
14761 : see if getnetbyname exists
14762 set getnetbyname d_getnbyname
14765 : see if getnetent exists
14766 set getnetent d_getnent
14769 : see if getnetbyaddr_r exists
14770 set getnetbyaddr_r d_getnetbyaddr_r
14772 case "$d_getnetbyaddr_r" in
14774 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14775 case "$d_getnetbyaddr_r_proto:$usethreads" in
14776 ":define") d_getnetbyaddr_r_proto=define
14777 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
14781 case "$d_getnetbyaddr_r_proto" in
14783 case "$getnetbyaddr_r_proto" in
14784 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
14785 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
14787 case "$getnetbyaddr_r_proto" in
14788 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
14789 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
14791 case "$getnetbyaddr_r_proto" in
14792 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
14793 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
14795 case "$getnetbyaddr_r_proto" in
14796 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
14797 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
14799 case "$getnetbyaddr_r_proto" in
14800 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
14801 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
14803 case "$getnetbyaddr_r_proto" in
14804 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
14805 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
14807 case "$getnetbyaddr_r_proto" in
14808 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
14809 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
14811 case "$getnetbyaddr_r_proto" in
14812 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
14813 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
14815 case "$getnetbyaddr_r_proto" in
14816 ''|0) d_getnetbyaddr_r=undef
14817 getnetbyaddr_r_proto=0
14818 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
14819 * ) case "$getnetbyaddr_r_proto" in
14820 REENTRANT_PROTO*) ;;
14821 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
14823 echo "Prototype: $try" ;;
14826 *) case "$usethreads" in
14827 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
14829 d_getnetbyaddr_r=undef
14830 getnetbyaddr_r_proto=0
14834 *) getnetbyaddr_r_proto=0
14838 : see if getnetbyname_r exists
14839 set getnetbyname_r d_getnetbyname_r
14841 case "$d_getnetbyname_r" in
14843 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14844 case "$d_getnetbyname_r_proto:$usethreads" in
14845 ":define") d_getnetbyname_r_proto=define
14846 set d_getnetbyname_r_proto getnetbyname_r $hdrs
14850 case "$d_getnetbyname_r_proto" in
14852 case "$getnetbyname_r_proto" in
14853 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
14854 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
14856 case "$getnetbyname_r_proto" in
14857 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
14858 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
14860 case "$getnetbyname_r_proto" in
14861 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
14862 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
14864 case "$getnetbyname_r_proto" in
14865 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
14866 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
14868 case "$getnetbyname_r_proto" in
14869 ''|0) d_getnetbyname_r=undef
14870 getnetbyname_r_proto=0
14871 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
14872 * ) case "$getnetbyname_r_proto" in
14873 REENTRANT_PROTO*) ;;
14874 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
14876 echo "Prototype: $try" ;;
14879 *) case "$usethreads" in
14880 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
14882 d_getnetbyname_r=undef
14883 getnetbyname_r_proto=0
14887 *) getnetbyname_r_proto=0
14891 : see if getnetent_r exists
14892 set getnetent_r d_getnetent_r
14894 case "$d_getnetent_r" in
14896 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14897 case "$d_getnetent_r_proto:$usethreads" in
14898 ":define") d_getnetent_r_proto=define
14899 set d_getnetent_r_proto getnetent_r $hdrs
14903 case "$d_getnetent_r_proto" in
14905 case "$getnetent_r_proto" in
14906 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
14907 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
14909 case "$getnetent_r_proto" in
14910 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
14911 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBIE ;;
14913 case "$getnetent_r_proto" in
14914 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
14915 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBIE ;;
14917 case "$getnetent_r_proto" in
14918 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
14919 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBI ;;
14921 case "$getnetent_r_proto" in
14922 ''|0) try='int getnetent_r(struct netent*, char*, int);'
14923 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBI ;;
14925 case "$getnetent_r_proto" in
14926 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
14927 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SD ;;
14929 case "$getnetent_r_proto" in
14930 ''|0) d_getnetent_r=undef
14931 getnetent_r_proto=0
14932 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
14933 * ) case "$getnetent_r_proto" in
14934 REENTRANT_PROTO*) ;;
14935 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
14937 echo "Prototype: $try" ;;
14940 *) case "$usethreads" in
14941 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
14943 d_getnetent_r=undef
14944 getnetent_r_proto=0
14948 *) getnetent_r_proto=0
14952 : see if prototypes for various getnetxxx netdb.h functions are available
14954 set d_getnetprotos getnetent $i_netdb netdb.h
14957 : see if getpagesize exists
14958 set getpagesize d_getpagsz
14961 : Optional checks for getprotobyname and getprotobynumber
14963 : see if getprotobyname exists
14964 set getprotobyname d_getpbyname
14967 : see if getprotobynumber exists
14968 set getprotobynumber d_getpbynumber
14971 : see if getprotoent exists
14972 set getprotoent d_getpent
14975 : see if getpgid exists
14976 set getpgid d_getpgid
14979 : see if getpgrp2 exists
14980 set getpgrp2 d_getpgrp2
14983 : see if getppid exists
14984 set getppid d_getppid
14987 : see if getpriority exists
14988 set getpriority d_getprior
14991 : see if getprotobyname_r exists
14992 set getprotobyname_r d_getprotobyname_r
14994 case "$d_getprotobyname_r" in
14996 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14997 case "$d_getprotobyname_r_proto:$usethreads" in
14998 ":define") d_getprotobyname_r_proto=define
14999 set d_getprotobyname_r_proto getprotobyname_r $hdrs
15003 case "$d_getprotobyname_r_proto" in
15005 case "$getprotobyname_r_proto" in
15006 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
15007 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
15009 case "$getprotobyname_r_proto" in
15010 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
15011 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
15013 case "$getprotobyname_r_proto" in
15014 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
15015 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
15017 case "$getprotobyname_r_proto" in
15018 ''|0) d_getprotobyname_r=undef
15019 getprotobyname_r_proto=0
15020 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
15021 * ) case "$getprotobyname_r_proto" in
15022 REENTRANT_PROTO*) ;;
15023 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
15025 echo "Prototype: $try" ;;
15028 *) case "$usethreads" in
15029 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
15031 d_getprotobyname_r=undef
15032 getprotobyname_r_proto=0
15036 *) getprotobyname_r_proto=0
15040 : see if getprotobynumber_r exists
15041 set getprotobynumber_r d_getprotobynumber_r
15043 case "$d_getprotobynumber_r" in
15045 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15046 case "$d_getprotobynumber_r_proto:$usethreads" in
15047 ":define") d_getprotobynumber_r_proto=define
15048 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
15052 case "$d_getprotobynumber_r_proto" in
15054 case "$getprotobynumber_r_proto" in
15055 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
15056 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
15058 case "$getprotobynumber_r_proto" in
15059 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
15060 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
15062 case "$getprotobynumber_r_proto" in
15063 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
15064 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
15066 case "$getprotobynumber_r_proto" in
15067 ''|0) d_getprotobynumber_r=undef
15068 getprotobynumber_r_proto=0
15069 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
15070 * ) case "$getprotobynumber_r_proto" in
15071 REENTRANT_PROTO*) ;;
15072 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
15074 echo "Prototype: $try" ;;
15077 *) case "$usethreads" in
15078 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
15080 d_getprotobynumber_r=undef
15081 getprotobynumber_r_proto=0
15085 *) getprotobynumber_r_proto=0
15089 : see if getprotoent_r exists
15090 set getprotoent_r d_getprotoent_r
15092 case "$d_getprotoent_r" in
15094 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15095 case "$d_getprotoent_r_proto:$usethreads" in
15096 ":define") d_getprotoent_r_proto=define
15097 set d_getprotoent_r_proto getprotoent_r $hdrs
15101 case "$d_getprotoent_r_proto" in
15103 case "$getprotoent_r_proto" in
15104 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
15105 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
15107 case "$getprotoent_r_proto" in
15108 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
15109 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBI ;;
15111 case "$getprotoent_r_proto" in
15112 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
15113 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=S_SBI ;;
15115 case "$getprotoent_r_proto" in
15116 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
15117 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SD ;;
15119 case "$getprotoent_r_proto" in
15120 ''|0) d_getprotoent_r=undef
15121 getprotoent_r_proto=0
15122 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
15123 * ) case "$getprotoent_r_proto" in
15124 REENTRANT_PROTO*) ;;
15125 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
15127 echo "Prototype: $try" ;;
15130 *) case "$usethreads" in
15131 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
15133 d_getprotoent_r=undef
15134 getprotoent_r_proto=0
15138 *) getprotoent_r_proto=0
15142 : see if prototypes for various getprotoxxx netdb.h functions are available
15144 set d_getprotoprotos getprotoent $i_netdb netdb.h
15147 : see if getprpwnam exists
15148 set getprpwnam d_getprpwnam
15151 : see if getpwent exists
15152 set getpwent d_getpwent
15155 : see if getpwent_r exists
15156 set getpwent_r d_getpwent_r
15158 case "$d_getpwent_r" in
15160 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15161 case "$d_getpwent_r_proto:$usethreads" in
15162 ":define") d_getpwent_r_proto=define
15163 set d_getpwent_r_proto getpwent_r $hdrs
15167 case "$d_getpwent_r_proto" in
15169 case "$getpwent_r_proto" in
15170 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
15171 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBWR ;;
15173 case "$getpwent_r_proto" in
15174 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
15175 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIR ;;
15177 case "$getpwent_r_proto" in
15178 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
15179 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBW ;;
15181 case "$getpwent_r_proto" in
15182 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
15183 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBI ;;
15185 case "$getpwent_r_proto" in
15186 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
15187 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBI ;;
15189 case "$getpwent_r_proto" in
15190 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
15191 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIH ;;
15193 case "$getpwent_r_proto" in
15194 ''|0) d_getpwent_r=undef
15196 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
15197 * ) case "$getpwent_r_proto" in
15198 REENTRANT_PROTO*) ;;
15199 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
15201 echo "Prototype: $try" ;;
15204 *) case "$usethreads" in
15205 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
15212 *) getpwent_r_proto=0
15216 : see if getpwnam_r exists
15217 set getpwnam_r d_getpwnam_r
15219 case "$d_getpwnam_r" in
15221 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15222 case "$d_getpwnam_r_proto:$usethreads" in
15223 ":define") d_getpwnam_r_proto=define
15224 set d_getpwnam_r_proto getpwnam_r $hdrs
15228 case "$d_getpwnam_r_proto" in
15230 case "$getpwnam_r_proto" in
15231 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
15232 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
15234 case "$getpwnam_r_proto" in
15235 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
15236 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
15238 case "$getpwnam_r_proto" in
15239 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
15240 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
15242 case "$getpwnam_r_proto" in
15243 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
15244 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
15246 case "$getpwnam_r_proto" in
15247 ''|0) d_getpwnam_r=undef
15249 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
15250 * ) case "$getpwnam_r_proto" in
15251 REENTRANT_PROTO*) ;;
15252 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
15254 echo "Prototype: $try" ;;
15257 *) case "$usethreads" in
15258 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
15265 *) getpwnam_r_proto=0
15269 : see if getpwuid_r exists
15270 set getpwuid_r d_getpwuid_r
15272 case "$d_getpwuid_r" in
15274 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15275 case "$d_getpwuid_r_proto:$usethreads" in
15276 ":define") d_getpwuid_r_proto=define
15277 set d_getpwuid_r_proto getpwuid_r $hdrs
15281 case "$d_getpwuid_r_proto" in
15283 case "$getpwuid_r_proto" in
15284 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
15285 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
15287 case "$getpwuid_r_proto" in
15288 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
15289 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
15291 case "$getpwuid_r_proto" in
15292 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
15293 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
15295 case "$getpwuid_r_proto" in
15296 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
15297 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
15299 case "$getpwuid_r_proto" in
15300 ''|0) d_getpwuid_r=undef
15302 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
15303 * ) case "$getpwuid_r_proto" in
15304 REENTRANT_PROTO*) ;;
15305 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
15307 echo "Prototype: $try" ;;
15310 *) case "$usethreads" in
15311 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
15318 *) getpwuid_r_proto=0
15322 : Optional checks for getsbyname and getsbyport
15324 : see if getservbyname exists
15325 set getservbyname d_getsbyname
15328 : see if getservbyport exists
15329 set getservbyport d_getsbyport
15332 : see if getservent exists
15333 set getservent d_getsent
15336 : see if getservbyname_r exists
15337 set getservbyname_r d_getservbyname_r
15339 case "$d_getservbyname_r" in
15341 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15342 case "$d_getservbyname_r_proto:$usethreads" in
15343 ":define") d_getservbyname_r_proto=define
15344 set d_getservbyname_r_proto getservbyname_r $hdrs
15348 case "$d_getservbyname_r_proto" in
15350 case "$getservbyname_r_proto" in
15351 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
15352 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
15354 case "$getservbyname_r_proto" in
15355 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
15356 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
15358 case "$getservbyname_r_proto" in
15359 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
15360 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
15362 case "$getservbyname_r_proto" in
15363 ''|0) d_getservbyname_r=undef
15364 getservbyname_r_proto=0
15365 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
15366 * ) case "$getservbyname_r_proto" in
15367 REENTRANT_PROTO*) ;;
15368 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
15370 echo "Prototype: $try" ;;
15373 *) case "$usethreads" in
15374 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
15376 d_getservbyname_r=undef
15377 getservbyname_r_proto=0
15381 *) getservbyname_r_proto=0
15385 : see if getservbyport_r exists
15386 set getservbyport_r d_getservbyport_r
15388 case "$d_getservbyport_r" in
15390 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15391 case "$d_getservbyport_r_proto:$usethreads" in
15392 ":define") d_getservbyport_r_proto=define
15393 set d_getservbyport_r_proto getservbyport_r $hdrs
15397 case "$d_getservbyport_r_proto" in
15399 case "$getservbyport_r_proto" in
15400 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
15401 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
15403 case "$getservbyport_r_proto" in
15404 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
15405 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
15407 case "$getservbyport_r_proto" in
15408 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
15409 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
15411 case "$getservbyport_r_proto" in
15412 ''|0) d_getservbyport_r=undef
15413 getservbyport_r_proto=0
15414 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
15415 * ) case "$getservbyport_r_proto" in
15416 REENTRANT_PROTO*) ;;
15417 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
15419 echo "Prototype: $try" ;;
15422 *) case "$usethreads" in
15423 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
15425 d_getservbyport_r=undef
15426 getservbyport_r_proto=0
15430 *) getservbyport_r_proto=0
15434 : see if getservent_r exists
15435 set getservent_r d_getservent_r
15437 case "$d_getservent_r" in
15439 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15440 case "$d_getservent_r_proto:$usethreads" in
15441 ":define") d_getservent_r_proto=define
15442 set d_getservent_r_proto getservent_r $hdrs
15446 case "$d_getservent_r_proto" in
15448 case "$getservent_r_proto" in
15449 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
15450 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBWR ;;
15452 case "$getservent_r_proto" in
15453 ''|0) try='int getservent_r(struct servent*, char*, int);'
15454 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBI ;;
15456 case "$getservent_r_proto" in
15457 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
15458 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=S_SBI ;;
15460 case "$getservent_r_proto" in
15461 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
15462 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SD ;;
15464 case "$getservent_r_proto" in
15465 ''|0) d_getservent_r=undef
15466 getservent_r_proto=0
15467 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
15468 * ) case "$getservent_r_proto" in
15469 REENTRANT_PROTO*) ;;
15470 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
15472 echo "Prototype: $try" ;;
15475 *) case "$usethreads" in
15476 define) echo "getservent_r has no prototype, not using it." >&4 ;;
15478 d_getservent_r=undef
15479 getservent_r_proto=0
15483 *) getservent_r_proto=0
15487 : see if prototypes for various getservxxx netdb.h functions are available
15489 set d_getservprotos getservent $i_netdb netdb.h
15492 : see if getspnam exists
15493 set getspnam d_getspnam
15496 : see if this is a shadow.h system
15497 set shadow.h i_shadow
15500 : see if getspnam_r exists
15501 set getspnam_r d_getspnam_r
15503 case "$d_getspnam_r" in
15505 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
15506 case "$d_getspnam_r_proto:$usethreads" in
15507 ":define") d_getspnam_r_proto=define
15508 set d_getspnam_r_proto getspnam_r $hdrs
15512 case "$d_getspnam_r_proto" in
15514 case "$getspnam_r_proto" in
15515 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
15516 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
15518 case "$getspnam_r_proto" in
15519 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
15520 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=S_CSBI ;;
15522 case "$getspnam_r_proto" in
15523 ''|0) d_getspnam_r=undef
15525 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
15526 * ) case "$getspnam_r_proto" in
15527 REENTRANT_PROTO*) ;;
15528 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
15530 echo "Prototype: $try" ;;
15533 *) case "$usethreads" in
15534 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
15541 *) getspnam_r_proto=0
15545 : see if gettimeofday or ftime exists
15546 set gettimeofday d_gettimeod
15548 case "$d_gettimeod" in
15554 val="$undef"; set d_ftime; eval $setvar
15557 case "$d_gettimeod$d_ftime" in
15560 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
15564 : see if gmtime_r exists
15565 set gmtime_r d_gmtime_r
15567 case "$d_gmtime_r" in
15569 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15570 case "$d_gmtime_r_proto:$usethreads" in
15571 ":define") d_gmtime_r_proto=define
15572 set d_gmtime_r_proto gmtime_r $hdrs
15576 case "$d_gmtime_r_proto" in
15578 case "$gmtime_r_proto" in
15579 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
15580 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=S_TS ;;
15582 case "$gmtime_r_proto" in
15583 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
15584 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=I_TS ;;
15586 case "$gmtime_r_proto" in
15587 ''|0) d_gmtime_r=undef
15589 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
15590 * ) case "$gmtime_r_proto" in
15591 REENTRANT_PROTO*) ;;
15592 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
15594 echo "Prototype: $try" ;;
15597 *) case "$usethreads" in
15598 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
15605 *) gmtime_r_proto=0
15609 : see if hasmntopt exists
15610 set hasmntopt d_hasmntopt
15613 : see if this is a netinet/in.h or sys/in.h system
15614 set netinet/in.h i_niin sys/in.h i_sysin
15617 : see if arpa/inet.h has to be included
15618 set arpa/inet.h i_arpainet
15621 : see if htonl --and friends-- exists
15626 : Maybe they are macros.
15629 $cat >htonl.c <<EOM
15631 #include <sys/types.h>
15632 #$i_niin I_NETINET_IN
15634 #$i_arpainet I_ARPA_INET
15635 #ifdef I_NETINET_IN
15636 #include <netinet/in.h>
15639 #include <sys/in.h>
15642 #include <arpa/inet.h>
15645 printf("Defined as a macro.");
15648 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
15649 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
15651 echo "But it seems to be defined as a macro." >&4
15659 : see if hypot exists
15663 : see if ilogb exists
15667 : see if ilogbl exists
15668 set ilogbl d_ilogbl
15671 : check whether inet_aton exists
15672 set inet_aton d_inetaton
15675 : see if inet_ntop exists
15676 set inet_ntop d_inetntop
15679 : see if inet_pton exists
15680 set inet_pton d_inetpton
15685 $cat >isascii.c <<EOCP
15688 #$i_stdlib I_STDLIB
15690 #include <stdlib.h>
15701 if eval $compile; then
15702 echo "isascii() found." >&4
15705 echo "isascii() NOT found." >&4
15714 $cat >isblank.c <<'EOCP'
15725 if $cc $ccflags $ldflags -o isblank isblank.c $libs >/dev/null 2>&1 ; then
15726 echo "isblank() found." >&4
15729 echo "isblank() NOT found." >&4
15736 : check for isfinite
15737 echo "Checking to see if you have isfinite..." >&4
15740 int main() { return isfinite(0.0); }
15743 if eval $compile; then
15745 echo "You have isfinite."
15748 echo "You do not have isfinite."
15754 : see if isfinitel exists
15755 set isfinitel d_isfinitel
15759 echo "Checking to see if you have isinf..." >&4
15762 int main() { return isinf(0.0); }
15765 if eval $compile; then
15767 echo "You have isinf."
15770 echo "You do not have isinf."
15776 : see if isinfl exists
15777 set isinfl d_isinfl
15781 echo "Checking to see if you have isless..." >&4
15784 int main() { return isless(0.0); }
15787 if eval $compile; then
15789 echo "You have isless."
15792 echo "You do not have isless."
15799 echo "Checking to see if you have isnan..." >&4
15802 int main() { return isnan(0.0); }
15805 if eval $compile; then
15807 echo "You have isnan."
15810 echo "You do not have isnan."
15816 : see if isnanl exists
15817 set isnanl d_isnanl
15820 : check for isnormal
15821 echo "Checking to see if you have isnormal..." >&4
15824 int main() { return isnormal(0.0); }
15827 if eval $compile; then
15829 echo "You have isnormal."
15832 echo "You do not have isnormal."
15842 : see if j0l exists
15846 : see if killpg exists
15847 set killpg d_killpg
15850 : see if localeconv exists
15851 set localeconv d_locconv
15854 : see if libc has the POSIX.1-2008 currency locale rules
15855 case "$d_locconv:$d_lc_monetary_2008" in
15858 #include <locale.h>
15860 struct lconv *lc = localeconv();
15861 char int_p_cs_precedes = lc->int_p_cs_precedes;
15866 if eval $compile; then
15867 d_lc_monetary_2008="$define"
15869 d_lc_monetary_2008="$undef"
15875 : see if lchown exists
15877 $cat > try.c <<'EOCP'
15878 /* System header to define __stub macros and hopefully few prototypes,
15879 which can conflict with char lchown(); below. */
15880 #include <assert.h>
15881 /* Override any gcc2 internal prototype to avoid an error. */
15882 /* We use char because int might match the return type of a gcc2
15883 builtin and then its argument prototype would still apply. */
15886 /* The GNU C library defines this for functions which it implements
15887 to always fail with ENOSYS. Some functions are actually named
15888 something starting with __ and the normal name is an alias. */
15889 #if defined (__stub_lchown) || defined (__stub___lchown)
15897 if eval $compile; then
15898 $echo "lchown() found." >&4
15901 $echo "lchown() NOT found." >&4
15907 : See if number of significant digits in a double precision number is known
15909 $cat >ldbl_dig.c <<EOM
15910 #include <limits.h>
15913 printf("Contains LDBL_DIG");
15916 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
15917 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
15918 echo "LDBL_DIG found." >&4
15921 echo "LDBL_DIG NOT found." >&4
15928 : see if lgamma exists
15929 set lgamma d_lgamma
15932 : see if lgamma_r exists
15933 set lgamma_r d_lgamma_r
15936 : check to see if math.h defines _LIB_VERSION
15937 d_libm_lib_version="$undef"
15939 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
15941 #include <unistd.h>
15943 int main (int argc, char *argv[])
15945 printf ("%d\n", _LIB_VERSION);
15950 if eval $compile; then
15952 echo "Yes, it does ($foo)" >&4
15953 d_libm_lib_version="$define"
15955 echo "No, it does not (probably harmless)" >&4
15959 : see if link exists
15963 : see if llrint exists
15964 set llrint d_llrint
15967 : see if llrintl exists
15968 set llrintl d_llrintl
15971 : see if llround exists
15972 set llround d_llround
15975 : see if llroundl exists
15976 set llroundl d_llroundl
15979 : see if localeconv_l exists
15980 set localeconv_l d_localeconv_l
15983 : see if localtime_r exists
15984 set localtime_r d_localtime_r
15986 case "$d_localtime_r" in
15988 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15989 case "$d_localtime_r_proto:$usethreads" in
15990 ":define") d_localtime_r_proto=define
15991 set d_localtime_r_proto localtime_r $hdrs
15995 case "$d_localtime_r_proto" in
15997 case "$localtime_r_proto" in
15998 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
15999 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=S_TS ;;
16001 case "$localtime_r_proto" in
16002 ''|0) try='int localtime_r(const time_t*, struct tm*);'
16003 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=I_TS ;;
16005 case "$localtime_r_proto" in
16006 ''|0) d_localtime_r=undef
16007 localtime_r_proto=0
16008 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
16009 * ) case "$localtime_r_proto" in
16010 REENTRANT_PROTO*) ;;
16011 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
16013 echo "Prototype: $try" ;;
16016 *) case "$usethreads" in
16017 define) echo "localtime_r has no prototype, not using it." >&4 ;;
16019 d_localtime_r=undef
16020 localtime_r_proto=0
16024 *) localtime_r_proto=0
16028 : see if localtime_r calls tzset
16029 case "$localtime_r_proto" in
16032 /* Does our libc's localtime_r call tzset ?
16033 * return 0 if so, 1 otherwise.
16035 #$i_systypes I_SYS_TYPES
16036 #$i_unistd I_UNISTD
16038 #$i_stdlib I_STDLIB
16039 #$i_malloc I_MALLOC
16041 # include <sys/types.h>
16044 # include <unistd.h>
16050 #include <stdlib.h>
16052 #include <string.h>
16054 # include <malloc.h>
16058 time_t t = time(0L);
16059 char w_tz[]="TZ" "=GMT+5",
16060 e_tz[]="TZ" "=GMT-5",
16061 *tz_e = (char*)malloc(16),
16062 *tz_w = (char*)malloc(16);
16063 struct tm tm_e, tm_w;
16064 memset(&tm_e,'\0',sizeof(struct tm));
16065 memset(&tm_w,'\0',sizeof(struct tm));
16070 localtime_r(&t, &tm_e);
16073 localtime_r(&t, &tm_w);
16075 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
16081 if eval $compile; then
16082 if $run ./try; then
16083 d_localtime_r_needs_tzset=undef;
16085 d_localtime_r_needs_tzset=define;
16088 d_localtime_r_needs_tzset=undef;
16092 d_localtime_r_needs_tzset=undef;
16097 : see if lockf exists
16101 : see if log1p exists
16105 : see if log2 exists
16109 : see if logb exists
16113 : see if lrint exists
16117 : see if lrintl exists
16118 set lrintl d_lrintl
16121 : see if lround exists
16122 set lround d_lround
16125 : see if lroundl exists
16126 set lroundl d_lroundl
16129 : see if prototype for lseek is available
16131 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
16134 : see if lstat exists
16138 : see if madvise exists
16139 set madvise d_madvise
16142 : see if malloc_size exists
16143 set malloc_size d_malloc_size
16146 : see if malloc_size_good exists
16147 set malloc_good_size d_malloc_good_size
16150 : see if mblen exists
16154 : see if mbrlen exists
16155 set mbrlen d_mbrlen
16158 : see if mbrtowc exists
16159 set mbrtowc d_mbrtowc
16162 : see if mbstowcs exists
16163 set mbstowcs d_mbstowcs
16166 : see if mbtowc exists
16167 set mbtowc d_mbtowc
16170 : see if memmem exists
16171 set memmem d_memmem
16174 : see if memrchr exists
16175 set memrchr d_memrchr
16178 : see if mkdir exists
16182 : see if mkdtemp exists
16183 set mkdtemp d_mkdtemp
16186 : see if mkfifo exists
16187 set mkfifo d_mkfifo
16190 : see if mkstemp exists
16191 set mkstemp d_mkstemp
16194 : see if mkstemps exists
16195 set mkstemps d_mkstemps
16198 : see if mktime exists
16199 set mktime d_mktime
16202 : see if sys/mman.h has to be included
16203 set sys/mman.h i_sysmman
16206 : see if mmap exists
16209 : see what shmat returns
16210 : default to something harmless
16212 case "$i_sysmman$d_mmap" in
16214 $cat >mmap.c <<'END'
16215 #include <sys/mman.h>
16218 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
16223 echo "and it returns ($mmaptype)." >&4
16229 : see if sqrtl exists
16233 : see if scalbnl exists
16234 set scalbnl d_scalbnl
16237 : see if truncl exists
16238 set truncl d_truncl
16241 : see if modfl exists
16245 : see if prototype for modfl is available
16247 set d_modflproto modfl define math.h
16250 if $test "$uselongdouble" = "$define"; then
16252 if $test "$d_sqrtl" != "$define"; then
16253 message="$message sqrtl"
16255 if $test "$d_modfl" != "$define"; then
16256 if $test "$d_truncl:$d_copysignl" = "$define:$define"; then
16257 echo "You have both truncl and copysignl, so I can emulate modfl."
16259 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
16260 echo "You have both aintl and copysignl, so I can emulate modfl."
16262 message="$message modfl"
16266 if $test "$d_frexpl" != "$define"; then
16267 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
16268 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
16270 message="$message frexpl"
16273 if $test "$d_ldexpl" != "$define"; then
16274 message="$message ldexpl"
16277 if $test "$message" != ""; then
16280 *** You requested the use of long doubles but you do not seem to have
16281 *** the following mathematical functions needed for long double support:
16283 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
16284 *** Cannot continue, aborting.
16292 : see if mprotect exists
16293 set mprotect d_mprotect
16296 : see if msgctl exists
16297 set msgctl d_msgctl
16300 : see if msgget exists
16301 set msgget d_msgget
16304 : see if msgsnd exists
16305 set msgsnd d_msgsnd
16308 : see if msgrcv exists
16309 set msgrcv d_msgrcv
16312 : see how much of the 'msg*(2)' library is present.
16315 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
16316 *"$undef"*) h_msg=false;;
16320 case "`ipcs 2>&1`" in
16321 "SVID messages"*"not configured"*)
16322 echo "Your $osname does not have the msg*(2) configured." >&4
16325 set msgctl d_msgctl
16327 set msgget d_msgget
16329 set msgsnd d_msgsnd
16331 set msgrcv d_msgrcv
16337 : we could also check for sys/ipc.h ...
16338 if $h_msg && $test `./findhdr sys/msg.h`; then
16339 echo "You have the full msg*(2) library." >&4
16342 echo "You don't have the full msg*(2) library." >&4
16348 : Check for msghdr_s
16350 echo "Checking to see if your system supports struct msghdr..." >&4
16351 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
16353 case "$d_msghdr_s" in
16354 "$define") echo "Yes, it does." ;;
16355 *) echo "No, it doesn't." ;;
16359 : see if msync exists
16363 : see if munmap exists
16364 set munmap d_munmap
16367 : see if nan exists
16371 : see if nanosleep exists
16372 set nanosleep d_nanosleep
16375 : see if nearbyint exists
16376 set nearbyint d_nearbyint
16379 : see if nextafter exists
16380 set nextafter d_nextafter
16383 : see if nexttoward exists
16384 set nexttoward d_nexttoward
16387 : see if nice exists
16391 : see if this is a langinfo.h system
16392 set langinfo.h i_langinfo
16395 : see if nl_langinfo exists
16396 set nl_langinfo d_nl_langinfo
16399 : see if this is a quadmath.h system
16400 set quadmath.h i_quadmath
16403 : Check basic sizes
16405 $echo "Choosing the C types to be used for Perl's internal types..." >&4
16407 case "$use64bitint:$d_quad:$quadtype" in
16410 uvtype="$uquadtype"
16415 uvtype="unsigned long"
16421 case "$uselongdouble:$d_longdbl" in
16423 nvtype="long double"
16424 nvsize=$longdblsize
16431 case "$usequadmath:$i_quadmath" in
16433 nvtype="__float128"
16439 *** You requested the use of the quadmath library, but you
16440 *** do not seem to have the quadmath library installed.
16441 *** Cannot continue, aborting.
16447 define:*) $cat <<EOM >&4
16449 *** You requested the use of the quadmath library, but you
16450 *** do not seem to have the required header, <quadmath.h>.
16452 case "$gccversion" in
16455 *** Your gcc looks a bit old:
16461 *** You are not running a gcc.
16466 *** For the quadmath library you need at least gcc 4.6.
16467 *** Cannot continue, aborting.
16473 $echo "(IV will be "$ivtype", $ivsize bytes)"
16474 $echo "(UV will be "$uvtype", $uvsize bytes)"
16475 $echo "(NV will be "$nvtype", $nvsize bytes)"
16478 #$i_inttypes I_INTTYPES
16480 #include <inttypes.h>
16485 int8_t i = INT8_MAX;
16486 uint8_t u = UINT8_MAX;
16487 printf("int8_t\n");
16490 int16_t i = INT16_MAX;
16491 uint16_t u = UINT16_MAX;
16492 printf("int16_t\n");
16495 int32_t i = INT32_MAX;
16496 uint32_t u = UINT32_MAX;
16497 printf("int32_t\n");
16502 i8type="signed char"
16503 u8type="unsigned char"
16508 '') case "$shortsize" in
16510 u16type="unsigned short"
16518 '') set try -DINT16
16519 if eval $compile; then
16520 case "`$run ./try`" in
16532 '') if $test $shortsize -ge 2; then
16534 u16type="unsigned short"
16542 '') case "$longsize" in
16544 u32type="unsigned long"
16548 *) case "$intsize" in
16550 u32type="unsigned int"
16560 '') set try -DINT32
16561 if eval $compile; then
16562 case "`$run ./try`" in
16574 '') if $test $intsize -ge 4; then
16576 u32type="unsigned int"
16584 '') case "$d_quad:$quadtype" in
16586 i64type="$quadtype"
16587 u64type="$uquadtype"
16595 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
16598 #$i_stdlib I_STDLIB
16600 #include <stdlib.h>
16602 #include <sys/types.h>
16603 #include <signal.h>
16605 /* volatile so that the compiler has to store it out to memory */
16606 volatile int bletched = 0;
16607 $signal_t blech(int s) { bletched = 1; }
16612 int n = 8 * $uvsize;
16615 signal(SIGFPE, blech);
16618 for (i = 0; i < n; i++) {
16619 u = u << 1 | ($uvtype)1;
16621 if (($uvtype)d != u)
16625 d = ($nvtype)(u - 1);
16626 if (($uvtype)d != (u - 1))
16633 printf("%d\n", ((i == n) ? -n : i));
16639 d_nv_preserves_uv="$undef"
16640 if eval $compile; then
16641 nv_preserves_uv_bits="`$run ./try`"
16643 case "$nv_preserves_uv_bits" in
16645 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
16646 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
16647 d_nv_preserves_uv="$define"
16649 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
16650 d_nv_preserves_uv="$undef" ;;
16651 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
16652 nv_preserves_uv_bits="0" ;;
16656 $echo "Checking to find the largest integer value your NVs can hold..." >&4
16660 typedef $nvtype NV;
16667 while(count < 256) {
16668 /* volatile so that the compiler has to store it out to memory */
16669 volatile NV up = value + 1.0;
16670 volatile NV negated = -value;
16671 volatile NV down = negated - 1.0;
16672 volatile NV got_up = up - value;
16673 int up_good = got_up == 1.0;
16674 int got_down = down - negated;
16675 int down_good = got_down == -1.0;
16677 if (down_good != up_good) {
16679 "Inconsistency - up %d %f; down %d %f; for 2**%d (%.20f)\n",
16680 up_good, (double) got_up, down_good, (double) got_down,
16681 count, (double) value);
16688 fputs("256.0", stdout);
16691 fputs("2.0", stdout);
16697 fputs("*", stdout);
16703 fprintf(stderr, "Cannot overflow integer range, even at 2**%d (%.20f)\n",
16704 count, (double) value);
16710 nv_overflows_integers_at='0'
16711 if eval $compile; then
16717 The largest integer your NVs can preserve is equal to $xxx
16719 nv_overflows_integers_at="$xxx"
16722 Cannot determine the largest integer value your NVs can hold, unexpected output
16729 Cannot determine the largest integer value your NVs can hold
16736 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
16739 #$i_stdlib I_STDLIB
16741 #include <stdlib.h>
16743 #include <string.h>
16744 #include <sys/types.h>
16745 #include <signal.h>
16747 /* volatile so that the compiler has to store it out to memory */
16748 volatile int bletched = 0;
16749 $signal_t blech(int s) { bletched = 1; }
16752 int checkit($nvtype d, const char *where) {
16754 unsigned char *p = (unsigned char *)v;
16755 unsigned char *end = p + sizeof(d);
16764 p = (unsigned char *)v;
16765 printf("No - %s: 0x", where);
16767 printf ("%02X", *p++);
16772 int main(int argc, char **argv) {
16775 fail += checkit(d, "0.0");
16777 /* The compiler shouldn't be assuming that bletched is 0 */
16780 fail += checkit(d, "bleched");
16783 signal(SIGFPE, blech);
16786 /* Paranoia - the compiler should have no way of knowing that ANSI says
16787 that argv[argc] will always be NULL. Actually, if it did assume this it
16788 would be buggy, as this is C and main() can be called from elsewhere in
16790 d = argv[argc] ? 1 : 0;
16793 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
16796 fail += checkit(d, "ternary");
16798 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
16801 printf("No - memset doesn't give 0.0\n");
16802 /* This might just blow up: */
16803 printf("(gives %g)\n", d);
16809 printf("No - something bleched\n");
16814 printf("No - %d fail(s)\n", fail);
16823 d_nv_zero_is_allbits_zero="$undef"
16824 if eval $compile; then
16830 0.0 is represented as all bits zero in memory
16832 d_nv_zero_is_allbits_zero="$define"
16835 0.0 is not represented as all bits zero in memory
16837 d_nv_zero_is_allbits_zero="$undef"
16842 0.0 is not represented as all bits zero in memory
16844 d_nv_zero_is_allbits_zero="$undef"
16850 : check for off64_t
16852 echo "Checking to see if you have off64_t..." >&4
16854 #include <sys/types.h>
16855 #include <unistd.h>
16856 int main() { off64_t x = 7; }
16859 if eval $compile; then
16861 echo "You have off64_t."
16864 echo "You do not have off64_t."
16865 case "$lseeksize" in
16866 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
16873 : how to create joinable pthreads
16874 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
16876 echo "Checking what constant to use for creating joinable pthreads..." >&4
16877 $cat >try.c <<'EOCP'
16878 #include <pthread.h>
16880 int detachstate = JOINABLE;
16883 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
16884 if eval $compile; then
16885 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
16886 val="$undef" # Yes, undef.
16887 set d_old_pthread_create_joinable
16890 set old_pthread_create_joinable
16893 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
16894 if eval $compile; then
16895 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
16897 set d_old_pthread_create_joinable
16899 val=PTHREAD_CREATE_UNDETACHED
16900 set old_pthread_create_joinable
16903 set try -DJOINABLE=__UNDETACHED
16904 if eval $compile; then
16905 echo "You seem to use __UNDETACHED." >&4
16907 set d_old_pthread_create_joinable
16910 set old_pthread_create_joinable
16913 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
16915 set d_old_pthread_create_joinable
16918 set old_pthread_create_joinable
16925 d_old_pthread_create_joinable="$undef"
16926 old_pthread_create_joinable=""
16929 : see if pause exists
16933 : see if pipe2 exists
16937 : see if poll exists
16941 : see if prctl exists
16945 : see if prctl supports PR_SET_NAME
16946 d_prctl_set_name=$undef
16951 #include <unistd.h>
16953 #include <sys/prctl.h>
16955 int main (int argc, char *argv[])
16957 return (prctl (PR_SET_NAME, "Test"));
16961 if eval $compile_ok && $run ./try; then
16962 echo "Your prctl (PR_SET_NAME, ...) works"
16963 d_prctl_set_name=$define
16969 : see if readlink exists
16970 set readlink d_readlink
16973 : Check if there is a /proc symlink to the abs path of
16974 : the executing program. We will honor hints of d_procselfexe=$undef
16975 : or procselfexe being non-empty, otherwise will try to determine both
16976 : if we have readlink.
16977 : AmigaOS will attempt to mount proc: aka /proc, if /proc/... is
16978 : referenced, and AmigaOS does not have a proc filesystem anyway.
16981 if $test "X$d_procselfexe" = Xundef; then
16983 elif $test "X$procselfexe" != X -a "X$procselfexe" != 'X '; then
16985 elif $test "X$d_readlink" = Xdefine; then
16986 : NetBSD first as /proc/self is a symlink to /proc/curproc,
16987 : and it feels more tidy to avoid an extra level of symlink
16988 set NetBSD /proc/curproc/exe Linux /proc/self/exe FreeBSD /proc/curproc/file Solaris /proc/self/path/a.out
16989 while test $# -gt 0; do
16992 if $issymlink $try; then
16993 $ls -l $try > reflect
16994 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
16995 echo "You have $type-like $try."
16996 procselfexe='"'$try'"'
16998 : This will break out of the loop
17008 : backward compatibility for d_hvfork
17009 if test X$d_hvfork != X; then
17010 d_vfork="$d_hvfork"
17013 : see if there is a vfork
17018 d_pseudofork=$undef
17020 : Ok, but do we want to use it. vfork is reportedly unreliable in
17021 : perl on Solaris 2.x, and probably elsewhere.
17025 case "$usevfork" in
17031 Perl can only use a vfork() that doesn't suffer from strict
17032 restrictions on calling functions or modifying global data in
17033 the child. For example, glibc-2.1 contains such a vfork()
17034 that is unsuitable. If your system provides a proper fork()
17035 call, chances are that you do NOT want perl to use vfork().
17038 rp="Do you still want to use vfork()?"
17043 echo "Ok, we won't use vfork()."
17052 $define) usevfork='true';;
17053 *) usevfork='false';;
17056 : see whether the pthread_atfork exists
17058 #include <pthread.h>
17061 #ifdef PTHREAD_ATFORK
17062 pthread_atfork(NULL,NULL,NULL);
17067 : see if pthread_atfork exists
17068 set try -DPTHREAD_ATFORK
17069 if eval $compile; then
17074 case "$usethreads" in
17077 $define) echo 'pthread_atfork found.' >&4 ;;
17078 *) echo 'pthread_atfork NOT found.' >&4 ;;
17081 set d_pthread_atfork
17084 : see if pthread_attr_setscope exists
17085 set pthread_attr_setscope d_pthread_attr_setscope
17088 : see whether the various POSIXish _yields exist
17090 #include <pthread.h>
17096 #ifdef PTHREAD_YIELD
17099 #ifdef PTHREAD_YIELD_NULL
17100 pthread_yield(NULL);
17106 : see if sched_yield exists
17107 set try -DSCHED_YIELD
17108 if eval $compile; then
17110 sched_yield='sched_yield()'
17114 case "$usethreads" in
17117 $define) echo 'sched_yield() found.' >&4 ;;
17118 *) echo 'sched_yield() NOT found.' >&4 ;;
17124 : see if pthread_yield exists
17125 set try -DPTHREAD_YIELD
17126 if eval $compile; then
17128 case "$sched_yield" in
17129 '') sched_yield='pthread_yield()' ;;
17132 set try -DPTHREAD_YIELD_NULL
17133 if eval $compile; then
17135 case "$sched_yield" in
17136 '') sched_yield='pthread_yield(NULL)' ;;
17142 case "$usethreads" in
17145 $define) echo 'pthread_yield() found.' >&4 ;;
17146 *) echo 'pthread_yield() NOT found.' >&4 ;;
17150 set d_pthread_yield
17152 case "$sched_yield" in
17153 '') sched_yield=undef ;;
17157 : check for ptrdiff_t
17159 echo "Checking to see if you have ptrdiff_t..." >&4
17161 #include <stddef.h>
17162 int main() { ptrdiff_t x = 7; }
17165 if eval $compile; then
17167 echo "You have ptrdiff_t."
17170 echo "You do not have ptrdiff_t."
17176 : see if random_r exists
17177 set random_r d_random_r
17179 case "$d_random_r" in
17181 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17182 case "$d_random_r_proto:$usethreads" in
17183 ":define") d_random_r_proto=define
17184 set d_random_r_proto random_r $hdrs
17188 case "$d_random_r_proto" in
17190 case "$random_r_proto" in
17191 ''|0) try='int random_r(int*, struct random_data*);'
17192 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_iS ;;
17194 case "$random_r_proto" in
17195 ''|0) try='int random_r(long*, struct random_data*);'
17196 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_lS ;;
17198 case "$random_r_proto" in
17199 ''|0) try='int random_r(struct random_data*, int32_t*);'
17200 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_St ;;
17202 case "$random_r_proto" in
17203 ''|0) d_random_r=undef
17205 echo "Disabling random_r, cannot determine prototype." >&4 ;;
17206 * ) case "$random_r_proto" in
17207 REENTRANT_PROTO*) ;;
17208 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
17210 echo "Prototype: $try" ;;
17213 *) case "$usethreads" in
17214 define) echo "random_r has no prototype, not using it." >&4 ;;
17221 *) random_r_proto=0
17225 : see if readdir and friends exist
17226 set readdir d_readdir
17228 set seekdir d_seekdir
17230 set telldir d_telldir
17232 set rewinddir d_rewinddir
17235 : see if readdir64_r exists
17236 set readdir64_r d_readdir64_r
17238 case "$d_readdir64_r" in
17240 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
17241 case "$d_readdir64_r_proto:$usethreads" in
17242 ":define") d_readdir64_r_proto=define
17243 set d_readdir64_r_proto readdir64_r $hdrs
17247 case "$d_readdir64_r_proto" in
17249 case "$readdir64_r_proto" in
17250 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
17251 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TSR ;;
17253 case "$readdir64_r_proto" in
17254 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
17255 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TS ;;
17257 case "$readdir64_r_proto" in
17258 ''|0) d_readdir64_r=undef
17259 readdir64_r_proto=0
17260 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
17261 * ) case "$readdir64_r_proto" in
17262 REENTRANT_PROTO*) ;;
17263 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
17265 echo "Prototype: $try" ;;
17268 *) case "$usethreads" in
17269 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
17271 d_readdir64_r=undef
17272 readdir64_r_proto=0
17276 *) readdir64_r_proto=0
17280 : see if readdir_r exists
17281 set readdir_r d_readdir_r
17283 case "$d_readdir_r" in
17285 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
17286 case "$d_readdir_r_proto:$usethreads" in
17287 ":define") d_readdir_r_proto=define
17288 set d_readdir_r_proto readdir_r $hdrs
17292 case "$d_readdir_r_proto" in
17294 case "$readdir_r_proto" in
17295 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
17296 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TSR ;;
17298 case "$readdir_r_proto" in
17299 ''|0) try='int readdir_r(DIR*, struct dirent*);'
17300 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TS ;;
17302 case "$readdir_r_proto" in
17303 ''|0) d_readdir_r=undef
17305 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
17306 * ) case "$readdir_r_proto" in
17307 REENTRANT_PROTO*) ;;
17308 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
17310 echo "Prototype: $try" ;;
17313 *) case "$usethreads" in
17314 define) echo "readdir_r has no prototype, not using it." >&4 ;;
17321 *) readdir_r_proto=0
17325 : see if readv exists
17329 : see if recvmsg exists
17330 set recvmsg d_recvmsg
17333 : see if regcomp, regcmp, or re_comp exist, for regular pattern matching
17335 if set regcomp val -f d_regcomp; eval $csym; $val; then
17336 echo 'regcomp() found.' >&4
17337 d_regcomp="$define"
17340 elif set regcmp val -f d_regcmp; eval $csym; $val; then
17341 echo 'regcmp() found.' >&4
17345 elif set re_comp val -f d_re_comp; eval $csym; $val; then
17346 echo 're_comp() found, assuming re_exec() also exists.' >&4
17347 d_re_comp="$define"
17352 No regcomp(), regcmp() nor re_comp() found !! No regular pattern matching.
17359 : see if remainder exists
17360 set remainder d_remainder
17363 : see if remquo exists
17364 set remquo d_remquo
17367 : see if rename exists
17368 set rename d_rename
17371 : see if rint exists
17375 : see if rmdir exists
17379 : see if round exists
17383 : see if prototype for sbrk is available
17385 set d_sbrkproto sbrk $i_unistd unistd.h
17388 : see if scalbn exists
17389 set scalbn d_scalbn
17392 : see if select exists
17393 set select d_select
17396 : see if semctl exists
17397 set semctl d_semctl
17400 : see if semget exists
17401 set semget d_semget
17404 : see if semop exists
17408 : see how much of the 'sem*(2)' library is present.
17411 case "$d_semctl$d_semget$d_semop" in
17412 *"$undef"*) h_sem=false;;
17416 case "`ipcs 2>&1`" in
17417 "SVID messages"*"not configured"*)
17418 echo "Your $osname does not have the sem*(2) configured." >&4
17421 set semctl d_semctl
17423 set semget d_semget
17431 : we could also check for sys/ipc.h ...
17432 if $h_sem && $test `./findhdr sys/sem.h`; then
17433 echo "You have the full sem*(2) library." >&4
17436 echo "You don't have the full sem*(2) library." >&4
17442 : see whether sys/sem.h defines union semun
17444 $cat > try.c <<'END'
17445 #include <sys/types.h>
17446 #include <sys/ipc.h>
17447 #include <sys/sem.h>
17448 int main () { union semun semun; semun.buf = 0; }
17451 if eval $compile; then
17452 echo "You have union semun in <sys/sem.h>." >&4
17455 echo "You do not have union semun in <sys/sem.h>." >&4
17462 : see how to do semctl IPC_STAT
17466 $cat > tryh.h <<END
17469 # define S_IRUSR S_IREAD
17470 # define S_IWUSR S_IWRITE
17471 # define S_IXUSR S_IEXEC
17473 # define S_IRUSR 0400
17474 # define S_IWUSR 0200
17475 # define S_IXUSR 0100
17477 # define S_IRGRP (S_IRUSR>>3)
17478 # define S_IWGRP (S_IWUSR>>3)
17479 # define S_IXGRP (S_IXUSR>>3)
17480 # define S_IROTH (S_IRUSR>>6)
17481 # define S_IWOTH (S_IWUSR>>6)
17482 # define S_IXOTH (S_IXUSR>>6)
17485 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
17486 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
17487 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
17490 : see whether semctl IPC_STAT can use union semun
17491 case "$d_semctl_semun" in
17495 #include <sys/types.h>
17496 #include <sys/ipc.h>
17497 #include <sys/sem.h>
17498 #include <sys/stat.h>
17505 #$d_union_semun HAS_UNION_SEMUN
17508 #ifndef HAS_UNION_SEMUN
17511 struct semid_ds *buf;
17512 unsigned short *array;
17518 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
17519 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
17521 struct semid_ds argbuf;
17524 st = semctl(sem, 0, IPC_STAT, arg);
17528 # endif /* IPC_STAT */
17529 printf("semctl IPC_STAT failed: errno = %d\n", errno);
17531 if (semctl(sem, 0, IPC_RMID, arg) != 0)
17532 # endif /* IPC_RMID */
17533 printf("semctl IPC_RMID failed: errno = %d\n", errno);
17535 #endif /* IPC_PRIVATE && ... */
17536 printf("semget failed: errno = %d\n", errno);
17541 if eval $compile; then
17544 semun) val="$define" ;;
17552 case "$d_semctl_semun" in
17554 echo "You can use union semun for semctl IPC_STAT." >&4
17557 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
17562 : see whether semctl IPC_STAT can use struct semid_ds pointer
17563 case "$d_semctl_semid_ds" in
17566 $cat > try.c <<'END'
17567 #include <sys/types.h>
17568 #include <sys/ipc.h>
17569 #include <sys/sem.h>
17570 #include <sys/stat.h>
17578 struct semid_ds arg;
17581 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
17582 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
17585 st = semctl(sem, 0, IPC_STAT, &arg);
17587 printf("semid_ds\n");
17589 # endif /* IPC_STAT */
17590 printf("semctl IPC_STAT failed: errno = %d\n", errno);
17592 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
17593 # endif /* IPC_RMID */
17594 printf("semctl IPC_RMID failed: errno = %d\n", errno);
17596 #endif /* IPC_PRIVATE && ... */
17597 printf("semget failed: errno = %d\n", errno);
17603 if eval $compile; then
17606 semid_ds) val="$define" ;;
17610 set d_semctl_semid_ds
17614 case "$d_semctl_semid_ds" in
17616 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
17618 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
17624 # We do not have the full sem*(2) library, so assume we can not
17630 set d_semctl_semid_ds
17636 : see if sendmsg exists
17637 set sendmsg d_sendmsg
17640 : see if setegid exists
17641 set setegid d_setegid
17644 : see if seteuid exists
17645 set seteuid d_seteuid
17648 : see if setgrent exists
17649 set setgrent d_setgrent
17652 : see if setgrent_r exists
17653 set setgrent_r d_setgrent_r
17655 case "$d_setgrent_r" in
17657 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
17658 case "$d_setgrent_r_proto:$usethreads" in
17659 ":define") d_setgrent_r_proto=define
17660 set d_setgrent_r_proto setgrent_r $hdrs
17664 case "$d_setgrent_r_proto" in
17666 case "$setgrent_r_proto" in
17667 ''|0) try='int setgrent_r(FILE**);'
17668 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=I_H ;;
17670 case "$setgrent_r_proto" in
17671 ''|0) try='void setgrent_r(FILE**);'
17672 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=V_H ;;
17674 case "$setgrent_r_proto" in
17675 ''|0) d_setgrent_r=undef
17677 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
17678 * ) case "$setgrent_r_proto" in
17679 REENTRANT_PROTO*) ;;
17680 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
17682 echo "Prototype: $try" ;;
17685 *) case "$usethreads" in
17686 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
17693 *) setgrent_r_proto=0
17697 : see if sethostent exists
17698 set sethostent d_sethent
17701 : see if sethostent_r exists
17702 set sethostent_r d_sethostent_r
17704 case "$d_sethostent_r" in
17706 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17707 case "$d_sethostent_r_proto:$usethreads" in
17708 ":define") d_sethostent_r_proto=define
17709 set d_sethostent_r_proto sethostent_r $hdrs
17713 case "$d_sethostent_r_proto" in
17715 case "$sethostent_r_proto" in
17716 ''|0) try='int sethostent_r(int, struct hostent_data*);'
17717 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=I_ID ;;
17719 case "$sethostent_r_proto" in
17720 ''|0) try='void sethostent_r(int, struct hostent_data*);'
17721 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=V_ID ;;
17723 case "$sethostent_r_proto" in
17724 ''|0) d_sethostent_r=undef
17725 sethostent_r_proto=0
17726 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
17727 * ) case "$sethostent_r_proto" in
17728 REENTRANT_PROTO*) ;;
17729 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
17731 echo "Prototype: $try" ;;
17734 *) case "$usethreads" in
17735 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
17737 d_sethostent_r=undef
17738 sethostent_r_proto=0
17742 *) sethostent_r_proto=0
17746 : see if setitimer exists
17747 set setitimer d_setitimer
17750 : see if setlinebuf exists
17751 set setlinebuf d_setlinebuf
17754 : see if setlocale exists
17755 set setlocale d_setlocale
17758 : see if locale.h is available
17759 set locale.h i_locale
17762 : see if setlocale_r exists
17763 set setlocale_r d_setlocale_r
17765 case "$d_setlocale_r" in
17767 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
17768 case "$d_setlocale_r_proto:$usethreads" in
17769 ":define") d_setlocale_r_proto=define
17770 set d_setlocale_r_proto setlocale_r $hdrs
17774 case "$d_setlocale_r_proto" in
17776 case "$setlocale_r_proto" in
17777 ''|0) try='int setlocale_r(int, const char*, char*, int);'
17778 ./protochk "$extern_C $try" $hdrs && setlocale_r_proto=I_ICBI ;;
17780 case "$setlocale_r_proto" in
17781 ''|0) d_setlocale_r=undef
17782 setlocale_r_proto=0
17783 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
17784 * ) case "$setlocale_r_proto" in
17785 REENTRANT_PROTO*) ;;
17786 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
17788 echo "Prototype: $try" ;;
17791 *) case "$usethreads" in
17792 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
17794 d_setlocale_r=undef
17795 setlocale_r_proto=0
17799 *) setlocale_r_proto=0
17803 : see if setnetent exists
17804 set setnetent d_setnent
17807 : see if setnetent_r exists
17808 set setnetent_r d_setnetent_r
17810 case "$d_setnetent_r" in
17812 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17813 case "$d_setnetent_r_proto:$usethreads" in
17814 ":define") d_setnetent_r_proto=define
17815 set d_setnetent_r_proto setnetent_r $hdrs
17819 case "$d_setnetent_r_proto" in
17821 case "$setnetent_r_proto" in
17822 ''|0) try='int setnetent_r(int, struct netent_data*);'
17823 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=I_ID ;;
17825 case "$setnetent_r_proto" in
17826 ''|0) try='void setnetent_r(int, struct netent_data*);'
17827 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=V_ID ;;
17829 case "$setnetent_r_proto" in
17830 ''|0) d_setnetent_r=undef
17831 setnetent_r_proto=0
17832 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
17833 * ) case "$setnetent_r_proto" in
17834 REENTRANT_PROTO*) ;;
17835 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
17837 echo "Prototype: $try" ;;
17840 *) case "$usethreads" in
17841 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
17843 d_setnetent_r=undef
17844 setnetent_r_proto=0
17848 *) setnetent_r_proto=0
17852 : see if setprotoent exists
17853 set setprotoent d_setpent
17856 : see if setpgid exists
17857 set setpgid d_setpgid
17860 : see if setpgrp2 exists
17861 set setpgrp2 d_setpgrp2
17864 : see if setpriority exists
17865 set setpriority d_setprior
17868 : see if setproctitle exists
17869 set setproctitle d_setproctitle
17872 : see if setprotoent_r exists
17873 set setprotoent_r d_setprotoent_r
17875 case "$d_setprotoent_r" in
17877 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17878 case "$d_setprotoent_r_proto:$usethreads" in
17879 ":define") d_setprotoent_r_proto=define
17880 set d_setprotoent_r_proto setprotoent_r $hdrs
17884 case "$d_setprotoent_r_proto" in
17886 case "$setprotoent_r_proto" in
17887 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
17888 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=I_ID ;;
17890 case "$setprotoent_r_proto" in
17891 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
17892 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=V_ID ;;
17894 case "$setprotoent_r_proto" in
17895 ''|0) d_setprotoent_r=undef
17896 setprotoent_r_proto=0
17897 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
17898 * ) case "$setprotoent_r_proto" in
17899 REENTRANT_PROTO*) ;;
17900 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
17902 echo "Prototype: $try" ;;
17905 *) case "$usethreads" in
17906 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
17908 d_setprotoent_r=undef
17909 setprotoent_r_proto=0
17913 *) setprotoent_r_proto=0
17917 : see if setpwent exists
17918 set setpwent d_setpwent
17921 : see if setpwent_r exists
17922 set setpwent_r d_setpwent_r
17924 case "$d_setpwent_r" in
17926 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
17927 case "$d_setpwent_r_proto:$usethreads" in
17928 ":define") d_setpwent_r_proto=define
17929 set d_setpwent_r_proto setpwent_r $hdrs
17933 case "$d_setpwent_r_proto" in
17935 case "$setpwent_r_proto" in
17936 ''|0) try='int setpwent_r(FILE**);'
17937 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=I_H ;;
17939 case "$setpwent_r_proto" in
17940 ''|0) try='void setpwent_r(FILE**);'
17941 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=V_H ;;
17943 case "$setpwent_r_proto" in
17944 ''|0) d_setpwent_r=undef
17946 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
17947 * ) case "$setpwent_r_proto" in
17948 REENTRANT_PROTO*) ;;
17949 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
17951 echo "Prototype: $try" ;;
17954 *) case "$usethreads" in
17955 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
17962 *) setpwent_r_proto=0
17966 : see if setregid exists
17967 set setregid d_setregid
17969 set setresgid d_setresgid
17972 : see if setreuid exists
17973 set setreuid d_setreuid
17975 set setresuid d_setresuid
17978 : see if setrgid exists
17979 set setrgid d_setrgid
17982 : see if setruid exists
17983 set setruid d_setruid
17986 : see if setservent exists
17987 set setservent d_setsent
17990 : see if setservent_r exists
17991 set setservent_r d_setservent_r
17993 case "$d_setservent_r" in
17995 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17996 case "$d_setservent_r_proto:$usethreads" in
17997 ":define") d_setservent_r_proto=define
17998 set d_setservent_r_proto setservent_r $hdrs
18002 case "$d_setservent_r_proto" in
18004 case "$setservent_r_proto" in
18005 ''|0) try='int setservent_r(int, struct servent_data*);'
18006 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=I_ID ;;
18008 case "$setservent_r_proto" in
18009 ''|0) try='void setservent_r(int, struct servent_data*);'
18010 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=V_ID ;;
18012 case "$setservent_r_proto" in
18013 ''|0) d_setservent_r=undef
18014 setservent_r_proto=0
18015 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
18016 * ) case "$setservent_r_proto" in
18017 REENTRANT_PROTO*) ;;
18018 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
18020 echo "Prototype: $try" ;;
18023 *) case "$usethreads" in
18024 define) echo "setservent_r has no prototype, not using it." >&4 ;;
18026 d_setservent_r=undef
18027 setservent_r_proto=0
18031 *) setservent_r_proto=0
18035 : see if setsid exists
18036 set setsid d_setsid
18039 : see if setvbuf exists
18040 set setvbuf d_setvbuf
18043 : see if shmctl exists
18044 set shmctl d_shmctl
18047 : see if shmget exists
18048 set shmget d_shmget
18051 : see if shmat exists
18054 : see what shmat returns
18057 $cat >shmat.c <<'END'
18058 #include <sys/shm.h>
18061 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
18066 echo "and it returns ($shmattype)." >&4
18067 : see if a prototype for shmat is available
18068 xxx=`./findhdr sys/shm.h`
18069 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
18070 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
18081 set d_shmatprototype
18084 : see if shmdt exists
18088 : see how much of the 'shm*(2)' library is present.
18091 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
18092 *"$undef"*) h_shm=false;;
18096 case "`ipcs 2>&1`" in
18097 "SVID shared memory"*"not configured"*)
18098 echo "Your $osname does not have the shm*(2) configured." >&4
18101 set shmctl d_shmctl
18103 set shmget d_shmget
18113 : we could also check for sys/ipc.h ...
18114 if $h_shm && $test `./findhdr sys/shm.h`; then
18115 echo "You have the full shm*(2) library." >&4
18118 echo "You don't have the full shm*(2) library." >&4
18124 : see if we have sigaction
18126 if set sigaction val -f d_sigaction; eval $csym; $val; then
18127 echo 'sigaction() found.' >&4
18130 #include <sys/types.h>
18131 #include <signal.h>
18132 #$i_stdlib I_STDLIB
18134 #include <stdlib.h>
18138 struct sigaction act, oact;
18140 oact.sa_handler = 0;
18141 /* so that act and oact are used */
18142 exit(act.sa_flags == 0 && oact.sa_handler == 0);
18146 if eval $compile_ok; then
18149 echo "But you don't seem to have a usable struct sigaction." >&4
18153 echo 'sigaction NOT found.' >&4
18156 set d_sigaction; eval $setvar
18159 : see what type pids are declared as in the kernel
18160 rp="What is the type of process ids on this system?"
18161 set pid_t pidtype int stdio.h sys/types.h
18164 : see what type uids are declared as in the kernel
18166 echo "Looking for the type for user ids returned by getuid()."
18167 set uid_t uidtype xxx stdio.h sys/types.h
18171 xxx=`./findhdr sys/user.h`
18172 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
18174 unsigned) dflt="$1 $2" ;;
18178 *) dflt="$uidtype";;
18181 uid_t) echo "uid_t found." ;;
18182 *) rp="What is the type for user ids returned by getuid()?"
18188 : Define hasfield_t macro for Configure internal use
18189 hasfield_t='varname=$1; struct=$2; type=$3; field=$4; shift; shift; shift; shift;
18190 while $test $# -ge 2; do
18192 $define) echo "#include <$2>";;
18196 echo "int main () { $struct foo; $type bar = foo.$field; }" >> try.c;
18198 if eval $compile; then
18207 : see what siginfo fields we have
18208 case "$d_sigaction" in
18210 echo "Checking if your siginfo_t has si_errno field...">&4
18211 set d_siginfo_si_errno siginfo_t int si_errno $d_sigaction signal.h
18214 echo "Checking if your siginfo_t has si_pid field...">&4
18215 set d_siginfo_si_pid siginfo_t $pidtype si_pid $d_sigaction signal.h
18218 echo "Checking if your siginfo_t has si_uid field...">&4
18219 set d_siginfo_si_uid siginfo_t $uidtype si_uid $d_sigaction signal.h
18222 echo "Checking if your siginfo_t has si_addr field...">&4
18223 set d_siginfo_si_addr siginfo_t "void *" si_addr $d_sigaction signal.h
18226 echo "Checking if your siginfo_t has si_status field...">&4
18227 set d_siginfo_si_status siginfo_t int si_status $d_sigaction signal.h
18230 echo "Checking if your siginfo_t has si_band field...">&4
18231 set d_siginfo_si_band siginfo_t long si_band $d_sigaction signal.h
18234 echo "Checking if your siginfo_t has si_value field...">&4
18235 set d_siginfo_si_value siginfo_t "union sigval" si_value $d_sigaction signal.h
18238 echo "Checking if your siginfo_t has si_fd field...">&4
18239 set d_siginfo_si_fd siginfo_t int si_fd $d_sigaction signal.h
18244 d_siginfo_si_errno="$undef"
18245 d_siginfo_si_pid="$undef"
18246 d_siginfo_si_uid="$undef"
18247 d_siginfo_si_addr="$undef"
18248 d_siginfo_si_status="$undef"
18249 d_siginfo_si_band="$undef"
18250 d_siginfo_si_value="$undef"
18251 d_siginfo_si_fd="$undef"
18255 : see if this is a sunmath.h system
18256 set sunmath.h i_sunmath
18259 : see if signbit exists
18260 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
18262 #$i_sunmath I_SUNMATH
18264 #ifdef I_SUNMATH /* Solaris special math library */
18265 # include <sunmath.h>
18268 int main(int argc, char **argv)
18272 if ((signbit(x) == 0) && (signbit(y) != 0))
18280 if eval $compile; then
18281 if $run ./try; then
18285 $echo "Signbit seems to be available, but doesn't work as I expected."
18286 $echo "I won't use it." >&4
18297 : see if sigprocmask exists
18298 set sigprocmask d_sigprocmask
18301 : see if sigsetjmp exists
18303 case "$d_sigsetjmp" in
18306 #include <setjmp.h>
18307 #$i_stdlib I_STDLIB
18309 #include <stdlib.h>
18315 if (sigsetjmp(env,1))
18318 siglongjmp(env, 1);
18323 if eval $compile; then
18324 if $run ./try >/dev/null 2>&1; then
18325 echo "POSIX sigsetjmp found." >&4
18329 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
18335 echo "sigsetjmp not found." >&4
18339 *) val="$d_sigsetjmp"
18340 case "$d_sigsetjmp" in
18341 $define) echo "POSIX sigsetjmp found." >&4;;
18342 $undef) echo "sigsetjmp not found." >&4;;
18350 : see if snprintf exists
18351 set snprintf d_snprintf
18354 : see if vsnprintf exists
18355 set vsnprintf d_vsnprintf
18358 case "$d_snprintf-$d_vsnprintf" in
18361 Checking whether your snprintf() and vsnprintf() work okay...
18363 $cat >try.c <<'EOCP'
18364 /* v?snprintf testing logic courtesy of Russ Allbery.
18365 * According to C99:
18366 * - if the buffer is too short it still must be \0-terminated
18367 * - if the buffer is too short the potentially required length
18368 * must be returned and not -1
18369 * - if the buffer is NULL the potentially required length
18370 * must be returned and not -1 or core dump
18373 #include <stdarg.h>
18377 int test (char *format, ...)
18382 va_start (args, format);
18383 count = vsnprintf (buf, sizeof buf, format, args);
18390 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
18391 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
18395 if eval $compile; then
18398 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
18400 Your snprintf() and snprintf() don't seem to be working okay.
18402 d_snprintf="$undef"
18403 d_vsnprintf="$undef"
18407 echo "(I can't seem to compile the test program--assuming they don't)"
18408 d_snprintf="$undef"
18409 d_vsnprintf="$undef"
18415 : see if sockatmark exists
18416 set sockatmark d_sockatmark
18419 : see if prototype for sockatmark is available
18421 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
18424 : see if socks5_init exists
18425 set socks5_init d_socks5_init
18428 : see if srand48_r exists
18429 set srand48_r d_srand48_r
18431 case "$d_srand48_r" in
18433 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
18434 case "$d_srand48_r_proto:$usethreads" in
18435 ":define") d_srand48_r_proto=define
18436 set d_srand48_r_proto srand48_r $hdrs
18440 case "$d_srand48_r_proto" in
18442 case "$srand48_r_proto" in
18443 ''|0) try='int srand48_r(long, struct drand48_data*);'
18444 ./protochk "$extern_C $try" $hdrs && srand48_r_proto=I_LS ;;
18446 case "$srand48_r_proto" in
18447 ''|0) d_srand48_r=undef
18449 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
18450 * ) case "$srand48_r_proto" in
18451 REENTRANT_PROTO*) ;;
18452 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
18454 echo "Prototype: $try" ;;
18457 *) case "$usethreads" in
18458 define) echo "srand48_r has no prototype, not using it." >&4 ;;
18465 *) srand48_r_proto=0
18469 : see if srandom_r exists
18470 set srandom_r d_srandom_r
18472 case "$d_srandom_r" in
18474 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
18475 case "$d_srandom_r_proto:$usethreads" in
18476 ":define") d_srandom_r_proto=define
18477 set d_srandom_r_proto srandom_r $hdrs
18481 case "$d_srandom_r_proto" in
18483 case "$srandom_r_proto" in
18484 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
18485 ./protochk "$extern_C $try" $hdrs && srandom_r_proto=I_TS ;;
18487 case "$srandom_r_proto" in
18488 ''|0) d_srandom_r=undef
18490 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
18491 * ) case "$srandom_r_proto" in
18492 REENTRANT_PROTO*) ;;
18493 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
18495 echo "Prototype: $try" ;;
18498 *) case "$usethreads" in
18499 define) echo "srandom_r has no prototype, not using it." >&4 ;;
18506 *) srandom_r_proto=0
18510 : see if prototype for setresgid is available
18512 set d_sresgproto setresgid $i_unistd unistd.h
18515 : see if prototype for setresuid is available
18517 set d_sresuproto setresuid $i_unistd unistd.h
18520 : see if stat exists
18524 : see if sys/stat.h is available
18525 set sys/stat.h i_sysstat
18528 : see if stat knows about block sizes
18530 echo "Checking to see if your struct stat has st_blocks field..." >&4
18531 set d_statblks stat st_blocks $i_sysstat sys/stat.h
18534 : see if this is a sys/vfs.h system
18535 set sys/vfs.h i_sysvfs
18538 : see if this is a sys/statfs.h system
18539 set sys/statfs.h i_sysstatfs
18542 : Check for statfs_s
18544 echo "Checking to see if your system supports struct statfs..." >&4
18545 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
18547 case "$d_statfs_s" in
18548 "$define") echo "Yes, it does." ;;
18549 *) echo "No, it doesn't." ;;
18553 : see if struct statfs knows about f_flags
18554 case "$d_statfs_s" in
18557 echo "Checking to see if your struct statfs has f_flags field..." >&4
18558 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
18562 set d_statfs_f_flags
18566 case "$d_statfs_f_flags" in
18567 "$define") echo "Yes, it does." ;;
18568 *) echo "No, it doesn't." ;;
18571 : see what flavor, if any, of static inline is supported
18573 echo "Checking to see if your system supports static inline..."
18574 $cat > try.c <<'EOCP'
18575 #include <stdlib.h>
18576 extern int f_via_a(int x);
18577 extern int f_via_b(int x);
18578 int main(int argc, char **argv)
18587 return EXIT_SUCCESS;
18590 return EXIT_FAILURE;
18594 $cat > a.c <<'EOCP'
18595 static INLINE int f(int x) {
18606 $cat > b.c <<'EOCP'
18607 extern int f(int x);
18615 # Respect a hint (or previous) value for perl_static_inline, if there is one.
18616 case "$perl_static_inline" in
18617 '') # Check the various possibilities, and break out on success.
18618 # For gcc, prefer __inline__, which will still permit
18619 # cflags.SH to add in -ansi.
18620 case "$gccversion" in
18621 '') xxx="inline __inline__ __inline _inline";;
18622 *) xxx="__inline__ inline __inline _inline";;
18624 for inline in $xxx; do
18625 set try -DINLINE=$inline a.c
18626 if eval $compile && $run ./try; then
18627 # Now make sure there is no external linkage of static
18629 set try -DINLINE=$inline -DUSE_B a.c b.c
18630 if eval $compile && $run ./try; then
18631 $echo "Your compiler supports static $inline, " >&4
18632 $echo "but it also creates an external definition," >&4
18633 $echo "so I won't use it." >&4
18636 $echo "Your compiler supports static $inline." >&4
18638 perl_static_inline="static $inline";
18642 $echo "Your compiler does NOT support static $inline." >&4
18647 *inline*) # Some variant of inline exists.
18648 echo "Keeping your $hint value of $perl_static_inline."
18651 static) # No inline capabilities
18652 echo "Keeping your $hint value of $perl_static_inline."
18655 *) # Unrecognized previous value -- blindly trust the supplied
18656 # value and hope it makes sense. Use old value for
18657 # d_static_inline, if there is one.
18658 echo "Keeping your $hint value of $perl_static_inline."
18659 case "$d_static_inline" in
18661 *) val=$d_static_inline ;;
18665 # Fallback to plain 'static' if nothing worked.
18666 case "$perl_static_inline" in
18668 perl_static_inline="static"
18672 set d_static_inline
18674 $rm -f a.[co] b.[co]
18677 : Check stream access
18679 Checking how to access stdio streams by file descriptor number...
18681 case "$stdio_stream_array" in
18682 '') $cat >try.c <<EOCP
18685 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
18689 for s in _iob __iob __sF
18691 set try -DSTDIO_STREAM_ARRAY=$s
18692 if eval $compile; then
18693 case "`$run ./try`" in
18694 yes) stdio_stream_array=$s; break ;;
18700 case "$stdio_stream_array" in
18702 I can't figure out how to access stdio streams by file descriptor number.
18704 d_stdio_stream_array="$undef"
18707 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
18709 d_stdio_stream_array="$define"
18713 : see if strcoll exists
18714 set strcoll d_strcoll
18717 : see if strerror_l exists
18718 set strerror_l d_strerror_l
18721 : see if strerror_r exists
18722 set strerror_r d_strerror_r
18724 case "$d_strerror_r" in
18726 hdrs="$i_systypes sys/types.h define stdio.h define string.h"
18727 case "$d_strerror_r_proto:$usethreads" in
18728 ":define") d_strerror_r_proto=define
18729 set d_strerror_r_proto strerror_r $hdrs
18733 case "$d_strerror_r_proto" in
18735 case "$strerror_r_proto" in
18736 ''|0) try='int strerror_r(int, char*, size_t);'
18737 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBW ;;
18739 case "$strerror_r_proto" in
18740 ''|0) try='int strerror_r(int, char*, int);'
18741 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBI ;;
18743 case "$strerror_r_proto" in
18744 ''|0) try='char* strerror_r(int, char*, size_t);'
18745 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=B_IBW ;;
18747 case "$strerror_r_proto" in
18748 ''|0) d_strerror_r=undef
18750 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
18751 * ) case "$strerror_r_proto" in
18752 REENTRANT_PROTO*) ;;
18753 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
18755 echo "Prototype: $try" ;;
18758 *) case "$usethreads" in
18759 define) echo "strerror_r has no prototype, not using it." >&4 ;;
18766 *) strerror_r_proto=0
18770 : see if strftime exists
18771 set strftime d_strftime
18774 : see if strlcat exists
18775 set strlcat d_strlcat
18778 : see if strlcpy exists
18779 set strlcpy d_strlcpy
18782 : see if strnlen exists
18783 set strnlen d_strnlen
18786 : see if strtod exists
18787 set strtod d_strtod
18790 : see if strtol exists
18791 set strtol d_strtol
18794 : see if strtold exists
18795 set strtold d_strtold
18798 : see if strtold_l exists
18799 set strtold_l d_strtold_l
18802 : see if strtoll exists
18803 set strtoll d_strtoll
18806 case "$d_longlong-$d_strtoll" in
18809 Checking whether your strtoll() works okay...
18811 $cat >try.c <<'EOCP'
18814 #define strtoll __strtoll
18817 #define strtoll _strtoll
18820 extern long long int strtoll(char *s, char **, int);
18821 static int bad = 0;
18822 int check(char *s, long long ell, int een) {
18825 gll = strtoll(s, 0, 10);
18826 if (!((gll == ell) && (errno == een)))
18830 check(" 1", 1LL, 0);
18831 check(" 0", 0LL, 0);
18832 check("-1", -1LL, 0);
18833 check("-9223372036854775808", -9223372036854775808LL, 0);
18834 check("-9223372036854775808", -9223372036854775808LL, 0);
18835 check(" 9223372036854775807", 9223372036854775807LL, 0);
18836 check("-9223372036854775808", -9223372036854775808LL, 0);
18837 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
18838 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
18844 if eval $compile; then
18847 ok) echo "Your strtoll() seems to be working okay." ;;
18849 Your strtoll() doesn't seem to be working okay.
18855 echo "(I can't seem to compile the test program--assuming it doesn't)"
18861 : see if strtoq exists
18862 set strtoq d_strtoq
18865 : see if strtoul exists
18866 set strtoul d_strtoul
18869 case "$d_strtoul" in
18872 Checking whether your strtoul() works okay...
18874 $cat >try.c <<'EOCP'
18877 extern unsigned long int strtoul(char *s, char **, int);
18878 static int bad = 0;
18879 void check(char *s, unsigned long eul, int een) {
18882 gul = strtoul(s, 0, 10);
18883 if (!((gul == eul) && (errno == een)))
18887 check(" 1", 1L, 0);
18888 check(" 0", 0L, 0);
18890 case "$longsize" in
18892 $cat >>try.c <<'EOCP'
18893 check("18446744073709551615", 18446744073709551615UL, 0);
18894 check("18446744073709551616", 18446744073709551615UL, ERANGE);
18895 #if 0 /* strtoul() for /^-/ strings is undefined. */
18896 check("-1", 18446744073709551615UL, 0);
18897 check("-18446744073709551614", 2, 0);
18898 check("-18446744073709551615", 1, 0);
18899 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
18900 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
18905 $cat >>try.c <<'EOCP'
18906 check("4294967295", 4294967295UL, 0);
18907 check("4294967296", 4294967295UL, ERANGE);
18908 #if 0 /* strtoul() for /^-/ strings is undefined. */
18909 check("-1", 4294967295UL, 0);
18910 check("-4294967294", 2, 0);
18911 check("-4294967295", 1, 0);
18912 check("-4294967296", 4294967295UL, ERANGE);
18913 check("-4294967297", 4294967295UL, ERANGE);
18918 : Should we write these tests to be more portable by sprintf-ing
18919 : ~0 and then manipulating that char string as input for strtol?
18922 $cat >>try.c <<'EOCP'
18929 if eval $compile; then
18930 case "`$run ./try`" in
18931 ok) echo "Your strtoul() seems to be working okay." ;;
18933 Your strtoul() doesn't seem to be working okay.
18939 echo "(I can't seem to compile the test program--assuming it doesn't)"
18945 : see if strtoull exists
18946 set strtoull d_strtoull
18949 case "$d_longlong-$d_strtoull" in
18952 Checking whether your strtoull() works okay...
18954 $cat >try.c <<'EOCP'
18957 #define strtoull __strtoull
18960 extern unsigned long long int strtoull(char *s, char **, int);
18961 static int bad = 0;
18962 int check(char *s, long long eull, int een) {
18965 gull = strtoull(s, 0, 10);
18966 if (!((gull == eull) && (errno == een)))
18970 check(" 1", 1LL, 0);
18971 check(" 0", 0LL, 0);
18972 check("18446744073709551615", 18446744073709551615ULL, 0);
18973 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18974 #if 0 /* strtoull() for /^-/ strings is undefined. */
18975 check("-1", 18446744073709551615ULL, 0);
18976 check("-18446744073709551614", 2LL, 0);
18977 check("-18446744073709551615", 1LL, 0);
18978 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18979 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18986 if eval $compile; then
18987 case "`$run ./try`" in
18988 ok) echo "Your strtoull() seems to be working okay." ;;
18990 Your strtoull() doesn't seem to be working okay.
18992 d_strtoull="$undef"
18996 echo "(I can't seem to compile the test program--assuming it doesn't)"
18997 d_strtoull="$undef"
19002 : see if strtouq exists
19003 set strtouq d_strtouq
19006 case "$d_strtouq" in
19009 Checking whether your strtouq() works okay...
19011 $cat >try.c <<'EOCP'
19014 extern unsigned long long int strtouq(char *s, char **, int);
19015 static int bad = 0;
19016 void check(char *s, unsigned long long eull, int een) {
19017 unsigned long long gull;
19019 gull = strtouq(s, 0, 10);
19020 if (!((gull == eull) && (errno == een)))
19024 check(" 1", 1LL, 0);
19025 check(" 0", 0LL, 0);
19026 check("18446744073709551615", 18446744073709551615ULL, 0);
19027 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
19028 #if 0 /* strtouq() for /^-/ strings is undefined. */
19029 check("-1", 18446744073709551615ULL, 0);
19030 check("-18446744073709551614", 2LL, 0);
19031 check("-18446744073709551615", 1LL, 0);
19032 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
19033 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
19041 if eval $compile; then
19042 case "`$run ./try`" in
19043 ok) echo "Your strtouq() seems to be working okay." ;;
19045 Your strtouq() doesn't seem to be working okay.
19051 echo "(I can't seem to compile the test program--assuming it doesn't)"
19057 : see if strxfrm exists
19058 set strxfrm d_strxfrm
19061 : see if symlink exists
19062 set symlink d_symlink
19065 : see if syscall exists
19066 set syscall d_syscall
19069 : see if prototype for syscall is available
19071 set d_syscallproto syscall $i_unistd unistd.h
19074 : see if sysconf exists
19075 set sysconf d_sysconf
19078 : see if sys_errlist[] exists
19080 if test "X$d_syserrlst" = X; then
19081 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
19082 echo "You have sys_errlist[], so we could roll our own strerror."
19083 d_syserrlst="$define"
19085 echo "You don't have sys_errlist[], so strerror() is welcome."
19086 d_syserrlst="$undef"
19090 : see if system exists
19091 set system d_system
19094 : see if tcgetpgrp exists
19095 set tcgetpgrp d_tcgetpgrp
19098 : see if tcsetpgrp exists
19099 set tcsetpgrp d_tcsetpgrp
19102 : see if prototype for telldir is available
19104 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
19107 : see if tgamma exists
19108 set tgamma d_tgamma
19111 : check for thread_safe_nl_langinfo_l item
19114 Checking to see if you have nl_langinfo_l() and that it is thread-safe
19117 #$i_stdlib I_STDLIB
19119 # include <stdlib.h>
19121 #include <string.h>
19122 #$i_langinfo I_LANGINFO
19124 # include <langinfo.h>
19126 #$i_pthread I_PTHREAD
19128 # include <pthread.h>
19130 #$i_locale I_LOCALE
19132 # include <locale.h>
19136 thread_start(void * arg)
19138 nl_langinfo(RADIXCHAR);
19142 char * main_buffer;
19143 char save_main_buffer[1000];
19144 pthread_t subthread;
19145 pthread_attr_t attr;
19147 main_buffer = nl_langinfo_l(CODESET, newlocale(LC_ALL_MASK, "C", 0));
19149 /* If too large for our generous allowance, just assume we don't have
19151 if (strlen(main_buffer) >= sizeof(save_main_buffer)) {
19155 strcpy(save_main_buffer, main_buffer);
19157 if (pthread_attr_init(&attr) != 0) {
19161 if (pthread_create(&subthread, &attr, thread_start, NULL) != 0) {
19165 if (pthread_join(subthread, NULL) != 0) {
19169 exit(! (strcmp(main_buffer, save_main_buffer) == 0));
19172 case "$usethreads" in
19175 if eval $compile; then
19176 echo "Your system has nl_langinfo_l()..." >&4
19177 if $run ./try; then
19178 echo "and it is thread-safe (just as I'd hoped)." >&4
19179 d_thread_safe_nl_langinfo_l="$define"
19180 echo "$d_thread_safe_nl_langinfo_l" >&4
19182 echo "but it isn't thread-safe, so we won't use it." >&4
19185 echo "your system does not have nl_langinfo_l()" >&4
19188 *) echo "Since threads aren't selected, we won't bother looking for nl_langinfo_l()" >&4
19190 if test X"$d_thread_safe_nl_langinfo_l" = X; then
19191 d_thread_safe_nl_langinfo_l="$undef"
19195 : see if time exists
19197 if test "X$d_time" = X -o X"$timetype" = X; then
19198 if set time val -f d_time; eval $csym; $val; then
19199 echo 'time() found.' >&4
19201 rp="What is the type returned by time() on this system?"
19202 set time_t timetype long stdio.h sys/types.h
19205 echo 'time() not found, hope that will do.' >&4
19213 : see if timegm exists
19214 set timegm d_timegm
19217 : see if this is a sys/times.h system
19218 set sys/times.h i_systimes
19221 : see if times exists
19223 if set times val -f d_times; eval $csym; $val; then
19224 echo 'times() found.' >&4
19227 case "$i_systimes" in
19228 "$define") inc='sys/times.h';;
19230 rp="What is the type returned by times() on this system?"
19231 set clock_t clocktype long stdio.h sys/types.h $inc
19234 echo 'times() NOT found, hope that will do.' >&4
19239 : see if tmpnam_r exists
19240 set tmpnam_r d_tmpnam_r
19242 case "$d_tmpnam_r" in
19244 hdrs="$i_systypes sys/types.h define stdio.h "
19245 case "$d_tmpnam_r_proto:$usethreads" in
19246 ":define") d_tmpnam_r_proto=define
19247 set d_tmpnam_r_proto tmpnam_r $hdrs
19251 case "$d_tmpnam_r_proto" in
19253 case "$tmpnam_r_proto" in
19254 ''|0) try='char* tmpnam_r(char*);'
19255 ./protochk "$extern_C $try" $hdrs && tmpnam_r_proto=B_B ;;
19257 case "$tmpnam_r_proto" in
19258 ''|0) d_tmpnam_r=undef
19260 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
19261 * ) case "$tmpnam_r_proto" in
19262 REENTRANT_PROTO*) ;;
19263 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
19265 echo "Prototype: $try" ;;
19268 *) case "$usethreads" in
19269 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
19276 *) tmpnam_r_proto=0
19280 : see if trunc exists
19284 : see if truncate exists
19285 set truncate d_truncate
19288 : see if ttyname_r exists
19289 set ttyname_r d_ttyname_r
19291 case "$d_ttyname_r" in
19293 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
19294 case "$d_ttyname_r_proto:$usethreads" in
19295 ":define") d_ttyname_r_proto=define
19296 set d_ttyname_r_proto ttyname_r $hdrs
19300 case "$d_ttyname_r_proto" in
19302 case "$ttyname_r_proto" in
19303 ''|0) try='int ttyname_r(int, char*, size_t);'
19304 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBW ;;
19306 case "$ttyname_r_proto" in
19307 ''|0) try='int ttyname_r(int, char*, int);'
19308 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBI ;;
19310 case "$ttyname_r_proto" in
19311 ''|0) try='char* ttyname_r(int, char*, int);'
19312 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=B_IBI ;;
19314 case "$ttyname_r_proto" in
19315 ''|0) d_ttyname_r=undef
19317 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
19318 * ) case "$ttyname_r_proto" in
19319 REENTRANT_PROTO*) ;;
19320 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
19322 echo "Prototype: $try" ;;
19325 *) case "$usethreads" in
19326 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
19333 *) ttyname_r_proto=0
19337 : see if tzname[] exists
19339 if set tzname val -a d_tzname; eval $csym; $val; then
19341 echo 'tzname[] found.' >&4
19344 echo 'tzname[] NOT found.' >&4
19349 : Check if is a multiplatform env
19351 darwin) multiarch="$define" ;;
19353 case "$multiarch" in
19354 ''|[nN]*) multiarch="$undef" ;;
19357 : check for ordering of bytes in a UV
19359 case "$multiarch" in
19362 You seem to be doing a multiarchitecture build,
19363 skipping the byteorder check.
19369 case "$byteorder" in
19372 In the following, larger digits indicate more significance. A big-endian
19373 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
19374 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
19375 machines may have weird orders like 3412. A Cray will report 87654321,
19376 an Alpha will report 12345678. If the test program works the default is
19378 I'm now running the test program...
19382 #$i_stdlib I_STDLIB
19384 #include <stdlib.h>
19386 #include <sys/types.h>
19387 typedef $uvtype UV;
19397 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
19399 u.l = (UV)0x04030201;
19400 for (i = 0; i < $uvsize; i++)
19401 printf("%c", u.c[i]+'0');
19408 if eval $compile && $run ./try > /dev/null; then
19411 [1-4][1-4][1-4][1-4]|12345678|87654321)
19412 echo "(The test program ran ok.)"
19413 echo "byteorder=$dflt"
19416 ????|????????) echo "(The test program ran ok.)" ;;
19417 *) echo "(The test program didn't run right for some reason.)" ;;
19422 (I can't seem to compile the test program. Guessing big-endian...)
19425 case "$xxx_prompt" in
19427 rp="What is the order of bytes in $uvtype?"
19440 : Checking 32bit alignedness
19443 Checking to see whether you can access character data unalignedly...
19445 case "$d_u32align" in
19446 '') $cat >try.c <<EOCP
19448 #$i_stdlib I_STDLIB
19450 #include <stdlib.h>
19452 #define U32 $u32type
19453 #define BYTEORDER 0x$byteorder
19455 #include <signal.h>
19457 $signal_t bletch(int s) { exit(4); }
19460 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
19461 volatile U8 buf[8];
19465 if (sizeof(U32) != 4) {
19466 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
19473 signal(SIGBUS, bletch);
19485 for (i = 0; i < 4; i++) {
19486 up = (U32*)(buf + i);
19487 if (! ((*up == 1 << (8*i)) || /* big-endian */
19488 (*up == 1 << (8*(3-i))) /* little-endian */
19492 printf("read failed (%x)\n", *up);
19498 for (i = 0; i < 4; i++) {
19499 up = (U32*)(buf + i);
19501 if (*up != 0xBeef) {
19502 printf("write failed (%x)\n", *up);
19516 if eval $compile_ok; then
19517 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
19518 $run ./try 2>&1 >/dev/null
19521 You can access character data pretty unalignedly.
19523 d_u32align="$undef"
19526 It seems that you must access character data in an aligned manner.
19528 d_u32align="$define"
19532 rp='Can you access character data at unaligned addresses?'
19536 [yY]*) d_u32align="$undef" ;;
19537 *) d_u32align="$define" ;;
19544 : see if ualarm exists
19545 set ualarm d_ualarm
19548 : see if umask exists
19552 : see if unordered exists
19553 set unordered d_unordered
19556 : see if unsetenv exists
19557 set unsetenv d_unsetenv
19560 : see if usleep exists
19561 set usleep d_usleep
19564 : see if prototype for usleep is available
19566 set d_usleepproto usleep $i_unistd unistd.h
19569 : see if ustat exists
19573 : see if closedir exists
19574 set closedir d_closedir
19577 case "$d_closedir" in
19580 echo "Checking whether closedir() returns a status..." >&4
19582 #$i_dirent I_DIRENT /**/
19583 #$i_sysdir I_SYS_DIR /**/
19584 #$i_sysndir I_SYS_NDIR /**/
19585 #$i_systypes I_SYS_TYPES /**/
19587 #if defined(I_SYS_TYPES)
19588 #include <sys/types.h>
19590 #if defined(I_DIRENT)
19591 #include <dirent.h>
19594 #include <sys/ndir.h>
19597 #include <sys/dir.h>
19601 int main() { return closedir(opendir(".")); }
19604 if eval $compile_ok; then
19605 if $run ./try > /dev/null 2>&1 ; then
19606 echo "Yes, it does."
19609 echo "No, it doesn't."
19613 echo "(I can't seem to compile the test program--assuming it doesn't)"
19621 set d_void_closedir
19625 : see if there is a wait4
19629 : see if waitpid exists
19630 set waitpid d_waitpid
19635 $cat >try.c <<'EOCP'
19641 return (wcscmp (s, s) ? 1 : 0);
19646 if eval $compile; then
19649 0) echo "A working wcscmp() found." >&4
19651 *) echo "wcscmp() found, but it doesn't work" >&4
19655 echo "wcscmp() NOT found." >&4
19661 : see if wcstombs exists
19662 set wcstombs d_wcstombs
19667 $cat >try.c <<'EOCP'
19672 wchar_t dst[4], *src = L" ";
19674 return (wcsxfrm (dst, src, 1) ? errno ? errno : 0 : 1);
19679 if eval $compile; then
19682 0) echo "A working wcsxfrm() found." >&4
19684 *) echo "wcsxfrm() found, but it doesn't work" >&4
19688 echo "wcsxfrm() NOT found." >&4
19694 : see if wctomb exists
19695 set wctomb d_wctomb
19698 : see if writev exists
19699 set writev d_writev
19702 : check for alignment requirements
19704 case "$alignbytes" in
19705 '') echo "Checking alignment constraints..." >&4
19714 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
19719 if eval $compile_ok; then
19723 echo "(I can't seem to compile the test program...)"
19725 case "$multiarch" in
19727 : The usual safe value is 8, but Darwin with -Duselongdouble
19728 : needs 16. Hence, we will take 8 as a minimum, but allow
19729 : Configure to pick a larger value if needed.
19730 if $test "$dflt" -lt 8; then
19732 echo "Setting alignment to 8 for multiarch support.">&4
19737 *) dflt="$alignbytes"
19740 rp="Doubles must be aligned on a how-many-byte boundary?"
19745 : set the base revision
19748 : length of character in bytes. Is always 1, otherwise it is not C
19749 : This used to be a test using sizeof
19752 : Check for the number of bits in a character
19753 case "$charbits" in
19754 '') echo "Checking how long a character is (in bits)..." >&4
19761 for (c = 1, n = 0; c; c <<= 1, n++) ;
19762 printf ("%d\n", n);
19767 if eval $compile_ok; then
19771 echo "(I can't seem to compile the test program. Guessing...)"
19778 rp="What is the length of a character (in bits)?"
19782 case "$charbits" in
19785 Your system has an unsigned character size of $charbits bits, which
19786 is rather unusual (normally it is 8 bits). Perl likely will not work
19787 correctly on your system, with subtle bugs in various places.
19789 rp='Do you really want to continue?'
19793 [yY]) echo >&4 "Okay, continuing." ;;
19798 : how do we concatenate cpp tokens here?
19800 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
19801 $cat >cpp_stuff.c <<'EOCP'
19802 #define RCAT(a,b)a/**/b
19803 #define ACAT(a,b)a ## b
19807 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
19808 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
19809 echo "Oh! Smells like ANSI's been here." >&4
19810 echo "We can catify or stringify, separately or together!"
19812 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
19813 echo "Ah, yes! The good old days!" >&4
19814 echo "However, in the good old days we don't know how to stringify and"
19815 echo "catify at the same time."
19819 Hmm, I don't seem to be able to concatenate tokens with your cpp.
19820 You're going to have to edit the values of CAT[2-5] in config.h...
19822 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
19826 : see if this is a db.h system
19832 : Check db version.
19834 echo "Checking Berkeley DB version ..." >&4
19840 #include <sys/types.h>
19842 #$i_stdlib I_STDLIB
19844 #include <stdlib.h>
19847 int main(int argc, char *argv[])
19849 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
19850 int Major, Minor, Patch ;
19851 unsigned long Version ;
19852 (void)db_version(&Major, &Minor, &Patch) ;
19854 printf("%d %d %d %d %d %d\n",
19855 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
19856 Major, Minor, Patch);
19859 printf("You have Berkeley DB Version 2 or greater.\n");
19861 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
19862 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
19863 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
19864 Major, Minor, Patch) ;
19866 /* check that db.h & libdb are compatible */
19867 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
19868 printf("db.h and libdb are incompatible.\n") ;
19872 printf("db.h and libdb are compatible.\n") ;
19874 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
19875 + DB_VERSION_PATCH ;
19877 /* needs to be >= 2.3.4 */
19878 if (Version < 2003004) {
19879 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
19880 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
19886 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
19891 printf("You have Berkeley DB Version 1.\n");
19892 exit(0); /* DB version < 2: the coast is clear. */
19894 exit(1); /* <db.h> not Berkeley DB? */
19900 if eval $compile_ok && $run ./try; then
19901 echo 'Looks OK.' >&4
19903 db_version_major=$1
19904 db_version_minor=$2
19905 db_version_patch=$3
19907 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
19911 : Remove db from list of libraries to use
19912 echo "Removing unusable -ldb from library list" >&4
19913 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
19916 echo "libs = $libs" >&4
19926 : Check the return type needed for hash
19928 echo "Checking return type needed for hash for Berkeley DB ..." >&4
19934 #include <sys/types.h>
19937 #ifndef DB_VERSION_MAJOR
19938 u_int32_t hash_cb (const void* ptr, size_t size)
19944 info.hash = hash_cb;
19948 if $cc $ccflags -c try.c >try.out 2>&1 ; then
19949 if $contains warning try.out >>/dev/null 2>&1 ; then
19952 db_hashtype='u_int32_t'
19955 : XXX Maybe we should just give up here.
19956 db_hashtype=u_int32_t
19958 echo "Help: I can't seem to compile the db test program." >&4
19959 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
19962 echo "Your version of Berkeley DB uses $db_hashtype for hash."
19964 *) db_hashtype=u_int32_t
19969 : Check the return type needed for prefix
19971 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
19977 #include <sys/types.h>
19980 #ifndef DB_VERSION_MAJOR
19981 size_t prefix_cb (const DBT *key1, const DBT *key2)
19987 info.prefix = prefix_cb;
19991 if $cc $ccflags -c try.c >try.out 2>&1 ; then
19992 if $contains warning try.out >>/dev/null 2>&1 ; then
19993 db_prefixtype='int'
19995 db_prefixtype='size_t'
19998 db_prefixtype='size_t'
19999 : XXX Maybe we should just give up here.
20001 echo "Help: I can't seem to compile the db test program." >&4
20002 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
20005 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
20007 *) db_prefixtype='size_t'
20011 : Include . in @INC
20014 Historically Perl has provided a final fallback of the current working
20015 directory '.' when searching for a library. This, however, can lead to
20016 problems when a Perl program which loads optional modules is called from
20017 a shared directory. This can lead to executing unexpected code.
20021 # When changing to exclude by default:
20022 case "$default_inc_excludes_dot" in
20023 $undef|false|[nN]*) dflt="n" ;;
20026 # To turn exclude off by default:
20027 #case "$default_inc_excludes_dot" in
20028 # $define|true|[yY]*) dflt="y" ;;
20032 rp='Exclude '.' from @INC by default? '
20035 [nN]|undef) default_inc_excludes_dot="$undef" ;;
20036 *) default_inc_excludes_dot="$define" ;;
20039 : Check what kind of inf/nan your system has
20040 $echo "Checking the kind of infinities and nans you have..." >&4
20041 $echo "(The following tests may crash. That's okay.)" >&4
20043 #define DOUBLESIZE $doublesize
20044 #$d_longdbl HAS_LONG_DOUBLE
20045 #ifdef HAS_LONG_DOUBLE
20046 #define LONG_DOUBLESIZE $longdblsize
20047 #define LONG_DOUBLEKIND $longdblkind
20050 #include <string.h>
20052 /* Note that whether the sign bit is on or off
20053 * for NaN depends on the CPU/FPU, and possibly
20054 * can be affected by the build toolchain.
20056 * For example for older MIPS and HP-PA 2.0 the quiet NaN is:
20057 * 0x7f, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
20058 * 0x7f, 0xf4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
20059 * (respectively) as opposed to the more usual
20060 * 0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
20062 * Pre-IEEE-754 floating point format do not even have inf/nan support
20063 * at all. They might have a "max" value (DBL_MAX), which may be deadly
20064 * to even mention, causing immediate SIGFPE or equivalent: this is
20065 * the case with VAX floating point, for example.
20067 static void bytes(void *v, unsigned int n) {
20068 unsigned char *p = (unsigned char *)v;
20070 for (i = 0; i < n; i++) {
20071 printf("0x%02x%s", p[i], i < n - 1 ? ", " : "\n");
20074 int main(int argc, char *argv[]) {
20075 /* We cannot use 1.0/0.0 and 0.0/0.0 (with L suffixes for long double)
20076 * because some compilers are 'smart' and not only warn but refuse to
20077 * compile such 'illegal' values. */
20078 double dinf = exp(1e9);
20079 double dnan = sqrt(-1.0);
20080 #ifdef HAS_LONG_DOUBLE
20081 long double ldinf = (long double)exp(1e9);
20082 long double ldnan = (long double)sqrt(-1.0);
20083 # if LONG_DOUBLEKIND == 3 || LONG_DOUBLEKIND == 4
20084 /* the 80-bit long doubles might have garbage in their excess bytes */
20085 memset((char *)&ldinf + 10, '\0', LONG_DOUBLESIZE - 10);
20086 memset((char *)&ldnan + 10, '\0', LONG_DOUBLESIZE - 10);
20089 switch (argv[1][0]) {
20090 case '1': bytes(&dinf, sizeof(dinf)); break;
20091 case '2': bytes(&dnan, sizeof(dnan)); break;
20092 case '3': bytes(&ldinf, sizeof(ldinf)); break;
20093 case '4': bytes(&ldnan, sizeof(ldnan)); break;
20101 if eval $compile; then
20102 doubleinfbytes=`$run ./try 1`
20103 doublenanbytes=`$run ./try 2`
20104 case "$d_longdbl" in
20106 longdblinfbytes=`$run ./try 3`
20107 longdblnanbytes=`$run ./try 4`
20111 # Defaults in case the above test program failed.
20112 case "$doublekind" in
20113 1) # IEEE 754 32-bit LE
20114 doubleinfbytes='0x00, 0x00, 0xf0, 0x7f'
20115 doublenanbytes='0x00, 0x00, 0xf8, 0x7f'
20117 2) # IEEE 754 32-bit BE
20118 doubleinfbytes='0x7f, 0xf0, 0x00, 0x00'
20119 doublenanbytes='0x7f, 0xf8, 0x00, 0x00'
20121 3) # IEEE 754 64-bit LE
20122 doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
20123 doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
20125 4) # IEEE 754 64-bit BE
20126 doubleinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20127 doublenanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20129 5) # IEEE 754 128-bit LE
20130 doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
20131 doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
20133 6) # IEEE 754 128-bit BE
20134 doubleinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20135 doublenanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20137 7) # IEEE 754 64-bit mixed: 32-bit LEs in BE
20138 doubleinfbytes='0x00, 0x00, 0xf0, 0x7f, 0x00, 0x00, 0x00, 0x00'
20139 doublenanbytes='0x00, 0x00, 0xf8, 0x7f, 0x00, 0x00, 0x00, 0x00'
20141 8) # IEEE 754 64-bit mixed: 32-bit BEs in LE
20142 doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x7f, 0xf0, 0x00, 0x00'
20143 doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x7f, 0xf8, 0x00, 0x00'
20145 9|10|11|12|13|14) # VAX/Cray/IBM floating point formats, no inf/nan.
20146 doubleinfbytes=$undef
20147 doublenanbytes=$undef
20150 doubleinfbytes=$undef
20151 doublenanbytes=$undef
20154 case "$longdblkind" in
20155 1) # IEEE 754 128-bit LE
20156 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f'
20157 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f'
20159 2) # IEEE 754 128-bit BE
20160 longdblinfbytes='0x7f, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20161 longdblnanbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20163 3) # IEEE 754 80-bit LE, 12 or 16 bytes (x86)
20164 case "$longdblsize" in
20165 12) # x86 32-bit (96 bits, or 4 x 32, or 12 x 8)
20166 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00'
20167 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x7f, 0x00, 0x00'
20170 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20171 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20174 longdblinfbytes=$undef
20175 longdblnanbytes=$undef
20179 4) # IEEE 754 80-bit BE, 12 or 16 bytes
20180 case "$longdblsize" in
20181 12) # 32-bit system
20182 longdblinfbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20183 longdblnanbytes='0x7f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20185 16) # 64-bit system
20186 longdblinfbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20187 longdblnanbytes='0x7f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20190 longdblinfbytes=$undef
20191 longdblnanbytes=$undef
20195 5) # 128-bit LE-LE "double double"
20196 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
20197 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
20199 6) # 128-bit BE-BE "double double"
20200 longdblinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20201 longdblnanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20203 7) # 128-bit LE-BE "double double"
20204 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20205 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20207 8) # 128-bit BE-LE "double double"
20208 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20209 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20211 9|10|11|12|13|14) # VAX/Cray/IBM floating point formats, no inf/nan.
20212 longdblinfbytes=$undef
20213 longdblnanbytes=$undef
20216 longdblinfbytes=$undef
20217 longdblnanbytes=$undef
20221 # In case the program crashed the values are empty, turn them undef.
20222 case "$doubleinfbytes" in
20223 '') doubleinfbytes=$undef ;;
20225 case "$doublenanbytes" in
20226 '') doublenanbytes=$undef ;;
20228 case "$longdblinfbytes" in
20229 '') longdblinfbytes=$undef ;;
20231 case "$longdblnanbytes" in
20232 '') longdblnanbytes=$undef ;;
20236 : Check the length of the double mantissa
20237 $echo "Checking how many mantissa bits your doubles have..." >&4
20239 #$i_sunmath I_SUNMATH
20242 # include <sunmath.h>
20244 #ifdef DBL_MANT_DIG
20245 # define BITS (DBL_MANT_DIG - 1) /* the implicit bit does not count */
20248 int main(int argc, char *argv[]) {
20250 printf("%d\n", BITS);
20256 if eval $compile; then
20257 doublemantbits=`$run ./try`
20259 doublemantbits="$undef"
20263 : Check the length of the longdouble mantissa
20264 $echo "Checking how many mantissa bits your long doubles have..." >&4
20266 #$i_sunmath I_SUNMATH
20269 # include <sunmath.h>
20271 #$d_longdbl HAS_LONG_DOUBLE
20272 #if defined(HAS_LONG_DOUBLE) && defined(LDBL_MANT_DIG)
20273 # if ($longdblkind == 3) || ($longdblkind == 4) /* 80-bit extended precision */
20274 /* This format has no implicit bit. Beware, however, that for
20275 * this format the bare LDBL_MANT_DIG is misleading for inf/nan:
20276 * the top three bits are used for inf (100) / qnan (11x) / snan (101),
20277 * and the top bit must have been one since 387, zero is plain invalid.
20278 * For normal fp values, the LDBL_MANT_DIG is fine, though. */
20279 # define BITS LDBL_MANT_DIG
20280 # elif ($longdblkind == 5 || $longdblkind == 6 || $longdblkind == 7 || $longdblkind == 8) /* double double */
20281 /* LDBL_MANT_DIG of 106 (twice 53) would be logical, but for some
20282 * reason e.g. Irix thinks 107. But in any case, we want only
20283 * the number of real bits, the implicit bits are of no interest. */
20284 # define BITS 2 * (DBL_MANT_DIG - 1)
20286 # define BITS (LDBL_MANT_DIG - 1) /* the implicit bit does not count */
20290 int main(int argc, char *argv[]) {
20292 printf("%d\n", BITS);
20298 if eval $compile; then
20299 longdblmantbits=`$run ./try`
20301 longdblmantbits="$undef"
20305 : Check the length of the NV mantissa
20306 $echo "Checking how many mantissa bits your NVs have..." >&4
20307 if test "X$usequadmath" = "X$define"; then
20308 nvmantbits=112 # 128-1-15
20310 if test "X$nvsize" = "X$doublesize"; then
20311 nvmantbits="$doublemantbits"
20313 if test "X$nvsize" = "X$longdblsize"; then
20314 nvmantbits="$longdblmantbits"
20316 nvmantbits="$undef"
20321 : How can we generate normalized random numbers ?
20323 echo "Using our internal random number implementation..." >&4
20326 *-Dmy_rand=*|*-Dmy_srand=*)
20327 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
20328 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
20329 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
20330 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
20334 randfunc=Perl_drand48
20335 drand01="Perl_drand48()"
20336 seedfunc="Perl_drand48_init"
20340 : Probe whether dtrace builds an object, as newer Illumos requires an input
20341 : object file that uses at least one of the probes defined in the .d file
20342 case "$usedtrace" in
20344 case "$dtracexnolibs" in
20345 $define|true|[yY]*)
20346 dtracexnolibs=$define
20347 $dtrace -h -xnolibs -s ../perldtrace.d -o perldtrace.h
20350 if $dtrace -h -xnolibs -s ../perldtrace.d -o perldtrace.h 2>&1 ; then
20351 dtracexnolibs=$define
20352 echo "Your dtrace accepts -xnolibs"
20353 elif $dtrace -h -s ../perldtrace.d -o perldtrace.h 2>&1 ; then
20354 dtracexnolibs=$undef
20355 echo "Your dtrace doesn't accept -xnolibs"
20357 echo "Your dtrace doesn't work at all, try building without dtrace support" >&4
20362 dtracexnolibs=$undef
20363 $dtrace -h -s ../perldtrace.d -o perldtrace.h
20366 case $dtracexnolibs in
20367 $define) xnolibs=-xnolibs ;;
20371 case "$dtraceobject" in
20372 $define|true|[yY]*)
20373 dtraceobject=$define
20377 #include "perldtrace.h"
20379 PERL_LOADED_FILE("dummy");
20383 dtraceobject=$undef
20384 if $cc -c -o try.o $optimize $ccflags try.c \
20385 && $dtrace -G $xnolibs -s ../perldtrace.d try.o >/dev/null 2>&1; then
20386 dtraceobject=$define
20387 echo "Your dtrace builds an object file"
20390 *) dtraceobject=$undef ;;
20392 $rm_try perldtrace.o perldtrace.h
20395 : Determine if this is an EBCDIC system
20397 echo "Determining whether or not we are on an EBCDIC system..." >&4
20398 $cat >try.c <<'EOM'
20401 if ('M'==0xd4) return 0;
20408 if eval $compile_ok; then
20409 if $run ./try; then
20410 echo "You seem to speak EBCDIC." >&4
20413 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
20416 echo "I'm unable to compile the test program." >&4
20417 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
20423 : Check how to flush
20426 Checking how to flush all pending stdio output...
20428 # I only know how to find the first 32 possibly open files on SunOS.
20429 # See also hints/sunos_4_1.sh and util.c --AD
20431 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
20433 $cat >>try.c <<EOCP
20435 #$i_stdlib I_STDLIB
20437 #include <stdlib.h>
20439 #$i_unistd I_UNISTD
20441 # include <unistd.h>
20443 #$d_sysconf HAS_SYSCONF
20444 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
20445 #ifdef HAS_STDIO_STREAM_ARRAY
20446 # define STDIO_STREAM_ARRAY $stdio_stream_array
20451 p = fopen("try.out", "w");
20455 # ifdef TRY_FPRINTF
20459 #ifdef TRY_FFLUSH_NULL
20462 #ifdef TRY_FFLUSH_ALL
20464 long open_max = -1;
20465 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
20466 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
20468 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
20469 open_max = sysconf(_SC_OPEN_MAX);
20472 open_max = FOPEN_MAX;
20475 open_max = OPEN_MAX;
20484 # ifdef HAS_STDIO_STREAM_ARRAY
20485 if (open_max > 0) {
20487 for (i = 0; i < open_max; i++)
20488 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
20489 STDIO_STREAM_ARRAY[i]._file < open_max &&
20490 STDIO_STREAM_ARRAY[i]._flag)
20491 fflush(&STDIO_STREAM_ARRAY[i]);
20499 : first we have to find out how _not_ to flush
20501 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
20503 set try -DTRY_FPUTC
20504 if eval $compile; then
20505 $run ./try 2>/dev/null
20508 if $test ! -s try.out -a "X$code" = X42; then
20514 set try -DTRY_FPRINTF
20515 if eval $compile; then
20516 $run ./try 2>/dev/null
20519 if $test ! -s try.out -a "X$code" = X42; then
20520 output=-DTRY_FPRINTF
20526 : check for fflush NULL behavior
20527 case "$fflushNULL" in
20528 '') set try -DTRY_FFLUSH_NULL $output
20529 if eval $compile; then
20530 $run ./try 2>/dev/null
20533 if $test -s try.out -a "X$code" = X42; then
20534 fflushNULL="`$cat try.out`"
20536 if $test "X$code" != X42; then
20538 (If this test failed, don't worry, we'll try another method shortly.)
20543 $rm -f core try.core core.try.*
20544 case "$fflushNULL" in
20546 Your fflush(NULL) works okay for output streams.
20547 Let's see if it clobbers input pipes...
20549 # As of mid-March 2000 all versions of Solaris appear to have a stdio
20550 # bug that improperly flushes the input end of pipes. So we avoid the
20551 # autoflush on fork/system/exec support for now. :-(
20552 $cat >tryp.c <<EOCP
20555 main(int argc, char **argv)
20561 while ((i = getc(stdin)) != -1
20562 && (*bp++ = i) != '\n'
20563 && bp < &buf[1024])
20566 fprintf(stdout, "%s", buf);
20574 fflushNULL="$define"
20576 if eval $compile; then
20578 # Copy the .c file to the remote host ($to is an ssh-alike if targethost is set)
20579 if $test "X$targethost" != X; then
20582 $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
20584 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
20586 if cmp tryp.c tryp.out >/dev/null 2>&1; then
20588 fflush(NULL) seems to behave okay with input streams.
20590 fflushNULL="$define"
20593 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
20595 fflushNULL="$undef"
20598 $rm -f core tryp.c tryp.core core.tryp.*
20601 Your fflush(NULL) isn't working (contrary to ANSI C).
20603 fflushNULL="$undef"
20606 Cannot figure out whether your fflush(NULL) works or not.
20607 I'm assuming it doesn't (contrary to ANSI C).
20609 fflushNULL="$undef"
20613 $define|true|[yY]*)
20614 fflushNULL="$define"
20617 fflushNULL="$undef"
20620 : check explicit looping only if NULL did not work, and if the pipe
20621 : bug does not show up on an explicit flush too
20622 case "$fflushNULL" in
20624 $cat >tryp.c <<EOCP
20627 main(int argc, char **argv)
20633 while ((i = getc(stdin)) != -1
20634 && (*bp++ = i) != '\n'
20635 && bp < &buf[1024])
20638 fprintf(stdout, "%s", buf);
20647 if eval $compile; then
20649 if $test "X$targethost" != X; then
20652 $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
20654 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
20656 if cmp tryp.c tryp.out >/dev/null 2>&1; then
20658 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
20660 : now check for fflushall behaviour
20661 case "$fflushall" in
20662 '') set try -DTRY_FFLUSH_ALL $output
20663 if eval $compile; then
20665 (Now testing the other method--but note that this also may fail.)
20667 $run ./try 2>/dev/null
20670 if $test -s try.out -a "X$code" = X42; then
20671 fflushall="`$cat try.out`"
20675 case "$fflushall" in
20677 Whew. Flushing explicitly all the stdio streams works.
20679 fflushall="$define"
20682 Sigh. Flushing explicitly all the stdio streams doesn't work.
20687 Cannot figure out whether flushing stdio streams explicitly works or not.
20688 I'm assuming it doesn't.
20694 "$define"|true|[yY]*)
20695 fflushall="$define"
20703 All is futile. Even fflush(stdin) clobbers input pipes!
20710 $rm -f core tryp.c tryp.core core.tryp.*
20712 *) fflushall="$undef"
20716 case "$fflushNULL$fflushall" in
20719 OK, I give up. I cannot figure out how to flush pending stdio output.
20720 We won't be flushing handles at all before fork/exec/popen.
20726 : Store the full pathname to the ar program for use in the C program
20727 : Respect a hint or command line value for full_ar.
20732 : Store the full pathname to the sed program for use in the C program
20735 : see what type gids are declared as in the kernel
20737 echo "Looking for the type for group ids returned by getgid()."
20738 set gid_t gidtype xxx stdio.h sys/types.h
20742 xxx=`./findhdr sys/user.h`
20743 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
20745 unsigned) dflt="$1 $2" ;;
20749 *) dflt="$gidtype";;
20752 gid_t) echo "gid_t found." ;;
20753 *) rp="What is the type for group ids returned by getgid()?"
20759 : Check the size of GID
20762 *_t) zzz="$gidtype" ;;
20765 echo "Checking the size of $zzz..." >&4
20767 #include <sys/types.h>
20769 #$i_stdlib I_STDLIB
20771 #include <stdlib.h>
20774 printf("%d\n", (int)sizeof($gidtype));
20779 if eval $compile_ok; then
20783 echo "(I can't execute the test program--guessing $gidsize.)" >&4
20786 echo "Your $zzz is $gidsize bytes long."
20791 echo "(I can't compile the test program--guessing $gidsize.)" >&4
20795 : Check if GID is signed
20798 *_t) zzz="$gidtype" ;;
20801 echo "Checking the sign of $zzz..." >&4
20803 #include <sys/types.h>
20814 if eval $compile; then
20818 echo "(I can't execute the test program--guessing unsigned.)" >&4
20822 1) echo "Your $zzz is unsigned." ;;
20823 -1) echo "Your $zzz is signed." ;;
20829 echo "(I can't compile the test program--guessing unsigned.)" >&4
20833 : Check 64bit sizes
20836 if $test X"$quadtype" != X; then
20838 echo "Checking how to print 64-bit integers..." >&4
20840 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
20841 $cat >try.c <<'EOCP'
20842 #include <sys/types.h>
20845 int q = 12345678901;
20846 printf("%ld\n", q);
20850 if eval $compile; then
20854 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
20855 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
20856 echo "We will use %d."
20862 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
20863 $cat >try.c <<'EOCP'
20864 #include <sys/types.h>
20867 long q = 12345678901;
20868 printf("%ld\n", q);
20872 if eval $compile; then
20876 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
20877 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
20878 echo "We will use %ld."
20884 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
20885 $cat >try.c <<'EOCP'
20886 #include <sys/types.h>
20887 #include <inttypes.h>
20890 int64_t q = 12345678901;
20891 printf("%" PRId64 "\n", q);
20895 if eval $compile; then
20899 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
20900 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
20901 echo "We will use the C9X style."
20907 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
20909 #include <sys/types.h>
20912 $quadtype q = 12345678901;
20913 printf("%Ld\n", q);
20917 if eval $compile; then
20921 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
20922 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
20923 echo "We will use %Ld."
20929 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
20930 $cat >try.c <<'EOCP'
20931 #include <sys/types.h>
20934 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
20935 printf("%lld\n", q);
20939 if eval $compile; then
20943 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
20944 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
20945 echo "We will use the %lld style."
20951 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
20953 #include <sys/types.h>
20956 $quadtype q = 12345678901;
20957 printf("%qd\n", q);
20961 if eval $compile; then
20965 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
20966 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
20967 echo "We will use %qd."
20973 if $test X"$sPRId64" = X; then
20974 echo "Cannot figure out how to print 64-bit integers." >&4
20981 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
20982 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
20984 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
20985 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
20989 : Check format strings for internal types
20991 $echo "Checking the format strings to be used for Perl's internal types..." >&4
20993 if $test X"$ivsize" = X8; then
20994 ivdformat="$sPRId64"
20995 uvuformat="$sPRIu64"
20996 uvoformat="$sPRIo64"
20997 uvxformat="$sPRIx64"
20998 uvXUformat="$sPRIXU64"
21000 if $test X"$ivsize" = X"$longsize"; then
21007 if $test X"$ivsize" = X"$intsize"; then
21015 if $test X"$ivsize" = X"$shortsize"; then
21026 if $test X"$usequadmath" = X"$define"; then
21034 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
21035 nveformat="$sPRIeldbl"
21036 nvfformat="$sPRIfldbl"
21037 nvgformat="$sPRIgldbl"
21038 nvEUformat="$sPRIEUldbl"
21039 nvFUformat="$sPRIFUldbl"
21040 nvGUformat="$sPRIGUldbl"
21051 case "$ivdformat" in
21052 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
21057 : Check format string for GID
21060 $echo "Checking the format string to be used for gids..." >&4
21063 -1) if $test X"$gidsize" = X"$ivsize"; then
21064 gidformat="$ivdformat"
21066 if $test X"$gidsize" = X"$longsize"; then
21069 if $test X"$gidsize" = X"$intsize"; then
21072 if $test X"$gidsize" = X"$shortsize"; then
21079 *) if $test X"$gidsize" = X"$uvsize"; then
21080 gidformat="$uvuformat"
21082 if $test X"$gidsize" = X"$longsize"; then
21085 if $test X"$gidsize" = X"$intsize"; then
21088 if $test X"$gidsize" = X"$shortsize"; then
21097 : see if getgroups exists
21098 set getgroups d_getgrps
21101 : see if setgroups exists
21102 set setgroups d_setgrps
21105 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
21107 case "$d_getgrps$d_setgrps" in
21109 case "$groupstype" in
21110 '') dflt="$gidtype" ;;
21111 *) dflt="$groupstype" ;;
21114 What type of pointer is the second argument to getgroups() and setgroups()?
21115 Usually this is the same as group ids, $gidtype, but not always.
21118 rp='What type pointer is the second argument to getgroups() and setgroups()?'
21122 *) groupstype="$gidtype";;
21125 : check whether make sets MAKE
21127 echo "Checking if your $make program sets \$(MAKE)..." >&4
21128 case "$make_set_make" in
21130 $sed 's/^X //' > testmake.mak << 'EOF'
21132 X @echo 'maketemp="$(MAKE)"'
21134 case "`$make -f testmake.mak 2>/dev/null`" in
21135 *maketemp=*) make_set_make='#' ;;
21136 *) make_set_make="MAKE=$make" ;;
21138 $rm -f testmake.mak
21141 case "$make_set_make" in
21142 '#') echo "Yup, it does.";;
21143 *) echo "Nope, it doesn't.";;
21146 : see what type is used for mode_t
21147 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
21148 set mode_t modetype int stdio.h sys/types.h
21151 : see if we need va_copy
21154 #include <stdarg.h>
21156 #include <stdlib.h>
21157 #include <signal.h>
21160 ivfprintf(FILE *f, const char *fmt, va_list *valp)
21162 return vfprintf(f, fmt, *valp);
21166 myvfprintf(FILE *f, const char *fmt, va_list val)
21168 return ivfprintf(f, fmt, &val);
21172 myprintf(char *fmt, ...)
21175 va_start(val, fmt);
21176 return myvfprintf(stdout, fmt, val);
21180 main(int ac, char **av)
21182 signal(SIGSEGV, exit);
21184 myprintf("%s%cs all right, then\n", "that", '\'');
21189 if eval $compile && $run ./try 2>&1 >/dev/null; then
21190 case "`$run ./try`" in
21191 "that's all right, then")
21197 yes) echo "It seems that you don't need va_copy()." >&4
21198 need_va_copy="$undef"
21200 *) echo "It seems that va_copy() or similar will be needed." >&4
21201 need_va_copy="$define"
21206 : see what type is used for size_t
21207 rp="What is the type used for the length parameter for string functions?"
21208 set size_t sizetype 'unsigned int' stdio.h sys/types.h
21211 : check for type of arguments to gethostbyaddr.
21212 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
21213 case "$d_gethbyaddr" in
21217 Checking to see what type of arguments are accepted by gethostbyaddr().
21219 hdrs="$define sys/types.h
21220 $d_socket sys/socket.h
21221 $i_niin netinet/in.h
21223 $i_unistd unistd.h"
21224 : The first arg can 'char *' or 'void *'
21225 : The second arg is some of integral type
21226 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
21227 for yyy in size_t long int; do
21228 case "$netdb_host_type" in
21229 '') try="$extern_C struct hostent *gethostbyaddr($xxx, $yyy, int);"
21230 if ./protochk "$try" $hdrs; then
21231 echo "Your system accepts $xxx for the first arg."
21232 echo "...and $yyy for the second arg."
21233 netdb_host_type="$xxx"
21234 netdb_hlen_type="$yyy"
21240 : In case none of those worked, prompt the user.
21241 case "$netdb_host_type" in
21242 '') rp='What is the type for the 1st argument to gethostbyaddr?'
21245 netdb_host_type=$ans
21246 rp='What is the type for the 2nd argument to gethostbyaddr?'
21249 netdb_hlen_type=$ans
21253 *) : no gethostbyaddr, so pick harmless defaults
21254 netdb_host_type='char *'
21255 netdb_hlen_type="$sizetype"
21258 # Remove the "const" if needed. -- but then we'll have a
21260 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
21263 : check for type of argument to gethostbyname.
21264 if test "X$netdb_name_type" = X ; then
21265 case "$d_gethbyname" in
21269 Checking to see what type of argument is accepted by gethostbyname().
21271 hdrs="$define sys/types.h
21272 $d_socket sys/socket.h
21273 $i_niin netinet/in.h
21275 $i_unistd unistd.h"
21276 for xxx in "const char *" "char *"; do
21277 case "$netdb_name_type" in
21278 '') try="$extern_C struct hostent *gethostbyname($xxx);"
21279 if ./protochk "$try" $hdrs; then
21280 echo "Your system accepts $xxx."
21281 netdb_name_type="$xxx"
21286 : In case none of those worked, prompt the user.
21287 case "$netdb_name_type" in
21288 '') rp='What is the type for the 1st argument to gethostbyname?'
21291 netdb_name_type=$ans
21295 *) : no gethostbyname, so pick harmless default
21296 netdb_name_type='char *'
21301 : check for type of 1st argument to getnetbyaddr.
21302 if test "X$netdb_net_type" = X ; then
21303 case "$d_getnbyaddr" in
21307 Checking to see what type of 1st argument is accepted by getnetbyaddr().
21309 hdrs="$define sys/types.h
21310 $d_socket sys/socket.h
21311 $i_niin netinet/in.h
21313 $i_unistd unistd.h"
21314 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
21315 case "$netdb_net_type" in
21316 '') try="$extern_C struct netent *getnetbyaddr($xxx, int);"
21317 if ./protochk "$try" $hdrs; then
21318 echo "Your system accepts $xxx."
21319 netdb_net_type="$xxx"
21324 : In case none of those worked, prompt the user.
21325 case "$netdb_net_type" in
21326 '') rp='What is the type for the 1st argument to getnetbyaddr?'
21329 netdb_net_type=$ans
21333 *) : no getnetbyaddr, so pick harmless default
21334 netdb_net_type='long'
21338 : locate the preferred pager for this system
21345 [a-zA-Z]:/*) dflt=$pg;;
21349 [a-zA-Z]:/*) dflt=$more;;
21353 [a-zA-Z]:/*) dflt=$less;;
21356 '') dflt=/usr/ucb/more;;
21364 rp='What pager is used on your system?'
21368 : see if ar generates random libraries by itself
21370 echo "Checking how to generate random libraries on your machine..." >&4
21371 echo 'int bar1() { return bar2(); }' > bar1.c
21372 echo 'int bar2() { return 2; }' > bar2.c
21374 #$i_stdlib I_STDLIB
21376 #include <stdlib.h>
21378 int main() { printf("%d\n", bar1()); exit(0); }
21380 $cc $ccflags -c bar1.c >/dev/null 2>&1
21381 $cc $ccflags -c bar2.c >/dev/null 2>&1
21382 $cc $ccflags -c foo.c >/dev/null 2>&1
21383 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
21384 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
21385 $run ./foobar >/dev/null 2>&1; then
21386 echo "$ar appears to generate random libraries itself."
21388 if [ "X$ranlib" = "X" ]; then
21391 elif $ar s bar$_a >/dev/null 2>&1 &&
21392 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
21393 $run ./foobar >/dev/null 2>&1; then
21394 echo "a table of contents needs to be added with '$ar s'."
21397 elif $ar ts bar$_a >/dev/null 2>&1 &&
21398 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
21399 $run ./foobar >/dev/null 2>&1; then
21400 echo "a table of contents needs to be added with '$ar ts'."
21407 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
21408 $test -f $ranlib || ranlib=''
21411 if $test -n "$ranlib"; then
21412 echo "your system has '$ranlib'; we'll use that."
21415 echo "your system doesn't seem to support random libraries"
21416 echo "so we'll use lorder and tsort to order the libraries."
21423 : Check the max offset that gmtime and localtime accept
21424 echo "Checking max offsets that gmtime () accepts"
21426 case "$sGMTIME_min/$sGMTIME_max" in
21429 #include <sys/types.h>
21437 void gm_check (time_t t, int min_year, int max_year)
21440 if ( tmp == NULL ||
21441 /* Check tm_year overflow */
21442 tmp->tm_year < min_year || tmp->tm_year > max_year)
21453 gm_check (MAXLONG, 69, 0x7fffffff);
21455 if (tmp == NULL || tmp->tm_year < 0) {
21456 for (i = 63; i >= 0; i--) {
21457 time_t x = pt | ((time_t)1 << i);
21458 if (x < 0 || x < pt) continue;
21459 gm_check (x, 69, 0x7fffffff);
21462 printf ("sGMTIME_max=%ld\n", pt);
21471 gm_check (MINLONG, -1900, 70);
21474 for (i = 36; i >= 0; i--) {
21475 time_t x = pt - ((time_t)1 << i);
21476 if (x > 0) continue;
21477 gm_check (x, -1900, 70);
21480 printf ("sGMTIME_min=%ld\n", pt);
21484 int main (int argc, char *argv[])
21486 /* fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t)); */
21493 if eval $compile; then
21494 eval `$run ./try 2>/dev/null`
21496 echo "Cannot determine sGMTIME_max and sGMTIME_min." >&4
21502 echo "Checking max offsets that localtime () accepts"
21504 case "$sLOCALTIME_min/$sLOCALTIME_max" in
21507 #include <sys/types.h>
21515 void local_check (time_t t, int min_year, int max_year)
21517 if (sizeof (time_t) > 4 && t > 0x7ffffffffffff000LL)
21520 tmp = localtime (&t);
21521 if ( tmp == NULL ||
21522 /* Check tm_year overflow */
21523 tmp->tm_year < min_year || tmp->tm_year > max_year)
21527 } /* local_check */
21534 local_check (MAXLONG, 69, 0x7fffffff);
21536 if (tmp == NULL || tmp->tm_year < 0) {
21537 for (i = 63; i >= 0; i--) {
21538 time_t x = pt | ((time_t)1 << i);
21539 if (x < 0 || x < pt) continue;
21540 local_check (x, 69, 0x7fffffff);
21543 printf ("sLOCALTIME_max=%ld\n", pt);
21552 local_check (MINLONG, -1900, 70);
21555 for (i = 36; i >= 0; i--) {
21556 time_t x = pt - ((time_t)1 << i);
21557 if (x > 0) continue;
21558 local_check (x, -1900, 70);
21561 printf ("sLOCALTIME_min=%ld\n", pt);
21565 int main (int argc, char *argv[])
21573 if eval $compile; then
21574 eval `$run ./try 2>/dev/null`
21576 echo "Cannot determine sLOCALTIME_max and sLOCALTIME_min." >&4
21582 : check for type of arguments to select.
21583 case "$selecttype" in
21584 '') case "$d_select" in
21588 Checking to see what type of arguments are accepted by select().
21590 hdrs="$define sys/types.h
21591 $i_systime sys/time.h
21592 $i_sysselct sys/select.h
21593 $d_socket sys/socket.h"
21594 : The first arg can be int, unsigned, or size_t
21595 : The last arg may or may not be 'const'
21597 : void pointer has been seen but using that
21598 : breaks the selectminbits test
21599 for xxx in 'fd_set *' 'int *'; do
21600 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
21601 for tmo in 'struct timeval *' 'const struct timeval *'; do
21603 '') try="$extern_C select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
21604 if ./protochk "$try" $hdrs; then
21605 echo "Your system accepts $xxx."
21614 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
21615 case "$d_fd_set" in
21616 $define) dflt="fd_set *" ;;
21625 *) : no select, so pick a harmless default
21632 : check for the select 'width'
21633 case "$selectminbits" in
21634 '') safebits=`expr $ptrsize \* 8`
21635 case "$d_select" in
21639 Checking to see on how many bits at a time your select() operates...
21642 #include <sys/types.h>
21644 #$i_systime I_SYS_TIME
21645 #$i_systimek I_SYS_TIME_KERNEL
21650 # ifdef I_SYS_TIME_KERNEL
21653 # include <sys/time.h>
21654 # ifdef I_SYS_TIME_KERNEL
21658 #$i_sysselct I_SYS_SELECT
21659 #ifdef I_SYS_SELECT
21660 #include <sys/select.h>
21662 #$d_socket HAS_SOCKET
21664 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
21667 #$i_stdlib I_STDLIB
21669 #include <stdlib.h>
21672 #define S sizeof(*(b))
21674 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
21675 #define NBITS (NBYTES * 8)
21677 char *s = (char *)malloc(NBYTES);
21686 fp = fopen("try.c", "r");
21692 b = ($selecttype)s;
21693 for (i = 0; i < NBITS; i++)
21697 select(fd + 1, b, 0, 0, &t);
21698 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
21700 printf("%d\n", i + 1);
21705 if eval $compile_ok; then
21706 selectminbits=`$run ./try 2>/dev/null`
21707 case "$selectminbits" in
21709 Cannot figure out on how many bits at a time your select() operates.
21710 I'll play safe and guess it is $safebits bits.
21712 selectminbits=$safebits
21713 bits="$safebits bits"
21716 *) bits="$selectminbits bits" ;;
21718 echo "Your select() operates on $bits at a time." >&4
21720 rp='What is the minimum number of bits your select() operates on?'
21721 case "$byteorder" in
21722 12345678) dflt=64 ;;
21728 selectminbits="$val"
21732 *) : no select, so pick a harmless default
21733 selectminbits=$safebits
21739 : Trace out the files included by signal.h, then look for SIGxxx names.
21740 case "$sig_num_init" in
21742 if [ "X$fieldn" = X ]; then
21743 : Just make some guesses. We check them later.
21744 xxx="$sysroot/usr/include/signal.h $sysroot/usr/include/sys/signal.h"
21746 xxx=`echo '#include <signal.h>' |
21747 $cppstdin $cppminus $cppflags 2>/dev/null |
21748 $grep '^[ ]*#.*include' |
21749 $awk "{print \\$$fieldn}" | $sed 's!"!!g' |\
21750 $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
21753 for xx in $xxx /dev/null ; do
21754 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
21756 case "$xxxfiles" in
21757 '') xxxfiles=`./findhdr signal.h` ;;
21760 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
21761 print substr($2, 4, 20)
21763 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
21764 print substr($3, 4, 20)
21766 : Append some common names just in case the awk scan failed.
21767 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
21768 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
21769 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
21770 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
21771 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
21773 : generate a few handy files for later
21774 $cat > signal.c <<EOCP
21775 #include <sys/types.h>
21776 #include <signal.h>
21777 #$i_stdlib I_STDLIB
21779 #include <stdlib.h>
21784 /* Strange style to avoid deeply-nested #if/#else/#endif */
21787 # define NSIG (_NSIG)
21793 # define NSIG (SIGMAX+1)
21799 # define NSIG (SIG_MAX+1)
21805 # define NSIG (_SIG_MAX+1)
21811 # define NSIG (MAXSIG+1)
21817 # define NSIG (MAX_SIG+1)
21822 # ifdef SIGARRAYSIZE
21823 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
21829 # define NSIG (_sys_nsig) /* Solaris 2.5 */
21833 /* Default to some arbitrary number that's big enough to get most
21834 of the common signals.
21840 printf("NSIG %d\n", NSIG);
21846 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
21848 printf "#ifdef SIG"; printf $1; printf "\n"
21849 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
21850 printf $1; printf ");\n"
21854 printf "#endif /* JUST_NSIG */\n";
21855 printf "exit(0);\n}\n";
21858 $cat >signal.awk <<'EOP'
21859 BEGIN { ndups = 0 }
21860 $1 ~ /^NSIG$/ { nsig = $2 }
21861 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
21862 if ($2 > maxsig) { maxsig = $2 }
21863 if (sig_name[$2]) {
21864 dup_name[ndups] = $1
21865 dup_num[ndups] = $2
21877 printf("NSIG %d\n", nsig);
21878 for (n = 1; n < nsig; n++) {
21880 printf("%s %d\n", sig_name[n], sig_num[n])
21883 printf("NUM%d %d\n", n, n)
21886 for (n = 0; n < ndups; n++) {
21887 printf("%s %d\n", dup_name[n], dup_num[n])
21891 $cat >signal_cmd <<EOS
21893 if $test -s signal.lst; then
21894 echo "Using your existing signal.lst file"
21899 $cat >>signal_cmd <<'EOS'
21902 if eval $compile_ok; then
21903 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) |\
21904 $uniq | $awk -f signal.awk >signal.lst
21906 echo "(I can't seem be able to compile the whole test program)" >&4
21907 echo "(I'll try it in little pieces.)" >&4
21908 set signal -DJUST_NSIG
21909 if eval $compile_ok; then
21910 $run ./signal$_exe > signal.nsg
21913 echo "I can't seem to figure out how many signals you have." >&4
21914 echo "Guessing 50." >&4
21915 echo 'NSIG 50' > signal.nsg
21917 : Now look at all the signal names, one at a time.
21918 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
21919 $cat > signal.c <<EOCP
21920 #include <sys/types.h>
21921 #include <signal.h>
21924 printf("$xx %d\n", SIG${xx});
21929 if eval $compile; then
21930 echo "SIG${xx} found."
21931 $run ./signal$_exe >> signal.ls1
21933 echo "SIG${xx} NOT found."
21936 if $test -s signal.ls1; then
21937 $cat signal.nsg signal.ls1 |
21938 $sort -n | $uniq | $awk -f signal.awk >signal.lst
21942 if $test -s signal.lst; then
21945 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
21946 echo 'kill -l' >signal
21947 set X `csh -f <signal`
21951 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
21953 echo $@ | $tr ' ' $trnl | \
21954 $awk '{ printf "%s %d\n", $1, ++s; }
21955 END { printf "NSIG %d\n", ++s }' >signal.lst
21957 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
21959 chmod a+x signal_cmd
21960 $eunicefix signal_cmd
21964 : generate list of signal names
21965 case "$sig_num_init" in
21968 case "$sig_name_init" in
21970 *) case "$sig_num_init" in
21971 ''|*,*) doinit=yes ;;
21976 echo "Generating a list of signal names and numbers..." >&4
21978 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
21979 sig_name=`$awk 'BEGIN { printf "ZERO " }
21980 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
21981 sig_num=`$awk 'BEGIN { printf "0 " }
21982 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
21983 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
21984 !/^NSIG/ { printf "\"%s\", ", $1 }
21985 END { printf "0\n" }' signal.lst`
21986 sig_num_init=`$awk 'BEGIN { printf "0, " }
21987 !/^NSIG/ { printf "%d, ", $2}
21988 END { printf "0\n"}' signal.lst`
21991 echo "The following $sig_count signals are available:"
21993 echo $sig_name | $awk \
21994 'BEGIN { linelen = 0 }
21996 for (i = 1; i <= NF; i++) {
21997 name = "SIG" $i " "
21998 linelen = linelen + length(name)
21999 if (linelen > 70) {
22001 linelen = length(name)
22007 sig_size=`echo $sig_name | awk '{print NF}'`
22008 $rm -f signal signal.c signal.awk signal.lst signal_cmd
22012 : Check size of size
22014 case "$sizetype" in
22015 *_t) zzz="$sizetype" ;;
22016 *) zzz="filesize" ;;
22018 echo "Checking the size of $zzz..." >&4
22020 #include <sys/types.h>
22022 #$i_stdlib I_STDLIB
22024 #include <stdlib.h>
22027 printf("%d\n", (int)sizeof($sizetype));
22032 if eval $compile_ok; then
22036 echo "(I can't execute the test program--guessing $sizesize.)" >&4
22039 echo "Your $zzz size is $sizesize bytes."
22044 echo "(I can't compile the test program--guessing $sizesize.)" >&4
22048 : check for socklen_t
22050 echo "Checking to see if you have socklen_t..." >&4
22052 #include <sys/types.h>
22053 #$d_socket HAS_SOCKET
22055 #include <sys/socket.h>
22057 int main() { socklen_t x = 16; }
22060 if eval $compile; then
22062 echo "You have socklen_t."
22065 echo "You do not have socklen_t."
22066 case "$sizetype" in
22067 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
22074 : see if this is a socks.h system
22075 set socks.h i_socks
22078 : check for type of the size argument to socket calls
22079 case "$d_socket" in
22083 Checking to see what type is the last argument of accept().
22086 case "$d_socklen_t" in
22087 "$define") yyy="$yyy socklen_t"
22089 yyy="$yyy $sizetype int long unsigned"
22090 for xxx in $yyy; do
22091 case "$socksizetype" in
22092 '') try="$extern_C int accept(int, struct sockaddr *, $xxx *);"
22093 case "$usesocks" in
22095 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
22096 echo "Your system accepts '$xxx *' for the last argument of accept()."
22097 socksizetype="$xxx"
22100 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
22101 echo "Your system accepts '$xxx *' for the last argument of accept()."
22102 socksizetype="$xxx"
22109 : In case none of those worked, prompt the user.
22110 case "$socksizetype" in
22111 '') rp='What is the type for socket address structure sizes?'
22118 *) : no sockets, so pick relatively harmless default
22123 : see what type is used for signed size_t
22124 set ssize_t ssizetype int stdio.h sys/types.h
22129 #$i_stdlib I_STDLIB
22131 #include <stdlib.h>
22133 #include <sys/types.h>
22134 #define Size_t $sizetype
22135 #define SSize_t $dflt
22138 if (sizeof(Size_t) == sizeof(SSize_t))
22140 else if (sizeof(Size_t) == sizeof(int))
22149 if eval $compile_ok && $run ./try > /dev/null; then
22150 ssizetype=`$run ./try`
22151 echo "I'll be using $ssizetype for functions returning a byte count." >&4
22154 Help! I can't compile and run the ssize_t test program: please enlighten me!
22155 (This is probably a misconfiguration in your system or libraries, and
22156 you really ought to fix it. Still, I'll try anyway.)
22158 I need a type that is the same size as $sizetype, but is guaranteed to
22159 be signed. Common values are ssize_t, int and long.
22162 rp="What signed type is the same size as $sizetype?"
22168 : Check the size of st_ino
22170 $echo "Checking the size of st_ino..." >&4
22171 $cat > try.c <<EOCP
22172 #include <sys/stat.h>
22174 #$i_stdlib I_STDLIB
22176 #include <stdlib.h>
22180 printf("%d\n", (int)sizeof(st.st_ino));
22185 if eval $compile_ok; then
22189 $echo "(I can't execute the test program--guessing $st_ino_size.)" >&4
22191 *) st_ino_size=$val
22192 $echo "Your st_ino is $st_ino_size bytes long."
22197 $echo "(I can't compile the test program--guessing $st_ino_size.)" >&4
22201 : Check if st_ino is signed
22203 $echo "Checking the sign of st_ino..." >&4
22204 $cat > try.c <<EOCP
22205 #include <sys/stat.h>
22210 if (foo.st_ino < 0)
22217 if eval $compile; then
22221 $echo "(I can't execute the test program--guessing unsigned.)" >&4
22223 *) st_ino_sign=$val
22224 case "$st_ino_sign" in
22225 1) $echo "Your st_ino is unsigned." ;;
22226 -1) $echo "Your st_ino is signed." ;;
22232 $echo "(I can't compile the test program--guessing unsigned.)" >&4
22236 : see what type of char stdio uses.
22238 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
22239 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
22240 echo "Your stdio uses unsigned chars." >&4
22241 stdchar="unsigned char"
22243 echo "Your stdio uses signed chars." >&4
22248 : Check size of UID
22251 *_t) zzz="$uidtype" ;;
22254 echo "Checking the size of $zzz..." >&4
22256 #include <sys/types.h>
22258 #$i_stdlib I_STDLIB
22260 #include <stdlib.h>
22263 printf("%d\n", (int)sizeof($uidtype));
22268 if eval $compile_ok; then
22272 echo "(I can't execute the test program--guessing $uidsize.)" >&4
22275 echo "Your $zzz is $uidsize bytes long."
22280 echo "(I can't compile the test program--guessing $uidsize.)" >&4
22283 : Check if UID is signed
22286 *_t) zzz="$uidtype" ;;
22289 echo "Checking the sign of $zzz..." >&4
22291 #include <sys/types.h>
22302 if eval $compile; then
22306 echo "(I can't execute the test program--guessing unsigned.)" >&4
22310 1) echo "Your $zzz is unsigned." ;;
22311 -1) echo "Your $zzz is signed." ;;
22317 echo "(I can't compile the test program--guessing unsigned.)" >&4
22321 : Check format string for UID
22323 $echo "Checking the format string to be used for uids..." >&4
22326 -1) if $test X"$uidsize" = X"$ivsize"; then
22327 uidformat="$ivdformat"
22329 if $test X"$uidsize" = X"$longsize"; then
22332 if $test X"$uidsize" = X"$intsize"; then
22335 if $test X"$uidsize" = X"$shortsize"; then
22342 *) if $test X"$uidsize" = X"$uvsize"; then
22343 uidformat="$uvuformat"
22345 if $test X"$uidsize" = X"$longsize"; then
22348 if $test X"$uidsize" = X"$intsize"; then
22351 if $test X"$uidsize" = X"$shortsize"; then
22360 : Determine if we can use sysctl with KERN_PROC_PATHNAME to find executing program
22362 echo "Determining whether we can use sysctl with KERN_PROC_PATHNAME to find executing program..." >&4
22363 $cat >try.c <<'EOM'
22364 /* Intentionally a long probe as I'd like to sanity check that the exact
22365 approach is going to work, as thinking it will work, but only having it
22366 part working at runtime is worse than not having it. */
22368 #include <sys/types.h>
22369 #include <sys/sysctl.h>
22370 #include <sys/param.h>
22372 #include <string.h>
22373 #include <stdlib.h>
22374 #include <unistd.h>
22377 main(int argc, char **argv) {
22379 char *argv_leaf = strrchr(argv[0], '/');
22385 mib[1] = KERN_PROC;
22386 mib[2] = KERN_PROC_PATHNAME;
22390 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
22394 if (sysctl(mib, 4, NULL, &size, NULL, 0)) {
22399 if (size < strlen(argv_leaf) + 1) {
22400 fprintf(stderr, "size %lu is too short for a path\n",
22401 (unsigned long) size);
22405 if (size > MAXPATHLEN * MAXPATHLEN) {
22406 fprintf(stderr, "size %lu is too long for a path\n",
22407 (unsigned long) size);
22411 buffer = (char *)malloc(size);
22417 if (sysctl(mib, 4, buffer, &size, NULL, 0)) {
22422 if (strlen(buffer) + 1 != size) {
22423 fprintf(stderr, "size != strlen(buffer) + 1 (%lu != %lu)\n",
22424 (unsigned long)size, (unsigned long)strlen(buffer) + 1);
22429 if (*buffer != '/') {
22430 fprintf(stderr, "Not an absolute path: '%s'\n", buffer);
22434 if (strstr(buffer, "/./")) {
22435 fprintf(stderr, "Contains /./: '%s'\n", buffer);
22439 if (strstr(buffer, "/../")) {
22440 fprintf(stderr, "Contains /../: '%s'\n", buffer);
22444 buffer_leaf = strrchr(buffer, '/');
22445 if (strcmp(buffer_leaf, argv_leaf) != 0) {
22446 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], buffer);
22458 if eval $compile; then
22459 if $run ./try; then
22460 echo "You can use sysctl with KERN_PROC_PATHNAME to find the executing program." >&4
22463 echo "Nope, sysctl with KERN_PROC_PATHNAME doesn't work here." >&4
22467 echo "I'm unable to compile the test program." >&4
22468 echo "I'll assume no sysctl with KERN_PROC_PATHNAME here." >&4
22472 set usekernprocpathname
22475 : Determine if we can use _NSGetExecutablePath to find executing program
22477 echo "Determining whether we can use _NSGetExecutablePath to find executing program..." >&4
22478 $cat >try.c <<'EOM'
22479 /* Intentionally a long probe as I'd like to sanity check that the exact
22480 approach is going to work, as thinking it will work, but only having it
22481 part working at runtime is worse than not having it. */
22482 #include <mach-o/dyld.h>
22484 #include <stdlib.h>
22485 #include <sys/param.h>
22486 #include <string.h>
22489 main(int argc, char **argv) {
22491 uint32_t size = sizeof(buf);
22495 char *argv_leaf = strrchr(argv[0], '/');
22499 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
22503 _NSGetExecutablePath(buf, &size);
22504 if (size > MAXPATHLEN * MAXPATHLEN) {
22505 fprintf(stderr, "_NSGetExecutablePath size %u is too long for a path\n",
22506 (unsigned int) size);
22510 buffer = (char *)malloc(size);
22516 result = _NSGetExecutablePath(buffer, &size);
22518 fprintf(stderr, "_NSGetExecutablePath returned %i for a size of %u\n",
22519 result, (unsigned int) size);
22523 tidied = realpath(buffer, NULL);
22525 perror("realpath");
22531 if (*tidied != '/') {
22532 fprintf(stderr, "Not an absolute path: '%s'\n", tidied);
22536 if (strstr(tidied, "/./")) {
22537 fprintf(stderr, "Contains /./: '%s'\n", tidied);
22541 if (strstr(tidied, "/../")) {
22542 fprintf(stderr, "Contains /../: '%s'\n", tidied);
22546 tidied_leaf = strrchr(tidied, '/');
22547 if (strcmp(tidied_leaf, argv_leaf) != 0) {
22548 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], tidied);
22560 if eval $compile; then
22561 if $run ./try; then
22562 echo "You can use _NSGetExecutablePath to find the executing program." >&4
22565 echo "Nope, _NSGetExecutablePath doesn't work here." >&4
22568 echo "I'm unable to compile the test program." >&4
22569 echo "I'll assume no _NSGetExecutablePath here." >&4
22572 set usensgetexecutablepath
22575 : Check if site customization support was requested
22576 case "$usesitecustomize" in
22577 $define|true|[Yy]*)
22578 usesitecustomize="$define"
22581 usesitecustomize="$undef"
22585 : determine compiler compiler
22594 if $test -f "$byacc$_exe"; then
22596 comp="byacc or $comp"
22598 if $test -f "$bison$_exe"; then
22599 comp="$comp or bison -y"
22601 rp="Which compiler compiler ($comp) shall I use?"
22610 echo "(Adding -y option to bison to get yacc-compatible behavior.)"
22616 : see if this is a bfd.h system
22620 : see if this is an execinfo.h system
22621 set execinfo.h i_execinfo
22624 : see if this is a fenv.h system
22628 : see if this is a fp.h system
22632 : see if this is a fp_class.h system
22633 set fp_class.h i_fp_class
22636 : see if gdbm.h is available
22641 : see if gdbm_open exists
22642 set gdbm_open d_gdbm_open
22644 case "$d_gdbm_open" in
22647 echo "We won't be including <gdbm.h>"
22656 : see if this is a ieeefp.h system
22657 case "$i_ieeefp" in
22658 '' ) set ieeefp.h i_ieeefp
22663 : see if this is a libutil.h system
22664 set libutil.h i_libutil
22667 : see if mach cthreads are available
22668 if test "X$usethreads" = "X$define"; then
22669 set mach/cthreads.h i_machcthr
22672 i_machcthr="$undef"
22675 : see if this is a mntent.h system
22676 set mntent.h i_mntent
22679 : see if net/errno.h is available
22681 set net/errno.h val
22684 : Unfortunately, it causes problems on some systems. Arrgh.
22687 cat > try.c <<'EOM'
22690 #include <net/errno.h>
22696 if $cc $ccflags -c try.c >/dev/null 2>&1; then
22697 echo "We'll be including <net/errno.h>." >&4
22699 echo "We won't be including <net/errno.h>." >&4
22708 : see if netinet/tcp.h is available
22709 set netinet/tcp.h i_netinettcp
22712 : see if this is a poll.h system
22716 : see if this is a prot.h system
22720 : Preprocessor symbols
22722 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
22723 $cat <<'EOSH' > Cppsym.know
22724 a29k aarch64 ABI64 aegis AES_SOURCE AIX AIX32 AIX370 AIX41 AIX42
22725 AIX43 aixpc AIX_SOURCE alliant ALL_SOURCE alpha AM29000 am29000
22726 AMD64 amd64 amiga AMIGAOS AMIX ansi ANSI_C_SOURCE apollo arch_ppc
22727 arch_pwr ardent ARM ARM32 atarist att386 att3b
22728 BeOS BIG_ENDIAN BIT_MSF BSD bsd bsd43 bsd4_2 BSD4_3 bsd4_3 bsd4_4
22729 BSDCOMPAT bsdi BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES bull
22730 byteorder byte_order
22731 c cadmus clang clipper CMU COFF COMPILER_VERSION concurrent
22732 convex cpu CRAY cray CRAYMPP ctix CX_UX CYGWIN
22733 DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO Dynix DynixPTX
22734 ELF encore EPI EXTENSIONS
22735 FAVOR_BSD FILE_OFFSET_BITS FORTIFY_SOURCE FreeBSD
22736 GCC_NEW_VARARGS gcos gcx gimpel GLIBC GLIBC_MINOR GNUC GNUC_MINOR
22737 GNU_LIBRARY GNU_SOURCE GO32 gould GOULD_PN
22738 H3050R H3050RX hbullx20 hcx host_mips hp200 hp300 HP700 hp700
22739 hp800 hp9000 hp9000s200 hp9000s300 hp9000s400
22740 hp9000s700 hp9000s800 hp9k8 hppa hpux HPUX_SOURCE hp_osf
22741 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960 IA32 IA64
22742 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
22743 INLINE_INTRINSICS INT64 INTEL interdata INTRINSICS is68k itanium
22745 LANGUAGE_C LARGEFILE64_SOURCE LARGEFILE_SOURCE LARGE_FILE_API
22746 LFS64_LARGEFILE LFS_LARGEFILE LIBCATAMOUNT Linux LITTLE_ENDIAN
22747 LONG64 LONGDOUBLE LONGLONG LONG_DOUBLE LONG_LONG LP64 luna
22749 M68000 m68k m88100 m88k M88KBCS_TARGET MACH machine MachTen
22750 MATH_HAS_NO_SIDE_EFFECTS mc300 mc500 mc68000 mc68010 mc68020
22751 mc68030 mc68040 mc68060 mc68k mc68k32 mc700 mc88000 mc88100
22752 merlin mert MiNT mips MIPSEB MIPSEL MIPS_FPSET MIPS_ISA MIPS_SIM
22753 MIPS_SZINT MIPS_SZLONG MIPS_SZPTR MODERN_C motorola mpeix MSDOS
22754 MTXINU MULTIMAX MVS mvs M_AMD64 M_ARM M_ARMT M_COFF M_I186 M_I286
22755 M_I386 M_I8086 M_I86 M_I86SM M_IA64 M_IX86 M_PPC M_SYS3 M_SYS5
22756 M_SYSIII M_SYSV M_UNIX M_X86 M_XENIX
22757 n16 ncl_el ncl_mr NetBSD news1500 news1700 news1800 news1900
22758 news3700 news700 news800 news900 NeXT NLS nonstopux ns16000
22759 ns32000 ns32016 ns32332 ns32k nsc32000
22760 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
22761 PARAGON parisc pa_risc PA_RISC1_1 PA_RISC2_0 pc532 pdp11 PGC PIC
22762 plexus PORTAR posix POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
22763 POSIX_C_SOURCE POSIX_SOURCE POWER powerpc ppc PROTOTYPES PWB pyr
22765 R3000 REENTRANT RES Rhapsody RISC6000 riscix riscos RT
22766 S390 S390x SA110 SCO scs sequent sgi SGI_SOURCE SH SH3 sinix
22767 SIZE_INT SIZE_LONG SIZE_PTR SOCKETS_SOURCE SOCKET_SOURCE sony
22768 sonyrisc sony_news sparc sparclite sparcv8 sparcv9 spectrum
22769 stardent stdc STDC_EXT stratos sun sun3 sun386 Sun386i svr3 svr4
22770 SVR4_2 SVR4_SOURCE svr5 SX system SYSTYPE_BSD SYSTYPE_BSD43
22771 SYSTYPE_BSD44 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3
22772 SYSV4 SYSV5 sysV68 sysV88
22773 Tek4132 Tek4300 thumb thw_370 thw_intel thw_rs6000 titan TM3200
22774 TM5400 TM5600 tower tower32 tower32_200 tower32_600 tower32_700
22775 tower32_800 tower32_850 tss
22776 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5 ultrix UMAXV UnicomPBB
22777 UnicomPBD UNICOS UNICOSMK unix UNIX95 UNIX99 unixpc unos USE_BSD
22778 USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE
22779 USE_LARGEFILE64 USE_MISC USE_POSIX USE_POSIX199309
22780 USE_POSIX199506 USE_POSIX2 USE_REENTRANT USE_SVID USE_UNIX98
22781 USE_XOPEN USE_XOPEN_EXTENDED USGr4 USGr4_2 UTek Utek UTS UWIN
22783 vax venix VMESA vms
22784 x86_64 xenix Xenix286 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2
22785 XPG2_EXTENDED XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
22788 # Maybe put other stuff here too.
22789 ./tr '-' '_' <<EOSH >>Cppsym.know
22792 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
22793 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
22794 $cat Cppsym.know > Cppsym.c
22795 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
22796 $rm -f Cppsym.a Cppsym.b Cppsym.c
22797 cat <<EOSH > Cppsym
22799 if $test \$# -gt 0; then
22800 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
22801 if $test -s Cppsym.got; then
22808 $tr " " "$trnl" | ./Cppsym.try
22814 cat <<EOSH > Cppsym.try
22816 cat <<'EOCP' > try.c
22819 #define STRINGIFY(a) "a"
22821 #if cpp_stuff == 42
22822 #define StGiFy(a) #a
22823 #define STRINGIFY(a) StGiFy(a)
22825 #if $cpp_stuff != 1 && $cpp_stuff != 42
22826 # include "Bletch: How does this C preprocessor stringify macros?"
22832 cat <<'EOSH' >> Cppsym.try
22834 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
22835 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
22836 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
22837 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
22839 echo 'return 0;}' >> try.c
22841 cat <<EOSH >> Cppsym.try
22843 case "$osname-$gccversion" in
22844 irix-) ccflags="\$ccflags -woff 1178" ;;
22845 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
22847 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs 2>/dev/null && $run ./try | $sed 's/ /\\\\ /g'
22849 chmod +x Cppsym.try
22850 $eunicefix Cppsym.try
22851 ./Cppsym < Cppsym.know | $sort | $uniq > Cppsym.true
22852 : Add in any Linux cpp "predefined macros":
22853 case "$osname::$gccversion" in
22854 *linux*::*.*|*gnukfreebsd*::*.*|gnu::*.*)
22856 rm -f $tHdrH'.h' $tHdrH
22858 # Filter out macro arguments, such as Linux's __INT8_C(c)
22859 if $cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
22860 sed -e 's/#define[\ \ ]*//;s/[\ \ ].*$//' -e 's/(.*//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
22861 if [ -s $tHdrH'_cppsym.real' ]; then
22862 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
22865 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
22868 : now check the C compiler for additional symbols
22869 postprocess_cc_v=''
22871 aix) postprocess_cc_v="|$tr , ' '" ;;
22878 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
22881 -D*) echo "\$i" | $sed 's/^-D//';;
22882 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
22887 postprocess_cc_v=''
22890 ./ccsym > ccsym1.raw
22891 if $test -s ccsym1.raw; then
22892 $sort ccsym1.raw | $uniq >ccsym.raw
22894 mv ccsym1.raw ccsym.raw
22897 $awk '/\=/ { print $0; next }
22898 { print $0"=1" }' ccsym.raw >ccsym.list
22899 $comm -13 Cppsym.true ccsym.list >ccsym.own
22900 $comm -12 Cppsym.true ccsym.list >ccsym.com
22901 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
22903 if $test -z ccsym.raw; then
22904 echo "Your C compiler doesn't seem to define any symbols!" >&4
22906 echo "However, your C preprocessor defines the following symbols:"
22909 cppsymbols=`$cat Cppsym.true`
22910 cppsymbols=`echo $cppsymbols`
22911 cppccsymbols="$cppsymbols"
22913 if $test -s ccsym.com; then
22914 echo "Your C compiler and pre-processor define these symbols:"
22915 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
22918 cppccsymbols=`$cat ccsym.com`
22919 cppccsymbols=`echo $cppccsymbols`
22920 $test "$silent" || sleep 1
22922 if $test -s ccsym.cpp; then
22923 $test "$also" && echo " "
22924 echo "Your C pre-processor ${also}defines the following symbols:"
22925 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
22927 cppsymbols=`$cat ccsym.cpp`
22928 cppsymbols=`echo $cppsymbols`
22929 $test "$silent" || sleep 1
22931 if $test -s ccsym.own; then
22932 $test "$also" && echo " "
22933 echo "Your C compiler ${also}defines the following cpp symbols:"
22934 $sed -e 's/\(..*\)=1/\1/' ccsym.own
22935 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
22936 ccsymbols=`$cat ccsym.own`
22937 ccsymbols=`echo $ccsymbols`
22938 $test "$silent" || sleep 1
22942 : add -D_FORTIFY_SOURCE if feasible and not already there
22943 case "$gccversion" in
22944 [4567].*) case "$optimize$ccflags" in
22945 *-O*) case "$ccflags$cppsymbols" in
22946 *_FORTIFY_SOURCE=*) # Don't add it again.
22947 echo "You seem to have -D_FORTIFY_SOURCE already, not adding it." >&4
22949 *) echo "Adding -D_FORTIFY_SOURCE=2 to ccflags..." >&4
22950 ccflags="$ccflags -D_FORTIFY_SOURCE=2"
22954 *) echo "You have gcc 4.* or later but not optimizing, not adding -D_FORTIFY_SOURCE." >&4
22958 *) echo "You seem not to have gcc 4.* or later, not adding -D_FORTIFY_SOURCE." >&4
22962 : script used to emit important warnings
22965 if test \$# -gt 0; then
22970 echo "*** WARNING:" >&4
22971 sed -e 's/^/*** /' <msg >&4
22973 cat msg >>config.msg
22974 echo " " >>config.msg
22980 : see if this is a termio system
22984 if $test `./findhdr termios.h`; then
22985 set tcsetattr i_termios
22991 "$define") echo "You have POSIX termios.h... good!" >&4;;
22992 *) if ./Cppsym pyr; then
22993 case "`$run /bin/universe`" in
22994 ucb) if $test `./findhdr sgtty.h`; then
22996 echo "<sgtty.h> found." >&4
22998 echo "System is pyramid with BSD universe."
22999 ./warn "<sgtty.h> not found--you could have problems."
23001 *) if $test `./findhdr termio.h`; then
23003 echo "<termio.h> found." >&4
23005 echo "System is pyramid with USG universe."
23006 ./warn "<termio.h> not found--you could have problems."
23010 if $test `./findhdr termio.h`; then
23011 echo "<termio.h> found." >&4
23013 elif $test `./findhdr sgtty.h`; then
23014 echo "<sgtty.h> found." >&4
23017 ./warn "Neither <termio.h> nor <sgtty.h> found--cross fingers!"
23020 if $test `./findhdr sgtty.h`; then
23021 echo "<sgtty.h> found." >&4
23023 elif $test `./findhdr termio.h`; then
23024 echo "<termio.h> found." >&4
23027 ./warn "Neither <sgtty.h> nor <termio.h> found--cross fingers!"
23031 set i_termio; eval $setvar
23032 val=$val2; set i_sgtty; eval $setvar
23033 val=$val3; set i_termios; eval $setvar
23035 : see if stdbool is available
23036 : we want a real compile instead of Inhdr because some Solaris systems
23037 : have stdbool.h, but it can only be used if the compiler indicates it
23038 : is sufficiently c99-compliant.
23042 #include <stdbool.h>
23047 int main(int argc, char **argv)
23053 if eval $compile; then
23054 echo "<stdbool.h> found." >&4
23057 echo "<stdbool.h> NOT found." >&4
23064 : see if stdint is available
23065 set stdint.h i_stdint
23068 : see if sys/access.h is available
23069 set sys/access.h i_sysaccess
23072 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
23073 set sys/filio.h i_sysfilio
23076 if $test `./findhdr sys/ioctl.h`; then
23078 echo '<sys/ioctl.h> found.' >&4
23081 if $test $i_sysfilio = "$define"; then
23082 echo '<sys/ioctl.h> NOT found.' >&4
23084 $test $i_sgtty = "$define" && xxx="sgtty.h"
23085 $test $i_termio = "$define" && xxx="termio.h"
23086 $test $i_termios = "$define" && xxx="termios.h"
23087 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
23093 : see if socket ioctl defs are in sys/sockio.h
23095 xxx=`./findhdr sys/sockio.h`
23096 if $test "$xxx"; then
23097 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
23099 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
23102 echo "No socket ioctls found in <sys/sockio.h>." >&4
23107 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
23113 : see if this is a syslog.h system
23114 set syslog.h i_syslog
23117 : see if this is a sys/mode.h system
23118 set sys/mode.h i_sysmode
23121 : see if there is a sys/poll.h file
23122 set sys/poll.h i_syspoll
23125 : see if sys/resource.h has to be included
23126 set sys/resource.h i_sysresrc
23129 : see if sys/security.h is available
23130 set sys/security.h i_syssecrt
23133 : see if this is a sys/statvfs.h system
23134 set sys/statvfs.h i_sysstatvfs
23137 : see if this is a sys/un.h system
23138 set sys/un.h i_sysun
23141 : see if this is a sys/utsname.h system
23142 set sys/utsname.h i_sysutsname
23145 : see if this is a syswait system
23146 set sys/wait.h i_syswait
23149 : see if this is a ustat.h system
23150 set ustat.h i_ustat
23153 : see if this is an utime system
23154 set utime.h i_utime
23157 : see if this is a vfork system
23160 set vfork.h i_vfork
23168 : see if wchar.h is present
23169 set wchar.h i_wchar
23174 echo "Looking for extensions..." >&4
23175 : If we are using the old config.sh, nonxs_extensions and xs_extensions may
23176 : contain old or inaccurate or duplicate values.
23177 nonxs_extensions=''
23179 : We do not use find because it might not be available.
23180 : We do not just use MANIFEST because the user may have dropped
23181 : some additional extensions into the source tree and expect them
23184 : Function to recursively find available extensions, ignoring DynaLoader
23185 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
23186 : In 5.10.1 and later, extensions are stored in directories
23187 : like File-Glob instead of the older File/Glob/.
23191 DynaLoader|dynaload) ;;
23193 this_ext=`echo "$xxx" | $sed -e s/-/\\\//g`;
23194 case "$this_ext" in
23195 Scalar/List/Utils) this_ext="List/Util" ;;
23196 PathTools) this_ext="Cwd" ;;
23198 echo " $xs_extensions $nonxs_extensions" > "$tdir/$$.tmp";
23199 if $contains " $this_ext " "$tdir/$$.tmp"; then
23201 echo "Duplicate directories detected for extension $xxx" >&4;
23202 echo "Configure cannot correctly recover from this - shall I abort?" >&4;
23203 case "$knowitall" in
23211 echo "Ok. Stopping Configure." >&4;
23212 echo "Please remove the duplicate directory (e.g. using git clean) and then re-run Configure" >&4;
23215 echo "Ok. You will need to correct config.sh before running make." >&4;
23217 $ls -1 "$xxx" > "$tdir/$$.tmp";
23218 if $contains "\.xs$" "$tdir/$$.tmp" > /dev/null 2>&1; then
23219 xs_extensions="$xs_extensions $this_ext";
23220 elif $contains "\.c$" "$tdir/$$.tmp" > /dev/null 2>&1; then
23221 xs_extensions="$xs_extensions $this_ext";
23222 elif $test -d "$xxx"; then
23223 nonxs_extensions="$nonxs_extensions $this_ext";
23225 $rm -f "$tdir/$$.tmp";
23233 eval $find_extensions
23237 eval $find_extensions
23241 eval $find_extensions
23242 set X $xs_extensions
23244 xs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
23245 set X $nonxs_extensions
23247 nonxs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
23249 known_extensions=`echo $nonxs_extensions $xs_extensions | tr ' ' $trnl | $sort | tr $trnl ' '`
23251 : Now see which are supported on this system.
23253 for xxx in $xs_extensions ; do
23257 amigaos) avail_ext="$avail_ext $xxx" ;;
23262 $define) avail_ext="$avail_ext $xxx" ;;
23265 GDBM_File|gdbm_fil)
23267 $define) avail_ext="$avail_ext $xxx" ;;
23270 I18N/Langinfo|i18n_lan)
23271 case "$i_langinfo$d_nl_langinfo" in
23272 $define$define) avail_ext="$avail_ext $xxx" ;;
23276 : XXX Do we need a useipcsysv variable here
23277 case "${d_msg}${d_sem}${d_shm}" in
23278 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
23281 NDBM_File|ndbm_fil)
23284 case "$osname-$use64bitint" in
23287 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
23290 *) avail_ext="$avail_ext $xxx" ;;
23295 ODBM_File|odbm_fil)
23296 case "${i_dbm}${i_rpcsvcdbm}" in
23298 case "$d_cplusplus" in
23299 define) ;; # delete as a function name will not work
23300 *) case "$osname-$use64bitint" in
23303 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
23306 *) avail_ext="$avail_ext $xxx" ;;
23314 case "$useopcode" in
23315 true|define|y) avail_ext="$avail_ext $xxx" ;;
23319 case "$useposix" in
23320 true|define|y) avail_ext="$avail_ext $xxx" ;;
23324 case "$d_socket" in
23325 true|$define|y) avail_ext="$avail_ext $xxx" ;;
23328 Sys/Syslog|sys/syslog)
23330 amigaos) ;; # not really very useful on AmigaOS
23332 : XXX syslog requires socket
23333 case "$d_socket" in
23334 true|$define|y) avail_ext="$avail_ext $xxx" ;;
23340 case "$usethreads" in
23342 case "$use5005threads" in
23343 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
23347 threads|threads/shared)
23348 # threads and threads::shared are special cases.
23349 # To stop people from asking "Perl 5.8.0 was supposed
23350 # to have this new fancy threads implementation but my
23351 # perl doesn't have it" and from people trying to
23352 # (re)install the threads module using CPAN.pm and
23353 # CPAN.pm then offering to reinstall Perl 5.8.0,
23354 # the threads.pm and threads/shared.pm will always be
23355 # there, croaking informatively ("you need to rebuild
23356 # all of Perl with threads, sorry") when threads haven't
23357 # been compiled in.
23359 avail_ext="$avail_ext $xxx"
23365 cygwin) avail_ext="$avail_ext $xxx" ;;
23368 XS/APItest|xs/apitest)
23369 # This is just for testing. Skip it unless we have dynamic loading.
23372 $define) avail_ext="$avail_ext $xxx" ;;
23375 XS/Typemap|xs/typemap)
23376 # This is just for testing. Skip it unless we have dynamic loading.
23378 $define) avail_ext="$avail_ext $xxx" ;;
23381 *) avail_ext="$avail_ext $xxx"
23390 case "$onlyextensions" in
23392 *) keepextensions=''
23393 echo "You have requested that only certain extensions be included..." >&4
23394 for i in $onlyextensions; do
23395 case " $avail_ext " in
23397 echo "Keeping extension $i."
23398 keepextensions="$keepextensions $i"
23400 *) echo "Ignoring extension $i." ;;
23403 avail_ext="$keepextensions"
23407 case "$noextensions" in
23409 *) keepextensions=''
23410 echo "You have requested that certain extensions be ignored..." >&4
23411 for i in $avail_ext; do
23412 case " $noextensions " in
23413 *" $i "*) echo "Ignoring extension $i." ;;
23414 *) echo "Keeping extension $i.";
23415 keepextensions="$keepextensions $i"
23419 avail_ext="$keepextensions"
23423 : Now see which nonxs extensions are supported on this system.
23424 : For now assume all are.
23426 for xxx in $nonxs_extensions ; do
23430 *) nonxs_ext="$nonxs_ext $xxx"
23442 A number of extensions are supplied with $package. You may choose to
23443 compile these extensions for dynamic loading (the default), compile
23444 them into the $package executable (static loading), or not include
23445 them at all. Answer "none" to include no extensions.
23446 Note that DynaLoader is always built and need not be mentioned here.
23449 case "$dynamic_ext" in
23451 : Exclude those listed in static_ext
23453 for xxx in $avail_ext; do
23454 case " $static_ext " in
23456 *) dflt="$dflt $xxx" ;;
23463 *) dflt="$dynamic_ext"
23464 # Perhaps we are reusing an old out-of-date config.sh.
23467 if test X"$dynamic_ext" != X"$avail_ext"; then
23469 NOTICE: Your previous config.sh list may be incorrect.
23470 The extensions now available to you are
23472 but the default list from your previous config.sh is
23484 rp="What extensions do you wish to load dynamically?"
23487 none) dynamic_ext=' ' ;;
23488 *) dynamic_ext="$ans" ;;
23491 case "$static_ext" in
23493 : Exclude those already listed in dynamic linking
23495 for xxx in $avail_ext; do
23496 case " $dynamic_ext " in
23498 *) dflt="$dflt $xxx" ;;
23505 *) dflt="$static_ext"
23512 rp="What extensions do you wish to load statically?"
23515 none) static_ext=' ' ;;
23516 *) static_ext="$ans" ;;
23521 A number of extensions are supplied with $package. Answer "none"
23522 to include no extensions.
23523 Note that DynaLoader is always built and need not be mentioned here.
23526 case "$static_ext" in
23527 '') dflt="$avail_ext" ;;
23528 *) dflt="$static_ext"
23529 # Perhaps we are reusing an old out-of-date config.sh.
23532 if test X"$static_ext" != X"$avail_ext"; then
23534 NOTICE: Your previous config.sh list may be incorrect.
23535 The extensions now available to you are
23537 but the default list from your previous config.sh is
23546 : Exclude those that are not xs extensions
23550 rp="What extensions do you wish to include?"
23553 none) static_ext=' ' ;;
23554 *) static_ext="$ans" ;;
23559 # Encode is a special case. If we are building Encode as a static
23560 # extension, we need to explicitly list its subextensions as well.
23561 # For other nested extensions, this is handled automatically by
23562 # the appropriate Makefile.PL.
23563 case " $static_ext " in
23564 *" Encode "*) # Add the subextensions of Encode
23566 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
23567 static_ext="$static_ext Encode/$xxx"
23568 known_extensions="$known_extensions Encode/$xxx"
23574 set X $dynamic_ext $static_ext $nonxs_ext
23578 # Sanity check: We require an extension suitable for use with
23579 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
23580 # should show up as failures in the test suite, but it's helpful to
23581 # catch them now.) The 'extensions' list is normally sorted
23582 # alphabetically, so we need to accept either
23583 # DB_File ... Fcntl ... IO ....
23584 # or something like
23585 # Fcntl ... NDBM_File ... IO ....
23586 case " $extensions" in
23587 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
23588 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
23589 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
23590 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
23591 echo "WARNING: The Perl you are building will be quite crippled." >& 4
23595 : Remove libraries needed only for extensions
23596 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
23597 : The exception is SunOS 4.x, which needs them.
23598 case "${osname}X${osvers}" in
23602 *) case "$usedl" in
23603 $define|true|[yY]*)
23604 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
23608 *) perllibs="$libs"
23614 : Remove build directory name from cppstdin so it can be used from
23615 : either the present location or the final installed location.
23617 : Get out of the UU directory to get correct path name.
23619 case "$cppstdin" in
23621 echo "Stripping down cppstdin path name"
23627 : end of configuration questions
23629 echo "End of configuration questions."
23632 : back to where it started
23633 if test -d ../UU; then
23637 : configuration may be unconditionally patched via a 'config.arch' file
23638 if $test -f config.arch; then
23639 echo "I see a config.arch file, loading it." >&4
23643 : configuration may be patched via a 'config.over' file
23644 if $test -f config.over; then
23647 rp='I see a config.over file. Do you wish to load it?'
23650 n*) echo "OK, I'll ignore it.";;
23652 echo "Configuration override changes have been loaded."
23657 : in case they want portability, strip down executable paths
23658 case "$d_portable" in
23661 echo "Stripping down executable paths..." >&4
23662 for file in $loclist $trylist; do
23664 eval $file=`basename $temp`
23669 : create config.sh file
23671 echo "Creating config.sh..." >&4
23672 $spitshell <<EOT >config.sh
23675 # This file was produced by running the Configure script. It holds all the
23676 # definitions figured out by Configure. Should you modify one of these values,
23677 # do not forget to propagate your changes by running "Configure -der". You may
23678 # instead choose to run each of the .SH files by yourself, or "Configure -S".
23681 # Package name : $package
23682 # Source directory : $src
23683 # Configuration time: $cf_time
23684 # Configured by : $cf_by
23685 # Target system : $myuname
23688 : Add in command line options if available
23689 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
23691 $spitshell <<EOT >>config.sh
23700 Revision='$Revision'
23708 alignbytes='$alignbytes'
23709 aphostname='$aphostname'
23710 api_revision='$api_revision'
23711 api_subversion='$api_subversion'
23712 api_version='$api_version'
23713 api_versionstring='$api_versionstring'
23716 archlibexp='$archlibexp'
23717 archname64='$archname64'
23718 archname='$archname'
23719 archobjs='$archobjs'
23720 asctime_r_proto='$asctime_r_proto'
23729 byteorder='$byteorder'
23731 castflags='$castflags'
23734 cccdlflags='$cccdlflags'
23735 ccdlflags='$ccdlflags'
23737 ccflags_uselargefiles='$ccflags_uselargefiles'
23739 ccsymbols='$ccsymbols'
23740 ccversion='$ccversion'
23742 cf_email='$cf_email'
23744 charbits='$charbits'
23745 charsize='$charsize'
23749 clocktype='$clocktype'
23751 compress='$compress'
23752 contains='$contains'
23756 cpp_stuff='$cpp_stuff'
23757 cppccsymbols='$cppccsymbols'
23758 cppflags='$cppflags'
23760 cppminus='$cppminus'
23762 cppstdin='$cppstdin'
23763 cppsymbols='$cppsymbols'
23764 crypt_r_proto='$crypt_r_proto'
23765 cryptlib='$cryptlib'
23767 ctermid_r_proto='$ctermid_r_proto'
23768 ctime_r_proto='$ctime_r_proto'
23769 d_Gconvert='$d_Gconvert'
23770 d_PRIEUldbl='$d_PRIEUldbl'
23771 d_PRIFUldbl='$d_PRIFUldbl'
23772 d_PRIGUldbl='$d_PRIGUldbl'
23773 d_PRIXU64='$d_PRIXU64'
23774 d_PRId64='$d_PRId64'
23775 d_PRIeldbl='$d_PRIeldbl'
23776 d_PRIfldbl='$d_PRIfldbl'
23777 d_PRIgldbl='$d_PRIgldbl'
23778 d_PRIi64='$d_PRIi64'
23779 d_PRIo64='$d_PRIo64'
23780 d_PRIu64='$d_PRIu64'
23781 d_PRIx64='$d_PRIx64'
23782 d_SCNfldbl='$d_SCNfldbl'
23783 d__fwalk='$d__fwalk'
23784 d_accept4='$d_accept4'
23785 d_access='$d_access'
23786 d_accessx='$d_accessx'
23790 d_archlib='$d_archlib'
23791 d_asctime64='$d_asctime64'
23792 d_asctime_r='$d_asctime_r'
23797 d_attribute_deprecated='$d_attribute_deprecated'
23798 d_attribute_format='$d_attribute_format'
23799 d_attribute_malloc='$d_attribute_malloc'
23800 d_attribute_nonnull='$d_attribute_nonnull'
23801 d_attribute_noreturn='$d_attribute_noreturn'
23802 d_attribute_pure='$d_attribute_pure'
23803 d_attribute_unused='$d_attribute_unused'
23804 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
23805 d_backtrace='$d_backtrace'
23807 d_bsdgetpgrp='$d_bsdgetpgrp'
23808 d_bsdsetpgrp='$d_bsdsetpgrp'
23809 d_builtin_add_overflow='$d_builtin_add_overflow'
23810 d_builtin_choose_expr='$d_builtin_choose_expr'
23811 d_builtin_expect='$d_builtin_expect'
23812 d_builtin_mul_overflow='$d_builtin_mul_overflow'
23813 d_builtin_sub_overflow='$d_builtin_sub_overflow'
23814 d_c99_variadic_macros='$d_c99_variadic_macros'
23815 d_casti32='$d_casti32'
23816 d_castneg='$d_castneg'
23819 d_chroot='$d_chroot'
23820 d_chsize='$d_chsize'
23822 d_clearenv='$d_clearenv'
23823 d_closedir='$d_closedir'
23824 d_cmsghdr_s='$d_cmsghdr_s'
23826 d_copysign='$d_copysign'
23827 d_copysignl='$d_copysignl'
23828 d_cplusplus='$d_cplusplus'
23830 d_crypt_r='$d_crypt_r'
23832 d_ctermid='$d_ctermid'
23833 d_ctermid_r='$d_ctermid_r'
23834 d_ctime64='$d_ctime64'
23835 d_ctime_r='$d_ctime_r'
23836 d_cuserid='$d_cuserid'
23837 d_dbminitproto='$d_dbminitproto'
23838 d_difftime64='$d_difftime64'
23839 d_difftime='$d_difftime'
23840 d_dir_dd_fd='$d_dir_dd_fd'
23842 d_dirnamlen='$d_dirnamlen'
23843 d_dladdr='$d_dladdr'
23844 d_dlerror='$d_dlerror'
23845 d_dlopen='$d_dlopen'
23846 d_dlsymun='$d_dlsymun'
23847 d_dosuid='$d_dosuid'
23848 d_double_has_inf='$d_double_has_inf'
23849 d_double_has_nan='$d_double_has_nan'
23850 d_double_has_negative_zero='$d_double_has_negative_zero'
23851 d_double_has_subnormals='$d_double_has_subnormals'
23852 d_double_style_cray='$d_double_style_cray'
23853 d_double_style_ibm='$d_double_style_ibm'
23854 d_double_style_ieee='$d_double_style_ieee'
23855 d_double_style_vax='$d_double_style_vax'
23856 d_drand48_r='$d_drand48_r'
23857 d_drand48proto='$d_drand48proto'
23860 d_duplocale='$d_duplocale'
23861 d_eaccess='$d_eaccess'
23862 d_endgrent='$d_endgrent'
23863 d_endgrent_r='$d_endgrent_r'
23864 d_endhent='$d_endhent'
23865 d_endhostent_r='$d_endhostent_r'
23866 d_endnent='$d_endnent'
23867 d_endnetent_r='$d_endnetent_r'
23868 d_endpent='$d_endpent'
23869 d_endprotoent_r='$d_endprotoent_r'
23870 d_endpwent='$d_endpwent'
23871 d_endpwent_r='$d_endpwent_r'
23872 d_endsent='$d_endsent'
23873 d_endservent_r='$d_endservent_r'
23874 d_eofnblk='$d_eofnblk'
23877 d_eunice='$d_eunice'
23880 d_faststdio='$d_faststdio'
23881 d_fchdir='$d_fchdir'
23882 d_fchmod='$d_fchmod'
23883 d_fchmodat='$d_fchmodat'
23884 d_fchown='$d_fchown'
23886 d_fcntl_can_lock='$d_fcntl_can_lock'
23887 d_fd_macros='$d_fd_macros'
23888 d_fd_set='$d_fd_set'
23889 d_fdclose='$d_fdclose'
23891 d_fds_bits='$d_fds_bits'
23892 d_fegetround='$d_fegetround'
23893 d_fgetpos='$d_fgetpos'
23894 d_finite='$d_finite'
23895 d_finitel='$d_finitel'
23896 d_flexfnam='$d_flexfnam'
23898 d_flockproto='$d_flockproto'
23903 d_fp_class='$d_fp_class'
23904 d_fp_classify='$d_fp_classify'
23905 d_fp_classl='$d_fp_classl'
23906 d_fpathconf='$d_fpathconf'
23907 d_fpclass='$d_fpclass'
23908 d_fpclassify='$d_fpclassify'
23909 d_fpclassl='$d_fpclassl'
23910 d_fpgetround='$d_fpgetround'
23911 d_fpos64_t='$d_fpos64_t'
23912 d_freelocale='$d_freelocale'
23913 d_frexpl='$d_frexpl'
23914 d_fs_data_s='$d_fs_data_s'
23915 d_fseeko='$d_fseeko'
23916 d_fsetpos='$d_fsetpos'
23917 d_fstatfs='$d_fstatfs'
23918 d_fstatvfs='$d_fstatvfs'
23920 d_ftello='$d_ftello'
23922 d_futimes='$d_futimes'
23923 d_gai_strerror='$d_gai_strerror'
23924 d_gdbm_ndbm_h_uses_prototypes='$d_gdbm_ndbm_h_uses_prototypes'
23925 d_gdbmndbm_h_uses_prototypes='$d_gdbmndbm_h_uses_prototypes'
23926 d_getaddrinfo='$d_getaddrinfo'
23927 d_getcwd='$d_getcwd'
23928 d_getespwnam='$d_getespwnam'
23929 d_getfsstat='$d_getfsstat'
23930 d_getgrent='$d_getgrent'
23931 d_getgrent_r='$d_getgrent_r'
23932 d_getgrgid_r='$d_getgrgid_r'
23933 d_getgrnam_r='$d_getgrnam_r'
23934 d_getgrps='$d_getgrps'
23935 d_gethbyaddr='$d_gethbyaddr'
23936 d_gethbyname='$d_gethbyname'
23937 d_gethent='$d_gethent'
23938 d_gethname='$d_gethname'
23939 d_gethostbyaddr_r='$d_gethostbyaddr_r'
23940 d_gethostbyname_r='$d_gethostbyname_r'
23941 d_gethostent_r='$d_gethostent_r'
23942 d_gethostprotos='$d_gethostprotos'
23943 d_getitimer='$d_getitimer'
23944 d_getlogin='$d_getlogin'
23945 d_getlogin_r='$d_getlogin_r'
23946 d_getmnt='$d_getmnt'
23947 d_getmntent='$d_getmntent'
23948 d_getnameinfo='$d_getnameinfo'
23949 d_getnbyaddr='$d_getnbyaddr'
23950 d_getnbyname='$d_getnbyname'
23951 d_getnent='$d_getnent'
23952 d_getnetbyaddr_r='$d_getnetbyaddr_r'
23953 d_getnetbyname_r='$d_getnetbyname_r'
23954 d_getnetent_r='$d_getnetent_r'
23955 d_getnetprotos='$d_getnetprotos'
23956 d_getpagsz='$d_getpagsz'
23957 d_getpbyname='$d_getpbyname'
23958 d_getpbynumber='$d_getpbynumber'
23959 d_getpent='$d_getpent'
23960 d_getpgid='$d_getpgid'
23961 d_getpgrp2='$d_getpgrp2'
23962 d_getpgrp='$d_getpgrp'
23963 d_getppid='$d_getppid'
23964 d_getprior='$d_getprior'
23965 d_getprotobyname_r='$d_getprotobyname_r'
23966 d_getprotobynumber_r='$d_getprotobynumber_r'
23967 d_getprotoent_r='$d_getprotoent_r'
23968 d_getprotoprotos='$d_getprotoprotos'
23969 d_getprpwnam='$d_getprpwnam'
23970 d_getpwent='$d_getpwent'
23971 d_getpwent_r='$d_getpwent_r'
23972 d_getpwnam_r='$d_getpwnam_r'
23973 d_getpwuid_r='$d_getpwuid_r'
23974 d_getsbyname='$d_getsbyname'
23975 d_getsbyport='$d_getsbyport'
23976 d_getsent='$d_getsent'
23977 d_getservbyname_r='$d_getservbyname_r'
23978 d_getservbyport_r='$d_getservbyport_r'
23979 d_getservent_r='$d_getservent_r'
23980 d_getservprotos='$d_getservprotos'
23981 d_getspnam='$d_getspnam'
23982 d_getspnam_r='$d_getspnam_r'
23983 d_gettimeod='$d_gettimeod'
23984 d_gmtime64='$d_gmtime64'
23985 d_gmtime_r='$d_gmtime_r'
23986 d_gnulibc='$d_gnulibc'
23987 d_grpasswd='$d_grpasswd'
23988 d_hasmntopt='$d_hasmntopt'
23992 d_ilogbl='$d_ilogbl'
23993 d_inc_version_list='$d_inc_version_list'
23994 d_inetaton='$d_inetaton'
23995 d_inetntop='$d_inetntop'
23996 d_inetpton='$d_inetpton'
23997 d_int64_t='$d_int64_t'
23998 d_ip_mreq='$d_ip_mreq'
23999 d_ip_mreq_source='$d_ip_mreq_source'
24000 d_ipv6_mreq='$d_ipv6_mreq'
24001 d_ipv6_mreq_source='$d_ipv6_mreq_source'
24002 d_isascii='$d_isascii'
24003 d_isblank='$d_isblank'
24004 d_isfinite='$d_isfinite'
24005 d_isfinitel='$d_isfinitel'
24007 d_isinfl='$d_isinfl'
24008 d_isless='$d_isless'
24010 d_isnanl='$d_isnanl'
24011 d_isnormal='$d_isnormal'
24014 d_killpg='$d_killpg'
24015 d_lc_monetary_2008='$d_lc_monetary_2008'
24016 d_lchown='$d_lchown'
24017 d_ldbl_dig='$d_ldbl_dig'
24018 d_ldexpl='$d_ldexpl'
24019 d_lgamma='$d_lgamma'
24020 d_lgamma_r='$d_lgamma_r'
24021 d_libm_lib_version='$d_libm_lib_version'
24022 d_libname_unique='$d_libname_unique'
24024 d_linkat='$d_linkat'
24025 d_llrint='$d_llrint'
24026 d_llrintl='$d_llrintl'
24027 d_llround='$d_llround'
24028 d_llroundl='$d_llroundl'
24029 d_localeconv_l='$d_localeconv_l'
24030 d_localtime64='$d_localtime64'
24031 d_localtime_r='$d_localtime_r'
24032 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
24033 d_locconv='$d_locconv'
24038 d_long_double_style_ieee='$d_long_double_style_ieee'
24039 d_long_double_style_ieee_doubledouble='$d_long_double_style_ieee_doubledouble'
24040 d_long_double_style_ieee_extended='$d_long_double_style_ieee_extended'
24041 d_long_double_style_ieee_std='$d_long_double_style_ieee_std'
24042 d_long_double_style_vax='$d_long_double_style_vax'
24043 d_longdbl='$d_longdbl'
24044 d_longlong='$d_longlong'
24046 d_lrintl='$d_lrintl'
24047 d_lround='$d_lround'
24048 d_lroundl='$d_lroundl'
24049 d_lseekproto='$d_lseekproto'
24051 d_madvise='$d_madvise'
24052 d_malloc_good_size='$d_malloc_good_size'
24053 d_malloc_size='$d_malloc_size'
24055 d_mbrlen='$d_mbrlen'
24056 d_mbrtowc='$d_mbrtowc'
24057 d_mbstowcs='$d_mbstowcs'
24058 d_mbtowc='$d_mbtowc'
24059 d_memmem='$d_memmem'
24060 d_memrchr='$d_memrchr'
24062 d_mkdtemp='$d_mkdtemp'
24063 d_mkfifo='$d_mkfifo'
24064 d_mkstemp='$d_mkstemp'
24065 d_mkstemps='$d_mkstemps'
24066 d_mktime64='$d_mktime64'
24067 d_mktime='$d_mktime'
24070 d_modflproto='$d_modflproto'
24071 d_mprotect='$d_mprotect'
24073 d_msg_ctrunc='$d_msg_ctrunc'
24074 d_msg_dontroute='$d_msg_dontroute'
24075 d_msg_oob='$d_msg_oob'
24076 d_msg_peek='$d_msg_peek'
24077 d_msg_proxy='$d_msg_proxy'
24078 d_msgctl='$d_msgctl'
24079 d_msgget='$d_msgget'
24080 d_msghdr_s='$d_msghdr_s'
24081 d_msgrcv='$d_msgrcv'
24082 d_msgsnd='$d_msgsnd'
24084 d_munmap='$d_munmap'
24085 d_mymalloc='$d_mymalloc'
24087 d_nanosleep='$d_nanosleep'
24089 d_ndbm_h_uses_prototypes='$d_ndbm_h_uses_prototypes'
24090 d_nearbyint='$d_nearbyint'
24091 d_newlocale='$d_newlocale'
24092 d_nextafter='$d_nextafter'
24093 d_nexttoward='$d_nexttoward'
24095 d_nl_langinfo='$d_nl_langinfo'
24096 d_nv_preserves_uv='$d_nv_preserves_uv'
24097 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
24098 d_off64_t='$d_off64_t'
24099 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
24100 d_oldpthreads='$d_oldpthreads'
24101 d_oldsock='$d_oldsock'
24103 d_openat='$d_openat'
24104 d_pathconf='$d_pathconf'
24106 d_perl_otherlibdirs='$d_perl_otherlibdirs'
24107 d_phostname='$d_phostname'
24111 d_portable='$d_portable'
24113 d_prctl_set_name='$d_prctl_set_name'
24114 d_printf_format_null='$d_printf_format_null'
24115 d_procselfexe='$d_procselfexe'
24116 d_pseudofork='$d_pseudofork'
24117 d_pthread_atfork='$d_pthread_atfork'
24118 d_pthread_attr_setscope='$d_pthread_attr_setscope'
24119 d_pthread_yield='$d_pthread_yield'
24120 d_ptrdiff_t='$d_ptrdiff_t'
24122 d_pwchange='$d_pwchange'
24123 d_pwclass='$d_pwclass'
24124 d_pwcomment='$d_pwcomment'
24125 d_pwexpire='$d_pwexpire'
24126 d_pwgecos='$d_pwgecos'
24127 d_pwpasswd='$d_pwpasswd'
24128 d_pwquota='$d_pwquota'
24131 d_querylocale='$d_querylocale'
24132 d_random_r='$d_random_r'
24133 d_re_comp='$d_re_comp'
24134 d_readdir64_r='$d_readdir64_r'
24135 d_readdir='$d_readdir'
24136 d_readdir_r='$d_readdir_r'
24137 d_readlink='$d_readlink'
24139 d_recvmsg='$d_recvmsg'
24140 d_regcmp='$d_regcmp'
24141 d_regcomp='$d_regcomp'
24142 d_remainder='$d_remainder'
24143 d_remquo='$d_remquo'
24144 d_rename='$d_rename'
24145 d_renameat='$d_renameat'
24146 d_rewinddir='$d_rewinddir'
24150 d_sbrkproto='$d_sbrkproto'
24151 d_scalbn='$d_scalbn'
24152 d_scalbnl='$d_scalbnl'
24153 d_sched_yield='$d_sched_yield'
24154 d_scm_rights='$d_scm_rights'
24155 d_seekdir='$d_seekdir'
24156 d_select='$d_select'
24158 d_semctl='$d_semctl'
24159 d_semctl_semid_ds='$d_semctl_semid_ds'
24160 d_semctl_semun='$d_semctl_semun'
24161 d_semget='$d_semget'
24163 d_sendmsg='$d_sendmsg'
24164 d_setegid='$d_setegid'
24165 d_seteuid='$d_seteuid'
24166 d_setgrent='$d_setgrent'
24167 d_setgrent_r='$d_setgrent_r'
24168 d_setgrps='$d_setgrps'
24169 d_sethent='$d_sethent'
24170 d_sethostent_r='$d_sethostent_r'
24171 d_setitimer='$d_setitimer'
24172 d_setlinebuf='$d_setlinebuf'
24173 d_setlocale='$d_setlocale'
24174 d_setlocale_r='$d_setlocale_r'
24175 d_setnent='$d_setnent'
24176 d_setnetent_r='$d_setnetent_r'
24177 d_setpent='$d_setpent'
24178 d_setpgid='$d_setpgid'
24179 d_setpgrp2='$d_setpgrp2'
24180 d_setpgrp='$d_setpgrp'
24181 d_setprior='$d_setprior'
24182 d_setproctitle='$d_setproctitle'
24183 d_setprotoent_r='$d_setprotoent_r'
24184 d_setpwent='$d_setpwent'
24185 d_setpwent_r='$d_setpwent_r'
24186 d_setregid='$d_setregid'
24187 d_setresgid='$d_setresgid'
24188 d_setresuid='$d_setresuid'
24189 d_setreuid='$d_setreuid'
24190 d_setrgid='$d_setrgid'
24191 d_setruid='$d_setruid'
24192 d_setsent='$d_setsent'
24193 d_setservent_r='$d_setservent_r'
24194 d_setsid='$d_setsid'
24195 d_setvbuf='$d_setvbuf'
24198 d_shmatprototype='$d_shmatprototype'
24199 d_shmctl='$d_shmctl'
24201 d_shmget='$d_shmget'
24202 d_sigaction='$d_sigaction'
24203 d_siginfo_si_addr='$d_siginfo_si_addr'
24204 d_siginfo_si_band='$d_siginfo_si_band'
24205 d_siginfo_si_errno='$d_siginfo_si_errno'
24206 d_siginfo_si_fd='$d_siginfo_si_fd'
24207 d_siginfo_si_pid='$d_siginfo_si_pid'
24208 d_siginfo_si_status='$d_siginfo_si_status'
24209 d_siginfo_si_uid='$d_siginfo_si_uid'
24210 d_siginfo_si_value='$d_siginfo_si_value'
24211 d_signbit='$d_signbit'
24212 d_sigprocmask='$d_sigprocmask'
24213 d_sigsetjmp='$d_sigsetjmp'
24214 d_sin6_scope_id='$d_sin6_scope_id'
24215 d_sitearch='$d_sitearch'
24216 d_snprintf='$d_snprintf'
24217 d_sockaddr_in6='$d_sockaddr_in6'
24218 d_sockaddr_sa_len='$d_sockaddr_sa_len'
24219 d_sockatmark='$d_sockatmark'
24220 d_sockatmarkproto='$d_sockatmarkproto'
24221 d_socket='$d_socket'
24222 d_socklen_t='$d_socklen_t'
24223 d_sockpair='$d_sockpair'
24224 d_socks5_init='$d_socks5_init'
24226 d_srand48_r='$d_srand48_r'
24227 d_srandom_r='$d_srandom_r'
24228 d_sresgproto='$d_sresgproto'
24229 d_sresuproto='$d_sresuproto'
24231 d_statblks='$d_statblks'
24232 d_statfs_f_flags='$d_statfs_f_flags'
24233 d_statfs_s='$d_statfs_s'
24234 d_static_inline='$d_static_inline'
24235 d_statvfs='$d_statvfs'
24236 d_stdio_cnt_lval='$d_stdio_cnt_lval'
24237 d_stdio_ptr_lval='$d_stdio_ptr_lval'
24238 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
24239 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
24240 d_stdio_stream_array='$d_stdio_stream_array'
24241 d_stdiobase='$d_stdiobase'
24242 d_stdstdio='$d_stdstdio'
24243 d_strcoll='$d_strcoll'
24244 d_strerror_l='$d_strerror_l'
24245 d_strerror_r='$d_strerror_r'
24246 d_strftime='$d_strftime'
24247 d_strlcat='$d_strlcat'
24248 d_strlcpy='$d_strlcpy'
24249 d_strnlen='$d_strnlen'
24250 d_strtod='$d_strtod'
24251 d_strtol='$d_strtol'
24252 d_strtold='$d_strtold'
24253 d_strtold_l='$d_strtold_l'
24254 d_strtoll='$d_strtoll'
24255 d_strtoq='$d_strtoq'
24256 d_strtoul='$d_strtoul'
24257 d_strtoull='$d_strtoull'
24258 d_strtouq='$d_strtouq'
24259 d_strxfrm='$d_strxfrm'
24260 d_suidsafe='$d_suidsafe'
24261 d_symlink='$d_symlink'
24262 d_syscall='$d_syscall'
24263 d_syscallproto='$d_syscallproto'
24264 d_sysconf='$d_sysconf'
24265 d_sysernlst='$d_sysernlst'
24266 d_syserrlst='$d_syserrlst'
24267 d_system='$d_system'
24268 d_tcgetpgrp='$d_tcgetpgrp'
24269 d_tcsetpgrp='$d_tcsetpgrp'
24270 d_telldir='$d_telldir'
24271 d_telldirproto='$d_telldirproto'
24272 d_tgamma='$d_tgamma'
24273 d_thread_safe_nl_langinfo_l='$d_thread_safe_nl_langinfo_l'
24275 d_timegm='$d_timegm'
24277 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
24278 d_tm_tm_zone='$d_tm_tm_zone'
24279 d_tmpnam_r='$d_tmpnam_r'
24281 d_truncate='$d_truncate'
24282 d_truncl='$d_truncl'
24283 d_ttyname_r='$d_ttyname_r'
24284 d_tzname='$d_tzname'
24285 d_u32align='$d_u32align'
24286 d_ualarm='$d_ualarm'
24289 d_union_semun='$d_union_semun'
24290 d_unlinkat='$d_unlinkat'
24291 d_unordered='$d_unordered'
24292 d_unsetenv='$d_unsetenv'
24293 d_uselocale='$d_uselocale'
24294 d_usleep='$d_usleep'
24295 d_usleepproto='$d_usleepproto'
24297 d_vendorarch='$d_vendorarch'
24298 d_vendorbin='$d_vendorbin'
24299 d_vendorlib='$d_vendorlib'
24300 d_vendorscript='$d_vendorscript'
24302 d_void_closedir='$d_void_closedir'
24303 d_voidsig='$d_voidsig'
24304 d_voidtty='$d_voidtty'
24305 d_vsnprintf='$d_vsnprintf'
24307 d_waitpid='$d_waitpid'
24308 d_wcscmp='$d_wcscmp'
24309 d_wcstombs='$d_wcstombs'
24310 d_wcsxfrm='$d_wcsxfrm'
24311 d_wctomb='$d_wctomb'
24312 d_writev='$d_writev'
24315 db_hashtype='$db_hashtype'
24316 db_prefixtype='$db_prefixtype'
24317 db_version_major='$db_version_major'
24318 db_version_minor='$db_version_minor'
24319 db_version_patch='$db_version_patch'
24320 default_inc_excludes_dot='$default_inc_excludes_dot'
24321 direntrytype='$direntrytype'
24324 doubleinfbytes='$doubleinfbytes'
24325 doublekind='$doublekind'
24326 doublemantbits='$doublemantbits'
24327 doublenanbytes='$doublenanbytes'
24328 doublesize='$doublesize'
24330 drand48_r_proto='$drand48_r_proto'
24332 dtraceobject='$dtraceobject'
24333 dtracexnolibs='$dtracexnolibs'
24334 dynamic_ext='$dynamic_ext'
24340 endgrent_r_proto='$endgrent_r_proto'
24341 endhostent_r_proto='$endhostent_r_proto'
24342 endnetent_r_proto='$endnetent_r_proto'
24343 endprotoent_r_proto='$endprotoent_r_proto'
24344 endpwent_r_proto='$endpwent_r_proto'
24345 endservent_r_proto='$endservent_r_proto'
24346 eunicefix='$eunicefix'
24349 extensions='$extensions'
24350 extern_C='$extern_C'
24352 fflushNULL='$fflushNULL'
24353 fflushall='$fflushall'
24355 firstmakefile='$firstmakefile'
24357 fpossize='$fpossize'
24358 fpostype='$fpostype'
24359 freetype='$freetype'
24362 full_csh='$full_csh'
24363 full_sed='$full_sed'
24364 gccansipedantic='$gccansipedantic'
24365 gccosandvers='$gccosandvers'
24366 gccversion='$gccversion'
24367 getgrent_r_proto='$getgrent_r_proto'
24368 getgrgid_r_proto='$getgrgid_r_proto'
24369 getgrnam_r_proto='$getgrnam_r_proto'
24370 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
24371 gethostbyname_r_proto='$gethostbyname_r_proto'
24372 gethostent_r_proto='$gethostent_r_proto'
24373 getlogin_r_proto='$getlogin_r_proto'
24374 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
24375 getnetbyname_r_proto='$getnetbyname_r_proto'
24376 getnetent_r_proto='$getnetent_r_proto'
24377 getprotobyname_r_proto='$getprotobyname_r_proto'
24378 getprotobynumber_r_proto='$getprotobynumber_r_proto'
24379 getprotoent_r_proto='$getprotoent_r_proto'
24380 getpwent_r_proto='$getpwent_r_proto'
24381 getpwnam_r_proto='$getpwnam_r_proto'
24382 getpwuid_r_proto='$getpwuid_r_proto'
24383 getservbyname_r_proto='$getservbyname_r_proto'
24384 getservbyport_r_proto='$getservbyport_r_proto'
24385 getservent_r_proto='$getservent_r_proto'
24386 getspnam_r_proto='$getspnam_r_proto'
24387 gidformat='$gidformat'
24393 gmtime_r_proto='$gmtime_r_proto'
24394 gnulibc_version='$gnulibc_version'
24396 groupcat='$groupcat'
24397 groupstype='$groupstype'
24400 h_sysfile='$h_sysfile'
24403 hostgenerate='$hostgenerate'
24404 hostosname='$hostosname'
24405 hostperl='$hostperl'
24406 html1dir='$html1dir'
24407 html1direxp='$html1direxp'
24408 html3dir='$html3dir'
24409 html3direxp='$html3direxp'
24418 i_arpainet='$i_arpainet'
24420 i_bsdioctl='$i_bsdioctl'
24424 i_dirent='$i_dirent'
24426 i_execinfo='$i_execinfo'
24430 i_fp_class='$i_fp_class'
24432 i_gdbm_ndbm='$i_gdbm_ndbm'
24433 i_gdbmndbm='$i_gdbmndbm'
24435 i_ieeefp='$i_ieeefp'
24436 i_inttypes='$i_inttypes'
24437 i_langinfo='$i_langinfo'
24438 i_libutil='$i_libutil'
24439 i_locale='$i_locale'
24440 i_machcthr='$i_machcthr'
24441 i_malloc='$i_malloc'
24442 i_mallocmalloc='$i_mallocmalloc'
24443 i_mntent='$i_mntent'
24446 i_neterrno='$i_neterrno'
24447 i_netinettcp='$i_netinettcp'
24451 i_pthread='$i_pthread'
24453 i_quadmath='$i_quadmath'
24454 i_rpcsvcdbm='$i_rpcsvcdbm'
24456 i_shadow='$i_shadow'
24458 i_stdbool='$i_stdbool'
24459 i_stdint='$i_stdint'
24460 i_stdlib='$i_stdlib'
24461 i_sunmath='$i_sunmath'
24462 i_sysaccess='$i_sysaccess'
24463 i_sysdir='$i_sysdir'
24464 i_sysfile='$i_sysfile'
24465 i_sysfilio='$i_sysfilio'
24467 i_sysioctl='$i_sysioctl'
24468 i_syslog='$i_syslog'
24469 i_sysmman='$i_sysmman'
24470 i_sysmode='$i_sysmode'
24471 i_sysmount='$i_sysmount'
24472 i_sysndir='$i_sysndir'
24473 i_sysparam='$i_sysparam'
24474 i_syspoll='$i_syspoll'
24475 i_sysresrc='$i_sysresrc'
24476 i_syssecrt='$i_syssecrt'
24477 i_sysselct='$i_sysselct'
24478 i_syssockio='$i_syssockio'
24479 i_sysstat='$i_sysstat'
24480 i_sysstatfs='$i_sysstatfs'
24481 i_sysstatvfs='$i_sysstatvfs'
24482 i_systime='$i_systime'
24483 i_systimek='$i_systimek'
24484 i_systimes='$i_systimes'
24485 i_systypes='$i_systypes'
24486 i_sysuio='$i_sysuio'
24488 i_sysutsname='$i_sysutsname'
24489 i_sysvfs='$i_sysvfs'
24490 i_syswait='$i_syswait'
24491 i_termio='$i_termio'
24492 i_termios='$i_termios'
24494 i_unistd='$i_unistd'
24499 i_xlocale='$i_xlocale'
24500 ignore_versioned_solibs='$ignore_versioned_solibs'
24501 inc_version_list='$inc_version_list'
24502 inc_version_list_init='$inc_version_list_init'
24506 initialinstalllocation='$initialinstalllocation'
24507 installarchlib='$installarchlib'
24508 installbin='$installbin'
24509 installhtml1dir='$installhtml1dir'
24510 installhtml3dir='$installhtml3dir'
24511 installman1dir='$installman1dir'
24512 installman3dir='$installman3dir'
24513 installprefix='$installprefix'
24514 installprefixexp='$installprefixexp'
24515 installprivlib='$installprivlib'
24516 installscript='$installscript'
24517 installsitearch='$installsitearch'
24518 installsitebin='$installsitebin'
24519 installsitehtml1dir='$installsitehtml1dir'
24520 installsitehtml3dir='$installsitehtml3dir'
24521 installsitelib='$installsitelib'
24522 installsiteman1dir='$installsiteman1dir'
24523 installsiteman3dir='$installsiteman3dir'
24524 installsitescript='$installsitescript'
24525 installstyle='$installstyle'
24526 installusrbinperl='$installusrbinperl'
24527 installvendorarch='$installvendorarch'
24528 installvendorbin='$installvendorbin'
24529 installvendorhtml1dir='$installvendorhtml1dir'
24530 installvendorhtml3dir='$installvendorhtml3dir'
24531 installvendorlib='$installvendorlib'
24532 installvendorman1dir='$installvendorman1dir'
24533 installvendorman3dir='$installvendorman3dir'
24534 installvendorscript='$installvendorscript'
24536 issymlink='$issymlink'
24537 ivdformat='$ivdformat'
24540 known_extensions='$known_extensions'
24543 ld_can_script='$ld_can_script'
24544 lddlflags='$lddlflags'
24546 ldflags_uselargefiles='$ldflags_uselargefiles'
24547 ldlibpthname='$ldlibpthname'
24554 libsdirs='$libsdirs'
24555 libsfiles='$libsfiles'
24556 libsfound='$libsfound'
24557 libspath='$libspath'
24558 libswanted='$libswanted'
24559 libswanted_uselargefiles='$libswanted_uselargefiles'
24565 localtime_r_proto='$localtime_r_proto'
24566 locincpth='$locincpth'
24567 loclibpth='$loclibpth'
24568 longdblinfbytes='$longdblinfbytes'
24569 longdblkind='$longdblkind'
24570 longdblmantbits='$longdblmantbits'
24571 longdblnanbytes='$longdblnanbytes'
24572 longdblsize='$longdblsize'
24573 longlongsize='$longlongsize'
24574 longsize='$longsize'
24578 lseeksize='$lseeksize'
24579 lseektype='$lseektype'
24583 make_set_make='$make_set_make'
24584 mallocobj='$mallocobj'
24585 mallocsrc='$mallocsrc'
24586 malloctype='$malloctype'
24588 man1direxp='$man1direxp'
24591 man3direxp='$man3direxp'
24593 mips_type='$mips_type'
24594 mistrustnm='$mistrustnm'
24596 mmaptype='$mmaptype'
24597 modetype='$modetype'
24599 multiarch='$multiarch'
24601 myarchname='$myarchname'
24602 mydomain='$mydomain'
24603 myhostname='$myhostname'
24606 need_va_copy='$need_va_copy'
24607 netdb_hlen_type='$netdb_hlen_type'
24608 netdb_host_type='$netdb_host_type'
24609 netdb_name_type='$netdb_name_type'
24610 netdb_net_type='$netdb_net_type'
24613 nm_so_opt='$nm_so_opt'
24614 nonxs_ext='$nonxs_ext'
24616 nvEUformat='$nvEUformat'
24617 nvFUformat='$nvFUformat'
24618 nvGUformat='$nvGUformat'
24619 nv_overflows_integers_at='$nv_overflows_integers_at'
24620 nv_preserves_uv_bits='$nv_preserves_uv_bits'
24621 nveformat='$nveformat'
24622 nvfformat='$nvfformat'
24623 nvgformat='$nvgformat'
24624 nvmantbits='$nvmantbits'
24627 o_nonblock='$o_nonblock'
24629 old_pthread_create_joinable='$old_pthread_create_joinable'
24630 optimize='$optimize'
24631 orderlib='$orderlib'
24634 otherlibdirs='$otherlibdirs'
24638 patchlevel='$patchlevel'
24639 path_sep='$path_sep'
24642 perl_patchlevel='$perl_patchlevel'
24643 perl_static_inline='$perl_static_inline'
24644 perladmin='$perladmin'
24645 perllibs='$perllibs'
24646 perlpath='$perlpath'
24648 phostname='$phostname'
24654 prefixexp='$prefixexp'
24656 privlibexp='$privlibexp'
24657 procselfexe='$procselfexe'
24659 quadkind='$quadkind'
24660 quadtype='$quadtype'
24661 randbits='$randbits'
24662 randfunc='$randfunc'
24663 random_r_proto='$random_r_proto'
24664 randseedtype='$randseedtype'
24666 rd_nodata='$rd_nodata'
24667 readdir64_r_proto='$readdir64_r_proto'
24668 readdir_r_proto='$readdir_r_proto'
24669 revision='$revision'
24675 sGMTIME_max='$sGMTIME_max'
24676 sGMTIME_min='$sGMTIME_min'
24677 sLOCALTIME_max='$sLOCALTIME_max'
24678 sLOCALTIME_min='$sLOCALTIME_min'
24679 sPRIEUldbl='$sPRIEUldbl'
24680 sPRIFUldbl='$sPRIFUldbl'
24681 sPRIGUldbl='$sPRIGUldbl'
24682 sPRIXU64='$sPRIXU64'
24684 sPRIeldbl='$sPRIeldbl'
24685 sPRIfldbl='$sPRIfldbl'
24686 sPRIgldbl='$sPRIgldbl'
24691 sSCNfldbl='$sSCNfldbl'
24692 sched_yield='$sched_yield'
24693 scriptdir='$scriptdir'
24694 scriptdirexp='$scriptdirexp'
24696 seedfunc='$seedfunc'
24697 selectminbits='$selectminbits'
24698 selecttype='$selecttype'
24699 sendmail='$sendmail'
24700 setgrent_r_proto='$setgrent_r_proto'
24701 sethostent_r_proto='$sethostent_r_proto'
24702 setlocale_r_proto='$setlocale_r_proto'
24703 setnetent_r_proto='$setnetent_r_proto'
24704 setprotoent_r_proto='$setprotoent_r_proto'
24705 setpwent_r_proto='$setpwent_r_proto'
24706 setservent_r_proto='$setservent_r_proto'
24709 sharpbang='$sharpbang'
24710 shmattype='$shmattype'
24711 shortsize='$shortsize'
24714 sig_count='$sig_count'
24715 sig_name='$sig_name'
24716 sig_name_init='$sig_name_init'
24718 sig_num_init='$sig_num_init'
24719 sig_size='$sig_size'
24720 signal_t='$signal_t'
24721 sitearch='$sitearch'
24722 sitearchexp='$sitearchexp'
24724 sitebinexp='$sitebinexp'
24725 sitehtml1dir='$sitehtml1dir'
24726 sitehtml1direxp='$sitehtml1direxp'
24727 sitehtml3dir='$sitehtml3dir'
24728 sitehtml3direxp='$sitehtml3direxp'
24730 sitelib_stem='$sitelib_stem'
24731 sitelibexp='$sitelibexp'
24732 siteman1dir='$siteman1dir'
24733 siteman1direxp='$siteman1direxp'
24734 siteman3dir='$siteman3dir'
24735 siteman3direxp='$siteman3direxp'
24736 siteprefix='$siteprefix'
24737 siteprefixexp='$siteprefixexp'
24738 sitescript='$sitescript'
24739 sitescriptexp='$sitescriptexp'
24740 sizesize='$sizesize'
24741 sizetype='$sizetype'
24745 sockethdr='$sockethdr'
24746 socketlib='$socketlib'
24747 socksizetype='$socksizetype'
24749 spackage='$spackage'
24750 spitshell='$spitshell'
24751 srand48_r_proto='$srand48_r_proto'
24752 srandom_r_proto='$srandom_r_proto'
24754 ssizetype='$ssizetype'
24755 st_ino_sign='$st_ino_sign'
24756 st_ino_size='$st_ino_size'
24757 startperl='$startperl'
24759 static_ext='$static_ext'
24761 stdio_base='$stdio_base'
24762 stdio_bufsiz='$stdio_bufsiz'
24763 stdio_cnt='$stdio_cnt'
24764 stdio_filbuf='$stdio_filbuf'
24765 stdio_ptr='$stdio_ptr'
24766 stdio_stream_array='$stdio_stream_array'
24767 strerror_r_proto='$strerror_r_proto'
24769 subversion='$subversion'
24774 targetarch='$targetarch'
24775 targetdir='$targetdir'
24776 targetenv='$targetenv'
24777 targethost='$targethost'
24778 targetmkdir='$targetmkdir'
24779 targetport='$targetport'
24780 targetsh='$targetsh'
24784 timeincl='$timeincl'
24785 timetype='$timetype'
24786 tmpnam_r_proto='$tmpnam_r_proto'
24792 ttyname_r_proto='$ttyname_r_proto'
24801 uidformat='$uidformat'
24807 uquadtype='$uquadtype'
24808 use5005threads='$use5005threads'
24809 use64bitall='$use64bitall'
24810 use64bitint='$use64bitint'
24811 usecbacktrace='$usecbacktrace'
24812 usecrosscompile='$usecrosscompile'
24813 usedevel='$usedevel'
24815 usedtrace='$usedtrace'
24816 usefaststdio='$usefaststdio'
24817 useithreads='$useithreads'
24818 usekernprocpathname='$usekernprocpathname'
24819 uselargefiles='$uselargefiles'
24820 uselongdouble='$uselongdouble'
24821 usemallocwrap='$usemallocwrap'
24822 usemorebits='$usemorebits'
24823 usemultiplicity='$usemultiplicity'
24824 usemymalloc='$usemymalloc'
24826 usensgetexecutablepath='$usensgetexecutablepath'
24827 useopcode='$useopcode'
24828 useperlio='$useperlio'
24829 useposix='$useposix'
24830 usequadmath='$usequadmath'
24831 usereentrant='$usereentrant'
24832 userelocatableinc='$userelocatableinc'
24833 useshrplib='$useshrplib'
24834 usesitecustomize='$usesitecustomize'
24835 usesocks='$usesocks'
24836 usethreads='$usethreads'
24837 usevendorprefix='$usevendorprefix'
24838 useversionedarchname='$useversionedarchname'
24839 usevfork='$usevfork'
24842 uvXUformat='$uvXUformat'
24843 uvoformat='$uvoformat'
24846 uvuformat='$uvuformat'
24847 uvxformat='$uvxformat'
24848 vendorarch='$vendorarch'
24849 vendorarchexp='$vendorarchexp'
24850 vendorbin='$vendorbin'
24851 vendorbinexp='$vendorbinexp'
24852 vendorhtml1dir='$vendorhtml1dir'
24853 vendorhtml1direxp='$vendorhtml1direxp'
24854 vendorhtml3dir='$vendorhtml3dir'
24855 vendorhtml3direxp='$vendorhtml3direxp'
24856 vendorlib='$vendorlib'
24857 vendorlib_stem='$vendorlib_stem'
24858 vendorlibexp='$vendorlibexp'
24859 vendorman1dir='$vendorman1dir'
24860 vendorman1direxp='$vendorman1direxp'
24861 vendorman3dir='$vendorman3dir'
24862 vendorman3direxp='$vendorman3direxp'
24863 vendorprefix='$vendorprefix'
24864 vendorprefixexp='$vendorprefixexp'
24865 vendorscript='$vendorscript'
24866 vendorscriptexp='$vendorscriptexp'
24868 version_patchlevel_string='$version_patchlevel_string'
24869 versiononly='$versiononly'
24873 yaccflags='$yaccflags'
24878 : add special variables
24879 $test -f $src/patchlevel.h && \
24880 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
24881 echo "PERL_PATCHLEVEL='$perl_patchlevel'" >>config.sh
24882 echo "PERL_CONFIG_SH=true" >>config.sh
24884 : propagate old symbols
24885 if $test -f UU/config.sh; then
24886 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
24887 $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \
24888 config.sh config.sh UU/oldconfig.sh |\
24889 $sort | $uniq -u >UU/oldsyms
24890 set X `$cat UU/oldsyms`
24896 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
24898 echo ": Variables propagated from previous config.sh file." >>config.sh
24899 for sym in `$cat UU/oldsyms`; do
24900 echo " Propagating $hint variable "'$'"$sym..."
24901 eval 'tmp="$'"${sym}"'"'
24903 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
24909 : preserve RCS keywords in files with variable substitution, grrr
24912 : Finish up by extracting the .SH files
24915 echo "Stopping at your request, leaving temporary files around."
24925 If you'd like to make any changes to the config.sh file before I begin
24926 to configure things, do it as a shell escape now (e.g. !vi config.sh).
24929 rp="Press return or use a shell escape to edit config.sh:"
24934 *) : in case they cannot read
24935 sh 1>&4 -c "$ans";;
24940 : if this fails, just run all the .SH files by hand
24949 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
24956 Now you need to generate make dependencies by running "$make depend".
24957 You might prefer to run it in background: "$make depend > makedepend.out &"
24958 It can take a while, so you might not want to run it right now.
24963 rp="Run $make depend now?"
24967 $make depend && echo "Now you must run '$make'."
24970 echo "You must run '$make depend' then '$make'."
24973 elif test -f [Mm]akefile; then
24975 echo "Now you must run a $make."
24977 echo "Configure done."
24980 if $test -f Policy.sh; then
24983 If you compile $package on a different machine or from a different object
24984 directory, copy the Policy.sh file from this object directory to the
24985 new one before you run Configure -- this will help you with most of
24986 the policy defaults.
24990 if $test -f UU/config.msg; then
24991 echo "Hmm. I also noted the following information while running:"
24993 $cat UU/config.msg >&4
24995 $rm -f kit*isdone ark*isdone