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.
4172 '') dflt=`./loc . /usr/local /usr/local /local /opt /usr`
4179 By default, $package will be installed in $dflt/bin, manual pages
4180 under $dflt/man, etc..., i.e. with $dflt as prefix for all
4181 installation directories. Typically this is something like /usr/local.
4182 If you wish to have binaries under /usr/bin but other parts of the
4183 installation under /usr/local, that's ok: you will be prompted
4184 separately for each of the installation directories, the prefix being
4185 only used to set the defaults.
4189 rp='Installation prefix to use?'
4196 *) oldprefix="$prefix";;
4202 *?/) prefix=`echo "$ans" | sed 's/.$//'`
4208 *?/) prefixexp=`echo "$ansexp" | sed 's/.$//'`
4210 *) prefixexp="$ansexp"
4213 : allow them to override the AFS root
4216 *) afsroot=$afsroot ;;
4222 $define|true) afs=true ;;
4223 $undef|false) afs=false ;;
4224 *) if $test -d $afsroot; then
4232 echo "AFS may be running... I'll be extra cautious then..." >&4
4234 echo "AFS does not seem to be running..." >&4
4237 : determine installation prefix for where package is to be installed.
4241 Since you are running AFS, I need to distinguish the directory in which
4242 files will reside from the directory in which they are installed (and from
4243 which they are presumably copied to the former directory by occult means).
4246 case "$installprefix" in
4247 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
4248 *) dflt="$installprefix";;
4253 In some special cases, particularly when building $package for distribution,
4254 it is convenient to distinguish the directory in which files should be
4255 installed from the directory ($prefix) in which they will
4256 eventually reside. For most users, these two directories are the same.
4259 case "$installprefix" in
4261 *) dflt=$installprefix;;
4265 rp='What installation prefix should I use for installing files?'
4267 installprefix="$ans"
4268 installprefixexp="$ansexp"
4270 : Perform the prefixexp/installprefixexp correction if necessary
4271 cat <<EOS >installprefix
4274 cat <<'EOSC' >>installprefix
4275 : Change installation prefix, if necessary.
4276 if $test X"$prefix" != X"$installprefix"; then
4277 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
4279 eval "install${prefixvar}=\"\$${prefixvar}exp\""
4282 chmod +x installprefix
4283 $eunicefix installprefix
4285 : Set variables such as privlib and privlibexp from the output of ./getfile
4286 : performing the prefixexp/installprefixexp correction if necessary.
4287 cat <<EOS >setprefixvar
4290 cat <<'EOSC' >>setprefixvar
4291 eval "${prefixvar}=\"\$ans\""
4292 eval "${prefixvar}exp=\"\$ansexp\""
4295 chmod +x setprefixvar
4296 $eunicefix setprefixvar
4298 : set up the script used to warn in case of inconsistency
4307 '') echo "The $hint value for \$$var on this machine was \"$was\"!" >&4
4309 *) echo "Hmm. Based on the hints in hints/$hintfile.sh, " >&4
4310 echo "the $hint value for \$$var on this machine was \"$was\"!" >&4
4315 echo "*** WHOA THERE!!! ***" >&4
4316 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
4319 rp=" Keep the $hint value?"
4322 y) td=$was; tu=$was;;
4326 : function used to set '$1' to '$val'
4327 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
4329 $define$undef) . ./whoa; eval "$var=\$td";;
4330 $undef$define) . ./whoa; eval "$var=\$tu";;
4331 *) eval "$var=$val";;
4334 : get the patchlevel
4336 echo "Getting the current patchlevel..." >&4
4337 if $test -r $rsrc/patchlevel.h;then
4338 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
4339 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4340 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4341 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4342 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4343 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4344 perl_patchlevel=`egrep ',"(MAINT|SMOKE)[0-9][0-9]*"' $rsrc/patchlevel.h|tail -1|sed 's/[^0-9]//g'`
4353 $echo "(You do not have patchlevel.h. Eek.)"
4355 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
4356 version_patchlevel_string="version $patchlevel subversion $subversion"
4357 case "$perl_patchlevel" in
4359 *) perl_patchlevel=`echo $perl_patchlevel | sed 's/.* //'`
4360 version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel"
4364 $echo "(You have $package $version_patchlevel_string.)"
4368 : XXX Should be a Configure test for double-dots in filenames.
4369 version=`echo $revision $patchlevel $subversion | \
4370 $awk '{ printf "%d_%d_%d", $1, $2, $3 }'`
4371 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4372 $awk '{ printf "%d_%d_%d", $1, $2, $3 }'`
4375 version=`echo $revision $patchlevel $subversion | \
4376 $awk '{ printf "%d.%d.%d", $1, $2, $3 }'`
4377 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4378 $awk '{ printf "%d.%d.%d", $1, $2, $3 }'`
4381 : Special case the 5.005_xx maintenance series, which used 5.005
4382 : without any subversion label as a subdirectory in $sitelib
4383 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4384 api_versionstring='5.005'
4387 : Do we want threads support and if so, what type
4388 case "$usethreads" in
4389 $define|true|[yY]*) dflt='y';;
4390 *) # Catch case where user specified ithreads or 5005threads but
4391 # forgot -Dusethreads (A.D. 4/2002)
4392 case "$useithreads$use5005threads" in
4393 *$define*) dflt='y';;
4400 Perl can be built to offer a form of threading support on some systems
4401 To do so, Configure can be run with -Dusethreads.
4403 Note that Perl built with threading support runs slightly slower
4404 and uses slightly more memory than plain Perl.
4406 If this doesn't make any sense to you, just accept the default '$dflt'.
4408 rp='Build a threading Perl?'
4411 y|Y) val="$define" ;;
4417 if $test $patchlevel -lt 9; then
4418 case "$usethreads" in
4420 : Default to ithreads unless overridden on command line or with
4423 case "$use5005threads" in
4425 echo "5.005 threads are no longer supported"
4429 case "$useithreads" in
4430 $undef|false|[nN]*) dflt='n';;
4432 rp='Use the newer interpreter-based ithreads?'
4435 y|Y) val="$define" ;;
4440 : Now set use5005threads to the opposite value.
4441 case "$useithreads" in
4442 $define) val="$undef" ;;
4449 useithreads="$undef"
4450 use5005threads="$undef"
4454 case "$useithreads$use5005threads" in
4458 You cannot have both the ithreads and the 5.005 threads enabled
4459 at the same time. Disabling the 5.005 threads since they are
4460 much less stable than the ithreads.
4463 use5005threads="$undef"
4468 : perl-5.9.x and later
4470 if test X"$usethreads" = "X$define"; then
4471 case "$use5005threads" in
4475 5.005 threads has been removed for 5.10. Perl will be built using ithreads.
4482 use5005threads="$undef"
4483 useithreads="$usethreads"
4486 case "$d_oldpthreads" in
4487 '') : Configure tests would be welcome here. For now, assume undef.
4489 *) val="$d_oldpthreads" ;;
4495 : Look for a hint-file generated 'call-back-unit'. If the
4496 : user has specified that a threading perl is to be built,
4497 : we may need to set or change some other defaults.
4498 if $test -f usethreads.cbu; then
4499 echo "Your platform has some specific hints regarding threaded builds, using them..."
4502 case "$usethreads" in
4503 "$define"|true|[yY]*)
4505 (Your platform does not have any specific hints for threaded builds.
4506 Assuming POSIX threads, then.)
4512 : Check if multiplicity is required
4515 Perl can be built so that multiple Perl interpreters can coexist
4516 within the same Perl executable.
4519 case "$useithreads" in
4522 This multiple interpreter support is required for interpreter-based threads.
4526 *) case "$usemultiplicity" in
4527 $define|true|[yY]*) dflt='y';;
4531 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4532 rp='Build Perl for multiplicity?'
4535 y|Y) val="$define" ;;
4543 : Check if morebits is requested
4544 case "$usemorebits" in
4545 "$define"|true|[yY]*)
4546 use64bitint="$define"
4547 uselongdouble="$define"
4548 usemorebits="$define"
4550 *) usemorebits="$undef"
4554 : Determine the C compiler to be used
4560 rp="Use which C compiler?"
4564 : See whether they have no cc but they do have gcc
4566 if $test -f cc.cbu; then
4571 : make some quick guesses about what we are up against
4573 $echo $n "Hmm... $c"
4583 $cat $sysroot/usr/include/signal.h $sysroot/usr/include/sys/signal.h >foo 2>/dev/null
4584 if test -f /osf_boot || $contains 'OSF/1' $sysroot/usr/include/ctype.h >/dev/null 2>&1
4586 echo "Looks kind of like an OSF/1 system, but we'll see..."
4588 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4589 xxx=`./loc addbib blurfl $pth`
4590 if $test -f $xxx; then
4591 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4595 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4596 echo "Looks kind of like an extended USG system, but we'll see..."
4598 echo "Looks kind of like a USG system, but we'll see..."
4602 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4603 echo "Looks kind of like a BSD system, but we'll see..."
4607 echo "Looks kind of like a Version 7 system, but we'll see..."
4610 case "$eunicefix" in
4613 There is, however, a strange, musty smell in the air that reminds me of
4614 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4618 : it so happens the Eunice I know will not run shell scripts in Unix format
4622 echo "Congratulations. You aren't running Eunice."
4626 : Detect OS2. The p_ variable is set above in the Head.U unit.
4627 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4628 : semicolon as a patch separator
4633 I have the feeling something is not exactly right, however...don't tell me...
4634 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4635 (Or you may be running DOS with DJGPP.)
4640 if test -f /xenix; then
4641 echo "Actually, this looks more like a XENIX system..."
4646 echo "It's not Xenix..."
4651 if test -f /venix; then
4652 echo "Actually, this looks more like a VENIX system..."
4659 echo "Nor is it Venix..."
4662 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4663 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4666 : Check if we are using GNU gcc and what its version is
4668 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4672 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4674 printf("%s\n", __VERSION__);
4676 printf("%s\n", "1");
4682 if $cc -o try $ccflags $ldflags try.c; then
4683 gccversion=`$run ./try`
4684 case "$gccversion" in
4685 '') echo "You are not using GNU cc." ;;
4686 *) echo "You are using GNU cc $gccversion."
4692 echo "*** WHOA THERE!!! ***" >&4
4693 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4694 case "$knowitall" in
4696 echo " You'd better start hunting for one and let me know about it." >&4
4702 case "$gccversion" in
4703 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4705 case "$gccversion" in
4706 '') gccosandvers='' ;;
4707 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4708 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4710 case "$gccosandvers" in
4711 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4712 $osname$osvers) ;; # looking good
4713 $osname*) cat <<EOM >&4
4715 *** WHOA THERE!!! ***
4717 Your gcc has not been compiled for the exact release of
4718 your operating system ($gccosandvers versus $osname$osvers).
4720 In general it is a good idea to keep gcc synchronized with
4721 the operating system because otherwise serious problems
4722 may ensue when trying to compile software, like Perl.
4724 I'm trying to be optimistic here, though, and will continue.
4725 If later during the configuration and build icky compilation
4726 problems appear (headerfile conflicts being the most common
4727 manifestation), I suggest reinstalling the gcc to match
4728 your operating system release.
4732 *) gccosandvers='' ;; # failed to parse, better be silent
4740 # gcc 3.* complain about adding -Idirectories that they already know about,
4741 # so we will take those off from locincpth.
4742 case "$gccversion" in
4744 echo "main(){}">try.c
4745 for incdir in $locincpth; do
4746 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4747 grep '^c[cp]p*[01]: warning: changing search order '`
4748 if test "X$warn" != X; then
4749 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4755 # gcc 4.9 by default does some optimizations that break perl.
4756 # see ticket 121505.
4758 # The -fwrapv disables those optimizations (and probably others,) so
4759 # for gcc 4.9 (and later, since the optimizations probably won't go
4760 # away), add -fwrapv unless the user requests -fno-wrapv, which
4761 # disables -fwrapv, or if the user requests -fsanitize=undefined,
4762 # which turns the overflows -fwrapv ignores into runtime errors.
4763 case "$gccversion" in
4764 4.[3-9].*|4.[1-9][0-9]*|[5-9].*|[1-9][0-9]*)
4766 *-fno-wrapv*|*-fsanitize=undefined*|*-fwrapv*) ;;
4767 *) ccflags="$ccflags -fwrapv" ;;
4771 : What should the include directory be ?
4772 : Use sysroot if set, so findhdr looks in the right place.
4774 $echo $n "Hmm... $c"
4775 dflt="$sysroot/usr/include"
4778 if $test -f /bin/mips && /bin/mips; then
4779 echo "Looks like a MIPS system..."
4780 $cat >usr.c <<'EOCP'
4781 #ifdef SYSTYPE_BSD43
4785 if $cc $cppflags -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4786 dflt='/bsd43/usr/include'
4790 mips_type='System V'
4792 $rm -f usr.c usr.out
4793 echo "and you're compiling with the $mips_type compiler and libraries."
4797 echo "Doesn't look like a MIPS system."
4807 case "$xxx_prompt" in
4810 rp='Where are the include files you want to use?'
4818 : see how we invoke the C preprocessor
4820 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4821 cat <<'EOT' >testcpp.c
4827 if test ! -f cppstdin; then
4828 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4829 # AIX cc -E doesn't show the absolute headerfile
4830 # locations but we'll cheat by using the -M flag.
4831 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
4833 echo 'cat >.$$.c; '"$cc $cppflags"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4836 echo "Keeping your $hint cppstdin wrapper."
4839 wrapper=`pwd`/cppstdin
4843 if $test "X$cppstdin" != "X" && \
4844 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4845 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4847 echo "You used to use $cppstdin $cppminus so we'll use that again."
4849 '') echo "But let's see if we can live without a wrapper..." ;;
4851 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4852 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4854 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4857 echo "(However, $cpprun $cpplast does not work, let's see...)"
4865 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4872 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4873 $cc -E <testcpp.c >testcpp.out 2>&1; \
4874 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4875 echo "Yup, it does."
4876 x_cpp="$cc $cppflags -E"
4878 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4879 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4880 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4881 echo "Yup, it does."
4882 x_cpp="$cc $cppflags -E"
4884 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4885 $cc -P <testcpp.c >testcpp.out 2>&1; \
4886 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4887 echo "Yipee, that works!"
4888 x_cpp="$cc $cppflags -P"
4890 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4891 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4892 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4893 echo "At long last!"
4894 x_cpp="$cc $cppflags -P"
4896 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4897 $cpp <testcpp.c >testcpp.out 2>&1; \
4898 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4900 x_cpp="$cpp $cppflags"
4902 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4903 $cpp - <testcpp.c >testcpp.out 2>&1; \
4904 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4905 echo "Hooray, it works! I was beginning to wonder."
4906 x_cpp="$cpp $cppflags"
4908 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4909 $wrapper <testcpp.c >testcpp.out 2>&1; \
4910 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4916 rp="No dice. I can't find a C preprocessor. Name one:"
4920 $x_cpp <testcpp.c >testcpp.out 2>&1
4921 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4922 echo "OK, that will do." >&4
4924 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4939 echo "Perhaps can we force $cc -E using a wrapper..."
4940 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4941 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4947 echo "Nope, we'll have to live without it..."
4961 "$wrapper"|'cppstdin') ;;
4962 *) $rm -f $wrapper;;
4964 $rm -f testcpp.c testcpp.out
4966 : Adjust cppfilter for path component separator
4968 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
4969 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
4973 : Use gcc to determine libpth and incpth
4974 # If using gcc or clang, we can get better values for libpth, incpth
4975 # and usrinc directly from the compiler.
4976 # Note that ccname for clang is also gcc.
4979 $echo 'extern int foo;' > try.c
4980 set X `$cppstdin -v try.c 2>&1 | $awk '/^#include </,/^End of search /'|$cppfilter $grep '/include'`
4982 if $test $# -gt 0; then
4984 incpth="`$echo $incpth|$sed 's/^ //'`"
4986 j="`$echo $i|$sed 's,/include$,/lib,'`"
4987 if $test -d $j; then
4991 libpth="`$echo $libpth|$sed 's/^ //'`"
4992 for xxx in $libpth $loclibpth $plibpth $glibpth; do
4993 if $test -d $xxx; then
4996 *) libpth="$libpth $xxx";;
5003 '') for i in $incpth; do
5004 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
5012 case "$usecrosscompile" in
5015 '') echo "Incpth not defined." >&4; croak=y ;;
5016 *) echo "Using incpth '$incpth'." >&4 ;;
5019 '') echo "Libpth not defined." >&4; croak=y ;;
5020 *) echo "Using libpth '$libpth'." >&4 ;;
5023 '') echo "Usrinc not defined." >&4; croak=y ;;
5024 *) echo "Using usrinc $usrinc." >&4 ;;
5028 if test "X$sysroot" = X; then
5029 echo "Cannot continue, aborting." >&4; exit 1
5031 echo "Cross-compiling using sysroot $sysroot, failing to guess inc/lib paths is not fatal" >&4
5040 : Default value for incpth is just usrinc
5042 '') incpth="$usrinc";;
5045 : Set private lib path
5048 plibpth="$incpath/usr/lib $sysroot/usr/local/lib $sysroot/usr/ccs/lib"
5053 '') dlist="$loclibpth $plibpth $glibpth";;
5054 *) dlist="$libpth";;
5057 : Now check and see which directories actually exist, avoiding duplicates
5060 if $test -d $xxx; then
5063 *) libpth="$libpth $xxx";;
5069 Some systems have incompatible or broken versions of libraries. Among
5070 the directories listed in the question below, please remove any you
5071 know not to be holding relevant libraries, and add any that are needed.
5072 Say "none" for none.
5076 if test "X$sysroot" != X; then
5078 You have set sysroot to $sysroot, please supply the directories excluding sysroot
5091 rp="Directories to use for library searches?"
5098 : compute shared library extension
5101 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
5111 On some systems, shared libraries may be available. Answer 'none' if
5112 you want to suppress searching of shared libraries for the remainder
5113 of this configuration.
5116 rp='What is the file extension used for shared libraries?'
5120 : Does target system insist that shared library basenames are unique
5123 Some dynamic loaders assume that the *basename* of shared library filenames
5124 are globally unique. We'll default this to undef as we assume your system
5125 is not this weird. Set to defined if you're on one of them.
5130 rp='Make shared library basenames unique?'
5133 y|Y) val="$define" ;;
5136 set d_libname_unique
5139 : Define several unixisms.
5140 : Hints files or command line option can be used to override them.
5141 : The convoluted testing is in case hints files set either the old
5144 '') case "$exe_ext" in
5146 *) _exe="$exe_ext" ;;
5151 '') case "$lib_ext" in
5158 '') case "$obj_ext" in
5165 '') case "$path_sep" in
5176 rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
5178 : Which makefile gets called first. This is used by make depend.
5179 case "$firstmakefile" in
5180 '') firstmakefile='makefile';;
5183 : Check is we will use socks
5185 $define|true|[yY]*) dflt='y';;
5190 Perl can be built to use the SOCKS proxy protocol library. To do so,
5191 Configure must be run with -Dusesocks. If you use SOCKS you also need
5192 to use the PerlIO abstraction layer, this will be implicitly selected.
5194 If this doesn't make any sense to you, just accept the default '$dflt'.
5196 rp='Build Perl for SOCKS?'
5199 y|Y) val="$define" ;;
5205 : Check for uselongdouble support
5207 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
5210 case "$uselongdouble" in
5211 $define|true|[yY]*) dflt='y';;
5216 Perl can be built to take advantage of long doubles which
5217 (if available) may give more accuracy and range for floating point numbers.
5219 If this doesn't make any sense to you, just accept the default '$dflt'.
5221 rp='Try to use long doubles if available?'
5224 y|Y) val="$define" ;;
5230 case "$uselongdouble" in
5231 true|[yY]*) uselongdouble="$define" ;;
5234 : Look for a hint-file generated 'call-back-unit'. If the
5235 : user has specified that long doubles should be used,
5236 : we may need to set or change some other defaults.
5237 if $test -f uselongdouble.cbu; then
5238 echo "Your platform has some specific hints regarding long doubles, using them..."
5239 . ./uselongdouble.cbu
5241 case "$uselongdouble" in
5244 (Your platform does not have any specific hints for long doubles.)
5250 : Check if quadmath is requested
5251 case "$usequadmath" in
5252 "$define"|true|[yY]*) usequadmath="$define" ;;
5253 *) usequadmath="$undef" ;;
5256 : Fail if both uselongdouble and usequadmath are requested
5257 case "$usequadmath:$uselongdouble" in
5261 *** You requested the use of the quadmath library and use
5262 *** of long doubles.
5264 *** Please select one or the other.
5270 : Looking for optional libraries
5272 echo "Checking for optional libraries..." >&4
5277 case "$libswanted" in
5278 '') libswanted='c_s';;
5281 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
5283 case "$usecbacktrace" in
5284 "$define") libswanted="$libswanted bfd" ;;
5286 case "$usequadmath" in
5287 "$define") libswanted="$libswanted quadmath" ;;
5293 for thisdir in $libpth $xlibpth; do
5294 test -d $thisdir && libspath="$libspath $thisdir"
5296 for thislib in $libswanted; do
5297 for thisdir in $libspath; do
5299 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
5300 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
5301 $test -f "$xxx" && eval $libscheck
5302 $test -f "$xxx" && libstyle=shared
5303 xxx=`ls $thisdir/lib$thislib.[0-9].$so 2>/dev/null|sed -n '$p'`
5304 $test -f "$xxx" && eval $libscheck
5305 $test -f "$xxx" && libstyle=shared
5307 if test ! -f "$xxx"; then
5308 xxx=$thisdir/lib$thislib.$so
5309 $test -f "$xxx" && eval $libscheck
5310 $test -f "$xxx" && libstyle=shared
5312 if test ! -f "$xxx"; then
5313 xxx=$thisdir/lib$thislib$_a
5314 $test -f "$xxx" && eval $libscheck
5315 $test -f "$xxx" && libstyle=static
5317 if test ! -f "$xxx"; then
5318 xxx=$thisdir/$thislib$_a
5319 $test -f "$xxx" && eval $libscheck
5320 $test -f "$xxx" && libstyle=static
5322 if test ! -f "$xxx"; then
5323 xxx=$thisdir/lib${thislib}_s$_a
5324 $test -f "$xxx" && eval $libscheck
5325 $test -f "$xxx" && libstyle=static
5326 $test -f "$xxx" && thislib=${thislib}_s
5328 if test ! -f "$xxx"; then
5329 xxx=$thisdir/Slib$thislib$_a
5330 $test -f "$xxx" && eval $libscheck
5331 $test -f "$xxx" && libstyle=static
5333 if $test -f "$xxx"; then
5335 shared) echo "Found -l$thislib (shared)." ;;
5336 static) echo "Found -l$thislib." ;;
5337 *) echo "Found -l$thislib ($libstyle)." ;;
5341 *) dflt="$dflt -l$thislib"
5342 libsfound="$libsfound $xxx"
5344 libsfiles="$libsfiles $yyy"
5345 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
5346 case " $libsdirs " in
5348 *) libsdirs="$libsdirs $yyy" ;;
5355 if $test ! -f "$xxx"; then
5356 echo "No -l$thislib."
5367 ' '|'') dflt='none';;
5372 In order to compile $package on your machine, a number of libraries
5373 are usually needed. Include any other special libraries here as well.
5374 Say "none" for none. The default list is almost always right.
5378 rp="What libraries to use?"
5385 : determine optimization, if desired, or use for debug flag also
5387 ' '|$undef) dflt='none';;
5389 *) dflt="$optimize";;
5393 By default, $package compiles with the -O flag to use the optimizer.
5394 Alternately, you might want to use the symbolic debugger, which uses
5395 the -g flag (on traditional Unix systems). Either flag can be
5396 specified here. To use neither flag, specify the word "none".
5399 rp="What optimizer/debugger flag should be used?"
5403 'none') optimize=" ";;
5406 : Check what DEBUGGING is required from the command line
5407 : -DEBUGGING or -DDEBUGGING or
5408 : -DEBUGGING=both = -g + -DDEBUGGING
5409 : -DEBUGGING=-g or -Doptimize=-g = -g
5410 : -DEBUGGING=none or -UDEBUGGING =
5411 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
5414 *) DEBUGGING=$EBUGGING ;;
5417 case "$DEBUGGING" in
5421 *) optimize="$optimize -g" ;;
5425 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
5433 case "$DEBUGGING" in
5434 both|$define) dflt='-DDEBUGGING'
5437 : argument order is deliberate, as the flag will start with - which set could
5438 : think is an option
5439 checkccflag='check=$1; flag=$2; callback=$3;
5441 echo "Checking if your compiler accepts $flag" 2>&1;
5442 [ "X$sysroot" != "X" ] && echo "For sysroot = $sysroot";
5443 echo "int main(void) { return 0; }" > gcctest.c;
5444 if $cc $_sysroot -O2 $flag -o gcctest gcctest.c 2>gcctest.out && $run ./gcctest; then
5445 echo "Yes, it does." 2>&1;
5446 if $test -s gcctest.out ; then
5447 echo "But your platform does not like it:";
5452 echo "Leaving current flags $ccflags alone." 2>&1
5454 *) dflt="$dflt $flag";
5460 echo "Nope, it does not, but that is ok." 2>&1;
5464 : We will not override a previous value, but we might want to
5465 : augment a hint file
5467 default|recommended)
5468 case "$gccversion" in
5469 1*) dflt="$dflt -fpcc-struct-return" ;;
5471 case "$optimize:$DEBUGGING" in
5472 *-g*:old) dflt="$dflt -DDEBUGGING";;
5474 case "$gccversion" in
5475 2*) if $test -d /etc/conf/kconfig.d &&
5476 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
5478 # Interactive Systems (ISC) POSIX mode.
5483 case "$gccversion" in
5486 ?*) set strict-aliasing -fno-strict-aliasing
5490 # For gcc, adding -pipe speeds up compilations for some, but apparently
5491 # some assemblers can't read from stdin. (It also slows down compilations
5492 # in other cases, but those are apparently rarer these days.) AD 5/2004.
5493 case "$gccversion" in
5499 # on x86_64 (at least) we require an extra library (libssp) in the
5500 # link command line. This library is not named, so I infer that it is
5501 # an implementation detail that may change. Hence the safest approach
5502 # is to add the flag to the flags passed to the compiler at link time,
5503 # as that way the compiler can do the right implementation dependant
5506 amigaos) ;; # -fstack-protector builds but doesn't work
5507 *) case "$gccversion" in
5508 ?*) set stack-protector-strong -fstack-protector-strong
5511 *-fstack-protector-strong*) ;; # It got added.
5512 *) # Try the plain/older -fstack-protector.
5513 set stack-protector -fstack-protector
5524 case "$mips_type" in
5525 *BSD*|'') inclwanted="$locincpth $usrinc";;
5526 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
5528 for thisincl in $inclwanted; do
5529 if $test -d $thisincl; then
5530 if $test x$thisincl != x$usrinc; then
5532 *" -I$thisincl "*);;
5533 *) dflt="$dflt -I$thisincl ";;
5539 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
5541 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5549 *) dflt="$dflt -D$2";;
5553 set signal.h LANGUAGE_C; eval $inctest
5557 ccflags="$ccflags -DSOCKS"
5562 default|recommended) dflt="$ccflags $dflt" ;;
5563 *) dflt="$ccflags";;
5572 Your C compiler may want other flags. For this question you should include
5573 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5574 but you should NOT include libraries or ld flags like -lwhatever. If you
5575 want $package to honor its debug switch, you should include -DDEBUGGING here.
5576 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5578 To use no flags, specify the word "none".
5584 rp="Any additional cc flags?"
5591 : the following weeds options from ccflags that are of no interest to cpp
5593 '') cppflags="$ccflags" ;;
5594 *) set X $ccflags; shift
5595 case " $cppflags " in
5596 *" $1 "*) ;; # Try to avoid doubling the cppflags.
5597 *) cppflags="$cppflags $ccflags" ;;
5601 case "$gccversion" in
5602 1*) cppflags="$cppflags -D__GNUC__"
5604 case "$mips_type" in
5606 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5612 echo "Let me guess what the preprocessor flags are..." >&4
5626 *) ftry="$previous $flag";;
5628 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5629 >cpp1.out 2>/dev/null && \
5630 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5631 >cpp2.out 2>/dev/null && \
5632 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5633 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5635 cppflags="$cppflags $ftry"
5645 *-*) echo "They appear to be: $cppflags";;
5647 $rm -f cpp.c cpp?.out
5651 : flags used in final linking phase
5653 '') if ./venix; then
5659 *-posix*) dflt="$dflt -posix" ;;
5662 *) dflt="$ldflags";;
5664 # See note above about -fstack-protector
5666 *-fstack-protector-strong*)
5668 *-fstack-protector-strong*) ;; # Don't add it again
5669 *) dflt="$dflt -fstack-protector-strong" ;;
5672 *-fstack-protector*)
5674 *-fstack-protector*) ;; # Don't add it again
5675 *) dflt="$dflt -fstack-protector" ;;
5680 : Try to guess additional flags to pick up local libraries.
5681 for thislibdir in $libpth; do
5682 case " $loclibpth " in
5685 *"-L$thislibdir "*) ;;
5686 *) dflt="$dflt -L$thislibdir" ;;
5698 Your C linker may need flags. For this question you should
5699 include -L/whatever and any other flags used by the C linker, but you
5700 should NOT include libraries like -lwhatever.
5702 Make sure you include the appropriate -L/path flags if your C linker
5703 does not normally search all of the directories you specified above,
5706 To use no flags, specify the word "none".
5710 rp="Any additional ld flags (NOT including libraries)?"
5716 rmlist="$rmlist pdp11"
5720 echo "Checking your choice of C compiler and flags for coherency..." >&4
5721 $cat > try.c <<'EOF'
5723 int main() { printf("Ok\n"); return(0); }
5725 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5727 $cat >try.msg <<'EOM'
5728 I've tried to compile and run the following simple program:
5731 $cat try.c >> try.msg
5733 $cat >> try.msg <<EOM
5740 and I got the following output:
5744 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5745 if $sh -c "$run ./try " >>try.msg 2>&1; then
5749 *) echo 'The program compiled OK, but produced no output.' >> try.msg ;;
5752 echo "The program compiled OK, but exited with status $?." >>try.msg
5753 rp="You have a problem. Shall I abort Configure"
5757 echo "I can't compile the test program." >>try.msg
5758 rp="You have a BIG problem. Shall I abort Configure"
5764 case "$knowitall" in
5766 echo "(The supplied flags or libraries might be incorrect.)"
5774 *) echo "Ok. Stopping Configure." >&4
5779 n) echo "OK, that should do.";;
5781 $rm_try gcctest gcctest.out
5783 : define a shorthand compile call
5787 case "$usedevel" in $define|true|[yY]*) if $test ! -f "${mc_file}.c"; then
5788 echo "Internal Configure script bug - compiler test file ${mc_file}.c is missing. Please report this to perlbug@perl.org" >&4;
5792 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5793 : define a shorthand compile call for compilations that should be ok.
5797 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5799 : stub, used only to satisfy other units
5802 : check for lengths of integral types
5806 echo "Checking to see how big your integers are..." >&4
5815 printf("intsize=%d;\n", (int)sizeof(int));
5816 printf("longsize=%d;\n", (int)sizeof(long));
5817 printf("shortsize=%d;\n", (int)sizeof(short));
5822 if eval $compile_ok && $run ./try > /dev/null; then
5824 echo "Your integers are $intsize bytes long."
5825 echo "Your long integers are $longsize bytes long."
5826 echo "Your short integers are $shortsize bytes long."
5830 Help! I can't compile and run the intsize test program: please enlighten me!
5831 (This is probably a misconfiguration in your system or libraries, and
5832 you really ought to fix it. Still, I'll try anyway.)
5836 rp="What is the size of an integer (in bytes)?"
5840 rp="What is the size of a long integer (in bytes)?"
5844 rp="What is the size of a short integer (in bytes)?"
5852 : check for long long
5854 echo "Checking to see if you have long long..." >&4
5855 echo 'int main() { long long x = 7; return 0; }' > try.c
5857 if eval $compile; then
5859 echo "You have long long."
5862 echo "You do not have long long."
5868 : check for length of long long
5869 case "${d_longlong}${longlongsize}" in
5872 echo "Checking to see how big your long longs are..." >&4
5873 $cat >try.c <<'EOCP'
5877 printf("%d\n", (int)sizeof(long long));
5882 if eval $compile_ok; then
5883 longlongsize=`$run ./try`
5884 echo "Your long longs are $longlongsize bytes long."
5888 echo "(I can't seem to compile the test program. Guessing...)"
5889 rp="What is the size of a long long (in bytes)?"
5893 if $test "X$longsize" = "X$longlongsize"; then
5894 echo "(That isn't any different from an ordinary long.)"
5900 : determine filename position in cpp output
5902 echo "Computing filename position in cpp output for #include directives..." >&4
5904 amigaos) fieldn=3 ;; # Workaround for a bug in abc (pdksh).
5909 vos) testaccess=-e ;;
5912 echo '#include <stdio.h>' > foo.c
5915 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5916 $grep '^[ ]*#.*stdio\.h' | \
5917 while read cline; do
5920 while $test \$# -gt 0; do
5921 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5926 pos=\`expr \$pos + 1\`
5940 *) pos="${fieldn}th";;
5942 echo "Your cpp writes the filename in the $pos field of the line."
5944 : locate header file
5949 for usrincdir in $incpth
5951 if test -f \$usrincdir/\$wanted; then
5952 echo "\$usrincdir/\$wanted"
5956 awkprg='{ print \$$fieldn }'
5957 echo "#include <\$wanted>" > foo\$\$.c
5958 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5959 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5960 while read cline; do
5961 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5963 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5964 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5969 # status = 0: grep returned 0 lines, case statement not executed
5970 # status = 1: headerfile found
5971 # status = 2: while loop executed, no headerfile found
5975 if test \$status -eq 1; then
5982 : define an alternate in-header-list? function
5983 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5984 cont=true; xxf="echo \"<\$1> found.\" >&4";
5985 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5986 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5988 case $# in 4) instead=instead;; *) instead="at last";; esac;
5989 while $test "$cont"; do
5991 var=$2; eval "was=\$$2";
5992 if $test "$xxx" && $test -r "$xxx";
5994 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5997 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5998 set $yyy; shift; shift; yyy=$@;
5999 case $# in 0) cont="";;
6000 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
6001 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
6002 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
6003 xxnf="echo \"there is no <\$1>, ...\" >&4";;
6007 do set $yyy; var=$2; eval "was=\$$2";
6008 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
6009 set $yyy; shift; shift; yyy=$@;
6012 : see if inttypes.h is available
6013 : we want a real compile instead of Inhdr because some systems
6014 : have an inttypes.h which includes non-existent headers
6017 #include <inttypes.h>
6019 static int32_t foo32 = 0x12345678;
6023 if eval $compile; then
6024 echo "<inttypes.h> found." >&4
6027 echo "<inttypes.h> NOT found." >&4
6036 echo "Checking to see if you have int64_t..." >&4
6038 #include <sys/types.h>
6039 #$i_inttypes I_INTTYPES
6041 #include <inttypes.h>
6043 int main() { int64_t x = 7; }
6046 if eval $compile; then
6048 echo "You have int64_t."
6051 echo "You do not have int64_t."
6057 : Check if 64bit ints have a quad type
6059 echo "Checking which 64-bit integer type we could use..." >&4
6065 val='"unsigned int"'
6070 *) case "$longsize" in
6074 val='"unsigned long"'
6079 *) case "$d_longlong:$longlongsize" in
6084 val='"unsigned long long"'
6089 *) case "$d_int64_t" in
6108 '') echo "Alas, no 64-bit integer types in sight." >&4
6111 *) echo "We could use '$quadtype' for 64-bit integers." >&4
6116 : Do we want 64bit support
6117 case "$uselonglong" in
6118 "$define"|true|[yY]*)
6121 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
6123 use64bitint="$define"
6126 case "$use64bits" in
6127 "$define"|true|[yY]*)
6130 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
6132 use64bitint="$define"
6135 case "$use64bitints" in
6136 "$define"|true|[yY]*)
6139 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
6141 use64bitint="$define"
6144 case "$use64bitsint" in
6145 "$define"|true|[yY]*)
6148 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
6150 use64bitint="$define"
6153 case "$uselonglongs" in
6154 "$define"|true|[yY]*)
6157 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
6159 use64bitint="$define"
6162 case "$use64bitsall" in
6163 "$define"|true|[yY]*)
6166 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
6168 use64bitall="$define"
6173 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
6175 case "$use64bitall" in
6176 "$define"|true|[yY]*) use64bitint="$define" ;;
6182 You have natively 64-bit long integers.
6186 *) case "$use64bitint" in
6187 "$define"|true|[yY]*) dflt='y';;
6196 Perl can be built to take advantage of 64-bit integer types
6197 on some systems. To do so, Configure can be run with -Duse64bitint.
6198 Choosing this option will most probably introduce binary incompatibilities.
6200 If this doesn't make any sense to you, just accept the default '$dflt'.
6201 (The default has been chosen based on your configuration.)
6203 rp='Try to use 64-bit integers, if available?'
6206 [yY]*) val="$define" ;;
6214 case "$use64bitall" in
6215 "$define"|true|[yY]*) dflt='y' ;;
6216 *) case "$longsize" in
6224 You may also choose to try maximal 64-bitness. It means using as much
6225 64-bitness as possible on the platform. This in turn means even more
6226 binary incompatibilities. On the other hand, your platform may not
6227 have any more 64-bitness available than what you already have chosen.
6229 If this doesn't make any sense to you, just accept the default '$dflt'.
6230 (The default has been chosen based on your configuration.)
6232 rp='Try to use maximal 64-bit support, if available?'
6235 [yY]*) val="$define" ;;
6240 case "$use64bitall" in
6242 case "$use64bitint" in
6246 Since you have chosen a maximally 64-bit build, I'm also turning on
6247 the use of 64-bit integers.
6249 use64bitint="$define" ;;
6254 : Look for a hint-file generated 'call-back-unit'. If the
6255 : user has specified that a 64-bit perl is to be built,
6256 : we may need to set or change some other defaults.
6257 if $test -f use64bitint.cbu; then
6258 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
6261 case "$use64bitint" in
6262 "$define"|true|[yY]*)
6263 : This test was common to all the OpenBSD forks, and seems harmless for
6266 echo "Checking if your C library has broken 64-bit functions..." >&4
6269 typedef $uquadtype myULL;
6276 {4294967303.15, 4294967303ULL},
6277 {4294967294.2, 4294967294ULL},
6278 {4294967295.7, 4294967295ULL},
6281 for (p = test; p->u; p++) {
6282 myULL x = (myULL)p->d;
6293 if eval $compile_ok; then
6294 libcquad=`$run ./try`
6295 echo "Your C library's 64-bit functions are $libcquad."
6297 echo "(I can't seem to compile the test program.)"
6298 echo "Assuming that your C library's 64-bit functions are ok."
6307 *** You have a C library with broken 64-bit functions.
6308 *** 64-bit support does not work reliably in this configuration.
6309 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
6310 *** Cannot continue, aborting.
6317 4) case "$archname64" in
6318 '') archname64=64int ;;
6325 : Look for a hint-file generated 'call-back-unit'. If the
6326 : user has specified that a maximally 64-bit perl is to be built,
6327 : we may need to set or change some other defaults.
6328 if $test -f use64bitall.cbu; then
6329 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
6332 case "$use64bitall" in
6333 "$define"|true|[yY]*)
6335 4) case "$archname64" in
6336 ''|64int) archname64=64all ;;
6343 case "$d_quad:$use64bitint" in
6347 *** You have chosen to use 64-bit integers,
6348 *** but none can be found.
6349 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
6350 *** Cannot continue, aborting.
6357 : Check if we are using the GNU C library
6359 echo "Checking for GNU C Library..." >&4
6361 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
6362 alone are insufficient to distinguish different versions, such as
6363 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
6364 libc version 2.1.0. A. Dougherty, June 3, 2002.
6370 # ifdef __GLIBC_MINOR__
6371 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
6372 # include <gnu/libc-version.h>
6373 printf("%s\n", gnu_get_libc_version());
6375 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
6378 printf("%d\n", __GLIBC__);
6387 if eval $compile_ok && $run ./try > glibc.ver; then
6389 gnulibc_version=`$cat glibc.ver`
6390 echo "You are using the GNU C Library version $gnulibc_version"
6394 echo "You are not using the GNU C Library"
6400 : see if nm is to be used to determine whether a symbol is defined or not
6404 case "$d_gnulibc" in
6407 echo "nm probably won't work on the GNU C Library." >&4
6413 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
6415 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
6416 echo "'nm' won't be sufficient on this system." >&4
6422 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
6423 if $test $dflt -gt 20; then
6433 true|$define) dflt=y;;
6440 I can use $nm to extract the symbols from your C libraries. This
6441 is a time consuming task which may generate huge output on the disk (up
6442 to 3 megabytes) but that should make the symbols extraction faster. The
6443 alternative is to skip the 'nm' extraction part and to compile a small
6444 test program instead to determine whether each symbol is present. If
6445 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
6446 this may be the best solution.
6448 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
6451 rp="Shall I use $nm to extract C symbols from the libraries?"
6454 [Nn]*) usenm=false;;
6463 : nm options which may be necessary
6465 '') if $test -f /mach_boot; then
6467 elif $test -d /usr/ccs/lib; then
6468 nm_opt='-p' # Solaris (and SunOS?)
6469 elif $test -f /dgux; then
6471 elif $test -f /lib64/rld; then
6472 nm_opt='-p' # 64-bit Irix
6478 : nm options which may be necessary for shared libraries but illegal
6479 : for archive libraries. Thank you, Linux.
6480 case "$nm_so_opt" in
6481 '') case "$myuname" in
6483 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
6484 nm_so_opt='--dynamic'
6491 : Figure out where the libc is located
6494 : get list of predefined functions in a handy place
6499 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
6505 *) for thislib in $libs; do
6508 : Handle C library specially below.
6511 thislib=`echo $thislib | $sed -e 's/^-l//'`
6512 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
6514 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
6516 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
6518 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
6520 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
6522 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
6524 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
6529 libnames="$libnames $try"
6531 *) libnames="$libnames $thislib" ;;
6540 for xxx in $libpth; do
6541 $test -r $1 || set $xxx/libc.$so
6542 : The messy sed command sorts on library version numbers.
6544 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
6545 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
6547 s/[0-9][0-9]*/0000&/g
6548 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
6551 $sort | $sed -e 's/^.* //'`
6554 $test -r $1 || set $sysroot/usr/ccs/lib/libc.$so
6555 $test -r $1 || set $sysroot/lib/libsys_s$_a
6561 if $test -r "$1"; then
6562 echo "Your (shared) C library seems to be in $1."
6564 elif $test -r /lib/libc && $test -r /lib/clib; then
6565 echo "Your C library seems to be in both /lib/clib and /lib/libc."
6567 libc='/lib/clib /lib/libc'
6568 if $test -r /lib/syslib; then
6569 echo "(Your math library is in /lib/syslib.)"
6570 libc="$libc /lib/syslib"
6572 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
6573 echo "Your C library seems to be in $libc, as you said before."
6574 elif $test -r $incpath/usr/lib/libc$_a; then
6575 libc=$incpath/usr/lib/libc$_a;
6576 echo "Your C library seems to be in $libc. That's fine."
6577 elif $test -r /lib/libc$_a; then
6579 echo "Your C library seems to be in $libc. You're normal."
6581 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
6583 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
6584 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
6585 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
6587 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
6589 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
6592 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
6594 if $test -r "$tans"; then
6595 echo "Your C library seems to be in $tans, of all places."
6601 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
6605 If the guess above is wrong (which it might be if you're using a strange
6606 compiler, or your machine supports multiple models), you can override it here.
6611 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
6613 I can't seem to find your C library. I've looked in the following places:
6616 $sed 's/^/ /' libpath
6619 None of these seems to contain your C library. I need to get its name...
6624 rp='Where is your C library?'
6629 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
6630 set X `cat libnames`
6633 case $# in 1) xxx=file; esac
6634 echo "Extracting names from the following $xxx for later perusal:" >&4
6636 $sed 's/^/ /' libnames >&4
6638 $echo $n "This may take a while...$c" >&4
6642 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
6643 *) $nm $nm_opt $file 2>/dev/null;;
6648 $grep fprintf libc.tmp > libc.ptf
6649 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
6650 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
6652 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
6654 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6656 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
6658 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6660 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
6662 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6664 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
6666 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6668 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
6670 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6672 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
6674 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6676 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
6677 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
6679 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6681 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
6683 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6685 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
6687 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6689 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
6691 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6693 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
6695 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6697 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
6699 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6701 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
6703 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6705 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
6707 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6710 $nm -p $* 2>/dev/null >libc.tmp
6711 $grep fprintf libc.tmp > libc.ptf
6712 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
6713 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
6719 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
6721 if $ar t $libc > libc.tmp && \
6722 $contains '^fprintf$' libc.tmp >/dev/null 2>&1
6724 for thisname in $libnames $libc; do
6725 $ar t $thisname >>libc.tmp
6727 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
6729 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
6730 for thisname in $libnames $libc; do
6731 $ar tv $thisname >>libc.tmp
6732 emximp -o tmp.imp $thisname \
6734 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
6735 < tmp.imp >>libc.tmp
6738 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
6741 echo "$ar didn't seem to work right." >&4
6742 echo "Maybe this is a Cray...trying bld instead..." >&4
6744 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list &&
6747 for thisname in $libnames; do
6749 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
6750 $ar t $thisname >>libc.tmp
6754 echo "That didn't work either. Giving up." >&4
6764 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
6765 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
6767 *) if $test -f /lib/syscalls.exp; then
6769 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
6770 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' \
6771 /lib/syscalls.exp >>libc.list
6777 $rm -f libnames libpath
6779 : Check if we are using C++
6781 echo "Checking for C++..." >&4
6782 $cat >try.c <<'EOCP'
6794 if eval $compile_ok && $run ./try; then
6796 echo "You are using a C++ compiler."
6799 echo "You are not using a C++ compiler."
6805 : is a C symbol defined?
6808 -v) tf=libc.tmp; tdc="";;
6809 -a) tf=libc.tmp; tdc="[]";;
6810 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
6812 case "$d_cplusplus" in
6813 $define) extern_C="extern \"C\"" ;;
6814 *) extern_C="extern" ;;
6817 case "$reuseval-$4" in
6819 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
6824 if $test "$runnm" = true; then
6825 if $contains $tlook $tf >/dev/null 2>&1; then
6827 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
6828 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;
6829 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
6830 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
6834 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;
6835 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
6841 $define) tval=true;;
6848 : define an is-in-libc? function
6849 inlibc='echo " "; td=$define; tu=$undef;
6850 sym=$1; var=$2; eval "was=\$$2";
6852 case "$reuseval$was" in
6862 echo "$sym() found." >&4;
6863 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
6865 echo "$sym() NOT found." >&4;
6866 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
6870 $define) echo "$sym() found." >&4;;
6871 *) echo "$sym() NOT found." >&4;;
6875 : check for length of double
6877 case "$doublesize" in
6879 echo "Checking to see how big your double precision numbers are..." >&4
6888 printf("%d\n", (int)sizeof(double));
6893 if eval $compile_ok; then
6894 doublesize=`$run ./try`
6895 echo "Your double is $doublesize bytes long."
6898 echo "(I can't seem to compile the test program. Guessing...)"
6899 rp="What is the size of a double precision number (in bytes)?"
6907 : check for long doubles
6909 echo "Checking to see if you have long double..." >&4
6910 echo 'int main() { long double x = 7.0; }' > try.c
6912 if eval $compile; then
6914 echo "You have long double."
6917 echo "You do not have long double."
6923 : see if ldexpl exists
6927 : check for length of long double
6928 case "${d_longdbl}${longdblsize}" in
6931 echo "Checking to see how big your long doubles are..." >&4
6932 $cat >try.c <<'EOCP'
6936 printf("%d\n", sizeof(long double));
6941 if eval $compile; then
6942 longdblsize=`$run ./try`
6943 echo "Your long doubles are $longdblsize bytes long."
6947 echo "(I can't seem to compile the test program. Guessing...)" >&4
6948 rp="What is the size of a long double (in bytes)?"
6952 if $test "X$doublesize" = "X$longdblsize"; then
6953 echo "That isn't any different from an ordinary double."
6954 echo "I'll keep your setting anyway, but you may see some"
6955 echo "harmless compilation warnings."
6961 $echo "Checking the kind of long doubles you have..." >&4
6962 case "$d_longdbl" in
6966 #define LONGDBLSIZE $longdblsize
6967 #define DOUBLESIZE $doublesize
6973 static const long double d = -0.1L;
6975 unsigned const char* b = (unsigned const char*)(&d);
6976 #if DOUBLESIZE == LONGDBLSIZE
6977 printf("0\n"); /* if it floats like double */
6980 #if (LDBL_MANT_DIG == 113 || FLT128_MANT_DIG == 113) && LONGDBLSIZE == 16
6981 if (b[0] == 0x9A && b[1] == 0x99 && b[15] == 0xBF) {
6982 /* IEEE 754 128-bit little-endian */
6986 if (b[0] == 0xBF && b[14] == 0x99 && b[15] == 0x9A) {
6987 /* IEEE 128-bit big-endian, e.g. solaris sparc */
6992 /* For alignment 32-bit platforms have the 80 bits in 12 bytes,
6993 * while 64-bits platforms have it in 16 bytes. The trailing bytes
6994 * cannot be trusted. */
6995 #if LDBL_MANT_DIG == 64 && (LONGDBLSIZE == 16 || LONGDBLSIZE == 12)
6996 if (b[0] == 0xCD && b[9] == 0xBF) {
6997 /* x86 80-bit little-endian, sizeof 12 (ILP32, Solaris x86)
6998 * or 16 (LP64, Linux and OS X), 4 or 6 bytes of padding.
6999 * Also known as "extended precision". */
7003 if (b[0] == 0xBF && b[9] == 0xCD) {
7004 /* Is there ever big-endian 80-bit, really?
7006 * The Motorola 68881 had another "extended precision" format:
7007 * sign:1 exp:15 zero:16 integer:1 mantissa:63
7008 * for total of 96 bits of bytes. The zero bits were unused.
7009 * See "M68000 FAMILY PROGRAMMER’S REFERENCE MANUAL" for more details.
7010 * If it ever becomes relevant, this format should be allocated
7011 * a new doublekind code since it's quite different from the Intel x87.
7017 #if (LDBL_MANT_DIG == 106 || LDBL_MANT_DIG == 107) && LONGDBLSIZE == 16
7018 /* software "double double", the 106 is 53+53.
7019 * but irix thinks it is 107. */
7020 if (b[0] == 0x9A && b[7] == 0x3C && b[8] == 0x9A && b[15] == 0xBF) {
7021 /* double double 128-bit fully little-endian,
7022 * little-endian doubles in little-endian order,
7023 * 9a 99 99 99 99 99 59 3c 9a 99 99 99 99 99 b9 bf */
7027 if (b[0] == 0xBF && b[7] == 0x9A && b[8] == 0x3C && b[15] == 0x9A) {
7028 /* double double 128-bit fully big-endian,
7029 * big-endian doubles in big-endian order,
7030 * e.g. PPC/Power and MIPS:
7031 * bf b9 99 99 99 99 99 9a 3c 59 99 99 99 99 99 9a */
7035 if (b[0] == 0x9A && b[7] == 0xBF && b[8] == 0x9A && b[15] == 0x3C) {
7036 /* double double 128-bit mixed endian.
7037 * little-endian doubles in big-endian order,
7039 * 9a 99 99 99 99 99 b9 bf 9a 99 99 99 99 99 59 3c */
7043 if (b[0] == 0x3C && b[7] == 0x9A && b[8] == 0xBF && b[15] == 0x9A) {
7044 /* double double 128-bit mixed endian,
7045 * big-endian doubles in little-endian order,
7046 * 3c 59 99 99 99 99 99 9a bf b9 99 99 99 99 99 9a */
7051 /* We are largely making this up because it may well be
7052 * that the VAX format H was never made available to C,
7053 * only to Fortran. */
7054 #if LONGDBLSIZE == 16 && defined(__vax__)
7055 if (b[0] == 0xFD && b[15] == 0x99) {
7056 /* VAX format H, PDP-11 mixed endian. */
7061 printf("-1\n"); /* unknown */
7066 if eval $compile; then
7067 longdblkind=`$run ./try`
7074 case "$longdblkind" in
7075 0) echo "Your long doubles are doubles." >&4 ;;
7076 1) echo "You have IEEE 754 128-bit little endian long doubles." >&4 ;;
7077 2) echo "You have IEEE 754 128-bit big endian long doubles." >&4 ;;
7078 3) echo "You have x86 80-bit little endian long doubles." >& 4 ;;
7079 4) echo "You have x86 80-bit big endian long doubles." >& 4 ;;
7080 5) echo "You have 128-bit fully little-endian double-double long doubles (64-bit LEs in LE)." >& 4 ;;
7081 6) echo "You have 128-bit fully big-endian double-double long doubles (64-bit BEs in BE)." >& 4 ;;
7082 7) echo "You have 128-bit mixed-endian double-double long doubles (64-bit LEs in BE)." >& 4 ;;
7083 8) echo "You have 128-bit mixed-endian double-double long doubles (64-bit BEs in LE)." >& 4 ;;
7084 9) echo "You have 128-bit PDP-style mixed-endian long doubles (VAX format H)." >& 4 ;;
7085 *) echo "Cannot figure out your long double." >&4 ;;
7087 d_long_double_style_ieee=$undef
7088 d_long_double_style_ieee_std=$undef
7089 d_long_double_style_ieee_extended=$undef
7090 d_long_double_style_ieee_doubledouble=$undef
7091 d_long_double_style_vax=$undef
7092 case "$longdblkind" in
7093 1|2|3|4|5|6|7|8) d_long_double_style_ieee=$define ;;
7095 case "$longdblkind" in
7096 1|2) d_long_double_style_ieee_std=$define ;;
7098 case "$longdblkind" in
7099 3|4) d_long_double_style_ieee_extended=$define ;;
7101 case "$longdblkind" in
7102 5|6|7|8) d_long_double_style_ieee_doubledouble=$define ;;
7104 case "$longdblkind" in
7105 9) d_long_double_style_vax=$define ;;
7109 : determine the architecture name
7111 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
7112 tarch=`arch`"-$osname"
7113 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
7114 if uname -m > tmparch 2>&1 ; then
7115 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
7116 -e 's/$/'"-$osname/" tmparch`
7124 case "$myarchname" in
7127 echo "(Your architecture name used to be $myarchname.)"
7131 case "$targetarch" in
7133 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
7138 *) dflt="$archname";;
7140 rp='What is your architecture name'
7144 : optionally add API version to the architecture for versioned archlibs
7145 case "$useversionedarchname" in
7146 $define|true|[yY]*) dflt='y';;
7149 rp='Add the Perl API version to your archname?'
7152 y|Y) useversionedarchname="$define" ;;
7153 *) useversionedarchname="$undef" ;;
7155 case "$useversionedarchname" in
7158 *-$api_versionstring)
7159 echo "...and architecture name already has -$api_versionstring" >&4
7162 archname="$archname-$api_versionstring"
7163 echo "...setting architecture name to $archname." >&4
7169 case "$usethreads" in
7171 echo "Threads selected." >&4
7173 *-thread*) echo "...and architecture name already has -thread." >&4
7175 *) archname="$archname-thread"
7176 echo "...setting architecture name to $archname." >&4
7181 case "$usemultiplicity" in
7183 echo "Multiplicity selected." >&4
7185 *-multi*) echo "...and architecture name already has -multi." >&4
7187 *) archname="$archname-multi"
7188 echo "...setting architecture name to $archname." >&4
7193 case "$use64bitint$use64bitall" in
7195 case "$archname64" in
7197 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
7200 case "$use64bitint" in
7201 "$define") echo "64 bit integers selected." >&4 ;;
7203 case "$use64bitall" in
7204 "$define") echo "Maximal 64 bitness selected." >&4 ;;
7207 *-$archname64*) echo "...and architecture name already has $archname64." >&4
7209 *) archname="$archname-$archname64"
7210 echo "...setting architecture name to $archname." >&4
7216 case "$uselongdouble" in
7218 echo "Long doubles selected." >&4
7219 case "$longdblsize" in
7221 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
7225 *-ld*) echo "...and architecture name already has -ld." >&4
7227 *) archname="$archname-ld"
7228 echo "...setting architecture name to $archname." >&4
7235 case "$usequadmath" in
7237 echo "quadmath selected." >&4
7239 *-quadmath*) echo "...and architecture name already has -quadmath." >&4
7241 *) archname="$archname-quadmath"
7242 echo "...setting architecture name to $archname." >&4
7247 if $test -f archname.cbu; then
7248 echo "Your platform has some specific hints for architecture name, using them..."
7252 : set the prefixit variable, to compute a suitable default value
7253 prefixit='case "$3" in
7255 case "$oldprefix" in
7256 "") eval "$1=\"\$$2\"";;
7263 ""|" "|none) eval "$1=\"\$$2\"";;
7269 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
7271 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
7272 /*-$oldprefix/*|\~*-$oldprefix/*)
7273 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
7274 *) eval "$1=\"\$$2\"";;
7278 : determine installation style
7279 : For now, try to deduce it from prefix unless it is already set.
7280 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
7281 case "$installstyle" in
7282 '') case "$prefix" in
7283 *perl*) dflt='lib';;
7284 *) dflt='lib/perl5' ;;
7287 *) dflt="$installstyle" ;;
7289 : Probably not worth prompting for this since we prompt for all
7290 : the directories individually, and the prompt would be too long and
7294 : determine where public executables go
7299 rp='Pathname where the public executables will reside?'
7301 if $test "X$ansexp" != "X$binexp"; then
7305 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
7306 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
7307 : this via initialinstalllocation
7310 case "$userelocatableinc" in
7311 $define|true|[yY]*) dflt='y' ;;
7316 Would you like to build Perl so that the installation is relocatable, so that
7317 library paths in @INC are determined relative to the path of the perl binary?
7318 This is not advised for system Perl installs, or if you need to run setid
7319 scripts or scripts under taint mode.
7321 If this doesn't make any sense to you, just accept the default '$dflt'.
7323 rp='Use relocatable @INC?'
7326 y|Y) val="$define" ;;
7329 set userelocatableinc
7332 initialinstalllocation="$binexp"
7333 : Default prefix is now "up one level from where the binaries are"
7334 case "$userelocatableinc" in
7340 installprefixexp=".../.."
7344 : determine where private library files go
7345 : Usual default is /usr/local/lib/perl5/$version.
7346 : Also allow things like /opt/perl/lib/$version, since
7347 : /opt/perl/lib/perl5... would be redundant.
7348 : The default "style" setting is made in installstyle.U
7349 case "$installstyle" in
7350 *lib/perl5*) set dflt privlib lib/$package/$version ;;
7351 *) set dflt privlib lib/$version ;;
7356 There are some auxiliary files for $package that need to be put into a
7357 private library directory that is accessible by everyone.
7362 rp='Pathname where the private library files will reside?'
7367 : set the prefixup variable, to restore leading tilda escape
7368 prefixup='case "$prefixexp" in
7370 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
7373 : determine where public architecture dependent libraries go
7376 : privlib default is /usr/local/lib/$package/$version
7377 : archlib default is /usr/local/lib/$package/$version/$archname
7378 : privlib may have an optional trailing /share.
7379 tdflt=`echo $privlib | $sed 's,/share$,,'`
7380 tdflt=$tdflt/$archname
7389 $spackage contains architecture-dependent library files. If you are
7390 sharing libraries in a heterogeneous environment, you might store
7391 these files in a separate location. Otherwise, you can just include
7392 them with the rest of the public library files.
7397 rp='Where do you want to put the public architecture-dependent libraries?'
7401 if $test X"$archlib" = X"$privlib"; then
7407 : see if setuid scripts can be secure
7410 Some kernels have a bug that prevents setuid #! scripts from being
7411 secure. Some sites have disabled setuid #! scripts because of this.
7413 First let's decide if your kernel supports secure setuid #! scripts.
7414 (If setuid #! scripts would be secure but have been disabled anyway,
7415 don't say that they are secure if asked.)
7420 if $test -d /dev/fd; then
7421 echo "#!$ls" >reflect
7422 chmod +x,u+s reflect
7423 ./reflect >flect 2>&1
7424 if $contains "/dev/fd" flect >/dev/null; then
7425 echo "Congratulations, your kernel has secure setuid scripts!" >&4
7429 If you are not sure if they are secure, I can check but I'll need a
7430 username and password different from the one you are using right now.
7431 If you don't have such a username or don't want me to test, simply
7435 rp='Other username to test security of setuid scripts with?'
7440 case "$d_suidsafe" in
7441 '') echo "I'll assume setuid scripts are *not* secure." >&4
7444 echo "Well, the $hint value is *not* secure." >&4
7446 *) echo "Well, the $hint value *is* secure." >&4
7451 $rm -f reflect flect
7452 echo "#!$ls" >reflect
7453 chmod +x,u+s reflect
7456 echo '"su" will (probably) prompt you for '"$ans's password."
7457 su $ans -c './reflect >flect'
7458 if $contains "/dev/fd" flect >/dev/null; then
7459 echo "Okay, it looks like setuid scripts are secure." >&4
7462 echo "I don't think setuid scripts are secure." >&4
7467 rp='Does your kernel have *secure* setuid scripts?'
7470 [yY]*) val="$define";;
7475 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
7476 echo "(That's for file descriptors, not floppy disks.)"
7482 $rm -f reflect flect
7484 : now see if they want to do setuid emulation
7485 if $test $patchlevel -lt 11; then
7488 case "$d_suidsafe" in
7491 echo "No need to emulate SUID scripts since they are secure here." >&4
7495 Some systems have disabled setuid scripts, especially systems where
7496 setuid scripts cannot be secure. On systems where setuid scripts have
7497 been disabled, the setuid/setgid bits on scripts are currently
7498 useless. It is possible for $package to detect those bits and emulate
7499 setuid/setgid in a secure fashion. This emulation will only work if
7500 setuid scripts have been disabled in your kernel.
7504 "$define") dflt=y ;;
7507 rp="Do you want to do setuid/setgid emulation?"
7510 [yY]*) val="$define";;
7522 SUID emulation has been removed for 5.12
7523 Please re-run Configure without -Dd_dosuid
7532 : Find perl5.005 or later.
7533 echo "Looking for a previously installed perl5.005 or later... "
7535 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
7536 : Check if this perl is recent and can load a simple module
7537 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
7540 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
7550 '') echo "None found. That's ok.";;
7551 *) echo "Using $perl5." ;;
7554 : Set the siteprefix variables
7557 After $package is installed, you may wish to install various
7558 add-on modules and utilities. Typically, these add-ons will
7559 be installed under $prefix with the rest
7560 of this package. However, you may wish to install such add-ons
7561 elsewhere under a different prefix.
7563 If you do not wish to put everything under a single prefix, that's
7564 ok. You will be prompted for the individual locations; this siteprefix
7565 is only used to suggest the defaults.
7567 The default should be fine for most people.
7571 rp='Installation prefix to use for add-on modules and utilities?'
7572 : XXX Here might be another good place for an installstyle setting.
7573 case "$siteprefix" in
7575 *) dflt=$siteprefix ;;
7578 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
7580 case "$siteprefix" in
7584 *) oldsiteprefix="$prefix";;
7589 siteprefixexp="$ansexp"
7591 : determine where site specific libraries go.
7592 : Usual default is /usr/local/lib/perl5/site_perl/$version
7593 : The default "style" setting is made in installstyle.U
7594 : XXX No longer works with Prefixit stuff.
7595 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7597 '') case "$installstyle" in
7598 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
7599 *) dflt=$siteprefix/lib/site_$prog/$version ;;
7607 The installation process will create a directory for
7608 site-specific extensions and modules. Most users find it convenient
7609 to place all site-specific files in this directory rather than in the
7610 main distribution directory.
7614 rp='Pathname for the site-specific library files?'
7618 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
7620 : Determine list of previous versions to include in @INC
7621 $cat > getverlist <<EOPL
7624 \$api_versionstring = "$api_versionstring";
7625 \$version = "$version";
7626 \$stem = "$sitelib_stem";
7627 \$archname = "$archname";
7629 $cat >> getverlist <<'EOPL'
7630 # The list found is store twice for each entry: the original name, and
7631 # the binary broken down version as pack "sss", so sorting is easy and
7632 # unambiguous. This will work for all versions that have a maximum of
7633 # three digit groups, separate by '.'s or '_'s. Names are extended with
7634 # ".0.0" to ensure at least three elements for the pack.
7635 # -- H.Merijn Brand (m)'06 23-10-2006
7637 # Can't have leading @ because metaconfig interprets it as a command!
7638 ;@inc_version_list=();
7639 # XXX Redo to do opendir/readdir?
7642 ;@candidates = map {
7643 [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
7644 ;@candidates = sort { $a->[1] cmp $b->[1]} @candidates;
7650 ($pversion, $aversion, $vsn5005) = map {
7651 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
7652 foreach $d (@candidates) {
7653 if ($d->[1] lt $pversion) {
7654 if ($d->[1] ge $aversion) {
7655 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
7657 elsif ($d->[1] ge $vsn5005) {
7658 unshift(@inc_version_list, grep { -d } $d->[0]);
7662 # Skip newer version. I.e. don't look in
7663 # 5.7.0 if we're installing 5.6.1.
7667 if (@inc_version_list) {
7668 print join(' ', @inc_version_list);
7671 # Blank space to preserve value for next Configure run.
7676 case "$inc_version_list" in
7677 '') if test -x "$perl5$exe_ext"; then
7678 dflt=`$perl5 getverlist`
7683 $undef) dflt='none' ;;
7684 *) eval dflt=\"$inc_version_list\" ;;
7687 ''|' ') dflt=none ;;
7694 In order to ease the process of upgrading, this version of perl
7695 can be configured to use modules built and installed with earlier
7696 versions of perl that were installed under $prefix. Specify here
7697 the list of earlier versions that this version of perl should check.
7698 If Configure detected no earlier versions of perl installed under
7699 $prefix, then the list will be empty. Answer 'none' to tell perl
7700 to not search earlier versions.
7702 The default should almost always be sensible, so if you're not sure,
7703 just accept the default.
7706 rp='List of earlier versions to include in @INC?'
7709 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
7710 *) inc_version_list="$ans" ;;
7712 case "$inc_version_list" in
7714 inc_version_list_init='0'
7715 d_inc_version_list="$undef"
7717 *) inc_version_list_init=`echo $inc_version_list |
7718 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
7719 d_inc_version_list="$define"
7724 : see if malloc/malloc.h has to be included
7725 set malloc/malloc.h i_mallocmalloc
7728 : see if this is a malloc.h system
7729 : we want a real compile instead of Inhdr because some systems have a
7730 : malloc.h that just gives a compile error saying to use stdlib.h instead
7735 #$i_mallocmalloc I_MALLOCMALLOC
7736 #ifdef I_MALLOCMALLOC
7737 # include <malloc/malloc.h>
7740 int main () { return 0; }
7743 if eval $compile; then
7744 echo "<malloc.h> found." >&4
7747 echo "<malloc.h> NOT found." >&4
7754 : check for length of pointer
7758 echo "Checking to see how big your pointers are..." >&4
7767 printf("%d\n", (int)sizeof(void *));
7772 if eval $compile_ok; then
7773 ptrsize=`$run ./try`
7774 echo "Your pointers are $ptrsize bytes long."
7777 echo "(I can't seem to compile the test program. Guessing...)" >&4
7778 rp="What is the size of a pointer (in bytes)?"
7785 case "$use64bitall" in
7786 "$define"|true|[yY]*)
7790 *** You have chosen a maximally 64-bit build,
7791 *** but your pointers are only 4 bytes wide.
7792 *** Please rerun Configure without -Duse64bitall.
7797 *** Since you have quads, you could possibly try with -Duse64bitint.
7802 *** Cannot continue, aborting.
7812 : determine whether to use malloc wrapping
7814 case "$usemallocwrap" in
7815 [yY]*|true|$define) dflt='y' ;;
7816 [nN]*|false|$undef) dflt='n' ;;
7817 *) case "$usedevel" in
7818 [yY]*|true|$define) dflt='y' ;;
7823 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
7825 usemallocwrap="$ans"
7828 usemallocwrap="$define" ;;
7830 usemallocwrap="$undef" ;;
7833 : determine which malloc to compile in
7835 case "$usemymalloc" in
7836 [yY]*|true|$define) dflt='y' ;;
7837 [nN]*|false|$undef) dflt='n' ;;
7838 *) case "$ptrsize" in
7842 if test "$useithreads" = "$define"; then dflt='n'; fi
7845 rp="Do you wish to attempt to use the malloc that comes with $package?"
7851 mallocsrc='malloc.c'
7852 mallocobj="malloc$_o"
7853 d_mymalloc="$define"
7856 : Remove malloc from list of libraries to use
7857 echo "Removing unneeded -lmalloc from library list" >&4
7858 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
7861 echo "libs = $libs" >&4
7873 : compute the return types of malloc and free
7875 $cat >malloc.c <<END
7879 #include <sys/types.h>
7893 case "$malloctype" in
7895 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
7902 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
7906 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
7913 echo "Your system uses $freetype free(), it would seem." >&4
7915 : determine where site specific architecture-dependent libraries go.
7916 : sitelib default is /usr/local/lib/perl5/site_perl/$version
7917 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
7918 : sitelib may have an optional trailing /share.
7920 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
7921 dflt="$dflt/$archname"
7926 set sitearch sitearch none
7930 The installation process will also create a directory for
7931 architecture-dependent site-specific extensions and modules.
7935 rp='Pathname for the site-specific architecture-dependent library files?'
7939 if $test X"$sitearch" = X"$sitelib"; then
7942 d_sitearch="$define"
7945 : Set the vendorprefix variables
7948 The installation process will also create a directory for
7949 vendor-supplied add-ons. Vendors who supply perl with their system
7950 may find it convenient to place all vendor-supplied files in this
7951 directory rather than in the main distribution directory. This will
7952 ease upgrades between binary-compatible maintenance versions of perl.
7954 Of course you may also use these directories in whatever way you see
7955 fit. For example, you might use them to access modules shared over a
7956 company-wide network.
7958 The default answer should be fine for most people.
7959 This causes further questions about vendor add-ons to be skipped
7960 and no vendor-specific directories will be configured for perl.
7963 rp='Do you want to configure vendor-specific add-on directories?'
7964 case "$usevendorprefix" in
7965 define|true|[yY]*) dflt=y ;;
7966 *) : User may have set vendorprefix directly on Configure command line.
7967 case "$vendorprefix" in
7976 rp='Installation prefix to use for vendor-supplied add-ons?'
7977 case "$vendorprefix" in
7978 '') dflt="$prefix" ;;
7979 *) dflt=$vendorprefix ;;
7982 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
7984 case "$vendorprefix" in
7988 *) oldvendorprefix="$prefix";;
7992 usevendorprefix="$define"
7994 vendorprefixexp="$ansexp"
7996 *) usevendorprefix="$undef"
8002 : Set the vendorlib variables
8003 case "$vendorprefix" in
8004 '') d_vendorlib="$undef"
8008 *) d_vendorlib="$define"
8009 : determine where vendor-supplied modules go.
8010 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
8011 case "$vendorlib" in
8013 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8014 case "$installstyle" in
8015 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
8016 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
8019 *) dflt="$vendorlib"
8023 rp='Pathname for the vendor-supplied library files?'
8026 vendorlibexp="$ansexp"
8029 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
8033 : Set the vendorarch variables
8034 case "$vendorprefix" in
8035 '') d_vendorarch="$undef"
8039 *) d_vendorarch="$define"
8040 : determine where vendor-supplied architecture-dependent libraries go.
8041 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
8042 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
8043 : vendorlib may have an optional trailing /share.
8044 case "$vendorarch" in
8045 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
8046 dflt="$dflt/$archname"
8048 *) dflt="$vendorarch" ;;
8051 rp='Pathname for vendor-supplied architecture-dependent files?'
8054 vendorarchexp="$ansexp"
8057 prefixvar=vendorarch
8059 if $test X"$vendorarch" = X"$vendorlib"; then
8060 d_vendorarch="$undef"
8062 d_vendorarch="$define"
8065 : Final catch-all directories to search
8068 Lastly, you can have perl look in other directories for extensions and
8069 modules in addition to those already specified.
8070 These directories will be searched after
8074 test X"$vendorlib" != "X" && echo ' ' $vendorlib
8075 test X"$vendorarch" != "X" && echo ' ' $vendorarch
8077 case "$otherlibdirs" in
8078 ''|' ') dflt='none' ;;
8079 *) dflt="$otherlibdirs" ;;
8082 Enter a colon-separated set of extra paths to include in perl's @INC
8083 search path, or enter 'none' for no extra paths.
8087 rp='Colon-separated list of additional directories for perl to search?'
8090 ' '|''|none) otherlibdirs=' ' ;;
8091 *) otherlibdirs="$ans" ;;
8093 case "$otherlibdirs" in
8097 set d_perl_otherlibdirs
8101 dflt_dtrace='/usr/sbin/dtrace'
8102 $test -x /usr/bin/dtrace && dflt_dtrace='/usr/bin/dtrace'
8106 Perl can be built to support DTrace on platforms that support it.
8107 DTrace is a diagnosis and performance analysis tool from Sun.
8109 If this doesn't make any sense to you, just accept the default.
8113 case "$usedtrace" in
8123 dflt_dtrace=$usedtrace
8130 rp='Support DTrace if available?'
8133 y|Y) val="$define" ;;
8139 test "X$usedtrace" != "X$define" && break
8142 rp='Where is the dtrace executable?'
8151 if $dtrace -h -s ../perldtrace.d \
8152 -o perldtrace.tmp >/dev/null 2>&1 \
8153 && rm -f perldtrace.tmp
8156 echo "Good: your $dtrace knows about the -h flag."
8160 *** $me: Fatal Error: $dtrace doesn't support -h flag
8162 *** Your installed dtrace doesn't support the -h switch to compile a D
8163 *** program into a C header. Can't continue.
8175 *** $me: Fatal Error: $dtrace not found.
8182 echo "*** $dtrace was not found."
8188 : See if we want extra modules installed
8195 Perl can be built with extra modules or bundles of modules which
8196 will be fetched from the CPAN and installed alongside Perl.
8198 Notice that you will need access to the CPAN; either via the Internet,
8199 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
8200 be asked later to configure the CPAN.pm module which will in turn do
8201 the installation of the rest of the extra modules or bundles.)
8203 Notice also that if the modules require any external software such as
8204 libraries and headers (the libz library and the zlib.h header for the
8205 Compress::Zlib module, for example) you MUST have any such software
8206 already installed, this configuration process will NOT install such
8209 If this doesn't make any sense to you, just accept the default '$dflt'.
8211 rp='Install any extra modules (y or n)?'
8217 Please list any extra modules or bundles to be installed from CPAN,
8218 with spaces between the names. The names can be in any format the
8219 'install' command of CPAN.pm will understand. (Answer 'none',
8220 without the quotes, to install no extra modules or bundles.)
8230 $rm -f ../extras.lst
8232 *) echo "(Saving the list of extras for later...)"
8233 echo "$extras" > ../extras.lst
8241 : determine where html pages for programs go
8242 set html1dir html1dir none
8246 If you wish to install html files for programs in $spackage, indicate
8247 the appropriate directory here. To skip installing html files,
8251 ''|none|$undef|' ') dflt=none ;;
8252 *) dflt=$html1dir ;;
8255 rp="Directory for the main $spackage html pages?"
8259 : Use ' ' for none so value is preserved next time through Configure
8260 $test X"$html1dir" = "X" && html1dir=' '
8262 : determine where html pages for libraries and modules go
8263 set html3dir html3dir none
8267 If you wish to install html files for modules associated with $spackage,
8268 indicate the appropriate directory here. To skip installing html files,
8271 : There is no obvious default. If they have specified html1dir, then
8272 : try to key off that, possibly changing .../html1 into .../html3.
8274 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
8275 *) dflt=$html3dir ;;
8278 rp="Directory for the $spackage module html pages?"
8282 : Use ' ' for none so value is preserved next time through Configure
8283 $test X"$html3dir" = "X" && html3dir=' '
8285 : determine whether to install perl also as /usr/bin/perl
8288 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
8290 Many scripts expect perl to be installed as /usr/bin/perl.
8292 If you want to, I can install the perl you are about to compile
8293 as /usr/bin/perl (in addition to $bin/perl).
8295 if test -f /usr/bin/perl; then
8298 However, please note that because you already have a /usr/bin/perl,
8299 overwriting that with a new Perl would very probably cause problems.
8300 Therefore I'm assuming you don't want to do that (unless you insist).
8303 case "$installusrbinperl" in
8304 "$define"|[yY]*) dflt='y';;
8310 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
8313 case "$installusrbinperl" in
8314 "$undef"|[nN]*) dflt='n';;
8318 rp="Do you want to install perl as /usr/bin/perl?"
8321 [yY]*) val="$define";;
8327 set installusrbinperl
8330 : see if dlopen exists
8332 xxx_ccflags="$ccflags"
8334 : with g++ one needs -shared to get is-in-libc to work for dlopen
8335 case "$gccversion" in
8338 *) case "$d_cplusplus" in
8339 "$define") ccflags="$ccflags -shared" ;;
8346 ccflags="$xxx_ccflags"
8348 : see if this is a unistd.h system
8349 set unistd.h i_unistd
8352 : determine which dynamic loading, if any, to compile in
8354 dldir="ext/DynaLoader"
8367 $define) dflt='y' ;;
8369 : Does a dl_xxx.xs file exist for this operating system
8370 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
8373 rp="Do you wish to use dynamic loading?"
8380 '') if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
8381 dflt="$dldir/dl_${osname}.xs"
8382 elif $test "$d_dlopen" = "$define" ; then
8383 dflt="$dldir/dl_dlopen.xs"
8388 *) dflt="$dldir/$dlsrc"
8391 echo "The following dynamic loading files are available:"
8392 : Can not go over to $dldir because getfile has path hard-coded in.
8393 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
8394 rp="Source file to use for dynamic loading"
8400 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
8404 Some systems may require passing special flags to $cc -c to
8405 compile modules that will be used to create a shared library.
8406 To use no flags, say "none".
8409 case "$cccdlflags" in
8410 '') case "$gccversion" in
8411 '') case "$osname" in
8413 irix*) dflt='-KPIC' ;;
8414 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
8415 sunos) dflt='-pic' ;;
8419 *) case "$osname" in
8420 darwin) dflt='none' ;;
8421 *linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
8426 *) dflt="$cccdlflags" ;;
8433 # If -Dsysroot was specified, now's the time to add it
8435 if test "X$sysroot" != X; then
8436 case "$gccversion" in
8441 dflt="$dflt --sysroot=$sysroot" ;;
8451 rp="Any special flags to pass to $cc -c to compile shared library modules?"
8454 none) cccdlflags=' ' ;;
8455 *) cccdlflags="$ans" ;;
8460 Some systems use ld to create libraries that can be dynamically loaded,
8461 while other systems (such as those using ELF) use $cc.
8465 : Determine if this is ELF
8467 /* Test for whether ELF binaries are produced */
8479 int i = open("a.out",O_RDONLY);
8482 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
8483 exit(0); /* succeed (yes, it is ELF) */
8487 if $cc $ccflags $ldflags -o a.out try.c >/dev/null 2>&1 && $run ./a.out; then
8493 '') if $test $bin_ELF = "$define"; then
8495 You appear to have ELF support. I'll use $cc to build dynamic libraries.
8499 echo "I'll use ld to build dynamic libraries."
8507 rp="What command should be used to create dynamic libraries?"
8513 Some systems may require passing special flags to $ld to create a
8514 library that can be dynamically loaded. If your ld flags include
8515 -L/other/path options to locate libraries outside your loader's normal
8516 search path, you may need to specify those -L options here as well. To
8517 use no flags, say "none".
8520 case "$lddlflags" in
8521 '') case "$osname" in
8522 haiku) dflt='-shared' ;;
8524 case "$gccversion" in
8525 '') dflt="$dflt +vnocompatwarnings" ;;
8528 *linux*|irix*|gnu*) dflt="-shared $optimize" ;;
8529 solaris) # See [perl #66604].
8530 # On Solaris 11, gcc -m64 on amd64
8531 # appears not to understand -G. gcc versions at
8532 # least as old as 3.4.3 support -shared, so just
8533 # use that with Solaris 11 and later, but keep
8534 # the old behavior for older Solaris versions.
8535 case "$gccversion" in
8537 *) case "$osvers" in
8538 2.?|2.10) dflt='-G' ;;
8539 *) dflt='-shared' ;;
8544 sunos) dflt='-assert nodefinitions' ;;
8545 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
8549 *) dflt="$lddlflags" ;;
8552 : Only do this for gcc, since, for example, qcc has no concept
8554 if $test "X$sysroot" != X; then
8555 case "$gccversion" in
8557 *) dflt="$dflt --sysroot=$sysroot" ;;
8561 : Try to guess additional flags to pick up local libraries.
8562 : Be careful not to append to a plain 'none'
8566 for thisflag in $ldflags; do
8571 *) dflt="$dflt $thisflag" ;;
8578 ''|' ') dflt='none' ;;
8582 *-fstack-protector-strong*)
8584 *-fstack-protector-strong*) ;; # Don't add it again
8585 *) dflt="$dflt -fstack-protector-strong" ;;
8588 *-fstack-protector*)
8590 *-fstack-protector*) ;; # Don't add it again
8591 *) dflt="$dflt -fstack-protector" ;;
8596 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
8599 none) lddlflags=' ' ;;
8600 *) lddlflags="$ans" ;;
8605 Some systems may require passing special flags to $cc to indicate that
8606 the resulting executable will use dynamic linking. To use no flags,
8610 case "$ccdlflags" in
8611 '') case "$osname" in
8612 *linux*|hpux|gnu*) dflt='-Wl,-E' ;;
8613 sunos) dflt='none' ;;
8617 *) dflt="$ccdlflags" ;;
8619 rp="Any special flags to pass to $cc to use dynamic linking?"
8622 none) ccdlflags=' ' ;;
8623 *) ccdlflags="$ans" ;;
8635 ld_can_script="$undef"
8636 case "$bin_ELF$usedl" in
8638 # Abuse try.h and a.out names for neat cleanup
8650 if $cc $cccdlflags $ccdlflags $ccflags \
8651 $ldflags $lddlflags -o a.out try.c \
8652 -Wl,--version-script=try.h >/dev/null 2>&1 \
8653 && $test -s a.out ; then
8654 echo "ld supports scripting" >&4
8655 ld_can_script="$define"
8657 echo "ld does not support scripting" >&4
8663 : Do we want a shared libperl?
8667 # No dynamic loading being used, so don't bother even to prompt.
8670 *) case "$useshrplib" in
8671 '') case "$osname" in
8672 svr4*|nonstopux|dgux|dynixptx|esix|powerux|haiku|cygwin*)
8674 also='Building a shared libperl is required for dynamic loading to work on your system.'
8688 The perl executable is normally obtained by linking perlmain.c with
8689 libperl${_a}, any static extensions (usually just DynaLoader), and
8690 any other libraries needed on this system (such as -lm, etc.). Since
8691 your system supports dynamic loading, it is probably possible to build
8692 a shared libperl.$so. If you will have more than one executable linked
8693 to libperl.$so, this will significantly reduce the size of each
8694 executable, but it may have a noticeable effect on performance. The
8695 default is probably sensible for your system.
8699 rp="Build a shared libperl.$so (y/n)"
8703 useshrplib='true' ;;
8704 *) useshrplib='false' ;;
8709 case "$useshrplib" in
8711 case "$userelocatableinc" in
8713 echo "Cannot build with both -Duserelocatableinc and -Duseshrplib" >&4
8714 echo "See INSTALL for an explanation why that won't work." >&4
8720 # Figure out a good name for libperl.so. Since it gets stored in
8721 # a version-specific architecture-dependent library, the version
8722 # number isn't really that important, except for making cc/ld happy.
8724 # A name such as libperl.so.10.1
8725 majmin="libperl.$so.$patchlevel.$subversion"
8726 # A name such as libperl.so.100
8727 majonly=`echo $patchlevel $subversion |
8728 $awk '{printf "%d%02d", $1, $2}'`
8729 majonly=libperl.$so.$majonly
8730 # I'd prefer to keep the os-specific stuff here to a minimum, and
8731 # rely on figuring it out from the naming of libc.
8732 case "${osname}${osvers}" in
8733 *linux*|gnu*) # ld won't link with a bare -lperl otherwise.
8736 cygwin*) # ld links now against the dll directly
8737 majmin="cygperl5_${patchlevel}_${subversion}.${so}"
8738 majonly=`echo $patchlevel $subversion |
8739 $awk '{printf "%03d%03d", $1, $2}'`
8740 majonly=cygperl5.$majonly.$so
8743 *) # Try to guess based on whether libc has major.minor.
8745 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8746 *libc.$so.[0-9]*) dflt=$majonly ;;
8747 *) dflt=libperl.$so ;;
8757 I need to select a good name for the shared libperl. If your system uses
8758 library names with major and minor numbers, then you might want something
8759 like $majmin. Alternatively, if your system uses a single version
8760 number for shared libraries, then you might want to use $majonly.
8761 Or, your system might be quite happy with a simple libperl.$so.
8763 Since the shared libperl will get installed into a version-specific
8764 architecture-dependent directory, the version number of the shared perl
8765 library probably isn't important, so the default should be o.k.
8768 rp='What name do you want to give to the shared libperl?'
8771 echo "Ok, I'll use $libperl"
8774 libperl="libperl${_a}"
8778 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8782 WARNING: Use of the shrpdir variable for the installation location of
8783 the shared $libperl is not supported. It was never documented and
8784 will not work in this version. Let me (perlbug@perl.org)
8785 know of any problems this may cause.
8791 But your current setting of $shrpdir is
8792 the default anyway, so it's harmless.
8797 Further, your current attempted setting of $shrpdir
8798 conflicts with the value of $archlibexp/CORE
8799 that installperl will use.
8806 # How will the perl executable find the installed shared $libperl?
8807 # Add $xxx to ccdlflags.
8808 # If we can't figure out a command-line option, use $shrpenv to
8809 # set env LD_RUN_PATH. The main perl makefile uses this.
8810 shrpdir=$archlibexp/CORE
8813 if "$useshrplib"; then
8816 # We'll set it in Makefile.SH...
8821 freebsd|minix|mirbsd|netbsd|openbsd|interix|dragonfly|bitrig)
8822 xxx="-Wl,-R$shrpdir"
8824 bsdos|linux|irix*|dec_osf|gnu*|haiku)
8825 xxx="-Wl,-rpath,$shrpdir"
8828 # hpux doesn't like the default, either.
8829 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8832 # cygwin needs only ldlibpth
8835 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8841 # Only add $xxx if it isn't already in ccdlflags.
8842 case " $ccdlflags " in
8844 *) ccdlflags="$ccdlflags $xxx"
8847 Adding $xxx to the flags
8848 passed to $ld so that the perl executable will find the
8849 installed shared $libperl.
8857 # Fix ccdlflags in AIX for building external extensions.
8858 # (For building Perl itself bare -bE:perl.exp is needed,
8859 # Makefile.SH takes care of this.)
8861 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8863 # Respect a hint or command-line value.
8865 '') shrpenv="$tmp_shrpenv" ;;
8867 case "$ldlibpthname" in
8868 '') ldlibpthname=LD_LIBRARY_PATH ;;
8869 none) ldlibpthname='' ;;
8872 : determine where manual pages are on this system
8876 syspath='/usr/share/man/man1 /usr/man/man1'
8877 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8878 syspath="$syspath /usr/man/u_man/man1"
8879 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8880 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8881 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8882 sysman=`./loc . /usr/man/man1 $syspath`
8885 if $test -d "$sysman"; then
8886 echo "System manual is in $sysman." >&4
8888 echo "Could not find manual pages in source form." >&4
8891 : determine where manual pages go
8892 set man1dir man1dir none
8896 $spackage has manual pages available in source form.
8900 echo "However, you don't have nroff, so they're probably useless to you."
8902 '') man1dir="none";;
8905 echo "If you don't want the manual sources installed, answer 'none'."
8910 lookpath="$prefixexp/share/man/man1"
8911 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8912 lookpath="$lookpath $prefixexp/man/p_man/man1"
8913 lookpath="$lookpath $prefixexp/man/u_man/man1"
8914 lookpath="$lookpath $prefixexp/man/man.1"
8916 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8917 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8927 rp="Where do the main $spackage manual pages (source) go?"
8929 if $test "X$man1direxp" != "X$ansexp"; then
8940 : What suffix to use on installed man pages
8947 rp="What suffix should be used for the main $spackage man pages?"
8949 '') case "$man1dir" in
8963 *) dflt="$man1ext";;
8970 : see if we can have long filenames
8972 first=123456789abcdef
8974 if (echo hi >$first) 2>/dev/null; then
8975 if $test -f 123456789abcde; then
8976 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8979 echo 'You can have filenames longer than 14 characters.'>&4
8984 You can't have filenames longer than 14 chars.
8985 You can't even think about them!
8991 $rm -rf 123456789abcde*
8993 : determine where library module manual pages go
8994 set man3dir man3dir none
8998 $spackage has manual pages for many of the library modules.
9004 However, you don't have nroff, so they're probably useless to you.
9007 '') man3dir="none";;
9011 case "$d_flexfnam" in
9014 However, your system can't handle the long file names like File::Basename.3.
9017 '') man3dir="none";;
9021 echo "If you don't want the manual sources installed, answer 'none'."
9022 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
9024 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
9025 if $test -d "$privlib/man/man3"; then
9028 WARNING: Previous versions of perl installed man3 pages into
9029 $privlib/man/man3. This version will suggest a
9030 new default of $dflt.
9034 rp='Do you wish to preserve the old behavior?(y/n)'
9037 y*) dflt="$privlib/man/man3" ;;
9042 *) dflt="$man3dir" ;;
9049 rp="Where do the $package library man pages (source) go?"
9059 : What suffix to use on installed man pages
9065 rp="What suffix should be used for the $package library man pages?"
9067 '') case "$man3dir" in
9081 *) dflt="$man3ext";;
9088 : see if we have to deal with yellow pages, now NIS.
9089 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
9095 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
9103 rp='Are you getting the hosts file via yellow pages?'
9106 y*) hostcat='ypcat hosts';;
9107 *) hostcat='cat /etc/hosts';;
9113 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
9116 '') test -f /etc/group && groupcat='cat /etc/group';;
9119 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
9122 : now get the host name
9124 echo "Figuring out host name..." >&4
9125 case "$myhostname" in
9127 echo 'Maybe "hostname" will work...'
9128 if tans=`sh -c hostname 2>&1` ; then
9136 if $test "$cont"; then
9138 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
9139 if tans=`cat /etc/systemid 2>&1` ; then
9141 phostname='cat /etc/systemid'
9142 echo "Whadyaknow. Xenix always was a bit strange..."
9145 elif $test -r /etc/systemid; then
9146 echo "(What is a non-Xenix system doing with /etc/systemid?)"
9149 if $test "$cont"; then
9150 echo 'No, maybe "uuname -l" will work...'
9151 if tans=`sh -c 'uuname -l' 2>&1` ; then
9153 phostname='uuname -l'
9155 echo 'Strange. Maybe "uname -n" will work...'
9156 if tans=`sh -c 'uname -n' 2>&1` ; then
9158 phostname='uname -n'
9160 echo 'Oh well, maybe I can mine it out of whoami.h...'
9161 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
9162 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
9163 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
9165 case "$myhostname" in
9166 '') echo "Does this machine have an identity crisis or something?"
9169 echo "Well, you said $myhostname before..."
9170 phostname='echo $myhostname';;
9176 case "$myhostname" in
9177 '') myhostname=noname ;;
9179 : you do not want to know about this
9184 if $test "$myhostname" ; then
9186 rp='Your host name appears to be "'$myhostname'".'" Right?"
9194 : bad guess or no guess
9195 while $test "X$myhostname" = X ; do
9197 rp="Please type the (one word) name of your host:"
9202 : translate upper to lower if necessary
9203 case "$myhostname" in
9205 echo "(Normalizing case in your host name)"
9206 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
9210 case "$myhostname" in
9212 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
9213 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
9214 echo "(Trimming domain name from host name--host name is now $myhostname)"
9216 *) case "$mydomain" in
9219 test "X$hostcat" = "Xypcat hosts" &&
9220 ypmatch "$myhostname" hosts 2>/dev/null |\
9221 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
9224 test "X$hostcat" != "X" &&
9225 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
9226 /[ ]$myhostname[ . ]/p" > hosts
9229 if $test -f hosts; then
9230 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
9231 END { print sum }" hosts` = x1 || tmp_re="[ ]"
9232 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
9233 hosts | $sort | $uniq | \
9234 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
9235 case `$echo X$dflt` in
9236 X*\ *) echo "(Several hosts in the database matched hostname)"
9239 X.) echo "(You do not have fully-qualified names in the hosts database)"
9243 echo "(I cannot locate a hosts database anywhere)"
9248 tans=`./loc resolv.conf X /etc /usr/etc`
9249 if $test -f "$tans"; then
9250 echo "(Attempting domain name extraction from $tans)"
9251 dflt=.`$sed -n -e 's/ / /g' \
9252 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
9255 .) dflt=.`$sed -n -e 's/ / /g' \
9256 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
9264 .) echo "(No help from resolv.conf either -- attempting clever guess)"
9265 dflt=.`sh -c domainname 2>/dev/null`
9268 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
9272 case "$dflt$osname" in
9273 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
9274 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
9278 .) echo "(Lost all hope -- silly guess then)"
9284 *) dflt="$mydomain";;
9288 rp="What is your domain name?"
9298 : translate upper to lower if necessary
9301 echo "(Normalizing case in your domain name)"
9302 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
9306 : a little sanity check here
9307 case "$phostname" in
9310 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
9311 $myhostname$mydomain|$myhostname) ;;
9313 case "$phostname" in
9315 echo "(That doesn't agree with your whoami.h file, by the way.)"
9318 echo "(That doesn't agree with your $phostname command, by the way.)"
9326 : determine the e-mail address of the user who is running us
9329 I need to get your e-mail address in Internet format if possible, i.e.
9330 something like user@host.domain. Please answer accurately since I have
9331 no easy means to double check it. The default value provided below
9332 is most probably close to reality but may not be valid from outside
9333 your organization...
9337 while test "$cont"; do
9338 case "$MAILDOMAIN" in
9340 if $test -s /etc/mailname; then
9341 maildomain=`$cat /etc/mailname`
9343 maildomain="$myhostname$mydomain"
9346 *) maildomain="$MAILDOMAIN";;
9349 '') dflt="$cf_by@$maildomain";;
9350 *) dflt="$cf_email";;
9352 rp='What is your e-mail address?'
9358 rp='Address does not look like an Internet one. Use it anyway?'
9372 : Ask e-mail of administrator
9375 If you or somebody else will be maintaining perl at your site, please
9376 fill in the correct e-mail address here so that they may be contacted
9377 if necessary. Currently, the "perlbug" program included with perl
9378 will send mail to this address in addition to perlbug@perl.org. You may
9379 enter "none" for no administrator.
9382 case "$perladmin" in
9383 '') dflt="$cf_email";;
9384 *) dflt="$perladmin";;
9386 rp='Perl administrator e-mail address'
9390 : determine whether to use a version number suffix for installed binaries
9393 Do you want to use a version number suffix for installed binaries? This
9394 will install 'perl$version' instead of 'perl', and likewise for other
9395 binaries like 'perldoc' and 'cpan'. This allows many versions of perl
9396 to be installed side-by-side. Unless you are a developer, you probably
9397 do *not* want to do this.
9399 case "$versiononly" in
9400 "$define"|[Yy]*|true) dflt='y' ;;
9403 rp="Do you want to use a version number suffix for installed binaries?"
9406 [yY]*) val="$define";;
9412 case "$versiononly" in
9413 "$define") inc_version_list=''
9414 inc_version_list_init=0
9418 : figure out how to guarantee perl startup
9419 : XXX Note that this currently takes advantage of the bug that binexp ignores
9420 : the Configure -Dinstallprefix setting, which in turn means that under
9421 : relocatable @INC, initialinstalllocation is what binexp started as.
9422 case "$startperl" in
9424 case "$sharpbang" in
9428 I can use the #! construct to start perl on your system. This will
9429 make startup of perl scripts faster, but may cause problems if you
9430 want to share those scripts and perl is not in a standard place
9431 ($initialinstalllocation/perl) on all your platforms. The alternative
9432 is to force a shell by starting the script with a single ':' character.
9435 case "$versiononly" in
9436 "$define") dflt="$initialinstalllocation/perl$version";;
9437 *) dflt="$initialinstalllocation/perl";;
9439 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
9442 none) startperl=": # use perl";;
9443 *) startperl="#!$ans"
9444 if $test 30 -lt `echo "$ans" | wc -c`; then
9447 WARNING: Some systems limit the #! command to 32 characters.
9448 If you experience difficulty running Perl scripts with #!, try
9449 installing Perl in a directory with a shorter pathname.
9455 *) startperl=": # use perl"
9460 echo "I'll use $startperl to start perl scripts."
9462 : figure best path for perl in scripts
9465 case "$versiononly" in
9466 "$define") perlpath="$initialinstalllocation/perl$version";;
9467 *) perlpath="$initialinstalllocation/perl";;
9469 case "$startperl" in
9474 I will use the "eval 'exec'" idiom to start Perl on your system.
9475 I can use the full path of your Perl binary for this purpose, but
9476 doing so may cause problems if you want to share those scripts and
9477 Perl is not always in a standard place ($initialinstalllocation/perl).
9480 dflt="$initialinstalllocation/perl"
9481 rp="What path shall I use in \"eval 'exec'\"?"
9488 case "$startperl" in
9490 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
9493 : determine where public executable scripts go
9494 set scriptdir scriptdir
9496 case "$scriptdir" in
9499 : guess some guesses
9500 $test -d /usr/share/scripts && dflt=/usr/share/scripts
9501 $test -d /usr/share/bin && dflt=/usr/share/bin
9502 $test -d /usr/local/script && dflt=/usr/local/script
9503 $test -d /usr/local/scripts && dflt=/usr/local/scripts
9504 $test -d $prefixexp/script && dflt=$prefixexp/script
9508 *) dflt="$scriptdir"
9513 Some installations have a separate directory just for executable scripts so
9514 that they can mount it across multiple architectures but keep the scripts in
9515 one spot. You might, for example, have a subdirectory of /usr/share for this.
9516 Or you might just lump your scripts in with all your other executables.
9520 rp='Where do you keep publicly executable scripts?'
9522 if $test "X$ansexp" != "X$scriptdirexp"; then
9528 : A little fix up for an irregularly named variable.
9529 installscript="$installscriptdir"
9531 : determine where add-on public executables go
9533 '') dflt=$siteprefix/bin ;;
9537 rp='Pathname where the add-on public executables should be installed?'
9542 : determine where add-on html pages go
9543 : There is no standard location, so try to copy the previously-selected
9544 : directory structure for the core html pages.
9545 case "$sitehtml1dir" in
9546 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9547 *) dflt=$sitehtml1dir ;;
9550 ''|' ') dflt=none ;;
9553 rp='Pathname where the site-specific html pages should be installed?'
9555 prefixvar=sitehtml1dir
9558 : determine where add-on library html pages go
9559 : There is no standard location, so try to copy the previously-selected
9560 : directory structure for the core html pages.
9561 case "$sitehtml3dir" in
9562 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9563 *) dflt=$sitehtml3dir ;;
9566 ''|' ') dflt=none ;;
9569 rp='Pathname where the site-specific library html pages should be installed?'
9571 prefixvar=sitehtml3dir
9574 : determine where add-on manual pages go
9575 case "$siteman1dir" in
9576 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
9577 *) dflt=$siteman1dir ;;
9580 ''|' ') dflt=none ;;
9583 rp='Pathname where the site-specific manual pages should be installed?'
9585 prefixvar=siteman1dir
9588 : determine where add-on library man pages go
9589 case "$siteman3dir" in
9590 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
9591 *) dflt=$siteman3dir ;;
9594 ''|' ') dflt=none ;;
9597 rp='Pathname where the site-specific library manual pages should be installed?'
9599 prefixvar=siteman3dir
9602 : determine where add-on public executable scripts go
9603 case "$sitescript" in
9604 '') dflt=$siteprefix/script
9605 $test -d $dflt || dflt=$sitebin ;;
9606 *) dflt="$sitescript" ;;
9609 rp='Pathname where add-on public executable scripts should be installed?'
9611 prefixvar=sitescript
9614 : see if backtrace exists
9615 set backtrace d_backtrace
9618 : add flags if using c backtrace
9619 case "$usecbacktrace" in
9620 "") usecbacktrace=$undef ;;
9622 case "$d_backtrace" in
9624 case " $ccflags " in
9625 *" -DUSE_C_BACKTRACE "*) ;; # Already there.
9626 *) ccflags="$ccflags -DUSE_C_BACKTRACE -g" ;;
9630 echo "This system does not support backtrace" >&4
9631 usecbacktrace=$undef
9637 : Check if faststdio is requested and available
9638 case "$usefaststdio" in
9639 $define|true|[yY]*|'')
9640 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
9650 Perl can be built to use 'fast stdio', which means using the stdio
9651 library but also directly manipulating the stdio buffers to enable
9652 faster I/O. Using stdio is better for backward compatibility (especially
9653 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
9654 interface has been preferred instead of stdio.
9656 If this doesn't make any sense to you, just accept the default '$dflt'.
9658 rp='Use the "fast stdio" if available?'
9661 y|Y) val="$define" ;;
9667 : define an is-a-typedef? function
9668 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9670 "") inclist="sys/types.h";;
9672 eval "varval=\$$var";
9676 for inc in $inclist; do
9677 echo "#include <$inc>" >>temp.c;
9679 echo "#ifdef $type" >> temp.c;
9680 echo "printf(\"We have $type\");" >> temp.c;
9681 echo "#endif" >> temp.c;
9682 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9683 if $contains $type temp.E >/dev/null 2>&1; then
9689 *) eval "$var=\$varval";;
9692 : define an is-a-typedef? function that prompts if the type is not available.
9693 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9695 "") inclist="sys/types.h";;
9697 eval "varval=\$$var";
9701 for inc in $inclist; do
9702 echo "#include <$inc>" >>temp.c;
9704 echo "#ifdef $type" >> temp.c;
9705 echo "printf(\"We have $type\");" >> temp.c;
9706 echo "#endif" >> temp.c;
9707 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9709 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
9710 if $contains $type temp.E >/dev/null 2>&1; then
9711 echo "$type found." >&4;
9714 echo "$type NOT found." >&4;
9720 *) eval "$var=\$varval";;
9723 : see what type lseek is declared as in the kernel
9724 rp="What is the type used for lseek's offset on this system?"
9725 set off_t lseektype long stdio.h sys/types.h
9729 echo "Checking to see how big your file offsets are..." >&4
9731 #include <sys/types.h>
9735 printf("%d\n", (int)sizeof($lseektype));
9740 if eval $compile_ok; then
9741 lseeksize=`$run ./try`
9742 echo "Your file offsets are $lseeksize bytes long."
9746 echo "(I can't seem to compile the test program. Guessing...)"
9747 rp="What is the size of your file offsets (in bytes)?"
9753 : see what type file positions are declared as in the library
9754 rp="What is the type for file position used by fsetpos()?"
9755 set fpos_t fpostype long stdio.h sys/types.h
9758 : Check size for Fpos_t
9761 *_t) zzz="$fpostype" ;;
9764 echo "Checking the size of $zzz..." >&4
9766 #include <sys/types.h>
9773 printf("%d\n", (int)sizeof($fpostype));
9778 if eval $compile_ok; then
9782 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9785 echo "Your $zzz is $fpossize bytes long."
9791 echo "(I can't compile the test program. Guessing...)" >&4
9792 rp="What is the size of your file positions (in bytes)?"
9797 : Check for large file support
9798 # Backward compatibility (uselfs is deprecated).
9800 "$define"|true|[yY]*)
9803 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9805 uselargefiles="$define"
9809 case "$lseeksize:$fpossize" in
9812 You can have files larger than 2 gigabytes.
9815 *) case "$uselargefiles" in
9816 "$undef"|false|[nN]*) dflt='n' ;;
9821 Perl can be built to understand large files (files larger than 2 gigabytes)
9822 on some systems. To do so, Configure can be run with -Duselargefiles.
9824 If this doesn't make any sense to you, just accept the default '$dflt'.
9826 rp='Try to understand large files, if available?'
9829 y|Y) val="$define" ;;
9836 : Look for a hint-file generated 'call-back-unit'. If the
9837 : user has specified that a large files perl is to be built,
9838 : we may need to set or change some other defaults.
9839 if $test -f uselargefiles.cbu; then
9840 echo "Your platform has some specific hints regarding large file builds, using them..."
9841 . ./uselargefiles.cbu
9843 case "$uselargefiles" in
9845 if $test -f uselargefiles.cbu; then
9847 echo "Rechecking to see how big your file offsets are..." >&4
9849 #include <sys/types.h>
9853 printf("%d\n", (int)sizeof($lseektype));
9858 if eval $compile_ok; then
9859 lseeksize=`$run ./try`
9860 $echo "Your file offsets are now $lseeksize bytes long."
9864 echo "(I can't seem to compile the test program. Guessing...)"
9865 rp="What is the size of your file offsets (in bytes)?"
9870 *_t) zzz="$fpostype" ;;
9873 $echo $n "Rechecking the size of $zzz...$c" >&4
9875 #include <sys/types.h>
9882 printf("%d\n", (int)sizeof($fpostype));
9887 if eval $compile_ok; then
9892 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9895 echo " $fpossize bytes." >&4
9901 echo "(I can't compile the test program. Guessing...)" >&4
9902 rp="What is the size of your file positions (in bytes)?"
9911 : Check if we want perlio
9914 : Set the vendorbin variables
9915 case "$vendorprefix" in
9916 '') d_vendorbin="$undef"
9920 *) d_vendorbin="$define"
9921 : determine where vendor-supplied executables go.
9922 case "$vendorbin" in
9923 '') dflt=$vendorprefix/bin ;;
9924 *) dflt="$vendorbin" ;;
9927 rp='Pathname for the vendor-supplied executables directory?'
9930 vendorbinexp="$ansexp"
9936 : Set the vendorhtml1dir variables
9937 case "$vendorprefix" in
9938 '') vendorhtml1dir=''
9939 vendorhtml1direxp=''
9941 *) : determine where vendor-supplied html pages go.
9942 : There is no standard location, so try to copy the previously-selected
9943 : directory structure for the core html pages.
9944 : XXX Better default suggestions would be welcome.
9945 case "$vendorhtml1dir" in
9946 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9947 *) dflt=$vendorhtml1dir ;;
9950 ''|' ') dflt=none ;;
9953 rp='Pathname for the vendor-supplied html pages?'
9955 vendorhtml1dir="$ans"
9956 vendorhtml1direxp="$ansexp"
9959 : Use ' ' for none so value is preserved next time through Configure
9960 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9961 prefixvar=vendorhtml1dir
9964 : Set the vendorhtml3dir variables
9965 case "$vendorprefix" in
9966 '') vendorhtml3dir=''
9967 vendorhtml3direxp=''
9969 *) : determine where vendor-supplied module html pages go.
9970 : There is no standard location, so try to copy the previously-selected
9971 : directory structure for the core html pages.
9972 : XXX Better default suggestions would be welcome.
9973 case "$vendorhtml3dir" in
9974 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9975 *) dflt=$vendorhtml3dir ;;
9978 ''|' ') dflt=none ;;
9981 rp='Pathname for the vendor-supplied html pages?'
9983 vendorhtml3dir="$ans"
9984 vendorhtml3direxp="$ansexp"
9987 : Use ' ' for none so value is preserved next time through Configure
9988 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9989 prefixvar=vendorhtml3dir
9992 : Set the vendorman1dir variables
9993 case "$vendorprefix" in
9994 '') vendorman1dir=''
9997 *) : determine where vendor-supplied manual pages go.
9998 case "$vendorman1dir" in
9999 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
10000 *) dflt=$vendorman1dir ;;
10003 ''|' ') dflt=none ;;
10006 rp='Pathname for the vendor-supplied manual section 1 pages?'
10008 vendorman1dir="$ans"
10009 vendorman1direxp="$ansexp"
10012 : Use ' ' for none so value is preserved next time through Configure
10013 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
10014 prefixvar=vendorman1dir
10017 : Set the vendorman3dir variables
10018 case "$vendorprefix" in
10019 '') vendorman3dir=''
10020 vendorman3direxp=''
10022 *) : determine where vendor-supplied module manual pages go.
10023 case "$vendorman3dir" in
10024 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
10025 *) dflt=$vendorman3dir ;;
10028 ''|' ') dflt=none ;;
10031 rp='Pathname for the vendor-supplied manual section 3 pages?'
10033 vendorman3dir="$ans"
10034 vendorman3direxp="$ansexp"
10037 : Use ' ' for none so value is preserved next time through Configure
10038 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
10039 prefixvar=vendorman3dir
10042 : Set the vendorscript variables
10043 case "$vendorprefix" in
10044 '') d_vendorscript="$undef"
10048 *) d_vendorscript="$define"
10049 : determine where vendor-supplied scripts go.
10050 case "$vendorscript" in
10051 '') dflt=$vendorprefix/script
10052 $test -d $dflt || dflt=$vendorbin ;;
10053 *) dflt="$vendorscript" ;;
10057 The installation process will create a directory for
10058 vendor-supplied scripts.
10062 rp='Pathname for the vendor-supplied scripts directory?'
10064 vendorscript="$ans"
10065 vendorscriptexp="$ansexp"
10068 prefixvar=vendorscript
10071 : see if qgcvt exists
10075 : Check what kind of doubles your system has
10076 $echo "Checking the kind of doubles you have..." >&4
10078 #$i_stdlib I_STDLIB
10079 #define DOUBLESIZE $doublesize
10081 #include <stdlib.h>
10084 static const double d = -0.1;
10086 unsigned const char* b = (unsigned const char*)(&d);
10087 #if DOUBLESIZE == 4
10088 if (b[0] == 0xCD && b[3] == 0xBD) {
10089 /* IEEE 754 32-bit little-endian */
10093 if (b[0] == 0xBD && b[3] == 0xCD) {
10094 /* IEEE 754 32-bit big-endian */
10098 if (b[0] == 0xCC && b[3] == 0xCC) {
10099 /* VAX format F, 32-bit PDP-style mixed endian. */
10103 if (b[0] == 0xC0 && b[3] == 0x9A) {
10104 /* IBM single 32-bit */
10109 #if DOUBLESIZE == 8
10110 if (b[0] == 0x9A && b[7] == 0xBF) {
10111 /* IEEE 754 64-bit little-endian */
10115 if (b[0] == 0xBF && b[7] == 0x9A) {
10116 /* IEEE 754 64-bit big-endian */
10120 if (b[0] == 0x99 && b[3] == 0xBF && b[4] == 0x9A && b[7] == 0x99) {
10121 /* ARM mixed endian: two little-endian 32-bit floats, in big endian order:
10122 * 4 5 6 7 0 1 2 3 (MSB = 7, LSB = 0)
10123 * 99 99 b9 bf 9a 99 99 99 */
10127 if (b[0] == 0x99 && b[3] == 0x9A && b[4] == 0xBF && b[7] == 0x99) {
10128 /* The opposite of case 7, mixed endian: two big-endian 32-bit floats,
10129 * in little endian order: 3 2 1 0 7 6 5 4 (MSB = 7, LSB = 0)
10130 * 99 99 99 9a bf b9 99 99 */
10134 if (b[0] == 0xCC && b[7] == 0xCC) {
10135 /* VAX format D, 64-bit PDP-style mixed endian. */
10139 if (b[0] == 0xD9 && b[7] == 0x99) {
10140 /* VAX format G, 64-bit PDP-style mixed endian. */
10144 if (b[0] == 0xC0 && b[7] == 0x9A) {
10145 /* IBM double 64-bit */
10149 if (b[0] == 0xBF && b[7] == 0xCD) {
10150 /* CRAY single 64-bit */
10155 #if DOUBLESIZE == 16
10156 if (b[0] == 0x9A && b[15] == 0xBF) {
10157 /* IEEE 754 128-bit little-endian */
10161 if (b[0] == 0xBF && b[15] == 0x9A) {
10162 /* IEEE 754 128-bit big-endian */
10167 /* Then there are old mainframe/miniframe formats like IBM and CRAY.
10168 * Whether those environments can still build Perl is debatable. */
10169 printf("-1\n"); /* unknown */
10174 if eval $compile; then
10175 doublekind=`$run ./try`
10179 case "$doublekind" in
10180 1) echo "You have IEEE 754 32-bit little endian doubles." >&4 ;;
10181 2) echo "You have IEEE 754 32-bit big endian doubles." >&4 ;;
10182 3) echo "You have IEEE 754 64-bit little endian doubles." >&4 ;;
10183 4) echo "You have IEEE 754 64-bit big endian doubles." >&4 ;;
10184 5) echo "You have IEEE 754 128-bit little endian doubles." >&4 ;;
10185 6) echo "You have IEEE 754 128-bit big endian doubles." >&4 ;;
10186 7) echo "You have IEEE 754 64-bit mixed endian doubles (32-bit LEs in BE)." >&4 ;;
10187 8) echo "You have IEEE 754 64-bit mixed endian doubles (32-bit BEs in LE)." >&4 ;;
10188 9) echo "You have VAX format F 32-bit PDP-style mixed endian doubles." >&4 ;;
10189 10) echo "You have VAX format D 64-bit PDP-style mixed endian doubles." >&4 ;;
10190 11) echo "You have VAX format G 64-bit PDP-style mixed endian doubles." >&4 ;;
10191 12) echo "You have IBM short 32-bit doubles." >&4 ;;
10192 13) echo "You have IBM long 64-bit doubles." >&4 ;;
10193 14) echo "You have Cray single 64-bit doubles." >&4 ;;
10194 *) echo "Cannot figure out your double. You Cyber, or something?" >&4 ;;
10196 d_double_style_ieee=$undef
10197 d_double_style_vax=$undef
10198 d_double_style_ibm=$undef
10199 d_double_style_cray=$undef
10200 case "$doublekind" in
10201 1|2|3|4|5|6|7|8) d_double_style_ieee=$define ;;
10202 9|10|11) d_double_style_vax=$define ;;
10203 12|13) d_double_style_ibm=$define ;;
10204 14) d_double_style_cray=$define ;;
10206 case "$d_double_style_ieee" in
10208 d_double_has_inf=$define
10209 d_double_has_nan=$define
10210 d_double_has_negative_zero=$define
10211 d_double_has_subnormals=$define
10214 d_double_has_inf=$undef
10215 d_double_has_nan=$undef
10216 d_double_has_negative_zero=$undef
10217 d_double_has_subnormals=$undef
10222 : Check print/scan long double stuff
10225 if $test X"$d_longdbl" = X"$define"; then
10227 echo "Checking how to print long doubles..." >&4
10229 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
10230 $cat >try.c <<'EOCP'
10231 #include <sys/types.h>
10234 double d = 123.456;
10235 printf("%.3f\n", d);
10239 if eval $compile; then
10243 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
10244 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
10245 echo "We will use %f."
10251 if $test X"$sPRIfldbl" = X; then
10252 $cat >try.c <<'EOCP'
10253 #include <sys/types.h>
10256 long double d = 123.456;
10257 printf("%.3Lf\n", d);
10261 if eval $compile; then
10265 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
10266 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
10267 echo "We will use %Lf."
10273 if $test X"$sPRIfldbl" = X; then
10274 $cat >try.c <<'EOCP'
10275 #include <sys/types.h>
10278 long double d = 123.456;
10279 printf("%.3llf\n", d);
10283 if eval $compile; then
10287 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
10288 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
10289 echo "We will use %llf."
10295 if $test X"$sPRIfldbl" = X; then
10296 $cat >try.c <<'EOCP'
10297 #include <sys/types.h>
10300 long double d = 123.456;
10301 printf("%.3lf\n", d);
10305 if eval $compile; then
10309 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
10310 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
10311 echo "We will use %lf."
10317 if $test X"$sPRIfldbl" = X; then
10318 echo "Cannot figure out how to print long doubles." >&4
10320 sSCNfldbl=$sPRIfldbl # expect consistency
10327 case "$sPRIfldbl" in
10328 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
10329 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
10330 d_SCNfldbl="$undef";
10332 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
10333 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
10334 d_SCNfldbl="$define";
10338 : Before committing on uselongdouble, see whether that looks sane.
10339 if $test "$uselongdouble" = "$define"; then
10342 echo "Checking if your long double math functions work right..." >&4
10347 printf("%"$sPRIgldbl"\n", sqrtl(logl(expl(cosl(sinl(0.0L))))+powl(2.0L, 3.0L)));
10350 case "$osname:$gccversion" in
10351 aix:) saveccflags="$ccflags"
10352 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
10355 if eval $compile_ok; then
10359 3) echo "Your long double math functions are working correctly." >&4 ;;
10360 *) echo "Your long double math functions are broken, not using long doubles." >&4
10361 uselongdouble=$undef
10365 case "$osname:$gccversion" in
10366 aix:) ccflags="$saveccflags" ;; # restore
10370 : Check how to convert floats to strings.
10372 if test "X$d_Gconvert" = X; then
10375 echo "Checking for an efficient way to convert floats to strings."
10377 case "$uselongdouble" in
10378 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
10380 case "$d_longdbl" in
10381 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
10383 case "$d_PRIgldbl" in
10384 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
10387 #ifdef TRY_gconvert
10388 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
10389 const char *myname = "gconvert";
10392 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
10393 const char *myname = "gcvt";
10396 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
10397 const char *myname = "qgcvt";
10398 #define DOUBLETYPE long double
10401 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
10402 #ifdef HAS_PRIgldbl
10403 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
10405 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
10408 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
10410 const char *myname = "sprintf";
10414 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
10415 #define DOUBLETYPE long double
10417 #define DOUBLETYPE double
10423 #$i_stdlib I_STDLIB
10425 #include <stdlib.h>
10427 #include <string.h>
10429 void checkit(const char *expect, char *got)
10431 if (strcmp(expect, got)) {
10432 printf("%s oddity: Expected %s, got %s\n",
10433 myname, expect, got);
10443 /* This must be 1st test on (which?) platform */
10444 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
10445 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
10446 checkit("0.1", buf);
10448 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
10449 checkit("0.01", buf);
10451 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
10452 checkit("0.001", buf);
10454 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
10455 checkit("0.0001", buf);
10457 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
10458 if (strlen(buf) > 5)
10459 checkit("9e-005", buf); /* for Microsoft ?? */
10461 checkit("9e-05", buf);
10463 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
10466 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
10467 checkit("1.1", buf);
10469 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
10470 checkit("1.01", buf);
10472 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
10473 checkit("1.001", buf);
10475 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
10476 checkit("1.0001", buf);
10478 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
10479 checkit("1.00001", buf);
10481 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
10482 checkit("1.000001", buf);
10484 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
10487 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
10488 checkit("-1", buf);
10490 /* Some Linux gcvt's give 1.e+5 here. */
10491 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
10492 checkit("100000", buf);
10494 /* Some Linux gcvt's give -1.e+5 here. */
10495 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
10496 checkit("-100000", buf);
10498 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
10499 checkit("123.456", buf);
10501 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
10502 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
10503 /* 34 should be enough to scare even long double
10504 * places into using the e notation. */
10505 if (strlen(buf) > 5)
10506 checkit("1e+034", buf); /* for Microsoft */
10508 checkit("1e+34", buf);
10510 /* For Perl, if you add additional tests here, also add them to
10511 * t/base/num.t for benefit of platforms not using Configure or
10512 * overriding d_Gconvert */
10517 : first add preferred functions to our list
10519 for xxx_convert in $gconvert_preference; do
10520 case $xxx_convert in
10521 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
10522 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
10525 : then add any others
10526 for xxx_convert in gconvert gcvt sprintf; do
10527 case "$xxx_list" in
10529 *) xxx_list="$xxx_list $xxx_convert" ;;
10533 case "$d_longdbl$uselongdouble" in
10535 : again, add preferred functions to our list first
10537 for xxx_convert in $gconvert_ld_preference; do
10538 case $xxx_convert in
10539 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
10540 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
10543 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
10544 for xxx_convert in qgcvt sprintf $xxx_list; do
10545 case "$xxx_ld_list" in
10546 $xxx_convert*|*" $xxx_convert"*) ;;
10547 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
10550 : if sprintf cannot do long doubles, move it to the end
10551 if test "$d_PRIgldbl" != "$define"; then
10552 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
10554 : if no qgcvt, remove it
10555 if test "$d_qgcvt" != "$define"; then
10556 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
10559 xxx_list="$xxx_ld_list"
10563 for xxx_convert in $xxx_list; do
10564 echo "Trying $xxx_convert..."
10565 $rm -f try try$_o core
10566 set try -DTRY_$xxx_convert
10567 if eval $compile; then
10568 echo "$xxx_convert() found." >&4
10569 if $run ./try; then
10570 echo "I'll use $xxx_convert to convert floats into a string." >&4
10573 echo "...But $xxx_convert didn't work as I expected."
10577 echo "$xxx_convert NOT found." >&4
10582 if test X$xxx_convert = X; then
10583 echo "*** WHOA THERE!!! ***" >&4
10584 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
10585 xxx_convert=sprintf
10588 case "$xxx_convert" in
10589 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
10590 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
10591 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
10592 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
10593 "$define$define$define")
10594 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
10595 "$define$define$undef")
10596 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
10597 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
10605 : see if _fwalk exists
10609 : see if accept4 exists
10610 set accept4 d_accept4
10613 : Initialize h_fcntl
10616 : Initialize h_sysfile
10619 : access call always available on UNIX
10620 set access d_access
10623 : locate the flags for 'access()'
10624 case "$d_access" in
10627 $cat >access.c <<EOCP
10628 #include <sys/types.h>
10633 #include <sys/file.h>
10636 #include <unistd.h>
10638 #$i_stdlib I_STDLIB
10640 #include <stdlib.h>
10646 : check sys/file.h first, no particular reason here
10647 if $test `./findhdr sys/file.h` && \
10648 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
10650 echo "<sys/file.h> defines the *_OK access constants." >&4
10651 elif $test `./findhdr fcntl.h` && \
10652 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
10654 echo "<fcntl.h> defines the *_OK access constants." >&4
10655 elif $test `./findhdr unistd.h` && \
10656 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
10657 echo "<unistd.h> defines the *_OK access constants." >&4
10659 echo "I can't find the four *_OK access constants--I'll use mine." >&4
10665 : see if accessx exists
10666 set accessx d_accessx
10669 : see if acosh exists
10673 : see if aintl exists
10677 : see if alarm exists
10681 : see if 64bit time functions exists
10683 set ctime64 d_ctime64
10686 set localtime64 d_localtime64
10689 set gmtime64 d_gmtime64
10692 set mktime64 d_mktime64
10695 set difftime64 d_difftime64
10698 set asctime64 d_asctime64
10701 : see if POSIX threads are available
10702 set pthread.h i_pthread
10705 : define a function to check prototypes
10706 $cat > protochk <<EOSH
10709 optimize="$optimize"
10713 usethreads=$usethreads
10714 i_pthread=$i_pthread
10715 pthread_h_first=$pthread_h_first
10718 $cat >> protochk <<'EOSH'
10723 while test $# -ge 2; do
10725 $define) echo "#include <$2>" >> try.c ;;
10726 literal) echo "$2" >> try.c ;;
10728 # Extra magic for the benefit of systems that need pthread.h
10729 # to be included early to correctly detect threadsafe functions.
10730 # Such functions must guarantee themselves, though, that the usethreads
10731 # and i_pthread have been defined, before calling protochk.
10732 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
10733 echo "#include <pthread.h>" >> try.c
10738 cat >> try.c <<'EOCP'
10739 #define _(args) args
10741 echo "$foo" >> try.c
10742 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
10743 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
10749 $eunicefix protochk
10751 : Define hasproto macro for Configure internal use
10752 hasproto='varname=$1; func=$2; shift; shift;
10753 while $test $# -ge 2; do
10755 $define) echo "#include <$2>";;
10756 literal) echo "$2" ;;
10760 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
10761 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
10762 echo "$func() prototype found.";
10765 echo "$func() prototype NOT found.";
10772 : see if sys/types.h has to be included
10773 set sys/types.h i_systypes
10776 : see if sys/select.h has to be included
10777 set sys/select.h i_sysselct
10780 : Define hasfield macro for Configure internal use
10781 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
10782 while $test $# -ge 2; do
10784 $define) echo "#include <$2>";;
10788 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
10790 if eval $compile; then
10799 : see if we should include sys/time.h
10802 if test "X$timeincl" = X; then
10803 echo "Testing to see if we should include <sys/time.h>." >&4
10804 $echo $n "I'm now running the test program...$c"
10806 #include <sys/types.h>
10809 #ifdef SYSTIMEKERNEL
10812 #include <sys/time.h>
10815 #include <sys/select.h>
10817 #$i_stdlib I_STDLIB
10819 #include <stdlib.h>
10825 struct timeval bar;
10828 struct timezone tzp;
10830 if (foo.tm_sec == foo.tm_sec)
10833 if (bar.tv_sec == bar.tv_sec)
10840 for s_timezone in '-DS_TIMEZONE' ''; do
10842 for s_timeval in '-DS_TIMEVAL' ''; do
10843 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10844 for i_systime in '-DI_SYSTIME' ''; do
10847 set try $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10848 if eval $compile; then
10849 set X $i_systime $i_systimek $sysselect $s_timeval
10853 $echo $n "Succeeded with $flags$c"
10864 *SYSTIMEKERNEL*) i_systimek="$define"
10865 timeincl=`./findhdr sys/time.h`
10866 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10867 *) i_systimek="$undef";;
10870 *I_SYSTIME*) i_systime="$define"
10871 timeincl=`./findhdr sys/time.h`" $timeincl"
10872 echo "We'll include <sys/time.h>." >&4;;
10873 *) i_systime="$undef";;
10877 : see if struct tm knows about tm_zone
10878 case "$i_systime$i_time" in
10881 echo "Checking to see if your struct tm has tm_zone field..." >&4
10882 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
10890 case "$d_tm_tm_zone" in
10891 "$define") echo "Yes, it does." ;;
10892 *) echo "No, it doesn't." ;;
10894 : see if struct tm knows about tm_gmtoff
10895 case "$i_systime$i_time" in
10898 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
10899 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
10907 case "$d_tm_tm_gmtoff" in
10908 "$define") echo "Yes, it does." ;;
10909 *) echo "No, it doesn't." ;;
10912 : see if asctime_r exists
10913 set asctime_r d_asctime_r
10915 case "$d_asctime_r" in
10917 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10918 case "$d_asctime_r_proto:$usethreads" in
10919 ":define") d_asctime_r_proto=define
10920 set d_asctime_r_proto asctime_r $hdrs
10924 case "$d_asctime_r_proto" in
10926 case "$asctime_r_proto" in
10927 ''|0) try='char* asctime_r(const struct tm*, char*);'
10928 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SB ;;
10930 case "$asctime_r_proto" in
10931 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
10932 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SBI ;;
10934 case "$asctime_r_proto" in
10935 ''|0) try='int asctime_r(const struct tm*, char*);'
10936 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SB ;;
10938 case "$asctime_r_proto" in
10939 ''|0) try='int asctime_r(const struct tm*, char*, int);'
10940 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SBI ;;
10942 case "$asctime_r_proto" in
10943 ''|0) d_asctime_r=undef
10945 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
10946 * ) case "$asctime_r_proto" in
10947 REENTRANT_PROTO*) ;;
10948 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
10950 echo "Prototype: $try" ;;
10953 *) case "$usethreads" in
10954 define) echo "asctime_r has no prototype, not using it." >&4 ;;
10961 *) asctime_r_proto=0
10965 : see if asinh exists
10969 : see if atanh exists
10973 : see if atolf exists
10977 : see if atoll exists
10981 : Look for GCC-style attribute format
10982 case "$d_attribute_format" in
10985 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
10986 $cat >attrib.c <<'EOCP'
10988 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
10990 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10991 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10992 echo "Your C compiler doesn't support __attribute__((format))."
10995 echo "Your C compiler supports __attribute__((format))."
10999 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11003 *) val="$d_attribute_format" ;;
11005 set d_attribute_format
11009 : Look for GCC-style attribute format with null format allowed
11010 case "$d_printf_format_null" in
11011 '') case "$d_attribute_format" in
11014 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
11015 $cat >attrib.c <<EOCP
11017 #$i_stdlib I_STDLIB
11019 #include <stdlib.h>
11021 #$i_inttypes I_INTTYPES
11023 #include <inttypes.h>
11026 #define intptr_t int
11028 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
11029 int null_printf (char* pat,...) { return (int)(intptr_t)pat; }
11030 int main () { exit(null_printf(NULL)); }
11032 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
11033 : run the executable in case it produces a run-time warning
11034 if $run ./attrib >>attrib.out 2>&1; then
11035 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11036 echo "Your C compiler doesn't allow __printf__ format to be null."
11039 echo "Your C compiler allows __printf__ format to be null."
11043 echo "Your C compiler executable failed with __printf__ format null."
11047 echo "Your C compiler fails with __printf__ format null."
11054 *) val="$d_printf_format_null" ;;
11056 set d_printf_format_null
11060 : Look for GCC-style attribute malloc
11061 case "$d_attribute_malloc" in
11064 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
11065 $cat >attrib.c <<'EOCP'
11067 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
11069 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11070 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11071 echo "Your C compiler doesn't support __attribute__((malloc))."
11074 echo "Your C compiler supports __attribute__((malloc))."
11078 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11082 *) val="$d_attribute_malloc" ;;
11084 set d_attribute_malloc
11088 : Look for GCC-style attribute nonnull
11089 case "$d_attribute_nonnull" in
11092 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
11093 $cat >attrib.c <<'EOCP'
11095 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
11097 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11098 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11099 echo "Your C compiler doesn't support __attribute__((nonnull))."
11102 echo "Your C compiler supports __attribute__((nonnull))."
11106 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11110 *) val="$d_attribute_nonnull" ;;
11112 set d_attribute_nonnull
11116 : Look for GCC-style attribute noreturn
11117 case "$d_attribute_noreturn" in
11120 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
11121 $cat >attrib.c <<'EOCP'
11123 void fall_over_dead( void ) __attribute__((noreturn));
11125 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11126 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11127 echo "Your C compiler doesn't support __attribute__((noreturn))."
11130 echo "Your C compiler supports __attribute__((noreturn))."
11134 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11138 *) val="$d_attribute_noreturn" ;;
11140 set d_attribute_noreturn
11144 : Look for GCC-style attribute pure
11145 case "$d_attribute_pure" in
11148 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
11149 $cat >attrib.c <<'EOCP'
11151 int square( int n ) __attribute__((pure));
11153 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11154 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11155 echo "Your C compiler doesn't support __attribute__((pure))."
11158 echo "Your C compiler supports __attribute__((pure))."
11162 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11166 *) val="$d_attribute_pure" ;;
11168 set d_attribute_pure
11172 : Look for GCC-style attribute unused
11173 case "$d_attribute_unused" in
11176 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
11177 $cat >attrib.c <<'EOCP'
11179 int do_something( int dummy __attribute__((unused)), int n );
11181 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11182 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11183 echo "Your C compiler doesn't support __attribute__((unused))."
11186 echo "Your C compiler supports __attribute__((unused))."
11190 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11194 *) val="$d_attribute_unused" ;;
11196 set d_attribute_unused
11200 : Look for GCC-style attribute deprecated
11201 case "$d_attribute_deprecated" in
11204 echo "Checking whether your compiler can handle __attribute__((deprecated)) ..." >&4
11205 $cat >attrib.c <<'EOCP'
11207 int I_am_deprecated(void) __attribute__((deprecated));
11209 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11210 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11211 echo "Your C compiler doesn't support __attribute__((deprecated))."
11214 echo "Your C compiler supports __attribute__((deprecated))."
11218 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11222 *) val="$d_attribute_deprecated" ;;
11224 set d_attribute_deprecated
11228 : Look for GCC-style attribute warn_unused_result
11229 case "$d_attribute_warn_unused_result" in
11232 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
11233 $cat >attrib.c <<'EOCP'
11235 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
11237 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
11238 if $contains 'warning' attrib.out >/dev/null 2>&1; then
11239 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
11242 echo "Your C compiler supports __attribute__((warn_unused_result))."
11246 echo "Your C compiler doesn't seem to understand __attribute__ at all."
11250 *) val="$d_attribute_warn_unused_result" ;;
11252 set d_attribute_warn_unused_result
11256 : see if getpgrp exists
11257 set getpgrp d_getpgrp
11260 case "$d_getpgrp" in
11263 echo "Checking to see which flavor of getpgrp is in use..."
11265 #$i_unistd I_UNISTD
11266 #include <sys/types.h>
11268 # include <unistd.h>
11270 #$i_stdlib I_STDLIB
11272 #include <stdlib.h>
11276 if (getuid() == 0) {
11277 printf("(I see you are running Configure as super-user...)\n");
11280 #ifdef TRY_BSD_PGRP
11281 if (getpgrp(1) == 0)
11290 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11291 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
11293 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11294 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
11297 echo "I can't seem to compile and run the test program."
11299 xxx="a USG one, i.e. you use getpgrp()."
11301 # SVR4 systems can appear rather BSD-ish.
11302 case "$i_unistd" in
11304 xxx="a BSD one, i.e. you use getpgrp(pid)."
11308 xxx="probably a USG one, i.e. you use getpgrp()."
11313 echo "Assuming your getpgrp is $xxx" >&4
11322 : see if setpgrp exists
11323 set setpgrp d_setpgrp
11326 case "$d_setpgrp" in
11329 echo "Checking to see which flavor of setpgrp is in use..."
11331 #$i_unistd I_UNISTD
11332 #include <sys/types.h>
11334 # include <unistd.h>
11336 #$i_stdlib I_STDLIB
11338 #include <stdlib.h>
11342 if (getuid() == 0) {
11343 printf("(I see you are running Configure as super-user...)\n");
11346 #ifdef TRY_BSD_PGRP
11347 if (-1 == setpgrp(1, 1))
11350 if (setpgrp() != -1)
11356 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11357 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
11359 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11360 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
11363 echo "(I can't seem to compile and run the test program.)"
11365 xxx="a USG one, i.e. you use setpgrp()."
11367 # SVR4 systems can appear rather BSD-ish.
11368 case "$i_unistd" in
11370 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
11374 xxx="probably a USG one, i.e. you use setpgrp()."
11379 echo "Assuming your setpgrp is $xxx" >&4
11388 : Look for GCC-style __builtin_add_overflow
11389 case "$d_builtin_add_overflow" in
11392 echo "Checking whether your compiler can handle __builtin_add_overflow ..." >&4
11393 $cat >try.c <<'EOCP'
11395 const unsigned int uint_max = ~0u;
11396 int target_int = 0;
11397 if (__builtin_add_overflow(1, 2, &target_int) || target_int != 3) {
11400 if (!__builtin_add_overflow((int)(uint_max >> 1), 1, &target_int)) {
11403 if (!__builtin_add_overflow(uint_max, -1, &target_int)) {
11410 if eval $compile && $run ./try; then
11411 echo "Your C compiler supports __builtin_add_overflow."
11414 echo "Your C compiler doesn't seem to understand __builtin_add_overflow."
11418 *) val="$d_builtin_add_overflow" ;;
11421 set d_builtin_add_overflow
11425 : Look for GCC-style __builtin_sub_overflow
11426 case "$d_builtin_sub_overflow" in
11429 echo "Checking whether your compiler can handle __builtin_sub_overflow ..." >&4
11430 $cat >try.c <<'EOCP'
11432 const unsigned int uint_max = ~0u;
11433 int target_int = 0;
11434 if (__builtin_sub_overflow(1, -2, &target_int) || target_int != 3) {
11437 if (!__builtin_sub_overflow(-(int)(uint_max >> 1), 2, &target_int)) {
11440 if (!__builtin_sub_overflow(uint_max, 1, &target_int)) {
11447 if eval $compile && $run ./try; then
11448 echo "Your C compiler supports __builtin_sub_overflow."
11451 echo "Your C compiler doesn't seem to understand __builtin_sub_overflow."
11455 *) val="$d_builtin_sub_overflow" ;;
11458 set d_builtin_sub_overflow
11462 : Look for GCC-style __builtin_mul_overflow
11463 case "$d_builtin_mul_overflow" in
11466 echo "Checking whether your compiler can handle __builtin_mul_overflow ..." >&4
11467 $cat >try.c <<'EOCP'
11469 const unsigned int uint_max = ~0u;
11470 int target_int = 0;
11471 if (__builtin_mul_overflow(2, 3, &target_int) || target_int != 6) {
11474 if (!__builtin_mul_overflow((int)(uint_max >> 1), 2, &target_int)) {
11477 if (!__builtin_mul_overflow(uint_max, 1, &target_int)) {
11484 if eval $compile && $run ./try; then
11485 echo "Your C compiler supports __builtin_mul_overflow."
11488 echo "Your C compiler doesn't seem to understand __builtin_mul_overflow."
11492 *) val="$d_builtin_mul_overflow" ;;
11495 set d_builtin_mul_overflow
11499 : Look for GCC-style __builtin_choose_expr
11500 case "$d_builtin_choose_expr" in
11503 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
11504 $cat >try.c <<'EOCP'
11505 #include <assert.h>
11506 #include <stdlib.h>
11509 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
11512 assert( SYRINX(1) == 2112 );
11513 assert( SYRINX(1) != 5150 );
11514 assert( SYRINX(0) == 5150 );
11515 assert( SYRINX(0) != 2112 );
11516 puts( "All good!" );
11522 if eval $compile && $run ./try; then
11523 echo "Your C compiler supports __builtin_choose_expr."
11526 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
11530 *) val="$d_builtin_choose_expr" ;;
11533 set d_builtin_choose_expr
11537 : Look for GCC-style __builtin_expect
11538 case "$d_builtin_expect" in
11541 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
11542 $cat >try.c <<'EOCP'
11545 if ( __builtin_expect(n, 0) ) n = 1;
11546 /* Remember shell exit code truth is 0, C truth is non-zero */
11551 if eval $compile && $run ./try; then
11552 echo "Your C compiler supports __builtin_expect."
11555 echo "Your C compiler doesn't seem to understand __builtin_expect."
11559 *) val="$d_builtin_expect" ;;
11562 set d_builtin_expect
11566 : see if the Compiler supports C99 variadic macros
11567 echo "Checking for C99 variadic macros." >&4
11570 #include <stdarg.h>
11572 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
11576 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
11582 if eval $compile && $run ./try 2>&1 >/dev/null; then
11583 case "`$run ./try`" in
11585 echo "You have C99 variadic macros." >&4
11586 d_c99_variadic_macros="$define"
11589 echo "You don't have functional C99 variadic macros." >&4
11590 d_c99_variadic_macros="$undef"
11594 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
11595 d_c99_variadic_macros="$undef"
11599 : see if signal is declared as pointer to function returning int or void
11601 xxx=`./findhdr signal.h`
11602 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
11603 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
11604 echo "You have int (*signal())() instead of void." >&4
11606 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
11607 echo "You have void (*signal())()." >&4
11609 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
11610 echo "You have int (*signal())() instead of void." >&4
11612 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
11613 echo "You have void (*signal())()." >&4
11616 case "$d_voidsig" in
11618 echo "I can't determine whether signal handler returns void or int..." >&4
11620 rp="What type does your signal handler return?"
11623 v*) val="$define";;
11627 echo "As you already told me, signal handler returns void." >&4
11630 *) echo "As you already told me, signal handler returns int." >&4
11637 case "$d_voidsig" in
11638 "$define") signal_t="void";;
11639 *) signal_t="int";;
11643 : check for ability to cast large floats to 32-bit ints.
11645 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
11646 if $test "$intsize" -ge 4; then
11653 #$i_stdlib I_STDLIB
11655 #include <stdlib.h>
11657 #include <sys/types.h>
11658 #include <signal.h>
11659 $signal_t blech(int s) { exit(3); }
11666 signal(SIGFPE, blech);
11668 /* Don't let compiler optimize the test away. Store the number
11669 in a writable string for gcc to pass to sscanf under HP-UX.
11671 sprintf(str, "2147483647");
11672 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
11676 /* x86 processors will probably give 0x8000 0000, which is a
11677 sign change. We don't want that. We want to mimic SPARC
11678 behavior here, which is to preserve the sign and give
11681 if (i32 != ($xxx) f)
11687 if eval $compile_ok; then
11688 $run ./try 2>/dev/null
11691 echo "(I can't seem to compile the test program--assuming it can't)"
11696 echo "Yup, it can."
11699 echo "Nope, it can't."
11706 : check for ability to cast negative floats to unsigned
11708 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
11711 #$i_stdlib I_STDLIB
11713 #include <stdlib.h>
11715 #include <sys/types.h>
11716 #include <signal.h>
11717 $signal_t blech(int s) { exit(7); }
11718 $signal_t blech_in_list(int s) { exit(4); }
11719 unsigned long dummy_long(unsigned long p) { return p; }
11720 unsigned int dummy_int(unsigned int p) { return p; }
11721 unsigned short dummy_short(unsigned short p) { return p; }
11725 unsigned long along;
11727 unsigned short ashort;
11731 /* Frustrate gcc-2.7.2's optimizer which failed this test with
11732 a direct f = -123. assignment. gcc-2.8.0 reportedly
11733 optimized the whole file away
11735 /* Store the number in a writable string for gcc to pass to
11736 sscanf under HP-UX.
11738 sprintf(str, "-123");
11739 sscanf(str, "%lf", &f); /* f = -123.; */
11741 signal(SIGFPE, blech);
11742 along = (unsigned long)f;
11743 aint = (unsigned int)f;
11744 ashort = (unsigned short)f;
11745 if (along != (unsigned long)-123)
11747 if (aint != (unsigned int)-123)
11749 if (ashort != (unsigned short)-123)
11751 sprintf(str, "1073741824.");
11752 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
11755 along = (unsigned long)f;
11756 if (along != 0x80000000)
11760 along = (unsigned long)f;
11761 if (along != 0x7fffffff)
11765 along = (unsigned long)f;
11766 if (along != 0x80000001)
11770 signal(SIGFPE, blech_in_list);
11771 sprintf(str, "123.");
11772 sscanf(str, "%lf", &f); /* f = 123.; */
11773 along = dummy_long((unsigned long)f);
11774 aint = dummy_int((unsigned int)f);
11775 ashort = dummy_short((unsigned short)f);
11776 if (along != (unsigned long)123)
11778 if (aint != (unsigned int)123)
11780 if (ashort != (unsigned short)123)
11787 if eval $compile_ok; then
11788 $run ./try 2>/dev/null
11791 echo "(I can't seem to compile the test program--assuming it can't)"
11794 case "$castflags" in
11796 echo "Yup, it can."
11799 echo "Nope, it can't."
11806 : see if cbrt exists
11810 : see if chown exists
11814 : see if chroot exists
11815 set chroot d_chroot
11818 : see if chsize exists
11819 set chsize d_chsize
11822 : see if class exists
11826 : see if clearenv exists
11827 set clearenv d_clearenv
11830 : Define hasstruct macro for Configure internal use
11831 hasstruct='varname=$1; struct=$2; shift; shift;
11832 while $test $# -ge 2; do
11834 $define) echo "#include <$2>";;
11838 echo "int main () { struct $struct foo; }" >> try.c;
11840 if eval $compile; then
11849 : see whether socket exists
11853 $echo $n "Hmm... $c" >&4
11854 if set socket val -f d_socket; eval $csym; $val; then
11855 echo "Looks like you have Berkeley networking support." >&4
11857 if set setsockopt val -f; eval $csym; $val; then
11860 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
11861 d_oldsock="$define"
11864 if $contains socklib libc.list >/dev/null 2>&1; then
11865 echo "Looks like you have Berkeley networking support." >&4
11867 : we will have to assume that it supports the 4.2 BSD interface
11870 echo "You don't have Berkeley networking in libc$_a..." >&4
11871 if test "X$d_socket" = "X$define"; then
11872 echo "...but you seem to believe that you have sockets." >&4
11874 for net in net socket
11876 if test -f $sysroot/usr/lib/lib$net$_a; then
11877 ( ($nm $nm_opt $sysroot/usr/lib/lib$net$_a | eval $nm_extract) || \
11878 $ar t $sysroot/usr/lib/lib$net$_a) 2>/dev/null >> libc.list
11879 if $contains socket libc.list >/dev/null 2>&1; then
11884 echo "...but the Wollongong group seems to have hacked it in." >&4
11885 sockethdr="-I$sysroot/usr/netinclude"
11888 echo "Found Berkeley sockets interface in lib$net." >&4
11889 if $contains setsockopt libc.list >/dev/null 2>&1; then
11892 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
11893 d_oldsock="$define"
11899 if test "X$d_socket" != "X$define"; then
11900 echo "or anywhere else I see." >&4
11908 : see if socketpair exists
11909 set socketpair d_sockpair
11914 echo "Checking the availability sa_len in the sock struct ..." >&4
11916 #include <sys/types.h>
11917 #include <sys/socket.h>
11919 struct sockaddr sa;
11920 return (sa.sa_len);
11924 set try; if eval $compile; then
11927 set d_sockaddr_sa_len; eval $setvar
11931 echo "Checking the availability struct sockaddr_in6 ..." >&4
11933 #include <sys/types.h>
11934 #include <sys/socket.h>
11935 #include <netinet/in.h>
11937 struct sockaddr_in6 sin6;
11938 return (sin6.sin6_family);
11942 set try; if eval $compile; then
11945 set d_sockaddr_in6; eval $setvar
11949 echo "Checking the availability sin6_scope_id in struct sockaddr_in6 ..." >&4
11951 #include <sys/types.h>
11952 #include <sys/socket.h>
11953 #include <netinet/in.h>
11955 struct sockaddr_in6 sin6;
11956 return (sin6.sin6_scope_id);
11960 set try; if eval $compile; then
11963 set d_sin6_scope_id; eval $setvar
11967 echo "Checking the availability struct ip_mreq ..." >&4
11969 #include <sys/types.h>
11970 #include <sys/socket.h>
11971 #include <netinet/in.h>
11973 struct ip_mreq mreq;
11974 return (mreq.imr_multiaddr.s_addr);
11978 set try; if eval $compile; then
11981 set d_ip_mreq; eval $setvar
11985 echo "Checking the availability struct ip_mreq_source ..." >&4
11987 #include <sys/types.h>
11988 #include <sys/socket.h>
11989 #include <netinet/in.h>
11991 struct ip_mreq_source mreq;
11992 return (mreq.imr_multiaddr.s_addr);
11996 set try; if eval $compile; then
11999 set d_ip_mreq_source; eval $setvar
12003 echo "Checking the availability struct ipv6_mreq ..." >&4
12005 #include <sys/types.h>
12006 #include <sys/socket.h>
12007 #include <netinet/in.h>
12009 struct ipv6_mreq mreq;
12010 return (mreq.ipv6mr_interface);
12014 set try; if eval $compile; then
12017 set d_ipv6_mreq; eval $setvar
12021 echo "Checking the availability struct ipv6_mreq_source ..." >&4
12023 #include <sys/types.h>
12024 #include <sys/socket.h>
12025 #include <netinet/in.h>
12027 struct ipv6_mreq_source mreq;
12028 return (mreq.imr_multiaddr.s_addr);
12032 set try; if eval $compile; then
12035 set d_ipv6_mreq_source; eval $setvar
12039 echo "Checking the availability of certain socket constants..." >&4
12040 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
12041 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
12043 #include <sys/types.h>
12044 #include <sys/socket.h>
12050 set try; if eval $compile; then
12053 set d_${enum}; eval $setvar
12057 : see if this is a sys/uio.h system
12058 set sys/uio.h i_sysuio
12061 : Check for cmsghdr support
12063 echo "Checking to see if your system supports struct cmsghdr..." >&4
12064 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
12066 case "$d_cmsghdr_s" in
12067 "$define") echo "Yes, it does." ;;
12068 *) echo "No, it doesn't." ;;
12071 : see if copysign exists
12072 set copysign d_copysign
12075 : see if copysignl exists
12076 set copysignl d_copysignl
12079 : see if crypt exists
12084 $define) cryptlib='' ;;
12085 *) if set crypt val -f d_crypt; eval $csym; $val; then
12086 echo 'crypt() found.' >&4
12090 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
12091 if $test -z "$cryptlib"; then
12092 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
12096 if $test -z "$cryptlib"; then
12097 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
12101 if $test -z "$cryptlib"; then
12102 cryptlib=`./loc libcrypt$_a "" $libpth`
12106 if $test -z "$cryptlib"; then
12107 echo 'crypt() NOT found.' >&4
12118 : see if this is a crypt.h system
12119 set crypt.h i_crypt
12122 : see if crypt_r exists
12123 set crypt_r d_crypt_r
12125 case "$d_crypt_r" in
12127 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
12128 case "$d_crypt_r_proto:$usethreads" in
12129 ":define") d_crypt_r_proto=define
12130 set d_crypt_r_proto crypt_r $hdrs
12134 case "$d_crypt_r_proto" in
12136 case "$crypt_r_proto" in
12137 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
12138 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCS ;;
12140 case "$crypt_r_proto" in
12141 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
12142 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCD ;;
12144 case "$crypt_r_proto" in
12145 ''|0) d_crypt_r=undef
12147 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
12148 * ) case "$crypt_r_proto" in
12149 REENTRANT_PROTO*) ;;
12150 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
12152 echo "Prototype: $try" ;;
12155 *) case "$usethreads" in
12156 define) echo "crypt_r has no prototype, not using it." >&4 ;;
12167 : get csh whereabouts
12169 'csh') val="$undef" ;;
12170 *) val="$define" ;;
12174 : Respect a hint or command line value for full_csh.
12175 case "$full_csh" in
12176 '') full_csh=$csh ;;
12179 : see if ctermid exists
12180 set ctermid d_ctermid
12183 : see if ctermid_r exists
12184 set ctermid_r d_ctermid_r
12186 case "$d_ctermid_r" in
12188 hdrs="$i_systypes sys/types.h define stdio.h "
12189 case "$d_ctermid_r_proto:$usethreads" in
12190 ":define") d_ctermid_r_proto=define
12191 set d_ctermid_r_proto ctermid_r $hdrs
12195 case "$d_ctermid_r_proto" in
12197 case "$ctermid_r_proto" in
12198 ''|0) try='char* ctermid_r(char*);'
12199 ./protochk "$extern_C $try" $hdrs && ctermid_r_proto=B_B ;;
12201 case "$ctermid_r_proto" in
12202 ''|0) d_ctermid_r=undef
12204 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
12205 * ) case "$ctermid_r_proto" in
12206 REENTRANT_PROTO*) ;;
12207 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
12209 echo "Prototype: $try" ;;
12212 *) case "$usethreads" in
12213 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
12220 *) ctermid_r_proto=0
12224 : see if ctime_r exists
12225 set ctime_r d_ctime_r
12227 case "$d_ctime_r" in
12229 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
12230 case "$d_ctime_r_proto:$usethreads" in
12231 ":define") d_ctime_r_proto=define
12232 set d_ctime_r_proto ctime_r $hdrs
12236 case "$d_ctime_r_proto" in
12238 case "$ctime_r_proto" in
12239 ''|0) try='char* ctime_r(const time_t*, char*);'
12240 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SB ;;
12242 case "$ctime_r_proto" in
12243 ''|0) try='char* ctime_r(const time_t*, char*, int);'
12244 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SBI ;;
12246 case "$ctime_r_proto" in
12247 ''|0) try='int ctime_r(const time_t*, char*);'
12248 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SB ;;
12250 case "$ctime_r_proto" in
12251 ''|0) try='int ctime_r(const time_t*, char*, int);'
12252 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SBI ;;
12254 case "$ctime_r_proto" in
12255 ''|0) d_ctime_r=undef
12257 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
12258 * ) case "$ctime_r_proto" in
12259 REENTRANT_PROTO*) ;;
12260 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
12262 echo "Prototype: $try" ;;
12265 *) case "$usethreads" in
12266 define) echo "ctime_r has no prototype, not using it." >&4 ;;
12277 : see if cuserid exists
12278 set cuserid d_cuserid
12281 : see if dbm.h is available
12282 : see if dbmclose exists
12283 set dbmclose d_dbmclose
12286 case "$d_dbmclose" in
12296 *) set rpcsvc/dbm.h i_rpcsvcdbm
12301 *) echo "We won't be including <dbm.h>"
12311 : see if prototype for dbminit is available
12313 set d_dbminitproto dbminit $i_dbm dbm.h
12316 : see if difftime exists
12317 set difftime d_difftime
12320 : see if this is a dirent system
12322 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
12324 echo "<dirent.h> found." >&4
12327 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
12328 echo "<sys/dir.h> found." >&4
12331 xinc=`./findhdr sys/ndir.h`
12333 echo "<dirent.h> NOT found." >&4
12338 : Look for type of directory structure.
12340 $cppstdin $cppflags $cppminus < "$xinc" > try.c
12342 case "$direntrytype" in
12344 case "$i_dirent" in
12345 $define) guess1='struct dirent' ;;
12346 *) guess1='struct direct' ;;
12349 *) guess1="$direntrytype"
12354 'struct dirent') guess2='struct direct' ;;
12355 *) guess2='struct dirent' ;;
12358 if $contains "$guess1" try.c >/dev/null 2>&1; then
12359 direntrytype="$guess1"
12360 echo "Your directory entries are $direntrytype." >&4
12361 elif $contains "$guess2" try.c >/dev/null 2>&1; then
12362 direntrytype="$guess2"
12363 echo "Your directory entries seem to be $direntrytype." >&4
12365 echo "I don't recognize your system's directory entries." >&4
12366 rp="What type is used for directory entries on this system?"
12369 direntrytype="$ans"
12373 : see if the directory entry stores field length
12375 $cppstdin $cppflags $cppminus < "$xinc" > try.c
12376 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
12377 echo "Good, your directory entry keeps length information in d_namlen." >&4
12380 echo "Your directory entry does not know about the d_namlen field." >&4
12387 : Look for DIR.dd_fd
12388 case "$i_dirent" in
12390 echo "Checking to see if DIR has a dd_fd member variable" >&4
12392 #$i_stdlib I_STDLIB
12394 #include <stdlib.h>
12396 #include <dirent.h>
12406 if eval $compile; then
12407 echo "Yes, it does."
12410 echo "No, it does not."
12415 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
12423 : see if this is an sysdir system
12424 set sys/dir.h i_sysdir
12427 : see if this is an sysndir system
12428 set sys/ndir.h i_sysndir
12433 $cat >dirfd.c <<EOM
12435 #$i_stdlib I_STDLIB
12437 #include <stdlib.h>
12439 #$i_dirent I_DIRENT /**/
12440 #$i_sysdir I_SYS_DIR /**/
12441 #$i_sysndir I_SYS_NDIR /**/
12442 #$i_systypes I_SYS_TYPES /**/
12443 #if defined(I_SYS_TYPES)
12444 #include <sys/types.h>
12446 #if defined(I_DIRENT)
12447 #include <dirent.h>
12450 #include <sys/ndir.h>
12453 #include <sys/dir.h>
12458 DIR *dirp = opendir(".");
12459 if (dirfd(dirp) >= 0)
12467 if eval $compile; then
12471 $define) echo "dirfd() found." >&4 ;;
12472 *) echo "dirfd() NOT found." >&4 ;;
12478 : see if dladdr exists
12479 set dladdr d_dladdr
12482 : see if dlerror exists
12485 set dlerror d_dlerror
12489 : see if dlfcn is available
12490 set dlfcn.h i_dlfcn
12493 : Check what extension to use for shared libs
12498 On a few systems, the dynamically loaded modules that perl generates and uses
12499 will need a different extension than shared libs. The default will probably
12505 *) dflt="$dlext" ;;
12507 rp='What is the extension of dynamically loaded modules'
12516 : Check if dlsym need a leading underscore
12522 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
12523 $cat >dyna.c <<'EOM'
12530 #$i_stdlib I_STDLIB
12532 #include <stdlib.h>
12536 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
12538 #include <sys/types.h>
12543 extern int fred() ;
12552 int mode = RTLD_LAZY ;
12554 handle = dlopen("./dyna.$dlext", mode) ;
12555 if (handle == NULL) {
12560 symbol = dlsym(handle, "fred") ;
12561 if (symbol == NULL) {
12562 /* try putting a leading underscore */
12563 symbol = dlsym(handle, "_fred") ;
12564 if (symbol == NULL) {
12577 : Call the object file tmp-dyna.o in case dlext=o.
12578 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
12579 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
12580 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
12581 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
12584 1) echo "Test program failed using dlopen." >&4
12585 echo "Perhaps you should not use dynamic loading." >&4;;
12586 2) echo "Test program failed using dlsym." >&4
12587 echo "Perhaps you should not use dynamic loading." >&4;;
12588 3) echo "dlsym needs a leading underscore" >&4
12590 4) echo "dlsym doesn't need a leading underscore." >&4;;
12593 echo "I can't compile and run the test program." >&4
12594 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
12599 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
12604 : see if drand48_r exists
12605 set drand48_r d_drand48_r
12607 case "$d_drand48_r" in
12609 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
12610 case "$d_drand48_r_proto:$usethreads" in
12611 ":define") d_drand48_r_proto=define
12612 set d_drand48_r_proto drand48_r $hdrs
12616 case "$d_drand48_r_proto" in
12618 case "$drand48_r_proto" in
12619 ''|0) try='int drand48_r(struct drand48_data*, double*);'
12620 ./protochk "$extern_C $try" $hdrs && drand48_r_proto=I_ST ;;
12622 case "$drand48_r_proto" in
12623 ''|0) d_drand48_r=undef
12625 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
12626 * ) case "$drand48_r_proto" in
12627 REENTRANT_PROTO*) ;;
12628 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
12630 echo "Prototype: $try" ;;
12633 *) case "$usethreads" in
12634 define) echo "drand48_r has no prototype, not using it." >&4 ;;
12641 *) drand48_r_proto=0
12645 : see if prototype for drand48 is available
12647 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
12650 : see if dup2 exists
12654 : see if dup3 exists
12658 : see if this is an xlocale.h system
12659 set xlocale.h i_xlocale
12662 : see if newlocale exists
12663 set newlocale d_newlocale
12666 : see if freelocale exists
12667 set freelocale d_freelocale
12670 : see if uselocale exists
12671 set uselocale d_uselocale
12674 : see if duplocale exists
12675 set duplocale d_duplocale
12678 : see if querylocale exists
12679 set querylocale d_querylocale
12682 : see if eaccess exists
12683 set eaccess d_eaccess
12686 : see if endgrent exists
12687 set endgrent d_endgrent
12690 : see if this is an grp system
12696 xxx=`./findhdr grp.h`
12697 $cppstdin $cppflags $cppminus < $xxx >$$.h
12699 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
12711 set d_grpasswd; eval $setvar
12715 : see if endgrent_r exists
12716 set endgrent_r d_endgrent_r
12718 case "$d_endgrent_r" in
12720 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12721 case "$d_endgrent_r_proto:$usethreads" in
12722 ":define") d_endgrent_r_proto=define
12723 set d_endgrent_r_proto endgrent_r $hdrs
12727 case "$d_endgrent_r_proto" in
12729 case "$endgrent_r_proto" in
12730 ''|0) try='int endgrent_r(FILE**);'
12731 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=I_H ;;
12733 case "$endgrent_r_proto" in
12734 ''|0) try='void endgrent_r(FILE**);'
12735 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=V_H ;;
12737 case "$endgrent_r_proto" in
12738 ''|0) d_endgrent_r=undef
12740 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
12741 * ) case "$endgrent_r_proto" in
12742 REENTRANT_PROTO*) ;;
12743 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
12745 echo "Prototype: $try" ;;
12748 *) case "$usethreads" in
12749 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
12756 *) endgrent_r_proto=0
12760 : see if endhostent exists
12761 set endhostent d_endhent
12764 : see if this is a netdb.h system
12765 set netdb.h i_netdb
12768 : see if endhostent_r exists
12769 set endhostent_r d_endhostent_r
12771 case "$d_endhostent_r" in
12773 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12774 case "$d_endhostent_r_proto:$usethreads" in
12775 ":define") d_endhostent_r_proto=define
12776 set d_endhostent_r_proto endhostent_r $hdrs
12780 case "$d_endhostent_r_proto" in
12782 case "$endhostent_r_proto" in
12783 ''|0) try='int endhostent_r(struct hostent_data*);'
12784 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=I_D ;;
12786 case "$endhostent_r_proto" in
12787 ''|0) try='void endhostent_r(struct hostent_data*);'
12788 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=V_D ;;
12790 case "$endhostent_r_proto" in
12791 ''|0) d_endhostent_r=undef
12792 endhostent_r_proto=0
12793 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
12794 * ) case "$endhostent_r_proto" in
12795 REENTRANT_PROTO*) ;;
12796 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
12798 echo "Prototype: $try" ;;
12801 *) case "$usethreads" in
12802 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
12804 d_endhostent_r=undef
12805 endhostent_r_proto=0
12809 *) endhostent_r_proto=0
12813 : see if endnetent exists
12814 set endnetent d_endnent
12817 : see if endnetent_r exists
12818 set endnetent_r d_endnetent_r
12820 case "$d_endnetent_r" in
12822 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12823 case "$d_endnetent_r_proto:$usethreads" in
12824 ":define") d_endnetent_r_proto=define
12825 set d_endnetent_r_proto endnetent_r $hdrs
12829 case "$d_endnetent_r_proto" in
12831 case "$endnetent_r_proto" in
12832 ''|0) try='int endnetent_r(struct netent_data*);'
12833 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=I_D ;;
12835 case "$endnetent_r_proto" in
12836 ''|0) try='void endnetent_r(struct netent_data*);'
12837 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=V_D ;;
12839 case "$endnetent_r_proto" in
12840 ''|0) d_endnetent_r=undef
12841 endnetent_r_proto=0
12842 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
12843 * ) case "$endnetent_r_proto" in
12844 REENTRANT_PROTO*) ;;
12845 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
12847 echo "Prototype: $try" ;;
12850 *) case "$usethreads" in
12851 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
12853 d_endnetent_r=undef
12854 endnetent_r_proto=0
12858 *) endnetent_r_proto=0
12862 : see if endprotoent exists
12863 set endprotoent d_endpent
12866 : see if endprotoent_r exists
12867 set endprotoent_r d_endprotoent_r
12869 case "$d_endprotoent_r" in
12871 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12872 case "$d_endprotoent_r_proto:$usethreads" in
12873 ":define") d_endprotoent_r_proto=define
12874 set d_endprotoent_r_proto endprotoent_r $hdrs
12878 case "$d_endprotoent_r_proto" in
12880 case "$endprotoent_r_proto" in
12881 ''|0) try='int endprotoent_r(struct protoent_data*);'
12882 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=I_D ;;
12884 case "$endprotoent_r_proto" in
12885 ''|0) try='void endprotoent_r(struct protoent_data*);'
12886 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=V_D ;;
12888 case "$endprotoent_r_proto" in
12889 ''|0) d_endprotoent_r=undef
12890 endprotoent_r_proto=0
12891 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
12892 * ) case "$endprotoent_r_proto" in
12893 REENTRANT_PROTO*) ;;
12894 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
12896 echo "Prototype: $try" ;;
12899 *) case "$usethreads" in
12900 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
12902 d_endprotoent_r=undef
12903 endprotoent_r_proto=0
12907 *) endprotoent_r_proto=0
12911 : see if endpwent exists
12912 set endpwent d_endpwent
12915 : see if this is a pwd.h system
12921 xxx=`./findhdr pwd.h`
12922 $cppstdin $cppflags $cppminus < $xxx >$$.h
12924 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
12932 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
12940 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
12948 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
12956 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
12964 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
12972 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
12980 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
12992 set d_pwquota; eval $setvar
12993 set d_pwage; eval $setvar
12994 set d_pwchange; eval $setvar
12995 set d_pwclass; eval $setvar
12996 set d_pwexpire; eval $setvar
12997 set d_pwcomment; eval $setvar
12998 set d_pwgecos; eval $setvar
12999 set d_pwpasswd; eval $setvar
13003 : see if endpwent_r exists
13004 set endpwent_r d_endpwent_r
13006 case "$d_endpwent_r" in
13008 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13009 case "$d_endpwent_r_proto:$usethreads" in
13010 ":define") d_endpwent_r_proto=define
13011 set d_endpwent_r_proto endpwent_r $hdrs
13015 case "$d_endpwent_r_proto" in
13017 case "$endpwent_r_proto" in
13018 ''|0) try='int endpwent_r(FILE**);'
13019 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=I_H ;;
13021 case "$endpwent_r_proto" in
13022 ''|0) try='void endpwent_r(FILE**);'
13023 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=V_H ;;
13025 case "$endpwent_r_proto" in
13026 ''|0) d_endpwent_r=undef
13028 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
13029 * ) case "$endpwent_r_proto" in
13030 REENTRANT_PROTO*) ;;
13031 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
13033 echo "Prototype: $try" ;;
13036 *) case "$usethreads" in
13037 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
13044 *) endpwent_r_proto=0
13048 : see if endservent exists
13049 set endservent d_endsent
13052 : see if endservent_r exists
13053 set endservent_r d_endservent_r
13055 case "$d_endservent_r" in
13057 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13058 case "$d_endservent_r_proto:$usethreads" in
13059 ":define") d_endservent_r_proto=define
13060 set d_endservent_r_proto endservent_r $hdrs
13064 case "$d_endservent_r_proto" in
13066 case "$endservent_r_proto" in
13067 ''|0) try='int endservent_r(struct servent_data*);'
13068 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=I_D ;;
13070 case "$endservent_r_proto" in
13071 ''|0) try='void endservent_r(struct servent_data*);'
13072 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=V_D ;;
13074 case "$endservent_r_proto" in
13075 ''|0) d_endservent_r=undef
13076 endservent_r_proto=0
13077 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
13078 * ) case "$endservent_r_proto" in
13079 REENTRANT_PROTO*) ;;
13080 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
13082 echo "Prototype: $try" ;;
13085 *) case "$usethreads" in
13086 define) echo "endservent_r has no prototype, not using it." >&4 ;;
13088 d_endservent_r=undef
13089 endservent_r_proto=0
13093 *) endservent_r_proto=0
13097 : Locate the flags for 'open()'
13100 #include <sys/types.h>
13105 #include <sys/file.h>
13107 #$i_stdlib I_STDLIB
13109 #include <stdlib.h>
13120 : check sys/file.h first to get FREAD on Sun
13121 if $test `./findhdr sys/file.h` && \
13122 set try -DI_SYS_FILE && eval $compile; then
13124 echo "<sys/file.h> defines the O_* constants..." >&4
13125 if $run ./try; then
13126 echo "and you have the 3 argument form of open()." >&4
13129 echo "but not the 3 argument form of open(). Oh, well." >&4
13132 elif $test `./findhdr fcntl.h` && \
13133 set try -DI_FCNTL && eval $compile; then
13135 echo "<fcntl.h> defines the O_* constants..." >&4
13136 if $run ./try; then
13137 echo "and you have the 3 argument form of open()." >&4
13140 echo "but not the 3 argument form of open(). Oh, well." >&4
13145 echo "I can't find the O_* constant definitions! You got problems." >&4
13151 : see if this is a sys/file.h system
13156 : do we need to include sys/file.h ?
13160 if $h_sysfile; then
13162 echo "We'll be including <sys/file.h>." >&4
13165 echo "We won't be including <sys/file.h>." >&4
13175 : see if fcntl.h is there
13180 : see if we can include fcntl.h
13186 echo "We'll be including <fcntl.h>." >&4
13189 if $h_sysfile; then
13190 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
13192 echo "We won't be including <fcntl.h>." >&4
13204 : see if fork exists
13208 : see if pipe exists
13212 : check for non-blocking I/O stuff
13213 case "$h_sysfile" in
13214 true) echo "#include <sys/file.h>" > head.c;;
13217 true) echo "#include <fcntl.h>" > head.c;;
13218 *) echo "#include <sys/fcntl.h>" > head.c;;
13223 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
13224 case "$o_nonblock" in
13226 $cat head.c > try.c
13227 $cat >>try.c <<EOCP
13229 #$i_stdlib I_STDLIB
13231 #include <stdlib.h>
13239 printf("O_NONBLOCK\n");
13243 printf("O_NDELAY\n");
13247 printf("FNDELAY\n");
13254 if eval $compile_ok; then
13255 o_nonblock=`$run ./try`
13256 case "$o_nonblock" in
13257 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
13258 *) echo "Seems like we can use $o_nonblock.";;
13261 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
13264 *) echo "Using $hint value $o_nonblock.";;
13269 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
13272 case "$d_fork:$d_pipe:$d_alarm" in
13273 define:define:define)
13274 $cat head.c > try.c
13275 $cat >>try.c <<EOCP
13277 #include <sys/types.h>
13278 #include <signal.h>
13280 #$i_stdlib I_STDLIB
13282 #include <stdlib.h>
13288 #define MY_O_NONBLOCK $o_nonblock
13289 #ifndef errno /* XXX need better Configure test */
13292 #$i_unistd I_UNISTD
13294 #include <unistd.h>
13296 #include <string.h>
13297 $signal_t blech(int x) { exit(3); }
13299 $cat >> try.c <<'EOCP'
13308 ret = pipe(pd); /* Down: child -> parent */
13311 ret = pipe(pu); /* Up: parent -> child */
13315 close(pd[1]); /* Parent reads from pd[0] */
13316 close(pu[0]); /* Parent writes (blocking) to pu[1] */
13318 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
13323 signal(SIGALRM, blech);
13325 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
13327 sprintf(string, "%d\n", ret);
13328 ret = write(2, string, strlen(string));
13329 if (ret != strlen(string))
13333 if (errno == EAGAIN) {
13334 printf("EAGAIN\n");
13339 if (errno == EWOULDBLOCK)
13340 printf("EWOULDBLOCK\n");
13343 ret = write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
13346 sleep(2); /* Give it time to close our pipe */
13348 ret = read(pd[0], buf, 1); /* Should read EOF */
13350 sprintf(string, "%d\n", ret);
13351 ret = write(4, string, strlen(string));
13352 if (ret != strlen(string))
13357 close(pd[0]); /* We write to pd[1] */
13358 close(pu[1]); /* We read from pu[0] */
13359 ret = read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
13362 close(pd[1]); /* Pipe pd is now fully closed! */
13363 exit(0); /* Bye bye, thank you for playing! */
13367 if eval $compile_ok; then
13368 echo "$startsh" >mtry
13369 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
13371 $run ./mtry >/dev/null 2>&1
13373 0) eagain=`$cat try.out`;;
13374 1) echo "Could not perform non-blocking setting!";;
13375 2) echo "I did a successful read() for something that was not there!";;
13376 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
13377 4) echo "Could not find F_SETFL!";;
13378 *) echo "Something terribly wrong happened during testing.";;
13380 rd_nodata=`$cat try.ret`
13381 echo "A read() system call with no data present returns $rd_nodata."
13382 case "$rd_nodata" in
13385 echo "(That's peculiar, fixing that to be -1.)"
13391 echo "Forcing errno EAGAIN on read() with no data available."
13395 echo "Your read() sets errno to $eagain when no data is available."
13398 status=`$cat try.err`
13400 0) echo "And it correctly returns 0 to signal EOF.";;
13401 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
13402 *) echo "However, your read() returns '$status' on EOF??";;
13405 if test "$status" = "$rd_nodata"; then
13406 echo "WARNING: you can't distinguish between EOF and no data!"
13410 echo "I can't compile the test program--assuming errno EAGAIN will do."
13414 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
13423 echo "Using $hint value $eagain."
13424 echo "Your read() returns $rd_nodata when no data is present."
13425 case "$d_eofnblk" in
13426 "$define") echo "And you can see EOF because read() returns 0.";;
13427 "$undef") echo "But you can't see EOF status from read() returned value.";;
13429 echo "(Assuming you can't see EOF status from read anyway.)"
13435 $rm_try head.c mtry
13437 : see if erf exists
13441 : see if erfc exists
13445 : see if exp2 exists
13449 : see if expm1 exists
13453 : see if _ptr and _cnt from stdio act std
13456 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
13457 echo "(Looks like you have stdio.h from BSD.)"
13458 case "$stdio_ptr" in
13459 '') stdio_ptr='((fp)->_p)'
13462 *) ptr_lval=$d_stdio_ptr_lval;;
13464 case "$stdio_cnt" in
13465 '') stdio_cnt='((fp)->_r)'
13468 *) cnt_lval=$d_stdio_cnt_lval;;
13470 case "$stdio_base" in
13471 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
13473 case "$stdio_bufsiz" in
13474 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
13476 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
13477 echo "(Looks like you have stdio.h from Linux.)"
13478 case "$stdio_ptr" in
13479 '') stdio_ptr='((fp)->_IO_read_ptr)'
13482 *) ptr_lval=$d_stdio_ptr_lval;;
13484 case "$stdio_cnt" in
13485 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
13488 *) cnt_lval=$d_stdio_cnt_lval;;
13490 case "$stdio_base" in
13491 '') stdio_base='((fp)->_IO_read_base)';;
13493 case "$stdio_bufsiz" in
13494 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
13497 case "$stdio_ptr" in
13498 '') stdio_ptr='((fp)->_ptr)'
13501 *) ptr_lval=$d_stdio_ptr_lval;;
13503 case "$stdio_cnt" in
13504 '') stdio_cnt='((fp)->_cnt)'
13507 *) cnt_lval=$d_stdio_cnt_lval;;
13509 case "$stdio_base" in
13510 '') stdio_base='((fp)->_base)';;
13512 case "$stdio_bufsiz" in
13513 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
13517 : test whether _ptr and _cnt really work
13518 echo "Checking how std your stdio is..." >&4
13521 #$i_stdlib I_STDLIB
13523 #include <stdlib.h>
13525 #define FILE_ptr(fp) $stdio_ptr
13526 #define FILE_cnt(fp) $stdio_cnt
13528 FILE *fp = fopen("try.c", "r");
13531 18 <= FILE_cnt(fp) &&
13532 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13540 if eval $compile && $to try.c; then
13541 if $run ./try; then
13542 echo "Your stdio acts pretty std."
13545 echo "Your stdio isn't very std."
13548 echo "Your stdio doesn't appear very std."
13552 # glibc 2.2.90 and above apparently change stdio streams so Perl's
13553 # direct buffer manipulation no longer works. The Configure tests
13554 # should be changed to correctly detect this, but until then,
13555 # the following check should at least let perl compile and run.
13556 # (This quick fix should be updated before 5.8.1.)
13557 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
13558 # A. Dougherty, June 3, 2002.
13559 case "$d_gnulibc" in
13561 case "$gnulibc_version" in
13565 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
13574 : Can _ptr be used as an lvalue?
13575 case "$d_stdstdio$ptr_lval" in
13576 $define$define) val=$define ;;
13579 set d_stdio_ptr_lval
13582 : Can _cnt be used as an lvalue?
13583 case "$d_stdstdio$cnt_lval" in
13584 $define$define) val=$define ;;
13587 set d_stdio_cnt_lval
13591 : test whether setting _ptr sets _cnt as a side effect
13592 d_stdio_ptr_lval_sets_cnt="$undef"
13593 d_stdio_ptr_lval_nochange_cnt="$undef"
13594 case "$d_stdio_ptr_lval$d_stdstdio" in
13596 echo "Checking to see what happens if we set the stdio ptr..." >&4
13599 /* Can we scream? */
13600 /* Eat dust sed :-) */
13601 /* In the buffer space, no one can hear you scream. */
13602 #$i_stdlib I_STDLIB
13604 #include <stdlib.h>
13606 #define FILE_ptr(fp) $stdio_ptr
13607 #define FILE_cnt(fp) $stdio_cnt
13608 #include <sys/types.h>
13610 FILE *fp = fopen("try.c", "r");
13615 puts("Fail even to read");
13618 c = getc(fp); /* Read away the first # */
13620 puts("Fail even to read");
13624 18 <= FILE_cnt(fp) &&
13625 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13627 puts("Fail even to read");
13630 ptr = (char*) FILE_ptr(fp);
13631 cnt = (size_t)FILE_cnt(fp);
13633 FILE_ptr(fp) += 42;
13635 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
13636 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
13639 if (FILE_cnt(fp) <= 20) {
13640 printf ("Fail (<20 chars to test)");
13643 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
13644 puts("Fail compare");
13647 if (cnt == FILE_cnt(fp)) {
13648 puts("Pass_unchanged");
13651 if (FILE_cnt(fp) == (cnt - 42)) {
13652 puts("Pass_changed");
13655 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
13661 if eval $compile && $to try.c; then
13662 case `$run ./try` in
13664 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
13665 d_stdio_ptr_lval_sets_cnt="$define" ;;
13667 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
13668 d_stdio_ptr_lval_nochange_cnt="$define" ;;
13670 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
13672 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
13675 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
13681 : see if _base is also standard
13683 case "$d_stdstdio" in
13687 #$i_stdlib I_STDLIB
13689 #include <stdlib.h>
13691 #define FILE_base(fp) $stdio_base
13692 #define FILE_bufsiz(fp) $stdio_bufsiz
13694 FILE *fp = fopen("try.c", "r");
13697 19 <= FILE_bufsiz(fp) &&
13698 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
13705 if eval $compile && $to try.c; then
13706 if $run ./try; then
13707 echo "And its _base field acts std."
13710 echo "But its _base field isn't std."
13713 echo "However, it seems to be lacking the _base field."
13721 : see if fast_stdio exists
13723 case "$d_stdstdio:$d_stdio_ptr_lval" in
13725 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
13727 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
13736 : see if fchdir exists
13737 set fchdir d_fchdir
13740 : see if fchmod exists
13741 set fchmod d_fchmod
13744 : check for openat, unlinkat, renameat, linkat, fchmodat
13745 set openat d_openat
13748 set unlinkat d_unlinkat
13751 set renameat d_renameat
13754 set linkat d_linkat
13757 set fchmodat d_fchmodat
13760 : see if fchown exists
13761 set fchown d_fchown
13764 : see if this is an fcntl system
13768 : See if fcntl-based locking works.
13771 #$i_stdlib I_STDLIB
13773 #include <stdlib.h>
13775 #include <unistd.h>
13777 #include <signal.h>
13778 $signal_t blech(int x) { exit(3); }
13780 #if defined(F_SETLK) && defined(F_SETLKW)
13781 struct flock flock;
13783 fd = open("try.c", O_RDONLY);
13784 flock.l_type = F_RDLCK;
13785 flock.l_whence = SEEK_SET;
13786 flock.l_start = flock.l_len = 0;
13787 signal(SIGALRM, blech);
13789 retval = fcntl(fd, F_SETLK, &flock);
13791 (retval < 0 ? exit(2) : exit(0));
13797 echo "Checking if fcntl-based file locking works... "
13801 if eval $compile_ok; then
13802 if $run ./try; then
13803 echo "Yes, it seems to work."
13806 echo "Nope, it didn't work."
13811 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
13812 *** This is (almost) impossible.
13813 *** If your NFS lock daemons are not feeling well, something like
13814 *** this may happen, please investigate. Cannot continue, aborting.
13822 echo "I'm unable to compile the test program, so I'll assume not."
13827 echo "Nope, since you don't even have fcntl()."
13830 set d_fcntl_can_lock
13834 : check for fd_set items
13837 Checking to see how well your C compiler handles fd_set and friends ...
13840 #$i_stdlib I_STDLIB
13842 #include <stdlib.h>
13844 #$i_systime I_SYS_TIME
13845 #$i_sysselct I_SYS_SELECT
13846 #$d_socket HAS_SOCKET
13847 #include <sys/types.h>
13849 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
13852 #include <sys/time.h>
13854 #ifdef I_SYS_SELECT
13855 #include <sys/select.h>
13864 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
13872 if eval $compile; then
13873 d_fds_bits="$define"
13875 echo "Well, your system knows about the normal fd_set typedef..." >&4
13876 if $run ./try; then
13877 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
13878 d_fd_macros="$define"
13881 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
13883 d_fd_macros="$undef"
13887 Hmm, your compiler has some difficulty with fd_set. Checking further...
13890 if eval $compile; then
13891 d_fds_bits="$undef"
13893 echo "Well, your system has some sort of fd_set available..." >&4
13894 if $run ./try; then
13895 echo "and you have the normal fd_set macros." >&4
13896 d_fd_macros="$define"
13899 but not the normal fd_set macros! Gross! More work for me...
13901 d_fd_macros="$undef"
13904 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
13906 d_fds_bits="$undef"
13907 d_fd_macros="$undef"
13912 : see if fdclose exists
13913 set fdclose d_fdclose
13916 : see if fdim exists
13920 : see if fegetround exists
13921 set fegetround d_fegetround
13924 : see if fgetpos exists
13925 set fgetpos d_fgetpos
13928 : see if finite exists
13929 set finite d_finite
13932 : see if finitel exists
13933 set finitel d_finitel
13936 : see if flock exists
13940 : see if prototype for flock is available
13942 set d_flockproto flock $i_sysfile sys/file.h
13945 : see if fma exists
13949 : see if fmax exists
13953 : see if fmin exists
13957 : see if fp_class exists
13958 set fp_class d_fp_class
13961 : check for fpclassify
13962 echo "Checking to see if you have fpclassify..." >&4
13965 int main() { return fpclassify(1.0) == FP_NORMAL ? 0 : 1; }
13968 if eval $compile; then
13970 echo "You have fpclassify."
13973 echo "You do not have fpclassify."
13979 : see if fp_classify exists
13980 set fp_classify d_fp_classify
13983 : see if fp_classl exists
13984 set fp_classl d_fp_classl
13987 : see if pathconf exists
13988 set pathconf d_pathconf
13991 : see if fpathconf exists
13992 set fpathconf d_fpathconf
13995 : see if fpclass exists
13996 set fpclass d_fpclass
13999 : see if fpclassl exists
14000 set fpclassl d_fpclassl
14003 : see if fpgetround exists
14004 set fpgetround d_fpgetround
14007 : check for fpos64_t
14009 echo "Checking to see if you have fpos64_t..." >&4
14012 int main() { fpos64_t x = 7; }
14015 if eval $compile; then
14017 echo "You have fpos64_t."
14020 echo "You do not have fpos64_t."
14021 case "$fpossize" in
14022 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
14029 : see if frexpl exists
14030 set frexpl d_frexpl
14033 : see if this is a sys/param system
14034 set sys/param.h i_sysparam
14037 : see if this is a sys/mount.h system
14038 set sys/mount.h i_sysmount
14041 : Check for fs_data_s
14043 echo "Checking to see if your system supports struct fs_data..." >&4
14044 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
14046 case "$d_fs_data_s" in
14047 "$define") echo "Yes, it does." ;;
14048 *) echo "No, it doesn't." ;;
14051 : see if fseeko exists
14052 set fseeko d_fseeko
14054 case "$longsize" in
14055 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
14058 : see if fsetpos exists
14059 set fsetpos d_fsetpos
14062 : see if fstatfs exists
14063 set fstatfs d_fstatfs
14066 : see if statvfs exists
14067 set statvfs d_statvfs
14070 : see if fstatvfs exists
14071 set fstatvfs d_fstatvfs
14074 : see if fsync exists
14078 : see if ftello exists
14079 set ftello d_ftello
14081 case "$longsize" in
14082 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
14085 : check for a working futimes
14088 echo "Checking if you have a working futimes()" >&4
14091 #include <sys/time.h>
14094 #include <stdlib.h>
14099 fd = open ("try.c", O_RDWR);
14100 if (-1 == fd) exit (1);
14101 rv = futimes (fd, NULL);
14102 exit (rv == -1 ? errno : 0);
14106 if eval $compile; then
14110 0) echo "Yes, you have" >&4
14111 d_futimes="$define"
14113 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
14117 echo "No, it does not (probably harmless)" >&4
14121 : look for gai_strerror
14123 $cat >try.c <<'EOCP'
14124 #include <sys/types.h>
14125 #include <sys/socket.h>
14129 return (gai_strerror (0) ? 0 : 1);
14134 if eval $compile; then
14137 0) echo "A working gai_strerror() found." >&4
14139 *) echo "gai_strerror() found, but it doesn't work" >&4
14143 echo "gai_strerror() NOT found." >&4
14149 : see if ndbm.h is available
14152 : Compatibility location for RedHat 7.1
14153 set gdbm/ndbm.h i_gdbmndbm
14155 : Compatibility location for Debian 4.0
14156 set gdbm-ndbm.h i_gdbm_ndbm
14160 if $test "$i_ndbm" = "$define" -o "$i_gdbmndbm" = "$define" -o "$i_gdbm_ndbm" = "$define"; then
14161 : see if dbm_open exists
14162 set dbm_open d_dbm_open
14164 case "$d_dbm_open" in
14167 i_gdbmndbm="$undef"
14168 i_gdbm_ndbm="$undef"
14169 echo "We won't be including <ndbm.h>"
14179 ndbm_hdr_protochk='name=$1; hdr=$2;
14180 eval "ihdr=\$""i_$name";
14182 if $test "$ihdr" = "$define"; then
14183 $echo "Checking if your <$hdr> uses prototypes..." >&4;
14184 case "$d_cplusplus" in
14185 $define) ./protochk "$extern_C void dbm_close(DBM *);" literal "extern \"C\" {" $ihdr $hdr literal "}" && val="$define" ;;
14186 *) ./protochk "$extern_C void dbm_close(int, int);" $ihdr $hdr || val="$define" ;;
14189 $define) $echo "Your <$hdr> seems to have prototypes";;
14190 *) $echo "Your <$hdr> does not seem to have prototypes";;
14193 set "d_${name}_h_uses_prototypes";
14197 eval $ndbm_hdr_protochk
14198 set gdbmndbm gdbm/ndbm.h
14199 eval $ndbm_hdr_protochk
14200 set gdbm_ndbm gdbm-ndbm.h
14201 eval $ndbm_hdr_protochk
14203 : see if getaddrinfo exists
14204 set getaddrinfo d_getaddrinfo
14207 : see if getcwd exists
14208 set getcwd d_getcwd
14211 : see if getespwnam exists
14212 set getespwnam d_getespwnam
14215 : see if getfsstat exists
14216 set getfsstat d_getfsstat
14219 : see if getgrent exists
14220 set getgrent d_getgrent
14223 : see if getgrent_r exists
14224 set getgrent_r d_getgrent_r
14226 case "$d_getgrent_r" in
14228 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14229 case "$d_getgrent_r_proto:$usethreads" in
14230 ":define") d_getgrent_r_proto=define
14231 set d_getgrent_r_proto getgrent_r $hdrs
14235 case "$d_getgrent_r_proto" in
14237 case "$getgrent_r_proto" in
14238 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
14239 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBWR ;;
14241 case "$getgrent_r_proto" in
14242 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
14243 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIR ;;
14245 case "$getgrent_r_proto" in
14246 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
14247 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBW ;;
14249 case "$getgrent_r_proto" in
14250 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
14251 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBI ;;
14253 case "$getgrent_r_proto" in
14254 ''|0) try='int getgrent_r(struct group*, char*, int);'
14255 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBI ;;
14257 case "$getgrent_r_proto" in
14258 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
14259 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIH ;;
14261 case "$getgrent_r_proto" in
14262 ''|0) d_getgrent_r=undef
14264 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
14265 * ) case "$getgrent_r_proto" in
14266 REENTRANT_PROTO*) ;;
14267 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
14269 echo "Prototype: $try" ;;
14272 *) case "$usethreads" in
14273 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
14280 *) getgrent_r_proto=0
14284 : see if getgrgid_r exists
14285 set getgrgid_r d_getgrgid_r
14287 case "$d_getgrgid_r" in
14289 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14290 case "$d_getgrgid_r_proto:$usethreads" in
14291 ":define") d_getgrgid_r_proto=define
14292 set d_getgrgid_r_proto getgrgid_r $hdrs
14296 case "$d_getgrgid_r_proto" in
14298 case "$getgrgid_r_proto" in
14299 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
14300 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
14302 case "$getgrgid_r_proto" in
14303 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
14304 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
14306 case "$getgrgid_r_proto" in
14307 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
14308 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
14310 case "$getgrgid_r_proto" in
14311 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
14312 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
14314 case "$getgrgid_r_proto" in
14315 ''|0) d_getgrgid_r=undef
14317 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
14318 * ) case "$getgrgid_r_proto" in
14319 REENTRANT_PROTO*) ;;
14320 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
14322 echo "Prototype: $try" ;;
14325 *) case "$usethreads" in
14326 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
14333 *) getgrgid_r_proto=0
14337 : see if getgrnam_r exists
14338 set getgrnam_r d_getgrnam_r
14340 case "$d_getgrnam_r" in
14342 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14343 case "$d_getgrnam_r_proto:$usethreads" in
14344 ":define") d_getgrnam_r_proto=define
14345 set d_getgrnam_r_proto getgrnam_r $hdrs
14349 case "$d_getgrnam_r_proto" in
14351 case "$getgrnam_r_proto" in
14352 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
14353 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
14355 case "$getgrnam_r_proto" in
14356 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
14357 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
14359 case "$getgrnam_r_proto" in
14360 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
14361 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CBI ;;
14363 case "$getgrnam_r_proto" in
14364 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
14365 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
14367 case "$getgrnam_r_proto" in
14368 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
14369 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
14371 case "$getgrnam_r_proto" in
14372 ''|0) d_getgrnam_r=undef
14374 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
14375 * ) case "$getgrnam_r_proto" in
14376 REENTRANT_PROTO*) ;;
14377 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
14379 echo "Prototype: $try" ;;
14382 *) case "$usethreads" in
14383 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
14390 *) getgrnam_r_proto=0
14394 : see if gethostbyaddr exists
14395 set gethostbyaddr d_gethbyaddr
14398 : see if gethostbyname exists
14399 set gethostbyname d_gethbyname
14402 : see if gethostent exists
14403 set gethostent d_gethent
14406 : see how we will look up host name
14409 if set gethostname val -f d_gethname; eval $csym; $val; then
14410 echo 'gethostname() found.' >&4
14411 d_gethname="$define"
14414 if set uname val -f d_uname; eval $csym; $val; then
14417 uname() was found, but you're running xenix, and older versions of xenix
14418 have a broken uname(). If you don't really know whether your xenix is old
14419 enough to have a broken system call, use the default answer.
14424 "$define") dflt=n;;
14426 rp='Is your uname() broken?'
14429 n*) d_uname="$define"; call=uname;;
14432 echo 'uname() found.' >&4
14439 case "$d_gethname" in
14440 '') d_gethname="$undef";;
14443 '') d_uname="$undef";;
14445 case "$d_uname$d_gethname" in
14450 Every now and then someone has a $call() that lies about the hostname
14451 but can't be fixed for political or economic reasons. If you wish, I can
14452 pretend $call() isn't there and maybe compute hostname at run-time
14453 thanks to the '$phostname' command.
14456 rp="Shall I ignore $call() from now on?"
14459 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
14462 case "$phostname" in
14463 '') aphostname='';;
14464 *) case "$aphostname" in
14466 *) set X $phostname
14470 file=`./loc $file $file $pth`
14471 aphostname=`echo $file $*`
14476 case "$d_uname$d_gethname" in
14479 case "$phostname" in
14481 echo "There will be no way for $package to get your hostname." >&4;;
14483 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
14487 case "$d_phostname" in
14488 '') d_phostname="$undef";;
14491 : see if gethostbyaddr_r exists
14492 set gethostbyaddr_r d_gethostbyaddr_r
14494 case "$d_gethostbyaddr_r" in
14496 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14497 case "$d_gethostbyaddr_r_proto:$usethreads" in
14498 ":define") d_gethostbyaddr_r_proto=define
14499 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
14503 case "$d_gethostbyaddr_r_proto" in
14505 case "$gethostbyaddr_r_proto" in
14506 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
14507 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
14509 case "$gethostbyaddr_r_proto" in
14510 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
14511 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
14513 case "$gethostbyaddr_r_proto" in
14514 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
14515 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
14517 case "$gethostbyaddr_r_proto" in
14518 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
14519 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
14521 case "$gethostbyaddr_r_proto" in
14522 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
14523 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
14525 case "$gethostbyaddr_r_proto" in
14526 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
14527 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
14529 case "$gethostbyaddr_r_proto" in
14530 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
14531 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
14533 case "$gethostbyaddr_r_proto" in
14534 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
14535 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
14537 case "$gethostbyaddr_r_proto" in
14538 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
14539 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
14541 case "$gethostbyaddr_r_proto" in
14542 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
14543 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
14545 case "$gethostbyaddr_r_proto" in
14546 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
14547 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
14549 case "$gethostbyaddr_r_proto" in
14550 ''|0) d_gethostbyaddr_r=undef
14551 gethostbyaddr_r_proto=0
14552 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
14553 * ) case "$gethostbyaddr_r_proto" in
14554 REENTRANT_PROTO*) ;;
14555 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
14557 echo "Prototype: $try" ;;
14560 *) case "$usethreads" in
14561 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
14563 d_gethostbyaddr_r=undef
14564 gethostbyaddr_r_proto=0
14568 *) gethostbyaddr_r_proto=0
14572 : see if gethostbyname_r exists
14573 set gethostbyname_r d_gethostbyname_r
14575 case "$d_gethostbyname_r" in
14577 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14578 case "$d_gethostbyname_r_proto:$usethreads" in
14579 ":define") d_gethostbyname_r_proto=define
14580 set d_gethostbyname_r_proto gethostbyname_r $hdrs
14584 case "$d_gethostbyname_r_proto" in
14586 case "$gethostbyname_r_proto" in
14587 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
14588 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
14590 case "$gethostbyname_r_proto" in
14591 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
14592 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
14594 case "$gethostbyname_r_proto" in
14595 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
14596 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
14598 case "$gethostbyname_r_proto" in
14599 ''|0) d_gethostbyname_r=undef
14600 gethostbyname_r_proto=0
14601 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
14602 * ) case "$gethostbyname_r_proto" in
14603 REENTRANT_PROTO*) ;;
14604 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
14606 echo "Prototype: $try" ;;
14609 *) case "$usethreads" in
14610 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
14612 d_gethostbyname_r=undef
14613 gethostbyname_r_proto=0
14617 *) gethostbyname_r_proto=0
14621 : see if gethostent_r exists
14622 set gethostent_r d_gethostent_r
14624 case "$d_gethostent_r" in
14626 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14627 case "$d_gethostent_r_proto:$usethreads" in
14628 ":define") d_gethostent_r_proto=define
14629 set d_gethostent_r_proto gethostent_r $hdrs
14633 case "$d_gethostent_r_proto" in
14635 case "$gethostent_r_proto" in
14636 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
14637 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
14639 case "$gethostent_r_proto" in
14640 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
14641 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBIE ;;
14643 case "$gethostent_r_proto" in
14644 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
14645 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBIE ;;
14647 case "$gethostent_r_proto" in
14648 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
14649 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBI ;;
14651 case "$gethostent_r_proto" in
14652 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
14653 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBI ;;
14655 case "$gethostent_r_proto" in
14656 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
14657 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SD ;;
14659 case "$gethostent_r_proto" in
14660 ''|0) d_gethostent_r=undef
14661 gethostent_r_proto=0
14662 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
14663 * ) case "$gethostent_r_proto" in
14664 REENTRANT_PROTO*) ;;
14665 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
14667 echo "Prototype: $try" ;;
14670 *) case "$usethreads" in
14671 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
14673 d_gethostent_r=undef
14674 gethostent_r_proto=0
14678 *) gethostent_r_proto=0
14682 : see if prototypes for various gethostxxx netdb.h functions are available
14684 set d_gethostprotos gethostent $i_netdb netdb.h
14687 : see if getitimer exists
14688 set getitimer d_getitimer
14691 : see if getlogin exists
14692 set getlogin d_getlogin
14695 : see if getlogin_r exists
14696 set getlogin_r d_getlogin_r
14698 case "$d_getlogin_r" in
14700 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
14701 case "$d_getlogin_r_proto:$usethreads" in
14702 ":define") d_getlogin_r_proto=define
14703 set d_getlogin_r_proto getlogin_r $hdrs
14707 case "$d_getlogin_r_proto" in
14709 case "$getlogin_r_proto" in
14710 ''|0) try='int getlogin_r(char*, size_t);'
14711 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BW ;;
14713 case "$getlogin_r_proto" in
14714 ''|0) try='int getlogin_r(char*, int);'
14715 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BI ;;
14717 case "$getlogin_r_proto" in
14718 ''|0) try='char* getlogin_r(char*, size_t);'
14719 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BW ;;
14721 case "$getlogin_r_proto" in
14722 ''|0) try='char* getlogin_r(char*, int);'
14723 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BI ;;
14725 case "$getlogin_r_proto" in
14726 ''|0) d_getlogin_r=undef
14728 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
14729 * ) case "$getlogin_r_proto" in
14730 REENTRANT_PROTO*) ;;
14731 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
14733 echo "Prototype: $try" ;;
14736 *) case "$usethreads" in
14737 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
14744 *) getlogin_r_proto=0
14748 : see if getmnt exists
14749 set getmnt d_getmnt
14752 : see if getmntent exists
14753 set getmntent d_getmntent
14756 : see if getnameinfo exists
14757 set getnameinfo d_getnameinfo
14760 : see if getnetbyaddr exists
14761 set getnetbyaddr d_getnbyaddr
14764 : see if getnetbyname exists
14765 set getnetbyname d_getnbyname
14768 : see if getnetent exists
14769 set getnetent d_getnent
14772 : see if getnetbyaddr_r exists
14773 set getnetbyaddr_r d_getnetbyaddr_r
14775 case "$d_getnetbyaddr_r" in
14777 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14778 case "$d_getnetbyaddr_r_proto:$usethreads" in
14779 ":define") d_getnetbyaddr_r_proto=define
14780 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
14784 case "$d_getnetbyaddr_r_proto" in
14786 case "$getnetbyaddr_r_proto" in
14787 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
14788 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
14790 case "$getnetbyaddr_r_proto" in
14791 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
14792 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
14794 case "$getnetbyaddr_r_proto" in
14795 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
14796 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
14798 case "$getnetbyaddr_r_proto" in
14799 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
14800 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
14802 case "$getnetbyaddr_r_proto" in
14803 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
14804 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
14806 case "$getnetbyaddr_r_proto" in
14807 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
14808 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
14810 case "$getnetbyaddr_r_proto" in
14811 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
14812 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
14814 case "$getnetbyaddr_r_proto" in
14815 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
14816 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
14818 case "$getnetbyaddr_r_proto" in
14819 ''|0) d_getnetbyaddr_r=undef
14820 getnetbyaddr_r_proto=0
14821 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
14822 * ) case "$getnetbyaddr_r_proto" in
14823 REENTRANT_PROTO*) ;;
14824 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
14826 echo "Prototype: $try" ;;
14829 *) case "$usethreads" in
14830 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
14832 d_getnetbyaddr_r=undef
14833 getnetbyaddr_r_proto=0
14837 *) getnetbyaddr_r_proto=0
14841 : see if getnetbyname_r exists
14842 set getnetbyname_r d_getnetbyname_r
14844 case "$d_getnetbyname_r" in
14846 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14847 case "$d_getnetbyname_r_proto:$usethreads" in
14848 ":define") d_getnetbyname_r_proto=define
14849 set d_getnetbyname_r_proto getnetbyname_r $hdrs
14853 case "$d_getnetbyname_r_proto" in
14855 case "$getnetbyname_r_proto" in
14856 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
14857 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
14859 case "$getnetbyname_r_proto" in
14860 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
14861 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
14863 case "$getnetbyname_r_proto" in
14864 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
14865 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
14867 case "$getnetbyname_r_proto" in
14868 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
14869 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
14871 case "$getnetbyname_r_proto" in
14872 ''|0) d_getnetbyname_r=undef
14873 getnetbyname_r_proto=0
14874 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
14875 * ) case "$getnetbyname_r_proto" in
14876 REENTRANT_PROTO*) ;;
14877 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
14879 echo "Prototype: $try" ;;
14882 *) case "$usethreads" in
14883 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
14885 d_getnetbyname_r=undef
14886 getnetbyname_r_proto=0
14890 *) getnetbyname_r_proto=0
14894 : see if getnetent_r exists
14895 set getnetent_r d_getnetent_r
14897 case "$d_getnetent_r" in
14899 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14900 case "$d_getnetent_r_proto:$usethreads" in
14901 ":define") d_getnetent_r_proto=define
14902 set d_getnetent_r_proto getnetent_r $hdrs
14906 case "$d_getnetent_r_proto" in
14908 case "$getnetent_r_proto" in
14909 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
14910 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
14912 case "$getnetent_r_proto" in
14913 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
14914 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBIE ;;
14916 case "$getnetent_r_proto" in
14917 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
14918 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBIE ;;
14920 case "$getnetent_r_proto" in
14921 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
14922 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBI ;;
14924 case "$getnetent_r_proto" in
14925 ''|0) try='int getnetent_r(struct netent*, char*, int);'
14926 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBI ;;
14928 case "$getnetent_r_proto" in
14929 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
14930 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SD ;;
14932 case "$getnetent_r_proto" in
14933 ''|0) d_getnetent_r=undef
14934 getnetent_r_proto=0
14935 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
14936 * ) case "$getnetent_r_proto" in
14937 REENTRANT_PROTO*) ;;
14938 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
14940 echo "Prototype: $try" ;;
14943 *) case "$usethreads" in
14944 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
14946 d_getnetent_r=undef
14947 getnetent_r_proto=0
14951 *) getnetent_r_proto=0
14955 : see if prototypes for various getnetxxx netdb.h functions are available
14957 set d_getnetprotos getnetent $i_netdb netdb.h
14960 : see if getpagesize exists
14961 set getpagesize d_getpagsz
14964 : Optional checks for getprotobyname and getprotobynumber
14966 : see if getprotobyname exists
14967 set getprotobyname d_getpbyname
14970 : see if getprotobynumber exists
14971 set getprotobynumber d_getpbynumber
14974 : see if getprotoent exists
14975 set getprotoent d_getpent
14978 : see if getpgid exists
14979 set getpgid d_getpgid
14982 : see if getpgrp2 exists
14983 set getpgrp2 d_getpgrp2
14986 : see if getppid exists
14987 set getppid d_getppid
14990 : see if getpriority exists
14991 set getpriority d_getprior
14994 : see if getprotobyname_r exists
14995 set getprotobyname_r d_getprotobyname_r
14997 case "$d_getprotobyname_r" in
14999 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15000 case "$d_getprotobyname_r_proto:$usethreads" in
15001 ":define") d_getprotobyname_r_proto=define
15002 set d_getprotobyname_r_proto getprotobyname_r $hdrs
15006 case "$d_getprotobyname_r_proto" in
15008 case "$getprotobyname_r_proto" in
15009 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
15010 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
15012 case "$getprotobyname_r_proto" in
15013 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
15014 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
15016 case "$getprotobyname_r_proto" in
15017 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
15018 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
15020 case "$getprotobyname_r_proto" in
15021 ''|0) d_getprotobyname_r=undef
15022 getprotobyname_r_proto=0
15023 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
15024 * ) case "$getprotobyname_r_proto" in
15025 REENTRANT_PROTO*) ;;
15026 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
15028 echo "Prototype: $try" ;;
15031 *) case "$usethreads" in
15032 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
15034 d_getprotobyname_r=undef
15035 getprotobyname_r_proto=0
15039 *) getprotobyname_r_proto=0
15043 : see if getprotobynumber_r exists
15044 set getprotobynumber_r d_getprotobynumber_r
15046 case "$d_getprotobynumber_r" in
15048 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15049 case "$d_getprotobynumber_r_proto:$usethreads" in
15050 ":define") d_getprotobynumber_r_proto=define
15051 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
15055 case "$d_getprotobynumber_r_proto" in
15057 case "$getprotobynumber_r_proto" in
15058 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
15059 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
15061 case "$getprotobynumber_r_proto" in
15062 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
15063 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
15065 case "$getprotobynumber_r_proto" in
15066 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
15067 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
15069 case "$getprotobynumber_r_proto" in
15070 ''|0) d_getprotobynumber_r=undef
15071 getprotobynumber_r_proto=0
15072 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
15073 * ) case "$getprotobynumber_r_proto" in
15074 REENTRANT_PROTO*) ;;
15075 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
15077 echo "Prototype: $try" ;;
15080 *) case "$usethreads" in
15081 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
15083 d_getprotobynumber_r=undef
15084 getprotobynumber_r_proto=0
15088 *) getprotobynumber_r_proto=0
15092 : see if getprotoent_r exists
15093 set getprotoent_r d_getprotoent_r
15095 case "$d_getprotoent_r" in
15097 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15098 case "$d_getprotoent_r_proto:$usethreads" in
15099 ":define") d_getprotoent_r_proto=define
15100 set d_getprotoent_r_proto getprotoent_r $hdrs
15104 case "$d_getprotoent_r_proto" in
15106 case "$getprotoent_r_proto" in
15107 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
15108 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
15110 case "$getprotoent_r_proto" in
15111 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
15112 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBI ;;
15114 case "$getprotoent_r_proto" in
15115 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
15116 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=S_SBI ;;
15118 case "$getprotoent_r_proto" in
15119 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
15120 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SD ;;
15122 case "$getprotoent_r_proto" in
15123 ''|0) d_getprotoent_r=undef
15124 getprotoent_r_proto=0
15125 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
15126 * ) case "$getprotoent_r_proto" in
15127 REENTRANT_PROTO*) ;;
15128 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
15130 echo "Prototype: $try" ;;
15133 *) case "$usethreads" in
15134 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
15136 d_getprotoent_r=undef
15137 getprotoent_r_proto=0
15141 *) getprotoent_r_proto=0
15145 : see if prototypes for various getprotoxxx netdb.h functions are available
15147 set d_getprotoprotos getprotoent $i_netdb netdb.h
15150 : see if getprpwnam exists
15151 set getprpwnam d_getprpwnam
15154 : see if getpwent exists
15155 set getpwent d_getpwent
15158 : see if getpwent_r exists
15159 set getpwent_r d_getpwent_r
15161 case "$d_getpwent_r" in
15163 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15164 case "$d_getpwent_r_proto:$usethreads" in
15165 ":define") d_getpwent_r_proto=define
15166 set d_getpwent_r_proto getpwent_r $hdrs
15170 case "$d_getpwent_r_proto" in
15172 case "$getpwent_r_proto" in
15173 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
15174 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBWR ;;
15176 case "$getpwent_r_proto" in
15177 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
15178 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIR ;;
15180 case "$getpwent_r_proto" in
15181 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
15182 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBW ;;
15184 case "$getpwent_r_proto" in
15185 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
15186 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBI ;;
15188 case "$getpwent_r_proto" in
15189 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
15190 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBI ;;
15192 case "$getpwent_r_proto" in
15193 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
15194 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIH ;;
15196 case "$getpwent_r_proto" in
15197 ''|0) d_getpwent_r=undef
15199 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
15200 * ) case "$getpwent_r_proto" in
15201 REENTRANT_PROTO*) ;;
15202 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
15204 echo "Prototype: $try" ;;
15207 *) case "$usethreads" in
15208 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
15215 *) getpwent_r_proto=0
15219 : see if getpwnam_r exists
15220 set getpwnam_r d_getpwnam_r
15222 case "$d_getpwnam_r" in
15224 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15225 case "$d_getpwnam_r_proto:$usethreads" in
15226 ":define") d_getpwnam_r_proto=define
15227 set d_getpwnam_r_proto getpwnam_r $hdrs
15231 case "$d_getpwnam_r_proto" in
15233 case "$getpwnam_r_proto" in
15234 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
15235 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
15237 case "$getpwnam_r_proto" in
15238 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
15239 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
15241 case "$getpwnam_r_proto" in
15242 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
15243 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
15245 case "$getpwnam_r_proto" in
15246 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
15247 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
15249 case "$getpwnam_r_proto" in
15250 ''|0) d_getpwnam_r=undef
15252 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
15253 * ) case "$getpwnam_r_proto" in
15254 REENTRANT_PROTO*) ;;
15255 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
15257 echo "Prototype: $try" ;;
15260 *) case "$usethreads" in
15261 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
15268 *) getpwnam_r_proto=0
15272 : see if getpwuid_r exists
15273 set getpwuid_r d_getpwuid_r
15275 case "$d_getpwuid_r" in
15277 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15278 case "$d_getpwuid_r_proto:$usethreads" in
15279 ":define") d_getpwuid_r_proto=define
15280 set d_getpwuid_r_proto getpwuid_r $hdrs
15284 case "$d_getpwuid_r_proto" in
15286 case "$getpwuid_r_proto" in
15287 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
15288 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
15290 case "$getpwuid_r_proto" in
15291 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
15292 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
15294 case "$getpwuid_r_proto" in
15295 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
15296 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
15298 case "$getpwuid_r_proto" in
15299 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
15300 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
15302 case "$getpwuid_r_proto" in
15303 ''|0) d_getpwuid_r=undef
15305 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
15306 * ) case "$getpwuid_r_proto" in
15307 REENTRANT_PROTO*) ;;
15308 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
15310 echo "Prototype: $try" ;;
15313 *) case "$usethreads" in
15314 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
15321 *) getpwuid_r_proto=0
15325 : Optional checks for getsbyname and getsbyport
15327 : see if getservbyname exists
15328 set getservbyname d_getsbyname
15331 : see if getservbyport exists
15332 set getservbyport d_getsbyport
15335 : see if getservent exists
15336 set getservent d_getsent
15339 : see if getservbyname_r exists
15340 set getservbyname_r d_getservbyname_r
15342 case "$d_getservbyname_r" in
15344 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15345 case "$d_getservbyname_r_proto:$usethreads" in
15346 ":define") d_getservbyname_r_proto=define
15347 set d_getservbyname_r_proto getservbyname_r $hdrs
15351 case "$d_getservbyname_r_proto" in
15353 case "$getservbyname_r_proto" in
15354 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
15355 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
15357 case "$getservbyname_r_proto" in
15358 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
15359 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
15361 case "$getservbyname_r_proto" in
15362 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
15363 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
15365 case "$getservbyname_r_proto" in
15366 ''|0) d_getservbyname_r=undef
15367 getservbyname_r_proto=0
15368 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
15369 * ) case "$getservbyname_r_proto" in
15370 REENTRANT_PROTO*) ;;
15371 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
15373 echo "Prototype: $try" ;;
15376 *) case "$usethreads" in
15377 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
15379 d_getservbyname_r=undef
15380 getservbyname_r_proto=0
15384 *) getservbyname_r_proto=0
15388 : see if getservbyport_r exists
15389 set getservbyport_r d_getservbyport_r
15391 case "$d_getservbyport_r" in
15393 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15394 case "$d_getservbyport_r_proto:$usethreads" in
15395 ":define") d_getservbyport_r_proto=define
15396 set d_getservbyport_r_proto getservbyport_r $hdrs
15400 case "$d_getservbyport_r_proto" in
15402 case "$getservbyport_r_proto" in
15403 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
15404 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
15406 case "$getservbyport_r_proto" in
15407 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
15408 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
15410 case "$getservbyport_r_proto" in
15411 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
15412 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
15414 case "$getservbyport_r_proto" in
15415 ''|0) d_getservbyport_r=undef
15416 getservbyport_r_proto=0
15417 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
15418 * ) case "$getservbyport_r_proto" in
15419 REENTRANT_PROTO*) ;;
15420 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
15422 echo "Prototype: $try" ;;
15425 *) case "$usethreads" in
15426 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
15428 d_getservbyport_r=undef
15429 getservbyport_r_proto=0
15433 *) getservbyport_r_proto=0
15437 : see if getservent_r exists
15438 set getservent_r d_getservent_r
15440 case "$d_getservent_r" in
15442 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15443 case "$d_getservent_r_proto:$usethreads" in
15444 ":define") d_getservent_r_proto=define
15445 set d_getservent_r_proto getservent_r $hdrs
15449 case "$d_getservent_r_proto" in
15451 case "$getservent_r_proto" in
15452 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
15453 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBWR ;;
15455 case "$getservent_r_proto" in
15456 ''|0) try='int getservent_r(struct servent*, char*, int);'
15457 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBI ;;
15459 case "$getservent_r_proto" in
15460 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
15461 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=S_SBI ;;
15463 case "$getservent_r_proto" in
15464 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
15465 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SD ;;
15467 case "$getservent_r_proto" in
15468 ''|0) d_getservent_r=undef
15469 getservent_r_proto=0
15470 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
15471 * ) case "$getservent_r_proto" in
15472 REENTRANT_PROTO*) ;;
15473 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
15475 echo "Prototype: $try" ;;
15478 *) case "$usethreads" in
15479 define) echo "getservent_r has no prototype, not using it." >&4 ;;
15481 d_getservent_r=undef
15482 getservent_r_proto=0
15486 *) getservent_r_proto=0
15490 : see if prototypes for various getservxxx netdb.h functions are available
15492 set d_getservprotos getservent $i_netdb netdb.h
15495 : see if getspnam exists
15496 set getspnam d_getspnam
15499 : see if this is a shadow.h system
15500 set shadow.h i_shadow
15503 : see if getspnam_r exists
15504 set getspnam_r d_getspnam_r
15506 case "$d_getspnam_r" in
15508 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
15509 case "$d_getspnam_r_proto:$usethreads" in
15510 ":define") d_getspnam_r_proto=define
15511 set d_getspnam_r_proto getspnam_r $hdrs
15515 case "$d_getspnam_r_proto" in
15517 case "$getspnam_r_proto" in
15518 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
15519 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
15521 case "$getspnam_r_proto" in
15522 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
15523 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=S_CSBI ;;
15525 case "$getspnam_r_proto" in
15526 ''|0) d_getspnam_r=undef
15528 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
15529 * ) case "$getspnam_r_proto" in
15530 REENTRANT_PROTO*) ;;
15531 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
15533 echo "Prototype: $try" ;;
15536 *) case "$usethreads" in
15537 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
15544 *) getspnam_r_proto=0
15548 : see if gettimeofday or ftime exists
15549 set gettimeofday d_gettimeod
15551 case "$d_gettimeod" in
15557 val="$undef"; set d_ftime; eval $setvar
15560 case "$d_gettimeod$d_ftime" in
15563 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
15567 : see if gmtime_r exists
15568 set gmtime_r d_gmtime_r
15570 case "$d_gmtime_r" in
15572 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15573 case "$d_gmtime_r_proto:$usethreads" in
15574 ":define") d_gmtime_r_proto=define
15575 set d_gmtime_r_proto gmtime_r $hdrs
15579 case "$d_gmtime_r_proto" in
15581 case "$gmtime_r_proto" in
15582 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
15583 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=S_TS ;;
15585 case "$gmtime_r_proto" in
15586 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
15587 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=I_TS ;;
15589 case "$gmtime_r_proto" in
15590 ''|0) d_gmtime_r=undef
15592 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
15593 * ) case "$gmtime_r_proto" in
15594 REENTRANT_PROTO*) ;;
15595 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
15597 echo "Prototype: $try" ;;
15600 *) case "$usethreads" in
15601 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
15608 *) gmtime_r_proto=0
15612 : see if hasmntopt exists
15613 set hasmntopt d_hasmntopt
15616 : see if this is a netinet/in.h or sys/in.h system
15617 set netinet/in.h i_niin sys/in.h i_sysin
15620 : see if arpa/inet.h has to be included
15621 set arpa/inet.h i_arpainet
15624 : see if htonl --and friends-- exists
15629 : Maybe they are macros.
15632 $cat >htonl.c <<EOM
15634 #include <sys/types.h>
15635 #$i_niin I_NETINET_IN
15637 #$i_arpainet I_ARPA_INET
15638 #ifdef I_NETINET_IN
15639 #include <netinet/in.h>
15642 #include <sys/in.h>
15645 #include <arpa/inet.h>
15648 printf("Defined as a macro.");
15651 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
15652 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
15654 echo "But it seems to be defined as a macro." >&4
15662 : see if hypot exists
15666 : see if ilogb exists
15670 : see if ilogbl exists
15671 set ilogbl d_ilogbl
15674 : check whether inet_aton exists
15675 set inet_aton d_inetaton
15678 : see if inet_ntop exists
15679 set inet_ntop d_inetntop
15682 : see if inet_pton exists
15683 set inet_pton d_inetpton
15688 $cat >isascii.c <<EOCP
15691 #$i_stdlib I_STDLIB
15693 #include <stdlib.h>
15704 if eval $compile; then
15705 echo "isascii() found." >&4
15708 echo "isascii() NOT found." >&4
15717 $cat >isblank.c <<'EOCP'
15728 if $cc $ccflags $ldflags -o isblank isblank.c $libs >/dev/null 2>&1 ; then
15729 echo "isblank() found." >&4
15732 echo "isblank() NOT found." >&4
15739 : check for isfinite
15740 echo "Checking to see if you have isfinite..." >&4
15743 int main() { return isfinite(0.0); }
15746 if eval $compile; then
15748 echo "You have isfinite."
15751 echo "You do not have isfinite."
15757 : see if isfinitel exists
15758 set isfinitel d_isfinitel
15762 echo "Checking to see if you have isinf..." >&4
15765 int main() { return isinf(0.0); }
15768 if eval $compile; then
15770 echo "You have isinf."
15773 echo "You do not have isinf."
15779 : see if isinfl exists
15780 set isinfl d_isinfl
15784 echo "Checking to see if you have isless..." >&4
15787 int main() { return isless(0.0); }
15790 if eval $compile; then
15792 echo "You have isless."
15795 echo "You do not have isless."
15802 echo "Checking to see if you have isnan..." >&4
15805 int main() { return isnan(0.0); }
15808 if eval $compile; then
15810 echo "You have isnan."
15813 echo "You do not have isnan."
15819 : see if isnanl exists
15820 set isnanl d_isnanl
15823 : check for isnormal
15824 echo "Checking to see if you have isnormal..." >&4
15827 int main() { return isnormal(0.0); }
15830 if eval $compile; then
15832 echo "You have isnormal."
15835 echo "You do not have isnormal."
15845 : see if j0l exists
15849 : see if killpg exists
15850 set killpg d_killpg
15853 : see if localeconv exists
15854 set localeconv d_locconv
15857 : see if libc has the POSIX.1-2008 currency locale rules
15858 case "$d_locconv:$d_lc_monetary_2008" in
15861 #include <locale.h>
15863 struct lconv *lc = localeconv();
15864 char int_p_cs_precedes = lc->int_p_cs_precedes;
15869 if eval $compile; then
15870 d_lc_monetary_2008="$define"
15872 d_lc_monetary_2008="$undef"
15878 : see if lchown exists
15880 $cat > try.c <<'EOCP'
15881 /* System header to define __stub macros and hopefully few prototypes,
15882 which can conflict with char lchown(); below. */
15883 #include <assert.h>
15884 /* Override any gcc2 internal prototype to avoid an error. */
15885 /* We use char because int might match the return type of a gcc2
15886 builtin and then its argument prototype would still apply. */
15889 /* The GNU C library defines this for functions which it implements
15890 to always fail with ENOSYS. Some functions are actually named
15891 something starting with __ and the normal name is an alias. */
15892 #if defined (__stub_lchown) || defined (__stub___lchown)
15900 if eval $compile; then
15901 $echo "lchown() found." >&4
15904 $echo "lchown() NOT found." >&4
15910 : See if number of significant digits in a double precision number is known
15912 $cat >ldbl_dig.c <<EOM
15913 #include <limits.h>
15916 printf("Contains LDBL_DIG");
15919 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
15920 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
15921 echo "LDBL_DIG found." >&4
15924 echo "LDBL_DIG NOT found." >&4
15931 : see if lgamma exists
15932 set lgamma d_lgamma
15935 : see if lgamma_r exists
15936 set lgamma_r d_lgamma_r
15939 : check to see if math.h defines _LIB_VERSION
15940 d_libm_lib_version="$undef"
15942 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
15944 #include <unistd.h>
15946 int main (int argc, char *argv[])
15948 printf ("%d\n", _LIB_VERSION);
15953 if eval $compile; then
15955 echo "Yes, it does ($foo)" >&4
15956 d_libm_lib_version="$define"
15958 echo "No, it does not (probably harmless)" >&4
15962 : see if link exists
15966 : see if llrint exists
15967 set llrint d_llrint
15970 : see if llrintl exists
15971 set llrintl d_llrintl
15974 : see if llround exists
15975 set llround d_llround
15978 : see if llroundl exists
15979 set llroundl d_llroundl
15982 : see if localeconv_l exists
15983 set localeconv_l d_localeconv_l
15986 : see if localtime_r exists
15987 set localtime_r d_localtime_r
15989 case "$d_localtime_r" in
15991 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15992 case "$d_localtime_r_proto:$usethreads" in
15993 ":define") d_localtime_r_proto=define
15994 set d_localtime_r_proto localtime_r $hdrs
15998 case "$d_localtime_r_proto" in
16000 case "$localtime_r_proto" in
16001 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
16002 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=S_TS ;;
16004 case "$localtime_r_proto" in
16005 ''|0) try='int localtime_r(const time_t*, struct tm*);'
16006 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=I_TS ;;
16008 case "$localtime_r_proto" in
16009 ''|0) d_localtime_r=undef
16010 localtime_r_proto=0
16011 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
16012 * ) case "$localtime_r_proto" in
16013 REENTRANT_PROTO*) ;;
16014 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
16016 echo "Prototype: $try" ;;
16019 *) case "$usethreads" in
16020 define) echo "localtime_r has no prototype, not using it." >&4 ;;
16022 d_localtime_r=undef
16023 localtime_r_proto=0
16027 *) localtime_r_proto=0
16031 : see if localtime_r calls tzset
16032 case "$localtime_r_proto" in
16035 /* Does our libc's localtime_r call tzset ?
16036 * return 0 if so, 1 otherwise.
16038 #$i_systypes I_SYS_TYPES
16039 #$i_unistd I_UNISTD
16041 #$i_stdlib I_STDLIB
16042 #$i_malloc I_MALLOC
16044 # include <sys/types.h>
16047 # include <unistd.h>
16053 #include <stdlib.h>
16055 #include <string.h>
16057 # include <malloc.h>
16061 time_t t = time(0L);
16062 char w_tz[]="TZ" "=GMT+5",
16063 e_tz[]="TZ" "=GMT-5",
16064 *tz_e = (char*)malloc(16),
16065 *tz_w = (char*)malloc(16);
16066 struct tm tm_e, tm_w;
16067 memset(&tm_e,'\0',sizeof(struct tm));
16068 memset(&tm_w,'\0',sizeof(struct tm));
16073 localtime_r(&t, &tm_e);
16076 localtime_r(&t, &tm_w);
16078 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
16084 if eval $compile; then
16085 if $run ./try; then
16086 d_localtime_r_needs_tzset=undef;
16088 d_localtime_r_needs_tzset=define;
16091 d_localtime_r_needs_tzset=undef;
16095 d_localtime_r_needs_tzset=undef;
16100 : see if lockf exists
16104 : see if log1p exists
16108 : see if log2 exists
16112 : see if logb exists
16116 : see if lrint exists
16120 : see if lrintl exists
16121 set lrintl d_lrintl
16124 : see if lround exists
16125 set lround d_lround
16128 : see if lroundl exists
16129 set lroundl d_lroundl
16132 : see if prototype for lseek is available
16134 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
16137 : see if lstat exists
16141 : see if madvise exists
16142 set madvise d_madvise
16145 : see if malloc_size exists
16146 set malloc_size d_malloc_size
16149 : see if malloc_size_good exists
16150 set malloc_good_size d_malloc_good_size
16153 : see if mblen exists
16157 : see if mbrlen exists
16158 set mbrlen d_mbrlen
16161 : see if mbrtowc exists
16162 set mbrtowc d_mbrtowc
16165 : see if mbstowcs exists
16166 set mbstowcs d_mbstowcs
16169 : see if mbtowc exists
16170 set mbtowc d_mbtowc
16173 : see if memmem exists
16174 : We need both a prototype in string.h and the symbol in libc.
16177 xx1="#$d_gnulibc HAS_GNULIBC"
16178 xx2='#if defined(HAS_GNULIBC) && !defined(_GNU_SOURCE)'
16179 xx3='# define _GNU_SOURCE'
16181 set d_memmem_proto memmem literal "$xx1" literal "$xx2" literal "$xx3" literal "$xx4" define string.h
16183 case "$d_memmem_proto" in
16184 define) # see if memmem exists
16185 set memmem d_memmem
16194 : see if memrchr exists
16195 : We need both a prototype in string.h and the symbol in libc.
16198 xx1="#$d_gnulibc HAS_GNULIBC"
16199 xx2='#if defined(HAS_GNULIBC) && !defined(_GNU_SOURCE)'
16200 xx3='# define _GNU_SOURCE'
16202 set d_memrchr_proto memrchr literal "$xx1" literal "$xx2" literal "$xx3" literal "$xx4" define string.h
16204 case "$d_memrchr_proto" in
16205 define) # see if memrchr exists
16206 set memrchr d_memrchr
16215 : see if mkdir exists
16219 : see if mkdtemp exists
16220 set mkdtemp d_mkdtemp
16223 : see if mkfifo exists
16224 set mkfifo d_mkfifo
16227 : see if mkostemp exists
16228 set mkostemp d_mkostemp
16231 : see if mkstemp exists
16232 set mkstemp d_mkstemp
16235 : see if mkstemps exists
16236 set mkstemps d_mkstemps
16239 : see if mktime exists
16240 set mktime d_mktime
16243 : see if sys/mman.h has to be included
16244 set sys/mman.h i_sysmman
16247 : see if mmap exists
16250 : see what shmat returns
16251 : default to something harmless
16253 case "$i_sysmman$d_mmap" in
16255 $cat >mmap.c <<'END'
16256 #include <sys/mman.h>
16259 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
16264 echo "and it returns ($mmaptype)." >&4
16268 : see if sqrtl exists
16272 : see if scalbnl exists
16273 set scalbnl d_scalbnl
16276 : see if truncl exists
16277 set truncl d_truncl
16280 : see if modfl exists
16284 : see if prototype for modfl is available
16286 set d_modflproto modfl define math.h
16289 if $test "$uselongdouble" = "$define"; then
16291 if $test "$d_sqrtl" != "$define"; then
16292 message="$message sqrtl"
16294 if $test "$d_modfl" != "$define"; then
16295 if $test "$d_truncl:$d_copysignl" = "$define:$define"; then
16296 echo "You have both truncl and copysignl, so I can emulate modfl."
16298 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
16299 echo "You have both aintl and copysignl, so I can emulate modfl."
16301 message="$message modfl"
16305 if $test "$d_frexpl" != "$define"; then
16306 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
16307 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
16309 message="$message frexpl"
16312 if $test "$d_ldexpl" != "$define"; then
16313 message="$message ldexpl"
16316 if $test "$message" != ""; then
16319 *** You requested the use of long doubles but you do not seem to have
16320 *** the following mathematical functions needed for long double support:
16322 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
16323 *** Cannot continue, aborting.
16331 : see if mprotect exists
16332 set mprotect d_mprotect
16335 : see if msgctl exists
16336 set msgctl d_msgctl
16339 : see if msgget exists
16340 set msgget d_msgget
16343 : see if msgsnd exists
16344 set msgsnd d_msgsnd
16347 : see if msgrcv exists
16348 set msgrcv d_msgrcv
16351 : see how much of the 'msg*(2)' library is present.
16354 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
16355 *"$undef"*) h_msg=false;;
16359 case "`ipcs 2>&1`" in
16360 "SVID messages"*"not configured"*)
16361 echo "Your $osname does not have the msg*(2) configured." >&4
16364 set msgctl d_msgctl
16366 set msgget d_msgget
16368 set msgsnd d_msgsnd
16370 set msgrcv d_msgrcv
16376 : we could also check for sys/ipc.h ...
16377 if $h_msg && $test `./findhdr sys/msg.h`; then
16378 echo "You have the full msg*(2) library." >&4
16381 echo "You don't have the full msg*(2) library." >&4
16387 : Check for msghdr_s
16389 echo "Checking to see if your system supports struct msghdr..." >&4
16390 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
16392 case "$d_msghdr_s" in
16393 "$define") echo "Yes, it does." ;;
16394 *) echo "No, it doesn't." ;;
16397 : see if msync exists
16401 : see if munmap exists
16402 set munmap d_munmap
16405 : see if nan exists
16409 : see if nanosleep exists
16410 set nanosleep d_nanosleep
16413 : see if nearbyint exists
16414 set nearbyint d_nearbyint
16417 : see if nextafter exists
16418 set nextafter d_nextafter
16421 : see if nexttoward exists
16422 set nexttoward d_nexttoward
16425 : see if nice exists
16429 : see if this is a langinfo.h system
16430 set langinfo.h i_langinfo
16433 : see if nl_langinfo exists
16434 set nl_langinfo d_nl_langinfo
16437 : see if this is a quadmath.h system
16438 set quadmath.h i_quadmath
16441 : Check basic sizes
16443 $echo "Choosing the C types to be used for Perl's internal types..." >&4
16445 case "$use64bitint:$d_quad:$quadtype" in
16448 uvtype="$uquadtype"
16453 uvtype="unsigned long"
16459 case "$uselongdouble:$d_longdbl" in
16461 nvtype="long double"
16462 nvsize=$longdblsize
16469 case "$usequadmath:$i_quadmath" in
16471 nvtype="__float128"
16477 *** You requested the use of the quadmath library, but you
16478 *** do not seem to have the quadmath library installed.
16479 *** Cannot continue, aborting.
16485 define:*) $cat <<EOM >&4
16487 *** You requested the use of the quadmath library, but you
16488 *** do not seem to have the required header, <quadmath.h>.
16490 case "$gccversion" in
16493 *** Your gcc looks a bit old:
16499 *** You are not running a gcc.
16504 *** For the quadmath library you need at least gcc 4.6.
16505 *** Cannot continue, aborting.
16511 $echo "(IV will be "$ivtype", $ivsize bytes)"
16512 $echo "(UV will be "$uvtype", $uvsize bytes)"
16513 $echo "(NV will be "$nvtype", $nvsize bytes)"
16516 #$i_inttypes I_INTTYPES
16518 #include <inttypes.h>
16523 int8_t i = INT8_MAX;
16524 uint8_t u = UINT8_MAX;
16525 printf("int8_t\n");
16528 int16_t i = INT16_MAX;
16529 uint16_t u = UINT16_MAX;
16530 printf("int16_t\n");
16533 int32_t i = INT32_MAX;
16534 uint32_t u = UINT32_MAX;
16535 printf("int32_t\n");
16540 i8type="signed char"
16541 u8type="unsigned char"
16546 '') case "$shortsize" in
16548 u16type="unsigned short"
16556 '') set try -DINT16
16557 if eval $compile; then
16558 case "`$run ./try`" in
16570 '') if $test $shortsize -ge 2; then
16572 u16type="unsigned short"
16580 '') case "$longsize" in
16582 u32type="unsigned long"
16586 *) case "$intsize" in
16588 u32type="unsigned int"
16598 '') set try -DINT32
16599 if eval $compile; then
16600 case "`$run ./try`" in
16612 '') if $test $intsize -ge 4; then
16614 u32type="unsigned int"
16622 '') case "$d_quad:$quadtype" in
16624 i64type="$quadtype"
16625 u64type="$uquadtype"
16633 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
16636 #$i_stdlib I_STDLIB
16638 #include <stdlib.h>
16640 #include <sys/types.h>
16641 #include <signal.h>
16643 /* volatile so that the compiler has to store it out to memory */
16644 volatile int bletched = 0;
16645 $signal_t blech(int s) { bletched = 1; }
16650 int n = 8 * $uvsize;
16653 signal(SIGFPE, blech);
16656 for (i = 0; i < n; i++) {
16657 u = u << 1 | ($uvtype)1;
16659 if (($uvtype)d != u)
16663 d = ($nvtype)(u - 1);
16664 if (($uvtype)d != (u - 1))
16671 printf("%d\n", ((i == n) ? -n : i));
16677 d_nv_preserves_uv="$undef"
16678 if eval $compile; then
16679 nv_preserves_uv_bits="`$run ./try`"
16681 case "$nv_preserves_uv_bits" in
16683 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
16684 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
16685 d_nv_preserves_uv="$define"
16687 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
16688 d_nv_preserves_uv="$undef" ;;
16689 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
16690 nv_preserves_uv_bits="0" ;;
16694 $echo "Checking to find the largest integer value your NVs can hold..." >&4
16698 typedef $nvtype NV;
16705 while(count < 256) {
16706 /* volatile so that the compiler has to store it out to memory */
16707 volatile NV up = value + 1.0;
16708 volatile NV negated = -value;
16709 volatile NV down = negated - 1.0;
16710 volatile NV got_up = up - value;
16711 int up_good = got_up == 1.0;
16712 int got_down = down - negated;
16713 int down_good = got_down == -1.0;
16715 if (down_good != up_good) {
16717 "Inconsistency - up %d %f; down %d %f; for 2**%d (%.20f)\n",
16718 up_good, (double) got_up, down_good, (double) got_down,
16719 count, (double) value);
16726 fputs("256.0", stdout);
16729 fputs("2.0", stdout);
16735 fputs("*", stdout);
16741 fprintf(stderr, "Cannot overflow integer range, even at 2**%d (%.20f)\n",
16742 count, (double) value);
16748 nv_overflows_integers_at='0'
16749 if eval $compile; then
16755 The largest integer your NVs can preserve is equal to $xxx
16757 nv_overflows_integers_at="$xxx"
16760 Cannot determine the largest integer value your NVs can hold, unexpected output
16767 Cannot determine the largest integer value your NVs can hold
16774 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
16777 #$i_stdlib I_STDLIB
16779 #include <stdlib.h>
16781 #include <string.h>
16782 #include <sys/types.h>
16783 #include <signal.h>
16785 /* volatile so that the compiler has to store it out to memory */
16786 volatile int bletched = 0;
16787 $signal_t blech(int s) { bletched = 1; }
16790 int checkit($nvtype d, const char *where) {
16792 unsigned char *p = (unsigned char *)v;
16793 unsigned char *end = p + sizeof(d);
16802 p = (unsigned char *)v;
16803 printf("No - %s: 0x", where);
16805 printf ("%02X", *p++);
16810 int main(int argc, char **argv) {
16813 fail += checkit(d, "0.0");
16815 /* The compiler shouldn't be assuming that bletched is 0 */
16818 fail += checkit(d, "bleched");
16821 signal(SIGFPE, blech);
16824 /* Paranoia - the compiler should have no way of knowing that ANSI says
16825 that argv[argc] will always be NULL. Actually, if it did assume this it
16826 would be buggy, as this is C and main() can be called from elsewhere in
16828 d = argv[argc] ? 1 : 0;
16831 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
16834 fail += checkit(d, "ternary");
16836 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
16839 printf("No - memset doesn't give 0.0\n");
16840 /* This might just blow up: */
16841 printf("(gives %g)\n", d);
16847 printf("No - something bleched\n");
16852 printf("No - %d fail(s)\n", fail);
16861 d_nv_zero_is_allbits_zero="$undef"
16862 if eval $compile; then
16868 0.0 is represented as all bits zero in memory
16870 d_nv_zero_is_allbits_zero="$define"
16873 0.0 is not represented as all bits zero in memory
16875 d_nv_zero_is_allbits_zero="$undef"
16880 0.0 is not represented as all bits zero in memory
16882 d_nv_zero_is_allbits_zero="$undef"
16888 : check for off64_t
16890 echo "Checking to see if you have off64_t..." >&4
16892 #include <sys/types.h>
16893 #include <unistd.h>
16894 int main() { off64_t x = 7; }
16897 if eval $compile; then
16899 echo "You have off64_t."
16902 echo "You do not have off64_t."
16903 case "$lseeksize" in
16904 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
16911 : how to create joinable pthreads
16912 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
16914 echo "Checking what constant to use for creating joinable pthreads..." >&4
16915 $cat >try.c <<'EOCP'
16916 #include <pthread.h>
16918 int detachstate = JOINABLE;
16921 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
16922 if eval $compile; then
16923 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
16924 val="$undef" # Yes, undef.
16925 set d_old_pthread_create_joinable
16928 set old_pthread_create_joinable
16931 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
16932 if eval $compile; then
16933 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
16935 set d_old_pthread_create_joinable
16937 val=PTHREAD_CREATE_UNDETACHED
16938 set old_pthread_create_joinable
16941 set try -DJOINABLE=__UNDETACHED
16942 if eval $compile; then
16943 echo "You seem to use __UNDETACHED." >&4
16945 set d_old_pthread_create_joinable
16948 set old_pthread_create_joinable
16951 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
16953 set d_old_pthread_create_joinable
16956 set old_pthread_create_joinable
16963 d_old_pthread_create_joinable="$undef"
16964 old_pthread_create_joinable=""
16967 : see if pause exists
16971 : see if pipe2 exists
16975 : see if poll exists
16979 : see if prctl exists
16983 : see if prctl supports PR_SET_NAME
16984 d_prctl_set_name=$undef
16989 #include <unistd.h>
16991 #include <sys/prctl.h>
16993 int main (int argc, char *argv[])
16995 return (prctl (PR_SET_NAME, "Test"));
16999 if eval $compile_ok && $run ./try; then
17000 echo "Your prctl (PR_SET_NAME, ...) works"
17001 d_prctl_set_name=$define
17007 : see if readlink exists
17008 set readlink d_readlink
17011 : Check if there is a /proc symlink to the abs path of
17012 : the executing program. We will honor hints of d_procselfexe=$undef
17013 : or procselfexe being non-empty, otherwise will try to determine both
17014 : if we have readlink.
17015 : AmigaOS will attempt to mount proc: aka /proc, if /proc/... is
17016 : referenced, and AmigaOS does not have a proc filesystem anyway.
17019 if $test "X$d_procselfexe" = Xundef; then
17021 elif $test "X$procselfexe" != X -a "X$procselfexe" != 'X '; then
17023 elif $test "X$d_readlink" = Xdefine; then
17024 : NetBSD first as /proc/self is a symlink to /proc/curproc,
17025 : and it feels more tidy to avoid an extra level of symlink
17026 set NetBSD /proc/curproc/exe Linux /proc/self/exe FreeBSD /proc/curproc/file Solaris /proc/self/path/a.out
17027 while test $# -gt 0; do
17030 if $issymlink $try; then
17031 $ls -l $try > reflect
17032 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
17033 echo "You have $type-like $try."
17034 procselfexe='"'$try'"'
17036 : This will break out of the loop
17046 : backward compatibility for d_hvfork
17047 if test X$d_hvfork != X; then
17048 d_vfork="$d_hvfork"
17051 : see if there is a vfork
17056 d_pseudofork=$undef
17058 : Ok, but do we want to use it. vfork is reportedly unreliable in
17059 : perl on Solaris 2.x, and probably elsewhere.
17063 case "$usevfork" in
17069 Perl can only use a vfork() that doesn't suffer from strict
17070 restrictions on calling functions or modifying global data in
17071 the child. For example, glibc-2.1 contains such a vfork()
17072 that is unsuitable. If your system provides a proper fork()
17073 call, chances are that you do NOT want perl to use vfork().
17076 rp="Do you still want to use vfork()?"
17081 echo "Ok, we won't use vfork()."
17090 $define) usevfork='true';;
17091 *) usevfork='false';;
17094 : see whether the pthread_atfork exists
17096 #include <pthread.h>
17099 #ifdef PTHREAD_ATFORK
17100 pthread_atfork(NULL,NULL,NULL);
17105 : see if pthread_atfork exists
17106 set try -DPTHREAD_ATFORK
17107 if eval $compile; then
17112 case "$usethreads" in
17115 $define) echo 'pthread_atfork found.' >&4 ;;
17116 *) echo 'pthread_atfork NOT found.' >&4 ;;
17119 set d_pthread_atfork
17122 : see if pthread_attr_setscope exists
17123 set pthread_attr_setscope d_pthread_attr_setscope
17126 : see whether the various POSIXish _yields exist
17128 #include <pthread.h>
17134 #ifdef PTHREAD_YIELD
17137 #ifdef PTHREAD_YIELD_NULL
17138 pthread_yield(NULL);
17144 : see if sched_yield exists
17145 set try -DSCHED_YIELD
17146 if eval $compile; then
17148 sched_yield='sched_yield()'
17152 case "$usethreads" in
17155 $define) echo 'sched_yield() found.' >&4 ;;
17156 *) echo 'sched_yield() NOT found.' >&4 ;;
17162 : see if pthread_yield exists
17163 set try -DPTHREAD_YIELD
17164 if eval $compile; then
17166 case "$sched_yield" in
17167 '') sched_yield='pthread_yield()' ;;
17170 set try -DPTHREAD_YIELD_NULL
17171 if eval $compile; then
17173 case "$sched_yield" in
17174 '') sched_yield='pthread_yield(NULL)' ;;
17180 case "$usethreads" in
17183 $define) echo 'pthread_yield() found.' >&4 ;;
17184 *) echo 'pthread_yield() NOT found.' >&4 ;;
17188 set d_pthread_yield
17190 case "$sched_yield" in
17191 '') sched_yield=undef ;;
17195 : check for ptrdiff_t
17197 echo "Checking to see if you have ptrdiff_t..." >&4
17199 #include <stddef.h>
17200 int main() { ptrdiff_t x = 7; }
17203 if eval $compile; then
17205 echo "You have ptrdiff_t."
17208 echo "You do not have ptrdiff_t."
17214 : see if random_r exists
17215 set random_r d_random_r
17217 case "$d_random_r" in
17219 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17220 case "$d_random_r_proto:$usethreads" in
17221 ":define") d_random_r_proto=define
17222 set d_random_r_proto random_r $hdrs
17226 case "$d_random_r_proto" in
17228 case "$random_r_proto" in
17229 ''|0) try='int random_r(int*, struct random_data*);'
17230 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_iS ;;
17232 case "$random_r_proto" in
17233 ''|0) try='int random_r(long*, struct random_data*);'
17234 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_lS ;;
17236 case "$random_r_proto" in
17237 ''|0) try='int random_r(struct random_data*, int32_t*);'
17238 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_St ;;
17240 case "$random_r_proto" in
17241 ''|0) d_random_r=undef
17243 echo "Disabling random_r, cannot determine prototype." >&4 ;;
17244 * ) case "$random_r_proto" in
17245 REENTRANT_PROTO*) ;;
17246 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
17248 echo "Prototype: $try" ;;
17251 *) case "$usethreads" in
17252 define) echo "random_r has no prototype, not using it." >&4 ;;
17259 *) random_r_proto=0
17263 : see if readdir and friends exist
17264 set readdir d_readdir
17266 set seekdir d_seekdir
17268 set telldir d_telldir
17270 set rewinddir d_rewinddir
17273 : see if readdir64_r exists
17274 set readdir64_r d_readdir64_r
17276 case "$d_readdir64_r" in
17278 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
17279 case "$d_readdir64_r_proto:$usethreads" in
17280 ":define") d_readdir64_r_proto=define
17281 set d_readdir64_r_proto readdir64_r $hdrs
17285 case "$d_readdir64_r_proto" in
17287 case "$readdir64_r_proto" in
17288 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
17289 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TSR ;;
17291 case "$readdir64_r_proto" in
17292 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
17293 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TS ;;
17295 case "$readdir64_r_proto" in
17296 ''|0) d_readdir64_r=undef
17297 readdir64_r_proto=0
17298 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
17299 * ) case "$readdir64_r_proto" in
17300 REENTRANT_PROTO*) ;;
17301 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
17303 echo "Prototype: $try" ;;
17306 *) case "$usethreads" in
17307 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
17309 d_readdir64_r=undef
17310 readdir64_r_proto=0
17314 *) readdir64_r_proto=0
17318 : see if readdir_r exists
17319 set readdir_r d_readdir_r
17321 case "$d_readdir_r" in
17323 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
17324 case "$d_readdir_r_proto:$usethreads" in
17325 ":define") d_readdir_r_proto=define
17326 set d_readdir_r_proto readdir_r $hdrs
17330 case "$d_readdir_r_proto" in
17332 case "$readdir_r_proto" in
17333 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
17334 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TSR ;;
17336 case "$readdir_r_proto" in
17337 ''|0) try='int readdir_r(DIR*, struct dirent*);'
17338 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TS ;;
17340 case "$readdir_r_proto" in
17341 ''|0) d_readdir_r=undef
17343 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
17344 * ) case "$readdir_r_proto" in
17345 REENTRANT_PROTO*) ;;
17346 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
17348 echo "Prototype: $try" ;;
17351 *) case "$usethreads" in
17352 define) echo "readdir_r has no prototype, not using it." >&4 ;;
17359 *) readdir_r_proto=0
17363 : see if readv exists
17367 : see if recvmsg exists
17368 set recvmsg d_recvmsg
17371 : see if regcomp, regcmp, or re_comp exist, for regular pattern matching
17373 if set regcomp val -f d_regcomp; eval $csym; $val; then
17374 echo 'regcomp() found.' >&4
17375 d_regcomp="$define"
17378 elif set regcmp val -f d_regcmp; eval $csym; $val; then
17379 echo 'regcmp() found.' >&4
17383 elif set re_comp val -f d_re_comp; eval $csym; $val; then
17384 echo 're_comp() found, assuming re_exec() also exists.' >&4
17385 d_re_comp="$define"
17390 No regcomp(), regcmp() nor re_comp() found !! No regular pattern matching.
17397 : see if remainder exists
17398 set remainder d_remainder
17401 : see if remquo exists
17402 set remquo d_remquo
17405 : see if rename exists
17406 set rename d_rename
17409 : see if rint exists
17413 : see if rmdir exists
17417 : see if round exists
17421 : see if prototype for sbrk is available
17423 set d_sbrkproto sbrk $i_unistd unistd.h
17426 : see if scalbn exists
17427 set scalbn d_scalbn
17430 : see if select exists
17431 set select d_select
17434 : see if semctl exists
17435 set semctl d_semctl
17438 : see if semget exists
17439 set semget d_semget
17442 : see if semop exists
17446 : see how much of the 'sem*(2)' library is present.
17449 case "$d_semctl$d_semget$d_semop" in
17450 *"$undef"*) h_sem=false;;
17454 case "`ipcs 2>&1`" in
17455 "SVID messages"*"not configured"*)
17456 echo "Your $osname does not have the sem*(2) configured." >&4
17459 set semctl d_semctl
17461 set semget d_semget
17469 : we could also check for sys/ipc.h ...
17470 if $h_sem && $test `./findhdr sys/sem.h`; then
17471 echo "You have the full sem*(2) library." >&4
17474 echo "You don't have the full sem*(2) library." >&4
17480 : see whether sys/sem.h defines union semun
17482 $cat > try.c <<'END'
17483 #include <sys/types.h>
17484 #include <sys/ipc.h>
17485 #include <sys/sem.h>
17486 int main () { union semun semun; semun.buf = 0; }
17489 if eval $compile; then
17490 echo "You have union semun in <sys/sem.h>." >&4
17493 echo "You do not have union semun in <sys/sem.h>." >&4
17500 : see how to do semctl IPC_STAT
17504 $cat > tryh.h <<END
17507 # define S_IRUSR S_IREAD
17508 # define S_IWUSR S_IWRITE
17509 # define S_IXUSR S_IEXEC
17511 # define S_IRUSR 0400
17512 # define S_IWUSR 0200
17513 # define S_IXUSR 0100
17515 # define S_IRGRP (S_IRUSR>>3)
17516 # define S_IWGRP (S_IWUSR>>3)
17517 # define S_IXGRP (S_IXUSR>>3)
17518 # define S_IROTH (S_IRUSR>>6)
17519 # define S_IWOTH (S_IWUSR>>6)
17520 # define S_IXOTH (S_IXUSR>>6)
17523 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
17524 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
17525 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
17528 : see whether semctl IPC_STAT can use union semun
17529 case "$d_semctl_semun" in
17533 #include <sys/types.h>
17534 #include <sys/ipc.h>
17535 #include <sys/sem.h>
17536 #include <sys/stat.h>
17543 #$d_union_semun HAS_UNION_SEMUN
17546 #ifndef HAS_UNION_SEMUN
17549 struct semid_ds *buf;
17550 unsigned short *array;
17556 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
17557 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
17559 struct semid_ds argbuf;
17562 st = semctl(sem, 0, IPC_STAT, arg);
17566 # endif /* IPC_STAT */
17567 printf("semctl IPC_STAT failed: errno = %d\n", errno);
17569 if (semctl(sem, 0, IPC_RMID, arg) != 0)
17570 # endif /* IPC_RMID */
17571 printf("semctl IPC_RMID failed: errno = %d\n", errno);
17573 #endif /* IPC_PRIVATE && ... */
17574 printf("semget failed: errno = %d\n", errno);
17579 if eval $compile; then
17582 semun) val="$define" ;;
17590 case "$d_semctl_semun" in
17592 echo "You can use union semun for semctl IPC_STAT." >&4
17595 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
17600 : see whether semctl IPC_STAT can use struct semid_ds pointer
17601 case "$d_semctl_semid_ds" in
17604 $cat > try.c <<'END'
17605 #include <sys/types.h>
17606 #include <sys/ipc.h>
17607 #include <sys/sem.h>
17608 #include <sys/stat.h>
17617 #ifndef HAS_UNION_SEMUN
17620 struct semid_ds *buf;
17621 unsigned short *array;
17625 struct semid_ds argbuf;
17628 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
17629 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
17633 st = semctl(sem, 0, IPC_STAT, arg);
17635 printf("semid_ds\n");
17637 # endif /* IPC_STAT */
17638 printf("semctl IPC_STAT failed: errno = %d\n", errno);
17640 if (semctl(sem, 0, IPC_RMID, arg) != 0)
17641 # endif /* IPC_RMID */
17642 printf("semctl IPC_RMID failed: errno = %d\n", errno);
17644 #endif /* IPC_PRIVATE && ... */
17645 printf("semget failed: errno = %d\n", errno);
17651 if eval $compile; then
17654 semid_ds) val="$define" ;;
17658 set d_semctl_semid_ds
17662 case "$d_semctl_semid_ds" in
17664 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
17666 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
17672 # We do not have the full sem*(2) library, so assume we can not
17678 set d_semctl_semid_ds
17684 : see if sendmsg exists
17685 set sendmsg d_sendmsg
17688 : see if setegid exists
17689 set setegid d_setegid
17692 : see if seteuid exists
17693 set seteuid d_seteuid
17696 : see if setgrent exists
17697 set setgrent d_setgrent
17700 : see if setgrent_r exists
17701 set setgrent_r d_setgrent_r
17703 case "$d_setgrent_r" in
17705 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
17706 case "$d_setgrent_r_proto:$usethreads" in
17707 ":define") d_setgrent_r_proto=define
17708 set d_setgrent_r_proto setgrent_r $hdrs
17712 case "$d_setgrent_r_proto" in
17714 case "$setgrent_r_proto" in
17715 ''|0) try='int setgrent_r(FILE**);'
17716 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=I_H ;;
17718 case "$setgrent_r_proto" in
17719 ''|0) try='void setgrent_r(FILE**);'
17720 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=V_H ;;
17722 case "$setgrent_r_proto" in
17723 ''|0) d_setgrent_r=undef
17725 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
17726 * ) case "$setgrent_r_proto" in
17727 REENTRANT_PROTO*) ;;
17728 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
17730 echo "Prototype: $try" ;;
17733 *) case "$usethreads" in
17734 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
17741 *) setgrent_r_proto=0
17745 : see if sethostent exists
17746 set sethostent d_sethent
17749 : see if sethostent_r exists
17750 set sethostent_r d_sethostent_r
17752 case "$d_sethostent_r" in
17754 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17755 case "$d_sethostent_r_proto:$usethreads" in
17756 ":define") d_sethostent_r_proto=define
17757 set d_sethostent_r_proto sethostent_r $hdrs
17761 case "$d_sethostent_r_proto" in
17763 case "$sethostent_r_proto" in
17764 ''|0) try='int sethostent_r(int, struct hostent_data*);'
17765 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=I_ID ;;
17767 case "$sethostent_r_proto" in
17768 ''|0) try='void sethostent_r(int, struct hostent_data*);'
17769 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=V_ID ;;
17771 case "$sethostent_r_proto" in
17772 ''|0) d_sethostent_r=undef
17773 sethostent_r_proto=0
17774 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
17775 * ) case "$sethostent_r_proto" in
17776 REENTRANT_PROTO*) ;;
17777 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
17779 echo "Prototype: $try" ;;
17782 *) case "$usethreads" in
17783 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
17785 d_sethostent_r=undef
17786 sethostent_r_proto=0
17790 *) sethostent_r_proto=0
17794 : see if setitimer exists
17795 set setitimer d_setitimer
17798 : see if setlinebuf exists
17799 set setlinebuf d_setlinebuf
17802 : see if locale.h is available
17803 set locale.h i_locale
17806 : see if this system has wctype.h
17807 set wctype.h i_wctype
17810 : see if towupper exists
17811 set towupper d_towupper
17814 : check for setlocale function and behavior
17817 Checking to see if you have setlocale() and its behavior
17820 #include <stdlib.h>
17821 #include <string.h>
17822 #$i_locale I_LOCALE
17824 # include <locale.h>
17826 #$i_wctype I_WCTYPE
17828 # include <wctype.h>
17832 const char * invalid_name = "\a"; /* This is really invalid! */
17833 int accepts_any_locale_name = 0;
17834 int has_C_UTF8 = 0;
17835 unsigned char bad_setlocale = 255;
17837 /* If LC_CTYPE isn't defined the compilation will fail, and locales will be
17838 * disabled. It's hard to imagine an instance where meaningful locale
17839 * handling could be done without LC_CTYPE */
17840 const char * name = setlocale(LC_CTYPE, "C");
17842 if (name == NULL || strcmp(name, "C") != 0) {
17843 exit(bad_setlocale);
17846 name = setlocale(LC_CTYPE, invalid_name);
17847 if (name != NULL) {
17849 /* Let it pass if it accepts the name but gives back one of the C
17851 if (strcmp(name, "C") != 0 && strcmp(name, "C.UTF-8") != 0) {
17852 accepts_any_locale_name = 1;
17856 name = setlocale(LC_CTYPE, "C.UTF-8");
17857 if (name != NULL) {
17858 unsigned char y_with_diaeresis = ('A' == 193) ? 0xDF : 0xFF;
17860 #$d_towupper HAS_TOWUPPER
17861 #ifdef HAS_TOWUPPER
17863 /* We assume that if the machine doesn't have the C99 towupper, it
17864 * doesn't have C.UTF-8, even if we successfully changed locales to
17865 * include it. This seems safer even on platforms that didn't accept
17866 * the really invalid name */
17868 if (towupper(y_with_diaeresis) == 0x178) {
17878 /* Currently unused code to determine if LC_ALL with disparate values uses
17879 * category = value pairs or positional, and to determine the separator
17880 * between the categories. We could add code so that if the separator were
17881 * > '9', we subtract 10; similarly for 'Z' and 'z', and then just about
17882 * every possible ASCII separator would fit in the 5 bits available in the
17883 * exit code. This would not be true in EBCDIC. And then if LC_ALL is
17884 * positional, we probably would want to know the order of the categories.
17885 * Using a file between the C program and the shell script would really be
17886 * require to do that */
17889 unsigned char min_separator = ' ' - 1;
17890 unsigned char separator = min_separator;
17891 int uses_name_value_pair_names = 0;
17893 name = setlocale(LC_ALL, "C");
17894 if (name == NULL || strcmp(name, "C") != 0) {
17895 exit(bad_setlocale);
17901 name = setlocale(LC_CTYPE, "C.UTF-8");
17902 if (name == NULL) {
17903 exit(bad_setlocale);
17905 name = setlocale(LC_ALL, NULL);
17906 if (name == NULL) {
17907 exit(bad_setlocale);
17910 pos = strstr(name, "LC_CTYPE" "=C.UTF-8");
17912 uses_name_value_pair_names = 1;
17914 separator = name[sizeof("LC_CTYPE=C.UTF-8") - 1];
17917 separator = *(pos - 1);
17921 pos = strstr(name, "C.UTF-8");
17925 else if (pos == name) {
17926 separator = name[sizeof("C.UTF-8") - 1];
17929 separator = *(pos - 1);
17937 exit( 0 /* (separator - min_separator) << 3
17938 | uses_name_value_pair_names << 2
17941 | accepts_any_locale_name);
17946 if eval $compile; then
17947 echo "Your system has setlocale()..." >&4
17950 0) echo "and it seems sane" >&4
17951 d_setlocale="$define"
17952 d_setlocale_accepts_any_locale_name="$undef"
17953 d_has_C_UTF8="false"
17955 1) 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="false"
17960 2) echo "and it seems sane" >&4
17961 d_setlocale="$define"
17962 d_setlocale_accepts_any_locale_name="$undef"
17963 d_has_C_UTF8="true"
17965 3) echo "and it seems sane, but accepts any locale name as valid" >&4
17966 d_setlocale="$define"
17967 d_setlocale_accepts_any_locale_name="$define"
17968 d_has_C_UTF8="true"
17970 *) echo "but it doesn't seem to work, so we won't use it." >&4
17971 d_setlocale="$undef"
17972 d_setlocale_accepts_any_locale_name="$undef"
17973 d_has_C_UTF8="false"
17977 echo "your system does not have setlocale()" >&4
17978 d_setlocale="$undef"
17979 d_setlocale_accepts_any_locale_name="$undef"
17980 d_has_C_UTF8="false"
17984 : see if setlocale_r exists
17985 set setlocale_r d_setlocale_r
17987 case "$d_setlocale_r" in
17989 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
17990 case "$d_setlocale_r_proto:$usethreads" in
17991 ":define") d_setlocale_r_proto=define
17992 set d_setlocale_r_proto setlocale_r $hdrs
17996 case "$d_setlocale_r_proto" in
17998 case "$setlocale_r_proto" in
17999 ''|0) try='int setlocale_r(int, const char*, char*, int);'
18000 ./protochk "$extern_C $try" $hdrs && setlocale_r_proto=I_ICBI ;;
18002 case "$setlocale_r_proto" in
18003 ''|0) d_setlocale_r=undef
18004 setlocale_r_proto=0
18005 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
18006 * ) case "$setlocale_r_proto" in
18007 REENTRANT_PROTO*) ;;
18008 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
18010 echo "Prototype: $try" ;;
18013 *) case "$usethreads" in
18014 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
18016 d_setlocale_r=undef
18017 setlocale_r_proto=0
18021 *) setlocale_r_proto=0
18025 : see if setnetent exists
18026 set setnetent d_setnent
18029 : see if setnetent_r exists
18030 set setnetent_r d_setnetent_r
18032 case "$d_setnetent_r" in
18034 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18035 case "$d_setnetent_r_proto:$usethreads" in
18036 ":define") d_setnetent_r_proto=define
18037 set d_setnetent_r_proto setnetent_r $hdrs
18041 case "$d_setnetent_r_proto" in
18043 case "$setnetent_r_proto" in
18044 ''|0) try='int setnetent_r(int, struct netent_data*);'
18045 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=I_ID ;;
18047 case "$setnetent_r_proto" in
18048 ''|0) try='void setnetent_r(int, struct netent_data*);'
18049 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=V_ID ;;
18051 case "$setnetent_r_proto" in
18052 ''|0) d_setnetent_r=undef
18053 setnetent_r_proto=0
18054 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
18055 * ) case "$setnetent_r_proto" in
18056 REENTRANT_PROTO*) ;;
18057 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
18059 echo "Prototype: $try" ;;
18062 *) case "$usethreads" in
18063 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
18065 d_setnetent_r=undef
18066 setnetent_r_proto=0
18070 *) setnetent_r_proto=0
18074 : see if setprotoent exists
18075 set setprotoent d_setpent
18078 : see if setpgid exists
18079 set setpgid d_setpgid
18082 : see if setpgrp2 exists
18083 set setpgrp2 d_setpgrp2
18086 : see if setpriority exists
18087 set setpriority d_setprior
18090 : see if setproctitle exists
18091 set setproctitle d_setproctitle
18094 : see if setprotoent_r exists
18095 set setprotoent_r d_setprotoent_r
18097 case "$d_setprotoent_r" in
18099 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18100 case "$d_setprotoent_r_proto:$usethreads" in
18101 ":define") d_setprotoent_r_proto=define
18102 set d_setprotoent_r_proto setprotoent_r $hdrs
18106 case "$d_setprotoent_r_proto" in
18108 case "$setprotoent_r_proto" in
18109 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
18110 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=I_ID ;;
18112 case "$setprotoent_r_proto" in
18113 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
18114 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=V_ID ;;
18116 case "$setprotoent_r_proto" in
18117 ''|0) d_setprotoent_r=undef
18118 setprotoent_r_proto=0
18119 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
18120 * ) case "$setprotoent_r_proto" in
18121 REENTRANT_PROTO*) ;;
18122 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
18124 echo "Prototype: $try" ;;
18127 *) case "$usethreads" in
18128 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
18130 d_setprotoent_r=undef
18131 setprotoent_r_proto=0
18135 *) setprotoent_r_proto=0
18139 : see if setpwent exists
18140 set setpwent d_setpwent
18143 : see if setpwent_r exists
18144 set setpwent_r d_setpwent_r
18146 case "$d_setpwent_r" in
18148 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
18149 case "$d_setpwent_r_proto:$usethreads" in
18150 ":define") d_setpwent_r_proto=define
18151 set d_setpwent_r_proto setpwent_r $hdrs
18155 case "$d_setpwent_r_proto" in
18157 case "$setpwent_r_proto" in
18158 ''|0) try='int setpwent_r(FILE**);'
18159 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=I_H ;;
18161 case "$setpwent_r_proto" in
18162 ''|0) try='void setpwent_r(FILE**);'
18163 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=V_H ;;
18165 case "$setpwent_r_proto" in
18166 ''|0) d_setpwent_r=undef
18168 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
18169 * ) case "$setpwent_r_proto" in
18170 REENTRANT_PROTO*) ;;
18171 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
18173 echo "Prototype: $try" ;;
18176 *) case "$usethreads" in
18177 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
18184 *) setpwent_r_proto=0
18188 : see if setregid exists
18189 set setregid d_setregid
18191 set setresgid d_setresgid
18194 : see if setreuid exists
18195 set setreuid d_setreuid
18197 set setresuid d_setresuid
18200 : see if setrgid exists
18201 set setrgid d_setrgid
18204 : see if setruid exists
18205 set setruid d_setruid
18208 : see if setservent exists
18209 set setservent d_setsent
18212 : see if setservent_r exists
18213 set setservent_r d_setservent_r
18215 case "$d_setservent_r" in
18217 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18218 case "$d_setservent_r_proto:$usethreads" in
18219 ":define") d_setservent_r_proto=define
18220 set d_setservent_r_proto setservent_r $hdrs
18224 case "$d_setservent_r_proto" in
18226 case "$setservent_r_proto" in
18227 ''|0) try='int setservent_r(int, struct servent_data*);'
18228 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=I_ID ;;
18230 case "$setservent_r_proto" in
18231 ''|0) try='void setservent_r(int, struct servent_data*);'
18232 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=V_ID ;;
18234 case "$setservent_r_proto" in
18235 ''|0) d_setservent_r=undef
18236 setservent_r_proto=0
18237 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
18238 * ) case "$setservent_r_proto" in
18239 REENTRANT_PROTO*) ;;
18240 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
18242 echo "Prototype: $try" ;;
18245 *) case "$usethreads" in
18246 define) echo "setservent_r has no prototype, not using it." >&4 ;;
18248 d_setservent_r=undef
18249 setservent_r_proto=0
18253 *) setservent_r_proto=0
18257 : see if setsid exists
18258 set setsid d_setsid
18261 : see if setvbuf exists
18262 set setvbuf d_setvbuf
18265 : see if shmctl exists
18266 set shmctl d_shmctl
18269 : see if shmget exists
18270 set shmget d_shmget
18273 : see if shmat exists
18276 : see what shmat returns
18279 $cat >shmat.c <<'END'
18280 #include <sys/shm.h>
18283 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
18288 echo "and it returns ($shmattype)." >&4
18289 : see if a prototype for shmat is available
18290 xxx=`./findhdr sys/shm.h`
18291 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
18292 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
18303 set d_shmatprototype
18306 : see if shmdt exists
18310 : see how much of the 'shm*(2)' library is present.
18313 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
18314 *"$undef"*) h_shm=false;;
18318 case "`ipcs 2>&1`" in
18319 "SVID shared memory"*"not configured"*)
18320 echo "Your $osname does not have the shm*(2) configured." >&4
18323 set shmctl d_shmctl
18325 set shmget d_shmget
18335 : we could also check for sys/ipc.h ...
18336 if $h_shm && $test `./findhdr sys/shm.h`; then
18337 echo "You have the full shm*(2) library." >&4
18340 echo "You don't have the full shm*(2) library." >&4
18346 : see if we have sigaction
18348 if set sigaction val -f d_sigaction; eval $csym; $val; then
18349 echo 'sigaction() found.' >&4
18352 #include <sys/types.h>
18353 #include <signal.h>
18354 #$i_stdlib I_STDLIB
18356 #include <stdlib.h>
18360 struct sigaction act, oact;
18362 oact.sa_handler = 0;
18363 /* so that act and oact are used */
18364 exit(act.sa_flags == 0 && oact.sa_handler == 0);
18368 if eval $compile_ok; then
18371 echo "But you don't seem to have a usable struct sigaction." >&4
18375 echo 'sigaction NOT found.' >&4
18378 set d_sigaction; eval $setvar
18381 : see what type pids are declared as in the kernel
18382 rp="What is the type of process ids on this system?"
18383 set pid_t pidtype int stdio.h sys/types.h
18386 : see what type uids are declared as in the kernel
18388 echo "Looking for the type for user ids returned by getuid()."
18389 set uid_t uidtype xxx stdio.h sys/types.h
18393 xxx=`./findhdr sys/user.h`
18394 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
18396 unsigned) dflt="$1 $2" ;;
18400 *) dflt="$uidtype";;
18403 uid_t) echo "uid_t found." ;;
18404 *) rp="What is the type for user ids returned by getuid()?"
18410 : Define hasfield_t macro for Configure internal use
18411 hasfield_t='varname=$1; struct=$2; type=$3; field=$4; shift; shift; shift; shift;
18412 while $test $# -ge 2; do
18414 $define) echo "#include <$2>";;
18418 echo "int main () { $struct foo; $type bar = foo.$field; }" >> try.c;
18420 if eval $compile; then
18429 : see what siginfo fields we have
18430 case "$d_sigaction" in
18432 echo "Checking if your siginfo_t has si_errno field...">&4
18433 set d_siginfo_si_errno siginfo_t int si_errno $d_sigaction signal.h
18436 echo "Checking if your siginfo_t has si_pid field...">&4
18437 set d_siginfo_si_pid siginfo_t $pidtype si_pid $d_sigaction signal.h
18440 echo "Checking if your siginfo_t has si_uid field...">&4
18441 set d_siginfo_si_uid siginfo_t $uidtype si_uid $d_sigaction signal.h
18444 echo "Checking if your siginfo_t has si_addr field...">&4
18445 set d_siginfo_si_addr siginfo_t "void *" si_addr $d_sigaction signal.h
18448 echo "Checking if your siginfo_t has si_status field...">&4
18449 set d_siginfo_si_status siginfo_t int si_status $d_sigaction signal.h
18452 echo "Checking if your siginfo_t has si_band field...">&4
18453 set d_siginfo_si_band siginfo_t long si_band $d_sigaction signal.h
18456 echo "Checking if your siginfo_t has si_value field...">&4
18457 set d_siginfo_si_value siginfo_t "union sigval" si_value $d_sigaction signal.h
18460 echo "Checking if your siginfo_t has si_fd field...">&4
18461 set d_siginfo_si_fd siginfo_t int si_fd $d_sigaction signal.h
18466 d_siginfo_si_errno="$undef"
18467 d_siginfo_si_pid="$undef"
18468 d_siginfo_si_uid="$undef"
18469 d_siginfo_si_addr="$undef"
18470 d_siginfo_si_status="$undef"
18471 d_siginfo_si_band="$undef"
18472 d_siginfo_si_value="$undef"
18473 d_siginfo_si_fd="$undef"
18477 : see if this is a sunmath.h system
18478 set sunmath.h i_sunmath
18481 : see if signbit exists
18482 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
18484 #$i_sunmath I_SUNMATH
18486 #ifdef I_SUNMATH /* Solaris special math library */
18487 # include <sunmath.h>
18490 int main(int argc, char **argv)
18494 if ((signbit(x) == 0) && (signbit(y) != 0))
18502 if eval $compile; then
18503 if $run ./try; then
18507 $echo "Signbit seems to be available, but doesn't work as I expected."
18508 $echo "I won't use it." >&4
18519 : see if sigprocmask exists
18520 set sigprocmask d_sigprocmask
18523 : see if sigsetjmp exists
18525 case "$d_sigsetjmp" in
18528 #include <setjmp.h>
18529 #$i_stdlib I_STDLIB
18531 #include <stdlib.h>
18537 if (sigsetjmp(env,1))
18540 siglongjmp(env, 1);
18545 if eval $compile; then
18546 if $run ./try >/dev/null 2>&1; then
18547 echo "POSIX sigsetjmp found." >&4
18551 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
18557 echo "sigsetjmp not found." >&4
18561 *) val="$d_sigsetjmp"
18562 case "$d_sigsetjmp" in
18563 $define) echo "POSIX sigsetjmp found." >&4;;
18564 $undef) echo "sigsetjmp not found." >&4;;
18572 : see if snprintf exists
18573 set snprintf d_snprintf
18576 : see if vsnprintf exists
18577 set vsnprintf d_vsnprintf
18580 case "$d_snprintf-$d_vsnprintf" in
18583 Checking whether your snprintf() and vsnprintf() work okay...
18585 $cat >try.c <<'EOCP'
18586 /* v?snprintf testing logic courtesy of Russ Allbery.
18587 * According to C99:
18588 * - if the buffer is too short it still must be \0-terminated
18589 * - if the buffer is too short the potentially required length
18590 * must be returned and not -1
18591 * - if the buffer is NULL the potentially required length
18592 * must be returned and not -1 or core dump
18595 #include <stdarg.h>
18599 int test (char *format, ...)
18604 va_start (args, format);
18605 count = vsnprintf (buf, sizeof buf, format, args);
18612 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
18613 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
18617 if eval $compile; then
18620 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
18622 Your snprintf() and snprintf() don't seem to be working okay.
18624 d_snprintf="$undef"
18625 d_vsnprintf="$undef"
18629 echo "(I can't seem to compile the test program--assuming they don't)"
18630 d_snprintf="$undef"
18631 d_vsnprintf="$undef"
18637 : see if sockatmark exists
18638 set sockatmark d_sockatmark
18641 : see if prototype for sockatmark is available
18643 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
18646 : see if socks5_init exists
18647 set socks5_init d_socks5_init
18650 : see if srand48_r exists
18651 set srand48_r d_srand48_r
18653 case "$d_srand48_r" in
18655 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
18656 case "$d_srand48_r_proto:$usethreads" in
18657 ":define") d_srand48_r_proto=define
18658 set d_srand48_r_proto srand48_r $hdrs
18662 case "$d_srand48_r_proto" in
18664 case "$srand48_r_proto" in
18665 ''|0) try='int srand48_r(long, struct drand48_data*);'
18666 ./protochk "$extern_C $try" $hdrs && srand48_r_proto=I_LS ;;
18668 case "$srand48_r_proto" in
18669 ''|0) d_srand48_r=undef
18671 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
18672 * ) case "$srand48_r_proto" in
18673 REENTRANT_PROTO*) ;;
18674 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
18676 echo "Prototype: $try" ;;
18679 *) case "$usethreads" in
18680 define) echo "srand48_r has no prototype, not using it." >&4 ;;
18687 *) srand48_r_proto=0
18691 : see if srandom_r exists
18692 set srandom_r d_srandom_r
18694 case "$d_srandom_r" in
18696 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
18697 case "$d_srandom_r_proto:$usethreads" in
18698 ":define") d_srandom_r_proto=define
18699 set d_srandom_r_proto srandom_r $hdrs
18703 case "$d_srandom_r_proto" in
18705 case "$srandom_r_proto" in
18706 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
18707 ./protochk "$extern_C $try" $hdrs && srandom_r_proto=I_TS ;;
18709 case "$srandom_r_proto" in
18710 ''|0) d_srandom_r=undef
18712 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
18713 * ) case "$srandom_r_proto" in
18714 REENTRANT_PROTO*) ;;
18715 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
18717 echo "Prototype: $try" ;;
18720 *) case "$usethreads" in
18721 define) echo "srandom_r has no prototype, not using it." >&4 ;;
18728 *) srandom_r_proto=0
18732 : see if prototype for setresgid is available
18734 set d_sresgproto setresgid $i_unistd unistd.h
18737 : see if prototype for setresuid is available
18739 set d_sresuproto setresuid $i_unistd unistd.h
18742 : see if stat exists
18746 : see if sys/stat.h is available
18747 set sys/stat.h i_sysstat
18750 : see if stat knows about block sizes
18752 echo "Checking to see if your struct stat has st_blocks field..." >&4
18753 set d_statblks stat st_blocks $i_sysstat sys/stat.h
18756 : see if this is a sys/vfs.h system
18757 set sys/vfs.h i_sysvfs
18760 : see if this is a sys/statfs.h system
18761 set sys/statfs.h i_sysstatfs
18764 : Check for statfs_s
18766 echo "Checking to see if your system supports struct statfs..." >&4
18767 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
18769 case "$d_statfs_s" in
18770 "$define") echo "Yes, it does." ;;
18771 *) echo "No, it doesn't." ;;
18774 : see if struct statfs knows about f_flags
18775 case "$d_statfs_s" in
18778 echo "Checking to see if your struct statfs has f_flags field..." >&4
18779 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
18783 set d_statfs_f_flags
18787 case "$d_statfs_f_flags" in
18788 "$define") echo "Yes, it does." ;;
18789 *) echo "No, it doesn't." ;;
18792 : see what flavor, if any, of static inline is supported
18794 echo "Checking to see if your system supports static inline..."
18795 $cat > try.c <<'EOCP'
18796 #include <stdlib.h>
18797 extern int f_via_a(int x);
18798 extern int f_via_b(int x);
18799 int main(int argc, char **argv)
18808 return EXIT_SUCCESS;
18811 return EXIT_FAILURE;
18815 $cat > a.c <<'EOCP'
18816 static INLINE int f(int x) {
18827 $cat > b.c <<'EOCP'
18828 extern int f(int x);
18836 # Respect a hint (or previous) value for perl_static_inline, if there is one.
18837 case "$perl_static_inline" in
18838 '') # Check the various possibilities, and break out on success.
18839 # For gcc, prefer __inline__, which will still permit
18840 # cflags.SH to add in -ansi.
18841 case "$gccversion" in
18842 '') xxx="inline __inline__ __inline _inline";;
18843 *) xxx="__inline__ inline __inline _inline";;
18845 for inline in $xxx; do
18846 set try -DINLINE=$inline a.c
18847 if eval $compile && $run ./try; then
18848 # Now make sure there is no external linkage of static
18850 set try -DINLINE=$inline -DUSE_B a.c b.c
18851 if eval $compile && $run ./try; then
18852 $echo "Your compiler supports static $inline, " >&4
18853 $echo "but it also creates an external definition," >&4
18854 $echo "so I won't use it." >&4
18857 $echo "Your compiler supports static $inline." >&4
18859 perl_static_inline="static $inline";
18863 $echo "Your compiler does NOT support static $inline." >&4
18868 *inline*) # Some variant of inline exists.
18869 echo "Keeping your $hint value of $perl_static_inline."
18872 static) # No inline capabilities
18873 echo "Keeping your $hint value of $perl_static_inline."
18876 *) # Unrecognized previous value -- blindly trust the supplied
18877 # value and hope it makes sense. Use old value for
18878 # d_static_inline, if there is one.
18879 echo "Keeping your $hint value of $perl_static_inline."
18880 case "$d_static_inline" in
18882 *) val=$d_static_inline ;;
18886 # Fallback to plain 'static' if nothing worked.
18887 case "$perl_static_inline" in
18889 perl_static_inline="static"
18893 set d_static_inline
18895 $rm -f a.[co] b.[co]
18898 : Check stream access
18900 Checking how to access stdio streams by file descriptor number...
18902 case "$stdio_stream_array" in
18903 '') $cat >try.c <<EOCP
18906 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
18910 for s in _iob __iob __sF
18912 set try -DSTDIO_STREAM_ARRAY=$s
18913 if eval $compile; then
18914 case "`$run ./try`" in
18915 yes) stdio_stream_array=$s; break ;;
18921 case "$stdio_stream_array" in
18923 I can't figure out how to access stdio streams by file descriptor number.
18925 d_stdio_stream_array="$undef"
18928 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
18930 d_stdio_stream_array="$define"
18934 : see if strcoll exists
18935 set strcoll d_strcoll
18938 : see if strerror_l exists
18939 set strerror_l d_strerror_l
18942 : see if strerror_r exists
18943 set strerror_r d_strerror_r
18945 case "$d_strerror_r" in
18947 hdrs="$i_systypes sys/types.h define stdio.h define string.h"
18948 case "$d_strerror_r_proto:$usethreads" in
18949 ":define") d_strerror_r_proto=define
18950 set d_strerror_r_proto strerror_r $hdrs
18954 case "$d_strerror_r_proto" in
18956 case "$strerror_r_proto" in
18957 ''|0) try='int strerror_r(int, char*, size_t);'
18958 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBW ;;
18960 case "$strerror_r_proto" in
18961 ''|0) try='int strerror_r(int, char*, int);'
18962 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBI ;;
18964 case "$strerror_r_proto" in
18965 ''|0) try='char* strerror_r(int, char*, size_t);'
18966 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=B_IBW ;;
18968 case "$strerror_r_proto" in
18969 ''|0) d_strerror_r=undef
18971 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
18972 * ) case "$strerror_r_proto" in
18973 REENTRANT_PROTO*) ;;
18974 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
18976 echo "Prototype: $try" ;;
18979 *) case "$usethreads" in
18980 define) echo "strerror_r has no prototype, not using it." >&4 ;;
18987 *) strerror_r_proto=0
18991 : see if strftime exists
18992 set strftime d_strftime
18995 : see if strlcat exists
18996 : We need both a prototype in string.h and the symbol in libc.
18999 xx1="#$d_gnulibc HAS_GNULIBC"
19000 xx2='#if defined(HAS_GNULIBC) && !defined(_GNU_SOURCE)'
19001 xx3='# define _GNU_SOURCE'
19003 set d_strlcat_proto strlcat literal "$xx1" literal "$xx2" literal "$xx3" literal "$xx4" define string.h
19005 case "$d_strlcat_proto" in
19006 define) # see if strlcat exists
19007 set strlcat d_strlcat
19016 : see if strlcpy exists
19017 : We need both a prototype in string.h and the symbol in libc.
19020 xx1="#$d_gnulibc HAS_GNULIBC"
19021 xx2='#if defined(HAS_GNULIBC) && !defined(_GNU_SOURCE)'
19022 xx3='# define _GNU_SOURCE'
19024 set d_strlcpy_proto strlcpy literal "$xx1" literal "$xx2" literal "$xx3" literal "$xx4" define string.h
19026 case "$d_strlcpy_proto" in
19027 define) # see if strlcpy exists
19028 set strlcpy d_strlcpy
19037 : see if strnlen exists
19038 set strnlen d_strnlen
19041 : see if strtod exists
19042 set strtod d_strtod
19045 : see if strtod_l exists
19046 set strtod_l d_strtod_l
19049 : see if strtol exists
19050 set strtol d_strtol
19053 : see if strtold exists
19054 set strtold d_strtold
19057 : see if strtold_l exists
19058 set strtold_l d_strtold_l
19061 : see if strtoll exists
19062 set strtoll d_strtoll
19065 case "$d_longlong-$d_strtoll" in
19068 Checking whether your strtoll() works okay...
19070 $cat >try.c <<'EOCP'
19073 #define strtoll __strtoll
19076 #define strtoll _strtoll
19079 extern long long int strtoll(char *s, char **, int);
19080 static int bad = 0;
19081 int check(char *s, long long ell, int een) {
19084 gll = strtoll(s, 0, 10);
19085 if (!((gll == ell) && (errno == een)))
19089 check(" 1", 1LL, 0);
19090 check(" 0", 0LL, 0);
19091 check("-1", -1LL, 0);
19092 check("-9223372036854775808", -9223372036854775808LL, 0);
19093 check("-9223372036854775808", -9223372036854775808LL, 0);
19094 check(" 9223372036854775807", 9223372036854775807LL, 0);
19095 check("-9223372036854775808", -9223372036854775808LL, 0);
19096 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
19097 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
19103 if eval $compile; then
19106 ok) echo "Your strtoll() seems to be working okay." ;;
19108 Your strtoll() doesn't seem to be working okay.
19114 echo "(I can't seem to compile the test program--assuming it doesn't)"
19120 : see if strtoq exists
19121 set strtoq d_strtoq
19124 : see if strtoul exists
19125 set strtoul d_strtoul
19128 case "$d_strtoul" in
19131 Checking whether your strtoul() works okay...
19133 $cat >try.c <<'EOCP'
19136 extern unsigned long int strtoul(char *s, char **, int);
19137 static int bad = 0;
19138 void check(char *s, unsigned long eul, int een) {
19141 gul = strtoul(s, 0, 10);
19142 if (!((gul == eul) && (errno == een)))
19146 check(" 1", 1L, 0);
19147 check(" 0", 0L, 0);
19149 case "$longsize" in
19151 $cat >>try.c <<'EOCP'
19152 check("18446744073709551615", 18446744073709551615UL, 0);
19153 check("18446744073709551616", 18446744073709551615UL, ERANGE);
19154 #if 0 /* strtoul() for /^-/ strings is undefined. */
19155 check("-1", 18446744073709551615UL, 0);
19156 check("-18446744073709551614", 2, 0);
19157 check("-18446744073709551615", 1, 0);
19158 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
19159 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
19164 $cat >>try.c <<'EOCP'
19165 check("4294967295", 4294967295UL, 0);
19166 check("4294967296", 4294967295UL, ERANGE);
19167 #if 0 /* strtoul() for /^-/ strings is undefined. */
19168 check("-1", 4294967295UL, 0);
19169 check("-4294967294", 2, 0);
19170 check("-4294967295", 1, 0);
19171 check("-4294967296", 4294967295UL, ERANGE);
19172 check("-4294967297", 4294967295UL, ERANGE);
19177 : Should we write these tests to be more portable by sprintf-ing
19178 : ~0 and then manipulating that char string as input for strtol?
19181 $cat >>try.c <<'EOCP'
19188 if eval $compile; then
19189 case "`$run ./try`" in
19190 ok) echo "Your strtoul() seems to be working okay." ;;
19192 Your strtoul() doesn't seem to be working okay.
19198 echo "(I can't seem to compile the test program--assuming it doesn't)"
19204 : see if strtoull exists
19205 set strtoull d_strtoull
19208 case "$d_longlong-$d_strtoull" in
19211 Checking whether your strtoull() works okay...
19213 $cat >try.c <<'EOCP'
19216 #define strtoull __strtoull
19219 extern unsigned long long int strtoull(char *s, char **, int);
19220 static int bad = 0;
19221 int check(char *s, long long eull, int een) {
19224 gull = strtoull(s, 0, 10);
19225 if (!((gull == eull) && (errno == een)))
19229 check(" 1", 1LL, 0);
19230 check(" 0", 0LL, 0);
19231 check("18446744073709551615", 18446744073709551615ULL, 0);
19232 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
19233 #if 0 /* strtoull() for /^-/ strings is undefined. */
19234 check("-1", 18446744073709551615ULL, 0);
19235 check("-18446744073709551614", 2LL, 0);
19236 check("-18446744073709551615", 1LL, 0);
19237 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
19238 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
19245 if eval $compile; then
19246 case "`$run ./try`" in
19247 ok) echo "Your strtoull() seems to be working okay." ;;
19249 Your strtoull() doesn't seem to be working okay.
19251 d_strtoull="$undef"
19255 echo "(I can't seem to compile the test program--assuming it doesn't)"
19256 d_strtoull="$undef"
19261 : see if strtouq exists
19262 set strtouq d_strtouq
19265 case "$d_strtouq" in
19268 Checking whether your strtouq() works okay...
19270 $cat >try.c <<'EOCP'
19273 extern unsigned long long int strtouq(char *s, char **, int);
19274 static int bad = 0;
19275 void check(char *s, unsigned long long eull, int een) {
19276 unsigned long long gull;
19278 gull = strtouq(s, 0, 10);
19279 if (!((gull == eull) && (errno == een)))
19283 check(" 1", 1LL, 0);
19284 check(" 0", 0LL, 0);
19285 check("18446744073709551615", 18446744073709551615ULL, 0);
19286 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
19287 #if 0 /* strtouq() for /^-/ strings is undefined. */
19288 check("-1", 18446744073709551615ULL, 0);
19289 check("-18446744073709551614", 2LL, 0);
19290 check("-18446744073709551615", 1LL, 0);
19291 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
19292 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
19300 if eval $compile; then
19301 case "`$run ./try`" in
19302 ok) echo "Your strtouq() seems to be working okay." ;;
19304 Your strtouq() doesn't seem to be working okay.
19310 echo "(I can't seem to compile the test program--assuming it doesn't)"
19316 : see if strxfrm exists
19317 set strxfrm d_strxfrm
19320 : see if symlink exists
19321 set symlink d_symlink
19324 : see if syscall exists
19325 set syscall d_syscall
19328 : see if prototype for syscall is available
19330 set d_syscallproto syscall $i_unistd unistd.h
19333 : see if sysconf exists
19334 set sysconf d_sysconf
19337 : see if sys_errlist[] exists
19339 if test "X$d_syserrlst" = X; then
19340 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
19341 echo "You have sys_errlist[], so we could roll our own strerror."
19342 d_syserrlst="$define"
19344 echo "You don't have sys_errlist[], so strerror() is welcome."
19345 d_syserrlst="$undef"
19349 : see if system exists
19350 set system d_system
19353 : see if tcgetpgrp exists
19354 set tcgetpgrp d_tcgetpgrp
19357 : see if tcsetpgrp exists
19358 set tcsetpgrp d_tcsetpgrp
19361 : see if prototype for telldir is available
19363 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
19366 : see if tgamma exists
19367 set tgamma d_tgamma
19370 : check for thread_safe_nl_langinfo_l item
19373 Checking to see if you have nl_langinfo_l() and that it is thread-safe
19376 #$i_stdlib I_STDLIB
19378 # include <stdlib.h>
19380 #include <string.h>
19381 #$i_langinfo I_LANGINFO
19383 # include <langinfo.h>
19385 #$i_pthread I_PTHREAD
19387 # include <pthread.h>
19389 #$i_locale I_LOCALE
19391 # include <locale.h>
19395 thread_start(void * arg)
19397 nl_langinfo(RADIXCHAR);
19401 char * main_buffer;
19402 char save_main_buffer[1000];
19403 pthread_t subthread;
19404 pthread_attr_t attr;
19406 main_buffer = nl_langinfo_l(CODESET, newlocale(LC_ALL_MASK, "C", 0));
19408 /* If too large for our generous allowance, just assume we don't have
19410 if (strlen(main_buffer) >= sizeof(save_main_buffer)) {
19414 strcpy(save_main_buffer, main_buffer);
19416 if (pthread_attr_init(&attr) != 0) {
19420 if (pthread_create(&subthread, &attr, thread_start, NULL) != 0) {
19424 if (pthread_join(subthread, NULL) != 0) {
19428 exit(! (strcmp(main_buffer, save_main_buffer) == 0));
19431 case "$usethreads" in
19434 if eval $compile; then
19435 echo "Your system has nl_langinfo_l()..." >&4
19436 if $run ./try; then
19437 echo "and it is thread-safe (just as I'd hoped)." >&4
19438 d_thread_safe_nl_langinfo_l="$define"
19439 echo "$d_thread_safe_nl_langinfo_l" >&4
19441 echo "but it isn't thread-safe, so we won't use it." >&4
19444 echo "your system does not have nl_langinfo_l()" >&4
19447 *) echo "Since threads aren't selected, we won't bother looking for nl_langinfo_l()" >&4
19449 if test X"$d_thread_safe_nl_langinfo_l" = X; then
19450 d_thread_safe_nl_langinfo_l="$undef"
19454 : see if time exists
19456 if test "X$d_time" = X -o X"$timetype" = X; then
19457 if set time val -f d_time; eval $csym; $val; then
19458 echo 'time() found.' >&4
19460 rp="What is the type returned by time() on this system?"
19461 set time_t timetype long stdio.h sys/types.h
19464 echo 'time() not found, hope that will do.' >&4
19472 : see if timegm exists
19473 set timegm d_timegm
19476 : see if this is a sys/times.h system
19477 set sys/times.h i_systimes
19480 : see if times exists
19482 if set times val -f d_times; eval $csym; $val; then
19483 echo 'times() found.' >&4
19486 case "$i_systimes" in
19487 "$define") inc='sys/times.h';;
19489 rp="What is the type returned by times() on this system?"
19490 set clock_t clocktype long stdio.h sys/types.h $inc
19493 echo 'times() NOT found, hope that will do.' >&4
19498 : see if tmpnam_r exists
19499 set tmpnam_r d_tmpnam_r
19501 case "$d_tmpnam_r" in
19503 hdrs="$i_systypes sys/types.h define stdio.h "
19504 case "$d_tmpnam_r_proto:$usethreads" in
19505 ":define") d_tmpnam_r_proto=define
19506 set d_tmpnam_r_proto tmpnam_r $hdrs
19510 case "$d_tmpnam_r_proto" in
19512 case "$tmpnam_r_proto" in
19513 ''|0) try='char* tmpnam_r(char*);'
19514 ./protochk "$extern_C $try" $hdrs && tmpnam_r_proto=B_B ;;
19516 case "$tmpnam_r_proto" in
19517 ''|0) d_tmpnam_r=undef
19519 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
19520 * ) case "$tmpnam_r_proto" in
19521 REENTRANT_PROTO*) ;;
19522 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
19524 echo "Prototype: $try" ;;
19527 *) case "$usethreads" in
19528 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
19535 *) tmpnam_r_proto=0
19539 : see if towlower exists
19540 set towlower d_towlower
19543 : see if trunc exists
19547 : see if truncate exists
19548 set truncate d_truncate
19551 : see if ttyname_r exists
19552 set ttyname_r d_ttyname_r
19554 case "$d_ttyname_r" in
19556 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
19557 case "$d_ttyname_r_proto:$usethreads" in
19558 ":define") d_ttyname_r_proto=define
19559 set d_ttyname_r_proto ttyname_r $hdrs
19563 case "$d_ttyname_r_proto" in
19565 case "$ttyname_r_proto" in
19566 ''|0) try='int ttyname_r(int, char*, size_t);'
19567 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBW ;;
19569 case "$ttyname_r_proto" in
19570 ''|0) try='int ttyname_r(int, char*, int);'
19571 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBI ;;
19573 case "$ttyname_r_proto" in
19574 ''|0) try='char* ttyname_r(int, char*, int);'
19575 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=B_IBI ;;
19577 case "$ttyname_r_proto" in
19578 ''|0) d_ttyname_r=undef
19580 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
19581 * ) case "$ttyname_r_proto" in
19582 REENTRANT_PROTO*) ;;
19583 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
19585 echo "Prototype: $try" ;;
19588 *) case "$usethreads" in
19589 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
19596 *) ttyname_r_proto=0
19600 : see if tzname[] exists
19602 if set tzname val -a d_tzname; eval $csym; $val; then
19604 echo 'tzname[] found.' >&4
19607 echo 'tzname[] NOT found.' >&4
19612 : Check if is a multiplatform env
19614 darwin) multiarch="$define" ;;
19616 case "$multiarch" in
19617 ''|[nN]*) multiarch="$undef" ;;
19620 : check for ordering of bytes in a UV
19622 case "$multiarch" in
19625 You seem to be doing a multiarchitecture build,
19626 skipping the byteorder check.
19632 case "$byteorder" in
19635 In the following, larger digits indicate more significance. A big-endian
19636 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
19637 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
19638 machines may have weird orders like 3412. A Cray will report 87654321,
19639 an Alpha will report 12345678. If the test program works the default is
19641 I'm now running the test program...
19645 #$i_stdlib I_STDLIB
19647 #include <stdlib.h>
19649 #include <sys/types.h>
19650 typedef $uvtype UV;
19660 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
19662 u.l = (UV)0x04030201;
19663 for (i = 0; i < $uvsize; i++)
19664 printf("%c", u.c[i]+'0');
19671 if eval $compile && $run ./try > /dev/null; then
19674 [1-4][1-4][1-4][1-4]|12345678|87654321)
19675 echo "(The test program ran ok.)"
19676 echo "byteorder=$dflt"
19679 ????|????????) echo "(The test program ran ok.)" ;;
19680 *) echo "(The test program didn't run right for some reason.)" ;;
19685 (I can't seem to compile the test program. Guessing big-endian...)
19688 case "$xxx_prompt" in
19690 rp="What is the order of bytes in $uvtype?"
19703 : Checking 32bit alignedness
19706 Checking to see whether you can access character data unalignedly...
19708 case "$d_u32align" in
19709 '') $cat >try.c <<EOCP
19711 #$i_stdlib I_STDLIB
19713 #include <stdlib.h>
19715 #define U32 $u32type
19716 #define BYTEORDER 0x$byteorder
19718 #include <signal.h>
19720 $signal_t bletch(int s) { exit(4); }
19723 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
19724 volatile U8 buf[8];
19728 if (sizeof(U32) != 4) {
19729 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
19736 signal(SIGBUS, bletch);
19748 for (i = 0; i < 4; i++) {
19749 up = (U32*)(buf + i);
19750 if (! ((*up == 1 << (8*i)) || /* big-endian */
19751 (*up == 1 << (8*(3-i))) /* little-endian */
19755 printf("read failed (%x)\n", *up);
19761 for (i = 0; i < 4; i++) {
19762 up = (U32*)(buf + i);
19764 if (*up != 0xBeef) {
19765 printf("write failed (%x)\n", *up);
19779 if eval $compile_ok; then
19780 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
19781 $run ./try 2>&1 >/dev/null
19784 You can access character data pretty unalignedly.
19786 d_u32align="$undef"
19789 It seems that you must access character data in an aligned manner.
19791 d_u32align="$define"
19795 rp='Can you access character data at unaligned addresses?'
19799 [yY]*) d_u32align="$undef" ;;
19800 *) d_u32align="$define" ;;
19807 : see if ualarm exists
19808 set ualarm d_ualarm
19811 : see if umask exists
19815 : see if unordered exists
19816 set unordered d_unordered
19819 : see if unsetenv exists
19820 set unsetenv d_unsetenv
19823 : see if usleep exists
19824 set usleep d_usleep
19827 : see if prototype for usleep is available
19829 set d_usleepproto usleep $i_unistd unistd.h
19832 : see if ustat exists
19836 : see if closedir exists
19837 set closedir d_closedir
19840 case "$d_closedir" in
19843 echo "Checking whether closedir() returns a status..." >&4
19845 #$i_dirent I_DIRENT /**/
19846 #$i_sysdir I_SYS_DIR /**/
19847 #$i_sysndir I_SYS_NDIR /**/
19848 #$i_systypes I_SYS_TYPES /**/
19850 #if defined(I_SYS_TYPES)
19851 #include <sys/types.h>
19853 #if defined(I_DIRENT)
19854 #include <dirent.h>
19857 #include <sys/ndir.h>
19860 #include <sys/dir.h>
19864 int main() { return closedir(opendir(".")); }
19867 if eval $compile_ok; then
19868 if $run ./try > /dev/null 2>&1 ; then
19869 echo "Yes, it does."
19872 echo "No, it doesn't."
19876 echo "(I can't seem to compile the test program--assuming it doesn't)"
19884 set d_void_closedir
19888 : see if there is a wait4
19892 : see if waitpid exists
19893 set waitpid d_waitpid
19898 $cat >try.c <<'EOCP'
19904 return (wcscmp (s, s) ? 1 : 0);
19909 if eval $compile; then
19912 0) echo "A working wcscmp() found." >&4
19914 *) echo "wcscmp() found, but it doesn't work" >&4
19918 echo "wcscmp() NOT found." >&4
19924 : see if wcstombs exists
19925 set wcstombs d_wcstombs
19930 $cat >try.c <<'EOCP'
19935 wchar_t dst[4], *src = L" ";
19937 return (wcsxfrm (dst, src, 1) ? errno ? errno : 0 : 1);
19942 if eval $compile; then
19945 0) echo "A working wcsxfrm() found." >&4
19947 *) echo "wcsxfrm() found, but it doesn't work" >&4
19951 echo "wcsxfrm() NOT found." >&4
19957 : see if wctomb exists
19958 set wctomb d_wctomb
19961 : see if writev exists
19962 set writev d_writev
19965 : check for alignment requirements
19967 case "$alignbytes" in
19968 '') echo "Checking alignment constraints..." >&4
19977 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
19982 if eval $compile_ok; then
19986 echo "(I can't seem to compile the test program...)"
19988 case "$multiarch" in
19990 : The usual safe value is 8, but Darwin with -Duselongdouble
19991 : needs 16. Hence, we will take 8 as a minimum, but allow
19992 : Configure to pick a larger value if needed.
19993 if $test "$dflt" -lt 8; then
19995 echo "Setting alignment to 8 for multiarch support.">&4
20000 *) dflt="$alignbytes"
20003 rp="Doubles must be aligned on a how-many-byte boundary?"
20008 : set the base revision
20011 : length of character in bytes. Is always 1, otherwise it is not C
20012 : This used to be a test using sizeof
20015 : Check for the number of bits in a character
20016 case "$charbits" in
20017 '') echo "Checking how long a character is (in bits)..." >&4
20024 for (c = 1, n = 0; c; c <<= 1, n++) ;
20025 printf ("%d\n", n);
20030 if eval $compile_ok; then
20034 echo "(I can't seem to compile the test program. Guessing...)"
20041 rp="What is the length of a character (in bits)?"
20045 case "$charbits" in
20048 Your system has an unsigned character size of $charbits bits, which
20049 is rather unusual (normally it is 8 bits). Perl likely will not work
20050 correctly on your system, with subtle bugs in various places.
20052 rp='Do you really want to continue?'
20056 [yY]) echo >&4 "Okay, continuing." ;;
20061 : how do we concatenate cpp tokens here?
20063 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
20064 $cat >cpp_stuff.c <<'EOCP'
20065 #define RCAT(a,b)a/**/b
20066 #define ACAT(a,b)a ## b
20070 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
20071 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
20072 echo "Oh! Smells like ANSI's been here." >&4
20073 echo "We can catify or stringify, separately or together!"
20075 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
20076 echo "Ah, yes! The good old days!" >&4
20077 echo "However, in the good old days we don't know how to stringify and"
20078 echo "catify at the same time."
20082 Hmm, I don't seem to be able to concatenate tokens with your cpp.
20083 You're going to have to edit the values of CAT[2-5] in config.h...
20085 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
20089 : see if this is a db.h system
20095 : Check db version.
20097 echo "Checking Berkeley DB version ..." >&4
20099 #include <sys/types.h>
20101 #$i_stdlib I_STDLIB
20103 #include <stdlib.h>
20106 int main(int argc, char *argv[])
20108 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
20109 int Major, Minor, Patch ;
20110 unsigned long Version ;
20111 (void)db_version(&Major, &Minor, &Patch) ;
20113 printf("%d %d %d %d %d %d\n",
20114 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
20115 Major, Minor, Patch);
20118 printf("You have Berkeley DB Version 2 or greater.\n");
20120 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
20121 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
20122 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
20123 Major, Minor, Patch) ;
20125 /* check that db.h & libdb are compatible */
20126 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
20127 printf("db.h and libdb are incompatible.\n") ;
20131 printf("db.h and libdb are compatible.\n") ;
20133 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
20134 + DB_VERSION_PATCH ;
20136 /* needs to be >= 2.3.4 */
20137 if (Version < 2003004) {
20138 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
20139 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
20145 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
20150 printf("You have Berkeley DB Version 1.\n");
20151 exit(0); /* DB version < 2: the coast is clear. */
20153 exit(1); /* <db.h> not Berkeley DB? */
20159 if eval $compile_ok && $run ./try; then
20160 echo 'Looks OK.' >&4
20162 db_version_major=$1
20163 db_version_minor=$2
20164 db_version_patch=$3
20166 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
20170 : Remove db from list of libraries to use
20171 echo "Removing unusable -ldb from library list" >&4
20172 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
20175 echo "libs = $libs" >&4
20185 : Check the return type needed for hash
20187 echo "Checking return type needed for hash for Berkeley DB ..." >&4
20189 #include <sys/types.h>
20192 #ifndef DB_VERSION_MAJOR
20193 u_int32_t hash_cb (const void* ptr, size_t size)
20200 info.hash = hash_cb;
20204 if $cc $ccflags -c try.c >try.out 2>&1 ; then
20205 if $contains warning try.out >>/dev/null 2>&1 ; then
20208 db_hashtype='u_int32_t'
20211 : XXX Maybe we should just give up here.
20212 db_hashtype=u_int32_t
20214 echo "Help: I can't seem to compile the db test program." >&4
20215 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
20218 echo "Your version of Berkeley DB uses $db_hashtype for hash."
20220 *) db_hashtype=u_int32_t
20225 : Check the return type needed for prefix
20227 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
20229 #include <sys/types.h>
20232 #ifndef DB_VERSION_MAJOR
20233 size_t prefix_cb (const DBT *key1, const DBT *key2)
20240 info.prefix = prefix_cb;
20244 if $cc $ccflags -c try.c >try.out 2>&1 ; then
20245 if $contains warning try.out >>/dev/null 2>&1 ; then
20246 db_prefixtype='int'
20248 db_prefixtype='size_t'
20251 db_prefixtype='size_t'
20252 : XXX Maybe we should just give up here.
20254 echo "Help: I can't seem to compile the db test program." >&4
20255 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
20258 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
20260 *) db_prefixtype='size_t'
20264 : Include . in @INC
20267 Historically Perl has provided a final fallback of the current working
20268 directory '.' when searching for a library. This, however, can lead to
20269 problems when a Perl program which loads optional modules is called from
20270 a shared directory. This can lead to executing unexpected code.
20274 # When changing to exclude by default:
20275 case "$default_inc_excludes_dot" in
20276 $undef|false|[nN]*) dflt="n" ;;
20279 # To turn exclude off by default:
20280 #case "$default_inc_excludes_dot" in
20281 # $define|true|[yY]*) dflt="y" ;;
20285 rp='Exclude '.' from @INC by default? '
20288 [nN]|undef) default_inc_excludes_dot="$undef" ;;
20289 *) default_inc_excludes_dot="$define" ;;
20292 : Check what kind of inf/nan your system has
20293 $echo "Checking the kind of infinities and nans you have..." >&4
20294 $echo "(The following tests may crash. That's okay.)" >&4
20296 #define DOUBLESIZE $doublesize
20297 #$d_longdbl HAS_LONG_DOUBLE
20298 #ifdef HAS_LONG_DOUBLE
20299 #define LONG_DOUBLESIZE $longdblsize
20300 #define LONG_DOUBLEKIND $longdblkind
20303 #include <string.h>
20305 /* Note that whether the sign bit is on or off
20306 * for NaN depends on the CPU/FPU, and possibly
20307 * can be affected by the build toolchain.
20309 * For example for older MIPS and HP-PA 2.0 the quiet NaN is:
20310 * 0x7f, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
20311 * 0x7f, 0xf4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
20312 * (respectively) as opposed to the more usual
20313 * 0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
20315 * Pre-IEEE-754 floating point format do not even have inf/nan support
20316 * at all. They might have a "max" value (DBL_MAX), which may be deadly
20317 * to even mention, causing immediate SIGFPE or equivalent: this is
20318 * the case with VAX floating point, for example.
20320 static void bytes(void *v, unsigned int n) {
20321 unsigned char *p = (unsigned char *)v;
20323 for (i = 0; i < n; i++) {
20324 printf("0x%02x%s", p[i], i < n - 1 ? ", " : "\n");
20327 int main(int argc, char *argv[]) {
20328 /* We cannot use 1.0/0.0 and 0.0/0.0 (with L suffixes for long double)
20329 * because some compilers are 'smart' and not only warn but refuse to
20330 * compile such 'illegal' values. */
20331 double dinf = exp(1e9);
20332 double dnan = sqrt(-1.0);
20333 #ifdef HAS_LONG_DOUBLE
20334 long double ldinf = (long double)exp(1e9);
20335 long double ldnan = (long double)sqrt(-1.0);
20336 # if LONG_DOUBLEKIND == 3 || LONG_DOUBLEKIND == 4
20337 /* the 80-bit long doubles might have garbage in their excess bytes */
20338 memset((char *)&ldinf + 10, '\0', LONG_DOUBLESIZE - 10);
20339 memset((char *)&ldnan + 10, '\0', LONG_DOUBLESIZE - 10);
20342 switch (argv[1][0]) {
20343 case '1': bytes(&dinf, sizeof(dinf)); break;
20344 case '2': bytes(&dnan, sizeof(dnan)); break;
20345 case '3': bytes(&ldinf, sizeof(ldinf)); break;
20346 case '4': bytes(&ldnan, sizeof(ldnan)); break;
20354 if eval $compile; then
20355 doubleinfbytes=`$run ./try 1`
20356 doublenanbytes=`$run ./try 2`
20357 case "$d_longdbl" in
20359 longdblinfbytes=`$run ./try 3`
20360 longdblnanbytes=`$run ./try 4`
20364 # Defaults in case the above test program failed.
20365 case "$doublekind" in
20366 1) # IEEE 754 32-bit LE
20367 doubleinfbytes='0x00, 0x00, 0xf0, 0x7f'
20368 doublenanbytes='0x00, 0x00, 0xf8, 0x7f'
20370 2) # IEEE 754 32-bit BE
20371 doubleinfbytes='0x7f, 0xf0, 0x00, 0x00'
20372 doublenanbytes='0x7f, 0xf8, 0x00, 0x00'
20374 3) # IEEE 754 64-bit LE
20375 doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
20376 doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
20378 4) # IEEE 754 64-bit BE
20379 doubleinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20380 doublenanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20382 5) # IEEE 754 128-bit LE
20383 doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
20384 doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
20386 6) # IEEE 754 128-bit BE
20387 doubleinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20388 doublenanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20390 7) # IEEE 754 64-bit mixed: 32-bit LEs in BE
20391 doubleinfbytes='0x00, 0x00, 0xf0, 0x7f, 0x00, 0x00, 0x00, 0x00'
20392 doublenanbytes='0x00, 0x00, 0xf8, 0x7f, 0x00, 0x00, 0x00, 0x00'
20394 8) # IEEE 754 64-bit mixed: 32-bit BEs in LE
20395 doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x7f, 0xf0, 0x00, 0x00'
20396 doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x7f, 0xf8, 0x00, 0x00'
20398 9|10|11|12|13|14) # VAX/Cray/IBM floating point formats, no inf/nan.
20399 doubleinfbytes=$undef
20400 doublenanbytes=$undef
20403 doubleinfbytes=$undef
20404 doublenanbytes=$undef
20407 case "$longdblkind" in
20408 1) # IEEE 754 128-bit LE
20409 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f'
20410 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f'
20412 2) # IEEE 754 128-bit BE
20413 longdblinfbytes='0x7f, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20414 longdblnanbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20416 3) # IEEE 754 80-bit LE, 12 or 16 bytes (x86)
20417 case "$longdblsize" in
20418 12) # x86 32-bit (96 bits, or 4 x 32, or 12 x 8)
20419 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00'
20420 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x7f, 0x00, 0x00'
20423 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20424 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20427 longdblinfbytes=$undef
20428 longdblnanbytes=$undef
20432 4) # IEEE 754 80-bit BE, 12 or 16 bytes
20433 case "$longdblsize" in
20434 12) # 32-bit system
20435 longdblinfbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20436 longdblnanbytes='0x7f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20438 16) # 64-bit system
20439 longdblinfbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20440 longdblnanbytes='0x7f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20443 longdblinfbytes=$undef
20444 longdblnanbytes=$undef
20448 5) # 128-bit LE-LE "double double"
20449 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
20450 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
20452 6) # 128-bit BE-BE "double double"
20453 longdblinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20454 longdblnanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20456 7) # 128-bit LE-BE "double double"
20457 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20458 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20460 8) # 128-bit BE-LE "double double"
20461 longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20462 longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
20464 9|10|11|12|13|14) # VAX/Cray/IBM floating point formats, no inf/nan.
20465 longdblinfbytes=$undef
20466 longdblnanbytes=$undef
20469 longdblinfbytes=$undef
20470 longdblnanbytes=$undef
20474 # In case the program crashed the values are empty, turn them undef.
20475 case "$doubleinfbytes" in
20476 '') doubleinfbytes=$undef ;;
20478 case "$doublenanbytes" in
20479 '') doublenanbytes=$undef ;;
20481 case "$longdblinfbytes" in
20482 '') longdblinfbytes=$undef ;;
20484 case "$longdblnanbytes" in
20485 '') longdblnanbytes=$undef ;;
20489 : Check the length of the double mantissa
20490 $echo "Checking how many mantissa bits your doubles have..." >&4
20492 #$i_sunmath I_SUNMATH
20495 # include <sunmath.h>
20497 #ifdef DBL_MANT_DIG
20498 # define BITS (DBL_MANT_DIG - 1) /* the implicit bit does not count */
20501 int main(int argc, char *argv[]) {
20503 printf("%d\n", BITS);
20509 if eval $compile; then
20510 doublemantbits=`$run ./try`
20512 doublemantbits="$undef"
20516 : Check the length of the longdouble mantissa
20517 $echo "Checking how many mantissa bits your long doubles have..." >&4
20519 #$i_sunmath I_SUNMATH
20522 # include <sunmath.h>
20524 #$d_longdbl HAS_LONG_DOUBLE
20525 #if defined(HAS_LONG_DOUBLE) && defined(LDBL_MANT_DIG)
20526 # if ($longdblkind == 3) || ($longdblkind == 4) /* 80-bit extended precision */
20527 /* This format has no implicit bit. Beware, however, that for
20528 * this format the bare LDBL_MANT_DIG is misleading for inf/nan:
20529 * the top three bits are used for inf (100) / qnan (11x) / snan (101),
20530 * and the top bit must have been one since 387, zero is plain invalid.
20531 * For normal fp values, the LDBL_MANT_DIG is fine, though. */
20532 # define BITS LDBL_MANT_DIG
20533 # elif ($longdblkind == 5 || $longdblkind == 6 || $longdblkind == 7 || $longdblkind == 8) /* double double */
20534 /* LDBL_MANT_DIG of 106 (twice 53) would be logical, but for some
20535 * reason e.g. Irix thinks 107. But in any case, we want only
20536 * the number of real bits, the implicit bits are of no interest. */
20537 # define BITS 2 * (DBL_MANT_DIG - 1)
20539 # define BITS (LDBL_MANT_DIG - 1) /* the implicit bit does not count */
20543 int main(int argc, char *argv[]) {
20545 printf("%d\n", BITS);
20551 if eval $compile; then
20552 longdblmantbits=`$run ./try`
20554 longdblmantbits="$undef"
20558 : Check the length of the NV mantissa
20559 $echo "Checking how many mantissa bits your NVs have..." >&4
20560 if test "X$usequadmath" = "X$define"; then
20561 nvmantbits=112 # 128-1-15
20563 if test "X$nvsize" = "X$doublesize"; then
20564 nvmantbits="$doublemantbits"
20566 if test "X$nvsize" = "X$longdblsize"; then
20567 nvmantbits="$longdblmantbits"
20569 nvmantbits="$undef"
20574 : How can we generate normalized random numbers ?
20576 echo "Using our internal random number implementation..." >&4
20579 *-Dmy_rand=*|*-Dmy_srand=*)
20580 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
20581 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
20582 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
20583 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
20587 randfunc=Perl_drand48
20588 drand01="Perl_drand48()"
20589 seedfunc="Perl_drand48_init"
20593 : Probe whether dtrace builds an object, as newer Illumos requires an input
20594 : object file that uses at least one of the probes defined in the .d file
20595 case "$usedtrace" in
20597 case "$dtracexnolibs" in
20598 $define|true|[yY]*)
20599 dtracexnolibs=$define
20600 $dtrace -h -xnolibs -s ../perldtrace.d -o perldtrace.h
20603 if $dtrace -h -xnolibs -s ../perldtrace.d -o perldtrace.h 2>&1 ; then
20604 dtracexnolibs=$define
20605 echo "Your dtrace accepts -xnolibs"
20606 elif $dtrace -h -s ../perldtrace.d -o perldtrace.h 2>&1 ; then
20607 dtracexnolibs=$undef
20608 echo "Your dtrace doesn't accept -xnolibs"
20610 echo "Your dtrace doesn't work at all, try building without dtrace support" >&4
20615 dtracexnolibs=$undef
20616 $dtrace -h -s ../perldtrace.d -o perldtrace.h
20619 case $dtracexnolibs in
20620 $define) xnolibs=-xnolibs ;;
20624 case "$dtraceobject" in
20625 $define|true|[yY]*)
20626 dtraceobject=$define
20630 #include "perldtrace.h"
20632 PERL_LOADED_FILE("dummy");
20636 dtraceobject=$undef
20637 if $cc -c -o try.o $optimize $ccflags try.c \
20638 && $dtrace -G $xnolibs -s ../perldtrace.d try.o >/dev/null 2>&1; then
20639 dtraceobject=$define
20640 echo "Your dtrace builds an object file"
20643 *) dtraceobject=$undef ;;
20645 $rm_try perldtrace.o perldtrace.h
20648 : Determine if this is an EBCDIC system
20650 echo "Determining whether or not we are on an EBCDIC system..." >&4
20651 $cat >try.c <<'EOM'
20654 if ('M'==0xd4) return 0;
20661 if eval $compile_ok; then
20662 if $run ./try; then
20663 echo "You seem to speak EBCDIC." >&4
20666 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
20669 echo "I'm unable to compile the test program." >&4
20670 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
20676 : Check how to flush
20679 Checking how to flush all pending stdio output...
20681 # I only know how to find the first 32 possibly open files on SunOS.
20682 # See also hints/sunos_4_1.sh and util.c --AD
20684 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
20686 $cat >>try.c <<EOCP
20688 #$i_stdlib I_STDLIB
20690 #include <stdlib.h>
20692 #$i_unistd I_UNISTD
20694 # include <unistd.h>
20696 #$d_sysconf HAS_SYSCONF
20697 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
20698 #ifdef HAS_STDIO_STREAM_ARRAY
20699 # define STDIO_STREAM_ARRAY $stdio_stream_array
20704 p = fopen("try.out", "w");
20708 # ifdef TRY_FPRINTF
20712 #ifdef TRY_FFLUSH_NULL
20715 #ifdef TRY_FFLUSH_ALL
20717 long open_max = -1;
20718 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
20719 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
20721 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
20722 open_max = sysconf(_SC_OPEN_MAX);
20725 open_max = FOPEN_MAX;
20728 open_max = OPEN_MAX;
20737 # ifdef HAS_STDIO_STREAM_ARRAY
20738 if (open_max > 0) {
20740 for (i = 0; i < open_max; i++)
20741 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
20742 STDIO_STREAM_ARRAY[i]._file < open_max &&
20743 STDIO_STREAM_ARRAY[i]._flag)
20744 fflush(&STDIO_STREAM_ARRAY[i]);
20752 : first we have to find out how _not_ to flush
20754 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
20756 set try -DTRY_FPUTC
20757 if eval $compile; then
20758 $run ./try 2>/dev/null
20761 if $test ! -s try.out -a "X$code" = X42; then
20767 set try -DTRY_FPRINTF
20768 if eval $compile; then
20769 $run ./try 2>/dev/null
20772 if $test ! -s try.out -a "X$code" = X42; then
20773 output=-DTRY_FPRINTF
20779 : check for fflush NULL behavior
20780 case "$fflushNULL" in
20781 '') set try -DTRY_FFLUSH_NULL $output
20782 if eval $compile; then
20783 $run ./try 2>/dev/null
20786 if $test -s try.out -a "X$code" = X42; then
20787 fflushNULL="`$cat try.out`"
20789 if $test "X$code" != X42; then
20791 (If this test failed, don't worry, we'll try another method shortly.)
20796 $rm -f core try.core core.try.*
20797 case "$fflushNULL" in
20799 Your fflush(NULL) works okay for output streams.
20800 Let's see if it clobbers input pipes...
20802 # As of mid-March 2000 all versions of Solaris appear to have a stdio
20803 # bug that improperly flushes the input end of pipes. So we avoid the
20804 # autoflush on fork/system/exec support for now. :-(
20805 $cat >tryp.c <<EOCP
20808 main(int argc, char **argv)
20814 while ((i = getc(stdin)) != -1
20815 && (*bp++ = i) != '\n'
20816 && bp < &buf[1024])
20819 fprintf(stdout, "%s", buf);
20827 fflushNULL="$define"
20829 if eval $compile; then
20831 # Copy the .c file to the remote host ($to is an ssh-alike if targethost is set)
20832 if $test "X$targethost" != X; then
20835 $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
20837 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
20839 if cmp tryp.c tryp.out >/dev/null 2>&1; then
20841 fflush(NULL) seems to behave okay with input streams.
20843 fflushNULL="$define"
20846 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
20848 fflushNULL="$undef"
20851 $rm -f core tryp.c tryp.core core.tryp.*
20854 Your fflush(NULL) isn't working (contrary to ANSI C).
20856 fflushNULL="$undef"
20859 Cannot figure out whether your fflush(NULL) works or not.
20860 I'm assuming it doesn't (contrary to ANSI C).
20862 fflushNULL="$undef"
20866 $define|true|[yY]*)
20867 fflushNULL="$define"
20870 fflushNULL="$undef"
20873 : check explicit looping only if NULL did not work, and if the pipe
20874 : bug does not show up on an explicit flush too
20875 case "$fflushNULL" in
20877 $cat >tryp.c <<EOCP
20880 main(int argc, char **argv)
20886 while ((i = getc(stdin)) != -1
20887 && (*bp++ = i) != '\n'
20888 && bp < &buf[1024])
20891 fprintf(stdout, "%s", buf);
20900 if eval $compile; then
20902 if $test "X$targethost" != X; then
20905 $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
20907 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
20909 if cmp tryp.c tryp.out >/dev/null 2>&1; then
20911 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
20913 : now check for fflushall behaviour
20914 case "$fflushall" in
20915 '') set try -DTRY_FFLUSH_ALL $output
20916 if eval $compile; then
20918 (Now testing the other method--but note that this also may fail.)
20920 $run ./try 2>/dev/null
20923 if $test -s try.out -a "X$code" = X42; then
20924 fflushall="`$cat try.out`"
20928 case "$fflushall" in
20930 Whew. Flushing explicitly all the stdio streams works.
20932 fflushall="$define"
20935 Sigh. Flushing explicitly all the stdio streams doesn't work.
20940 Cannot figure out whether flushing stdio streams explicitly works or not.
20941 I'm assuming it doesn't.
20947 "$define"|true|[yY]*)
20948 fflushall="$define"
20956 All is futile. Even fflush(stdin) clobbers input pipes!
20963 $rm -f core tryp.c tryp.core core.tryp.*
20965 *) fflushall="$undef"
20969 case "$fflushNULL$fflushall" in
20972 OK, I give up. I cannot figure out how to flush pending stdio output.
20973 We won't be flushing handles at all before fork/exec/popen.
20979 : Store the full pathname to the ar program for use in the C program
20980 : Respect a hint or command line value for full_ar.
20985 : Store the full pathname to the sed program for use in the C program
20988 : see what type gids are declared as in the kernel
20990 echo "Looking for the type for group ids returned by getgid()."
20991 set gid_t gidtype xxx stdio.h sys/types.h
20995 xxx=`./findhdr sys/user.h`
20996 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
20998 unsigned) dflt="$1 $2" ;;
21002 *) dflt="$gidtype";;
21005 gid_t) echo "gid_t found." ;;
21006 *) rp="What is the type for group ids returned by getgid()?"
21012 : Check the size of GID
21015 *_t) zzz="$gidtype" ;;
21018 echo "Checking the size of $zzz..." >&4
21020 #include <sys/types.h>
21022 #$i_stdlib I_STDLIB
21024 #include <stdlib.h>
21027 printf("%d\n", (int)sizeof($gidtype));
21032 if eval $compile_ok; then
21036 echo "(I can't execute the test program--guessing $gidsize.)" >&4
21039 echo "Your $zzz is $gidsize bytes long."
21044 echo "(I can't compile the test program--guessing $gidsize.)" >&4
21047 : Check if GID is signed
21050 *_t) zzz="$gidtype" ;;
21053 echo "Checking the sign of $zzz..." >&4
21055 #include <sys/types.h>
21066 if eval $compile; then
21070 echo "(I can't execute the test program--guessing unsigned.)" >&4
21074 1) echo "Your $zzz is unsigned." ;;
21075 -1) echo "Your $zzz is signed." ;;
21081 echo "(I can't compile the test program--guessing unsigned.)" >&4
21084 : Check 64bit sizes
21087 if $test X"$quadtype" != X; then
21089 echo "Checking how to print 64-bit integers..." >&4
21091 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
21092 $cat >try.c <<'EOCP'
21093 #include <sys/types.h>
21096 int q = 12345678901;
21097 printf("%ld\n", q);
21101 if eval $compile; then
21105 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
21106 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
21107 echo "We will use %d."
21113 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
21114 $cat >try.c <<'EOCP'
21115 #include <sys/types.h>
21118 long q = 12345678901;
21119 printf("%ld\n", q);
21123 if eval $compile; then
21127 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
21128 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
21129 echo "We will use %ld."
21135 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
21136 $cat >try.c <<'EOCP'
21137 #include <sys/types.h>
21138 #include <inttypes.h>
21141 int64_t q = 12345678901;
21142 printf("%" PRId64 "\n", q);
21146 if eval $compile; then
21150 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
21151 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
21152 echo "We will use the C9X style."
21158 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
21160 #include <sys/types.h>
21163 $quadtype q = 12345678901;
21164 printf("%Ld\n", q);
21168 if eval $compile; then
21172 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
21173 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
21174 echo "We will use %Ld."
21180 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
21181 $cat >try.c <<'EOCP'
21182 #include <sys/types.h>
21185 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
21186 printf("%lld\n", q);
21190 if eval $compile; then
21194 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
21195 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
21196 echo "We will use the %lld style."
21202 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
21204 #include <sys/types.h>
21207 $quadtype q = 12345678901;
21208 printf("%qd\n", q);
21212 if eval $compile; then
21216 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
21217 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
21218 echo "We will use %qd."
21224 if $test X"$sPRId64" = X; then
21225 echo "Cannot figure out how to print 64-bit integers." >&4
21232 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
21233 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
21235 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
21236 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
21240 : Check format strings for internal types
21242 $echo "Checking the format strings to be used for Perl's internal types..." >&4
21244 if $test X"$ivsize" = X8; then
21245 ivdformat="$sPRId64"
21246 uvuformat="$sPRIu64"
21247 uvoformat="$sPRIo64"
21248 uvxformat="$sPRIx64"
21249 uvXUformat="$sPRIXU64"
21251 if $test X"$ivsize" = X"$longsize"; then
21258 if $test X"$ivsize" = X"$intsize"; then
21266 if $test X"$ivsize" = X"$shortsize"; then
21277 if $test X"$usequadmath" = X"$define"; then
21285 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
21286 nveformat="$sPRIeldbl"
21287 nvfformat="$sPRIfldbl"
21288 nvgformat="$sPRIgldbl"
21289 nvEUformat="$sPRIEUldbl"
21290 nvFUformat="$sPRIFUldbl"
21291 nvGUformat="$sPRIGUldbl"
21302 case "$ivdformat" in
21303 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
21308 : Check format string for GID
21311 $echo "Checking the format string to be used for gids..." >&4
21314 -1) if $test X"$gidsize" = X"$ivsize"; then
21315 gidformat="$ivdformat"
21317 if $test X"$gidsize" = X"$longsize"; then
21320 if $test X"$gidsize" = X"$intsize"; then
21323 if $test X"$gidsize" = X"$shortsize"; then
21330 *) if $test X"$gidsize" = X"$uvsize"; then
21331 gidformat="$uvuformat"
21333 if $test X"$gidsize" = X"$longsize"; then
21336 if $test X"$gidsize" = X"$intsize"; then
21339 if $test X"$gidsize" = X"$shortsize"; then
21348 : see if getgroups exists
21349 set getgroups d_getgrps
21352 : see if setgroups exists
21353 set setgroups d_setgrps
21356 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
21358 case "$d_getgrps$d_setgrps" in
21360 case "$groupstype" in
21361 '') dflt="$gidtype" ;;
21362 *) dflt="$groupstype" ;;
21365 What type of pointer is the second argument to getgroups() and setgroups()?
21366 Usually this is the same as group ids, $gidtype, but not always.
21369 rp='What type pointer is the second argument to getgroups() and setgroups()?'
21373 *) groupstype="$gidtype";;
21376 : check whether make sets MAKE
21378 echo "Checking if your $make program sets \$(MAKE)..." >&4
21379 case "$make_set_make" in
21381 $sed 's/^X //' > testmake.mak << 'EOF'
21383 X @echo 'maketemp="$(MAKE)"'
21385 case "`$make -f testmake.mak 2>/dev/null`" in
21386 *maketemp=*) make_set_make='#' ;;
21387 *) make_set_make="MAKE=$make" ;;
21389 $rm -f testmake.mak
21392 case "$make_set_make" in
21393 '#') echo "Yup, it does.";;
21394 *) echo "Nope, it doesn't.";;
21397 : see what type is used for mode_t
21398 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
21399 set mode_t modetype int stdio.h sys/types.h
21402 : see if we need va_copy
21405 #include <stdarg.h>
21407 #include <stdlib.h>
21408 #include <signal.h>
21411 ivfprintf(FILE *f, const char *fmt, va_list *valp)
21413 return vfprintf(f, fmt, *valp);
21417 myvfprintf(FILE *f, const char *fmt, va_list val)
21419 return ivfprintf(f, fmt, &val);
21423 myprintf(char *fmt, ...)
21426 va_start(val, fmt);
21427 return myvfprintf(stdout, fmt, val);
21431 main(int ac, char **av)
21433 signal(SIGSEGV, exit);
21435 myprintf("%s%cs all right, then\n", "that", '\'');
21440 if eval $compile && $run ./try 2>&1 >/dev/null; then
21441 case "`$run ./try`" in
21442 "that's all right, then")
21448 yes) echo "It seems that you don't need va_copy()." >&4
21449 need_va_copy="$undef"
21451 *) echo "It seems that va_copy() or similar will be needed." >&4
21452 need_va_copy="$define"
21457 : see what type is used for size_t
21458 rp="What is the type used for the length parameter for string functions?"
21459 set size_t sizetype 'unsigned int' stdio.h sys/types.h
21462 : check for type of arguments to gethostbyaddr.
21463 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
21464 case "$d_gethbyaddr" in
21468 Checking to see what type of arguments are accepted by gethostbyaddr().
21470 hdrs="$define sys/types.h
21471 $d_socket sys/socket.h
21472 $i_niin netinet/in.h
21474 $i_unistd unistd.h"
21475 : The first arg can 'char *' or 'void *'
21476 : The second arg is some of integral type
21477 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
21478 for yyy in size_t long int; do
21479 case "$netdb_host_type" in
21480 '') try="$extern_C struct hostent *gethostbyaddr($xxx, $yyy, int);"
21481 if ./protochk "$try" $hdrs; then
21482 echo "Your system accepts $xxx for the first arg."
21483 echo "...and $yyy for the second arg."
21484 netdb_host_type="$xxx"
21485 netdb_hlen_type="$yyy"
21491 : In case none of those worked, prompt the user.
21492 case "$netdb_host_type" in
21493 '') rp='What is the type for the 1st argument to gethostbyaddr?'
21496 netdb_host_type=$ans
21497 rp='What is the type for the 2nd argument to gethostbyaddr?'
21500 netdb_hlen_type=$ans
21504 *) : no gethostbyaddr, so pick harmless defaults
21505 netdb_host_type='char *'
21506 netdb_hlen_type="$sizetype"
21509 # Remove the "const" if needed. -- but then we'll have a
21511 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
21514 : check for type of argument to gethostbyname.
21515 if test "X$netdb_name_type" = X ; then
21516 case "$d_gethbyname" in
21520 Checking to see what type of argument is accepted by gethostbyname().
21522 hdrs="$define sys/types.h
21523 $d_socket sys/socket.h
21524 $i_niin netinet/in.h
21526 $i_unistd unistd.h"
21527 for xxx in "const char *" "char *"; do
21528 case "$netdb_name_type" in
21529 '') try="$extern_C struct hostent *gethostbyname($xxx);"
21530 if ./protochk "$try" $hdrs; then
21531 echo "Your system accepts $xxx."
21532 netdb_name_type="$xxx"
21537 : In case none of those worked, prompt the user.
21538 case "$netdb_name_type" in
21539 '') rp='What is the type for the 1st argument to gethostbyname?'
21542 netdb_name_type=$ans
21546 *) : no gethostbyname, so pick harmless default
21547 netdb_name_type='char *'
21552 : check for type of 1st argument to getnetbyaddr.
21553 if test "X$netdb_net_type" = X ; then
21554 case "$d_getnbyaddr" in
21558 Checking to see what type of 1st argument is accepted by getnetbyaddr().
21560 hdrs="$define sys/types.h
21561 $d_socket sys/socket.h
21562 $i_niin netinet/in.h
21564 $i_unistd unistd.h"
21565 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
21566 case "$netdb_net_type" in
21567 '') try="$extern_C struct netent *getnetbyaddr($xxx, int);"
21568 if ./protochk "$try" $hdrs; then
21569 echo "Your system accepts $xxx."
21570 netdb_net_type="$xxx"
21575 : In case none of those worked, prompt the user.
21576 case "$netdb_net_type" in
21577 '') rp='What is the type for the 1st argument to getnetbyaddr?'
21580 netdb_net_type=$ans
21584 *) : no getnetbyaddr, so pick harmless default
21585 netdb_net_type='long'
21589 : locate the preferred pager for this system
21596 [a-zA-Z]:/*) dflt=$pg;;
21600 [a-zA-Z]:/*) dflt=$more;;
21604 [a-zA-Z]:/*) dflt=$less;;
21607 '') dflt=/usr/ucb/more;;
21615 rp='What pager is used on your system?'
21619 : see if ar generates random libraries by itself
21621 echo "Checking how to generate random libraries on your machine..." >&4
21622 echo 'int bar1() { return bar2(); }' > bar1.c
21623 echo 'int bar2() { return 2; }' > bar2.c
21625 #$i_stdlib I_STDLIB
21627 #include <stdlib.h>
21629 int main() { printf("%d\n", bar1()); exit(0); }
21631 $cc $ccflags -c bar1.c >/dev/null 2>&1
21632 $cc $ccflags -c bar2.c >/dev/null 2>&1
21633 $cc $ccflags -c foo.c >/dev/null 2>&1
21634 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
21635 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
21636 $run ./foobar >/dev/null 2>&1; then
21637 echo "$ar appears to generate random libraries itself."
21639 if [ "X$ranlib" = "X" ]; then
21642 elif $ar s bar$_a >/dev/null 2>&1 &&
21643 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
21644 $run ./foobar >/dev/null 2>&1; then
21645 echo "a table of contents needs to be added with '$ar s'."
21648 elif $ar ts bar$_a >/dev/null 2>&1 &&
21649 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
21650 $run ./foobar >/dev/null 2>&1; then
21651 echo "a table of contents needs to be added with '$ar ts'."
21658 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
21659 $test -f $ranlib || ranlib=''
21662 if $test -n "$ranlib"; then
21663 echo "your system has '$ranlib'; we'll use that."
21666 echo "your system doesn't seem to support random libraries"
21667 echo "so we'll use lorder and tsort to order the libraries."
21674 : Check the max offset that gmtime and localtime accept
21675 echo "Checking max offsets that gmtime () accepts"
21677 case "$sGMTIME_min/$sGMTIME_max" in
21680 #include <sys/types.h>
21688 void gm_check (time_t t, int min_year, int max_year)
21691 if ( tmp == NULL ||
21692 /* Check tm_year overflow */
21693 tmp->tm_year < min_year || tmp->tm_year > max_year)
21704 gm_check (MAXLONG, 69, 0x7fffffff);
21706 if (tmp == NULL || tmp->tm_year < 0) {
21707 for (i = 63; i >= 0; i--) {
21708 time_t x = pt | ((time_t)1 << i);
21709 if (x < 0 || x < pt) continue;
21710 gm_check (x, 69, 0x7fffffff);
21713 printf ("sGMTIME_max=%ld\n", pt);
21722 gm_check (MINLONG, -1900, 70);
21725 for (i = 36; i >= 0; i--) {
21726 time_t x = pt - ((time_t)1 << i);
21727 if (x > 0) continue;
21728 gm_check (x, -1900, 70);
21731 printf ("sGMTIME_min=%ld\n", pt);
21735 int main (int argc, char *argv[])
21737 /* fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t)); */
21744 if eval $compile; then
21745 eval `$run ./try 2>/dev/null`
21747 echo "Cannot determine sGMTIME_max and sGMTIME_min." >&4
21753 echo "Checking max offsets that localtime () accepts"
21755 case "$sLOCALTIME_min/$sLOCALTIME_max" in
21758 #include <sys/types.h>
21766 void local_check (time_t t, int min_year, int max_year)
21768 if (sizeof (time_t) > 4 && t > 0x7ffffffffffff000LL)
21771 tmp = localtime (&t);
21772 if ( tmp == NULL ||
21773 /* Check tm_year overflow */
21774 tmp->tm_year < min_year || tmp->tm_year > max_year)
21778 } /* local_check */
21785 local_check (MAXLONG, 69, 0x7fffffff);
21787 if (tmp == NULL || tmp->tm_year < 0) {
21788 for (i = 63; i >= 0; i--) {
21789 time_t x = pt | ((time_t)1 << i);
21790 if (x < 0 || x < pt) continue;
21791 local_check (x, 69, 0x7fffffff);
21794 printf ("sLOCALTIME_max=%ld\n", pt);
21803 local_check (MINLONG, -1900, 70);
21806 for (i = 36; i >= 0; i--) {
21807 time_t x = pt - ((time_t)1 << i);
21808 if (x > 0) continue;
21809 local_check (x, -1900, 70);
21812 printf ("sLOCALTIME_min=%ld\n", pt);
21816 int main (int argc, char *argv[])
21824 if eval $compile; then
21825 eval `$run ./try 2>/dev/null`
21827 echo "Cannot determine sLOCALTIME_max and sLOCALTIME_min." >&4
21833 : check for type of arguments to select.
21834 case "$selecttype" in
21835 '') case "$d_select" in
21839 Checking to see what type of arguments are accepted by select().
21841 hdrs="$define sys/types.h
21842 $i_systime sys/time.h
21843 $i_sysselct sys/select.h
21844 $d_socket sys/socket.h"
21845 : The first arg can be int, unsigned, or size_t
21846 : The last arg may or may not be 'const'
21848 : void pointer has been seen but using that
21849 : breaks the selectminbits test
21850 for xxx in 'fd_set *' 'int *'; do
21851 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
21852 for tmo in 'struct timeval *' 'const struct timeval *'; do
21854 '') try="$extern_C select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
21855 if ./protochk "$try" $hdrs; then
21856 echo "Your system accepts $xxx."
21865 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
21866 case "$d_fd_set" in
21867 $define) dflt="fd_set *" ;;
21876 *) : no select, so pick a harmless default
21883 : check for the select 'width'
21884 case "$selectminbits" in
21885 '') safebits=`expr $ptrsize \* 8`
21886 case "$d_select" in
21890 Checking to see on how many bits at a time your select() operates...
21893 #include <sys/types.h>
21895 #$i_systime I_SYS_TIME
21896 #$i_systimek I_SYS_TIME_KERNEL
21901 # ifdef I_SYS_TIME_KERNEL
21904 # include <sys/time.h>
21905 # ifdef I_SYS_TIME_KERNEL
21909 #$i_sysselct I_SYS_SELECT
21910 #ifdef I_SYS_SELECT
21911 #include <sys/select.h>
21913 #$d_socket HAS_SOCKET
21915 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
21918 #$i_stdlib I_STDLIB
21920 #include <stdlib.h>
21923 #define S sizeof(*(b))
21925 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
21926 #define NBITS (NBYTES * 8)
21928 char *s = (char *)malloc(NBYTES);
21937 fp = fopen("try.c", "r");
21943 b = ($selecttype)s;
21944 for (i = 0; i < NBITS; i++)
21948 select(fd + 1, b, 0, 0, &t);
21949 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
21951 printf("%d\n", i + 1);
21956 if eval $compile_ok; then
21957 selectminbits=`$run ./try 2>/dev/null`
21958 case "$selectminbits" in
21960 Cannot figure out on how many bits at a time your select() operates.
21961 I'll play safe and guess it is $safebits bits.
21963 selectminbits=$safebits
21964 bits="$safebits bits"
21967 *) bits="$selectminbits bits" ;;
21969 echo "Your select() operates on $bits at a time." >&4
21971 rp='What is the minimum number of bits your select() operates on?'
21972 case "$byteorder" in
21973 12345678) dflt=64 ;;
21979 selectminbits="$val"
21983 *) : no select, so pick a harmless default
21984 selectminbits=$safebits
21990 : Trace out the files included by signal.h, then look for SIGxxx names.
21991 case "$sig_num_init" in
21993 if [ "X$fieldn" = X ]; then
21994 : Just make some guesses. We check them later.
21995 xxx="$sysroot/usr/include/signal.h $sysroot/usr/include/sys/signal.h"
21997 xxx=`echo '#include <signal.h>' |
21998 $cppstdin $cppminus $cppflags 2>/dev/null |
21999 $grep '^[ ]*#.*include' |
22000 $awk "{print \\$$fieldn}" | $sed 's!"!!g' |\
22001 $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
22004 for xx in $xxx /dev/null ; do
22005 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
22007 case "$xxxfiles" in
22008 '') xxxfiles=`./findhdr signal.h` ;;
22011 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
22012 print substr($2, 4, 20)
22014 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
22015 print substr($3, 4, 20)
22017 : Append some common names just in case the awk scan failed.
22018 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
22019 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
22020 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
22021 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
22022 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
22024 : generate a few handy files for later
22025 $cat > signal.c <<EOCP
22026 #include <sys/types.h>
22027 #include <signal.h>
22028 #$i_stdlib I_STDLIB
22030 #include <stdlib.h>
22035 /* Strange style to avoid deeply-nested #if/#else/#endif */
22038 # define NSIG (_NSIG)
22044 # define NSIG (SIGMAX+1)
22050 # define NSIG (SIG_MAX+1)
22056 # define NSIG (_SIG_MAX+1)
22062 # define NSIG (MAXSIG+1)
22068 # define NSIG (MAX_SIG+1)
22073 # ifdef SIGARRAYSIZE
22074 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
22080 # define NSIG (_sys_nsig) /* Solaris 2.5 */
22084 /* Default to some arbitrary number that's big enough to get most
22085 of the common signals.
22091 printf("NSIG %d\n", NSIG);
22097 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
22099 printf "#ifdef SIG"; printf $1; printf "\n"
22100 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
22101 printf $1; printf ");\n"
22105 printf "#endif /* JUST_NSIG */\n";
22106 printf "exit(0);\n}\n";
22109 $cat >signal.awk <<'EOP'
22110 BEGIN { ndups = 0 }
22111 $1 ~ /^NSIG$/ { nsig = $2 }
22112 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
22113 if ($2 > maxsig) { maxsig = $2 }
22114 if (sig_name[$2]) {
22115 dup_name[ndups] = $1
22116 dup_num[ndups] = $2
22128 printf("NSIG %d\n", nsig);
22129 for (n = 1; n < nsig; n++) {
22131 printf("%s %d\n", sig_name[n], sig_num[n])
22134 printf("NUM%d %d\n", n, n)
22137 for (n = 0; n < ndups; n++) {
22138 printf("%s %d\n", dup_name[n], dup_num[n])
22142 $cat >signal_cmd <<EOS
22144 if $test -s signal.lst; then
22145 echo "Using your existing signal.lst file"
22150 $cat >>signal_cmd <<'EOS'
22153 if eval $compile_ok; then
22154 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) |\
22155 $uniq | $awk -f signal.awk >signal.lst
22157 echo "(I can't seem be able to compile the whole test program)" >&4
22158 echo "(I'll try it in little pieces.)" >&4
22159 set signal -DJUST_NSIG
22160 if eval $compile_ok; then
22161 $run ./signal$_exe > signal.nsg
22164 echo "I can't seem to figure out how many signals you have." >&4
22165 echo "Guessing 50." >&4
22166 echo 'NSIG 50' > signal.nsg
22168 : Now look at all the signal names, one at a time.
22169 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
22170 $cat > signal.c <<EOCP
22171 #include <sys/types.h>
22172 #include <signal.h>
22175 printf("$xx %d\n", SIG${xx});
22180 if eval $compile; then
22181 echo "SIG${xx} found."
22182 $run ./signal$_exe >> signal.ls1
22184 echo "SIG${xx} NOT found."
22187 if $test -s signal.ls1; then
22188 $cat signal.nsg signal.ls1 |
22189 $sort -n | $uniq | $awk -f signal.awk >signal.lst
22193 if $test -s signal.lst; then
22196 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
22197 echo 'kill -l' >signal
22198 set X `csh -f <signal`
22202 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
22204 echo $@ | $tr ' ' $trnl | \
22205 $awk '{ printf "%s %d\n", $1, ++s; }
22206 END { printf "NSIG %d\n", ++s }' >signal.lst
22208 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
22210 chmod a+x signal_cmd
22211 $eunicefix signal_cmd
22215 : generate list of signal names
22216 case "$sig_num_init" in
22219 case "$sig_name_init" in
22221 *) case "$sig_num_init" in
22222 ''|*,*) doinit=yes ;;
22227 echo "Generating a list of signal names and numbers..." >&4
22229 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
22230 sig_name=`$awk 'BEGIN { printf "ZERO " }
22231 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
22232 sig_num=`$awk 'BEGIN { printf "0 " }
22233 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
22234 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
22235 !/^NSIG/ { printf "\"%s\", ", $1 }
22236 END { printf "0\n" }' signal.lst`
22237 sig_num_init=`$awk 'BEGIN { printf "0, " }
22238 !/^NSIG/ { printf "%d, ", $2}
22239 END { printf "0\n"}' signal.lst`
22242 echo "The following $sig_count signals are available:"
22244 echo $sig_name | $awk \
22245 'BEGIN { linelen = 0 }
22247 for (i = 1; i <= NF; i++) {
22248 name = "SIG" $i " "
22249 linelen = linelen + length(name)
22250 if (linelen > 70) {
22252 linelen = length(name)
22258 sig_size=`echo $sig_name | awk '{print NF}'`
22259 $rm -f signal signal.c signal.awk signal.lst signal_cmd
22263 : Check size of size
22265 case "$sizetype" in
22266 *_t) zzz="$sizetype" ;;
22267 *) zzz="filesize" ;;
22269 echo "Checking the size of $zzz..." >&4
22271 #include <sys/types.h>
22273 #$i_stdlib I_STDLIB
22275 #include <stdlib.h>
22278 printf("%d\n", (int)sizeof($sizetype));
22283 if eval $compile_ok; then
22287 echo "(I can't execute the test program--guessing $sizesize.)" >&4
22290 echo "Your $zzz size is $sizesize bytes."
22295 echo "(I can't compile the test program--guessing $sizesize.)" >&4
22298 : check for socklen_t
22300 echo "Checking to see if you have socklen_t..." >&4
22302 #include <sys/types.h>
22303 #$d_socket HAS_SOCKET
22305 #include <sys/socket.h>
22307 int main() { socklen_t x = 16; }
22310 if eval $compile; then
22312 echo "You have socklen_t."
22315 echo "You do not have socklen_t."
22316 case "$sizetype" in
22317 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
22324 : see if this is a socks.h system
22325 set socks.h i_socks
22328 : check for type of the size argument to socket calls
22329 case "$d_socket" in
22333 Checking to see what type is the last argument of accept().
22336 case "$d_socklen_t" in
22337 "$define") yyy="$yyy socklen_t"
22339 yyy="$yyy $sizetype int long unsigned"
22340 for xxx in $yyy; do
22341 case "$socksizetype" in
22342 '') try="$extern_C int accept(int, struct sockaddr *, $xxx *);"
22343 case "$usesocks" in
22345 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
22346 echo "Your system accepts '$xxx *' for the last argument of accept()."
22347 socksizetype="$xxx"
22350 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
22351 echo "Your system accepts '$xxx *' for the last argument of accept()."
22352 socksizetype="$xxx"
22359 : In case none of those worked, prompt the user.
22360 case "$socksizetype" in
22361 '') rp='What is the type for socket address structure sizes?'
22368 *) : no sockets, so pick relatively harmless default
22373 : see what type is used for signed size_t
22374 set ssize_t ssizetype int stdio.h sys/types.h
22379 #$i_stdlib I_STDLIB
22381 #include <stdlib.h>
22383 #include <sys/types.h>
22384 #define Size_t $sizetype
22385 #define SSize_t $dflt
22388 if (sizeof(Size_t) == sizeof(SSize_t))
22390 else if (sizeof(Size_t) == sizeof(int))
22399 if eval $compile_ok && $run ./try > /dev/null; then
22400 ssizetype=`$run ./try`
22401 echo "I'll be using $ssizetype for functions returning a byte count." >&4
22404 Help! I can't compile and run the ssize_t test program: please enlighten me!
22405 (This is probably a misconfiguration in your system or libraries, and
22406 you really ought to fix it. Still, I'll try anyway.)
22408 I need a type that is the same size as $sizetype, but is guaranteed to
22409 be signed. Common values are ssize_t, int and long.
22412 rp="What signed type is the same size as $sizetype?"
22418 : Check the size of st_ino
22420 $echo "Checking the size of st_ino..." >&4
22421 $cat > try.c <<EOCP
22422 #include <sys/stat.h>
22424 #$i_stdlib I_STDLIB
22426 #include <stdlib.h>
22430 printf("%d\n", (int)sizeof(st.st_ino));
22435 if eval $compile_ok; then
22439 $echo "(I can't execute the test program--guessing $st_ino_size.)" >&4
22441 *) st_ino_size=$val
22442 $echo "Your st_ino is $st_ino_size bytes long."
22447 $echo "(I can't compile the test program--guessing $st_ino_size.)" >&4
22451 : Check if st_ino is signed
22453 $echo "Checking the sign of st_ino..." >&4
22454 $cat > try.c <<EOCP
22455 #include <sys/stat.h>
22460 if (foo.st_ino < 0)
22467 if eval $compile; then
22471 $echo "(I can't execute the test program--guessing unsigned.)" >&4
22473 *) st_ino_sign=$val
22474 case "$st_ino_sign" in
22475 1) $echo "Your st_ino is unsigned." ;;
22476 -1) $echo "Your st_ino is signed." ;;
22482 $echo "(I can't compile the test program--guessing unsigned.)" >&4
22486 : see what type of char stdio uses.
22488 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
22489 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
22490 echo "Your stdio uses unsigned chars." >&4
22491 stdchar="unsigned char"
22493 echo "Your stdio uses signed chars." >&4
22498 : Check size of UID
22501 *_t) zzz="$uidtype" ;;
22504 echo "Checking the size of $zzz..." >&4
22506 #include <sys/types.h>
22508 #$i_stdlib I_STDLIB
22510 #include <stdlib.h>
22513 printf("%d\n", (int)sizeof($uidtype));
22518 if eval $compile_ok; then
22522 echo "(I can't execute the test program--guessing $uidsize.)" >&4
22525 echo "Your $zzz is $uidsize bytes long."
22530 echo "(I can't compile the test program--guessing $uidsize.)" >&4
22533 : Check if UID is signed
22536 *_t) zzz="$uidtype" ;;
22539 echo "Checking the sign of $zzz..." >&4
22541 #include <sys/types.h>
22552 if eval $compile; then
22556 echo "(I can't execute the test program--guessing unsigned.)" >&4
22560 1) echo "Your $zzz is unsigned." ;;
22561 -1) echo "Your $zzz is signed." ;;
22567 echo "(I can't compile the test program--guessing unsigned.)" >&4
22570 : Check format string for UID
22572 $echo "Checking the format string to be used for uids..." >&4
22575 -1) if $test X"$uidsize" = X"$ivsize"; then
22576 uidformat="$ivdformat"
22578 if $test X"$uidsize" = X"$longsize"; then
22581 if $test X"$uidsize" = X"$intsize"; then
22584 if $test X"$uidsize" = X"$shortsize"; then
22591 *) if $test X"$uidsize" = X"$uvsize"; then
22592 uidformat="$uvuformat"
22594 if $test X"$uidsize" = X"$longsize"; then
22597 if $test X"$uidsize" = X"$intsize"; then
22600 if $test X"$uidsize" = X"$shortsize"; then
22609 : Determine if we can use sysctl with KERN_PROC_PATHNAME to find executing program
22611 echo "Determining whether we can use sysctl with KERN_PROC_PATHNAME to find executing program..." >&4
22612 $cat >try.c <<'EOM'
22613 /* Intentionally a long probe as I'd like to sanity check that the exact
22614 approach is going to work, as thinking it will work, but only having it
22615 part working at runtime is worse than not having it. */
22617 #include <sys/types.h>
22618 #include <sys/sysctl.h>
22619 #include <sys/param.h>
22621 #include <string.h>
22622 #include <stdlib.h>
22623 #include <unistd.h>
22626 main(int argc, char **argv) {
22628 char *argv_leaf = strrchr(argv[0], '/');
22634 mib[1] = KERN_PROC;
22635 mib[2] = KERN_PROC_PATHNAME;
22639 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
22643 if (sysctl(mib, 4, NULL, &size, NULL, 0)) {
22648 if (size < strlen(argv_leaf) + 1) {
22649 fprintf(stderr, "size %lu is too short for a path\n",
22650 (unsigned long) size);
22654 if (size > MAXPATHLEN * MAXPATHLEN) {
22655 fprintf(stderr, "size %lu is too long for a path\n",
22656 (unsigned long) size);
22660 buffer = (char *)malloc(size);
22666 if (sysctl(mib, 4, buffer, &size, NULL, 0)) {
22671 if (strlen(buffer) + 1 != size) {
22672 fprintf(stderr, "size != strlen(buffer) + 1 (%lu != %lu)\n",
22673 (unsigned long)size, (unsigned long)strlen(buffer) + 1);
22678 if (*buffer != '/') {
22679 fprintf(stderr, "Not an absolute path: '%s'\n", buffer);
22683 if (strstr(buffer, "/./")) {
22684 fprintf(stderr, "Contains /./: '%s'\n", buffer);
22688 if (strstr(buffer, "/../")) {
22689 fprintf(stderr, "Contains /../: '%s'\n", buffer);
22693 buffer_leaf = strrchr(buffer, '/');
22694 if (strcmp(buffer_leaf, argv_leaf) != 0) {
22695 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], buffer);
22707 if eval $compile; then
22708 if $run ./try; then
22709 echo "You can use sysctl with KERN_PROC_PATHNAME to find the executing program." >&4
22712 echo "Nope, sysctl with KERN_PROC_PATHNAME doesn't work here." >&4
22716 echo "I'm unable to compile the test program." >&4
22717 echo "I'll assume no sysctl with KERN_PROC_PATHNAME here." >&4
22721 set usekernprocpathname
22724 : Determine if we can use _NSGetExecutablePath to find executing program
22726 echo "Determining whether we can use _NSGetExecutablePath to find executing program..." >&4
22727 $cat >try.c <<'EOM'
22728 /* Intentionally a long probe as I'd like to sanity check that the exact
22729 approach is going to work, as thinking it will work, but only having it
22730 part working at runtime is worse than not having it. */
22731 #include <mach-o/dyld.h>
22733 #include <stdlib.h>
22734 #include <sys/param.h>
22735 #include <string.h>
22738 main(int argc, char **argv) {
22740 uint32_t size = sizeof(buf);
22744 char *argv_leaf = strrchr(argv[0], '/');
22748 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
22752 _NSGetExecutablePath(buf, &size);
22753 if (size > MAXPATHLEN * MAXPATHLEN) {
22754 fprintf(stderr, "_NSGetExecutablePath size %u is too long for a path\n",
22755 (unsigned int) size);
22759 buffer = (char *)malloc(size);
22765 result = _NSGetExecutablePath(buffer, &size);
22767 fprintf(stderr, "_NSGetExecutablePath returned %i for a size of %u\n",
22768 result, (unsigned int) size);
22772 tidied = realpath(buffer, NULL);
22774 perror("realpath");
22780 if (*tidied != '/') {
22781 fprintf(stderr, "Not an absolute path: '%s'\n", tidied);
22785 if (strstr(tidied, "/./")) {
22786 fprintf(stderr, "Contains /./: '%s'\n", tidied);
22790 if (strstr(tidied, "/../")) {
22791 fprintf(stderr, "Contains /../: '%s'\n", tidied);
22795 tidied_leaf = strrchr(tidied, '/');
22796 if (strcmp(tidied_leaf, argv_leaf) != 0) {
22797 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], tidied);
22809 if eval $compile; then
22810 if $run ./try; then
22811 echo "You can use _NSGetExecutablePath to find the executing program." >&4
22814 echo "Nope, _NSGetExecutablePath doesn't work here." >&4
22817 echo "I'm unable to compile the test program." >&4
22818 echo "I'll assume no _NSGetExecutablePath here." >&4
22821 set usensgetexecutablepath
22824 : Check if site customization support was requested
22825 case "$usesitecustomize" in
22826 $define|true|[Yy]*)
22827 usesitecustomize="$define"
22830 usesitecustomize="$undef"
22834 : determine compiler compiler
22843 if $test -f "$byacc$_exe"; then
22845 comp="byacc or $comp"
22847 if $test -f "$bison$_exe"; then
22848 comp="$comp or bison -y"
22850 rp="Which compiler compiler ($comp) shall I use?"
22859 echo "(Adding -y option to bison to get yacc-compatible behavior.)"
22865 : see if this is a bfd.h system
22869 : see if this is an execinfo.h system
22870 set execinfo.h i_execinfo
22873 : see if this is a fenv.h system
22877 : see if this is a fp.h system
22881 : see if this is a fp_class.h system
22882 set fp_class.h i_fp_class
22885 : see if gdbm.h is available
22890 : see if gdbm_open exists
22891 set gdbm_open d_gdbm_open
22893 case "$d_gdbm_open" in
22896 echo "We won't be including <gdbm.h>"
22905 : see if this is a ieeefp.h system
22906 case "$i_ieeefp" in
22907 '' ) set ieeefp.h i_ieeefp
22912 : see if this is a libutil.h system
22913 set libutil.h i_libutil
22916 : see if mach cthreads are available
22917 if test "X$usethreads" = "X$define"; then
22918 set mach/cthreads.h i_machcthr
22921 i_machcthr="$undef"
22924 : see if this is a mntent.h system
22925 set mntent.h i_mntent
22928 : see if net/errno.h is available
22930 set net/errno.h val
22933 : Unfortunately, it causes problems on some systems. Arrgh.
22936 cat > try.c <<'EOM'
22939 #include <net/errno.h>
22945 if $cc $ccflags -c try.c >/dev/null 2>&1; then
22946 echo "We'll be including <net/errno.h>." >&4
22948 echo "We won't be including <net/errno.h>." >&4
22957 : see if netinet/tcp.h is available
22958 set netinet/tcp.h i_netinettcp
22961 : see if this is a poll.h system
22965 : see if this is a prot.h system
22969 : Preprocessor symbols
22971 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
22972 $cat <<'EOSH' > Cppsym.know
22973 a29k aarch64 ABI64 aegis AES_SOURCE AIX AIX32 AIX370 AIX41 AIX42
22974 AIX43 aixpc AIX_SOURCE alliant ALL_SOURCE alpha AM29000 am29000
22975 AMD64 amd64 amiga AMIGAOS AMIX ansi ANSI_C_SOURCE apollo arch_ppc
22976 arch_pwr ardent ARM ARM32 atarist att386 att3b
22977 BeOS BIG_ENDIAN BIT_MSF BSD bsd bsd43 bsd4_2 BSD4_3 bsd4_3 bsd4_4
22978 BSDCOMPAT bsdi BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES bull
22979 byteorder byte_order
22980 c cadmus clang clipper CMU COFF COMPILER_VERSION concurrent
22981 convex cpu CRAY cray CRAYMPP ctix CX_UX CYGWIN
22982 DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO Dynix DynixPTX
22983 ELF encore EPI EXTENSIONS
22984 FAVOR_BSD FILE_OFFSET_BITS FORTIFY_SOURCE FreeBSD
22985 GCC_NEW_VARARGS gcos gcx gimpel GLIBC GLIBC_MINOR GNUC GNUC_MINOR
22986 GNU_LIBRARY GNU_SOURCE GO32 gould GOULD_PN
22987 H3050R H3050RX hbullx20 hcx host_mips hp200 hp300 HP700 hp700
22988 hp800 hp9000 hp9000s200 hp9000s300 hp9000s400
22989 hp9000s700 hp9000s800 hp9k8 hppa hpux HPUX_SOURCE hp_osf
22990 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960 IA32 IA64
22991 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
22992 INLINE_INTRINSICS INT64 INTEL interdata INTRINSICS is68k itanium
22994 LANGUAGE_C LARGEFILE64_SOURCE LARGEFILE_SOURCE LARGE_FILE_API
22995 LFS64_LARGEFILE LFS_LARGEFILE LIBCATAMOUNT Linux LITTLE_ENDIAN
22996 LONG64 LONGDOUBLE LONGLONG LONG_DOUBLE LONG_LONG LP64 luna
22998 M68000 m68k m88100 m88k M88KBCS_TARGET MACH machine MachTen
22999 MATH_HAS_NO_SIDE_EFFECTS mc300 mc500 mc68000 mc68010 mc68020
23000 mc68030 mc68040 mc68060 mc68k mc68k32 mc700 mc88000 mc88100
23001 merlin mert MiNT mips MIPSEB MIPSEL MIPS_FPSET MIPS_ISA MIPS_SIM
23002 MIPS_SZINT MIPS_SZLONG MIPS_SZPTR MODERN_C motorola MSDOS
23003 MTXINU MULTIMAX MVS mvs M_AMD64 M_ARM M_ARMT M_COFF M_I186 M_I286
23004 M_I386 M_I8086 M_I86 M_I86SM M_IA64 M_IX86 M_PPC M_SYS3 M_SYS5
23005 M_SYSIII M_SYSV M_UNIX M_X86 M_XENIX
23006 n16 ncl_el ncl_mr NetBSD news1500 news1700 news1800 news1900
23007 news3700 news700 news800 news900 NeXT NLS nonstopux ns16000
23008 ns32000 ns32016 ns32332 ns32k nsc32000
23009 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
23010 PARAGON parisc pa_risc PA_RISC1_1 PA_RISC2_0 pc532 pdp11 PGC PIC
23011 plexus PORTAR posix POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
23012 POSIX_C_SOURCE POSIX_SOURCE POWER powerpc ppc PROTOTYPES PWB pyr
23014 R3000 REENTRANT RES Rhapsody RISC6000 riscix riscos RT
23015 S390 S390x SA110 SCO scs sequent sgi SGI_SOURCE SH SH3 sinix
23016 SIZE_INT SIZE_LONG SIZE_PTR SOCKETS_SOURCE SOCKET_SOURCE sony
23017 sonyrisc sony_news sparc sparclite sparcv8 sparcv9 spectrum
23018 stardent stdc STDC_EXT stratos sun sun3 sun386 Sun386i svr3 svr4
23019 SVR4_2 SVR4_SOURCE svr5 SX system SYSTYPE_BSD SYSTYPE_BSD43
23020 SYSTYPE_BSD44 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3
23021 SYSV4 SYSV5 sysV68 sysV88
23022 Tek4132 Tek4300 thumb thw_370 thw_intel thw_rs6000 titan TM3200
23023 TM5400 TM5600 tower tower32 tower32_200 tower32_600 tower32_700
23024 tower32_800 tower32_850 tss
23025 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5 ultrix UMAXV UnicomPBB
23026 UnicomPBD UNICOS UNICOSMK unix UNIX95 UNIX99 unixpc unos USE_BSD
23027 USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE
23028 USE_LARGEFILE64 USE_MISC USE_POSIX USE_POSIX199309
23029 USE_POSIX199506 USE_POSIX2 USE_REENTRANT USE_SVID USE_UNIX98
23030 USE_XOPEN USE_XOPEN_EXTENDED USGr4 USGr4_2 UTek Utek UTS UWIN
23032 vax venix VMESA vms
23033 x86_64 xenix Xenix286 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2
23034 XPG2_EXTENDED XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
23037 # Maybe put other stuff here too.
23038 ./tr '-' '_' <<EOSH >>Cppsym.know
23041 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
23042 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
23043 $cat Cppsym.know > Cppsym.c
23044 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
23045 $rm -f Cppsym.a Cppsym.b Cppsym.c
23046 cat <<EOSH > Cppsym
23048 if $test \$# -gt 0; then
23049 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
23050 if $test -s Cppsym.got; then
23057 $tr " " "$trnl" | ./Cppsym.try
23063 cat <<EOSH > Cppsym.try
23065 cat <<'EOCP' > try.c
23068 #define STRINGIFY(a) "a"
23070 #if cpp_stuff == 42
23071 #define StGiFy(a) #a
23072 #define STRINGIFY(a) StGiFy(a)
23074 #if $cpp_stuff != 1 && $cpp_stuff != 42
23075 # include "Bletch: How does this C preprocessor stringify macros?"
23081 cat <<'EOSH' >> Cppsym.try
23083 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
23084 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
23085 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
23086 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
23088 echo 'return 0;}' >> try.c
23090 cat <<EOSH >> Cppsym.try
23092 case "$osname-$gccversion" in
23093 irix-) ccflags="\$ccflags -woff 1178" ;;
23094 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
23096 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs 2>/dev/null && $run ./try | $sed 's/ /\\\\ /g'
23098 chmod +x Cppsym.try
23099 $eunicefix Cppsym.try
23100 ./Cppsym < Cppsym.know | $sort | $uniq > Cppsym.true
23101 : Add in any Linux cpp "predefined macros":
23102 case "$osname::$gccversion" in
23103 *linux*::*.*|*gnukfreebsd*::*.*|gnu::*.*)
23105 rm -f $tHdrH'.h' $tHdrH
23107 # Filter out macro arguments, such as Linux's __INT8_C(c)
23108 if $cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
23109 sed -e 's/#define[\ \ ]*//;s/[\ \ ].*$//' -e 's/(.*//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
23110 if [ -s $tHdrH'_cppsym.real' ]; then
23111 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
23114 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
23117 : now check the C compiler for additional symbols
23118 postprocess_cc_v=''
23120 aix) postprocess_cc_v="|$tr , ' '" ;;
23127 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
23130 -D*) echo "\$i" | $sed 's/^-D//';;
23131 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
23136 postprocess_cc_v=''
23139 ./ccsym > ccsym1.raw
23140 if $test -s ccsym1.raw; then
23141 $sort ccsym1.raw | $uniq >ccsym.raw
23143 mv ccsym1.raw ccsym.raw
23146 $awk '/\=/ { print $0; next }
23147 { print $0"=1" }' ccsym.raw >ccsym.list
23148 $comm -13 Cppsym.true ccsym.list >ccsym.own
23149 $comm -12 Cppsym.true ccsym.list >ccsym.com
23150 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
23152 if $test -z ccsym.raw; then
23153 echo "Your C compiler doesn't seem to define any symbols!" >&4
23155 echo "However, your C preprocessor defines the following symbols:"
23158 cppsymbols=`$cat Cppsym.true`
23159 cppsymbols=`echo $cppsymbols`
23160 cppccsymbols="$cppsymbols"
23162 if $test -s ccsym.com; then
23163 echo "Your C compiler and pre-processor define these symbols:"
23164 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
23167 cppccsymbols=`$cat ccsym.com`
23168 cppccsymbols=`echo $cppccsymbols`
23169 $test "$silent" || sleep 1
23171 if $test -s ccsym.cpp; then
23172 $test "$also" && echo " "
23173 echo "Your C pre-processor ${also}defines the following symbols:"
23174 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
23176 cppsymbols=`$cat ccsym.cpp`
23177 cppsymbols=`echo $cppsymbols`
23178 $test "$silent" || sleep 1
23180 if $test -s ccsym.own; then
23181 $test "$also" && echo " "
23182 echo "Your C compiler ${also}defines the following cpp symbols:"
23183 $sed -e 's/\(..*\)=1/\1/' ccsym.own
23184 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
23185 ccsymbols=`$cat ccsym.own`
23186 ccsymbols=`echo $ccsymbols`
23187 $test "$silent" || sleep 1
23191 : add -D_FORTIFY_SOURCE if feasible and not already there
23192 case "$gccversion" in
23193 [456789].*) case "$optimize$ccflags" in
23194 *-O*) case "$ccflags$cppsymbols" in
23195 *_FORTIFY_SOURCE=*) # Don't add it again.
23196 echo "You seem to have -D_FORTIFY_SOURCE already, not adding it." >&4
23198 *) echo "Adding -D_FORTIFY_SOURCE=2 to ccflags..." >&4
23199 ccflags="$ccflags -D_FORTIFY_SOURCE=2"
23203 *) echo "You have gcc 4.* or later but not optimizing, not adding -D_FORTIFY_SOURCE." >&4
23207 *) echo "You seem not to have gcc 4.* or later, not adding -D_FORTIFY_SOURCE." >&4
23211 : script used to emit important warnings
23214 if test \$# -gt 0; then
23219 echo "*** WARNING:" >&4
23220 sed -e 's/^/*** /' <msg >&4
23222 cat msg >>config.msg
23223 echo " " >>config.msg
23229 : see if this is a termio system
23233 if $test `./findhdr termios.h`; then
23234 set tcsetattr i_termios
23240 "$define") echo "You have POSIX termios.h... good!" >&4;;
23241 *) if ./Cppsym pyr; then
23242 case "`$run /bin/universe`" in
23243 ucb) if $test `./findhdr sgtty.h`; then
23245 echo "<sgtty.h> found." >&4
23247 echo "System is pyramid with BSD universe."
23248 ./warn "<sgtty.h> not found--you could have problems."
23250 *) if $test `./findhdr termio.h`; then
23252 echo "<termio.h> found." >&4
23254 echo "System is pyramid with USG universe."
23255 ./warn "<termio.h> not found--you could have problems."
23259 if $test `./findhdr termio.h`; then
23260 echo "<termio.h> found." >&4
23262 elif $test `./findhdr sgtty.h`; then
23263 echo "<sgtty.h> found." >&4
23266 ./warn "Neither <termio.h> nor <sgtty.h> found--cross fingers!"
23269 if $test `./findhdr sgtty.h`; then
23270 echo "<sgtty.h> found." >&4
23272 elif $test `./findhdr termio.h`; then
23273 echo "<termio.h> found." >&4
23276 ./warn "Neither <sgtty.h> nor <termio.h> found--cross fingers!"
23280 set i_termio; eval $setvar
23281 val=$val2; set i_sgtty; eval $setvar
23282 val=$val3; set i_termios; eval $setvar
23284 : see if stdbool is available
23285 : we want a real compile instead of Inhdr because some Solaris systems
23286 : have stdbool.h, but it can only be used if the compiler indicates it
23287 : is sufficiently c99-compliant.
23291 #include <stdbool.h>
23296 int main(int argc, char **argv)
23302 if eval $compile; then
23303 echo "<stdbool.h> found." >&4
23306 echo "<stdbool.h> NOT found." >&4
23313 : see if stdint is available
23314 set stdint.h i_stdint
23317 : see if sys/access.h is available
23318 set sys/access.h i_sysaccess
23321 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
23322 set sys/filio.h i_sysfilio
23325 if $test `./findhdr sys/ioctl.h`; then
23327 echo '<sys/ioctl.h> found.' >&4
23330 if $test $i_sysfilio = "$define"; then
23331 echo '<sys/ioctl.h> NOT found.' >&4
23333 $test $i_sgtty = "$define" && xxx="sgtty.h"
23334 $test $i_termio = "$define" && xxx="termio.h"
23335 $test $i_termios = "$define" && xxx="termios.h"
23336 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
23342 : see if socket ioctl defs are in sys/sockio.h
23344 xxx=`./findhdr sys/sockio.h`
23345 if $test "$xxx"; then
23346 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
23348 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
23351 echo "No socket ioctls found in <sys/sockio.h>." >&4
23356 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
23362 : see if this is a syslog.h system
23363 set syslog.h i_syslog
23366 : see if this is a sys/mode.h system
23367 set sys/mode.h i_sysmode
23370 : see if there is a sys/poll.h file
23371 set sys/poll.h i_syspoll
23374 : see if sys/resource.h has to be included
23375 set sys/resource.h i_sysresrc
23378 : see if sys/security.h is available
23379 set sys/security.h i_syssecrt
23382 : see if this is a sys/statvfs.h system
23383 set sys/statvfs.h i_sysstatvfs
23386 : see if this is a sys/un.h system
23387 set sys/un.h i_sysun
23390 : see if this is a sys/utsname.h system
23391 set sys/utsname.h i_sysutsname
23394 : see if this is a syswait system
23395 set sys/wait.h i_syswait
23398 : see if this is a ustat.h system
23399 set ustat.h i_ustat
23402 : see if this is an utime system
23403 set utime.h i_utime
23406 : see if this is a vfork system
23409 set vfork.h i_vfork
23417 : see if wchar.h is present
23418 set wchar.h i_wchar
23423 echo "Looking for extensions..." >&4
23424 : If we are using the old config.sh, nonxs_extensions and xs_extensions may
23425 : contain old or inaccurate or duplicate values.
23426 nonxs_extensions=''
23428 : We do not use find because it might not be available.
23429 : We do not just use MANIFEST because the user may have dropped
23430 : some additional extensions into the source tree and expect them
23433 : Function to recursively find available extensions, ignoring DynaLoader
23434 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
23435 : In 5.10.1 and later, extensions are stored in directories
23436 : like File-Glob instead of the older File/Glob/.
23440 DynaLoader|dynaload) ;;
23442 this_ext=`echo "$xxx" | $sed -e s/-/\\\//g`;
23443 case "$this_ext" in
23444 Scalar/List/Utils) this_ext="List/Util" ;;
23445 PathTools) this_ext="Cwd" ;;
23447 echo " $xs_extensions $nonxs_extensions" > "$tdir/$$.tmp";
23448 if $contains " $this_ext " "$tdir/$$.tmp"; then
23450 echo "Duplicate directories detected for extension $xxx" >&4;
23451 echo "Configure cannot correctly recover from this - shall I abort?" >&4;
23452 case "$knowitall" in
23460 echo "Ok. Stopping Configure." >&4;
23461 echo "Please remove the duplicate directory (e.g. using git clean) and then re-run Configure" >&4;
23464 echo "Ok. You will need to correct config.sh before running make." >&4;
23466 $ls -1 "$xxx" > "$tdir/$$.tmp";
23467 if $contains "\.xs$" "$tdir/$$.tmp" > /dev/null 2>&1; then
23468 xs_extensions="$xs_extensions $this_ext";
23469 elif $contains "\.c$" "$tdir/$$.tmp" > /dev/null 2>&1; then
23470 xs_extensions="$xs_extensions $this_ext";
23471 elif $test -d "$xxx"; then
23472 nonxs_extensions="$nonxs_extensions $this_ext";
23474 $rm -f "$tdir/$$.tmp";
23482 eval $find_extensions
23486 eval $find_extensions
23490 eval $find_extensions
23491 set X $xs_extensions
23493 xs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
23494 set X $nonxs_extensions
23496 nonxs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
23498 known_extensions=`echo $nonxs_extensions $xs_extensions | tr ' ' $trnl | $sort | tr $trnl ' '`
23500 : Now see which are supported on this system.
23502 for xxx in $xs_extensions ; do
23506 amigaos) avail_ext="$avail_ext $xxx" ;;
23511 $define) avail_ext="$avail_ext $xxx" ;;
23514 GDBM_File|gdbm_fil)
23516 $define) avail_ext="$avail_ext $xxx" ;;
23520 : XXX Do we need a useipcsysv variable here
23521 case "${d_msg}${d_sem}${d_shm}" in
23522 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
23525 NDBM_File|ndbm_fil)
23528 case "$osname-$use64bitint" in
23531 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
23534 *) avail_ext="$avail_ext $xxx" ;;
23539 ODBM_File|odbm_fil)
23540 case "${i_dbm}${i_rpcsvcdbm}" in
23542 case "$d_cplusplus" in
23543 define) ;; # delete as a function name will not work
23544 *) case "$osname-$use64bitint" in
23547 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
23550 *) avail_ext="$avail_ext $xxx" ;;
23558 case "$useopcode" in
23559 true|define|y) avail_ext="$avail_ext $xxx" ;;
23563 case "$useposix" in
23564 true|define|y) avail_ext="$avail_ext $xxx" ;;
23568 case "$d_socket" in
23569 true|$define|y) avail_ext="$avail_ext $xxx" ;;
23572 I18N/Langinfo|langinfo)
23573 case "$uselanginfo" in
23574 true|define|y) avail_ext="$avail_ext $xxx" ;;
23577 Sys/Syslog|sys/syslog)
23579 amigaos) ;; # not really very useful on AmigaOS
23581 : XXX syslog requires socket
23582 case "$d_socket" in
23583 true|$define|y) avail_ext="$avail_ext $xxx" ;;
23589 case "$usethreads" in
23591 case "$use5005threads" in
23592 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
23596 threads|threads/shared)
23597 # threads and threads::shared are special cases.
23598 # To stop people from asking "Perl 5.8.0 was supposed
23599 # to have this new fancy threads implementation but my
23600 # perl doesn't have it" and from people trying to
23601 # (re)install the threads module using CPAN.pm and
23602 # CPAN.pm then offering to reinstall Perl 5.8.0,
23603 # the threads.pm and threads/shared.pm will always be
23604 # there, croaking informatively ("you need to rebuild
23605 # all of Perl with threads, sorry") when threads haven't
23606 # been compiled in.
23608 avail_ext="$avail_ext $xxx"
23614 cygwin) avail_ext="$avail_ext $xxx" ;;
23617 XS/APItest|xs/apitest)
23618 # This is just for testing. Skip it unless we have dynamic loading.
23621 $define) avail_ext="$avail_ext $xxx" ;;
23624 XS/Typemap|xs/typemap)
23625 # This is just for testing. Skip it unless we have dynamic loading.
23627 $define) avail_ext="$avail_ext $xxx" ;;
23630 *) avail_ext="$avail_ext $xxx"
23639 case "$onlyextensions" in
23641 *) keepextensions=''
23642 echo "You have requested that only certain extensions be included..." >&4
23643 for i in $onlyextensions; do
23644 case " $avail_ext " in
23646 echo "Keeping extension $i."
23647 keepextensions="$keepextensions $i"
23649 *) echo "Ignoring extension $i." ;;
23652 avail_ext="$keepextensions"
23656 case "$noextensions" in
23658 *) keepextensions=''
23659 echo "You have requested that certain extensions be ignored..." >&4
23660 for i in $avail_ext; do
23661 case " $noextensions " in
23662 *" $i "*) echo "Ignoring extension $i." ;;
23663 *) echo "Keeping extension $i.";
23664 keepextensions="$keepextensions $i"
23668 avail_ext="$keepextensions"
23672 : Now see which nonxs extensions are supported on this system.
23673 : For now assume all are.
23675 for xxx in $nonxs_extensions ; do
23679 *) nonxs_ext="$nonxs_ext $xxx"
23691 A number of extensions are supplied with $package. You may choose to
23692 compile these extensions for dynamic loading (the default), compile
23693 them into the $package executable (static loading), or not include
23694 them at all. Answer "none" to include no extensions.
23695 Note that DynaLoader is always built and need not be mentioned here.
23698 case "$dynamic_ext" in
23700 : Exclude those listed in static_ext
23702 for xxx in $avail_ext; do
23703 case " $static_ext " in
23705 *) dflt="$dflt $xxx" ;;
23712 *) dflt="$dynamic_ext"
23713 # Perhaps we are reusing an old out-of-date config.sh.
23716 if test X"$dynamic_ext" != X"$avail_ext"; then
23718 NOTICE: Your previous config.sh list may be incorrect.
23719 The extensions now available to you are
23721 but the default list from your previous config.sh is
23733 rp="What extensions do you wish to load dynamically?"
23736 none) dynamic_ext=' ' ;;
23737 *) dynamic_ext="$ans" ;;
23740 case "$static_ext" in
23742 : Exclude those already listed in dynamic linking
23744 for xxx in $avail_ext; do
23745 case " $dynamic_ext " in
23747 *) dflt="$dflt $xxx" ;;
23754 *) dflt="$static_ext"
23761 rp="What extensions do you wish to load statically?"
23764 none) static_ext=' ' ;;
23765 *) static_ext="$ans" ;;
23770 A number of extensions are supplied with $package. Answer "none"
23771 to include no extensions.
23772 Note that DynaLoader is always built and need not be mentioned here.
23775 case "$static_ext" in
23776 '') dflt="$avail_ext" ;;
23777 *) dflt="$static_ext"
23778 # Perhaps we are reusing an old out-of-date config.sh.
23781 if test X"$static_ext" != X"$avail_ext"; then
23783 NOTICE: Your previous config.sh list may be incorrect.
23784 The extensions now available to you are
23786 but the default list from your previous config.sh is
23795 : Exclude those that are not xs extensions
23799 rp="What extensions do you wish to include?"
23802 none) static_ext=' ' ;;
23803 *) static_ext="$ans" ;;
23808 # Encode is a special case. If we are building Encode as a static
23809 # extension, we need to explicitly list its subextensions as well.
23810 # For other nested extensions, this is handled automatically by
23811 # the appropriate Makefile.PL.
23812 case " $static_ext " in
23813 *" Encode "*) # Add the subextensions of Encode
23815 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
23816 static_ext="$static_ext Encode/$xxx"
23817 known_extensions="$known_extensions Encode/$xxx"
23823 set X $dynamic_ext $static_ext $nonxs_ext
23827 # Sanity check: We require an extension suitable for use with
23828 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
23829 # should show up as failures in the test suite, but it's helpful to
23830 # catch them now.) The 'extensions' list is normally sorted
23831 # alphabetically, so we need to accept either
23832 # DB_File ... Fcntl ... IO ....
23833 # or something like
23834 # Fcntl ... NDBM_File ... IO ....
23835 case " $extensions" in
23836 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
23837 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
23838 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
23839 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
23840 echo "WARNING: The Perl you are building will be quite crippled." >& 4
23844 : Remove libraries needed only for extensions
23845 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
23846 : The exception is SunOS 4.x, which needs them.
23847 case "${osname}X${osvers}" in
23851 *) case "$usedl" in
23852 $define|true|[yY]*)
23853 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
23857 *) perllibs="$libs"
23863 : Remove build directory name from cppstdin so it can be used from
23864 : either the present location or the final installed location.
23866 : Get out of the UU directory to get correct path name.
23868 case "$cppstdin" in
23870 echo "Stripping down cppstdin path name"
23876 : end of configuration questions
23878 echo "End of configuration questions."
23881 : back to where it started
23882 if test -d ../UU; then
23886 : configuration may be unconditionally patched via a 'config.arch' file
23887 if $test -f config.arch; then
23888 echo "I see a config.arch file, loading it." >&4
23892 : configuration may be patched via a 'config.over' file
23893 if $test -f config.over; then
23896 rp='I see a config.over file. Do you wish to load it?'
23899 n*) echo "OK, I'll ignore it.";;
23901 echo "Configuration override changes have been loaded."
23906 : in case they want portability, strip down executable paths
23907 case "$d_portable" in
23910 echo "Stripping down executable paths..." >&4
23911 for file in $loclist $trylist; do
23913 eval $file=`basename $temp`
23918 : create config.sh file
23920 echo "Creating config.sh..." >&4
23921 $spitshell <<EOT >config.sh
23924 # This file was produced by running the Configure script. It holds all the
23925 # definitions figured out by Configure. Should you modify one of these values,
23926 # do not forget to propagate your changes by running "Configure -der". You may
23927 # instead choose to run each of the .SH files by yourself, or "Configure -S".
23930 # Package name : $package
23931 # Source directory : $src
23932 # Configuration time: $cf_time
23933 # Configured by : $cf_by
23934 # Target system : $myuname
23937 : Add in command line options if available
23938 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
23940 $spitshell <<EOT >>config.sh
23949 Revision='$Revision'
23957 alignbytes='$alignbytes'
23958 aphostname='$aphostname'
23959 api_revision='$api_revision'
23960 api_subversion='$api_subversion'
23961 api_version='$api_version'
23962 api_versionstring='$api_versionstring'
23965 archlibexp='$archlibexp'
23966 archname64='$archname64'
23967 archname='$archname'
23968 archobjs='$archobjs'
23969 asctime_r_proto='$asctime_r_proto'
23978 byteorder='$byteorder'
23980 castflags='$castflags'
23983 cccdlflags='$cccdlflags'
23984 ccdlflags='$ccdlflags'
23986 ccflags_uselargefiles='$ccflags_uselargefiles'
23988 ccsymbols='$ccsymbols'
23989 ccversion='$ccversion'
23991 cf_email='$cf_email'
23993 charbits='$charbits'
23994 charsize='$charsize'
23998 clocktype='$clocktype'
24000 compress='$compress'
24001 contains='$contains'
24005 cpp_stuff='$cpp_stuff'
24006 cppccsymbols='$cppccsymbols'
24007 cppflags='$cppflags'
24009 cppminus='$cppminus'
24011 cppstdin='$cppstdin'
24012 cppsymbols='$cppsymbols'
24013 crypt_r_proto='$crypt_r_proto'
24014 cryptlib='$cryptlib'
24016 ctermid_r_proto='$ctermid_r_proto'
24017 ctime_r_proto='$ctime_r_proto'
24018 d_Gconvert='$d_Gconvert'
24019 d_PRIEUldbl='$d_PRIEUldbl'
24020 d_PRIFUldbl='$d_PRIFUldbl'
24021 d_PRIGUldbl='$d_PRIGUldbl'
24022 d_PRIXU64='$d_PRIXU64'
24023 d_PRId64='$d_PRId64'
24024 d_PRIeldbl='$d_PRIeldbl'
24025 d_PRIfldbl='$d_PRIfldbl'
24026 d_PRIgldbl='$d_PRIgldbl'
24027 d_PRIi64='$d_PRIi64'
24028 d_PRIo64='$d_PRIo64'
24029 d_PRIu64='$d_PRIu64'
24030 d_PRIx64='$d_PRIx64'
24031 d_SCNfldbl='$d_SCNfldbl'
24032 d__fwalk='$d__fwalk'
24033 d_accept4='$d_accept4'
24034 d_access='$d_access'
24035 d_accessx='$d_accessx'
24039 d_archlib='$d_archlib'
24040 d_asctime64='$d_asctime64'
24041 d_asctime_r='$d_asctime_r'
24046 d_attribute_deprecated='$d_attribute_deprecated'
24047 d_attribute_format='$d_attribute_format'
24048 d_attribute_malloc='$d_attribute_malloc'
24049 d_attribute_nonnull='$d_attribute_nonnull'
24050 d_attribute_noreturn='$d_attribute_noreturn'
24051 d_attribute_pure='$d_attribute_pure'
24052 d_attribute_unused='$d_attribute_unused'
24053 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
24054 d_backtrace='$d_backtrace'
24056 d_bsdgetpgrp='$d_bsdgetpgrp'
24057 d_bsdsetpgrp='$d_bsdsetpgrp'
24058 d_builtin_add_overflow='$d_builtin_add_overflow'
24059 d_builtin_choose_expr='$d_builtin_choose_expr'
24060 d_builtin_expect='$d_builtin_expect'
24061 d_builtin_mul_overflow='$d_builtin_mul_overflow'
24062 d_builtin_sub_overflow='$d_builtin_sub_overflow'
24063 d_c99_variadic_macros='$d_c99_variadic_macros'
24064 d_casti32='$d_casti32'
24065 d_castneg='$d_castneg'
24068 d_chroot='$d_chroot'
24069 d_chsize='$d_chsize'
24071 d_clearenv='$d_clearenv'
24072 d_closedir='$d_closedir'
24073 d_cmsghdr_s='$d_cmsghdr_s'
24074 d_copysign='$d_copysign'
24075 d_copysignl='$d_copysignl'
24076 d_cplusplus='$d_cplusplus'
24078 d_crypt_r='$d_crypt_r'
24080 d_ctermid='$d_ctermid'
24081 d_ctermid_r='$d_ctermid_r'
24082 d_ctime64='$d_ctime64'
24083 d_ctime_r='$d_ctime_r'
24084 d_cuserid='$d_cuserid'
24085 d_dbminitproto='$d_dbminitproto'
24086 d_difftime64='$d_difftime64'
24087 d_difftime='$d_difftime'
24088 d_dir_dd_fd='$d_dir_dd_fd'
24090 d_dirnamlen='$d_dirnamlen'
24091 d_dladdr='$d_dladdr'
24092 d_dlerror='$d_dlerror'
24093 d_dlopen='$d_dlopen'
24094 d_dlsymun='$d_dlsymun'
24095 d_dosuid='$d_dosuid'
24096 d_double_has_inf='$d_double_has_inf'
24097 d_double_has_nan='$d_double_has_nan'
24098 d_double_has_negative_zero='$d_double_has_negative_zero'
24099 d_double_has_subnormals='$d_double_has_subnormals'
24100 d_double_style_cray='$d_double_style_cray'
24101 d_double_style_ibm='$d_double_style_ibm'
24102 d_double_style_ieee='$d_double_style_ieee'
24103 d_double_style_vax='$d_double_style_vax'
24104 d_drand48_r='$d_drand48_r'
24105 d_drand48proto='$d_drand48proto'
24108 d_duplocale='$d_duplocale'
24109 d_eaccess='$d_eaccess'
24110 d_endgrent='$d_endgrent'
24111 d_endgrent_r='$d_endgrent_r'
24112 d_endhent='$d_endhent'
24113 d_endhostent_r='$d_endhostent_r'
24114 d_endnent='$d_endnent'
24115 d_endnetent_r='$d_endnetent_r'
24116 d_endpent='$d_endpent'
24117 d_endprotoent_r='$d_endprotoent_r'
24118 d_endpwent='$d_endpwent'
24119 d_endpwent_r='$d_endpwent_r'
24120 d_endsent='$d_endsent'
24121 d_endservent_r='$d_endservent_r'
24122 d_eofnblk='$d_eofnblk'
24125 d_eunice='$d_eunice'
24128 d_faststdio='$d_faststdio'
24129 d_fchdir='$d_fchdir'
24130 d_fchmod='$d_fchmod'
24131 d_fchmodat='$d_fchmodat'
24132 d_fchown='$d_fchown'
24134 d_fcntl_can_lock='$d_fcntl_can_lock'
24135 d_fd_macros='$d_fd_macros'
24136 d_fd_set='$d_fd_set'
24137 d_fdclose='$d_fdclose'
24139 d_fds_bits='$d_fds_bits'
24140 d_fegetround='$d_fegetround'
24141 d_fgetpos='$d_fgetpos'
24142 d_finite='$d_finite'
24143 d_finitel='$d_finitel'
24144 d_flexfnam='$d_flexfnam'
24146 d_flockproto='$d_flockproto'
24151 d_fp_class='$d_fp_class'
24152 d_fp_classify='$d_fp_classify'
24153 d_fp_classl='$d_fp_classl'
24154 d_fpathconf='$d_fpathconf'
24155 d_fpclass='$d_fpclass'
24156 d_fpclassify='$d_fpclassify'
24157 d_fpclassl='$d_fpclassl'
24158 d_fpgetround='$d_fpgetround'
24159 d_fpos64_t='$d_fpos64_t'
24160 d_freelocale='$d_freelocale'
24161 d_frexpl='$d_frexpl'
24162 d_fs_data_s='$d_fs_data_s'
24163 d_fseeko='$d_fseeko'
24164 d_fsetpos='$d_fsetpos'
24165 d_fstatfs='$d_fstatfs'
24166 d_fstatvfs='$d_fstatvfs'
24168 d_ftello='$d_ftello'
24170 d_futimes='$d_futimes'
24171 d_gai_strerror='$d_gai_strerror'
24172 d_gdbm_ndbm_h_uses_prototypes='$d_gdbm_ndbm_h_uses_prototypes'
24173 d_gdbmndbm_h_uses_prototypes='$d_gdbmndbm_h_uses_prototypes'
24174 d_getaddrinfo='$d_getaddrinfo'
24175 d_getcwd='$d_getcwd'
24176 d_getespwnam='$d_getespwnam'
24177 d_getfsstat='$d_getfsstat'
24178 d_getgrent='$d_getgrent'
24179 d_getgrent_r='$d_getgrent_r'
24180 d_getgrgid_r='$d_getgrgid_r'
24181 d_getgrnam_r='$d_getgrnam_r'
24182 d_getgrps='$d_getgrps'
24183 d_gethbyaddr='$d_gethbyaddr'
24184 d_gethbyname='$d_gethbyname'
24185 d_gethent='$d_gethent'
24186 d_gethname='$d_gethname'
24187 d_gethostbyaddr_r='$d_gethostbyaddr_r'
24188 d_gethostbyname_r='$d_gethostbyname_r'
24189 d_gethostent_r='$d_gethostent_r'
24190 d_gethostprotos='$d_gethostprotos'
24191 d_getitimer='$d_getitimer'
24192 d_getlogin='$d_getlogin'
24193 d_getlogin_r='$d_getlogin_r'
24194 d_getmnt='$d_getmnt'
24195 d_getmntent='$d_getmntent'
24196 d_getnameinfo='$d_getnameinfo'
24197 d_getnbyaddr='$d_getnbyaddr'
24198 d_getnbyname='$d_getnbyname'
24199 d_getnent='$d_getnent'
24200 d_getnetbyaddr_r='$d_getnetbyaddr_r'
24201 d_getnetbyname_r='$d_getnetbyname_r'
24202 d_getnetent_r='$d_getnetent_r'
24203 d_getnetprotos='$d_getnetprotos'
24204 d_getpagsz='$d_getpagsz'
24205 d_getpbyname='$d_getpbyname'
24206 d_getpbynumber='$d_getpbynumber'
24207 d_getpent='$d_getpent'
24208 d_getpgid='$d_getpgid'
24209 d_getpgrp2='$d_getpgrp2'
24210 d_getpgrp='$d_getpgrp'
24211 d_getppid='$d_getppid'
24212 d_getprior='$d_getprior'
24213 d_getprotobyname_r='$d_getprotobyname_r'
24214 d_getprotobynumber_r='$d_getprotobynumber_r'
24215 d_getprotoent_r='$d_getprotoent_r'
24216 d_getprotoprotos='$d_getprotoprotos'
24217 d_getprpwnam='$d_getprpwnam'
24218 d_getpwent='$d_getpwent'
24219 d_getpwent_r='$d_getpwent_r'
24220 d_getpwnam_r='$d_getpwnam_r'
24221 d_getpwuid_r='$d_getpwuid_r'
24222 d_getsbyname='$d_getsbyname'
24223 d_getsbyport='$d_getsbyport'
24224 d_getsent='$d_getsent'
24225 d_getservbyname_r='$d_getservbyname_r'
24226 d_getservbyport_r='$d_getservbyport_r'
24227 d_getservent_r='$d_getservent_r'
24228 d_getservprotos='$d_getservprotos'
24229 d_getspnam='$d_getspnam'
24230 d_getspnam_r='$d_getspnam_r'
24231 d_gettimeod='$d_gettimeod'
24232 d_gmtime64='$d_gmtime64'
24233 d_gmtime_r='$d_gmtime_r'
24234 d_gnulibc='$d_gnulibc'
24235 d_grpasswd='$d_grpasswd'
24236 d_has_C_UTF8='$d_has_C_UTF8'
24237 d_hasmntopt='$d_hasmntopt'
24241 d_ilogbl='$d_ilogbl'
24242 d_inc_version_list='$d_inc_version_list'
24243 d_inetaton='$d_inetaton'
24244 d_inetntop='$d_inetntop'
24245 d_inetpton='$d_inetpton'
24246 d_int64_t='$d_int64_t'
24247 d_ip_mreq='$d_ip_mreq'
24248 d_ip_mreq_source='$d_ip_mreq_source'
24249 d_ipv6_mreq='$d_ipv6_mreq'
24250 d_ipv6_mreq_source='$d_ipv6_mreq_source'
24251 d_isascii='$d_isascii'
24252 d_isblank='$d_isblank'
24253 d_isfinite='$d_isfinite'
24254 d_isfinitel='$d_isfinitel'
24256 d_isinfl='$d_isinfl'
24257 d_isless='$d_isless'
24259 d_isnanl='$d_isnanl'
24260 d_isnormal='$d_isnormal'
24263 d_killpg='$d_killpg'
24264 d_lc_monetary_2008='$d_lc_monetary_2008'
24265 d_lchown='$d_lchown'
24266 d_ldbl_dig='$d_ldbl_dig'
24267 d_ldexpl='$d_ldexpl'
24268 d_lgamma='$d_lgamma'
24269 d_lgamma_r='$d_lgamma_r'
24270 d_libm_lib_version='$d_libm_lib_version'
24271 d_libname_unique='$d_libname_unique'
24273 d_linkat='$d_linkat'
24274 d_llrint='$d_llrint'
24275 d_llrintl='$d_llrintl'
24276 d_llround='$d_llround'
24277 d_llroundl='$d_llroundl'
24278 d_localeconv_l='$d_localeconv_l'
24279 d_localtime64='$d_localtime64'
24280 d_localtime_r='$d_localtime_r'
24281 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
24282 d_locconv='$d_locconv'
24287 d_long_double_style_ieee='$d_long_double_style_ieee'
24288 d_long_double_style_ieee_doubledouble='$d_long_double_style_ieee_doubledouble'
24289 d_long_double_style_ieee_extended='$d_long_double_style_ieee_extended'
24290 d_long_double_style_ieee_std='$d_long_double_style_ieee_std'
24291 d_long_double_style_vax='$d_long_double_style_vax'
24292 d_longdbl='$d_longdbl'
24293 d_longlong='$d_longlong'
24295 d_lrintl='$d_lrintl'
24296 d_lround='$d_lround'
24297 d_lroundl='$d_lroundl'
24298 d_lseekproto='$d_lseekproto'
24300 d_madvise='$d_madvise'
24301 d_malloc_good_size='$d_malloc_good_size'
24302 d_malloc_size='$d_malloc_size'
24304 d_mbrlen='$d_mbrlen'
24305 d_mbrtowc='$d_mbrtowc'
24306 d_mbstowcs='$d_mbstowcs'
24307 d_mbtowc='$d_mbtowc'
24308 d_memmem='$d_memmem'
24309 d_memrchr='$d_memrchr'
24311 d_mkdtemp='$d_mkdtemp'
24312 d_mkfifo='$d_mkfifo'
24313 d_mkostemp='$d_mkostemp'
24314 d_mkstemp='$d_mkstemp'
24315 d_mkstemps='$d_mkstemps'
24316 d_mktime64='$d_mktime64'
24317 d_mktime='$d_mktime'
24320 d_modflproto='$d_modflproto'
24321 d_mprotect='$d_mprotect'
24323 d_msg_ctrunc='$d_msg_ctrunc'
24324 d_msg_dontroute='$d_msg_dontroute'
24325 d_msg_oob='$d_msg_oob'
24326 d_msg_peek='$d_msg_peek'
24327 d_msg_proxy='$d_msg_proxy'
24328 d_msgctl='$d_msgctl'
24329 d_msgget='$d_msgget'
24330 d_msghdr_s='$d_msghdr_s'
24331 d_msgrcv='$d_msgrcv'
24332 d_msgsnd='$d_msgsnd'
24334 d_munmap='$d_munmap'
24335 d_mymalloc='$d_mymalloc'
24337 d_nanosleep='$d_nanosleep'
24339 d_ndbm_h_uses_prototypes='$d_ndbm_h_uses_prototypes'
24340 d_nearbyint='$d_nearbyint'
24341 d_newlocale='$d_newlocale'
24342 d_nextafter='$d_nextafter'
24343 d_nexttoward='$d_nexttoward'
24345 d_nl_langinfo='$d_nl_langinfo'
24346 d_nv_preserves_uv='$d_nv_preserves_uv'
24347 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
24348 d_off64_t='$d_off64_t'
24349 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
24350 d_oldpthreads='$d_oldpthreads'
24351 d_oldsock='$d_oldsock'
24353 d_openat='$d_openat'
24354 d_pathconf='$d_pathconf'
24356 d_perl_otherlibdirs='$d_perl_otherlibdirs'
24357 d_phostname='$d_phostname'
24361 d_portable='$d_portable'
24363 d_prctl_set_name='$d_prctl_set_name'
24364 d_printf_format_null='$d_printf_format_null'
24365 d_procselfexe='$d_procselfexe'
24366 d_pseudofork='$d_pseudofork'
24367 d_pthread_atfork='$d_pthread_atfork'
24368 d_pthread_attr_setscope='$d_pthread_attr_setscope'
24369 d_pthread_yield='$d_pthread_yield'
24370 d_ptrdiff_t='$d_ptrdiff_t'
24372 d_pwchange='$d_pwchange'
24373 d_pwclass='$d_pwclass'
24374 d_pwcomment='$d_pwcomment'
24375 d_pwexpire='$d_pwexpire'
24376 d_pwgecos='$d_pwgecos'
24377 d_pwpasswd='$d_pwpasswd'
24378 d_pwquota='$d_pwquota'
24381 d_querylocale='$d_querylocale'
24382 d_random_r='$d_random_r'
24383 d_re_comp='$d_re_comp'
24384 d_readdir64_r='$d_readdir64_r'
24385 d_readdir='$d_readdir'
24386 d_readdir_r='$d_readdir_r'
24387 d_readlink='$d_readlink'
24389 d_recvmsg='$d_recvmsg'
24390 d_regcmp='$d_regcmp'
24391 d_regcomp='$d_regcomp'
24392 d_remainder='$d_remainder'
24393 d_remquo='$d_remquo'
24394 d_rename='$d_rename'
24395 d_renameat='$d_renameat'
24396 d_rewinddir='$d_rewinddir'
24400 d_sbrkproto='$d_sbrkproto'
24401 d_scalbn='$d_scalbn'
24402 d_scalbnl='$d_scalbnl'
24403 d_sched_yield='$d_sched_yield'
24404 d_scm_rights='$d_scm_rights'
24405 d_seekdir='$d_seekdir'
24406 d_select='$d_select'
24408 d_semctl='$d_semctl'
24409 d_semctl_semid_ds='$d_semctl_semid_ds'
24410 d_semctl_semun='$d_semctl_semun'
24411 d_semget='$d_semget'
24413 d_sendmsg='$d_sendmsg'
24414 d_setegid='$d_setegid'
24415 d_seteuid='$d_seteuid'
24416 d_setgrent='$d_setgrent'
24417 d_setgrent_r='$d_setgrent_r'
24418 d_setgrps='$d_setgrps'
24419 d_sethent='$d_sethent'
24420 d_sethostent_r='$d_sethostent_r'
24421 d_setitimer='$d_setitimer'
24422 d_setlinebuf='$d_setlinebuf'
24423 d_setlocale='$d_setlocale'
24424 d_setlocale_accepts_any_locale_name='$d_setlocale_accepts_any_locale_name'
24425 d_setlocale_r='$d_setlocale_r'
24426 d_setnent='$d_setnent'
24427 d_setnetent_r='$d_setnetent_r'
24428 d_setpent='$d_setpent'
24429 d_setpgid='$d_setpgid'
24430 d_setpgrp2='$d_setpgrp2'
24431 d_setpgrp='$d_setpgrp'
24432 d_setprior='$d_setprior'
24433 d_setproctitle='$d_setproctitle'
24434 d_setprotoent_r='$d_setprotoent_r'
24435 d_setpwent='$d_setpwent'
24436 d_setpwent_r='$d_setpwent_r'
24437 d_setregid='$d_setregid'
24438 d_setresgid='$d_setresgid'
24439 d_setresuid='$d_setresuid'
24440 d_setreuid='$d_setreuid'
24441 d_setrgid='$d_setrgid'
24442 d_setruid='$d_setruid'
24443 d_setsent='$d_setsent'
24444 d_setservent_r='$d_setservent_r'
24445 d_setsid='$d_setsid'
24446 d_setvbuf='$d_setvbuf'
24449 d_shmatprototype='$d_shmatprototype'
24450 d_shmctl='$d_shmctl'
24452 d_shmget='$d_shmget'
24453 d_sigaction='$d_sigaction'
24454 d_siginfo_si_addr='$d_siginfo_si_addr'
24455 d_siginfo_si_band='$d_siginfo_si_band'
24456 d_siginfo_si_errno='$d_siginfo_si_errno'
24457 d_siginfo_si_fd='$d_siginfo_si_fd'
24458 d_siginfo_si_pid='$d_siginfo_si_pid'
24459 d_siginfo_si_status='$d_siginfo_si_status'
24460 d_siginfo_si_uid='$d_siginfo_si_uid'
24461 d_siginfo_si_value='$d_siginfo_si_value'
24462 d_signbit='$d_signbit'
24463 d_sigprocmask='$d_sigprocmask'
24464 d_sigsetjmp='$d_sigsetjmp'
24465 d_sin6_scope_id='$d_sin6_scope_id'
24466 d_sitearch='$d_sitearch'
24467 d_snprintf='$d_snprintf'
24468 d_sockaddr_in6='$d_sockaddr_in6'
24469 d_sockaddr_sa_len='$d_sockaddr_sa_len'
24470 d_sockatmark='$d_sockatmark'
24471 d_sockatmarkproto='$d_sockatmarkproto'
24472 d_socket='$d_socket'
24473 d_socklen_t='$d_socklen_t'
24474 d_sockpair='$d_sockpair'
24475 d_socks5_init='$d_socks5_init'
24477 d_srand48_r='$d_srand48_r'
24478 d_srandom_r='$d_srandom_r'
24479 d_sresgproto='$d_sresgproto'
24480 d_sresuproto='$d_sresuproto'
24482 d_statblks='$d_statblks'
24483 d_statfs_f_flags='$d_statfs_f_flags'
24484 d_statfs_s='$d_statfs_s'
24485 d_static_inline='$d_static_inline'
24486 d_statvfs='$d_statvfs'
24487 d_stdio_cnt_lval='$d_stdio_cnt_lval'
24488 d_stdio_ptr_lval='$d_stdio_ptr_lval'
24489 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
24490 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
24491 d_stdio_stream_array='$d_stdio_stream_array'
24492 d_stdiobase='$d_stdiobase'
24493 d_stdstdio='$d_stdstdio'
24494 d_strcoll='$d_strcoll'
24495 d_strerror_l='$d_strerror_l'
24496 d_strerror_r='$d_strerror_r'
24497 d_strftime='$d_strftime'
24498 d_strlcat='$d_strlcat'
24499 d_strlcpy='$d_strlcpy'
24500 d_strnlen='$d_strnlen'
24501 d_strtod='$d_strtod'
24502 d_strtod_l='$d_strtod_l'
24503 d_strtol='$d_strtol'
24504 d_strtold='$d_strtold'
24505 d_strtold_l='$d_strtold_l'
24506 d_strtoll='$d_strtoll'
24507 d_strtoq='$d_strtoq'
24508 d_strtoul='$d_strtoul'
24509 d_strtoull='$d_strtoull'
24510 d_strtouq='$d_strtouq'
24511 d_strxfrm='$d_strxfrm'
24512 d_suidsafe='$d_suidsafe'
24513 d_symlink='$d_symlink'
24514 d_syscall='$d_syscall'
24515 d_syscallproto='$d_syscallproto'
24516 d_sysconf='$d_sysconf'
24517 d_sysernlst='$d_sysernlst'
24518 d_syserrlst='$d_syserrlst'
24519 d_system='$d_system'
24520 d_tcgetpgrp='$d_tcgetpgrp'
24521 d_tcsetpgrp='$d_tcsetpgrp'
24522 d_telldir='$d_telldir'
24523 d_telldirproto='$d_telldirproto'
24524 d_tgamma='$d_tgamma'
24525 d_thread_safe_nl_langinfo_l='$d_thread_safe_nl_langinfo_l'
24527 d_timegm='$d_timegm'
24529 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
24530 d_tm_tm_zone='$d_tm_tm_zone'
24531 d_tmpnam_r='$d_tmpnam_r'
24532 d_towlower='$d_towlower'
24533 d_towupper='$d_towupper'
24535 d_truncate='$d_truncate'
24536 d_truncl='$d_truncl'
24537 d_ttyname_r='$d_ttyname_r'
24538 d_tzname='$d_tzname'
24539 d_u32align='$d_u32align'
24540 d_ualarm='$d_ualarm'
24543 d_union_semun='$d_union_semun'
24544 d_unlinkat='$d_unlinkat'
24545 d_unordered='$d_unordered'
24546 d_unsetenv='$d_unsetenv'
24547 d_uselocale='$d_uselocale'
24548 d_usleep='$d_usleep'
24549 d_usleepproto='$d_usleepproto'
24551 d_vendorarch='$d_vendorarch'
24552 d_vendorbin='$d_vendorbin'
24553 d_vendorlib='$d_vendorlib'
24554 d_vendorscript='$d_vendorscript'
24556 d_void_closedir='$d_void_closedir'
24557 d_voidsig='$d_voidsig'
24558 d_voidtty='$d_voidtty'
24559 d_vsnprintf='$d_vsnprintf'
24561 d_waitpid='$d_waitpid'
24562 d_wcscmp='$d_wcscmp'
24563 d_wcstombs='$d_wcstombs'
24564 d_wcsxfrm='$d_wcsxfrm'
24565 d_wctomb='$d_wctomb'
24566 d_writev='$d_writev'
24569 db_hashtype='$db_hashtype'
24570 db_prefixtype='$db_prefixtype'
24571 db_version_major='$db_version_major'
24572 db_version_minor='$db_version_minor'
24573 db_version_patch='$db_version_patch'
24574 default_inc_excludes_dot='$default_inc_excludes_dot'
24575 direntrytype='$direntrytype'
24578 doubleinfbytes='$doubleinfbytes'
24579 doublekind='$doublekind'
24580 doublemantbits='$doublemantbits'
24581 doublenanbytes='$doublenanbytes'
24582 doublesize='$doublesize'
24584 drand48_r_proto='$drand48_r_proto'
24586 dtraceobject='$dtraceobject'
24587 dtracexnolibs='$dtracexnolibs'
24588 dynamic_ext='$dynamic_ext'
24594 endgrent_r_proto='$endgrent_r_proto'
24595 endhostent_r_proto='$endhostent_r_proto'
24596 endnetent_r_proto='$endnetent_r_proto'
24597 endprotoent_r_proto='$endprotoent_r_proto'
24598 endpwent_r_proto='$endpwent_r_proto'
24599 endservent_r_proto='$endservent_r_proto'
24600 eunicefix='$eunicefix'
24603 extensions='$extensions'
24604 extern_C='$extern_C'
24606 fflushNULL='$fflushNULL'
24607 fflushall='$fflushall'
24609 firstmakefile='$firstmakefile'
24611 fpossize='$fpossize'
24612 fpostype='$fpostype'
24613 freetype='$freetype'
24616 full_csh='$full_csh'
24617 full_sed='$full_sed'
24618 gccansipedantic='$gccansipedantic'
24619 gccosandvers='$gccosandvers'
24620 gccversion='$gccversion'
24621 getgrent_r_proto='$getgrent_r_proto'
24622 getgrgid_r_proto='$getgrgid_r_proto'
24623 getgrnam_r_proto='$getgrnam_r_proto'
24624 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
24625 gethostbyname_r_proto='$gethostbyname_r_proto'
24626 gethostent_r_proto='$gethostent_r_proto'
24627 getlogin_r_proto='$getlogin_r_proto'
24628 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
24629 getnetbyname_r_proto='$getnetbyname_r_proto'
24630 getnetent_r_proto='$getnetent_r_proto'
24631 getprotobyname_r_proto='$getprotobyname_r_proto'
24632 getprotobynumber_r_proto='$getprotobynumber_r_proto'
24633 getprotoent_r_proto='$getprotoent_r_proto'
24634 getpwent_r_proto='$getpwent_r_proto'
24635 getpwnam_r_proto='$getpwnam_r_proto'
24636 getpwuid_r_proto='$getpwuid_r_proto'
24637 getservbyname_r_proto='$getservbyname_r_proto'
24638 getservbyport_r_proto='$getservbyport_r_proto'
24639 getservent_r_proto='$getservent_r_proto'
24640 getspnam_r_proto='$getspnam_r_proto'
24641 gidformat='$gidformat'
24647 gmtime_r_proto='$gmtime_r_proto'
24648 gnulibc_version='$gnulibc_version'
24650 groupcat='$groupcat'
24651 groupstype='$groupstype'
24654 h_sysfile='$h_sysfile'
24657 hostgenerate='$hostgenerate'
24658 hostosname='$hostosname'
24659 hostperl='$hostperl'
24660 html1dir='$html1dir'
24661 html1direxp='$html1direxp'
24662 html3dir='$html3dir'
24663 html3direxp='$html3direxp'
24672 i_arpainet='$i_arpainet'
24674 i_bsdioctl='$i_bsdioctl'
24678 i_dirent='$i_dirent'
24680 i_execinfo='$i_execinfo'
24684 i_fp_class='$i_fp_class'
24686 i_gdbm_ndbm='$i_gdbm_ndbm'
24687 i_gdbmndbm='$i_gdbmndbm'
24689 i_ieeefp='$i_ieeefp'
24690 i_inttypes='$i_inttypes'
24691 i_langinfo='$i_langinfo'
24692 i_libutil='$i_libutil'
24693 i_locale='$i_locale'
24694 i_machcthr='$i_machcthr'
24695 i_malloc='$i_malloc'
24696 i_mallocmalloc='$i_mallocmalloc'
24697 i_mntent='$i_mntent'
24700 i_neterrno='$i_neterrno'
24701 i_netinettcp='$i_netinettcp'
24705 i_pthread='$i_pthread'
24707 i_quadmath='$i_quadmath'
24708 i_rpcsvcdbm='$i_rpcsvcdbm'
24710 i_shadow='$i_shadow'
24712 i_stdbool='$i_stdbool'
24713 i_stdint='$i_stdint'
24714 i_stdlib='$i_stdlib'
24715 i_sunmath='$i_sunmath'
24716 i_sysaccess='$i_sysaccess'
24717 i_sysdir='$i_sysdir'
24718 i_sysfile='$i_sysfile'
24719 i_sysfilio='$i_sysfilio'
24721 i_sysioctl='$i_sysioctl'
24722 i_syslog='$i_syslog'
24723 i_sysmman='$i_sysmman'
24724 i_sysmode='$i_sysmode'
24725 i_sysmount='$i_sysmount'
24726 i_sysndir='$i_sysndir'
24727 i_sysparam='$i_sysparam'
24728 i_syspoll='$i_syspoll'
24729 i_sysresrc='$i_sysresrc'
24730 i_syssecrt='$i_syssecrt'
24731 i_sysselct='$i_sysselct'
24732 i_syssockio='$i_syssockio'
24733 i_sysstat='$i_sysstat'
24734 i_sysstatfs='$i_sysstatfs'
24735 i_sysstatvfs='$i_sysstatvfs'
24736 i_systime='$i_systime'
24737 i_systimek='$i_systimek'
24738 i_systimes='$i_systimes'
24739 i_systypes='$i_systypes'
24740 i_sysuio='$i_sysuio'
24742 i_sysutsname='$i_sysutsname'
24743 i_sysvfs='$i_sysvfs'
24744 i_syswait='$i_syswait'
24745 i_termio='$i_termio'
24746 i_termios='$i_termios'
24748 i_unistd='$i_unistd'
24753 i_wctype='$i_wctype'
24754 i_xlocale='$i_xlocale'
24755 ignore_versioned_solibs='$ignore_versioned_solibs'
24756 inc_version_list='$inc_version_list'
24757 inc_version_list_init='$inc_version_list_init'
24761 initialinstalllocation='$initialinstalllocation'
24762 installarchlib='$installarchlib'
24763 installbin='$installbin'
24764 installhtml1dir='$installhtml1dir'
24765 installhtml3dir='$installhtml3dir'
24766 installman1dir='$installman1dir'
24767 installman3dir='$installman3dir'
24768 installprefix='$installprefix'
24769 installprefixexp='$installprefixexp'
24770 installprivlib='$installprivlib'
24771 installscript='$installscript'
24772 installsitearch='$installsitearch'
24773 installsitebin='$installsitebin'
24774 installsitehtml1dir='$installsitehtml1dir'
24775 installsitehtml3dir='$installsitehtml3dir'
24776 installsitelib='$installsitelib'
24777 installsiteman1dir='$installsiteman1dir'
24778 installsiteman3dir='$installsiteman3dir'
24779 installsitescript='$installsitescript'
24780 installstyle='$installstyle'
24781 installusrbinperl='$installusrbinperl'
24782 installvendorarch='$installvendorarch'
24783 installvendorbin='$installvendorbin'
24784 installvendorhtml1dir='$installvendorhtml1dir'
24785 installvendorhtml3dir='$installvendorhtml3dir'
24786 installvendorlib='$installvendorlib'
24787 installvendorman1dir='$installvendorman1dir'
24788 installvendorman3dir='$installvendorman3dir'
24789 installvendorscript='$installvendorscript'
24791 issymlink='$issymlink'
24792 ivdformat='$ivdformat'
24795 known_extensions='$known_extensions'
24798 ld_can_script='$ld_can_script'
24799 lddlflags='$lddlflags'
24801 ldflags_uselargefiles='$ldflags_uselargefiles'
24802 ldlibpthname='$ldlibpthname'
24809 libsdirs='$libsdirs'
24810 libsfiles='$libsfiles'
24811 libsfound='$libsfound'
24812 libspath='$libspath'
24813 libswanted='$libswanted'
24814 libswanted_uselargefiles='$libswanted_uselargefiles'
24820 localtime_r_proto='$localtime_r_proto'
24821 locincpth='$locincpth'
24822 loclibpth='$loclibpth'
24823 longdblinfbytes='$longdblinfbytes'
24824 longdblkind='$longdblkind'
24825 longdblmantbits='$longdblmantbits'
24826 longdblnanbytes='$longdblnanbytes'
24827 longdblsize='$longdblsize'
24828 longlongsize='$longlongsize'
24829 longsize='$longsize'
24833 lseeksize='$lseeksize'
24834 lseektype='$lseektype'
24838 make_set_make='$make_set_make'
24839 mallocobj='$mallocobj'
24840 mallocsrc='$mallocsrc'
24841 malloctype='$malloctype'
24843 man1direxp='$man1direxp'
24846 man3direxp='$man3direxp'
24848 mips_type='$mips_type'
24849 mistrustnm='$mistrustnm'
24851 mmaptype='$mmaptype'
24852 modetype='$modetype'
24854 multiarch='$multiarch'
24856 myarchname='$myarchname'
24857 mydomain='$mydomain'
24858 myhostname='$myhostname'
24861 need_va_copy='$need_va_copy'
24862 netdb_hlen_type='$netdb_hlen_type'
24863 netdb_host_type='$netdb_host_type'
24864 netdb_name_type='$netdb_name_type'
24865 netdb_net_type='$netdb_net_type'
24868 nm_so_opt='$nm_so_opt'
24869 nonxs_ext='$nonxs_ext'
24871 nvEUformat='$nvEUformat'
24872 nvFUformat='$nvFUformat'
24873 nvGUformat='$nvGUformat'
24874 nv_overflows_integers_at='$nv_overflows_integers_at'
24875 nv_preserves_uv_bits='$nv_preserves_uv_bits'
24876 nveformat='$nveformat'
24877 nvfformat='$nvfformat'
24878 nvgformat='$nvgformat'
24879 nvmantbits='$nvmantbits'
24882 o_nonblock='$o_nonblock'
24884 old_pthread_create_joinable='$old_pthread_create_joinable'
24885 optimize='$optimize'
24886 orderlib='$orderlib'
24889 otherlibdirs='$otherlibdirs'
24893 patchlevel='$patchlevel'
24894 path_sep='$path_sep'
24897 perl_patchlevel='$perl_patchlevel'
24898 perl_static_inline='$perl_static_inline'
24899 perladmin='$perladmin'
24900 perllibs='$perllibs'
24901 perlpath='$perlpath'
24903 phostname='$phostname'
24909 prefixexp='$prefixexp'
24911 privlibexp='$privlibexp'
24912 procselfexe='$procselfexe'
24914 quadkind='$quadkind'
24915 quadtype='$quadtype'
24916 randbits='$randbits'
24917 randfunc='$randfunc'
24918 random_r_proto='$random_r_proto'
24919 randseedtype='$randseedtype'
24921 rd_nodata='$rd_nodata'
24922 readdir64_r_proto='$readdir64_r_proto'
24923 readdir_r_proto='$readdir_r_proto'
24924 revision='$revision'
24930 sGMTIME_max='$sGMTIME_max'
24931 sGMTIME_min='$sGMTIME_min'
24932 sLOCALTIME_max='$sLOCALTIME_max'
24933 sLOCALTIME_min='$sLOCALTIME_min'
24934 sPRIEUldbl='$sPRIEUldbl'
24935 sPRIFUldbl='$sPRIFUldbl'
24936 sPRIGUldbl='$sPRIGUldbl'
24937 sPRIXU64='$sPRIXU64'
24939 sPRIeldbl='$sPRIeldbl'
24940 sPRIfldbl='$sPRIfldbl'
24941 sPRIgldbl='$sPRIgldbl'
24946 sSCNfldbl='$sSCNfldbl'
24947 sched_yield='$sched_yield'
24948 scriptdir='$scriptdir'
24949 scriptdirexp='$scriptdirexp'
24951 seedfunc='$seedfunc'
24952 selectminbits='$selectminbits'
24953 selecttype='$selecttype'
24954 sendmail='$sendmail'
24955 setgrent_r_proto='$setgrent_r_proto'
24956 sethostent_r_proto='$sethostent_r_proto'
24957 setlocale_r_proto='$setlocale_r_proto'
24958 setnetent_r_proto='$setnetent_r_proto'
24959 setprotoent_r_proto='$setprotoent_r_proto'
24960 setpwent_r_proto='$setpwent_r_proto'
24961 setservent_r_proto='$setservent_r_proto'
24964 sharpbang='$sharpbang'
24965 shmattype='$shmattype'
24966 shortsize='$shortsize'
24969 sig_count='$sig_count'
24970 sig_name='$sig_name'
24971 sig_name_init='$sig_name_init'
24973 sig_num_init='$sig_num_init'
24974 sig_size='$sig_size'
24975 signal_t='$signal_t'
24976 sitearch='$sitearch'
24977 sitearchexp='$sitearchexp'
24979 sitebinexp='$sitebinexp'
24980 sitehtml1dir='$sitehtml1dir'
24981 sitehtml1direxp='$sitehtml1direxp'
24982 sitehtml3dir='$sitehtml3dir'
24983 sitehtml3direxp='$sitehtml3direxp'
24985 sitelib_stem='$sitelib_stem'
24986 sitelibexp='$sitelibexp'
24987 siteman1dir='$siteman1dir'
24988 siteman1direxp='$siteman1direxp'
24989 siteman3dir='$siteman3dir'
24990 siteman3direxp='$siteman3direxp'
24991 siteprefix='$siteprefix'
24992 siteprefixexp='$siteprefixexp'
24993 sitescript='$sitescript'
24994 sitescriptexp='$sitescriptexp'
24995 sizesize='$sizesize'
24996 sizetype='$sizetype'
25000 sockethdr='$sockethdr'
25001 socketlib='$socketlib'
25002 socksizetype='$socksizetype'
25004 spackage='$spackage'
25005 spitshell='$spitshell'
25006 srand48_r_proto='$srand48_r_proto'
25007 srandom_r_proto='$srandom_r_proto'
25009 ssizetype='$ssizetype'
25010 st_ino_sign='$st_ino_sign'
25011 st_ino_size='$st_ino_size'
25012 startperl='$startperl'
25014 static_ext='$static_ext'
25016 stdio_base='$stdio_base'
25017 stdio_bufsiz='$stdio_bufsiz'
25018 stdio_cnt='$stdio_cnt'
25019 stdio_filbuf='$stdio_filbuf'
25020 stdio_ptr='$stdio_ptr'
25021 stdio_stream_array='$stdio_stream_array'
25022 strerror_r_proto='$strerror_r_proto'
25024 subversion='$subversion'
25029 targetarch='$targetarch'
25030 targetdir='$targetdir'
25031 targetenv='$targetenv'
25032 targethost='$targethost'
25033 targetmkdir='$targetmkdir'
25034 targetport='$targetport'
25035 targetsh='$targetsh'
25039 timeincl='$timeincl'
25040 timetype='$timetype'
25041 tmpnam_r_proto='$tmpnam_r_proto'
25047 ttyname_r_proto='$ttyname_r_proto'
25056 uidformat='$uidformat'
25062 uquadtype='$uquadtype'
25063 use5005threads='$use5005threads'
25064 use64bitall='$use64bitall'
25065 use64bitint='$use64bitint'
25066 usecbacktrace='$usecbacktrace'
25067 usecrosscompile='$usecrosscompile'
25068 usedevel='$usedevel'
25070 usedtrace='$usedtrace'
25071 usefaststdio='$usefaststdio'
25072 useithreads='$useithreads'
25073 usekernprocpathname='$usekernprocpathname'
25074 uselanginfo='$uselanginfo'
25075 uselargefiles='$uselargefiles'
25076 uselongdouble='$uselongdouble'
25077 usemallocwrap='$usemallocwrap'
25078 usemorebits='$usemorebits'
25079 usemultiplicity='$usemultiplicity'
25080 usemymalloc='$usemymalloc'
25082 usensgetexecutablepath='$usensgetexecutablepath'
25083 useopcode='$useopcode'
25084 useperlio='$useperlio'
25085 useposix='$useposix'
25086 usequadmath='$usequadmath'
25087 usereentrant='$usereentrant'
25088 userelocatableinc='$userelocatableinc'
25089 useshrplib='$useshrplib'
25090 usesitecustomize='$usesitecustomize'
25091 usesocks='$usesocks'
25092 usethreads='$usethreads'
25093 usevendorprefix='$usevendorprefix'
25094 useversionedarchname='$useversionedarchname'
25095 usevfork='$usevfork'
25098 uvXUformat='$uvXUformat'
25099 uvoformat='$uvoformat'
25102 uvuformat='$uvuformat'
25103 uvxformat='$uvxformat'
25104 vendorarch='$vendorarch'
25105 vendorarchexp='$vendorarchexp'
25106 vendorbin='$vendorbin'
25107 vendorbinexp='$vendorbinexp'
25108 vendorhtml1dir='$vendorhtml1dir'
25109 vendorhtml1direxp='$vendorhtml1direxp'
25110 vendorhtml3dir='$vendorhtml3dir'
25111 vendorhtml3direxp='$vendorhtml3direxp'
25112 vendorlib='$vendorlib'
25113 vendorlib_stem='$vendorlib_stem'
25114 vendorlibexp='$vendorlibexp'
25115 vendorman1dir='$vendorman1dir'
25116 vendorman1direxp='$vendorman1direxp'
25117 vendorman3dir='$vendorman3dir'
25118 vendorman3direxp='$vendorman3direxp'
25119 vendorprefix='$vendorprefix'
25120 vendorprefixexp='$vendorprefixexp'
25121 vendorscript='$vendorscript'
25122 vendorscriptexp='$vendorscriptexp'
25124 version_patchlevel_string='$version_patchlevel_string'
25125 versiononly='$versiononly'
25129 yaccflags='$yaccflags'
25134 : add special variables
25135 $test -f $src/patchlevel.h && \
25136 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
25137 echo "PERL_PATCHLEVEL='$perl_patchlevel'" >>config.sh
25138 echo "PERL_CONFIG_SH=true" >>config.sh
25140 : propagate old symbols
25141 if $test -f UU/config.sh; then
25142 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
25143 $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \
25144 config.sh config.sh UU/oldconfig.sh |\
25145 $sort | $uniq -u >UU/oldsyms
25146 set X `$cat UU/oldsyms`
25152 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
25154 echo ": Variables propagated from previous config.sh file." >>config.sh
25155 for sym in `$cat UU/oldsyms`; do
25156 echo " Propagating $hint variable "'$'"$sym..."
25157 eval 'tmp="$'"${sym}"'"'
25159 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
25165 : preserve RCS keywords in files with variable substitution, grrr
25168 : Finish up by extracting the .SH files
25171 echo "Stopping at your request, leaving temporary files around."
25181 If you'd like to make any changes to the config.sh file before I begin
25182 to configure things, do it as a shell escape now (e.g. !vi config.sh).
25185 rp="Press return or use a shell escape to edit config.sh:"
25190 *) : in case they cannot read
25191 sh 1>&4 -c "$ans";;
25196 : if this fails, just run all the .SH files by hand
25205 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
25212 Now you need to generate make dependencies by running "$make depend".
25213 You might prefer to run it in background: "$make depend > makedepend.out &"
25214 It can take a while, so you might not want to run it right now.
25219 rp="Run $make depend now?"
25223 $make depend && echo "Now you must run '$make'."
25226 echo "You must run '$make depend' then '$make'."
25229 elif test -f [Mm]akefile; then
25231 echo "Now you must run a $make."
25233 echo "Configure done."
25236 if $test -f Policy.sh; then
25239 If you compile $package on a different machine or from a different object
25240 directory, copy the Policy.sh file from this object directory to the
25241 new one before you run Configure -- this will help you with most of
25242 the policy defaults.
25246 if $test -f UU/config.msg; then
25247 echo "Hmm. I also noted the following information while running:"
25249 $cat UU/config.msg >&4
25251 $rm -f kit*isdone ark*isdone