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
346 useversionedarchname=''
352 initialinstalllocation=''
385 d_attribute_deprecated=''
386 d_attribute_format=''
387 d_attribute_malloc=''
388 d_attribute_nonnull=''
389 d_attribute_noreturn=''
391 d_attribute_unused=''
392 d_attribute_warn_unused_result=''
393 d_printf_format_null=''
395 d_builtin_choose_expr=''
397 d_builtin_add_overflow=''
398 d_builtin_mul_overflow=''
399 d_builtin_sub_overflow=''
400 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=''
700 d_thread_safe_nl_langinfo_l=''
714 d_old_pthread_create_joinable=''
715 old_pthread_create_joinable=''
717 d_pthread_attr_setscope=''
762 sethostent_r_proto=''
767 d_setlocale_accepts_any_locale_name=''
781 setprotoent_r_proto=''
793 setservent_r_proto=''
806 d_siginfo_si_errno=''
809 d_siginfo_si_status=''
811 d_siginfo_si_value=''
823 d_ipv6_mreq_source=''
852 perl_static_inline=''
857 d_stdio_ptr_lval_nochange_cnt=''
858 d_stdio_ptr_lval_sets_cnt=''
940 default_inc_excludes_dot=''
1006 d_gdbm_ndbm_h_uses_prototypes=''
1007 d_gdbmndbm_h_uses_prototypes=''
1009 d_ndbm_h_uses_prototypes=''
1080 d_inc_version_list=''
1082 inc_version_list_init=''
1090 installusrbinperl=''
1106 ignore_versioned_solibs=''
1122 d_double_has_negative_zero=''
1123 d_double_has_subnormals=''
1124 d_double_style_cray=''
1125 d_double_style_ibm=''
1126 d_double_style_ieee=''
1127 d_double_style_vax=''
1178 d_perl_otherlibdirs=''
1186 api_versionstring=''
1192 version_patchlevel_string=''
1196 d_nv_preserves_uv=''
1197 d_nv_zero_is_allbits_zero=''
1208 nv_overflows_integers_at=''
1209 nv_preserves_uv_bits=''
1281 installsitehtml1dir=''
1284 installsitehtml3dir=''
1291 installsiteman1dir=''
1294 installsiteman3dir=''
1299 installsitescript=''
1317 d_stdio_stream_array=''
1318 stdio_stream_array=''
1336 usekernprocpathname=''
1337 ccflags_uselargefiles=''
1338 ldflags_uselargefiles=''
1339 libswanted_uselargefiles=''
1348 usensgetexecutablepath=''
1361 installvendorarch=''
1368 installvendorhtml1dir=''
1370 vendorhtml1direxp=''
1371 installvendorhtml3dir=''
1373 vendorhtml3direxp=''
1379 installvendorman1dir=''
1382 installvendorman3dir=''
1389 installvendorscript=''
1400 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1403 : We must find out about Eunice early
1405 if test -f /etc/unixtovms; then
1406 eunicefix=/etc/unixtovms
1408 if test -f /etc/unixtovms.exe; then
1409 eunicefix=/etc/unixtovms.exe
1412 : Set executable suffix now -- needed before hints available
1413 if test -f "/libs/version.library"; then
1416 elif test -f "/system/gnu_library/bin/ar.pm"; then
1419 elif test -n "$DJGPP"; then
1422 elif test -f /kern/cookiejar; then
1425 elif test -d c:/. -o -n "$is_os2" ; then
1432 : Possible local include directories to search.
1433 : Set locincpth to "" in a hint file to defeat local include searches.
1434 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1435 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1437 : no include file wanted by default
1440 : Enable -DEBUGGING and -DDEBUGGING from the command line
1444 : Trailing extension. Override this in a hint file, if needed.
1445 : Extra object files, if any, needed on this platform.
1448 : change the next line if compiling for Xenix/286 on Xenix/386
1449 xlibpth='/usr/lib/386 /lib/386'
1450 : Possible local library directories to search.
1451 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1452 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1454 : general looking path for locating libraries
1455 glibpth="/lib /usr/lib $xlibpth"
1456 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1457 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1458 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1459 test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
1461 : Private path used by Configure to find libraries. Its value
1462 : is prepended to libpth. This variable takes care of special
1463 : machines, like the mips. Usually, it should be empty.
1466 : default library list
1468 : some systems want to use only the non-versioned libso:s
1469 ignore_versioned_solibs=''
1473 : set useposix=false in your hint file to disable the POSIX extension.
1475 : set useopcode=false in your hint file to disable the Opcode extension.
1477 : set uselanginfo=false in your hint file to disable the I18N::Langinfo extension.
1480 ccflags_uselargefiles=''
1481 ldflags_uselargefiles=''
1482 libswanted_uselargefiles=''
1483 : set usemultiplicity on the Configure command line to enable multiplicity.
1484 : set usesocks on the Configure command line to enable socks.
1486 : set usethreads on the Configure command line to enable threads.
1487 usereentrant='undef'
1488 : List of libraries we want.
1489 : If anyone needs extra -lxxx, put those in a hint file.
1490 libswanted="cl pthread socket bind inet nsl ndbm gdbm dbm db malloc dl ld"
1491 libswanted="$libswanted sun m crypt sec util c cposix posix ucb bsd BSD"
1492 : We probably want to search /usr/shlib before most other libraries.
1493 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1494 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1495 glibpth="/usr/shlib $glibpth"
1496 : Do not use vfork unless overridden by a hint file.
1499 : Find the basic shell for Bourne shell scripts
1503 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1506 if test -f "$xxx"; then
1509 : Build up a list and do a single loop so we can 'break' out.
1510 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1511 for xxx in sh bash ksh pdksh ash; do
1513 try="$try ${p}/${xxx}"
1517 if test -f "$xxx"; then
1520 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1523 elif test -f "$xxx.exe"; then
1534 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1536 Usually it's in /bin/sh. How did you even get this far?
1537 Please contact me (Perl Maintainers) at perlbug@perl.org and
1538 we'll try to straighten this all out.
1544 : When cross-compiling we need to separate the sh-to-run-Configure-with from the sh-to-use-in-Perl
1545 : default both to the same thing, cross-compilers can then set targetsh differently if they like
1548 : see if sh knows # comments
1549 if `$sh -c '#' >/dev/null 2>&1`; then
1553 test -f $xcat$_exe || xcat=/usr/bin/cat
1554 if test ! -f $xcat$_exe; then
1555 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1556 if test -f $p/cat$_exe; then
1561 if test ! -f $xcat$_exe; then
1562 echo "Can't find cat anywhere!"
1566 echo "#!$xcat" >sharp
1569 ./sharp > today 2>/dev/null
1570 if test -s today; then
1573 echo "#! $xcat" > sharp
1576 ./sharp > today 2>/dev/null
1577 if test -s today; then
1585 echo "Your $sh doesn't grok # comments--I will strip them later on."
1588 echo "exec grep -v '^[ ]*#'" >spitshell
1590 $eunicefix spitshell
1591 spitshell=`pwd`/spitshell
1593 echo "I presume that if # doesn't work, #! won't work either!"
1598 : figure out how to guarantee sh startup
1600 '') startsh=${sharpbang}${sh} ;;
1612 : echo "Yup, it does."
1614 echo "Hmm... '$startsh' does not guarantee sh startup..."
1615 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1619 : Save command line options in file UU/cmdline.opt for later use in
1620 : generating config.sh.
1621 cat > cmdline.opt <<EOSH
1622 : Configure command line arguments.
1631 cat >>cmdline.opt <<EOSH
1632 config_arg$argn='$arg'
1634 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1637 arg_exp=`cat cmdl.opt`
1638 args_exp="$args_exp$args_sep'$arg_exp'"
1639 argn=`expr $argn + 1`
1644 : produce awk script to parse command line options
1645 cat >options.awk <<'EOF'
1647 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1649 len = length(optstr);
1650 for (i = 1; i <= len; i++) {
1651 c = substr(optstr, i, 1);
1652 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1663 if (substr(str, 1, 1) != "-") {
1664 printf("'%s'\n", str);
1668 for (i = 2; i <= len; i++) {
1669 c = substr(str, i, 1);
1671 printf("-%s\n", substr(str, i));
1677 printf("'%s'\n", substr(str, i + 1));
1690 : process the command line options
1691 set X `for arg in "$@"; do echo "X$arg"; done |
1692 sed -e s/X// | awk -f options.awk`
1697 : set up default values
1706 rm -f optdef.sh posthint.sh
1707 cat >optdef.sh <<EOS
1713 while test $# -gt 0; do
1715 -d) shift; fastread=yes;;
1716 -e) shift; alldone=cont;;
1720 if test -r "$1"; then
1723 echo "$me: cannot read config file $1." >&2
1729 -h) shift; error=true;;
1730 -r) shift; reuseval=true;;
1731 -s) shift; silent=true; realsilent=true;;
1732 -E) shift; alldone=exit;;
1733 -K) shift; knowitall=true;;
1735 -S) shift; silent=true; extractsh=true;;
1740 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1741 echo "$me: ignoring -D $1" >&2
1744 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1745 *) echo "$1='define'" >> optdef.sh;;
1752 *=) echo "$1" >> optdef.sh;;
1754 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1755 echo "$me: ignoring -U $1" >&2
1757 *) echo "$1='undef'" >> optdef.sh;;
1768 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1772 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1773 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1779 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1780 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1781 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1782 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1783 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1784 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1790 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1792 echo "$yyy=''" >> posthint.sh ;;
1797 echo "$yyy='$zzz'" >> posthint.sh ;;
1799 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1801 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1806 echo "$yyy=$zzz" >> posthint.sh ;;
1807 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1811 -V) echo "$me generated by metaconfig 3.5 PL0." >&2
1814 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1822 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1823 [-U symbol] [-U symbol=] [-A command:symbol...]
1824 -d : use defaults for all answers.
1825 -e : go on without questioning past the production of config.sh.
1826 -f : specify an alternate default configuration file.
1827 -h : print this help message and exit (with an error status).
1828 -r : reuse C symbols value if possible (skips costly nm extraction).
1829 -s : silent mode, only echoes questions and essential information.
1830 -D : define symbol to have some value:
1831 -D symbol symbol gets the value 'define'
1832 -D symbol=value symbol gets the value 'value'
1833 common used examples (see INSTALL for more info):
1834 -Duse64bitint use 64bit integers
1835 -Duse64bitall use 64bit integers and pointers
1836 -Dusethreads use thread support
1837 -Dinc_version_list=none do not include older perl trees in @INC
1838 -DEBUGGING=none DEBUGGING options
1839 -Dcc=gcc choose your compiler
1840 -Dprefix=/opt/perl5 choose your destination
1841 -E : stop at the end of questions, after having produced config.sh.
1842 -K : do not use unless you know what you are doing.
1843 -O : ignored for backward compatibility
1844 -S : perform variable substitutions on all .SH files (can mix with -f)
1845 -U : undefine symbol:
1846 -U symbol symbol gets the value 'undef'
1847 -U symbol= symbol gets completely empty
1849 -A : manipulate symbol after the platform specific hints have been applied:
1850 -A append:symbol=value append value to symbol
1851 -A symbol=value like append:, but with a separating space
1852 -A define:symbol=value define symbol to have value
1853 -A clear:symbol define symbol to be ''
1854 -A define:symbol define symbol to be 'define'
1855 -A eval:symbol=value define symbol to be eval of value
1856 -A prepend:symbol=value prepend value to symbol
1857 -A undef:symbol define symbol to be 'undef'
1858 -A undef:symbol= define symbol to be ''
1859 e.g.: -A prepend:libswanted='cl pthread '
1860 -A ccflags=-DSOME_MACRO
1861 -V : print version number and exit (with a zero status).
1868 case "$fastread$alldone" in
1871 case "$extractsh" in
1874 if test ! -t 0; then
1875 echo "Say 'sh Configure', not 'sh <Configure'"
1885 true) exec 1>/dev/null;;
1888 : run the defines and the undefines, if any, but leave the file out there...
1890 grep '\\' optdef.sh >/dev/null 2>&1
1891 if test $? = 0; then
1892 echo "Configure does not support \\ in -D arguments"
1896 : create the posthint manipulation script and leave the file out there...
1901 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1902 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1903 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`"-"`echo AbyZ | tr '[:upper:]' '[:lower:]' 2>/dev/null`" in
1904 ABYZ-abyz) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1905 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1908 : Some greps do not return status, grrr.
1909 echo "grimblepritz" >grimble
1910 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1912 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1918 : the following should work in any shell
1922 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1923 cat >contains <<'EOSS'
1924 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1929 : Find the path to the source tree
1932 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1936 *) src=`cd ../$src && pwd` ;;
1949 if test -f $rsrc/Configure && \
1950 $contains "^package='$package'\$" $rsrc/Configure >/dev/null 2>&1
1952 : found it, so we are ok.
1955 for src in . .. ../.. ../../.. ../../../..; do
1956 if test -f ../$src/Configure && \
1957 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1968 Sorry, I can't seem to locate the source dir for $package. Please start
1969 Configure with an explicit path -- i.e. /some/path/Configure.
1977 echo "Sources for $package found in \"$src\"." >&4
1981 : script used to extract .SH files with variable substitutions
1982 cat >extract <<'EOS'
1984 echo "Doing variable substitutions on .SH files..."
1985 if test -f MANIFEST; then
1986 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1988 echo "(Looking for .SH files under the source directory.)"
1989 set x `(cd "$src"; find . -name "*.SH" -print)`
1993 0) set x `(cd "$src"; echo *.SH)`; shift;;
1995 if test ! -f "$src/$1"; then
2001 while test $name; do
2002 if test ! -d "$name"; then
2003 create="$name $create";
2004 name=`echo $name | sed -e "s|^[^/]*$||"`;
2005 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
2010 for file in $create; do
2019 dir=`expr X$file : 'X\(.*\)/'`
2020 file=`expr X$file : 'X.*/\(.*\)'`
2021 (cd "$dir" && . ./$file)
2031 dir=`expr X$file : 'X\(.*\)/'`
2032 file=`expr X$file : 'X.*/\(.*\)'`
2033 (set x $dir; shift; eval $mkdir_p)
2034 sh <"$src/$dir/$file"
2043 if test -f "$src/config_h.SH"; then
2044 if test ! -f config.h; then
2045 : oops, they left it out of MANIFEST, probably, so do it anyway.
2046 . "$src/config_h.SH"
2051 : extract files and exit if asked to do so
2052 case "$extractsh" in
2054 case "$realsilent" in
2058 case "$config_sh" in
2059 '') config_sh='config.sh';;
2062 echo "Fetching answers from $config_sh..."
2069 echo "Extraction done."
2074 : Eunice requires " " instead of "", can you believe it
2077 echo "Beginning of configuration questions for $package."
2079 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
2081 : first determine how to suppress newline on echo command
2083 echo "Checking echo to see how to suppress newlines..."
2084 (echo "hi there\c" ; echo " ") >.echotmp
2085 if $contains c .echotmp >/dev/null 2>&1 ; then
2096 echo $n "The star should be here-->$c"
2100 : Now test for existence of everything in MANIFEST
2102 if test -f "$rsrc/MANIFEST"; then
2103 echo "First let's make sure your kit is complete. Checking..." >&4
2104 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | \
2105 (split -l 50 2>/dev/null || split -50)
2108 for filelist in x??; do
2109 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` \
2110 >/dev/null 2>>"$tmppwd/missing")
2112 if test -s missing; then
2116 THIS PACKAGE SEEMS TO BE INCOMPLETE.
2118 You have the option of continuing the configuration process, despite the
2119 distinct possibility that your kit is damaged, by typing 'y'es. If you
2120 do, don't blame me if something goes wrong. I advise you to type 'n'o
2121 and contact the author (perlbug@perl.org).
2124 echo $n "Continue? [n] $c" >&4
2128 echo "Continuing..." >&4
2132 echo "ABORTING..." >&4
2137 echo "Looks good..."
2140 echo "There is no MANIFEST file. I hope your kit is complete !"
2144 : Find the appropriate value for a newline for tr
2145 if test -n "$DJGPP"; then
2148 if test X"$trnl" = X; then
2149 case "`echo foo | tr '\n' x 2>/dev/null`" in
2153 if test X"$trnl" = X; then
2154 case "`echo foo | tr '\012' x 2>/dev/null`" in
2155 foox) trnl='\012' ;;
2158 if test X"$trnl" = X; then
2159 case "`echo foo | tr '\r\n' xy 2>/dev/null`" in
2160 fooxy) trnl='\n\r' ;;
2163 if test X"$trnl" = X; then
2166 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
2172 : compute the number of columns on the terminal for proper question formatting
2177 : set up the echo used in my read
2178 myecho="case \"\$xxxm\" in
2179 '') echo $n \"\$rp $c\" >&4;;
2181 '') echo $n \"[\$xxxm] $c\";;
2183 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
2185 echo $n \"[\$xxxm] $c\" >&4
2187 echo $n \"\$rp [\$xxxm] $c\" >&4
2193 : now set up to do reads with possible shell escape and default assignment
2199 case "\$fastread" in
2200 yes) case "\$dflt" in
2203 case "\$silent-\$rp" in
2208 *) case "\$silent" in
2209 true) case "\$rp" in
2214 while expr "X\$ans" : "X!" >/dev/null; do
2218 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2226 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2235 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2240 echo "(OK, I'll run with -d after this question.)" >&4
2243 echo "*** Sorry, \$1 not supported yet." >&4
2253 echo "*** Substitution done -- please confirm."
2255 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2260 echo "*** Error -- try again."
2267 case "\$ans\$xxxm\$nostick" in
2279 : create .config dir to save info across Configure sessions
2280 test -d ../.config || mkdir ../.config
2281 cat >../.config/README <<EOF
2282 This directory created by Configure to save information that should
2283 persist across sessions for $package.
2285 You may safely delete it if you wish.
2288 : See if we are using a devel version and want that
2289 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2292 usedevel="$define" ;;
2293 *) case "$xversion" in
2296 *** WHOA THERE!!! ***
2298 This is an UNSTABLE DEVELOPMENT release.
2299 The version of this $package distribution is $xversion, that is, odd,
2300 (as opposed to even) and that signifies a development release.
2301 If you want a maintenance release, you want an even-numbered version.
2303 Do ***NOT*** install this into production use.
2304 Data corruption and crashes are possible.
2306 It is most seriously suggested that you do not continue any further
2307 unless you want to help in developing and debugging Perl.
2309 If you *still* want to build perl, you can answer 'y' now,
2310 or pass -Dusedevel to Configure.
2313 rp='Do you really want to continue?'
2317 [yY]) echo >&4 "Okay, continuing."
2318 usedevel="$define" ;;
2319 *) echo >&4 "Okay, bye."
2330 case "$versiononly" in
2331 '') versiononly="$define" ;;
2333 case "$installusrbinperl" in
2334 '') installusrbinperl="$undef" ;;
2339 : general instructions
2342 user=`(logname) 2>/dev/null`
2344 '') user=`whoami 2>&1`;;
2346 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2349 rp='Would you like to see the instructions?'
2360 This installation shell script will examine your system and ask you questions
2361 to determine how the perl5 package should be installed. If you get
2362 stuck on a question, you may use a ! shell escape to start a subshell or
2363 execute a command. Many of the questions will have default answers in square
2364 brackets; typing carriage return will give you the default.
2366 On some of the questions which ask for file or directory names you are allowed
2367 to use the ~name construct to specify the login directory belonging to "name",
2368 even if you don't have a shell which knows about that. Questions where this is
2369 allowed will be marked "(~name ok)".
2373 dflt='Type carriage return to continue'
2377 The prompter used in this script allows you to use shell variables and
2378 backticks in your answers. You may use $1, $2, etc... to refer to the words
2379 in the default answer, as if the default line was a set of arguments given to a
2380 script shell. This means you may also use $* to repeat the whole default line,
2381 so you do not have to re-type everything to add something to the default.
2383 Every time there is a substitution, you will have to confirm. If there is an
2384 error (e.g. an unmatched backtick), the default answer will remain unchanged
2385 and you will be prompted again.
2387 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2388 the questions and use the computed defaults (or the previous answers if there
2389 was already a config.sh file). Type 'Configure -h' for a list of options.
2390 You may also start interactively and then answer '& -d' at any prompt to turn
2391 on the non-interactive behaviour for the remainder of the execution.
2397 Much effort has been expended to ensure that this shell script will run on any
2398 Unix system. If despite that it blows up on yours, your best bet is to edit
2399 Configure and run it again. If you can't run Configure for some reason,
2400 you'll have to generate a config.sh file by hand. Whatever problems you
2401 have, let me (perlbug@perl.org) know how I blew it.
2403 This installation script affects things in two ways:
2405 1) it may do direct variable substitutions on some of the files included
2407 2) it builds a config.h file for inclusion in C programs. You may edit
2408 any of these files as the need arises after running this script.
2410 If you make a mistake on a question, there is no easy way to back up to it
2411 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2412 files. Configure will offer to let you do this before it runs the SH files.
2415 dflt='Type carriage return to continue'
2417 case "$firsttime" in
2418 true) echo $user >>../.config/instruct;;
2422 : Set 'sysroot' to change the logical root directory to your headers and libraries see man gcc
2423 : This is primarily meant for cross-compile environments, and may fail to be useful in other cases
2424 if test "X$sysroot" = X; then
2429 echo "Using $sysroot to find your headers and libraries, adding to ccflags"
2430 # _sysroot is used in places where we need --sysroot=foo
2431 # but using the rest of the flags could cause issues.
2432 _sysroot="--sysroot=$sysroot";
2436 ccflags="$ccflags $_sysroot"
2441 ldflags="$ldflags $_sysroot"
2446 cppflags="$cppflags $_sysroot"
2448 # lddlflags updated below in lddlflags section;
2449 # same with cccdlflags
2453 # Adjust some defaults to also use $sysroot
2454 for var in xlibpth loclibpth locincpth glibpth; do
2457 for path in $xxx; do
2458 eval $var=\"\$$var $sysroot$path\"
2464 : find out where common programs are
2466 echo "Locating common programs..." >&4
2479 if test -d \$dir/\$thing; then
2485 for thisthing in \$dir/\$thing; do
2486 : just loop through to pick last item
2488 if test -f \$thisthing; then
2491 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2494 elif test -f \$dir/\$thing.exe; then
2495 if test -n "$DJGPP"; then
2496 echo \$dir/\$thing.exe
2497 elif test "$eunicefix" != ":"; then
2498 : on Eunice apparently
2551 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2552 pth="$pth $sysroot/lib $sysroot/usr/lib"
2553 for file in $loclist; do
2557 if test -f "$xxx"; then
2560 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2561 xxx=`./loc $file $file $pth`
2564 '') xxx=`./loc $file $file $pth`;;
2565 *) xxx=`./loc $xxx $xxx $pth`;;
2567 eval $file=$xxx$_exe
2571 echo $file is in $xxx.
2574 echo $file is in $xxx.
2577 echo "I don't know where '$file' is, and my life depends on it." >&4
2578 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2584 echo "Don't worry if any of the following aren't found..."
2586 for file in $trylist; do
2590 if test -f "$xxx"; then
2593 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2594 xxx=`./loc $file $file $pth`
2597 '') xxx=`./loc $file $file $pth`;;
2598 *) xxx=`./loc $xxx $xxx $pth`;;
2600 eval $file=$xxx$_exe
2604 echo $file is in $xxx.
2607 echo $file is in $xxx.
2610 echo "I don't see $file out there, $say."
2617 echo "Substituting grep for egrep."
2624 *) if $less -R </dev/null >/dev/null 2>&1; then
2625 echo "Substituting less -R for less."
2633 echo "Substituting cp for ln."
2642 echo "I can't find make or gmake, and my life depends on it." >&4
2643 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2651 *) # We can't have osname yet.
2652 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2653 # Assume that gmake, if found, is definitely GNU make
2654 # and prefer it over the system make.
2655 echo "Substituting gmake for make."
2663 echo "Hopefully test is built into your sh."
2666 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2667 echo "Using the test built into your sh."
2675 echo "Hopefully echo is built into your sh."
2680 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2681 $echo $n "hi there$c" >foo1
2682 echo $n "hi there$c" >foo2
2683 if cmp foo1 foo2 >/dev/null 2>&1; then
2684 echo "They are compatible. In fact, they may be identical."
2691 They are not compatible! You are probably running ksh on a non-USG system.
2692 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2693 have echo built in and we may have to run some Bourne shell scripts. That
2694 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2697 $echo $n "The star should be here-->$c"
2704 # This question was auctioned at YAPC::Europe-2007 in Vienna
2705 # I never promised you could answer it. I only auctioned the question.
2707 The following message is sponsored by
2709 Dresden.pm<--The stars should be here.
2711 Dear Perl user, system administrator or package
2712 maintainer, the Perl community sends greetings to
2713 you. Do you (emblematical) greet back [Y/n]? n
2717 : Check what type of C compiler we use
2721 cat <<'EOSC' >>trygcc
2726 int main(int argc, char *argv[]) {
2730 if $cc -o try $ccflags $ldflags try.c; then
2733 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2739 # Skip this test because it gives a false match on output like:
2740 # ./trygcc: line 23: cc: command not found
2741 # case "`$cc -v -c try.c 2>&1`" in
2742 # *gcc*) trygcc=no ;;
2744 if $test X"$trygcc" = Xyes; then
2745 if gcc -o try -c try.c; then
2747 echo "You seem to have a working gcc, though." >&4
2748 # Switching compilers may undo the work of hints files.
2749 # The most common problem is -D_REENTRANT for threads.
2750 # This heuristic catches that case, but gets false positives
2751 # if -Dusethreads was not actually specified. Better to
2752 # bail out here with a useful message than fail
2753 # mysteriously later. Should we perhaps just try to
2754 # re-invoke Configure -Dcc=gcc config_args ?
2755 if $test -f usethreads.cbu; then
2758 *** However, any setting of the C compiler flags (e.g. for thread support)
2759 *** will be lost. It may be necessary for you to restart Configure and
2760 *** add -Dcc=gcc to your Configure command line.
2763 rp="Would you like to go ahead and try gcc anyway?"
2766 rp="Would you like to use it?"
2769 if $test -f myread; then
2772 if $test -f UU/myread; then
2775 echo "Cannot find myread, sorry. Aborting." >&2
2780 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2793 cat <<'EOSC' >>checkcc
2798 int main(int argc, char *argv[]) {
2802 if $cc -o try $ccflags $ldflags try.c; then
2805 if $test X"$despair" = Xyes; then
2806 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2809 You need to find a working C compiler.
2810 Either (purchase and) install the C compiler supplied by your OS vendor,
2811 or for a free C compiler try http://gcc.gnu.org/
2812 I cannot continue any further, aborting.
2821 : determine whether symbolic links are supported
2824 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2825 echo "Symbolic links are supported." >&4
2828 echo "Symbolic links are NOT supported." >&4
2833 : determine whether symbolic links are supported
2837 echo "Checking how to test for symbolic links..." >&4
2839 if $test "X$issymlink" = X; then
2841 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2842 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2844 if test $? = 0; then
2847 echo "Your builtin 'test -h' may be broken." >&4
2850 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2853 if test -f "$p/$test"; then
2862 echo "Trying external '$test -h'." >&4
2863 issymlink="$test -h"
2864 if $test ! -h sym >/dev/null 2>&1; then
2865 echo "External '$test -h' is broken, too." >&4
2873 if $test "X$issymlink" = X; then
2874 if $test -L sym 2>/dev/null; then
2875 issymlink="$test -L"
2876 echo "The builtin '$test -L' worked." >&4
2879 if $test "X$issymlink" != X; then
2880 echo "You can test for symbolic links with '$issymlink'." >&4
2882 echo "I do not know how you can test for symbolic links." >&4
2886 *) echo "No symbolic links, so not testing for their testing..." >&4
2890 : Make symlinks util
2891 case "$mksymlinks" in
2894 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2897 *) case "$lns:$issymlink" in
2898 *"ln"*" -s:"*"test -"?)
2899 echo "Creating the symbolic links..." >&4
2901 awk '{print $1}' $src/MANIFEST | sed -e 's:/\([^/]*\)$: \1:' |
2911 print "# dir = ", dir, "file = ", file
2912 mf[dir] = mf[dir]" "source"/"dir"/"file;
2915 if (d != ".") { print("mkdir -p "d) }
2916 print("ln -sf "mf[d]" "d);
2918 }' source="$src" > UU/mksymlinks.$$
2922 if test ! -d t/base; then
2923 echo "Failed to create the subdirectories. Aborting." >&4
2927 if test ! -f t/base/lex.t; then
2928 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2931 if test ! -f win32/win32.c; then
2932 echo "Failed to create the symlinks (win32/win32.c missing). Aborting." >&4
2937 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2945 : Check for Cross-Compilation
2946 if $test "X$targethost" = "X"; then
2949 if $test "X$targetenv" = "X"; then
2952 case "$usecrosscompile" in
2954 $echo "Cross-compiling..."
2957 *-gcc*|*-g++*) # A cross-compiling gcc, probably.
2958 # arm-linux-androideabi-gcc -> arm-linux-androideabi
2959 # x86_64-w64-mingw32-gcc.exe -> x86_64-w64-mingw32
2960 targetarch=`$echo $cc|$sed 's/-g[c\+][c\+].*$//'`
2961 ar=`$echo $cc|$sed 's/-g[c\+][c\+]/-ar/'`
2962 # leave out ld, choosing it is more complex
2963 nm=`$echo $cc|$sed 's/-g[c\+][c\+]/-nm/'`
2964 ranlib=`$echo $cc|$sed 's/-g[c\+][c\+]/-ranlib/'`
2965 # We are in a weird spot. Just before us, some values
2966 # were 'saved', to be restored after the hints are
2967 # run. This means that the changes we made to ar,
2968 # nm and ranlib will get reverted.
2969 # To avoid that, we hijack the saving mechanism and
2970 # have it save our new values.
2971 for file in ar nm ranlib; do
2973 eval $file=$xxx$_exe
2978 case "$targetarch" in
2979 '') echo "Targetarch not defined." >&4; croak=y ;;
2980 *) echo "Using targetarch $targetarch." >&4 ;;
2982 case "$targethost" in
2983 '') echo "Targethost not defined." >&4; croak=n ;;
2984 *) echo "Using targethost $targethost." >&4
2989 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2991 : compile a host miniperl and generate_uudmap, unless we got passed them
2992 if $test "X$hostperl" = X; then
2993 echo "Building host miniperl and generate_uudmap binaries" >&4
3001 $src/Configure -des -Dusedevel -Dmksymlinks
3003 case "$hostgenerate" in
3004 '') $make generate_uudmap
3005 hostgenerate=$src/host/generate_uudmap
3007 "$undef") hostgenerate=''
3010 hostperl=$src/host/miniperl
3013 hostosname=`$hostperl -le 'print $^O'`
3016 usecrosscompile="$undef"
3020 : Define -Dtargethost=somecomputer to run compiled tests on another machine
3021 case "$targethost" in
3022 '') echo "Checking for cross-compile" >&4
3023 case "$usecrosscompile$multiarch" in
3024 *$define*) echo "Skipping the try tests in the rest of Configure as no targethost was defined when cross-compiling" >&4
3025 if [ -f Makefile ]; then
3027 echo "Now you must ensure config.sh, config.h and the generated headers exist and run a $make."
3029 echo "Configure done."
3033 *) echo "No targethost for running compiler tests against defined, running locally" >&4
3040 *) echo "Using targethost $targethost." >&4
3042 /*) run=$src/Cross/run
3043 targetmkdir=$src/Cross/mkdir
3045 from=$src/Cross/from
3047 *) pwd=`$test -f ../Configure & cd ..; pwd`
3049 targetmkdir=$pwd/Cross/mkdir
3051 from=$pwd/Cross/from
3054 case "$targetrun" in
3055 '') targetrun=ssh ;;
3060 case "$targetfrom" in
3061 '') targetfrom=scp ;;
3065 from=$from-$targetfrom
3066 case "$targetdir" in
3068 echo "Guessing targetdir $targetdir." >&4
3071 case "$targetuser" in
3073 echo "Guessing targetuser $targetuser." >&4
3076 case "$targetport" in
3078 echo "Guessing targetport $targetport." >&4
3081 case "$targetfrom" in
3085 case "$targetrun" in
3105 '') cwd=$targetdir ;;
3110 $targetrun -p $targetport -l $targetuser $targethost "cd \$cwd && \$env \$exe \$@"
3116 *) echo "Unknown targetrun '$targetrun'" >&4
3120 case "$targetmkdir" in
3122 cat >$targetmkdir <<EOF
3124 $targetrun -p $targetport -l $targetuser $targethost "mkdir -p \$@"
3126 $chmod a+rx $targetmkdir
3128 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
3140 $targetmkdir \`dirname \$f\`
3141 $targetto -P $targetport -r $q \$f $targetuser@$targethost:\$f 2>/dev/null || exit 1
3144 $targetmkdir $targetdir/\`dirname \$f\`
3145 $targetto -P $targetport -r $q \$f $targetuser@$targethost:$targetdir/\$f 2>/dev/null || exit 1
3158 $mkdir -p $targetdir/\`dirname \$f\`
3159 $cp \$f $targetdir/\$f || exit 1
3162 $targetmkdir $targetdir/\`dirname \$f\`
3163 $cp \$f $targetdir/\$f || exit 1
3170 *) echo "Unknown targetto '$targetto'" >&4
3174 case "$targetfrom" in
3181 $targetfrom -P $targetport $q $targetuser@$targethost:$targetdir/\$f . || exit 1
3186 cp) cat >$from <<EOF
3191 cp $targetdir/\$f . || exit 1
3196 *) echo "Unknown targetfrom '$targetfrom'" >&4
3200 if $test ! -f $run; then
3201 echo "Target 'run' script '$run' not found." >&4
3205 if $test ! -f $to; then
3206 echo "Target 'to' script '$to' not found." >&4
3210 if $test ! -f $from; then
3211 echo "Target 'from' script '$from' not found." >&4
3215 if $test ! -f $run -o ! -f $to -o ! -f $from; then
3219 Using '$run' for remote execution,
3220 and '$from' and '$to'
3221 for remote file transfer.
3227 usecrosscompile="$undef"
3232 : see whether [:lower:] and [:upper:] are supported character classes
3234 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`"-"`echo AbyZ | $tr '[:upper:]' '[:lower:]' 2>/dev/null`" in
3236 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
3240 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
3241 # (0xd9 and 0xe2), therefore that is a nice testing point.
3242 if test "X$up" = X -o "X$low" = X; then
3243 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
3249 if test "X$up" = X -o "X$low" = X; then
3250 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
3256 if test "X$up" = X -o "X$low" = X; then
3257 case "`echo RS | od -x 2>/dev/null`" in
3259 echo "Hey, this might be EBCDIC." >&4
3260 if test "X$up" = X -o "X$low" = X; then
3261 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
3262 rs) up='[A-IJ-RS-Z]'
3267 if test "X$up" = X -o "X$low" = X; then
3268 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
3278 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
3280 echo "Using $up and $low to convert case." >&4
3283 echo "I don't know how to translate letters from upper to lower case." >&4
3284 echo "Your tr is not acting any way I know of." >&4
3288 : set up the translation script tr, must be called with ./tr of course
3292 '[A-Z][a-z]') exec $tr '$up' '$low';;
3293 '[a-z][A-Z]') exec $tr '$low' '$up';;
3300 : Try to determine whether config.sh was made on this system
3301 case "$config_sh" in
3303 myuname=`$uname -a 2>/dev/null`
3304 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
3305 # Downcase everything to avoid ambiguity.
3306 # Remove slashes and single quotes so we can use parts of this in
3307 # directory and file names.
3308 # Remove newlines so myuname is sane to use elsewhere.
3309 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
3310 # because the A-Z/a-z are not consecutive.
3311 myuname=`echo $myuname | $sed -e "s,['/],,g" | \
3312 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
3313 newmyuname="$myuname"
3315 case "$knowitall" in
3317 if test -f ../config.sh; then
3318 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3319 eval "`grep myuname= ../config.sh`"
3321 if test "X$myuname" = "X$newmyuname"; then
3329 : Get old answers from old config file if Configure was run on the
3330 : same system, otherwise use the hints.
3333 if test -f config.sh; then
3335 rp="I see a config.sh file. Shall I use it to set the defaults?"
3338 n*|N*) echo "OK, I'll ignore it."
3339 mv config.sh config.sh.old
3340 myuname="$newmyuname"
3342 *) echo "Fetching default answers from your old config.sh file..." >&4
3350 : Older versions did not always set $sh. Catch re-use of such
3360 if test ! -f config.sh; then
3363 First time through, eh? I have some defaults handy for some systems
3364 that need some extra help getting the Configure answers right:
3367 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3369 : Half the following guesses are probably wrong... If you have better
3370 : tests or hints, please send them to perlbug@perl.org
3371 : The metaconfig authors would also appreciate a copy...
3372 $test -f /irix && osname=irix
3373 $test -f /xenix && osname=sco_xenix
3374 $test -f /dynix && osname=dynix
3375 $test -f /dnix && osname=dnix
3376 $test -f /lynx.os && osname=lynxos
3377 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3378 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3379 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3380 $test -f /bin/mips && /bin/mips && osname=mips
3381 $test -d /usr/apollo/bin && osname=apollo
3382 $test -f /etc/saf/_sactab && osname=svr4
3383 $test -d /usr/include/minix && osname=minix && osvers=`$uname -r`
3384 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3385 $test -f /sys/utilities/MultiView && osname=amigaos
3386 if $test -d /MachTen -o -d /MachTen_Folder; then
3388 if $test -x /sbin/version; then
3389 osvers=`/sbin/version | $awk '{print $2}' |
3390 $sed -e 's/[A-Za-z]$//'`
3391 elif $test -x /usr/etc/version; then
3392 osvers=`/usr/etc/version | $awk '{print $2}' |
3393 $sed -e 's/[A-Za-z]$//'`
3399 $test -f /sys/posix.dll &&
3400 $test -f /usr/bin/what &&
3401 set X `/usr/bin/what /sys/posix.dll` &&
3402 $test "$3" = UWIN &&
3406 if $test -f $uname; then
3414 umips) osname=umips ;;
3417 [23]100) osname=mips ;;
3419 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3420 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3423 elif $test -f /etc/kconfig; then
3425 if test "$lns" = "$ln -s"; then
3427 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3429 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3436 if test -n "$DJGPP"; then
3445 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3447 # oslevel can fail with:
3448 # oslevel: Unable to acquire lock.
3449 *not\ found) osvers="$4"."$3" ;;
3450 '<3240'|'<>3240') osvers=3.2.0 ;;
3451 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3452 '=3250'|'>3250') osvers=3.2.5 ;;
3456 bitrig) osname=bitrig
3459 bsd386) osname=bsd386
3462 cygwin*) osname=cygwin
3465 *dc.osx) osname=dcosx
3471 domainos) osname=apollo
3477 dragonfly) osname=dragonfly
3480 dynixptx*) osname=dynixptx
3481 osvers=`echo "$4"|sed 's/^v//'`
3483 freebsd) osname=freebsd
3485 genix) osname=genix ;;
3489 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3502 $test -f /system/lib/libandroid.so && osname=linux-android
3509 netbsd*) osname=netbsd
3512 news-os) osvers="$3"
3514 4*) osname=newsos4 ;;
3518 nonstop-ux) osname=nonstopux ;;
3519 openbsd) osname=openbsd
3525 POSIX-BC | posix-bc ) osname=posix-bc
3528 powerux | power_ux | powermax_os | powermaxos | \
3529 powerunix | power_unix) osname=powerux
3535 solaris) osname=solaris
3537 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3544 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3548 titanos) osname=titanos
3557 ultrix) osname=ultrix
3560 osf1|mls+) case "$5" in
3563 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3566 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3569 hp*) osname=hp_osf1 ;;
3570 mips) osname=mips_osf1 ;;
3573 # UnixWare 7.1.2 is known as Open UNIX 8
3574 openunix|unixware) osname=svr5
3582 $2) case "$osname" in
3586 : svr4.x or possibly later
3596 if test -f /stand/boot ; then
3597 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3598 if test -n "$INITPROG" -a -f "$INITPROG"; then
3599 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3600 if test -n "$isesix"; then
3608 *) if test -f /etc/systemid; then
3610 set `echo $3 | $sed 's/\./ /g'` $4
3611 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3613 elif $test -f $src/hints/sco_$1_$2.sh; then
3615 elif $test -f $src/hints/sco_$1.sh; then
3620 '') : Still unknown. Probably a generic Sys V.
3629 *) case "$osname" in
3630 '') : Still unknown. Probably a generic BSD.
3638 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3639 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3640 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3643 $rm -f UU/kernel.what
3644 elif test -d c:/. -o -n "$is_os2" ; then
3651 case "$targetarch" in
3654 case "$targetarch" in
3656 # Will load qnx.sh, which should change osname to nto
3661 # Catch arm-linux-androideabi, mipsel-linux-android,
3662 # and i686-linux-android
3663 osname=linux-android
3667 # Something like arm-linux-gnueabihf is really just
3674 # XXX perhaps we should just assume
3675 # osvers to be 2, or maybe take the value
3676 # from targetarch. Using $run before the
3677 # hints are run is somewhat icky.
3678 set X `$run $uname -a 2>/dev/null`
3681 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3686 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3693 : Now look for a hint file osname_osvers, unless one has been
3694 : specified already.
3697 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3698 : Also try without trailing minor version numbers.
3699 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3700 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3701 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3702 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3705 *) case "$osvers" in
3708 *) if $test -f $src/hints/$file.sh ; then
3710 elif $test -f $src/hints/$xfile.sh ; then
3712 elif $test -f $src/hints/$xxfile.sh ; then
3714 elif $test -f $src/hints/$xxxfile.sh ; then
3716 elif $test -f $src/hints/$xxxxfile.sh ; then
3718 elif $test -f "$src/hints/${osname}.sh" ; then
3727 if $test -f Policy.sh ; then
3730 none) dflt="Policy" ;;
3731 *) dflt="Policy $dflt" ;;
3736 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3740 if $test -f Policy.sh ; then
3743 There's also a Policy hint file available, which should make the
3744 site-specific (policy) questions easier to answer.
3751 You may give one or more space-separated answers, or "none" if appropriate.
3752 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3753 previous run of Configure, you may specify it as well as or instead of
3754 OS-specific hints. If hints are provided for your OS, you should use them:
3755 although Perl can probably be built without hints on many platforms, using
3756 hints often improve performance and may enable features that Configure can't
3757 set up on its own. If there are no hints that match your OS, specify "none";
3758 DO NOT give a wrong version or a wrong OS.
3762 rp="Which of these apply, if any?"
3765 for file in $tans; do
3766 if $test X$file = XPolicy -a -f Policy.sh; then
3768 $cat Policy.sh >> UU/config.sh
3769 elif $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"$tans" = X -o X"$tans" = Xnone ; then
3775 : Give one chance to correct a possible typo.
3776 echo "$file.sh does not exist"
3778 rp="hint to use instead?"
3780 for file in $ans; do
3781 if $test -f "$src/hints/$file.sh"; then
3782 . $src/hints/$file.sh
3783 $cat $src/hints/$file.sh >> UU/config.sh
3784 elif $test X$ans = X -o X$ans = Xnone ; then
3787 echo "$file.sh does not exist -- ignored."
3794 : Remember our hint file for later.
3795 if $test -f "$src/hints/$file.sh" ; then
3805 echo "Fetching default answers from $config_sh..." >&4
3809 cp $config_sh config.sh 2>/dev/null
3821 : Restore computed paths
3822 for file in $loclist $trylist; do
3823 eval $file="\$_$file"
3828 Configure uses the operating system name and version to set some defaults.
3829 The default value is probably right if the name rings a bell. Otherwise,
3830 since spelling matters for me, either accept the default or answer "none"
3837 ''|' '|none) dflt=none ;;
3838 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3841 *) dflt="$osname" ;;
3843 rp="Operating system name?"
3847 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3853 ''|' '|none) dflt=none ;;
3854 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3855 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3857 ''|' ') dflt=none ;;
3862 *) dflt="$osvers" ;;
3864 rp="Operating system version?"
3874 : who configured the system
3875 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3878 cf_by=`(logname) 2>/dev/null`
3881 cf_by=`(whoami) 2>/dev/null`
3883 "") cf_by=unknown ;;
3888 : decide how portable to be. Allow command line overrides.
3889 case "$d_portable" in
3891 *) d_portable="$define" ;;
3894 : set up shell script to do ~ expansion
3900 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3903 if $test -f /bin/csh; then
3904 /bin/csh -f -c "glob \$1"
3909 name=\`$expr x\$1 : '..\([^/]*\)'\`
3910 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3911 if $test ! -d "\$dir"; then
3913 echo "\$me: can't locate home directory for: \$name" >&2
3918 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3934 : now set up to get a file name
3938 cat <<'EOSC' >>getfile
3954 : getfile will accept an answer from the comma-separated list
3955 : enclosed in parentheses even if it does not meet other criteria.
3956 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3957 fn=`echo $fn | sed 's/(.*)//'`
3963 loc_file=`expr $fn : '.*:\(.*\)'`
3964 fn=`expr $fn : '\(.*\):.*'`
3972 */*) fullpath=true;;
3981 *e*) exp_file=true;;
3984 *p*) nopath_ok=true;;
3989 *d*) type='Directory';;
3990 *l*) type='Locate';;
3995 Locate) what='File';;
4000 case "$d_portable" in
4008 while test "$type"; do
4013 true) rp="$rp (~name ok)";;
4016 if test -f UU/getfile.ok && \
4017 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
4036 value=`UU/filexp $ans`
4039 if test "$ans" != "$value"; then
4040 echo "(That expands to $value on this system.)"
4054 /*) value="$ansexp" ;;
4055 [a-zA-Z]:/*) value="$ansexp" ;;
4060 echo "I shall only accept a full path name, as in /bin/ls." >&4
4061 echo "Use a ! shell escape if you wish to check pathnames." >&4
4064 echo "Please give a full path name, starting with slash." >&4
4067 echo "Note that using ~name is ok provided it expands well." >&4
4080 for fp in $gfpth; do
4081 if test "X$fp" = X.; then
4086 if test -f "$pf"; then
4088 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
4090 echo "($value is not a plain file, but that's ok.)"
4093 if test X"$type" = X; then
4100 for fp in $gfpth; do
4101 if test "X$fp" = X.; then
4106 direxp="$fp/$ansexp"
4108 if test -d "$direxp"; then
4116 if test -d "$ansexp"; then
4117 echo "(Looking for $loc_file in directory $value.)"
4118 value="$value/$loc_file"
4119 ansexp="$ansexp/$loc_file"
4121 if test -f "$ansexp"; then
4124 case "$nopath_ok" in
4125 true) case "$value" in
4127 *) echo "Assuming $value will be in people's path."
4143 if test "$fastread" = yes; then
4148 rp="$what $value doesn't exist. Use that name anyway?"
4167 test "X$gfpthkeep" != Xy && gfpth=""
4170 : determine root of directory hierarchy where package will be installed.
4173 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
4176 dflt=`echo "$prefix" | sed 's/.$//'`
4184 By default, $package will be installed in $dflt/bin, manual pages
4185 under $dflt/man, etc..., i.e. with $dflt as prefix for all
4186 installation directories. Typically this is something like /usr/local.
4187 If you wish to have binaries under /usr/bin but other parts of the
4188 installation under /usr/local, that's ok: you will be prompted
4189 separately for each of the installation directories, the prefix being
4190 only used to set the defaults.
4194 rp='Installation prefix to use?'
4202 *) oldprefix="$prefix";;
4209 : allow them to override the AFS root
4212 *) afsroot=$afsroot ;;
4218 $define|true) afs=true ;;
4219 $undef|false) afs=false ;;
4220 *) if $test -d $afsroot; then
4228 echo "AFS may be running... I'll be extra cautious then..." >&4
4230 echo "AFS does not seem to be running..." >&4
4233 : determine installation prefix for where package is to be installed.
4237 Since you are running AFS, I need to distinguish the directory in which
4238 files will reside from the directory in which they are installed (and from
4239 which they are presumably copied to the former directory by occult means).
4242 case "$installprefix" in
4243 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
4244 *) dflt="$installprefix";;
4249 In some special cases, particularly when building $package for distribution,
4250 it is convenient to distinguish the directory in which files should be
4251 installed from the directory ($prefix) in which they will
4252 eventually reside. For most users, these two directories are the same.
4255 case "$installprefix" in
4257 *) dflt=$installprefix;;
4261 rp='What installation prefix should I use for installing files?'
4263 installprefix="$ans"
4264 installprefixexp="$ansexp"
4266 : Perform the prefixexp/installprefixexp correction if necessary
4267 cat <<EOS >installprefix
4270 cat <<'EOSC' >>installprefix
4271 : Change installation prefix, if necessary.
4272 if $test X"$prefix" != X"$installprefix"; then
4273 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
4275 eval "install${prefixvar}=\"\$${prefixvar}exp\""
4278 chmod +x installprefix
4279 $eunicefix installprefix
4281 : Set variables such as privlib and privlibexp from the output of ./getfile
4282 : performing the prefixexp/installprefixexp correction if necessary.
4283 cat <<EOS >setprefixvar
4286 cat <<'EOSC' >>setprefixvar
4287 eval "${prefixvar}=\"\$ans\""
4288 eval "${prefixvar}exp=\"\$ansexp\""
4291 chmod +x setprefixvar
4292 $eunicefix setprefixvar
4294 : set up the script used to warn in case of inconsistency
4303 '') echo "The $hint value for \$$var on this machine was \"$was\"!" >&4
4305 *) echo "Hmm. Based on the hints in hints/$hintfile.sh, " >&4
4306 echo "the $hint value for \$$var on this machine was \"$was\"!" >&4
4311 echo "*** WHOA THERE!!! ***" >&4
4312 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
4315 rp=" Keep the $hint value?"
4318 y) td=$was; tu=$was;;
4322 : function used to set '$1' to '$val'
4323 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
4325 $define$undef) . ./whoa; eval "$var=\$td";;
4326 $undef$define) . ./whoa; eval "$var=\$tu";;
4327 *) eval "$var=$val";;
4330 : get the patchlevel
4332 echo "Getting the current patchlevel..." >&4
4333 if $test -r $rsrc/patchlevel.h;then
4334 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
4335 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4336 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4337 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4338 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4339 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4340 perl_patchlevel=`egrep ',"(MAINT|SMOKE)[0-9][0-9]*"' $rsrc/patchlevel.h|tail -1|sed 's/[^0-9]//g'`
4349 $echo "(You do not have patchlevel.h. Eek.)"
4351 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
4352 version_patchlevel_string="version $patchlevel subversion $subversion"
4353 case "$perl_patchlevel" in
4355 *) perl_patchlevel=`echo $perl_patchlevel | sed 's/.* //'`
4356 version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel"
4360 $echo "(You have $package $version_patchlevel_string.)"
4364 : XXX Should be a Configure test for double-dots in filenames.
4365 version=`echo $revision $patchlevel $subversion | \
4366 $awk '{ printf "%d_%d_%d", $1, $2, $3 }'`
4367 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4368 $awk '{ printf "%d_%d_%d", $1, $2, $3 }'`
4371 version=`echo $revision $patchlevel $subversion | \
4372 $awk '{ printf "%d.%d.%d", $1, $2, $3 }'`
4373 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4374 $awk '{ printf "%d.%d.%d", $1, $2, $3 }'`
4377 : Special case the 5.005_xx maintenance series, which used 5.005
4378 : without any subversion label as a subdirectory in $sitelib
4379 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4380 api_versionstring='5.005'
4383 : Do we want threads support and if so, what type
4384 case "$usethreads" in
4385 $define|true|[yY]*) dflt='y';;
4386 *) # Catch case where user specified ithreads or 5005threads but
4387 # forgot -Dusethreads (A.D. 4/2002)
4388 case "$useithreads$use5005threads" in
4389 *$define*) dflt='y';;
4396 Perl can be built to offer a form of threading support on some systems
4397 To do so, Configure can be run with -Dusethreads.
4399 Note that Perl built with threading support runs slightly slower
4400 and uses slightly more memory than plain Perl.
4402 If this doesn't make any sense to you, just accept the default '$dflt'.
4404 rp='Build a threading Perl?'
4407 y|Y) val="$define" ;;
4413 if $test $patchlevel -lt 9; then
4414 case "$usethreads" in
4416 : Default to ithreads unless overridden on command line or with
4419 case "$use5005threads" in
4421 echo "5.005 threads are no longer supported"
4425 case "$useithreads" in
4426 $undef|false|[nN]*) dflt='n';;
4428 rp='Use the newer interpreter-based ithreads?'
4431 y|Y) val="$define" ;;
4436 : Now set use5005threads to the opposite value.
4437 case "$useithreads" in
4438 $define) val="$undef" ;;
4445 useithreads="$undef"
4446 use5005threads="$undef"
4450 case "$useithreads$use5005threads" in
4454 You cannot have both the ithreads and the 5.005 threads enabled
4455 at the same time. Disabling the 5.005 threads since they are
4456 much less stable than the ithreads.
4459 use5005threads="$undef"
4464 : perl-5.9.x and later
4466 if test X"$usethreads" = "X$define"; then
4467 case "$use5005threads" in
4471 5.005 threads has been removed for 5.10. Perl will be built using ithreads.
4478 use5005threads="$undef"
4479 useithreads="$usethreads"
4482 case "$d_oldpthreads" in
4483 '') : Configure tests would be welcome here. For now, assume undef.
4485 *) val="$d_oldpthreads" ;;
4491 : Look for a hint-file generated 'call-back-unit'. If the
4492 : user has specified that a threading perl is to be built,
4493 : we may need to set or change some other defaults.
4494 if $test -f usethreads.cbu; then
4495 echo "Your platform has some specific hints regarding threaded builds, using them..."
4498 case "$usethreads" in
4499 "$define"|true|[yY]*)
4501 (Your platform does not have any specific hints for threaded builds.
4502 Assuming POSIX threads, then.)
4508 : Check if multiplicity is required
4511 Perl can be built so that multiple Perl interpreters can coexist
4512 within the same Perl executable.
4515 case "$useithreads" in
4518 This multiple interpreter support is required for interpreter-based threads.
4522 *) case "$usemultiplicity" in
4523 $define|true|[yY]*) dflt='y';;
4527 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4528 rp='Build Perl for multiplicity?'
4531 y|Y) val="$define" ;;
4539 : Check if morebits is requested
4540 case "$usemorebits" in
4541 "$define"|true|[yY]*)
4542 use64bitint="$define"
4543 uselongdouble="$define"
4544 usemorebits="$define"
4546 *) usemorebits="$undef"
4550 : Determine the C compiler to be used
4556 rp="Use which C compiler?"
4560 : See whether they have no cc but they do have gcc
4562 if $test -f cc.cbu; then
4567 : make some quick guesses about what we are up against
4569 $echo $n "Hmm... $c"
4579 $cat $sysroot/usr/include/signal.h $sysroot/usr/include/sys/signal.h >foo 2>/dev/null
4580 if test -f /osf_boot || $contains 'OSF/1' $sysroot/usr/include/ctype.h >/dev/null 2>&1
4582 echo "Looks kind of like an OSF/1 system, but we'll see..."
4584 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4585 xxx=`./loc addbib blurfl $pth`
4586 if $test -f $xxx; then
4587 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4591 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4592 echo "Looks kind of like an extended USG system, but we'll see..."
4594 echo "Looks kind of like a USG system, but we'll see..."
4598 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4599 echo "Looks kind of like a BSD system, but we'll see..."
4603 echo "Looks kind of like a Version 7 system, but we'll see..."
4606 case "$eunicefix" in
4609 There is, however, a strange, musty smell in the air that reminds me of
4610 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4614 : it so happens the Eunice I know will not run shell scripts in Unix format
4618 echo "Congratulations. You aren't running Eunice."
4622 : Detect OS2. The p_ variable is set above in the Head.U unit.
4623 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4624 : semicolon as a patch separator
4629 I have the feeling something is not exactly right, however...don't tell me...
4630 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4631 (Or you may be running DOS with DJGPP.)
4636 if test -f /xenix; then
4637 echo "Actually, this looks more like a XENIX system..."
4642 echo "It's not Xenix..."
4647 if test -f /venix; then
4648 echo "Actually, this looks more like a VENIX system..."
4655 echo "Nor is it Venix..."
4658 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4659 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4662 : Check if we are using GNU gcc and what its version is
4664 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4668 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4670 printf("%s\n", __VERSION__);
4672 printf("%s\n", "1");
4678 if $cc -o try $ccflags $ldflags try.c; then
4679 gccversion=`$run ./try`
4680 case "$gccversion" in
4681 '') echo "You are not using GNU cc." ;;
4682 *) echo "You are using GNU cc $gccversion."
4688 echo "*** WHOA THERE!!! ***" >&4
4689 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4690 case "$knowitall" in
4692 echo " You'd better start hunting for one and let me know about it." >&4
4698 case "$gccversion" in
4699 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4701 case "$gccversion" in
4702 '') gccosandvers='' ;;
4703 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4704 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4706 case "$gccosandvers" in
4707 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4708 $osname$osvers) ;; # looking good
4709 $osname*) cat <<EOM >&4
4711 *** WHOA THERE!!! ***
4713 Your gcc has not been compiled for the exact release of
4714 your operating system ($gccosandvers versus $osname$osvers).
4716 In general it is a good idea to keep gcc synchronized with
4717 the operating system because otherwise serious problems
4718 may ensue when trying to compile software, like Perl.
4720 I'm trying to be optimistic here, though, and will continue.
4721 If later during the configuration and build icky compilation
4722 problems appear (headerfile conflicts being the most common
4723 manifestation), I suggest reinstalling the gcc to match
4724 your operating system release.
4728 *) gccosandvers='' ;; # failed to parse, better be silent
4736 # gcc 3.* complain about adding -Idirectories that they already know about,
4737 # so we will take those off from locincpth.
4738 case "$gccversion" in
4740 echo "main(){}">try.c
4741 for incdir in $locincpth; do
4742 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4743 grep '^c[cp]p*[01]: warning: changing search order '`
4744 if test "X$warn" != X; then
4745 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4751 # gcc 4.9 by default does some optimizations that break perl.
4752 # see ticket 121505.
4754 # The -fwrapv disables those optimizations (and probably others,) so
4755 # for gcc 4.9 (and later, since the optimizations probably won't go
4756 # away), add -fwrapv unless the user requests -fno-wrapv, which
4757 # disables -fwrapv, or if the user requests -fsanitize=undefined,
4758 # which turns the overflows -fwrapv ignores into runtime errors.
4759 case "$gccversion" in
4760 4.[3-9].*|4.[1-9][0-9]*|[5-9].*|[1-9][0-9]*)
4762 *-fno-wrapv*|*-fsanitize=undefined*|*-fwrapv*) ;;
4763 *) ccflags="$ccflags -fwrapv" ;;
4767 : What should the include directory be ?
4768 : Use sysroot if set, so findhdr looks in the right place.
4770 $echo $n "Hmm... $c"
4771 dflt="$sysroot/usr/include"
4774 if $test -f /bin/mips && /bin/mips; then
4775 echo "Looks like a MIPS system..."
4776 $cat >usr.c <<'EOCP'
4777 #ifdef SYSTYPE_BSD43
4781 if $cc $cppflags -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4782 dflt='/bsd43/usr/include'
4786 mips_type='System V'
4788 $rm -f usr.c usr.out
4789 echo "and you're compiling with the $mips_type compiler and libraries."
4793 echo "Doesn't look like a MIPS system."
4803 case "$xxx_prompt" in
4806 rp='Where are the include files you want to use?'
4814 : see how we invoke the C preprocessor
4816 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4817 cat <<'EOT' >testcpp.c
4823 if test ! -f cppstdin; then
4824 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4825 # AIX cc -E doesn't show the absolute headerfile
4826 # locations but we'll cheat by using the -M flag.
4827 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
4829 echo 'cat >.$$.c; '"$cc $cppflags"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4832 echo "Keeping your $hint cppstdin wrapper."
4835 wrapper=`pwd`/cppstdin
4839 if $test "X$cppstdin" != "X" && \
4840 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4841 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4843 echo "You used to use $cppstdin $cppminus so we'll use that again."
4845 '') echo "But let's see if we can live without a wrapper..." ;;
4847 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4848 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4850 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4853 echo "(However, $cpprun $cpplast does not work, let's see...)"
4861 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4868 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4869 $cc -E <testcpp.c >testcpp.out 2>&1; \
4870 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4871 echo "Yup, it does."
4872 x_cpp="$cc $cppflags -E"
4874 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4875 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4876 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4877 echo "Yup, it does."
4878 x_cpp="$cc $cppflags -E"
4880 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4881 $cc -P <testcpp.c >testcpp.out 2>&1; \
4882 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4883 echo "Yipee, that works!"
4884 x_cpp="$cc $cppflags -P"
4886 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4887 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4888 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4889 echo "At long last!"
4890 x_cpp="$cc $cppflags -P"
4892 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4893 $cpp <testcpp.c >testcpp.out 2>&1; \
4894 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4896 x_cpp="$cpp $cppflags"
4898 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4899 $cpp - <testcpp.c >testcpp.out 2>&1; \
4900 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4901 echo "Hooray, it works! I was beginning to wonder."
4902 x_cpp="$cpp $cppflags"
4904 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4905 $wrapper <testcpp.c >testcpp.out 2>&1; \
4906 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4912 rp="No dice. I can't find a C preprocessor. Name one:"
4916 $x_cpp <testcpp.c >testcpp.out 2>&1
4917 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4918 echo "OK, that will do." >&4
4920 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4935 echo "Perhaps can we force $cc -E using a wrapper..."
4936 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4937 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4943 echo "Nope, we'll have to live without it..."
4957 "$wrapper"|'cppstdin') ;;
4958 *) $rm -f $wrapper;;
4960 $rm -f testcpp.c testcpp.out
4962 : Adjust cppfilter for path component separator
4964 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
4965 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
4969 : Use gcc to determine libpth and incpth
4970 # If using gcc or clang, we can get better values for libpth, incpth
4971 # and usrinc directly from the compiler.
4972 # Note that ccname for clang is also gcc.
4975 $echo 'extern int foo;' > try.c
4976 set X `$cppstdin -v try.c 2>&1 | $awk '/^#include </,/^End of search /'|$cppfilter $grep '/include'`
4978 if $test $# -gt 0; then
4980 incpth="`$echo $incpth|$sed 's/^ //'`"
4982 j="`$echo $i|$sed 's,/include$,/lib,'`"
4983 if $test -d $j; then
4987 libpth="`$echo $libpth|$sed 's/^ //'`"
4988 for xxx in $libpth $loclibpth $plibpth $glibpth; do
4989 if $test -d $xxx; then
4992 *) libpth="$libpth $xxx";;
4999 '') for i in $incpth; do
5000 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
5008 case "$usecrosscompile" in
5011 '') echo "Incpth not defined." >&4; croak=y ;;
5012 *) echo "Using incpth '$incpth'." >&4 ;;
5015 '') echo "Libpth not defined." >&4; croak=y ;;
5016 *) echo "Using libpth '$libpth'." >&4 ;;
5019 '') echo "Usrinc not defined." >&4; croak=y ;;
5020 *) echo "Using usrinc $usrinc." >&4 ;;
5024 if test "X$sysroot" = X; then
5025 echo "Cannot continue, aborting." >&4; exit 1
5027 echo "Cross-compiling using sysroot $sysroot, failing to guess inc/lib paths is not fatal" >&4
5036 : Default value for incpth is just usrinc
5038 '') incpth="$usrinc";;
5041 : Set private lib path
5044 plibpth="$incpath/usr/lib $sysroot/usr/local/lib $sysroot/usr/ccs/lib"
5049 '') dlist="$loclibpth $plibpth $glibpth";;
5050 *) dlist="$libpth";;
5053 : Now check and see which directories actually exist, avoiding duplicates
5056 if $test -d $xxx; then
5059 *) libpth="$libpth $xxx";;
5065 Some systems have incompatible or broken versions of libraries. Among
5066 the directories listed in the question below, please remove any you
5067 know not to be holding relevant libraries, and add any that are needed.
5068 Say "none" for none.
5072 if test "X$sysroot" != X; then
5074 You have set sysroot to $sysroot, please supply the directories excluding sysroot
5087 rp="Directories to use for library searches?"
5094 : compute shared library extension
5097 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
5107 On some systems, shared libraries may be available. Answer 'none' if
5108 you want to suppress searching of shared libraries for the remainder
5109 of this configuration.
5112 rp='What is the file extension used for shared libraries?'
5116 : Does target system insist that shared library basenames are unique
5119 Some dynamic loaders assume that the *basename* of shared library filenames
5120 are globally unique. We'll default this to undef as we assume your system
5121 is not this weird. Set to defined if you're on one of them.
5126 rp='Make shared library basenames unique?'
5129 y|Y) val="$define" ;;
5132 set d_libname_unique
5135 : Define several unixisms.
5136 : Hints files or command line option can be used to override them.
5137 : The convoluted testing is in case hints files set either the old
5140 '') case "$exe_ext" in
5142 *) _exe="$exe_ext" ;;
5147 '') case "$lib_ext" in
5154 '') case "$obj_ext" in
5161 '') case "$path_sep" in
5172 rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
5174 : Which makefile gets called first. This is used by make depend.
5175 case "$firstmakefile" in
5176 '') firstmakefile='makefile';;
5179 : Check is we will use socks
5181 $define|true|[yY]*) dflt='y';;
5186 Perl can be built to use the SOCKS proxy protocol library. To do so,
5187 Configure must be run with -Dusesocks. If you use SOCKS you also need
5188 to use the PerlIO abstraction layer, this will be implicitly selected.
5190 If this doesn't make any sense to you, just accept the default '$dflt'.
5192 rp='Build Perl for SOCKS?'
5195 y|Y) val="$define" ;;
5201 : Check for uselongdouble support
5203 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
5206 case "$uselongdouble" in
5207 $define|true|[yY]*) dflt='y';;
5212 Perl can be built to take advantage of long doubles which
5213 (if available) may give more accuracy and range for floating point numbers.
5215 If this doesn't make any sense to you, just accept the default '$dflt'.
5217 rp='Try to use long doubles if available?'
5220 y|Y) val="$define" ;;
5226 case "$uselongdouble" in
5227 true|[yY]*) uselongdouble="$define" ;;
5230 : Look for a hint-file generated 'call-back-unit'. If the
5231 : user has specified that long doubles should be used,
5232 : we may need to set or change some other defaults.
5233 if $test -f uselongdouble.cbu; then
5234 echo "Your platform has some specific hints regarding long doubles, using them..."
5235 . ./uselongdouble.cbu
5237 case "$uselongdouble" in
5240 (Your platform does not have any specific hints for long doubles.)
5246 : Check if quadmath is requested
5247 case "$usequadmath" in
5248 "$define"|true|[yY]*) usequadmath="$define" ;;
5249 *) usequadmath="$undef" ;;
5252 : Fail if both uselongdouble and usequadmath are requested
5253 case "$usequadmath:$uselongdouble" in
5257 *** You requested the use of the quadmath library and use
5258 *** of long doubles.
5260 *** Please select one or the other.
5266 : Looking for optional libraries
5268 echo "Checking for optional libraries..." >&4
5273 case "$libswanted" in
5274 '') libswanted='c_s';;
5277 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
5279 case "$usecbacktrace" in
5280 "$define") libswanted="$libswanted bfd" ;;
5282 case "$usequadmath" in
5283 "$define") libswanted="$libswanted quadmath" ;;
5289 for thisdir in $libpth $xlibpth; do
5290 test -d $thisdir && libspath="$libspath $thisdir"
5292 for thislib in $libswanted; do
5293 for thisdir in $libspath; do
5295 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
5296 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
5297 $test -f "$xxx" && eval $libscheck
5298 $test -f "$xxx" && libstyle=shared
5299 xxx=`ls $thisdir/lib$thislib.[0-9].$so 2>/dev/null|sed -n '$p'`
5300 $test -f "$xxx" && eval $libscheck
5301 $test -f "$xxx" && libstyle=shared
5303 if test ! -f "$xxx"; then
5304 xxx=$thisdir/lib$thislib.$so
5305 $test -f "$xxx" && eval $libscheck
5306 $test -f "$xxx" && libstyle=shared
5308 if test ! -f "$xxx"; then
5309 xxx=$thisdir/lib$thislib$_a
5310 $test -f "$xxx" && eval $libscheck
5311 $test -f "$xxx" && libstyle=static
5313 if test ! -f "$xxx"; then
5314 xxx=$thisdir/$thislib$_a
5315 $test -f "$xxx" && eval $libscheck
5316 $test -f "$xxx" && libstyle=static
5318 if test ! -f "$xxx"; then
5319 xxx=$thisdir/lib${thislib}_s$_a
5320 $test -f "$xxx" && eval $libscheck
5321 $test -f "$xxx" && libstyle=static
5322 $test -f "$xxx" && thislib=${thislib}_s
5324 if test ! -f "$xxx"; then
5325 xxx=$thisdir/Slib$thislib$_a
5326 $test -f "$xxx" && eval $libscheck
5327 $test -f "$xxx" && libstyle=static
5329 if $test -f "$xxx"; then
5331 shared) echo "Found -l$thislib (shared)." ;;
5332 static) echo "Found -l$thislib." ;;
5333 *) echo "Found -l$thislib ($libstyle)." ;;
5337 *) dflt="$dflt -l$thislib"
5338 libsfound="$libsfound $xxx"
5340 libsfiles="$libsfiles $yyy"
5341 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
5342 case " $libsdirs " in
5344 *) libsdirs="$libsdirs $yyy" ;;
5351 if $test ! -f "$xxx"; then
5352 echo "No -l$thislib."
5363 ' '|'') dflt='none';;
5368 In order to compile $package on your machine, a number of libraries
5369 are usually needed. Include any other special libraries here as well.
5370 Say "none" for none. The default list is almost always right.
5374 rp="What libraries to use?"
5381 : determine optimization, if desired, or use for debug flag also
5383 ' '|$undef) dflt='none';;
5385 *) dflt="$optimize";;
5389 By default, $package compiles with the -O flag to use the optimizer.
5390 Alternately, you might want to use the symbolic debugger, which uses
5391 the -g flag (on traditional Unix systems). Either flag can be
5392 specified here. To use neither flag, specify the word "none".
5395 rp="What optimizer/debugger flag should be used?"
5399 'none') optimize=" ";;
5402 : Check what DEBUGGING is required from the command line
5403 : -DEBUGGING or -DDEBUGGING or
5404 : -DEBUGGING=both = -g + -DDEBUGGING
5405 : -DEBUGGING=-g or -Doptimize=-g = -g
5406 : -DEBUGGING=none or -UDEBUGGING =
5407 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
5410 *) DEBUGGING=$EBUGGING ;;
5413 case "$DEBUGGING" in
5417 *) optimize="$optimize -g" ;;
5421 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
5429 case "$DEBUGGING" in
5430 both|$define) dflt='-DDEBUGGING'
5433 : argument order is deliberate, as the flag will start with - which set could
5434 : think is an option
5435 checkccflag='check=$1; flag=$2; callback=$3;
5437 echo "Checking if your compiler accepts $flag" 2>&1;
5438 [ "X$sysroot" != "X" ] && echo "For sysroot = $sysroot";
5439 echo "int main(void) { return 0; }" > gcctest.c;
5440 if $cc $_sysroot -O2 $flag -o gcctest gcctest.c 2>gcctest.out && $run ./gcctest; then
5441 echo "Yes, it does." 2>&1;
5442 if $test -s gcctest.out ; then
5443 echo "But your platform does not like it:";
5448 echo "Leaving current flags $ccflags alone." 2>&1
5450 *) dflt="$dflt $flag";
5456 echo "Nope, it does not, but that is ok." 2>&1;
5460 : We will not override a previous value, but we might want to
5461 : augment a hint file
5463 default|recommended)
5464 case "$gccversion" in
5465 1*) dflt="$dflt -fpcc-struct-return" ;;
5467 case "$optimize:$DEBUGGING" in
5468 *-g*:old) dflt="$dflt -DDEBUGGING";;
5470 case "$gccversion" in
5471 2*) if $test -d /etc/conf/kconfig.d &&
5472 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
5474 # Interactive Systems (ISC) POSIX mode.
5479 case "$gccversion" in
5482 ?*) set strict-aliasing -fno-strict-aliasing
5486 # For gcc, adding -pipe speeds up compilations for some, but apparently
5487 # some assemblers can't read from stdin. (It also slows down compilations
5488 # in other cases, but those are apparently rarer these days.) AD 5/2004.
5489 case "$gccversion" in
5495 # on x86_64 (at least) we require an extra library (libssp) in the
5496 # link command line. This library is not named, so I infer that it is
5497 # an implementation detail that may change. Hence the safest approach
5498 # is to add the flag to the flags passed to the compiler at link time,
5499 # as that way the compiler can do the right implementation dependant
5502 amigaos) ;; # -fstack-protector builds but doesn't work
5503 *) case "$gccversion" in
5504 ?*) set stack-protector-strong -fstack-protector-strong
5507 *-fstack-protector-strong*) ;; # It got added.
5508 *) # Try the plain/older -fstack-protector.
5509 set stack-protector -fstack-protector
5520 case "$mips_type" in
5521 *BSD*|'') inclwanted="$locincpth $usrinc";;
5522 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
5524 for thisincl in $inclwanted; do
5525 if $test -d $thisincl; then
5526 if $test x$thisincl != x$usrinc; then
5528 *" -I$thisincl "*);;
5529 *) dflt="$dflt -I$thisincl ";;
5535 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
5537 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5545 *) dflt="$dflt -D$2";;
5549 set signal.h LANGUAGE_C; eval $inctest
5553 ccflags="$ccflags -DSOCKS"
5558 default|recommended) dflt="$ccflags $dflt" ;;
5559 *) dflt="$ccflags";;
5568 Your C compiler may want other flags. For this question you should include
5569 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5570 but you should NOT include libraries or ld flags like -lwhatever. If you
5571 want $package to honor its debug switch, you should include -DDEBUGGING here.
5572 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5574 To use no flags, specify the word "none".
5580 rp="Any additional cc flags?"
5587 : the following weeds options from ccflags that are of no interest to cpp
5589 '') cppflags="$ccflags" ;;
5590 *) set X $ccflags; shift
5591 case " $cppflags " in
5592 *" $1 "*) ;; # Try to avoid doubling the cppflags.
5593 *) cppflags="$cppflags $ccflags" ;;
5597 case "$gccversion" in
5598 1*) cppflags="$cppflags -D__GNUC__"
5600 case "$mips_type" in
5602 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5608 echo "Let me guess what the preprocessor flags are..." >&4
5622 *) ftry="$previous $flag";;
5624 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5625 >cpp1.out 2>/dev/null && \
5626 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5627 >cpp2.out 2>/dev/null && \
5628 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5629 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5631 cppflags="$cppflags $ftry"
5641 *-*) echo "They appear to be: $cppflags";;
5643 $rm -f cpp.c cpp?.out
5647 : flags used in final linking phase
5649 '') if ./venix; then
5655 *-posix*) dflt="$dflt -posix" ;;
5658 *) dflt="$ldflags";;
5660 # See note above about -fstack-protector
5662 *-fstack-protector-strong*)
5664 *-fstack-protector-strong*) ;; # Don't add it again
5665 *) dflt="$dflt -fstack-protector-strong" ;;
5668 *-fstack-protector*)
5670 *-fstack-protector*) ;; # Don't add it again
5671 *) dflt="$dflt -fstack-protector" ;;
5676 : Try to guess additional flags to pick up local libraries.
5677 for thislibdir in $libpth; do
5678 case " $loclibpth " in
5681 *"-L$thislibdir "*) ;;
5682 *) dflt="$dflt -L$thislibdir" ;;
5694 Your C linker may need flags. For this question you should
5695 include -L/whatever and any other flags used by the C linker, but you
5696 should NOT include libraries like -lwhatever.
5698 Make sure you include the appropriate -L/path flags if your C linker
5699 does not normally search all of the directories you specified above,
5702 To use no flags, specify the word "none".
5706 rp="Any additional ld flags (NOT including libraries)?"
5712 rmlist="$rmlist pdp11"
5716 echo "Checking your choice of C compiler and flags for coherency..." >&4
5717 $cat > try.c <<'EOF'
5719 int main() { printf("Ok\n"); return(0); }
5721 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5723 $cat >try.msg <<'EOM'
5724 I've tried to compile and run the following simple program:
5727 $cat try.c >> try.msg
5729 $cat >> try.msg <<EOM
5736 and I got the following output:
5740 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5741 if $sh -c "$run ./try " >>try.msg 2>&1; then
5745 *) echo 'The program compiled OK, but produced no output.' >> try.msg ;;
5748 echo "The program compiled OK, but exited with status $?." >>try.msg
5749 rp="You have a problem. Shall I abort Configure"
5753 echo "I can't compile the test program." >>try.msg
5754 rp="You have a BIG problem. Shall I abort Configure"
5760 case "$knowitall" in
5762 echo "(The supplied flags or libraries might be incorrect.)"
5770 *) echo "Ok. Stopping Configure." >&4
5775 n) echo "OK, that should do.";;
5777 $rm_try gcctest gcctest.out
5779 : define a shorthand compile call
5783 case "$usedevel" in $define|true|[yY]*) if $test ! -f "${mc_file}.c"; then
5784 echo "Internal Configure script bug - compiler test file ${mc_file}.c is missing. Please report this to perlbug@perl.org" >&4;
5788 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5789 : define a shorthand compile call for compilations that should be ok.
5793 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5795 : stub, used only to satisfy other units
5798 : check for lengths of integral types
5802 echo "Checking to see how big your integers are..." >&4
5811 printf("intsize=%d;\n", (int)sizeof(int));
5812 printf("longsize=%d;\n", (int)sizeof(long));
5813 printf("shortsize=%d;\n", (int)sizeof(short));
5818 if eval $compile_ok && $run ./try > /dev/null; then
5820 echo "Your integers are $intsize bytes long."
5821 echo "Your long integers are $longsize bytes long."
5822 echo "Your short integers are $shortsize bytes long."
5826 Help! I can't compile and run the intsize test program: please enlighten me!
5827 (This is probably a misconfiguration in your system or libraries, and
5828 you really ought to fix it. Still, I'll try anyway.)
5832 rp="What is the size of an integer (in bytes)?"
5836 rp="What is the size of a long integer (in bytes)?"
5840 rp="What is the size of a short integer (in bytes)?"
5848 : check for long long
5850 echo "Checking to see if you have long long..." >&4
5851 echo 'int main() { long long x = 7; return 0; }' > try.c
5853 if eval $compile; then
5855 echo "You have long long."
5858 echo "You do not have long long."
5864 : check for length of long long
5865 case "${d_longlong}${longlongsize}" in
5868 echo "Checking to see how big your long longs are..." >&4
5869 $cat >try.c <<'EOCP'
5873 printf("%d\n", (int)sizeof(long long));
5878 if eval $compile_ok; then
5879 longlongsize=`$run ./try`
5880 echo "Your long longs are $longlongsize bytes long."
5884 echo "(I can't seem to compile the test program. Guessing...)"
5885 rp="What is the size of a long long (in bytes)?"
5889 if $test "X$longsize" = "X$longlongsize"; then
5890 echo "(That isn't any different from an ordinary long.)"
5896 : determine filename position in cpp output
5898 echo "Computing filename position in cpp output for #include directives..." >&4
5900 amigaos) fieldn=3 ;; # Workaround for a bug in abc (pdksh).
5905 vos) testaccess=-e ;;
5908 echo '#include <stdio.h>' > foo.c
5911 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5912 $grep '^[ ]*#.*stdio\.h' | \
5913 while read cline; do
5916 while $test \$# -gt 0; do
5917 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5922 pos=\`expr \$pos + 1\`
5936 *) pos="${fieldn}th";;
5938 echo "Your cpp writes the filename in the $pos field of the line."
5940 : locate header file
5945 for usrincdir in $incpth
5947 if test -f \$usrincdir/\$wanted; then
5948 echo "\$usrincdir/\$wanted"
5952 awkprg='{ print \$$fieldn }'
5953 echo "#include <\$wanted>" > foo\$\$.c
5954 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5955 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5956 while read cline; do
5957 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5959 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5960 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5965 # status = 0: grep returned 0 lines, case statement not executed
5966 # status = 1: headerfile found
5967 # status = 2: while loop executed, no headerfile found
5971 if test \$status -eq 1; then
5978 : define an alternate in-header-list? function
5979 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5980 cont=true; xxf="echo \"<\$1> found.\" >&4";
5981 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5982 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5984 case $# in 4) instead=instead;; *) instead="at last";; esac;
5985 while $test "$cont"; do
5987 var=$2; eval "was=\$$2";
5988 if $test "$xxx" && $test -r "$xxx";
5990 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5993 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5994 set $yyy; shift; shift; yyy=$@;
5995 case $# in 0) cont="";;
5996 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5997 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5998 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5999 xxnf="echo \"there is no <\$1>, ...\" >&4";;
6003 do set $yyy; var=$2; eval "was=\$$2";
6004 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
6005 set $yyy; shift; shift; yyy=$@;
6008 : see if inttypes.h is available
6009 : we want a real compile instead of Inhdr because some systems
6010 : have an inttypes.h which includes non-existent headers
6013 #include <inttypes.h>
6015 static int32_t foo32 = 0x12345678;
6019 if eval $compile; then
6020 echo "<inttypes.h> found." >&4
6023 echo "<inttypes.h> NOT found." >&4
6032 echo "Checking to see if you have int64_t..." >&4
6034 #include <sys/types.h>
6035 #$i_inttypes I_INTTYPES
6037 #include <inttypes.h>
6039 int main() { int64_t x = 7; }
6042 if eval $compile; then
6044 echo "You have int64_t."
6047 echo "You do not have int64_t."
6053 : Check if 64bit ints have a quad type
6055 echo "Checking which 64-bit integer type we could use..." >&4
6061 val='"unsigned int"'
6066 *) case "$longsize" in
6070 val='"unsigned long"'
6075 *) case "$d_longlong:$longlongsize" in
6080 val='"unsigned long long"'
6085 *) case "$d_int64_t" in
6104 '') echo "Alas, no 64-bit integer types in sight." >&4
6107 *) echo "We could use '$quadtype' for 64-bit integers." >&4
6112 : Do we want 64bit support
6113 case "$uselonglong" in
6114 "$define"|true|[yY]*)
6117 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
6119 use64bitint="$define"
6122 case "$use64bits" in
6123 "$define"|true|[yY]*)
6126 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
6128 use64bitint="$define"
6131 case "$use64bitints" in
6132 "$define"|true|[yY]*)
6135 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
6137 use64bitint="$define"
6140 case "$use64bitsint" in
6141 "$define"|true|[yY]*)
6144 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
6146 use64bitint="$define"
6149 case "$uselonglongs" in
6150 "$define"|true|[yY]*)
6153 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
6155 use64bitint="$define"
6158 case "$use64bitsall" in
6159 "$define"|true|[yY]*)
6162 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
6164 use64bitall="$define"
6169 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
6171 case "$use64bitall" in
6172 "$define"|true|[yY]*) use64bitint="$define" ;;
6178 You have natively 64-bit long integers.
6182 *) case "$use64bitint" in
6183 "$define"|true|[yY]*) dflt='y';;
6192 Perl can be built to take advantage of 64-bit integer types
6193 on some systems. To do so, Configure can be run with -Duse64bitint.
6194 Choosing this option will most probably introduce binary incompatibilities.
6196 If this doesn't make any sense to you, just accept the default '$dflt'.
6197 (The default has been chosen based on your configuration.)
6199 rp='Try to use 64-bit integers, if available?'
6202 [yY]*) val="$define" ;;
6210 case "$use64bitall" in
6211 "$define"|true|[yY]*) dflt='y' ;;
6212 *) case "$longsize" in
6220 You may also choose to try maximal 64-bitness. It means using as much
6221 64-bitness as possible on the platform. This in turn means even more
6222 binary incompatibilities. On the other hand, your platform may not
6223 have any more 64-bitness available than what you already have chosen.
6225 If this doesn't make any sense to you, just accept the default '$dflt'.
6226 (The default has been chosen based on your configuration.)
6228 rp='Try to use maximal 64-bit support, if available?'
6231 [yY]*) val="$define" ;;
6236 case "$use64bitall" in
6238 case "$use64bitint" in
6242 Since you have chosen a maximally 64-bit build, I'm also turning on
6243 the use of 64-bit integers.
6245 use64bitint="$define" ;;
6250 : Look for a hint-file generated 'call-back-unit'. If the
6251 : user has specified that a 64-bit perl is to be built,
6252 : we may need to set or change some other defaults.
6253 if $test -f use64bitint.cbu; then
6254 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
6257 case "$use64bitint" in
6258 "$define"|true|[yY]*)
6259 : This test was common to all the OpenBSD forks, and seems harmless for
6262 echo "Checking if your C library has broken 64-bit functions..." >&4
6265 typedef $uquadtype myULL;
6272 {4294967303.15, 4294967303ULL},
6273 {4294967294.2, 4294967294ULL},
6274 {4294967295.7, 4294967295ULL},
6277 for (p = test; p->u; p++) {
6278 myULL x = (myULL)p->d;
6289 if eval $compile_ok; then
6290 libcquad=`$run ./try`
6291 echo "Your C library's 64-bit functions are $libcquad."
6293 echo "(I can't seem to compile the test program.)"
6294 echo "Assuming that your C library's 64-bit functions are ok."
6303 *** You have a C library with broken 64-bit functions.
6304 *** 64-bit support does not work reliably in this configuration.
6305 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
6306 *** Cannot continue, aborting.
6313 4) case "$archname64" in
6314 '') archname64=64int ;;
6321 : Look for a hint-file generated 'call-back-unit'. If the
6322 : user has specified that a maximally 64-bit perl is to be built,
6323 : we may need to set or change some other defaults.
6324 if $test -f use64bitall.cbu; then
6325 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
6328 case "$use64bitall" in
6329 "$define"|true|[yY]*)
6331 4) case "$archname64" in
6332 ''|64int) archname64=64all ;;
6339 case "$d_quad:$use64bitint" in
6343 *** You have chosen to use 64-bit integers,
6344 *** but none can be found.
6345 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
6346 *** Cannot continue, aborting.
6353 : Check if we are using the GNU C library
6355 echo "Checking for GNU C Library..." >&4
6357 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
6358 alone are insufficient to distinguish different versions, such as
6359 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
6360 libc version 2.1.0. A. Dougherty, June 3, 2002.
6366 # ifdef __GLIBC_MINOR__
6367 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
6368 # include <gnu/libc-version.h>
6369 printf("%s\n", gnu_get_libc_version());
6371 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
6374 printf("%d\n", __GLIBC__);
6383 if eval $compile_ok && $run ./try > glibc.ver; then
6385 gnulibc_version=`$cat glibc.ver`
6386 echo "You are using the GNU C Library version $gnulibc_version"
6390 echo "You are not using the GNU C Library"
6396 : see if nm is to be used to determine whether a symbol is defined or not
6400 case "$d_gnulibc" in
6403 echo "nm probably won't work on the GNU C Library." >&4
6409 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
6411 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
6412 echo "'nm' won't be sufficient on this system." >&4
6418 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
6419 if $test $dflt -gt 20; then
6429 true|$define) dflt=y;;
6436 I can use $nm to extract the symbols from your C libraries. This
6437 is a time consuming task which may generate huge output on the disk (up
6438 to 3 megabytes) but that should make the symbols extraction faster. The
6439 alternative is to skip the 'nm' extraction part and to compile a small
6440 test program instead to determine whether each symbol is present. If
6441 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
6442 this may be the best solution.
6444 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
6447 rp="Shall I use $nm to extract C symbols from the libraries?"
6450 [Nn]*) usenm=false;;
6459 : nm options which may be necessary
6461 '') if $test -f /mach_boot; then
6463 elif $test -d /usr/ccs/lib; then
6464 nm_opt='-p' # Solaris (and SunOS?)
6465 elif $test -f /dgux; then
6467 elif $test -f /lib64/rld; then
6468 nm_opt='-p' # 64-bit Irix
6474 : nm options which may be necessary for shared libraries but illegal
6475 : for archive libraries. Thank you, Linux.
6476 case "$nm_so_opt" in
6477 '') case "$myuname" in
6479 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
6480 nm_so_opt='--dynamic'
6487 : Figure out where the libc is located
6490 : get list of predefined functions in a handy place
6495 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
6501 *) for thislib in $libs; do
6504 : Handle C library specially below.
6507 thislib=`echo $thislib | $sed -e 's/^-l//'`
6508 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
6510 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
6512 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
6514 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
6516 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
6518 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
6520 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
6525 libnames="$libnames $try"
6527 *) libnames="$libnames $thislib" ;;
6536 for xxx in $libpth; do
6537 $test -r $1 || set $xxx/libc.$so
6538 : The messy sed command sorts on library version numbers.
6540 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
6541 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
6543 s/[0-9][0-9]*/0000&/g
6544 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
6547 $sort | $sed -e 's/^.* //'`
6550 $test -r $1 || set $sysroot/usr/ccs/lib/libc.$so
6551 $test -r $1 || set $sysroot/lib/libsys_s$_a
6557 if $test -r "$1"; then
6558 echo "Your (shared) C library seems to be in $1."
6560 elif $test -r /lib/libc && $test -r /lib/clib; then
6561 echo "Your C library seems to be in both /lib/clib and /lib/libc."
6563 libc='/lib/clib /lib/libc'
6564 if $test -r /lib/syslib; then
6565 echo "(Your math library is in /lib/syslib.)"
6566 libc="$libc /lib/syslib"
6568 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
6569 echo "Your C library seems to be in $libc, as you said before."
6570 elif $test -r $incpath/usr/lib/libc$_a; then
6571 libc=$incpath/usr/lib/libc$_a;
6572 echo "Your C library seems to be in $libc. That's fine."
6573 elif $test -r /lib/libc$_a; then
6575 echo "Your C library seems to be in $libc. You're normal."
6577 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
6579 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
6580 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
6581 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
6583 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
6585 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
6588 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
6590 if $test -r "$tans"; then
6591 echo "Your C library seems to be in $tans, of all places."
6597 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
6601 If the guess above is wrong (which it might be if you're using a strange
6602 compiler, or your machine supports multiple models), you can override it here.
6607 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
6609 I can't seem to find your C library. I've looked in the following places:
6612 $sed 's/^/ /' libpath
6615 None of these seems to contain your C library. I need to get its name...
6620 rp='Where is your C library?'
6625 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
6626 set X `cat libnames`
6629 case $# in 1) xxx=file; esac
6630 echo "Extracting names from the following $xxx for later perusal:" >&4
6632 $sed 's/^/ /' libnames >&4
6634 $echo $n "This may take a while...$c" >&4
6638 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
6639 *) $nm $nm_opt $file 2>/dev/null;;
6644 $grep fprintf libc.tmp > libc.ptf
6645 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
6646 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
6648 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//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.*/\1/p'";\
6654 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6656 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
6658 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6660 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
6662 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6664 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
6666 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6668 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
6670 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6672 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
6673 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
6675 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6677 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
6679 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6681 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
6683 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6685 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
6687 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6689 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
6691 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6693 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
6695 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6697 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
6699 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6701 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
6703 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6706 $nm -p $* 2>/dev/null >libc.tmp
6707 $grep fprintf libc.tmp > libc.ptf
6708 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
6709 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
6715 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
6717 if $ar t $libc > libc.tmp && \
6718 $contains '^fprintf$' libc.tmp >/dev/null 2>&1
6720 for thisname in $libnames $libc; do
6721 $ar t $thisname >>libc.tmp
6723 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
6725 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
6726 for thisname in $libnames $libc; do
6727 $ar tv $thisname >>libc.tmp
6728 emximp -o tmp.imp $thisname \
6730 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
6731 < tmp.imp >>libc.tmp
6734 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
6737 echo "$ar didn't seem to work right." >&4
6738 echo "Maybe this is a Cray...trying bld instead..." >&4
6740 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list &&
6743 for thisname in $libnames; do
6745 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
6746 $ar t $thisname >>libc.tmp
6750 echo "That didn't work either. Giving up." >&4
6760 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
6761 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
6763 *) if $test -f /lib/syscalls.exp; then
6765 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
6766 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' \
6767 /lib/syscalls.exp >>libc.list
6773 $rm -f libnames libpath
6775 : Check if we are using C++
6777 echo "Checking for C++..." >&4
6778 $cat >try.c <<'EOCP'
6790 if eval $compile_ok && $run ./try; then
6792 echo "You are using a C++ compiler."
6795 echo "You are not using a C++ compiler."
6801 : is a C symbol defined?
6804 -v) tf=libc.tmp; tdc="";;
6805 -a) tf=libc.tmp; tdc="[]";;
6806 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
6808 case "$d_cplusplus" in
6809 $define) extern_C="extern \"C\"" ;;
6810 *) extern_C="extern" ;;
6813 case "$reuseval-$4" in
6815 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
6820 if $test "$runnm" = true; then
6821 if $contains $tlook $tf >/dev/null 2>&1; then
6823 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
6824 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;
6825 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
6826 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
6830 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;
6831 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
6837 $define) tval=true;;
6844 : define an is-in-libc? function
6845 inlibc='echo " "; td=$define; tu=$undef;
6846 sym=$1; var=$2; eval "was=\$$2";
6848 case "$reuseval$was" in
6858 echo "$sym() found." >&4;
6859 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
6861 echo "$sym() NOT found." >&4;
6862 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
6866 $define) echo "$sym() found." >&4;;
6867 *) echo "$sym() NOT found." >&4;;
6871 : check for length of double
6873 case "$doublesize" in
6875 echo "Checking to see how big your double precision numbers are..." >&4
6884 printf("%d\n", (int)sizeof(double));
6889 if eval $compile_ok; then
6890 doublesize=`$run ./try`
6891 echo "Your double is $doublesize bytes long."
6894 echo "(I can't seem to compile the test program. Guessing...)"
6895 rp="What is the size of a double precision number (in bytes)?"
6903 : check for long doubles
6905 echo "Checking to see if you have long double..." >&4
6906 echo 'int main() { long double x = 7.0; }' > try.c
6908 if eval $compile; then
6910 echo "You have long double."
6913 echo "You do not have long double."
6919 : see if ldexpl exists
6923 : check for length of long double
6924 case "${d_longdbl}${longdblsize}" in
6927 echo "Checking to see how big your long doubles are..." >&4
6928 $cat >try.c <<'EOCP'
6932 printf("%d\n", sizeof(long double));
6937 if eval $compile; then
6938 longdblsize=`$run ./try`
6939 echo "Your long doubles are $longdblsize bytes long."
6943 echo "(I can't seem to compile the test program. Guessing...)" >&4
6944 rp="What is the size of a long double (in bytes)?"
6948 if $test "X$doublesize" = "X$longdblsize"; then
6949 echo "That isn't any different from an ordinary double."
6950 echo "I'll keep your setting anyway, but you may see some"
6951 echo "harmless compilation warnings."
6957 $echo "Checking the kind of long doubles you have..." >&4
6958 case "$d_longdbl" in
6962 #define LONGDBLSIZE $longdblsize
6963 #define DOUBLESIZE $doublesize
6969 static const long double d = -0.1L;
6971 unsigned const char* b = (unsigned const char*)(&d);
6972 #if DOUBLESIZE == LONGDBLSIZE
6973 printf("0\n"); /* if it floats like double */
6976 #if (LDBL_MANT_DIG == 113 || FLT128_MANT_DIG == 113) && LONGDBLSIZE == 16
6977 if (b[0] == 0x9A && b[1] == 0x99 && b[15] == 0xBF) {
6978 /* IEEE 754 128-bit little-endian */
6982 if (b[0] == 0xBF && b[14] == 0x99 && b[15] == 0x9A) {
6983 /* IEEE 128-bit big-endian, e.g. solaris sparc */
6988 /* For alignment 32-bit platforms have the 80 bits in 12 bytes,
6989 * while 64-bits platforms have it in 16 bytes. The trailing bytes
6990 * cannot be trusted. */
6991 #if LDBL_MANT_DIG == 64 && (LONGDBLSIZE == 16 || LONGDBLSIZE == 12)
6992 if (b[0] == 0xCD && b[9] == 0xBF) {
6993 /* x86 80-bit little-endian, sizeof 12 (ILP32, Solaris x86)
6994 * or 16 (LP64, Linux and OS X), 4 or 6 bytes of padding.
6995 * Also known as "extended precision". */
6999 if (b[0] == 0xBF && b[9] == 0xCD) {
7000 /* Is there ever big-endian 80-bit, really?
7002 * The Motorola 68881 had another "extended precision" format:
7003 * sign:1 exp:15 zero:16 integer:1 mantissa:63
7004 * for total of 96 bits of bytes. The zero bits were unused.
7005 * See "M68000 FAMILY PROGRAMMER’S REFERENCE MANUAL" for more details.
7006 * If it ever becomes relevant, this format should be allocated
7007 * a new doublekind code since it's quite different from the Intel x87.
7013 #if (LDBL_MANT_DIG == 106 || LDBL_MANT_DIG == 107) && LONGDBLSIZE == 16
7014 /* software "double double", the 106 is 53+53.
7015 * but irix thinks it is 107. */
7016 if (b[0] == 0x9A && b[7] == 0x3C && b[8] == 0x9A && b[15] == 0xBF) {
7017 /* double double 128-bit fully little-endian,
7018 * little-endian doubles in little-endian order,
7019 * 9a 99 99 99 99 99 59 3c 9a 99 99 99 99 99 b9 bf */
7023 if (b[0] == 0xBF && b[7] == 0x9A && b[8] == 0x3C && b[15] == 0x9A) {
7024 /* double double 128-bit fully big-endian,
7025 * big-endian doubles in big-endian order,
7026 * e.g. PPC/Power and MIPS:
7027 * bf b9 99 99 99 99 99 9a 3c 59 99 99 99 99 99 9a */
7031 if (b[0] == 0x9A && b[7] == 0xBF && b[8] == 0x9A && b[15] == 0x3C) {
7032 /* double double 128-bit mixed endian.
7033 * little-endian doubles in big-endian order,
7035 * 9a 99 99 99 99 99 b9 bf 9a 99 99 99 99 99 59 3c */
7039 if (b[0] == 0x3C && b[7] == 0x9A && b[8] == 0xBF && b[15] == 0x9A) {
7040 /* double double 128-bit mixed endian,
7041 * big-endian doubles in little-endian order,
7042 * 3c 59 99 99 99 99 99 9a bf b9 99 99 99 99 99 9a */
7047 /* We are largely making this up because it may well be
7048 * that the VAX format H was never made available to C,
7049 * only to Fortran. */
7050 #if LONGDBLSIZE == 16 && defined(__vax__)
7051 if (b[0] == 0xFD && b[15] == 0x99) {
7052 /* VAX format H, PDP-11 mixed endian. */
7057 printf("-1\n"); /* unknown */
7062 if eval $compile; then
7063 longdblkind=`$run ./try`
7070 case "$longdblkind" in
7071 0) echo "Your long doubles are doubles." >&4 ;;
7072 1) echo "You have IEEE 754 128-bit little endian long doubles." >&4 ;;
7073 2) echo "You have IEEE 754 128-bit big endian long doubles." >&4 ;;
7074 3) echo "You have x86 80-bit little endian long doubles." >& 4 ;;
7075 4) echo "You have x86 80-bit big endian long doubles." >& 4 ;;
7076 5) echo "You have 128-bit fully little-endian double-double long doubles (64-bit LEs in LE)." >& 4 ;;
7077 6) echo "You have 128-bit fully big-endian double-double long doubles (64-bit BEs in BE)." >& 4 ;;
7078 7) echo "You have 128-bit mixed-endian double-double long doubles (64-bit LEs in BE)." >& 4 ;;
7079 8) echo "You have 128-bit mixed-endian double-double long doubles (64-bit BEs in LE)." >& 4 ;;
7080 9) echo "You have 128-bit PDP-style mixed-endian long doubles (VAX format H)." >& 4 ;;
7081 *) echo "Cannot figure out your long double." >&4 ;;
7083 d_long_double_style_ieee=$undef
7084 d_long_double_style_ieee_std=$undef
7085 d_long_double_style_ieee_extended=$undef
7086 d_long_double_style_ieee_doubledouble=$undef
7087 d_long_double_style_vax=$undef
7088 case "$longdblkind" in
7089 1|2|3|4|5|6|7|8) d_long_double_style_ieee=$define ;;
7091 case "$longdblkind" in
7092 1|2) d_long_double_style_ieee_std=$define ;;
7094 case "$longdblkind" in
7095 3|4) d_long_double_style_ieee_extended=$define ;;
7097 case "$longdblkind" in
7098 5|6|7|8) d_long_double_style_ieee_doubledouble=$define ;;
7100 case "$longdblkind" in
7101 9) d_long_double_style_vax=$define ;;
7105 : determine the architecture name
7107 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
7108 tarch=`arch`"-$osname"
7109 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
7110 if uname -m > tmparch 2>&1 ; then
7111 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
7112 -e 's/$/'"-$osname/" tmparch`
7120 case "$myarchname" in
7123 echo "(Your architecture name used to be $myarchname.)"
7127 case "$targetarch" in
7129 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
7134 *) dflt="$archname";;
7136 rp='What is your architecture name'
7140 : optionally add API version to the architecture for versioned archlibs
7141 case "$useversionedarchname" in
7142 $define|true|[yY]*) dflt='y';;
7145 rp='Add the Perl API version to your archname?'
7148 y|Y) useversionedarchname="$define" ;;
7149 *) useversionedarchname="$undef" ;;
7151 case "$useversionedarchname" in
7154 *-$api_versionstring)
7155 echo "...and architecture name already has -$api_versionstring" >&4
7158 archname="$archname-$api_versionstring"
7159 echo "...setting architecture name to $archname." >&4
7165 case "$usethreads" in
7167 echo "Threads selected." >&4
7169 *-thread*) echo "...and architecture name already has -thread." >&4
7171 *) archname="$archname-thread"
7172 echo "...setting architecture name to $archname." >&4
7177 case "$usemultiplicity" in
7179 echo "Multiplicity selected." >&4
7181 *-multi*) echo "...and architecture name already has -multi." >&4
7183 *) archname="$archname-multi"
7184 echo "...setting architecture name to $archname." >&4
7189 case "$use64bitint$use64bitall" in
7191 case "$archname64" in
7193 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
7196 case "$use64bitint" in
7197 "$define") echo "64 bit integers selected." >&4 ;;
7199 case "$use64bitall" in
7200 "$define") echo "Maximal 64 bitness selected." >&4 ;;
7203 *-$archname64*) echo "...and architecture name already has $archname64." >&4
7205 *) archname="$archname-$archname64"
7206 echo "...setting architecture name to $archname." >&4
7212 case "$uselongdouble" in
7214 echo "Long doubles selected." >&4
7215 case "$longdblsize" in
7217 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
7221 *-ld*) echo "...and architecture name already has -ld." >&4
7223 *) archname="$archname-ld"
7224 echo "...setting architecture name to $archname." >&4
7231 case "$usequadmath" in
7233 echo "quadmath selected." >&4
7235 *-quadmath*) echo "...and architecture name already has -quadmath." >&4
7237 *) archname="$archname-quadmath"
7238 echo "...setting architecture name to $archname." >&4
7243 if $test -f archname.cbu; then
7244 echo "Your platform has some specific hints for architecture name, using them..."
7248 : set the prefixit variable, to compute a suitable default value
7249 prefixit='case "$3" in
7251 case "$oldprefix" in
7252 "") eval "$1=\"\$$2\"";;
7259 ""|" ") eval "$1=\"\$$2\"";;
7265 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
7267 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
7268 /*-$oldprefix/*|\~*-$oldprefix/*)
7269 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
7270 *) eval "$1=\"\$$2\"";;
7274 : determine installation style
7275 : For now, try to deduce it from prefix unless it is already set.
7276 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
7277 case "$installstyle" in
7278 '') case "$prefix" in
7279 *perl*) dflt='lib';;
7280 *) dflt='lib/perl5' ;;
7283 *) dflt="$installstyle" ;;
7285 : Probably not worth prompting for this since we prompt for all
7286 : the directories individually, and the prompt would be too long and
7290 : determine where public executables go
7295 rp='Pathname where the public executables will reside?'
7297 if $test "X$ansexp" != "X$binexp"; then
7301 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
7302 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
7303 : this via initialinstalllocation
7306 case "$userelocatableinc" in
7307 $define|true|[yY]*) dflt='y' ;;
7312 Would you like to build Perl so that the installation is relocatable, so that
7313 library paths in @INC are determined relative to the path of the perl binary?
7314 This is not advised for system Perl installs, or if you need to run setid
7315 scripts or scripts under taint mode.
7317 If this doesn't make any sense to you, just accept the default '$dflt'.
7319 rp='Use relocatable @INC?'
7322 y|Y) val="$define" ;;
7325 set userelocatableinc
7328 initialinstalllocation="$binexp"
7329 : Default prefix is now "up one level from where the binaries are"
7330 case "$userelocatableinc" in
7336 installprefixexp=".../.."
7340 : determine where private library files go
7341 : Usual default is /usr/local/lib/perl5/$version.
7342 : Also allow things like /opt/perl/lib/$version, since
7343 : /opt/perl/lib/perl5... would be redundant.
7344 : The default "style" setting is made in installstyle.U
7345 case "$installstyle" in
7346 *lib/perl5*) set dflt privlib lib/$package/$version ;;
7347 *) set dflt privlib lib/$version ;;
7352 There are some auxiliary files for $package that need to be put into a
7353 private library directory that is accessible by everyone.
7358 rp='Pathname where the private library files will reside?'
7363 : set the prefixup variable, to restore leading tilda escape
7364 prefixup='case "$prefixexp" in
7366 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
7369 : determine where public architecture dependent libraries go
7372 : privlib default is /usr/local/lib/$package/$version
7373 : archlib default is /usr/local/lib/$package/$version/$archname
7374 : privlib may have an optional trailing /share.
7375 tdflt=`echo $privlib | $sed 's,/share$,,'`
7376 tdflt=$tdflt/$archname
7385 $spackage contains architecture-dependent library files. If you are
7386 sharing libraries in a heterogeneous environment, you might store
7387 these files in a separate location. Otherwise, you can just include
7388 them with the rest of the public library files.
7393 rp='Where do you want to put the public architecture-dependent libraries?'
7397 if $test X"$archlib" = X"$privlib"; then
7403 : see if setuid scripts can be secure
7406 Some kernels have a bug that prevents setuid #! scripts from being
7407 secure. Some sites have disabled setuid #! scripts because of this.
7409 First let's decide if your kernel supports secure setuid #! scripts.
7410 (If setuid #! scripts would be secure but have been disabled anyway,
7411 don't say that they are secure if asked.)
7416 if $test -d /dev/fd; then
7417 echo "#!$ls" >reflect
7418 chmod +x,u+s reflect
7419 ./reflect >flect 2>&1
7420 if $contains "/dev/fd" flect >/dev/null; then
7421 echo "Congratulations, your kernel has secure setuid scripts!" >&4
7425 If you are not sure if they are secure, I can check but I'll need a
7426 username and password different from the one you are using right now.
7427 If you don't have such a username or don't want me to test, simply
7431 rp='Other username to test security of setuid scripts with?'
7436 case "$d_suidsafe" in
7437 '') echo "I'll assume setuid scripts are *not* secure." >&4
7440 echo "Well, the $hint value is *not* secure." >&4
7442 *) echo "Well, the $hint value *is* secure." >&4
7447 $rm -f reflect flect
7448 echo "#!$ls" >reflect
7449 chmod +x,u+s reflect
7452 echo '"su" will (probably) prompt you for '"$ans's password."
7453 su $ans -c './reflect >flect'
7454 if $contains "/dev/fd" flect >/dev/null; then
7455 echo "Okay, it looks like setuid scripts are secure." >&4
7458 echo "I don't think setuid scripts are secure." >&4
7463 rp='Does your kernel have *secure* setuid scripts?'
7466 [yY]*) val="$define";;
7471 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
7472 echo "(That's for file descriptors, not floppy disks.)"
7478 $rm -f reflect flect
7480 : now see if they want to do setuid emulation
7481 if $test $patchlevel -lt 11; then
7484 case "$d_suidsafe" in
7487 echo "No need to emulate SUID scripts since they are secure here." >&4
7491 Some systems have disabled setuid scripts, especially systems where
7492 setuid scripts cannot be secure. On systems where setuid scripts have
7493 been disabled, the setuid/setgid bits on scripts are currently
7494 useless. It is possible for $package to detect those bits and emulate
7495 setuid/setgid in a secure fashion. This emulation will only work if
7496 setuid scripts have been disabled in your kernel.
7500 "$define") dflt=y ;;
7503 rp="Do you want to do setuid/setgid emulation?"
7506 [yY]*) val="$define";;
7518 SUID emulation has been removed for 5.12
7519 Please re-run Configure without -Dd_dosuid
7528 : Find perl5.005 or later.
7529 echo "Looking for a previously installed perl5.005 or later... "
7531 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
7532 : Check if this perl is recent and can load a simple module
7533 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
7536 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
7546 '') echo "None found. That's ok.";;
7547 *) echo "Using $perl5." ;;
7550 : Set the siteprefix variables
7553 After $package is installed, you may wish to install various
7554 add-on modules and utilities. Typically, these add-ons will
7555 be installed under $prefix with the rest
7556 of this package. However, you may wish to install such add-ons
7557 elsewhere under a different prefix.
7559 If you do not wish to put everything under a single prefix, that's
7560 ok. You will be prompted for the individual locations; this siteprefix
7561 is only used to suggest the defaults.
7563 The default should be fine for most people.
7567 rp='Installation prefix to use for add-on modules and utilities?'
7568 : XXX Here might be another good place for an installstyle setting.
7569 case "$siteprefix" in
7571 *) dflt=$siteprefix ;;
7574 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
7576 case "$siteprefix" in
7580 *) oldsiteprefix="$prefix";;
7585 siteprefixexp="$ansexp"
7587 : determine where site specific libraries go.
7588 : Usual default is /usr/local/lib/perl5/site_perl/$version
7589 : The default "style" setting is made in installstyle.U
7590 : XXX No longer works with Prefixit stuff.
7591 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7593 '') case "$installstyle" in
7594 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
7595 *) dflt=$siteprefix/lib/site_$prog/$version ;;
7603 The installation process will create a directory for
7604 site-specific extensions and modules. Most users find it convenient
7605 to place all site-specific files in this directory rather than in the
7606 main distribution directory.
7610 rp='Pathname for the site-specific library files?'
7614 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
7616 : Determine list of previous versions to include in @INC
7617 $cat > getverlist <<EOPL
7620 \$api_versionstring = "$api_versionstring";
7621 \$version = "$version";
7622 \$stem = "$sitelib_stem";
7623 \$archname = "$archname";
7625 $cat >> getverlist <<'EOPL'
7626 # The list found is store twice for each entry: the original name, and
7627 # the binary broken down version as pack "sss", so sorting is easy and
7628 # unambiguous. This will work for all versions that have a maximum of
7629 # three digit groups, separate by '.'s or '_'s. Names are extended with
7630 # ".0.0" to ensure at least three elements for the pack.
7631 # -- H.Merijn Brand (m)'06 23-10-2006
7633 # Can't have leading @ because metaconfig interprets it as a command!
7634 ;@inc_version_list=();
7635 # XXX Redo to do opendir/readdir?
7638 ;@candidates = map {
7639 [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
7640 ;@candidates = sort { $a->[1] cmp $b->[1]} @candidates;
7646 ($pversion, $aversion, $vsn5005) = map {
7647 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
7648 foreach $d (@candidates) {
7649 if ($d->[1] lt $pversion) {
7650 if ($d->[1] ge $aversion) {
7651 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
7653 elsif ($d->[1] ge $vsn5005) {
7654 unshift(@inc_version_list, grep { -d } $d->[0]);
7658 # Skip newer version. I.e. don't look in
7659 # 5.7.0 if we're installing 5.6.1.
7663 if (@inc_version_list) {
7664 print join(' ', @inc_version_list);
7667 # Blank space to preserve value for next Configure run.
7672 case "$inc_version_list" in
7673 '') if test -x "$perl5$exe_ext"; then
7674 dflt=`$perl5 getverlist`
7679 $undef) dflt='none' ;;
7680 *) eval dflt=\"$inc_version_list\" ;;
7683 ''|' ') dflt=none ;;
7690 In order to ease the process of upgrading, this version of perl
7691 can be configured to use modules built and installed with earlier
7692 versions of perl that were installed under $prefix. Specify here
7693 the list of earlier versions that this version of perl should check.
7694 If Configure detected no earlier versions of perl installed under
7695 $prefix, then the list will be empty. Answer 'none' to tell perl
7696 to not search earlier versions.
7698 The default should almost always be sensible, so if you're not sure,
7699 just accept the default.
7702 rp='List of earlier versions to include in @INC?'
7705 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
7706 *) inc_version_list="$ans" ;;
7708 case "$inc_version_list" in
7710 inc_version_list_init='0'
7711 d_inc_version_list="$undef"
7713 *) inc_version_list_init=`echo $inc_version_list |
7714 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
7715 d_inc_version_list="$define"
7720 : see if malloc/malloc.h has to be included
7721 set malloc/malloc.h i_mallocmalloc
7724 : see if this is a malloc.h system
7725 : we want a real compile instead of Inhdr because some systems have a
7726 : malloc.h that just gives a compile error saying to use stdlib.h instead
7731 #$i_mallocmalloc I_MALLOCMALLOC
7732 #ifdef I_MALLOCMALLOC
7733 # include <malloc/malloc.h>
7736 int main () { return 0; }
7739 if eval $compile; then
7740 echo "<malloc.h> found." >&4
7743 echo "<malloc.h> NOT found." >&4
7750 : check for length of pointer
7754 echo "Checking to see how big your pointers are..." >&4
7763 printf("%d\n", (int)sizeof(void *));
7768 if eval $compile_ok; then
7769 ptrsize=`$run ./try`
7770 echo "Your pointers are $ptrsize bytes long."
7773 echo "(I can't seem to compile the test program. Guessing...)" >&4
7774 rp="What is the size of a pointer (in bytes)?"
7781 case "$use64bitall" in
7782 "$define"|true|[yY]*)
7786 *** You have chosen a maximally 64-bit build,
7787 *** but your pointers are only 4 bytes wide.
7788 *** Please rerun Configure without -Duse64bitall.
7793 *** Since you have quads, you could possibly try with -Duse64bitint.
7798 *** Cannot continue, aborting.
7808 : determine whether to use malloc wrapping
7810 case "$usemallocwrap" in
7811 [yY]*|true|$define) dflt='y' ;;
7812 [nN]*|false|$undef) dflt='n' ;;
7813 *) case "$usedevel" in
7814 [yY]*|true|$define) dflt='y' ;;
7819 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
7821 usemallocwrap="$ans"
7824 usemallocwrap="$define" ;;
7826 usemallocwrap="$undef" ;;
7829 : determine which malloc to compile in
7831 case "$usemymalloc" in
7832 [yY]*|true|$define) dflt='y' ;;
7833 [nN]*|false|$undef) dflt='n' ;;
7834 *) case "$ptrsize" in
7838 if test "$useithreads" = "$define"; then dflt='n'; fi
7841 rp="Do you wish to attempt to use the malloc that comes with $package?"
7847 mallocsrc='malloc.c'
7848 mallocobj="malloc$_o"
7849 d_mymalloc="$define"
7852 : Remove malloc from list of libraries to use
7853 echo "Removing unneeded -lmalloc from library list" >&4
7854 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
7857 echo "libs = $libs" >&4
7869 : compute the return types of malloc and free
7871 $cat >malloc.c <<END
7875 #include <sys/types.h>
7889 case "$malloctype" in
7891 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
7898 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
7902 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
7909 echo "Your system uses $freetype free(), it would seem." >&4
7911 : determine where site specific architecture-dependent libraries go.
7912 : sitelib default is /usr/local/lib/perl5/site_perl/$version
7913 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
7914 : sitelib may have an optional trailing /share.
7916 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
7917 dflt="$dflt/$archname"
7922 set sitearch sitearch none
7926 The installation process will also create a directory for
7927 architecture-dependent site-specific extensions and modules.
7931 rp='Pathname for the site-specific architecture-dependent library files?'
7935 if $test X"$sitearch" = X"$sitelib"; then
7938 d_sitearch="$define"
7941 : Set the vendorprefix variables
7944 The installation process will also create a directory for
7945 vendor-supplied add-ons. Vendors who supply perl with their system
7946 may find it convenient to place all vendor-supplied files in this
7947 directory rather than in the main distribution directory. This will
7948 ease upgrades between binary-compatible maintenance versions of perl.
7950 Of course you may also use these directories in whatever way you see
7951 fit. For example, you might use them to access modules shared over a
7952 company-wide network.
7954 The default answer should be fine for most people.
7955 This causes further questions about vendor add-ons to be skipped
7956 and no vendor-specific directories will be configured for perl.
7959 rp='Do you want to configure vendor-specific add-on directories?'
7960 case "$usevendorprefix" in
7961 define|true|[yY]*) dflt=y ;;
7962 *) : User may have set vendorprefix directly on Configure command line.
7963 case "$vendorprefix" in
7972 rp='Installation prefix to use for vendor-supplied add-ons?'
7973 case "$vendorprefix" in
7974 '') dflt="$prefix" ;;
7975 *) dflt=$vendorprefix ;;
7978 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
7980 case "$vendorprefix" in
7984 *) oldvendorprefix="$prefix";;
7988 usevendorprefix="$define"
7990 vendorprefixexp="$ansexp"
7992 *) usevendorprefix="$undef"
7998 : Set the vendorlib variables
7999 case "$vendorprefix" in
8000 '') d_vendorlib="$undef"
8004 *) d_vendorlib="$define"
8005 : determine where vendor-supplied modules go.
8006 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
8007 case "$vendorlib" in
8009 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8010 case "$installstyle" in
8011 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
8012 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
8015 *) dflt="$vendorlib"
8019 rp='Pathname for the vendor-supplied library files?'
8022 vendorlibexp="$ansexp"
8025 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
8029 : Set the vendorarch variables
8030 case "$vendorprefix" in
8031 '') d_vendorarch="$undef"
8035 *) d_vendorarch="$define"
8036 : determine where vendor-supplied architecture-dependent libraries go.
8037 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
8038 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
8039 : vendorlib may have an optional trailing /share.
8040 case "$vendorarch" in
8041 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
8042 dflt="$dflt/$archname"
8044 *) dflt="$vendorarch" ;;
8047 rp='Pathname for vendor-supplied architecture-dependent files?'
8050 vendorarchexp="$ansexp"
8053 prefixvar=vendorarch
8055 if $test X"$vendorarch" = X"$vendorlib"; then
8056 d_vendorarch="$undef"
8058 d_vendorarch="$define"
8061 : Final catch-all directories to search
8064 Lastly, you can have perl look in other directories for extensions and
8065 modules in addition to those already specified.
8066 These directories will be searched after
8070 test X"$vendorlib" != "X" && echo ' ' $vendorlib
8071 test X"$vendorarch" != "X" && echo ' ' $vendorarch
8073 case "$otherlibdirs" in
8074 ''|' ') dflt='none' ;;
8075 *) dflt="$otherlibdirs" ;;
8078 Enter a colon-separated set of extra paths to include in perl's @INC
8079 search path, or enter 'none' for no extra paths.
8083 rp='Colon-separated list of additional directories for perl to search?'
8086 ' '|''|none) otherlibdirs=' ' ;;
8087 *) otherlibdirs="$ans" ;;
8089 case "$otherlibdirs" in
8093 set d_perl_otherlibdirs
8097 dflt_dtrace='/usr/sbin/dtrace'
8098 $test -x /usr/bin/dtrace && dflt_dtrace='/usr/bin/dtrace'
8102 Perl can be built to support DTrace on platforms that support it.
8103 DTrace is a diagnosis and performance analysis tool from Sun.
8105 If this doesn't make any sense to you, just accept the default.
8109 case "$usedtrace" in
8115 dflt_dtrace=$usedtrace
8122 rp='Support DTrace if available?'
8125 y|Y) val="$define" ;;
8131 test "X$usedtrace" != "X$define" && break
8134 rp='Where is the dtrace executable?'
8143 if $dtrace -h -s ../perldtrace.d \
8144 -o perldtrace.tmp >/dev/null 2>&1 \
8145 && rm -f perldtrace.tmp
8148 echo "Good: your $dtrace knows about the -h flag."
8152 *** $me: Fatal Error: $dtrace doesn't support -h flag
8154 *** Your installed dtrace doesn't support the -h switch to compile a D
8155 *** program into a C header. Can't continue.
8167 *** $me: Fatal Error: $dtrace not found.
8174 echo "*** $dtrace was not found."
8180 : See if we want extra modules installed
8187 Perl can be built with extra modules or bundles of modules which
8188 will be fetched from the CPAN and installed alongside Perl.
8190 Notice that you will need access to the CPAN; either via the Internet,
8191 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
8192 be asked later to configure the CPAN.pm module which will in turn do
8193 the installation of the rest of the extra modules or bundles.)
8195 Notice also that if the modules require any external software such as
8196 libraries and headers (the libz library and the zlib.h header for the
8197 Compress::Zlib module, for example) you MUST have any such software
8198 already installed, this configuration process will NOT install such
8201 If this doesn't make any sense to you, just accept the default '$dflt'.
8203 rp='Install any extra modules (y or n)?'
8209 Please list any extra modules or bundles to be installed from CPAN,
8210 with spaces between the names. The names can be in any format the
8211 'install' command of CPAN.pm will understand. (Answer 'none',
8212 without the quotes, to install no extra modules or bundles.)
8222 $rm -f ../extras.lst
8224 *) echo "(Saving the list of extras for later...)"
8225 echo "$extras" > ../extras.lst
8233 : determine where html pages for programs go
8234 set html1dir html1dir none
8238 If you wish to install html files for programs in $spackage, indicate
8239 the appropriate directory here. To skip installing html files,
8243 ''|none|$undef|' ') dflt=none ;;
8244 *) dflt=$html1dir ;;
8247 rp="Directory for the main $spackage html pages?"
8251 : Use ' ' for none so value is preserved next time through Configure
8252 $test X"$html1dir" = "X" && html1dir=' '
8254 : determine where html pages for libraries and modules go
8255 set html3dir html3dir none
8259 If you wish to install html files for modules associated with $spackage,
8260 indicate the appropriate directory here. To skip installing html files,
8263 : There is no obvious default. If they have specified html1dir, then
8264 : try to key off that, possibly changing .../html1 into .../html3.
8266 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
8267 *) dflt=$html3dir ;;
8270 rp="Directory for the $spackage module html pages?"
8274 : Use ' ' for none so value is preserved next time through Configure
8275 $test X"$html3dir" = "X" && html3dir=' '
8277 : determine whether to install perl also as /usr/bin/perl
8280 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
8282 Many scripts expect perl to be installed as /usr/bin/perl.
8284 If you want to, I can install the perl you are about to compile
8285 as /usr/bin/perl (in addition to $bin/perl).
8287 if test -f /usr/bin/perl; then
8290 However, please note that because you already have a /usr/bin/perl,
8291 overwriting that with a new Perl would very probably cause problems.
8292 Therefore I'm assuming you don't want to do that (unless you insist).
8295 case "$installusrbinperl" in
8296 "$define"|[yY]*) dflt='y';;
8302 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
8305 case "$installusrbinperl" in
8306 "$undef"|[nN]*) dflt='n';;
8310 rp="Do you want to install perl as /usr/bin/perl?"
8313 [yY]*) val="$define";;
8319 set installusrbinperl
8322 : see if dlopen exists
8324 xxx_ccflags="$ccflags"
8326 : with g++ one needs -shared to get is-in-libc to work for dlopen
8327 case "$gccversion" in
8330 *) case "$d_cplusplus" in
8331 "$define") ccflags="$ccflags -shared" ;;
8338 ccflags="$xxx_ccflags"
8340 : see if this is a unistd.h system
8341 set unistd.h i_unistd
8344 : determine which dynamic loading, if any, to compile in
8346 dldir="ext/DynaLoader"
8359 $define) dflt='y' ;;
8361 : Does a dl_xxx.xs file exist for this operating system
8362 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
8365 rp="Do you wish to use dynamic loading?"
8372 '') if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
8373 dflt="$dldir/dl_${osname}.xs"
8374 elif $test "$d_dlopen" = "$define" ; then
8375 dflt="$dldir/dl_dlopen.xs"
8380 *) dflt="$dldir/$dlsrc"
8383 echo "The following dynamic loading files are available:"
8384 : Can not go over to $dldir because getfile has path hard-coded in.
8385 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
8386 rp="Source file to use for dynamic loading"
8392 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
8396 Some systems may require passing special flags to $cc -c to
8397 compile modules that will be used to create a shared library.
8398 To use no flags, say "none".
8401 case "$cccdlflags" in
8402 '') case "$gccversion" in
8403 '') case "$osname" in
8405 irix*) dflt='-KPIC' ;;
8406 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
8407 sunos) dflt='-pic' ;;
8411 *) case "$osname" in
8412 darwin) dflt='none' ;;
8413 *linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
8418 *) dflt="$cccdlflags" ;;
8425 # If -Dsysroot was specified, now's the time to add it
8427 if test "X$sysroot" != X; then
8428 case "$gccversion" in
8433 dflt="$dflt --sysroot=$sysroot" ;;
8443 rp="Any special flags to pass to $cc -c to compile shared library modules?"
8446 none) cccdlflags=' ' ;;
8447 *) cccdlflags="$ans" ;;
8452 Some systems use ld to create libraries that can be dynamically loaded,
8453 while other systems (such as those using ELF) use $cc.
8457 : Determine if this is ELF
8459 /* Test for whether ELF binaries are produced */
8471 int i = open("a.out",O_RDONLY);
8474 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
8475 exit(0); /* succeed (yes, it is ELF) */
8479 if $cc $ccflags $ldflags -o a.out try.c >/dev/null 2>&1 && $run ./a.out; then
8485 '') if $test $bin_ELF = "$define"; then
8487 You appear to have ELF support. I'll use $cc to build dynamic libraries.
8491 echo "I'll use ld to build dynamic libraries."
8499 rp="What command should be used to create dynamic libraries?"
8505 Some systems may require passing special flags to $ld to create a
8506 library that can be dynamically loaded. If your ld flags include
8507 -L/other/path options to locate libraries outside your loader's normal
8508 search path, you may need to specify those -L options here as well. To
8509 use no flags, say "none".
8512 case "$lddlflags" in
8513 '') case "$osname" in
8514 haiku) dflt='-shared' ;;
8516 case "$gccversion" in
8517 '') dflt="$dflt +vnocompatwarnings" ;;
8520 *linux*|irix*|gnu*) dflt="-shared $optimize" ;;
8521 solaris) # See [perl #66604].
8522 # On Solaris 11, gcc -m64 on amd64
8523 # appears not to understand -G. gcc versions at
8524 # least as old as 3.4.3 support -shared, so just
8525 # use that with Solaris 11 and later, but keep
8526 # the old behavior for older Solaris versions.
8527 case "$gccversion" in
8529 *) case "$osvers" in
8530 2.?|2.10) dflt='-G' ;;
8531 *) dflt='-shared' ;;
8536 sunos) dflt='-assert nodefinitions' ;;
8537 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
8541 *) dflt="$lddlflags" ;;
8544 : Only do this for gcc, since, for example, qcc has no concept
8546 if $test "X$sysroot" != X; then
8547 case "$gccversion" in
8549 *) dflt="$dflt --sysroot $sysroot" ;;
8553 : Try to guess additional flags to pick up local libraries.
8554 : Be careful not to append to a plain 'none'
8558 for thisflag in $ldflags; do
8563 *) dflt="$dflt $thisflag" ;;
8570 ''|' ') dflt='none' ;;
8574 *-fstack-protector-strong*)
8576 *-fstack-protector-strong*) ;; # Don't add it again
8577 *) dflt="$dflt -fstack-protector-strong" ;;
8580 *-fstack-protector*)
8582 *-fstack-protector*) ;; # Don't add it again
8583 *) dflt="$dflt -fstack-protector" ;;
8588 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
8591 none) lddlflags=' ' ;;
8592 *) lddlflags="$ans" ;;
8597 Some systems may require passing special flags to $cc to indicate that
8598 the resulting executable will use dynamic linking. To use no flags,
8602 case "$ccdlflags" in
8603 '') case "$osname" in
8604 *linux*|hpux|gnu*) dflt='-Wl,-E' ;;
8605 sunos) dflt='none' ;;
8609 *) dflt="$ccdlflags" ;;
8611 rp="Any special flags to pass to $cc to use dynamic linking?"
8614 none) ccdlflags=' ' ;;
8615 *) ccdlflags="$ans" ;;
8627 ld_can_script="$undef"
8628 case "$bin_ELF$usedl" in
8630 # Abuse try.h and a.out names for neat cleanup
8642 if $cc $cccdlflags $ccdlflags $ccflags \
8643 $ldflags $lddlflags -o a.out try.c \
8644 -Wl,--version-script=try.h >/dev/null 2>&1 \
8645 && $test -s a.out ; then
8646 echo "ld supports scripting" >&4
8647 ld_can_script="$define"
8649 echo "ld does not support scripting" >&4
8655 : Do we want a shared libperl?
8659 # No dynamic loading being used, so don't bother even to prompt.
8662 *) case "$useshrplib" in
8663 '') case "$osname" in
8664 svr4*|nonstopux|dgux|dynixptx|esix|powerux|haiku|cygwin*)
8666 also='Building a shared libperl is required for dynamic loading to work on your system.'
8680 The perl executable is normally obtained by linking perlmain.c with
8681 libperl${_a}, any static extensions (usually just DynaLoader), and
8682 any other libraries needed on this system (such as -lm, etc.). Since
8683 your system supports dynamic loading, it is probably possible to build
8684 a shared libperl.$so. If you will have more than one executable linked
8685 to libperl.$so, this will significantly reduce the size of each
8686 executable, but it may have a noticeable effect on performance. The
8687 default is probably sensible for your system.
8691 rp="Build a shared libperl.$so (y/n)"
8695 useshrplib='true' ;;
8696 *) useshrplib='false' ;;
8701 case "$useshrplib" in
8703 case "$userelocatableinc" in
8705 echo "Cannot build with both -Duserelocatableinc and -Duseshrplib" >&4
8706 echo "See INSTALL for an explanation why that won't work." >&4
8712 # Figure out a good name for libperl.so. Since it gets stored in
8713 # a version-specific architecture-dependent library, the version
8714 # number isn't really that important, except for making cc/ld happy.
8716 # A name such as libperl.so.10.1
8717 majmin="libperl.$so.$patchlevel.$subversion"
8718 # A name such as libperl.so.100
8719 majonly=`echo $patchlevel $subversion |
8720 $awk '{printf "%d%02d", $1, $2}'`
8721 majonly=libperl.$so.$majonly
8722 # I'd prefer to keep the os-specific stuff here to a minimum, and
8723 # rely on figuring it out from the naming of libc.
8724 case "${osname}${osvers}" in
8725 *linux*|gnu*) # ld won't link with a bare -lperl otherwise.
8728 cygwin*) # ld links now against the dll directly
8729 majmin="cygperl5_${patchlevel}_${subversion}.${so}"
8730 majonly=`echo $patchlevel $subversion |
8731 $awk '{printf "%03d%03d", $1, $2}'`
8732 majonly=cygperl5.$majonly.$so
8735 *) # Try to guess based on whether libc has major.minor.
8737 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8738 *libc.$so.[0-9]*) dflt=$majonly ;;
8739 *) dflt=libperl.$so ;;
8749 I need to select a good name for the shared libperl. If your system uses
8750 library names with major and minor numbers, then you might want something
8751 like $majmin. Alternatively, if your system uses a single version
8752 number for shared libraries, then you might want to use $majonly.
8753 Or, your system might be quite happy with a simple libperl.$so.
8755 Since the shared libperl will get installed into a version-specific
8756 architecture-dependent directory, the version number of the shared perl
8757 library probably isn't important, so the default should be o.k.
8760 rp='What name do you want to give to the shared libperl?'
8763 echo "Ok, I'll use $libperl"
8766 libperl="libperl${_a}"
8770 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8774 WARNING: Use of the shrpdir variable for the installation location of
8775 the shared $libperl is not supported. It was never documented and
8776 will not work in this version. Let me (perlbug@perl.org)
8777 know of any problems this may cause.
8783 But your current setting of $shrpdir is
8784 the default anyway, so it's harmless.
8789 Further, your current attempted setting of $shrpdir
8790 conflicts with the value of $archlibexp/CORE
8791 that installperl will use.
8798 # How will the perl executable find the installed shared $libperl?
8799 # Add $xxx to ccdlflags.
8800 # If we can't figure out a command-line option, use $shrpenv to
8801 # set env LD_RUN_PATH. The main perl makefile uses this.
8802 shrpdir=$archlibexp/CORE
8805 if "$useshrplib"; then
8808 # We'll set it in Makefile.SH...
8813 freebsd|minix|mirbsd|netbsd|openbsd|interix|dragonfly|bitrig)
8814 xxx="-Wl,-R$shrpdir"
8816 bsdos|linux|irix*|dec_osf|gnu*|haiku)
8817 xxx="-Wl,-rpath,$shrpdir"
8820 # hpux doesn't like the default, either.
8821 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8824 # cygwin needs only ldlibpth
8827 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8833 # Only add $xxx if it isn't already in ccdlflags.
8834 case " $ccdlflags " in
8836 *) ccdlflags="$ccdlflags $xxx"
8839 Adding $xxx to the flags
8840 passed to $ld so that the perl executable will find the
8841 installed shared $libperl.
8849 # Fix ccdlflags in AIX for building external extensions.
8850 # (For building Perl itself bare -bE:perl.exp is needed,
8851 # Makefile.SH takes care of this.)
8853 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8855 # Respect a hint or command-line value.
8857 '') shrpenv="$tmp_shrpenv" ;;
8859 case "$ldlibpthname" in
8860 '') ldlibpthname=LD_LIBRARY_PATH ;;
8861 none) ldlibpthname='' ;;
8864 : determine where manual pages are on this system
8868 syspath='/usr/share/man/man1 /usr/man/man1'
8869 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8870 syspath="$syspath /usr/man/u_man/man1"
8871 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8872 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8873 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8874 sysman=`./loc . /usr/man/man1 $syspath`
8877 if $test -d "$sysman"; then
8878 echo "System manual is in $sysman." >&4
8880 echo "Could not find manual pages in source form." >&4
8883 : determine where manual pages go
8884 set man1dir man1dir none
8888 $spackage has manual pages available in source form.
8892 echo "However, you don't have nroff, so they're probably useless to you."
8894 '') man1dir="none";;
8897 echo "If you don't want the manual sources installed, answer 'none'."
8902 lookpath="$prefixexp/share/man/man1"
8903 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8904 lookpath="$lookpath $prefixexp/man/p_man/man1"
8905 lookpath="$lookpath $prefixexp/man/u_man/man1"
8906 lookpath="$lookpath $prefixexp/man/man.1"
8908 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8909 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8919 rp="Where do the main $spackage manual pages (source) go?"
8921 if $test "X$man1direxp" != "X$ansexp"; then
8932 : What suffix to use on installed man pages
8939 rp="What suffix should be used for the main $spackage man pages?"
8941 '') case "$man1dir" in
8955 *) dflt="$man1ext";;
8962 : see if we can have long filenames
8964 first=123456789abcdef
8966 if (echo hi >$first) 2>/dev/null; then
8967 if $test -f 123456789abcde; then
8968 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8971 echo 'You can have filenames longer than 14 characters.'>&4
8976 You can't have filenames longer than 14 chars.
8977 You can't even think about them!
8983 $rm -rf 123456789abcde*
8985 : determine where library module manual pages go
8986 set man3dir man3dir none
8990 $spackage has manual pages for many of the library modules.
8996 However, you don't have nroff, so they're probably useless to you.
8999 '') man3dir="none";;
9003 case "$d_flexfnam" in
9006 However, your system can't handle the long file names like File::Basename.3.
9009 '') man3dir="none";;
9013 echo "If you don't want the manual sources installed, answer 'none'."
9014 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
9016 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
9017 if $test -d "$privlib/man/man3"; then
9020 WARNING: Previous versions of perl installed man3 pages into
9021 $privlib/man/man3. This version will suggest a
9022 new default of $dflt.
9026 rp='Do you wish to preserve the old behavior?(y/n)'
9029 y*) dflt="$privlib/man/man3" ;;
9034 *) dflt="$man3dir" ;;
9041 rp="Where do the $package library man pages (source) go?"
9051 : What suffix to use on installed man pages
9057 rp="What suffix should be used for the $package library man pages?"
9059 '') case "$man3dir" in
9073 *) dflt="$man3ext";;
9080 : see if we have to deal with yellow pages, now NIS.
9081 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
9087 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
9095 rp='Are you getting the hosts file via yellow pages?'
9098 y*) hostcat='ypcat hosts';;
9099 *) hostcat='cat /etc/hosts';;
9105 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
9108 '') test -f /etc/group && groupcat='cat /etc/group';;
9111 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
9114 : now get the host name
9116 echo "Figuring out host name..." >&4
9117 case "$myhostname" in
9119 echo 'Maybe "hostname" will work...'
9120 if tans=`sh -c hostname 2>&1` ; then
9128 if $test "$cont"; then
9130 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
9131 if tans=`cat /etc/systemid 2>&1` ; then
9133 phostname='cat /etc/systemid'
9134 echo "Whadyaknow. Xenix always was a bit strange..."
9137 elif $test -r /etc/systemid; then
9138 echo "(What is a non-Xenix system doing with /etc/systemid?)"
9141 if $test "$cont"; then
9142 echo 'No, maybe "uuname -l" will work...'
9143 if tans=`sh -c 'uuname -l' 2>&1` ; then
9145 phostname='uuname -l'
9147 echo 'Strange. Maybe "uname -n" will work...'
9148 if tans=`sh -c 'uname -n' 2>&1` ; then
9150 phostname='uname -n'
9152 echo 'Oh well, maybe I can mine it out of whoami.h...'
9153 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
9154 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
9155 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
9157 case "$myhostname" in
9158 '') echo "Does this machine have an identity crisis or something?"
9161 echo "Well, you said $myhostname before..."
9162 phostname='echo $myhostname';;
9168 case "$myhostname" in
9169 '') myhostname=noname ;;
9171 : you do not want to know about this
9176 if $test "$myhostname" ; then
9178 rp='Your host name appears to be "'$myhostname'".'" Right?"
9186 : bad guess or no guess
9187 while $test "X$myhostname" = X ; do
9189 rp="Please type the (one word) name of your host:"
9194 : translate upper to lower if necessary
9195 case "$myhostname" in
9197 echo "(Normalizing case in your host name)"
9198 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
9202 case "$myhostname" in
9204 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
9205 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
9206 echo "(Trimming domain name from host name--host name is now $myhostname)"
9208 *) case "$mydomain" in
9211 test "X$hostcat" = "Xypcat hosts" &&
9212 ypmatch "$myhostname" hosts 2>/dev/null |\
9213 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
9216 test "X$hostcat" != "X" &&
9217 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
9218 /[ ]$myhostname[ . ]/p" > hosts
9221 if $test -f hosts; then
9222 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
9223 END { print sum }" hosts` = x1 || tmp_re="[ ]"
9224 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
9225 hosts | $sort | $uniq | \
9226 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
9227 case `$echo X$dflt` in
9228 X*\ *) echo "(Several hosts in the database matched hostname)"
9231 X.) echo "(You do not have fully-qualified names in the hosts database)"
9235 echo "(I cannot locate a hosts database anywhere)"
9240 tans=`./loc resolv.conf X /etc /usr/etc`
9241 if $test -f "$tans"; then
9242 echo "(Attempting domain name extraction from $tans)"
9243 dflt=.`$sed -n -e 's/ / /g' \
9244 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
9247 .) dflt=.`$sed -n -e 's/ / /g' \
9248 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
9256 .) echo "(No help from resolv.conf either -- attempting clever guess)"
9257 dflt=.`sh -c domainname 2>/dev/null`
9260 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
9264 case "$dflt$osname" in
9265 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
9266 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
9270 .) echo "(Lost all hope -- silly guess then)"
9276 *) dflt="$mydomain";;
9280 rp="What is your domain name?"
9290 : translate upper to lower if necessary
9293 echo "(Normalizing case in your domain name)"
9294 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
9298 : a little sanity check here
9299 case "$phostname" in
9302 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
9303 $myhostname$mydomain|$myhostname) ;;
9305 case "$phostname" in
9307 echo "(That doesn't agree with your whoami.h file, by the way.)"
9310 echo "(That doesn't agree with your $phostname command, by the way.)"
9318 : determine the e-mail address of the user who is running us
9321 I need to get your e-mail address in Internet format if possible, i.e.
9322 something like user@host.domain. Please answer accurately since I have
9323 no easy means to double check it. The default value provided below
9324 is most probably close to reality but may not be valid from outside
9325 your organization...
9329 while test "$cont"; do
9330 case "$MAILDOMAIN" in
9332 if $test -s /etc/mailname; then
9333 maildomain=`$cat /etc/mailname`
9335 maildomain="$myhostname$mydomain"
9338 *) maildomain="$MAILDOMAIN";;
9341 '') dflt="$cf_by@$maildomain";;
9342 *) dflt="$cf_email";;
9344 rp='What is your e-mail address?'
9350 rp='Address does not look like an Internet one. Use it anyway?'
9364 : Ask e-mail of administrator
9367 If you or somebody else will be maintaining perl at your site, please
9368 fill in the correct e-mail address here so that they may be contacted
9369 if necessary. Currently, the "perlbug" program included with perl
9370 will send mail to this address in addition to perlbug@perl.org. You may
9371 enter "none" for no administrator.
9374 case "$perladmin" in
9375 '') dflt="$cf_email";;
9376 *) dflt="$perladmin";;
9378 rp='Perl administrator e-mail address'
9382 : determine whether to use a version number suffix for installed binaries
9385 Do you want to use a version number suffix for installed binaries? This
9386 will install 'perl$version' instead of 'perl', and likewise for other
9387 binaries like 'perldoc' and 'cpan'. This allows many versions of perl
9388 to be installed side-by-side. Unless you are a developer, you probably
9389 do *not* want to do this.
9391 case "$versiononly" in
9392 "$define"|[Yy]*|true) dflt='y' ;;
9395 rp="Do you want to use a version number suffix for installed binaries?"
9398 [yY]*) val="$define";;
9404 case "$versiononly" in
9405 "$define") inc_version_list=''
9406 inc_version_list_init=0
9410 : figure out how to guarantee perl startup
9411 : XXX Note that this currently takes advantage of the bug that binexp ignores
9412 : the Configure -Dinstallprefix setting, which in turn means that under
9413 : relocatable @INC, initialinstalllocation is what binexp started as.
9414 case "$startperl" in
9416 case "$sharpbang" in
9420 I can use the #! construct to start perl on your system. This will
9421 make startup of perl scripts faster, but may cause problems if you
9422 want to share those scripts and perl is not in a standard place
9423 ($initialinstalllocation/perl) on all your platforms. The alternative
9424 is to force a shell by starting the script with a single ':' character.
9427 case "$versiononly" in
9428 "$define") dflt="$initialinstalllocation/perl$version";;
9429 *) dflt="$initialinstalllocation/perl";;
9431 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
9434 none) startperl=": # use perl";;
9435 *) startperl="#!$ans"
9436 if $test 30 -lt `echo "$ans" | wc -c`; then
9439 WARNING: Some systems limit the #! command to 32 characters.
9440 If you experience difficulty running Perl scripts with #!, try
9441 installing Perl in a directory with a shorter pathname.
9447 *) startperl=": # use perl"
9452 echo "I'll use $startperl to start perl scripts."
9454 : figure best path for perl in scripts
9457 case "$versiononly" in
9458 "$define") perlpath="$initialinstalllocation/perl$version";;
9459 *) perlpath="$initialinstalllocation/perl";;
9461 case "$startperl" in
9466 I will use the "eval 'exec'" idiom to start Perl on your system.
9467 I can use the full path of your Perl binary for this purpose, but
9468 doing so may cause problems if you want to share those scripts and
9469 Perl is not always in a standard place ($initialinstalllocation/perl).
9472 dflt="$initialinstalllocation/perl"
9473 rp="What path shall I use in \"eval 'exec'\"?"
9480 case "$startperl" in
9482 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
9485 : determine where public executable scripts go
9486 set scriptdir scriptdir
9488 case "$scriptdir" in
9491 : guess some guesses
9492 $test -d /usr/share/scripts && dflt=/usr/share/scripts
9493 $test -d /usr/share/bin && dflt=/usr/share/bin
9494 $test -d /usr/local/script && dflt=/usr/local/script
9495 $test -d /usr/local/scripts && dflt=/usr/local/scripts
9496 $test -d $prefixexp/script && dflt=$prefixexp/script
9500 *) dflt="$scriptdir"
9505 Some installations have a separate directory just for executable scripts so
9506 that they can mount it across multiple architectures but keep the scripts in
9507 one spot. You might, for example, have a subdirectory of /usr/share for this.
9508 Or you might just lump your scripts in with all your other executables.
9512 rp='Where do you keep publicly executable scripts?'
9514 if $test "X$ansexp" != "X$scriptdirexp"; then
9520 : A little fix up for an irregularly named variable.
9521 installscript="$installscriptdir"
9523 : determine where add-on public executables go
9525 '') dflt=$siteprefix/bin ;;
9529 rp='Pathname where the add-on public executables should be installed?'
9534 : determine where add-on html pages go
9535 : There is no standard location, so try to copy the previously-selected
9536 : directory structure for the core html pages.
9537 case "$sitehtml1dir" in
9538 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9539 *) dflt=$sitehtml1dir ;;
9542 ''|' ') dflt=none ;;
9545 rp='Pathname where the site-specific html pages should be installed?'
9547 prefixvar=sitehtml1dir
9550 : determine where add-on library html pages go
9551 : There is no standard location, so try to copy the previously-selected
9552 : directory structure for the core html pages.
9553 case "$sitehtml3dir" in
9554 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9555 *) dflt=$sitehtml3dir ;;
9558 ''|' ') dflt=none ;;
9561 rp='Pathname where the site-specific library html pages should be installed?'
9563 prefixvar=sitehtml3dir
9566 : determine where add-on manual pages go
9567 case "$siteman1dir" in
9568 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
9569 *) dflt=$siteman1dir ;;
9572 ''|' ') dflt=none ;;
9575 rp='Pathname where the site-specific manual pages should be installed?'
9577 prefixvar=siteman1dir
9580 : determine where add-on library man pages go
9581 case "$siteman3dir" in
9582 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
9583 *) dflt=$siteman3dir ;;
9586 ''|' ') dflt=none ;;
9589 rp='Pathname where the site-specific library manual pages should be installed?'
9591 prefixvar=siteman3dir
9594 : determine where add-on public executable scripts go
9595 case "$sitescript" in
9596 '') dflt=$siteprefix/script
9597 $test -d $dflt || dflt=$sitebin ;;
9598 *) dflt="$sitescript" ;;
9601 rp='Pathname where add-on public executable scripts should be installed?'
9603 prefixvar=sitescript
9606 : see if backtrace exists
9607 set backtrace d_backtrace
9610 : add flags if using c backtrace
9611 case "$usecbacktrace" in
9612 "") usecbacktrace=$undef ;;
9614 case "$d_backtrace" in
9616 case " $ccflags " in
9617 *" -DUSE_C_BACKTRACE "*) ;; # Already there.
9618 *) ccflags="$ccflags -DUSE_C_BACKTRACE -g" ;;
9622 echo "This system does not support backtrace" >&4
9623 usecbacktrace=$undef
9629 : Check if faststdio is requested and available
9630 case "$usefaststdio" in
9631 $define|true|[yY]*|'')
9632 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
9642 Perl can be built to use 'fast stdio', which means using the stdio
9643 library but also directly manipulating the stdio buffers to enable
9644 faster I/O. Using stdio is better for backward compatibility (especially
9645 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
9646 interface has been preferred instead of stdio.
9648 If this doesn't make any sense to you, just accept the default '$dflt'.
9650 rp='Use the "fast stdio" if available?'
9653 y|Y) val="$define" ;;
9659 : define an is-a-typedef? function
9660 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9662 "") inclist="sys/types.h";;
9664 eval "varval=\$$var";
9668 for inc in $inclist; do
9669 echo "#include <$inc>" >>temp.c;
9671 echo "#ifdef $type" >> temp.c;
9672 echo "printf(\"We have $type\");" >> temp.c;
9673 echo "#endif" >> temp.c;
9674 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9675 if $contains $type temp.E >/dev/null 2>&1; then
9681 *) eval "$var=\$varval";;
9684 : define an is-a-typedef? function that prompts if the type is not available.
9685 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9687 "") inclist="sys/types.h";;
9689 eval "varval=\$$var";
9693 for inc in $inclist; do
9694 echo "#include <$inc>" >>temp.c;
9696 echo "#ifdef $type" >> temp.c;
9697 echo "printf(\"We have $type\");" >> temp.c;
9698 echo "#endif" >> temp.c;
9699 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9701 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
9702 if $contains $type temp.E >/dev/null 2>&1; then
9703 echo "$type found." >&4;
9706 echo "$type NOT found." >&4;
9712 *) eval "$var=\$varval";;
9715 : see what type lseek is declared as in the kernel
9716 rp="What is the type used for lseek's offset on this system?"
9717 set off_t lseektype long stdio.h sys/types.h
9721 echo "Checking to see how big your file offsets are..." >&4
9723 #include <sys/types.h>
9727 printf("%d\n", (int)sizeof($lseektype));
9732 if eval $compile_ok; then
9733 lseeksize=`$run ./try`
9734 echo "Your file offsets are $lseeksize bytes long."
9738 echo "(I can't seem to compile the test program. Guessing...)"
9739 rp="What is the size of your file offsets (in bytes)?"
9745 : see what type file positions are declared as in the library
9746 rp="What is the type for file position used by fsetpos()?"
9747 set fpos_t fpostype long stdio.h sys/types.h
9750 : Check size for Fpos_t
9753 *_t) zzz="$fpostype" ;;
9756 echo "Checking the size of $zzz..." >&4
9758 #include <sys/types.h>
9765 printf("%d\n", (int)sizeof($fpostype));
9770 if eval $compile_ok; then
9774 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9777 echo "Your $zzz is $fpossize bytes long."
9783 echo "(I can't compile the test program. Guessing...)" >&4
9784 rp="What is the size of your file positions (in bytes)?"
9789 : Check for large file support
9790 # Backward compatibility (uselfs is deprecated).
9792 "$define"|true|[yY]*)
9795 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9797 uselargefiles="$define"
9801 case "$lseeksize:$fpossize" in
9804 You can have files larger than 2 gigabytes.
9807 *) case "$uselargefiles" in
9808 "$undef"|false|[nN]*) dflt='n' ;;
9813 Perl can be built to understand large files (files larger than 2 gigabytes)
9814 on some systems. To do so, Configure can be run with -Duselargefiles.
9816 If this doesn't make any sense to you, just accept the default '$dflt'.
9818 rp='Try to understand large files, if available?'
9821 y|Y) val="$define" ;;
9828 : Look for a hint-file generated 'call-back-unit'. If the
9829 : user has specified that a large files perl is to be built,
9830 : we may need to set or change some other defaults.
9831 if $test -f uselargefiles.cbu; then
9832 echo "Your platform has some specific hints regarding large file builds, using them..."
9833 . ./uselargefiles.cbu
9835 case "$uselargefiles" in
9837 if $test -f uselargefiles.cbu; then
9839 echo "Rechecking to see how big your file offsets are..." >&4
9841 #include <sys/types.h>
9845 printf("%d\n", (int)sizeof($lseektype));
9850 if eval $compile_ok; then
9851 lseeksize=`$run ./try`
9852 $echo "Your file offsets are now $lseeksize bytes long."
9856 echo "(I can't seem to compile the test program. Guessing...)"
9857 rp="What is the size of your file offsets (in bytes)?"
9862 *_t) zzz="$fpostype" ;;
9865 $echo $n "Rechecking the size of $zzz...$c" >&4
9867 #include <sys/types.h>
9874 printf("%d\n", (int)sizeof($fpostype));
9879 if eval $compile_ok; then
9884 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9887 echo " $fpossize bytes." >&4
9893 echo "(I can't compile the test program. Guessing...)" >&4
9894 rp="What is the size of your file positions (in bytes)?"
9903 : Check if we want perlio
9906 : Set the vendorbin variables
9907 case "$vendorprefix" in
9908 '') d_vendorbin="$undef"
9912 *) d_vendorbin="$define"
9913 : determine where vendor-supplied executables go.
9914 case "$vendorbin" in
9915 '') dflt=$vendorprefix/bin ;;
9916 *) dflt="$vendorbin" ;;
9919 rp='Pathname for the vendor-supplied executables directory?'
9922 vendorbinexp="$ansexp"
9928 : Set the vendorhtml1dir variables
9929 case "$vendorprefix" in
9930 '') vendorhtml1dir=''
9931 vendorhtml1direxp=''
9933 *) : determine where vendor-supplied html pages go.
9934 : There is no standard location, so try to copy the previously-selected
9935 : directory structure for the core html pages.
9936 : XXX Better default suggestions would be welcome.
9937 case "$vendorhtml1dir" in
9938 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9939 *) dflt=$vendorhtml1dir ;;
9942 ''|' ') dflt=none ;;
9945 rp='Pathname for the vendor-supplied html pages?'
9947 vendorhtml1dir="$ans"
9948 vendorhtml1direxp="$ansexp"
9951 : Use ' ' for none so value is preserved next time through Configure
9952 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9953 prefixvar=vendorhtml1dir
9956 : Set the vendorhtml3dir variables
9957 case "$vendorprefix" in
9958 '') vendorhtml3dir=''
9959 vendorhtml3direxp=''
9961 *) : determine where vendor-supplied module html pages go.
9962 : There is no standard location, so try to copy the previously-selected
9963 : directory structure for the core html pages.
9964 : XXX Better default suggestions would be welcome.
9965 case "$vendorhtml3dir" in
9966 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9967 *) dflt=$vendorhtml3dir ;;
9970 ''|' ') dflt=none ;;
9973 rp='Pathname for the vendor-supplied html pages?'
9975 vendorhtml3dir="$ans"
9976 vendorhtml3direxp="$ansexp"
9979 : Use ' ' for none so value is preserved next time through Configure
9980 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9981 prefixvar=vendorhtml3dir
9984 : Set the vendorman1dir variables
9985 case "$vendorprefix" in
9986 '') vendorman1dir=''
9989 *) : determine where vendor-supplied manual pages go.
9990 case "$vendorman1dir" in
9991 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9992 *) dflt=$vendorman1dir ;;
9995 ''|' ') dflt=none ;;
9998 rp='Pathname for the vendor-supplied manual section 1 pages?'
10000 vendorman1dir="$ans"
10001 vendorman1direxp="$ansexp"
10004 : Use ' ' for none so value is preserved next time through Configure
10005 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
10006 prefixvar=vendorman1dir
10009 : Set the vendorman3dir variables
10010 case "$vendorprefix" in
10011 '') vendorman3dir=''
10012 vendorman3direxp=''
10014 *) : determine where vendor-supplied module manual pages go.
10015 case "$vendorman3dir" in
10016 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
10017 *) dflt=$vendorman3dir ;;
10020 ''|' ') dflt=none ;;
10023 rp='Pathname for the vendor-supplied manual section 3 pages?'
10025 vendorman3dir="$ans"
10026 vendorman3direxp="$ansexp"
10029 : Use ' ' for none so value is preserved next time through Configure
10030 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
10031 prefixvar=vendorman3dir
10034 : Set the vendorscript variables
10035 case "$vendorprefix" in
10036 '') d_vendorscript="$undef"
10040 *) d_vendorscript="$define"
10041 : determine where vendor-supplied scripts go.
10042 case "$vendorscript" in
10043 '') dflt=$vendorprefix/script
10044 $test -d $dflt || dflt=$vendorbin ;;
10045 *) dflt="$vendorscript" ;;
10049 The installation process will create a directory for
10050 vendor-supplied scripts.
10054 rp='Pathname for the vendor-supplied scripts directory?'
10056 vendorscript="$ans"
10057 vendorscriptexp="$ansexp"
10060 prefixvar=vendorscript
10063 : see if qgcvt exists
10067 : Check what kind of doubles your system has
10068 $echo "Checking the kind of doubles you have..." >&4
10070 #$i_stdlib I_STDLIB
10071 #define DOUBLESIZE $doublesize
10073 #include <stdlib.h>
10076 static const double d = -0.1;
10078 unsigned const char* b = (unsigned const char*)(&d);
10079 #if DOUBLESIZE == 4
10080 if (b[0] == 0xCD && b[3] == 0xBD) {
10081 /* IEEE 754 32-bit little-endian */
10085 if (b[0] == 0xBD && b[3] == 0xCD) {
10086 /* IEEE 754 32-bit big-endian */
10090 if (b[0] == 0xCC && b[3] == 0xCC) {
10091 /* VAX format F, 32-bit PDP-style mixed endian. */
10095 if (b[0] == 0xC0 && b[3] == 0x9A) {
10096 /* IBM single 32-bit */
10101 #if DOUBLESIZE == 8
10102 if (b[0] == 0x9A && b[7] == 0xBF) {
10103 /* IEEE 754 64-bit little-endian */
10107 if (b[0] == 0xBF && b[7] == 0x9A) {
10108 /* IEEE 754 64-bit big-endian */
10112 if (b[0] == 0x99 && b[3] == 0xBF && b[4] == 0x9A && b[7] == 0x99) {
10113 /* ARM mixed endian: two little-endian 32-bit floats, in big endian order:
10114 * 4 5 6 7 0 1 2 3 (MSB = 7, LSB = 0)
10115 * 99 99 b9 bf 9a 99 99 99 */
10119 if (b[0] == 0x99 && b[3] == 0x9A && b[4] == 0xBF && b[7] == 0x99) {
10120 /* The opposite of case 7, mixed endian: two big-endian 32-bit floats,
10121 * in little endian order: 3 2 1 0 7 6 5 4 (MSB = 7, LSB = 0)
10122 * 99 99 99 9a bf b9 99 99 */
10126 if (b[0] == 0xCC && b[7] == 0xCC) {
10127 /* VAX format D, 64-bit PDP-style mixed endian. */
10131 if (b[0] == 0xD9 && b[7] == 0x99) {
10132 /* VAX format G, 64-bit PDP-style mixed endian. */
10136 if (b[0] == 0xC0 && b[7] == 0x9A) {
10137 /* IBM double 64-bit */
10141 if (b[0] == 0xBF && b[7] == 0xCD) {
10142 /* CRAY single 64-bit */
10147 #if DOUBLESIZE == 16
10148 if (b[0] == 0x9A && b[15] == 0xBF) {
10149 /* IEEE 754 128-bit little-endian */
10153 if (b[0] == 0xBF && b[15] == 0x9A) {
10154 /* IEEE 754 128-bit big-endian */
10159 /* Then there are old mainframe/miniframe formats like IBM and CRAY.
10160 * Whether those environments can still build Perl is debatable. */
10161 printf("-1\n"); /* unknown */
10166 if eval $compile; then
10167 doublekind=`$run ./try`
10171 case "$doublekind" in
10172 1) echo "You have IEEE 754 32-bit little endian doubles." >&4 ;;
10173 2) echo "You have IEEE 754 32-bit big endian doubles." >&4 ;;
10174 3) echo "You have IEEE 754 64-bit little endian doubles." >&4 ;;
10175 4) echo "You have IEEE 754 64-bit big endian doubles." >&4 ;;
10176 5) echo "You have IEEE 754 128-bit little endian doubles." >&4 ;;
10177 6) echo "You have IEEE 754 128-bit big endian doubles." >&4 ;;
10178 7) echo "You have IEEE 754 64-bit mixed endian doubles (32-bit LEs in BE)." >&4 ;;
10179 8) echo "You have IEEE 754 64-bit mixed endian doubles (32-bit BEs in LE)." >&4 ;;
10180 9) echo "You have VAX format F 32-bit PDP-style mixed endian doubles." >&4 ;;
10181 10) echo "You have VAX format D 64-bit PDP-style mixed endian doubles." >&4 ;;
10182 11) echo "You have VAX format G 64-bit PDP-style mixed endian doubles." >&4 ;;
10183 12) echo "You have IBM short 32-bit doubles." >&4 ;;
10184 13) echo "You have IBM long 64-bit doubles." >&4 ;;
10185 14) echo "You have Cray single 64-bit doubles." >&4 ;;
10186 *) echo "Cannot figure out your double. You Cyber, or something?" >&4 ;;
10188 d_double_style_ieee=$undef
10189 d_double_style_vax=$undef
10190 d_double_style_ibm=$undef
10191 d_double_style_cray=$undef
10192 case "$doublekind" in
10193 1|2|3|4|5|6|7|8) d_double_style_ieee=$define ;;
10194 9|10|11) d_double_style_vax=$define ;;
10195 12|13) d_double_style_ibm=$define ;;
10196 14) d_double_style_cray=$define ;;
10198 case "$d_double_style_ieee" in
10200 d_double_has_inf=$define
10201 d_double_has_nan=$define
10202 d_double_has_negative_zero=$define
10203 d_double_has_subnormals=$define
10206 d_double_has_inf=$undef
10207 d_double_has_nan=$undef
10208 d_double_has_negative_zero=$undef
10209 d_double_has_subnormals=$undef
10214 : Check print/scan long double stuff
10217 if $test X"$d_longdbl" = X"$define"; then
10219 echo "Checking how to print long doubles..." >&4
10221 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
10222 $cat >try.c <<'EOCP'
10223 #include <sys/types.h>
10226 double d = 123.456;
10227 printf("%.3f\n", d);
10231 if eval $compile; then
10235 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
10236 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
10237 echo "We will use %f."
10243 if $test X"$sPRIfldbl" = X; then
10244 $cat >try.c <<'EOCP'
10245 #include <sys/types.h>
10248 long double d = 123.456;
10249 printf("%.3Lf\n", d);
10253 if eval $compile; then
10257 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
10258 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
10259 echo "We will use %Lf."
10265 if $test X"$sPRIfldbl" = X; then
10266 $cat >try.c <<'EOCP'
10267 #include <sys/types.h>
10270 long double d = 123.456;
10271 printf("%.3llf\n", d);
10275 if eval $compile; then
10279 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
10280 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
10281 echo "We will use %llf."
10287 if $test X"$sPRIfldbl" = X; then
10288 $cat >try.c <<'EOCP'
10289 #include <sys/types.h>
10292 long double d = 123.456;
10293 printf("%.3lf\n", d);
10297 if eval $compile; then
10301 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
10302 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
10303 echo "We will use %lf."
10309 if $test X"$sPRIfldbl" = X; then
10310 echo "Cannot figure out how to print long doubles." >&4
10312 sSCNfldbl=$sPRIfldbl # expect consistency
10319 case "$sPRIfldbl" in
10320 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
10321 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
10322 d_SCNfldbl="$undef";
10324 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
10325 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
10326 d_SCNfldbl="$define";
10330 : Before committing on uselongdouble, see whether that looks sane.
10331 if $test "$uselongdouble" = "$define"; then
10334 echo "Checking if your long double math functions work right..." >&4
10339 printf("%"$sPRIgldbl"\n", sqrtl(logl(expl(cosl(sinl(0.0L))))+powl(2.0L, 3.0L)));
10342 case "$osname:$gccversion" in
10343 aix:) saveccflags="$ccflags"
10344 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
10347 if eval $compile_ok; then
10351 3) echo "Your long double math functions are working correctly." >&4 ;;
10352 *) echo "Your long double math functions are broken, not using long doubles." >&4
10353 uselongdouble=$undef
10357 case "$osname:$gccversion" in
10358 aix:) ccflags="$saveccflags" ;; # restore
10362 : Check how to convert floats to strings.
10364 if test "X$d_Gconvert" = X; then
10367 echo "Checking for an efficient way to convert floats to strings."
10369 case "$uselongdouble" in
10370 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
10372 case "$d_longdbl" in
10373 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
10375 case "$d_PRIgldbl" in
10376 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
10379 #ifdef TRY_gconvert
10380 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
10381 char *myname = "gconvert";
10384 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
10385 char *myname = "gcvt";
10388 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
10389 char *myname = "qgcvt";
10390 #define DOUBLETYPE long double
10393 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
10394 #ifdef HAS_PRIgldbl
10395 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
10397 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
10400 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
10402 char *myname = "sprintf";
10406 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
10407 #define DOUBLETYPE long double
10409 #define DOUBLETYPE double
10415 #$i_stdlib I_STDLIB
10417 #include <stdlib.h>
10419 #include <string.h>
10421 int checkit(char *expect, char *got)
10423 if (strcmp(expect, got)) {
10424 printf("%s oddity: Expected %s, got %s\n",
10425 myname, expect, got);
10435 /* This must be 1st test on (which?) platform */
10436 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
10437 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
10438 checkit("0.1", buf);
10440 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
10441 checkit("0.01", buf);
10443 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
10444 checkit("0.001", buf);
10446 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
10447 checkit("0.0001", buf);
10449 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
10450 if (strlen(buf) > 5)
10451 checkit("9e-005", buf); /* for Microsoft ?? */
10453 checkit("9e-05", buf);
10455 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
10458 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
10459 checkit("1.1", buf);
10461 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
10462 checkit("1.01", buf);
10464 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
10465 checkit("1.001", buf);
10467 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
10468 checkit("1.0001", buf);
10470 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
10471 checkit("1.00001", buf);
10473 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
10474 checkit("1.000001", buf);
10476 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
10479 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
10480 checkit("-1", buf);
10482 /* Some Linux gcvt's give 1.e+5 here. */
10483 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
10484 checkit("100000", buf);
10486 /* Some Linux gcvt's give -1.e+5 here. */
10487 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
10488 checkit("-100000", buf);
10490 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
10491 checkit("123.456", buf);
10493 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
10494 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
10495 /* 34 should be enough to scare even long double
10496 * places into using the e notation. */
10497 if (strlen(buf) > 5)
10498 checkit("1e+034", buf); /* for Microsoft */
10500 checkit("1e+34", buf);
10502 /* For Perl, if you add additional tests here, also add them to
10503 * t/base/num.t for benefit of platforms not using Configure or
10504 * overriding d_Gconvert */
10509 : first add preferred functions to our list
10511 for xxx_convert in $gconvert_preference; do
10512 case $xxx_convert in
10513 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
10514 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
10517 : then add any others
10518 for xxx_convert in gconvert gcvt sprintf; do
10519 case "$xxx_list" in
10521 *) xxx_list="$xxx_list $xxx_convert" ;;
10525 case "$d_longdbl$uselongdouble" in
10527 : again, add preferred functions to our list first
10529 for xxx_convert in $gconvert_ld_preference; do
10530 case $xxx_convert in
10531 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
10532 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
10535 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
10536 for xxx_convert in qgcvt sprintf $xxx_list; do
10537 case "$xxx_ld_list" in
10538 $xxx_convert*|*" $xxx_convert"*) ;;
10539 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
10542 : if sprintf cannot do long doubles, move it to the end
10543 if test "$d_PRIgldbl" != "$define"; then
10544 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
10546 : if no qgcvt, remove it
10547 if test "$d_qgcvt" != "$define"; then
10548 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
10551 xxx_list="$xxx_ld_list"
10555 for xxx_convert in $xxx_list; do
10556 echo "Trying $xxx_convert..."
10557 $rm -f try try$_o core
10558 set try -DTRY_$xxx_convert
10559 if eval $compile; then
10560 echo "$xxx_convert() found." >&4
10561 if $run ./try; then
10562 echo "I'll use $xxx_convert to convert floats into a string." >&4
10565 echo "...But $xxx_convert didn't work as I expected."
10569 echo "$xxx_convert NOT found." >&4
10573 if test X$xxx_convert = X; then
10574 echo "*** WHOA THERE!!! ***" >&4
10575 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
10576 xxx_convert=sprintf
10579 case "$xxx_convert" in
10580 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
10581 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
10582 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
10583 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
10584 "$define$define$define")
10585 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
10586 "$define$define$undef")
10587 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
10588 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
10596 : see if _fwalk exists
10600 : see if accept4 exists
10601 set accept4 d_accept4
10604 : Initialize h_fcntl
10607 : Initialize h_sysfile
10610 : access call always available on UNIX
10611 set access d_access
10614 : locate the flags for 'access()'
10615 case "$d_access" in
10618 $cat >access.c <<EOCP
10619 #include <sys/types.h>
10624 #include <sys/file.h>
10627 #include <unistd.h>
10629 #$i_stdlib I_STDLIB
10631 #include <stdlib.h>
10637 : check sys/file.h first, no particular reason here
10638 if $test `./findhdr sys/file.h` && \
10639 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
10641 echo "<sys/file.h> defines the *_OK access constants." >&4
10642 elif $test `./findhdr fcntl.h` && \
10643 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
10645 echo "<fcntl.h> defines the *_OK access constants." >&4
10646 elif $test `./findhdr unistd.h` && \
10647 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
10648 echo "<unistd.h> defines the *_OK access constants." >&4
10650 echo "I can't find the four *_OK access constants--I'll use mine." >&4
10656 : see if accessx exists
10657 set accessx d_accessx
10660 : see if acosh exists
10664 : see if aintl exists
10668 : see if alarm exists
10672 : see if 64bit time functions exists
10674 set ctime64 d_ctime64
10677 set localtime64 d_localtime64
10680 set gmtime64 d_gmtime64
10683 set mktime64 d_mktime64
10686 set difftime64 d_difftime64
10689 set asctime64 d_asctime64
10692 : see if POSIX threads are available
10693 set pthread.h i_pthread
10696 : define a function to check prototypes
10697 $cat > protochk <<EOSH
10700 optimize="$optimize"
10704 usethreads=$usethreads
10705 i_pthread=$i_pthread
10706 pthread_h_first=$pthread_h_first
10709 $cat >> protochk <<'EOSH'
10714 while test $# -ge 2; do
10716 $define) echo "#include <$2>" >> try.c ;;
10717 literal) echo "$2" >> try.c ;;
10719 # Extra magic for the benefit of systems that need pthread.h
10720 # to be included early to correctly detect threadsafe functions.
10721 # Such functions must guarantee themselves, though, that the usethreads
10722 # and i_pthread have been defined, before calling protochk.
10723 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
10724 echo "#include <pthread.h>" >> try.c
10729 cat >> try.c <<'EOCP'
10730 #define _(args) args
10732 echo "$foo" >> try.c
10733 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
10734 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
10740 $eunicefix protochk
10742 : Define hasproto macro for Configure internal use
10743 hasproto='varname=$1; func=$2; shift; shift;
10744 while $test $# -ge 2; do
10746 $define) echo "#include <$2>";;
10747 literal) echo "$2" ;;
10751 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
10752 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
10753 echo "$func() prototype found.";
10756 echo "$func() prototype NOT found.";
10763 : see if sys/types.h has to be included
10764 set sys/types.h i_systypes
10767 : see if sys/select.h has to be included
10768 set sys/select.h i_sysselct
10771 : Define hasfield macro for Configure internal use
10772 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
10773 while $test $# -ge 2; do
10775 $define) echo "#include <$2>";;
10779 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
10781 if eval $compile; then
10790 : see if we should include sys/time.h
10793 if test "X$timeincl" = X; then
10794 echo "Testing to see if we should include <sys/time.h>." >&4
10795 $echo $n "I'm now running the test program...$c"
10797 #include <sys/types.h>
10800 #ifdef SYSTIMEKERNEL
10803 #include <sys/time.h>
10806 #include <sys/select.h>
10808 #$i_stdlib I_STDLIB
10810 #include <stdlib.h>
10816 struct timeval bar;
10819 struct timezone tzp;
10821 if (foo.tm_sec == foo.tm_sec)
10824 if (bar.tv_sec == bar.tv_sec)
10831 for s_timezone in '-DS_TIMEZONE' ''; do
10833 for s_timeval in '-DS_TIMEVAL' ''; do
10834 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10835 for i_systime in '-DI_SYSTIME' ''; do
10838 set try $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10839 if eval $compile; then
10840 set X $i_systime $i_systimek $sysselect $s_timeval
10844 $echo $n "Succeeded with $flags$c"
10855 *SYSTIMEKERNEL*) i_systimek="$define"
10856 timeincl=`./findhdr sys/time.h`
10857 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10858 *) i_systimek="$undef";;
10861 *I_SYSTIME*) i_systime="$define"
10862 timeincl=`./findhdr sys/time.h`" $timeincl"
10863 echo "We'll include <sys/time.h>." >&4;;
10864 *) i_systime="$undef";;
10868 : see if struct tm knows about tm_zone
10869 case "$i_systime$i_time" in
10872 echo "Checking to see if your struct tm has tm_zone field..." >&4
10873 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
10881 case "$d_tm_tm_zone" in
10882 "$define") echo "Yes, it does." ;;
10883 *) echo "No, it doesn't." ;;
10885 : see if struct tm knows about tm_gmtoff
10886 case "$i_systime$i_time" in
10889 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
10890 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
10898 case "$d_tm_tm_gmtoff" in
10899 "$define") echo "Yes, it does." ;;
10900 *) echo "No, it doesn't." ;;
10903 : see if asctime_r exists
10904 set asctime_r d_asctime_r
10906 case "$d_asctime_r" in
10908 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10909 case "$d_asctime_r_proto:$usethreads" in
10910 ":define") d_asctime_r_proto=define
10911 set d_asctime_r_proto asctime_r $hdrs
10915 case "$d_asctime_r_proto" in
10917 case "$asctime_r_proto" in
10918 ''|0) try='char* asctime_r(const struct tm*, char*);'
10919 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SB ;;
10921 case "$asctime_r_proto" in
10922 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
10923 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SBI ;;
10925 case "$asctime_r_proto" in
10926 ''|0) try='int asctime_r(const struct tm*, char*);'
10927 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SB ;;
10929 case "$asctime_r_proto" in
10930 ''|0) try='int asctime_r(const struct tm*, char*, int);'
10931 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SBI ;;
10933 case "$asctime_r_proto" in
10934 ''|0) d_asctime_r=undef
10936 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
10937 * ) case "$asctime_r_proto" in
10938 REENTRANT_PROTO*) ;;
10939 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
10941 echo "Prototype: $try" ;;
10944 *) case "$usethreads" in
10945 define) echo "asctime_r has no prototype, not using it." >&4 ;;
10952 *) asctime_r_proto=0
10956 : see if asinh exists
10960 : see if atanh exists
10964 : see if atolf exists
10968 : see if atoll exists
10972 : Look for GCC-style attribute format
10973 case "$d_attribute_format" in
10976 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
10977 $cat >attrib.c <<'EOCP'
10979 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
10981 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10982 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10983 echo "Your C compiler doesn't support __attribute__((format))."
10986 echo "Your C compiler supports __attribute__((format))."
10990 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10994 *) val="$d_attribute_format" ;;
10996 set d_attribute_format
11000 : Look for GCC-style attribute format with null format allowed
11001 case "$d_printf_format_null" in
11002 '') case "$d_attribute_format" in
11005 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
11006 $cat >attrib.c <<EOCP
11008 #$i_stdlib I_STDLIB
11010 #include <stdlib.h>
11012 #$i_inttypes I_INTTYPES
11014 #include <inttypes.h>
11017 #define intptr_t int
11019 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
11020 int null_printf (char* pat,...) { return (int)(intptr_t)pat; }
11021 int main () { exit(null_printf(NULL)); }
11023 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
11024 : run the executable in case it produces a run-time warning
11025 if $run ./attrib >>attrib.out 2>&1; then
11026 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11027 echo "Your C compiler doesn't allow __printf__ format to be null."
11030 echo "Your C compiler allows __printf__ format to be null."
11034 echo "Your C compiler executable failed with __printf__ format null."
11038 echo "Your C compiler fails with __printf__ format null."
11045 *) val="$d_printf_format_null" ;;
11047 set d_printf_format_null
11051 : Look for GCC-style attribute malloc
11052 case "$d_attribute_malloc" in
11055 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
11056 $cat >attrib.c <<'EOCP'
11058 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
11060 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11061 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11062 echo "Your C compiler doesn't support __attribute__((malloc))."
11065 echo "Your C compiler supports __attribute__((malloc))."
11069 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11073 *) val="$d_attribute_malloc" ;;
11075 set d_attribute_malloc
11079 : Look for GCC-style attribute nonnull
11080 case "$d_attribute_nonnull" in
11083 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
11084 $cat >attrib.c <<'EOCP'
11086 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
11088 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11089 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11090 echo "Your C compiler doesn't support __attribute__((nonnull))."
11093 echo "Your C compiler supports __attribute__((nonnull))."
11097 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11101 *) val="$d_attribute_nonnull" ;;
11103 set d_attribute_nonnull
11107 : Look for GCC-style attribute noreturn
11108 case "$d_attribute_noreturn" in
11111 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
11112 $cat >attrib.c <<'EOCP'
11114 void fall_over_dead( void ) __attribute__((noreturn));
11116 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11117 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11118 echo "Your C compiler doesn't support __attribute__((noreturn))."
11121 echo "Your C compiler supports __attribute__((noreturn))."
11125 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11129 *) val="$d_attribute_noreturn" ;;
11131 set d_attribute_noreturn
11135 : Look for GCC-style attribute pure
11136 case "$d_attribute_pure" in
11139 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
11140 $cat >attrib.c <<'EOCP'
11142 int square( int n ) __attribute__((pure));
11144 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11145 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11146 echo "Your C compiler doesn't support __attribute__((pure))."
11149 echo "Your C compiler supports __attribute__((pure))."
11153 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11157 *) val="$d_attribute_pure" ;;
11159 set d_attribute_pure
11163 : Look for GCC-style attribute unused
11164 case "$d_attribute_unused" in
11167 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
11168 $cat >attrib.c <<'EOCP'
11170 int do_something( int dummy __attribute__((unused)), int n );
11172 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11173 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11174 echo "Your C compiler doesn't support __attribute__((unused))."
11177 echo "Your C compiler supports __attribute__((unused))."
11181 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11185 *) val="$d_attribute_unused" ;;
11187 set d_attribute_unused
11191 : Look for GCC-style attribute deprecated
11192 case "$d_attribute_deprecated" in
11195 echo "Checking whether your compiler can handle __attribute__((deprecated)) ..." >&4
11196 $cat >attrib.c <<'EOCP'
11198 int I_am_deprecated(void) __attribute__((deprecated));
11200 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11201 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11202 echo "Your C compiler doesn't support __attribute__((deprecated))."
11205 echo "Your C compiler supports __attribute__((deprecated))."
11209 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11213 *) val="$d_attribute_deprecated" ;;
11215 set d_attribute_deprecated
11219 : Look for GCC-style attribute warn_unused_result
11220 case "$d_attribute_warn_unused_result" in
11223 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
11224 $cat >attrib.c <<'EOCP'
11226 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
11228 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11229 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11230 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
11233 echo "Your C compiler supports __attribute__((warn_unused_result))."
11237 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11241 *) val="$d_attribute_warn_unused_result" ;;
11243 set d_attribute_warn_unused_result
11247 : see if getpgrp exists
11248 set getpgrp d_getpgrp
11251 case "$d_getpgrp" in
11254 echo "Checking to see which flavor of getpgrp is in use..."
11256 #$i_unistd I_UNISTD
11257 #include <sys/types.h>
11259 # include <unistd.h>
11261 #$i_stdlib I_STDLIB
11263 #include <stdlib.h>
11267 if (getuid() == 0) {
11268 printf("(I see you are running Configure as super-user...)\n");
11271 #ifdef TRY_BSD_PGRP
11272 if (getpgrp(1) == 0)
11281 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11282 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
11284 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11285 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
11288 echo "I can't seem to compile and run the test program."
11290 xxx="a USG one, i.e. you use getpgrp()."
11292 # SVR4 systems can appear rather BSD-ish.
11293 case "$i_unistd" in
11295 xxx="a BSD one, i.e. you use getpgrp(pid)."
11299 xxx="probably a USG one, i.e. you use getpgrp()."
11304 echo "Assuming your getpgrp is $xxx" >&4
11313 : see if setpgrp exists
11314 set setpgrp d_setpgrp
11317 case "$d_setpgrp" in
11320 echo "Checking to see which flavor of setpgrp is in use..."
11322 #$i_unistd I_UNISTD
11323 #include <sys/types.h>
11325 # include <unistd.h>
11327 #$i_stdlib I_STDLIB
11329 #include <stdlib.h>
11333 if (getuid() == 0) {
11334 printf("(I see you are running Configure as super-user...)\n");
11337 #ifdef TRY_BSD_PGRP
11338 if (-1 == setpgrp(1, 1))
11341 if (setpgrp() != -1)
11347 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11348 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
11350 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11351 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
11354 echo "(I can't seem to compile and run the test program.)"
11356 xxx="a USG one, i.e. you use setpgrp()."
11358 # SVR4 systems can appear rather BSD-ish.
11359 case "$i_unistd" in
11361 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
11365 xxx="probably a USG one, i.e. you use setpgrp()."
11370 echo "Assuming your setpgrp is $xxx" >&4
11379 : Look for GCC-style __builtin_add_overflow
11380 case "$d_builtin_add_overflow" in
11383 echo "Checking whether your compiler can handle __builtin_add_overflow ..." >&4
11384 $cat >try.c <<'EOCP'
11386 const unsigned int uint_max = ~0u;
11387 int target_int = 0;
11388 if (__builtin_add_overflow(1, 2, &target_int) || target_int != 3) {
11391 if (!__builtin_add_overflow((int)(uint_max >> 1), 1, &target_int)) {
11394 if (!__builtin_add_overflow(uint_max, -1, &target_int)) {
11401 if eval $compile && $run ./try; then
11402 echo "Your C compiler supports __builtin_add_overflow."
11405 echo "Your C compiler doesn't seem to understand __builtin_add_overflow."
11409 *) val="$d_builtin_add_overflow" ;;
11412 set d_builtin_add_overflow
11416 : Look for GCC-style __builtin_sub_overflow
11417 case "$d_builtin_sub_overflow" in
11420 echo "Checking whether your compiler can handle __builtin_sub_overflow ..." >&4
11421 $cat >try.c <<'EOCP'
11423 const unsigned int uint_max = ~0u;
11424 int target_int = 0;
11425 if (__builtin_sub_overflow(1, -2, &target_int) || target_int != 3) {
11428 if (!__builtin_sub_overflow(-(int)(uint_max >> 1), 2, &target_int)) {
11431 if (!__builtin_sub_overflow(uint_max, 1, &target_int)) {
11438 if eval $compile && $run ./try; then
11439 echo "Your C compiler supports __builtin_sub_overflow."
11442 echo "Your C compiler doesn't seem to understand __builtin_sub_overflow."
11446 *) val="$d_builtin_sub_overflow" ;;
11449 set d_builtin_sub_overflow
11453 : Look for GCC-style __builtin_mul_overflow
11454 case "$d_builtin_mul_overflow" in
11457 echo "Checking whether your compiler can handle __builtin_mul_overflow ..." >&4
11458 $cat >try.c <<'EOCP'
11460 const unsigned int uint_max = ~0u;
11461 int target_int = 0;
11462 if (__builtin_mul_overflow(2, 3, &target_int) || target_int != 6) {
11465 if (!__builtin_mul_overflow((int)(uint_max >> 1), 2, &target_int)) {
11468 if (!__builtin_mul_overflow(uint_max, 1, &target_int)) {
11475 if eval $compile && $run ./try; then
11476 echo "Your C compiler supports __builtin_mul_overflow."
11479 echo "Your C compiler doesn't seem to understand __builtin_mul_overflow."
11483 *) val="$d_builtin_mul_overflow" ;;
11486 set d_builtin_mul_overflow
11490 : Look for GCC-style __builtin_choose_expr
11491 case "$d_builtin_choose_expr" in
11494 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
11495 $cat >try.c <<'EOCP'
11496 #include <assert.h>
11497 #include <stdlib.h>
11500 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
11503 assert( SYRINX(1) == 2112 );
11504 assert( SYRINX(1) != 5150 );
11505 assert( SYRINX(0) == 5150 );
11506 assert( SYRINX(0) != 2112 );
11507 puts( "All good!" );
11513 if eval $compile && $run ./try; then
11514 echo "Your C compiler supports __builtin_choose_expr."
11517 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
11521 *) val="$d_builtin_choose_expr" ;;
11524 set d_builtin_choose_expr
11528 : Look for GCC-style __builtin_expect
11529 case "$d_builtin_expect" in
11532 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
11533 $cat >try.c <<'EOCP'
11536 if ( __builtin_expect(n, 0) ) n = 1;
11537 /* Remember shell exit code truth is 0, C truth is non-zero */
11542 if eval $compile && $run ./try; then
11543 echo "Your C compiler supports __builtin_expect."
11546 echo "Your C compiler doesn't seem to understand __builtin_expect."
11550 *) val="$d_builtin_expect" ;;
11553 set d_builtin_expect
11557 : see if the Compiler supports C99 variadic macros
11558 echo "Checking for C99 variadic macros." >&4
11561 #include <stdarg.h>
11563 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
11567 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
11573 if eval $compile && $run ./try 2>&1 >/dev/null; then
11574 case "`$run ./try`" in
11576 echo "You have C99 variadic macros." >&4
11577 d_c99_variadic_macros="$define"
11580 echo "You don't have functional C99 variadic macros." >&4
11581 d_c99_variadic_macros="$undef"
11585 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
11586 d_c99_variadic_macros="$undef"
11590 : see if signal is declared as pointer to function returning int or void
11592 xxx=`./findhdr signal.h`
11593 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
11594 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
11595 echo "You have int (*signal())() instead of void." >&4
11597 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
11598 echo "You have void (*signal())()." >&4
11600 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
11601 echo "You have int (*signal())() instead of void." >&4
11603 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
11604 echo "You have void (*signal())()." >&4
11607 case "$d_voidsig" in
11609 echo "I can't determine whether signal handler returns void or int..." >&4
11611 rp="What type does your signal handler return?"
11614 v*) val="$define";;
11618 echo "As you already told me, signal handler returns void." >&4
11621 *) echo "As you already told me, signal handler returns int." >&4
11628 case "$d_voidsig" in
11629 "$define") signal_t="void";;
11630 *) signal_t="int";;
11634 : check for ability to cast large floats to 32-bit ints.
11636 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
11637 if $test "$intsize" -ge 4; then
11644 #$i_stdlib I_STDLIB
11646 #include <stdlib.h>
11648 #include <sys/types.h>
11649 #include <signal.h>
11650 $signal_t blech(int s) { exit(3); }
11657 signal(SIGFPE, blech);
11659 /* Don't let compiler optimize the test away. Store the number
11660 in a writable string for gcc to pass to sscanf under HP-UX.
11662 sprintf(str, "2147483647");
11663 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
11667 /* x86 processors will probably give 0x8000 0000, which is a
11668 sign change. We don't want that. We want to mimic SPARC
11669 behavior here, which is to preserve the sign and give
11672 if (i32 != ($xxx) f)
11678 if eval $compile_ok; then
11679 $run ./try 2>/dev/null
11682 echo "(I can't seem to compile the test program--assuming it can't)"
11687 echo "Yup, it can."
11690 echo "Nope, it can't."
11697 : check for ability to cast negative floats to unsigned
11699 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
11702 #$i_stdlib I_STDLIB
11704 #include <stdlib.h>
11706 #include <sys/types.h>
11707 #include <signal.h>
11708 $signal_t blech(int s) { exit(7); }
11709 $signal_t blech_in_list(int s) { exit(4); }
11710 unsigned long dummy_long(unsigned long p) { return p; }
11711 unsigned int dummy_int(unsigned int p) { return p; }
11712 unsigned short dummy_short(unsigned short p) { return p; }
11716 unsigned long along;
11718 unsigned short ashort;
11722 /* Frustrate gcc-2.7.2's optimizer which failed this test with
11723 a direct f = -123. assignment. gcc-2.8.0 reportedly
11724 optimized the whole file away
11726 /* Store the number in a writable string for gcc to pass to
11727 sscanf under HP-UX.
11729 sprintf(str, "-123");
11730 sscanf(str, "%lf", &f); /* f = -123.; */
11732 signal(SIGFPE, blech);
11733 along = (unsigned long)f;
11734 aint = (unsigned int)f;
11735 ashort = (unsigned short)f;
11736 if (along != (unsigned long)-123)
11738 if (aint != (unsigned int)-123)
11740 if (ashort != (unsigned short)-123)
11742 sprintf(str, "1073741824.");
11743 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
11746 along = (unsigned long)f;
11747 if (along != 0x80000000)
11751 along = (unsigned long)f;
11752 if (along != 0x7fffffff)
11756 along = (unsigned long)f;
11757 if (along != 0x80000001)
11761 signal(SIGFPE, blech_in_list);
11762 sprintf(str, "123.");
11763 sscanf(str, "%lf", &f); /* f = 123.; */
11764 along = dummy_long((unsigned long)f);
11765 aint = dummy_int((unsigned int)f);
11766 ashort = dummy_short((unsigned short)f);
11767 if (along != (unsigned long)123)
11769 if (aint != (unsigned int)123)
11771 if (ashort != (unsigned short)123)
11778 if eval $compile_ok; then
11779 $run ./try 2>/dev/null
11782 echo "(I can't seem to compile the test program--assuming it can't)"
11785 case "$castflags" in
11787 echo "Yup, it can."
11790 echo "Nope, it can't."
11797 : see if cbrt exists
11801 : see if chown exists
11805 : see if chroot exists
11806 set chroot d_chroot
11809 : see if chsize exists
11810 set chsize d_chsize
11813 : see if class exists
11817 : see if clearenv exists
11818 set clearenv d_clearenv
11821 : Define hasstruct macro for Configure internal use
11822 hasstruct='varname=$1; struct=$2; shift; shift;
11823 while $test $# -ge 2; do
11825 $define) echo "#include <$2>";;
11829 echo "int main () { struct $struct foo; }" >> try.c;
11831 if eval $compile; then
11840 : see whether socket exists
11844 $echo $n "Hmm... $c" >&4
11845 if set socket val -f d_socket; eval $csym; $val; then
11846 echo "Looks like you have Berkeley networking support." >&4
11848 if set setsockopt val -f; eval $csym; $val; then
11851 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
11852 d_oldsock="$define"
11855 if $contains socklib libc.list >/dev/null 2>&1; then
11856 echo "Looks like you have Berkeley networking support." >&4
11858 : we will have to assume that it supports the 4.2 BSD interface
11861 echo "You don't have Berkeley networking in libc$_a..." >&4
11862 if test "X$d_socket" = "X$define"; then
11863 echo "...but you seem to believe that you have sockets." >&4
11865 for net in net socket
11867 if test -f $sysroot/usr/lib/lib$net$_a; then
11868 ( ($nm $nm_opt $sysroot/usr/lib/lib$net$_a | eval $nm_extract) || \
11869 $ar t $sysroot/usr/lib/lib$net$_a) 2>/dev/null >> libc.list
11870 if $contains socket libc.list >/dev/null 2>&1; then
11875 echo "...but the Wollongong group seems to have hacked it in." >&4
11876 sockethdr="-I$sysroot/usr/netinclude"
11879 echo "Found Berkeley sockets interface in lib$net." >&4
11880 if $contains setsockopt libc.list >/dev/null 2>&1; then
11883 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
11884 d_oldsock="$define"
11890 if test "X$d_socket" != "X$define"; then
11891 echo "or anywhere else I see." >&4
11899 : see if socketpair exists
11900 set socketpair d_sockpair
11905 echo "Checking the availability sa_len in the sock struct ..." >&4
11907 #include <sys/types.h>
11908 #include <sys/socket.h>
11910 struct sockaddr sa;
11911 return (sa.sa_len);
11915 set try; if eval $compile; then
11918 set d_sockaddr_sa_len; eval $setvar
11922 echo "Checking the availability 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_family);
11933 set try; if eval $compile; then
11936 set d_sockaddr_in6; eval $setvar
11940 echo "Checking the availability sin6_scope_id in struct sockaddr_in6 ..." >&4
11942 #include <sys/types.h>
11943 #include <sys/socket.h>
11944 #include <netinet/in.h>
11946 struct sockaddr_in6 sin6;
11947 return (sin6.sin6_scope_id);
11951 set try; if eval $compile; then
11954 set d_sin6_scope_id; eval $setvar
11958 echo "Checking the availability struct ip_mreq ..." >&4
11960 #include <sys/types.h>
11961 #include <sys/socket.h>
11962 #include <netinet/in.h>
11964 struct ip_mreq mreq;
11965 return (mreq.imr_multiaddr.s_addr);
11969 set try; if eval $compile; then
11972 set d_ip_mreq; eval $setvar
11976 echo "Checking the availability struct ip_mreq_source ..." >&4
11978 #include <sys/types.h>
11979 #include <sys/socket.h>
11980 #include <netinet/in.h>
11982 struct ip_mreq_source mreq;
11983 return (mreq.imr_multiaddr.s_addr);
11987 set try; if eval $compile; then
11990 set d_ip_mreq_source; eval $setvar
11994 echo "Checking the availability struct ipv6_mreq ..." >&4
11996 #include <sys/types.h>
11997 #include <sys/socket.h>
11998 #include <netinet/in.h>
12000 struct ipv6_mreq mreq;
12001 return (mreq.ipv6mr_interface);
12005 set try; if eval $compile; then
12008 set d_ipv6_mreq; eval $setvar
12012 echo "Checking the availability struct ipv6_mreq_source ..." >&4
12014 #include <sys/types.h>
12015 #include <sys/socket.h>
12016 #include <netinet/in.h>
12018 struct ipv6_mreq_source mreq;
12019 return (mreq.imr_multiaddr.s_addr);
12023 set try; if eval $compile; then
12026 set d_ipv6_mreq_source; eval $setvar
12030 echo "Checking the availability of certain socket constants..." >&4
12031 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
12032 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
12034 #include <sys/types.h>
12035 #include <sys/socket.h>
12041 set try; if eval $compile; then
12044 set d_${enum}; eval $setvar
12048 : see if this is a sys/uio.h system
12049 set sys/uio.h i_sysuio
12052 : Check for cmsghdr support
12054 echo "Checking to see if your system supports struct cmsghdr..." >&4
12055 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
12057 case "$d_cmsghdr_s" in
12058 "$define") echo "Yes, it does." ;;
12059 *) echo "No, it doesn't." ;;
12062 : see if copysign exists
12063 set copysign d_copysign
12066 : see if copysignl exists
12067 set copysignl d_copysignl
12070 : see if crypt exists
12075 $define) cryptlib='' ;;
12076 *) if set crypt val -f d_crypt; eval $csym; $val; then
12077 echo 'crypt() found.' >&4
12081 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
12082 if $test -z "$cryptlib"; then
12083 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
12087 if $test -z "$cryptlib"; then
12088 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
12092 if $test -z "$cryptlib"; then
12093 cryptlib=`./loc libcrypt$_a "" $libpth`
12097 if $test -z "$cryptlib"; then
12098 echo 'crypt() NOT found.' >&4
12109 : see if this is a crypt.h system
12110 set crypt.h i_crypt
12113 : see if crypt_r exists
12114 set crypt_r d_crypt_r
12116 case "$d_crypt_r" in
12118 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
12119 case "$d_crypt_r_proto:$usethreads" in
12120 ":define") d_crypt_r_proto=define
12121 set d_crypt_r_proto crypt_r $hdrs
12125 case "$d_crypt_r_proto" in
12127 case "$crypt_r_proto" in
12128 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
12129 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCS ;;
12131 case "$crypt_r_proto" in
12132 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
12133 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCD ;;
12135 case "$crypt_r_proto" in
12136 ''|0) d_crypt_r=undef
12138 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
12139 * ) case "$crypt_r_proto" in
12140 REENTRANT_PROTO*) ;;
12141 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
12143 echo "Prototype: $try" ;;
12146 *) case "$usethreads" in
12147 define) echo "crypt_r has no prototype, not using it." >&4 ;;
12158 : get csh whereabouts
12160 'csh') val="$undef" ;;
12161 *) val="$define" ;;
12165 : Respect a hint or command line value for full_csh.
12166 case "$full_csh" in
12167 '') full_csh=$csh ;;
12170 : see if ctermid exists
12171 set ctermid d_ctermid
12174 : see if ctermid_r exists
12175 set ctermid_r d_ctermid_r
12177 case "$d_ctermid_r" in
12179 hdrs="$i_systypes sys/types.h define stdio.h "
12180 case "$d_ctermid_r_proto:$usethreads" in
12181 ":define") d_ctermid_r_proto=define
12182 set d_ctermid_r_proto ctermid_r $hdrs
12186 case "$d_ctermid_r_proto" in
12188 case "$ctermid_r_proto" in
12189 ''|0) try='char* ctermid_r(char*);'
12190 ./protochk "$extern_C $try" $hdrs && ctermid_r_proto=B_B ;;
12192 case "$ctermid_r_proto" in
12193 ''|0) d_ctermid_r=undef
12195 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
12196 * ) case "$ctermid_r_proto" in
12197 REENTRANT_PROTO*) ;;
12198 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
12200 echo "Prototype: $try" ;;
12203 *) case "$usethreads" in
12204 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
12211 *) ctermid_r_proto=0
12215 : see if ctime_r exists
12216 set ctime_r d_ctime_r
12218 case "$d_ctime_r" in
12220 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
12221 case "$d_ctime_r_proto:$usethreads" in
12222 ":define") d_ctime_r_proto=define
12223 set d_ctime_r_proto ctime_r $hdrs
12227 case "$d_ctime_r_proto" in
12229 case "$ctime_r_proto" in
12230 ''|0) try='char* ctime_r(const time_t*, char*);'
12231 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SB ;;
12233 case "$ctime_r_proto" in
12234 ''|0) try='char* ctime_r(const time_t*, char*, int);'
12235 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SBI ;;
12237 case "$ctime_r_proto" in
12238 ''|0) try='int ctime_r(const time_t*, char*);'
12239 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SB ;;
12241 case "$ctime_r_proto" in
12242 ''|0) try='int ctime_r(const time_t*, char*, int);'
12243 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SBI ;;
12245 case "$ctime_r_proto" in
12246 ''|0) d_ctime_r=undef
12248 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
12249 * ) case "$ctime_r_proto" in
12250 REENTRANT_PROTO*) ;;
12251 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
12253 echo "Prototype: $try" ;;
12256 *) case "$usethreads" in
12257 define) echo "ctime_r has no prototype, not using it." >&4 ;;
12268 : see if cuserid exists
12269 set cuserid d_cuserid
12272 : see if dbm.h is available
12273 : see if dbmclose exists
12274 set dbmclose d_dbmclose
12277 case "$d_dbmclose" in
12287 *) set rpcsvc/dbm.h i_rpcsvcdbm
12292 *) echo "We won't be including <dbm.h>"
12302 : see if prototype for dbminit is available
12304 set d_dbminitproto dbminit $i_dbm dbm.h
12307 : see if difftime exists
12308 set difftime d_difftime
12311 : see if this is a dirent system
12313 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
12315 echo "<dirent.h> found." >&4
12318 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
12319 echo "<sys/dir.h> found." >&4
12322 xinc=`./findhdr sys/ndir.h`
12324 echo "<dirent.h> NOT found." >&4
12329 : Look for type of directory structure.
12331 $cppstdin $cppflags $cppminus < "$xinc" > try.c
12333 case "$direntrytype" in
12335 case "$i_dirent" in
12336 $define) guess1='struct dirent' ;;
12337 *) guess1='struct direct' ;;
12340 *) guess1="$direntrytype"
12345 'struct dirent') guess2='struct direct' ;;
12346 *) guess2='struct dirent' ;;
12349 if $contains "$guess1" try.c >/dev/null 2>&1; then
12350 direntrytype="$guess1"
12351 echo "Your directory entries are $direntrytype." >&4
12352 elif $contains "$guess2" try.c >/dev/null 2>&1; then
12353 direntrytype="$guess2"
12354 echo "Your directory entries seem to be $direntrytype." >&4
12356 echo "I don't recognize your system's directory entries." >&4
12357 rp="What type is used for directory entries on this system?"
12360 direntrytype="$ans"
12364 : see if the directory entry stores field length
12366 $cppstdin $cppflags $cppminus < "$xinc" > try.c
12367 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
12368 echo "Good, your directory entry keeps length information in d_namlen." >&4
12371 echo "Your directory entry does not know about the d_namlen field." >&4
12378 : Look for DIR.dd_fd
12379 case "$i_dirent" in
12381 echo "Checking to see if DIR has a dd_fd member variable" >&4
12383 #$i_stdlib I_STDLIB
12385 #include <stdlib.h>
12387 #include <dirent.h>
12397 if eval $compile; then
12398 echo "Yes, it does."
12401 echo "No, it does not."
12406 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
12414 : see if this is an sysdir system
12415 set sys/dir.h i_sysdir
12418 : see if this is an sysndir system
12419 set sys/ndir.h i_sysndir
12424 $cat >dirfd.c <<EOM
12426 #$i_stdlib I_STDLIB
12428 #include <stdlib.h>
12430 #$i_dirent I_DIRENT /**/
12431 #$i_sysdir I_SYS_DIR /**/
12432 #$i_sysndir I_SYS_NDIR /**/
12433 #$i_systypes I_SYS_TYPES /**/
12434 #if defined(I_SYS_TYPES)
12435 #include <sys/types.h>
12437 #if defined(I_DIRENT)
12438 #include <dirent.h>
12441 #include <sys/ndir.h>
12444 #include <sys/dir.h>
12449 DIR *dirp = opendir(".");
12450 if (dirfd(dirp) >= 0)
12458 if eval $compile; then
12462 $define) echo "dirfd() found." >&4 ;;
12463 *) echo "dirfd() NOT found." >&4 ;;
12469 : see if dladdr exists
12470 set dladdr d_dladdr
12473 : see if dlerror exists
12476 set dlerror d_dlerror
12480 : see if dlfcn is available
12481 set dlfcn.h i_dlfcn
12484 : Check what extension to use for shared libs
12489 On a few systems, the dynamically loaded modules that perl generates and uses
12490 will need a different extension than shared libs. The default will probably
12496 *) dflt="$dlext" ;;
12498 rp='What is the extension of dynamically loaded modules'
12507 : Check if dlsym need a leading underscore
12513 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
12514 $cat >dyna.c <<'EOM'
12521 #$i_stdlib I_STDLIB
12523 #include <stdlib.h>
12527 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
12529 #include <sys/types.h>
12534 extern int fred() ;
12543 int mode = RTLD_LAZY ;
12545 handle = dlopen("./dyna.$dlext", mode) ;
12546 if (handle == NULL) {
12551 symbol = dlsym(handle, "fred") ;
12552 if (symbol == NULL) {
12553 /* try putting a leading underscore */
12554 symbol = dlsym(handle, "_fred") ;
12555 if (symbol == NULL) {
12568 : Call the object file tmp-dyna.o in case dlext=o.
12569 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
12570 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
12571 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
12572 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
12575 1) echo "Test program failed using dlopen." >&4
12576 echo "Perhaps you should not use dynamic loading." >&4;;
12577 2) echo "Test program failed using dlsym." >&4
12578 echo "Perhaps you should not use dynamic loading." >&4;;
12579 3) echo "dlsym needs a leading underscore" >&4
12581 4) echo "dlsym doesn't need a leading underscore." >&4;;
12584 echo "I can't compile and run the test program." >&4
12585 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
12590 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
12595 : see if drand48_r exists
12596 set drand48_r d_drand48_r
12598 case "$d_drand48_r" in
12600 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
12601 case "$d_drand48_r_proto:$usethreads" in
12602 ":define") d_drand48_r_proto=define
12603 set d_drand48_r_proto drand48_r $hdrs
12607 case "$d_drand48_r_proto" in
12609 case "$drand48_r_proto" in
12610 ''|0) try='int drand48_r(struct drand48_data*, double*);'
12611 ./protochk "$extern_C $try" $hdrs && drand48_r_proto=I_ST ;;
12613 case "$drand48_r_proto" in
12614 ''|0) d_drand48_r=undef
12616 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
12617 * ) case "$drand48_r_proto" in
12618 REENTRANT_PROTO*) ;;
12619 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
12621 echo "Prototype: $try" ;;
12624 *) case "$usethreads" in
12625 define) echo "drand48_r has no prototype, not using it." >&4 ;;
12632 *) drand48_r_proto=0
12636 : see if prototype for drand48 is available
12638 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
12641 : see if dup2 exists
12645 : see if dup3 exists
12649 : see if this is an xlocale.h system
12650 set xlocale.h i_xlocale
12653 : see if newlocale exists
12654 set newlocale d_newlocale
12657 : see if freelocale exists
12658 set freelocale d_freelocale
12661 : see if uselocale exists
12662 set uselocale d_uselocale
12665 : see if duplocale exists
12666 set duplocale d_duplocale
12669 : see if querylocale exists
12670 set querylocale d_querylocale
12673 : see if eaccess exists
12674 set eaccess d_eaccess
12677 : see if endgrent exists
12678 set endgrent d_endgrent
12681 : see if this is an grp system
12687 xxx=`./findhdr grp.h`
12688 $cppstdin $cppflags $cppminus < $xxx >$$.h
12690 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
12702 set d_grpasswd; eval $setvar
12706 : see if endgrent_r exists
12707 set endgrent_r d_endgrent_r
12709 case "$d_endgrent_r" in
12711 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12712 case "$d_endgrent_r_proto:$usethreads" in
12713 ":define") d_endgrent_r_proto=define
12714 set d_endgrent_r_proto endgrent_r $hdrs
12718 case "$d_endgrent_r_proto" in
12720 case "$endgrent_r_proto" in
12721 ''|0) try='int endgrent_r(FILE**);'
12722 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=I_H ;;
12724 case "$endgrent_r_proto" in
12725 ''|0) try='void endgrent_r(FILE**);'
12726 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=V_H ;;
12728 case "$endgrent_r_proto" in
12729 ''|0) d_endgrent_r=undef
12731 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
12732 * ) case "$endgrent_r_proto" in
12733 REENTRANT_PROTO*) ;;
12734 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
12736 echo "Prototype: $try" ;;
12739 *) case "$usethreads" in
12740 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
12747 *) endgrent_r_proto=0
12751 : see if endhostent exists
12752 set endhostent d_endhent
12755 : see if this is a netdb.h system
12756 set netdb.h i_netdb
12759 : see if endhostent_r exists
12760 set endhostent_r d_endhostent_r
12762 case "$d_endhostent_r" in
12764 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12765 case "$d_endhostent_r_proto:$usethreads" in
12766 ":define") d_endhostent_r_proto=define
12767 set d_endhostent_r_proto endhostent_r $hdrs
12771 case "$d_endhostent_r_proto" in
12773 case "$endhostent_r_proto" in
12774 ''|0) try='int endhostent_r(struct hostent_data*);'
12775 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=I_D ;;
12777 case "$endhostent_r_proto" in
12778 ''|0) try='void endhostent_r(struct hostent_data*);'
12779 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=V_D ;;
12781 case "$endhostent_r_proto" in
12782 ''|0) d_endhostent_r=undef
12783 endhostent_r_proto=0
12784 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
12785 * ) case "$endhostent_r_proto" in
12786 REENTRANT_PROTO*) ;;
12787 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
12789 echo "Prototype: $try" ;;
12792 *) case "$usethreads" in
12793 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
12795 d_endhostent_r=undef
12796 endhostent_r_proto=0
12800 *) endhostent_r_proto=0
12804 : see if endnetent exists
12805 set endnetent d_endnent
12808 : see if endnetent_r exists
12809 set endnetent_r d_endnetent_r
12811 case "$d_endnetent_r" in
12813 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12814 case "$d_endnetent_r_proto:$usethreads" in
12815 ":define") d_endnetent_r_proto=define
12816 set d_endnetent_r_proto endnetent_r $hdrs
12820 case "$d_endnetent_r_proto" in
12822 case "$endnetent_r_proto" in
12823 ''|0) try='int endnetent_r(struct netent_data*);'
12824 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=I_D ;;
12826 case "$endnetent_r_proto" in
12827 ''|0) try='void endnetent_r(struct netent_data*);'
12828 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=V_D ;;
12830 case "$endnetent_r_proto" in
12831 ''|0) d_endnetent_r=undef
12832 endnetent_r_proto=0
12833 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
12834 * ) case "$endnetent_r_proto" in
12835 REENTRANT_PROTO*) ;;
12836 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
12838 echo "Prototype: $try" ;;
12841 *) case "$usethreads" in
12842 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
12844 d_endnetent_r=undef
12845 endnetent_r_proto=0
12849 *) endnetent_r_proto=0
12853 : see if endprotoent exists
12854 set endprotoent d_endpent
12857 : see if endprotoent_r exists
12858 set endprotoent_r d_endprotoent_r
12860 case "$d_endprotoent_r" in
12862 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12863 case "$d_endprotoent_r_proto:$usethreads" in
12864 ":define") d_endprotoent_r_proto=define
12865 set d_endprotoent_r_proto endprotoent_r $hdrs
12869 case "$d_endprotoent_r_proto" in
12871 case "$endprotoent_r_proto" in
12872 ''|0) try='int endprotoent_r(struct protoent_data*);'
12873 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=I_D ;;
12875 case "$endprotoent_r_proto" in
12876 ''|0) try='void endprotoent_r(struct protoent_data*);'
12877 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=V_D ;;
12879 case "$endprotoent_r_proto" in
12880 ''|0) d_endprotoent_r=undef
12881 endprotoent_r_proto=0
12882 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
12883 * ) case "$endprotoent_r_proto" in
12884 REENTRANT_PROTO*) ;;
12885 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
12887 echo "Prototype: $try" ;;
12890 *) case "$usethreads" in
12891 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
12893 d_endprotoent_r=undef
12894 endprotoent_r_proto=0
12898 *) endprotoent_r_proto=0
12902 : see if endpwent exists
12903 set endpwent d_endpwent
12906 : see if this is a pwd.h system
12912 xxx=`./findhdr pwd.h`
12913 $cppstdin $cppflags $cppminus < $xxx >$$.h
12915 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
12923 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
12931 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
12939 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
12947 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
12955 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
12963 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
12971 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
12983 set d_pwquota; eval $setvar
12984 set d_pwage; eval $setvar
12985 set d_pwchange; eval $setvar
12986 set d_pwclass; eval $setvar
12987 set d_pwexpire; eval $setvar
12988 set d_pwcomment; eval $setvar
12989 set d_pwgecos; eval $setvar
12990 set d_pwpasswd; eval $setvar
12994 : see if endpwent_r exists
12995 set endpwent_r d_endpwent_r
12997 case "$d_endpwent_r" in
12999 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13000 case "$d_endpwent_r_proto:$usethreads" in
13001 ":define") d_endpwent_r_proto=define
13002 set d_endpwent_r_proto endpwent_r $hdrs
13006 case "$d_endpwent_r_proto" in
13008 case "$endpwent_r_proto" in
13009 ''|0) try='int endpwent_r(FILE**);'
13010 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=I_H ;;
13012 case "$endpwent_r_proto" in
13013 ''|0) try='void endpwent_r(FILE**);'
13014 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=V_H ;;
13016 case "$endpwent_r_proto" in
13017 ''|0) d_endpwent_r=undef
13019 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
13020 * ) case "$endpwent_r_proto" in
13021 REENTRANT_PROTO*) ;;
13022 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
13024 echo "Prototype: $try" ;;
13027 *) case "$usethreads" in
13028 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
13035 *) endpwent_r_proto=0
13039 : see if endservent exists
13040 set endservent d_endsent
13043 : see if endservent_r exists
13044 set endservent_r d_endservent_r
13046 case "$d_endservent_r" in
13048 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13049 case "$d_endservent_r_proto:$usethreads" in
13050 ":define") d_endservent_r_proto=define
13051 set d_endservent_r_proto endservent_r $hdrs
13055 case "$d_endservent_r_proto" in
13057 case "$endservent_r_proto" in
13058 ''|0) try='int endservent_r(struct servent_data*);'
13059 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=I_D ;;
13061 case "$endservent_r_proto" in
13062 ''|0) try='void endservent_r(struct servent_data*);'
13063 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=V_D ;;
13065 case "$endservent_r_proto" in
13066 ''|0) d_endservent_r=undef
13067 endservent_r_proto=0
13068 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
13069 * ) case "$endservent_r_proto" in
13070 REENTRANT_PROTO*) ;;
13071 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
13073 echo "Prototype: $try" ;;
13076 *) case "$usethreads" in
13077 define) echo "endservent_r has no prototype, not using it." >&4 ;;
13079 d_endservent_r=undef
13080 endservent_r_proto=0
13084 *) endservent_r_proto=0
13088 : Locate the flags for 'open()'
13091 #include <sys/types.h>
13096 #include <sys/file.h>
13098 #$i_stdlib I_STDLIB
13100 #include <stdlib.h>
13111 : check sys/file.h first to get FREAD on Sun
13112 if $test `./findhdr sys/file.h` && \
13113 set try -DI_SYS_FILE && eval $compile; then
13115 echo "<sys/file.h> defines the O_* constants..." >&4
13116 if $run ./try; then
13117 echo "and you have the 3 argument form of open()." >&4
13120 echo "but not the 3 argument form of open(). Oh, well." >&4
13123 elif $test `./findhdr fcntl.h` && \
13124 set try -DI_FCNTL && eval $compile; then
13126 echo "<fcntl.h> defines the O_* constants..." >&4
13127 if $run ./try; then
13128 echo "and you have the 3 argument form of open()." >&4
13131 echo "but not the 3 argument form of open(). Oh, well." >&4
13136 echo "I can't find the O_* constant definitions! You got problems." >&4
13142 : see if this is a sys/file.h system
13147 : do we need to include sys/file.h ?
13151 if $h_sysfile; then
13153 echo "We'll be including <sys/file.h>." >&4
13156 echo "We won't be including <sys/file.h>." >&4
13166 : see if fcntl.h is there
13171 : see if we can include fcntl.h
13177 echo "We'll be including <fcntl.h>." >&4
13180 if $h_sysfile; then
13181 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
13183 echo "We won't be including <fcntl.h>." >&4
13195 : see if fork exists
13199 : see if pipe exists
13203 : check for non-blocking I/O stuff
13204 case "$h_sysfile" in
13205 true) echo "#include <sys/file.h>" > head.c;;
13208 true) echo "#include <fcntl.h>" > head.c;;
13209 *) echo "#include <sys/fcntl.h>" > head.c;;
13214 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
13215 case "$o_nonblock" in
13217 $cat head.c > try.c
13218 $cat >>try.c <<EOCP
13220 #$i_stdlib I_STDLIB
13222 #include <stdlib.h>
13230 printf("O_NONBLOCK\n");
13234 printf("O_NDELAY\n");
13238 printf("FNDELAY\n");
13245 if eval $compile_ok; then
13246 o_nonblock=`$run ./try`
13247 case "$o_nonblock" in
13248 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
13249 *) echo "Seems like we can use $o_nonblock.";;
13252 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
13255 *) echo "Using $hint value $o_nonblock.";;
13260 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
13263 case "$d_fork:$d_pipe:$d_alarm" in
13264 define:define:define)
13265 $cat head.c > try.c
13266 $cat >>try.c <<EOCP
13268 #include <sys/types.h>
13269 #include <signal.h>
13271 #$i_stdlib I_STDLIB
13273 #include <stdlib.h>
13279 #define MY_O_NONBLOCK $o_nonblock
13280 #ifndef errno /* XXX need better Configure test */
13283 #$i_unistd I_UNISTD
13285 #include <unistd.h>
13287 #include <string.h>
13288 $signal_t blech(int x) { exit(3); }
13290 $cat >> try.c <<'EOCP'
13299 ret = pipe(pd); /* Down: child -> parent */
13302 ret = pipe(pu); /* Up: parent -> child */
13306 close(pd[1]); /* Parent reads from pd[0] */
13307 close(pu[0]); /* Parent writes (blocking) to pu[1] */
13309 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
13314 signal(SIGALRM, blech);
13316 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
13318 sprintf(string, "%d\n", ret);
13319 ret = write(2, string, strlen(string));
13320 if (ret != strlen(string))
13324 if (errno == EAGAIN) {
13325 printf("EAGAIN\n");
13330 if (errno == EWOULDBLOCK)
13331 printf("EWOULDBLOCK\n");
13334 ret = write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
13337 sleep(2); /* Give it time to close our pipe */
13339 ret = read(pd[0], buf, 1); /* Should read EOF */
13341 sprintf(string, "%d\n", ret);
13342 ret = write(4, string, strlen(string));
13343 if (ret != strlen(string))
13348 close(pd[0]); /* We write to pd[1] */
13349 close(pu[1]); /* We read from pu[0] */
13350 ret = read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
13353 close(pd[1]); /* Pipe pd is now fully closed! */
13354 exit(0); /* Bye bye, thank you for playing! */
13358 if eval $compile_ok; then
13359 echo "$startsh" >mtry
13360 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
13362 $run ./mtry >/dev/null 2>&1
13364 0) eagain=`$cat try.out`;;
13365 1) echo "Could not perform non-blocking setting!";;
13366 2) echo "I did a successful read() for something that was not there!";;
13367 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
13368 4) echo "Could not find F_SETFL!";;
13369 *) echo "Something terribly wrong happened during testing.";;
13371 rd_nodata=`$cat try.ret`
13372 echo "A read() system call with no data present returns $rd_nodata."
13373 case "$rd_nodata" in
13376 echo "(That's peculiar, fixing that to be -1.)"
13382 echo "Forcing errno EAGAIN on read() with no data available."
13386 echo "Your read() sets errno to $eagain when no data is available."
13389 status=`$cat try.err`
13391 0) echo "And it correctly returns 0 to signal EOF.";;
13392 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
13393 *) echo "However, your read() returns '$status' on EOF??";;
13396 if test "$status" = "$rd_nodata"; then
13397 echo "WARNING: you can't distinguish between EOF and no data!"
13401 echo "I can't compile the test program--assuming errno EAGAIN will do."
13405 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
13414 echo "Using $hint value $eagain."
13415 echo "Your read() returns $rd_nodata when no data is present."
13416 case "$d_eofnblk" in
13417 "$define") echo "And you can see EOF because read() returns 0.";;
13418 "$undef") echo "But you can't see EOF status from read() returned value.";;
13420 echo "(Assuming you can't see EOF status from read anyway.)"
13426 $rm_try head.c mtry
13428 : see if erf exists
13432 : see if erfc exists
13436 : see if exp2 exists
13440 : see if expm1 exists
13444 : see if _ptr and _cnt from stdio act std
13447 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
13448 echo "(Looks like you have stdio.h from BSD.)"
13449 case "$stdio_ptr" in
13450 '') stdio_ptr='((fp)->_p)'
13453 *) ptr_lval=$d_stdio_ptr_lval;;
13455 case "$stdio_cnt" in
13456 '') stdio_cnt='((fp)->_r)'
13459 *) cnt_lval=$d_stdio_cnt_lval;;
13461 case "$stdio_base" in
13462 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
13464 case "$stdio_bufsiz" in
13465 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
13467 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
13468 echo "(Looks like you have stdio.h from Linux.)"
13469 case "$stdio_ptr" in
13470 '') stdio_ptr='((fp)->_IO_read_ptr)'
13473 *) ptr_lval=$d_stdio_ptr_lval;;
13475 case "$stdio_cnt" in
13476 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
13479 *) cnt_lval=$d_stdio_cnt_lval;;
13481 case "$stdio_base" in
13482 '') stdio_base='((fp)->_IO_read_base)';;
13484 case "$stdio_bufsiz" in
13485 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
13488 case "$stdio_ptr" in
13489 '') stdio_ptr='((fp)->_ptr)'
13492 *) ptr_lval=$d_stdio_ptr_lval;;
13494 case "$stdio_cnt" in
13495 '') stdio_cnt='((fp)->_cnt)'
13498 *) cnt_lval=$d_stdio_cnt_lval;;
13500 case "$stdio_base" in
13501 '') stdio_base='((fp)->_base)';;
13503 case "$stdio_bufsiz" in
13504 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
13508 : test whether _ptr and _cnt really work
13509 echo "Checking how std your stdio is..." >&4
13512 #$i_stdlib I_STDLIB
13514 #include <stdlib.h>
13516 #define FILE_ptr(fp) $stdio_ptr
13517 #define FILE_cnt(fp) $stdio_cnt
13519 FILE *fp = fopen("try.c", "r");
13522 18 <= FILE_cnt(fp) &&
13523 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13531 if eval $compile && $to try.c; then
13532 if $run ./try; then
13533 echo "Your stdio acts pretty std."
13536 echo "Your stdio isn't very std."
13539 echo "Your stdio doesn't appear very std."
13543 # glibc 2.2.90 and above apparently change stdio streams so Perl's
13544 # direct buffer manipulation no longer works. The Configure tests
13545 # should be changed to correctly detect this, but until then,
13546 # the following check should at least let perl compile and run.
13547 # (This quick fix should be updated before 5.8.1.)
13548 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
13549 # A. Dougherty, June 3, 2002.
13550 case "$d_gnulibc" in
13552 case "$gnulibc_version" in
13556 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
13565 : Can _ptr be used as an lvalue?
13566 case "$d_stdstdio$ptr_lval" in
13567 $define$define) val=$define ;;
13570 set d_stdio_ptr_lval
13573 : Can _cnt be used as an lvalue?
13574 case "$d_stdstdio$cnt_lval" in
13575 $define$define) val=$define ;;
13578 set d_stdio_cnt_lval
13582 : test whether setting _ptr sets _cnt as a side effect
13583 d_stdio_ptr_lval_sets_cnt="$undef"
13584 d_stdio_ptr_lval_nochange_cnt="$undef"
13585 case "$d_stdio_ptr_lval$d_stdstdio" in
13587 echo "Checking to see what happens if we set the stdio ptr..." >&4
13590 /* Can we scream? */
13591 /* Eat dust sed :-) */
13592 /* In the buffer space, no one can hear you scream. */
13593 #$i_stdlib I_STDLIB
13595 #include <stdlib.h>
13597 #define FILE_ptr(fp) $stdio_ptr
13598 #define FILE_cnt(fp) $stdio_cnt
13599 #include <sys/types.h>
13601 FILE *fp = fopen("try.c", "r");
13606 puts("Fail even to read");
13609 c = getc(fp); /* Read away the first # */
13611 puts("Fail even to read");
13615 18 <= FILE_cnt(fp) &&
13616 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13618 puts("Fail even to read");
13621 ptr = (char*) FILE_ptr(fp);
13622 cnt = (size_t)FILE_cnt(fp);
13624 FILE_ptr(fp) += 42;
13626 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
13627 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
13630 if (FILE_cnt(fp) <= 20) {
13631 printf ("Fail (<20 chars to test)");
13634 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
13635 puts("Fail compare");
13638 if (cnt == FILE_cnt(fp)) {
13639 puts("Pass_unchanged");
13642 if (FILE_cnt(fp) == (cnt - 42)) {
13643 puts("Pass_changed");
13646 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
13652 if eval $compile && $to try.c; then
13653 case `$run ./try` in
13655 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
13656 d_stdio_ptr_lval_sets_cnt="$define" ;;
13658 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
13659 d_stdio_ptr_lval_nochange_cnt="$define" ;;
13661 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
13663 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
13666 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
13672 : see if _base is also standard
13674 case "$d_stdstdio" in
13678 #$i_stdlib I_STDLIB
13680 #include <stdlib.h>
13682 #define FILE_base(fp) $stdio_base
13683 #define FILE_bufsiz(fp) $stdio_bufsiz
13685 FILE *fp = fopen("try.c", "r");
13688 19 <= FILE_bufsiz(fp) &&
13689 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
13696 if eval $compile && $to try.c; then
13697 if $run ./try; then
13698 echo "And its _base field acts std."
13701 echo "But its _base field isn't std."
13704 echo "However, it seems to be lacking the _base field."
13712 : see if fast_stdio exists
13714 case "$d_stdstdio:$d_stdio_ptr_lval" in
13716 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
13718 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
13727 : see if fchdir exists
13728 set fchdir d_fchdir
13731 : see if fchmod exists
13732 set fchmod d_fchmod
13735 : check for openat, unlinkat, renameat, linkat, fchmodat
13736 set openat d_openat
13739 set unlinkat d_unlinkat
13742 set renameat d_renameat
13745 set linkat d_linkat
13748 set fchmodat d_fchmodat
13751 : see if fchown exists
13752 set fchown d_fchown
13755 : see if this is an fcntl system
13759 : See if fcntl-based locking works.
13762 #$i_stdlib I_STDLIB
13764 #include <stdlib.h>
13766 #include <unistd.h>
13768 #include <signal.h>
13769 $signal_t blech(int x) { exit(3); }
13771 #if defined(F_SETLK) && defined(F_SETLKW)
13772 struct flock flock;
13774 fd = open("try.c", O_RDONLY);
13775 flock.l_type = F_RDLCK;
13776 flock.l_whence = SEEK_SET;
13777 flock.l_start = flock.l_len = 0;
13778 signal(SIGALRM, blech);
13780 retval = fcntl(fd, F_SETLK, &flock);
13782 (retval < 0 ? exit(2) : exit(0));
13788 echo "Checking if fcntl-based file locking works... "
13792 if eval $compile_ok; then
13793 if $run ./try; then
13794 echo "Yes, it seems to work."
13797 echo "Nope, it didn't work."
13802 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
13803 *** This is (almost) impossible.
13804 *** If your NFS lock daemons are not feeling well, something like
13805 *** this may happen, please investigate. Cannot continue, aborting.
13813 echo "I'm unable to compile the test program, so I'll assume not."
13818 echo "Nope, since you don't even have fcntl()."
13821 set d_fcntl_can_lock
13825 : check for fd_set items
13828 Checking to see how well your C compiler handles fd_set and friends ...
13831 #$i_stdlib I_STDLIB
13833 #include <stdlib.h>
13835 #$i_systime I_SYS_TIME
13836 #$i_sysselct I_SYS_SELECT
13837 #$d_socket HAS_SOCKET
13838 #include <sys/types.h>
13840 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
13843 #include <sys/time.h>
13845 #ifdef I_SYS_SELECT
13846 #include <sys/select.h>
13855 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
13863 if eval $compile; then
13864 d_fds_bits="$define"
13866 echo "Well, your system knows about the normal fd_set typedef..." >&4
13867 if $run ./try; then
13868 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
13869 d_fd_macros="$define"
13872 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
13874 d_fd_macros="$undef"
13878 Hmm, your compiler has some difficulty with fd_set. Checking further...
13881 if eval $compile; then
13882 d_fds_bits="$undef"
13884 echo "Well, your system has some sort of fd_set available..." >&4
13885 if $run ./try; then
13886 echo "and you have the normal fd_set macros." >&4
13887 d_fd_macros="$define"
13890 but not the normal fd_set macros! Gross! More work for me...
13892 d_fd_macros="$undef"
13895 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
13897 d_fds_bits="$undef"
13898 d_fd_macros="$undef"
13903 : see if fdclose exists
13904 set fdclose d_fdclose
13907 : see if fdim exists
13911 : see if fegetround exists
13912 set fegetround d_fegetround
13915 : see if fgetpos exists
13916 set fgetpos d_fgetpos
13919 : see if finite exists
13920 set finite d_finite
13923 : see if finitel exists
13924 set finitel d_finitel
13927 : see if flock exists
13931 : see if prototype for flock is available
13933 set d_flockproto flock $i_sysfile sys/file.h
13936 : see if fma exists
13940 : see if fmax exists
13944 : see if fmin exists
13948 : see if fp_class exists
13949 set fp_class d_fp_class
13952 : check for fpclassify
13953 echo "Checking to see if you have fpclassify..." >&4
13956 int main() { return fpclassify(1.0) == FP_NORMAL ? 0 : 1; }
13959 if eval $compile; then
13961 echo "You have fpclassify."
13964 echo "You do not have fpclassify."
13970 : see if fp_classify exists
13971 set fp_classify d_fp_classify
13974 : see if fp_classl exists
13975 set fp_classl d_fp_classl
13978 : see if pathconf exists
13979 set pathconf d_pathconf
13982 : see if fpathconf exists
13983 set fpathconf d_fpathconf
13986 : see if fpclass exists
13987 set fpclass d_fpclass
13990 : see if fpclassl exists
13991 set fpclassl d_fpclassl
13994 : see if fpgetround exists
13995 set fpgetround d_fpgetround
13998 : check for fpos64_t
14000 echo "Checking to see if you have fpos64_t..." >&4
14003 int main() { fpos64_t x = 7; }
14006 if eval $compile; then
14008 echo "You have fpos64_t."
14011 echo "You do not have fpos64_t."
14012 case "$fpossize" in
14013 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
14020 : see if frexpl exists
14021 set frexpl d_frexpl
14024 : see if this is a sys/param system
14025 set sys/param.h i_sysparam
14028 : see if this is a sys/mount.h system
14029 set sys/mount.h i_sysmount
14032 : Check for fs_data_s
14034 echo "Checking to see if your system supports struct fs_data..." >&4
14035 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
14037 case "$d_fs_data_s" in
14038 "$define") echo "Yes, it does." ;;
14039 *) echo "No, it doesn't." ;;
14042 : see if fseeko exists
14043 set fseeko d_fseeko
14045 case "$longsize" in
14046 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
14049 : see if fsetpos exists
14050 set fsetpos d_fsetpos
14053 : see if fstatfs exists
14054 set fstatfs d_fstatfs
14057 : see if statvfs exists
14058 set statvfs d_statvfs
14061 : see if fstatvfs exists
14062 set fstatvfs d_fstatvfs
14065 : see if fsync exists
14069 : see if ftello exists
14070 set ftello d_ftello
14072 case "$longsize" in
14073 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
14076 : check for a working futimes
14079 echo "Checking if you have a working futimes()" >&4
14082 #include <sys/time.h>
14089 fd = open ("try.c", O_RDWR);
14090 if (-1 == fd) exit (1);
14091 rv = futimes (fd, NULL);
14092 exit (rv == -1 ? errno : 0);
14096 if eval $compile; then
14100 0) echo "Yes, you have" >&4
14101 d_futimes="$define"
14103 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
14107 echo "No, it does not (probably harmless)" >&4
14111 : look for gai_strerror
14113 $cat >try.c <<'EOCP'
14114 #include <sys/types.h>
14115 #include <sys/socket.h>
14119 return (gai_strerror (0) ? 0 : 1);
14124 if eval $compile; then
14127 0) echo "A working gai_strerror() found." >&4
14129 *) echo "gai_strerror() found, but it doesn't work" >&4
14133 echo "gai_strerror() NOT found." >&4
14139 : see if ndbm.h is available
14142 : Compatibility location for RedHat 7.1
14143 set gdbm/ndbm.h i_gdbmndbm
14145 : Compatibility location for Debian 4.0
14146 set gdbm-ndbm.h i_gdbm_ndbm
14150 if $test "$i_ndbm" = "$define" -o "$i_gdbmndbm" = "$define" -o "$i_gdbm_ndbm" = "$define"; then
14151 : see if dbm_open exists
14152 set dbm_open d_dbm_open
14154 case "$d_dbm_open" in
14157 i_gdbmndbm="$undef"
14158 i_gdbm_ndbm="$undef"
14159 echo "We won't be including <ndbm.h>"
14169 ndbm_hdr_protochk='name=$1; hdr=$2;
14170 eval "ihdr=\$""i_$name";
14172 if $test "$ihdr" = "$define"; then
14173 $echo "Checking if your <$hdr> uses prototypes..." >&4;
14174 case "$d_cplusplus" in
14175 $define) ./protochk "$extern_C void dbm_close(DBM *);" literal "extern \"C\" {" $ihdr $hdr literal "}" && val="$define" ;;
14176 *) ./protochk "$extern_C void dbm_close(int, int);" $ihdr $hdr || val="$define" ;;
14179 $define) $echo "Your <$hdr> seems to have prototypes";;
14180 *) $echo "Your <$hdr> does not seem to have prototypes";;
14183 set "d_${name}_h_uses_prototypes";
14187 eval $ndbm_hdr_protochk
14188 set gdbmndbm gdbm/ndbm.h
14189 eval $ndbm_hdr_protochk
14190 set gdbm_ndbm gdbm-ndbm.h
14191 eval $ndbm_hdr_protochk
14193 : see if getaddrinfo exists
14194 set getaddrinfo d_getaddrinfo
14197 : see if getcwd exists
14198 set getcwd d_getcwd
14201 : see if getespwnam exists
14202 set getespwnam d_getespwnam
14205 : see if getfsstat exists
14206 set getfsstat d_getfsstat
14209 : see if getgrent exists
14210 set getgrent d_getgrent
14213 : see if getgrent_r exists
14214 set getgrent_r d_getgrent_r
14216 case "$d_getgrent_r" in
14218 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14219 case "$d_getgrent_r_proto:$usethreads" in
14220 ":define") d_getgrent_r_proto=define
14221 set d_getgrent_r_proto getgrent_r $hdrs
14225 case "$d_getgrent_r_proto" in
14227 case "$getgrent_r_proto" in
14228 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
14229 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBWR ;;
14231 case "$getgrent_r_proto" in
14232 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
14233 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIR ;;
14235 case "$getgrent_r_proto" in
14236 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
14237 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBW ;;
14239 case "$getgrent_r_proto" in
14240 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
14241 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBI ;;
14243 case "$getgrent_r_proto" in
14244 ''|0) try='int getgrent_r(struct group*, char*, int);'
14245 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBI ;;
14247 case "$getgrent_r_proto" in
14248 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
14249 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIH ;;
14251 case "$getgrent_r_proto" in
14252 ''|0) d_getgrent_r=undef
14254 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
14255 * ) case "$getgrent_r_proto" in
14256 REENTRANT_PROTO*) ;;
14257 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
14259 echo "Prototype: $try" ;;
14262 *) case "$usethreads" in
14263 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
14270 *) getgrent_r_proto=0
14274 : see if getgrgid_r exists
14275 set getgrgid_r d_getgrgid_r
14277 case "$d_getgrgid_r" in
14279 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14280 case "$d_getgrgid_r_proto:$usethreads" in
14281 ":define") d_getgrgid_r_proto=define
14282 set d_getgrgid_r_proto getgrgid_r $hdrs
14286 case "$d_getgrgid_r_proto" in
14288 case "$getgrgid_r_proto" in
14289 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
14290 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
14292 case "$getgrgid_r_proto" in
14293 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
14294 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
14296 case "$getgrgid_r_proto" in
14297 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
14298 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
14300 case "$getgrgid_r_proto" in
14301 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
14302 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
14304 case "$getgrgid_r_proto" in
14305 ''|0) d_getgrgid_r=undef
14307 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
14308 * ) case "$getgrgid_r_proto" in
14309 REENTRANT_PROTO*) ;;
14310 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
14312 echo "Prototype: $try" ;;
14315 *) case "$usethreads" in
14316 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
14323 *) getgrgid_r_proto=0
14327 : see if getgrnam_r exists
14328 set getgrnam_r d_getgrnam_r
14330 case "$d_getgrnam_r" in
14332 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14333 case "$d_getgrnam_r_proto:$usethreads" in
14334 ":define") d_getgrnam_r_proto=define
14335 set d_getgrnam_r_proto getgrnam_r $hdrs
14339 case "$d_getgrnam_r_proto" in
14341 case "$getgrnam_r_proto" in
14342 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
14343 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
14345 case "$getgrnam_r_proto" in
14346 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
14347 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
14349 case "$getgrnam_r_proto" in
14350 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
14351 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CBI ;;
14353 case "$getgrnam_r_proto" in
14354 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
14355 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
14357 case "$getgrnam_r_proto" in
14358 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
14359 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
14361 case "$getgrnam_r_proto" in
14362 ''|0) d_getgrnam_r=undef
14364 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
14365 * ) case "$getgrnam_r_proto" in
14366 REENTRANT_PROTO*) ;;
14367 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
14369 echo "Prototype: $try" ;;
14372 *) case "$usethreads" in
14373 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
14380 *) getgrnam_r_proto=0
14384 : see if gethostbyaddr exists
14385 set gethostbyaddr d_gethbyaddr
14388 : see if gethostbyname exists
14389 set gethostbyname d_gethbyname
14392 : see if gethostent exists
14393 set gethostent d_gethent
14396 : see how we will look up host name
14399 if set gethostname val -f d_gethname; eval $csym; $val; then
14400 echo 'gethostname() found.' >&4
14401 d_gethname="$define"
14404 if set uname val -f d_uname; eval $csym; $val; then
14407 uname() was found, but you're running xenix, and older versions of xenix
14408 have a broken uname(). If you don't really know whether your xenix is old
14409 enough to have a broken system call, use the default answer.
14414 "$define") dflt=n;;
14416 rp='Is your uname() broken?'
14419 n*) d_uname="$define"; call=uname;;
14422 echo 'uname() found.' >&4
14429 case "$d_gethname" in
14430 '') d_gethname="$undef";;
14433 '') d_uname="$undef";;
14435 case "$d_uname$d_gethname" in
14440 Every now and then someone has a $call() that lies about the hostname
14441 but can't be fixed for political or economic reasons. If you wish, I can
14442 pretend $call() isn't there and maybe compute hostname at run-time
14443 thanks to the '$phostname' command.
14446 rp="Shall I ignore $call() from now on?"
14449 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
14452 case "$phostname" in
14453 '') aphostname='';;
14454 *) case "$aphostname" in
14456 *) set X $phostname
14460 file=`./loc $file $file $pth`
14461 aphostname=`echo $file $*`
14466 case "$d_uname$d_gethname" in
14469 case "$phostname" in
14471 echo "There will be no way for $package to get your hostname." >&4;;
14473 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
14477 case "$d_phostname" in
14478 '') d_phostname="$undef";;
14481 : see if gethostbyaddr_r exists
14482 set gethostbyaddr_r d_gethostbyaddr_r
14484 case "$d_gethostbyaddr_r" in
14486 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14487 case "$d_gethostbyaddr_r_proto:$usethreads" in
14488 ":define") d_gethostbyaddr_r_proto=define
14489 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
14493 case "$d_gethostbyaddr_r_proto" in
14495 case "$gethostbyaddr_r_proto" in
14496 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
14497 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
14499 case "$gethostbyaddr_r_proto" in
14500 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
14501 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
14503 case "$gethostbyaddr_r_proto" in
14504 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
14505 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
14507 case "$gethostbyaddr_r_proto" in
14508 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
14509 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
14511 case "$gethostbyaddr_r_proto" in
14512 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
14513 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
14515 case "$gethostbyaddr_r_proto" in
14516 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
14517 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
14519 case "$gethostbyaddr_r_proto" in
14520 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
14521 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
14523 case "$gethostbyaddr_r_proto" in
14524 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
14525 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
14527 case "$gethostbyaddr_r_proto" in
14528 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
14529 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
14531 case "$gethostbyaddr_r_proto" in
14532 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
14533 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
14535 case "$gethostbyaddr_r_proto" in
14536 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
14537 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
14539 case "$gethostbyaddr_r_proto" in
14540 ''|0) d_gethostbyaddr_r=undef
14541 gethostbyaddr_r_proto=0
14542 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
14543 * ) case "$gethostbyaddr_r_proto" in
14544 REENTRANT_PROTO*) ;;
14545 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
14547 echo "Prototype: $try" ;;
14550 *) case "$usethreads" in
14551 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
14553 d_gethostbyaddr_r=undef
14554 gethostbyaddr_r_proto=0
14558 *) gethostbyaddr_r_proto=0
14562 : see if gethostbyname_r exists
14563 set gethostbyname_r d_gethostbyname_r
14565 case "$d_gethostbyname_r" in
14567 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14568 case "$d_gethostbyname_r_proto:$usethreads" in
14569 ":define") d_gethostbyname_r_proto=define
14570 set d_gethostbyname_r_proto gethostbyname_r $hdrs
14574 case "$d_gethostbyname_r_proto" in
14576 case "$gethostbyname_r_proto" in
14577 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
14578 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
14580 case "$gethostbyname_r_proto" in
14581 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
14582 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
14584 case "$gethostbyname_r_proto" in
14585 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
14586 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
14588 case "$gethostbyname_r_proto" in
14589 ''|0) d_gethostbyname_r=undef
14590 gethostbyname_r_proto=0
14591 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
14592 * ) case "$gethostbyname_r_proto" in
14593 REENTRANT_PROTO*) ;;
14594 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
14596 echo "Prototype: $try" ;;
14599 *) case "$usethreads" in
14600 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
14602 d_gethostbyname_r=undef
14603 gethostbyname_r_proto=0
14607 *) gethostbyname_r_proto=0
14611 : see if gethostent_r exists
14612 set gethostent_r d_gethostent_r
14614 case "$d_gethostent_r" in
14616 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14617 case "$d_gethostent_r_proto:$usethreads" in
14618 ":define") d_gethostent_r_proto=define
14619 set d_gethostent_r_proto gethostent_r $hdrs
14623 case "$d_gethostent_r_proto" in
14625 case "$gethostent_r_proto" in
14626 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
14627 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
14629 case "$gethostent_r_proto" in
14630 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
14631 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBIE ;;
14633 case "$gethostent_r_proto" in
14634 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
14635 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBIE ;;
14637 case "$gethostent_r_proto" in
14638 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
14639 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBI ;;
14641 case "$gethostent_r_proto" in
14642 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
14643 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBI ;;
14645 case "$gethostent_r_proto" in
14646 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
14647 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SD ;;
14649 case "$gethostent_r_proto" in
14650 ''|0) d_gethostent_r=undef
14651 gethostent_r_proto=0
14652 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
14653 * ) case "$gethostent_r_proto" in
14654 REENTRANT_PROTO*) ;;
14655 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
14657 echo "Prototype: $try" ;;
14660 *) case "$usethreads" in
14661 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
14663 d_gethostent_r=undef
14664 gethostent_r_proto=0
14668 *) gethostent_r_proto=0
14672 : see if prototypes for various gethostxxx netdb.h functions are available
14674 set d_gethostprotos gethostent $i_netdb netdb.h
14677 : see if getitimer exists
14678 set getitimer d_getitimer
14681 : see if getlogin exists
14682 set getlogin d_getlogin
14685 : see if getlogin_r exists
14686 set getlogin_r d_getlogin_r
14688 case "$d_getlogin_r" in
14690 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
14691 case "$d_getlogin_r_proto:$usethreads" in
14692 ":define") d_getlogin_r_proto=define
14693 set d_getlogin_r_proto getlogin_r $hdrs
14697 case "$d_getlogin_r_proto" in
14699 case "$getlogin_r_proto" in
14700 ''|0) try='int getlogin_r(char*, size_t);'
14701 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BW ;;
14703 case "$getlogin_r_proto" in
14704 ''|0) try='int getlogin_r(char*, int);'
14705 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BI ;;
14707 case "$getlogin_r_proto" in
14708 ''|0) try='char* getlogin_r(char*, size_t);'
14709 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BW ;;
14711 case "$getlogin_r_proto" in
14712 ''|0) try='char* getlogin_r(char*, int);'
14713 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BI ;;
14715 case "$getlogin_r_proto" in
14716 ''|0) d_getlogin_r=undef
14718 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
14719 * ) case "$getlogin_r_proto" in
14720 REENTRANT_PROTO*) ;;
14721 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
14723 echo "Prototype: $try" ;;
14726 *) case "$usethreads" in
14727 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
14734 *) getlogin_r_proto=0
14738 : see if getmnt exists
14739 set getmnt d_getmnt
14742 : see if getmntent exists
14743 set getmntent d_getmntent
14746 : see if getnameinfo exists
14747 set getnameinfo d_getnameinfo
14750 : see if getnetbyaddr exists
14751 set getnetbyaddr d_getnbyaddr
14754 : see if getnetbyname exists
14755 set getnetbyname d_getnbyname
14758 : see if getnetent exists
14759 set getnetent d_getnent
14762 : see if getnetbyaddr_r exists
14763 set getnetbyaddr_r d_getnetbyaddr_r
14765 case "$d_getnetbyaddr_r" in
14767 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14768 case "$d_getnetbyaddr_r_proto:$usethreads" in
14769 ":define") d_getnetbyaddr_r_proto=define
14770 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
14774 case "$d_getnetbyaddr_r_proto" in
14776 case "$getnetbyaddr_r_proto" in
14777 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
14778 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
14780 case "$getnetbyaddr_r_proto" in
14781 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
14782 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
14784 case "$getnetbyaddr_r_proto" in
14785 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
14786 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
14788 case "$getnetbyaddr_r_proto" in
14789 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
14790 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
14792 case "$getnetbyaddr_r_proto" in
14793 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
14794 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
14796 case "$getnetbyaddr_r_proto" in
14797 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
14798 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
14800 case "$getnetbyaddr_r_proto" in
14801 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
14802 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
14804 case "$getnetbyaddr_r_proto" in
14805 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
14806 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
14808 case "$getnetbyaddr_r_proto" in
14809 ''|0) d_getnetbyaddr_r=undef
14810 getnetbyaddr_r_proto=0
14811 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
14812 * ) case "$getnetbyaddr_r_proto" in
14813 REENTRANT_PROTO*) ;;
14814 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
14816 echo "Prototype: $try" ;;
14819 *) case "$usethreads" in
14820 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
14822 d_getnetbyaddr_r=undef
14823 getnetbyaddr_r_proto=0
14827 *) getnetbyaddr_r_proto=0
14831 : see if getnetbyname_r exists
14832 set getnetbyname_r d_getnetbyname_r
14834 case "$d_getnetbyname_r" in
14836 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14837 case "$d_getnetbyname_r_proto:$usethreads" in
14838 ":define") d_getnetbyname_r_proto=define
14839 set d_getnetbyname_r_proto getnetbyname_r $hdrs
14843 case "$d_getnetbyname_r_proto" in
14845 case "$getnetbyname_r_proto" in
14846 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
14847 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
14849 case "$getnetbyname_r_proto" in
14850 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
14851 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
14853 case "$getnetbyname_r_proto" in
14854 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
14855 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
14857 case "$getnetbyname_r_proto" in
14858 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
14859 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
14861 case "$getnetbyname_r_proto" in
14862 ''|0) d_getnetbyname_r=undef
14863 getnetbyname_r_proto=0
14864 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
14865 * ) case "$getnetbyname_r_proto" in
14866 REENTRANT_PROTO*) ;;
14867 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
14869 echo "Prototype: $try" ;;
14872 *) case "$usethreads" in
14873 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
14875 d_getnetbyname_r=undef
14876 getnetbyname_r_proto=0
14880 *) getnetbyname_r_proto=0
14884 : see if getnetent_r exists
14885 set getnetent_r d_getnetent_r
14887 case "$d_getnetent_r" in
14889 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14890 case "$d_getnetent_r_proto:$usethreads" in
14891 ":define") d_getnetent_r_proto=define
14892 set d_getnetent_r_proto getnetent_r $hdrs
14896 case "$d_getnetent_r_proto" in
14898 case "$getnetent_r_proto" in
14899 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
14900 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
14902 case "$getnetent_r_proto" in
14903 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
14904 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBIE ;;
14906 case "$getnetent_r_proto" in
14907 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
14908 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBIE ;;
14910 case "$getnetent_r_proto" in
14911 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
14912 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBI ;;
14914 case "$getnetent_r_proto" in
14915 ''|0) try='int getnetent_r(struct netent*, char*, int);'
14916 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBI ;;
14918 case "$getnetent_r_proto" in
14919 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
14920 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SD ;;
14922 case "$getnetent_r_proto" in
14923 ''|0) d_getnetent_r=undef
14924 getnetent_r_proto=0
14925 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
14926 * ) case "$getnetent_r_proto" in
14927 REENTRANT_PROTO*) ;;
14928 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
14930 echo "Prototype: $try" ;;
14933 *) case "$usethreads" in
14934 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
14936 d_getnetent_r=undef
14937 getnetent_r_proto=0
14941 *) getnetent_r_proto=0
14945 : see if prototypes for various getnetxxx netdb.h functions are available
14947 set d_getnetprotos getnetent $i_netdb netdb.h
14950 : see if getpagesize exists
14951 set getpagesize d_getpagsz
14954 : Optional checks for getprotobyname and getprotobynumber
14956 : see if getprotobyname exists
14957 set getprotobyname d_getpbyname
14960 : see if getprotobynumber exists
14961 set getprotobynumber d_getpbynumber
14964 : see if getprotoent exists
14965 set getprotoent d_getpent
14968 : see if getpgid exists
14969 set getpgid d_getpgid
14972 : see if getpgrp2 exists
14973 set getpgrp2 d_getpgrp2
14976 : see if getppid exists
14977 set getppid d_getppid
14980 : see if getpriority exists
14981 set getpriority d_getprior
14984 : see if getprotobyname_r exists
14985 set getprotobyname_r d_getprotobyname_r
14987 case "$d_getprotobyname_r" in
14989 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14990 case "$d_getprotobyname_r_proto:$usethreads" in
14991 ":define") d_getprotobyname_r_proto=define
14992 set d_getprotobyname_r_proto getprotobyname_r $hdrs
14996 case "$d_getprotobyname_r_proto" in
14998 case "$getprotobyname_r_proto" in
14999 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
15000 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
15002 case "$getprotobyname_r_proto" in
15003 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
15004 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
15006 case "$getprotobyname_r_proto" in
15007 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
15008 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
15010 case "$getprotobyname_r_proto" in
15011 ''|0) d_getprotobyname_r=undef
15012 getprotobyname_r_proto=0
15013 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
15014 * ) case "$getprotobyname_r_proto" in
15015 REENTRANT_PROTO*) ;;
15016 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
15018 echo "Prototype: $try" ;;
15021 *) case "$usethreads" in
15022 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
15024 d_getprotobyname_r=undef
15025 getprotobyname_r_proto=0
15029 *) getprotobyname_r_proto=0
15033 : see if getprotobynumber_r exists
15034 set getprotobynumber_r d_getprotobynumber_r
15036 case "$d_getprotobynumber_r" in
15038 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15039 case "$d_getprotobynumber_r_proto:$usethreads" in
15040 ":define") d_getprotobynumber_r_proto=define
15041 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
15045 case "$d_getprotobynumber_r_proto" in
15047 case "$getprotobynumber_r_proto" in
15048 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
15049 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
15051 case "$getprotobynumber_r_proto" in
15052 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
15053 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
15055 case "$getprotobynumber_r_proto" in
15056 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
15057 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
15059 case "$getprotobynumber_r_proto" in
15060 ''|0) d_getprotobynumber_r=undef
15061 getprotobynumber_r_proto=0
15062 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
15063 * ) case "$getprotobynumber_r_proto" in
15064 REENTRANT_PROTO*) ;;
15065 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
15067 echo "Prototype: $try" ;;
15070 *) case "$usethreads" in
15071 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
15073 d_getprotobynumber_r=undef
15074 getprotobynumber_r_proto=0
15078 *) getprotobynumber_r_proto=0
15082 : see if getprotoent_r exists
15083 set getprotoent_r d_getprotoent_r
15085 case "$d_getprotoent_r" in
15087 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15088 case "$d_getprotoent_r_proto:$usethreads" in
15089 ":define") d_getprotoent_r_proto=define
15090 set d_getprotoent_r_proto getprotoent_r $hdrs
15094 case "$d_getprotoent_r_proto" in
15096 case "$getprotoent_r_proto" in
15097 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
15098 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
15100 case "$getprotoent_r_proto" in
15101 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
15102 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBI ;;
15104 case "$getprotoent_r_proto" in
15105 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
15106 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=S_SBI ;;
15108 case "$getprotoent_r_proto" in
15109 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
15110 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SD ;;
15112 case "$getprotoent_r_proto" in
15113 ''|0) d_getprotoent_r=undef
15114 getprotoent_r_proto=0
15115 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
15116 * ) case "$getprotoent_r_proto" in
15117 REENTRANT_PROTO*) ;;
15118 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
15120 echo "Prototype: $try" ;;
15123 *) case "$usethreads" in
15124 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
15126 d_getprotoent_r=undef
15127 getprotoent_r_proto=0
15131 *) getprotoent_r_proto=0
15135 : see if prototypes for various getprotoxxx netdb.h functions are available
15137 set d_getprotoprotos getprotoent $i_netdb netdb.h
15140 : see if getprpwnam exists
15141 set getprpwnam d_getprpwnam
15144 : see if getpwent exists
15145 set getpwent d_getpwent
15148 : see if getpwent_r exists
15149 set getpwent_r d_getpwent_r
15151 case "$d_getpwent_r" in
15153 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15154 case "$d_getpwent_r_proto:$usethreads" in
15155 ":define") d_getpwent_r_proto=define
15156 set d_getpwent_r_proto getpwent_r $hdrs
15160 case "$d_getpwent_r_proto" in
15162 case "$getpwent_r_proto" in
15163 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
15164 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBWR ;;
15166 case "$getpwent_r_proto" in
15167 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
15168 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIR ;;
15170 case "$getpwent_r_proto" in
15171 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
15172 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBW ;;
15174 case "$getpwent_r_proto" in
15175 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
15176 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBI ;;
15178 case "$getpwent_r_proto" in
15179 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
15180 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBI ;;
15182 case "$getpwent_r_proto" in
15183 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
15184 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIH ;;
15186 case "$getpwent_r_proto" in
15187 ''|0) d_getpwent_r=undef
15189 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
15190 * ) case "$getpwent_r_proto" in
15191 REENTRANT_PROTO*) ;;
15192 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
15194 echo "Prototype: $try" ;;
15197 *) case "$usethreads" in
15198 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
15205 *) getpwent_r_proto=0
15209 : see if getpwnam_r exists
15210 set getpwnam_r d_getpwnam_r
15212 case "$d_getpwnam_r" in
15214 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15215 case "$d_getpwnam_r_proto:$usethreads" in
15216 ":define") d_getpwnam_r_proto=define
15217 set d_getpwnam_r_proto getpwnam_r $hdrs
15221 case "$d_getpwnam_r_proto" in
15223 case "$getpwnam_r_proto" in
15224 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
15225 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
15227 case "$getpwnam_r_proto" in
15228 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
15229 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
15231 case "$getpwnam_r_proto" in
15232 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
15233 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
15235 case "$getpwnam_r_proto" in
15236 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
15237 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
15239 case "$getpwnam_r_proto" in
15240 ''|0) d_getpwnam_r=undef
15242 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
15243 * ) case "$getpwnam_r_proto" in
15244 REENTRANT_PROTO*) ;;
15245 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
15247 echo "Prototype: $try" ;;
15250 *) case "$usethreads" in
15251 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
15258 *) getpwnam_r_proto=0
15262 : see if getpwuid_r exists
15263 set getpwuid_r d_getpwuid_r
15265 case "$d_getpwuid_r" in
15267 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15268 case "$d_getpwuid_r_proto:$usethreads" in
15269 ":define") d_getpwuid_r_proto=define
15270 set d_getpwuid_r_proto getpwuid_r $hdrs
15274 case "$d_getpwuid_r_proto" in
15276 case "$getpwuid_r_proto" in
15277 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
15278 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
15280 case "$getpwuid_r_proto" in
15281 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
15282 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
15284 case "$getpwuid_r_proto" in
15285 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
15286 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
15288 case "$getpwuid_r_proto" in
15289 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
15290 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
15292 case "$getpwuid_r_proto" in
15293 ''|0) d_getpwuid_r=undef
15295 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
15296 * ) case "$getpwuid_r_proto" in
15297 REENTRANT_PROTO*) ;;
15298 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
15300 echo "Prototype: $try" ;;
15303 *) case "$usethreads" in
15304 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
15311 *) getpwuid_r_proto=0
15315 : Optional checks for getsbyname and getsbyport
15317 : see if getservbyname exists
15318 set getservbyname d_getsbyname
15321 : see if getservbyport exists
15322 set getservbyport d_getsbyport
15325 : see if getservent exists
15326 set getservent d_getsent
15329 : see if getservbyname_r exists
15330 set getservbyname_r d_getservbyname_r
15332 case "$d_getservbyname_r" in
15334 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15335 case "$d_getservbyname_r_proto:$usethreads" in
15336 ":define") d_getservbyname_r_proto=define
15337 set d_getservbyname_r_proto getservbyname_r $hdrs
15341 case "$d_getservbyname_r_proto" in
15343 case "$getservbyname_r_proto" in
15344 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
15345 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
15347 case "$getservbyname_r_proto" in
15348 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
15349 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
15351 case "$getservbyname_r_proto" in
15352 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
15353 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
15355 case "$getservbyname_r_proto" in
15356 ''|0) d_getservbyname_r=undef
15357 getservbyname_r_proto=0
15358 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
15359 * ) case "$getservbyname_r_proto" in
15360 REENTRANT_PROTO*) ;;
15361 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
15363 echo "Prototype: $try" ;;
15366 *) case "$usethreads" in
15367 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
15369 d_getservbyname_r=undef
15370 getservbyname_r_proto=0
15374 *) getservbyname_r_proto=0
15378 : see if getservbyport_r exists
15379 set getservbyport_r d_getservbyport_r
15381 case "$d_getservbyport_r" in
15383 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15384 case "$d_getservbyport_r_proto:$usethreads" in
15385 ":define") d_getservbyport_r_proto=define
15386 set d_getservbyport_r_proto getservbyport_r $hdrs
15390 case "$d_getservbyport_r_proto" in
15392 case "$getservbyport_r_proto" in
15393 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
15394 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
15396 case "$getservbyport_r_proto" in
15397 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
15398 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
15400 case "$getservbyport_r_proto" in
15401 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
15402 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
15404 case "$getservbyport_r_proto" in
15405 ''|0) d_getservbyport_r=undef
15406 getservbyport_r_proto=0
15407 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
15408 * ) case "$getservbyport_r_proto" in
15409 REENTRANT_PROTO*) ;;
15410 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
15412 echo "Prototype: $try" ;;
15415 *) case "$usethreads" in
15416 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
15418 d_getservbyport_r=undef
15419 getservbyport_r_proto=0
15423 *) getservbyport_r_proto=0
15427 : see if getservent_r exists
15428 set getservent_r d_getservent_r
15430 case "$d_getservent_r" in
15432 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15433 case "$d_getservent_r_proto:$usethreads" in
15434 ":define") d_getservent_r_proto=define
15435 set d_getservent_r_proto getservent_r $hdrs
15439 case "$d_getservent_r_proto" in
15441 case "$getservent_r_proto" in
15442 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
15443 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBWR ;;
15445 case "$getservent_r_proto" in
15446 ''|0) try='int getservent_r(struct servent*, char*, int);'
15447 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBI ;;
15449 case "$getservent_r_proto" in
15450 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
15451 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=S_SBI ;;
15453 case "$getservent_r_proto" in
15454 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
15455 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SD ;;
15457 case "$getservent_r_proto" in
15458 ''|0) d_getservent_r=undef
15459 getservent_r_proto=0
15460 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
15461 * ) case "$getservent_r_proto" in
15462 REENTRANT_PROTO*) ;;
15463 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
15465 echo "Prototype: $try" ;;
15468 *) case "$usethreads" in
15469 define) echo "getservent_r has no prototype, not using it." >&4 ;;
15471 d_getservent_r=undef
15472 getservent_r_proto=0
15476 *) getservent_r_proto=0
15480 : see if prototypes for various getservxxx netdb.h functions are available
15482 set d_getservprotos getservent $i_netdb netdb.h
15485 : see if getspnam exists
15486 set getspnam d_getspnam
15489 : see if this is a shadow.h system
15490 set shadow.h i_shadow
15493 : see if getspnam_r exists
15494 set getspnam_r d_getspnam_r
15496 case "$d_getspnam_r" in
15498 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
15499 case "$d_getspnam_r_proto:$usethreads" in
15500 ":define") d_getspnam_r_proto=define
15501 set d_getspnam_r_proto getspnam_r $hdrs
15505 case "$d_getspnam_r_proto" in
15507 case "$getspnam_r_proto" in
15508 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
15509 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
15511 case "$getspnam_r_proto" in
15512 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
15513 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=S_CSBI ;;
15515 case "$getspnam_r_proto" in
15516 ''|0) d_getspnam_r=undef
15518 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
15519 * ) case "$getspnam_r_proto" in
15520 REENTRANT_PROTO*) ;;
15521 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
15523 echo "Prototype: $try" ;;
15526 *) case "$usethreads" in
15527 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
15534 *) getspnam_r_proto=0
15538 : see if gettimeofday or ftime exists
15539 set gettimeofday d_gettimeod
15541 case "$d_gettimeod" in
15547 val="$undef"; set d_ftime; eval $setvar
15550 case "$d_gettimeod$d_ftime" in
15553 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
15557 : see if gmtime_r exists
15558 set gmtime_r d_gmtime_r
15560 case "$d_gmtime_r" in
15562 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15563 case "$d_gmtime_r_proto:$usethreads" in
15564 ":define") d_gmtime_r_proto=define
15565 set d_gmtime_r_proto gmtime_r $hdrs
15569 case "$d_gmtime_r_proto" in
15571 case "$gmtime_r_proto" in
15572 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
15573 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=S_TS ;;
15575 case "$gmtime_r_proto" in
15576 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
15577 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=I_TS ;;
15579 case "$gmtime_r_proto" in
15580 ''|0) d_gmtime_r=undef
15582 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
15583 * ) case "$gmtime_r_proto" in
15584 REENTRANT_PROTO*) ;;
15585 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
15587 echo "Prototype: $try" ;;
15590 *) case "$usethreads" in
15591 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
15598 *) gmtime_r_proto=0
15602 : see if hasmntopt exists
15603 set hasmntopt d_hasmntopt
15606 : see if this is a netinet/in.h or sys/in.h system
15607 set netinet/in.h i_niin sys/in.h i_sysin
15610 : see if arpa/inet.h has to be included
15611 set arpa/inet.h i_arpainet
15614 : see if htonl --and friends-- exists
15619 : Maybe they are macros.
15622 $cat >htonl.c <<EOM
15624 #include <sys/types.h>
15625 #$i_niin I_NETINET_IN
15627 #$i_arpainet I_ARPA_INET
15628 #ifdef I_NETINET_IN
15629 #include <netinet/in.h>
15632 #include <sys/in.h>
15635 #include <arpa/inet.h>
15638 printf("Defined as a macro.");
15641 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
15642 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
15644 echo "But it seems to be defined as a macro." >&4
15652 : see if hypot exists
15656 : see if ilogb exists
15660 : see if ilogbl exists
15661 set ilogbl d_ilogbl
15664 : check whether inet_aton exists
15665 set inet_aton d_inetaton
15668 : see if inet_ntop exists
15669 set inet_ntop d_inetntop
15672 : see if inet_pton exists
15673 set inet_pton d_inetpton
15678 $cat >isascii.c <<EOCP
15681 #$i_stdlib I_STDLIB
15683 #include <stdlib.h>
15694 if eval $compile; then
15695 echo "isascii() found." >&4
15698 echo "isascii() NOT found." >&4
15707 $cat >isblank.c <<'EOCP'
15718 if $cc $ccflags $ldflags -o isblank isblank.c $libs >/dev/null 2>&1 ; then
15719 echo "isblank() found." >&4
15722 echo "isblank() NOT found." >&4
15729 : check for isfinite
15730 echo "Checking to see if you have isfinite..." >&4
15733 int main() { return isfinite(0.0); }
15736 if eval $compile; then
15738 echo "You have isfinite."
15741 echo "You do not have isfinite."
15747 : see if isfinitel exists
15748 set isfinitel d_isfinitel
15752 echo "Checking to see if you have isinf..." >&4
15755 int main() { return isinf(0.0); }
15758 if eval $compile; then
15760 echo "You have isinf."
15763 echo "You do not have isinf."
15769 : see if isinfl exists
15770 set isinfl d_isinfl
15774 echo "Checking to see if you have isless..." >&4
15777 int main() { return isless(0.0); }
15780 if eval $compile; then
15782 echo "You have isless."
15785 echo "You do not have isless."
15792 echo "Checking to see if you have isnan..." >&4
15795 int main() { return isnan(0.0); }
15798 if eval $compile; then
15800 echo "You have isnan."
15803 echo "You do not have isnan."
15809 : see if isnanl exists
15810 set isnanl d_isnanl
15813 : check for isnormal
15814 echo "Checking to see if you have isnormal..." >&4
15817 int main() { return isnormal(0.0); }
15820 if eval $compile; then
15822 echo "You have isnormal."
15825 echo "You do not have isnormal."
15835 : see if j0l exists
15839 : see if killpg exists
15840 set killpg d_killpg
15843 : see if localeconv exists
15844 set localeconv d_locconv
15847 : see if libc has the POSIX.1-2008 currency locale rules
15848 case "$d_locconv:$d_lc_monetary_2008" in
15851 #include <locale.h>
15853 struct lconv *lc = localeconv();
15854 char int_p_cs_precedes = lc->int_p_cs_precedes;
15859 if eval $compile; then
15860 d_lc_monetary_2008="$define"
15862 d_lc_monetary_2008="$undef"
15868 : see if lchown exists
15870 $cat > try.c <<'EOCP'
15871 /* System header to define __stub macros and hopefully few prototypes,
15872 which can conflict with char lchown(); below. */
15873 #include <assert.h>
15874 /* Override any gcc2 internal prototype to avoid an error. */
15875 /* We use char because int might match the return type of a gcc2
15876 builtin and then its argument prototype would still apply. */
15879 /* The GNU C library defines this for functions which it implements
15880 to always fail with ENOSYS. Some functions are actually named
15881 something starting with __ and the normal name is an alias. */
15882 #if defined (__stub_lchown) || defined (__stub___lchown)
15890 if eval $compile; then
15891 $echo "lchown() found." >&4
15894 $echo "lchown() NOT found." >&4
15900 : See if number of significant digits in a double precision number is known
15902 $cat >ldbl_dig.c <<EOM
15903 #include <limits.h>
15906 printf("Contains LDBL_DIG");
15909 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
15910 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
15911 echo "LDBL_DIG found." >&4
15914 echo "LDBL_DIG NOT found." >&4
15921 : see if lgamma exists
15922 set lgamma d_lgamma
15925 : see if lgamma_r exists
15926 set lgamma_r d_lgamma_r
15929 : check to see if math.h defines _LIB_VERSION
15930 d_libm_lib_version="$undef"
15932 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
15934 #include <unistd.h>
15936 int main (int argc, char *argv[])
15938 printf ("%d\n", _LIB_VERSION);
15943 if eval $compile; then
15945 echo "Yes, it does ($foo)" >&4
15946 d_libm_lib_version="$define"
15948 echo "No, it does not (probably harmless)" >&4
15952 : see if link exists
15956 : see if llrint exists
15957 set llrint d_llrint
15960 : see if llrintl exists
15961 set llrintl d_llrintl
15964 : see if llround exists
15965 set llround d_llround
15968 : see if llroundl exists
15969 set llroundl d_llroundl
15972 : see if localeconv_l exists
15973 set localeconv_l d_localeconv_l
15976 : see if localtime_r exists
15977 set localtime_r d_localtime_r
15979 case "$d_localtime_r" in
15981 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15982 case "$d_localtime_r_proto:$usethreads" in
15983 ":define") d_localtime_r_proto=define
15984 set d_localtime_r_proto localtime_r $hdrs
15988 case "$d_localtime_r_proto" in
15990 case "$localtime_r_proto" in
15991 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
15992 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=S_TS ;;
15994 case "$localtime_r_proto" in
15995 ''|0) try='int localtime_r(const time_t*, struct tm*);'
15996 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=I_TS ;;
15998 case "$localtime_r_proto" in
15999 ''|0) d_localtime_r=undef
16000 localtime_r_proto=0
16001 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
16002 * ) case "$localtime_r_proto" in
16003 REENTRANT_PROTO*) ;;
16004 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
16006 echo "Prototype: $try" ;;
16009 *) case "$usethreads" in
16010 define) echo "localtime_r has no prototype, not using it." >&4 ;;
16012 d_localtime_r=undef
16013 localtime_r_proto=0
16017 *) localtime_r_proto=0
16021 : see if localtime_r calls tzset
16022 case "$localtime_r_proto" in
16025 /* Does our libc's localtime_r call tzset ?
16026 * return 0 if so, 1 otherwise.
16028 #$i_systypes I_SYS_TYPES
16029 #$i_unistd I_UNISTD
16031 #$i_stdlib I_STDLIB
16032 #$i_malloc I_MALLOC
16034 # include <sys/types.h>
16037 # include <unistd.h>
16043 #include <stdlib.h>
16045 #include <string.h>
16047 # include <malloc.h>
16051 time_t t = time(0L);
16052 char w_tz[]="TZ" "=GMT+5",
16053 e_tz[]="TZ" "=GMT-5",
16054 *tz_e = (char*)malloc(16),
16055 *tz_w = (char*)malloc(16);
16056 struct tm tm_e, tm_w;
16057 memset(&tm_e,'\0',sizeof(struct tm));
16058 memset(&tm_w,'\0',sizeof(struct tm));
16063 localtime_r(&t, &tm_e);
16066 localtime_r(&t, &tm_w);
16068 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
16074 if eval $compile; then
16075 if $run ./try; then
16076 d_localtime_r_needs_tzset=undef;
16078 d_localtime_r_needs_tzset=define;
16081 d_localtime_r_needs_tzset=undef;
16085 d_localtime_r_needs_tzset=undef;
16090 : see if lockf exists
16094 : see if log1p exists
16098 : see if log2 exists
16102 : see if logb exists
16106 : see if lrint exists
16110 : see if lrintl exists
16111 set lrintl d_lrintl
16114 : see if lround exists
16115 set lround d_lround
16118 : see if lroundl exists
16119 set lroundl d_lroundl
16122 : see if prototype for lseek is available
16124 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
16127 : see if lstat exists
16131 : see if madvise exists
16132 set madvise d_madvise
16135 : see if malloc_size exists
16136 set malloc_size d_malloc_size
16139 : see if malloc_size_good exists
16140 set malloc_good_size d_malloc_good_size
16143 : see if mblen exists
16147 : see if mbrlen exists
16148 set mbrlen d_mbrlen
16151 : see if mbrtowc exists
16152 set mbrtowc d_mbrtowc
16155 : see if mbstowcs exists
16156 set mbstowcs d_mbstowcs
16159 : see if mbtowc exists
16160 set mbtowc d_mbtowc
16163 : see if memmem exists
16164 : We need both a prototype in string.h and the symbol in libc.
16167 xx1="#$d_gnulibc HAS_GNULIBC"
16168 xx2='#if defined(HAS_GNULIBC) && !defined(_GNU_SOURCE)'
16169 xx3='# define _GNU_SOURCE'
16171 set d_memmem_proto memmem literal "$xx1" literal "$xx2" literal "$xx3" literal "$xx4" define string.h
16173 case "$d_memmem_proto" in
16174 define) # see if memmem exists
16175 set memmem d_memmem
16184 : see if memrchr exists
16185 : We need both a prototype in string.h and the symbol in libc.
16188 xx1="#$d_gnulibc HAS_GNULIBC"
16189 xx2='#if defined(HAS_GNULIBC) && !defined(_GNU_SOURCE)'
16190 xx3='# define _GNU_SOURCE'
16192 set d_memrchr_proto memrchr literal "$xx1" literal "$xx2" literal "$xx3" literal "$xx4" define string.h
16194 case "$d_memrchr_proto" in
16195 define) # see if memrchr exists
16196 set memrchr d_memrchr
16205 : see if mkdir exists
16209 : see if mkdtemp exists
16210 set mkdtemp d_mkdtemp
16213 : see if mkfifo exists
16214 set mkfifo d_mkfifo
16217 : see if mkostemp exists
16218 set mkostemp d_mkostemp
16221 : see if mkstemp exists
16222 set mkstemp d_mkstemp
16225 : see if mkstemps exists
16226 set mkstemps d_mkstemps
16229 : see if mktime exists
16230 set mktime d_mktime
16233 : see if sys/mman.h has to be included
16234 set sys/mman.h i_sysmman
16237 : see if mmap exists
16240 : see what shmat returns
16241 : default to something harmless
16243 case "$i_sysmman$d_mmap" in
16245 $cat >mmap.c <<'END'
16246 #include <sys/mman.h>
16249 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
16254 echo "and it returns ($mmaptype)." >&4
16258 : see if sqrtl exists
16262 : see if scalbnl exists
16263 set scalbnl d_scalbnl
16266 : see if truncl exists
16267 set truncl d_truncl
16270 : see if modfl exists
16274 : see if prototype for modfl is available
16276 set d_modflproto modfl define math.h
16279 if $test "$uselongdouble" = "$define"; then
16281 if $test "$d_sqrtl" != "$define"; then
16282 message="$message sqrtl"
16284 if $test "$d_modfl" != "$define"; then
16285 if $test "$d_truncl:$d_copysignl" = "$define:$define"; then
16286 echo "You have both truncl and copysignl, so I can emulate modfl."
16288 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
16289 echo "You have both aintl and copysignl, so I can emulate modfl."
16291 message="$message modfl"
16295 if $test "$d_frexpl" != "$define"; then
16296 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
16297 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
16299 message="$message frexpl"
16302 if $test "$d_ldexpl" != "$define"; then
16303 message="$message ldexpl"
16306 if $test "$message" != ""; then
16309 *** You requested the use of long doubles but you do not seem to have
16310 *** the following mathematical functions needed for long double support:
16312 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
16313 *** Cannot continue, aborting.
16321 : see if mprotect exists
16322 set mprotect d_mprotect
16325 : see if msgctl exists
16326 set msgctl d_msgctl
16329 : see if msgget exists
16330 set msgget d_msgget
16333 : see if msgsnd exists
16334 set msgsnd d_msgsnd
16337 : see if msgrcv exists
16338 set msgrcv d_msgrcv
16341 : see how much of the 'msg*(2)' library is present.
16344 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
16345 *"$undef"*) h_msg=false;;
16349 case "`ipcs 2>&1`" in
16350 "SVID messages"*"not configured"*)
16351 echo "Your $osname does not have the msg*(2) configured." >&4
16354 set msgctl d_msgctl
16356 set msgget d_msgget
16358 set msgsnd d_msgsnd
16360 set msgrcv d_msgrcv
16366 : we could also check for sys/ipc.h ...
16367 if $h_msg && $test `./findhdr sys/msg.h`; then
16368 echo "You have the full msg*(2) library." >&4
16371 echo "You don't have the full msg*(2) library." >&4
16377 : Check for msghdr_s
16379 echo "Checking to see if your system supports struct msghdr..." >&4
16380 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
16382 case "$d_msghdr_s" in
16383 "$define") echo "Yes, it does." ;;
16384 *) echo "No, it doesn't." ;;
16387 : see if msync exists
16391 : see if munmap exists
16392 set munmap d_munmap
16395 : see if nan exists
16399 : see if nanosleep exists
16400 set nanosleep d_nanosleep
16403 : see if nearbyint exists
16404 set nearbyint d_nearbyint
16407 : see if nextafter exists
16408 set nextafter d_nextafter
16411 : see if nexttoward exists
16412 set nexttoward d_nexttoward
16415 : see if nice exists
16419 : see if this is a langinfo.h system
16420 set langinfo.h i_langinfo
16423 : see if nl_langinfo exists
16424 set nl_langinfo d_nl_langinfo
16427 : see if this is a quadmath.h system
16428 set quadmath.h i_quadmath
16431 : Check basic sizes
16433 $echo "Choosing the C types to be used for Perl's internal types..." >&4
16435 case "$use64bitint:$d_quad:$quadtype" in
16438 uvtype="$uquadtype"
16443 uvtype="unsigned long"
16449 case "$uselongdouble:$d_longdbl" in
16451 nvtype="long double"
16452 nvsize=$longdblsize
16459 case "$usequadmath:$i_quadmath" in
16461 nvtype="__float128"
16467 *** You requested the use of the quadmath library, but you
16468 *** do not seem to have the quadmath library installed.
16469 *** Cannot continue, aborting.
16475 define:*) $cat <<EOM >&4
16477 *** You requested the use of the quadmath library, but you
16478 *** do not seem to have the required header, <quadmath.h>.
16480 case "$gccversion" in
16483 *** Your gcc looks a bit old:
16489 *** You are not running a gcc.
16494 *** For the quadmath library you need at least gcc 4.6.
16495 *** Cannot continue, aborting.
16501 $echo "(IV will be "$ivtype", $ivsize bytes)"
16502 $echo "(UV will be "$uvtype", $uvsize bytes)"
16503 $echo "(NV will be "$nvtype", $nvsize bytes)"
16506 #$i_inttypes I_INTTYPES
16508 #include <inttypes.h>
16513 int8_t i = INT8_MAX;
16514 uint8_t u = UINT8_MAX;
16515 printf("int8_t\n");
16518 int16_t i = INT16_MAX;
16519 uint16_t u = UINT16_MAX;
16520 printf("int16_t\n");
16523 int32_t i = INT32_MAX;
16524 uint32_t u = UINT32_MAX;
16525 printf("int32_t\n");
16530 i8type="signed char"
16531 u8type="unsigned char"
16536 '') case "$shortsize" in
16538 u16type="unsigned short"
16546 '') set try -DINT16
16547 if eval $compile; then
16548 case "`$run ./try`" in
16560 '') if $test $shortsize -ge 2; then
16562 u16type="unsigned short"
16570 '') case "$longsize" in
16572 u32type="unsigned long"
16576 *) case "$intsize" in
16578 u32type="unsigned int"
16588 '') set try -DINT32
16589 if eval $compile; then
16590 case "`$run ./try`" in
16602 '') if $test $intsize -ge 4; then
16604 u32type="unsigned int"
16612 '') case "$d_quad:$quadtype" in
16614 i64type="$quadtype"
16615 u64type="$uquadtype"
16623 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
16626 #$i_stdlib I_STDLIB
16628 #include <stdlib.h>
16630 #include <sys/types.h>
16631 #include <signal.h>
16633 /* volatile so that the compiler has to store it out to memory */
16634 volatile int bletched = 0;
16635 $signal_t blech(int s) { bletched = 1; }
16640 int n = 8 * $uvsize;
16643 signal(SIGFPE, blech);
16646 for (i = 0; i < n; i++) {
16647 u = u << 1 | ($uvtype)1;
16649 if (($uvtype)d != u)
16653 d = ($nvtype)(u - 1);
16654 if (($uvtype)d != (u - 1))
16661 printf("%d\n", ((i == n) ? -n : i));
16667 d_nv_preserves_uv="$undef"
16668 if eval $compile; then
16669 nv_preserves_uv_bits="`$run ./try`"
16671 case "$nv_preserves_uv_bits" in
16673 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
16674 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
16675 d_nv_preserves_uv="$define"
16677 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
16678 d_nv_preserves_uv="$undef" ;;
16679 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
16680 nv_preserves_uv_bits="0" ;;
16684 $echo "Checking to find the largest integer value your NVs can hold..." >&4
16688 typedef $nvtype NV;
16695 while(count < 256) {
16696 /* volatile so that the compiler has to store it out to memory */
16697 volatile NV up = value + 1.0;
16698 volatile NV negated = -value;
16699 volatile NV down = negated - 1.0;
16700 volatile NV got_up = up - value;
16701 int up_good = got_up == 1.0;
16702 int got_down = down - negated;
16703 int down_good = got_down == -1.0;
16705 if (down_good != up_good) {
16707 "Inconsistency - up %d %f; down %d %f; for 2**%d (%.20f)\n",
16708 up_good, (double) got_up, down_good, (double) got_down,
16709 count, (double) value);
16716 fputs("256.0", stdout);
16719 fputs("2.0", stdout);
16725 fputs("*", stdout);
16731 fprintf(stderr, "Cannot overflow integer range, even at 2**%d (%.20f)\n",
16732 count, (double) value);
16738 nv_overflows_integers_at='0'
16739 if eval $compile; then
16745 The largest integer your NVs can preserve is equal to $xxx
16747 nv_overflows_integers_at="$xxx"
16750 Cannot determine the largest integer value your NVs can hold, unexpected output
16757 Cannot determine the largest integer value your NVs can hold
16764 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
16767 #$i_stdlib I_STDLIB
16769 #include <stdlib.h>
16771 #include <string.h>
16772 #include <sys/types.h>
16773 #include <signal.h>
16775 /* volatile so that the compiler has to store it out to memory */
16776 volatile int bletched = 0;
16777 $signal_t blech(int s) { bletched = 1; }
16780 int checkit($nvtype d, const char *where) {
16782 unsigned char *p = (unsigned char *)v;
16783 unsigned char *end = p + sizeof(d);
16792 p = (unsigned char *)v;
16793 printf("No - %s: 0x", where);
16795 printf ("%02X", *p++);
16800 int main(int argc, char **argv) {
16803 fail += checkit(d, "0.0");
16805 /* The compiler shouldn't be assuming that bletched is 0 */
16808 fail += checkit(d, "bleched");
16811 signal(SIGFPE, blech);
16814 /* Paranoia - the compiler should have no way of knowing that ANSI says
16815 that argv[argc] will always be NULL. Actually, if it did assume this it
16816 would be buggy, as this is C and main() can be called from elsewhere in
16818 d = argv[argc] ? 1 : 0;
16821 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
16824 fail += checkit(d, "ternary");
16826 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
16829 printf("No - memset doesn't give 0.0\n");
16830 /* This might just blow up: */
16831 printf("(gives %g)\n", d);
16837 printf("No - something bleched\n");
16842 printf("No - %d fail(s)\n", fail);
16851 d_nv_zero_is_allbits_zero="$undef"
16852 if eval $compile; then
16858 0.0 is represented as all bits zero in memory
16860 d_nv_zero_is_allbits_zero="$define"
16863 0.0 is not represented as all bits zero in memory
16865 d_nv_zero_is_allbits_zero="$undef"
16870 0.0 is not represented as all bits zero in memory
16872 d_nv_zero_is_allbits_zero="$undef"
16878 : check for off64_t
16880 echo "Checking to see if you have off64_t..." >&4
16882 #include <sys/types.h>
16883 #include <unistd.h>
16884 int main() { off64_t x = 7; }
16887 if eval $compile; then
16889 echo "You have off64_t."
16892 echo "You do not have off64_t."
16893 case "$lseeksize" in
16894 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
16901 : how to create joinable pthreads
16902 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
16904 echo "Checking what constant to use for creating joinable pthreads..." >&4
16905 $cat >try.c <<'EOCP'
16906 #include <pthread.h>
16908 int detachstate = JOINABLE;
16911 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
16912 if eval $compile; then
16913 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
16914 val="$undef" # Yes, undef.
16915 set d_old_pthread_create_joinable
16918 set old_pthread_create_joinable
16921 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
16922 if eval $compile; then
16923 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
16925 set d_old_pthread_create_joinable
16927 val=PTHREAD_CREATE_UNDETACHED
16928 set old_pthread_create_joinable
16931 set try -DJOINABLE=__UNDETACHED
16932 if eval $compile; then
16933 echo "You seem to use __UNDETACHED." >&4
16935 set d_old_pthread_create_joinable
16938 set old_pthread_create_joinable
16941 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
16943 set d_old_pthread_create_joinable
16946 set old_pthread_create_joinable
16953 d_old_pthread_create_joinable="$undef"
16954 old_pthread_create_joinable=""
16957 : see if pause exists
16961 : see if pipe2 exists
16965 : see if poll exists
16969 : see if prctl exists
16973 : see if prctl supports PR_SET_NAME
16974 d_prctl_set_name=$undef
16979 #include <unistd.h>
16981 #include <sys/prctl.h>
16983 int main (int argc, char *argv[])
16985 return (prctl (PR_SET_NAME, "Test"));
16989 if eval $compile_ok && $run ./try; then
16990 echo "Your prctl (PR_SET_NAME, ...) works"
16991 d_prctl_set_name=$define
16997 : see if readlink exists
16998 set readlink d_readlink
17001 : Check if there is a /proc symlink to the abs path of
17002 : the executing program. We will honor hints of d_procselfexe=$undef
17003 : or procselfexe being non-empty, otherwise will try to determine both
17004 : if we have readlink.
17005 : AmigaOS will attempt to mount proc: aka /proc, if /proc/... is
17006 : referenced, and AmigaOS does not have a proc filesystem anyway.
17009 if $test "X$d_procselfexe" = Xundef; then
17011 elif $test "X$procselfexe" != X -a "X$procselfexe" != 'X '; then
17013 elif $test "X$d_readlink" = Xdefine; then
17014 : NetBSD first as /proc/self is a symlink to /proc/curproc,
17015 : and it feels more tidy to avoid an extra level of symlink
17016 set NetBSD /proc/curproc/exe Linux /proc/self/exe FreeBSD /proc/curproc/file Solaris /proc/self/path/a.out
17017 while test $# -gt 0; do
17020 if $issymlink $try; then
17021 $ls -l $try > reflect
17022 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
17023 echo "You have $type-like $try."
17024 procselfexe='"'$try'"'
17026 : This will break out of the loop
17036 : backward compatibility for d_hvfork
17037 if test X$d_hvfork != X; then
17038 d_vfork="$d_hvfork"
17041 : see if there is a vfork
17046 d_pseudofork=$undef
17048 : Ok, but do we want to use it. vfork is reportedly unreliable in
17049 : perl on Solaris 2.x, and probably elsewhere.
17053 case "$usevfork" in
17059 Perl can only use a vfork() that doesn't suffer from strict
17060 restrictions on calling functions or modifying global data in
17061 the child. For example, glibc-2.1 contains such a vfork()
17062 that is unsuitable. If your system provides a proper fork()
17063 call, chances are that you do NOT want perl to use vfork().
17066 rp="Do you still want to use vfork()?"
17071 echo "Ok, we won't use vfork()."
17080 $define) usevfork='true';;
17081 *) usevfork='false';;
17084 : see whether the pthread_atfork exists
17086 #include <pthread.h>
17089 #ifdef PTHREAD_ATFORK
17090 pthread_atfork(NULL,NULL,NULL);
17095 : see if pthread_atfork exists
17096 set try -DPTHREAD_ATFORK
17097 if eval $compile; then
17102 case "$usethreads" in
17105 $define) echo 'pthread_atfork found.' >&4 ;;
17106 *) echo 'pthread_atfork NOT found.' >&4 ;;
17109 set d_pthread_atfork
17112 : see if pthread_attr_setscope exists
17113 set pthread_attr_setscope d_pthread_attr_setscope
17116 : see whether the various POSIXish _yields exist
17118 #include <pthread.h>
17124 #ifdef PTHREAD_YIELD
17127 #ifdef PTHREAD_YIELD_NULL
17128 pthread_yield(NULL);
17134 : see if sched_yield exists
17135 set try -DSCHED_YIELD
17136 if eval $compile; then
17138 sched_yield='sched_yield()'
17142 case "$usethreads" in
17145 $define) echo 'sched_yield() found.' >&4 ;;
17146 *) echo 'sched_yield() NOT found.' >&4 ;;
17152 : see if pthread_yield exists
17153 set try -DPTHREAD_YIELD
17154 if eval $compile; then
17156 case "$sched_yield" in
17157 '') sched_yield='pthread_yield()' ;;
17160 set try -DPTHREAD_YIELD_NULL
17161 if eval $compile; then
17163 case "$sched_yield" in
17164 '') sched_yield='pthread_yield(NULL)' ;;
17170 case "$usethreads" in
17173 $define) echo 'pthread_yield() found.' >&4 ;;
17174 *) echo 'pthread_yield() NOT found.' >&4 ;;
17178 set d_pthread_yield
17180 case "$sched_yield" in
17181 '') sched_yield=undef ;;
17185 : check for ptrdiff_t
17187 echo "Checking to see if you have ptrdiff_t..." >&4
17189 #include <stddef.h>
17190 int main() { ptrdiff_t x = 7; }
17193 if eval $compile; then
17195 echo "You have ptrdiff_t."
17198 echo "You do not have ptrdiff_t."
17204 : see if random_r exists
17205 set random_r d_random_r
17207 case "$d_random_r" in
17209 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17210 case "$d_random_r_proto:$usethreads" in
17211 ":define") d_random_r_proto=define
17212 set d_random_r_proto random_r $hdrs
17216 case "$d_random_r_proto" in
17218 case "$random_r_proto" in
17219 ''|0) try='int random_r(int*, struct random_data*);'
17220 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_iS ;;
17222 case "$random_r_proto" in
17223 ''|0) try='int random_r(long*, struct random_data*);'
17224 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_lS ;;
17226 case "$random_r_proto" in
17227 ''|0) try='int random_r(struct random_data*, int32_t*);'
17228 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_St ;;
17230 case "$random_r_proto" in
17231 ''|0) d_random_r=undef
17233 echo "Disabling random_r, cannot determine prototype." >&4 ;;
17234 * ) case "$random_r_proto" in
17235 REENTRANT_PROTO*) ;;
17236 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
17238 echo "Prototype: $try" ;;
17241 *) case "$usethreads" in
17242 define) echo "random_r has no prototype, not using it." >&4 ;;
17249 *) random_r_proto=0
17253 : see if readdir and friends exist
17254 set readdir d_readdir
17256 set seekdir d_seekdir
17258 set telldir d_telldir
17260 set rewinddir d_rewinddir
17263 : see if readdir64_r exists
17264 set readdir64_r d_readdir64_r
17266 case "$d_readdir64_r" in
17268 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
17269 case "$d_readdir64_r_proto:$usethreads" in
17270 ":define") d_readdir64_r_proto=define
17271 set d_readdir64_r_proto readdir64_r $hdrs
17275 case "$d_readdir64_r_proto" in
17277 case "$readdir64_r_proto" in
17278 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
17279 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TSR ;;
17281 case "$readdir64_r_proto" in
17282 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
17283 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TS ;;
17285 case "$readdir64_r_proto" in
17286 ''|0) d_readdir64_r=undef
17287 readdir64_r_proto=0
17288 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
17289 * ) case "$readdir64_r_proto" in
17290 REENTRANT_PROTO*) ;;
17291 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
17293 echo "Prototype: $try" ;;
17296 *) case "$usethreads" in
17297 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
17299 d_readdir64_r=undef
17300 readdir64_r_proto=0
17304 *) readdir64_r_proto=0
17308 : see if readdir_r exists
17309 set readdir_r d_readdir_r
17311 case "$d_readdir_r" in
17313 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
17314 case "$d_readdir_r_proto:$usethreads" in
17315 ":define") d_readdir_r_proto=define
17316 set d_readdir_r_proto readdir_r $hdrs
17320 case "$d_readdir_r_proto" in
17322 case "$readdir_r_proto" in
17323 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
17324 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TSR ;;
17326 case "$readdir_r_proto" in
17327 ''|0) try='int readdir_r(DIR*, struct dirent*);'
17328 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TS ;;
17330 case "$readdir_r_proto" in
17331 ''|0) d_readdir_r=undef
17333 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
17334 * ) case "$readdir_r_proto" in
17335 REENTRANT_PROTO*) ;;
17336 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
17338 echo "Prototype: $try" ;;
17341 *) case "$usethreads" in
17342 define) echo "readdir_r has no prototype, not using it." >&4 ;;
17349 *) readdir_r_proto=0
17353 : see if readv exists
17357 : see if recvmsg exists
17358 set recvmsg d_recvmsg
17361 : see if regcomp, regcmp, or re_comp exist, for regular pattern matching
17363 if set regcomp val -f d_regcomp; eval $csym; $val; then
17364 echo 'regcomp() found.' >&4
17365 d_regcomp="$define"
17368 elif set regcmp val -f d_regcmp; eval $csym; $val; then
17369 echo 'regcmp() found.' >&4
17373 elif set re_comp val -f d_re_comp; eval $csym; $val; then
17374 echo 're_comp() found, assuming re_exec() also exists.' >&4
17375 d_re_comp="$define"
17380 No regcomp(), regcmp() nor re_comp() found !! No regular pattern matching.
17387 : see if remainder exists
17388 set remainder d_remainder
17391 : see if remquo exists
17392 set remquo d_remquo
17395 : see if rename exists
17396 set rename d_rename
17399 : see if rint exists
17403 : see if rmdir exists
17407 : see if round exists
17411 : see if prototype for sbrk is available
17413 set d_sbrkproto sbrk $i_unistd unistd.h
17416 : see if scalbn exists
17417 set scalbn d_scalbn
17420 : see if select exists
17421 set select d_select
17424 : see if semctl exists
17425 set semctl d_semctl
17428 : see if semget exists
17429 set semget d_semget
17432 : see if semop exists
17436 : see how much of the 'sem*(2)' library is present.
17439 case "$d_semctl$d_semget$d_semop" in
17440 *"$undef"*) h_sem=false;;
17444 case "`ipcs 2>&1`" in
17445 "SVID messages"*"not configured"*)
17446 echo "Your $osname does not have the sem*(2) configured." >&4
17449 set semctl d_semctl
17451 set semget d_semget
17459 : we could also check for sys/ipc.h ...
17460 if $h_sem && $test `./findhdr sys/sem.h`; then
17461 echo "You have the full sem*(2) library." >&4
17464 echo "You don't have the full sem*(2) library." >&4
17470 : see whether sys/sem.h defines union semun
17472 $cat > try.c <<'END'
17473 #include <sys/types.h>
17474 #include <sys/ipc.h>
17475 #include <sys/sem.h>
17476 int main () { union semun semun; semun.buf = 0; }
17479 if eval $compile; then
17480 echo "You have union semun in <sys/sem.h>." >&4
17483 echo "You do not have union semun in <sys/sem.h>." >&4
17490 : see how to do semctl IPC_STAT
17494 $cat > tryh.h <<END
17497 # define S_IRUSR S_IREAD
17498 # define S_IWUSR S_IWRITE
17499 # define S_IXUSR S_IEXEC
17501 # define S_IRUSR 0400
17502 # define S_IWUSR 0200
17503 # define S_IXUSR 0100
17505 # define S_IRGRP (S_IRUSR>>3)
17506 # define S_IWGRP (S_IWUSR>>3)
17507 # define S_IXGRP (S_IXUSR>>3)
17508 # define S_IROTH (S_IRUSR>>6)
17509 # define S_IWOTH (S_IWUSR>>6)
17510 # define S_IXOTH (S_IXUSR>>6)
17513 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
17514 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
17515 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
17518 : see whether semctl IPC_STAT can use union semun
17519 case "$d_semctl_semun" in
17523 #include <sys/types.h>
17524 #include <sys/ipc.h>
17525 #include <sys/sem.h>
17526 #include <sys/stat.h>
17533 #$d_union_semun HAS_UNION_SEMUN
17536 #ifndef HAS_UNION_SEMUN
17539 struct semid_ds *buf;
17540 unsigned short *array;
17546 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
17547 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
17549 struct semid_ds argbuf;
17552 st = semctl(sem, 0, IPC_STAT, arg);
17556 # endif /* IPC_STAT */
17557 printf("semctl IPC_STAT failed: errno = %d\n", errno);
17559 if (semctl(sem, 0, IPC_RMID, arg) != 0)
17560 # endif /* IPC_RMID */
17561 printf("semctl IPC_RMID failed: errno = %d\n", errno);
17563 #endif /* IPC_PRIVATE && ... */
17564 printf("semget failed: errno = %d\n", errno);
17569 if eval $compile; then
17572 semun) val="$define" ;;
17580 case "$d_semctl_semun" in
17582 echo "You can use union semun for semctl IPC_STAT." >&4
17585 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
17590 : see whether semctl IPC_STAT can use struct semid_ds pointer
17591 case "$d_semctl_semid_ds" in
17594 $cat > try.c <<'END'
17595 #include <sys/types.h>
17596 #include <sys/ipc.h>
17597 #include <sys/sem.h>
17598 #include <sys/stat.h>
17607 #ifndef HAS_UNION_SEMUN
17610 struct semid_ds *buf;
17611 unsigned short *array;
17615 struct semid_ds argbuf;
17618 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
17619 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
17623 st = semctl(sem, 0, IPC_STAT, arg);
17625 printf("semid_ds\n");
17627 # endif /* IPC_STAT */
17628 printf("semctl IPC_STAT failed: errno = %d\n", errno);
17630 if (semctl(sem, 0, IPC_RMID, arg) != 0)
17631 # endif /* IPC_RMID */
17632 printf("semctl IPC_RMID failed: errno = %d\n", errno);
17634 #endif /* IPC_PRIVATE && ... */
17635 printf("semget failed: errno = %d\n", errno);
17641 if eval $compile; then
17644 semid_ds) val="$define" ;;
17648 set d_semctl_semid_ds
17652 case "$d_semctl_semid_ds" in
17654 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
17656 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
17662 # We do not have the full sem*(2) library, so assume we can not
17668 set d_semctl_semid_ds
17674 : see if sendmsg exists
17675 set sendmsg d_sendmsg
17678 : see if setegid exists
17679 set setegid d_setegid
17682 : see if seteuid exists
17683 set seteuid d_seteuid
17686 : see if setgrent exists
17687 set setgrent d_setgrent
17690 : see if setgrent_r exists
17691 set setgrent_r d_setgrent_r
17693 case "$d_setgrent_r" in
17695 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
17696 case "$d_setgrent_r_proto:$usethreads" in
17697 ":define") d_setgrent_r_proto=define
17698 set d_setgrent_r_proto setgrent_r $hdrs
17702 case "$d_setgrent_r_proto" in
17704 case "$setgrent_r_proto" in
17705 ''|0) try='int setgrent_r(FILE**);'
17706 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=I_H ;;
17708 case "$setgrent_r_proto" in
17709 ''|0) try='void setgrent_r(FILE**);'
17710 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=V_H ;;
17712 case "$setgrent_r_proto" in
17713 ''|0) d_setgrent_r=undef
17715 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
17716 * ) case "$setgrent_r_proto" in
17717 REENTRANT_PROTO*) ;;
17718 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
17720 echo "Prototype: $try" ;;
17723 *) case "$usethreads" in
17724 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
17731 *) setgrent_r_proto=0
17735 : see if sethostent exists
17736 set sethostent d_sethent
17739 : see if sethostent_r exists
17740 set sethostent_r d_sethostent_r
17742 case "$d_sethostent_r" in
17744 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17745 case "$d_sethostent_r_proto:$usethreads" in
17746 ":define") d_sethostent_r_proto=define
17747 set d_sethostent_r_proto sethostent_r $hdrs
17751 case "$d_sethostent_r_proto" in
17753 case "$sethostent_r_proto" in
17754 ''|0) try='int sethostent_r(int, struct hostent_data*);'
17755 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=I_ID ;;
17757 case "$sethostent_r_proto" in
17758 ''|0) try='void sethostent_r(int, struct hostent_data*);'
17759 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=V_ID ;;
17761 case "$sethostent_r_proto" in
17762 ''|0) d_sethostent_r=undef
17763 sethostent_r_proto=0
17764 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
17765 * ) case "$sethostent_r_proto" in
17766 REENTRANT_PROTO*) ;;
17767 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
17769 echo "Prototype: $try" ;;
17772 *) case "$usethreads" in
17773 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
17775 d_sethostent_r=undef
17776 sethostent_r_proto=0
17780 *) sethostent_r_proto=0
17784 : see if setitimer exists
17785 set setitimer d_setitimer
17788 : see if setlinebuf exists
17789 set setlinebuf d_setlinebuf
17792 : see if locale.h is available
17793 set locale.h i_locale
17796 : see if this system has wctype.h
17797 set wctype.h i_wctype
17800 : see if towupper exists
17801 set towupper d_towupper
17804 : check for setlocale function and behavior
17807 Checking to see if you have setlocale() and its behavior
17810 #include <stdlib.h>
17811 #include <string.h>
17812 #$i_locale I_LOCALE
17814 # include <locale.h>
17816 #$i_wctype I_WCTYPE
17818 # include <wctype.h>
17822 const char * invalid_name = "\a"; /* This is really invalid! */
17823 int accepts_any_locale_name = 0;
17824 int has_C_UTF8 = 0;
17825 unsigned char bad_setlocale = 255;
17827 /* If LC_CTYPE isn't defined the compilation will fail, and locales will be
17828 * disabled. It's hard to imagine an instance where meaningful locale
17829 * handling could be done without LC_CTYPE */
17830 const char * name = setlocale(LC_CTYPE, "C");
17832 if (name == NULL || strcmp(name, "C") != 0) {
17833 exit(bad_setlocale);
17836 name = setlocale(LC_CTYPE, invalid_name);
17837 if (name != NULL) {
17839 /* Let it pass if it accepts the name but gives back one of the C
17841 if (strcmp(name, "C") != 0 && strcmp(name, "C.UTF-8") != 0) {
17842 accepts_any_locale_name = 1;
17846 name = setlocale(LC_CTYPE, "C.UTF-8");
17847 if (name != NULL) {
17848 unsigned char y_with_diaeresis = ('A' == 193) ? 0xDF : 0xFF;
17850 #$d_towupper HAS_TOWUPPER
17851 #ifdef HAS_TOWUPPER
17853 /* We assume that if the machine doesn't have the C99 towupper, it
17854 * doesn't have C.UTF-8, even if we successfully changed locales to
17855 * include it. This seems safer even on platforms that didn't accept
17856 * the really invalid name */
17858 if (towupper(y_with_diaeresis) == 0x178) {
17868 /* Currently unused code to determine if LC_ALL with disparate values uses
17869 * category = value pairs or positional, and to determine the separator
17870 * between the categories. We could add code so that if the separator were
17871 * > '9', we subtract 10; similarly for 'Z' and 'z', and then just about
17872 * every possible ASCII separator would fit in the 5 bits available in the
17873 * exit code. This would not be true in EBCDIC. And then if LC_ALL is
17874 * positional, we probably would want to know the order of the categories.
17875 * Using a file between the C program and the shell script would really be
17876 * require to do that */
17879 unsigned char min_separator = ' ' - 1;
17880 unsigned char separator = min_separator;
17881 int uses_name_value_pair_names = 0;
17883 name = setlocale(LC_ALL, "C");
17884 if (name == NULL || strcmp(name, "C") != 0) {
17885 exit(bad_setlocale);
17891 name = setlocale(LC_CTYPE, "C.UTF-8");
17892 if (name == NULL) {
17893 exit(bad_setlocale);
17895 name = setlocale(LC_ALL, NULL);
17896 if (name == NULL) {
17897 exit(bad_setlocale);
17900 pos = strstr(name, "LC_CTYPE" "=C.UTF-8");
17902 uses_name_value_pair_names = 1;
17904 separator = name[sizeof("LC_CTYPE=C.UTF-8") - 1];
17907 separator = *(pos - 1);
17911 pos = strstr(name, "C.UTF-8");
17915 else if (pos == name) {
17916 separator = name[sizeof("C.UTF-8") - 1];
17919 separator = *(pos - 1);
17927 exit( 0 /* (separator - min_separator) << 3
17928 | uses_name_value_pair_names << 2
17931 | accepts_any_locale_name);
17936 if eval $compile; then
17937 echo "Your system has setlocale()..." >&4
17940 0) echo "and it seems sane" >&4
17941 d_setlocale="$define"
17942 d_setlocale_accepts_any_locale_name="$undef"
17943 d_has_C_UTF8="false"
17945 1) echo "and it seems sane, but accepts any locale name as valid" >&4
17946 d_setlocale="$define"
17947 d_setlocale_accepts_any_locale_name="$define"
17948 d_has_C_UTF8="false"
17950 2) echo "and it seems sane" >&4
17951 d_setlocale="$define"
17952 d_setlocale_accepts_any_locale_name="$undef"
17953 d_has_C_UTF8="true"
17955 3) echo "and it seems sane, but accepts any locale name as valid" >&4
17956 d_setlocale="$define"
17957 d_setlocale_accepts_any_locale_name="$define"
17958 d_has_C_UTF8="true"
17960 *) echo "but it doesn't seem to work, so we won't use it." >&4
17961 d_setlocale="$undef"
17962 d_setlocale_accepts_any_locale_name="$undef"
17963 d_has_C_UTF8="false"
17967 echo "your system does not have setlocale()" >&4
17968 d_setlocale="$undef"
17969 d_setlocale_accepts_any_locale_name="$undef"
17970 d_has_C_UTF8="false"
17974 : see if setlocale_r exists
17975 set setlocale_r d_setlocale_r
17977 case "$d_setlocale_r" in
17979 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
17980 case "$d_setlocale_r_proto:$usethreads" in
17981 ":define") d_setlocale_r_proto=define
17982 set d_setlocale_r_proto setlocale_r $hdrs
17986 case "$d_setlocale_r_proto" in
17988 case "$setlocale_r_proto" in
17989 ''|0) try='int setlocale_r(int, const char*, char*, int);'
17990 ./protochk "$extern_C $try" $hdrs && setlocale_r_proto=I_ICBI ;;
17992 case "$setlocale_r_proto" in
17993 ''|0) d_setlocale_r=undef
17994 setlocale_r_proto=0
17995 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
17996 * ) case "$setlocale_r_proto" in
17997 REENTRANT_PROTO*) ;;
17998 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
18000 echo "Prototype: $try" ;;
18003 *) case "$usethreads" in
18004 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
18006 d_setlocale_r=undef
18007 setlocale_r_proto=0
18011 *) setlocale_r_proto=0
18015 : see if setnetent exists
18016 set setnetent d_setnent
18019 : see if setnetent_r exists
18020 set setnetent_r d_setnetent_r
18022 case "$d_setnetent_r" in
18024 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18025 case "$d_setnetent_r_proto:$usethreads" in
18026 ":define") d_setnetent_r_proto=define
18027 set d_setnetent_r_proto setnetent_r $hdrs
18031 case "$d_setnetent_r_proto" in
18033 case "$setnetent_r_proto" in
18034 ''|0) try='int setnetent_r(int, struct netent_data*);'
18035 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=I_ID ;;
18037 case "$setnetent_r_proto" in
18038 ''|0) try='void setnetent_r(int, struct netent_data*);'
18039 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=V_ID ;;
18041 case "$setnetent_r_proto" in
18042 ''|0) d_setnetent_r=undef
18043 setnetent_r_proto=0
18044 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
18045 * ) case "$setnetent_r_proto" in
18046 REENTRANT_PROTO*) ;;
18047 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
18049 echo "Prototype: $try" ;;
18052 *) case "$usethreads" in
18053 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
18055 d_setnetent_r=undef
18056 setnetent_r_proto=0
18060 *) setnetent_r_proto=0
18064 : see if setprotoent exists
18065 set setprotoent d_setpent
18068 : see if setpgid exists
18069 set setpgid d_setpgid
18072 : see if setpgrp2 exists
18073 set setpgrp2 d_setpgrp2
18076 : see if setpriority exists
18077 set setpriority d_setprior
18080 : see if setproctitle exists
18081 set setproctitle d_setproctitle
18084 : see if setprotoent_r exists
18085 set setprotoent_r d_setprotoent_r
18087 case "$d_setprotoent_r" in
18089 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18090 case "$d_setprotoent_r_proto:$usethreads" in
18091 ":define") d_setprotoent_r_proto=define
18092 set d_setprotoent_r_proto setprotoent_r $hdrs
18096 case "$d_setprotoent_r_proto" in
18098 case "$setprotoent_r_proto" in
18099 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
18100 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=I_ID ;;
18102 case "$setprotoent_r_proto" in
18103 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
18104 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=V_ID ;;
18106 case "$setprotoent_r_proto" in
18107 ''|0) d_setprotoent_r=undef
18108 setprotoent_r_proto=0
18109 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
18110 * ) case "$setprotoent_r_proto" in
18111 REENTRANT_PROTO*) ;;
18112 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
18114 echo "Prototype: $try" ;;
18117 *) case "$usethreads" in
18118 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
18120 d_setprotoent_r=undef
18121 setprotoent_r_proto=0
18125 *) setprotoent_r_proto=0
18129 : see if setpwent exists
18130 set setpwent d_setpwent
18133 : see if setpwent_r exists
18134 set setpwent_r d_setpwent_r
18136 case "$d_setpwent_r" in
18138 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
18139 case "$d_setpwent_r_proto:$usethreads" in
18140 ":define") d_setpwent_r_proto=define
18141 set d_setpwent_r_proto setpwent_r $hdrs
18145 case "$d_setpwent_r_proto" in
18147 case "$setpwent_r_proto" in
18148 ''|0) try='int setpwent_r(FILE**);'
18149 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=I_H ;;
18151 case "$setpwent_r_proto" in
18152 ''|0) try='void setpwent_r(FILE**);'
18153 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=V_H ;;
18155 case "$setpwent_r_proto" in
18156 ''|0) d_setpwent_r=undef
18158 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
18159 * ) case "$setpwent_r_proto" in
18160 REENTRANT_PROTO*) ;;
18161 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
18163 echo "Prototype: $try" ;;
18166 *) case "$usethreads" in
18167 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
18174 *) setpwent_r_proto=0
18178 : see if setregid exists
18179 set setregid d_setregid
18181 set setresgid d_setresgid
18184 : see if setreuid exists
18185 set setreuid d_setreuid
18187 set setresuid d_setresuid
18190 : see if setrgid exists
18191 set setrgid d_setrgid
18194 : see if setruid exists
18195 set setruid d_setruid
18198 : see if setservent exists
18199 set setservent d_setsent
18202 : see if setservent_r exists
18203 set setservent_r d_setservent_r
18205 case "$d_setservent_r" in
18207 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18208 case "$d_setservent_r_proto:$usethreads" in
18209 ":define") d_setservent_r_proto=define
18210 set d_setservent_r_proto setservent_r $hdrs
18214 case "$d_setservent_r_proto" in
18216 case "$setservent_r_proto" in
18217 ''|0) try='int setservent_r(int, struct servent_data*);'
18218 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=I_ID ;;
18220 case "$setservent_r_proto" in
18221 ''|0) try='void setservent_r(int, struct servent_data*);'
18222 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=V_ID ;;
18224 case "$setservent_r_proto" in
18225 ''|0) d_setservent_r=undef
18226 setservent_r_proto=0
18227 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
18228 * ) case "$setservent_r_proto" in
18229 REENTRANT_PROTO*) ;;
18230 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
18232 echo "Prototype: $try" ;;
18235 *) case "$usethreads" in
18236 define) echo "setservent_r has no prototype, not using it." >&4 ;;
18238 d_setservent_r=undef
18239 setservent_r_proto=0
18243 *) setservent_r_proto=0
18247 : see if setsid exists
18248 set setsid d_setsid
18251 : see if setvbuf exists
18252 set setvbuf d_setvbuf
18255 : see if shmctl exists
18256 set shmctl d_shmctl
18259 : see if shmget exists
18260 set shmget d_shmget
18263 : see if shmat exists
18266 : see what shmat returns
18269 $cat >shmat.c <<'END'
18270 #include <sys/shm.h>
18273 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
18278 echo "and it returns ($shmattype)." >&4
18279 : see if a prototype for shmat is available
18280 xxx=`./findhdr sys/shm.h`
18281 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
18282 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
18293 set d_shmatprototype
18296 : see if shmdt exists
18300 : see how much of the 'shm*(2)' library is present.
18303 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
18304 *"$undef"*) h_shm=false;;
18308 case "`ipcs 2>&1`" in
18309 "SVID shared memory"*"not configured"*)
18310 echo "Your $osname does not have the shm*(2) configured." >&4
18313 set shmctl d_shmctl
18315 set shmget d_shmget
18325 : we could also check for sys/ipc.h ...
18326 if $h_shm && $test `./findhdr sys/shm.h`; then
18327 echo "You have the full shm*(2) library." >&4
18330 echo "You don't have the full shm*(2) library." >&4
18336 : see if we have sigaction
18338 if set sigaction val -f d_sigaction; eval $csym; $val; then
18339 echo 'sigaction() found.' >&4
18342 #include <sys/types.h>
18343 #include <signal.h>
18344 #$i_stdlib I_STDLIB
18346 #include <stdlib.h>
18350 struct sigaction act, oact;
18352 oact.sa_handler = 0;
18353 /* so that act and oact are used */
18354 exit(act.sa_flags == 0 && oact.sa_handler == 0);
18358 if eval $compile_ok; then
18361 echo "But you don't seem to have a usable struct sigaction." >&4
18365 echo 'sigaction NOT found.' >&4
18368 set d_sigaction; eval $setvar
18371 : see what type pids are declared as in the kernel
18372 rp="What is the type of process ids on this system?"
18373 set pid_t pidtype int stdio.h sys/types.h
18376 : see what type uids are declared as in the kernel
18378 echo "Looking for the type for user ids returned by getuid()."
18379 set uid_t uidtype xxx stdio.h sys/types.h
18383 xxx=`./findhdr sys/user.h`
18384 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
18386 unsigned) dflt="$1 $2" ;;
18390 *) dflt="$uidtype";;
18393 uid_t) echo "uid_t found." ;;
18394 *) rp="What is the type for user ids returned by getuid()?"
18400 : Define hasfield_t macro for Configure internal use
18401 hasfield_t='varname=$1; struct=$2; type=$3; field=$4; shift; shift; shift; shift;
18402 while $test $# -ge 2; do
18404 $define) echo "#include <$2>";;
18408 echo "int main () { $struct foo; $type bar = foo.$field; }" >> try.c;
18410 if eval $compile; then
18419 : see what siginfo fields we have
18420 case "$d_sigaction" in
18422 echo "Checking if your siginfo_t has si_errno field...">&4
18423 set d_siginfo_si_errno siginfo_t int si_errno $d_sigaction signal.h
18426 echo "Checking if your siginfo_t has si_pid field...">&4
18427 set d_siginfo_si_pid siginfo_t $pidtype si_pid $d_sigaction signal.h
18430 echo "Checking if your siginfo_t has si_uid field...">&4
18431 set d_siginfo_si_uid siginfo_t $uidtype si_uid $d_sigaction signal.h
18434 echo "Checking if your siginfo_t has si_addr field...">&4
18435 set d_siginfo_si_addr siginfo_t "void *" si_addr $d_sigaction signal.h
18438 echo "Checking if your siginfo_t has si_status field...">&4
18439 set d_siginfo_si_status siginfo_t int si_status $d_sigaction signal.h
18442 echo "Checking if your siginfo_t has si_band field...">&4
18443 set d_siginfo_si_band siginfo_t long si_band $d_sigaction signal.h
18446 echo "Checking if your siginfo_t has si_value field...">&4
18447 set d_siginfo_si_value siginfo_t "union sigval" si_value $d_sigaction signal.h
18450 echo "Checking if your siginfo_t has si_fd field...">&4
18451 set d_siginfo_si_fd siginfo_t int si_fd $d_sigaction signal.h
18456 d_siginfo_si_errno="$undef"
18457 d_siginfo_si_pid="$undef"
18458 d_siginfo_si_uid="$undef"
18459 d_siginfo_si_addr="$undef"
18460 d_siginfo_si_status="$undef"
18461 d_siginfo_si_band="$undef"
18462 d_siginfo_si_value="$undef"
18463 d_siginfo_si_fd="$undef"
18467 : see if this is a sunmath.h system
18468 set sunmath.h i_sunmath
18471 : see if signbit exists
18472 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
18474 #$i_sunmath I_SUNMATH
18476 #ifdef I_SUNMATH /* Solaris special math library */
18477 # include <sunmath.h>
18480 int main(int argc, char **argv)
18484 if ((signbit(x) == 0) && (signbit(y) != 0))
18492 if eval $compile; then
18493 if $run ./try; then
18497 $echo "Signbit seems to be available, but doesn't work as I expected."
18498 $echo "I won't use it." >&4
18509 : see if sigprocmask exists
18510 set sigprocmask d_sigprocmask
18513 : see if sigsetjmp exists
18515 case "$d_sigsetjmp" in
18518 #include <setjmp.h>
18519 #$i_stdlib I_STDLIB
18521 #include <stdlib.h>
18527 if (sigsetjmp(env,1))
18530 siglongjmp(env, 1);
18535 if eval $compile; then
18536 if $run ./try >/dev/null 2>&1; then
18537 echo "POSIX sigsetjmp found." >&4
18541 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
18547 echo "sigsetjmp not found." >&4
18551 *) val="$d_sigsetjmp"
18552 case "$d_sigsetjmp" in
18553 $define) echo "POSIX sigsetjmp found." >&4;;
18554 $undef) echo "sigsetjmp not found." >&4;;
18562 : see if snprintf exists
18563 set snprintf d_snprintf
18566 : see if vsnprintf exists
18567 set vsnprintf d_vsnprintf
18570 case "$d_snprintf-$d_vsnprintf" in
18573 Checking whether your snprintf() and vsnprintf() work okay...
18575 $cat >try.c <<'EOCP'
18576 /* v?snprintf testing logic courtesy of Russ Allbery.
18577 * According to C99:
18578 * - if the buffer is too short it still must be \0-terminated
18579 * - if the buffer is too short the potentially required length
18580 * must be returned and not -1
18581 * - if the buffer is NULL the potentially required length
18582 * must be returned and not -1 or core dump
18585 #include <stdarg.h>
18589 int test (char *format, ...)
18594 va_start (args, format);
18595 count = vsnprintf (buf, sizeof buf, format, args);
18602 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
18603 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
18607 if eval $compile; then
18610 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
18612 Your snprintf() and snprintf() don't seem to be working okay.
18614 d_snprintf="$undef"
18615 d_vsnprintf="$undef"
18619 echo "(I can't seem to compile the test program--assuming they don't)"
18620 d_snprintf="$undef"
18621 d_vsnprintf="$undef"
18627 : see if sockatmark exists
18628 set sockatmark d_sockatmark
18631 : see if prototype for sockatmark is available
18633 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
18636 : see if socks5_init exists
18637 set socks5_init d_socks5_init
18640 : see if srand48_r exists
18641 set srand48_r d_srand48_r
18643 case "$d_srand48_r" in
18645 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
18646 case "$d_srand48_r_proto:$usethreads" in
18647 ":define") d_srand48_r_proto=define
18648 set d_srand48_r_proto srand48_r $hdrs
18652 case "$d_srand48_r_proto" in
18654 case "$srand48_r_proto" in
18655 ''|0) try='int srand48_r(long, struct drand48_data*);'
18656 ./protochk "$extern_C $try" $hdrs && srand48_r_proto=I_LS ;;
18658 case "$srand48_r_proto" in
18659 ''|0) d_srand48_r=undef
18661 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
18662 * ) case "$srand48_r_proto" in
18663 REENTRANT_PROTO*) ;;
18664 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
18666 echo "Prototype: $try" ;;
18669 *) case "$usethreads" in
18670 define) echo "srand48_r has no prototype, not using it." >&4 ;;
18677 *) srand48_r_proto=0
18681 : see if srandom_r exists
18682 set srandom_r d_srandom_r
18684 case "$d_srandom_r" in
18686 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
18687 case "$d_srandom_r_proto:$usethreads" in
18688 ":define") d_srandom_r_proto=define
18689 set d_srandom_r_proto srandom_r $hdrs
18693 case "$d_srandom_r_proto" in
18695 case "$srandom_r_proto" in
18696 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
18697 ./protochk "$extern_C $try" $hdrs && srandom_r_proto=I_TS ;;
18699 case "$srandom_r_proto" in
18700 ''|0) d_srandom_r=undef
18702 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
18703 * ) case "$srandom_r_proto" in
18704 REENTRANT_PROTO*) ;;
18705 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
18707 echo "Prototype: $try" ;;
18710 *) case "$usethreads" in
18711 define) echo "srandom_r has no prototype, not using it." >&4 ;;
18718 *) srandom_r_proto=0
18722 : see if prototype for setresgid is available
18724 set d_sresgproto setresgid $i_unistd unistd.h
18727 : see if prototype for setresuid is available
18729 set d_sresuproto setresuid $i_unistd unistd.h
18732 : see if stat exists
18736 : see if sys/stat.h is available
18737 set sys/stat.h i_sysstat
18740 : see if stat knows about block sizes
18742 echo "Checking to see if your struct stat has st_blocks field..." >&4
18743 set d_statblks stat st_blocks $i_sysstat sys/stat.h
18746 : see if this is a sys/vfs.h system
18747 set sys/vfs.h i_sysvfs
18750 : see if this is a sys/statfs.h system
18751 set sys/statfs.h i_sysstatfs
18754 : Check for statfs_s
18756 echo "Checking to see if your system supports struct statfs..." >&4
18757 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
18759 case "$d_statfs_s" in
18760 "$define") echo "Yes, it does." ;;
18761 *) echo "No, it doesn't." ;;
18764 : see if struct statfs knows about f_flags
18765 case "$d_statfs_s" in
18768 echo "Checking to see if your struct statfs has f_flags field..." >&4
18769 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
18773 set d_statfs_f_flags
18777 case "$d_statfs_f_flags" in
18778 "$define") echo "Yes, it does." ;;
18779 *) echo "No, it doesn't." ;;
18782 : see what flavor, if any, of static inline is supported
18784 echo "Checking to see if your system supports static inline..."
18785 $cat > try.c <<'EOCP'
18786 #include <stdlib.h>
18787 extern int f_via_a(int x);
18788 extern int f_via_b(int x);
18789 int main(int argc, char **argv)
18798 return EXIT_SUCCESS;
18801 return EXIT_FAILURE;
18805 $cat > a.c <<'EOCP'
18806 static INLINE int f(int x) {
18817 $cat > b.c <<'EOCP'
18818 extern int f(int x);
18826 # Respect a hint (or previous) value for perl_static_inline, if there is one.
18827 case "$perl_static_inline" in
18828 '') # Check the various possibilities, and break out on success.
18829 # For gcc, prefer __inline__, which will still permit
18830 # cflags.SH to add in -ansi.
18831 case "$gccversion" in
18832 '') xxx="inline __inline__ __inline _inline";;
18833 *) xxx="__inline__ inline __inline _inline";;
18835 for inline in $xxx; do
18836 set try -DINLINE=$inline a.c
18837 if eval $compile && $run ./try; then
18838 # Now make sure there is no external linkage of static
18840 set try -DINLINE=$inline -DUSE_B a.c b.c
18841 if eval $compile && $run ./try; then
18842 $echo "Your compiler supports static $inline, " >&4
18843 $echo "but it also creates an external definition," >&4
18844 $echo "so I won't use it." >&4
18847 $echo "Your compiler supports static $inline." >&4
18849 perl_static_inline="static $inline";
18853 $echo "Your compiler does NOT support static $inline." >&4
18858 *inline*) # Some variant of inline exists.
18859 echo "Keeping your $hint value of $perl_static_inline."
18862 static) # No inline capabilities
18863 echo "Keeping your $hint value of $perl_static_inline."
18866 *) # Unrecognized previous value -- blindly trust the supplied
18867 # value and hope it makes sense. Use old value for
18868 # d_static_inline, if there is one.
18869 echo "Keeping your $hint value of $perl_static_inline."
18870 case "$d_static_inline" in
18872 *) val=$d_static_inline ;;
18876 # Fallback to plain 'static' if nothing worked.
18877 case "$perl_static_inline" in
18879 perl_static_inline="static"
18883 set d_static_inline
18885 $rm -f a.[co] b.[co]
18888 : Check stream access
18890 Checking how to access stdio streams by file descriptor number...
18892 case "$stdio_stream_array" in
18893 '') $cat >try.c <<EOCP
18896 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
18900 for s in _iob __iob __sF
18902 set try -DSTDIO_STREAM_ARRAY=$s
18903 if eval $compile; then
18904 case "`$run ./try`" in
18905 yes) stdio_stream_array=$s; break ;;
18911 case "$stdio_stream_array" in
18913 I can't figure out how to access stdio streams by file descriptor number.
18915 d_stdio_stream_array="$undef"
18918 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
18920 d_stdio_stream_array="$define"
18924 : see if strcoll exists
18925 set strcoll d_strcoll
18928 : see if strerror_l exists
18929 set strerror_l d_strerror_l
18932 : see if strerror_r exists
18933 set strerror_r d_strerror_r
18935 case "$d_strerror_r" in
18937 hdrs="$i_systypes sys/types.h define stdio.h define string.h"
18938 case "$d_strerror_r_proto:$usethreads" in
18939 ":define") d_strerror_r_proto=define
18940 set d_strerror_r_proto strerror_r $hdrs
18944 case "$d_strerror_r_proto" in
18946 case "$strerror_r_proto" in
18947 ''|0) try='int strerror_r(int, char*, size_t);'
18948 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBW ;;
18950 case "$strerror_r_proto" in
18951 ''|0) try='int strerror_r(int, char*, int);'
18952 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBI ;;
18954 case "$strerror_r_proto" in
18955 ''|0) try='char* strerror_r(int, char*, size_t);'
18956 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=B_IBW ;;
18958 case "$strerror_r_proto" in
18959 ''|0) d_strerror_r=undef
18961 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
18962 * ) case "$strerror_r_proto" in
18963 REENTRANT_PROTO*) ;;
18964 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
18966 echo "Prototype: $try" ;;
18969 *) case "$usethreads" in
18970 define) echo "strerror_r has no prototype, not using it." >&4 ;;
18977 *) strerror_r_proto=0
18981 : see if strftime exists
18982 set strftime d_strftime
18985 : see if strlcat exists
18986 : We need both a prototype in string.h and the symbol in libc.
18989 xx1="#$d_gnulibc HAS_GNULIBC"
18990 xx2='#if defined(HAS_GNULIBC) && !defined(_GNU_SOURCE)'
18991 xx3='# define _GNU_SOURCE'
18993 set d_strlcat_proto strlcat literal "$xx1" literal "$xx2" literal "$xx3" literal "$xx4" define string.h
18995 case "$d_strlcat_proto" in
18996 define) # see if strlcat exists
18997 set strlcat d_strlcat
19006 : see if strlcpy exists
19007 : We need both a prototype in string.h and the symbol in libc.
19010 xx1="#$d_gnulibc HAS_GNULIBC"
19011 xx2='#if defined(HAS_GNULIBC) && !defined(_GNU_SOURCE)'
19012 xx3='# define _GNU_SOURCE'
19014 set d_strlcpy_proto strlcpy literal "$xx1" literal "$xx2" literal "$xx3" literal "$xx4" define string.h
19016 case "$d_strlcpy_proto" in
19017 define) # see if strlcpy exists
19018 set strlcpy d_strlcpy
19027 : see if strnlen exists
19028 set strnlen d_strnlen
19031 : see if strtod exists
19032 set strtod d_strtod
19035 : see if strtod_l exists
19036 set strtod_l d_strtod_l
19039 : see if strtol exists
19040 set strtol d_strtol
19043 : see if strtold exists
19044 set strtold d_strtold
19047 : see if strtold_l exists
19048 set strtold_l d_strtold_l
19051 : see if strtoll exists
19052 set strtoll d_strtoll
19055 case "$d_longlong-$d_strtoll" in
19058 Checking whether your strtoll() works okay...
19060 $cat >try.c <<'EOCP'
19063 #define strtoll __strtoll
19066 #define strtoll _strtoll
19069 extern long long int strtoll(char *s, char **, int);
19070 static int bad = 0;
19071 int check(char *s, long long ell, int een) {
19074 gll = strtoll(s, 0, 10);
19075 if (!((gll == ell) && (errno == een)))
19079 check(" 1", 1LL, 0);
19080 check(" 0", 0LL, 0);
19081 check("-1", -1LL, 0);
19082 check("-9223372036854775808", -9223372036854775808LL, 0);
19083 check("-9223372036854775808", -9223372036854775808LL, 0);
19084 check(" 9223372036854775807", 9223372036854775807LL, 0);
19085 check("-9223372036854775808", -9223372036854775808LL, 0);
19086 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
19087 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
19093 if eval $compile; then
19096 ok) echo "Your strtoll() seems to be working okay." ;;
19098 Your strtoll() doesn't seem to be working okay.
19104 echo "(I can't seem to compile the test program--assuming it doesn't)"
19110 : see if strtoq exists
19111 set strtoq d_strtoq
19114 : see if strtoul exists
19115 set strtoul d_strtoul
19118 case "$d_strtoul" in
19121 Checking whether your strtoul() works okay...
19123 $cat >try.c <<'EOCP'
19126 extern unsigned long int strtoul(char *s, char **, int);
19127 static int bad = 0;
19128 void check(char *s, unsigned long eul, int een) {
19131 gul = strtoul(s, 0, 10);
19132 if (!((gul == eul) && (errno == een)))
19136 check(" 1", 1L, 0);
19137 check(" 0", 0L, 0);
19139 case "$longsize" in
19141 $cat >>try.c <<'EOCP'
19142 check("18446744073709551615", 18446744073709551615UL, 0);
19143 check("18446744073709551616", 18446744073709551615UL, ERANGE);
19144 #if 0 /* strtoul() for /^-/ strings is undefined. */
19145 check("-1", 18446744073709551615UL, 0);
19146 check("-18446744073709551614", 2, 0);
19147 check("-18446744073709551615", 1, 0);
19148 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
19149 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
19154 $cat >>try.c <<'EOCP'
19155 check("4294967295", 4294967295UL, 0);
19156 check("4294967296", 4294967295UL, ERANGE);
19157 #if 0 /* strtoul() for /^-/ strings is undefined. */
19158 check("-1", 4294967295UL, 0);
19159 check("-4294967294", 2, 0);
19160 check("-4294967295", 1, 0);
19161 check("-4294967296", 4294967295UL, ERANGE);
19162 check("-4294967297", 4294967295UL, ERANGE);
19167 : Should we write these tests to be more portable by sprintf-ing
19168 : ~0 and then manipulating that char string as input for strtol?
19171 $cat >>try.c <<'EOCP'
19178 if eval $compile; then
19179 case "`$run ./try`" in
19180 ok) echo "Your strtoul() seems to be working okay." ;;
19182 Your strtoul() doesn't seem to be working okay.
19188 echo "(I can't seem to compile the test program--assuming it doesn't)"
19194 : see if strtoull exists
19195 set strtoull d_strtoull
19198 case "$d_longlong-$d_strtoull" in
19201 Checking whether your strtoull() works okay...
19203 $cat >try.c <<'EOCP'
19206 #define strtoull __strtoull
19209 extern unsigned long long int strtoull(char *s, char **, int);
19210 static int bad = 0;
19211 int check(char *s, long long eull, int een) {
19214 gull = strtoull(s, 0, 10);
19215 if (!((gull == eull) && (errno == een)))
19219 check(" 1", 1LL, 0);
19220 check(" 0", 0LL, 0);
19221 check("18446744073709551615", 18446744073709551615ULL, 0);
19222 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
19223 #if 0 /* strtoull() for /^-/ strings is undefined. */
19224 check("-1", 18446744073709551615ULL, 0);
19225 check("-18446744073709551614", 2LL, 0);
19226 check("-18446744073709551615", 1LL, 0);
19227 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
19228 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
19235 if eval $compile; then
19236 case "`$run ./try`" in
19237 ok) echo "Your strtoull() seems to be working okay." ;;
19239 Your strtoull() doesn't seem to be working okay.
19241 d_strtoull="$undef"
19245 echo "(I can't seem to compile the test program--assuming it doesn't)"
19246 d_strtoull="$undef"
19251 : see if strtouq exists
19252 set strtouq d_strtouq
19255 case "$d_strtouq" in
19258 Checking whether your strtouq() works okay...
19260 $cat >try.c <<'EOCP'
19263 extern unsigned long long int strtouq(char *s, char **, int);
19264 static int bad = 0;
19265 void check(char *s, unsigned long long eull, int een) {
19266 unsigned long long gull;
19268 gull = strtouq(s, 0, 10);
19269 if (!((gull == eull) && (errno == een)))
19273 check(" 1", 1LL, 0);
19274 check(" 0", 0LL, 0);
19275 check("18446744073709551615", 18446744073709551615ULL, 0);
19276 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
19277 #if 0 /* strtouq() for /^-/ strings is undefined. */
19278 check("-1", 18446744073709551615ULL, 0);
19279 check("-18446744073709551614", 2LL, 0);
19280 check("-18446744073709551615", 1LL, 0);
19281 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
19282 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
19290 if eval $compile; then
19291 case "`$run ./try`" in
19292 ok) echo "Your strtouq() seems to be working okay." ;;
19294 Your strtouq() doesn't seem to be working okay.
19300 echo "(I can't seem to compile the test program--assuming it doesn't)"
19306 : see if strxfrm exists
19307 set strxfrm d_strxfrm
19310 : see if symlink exists
19311 set symlink d_symlink
19314 : see if syscall exists
19315 set syscall d_syscall
19318 : see if prototype for syscall is available
19320 set d_syscallproto syscall $i_unistd unistd.h
19323 : see if sysconf exists
19324 set sysconf d_sysconf
19327 : see if sys_errlist[] exists
19329 if test "X$d_syserrlst" = X; then
19330 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
19331 echo "You have sys_errlist[], so we could roll our own strerror."
19332 d_syserrlst="$define"
19334 echo "You don't have sys_errlist[], so strerror() is welcome."
19335 d_syserrlst="$undef"
19339 : see if system exists
19340 set system d_system
19343 : see if tcgetpgrp exists
19344 set tcgetpgrp d_tcgetpgrp
19347 : see if tcsetpgrp exists
19348 set tcsetpgrp d_tcsetpgrp
19351 : see if prototype for telldir is available
19353 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
19356 : see if tgamma exists
19357 set tgamma d_tgamma
19360 : check for thread_safe_nl_langinfo_l item
19363 Checking to see if you have nl_langinfo_l() and that it is thread-safe
19366 #$i_stdlib I_STDLIB
19368 # include <stdlib.h>
19370 #include <string.h>
19371 #$i_langinfo I_LANGINFO
19373 # include <langinfo.h>
19375 #$i_pthread I_PTHREAD
19377 # include <pthread.h>
19379 #$i_locale I_LOCALE
19381 # include <locale.h>
19385 thread_start(void * arg)
19387 nl_langinfo(RADIXCHAR);
19391 char * main_buffer;
19392 char save_main_buffer[1000];
19393 pthread_t subthread;
19394 pthread_attr_t attr;
19396 main_buffer = nl_langinfo_l(CODESET, newlocale(LC_ALL_MASK, "C", 0));
19398 /* If too large for our generous allowance, just assume we don't have
19400 if (strlen(main_buffer) >= sizeof(save_main_buffer)) {
19404 strcpy(save_main_buffer, main_buffer);
19406 if (pthread_attr_init(&attr) != 0) {
19410 if (pthread_create(&subthread, &attr, thread_start, NULL) != 0) {
19414 if (pthread_join(subthread, NULL) != 0) {
19418 exit(! (strcmp(main_buffer, save_main_buffer) == 0));
19421 case "$usethreads" in
19424 if eval $compile; then
19425 echo "Your system has nl_langinfo_l()..." >&4
19426 if $run ./try; then
19427 echo "and it is thread-safe (just as I'd hoped)." >&4
19428 d_thread_safe_nl_langinfo_l="$define"
19429 echo "$d_thread_safe_nl_langinfo_l" >&4
19431 echo "but it isn't thread-safe, so we won't use it." >&4
19434 echo "your system does not have nl_langinfo_l()" >&4
19437 *) echo "Since threads aren't selected, we won't bother looking for nl_langinfo_l()" >&4
19439 if test X"$d_thread_safe_nl_langinfo_l" = X; then
19440 d_thread_safe_nl_langinfo_l="$undef"
19444 : see if time exists
19446 if test "X$d_time" = X -o X"$timetype" = X; then
19447 if set time val -f d_time; eval $csym; $val; then
19448 echo 'time() found.' >&4
19450 rp="What is the type returned by time() on this system?"
19451 set time_t timetype long stdio.h sys/types.h
19454 echo 'time() not found, hope that will do.' >&4
19462 : see if timegm exists
19463 set timegm d_timegm
19466 : see if this is a sys/times.h system
19467 set sys/times.h i_systimes
19470 : see if times exists
19472 if set times val -f d_times; eval $csym; $val; then
19473 echo 'times() found.' >&4
19476 case "$i_systimes" in
19477 "$define") inc='sys/times.h';;
19479 rp="What is the type returned by times() on this system?"
19480 set clock_t clocktype long stdio.h sys/types.h $inc
19483 echo 'times() NOT found, hope that will do.' >&4
19488 : see if tmpnam_r exists
19489 set tmpnam_r d_tmpnam_r
19491 case "$d_tmpnam_r" in
19493 hdrs="$i_systypes sys/types.h define stdio.h "
19494 case "$d_tmpnam_r_proto:$usethreads" in
19495 ":define") d_tmpnam_r_proto=define
19496 set d_tmpnam_r_proto tmpnam_r $hdrs
19500 case "$d_tmpnam_r_proto" in
19502 case "$tmpnam_r_proto" in
19503 ''|0) try='char* tmpnam_r(char*);'
19504 ./protochk "$extern_C $try" $hdrs && tmpnam_r_proto=B_B ;;
19506 case "$tmpnam_r_proto" in
19507 ''|0) d_tmpnam_r=undef
19509 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
19510 * ) case "$tmpnam_r_proto" in
19511 REENTRANT_PROTO*) ;;
19512 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
19514 echo "Prototype: $try" ;;
19517 *) case "$usethreads" in
19518 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
19525 *) tmpnam_r_proto=0
19529 : see if towlower exists
19530 set towlower d_towlower
19533 : see if trunc exists
19537 : see if truncate exists
19538 set truncate d_truncate
19541 : see if ttyname_r exists
19542 set ttyname_r d_ttyname_r
19544 case "$d_ttyname_r" in
19546 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
19547 case "$d_ttyname_r_proto:$usethreads" in
19548 ":define") d_ttyname_r_proto=define
19549 set d_ttyname_r_proto ttyname_r $hdrs
19553 case "$d_ttyname_r_proto" in
19555 case "$ttyname_r_proto" in
19556 ''|0) try='int ttyname_r(int, char*, size_t);'
19557 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBW ;;
19559 case "$ttyname_r_proto" in
19560 ''|0) try='int ttyname_r(int, char*, int);'
19561 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBI ;;
19563 case "$ttyname_r_proto" in
19564 ''|0) try='char* ttyname_r(int, char*, int);'
19565 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=B_IBI ;;
19567 case "$ttyname_r_proto" in
19568 ''|0) d_ttyname_r=undef
19570 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
19571 * ) case "$ttyname_r_proto" in
19572 REENTRANT_PROTO*) ;;
19573 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
19575 echo "Prototype: $try" ;;
19578 *) case "$usethreads" in
19579 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
19586 *) ttyname_r_proto=0
19590 : see if tzname[] exists
19592 if set tzname val -a d_tzname; eval $csym; $val; then
19594 echo 'tzname[] found.' >&4
19597 echo 'tzname[] NOT found.' >&4
19602 : Check if is a multiplatform env
19604 darwin) multiarch="$define" ;;
19606 case "$multiarch" in
19607 ''|[nN]*) multiarch="$undef" ;;
19610 : check for ordering of bytes in a UV
19612 case "$multiarch" in
19615 You seem to be doing a multiarchitecture build,
19616 skipping the byteorder check.
19622 case "$byteorder" in
19625 In the following, larger digits indicate more significance. A big-endian
19626 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
19627 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
19628 machines may have weird orders like 3412. A Cray will report 87654321,
19629 an Alpha will report 12345678. If the test program works the default is
19631 I'm now running the test program...
19635 #$i_stdlib I_STDLIB
19637 #include <stdlib.h>
19639 #include <sys/types.h>
19640 typedef $uvtype UV;
19650 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
19652 u.l = (UV)0x04030201;
19653 for (i = 0; i < $uvsize; i++)
19654 printf("%c", u.c[i]+'0');
19661 if eval $compile && $run ./try > /dev/null; then
19664 [1-4][1-4][1-4][1-4]|12345678|87654321)
19665 echo "(The test program ran ok.)"
19666 echo "byteorder=$dflt"
19669 ????|????????) echo "(The test program ran ok.)" ;;
19670 *) echo "(The test program didn't run right for some reason.)" ;;
19675 (I can't seem to compile the test program. Guessing big-endian...)
19678 case "$xxx_prompt" in
19680 rp="What is the order of bytes in $uvtype?"
19693 : Checking 32bit alignedness
19696 Checking to see whether you can access character data unalignedly...
19698 case "$d_u32align" in
19699 '') $cat >try.c <<EOCP
19701 #$i_stdlib I_STDLIB
19703 #include <stdlib.h>
19705 #define U32 $u32type
19706 #define BYTEORDER 0x$byteorder
19708 #include <signal.h>
19710 $signal_t bletch(int s) { exit(4); }
19713 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
19714 volatile U8 buf[8];
19718 if (sizeof(U32) != 4) {
19719 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
19726 signal(SIGBUS, bletch);
19738 for (i = 0; i < 4; i++) {
19739 up = (U32*)(buf + i);
19740 if (! ((*up == 1 << (8*i)) || /* big-endian */
19741 (*up == 1 << (8*(3-i))) /* little-endian */
19745 printf("read failed (%x)\n", *up);
19751 for (i = 0; i < 4; i++) {
19752 up = (U32*)(buf + i);
19754 if (*up != 0xBeef) {
19755 printf("write failed (%x)\n", *up);
19769 if eval $compile_ok; then
19770 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
19771 $run ./try 2>&1 >/dev/null
19774 You can access character data pretty unalignedly.
19776 d_u32align="$undef"
19779 It seems that you must access character data in an aligned manner.
19781 d_u32align="$define"
19785 rp='Can you access character data at unaligned addresses?'
19789 [yY]*) d_u32align="$undef" ;;
19790 *) d_u32align="$define" ;;
19797 : see if ualarm exists
19798 set ualarm d_ualarm
19801 : see if umask exists
19805 : see if unordered exists
19806 set unordered d_unordered
19809 : see if unsetenv exists
19810 set unsetenv d_unsetenv
19813 : see if usleep exists
19814 set usleep d_usleep
19817 : see if prototype for usleep is available
19819 set d_usleepproto usleep $i_unistd unistd.h
19822 : see if ustat exists
19826 : see if closedir exists
19827 set closedir d_closedir
19830 case "$d_closedir" in
19833 echo "Checking whether closedir() returns a status..." >&4
19835 #$i_dirent I_DIRENT /**/
19836 #$i_sysdir I_SYS_DIR /**/
19837 #$i_sysndir I_SYS_NDIR /**/
19838 #$i_systypes I_SYS_TYPES /**/
19840 #if defined(I_SYS_TYPES)
19841 #include <sys/types.h>
19843 #if defined(I_DIRENT)
19844 #include <dirent.h>
19847 #include <sys/ndir.h>
19850 #include <sys/dir.h>
19854 int main() { return closedir(opendir(".")); }
19857 if eval $compile_ok; then
19858 if $run ./try > /dev/null 2>&1 ; then
19859 echo "Yes, it does."
19862 echo "No, it doesn't."
19866 echo "(I can't seem to compile the test program--assuming it doesn't)"
19874 set d_void_closedir
19878 : see if there is a wait4
19882 : see if waitpid exists
19883 set waitpid d_waitpid
19888 $cat >try.c <<'EOCP'
19894 return (wcscmp (s, s) ? 1 : 0);
19899 if eval $compile; then
19902 0) echo "A working wcscmp() found." >&4
19904 *) echo "wcscmp() found, but it doesn't work" >&4
19908 echo "wcscmp() NOT found." >&4
19914 : see if wcstombs exists
19915 set wcstombs d_wcstombs
19920 $cat >try.c <<'EOCP'
19925 wchar_t dst[4], *src = L" ";
19927 return (wcsxfrm (dst, src, 1) ? errno ? errno : 0 : 1);
19932 if eval $compile; then
19935 0) echo "A working wcsxfrm() found." >&4
19937 *) echo "wcsxfrm() found, but it doesn't work" >&4
19941 echo "wcsxfrm() NOT found." >&4
19947 : see if wctomb exists
19948 set wctomb d_wctomb
19951 : see if writev exists
19952 set writev d_writev
19955 : check for alignment requirements
19957 case "$alignbytes" in
19958 '') echo "Checking alignment constraints..." >&4
19967 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
19972 if eval $compile_ok; then
19976 echo "(I can't seem to compile the test program...)"
19978 case "$multiarch" in
19980 : The usual safe value is 8, but Darwin with -Duselongdouble
19981 : needs 16. Hence, we will take 8 as a minimum, but allow
19982 : Configure to pick a larger value if needed.
19983 if $test "$dflt" -lt 8; then
19985 echo "Setting alignment to 8 for multiarch support.">&4
19990 *) dflt="$alignbytes"
19993 rp="Doubles must be aligned on a how-many-byte boundary?"
19998 : set the base revision
20001 : length of character in bytes. Is always 1, otherwise it is not C
20002 : This used to be a test using sizeof
20005 : Check for the number of bits in a character
20006 case "$charbits" in
20007 '') echo "Checking how long a character is (in bits)..." >&4
20014 for (c = 1, n = 0; c; c <<= 1, n++) ;
20015 printf ("%d\n", n);
20020 if eval $compile_ok; then
20024 echo "(I can't seem to compile the test program. Guessing...)"
20031 rp="What is the length of a character (in bits)?"
20035 case "$charbits" in
20038 Your system has an unsigned character size of $charbits bits, which
20039 is rather unusual (normally it is 8 bits). Perl likely will not work
20040 correctly on your system, with subtle bugs in various places.
20042 rp='Do you really want to continue?'
20046 [yY]) echo >&4 "Okay, continuing." ;;
20051 : how do we concatenate cpp tokens here?
20053 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
20054 $cat >cpp_stuff.c <<'EOCP'
20055 #define RCAT(a,b)a/**/b
20056 #define ACAT(a,b)a ## b
20060 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
20061 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
20062 echo "Oh! Smells like ANSI's been here." >&4
20063 echo "We can catify or stringify, separately or together!"
20065 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
20066 echo "Ah, yes! The good old days!" >&4
20067 echo "However, in the good old days we don't know how to stringify and"
20068 echo "catify at the same time."
20072 Hmm, I don't seem to be able to concatenate tokens with your cpp.
20073 You're going to have to edit the values of CAT[2-5] in config.h...
20075 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
20079 : see if this is a db.h system
20085 : Check db version.
20087 echo "Checking Berkeley DB version ..." >&4
20089 #include <sys/types.h>
20091 #$i_stdlib I_STDLIB
20093 #include <stdlib.h>
20096 int main(int argc, char *argv[])
20098 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
20099 int Major, Minor, Patch ;
20100 unsigned long Version ;
20101 (void)db_version(&Major, &Minor, &Patch) ;
20103 printf("%d %d %d %d %d %d\n",
20104 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
20105 Major, Minor, Patch);
20108 printf("You have Berkeley DB Version 2 or greater.\n");
20110 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
20111 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
20112 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
20113 Major, Minor, Patch) ;
20115 /* check that db.h & libdb are compatible */
20116 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
20117 printf("db.h and libdb are incompatible.\n") ;
20121 printf("db.h and libdb are compatible.\n") ;
20123 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
20124 + DB_VERSION_PATCH ;
20126 /* needs to be >= 2.3.4 */
20127 if (Version < 2003004) {
20128 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
20129 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
20135 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
20140 printf("You have Berkeley DB Version 1.\n");
20141 exit(0); /* DB version < 2: the coast is clear. */
20143 exit(1); /* <db.h> not Berkeley DB? */
20149 if eval $compile_ok && $run ./try; then
20150 echo 'Looks OK.' >&4
20152 db_version_major=$1
20153 db_version_minor=$2
20154 db_version_patch=$3
20156 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
20160 : Remove db from list of libraries to use
20161 echo "Removing unusable -ldb from library list" >&4
20162 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
20165 echo "libs = $libs" >&4
20175 : Check the return type needed for hash
20177 echo "Checking return type needed for hash for Berkeley DB ..." >&4
20179 #include <sys/types.h>
20182 #ifndef DB_VERSION_MAJOR
20183 u_int32_t hash_cb (const void* ptr, size_t size)
20190 info.hash = hash_cb;
20194 if $cc $ccflags -c try.c >try.out 2>&1 ; then
20195 if $contains warning try.out >>/dev/null 2>&1 ; then
20198 db_hashtype='u_int32_t'
20201 : XXX Maybe we should just give up here.
20202 db_hashtype=u_int32_t
20204 echo "Help: I can't seem to compile the db test program." >&4
20205 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
20208 echo "Your version of Berkeley DB uses $db_hashtype for hash."
20210 *) db_hashtype=u_int32_t
20215 : Check the return type needed for prefix
20217 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
20219 #include <sys/types.h>
20222 #ifndef DB_VERSION_MAJOR
20223 size_t prefix_cb (const DBT *key1, const DBT *key2)
20230 info.prefix = prefix_cb;
20234 if $cc $ccflags -c try.c >try.out 2>&1 ; then
20235 if $contains warning try.out >>/dev/null 2>&1 ; then
20236 db_prefixtype='int'
20238 db_prefixtype='size_t'
20241 db_prefixtype='size_t'
20242 : XXX Maybe we should just give up here.
20244 echo "Help: I can't seem to compile the db test program." >&4
20245 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
20248 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
20250 *) db_prefixtype='size_t'
20254 : Include . in @INC
20257 Historically Perl has provided a final fallback of the current working
20258 directory '.' when searching for a library. This, however, can lead to
20259 problems when a Perl program which loads optional modules is called from
20260 a shared directory. This can lead to executing unexpected code.
20264 # When changing to exclude by default:
20265 case "$default_inc_excludes_dot" in
20266 $undef|false|[nN]*) dflt="n" ;;
20269 # To turn exclude off by default:
20270 #case "$default_inc_excludes_dot" in
20271 # $define|true|[yY]*) dflt="y" ;;
20275 rp='Exclude '.' from @INC by default? '
20278 [nN]|undef) default_inc_excludes_dot="$undef" ;;
20279 *) default_inc_excludes_dot="$define" ;;
20282 : Check what kind of inf/nan your system has
20283 $echo "Checking the kind of infinities and nans you have..." >&4
20284 $echo "(The following tests may crash. That's okay.)" >&4
20286 #define DOUBLESIZE $doublesize
20287 #$d_longdbl HAS_LONG_DOUBLE
20288 #ifdef HAS_LONG_DOUBLE
20289 #define LONG_DOUBLESIZE $longdblsize
20290 #define LONG_DOUBLEKIND $longdblkind
20293 #include <string.h>
20295 /* Note that whether the sign bit is on or off
20296 * for NaN depends on the CPU/FPU, and possibly
20297 * can be affected by the build toolchain.
20299 * For example for older MIPS and HP-PA 2.0 the quiet NaN is:
20300 * 0x7f, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
20301 * 0x7f, 0xf4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
20302 * (respectively) as opposed to the more usual
20303 * 0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
20305 * Pre-IEEE-754 floating point format do not even have inf/nan support
20306 * at all. They might have a "max" value (DBL_MAX), which may be deadly
20307 * to even mention, causing immediate SIGFPE or equivalent: this is
20308 * the case with VAX floating point, for example.
20310 static void bytes(void *v, unsigned int n) {
20311 unsigned char *p = (unsigned char *)v;
20313 for (i = 0; i < n; i++) {
20314 printf("0x%02x%s", p[i], i < n - 1 ? ", " : "\n");
20317 int main(int argc, char *argv[]) {
20318 /* We cannot use 1.0/0.0 and 0.0/0.0 (with L suffixes for long double)
20319 * because some compilers are 'smart' and not only warn but refuse to
20320 * compile such 'illegal' values. */
20321 double dinf = exp(1e9);
20322 double dnan = sqrt(-1.0);
20323 #ifdef HAS_LONG_DOUBLE
20324 long double ldinf = (long double)exp(1e9);
20325 long double ldnan = (long double)sqrt(-1.0);
20326 # if LONG_DOUBLEKIND == 3 || LONG_DOUBLEKIND == 4
20327 /* the 80-bit long doubles might have garbage in their excess bytes */
20328 memset((char *)&ldinf + 10, '\0', LONG_DOUBLESIZE - 10);
20329 memset((char *)&ldnan + 10, '\0', LONG_DOUBLESIZE - 10);
20332 switch (argv[1][0]) {
20333 case '1': bytes(&dinf, sizeof(dinf)); break;
20334 case '2': bytes(&dnan, sizeof(dnan)); break;
20335 case '3': bytes(&ldinf, sizeof(ldinf)); break;
20336 case '4': bytes(&ldnan, sizeof(ldnan)); break;
20344 if eval $compile; then
20345 doubleinfbytes=`$run ./try 1`
20346 doublenanbytes=`$run ./try 2`
20347 case "$d_longdbl" in
20349 longdblinfbytes=`$run ./try 3`
20350 longdblnanbytes=`$run ./try 4`
20354 # Defaults in case the above test program failed.
20355 case "$doublekind" in
20356 1) # IEEE 754 32-bit LE
20357 doubleinfbytes='0x00, 0x00, 0xf0, 0x7f'
20358 doublenanbytes='0x00, 0x00, 0xf8, 0x7f'
20360 2) # IEEE 754 32-bit BE
20361 doubleinfbytes='0x7f, 0xf0, 0x00, 0x00'
20362 doublenanbytes='0x7f, 0xf8, 0x00, 0x00'
20364 3) # IEEE 754 64-bit LE
20365 doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
20366 doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
20368 4) # IEEE 754 64-bit BE
20369 doubleinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20370 doublenanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20372 5) # IEEE 754 128-bit LE
20373 doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
20374 doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
20376 6) # IEEE 754 128-bit BE
20377 doubleinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20378 doublenanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20380 7) # IEEE 754 64-bit mixed: 32-bit LEs in BE
20381 doubleinfbytes='0x00, 0x00, 0xf0, 0x7f, 0x00, 0x00, 0x00, 0x00'
20382 doublenanbytes='0x00, 0x00, 0xf8, 0x7f, 0x00, 0x00, 0x00, 0x00'
20384 8) # IEEE 754 64-bit mixed: 32-bit BEs in LE
20385 doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x7f, 0xf0, 0x00, 0x00'
20386 doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x7f, 0xf8, 0x00, 0x00'
20388 9|10|11|12|13|14) # VAX/Cray/IBM floating point formats, no inf/nan.
20389 doubleinfbytes=$undef
20390 doublenanbytes=$undef
20393 doubleinfbytes=$undef
20394 doublenanbytes=$undef
20397 case "$longdblkind" in
20398 1) # IEEE 754 128-bit LE
20399 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f'
20400 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f'
20402 2) # IEEE 754 128-bit BE
20403 longdblinfbytes='0x7f, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20404 longdblnanbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20406 3) # IEEE 754 80-bit LE, 12 or 16 bytes (x86)
20407 case "$longdblsize" in
20408 12) # x86 32-bit (96 bits, or 4 x 32, or 12 x 8)
20409 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00'
20410 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x7f, 0x00, 0x00'
20413 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20414 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20417 longdblinfbytes=$undef
20418 longdblnanbytes=$undef
20422 4) # IEEE 754 80-bit BE, 12 or 16 bytes
20423 case "$longdblsize" in
20424 12) # 32-bit system
20425 longdblinfbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20426 longdblnanbytes='0x7f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20428 16) # 64-bit system
20429 longdblinfbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20430 longdblnanbytes='0x7f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20433 longdblinfbytes=$undef
20434 longdblnanbytes=$undef
20438 5) # 128-bit LE-LE "double double"
20439 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
20440 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
20442 6) # 128-bit BE-BE "double double"
20443 longdblinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20444 longdblnanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20446 7) # 128-bit LE-BE "double double"
20447 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20448 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20450 8) # 128-bit BE-LE "double double"
20451 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20452 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20454 9|10|11|12|13|14) # VAX/Cray/IBM floating point formats, no inf/nan.
20455 longdblinfbytes=$undef
20456 longdblnanbytes=$undef
20459 longdblinfbytes=$undef
20460 longdblnanbytes=$undef
20464 # In case the program crashed the values are empty, turn them undef.
20465 case "$doubleinfbytes" in
20466 '') doubleinfbytes=$undef ;;
20468 case "$doublenanbytes" in
20469 '') doublenanbytes=$undef ;;
20471 case "$longdblinfbytes" in
20472 '') longdblinfbytes=$undef ;;
20474 case "$longdblnanbytes" in
20475 '') longdblnanbytes=$undef ;;
20479 : Check the length of the double mantissa
20480 $echo "Checking how many mantissa bits your doubles have..." >&4
20482 #$i_sunmath I_SUNMATH
20485 # include <sunmath.h>
20487 #ifdef DBL_MANT_DIG
20488 # define BITS (DBL_MANT_DIG - 1) /* the implicit bit does not count */
20491 int main(int argc, char *argv[]) {
20493 printf("%d\n", BITS);
20499 if eval $compile; then
20500 doublemantbits=`$run ./try`
20502 doublemantbits="$undef"
20506 : Check the length of the longdouble mantissa
20507 $echo "Checking how many mantissa bits your long doubles have..." >&4
20509 #$i_sunmath I_SUNMATH
20512 # include <sunmath.h>
20514 #$d_longdbl HAS_LONG_DOUBLE
20515 #if defined(HAS_LONG_DOUBLE) && defined(LDBL_MANT_DIG)
20516 # if ($longdblkind == 3) || ($longdblkind == 4) /* 80-bit extended precision */
20517 /* This format has no implicit bit. Beware, however, that for
20518 * this format the bare LDBL_MANT_DIG is misleading for inf/nan:
20519 * the top three bits are used for inf (100) / qnan (11x) / snan (101),
20520 * and the top bit must have been one since 387, zero is plain invalid.
20521 * For normal fp values, the LDBL_MANT_DIG is fine, though. */
20522 # define BITS LDBL_MANT_DIG
20523 # elif ($longdblkind == 5 || $longdblkind == 6 || $longdblkind == 7 || $longdblkind == 8) /* double double */
20524 /* LDBL_MANT_DIG of 106 (twice 53) would be logical, but for some
20525 * reason e.g. Irix thinks 107. But in any case, we want only
20526 * the number of real bits, the implicit bits are of no interest. */
20527 # define BITS 2 * (DBL_MANT_DIG - 1)
20529 # define BITS (LDBL_MANT_DIG - 1) /* the implicit bit does not count */
20533 int main(int argc, char *argv[]) {
20535 printf("%d\n", BITS);
20541 if eval $compile; then
20542 longdblmantbits=`$run ./try`
20544 longdblmantbits="$undef"
20548 : Check the length of the NV mantissa
20549 $echo "Checking how many mantissa bits your NVs have..." >&4
20550 if test "X$usequadmath" = "X$define"; then
20551 nvmantbits=112 # 128-1-15
20553 if test "X$nvsize" = "X$doublesize"; then
20554 nvmantbits="$doublemantbits"
20556 if test "X$nvsize" = "X$longdblsize"; then
20557 nvmantbits="$longdblmantbits"
20559 nvmantbits="$undef"
20564 : How can we generate normalized random numbers ?
20566 echo "Using our internal random number implementation..." >&4
20569 *-Dmy_rand=*|*-Dmy_srand=*)
20570 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
20571 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
20572 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
20573 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
20577 randfunc=Perl_drand48
20578 drand01="Perl_drand48()"
20579 seedfunc="Perl_drand48_init"
20583 : Probe whether dtrace builds an object, as newer Illumos requires an input
20584 : object file that uses at least one of the probes defined in the .d file
20585 case "$usedtrace" in
20587 case "$dtracexnolibs" in
20588 $define|true|[yY]*)
20589 dtracexnolibs=$define
20590 $dtrace -h -xnolibs -s ../perldtrace.d -o perldtrace.h
20593 if $dtrace -h -xnolibs -s ../perldtrace.d -o perldtrace.h 2>&1 ; then
20594 dtracexnolibs=$define
20595 echo "Your dtrace accepts -xnolibs"
20596 elif $dtrace -h -s ../perldtrace.d -o perldtrace.h 2>&1 ; then
20597 dtracexnolibs=$undef
20598 echo "Your dtrace doesn't accept -xnolibs"
20600 echo "Your dtrace doesn't work at all, try building without dtrace support" >&4
20605 dtracexnolibs=$undef
20606 $dtrace -h -s ../perldtrace.d -o perldtrace.h
20609 case $dtracexnolibs in
20610 $define) xnolibs=-xnolibs ;;
20614 case "$dtraceobject" in
20615 $define|true|[yY]*)
20616 dtraceobject=$define
20620 #include "perldtrace.h"
20622 PERL_LOADED_FILE("dummy");
20626 dtraceobject=$undef
20627 if $cc -c -o try.o $optimize $ccflags try.c \
20628 && $dtrace -G $xnolibs -s ../perldtrace.d try.o >/dev/null 2>&1; then
20629 dtraceobject=$define
20630 echo "Your dtrace builds an object file"
20633 *) dtraceobject=$undef ;;
20635 $rm_try perldtrace.o perldtrace.h
20638 : Determine if this is an EBCDIC system
20640 echo "Determining whether or not we are on an EBCDIC system..." >&4
20641 $cat >try.c <<'EOM'
20644 if ('M'==0xd4) return 0;
20651 if eval $compile_ok; then
20652 if $run ./try; then
20653 echo "You seem to speak EBCDIC." >&4
20656 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
20659 echo "I'm unable to compile the test program." >&4
20660 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
20666 : Check how to flush
20669 Checking how to flush all pending stdio output...
20671 # I only know how to find the first 32 possibly open files on SunOS.
20672 # See also hints/sunos_4_1.sh and util.c --AD
20674 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
20676 $cat >>try.c <<EOCP
20678 #$i_stdlib I_STDLIB
20680 #include <stdlib.h>
20682 #$i_unistd I_UNISTD
20684 # include <unistd.h>
20686 #$d_sysconf HAS_SYSCONF
20687 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
20688 #ifdef HAS_STDIO_STREAM_ARRAY
20689 # define STDIO_STREAM_ARRAY $stdio_stream_array
20694 p = fopen("try.out", "w");
20698 # ifdef TRY_FPRINTF
20702 #ifdef TRY_FFLUSH_NULL
20705 #ifdef TRY_FFLUSH_ALL
20707 long open_max = -1;
20708 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
20709 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
20711 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
20712 open_max = sysconf(_SC_OPEN_MAX);
20715 open_max = FOPEN_MAX;
20718 open_max = OPEN_MAX;
20727 # ifdef HAS_STDIO_STREAM_ARRAY
20728 if (open_max > 0) {
20730 for (i = 0; i < open_max; i++)
20731 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
20732 STDIO_STREAM_ARRAY[i]._file < open_max &&
20733 STDIO_STREAM_ARRAY[i]._flag)
20734 fflush(&STDIO_STREAM_ARRAY[i]);
20742 : first we have to find out how _not_ to flush
20744 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
20746 set try -DTRY_FPUTC
20747 if eval $compile; then
20748 $run ./try 2>/dev/null
20751 if $test ! -s try.out -a "X$code" = X42; then
20757 set try -DTRY_FPRINTF
20758 if eval $compile; then
20759 $run ./try 2>/dev/null
20762 if $test ! -s try.out -a "X$code" = X42; then
20763 output=-DTRY_FPRINTF
20769 : check for fflush NULL behavior
20770 case "$fflushNULL" in
20771 '') set try -DTRY_FFLUSH_NULL $output
20772 if eval $compile; then
20773 $run ./try 2>/dev/null
20776 if $test -s try.out -a "X$code" = X42; then
20777 fflushNULL="`$cat try.out`"
20779 if $test "X$code" != X42; then
20781 (If this test failed, don't worry, we'll try another method shortly.)
20786 $rm -f core try.core core.try.*
20787 case "$fflushNULL" in
20789 Your fflush(NULL) works okay for output streams.
20790 Let's see if it clobbers input pipes...
20792 # As of mid-March 2000 all versions of Solaris appear to have a stdio
20793 # bug that improperly flushes the input end of pipes. So we avoid the
20794 # autoflush on fork/system/exec support for now. :-(
20795 $cat >tryp.c <<EOCP
20798 main(int argc, char **argv)
20804 while ((i = getc(stdin)) != -1
20805 && (*bp++ = i) != '\n'
20806 && bp < &buf[1024])
20809 fprintf(stdout, "%s", buf);
20817 fflushNULL="$define"
20819 if eval $compile; then
20821 # Copy the .c file to the remote host ($to is an ssh-alike if targethost is set)
20822 if $test "X$targethost" != X; then
20825 $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
20827 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
20829 if cmp tryp.c tryp.out >/dev/null 2>&1; then
20831 fflush(NULL) seems to behave okay with input streams.
20833 fflushNULL="$define"
20836 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
20838 fflushNULL="$undef"
20841 $rm -f core tryp.c tryp.core core.tryp.*
20844 Your fflush(NULL) isn't working (contrary to ANSI C).
20846 fflushNULL="$undef"
20849 Cannot figure out whether your fflush(NULL) works or not.
20850 I'm assuming it doesn't (contrary to ANSI C).
20852 fflushNULL="$undef"
20856 $define|true|[yY]*)
20857 fflushNULL="$define"
20860 fflushNULL="$undef"
20863 : check explicit looping only if NULL did not work, and if the pipe
20864 : bug does not show up on an explicit flush too
20865 case "$fflushNULL" in
20867 $cat >tryp.c <<EOCP
20870 main(int argc, char **argv)
20876 while ((i = getc(stdin)) != -1
20877 && (*bp++ = i) != '\n'
20878 && bp < &buf[1024])
20881 fprintf(stdout, "%s", buf);
20890 if eval $compile; then
20892 if $test "X$targethost" != X; then
20895 $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
20897 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
20899 if cmp tryp.c tryp.out >/dev/null 2>&1; then
20901 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
20903 : now check for fflushall behaviour
20904 case "$fflushall" in
20905 '') set try -DTRY_FFLUSH_ALL $output
20906 if eval $compile; then
20908 (Now testing the other method--but note that this also may fail.)
20910 $run ./try 2>/dev/null
20913 if $test -s try.out -a "X$code" = X42; then
20914 fflushall="`$cat try.out`"
20918 case "$fflushall" in
20920 Whew. Flushing explicitly all the stdio streams works.
20922 fflushall="$define"
20925 Sigh. Flushing explicitly all the stdio streams doesn't work.
20930 Cannot figure out whether flushing stdio streams explicitly works or not.
20931 I'm assuming it doesn't.
20937 "$define"|true|[yY]*)
20938 fflushall="$define"
20946 All is futile. Even fflush(stdin) clobbers input pipes!
20953 $rm -f core tryp.c tryp.core core.tryp.*
20955 *) fflushall="$undef"
20959 case "$fflushNULL$fflushall" in
20962 OK, I give up. I cannot figure out how to flush pending stdio output.
20963 We won't be flushing handles at all before fork/exec/popen.
20969 : Store the full pathname to the ar program for use in the C program
20970 : Respect a hint or command line value for full_ar.
20975 : Store the full pathname to the sed program for use in the C program
20978 : see what type gids are declared as in the kernel
20980 echo "Looking for the type for group ids returned by getgid()."
20981 set gid_t gidtype xxx stdio.h sys/types.h
20985 xxx=`./findhdr sys/user.h`
20986 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
20988 unsigned) dflt="$1 $2" ;;
20992 *) dflt="$gidtype";;
20995 gid_t) echo "gid_t found." ;;
20996 *) rp="What is the type for group ids returned by getgid()?"
21002 : Check the size of GID
21005 *_t) zzz="$gidtype" ;;
21008 echo "Checking the size of $zzz..." >&4
21010 #include <sys/types.h>
21012 #$i_stdlib I_STDLIB
21014 #include <stdlib.h>
21017 printf("%d\n", (int)sizeof($gidtype));
21022 if eval $compile_ok; then
21026 echo "(I can't execute the test program--guessing $gidsize.)" >&4
21029 echo "Your $zzz is $gidsize bytes long."
21034 echo "(I can't compile the test program--guessing $gidsize.)" >&4
21037 : Check if GID is signed
21040 *_t) zzz="$gidtype" ;;
21043 echo "Checking the sign of $zzz..." >&4
21045 #include <sys/types.h>
21056 if eval $compile; then
21060 echo "(I can't execute the test program--guessing unsigned.)" >&4
21064 1) echo "Your $zzz is unsigned." ;;
21065 -1) echo "Your $zzz is signed." ;;
21071 echo "(I can't compile the test program--guessing unsigned.)" >&4
21074 : Check 64bit sizes
21077 if $test X"$quadtype" != X; then
21079 echo "Checking how to print 64-bit integers..." >&4
21081 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
21082 $cat >try.c <<'EOCP'
21083 #include <sys/types.h>
21086 int q = 12345678901;
21087 printf("%ld\n", q);
21091 if eval $compile; then
21095 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
21096 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
21097 echo "We will use %d."
21103 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
21104 $cat >try.c <<'EOCP'
21105 #include <sys/types.h>
21108 long q = 12345678901;
21109 printf("%ld\n", q);
21113 if eval $compile; then
21117 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
21118 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
21119 echo "We will use %ld."
21125 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
21126 $cat >try.c <<'EOCP'
21127 #include <sys/types.h>
21128 #include <inttypes.h>
21131 int64_t q = 12345678901;
21132 printf("%" PRId64 "\n", q);
21136 if eval $compile; then
21140 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
21141 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
21142 echo "We will use the C9X style."
21148 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
21150 #include <sys/types.h>
21153 $quadtype q = 12345678901;
21154 printf("%Ld\n", q);
21158 if eval $compile; then
21162 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
21163 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
21164 echo "We will use %Ld."
21170 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
21171 $cat >try.c <<'EOCP'
21172 #include <sys/types.h>
21175 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
21176 printf("%lld\n", q);
21180 if eval $compile; then
21184 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
21185 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
21186 echo "We will use the %lld style."
21192 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
21194 #include <sys/types.h>
21197 $quadtype q = 12345678901;
21198 printf("%qd\n", q);
21202 if eval $compile; then
21206 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
21207 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
21208 echo "We will use %qd."
21214 if $test X"$sPRId64" = X; then
21215 echo "Cannot figure out how to print 64-bit integers." >&4
21222 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
21223 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
21225 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
21226 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
21230 : Check format strings for internal types
21232 $echo "Checking the format strings to be used for Perl's internal types..." >&4
21234 if $test X"$ivsize" = X8; then
21235 ivdformat="$sPRId64"
21236 uvuformat="$sPRIu64"
21237 uvoformat="$sPRIo64"
21238 uvxformat="$sPRIx64"
21239 uvXUformat="$sPRIXU64"
21241 if $test X"$ivsize" = X"$longsize"; then
21248 if $test X"$ivsize" = X"$intsize"; then
21256 if $test X"$ivsize" = X"$shortsize"; then
21267 if $test X"$usequadmath" = X"$define"; then
21275 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
21276 nveformat="$sPRIeldbl"
21277 nvfformat="$sPRIfldbl"
21278 nvgformat="$sPRIgldbl"
21279 nvEUformat="$sPRIEUldbl"
21280 nvFUformat="$sPRIFUldbl"
21281 nvGUformat="$sPRIGUldbl"
21292 case "$ivdformat" in
21293 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
21298 : Check format string for GID
21301 $echo "Checking the format string to be used for gids..." >&4
21304 -1) if $test X"$gidsize" = X"$ivsize"; then
21305 gidformat="$ivdformat"
21307 if $test X"$gidsize" = X"$longsize"; then
21310 if $test X"$gidsize" = X"$intsize"; then
21313 if $test X"$gidsize" = X"$shortsize"; then
21320 *) if $test X"$gidsize" = X"$uvsize"; then
21321 gidformat="$uvuformat"
21323 if $test X"$gidsize" = X"$longsize"; then
21326 if $test X"$gidsize" = X"$intsize"; then
21329 if $test X"$gidsize" = X"$shortsize"; then
21338 : see if getgroups exists
21339 set getgroups d_getgrps
21342 : see if setgroups exists
21343 set setgroups d_setgrps
21346 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
21348 case "$d_getgrps$d_setgrps" in
21350 case "$groupstype" in
21351 '') dflt="$gidtype" ;;
21352 *) dflt="$groupstype" ;;
21355 What type of pointer is the second argument to getgroups() and setgroups()?
21356 Usually this is the same as group ids, $gidtype, but not always.
21359 rp='What type pointer is the second argument to getgroups() and setgroups()?'
21363 *) groupstype="$gidtype";;
21366 : check whether make sets MAKE
21368 echo "Checking if your $make program sets \$(MAKE)..." >&4
21369 case "$make_set_make" in
21371 $sed 's/^X //' > testmake.mak << 'EOF'
21373 X @echo 'maketemp="$(MAKE)"'
21375 case "`$make -f testmake.mak 2>/dev/null`" in
21376 *maketemp=*) make_set_make='#' ;;
21377 *) make_set_make="MAKE=$make" ;;
21379 $rm -f testmake.mak
21382 case "$make_set_make" in
21383 '#') echo "Yup, it does.";;
21384 *) echo "Nope, it doesn't.";;
21387 : see what type is used for mode_t
21388 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
21389 set mode_t modetype int stdio.h sys/types.h
21392 : see if we need va_copy
21395 #include <stdarg.h>
21397 #include <stdlib.h>
21398 #include <signal.h>
21401 ivfprintf(FILE *f, const char *fmt, va_list *valp)
21403 return vfprintf(f, fmt, *valp);
21407 myvfprintf(FILE *f, const char *fmt, va_list val)
21409 return ivfprintf(f, fmt, &val);
21413 myprintf(char *fmt, ...)
21416 va_start(val, fmt);
21417 return myvfprintf(stdout, fmt, val);
21421 main(int ac, char **av)
21423 signal(SIGSEGV, exit);
21425 myprintf("%s%cs all right, then\n", "that", '\'');
21430 if eval $compile && $run ./try 2>&1 >/dev/null; then
21431 case "`$run ./try`" in
21432 "that's all right, then")
21438 yes) echo "It seems that you don't need va_copy()." >&4
21439 need_va_copy="$undef"
21441 *) echo "It seems that va_copy() or similar will be needed." >&4
21442 need_va_copy="$define"
21447 : see what type is used for size_t
21448 rp="What is the type used for the length parameter for string functions?"
21449 set size_t sizetype 'unsigned int' stdio.h sys/types.h
21452 : check for type of arguments to gethostbyaddr.
21453 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
21454 case "$d_gethbyaddr" in
21458 Checking to see what type of arguments are accepted by gethostbyaddr().
21460 hdrs="$define sys/types.h
21461 $d_socket sys/socket.h
21462 $i_niin netinet/in.h
21464 $i_unistd unistd.h"
21465 : The first arg can 'char *' or 'void *'
21466 : The second arg is some of integral type
21467 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
21468 for yyy in size_t long int; do
21469 case "$netdb_host_type" in
21470 '') try="$extern_C struct hostent *gethostbyaddr($xxx, $yyy, int);"
21471 if ./protochk "$try" $hdrs; then
21472 echo "Your system accepts $xxx for the first arg."
21473 echo "...and $yyy for the second arg."
21474 netdb_host_type="$xxx"
21475 netdb_hlen_type="$yyy"
21481 : In case none of those worked, prompt the user.
21482 case "$netdb_host_type" in
21483 '') rp='What is the type for the 1st argument to gethostbyaddr?'
21486 netdb_host_type=$ans
21487 rp='What is the type for the 2nd argument to gethostbyaddr?'
21490 netdb_hlen_type=$ans
21494 *) : no gethostbyaddr, so pick harmless defaults
21495 netdb_host_type='char *'
21496 netdb_hlen_type="$sizetype"
21499 # Remove the "const" if needed. -- but then we'll have a
21501 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
21504 : check for type of argument to gethostbyname.
21505 if test "X$netdb_name_type" = X ; then
21506 case "$d_gethbyname" in
21510 Checking to see what type of argument is accepted by gethostbyname().
21512 hdrs="$define sys/types.h
21513 $d_socket sys/socket.h
21514 $i_niin netinet/in.h
21516 $i_unistd unistd.h"
21517 for xxx in "const char *" "char *"; do
21518 case "$netdb_name_type" in
21519 '') try="$extern_C struct hostent *gethostbyname($xxx);"
21520 if ./protochk "$try" $hdrs; then
21521 echo "Your system accepts $xxx."
21522 netdb_name_type="$xxx"
21527 : In case none of those worked, prompt the user.
21528 case "$netdb_name_type" in
21529 '') rp='What is the type for the 1st argument to gethostbyname?'
21532 netdb_name_type=$ans
21536 *) : no gethostbyname, so pick harmless default
21537 netdb_name_type='char *'
21542 : check for type of 1st argument to getnetbyaddr.
21543 if test "X$netdb_net_type" = X ; then
21544 case "$d_getnbyaddr" in
21548 Checking to see what type of 1st argument is accepted by getnetbyaddr().
21550 hdrs="$define sys/types.h
21551 $d_socket sys/socket.h
21552 $i_niin netinet/in.h
21554 $i_unistd unistd.h"
21555 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
21556 case "$netdb_net_type" in
21557 '') try="$extern_C struct netent *getnetbyaddr($xxx, int);"
21558 if ./protochk "$try" $hdrs; then
21559 echo "Your system accepts $xxx."
21560 netdb_net_type="$xxx"
21565 : In case none of those worked, prompt the user.
21566 case "$netdb_net_type" in
21567 '') rp='What is the type for the 1st argument to getnetbyaddr?'
21570 netdb_net_type=$ans
21574 *) : no getnetbyaddr, so pick harmless default
21575 netdb_net_type='long'
21579 : locate the preferred pager for this system
21586 [a-zA-Z]:/*) dflt=$pg;;
21590 [a-zA-Z]:/*) dflt=$more;;
21594 [a-zA-Z]:/*) dflt=$less;;
21597 '') dflt=/usr/ucb/more;;
21605 rp='What pager is used on your system?'
21609 : see if ar generates random libraries by itself
21611 echo "Checking how to generate random libraries on your machine..." >&4
21612 echo 'int bar1() { return bar2(); }' > bar1.c
21613 echo 'int bar2() { return 2; }' > bar2.c
21615 #$i_stdlib I_STDLIB
21617 #include <stdlib.h>
21619 int main() { printf("%d\n", bar1()); exit(0); }
21621 $cc $ccflags -c bar1.c >/dev/null 2>&1
21622 $cc $ccflags -c bar2.c >/dev/null 2>&1
21623 $cc $ccflags -c foo.c >/dev/null 2>&1
21624 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
21625 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
21626 $run ./foobar >/dev/null 2>&1; then
21627 echo "$ar appears to generate random libraries itself."
21629 if [ "X$ranlib" = "X" ]; then
21632 elif $ar s bar$_a >/dev/null 2>&1 &&
21633 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
21634 $run ./foobar >/dev/null 2>&1; then
21635 echo "a table of contents needs to be added with '$ar s'."
21638 elif $ar ts bar$_a >/dev/null 2>&1 &&
21639 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
21640 $run ./foobar >/dev/null 2>&1; then
21641 echo "a table of contents needs to be added with '$ar ts'."
21648 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
21649 $test -f $ranlib || ranlib=''
21652 if $test -n "$ranlib"; then
21653 echo "your system has '$ranlib'; we'll use that."
21656 echo "your system doesn't seem to support random libraries"
21657 echo "so we'll use lorder and tsort to order the libraries."
21664 : Check the max offset that gmtime and localtime accept
21665 echo "Checking max offsets that gmtime () accepts"
21667 case "$sGMTIME_min/$sGMTIME_max" in
21670 #include <sys/types.h>
21678 void gm_check (time_t t, int min_year, int max_year)
21681 if ( tmp == NULL ||
21682 /* Check tm_year overflow */
21683 tmp->tm_year < min_year || tmp->tm_year > max_year)
21694 gm_check (MAXLONG, 69, 0x7fffffff);
21696 if (tmp == NULL || tmp->tm_year < 0) {
21697 for (i = 63; i >= 0; i--) {
21698 time_t x = pt | ((time_t)1 << i);
21699 if (x < 0 || x < pt) continue;
21700 gm_check (x, 69, 0x7fffffff);
21703 printf ("sGMTIME_max=%ld\n", pt);
21712 gm_check (MINLONG, -1900, 70);
21715 for (i = 36; i >= 0; i--) {
21716 time_t x = pt - ((time_t)1 << i);
21717 if (x > 0) continue;
21718 gm_check (x, -1900, 70);
21721 printf ("sGMTIME_min=%ld\n", pt);
21725 int main (int argc, char *argv[])
21727 /* fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t)); */
21734 if eval $compile; then
21735 eval `$run ./try 2>/dev/null`
21737 echo "Cannot determine sGMTIME_max and sGMTIME_min." >&4
21743 echo "Checking max offsets that localtime () accepts"
21745 case "$sLOCALTIME_min/$sLOCALTIME_max" in
21748 #include <sys/types.h>
21756 void local_check (time_t t, int min_year, int max_year)
21758 if (sizeof (time_t) > 4 && t > 0x7ffffffffffff000LL)
21761 tmp = localtime (&t);
21762 if ( tmp == NULL ||
21763 /* Check tm_year overflow */
21764 tmp->tm_year < min_year || tmp->tm_year > max_year)
21768 } /* local_check */
21775 local_check (MAXLONG, 69, 0x7fffffff);
21777 if (tmp == NULL || tmp->tm_year < 0) {
21778 for (i = 63; i >= 0; i--) {
21779 time_t x = pt | ((time_t)1 << i);
21780 if (x < 0 || x < pt) continue;
21781 local_check (x, 69, 0x7fffffff);
21784 printf ("sLOCALTIME_max=%ld\n", pt);
21793 local_check (MINLONG, -1900, 70);
21796 for (i = 36; i >= 0; i--) {
21797 time_t x = pt - ((time_t)1 << i);
21798 if (x > 0) continue;
21799 local_check (x, -1900, 70);
21802 printf ("sLOCALTIME_min=%ld\n", pt);
21806 int main (int argc, char *argv[])
21814 if eval $compile; then
21815 eval `$run ./try 2>/dev/null`
21817 echo "Cannot determine sLOCALTIME_max and sLOCALTIME_min." >&4
21823 : check for type of arguments to select.
21824 case "$selecttype" in
21825 '') case "$d_select" in
21829 Checking to see what type of arguments are accepted by select().
21831 hdrs="$define sys/types.h
21832 $i_systime sys/time.h
21833 $i_sysselct sys/select.h
21834 $d_socket sys/socket.h"
21835 : The first arg can be int, unsigned, or size_t
21836 : The last arg may or may not be 'const'
21838 : void pointer has been seen but using that
21839 : breaks the selectminbits test
21840 for xxx in 'fd_set *' 'int *'; do
21841 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
21842 for tmo in 'struct timeval *' 'const struct timeval *'; do
21844 '') try="$extern_C select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
21845 if ./protochk "$try" $hdrs; then
21846 echo "Your system accepts $xxx."
21855 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
21856 case "$d_fd_set" in
21857 $define) dflt="fd_set *" ;;
21866 *) : no select, so pick a harmless default
21873 : check for the select 'width'
21874 case "$selectminbits" in
21875 '') safebits=`expr $ptrsize \* 8`
21876 case "$d_select" in
21880 Checking to see on how many bits at a time your select() operates...
21883 #include <sys/types.h>
21885 #$i_systime I_SYS_TIME
21886 #$i_systimek I_SYS_TIME_KERNEL
21891 # ifdef I_SYS_TIME_KERNEL
21894 # include <sys/time.h>
21895 # ifdef I_SYS_TIME_KERNEL
21899 #$i_sysselct I_SYS_SELECT
21900 #ifdef I_SYS_SELECT
21901 #include <sys/select.h>
21903 #$d_socket HAS_SOCKET
21905 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
21908 #$i_stdlib I_STDLIB
21910 #include <stdlib.h>
21913 #define S sizeof(*(b))
21915 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
21916 #define NBITS (NBYTES * 8)
21918 char *s = (char *)malloc(NBYTES);
21927 fp = fopen("try.c", "r");
21933 b = ($selecttype)s;
21934 for (i = 0; i < NBITS; i++)
21938 select(fd + 1, b, 0, 0, &t);
21939 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
21941 printf("%d\n", i + 1);
21946 if eval $compile_ok; then
21947 selectminbits=`$run ./try 2>/dev/null`
21948 case "$selectminbits" in
21950 Cannot figure out on how many bits at a time your select() operates.
21951 I'll play safe and guess it is $safebits bits.
21953 selectminbits=$safebits
21954 bits="$safebits bits"
21957 *) bits="$selectminbits bits" ;;
21959 echo "Your select() operates on $bits at a time." >&4
21961 rp='What is the minimum number of bits your select() operates on?'
21962 case "$byteorder" in
21963 12345678) dflt=64 ;;
21969 selectminbits="$val"
21973 *) : no select, so pick a harmless default
21974 selectminbits=$safebits
21980 : Trace out the files included by signal.h, then look for SIGxxx names.
21981 case "$sig_num_init" in
21983 if [ "X$fieldn" = X ]; then
21984 : Just make some guesses. We check them later.
21985 xxx="$sysroot/usr/include/signal.h $sysroot/usr/include/sys/signal.h"
21987 xxx=`echo '#include <signal.h>' |
21988 $cppstdin $cppminus $cppflags 2>/dev/null |
21989 $grep '^[ ]*#.*include' |
21990 $awk "{print \\$$fieldn}" | $sed 's!"!!g' |\
21991 $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
21994 for xx in $xxx /dev/null ; do
21995 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
21997 case "$xxxfiles" in
21998 '') xxxfiles=`./findhdr signal.h` ;;
22001 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
22002 print substr($2, 4, 20)
22004 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
22005 print substr($3, 4, 20)
22007 : Append some common names just in case the awk scan failed.
22008 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
22009 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
22010 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
22011 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
22012 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
22014 : generate a few handy files for later
22015 $cat > signal.c <<EOCP
22016 #include <sys/types.h>
22017 #include <signal.h>
22018 #$i_stdlib I_STDLIB
22020 #include <stdlib.h>
22025 /* Strange style to avoid deeply-nested #if/#else/#endif */
22028 # define NSIG (_NSIG)
22034 # define NSIG (SIGMAX+1)
22040 # define NSIG (SIG_MAX+1)
22046 # define NSIG (_SIG_MAX+1)
22052 # define NSIG (MAXSIG+1)
22058 # define NSIG (MAX_SIG+1)
22063 # ifdef SIGARRAYSIZE
22064 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
22070 # define NSIG (_sys_nsig) /* Solaris 2.5 */
22074 /* Default to some arbitrary number that's big enough to get most
22075 of the common signals.
22081 printf("NSIG %d\n", NSIG);
22087 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
22089 printf "#ifdef SIG"; printf $1; printf "\n"
22090 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
22091 printf $1; printf ");\n"
22095 printf "#endif /* JUST_NSIG */\n";
22096 printf "exit(0);\n}\n";
22099 $cat >signal.awk <<'EOP'
22100 BEGIN { ndups = 0 }
22101 $1 ~ /^NSIG$/ { nsig = $2 }
22102 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
22103 if ($2 > maxsig) { maxsig = $2 }
22104 if (sig_name[$2]) {
22105 dup_name[ndups] = $1
22106 dup_num[ndups] = $2
22118 printf("NSIG %d\n", nsig);
22119 for (n = 1; n < nsig; n++) {
22121 printf("%s %d\n", sig_name[n], sig_num[n])
22124 printf("NUM%d %d\n", n, n)
22127 for (n = 0; n < ndups; n++) {
22128 printf("%s %d\n", dup_name[n], dup_num[n])
22132 $cat >signal_cmd <<EOS
22134 if $test -s signal.lst; then
22135 echo "Using your existing signal.lst file"
22140 $cat >>signal_cmd <<'EOS'
22143 if eval $compile_ok; then
22144 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) |\
22145 $uniq | $awk -f signal.awk >signal.lst
22147 echo "(I can't seem be able to compile the whole test program)" >&4
22148 echo "(I'll try it in little pieces.)" >&4
22149 set signal -DJUST_NSIG
22150 if eval $compile_ok; then
22151 $run ./signal$_exe > signal.nsg
22154 echo "I can't seem to figure out how many signals you have." >&4
22155 echo "Guessing 50." >&4
22156 echo 'NSIG 50' > signal.nsg
22158 : Now look at all the signal names, one at a time.
22159 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
22160 $cat > signal.c <<EOCP
22161 #include <sys/types.h>
22162 #include <signal.h>
22165 printf("$xx %d\n", SIG${xx});
22170 if eval $compile; then
22171 echo "SIG${xx} found."
22172 $run ./signal$_exe >> signal.ls1
22174 echo "SIG${xx} NOT found."
22177 if $test -s signal.ls1; then
22178 $cat signal.nsg signal.ls1 |
22179 $sort -n | $uniq | $awk -f signal.awk >signal.lst
22183 if $test -s signal.lst; then
22186 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
22187 echo 'kill -l' >signal
22188 set X `csh -f <signal`
22192 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
22194 echo $@ | $tr ' ' $trnl | \
22195 $awk '{ printf "%s %d\n", $1, ++s; }
22196 END { printf "NSIG %d\n", ++s }' >signal.lst
22198 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
22200 chmod a+x signal_cmd
22201 $eunicefix signal_cmd
22205 : generate list of signal names
22206 case "$sig_num_init" in
22209 case "$sig_name_init" in
22211 *) case "$sig_num_init" in
22212 ''|*,*) doinit=yes ;;
22217 echo "Generating a list of signal names and numbers..." >&4
22219 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
22220 sig_name=`$awk 'BEGIN { printf "ZERO " }
22221 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
22222 sig_num=`$awk 'BEGIN { printf "0 " }
22223 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
22224 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
22225 !/^NSIG/ { printf "\"%s\", ", $1 }
22226 END { printf "0\n" }' signal.lst`
22227 sig_num_init=`$awk 'BEGIN { printf "0, " }
22228 !/^NSIG/ { printf "%d, ", $2}
22229 END { printf "0\n"}' signal.lst`
22232 echo "The following $sig_count signals are available:"
22234 echo $sig_name | $awk \
22235 'BEGIN { linelen = 0 }
22237 for (i = 1; i <= NF; i++) {
22238 name = "SIG" $i " "
22239 linelen = linelen + length(name)
22240 if (linelen > 70) {
22242 linelen = length(name)
22248 sig_size=`echo $sig_name | awk '{print NF}'`
22249 $rm -f signal signal.c signal.awk signal.lst signal_cmd
22253 : Check size of size
22255 case "$sizetype" in
22256 *_t) zzz="$sizetype" ;;
22257 *) zzz="filesize" ;;
22259 echo "Checking the size of $zzz..." >&4
22261 #include <sys/types.h>
22263 #$i_stdlib I_STDLIB
22265 #include <stdlib.h>
22268 printf("%d\n", (int)sizeof($sizetype));
22273 if eval $compile_ok; then
22277 echo "(I can't execute the test program--guessing $sizesize.)" >&4
22280 echo "Your $zzz size is $sizesize bytes."
22285 echo "(I can't compile the test program--guessing $sizesize.)" >&4
22288 : check for socklen_t
22290 echo "Checking to see if you have socklen_t..." >&4
22292 #include <sys/types.h>
22293 #$d_socket HAS_SOCKET
22295 #include <sys/socket.h>
22297 int main() { socklen_t x = 16; }
22300 if eval $compile; then
22302 echo "You have socklen_t."
22305 echo "You do not have socklen_t."
22306 case "$sizetype" in
22307 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
22314 : see if this is a socks.h system
22315 set socks.h i_socks
22318 : check for type of the size argument to socket calls
22319 case "$d_socket" in
22323 Checking to see what type is the last argument of accept().
22326 case "$d_socklen_t" in
22327 "$define") yyy="$yyy socklen_t"
22329 yyy="$yyy $sizetype int long unsigned"
22330 for xxx in $yyy; do
22331 case "$socksizetype" in
22332 '') try="$extern_C int accept(int, struct sockaddr *, $xxx *);"
22333 case "$usesocks" in
22335 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
22336 echo "Your system accepts '$xxx *' for the last argument of accept()."
22337 socksizetype="$xxx"
22340 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
22341 echo "Your system accepts '$xxx *' for the last argument of accept()."
22342 socksizetype="$xxx"
22349 : In case none of those worked, prompt the user.
22350 case "$socksizetype" in
22351 '') rp='What is the type for socket address structure sizes?'
22358 *) : no sockets, so pick relatively harmless default
22363 : see what type is used for signed size_t
22364 set ssize_t ssizetype int stdio.h sys/types.h
22369 #$i_stdlib I_STDLIB
22371 #include <stdlib.h>
22373 #include <sys/types.h>
22374 #define Size_t $sizetype
22375 #define SSize_t $dflt
22378 if (sizeof(Size_t) == sizeof(SSize_t))
22380 else if (sizeof(Size_t) == sizeof(int))
22389 if eval $compile_ok && $run ./try > /dev/null; then
22390 ssizetype=`$run ./try`
22391 echo "I'll be using $ssizetype for functions returning a byte count." >&4
22394 Help! I can't compile and run the ssize_t test program: please enlighten me!
22395 (This is probably a misconfiguration in your system or libraries, and
22396 you really ought to fix it. Still, I'll try anyway.)
22398 I need a type that is the same size as $sizetype, but is guaranteed to
22399 be signed. Common values are ssize_t, int and long.
22402 rp="What signed type is the same size as $sizetype?"
22408 : Check the size of st_ino
22410 $echo "Checking the size of st_ino..." >&4
22411 $cat > try.c <<EOCP
22412 #include <sys/stat.h>
22414 #$i_stdlib I_STDLIB
22416 #include <stdlib.h>
22420 printf("%d\n", (int)sizeof(st.st_ino));
22425 if eval $compile_ok; then
22429 $echo "(I can't execute the test program--guessing $st_ino_size.)" >&4
22431 *) st_ino_size=$val
22432 $echo "Your st_ino is $st_ino_size bytes long."
22437 $echo "(I can't compile the test program--guessing $st_ino_size.)" >&4
22441 : Check if st_ino is signed
22443 $echo "Checking the sign of st_ino..." >&4
22444 $cat > try.c <<EOCP
22445 #include <sys/stat.h>
22450 if (foo.st_ino < 0)
22457 if eval $compile; then
22461 $echo "(I can't execute the test program--guessing unsigned.)" >&4
22463 *) st_ino_sign=$val
22464 case "$st_ino_sign" in
22465 1) $echo "Your st_ino is unsigned." ;;
22466 -1) $echo "Your st_ino is signed." ;;
22472 $echo "(I can't compile the test program--guessing unsigned.)" >&4
22476 : see what type of char stdio uses.
22478 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
22479 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
22480 echo "Your stdio uses unsigned chars." >&4
22481 stdchar="unsigned char"
22483 echo "Your stdio uses signed chars." >&4
22488 : Check size of UID
22491 *_t) zzz="$uidtype" ;;
22494 echo "Checking the size of $zzz..." >&4
22496 #include <sys/types.h>
22498 #$i_stdlib I_STDLIB
22500 #include <stdlib.h>
22503 printf("%d\n", (int)sizeof($uidtype));
22508 if eval $compile_ok; then
22512 echo "(I can't execute the test program--guessing $uidsize.)" >&4
22515 echo "Your $zzz is $uidsize bytes long."
22520 echo "(I can't compile the test program--guessing $uidsize.)" >&4
22523 : Check if UID is signed
22526 *_t) zzz="$uidtype" ;;
22529 echo "Checking the sign of $zzz..." >&4
22531 #include <sys/types.h>
22542 if eval $compile; then
22546 echo "(I can't execute the test program--guessing unsigned.)" >&4
22550 1) echo "Your $zzz is unsigned." ;;
22551 -1) echo "Your $zzz is signed." ;;
22557 echo "(I can't compile the test program--guessing unsigned.)" >&4
22560 : Check format string for UID
22562 $echo "Checking the format string to be used for uids..." >&4
22565 -1) if $test X"$uidsize" = X"$ivsize"; then
22566 uidformat="$ivdformat"
22568 if $test X"$uidsize" = X"$longsize"; then
22571 if $test X"$uidsize" = X"$intsize"; then
22574 if $test X"$uidsize" = X"$shortsize"; then
22581 *) if $test X"$uidsize" = X"$uvsize"; then
22582 uidformat="$uvuformat"
22584 if $test X"$uidsize" = X"$longsize"; then
22587 if $test X"$uidsize" = X"$intsize"; then
22590 if $test X"$uidsize" = X"$shortsize"; then
22599 : Determine if we can use sysctl with KERN_PROC_PATHNAME to find executing program
22601 echo "Determining whether we can use sysctl with KERN_PROC_PATHNAME to find executing program..." >&4
22602 $cat >try.c <<'EOM'
22603 /* Intentionally a long probe as I'd like to sanity check that the exact
22604 approach is going to work, as thinking it will work, but only having it
22605 part working at runtime is worse than not having it. */
22607 #include <sys/types.h>
22608 #include <sys/sysctl.h>
22609 #include <sys/param.h>
22611 #include <string.h>
22612 #include <stdlib.h>
22613 #include <unistd.h>
22616 main(int argc, char **argv) {
22618 char *argv_leaf = strrchr(argv[0], '/');
22624 mib[1] = KERN_PROC;
22625 mib[2] = KERN_PROC_PATHNAME;
22629 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
22633 if (sysctl(mib, 4, NULL, &size, NULL, 0)) {
22638 if (size < strlen(argv_leaf) + 1) {
22639 fprintf(stderr, "size %lu is too short for a path\n",
22640 (unsigned long) size);
22644 if (size > MAXPATHLEN * MAXPATHLEN) {
22645 fprintf(stderr, "size %lu is too long for a path\n",
22646 (unsigned long) size);
22650 buffer = (char *)malloc(size);
22656 if (sysctl(mib, 4, buffer, &size, NULL, 0)) {
22661 if (strlen(buffer) + 1 != size) {
22662 fprintf(stderr, "size != strlen(buffer) + 1 (%lu != %lu)\n",
22663 (unsigned long)size, (unsigned long)strlen(buffer) + 1);
22668 if (*buffer != '/') {
22669 fprintf(stderr, "Not an absolute path: '%s'\n", buffer);
22673 if (strstr(buffer, "/./")) {
22674 fprintf(stderr, "Contains /./: '%s'\n", buffer);
22678 if (strstr(buffer, "/../")) {
22679 fprintf(stderr, "Contains /../: '%s'\n", buffer);
22683 buffer_leaf = strrchr(buffer, '/');
22684 if (strcmp(buffer_leaf, argv_leaf) != 0) {
22685 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], buffer);
22697 if eval $compile; then
22698 if $run ./try; then
22699 echo "You can use sysctl with KERN_PROC_PATHNAME to find the executing program." >&4
22702 echo "Nope, sysctl with KERN_PROC_PATHNAME doesn't work here." >&4
22706 echo "I'm unable to compile the test program." >&4
22707 echo "I'll assume no sysctl with KERN_PROC_PATHNAME here." >&4
22711 set usekernprocpathname
22714 : Determine if we can use _NSGetExecutablePath to find executing program
22716 echo "Determining whether we can use _NSGetExecutablePath to find executing program..." >&4
22717 $cat >try.c <<'EOM'
22718 /* Intentionally a long probe as I'd like to sanity check that the exact
22719 approach is going to work, as thinking it will work, but only having it
22720 part working at runtime is worse than not having it. */
22721 #include <mach-o/dyld.h>
22723 #include <stdlib.h>
22724 #include <sys/param.h>
22725 #include <string.h>
22728 main(int argc, char **argv) {
22730 uint32_t size = sizeof(buf);
22734 char *argv_leaf = strrchr(argv[0], '/');
22738 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
22742 _NSGetExecutablePath(buf, &size);
22743 if (size > MAXPATHLEN * MAXPATHLEN) {
22744 fprintf(stderr, "_NSGetExecutablePath size %u is too long for a path\n",
22745 (unsigned int) size);
22749 buffer = (char *)malloc(size);
22755 result = _NSGetExecutablePath(buffer, &size);
22757 fprintf(stderr, "_NSGetExecutablePath returned %i for a size of %u\n",
22758 result, (unsigned int) size);
22762 tidied = realpath(buffer, NULL);
22764 perror("realpath");
22770 if (*tidied != '/') {
22771 fprintf(stderr, "Not an absolute path: '%s'\n", tidied);
22775 if (strstr(tidied, "/./")) {
22776 fprintf(stderr, "Contains /./: '%s'\n", tidied);
22780 if (strstr(tidied, "/../")) {
22781 fprintf(stderr, "Contains /../: '%s'\n", tidied);
22785 tidied_leaf = strrchr(tidied, '/');
22786 if (strcmp(tidied_leaf, argv_leaf) != 0) {
22787 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], tidied);
22799 if eval $compile; then
22800 if $run ./try; then
22801 echo "You can use _NSGetExecutablePath to find the executing program." >&4
22804 echo "Nope, _NSGetExecutablePath doesn't work here." >&4
22807 echo "I'm unable to compile the test program." >&4
22808 echo "I'll assume no _NSGetExecutablePath here." >&4
22811 set usensgetexecutablepath
22814 : Check if site customization support was requested
22815 case "$usesitecustomize" in
22816 $define|true|[Yy]*)
22817 usesitecustomize="$define"
22820 usesitecustomize="$undef"
22824 : determine compiler compiler
22833 if $test -f "$byacc$_exe"; then
22835 comp="byacc or $comp"
22837 if $test -f "$bison$_exe"; then
22838 comp="$comp or bison -y"
22840 rp="Which compiler compiler ($comp) shall I use?"
22849 echo "(Adding -y option to bison to get yacc-compatible behavior.)"
22855 : see if this is a bfd.h system
22859 : see if this is an execinfo.h system
22860 set execinfo.h i_execinfo
22863 : see if this is a fenv.h system
22867 : see if this is a fp.h system
22871 : see if this is a fp_class.h system
22872 set fp_class.h i_fp_class
22875 : see if gdbm.h is available
22880 : see if gdbm_open exists
22881 set gdbm_open d_gdbm_open
22883 case "$d_gdbm_open" in
22886 echo "We won't be including <gdbm.h>"
22895 : see if this is a ieeefp.h system
22896 case "$i_ieeefp" in
22897 '' ) set ieeefp.h i_ieeefp
22902 : see if this is a libutil.h system
22903 set libutil.h i_libutil
22906 : see if mach cthreads are available
22907 if test "X$usethreads" = "X$define"; then
22908 set mach/cthreads.h i_machcthr
22911 i_machcthr="$undef"
22914 : see if this is a mntent.h system
22915 set mntent.h i_mntent
22918 : see if net/errno.h is available
22920 set net/errno.h val
22923 : Unfortunately, it causes problems on some systems. Arrgh.
22926 cat > try.c <<'EOM'
22929 #include <net/errno.h>
22935 if $cc $ccflags -c try.c >/dev/null 2>&1; then
22936 echo "We'll be including <net/errno.h>." >&4
22938 echo "We won't be including <net/errno.h>." >&4
22947 : see if netinet/tcp.h is available
22948 set netinet/tcp.h i_netinettcp
22951 : see if this is a poll.h system
22955 : see if this is a prot.h system
22959 : Preprocessor symbols
22961 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
22962 $cat <<'EOSH' > Cppsym.know
22963 a29k aarch64 ABI64 aegis AES_SOURCE AIX AIX32 AIX370 AIX41 AIX42
22964 AIX43 aixpc AIX_SOURCE alliant ALL_SOURCE alpha AM29000 am29000
22965 AMD64 amd64 amiga AMIGAOS AMIX ansi ANSI_C_SOURCE apollo arch_ppc
22966 arch_pwr ardent ARM ARM32 atarist att386 att3b
22967 BeOS BIG_ENDIAN BIT_MSF BSD bsd bsd43 bsd4_2 BSD4_3 bsd4_3 bsd4_4
22968 BSDCOMPAT bsdi BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES bull
22969 byteorder byte_order
22970 c cadmus clang clipper CMU COFF COMPILER_VERSION concurrent
22971 convex cpu CRAY cray CRAYMPP ctix CX_UX CYGWIN
22972 DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO Dynix DynixPTX
22973 ELF encore EPI EXTENSIONS
22974 FAVOR_BSD FILE_OFFSET_BITS FORTIFY_SOURCE FreeBSD
22975 GCC_NEW_VARARGS gcos gcx gimpel GLIBC GLIBC_MINOR GNUC GNUC_MINOR
22976 GNU_LIBRARY GNU_SOURCE GO32 gould GOULD_PN
22977 H3050R H3050RX hbullx20 hcx host_mips hp200 hp300 HP700 hp700
22978 hp800 hp9000 hp9000s200 hp9000s300 hp9000s400
22979 hp9000s700 hp9000s800 hp9k8 hppa hpux HPUX_SOURCE hp_osf
22980 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960 IA32 IA64
22981 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
22982 INLINE_INTRINSICS INT64 INTEL interdata INTRINSICS is68k itanium
22984 LANGUAGE_C LARGEFILE64_SOURCE LARGEFILE_SOURCE LARGE_FILE_API
22985 LFS64_LARGEFILE LFS_LARGEFILE LIBCATAMOUNT Linux LITTLE_ENDIAN
22986 LONG64 LONGDOUBLE LONGLONG LONG_DOUBLE LONG_LONG LP64 luna
22988 M68000 m68k m88100 m88k M88KBCS_TARGET MACH machine MachTen
22989 MATH_HAS_NO_SIDE_EFFECTS mc300 mc500 mc68000 mc68010 mc68020
22990 mc68030 mc68040 mc68060 mc68k mc68k32 mc700 mc88000 mc88100
22991 merlin mert MiNT mips MIPSEB MIPSEL MIPS_FPSET MIPS_ISA MIPS_SIM
22992 MIPS_SZINT MIPS_SZLONG MIPS_SZPTR MODERN_C motorola MSDOS
22993 MTXINU MULTIMAX MVS mvs M_AMD64 M_ARM M_ARMT M_COFF M_I186 M_I286
22994 M_I386 M_I8086 M_I86 M_I86SM M_IA64 M_IX86 M_PPC M_SYS3 M_SYS5
22995 M_SYSIII M_SYSV M_UNIX M_X86 M_XENIX
22996 n16 ncl_el ncl_mr NetBSD news1500 news1700 news1800 news1900
22997 news3700 news700 news800 news900 NeXT NLS nonstopux ns16000
22998 ns32000 ns32016 ns32332 ns32k nsc32000
22999 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
23000 PARAGON parisc pa_risc PA_RISC1_1 PA_RISC2_0 pc532 pdp11 PGC PIC
23001 plexus PORTAR posix POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
23002 POSIX_C_SOURCE POSIX_SOURCE POWER powerpc ppc PROTOTYPES PWB pyr
23004 R3000 REENTRANT RES Rhapsody RISC6000 riscix riscos RT
23005 S390 S390x SA110 SCO scs sequent sgi SGI_SOURCE SH SH3 sinix
23006 SIZE_INT SIZE_LONG SIZE_PTR SOCKETS_SOURCE SOCKET_SOURCE sony
23007 sonyrisc sony_news sparc sparclite sparcv8 sparcv9 spectrum
23008 stardent stdc STDC_EXT stratos sun sun3 sun386 Sun386i svr3 svr4
23009 SVR4_2 SVR4_SOURCE svr5 SX system SYSTYPE_BSD SYSTYPE_BSD43
23010 SYSTYPE_BSD44 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3
23011 SYSV4 SYSV5 sysV68 sysV88
23012 Tek4132 Tek4300 thumb thw_370 thw_intel thw_rs6000 titan TM3200
23013 TM5400 TM5600 tower tower32 tower32_200 tower32_600 tower32_700
23014 tower32_800 tower32_850 tss
23015 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5 ultrix UMAXV UnicomPBB
23016 UnicomPBD UNICOS UNICOSMK unix UNIX95 UNIX99 unixpc unos USE_BSD
23017 USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE
23018 USE_LARGEFILE64 USE_MISC USE_POSIX USE_POSIX199309
23019 USE_POSIX199506 USE_POSIX2 USE_REENTRANT USE_SVID USE_UNIX98
23020 USE_XOPEN USE_XOPEN_EXTENDED USGr4 USGr4_2 UTek Utek UTS UWIN
23022 vax venix VMESA vms
23023 x86_64 xenix Xenix286 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2
23024 XPG2_EXTENDED XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
23027 # Maybe put other stuff here too.
23028 ./tr '-' '_' <<EOSH >>Cppsym.know
23031 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
23032 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
23033 $cat Cppsym.know > Cppsym.c
23034 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
23035 $rm -f Cppsym.a Cppsym.b Cppsym.c
23036 cat <<EOSH > Cppsym
23038 if $test \$# -gt 0; then
23039 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
23040 if $test -s Cppsym.got; then
23047 $tr " " "$trnl" | ./Cppsym.try
23053 cat <<EOSH > Cppsym.try
23055 cat <<'EOCP' > try.c
23058 #define STRINGIFY(a) "a"
23060 #if cpp_stuff == 42
23061 #define StGiFy(a) #a
23062 #define STRINGIFY(a) StGiFy(a)
23064 #if $cpp_stuff != 1 && $cpp_stuff != 42
23065 # include "Bletch: How does this C preprocessor stringify macros?"
23071 cat <<'EOSH' >> Cppsym.try
23073 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
23074 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
23075 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
23076 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
23078 echo 'return 0;}' >> try.c
23080 cat <<EOSH >> Cppsym.try
23082 case "$osname-$gccversion" in
23083 irix-) ccflags="\$ccflags -woff 1178" ;;
23084 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
23086 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs 2>/dev/null && $run ./try | $sed 's/ /\\\\ /g'
23088 chmod +x Cppsym.try
23089 $eunicefix Cppsym.try
23090 ./Cppsym < Cppsym.know | $sort | $uniq > Cppsym.true
23091 : Add in any Linux cpp "predefined macros":
23092 case "$osname::$gccversion" in
23093 *linux*::*.*|*gnukfreebsd*::*.*|gnu::*.*)
23095 rm -f $tHdrH'.h' $tHdrH
23097 # Filter out macro arguments, such as Linux's __INT8_C(c)
23098 if $cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
23099 sed -e 's/#define[\ \ ]*//;s/[\ \ ].*$//' -e 's/(.*//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
23100 if [ -s $tHdrH'_cppsym.real' ]; then
23101 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
23104 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
23107 : now check the C compiler for additional symbols
23108 postprocess_cc_v=''
23110 aix) postprocess_cc_v="|$tr , ' '" ;;
23117 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
23120 -D*) echo "\$i" | $sed 's/^-D//';;
23121 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
23126 postprocess_cc_v=''
23129 ./ccsym > ccsym1.raw
23130 if $test -s ccsym1.raw; then
23131 $sort ccsym1.raw | $uniq >ccsym.raw
23133 mv ccsym1.raw ccsym.raw
23136 $awk '/\=/ { print $0; next }
23137 { print $0"=1" }' ccsym.raw >ccsym.list
23138 $comm -13 Cppsym.true ccsym.list >ccsym.own
23139 $comm -12 Cppsym.true ccsym.list >ccsym.com
23140 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
23142 if $test -z ccsym.raw; then
23143 echo "Your C compiler doesn't seem to define any symbols!" >&4
23145 echo "However, your C preprocessor defines the following symbols:"
23148 cppsymbols=`$cat Cppsym.true`
23149 cppsymbols=`echo $cppsymbols`
23150 cppccsymbols="$cppsymbols"
23152 if $test -s ccsym.com; then
23153 echo "Your C compiler and pre-processor define these symbols:"
23154 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
23157 cppccsymbols=`$cat ccsym.com`
23158 cppccsymbols=`echo $cppccsymbols`
23159 $test "$silent" || sleep 1
23161 if $test -s ccsym.cpp; then
23162 $test "$also" && echo " "
23163 echo "Your C pre-processor ${also}defines the following symbols:"
23164 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
23166 cppsymbols=`$cat ccsym.cpp`
23167 cppsymbols=`echo $cppsymbols`
23168 $test "$silent" || sleep 1
23170 if $test -s ccsym.own; then
23171 $test "$also" && echo " "
23172 echo "Your C compiler ${also}defines the following cpp symbols:"
23173 $sed -e 's/\(..*\)=1/\1/' ccsym.own
23174 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
23175 ccsymbols=`$cat ccsym.own`
23176 ccsymbols=`echo $ccsymbols`
23177 $test "$silent" || sleep 1
23181 : add -D_FORTIFY_SOURCE if feasible and not already there
23182 case "$gccversion" in
23183 [456789].*) case "$optimize$ccflags" in
23184 *-O*) case "$ccflags$cppsymbols" in
23185 *_FORTIFY_SOURCE=*) # Don't add it again.
23186 echo "You seem to have -D_FORTIFY_SOURCE already, not adding it." >&4
23188 *) echo "Adding -D_FORTIFY_SOURCE=2 to ccflags..." >&4
23189 ccflags="$ccflags -D_FORTIFY_SOURCE=2"
23193 *) echo "You have gcc 4.* or later but not optimizing, not adding -D_FORTIFY_SOURCE." >&4
23197 *) echo "You seem not to have gcc 4.* or later, not adding -D_FORTIFY_SOURCE." >&4
23201 : script used to emit important warnings
23204 if test \$# -gt 0; then
23209 echo "*** WARNING:" >&4
23210 sed -e 's/^/*** /' <msg >&4
23212 cat msg >>config.msg
23213 echo " " >>config.msg
23219 : see if this is a termio system
23223 if $test `./findhdr termios.h`; then
23224 set tcsetattr i_termios
23230 "$define") echo "You have POSIX termios.h... good!" >&4;;
23231 *) if ./Cppsym pyr; then
23232 case "`$run /bin/universe`" in
23233 ucb) if $test `./findhdr sgtty.h`; then
23235 echo "<sgtty.h> found." >&4
23237 echo "System is pyramid with BSD universe."
23238 ./warn "<sgtty.h> not found--you could have problems."
23240 *) if $test `./findhdr termio.h`; then
23242 echo "<termio.h> found." >&4
23244 echo "System is pyramid with USG universe."
23245 ./warn "<termio.h> not found--you could have problems."
23249 if $test `./findhdr termio.h`; then
23250 echo "<termio.h> found." >&4
23252 elif $test `./findhdr sgtty.h`; then
23253 echo "<sgtty.h> found." >&4
23256 ./warn "Neither <termio.h> nor <sgtty.h> found--cross fingers!"
23259 if $test `./findhdr sgtty.h`; then
23260 echo "<sgtty.h> found." >&4
23262 elif $test `./findhdr termio.h`; then
23263 echo "<termio.h> found." >&4
23266 ./warn "Neither <sgtty.h> nor <termio.h> found--cross fingers!"
23270 set i_termio; eval $setvar
23271 val=$val2; set i_sgtty; eval $setvar
23272 val=$val3; set i_termios; eval $setvar
23274 : see if stdbool is available
23275 : we want a real compile instead of Inhdr because some Solaris systems
23276 : have stdbool.h, but it can only be used if the compiler indicates it
23277 : is sufficiently c99-compliant.
23281 #include <stdbool.h>
23286 int main(int argc, char **argv)
23292 if eval $compile; then
23293 echo "<stdbool.h> found." >&4
23296 echo "<stdbool.h> NOT found." >&4
23303 : see if stdint is available
23304 set stdint.h i_stdint
23307 : see if sys/access.h is available
23308 set sys/access.h i_sysaccess
23311 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
23312 set sys/filio.h i_sysfilio
23315 if $test `./findhdr sys/ioctl.h`; then
23317 echo '<sys/ioctl.h> found.' >&4
23320 if $test $i_sysfilio = "$define"; then
23321 echo '<sys/ioctl.h> NOT found.' >&4
23323 $test $i_sgtty = "$define" && xxx="sgtty.h"
23324 $test $i_termio = "$define" && xxx="termio.h"
23325 $test $i_termios = "$define" && xxx="termios.h"
23326 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
23332 : see if socket ioctl defs are in sys/sockio.h
23334 xxx=`./findhdr sys/sockio.h`
23335 if $test "$xxx"; then
23336 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
23338 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
23341 echo "No socket ioctls found in <sys/sockio.h>." >&4
23346 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
23352 : see if this is a syslog.h system
23353 set syslog.h i_syslog
23356 : see if this is a sys/mode.h system
23357 set sys/mode.h i_sysmode
23360 : see if there is a sys/poll.h file
23361 set sys/poll.h i_syspoll
23364 : see if sys/resource.h has to be included
23365 set sys/resource.h i_sysresrc
23368 : see if sys/security.h is available
23369 set sys/security.h i_syssecrt
23372 : see if this is a sys/statvfs.h system
23373 set sys/statvfs.h i_sysstatvfs
23376 : see if this is a sys/un.h system
23377 set sys/un.h i_sysun
23380 : see if this is a sys/utsname.h system
23381 set sys/utsname.h i_sysutsname
23384 : see if this is a syswait system
23385 set sys/wait.h i_syswait
23388 : see if this is a ustat.h system
23389 set ustat.h i_ustat
23392 : see if this is an utime system
23393 set utime.h i_utime
23396 : see if this is a vfork system
23399 set vfork.h i_vfork
23407 : see if wchar.h is present
23408 set wchar.h i_wchar
23413 echo "Looking for extensions..." >&4
23414 : If we are using the old config.sh, nonxs_extensions and xs_extensions may
23415 : contain old or inaccurate or duplicate values.
23416 nonxs_extensions=''
23418 : We do not use find because it might not be available.
23419 : We do not just use MANIFEST because the user may have dropped
23420 : some additional extensions into the source tree and expect them
23423 : Function to recursively find available extensions, ignoring DynaLoader
23424 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
23425 : In 5.10.1 and later, extensions are stored in directories
23426 : like File-Glob instead of the older File/Glob/.
23430 DynaLoader|dynaload) ;;
23432 this_ext=`echo "$xxx" | $sed -e s/-/\\\//g`;
23433 case "$this_ext" in
23434 Scalar/List/Utils) this_ext="List/Util" ;;
23435 PathTools) this_ext="Cwd" ;;
23437 echo " $xs_extensions $nonxs_extensions" > "$tdir/$$.tmp";
23438 if $contains " $this_ext " "$tdir/$$.tmp"; then
23440 echo "Duplicate directories detected for extension $xxx" >&4;
23441 echo "Configure cannot correctly recover from this - shall I abort?" >&4;
23442 case "$knowitall" in
23450 echo "Ok. Stopping Configure." >&4;
23451 echo "Please remove the duplicate directory (e.g. using git clean) and then re-run Configure" >&4;
23454 echo "Ok. You will need to correct config.sh before running make." >&4;
23456 $ls -1 "$xxx" > "$tdir/$$.tmp";
23457 if $contains "\.xs$" "$tdir/$$.tmp" > /dev/null 2>&1; then
23458 xs_extensions="$xs_extensions $this_ext";
23459 elif $contains "\.c$" "$tdir/$$.tmp" > /dev/null 2>&1; then
23460 xs_extensions="$xs_extensions $this_ext";
23461 elif $test -d "$xxx"; then
23462 nonxs_extensions="$nonxs_extensions $this_ext";
23464 $rm -f "$tdir/$$.tmp";
23472 eval $find_extensions
23476 eval $find_extensions
23480 eval $find_extensions
23481 set X $xs_extensions
23483 xs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
23484 set X $nonxs_extensions
23486 nonxs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
23488 known_extensions=`echo $nonxs_extensions $xs_extensions | tr ' ' $trnl | $sort | tr $trnl ' '`
23490 : Now see which are supported on this system.
23492 for xxx in $xs_extensions ; do
23496 amigaos) avail_ext="$avail_ext $xxx" ;;
23501 $define) avail_ext="$avail_ext $xxx" ;;
23504 GDBM_File|gdbm_fil)
23506 $define) avail_ext="$avail_ext $xxx" ;;
23510 : XXX Do we need a useipcsysv variable here
23511 case "${d_msg}${d_sem}${d_shm}" in
23512 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
23515 NDBM_File|ndbm_fil)
23518 case "$osname-$use64bitint" in
23521 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
23524 *) avail_ext="$avail_ext $xxx" ;;
23529 ODBM_File|odbm_fil)
23530 case "${i_dbm}${i_rpcsvcdbm}" in
23532 case "$d_cplusplus" in
23533 define) ;; # delete as a function name will not work
23534 *) case "$osname-$use64bitint" in
23537 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
23540 *) avail_ext="$avail_ext $xxx" ;;
23548 case "$useopcode" in
23549 true|define|y) avail_ext="$avail_ext $xxx" ;;
23553 case "$useposix" in
23554 true|define|y) avail_ext="$avail_ext $xxx" ;;
23558 case "$d_socket" in
23559 true|$define|y) avail_ext="$avail_ext $xxx" ;;
23562 I18N/Langinfo|langinfo)
23563 case "$uselanginfo" in
23564 true|define|y) avail_ext="$avail_ext $xxx" ;;
23567 Sys/Syslog|sys/syslog)
23569 amigaos) ;; # not really very useful on AmigaOS
23571 : XXX syslog requires socket
23572 case "$d_socket" in
23573 true|$define|y) avail_ext="$avail_ext $xxx" ;;
23579 case "$usethreads" in
23581 case "$use5005threads" in
23582 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
23586 threads|threads/shared)
23587 # threads and threads::shared are special cases.
23588 # To stop people from asking "Perl 5.8.0 was supposed
23589 # to have this new fancy threads implementation but my
23590 # perl doesn't have it" and from people trying to
23591 # (re)install the threads module using CPAN.pm and
23592 # CPAN.pm then offering to reinstall Perl 5.8.0,
23593 # the threads.pm and threads/shared.pm will always be
23594 # there, croaking informatively ("you need to rebuild
23595 # all of Perl with threads, sorry") when threads haven't
23596 # been compiled in.
23598 avail_ext="$avail_ext $xxx"
23604 cygwin) avail_ext="$avail_ext $xxx" ;;
23607 XS/APItest|xs/apitest)
23608 # This is just for testing. Skip it unless we have dynamic loading.
23611 $define) avail_ext="$avail_ext $xxx" ;;
23614 XS/Typemap|xs/typemap)
23615 # This is just for testing. Skip it unless we have dynamic loading.
23617 $define) avail_ext="$avail_ext $xxx" ;;
23620 *) avail_ext="$avail_ext $xxx"
23629 case "$onlyextensions" in
23631 *) keepextensions=''
23632 echo "You have requested that only certain extensions be included..." >&4
23633 for i in $onlyextensions; do
23634 case " $avail_ext " in
23636 echo "Keeping extension $i."
23637 keepextensions="$keepextensions $i"
23639 *) echo "Ignoring extension $i." ;;
23642 avail_ext="$keepextensions"
23646 case "$noextensions" in
23648 *) keepextensions=''
23649 echo "You have requested that certain extensions be ignored..." >&4
23650 for i in $avail_ext; do
23651 case " $noextensions " in
23652 *" $i "*) echo "Ignoring extension $i." ;;
23653 *) echo "Keeping extension $i.";
23654 keepextensions="$keepextensions $i"
23658 avail_ext="$keepextensions"
23662 : Now see which nonxs extensions are supported on this system.
23663 : For now assume all are.
23665 for xxx in $nonxs_extensions ; do
23669 *) nonxs_ext="$nonxs_ext $xxx"
23681 A number of extensions are supplied with $package. You may choose to
23682 compile these extensions for dynamic loading (the default), compile
23683 them into the $package executable (static loading), or not include
23684 them at all. Answer "none" to include no extensions.
23685 Note that DynaLoader is always built and need not be mentioned here.
23688 case "$dynamic_ext" in
23690 : Exclude those listed in static_ext
23692 for xxx in $avail_ext; do
23693 case " $static_ext " in
23695 *) dflt="$dflt $xxx" ;;
23702 *) dflt="$dynamic_ext"
23703 # Perhaps we are reusing an old out-of-date config.sh.
23706 if test X"$dynamic_ext" != X"$avail_ext"; then
23708 NOTICE: Your previous config.sh list may be incorrect.
23709 The extensions now available to you are
23711 but the default list from your previous config.sh is
23723 rp="What extensions do you wish to load dynamically?"
23726 none) dynamic_ext=' ' ;;
23727 *) dynamic_ext="$ans" ;;
23730 case "$static_ext" in
23732 : Exclude those already listed in dynamic linking
23734 for xxx in $avail_ext; do
23735 case " $dynamic_ext " in
23737 *) dflt="$dflt $xxx" ;;
23744 *) dflt="$static_ext"
23751 rp="What extensions do you wish to load statically?"
23754 none) static_ext=' ' ;;
23755 *) static_ext="$ans" ;;
23760 A number of extensions are supplied with $package. Answer "none"
23761 to include no extensions.
23762 Note that DynaLoader is always built and need not be mentioned here.
23765 case "$static_ext" in
23766 '') dflt="$avail_ext" ;;
23767 *) dflt="$static_ext"
23768 # Perhaps we are reusing an old out-of-date config.sh.
23771 if test X"$static_ext" != X"$avail_ext"; then
23773 NOTICE: Your previous config.sh list may be incorrect.
23774 The extensions now available to you are
23776 but the default list from your previous config.sh is
23785 : Exclude those that are not xs extensions
23789 rp="What extensions do you wish to include?"
23792 none) static_ext=' ' ;;
23793 *) static_ext="$ans" ;;
23798 # Encode is a special case. If we are building Encode as a static
23799 # extension, we need to explicitly list its subextensions as well.
23800 # For other nested extensions, this is handled automatically by
23801 # the appropriate Makefile.PL.
23802 case " $static_ext " in
23803 *" Encode "*) # Add the subextensions of Encode
23805 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
23806 static_ext="$static_ext Encode/$xxx"
23807 known_extensions="$known_extensions Encode/$xxx"
23813 set X $dynamic_ext $static_ext $nonxs_ext
23817 # Sanity check: We require an extension suitable for use with
23818 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
23819 # should show up as failures in the test suite, but it's helpful to
23820 # catch them now.) The 'extensions' list is normally sorted
23821 # alphabetically, so we need to accept either
23822 # DB_File ... Fcntl ... IO ....
23823 # or something like
23824 # Fcntl ... NDBM_File ... IO ....
23825 case " $extensions" in
23826 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
23827 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
23828 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
23829 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
23830 echo "WARNING: The Perl you are building will be quite crippled." >& 4
23834 : Remove libraries needed only for extensions
23835 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
23836 : The exception is SunOS 4.x, which needs them.
23837 case "${osname}X${osvers}" in
23841 *) case "$usedl" in
23842 $define|true|[yY]*)
23843 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
23847 *) perllibs="$libs"
23853 : Remove build directory name from cppstdin so it can be used from
23854 : either the present location or the final installed location.
23856 : Get out of the UU directory to get correct path name.
23858 case "$cppstdin" in
23860 echo "Stripping down cppstdin path name"
23866 : end of configuration questions
23868 echo "End of configuration questions."
23871 : back to where it started
23872 if test -d ../UU; then
23876 : configuration may be unconditionally patched via a 'config.arch' file
23877 if $test -f config.arch; then
23878 echo "I see a config.arch file, loading it." >&4
23882 : configuration may be patched via a 'config.over' file
23883 if $test -f config.over; then
23886 rp='I see a config.over file. Do you wish to load it?'
23889 n*) echo "OK, I'll ignore it.";;
23891 echo "Configuration override changes have been loaded."
23896 : in case they want portability, strip down executable paths
23897 case "$d_portable" in
23900 echo "Stripping down executable paths..." >&4
23901 for file in $loclist $trylist; do
23903 eval $file=`basename $temp`
23908 : create config.sh file
23910 echo "Creating config.sh..." >&4
23911 $spitshell <<EOT >config.sh
23914 # This file was produced by running the Configure script. It holds all the
23915 # definitions figured out by Configure. Should you modify one of these values,
23916 # do not forget to propagate your changes by running "Configure -der". You may
23917 # instead choose to run each of the .SH files by yourself, or "Configure -S".
23920 # Package name : $package
23921 # Source directory : $src
23922 # Configuration time: $cf_time
23923 # Configured by : $cf_by
23924 # Target system : $myuname
23927 : Add in command line options if available
23928 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
23930 $spitshell <<EOT >>config.sh
23939 Revision='$Revision'
23947 alignbytes='$alignbytes'
23948 aphostname='$aphostname'
23949 api_revision='$api_revision'
23950 api_subversion='$api_subversion'
23951 api_version='$api_version'
23952 api_versionstring='$api_versionstring'
23955 archlibexp='$archlibexp'
23956 archname64='$archname64'
23957 archname='$archname'
23958 archobjs='$archobjs'
23959 asctime_r_proto='$asctime_r_proto'
23968 byteorder='$byteorder'
23970 castflags='$castflags'
23973 cccdlflags='$cccdlflags'
23974 ccdlflags='$ccdlflags'
23976 ccflags_uselargefiles='$ccflags_uselargefiles'
23978 ccsymbols='$ccsymbols'
23979 ccversion='$ccversion'
23981 cf_email='$cf_email'
23983 charbits='$charbits'
23984 charsize='$charsize'
23988 clocktype='$clocktype'
23990 compress='$compress'
23991 contains='$contains'
23995 cpp_stuff='$cpp_stuff'
23996 cppccsymbols='$cppccsymbols'
23997 cppflags='$cppflags'
23999 cppminus='$cppminus'
24001 cppstdin='$cppstdin'
24002 cppsymbols='$cppsymbols'
24003 crypt_r_proto='$crypt_r_proto'
24004 cryptlib='$cryptlib'
24006 ctermid_r_proto='$ctermid_r_proto'
24007 ctime_r_proto='$ctime_r_proto'
24008 d_Gconvert='$d_Gconvert'
24009 d_PRIEUldbl='$d_PRIEUldbl'
24010 d_PRIFUldbl='$d_PRIFUldbl'
24011 d_PRIGUldbl='$d_PRIGUldbl'
24012 d_PRIXU64='$d_PRIXU64'
24013 d_PRId64='$d_PRId64'
24014 d_PRIeldbl='$d_PRIeldbl'
24015 d_PRIfldbl='$d_PRIfldbl'
24016 d_PRIgldbl='$d_PRIgldbl'
24017 d_PRIi64='$d_PRIi64'
24018 d_PRIo64='$d_PRIo64'
24019 d_PRIu64='$d_PRIu64'
24020 d_PRIx64='$d_PRIx64'
24021 d_SCNfldbl='$d_SCNfldbl'
24022 d__fwalk='$d__fwalk'
24023 d_accept4='$d_accept4'
24024 d_access='$d_access'
24025 d_accessx='$d_accessx'
24029 d_archlib='$d_archlib'
24030 d_asctime64='$d_asctime64'
24031 d_asctime_r='$d_asctime_r'
24036 d_attribute_deprecated='$d_attribute_deprecated'
24037 d_attribute_format='$d_attribute_format'
24038 d_attribute_malloc='$d_attribute_malloc'
24039 d_attribute_nonnull='$d_attribute_nonnull'
24040 d_attribute_noreturn='$d_attribute_noreturn'
24041 d_attribute_pure='$d_attribute_pure'
24042 d_attribute_unused='$d_attribute_unused'
24043 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
24044 d_backtrace='$d_backtrace'
24046 d_bsdgetpgrp='$d_bsdgetpgrp'
24047 d_bsdsetpgrp='$d_bsdsetpgrp'
24048 d_builtin_add_overflow='$d_builtin_add_overflow'
24049 d_builtin_choose_expr='$d_builtin_choose_expr'
24050 d_builtin_expect='$d_builtin_expect'
24051 d_builtin_mul_overflow='$d_builtin_mul_overflow'
24052 d_builtin_sub_overflow='$d_builtin_sub_overflow'
24053 d_c99_variadic_macros='$d_c99_variadic_macros'
24054 d_casti32='$d_casti32'
24055 d_castneg='$d_castneg'
24058 d_chroot='$d_chroot'
24059 d_chsize='$d_chsize'
24061 d_clearenv='$d_clearenv'
24062 d_closedir='$d_closedir'
24063 d_cmsghdr_s='$d_cmsghdr_s'
24064 d_copysign='$d_copysign'
24065 d_copysignl='$d_copysignl'
24066 d_cplusplus='$d_cplusplus'
24068 d_crypt_r='$d_crypt_r'
24070 d_ctermid='$d_ctermid'
24071 d_ctermid_r='$d_ctermid_r'
24072 d_ctime64='$d_ctime64'
24073 d_ctime_r='$d_ctime_r'
24074 d_cuserid='$d_cuserid'
24075 d_dbminitproto='$d_dbminitproto'
24076 d_difftime64='$d_difftime64'
24077 d_difftime='$d_difftime'
24078 d_dir_dd_fd='$d_dir_dd_fd'
24080 d_dirnamlen='$d_dirnamlen'
24081 d_dladdr='$d_dladdr'
24082 d_dlerror='$d_dlerror'
24083 d_dlopen='$d_dlopen'
24084 d_dlsymun='$d_dlsymun'
24085 d_dosuid='$d_dosuid'
24086 d_double_has_inf='$d_double_has_inf'
24087 d_double_has_nan='$d_double_has_nan'
24088 d_double_has_negative_zero='$d_double_has_negative_zero'
24089 d_double_has_subnormals='$d_double_has_subnormals'
24090 d_double_style_cray='$d_double_style_cray'
24091 d_double_style_ibm='$d_double_style_ibm'
24092 d_double_style_ieee='$d_double_style_ieee'
24093 d_double_style_vax='$d_double_style_vax'
24094 d_drand48_r='$d_drand48_r'
24095 d_drand48proto='$d_drand48proto'
24098 d_duplocale='$d_duplocale'
24099 d_eaccess='$d_eaccess'
24100 d_endgrent='$d_endgrent'
24101 d_endgrent_r='$d_endgrent_r'
24102 d_endhent='$d_endhent'
24103 d_endhostent_r='$d_endhostent_r'
24104 d_endnent='$d_endnent'
24105 d_endnetent_r='$d_endnetent_r'
24106 d_endpent='$d_endpent'
24107 d_endprotoent_r='$d_endprotoent_r'
24108 d_endpwent='$d_endpwent'
24109 d_endpwent_r='$d_endpwent_r'
24110 d_endsent='$d_endsent'
24111 d_endservent_r='$d_endservent_r'
24112 d_eofnblk='$d_eofnblk'
24115 d_eunice='$d_eunice'
24118 d_faststdio='$d_faststdio'
24119 d_fchdir='$d_fchdir'
24120 d_fchmod='$d_fchmod'
24121 d_fchmodat='$d_fchmodat'
24122 d_fchown='$d_fchown'
24124 d_fcntl_can_lock='$d_fcntl_can_lock'
24125 d_fd_macros='$d_fd_macros'
24126 d_fd_set='$d_fd_set'
24127 d_fdclose='$d_fdclose'
24129 d_fds_bits='$d_fds_bits'
24130 d_fegetround='$d_fegetround'
24131 d_fgetpos='$d_fgetpos'
24132 d_finite='$d_finite'
24133 d_finitel='$d_finitel'
24134 d_flexfnam='$d_flexfnam'
24136 d_flockproto='$d_flockproto'
24141 d_fp_class='$d_fp_class'
24142 d_fp_classify='$d_fp_classify'
24143 d_fp_classl='$d_fp_classl'
24144 d_fpathconf='$d_fpathconf'
24145 d_fpclass='$d_fpclass'
24146 d_fpclassify='$d_fpclassify'
24147 d_fpclassl='$d_fpclassl'
24148 d_fpgetround='$d_fpgetround'
24149 d_fpos64_t='$d_fpos64_t'
24150 d_freelocale='$d_freelocale'
24151 d_frexpl='$d_frexpl'
24152 d_fs_data_s='$d_fs_data_s'
24153 d_fseeko='$d_fseeko'
24154 d_fsetpos='$d_fsetpos'
24155 d_fstatfs='$d_fstatfs'
24156 d_fstatvfs='$d_fstatvfs'
24158 d_ftello='$d_ftello'
24160 d_futimes='$d_futimes'
24161 d_gai_strerror='$d_gai_strerror'
24162 d_gdbm_ndbm_h_uses_prototypes='$d_gdbm_ndbm_h_uses_prototypes'
24163 d_gdbmndbm_h_uses_prototypes='$d_gdbmndbm_h_uses_prototypes'
24164 d_getaddrinfo='$d_getaddrinfo'
24165 d_getcwd='$d_getcwd'
24166 d_getespwnam='$d_getespwnam'
24167 d_getfsstat='$d_getfsstat'
24168 d_getgrent='$d_getgrent'
24169 d_getgrent_r='$d_getgrent_r'
24170 d_getgrgid_r='$d_getgrgid_r'
24171 d_getgrnam_r='$d_getgrnam_r'
24172 d_getgrps='$d_getgrps'
24173 d_gethbyaddr='$d_gethbyaddr'
24174 d_gethbyname='$d_gethbyname'
24175 d_gethent='$d_gethent'
24176 d_gethname='$d_gethname'
24177 d_gethostbyaddr_r='$d_gethostbyaddr_r'
24178 d_gethostbyname_r='$d_gethostbyname_r'
24179 d_gethostent_r='$d_gethostent_r'
24180 d_gethostprotos='$d_gethostprotos'
24181 d_getitimer='$d_getitimer'
24182 d_getlogin='$d_getlogin'
24183 d_getlogin_r='$d_getlogin_r'
24184 d_getmnt='$d_getmnt'
24185 d_getmntent='$d_getmntent'
24186 d_getnameinfo='$d_getnameinfo'
24187 d_getnbyaddr='$d_getnbyaddr'
24188 d_getnbyname='$d_getnbyname'
24189 d_getnent='$d_getnent'
24190 d_getnetbyaddr_r='$d_getnetbyaddr_r'
24191 d_getnetbyname_r='$d_getnetbyname_r'
24192 d_getnetent_r='$d_getnetent_r'
24193 d_getnetprotos='$d_getnetprotos'
24194 d_getpagsz='$d_getpagsz'
24195 d_getpbyname='$d_getpbyname'
24196 d_getpbynumber='$d_getpbynumber'
24197 d_getpent='$d_getpent'
24198 d_getpgid='$d_getpgid'
24199 d_getpgrp2='$d_getpgrp2'
24200 d_getpgrp='$d_getpgrp'
24201 d_getppid='$d_getppid'
24202 d_getprior='$d_getprior'
24203 d_getprotobyname_r='$d_getprotobyname_r'
24204 d_getprotobynumber_r='$d_getprotobynumber_r'
24205 d_getprotoent_r='$d_getprotoent_r'
24206 d_getprotoprotos='$d_getprotoprotos'
24207 d_getprpwnam='$d_getprpwnam'
24208 d_getpwent='$d_getpwent'
24209 d_getpwent_r='$d_getpwent_r'
24210 d_getpwnam_r='$d_getpwnam_r'
24211 d_getpwuid_r='$d_getpwuid_r'
24212 d_getsbyname='$d_getsbyname'
24213 d_getsbyport='$d_getsbyport'
24214 d_getsent='$d_getsent'
24215 d_getservbyname_r='$d_getservbyname_r'
24216 d_getservbyport_r='$d_getservbyport_r'
24217 d_getservent_r='$d_getservent_r'
24218 d_getservprotos='$d_getservprotos'
24219 d_getspnam='$d_getspnam'
24220 d_getspnam_r='$d_getspnam_r'
24221 d_gettimeod='$d_gettimeod'
24222 d_gmtime64='$d_gmtime64'
24223 d_gmtime_r='$d_gmtime_r'
24224 d_gnulibc='$d_gnulibc'
24225 d_grpasswd='$d_grpasswd'
24226 d_has_C_UTF8='$d_has_C_UTF8'
24227 d_hasmntopt='$d_hasmntopt'
24231 d_ilogbl='$d_ilogbl'
24232 d_inc_version_list='$d_inc_version_list'
24233 d_inetaton='$d_inetaton'
24234 d_inetntop='$d_inetntop'
24235 d_inetpton='$d_inetpton'
24236 d_int64_t='$d_int64_t'
24237 d_ip_mreq='$d_ip_mreq'
24238 d_ip_mreq_source='$d_ip_mreq_source'
24239 d_ipv6_mreq='$d_ipv6_mreq'
24240 d_ipv6_mreq_source='$d_ipv6_mreq_source'
24241 d_isascii='$d_isascii'
24242 d_isblank='$d_isblank'
24243 d_isfinite='$d_isfinite'
24244 d_isfinitel='$d_isfinitel'
24246 d_isinfl='$d_isinfl'
24247 d_isless='$d_isless'
24249 d_isnanl='$d_isnanl'
24250 d_isnormal='$d_isnormal'
24253 d_killpg='$d_killpg'
24254 d_lc_monetary_2008='$d_lc_monetary_2008'
24255 d_lchown='$d_lchown'
24256 d_ldbl_dig='$d_ldbl_dig'
24257 d_ldexpl='$d_ldexpl'
24258 d_lgamma='$d_lgamma'
24259 d_lgamma_r='$d_lgamma_r'
24260 d_libm_lib_version='$d_libm_lib_version'
24261 d_libname_unique='$d_libname_unique'
24263 d_linkat='$d_linkat'
24264 d_llrint='$d_llrint'
24265 d_llrintl='$d_llrintl'
24266 d_llround='$d_llround'
24267 d_llroundl='$d_llroundl'
24268 d_localeconv_l='$d_localeconv_l'
24269 d_localtime64='$d_localtime64'
24270 d_localtime_r='$d_localtime_r'
24271 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
24272 d_locconv='$d_locconv'
24277 d_long_double_style_ieee='$d_long_double_style_ieee'
24278 d_long_double_style_ieee_doubledouble='$d_long_double_style_ieee_doubledouble'
24279 d_long_double_style_ieee_extended='$d_long_double_style_ieee_extended'
24280 d_long_double_style_ieee_std='$d_long_double_style_ieee_std'
24281 d_long_double_style_vax='$d_long_double_style_vax'
24282 d_longdbl='$d_longdbl'
24283 d_longlong='$d_longlong'
24285 d_lrintl='$d_lrintl'
24286 d_lround='$d_lround'
24287 d_lroundl='$d_lroundl'
24288 d_lseekproto='$d_lseekproto'
24290 d_madvise='$d_madvise'
24291 d_malloc_good_size='$d_malloc_good_size'
24292 d_malloc_size='$d_malloc_size'
24294 d_mbrlen='$d_mbrlen'
24295 d_mbrtowc='$d_mbrtowc'
24296 d_mbstowcs='$d_mbstowcs'
24297 d_mbtowc='$d_mbtowc'
24298 d_memmem='$d_memmem'
24299 d_memrchr='$d_memrchr'
24301 d_mkdtemp='$d_mkdtemp'
24302 d_mkfifo='$d_mkfifo'
24303 d_mkostemp='$d_mkostemp'
24304 d_mkstemp='$d_mkstemp'
24305 d_mkstemps='$d_mkstemps'
24306 d_mktime64='$d_mktime64'
24307 d_mktime='$d_mktime'
24310 d_modflproto='$d_modflproto'
24311 d_mprotect='$d_mprotect'
24313 d_msg_ctrunc='$d_msg_ctrunc'
24314 d_msg_dontroute='$d_msg_dontroute'
24315 d_msg_oob='$d_msg_oob'
24316 d_msg_peek='$d_msg_peek'
24317 d_msg_proxy='$d_msg_proxy'
24318 d_msgctl='$d_msgctl'
24319 d_msgget='$d_msgget'
24320 d_msghdr_s='$d_msghdr_s'
24321 d_msgrcv='$d_msgrcv'
24322 d_msgsnd='$d_msgsnd'
24324 d_munmap='$d_munmap'
24325 d_mymalloc='$d_mymalloc'
24327 d_nanosleep='$d_nanosleep'
24329 d_ndbm_h_uses_prototypes='$d_ndbm_h_uses_prototypes'
24330 d_nearbyint='$d_nearbyint'
24331 d_newlocale='$d_newlocale'
24332 d_nextafter='$d_nextafter'
24333 d_nexttoward='$d_nexttoward'
24335 d_nl_langinfo='$d_nl_langinfo'
24336 d_nv_preserves_uv='$d_nv_preserves_uv'
24337 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
24338 d_off64_t='$d_off64_t'
24339 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
24340 d_oldpthreads='$d_oldpthreads'
24341 d_oldsock='$d_oldsock'
24343 d_openat='$d_openat'
24344 d_pathconf='$d_pathconf'
24346 d_perl_otherlibdirs='$d_perl_otherlibdirs'
24347 d_phostname='$d_phostname'
24351 d_portable='$d_portable'
24353 d_prctl_set_name='$d_prctl_set_name'
24354 d_printf_format_null='$d_printf_format_null'
24355 d_procselfexe='$d_procselfexe'
24356 d_pseudofork='$d_pseudofork'
24357 d_pthread_atfork='$d_pthread_atfork'
24358 d_pthread_attr_setscope='$d_pthread_attr_setscope'
24359 d_pthread_yield='$d_pthread_yield'
24360 d_ptrdiff_t='$d_ptrdiff_t'
24362 d_pwchange='$d_pwchange'
24363 d_pwclass='$d_pwclass'
24364 d_pwcomment='$d_pwcomment'
24365 d_pwexpire='$d_pwexpire'
24366 d_pwgecos='$d_pwgecos'
24367 d_pwpasswd='$d_pwpasswd'
24368 d_pwquota='$d_pwquota'
24371 d_querylocale='$d_querylocale'
24372 d_random_r='$d_random_r'
24373 d_re_comp='$d_re_comp'
24374 d_readdir64_r='$d_readdir64_r'
24375 d_readdir='$d_readdir'
24376 d_readdir_r='$d_readdir_r'
24377 d_readlink='$d_readlink'
24379 d_recvmsg='$d_recvmsg'
24380 d_regcmp='$d_regcmp'
24381 d_regcomp='$d_regcomp'
24382 d_remainder='$d_remainder'
24383 d_remquo='$d_remquo'
24384 d_rename='$d_rename'
24385 d_renameat='$d_renameat'
24386 d_rewinddir='$d_rewinddir'
24390 d_sbrkproto='$d_sbrkproto'
24391 d_scalbn='$d_scalbn'
24392 d_scalbnl='$d_scalbnl'
24393 d_sched_yield='$d_sched_yield'
24394 d_scm_rights='$d_scm_rights'
24395 d_seekdir='$d_seekdir'
24396 d_select='$d_select'
24398 d_semctl='$d_semctl'
24399 d_semctl_semid_ds='$d_semctl_semid_ds'
24400 d_semctl_semun='$d_semctl_semun'
24401 d_semget='$d_semget'
24403 d_sendmsg='$d_sendmsg'
24404 d_setegid='$d_setegid'
24405 d_seteuid='$d_seteuid'
24406 d_setgrent='$d_setgrent'
24407 d_setgrent_r='$d_setgrent_r'
24408 d_setgrps='$d_setgrps'
24409 d_sethent='$d_sethent'
24410 d_sethostent_r='$d_sethostent_r'
24411 d_setitimer='$d_setitimer'
24412 d_setlinebuf='$d_setlinebuf'
24413 d_setlocale='$d_setlocale'
24414 d_setlocale_accepts_any_locale_name='$d_setlocale_accepts_any_locale_name'
24415 d_setlocale_r='$d_setlocale_r'
24416 d_setnent='$d_setnent'
24417 d_setnetent_r='$d_setnetent_r'
24418 d_setpent='$d_setpent'
24419 d_setpgid='$d_setpgid'
24420 d_setpgrp2='$d_setpgrp2'
24421 d_setpgrp='$d_setpgrp'
24422 d_setprior='$d_setprior'
24423 d_setproctitle='$d_setproctitle'
24424 d_setprotoent_r='$d_setprotoent_r'
24425 d_setpwent='$d_setpwent'
24426 d_setpwent_r='$d_setpwent_r'
24427 d_setregid='$d_setregid'
24428 d_setresgid='$d_setresgid'
24429 d_setresuid='$d_setresuid'
24430 d_setreuid='$d_setreuid'
24431 d_setrgid='$d_setrgid'
24432 d_setruid='$d_setruid'
24433 d_setsent='$d_setsent'
24434 d_setservent_r='$d_setservent_r'
24435 d_setsid='$d_setsid'
24436 d_setvbuf='$d_setvbuf'
24439 d_shmatprototype='$d_shmatprototype'
24440 d_shmctl='$d_shmctl'
24442 d_shmget='$d_shmget'
24443 d_sigaction='$d_sigaction'
24444 d_siginfo_si_addr='$d_siginfo_si_addr'
24445 d_siginfo_si_band='$d_siginfo_si_band'
24446 d_siginfo_si_errno='$d_siginfo_si_errno'
24447 d_siginfo_si_fd='$d_siginfo_si_fd'
24448 d_siginfo_si_pid='$d_siginfo_si_pid'
24449 d_siginfo_si_status='$d_siginfo_si_status'
24450 d_siginfo_si_uid='$d_siginfo_si_uid'
24451 d_siginfo_si_value='$d_siginfo_si_value'
24452 d_signbit='$d_signbit'
24453 d_sigprocmask='$d_sigprocmask'
24454 d_sigsetjmp='$d_sigsetjmp'
24455 d_sin6_scope_id='$d_sin6_scope_id'
24456 d_sitearch='$d_sitearch'
24457 d_snprintf='$d_snprintf'
24458 d_sockaddr_in6='$d_sockaddr_in6'
24459 d_sockaddr_sa_len='$d_sockaddr_sa_len'
24460 d_sockatmark='$d_sockatmark'
24461 d_sockatmarkproto='$d_sockatmarkproto'
24462 d_socket='$d_socket'
24463 d_socklen_t='$d_socklen_t'
24464 d_sockpair='$d_sockpair'
24465 d_socks5_init='$d_socks5_init'
24467 d_srand48_r='$d_srand48_r'
24468 d_srandom_r='$d_srandom_r'
24469 d_sresgproto='$d_sresgproto'
24470 d_sresuproto='$d_sresuproto'
24472 d_statblks='$d_statblks'
24473 d_statfs_f_flags='$d_statfs_f_flags'
24474 d_statfs_s='$d_statfs_s'
24475 d_static_inline='$d_static_inline'
24476 d_statvfs='$d_statvfs'
24477 d_stdio_cnt_lval='$d_stdio_cnt_lval'
24478 d_stdio_ptr_lval='$d_stdio_ptr_lval'
24479 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
24480 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
24481 d_stdio_stream_array='$d_stdio_stream_array'
24482 d_stdiobase='$d_stdiobase'
24483 d_stdstdio='$d_stdstdio'
24484 d_strcoll='$d_strcoll'
24485 d_strerror_l='$d_strerror_l'
24486 d_strerror_r='$d_strerror_r'
24487 d_strftime='$d_strftime'
24488 d_strlcat='$d_strlcat'
24489 d_strlcpy='$d_strlcpy'
24490 d_strnlen='$d_strnlen'
24491 d_strtod='$d_strtod'
24492 d_strtod_l='$d_strtod_l'
24493 d_strtol='$d_strtol'
24494 d_strtold='$d_strtold'
24495 d_strtold_l='$d_strtold_l'
24496 d_strtoll='$d_strtoll'
24497 d_strtoq='$d_strtoq'
24498 d_strtoul='$d_strtoul'
24499 d_strtoull='$d_strtoull'
24500 d_strtouq='$d_strtouq'
24501 d_strxfrm='$d_strxfrm'
24502 d_suidsafe='$d_suidsafe'
24503 d_symlink='$d_symlink'
24504 d_syscall='$d_syscall'
24505 d_syscallproto='$d_syscallproto'
24506 d_sysconf='$d_sysconf'
24507 d_sysernlst='$d_sysernlst'
24508 d_syserrlst='$d_syserrlst'
24509 d_system='$d_system'
24510 d_tcgetpgrp='$d_tcgetpgrp'
24511 d_tcsetpgrp='$d_tcsetpgrp'
24512 d_telldir='$d_telldir'
24513 d_telldirproto='$d_telldirproto'
24514 d_tgamma='$d_tgamma'
24515 d_thread_safe_nl_langinfo_l='$d_thread_safe_nl_langinfo_l'
24517 d_timegm='$d_timegm'
24519 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
24520 d_tm_tm_zone='$d_tm_tm_zone'
24521 d_tmpnam_r='$d_tmpnam_r'
24522 d_towlower='$d_towlower'
24523 d_towupper='$d_towupper'
24525 d_truncate='$d_truncate'
24526 d_truncl='$d_truncl'
24527 d_ttyname_r='$d_ttyname_r'
24528 d_tzname='$d_tzname'
24529 d_u32align='$d_u32align'
24530 d_ualarm='$d_ualarm'
24533 d_union_semun='$d_union_semun'
24534 d_unlinkat='$d_unlinkat'
24535 d_unordered='$d_unordered'
24536 d_unsetenv='$d_unsetenv'
24537 d_uselocale='$d_uselocale'
24538 d_usleep='$d_usleep'
24539 d_usleepproto='$d_usleepproto'
24541 d_vendorarch='$d_vendorarch'
24542 d_vendorbin='$d_vendorbin'
24543 d_vendorlib='$d_vendorlib'
24544 d_vendorscript='$d_vendorscript'
24546 d_void_closedir='$d_void_closedir'
24547 d_voidsig='$d_voidsig'
24548 d_voidtty='$d_voidtty'
24549 d_vsnprintf='$d_vsnprintf'
24551 d_waitpid='$d_waitpid'
24552 d_wcscmp='$d_wcscmp'
24553 d_wcstombs='$d_wcstombs'
24554 d_wcsxfrm='$d_wcsxfrm'
24555 d_wctomb='$d_wctomb'
24556 d_writev='$d_writev'
24559 db_hashtype='$db_hashtype'
24560 db_prefixtype='$db_prefixtype'
24561 db_version_major='$db_version_major'
24562 db_version_minor='$db_version_minor'
24563 db_version_patch='$db_version_patch'
24564 default_inc_excludes_dot='$default_inc_excludes_dot'
24565 direntrytype='$direntrytype'
24568 doubleinfbytes='$doubleinfbytes'
24569 doublekind='$doublekind'
24570 doublemantbits='$doublemantbits'
24571 doublenanbytes='$doublenanbytes'
24572 doublesize='$doublesize'
24574 drand48_r_proto='$drand48_r_proto'
24576 dtraceobject='$dtraceobject'
24577 dtracexnolibs='$dtracexnolibs'
24578 dynamic_ext='$dynamic_ext'
24584 endgrent_r_proto='$endgrent_r_proto'
24585 endhostent_r_proto='$endhostent_r_proto'
24586 endnetent_r_proto='$endnetent_r_proto'
24587 endprotoent_r_proto='$endprotoent_r_proto'
24588 endpwent_r_proto='$endpwent_r_proto'
24589 endservent_r_proto='$endservent_r_proto'
24590 eunicefix='$eunicefix'
24593 extensions='$extensions'
24594 extern_C='$extern_C'
24596 fflushNULL='$fflushNULL'
24597 fflushall='$fflushall'
24599 firstmakefile='$firstmakefile'
24601 fpossize='$fpossize'
24602 fpostype='$fpostype'
24603 freetype='$freetype'
24606 full_csh='$full_csh'
24607 full_sed='$full_sed'
24608 gccansipedantic='$gccansipedantic'
24609 gccosandvers='$gccosandvers'
24610 gccversion='$gccversion'
24611 getgrent_r_proto='$getgrent_r_proto'
24612 getgrgid_r_proto='$getgrgid_r_proto'
24613 getgrnam_r_proto='$getgrnam_r_proto'
24614 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
24615 gethostbyname_r_proto='$gethostbyname_r_proto'
24616 gethostent_r_proto='$gethostent_r_proto'
24617 getlogin_r_proto='$getlogin_r_proto'
24618 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
24619 getnetbyname_r_proto='$getnetbyname_r_proto'
24620 getnetent_r_proto='$getnetent_r_proto'
24621 getprotobyname_r_proto='$getprotobyname_r_proto'
24622 getprotobynumber_r_proto='$getprotobynumber_r_proto'
24623 getprotoent_r_proto='$getprotoent_r_proto'
24624 getpwent_r_proto='$getpwent_r_proto'
24625 getpwnam_r_proto='$getpwnam_r_proto'
24626 getpwuid_r_proto='$getpwuid_r_proto'
24627 getservbyname_r_proto='$getservbyname_r_proto'
24628 getservbyport_r_proto='$getservbyport_r_proto'
24629 getservent_r_proto='$getservent_r_proto'
24630 getspnam_r_proto='$getspnam_r_proto'
24631 gidformat='$gidformat'
24637 gmtime_r_proto='$gmtime_r_proto'
24638 gnulibc_version='$gnulibc_version'
24640 groupcat='$groupcat'
24641 groupstype='$groupstype'
24644 h_sysfile='$h_sysfile'
24647 hostgenerate='$hostgenerate'
24648 hostosname='$hostosname'
24649 hostperl='$hostperl'
24650 html1dir='$html1dir'
24651 html1direxp='$html1direxp'
24652 html3dir='$html3dir'
24653 html3direxp='$html3direxp'
24662 i_arpainet='$i_arpainet'
24664 i_bsdioctl='$i_bsdioctl'
24668 i_dirent='$i_dirent'
24670 i_execinfo='$i_execinfo'
24674 i_fp_class='$i_fp_class'
24676 i_gdbm_ndbm='$i_gdbm_ndbm'
24677 i_gdbmndbm='$i_gdbmndbm'
24679 i_ieeefp='$i_ieeefp'
24680 i_inttypes='$i_inttypes'
24681 i_langinfo='$i_langinfo'
24682 i_libutil='$i_libutil'
24683 i_locale='$i_locale'
24684 i_machcthr='$i_machcthr'
24685 i_malloc='$i_malloc'
24686 i_mallocmalloc='$i_mallocmalloc'
24687 i_mntent='$i_mntent'
24690 i_neterrno='$i_neterrno'
24691 i_netinettcp='$i_netinettcp'
24695 i_pthread='$i_pthread'
24697 i_quadmath='$i_quadmath'
24698 i_rpcsvcdbm='$i_rpcsvcdbm'
24700 i_shadow='$i_shadow'
24702 i_stdbool='$i_stdbool'
24703 i_stdint='$i_stdint'
24704 i_stdlib='$i_stdlib'
24705 i_sunmath='$i_sunmath'
24706 i_sysaccess='$i_sysaccess'
24707 i_sysdir='$i_sysdir'
24708 i_sysfile='$i_sysfile'
24709 i_sysfilio='$i_sysfilio'
24711 i_sysioctl='$i_sysioctl'
24712 i_syslog='$i_syslog'
24713 i_sysmman='$i_sysmman'
24714 i_sysmode='$i_sysmode'
24715 i_sysmount='$i_sysmount'
24716 i_sysndir='$i_sysndir'
24717 i_sysparam='$i_sysparam'
24718 i_syspoll='$i_syspoll'
24719 i_sysresrc='$i_sysresrc'
24720 i_syssecrt='$i_syssecrt'
24721 i_sysselct='$i_sysselct'
24722 i_syssockio='$i_syssockio'
24723 i_sysstat='$i_sysstat'
24724 i_sysstatfs='$i_sysstatfs'
24725 i_sysstatvfs='$i_sysstatvfs'
24726 i_systime='$i_systime'
24727 i_systimek='$i_systimek'
24728 i_systimes='$i_systimes'
24729 i_systypes='$i_systypes'
24730 i_sysuio='$i_sysuio'
24732 i_sysutsname='$i_sysutsname'
24733 i_sysvfs='$i_sysvfs'
24734 i_syswait='$i_syswait'
24735 i_termio='$i_termio'
24736 i_termios='$i_termios'
24738 i_unistd='$i_unistd'
24743 i_wctype='$i_wctype'
24744 i_xlocale='$i_xlocale'
24745 ignore_versioned_solibs='$ignore_versioned_solibs'
24746 inc_version_list='$inc_version_list'
24747 inc_version_list_init='$inc_version_list_init'
24751 initialinstalllocation='$initialinstalllocation'
24752 installarchlib='$installarchlib'
24753 installbin='$installbin'
24754 installhtml1dir='$installhtml1dir'
24755 installhtml3dir='$installhtml3dir'
24756 installman1dir='$installman1dir'
24757 installman3dir='$installman3dir'
24758 installprefix='$installprefix'
24759 installprefixexp='$installprefixexp'
24760 installprivlib='$installprivlib'
24761 installscript='$installscript'
24762 installsitearch='$installsitearch'
24763 installsitebin='$installsitebin'
24764 installsitehtml1dir='$installsitehtml1dir'
24765 installsitehtml3dir='$installsitehtml3dir'
24766 installsitelib='$installsitelib'
24767 installsiteman1dir='$installsiteman1dir'
24768 installsiteman3dir='$installsiteman3dir'
24769 installsitescript='$installsitescript'
24770 installstyle='$installstyle'
24771 installusrbinperl='$installusrbinperl'
24772 installvendorarch='$installvendorarch'
24773 installvendorbin='$installvendorbin'
24774 installvendorhtml1dir='$installvendorhtml1dir'
24775 installvendorhtml3dir='$installvendorhtml3dir'
24776 installvendorlib='$installvendorlib'
24777 installvendorman1dir='$installvendorman1dir'
24778 installvendorman3dir='$installvendorman3dir'
24779 installvendorscript='$installvendorscript'
24781 issymlink='$issymlink'
24782 ivdformat='$ivdformat'
24785 known_extensions='$known_extensions'
24788 ld_can_script='$ld_can_script'
24789 lddlflags='$lddlflags'
24791 ldflags_uselargefiles='$ldflags_uselargefiles'
24792 ldlibpthname='$ldlibpthname'
24799 libsdirs='$libsdirs'
24800 libsfiles='$libsfiles'
24801 libsfound='$libsfound'
24802 libspath='$libspath'
24803 libswanted='$libswanted'
24804 libswanted_uselargefiles='$libswanted_uselargefiles'
24810 localtime_r_proto='$localtime_r_proto'
24811 locincpth='$locincpth'
24812 loclibpth='$loclibpth'
24813 longdblinfbytes='$longdblinfbytes'
24814 longdblkind='$longdblkind'
24815 longdblmantbits='$longdblmantbits'
24816 longdblnanbytes='$longdblnanbytes'
24817 longdblsize='$longdblsize'
24818 longlongsize='$longlongsize'
24819 longsize='$longsize'
24823 lseeksize='$lseeksize'
24824 lseektype='$lseektype'
24828 make_set_make='$make_set_make'
24829 mallocobj='$mallocobj'
24830 mallocsrc='$mallocsrc'
24831 malloctype='$malloctype'
24833 man1direxp='$man1direxp'
24836 man3direxp='$man3direxp'
24838 mips_type='$mips_type'
24839 mistrustnm='$mistrustnm'
24841 mmaptype='$mmaptype'
24842 modetype='$modetype'
24844 multiarch='$multiarch'
24846 myarchname='$myarchname'
24847 mydomain='$mydomain'
24848 myhostname='$myhostname'
24851 need_va_copy='$need_va_copy'
24852 netdb_hlen_type='$netdb_hlen_type'
24853 netdb_host_type='$netdb_host_type'
24854 netdb_name_type='$netdb_name_type'
24855 netdb_net_type='$netdb_net_type'
24858 nm_so_opt='$nm_so_opt'
24859 nonxs_ext='$nonxs_ext'
24861 nvEUformat='$nvEUformat'
24862 nvFUformat='$nvFUformat'
24863 nvGUformat='$nvGUformat'
24864 nv_overflows_integers_at='$nv_overflows_integers_at'
24865 nv_preserves_uv_bits='$nv_preserves_uv_bits'
24866 nveformat='$nveformat'
24867 nvfformat='$nvfformat'
24868 nvgformat='$nvgformat'
24869 nvmantbits='$nvmantbits'
24872 o_nonblock='$o_nonblock'
24874 old_pthread_create_joinable='$old_pthread_create_joinable'
24875 optimize='$optimize'
24876 orderlib='$orderlib'
24879 otherlibdirs='$otherlibdirs'
24883 patchlevel='$patchlevel'
24884 path_sep='$path_sep'
24887 perl_patchlevel='$perl_patchlevel'
24888 perl_static_inline='$perl_static_inline'
24889 perladmin='$perladmin'
24890 perllibs='$perllibs'
24891 perlpath='$perlpath'
24893 phostname='$phostname'
24899 prefixexp='$prefixexp'
24901 privlibexp='$privlibexp'
24902 procselfexe='$procselfexe'
24904 quadkind='$quadkind'
24905 quadtype='$quadtype'
24906 randbits='$randbits'
24907 randfunc='$randfunc'
24908 random_r_proto='$random_r_proto'
24909 randseedtype='$randseedtype'
24911 rd_nodata='$rd_nodata'
24912 readdir64_r_proto='$readdir64_r_proto'
24913 readdir_r_proto='$readdir_r_proto'
24914 revision='$revision'
24920 sGMTIME_max='$sGMTIME_max'
24921 sGMTIME_min='$sGMTIME_min'
24922 sLOCALTIME_max='$sLOCALTIME_max'
24923 sLOCALTIME_min='$sLOCALTIME_min'
24924 sPRIEUldbl='$sPRIEUldbl'
24925 sPRIFUldbl='$sPRIFUldbl'
24926 sPRIGUldbl='$sPRIGUldbl'
24927 sPRIXU64='$sPRIXU64'
24929 sPRIeldbl='$sPRIeldbl'
24930 sPRIfldbl='$sPRIfldbl'
24931 sPRIgldbl='$sPRIgldbl'
24936 sSCNfldbl='$sSCNfldbl'
24937 sched_yield='$sched_yield'
24938 scriptdir='$scriptdir'
24939 scriptdirexp='$scriptdirexp'
24941 seedfunc='$seedfunc'
24942 selectminbits='$selectminbits'
24943 selecttype='$selecttype'
24944 sendmail='$sendmail'
24945 setgrent_r_proto='$setgrent_r_proto'
24946 sethostent_r_proto='$sethostent_r_proto'
24947 setlocale_r_proto='$setlocale_r_proto'
24948 setnetent_r_proto='$setnetent_r_proto'
24949 setprotoent_r_proto='$setprotoent_r_proto'
24950 setpwent_r_proto='$setpwent_r_proto'
24951 setservent_r_proto='$setservent_r_proto'
24954 sharpbang='$sharpbang'
24955 shmattype='$shmattype'
24956 shortsize='$shortsize'
24959 sig_count='$sig_count'
24960 sig_name='$sig_name'
24961 sig_name_init='$sig_name_init'
24963 sig_num_init='$sig_num_init'
24964 sig_size='$sig_size'
24965 signal_t='$signal_t'
24966 sitearch='$sitearch'
24967 sitearchexp='$sitearchexp'
24969 sitebinexp='$sitebinexp'
24970 sitehtml1dir='$sitehtml1dir'
24971 sitehtml1direxp='$sitehtml1direxp'
24972 sitehtml3dir='$sitehtml3dir'
24973 sitehtml3direxp='$sitehtml3direxp'
24975 sitelib_stem='$sitelib_stem'
24976 sitelibexp='$sitelibexp'
24977 siteman1dir='$siteman1dir'
24978 siteman1direxp='$siteman1direxp'
24979 siteman3dir='$siteman3dir'
24980 siteman3direxp='$siteman3direxp'
24981 siteprefix='$siteprefix'
24982 siteprefixexp='$siteprefixexp'
24983 sitescript='$sitescript'
24984 sitescriptexp='$sitescriptexp'
24985 sizesize='$sizesize'
24986 sizetype='$sizetype'
24990 sockethdr='$sockethdr'
24991 socketlib='$socketlib'
24992 socksizetype='$socksizetype'
24994 spackage='$spackage'
24995 spitshell='$spitshell'
24996 srand48_r_proto='$srand48_r_proto'
24997 srandom_r_proto='$srandom_r_proto'
24999 ssizetype='$ssizetype'
25000 st_ino_sign='$st_ino_sign'
25001 st_ino_size='$st_ino_size'
25002 startperl='$startperl'
25004 static_ext='$static_ext'
25006 stdio_base='$stdio_base'
25007 stdio_bufsiz='$stdio_bufsiz'
25008 stdio_cnt='$stdio_cnt'
25009 stdio_filbuf='$stdio_filbuf'
25010 stdio_ptr='$stdio_ptr'
25011 stdio_stream_array='$stdio_stream_array'
25012 strerror_r_proto='$strerror_r_proto'
25014 subversion='$subversion'
25019 targetarch='$targetarch'
25020 targetdir='$targetdir'
25021 targetenv='$targetenv'
25022 targethost='$targethost'
25023 targetmkdir='$targetmkdir'
25024 targetport='$targetport'
25025 targetsh='$targetsh'
25029 timeincl='$timeincl'
25030 timetype='$timetype'
25031 tmpnam_r_proto='$tmpnam_r_proto'
25037 ttyname_r_proto='$ttyname_r_proto'
25046 uidformat='$uidformat'
25052 uquadtype='$uquadtype'
25053 use5005threads='$use5005threads'
25054 use64bitall='$use64bitall'
25055 use64bitint='$use64bitint'
25056 usecbacktrace='$usecbacktrace'
25057 usecrosscompile='$usecrosscompile'
25058 usedevel='$usedevel'
25060 usedtrace='$usedtrace'
25061 usefaststdio='$usefaststdio'
25062 useithreads='$useithreads'
25063 usekernprocpathname='$usekernprocpathname'
25064 uselanginfo='$uselanginfo'
25065 uselargefiles='$uselargefiles'
25066 uselongdouble='$uselongdouble'
25067 usemallocwrap='$usemallocwrap'
25068 usemorebits='$usemorebits'
25069 usemultiplicity='$usemultiplicity'
25070 usemymalloc='$usemymalloc'
25072 usensgetexecutablepath='$usensgetexecutablepath'
25073 useopcode='$useopcode'
25074 useperlio='$useperlio'
25075 useposix='$useposix'
25076 usequadmath='$usequadmath'
25077 usereentrant='$usereentrant'
25078 userelocatableinc='$userelocatableinc'
25079 useshrplib='$useshrplib'
25080 usesitecustomize='$usesitecustomize'
25081 usesocks='$usesocks'
25082 usethreads='$usethreads'
25083 usevendorprefix='$usevendorprefix'
25084 useversionedarchname='$useversionedarchname'
25085 usevfork='$usevfork'
25088 uvXUformat='$uvXUformat'
25089 uvoformat='$uvoformat'
25092 uvuformat='$uvuformat'
25093 uvxformat='$uvxformat'
25094 vendorarch='$vendorarch'
25095 vendorarchexp='$vendorarchexp'
25096 vendorbin='$vendorbin'
25097 vendorbinexp='$vendorbinexp'
25098 vendorhtml1dir='$vendorhtml1dir'
25099 vendorhtml1direxp='$vendorhtml1direxp'
25100 vendorhtml3dir='$vendorhtml3dir'
25101 vendorhtml3direxp='$vendorhtml3direxp'
25102 vendorlib='$vendorlib'
25103 vendorlib_stem='$vendorlib_stem'
25104 vendorlibexp='$vendorlibexp'
25105 vendorman1dir='$vendorman1dir'
25106 vendorman1direxp='$vendorman1direxp'
25107 vendorman3dir='$vendorman3dir'
25108 vendorman3direxp='$vendorman3direxp'
25109 vendorprefix='$vendorprefix'
25110 vendorprefixexp='$vendorprefixexp'
25111 vendorscript='$vendorscript'
25112 vendorscriptexp='$vendorscriptexp'
25114 version_patchlevel_string='$version_patchlevel_string'
25115 versiononly='$versiononly'
25119 yaccflags='$yaccflags'
25124 : add special variables
25125 $test -f $src/patchlevel.h && \
25126 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
25127 echo "PERL_PATCHLEVEL='$perl_patchlevel'" >>config.sh
25128 echo "PERL_CONFIG_SH=true" >>config.sh
25130 : propagate old symbols
25131 if $test -f UU/config.sh; then
25132 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
25133 $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \
25134 config.sh config.sh UU/oldconfig.sh |\
25135 $sort | $uniq -u >UU/oldsyms
25136 set X `$cat UU/oldsyms`
25142 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
25144 echo ": Variables propagated from previous config.sh file." >>config.sh
25145 for sym in `$cat UU/oldsyms`; do
25146 echo " Propagating $hint variable "'$'"$sym..."
25147 eval 'tmp="$'"${sym}"'"'
25149 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
25155 : preserve RCS keywords in files with variable substitution, grrr
25158 : Finish up by extracting the .SH files
25161 echo "Stopping at your request, leaving temporary files around."
25171 If you'd like to make any changes to the config.sh file before I begin
25172 to configure things, do it as a shell escape now (e.g. !vi config.sh).
25175 rp="Press return or use a shell escape to edit config.sh:"
25180 *) : in case they cannot read
25181 sh 1>&4 -c "$ans";;
25186 : if this fails, just run all the .SH files by hand
25195 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
25202 Now you need to generate make dependencies by running "$make depend".
25203 You might prefer to run it in background: "$make depend > makedepend.out &"
25204 It can take a while, so you might not want to run it right now.
25209 rp="Run $make depend now?"
25213 $make depend && echo "Now you must run '$make'."
25216 echo "You must run '$make depend' then '$make'."
25219 elif test -f [Mm]akefile; then
25221 echo "Now you must run a $make."
25223 echo "Configure done."
25226 if $test -f Policy.sh; then
25229 If you compile $package on a different machine or from a different object
25230 directory, copy the Policy.sh file from this object directory to the
25231 new one before you run Configure -- this will help you with most of
25232 the policy defaults.
25236 if $test -f UU/config.msg; then
25237 echo "Hmm. I also noted the following information while running:"
25239 $cat UU/config.msg >&4
25241 $rm -f kit*isdone ark*isdone